From 9d298a13a1edee38a6d9a30fab153cfca6ac44f6 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Mon, 20 Nov 2017 16:43:02 -0800 Subject: [PATCH 001/298] [WIP] enable updating ATA files --- src/compiler/types.ts | 10 --- src/harness/unittests/typingsInstaller.ts | 6 +- src/server/types.ts | 1 + .../typingsInstaller/nodeTypingsInstaller.ts | 2 +- .../typingsInstaller/typingsInstaller.ts | 86 +++++++++++++++++-- src/services/jsTyping.ts | 21 +++-- src/services/shims.ts | 10 +++ .../reference/api/tsserverlibrary.d.ts | 9 -- tests/baselines/reference/api/typescript.d.ts | 9 -- 9 files changed, 112 insertions(+), 42 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 23798635671..673db399d0d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3999,16 +3999,6 @@ namespace ts { [option: string]: string[] | boolean | undefined; } - export interface DiscoverTypingsInfo { - fileNames: string[]; // The file names that belong to the same project. - projectRootPath: string; // The path to the project root directory - safeListPath: string; // The path used to retrieve the safe list - packageNameToTypingLocation: Map; // The map of package names to their cached typing locations - typeAcquisition: TypeAcquisition; // Used to customize the type acquisition process - compilerOptions: CompilerOptions; // Used as a source for typing inference - unresolvedImports: ReadonlyArray; // List of unresolved module ids from imports - } - export enum ModuleKind { None = 0, CommonJS = 1, diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index a84520095a4..5c2f8758916 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1148,7 +1148,7 @@ namespace ts.projectSystem { content: "" }; const host = createServerHost([f]); - const cache = createMap(); + const cache = createMap(); for (const name of JsTyping.nodeCoreModuleList) { const logger = trackingLogger(); @@ -1171,7 +1171,7 @@ namespace ts.projectSystem { content: "" }; const host = createServerHost([f, node]); - const cache = createMapFromTemplate({ node: node.path }); + const cache = createMapFromTemplate({ node: { typingLocation: node.path, timestamp: Date.now() } }); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, ["fs", "bar"]); assert.deepEqual(logger.finish(), [ @@ -1196,7 +1196,7 @@ namespace ts.projectSystem { content: JSON.stringify({ name: "b" }), }; const host = createServerHost([app, a, b]); - const cache = createMap(); + const cache = createMap(); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, /*unresolvedImports*/ []); assert.deepEqual(logger.finish(), [ diff --git a/src/server/types.ts b/src/server/types.ts index 32132ed278b..69b1dae0d7c 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -128,5 +128,6 @@ declare namespace ts.server { writeFile(path: string, content: string): void; createDirectory(path: string): void; watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; + getModifiedTime?(path: string): Date; } } \ No newline at end of file diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index 36f5adab400..378708a4a81 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -185,7 +185,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`#${requestId} with arguments'${JSON.stringify(packageNames)}'.`); } - const command = `${this.npmPath} install --ignore-scripts ${packageNames.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`; + const command = `${this.npmPath} install@latest --ignore-scripts ${packageNames.join(" ")} --save-dev --force --user-agent="typesInstaller/${version}"`; const start = Date.now(); const hasError = this.execSyncAndLog(command, { cwd }); if (this.log.isEnabled()) { diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 283770d1dc8..fe629b353b7 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -41,13 +41,74 @@ namespace ts.server.typingsInstaller { onRequestCompleted: RequestCompletedAction; } + interface TypeDeclarationTimestampFile { + entries: MapLike; + } + + function loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, host: InstallTypingHost, log: Log): Map { + const fileExists = host.fileExists(typeDeclarationTimestampFilePath); + if (!fileExists) { + if (log.isEnabled()) { + log.writeLine(`Type declaration timestamp file '${typeDeclarationTimestampFilePath}' does not exist`); + } + } + try { + if (fileExists) { + const content = JSON.parse(host.readFile(typeDeclarationTimestampFilePath)); + return createMapFromTemplate(content.entries); + } + else { + host.writeFile(typeDeclarationTimestampFilePath, "{}"); + if (log.isEnabled()) { + log.writeLine("Type declaration timestamp file was created."); + } + return createMap(); + } + } + catch (e) { + if (log.isEnabled()) { + log.writeLine(`Error when loading type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); + } + return createMap(); + } + } + + function writeTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, newContents: TypeDeclarationTimestampFile, host: InstallTypingHost, log: Log): void { + const fileExists = host.fileExists(typeDeclarationTimestampFilePath); + if (!fileExists) { + if (log.isEnabled()) { + log.writeLine(`Type declaration timestamp file '${typeDeclarationTimestampFilePath}' does not exist`); + } + } + try { + if (fileExists) { + host.writeFile(typeDeclarationTimestampFilePath, JSON.stringify(newContents)); + return; + } + else { + host.writeFile(typeDeclarationTimestampFilePath, JSON.stringify(newContents)); + if (log.isEnabled()) { + log.writeLine("Type declaration time stamp file was created."); + } + return; + } + } + catch (e) { + if (log.isEnabled()) { + log.writeLine(`Error when writing new type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); + } + return; + } + } + export abstract class TypingsInstaller { - private readonly packageNameToTypingLocation: Map = createMap(); + private readonly packageNameToTypingLocation: Map = createMap(); private readonly missingTypingsSet: Map = createMap(); private readonly knownCachesSet: Map = createMap(); private readonly projectWatchers: Map = createMap(); private safeList: JsTyping.SafeList | undefined; readonly pendingRunRequests: PendingRequest[] = []; + private typeDeclarationTimestamps: Map = createMap(); private installRunCount = 1; private inFlightRequestCount = 0; @@ -162,6 +223,8 @@ namespace ts.server.typingsInstaller { } return; } + const timestampJson = combinePaths(cacheLocation, "timestamps.json"); + this.typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampJson, this.installTypingHost, this.log); const packageJson = combinePaths(cacheLocation, "package.json"); if (this.log.isEnabled()) { this.log.writeLine(`Trying to find '${packageJson}'...`); @@ -184,7 +247,7 @@ namespace ts.server.typingsInstaller { continue; } const existingTypingFile = this.packageNameToTypingLocation.get(packageName); - if (existingTypingFile === typingFile) { + if (existingTypingFile.typingLocation === typingFile) { continue; } if (existingTypingFile) { @@ -195,7 +258,15 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); } - this.packageNameToTypingLocation.set(packageName, typingFile); + if (this.typeDeclarationTimestamps.get(key) === undefined) { + // getModifiedTime is only undefined if we were to use the ChakraHost, but we never do in this scenario + // defaults to old behavior of never updating if we ever use a host without getModifiedTime in the future + const timestamp = this.installTypingHost.getModifiedTime === undefined ? Date.now() : this.installTypingHost.getModifiedTime(typingFile).getTime(); + this.typeDeclarationTimestamps.set(key, timestamp); + } + // timestamp guaranteed to not be undefined by above check + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: this.typeDeclarationTimestamps.get(key) }; + this.packageNameToTypingLocation.set(packageName, newTyping); } } } @@ -211,7 +282,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) this.log.writeLine(`'${typing}' is in missingTypingsSet - skipping...`); return false; } - if (this.packageNameToTypingLocation.get(typing)) { + if (this.packageNameToTypingLocation.get(typing) && !JsTyping.isTypingExpired(this.packageNameToTypingLocation.get(typing))) { if (this.log.isEnabled()) this.log.writeLine(`'${typing}' already has a typing - skipping...`); return false; } @@ -295,7 +366,9 @@ namespace ts.server.typingsInstaller { continue; } if (!this.packageNameToTypingLocation.has(packageName)) { - this.packageNameToTypingLocation.set(packageName, typingFile); + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: Date.now() }; + this.packageNameToTypingLocation.set(packageName, newTyping); + this.typeDeclarationTimestamps.set(packageName, Date.now()); } installedTypingFiles.push(typingFile); } @@ -303,6 +376,9 @@ namespace ts.server.typingsInstaller { this.log.writeLine(`Installed typing files ${JSON.stringify(installedTypingFiles)}`); } + const newFileContents: TypeDeclarationTimestampFile = { entries: this.typeDeclarationTimestamps }; + writeTypeDeclarationTimestampFile(cachePath, newFileContents, this.installTypingHost, this.log); // WRONG PATH + this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } finally { diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 1c2f87fa428..85660a03368 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -26,6 +26,17 @@ namespace ts.JsTyping { typings?: string; } + export interface CachedTyping { + typingLocation: string; + timestamp: number; + } + + const typingLifetime = new Date(0, 1); + + export function isTypingExpired(typing: JsTyping.CachedTyping | undefined) { + return typing && Date.now() - typingLifetime.getTime() < typing.timestamp; + } + /* @internal */ export const nodeCoreModuleList: ReadonlyArray = [ "buffer", "querystring", "events", "http", "cluster", @@ -60,7 +71,7 @@ namespace ts.JsTyping { * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and time of caching * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ @@ -70,7 +81,7 @@ namespace ts.JsTyping { fileNames: string[], projectRootPath: Path, safeList: SafeList, - packageNameToTypingLocation: ReadonlyMap, + packageNameToTypingLocation: ReadonlyMap, typeAcquisition: TypeAcquisition, unresolvedImports: ReadonlyArray): { cachedTypingPaths: string[], newTypingNames: string[], filesToWatch: string[] } { @@ -122,9 +133,9 @@ namespace ts.JsTyping { addInferredTypings(module, "Inferred typings from unresolved imports"); } // Add the cached typing locations for inferred typings that are already installed - packageNameToTypingLocation.forEach((typingLocation, name) => { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); + packageNameToTypingLocation.forEach((typing, name) => { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && !isTypingExpired(typing)) { + inferredTypings.set(name, typing.typingLocation); } }); diff --git a/src/services/shims.ts b/src/services/shims.ts index fda698785b3..d4bad1908e9 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -24,6 +24,16 @@ let debugObjectHost: { CollectGarbage(): void } = (function (this: any) { return /* @internal */ namespace ts { + interface DiscoverTypingsInfo { + fileNames: string[]; // The file names that belong to the same project. + projectRootPath: string; // The path to the project root directory + safeListPath: string; // The path used to retrieve the safe list + packageNameToTypingLocation: Map; // The map of package names to their cached typing locations + typeAcquisition: TypeAcquisition; // Used to customize the type acquisition process + compilerOptions: CompilerOptions; // Used as a source for typing inference + unresolvedImports: ReadonlyArray; // List of unresolved module ids from imports + } + export interface ScriptSnapshotShim { /** Gets a portion of the script snapshot specified by [start, end). */ getText(start: number, end: number): string; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 3eabea4435a..d5a5c7a1a72 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2308,15 +2308,6 @@ declare namespace ts { exclude?: string[]; [option: string]: string[] | boolean | undefined; } - interface DiscoverTypingsInfo { - fileNames: string[]; - projectRootPath: string; - safeListPath: string; - packageNameToTypingLocation: Map; - typeAcquisition: TypeAcquisition; - compilerOptions: CompilerOptions; - unresolvedImports: ReadonlyArray; - } enum ModuleKind { None = 0, CommonJS = 1, diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 630b7a08a28..fef3baf9e36 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2308,15 +2308,6 @@ declare namespace ts { exclude?: string[]; [option: string]: string[] | boolean | undefined; } - interface DiscoverTypingsInfo { - fileNames: string[]; - projectRootPath: string; - safeListPath: string; - packageNameToTypingLocation: Map; - typeAcquisition: TypeAcquisition; - compilerOptions: CompilerOptions; - unresolvedImports: ReadonlyArray; - } enum ModuleKind { None = 0, CommonJS = 1, From ee5e8e3eee90bb975c3a952abb560472527df61e Mon Sep 17 00:00:00 2001 From: Benjamin Lichtman Date: Mon, 27 Nov 2017 23:29:10 -0500 Subject: [PATCH 002/298] Ensure proper JSON writing behavior of timestamps --- .../typingsInstaller/typingsInstaller.ts | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index fe629b353b7..a3b96a4e02e 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -45,7 +45,7 @@ namespace ts.server.typingsInstaller { entries: MapLike; } - function loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, host: InstallTypingHost, log: Log): Map { + function loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, host: InstallTypingHost, log: Log): MapLike { const fileExists = host.fileExists(typeDeclarationTimestampFilePath); if (!fileExists) { if (log.isEnabled()) { @@ -55,21 +55,21 @@ namespace ts.server.typingsInstaller { try { if (fileExists) { const content = JSON.parse(host.readFile(typeDeclarationTimestampFilePath)); - return createMapFromTemplate(content.entries); + return content.entries; } else { host.writeFile(typeDeclarationTimestampFilePath, "{}"); if (log.isEnabled()) { log.writeLine("Type declaration timestamp file was created."); } - return createMap(); + return {}; } } catch (e) { if (log.isEnabled()) { log.writeLine(`Error when loading type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); } - return createMap(); + return {}; } } @@ -108,7 +108,7 @@ namespace ts.server.typingsInstaller { private readonly projectWatchers: Map = createMap(); private safeList: JsTyping.SafeList | undefined; readonly pendingRunRequests: PendingRequest[] = []; - private typeDeclarationTimestamps: Map = createMap(); + private typeDeclarationTimestamps: MapLike = {}; private installRunCount = 1; private inFlightRequestCount = 0; @@ -258,14 +258,14 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); } - if (this.typeDeclarationTimestamps.get(key) === undefined) { + if (getProperty(this.typeDeclarationTimestamps, key) === undefined) { // getModifiedTime is only undefined if we were to use the ChakraHost, but we never do in this scenario // defaults to old behavior of never updating if we ever use a host without getModifiedTime in the future const timestamp = this.installTypingHost.getModifiedTime === undefined ? Date.now() : this.installTypingHost.getModifiedTime(typingFile).getTime(); - this.typeDeclarationTimestamps.set(key, timestamp); + this.typeDeclarationTimestamps[key] = timestamp; } // timestamp guaranteed to not be undefined by above check - const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: this.typeDeclarationTimestamps.get(key) }; + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: getProperty(this.typeDeclarationTimestamps, key) }; this.packageNameToTypingLocation.set(packageName, newTyping); } } @@ -365,11 +365,11 @@ namespace ts.server.typingsInstaller { this.missingTypingsSet.set(packageName, true); continue; } - if (!this.packageNameToTypingLocation.has(packageName)) { - const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: Date.now() }; - this.packageNameToTypingLocation.set(packageName, newTyping); - this.typeDeclarationTimestamps.set(packageName, Date.now()); - } + + const newTimestamp = Date.now(); + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: newTimestamp }; + this.packageNameToTypingLocation.set(packageName, newTyping); + this.typeDeclarationTimestamps[packageName] = newTimestamp; installedTypingFiles.push(typingFile); } if (this.log.isEnabled()) { From b0321dc177dffae1bbd7ff020386ee648189b47c Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 29 Dec 2017 14:21:55 -0800 Subject: [PATCH 003/298] Refactor to avoid errors --- src/server/typingsInstaller/typingsInstaller.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index a3b96a4e02e..22982b60075 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -55,7 +55,7 @@ namespace ts.server.typingsInstaller { try { if (fileExists) { const content = JSON.parse(host.readFile(typeDeclarationTimestampFilePath)); - return content.entries; + return content.entries || {}; } else { host.writeFile(typeDeclarationTimestampFilePath, "{}"); @@ -247,10 +247,11 @@ namespace ts.server.typingsInstaller { continue; } const existingTypingFile = this.packageNameToTypingLocation.get(packageName); - if (existingTypingFile.typingLocation === typingFile) { - continue; - } if (existingTypingFile) { + if (existingTypingFile.typingLocation === typingFile) { + continue; + } + if (this.log.isEnabled()) { this.log.writeLine(`New typing for package ${packageName} from '${typingFile}' conflicts with existing typing file '${existingTypingFile}'`); } From bf4ec1df5ae468a3a8e0b3269d6b461e81656526 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Tue, 2 Jan 2018 16:29:39 -0800 Subject: [PATCH 004/298] Fix timestamp writing, npm install, and cache behavior --- src/server/typingsInstaller/nodeTypingsInstaller.ts | 2 +- src/server/typingsInstaller/typingsInstaller.ts | 13 ++++++++++--- src/services/jsTyping.ts | 12 +++++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index 378708a4a81..36f5adab400 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -185,7 +185,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`#${requestId} with arguments'${JSON.stringify(packageNames)}'.`); } - const command = `${this.npmPath} install@latest --ignore-scripts ${packageNames.join(" ")} --save-dev --force --user-agent="typesInstaller/${version}"`; + const command = `${this.npmPath} install --ignore-scripts ${packageNames.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`; const start = Date.now(); const hasError = this.execSyncAndLog(command, { cwd }); if (this.log.isEnabled()) { diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 22982b60075..cf441017de9 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -19,6 +19,8 @@ namespace ts.server.typingsInstaller { writeLine: noop }; + const timestampsFile = "timestamps.json"; + function typingToFileName(cachePath: string, packageName: string, installTypingHost: InstallTypingHost, log: Log): string { try { const result = resolveModuleName(packageName, combinePaths(cachePath, "index.d.ts"), { moduleResolution: ModuleResolutionKind.NodeJs }, installTypingHost); @@ -223,7 +225,7 @@ namespace ts.server.typingsInstaller { } return; } - const timestampJson = combinePaths(cacheLocation, "timestamps.json"); + const timestampJson = combinePaths(cacheLocation, timestampsFile); this.typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampJson, this.installTypingHost, this.log); const packageJson = combinePaths(cacheLocation, "package.json"); if (this.log.isEnabled()) { @@ -264,6 +266,9 @@ namespace ts.server.typingsInstaller { // defaults to old behavior of never updating if we ever use a host without getModifiedTime in the future const timestamp = this.installTypingHost.getModifiedTime === undefined ? Date.now() : this.installTypingHost.getModifiedTime(typingFile).getTime(); this.typeDeclarationTimestamps[key] = timestamp; + if (this.log.isEnabled()) { + this.log.writeLine(`Adding entry into timestamp cache: '${key}' => '${timestamp}'`); + } } // timestamp guaranteed to not be undefined by above check const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: getProperty(this.typeDeclarationTimestamps, key) }; @@ -360,6 +365,7 @@ namespace ts.server.typingsInstaller { this.log.writeLine(`Installed typings ${JSON.stringify(scopedTypings)}`); } const installedTypingFiles: string[] = []; + const typesPackageName = (packageName: string) => `@types/${packageName}`; for (const packageName of filteredTypings) { const typingFile = typingToFileName(cachePath, packageName, this.installTypingHost, this.log); if (!typingFile) { @@ -370,7 +376,7 @@ namespace ts.server.typingsInstaller { const newTimestamp = Date.now(); const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: newTimestamp }; this.packageNameToTypingLocation.set(packageName, newTyping); - this.typeDeclarationTimestamps[packageName] = newTimestamp; + this.typeDeclarationTimestamps[typesPackageName(packageName)] = newTimestamp; installedTypingFiles.push(typingFile); } if (this.log.isEnabled()) { @@ -378,7 +384,8 @@ namespace ts.server.typingsInstaller { } const newFileContents: TypeDeclarationTimestampFile = { entries: this.typeDeclarationTimestamps }; - writeTypeDeclarationTimestampFile(cachePath, newFileContents, this.installTypingHost, this.log); // WRONG PATH + const timestampJson = combinePaths(cachePath, timestampsFile); + writeTypeDeclarationTimestampFile(timestampJson, newFileContents, this.installTypingHost, this.log); this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 85660a03368..b26b2a00a84 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -31,10 +31,16 @@ namespace ts.JsTyping { timestamp: number; } - const typingLifetime = new Date(0, 1); - export function isTypingExpired(typing: JsTyping.CachedTyping | undefined) { - return typing && Date.now() - typingLifetime.getTime() < typing.timestamp; + const comparisonDate = new Date(); + const currentMonth = comparisonDate.getMonth(); + if (currentMonth) { + comparisonDate.setMonth(11); + comparisonDate.setFullYear(comparisonDate.getFullYear() - 1); + } else { + comparisonDate.setMonth(currentMonth - 1); + } + return !typing || typing.timestamp < comparisonDate.getTime(); } /* @internal */ From 0b47a2dcfe58cca0dcddb9572a7969ef52ad42e5 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 4 Jan 2018 10:24:37 -0800 Subject: [PATCH 005/298] Add tests --- .../unittests/tsserverProjectSystem.ts | 6 +- src/harness/unittests/typingsInstaller.ts | 161 +++++++++++++++++- src/harness/virtualFileSystemWithWatch.ts | 8 +- src/services/jsTyping.ts | 3 +- 4 files changed, 171 insertions(+), 7 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index fe7a2095b86..74981bbac35 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -243,9 +243,11 @@ namespace ts.projectSystem { } } - export function createSession(host: server.ServerHost, opts: Partial = {}) { + export function createSession(host: TestServerHost, opts: Partial = {}) { if (opts.typingsInstaller === undefined) { - opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/ 5, host); + const globalTypingsCacheLocation = "/a/data"; + host.ensureFileOrFolder({ path: globalTypingsCacheLocation }); + opts.typingsInstaller = new TestTypingsInstaller(globalTypingsCacheLocation, /*throttleLimit*/ 5, host); } if (opts.eventHandler !== undefined) { diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 5c2f8758916..bdb96c2ec9c 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -22,7 +22,8 @@ namespace ts.projectSystem { } class Installer extends TestTypingsInstaller { - constructor(host: server.ServerHost, p?: InstallerParams, log?: TI.Log) { + constructor(host: TestServerHost, p?: InstallerParams, log?: TI.Log) { + host.ensureFileOrFolder({ path: (p && p.globalTypingsCacheLocation) || "/a/data" }); super( (p && p.globalTypingsCacheLocation) || "/a/data", (p && p.throttleLimit) || 5, @@ -1053,6 +1054,132 @@ namespace ts.projectSystem { const version2 = proj.getCachedUnresolvedImportsPerFile_TestOnly().getVersion(); assert.notEqual(version1, version2, "set of unresolved imports should change"); }); + + it("expired cache entry (inferred project, should install typings)", () => { + const file1 = { + path: "/a/b/app.js", + content: "" + }; + const packageJson = { + path: "/a/b/package.json", + content: JSON.stringify({ + name: "test", + dependencies: { + jquery: "^3.1.0" + } + }) + }; + const date = new Date(); + date.setFullYear(date.getFullYear() - 1); + const timestamps = { + path: "/a/data/timestamps.json", + content: JSON.stringify({ + entries: { + "@types/jquery": date.getTime() + } + }) + }; + const jquery = { + path: "/a/data/node_modules/@types/jquery/index.d.ts", + content: "declare const $: { x: number }" + }; + const cacheConfig = { + path: "/a/data/package.json", + content: JSON.stringify({ + dependencies: { + "types-registry": "^0.1.317" + }, + devDependencies: { + "@types/jquery": "^3.2.16" + } + }) + }; + const host = createServerHost([file1, packageJson, jquery, timestamps, cacheConfig]); + const installer = new (class extends Installer { + constructor() { + super(host, { typesRegistry: createTypesRegistry("jquery") }); + } + installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { + const installedTypings = ["@types/jquery"]; + const typingFiles = [jquery]; + executeCommand(this, host, installedTypings, typingFiles, cb); + } + })(); + + const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); + projectService.openClientFile(file1.path); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const p = projectService.inferredProjects[0]; + checkProjectActualFiles(p, [file1.path]); + + installer.installAll(/*expectedCount*/ 1); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(p, [file1.path, jquery.path]); + }); + + it("non-expired cache entry (inferred project, should not install typings)", () => { + const file1 = { + path: "/a/b/app.js", + content: "" + }; + const packageJson = { + path: "/a/b/package.json", + content: JSON.stringify({ + name: "test", + dependencies: { + jquery: "^3.1.0" + } + }) + }; + const timestamps = { + path: "/a/data/timestamps.json", + content: JSON.stringify({ + entries: { + "@types/jquery": Date.now() + } + }) + }; + const cacheConfig = { + path: "/a/data/package.json", + content: JSON.stringify({ + dependencies: { + "types-registry": "^0.1.317" + }, + devDependencies: { + "@types/jquery": "^3.2.16" + } + }) + }; + const jquery = { + path: "/a/data/node_modules/@types/jquery/index.d.ts", + content: "declare const $: { x: number }" + }; + const host = createServerHost([file1, packageJson, timestamps, cacheConfig, jquery]); + const installer = new (class extends Installer { + constructor() { + super(host, { typesRegistry: createTypesRegistry("jquery") }); + } + installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { + const installedTypings: string[] = []; + const typingFiles: FileOrFolder[] = []; + executeCommand(this, host, installedTypings, typingFiles, cb); + } + })(); + + const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); + projectService.openClientFile(file1.path); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const p = projectService.inferredProjects[0]; + checkProjectActualFiles(p, [file1.path]); + + installer.installAll(/*expectedCount*/ 0); + + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(p, [file1.path]); + }); }); describe("Validate package name:", () => { @@ -1211,6 +1338,38 @@ namespace ts.projectSystem { filesToWatch: ["/bower_components", "/node_modules"], }); }); + + it("should install expired typings", () => { + const date = new Date(); + date.setFullYear(date.getFullYear() - 1); + + const app = { + path: "/a/app.js", + content: "" + }; + const cachePath = "/a/cache/"; + const commander = { + path: cachePath + "node_modules/@types/commander/index.d.ts", + content: "export let x: number" + }; + const node = { + path: cachePath + "node_modules/@types/node/index.d.ts", + content: "export let y: number" + }; + const host = createServerHost([app]); + const cache = createMapFromTemplate({ + node: { typingLocation: node.path, timestamp: Date.now() }, + commander: { typingLocation: commander.path, timestamp: date.getTime() } + }); + const logger = trackingLogger(); + const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http", "commander"]); + assert.deepEqual(logger.finish(), [ + 'Inferred typings from unresolved imports: ["node","commander"]', + 'Result: {"cachedTypingPaths":["/a/cache/node_modules/@types/node/index.d.ts"],"newTypingNames":["commander"],"filesToWatch":["/a/bower_components","/a/node_modules"]}', + ]); + assert.deepEqual(result.cachedTypingPaths, [node.path]); + assert.deepEqual(result.newTypingNames, ["commander"]); + }); }); describe("telemetry events", () => { diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 921d4674231..06e1b45a688 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -383,9 +383,11 @@ interface Array {}` ensureFileOrFolder(fileOrDirectory: FileOrFolder, ignoreWatchInvokedWithTriggerAsFileCreate?: boolean) { if (isString(fileOrDirectory.content)) { const file = this.toFile(fileOrDirectory); - Debug.assert(!this.fs.get(file.path)); - const baseFolder = this.ensureFolder(getDirectoryPath(file.fullPath)); - this.addFileOrFolderInFolder(baseFolder, file, ignoreWatchInvokedWithTriggerAsFileCreate); + // file may already exist when updating existing type declaration file + if (!this.fs.get(file.path)) { + const baseFolder = this.ensureFolder(getDirectoryPath(file.fullPath)); + this.addFileOrFolderInFolder(baseFolder, file, ignoreWatchInvokedWithTriggerAsFileCreate); + } } else { const fullPath = getNormalizedAbsolutePath(fileOrDirectory.path, this.currentDirectory); diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index b26b2a00a84..f636de25313 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -37,7 +37,8 @@ namespace ts.JsTyping { if (currentMonth) { comparisonDate.setMonth(11); comparisonDate.setFullYear(comparisonDate.getFullYear() - 1); - } else { + } + else { comparisonDate.setMonth(currentMonth - 1); } return !typing || typing.timestamp < comparisonDate.getTime(); From 4c32ac010c5801529727ecbfc79eacc4b21b94b8 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 4 Jan 2018 11:05:39 -0800 Subject: [PATCH 006/298] Add test for timestamps write --- src/harness/unittests/typingsInstaller.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index bdb96c2ec9c..fb82a17b965 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1,6 +1,10 @@ /// /// -/// +/// import { deepEqual } from "assert";import { deepEqual } from "assert"; + + + + namespace ts.projectSystem { import TI = server.typingsInstaller; @@ -1117,6 +1121,7 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { inferredProjects: 1 }); checkProjectActualFiles(p, [file1.path, jquery.path]); + assert(host.readFile(timestamps.path) !== JSON.stringify({ entries: { "@types/jquery": date.getTime() } }), "timestamps content should be updated"); }); it("non-expired cache entry (inferred project, should not install typings)", () => { From 3f23d5d02e226d810650432717c0d6425bc059d1 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 4 Jan 2018 14:04:14 -0800 Subject: [PATCH 007/298] Respond to CR --- src/harness/unittests/typingsInstaller.ts | 2 +- .../typingsInstaller/typingsInstaller.ts | 60 ++++++------------- src/services/jsTyping.ts | 12 +--- 3 files changed, 21 insertions(+), 53 deletions(-) diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index fb82a17b965..8636b38d294 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1,6 +1,6 @@ /// /// -/// import { deepEqual } from "assert";import { deepEqual } from "assert"; +/// diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index cf441017de9..291f2b9b871 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -19,7 +19,7 @@ namespace ts.server.typingsInstaller { writeLine: noop }; - const timestampsFile = "timestamps.json"; + const timestampsFileName = "timestamps.json"; function typingToFileName(cachePath: string, packageName: string, installTypingHost: InstallTypingHost, log: Log): string { try { @@ -44,60 +44,37 @@ namespace ts.server.typingsInstaller { } interface TypeDeclarationTimestampFile { + // entries maps from package names (e.g. "@types/node") to timestamp values (as produced by Date#getTime) entries: MapLike; } function loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, host: InstallTypingHost, log: Log): MapLike { - const fileExists = host.fileExists(typeDeclarationTimestampFilePath); - if (!fileExists) { - if (log.isEnabled()) { - log.writeLine(`Type declaration timestamp file '${typeDeclarationTimestampFilePath}' does not exist`); - } - } try { - if (fileExists) { - const content = JSON.parse(host.readFile(typeDeclarationTimestampFilePath)); - return content.entries || {}; - } - else { - host.writeFile(typeDeclarationTimestampFilePath, "{}"); - if (log.isEnabled()) { - log.writeLine("Type declaration timestamp file was created."); - } - return {}; + if (log.isEnabled()) { + log.writeLine("Loading type declaration timestamp file."); } + const content = JSON.parse(host.readFile(typeDeclarationTimestampFilePath)); + return content.entries || {}; } catch (e) { if (log.isEnabled()) { log.writeLine(`Error when loading type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); } + // If file cannot be read, we update all requested type declarations. return {}; } } function writeTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, newContents: TypeDeclarationTimestampFile, host: InstallTypingHost, log: Log): void { - const fileExists = host.fileExists(typeDeclarationTimestampFilePath); - if (!fileExists) { - if (log.isEnabled()) { - log.writeLine(`Type declaration timestamp file '${typeDeclarationTimestampFilePath}' does not exist`); - } - } try { - if (fileExists) { - host.writeFile(typeDeclarationTimestampFilePath, JSON.stringify(newContents)); - return; - } - else { - host.writeFile(typeDeclarationTimestampFilePath, JSON.stringify(newContents)); - if (log.isEnabled()) { - log.writeLine("Type declaration time stamp file was created."); - } - return; + if (log.isEnabled()) { + log.writeLine("Writing type declaration timestamp file."); } + host.writeFile(typeDeclarationTimestampFilePath, JSON.stringify(newContents)); } catch (e) { if (log.isEnabled()) { - log.writeLine(`Error when writing new type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); + log.writeLine(`Error when writing type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); } return; } @@ -162,11 +139,12 @@ namespace ts.server.typingsInstaller { } // load existing typing information from the cache + const timestampsFilePath = combinePaths(req.cachePath || this.globalCachePath, timestampsFileName); if (req.cachePath) { if (this.log.isEnabled()) { this.log.writeLine(`Request specifies cache path '${req.cachePath}', loading cached information...`); } - this.processCacheLocation(req.cachePath); + this.processCacheLocation(req.cachePath, timestampsFilePath); } if (this.safeList === undefined) { @@ -191,7 +169,7 @@ namespace ts.server.typingsInstaller { // install typings if (discoverTypingsResult.newTypingNames.length) { - this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames); + this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames, timestampsFilePath); } else { this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); @@ -215,7 +193,7 @@ namespace ts.server.typingsInstaller { this.safeList = JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); } - private processCacheLocation(cacheLocation: string) { + private processCacheLocation(cacheLocation: string, timestampsFilePath?: string) { if (this.log.isEnabled()) { this.log.writeLine(`Processing cache location '${cacheLocation}'`); } @@ -225,8 +203,7 @@ namespace ts.server.typingsInstaller { } return; } - const timestampJson = combinePaths(cacheLocation, timestampsFile); - this.typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampJson, this.installTypingHost, this.log); + this.typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampsFilePath || combinePaths(cacheLocation, timestampsFileName), this.installTypingHost, this.log); const packageJson = combinePaths(cacheLocation, "package.json"); if (this.log.isEnabled()) { this.log.writeLine(`Trying to find '${packageJson}'...`); @@ -321,7 +298,7 @@ namespace ts.server.typingsInstaller { } } - private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[]) { + private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[], timestampsFilePath: string) { if (this.log.isEnabled()) { this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`); } @@ -384,8 +361,7 @@ namespace ts.server.typingsInstaller { } const newFileContents: TypeDeclarationTimestampFile = { entries: this.typeDeclarationTimestamps }; - const timestampJson = combinePaths(cachePath, timestampsFile); - writeTypeDeclarationTimestampFile(timestampJson, newFileContents, this.installTypingHost, this.log); + writeTypeDeclarationTimestampFile(timestampsFilePath, newFileContents, this.installTypingHost, this.log); this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index f636de25313..335b36952f6 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -32,16 +32,8 @@ namespace ts.JsTyping { } export function isTypingExpired(typing: JsTyping.CachedTyping | undefined) { - const comparisonDate = new Date(); - const currentMonth = comparisonDate.getMonth(); - if (currentMonth) { - comparisonDate.setMonth(11); - comparisonDate.setFullYear(comparisonDate.getFullYear() - 1); - } - else { - comparisonDate.setMonth(currentMonth - 1); - } - return !typing || typing.timestamp < comparisonDate.getTime(); + const msPerMonth = 1000 * 60 * 60 * 24 * 30; // ms/second * second/minute * minutes/hour * hours/day * days/month + return !typing || typing.timestamp < Date.now() - msPerMonth; } /* @internal */ From 7b6be118f5653c57d83a8e511d3d518454c03ce8 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 4 Jan 2018 15:21:54 -0800 Subject: [PATCH 008/298] Allow for local timestamp files and style fixes --- src/harness/unittests/typingsInstaller.ts | 4 --- .../typingsInstaller/typingsInstaller.ts | 27 ++++++++++--------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 8636b38d294..e76f75f45d9 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -2,10 +2,6 @@ /// /// - - - - namespace ts.projectSystem { import TI = server.typingsInstaller; import validatePackageName = JsTyping.validatePackageName; diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 291f2b9b871..4996d0d29a1 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -76,7 +76,6 @@ namespace ts.server.typingsInstaller { if (log.isEnabled()) { log.writeLine(`Error when writing type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); } - return; } } @@ -87,7 +86,7 @@ namespace ts.server.typingsInstaller { private readonly projectWatchers: Map = createMap(); private safeList: JsTyping.SafeList | undefined; readonly pendingRunRequests: PendingRequest[] = []; - private typeDeclarationTimestamps: MapLike = {}; + private globalTypeDeclarationTimestamps: MapLike = {}; private installRunCount = 1; private inFlightRequestCount = 0; @@ -104,7 +103,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}', types map path ${typesMapLocation}`); } - this.processCacheLocation(this.globalCachePath); + this.globalTypeDeclarationTimestamps = this.processCacheLocation(this.globalCachePath); } closeProject(req: CloseProject) { @@ -140,11 +139,12 @@ namespace ts.server.typingsInstaller { // load existing typing information from the cache const timestampsFilePath = combinePaths(req.cachePath || this.globalCachePath, timestampsFileName); + let localTimestamps: MapLike; if (req.cachePath) { if (this.log.isEnabled()) { this.log.writeLine(`Request specifies cache path '${req.cachePath}', loading cached information...`); } - this.processCacheLocation(req.cachePath, timestampsFilePath); + localTimestamps = this.processCacheLocation(req.cachePath, timestampsFilePath); } if (this.safeList === undefined) { @@ -169,7 +169,7 @@ namespace ts.server.typingsInstaller { // install typings if (discoverTypingsResult.newTypingNames.length) { - this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames, timestampsFilePath); + this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames, timestampsFilePath, localTimestamps || this.globalTypeDeclarationTimestamps); } else { this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); @@ -193,7 +193,7 @@ namespace ts.server.typingsInstaller { this.safeList = JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); } - private processCacheLocation(cacheLocation: string, timestampsFilePath?: string) { + private processCacheLocation(cacheLocation: string, timestampsFilePath?: string): MapLike { if (this.log.isEnabled()) { this.log.writeLine(`Processing cache location '${cacheLocation}'`); } @@ -203,7 +203,7 @@ namespace ts.server.typingsInstaller { } return; } - this.typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampsFilePath || combinePaths(cacheLocation, timestampsFileName), this.installTypingHost, this.log); + const typeDeclarationTimestamps: MapLike = loadTypeDeclarationTimestampFile(timestampsFilePath || combinePaths(cacheLocation, timestampsFileName), this.installTypingHost, this.log); const packageJson = combinePaths(cacheLocation, "package.json"); if (this.log.isEnabled()) { this.log.writeLine(`Trying to find '${packageJson}'...`); @@ -238,17 +238,17 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); } - if (getProperty(this.typeDeclarationTimestamps, key) === undefined) { + if (getProperty(typeDeclarationTimestamps, key) === undefined) { // getModifiedTime is only undefined if we were to use the ChakraHost, but we never do in this scenario // defaults to old behavior of never updating if we ever use a host without getModifiedTime in the future const timestamp = this.installTypingHost.getModifiedTime === undefined ? Date.now() : this.installTypingHost.getModifiedTime(typingFile).getTime(); - this.typeDeclarationTimestamps[key] = timestamp; + typeDeclarationTimestamps[key] = timestamp; if (this.log.isEnabled()) { this.log.writeLine(`Adding entry into timestamp cache: '${key}' => '${timestamp}'`); } } // timestamp guaranteed to not be undefined by above check - const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: getProperty(this.typeDeclarationTimestamps, key) }; + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: getProperty(typeDeclarationTimestamps, key) }; this.packageNameToTypingLocation.set(packageName, newTyping); } } @@ -257,6 +257,7 @@ namespace ts.server.typingsInstaller { this.log.writeLine(`Finished processing cache location '${cacheLocation}'`); } this.knownCachesSet.set(cacheLocation, true); + return typeDeclarationTimestamps; } private filterTypings(typingsToInstall: ReadonlyArray): ReadonlyArray { @@ -298,7 +299,7 @@ namespace ts.server.typingsInstaller { } } - private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[], timestampsFilePath: string) { + private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[], timestampsFilePath: string, typeDeclarationTimestamps: MapLike) { if (this.log.isEnabled()) { this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`); } @@ -353,14 +354,14 @@ namespace ts.server.typingsInstaller { const newTimestamp = Date.now(); const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: newTimestamp }; this.packageNameToTypingLocation.set(packageName, newTyping); - this.typeDeclarationTimestamps[typesPackageName(packageName)] = newTimestamp; + typeDeclarationTimestamps[typesPackageName(packageName)] = newTimestamp; installedTypingFiles.push(typingFile); } if (this.log.isEnabled()) { this.log.writeLine(`Installed typing files ${JSON.stringify(installedTypingFiles)}`); } - const newFileContents: TypeDeclarationTimestampFile = { entries: this.typeDeclarationTimestamps }; + const newFileContents: TypeDeclarationTimestampFile = { entries: typeDeclarationTimestamps }; writeTypeDeclarationTimestampFile(timestampsFilePath, newFileContents, this.installTypingHost, this.log); this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); From 6a16cfe0a5dcfe38b13beaf6396bae99149f8950 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 4 Jan 2018 16:44:01 -0800 Subject: [PATCH 009/298] Use existing map to hold representations of timestamp files --- .../typingsInstaller/typingsInstaller.ts | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 4996d0d29a1..d3952ee13b0 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -19,8 +19,6 @@ namespace ts.server.typingsInstaller { writeLine: noop }; - const timestampsFileName = "timestamps.json"; - function typingToFileName(cachePath: string, packageName: string, installTypingHost: InstallTypingHost, log: Log): string { try { const result = resolveModuleName(packageName, combinePaths(cachePath, "index.d.ts"), { moduleResolution: ModuleResolutionKind.NodeJs }, installTypingHost); @@ -43,12 +41,14 @@ namespace ts.server.typingsInstaller { onRequestCompleted: RequestCompletedAction; } + const timestampsFileName = "timestamps.json"; + type TypingsTimestamps = MapLike; interface TypeDeclarationTimestampFile { // entries maps from package names (e.g. "@types/node") to timestamp values (as produced by Date#getTime) - entries: MapLike; + entries: TypingsTimestamps; } - function loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, host: InstallTypingHost, log: Log): MapLike { + function loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, host: InstallTypingHost, log: Log): TypingsTimestamps { try { if (log.isEnabled()) { log.writeLine("Loading type declaration timestamp file."); @@ -82,11 +82,10 @@ namespace ts.server.typingsInstaller { export abstract class TypingsInstaller { private readonly packageNameToTypingLocation: Map = createMap(); private readonly missingTypingsSet: Map = createMap(); - private readonly knownCachesSet: Map = createMap(); + private readonly knownCacheToTimestamps: Map = createMap(); private readonly projectWatchers: Map = createMap(); private safeList: JsTyping.SafeList | undefined; readonly pendingRunRequests: PendingRequest[] = []; - private globalTypeDeclarationTimestamps: MapLike = {}; private installRunCount = 1; private inFlightRequestCount = 0; @@ -103,7 +102,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Global cache location '${globalCachePath}', safe file path '${safeListPath}', types map path ${typesMapLocation}`); } - this.globalTypeDeclarationTimestamps = this.processCacheLocation(this.globalCachePath); + this.processCacheLocation(this.globalCachePath); } closeProject(req: CloseProject) { @@ -139,12 +138,11 @@ namespace ts.server.typingsInstaller { // load existing typing information from the cache const timestampsFilePath = combinePaths(req.cachePath || this.globalCachePath, timestampsFileName); - let localTimestamps: MapLike; if (req.cachePath) { if (this.log.isEnabled()) { this.log.writeLine(`Request specifies cache path '${req.cachePath}', loading cached information...`); } - localTimestamps = this.processCacheLocation(req.cachePath, timestampsFilePath); + this.processCacheLocation(req.cachePath, timestampsFilePath); } if (this.safeList === undefined) { @@ -169,7 +167,7 @@ namespace ts.server.typingsInstaller { // install typings if (discoverTypingsResult.newTypingNames.length) { - this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames, timestampsFilePath, localTimestamps || this.globalTypeDeclarationTimestamps); + this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames, timestampsFilePath); } else { this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); @@ -193,17 +191,17 @@ namespace ts.server.typingsInstaller { this.safeList = JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); } - private processCacheLocation(cacheLocation: string, timestampsFilePath?: string): MapLike { + private processCacheLocation(cacheLocation: string, timestampsFilePath?: string) { if (this.log.isEnabled()) { this.log.writeLine(`Processing cache location '${cacheLocation}'`); } - if (this.knownCachesSet.get(cacheLocation)) { + if (this.knownCacheToTimestamps.has(cacheLocation)) { if (this.log.isEnabled()) { this.log.writeLine(`Cache location was already processed...`); } return; } - const typeDeclarationTimestamps: MapLike = loadTypeDeclarationTimestampFile(timestampsFilePath || combinePaths(cacheLocation, timestampsFileName), this.installTypingHost, this.log); + const typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampsFilePath || combinePaths(cacheLocation, timestampsFileName), this.installTypingHost, this.log); const packageJson = combinePaths(cacheLocation, "package.json"); if (this.log.isEnabled()) { this.log.writeLine(`Trying to find '${packageJson}'...`); @@ -256,8 +254,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Finished processing cache location '${cacheLocation}'`); } - this.knownCachesSet.set(cacheLocation, true); - return typeDeclarationTimestamps; + this.knownCacheToTimestamps.set(cacheLocation, typeDeclarationTimestamps); } private filterTypings(typingsToInstall: ReadonlyArray): ReadonlyArray { @@ -299,7 +296,7 @@ namespace ts.server.typingsInstaller { } } - private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[], timestampsFilePath: string, typeDeclarationTimestamps: MapLike) { + private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[], timestampsFilePath: string) { if (this.log.isEnabled()) { this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`); } @@ -342,6 +339,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Installed typings ${JSON.stringify(scopedTypings)}`); } + const typeDeclarationTimestamps = this.knownCacheToTimestamps.get(cachePath); const installedTypingFiles: string[] = []; const typesPackageName = (packageName: string) => `@types/${packageName}`; for (const packageName of filteredTypings) { @@ -363,6 +361,7 @@ namespace ts.server.typingsInstaller { const newFileContents: TypeDeclarationTimestampFile = { entries: typeDeclarationTimestamps }; writeTypeDeclarationTimestampFile(timestampsFilePath, newFileContents, this.installTypingHost, this.log); + this.knownCacheToTimestamps.set(cachePath, typeDeclarationTimestamps); this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } From 23324345e2fcb81c9c297c8937a1bcc1cc072750 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 5 Jan 2018 14:15:52 -0800 Subject: [PATCH 010/298] Update representation of timestamp file to prevent some extra install calls --- .../typingsInstaller/typingsInstaller.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index d3952ee13b0..15a8b1268ac 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -65,6 +65,20 @@ namespace ts.server.typingsInstaller { } } + function updateTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, timestampsInProcess: TypingsTimestamps, host: InstallTypingHost, log: Log): TypingsTimestamps { + const timestampsOnDisk = loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath, host, log); + for (const packageName in timestampsOnDisk) { + const timestampForPackageInProcess = getProperty(timestampsInProcess, packageName); + if (timestampForPackageInProcess) { + timestampsInProcess[packageName] = Math.max(timestampForPackageInProcess, timestampsOnDisk[packageName]); + } + else { + timestampsInProcess[packageName] = timestampsOnDisk[packageName]; + } + } + return timestampsInProcess; + } + function writeTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, newContents: TypeDeclarationTimestampFile, host: InstallTypingHost, log: Log): void { try { if (log.isEnabled()) { @@ -359,9 +373,10 @@ namespace ts.server.typingsInstaller { this.log.writeLine(`Installed typing files ${JSON.stringify(installedTypingFiles)}`); } - const newFileContents: TypeDeclarationTimestampFile = { entries: typeDeclarationTimestamps }; + const updatedTypeDeclarationTimestamps = updateTypeDeclarationTimestampFile(timestampsFilePath, typeDeclarationTimestamps, this.installTypingHost, this.log); + const newFileContents: TypeDeclarationTimestampFile = { entries: updatedTypeDeclarationTimestamps }; writeTypeDeclarationTimestampFile(timestampsFilePath, newFileContents, this.installTypingHost, this.log); - this.knownCacheToTimestamps.set(cachePath, typeDeclarationTimestamps); + this.knownCacheToTimestamps.set(cachePath, updatedTypeDeclarationTimestamps); this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } From e72ea6f7b1e6e3314b089e7a962a61311cdb4cf7 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 11 Jan 2018 09:13:33 -0800 Subject: [PATCH 011/298] Update installed types if older than those listed in the registry --- .../unittests/tsserverProjectSystem.ts | 2 +- src/harness/unittests/typingsInstaller.ts | 54 ++++++++++++++---- src/server/server.ts | 2 +- src/server/types.ts | 2 +- .../typingsInstaller/nodeTypingsInstaller.ts | 12 ++-- .../typingsInstaller/typingsInstaller.ts | 35 +++++++++--- src/services/jsTyping.ts | 4 +- src/services/semver.ts | 55 +++++++++++++++++++ src/services/tsconfig.json | 1 + 9 files changed, 137 insertions(+), 30 deletions(-) create mode 100644 src/services/semver.ts diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 74981bbac35..2c5d4c59bab 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -63,7 +63,7 @@ namespace ts.projectSystem { readonly globalTypingsCacheLocation: string, throttleLimit: number, installTypingHost: server.ServerHost, - readonly typesRegistry = createMap(), + readonly typesRegistry = createMap>(), log?: TI.Log) { super(installTypingHost, globalTypingsCacheLocation, safeList.path, customTypesMap.path, throttleLimit, log); } diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index e76f75f45d9..cbeab8f7a97 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1,6 +1,7 @@ /// /// /// +/// namespace ts.projectSystem { import TI = server.typingsInstaller; @@ -10,13 +11,24 @@ namespace ts.projectSystem { interface InstallerParams { globalTypingsCacheLocation?: string; throttleLimit?: number; - typesRegistry?: Map; + typesRegistry?: Map>; } - function createTypesRegistry(...list: string[]): Map { - const map = createMap(); + function createTypesRegistry(...list: string[]): Map> { + const versionMap = { + "latest": "1.3.0", + "ts2.0": "1.0.0", + "ts2.1": "1.0.0", + "ts2.2": "1.2.0", + "ts2.3": "1.3.0", + "ts2.4": "1.3.0", + "ts2.5": "1.3.0", + "ts2.6": "1.3.0", + "ts2.7": "1.3.0" + }; + const map = createMap>(); for (const l of list) { - map.set(l, undefined); + map.set(l, versionMap); } return map; } @@ -51,7 +63,7 @@ namespace ts.projectSystem { const logs: string[] = []; return { log(message) { - logs.push(message); + logs.push(message); }, finish() { return logs; @@ -1149,7 +1161,17 @@ namespace ts.projectSystem { "types-registry": "^0.1.317" }, devDependencies: { - "@types/jquery": "^3.2.16" + "@types/jquery": "^1.3.0" + } + }) + }; + const cacheLockConfig = { + path: "/a/data/package-lock.json", + content: JSON.stringify({ + dependencies: { + "@types/jquery": { + version: "1.3.0" + } } }) }; @@ -1157,7 +1179,7 @@ namespace ts.projectSystem { path: "/a/data/node_modules/@types/jquery/index.d.ts", content: "declare const $: { x: number }" }; - const host = createServerHost([file1, packageJson, timestamps, cacheConfig, jquery]); + const host = createServerHost([file1, packageJson, timestamps, cacheConfig, cacheLockConfig, jquery]); const installer = new (class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("jquery") }); @@ -1299,7 +1321,7 @@ namespace ts.projectSystem { content: "" }; const host = createServerHost([f, node]); - const cache = createMapFromTemplate({ node: { typingLocation: node.path, timestamp: Date.now() } }); + const cache = createMapFromTemplate({ node: { typingLocation: node.path, timestamp: Date.now(), version: new Semver(1, 0, 0, /*isPrerelease*/ false) } }); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, ["fs", "bar"]); assert.deepEqual(logger.finish(), [ @@ -1359,8 +1381,8 @@ namespace ts.projectSystem { }; const host = createServerHost([app]); const cache = createMapFromTemplate({ - node: { typingLocation: node.path, timestamp: Date.now() }, - commander: { typingLocation: commander.path, timestamp: date.getTime() } + node: { typingLocation: node.path, timestamp: Date.now(), version: new Semver(1, 0, 0, /*isPrerelease*/ false) }, + commander: { typingLocation: commander.path, timestamp: date.getTime(), version: new Semver(1, 0, 0, /*isPrerelease*/ false) } }); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http", "commander"]); @@ -1433,12 +1455,22 @@ namespace ts.projectSystem { path: "/a/package.json", content: JSON.stringify({ dependencies: { commander: "1.0.0" } }) }; + const packageLockFile = { + path: "/a/cache/package-lock.json", + content: JSON.stringify({ + dependencies: { + "@types/commander": { + version: "1.0.0" + } + } + }) + }; const cachePath = "/a/cache/"; const commander = { path: cachePath + "node_modules/@types/commander/index.d.ts", content: "export let x: number" }; - const host = createServerHost([f1, packageFile]); + const host = createServerHost([f1, packageFile, packageLockFile]); let beginEvent: server.BeginInstallTypes; let endEvent: server.EndInstallTypes; const installer = new (class extends Installer { diff --git a/src/server/server.ts b/src/server/server.ts index 8e53c4d5109..6d5dfafbe8e 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -252,7 +252,7 @@ namespace ts.server { private requestMap = createMap(); // Maps operation ID to newest requestQueue entry with that ID /** We will lazily request the types registry on the first call to `isKnownTypesPackageName` and store it in `typesRegistryCache`. */ private requestedRegistry: boolean; - private typesRegistryCache: Map | undefined; + private typesRegistryCache: Map> | undefined; // This number is essentially arbitrary. Processing more than one typings request // at a time makes sense, but having too many in the pipe results in a hang diff --git a/src/server/types.ts b/src/server/types.ts index 69b1dae0d7c..161fb00a6ae 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -77,7 +77,7 @@ declare namespace ts.server { /* @internal */ export interface TypesRegistryResponse extends TypingInstallerResponse { readonly kind: EventTypesRegistry; - readonly typesRegistry: MapLike; + readonly typesRegistry: MapLike>; } export interface PackageInstalledResponse extends ProjectResponse { diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index 36f5adab400..e51ec68561c 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -41,15 +41,15 @@ namespace ts.server.typingsInstaller { } interface TypesRegistryFile { - entries: MapLike; + entries: MapLike>; } - function loadTypesRegistryFile(typesRegistryFilePath: string, host: InstallTypingHost, log: Log): Map { + function loadTypesRegistryFile(typesRegistryFilePath: string, host: InstallTypingHost, log: Log): Map> { if (!host.fileExists(typesRegistryFilePath)) { if (log.isEnabled()) { log.writeLine(`Types registry file '${typesRegistryFilePath}' does not exist`); } - return createMap(); + return createMap>(); } try { const content = JSON.parse(host.readFile(typesRegistryFilePath)); @@ -59,7 +59,7 @@ namespace ts.server.typingsInstaller { if (log.isEnabled()) { log.writeLine(`Error when loading types registry file '${typesRegistryFilePath}': ${(e).message}, ${(e).stack}`); } - return createMap(); + return createMap>(); } } @@ -77,7 +77,7 @@ namespace ts.server.typingsInstaller { export class NodeTypingsInstaller extends TypingsInstaller { private readonly nodeExecSync: ExecSync; private readonly npmPath: string; - readonly typesRegistry: Map; + readonly typesRegistry: Map>; private delayedInitializationError: InitializationFailedResponse | undefined; @@ -141,7 +141,7 @@ namespace ts.server.typingsInstaller { this.closeProject(req); break; case "typesRegistry": { - const typesRegistry: { [key: string]: void } = {}; + const typesRegistry: { [key: string]: MapLike } = {}; this.typesRegistry.forEach((value, key) => { typesRegistry[key] = value; }); diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 15a8b1268ac..f3048795229 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -1,6 +1,7 @@ /// /// /// +/// /// /// @@ -9,6 +10,10 @@ namespace ts.server.typingsInstaller { devDependencies: MapLike; } + interface NpmLock { + dependencies: { [packageName: string]: { version: string } }; + } + export interface Log { isEnabled(): boolean; writeLine(text: string): void; @@ -104,7 +109,7 @@ namespace ts.server.typingsInstaller { private installRunCount = 1; private inFlightRequestCount = 0; - abstract readonly typesRegistry: Map; + abstract readonly typesRegistry: Map>; constructor( protected readonly installTypingHost: InstallTypingHost, @@ -217,15 +222,18 @@ namespace ts.server.typingsInstaller { } const typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampsFilePath || combinePaths(cacheLocation, timestampsFileName), this.installTypingHost, this.log); const packageJson = combinePaths(cacheLocation, "package.json"); + const packageLockJson = combinePaths(cacheLocation, "package-lock.json"); if (this.log.isEnabled()) { this.log.writeLine(`Trying to find '${packageJson}'...`); } - if (this.installTypingHost.fileExists(packageJson)) { + if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) { const npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); + const npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); if (this.log.isEnabled()) { this.log.writeLine(`Loaded content of '${packageJson}': ${JSON.stringify(npmConfig)}`); + this.log.writeLine(`Loaded content of '${packageLockJson}'`); } - if (npmConfig.devDependencies) { + if (npmConfig.devDependencies && npmLock.dependencies) { for (const key in npmConfig.devDependencies) { // key is @types/ const packageName = getBaseFileName(key); @@ -259,8 +267,11 @@ namespace ts.server.typingsInstaller { this.log.writeLine(`Adding entry into timestamp cache: '${key}' => '${timestamp}'`); } } + const info = getProperty(npmLock.dependencies, key); + const version = info && info.version; + const semver = Semver.parse(version); // timestamp guaranteed to not be undefined by above check - const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: getProperty(typeDeclarationTimestamps, key) }; + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: getProperty(typeDeclarationTimestamps, key), version: semver }; this.packageNameToTypingLocation.set(packageName, newTyping); } } @@ -277,10 +288,6 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) this.log.writeLine(`'${typing}' is in missingTypingsSet - skipping...`); return false; } - if (this.packageNameToTypingLocation.get(typing) && !JsTyping.isTypingExpired(this.packageNameToTypingLocation.get(typing))) { - if (this.log.isEnabled()) this.log.writeLine(`'${typing}' already has a typing - skipping...`); - return false; - } const validationResult = JsTyping.validatePackageName(typing); if (validationResult !== JsTyping.PackageNameValidationResult.Ok) { // add typing name to missing set so we won't process it again @@ -292,8 +299,17 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) this.log.writeLine(`Entry for package '${typing}' does not exist in local types registry - skipping...`); return false; } + if (this.packageNameToTypingLocation.get(typing) && isTypingUpToDate(this.packageNameToTypingLocation.get(typing), this.typesRegistry.get(typing))) { + if (this.log.isEnabled()) this.log.writeLine(`'${typing}' already has an up-to-date typing - skipping...`); + return false; + } return true; }); + + function isTypingUpToDate(cachedTyping: JsTyping.CachedTyping, availableTypingVersions: MapLike) { + const availableVersion = Semver.parse(getProperty(availableTypingVersions, `ts${ts.version}`)); + return !availableVersion.greaterThan(cachedTyping.version); + } } protected ensurePackageDirectoryExists(directory: string) { @@ -364,7 +380,8 @@ namespace ts.server.typingsInstaller { } const newTimestamp = Date.now(); - const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: newTimestamp }; + const newVersion = Semver.parse(this.typesRegistry.get(packageName)[`ts${ts.versionMajorMinor}`]); + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: newTimestamp, version: newVersion }; this.packageNameToTypingLocation.set(packageName, newTyping); typeDeclarationTimestamps[typesPackageName(packageName)] = newTimestamp; installedTypingFiles.push(typingFile); diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 335b36952f6..75df1a7ea1b 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -4,6 +4,7 @@ /// /// /// +/// /* @internal */ namespace ts.JsTyping { @@ -29,6 +30,7 @@ namespace ts.JsTyping { export interface CachedTyping { typingLocation: string; timestamp: number; + version: Semver; } export function isTypingExpired(typing: JsTyping.CachedTyping | undefined) { @@ -70,7 +72,7 @@ namespace ts.JsTyping { * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations and time of caching + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and time of caching and versions * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ diff --git a/src/services/semver.ts b/src/services/semver.ts new file mode 100644 index 00000000000..1f2d8e3de45 --- /dev/null +++ b/src/services/semver.ts @@ -0,0 +1,55 @@ +/* @internal */ +namespace ts { + function intOfString(str: string): number { + const n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error(`Error in parseInt(${JSON.stringify(str)})`); + } + return n; + } + + export class Semver { + static parse(semver: string): Semver { + const isPrerelease = /^(.*)-next.\d+/.test(semver); + const result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error(`Unexpected semver: ${semver} (isPrerelease: ${isPrerelease})`); + } + return result; + } + + static fromRaw({ major, minor, patch, isPrerelease }: Semver): Semver { + return new Semver(major, minor, patch, isPrerelease); + } + + // This must parse the output of `versionString`. + static tryParse(semver: string, isPrerelease: boolean): Semver | undefined { + // Per the semver spec : + // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." + const rgx = isPrerelease ? /^(\d+)\.(\d+)\.0-next.(\d+)$/ : /^(\d+)\.(\d+)\.(\d+)$/; + const match = rgx.exec(semver); + return match ? new Semver(intOfString(match[1]), intOfString(match[2]), intOfString(match[3]), isPrerelease) : undefined; + } + + constructor( + readonly major: number, readonly minor: number, readonly patch: number, + /** + * If true, this is `major.minor.0-next.patch`. + * If false, this is `major.minor.patch`. + */ + readonly isPrerelease: boolean) { } + + get versionString(): string { + return this.isPrerelease ? `${this.major}.${this.minor}.0-next.${this.patch}` : `${this.major}.${this.minor}.${this.patch}`; + } + + equals(sem: Semver): boolean { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + } + + greaterThan(sem: Semver): boolean { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor && this.patch > sem.patch); + } + } +} \ No newline at end of file diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index d73014a93a2..a0a81f0042c 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -61,6 +61,7 @@ "services.ts", "transform.ts", "transpile.ts", + "semver.ts", "shims.ts", "signatureHelp.ts", "symbolDisplay.ts", From a21f73f862e354d0a4b79322dc497bd588624d70 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 11 Jan 2018 11:11:26 -0800 Subject: [PATCH 012/298] Remove timestamp checking and move registry check into jstyping --- src/harness/unittests/typingsInstaller.ts | 46 ++++---- src/server/types.ts | 1 - .../typingsInstaller/typingsInstaller.ts | 101 +++--------------- src/services/jsTyping.ts | 15 +-- src/services/shims.ts | 6 +- 5 files changed, 46 insertions(+), 123 deletions(-) diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index cbeab8f7a97..cf3d82ca3d7 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1081,16 +1081,6 @@ namespace ts.projectSystem { } }) }; - const date = new Date(); - date.setFullYear(date.getFullYear() - 1); - const timestamps = { - path: "/a/data/timestamps.json", - content: JSON.stringify({ - entries: { - "@types/jquery": date.getTime() - } - }) - }; const jquery = { path: "/a/data/node_modules/@types/jquery/index.d.ts", content: "declare const $: { x: number }" @@ -1102,11 +1092,21 @@ namespace ts.projectSystem { "types-registry": "^0.1.317" }, devDependencies: { - "@types/jquery": "^3.2.16" + "@types/jquery": "^1.0.0" } }) }; - const host = createServerHost([file1, packageJson, jquery, timestamps, cacheConfig]); + const cacheLockConfig = { + path: "/a/data/package-lock.json", + content: JSON.stringify({ + dependencies: { + "@types/jquery": { + version: "1.0.0" + } + } + }) + }; + const host = createServerHost([file1, packageJson, jquery, cacheConfig, cacheLockConfig]); const installer = new (class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("jquery") }); @@ -1129,7 +1129,6 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { inferredProjects: 1 }); checkProjectActualFiles(p, [file1.path, jquery.path]); - assert(host.readFile(timestamps.path) !== JSON.stringify({ entries: { "@types/jquery": date.getTime() } }), "timestamps content should be updated"); }); it("non-expired cache entry (inferred project, should not install typings)", () => { @@ -1282,7 +1281,7 @@ namespace ts.projectSystem { const host = createServerHost([app, jquery, chroma]); const logger = trackingLogger(); - const result = JsTyping.discoverTypings(host, logger.log, [app.path, jquery.path, chroma.path], getDirectoryPath(app.path), safeList, emptyMap, { enable: true }, emptyArray); + const result = JsTyping.discoverTypings(host, logger.log, [app.path, jquery.path, chroma.path], getDirectoryPath(app.path), safeList, emptyMap, { enable: true }, emptyArray, emptyMap); const finish = logger.finish(); assert.deepEqual(finish, [ 'Inferred typings from file names: ["jquery","chroma-js"]', @@ -1302,7 +1301,7 @@ namespace ts.projectSystem { for (const name of JsTyping.nodeCoreModuleList) { const logger = trackingLogger(); - const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, [name, "somename"]); + const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, [name, "somename"], emptyMap); assert.deepEqual(logger.finish(), [ 'Inferred typings from unresolved imports: ["node","somename"]', 'Result: {"cachedTypingPaths":[],"newTypingNames":["node","somename"],"filesToWatch":["/a/b/bower_components","/a/b/node_modules"]}', @@ -1321,9 +1320,10 @@ namespace ts.projectSystem { content: "" }; const host = createServerHost([f, node]); - const cache = createMapFromTemplate({ node: { typingLocation: node.path, timestamp: Date.now(), version: new Semver(1, 0, 0, /*isPrerelease*/ false) } }); + const cache = createMapFromTemplate({ node: { typingLocation: node.path, version: new Semver(1, 3, 0, /*isPrerelease*/ false) } }); + const registry = createTypesRegistry("node"); const logger = trackingLogger(); - const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, ["fs", "bar"]); + const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, ["fs", "bar"], registry); assert.deepEqual(logger.finish(), [ 'Inferred typings from unresolved imports: ["node","bar"]', 'Result: {"cachedTypingPaths":["/a/b/node.d.ts"],"newTypingNames":["bar"],"filesToWatch":["/a/b/bower_components","/a/b/node_modules"]}', @@ -1348,7 +1348,7 @@ namespace ts.projectSystem { const host = createServerHost([app, a, b]); const cache = createMap(); const logger = trackingLogger(); - const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, /*unresolvedImports*/ []); + const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, /*unresolvedImports*/ [], emptyMap); assert.deepEqual(logger.finish(), [ 'Searching for typing names in /node_modules; all files: ["/node_modules/a/package.json"]', ' Found package names: ["a"]', @@ -1363,9 +1363,6 @@ namespace ts.projectSystem { }); it("should install expired typings", () => { - const date = new Date(); - date.setFullYear(date.getFullYear() - 1); - const app = { path: "/a/app.js", content: "" @@ -1381,11 +1378,12 @@ namespace ts.projectSystem { }; const host = createServerHost([app]); const cache = createMapFromTemplate({ - node: { typingLocation: node.path, timestamp: Date.now(), version: new Semver(1, 0, 0, /*isPrerelease*/ false) }, - commander: { typingLocation: commander.path, timestamp: date.getTime(), version: new Semver(1, 0, 0, /*isPrerelease*/ false) } + node: { typingLocation: node.path, version: new Semver(1, 3, 0, /*isPrerelease*/ false) }, + commander: { typingLocation: commander.path, version: new Semver(1, 0, 0, /*isPrerelease*/ false) } }); + const registry = createTypesRegistry("node", "commander"); const logger = trackingLogger(); - const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http", "commander"]); + const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http", "commander"], registry); assert.deepEqual(logger.finish(), [ 'Inferred typings from unresolved imports: ["node","commander"]', 'Result: {"cachedTypingPaths":["/a/cache/node_modules/@types/node/index.d.ts"],"newTypingNames":["commander"],"filesToWatch":["/a/bower_components","/a/node_modules"]}', diff --git a/src/server/types.ts b/src/server/types.ts index 161fb00a6ae..6f773955d45 100644 --- a/src/server/types.ts +++ b/src/server/types.ts @@ -128,6 +128,5 @@ declare namespace ts.server { writeFile(path: string, content: string): void; createDirectory(path: string): void; watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; - getModifiedTime?(path: string): Date; } } \ No newline at end of file diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index f3048795229..18890d8af05 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -46,62 +46,10 @@ namespace ts.server.typingsInstaller { onRequestCompleted: RequestCompletedAction; } - const timestampsFileName = "timestamps.json"; - type TypingsTimestamps = MapLike; - interface TypeDeclarationTimestampFile { - // entries maps from package names (e.g. "@types/node") to timestamp values (as produced by Date#getTime) - entries: TypingsTimestamps; - } - - function loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, host: InstallTypingHost, log: Log): TypingsTimestamps { - try { - if (log.isEnabled()) { - log.writeLine("Loading type declaration timestamp file."); - } - const content = JSON.parse(host.readFile(typeDeclarationTimestampFilePath)); - return content.entries || {}; - } - catch (e) { - if (log.isEnabled()) { - log.writeLine(`Error when loading type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); - } - // If file cannot be read, we update all requested type declarations. - return {}; - } - } - - function updateTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, timestampsInProcess: TypingsTimestamps, host: InstallTypingHost, log: Log): TypingsTimestamps { - const timestampsOnDisk = loadTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath, host, log); - for (const packageName in timestampsOnDisk) { - const timestampForPackageInProcess = getProperty(timestampsInProcess, packageName); - if (timestampForPackageInProcess) { - timestampsInProcess[packageName] = Math.max(timestampForPackageInProcess, timestampsOnDisk[packageName]); - } - else { - timestampsInProcess[packageName] = timestampsOnDisk[packageName]; - } - } - return timestampsInProcess; - } - - function writeTypeDeclarationTimestampFile(typeDeclarationTimestampFilePath: string, newContents: TypeDeclarationTimestampFile, host: InstallTypingHost, log: Log): void { - try { - if (log.isEnabled()) { - log.writeLine("Writing type declaration timestamp file."); - } - host.writeFile(typeDeclarationTimestampFilePath, JSON.stringify(newContents)); - } - catch (e) { - if (log.isEnabled()) { - log.writeLine(`Error when writing type declaration timestamp file '${typeDeclarationTimestampFilePath}': ${(e).message}, ${(e).stack}`); - } - } - } - export abstract class TypingsInstaller { private readonly packageNameToTypingLocation: Map = createMap(); private readonly missingTypingsSet: Map = createMap(); - private readonly knownCacheToTimestamps: Map = createMap(); + private readonly knownCachesSet: Map = createMap(); private readonly projectWatchers: Map = createMap(); private safeList: JsTyping.SafeList | undefined; readonly pendingRunRequests: PendingRequest[] = []; @@ -156,12 +104,11 @@ namespace ts.server.typingsInstaller { } // load existing typing information from the cache - const timestampsFilePath = combinePaths(req.cachePath || this.globalCachePath, timestampsFileName); if (req.cachePath) { if (this.log.isEnabled()) { this.log.writeLine(`Request specifies cache path '${req.cachePath}', loading cached information...`); } - this.processCacheLocation(req.cachePath, timestampsFilePath); + this.processCacheLocation(req.cachePath); } if (this.safeList === undefined) { @@ -175,7 +122,8 @@ namespace ts.server.typingsInstaller { this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, - req.unresolvedImports); + req.unresolvedImports, + this.typesRegistry); if (this.log.isEnabled()) { this.log.writeLine(`Finished typings discovery: ${JSON.stringify(discoverTypingsResult)}`); @@ -186,7 +134,7 @@ namespace ts.server.typingsInstaller { // install typings if (discoverTypingsResult.newTypingNames.length) { - this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames, timestampsFilePath); + this.installTypings(req, req.cachePath || this.globalCachePath, discoverTypingsResult.cachedTypingPaths, discoverTypingsResult.newTypingNames); } else { this.sendResponse(this.createSetTypings(req, discoverTypingsResult.cachedTypingPaths)); @@ -210,17 +158,16 @@ namespace ts.server.typingsInstaller { this.safeList = JsTyping.loadSafeList(this.installTypingHost, this.safeListPath); } - private processCacheLocation(cacheLocation: string, timestampsFilePath?: string) { + private processCacheLocation(cacheLocation: string) { if (this.log.isEnabled()) { this.log.writeLine(`Processing cache location '${cacheLocation}'`); } - if (this.knownCacheToTimestamps.has(cacheLocation)) { + if (this.knownCachesSet.has(cacheLocation)) { if (this.log.isEnabled()) { this.log.writeLine(`Cache location was already processed...`); } return; } - const typeDeclarationTimestamps = loadTypeDeclarationTimestampFile(timestampsFilePath || combinePaths(cacheLocation, timestampsFileName), this.installTypingHost, this.log); const packageJson = combinePaths(cacheLocation, "package.json"); const packageLockJson = combinePaths(cacheLocation, "package-lock.json"); if (this.log.isEnabled()) { @@ -258,20 +205,10 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Adding entry into typings cache: '${packageName}' => '${typingFile}'`); } - if (getProperty(typeDeclarationTimestamps, key) === undefined) { - // getModifiedTime is only undefined if we were to use the ChakraHost, but we never do in this scenario - // defaults to old behavior of never updating if we ever use a host without getModifiedTime in the future - const timestamp = this.installTypingHost.getModifiedTime === undefined ? Date.now() : this.installTypingHost.getModifiedTime(typingFile).getTime(); - typeDeclarationTimestamps[key] = timestamp; - if (this.log.isEnabled()) { - this.log.writeLine(`Adding entry into timestamp cache: '${key}' => '${timestamp}'`); - } - } const info = getProperty(npmLock.dependencies, key); const version = info && info.version; const semver = Semver.parse(version); - // timestamp guaranteed to not be undefined by above check - const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: getProperty(typeDeclarationTimestamps, key), version: semver }; + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, version: semver }; this.packageNameToTypingLocation.set(packageName, newTyping); } } @@ -279,7 +216,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Finished processing cache location '${cacheLocation}'`); } - this.knownCacheToTimestamps.set(cacheLocation, typeDeclarationTimestamps); + this.knownCachesSet.set(cacheLocation, true); } private filterTypings(typingsToInstall: ReadonlyArray): ReadonlyArray { @@ -299,17 +236,12 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) this.log.writeLine(`Entry for package '${typing}' does not exist in local types registry - skipping...`); return false; } - if (this.packageNameToTypingLocation.get(typing) && isTypingUpToDate(this.packageNameToTypingLocation.get(typing), this.typesRegistry.get(typing))) { + if (this.packageNameToTypingLocation.get(typing) && JsTyping.isTypingUpToDate(this.packageNameToTypingLocation.get(typing), this.typesRegistry.get(typing))) { if (this.log.isEnabled()) this.log.writeLine(`'${typing}' already has an up-to-date typing - skipping...`); return false; } return true; }); - - function isTypingUpToDate(cachedTyping: JsTyping.CachedTyping, availableTypingVersions: MapLike) { - const availableVersion = Semver.parse(getProperty(availableTypingVersions, `ts${ts.version}`)); - return !availableVersion.greaterThan(cachedTyping.version); - } } protected ensurePackageDirectoryExists(directory: string) { @@ -326,7 +258,7 @@ namespace ts.server.typingsInstaller { } } - private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[], timestampsFilePath: string) { + private installTypings(req: DiscoverTypings, cachePath: string, currentlyCachedTypings: string[], typingsToInstall: string[]) { if (this.log.isEnabled()) { this.log.writeLine(`Installing typings ${JSON.stringify(typingsToInstall)}`); } @@ -369,9 +301,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Installed typings ${JSON.stringify(scopedTypings)}`); } - const typeDeclarationTimestamps = this.knownCacheToTimestamps.get(cachePath); const installedTypingFiles: string[] = []; - const typesPackageName = (packageName: string) => `@types/${packageName}`; for (const packageName of filteredTypings) { const typingFile = typingToFileName(cachePath, packageName, this.installTypingHost, this.log); if (!typingFile) { @@ -379,22 +309,15 @@ namespace ts.server.typingsInstaller { continue; } - const newTimestamp = Date.now(); const newVersion = Semver.parse(this.typesRegistry.get(packageName)[`ts${ts.versionMajorMinor}`]); - const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, timestamp: newTimestamp, version: newVersion }; + const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, version: newVersion }; this.packageNameToTypingLocation.set(packageName, newTyping); - typeDeclarationTimestamps[typesPackageName(packageName)] = newTimestamp; installedTypingFiles.push(typingFile); } if (this.log.isEnabled()) { this.log.writeLine(`Installed typing files ${JSON.stringify(installedTypingFiles)}`); } - const updatedTypeDeclarationTimestamps = updateTypeDeclarationTimestampFile(timestampsFilePath, typeDeclarationTimestamps, this.installTypingHost, this.log); - const newFileContents: TypeDeclarationTimestampFile = { entries: updatedTypeDeclarationTimestamps }; - writeTypeDeclarationTimestampFile(timestampsFilePath, newFileContents, this.installTypingHost, this.log); - this.knownCacheToTimestamps.set(cachePath, updatedTypeDeclarationTimestamps); - this.sendResponse(this.createSetTypings(req, currentlyCachedTypings.concat(installedTypingFiles))); } finally { diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 75df1a7ea1b..3900a290bce 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -29,13 +29,13 @@ namespace ts.JsTyping { export interface CachedTyping { typingLocation: string; - timestamp: number; version: Semver; } - export function isTypingExpired(typing: JsTyping.CachedTyping | undefined) { - const msPerMonth = 1000 * 60 * 60 * 24 * 30; // ms/second * second/minute * minutes/hour * hours/day * days/month - return !typing || typing.timestamp < Date.now() - msPerMonth; + /* @internal */ + export function isTypingUpToDate(cachedTyping: JsTyping.CachedTyping, availableTypingVersions: MapLike) { + const availableVersion = Semver.parse(getProperty(availableTypingVersions, `ts${ts.versionMajorMinor}`)); + return !availableVersion.greaterThan(cachedTyping.version); } /* @internal */ @@ -72,7 +72,7 @@ namespace ts.JsTyping { * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations and time of caching and versions + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ @@ -84,7 +84,8 @@ namespace ts.JsTyping { safeList: SafeList, packageNameToTypingLocation: ReadonlyMap, typeAcquisition: TypeAcquisition, - unresolvedImports: ReadonlyArray): + unresolvedImports: ReadonlyArray, + typesRegistry: ReadonlyMap>): { cachedTypingPaths: string[], newTypingNames: string[], filesToWatch: string[] } { if (!typeAcquisition || !typeAcquisition.enable) { @@ -135,7 +136,7 @@ namespace ts.JsTyping { } // Add the cached typing locations for inferred typings that are already installed packageNameToTypingLocation.forEach((typing, name) => { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && !isTypingExpired(typing)) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { inferredTypings.set(name, typing.typingLocation); } }); diff --git a/src/services/shims.ts b/src/services/shims.ts index d4bad1908e9..1b2f84035c0 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -28,10 +28,11 @@ namespace ts { fileNames: string[]; // The file names that belong to the same project. projectRootPath: string; // The path to the project root directory safeListPath: string; // The path used to retrieve the safe list - packageNameToTypingLocation: Map; // The map of package names to their cached typing locations + packageNameToTypingLocation: Map; // The map of package names to their cached typing locations and installed versions typeAcquisition: TypeAcquisition; // Used to customize the type acquisition process compilerOptions: CompilerOptions; // Used as a source for typing inference unresolvedImports: ReadonlyArray; // List of unresolved module ids from imports + typesRegistry: ReadonlyMap>; // The map of available typings in npm to maps of TS versions to their latest supported versions } export interface ScriptSnapshotShim { @@ -1171,7 +1172,8 @@ namespace ts { this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, - info.unresolvedImports); + info.unresolvedImports, + info.typesRegistry); }); } } From 87c59450aa8ec37da091eb48ff6589872034d120 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 11 Jan 2018 11:29:08 -0800 Subject: [PATCH 013/298] Revert unnecessary harness changes --- src/harness/unittests/tsserverProjectSystem.ts | 6 ++---- src/harness/unittests/typingsInstaller.ts | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 2c5d4c59bab..b7536248d36 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -243,11 +243,9 @@ namespace ts.projectSystem { } } - export function createSession(host: TestServerHost, opts: Partial = {}) { + export function createSession(host: server.ServerHost, opts: Partial = {}) { if (opts.typingsInstaller === undefined) { - const globalTypingsCacheLocation = "/a/data"; - host.ensureFileOrFolder({ path: globalTypingsCacheLocation }); - opts.typingsInstaller = new TestTypingsInstaller(globalTypingsCacheLocation, /*throttleLimit*/ 5, host); + opts.typingsInstaller = new TestTypingsInstaller("/a/data", /*throttleLimit*/ 5, host); } if (opts.eventHandler !== undefined) { diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index cf3d82ca3d7..1e0a66f6d55 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -34,8 +34,7 @@ namespace ts.projectSystem { } class Installer extends TestTypingsInstaller { - constructor(host: TestServerHost, p?: InstallerParams, log?: TI.Log) { - host.ensureFileOrFolder({ path: (p && p.globalTypingsCacheLocation) || "/a/data" }); + constructor(host: server.ServerHost, p?: InstallerParams, log?: TI.Log) { super( (p && p.globalTypingsCacheLocation) || "/a/data", (p && p.throttleLimit) || 5, From 2a0d5d173dbe46a33bb9c6ec32f9aaa0de1e45fa Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 11 Jan 2018 13:07:47 -0800 Subject: [PATCH 014/298] Fix tests --- src/harness/unittests/tsserverProjectSystem.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index b7536248d36..279bec7db04 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -245,7 +245,7 @@ namespace ts.projectSystem { export function createSession(host: server.ServerHost, opts: Partial = {}) { if (opts.typingsInstaller === undefined) { - opts.typingsInstaller = new TestTypingsInstaller("/a/data", /*throttleLimit*/ 5, host); + opts.typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/ 5, host); } if (opts.eventHandler !== undefined) { @@ -6532,7 +6532,7 @@ namespace ts.projectSystem { const files = [file, packageJsonInCurrentDirectory, packageJsonOfPkgcurrentdirectory, indexOfPkgcurrentdirectory, typingsCachePackageJson]; const host = createServerHost(files, { currentDirectory }); - const typesRegistry = createMap(); + const typesRegistry = createMap>(); typesRegistry.set("pkgcurrentdirectory", void 0); const typingsInstaller = new TestTypingsInstaller(typingsCache, /*throttleLimit*/ 5, host, typesRegistry); From aff02e879cde1e614526fa044f1f09f456542765 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 11 Jan 2018 13:20:45 -0800 Subject: [PATCH 015/298] Move createTypesRegistry so more accessible --- .../unittests/tsserverProjectSystem.ts | 31 +++++++++++++++++-- src/harness/unittests/typingsInstaller.ts | 19 ------------ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 279bec7db04..90c38186828 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -126,6 +126,25 @@ namespace ts.projectSystem { return JSON.stringify({ dependencies }); } + export function createTypesRegistry(...list: string[]): Map> { + const versionMap = { + "latest": "1.3.0", + "ts2.0": "1.0.0", + "ts2.1": "1.0.0", + "ts2.2": "1.2.0", + "ts2.3": "1.3.0", + "ts2.4": "1.3.0", + "ts2.5": "1.3.0", + "ts2.6": "1.3.0", + "ts2.7": "1.3.0" + }; + const map = createMap>(); + for (const l of list) { + map.set(l, versionMap); + } + return map; + } + export function toExternalFile(fileName: string): protocol.ExternalFile { return { fileName }; } @@ -6528,12 +6547,18 @@ namespace ts.projectSystem { }, }) }; + const typingsCachePackageLockJson: FileOrFolder = { + path: `${typingsCache}/package-lock.json`, + content: JSON.stringify({ + dependencies: { + }, + }) + }; - const files = [file, packageJsonInCurrentDirectory, packageJsonOfPkgcurrentdirectory, indexOfPkgcurrentdirectory, typingsCachePackageJson]; + const files = [file, packageJsonInCurrentDirectory, packageJsonOfPkgcurrentdirectory, indexOfPkgcurrentdirectory, typingsCachePackageJson, typingsCachePackageLockJson]; const host = createServerHost(files, { currentDirectory }); - const typesRegistry = createMap>(); - typesRegistry.set("pkgcurrentdirectory", void 0); + const typesRegistry = createTypesRegistry("pkgcurrentdirectory"); const typingsInstaller = new TestTypingsInstaller(typingsCache, /*throttleLimit*/ 5, host, typesRegistry); const projectService = createProjectService(host, { typingsInstaller }); diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 1e0a66f6d55..33f3544bde8 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -14,25 +14,6 @@ namespace ts.projectSystem { typesRegistry?: Map>; } - function createTypesRegistry(...list: string[]): Map> { - const versionMap = { - "latest": "1.3.0", - "ts2.0": "1.0.0", - "ts2.1": "1.0.0", - "ts2.2": "1.2.0", - "ts2.3": "1.3.0", - "ts2.4": "1.3.0", - "ts2.5": "1.3.0", - "ts2.6": "1.3.0", - "ts2.7": "1.3.0" - }; - const map = createMap>(); - for (const l of list) { - map.set(l, versionMap); - } - return map; - } - class Installer extends TestTypingsInstaller { constructor(host: server.ServerHost, p?: InstallerParams, log?: TI.Log) { super( From d34b86573c36721d13e7ff76d221ed75b710497c Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 19 Jan 2018 13:13:51 -0800 Subject: [PATCH 016/298] Respond to CR --- src/server/typingsInstaller/typingsInstaller.ts | 4 +++- src/services/semver.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 18890d8af05..fa31384a453 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -309,7 +309,9 @@ namespace ts.server.typingsInstaller { continue; } - const newVersion = Semver.parse(this.typesRegistry.get(packageName)[`ts${ts.versionMajorMinor}`]); + // packageName is guaranteed to exist in typesRegistry by filterTypings + const distTags = this.typesRegistry.get(packageName); + const newVersion = Semver.parse(distTags[`ts${ts.versionMajorMinor}`] || distTags["latest"]); const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, version: newVersion }; this.packageNameToTypingLocation.set(packageName, newTyping); installedTypingFiles.push(typingFile); diff --git a/src/services/semver.ts b/src/services/semver.ts index 1f2d8e3de45..b16d6041529 100644 --- a/src/services/semver.ts +++ b/src/services/semver.ts @@ -1,6 +1,6 @@ /* @internal */ namespace ts { - function intOfString(str: string): number { + function stringToInt(str: string): number { const n = parseInt(str, 10); if (isNaN(n)) { throw new Error(`Error in parseInt(${JSON.stringify(str)})`); @@ -28,10 +28,10 @@ namespace ts { // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." const rgx = isPrerelease ? /^(\d+)\.(\d+)\.0-next.(\d+)$/ : /^(\d+)\.(\d+)\.(\d+)$/; const match = rgx.exec(semver); - return match ? new Semver(intOfString(match[1]), intOfString(match[2]), intOfString(match[3]), isPrerelease) : undefined; + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; } - constructor( + private constructor( readonly major: number, readonly minor: number, readonly patch: number, /** * If true, this is `major.minor.0-next.patch`. @@ -49,7 +49,9 @@ namespace ts { greaterThan(sem: Semver): boolean { return this.major > sem.major || this.major === sem.major - && (this.minor > sem.minor || this.minor === sem.minor && this.patch > sem.patch); + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); } } } \ No newline at end of file From 7397fb11c4cbc651a2d0be5180a003fecd46716e Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 19 Jan 2018 14:10:06 -0800 Subject: [PATCH 017/298] Fix lint and test errors and add tests --- src/harness/unittests/typingsInstaller.ts | 64 ++++++++++++++++++- .../typingsInstaller/typingsInstaller.ts | 4 +- src/services/semver.ts | 2 +- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 33f3544bde8..b5265c5e5f2 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1300,7 +1300,7 @@ namespace ts.projectSystem { content: "" }; const host = createServerHost([f, node]); - const cache = createMapFromTemplate({ node: { typingLocation: node.path, version: new Semver(1, 3, 0, /*isPrerelease*/ false) } }); + const cache = createMapFromTemplate({ node: { typingLocation: node.path, version: Semver.parse("1.3.0") } }); const registry = createTypesRegistry("node"); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, ["fs", "bar"], registry); @@ -1358,8 +1358,8 @@ namespace ts.projectSystem { }; const host = createServerHost([app]); const cache = createMapFromTemplate({ - node: { typingLocation: node.path, version: new Semver(1, 3, 0, /*isPrerelease*/ false) }, - commander: { typingLocation: commander.path, version: new Semver(1, 0, 0, /*isPrerelease*/ false) } + node: { typingLocation: node.path, version: Semver.parse("1.3.0") }, + commander: { typingLocation: commander.path, version: Semver.parse("1.0.0") } }); const registry = createTypesRegistry("node", "commander"); const logger = trackingLogger(); @@ -1371,6 +1371,64 @@ namespace ts.projectSystem { assert.deepEqual(result.cachedTypingPaths, [node.path]); assert.deepEqual(result.newTypingNames, ["commander"]); }); + + it("should install expired typings with prerelease version of tsserver", () => { + const app = { + path: "/a/app.js", + content: "" + }; + const cachePath = "/a/cache/"; + const node = { + path: cachePath + "node_modules/@types/node/index.d.ts", + content: "export let y: number" + }; + const host = createServerHost([app]); + const cache = createMapFromTemplate({ + node: { typingLocation: node.path, version: Semver.parse("1.0.0") } + }); + const registry = createTypesRegistry("node"); + registry.delete(`ts${ts.versionMajorMinor}`); + const logger = trackingLogger(); + const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http"], registry); + assert.deepEqual(logger.finish(), [ + 'Inferred typings from unresolved imports: ["node"]', + 'Result: {"cachedTypingPaths":[],"newTypingNames":["node"],"filesToWatch":["/a/bower_components","/a/node_modules"]}', + ]); + assert.deepEqual(result.cachedTypingPaths, []); + assert.deepEqual(result.newTypingNames, ["node"]); + }); + + + it("prerelease typings are properly handled", () => { + const app = { + path: "/a/app.js", + content: "" + }; + const cachePath = "/a/cache/"; + const commander = { + path: cachePath + "node_modules/@types/commander/index.d.ts", + content: "export let x: number" + }; + const node = { + path: cachePath + "node_modules/@types/node/index.d.ts", + content: "export let y: number" + }; + const host = createServerHost([app]); + const cache = createMapFromTemplate({ + node: { typingLocation: node.path, version: Semver.parse("1.3.0-next.0") }, + commander: { typingLocation: commander.path, version: Semver.parse("1.3.0-next.0") } + }); + const registry = createTypesRegistry("node", "commander"); + registry.get("node")[`ts${ts.versionMajorMinor}`] = "1.3.0-next.1"; + const logger = trackingLogger(); + const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http", "commander"], registry); + assert.deepEqual(logger.finish(), [ + 'Inferred typings from unresolved imports: ["node","commander"]', + 'Result: {"cachedTypingPaths":[],"newTypingNames":["node","commander"],"filesToWatch":["/a/bower_components","/a/node_modules"]}', + ]); + assert.deepEqual(result.cachedTypingPaths, []); + assert.deepEqual(result.newTypingNames, ["node", "commander"]); + }); }); describe("telemetry events", () => { diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index fa31384a453..09c0e76e8d0 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -311,7 +311,7 @@ namespace ts.server.typingsInstaller { // packageName is guaranteed to exist in typesRegistry by filterTypings const distTags = this.typesRegistry.get(packageName); - const newVersion = Semver.parse(distTags[`ts${ts.versionMajorMinor}`] || distTags["latest"]); + const newVersion = Semver.parse(distTags[`ts${ts.versionMajorMinor}`] || distTags[latestDistTag]); const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, version: newVersion }; this.packageNameToTypingLocation.set(packageName, newTyping); installedTypingFiles.push(typingFile); @@ -407,4 +407,6 @@ namespace ts.server.typingsInstaller { export function typingsName(packageName: string): string { return `@types/${packageName}@ts${versionMajorMinor}`; } + + const latestDistTag = "latest"; } \ No newline at end of file diff --git a/src/services/semver.ts b/src/services/semver.ts index b16d6041529..3415ff9176f 100644 --- a/src/services/semver.ts +++ b/src/services/semver.ts @@ -23,7 +23,7 @@ namespace ts { } // This must parse the output of `versionString`. - static tryParse(semver: string, isPrerelease: boolean): Semver | undefined { + private static tryParse(semver: string, isPrerelease: boolean): Semver | undefined { // Per the semver spec : // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." const rgx = isPrerelease ? /^(\d+)\.(\d+)\.0-next.(\d+)$/ : /^(\d+)\.(\d+)\.(\d+)$/; From f8eac24f08fa1f1ba84b7f25795362d41a81377c Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 19 Jan 2018 17:09:12 -0800 Subject: [PATCH 018/298] Make regexes instantiate only once --- src/services/semver.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/services/semver.ts b/src/services/semver.ts index 3415ff9176f..1c58da8c8f7 100644 --- a/src/services/semver.ts +++ b/src/services/semver.ts @@ -8,9 +8,13 @@ namespace ts { return n; } + const isPrereleaseRegex = /^(.*)-next.\d+/; + const prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + const semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + export class Semver { static parse(semver: string): Semver { - const isPrerelease = /^(.*)-next.\d+/.test(semver); + const isPrerelease = isPrereleaseRegex.test(semver); const result = Semver.tryParse(semver, isPrerelease); if (!result) { throw new Error(`Unexpected semver: ${semver} (isPrerelease: ${isPrerelease})`); @@ -26,7 +30,7 @@ namespace ts { private static tryParse(semver: string, isPrerelease: boolean): Semver | undefined { // Per the semver spec : // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." - const rgx = isPrerelease ? /^(\d+)\.(\d+)\.0-next.(\d+)$/ : /^(\d+)\.(\d+)\.(\d+)$/; + const rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; const match = rgx.exec(semver); return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; } From 1d5e5e6205dd3bb5aeaac10ca2b627838846c39d Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Wed, 24 Jan 2018 13:56:30 -0800 Subject: [PATCH 019/298] Handle missing ts versions in registry --- src/services/jsTyping.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 3900a290bce..bd6c2e5cb9f 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -34,7 +34,7 @@ namespace ts.JsTyping { /* @internal */ export function isTypingUpToDate(cachedTyping: JsTyping.CachedTyping, availableTypingVersions: MapLike) { - const availableVersion = Semver.parse(getProperty(availableTypingVersions, `ts${ts.versionMajorMinor}`)); + const availableVersion = Semver.parse(getProperty(availableTypingVersions, `ts${ts.versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")); return !availableVersion.greaterThan(cachedTyping.version); } From 271b47ce9338dadc2692545819614ec7f29624a5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 17 Jan 2017 13:51:00 -0800 Subject: [PATCH 020/298] Emit the symbol information for declaration names (could be string literals and more) --- src/harness/typeWriter.ts | 4 +- .../reference/ClassDeclaration21.symbols | 3 + .../reference/ClassDeclaration21.types | 3 + .../reference/ClassDeclaration22.symbols | 3 + .../reference/ClassDeclaration22.types | 3 + .../aliasOnMergedModuleInterface.symbols | 1 + .../aliasOnMergedModuleInterface.types | 1 + .../reference/ambientDeclarations.symbols | 2 + .../reference/ambientDeclarations.types | 2 + .../ambientDeclarationsExternal.symbols | 4 + .../ambientDeclarationsExternal.types | 4 + .../ambientDeclarationsPatterns.symbols | 8 + .../ambientDeclarationsPatterns.types | 8 + ...larationsPatterns_tooManyAsterisks.symbols | 4 +- ...eclarationsPatterns_tooManyAsterisks.types | 4 +- .../baselines/reference/ambientErrors.symbols | 4 + tests/baselines/reference/ambientErrors.types | 4 + .../ambientExportDefaultErrors.symbols | 4 + .../ambientExportDefaultErrors.types | 4 + ...ernalModuleInAnotherExternalModule.symbols | 2 + ...xternalModuleInAnotherExternalModule.types | 2 + ...ientExternalModuleInsideNonAmbient.symbols | 1 + ...mbientExternalModuleInsideNonAmbient.types | 1 + ...duleInsideNonAmbientExternalModule.symbols | 3 +- ...ModuleInsideNonAmbientExternalModule.types | 3 +- .../ambientExternalModuleMerging.symbols | 4 + .../ambientExternalModuleMerging.types | 4 + .../ambientExternalModuleReopen.symbols | 4 + .../ambientExternalModuleReopen.types | 4 + ...oduleWithInternalImportDeclaration.symbols | 2 + ...lModuleWithInternalImportDeclaration.types | 2 + ...hRelativeExternalImportDeclaration.symbols | 2 + ...ithRelativeExternalImportDeclaration.types | 2 + ...ternalModuleWithRelativeModuleName.symbols | 4 + ...ExternalModuleWithRelativeModuleName.types | 4 + ...leWithoutInternalImportDeclaration.symbols | 2 + ...duleWithoutInternalImportDeclaration.types | 2 + .../reference/ambientRequireFunction.symbols | 2 + .../reference/ambientRequireFunction.types | 2 + .../reference/ambientShorthand.symbols | 10 +- .../reference/ambientShorthand.types | 10 +- .../ambientShorthand_declarationEmit.symbols | 4 +- .../ambientShorthand_declarationEmit.types | 4 +- .../ambientShorthand_duplicate.symbols | 4 +- .../ambientShorthand_duplicate.types | 4 +- .../ambientShorthand_merging.symbols | 4 +- .../reference/ambientShorthand_merging.types | 4 +- .../ambientShorthand_reExport.symbols | 5 +- .../reference/ambientShorthand_reExport.types | 5 +- .../arityAndOrderCompatibility01.symbols | 8 + .../arityAndOrderCompatibility01.types | 8 + .../reference/arrayLiterals3.symbols | 3 + .../baselines/reference/arrayLiterals3.types | 3 + ...ompatWithObjectMembersNumericNames.symbols | 8 + ...tCompatWithObjectMembersNumericNames.types | 8 + ...ithObjectMembersStringNumericNames.symbols | 16 + ...tWithObjectMembersStringNumericNames.types | 16 + .../reference/augmentExportEquals1.symbols | 2 + .../reference/augmentExportEquals1.types | 2 + .../reference/augmentExportEquals1_1.symbols | 4 + .../reference/augmentExportEquals1_1.types | 4 + .../reference/augmentExportEquals2.symbols | 2 + .../reference/augmentExportEquals2.types | 2 + .../reference/augmentExportEquals2_1.symbols | 4 + .../reference/augmentExportEquals2_1.types | 4 + .../reference/augmentExportEquals3.symbols | 2 + .../reference/augmentExportEquals3.types | 2 + .../reference/augmentExportEquals3_1.symbols | 4 + .../reference/augmentExportEquals3_1.types | 4 + .../reference/augmentExportEquals4.symbols | 2 + .../reference/augmentExportEquals4.types | 2 + .../reference/augmentExportEquals4_1.symbols | 4 + .../reference/augmentExportEquals4_1.types | 4 + .../reference/augmentExportEquals5.symbols | 4 + .../reference/augmentExportEquals5.types | 4 + .../reference/augmentExportEquals6.symbols | 2 + .../reference/augmentExportEquals6.types | 2 + .../reference/augmentExportEquals6_1.symbols | 4 + .../reference/augmentExportEquals6_1.types | 4 + .../reference/augmentExportEquals7.symbols | 2 + .../reference/augmentExportEquals7.types | 2 + .../reference/bangInModuleName.symbols | 3 + .../reference/bangInModuleName.types | 3 + .../reference/binaryIntegerLiteral.symbols | 6 + .../reference/binaryIntegerLiteral.types | 4 + .../reference/binaryIntegerLiteralES6.symbols | 6 + .../reference/binaryIntegerLiteralES6.types | 4 + .../binaryIntegerLiteralError.symbols | 6 + .../reference/binaryIntegerLiteralError.types | 3 + .../bitwiseNotOperatorWithEnumType.symbols | 1 + .../bitwiseNotOperatorWithEnumType.types | 1 + ...PublicMembersEquivalentToInterface.symbols | 2 + ...lyPublicMembersEquivalentToInterface.types | 2 + ...ublicMembersEquivalentToInterface2.symbols | 2 + ...yPublicMembersEquivalentToInterface2.types | 2 + .../reference/commonSourceDirectory.symbols | 2 + .../reference/commonSourceDirectory.types | 2 + .../complexRecursiveCollections.symbols | 2 + .../complexRecursiveCollections.types | 2 + ...utedPropertiesInDestructuring1_ES6.symbols | 1 + ...mputedPropertiesInDestructuring1_ES6.types | 1 + ...edPropertyNamesContextualType6_ES5.symbols | 2 + ...utedPropertyNamesContextualType6_ES5.types | 1 + ...edPropertyNamesContextualType6_ES6.symbols | 2 + ...utedPropertyNamesContextualType6_ES6.types | 1 + ...edPropertyNamesContextualType7_ES5.symbols | 2 + ...utedPropertyNamesContextualType7_ES5.types | 1 + ...edPropertyNamesContextualType7_ES6.symbols | 2 + ...utedPropertyNamesContextualType7_ES6.types | 1 + .../constEnumPropertyAccess1.symbols | 2 + .../reference/constEnumPropertyAccess1.types | 1 + .../reference/constIndexedAccess.symbols | 3 + .../reference/constIndexedAccess.types | 3 + ...ructorWithIncompleteTypeAnnotation.symbols | 3 + ...structorWithIncompleteTypeAnnotation.types | 3 + .../contextualTypeArrayReturnType.symbols | 2 + .../contextualTypeArrayReturnType.types | 1 + ...alTypeWithUnionTypeIndexSignatures.symbols | 6 + ...tualTypeWithUnionTypeIndexSignatures.types | 6 + .../reference/convertKeywordsYes.symbols | 2 + .../reference/convertKeywordsYes.types | 1 + .../correctlyMarkAliasAsReferences1.symbols | 4 +- .../correctlyMarkAliasAsReferences1.types | 4 +- .../correctlyMarkAliasAsReferences2.symbols | 4 +- .../correctlyMarkAliasAsReferences2.types | 4 +- .../correctlyMarkAliasAsReferences3.symbols | 4 +- .../correctlyMarkAliasAsReferences3.types | 4 +- .../correctlyMarkAliasAsReferences4.symbols | 4 +- .../correctlyMarkAliasAsReferences4.types | 4 +- .../reference/cyclicModuleImport.symbols | 4 + .../reference/cyclicModuleImport.types | 4 + ...declFileAliasUseBeforeDeclaration2.symbols | 2 + .../declFileAliasUseBeforeDeclaration2.types | 2 + ...rnalModuleWithSingleExportedModule.symbols | 2 + ...ternalModuleWithSingleExportedModule.types | 2 + .../baselines/reference/declFileEnums.symbols | 7 + tests/baselines/reference/declFileEnums.types | 7 + ...leImportedTypeUseInTypeArgPosition.symbols | 4 + ...FileImportedTypeUseInTypeArgPosition.types | 4 + ...declarationEmitRelativeModuleError.symbols | 15 +- .../declarationEmitRelativeModuleError.types | 15 +- .../reference/declarationMerging2.symbols | 2 + .../reference/declarationMerging2.types | 2 + .../declarationsAndAssignments.symbols | 6 + .../declarationsAndAssignments.types | 6 + ...nalModuleWithExportAssignedFundule.symbols | 1 + ...ernalModuleWithExportAssignedFundule.types | 1 + .../reference/declaredExternalModule.symbols | 1 + .../reference/declaredExternalModule.types | 1 + ...ExternalModuleWithExportAssignment.symbols | 2 + ...edExternalModuleWithExportAssignment.types | 2 + .../decrementOperatorWithEnumType.symbols | 1 + .../decrementOperatorWithEnumType.types | 1 + ...ratorWithEnumTypeInvalidOperations.symbols | 1 + ...peratorWithEnumTypeInvalidOperations.types | 1 + .../deleteOperatorWithEnumType.symbols | 1 + .../deleteOperatorWithEnumType.types | 1 + .../reference/deleteReadonly.symbols | 2 + .../baselines/reference/deleteReadonly.types | 1 + ...terfaceIncompatibleWithBaseIndexer.symbols | 4 + ...InterfaceIncompatibleWithBaseIndexer.types | 4 + ...gArrayBindingPatternAndAssignment2.symbols | 2 + ...ingArrayBindingPatternAndAssignment2.types | 2 + ...ectBindingPatternAndAssignment1ES5.symbols | 6 + ...bjectBindingPatternAndAssignment1ES5.types | 4 + ...ectBindingPatternAndAssignment1ES6.symbols | 6 + ...bjectBindingPatternAndAssignment1ES6.types | 4 + ...ObjectBindingPatternAndAssignment3.symbols | 2 + ...ngObjectBindingPatternAndAssignment3.types | 2 + .../destructuringParameterProperties1.symbols | 1 + .../destructuringParameterProperties1.types | 1 + .../doubleUnderscoreEnumEmit.symbols | 7 + .../reference/doubleUnderscoreEnumEmit.types | 4 + ...plicateIdentifierDifferentSpelling.symbols | 5 + ...duplicateIdentifierDifferentSpelling.types | 4 + .../duplicateObjectLiteralProperty.symbols | 1 + .../duplicateObjectLiteralProperty.types | 1 + .../duplicateStringNamedProperty1.symbols | 2 + .../duplicateStringNamedProperty1.types | 2 + .../baselines/reference/dynamicNames.symbols | 8 + tests/baselines/reference/dynamicNames.types | 8 + .../reference/dynamicNamesErrors.symbols | 1 + .../reference/dynamicNamesErrors.types | 1 + ...iteralExpressionInArrowFunctionES5.symbols | 4 + ...tLiteralExpressionInArrowFunctionES5.types | 4 + ...iteralExpressionInArrowFunctionES6.symbols | 4 + ...tLiteralExpressionInArrowFunctionES6.types | 4 + ...rationWithLiteralPropertyNameInES6.symbols | 21 + ...larationWithLiteralPropertyNameInES6.types | 14 + ...iationAssignmentWithIndexingOnLHS2.symbols | 1 + ...ntiationAssignmentWithIndexingOnLHS2.types | 1 + ...iationAssignmentWithIndexingOnLHS3.symbols | 3 + ...ntiationAssignmentWithIndexingOnLHS3.types | 3 + .../reference/enumIdentifierLiterals.symbols | 9 + .../reference/enumIdentifierLiterals.types | 9 + .../enumWithNegativeInfinityProperty.symbols | 1 + .../enumWithNegativeInfinityProperty.types | 1 + .../enumWithQuotedElementName1.symbols | 1 + .../enumWithQuotedElementName1.types | 1 + .../enumWithQuotedElementName2.symbols | 1 + .../enumWithQuotedElementName2.types | 1 + .../reference/enumWithUnicodeEscape1.symbols | 1 + .../reference/enumWithUnicodeEscape1.types | 1 + .../es5ExportDefaultClassDeclaration4.symbols | 2 + .../es5ExportDefaultClassDeclaration4.types | 2 + ...5ExportDefaultFunctionDeclaration4.symbols | 2 + ...es5ExportDefaultFunctionDeclaration4.types | 2 + .../reference/es6ExportAssignment4.symbols | 2 + .../reference/es6ExportAssignment4.types | 2 + .../reference/es6ExportEqualsInterop.symbols | 20 + .../reference/es6ExportEqualsInterop.types | 20 + .../es6ImportEqualsDeclaration2.symbols | 4 + .../es6ImportEqualsDeclaration2.types | 4 + ...pedReservedCompilerNamedIdentifier.symbols | 6 + ...capedReservedCompilerNamedIdentifier.types | 3 + ...rtDeclarationsInAmbientNamespaces2.symbols | 2 + ...portDeclarationsInAmbientNamespaces2.types | 2 + .../reference/exportDefaultProperty.symbols | 4 + .../reference/exportDefaultProperty.types | 4 + .../reference/exportDefaultVariable.symbols | 2 + .../reference/exportDefaultVariable.types | 2 + .../exportEqualsDefaultProperty.symbols | 4 + .../exportEqualsDefaultProperty.types | 2 + .../reference/exportEqualsOfModule.symbols | 8 + .../reference/exportEqualsOfModule.types | 8 + .../reference/exportEqualsProperty.symbols | 4 + .../reference/exportEqualsProperty.types | 4 + ...cifierAndExportedMemberDeclaration.symbols | 4 + ...pecifierAndExportedMemberDeclaration.types | 4 + ...SpecifierAndLocalMemberDeclaration.symbols | 4 + ...rtSpecifierAndLocalMemberDeclaration.types | 4 + ...cifierReferencingOuterDeclaration1.symbols | 2 + ...pecifierReferencingOuterDeclaration1.types | 2 + ...cifierReferencingOuterDeclaration3.symbols | 2 + ...pecifierReferencingOuterDeclaration3.types | 2 + .../exportsAndImportsWithUnderscores1.symbols | 5 + .../exportsAndImportsWithUnderscores1.types | 3 + .../exportsAndImportsWithUnderscores2.symbols | 3 + .../exportsAndImportsWithUnderscores2.types | 2 + .../exportsAndImportsWithUnderscores3.symbols | 5 + .../exportsAndImportsWithUnderscores3.types | 3 + .../exportsInAmbientModules1.symbols | 2 + .../reference/exportsInAmbientModules1.types | 2 + .../exportsInAmbientModules2.symbols | 7 +- .../reference/exportsInAmbientModules2.types | 7 +- ...ingClassFromAliasAndUsageInIndexer.symbols | 2 + ...ndingClassFromAliasAndUsageInIndexer.types | 2 + ...alModuleReferenceDoubleUnderscore1.symbols | 4 + ...rnalModuleReferenceDoubleUnderscore1.types | 4 + ...ResolutionOrderInImportDeclaration.symbols | 2 + ...ceResolutionOrderInImportDeclaration.types | 2 + .../reference/fixSignatureCaching.symbols | 467 ++++++++++++++++++ .../reference/fixSignatureCaching.types | 234 +++++++++ .../reference/implicitIndexSignatures.symbols | 4 + .../reference/implicitIndexSignatures.types | 4 + ...fereingExternalModuleWithNoResolve.symbols | 2 + ...RefereingExternalModuleWithNoResolve.types | 2 + ...ithDeclareModifierInAmbientContext.symbols | 2 + ...lWithDeclareModifierInAmbientContext.types | 2 + ...ndExportAssignmentInAmbientContext.symbols | 2 + ...rAndExportAssignmentInAmbientContext.types | 2 + ...WithExportModifierInAmbientContext.symbols | 2 + ...clWithExportModifierInAmbientContext.types | 2 + ...renecing-aliased-type-throug-array.symbols | 2 + ...ferenecing-aliased-type-throug-array.types | 2 + .../importsInAmbientModules1.symbols | 2 + .../reference/importsInAmbientModules1.types | 2 + .../importsInAmbientModules2.symbols | 2 + .../reference/importsInAmbientModules2.types | 2 + .../importsInAmbientModules3.symbols | 2 + .../reference/importsInAmbientModules3.types | 2 + .../reference/inOperatorWithFunction.symbols | 1 + .../reference/inOperatorWithFunction.types | 1 + .../reference/incompatibleExports1.symbols | 4 + .../reference/incompatibleExports1.types | 4 + .../reference/incompatibleExports2.symbols | 2 + .../reference/incompatibleExports2.types | 2 + .../incrementOperatorWithEnumType.symbols | 1 + .../incrementOperatorWithEnumType.types | 1 + ...ratorWithEnumTypeInvalidOperations.symbols | 1 + ...peratorWithEnumTypeInvalidOperations.types | 1 + .../indexSignaturesInferentialTyping.symbols | 4 + .../indexSignaturesInferentialTyping.types | 4 + tests/baselines/reference/indexer.symbols | 2 + tests/baselines/reference/indexer.types | 2 + tests/baselines/reference/indexerA.symbols | 2 + tests/baselines/reference/indexerA.types | 2 + .../reference/indexersInClassType.symbols | 2 + .../reference/indexersInClassType.types | 2 + .../inferringAnyFunctionType1.symbols | 1 + .../reference/inferringAnyFunctionType1.types | 1 + ...dIndexSignaturesFromDifferentBases.symbols | 1 + ...AndIndexSignaturesFromDifferentBases.types | 1 + .../initializersInDeclarations.symbols | 2 + .../initializersInDeclarations.types | 1 + ...aceExtendsObjectIntersectionErrors.symbols | 2 + ...rfaceExtendsObjectIntersectionErrors.types | 2 + ...tringIndexerHidingBaseTypeIndexer2.symbols | 2 + ...hStringIndexerHidingBaseTypeIndexer2.types | 2 + ...tringIndexerHidingBaseTypeIndexer3.symbols | 4 + ...hStringIndexerHidingBaseTypeIndexer3.types | 4 + .../invalidNumberAssignments.symbols | 1 + .../reference/invalidNumberAssignments.types | 1 + .../invalidStringAssignments.symbols | 1 + .../reference/invalidStringAssignments.types | 1 + .../reference/invalidVoidAssignments.symbols | 1 + .../reference/invalidVoidAssignments.types | 1 + .../reference/iterableArrayPattern21.symbols | 2 + .../reference/iterableArrayPattern21.types | 2 + .../reference/iterableArrayPattern22.symbols | 2 + .../reference/iterableArrayPattern22.types | 2 + .../reference/iterableArrayPattern23.symbols | 2 + .../reference/iterableArrayPattern23.types | 2 + .../reference/iterableArrayPattern24.symbols | 2 + .../reference/iterableArrayPattern24.types | 2 + .../reference/jsxImportInAttribute.symbols | 2 + .../reference/jsxImportInAttribute.types | 2 + .../reference/jsxViaImport.2.symbols | 2 + .../baselines/reference/jsxViaImport.2.types | 2 + .../baselines/reference/jsxViaImport.symbols | 2 + tests/baselines/reference/jsxViaImport.types | 2 + .../reference/limitDeepInstantiations.symbols | 1 + .../reference/limitDeepInstantiations.types | 1 + .../literalsInComputedProperties1.symbols | 18 + .../literalsInComputedProperties1.types | 13 + ...maxNodeModuleJsDepthDefaultsToZero.symbols | 2 + .../maxNodeModuleJsDepthDefaultsToZero.types | 2 + .../reference/mergedDeclarations6.symbols | 2 + .../reference/mergedDeclarations6.types | 2 + .../reference/mergedDeclarations7.symbols | 2 + .../reference/mergedDeclarations7.types | 2 + .../mergedInterfacesWithIndexers2.symbols | 2 + .../mergedInterfacesWithIndexers2.types | 2 + .../missingFunctionImplementation2.symbols | 2 + .../missingFunctionImplementation2.types | 2 + .../missingImportAfterModuleImport.symbols | 2 + .../missingImportAfterModuleImport.types | 2 + ...ationCollidingNamesInAugmentation1.symbols | 4 + ...ntationCollidingNamesInAugmentation1.types | 4 + ...moduleAugmentationDeclarationEmit1.symbols | 2 + .../moduleAugmentationDeclarationEmit1.types | 2 + ...moduleAugmentationDeclarationEmit2.symbols | 2 + .../moduleAugmentationDeclarationEmit2.types | 2 + ...leAugmentationDisallowedExtensions.symbols | 4 + ...duleAugmentationDisallowedExtensions.types | 4 + ...leAugmentationExtendAmbientModule1.symbols | 4 + ...duleAugmentationExtendAmbientModule1.types | 4 + ...leAugmentationExtendAmbientModule2.symbols | 4 + ...duleAugmentationExtendAmbientModule2.types | 4 + ...oduleAugmentationExtendFileModule1.symbols | 2 + .../moduleAugmentationExtendFileModule1.types | 2 + ...oduleAugmentationExtendFileModule2.symbols | 2 + .../moduleAugmentationExtendFileModule2.types | 2 + .../moduleAugmentationGlobal5.symbols | 4 + .../reference/moduleAugmentationGlobal5.types | 4 + ...duleAugmentationImportsAndExports1.symbols | 2 + ...moduleAugmentationImportsAndExports1.types | 2 + ...duleAugmentationImportsAndExports2.symbols | 2 + ...moduleAugmentationImportsAndExports2.types | 2 + ...duleAugmentationImportsAndExports3.symbols | 2 + ...moduleAugmentationImportsAndExports3.types | 2 + ...duleAugmentationImportsAndExports4.symbols | 2 + ...moduleAugmentationImportsAndExports4.types | 2 + ...duleAugmentationImportsAndExports5.symbols | 2 + ...moduleAugmentationImportsAndExports5.types | 2 + ...duleAugmentationImportsAndExports6.symbols | 2 + ...moduleAugmentationImportsAndExports6.types | 2 + ...moduleAugmentationInAmbientModule1.symbols | 8 + .../moduleAugmentationInAmbientModule1.types | 8 + ...moduleAugmentationInAmbientModule2.symbols | 8 + .../moduleAugmentationInAmbientModule2.types | 8 + ...moduleAugmentationInAmbientModule3.symbols | 12 + .../moduleAugmentationInAmbientModule3.types | 12 + ...moduleAugmentationInAmbientModule4.symbols | 12 + .../moduleAugmentationInAmbientModule4.types | 12 + ...moduleAugmentationInAmbientModule5.symbols | 4 + .../moduleAugmentationInAmbientModule5.types | 4 + .../moduleAugmentationInDependency.symbols | 9 +- .../moduleAugmentationInDependency.types | 9 +- .../moduleAugmentationInDependency2.symbols | 9 +- .../moduleAugmentationInDependency2.types | 9 +- .../moduleAugmentationNoNewNames.symbols | 2 + .../moduleAugmentationNoNewNames.types | 2 + .../moduleAugmentationsBundledOutput1.symbols | 8 + .../moduleAugmentationsBundledOutput1.types | 8 + .../moduleAugmentationsImports1.symbols | 6 + .../moduleAugmentationsImports1.types | 6 + .../moduleAugmentationsImports2.symbols | 6 + .../moduleAugmentationsImports2.types | 6 + .../moduleAugmentationsImports3.symbols | 8 + .../moduleAugmentationsImports3.types | 8 + .../moduleAugmentationsImports4.symbols | 10 + .../moduleAugmentationsImports4.types | 10 + .../moduleElementsInWrongContext.symbols | 1 + .../moduleElementsInWrongContext.types | 1 + .../moduleElementsInWrongContext2.symbols | 1 + .../moduleElementsInWrongContext2.types | 1 + .../moduleElementsInWrongContext3.symbols | 1 + .../moduleElementsInWrongContext3.types | 1 + .../reference/moduleMergeConstructor.symbols | 4 + .../reference/moduleMergeConstructor.types | 4 + ...nWithExtensions_withAmbientPresent.symbols | 2 + ...ionWithExtensions_withAmbientPresent.types | 2 + ...module_augmentUninstantiatedModule.symbols | 5 + .../module_augmentUninstantiatedModule.types | 5 + tests/baselines/reference/moduledecl.symbols | 2 + tests/baselines/reference/moduledecl.types | 2 + ...ortAssignmentsInAmbientDeclaration.symbols | 2 + ...xportAssignmentsInAmbientDeclaration.types | 2 + .../reference/multipleNumericIndexers.symbols | 2 + .../reference/multipleNumericIndexers.types | 2 + .../negateOperatorWithEnumType.symbols | 1 + .../negateOperatorWithEnumType.types | 1 + .../baselines/reference/newWithSpread.symbols | 2 + tests/baselines/reference/newWithSpread.types | 2 + .../reference/newWithSpreadES5.symbols | 2 + .../reference/newWithSpreadES5.types | 2 + .../reference/newWithSpreadES6.symbols | 2 + .../reference/newWithSpreadES6.types | 2 + .../reference/noImplicitAnyIndexing.symbols | 7 + .../reference/noImplicitAnyIndexing.types | 4 + .../noImplicitAnyIndexingSuppressed.symbols | 7 + .../noImplicitAnyIndexingSuppressed.types | 4 + ...noImplicitAnyStringIndexerOnObject.symbols | 1 + .../noImplicitAnyStringIndexerOnObject.types | 1 + .../reference/nodeResolution5.symbols | 2 + .../baselines/reference/nodeResolution5.types | 2 + .../reference/nodeResolution7.symbols | 2 + .../baselines/reference/nodeResolution7.types | 2 + .../reference/numericClassMembers1.symbols | 9 + .../reference/numericClassMembers1.types | 6 + .../reference/numericIndexExpressions.symbols | 2 + .../reference/numericIndexExpressions.types | 2 + ...exerConstrainsPropertyDeclarations.symbols | 49 ++ ...ndexerConstrainsPropertyDeclarations.types | 43 ++ ...xerConstrainsPropertyDeclarations2.symbols | 25 + ...dexerConstrainsPropertyDeclarations2.types | 24 + .../numericIndexerConstraint.symbols | 2 + .../reference/numericIndexerConstraint.types | 2 + .../numericIndexerConstraint3.symbols | 1 + .../reference/numericIndexerConstraint3.types | 1 + .../numericIndexerConstraint4.symbols | 1 + .../reference/numericIndexerConstraint4.types | 1 + .../numericIndexerConstraint5.symbols | 1 + .../reference/numericIndexerConstraint5.types | 1 + .../reference/numericIndexingResults.symbols | 15 + .../reference/numericIndexingResults.types | 14 + .../reference/numericMethodName1.symbols | 1 + .../reference/numericMethodName1.types | 1 + .../numericNamedPropertyDuplicates.symbols | 16 + .../numericNamedPropertyDuplicates.types | 15 + ...ericStringNamedPropertyEquivalence.symbols | 16 + ...umericStringNamedPropertyEquivalence.types | 15 + .../objectLitIndexerContextualType.symbols | 2 + .../objectLitIndexerContextualType.types | 2 + .../objectLiteralEnumPropertyNames.symbols | 2 + .../objectLiteralEnumPropertyNames.types | 2 + .../reference/objectLiteralErrors.symbols | 44 ++ .../reference/objectLiteralErrors.types | 44 ++ .../objectLiteralExcessProperties.symbols | 3 + .../objectLiteralExcessProperties.types | 3 + .../objectLiteralGettersAndSetters.symbols | 10 + .../objectLiteralGettersAndSetters.types | 10 + .../objectLiteralIndexerErrors.symbols | 2 + .../objectLiteralIndexerErrors.types | 2 + .../reference/objectLiteralIndexers.symbols | 3 + .../reference/objectLiteralIndexers.types | 3 + .../objectLiteralParameterResolution.symbols | 1 + .../objectLiteralParameterResolution.types | 1 + ...pertiesErrorFromNotUsingIdentifier.symbols | 4 + ...ropertiesErrorFromNotUsingIdentifier.types | 2 + ...jectLiteralWithNumericPropertyName.symbols | 3 + ...objectLiteralWithNumericPropertyName.types | 2 + .../baselines/reference/objectSpread.symbols | 3 + tests/baselines/reference/objectSpread.types | 3 + ...ctTypeWithDuplicateNumericProperty.symbols | 28 ++ ...jectTypeWithDuplicateNumericProperty.types | 25 + .../objectTypeWithNumericProperty.symbols | 12 + .../objectTypeWithNumericProperty.types | 11 + ...TypeWithStringNamedNumericProperty.symbols | 49 ++ ...ctTypeWithStringNamedNumericProperty.types | 44 ++ ...ngNamedPropertyOfIllegalCharacters.symbols | 24 + ...ringNamedPropertyOfIllegalCharacters.types | 22 + ...tTypesIdentityWithNumericIndexers1.symbols | 1 + ...ectTypesIdentityWithNumericIndexers1.types | 1 + ...tTypesIdentityWithNumericIndexers2.symbols | 1 + ...ectTypesIdentityWithNumericIndexers2.types | 1 + ...tTypesIdentityWithNumericIndexers3.symbols | 1 + ...ectTypesIdentityWithNumericIndexers3.types | 1 + ...objectTypesWithOptionalProperties2.symbols | 1 + .../objectTypesWithOptionalProperties2.types | 1 + .../reference/octalIntegerLiteral.symbols | 6 + .../reference/octalIntegerLiteral.types | 4 + .../reference/octalIntegerLiteralES6.symbols | 6 + .../reference/octalIntegerLiteralES6.types | 4 + .../octalIntegerLiteralError.symbols | 6 + .../reference/octalIntegerLiteralError.types | 3 + ...syncGenerators.classMethods.esnext.symbols | 1 + ....asyncGenerators.classMethods.esnext.types | 1 + .../reference/parser0_004152.symbols | 14 + .../baselines/reference/parser0_004152.types | 14 + .../parserClassDeclaration19.symbols | 1 + .../reference/parserClassDeclaration19.types | 1 + .../parserClassDeclaration20.symbols | 3 + .../reference/parserClassDeclaration20.types | 3 + .../parserClassDeclaration21.symbols | 3 + .../reference/parserClassDeclaration21.types | 3 + .../parserClassDeclaration22.symbols | 3 + .../reference/parserClassDeclaration22.types | 3 + tests/baselines/reference/parserEnum5.symbols | 3 + tests/baselines/reference/parserEnum5.types | 3 + tests/baselines/reference/parserEnum6.symbols | 3 + tests/baselines/reference/parserEnum6.types | 3 + tests/baselines/reference/parserEnum7.symbols | 3 + tests/baselines/reference/parserEnum7.types | 3 + ...Recovery_IncompleteMemberVariable2.symbols | 1 + ...orRecovery_IncompleteMemberVariable2.types | 1 + .../reference/parserExportAssignment6.symbols | 7 +- .../reference/parserExportAssignment6.types | 2 + .../parserFunctionPropertyAssignment2.symbols | 1 + .../parserFunctionPropertyAssignment2.types | 1 + .../parserFunctionPropertyAssignment3.symbols | 1 + .../parserFunctionPropertyAssignment3.types | 1 + .../parserFunctionPropertyAssignment4.symbols | 1 + .../parserFunctionPropertyAssignment4.types | 1 + .../reference/parserInExpression1.symbols | 3 +- .../reference/parserInExpression1.types | 1 + .../parserMemberAccessorDeclaration2.symbols | 1 + .../parserMemberAccessorDeclaration2.types | 1 + .../parserMemberAccessorDeclaration3.symbols | 1 + .../parserMemberAccessorDeclaration3.types | 1 + .../parserMemberAccessorDeclaration5.symbols | 1 + .../parserMemberAccessorDeclaration5.types | 1 + .../parserMemberAccessorDeclaration6.symbols | 1 + .../parserMemberAccessorDeclaration6.types | 1 + .../reference/parserMethodSignature10.symbols | 1 + .../reference/parserMethodSignature10.types | 1 + .../reference/parserMethodSignature11.symbols | 1 + .../reference/parserMethodSignature11.types | 1 + .../reference/parserMethodSignature12.symbols | 1 + .../reference/parserMethodSignature12.types | 1 + .../reference/parserMethodSignature5.symbols | 1 + .../reference/parserMethodSignature5.types | 1 + .../reference/parserMethodSignature6.symbols | 1 + .../reference/parserMethodSignature6.types | 1 + .../reference/parserMethodSignature7.symbols | 1 + .../reference/parserMethodSignature7.types | 1 + .../reference/parserMethodSignature8.symbols | 1 + .../reference/parserMethodSignature8.types | 1 + .../reference/parserMethodSignature9.symbols | 1 + .../reference/parserMethodSignature9.types | 1 + .../parserModuleDeclaration1.d.symbols | 4 +- .../parserModuleDeclaration1.d.types | 4 +- .../parserModuleDeclaration1.symbols | 4 +- .../reference/parserModuleDeclaration1.types | 4 +- .../parserModuleDeclaration2.symbols | 4 +- .../reference/parserModuleDeclaration2.types | 4 +- .../parserPropertySignature10.symbols | 1 + .../reference/parserPropertySignature10.types | 1 + .../parserPropertySignature11.symbols | 1 + .../reference/parserPropertySignature11.types | 1 + .../parserPropertySignature12.symbols | 1 + .../reference/parserPropertySignature12.types | 1 + .../parserPropertySignature5.symbols | 1 + .../reference/parserPropertySignature5.types | 1 + .../parserPropertySignature6.symbols | 1 + .../reference/parserPropertySignature6.types | 1 + .../parserPropertySignature7.symbols | 1 + .../reference/parserPropertySignature7.types | 1 + .../parserPropertySignature8.symbols | 1 + .../reference/parserPropertySignature8.types | 1 + .../parserPropertySignature9.symbols | 1 + .../reference/parserPropertySignature9.types | 1 + ...parserShorthandPropertyAssignment3.symbols | 1 + .../parserShorthandPropertyAssignment3.types | 1 + ...parserShorthandPropertyAssignment4.symbols | 1 + .../parserShorthandPropertyAssignment4.types | 1 + ...ntIsNotAMemberVariableDeclaration1.symbols | 1 + ...mentIsNotAMemberVariableDeclaration1.types | 1 + .../reference/parserSymbolIndexer5.symbols | 1 + .../reference/parserSymbolIndexer5.types | 1 + .../plusOperatorWithEnumType.symbols | 1 + .../reference/plusOperatorWithEnumType.types | 1 + .../privacyCannotNameAccessorDeclFile.symbols | 2 + .../privacyCannotNameAccessorDeclFile.types | 2 + .../privacyCannotNameVarTypeDeclFile.symbols | 2 + .../privacyCannotNameVarTypeDeclFile.types | 2 + ...ionCannotNameParameterTypeDeclFile.symbols | 2 + ...ctionCannotNameParameterTypeDeclFile.types | 2 + ...nctionCannotNameReturnTypeDeclFile.symbols | 2 + ...FunctionCannotNameReturnTypeDeclFile.types | 2 + .../reference/privacyGloImport.symbols | 6 + .../reference/privacyGloImport.types | 6 + .../privacyGloImportParseErrors.symbols | 13 + .../privacyGloImportParseErrors.types | 13 + .../privacyImportParseErrors.symbols | 26 + .../reference/privacyImportParseErrors.types | 26 + ...ientExternalModuleImportWithExport.symbols | 4 + ...mbientExternalModuleImportWithExport.types | 4 + ...tExternalModuleImportWithoutExport.symbols | 4 + ...entExternalModuleImportWithoutExport.types | 4 + .../reference/propertiesAndIndexers.symbols | 11 + .../reference/propertiesAndIndexers.types | 11 + .../reference/propertiesAndIndexers2.symbols | 7 + .../reference/propertiesAndIndexers2.types | 7 + ...opertiesAndIndexersForNumericNames.symbols | 51 ++ ...propertiesAndIndexersForNumericNames.types | 27 + .../reference/propertyAccess.symbols | 8 + .../baselines/reference/propertyAccess.types | 6 + ...ropertyIdentityWithPrivacyMismatch.symbols | 4 + .../propertyIdentityWithPrivacyMismatch.types | 4 + .../propertyNamesWithStringLiteral.symbols | 2 + .../propertyNamesWithStringLiteral.types | 2 + .../protoAsIndexInIndexExpression.symbols | 3 + .../protoAsIndexInIndexExpression.types | 2 + .../reference/quotedAccessorName1.symbols | 1 + .../reference/quotedAccessorName1.types | 1 + .../reference/quotedAccessorName2.symbols | 1 + .../reference/quotedAccessorName2.types | 1 + .../reference/quotedFunctionName1.symbols | 1 + .../reference/quotedFunctionName1.types | 1 + .../reference/quotedFunctionName2.symbols | 1 + .../reference/quotedFunctionName2.types | 1 + .../quotedModuleNameMustBeAmbient.symbols | 8 +- .../quotedModuleNameMustBeAmbient.types | 8 +- .../reference/quotedPropertyName1.symbols | 1 + .../reference/quotedPropertyName1.types | 1 + .../reference/quotedPropertyName2.symbols | 1 + .../reference/quotedPropertyName2.types | 1 + .../reference/quotedPropertyName3.symbols | 2 + .../reference/quotedPropertyName3.types | 2 + .../reactNamespaceImportPresevation.symbols | 2 + .../reactNamespaceImportPresevation.types | 2 + ...xportAssignmentAndFindAliasedType1.symbols | 2 + ...eExportAssignmentAndFindAliasedType1.types | 2 + ...xportAssignmentAndFindAliasedType2.symbols | 4 + ...eExportAssignmentAndFindAliasedType2.types | 4 + ...xportAssignmentAndFindAliasedType3.symbols | 6 + ...eExportAssignmentAndFindAliasedType3.types | 6 + ...uleNameWithSameLetDeclarationName2.symbols | 2 + ...oduleNameWithSameLetDeclarationName2.types | 2 + .../restElementWithAssignmentPattern2.symbols | 1 + .../restElementWithAssignmentPattern2.types | 1 + .../restElementWithAssignmentPattern4.symbols | 1 + .../restElementWithAssignmentPattern4.types | 1 + .../reference/shebangBeforeReferences.symbols | 2 + .../reference/shebangBeforeReferences.types | 2 + ...aticMemberWithStringAndNumberNames.symbols | 3 + ...staticMemberWithStringAndNumberNames.types | 2 + .../strictPropertyInitialization.symbols | 3 + .../strictPropertyInitialization.types | 3 + .../stringIndexerAndConstructor.symbols | 2 + .../stringIndexerAndConstructor.types | 2 + .../stringIndexerAndConstructor1.symbols | 1 + .../stringIndexerAndConstructor1.types | 1 + ...exerConstrainsPropertyDeclarations.symbols | 48 ++ ...ndexerConstrainsPropertyDeclarations.types | 42 ++ ...ngLiteralObjectLiteralDeclaration1.symbols | 1 + ...ringLiteralObjectLiteralDeclaration1.types | 1 + ...lPropertyNameWithLineContinuation1.symbols | 2 + ...ralPropertyNameWithLineContinuation1.types | 1 + .../stringNamedPropertyAccess.symbols | 6 + .../reference/stringNamedPropertyAccess.types | 6 + .../stringNamedPropertyDuplicates.symbols | 16 + .../stringNamedPropertyDuplicates.types | 15 + .../reference/stringPropCodeGen.symbols | 3 + .../reference/stringPropCodeGen.types | 2 + .../subtypingWithObjectMembers.symbols | 16 + .../subtypingWithObjectMembers.types | 16 + .../subtypingWithObjectMembers2.symbols | 16 + .../subtypingWithObjectMembers2.types | 16 + .../subtypingWithObjectMembers3.symbols | 16 + .../subtypingWithObjectMembers3.types | 16 + .../subtypingWithObjectMembers4.symbols | 4 + .../subtypingWithObjectMembers4.types | 4 + .../subtypingWithObjectMembers5.symbols | 8 + .../subtypingWithObjectMembers5.types | 8 + ...pingWithObjectMembersAccessibility.symbols | 4 + ...typingWithObjectMembersAccessibility.types | 4 + ...ingWithObjectMembersAccessibility2.symbols | 8 + ...ypingWithObjectMembersAccessibility2.types | 8 + ...typingWithObjectMembersOptionality.symbols | 8 + ...ubtypingWithObjectMembersOptionality.types | 8 + ...ypingWithObjectMembersOptionality2.symbols | 4 + ...btypingWithObjectMembersOptionality2.types | 4 + ...ypingWithObjectMembersOptionality3.symbols | 4 + ...btypingWithObjectMembersOptionality3.types | 4 + ...ypingWithObjectMembersOptionality4.symbols | 4 + ...btypingWithObjectMembersOptionality4.types | 4 + .../reference/symbolProperty17.symbols | 1 + .../reference/symbolProperty17.types | 1 + .../reference/systemExportAssignment3.symbols | 2 + .../reference/systemExportAssignment3.types | 2 + .../reference/topLevelAmbientModule.symbols | 2 + .../reference/topLevelAmbientModule.types | 2 + .../topLevelModuleDeclarationAndFile.symbols | 2 + .../topLevelModuleDeclarationAndFile.types | 2 + .../transformNestedGeneratorsWithTry.symbols | 2 + .../transformNestedGeneratorsWithTry.types | 2 + .../tsxAttributeInvalidNames.symbols | 3 + .../reference/tsxAttributeInvalidNames.types | 3 + .../reference/tsxAttributeResolution7.symbols | 1 + .../reference/tsxAttributeResolution7.types | 1 + .../reference/tsxDynamicTagName5.symbols | 2 + .../reference/tsxDynamicTagName5.types | 2 + .../reference/tsxDynamicTagName7.symbols | 2 + .../reference/tsxDynamicTagName7.types | 2 + .../reference/tsxDynamicTagName8.symbols | 2 + .../reference/tsxDynamicTagName8.types | 2 + .../reference/tsxDynamicTagName9.symbols | 2 + .../reference/tsxDynamicTagName9.types | 2 + .../reference/tsxElementResolution.symbols | 3 + .../reference/tsxElementResolution.types | 3 + .../reference/tsxElementResolution17.symbols | 4 + .../reference/tsxElementResolution17.types | 4 + .../reference/tsxElementResolution19.symbols | 9 +- .../reference/tsxElementResolution19.types | 9 +- .../reference/tsxExternalModuleEmit1.symbols | 2 + .../reference/tsxExternalModuleEmit1.types | 2 + .../reference/tsxExternalModuleEmit2.symbols | 2 + .../reference/tsxExternalModuleEmit2.types | 2 + .../reference/tsxPreserveEmit1.symbols | 4 + .../reference/tsxPreserveEmit1.types | 4 + .../tsxSpreadAttributesResolution4.symbols | 1 + .../tsxSpreadAttributesResolution4.types | 1 + ...tatelessFunctionComponentOverload1.symbols | 2 + ...xStatelessFunctionComponentOverload1.types | 2 + ...tatelessFunctionComponentOverload2.symbols | 2 + ...xStatelessFunctionComponentOverload2.types | 2 + ...tatelessFunctionComponentOverload4.symbols | 1 + ...xStatelessFunctionComponentOverload4.types | 1 + ...tatelessFunctionComponentOverload5.symbols | 1 + ...xStatelessFunctionComponentOverload5.types | 1 + ...tatelessFunctionComponentOverload6.symbols | 1 + ...xStatelessFunctionComponentOverload6.types | 1 + .../tsxStatelessFunctionComponents1.symbols | 2 + .../tsxStatelessFunctionComponents1.types | 2 + ...nctionComponentsWithTypeArguments2.symbols | 1 + ...FunctionComponentsWithTypeArguments2.types | 1 + ...nctionComponentsWithTypeArguments3.symbols | 1 + ...FunctionComponentsWithTypeArguments3.types | 1 + ...nctionComponentsWithTypeArguments4.symbols | 1 + ...FunctionComponentsWithTypeArguments4.types | 1 + ...nctionComponentsWithTypeArguments5.symbols | 1 + ...FunctionComponentsWithTypeArguments5.types | 1 + .../reference/typeAliasExport.symbols | 2 + .../baselines/reference/typeAliasExport.types | 2 + ...tationBestCommonTypeInArrayLiteral.symbols | 15 + ...notationBestCommonTypeInArrayLiteral.types | 8 + .../reference/typeGuardFunctionErrors.symbols | 2 + .../reference/typeGuardFunctionErrors.types | 2 + .../reference/typeOfOnTypeArg.symbols | 1 + .../baselines/reference/typeOfOnTypeArg.types | 1 + .../typeReferenceDirectives12.symbols | 2 + .../reference/typeReferenceDirectives12.types | 2 + .../typeReferenceDirectives9.symbols | 2 + .../reference/typeReferenceDirectives9.types | 2 + ...FromMultipleNodeModulesDirectories.symbols | 6 + ...tsFromMultipleNodeModulesDirectories.types | 6 + ...tsFromNodeModulesInParentDirectory.symbols | 2 + ...ootsFromNodeModulesInParentDirectory.types | 2 + .../typeofOperatorWithEnumType.symbols | 1 + .../typeofOperatorWithEnumType.types | 1 + .../reference/umd-augmentation-1.symbols | 2 + .../reference/umd-augmentation-1.types | 2 + .../reference/umd-augmentation-2.symbols | 2 + .../reference/umd-augmentation-2.types | 2 + .../reference/umd-augmentation-3.symbols | 2 + .../reference/umd-augmentation-3.types | 2 + .../reference/umd-augmentation-4.symbols | 2 + .../reference/umd-augmentation-4.types | 2 + tests/baselines/reference/umd-errors.symbols | 12 +- tests/baselines/reference/umd-errors.types | 2 + .../underscoreEscapedNameInEnum.symbols | 2 + .../underscoreEscapedNameInEnum.types | 1 + .../reference/underscoreTest1.symbols | 9 + .../baselines/reference/underscoreTest1.types | 9 + .../unionAndIntersectionInference1.symbols | 1 + .../unionAndIntersectionInference1.types | 1 + .../unionTypeFromArrayLiteral.symbols | 4 + .../reference/unionTypeFromArrayLiteral.types | 4 + .../untypedModuleImport_vsAmbient.symbols | 2 + .../untypedModuleImport_vsAmbient.types | 2 + ...typedModuleImport_withAugmentation.symbols | 2 + ...untypedModuleImport_withAugmentation.types | 2 + ...ypedModuleImport_withAugmentation2.symbols | 2 + ...ntypedModuleImport_withAugmentation2.types | 2 + .../voidOperatorWithEnumType.symbols | 1 + .../reference/voidOperatorWithEnumType.types | 1 + 789 files changed, 3820 insertions(+), 119 deletions(-) diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 17eda776bda..bc25bfd12d6 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -52,7 +52,7 @@ class TypeWriterWalker { } private *visitNode(node: ts.Node, isSymbolWalk: boolean): IterableIterator { - if (ts.isExpressionNode(node) || node.kind === ts.SyntaxKind.Identifier) { + if (ts.isExpressionNode(node) || node.kind === ts.SyntaxKind.Identifier || ts.isDeclarationName(node)) { const result = this.writeTypeOrSymbol(node, isSymbolWalk); if (result) { yield result; @@ -122,4 +122,4 @@ class TypeWriterWalker { symbol: symbolString }; } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/ClassDeclaration21.symbols b/tests/baselines/reference/ClassDeclaration21.symbols index f9bd42a3a4f..3d0b571ea37 100644 --- a/tests/baselines/reference/ClassDeclaration21.symbols +++ b/tests/baselines/reference/ClassDeclaration21.symbols @@ -3,5 +3,8 @@ class C { >C : Symbol(C, Decl(ClassDeclaration21.ts, 0, 0)) 0(); +>0 : Symbol(C[0], Decl(ClassDeclaration21.ts, 0, 9)) + 1() { } +>1 : Symbol(C[1], Decl(ClassDeclaration21.ts, 1, 8)) } diff --git a/tests/baselines/reference/ClassDeclaration21.types b/tests/baselines/reference/ClassDeclaration21.types index fa41bb54676..32ed0db413e 100644 --- a/tests/baselines/reference/ClassDeclaration21.types +++ b/tests/baselines/reference/ClassDeclaration21.types @@ -3,5 +3,8 @@ class C { >C : C 0(); +>0 : () => any + 1() { } +>1 : () => void } diff --git a/tests/baselines/reference/ClassDeclaration22.symbols b/tests/baselines/reference/ClassDeclaration22.symbols index 059ff9e825c..b53258c6ee5 100644 --- a/tests/baselines/reference/ClassDeclaration22.symbols +++ b/tests/baselines/reference/ClassDeclaration22.symbols @@ -3,5 +3,8 @@ class C { >C : Symbol(C, Decl(ClassDeclaration22.ts, 0, 0)) "foo"(); +>"foo" : Symbol(C["foo"], Decl(ClassDeclaration22.ts, 0, 9)) + "bar"() { } +>"bar" : Symbol(C["bar"], Decl(ClassDeclaration22.ts, 1, 12)) } diff --git a/tests/baselines/reference/ClassDeclaration22.types b/tests/baselines/reference/ClassDeclaration22.types index 359ac950462..768160a8ac9 100644 --- a/tests/baselines/reference/ClassDeclaration22.types +++ b/tests/baselines/reference/ClassDeclaration22.types @@ -3,5 +3,8 @@ class C { >C : C "foo"(); +>"foo" : () => any + "bar"() { } +>"bar" : () => void } diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.symbols b/tests/baselines/reference/aliasOnMergedModuleInterface.symbols index c4f5c0730a1..253c5639f5d 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.symbols +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.symbols @@ -19,6 +19,7 @@ var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be err === tests/cases/compiler/aliasOnMergedModuleInterface_0.ts === declare module "foo" +>"foo" : Symbol("foo", Decl(aliasOnMergedModuleInterface_0.ts, 0, 0)) { module B { >B : Symbol(B, Decl(aliasOnMergedModuleInterface_0.ts, 1, 1), Decl(aliasOnMergedModuleInterface_0.ts, 5, 5)) diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.types b/tests/baselines/reference/aliasOnMergedModuleInterface.types index 9ba023a8dd8..fb9c197feec 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.types +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.types @@ -26,6 +26,7 @@ var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be err === tests/cases/compiler/aliasOnMergedModuleInterface_0.ts === declare module "foo" +>"foo" : typeof "foo" { module B { >B : any diff --git a/tests/baselines/reference/ambientDeclarations.symbols b/tests/baselines/reference/ambientDeclarations.symbols index ef5c5403ccf..1436c698cff 100644 --- a/tests/baselines/reference/ambientDeclarations.symbols +++ b/tests/baselines/reference/ambientDeclarations.symbols @@ -160,6 +160,8 @@ var q = M1.fn(); // Ambient external module in the global module // Ambient external module with a string literal name that is a top level external module name declare module 'external1' { +>'external1' : Symbol('external1', Decl(ambientDeclarations.ts, 67, 16)) + var q; >q : Symbol(q, Decl(ambientDeclarations.ts, 72, 7)) } diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types index a571eb9fa7b..3d0b53ee19d 100644 --- a/tests/baselines/reference/ambientDeclarations.types +++ b/tests/baselines/reference/ambientDeclarations.types @@ -163,6 +163,8 @@ var q = M1.fn(); // Ambient external module in the global module // Ambient external module with a string literal name that is a top level external module name declare module 'external1' { +>'external1' : typeof 'external1' + var q; >q : any } diff --git a/tests/baselines/reference/ambientDeclarationsExternal.symbols b/tests/baselines/reference/ambientDeclarationsExternal.symbols index 57d3fdf914f..49f0775e136 100644 --- a/tests/baselines/reference/ambientDeclarationsExternal.symbols +++ b/tests/baselines/reference/ambientDeclarationsExternal.symbols @@ -20,6 +20,8 @@ var n: number; === tests/cases/conformance/ambient/decls.ts === // Ambient external module with export assignment declare module 'equ' { +>'equ' : Symbol('equ', Decl(decls.ts, 0, 0)) + var x; >x : Symbol(x, Decl(decls.ts, 2, 7)) @@ -28,6 +30,8 @@ declare module 'equ' { } declare module 'equ2' { +>'equ2' : Symbol('equ2', Decl(decls.ts, 4, 1)) + var x: number; >x : Symbol(x, Decl(decls.ts, 7, 7)) } diff --git a/tests/baselines/reference/ambientDeclarationsExternal.types b/tests/baselines/reference/ambientDeclarationsExternal.types index 4cf7d6b0bcb..522c9bd1442 100644 --- a/tests/baselines/reference/ambientDeclarationsExternal.types +++ b/tests/baselines/reference/ambientDeclarationsExternal.types @@ -20,6 +20,8 @@ var n: number; === tests/cases/conformance/ambient/decls.ts === // Ambient external module with export assignment declare module 'equ' { +>'equ' : typeof 'equ' + var x; >x : any @@ -28,6 +30,8 @@ declare module 'equ' { } declare module 'equ2' { +>'equ2' : typeof 'equ2' + var x: number; >x : number } diff --git a/tests/baselines/reference/ambientDeclarationsPatterns.symbols b/tests/baselines/reference/ambientDeclarationsPatterns.symbols index 4c0acc93f8f..22fc2937872 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns.symbols +++ b/tests/baselines/reference/ambientDeclarationsPatterns.symbols @@ -25,23 +25,31 @@ foo(fileText); === tests/cases/conformance/ambient/declarations.d.ts === declare module "foo*baz" { +>"foo*baz" : Symbol("foo*baz", Decl(declarations.d.ts, 0, 0), Decl(declarations.d.ts, 2, 1)) + export function foo(s: string): void; >foo : Symbol(foo, Decl(declarations.d.ts, 0, 26)) >s : Symbol(s, Decl(declarations.d.ts, 1, 24)) } // Augmentations still work declare module "foo*baz" { +>"foo*baz" : Symbol("foo*baz", Decl(declarations.d.ts, 0, 0), Decl(declarations.d.ts, 2, 1)) + export const baz: string; >baz : Symbol(baz, Decl(declarations.d.ts, 5, 16)) } // Longest prefix wins declare module "foos*" { +>"foos*" : Symbol("foos*", Decl(declarations.d.ts, 6, 1)) + export const foos: string; >foos : Symbol(foos, Decl(declarations.d.ts, 10, 16)) } declare module "*!text" { +>"*!text" : Symbol("*!text", Decl(declarations.d.ts, 11, 1)) + const x: string; >x : Symbol(x, Decl(declarations.d.ts, 14, 9)) diff --git a/tests/baselines/reference/ambientDeclarationsPatterns.types b/tests/baselines/reference/ambientDeclarationsPatterns.types index adf8ae1ab3b..77cef7515b2 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns.types +++ b/tests/baselines/reference/ambientDeclarationsPatterns.types @@ -28,23 +28,31 @@ foo(fileText); === tests/cases/conformance/ambient/declarations.d.ts === declare module "foo*baz" { +>"foo*baz" : typeof "foo*baz" + export function foo(s: string): void; >foo : (s: string) => void >s : string } // Augmentations still work declare module "foo*baz" { +>"foo*baz" : typeof "foo*baz" + export const baz: string; >baz : string } // Longest prefix wins declare module "foos*" { +>"foos*" : typeof "foos*" + export const foos: string; >foos : string } declare module "*!text" { +>"*!text" : typeof "*!text" + const x: string; >x : string diff --git a/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.symbols b/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.symbols index 63d50b6c85e..1ebc29ee92a 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.symbols +++ b/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/ambient/ambientDeclarationsPatterns_tooManyAsterisks.ts === declare module "too*many*asterisks" { } -No type information for this code. -No type information for this code. \ No newline at end of file +>"too*many*asterisks" : Symbol("too*many*asterisks", Decl(ambientDeclarationsPatterns_tooManyAsterisks.ts, 0, 0)) + diff --git a/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.types b/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.types index 63d50b6c85e..93ea5f185d0 100644 --- a/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.types +++ b/tests/baselines/reference/ambientDeclarationsPatterns_tooManyAsterisks.types @@ -1,4 +1,4 @@ === tests/cases/conformance/ambient/ambientDeclarationsPatterns_tooManyAsterisks.ts === declare module "too*many*asterisks" { } -No type information for this code. -No type information for this code. \ No newline at end of file +>"too*many*asterisks" : typeof "too*many*asterisks" + diff --git a/tests/baselines/reference/ambientErrors.symbols b/tests/baselines/reference/ambientErrors.symbols index 684e87b1fd4..d9c3647fcc6 100644 --- a/tests/baselines/reference/ambientErrors.symbols +++ b/tests/baselines/reference/ambientErrors.symbols @@ -90,13 +90,17 @@ module M2 { >M2 : Symbol(M2, Decl(ambientErrors.ts, 42, 1)) declare module 'nope' { } +>'nope' : Symbol('nope', Decl(ambientErrors.ts, 45, 11)) } // Ambient external module with a string literal name that isn't a top level external module name declare module '../foo' { } +>'../foo' : Symbol('../foo', Decl(ambientErrors.ts, 47, 1)) // Ambient external module with export assignment and other exported members declare module 'bar' { +>'bar' : Symbol('bar', Decl(ambientErrors.ts, 50, 27)) + var n; >n : Symbol(n, Decl(ambientErrors.ts, 54, 7)) diff --git a/tests/baselines/reference/ambientErrors.types b/tests/baselines/reference/ambientErrors.types index 3cd46066219..bd4033e9397 100644 --- a/tests/baselines/reference/ambientErrors.types +++ b/tests/baselines/reference/ambientErrors.types @@ -97,13 +97,17 @@ module M2 { >M2 : any declare module 'nope' { } +>'nope' : typeof 'nope' } // Ambient external module with a string literal name that isn't a top level external module name declare module '../foo' { } +>'../foo' : typeof '../foo' // Ambient external module with export assignment and other exported members declare module 'bar' { +>'bar' : typeof 'bar' + var n; >n : any diff --git a/tests/baselines/reference/ambientExportDefaultErrors.symbols b/tests/baselines/reference/ambientExportDefaultErrors.symbols index bfec3520347..b3e6b79cd3e 100644 --- a/tests/baselines/reference/ambientExportDefaultErrors.symbols +++ b/tests/baselines/reference/ambientExportDefaultErrors.symbols @@ -18,6 +18,8 @@ export as namespace Foo2; === tests/cases/compiler/indirection.d.ts === /// declare module "indirect" { +>"indirect" : Symbol("indirect", Decl(indirection.d.ts, 0, 0)) + export default typeof Foo.default; >Foo.default : Symbol(Foo.default, Decl(foo.d.ts, 0, 0)) >Foo : Symbol(Foo, Decl(foo.d.ts, 0, 21)) @@ -27,6 +29,8 @@ declare module "indirect" { === tests/cases/compiler/indirection2.d.ts === /// declare module "indirect2" { +>"indirect2" : Symbol("indirect2", Decl(indirection2.d.ts, 0, 0)) + export = typeof Foo2; >Foo2 : Symbol(Foo2, Decl(foo2.d.ts, 0, 15)) } diff --git a/tests/baselines/reference/ambientExportDefaultErrors.types b/tests/baselines/reference/ambientExportDefaultErrors.types index 97d2051a70a..c9c2351d444 100644 --- a/tests/baselines/reference/ambientExportDefaultErrors.types +++ b/tests/baselines/reference/ambientExportDefaultErrors.types @@ -26,6 +26,8 @@ export as namespace Foo2; === tests/cases/compiler/indirection.d.ts === /// declare module "indirect" { +>"indirect" : typeof "indirect" + export default typeof Foo.default; >typeof Foo.default : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" >Foo.default : number @@ -36,6 +38,8 @@ declare module "indirect" { === tests/cases/compiler/indirection2.d.ts === /// declare module "indirect2" { +>"indirect2" : typeof "indirect2" + export = typeof Foo2; >typeof Foo2 : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" >Foo2 : number diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.symbols b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.symbols index 7ab22e063e3..837de2d5ddc 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.symbols +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.symbols @@ -6,6 +6,8 @@ export = D; >D : Symbol(D, Decl(ambientExternalModuleInAnotherExternalModule.ts, 0, 0)) declare module "ext" { +>"ext" : Symbol("ext", Decl(ambientExternalModuleInAnotherExternalModule.ts, 1, 11)) + export class C { } >C : Symbol(C, Decl(ambientExternalModuleInAnotherExternalModule.ts, 3, 22)) } diff --git a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.types b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.types index e7d852d7a3d..f335f5255d2 100644 --- a/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.types +++ b/tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.types @@ -6,6 +6,8 @@ export = D; >D : D declare module "ext" { +>"ext" : typeof "ext" + export class C { } >C : C } diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.symbols b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.symbols index a2b535c5b80..bb83ea46ae1 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.symbols +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.symbols @@ -3,4 +3,5 @@ module M { >M : Symbol(M, Decl(ambientExternalModuleInsideNonAmbient.ts, 0, 0)) export declare module "M" { } +>"M" : Symbol("M", Decl(ambientExternalModuleInsideNonAmbient.ts, 0, 10)) } diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types index d635bfd1d1e..be88c42d3f9 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types @@ -3,4 +3,5 @@ module M { >M : any export declare module "M" { } +>"M" : typeof "M" } diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.symbols b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.symbols index 10841ebc4cd..8ef83c37ebf 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.symbols +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.symbols @@ -1,3 +1,4 @@ === tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts === export declare module "M" { } -No type information for this code. \ No newline at end of file +>"M" : Symbol("M", Decl(ambientExternalModuleInsideNonAmbientExternalModule.ts, 0, 0)) + diff --git a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.types b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.types index 10841ebc4cd..9a4bb0c94ef 100644 --- a/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.types +++ b/tests/baselines/reference/ambientExternalModuleInsideNonAmbientExternalModule.types @@ -1,3 +1,4 @@ === tests/cases/conformance/ambient/ambientExternalModuleInsideNonAmbientExternalModule.ts === export declare module "M" { } -No type information for this code. \ No newline at end of file +>"M" : any + diff --git a/tests/baselines/reference/ambientExternalModuleMerging.symbols b/tests/baselines/reference/ambientExternalModuleMerging.symbols index 7fea7fea89f..b99157b1142 100644 --- a/tests/baselines/reference/ambientExternalModuleMerging.symbols +++ b/tests/baselines/reference/ambientExternalModuleMerging.symbols @@ -17,12 +17,16 @@ var y = M.y; === tests/cases/conformance/ambient/ambientExternalModuleMerging_declare.ts === declare module "M" { +>"M" : Symbol("M", Decl(ambientExternalModuleMerging_declare.ts, 0, 0), Decl(ambientExternalModuleMerging_declare.ts, 2, 1)) + export var x: string; >x : Symbol(x, Decl(ambientExternalModuleMerging_declare.ts, 1, 14)) } // Merge declare module "M" { +>"M" : Symbol("M", Decl(ambientExternalModuleMerging_declare.ts, 0, 0), Decl(ambientExternalModuleMerging_declare.ts, 2, 1)) + export var y: string; >y : Symbol(y, Decl(ambientExternalModuleMerging_declare.ts, 6, 14)) } diff --git a/tests/baselines/reference/ambientExternalModuleMerging.types b/tests/baselines/reference/ambientExternalModuleMerging.types index 1c1be0fd256..8150f6c6dfc 100644 --- a/tests/baselines/reference/ambientExternalModuleMerging.types +++ b/tests/baselines/reference/ambientExternalModuleMerging.types @@ -17,12 +17,16 @@ var y = M.y; === tests/cases/conformance/ambient/ambientExternalModuleMerging_declare.ts === declare module "M" { +>"M" : typeof "M" + export var x: string; >x : string } // Merge declare module "M" { +>"M" : typeof "M" + export var y: string; >y : string } diff --git a/tests/baselines/reference/ambientExternalModuleReopen.symbols b/tests/baselines/reference/ambientExternalModuleReopen.symbols index a2a1ba72fab..74bc430550b 100644 --- a/tests/baselines/reference/ambientExternalModuleReopen.symbols +++ b/tests/baselines/reference/ambientExternalModuleReopen.symbols @@ -1,9 +1,13 @@ === tests/cases/compiler/ambientExternalModuleReopen.ts === declare module "fs" { +>"fs" : Symbol("fs", Decl(ambientExternalModuleReopen.ts, 0, 0), Decl(ambientExternalModuleReopen.ts, 2, 1)) + var x: string; >x : Symbol(x, Decl(ambientExternalModuleReopen.ts, 1, 7)) } declare module 'fs' { +>'fs' : Symbol("fs", Decl(ambientExternalModuleReopen.ts, 0, 0), Decl(ambientExternalModuleReopen.ts, 2, 1)) + var y: number; >y : Symbol(y, Decl(ambientExternalModuleReopen.ts, 4, 7)) } diff --git a/tests/baselines/reference/ambientExternalModuleReopen.types b/tests/baselines/reference/ambientExternalModuleReopen.types index 842d634344c..dffba752e05 100644 --- a/tests/baselines/reference/ambientExternalModuleReopen.types +++ b/tests/baselines/reference/ambientExternalModuleReopen.types @@ -1,9 +1,13 @@ === tests/cases/compiler/ambientExternalModuleReopen.ts === declare module "fs" { +>"fs" : typeof "fs" + var x: string; >x : string } declare module 'fs' { +>'fs' : typeof "fs" + var y: number; >y : number } diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols index d7e3b5925b1..621c7b3ebfc 100644 --- a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols +++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.symbols @@ -9,6 +9,8 @@ var c = new A(); === tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_0.ts === declare module 'M' { +>'M' : Symbol('M', Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 0)) + module C { >C : Symbol(C, Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithInternalImportDeclaration_0.ts, 3, 5)) diff --git a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types index 4e9043d1b75..17372294131 100644 --- a/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types +++ b/tests/baselines/reference/ambientExternalModuleWithInternalImportDeclaration.types @@ -10,6 +10,8 @@ var c = new A(); === tests/cases/compiler/ambientExternalModuleWithInternalImportDeclaration_0.ts === declare module 'M' { +>'M' : typeof 'M' + module C { >C : typeof C diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.symbols b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.symbols index 1e8ad3c5fa5..3c7754d0135 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.symbols +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.symbols @@ -1,5 +1,7 @@ === tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts === declare module "OuterModule" { +>"OuterModule" : Symbol("OuterModule", Decl(ambientExternalModuleWithRelativeExternalImportDeclaration.ts, 0, 0)) + import m2 = require("./SubModule"); >m2 : Symbol(m2, Decl(ambientExternalModuleWithRelativeExternalImportDeclaration.ts, 0, 30)) diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types index 0d173e5e7a9..4072b2fcedd 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeExternalImportDeclaration.types @@ -1,5 +1,7 @@ === tests/cases/compiler/ambientExternalModuleWithRelativeExternalImportDeclaration.ts === declare module "OuterModule" { +>"OuterModule" : typeof "OuterModule" + import m2 = require("./SubModule"); >m2 : any diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.symbols b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.symbols index a8ef371e805..350a84a0b4a 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.symbols +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.symbols @@ -1,10 +1,14 @@ === tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts === declare module "./relativeModule" { +>"./relativeModule" : Symbol("./relativeModule", Decl(ambientExternalModuleWithRelativeModuleName.ts, 0, 0)) + var x: string; >x : Symbol(x, Decl(ambientExternalModuleWithRelativeModuleName.ts, 1, 7)) } declare module ".\\relativeModule" { +>".\\relativeModule" : Symbol(".\\relativeModule", Decl(ambientExternalModuleWithRelativeModuleName.ts, 2, 1)) + var x: string; >x : Symbol(x, Decl(ambientExternalModuleWithRelativeModuleName.ts, 5, 7)) } diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.types b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.types index ab0f2b62f58..d585e8ed6a1 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.types +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.types @@ -1,10 +1,14 @@ === tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts === declare module "./relativeModule" { +>"./relativeModule" : typeof "./relativeModule" + var x: string; >x : string } declare module ".\\relativeModule" { +>".\\relativeModule" : typeof ".\\relativeModule" + var x: string; >x : string } diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols index 15ddf4ac488..6827122959d 100644 --- a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols +++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.symbols @@ -9,6 +9,8 @@ var c = new A(); === tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_0.ts === declare module 'M' { +>'M' : Symbol('M', Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 0)) + module C { >C : Symbol(C, Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 0, 20), Decl(ambientExternalModuleWithoutInternalImportDeclaration_0.ts, 3, 5)) diff --git a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types index 0029817400b..c943603fb52 100644 --- a/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types +++ b/tests/baselines/reference/ambientExternalModuleWithoutInternalImportDeclaration.types @@ -10,6 +10,8 @@ var c = new A(); === tests/cases/compiler/ambientExternalModuleWithoutInternalImportDeclaration_0.ts === declare module 'M' { +>'M' : typeof 'M' + module C { >C : typeof C diff --git a/tests/baselines/reference/ambientRequireFunction.symbols b/tests/baselines/reference/ambientRequireFunction.symbols index 11f91a66357..b2e94e89a2c 100644 --- a/tests/baselines/reference/ambientRequireFunction.symbols +++ b/tests/baselines/reference/ambientRequireFunction.symbols @@ -18,6 +18,8 @@ declare function require(moduleName: string): any; >moduleName : Symbol(moduleName, Decl(node.d.ts, 0, 25)) declare module "fs" { +>"fs" : Symbol("fs", Decl(node.d.ts, 0, 50)) + export function readFileSync(s: string): string; >readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) >s : Symbol(s, Decl(node.d.ts, 3, 33)) diff --git a/tests/baselines/reference/ambientRequireFunction.types b/tests/baselines/reference/ambientRequireFunction.types index 5ae9a85188c..ed34aa4309f 100644 --- a/tests/baselines/reference/ambientRequireFunction.types +++ b/tests/baselines/reference/ambientRequireFunction.types @@ -21,6 +21,8 @@ declare function require(moduleName: string): any; >moduleName : string declare module "fs" { +>"fs" : typeof "fs" + export function readFileSync(s: string): string; >readFileSync : (s: string) => string >s : string diff --git a/tests/baselines/reference/ambientShorthand.symbols b/tests/baselines/reference/ambientShorthand.symbols index 6747fd65173..c2231ac5c3d 100644 --- a/tests/baselines/reference/ambientShorthand.symbols +++ b/tests/baselines/reference/ambientShorthand.symbols @@ -18,7 +18,9 @@ foo(bar, baz, boom); === tests/cases/conformance/ambient/declarations.d.ts === declare module "jquery" -No type information for this code.// Semicolon is optional -No type information for this code.declare module "fs"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"jquery" : Symbol("jquery", Decl(declarations.d.ts, 0, 0)) + +// Semicolon is optional +declare module "fs"; +>"fs" : Symbol("fs", Decl(declarations.d.ts, 0, 23)) + diff --git a/tests/baselines/reference/ambientShorthand.types b/tests/baselines/reference/ambientShorthand.types index 054349b1a6a..4c93cc7fd8f 100644 --- a/tests/baselines/reference/ambientShorthand.types +++ b/tests/baselines/reference/ambientShorthand.types @@ -19,7 +19,9 @@ foo(bar, baz, boom); === tests/cases/conformance/ambient/declarations.d.ts === declare module "jquery" -No type information for this code.// Semicolon is optional -No type information for this code.declare module "fs"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"jquery" : any + +// Semicolon is optional +declare module "fs"; +>"fs" : any + diff --git a/tests/baselines/reference/ambientShorthand_declarationEmit.symbols b/tests/baselines/reference/ambientShorthand_declarationEmit.symbols index f1b3284b0f2..f1eabac0e9e 100644 --- a/tests/baselines/reference/ambientShorthand_declarationEmit.symbols +++ b/tests/baselines/reference/ambientShorthand_declarationEmit.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/ambient/ambientShorthand_declarationEmit.ts === declare module "foo"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"foo" : Symbol("foo", Decl(ambientShorthand_declarationEmit.ts, 0, 0)) + diff --git a/tests/baselines/reference/ambientShorthand_declarationEmit.types b/tests/baselines/reference/ambientShorthand_declarationEmit.types index f1b3284b0f2..c5c8411bb03 100644 --- a/tests/baselines/reference/ambientShorthand_declarationEmit.types +++ b/tests/baselines/reference/ambientShorthand_declarationEmit.types @@ -1,4 +1,4 @@ === tests/cases/conformance/ambient/ambientShorthand_declarationEmit.ts === declare module "foo"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"foo" : any + diff --git a/tests/baselines/reference/ambientShorthand_duplicate.symbols b/tests/baselines/reference/ambientShorthand_duplicate.symbols index 05856b47b92..6d5716a193c 100644 --- a/tests/baselines/reference/ambientShorthand_duplicate.symbols +++ b/tests/baselines/reference/ambientShorthand_duplicate.symbols @@ -6,5 +6,5 @@ import foo from "foo"; === tests/cases/conformance/ambient/declarations1.d.ts === declare module "foo"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"foo" : Symbol("foo", Decl(declarations1.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/ambientShorthand_duplicate.types b/tests/baselines/reference/ambientShorthand_duplicate.types index 1520c5447ec..8abf9f7b230 100644 --- a/tests/baselines/reference/ambientShorthand_duplicate.types +++ b/tests/baselines/reference/ambientShorthand_duplicate.types @@ -6,5 +6,5 @@ import foo from "foo"; === tests/cases/conformance/ambient/declarations1.d.ts === declare module "foo"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"foo" : any + diff --git a/tests/baselines/reference/ambientShorthand_merging.symbols b/tests/baselines/reference/ambientShorthand_merging.symbols index 8a0ca5acb74..d37bdb06078 100644 --- a/tests/baselines/reference/ambientShorthand_merging.symbols +++ b/tests/baselines/reference/ambientShorthand_merging.symbols @@ -7,5 +7,5 @@ import foo, {bar} from "foo"; === tests/cases/conformance/ambient/declarations1.d.ts === declare module "foo"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"foo" : Symbol("foo", Decl(declarations1.d.ts, 0, 0)) + diff --git a/tests/baselines/reference/ambientShorthand_merging.types b/tests/baselines/reference/ambientShorthand_merging.types index 78390a35dd8..ad9827f47eb 100644 --- a/tests/baselines/reference/ambientShorthand_merging.types +++ b/tests/baselines/reference/ambientShorthand_merging.types @@ -7,5 +7,5 @@ import foo, {bar} from "foo"; === tests/cases/conformance/ambient/declarations1.d.ts === declare module "foo"; -No type information for this code. -No type information for this code. \ No newline at end of file +>"foo" : any + diff --git a/tests/baselines/reference/ambientShorthand_reExport.symbols b/tests/baselines/reference/ambientShorthand_reExport.symbols index 1e8d5318011..3aa3ddcec3d 100644 --- a/tests/baselines/reference/ambientShorthand_reExport.symbols +++ b/tests/baselines/reference/ambientShorthand_reExport.symbols @@ -1,7 +1,8 @@ === tests/cases/conformance/ambient/declarations.d.ts === declare module "jquery"; -No type information for this code. -No type information for this code.=== tests/cases/conformance/ambient/reExportX.ts === +>"jquery" : Symbol("jquery", Decl(declarations.d.ts, 0, 0)) + +=== tests/cases/conformance/ambient/reExportX.ts === export {x} from "jquery"; >x : Symbol(x, Decl(reExportX.ts, 0, 8)) diff --git a/tests/baselines/reference/ambientShorthand_reExport.types b/tests/baselines/reference/ambientShorthand_reExport.types index 5765c7e0331..e3e6c9742fd 100644 --- a/tests/baselines/reference/ambientShorthand_reExport.types +++ b/tests/baselines/reference/ambientShorthand_reExport.types @@ -1,7 +1,8 @@ === tests/cases/conformance/ambient/declarations.d.ts === declare module "jquery"; -No type information for this code. -No type information for this code.=== tests/cases/conformance/ambient/reExportX.ts === +>"jquery" : any + +=== tests/cases/conformance/ambient/reExportX.ts === export {x} from "jquery"; >x : any diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.symbols b/tests/baselines/reference/arityAndOrderCompatibility01.symbols index 3a5d55dc1e6..16c1118738e 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.symbols +++ b/tests/baselines/reference/arityAndOrderCompatibility01.symbols @@ -4,7 +4,11 @@ interface StrNum extends Array { >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) 0: string; +>0 : Symbol(StrNum[0], Decl(arityAndOrderCompatibility01.ts, 0, 47)) + 1: number; +>1 : Symbol(StrNum[1], Decl(arityAndOrderCompatibility01.ts, 1, 14)) + length: 2; >length : Symbol(StrNum.length, Decl(arityAndOrderCompatibility01.ts, 2, 14)) } @@ -20,7 +24,11 @@ var z: { >z : Symbol(z, Decl(arityAndOrderCompatibility01.ts, 8, 3)) 0: string; +>0 : Symbol(0, Decl(arityAndOrderCompatibility01.ts, 8, 8)) + 1: number; +>1 : Symbol(1, Decl(arityAndOrderCompatibility01.ts, 9, 14)) + length: 2; >length : Symbol(length, Decl(arityAndOrderCompatibility01.ts, 10, 14)) } diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.types b/tests/baselines/reference/arityAndOrderCompatibility01.types index 80e91fbd2e7..6fdbab7a587 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.types +++ b/tests/baselines/reference/arityAndOrderCompatibility01.types @@ -4,7 +4,11 @@ interface StrNum extends Array { >Array : T[] 0: string; +>0 : string + 1: number; +>1 : number + length: 2; >length : 2 } @@ -20,7 +24,11 @@ var z: { >z : { 0: string; 1: number; length: 2; } 0: string; +>0 : string + 1: number; +>1 : number + length: 2; >length : 2 } diff --git a/tests/baselines/reference/arrayLiterals3.symbols b/tests/baselines/reference/arrayLiterals3.symbols index 8a94e9ee462..d1773ef97d7 100644 --- a/tests/baselines/reference/arrayLiterals3.symbols +++ b/tests/baselines/reference/arrayLiterals3.symbols @@ -38,7 +38,10 @@ interface tup { >tup : Symbol(tup, Decl(arrayLiterals3.ts, 23, 67)) 0: number[]|string[]; +>0 : Symbol(tup[0], Decl(arrayLiterals3.ts, 25, 15)) + 1: number[]|string[]; +>1 : Symbol(tup[1], Decl(arrayLiterals3.ts, 26, 25)) } interface myArray extends Array { } >myArray : Symbol(myArray, Decl(arrayLiterals3.ts, 28, 1)) diff --git a/tests/baselines/reference/arrayLiterals3.types b/tests/baselines/reference/arrayLiterals3.types index 926f1448a44..7d890f38fb4 100644 --- a/tests/baselines/reference/arrayLiterals3.types +++ b/tests/baselines/reference/arrayLiterals3.types @@ -64,7 +64,10 @@ interface tup { >tup : tup 0: number[]|string[]; +>0 : number[] | string[] + 1: number[]|string[]; +>1 : number[] | string[] } interface myArray extends Array { } >myArray : myArray diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols index ce633683339..4bd6397936d 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.symbols @@ -4,9 +4,11 @@ class S { 1: string; } >S : Symbol(S, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 0, 0)) +>1 : Symbol(S[1], Decl(assignmentCompatWithObjectMembersNumericNames.ts, 3, 9)) class T { 1.: string; } >T : Symbol(T, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 3, 22)) +>1. : Symbol(T[1.], Decl(assignmentCompatWithObjectMembersNumericNames.ts, 4, 9)) var s: S; >s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) @@ -18,10 +20,12 @@ var t: T; interface S2 { 1: string; bar?: string } >S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 6, 9)) +>1 : Symbol(S2[1], Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 14)) >bar : Symbol(S2.bar, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 25)) interface T2 { 1.0: string; baz?: string } >T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 8, 40)) +>1.0 : Symbol(T2[1.0], Decl(assignmentCompatWithObjectMembersNumericNames.ts, 9, 14)) >baz : Symbol(T2.baz, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 9, 27)) var s2: S2; @@ -34,17 +38,21 @@ var t2: T2; var a: { 1.: string; bar?: string } >a : Symbol(a, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 3)) +>1. : Symbol(1., Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 8)) >bar : Symbol(bar, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 13, 20)) var b: { 1.0: string; baz?: string } >b : Symbol(b, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 3)) +>1.0 : Symbol(1.0, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 8)) >baz : Symbol(baz, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 14, 21)) var a2 = { 1.0: '' }; >a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 3)) +>1.0 : Symbol(1.0, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 16, 10)) var b2 = { 1: '' }; >b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 3)) +>1 : Symbol(1, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 17, 10)) s = t; >s : Symbol(s, Decl(assignmentCompatWithObjectMembersNumericNames.ts, 5, 3)) diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types index 0c44316d324..aea92a9aa3f 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersNumericNames.types @@ -4,9 +4,11 @@ class S { 1: string; } >S : S +>1 : string class T { 1.: string; } >T : T +>1. : string var s: S; >s : S @@ -18,10 +20,12 @@ var t: T; interface S2 { 1: string; bar?: string } >S2 : S2 +>1 : string >bar : string interface T2 { 1.0: string; baz?: string } >T2 : T2 +>1.0 : string >baz : string var s2: S2; @@ -34,20 +38,24 @@ var t2: T2; var a: { 1.: string; bar?: string } >a : { 1.: string; bar?: string; } +>1. : string >bar : string var b: { 1.0: string; baz?: string } >b : { 1.0: string; baz?: string; } +>1.0 : string >baz : string var a2 = { 1.0: '' }; >a2 : { 1.0: string; } >{ 1.0: '' } : { 1.0: string; } +>1.0 : string >'' : "" var b2 = { 1: '' }; >b2 : { 1: string; } >{ 1: '' } : { 1: string; } +>1 : string >'' : "" s = t; diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.symbols b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.symbols index b33dd82f99a..a55c665b085 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.symbols +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.symbols @@ -7,9 +7,11 @@ module JustStrings { class S { '1': string; } >S : Symbol(S, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 3, 20)) +>'1' : Symbol(S['1'], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 4, 13)) class T { '1.': string; } >T : Symbol(T, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 4, 28)) +>'1.' : Symbol(T['1.'], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 5, 13)) var s: S; >s : Symbol(s, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 6, 7)) @@ -21,10 +23,12 @@ module JustStrings { interface S2 { '1': string; bar?: string } >S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 7, 13)) +>'1' : Symbol(S2['1'], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 9, 18)) >bar : Symbol(S2.bar, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 9, 31)) interface T2 { '1.0': string; baz?: string } >T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 9, 46)) +>'1.0' : Symbol(T2['1.0'], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 10, 18)) >baz : Symbol(T2.baz, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 10, 33)) var s2: S2; @@ -37,17 +41,21 @@ module JustStrings { var a: { '1.': string; bar?: string } >a : Symbol(a, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 14, 7)) +>'1.' : Symbol('1.', Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 14, 12)) >bar : Symbol(bar, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 14, 26)) var b: { '1.0': string; baz?: string } >b : Symbol(b, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 15, 7)) +>'1.0' : Symbol('1.0', Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 15, 12)) >baz : Symbol(baz, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 15, 27)) var a2 = { '1.0': '' }; >a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 17, 7)) +>'1.0' : Symbol('1.0', Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 17, 14)) var b2 = { '1': '' }; >b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 18, 7)) +>'1' : Symbol('1', Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 18, 14)) s = t; >s : Symbol(s, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 6, 7)) @@ -131,9 +139,11 @@ module NumbersAndStrings { class S { '1': string; } >S : Symbol(S, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 44, 26)) +>'1' : Symbol(S['1'], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 45, 13)) class T { 1: string; } >T : Symbol(T, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 45, 28)) +>1 : Symbol(T[1], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 46, 13)) var s: S; >s : Symbol(s, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 47, 7)) @@ -145,10 +155,12 @@ module NumbersAndStrings { interface S2 { '1': string; bar?: string } >S2 : Symbol(S2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 48, 13)) +>'1' : Symbol(S2['1'], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 50, 18)) >bar : Symbol(S2.bar, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 50, 31)) interface T2 { 1.0: string; baz?: string } >T2 : Symbol(T2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 50, 46)) +>1.0 : Symbol(T2[1.0], Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 51, 18)) >baz : Symbol(T2.baz, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 51, 31)) var s2: S2; @@ -161,17 +173,21 @@ module NumbersAndStrings { var a: { '1.': string; bar?: string } >a : Symbol(a, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 55, 7)) +>'1.' : Symbol('1.', Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 55, 12)) >bar : Symbol(bar, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 55, 26)) var b: { 1.0: string; baz?: string } >b : Symbol(b, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 56, 7)) +>1.0 : Symbol(1.0, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 56, 12)) >baz : Symbol(baz, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 56, 25)) var a2 = { '1.0': '' }; >a2 : Symbol(a2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 58, 7)) +>'1.0' : Symbol('1.0', Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 58, 14)) var b2 = { 1.: '' }; >b2 : Symbol(b2, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 59, 7)) +>1. : Symbol(1., Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 59, 14)) s = t; // ok >s : Symbol(s, Decl(assignmentCompatWithObjectMembersStringNumericNames.ts, 47, 7)) diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types index 6d021b024cb..a8be024ca60 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.types @@ -7,9 +7,11 @@ module JustStrings { class S { '1': string; } >S : S +>'1' : string class T { '1.': string; } >T : T +>'1.' : string var s: S; >s : S @@ -21,10 +23,12 @@ module JustStrings { interface S2 { '1': string; bar?: string } >S2 : S2 +>'1' : string >bar : string interface T2 { '1.0': string; baz?: string } >T2 : T2 +>'1.0' : string >baz : string var s2: S2; @@ -37,20 +41,24 @@ module JustStrings { var a: { '1.': string; bar?: string } >a : { '1.': string; bar?: string; } +>'1.' : string >bar : string var b: { '1.0': string; baz?: string } >b : { '1.0': string; baz?: string; } +>'1.0' : string >baz : string var a2 = { '1.0': '' }; >a2 : { '1.0': string; } >{ '1.0': '' } : { '1.0': string; } +>'1.0' : string >'' : "" var b2 = { '1': '' }; >b2 : { '1': string; } >{ '1': '' } : { '1': string; } +>'1' : string >'' : "" s = t; @@ -154,9 +162,11 @@ module NumbersAndStrings { class S { '1': string; } >S : S +>'1' : string class T { 1: string; } >T : T +>1 : string var s: S; >s : S @@ -168,10 +178,12 @@ module NumbersAndStrings { interface S2 { '1': string; bar?: string } >S2 : S2 +>'1' : string >bar : string interface T2 { 1.0: string; baz?: string } >T2 : T2 +>1.0 : string >baz : string var s2: S2; @@ -184,20 +196,24 @@ module NumbersAndStrings { var a: { '1.': string; bar?: string } >a : { '1.': string; bar?: string; } +>'1.' : string >bar : string var b: { 1.0: string; baz?: string } >b : { 1.0: string; baz?: string; } +>1.0 : string >baz : string var a2 = { '1.0': '' }; >a2 : { '1.0': string; } >{ '1.0': '' } : { '1.0': string; } +>'1.0' : string >'' : "" var b2 = { 1.: '' }; >b2 : { 1.: string; } >{ 1.: '' } : { 1.: string; } +>1. : string >'' : "" s = t; // ok diff --git a/tests/baselines/reference/augmentExportEquals1.symbols b/tests/baselines/reference/augmentExportEquals1.symbols index 84ec06ca7fe..b2bda7590cd 100644 --- a/tests/baselines/reference/augmentExportEquals1.symbols +++ b/tests/baselines/reference/augmentExportEquals1.symbols @@ -20,6 +20,8 @@ import x = require("./file1"); // augmentation for './file1' // should error since './file1' does not have namespace meaning declare module "./file1" { +>"./file1" : Symbol("./file1", Decl(file2.ts, 0, 30)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 4, 26)) >a : Symbol(A.a, Decl(file2.ts, 5, 17)) diff --git a/tests/baselines/reference/augmentExportEquals1.types b/tests/baselines/reference/augmentExportEquals1.types index afb5dd1edc9..3c9872c8afe 100644 --- a/tests/baselines/reference/augmentExportEquals1.types +++ b/tests/baselines/reference/augmentExportEquals1.types @@ -23,6 +23,8 @@ import x = require("./file1"); // augmentation for './file1' // should error since './file1' does not have namespace meaning declare module "./file1" { +>"./file1" : any + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals1_1.symbols b/tests/baselines/reference/augmentExportEquals1_1.symbols index df793ca841c..6d1ca82a086 100644 --- a/tests/baselines/reference/augmentExportEquals1_1.symbols +++ b/tests/baselines/reference/augmentExportEquals1_1.symbols @@ -8,6 +8,8 @@ let a: x.A; // should not work === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : Symbol("file1", Decl(file1.d.ts, 0, 0)) + var x: number; >x : Symbol(x, Decl(file1.d.ts, 1, 7)) @@ -23,6 +25,8 @@ import x = require("file1"); // augmentation for 'file1' // should error since 'file1' does not have namespace meaning declare module "file1" { +>"file1" : Symbol("file1", Decl(file2.ts, 1, 28)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 5, 24)) >a : Symbol(A.a, Decl(file2.ts, 6, 17)) diff --git a/tests/baselines/reference/augmentExportEquals1_1.types b/tests/baselines/reference/augmentExportEquals1_1.types index f771e815743..9077a27d327 100644 --- a/tests/baselines/reference/augmentExportEquals1_1.types +++ b/tests/baselines/reference/augmentExportEquals1_1.types @@ -10,6 +10,8 @@ let a: x.A; // should not work === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : typeof "file1" + var x: number; >x : number @@ -25,6 +27,8 @@ import x = require("file1"); // augmentation for 'file1' // should error since 'file1' does not have namespace meaning declare module "file1" { +>"file1" : any + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals2.symbols b/tests/baselines/reference/augmentExportEquals2.symbols index 29f85da0e1f..18dc793b5c2 100644 --- a/tests/baselines/reference/augmentExportEquals2.symbols +++ b/tests/baselines/reference/augmentExportEquals2.symbols @@ -19,6 +19,8 @@ import x = require("./file1"); // should error since './file1' does not have namespace meaning declare module "./file1" { +>"./file1" : Symbol("./file1", Decl(file2.ts, 0, 30)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 3, 26)) >a : Symbol(A.a, Decl(file2.ts, 4, 17)) diff --git a/tests/baselines/reference/augmentExportEquals2.types b/tests/baselines/reference/augmentExportEquals2.types index 658579598ae..03424f0b6a5 100644 --- a/tests/baselines/reference/augmentExportEquals2.types +++ b/tests/baselines/reference/augmentExportEquals2.types @@ -21,6 +21,8 @@ import x = require("./file1"); // should error since './file1' does not have namespace meaning declare module "./file1" { +>"./file1" : any + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals2_1.symbols b/tests/baselines/reference/augmentExportEquals2_1.symbols index 99ce1e5c85c..4eb0675cf64 100644 --- a/tests/baselines/reference/augmentExportEquals2_1.symbols +++ b/tests/baselines/reference/augmentExportEquals2_1.symbols @@ -8,6 +8,8 @@ let a: x.A; // should not work === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : Symbol("file1", Decl(file1.d.ts, 0, 0)) + function foo(): void; >foo : Symbol(foo, Decl(file1.d.ts, 0, 24)) @@ -22,6 +24,8 @@ import x = require("file1"); // should error since './file1' does not have namespace meaning declare module "file1" { +>"file1" : Symbol("file1", Decl(file2.ts, 1, 28)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 4, 24)) >a : Symbol(A.a, Decl(file2.ts, 5, 17)) diff --git a/tests/baselines/reference/augmentExportEquals2_1.types b/tests/baselines/reference/augmentExportEquals2_1.types index e47ed79f584..9a619638a01 100644 --- a/tests/baselines/reference/augmentExportEquals2_1.types +++ b/tests/baselines/reference/augmentExportEquals2_1.types @@ -10,6 +10,8 @@ let a: x.A; // should not work === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : typeof "file1" + function foo(): void; >foo : () => void @@ -24,6 +26,8 @@ import x = require("file1"); // should error since './file1' does not have namespace meaning declare module "file1" { +>"file1" : any + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals3.symbols b/tests/baselines/reference/augmentExportEquals3.symbols index 06ac04b39f3..e4e7a8e1a5f 100644 --- a/tests/baselines/reference/augmentExportEquals3.symbols +++ b/tests/baselines/reference/augmentExportEquals3.symbols @@ -22,6 +22,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "./file1" { +>"./file1" : Symbol(x, Decl(file1.ts, 0, 0), Decl(file1.ts, 0, 17), Decl(file2.ts, 1, 8)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 4, 26)) >a : Symbol(A.a, Decl(file2.ts, 5, 17)) diff --git a/tests/baselines/reference/augmentExportEquals3.types b/tests/baselines/reference/augmentExportEquals3.types index 37362bc9649..67aa8399af3 100644 --- a/tests/baselines/reference/augmentExportEquals3.types +++ b/tests/baselines/reference/augmentExportEquals3.types @@ -25,6 +25,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "./file1" { +>"./file1" : typeof x + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals3_1.symbols b/tests/baselines/reference/augmentExportEquals3_1.symbols index ad3505c2835..2431b293dea 100644 --- a/tests/baselines/reference/augmentExportEquals3_1.symbols +++ b/tests/baselines/reference/augmentExportEquals3_1.symbols @@ -1,5 +1,7 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : Symbol("file1", Decl(file1.d.ts, 0, 0)) + function foo(): void; >foo : Symbol(foo, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) @@ -26,6 +28,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "file1" { +>"file1" : Symbol(x, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 25), Decl(file2.ts, 2, 8)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 5, 24)) >a : Symbol(A.a, Decl(file2.ts, 6, 17)) diff --git a/tests/baselines/reference/augmentExportEquals3_1.types b/tests/baselines/reference/augmentExportEquals3_1.types index 2457e91530a..f841fb31535 100644 --- a/tests/baselines/reference/augmentExportEquals3_1.types +++ b/tests/baselines/reference/augmentExportEquals3_1.types @@ -1,5 +1,7 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : typeof "file1" + function foo(): void; >foo : typeof foo @@ -28,6 +30,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "file1" { +>"file1" : typeof x + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals4.symbols b/tests/baselines/reference/augmentExportEquals4.symbols index 2a4e3dbc147..f1f63762545 100644 --- a/tests/baselines/reference/augmentExportEquals4.symbols +++ b/tests/baselines/reference/augmentExportEquals4.symbols @@ -22,6 +22,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "./file1" { +>"./file1" : Symbol(x, Decl(file1.ts, 0, 0), Decl(file1.ts, 0, 12), Decl(file2.ts, 1, 8)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 4, 26)) >a : Symbol(A.a, Decl(file2.ts, 5, 17)) diff --git a/tests/baselines/reference/augmentExportEquals4.types b/tests/baselines/reference/augmentExportEquals4.types index 295156ffb59..c2823d794e0 100644 --- a/tests/baselines/reference/augmentExportEquals4.types +++ b/tests/baselines/reference/augmentExportEquals4.types @@ -25,6 +25,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "./file1" { +>"./file1" : typeof x + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals4_1.symbols b/tests/baselines/reference/augmentExportEquals4_1.symbols index 1488645898c..d2a3c001825 100644 --- a/tests/baselines/reference/augmentExportEquals4_1.symbols +++ b/tests/baselines/reference/augmentExportEquals4_1.symbols @@ -1,5 +1,7 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : Symbol("file1", Decl(file1.d.ts, 0, 0)) + class foo {} >foo : Symbol(foo, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 16), Decl(file2.ts, 2, 8)) @@ -26,6 +28,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "file1" { +>"file1" : Symbol(x, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 16), Decl(file2.ts, 2, 8)) + interface A { a } >A : Symbol(A, Decl(file2.ts, 5, 24)) >a : Symbol(A.a, Decl(file2.ts, 6, 17)) diff --git a/tests/baselines/reference/augmentExportEquals4_1.types b/tests/baselines/reference/augmentExportEquals4_1.types index 8eaf1c6cbba..9daf444e419 100644 --- a/tests/baselines/reference/augmentExportEquals4_1.types +++ b/tests/baselines/reference/augmentExportEquals4_1.types @@ -1,5 +1,7 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : typeof "file1" + class foo {} >foo : foo @@ -28,6 +30,8 @@ x.b = 1; // OK - './file1' is a namespace declare module "file1" { +>"file1" : typeof x + interface A { a } >A : A >a : any diff --git a/tests/baselines/reference/augmentExportEquals5.symbols b/tests/baselines/reference/augmentExportEquals5.symbols index d55e8eed021..0bf821f6cad 100644 --- a/tests/baselines/reference/augmentExportEquals5.symbols +++ b/tests/baselines/reference/augmentExportEquals5.symbols @@ -13,6 +13,8 @@ declare module Express { } declare module "express" { +>"express" : Symbol("express", Decl(express.d.ts, 4, 1)) + function e(): e.Express; >e : Symbol(e, Decl(express.d.ts, 6, 26), Decl(express.d.ts, 7, 28), Decl(augmentation.ts, 1, 29)) >e : Symbol(e, Decl(express.d.ts, 6, 26), Decl(express.d.ts, 7, 28)) @@ -167,6 +169,8 @@ import * as e from "express"; >e : Symbol(e, Decl(augmentation.ts, 1, 6)) declare module "express" { +>"express" : Symbol(e, Decl(express.d.ts, 6, 26), Decl(express.d.ts, 7, 28), Decl(augmentation.ts, 1, 29)) + interface Request { >Request : Symbol(Request, Decl(express.d.ts, 25, 49), Decl(augmentation.ts, 2, 26)) diff --git a/tests/baselines/reference/augmentExportEquals5.types b/tests/baselines/reference/augmentExportEquals5.types index c0444d35358..eaa956e1d4e 100644 --- a/tests/baselines/reference/augmentExportEquals5.types +++ b/tests/baselines/reference/augmentExportEquals5.types @@ -13,6 +13,8 @@ declare module Express { } declare module "express" { +>"express" : typeof "express" + function e(): e.Express; >e : typeof e >e : any @@ -167,6 +169,8 @@ import * as e from "express"; >e : typeof e declare module "express" { +>"express" : typeof e + interface Request { >Request : Request diff --git a/tests/baselines/reference/augmentExportEquals6.symbols b/tests/baselines/reference/augmentExportEquals6.symbols index 33ec14ed334..2125b650464 100644 --- a/tests/baselines/reference/augmentExportEquals6.symbols +++ b/tests/baselines/reference/augmentExportEquals6.symbols @@ -28,6 +28,8 @@ x.B.b = 1; // OK - './file1' is a namespace declare module "./file1" { +>"./file1" : Symbol(x, Decl(file1.ts, 0, 0), Decl(file1.ts, 0, 12), Decl(file2.ts, 1, 10)) + interface A { a: number } >A : Symbol(A, Decl(file1.ts, 1, 15), Decl(file2.ts, 4, 26)) >a : Symbol(A.a, Decl(file2.ts, 5, 17)) diff --git a/tests/baselines/reference/augmentExportEquals6.types b/tests/baselines/reference/augmentExportEquals6.types index 01b7095b169..6948535c6da 100644 --- a/tests/baselines/reference/augmentExportEquals6.types +++ b/tests/baselines/reference/augmentExportEquals6.types @@ -30,6 +30,8 @@ x.B.b = 1; // OK - './file1' is a namespace declare module "./file1" { +>"./file1" : typeof x + interface A { a: number } >A : A >a : number diff --git a/tests/baselines/reference/augmentExportEquals6_1.symbols b/tests/baselines/reference/augmentExportEquals6_1.symbols index 60f8b845657..b75f8131c01 100644 --- a/tests/baselines/reference/augmentExportEquals6_1.symbols +++ b/tests/baselines/reference/augmentExportEquals6_1.symbols @@ -1,5 +1,7 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : Symbol("file1", Decl(file1.d.ts, 0, 0)) + class foo {} >foo : Symbol(foo, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 16), Decl(file2.ts, 1, 28)) @@ -21,6 +23,8 @@ import x = require("file1"); // OK - './file1' is a namespace declare module "file1" { +>"file1" : Symbol(x, Decl(file1.d.ts, 0, 24), Decl(file1.d.ts, 1, 16), Decl(file2.ts, 1, 28)) + interface A { a: number } >A : Symbol(A, Decl(file1.d.ts, 2, 19), Decl(file2.ts, 4, 24)) >a : Symbol(A.a, Decl(file2.ts, 5, 17)) diff --git a/tests/baselines/reference/augmentExportEquals6_1.types b/tests/baselines/reference/augmentExportEquals6_1.types index a6041ecda81..6929d99ad51 100644 --- a/tests/baselines/reference/augmentExportEquals6_1.types +++ b/tests/baselines/reference/augmentExportEquals6_1.types @@ -1,5 +1,7 @@ === tests/cases/compiler/file1.d.ts === declare module "file1" { +>"file1" : typeof "file1" + class foo {} >foo : foo @@ -21,6 +23,8 @@ import x = require("file1"); // OK - './file1' is a namespace declare module "file1" { +>"file1" : typeof x + interface A { a: number } >A : A >a : number diff --git a/tests/baselines/reference/augmentExportEquals7.symbols b/tests/baselines/reference/augmentExportEquals7.symbols index 42156dafaed..cdcd430e7af 100644 --- a/tests/baselines/reference/augmentExportEquals7.symbols +++ b/tests/baselines/reference/augmentExportEquals7.symbols @@ -13,6 +13,8 @@ import * as lib from "lib"; >lib : Symbol(lib, Decl(index.d.ts, 0, 6)) declare module "lib" { +>"lib" : Symbol("lib", Decl(index.d.ts, 0, 27)) + export function fn(): void; >fn : Symbol(fn, Decl(index.d.ts, 1, 22)) } diff --git a/tests/baselines/reference/augmentExportEquals7.types b/tests/baselines/reference/augmentExportEquals7.types index f2870eab8df..4311a3c112e 100644 --- a/tests/baselines/reference/augmentExportEquals7.types +++ b/tests/baselines/reference/augmentExportEquals7.types @@ -13,6 +13,8 @@ import * as lib from "lib"; >lib : () => void declare module "lib" { +>"lib" : typeof "lib" + export function fn(): void; >fn : () => void } diff --git a/tests/baselines/reference/bangInModuleName.symbols b/tests/baselines/reference/bangInModuleName.symbols index 08bcf487cc8..ca3d4a161f5 100644 --- a/tests/baselines/reference/bangInModuleName.symbols +++ b/tests/baselines/reference/bangInModuleName.symbols @@ -6,9 +6,12 @@ import * as http from 'intern/dojo/node!http'; === tests/cases/compiler/a.d.ts === declare module "http" { +>"http" : Symbol("http", Decl(a.d.ts, 0, 0)) } declare module 'intern/dojo/node!http' { +>'intern/dojo/node!http' : Symbol('intern/dojo/node!http', Decl(a.d.ts, 1, 1)) + import http = require('http'); >http : Symbol(http, Decl(a.d.ts, 3, 40)) diff --git a/tests/baselines/reference/bangInModuleName.types b/tests/baselines/reference/bangInModuleName.types index 93115f76a0e..691ac6add00 100644 --- a/tests/baselines/reference/bangInModuleName.types +++ b/tests/baselines/reference/bangInModuleName.types @@ -6,9 +6,12 @@ import * as http from 'intern/dojo/node!http'; === tests/cases/compiler/a.d.ts === declare module "http" { +>"http" : typeof "http" } declare module 'intern/dojo/node!http' { +>'intern/dojo/node!http' : typeof 'intern/dojo/node!http' + import http = require('http'); >http : typeof http diff --git a/tests/baselines/reference/binaryIntegerLiteral.symbols b/tests/baselines/reference/binaryIntegerLiteral.symbols index 31e28819657..fb15a8b6e6c 100644 --- a/tests/baselines/reference/binaryIntegerLiteral.symbols +++ b/tests/baselines/reference/binaryIntegerLiteral.symbols @@ -15,6 +15,8 @@ var obj1 = { >obj1 : Symbol(obj1, Decl(binaryIntegerLiteral.ts, 5, 3)) 0b11010: "Hello", +>0b11010 : Symbol(0b11010, Decl(binaryIntegerLiteral.ts, 5, 12)) + a: bin1, >a : Symbol(a, Decl(binaryIntegerLiteral.ts, 6, 21)) >bin1 : Symbol(bin1, Decl(binaryIntegerLiteral.ts, 0, 3)) @@ -26,12 +28,15 @@ var obj1 = { >b : Symbol(b, Decl(binaryIntegerLiteral.ts, 8, 9)) 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Symbol(0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 9, 15)) } var obj2 = { >obj2 : Symbol(obj2, Decl(binaryIntegerLiteral.ts, 13, 3)) 0B11010: "World", +>0B11010 : Symbol(0B11010, Decl(binaryIntegerLiteral.ts, 13, 12)) + a: bin2, >a : Symbol(a, Decl(binaryIntegerLiteral.ts, 14, 21)) >bin2 : Symbol(bin2, Decl(binaryIntegerLiteral.ts, 1, 3)) @@ -43,6 +48,7 @@ var obj2 = { >b : Symbol(b, Decl(binaryIntegerLiteral.ts, 16, 9)) 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteral.ts, 17, 15)) } obj1[0b11010]; // string diff --git a/tests/baselines/reference/binaryIntegerLiteral.types b/tests/baselines/reference/binaryIntegerLiteral.types index 5cee371fdbe..070ae22d796 100644 --- a/tests/baselines/reference/binaryIntegerLiteral.types +++ b/tests/baselines/reference/binaryIntegerLiteral.types @@ -20,6 +20,7 @@ var obj1 = { >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", +>0b11010 : string >"Hello" : "Hello" a: bin1, @@ -34,6 +35,7 @@ var obj1 = { >0b11010 : 26 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : boolean >true : true } @@ -42,6 +44,7 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", +>0B11010 : string >"World" : "World" a: bin2, @@ -56,6 +59,7 @@ var obj2 = { >0B11010 : 26 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : boolean >false : false } diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.symbols b/tests/baselines/reference/binaryIntegerLiteralES6.symbols index 4fb7aaff82d..15c8c633019 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.symbols +++ b/tests/baselines/reference/binaryIntegerLiteralES6.symbols @@ -15,6 +15,8 @@ var obj1 = { >obj1 : Symbol(obj1, Decl(binaryIntegerLiteralES6.ts, 5, 3)) 0b11010: "Hello", +>0b11010 : Symbol(0b11010, Decl(binaryIntegerLiteralES6.ts, 5, 12)) + a: bin1, >a : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 6, 21)) >bin1 : Symbol(bin1, Decl(binaryIntegerLiteralES6.ts, 0, 3)) @@ -26,12 +28,15 @@ var obj1 = { >b : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 8, 9)) 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Symbol(0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 9, 15)) } var obj2 = { >obj2 : Symbol(obj2, Decl(binaryIntegerLiteralES6.ts, 13, 3)) 0B11010: "World", +>0B11010 : Symbol(0B11010, Decl(binaryIntegerLiteralES6.ts, 13, 12)) + a: bin2, >a : Symbol(a, Decl(binaryIntegerLiteralES6.ts, 14, 21)) >bin2 : Symbol(bin2, Decl(binaryIntegerLiteralES6.ts, 1, 3)) @@ -43,6 +48,7 @@ var obj2 = { >b : Symbol(b, Decl(binaryIntegerLiteralES6.ts, 16, 9)) 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : Symbol(0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111, Decl(binaryIntegerLiteralES6.ts, 17, 15)) } obj1[0b11010]; // string diff --git a/tests/baselines/reference/binaryIntegerLiteralES6.types b/tests/baselines/reference/binaryIntegerLiteralES6.types index ab28010283b..fe9f65a1f71 100644 --- a/tests/baselines/reference/binaryIntegerLiteralES6.types +++ b/tests/baselines/reference/binaryIntegerLiteralES6.types @@ -20,6 +20,7 @@ var obj1 = { >{ 0b11010: "Hello", a: bin1, bin1, b: 0b11010, 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,} : { 0b11010: string; a: number; bin1: number; b: number; 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0b11010: "Hello", +>0b11010 : string >"Hello" : "Hello" a: bin1, @@ -34,6 +35,7 @@ var obj1 = { >0b11010 : 26 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true, +>0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111 : boolean >true : true } @@ -42,6 +44,7 @@ var obj2 = { >{ 0B11010: "World", a: bin2, bin2, b: 0B11010, 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,} : { 0B11010: string; a: number; bin2: number; b: number; 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: boolean; } 0B11010: "World", +>0B11010 : string >"World" : "World" a: bin2, @@ -56,6 +59,7 @@ var obj2 = { >0B11010 : 26 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false, +>0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111 : boolean >false : false } diff --git a/tests/baselines/reference/binaryIntegerLiteralError.symbols b/tests/baselines/reference/binaryIntegerLiteralError.symbols index bd40cecff8d..dca3aa3d9ff 100644 --- a/tests/baselines/reference/binaryIntegerLiteralError.symbols +++ b/tests/baselines/reference/binaryIntegerLiteralError.symbols @@ -10,7 +10,13 @@ var obj1 = { >obj1 : Symbol(obj1, Decl(binaryIntegerLiteralError.ts, 4, 3)) 0b11010: "hi", +>0b11010 : Symbol(0b11010, Decl(binaryIntegerLiteralError.ts, 4, 12), Decl(binaryIntegerLiteralError.ts, 5, 18), Decl(binaryIntegerLiteralError.ts, 6, 16)) + 26: "Hello", +>26 : Symbol(0b11010, Decl(binaryIntegerLiteralError.ts, 4, 12), Decl(binaryIntegerLiteralError.ts, 5, 18), Decl(binaryIntegerLiteralError.ts, 6, 16)) + "26": "world", +>"26" : Symbol(0b11010, Decl(binaryIntegerLiteralError.ts, 4, 12), Decl(binaryIntegerLiteralError.ts, 5, 18), Decl(binaryIntegerLiteralError.ts, 6, 16)) + }; diff --git a/tests/baselines/reference/binaryIntegerLiteralError.types b/tests/baselines/reference/binaryIntegerLiteralError.types index 5ab51f74666..6d53b3e515e 100644 --- a/tests/baselines/reference/binaryIntegerLiteralError.types +++ b/tests/baselines/reference/binaryIntegerLiteralError.types @@ -15,12 +15,15 @@ var obj1 = { >{ 0b11010: "hi", 26: "Hello", "26": "world",} : { 0b11010: string; } 0b11010: "hi", +>0b11010 : string >"hi" : "hi" 26: "Hello", +>26 : string >"Hello" : "Hello" "26": "world", +>"26" : string >"world" : "world" }; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols index 24783a153ae..e734966c594 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols @@ -5,6 +5,7 @@ enum ENUM1 { A, B, "" }; >ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0)) >A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12)) >B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15)) +>"" : Symbol(ENUM1[""], Decl(bitwiseNotOperatorWithEnumType.ts, 2, 18)) // enum type var var ResultIsNumber1 = ~ENUM1; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types index 03008f67d11..266c62de93e 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types @@ -5,6 +5,7 @@ enum ENUM1 { A, B, "" }; >ENUM1 : ENUM1 >A : ENUM1.A >B : ENUM1.B +>"" : ENUM1. // enum type var var ResultIsNumber1 = ~ENUM1; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols index b09c819cf65..e55bfd99aa8 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.symbols @@ -27,6 +27,7 @@ class C { >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) 0: number; +>0 : Symbol(C[0], Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 8, 24)) } interface I { @@ -51,6 +52,7 @@ interface I { >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) 0: number; +>0 : Symbol(I[0], Decl(classWithOnlyPublicMembersEquivalentToInterface.ts, 17, 24)) } var c: C; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types index 272ba94f7f2..65e01240b72 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types @@ -29,6 +29,7 @@ class C { >Object : Object 0: number; +>0 : number } interface I { @@ -53,6 +54,7 @@ interface I { >Object : Object 0: number; +>0 : number } var c: C; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols index 80658b0531c..ab337787517 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.symbols @@ -27,6 +27,7 @@ class C { >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) 0: number; +>0 : Symbol(C[0], Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 8, 24)) public static foo: string; // doesn't effect equivalence >foo : Symbol(C.foo, Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 9, 14)) @@ -54,6 +55,7 @@ interface I { >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) 0: number; +>0 : Symbol(I[0], Decl(classWithOnlyPublicMembersEquivalentToInterface2.ts, 19, 24)) } var c: C; diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types index 22440da1768..a5fbc06e0af 100644 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types @@ -29,6 +29,7 @@ class C { >Object : Object 0: number; +>0 : number public static foo: string; // doesn't effect equivalence >foo : string @@ -56,6 +57,7 @@ interface I { >Object : Object 0: number; +>0 : number } var c: C; diff --git a/tests/baselines/reference/commonSourceDirectory.symbols b/tests/baselines/reference/commonSourceDirectory.symbols index 5409286ede5..89233ddd3cc 100644 --- a/tests/baselines/reference/commonSourceDirectory.symbols +++ b/tests/baselines/reference/commonSourceDirectory.symbols @@ -18,6 +18,8 @@ export const x = 0; === /types/bar.d.ts === declare module "bar" { +>"bar" : Symbol("bar", Decl(bar.d.ts, 0, 0)) + export const y = 0; >y : Symbol(y, Decl(bar.d.ts, 1, 16)) } diff --git a/tests/baselines/reference/commonSourceDirectory.types b/tests/baselines/reference/commonSourceDirectory.types index ce0169582d7..ea16e24b851 100644 --- a/tests/baselines/reference/commonSourceDirectory.types +++ b/tests/baselines/reference/commonSourceDirectory.types @@ -20,6 +20,8 @@ export const x = 0; === /types/bar.d.ts === declare module "bar" { +>"bar" : typeof "bar" + export const y = 0; >y : 0 >0 : 0 diff --git a/tests/baselines/reference/complexRecursiveCollections.symbols b/tests/baselines/reference/complexRecursiveCollections.symbols index 8533f5220a2..6e0bc95a292 100644 --- a/tests/baselines/reference/complexRecursiveCollections.symbols +++ b/tests/baselines/reference/complexRecursiveCollections.symbols @@ -3800,6 +3800,8 @@ declare module Immutable { } } declare module "immutable" { +>"immutable" : Symbol("immutable", Decl(immutable.ts, 506, 1)) + export = Immutable >Immutable : Symbol(Immutable, Decl(immutable.ts, 0, 0)) } diff --git a/tests/baselines/reference/complexRecursiveCollections.types b/tests/baselines/reference/complexRecursiveCollections.types index e3d4a01196e..1622d9ce360 100644 --- a/tests/baselines/reference/complexRecursiveCollections.types +++ b/tests/baselines/reference/complexRecursiveCollections.types @@ -3800,6 +3800,8 @@ declare module Immutable { } } declare module "immutable" { +>"immutable" : typeof "immutable" + export = Immutable >Immutable : typeof Immutable } diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols index 10864291be1..e3a6c214404 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols @@ -16,6 +16,7 @@ let {["bar"]: bar2} = {bar: "bar"}; let {[11]: bar2_1} = {11: "bar"}; >11 : Symbol(bar2_1, Decl(computedPropertiesInDestructuring1_ES6.ts, 5, 5)) >bar2_1 : Symbol(bar2_1, Decl(computedPropertiesInDestructuring1_ES6.ts, 5, 5)) +>11 : Symbol(11, Decl(computedPropertiesInDestructuring1_ES6.ts, 5, 22)) let foo2 = () => "bar"; >foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring1_ES6.ts, 7, 3)) diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types index 79fb8372023..0197c0b4a82 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types @@ -22,6 +22,7 @@ let {[11]: bar2_1} = {11: "bar"}; >11 : 11 >bar2_1 : string >{11: "bar"} : { 11: string; } +>11 : string >"bar" : "bar" let foo2 = () => "bar"; diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols index fb303b1f8b3..23179820592 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols @@ -23,6 +23,8 @@ foo({ >p : Symbol(p, Decl(computedPropertyNamesContextualType6_ES5.ts, 6, 5)) 0: () => { }, +>0 : Symbol(0, Decl(computedPropertyNamesContextualType6_ES5.ts, 7, 10)) + ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index 9c89065ac02..5c46bee4ccf 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -26,6 +26,7 @@ foo({ >"" : "" 0: () => { }, +>0 : () => void >() => { } : () => void ["hi" + "bye"]: true, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols index b3e371447e2..d441c593fb3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols @@ -23,6 +23,8 @@ foo({ >p : Symbol(p, Decl(computedPropertyNamesContextualType6_ES6.ts, 6, 5)) 0: () => { }, +>0 : Symbol(0, Decl(computedPropertyNamesContextualType6_ES6.ts, 7, 10)) + ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index 03295db5f70..f0e56a954cb 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -26,6 +26,7 @@ foo({ >"" : "" 0: () => { }, +>0 : () => void >() => { } : () => void ["hi" + "bye"]: true, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols index d6889f9912d..77e87a5bf48 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols @@ -36,6 +36,8 @@ foo({ >foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES5.ts, 5, 1)) 0: () => { }, +>0 : Symbol(0, Decl(computedPropertyNamesContextualType7_ES5.ts, 10, 5)) + ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types index b77a129a0b4..e838c06bfa1 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types @@ -38,6 +38,7 @@ foo({ >{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; } 0: () => { }, +>0 : () => void >() => { } : () => void ["hi" + "bye"]: true, diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols index d04c8f913bd..5f798731dba 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols @@ -36,6 +36,8 @@ foo({ >foo : Symbol(foo, Decl(computedPropertyNamesContextualType7_ES6.ts, 5, 1)) 0: () => { }, +>0 : Symbol(0, Decl(computedPropertyNamesContextualType7_ES6.ts, 10, 5)) + ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types index f041b2b4eb4..ace52b05bcb 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types @@ -38,6 +38,7 @@ foo({ >{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; } 0: () => { }, +>0 : () => void >() => { } : () => void ["hi" + "bye"]: true, diff --git a/tests/baselines/reference/constEnumPropertyAccess1.symbols b/tests/baselines/reference/constEnumPropertyAccess1.symbols index 63861a94ae1..a2b4ed6a9a1 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.symbols +++ b/tests/baselines/reference/constEnumPropertyAccess1.symbols @@ -30,6 +30,8 @@ var o: { } = { 1: true +>1 : Symbol(1, Decl(constEnumPropertyAccess1.ts, 13, 5)) + }; var a = G.A; diff --git a/tests/baselines/reference/constEnumPropertyAccess1.types b/tests/baselines/reference/constEnumPropertyAccess1.types index af9aacd279c..9a210c646c7 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.types +++ b/tests/baselines/reference/constEnumPropertyAccess1.types @@ -37,6 +37,7 @@ var o: { >{ 1: true } : { 1: true; } 1: true +>1 : true >true : true }; diff --git a/tests/baselines/reference/constIndexedAccess.symbols b/tests/baselines/reference/constIndexedAccess.symbols index ef2be6368e3..658a30c99a6 100644 --- a/tests/baselines/reference/constIndexedAccess.symbols +++ b/tests/baselines/reference/constIndexedAccess.symbols @@ -13,7 +13,10 @@ interface indexAccess { >indexAccess : Symbol(indexAccess, Decl(constIndexedAccess.ts, 3, 1)) 0: string; +>0 : Symbol(indexAccess[0], Decl(constIndexedAccess.ts, 5, 23)) + 1: number; +>1 : Symbol(indexAccess[1], Decl(constIndexedAccess.ts, 6, 14)) } let test: indexAccess; diff --git a/tests/baselines/reference/constIndexedAccess.types b/tests/baselines/reference/constIndexedAccess.types index e63852c1ab1..2a753814d40 100644 --- a/tests/baselines/reference/constIndexedAccess.types +++ b/tests/baselines/reference/constIndexedAccess.types @@ -13,7 +13,10 @@ interface indexAccess { >indexAccess : indexAccess 0: string; +>0 : string + 1: number; +>1 : number } let test: indexAccess; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols index 45a894d8895..56b4bb3c7fa 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols @@ -1,5 +1,7 @@ === tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts === declare module "fs" { +>"fs" : Symbol("fs", Decl(constructorWithIncompleteTypeAnnotation.ts, 0, 0)) + export class File { >File : Symbol(File, Decl(constructorWithIncompleteTypeAnnotation.ts, 0, 21)) @@ -171,6 +173,7 @@ module TypeScriptAllInOne { var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, instanceof : () => 'objLit{42}' }; >objLit : Symbol(objLit, Decl(constructorWithIncompleteTypeAnnotation.ts, 82, 15)) +>"var" : Symbol("var", Decl(constructorWithIncompleteTypeAnnotation.ts, 82, 26)) >number : Symbol(number, Decl(constructorWithIncompleteTypeAnnotation.ts, 97, 15)) >equals : Symbol(equals, Decl(constructorWithIncompleteTypeAnnotation.ts, 82, 46)) >x : Symbol(x, Decl(constructorWithIncompleteTypeAnnotation.ts, 82, 65)) diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types index d1b7c98087f..78235027dd6 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types @@ -1,5 +1,7 @@ === tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts === declare module "fs" { +>"fs" : typeof "fs" + export class File { >File : File @@ -249,6 +251,7 @@ module TypeScriptAllInOne { var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, instanceof : () => 'objLit{42}' }; >objLit : { "var": number; equals: (x: any) => boolean; instanceof: () => string; } >{ "var": number = 42, equals: function (x) { return x["var"] === 42; }, instanceof : () => 'objLit{42}' } : { "var": number; equals: (x: any) => boolean; instanceof: () => string; } +>"var" : number >number = 42 : 42 >number : number >42 : 42 diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.symbols b/tests/baselines/reference/contextualTypeArrayReturnType.symbols index 2982a1ce893..0688e810c08 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.symbols +++ b/tests/baselines/reference/contextualTypeArrayReturnType.symbols @@ -33,6 +33,8 @@ var style: IBookStyle = { return [ {'ry': null } +>'ry' : Symbol('ry', Decl(contextualTypeArrayReturnType.ts, 15, 13)) + ]; } } diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.types b/tests/baselines/reference/contextualTypeArrayReturnType.types index 6c91fd7b8b9..aee8eae59f5 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.types +++ b/tests/baselines/reference/contextualTypeArrayReturnType.types @@ -38,6 +38,7 @@ var style: IBookStyle = { {'ry': null } >{'ry': null } : { 'ry': null; } +>'ry' : null >null : null ]; diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols index 985bb52f243..207b4dab689 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.symbols @@ -24,6 +24,7 @@ interface IWithNoNumberIndexSignature { >IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) 0: string; +>0 : Symbol(IWithNoNumberIndexSignature[0], Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 12, 39)) } interface IWithStringIndexSignature1 { >IWithStringIndexSignature1 : Symbol(IWithStringIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 14, 1)) @@ -113,6 +114,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a } >x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) >IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) >IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>1 : Symbol(1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 68)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 71)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 71)) @@ -120,6 +122,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a } >x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) >IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) >IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>0 : Symbol(0, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 68)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 71)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 71)) @@ -127,11 +130,13 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" >x3 : Symbol(x3, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 49, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 50, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 3)) >IWithNoNumberIndexSignature : Symbol(IWithNoNumberIndexSignature, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 11, 1)) >IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) +>0 : Symbol(0, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 51, 68)) var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number >x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 3)) >IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) >IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) +>1 : Symbol(1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 67)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 70)) >a.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 70)) @@ -141,6 +146,7 @@ var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; >x4 : Symbol(x4, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 52, 3), Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 3)) >IWithNumberIndexSignature1 : Symbol(IWithNumberIndexSignature1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 20, 1)) >IWithNumberIndexSignature2 : Symbol(IWithNumberIndexSignature2, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 23, 1)) +>1 : Symbol(1, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 67)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 70)) >a : Symbol(a, Decl(contextualTypeWithUnionTypeIndexSignatures.ts, 53, 70)) diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types index 97c5f0fdf90..c44afae7cd5 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -24,6 +24,7 @@ interface IWithNoNumberIndexSignature { >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature 0: string; +>0 : string } interface IWithStringIndexSignature1 { >IWithStringIndexSignature1 : IWithStringIndexSignature1 @@ -125,6 +126,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 1: a => a } >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >{ 1: a => a } : { 1: (a: number) => number; } +>1 : (a: number) => number >a => a : (a: number) => number >a : number >a : number @@ -134,6 +136,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: a => a } >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >{ 0: a => a } : { 0: (a: any) => any; } +>0 : (a: any) => any >a => a : (a: any) => any >a : any >a : any @@ -143,6 +146,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >{ 0: "hello" } : { 0: string; } +>0 : string >"hello" : "hello" var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number @@ -150,6 +154,7 @@ var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.to >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >IWithNumberIndexSignature2 : IWithNumberIndexSignature2 >{ 1: a => a.toString() } : { 1: (a: number) => string; } +>1 : (a: number) => string >a => a.toString() : (a: number) => string >a : number >a.toString() : string @@ -162,6 +167,7 @@ var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a }; >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 >IWithNumberIndexSignature2 : IWithNumberIndexSignature2 >{ 1: a => a } : { 1: (a: number) => number; } +>1 : (a: number) => number >a => a : (a: number) => number >a : number >a : number diff --git a/tests/baselines/reference/convertKeywordsYes.symbols b/tests/baselines/reference/convertKeywordsYes.symbols index 8049c747efb..27e5774b1f7 100644 --- a/tests/baselines/reference/convertKeywordsYes.symbols +++ b/tests/baselines/reference/convertKeywordsYes.symbols @@ -505,6 +505,8 @@ class bigClass { >bigClass : Symbol(bigClass, Decl(convertKeywordsYes.ts, 171, 1)) public "constructor" = 0; +>"constructor" : Symbol(bigClass["constructor"], Decl(convertKeywordsYes.ts, 173, 16)) + public any = 0; >any : Symbol(bigClass.any, Decl(convertKeywordsYes.ts, 174, 29)) diff --git a/tests/baselines/reference/convertKeywordsYes.types b/tests/baselines/reference/convertKeywordsYes.types index 3ed4f9ae903..b7b3989df4e 100644 --- a/tests/baselines/reference/convertKeywordsYes.types +++ b/tests/baselines/reference/convertKeywordsYes.types @@ -578,6 +578,7 @@ class bigClass { >bigClass : bigClass public "constructor" = 0; +>"constructor" : number >0 : 0 public any = 0; diff --git a/tests/baselines/reference/correctlyMarkAliasAsReferences1.symbols b/tests/baselines/reference/correctlyMarkAliasAsReferences1.symbols index b0338f1c803..f8a1dfe2ef4 100644 --- a/tests/baselines/reference/correctlyMarkAliasAsReferences1.symbols +++ b/tests/baselines/reference/correctlyMarkAliasAsReferences1.symbols @@ -25,5 +25,5 @@ let k = ; ->button : Symbol(unknown) ->button : Symbol(unknown) } } diff --git a/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols index b6163a36df6..37580994a15 100644 --- a/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols +++ b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.symbols @@ -44,7 +44,6 @@ function ShouldInferFromData(props: Props): JSX.Element { >Element : Symbol(JSX.Element, Decl(index.tsx, 0, 15)) return
; ->div : Symbol(unknown) } // Sanity check: function call equivalent versions work fine diff --git a/tests/baselines/reference/tsxNoJsx.symbols b/tests/baselines/reference/tsxNoJsx.symbols index 2bf187c99cd..65a397961e7 100644 --- a/tests/baselines/reference/tsxNoJsx.symbols +++ b/tests/baselines/reference/tsxNoJsx.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/jsx/tsxNoJsx.tsx === ; ->nope : Symbol(unknown) - +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/tsxReactEmitNesting.symbols b/tests/baselines/reference/tsxReactEmitNesting.symbols index 9972436ac73..e6d19f3ea62 100644 --- a/tests/baselines/reference/tsxReactEmitNesting.symbols +++ b/tests/baselines/reference/tsxReactEmitNesting.symbols @@ -15,19 +15,13 @@ let render = (ctrl, model) => >model : Symbol(model, Decl(file.tsx, 5, 19))
->section : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 6, 12))
->header : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 7, 15))

todos <x>

->h1 : Symbol(unknown) ->h1 : Symbol(unknown) - ->input : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 9, 18)) >autofocus : Symbol(autofocus, Decl(file.tsx, 9, 35)) >autocomplete : Symbol(autocomplete, Decl(file.tsx, 9, 45)) @@ -40,10 +34,7 @@ let render = (ctrl, model) => >model : Symbol(model, Decl(file.tsx, 5, 19))
->header : Symbol(unknown) -
->section : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 11, 16)) >style : Symbol(style, Decl(file.tsx, 11, 29)) >display : Symbol(display, Decl(file.tsx, 11, 38)) @@ -51,7 +42,6 @@ let render = (ctrl, model) => >model : Symbol(model, Decl(file.tsx, 5, 19)) ->input : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 12, 18)) >type : Symbol(type, Decl(file.tsx, 12, 37)) >onChange : Symbol(onChange, Decl(file.tsx, 12, 53)) @@ -59,7 +49,6 @@ let render = (ctrl, model) => >ctrl : Symbol(ctrl, Decl(file.tsx, 5, 14))
    ->ul : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 13, 15)) {model.filteredTodos.map((todo) => @@ -67,7 +56,6 @@ let render = (ctrl, model) => >todo : Symbol(todo, Decl(file.tsx, 14, 42))
  • ->li : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 15, 23)) >todo : Symbol(todo, Decl(file.tsx, 15, 32)) >completed : Symbol(completed, Decl(file.tsx, 15, 43)) @@ -77,62 +65,42 @@ let render = (ctrl, model) => >model : Symbol(model, Decl(file.tsx, 5, 19))
    ->div : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 16, 28)) {(!todo.editable) ? >todo : Symbol(todo, Decl(file.tsx, 14, 42)) ->input : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 18, 38)) >type : Symbol(type, Decl(file.tsx, 18, 53)) ->input : Symbol(unknown) : null } ->label : Symbol(unknown) >onDoubleClick : Symbol(onDoubleClick, Decl(file.tsx, 21, 34)) >ctrl : Symbol(ctrl, Decl(file.tsx, 5, 14)) >todo : Symbol(todo, Decl(file.tsx, 14, 42)) >todo : Symbol(todo, Decl(file.tsx, 14, 42)) ->label : Symbol(unknown) ->button : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 22, 35)) >onClick : Symbol(onClick, Decl(file.tsx, 22, 51)) >ctrl : Symbol(ctrl, Decl(file.tsx, 5, 14)) >ctrl : Symbol(ctrl, Decl(file.tsx, 5, 14)) >todo : Symbol(todo, Decl(file.tsx, 14, 42)) ->button : Symbol(unknown)
    ->div : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 23, 32))
    ->div : Symbol(unknown) >class : Symbol(class, Decl(file.tsx, 24, 36))
    ->div : Symbol(unknown) -
    ->div : Symbol(unknown) -
  • ->li : Symbol(unknown) - )}
->ul : Symbol(unknown) -
->section : Symbol(unknown) -
->section : Symbol(unknown) diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution17.symbols b/tests/baselines/reference/tsxSpreadAttributesResolution17.symbols index 6f346ccdcb1..96dfe32abb0 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution17.symbols +++ b/tests/baselines/reference/tsxSpreadAttributesResolution17.symbols @@ -24,8 +24,6 @@ export class Empty extends React.Component<{}, {}> { >render : Symbol(Empty.render, Decl(file.tsx, 8, 52)) return
Hello
; ->div : Symbol(unknown) ->div : Symbol(unknown) } } diff --git a/tests/baselines/reference/tsxTypeErrors.symbols b/tests/baselines/reference/tsxTypeErrors.symbols index f40faf52b19..a58529c5258 100644 --- a/tests/baselines/reference/tsxTypeErrors.symbols +++ b/tests/baselines/reference/tsxTypeErrors.symbols @@ -2,13 +2,11 @@ // A built-in element (OK) var a1 =
; >a1 : Symbol(a1, Decl(tsxTypeErrors.tsx, 1, 3)) ->div : Symbol(unknown) >id : Symbol(id, Decl(tsxTypeErrors.tsx, 1, 13)) // A built-in element with a mistyped property (error) var a2 = >a2 : Symbol(a2, Decl(tsxTypeErrors.tsx, 4, 3)) ->img : Symbol(unknown) >srce : Symbol(srce, Decl(tsxTypeErrors.tsx, 4, 13)) // A built-in element with a badly-typed attribute value (error) @@ -18,14 +16,12 @@ var thing = { oops: 100 }; var a3 =
>a3 : Symbol(a3, Decl(tsxTypeErrors.tsx, 8, 3)) ->div : Symbol(unknown) >id : Symbol(id, Decl(tsxTypeErrors.tsx, 8, 13)) >thing : Symbol(thing, Decl(tsxTypeErrors.tsx, 7, 3)) // Mistyped html name (error) var e1 = >e1 : Symbol(e1, Decl(tsxTypeErrors.tsx, 11, 3)) ->imag : Symbol(unknown) >src : Symbol(src, Decl(tsxTypeErrors.tsx, 11, 14)) // A custom type diff --git a/tests/baselines/reference/unusedImports13.symbols b/tests/baselines/reference/unusedImports13.symbols index 2b9da078e44..46949555e73 100644 --- a/tests/baselines/reference/unusedImports13.symbols +++ b/tests/baselines/reference/unusedImports13.symbols @@ -4,8 +4,6 @@ import React = require("react"); export const FooComponent =
>FooComponent : Symbol(FooComponent, Decl(foo.tsx, 2, 12)) ->div : Symbol(unknown) ->div : Symbol(unknown) === tests/cases/compiler/node_modules/@types/react/index.d.ts === export = React; diff --git a/tests/baselines/reference/unusedImports14.symbols b/tests/baselines/reference/unusedImports14.symbols index 2b9da078e44..46949555e73 100644 --- a/tests/baselines/reference/unusedImports14.symbols +++ b/tests/baselines/reference/unusedImports14.symbols @@ -4,8 +4,6 @@ import React = require("react"); export const FooComponent =
>FooComponent : Symbol(FooComponent, Decl(foo.tsx, 2, 12)) ->div : Symbol(unknown) ->div : Symbol(unknown) === tests/cases/compiler/node_modules/@types/react/index.d.ts === export = React; diff --git a/tests/baselines/reference/unusedImports15.symbols b/tests/baselines/reference/unusedImports15.symbols index e163b1ad459..2aa41146738 100644 --- a/tests/baselines/reference/unusedImports15.symbols +++ b/tests/baselines/reference/unusedImports15.symbols @@ -4,8 +4,6 @@ import Element = require("react"); export const FooComponent =
>FooComponent : Symbol(FooComponent, Decl(foo.tsx, 2, 12)) ->div : Symbol(unknown) ->div : Symbol(unknown) === tests/cases/compiler/node_modules/@types/react/index.d.ts === export = React; diff --git a/tests/baselines/reference/unusedImports16.symbols b/tests/baselines/reference/unusedImports16.symbols index e163b1ad459..2aa41146738 100644 --- a/tests/baselines/reference/unusedImports16.symbols +++ b/tests/baselines/reference/unusedImports16.symbols @@ -4,8 +4,6 @@ import Element = require("react"); export const FooComponent =
>FooComponent : Symbol(FooComponent, Decl(foo.tsx, 2, 12)) ->div : Symbol(unknown) ->div : Symbol(unknown) === tests/cases/compiler/node_modules/@types/react/index.d.ts === export = React; diff --git a/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts b/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts new file mode 100644 index 00000000000..55fd74d4243 --- /dev/null +++ b/tests/cases/fourslash/extract-method_jsxIntrinsicTagSymbol.ts @@ -0,0 +1,10 @@ +/// + +// @Filename: /a.tsx + +// Test that we don't get `unknownSymbol`, which causes a crash when we try getting its declarations. + +/////*a*/
/*b*/ + +goTo.select("a", "b"); +verify.refactorAvailable("Extract Symbol", "constant_scope_0"); From 8d6e48a2ec06c0c793323625a8c399a2b2cf13ba Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 8 Feb 2018 15:28:59 -0800 Subject: [PATCH 087/298] Change the meaning of useNonAdjustedStartPosition Old: getFullStart New: getStart Impact: only used in tests Reason: symmetry with useNonAdjustedEndPosition - both now effectively mean "exclude trivia from range" --- src/services/textChanges.ts | 4 +++- tests/baselines/reference/textChanges/deleteNode2.js | 6 +++++- tests/baselines/reference/textChanges/deleteNode4.js | 6 +++++- tests/baselines/reference/textChanges/deleteNodeRange2.js | 4 +++- tests/baselines/reference/textChanges/deleteNodeRange4.js | 4 +++- tests/baselines/reference/textChanges/replaceNode2.js | 4 +++- tests/baselines/reference/textChanges/replaceNode4.js | 4 +++- tests/baselines/reference/textChanges/replaceNode5.js | 2 ++ tests/baselines/reference/textChanges/replaceNodeRange2.js | 4 +++- tests/baselines/reference/textChanges/replaceNodeRange4.js | 4 +++- 10 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 83b434aac7d..fc61ae36195 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -28,9 +28,11 @@ namespace ts.textChanges { } export interface ConfigurableStart { + /** True to use getStart() (NB, not getFullStart()) without adjustment. */ useNonAdjustedStartPosition?: boolean; } export interface ConfigurableEnd { + /** True to use getEnd() without adjustment. */ useNonAdjustedEndPosition?: boolean; } @@ -132,7 +134,7 @@ namespace ts.textChanges { export function getAdjustedStartPosition(sourceFile: SourceFile, node: Node, options: ConfigurableStart, position: Position) { if (options.useNonAdjustedStartPosition) { - return node.getFullStart(); + return node.getStart(); } const fullStart = node.getFullStart(); const start = node.getStart(sourceFile); diff --git a/tests/baselines/reference/textChanges/deleteNode2.js b/tests/baselines/reference/textChanges/deleteNode2.js index 828a9b5b8fa..654c4929f15 100644 --- a/tests/baselines/reference/textChanges/deleteNode2.js +++ b/tests/baselines/reference/textChanges/deleteNode2.js @@ -9,4 +9,8 @@ var z = 3; // comment 4 ===MODIFIED=== -var x = 1;var z = 3; // comment 4 +var x = 1; // some comment - 1 +/** + * comment 2 + */ +var z = 3; // comment 4 diff --git a/tests/baselines/reference/textChanges/deleteNode4.js b/tests/baselines/reference/textChanges/deleteNode4.js index b6edb25bc5c..d6c35e5d2e1 100644 --- a/tests/baselines/reference/textChanges/deleteNode4.js +++ b/tests/baselines/reference/textChanges/deleteNode4.js @@ -9,5 +9,9 @@ var z = 3; // comment 4 ===MODIFIED=== -var x = 1; // comment 3 +var x = 1; // some comment - 1 +/** + * comment 2 + */ + // comment 3 var z = 3; // comment 4 diff --git a/tests/baselines/reference/textChanges/deleteNodeRange2.js b/tests/baselines/reference/textChanges/deleteNodeRange2.js index aacea6ff5ee..08274885af4 100644 --- a/tests/baselines/reference/textChanges/deleteNodeRange2.js +++ b/tests/baselines/reference/textChanges/deleteNodeRange2.js @@ -11,5 +11,7 @@ var a = 4; // comment 7 ===MODIFIED=== // comment 1 -var x = 1;// comment 6 +var x = 1; // comment 2 +// comment 3 +// comment 6 var a = 4; // comment 7 diff --git a/tests/baselines/reference/textChanges/deleteNodeRange4.js b/tests/baselines/reference/textChanges/deleteNodeRange4.js index 3e9ad960b13..5314c59c9e4 100644 --- a/tests/baselines/reference/textChanges/deleteNodeRange4.js +++ b/tests/baselines/reference/textChanges/deleteNodeRange4.js @@ -11,6 +11,8 @@ var a = 4; // comment 7 ===MODIFIED=== // comment 1 -var x = 1; // comment 5 +var x = 1; // comment 2 +// comment 3 + // comment 5 // comment 6 var a = 4; // comment 7 diff --git a/tests/baselines/reference/textChanges/replaceNode2.js b/tests/baselines/reference/textChanges/replaceNode2.js index 66a17f7c910..f474aaa327b 100644 --- a/tests/baselines/reference/textChanges/replaceNode2.js +++ b/tests/baselines/reference/textChanges/replaceNode2.js @@ -10,7 +10,9 @@ var a = 4; // comment 7 ===MODIFIED=== // comment 1 -var x = 1; +var x = 1; // comment 2 +// comment 3 + public class class1 implements interface1 { property1: boolean; diff --git a/tests/baselines/reference/textChanges/replaceNode4.js b/tests/baselines/reference/textChanges/replaceNode4.js index e5bbf0e306d..b5a998a88cd 100644 --- a/tests/baselines/reference/textChanges/replaceNode4.js +++ b/tests/baselines/reference/textChanges/replaceNode4.js @@ -10,7 +10,9 @@ var a = 4; // comment 7 ===MODIFIED=== // comment 1 -var x = 1;public class class1 implements interface1 +var x = 1; // comment 2 +// comment 3 +public class class1 implements interface1 { property1: boolean; } // comment 4 diff --git a/tests/baselines/reference/textChanges/replaceNode5.js b/tests/baselines/reference/textChanges/replaceNode5.js index ad3ec0ab0ea..9fc6d7777c9 100644 --- a/tests/baselines/reference/textChanges/replaceNode5.js +++ b/tests/baselines/reference/textChanges/replaceNode5.js @@ -8,6 +8,8 @@ var z = 3; // comment 5 // comment 6 var a = 4; // comment 7 ===MODIFIED=== + +// comment 1 public class class1 implements interface1 { property1: boolean; diff --git a/tests/baselines/reference/textChanges/replaceNodeRange2.js b/tests/baselines/reference/textChanges/replaceNodeRange2.js index e8f9506d608..ebd26644740 100644 --- a/tests/baselines/reference/textChanges/replaceNodeRange2.js +++ b/tests/baselines/reference/textChanges/replaceNodeRange2.js @@ -10,7 +10,9 @@ var a = 4; // comment 7 ===MODIFIED=== // comment 1 -var x = 1; +var x = 1; // comment 2 +// comment 3 + public class class1 implements interface1 { property1: boolean; diff --git a/tests/baselines/reference/textChanges/replaceNodeRange4.js b/tests/baselines/reference/textChanges/replaceNodeRange4.js index ad50a1f01fc..b21468dd06d 100644 --- a/tests/baselines/reference/textChanges/replaceNodeRange4.js +++ b/tests/baselines/reference/textChanges/replaceNodeRange4.js @@ -10,7 +10,9 @@ var a = 4; // comment 7 ===MODIFIED=== // comment 1 -var x = 1;public class class1 implements interface1 +var x = 1; // comment 2 +// comment 3 +public class class1 implements interface1 { property1: boolean; } // comment 5 From 80b2c58c5198e70a24bc7c8fbe46f79498e2221b Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 8 Feb 2018 13:39:03 -0800 Subject: [PATCH 088/298] Eliminate replaceWithSingle in favor of replaceRange --- src/services/textChanges.ts | 39 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index fc61ae36195..f2109b34751 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -288,26 +288,15 @@ namespace ts.textChanges { } public replaceNode(sourceFile: SourceFile, oldNode: Node, newNode: Node, options: ChangeNodeOptions = {}) { - const startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - const endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + const pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + const end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRange(sourceFile, { pos, end }, newNode, options); } public replaceNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, newNode: Node, options: ChangeNodeOptions = {}) { - const startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - const endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); - } - - private replaceWithSingle(sourceFile: SourceFile, startPosition: number, endPosition: number, newNode: Node, options: ChangeNodeOptions): this { - this.changes.push({ - kind: ChangeKind.ReplaceWithSingleNode, - sourceFile, - options, - node: newNode, - range: { pos: startPosition, end: endPosition } - }); - return this; + const pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + const end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRange(sourceFile, { pos, end }, newNode, options); } private replaceWithMultiple(sourceFile: SourceFile, startPosition: number, endPosition: number, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions): this { @@ -343,18 +332,18 @@ namespace ts.textChanges { } public insertNodeBefore(sourceFile: SourceFile, before: Node, newNode: Node, blankLineBetween = false) { - const startPosition = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); - return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); + const pos = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); + return this.replaceRange(sourceFile, { pos, end: pos }, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); } public insertModifierBefore(sourceFile: SourceFile, modifier: SyntaxKind, before: Node): void { const pos = before.getStart(sourceFile); - this.replaceWithSingle(sourceFile, pos, pos, createToken(modifier), { suffix: " " }); + this.replaceRange(sourceFile, { pos, end: pos }, createToken(modifier), { suffix: " " }); } public changeIdentifierToPropertyAccess(sourceFile: SourceFile, prefix: string, node: Identifier): void { - const startPosition = getAdjustedStartPosition(sourceFile, node, {}, Position.Start); - this.replaceWithSingle(sourceFile, startPosition, startPosition, createPropertyAccess(createIdentifier(prefix), ""), {}); + const pos = getAdjustedStartPosition(sourceFile, node, {}, Position.Start); + this.replaceRange(sourceFile, { pos, end: pos }, createPropertyAccess(createIdentifier(prefix), ""), {}); } private getOptionsForInsertNodeBefore(before: Node, doubleNewlines: boolean): ChangeNodeOptions { @@ -392,8 +381,8 @@ namespace ts.textChanges { } public insertNodeAtEndOfScope(sourceFile: SourceFile, scope: Node, newNode: Node): void { - const startPosition = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); - this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, { + const pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); + this.replaceRange(sourceFile, { pos, end: pos }, newNode, { prefix: isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, suffix: this.newLineCharacter }); @@ -435,7 +424,7 @@ namespace ts.textChanges { } } const endPosition = getAdjustedEndPosition(sourceFile, after, {}); - return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, this.getInsertNodeAfterOptions(after)); + return this.replaceRange(sourceFile, { pos: endPosition, end: endPosition }, newNode, this.getInsertNodeAfterOptions(after)); } private getInsertNodeAfterOptions(node: Node): InsertNodeOptions { From f77cefee88be6fe0ddd8cc9b2aff089736949c91 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 8 Feb 2018 15:05:36 -0800 Subject: [PATCH 089/298] Introduce *WithNodes paralleling textChanges.Replace* 1) Take options 2) Return `this` 3) Use adjusted positions --- src/services/refactors/extractSymbol.ts | 2 +- src/services/textChanges.ts | 32 +++++++++++++++---------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 74a944077ec..20895d7992a 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -968,7 +968,7 @@ namespace ts.refactor.extractSymbol { } if (isReadonlyArray(range.range)) { - changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes); + changeTracker.replaceNodeRangeWithNodes(context.file, first(range.range), last(range.range), newNodes); } else { changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index f2109b34751..98e37f7656d 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -282,7 +282,7 @@ namespace ts.textChanges { return this; } - public replaceRange(sourceFile: SourceFile, range: TextRange, newNode: Node, options: InsertNodeOptions = {}) { + public replaceRange(sourceFile: SourceFile, range: TextRange, newNode: Node, options: ChangeNodeOptions = {}) { this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range, options, node: newNode }); return this; } @@ -299,23 +299,29 @@ namespace ts.textChanges { return this.replaceRange(sourceFile, { pos, end }, newNode, options); } - private replaceWithMultiple(sourceFile: SourceFile, startPosition: number, endPosition: number, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions): this { - this.changes.push({ - kind: ChangeKind.ReplaceWithMultipleNodes, - sourceFile, - options, - nodes: newNodes, - range: { pos: startPosition, end: endPosition } - }); + private getDefaultChangeMultipleNodesOptions(): ChangeMultipleNodesOptions { + return { + nodeSeparator: this.newLineCharacter, + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; + } + + public replaceRangeWithNodes(sourceFile: SourceFile, range: TextRange, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions = this.getDefaultChangeMultipleNodesOptions()) { + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile, range, options, nodes: newNodes }); return this; } - public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray): void { - this.replaceWithMultiple(sourceFile, oldNode.getStart(sourceFile), oldNode.getEnd(), newNodes, { nodeSeparator: this.newLineCharacter }); + public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions = this.getDefaultChangeMultipleNodesOptions()) { + const pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + const end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos, end }, newNodes, options); } - public replaceNodesWithNodes(sourceFile: SourceFile, oldNodes: ReadonlyArray, newNodes: ReadonlyArray): void { - this.replaceWithMultiple(sourceFile, first(oldNodes).getStart(sourceFile), last(oldNodes).getEnd(), newNodes, { nodeSeparator: this.newLineCharacter }); + public replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions = this.getDefaultChangeMultipleNodesOptions()) { + const pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + const end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos, end }, newNodes, options); } private insertNodeAt(sourceFile: SourceFile, pos: number, newNode: Node, options: InsertNodeOptions = {}) { From a9251723c7b8491407f48977245211478a67b726 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 8 Feb 2018 17:10:25 -0800 Subject: [PATCH 090/298] Properly detect identical conditional types in caching logic --- src/compiler/checker.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6211c9153bf..2341b983ceb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8219,16 +8219,17 @@ namespace ts { const erasedCheckType = getActualTypeParameter(checkType); const trueType = instantiateType(baseTrueType, mapper); const falseType = instantiateType(baseFalseType, mapper); - const id = target && (target.id + "," + erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id); - const cached = id && conditionalTypes.get(id); + // We compute the cache key from the ids of the four constituent types, plus an indicator of whether the + // type is distributive (i.e. whether the original declaration has a type parameter as the check type). + const isDistributive = (target ? target.checkType : erasedCheckType).flags & TypeFlags.TypeParameter ? 1 : 0; + const id = erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id + "," + isDistributive; + const cached = conditionalTypes.get(id); if (cached) { return cached; } const result = createConditionalType(erasedCheckType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, instantiateTypes(baseAliasTypeArguments, mapper)); - if (id) { - conditionalTypes.set(id, result); - } + conditionalTypes.set(id, result); return result; } From e54606b7bf6a8617d4c7d9cb4f1ef48945357d4a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 8 Feb 2018 17:14:52 -0800 Subject: [PATCH 091/298] Add tests --- .../types/conditional/conditionalTypes1.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes1.ts b/tests/cases/conformance/types/conditional/conditionalTypes1.ts index 7ac6255b7d5..93069138b36 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes1.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes1.ts @@ -226,3 +226,33 @@ type T80 = Eq2; // true type T81 = Eq2; // false type T82 = Eq2; // false type T83 = Eq2; // true + +// Repro from #21756 + +type Foo = T extends string ? boolean : number; +type Bar = T extends string ? boolean : number; +const convert = (value: Foo): Bar => value; + +type Baz = Foo; +const convert2 = (value: Foo): Baz => value; + +function f31() { + type T1 = T extends string ? boolean : number; + type T2 = T extends string ? boolean : number; + var x: T1; + var x: T2; +} + +function f32() { + type T1 = T & U extends string ? boolean : number; + type T2 = Foo; + var z: T1; + var z: T2; // Error, T2 is distributive, T1 isn't +} + +function f33() { + type T1 = Foo; + type T2 = Bar; + var z: T1; + var z: T2; +} From 6dfcbffdc15015dc23a15a9d227c544a3b750cd5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 8 Feb 2018 17:15:00 -0800 Subject: [PATCH 092/298] Accept new baselines --- .../reference/conditionalTypes1.errors.txt | 35 +++++- .../baselines/reference/conditionalTypes1.js | 52 ++++++++ .../reference/conditionalTypes1.symbols | 110 +++++++++++++++++ .../reference/conditionalTypes1.types | 112 ++++++++++++++++++ 4 files changed, 308 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 4f515876b1e..8b42f006cd4 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -58,9 +58,10 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(156,5): error TS2 tests/cases/conformance/types/conditional/conditionalTypes1.ts(157,5): error TS2322: Type 'T' is not assignable to type 'ZeroOf'. Type 'string | number' is not assignable to type 'ZeroOf'. Type 'string' is not assignable to type 'ZeroOf'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo'. -==== tests/cases/conformance/types/conditional/conditionalTypes1.ts (18 errors) ==== +==== tests/cases/conformance/types/conditional/conditionalTypes1.ts (19 errors) ==== type Diff = T extends U ? never : T; type Filter = T extends U ? T : never; type NonNullable = Diff; @@ -364,4 +365,36 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(157,5): error TS2 type T81 = Eq2; // false type T82 = Eq2; // false type T83 = Eq2; // true + + // Repro from #21756 + + type Foo = T extends string ? boolean : number; + type Bar = T extends string ? boolean : number; + const convert = (value: Foo): Bar => value; + + type Baz = Foo; + const convert2 = (value: Foo): Baz => value; + + function f31() { + type T1 = T extends string ? boolean : number; + type T2 = T extends string ? boolean : number; + var x: T1; + var x: T2; + } + + function f32() { + type T1 = T & U extends string ? boolean : number; + type T2 = Foo; + var z: T1; + var z: T2; // Error, T2 is distributive, T1 isn't + ~ +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo'. + } + + function f33() { + type T1 = Foo; + type T2 = Bar; + var z: T1; + var z: T2; + } \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypes1.js b/tests/baselines/reference/conditionalTypes1.js index 3ca5966ce8e..403259b049f 100644 --- a/tests/baselines/reference/conditionalTypes1.js +++ b/tests/baselines/reference/conditionalTypes1.js @@ -224,6 +224,36 @@ type T80 = Eq2; // true type T81 = Eq2; // false type T82 = Eq2; // false type T83 = Eq2; // true + +// Repro from #21756 + +type Foo = T extends string ? boolean : number; +type Bar = T extends string ? boolean : number; +const convert = (value: Foo): Bar => value; + +type Baz = Foo; +const convert2 = (value: Foo): Baz => value; + +function f31() { + type T1 = T extends string ? boolean : number; + type T2 = T extends string ? boolean : number; + var x: T1; + var x: T2; +} + +function f32() { + type T1 = T & U extends string ? boolean : number; + type T2 = Foo; + var z: T1; + var z: T2; // Error, T2 is distributive, T1 isn't +} + +function f33() { + type T1 = Foo; + type T2 = Bar; + var z: T1; + var z: T2; +} //// [conditionalTypes1.js] @@ -285,6 +315,20 @@ function f21(x, y) { x = y; // Error y = x; // Error } +var convert = function (value) { return value; }; +var convert2 = function (value) { return value; }; +function f31() { + var x; + var x; +} +function f32() { + var z; + var z; // Error, T2 is distributive, T1 isn't +} +function f33() { + var z; + var z; +} //// [conditionalTypes1.d.ts] @@ -450,3 +494,11 @@ declare type T80 = Eq2; declare type T81 = Eq2; declare type T82 = Eq2; declare type T83 = Eq2; +declare type Foo = T extends string ? boolean : number; +declare type Bar = T extends string ? boolean : number; +declare const convert: (value: Foo) => Foo; +declare type Baz = Foo; +declare const convert2: (value: Foo) => Foo; +declare function f31(): void; +declare function f32(): void; +declare function f33(): void; diff --git a/tests/baselines/reference/conditionalTypes1.symbols b/tests/baselines/reference/conditionalTypes1.symbols index 276c1af740a..883a2d9bda1 100644 --- a/tests/baselines/reference/conditionalTypes1.symbols +++ b/tests/baselines/reference/conditionalTypes1.symbols @@ -852,3 +852,113 @@ type T83 = Eq2; // true >T83 : Symbol(T83, Decl(conditionalTypes1.ts, 223, 28)) >Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +// Repro from #21756 + +type Foo = T extends string ? boolean : number; +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) + +type Bar = T extends string ? boolean : number; +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 229, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 229, 9)) + +const convert = (value: Foo): Bar => value; +>convert : Symbol(convert, Decl(conditionalTypes1.ts, 230, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 230, 20)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 230, 20)) + +type Baz = Foo; +>Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 230, 52)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 232, 9)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 232, 9)) + +const convert2 = (value: Foo): Baz => value; +>convert2 : Symbol(convert2, Decl(conditionalTypes1.ts, 233, 5)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 233, 21)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) +>Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 230, 52)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 233, 21)) + +function f31() { +>f31 : Symbol(f31, Decl(conditionalTypes1.ts, 233, 53)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) + + type T1 = T extends string ? boolean : number; +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 235, 19)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) + + type T2 = T extends string ? boolean : number; +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 236, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) + + var x: T1; +>x : Symbol(x, Decl(conditionalTypes1.ts, 238, 7), Decl(conditionalTypes1.ts, 239, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 235, 19)) + + var x: T2; +>x : Symbol(x, Decl(conditionalTypes1.ts, 238, 7), Decl(conditionalTypes1.ts, 239, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 236, 50)) +} + +function f32() { +>f32 : Symbol(f32, Decl(conditionalTypes1.ts, 240, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) + + type T1 = T & U extends string ? boolean : number; +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 22)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) + + type T2 = Foo; +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 54)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) + + var z: T1; +>z : Symbol(z, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 22)) + + var z: T2; // Error, T2 is distributive, T1 isn't +>z : Symbol(z, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 54)) +} + +function f33() { +>f33 : Symbol(f33, Decl(conditionalTypes1.ts, 247, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) + + type T1 = Foo; +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) + + type T2 = Bar; +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 25)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) + + var z: T1; +>z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) + + var z: T2; +>z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 25)) +} + diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index e8a50e60fcc..9c68f394094 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -991,3 +991,115 @@ type T83 = Eq2; // true >false : false >false : false +// Repro from #21756 + +type Foo = T extends string ? boolean : number; +>Foo : Foo +>T : T +>T : T + +type Bar = T extends string ? boolean : number; +>Bar : Bar +>T : T +>T : T + +const convert = (value: Foo): Bar => value; +>convert : (value: Foo) => Foo +>(value: Foo): Bar => value : (value: Foo) => Foo +>U : U +>value : Foo +>Foo : Foo +>U : U +>Bar : Bar +>U : U +>value : Foo + +type Baz = Foo; +>Baz : Foo +>T : T +>Foo : Foo +>T : T + +const convert2 = (value: Foo): Baz => value; +>convert2 : (value: Foo) => Foo +>(value: Foo): Baz => value : (value: Foo) => Foo +>T : T +>value : Foo +>Foo : Foo +>T : T +>Baz : Foo +>T : T +>value : Foo + +function f31() { +>f31 : () => void +>T : T + + type T1 = T extends string ? boolean : number; +>T1 : T extends string ? boolean : number +>T : T + + type T2 = T extends string ? boolean : number; +>T2 : T extends string ? boolean : number +>T : T + + var x: T1; +>x : T extends string ? boolean : number +>T1 : T extends string ? boolean : number + + var x: T2; +>x : T extends string ? boolean : number +>T2 : T extends string ? boolean : number +} + +function f32() { +>f32 : () => void +>T : T +>U : U + + type T1 = T & U extends string ? boolean : number; +>T1 : T & U extends string ? boolean : number +>T : T +>U : U + + type T2 = Foo; +>T2 : Foo +>Foo : Foo +>T : T +>U : U + + var z: T1; +>z : T & U extends string ? boolean : number +>T1 : T & U extends string ? boolean : number + + var z: T2; // Error, T2 is distributive, T1 isn't +>z : T & U extends string ? boolean : number +>T2 : Foo +} + +function f33() { +>f33 : () => void +>T : T +>U : U + + type T1 = Foo; +>T1 : Foo +>Foo : Foo +>T : T +>U : U + + type T2 = Bar; +>T2 : Foo +>Bar : Bar +>T : T +>U : U + + var z: T1; +>z : Foo +>T1 : Foo + + var z: T2; +>z : Foo +>T2 : Foo +} + From 1b620886a9107772c58a1faece22d589460feb8b Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 9 Feb 2018 10:28:31 -0800 Subject: [PATCH 093/298] Assert getExportEqualsLocalSymbol returns a defined result (#21831) --- src/services/importTracker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index 91544e209cb..02d0979ca1e 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -577,17 +577,17 @@ namespace ts.FindAllReferences { function getExportEqualsLocalSymbol(importedSymbol: Symbol, checker: TypeChecker): Symbol { if (importedSymbol.flags & SymbolFlags.Alias) { - return checker.getImmediateAliasedSymbol(importedSymbol); + return Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol)); } const decl = importedSymbol.valueDeclaration; if (isExportAssignment(decl)) { // `export = class {}` - return decl.expression.symbol; + return Debug.assertDefined(decl.expression.symbol); } else if (isBinaryExpression(decl)) { // `module.exports = class {}` - return decl.right.symbol; + return Debug.assertDefined(decl.right.symbol); } - Debug.fail(); + return Debug.fail(); } // If a reference is a class expression, the exported node would be its parent. From 4c89a813bf7eb26f3cc259ef28067e19b184e3b1 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Fri, 9 Feb 2018 10:36:49 -0800 Subject: [PATCH 094/298] Handle case where package.json and package-lock.json don't agree --- src/server/typingsInstaller/typingsInstaller.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 09c0e76e8d0..465f281006e 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -182,6 +182,10 @@ namespace ts.server.typingsInstaller { } if (npmConfig.devDependencies && npmLock.dependencies) { for (const key in npmConfig.devDependencies) { + if (!hasProperty(npmLock.dependencies, key)) { + // if package in package.json but not package-lock.json, skip adding to cache so it is reinstalled on next use + continue; + } // key is @types/ const packageName = getBaseFileName(key); if (!packageName) { From 57351e898e69e18b4299022943488ca4753ba78f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Feb 2018 13:02:07 -0800 Subject: [PATCH 095/298] Add higher order structural identity relations --- src/compiler/checker.ts | 66 ++++++++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0612c4d4307..8a7853dfaa5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6096,11 +6096,13 @@ namespace ts { // with its constraint. We do this because if the constraint is a union type it will be distributed // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' // removes 'undefined' from T. - const checkType = type.checkType; - if (checkType.flags & TypeFlags.TypeParameter) { - const constraint = getConstraintOfTypeParameter(checkType); + if (isDistributiveConditionalType(type)) { + const constraint = getConstraintOfType(type.checkType); if (constraint) { - return instantiateType(type, createTypeMapper([checkType], [constraint])); + const target = type.target || type; + const mapper = createTypeMapper([target.checkType], [constraint]); + const combinedMapper = type.mapper ? combineTypeMappers(mapper, type.mapper) : mapper; + return instantiateType(target, combinedMapper); } } return undefined; @@ -8237,6 +8239,10 @@ namespace ts { return result; } + function isDistributiveConditionalType(type: ConditionalType) { + return !!((type.target || type).checkType.flags & TypeFlags.TypeParameter); + } + function getInferTypeParameters(node: ConditionalTypeNode): TypeParameter[] { let result: TypeParameter[]; if (node.locals) { @@ -8849,9 +8855,9 @@ namespace ts { // Check if we have a conditional type where the check type is a naked type parameter. If so, // the conditional type is distributive over union types and when T is instantiated to a union // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). - const checkType = target.checkType; - if (checkType.flags & TypeFlags.TypeParameter) { - const instantiatedType = combinedMapper(checkType); + if (isDistributiveConditionalType(target)) { + const checkType = target.checkType; + const instantiatedType = combinedMapper(checkType); if (checkType !== instantiatedType && instantiatedType.flags & TypeFlags.Union) { return mapType(instantiatedType, t => instantiateConditionalType(target, createReplacementMapper(checkType, t, combinedMapper))); } @@ -9628,17 +9634,43 @@ namespace ts { function isIdenticalTo(source: Type, target: Type): Ternary { let result: Ternary; - if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Object) { + const flags = source.flags & target.flags; + if (flags & TypeFlags.Object) { return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } - if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union || - source.flags & TypeFlags.Intersection && target.flags & TypeFlags.Intersection) { + if (flags & (TypeFlags.Union | TypeFlags.Intersection)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & TypeFlags.Index) { + return isRelatedTo((source).type, (target).type, /*reportErrors*/ false); + } + if (flags & TypeFlags.IndexedAccess) { + if (result = isRelatedTo((source).objectType, (target).objectType, /*reportErrors*/ false)) { + if (result &= isRelatedTo((source).indexType, (target).indexType, /*reportErrors*/ false)) { + return result; + } + } + } + if (flags & TypeFlags.Conditional) { + if (result = isRelatedTo((source).checkType, (target).checkType, /*reportErrors*/ false)) { + if (result &= isRelatedTo((source).extendsType, (target).extendsType, /*reportErrors*/ false)) { + if (result &= isRelatedTo((source).trueType, (target).trueType, /*reportErrors*/ false)) { + if (result &= isRelatedTo((source).falseType, (target).falseType, /*reportErrors*/ false)) { + if (isDistributiveConditionalType(source) === isDistributiveConditionalType(target)) { + return result; + } + } + } + } + } + } + if (flags & TypeFlags.Substitution) { + return isRelatedTo((source).substitute, (target).substitute, /*reportErrors*/ false); + } return Ternary.False; } @@ -10024,7 +10056,19 @@ namespace ts { } } } - if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { + if (target.flags & TypeFlags.Conditional) { + if (isTypeIdenticalTo((source).checkType, (target).checkType) && + isTypeIdenticalTo((source).extendsType, (target).extendsType)) { + if (result = isRelatedTo((source).trueType, (target).trueType, reportErrors)) { + result &= isRelatedTo((source).falseType, (target).falseType, reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { errorInfo = saveErrorInfo; return result; } From 35f1fcbe85f2ff2fd5aa164ffd892ccd88689d64 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Feb 2018 13:02:21 -0800 Subject: [PATCH 096/298] Add tests --- .../types/conditional/conditionalTypes1.ts | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes1.ts b/tests/cases/conformance/types/conditional/conditionalTypes1.ts index 93069138b36..8efd5f3d3c1 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes1.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes1.ts @@ -31,6 +31,13 @@ function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { y = x; // Error } +function f4(x: T["x"], y: NonNullable) { + x = y; + y = x; // Error + let s1: string = x; // Error + let s2: string = y; +} + type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; type T10 = Diff; // { k: "c", c: boolean } @@ -42,8 +49,8 @@ type T13 = Filter; // { k: "a", a: number } | type T14 = Diff; // Options type T15 = Filter; // never -declare function f4(p: K): Filter; -let x0 = f4("a"); // { k: "a", a: number } +declare function f5(p: K): Filter; +let x0 = f5("a"); // { k: "a", a: number } type OptionsOfKind = Filter; @@ -256,3 +263,20 @@ function f33() { var z: T1; var z: T2; } + +// Repro from #21823 + +type T90 = T extends 0 ? 0 : () => 0; +type T91 = T extends 0 ? 0 : () => 0; +const f40 = (a: T90): T91 => a; +const f41 = (a: T91): T90 => a; + +type T92 = T extends () => 0 ? () => 1 : () => 2; +type T93 = T extends () => 0 ? () => 1 : () => 2; +const f42 = (a: T92): T93 => a; +const f43 = (a: T93): T92 => a; + +type T94 = T extends string ? true : 42; +type T95 = T extends string ? boolean : number; +const f44 = (value: T94): T95 => value; +const f45 = (value: T95): T94 => value; // Error From d9a0334ec7693edb536b4b00fb123a36e9713e3f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Feb 2018 13:02:37 -0800 Subject: [PATCH 097/298] Accept new baselines --- .../reference/conditionalTypes1.errors.txt | 95 +- .../baselines/reference/conditionalTypes1.js | 59 +- .../reference/conditionalTypes1.symbols | 1063 +++++++++-------- .../reference/conditionalTypes1.types | 138 ++- 4 files changed, 848 insertions(+), 507 deletions(-) diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 8b42f006cd4..574e6c45ee2 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -8,9 +8,15 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(22,9): error TS23 tests/cases/conformance/types/conditional/conditionalTypes1.ts(28,5): error TS2322: Type 'Partial[keyof T]' is not assignable to type 'Diff[keyof T], null | undefined>'. Type 'T[keyof T] | undefined' is not assignable to type 'Diff[keyof T], null | undefined>'. Type 'undefined' is not assignable to type 'Diff[keyof T], null | undefined>'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(100,5): error TS2322: Type 'Pick' is not assignable to type 'T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(101,5): error TS2322: Type 'Pick' is not assignable to type 'T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(33,5): error TS2322: Type 'T["x"]' is not assignable to type 'Diff'. + Type 'string | undefined' is not assignable to type 'Diff'. + Type 'undefined' is not assignable to type 'Diff'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(34,9): error TS2322: Type 'T["x"]' is not assignable to type 'string'. + Type 'string | undefined' is not assignable to type 'string'. + Type 'undefined' is not assignable to type 'string'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(107,5): error TS2322: Type 'Pick' is not assignable to type 'T'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(108,5): error TS2322: Type 'Pick' is not assignable to type 'T'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(110,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. @@ -18,8 +24,8 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2 Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. - Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(105,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. + Type 'keyof T' is not assignable to type 'never'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(112,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. @@ -27,41 +33,43 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(105,5): error TS2 Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. - Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(111,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. + Type 'keyof T' is not assignable to type 'never'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(118,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(112,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(119,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. - Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(113,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. + Type 'keyof T' is not assignable to type 'never'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(120,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(114,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(121,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. - Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(131,10): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(132,5): error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(133,22): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(134,10): error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(156,5): error TS2322: Type 'ZeroOf' is not assignable to type 'T'. + Type 'keyof T' is not assignable to type 'never'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(138,10): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(139,5): error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(140,22): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(141,10): error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(163,5): error TS2322: Type 'ZeroOf' is not assignable to type 'T'. Type '0 | (T extends string ? "" : false)' is not assignable to type 'T'. Type '0' is not assignable to type 'T'. Type '"" | 0' is not assignable to type 'T'. Type '""' is not assignable to type 'T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(157,5): error TS2322: Type 'T' is not assignable to type 'ZeroOf'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(164,5): error TS2322: Type 'T' is not assignable to type 'ZeroOf'. Type 'string | number' is not assignable to type 'ZeroOf'. Type 'string' is not assignable to type 'ZeroOf'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(254,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(279,43): error TS2322: Type 'T95' is not assignable to type 'T94'. + Type 'boolean' is not assignable to type 'true'. -==== tests/cases/conformance/types/conditional/conditionalTypes1.ts (19 errors) ==== +==== tests/cases/conformance/types/conditional/conditionalTypes1.ts (22 errors) ==== type Diff = T extends U ? never : T; type Filter = T extends U ? T : never; type NonNullable = Diff; @@ -106,6 +114,21 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 !!! error TS2322: Type 'undefined' is not assignable to type 'Diff[keyof T], null | undefined>'. } + function f4(x: T["x"], y: NonNullable) { + x = y; + y = x; // Error + ~ +!!! error TS2322: Type 'T["x"]' is not assignable to type 'Diff'. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'Diff'. +!!! error TS2322: Type 'undefined' is not assignable to type 'Diff'. + let s1: string = x; // Error + ~~ +!!! error TS2322: Type 'T["x"]' is not assignable to type 'string'. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'. +!!! error TS2322: Type 'undefined' is not assignable to type 'string'. + let s2: string = y; + } + type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; type T10 = Diff; // { k: "c", c: boolean } @@ -117,8 +140,8 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 type T14 = Diff; // Options type T15 = Filter; // never - declare function f4(p: K): Filter; - let x0 = f4("a"); // { k: "a", a: number } + declare function f5(p: K): Filter; + let x0 = f5("a"); // { k: "a", a: number } type OptionsOfKind = Filter; @@ -192,7 +215,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 !!! error TS2322: Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. !!! error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. !!! error TS2322: Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. +!!! error TS2322: Type 'keyof T' is not assignable to type 'never'. z = x; z = y; // Error ~ @@ -204,7 +227,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 !!! error TS2322: Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. !!! error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. !!! error TS2322: Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. +!!! error TS2322: Type 'keyof T' is not assignable to type 'never'. } function f8(x: keyof T, y: FunctionPropertyNames, z: NonFunctionPropertyNames) { @@ -222,7 +245,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 !!! error TS2322: Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. !!! error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. !!! error TS2322: Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. +!!! error TS2322: Type 'keyof T' is not assignable to type 'never'. z = x; // Error ~ !!! error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. @@ -235,7 +258,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 !!! error TS2322: Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. !!! error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. !!! error TS2322: Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -!!! error TS2322: Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. +!!! error TS2322: Type 'keyof T' is not assignable to type 'never'. } type DeepReadonly = @@ -397,4 +420,24 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 var z: T1; var z: T2; } + + // Repro from #21823 + + type T90 = T extends 0 ? 0 : () => 0; + type T91 = T extends 0 ? 0 : () => 0; + const f40 = (a: T90): T91 => a; + const f41 = (a: T91): T90 => a; + + type T92 = T extends () => 0 ? () => 1 : () => 2; + type T93 = T extends () => 0 ? () => 1 : () => 2; + const f42 = (a: T92): T93 => a; + const f43 = (a: T93): T92 => a; + + type T94 = T extends string ? true : 42; + type T95 = T extends string ? boolean : number; + const f44 = (value: T94): T95 => value; + const f45 = (value: T95): T94 => value; // Error + ~~~~~ +!!! error TS2322: Type 'T95' is not assignable to type 'T94'. +!!! error TS2322: Type 'boolean' is not assignable to type 'true'. \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypes1.js b/tests/baselines/reference/conditionalTypes1.js index 403259b049f..6aa9065f12e 100644 --- a/tests/baselines/reference/conditionalTypes1.js +++ b/tests/baselines/reference/conditionalTypes1.js @@ -29,6 +29,13 @@ function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { y = x; // Error } +function f4(x: T["x"], y: NonNullable) { + x = y; + y = x; // Error + let s1: string = x; // Error + let s2: string = y; +} + type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; type T10 = Diff; // { k: "c", c: boolean } @@ -40,8 +47,8 @@ type T13 = Filter; // { k: "a", a: number } | type T14 = Diff; // Options type T15 = Filter; // never -declare function f4(p: K): Filter; -let x0 = f4("a"); // { k: "a", a: number } +declare function f5(p: K): Filter; +let x0 = f5("a"); // { k: "a", a: number } type OptionsOfKind = Filter; @@ -254,6 +261,23 @@ function f33() { var z: T1; var z: T2; } + +// Repro from #21823 + +type T90 = T extends 0 ? 0 : () => 0; +type T91 = T extends 0 ? 0 : () => 0; +const f40 = (a: T90): T91 => a; +const f41 = (a: T91): T90 => a; + +type T92 = T extends () => 0 ? () => 1 : () => 2; +type T93 = T extends () => 0 ? () => 1 : () => 2; +const f42 = (a: T92): T93 => a; +const f43 = (a: T93): T92 => a; + +type T94 = T extends string ? true : 42; +type T95 = T extends string ? boolean : number; +const f44 = (value: T94): T95 => value; +const f45 = (value: T95): T94 => value; // Error //// [conditionalTypes1.js] @@ -272,7 +296,13 @@ function f3(x, y) { x = y; y = x; // Error } -var x0 = f4("a"); // { k: "a", a: number } +function f4(x, y) { + x = y; + y = x; // Error + var s1 = x; // Error + var s2 = y; +} +var x0 = f5("a"); // { k: "a", a: number } function f7(x, y, z) { x = y; // Error x = z; // Error @@ -329,6 +359,12 @@ function f33() { var z; var z; } +var f40 = function (a) { return a; }; +var f41 = function (a) { return a; }; +var f42 = function (a) { return a; }; +var f43 = function (a) { return a; }; +var f44 = function (value) { return value; }; +var f45 = function (value) { return value; }; // Error //// [conditionalTypes1.d.ts] @@ -344,6 +380,9 @@ declare type T05 = NonNullable<(() => string) | string[] | null | undefined>; declare function f1(x: T, y: NonNullable): void; declare function f2(x: T, y: NonNullable): void; declare function f3(x: Partial[keyof T], y: NonNullable[keyof T]>): void; +declare function f4(x: T["x"], y: NonNullable): void; declare type Options = { k: "a"; a: number; @@ -376,7 +415,7 @@ declare type T14 = Diff; -declare function f4(p: K): Filter(p: K): Filter; declare let x0: { @@ -502,3 +541,15 @@ declare const convert2: (value: Foo) => Foo; declare function f31(): void; declare function f32(): void; declare function f33(): void; +declare type T90 = T extends 0 ? 0 : () => 0; +declare type T91 = T extends 0 ? 0 : () => 0; +declare const f40: (a: T90) => T91; +declare const f41: (a: T91) => T90; +declare type T92 = T extends () => 0 ? () => 1 : () => 2; +declare type T93 = T extends () => 0 ? () => 1 : () => 2; +declare const f42: (a: T92) => T93; +declare const f43: (a: T93) => T92; +declare type T94 = T extends string ? true : 42; +declare type T95 = T extends string ? boolean : number; +declare const f44: (value: T94) => T95; +declare const f45: (value: T95) => T94; diff --git a/tests/baselines/reference/conditionalTypes1.symbols b/tests/baselines/reference/conditionalTypes1.symbols index 883a2d9bda1..ebcddec7f69 100644 --- a/tests/baselines/reference/conditionalTypes1.symbols +++ b/tests/baselines/reference/conditionalTypes1.symbols @@ -113,852 +113,971 @@ function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { >x : Symbol(x, Decl(conditionalTypes1.ts, 25, 15)) } +function f4(x: T["x"], y: NonNullable) { +>f4 : Symbol(f4, Decl(conditionalTypes1.ts, 28, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 30, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 30, 23)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 30, 49)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 30, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 30, 59)) +>NonNullable : Symbol(NonNullable, Decl(conditionalTypes1.ts, 1, 44)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 30, 12)) + + x = y; +>x : Symbol(x, Decl(conditionalTypes1.ts, 30, 49)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 30, 59)) + + y = x; // Error +>y : Symbol(y, Decl(conditionalTypes1.ts, 30, 59)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 30, 49)) + + let s1: string = x; // Error +>s1 : Symbol(s1, Decl(conditionalTypes1.ts, 33, 7)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 30, 49)) + + let s2: string = y; +>s2 : Symbol(s2, Decl(conditionalTypes1.ts, 34, 7)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 30, 59)) +} + type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 30, 16)) ->a : Symbol(a, Decl(conditionalTypes1.ts, 30, 24)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 30, 40)) ->b : Symbol(b, Decl(conditionalTypes1.ts, 30, 48)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 30, 64)) ->c : Symbol(c, Decl(conditionalTypes1.ts, 30, 72)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 37, 16)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 37, 24)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 37, 40)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 37, 48)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 37, 64)) +>c : Symbol(c, Decl(conditionalTypes1.ts, 37, 72)) type T10 = Diff; // { k: "c", c: boolean } ->T10 : Symbol(T10, Decl(conditionalTypes1.ts, 30, 86)) +>T10 : Symbol(T10, Decl(conditionalTypes1.ts, 37, 86)) >Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 32, 26)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 39, 26)) type T11 = Filter; // { k: "a", a: number } | { k: "b", b: string } ->T11 : Symbol(T11, Decl(conditionalTypes1.ts, 32, 43)) +>T11 : Symbol(T11, Decl(conditionalTypes1.ts, 39, 43)) >Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 33, 28)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 40, 28)) type T12 = Diff; // { k: "c", c: boolean } ->T12 : Symbol(T12, Decl(conditionalTypes1.ts, 33, 45)) +>T12 : Symbol(T12, Decl(conditionalTypes1.ts, 40, 45)) >Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 35, 26)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 35, 39)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 42, 26)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 42, 39)) type T13 = Filter; // { k: "a", a: number } | { k: "b", b: string } ->T13 : Symbol(T13, Decl(conditionalTypes1.ts, 35, 50)) +>T13 : Symbol(T13, Decl(conditionalTypes1.ts, 42, 50)) >Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 36, 28)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 36, 41)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 43, 28)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 43, 41)) type T14 = Diff; // Options ->T14 : Symbol(T14, Decl(conditionalTypes1.ts, 36, 52)) +>T14 : Symbol(T14, Decl(conditionalTypes1.ts, 43, 52)) >Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->q : Symbol(q, Decl(conditionalTypes1.ts, 38, 26)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>q : Symbol(q, Decl(conditionalTypes1.ts, 45, 26)) type T15 = Filter; // never ->T15 : Symbol(T15, Decl(conditionalTypes1.ts, 38, 37)) +>T15 : Symbol(T15, Decl(conditionalTypes1.ts, 45, 37)) >Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->q : Symbol(q, Decl(conditionalTypes1.ts, 39, 28)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>q : Symbol(q, Decl(conditionalTypes1.ts, 46, 28)) -declare function f4(p: K): Filter; ->f4 : Symbol(f4, Decl(conditionalTypes1.ts, 39, 39)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 41, 20)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 41, 38)) ->p : Symbol(p, Decl(conditionalTypes1.ts, 41, 57)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 41, 38)) +declare function f5(p: K): Filter; +>f5 : Symbol(f5, Decl(conditionalTypes1.ts, 46, 39)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 20)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 48, 38)) +>p : Symbol(p, Decl(conditionalTypes1.ts, 48, 57)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 48, 38)) >Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 41, 20)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 41, 75)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 41, 38)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 20)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 48, 75)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 48, 38)) -let x0 = f4("a"); // { k: "a", a: number } ->x0 : Symbol(x0, Decl(conditionalTypes1.ts, 42, 3)) ->f4 : Symbol(f4, Decl(conditionalTypes1.ts, 39, 39)) +let x0 = f5("a"); // { k: "a", a: number } +>x0 : Symbol(x0, Decl(conditionalTypes1.ts, 49, 3)) +>f5 : Symbol(f5, Decl(conditionalTypes1.ts, 46, 39)) type OptionsOfKind = Filter; ->OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 42, 17)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 44, 19)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) +>OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 49, 17)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 51, 19)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) >Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 44, 62)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 44, 19)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 51, 62)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 51, 19)) type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string } ->T16 : Symbol(T16, Decl(conditionalTypes1.ts, 44, 71)) ->OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 42, 17)) +>T16 : Symbol(T16, Decl(conditionalTypes1.ts, 51, 71)) +>OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 49, 17)) type Select = Filter; ->Select : Symbol(Select, Decl(conditionalTypes1.ts, 46, 36)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 48, 14)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->V : Symbol(V, Decl(conditionalTypes1.ts, 48, 33)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 48, 14)) +>Select : Symbol(Select, Decl(conditionalTypes1.ts, 53, 36)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 55, 12)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 55, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 55, 12)) +>V : Symbol(V, Decl(conditionalTypes1.ts, 55, 33)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 55, 12)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 55, 14)) >Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->P : Symbol(P, Decl(conditionalTypes1.ts, 48, 65)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 48, 14)) ->V : Symbol(V, Decl(conditionalTypes1.ts, 48, 33)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 55, 12)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 55, 65)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 55, 14)) +>V : Symbol(V, Decl(conditionalTypes1.ts, 55, 33)) type T17 = Select; // // { k: "a", a: number } | { k: "b", b: string } ->T17 : Symbol(T17, Decl(conditionalTypes1.ts, 48, 79)) ->Select : Symbol(Select, Decl(conditionalTypes1.ts, 46, 36)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) +>T17 : Symbol(T17, Decl(conditionalTypes1.ts, 55, 79)) +>Select : Symbol(Select, Decl(conditionalTypes1.ts, 53, 36)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 35, 1)) type TypeName = ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 57, 43)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 59, 14)) T extends string ? "string" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 59, 14)) T extends number ? "number" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 59, 14)) T extends boolean ? "boolean" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 59, 14)) T extends undefined ? "undefined" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 59, 14)) T extends Function ? "function" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 59, 14)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "object"; type T20 = TypeName void)>; // "string" | "function" ->T20 : Symbol(T20, Decl(conditionalTypes1.ts, 58, 13)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T20 : Symbol(T20, Decl(conditionalTypes1.ts, 65, 13)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 57, 43)) type T21 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" ->T21 : Symbol(T21, Decl(conditionalTypes1.ts, 60, 43)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T21 : Symbol(T21, Decl(conditionalTypes1.ts, 67, 43)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 57, 43)) type T22 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" ->T22 : Symbol(T22, Decl(conditionalTypes1.ts, 61, 25)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T22 : Symbol(T22, Decl(conditionalTypes1.ts, 68, 25)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 57, 43)) type T23 = TypeName<{}>; // "object" ->T23 : Symbol(T23, Decl(conditionalTypes1.ts, 62, 27)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T23 : Symbol(T23, Decl(conditionalTypes1.ts, 69, 27)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 57, 43)) type KnockoutObservable = { object: T }; ->KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 63, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 65, 24)) ->object : Symbol(object, Decl(conditionalTypes1.ts, 65, 30)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 65, 24)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 70, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 72, 24)) +>object : Symbol(object, Decl(conditionalTypes1.ts, 72, 30)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 72, 24)) type KnockoutObservableArray = { array: T }; ->KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 65, 43)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 66, 29)) ->array : Symbol(array, Decl(conditionalTypes1.ts, 66, 35)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 66, 29)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 72, 43)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 73, 29)) +>array : Symbol(array, Decl(conditionalTypes1.ts, 73, 35)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 73, 29)) type KnockedOut = T extends any[] ? KnockoutObservableArray : KnockoutObservable; ->KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 66, 47)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) ->KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 65, 43)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) ->KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 63, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) +>KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 73, 47)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 75, 16)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 75, 16)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 72, 43)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 75, 16)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 70, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 75, 16)) type KnockedOutObj = { ->KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 68, 98)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 70, 19)) +>KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 75, 98)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 77, 19)) [P in keyof T]: KnockedOut; ->P : Symbol(P, Decl(conditionalTypes1.ts, 71, 5)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 70, 19)) ->KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 66, 47)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 70, 19)) ->P : Symbol(P, Decl(conditionalTypes1.ts, 71, 5)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 78, 5)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 77, 19)) +>KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 73, 47)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 77, 19)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 78, 5)) } interface Item { ->Item : Symbol(Item, Decl(conditionalTypes1.ts, 72, 1)) +>Item : Symbol(Item, Decl(conditionalTypes1.ts, 79, 1)) id: number; ->id : Symbol(Item.id, Decl(conditionalTypes1.ts, 74, 16)) +>id : Symbol(Item.id, Decl(conditionalTypes1.ts, 81, 16)) name: string; ->name : Symbol(Item.name, Decl(conditionalTypes1.ts, 75, 15)) +>name : Symbol(Item.name, Decl(conditionalTypes1.ts, 82, 15)) subitems: string[]; ->subitems : Symbol(Item.subitems, Decl(conditionalTypes1.ts, 76, 17)) +>subitems : Symbol(Item.subitems, Decl(conditionalTypes1.ts, 83, 17)) } type KOItem = KnockedOutObj; ->KOItem : Symbol(KOItem, Decl(conditionalTypes1.ts, 78, 1)) ->KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 68, 98)) ->Item : Symbol(Item, Decl(conditionalTypes1.ts, 72, 1)) +>KOItem : Symbol(KOItem, Decl(conditionalTypes1.ts, 85, 1)) +>KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 75, 98)) +>Item : Symbol(Item, Decl(conditionalTypes1.ts, 79, 1)) interface Part { ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 87, 34)) id: number; ->id : Symbol(Part.id, Decl(conditionalTypes1.ts, 82, 16)) +>id : Symbol(Part.id, Decl(conditionalTypes1.ts, 89, 16)) name: string; ->name : Symbol(Part.name, Decl(conditionalTypes1.ts, 83, 15)) +>name : Symbol(Part.name, Decl(conditionalTypes1.ts, 90, 15)) subparts: Part[]; ->subparts : Symbol(Part.subparts, Decl(conditionalTypes1.ts, 84, 17)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>subparts : Symbol(Part.subparts, Decl(conditionalTypes1.ts, 91, 17)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 87, 34)) updatePart(newName: string): void; ->updatePart : Symbol(Part.updatePart, Decl(conditionalTypes1.ts, 85, 21)) ->newName : Symbol(newName, Decl(conditionalTypes1.ts, 86, 15)) +>updatePart : Symbol(Part.updatePart, Decl(conditionalTypes1.ts, 92, 21)) +>newName : Symbol(newName, Decl(conditionalTypes1.ts, 93, 15)) } type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T]; ->FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 87, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 89, 35)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 89, 35)) +>FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 94, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 96, 27)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 96, 35)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 96, 27)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 96, 27)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 96, 35)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 89, 35)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 96, 35)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 96, 27)) type FunctionProperties = Pick>; ->FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 89, 95)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 90, 24)) +>FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 96, 95)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 97, 24)) >Pick : Symbol(Pick, Decl(lib.d.ts, --, --)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 90, 24)) ->FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 87, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 90, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 97, 24)) +>FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 94, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 97, 24)) type NonFunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? never : K }[keyof T]; ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 92, 38)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 92, 38)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 97, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 99, 30)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 99, 38)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 99, 30)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 99, 30)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 99, 38)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 92, 38)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 99, 38)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 99, 30)) type NonFunctionProperties = Pick>; ->NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 92, 98)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 93, 27)) +>NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 99, 98)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 100, 27)) >Pick : Symbol(Pick, Decl(lib.d.ts, --, --)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 93, 27)) ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 93, 27)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 100, 27)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 97, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 100, 27)) type T30 = FunctionProperties; ->T30 : Symbol(T30, Decl(conditionalTypes1.ts, 93, 69)) ->FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 89, 95)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>T30 : Symbol(T30, Decl(conditionalTypes1.ts, 100, 69)) +>FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 96, 95)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 87, 34)) type T31 = NonFunctionProperties; ->T31 : Symbol(T31, Decl(conditionalTypes1.ts, 95, 36)) ->NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 92, 98)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>T31 : Symbol(T31, Decl(conditionalTypes1.ts, 102, 36)) +>NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 99, 98)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 87, 34)) function f7(x: T, y: FunctionProperties, z: NonFunctionProperties) { ->f7 : Symbol(f7, Decl(conditionalTypes1.ts, 96, 39)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) ->FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 89, 95)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) ->NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 92, 98)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) +>f7 : Symbol(f7, Decl(conditionalTypes1.ts, 103, 39)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 105, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 105, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 105, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 105, 20)) +>FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 96, 95)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 105, 12)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 105, 46)) +>NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 99, 98)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 105, 12)) x = y; // Error ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 105, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 105, 20)) x = z; // Error ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 105, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 105, 46)) y = x; ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 105, 20)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 105, 15)) y = z; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 105, 20)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 105, 46)) z = x; ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 105, 46)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 105, 15)) z = y; // Error ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 105, 46)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 105, 20)) } function f8(x: keyof T, y: FunctionPropertyNames, z: NonFunctionPropertyNames) { ->f8 : Symbol(f8, Decl(conditionalTypes1.ts, 105, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) ->FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 87, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) +>f8 : Symbol(f8, Decl(conditionalTypes1.ts, 112, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 114, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 114, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 114, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 114, 26)) +>FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 94, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 114, 12)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 114, 55)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 97, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 114, 12)) x = y; ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 114, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 114, 26)) x = z; ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 114, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 114, 55)) y = x; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 114, 26)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 114, 15)) y = z; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 114, 26)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 114, 55)) z = x; // Error ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 114, 55)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 114, 15)) z = y; // Error ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 114, 55)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 114, 26)) } type DeepReadonly = ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 121, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 123, 18)) T extends any[] ? DeepReadonlyArray : ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) ->DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 119, 6)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 123, 18)) +>DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 126, 6)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 123, 18)) T extends object ? DeepReadonlyObject : ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) ->DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 121, 72)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 123, 18)) +>DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 128, 72)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 123, 18)) T; ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 123, 18)) interface DeepReadonlyArray extends ReadonlyArray> {} ->DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 119, 6)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 121, 28)) +>DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 126, 6)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 128, 28)) >ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.d.ts, --, --)) ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 121, 28)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 121, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 128, 28)) type DeepReadonlyObject = { ->DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 121, 72)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 123, 24)) +>DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 128, 72)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 130, 24)) readonly [P in NonFunctionPropertyNames]: DeepReadonly; ->P : Symbol(P, Decl(conditionalTypes1.ts, 124, 14)) ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 123, 24)) ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 123, 24)) ->P : Symbol(P, Decl(conditionalTypes1.ts, 124, 14)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 131, 14)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 97, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 130, 24)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 121, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 130, 24)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 131, 14)) }; function f10(part: DeepReadonly) { ->f10 : Symbol(f10, Decl(conditionalTypes1.ts, 125, 2)) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>f10 : Symbol(f10, Decl(conditionalTypes1.ts, 132, 2)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 121, 1)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 87, 34)) let name: string = part.name; ->name : Symbol(name, Decl(conditionalTypes1.ts, 128, 7)) +>name : Symbol(name, Decl(conditionalTypes1.ts, 135, 7)) >part.name : Symbol(name) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >name : Symbol(name) let id: number = part.subparts[0].id; ->id : Symbol(id, Decl(conditionalTypes1.ts, 129, 7)) +>id : Symbol(id, Decl(conditionalTypes1.ts, 136, 7)) >part.subparts[0].id : Symbol(id) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >subparts : Symbol(subparts) >id : Symbol(id) part.id = part.id; // Error >part.id : Symbol(id) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >id : Symbol(id) >part.id : Symbol(id) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >id : Symbol(id) part.subparts[0] = part.subparts[0]; // Error >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >subparts : Symbol(subparts) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >subparts : Symbol(subparts) part.subparts[0].id = part.subparts[0].id; // Error >part.subparts[0].id : Symbol(id) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >subparts : Symbol(subparts) >id : Symbol(id) >part.subparts[0].id : Symbol(id) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) >subparts : Symbol(subparts) >id : Symbol(id) part.updatePart("hello"); // Error ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 134, 13)) } type ZeroOf = T extends number ? 0 : T extends string ? "" : false; ->ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 134, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 136, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 136, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 136, 12)) +>ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 141, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 143, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 143, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 143, 12)) function zeroOf(value: T) { ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 138, 16)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 138, 53)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 138, 16)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 145, 16)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 145, 53)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 145, 16)) return >(typeof value === "number" ? 0 : typeof value === "string" ? "" : false); ->ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 134, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 138, 16)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 138, 53)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 138, 53)) +>ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 141, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 145, 16)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 145, 53)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 145, 53)) } function f20(n: number, b: boolean, x: number | boolean, y: T) { ->f20 : Symbol(f20, Decl(conditionalTypes1.ts, 140, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 142, 13)) ->n : Symbol(n, Decl(conditionalTypes1.ts, 142, 31)) ->b : Symbol(b, Decl(conditionalTypes1.ts, 142, 41)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 142, 53)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 142, 74)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 142, 13)) +>f20 : Symbol(f20, Decl(conditionalTypes1.ts, 147, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 149, 13)) +>n : Symbol(n, Decl(conditionalTypes1.ts, 149, 31)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 149, 41)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 149, 53)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 149, 74)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 149, 13)) zeroOf(5); // 0 ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) zeroOf("hello"); // "" ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) zeroOf(true); // false ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) zeroOf(n); // 0 ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->n : Symbol(n, Decl(conditionalTypes1.ts, 142, 31)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) +>n : Symbol(n, Decl(conditionalTypes1.ts, 149, 31)) zeroOf(b); // False ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->b : Symbol(b, Decl(conditionalTypes1.ts, 142, 41)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 149, 41)) zeroOf(x); // 0 | false ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 142, 53)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 149, 53)) zeroOf(y); // ZeroOf ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 142, 74)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 143, 104)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 149, 74)) } function f21(x: T, y: ZeroOf) { ->f21 : Symbol(f21, Decl(conditionalTypes1.ts, 150, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 152, 13)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 152, 40)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 152, 13)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) ->ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 134, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 152, 13)) +>f21 : Symbol(f21, Decl(conditionalTypes1.ts, 157, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 159, 13)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 159, 40)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 159, 13)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 159, 45)) +>ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 141, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 159, 13)) let z1: number | string = y; ->z1 : Symbol(z1, Decl(conditionalTypes1.ts, 153, 7)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) +>z1 : Symbol(z1, Decl(conditionalTypes1.ts, 160, 7)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 159, 45)) let z2: 0 | "" = y; ->z2 : Symbol(z2, Decl(conditionalTypes1.ts, 154, 7)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) +>z2 : Symbol(z2, Decl(conditionalTypes1.ts, 161, 7)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 159, 45)) x = y; // Error ->x : Symbol(x, Decl(conditionalTypes1.ts, 152, 40)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 159, 40)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 159, 45)) y = x; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 152, 40)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 159, 45)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 159, 40)) } type Extends = T extends U ? true : false; ->Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 157, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 159, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 159, 15)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 159, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 159, 15)) +>Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 164, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 166, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 166, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 166, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 166, 15)) type If = C extends true ? T : F; ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 160, 8)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 160, 26)) ->F : Symbol(F, Decl(conditionalTypes1.ts, 160, 29)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 160, 8)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 160, 26)) ->F : Symbol(F, Decl(conditionalTypes1.ts, 160, 29)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 166, 48)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 167, 8)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 167, 26)) +>F : Symbol(F, Decl(conditionalTypes1.ts, 167, 29)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 167, 8)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 167, 26)) +>F : Symbol(F, Decl(conditionalTypes1.ts, 167, 29)) type Not = If; ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 161, 9)) ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 161, 9)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 167, 58)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 168, 9)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 166, 48)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 168, 9)) type And
= If; ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 162, 9)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 162, 27)) ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 162, 9)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 162, 27)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 169, 9)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 169, 27)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 166, 48)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 169, 9)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 169, 27)) type Or = If; ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 163, 8)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 163, 26)) ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 163, 8)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 163, 26)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 170, 8)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 170, 26)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 166, 48)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 170, 8)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 170, 26)) type IsString = Extends; ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 165, 14)) ->Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 157, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 165, 14)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 170, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 172, 14)) +>Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 164, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 172, 14)) type Q1 = IsString; // false ->Q1 : Symbol(Q1, Decl(conditionalTypes1.ts, 165, 38)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q1 : Symbol(Q1, Decl(conditionalTypes1.ts, 172, 38)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 170, 63)) type Q2 = IsString<"abc">; // true ->Q2 : Symbol(Q2, Decl(conditionalTypes1.ts, 167, 27)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q2 : Symbol(Q2, Decl(conditionalTypes1.ts, 174, 27)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 170, 63)) type Q3 = IsString; // boolean ->Q3 : Symbol(Q3, Decl(conditionalTypes1.ts, 168, 26)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q3 : Symbol(Q3, Decl(conditionalTypes1.ts, 175, 26)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 170, 63)) type Q4 = IsString; // boolean ->Q4 : Symbol(Q4, Decl(conditionalTypes1.ts, 169, 24)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q4 : Symbol(Q4, Decl(conditionalTypes1.ts, 176, 24)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 170, 63)) type N1 = Not; // true ->N1 : Symbol(N1, Decl(conditionalTypes1.ts, 170, 26)) ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) +>N1 : Symbol(N1, Decl(conditionalTypes1.ts, 177, 26)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 167, 58)) type N2 = Not; // false ->N2 : Symbol(N2, Decl(conditionalTypes1.ts, 172, 21)) ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) +>N2 : Symbol(N2, Decl(conditionalTypes1.ts, 179, 21)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 167, 58)) type N3 = Not; // boolean ->N3 : Symbol(N3, Decl(conditionalTypes1.ts, 173, 20)) ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) +>N3 : Symbol(N3, Decl(conditionalTypes1.ts, 180, 20)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 167, 58)) type A1 = And; // false ->A1 : Symbol(A1, Decl(conditionalTypes1.ts, 174, 23)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A1 : Symbol(A1, Decl(conditionalTypes1.ts, 181, 23)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A2 = And; // false ->A2 : Symbol(A2, Decl(conditionalTypes1.ts, 176, 28)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A2 : Symbol(A2, Decl(conditionalTypes1.ts, 183, 28)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A3 = And; // false ->A3 : Symbol(A3, Decl(conditionalTypes1.ts, 177, 27)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A3 : Symbol(A3, Decl(conditionalTypes1.ts, 184, 27)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A4 = And; // true ->A4 : Symbol(A4, Decl(conditionalTypes1.ts, 178, 27)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A4 : Symbol(A4, Decl(conditionalTypes1.ts, 185, 27)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A5 = And; // false ->A5 : Symbol(A5, Decl(conditionalTypes1.ts, 179, 26)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A5 : Symbol(A5, Decl(conditionalTypes1.ts, 186, 26)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A6 = And; // false ->A6 : Symbol(A6, Decl(conditionalTypes1.ts, 180, 30)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A6 : Symbol(A6, Decl(conditionalTypes1.ts, 187, 30)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A7 = And; // boolean ->A7 : Symbol(A7, Decl(conditionalTypes1.ts, 181, 30)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A7 : Symbol(A7, Decl(conditionalTypes1.ts, 188, 30)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A8 = And; // boolean ->A8 : Symbol(A8, Decl(conditionalTypes1.ts, 182, 29)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A8 : Symbol(A8, Decl(conditionalTypes1.ts, 189, 29)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type A9 = And; // boolean ->A9 : Symbol(A9, Decl(conditionalTypes1.ts, 183, 29)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A9 : Symbol(A9, Decl(conditionalTypes1.ts, 190, 29)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 168, 49)) type O1 = Or; // false ->O1 : Symbol(O1, Decl(conditionalTypes1.ts, 184, 32)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O1 : Symbol(O1, Decl(conditionalTypes1.ts, 191, 32)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O2 = Or; // true ->O2 : Symbol(O2, Decl(conditionalTypes1.ts, 186, 27)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O2 : Symbol(O2, Decl(conditionalTypes1.ts, 193, 27)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O3 = Or; // true ->O3 : Symbol(O3, Decl(conditionalTypes1.ts, 187, 26)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O3 : Symbol(O3, Decl(conditionalTypes1.ts, 194, 26)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O4 = Or; // true ->O4 : Symbol(O4, Decl(conditionalTypes1.ts, 188, 26)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O4 : Symbol(O4, Decl(conditionalTypes1.ts, 195, 26)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O5 = Or; // boolean ->O5 : Symbol(O5, Decl(conditionalTypes1.ts, 189, 25)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O5 : Symbol(O5, Decl(conditionalTypes1.ts, 196, 25)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O6 = Or; // boolean ->O6 : Symbol(O6, Decl(conditionalTypes1.ts, 190, 29)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O6 : Symbol(O6, Decl(conditionalTypes1.ts, 197, 29)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O7 = Or; // true ->O7 : Symbol(O7, Decl(conditionalTypes1.ts, 191, 29)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O7 : Symbol(O7, Decl(conditionalTypes1.ts, 198, 29)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O8 = Or; // true ->O8 : Symbol(O8, Decl(conditionalTypes1.ts, 192, 28)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O8 : Symbol(O8, Decl(conditionalTypes1.ts, 199, 28)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type O9 = Or; // boolean ->O9 : Symbol(O9, Decl(conditionalTypes1.ts, 193, 28)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O9 : Symbol(O9, Decl(conditionalTypes1.ts, 200, 28)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 169, 65)) type T40 = never extends never ? true : false; // true ->T40 : Symbol(T40, Decl(conditionalTypes1.ts, 194, 31)) +>T40 : Symbol(T40, Decl(conditionalTypes1.ts, 201, 31)) type T41 = number extends never ? true : false; // false ->T41 : Symbol(T41, Decl(conditionalTypes1.ts, 196, 46)) +>T41 : Symbol(T41, Decl(conditionalTypes1.ts, 203, 46)) type T42 = never extends number ? true : false; // boolean ->T42 : Symbol(T42, Decl(conditionalTypes1.ts, 197, 47)) +>T42 : Symbol(T42, Decl(conditionalTypes1.ts, 204, 47)) type IsNever = T extends never ? true : false; ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 200, 13)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 200, 13)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 205, 47)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 207, 13)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 207, 13)) type T50 = IsNever; // true ->T50 : Symbol(T50, Decl(conditionalTypes1.ts, 200, 49)) ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) +>T50 : Symbol(T50, Decl(conditionalTypes1.ts, 207, 49)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 205, 47)) type T51 = IsNever; // false ->T51 : Symbol(T51, Decl(conditionalTypes1.ts, 202, 26)) ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) +>T51 : Symbol(T51, Decl(conditionalTypes1.ts, 209, 26)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 205, 47)) type T52 = IsNever; // false ->T52 : Symbol(T52, Decl(conditionalTypes1.ts, 203, 27)) ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) +>T52 : Symbol(T52, Decl(conditionalTypes1.ts, 210, 27)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 205, 47)) // Repros from #21664 type Eq = T extends U ? U extends T ? true : false : false; ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 208, 8)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 208, 10)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 208, 8)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 208, 10)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 208, 10)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 208, 8)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 211, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 215, 8)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 215, 10)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 215, 8)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 215, 10)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 215, 10)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 215, 8)) type T60 = Eq; // true ->T60 : Symbol(T60, Decl(conditionalTypes1.ts, 208, 65)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T60 : Symbol(T60, Decl(conditionalTypes1.ts, 215, 65)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 211, 24)) type T61 = Eq; // false ->T61 : Symbol(T61, Decl(conditionalTypes1.ts, 209, 26)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T61 : Symbol(T61, Decl(conditionalTypes1.ts, 216, 26)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 211, 24)) type T62 = Eq; // false ->T62 : Symbol(T62, Decl(conditionalTypes1.ts, 210, 27)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T62 : Symbol(T62, Decl(conditionalTypes1.ts, 217, 27)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 211, 24)) type T63 = Eq; // true ->T63 : Symbol(T63, Decl(conditionalTypes1.ts, 211, 27)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T63 : Symbol(T63, Decl(conditionalTypes1.ts, 218, 27)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 211, 24)) type Eq1 = Eq extends false ? false : true; ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 214, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 214, 11)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 214, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 214, 11)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 219, 28)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 221, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 221, 11)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 211, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 221, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 221, 11)) type T70 = Eq1; // true ->T70 : Symbol(T70, Decl(conditionalTypes1.ts, 214, 55)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T70 : Symbol(T70, Decl(conditionalTypes1.ts, 221, 55)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 219, 28)) type T71 = Eq1; // false ->T71 : Symbol(T71, Decl(conditionalTypes1.ts, 215, 27)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T71 : Symbol(T71, Decl(conditionalTypes1.ts, 222, 27)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 219, 28)) type T72 = Eq1; // false ->T72 : Symbol(T72, Decl(conditionalTypes1.ts, 216, 28)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T72 : Symbol(T72, Decl(conditionalTypes1.ts, 223, 28)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 219, 28)) type T73 = Eq1; // true ->T73 : Symbol(T73, Decl(conditionalTypes1.ts, 217, 28)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T73 : Symbol(T73, Decl(conditionalTypes1.ts, 224, 28)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 219, 28)) type Eq2 = Eq extends true ? true : false; ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 220, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 220, 11)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 220, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 220, 11)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 225, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 227, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 227, 11)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 211, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 227, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 227, 11)) type T80 = Eq2; // true ->T80 : Symbol(T80, Decl(conditionalTypes1.ts, 220, 54)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T80 : Symbol(T80, Decl(conditionalTypes1.ts, 227, 54)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 225, 29)) type T81 = Eq2; // false ->T81 : Symbol(T81, Decl(conditionalTypes1.ts, 221, 27)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T81 : Symbol(T81, Decl(conditionalTypes1.ts, 228, 27)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 225, 29)) type T82 = Eq2; // false ->T82 : Symbol(T82, Decl(conditionalTypes1.ts, 222, 28)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T82 : Symbol(T82, Decl(conditionalTypes1.ts, 229, 28)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 225, 29)) type T83 = Eq2; // true ->T83 : Symbol(T83, Decl(conditionalTypes1.ts, 223, 28)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T83 : Symbol(T83, Decl(conditionalTypes1.ts, 230, 28)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 225, 29)) // Repro from #21756 type Foo = T extends string ? boolean : number; ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 231, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 235, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 235, 9)) type Bar = T extends string ? boolean : number; ->Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 229, 9)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 229, 9)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 235, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 236, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 236, 9)) const convert = (value: Foo): Bar => value; ->convert : Symbol(convert, Decl(conditionalTypes1.ts, 230, 5)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 230, 20)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) ->Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 230, 20)) +>convert : Symbol(convert, Decl(conditionalTypes1.ts, 237, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 237, 17)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 237, 20)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 231, 29)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 237, 17)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 235, 50)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 237, 17)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 237, 20)) type Baz = Foo; ->Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 230, 52)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 232, 9)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 232, 9)) +>Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 237, 52)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 239, 9)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 231, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 239, 9)) const convert2 = (value: Foo): Baz => value; ->convert2 : Symbol(convert2, Decl(conditionalTypes1.ts, 233, 5)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 233, 21)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) ->Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 230, 52)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 233, 21)) +>convert2 : Symbol(convert2, Decl(conditionalTypes1.ts, 240, 5)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 240, 18)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 240, 21)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 231, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 240, 18)) +>Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 237, 52)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 240, 18)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 240, 21)) function f31() { ->f31 : Symbol(f31, Decl(conditionalTypes1.ts, 233, 53)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) +>f31 : Symbol(f31, Decl(conditionalTypes1.ts, 240, 53)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) type T1 = T extends string ? boolean : number; ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 235, 19)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 19)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) type T2 = T extends string ? boolean : number; ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 236, 50)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) var x: T1; ->x : Symbol(x, Decl(conditionalTypes1.ts, 238, 7), Decl(conditionalTypes1.ts, 239, 7)) ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 235, 19)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 19)) var x: T2; ->x : Symbol(x, Decl(conditionalTypes1.ts, 238, 7), Decl(conditionalTypes1.ts, 239, 7)) ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 236, 50)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 50)) } function f32() { ->f32 : Symbol(f32, Decl(conditionalTypes1.ts, 240, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) +>f32 : Symbol(f32, Decl(conditionalTypes1.ts, 247, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) type T1 = T & U extends string ? boolean : number; ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 22)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) type T2 = Foo; ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 54)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 54)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 231, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) var z: T1; ->z : Symbol(z, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 22)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) var z: T2; // Error, T2 is distributive, T1 isn't ->z : Symbol(z, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 54)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 54)) } function f33() { ->f33 : Symbol(f33, Decl(conditionalTypes1.ts, 247, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) +>f33 : Symbol(f33, Decl(conditionalTypes1.ts, 254, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 256, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 256, 15)) type T1 = Foo; ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 256, 22)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 231, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 256, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 256, 15)) type T2 = Bar; ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 25)) ->Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 257, 25)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 235, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 256, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 256, 15)) var z: T1; ->z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 259, 7), Decl(conditionalTypes1.ts, 260, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 256, 22)) var z: T2; ->z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 25)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 259, 7), Decl(conditionalTypes1.ts, 260, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 257, 25)) } +// Repro from #21823 + +type T90 = T extends 0 ? 0 : () => 0; +>T90 : Symbol(T90, Decl(conditionalTypes1.ts, 261, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 265, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 265, 9)) + +type T91 = T extends 0 ? 0 : () => 0; +>T91 : Symbol(T91, Decl(conditionalTypes1.ts, 265, 40)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 266, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 266, 9)) + +const f40 = (a: T90): T91 => a; +>f40 : Symbol(f40, Decl(conditionalTypes1.ts, 267, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 267, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 267, 16)) +>T90 : Symbol(T90, Decl(conditionalTypes1.ts, 261, 1)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 267, 13)) +>T91 : Symbol(T91, Decl(conditionalTypes1.ts, 265, 40)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 267, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 267, 16)) + +const f41 = (a: T91): T90 => a; +>f41 : Symbol(f41, Decl(conditionalTypes1.ts, 268, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 268, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 268, 16)) +>T91 : Symbol(T91, Decl(conditionalTypes1.ts, 265, 40)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 268, 13)) +>T90 : Symbol(T90, Decl(conditionalTypes1.ts, 261, 1)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 268, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 268, 16)) + +type T92 = T extends () => 0 ? () => 1 : () => 2; +>T92 : Symbol(T92, Decl(conditionalTypes1.ts, 268, 40)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 270, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 270, 9)) + +type T93 = T extends () => 0 ? () => 1 : () => 2; +>T93 : Symbol(T93, Decl(conditionalTypes1.ts, 270, 52)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 271, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 271, 9)) + +const f42 = (a: T92): T93 => a; +>f42 : Symbol(f42, Decl(conditionalTypes1.ts, 272, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 272, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 272, 16)) +>T92 : Symbol(T92, Decl(conditionalTypes1.ts, 268, 40)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 272, 13)) +>T93 : Symbol(T93, Decl(conditionalTypes1.ts, 270, 52)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 272, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 272, 16)) + +const f43 = (a: T93): T92 => a; +>f43 : Symbol(f43, Decl(conditionalTypes1.ts, 273, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 273, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 273, 16)) +>T93 : Symbol(T93, Decl(conditionalTypes1.ts, 270, 52)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 273, 13)) +>T92 : Symbol(T92, Decl(conditionalTypes1.ts, 268, 40)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 273, 13)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 273, 16)) + +type T94 = T extends string ? true : 42; +>T94 : Symbol(T94, Decl(conditionalTypes1.ts, 273, 40)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 275, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 275, 9)) + +type T95 = T extends string ? boolean : number; +>T95 : Symbol(T95, Decl(conditionalTypes1.ts, 275, 43)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 276, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 276, 9)) + +const f44 = (value: T94): T95 => value; +>f44 : Symbol(f44, Decl(conditionalTypes1.ts, 277, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 277, 13)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 277, 16)) +>T94 : Symbol(T94, Decl(conditionalTypes1.ts, 273, 40)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 277, 13)) +>T95 : Symbol(T95, Decl(conditionalTypes1.ts, 275, 43)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 277, 13)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 277, 16)) + +const f45 = (value: T95): T94 => value; // Error +>f45 : Symbol(f45, Decl(conditionalTypes1.ts, 278, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 278, 13)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 278, 16)) +>T95 : Symbol(T95, Decl(conditionalTypes1.ts, 275, 43)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 278, 13)) +>T94 : Symbol(T94, Decl(conditionalTypes1.ts, 273, 40)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 278, 13)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 278, 16)) + diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index 9c68f394094..42cfeae5da0 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -121,6 +121,35 @@ function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { >x : Partial[keyof T] } +function f4(x: T["x"], y: NonNullable) { +>f4 : (x: T["x"], y: Diff) => void +>T : T +>x : string | undefined +>x : T["x"] +>T : T +>y : Diff +>NonNullable : Diff +>T : T + + x = y; +>x = y : Diff +>x : T["x"] +>y : Diff + + y = x; // Error +>y = x : T["x"] +>y : Diff +>x : T["x"] + + let s1: string = x; // Error +>s1 : string +>x : T["x"] + + let s2: string = y; +>s2 : string +>y : Diff +} + type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; >Options : Options >k : "a" @@ -168,8 +197,8 @@ type T15 = Filter; // never >Options : Options >q : "a" -declare function f4(p: K): Filter; ->f4 : (p: K) => Filter +declare function f5(p: K): Filter; +>f5 : (p: K) => Filter >T : T >Options : Options >K : K @@ -180,10 +209,10 @@ declare function f4(p: K): Filterk : K >K : K -let x0 = f4("a"); // { k: "a", a: number } +let x0 = f5("a"); // { k: "a", a: number } >x0 : { k: "a"; a: number; } ->f4("a") : { k: "a"; a: number; } ->f4 : (p: K) => Filter +>f5("a") : { k: "a"; a: number; } +>f5 : (p: K) => Filter >"a" : "a" type OptionsOfKind = Filter; @@ -1103,3 +1132,102 @@ function f33() { >T2 : Foo } +// Repro from #21823 + +type T90 = T extends 0 ? 0 : () => 0; +>T90 : T90 +>T : T +>T : T + +type T91 = T extends 0 ? 0 : () => 0; +>T91 : T91 +>T : T +>T : T + +const f40 = (a: T90): T91 => a; +>f40 : (a: T90) => T91 +>(a: T90): T91 => a : (a: T90) => T91 +>U : U +>a : T90 +>T90 : T90 +>U : U +>T91 : T91 +>U : U +>a : T90 + +const f41 = (a: T91): T90 => a; +>f41 : (a: T91) => T90 +>(a: T91): T90 => a : (a: T91) => T90 +>U : U +>a : T91 +>T91 : T91 +>U : U +>T90 : T90 +>U : U +>a : T91 + +type T92 = T extends () => 0 ? () => 1 : () => 2; +>T92 : T92 +>T : T +>T : T + +type T93 = T extends () => 0 ? () => 1 : () => 2; +>T93 : T93 +>T : T +>T : T + +const f42 = (a: T92): T93 => a; +>f42 : (a: T92) => T93 +>(a: T92): T93 => a : (a: T92) => T93 +>U : U +>a : T92 +>T92 : T92 +>U : U +>T93 : T93 +>U : U +>a : T92 + +const f43 = (a: T93): T92 => a; +>f43 : (a: T93) => T92 +>(a: T93): T92 => a : (a: T93) => T92 +>U : U +>a : T93 +>T93 : T93 +>U : U +>T92 : T92 +>U : U +>a : T93 + +type T94 = T extends string ? true : 42; +>T94 : T94 +>T : T +>T : T +>true : true + +type T95 = T extends string ? boolean : number; +>T95 : T95 +>T : T +>T : T + +const f44 = (value: T94): T95 => value; +>f44 : (value: T94) => T95 +>(value: T94): T95 => value : (value: T94) => T95 +>U : U +>value : T94 +>T94 : T94 +>U : U +>T95 : T95 +>U : U +>value : T94 + +const f45 = (value: T95): T94 => value; // Error +>f45 : (value: T95) => T94 +>(value: T95): T94 => value : (value: T95) => T94 +>U : U +>value : T95 +>T95 : T95 +>U : U +>T94 : T94 +>U : U +>value : T95 + From aa1ebda6a6978c898bf37a5d0c9bdfced90e1cce Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 9 Feb 2018 13:48:40 -0800 Subject: [PATCH 098/298] Fix bug: handle missing symbol.parent for non-accessible symbol (#21834) --- src/services/completions.ts | 2 +- .../completionsRecommended_nonAccessibleSymbol.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionsRecommended_nonAccessibleSymbol.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 2add52cc3dd..c6d5f015279 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -712,7 +712,7 @@ namespace ts.Completions { function getFirstSymbolInChain(symbol: Symbol, enclosingDeclaration: Node, checker: TypeChecker): Symbol | undefined { const chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ SymbolFlags.All, /*useOnlyExternalAliasing*/ false); if (chain) return first(chain); - return isModuleSymbol(symbol.parent) ? symbol : symbol.parent && getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol: Symbol): boolean { diff --git a/tests/cases/fourslash/completionsRecommended_nonAccessibleSymbol.ts b/tests/cases/fourslash/completionsRecommended_nonAccessibleSymbol.ts new file mode 100644 index 00000000000..0f27e824d2b --- /dev/null +++ b/tests/cases/fourslash/completionsRecommended_nonAccessibleSymbol.ts @@ -0,0 +1,10 @@ +/// + +////function f() { +//// class C {} +//// return (c: C) => void; +////} +////f()(new /**/); + +goTo.marker(""); +verify.not.completionListContains("C"); // Not accessible From 31ec5e7390a5d711e5cd9fe85e3beca2dd9b3d8c Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 9 Feb 2018 13:56:04 -0800 Subject: [PATCH 099/298] findAllReferences: Don't fail on broken re-export (#21841) --- src/services/findAllReferences.ts | 5 +++-- tests/cases/fourslash/findAllRefsReExport_broken.ts | 6 ++++++ tests/cases/fourslash/findAllRefsReExport_broken2.ts | 6 ++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/findAllRefsReExport_broken.ts create mode 100644 tests/cases/fourslash/findAllRefsReExport_broken2.ts diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 8b9937394f1..ad243d59d89 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -914,7 +914,8 @@ namespace ts.FindAllReferences.Core { // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. if (search.comingFrom !== ImportExport.Export && exportDeclaration.moduleSpecifier && !propertyName) { - searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + const imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) searchForImportedSymbol(imported, state); } function addRef() { @@ -923,7 +924,7 @@ namespace ts.FindAllReferences.Core { } function getLocalSymbolForExportSpecifier(referenceLocation: Identifier, referenceSymbol: Symbol, exportSpecifier: ExportSpecifier, checker: TypeChecker): Symbol { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; } function isExportSpecifierAlias(referenceLocation: Identifier, exportSpecifier: ExportSpecifier): boolean { diff --git a/tests/cases/fourslash/findAllRefsReExport_broken.ts b/tests/cases/fourslash/findAllRefsReExport_broken.ts new file mode 100644 index 00000000000..7c42d9e2b6c --- /dev/null +++ b/tests/cases/fourslash/findAllRefsReExport_broken.ts @@ -0,0 +1,6 @@ +/// + +// @Filename: /a.ts +////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] }; + +verify.singleReferenceGroup("import x"); diff --git a/tests/cases/fourslash/findAllRefsReExport_broken2.ts b/tests/cases/fourslash/findAllRefsReExport_broken2.ts new file mode 100644 index 00000000000..4f8a3ea5f45 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsReExport_broken2.ts @@ -0,0 +1,6 @@ +/// + +// @Filename: /a.ts +////export { [|{| "isWriteAccess": true, "isDefinition": true |}x|] } from "nonsense"; + +verify.singleReferenceGroup("import x"); From 171b68c9e75ec9f1f8055492e7168ab10ef0a96b Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 9 Feb 2018 14:08:56 -0800 Subject: [PATCH 100/298] Add assertions for bad symbol declaration (#21837) * Add assertions for bad symbol declaration * Fix lint --- src/compiler/checker.ts | 4 ++-- src/compiler/core.ts | 21 ++++++++++++++++++++- src/services/findAllReferences.ts | 12 +++++++++--- src/services/importTracker.ts | 19 +------------------ 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0612c4d4307..7da5d747391 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4406,7 +4406,7 @@ namespace ts { type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } else { - Debug.fail("Unhandled declaration kind! " + (ts as any).SyntaxKind[declaration.kind]); + Debug.fail("Unhandled declaration kind! " + Debug.showSyntaxKind(declaration)); } if (!popTypeResolution()) { @@ -20682,7 +20682,7 @@ namespace ts { case SyntaxKind.ImportSpecifier: // https://github.com/Microsoft/TypeScript/pull/7591 return DeclarationSpaces.ExportValue; default: - Debug.fail((ts as any).SyntaxKind[d.kind]); + Debug.fail(Debug.showSyntaxKind(d)); } } } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index fe8e63676d7..8479cf94180 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1466,7 +1466,7 @@ namespace ts { if (value !== undefined && test(value)) return value; if (value && typeof (value as any).kind === "number") { - Debug.fail(`Invalid cast. The supplied ${(ts as any).SyntaxKind[(value as any).kind]} did not pass the test '${Debug.getFunctionName(test)}'.`); + Debug.fail(`Invalid cast. The supplied ${Debug.showSyntaxKind(value as any as Node)} did not pass the test '${Debug.getFunctionName(test)}'.`); } else { Debug.fail(`Invalid cast. The supplied value did not pass the test '${Debug.getFunctionName(test)}'.`); @@ -2925,6 +2925,25 @@ namespace ts { return match ? match[1] : ""; } } + + export function showSymbol(symbol: Symbol): string { + return `{ flags: ${showFlags(symbol.flags, (ts as any).SymbolFlags)}; declarations: ${map(symbol.declarations, showSyntaxKind)} }`; + } + + function showFlags(flags: number, flagsEnum: { [flag: number]: string }): string { + const out = []; + for (let pow = 0; pow <= 30; pow++) { + const n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + + export function showSyntaxKind(node: Node): string { + return (ts as any).SyntaxKind[node.kind]; + } } /** Remove an item from an array, moving everything to its right one space left. */ diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index ad243d59d89..acc3e6ac4cb 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -416,10 +416,16 @@ namespace ts.FindAllReferences.Core { } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. - return firstDefined(symbol.declarations, decl => - isTypeLiteralNode(decl.parent) && isUnionTypeNode(decl.parent.parent) + return firstDefined(symbol.declarations, decl => { + if (!decl.parent) { + // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. + Debug.assert(decl.kind === SyntaxKind.SourceFile); + Debug.fail(`Unexpected symbol at ${Debug.showSyntaxKind(node)}: ${Debug.showSymbol(symbol)}`); + } + return isTypeLiteralNode(decl.parent) && isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) - : undefined) || symbol; + : undefined; + }) || symbol; } /** diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index 02d0979ca1e..e76e21b2963 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -517,29 +517,12 @@ namespace ts.FindAllReferences { const sym = useLhsSymbol ? checker.getSymbolAtLocation(cast(node.left, isPropertyAccessExpression).name) : symbol; // Better detection for GH#20803 if (sym && !(checker.getMergedSymbol(sym.parent).flags & SymbolFlags.Module)) { - Debug.fail(`Special property assignment kind does not have a module as its parent. Assignment is ${showSymbol(sym)}, parent is ${showSymbol(sym.parent)}`); + Debug.fail(`Special property assignment kind does not have a module as its parent. Assignment is ${Debug.showSymbol(sym)}, parent is ${Debug.showSymbol(sym.parent)}`); } return sym && exportInfo(sym, kind); } } - function showSymbol(s: Symbol): string { - const decls = s.declarations.map(d => (ts as any).SyntaxKind[d.kind]).join(","); - const flags = showFlags(s.flags, (ts as any).SymbolFlags); - return `{ declarations: ${decls}, flags: ${flags} }`; - } - - function showFlags(f: number, flags: any) { - const out = []; - for (let pow = 0; pow <= 30; pow++) { - const n = 1 << pow; - if (f & n) { - out.push(flags[n]); - } - } - return out.join("|"); - } - function getImport(): ImportedSymbol | undefined { const isImport = isNodeImport(node); if (!isImport) return undefined; From 2aba29fc32b21cd9f56ea8510c37772735ebcadf Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Feb 2018 14:22:46 -0800 Subject: [PATCH 101/298] Add Exclude, Extract, NonNullable, ReturnType, and InstanceType types --- src/lib/es5.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 707f749e365..0f773e78786 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1338,6 +1338,31 @@ type Record = { [P in K]: T; }; +/** + * Exclude from T those types that are assignable to U + */ +type Exclude = T extends U ? never : T; + +/** + * Extract from T those types that are assignable to U + */ +type Extract = T extends U ? T : never; + +/** + * Exclude null and undefined from T + */ +type NonNullable = T extends null | undefined ? never : T; + +/** + * Obtain the return type of a function type + */ +type ReturnType any> = T extends (...args: any[]) => infer R ? R : any; + +/** + * Obtain the return type of a constructor function type + */ +type InstanceType any> = T extends new (...args: any[]) => infer R ? R : any; + /** * Marker for contextual 'this' type */ From 92b8ce7821ca9f32cf575d0931fd10364e7a93b1 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Feb 2018 14:22:57 -0800 Subject: [PATCH 102/298] Update tests --- .../types/conditional/conditionalTypes1.ts | 30 ++++++++----------- .../types/conditional/inferTypes1.ts | 17 ++++++----- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes1.ts b/tests/cases/conformance/types/conditional/conditionalTypes1.ts index 93069138b36..3a6dab9a612 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes1.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes1.ts @@ -1,15 +1,11 @@ // @strict: true // @declaration: true -type Diff = T extends U ? never : T; -type Filter = T extends U ? T : never; -type NonNullable = Diff; +type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" +type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" -type T00 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" -type T01 = Filter<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" - -type T02 = Diff void), Function>; // string | number -type T03 = Filter void), Function>; // () => void +type T02 = Exclude void), Function>; // string | number +type T03 = Extract void), Function>; // () => void type T04 = NonNullable; // string | number type T05 = NonNullable<(() => string) | string[] | null | undefined>; // (() => string) | string[] @@ -33,23 +29,23 @@ function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; -type T10 = Diff; // { k: "c", c: boolean } -type T11 = Filter; // { k: "a", a: number } | { k: "b", b: string } +type T10 = Exclude; // { k: "c", c: boolean } +type T11 = Extract; // { k: "a", a: number } | { k: "b", b: string } -type T12 = Diff; // { k: "c", c: boolean } -type T13 = Filter; // { k: "a", a: number } | { k: "b", b: string } +type T12 = Exclude; // { k: "c", c: boolean } +type T13 = Extract; // { k: "a", a: number } | { k: "b", b: string } -type T14 = Diff; // Options -type T15 = Filter; // never +type T14 = Exclude; // Options +type T15 = Extract; // never -declare function f4(p: K): Filter; +declare function f4(p: K): Extract; let x0 = f4("a"); // { k: "a", a: number } -type OptionsOfKind = Filter; +type OptionsOfKind = Extract; type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string } -type Select = Filter; +type Select = Extract; type T17 = Select; // // { k: "a", a: number } | { k: "b", b: string } diff --git a/tests/cases/conformance/types/conditional/inferTypes1.ts b/tests/cases/conformance/types/conditional/inferTypes1.ts index 99cfa8a2460..cb803103bae 100644 --- a/tests/cases/conformance/types/conditional/inferTypes1.ts +++ b/tests/cases/conformance/types/conditional/inferTypes1.ts @@ -15,8 +15,6 @@ type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any type T06 = Unpacked; // never -type ReturnType = T extends ((...args: any[]) => infer R) | (new (...args: any[]) => infer R) ? R : any; - function f1(s: string) { return { a: 1, b: s }; } @@ -31,11 +29,16 @@ type T11 = ReturnType<(s: string) => void>; // void type T12 = ReturnType<(() => T)>; // {} type T13 = ReturnType<(() => T)>; // number[] type T14 = ReturnType; // { a: number, b: string } -type T15 = ReturnType; // C -type T16 = ReturnType; // any -type T17 = ReturnType; // any -type T18 = ReturnType; // Error -type T19 = ReturnType; // any +type T15 = ReturnType; // any +type T16 = ReturnType; // any +type T17 = ReturnType; // Error +type T18 = ReturnType; // Error + +type U10 = InstanceType; // C +type U11 = InstanceType; // any +type U12 = InstanceType; // any +type U13 = InstanceType; // Error +type U14 = InstanceType; // Error type ArgumentType any> = T extends (a: infer A) => any ? A : any; From 11a075c2892fd30b7c3f97ed1a9ca4533f7ea4c7 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 9 Feb 2018 14:23:19 -0800 Subject: [PATCH 103/298] Accept new baselines --- .../reference/conditionalTypes1.errors.txt | 90 +- .../baselines/reference/conditionalTypes1.js | 59 +- .../reference/conditionalTypes1.symbols | 1108 ++++++++--------- .../reference/conditionalTypes1.types | 129 +- .../reference/inferTypes1.errors.txt | 60 +- tests/baselines/reference/inferTypes1.js | 17 +- tests/baselines/reference/inferTypes1.symbols | 696 ++++++----- tests/baselines/reference/inferTypes1.types | 46 +- 8 files changed, 1090 insertions(+), 1115 deletions(-) diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 8b42f006cd4..111b74a830b 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -1,16 +1,16 @@ -tests/cases/conformance/types/conditional/conditionalTypes1.ts(16,5): error TS2322: Type 'T' is not assignable to type 'Diff'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(21,5): error TS2322: Type 'T' is not assignable to type 'Diff'. - Type 'string | undefined' is not assignable to type 'Diff'. - Type 'undefined' is not assignable to type 'Diff'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(22,9): error TS2322: Type 'T' is not assignable to type 'string'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(12,5): error TS2322: Type 'T' is not assignable to type 'NonNullable'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(17,5): error TS2322: Type 'T' is not assignable to type 'NonNullable'. + Type 'string | undefined' is not assignable to type 'NonNullable'. + Type 'undefined' is not assignable to type 'NonNullable'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(18,9): error TS2322: Type 'T' is not assignable to type 'string'. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(28,5): error TS2322: Type 'Partial[keyof T]' is not assignable to type 'Diff[keyof T], null | undefined>'. - Type 'T[keyof T] | undefined' is not assignable to type 'Diff[keyof T], null | undefined>'. - Type 'undefined' is not assignable to type 'Diff[keyof T], null | undefined>'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(100,5): error TS2322: Type 'Pick' is not assignable to type 'T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(101,5): error TS2322: Type 'Pick' is not assignable to type 'T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(24,5): error TS2322: Type 'Partial[keyof T]' is not assignable to type 'NonNullable[keyof T]>'. + Type 'T[keyof T] | undefined' is not assignable to type 'NonNullable[keyof T]>'. + Type 'undefined' is not assignable to type 'NonNullable[keyof T]>'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(96,5): error TS2322: Type 'Pick' is not assignable to type 'T'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(97,5): error TS2322: Type 'Pick' is not assignable to type 'T'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(99,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. @@ -19,7 +19,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2 Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(105,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(101,5): error TS2322: Type 'Pick' is not assignable to type 'Pick'. Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. @@ -28,49 +28,45 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(105,5): error TS2 Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(111,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(107,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(112,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(108,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type 'T[keyof T] extends Function ? never : keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? keyof T : never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(113,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(109,5): error TS2322: Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(114,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(110,5): error TS2322: Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'keyof T' is not assignable to type '{ [K in keyof T]: T[K] extends Function ? never : K; }[keyof T]'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type '{ [K in keyof T]: T[K] extends Function ? K : never; }[keyof T]' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'keyof T' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(131,10): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(132,5): error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(133,22): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(134,10): error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(156,5): error TS2322: Type 'ZeroOf' is not assignable to type 'T'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(127,10): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(128,5): error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(129,22): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(130,10): error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(152,5): error TS2322: Type 'ZeroOf' is not assignable to type 'T'. Type '0 | (T extends string ? "" : false)' is not assignable to type 'T'. Type '0' is not assignable to type 'T'. Type '"" | 0' is not assignable to type 'T'. Type '""' is not assignable to type 'T'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(157,5): error TS2322: Type 'T' is not assignable to type 'ZeroOf'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(153,5): error TS2322: Type 'T' is not assignable to type 'ZeroOf'. Type 'string | number' is not assignable to type 'ZeroOf'. Type 'string' is not assignable to type 'ZeroOf'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo'. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(243,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo'. ==== tests/cases/conformance/types/conditional/conditionalTypes1.ts (19 errors) ==== - type Diff = T extends U ? never : T; - type Filter = T extends U ? T : never; - type NonNullable = Diff; + type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" + type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" - type T00 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" - type T01 = Filter<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" - - type T02 = Diff void), Function>; // string | number - type T03 = Filter void), Function>; // () => void + type T02 = Exclude void), Function>; // string | number + type T03 = Extract void), Function>; // () => void type T04 = NonNullable; // string | number type T05 = NonNullable<(() => string) | string[] | null | undefined>; // (() => string) | string[] @@ -79,16 +75,16 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 x = y; y = x; // Error ~ -!!! error TS2322: Type 'T' is not assignable to type 'Diff'. +!!! error TS2322: Type 'T' is not assignable to type 'NonNullable'. } function f2(x: T, y: NonNullable) { x = y; y = x; // Error ~ -!!! error TS2322: Type 'T' is not assignable to type 'Diff'. -!!! error TS2322: Type 'string | undefined' is not assignable to type 'Diff'. -!!! error TS2322: Type 'undefined' is not assignable to type 'Diff'. +!!! error TS2322: Type 'T' is not assignable to type 'NonNullable'. +!!! error TS2322: Type 'string | undefined' is not assignable to type 'NonNullable'. +!!! error TS2322: Type 'undefined' is not assignable to type 'NonNullable'. let s1: string = x; // Error ~~ !!! error TS2322: Type 'T' is not assignable to type 'string'. @@ -101,30 +97,30 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(247,9): error TS2 x = y; y = x; // Error ~ -!!! error TS2322: Type 'Partial[keyof T]' is not assignable to type 'Diff[keyof T], null | undefined>'. -!!! error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'Diff[keyof T], null | undefined>'. -!!! error TS2322: Type 'undefined' is not assignable to type 'Diff[keyof T], null | undefined>'. +!!! error TS2322: Type 'Partial[keyof T]' is not assignable to type 'NonNullable[keyof T]>'. +!!! error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'NonNullable[keyof T]>'. +!!! error TS2322: Type 'undefined' is not assignable to type 'NonNullable[keyof T]>'. } type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; - type T10 = Diff; // { k: "c", c: boolean } - type T11 = Filter; // { k: "a", a: number } | { k: "b", b: string } + type T10 = Exclude; // { k: "c", c: boolean } + type T11 = Extract; // { k: "a", a: number } | { k: "b", b: string } - type T12 = Diff; // { k: "c", c: boolean } - type T13 = Filter; // { k: "a", a: number } | { k: "b", b: string } + type T12 = Exclude; // { k: "c", c: boolean } + type T13 = Extract; // { k: "a", a: number } | { k: "b", b: string } - type T14 = Diff; // Options - type T15 = Filter; // never + type T14 = Exclude; // Options + type T15 = Extract; // never - declare function f4(p: K): Filter; + declare function f4(p: K): Extract; let x0 = f4("a"); // { k: "a", a: number } - type OptionsOfKind = Filter; + type OptionsOfKind = Extract; type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string } - type Select = Filter; + type Select = Extract; type T17 = Select; // // { k: "a", a: number } | { k: "b", b: string } diff --git a/tests/baselines/reference/conditionalTypes1.js b/tests/baselines/reference/conditionalTypes1.js index 403259b049f..399ccb14fb3 100644 --- a/tests/baselines/reference/conditionalTypes1.js +++ b/tests/baselines/reference/conditionalTypes1.js @@ -1,13 +1,9 @@ //// [conditionalTypes1.ts] -type Diff = T extends U ? never : T; -type Filter = T extends U ? T : never; -type NonNullable = Diff; +type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" +type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" -type T00 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" -type T01 = Filter<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" - -type T02 = Diff void), Function>; // string | number -type T03 = Filter void), Function>; // () => void +type T02 = Exclude void), Function>; // string | number +type T03 = Extract void), Function>; // () => void type T04 = NonNullable; // string | number type T05 = NonNullable<(() => string) | string[] | null | undefined>; // (() => string) | string[] @@ -31,23 +27,23 @@ function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; -type T10 = Diff; // { k: "c", c: boolean } -type T11 = Filter; // { k: "a", a: number } | { k: "b", b: string } +type T10 = Exclude; // { k: "c", c: boolean } +type T11 = Extract; // { k: "a", a: number } | { k: "b", b: string } -type T12 = Diff; // { k: "c", c: boolean } -type T13 = Filter; // { k: "a", a: number } | { k: "b", b: string } +type T12 = Exclude; // { k: "c", c: boolean } +type T13 = Extract; // { k: "a", a: number } | { k: "b", b: string } -type T14 = Diff; // Options -type T15 = Filter; // never +type T14 = Exclude; // Options +type T15 = Extract; // never -declare function f4(p: K): Filter; +declare function f4(p: K): Extract; let x0 = f4("a"); // { k: "a", a: number } -type OptionsOfKind = Filter; +type OptionsOfKind = Extract; type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string } -type Select = Filter; +type Select = Extract; type T17 = Select; // // { k: "a", a: number } | { k: "b", b: string } @@ -332,13 +328,10 @@ function f33() { //// [conditionalTypes1.d.ts] -declare type Diff = T extends U ? never : T; -declare type Filter = T extends U ? T : never; -declare type NonNullable = Diff; -declare type T00 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">; -declare type T01 = Filter<"a" | "b" | "c" | "d", "a" | "c" | "f">; -declare type T02 = Diff void), Function>; -declare type T03 = Filter void), Function>; +declare type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; +declare type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; +declare type T02 = Exclude void), Function>; +declare type T03 = Extract void), Function>; declare type T04 = NonNullable; declare type T05 = NonNullable<(() => string) | string[] | null | undefined>; declare function f1(x: T, y: NonNullable): void; @@ -354,40 +347,40 @@ declare type Options = { k: "c"; c: boolean; }; -declare type T10 = Diff; -declare type T11 = Filter; -declare type T12 = Diff; -declare type T13 = Filter; -declare type T14 = Diff; -declare type T15 = Filter; -declare function f4(p: K): Filter(p: K): Extract; declare let x0: { k: "a"; a: number; }; -declare type OptionsOfKind = Filter = Extract; declare type T16 = OptionsOfKind<"a" | "b">; -declare type Select = Filter = Extract; declare type T17 = Select; diff --git a/tests/baselines/reference/conditionalTypes1.symbols b/tests/baselines/reference/conditionalTypes1.symbols index 883a2d9bda1..cef734c4c4b 100644 --- a/tests/baselines/reference/conditionalTypes1.symbols +++ b/tests/baselines/reference/conditionalTypes1.symbols @@ -1,964 +1,942 @@ === tests/cases/conformance/types/conditional/conditionalTypes1.ts === -type Diff = T extends U ? never : T; ->Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 0, 10)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 0, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 0, 10)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 0, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 0, 10)) +type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" +>T00 : Symbol(T00, Decl(conditionalTypes1.ts, 0, 0)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) -type Filter = T extends U ? T : never; ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 1, 12)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 1, 14)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 1, 12)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 1, 14)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 1, 12)) +type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" +>T01 : Symbol(T01, Decl(conditionalTypes1.ts, 0, 59)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) -type NonNullable = Diff; ->NonNullable : Symbol(NonNullable, Decl(conditionalTypes1.ts, 1, 44)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 2, 17)) ->Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 2, 17)) - -type T00 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" ->T00 : Symbol(T00, Decl(conditionalTypes1.ts, 2, 48)) ->Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) - -type T01 = Filter<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" ->T01 : Symbol(T01, Decl(conditionalTypes1.ts, 4, 56)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) - -type T02 = Diff void), Function>; // string | number ->T02 : Symbol(T02, Decl(conditionalTypes1.ts, 5, 58)) ->Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) +type T02 = Exclude void), Function>; // string | number +>T02 : Symbol(T02, Decl(conditionalTypes1.ts, 1, 59)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) -type T03 = Filter void), Function>; // () => void ->T03 : Symbol(T03, Decl(conditionalTypes1.ts, 7, 58)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) +type T03 = Extract void), Function>; // () => void +>T03 : Symbol(T03, Decl(conditionalTypes1.ts, 3, 61)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type T04 = NonNullable; // string | number ->T04 : Symbol(T04, Decl(conditionalTypes1.ts, 8, 60)) ->NonNullable : Symbol(NonNullable, Decl(conditionalTypes1.ts, 1, 44)) +>T04 : Symbol(T04, Decl(conditionalTypes1.ts, 4, 61)) +>NonNullable : Symbol(NonNullable, Decl(lib.d.ts, --, --)) type T05 = NonNullable<(() => string) | string[] | null | undefined>; // (() => string) | string[] ->T05 : Symbol(T05, Decl(conditionalTypes1.ts, 10, 52)) ->NonNullable : Symbol(NonNullable, Decl(conditionalTypes1.ts, 1, 44)) +>T05 : Symbol(T05, Decl(conditionalTypes1.ts, 6, 52)) +>NonNullable : Symbol(NonNullable, Decl(lib.d.ts, --, --)) function f1(x: T, y: NonNullable) { ->f1 : Symbol(f1, Decl(conditionalTypes1.ts, 11, 69)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 13, 12)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 13, 15)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 13, 12)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 13, 20)) ->NonNullable : Symbol(NonNullable, Decl(conditionalTypes1.ts, 1, 44)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 13, 12)) +>f1 : Symbol(f1, Decl(conditionalTypes1.ts, 7, 69)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 9, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 9, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 9, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 9, 20)) +>NonNullable : Symbol(NonNullable, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 9, 12)) x = y; ->x : Symbol(x, Decl(conditionalTypes1.ts, 13, 15)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 13, 20)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 9, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 9, 20)) y = x; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 13, 20)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 13, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 9, 20)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 9, 15)) } function f2(x: T, y: NonNullable) { ->f2 : Symbol(f2, Decl(conditionalTypes1.ts, 16, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 18, 12)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 18, 42)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 18, 12)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 18, 47)) ->NonNullable : Symbol(NonNullable, Decl(conditionalTypes1.ts, 1, 44)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 18, 12)) +>f2 : Symbol(f2, Decl(conditionalTypes1.ts, 12, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 14, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 14, 42)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 14, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 14, 47)) +>NonNullable : Symbol(NonNullable, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 14, 12)) x = y; ->x : Symbol(x, Decl(conditionalTypes1.ts, 18, 42)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 18, 47)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 14, 42)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 14, 47)) y = x; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 18, 47)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 18, 42)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 14, 47)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 14, 42)) let s1: string = x; // Error ->s1 : Symbol(s1, Decl(conditionalTypes1.ts, 21, 7)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 18, 42)) +>s1 : Symbol(s1, Decl(conditionalTypes1.ts, 17, 7)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 14, 42)) let s2: string = y; ->s2 : Symbol(s2, Decl(conditionalTypes1.ts, 22, 7)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 18, 47)) +>s2 : Symbol(s2, Decl(conditionalTypes1.ts, 18, 7)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 14, 47)) } function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { ->f3 : Symbol(f3, Decl(conditionalTypes1.ts, 23, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 25, 12)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 25, 15)) +>f3 : Symbol(f3, Decl(conditionalTypes1.ts, 19, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 21, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 21, 15)) >Partial : Symbol(Partial, Decl(lib.d.ts, --, --)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 25, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 25, 12)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 25, 38)) ->NonNullable : Symbol(NonNullable, Decl(conditionalTypes1.ts, 1, 44)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 21, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 21, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 21, 38)) +>NonNullable : Symbol(NonNullable, Decl(lib.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.d.ts, --, --)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 25, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 25, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 21, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 21, 12)) x = y; ->x : Symbol(x, Decl(conditionalTypes1.ts, 25, 15)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 25, 38)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 21, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 21, 38)) y = x; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 25, 38)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 25, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 21, 38)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 21, 15)) } type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: boolean }; ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 30, 16)) ->a : Symbol(a, Decl(conditionalTypes1.ts, 30, 24)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 30, 40)) ->b : Symbol(b, Decl(conditionalTypes1.ts, 30, 48)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 30, 64)) ->c : Symbol(c, Decl(conditionalTypes1.ts, 30, 72)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 26, 16)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 26, 24)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 26, 40)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 26, 48)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 26, 64)) +>c : Symbol(c, Decl(conditionalTypes1.ts, 26, 72)) -type T10 = Diff; // { k: "c", c: boolean } ->T10 : Symbol(T10, Decl(conditionalTypes1.ts, 30, 86)) ->Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 32, 26)) +type T10 = Exclude; // { k: "c", c: boolean } +>T10 : Symbol(T10, Decl(conditionalTypes1.ts, 26, 86)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 28, 29)) -type T11 = Filter; // { k: "a", a: number } | { k: "b", b: string } ->T11 : Symbol(T11, Decl(conditionalTypes1.ts, 32, 43)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 33, 28)) +type T11 = Extract; // { k: "a", a: number } | { k: "b", b: string } +>T11 : Symbol(T11, Decl(conditionalTypes1.ts, 28, 46)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 29, 29)) -type T12 = Diff; // { k: "c", c: boolean } ->T12 : Symbol(T12, Decl(conditionalTypes1.ts, 33, 45)) ->Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 35, 26)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 35, 39)) +type T12 = Exclude; // { k: "c", c: boolean } +>T12 : Symbol(T12, Decl(conditionalTypes1.ts, 29, 46)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 31, 29)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 31, 42)) -type T13 = Filter; // { k: "a", a: number } | { k: "b", b: string } ->T13 : Symbol(T13, Decl(conditionalTypes1.ts, 35, 50)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 36, 28)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 36, 41)) +type T13 = Extract; // { k: "a", a: number } | { k: "b", b: string } +>T13 : Symbol(T13, Decl(conditionalTypes1.ts, 31, 53)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 32, 29)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 32, 42)) -type T14 = Diff; // Options ->T14 : Symbol(T14, Decl(conditionalTypes1.ts, 36, 52)) ->Diff : Symbol(Diff, Decl(conditionalTypes1.ts, 0, 0)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->q : Symbol(q, Decl(conditionalTypes1.ts, 38, 26)) +type T14 = Exclude; // Options +>T14 : Symbol(T14, Decl(conditionalTypes1.ts, 32, 53)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>q : Symbol(q, Decl(conditionalTypes1.ts, 34, 29)) -type T15 = Filter; // never ->T15 : Symbol(T15, Decl(conditionalTypes1.ts, 38, 37)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->q : Symbol(q, Decl(conditionalTypes1.ts, 39, 28)) +type T15 = Extract; // never +>T15 : Symbol(T15, Decl(conditionalTypes1.ts, 34, 40)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>q : Symbol(q, Decl(conditionalTypes1.ts, 35, 29)) -declare function f4(p: K): Filter; ->f4 : Symbol(f4, Decl(conditionalTypes1.ts, 39, 39)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 41, 20)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 41, 38)) ->p : Symbol(p, Decl(conditionalTypes1.ts, 41, 57)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 41, 38)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 41, 20)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 41, 75)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 41, 38)) +declare function f4(p: K): Extract; +>f4 : Symbol(f4, Decl(conditionalTypes1.ts, 35, 40)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 37, 20)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 37, 38)) +>p : Symbol(p, Decl(conditionalTypes1.ts, 37, 57)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 37, 38)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 37, 20)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 37, 76)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 37, 38)) let x0 = f4("a"); // { k: "a", a: number } ->x0 : Symbol(x0, Decl(conditionalTypes1.ts, 42, 3)) ->f4 : Symbol(f4, Decl(conditionalTypes1.ts, 39, 39)) +>x0 : Symbol(x0, Decl(conditionalTypes1.ts, 38, 3)) +>f4 : Symbol(f4, Decl(conditionalTypes1.ts, 35, 40)) -type OptionsOfKind = Filter; ->OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 42, 17)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 44, 19)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) ->k : Symbol(k, Decl(conditionalTypes1.ts, 44, 62)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 44, 19)) +type OptionsOfKind = Extract; +>OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 38, 17)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 40, 19)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) +>k : Symbol(k, Decl(conditionalTypes1.ts, 40, 63)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 40, 19)) type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string } ->T16 : Symbol(T16, Decl(conditionalTypes1.ts, 44, 71)) ->OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 42, 17)) +>T16 : Symbol(T16, Decl(conditionalTypes1.ts, 40, 72)) +>OptionsOfKind : Symbol(OptionsOfKind, Decl(conditionalTypes1.ts, 38, 17)) -type Select = Filter; ->Select : Symbol(Select, Decl(conditionalTypes1.ts, 46, 36)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 48, 14)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->V : Symbol(V, Decl(conditionalTypes1.ts, 48, 33)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 48, 14)) ->Filter : Symbol(Filter, Decl(conditionalTypes1.ts, 0, 42)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 48, 12)) ->P : Symbol(P, Decl(conditionalTypes1.ts, 48, 65)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 48, 14)) ->V : Symbol(V, Decl(conditionalTypes1.ts, 48, 33)) +type Select = Extract; +>Select : Symbol(Select, Decl(conditionalTypes1.ts, 42, 36)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 44, 12)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 44, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 44, 12)) +>V : Symbol(V, Decl(conditionalTypes1.ts, 44, 33)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 44, 12)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 44, 14)) +>Extract : Symbol(Extract, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 44, 12)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 44, 66)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 44, 14)) +>V : Symbol(V, Decl(conditionalTypes1.ts, 44, 33)) type T17 = Select; // // { k: "a", a: number } | { k: "b", b: string } ->T17 : Symbol(T17, Decl(conditionalTypes1.ts, 48, 79)) ->Select : Symbol(Select, Decl(conditionalTypes1.ts, 46, 36)) ->Options : Symbol(Options, Decl(conditionalTypes1.ts, 28, 1)) +>T17 : Symbol(T17, Decl(conditionalTypes1.ts, 44, 80)) +>Select : Symbol(Select, Decl(conditionalTypes1.ts, 42, 36)) +>Options : Symbol(Options, Decl(conditionalTypes1.ts, 24, 1)) type TypeName = ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 46, 43)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 14)) T extends string ? "string" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 14)) T extends number ? "number" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 14)) T extends boolean ? "boolean" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 14)) T extends undefined ? "undefined" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 14)) T extends Function ? "function" : ->T : Symbol(T, Decl(conditionalTypes1.ts, 52, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 48, 14)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "object"; type T20 = TypeName void)>; // "string" | "function" ->T20 : Symbol(T20, Decl(conditionalTypes1.ts, 58, 13)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T20 : Symbol(T20, Decl(conditionalTypes1.ts, 54, 13)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 46, 43)) type T21 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" ->T21 : Symbol(T21, Decl(conditionalTypes1.ts, 60, 43)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T21 : Symbol(T21, Decl(conditionalTypes1.ts, 56, 43)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 46, 43)) type T22 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" ->T22 : Symbol(T22, Decl(conditionalTypes1.ts, 61, 25)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T22 : Symbol(T22, Decl(conditionalTypes1.ts, 57, 25)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 46, 43)) type T23 = TypeName<{}>; // "object" ->T23 : Symbol(T23, Decl(conditionalTypes1.ts, 62, 27)) ->TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 50, 43)) +>T23 : Symbol(T23, Decl(conditionalTypes1.ts, 58, 27)) +>TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 46, 43)) type KnockoutObservable = { object: T }; ->KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 63, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 65, 24)) ->object : Symbol(object, Decl(conditionalTypes1.ts, 65, 30)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 65, 24)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 59, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 61, 24)) +>object : Symbol(object, Decl(conditionalTypes1.ts, 61, 30)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 61, 24)) type KnockoutObservableArray = { array: T }; ->KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 65, 43)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 66, 29)) ->array : Symbol(array, Decl(conditionalTypes1.ts, 66, 35)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 66, 29)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 61, 43)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 62, 29)) +>array : Symbol(array, Decl(conditionalTypes1.ts, 62, 35)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 62, 29)) type KnockedOut = T extends any[] ? KnockoutObservableArray : KnockoutObservable; ->KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 66, 47)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) ->KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 65, 43)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) ->KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 63, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 68, 16)) +>KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 62, 47)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 64, 16)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 64, 16)) +>KnockoutObservableArray : Symbol(KnockoutObservableArray, Decl(conditionalTypes1.ts, 61, 43)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 64, 16)) +>KnockoutObservable : Symbol(KnockoutObservable, Decl(conditionalTypes1.ts, 59, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 64, 16)) type KnockedOutObj = { ->KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 68, 98)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 70, 19)) +>KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 64, 98)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 66, 19)) [P in keyof T]: KnockedOut; ->P : Symbol(P, Decl(conditionalTypes1.ts, 71, 5)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 70, 19)) ->KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 66, 47)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 70, 19)) ->P : Symbol(P, Decl(conditionalTypes1.ts, 71, 5)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 67, 5)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 66, 19)) +>KnockedOut : Symbol(KnockedOut, Decl(conditionalTypes1.ts, 62, 47)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 66, 19)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 67, 5)) } interface Item { ->Item : Symbol(Item, Decl(conditionalTypes1.ts, 72, 1)) +>Item : Symbol(Item, Decl(conditionalTypes1.ts, 68, 1)) id: number; ->id : Symbol(Item.id, Decl(conditionalTypes1.ts, 74, 16)) +>id : Symbol(Item.id, Decl(conditionalTypes1.ts, 70, 16)) name: string; ->name : Symbol(Item.name, Decl(conditionalTypes1.ts, 75, 15)) +>name : Symbol(Item.name, Decl(conditionalTypes1.ts, 71, 15)) subitems: string[]; ->subitems : Symbol(Item.subitems, Decl(conditionalTypes1.ts, 76, 17)) +>subitems : Symbol(Item.subitems, Decl(conditionalTypes1.ts, 72, 17)) } type KOItem = KnockedOutObj; ->KOItem : Symbol(KOItem, Decl(conditionalTypes1.ts, 78, 1)) ->KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 68, 98)) ->Item : Symbol(Item, Decl(conditionalTypes1.ts, 72, 1)) +>KOItem : Symbol(KOItem, Decl(conditionalTypes1.ts, 74, 1)) +>KnockedOutObj : Symbol(KnockedOutObj, Decl(conditionalTypes1.ts, 64, 98)) +>Item : Symbol(Item, Decl(conditionalTypes1.ts, 68, 1)) interface Part { ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 76, 34)) id: number; ->id : Symbol(Part.id, Decl(conditionalTypes1.ts, 82, 16)) +>id : Symbol(Part.id, Decl(conditionalTypes1.ts, 78, 16)) name: string; ->name : Symbol(Part.name, Decl(conditionalTypes1.ts, 83, 15)) +>name : Symbol(Part.name, Decl(conditionalTypes1.ts, 79, 15)) subparts: Part[]; ->subparts : Symbol(Part.subparts, Decl(conditionalTypes1.ts, 84, 17)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>subparts : Symbol(Part.subparts, Decl(conditionalTypes1.ts, 80, 17)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 76, 34)) updatePart(newName: string): void; ->updatePart : Symbol(Part.updatePart, Decl(conditionalTypes1.ts, 85, 21)) ->newName : Symbol(newName, Decl(conditionalTypes1.ts, 86, 15)) +>updatePart : Symbol(Part.updatePart, Decl(conditionalTypes1.ts, 81, 21)) +>newName : Symbol(newName, Decl(conditionalTypes1.ts, 82, 15)) } type FunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? K : never }[keyof T]; ->FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 87, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 89, 35)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 89, 35)) +>FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 83, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 85, 27)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 85, 35)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 85, 27)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 85, 27)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 85, 35)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 89, 35)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 85, 35)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 85, 27)) type FunctionProperties = Pick>; ->FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 89, 95)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 90, 24)) +>FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 85, 95)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 86, 24)) >Pick : Symbol(Pick, Decl(lib.d.ts, --, --)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 90, 24)) ->FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 87, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 90, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 86, 24)) +>FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 83, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 86, 24)) type NonFunctionPropertyNames = { [K in keyof T]: T[K] extends Function ? never : K }[keyof T]; ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 92, 38)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 92, 38)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 86, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 88, 30)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 88, 38)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 88, 30)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 88, 30)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 88, 38)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->K : Symbol(K, Decl(conditionalTypes1.ts, 92, 38)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 92, 30)) +>K : Symbol(K, Decl(conditionalTypes1.ts, 88, 38)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 88, 30)) type NonFunctionProperties = Pick>; ->NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 92, 98)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 93, 27)) +>NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 88, 98)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) >Pick : Symbol(Pick, Decl(lib.d.ts, --, --)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 93, 27)) ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 93, 27)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 86, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 89, 27)) type T30 = FunctionProperties; ->T30 : Symbol(T30, Decl(conditionalTypes1.ts, 93, 69)) ->FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 89, 95)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>T30 : Symbol(T30, Decl(conditionalTypes1.ts, 89, 69)) +>FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 85, 95)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 76, 34)) type T31 = NonFunctionProperties; ->T31 : Symbol(T31, Decl(conditionalTypes1.ts, 95, 36)) ->NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 92, 98)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>T31 : Symbol(T31, Decl(conditionalTypes1.ts, 91, 36)) +>NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 88, 98)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 76, 34)) function f7(x: T, y: FunctionProperties, z: NonFunctionProperties) { ->f7 : Symbol(f7, Decl(conditionalTypes1.ts, 96, 39)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) ->FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 89, 95)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) ->NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 92, 98)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 98, 12)) +>f7 : Symbol(f7, Decl(conditionalTypes1.ts, 92, 39)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 94, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 94, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 94, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 94, 20)) +>FunctionProperties : Symbol(FunctionProperties, Decl(conditionalTypes1.ts, 85, 95)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 94, 12)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 94, 46)) +>NonFunctionProperties : Symbol(NonFunctionProperties, Decl(conditionalTypes1.ts, 88, 98)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 94, 12)) x = y; // Error ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 94, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 94, 20)) x = z; // Error ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 94, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 94, 46)) y = x; ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 94, 20)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 94, 15)) y = z; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 94, 20)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 94, 46)) z = x; ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 98, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 94, 46)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 94, 15)) z = y; // Error ->z : Symbol(z, Decl(conditionalTypes1.ts, 98, 46)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 98, 20)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 94, 46)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 94, 20)) } function f8(x: keyof T, y: FunctionPropertyNames, z: NonFunctionPropertyNames) { ->f8 : Symbol(f8, Decl(conditionalTypes1.ts, 105, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) ->FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 87, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 107, 12)) +>f8 : Symbol(f8, Decl(conditionalTypes1.ts, 101, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 103, 12)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 103, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 103, 12)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 103, 26)) +>FunctionPropertyNames : Symbol(FunctionPropertyNames, Decl(conditionalTypes1.ts, 83, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 103, 12)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 103, 55)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 86, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 103, 12)) x = y; ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 103, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 103, 26)) x = z; ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 103, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 103, 55)) y = x; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 103, 26)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 103, 15)) y = z; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 103, 26)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 103, 55)) z = x; // Error ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 107, 15)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 103, 55)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 103, 15)) z = y; // Error ->z : Symbol(z, Decl(conditionalTypes1.ts, 107, 55)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 107, 26)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 103, 55)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 103, 26)) } type DeepReadonly = ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 110, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 112, 18)) T extends any[] ? DeepReadonlyArray : ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) ->DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 119, 6)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 112, 18)) +>DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 115, 6)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 112, 18)) T extends object ? DeepReadonlyObject : ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) ->DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 121, 72)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 112, 18)) +>DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 117, 72)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 112, 18)) T; ->T : Symbol(T, Decl(conditionalTypes1.ts, 116, 18)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 112, 18)) interface DeepReadonlyArray extends ReadonlyArray> {} ->DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 119, 6)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 121, 28)) +>DeepReadonlyArray : Symbol(DeepReadonlyArray, Decl(conditionalTypes1.ts, 115, 6)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 117, 28)) >ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.d.ts, --, --)) ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 121, 28)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 110, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 117, 28)) type DeepReadonlyObject = { ->DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 121, 72)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 123, 24)) +>DeepReadonlyObject : Symbol(DeepReadonlyObject, Decl(conditionalTypes1.ts, 117, 72)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 119, 24)) readonly [P in NonFunctionPropertyNames]: DeepReadonly; ->P : Symbol(P, Decl(conditionalTypes1.ts, 124, 14)) ->NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 90, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 123, 24)) ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 123, 24)) ->P : Symbol(P, Decl(conditionalTypes1.ts, 124, 14)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 120, 14)) +>NonFunctionPropertyNames : Symbol(NonFunctionPropertyNames, Decl(conditionalTypes1.ts, 86, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 119, 24)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 110, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 119, 24)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 120, 14)) }; function f10(part: DeepReadonly) { ->f10 : Symbol(f10, Decl(conditionalTypes1.ts, 125, 2)) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) ->DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 114, 1)) ->Part : Symbol(Part, Decl(conditionalTypes1.ts, 80, 34)) +>f10 : Symbol(f10, Decl(conditionalTypes1.ts, 121, 2)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) +>DeepReadonly : Symbol(DeepReadonly, Decl(conditionalTypes1.ts, 110, 1)) +>Part : Symbol(Part, Decl(conditionalTypes1.ts, 76, 34)) let name: string = part.name; ->name : Symbol(name, Decl(conditionalTypes1.ts, 128, 7)) +>name : Symbol(name, Decl(conditionalTypes1.ts, 124, 7)) >part.name : Symbol(name) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >name : Symbol(name) let id: number = part.subparts[0].id; ->id : Symbol(id, Decl(conditionalTypes1.ts, 129, 7)) +>id : Symbol(id, Decl(conditionalTypes1.ts, 125, 7)) >part.subparts[0].id : Symbol(id) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >subparts : Symbol(subparts) >id : Symbol(id) part.id = part.id; // Error >part.id : Symbol(id) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >id : Symbol(id) >part.id : Symbol(id) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >id : Symbol(id) part.subparts[0] = part.subparts[0]; // Error >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >subparts : Symbol(subparts) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >subparts : Symbol(subparts) part.subparts[0].id = part.subparts[0].id; // Error >part.subparts[0].id : Symbol(id) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >subparts : Symbol(subparts) >id : Symbol(id) >part.subparts[0].id : Symbol(id) >part.subparts : Symbol(subparts) ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) >subparts : Symbol(subparts) >id : Symbol(id) part.updatePart("hello"); // Error ->part : Symbol(part, Decl(conditionalTypes1.ts, 127, 13)) +>part : Symbol(part, Decl(conditionalTypes1.ts, 123, 13)) } type ZeroOf = T extends number ? 0 : T extends string ? "" : false; ->ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 134, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 136, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 136, 12)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 136, 12)) +>ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 130, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 132, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 132, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 132, 12)) function zeroOf(value: T) { ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 138, 16)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 138, 53)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 138, 16)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 134, 16)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 134, 53)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 134, 16)) return >(typeof value === "number" ? 0 : typeof value === "string" ? "" : false); ->ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 134, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 138, 16)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 138, 53)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 138, 53)) +>ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 130, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 134, 16)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 134, 53)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 134, 53)) } function f20(n: number, b: boolean, x: number | boolean, y: T) { ->f20 : Symbol(f20, Decl(conditionalTypes1.ts, 140, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 142, 13)) ->n : Symbol(n, Decl(conditionalTypes1.ts, 142, 31)) ->b : Symbol(b, Decl(conditionalTypes1.ts, 142, 41)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 142, 53)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 142, 74)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 142, 13)) +>f20 : Symbol(f20, Decl(conditionalTypes1.ts, 136, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 138, 13)) +>n : Symbol(n, Decl(conditionalTypes1.ts, 138, 31)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 138, 41)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 138, 53)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 138, 74)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 138, 13)) zeroOf(5); // 0 ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) zeroOf("hello"); // "" ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) zeroOf(true); // false ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) zeroOf(n); // 0 ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->n : Symbol(n, Decl(conditionalTypes1.ts, 142, 31)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) +>n : Symbol(n, Decl(conditionalTypes1.ts, 138, 31)) zeroOf(b); // False ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->b : Symbol(b, Decl(conditionalTypes1.ts, 142, 41)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 138, 41)) zeroOf(x); // 0 | false ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 142, 53)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 138, 53)) zeroOf(y); // ZeroOf ->zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 136, 104)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 142, 74)) +>zeroOf : Symbol(zeroOf, Decl(conditionalTypes1.ts, 132, 104)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 138, 74)) } function f21(x: T, y: ZeroOf) { ->f21 : Symbol(f21, Decl(conditionalTypes1.ts, 150, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 152, 13)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 152, 40)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 152, 13)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) ->ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 134, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 152, 13)) +>f21 : Symbol(f21, Decl(conditionalTypes1.ts, 146, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 148, 13)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 148, 40)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 148, 13)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 148, 45)) +>ZeroOf : Symbol(ZeroOf, Decl(conditionalTypes1.ts, 130, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 148, 13)) let z1: number | string = y; ->z1 : Symbol(z1, Decl(conditionalTypes1.ts, 153, 7)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) +>z1 : Symbol(z1, Decl(conditionalTypes1.ts, 149, 7)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 148, 45)) let z2: 0 | "" = y; ->z2 : Symbol(z2, Decl(conditionalTypes1.ts, 154, 7)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) +>z2 : Symbol(z2, Decl(conditionalTypes1.ts, 150, 7)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 148, 45)) x = y; // Error ->x : Symbol(x, Decl(conditionalTypes1.ts, 152, 40)) ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 148, 40)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 148, 45)) y = x; // Error ->y : Symbol(y, Decl(conditionalTypes1.ts, 152, 45)) ->x : Symbol(x, Decl(conditionalTypes1.ts, 152, 40)) +>y : Symbol(y, Decl(conditionalTypes1.ts, 148, 45)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 148, 40)) } type Extends = T extends U ? true : false; ->Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 157, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 159, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 159, 15)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 159, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 159, 15)) +>Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 153, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 155, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 155, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 155, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 155, 15)) type If = C extends true ? T : F; ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 160, 8)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 160, 26)) ->F : Symbol(F, Decl(conditionalTypes1.ts, 160, 29)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 160, 8)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 160, 26)) ->F : Symbol(F, Decl(conditionalTypes1.ts, 160, 29)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 155, 48)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 156, 8)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 156, 26)) +>F : Symbol(F, Decl(conditionalTypes1.ts, 156, 29)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 156, 8)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 156, 26)) +>F : Symbol(F, Decl(conditionalTypes1.ts, 156, 29)) type Not = If; ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 161, 9)) ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->C : Symbol(C, Decl(conditionalTypes1.ts, 161, 9)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 156, 58)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 157, 9)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 155, 48)) +>C : Symbol(C, Decl(conditionalTypes1.ts, 157, 9)) type And = If; ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 162, 9)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 162, 27)) ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 162, 9)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 162, 27)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 158, 9)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 158, 27)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 155, 48)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 158, 9)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 158, 27)) type Or = If; ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 163, 8)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 163, 26)) ->If : Symbol(If, Decl(conditionalTypes1.ts, 159, 48)) ->A : Symbol(A, Decl(conditionalTypes1.ts, 163, 8)) ->B : Symbol(B, Decl(conditionalTypes1.ts, 163, 26)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 159, 8)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 159, 26)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 155, 48)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 159, 8)) +>B : Symbol(B, Decl(conditionalTypes1.ts, 159, 26)) type IsString = Extends; ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 165, 14)) ->Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 157, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 165, 14)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 159, 63)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 161, 14)) +>Extends : Symbol(Extends, Decl(conditionalTypes1.ts, 153, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 161, 14)) type Q1 = IsString; // false ->Q1 : Symbol(Q1, Decl(conditionalTypes1.ts, 165, 38)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q1 : Symbol(Q1, Decl(conditionalTypes1.ts, 161, 38)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 159, 63)) type Q2 = IsString<"abc">; // true ->Q2 : Symbol(Q2, Decl(conditionalTypes1.ts, 167, 27)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q2 : Symbol(Q2, Decl(conditionalTypes1.ts, 163, 27)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 159, 63)) type Q3 = IsString; // boolean ->Q3 : Symbol(Q3, Decl(conditionalTypes1.ts, 168, 26)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q3 : Symbol(Q3, Decl(conditionalTypes1.ts, 164, 26)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 159, 63)) type Q4 = IsString; // boolean ->Q4 : Symbol(Q4, Decl(conditionalTypes1.ts, 169, 24)) ->IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 163, 63)) +>Q4 : Symbol(Q4, Decl(conditionalTypes1.ts, 165, 24)) +>IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 159, 63)) type N1 = Not; // true ->N1 : Symbol(N1, Decl(conditionalTypes1.ts, 170, 26)) ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) +>N1 : Symbol(N1, Decl(conditionalTypes1.ts, 166, 26)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 156, 58)) type N2 = Not; // false ->N2 : Symbol(N2, Decl(conditionalTypes1.ts, 172, 21)) ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) +>N2 : Symbol(N2, Decl(conditionalTypes1.ts, 168, 21)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 156, 58)) type N3 = Not; // boolean ->N3 : Symbol(N3, Decl(conditionalTypes1.ts, 173, 20)) ->Not : Symbol(Not, Decl(conditionalTypes1.ts, 160, 58)) +>N3 : Symbol(N3, Decl(conditionalTypes1.ts, 169, 20)) +>Not : Symbol(Not, Decl(conditionalTypes1.ts, 156, 58)) type A1 = And; // false ->A1 : Symbol(A1, Decl(conditionalTypes1.ts, 174, 23)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A1 : Symbol(A1, Decl(conditionalTypes1.ts, 170, 23)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A2 = And; // false ->A2 : Symbol(A2, Decl(conditionalTypes1.ts, 176, 28)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A2 : Symbol(A2, Decl(conditionalTypes1.ts, 172, 28)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A3 = And; // false ->A3 : Symbol(A3, Decl(conditionalTypes1.ts, 177, 27)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A3 : Symbol(A3, Decl(conditionalTypes1.ts, 173, 27)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A4 = And; // true ->A4 : Symbol(A4, Decl(conditionalTypes1.ts, 178, 27)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A4 : Symbol(A4, Decl(conditionalTypes1.ts, 174, 27)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A5 = And; // false ->A5 : Symbol(A5, Decl(conditionalTypes1.ts, 179, 26)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A5 : Symbol(A5, Decl(conditionalTypes1.ts, 175, 26)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A6 = And; // false ->A6 : Symbol(A6, Decl(conditionalTypes1.ts, 180, 30)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A6 : Symbol(A6, Decl(conditionalTypes1.ts, 176, 30)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A7 = And; // boolean ->A7 : Symbol(A7, Decl(conditionalTypes1.ts, 181, 30)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A7 : Symbol(A7, Decl(conditionalTypes1.ts, 177, 30)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A8 = And; // boolean ->A8 : Symbol(A8, Decl(conditionalTypes1.ts, 182, 29)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A8 : Symbol(A8, Decl(conditionalTypes1.ts, 178, 29)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type A9 = And; // boolean ->A9 : Symbol(A9, Decl(conditionalTypes1.ts, 183, 29)) ->And : Symbol(And, Decl(conditionalTypes1.ts, 161, 49)) +>A9 : Symbol(A9, Decl(conditionalTypes1.ts, 179, 29)) +>And : Symbol(And, Decl(conditionalTypes1.ts, 157, 49)) type O1 = Or; // false ->O1 : Symbol(O1, Decl(conditionalTypes1.ts, 184, 32)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O1 : Symbol(O1, Decl(conditionalTypes1.ts, 180, 32)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O2 = Or; // true ->O2 : Symbol(O2, Decl(conditionalTypes1.ts, 186, 27)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O2 : Symbol(O2, Decl(conditionalTypes1.ts, 182, 27)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O3 = Or; // true ->O3 : Symbol(O3, Decl(conditionalTypes1.ts, 187, 26)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O3 : Symbol(O3, Decl(conditionalTypes1.ts, 183, 26)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O4 = Or; // true ->O4 : Symbol(O4, Decl(conditionalTypes1.ts, 188, 26)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O4 : Symbol(O4, Decl(conditionalTypes1.ts, 184, 26)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O5 = Or; // boolean ->O5 : Symbol(O5, Decl(conditionalTypes1.ts, 189, 25)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O5 : Symbol(O5, Decl(conditionalTypes1.ts, 185, 25)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O6 = Or; // boolean ->O6 : Symbol(O6, Decl(conditionalTypes1.ts, 190, 29)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O6 : Symbol(O6, Decl(conditionalTypes1.ts, 186, 29)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O7 = Or; // true ->O7 : Symbol(O7, Decl(conditionalTypes1.ts, 191, 29)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O7 : Symbol(O7, Decl(conditionalTypes1.ts, 187, 29)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O8 = Or; // true ->O8 : Symbol(O8, Decl(conditionalTypes1.ts, 192, 28)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O8 : Symbol(O8, Decl(conditionalTypes1.ts, 188, 28)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type O9 = Or; // boolean ->O9 : Symbol(O9, Decl(conditionalTypes1.ts, 193, 28)) ->Or : Symbol(Or, Decl(conditionalTypes1.ts, 162, 65)) +>O9 : Symbol(O9, Decl(conditionalTypes1.ts, 189, 28)) +>Or : Symbol(Or, Decl(conditionalTypes1.ts, 158, 65)) type T40 = never extends never ? true : false; // true ->T40 : Symbol(T40, Decl(conditionalTypes1.ts, 194, 31)) +>T40 : Symbol(T40, Decl(conditionalTypes1.ts, 190, 31)) type T41 = number extends never ? true : false; // false ->T41 : Symbol(T41, Decl(conditionalTypes1.ts, 196, 46)) +>T41 : Symbol(T41, Decl(conditionalTypes1.ts, 192, 46)) type T42 = never extends number ? true : false; // boolean ->T42 : Symbol(T42, Decl(conditionalTypes1.ts, 197, 47)) +>T42 : Symbol(T42, Decl(conditionalTypes1.ts, 193, 47)) type IsNever = T extends never ? true : false; ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 200, 13)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 200, 13)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 194, 47)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 196, 13)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 196, 13)) type T50 = IsNever; // true ->T50 : Symbol(T50, Decl(conditionalTypes1.ts, 200, 49)) ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) +>T50 : Symbol(T50, Decl(conditionalTypes1.ts, 196, 49)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 194, 47)) type T51 = IsNever; // false ->T51 : Symbol(T51, Decl(conditionalTypes1.ts, 202, 26)) ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) +>T51 : Symbol(T51, Decl(conditionalTypes1.ts, 198, 26)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 194, 47)) type T52 = IsNever; // false ->T52 : Symbol(T52, Decl(conditionalTypes1.ts, 203, 27)) ->IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 198, 47)) +>T52 : Symbol(T52, Decl(conditionalTypes1.ts, 199, 27)) +>IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 194, 47)) // Repros from #21664 type Eq = T extends U ? U extends T ? true : false : false; ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 208, 8)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 208, 10)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 208, 8)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 208, 10)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 208, 10)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 208, 8)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 200, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 204, 8)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 204, 10)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 204, 8)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 204, 10)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 204, 10)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 204, 8)) type T60 = Eq; // true ->T60 : Symbol(T60, Decl(conditionalTypes1.ts, 208, 65)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T60 : Symbol(T60, Decl(conditionalTypes1.ts, 204, 65)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 200, 24)) type T61 = Eq; // false ->T61 : Symbol(T61, Decl(conditionalTypes1.ts, 209, 26)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T61 : Symbol(T61, Decl(conditionalTypes1.ts, 205, 26)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 200, 24)) type T62 = Eq; // false ->T62 : Symbol(T62, Decl(conditionalTypes1.ts, 210, 27)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T62 : Symbol(T62, Decl(conditionalTypes1.ts, 206, 27)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 200, 24)) type T63 = Eq; // true ->T63 : Symbol(T63, Decl(conditionalTypes1.ts, 211, 27)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) +>T63 : Symbol(T63, Decl(conditionalTypes1.ts, 207, 27)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 200, 24)) type Eq1 = Eq extends false ? false : true; ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 214, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 214, 11)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 214, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 214, 11)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 208, 28)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 210, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 210, 11)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 200, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 210, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 210, 11)) type T70 = Eq1; // true ->T70 : Symbol(T70, Decl(conditionalTypes1.ts, 214, 55)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T70 : Symbol(T70, Decl(conditionalTypes1.ts, 210, 55)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 208, 28)) type T71 = Eq1; // false ->T71 : Symbol(T71, Decl(conditionalTypes1.ts, 215, 27)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T71 : Symbol(T71, Decl(conditionalTypes1.ts, 211, 27)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 208, 28)) type T72 = Eq1; // false ->T72 : Symbol(T72, Decl(conditionalTypes1.ts, 216, 28)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T72 : Symbol(T72, Decl(conditionalTypes1.ts, 212, 28)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 208, 28)) type T73 = Eq1; // true ->T73 : Symbol(T73, Decl(conditionalTypes1.ts, 217, 28)) ->Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 212, 28)) +>T73 : Symbol(T73, Decl(conditionalTypes1.ts, 213, 28)) +>Eq1 : Symbol(Eq1, Decl(conditionalTypes1.ts, 208, 28)) type Eq2 = Eq extends true ? true : false; ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 220, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 220, 11)) ->Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 204, 24)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 220, 9)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 220, 11)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 214, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 216, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 216, 11)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 200, 24)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 216, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 216, 11)) type T80 = Eq2; // true ->T80 : Symbol(T80, Decl(conditionalTypes1.ts, 220, 54)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T80 : Symbol(T80, Decl(conditionalTypes1.ts, 216, 54)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 214, 29)) type T81 = Eq2; // false ->T81 : Symbol(T81, Decl(conditionalTypes1.ts, 221, 27)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T81 : Symbol(T81, Decl(conditionalTypes1.ts, 217, 27)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 214, 29)) type T82 = Eq2; // false ->T82 : Symbol(T82, Decl(conditionalTypes1.ts, 222, 28)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T82 : Symbol(T82, Decl(conditionalTypes1.ts, 218, 28)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 214, 29)) type T83 = Eq2; // true ->T83 : Symbol(T83, Decl(conditionalTypes1.ts, 223, 28)) ->Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 218, 29)) +>T83 : Symbol(T83, Decl(conditionalTypes1.ts, 219, 28)) +>Eq2 : Symbol(Eq2, Decl(conditionalTypes1.ts, 214, 29)) // Repro from #21756 type Foo = T extends string ? boolean : number; ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 220, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 224, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 224, 9)) type Bar = T extends string ? boolean : number; ->Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 229, 9)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 229, 9)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 224, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 225, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 225, 9)) const convert = (value: Foo): Bar => value; ->convert : Symbol(convert, Decl(conditionalTypes1.ts, 230, 5)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 230, 20)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) ->Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 230, 17)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 230, 20)) +>convert : Symbol(convert, Decl(conditionalTypes1.ts, 226, 5)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 226, 17)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 226, 20)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 220, 29)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 226, 17)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 224, 50)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 226, 17)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 226, 20)) type Baz = Foo; ->Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 230, 52)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 232, 9)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 232, 9)) +>Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 226, 52)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 220, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 228, 9)) const convert2 = (value: Foo): Baz => value; ->convert2 : Symbol(convert2, Decl(conditionalTypes1.ts, 233, 5)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 233, 21)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) ->Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 230, 52)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 233, 18)) ->value : Symbol(value, Decl(conditionalTypes1.ts, 233, 21)) +>convert2 : Symbol(convert2, Decl(conditionalTypes1.ts, 229, 5)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 229, 18)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 229, 21)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 220, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 229, 18)) +>Baz : Symbol(Baz, Decl(conditionalTypes1.ts, 226, 52)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 229, 18)) +>value : Symbol(value, Decl(conditionalTypes1.ts, 229, 21)) function f31() { ->f31 : Symbol(f31, Decl(conditionalTypes1.ts, 233, 53)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) +>f31 : Symbol(f31, Decl(conditionalTypes1.ts, 229, 53)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 231, 13)) type T1 = T extends string ? boolean : number; ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 235, 19)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 231, 19)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 231, 13)) type T2 = T extends string ? boolean : number; ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 236, 50)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 235, 13)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 232, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 231, 13)) var x: T1; ->x : Symbol(x, Decl(conditionalTypes1.ts, 238, 7), Decl(conditionalTypes1.ts, 239, 7)) ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 235, 19)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 234, 7), Decl(conditionalTypes1.ts, 235, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 231, 19)) var x: T2; ->x : Symbol(x, Decl(conditionalTypes1.ts, 238, 7), Decl(conditionalTypes1.ts, 239, 7)) ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 236, 50)) +>x : Symbol(x, Decl(conditionalTypes1.ts, 234, 7), Decl(conditionalTypes1.ts, 235, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 232, 50)) } function f32() { ->f32 : Symbol(f32, Decl(conditionalTypes1.ts, 240, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) +>f32 : Symbol(f32, Decl(conditionalTypes1.ts, 236, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 238, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 238, 15)) type T1 = T & U extends string ? boolean : number; ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 22)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 238, 22)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 238, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 238, 15)) type T2 = Foo; ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 54)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 242, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 242, 15)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 239, 54)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 220, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 238, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 238, 15)) var z: T1; ->z : Symbol(z, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 242, 22)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 241, 7), Decl(conditionalTypes1.ts, 242, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 238, 22)) var z: T2; // Error, T2 is distributive, T1 isn't ->z : Symbol(z, Decl(conditionalTypes1.ts, 245, 7), Decl(conditionalTypes1.ts, 246, 7)) ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 243, 54)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 241, 7), Decl(conditionalTypes1.ts, 242, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 239, 54)) } function f33() { ->f33 : Symbol(f33, Decl(conditionalTypes1.ts, 247, 1)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) +>f33 : Symbol(f33, Decl(conditionalTypes1.ts, 243, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 245, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 245, 15)) type T1 = Foo; ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) ->Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 224, 29)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 245, 22)) +>Foo : Symbol(Foo, Decl(conditionalTypes1.ts, 220, 29)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 245, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 245, 15)) type T2 = Bar; ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 25)) ->Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 228, 50)) ->T : Symbol(T, Decl(conditionalTypes1.ts, 249, 13)) ->U : Symbol(U, Decl(conditionalTypes1.ts, 249, 15)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 246, 25)) +>Bar : Symbol(Bar, Decl(conditionalTypes1.ts, 224, 50)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 245, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 245, 15)) var z: T1; ->z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) ->T1 : Symbol(T1, Decl(conditionalTypes1.ts, 249, 22)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 248, 7), Decl(conditionalTypes1.ts, 249, 7)) +>T1 : Symbol(T1, Decl(conditionalTypes1.ts, 245, 22)) var z: T2; ->z : Symbol(z, Decl(conditionalTypes1.ts, 252, 7), Decl(conditionalTypes1.ts, 253, 7)) ->T2 : Symbol(T2, Decl(conditionalTypes1.ts, 250, 25)) +>z : Symbol(z, Decl(conditionalTypes1.ts, 248, 7), Decl(conditionalTypes1.ts, 249, 7)) +>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 246, 25)) } diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index 9c68f394094..eb17cb31350 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -1,91 +1,68 @@ === tests/cases/conformance/types/conditional/conditionalTypes1.ts === -type Diff = T extends U ? never : T; ->Diff : Diff ->T : T ->U : U ->T : T ->U : U ->T : T - -type Filter = T extends U ? T : never; ->Filter : Filter ->T : T ->U : U ->T : T ->U : U ->T : T - -type NonNullable = Diff; ->NonNullable : Diff ->T : T ->Diff : Diff ->T : T ->null : null - -type T00 = Diff<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" +type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d" >T00 : "b" | "d" ->Diff : Diff +>Exclude : Exclude -type T01 = Filter<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" +type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c" >T01 : "a" | "c" ->Filter : Filter +>Extract : Extract -type T02 = Diff void), Function>; // string | number +type T02 = Exclude void), Function>; // string | number >T02 : string | number ->Diff : Diff +>Exclude : Exclude >Function : Function -type T03 = Filter void), Function>; // () => void +type T03 = Extract void), Function>; // () => void >T03 : () => void ->Filter : Filter +>Extract : Extract >Function : Function type T04 = NonNullable; // string | number >T04 : string | number ->NonNullable : Diff +>NonNullable : NonNullable type T05 = NonNullable<(() => string) | string[] | null | undefined>; // (() => string) | string[] >T05 : (() => string) | string[] ->NonNullable : Diff +>NonNullable : NonNullable >null : null function f1(x: T, y: NonNullable) { ->f1 : (x: T, y: Diff) => void +>f1 : (x: T, y: NonNullable) => void >T : T >x : T >T : T ->y : Diff ->NonNullable : Diff +>y : NonNullable +>NonNullable : NonNullable >T : T x = y; ->x = y : Diff +>x = y : NonNullable >x : T ->y : Diff +>y : NonNullable y = x; // Error >y = x : T ->y : Diff +>y : NonNullable >x : T } function f2(x: T, y: NonNullable) { ->f2 : (x: T, y: Diff) => void +>f2 : (x: T, y: NonNullable) => void >T : T >x : T >T : T ->y : Diff ->NonNullable : Diff +>y : NonNullable +>NonNullable : NonNullable >T : T x = y; ->x = y : Diff +>x = y : NonNullable >x : T ->y : Diff +>y : NonNullable y = x; // Error >y = x : T ->y : Diff +>y : NonNullable >x : T let s1: string = x; // Error @@ -94,30 +71,30 @@ function f2(x: T, y: NonNullable) { let s2: string = y; >s2 : string ->y : Diff +>y : NonNullable } function f3(x: Partial[keyof T], y: NonNullable[keyof T]>) { ->f3 : (x: Partial[keyof T], y: Diff[keyof T], null | undefined>) => void +>f3 : (x: Partial[keyof T], y: NonNullable[keyof T]>) => void >T : T >x : Partial[keyof T] >Partial : Partial >T : T >T : T ->y : Diff[keyof T], null | undefined> ->NonNullable : Diff +>y : NonNullable[keyof T]> +>NonNullable : NonNullable >Partial : Partial >T : T >T : T x = y; ->x = y : Diff[keyof T], null | undefined> +>x = y : NonNullable[keyof T]> >x : Partial[keyof T] ->y : Diff[keyof T], null | undefined> +>y : NonNullable[keyof T]> y = x; // Error >y = x : Partial[keyof T] ->y : Diff[keyof T], null | undefined> +>y : NonNullable[keyof T]> >x : Partial[keyof T] } @@ -130,52 +107,52 @@ type Options = { k: "a", a: number } | { k: "b", b: string } | { k: "c", c: bool >k : "c" >c : boolean -type T10 = Diff; // { k: "c", c: boolean } +type T10 = Exclude; // { k: "c", c: boolean } >T10 : { k: "c"; c: boolean; } ->Diff : Diff +>Exclude : Exclude >Options : Options >k : "a" | "b" -type T11 = Filter; // { k: "a", a: number } | { k: "b", b: string } +type T11 = Extract; // { k: "a", a: number } | { k: "b", b: string } >T11 : { k: "a"; a: number; } | { k: "b"; b: string; } ->Filter : Filter +>Extract : Extract >Options : Options >k : "a" | "b" -type T12 = Diff; // { k: "c", c: boolean } +type T12 = Exclude; // { k: "c", c: boolean } >T12 : { k: "c"; c: boolean; } ->Diff : Diff +>Exclude : Exclude >Options : Options >k : "a" >k : "b" -type T13 = Filter; // { k: "a", a: number } | { k: "b", b: string } +type T13 = Extract; // { k: "a", a: number } | { k: "b", b: string } >T13 : { k: "a"; a: number; } | { k: "b"; b: string; } ->Filter : Filter +>Extract : Extract >Options : Options >k : "a" >k : "b" -type T14 = Diff; // Options +type T14 = Exclude; // Options >T14 : Options ->Diff : Diff +>Exclude : Exclude >Options : Options >q : "a" -type T15 = Filter; // never +type T15 = Extract; // never >T15 : never ->Filter : Filter +>Extract : Extract >Options : Options >q : "a" -declare function f4(p: K): Filter; ->f4 : (p: K) => Filter +declare function f4(p: K): Extract; +>f4 : (p: K) => Extract >T : T >Options : Options >K : K >p : K >K : K ->Filter : Filter +>Extract : Extract >T : T >k : K >K : K @@ -183,31 +160,31 @@ declare function f4(p: K): Filterx0 : { k: "a"; a: number; } >f4("a") : { k: "a"; a: number; } ->f4 : (p: K) => Filter +>f4 : (p: K) => Extract >"a" : "a" -type OptionsOfKind = Filter; ->OptionsOfKind : Filter<{ k: "a"; a: number; }, { k: K; }> | Filter<{ k: "b"; b: string; }, { k: K; }> | Filter<{ k: "c"; c: boolean; }, { k: K; }> +type OptionsOfKind = Extract; +>OptionsOfKind : Extract<{ k: "a"; a: number; }, { k: K; }> | Extract<{ k: "b"; b: string; }, { k: K; }> | Extract<{ k: "c"; c: boolean; }, { k: K; }> >K : K >Options : Options ->Filter : Filter +>Extract : Extract >Options : Options >k : K >K : K type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string } >T16 : { k: "a"; a: number; } | { k: "b"; b: string; } ->OptionsOfKind : Filter<{ k: "a"; a: number; }, { k: K; }> | Filter<{ k: "b"; b: string; }, { k: K; }> | Filter<{ k: "c"; c: boolean; }, { k: K; }> +>OptionsOfKind : Extract<{ k: "a"; a: number; }, { k: K; }> | Extract<{ k: "b"; b: string; }, { k: K; }> | Extract<{ k: "c"; c: boolean; }, { k: K; }> -type Select = Filter; ->Select : Filter +type Select = Extract; +>Select : Extract >T : T >K : K >T : T >V : V >T : T >K : K ->Filter : Filter +>Extract : Extract >T : T >P : P >K : K @@ -215,7 +192,7 @@ type Select = Filter; type T17 = Select; // // { k: "a", a: number } | { k: "b", b: string } >T17 : { k: "a"; a: number; } | { k: "b"; b: string; } ->Select : Filter +>Select : Extract >Options : Options type TypeName = diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 80edc31d37c..acc4b9029b1 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -1,21 +1,26 @@ -tests/cases/conformance/types/conditional/inferTypes1.ts(34,23): error TS2344: Type 'string' does not satisfy the constraint 'Function'. -tests/cases/conformance/types/conditional/inferTypes1.ts(43,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. -tests/cases/conformance/types/conditional/inferTypes1.ts(44,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(31,23): error TS2344: Type 'string' does not satisfy the constraint '(...args: any[]) => any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(32,23): error TS2344: Type 'Function' does not satisfy the constraint '(...args: any[]) => any'. + Type 'Function' provides no match for the signature '(...args: any[]): any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(37,25): error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any[]) => any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(38,25): error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any[]) => any'. + Type 'Function' provides no match for the signature 'new (...args: any[]): any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(46,25): error TS2344: Type '(x: string, y: string) => number' does not satisfy the constraint '(x: any) => any'. +tests/cases/conformance/types/conditional/inferTypes1.ts(47,25): error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. Type 'Function' provides no match for the signature '(x: any): any'. -tests/cases/conformance/types/conditional/inferTypes1.ts(70,12): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. -tests/cases/conformance/types/conditional/inferTypes1.ts(71,15): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. -tests/cases/conformance/types/conditional/inferTypes1.ts(71,41): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. -tests/cases/conformance/types/conditional/inferTypes1.ts(71,51): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. -tests/cases/conformance/types/conditional/inferTypes1.ts(72,15): error TS2304: Cannot find name 'U'. -tests/cases/conformance/types/conditional/inferTypes1.ts(72,15): error TS4081: Exported type alias 'T62' has or is using private name 'U'. -tests/cases/conformance/types/conditional/inferTypes1.ts(72,43): error TS2304: Cannot find name 'U'. -tests/cases/conformance/types/conditional/inferTypes1.ts(72,43): error TS4081: Exported type alias 'T62' has or is using private name 'U'. -tests/cases/conformance/types/conditional/inferTypes1.ts(78,44): error TS2344: Type 'U' does not satisfy the constraint 'string'. +tests/cases/conformance/types/conditional/inferTypes1.ts(73,12): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. +tests/cases/conformance/types/conditional/inferTypes1.ts(74,15): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. +tests/cases/conformance/types/conditional/inferTypes1.ts(74,41): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. +tests/cases/conformance/types/conditional/inferTypes1.ts(74,51): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type. +tests/cases/conformance/types/conditional/inferTypes1.ts(75,15): error TS2304: Cannot find name 'U'. +tests/cases/conformance/types/conditional/inferTypes1.ts(75,15): error TS4081: Exported type alias 'T62' has or is using private name 'U'. +tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS2304: Cannot find name 'U'. +tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS4081: Exported type alias 'T62' has or is using private name 'U'. +tests/cases/conformance/types/conditional/inferTypes1.ts(81,44): error TS2344: Type 'U' does not satisfy the constraint 'string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/conditional/inferTypes1.ts(131,40): error TS2322: Type 'T' is not assignable to type 'string'. +tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: Type 'T' is not assignable to type 'string'. -==== tests/cases/conformance/types/conditional/inferTypes1.ts (13 errors) ==== +==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ==== type Unpacked = T extends (infer U)[] ? U : T extends (...args: any[]) => infer U ? U : @@ -30,8 +35,6 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(131,40): error TS2322: type T05 = Unpacked; // any type T06 = Unpacked; // never - type ReturnType = T extends ((...args: any[]) => infer R) | (new (...args: any[]) => infer R) ? R : any; - function f1(s: string) { return { a: 1, b: s }; } @@ -46,13 +49,26 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(131,40): error TS2322: type T12 = ReturnType<(() => T)>; // {} type T13 = ReturnType<(() => T)>; // number[] type T14 = ReturnType; // { a: number, b: string } - type T15 = ReturnType; // C - type T16 = ReturnType; // any - type T17 = ReturnType; // any - type T18 = ReturnType; // Error + type T15 = ReturnType; // any + type T16 = ReturnType; // any + type T17 = ReturnType; // Error ~~~~~~ -!!! error TS2344: Type 'string' does not satisfy the constraint 'Function'. - type T19 = ReturnType; // any +!!! error TS2344: Type 'string' does not satisfy the constraint '(...args: any[]) => any'. + type T18 = ReturnType; // Error + ~~~~~~~~ +!!! error TS2344: Type 'Function' does not satisfy the constraint '(...args: any[]) => any'. +!!! error TS2344: Type 'Function' provides no match for the signature '(...args: any[]): any'. + + type U10 = InstanceType; // C + type U11 = InstanceType; // any + type U12 = InstanceType; // any + type U13 = InstanceType; // Error + ~~~~~~ +!!! error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any[]) => any'. + type U14 = InstanceType; // Error + ~~~~~~~~ +!!! error TS2344: Type 'Function' does not satisfy the constraint 'new (...args: any[]) => any'. +!!! error TS2344: Type 'Function' provides no match for the signature 'new (...args: any[]): any'. type ArgumentType any> = T extends (a: infer A) => any ? A : any; diff --git a/tests/baselines/reference/inferTypes1.js b/tests/baselines/reference/inferTypes1.js index 21cada9c71b..146acdc1ce7 100644 --- a/tests/baselines/reference/inferTypes1.js +++ b/tests/baselines/reference/inferTypes1.js @@ -13,8 +13,6 @@ type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any type T06 = Unpacked; // never -type ReturnType = T extends ((...args: any[]) => infer R) | (new (...args: any[]) => infer R) ? R : any; - function f1(s: string) { return { a: 1, b: s }; } @@ -29,11 +27,16 @@ type T11 = ReturnType<(s: string) => void>; // void type T12 = ReturnType<(() => T)>; // {} type T13 = ReturnType<(() => T)>; // number[] type T14 = ReturnType; // { a: number, b: string } -type T15 = ReturnType; // C -type T16 = ReturnType; // any -type T17 = ReturnType; // any -type T18 = ReturnType; // Error -type T19 = ReturnType; // any +type T15 = ReturnType; // any +type T16 = ReturnType; // any +type T17 = ReturnType; // Error +type T18 = ReturnType; // Error + +type U10 = InstanceType; // C +type U11 = InstanceType; // any +type U12 = InstanceType; // any +type U13 = InstanceType; // Error +type U14 = InstanceType; // Error type ArgumentType any> = T extends (a: infer A) => any ? A : any; diff --git a/tests/baselines/reference/inferTypes1.symbols b/tests/baselines/reference/inferTypes1.symbols index 6e8a9670f29..138f60aaf49 100644 --- a/tests/baselines/reference/inferTypes1.symbols +++ b/tests/baselines/reference/inferTypes1.symbols @@ -54,518 +54,524 @@ type T06 = Unpacked; // never >T06 : Symbol(T06, Decl(inferTypes1.ts, 11, 25)) >Unpacked : Symbol(Unpacked, Decl(inferTypes1.ts, 0, 0)) -type ReturnType = T extends ((...args: any[]) => infer R) | (new (...args: any[]) => infer R) ? R : any; ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) ->T : Symbol(T, Decl(inferTypes1.ts, 14, 16)) ->Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->T : Symbol(T, Decl(inferTypes1.ts, 14, 16)) ->args : Symbol(args, Decl(inferTypes1.ts, 14, 50)) ->R : Symbol(R, Decl(inferTypes1.ts, 14, 74), Decl(inferTypes1.ts, 14, 110)) ->args : Symbol(args, Decl(inferTypes1.ts, 14, 86)) ->R : Symbol(R, Decl(inferTypes1.ts, 14, 74), Decl(inferTypes1.ts, 14, 110)) ->R : Symbol(R, Decl(inferTypes1.ts, 14, 74), Decl(inferTypes1.ts, 14, 110)) - function f1(s: string) { ->f1 : Symbol(f1, Decl(inferTypes1.ts, 14, 124)) ->s : Symbol(s, Decl(inferTypes1.ts, 16, 12)) +>f1 : Symbol(f1, Decl(inferTypes1.ts, 12, 27)) +>s : Symbol(s, Decl(inferTypes1.ts, 14, 12)) return { a: 1, b: s }; ->a : Symbol(a, Decl(inferTypes1.ts, 17, 12)) ->b : Symbol(b, Decl(inferTypes1.ts, 17, 18)) ->s : Symbol(s, Decl(inferTypes1.ts, 16, 12)) +>a : Symbol(a, Decl(inferTypes1.ts, 15, 12)) +>b : Symbol(b, Decl(inferTypes1.ts, 15, 18)) +>s : Symbol(s, Decl(inferTypes1.ts, 14, 12)) } class C { ->C : Symbol(C, Decl(inferTypes1.ts, 18, 1)) +>C : Symbol(C, Decl(inferTypes1.ts, 16, 1)) x = 0; ->x : Symbol(C.x, Decl(inferTypes1.ts, 20, 9)) +>x : Symbol(C.x, Decl(inferTypes1.ts, 18, 9)) y = 0; ->y : Symbol(C.y, Decl(inferTypes1.ts, 21, 10)) +>y : Symbol(C.y, Decl(inferTypes1.ts, 19, 10)) } type T10 = ReturnType<() => string>; // string ->T10 : Symbol(T10, Decl(inferTypes1.ts, 23, 1)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) +>T10 : Symbol(T10, Decl(inferTypes1.ts, 21, 1)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) type T11 = ReturnType<(s: string) => void>; // void ->T11 : Symbol(T11, Decl(inferTypes1.ts, 25, 36)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) ->s : Symbol(s, Decl(inferTypes1.ts, 26, 23)) +>T11 : Symbol(T11, Decl(inferTypes1.ts, 23, 36)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) +>s : Symbol(s, Decl(inferTypes1.ts, 24, 23)) type T12 = ReturnType<(() => T)>; // {} ->T12 : Symbol(T12, Decl(inferTypes1.ts, 26, 43)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) ->T : Symbol(T, Decl(inferTypes1.ts, 27, 24)) ->T : Symbol(T, Decl(inferTypes1.ts, 27, 24)) +>T12 : Symbol(T12, Decl(inferTypes1.ts, 24, 43)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(inferTypes1.ts, 25, 24)) +>T : Symbol(T, Decl(inferTypes1.ts, 25, 24)) type T13 = ReturnType<(() => T)>; // number[] ->T13 : Symbol(T13, Decl(inferTypes1.ts, 27, 36)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) ->T : Symbol(T, Decl(inferTypes1.ts, 28, 24)) ->U : Symbol(U, Decl(inferTypes1.ts, 28, 36)) ->U : Symbol(U, Decl(inferTypes1.ts, 28, 36)) ->T : Symbol(T, Decl(inferTypes1.ts, 28, 24)) +>T13 : Symbol(T13, Decl(inferTypes1.ts, 25, 36)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(inferTypes1.ts, 26, 24)) +>U : Symbol(U, Decl(inferTypes1.ts, 26, 36)) +>U : Symbol(U, Decl(inferTypes1.ts, 26, 36)) +>T : Symbol(T, Decl(inferTypes1.ts, 26, 24)) type T14 = ReturnType; // { a: number, b: string } ->T14 : Symbol(T14, Decl(inferTypes1.ts, 28, 66)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) ->f1 : Symbol(f1, Decl(inferTypes1.ts, 14, 124)) +>T14 : Symbol(T14, Decl(inferTypes1.ts, 26, 66)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) +>f1 : Symbol(f1, Decl(inferTypes1.ts, 12, 27)) -type T15 = ReturnType; // C ->T15 : Symbol(T15, Decl(inferTypes1.ts, 29, 33)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) ->C : Symbol(C, Decl(inferTypes1.ts, 18, 1)) +type T15 = ReturnType; // any +>T15 : Symbol(T15, Decl(inferTypes1.ts, 27, 33)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) -type T16 = ReturnType; // any ->T16 : Symbol(T16, Decl(inferTypes1.ts, 30, 32)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) +type T16 = ReturnType; // any +>T16 : Symbol(T16, Decl(inferTypes1.ts, 28, 27)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) -type T17 = ReturnType; // any ->T17 : Symbol(T17, Decl(inferTypes1.ts, 31, 27)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) +type T17 = ReturnType; // Error +>T17 : Symbol(T17, Decl(inferTypes1.ts, 29, 29)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) -type T18 = ReturnType; // Error ->T18 : Symbol(T18, Decl(inferTypes1.ts, 32, 29)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) +type T18 = ReturnType; // Error +>T18 : Symbol(T18, Decl(inferTypes1.ts, 30, 30)) +>ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) -type T19 = ReturnType; // any ->T19 : Symbol(T19, Decl(inferTypes1.ts, 33, 30)) ->ReturnType : Symbol(ReturnType, Decl(inferTypes1.ts, 12, 27)) +type U10 = InstanceType; // C +>U10 : Symbol(U10, Decl(inferTypes1.ts, 31, 32)) +>InstanceType : Symbol(InstanceType, Decl(lib.d.ts, --, --)) +>C : Symbol(C, Decl(inferTypes1.ts, 16, 1)) + +type U11 = InstanceType; // any +>U11 : Symbol(U11, Decl(inferTypes1.ts, 33, 34)) +>InstanceType : Symbol(InstanceType, Decl(lib.d.ts, --, --)) + +type U12 = InstanceType; // any +>U12 : Symbol(U12, Decl(inferTypes1.ts, 34, 29)) +>InstanceType : Symbol(InstanceType, Decl(lib.d.ts, --, --)) + +type U13 = InstanceType; // Error +>U13 : Symbol(U13, Decl(inferTypes1.ts, 35, 31)) +>InstanceType : Symbol(InstanceType, Decl(lib.d.ts, --, --)) + +type U14 = InstanceType; // Error +>U14 : Symbol(U14, Decl(inferTypes1.ts, 36, 32)) +>InstanceType : Symbol(InstanceType, Decl(lib.d.ts, --, --)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type ArgumentType any> = T extends (a: infer A) => any ? A : any; ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) ->T : Symbol(T, Decl(inferTypes1.ts, 36, 18)) ->x : Symbol(x, Decl(inferTypes1.ts, 36, 29)) ->T : Symbol(T, Decl(inferTypes1.ts, 36, 18)) ->a : Symbol(a, Decl(inferTypes1.ts, 36, 58)) ->A : Symbol(A, Decl(inferTypes1.ts, 36, 66)) ->A : Symbol(A, Decl(inferTypes1.ts, 36, 66)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) +>T : Symbol(T, Decl(inferTypes1.ts, 39, 18)) +>x : Symbol(x, Decl(inferTypes1.ts, 39, 29)) +>T : Symbol(T, Decl(inferTypes1.ts, 39, 18)) +>a : Symbol(a, Decl(inferTypes1.ts, 39, 58)) +>A : Symbol(A, Decl(inferTypes1.ts, 39, 66)) +>A : Symbol(A, Decl(inferTypes1.ts, 39, 66)) type T20 = ArgumentType<() => void>; // never ->T20 : Symbol(T20, Decl(inferTypes1.ts, 36, 87)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) +>T20 : Symbol(T20, Decl(inferTypes1.ts, 39, 87)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) type T21 = ArgumentType<(x: string) => number>; // string ->T21 : Symbol(T21, Decl(inferTypes1.ts, 38, 36)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) ->x : Symbol(x, Decl(inferTypes1.ts, 39, 25)) +>T21 : Symbol(T21, Decl(inferTypes1.ts, 41, 36)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) +>x : Symbol(x, Decl(inferTypes1.ts, 42, 25)) type T22 = ArgumentType<(x?: string) => number>; // string | undefined ->T22 : Symbol(T22, Decl(inferTypes1.ts, 39, 47)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) ->x : Symbol(x, Decl(inferTypes1.ts, 40, 25)) +>T22 : Symbol(T22, Decl(inferTypes1.ts, 42, 47)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) +>x : Symbol(x, Decl(inferTypes1.ts, 43, 25)) type T23 = ArgumentType<(...args: string[]) => number>; // string ->T23 : Symbol(T23, Decl(inferTypes1.ts, 40, 48)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) ->args : Symbol(args, Decl(inferTypes1.ts, 41, 25)) +>T23 : Symbol(T23, Decl(inferTypes1.ts, 43, 48)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) +>args : Symbol(args, Decl(inferTypes1.ts, 44, 25)) type T24 = ArgumentType<(x: string, y: string) => number>; // Error ->T24 : Symbol(T24, Decl(inferTypes1.ts, 41, 55)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) ->x : Symbol(x, Decl(inferTypes1.ts, 42, 25)) ->y : Symbol(y, Decl(inferTypes1.ts, 42, 35)) +>T24 : Symbol(T24, Decl(inferTypes1.ts, 44, 55)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) +>x : Symbol(x, Decl(inferTypes1.ts, 45, 25)) +>y : Symbol(y, Decl(inferTypes1.ts, 45, 35)) type T25 = ArgumentType; // Error ->T25 : Symbol(T25, Decl(inferTypes1.ts, 42, 58)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) +>T25 : Symbol(T25, Decl(inferTypes1.ts, 45, 58)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type T26 = ArgumentType; // any ->T26 : Symbol(T26, Decl(inferTypes1.ts, 43, 34)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) +>T26 : Symbol(T26, Decl(inferTypes1.ts, 46, 34)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) type T27 = ArgumentType; // any ->T27 : Symbol(T27, Decl(inferTypes1.ts, 44, 29)) ->ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 34, 32)) +>T27 : Symbol(T27, Decl(inferTypes1.ts, 47, 29)) +>ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) type X1 = T extends { x: infer X, y: infer Y } ? [X, Y] : any; ->X1 : Symbol(X1, Decl(inferTypes1.ts, 45, 31)) ->T : Symbol(T, Decl(inferTypes1.ts, 47, 8)) ->x : Symbol(x, Decl(inferTypes1.ts, 47, 19)) ->y : Symbol(y, Decl(inferTypes1.ts, 47, 27)) ->T : Symbol(T, Decl(inferTypes1.ts, 47, 8)) ->x : Symbol(x, Decl(inferTypes1.ts, 47, 51)) ->X : Symbol(X, Decl(inferTypes1.ts, 47, 60)) ->y : Symbol(y, Decl(inferTypes1.ts, 47, 63)) ->Y : Symbol(Y, Decl(inferTypes1.ts, 47, 72)) ->X : Symbol(X, Decl(inferTypes1.ts, 47, 60)) ->Y : Symbol(Y, Decl(inferTypes1.ts, 47, 72)) +>X1 : Symbol(X1, Decl(inferTypes1.ts, 48, 31)) +>T : Symbol(T, Decl(inferTypes1.ts, 50, 8)) +>x : Symbol(x, Decl(inferTypes1.ts, 50, 19)) +>y : Symbol(y, Decl(inferTypes1.ts, 50, 27)) +>T : Symbol(T, Decl(inferTypes1.ts, 50, 8)) +>x : Symbol(x, Decl(inferTypes1.ts, 50, 51)) +>X : Symbol(X, Decl(inferTypes1.ts, 50, 60)) +>y : Symbol(y, Decl(inferTypes1.ts, 50, 63)) +>Y : Symbol(Y, Decl(inferTypes1.ts, 50, 72)) +>X : Symbol(X, Decl(inferTypes1.ts, 50, 60)) +>Y : Symbol(Y, Decl(inferTypes1.ts, 50, 72)) type T30 = X1<{ x: any, y: any }>; // [any, any] ->T30 : Symbol(T30, Decl(inferTypes1.ts, 47, 92)) ->X1 : Symbol(X1, Decl(inferTypes1.ts, 45, 31)) ->x : Symbol(x, Decl(inferTypes1.ts, 49, 15)) ->y : Symbol(y, Decl(inferTypes1.ts, 49, 23)) +>T30 : Symbol(T30, Decl(inferTypes1.ts, 50, 92)) +>X1 : Symbol(X1, Decl(inferTypes1.ts, 48, 31)) +>x : Symbol(x, Decl(inferTypes1.ts, 52, 15)) +>y : Symbol(y, Decl(inferTypes1.ts, 52, 23)) type T31 = X1<{ x: number, y: string }>; // [number, string] ->T31 : Symbol(T31, Decl(inferTypes1.ts, 49, 34)) ->X1 : Symbol(X1, Decl(inferTypes1.ts, 45, 31)) ->x : Symbol(x, Decl(inferTypes1.ts, 50, 15)) ->y : Symbol(y, Decl(inferTypes1.ts, 50, 26)) +>T31 : Symbol(T31, Decl(inferTypes1.ts, 52, 34)) +>X1 : Symbol(X1, Decl(inferTypes1.ts, 48, 31)) +>x : Symbol(x, Decl(inferTypes1.ts, 53, 15)) +>y : Symbol(y, Decl(inferTypes1.ts, 53, 26)) type T32 = X1<{ x: number, y: string, z: boolean }>; // [number, string] ->T32 : Symbol(T32, Decl(inferTypes1.ts, 50, 40)) ->X1 : Symbol(X1, Decl(inferTypes1.ts, 45, 31)) ->x : Symbol(x, Decl(inferTypes1.ts, 51, 15)) ->y : Symbol(y, Decl(inferTypes1.ts, 51, 26)) ->z : Symbol(z, Decl(inferTypes1.ts, 51, 37)) +>T32 : Symbol(T32, Decl(inferTypes1.ts, 53, 40)) +>X1 : Symbol(X1, Decl(inferTypes1.ts, 48, 31)) +>x : Symbol(x, Decl(inferTypes1.ts, 54, 15)) +>y : Symbol(y, Decl(inferTypes1.ts, 54, 26)) +>z : Symbol(z, Decl(inferTypes1.ts, 54, 37)) type X2 = T extends { a: infer U, b: infer U } ? U : never; ->X2 : Symbol(X2, Decl(inferTypes1.ts, 51, 52)) ->T : Symbol(T, Decl(inferTypes1.ts, 53, 8)) ->T : Symbol(T, Decl(inferTypes1.ts, 53, 8)) ->a : Symbol(a, Decl(inferTypes1.ts, 53, 24)) ->U : Symbol(U, Decl(inferTypes1.ts, 53, 33), Decl(inferTypes1.ts, 53, 45)) ->b : Symbol(b, Decl(inferTypes1.ts, 53, 36)) ->U : Symbol(U, Decl(inferTypes1.ts, 53, 33), Decl(inferTypes1.ts, 53, 45)) ->U : Symbol(U, Decl(inferTypes1.ts, 53, 33), Decl(inferTypes1.ts, 53, 45)) +>X2 : Symbol(X2, Decl(inferTypes1.ts, 54, 52)) +>T : Symbol(T, Decl(inferTypes1.ts, 56, 8)) +>T : Symbol(T, Decl(inferTypes1.ts, 56, 8)) +>a : Symbol(a, Decl(inferTypes1.ts, 56, 24)) +>U : Symbol(U, Decl(inferTypes1.ts, 56, 33), Decl(inferTypes1.ts, 56, 45)) +>b : Symbol(b, Decl(inferTypes1.ts, 56, 36)) +>U : Symbol(U, Decl(inferTypes1.ts, 56, 33), Decl(inferTypes1.ts, 56, 45)) +>U : Symbol(U, Decl(inferTypes1.ts, 56, 33), Decl(inferTypes1.ts, 56, 45)) type T40 = X2<{}>; // never ->T40 : Symbol(T40, Decl(inferTypes1.ts, 53, 62)) ->X2 : Symbol(X2, Decl(inferTypes1.ts, 51, 52)) +>T40 : Symbol(T40, Decl(inferTypes1.ts, 56, 62)) +>X2 : Symbol(X2, Decl(inferTypes1.ts, 54, 52)) type T41 = X2<{ a: string }>; // never ->T41 : Symbol(T41, Decl(inferTypes1.ts, 55, 18)) ->X2 : Symbol(X2, Decl(inferTypes1.ts, 51, 52)) ->a : Symbol(a, Decl(inferTypes1.ts, 56, 15)) +>T41 : Symbol(T41, Decl(inferTypes1.ts, 58, 18)) +>X2 : Symbol(X2, Decl(inferTypes1.ts, 54, 52)) +>a : Symbol(a, Decl(inferTypes1.ts, 59, 15)) type T42 = X2<{ a: string, b: string }>; // string ->T42 : Symbol(T42, Decl(inferTypes1.ts, 56, 29)) ->X2 : Symbol(X2, Decl(inferTypes1.ts, 51, 52)) ->a : Symbol(a, Decl(inferTypes1.ts, 57, 15)) ->b : Symbol(b, Decl(inferTypes1.ts, 57, 26)) +>T42 : Symbol(T42, Decl(inferTypes1.ts, 59, 29)) +>X2 : Symbol(X2, Decl(inferTypes1.ts, 54, 52)) +>a : Symbol(a, Decl(inferTypes1.ts, 60, 15)) +>b : Symbol(b, Decl(inferTypes1.ts, 60, 26)) type T43 = X2<{ a: number, b: string }>; // string | number ->T43 : Symbol(T43, Decl(inferTypes1.ts, 57, 40)) ->X2 : Symbol(X2, Decl(inferTypes1.ts, 51, 52)) ->a : Symbol(a, Decl(inferTypes1.ts, 58, 15)) ->b : Symbol(b, Decl(inferTypes1.ts, 58, 26)) +>T43 : Symbol(T43, Decl(inferTypes1.ts, 60, 40)) +>X2 : Symbol(X2, Decl(inferTypes1.ts, 54, 52)) +>a : Symbol(a, Decl(inferTypes1.ts, 61, 15)) +>b : Symbol(b, Decl(inferTypes1.ts, 61, 26)) type T44 = X2<{ a: number, b: string, c: boolean }>; // string | number ->T44 : Symbol(T44, Decl(inferTypes1.ts, 58, 40)) ->X2 : Symbol(X2, Decl(inferTypes1.ts, 51, 52)) ->a : Symbol(a, Decl(inferTypes1.ts, 59, 15)) ->b : Symbol(b, Decl(inferTypes1.ts, 59, 26)) ->c : Symbol(c, Decl(inferTypes1.ts, 59, 37)) +>T44 : Symbol(T44, Decl(inferTypes1.ts, 61, 40)) +>X2 : Symbol(X2, Decl(inferTypes1.ts, 54, 52)) +>a : Symbol(a, Decl(inferTypes1.ts, 62, 15)) +>b : Symbol(b, Decl(inferTypes1.ts, 62, 26)) +>c : Symbol(c, Decl(inferTypes1.ts, 62, 37)) type X3 = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U : never; ->X3 : Symbol(X3, Decl(inferTypes1.ts, 59, 52)) ->T : Symbol(T, Decl(inferTypes1.ts, 61, 8)) ->T : Symbol(T, Decl(inferTypes1.ts, 61, 8)) ->a : Symbol(a, Decl(inferTypes1.ts, 61, 24)) ->x : Symbol(x, Decl(inferTypes1.ts, 61, 29)) ->U : Symbol(U, Decl(inferTypes1.ts, 61, 37), Decl(inferTypes1.ts, 61, 62)) ->b : Symbol(b, Decl(inferTypes1.ts, 61, 49)) ->x : Symbol(x, Decl(inferTypes1.ts, 61, 54)) ->U : Symbol(U, Decl(inferTypes1.ts, 61, 37), Decl(inferTypes1.ts, 61, 62)) ->U : Symbol(U, Decl(inferTypes1.ts, 61, 37), Decl(inferTypes1.ts, 61, 62)) +>X3 : Symbol(X3, Decl(inferTypes1.ts, 62, 52)) +>T : Symbol(T, Decl(inferTypes1.ts, 64, 8)) +>T : Symbol(T, Decl(inferTypes1.ts, 64, 8)) +>a : Symbol(a, Decl(inferTypes1.ts, 64, 24)) +>x : Symbol(x, Decl(inferTypes1.ts, 64, 29)) +>U : Symbol(U, Decl(inferTypes1.ts, 64, 37), Decl(inferTypes1.ts, 64, 62)) +>b : Symbol(b, Decl(inferTypes1.ts, 64, 49)) +>x : Symbol(x, Decl(inferTypes1.ts, 64, 54)) +>U : Symbol(U, Decl(inferTypes1.ts, 64, 37), Decl(inferTypes1.ts, 64, 62)) +>U : Symbol(U, Decl(inferTypes1.ts, 64, 37), Decl(inferTypes1.ts, 64, 62)) type T50 = X3<{}>; // never ->T50 : Symbol(T50, Decl(inferTypes1.ts, 61, 88)) ->X3 : Symbol(X3, Decl(inferTypes1.ts, 59, 52)) +>T50 : Symbol(T50, Decl(inferTypes1.ts, 64, 88)) +>X3 : Symbol(X3, Decl(inferTypes1.ts, 62, 52)) type T51 = X3<{ a: (x: string) => void }>; // never ->T51 : Symbol(T51, Decl(inferTypes1.ts, 63, 18)) ->X3 : Symbol(X3, Decl(inferTypes1.ts, 59, 52)) ->a : Symbol(a, Decl(inferTypes1.ts, 64, 15)) ->x : Symbol(x, Decl(inferTypes1.ts, 64, 20)) - -type T52 = X3<{ a: (x: string) => void, b: (x: string) => void }>; // string ->T52 : Symbol(T52, Decl(inferTypes1.ts, 64, 42)) ->X3 : Symbol(X3, Decl(inferTypes1.ts, 59, 52)) ->a : Symbol(a, Decl(inferTypes1.ts, 65, 15)) ->x : Symbol(x, Decl(inferTypes1.ts, 65, 20)) ->b : Symbol(b, Decl(inferTypes1.ts, 65, 39)) ->x : Symbol(x, Decl(inferTypes1.ts, 65, 44)) - -type T53 = X3<{ a: (x: number) => void, b: (x: string) => void }>; // string & number ->T53 : Symbol(T53, Decl(inferTypes1.ts, 65, 66)) ->X3 : Symbol(X3, Decl(inferTypes1.ts, 59, 52)) ->a : Symbol(a, Decl(inferTypes1.ts, 66, 15)) ->x : Symbol(x, Decl(inferTypes1.ts, 66, 20)) ->b : Symbol(b, Decl(inferTypes1.ts, 66, 39)) ->x : Symbol(x, Decl(inferTypes1.ts, 66, 44)) - -type T54 = X3<{ a: (x: number) => void, b: () => void }>; // number ->T54 : Symbol(T54, Decl(inferTypes1.ts, 66, 66)) ->X3 : Symbol(X3, Decl(inferTypes1.ts, 59, 52)) +>T51 : Symbol(T51, Decl(inferTypes1.ts, 66, 18)) +>X3 : Symbol(X3, Decl(inferTypes1.ts, 62, 52)) >a : Symbol(a, Decl(inferTypes1.ts, 67, 15)) >x : Symbol(x, Decl(inferTypes1.ts, 67, 20)) ->b : Symbol(b, Decl(inferTypes1.ts, 67, 39)) + +type T52 = X3<{ a: (x: string) => void, b: (x: string) => void }>; // string +>T52 : Symbol(T52, Decl(inferTypes1.ts, 67, 42)) +>X3 : Symbol(X3, Decl(inferTypes1.ts, 62, 52)) +>a : Symbol(a, Decl(inferTypes1.ts, 68, 15)) +>x : Symbol(x, Decl(inferTypes1.ts, 68, 20)) +>b : Symbol(b, Decl(inferTypes1.ts, 68, 39)) +>x : Symbol(x, Decl(inferTypes1.ts, 68, 44)) + +type T53 = X3<{ a: (x: number) => void, b: (x: string) => void }>; // string & number +>T53 : Symbol(T53, Decl(inferTypes1.ts, 68, 66)) +>X3 : Symbol(X3, Decl(inferTypes1.ts, 62, 52)) +>a : Symbol(a, Decl(inferTypes1.ts, 69, 15)) +>x : Symbol(x, Decl(inferTypes1.ts, 69, 20)) +>b : Symbol(b, Decl(inferTypes1.ts, 69, 39)) +>x : Symbol(x, Decl(inferTypes1.ts, 69, 44)) + +type T54 = X3<{ a: (x: number) => void, b: () => void }>; // number +>T54 : Symbol(T54, Decl(inferTypes1.ts, 69, 66)) +>X3 : Symbol(X3, Decl(inferTypes1.ts, 62, 52)) +>a : Symbol(a, Decl(inferTypes1.ts, 70, 15)) +>x : Symbol(x, Decl(inferTypes1.ts, 70, 20)) +>b : Symbol(b, Decl(inferTypes1.ts, 70, 39)) type T60 = infer U; // Error ->T60 : Symbol(T60, Decl(inferTypes1.ts, 67, 57)) ->U : Symbol(U, Decl(inferTypes1.ts, 69, 16)) +>T60 : Symbol(T60, Decl(inferTypes1.ts, 70, 57)) +>U : Symbol(U, Decl(inferTypes1.ts, 72, 16)) type T61 = infer A extends infer B ? infer C : infer D; // Error ->T61 : Symbol(T61, Decl(inferTypes1.ts, 69, 19)) ->T : Symbol(T, Decl(inferTypes1.ts, 70, 9)) ->A : Symbol(A, Decl(inferTypes1.ts, 70, 19)) ->B : Symbol(B, Decl(inferTypes1.ts, 70, 35)) ->C : Symbol(C, Decl(inferTypes1.ts, 70, 45)) ->D : Symbol(D, Decl(inferTypes1.ts, 70, 55)) +>T61 : Symbol(T61, Decl(inferTypes1.ts, 72, 19)) +>T : Symbol(T, Decl(inferTypes1.ts, 73, 9)) +>A : Symbol(A, Decl(inferTypes1.ts, 73, 19)) +>B : Symbol(B, Decl(inferTypes1.ts, 73, 35)) +>C : Symbol(C, Decl(inferTypes1.ts, 73, 45)) +>D : Symbol(D, Decl(inferTypes1.ts, 73, 55)) type T62 = U extends (infer U)[] ? U : U; // Error ->T62 : Symbol(T62, Decl(inferTypes1.ts, 70, 58)) ->T : Symbol(T, Decl(inferTypes1.ts, 71, 9)) ->U : Symbol(U, Decl(inferTypes1.ts, 71, 30)) ->U : Symbol(U, Decl(inferTypes1.ts, 71, 30)) +>T62 : Symbol(T62, Decl(inferTypes1.ts, 73, 58)) +>T : Symbol(T, Decl(inferTypes1.ts, 74, 9)) +>U : Symbol(U, Decl(inferTypes1.ts, 74, 30)) +>U : Symbol(U, Decl(inferTypes1.ts, 74, 30)) type T70 = { x: T }; ->T70 : Symbol(T70, Decl(inferTypes1.ts, 71, 44)) ->T : Symbol(T, Decl(inferTypes1.ts, 73, 9)) ->x : Symbol(x, Decl(inferTypes1.ts, 73, 30)) ->T : Symbol(T, Decl(inferTypes1.ts, 73, 9)) +>T70 : Symbol(T70, Decl(inferTypes1.ts, 74, 44)) +>T : Symbol(T, Decl(inferTypes1.ts, 76, 9)) +>x : Symbol(x, Decl(inferTypes1.ts, 76, 30)) +>T : Symbol(T, Decl(inferTypes1.ts, 76, 9)) type T71 = T extends T70 ? T70 : never; ->T71 : Symbol(T71, Decl(inferTypes1.ts, 73, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 74, 9)) ->T : Symbol(T, Decl(inferTypes1.ts, 74, 9)) ->T70 : Symbol(T70, Decl(inferTypes1.ts, 71, 44)) ->U : Symbol(U, Decl(inferTypes1.ts, 74, 33)) ->T70 : Symbol(T70, Decl(inferTypes1.ts, 71, 44)) ->U : Symbol(U, Decl(inferTypes1.ts, 74, 33)) +>T71 : Symbol(T71, Decl(inferTypes1.ts, 76, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 77, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 77, 9)) +>T70 : Symbol(T70, Decl(inferTypes1.ts, 74, 44)) +>U : Symbol(U, Decl(inferTypes1.ts, 77, 33)) +>T70 : Symbol(T70, Decl(inferTypes1.ts, 74, 44)) +>U : Symbol(U, Decl(inferTypes1.ts, 77, 33)) type T72 = { y: T }; ->T72 : Symbol(T72, Decl(inferTypes1.ts, 74, 54)) ->T : Symbol(T, Decl(inferTypes1.ts, 76, 9)) ->y : Symbol(y, Decl(inferTypes1.ts, 76, 30)) ->T : Symbol(T, Decl(inferTypes1.ts, 76, 9)) +>T72 : Symbol(T72, Decl(inferTypes1.ts, 77, 54)) +>T : Symbol(T, Decl(inferTypes1.ts, 79, 9)) +>y : Symbol(y, Decl(inferTypes1.ts, 79, 30)) +>T : Symbol(T, Decl(inferTypes1.ts, 79, 9)) type T73 = T extends T72 ? T70 : never; // Error ->T73 : Symbol(T73, Decl(inferTypes1.ts, 76, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 77, 9)) ->T : Symbol(T, Decl(inferTypes1.ts, 77, 9)) ->T72 : Symbol(T72, Decl(inferTypes1.ts, 74, 54)) ->U : Symbol(U, Decl(inferTypes1.ts, 77, 33)) ->T70 : Symbol(T70, Decl(inferTypes1.ts, 71, 44)) ->U : Symbol(U, Decl(inferTypes1.ts, 77, 33)) +>T73 : Symbol(T73, Decl(inferTypes1.ts, 79, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 80, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 80, 9)) +>T72 : Symbol(T72, Decl(inferTypes1.ts, 77, 54)) +>U : Symbol(U, Decl(inferTypes1.ts, 80, 33)) +>T70 : Symbol(T70, Decl(inferTypes1.ts, 74, 44)) +>U : Symbol(U, Decl(inferTypes1.ts, 80, 33)) type T74 = { x: T, y: U }; ->T74 : Symbol(T74, Decl(inferTypes1.ts, 77, 54)) ->T : Symbol(T, Decl(inferTypes1.ts, 79, 9)) ->U : Symbol(U, Decl(inferTypes1.ts, 79, 26)) ->x : Symbol(x, Decl(inferTypes1.ts, 79, 48)) ->T : Symbol(T, Decl(inferTypes1.ts, 79, 9)) ->y : Symbol(y, Decl(inferTypes1.ts, 79, 54)) ->U : Symbol(U, Decl(inferTypes1.ts, 79, 26)) +>T74 : Symbol(T74, Decl(inferTypes1.ts, 80, 54)) +>T : Symbol(T, Decl(inferTypes1.ts, 82, 9)) +>U : Symbol(U, Decl(inferTypes1.ts, 82, 26)) +>x : Symbol(x, Decl(inferTypes1.ts, 82, 48)) +>T : Symbol(T, Decl(inferTypes1.ts, 82, 9)) +>y : Symbol(y, Decl(inferTypes1.ts, 82, 54)) +>U : Symbol(U, Decl(inferTypes1.ts, 82, 26)) type T75 = T extends T74 ? T70 | T72 | T74 : never; ->T75 : Symbol(T75, Decl(inferTypes1.ts, 79, 62)) ->T : Symbol(T, Decl(inferTypes1.ts, 80, 9)) ->T : Symbol(T, Decl(inferTypes1.ts, 80, 9)) ->T74 : Symbol(T74, Decl(inferTypes1.ts, 77, 54)) ->U : Symbol(U, Decl(inferTypes1.ts, 80, 33), Decl(inferTypes1.ts, 80, 42)) ->U : Symbol(U, Decl(inferTypes1.ts, 80, 33), Decl(inferTypes1.ts, 80, 42)) ->T70 : Symbol(T70, Decl(inferTypes1.ts, 71, 44)) ->U : Symbol(U, Decl(inferTypes1.ts, 80, 33), Decl(inferTypes1.ts, 80, 42)) ->T72 : Symbol(T72, Decl(inferTypes1.ts, 74, 54)) ->U : Symbol(U, Decl(inferTypes1.ts, 80, 33), Decl(inferTypes1.ts, 80, 42)) ->T74 : Symbol(T74, Decl(inferTypes1.ts, 77, 54)) ->U : Symbol(U, Decl(inferTypes1.ts, 80, 33), Decl(inferTypes1.ts, 80, 42)) ->U : Symbol(U, Decl(inferTypes1.ts, 80, 33), Decl(inferTypes1.ts, 80, 42)) +>T75 : Symbol(T75, Decl(inferTypes1.ts, 82, 62)) +>T : Symbol(T, Decl(inferTypes1.ts, 83, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 83, 9)) +>T74 : Symbol(T74, Decl(inferTypes1.ts, 80, 54)) +>U : Symbol(U, Decl(inferTypes1.ts, 83, 33), Decl(inferTypes1.ts, 83, 42)) +>U : Symbol(U, Decl(inferTypes1.ts, 83, 33), Decl(inferTypes1.ts, 83, 42)) +>T70 : Symbol(T70, Decl(inferTypes1.ts, 74, 44)) +>U : Symbol(U, Decl(inferTypes1.ts, 83, 33), Decl(inferTypes1.ts, 83, 42)) +>T72 : Symbol(T72, Decl(inferTypes1.ts, 77, 54)) +>U : Symbol(U, Decl(inferTypes1.ts, 83, 33), Decl(inferTypes1.ts, 83, 42)) +>T74 : Symbol(T74, Decl(inferTypes1.ts, 80, 54)) +>U : Symbol(U, Decl(inferTypes1.ts, 83, 33), Decl(inferTypes1.ts, 83, 42)) +>U : Symbol(U, Decl(inferTypes1.ts, 83, 33), Decl(inferTypes1.ts, 83, 42)) type T76 = { x: T }; ->T76 : Symbol(T76, Decl(inferTypes1.ts, 80, 84)) ->T : Symbol(T, Decl(inferTypes1.ts, 82, 9)) ->T : Symbol(T, Decl(inferTypes1.ts, 82, 9)) ->U : Symbol(U, Decl(inferTypes1.ts, 82, 23)) ->T : Symbol(T, Decl(inferTypes1.ts, 82, 9)) ->x : Symbol(x, Decl(inferTypes1.ts, 82, 40)) ->T : Symbol(T, Decl(inferTypes1.ts, 82, 9)) +>T76 : Symbol(T76, Decl(inferTypes1.ts, 83, 84)) +>T : Symbol(T, Decl(inferTypes1.ts, 85, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 85, 9)) +>U : Symbol(U, Decl(inferTypes1.ts, 85, 23)) +>T : Symbol(T, Decl(inferTypes1.ts, 85, 9)) +>x : Symbol(x, Decl(inferTypes1.ts, 85, 40)) +>T : Symbol(T, Decl(inferTypes1.ts, 85, 9)) type T77 = T extends T76 ? T76 : never; ->T77 : Symbol(T77, Decl(inferTypes1.ts, 82, 48)) ->T : Symbol(T, Decl(inferTypes1.ts, 83, 9)) ->T : Symbol(T, Decl(inferTypes1.ts, 83, 9)) ->T76 : Symbol(T76, Decl(inferTypes1.ts, 80, 84)) ->X : Symbol(X, Decl(inferTypes1.ts, 83, 33)) ->Y : Symbol(Y, Decl(inferTypes1.ts, 83, 42)) ->T76 : Symbol(T76, Decl(inferTypes1.ts, 80, 84)) ->X : Symbol(X, Decl(inferTypes1.ts, 83, 33)) ->Y : Symbol(Y, Decl(inferTypes1.ts, 83, 42)) +>T77 : Symbol(T77, Decl(inferTypes1.ts, 85, 48)) +>T : Symbol(T, Decl(inferTypes1.ts, 86, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 86, 9)) +>T76 : Symbol(T76, Decl(inferTypes1.ts, 83, 84)) +>X : Symbol(X, Decl(inferTypes1.ts, 86, 33)) +>Y : Symbol(Y, Decl(inferTypes1.ts, 86, 42)) +>T76 : Symbol(T76, Decl(inferTypes1.ts, 83, 84)) +>X : Symbol(X, Decl(inferTypes1.ts, 86, 33)) +>Y : Symbol(Y, Decl(inferTypes1.ts, 86, 42)) type T78 = T extends T76 ? T76 : never; ->T78 : Symbol(T78, Decl(inferTypes1.ts, 83, 66)) ->T : Symbol(T, Decl(inferTypes1.ts, 84, 9)) ->T : Symbol(T, Decl(inferTypes1.ts, 84, 9)) ->T76 : Symbol(T76, Decl(inferTypes1.ts, 80, 84)) ->X : Symbol(X, Decl(inferTypes1.ts, 84, 33), Decl(inferTypes1.ts, 84, 42)) ->X : Symbol(X, Decl(inferTypes1.ts, 84, 33), Decl(inferTypes1.ts, 84, 42)) ->T76 : Symbol(T76, Decl(inferTypes1.ts, 80, 84)) ->X : Symbol(X, Decl(inferTypes1.ts, 84, 33), Decl(inferTypes1.ts, 84, 42)) ->X : Symbol(X, Decl(inferTypes1.ts, 84, 33), Decl(inferTypes1.ts, 84, 42)) +>T78 : Symbol(T78, Decl(inferTypes1.ts, 86, 66)) +>T : Symbol(T, Decl(inferTypes1.ts, 87, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 87, 9)) +>T76 : Symbol(T76, Decl(inferTypes1.ts, 83, 84)) +>X : Symbol(X, Decl(inferTypes1.ts, 87, 33), Decl(inferTypes1.ts, 87, 42)) +>X : Symbol(X, Decl(inferTypes1.ts, 87, 33), Decl(inferTypes1.ts, 87, 42)) +>T76 : Symbol(T76, Decl(inferTypes1.ts, 83, 84)) +>X : Symbol(X, Decl(inferTypes1.ts, 87, 33), Decl(inferTypes1.ts, 87, 42)) +>X : Symbol(X, Decl(inferTypes1.ts, 87, 33), Decl(inferTypes1.ts, 87, 42)) // Example from #21496 type JsonifiedObject = { [K in keyof T]: Jsonified }; ->JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 84, 66)) ->T : Symbol(T, Decl(inferTypes1.ts, 88, 21)) ->K : Symbol(K, Decl(inferTypes1.ts, 88, 44)) ->T : Symbol(T, Decl(inferTypes1.ts, 88, 21)) ->Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 88, 77)) ->T : Symbol(T, Decl(inferTypes1.ts, 88, 21)) ->K : Symbol(K, Decl(inferTypes1.ts, 88, 44)) +>JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 87, 66)) +>T : Symbol(T, Decl(inferTypes1.ts, 91, 21)) +>K : Symbol(K, Decl(inferTypes1.ts, 91, 44)) +>T : Symbol(T, Decl(inferTypes1.ts, 91, 21)) +>Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 91, 77)) +>T : Symbol(T, Decl(inferTypes1.ts, 91, 21)) +>K : Symbol(K, Decl(inferTypes1.ts, 91, 44)) type Jsonified = ->Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 88, 77)) ->T : Symbol(T, Decl(inferTypes1.ts, 90, 15)) +>Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 91, 77)) +>T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) T extends string | number | boolean | null ? T ->T : Symbol(T, Decl(inferTypes1.ts, 90, 15)) ->T : Symbol(T, Decl(inferTypes1.ts, 90, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) : T extends undefined | Function ? never // undefined and functions are removed ->T : Symbol(T, Decl(inferTypes1.ts, 90, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) : T extends { toJSON(): infer R } ? R // toJSON is called if it exists (e.g. Date) ->T : Symbol(T, Decl(inferTypes1.ts, 90, 15)) ->toJSON : Symbol(toJSON, Decl(inferTypes1.ts, 93, 17)) ->R : Symbol(R, Decl(inferTypes1.ts, 93, 33)) ->R : Symbol(R, Decl(inferTypes1.ts, 93, 33)) +>T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) +>toJSON : Symbol(toJSON, Decl(inferTypes1.ts, 96, 17)) +>R : Symbol(R, Decl(inferTypes1.ts, 96, 33)) +>R : Symbol(R, Decl(inferTypes1.ts, 96, 33)) : T extends object ? JsonifiedObject ->T : Symbol(T, Decl(inferTypes1.ts, 90, 15)) ->JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 84, 66)) ->T : Symbol(T, Decl(inferTypes1.ts, 90, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) +>JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 87, 66)) +>T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) : "what is this"; type Example = { ->Example : Symbol(Example, Decl(inferTypes1.ts, 95, 21)) +>Example : Symbol(Example, Decl(inferTypes1.ts, 98, 21)) str: "literalstring", ->str : Symbol(str, Decl(inferTypes1.ts, 97, 16)) +>str : Symbol(str, Decl(inferTypes1.ts, 100, 16)) fn: () => void, ->fn : Symbol(fn, Decl(inferTypes1.ts, 98, 25)) +>fn : Symbol(fn, Decl(inferTypes1.ts, 101, 25)) date: Date, ->date : Symbol(date, Decl(inferTypes1.ts, 99, 19)) +>date : Symbol(date, Decl(inferTypes1.ts, 102, 19)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) customClass: MyClass, ->customClass : Symbol(customClass, Decl(inferTypes1.ts, 100, 15)) ->MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 107, 1)) +>customClass : Symbol(customClass, Decl(inferTypes1.ts, 103, 15)) +>MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 110, 1)) obj: { ->obj : Symbol(obj, Decl(inferTypes1.ts, 101, 25)) +>obj : Symbol(obj, Decl(inferTypes1.ts, 104, 25)) prop: "property", ->prop : Symbol(prop, Decl(inferTypes1.ts, 102, 10)) +>prop : Symbol(prop, Decl(inferTypes1.ts, 105, 10)) clz: MyClass, ->clz : Symbol(clz, Decl(inferTypes1.ts, 103, 25)) ->MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 107, 1)) +>clz : Symbol(clz, Decl(inferTypes1.ts, 106, 25)) +>MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 110, 1)) nested: { attr: Date } ->nested : Symbol(nested, Decl(inferTypes1.ts, 104, 21)) ->attr : Symbol(attr, Decl(inferTypes1.ts, 105, 17)) +>nested : Symbol(nested, Decl(inferTypes1.ts, 107, 21)) +>attr : Symbol(attr, Decl(inferTypes1.ts, 108, 17)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }, } declare class MyClass { ->MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 107, 1)) +>MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 110, 1)) toJSON(): "correct"; ->toJSON : Symbol(MyClass.toJSON, Decl(inferTypes1.ts, 109, 23)) +>toJSON : Symbol(MyClass.toJSON, Decl(inferTypes1.ts, 112, 23)) } type JsonifiedExample = Jsonified; ->JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 111, 1)) ->Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 88, 77)) ->Example : Symbol(Example, Decl(inferTypes1.ts, 95, 21)) +>JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 114, 1)) +>Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 91, 77)) +>Example : Symbol(Example, Decl(inferTypes1.ts, 98, 21)) declare let ex: JsonifiedExample; ->ex : Symbol(ex, Decl(inferTypes1.ts, 114, 11)) ->JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 111, 1)) +>ex : Symbol(ex, Decl(inferTypes1.ts, 117, 11)) +>JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 114, 1)) const z1: "correct" = ex.customClass; ->z1 : Symbol(z1, Decl(inferTypes1.ts, 115, 5)) ->ex.customClass : Symbol(customClass, Decl(inferTypes1.ts, 100, 15)) ->ex : Symbol(ex, Decl(inferTypes1.ts, 114, 11)) ->customClass : Symbol(customClass, Decl(inferTypes1.ts, 100, 15)) +>z1 : Symbol(z1, Decl(inferTypes1.ts, 118, 5)) +>ex.customClass : Symbol(customClass, Decl(inferTypes1.ts, 103, 15)) +>ex : Symbol(ex, Decl(inferTypes1.ts, 117, 11)) +>customClass : Symbol(customClass, Decl(inferTypes1.ts, 103, 15)) const z2: string = ex.obj.nested.attr; ->z2 : Symbol(z2, Decl(inferTypes1.ts, 116, 5)) ->ex.obj.nested.attr : Symbol(attr, Decl(inferTypes1.ts, 105, 17)) ->ex.obj.nested : Symbol(nested, Decl(inferTypes1.ts, 104, 21)) ->ex.obj : Symbol(obj, Decl(inferTypes1.ts, 101, 25)) ->ex : Symbol(ex, Decl(inferTypes1.ts, 114, 11)) ->obj : Symbol(obj, Decl(inferTypes1.ts, 101, 25)) ->nested : Symbol(nested, Decl(inferTypes1.ts, 104, 21)) ->attr : Symbol(attr, Decl(inferTypes1.ts, 105, 17)) +>z2 : Symbol(z2, Decl(inferTypes1.ts, 119, 5)) +>ex.obj.nested.attr : Symbol(attr, Decl(inferTypes1.ts, 108, 17)) +>ex.obj.nested : Symbol(nested, Decl(inferTypes1.ts, 107, 21)) +>ex.obj : Symbol(obj, Decl(inferTypes1.ts, 104, 25)) +>ex : Symbol(ex, Decl(inferTypes1.ts, 117, 11)) +>obj : Symbol(obj, Decl(inferTypes1.ts, 104, 25)) +>nested : Symbol(nested, Decl(inferTypes1.ts, 107, 21)) +>attr : Symbol(attr, Decl(inferTypes1.ts, 108, 17)) // Repros from #21631 type A1> = [T, U]; ->A1 : Symbol(A1, Decl(inferTypes1.ts, 116, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 120, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 120, 10)) ->A1 : Symbol(A1, Decl(inferTypes1.ts, 116, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 120, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 120, 10)) +>A1 : Symbol(A1, Decl(inferTypes1.ts, 119, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 123, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 123, 10)) +>A1 : Symbol(A1, Decl(inferTypes1.ts, 119, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 123, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 123, 10)) type B1 = S extends A1 ? [T, U] : never; ->B1 : Symbol(B1, Decl(inferTypes1.ts, 120, 44)) ->S : Symbol(S, Decl(inferTypes1.ts, 121, 8)) ->S : Symbol(S, Decl(inferTypes1.ts, 121, 8)) ->A1 : Symbol(A1, Decl(inferTypes1.ts, 116, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 121, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 121, 40)) ->T : Symbol(T, Decl(inferTypes1.ts, 121, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 121, 40)) +>B1 : Symbol(B1, Decl(inferTypes1.ts, 123, 44)) +>S : Symbol(S, Decl(inferTypes1.ts, 124, 8)) +>S : Symbol(S, Decl(inferTypes1.ts, 124, 8)) +>A1 : Symbol(A1, Decl(inferTypes1.ts, 119, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 124, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 124, 40)) +>T : Symbol(T, Decl(inferTypes1.ts, 124, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 124, 40)) type A2 = [T, U]; ->A2 : Symbol(A2, Decl(inferTypes1.ts, 121, 61)) ->T : Symbol(T, Decl(inferTypes1.ts, 123, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 123, 10)) ->T : Symbol(T, Decl(inferTypes1.ts, 123, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 123, 10)) +>A2 : Symbol(A2, Decl(inferTypes1.ts, 124, 61)) +>T : Symbol(T, Decl(inferTypes1.ts, 126, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 126, 10)) +>T : Symbol(T, Decl(inferTypes1.ts, 126, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 126, 10)) type B2 = S extends A2 ? [T, U] : never; ->B2 : Symbol(B2, Decl(inferTypes1.ts, 123, 36)) ->S : Symbol(S, Decl(inferTypes1.ts, 124, 8)) ->S : Symbol(S, Decl(inferTypes1.ts, 124, 8)) ->A2 : Symbol(A2, Decl(inferTypes1.ts, 121, 61)) ->T : Symbol(T, Decl(inferTypes1.ts, 124, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 124, 40)) ->T : Symbol(T, Decl(inferTypes1.ts, 124, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 124, 40)) +>B2 : Symbol(B2, Decl(inferTypes1.ts, 126, 36)) +>S : Symbol(S, Decl(inferTypes1.ts, 127, 8)) +>S : Symbol(S, Decl(inferTypes1.ts, 127, 8)) +>A2 : Symbol(A2, Decl(inferTypes1.ts, 124, 61)) +>T : Symbol(T, Decl(inferTypes1.ts, 127, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 127, 40)) +>T : Symbol(T, Decl(inferTypes1.ts, 127, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 127, 40)) type C2 = S extends A2 ? [T, U] : never; ->C2 : Symbol(C2, Decl(inferTypes1.ts, 124, 61)) ->S : Symbol(S, Decl(inferTypes1.ts, 125, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 125, 10)) ->S : Symbol(S, Decl(inferTypes1.ts, 125, 8)) ->A2 : Symbol(A2, Decl(inferTypes1.ts, 121, 61)) ->T : Symbol(T, Decl(inferTypes1.ts, 125, 47)) ->U : Symbol(U, Decl(inferTypes1.ts, 125, 10)) ->T : Symbol(T, Decl(inferTypes1.ts, 125, 47)) ->U : Symbol(U, Decl(inferTypes1.ts, 125, 10)) +>C2 : Symbol(C2, Decl(inferTypes1.ts, 127, 61)) +>S : Symbol(S, Decl(inferTypes1.ts, 128, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 128, 10)) +>S : Symbol(S, Decl(inferTypes1.ts, 128, 8)) +>A2 : Symbol(A2, Decl(inferTypes1.ts, 124, 61)) +>T : Symbol(T, Decl(inferTypes1.ts, 128, 47)) +>U : Symbol(U, Decl(inferTypes1.ts, 128, 10)) +>T : Symbol(T, Decl(inferTypes1.ts, 128, 47)) +>U : Symbol(U, Decl(inferTypes1.ts, 128, 10)) // Repro from #21735 type A = T extends string ? { [P in T]: void; } : T; ->A : Symbol(A, Decl(inferTypes1.ts, 125, 71)) ->T : Symbol(T, Decl(inferTypes1.ts, 129, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 129, 7)) ->P : Symbol(P, Decl(inferTypes1.ts, 129, 34)) ->T : Symbol(T, Decl(inferTypes1.ts, 129, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 129, 7)) +>A : Symbol(A, Decl(inferTypes1.ts, 128, 71)) +>T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) +>P : Symbol(P, Decl(inferTypes1.ts, 132, 34)) +>T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) type B = string extends T ? { [P in T]: void; } : T; // Error ->B : Symbol(B, Decl(inferTypes1.ts, 129, 55)) ->T : Symbol(T, Decl(inferTypes1.ts, 130, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 130, 7)) ->P : Symbol(P, Decl(inferTypes1.ts, 130, 34)) ->T : Symbol(T, Decl(inferTypes1.ts, 130, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 130, 7)) +>B : Symbol(B, Decl(inferTypes1.ts, 132, 55)) +>T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) +>P : Symbol(P, Decl(inferTypes1.ts, 133, 34)) +>T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index 141a3d0aac6..f29c380a0ad 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -54,17 +54,6 @@ type T06 = Unpacked; // never >T06 : never >Unpacked : Unpacked -type ReturnType = T extends ((...args: any[]) => infer R) | (new (...args: any[]) => infer R) ? R : any; ->ReturnType : ReturnType ->T : T ->Function : Function ->T : T ->args : any[] ->R : R ->args : any[] ->R : R ->R : R - function f1(s: string) { >f1 : (s: string) => { a: number; b: string; } >s : string @@ -117,26 +106,43 @@ type T14 = ReturnType; // { a: number, b: string } >ReturnType : ReturnType >f1 : (s: string) => { a: number; b: string; } -type T15 = ReturnType; // C ->T15 : C +type T15 = ReturnType; // any +>T15 : any >ReturnType : ReturnType ->C : typeof C -type T16 = ReturnType; // any +type T16 = ReturnType; // any >T16 : any >ReturnType : ReturnType -type T17 = ReturnType; // any +type T17 = ReturnType; // Error >T17 : any >ReturnType : ReturnType -type T18 = ReturnType; // Error +type T18 = ReturnType; // Error >T18 : any >ReturnType : ReturnType +>Function : Function -type T19 = ReturnType; // any ->T19 : any ->ReturnType : ReturnType +type U10 = InstanceType; // C +>U10 : C +>InstanceType : InstanceType +>C : typeof C + +type U11 = InstanceType; // any +>U11 : any +>InstanceType : InstanceType + +type U12 = InstanceType; // any +>U12 : any +>InstanceType : InstanceType + +type U13 = InstanceType; // Error +>U13 : any +>InstanceType : InstanceType + +type U14 = InstanceType; // Error +>U14 : any +>InstanceType : InstanceType >Function : Function type ArgumentType any> = T extends (a: infer A) => any ? A : any; From 425a4182a3eb694835841ea2f614b2a914a348c2 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 9 Feb 2018 14:46:57 -0800 Subject: [PATCH 104/298] Handle empty declaration list in Convert to ES6 Module (#21843) * Handle empty declaration list in Convert to ES6 Module * Fix test --- src/services/refactors/convertToEs6Module.ts | 4 ++-- ...efactorConvertToEs6Module_triggers_declarationList.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts diff --git a/src/services/refactors/convertToEs6Module.ts b/src/services/refactors/convertToEs6Module.ts index 5a7f2e90718..65f9f58ccc4 100644 --- a/src/services/refactors/convertToEs6Module.ts +++ b/src/services/refactors/convertToEs6Module.ts @@ -33,8 +33,8 @@ namespace ts.refactor { return isExportsOrModuleExportsOrAlias(sourceFile, node as PropertyAccessExpression) || isExportsOrModuleExportsOrAlias(sourceFile, (node as PropertyAccessExpression).expression); case SyntaxKind.VariableDeclarationList: - const decl = (node as VariableDeclarationList).declarations[0]; - return isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); + const decl = firstOrUndefined((node as VariableDeclarationList).declarations); + return !!decl && isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); case SyntaxKind.VariableDeclaration: return isExportsOrModuleExportsOrAlias(sourceFile, (node as VariableDeclaration).initializer); default: diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts b/tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts new file mode 100644 index 00000000000..36ec32b0561 --- /dev/null +++ b/tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts @@ -0,0 +1,9 @@ +/// + +// @allowJs: true + +// @Filename: /a.js +////c[|o|]nst; +////require("x"); + +goTo.eachRange(() => verify.not.refactorAvailable("Convert to ES6 module")); From 49e78f68d2b429f2fe4066d50e2ff212db2c3ca1 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 9 Feb 2018 15:10:34 -0800 Subject: [PATCH 105/298] findAllRefs: Fix bug for `export` not at top-level of a module/namespace (#21846) --- src/services/importTracker.ts | 4 +++- tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index e76e21b2963..d3e57b124de 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -606,7 +606,9 @@ namespace ts.FindAllReferences { } export function getExportInfo(exportSymbol: Symbol, exportKind: ExportKind, checker: TypeChecker): ExportInfo | undefined { - const exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + const moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) return undefined; // This can happen if an `export` is not at the top-level (which is a compile error). + const exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation. // `export` may appear in a namespace. In that case, just rely on global search. return isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol, exportKind } : undefined; } diff --git a/tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts b/tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts new file mode 100644 index 00000000000..7f9c258bbe2 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsExportNotAtTopLevel.ts @@ -0,0 +1,8 @@ +/// + +////{ +//// export const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0; +//// [|x|]; +////} + +verify.singleReferenceGroup("const x: 0"); From 8d1f316414f05f4446a7a2fae7b5331a39465ed5 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 8 Feb 2018 17:27:28 -0800 Subject: [PATCH 106/298] Eliminate ChangeMultipleNodesOptions in favor of smart separators --- src/services/textChanges.ts | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index d093aef3d1a..994d4fcb6bf 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -72,6 +72,11 @@ namespace ts.textChanges { */ export type ConfigurableStartEnd = ConfigurableStart & ConfigurableEnd; + export const useNonAdjustedPositions: ConfigurableStartEnd = { + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; + export interface InsertNodeOptions { /** * Text to be inserted before the new node @@ -119,13 +124,10 @@ namespace ts.textChanges { readonly options?: never; } - interface ChangeMultipleNodesOptions extends ChangeNodeOptions { - nodeSeparator: string; - } interface ReplaceWithMultipleNodes extends BaseChange { readonly kind: ChangeKind.ReplaceWithMultipleNodes; readonly nodes: ReadonlyArray; - readonly options?: ChangeMultipleNodesOptions; + readonly options?: ChangeNodeOptions; } export function getSeparatorCharacter(separator: Token) { @@ -282,43 +284,38 @@ namespace ts.textChanges { return this; } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions public replaceRange(sourceFile: SourceFile, range: TextRange, newNode: Node, options: ChangeNodeOptions = {}) { this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile, range, options, node: newNode }); return this; } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions public replaceNode(sourceFile: SourceFile, oldNode: Node, newNode: Node, options: ChangeNodeOptions = {}) { const pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); const end = getAdjustedEndPosition(sourceFile, oldNode, options); return this.replaceRange(sourceFile, { pos, end }, newNode, options); } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions public replaceNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, newNode: Node, options: ChangeNodeOptions = {}) { const pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); const end = getAdjustedEndPosition(sourceFile, endNode, options); return this.replaceRange(sourceFile, { pos, end }, newNode, options); } - private getDefaultChangeMultipleNodesOptions(): ChangeMultipleNodesOptions { - return { - nodeSeparator: this.newLineCharacter, - useNonAdjustedStartPosition: true, - useNonAdjustedEndPosition: true, - }; - } - - public replaceRangeWithNodes(sourceFile: SourceFile, range: TextRange, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions = this.getDefaultChangeMultipleNodesOptions()) { + public replaceRangeWithNodes(sourceFile: SourceFile, range: TextRange, newNodes: ReadonlyArray, options: ChangeNodeOptions = useNonAdjustedPositions) { this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile, range, options, nodes: newNodes }); return this; } - public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions = this.getDefaultChangeMultipleNodesOptions()) { + public replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray, options: ChangeNodeOptions = useNonAdjustedPositions) { const pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); const end = getAdjustedEndPosition(sourceFile, oldNode, options); return this.replaceRangeWithNodes(sourceFile, { pos, end }, newNodes, options); } - public replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray, options: ChangeMultipleNodesOptions = this.getDefaultChangeMultipleNodesOptions()) { + public replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray, options: ChangeNodeOptions = useNonAdjustedPositions) { const pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); const end = getAdjustedEndPosition(sourceFile, endNode, options); return this.replaceRangeWithNodes(sourceFile, { pos, end }, newNodes, options); @@ -640,8 +637,14 @@ namespace ts.textChanges { const pos = change.range.pos; const posStartsLine = getLineStartPositionForPosition(pos, sourceFile) === pos; if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - const parts = change.nodes.map(n => this.getFormattedTextOfNode(n, sourceFile, pos, options)); - text = parts.join(change.options.nodeSeparator); + const lastIndex = change.nodes.length - 1; + const parts = change.nodes.map((n, index) => { + const formatted = this.getFormattedTextOfNode(n, sourceFile, pos, options); + return index === lastIndex || endsWith(formatted, this.newLineCharacter) + ? formatted + : (formatted + this.newLineCharacter); + }); + text = parts.join(""); } else { Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); From ab5596e78500256a69a3c2474b66b81a14b89e6e Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 8 Feb 2018 16:03:52 -0800 Subject: [PATCH 107/298] Call replaceNode rather than replaceRange ...where convenient. Same for deleteNode/Range. --- .../codefixes/fixExtendsInterfaceBecomesImplements.ts | 2 +- .../codefixes/fixForgottenThisPropertyAccess.ts | 2 +- src/services/codefixes/fixUnusedIdentifier.ts | 2 +- src/services/refactors/annotateWithTypeFromJSDoc.ts | 4 ++-- src/services/refactors/extractSymbol.ts | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts b/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts index d98ca556f47..551662210c1 100644 --- a/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts +++ b/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts @@ -27,7 +27,7 @@ namespace ts.codefix { } function doChanges(changes: textChanges.ChangeTracker, sourceFile: SourceFile, extendsToken: Node, heritageClauses: ReadonlyArray): void { - changes.replaceRange(sourceFile, { pos: extendsToken.getStart(), end: extendsToken.end }, createToken(SyntaxKind.ImplementsKeyword)); + changes.replaceNode(sourceFile, extendsToken, createToken(SyntaxKind.ImplementsKeyword), textChanges.useNonAdjustedPositions); // If there is already an implements clause, replace the implements keyword with a comma. if (heritageClauses.length === 2 && diff --git a/src/services/codefixes/fixForgottenThisPropertyAccess.ts b/src/services/codefixes/fixForgottenThisPropertyAccess.ts index 837487f1b8c..a3eb30159f5 100644 --- a/src/services/codefixes/fixForgottenThisPropertyAccess.ts +++ b/src/services/codefixes/fixForgottenThisPropertyAccess.ts @@ -23,6 +23,6 @@ namespace ts.codefix { function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Identifier): void { // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper suppressLeadingAndTrailingTrivia(token); - changes.replaceRange(sourceFile, { pos: token.getStart(), end: token.end }, createPropertyAccess(createThis(), token)); + changes.replaceNode(sourceFile, token, createPropertyAccess(createThis(), token), textChanges.useNonAdjustedPositions); } } \ No newline at end of file diff --git a/src/services/codefixes/fixUnusedIdentifier.ts b/src/services/codefixes/fixUnusedIdentifier.ts index 59d19a1bd9b..cb94c2112af 100644 --- a/src/services/codefixes/fixUnusedIdentifier.ts +++ b/src/services/codefixes/fixUnusedIdentifier.ts @@ -140,7 +140,7 @@ namespace ts.codefix { // and trailing trivia will remain. suppressLeadingAndTrailingTrivia(newFunction); - changes.replaceRange(sourceFile, { pos: oldFunction.getStart(), end: oldFunction.end }, newFunction); + changes.replaceNode(sourceFile, oldFunction, newFunction, textChanges.useNonAdjustedPositions); } else { changes.deleteNodeInList(sourceFile, parent); diff --git a/src/services/refactors/annotateWithTypeFromJSDoc.ts b/src/services/refactors/annotateWithTypeFromJSDoc.ts index 3116634cb52..6f87332aa96 100644 --- a/src/services/refactors/annotateWithTypeFromJSDoc.ts +++ b/src/services/refactors/annotateWithTypeFromJSDoc.ts @@ -76,7 +76,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc { const changeTracker = textChanges.ChangeTracker.fromContext(context); const declarationWithType = addType(decl, transformJSDocType(jsdocType) as TypeNode); suppressLeadingAndTrailingTrivia(declarationWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, declarationWithType); + changeTracker.replaceNode(sourceFile, decl, declarationWithType, textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -91,7 +91,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc { const changeTracker = textChanges.ChangeTracker.fromContext(context); const functionWithType = addTypesToFunctionLike(decl); suppressLeadingAndTrailingTrivia(functionWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, functionWithType); + changeTracker.replaceNode(sourceFile, decl, functionWithType, textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 20895d7992a..245f6d5859c 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -1053,7 +1053,7 @@ namespace ts.refactor.extractSymbol { changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true); // Consume - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, textChanges.useNonAdjustedPositions); } else { const newVariableDeclaration = createVariableDeclaration(localNameText, variableType, initializer); @@ -1070,7 +1070,7 @@ namespace ts.refactor.extractSymbol { // Consume const localReference = createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, textChanges.useNonAdjustedPositions); } else if (node.parent.kind === SyntaxKind.ExpressionStatement && scope === findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, @@ -1078,7 +1078,7 @@ namespace ts.refactor.extractSymbol { const newVariableStatement = createVariableStatement( /*modifiers*/ undefined, createVariableDeclarationList([newVariableDeclaration], NodeFlags.Const)); - changeTracker.replaceRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }, newVariableStatement); + changeTracker.replaceNode(context.file, node.parent, newVariableStatement, textChanges.useNonAdjustedPositions); } else { const newVariableStatement = createVariableStatement( @@ -1097,11 +1097,11 @@ namespace ts.refactor.extractSymbol { // Consume if (node.parent.kind === SyntaxKind.ExpressionStatement) { // If the parent is an expression statement, delete it. - changeTracker.deleteRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }); + changeTracker.deleteNode(context.file, node.parent, textChanges.useNonAdjustedPositions); } else { const localReference = createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, textChanges.useNonAdjustedPositions); } } } From 1baae421490015946c5397cb428d47ef2be3f681 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 9 Feb 2018 11:15:13 -0800 Subject: [PATCH 108/298] Handle variable declaration without initializer in Convert to ES6 Module Fixes #21786 --- src/services/refactors/convertToEs6Module.ts | 9 ++++++--- ...factorConvertToEs6Module_triggers_noInitializer.ts | 11 +++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts diff --git a/src/services/refactors/convertToEs6Module.ts b/src/services/refactors/convertToEs6Module.ts index 65f9f58ccc4..f1f3c16b6bb 100644 --- a/src/services/refactors/convertToEs6Module.ts +++ b/src/services/refactors/convertToEs6Module.ts @@ -33,14 +33,17 @@ namespace ts.refactor { return isExportsOrModuleExportsOrAlias(sourceFile, node as PropertyAccessExpression) || isExportsOrModuleExportsOrAlias(sourceFile, (node as PropertyAccessExpression).expression); case SyntaxKind.VariableDeclarationList: - const decl = firstOrUndefined((node as VariableDeclarationList).declarations); - return !!decl && isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); + return isVariableDeclarationTriggerLocation(firstOrUndefined((node as VariableDeclarationList).declarations)); case SyntaxKind.VariableDeclaration: - return isExportsOrModuleExportsOrAlias(sourceFile, (node as VariableDeclaration).initializer); + return isVariableDeclarationTriggerLocation(node as VariableDeclaration); default: return isExpression(node) && isExportsOrModuleExportsOrAlias(sourceFile, node) || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, /*onSecondTry*/ true); } + + function isVariableDeclarationTriggerLocation(decl: VariableDeclaration | undefined) { + return !!decl && !!decl.initializer && isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); + } } function isAtTopLevelRequire(call: CallExpression): boolean { diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts b/tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts new file mode 100644 index 00000000000..23cbdd12aee --- /dev/null +++ b/tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts @@ -0,0 +1,11 @@ +/// + +// @allowJs: true + +// @Filename: /a.js +/////*a*/const/*b*/ alias; +////require("x"); + +goTo.select("a", "b"); +verify.not.refactorAvailable("Convert to ES6 module"); + From 025418fdb0759ab03fbff4331681f288db11aacc Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 9 Feb 2018 15:54:32 -0800 Subject: [PATCH 109/298] Handle class declarations without names in Extract Symbol Fixes #21816 --- src/harness/unittests/extractFunctions.ts | 7 +++++ src/services/refactors/extractSymbol.ts | 2 +- .../extractFunction_NamelessClass.js | 29 +++++++++++++++++++ .../extractFunction_NamelessClass.ts | 29 +++++++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/extractFunction/extractFunction_NamelessClass.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_NamelessClass.ts diff --git a/src/harness/unittests/extractFunctions.ts b/src/harness/unittests/extractFunctions.ts index 56b3c35a292..ecc4112c3a7 100644 --- a/src/harness/unittests/extractFunctions.ts +++ b/src/harness/unittests/extractFunctions.ts @@ -546,6 +546,13 @@ var q = /*b*/ //c /*g*/ + /*h*/ //i /*j*/ 2|] /*k*/ //l /*m*/; /*n*/ //o`); + + testExtractFunction("extractFunction_NamelessClass", ` +export default class { + M() { + [#|1 + 1|]; + } +}`); }); function testExtractFunction(caption: string, text: string, includeLib?: boolean) { diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 245f6d5859c..68001262a3f 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -687,7 +687,7 @@ namespace ts.refactor.extractSymbol { } function getDescriptionForClassLikeDeclaration(scope: ClassLikeDeclaration): string { return scope.kind === SyntaxKind.ClassDeclaration - ? `class '${scope.name.text}'` + ? scope.name ? `class '${scope.name.text}'` : "anonymous class declaration" : scope.name ? `class expression '${scope.name.text}'` : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope: SourceFile | ModuleBlock): string | SpecialScope { diff --git a/tests/baselines/reference/extractFunction/extractFunction_NamelessClass.js b/tests/baselines/reference/extractFunction/extractFunction_NamelessClass.js new file mode 100644 index 00000000000..f0c42044996 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_NamelessClass.js @@ -0,0 +1,29 @@ +// ==ORIGINAL== + +export default class { + M() { + /*[#|*/1 + 1/*|]*/; + } +} +// ==SCOPE::Extract to method in anonymous class declaration== + +export default class { + M() { + this./*RENAME*/newMethod(); + } + + newMethod() { + 1 + 1; + } +} +// ==SCOPE::Extract to function in module scope== + +export default class { + M() { + /*RENAME*/newFunction(); + } +} + +function newFunction() { + 1 + 1; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_NamelessClass.ts b/tests/baselines/reference/extractFunction/extractFunction_NamelessClass.ts new file mode 100644 index 00000000000..9905cd08c74 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_NamelessClass.ts @@ -0,0 +1,29 @@ +// ==ORIGINAL== + +export default class { + M() { + /*[#|*/1 + 1/*|]*/; + } +} +// ==SCOPE::Extract to method in anonymous class declaration== + +export default class { + M() { + this./*RENAME*/newMethod(); + } + + private newMethod() { + 1 + 1; + } +} +// ==SCOPE::Extract to function in module scope== + +export default class { + M() { + /*RENAME*/newFunction(); + } +} + +function newFunction() { + 1 + 1; +} From e65a1a429cbff6b29e76c6914ea3d5cbd445b186 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 9 Feb 2018 14:49:44 -0800 Subject: [PATCH 110/298] Harden Extract Symbol against symbols without declarations Fixes #21793 --- src/harness/unittests/extractFunctions.ts | 5 ++++ src/services/refactors/extractSymbol.ts | 6 +++-- .../extractFunction_NoDeclarations.js | 24 +++++++++++++++++++ .../extractFunction_NoDeclarations.ts | 24 +++++++++++++++++++ 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.ts diff --git a/src/harness/unittests/extractFunctions.ts b/src/harness/unittests/extractFunctions.ts index ecc4112c3a7..5e9214fb35e 100644 --- a/src/harness/unittests/extractFunctions.ts +++ b/src/harness/unittests/extractFunctions.ts @@ -552,6 +552,11 @@ export default class { M() { [#|1 + 1|]; } +}`); + + testExtractFunction("extractFunction_NoDeclarations", ` +function F() { +[#|arguments.length|]; // arguments has no declaration }`); }); diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 68001262a3f..bf410ab27a9 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -1689,7 +1689,8 @@ namespace ts.refactor.extractSymbol { return symbolId; } // find first declaration in this file - const declInFile = find(symbol.getDeclarations(), d => d.getSourceFile() === sourceFile); + const decls = symbol.getDeclarations(); + const declInFile = decls && find(decls, d => d.getSourceFile() === sourceFile); if (!declInFile) { return undefined; } @@ -1782,7 +1783,8 @@ namespace ts.refactor.extractSymbol { if (!symbol) { return undefined; } - if (symbol.getDeclarations().some(d => d.parent === scopeDecl)) { + const decls = symbol.getDeclarations(); + if (decls && decls.some(d => d.parent === scopeDecl)) { return createIdentifier(symbol.name); } const prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); diff --git a/tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.js b/tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.js new file mode 100644 index 00000000000..b4129d1225e --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.js @@ -0,0 +1,24 @@ +// ==ORIGINAL== + +function F() { +/*[#|*/arguments.length/*|]*/; // arguments has no declaration +} +// ==SCOPE::Extract to inner function in function 'F'== + +function F() { + /*RENAME*/newFunction(); // arguments has no declaration + + + function newFunction() { + arguments.length; + } +} +// ==SCOPE::Extract to function in global scope== + +function F() { + /*RENAME*/newFunction(); // arguments has no declaration +} + +function newFunction() { + arguments.length; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.ts b/tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.ts new file mode 100644 index 00000000000..b4129d1225e --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_NoDeclarations.ts @@ -0,0 +1,24 @@ +// ==ORIGINAL== + +function F() { +/*[#|*/arguments.length/*|]*/; // arguments has no declaration +} +// ==SCOPE::Extract to inner function in function 'F'== + +function F() { + /*RENAME*/newFunction(); // arguments has no declaration + + + function newFunction() { + arguments.length; + } +} +// ==SCOPE::Extract to function in global scope== + +function F() { + /*RENAME*/newFunction(); // arguments has no declaration +} + +function newFunction() { + arguments.length; +} From 9b65a7dfe137f17f4625bdc3893bde3aaca06b7b Mon Sep 17 00:00:00 2001 From: csigs Date: Sat, 10 Feb 2018 11:10:20 +0000 Subject: [PATCH 111/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index 3507c91d278..c5a24f11483 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -8778,6 +8778,15 @@ + + + + + + + + + From a732ff6b35731bc7c4844dec2ac0f0443adb97b9 Mon Sep 17 00:00:00 2001 From: Priyantha Lankapura <403912+lankaapura@users.noreply.github.com> Date: Sun, 11 Feb 2018 02:06:04 +0530 Subject: [PATCH 112/298] Add type infer formatting (#21850) * add test for type infer formatting * Fix type infer formatting * update test to use condtional --- src/services/formatting/rules.ts | 1 + tests/cases/fourslash/formattingTypeInfer.ts | 45 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tests/cases/fourslash/formattingTypeInfer.ts diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 0371fff09c4..75182d9bb00 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -162,6 +162,7 @@ namespace ts.formatting { SyntaxKind.TypeKeyword, SyntaxKind.FromKeyword, SyntaxKind.KeyOfKeyword, + SyntaxKind.InferKeyword, ], anyToken, [isNonJsxSameLineTokenContext], diff --git a/tests/cases/fourslash/formattingTypeInfer.ts b/tests/cases/fourslash/formattingTypeInfer.ts new file mode 100644 index 00000000000..f41a4ef19a8 --- /dev/null +++ b/tests/cases/fourslash/formattingTypeInfer.ts @@ -0,0 +1,45 @@ +/// + +//// +/////*L1*/type C = T extends Array ? U : never; +//// +/////*L2*/ type C < T > = T extends Array < infer U > ? U : never ; +//// +/////*L3*/type C = T extends Array ? U : T; +//// +/////*L4*/ type C < T > = T extends Array < infer U > ? U : T ; +//// +/////*L5*/type Foo = T extends { a: infer U, b: infer U } ? U : never; +//// +/////*L6*/ type Foo < T > = T extends { a : infer U , b : infer U } ? U : never ; +//// +/////*L7*/type Bar = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U : never; +//// +/////*L8*/ type Bar < T > = T extends { a : (x : infer U ) => void , b : (x : infer U ) => void } ? U : never ; +//// + +format.document(); + +goTo.marker("L1"); +verify.currentLineContentIs("type C = T extends Array ? U : never;"); + +goTo.marker("L2"); +verify.currentLineContentIs("type C = T extends Array ? U : never;"); + +goTo.marker("L3"); +verify.currentLineContentIs("type C = T extends Array ? U : T;"); + +goTo.marker("L4"); +verify.currentLineContentIs("type C = T extends Array ? U : T;"); + +goTo.marker("L5"); +verify.currentLineContentIs("type Foo = T extends { a: infer U, b: infer U } ? U : never;"); + +goTo.marker("L6"); +verify.currentLineContentIs("type Foo = T extends { a: infer U, b: infer U } ? U : never;"); + +goTo.marker("L7"); +verify.currentLineContentIs("type Bar = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U : never;"); + +goTo.marker("L8"); +verify.currentLineContentIs("type Bar = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U : never;"); \ No newline at end of file From 02e769675932e9e6b4628f0e6ac9719fdc569c04 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 10 Feb 2018 12:44:01 -0800 Subject: [PATCH 113/298] PR template typo: labeled / labelled (#21854) --- pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pull_request_template.md b/pull_request_template.md index 2c49c84641b..9c74ff2d6e8 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -2,7 +2,7 @@ Thank you for submitting a pull request! Here's a checklist you might find useful. -[ ] There is an associated issue that is labelled +[ ] There is an associated issue that is labeled 'Bug' or 'help wanted' or is in the Community milestone [ ] Code is up-to-date with the `master` branch [ ] You've successfully run `jake runtests` locally From 879cb69d6af543811f1128cbacc76a520af12484 Mon Sep 17 00:00:00 2001 From: Eric Grube Date: Sat, 10 Feb 2018 15:45:54 -0500 Subject: [PATCH 114/298] add beautifier rule for space after close paren and destructure bracket (#21859) --- src/services/formatting/rules.ts | 3 +++ .../cases/fourslash/formattingInDestructuring5.ts | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/cases/fourslash/formattingInDestructuring5.ts diff --git a/src/services/formatting/rules.ts b/src/services/formatting/rules.ts index 75182d9bb00..815237df228 100644 --- a/src/services/formatting/rules.ts +++ b/src/services/formatting/rules.ts @@ -92,6 +92,9 @@ namespace ts.formatting { rule("SpaceBetweenCloseBraceAndWhile", SyntaxKind.CloseBraceToken, SyntaxKind.WhileKeyword, [isNonJsxSameLineTokenContext], RuleAction.Space), rule("NoSpaceBetweenEmptyBraceBrackets", SyntaxKind.OpenBraceToken, SyntaxKind.CloseBraceToken, [isNonJsxSameLineTokenContext, isObjectContext], RuleAction.Delete), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule("SpaceAfterConditionalClosingParen", SyntaxKind.CloseParenToken, SyntaxKind.OpenBracketToken, [isControlDeclContext], RuleAction.Space), + rule("NoSpaceBetweenFunctionKeywordAndStar", SyntaxKind.FunctionKeyword, SyntaxKind.AsteriskToken, [isFunctionDeclarationOrFunctionExpressionContext], RuleAction.Delete), rule("SpaceAfterStarInGeneratorDeclaration", SyntaxKind.AsteriskToken, [SyntaxKind.Identifier, SyntaxKind.OpenParenToken], [isFunctionDeclarationOrFunctionExpressionContext], RuleAction.Space), diff --git a/tests/cases/fourslash/formattingInDestructuring5.ts b/tests/cases/fourslash/formattingInDestructuring5.ts new file mode 100644 index 00000000000..3141f3ee3e6 --- /dev/null +++ b/tests/cases/fourslash/formattingInDestructuring5.ts @@ -0,0 +1,15 @@ +/// + +//// let a, b; +//// /*1*/if (false)[a, b] = [1, 2]; +//// /*2*/if (true) [a, b] = [1, 2]; +//// /*3*/var a = [1, 2, 3].map(num => num) [0]; + +format.document(); + +goTo.marker("1"); +verify.currentLineContentIs("if (false) [a, b] = [1, 2];"); +goTo.marker("2"); +verify.currentLineContentIs("if (true) [a, b] = [1, 2];"); +goTo.marker("3"); +verify.currentLineContentIs("var a = [1, 2, 3].map(num => num)[0];"); \ No newline at end of file From 9189354713dbed8d0f49555309278674c78cefd4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 10 Feb 2018 17:10:32 -0800 Subject: [PATCH 115/298] Wildcard instantiation of indexed access should be wildcard --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7da5d747391..5965eeaf8b2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7986,7 +7986,7 @@ namespace ts { } if (!(indexType.flags & TypeFlags.Nullable) && isTypeAssignableToKind(indexType, TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.ESSymbolLike)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } const indexInfo = isTypeAssignableToKind(indexType, TypeFlags.NumberLike) && getIndexInfoOfType(objectType, IndexKind.Number) || getIndexInfoOfType(objectType, IndexKind.String) || From 2e1dcd666c790347b02d0af46e4e928c7d45fdf7 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 10 Feb 2018 17:10:44 -0800 Subject: [PATCH 116/298] Add regression test --- .../types/conditional/conditionalTypes1.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes1.ts b/tests/cases/conformance/types/conditional/conditionalTypes1.ts index 3a6dab9a612..a0776ef2e0e 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes1.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes1.ts @@ -252,3 +252,14 @@ function f33() { var z: T1; var z: T2; } + +// Repro from #21863 + +function f40() { + type Eq = T extends U ? U extends T ? true : false : false; + type If = S extends false ? U : T; + type Omit = { [P in keyof T]: If, never, P>; }[keyof T]; + type Omit2 = { [P in keyof T]: If, never, P>; }[keyof T]; + type A = Omit<{ a: void; b: never; }>; // 'a' + type B = Omit2<{ a: void; b: never; }>; // 'a' +} From 071ee915ca0972301f5ca4499e65850038c8a50e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 10 Feb 2018 17:11:02 -0800 Subject: [PATCH 117/298] Accept new baselines --- .../reference/conditionalTypes1.errors.txt | 11 ++++ .../baselines/reference/conditionalTypes1.js | 15 +++++ .../reference/conditionalTypes1.symbols | 62 +++++++++++++++++ .../reference/conditionalTypes1.types | 66 +++++++++++++++++++ 4 files changed, 154 insertions(+) diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 111b74a830b..fd128c05322 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -393,4 +393,15 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(243,9): error TS2 var z: T1; var z: T2; } + + // Repro from #21863 + + function f40() { + type Eq = T extends U ? U extends T ? true : false : false; + type If = S extends false ? U : T; + type Omit = { [P in keyof T]: If, never, P>; }[keyof T]; + type Omit2 = { [P in keyof T]: If, never, P>; }[keyof T]; + type A = Omit<{ a: void; b: never; }>; // 'a' + type B = Omit2<{ a: void; b: never; }>; // 'a' + } \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypes1.js b/tests/baselines/reference/conditionalTypes1.js index 399ccb14fb3..6c9179a001e 100644 --- a/tests/baselines/reference/conditionalTypes1.js +++ b/tests/baselines/reference/conditionalTypes1.js @@ -250,6 +250,17 @@ function f33() { var z: T1; var z: T2; } + +// Repro from #21863 + +function f40() { + type Eq = T extends U ? U extends T ? true : false : false; + type If = S extends false ? U : T; + type Omit = { [P in keyof T]: If, never, P>; }[keyof T]; + type Omit2 = { [P in keyof T]: If, never, P>; }[keyof T]; + type A = Omit<{ a: void; b: never; }>; // 'a' + type B = Omit2<{ a: void; b: never; }>; // 'a' +} //// [conditionalTypes1.js] @@ -325,6 +336,9 @@ function f33() { var z; var z; } +// Repro from #21863 +function f40() { +} //// [conditionalTypes1.d.ts] @@ -495,3 +509,4 @@ declare const convert2: (value: Foo) => Foo; declare function f31(): void; declare function f32(): void; declare function f33(): void; +declare function f40(): void; diff --git a/tests/baselines/reference/conditionalTypes1.symbols b/tests/baselines/reference/conditionalTypes1.symbols index cef734c4c4b..969f6bfcb42 100644 --- a/tests/baselines/reference/conditionalTypes1.symbols +++ b/tests/baselines/reference/conditionalTypes1.symbols @@ -940,3 +940,65 @@ function f33() { >T2 : Symbol(T2, Decl(conditionalTypes1.ts, 246, 25)) } +// Repro from #21863 + +function f40() { +>f40 : Symbol(f40, Decl(conditionalTypes1.ts, 250, 1)) + + type Eq = T extends U ? U extends T ? true : false : false; +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 254, 16)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 255, 12)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 255, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 255, 12)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 255, 14)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 255, 14)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 255, 12)) + + type If = S extends false ? U : T; +>If : Symbol(If, Decl(conditionalTypes1.ts, 255, 69)) +>S : Symbol(S, Decl(conditionalTypes1.ts, 256, 12)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 256, 14)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 256, 17)) +>S : Symbol(S, Decl(conditionalTypes1.ts, 256, 12)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 256, 17)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 256, 14)) + + type Omit = { [P in keyof T]: If, never, P>; }[keyof T]; +>Omit : Symbol(Omit, Decl(conditionalTypes1.ts, 256, 47)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 257, 37)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 255, 69)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 254, 16)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 257, 37)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 257, 37)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14)) + + type Omit2 = { [P in keyof T]: If, never, P>; }[keyof T]; +>Omit2 : Symbol(Omit2, Decl(conditionalTypes1.ts, 257, 94)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 258, 32)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 258, 49)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15)) +>If : Symbol(If, Decl(conditionalTypes1.ts, 255, 69)) +>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 254, 16)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 258, 49)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 258, 32)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 258, 49)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15)) + + type A = Omit<{ a: void; b: never; }>; // 'a' +>A : Symbol(A, Decl(conditionalTypes1.ts, 258, 102)) +>Omit : Symbol(Omit, Decl(conditionalTypes1.ts, 256, 47)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 259, 19)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 259, 28)) + + type B = Omit2<{ a: void; b: never; }>; // 'a' +>B : Symbol(B, Decl(conditionalTypes1.ts, 259, 42)) +>Omit2 : Symbol(Omit2, Decl(conditionalTypes1.ts, 257, 94)) +>a : Symbol(a, Decl(conditionalTypes1.ts, 260, 20)) +>b : Symbol(b, Decl(conditionalTypes1.ts, 260, 29)) +} + diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index eb17cb31350..99c7e45f64d 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -1080,3 +1080,69 @@ function f33() { >T2 : Foo } +// Repro from #21863 + +function f40() { +>f40 : () => void + + type Eq = T extends U ? U extends T ? true : false : false; +>Eq : T extends U ? U extends T ? true : false : false +>T : T +>U : U +>T : T +>U : U +>U : U +>T : T +>true : true +>false : false +>false : false + + type If = S extends false ? U : T; +>If : S extends false ? U : T +>S : S +>T : T +>U : U +>S : S +>false : false +>U : U +>T : T + + type Omit = { [P in keyof T]: If, never, P>; }[keyof T]; +>Omit : { [P in keyof T]: (T[P] extends never ? boolean : false) extends false ? P : never; }[keyof T] +>T : T +>P : P +>T : T +>If : S extends false ? U : T +>Eq : T extends U ? U extends T ? true : false : false +>T : T +>P : P +>P : P +>T : T + + type Omit2 = { [P in keyof T]: If, never, P>; }[keyof T]; +>Omit2 : { [P in keyof T]: (T[P] extends U ? U extends T[P] ? true : false : false) extends false ? P : never; }[keyof T] +>T : T +>U : U +>P : P +>T : T +>If : S extends false ? U : T +>Eq : T extends U ? U extends T ? true : false : false +>T : T +>P : P +>U : U +>P : P +>T : T + + type A = Omit<{ a: void; b: never; }>; // 'a' +>A : "a" +>Omit : { [P in keyof T]: (T[P] extends never ? boolean : false) extends false ? P : never; }[keyof T] +>a : void +>b : never + + type B = Omit2<{ a: void; b: never; }>; // 'a' +>B : "a" +>Omit2 : { [P in keyof T]: (T[P] extends U ? U extends T[P] ? true : false : false) extends false ? P : never; }[keyof T] +>a : void +>b : never +} + From 3fb481ff40f4ba87b052992299108f41165e0730 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 12 Feb 2018 10:34:17 -0800 Subject: [PATCH 118/298] Multiple telemetry debug assert failure fixes (#21886) * Use getAllowSyntheticDefaultImports to access `--allowSyntheticDefaultImport` value * Fix #21788: Handel missing imporotClause case * Fix #21789: Add a defensive check to forgottenThisPropertyAccess code fix for non-identifier locations * Do not suggest prefix with `this` if the name we are looking for is diffrent from the errorLocation * Fix #21796: Handel case of unknown module * Add check to capture more info for #21800 * Fix #21807: check for symbol before looking up its flags * Fix #21812: Gracefully fail if the token is not `this`. --- src/compiler/checker.ts | 2 +- src/services/codefixes/fixAddMissingMember.ts | 2 +- .../fixClassSuperMustPrecedeThisAccess.ts | 2 +- .../codefixes/fixForgottenThisPropertyAccess.ts | 15 +++++++++++---- src/services/codefixes/inferFromUsage.ts | 4 ++-- src/services/refactors/useDefaultImport.ts | 8 ++++---- ...sxFactoryMissingErrorInsideAClass.errors.txt | 12 ++++++++++++ .../jsxFactoryMissingErrorInsideAClass.js | 17 +++++++++++++++++ .../jsxFactoryMissingErrorInsideAClass.symbols | 11 +++++++++++ .../jsxFactoryMissingErrorInsideAClass.types | 14 ++++++++++++++ .../jsxFactoryMissingErrorInsideAClass.ts | 11 +++++++++++ .../cases/fourslash/codeFixAddMissingMember8.ts | 7 +++++++ .../codeFixForgottenThisPropertyAccess04.ts | 14 ++++++++++++++ tests/cases/fourslash/fourslash.ts | 2 +- .../cases/fourslash/refactorUseDefaultImport.ts | 12 ++++++++++++ 15 files changed, 119 insertions(+), 14 deletions(-) create mode 100644 tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.errors.txt create mode 100644 tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.js create mode 100644 tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.symbols create mode 100644 tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.types create mode 100644 tests/cases/compiler/jsxFactoryMissingErrorInsideAClass.ts create mode 100644 tests/cases/fourslash/codeFixAddMissingMember8.ts create mode 100644 tests/cases/fourslash/codeFixForgottenThisPropertyAccess04.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cd918ea4dce..027e8f095a0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1496,7 +1496,7 @@ namespace ts { } function checkAndReportErrorForMissingPrefix(errorLocation: Node, name: __String, nameArg: __String | Identifier): boolean { - if ((errorLocation.kind === SyntaxKind.Identifier && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index f7f5aa0a22f..7dbbc39843f 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -86,7 +86,7 @@ namespace ts.codefix { else { const leftExpressionType = checker.getTypeAtLocation(parent.expression); const { symbol } = leftExpressionType; - if (!(leftExpressionType.flags & TypeFlags.Object && symbol.flags & SymbolFlags.Class)) { + if (!(symbol && leftExpressionType.flags & TypeFlags.Object && symbol.flags & SymbolFlags.Class)) { return undefined; } const classDeclaration = cast(first(symbol.declarations), isClassLike); diff --git a/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts b/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts index 1595bbf3c13..8d47e74d8a4 100644 --- a/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts +++ b/src/services/codefixes/fixClassSuperMustPrecedeThisAccess.ts @@ -34,7 +34,7 @@ namespace ts.codefix { function getNodes(sourceFile: SourceFile, pos: number): { readonly constructor: ConstructorDeclaration, readonly superCall: ExpressionStatement } { const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); - Debug.assert(token.kind === SyntaxKind.ThisKeyword); + if (token.kind !== SyntaxKind.ThisKeyword) return undefined; const constructor = getContainingFunction(token) as ConstructorDeclaration; const superCall = findSuperCall(constructor.body); // figure out if the `this` access is actually inside the supercall diff --git a/src/services/codefixes/fixForgottenThisPropertyAccess.ts b/src/services/codefixes/fixForgottenThisPropertyAccess.ts index a3eb30159f5..e71c06399c2 100644 --- a/src/services/codefixes/fixForgottenThisPropertyAccess.ts +++ b/src/services/codefixes/fixForgottenThisPropertyAccess.ts @@ -7,6 +7,9 @@ namespace ts.codefix { getCodeActions(context) { const { sourceFile } = context; const token = getNode(sourceFile, context.span.start); + if (!token) { + return undefined; + } const changes = textChanges.ChangeTracker.with(context, t => doChange(t, sourceFile, token)); return [{ description: getLocaleSpecificMessage(Diagnostics.Add_this_to_unresolved_variable), changes, fixId }]; }, @@ -16,13 +19,17 @@ namespace ts.codefix { }), }); - function getNode(sourceFile: SourceFile, pos: number): Identifier { - return cast(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isIdentifier); + function getNode(sourceFile: SourceFile, pos: number): Identifier | undefined { + const node = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return isIdentifier(node) ? node : undefined; } - function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Identifier): void { + function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, token: Identifier | undefined): void { + if (!token) { + return; + } // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper suppressLeadingAndTrailingTrivia(token); changes.replaceNode(sourceFile, token, createPropertyAccess(createThis(), token), textChanges.useNonAdjustedPositions); } -} \ No newline at end of file +} diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index 2abd82fa7a7..902764a1729 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -86,8 +86,8 @@ namespace ts.codefix { if (containingFunction === undefined) { return undefined; } - switch (errorCode) { + switch (errorCode) { // Parameter declarations case Diagnostics.Parameter_0_implicitly_has_an_1_type.code: if (isSetAccessor(containingFunction)) { @@ -96,7 +96,7 @@ namespace ts.codefix { // falls through case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: return !seenFunctions || addToSeen(seenFunctions, getNodeId(containingFunction)) - ? getCodeActionForParameters(token.parent, containingFunction, sourceFile, program, cancellationToken) + ? getCodeActionForParameters(cast(token.parent, isParameter), containingFunction, sourceFile, program, cancellationToken) : undefined; // Get Accessor declarations diff --git a/src/services/refactors/useDefaultImport.ts b/src/services/refactors/useDefaultImport.ts index 6ee43cc7503..080092e16ab 100644 --- a/src/services/refactors/useDefaultImport.ts +++ b/src/services/refactors/useDefaultImport.ts @@ -7,7 +7,7 @@ namespace ts.refactor.installTypesForPackage { function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined { const { file, startPosition, program } = context; - if (!program.getCompilerOptions().allowSyntheticDefaultImports) { + if (!getAllowSyntheticDefaultImports(program.getCompilerOptions())) { return undefined; } @@ -17,8 +17,8 @@ namespace ts.refactor.installTypesForPackage { } const module = getResolvedModule(file, importInfo.moduleSpecifier.text); - const resolvedFile = program.getSourceFile(module.resolvedFileName); - if (!(resolvedFile.externalModuleIndicator && isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { + const resolvedFile = module && program.getSourceFile(module.resolvedFileName); + if (!(resolvedFile && resolvedFile.externalModuleIndicator && isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { return undefined; } @@ -69,7 +69,7 @@ namespace ts.refactor.installTypesForPackage { case SyntaxKind.ImportDeclaration: const d = node as ImportDeclaration; const { importClause } = d; - return !importClause.name && importClause.namedBindings.kind === SyntaxKind.NamespaceImport && isStringLiteral(d.moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings.kind === SyntaxKind.NamespaceImport && isStringLiteral(d.moduleSpecifier) ? { importStatement: d, name: importClause.namedBindings.name, moduleSpecifier: d.moduleSpecifier } : undefined; // For known child node kinds of convertible imports, try again with parent node. diff --git a/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.errors.txt b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.errors.txt new file mode 100644 index 00000000000..4bcf84b79da --- /dev/null +++ b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.errors.txt @@ -0,0 +1,12 @@ +tests/cases/compiler/test.tsx(3,17): error TS2304: Cannot find name 'factory'. + + +==== tests/cases/compiler/test.tsx (1 errors) ==== + export class C { + factory() { + return
; + ~~~ +!!! error TS2304: Cannot find name 'factory'. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.js b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.js new file mode 100644 index 00000000000..67daa7d3329 --- /dev/null +++ b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.js @@ -0,0 +1,17 @@ +//// [test.tsx] +export class C { + factory() { + return
; + } +} + + +//// [test.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class C { + factory() { + return factory.createElement("div", null); + } +} +exports.C = C; diff --git a/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.symbols b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.symbols new file mode 100644 index 00000000000..5e3ada2a717 --- /dev/null +++ b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/test.tsx === +export class C { +>C : Symbol(C, Decl(test.tsx, 0, 0)) + + factory() { +>factory : Symbol(C.factory, Decl(test.tsx, 0, 16)) + + return
; + } +} + diff --git a/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.types b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.types new file mode 100644 index 00000000000..f1203cdff3c --- /dev/null +++ b/tests/baselines/reference/jsxFactoryMissingErrorInsideAClass.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/test.tsx === +export class C { +>C : C + + factory() { +>factory : () => any + + return
; +>
: any +>div : any +>div : any + } +} + diff --git a/tests/cases/compiler/jsxFactoryMissingErrorInsideAClass.ts b/tests/cases/compiler/jsxFactoryMissingErrorInsideAClass.ts new file mode 100644 index 00000000000..73b25974f5e --- /dev/null +++ b/tests/cases/compiler/jsxFactoryMissingErrorInsideAClass.ts @@ -0,0 +1,11 @@ +//@jsx: react +//@target: es6 +//@module: commonjs +//@reactNamespace: factory + +//@filename: test.tsx +export class C { + factory() { + return
; + } +} diff --git a/tests/cases/fourslash/codeFixAddMissingMember8.ts b/tests/cases/fourslash/codeFixAddMissingMember8.ts new file mode 100644 index 00000000000..6a3b67ca9f7 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddMissingMember8.ts @@ -0,0 +1,7 @@ +/// + +// @Filename: a.ts +////declare var x: [1, 2]; +////x.b; + +verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/codeFixForgottenThisPropertyAccess04.ts b/tests/cases/fourslash/codeFixForgottenThisPropertyAccess04.ts new file mode 100644 index 00000000000..884bad4d21a --- /dev/null +++ b/tests/cases/fourslash/codeFixForgottenThisPropertyAccess04.ts @@ -0,0 +1,14 @@ +/// + +// @jsx: react +// @jsxFactory: factory + +// @Filename: /a.tsx +////export class C { +//// foo() { +//// return ; +//// } +////} + + +verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index c05df7a68e6..987af1d6a3a 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -181,7 +181,7 @@ declare namespace FourSlashInterface { errorCode?: number, index?: number, }); - codeFixAvailable(options: Array<{ description: string, actions?: Array<{ type: string, data: {} }>, commands?: {}[] }>): void; + codeFixAvailable(options?: Array<{ description: string, actions?: Array<{ type: string, data: {} }>, commands?: {}[] }>): void; applicableRefactorAvailableAtMarker(markerName: string): void; codeFixDiagnosticsAvailableAtMarkers(markerNames: string[], diagnosticCode?: number): void; applicableRefactorAvailableForRange(): void; diff --git a/tests/cases/fourslash/refactorUseDefaultImport.ts b/tests/cases/fourslash/refactorUseDefaultImport.ts index 8834b70f85e..3846c1d5c1e 100644 --- a/tests/cases/fourslash/refactorUseDefaultImport.ts +++ b/tests/cases/fourslash/refactorUseDefaultImport.ts @@ -12,6 +12,12 @@ // @Filename: /c.ts /////*c0*/import a = require("./a");/*c1*/ +// @Filename: /d.ts +/////*d0*/import "./a";/*d1*/ + +// @Filename: /e.ts +/////*e0*/import * as n from "./non-existant";/*e1*/ + goTo.select("b0", "b1"); edit.applyRefactor({ refactorName: "Convert to default import", @@ -27,3 +33,9 @@ edit.applyRefactor({ actionDescription: "Convert to default import", newContent: 'import a from "./a";', }); + +goTo.select("d0", "d1"); +verify.not.applicableRefactorAvailableAtMarker("d0"); + +goTo.select("e0", "e1"); +verify.not.applicableRefactorAvailableAtMarker("e0"); \ No newline at end of file From 67984c720ee03e798772bc6c3c425237b4e20ccd Mon Sep 17 00:00:00 2001 From: jack-williams Date: Mon, 12 Feb 2018 18:57:59 +0000 Subject: [PATCH 119/298] Fix #21848: Allows to mutate `const` with non-null assertion (#21873) --- src/compiler/utilities.ts | 1 + tests/baselines/reference/constWithNonNull.errors.txt | 11 +++++++++++ tests/baselines/reference/constWithNonNull.js | 10 ++++++++++ tests/baselines/reference/constWithNonNull.symbols | 9 +++++++++ tests/baselines/reference/constWithNonNull.types | 11 +++++++++++ tests/cases/compiler/constWithNonNull.ts | 4 ++++ 6 files changed, 46 insertions(+) create mode 100644 tests/baselines/reference/constWithNonNull.errors.txt create mode 100644 tests/baselines/reference/constWithNonNull.js create mode 100644 tests/baselines/reference/constWithNonNull.symbols create mode 100644 tests/baselines/reference/constWithNonNull.types create mode 100644 tests/cases/compiler/constWithNonNull.ts diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 1de61bd71b5..c8541da79d1 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1754,6 +1754,7 @@ namespace ts { case SyntaxKind.ParenthesizedExpression: case SyntaxKind.ArrayLiteralExpression: case SyntaxKind.SpreadElement: + case SyntaxKind.NonNullExpression: node = parent; break; case SyntaxKind.ShorthandPropertyAssignment: diff --git a/tests/baselines/reference/constWithNonNull.errors.txt b/tests/baselines/reference/constWithNonNull.errors.txt new file mode 100644 index 00000000000..58667c417da --- /dev/null +++ b/tests/baselines/reference/constWithNonNull.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/constWithNonNull.ts(4,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. + + +==== tests/cases/compiler/constWithNonNull.ts (1 errors) ==== + // Fixes #21848 + + declare const x: number | undefined; + x!++; + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. + \ No newline at end of file diff --git a/tests/baselines/reference/constWithNonNull.js b/tests/baselines/reference/constWithNonNull.js new file mode 100644 index 00000000000..66aeb426489 --- /dev/null +++ b/tests/baselines/reference/constWithNonNull.js @@ -0,0 +1,10 @@ +//// [constWithNonNull.ts] +// Fixes #21848 + +declare const x: number | undefined; +x!++; + + +//// [constWithNonNull.js] +// Fixes #21848 +x++; diff --git a/tests/baselines/reference/constWithNonNull.symbols b/tests/baselines/reference/constWithNonNull.symbols new file mode 100644 index 00000000000..4f5ddcbb454 --- /dev/null +++ b/tests/baselines/reference/constWithNonNull.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/constWithNonNull.ts === +// Fixes #21848 + +declare const x: number | undefined; +>x : Symbol(x, Decl(constWithNonNull.ts, 2, 13)) + +x!++; +>x : Symbol(x, Decl(constWithNonNull.ts, 2, 13)) + diff --git a/tests/baselines/reference/constWithNonNull.types b/tests/baselines/reference/constWithNonNull.types new file mode 100644 index 00000000000..b58fb7a62d5 --- /dev/null +++ b/tests/baselines/reference/constWithNonNull.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/constWithNonNull.ts === +// Fixes #21848 + +declare const x: number | undefined; +>x : number + +x!++; +>x!++ : number +>x! : any +>x : any + diff --git a/tests/cases/compiler/constWithNonNull.ts b/tests/cases/compiler/constWithNonNull.ts new file mode 100644 index 00000000000..3a5718f31a7 --- /dev/null +++ b/tests/cases/compiler/constWithNonNull.ts @@ -0,0 +1,4 @@ +// Fixes #21848 + +declare const x: number | undefined; +x!++; From 2d80253d09853304e6e15b7f1d52d59a7776b8a6 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Feb 2018 11:09:50 -0800 Subject: [PATCH 120/298] Fix error message for implicit-any property in object literal with symbol key (#21883) --- src/compiler/checker.ts | 2 +- .../objectLiteralPropertyImplicitlyAny.errors.txt | 9 +++++++++ .../objectLiteralPropertyImplicitlyAny.js | 8 ++++++++ .../objectLiteralPropertyImplicitlyAny.symbols | 12 ++++++++++++ .../objectLiteralPropertyImplicitlyAny.types | 15 +++++++++++++++ .../objectLiteralPropertyImplicitlyAny.ts | 5 +++++ 6 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/objectLiteralPropertyImplicitlyAny.errors.txt create mode 100644 tests/baselines/reference/objectLiteralPropertyImplicitlyAny.js create mode 100644 tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols create mode 100644 tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types create mode 100644 tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 027e8f095a0..d336336f549 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11203,7 +11203,7 @@ namespace ts { const t = getTypeOfSymbol(p); if (t.flags & TypeFlags.ContainsWideningType) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } diff --git a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.errors.txt b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.errors.txt new file mode 100644 index 00000000000..3fd7aea4503 --- /dev/null +++ b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.errors.txt @@ -0,0 +1,9 @@ +tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts(2,13): error TS7018: Object literal's property '[foo]' implicitly has an 'any' type. + + +==== tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts (1 errors) ==== + const foo = Symbol.for("foo"); + const o = { [foo]: undefined }; + ~~~~~~~~~~~~~~~~ +!!! error TS7018: Object literal's property '[foo]' implicitly has an 'any' type. + \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.js b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.js new file mode 100644 index 00000000000..f779b5095e1 --- /dev/null +++ b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.js @@ -0,0 +1,8 @@ +//// [objectLiteralPropertyImplicitlyAny.ts] +const foo = Symbol.for("foo"); +const o = { [foo]: undefined }; + + +//// [objectLiteralPropertyImplicitlyAny.js] +const foo = Symbol.for("foo"); +const o = { [foo]: undefined }; diff --git a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols new file mode 100644 index 00000000000..570a6d8212d --- /dev/null +++ b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts === +const foo = Symbol.for("foo"); +>foo : Symbol(foo, Decl(objectLiteralPropertyImplicitlyAny.ts, 0, 5)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) + +const o = { [foo]: undefined }; +>o : Symbol(o, Decl(objectLiteralPropertyImplicitlyAny.ts, 1, 5)) +>foo : Symbol(foo, Decl(objectLiteralPropertyImplicitlyAny.ts, 0, 5)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types new file mode 100644 index 00000000000..36d33fa6841 --- /dev/null +++ b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types @@ -0,0 +1,15 @@ +=== tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts === +const foo = Symbol.for("foo"); +>foo : unique symbol +>Symbol.for("foo") : unique symbol +>Symbol.for : (key: string) => symbol +>Symbol : SymbolConstructor +>for : (key: string) => symbol +>"foo" : "foo" + +const o = { [foo]: undefined }; +>o : { [foo]: any; } +>{ [foo]: undefined } : { [foo]: undefined; } +>foo : unique symbol +>undefined : undefined + diff --git a/tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts b/tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts new file mode 100644 index 00000000000..e87d279c401 --- /dev/null +++ b/tests/cases/compiler/objectLiteralPropertyImplicitlyAny.ts @@ -0,0 +1,5 @@ +// @target: esnext +// @noImplicitAny: true + +const foo = Symbol.for("foo"); +const o = { [foo]: undefined }; From fcf348610c11db67950c117cc89e63a45f6406e6 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Feb 2018 11:34:49 -0800 Subject: [PATCH 121/298] documentHighlights: Handle some invalid modifier locations (#21893) --- src/services/documentHighlights.ts | 16 ++++++++++------ ...documentHighlightsInvalidModifierLocations.ts | 10 ++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 tests/cases/fourslash/documentHighlightsInvalidModifierLocations.ts diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts index 84ef457310e..dd5281f15bc 100644 --- a/src/services/documentHighlights.ts +++ b/src/services/documentHighlights.ts @@ -200,7 +200,8 @@ namespace ts.DocumentHighlights { } function getNodesToSearchForModifier(declaration: Node, modifierFlag: ModifierFlags): ReadonlyArray { - const container = declaration.parent; + // Types of node whose children might have modifiers. + const container = declaration.parent as ModuleBlock | SourceFile | Block | CaseClause | DefaultClause | ConstructorDeclaration | MethodDeclaration | FunctionDeclaration | ClassLikeDeclaration; switch (container.kind) { case SyntaxKind.ModuleBlock: case SyntaxKind.SourceFile: @@ -212,18 +213,21 @@ namespace ts.DocumentHighlights { return [...declaration.members, declaration]; } else { - return (container).statements; + return container.statements; } case SyntaxKind.Constructor: - return [...(container).parameters, ...(container.parent).members]; + case SyntaxKind.MethodDeclaration: + case SyntaxKind.FunctionDeclaration: { + return [...container.parameters, ...(isClassLike(container.parent) ? container.parent.members : [])]; + } case SyntaxKind.ClassDeclaration: case SyntaxKind.ClassExpression: - const nodes = (container).members; + const nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. if (modifierFlag & ModifierFlags.AccessibilityModifier) { - const constructor = find((container).members, isConstructorDeclaration); + const constructor = find(container.members, isConstructorDeclaration); if (constructor) { return [...nodes, ...constructor.parameters]; } @@ -233,7 +237,7 @@ namespace ts.DocumentHighlights { } return nodes; default: - Debug.fail("Invalid container kind."); + Debug.assertNever(container, "Invalid container kind."); } } diff --git a/tests/cases/fourslash/documentHighlightsInvalidModifierLocations.ts b/tests/cases/fourslash/documentHighlightsInvalidModifierLocations.ts new file mode 100644 index 00000000000..f008e632464 --- /dev/null +++ b/tests/cases/fourslash/documentHighlightsInvalidModifierLocations.ts @@ -0,0 +1,10 @@ +/// + +////class C { +//// m([|readonly|] p) {} +////} +////function f([|readonly|] p) {} + +for (const r of test.ranges()) { + verify.documentHighlightsOf(r, [r]); +} From c9a0b7ec5b236f0f4092bb601e96ead6390c9b3b Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 12 Feb 2018 11:53:03 -0800 Subject: [PATCH 122/298] Port generated lib files (#21889) --- src/lib/dom.generated.d.ts | 911 ++++++++++-------- src/lib/webworker.generated.d.ts | 116 +-- .../mappedTypeRecursiveInference.types | 20 +- .../modularizeLibrary_Dom.iterable.types | 4 +- 4 files changed, 545 insertions(+), 506 deletions(-) diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index 951d34377a6..ff764a8a06e 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -1169,21 +1169,13 @@ interface WheelEventInit extends MouseEventInit { deltaZ?: number; } -interface EventListener { - (evt: Event): void; -} +type EventListener = (evt: Event) => void | { handleEvent(evt: Event): void; }; -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = (entries: WebKitEntry[]) => void | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = (err: DOMError) => void | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = (file: File) => void | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -1257,9 +1249,9 @@ interface ApplicationCache extends EventTarget { readonly UNCACHED: number; readonly UPDATEREADY: number; addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ApplicationCache: { @@ -1316,9 +1308,9 @@ interface AudioBufferSourceNode extends AudioNode { start(when?: number, offset?: number, duration?: number): void; stop(when?: number): void; addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var AudioBufferSourceNode: { @@ -1360,9 +1352,9 @@ interface AudioContextBase extends EventTarget { decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise; resume(): Promise; addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface AudioContext extends AudioContextBase { @@ -1470,9 +1462,9 @@ interface AudioTrackList extends EventTarget { getTrackById(id: string): AudioTrack | null; item(index: number): AudioTrack; addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; [index: number]: AudioTrack; } @@ -2391,9 +2383,9 @@ declare var CustomEvent: { interface DataCue extends TextTrackCue { data: ArrayBuffer; addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var DataCue: { @@ -3080,6 +3072,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -3108,8 +3101,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -3317,9 +3310,9 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven */ writeln(...content: string[]): void; addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Document: { @@ -3647,9 +3640,9 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec insertAdjacentText(where: InsertPosition, text: string): void; attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Element: { @@ -3704,9 +3697,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -3787,9 +3780,9 @@ interface FileReader extends EventTarget, MSBaseReader { readAsDataURL(blob: Blob): void; readAsText(blob: Blob, encoding?: string): void; addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var FileReader: { @@ -4022,9 +4015,9 @@ interface HTMLAnchorElement extends HTMLElement { */ toString(): string; addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLAnchorElement: { @@ -4098,9 +4091,9 @@ interface HTMLAppletElement extends HTMLElement { vspace: number; width: number; addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLAppletElement: { @@ -4168,9 +4161,9 @@ interface HTMLAreaElement extends HTMLElement { */ toString(): string; addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLAreaElement: { @@ -4188,9 +4181,9 @@ declare var HTMLAreasCollection: { interface HTMLAudioElement extends HTMLMediaElement { addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLAudioElement: { @@ -4208,9 +4201,9 @@ interface HTMLBaseElement extends HTMLElement { */ target: string; addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLBaseElement: { @@ -4228,9 +4221,9 @@ interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty */ size: number; addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLBaseFontElement: { @@ -4284,9 +4277,9 @@ interface HTMLBodyElement extends HTMLElement { text: any; vLink: any; addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLBodyElement: { @@ -4300,9 +4293,9 @@ interface HTMLBRElement extends HTMLElement { */ clear: string; addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLBRElement: { @@ -4375,9 +4368,9 @@ interface HTMLButtonElement extends HTMLElement { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLButtonElement: { @@ -4412,9 +4405,9 @@ interface HTMLCanvasElement extends HTMLElement { toDataURL(type?: string, ...args: any[]): string; toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLCanvasElement: { @@ -4449,9 +4442,9 @@ declare var HTMLCollection: { interface HTMLDataElement extends HTMLElement { value: string; addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLDataElement: { @@ -4462,9 +4455,9 @@ declare var HTMLDataElement: { interface HTMLDataListElement extends HTMLElement { options: HTMLCollectionOf; addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLDataListElement: { @@ -4475,9 +4468,9 @@ declare var HTMLDataListElement: { interface HTMLDirectoryElement extends HTMLElement { compact: boolean; addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLDirectoryElement: { @@ -4495,9 +4488,9 @@ interface HTMLDivElement extends HTMLElement { */ noWrap: boolean; addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLDivElement: { @@ -4508,9 +4501,9 @@ declare var HTMLDivElement: { interface HTMLDListElement extends HTMLElement { compact: boolean; addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLDListElement: { @@ -4520,9 +4513,9 @@ declare var HTMLDListElement: { interface HTMLDocument extends Document { addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLDocument: { @@ -4694,10 +4687,11 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLElement: { @@ -4753,9 +4747,9 @@ interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { */ width: string; addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLEmbedElement: { @@ -4796,9 +4790,9 @@ interface HTMLFieldSetElement extends HTMLElement { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLFieldSetElement: { @@ -4812,9 +4806,9 @@ interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOM */ face: string; addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLFontElement: { @@ -4901,9 +4895,9 @@ interface HTMLFormElement extends HTMLElement { reportValidity(): boolean; reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; [name: string]: any; } @@ -4978,9 +4972,9 @@ interface HTMLFrameElement extends HTMLElement, GetSVGDocument { */ width: string | number; addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLFrameElement: { @@ -5048,9 +5042,9 @@ interface HTMLFrameSetElement extends HTMLElement { */ rows: string; addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLFrameSetElement: { @@ -5061,9 +5055,9 @@ declare var HTMLFrameSetElement: { interface HTMLHeadElement extends HTMLElement { profile: string; addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLHeadElement: { @@ -5077,9 +5071,9 @@ interface HTMLHeadingElement extends HTMLElement { */ align: string; addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLHeadingElement: { @@ -5101,9 +5095,9 @@ interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2 */ width: number; addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLHRElement: { @@ -5117,9 +5111,9 @@ interface HTMLHtmlElement extends HTMLElement { */ version: string; addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLHtmlElement: { @@ -5208,9 +5202,9 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { */ srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLIFrameElement: { @@ -5301,9 +5295,9 @@ interface HTMLImageElement extends HTMLElement { readonly y: number; msGetAsCastingSource(): any; addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLImageElement: { @@ -5516,9 +5510,9 @@ interface HTMLInputElement extends HTMLElement { */ stepUp(n?: number): void; addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLInputElement: { @@ -5537,9 +5531,9 @@ interface HTMLLabelElement extends HTMLElement { htmlFor: string; readonly control: HTMLInputElement | null; addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLLabelElement: { @@ -5557,9 +5551,9 @@ interface HTMLLegendElement extends HTMLElement { */ readonly form: HTMLFormElement | null; addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLLegendElement: { @@ -5574,9 +5568,9 @@ interface HTMLLIElement extends HTMLElement { */ value: number; addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLLIElement: { @@ -5621,9 +5615,9 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle { import?: Document; integrity: string; addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLLinkElement: { @@ -5641,9 +5635,9 @@ interface HTMLMapElement extends HTMLElement { */ name: string; addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLMapElement: { @@ -5675,9 +5669,9 @@ interface HTMLMarqueeElement extends HTMLElement { start(): void; stop(): void; addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLMarqueeElement: { @@ -5859,9 +5853,9 @@ interface HTMLMediaElement extends HTMLElement { readonly NETWORK_LOADING: number; readonly NETWORK_NO_SOURCE: number; addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLMediaElement: { @@ -5882,9 +5876,9 @@ interface HTMLMenuElement extends HTMLElement { compact: boolean; type: string; addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLMenuElement: { @@ -5918,9 +5912,9 @@ interface HTMLMetaElement extends HTMLElement { */ url: string; addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLMetaElement: { @@ -5936,9 +5930,9 @@ interface HTMLMeterElement extends HTMLElement { optimum: number; value: number; addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLMeterElement: { @@ -5956,9 +5950,9 @@ interface HTMLModElement extends HTMLElement { */ dateTime: string; addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLModElement: { @@ -5968,10 +5962,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -6076,9 +6066,9 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLObjectElement: { @@ -6094,9 +6084,9 @@ interface HTMLOListElement extends HTMLElement { start: number; type: string; addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLOListElement: { @@ -6135,9 +6125,9 @@ interface HTMLOptGroupElement extends HTMLElement { */ value: string; addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLOptGroupElement: { @@ -6176,9 +6166,9 @@ interface HTMLOptionElement extends HTMLElement { */ value: string; addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLOptionElement: { @@ -6212,9 +6202,9 @@ interface HTMLOutputElement extends HTMLElement { reportValidity(): boolean; setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLOutputElement: { @@ -6229,9 +6219,9 @@ interface HTMLParagraphElement extends HTMLElement { align: string; clear: string; addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLParagraphElement: { @@ -6257,9 +6247,9 @@ interface HTMLParamElement extends HTMLElement { */ valueType: string; addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLParamElement: { @@ -6269,9 +6259,9 @@ declare var HTMLParamElement: { interface HTMLPictureElement extends HTMLElement { addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLPictureElement: { @@ -6285,9 +6275,9 @@ interface HTMLPreElement extends HTMLElement { */ width: number; addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLPreElement: { @@ -6313,9 +6303,9 @@ interface HTMLProgressElement extends HTMLElement { */ value: number; addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLProgressElement: { @@ -6329,9 +6319,9 @@ interface HTMLQuoteElement extends HTMLElement { */ cite: string; addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLQuoteElement: { @@ -6372,9 +6362,9 @@ interface HTMLScriptElement extends HTMLElement { type: string; integrity: string; addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLScriptElement: { @@ -6470,9 +6460,9 @@ interface HTMLSelectElement extends HTMLElement { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; [name: string]: any; } @@ -6498,9 +6488,9 @@ interface HTMLSourceElement extends HTMLElement { */ type: string; addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLSourceElement: { @@ -6510,9 +6500,9 @@ declare var HTMLSourceElement: { interface HTMLSpanElement extends HTMLElement { addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLSpanElement: { @@ -6531,9 +6521,9 @@ interface HTMLStyleElement extends HTMLElement, LinkStyle { */ type: string; addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLStyleElement: { @@ -6551,9 +6541,9 @@ interface HTMLTableCaptionElement extends HTMLElement { */ vAlign: string; addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableCaptionElement: { @@ -6608,9 +6598,9 @@ interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { */ width: string; addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableCellElement: { @@ -6632,9 +6622,9 @@ interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { */ width: any; addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableColElement: { @@ -6644,9 +6634,9 @@ declare var HTMLTableColElement: { interface HTMLTableDataCellElement extends HTMLTableCellElement { addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableDataCellElement: { @@ -6759,9 +6749,9 @@ interface HTMLTableElement extends HTMLElement { */ insertRow(index?: number): HTMLTableRowElement; addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableElement: { @@ -6775,9 +6765,9 @@ interface HTMLTableHeaderCellElement extends HTMLTableCellElement { */ scope: string; addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableHeaderCellElement: { @@ -6818,9 +6808,9 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { */ insertCell(index?: number): HTMLTableDataCellElement; addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableRowElement: { @@ -6848,9 +6838,9 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { */ insertRow(index?: number): HTMLTableRowElement; addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTableSectionElement: { @@ -6861,9 +6851,9 @@ declare var HTMLTableSectionElement: { interface HTMLTemplateElement extends HTMLElement { readonly content: DocumentFragment; addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTemplateElement: { @@ -6971,9 +6961,9 @@ interface HTMLTextAreaElement extends HTMLElement { */ setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTextAreaElement: { @@ -6984,9 +6974,9 @@ declare var HTMLTextAreaElement: { interface HTMLTimeElement extends HTMLElement { dateTime: string; addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTimeElement: { @@ -7000,9 +6990,9 @@ interface HTMLTitleElement extends HTMLElement { */ text: string; addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTitleElement: { @@ -7023,9 +7013,9 @@ interface HTMLTrackElement extends HTMLElement { readonly LOADING: number; readonly NONE: number; addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLTrackElement: { @@ -7041,9 +7031,9 @@ interface HTMLUListElement extends HTMLElement { compact: boolean; type: string; addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLUListElement: { @@ -7053,9 +7043,9 @@ declare var HTMLUListElement: { interface HTMLUnknownElement extends HTMLElement { addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLUnknownElement: { @@ -7110,9 +7100,9 @@ interface HTMLVideoElement extends HTMLMediaElement { webkitExitFullscreen(): void; webkitExitFullScreen(): void; addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var HTMLVideoElement: { @@ -7172,9 +7162,9 @@ interface IDBDatabase extends EventTarget { addEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | EventListenerOptions): void; addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBDatabase: { @@ -7259,9 +7249,9 @@ interface IDBOpenDBRequest extends IDBRequest { onblocked: (this: IDBOpenDBRequest, ev: Event) => any; onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBOpenDBRequest: { @@ -7283,9 +7273,9 @@ interface IDBRequest extends EventTarget { source: IDBObjectStore | IDBIndex | IDBCursor; readonly transaction: IDBTransaction; addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBRequest: { @@ -7312,9 +7302,9 @@ interface IDBTransaction extends EventTarget { readonly READ_WRITE: string; readonly VERSION_CHANGE: string; addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBTransaction: { @@ -7484,9 +7474,9 @@ interface MediaDevices extends EventTarget { getSupportedConstraints(): MediaTrackSupportedConstraints; getUserMedia(constraints: MediaStreamConstraints): Promise; addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MediaDevices: { @@ -7658,9 +7648,9 @@ interface MediaStream extends EventTarget { removeTrack(track: MediaStreamTrack): void; stop(): void; addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MediaStream: { @@ -7732,9 +7722,9 @@ interface MediaStreamTrack extends EventTarget { getSettings(): MediaTrackSettings; stop(): void; addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MediaStreamTrack: { @@ -7784,9 +7774,9 @@ interface MessagePort extends EventTarget { postMessage(message?: any, transfer?: any[]): void; start(): void; addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MessagePort: { @@ -7891,9 +7881,9 @@ interface MSAppAsyncOperation extends EventTarget { readonly ERROR: number; readonly STARTED: number; addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MSAppAsyncOperation: { @@ -8049,9 +8039,9 @@ interface MSHTMLWebViewElement extends HTMLElement { refresh(): void; stop(): void; addEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MSHTMLWebViewElement: { @@ -8077,9 +8067,9 @@ interface MSInputMethodContext extends EventTarget { hasComposition(): boolean; isCandidateWindowVisible(): boolean; addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MSInputMethodContext: { @@ -8245,9 +8235,9 @@ interface MSStreamReader extends EventTarget, MSBaseReader { readAsDataURL(stream: MSStream, size?: number): void; readAsText(stream: MSStream, encoding?: string, size?: number): void; addEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MSStreamReader: { @@ -8276,9 +8266,9 @@ interface MSWebViewAsyncOperation extends EventTarget { readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; readonly TYPE_INVOKE_SCRIPT: number; addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MSWebViewAsyncOperation: { @@ -8569,9 +8559,9 @@ interface Notification extends EventTarget { readonly title: string; close(): void; addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Notification: { @@ -8651,9 +8641,9 @@ interface OfflineAudioContext extends AudioContextBase { startRendering(): Promise; suspend(suspendTime: number): Promise; addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var OfflineAudioContext: { @@ -8674,9 +8664,9 @@ interface OscillatorNode extends AudioNode { start(when?: number): void; stop(when?: number): void; addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var OscillatorNode: { @@ -8771,9 +8761,9 @@ interface PaymentRequest extends EventTarget { abort(): Promise; show(): Promise; addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var PaymentRequest: { @@ -9124,7 +9114,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -9281,9 +9271,9 @@ interface RTCDtlsTransport extends RTCStatsProvider { start(remoteParameters: RTCDtlsParameters): void; stop(): void; addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCDtlsTransport: { @@ -9313,9 +9303,9 @@ interface RTCDtmfSender extends EventTarget { readonly toneBuffer: string; insertDTMF(tones: string, duration?: number, interToneGap?: number): void; addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCDtmfSender: { @@ -9366,9 +9356,9 @@ interface RTCIceGatherer extends RTCStatsProvider { getLocalCandidates(): RTCIceCandidateDictionary[]; getLocalParameters(): RTCIceParameters; addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCIceGatherer: { @@ -9406,9 +9396,9 @@ interface RTCIceTransport extends RTCStatsProvider { start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void; stop(): void; addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCIceTransport: { @@ -9463,9 +9453,9 @@ interface RTCPeerConnection extends EventTarget { setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCPeerConnection: { @@ -9497,9 +9487,9 @@ interface RTCRtpReceiver extends RTCStatsProvider { setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; stop(): void; addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCRtpReceiver: { @@ -9524,9 +9514,9 @@ interface RTCRtpSender extends RTCStatsProvider { setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; stop(): void; addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCRtpSender: { @@ -9554,9 +9544,9 @@ interface RTCSrtpSdesTransport extends EventTarget { onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null; readonly transport: RTCIceTransport; addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var RTCSrtpSdesTransport: { @@ -9628,9 +9618,9 @@ interface Screen extends EventTarget { msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Screen: { @@ -9656,9 +9646,9 @@ interface ScriptProcessorNode extends AudioNode { readonly bufferSize: number; onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ScriptProcessorNode: { @@ -9710,9 +9700,9 @@ interface ServiceWorker extends EventTarget, AbstractWorker { readonly state: ServiceWorkerState; postMessage(message: any, transfer?: any[]): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ServiceWorker: { @@ -9734,9 +9724,9 @@ interface ServiceWorkerContainer extends EventTarget { getRegistrations(): Promise; register(scriptURL: USVString, options?: RegistrationOptions): Promise; addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerContainer: { @@ -9774,9 +9764,9 @@ interface ServiceWorkerRegistration extends EventTarget { unregister(): Promise; update(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerRegistration: { @@ -9830,9 +9820,9 @@ interface SpeechSynthesis extends EventTarget { resume(): void; speak(utterance: SpeechSynthesisUtterance): void; addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SpeechSynthesis: { @@ -9877,9 +9867,9 @@ interface SpeechSynthesisUtterance extends EventTarget { voice: SpeechSynthesisVoice; volume: number; addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SpeechSynthesisUtterance: { @@ -10014,9 +10004,9 @@ declare var SubtleCrypto: { interface SVGAElement extends SVGGraphicsElement, SVGURIReference { readonly target: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGAElement: { @@ -10173,9 +10163,9 @@ interface SVGCircleElement extends SVGGraphicsElement { readonly cy: SVGAnimatedLength; readonly r: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGCircleElement: { @@ -10186,9 +10176,9 @@ declare var SVGCircleElement: { interface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes { readonly clipPathUnits: SVGAnimatedEnumeration; addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGClipPathElement: { @@ -10211,9 +10201,9 @@ interface SVGComponentTransferFunctionElement extends SVGElement { readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGComponentTransferFunctionElement: { @@ -10229,9 +10219,9 @@ declare var SVGComponentTransferFunctionElement: { interface SVGDefsElement extends SVGGraphicsElement { addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGDefsElement: { @@ -10241,9 +10231,9 @@ declare var SVGDefsElement: { interface SVGDescElement extends SVGElement { addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGDescElement: { @@ -10281,9 +10271,9 @@ interface SVGElement extends Element { readonly viewportElement: SVGElement; xmlbase: string; addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGElement: { @@ -10323,9 +10313,9 @@ interface SVGEllipseElement extends SVGGraphicsElement { readonly rx: SVGAnimatedLength; readonly ry: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGEllipseElement: { @@ -10355,9 +10345,9 @@ interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttrib readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; readonly SVG_FEBLEND_MODE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEBlendElement: { @@ -10392,9 +10382,9 @@ interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandard readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEColorMatrixElement: { @@ -10410,9 +10400,9 @@ declare var SVGFEColorMatrixElement: { interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEComponentTransferElement: { @@ -10436,9 +10426,9 @@ interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAt readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFECompositeElement: { @@ -10471,9 +10461,9 @@ interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStand readonly SVG_EDGEMODE_UNKNOWN: number; readonly SVG_EDGEMODE_WRAP: number; addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEConvolveMatrixElement: { @@ -10492,9 +10482,9 @@ interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStan readonly kernelUnitLengthY: SVGAnimatedNumber; readonly surfaceScale: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEDiffuseLightingElement: { @@ -10514,9 +10504,9 @@ interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStan readonly SVG_CHANNEL_R: number; readonly SVG_CHANNEL_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEDisplacementMapElement: { @@ -10533,9 +10523,9 @@ interface SVGFEDistantLightElement extends SVGElement { readonly azimuth: SVGAnimatedNumber; readonly elevation: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEDistantLightElement: { @@ -10545,9 +10535,9 @@ declare var SVGFEDistantLightElement: { interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEFloodElement: { @@ -10557,9 +10547,9 @@ declare var SVGFEFloodElement: { interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncAElement: { @@ -10569,9 +10559,9 @@ declare var SVGFEFuncAElement: { interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncBElement: { @@ -10581,9 +10571,9 @@ declare var SVGFEFuncBElement: { interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncGElement: { @@ -10593,9 +10583,9 @@ declare var SVGFEFuncGElement: { interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncRElement: { @@ -10609,9 +10599,9 @@ interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandar readonly stdDeviationY: SVGAnimatedNumber; setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEGaussianBlurElement: { @@ -10622,9 +10612,9 @@ declare var SVGFEGaussianBlurElement: { interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEImageElement: { @@ -10634,9 +10624,9 @@ declare var SVGFEImageElement: { interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEMergeElement: { @@ -10647,9 +10637,9 @@ declare var SVGFEMergeElement: { interface SVGFEMergeNodeElement extends SVGElement { readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEMergeNodeElement: { @@ -10666,9 +10656,9 @@ interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardA readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEMorphologyElement: { @@ -10684,9 +10674,9 @@ interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttri readonly dy: SVGAnimatedNumber; readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEOffsetElement: { @@ -10699,9 +10689,9 @@ interface SVGFEPointLightElement extends SVGElement { readonly y: SVGAnimatedNumber; readonly z: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFEPointLightElement: { @@ -10717,9 +10707,9 @@ interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveSta readonly specularExponent: SVGAnimatedNumber; readonly surfaceScale: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFESpecularLightingElement: { @@ -10737,9 +10727,9 @@ interface SVGFESpotLightElement extends SVGElement { readonly y: SVGAnimatedNumber; readonly z: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFESpotLightElement: { @@ -10750,9 +10740,9 @@ declare var SVGFESpotLightElement: { interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFETileElement: { @@ -10774,9 +10764,9 @@ interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardA readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFETurbulenceElement: { @@ -10801,9 +10791,9 @@ interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference { readonly y: SVGAnimatedLength; setFilterRes(filterResX: number, filterResY: number): void; addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGFilterElement: { @@ -10817,9 +10807,9 @@ interface SVGForeignObjectElement extends SVGGraphicsElement { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGForeignObjectElement: { @@ -10829,9 +10819,9 @@ declare var SVGForeignObjectElement: { interface SVGGElement extends SVGGraphicsElement { addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGGElement: { @@ -10848,9 +10838,9 @@ interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference { readonly SVG_SPREADMETHOD_REPEAT: number; readonly SVG_SPREADMETHOD_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGGradientElement: { @@ -10871,9 +10861,9 @@ interface SVGGraphicsElement extends SVGElement, SVGTests { getScreenCTM(): SVGMatrix; getTransformToElement(element: SVGElement): SVGMatrix; addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGGraphicsElement: { @@ -10888,9 +10878,9 @@ interface SVGImageElement extends SVGGraphicsElement, SVGURIReference { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGImageElement: { @@ -10956,9 +10946,9 @@ interface SVGLinearGradientElement extends SVGGradientElement { readonly y1: SVGAnimatedLength; readonly y2: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGLinearGradientElement: { @@ -10972,9 +10962,9 @@ interface SVGLineElement extends SVGGraphicsElement { readonly y1: SVGAnimatedLength; readonly y2: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGLineElement: { @@ -10999,9 +10989,9 @@ interface SVGMarkerElement extends SVGElement, SVGFitToViewBox { readonly SVG_MARKERUNITS_UNKNOWN: number; readonly SVG_MARKERUNITS_USERSPACEONUSE: number; addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGMarkerElement: { @@ -11023,9 +11013,9 @@ interface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGMaskElement: { @@ -11060,9 +11050,9 @@ declare var SVGMatrix: { interface SVGMetadataElement extends SVGElement { addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGMetadataElement: { @@ -11120,9 +11110,9 @@ interface SVGPathElement extends SVGGraphicsElement { getPointAtLength(distance: number): SVGPoint; getTotalLength(): number; addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGPathElement: { @@ -11415,9 +11405,9 @@ interface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitTo readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGPatternElement: { @@ -11454,9 +11444,9 @@ declare var SVGPointList: { interface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints { addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGPolygonElement: { @@ -11466,9 +11456,9 @@ declare var SVGPolygonElement: { interface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints { addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGPolylineElement: { @@ -11521,9 +11511,9 @@ interface SVGRadialGradientElement extends SVGGradientElement { readonly fy: SVGAnimatedLength; readonly r: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGRadialGradientElement: { @@ -11551,9 +11541,9 @@ interface SVGRectElement extends SVGGraphicsElement { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGRectElement: { @@ -11564,9 +11554,9 @@ declare var SVGRectElement: { interface SVGScriptElement extends SVGElement, SVGURIReference { type: string; addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGScriptElement: { @@ -11577,9 +11567,9 @@ declare var SVGScriptElement: { interface SVGStopElement extends SVGElement { readonly offset: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGStopElement: { @@ -11609,9 +11599,9 @@ interface SVGStyleElement extends SVGElement { title: string; type: string; addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGStyleElement: { @@ -11672,9 +11662,9 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB unsuspendRedraw(suspendHandleID: number): void; unsuspendRedrawAll(): void; addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGSVGElement: { @@ -11684,9 +11674,9 @@ declare var SVGSVGElement: { interface SVGSwitchElement extends SVGGraphicsElement { addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGSwitchElement: { @@ -11696,9 +11686,9 @@ declare var SVGSwitchElement: { interface SVGSymbolElement extends SVGElement, SVGFitToViewBox { addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGSymbolElement: { @@ -11722,9 +11712,9 @@ interface SVGTextContentElement extends SVGGraphicsElement { readonly LENGTHADJUST_SPACINGANDGLYPHS: number; readonly LENGTHADJUST_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGTextContentElement: { @@ -11737,9 +11727,9 @@ declare var SVGTextContentElement: { interface SVGTextElement extends SVGTextPositioningElement { addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGTextElement: { @@ -11758,9 +11748,9 @@ interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { readonly TEXTPATH_SPACINGTYPE_EXACT: number; readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGTextPathElement: { @@ -11781,9 +11771,9 @@ interface SVGTextPositioningElement extends SVGTextContentElement { readonly x: SVGAnimatedLengthList; readonly y: SVGAnimatedLengthList; addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGTextPositioningElement: { @@ -11793,9 +11783,9 @@ declare var SVGTextPositioningElement: { interface SVGTitleElement extends SVGElement { addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGTitleElement: { @@ -11854,9 +11844,9 @@ declare var SVGTransformList: { interface SVGTSpanElement extends SVGTextPositioningElement { addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGTSpanElement: { @@ -11879,9 +11869,9 @@ interface SVGUseElement extends SVGGraphicsElement, SVGURIReference { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGUseElement: { @@ -11892,9 +11882,9 @@ declare var SVGUseElement: { interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox { readonly viewTarget: SVGStringList; addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var SVGViewElement: { @@ -12015,9 +12005,9 @@ interface TextTrack extends EventTarget { readonly NONE: number; readonly SHOWING: number; addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var TextTrack: { @@ -12048,9 +12038,9 @@ interface TextTrackCue extends EventTarget { readonly track: TextTrack; getCueAsHTML(): DocumentFragment; addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var TextTrackCue: { @@ -12079,9 +12069,9 @@ interface TextTrackList extends EventTarget { onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; item(index: number): TextTrack; addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; [index: number]: TextTrack; } @@ -12290,9 +12280,9 @@ interface VideoTrackList extends EventTarget { getTrackById(id: string): VideoTrack | null; item(index: number): VideoTrack; addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; [index: number]: VideoTrack; } @@ -12565,24 +12555,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -13333,9 +13323,9 @@ declare var WebKitPoint: { interface webkitRTCPeerConnection extends RTCPeerConnection { addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var webkitRTCPeerConnection: { @@ -13362,15 +13352,15 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var WebSocket: { @@ -13683,9 +13673,9 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window scrollTo(options?: ScrollToOptions): void; scrollBy(options?: ScrollToOptions): void; addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Window: { @@ -13702,9 +13692,9 @@ interface Worker extends EventTarget, AbstractWorker { postMessage(message: any, transfer?: any[]): void; terminate(): void; addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Worker: { @@ -13714,9 +13704,9 @@ declare var Worker: { interface XMLDocument extends Document { addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var XMLDocument: { @@ -13758,9 +13748,9 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { readonly OPENED: number; readonly UNSENT: number; addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequest: { @@ -13775,9 +13765,9 @@ declare var XMLHttpRequest: { interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequestUpload: { @@ -13883,9 +13873,9 @@ interface AbstractWorkerEventMap { interface AbstractWorker { onerror: (this: AbstractWorker, ev: ErrorEvent) => any; addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface Body { @@ -14031,9 +14021,9 @@ interface GlobalEventHandlers { onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface GlobalFetch { @@ -14086,9 +14076,9 @@ interface MSBaseReader { readonly EMPTY: number; readonly LOADING: number; addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface MSFileSaver { @@ -14237,9 +14227,9 @@ interface XMLHttpRequestEventTarget { onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any; ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any; addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface BroadcastChannel extends EventTarget { @@ -14249,9 +14239,9 @@ interface BroadcastChannel extends EventTarget { close(): void; postMessage(message: any): void; addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var BroadcastChannel: { @@ -14358,10 +14348,6 @@ interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } -interface EventListenerObject { - handleEvent(evt: Event): void; -} - interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -14570,7 +14556,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -14599,6 +14585,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -14863,7 +14853,74 @@ interface EventSourceInit { readonly withCredentials: boolean; } -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; interface DecodeErrorCallback { (error: DOMException): void; @@ -14875,7 +14932,7 @@ interface ErrorEventHandler { (message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void; } interface ForEachCallback { - (keyId: BufferSource, status: MediaKeyStatus): void; + (keyId: any, status: MediaKeyStatus): void; } interface FrameRequestCallback { (time: number): void; @@ -15027,6 +15084,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -15326,9 +15384,9 @@ declare function atob(encodedString: string): string; declare function btoa(rawString: string): string; declare function fetch(input: RequestInfo, init?: RequestInit): Promise; declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; +declare function addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; declare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void; -declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +declare function removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; type BodyInit = Blob | BufferSource | FormData | string; @@ -15373,6 +15431,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type AnimationKeyFrame = {offset?: number | null | (number | null)[]} & {[key: string]: string | number | number[] | string[]}; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index 1b0ce074f00..187aa6072b2 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -128,21 +128,7 @@ interface SyncEventInit extends ExtendableEventInit { lastChance?: boolean; } -interface EventListener { - (evt: Event): void; -} - -interface WebKitEntriesCallback { - (evt: Event): void; -} - -interface WebKitErrorCallback { - (evt: Event): void; -} - -interface WebKitFileCallback { - (evt: Event): void; -} +type EventListener = (evt: Event) => void | { handleEvent(evt: Event): void; }; interface AudioBuffer { readonly duration: number; @@ -404,9 +390,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -444,9 +430,9 @@ interface FileReader extends EventTarget, MSBaseReader { readAsDataURL(blob: Blob): void; readAsText(blob: Blob, encoding?: string): void; addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var FileReader: { @@ -529,9 +515,9 @@ interface IDBDatabase extends EventTarget { addEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | EventListenerOptions): void; addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBDatabase: { @@ -616,9 +602,9 @@ interface IDBOpenDBRequest extends IDBRequest { onblocked: (this: IDBOpenDBRequest, ev: Event) => any; onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBOpenDBRequest: { @@ -640,9 +626,9 @@ interface IDBRequest extends EventTarget { source: IDBObjectStore | IDBIndex | IDBCursor; readonly transaction: IDBTransaction; addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBRequest: { @@ -669,9 +655,9 @@ interface IDBTransaction extends EventTarget { readonly READ_WRITE: string; readonly VERSION_CHANGE: string; addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var IDBTransaction: { @@ -737,9 +723,9 @@ interface MessagePort extends EventTarget { postMessage(message?: any, transfer?: any[]): void; start(): void; addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var MessagePort: { @@ -768,9 +754,9 @@ interface Notification extends EventTarget { readonly title: string; close(): void; addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Notification: { @@ -892,7 +878,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -999,9 +985,9 @@ interface ServiceWorker extends EventTarget, AbstractWorker { readonly state: ServiceWorkerState; postMessage(message: any, transfer?: any[]): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ServiceWorker: { @@ -1026,9 +1012,9 @@ interface ServiceWorkerRegistration extends EventTarget { unregister(): Promise; update(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerRegistration: { @@ -1088,15 +1074,15 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var WebSocket: { @@ -1117,9 +1103,9 @@ interface Worker extends EventTarget, AbstractWorker { postMessage(message: any, transfer?: any[]): void; terminate(): void; addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var Worker: { @@ -1160,9 +1146,9 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { readonly OPENED: number; readonly UNSENT: number; addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequest: { @@ -1177,9 +1163,9 @@ declare var XMLHttpRequest: { interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequestUpload: { @@ -1194,9 +1180,9 @@ interface AbstractWorkerEventMap { interface AbstractWorker { onerror: (this: AbstractWorker, ev: ErrorEvent) => any; addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface Body { @@ -1234,9 +1220,9 @@ interface MSBaseReader { readonly EMPTY: number; readonly LOADING: number; addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface NavigatorBeacon { @@ -1291,9 +1277,9 @@ interface XMLHttpRequestEventTarget { onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any; ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any; addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } interface Client { @@ -1329,9 +1315,9 @@ interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { close(): void; postMessage(message: any, transfer?: any[]): void; addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var DedicatedWorkerGlobalScope: { @@ -1442,9 +1428,9 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope { readonly registration: ServiceWorkerRegistration; skipWaiting(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerGlobalScope: { @@ -1489,9 +1475,9 @@ interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, Glo createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; addEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var WorkerGlobalScope: { @@ -1549,9 +1535,9 @@ interface BroadcastChannel extends EventTarget { close(): void; postMessage(message: any): void; addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; } declare var BroadcastChannel: { @@ -1631,10 +1617,6 @@ interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } -interface EventListenerObject { - handleEvent(evt: Event): void; -} - interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -1861,8 +1843,6 @@ interface EventSourceInit { readonly withCredentials: boolean; } -declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; - interface DecodeErrorCallback { (error: DOMException): void; } @@ -1873,7 +1853,7 @@ interface ErrorEventHandler { (message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void; } interface ForEachCallback { - (keyId: BufferSource, status: MediaKeyStatus): void; + (keyId: any, status: MediaKeyStatus): void; } interface FunctionStringCallback { (data: string): void; @@ -1919,9 +1899,9 @@ declare var console: Console; declare function fetch(input: RequestInfo, init?: RequestInit): Promise; declare function dispatchEvent(evt: Event): boolean; declare function addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; -declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; +declare function addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; declare function removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; -declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +declare function removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; type AlgorithmIdentifier = string | Algorithm; type BodyInit = Blob | BufferSource | FormData | string; type IDBKeyPath = string; diff --git a/tests/baselines/reference/mappedTypeRecursiveInference.types b/tests/baselines/reference/mappedTypeRecursiveInference.types index 63a10cce010..4db91e61ba1 100644 --- a/tests/baselines/reference/mappedTypeRecursiveInference.types +++ b/tests/baselines/reference/mappedTypeRecursiveInference.types @@ -108,24 +108,24 @@ let xhr: XMLHttpRequest; >XMLHttpRequest : XMLHttpRequest const out2 = foo(xhr); ->out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } ->foo(xhr) : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>foo(xhr) : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } >foo : (deep: Deep) => T >xhr : XMLHttpRequest out2.responseXML ->out2.responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly stylesheets: { readonly length: any; item: any; }; elementsFromPoint: {}; } ->out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } ->responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly stylesheets: { readonly length: any; item: any; }; elementsFromPoint: {}; } +>out2.responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } +>out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } out2.responseXML.activeElement.className.length >out2.responseXML.activeElement.className.length : { toString: {}; toFixed: {}; toExponential: {}; toPrecision: {}; valueOf: {}; toLocaleString: {}; } >out2.responseXML.activeElement.className : { toString: {}; charAt: {}; charCodeAt: {}; concat: {}; indexOf: {}; lastIndexOf: {}; localeCompare: {}; match: {}; replace: {}; search: {}; slice: {}; split: {}; substring: {}; toLowerCase: {}; toLocaleLowerCase: {}; toUpperCase: {}; toLocaleUpperCase: {}; trim: {}; readonly length: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; substr: {}; valueOf: {}; [Symbol.iterator]: {}; codePointAt: {}; includes: {}; endsWith: {}; normalize: {}; repeat: {}; startsWith: {}; anchor: {}; big: {}; blink: {}; bold: {}; fixed: {}; fontcolor: {}; fontsize: {}; italics: {}; link: {}; small: {}; strike: {}; sub: {}; sup: {}; } ->out2.responseXML.activeElement : { readonly classList: { readonly length: any; add: any; contains: any; item: any; remove: any; toggle: any; toString: any; }; className: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly clientHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; id: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; innerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; msContentZoomFactor: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly msRegionOverflow: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly prefix: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly scrollHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly scrollWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly tagName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly assignedSlot: { name: any; assignedNodes: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; slot: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly shadowRoot: { readonly host: any; innerHTML: any; readonly activeElement: any; readonly stylesheets: any; getSelection: any; elementFromPoint: any; elementsFromPoint: any; getElementById: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; querySelector: any; querySelectorAll: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; }; getAttribute: {}; getAttributeNode: {}; getAttributeNodeNS: {}; getAttributeNS: {}; getBoundingClientRect: {}; getClientRects: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; hasAttribute: {}; hasAttributeNS: {}; msGetRegionContent: {}; msGetUntransformedBounds: {}; msMatchesSelector: {}; msReleasePointerCapture: {}; msSetPointerCapture: {}; msZoomTo: {}; releasePointerCapture: {}; removeAttribute: {}; removeAttributeNode: {}; removeAttributeNS: {}; requestFullscreen: {}; requestPointerLock: {}; setAttribute: {}; setAttributeNode: {}; setAttributeNodeNS: {}; setAttributeNS: {}; setPointerCapture: {}; webkitMatchesSelector: {}; webkitRequestFullscreen: {}; webkitRequestFullScreen: {}; getElementsByClassName: {}; matches: {}; closest: {}; scrollIntoView: {}; scroll: {}; scrollTo: {}; scrollBy: {}; insertAdjacentElement: {}; insertAdjacentHTML: {}; insertAdjacentText: {}; attachShadow: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly nextElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly previousElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; querySelector: {}; querySelectorAll: {}; remove: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; } ->out2.responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly stylesheets: { readonly length: any; item: any; }; elementsFromPoint: {}; } ->out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } ->responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly stylesheets: { readonly length: any; item: any; }; elementsFromPoint: {}; } ->activeElement : { readonly classList: { readonly length: any; add: any; contains: any; item: any; remove: any; toggle: any; toString: any; }; className: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly clientHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; id: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; innerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; msContentZoomFactor: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly msRegionOverflow: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly prefix: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly scrollHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly scrollWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly tagName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly assignedSlot: { name: any; assignedNodes: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; slot: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly shadowRoot: { readonly host: any; innerHTML: any; readonly activeElement: any; readonly stylesheets: any; getSelection: any; elementFromPoint: any; elementsFromPoint: any; getElementById: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; querySelector: any; querySelectorAll: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; }; getAttribute: {}; getAttributeNode: {}; getAttributeNodeNS: {}; getAttributeNS: {}; getBoundingClientRect: {}; getClientRects: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; hasAttribute: {}; hasAttributeNS: {}; msGetRegionContent: {}; msGetUntransformedBounds: {}; msMatchesSelector: {}; msReleasePointerCapture: {}; msSetPointerCapture: {}; msZoomTo: {}; releasePointerCapture: {}; removeAttribute: {}; removeAttributeNode: {}; removeAttributeNS: {}; requestFullscreen: {}; requestPointerLock: {}; setAttribute: {}; setAttributeNode: {}; setAttributeNodeNS: {}; setAttributeNS: {}; setPointerCapture: {}; webkitMatchesSelector: {}; webkitRequestFullscreen: {}; webkitRequestFullScreen: {}; getElementsByClassName: {}; matches: {}; closest: {}; scrollIntoView: {}; scroll: {}; scrollTo: {}; scrollBy: {}; insertAdjacentElement: {}; insertAdjacentHTML: {}; insertAdjacentText: {}; attachShadow: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; readonly stylesheets: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly nextElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly previousElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; querySelector: {}; querySelectorAll: {}; remove: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; } +>out2.responseXML.activeElement : { readonly classList: { readonly length: any; add: any; contains: any; item: any; remove: any; toggle: any; toString: any; }; className: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly clientHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; id: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; innerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; msContentZoomFactor: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly msRegionOverflow: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly prefix: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly scrollHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly scrollWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly tagName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly assignedSlot: { name: any; assignedNodes: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; slot: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly shadowRoot: { readonly host: any; innerHTML: any; readonly activeElement: any; readonly styleSheets: any; getSelection: any; elementFromPoint: any; elementsFromPoint: any; getElementById: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; querySelector: any; querySelectorAll: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; }; getAttribute: {}; getAttributeNode: {}; getAttributeNodeNS: {}; getAttributeNS: {}; getBoundingClientRect: {}; getClientRects: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; hasAttribute: {}; hasAttributeNS: {}; msGetRegionContent: {}; msGetUntransformedBounds: {}; msMatchesSelector: {}; msReleasePointerCapture: {}; msSetPointerCapture: {}; msZoomTo: {}; releasePointerCapture: {}; removeAttribute: {}; removeAttributeNode: {}; removeAttributeNS: {}; requestFullscreen: {}; requestPointerLock: {}; setAttribute: {}; setAttributeNode: {}; setAttributeNodeNS: {}; setAttributeNS: {}; setPointerCapture: {}; webkitMatchesSelector: {}; webkitRequestFullscreen: {}; webkitRequestFullScreen: {}; getElementsByClassName: {}; matches: {}; closest: {}; scrollIntoView: {}; scroll: {}; scrollTo: {}; scrollBy: {}; insertAdjacentElement: {}; insertAdjacentHTML: {}; insertAdjacentText: {}; attachShadow: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly nextElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly previousElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; querySelector: {}; querySelectorAll: {}; remove: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; } +>out2.responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } +>out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } +>activeElement : { readonly classList: { readonly length: any; add: any; contains: any; item: any; remove: any; toggle: any; toString: any; }; className: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly clientHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; id: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; innerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; msContentZoomFactor: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly msRegionOverflow: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly prefix: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly scrollHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly scrollWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly tagName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly assignedSlot: { name: any; assignedNodes: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; slot: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly shadowRoot: { readonly host: any; innerHTML: any; readonly activeElement: any; readonly styleSheets: any; getSelection: any; elementFromPoint: any; elementsFromPoint: any; getElementById: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; querySelector: any; querySelectorAll: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; }; getAttribute: {}; getAttributeNode: {}; getAttributeNodeNS: {}; getAttributeNS: {}; getBoundingClientRect: {}; getClientRects: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; hasAttribute: {}; hasAttributeNS: {}; msGetRegionContent: {}; msGetUntransformedBounds: {}; msMatchesSelector: {}; msReleasePointerCapture: {}; msSetPointerCapture: {}; msZoomTo: {}; releasePointerCapture: {}; removeAttribute: {}; removeAttributeNode: {}; removeAttributeNS: {}; requestFullscreen: {}; requestPointerLock: {}; setAttribute: {}; setAttributeNode: {}; setAttributeNodeNS: {}; setAttributeNS: {}; setPointerCapture: {}; webkitMatchesSelector: {}; webkitRequestFullscreen: {}; webkitRequestFullScreen: {}; getElementsByClassName: {}; matches: {}; closest: {}; scrollIntoView: {}; scroll: {}; scrollTo: {}; scrollBy: {}; insertAdjacentElement: {}; insertAdjacentHTML: {}; insertAdjacentText: {}; attachShadow: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly nextElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly previousElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; querySelector: {}; querySelectorAll: {}; remove: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; } >className : { toString: {}; charAt: {}; charCodeAt: {}; concat: {}; indexOf: {}; lastIndexOf: {}; localeCompare: {}; match: {}; replace: {}; search: {}; slice: {}; split: {}; substring: {}; toLowerCase: {}; toLocaleLowerCase: {}; toUpperCase: {}; toLocaleUpperCase: {}; trim: {}; readonly length: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; substr: {}; valueOf: {}; [Symbol.iterator]: {}; codePointAt: {}; includes: {}; endsWith: {}; normalize: {}; repeat: {}; startsWith: {}; anchor: {}; big: {}; blink: {}; bold: {}; fixed: {}; fontcolor: {}; fontsize: {}; italics: {}; link: {}; small: {}; strike: {}; sub: {}; sup: {}; } >length : { toString: {}; toFixed: {}; toExponential: {}; toPrecision: {}; valueOf: {}; toLocaleString: {}; } diff --git a/tests/baselines/reference/modularizeLibrary_Dom.iterable.types b/tests/baselines/reference/modularizeLibrary_Dom.iterable.types index 3c2e7b79ee1..b3ddd4c3f3d 100644 --- a/tests/baselines/reference/modularizeLibrary_Dom.iterable.types +++ b/tests/baselines/reference/modularizeLibrary_Dom.iterable.types @@ -2,9 +2,9 @@ for (const element of document.getElementsByTagName("a")) { >element : HTMLAnchorElement >document.getElementsByTagName("a") : NodeListOf ->document.getElementsByTagName : { (tagname: K): NodeListOf; (tagname: K): NodeListOf; (tagname: string): NodeListOf; } +>document.getElementsByTagName : { (tagname: K): NodeListOf; (tagname: K): NodeListOf; (tagname: string): NodeListOf; } >document : Document ->getElementsByTagName : { (tagname: K): NodeListOf; (tagname: K): NodeListOf; (tagname: string): NodeListOf; } +>getElementsByTagName : { (tagname: K): NodeListOf; (tagname: K): NodeListOf; (tagname: string): NodeListOf; } >"a" : "a" element.href; From fca3db440c584115ae969aa2b7829c5d1d40ec0d Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Feb 2018 11:56:44 -0800 Subject: [PATCH 123/298] Give MethodDeclaration and MethodSignature parent types (#21892) * Give MethodDeclaration and MethodSignature parent types * And fix code that used MethodDeclaration for parameter that might be a MethodSignature * Move type check back inside checkGrammarArrowFunction --- src/compiler/checker.ts | 81 +++++++++---------- src/compiler/types.ts | 2 + .../reference/api/tsserverlibrary.d.ts | 2 + tests/baselines/reference/api/typescript.d.ts | 2 + 4 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d336336f549..2426c7b9508 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18404,7 +18404,7 @@ namespace ts { * * @param returnType - return type of the function, can be undefined if return type is not explicitly specified */ - function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func: FunctionLikeDeclaration, returnType: Type): void { + function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func: FunctionLikeDeclaration | MethodSignature, returnType: Type): void { if (!produceDiagnostics) { return; } @@ -18416,7 +18416,7 @@ namespace ts { // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (nodeIsMissing(func.body) || func.body.kind !== SyntaxKind.Block || !functionHasImplicitReturn(func)) { + if (func.kind === SyntaxKind.MethodSignature || nodeIsMissing(func.body) || func.body.kind !== SyntaxKind.Block || !functionHasImplicitReturn(func)) { return; } @@ -20083,7 +20083,7 @@ namespace ts { checkVariableLikeDeclaration(node); } - function checkMethodDeclaration(node: MethodDeclaration) { + function checkMethodDeclaration(node: MethodDeclaration | MethodSignature) { // Grammar checking if (!checkGrammarMethod(node)) checkGrammarComputedPropertyName(node.name); @@ -20092,7 +20092,7 @@ namespace ts { // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (hasModifier(node, ModifierFlags.Abstract) && node.body) { + if (hasModifier(node, ModifierFlags.Abstract) && node.kind === SyntaxKind.MethodDeclaration && node.body) { error(node, Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, declarationNameToString(node.name)); } } @@ -20922,7 +20922,7 @@ namespace ts { * * @param node The signature to check */ - function checkAsyncFunctionReturnType(node: FunctionLikeDeclaration): Type { + function checkAsyncFunctionReturnType(node: FunctionLikeDeclaration | MethodSignature): Type { // As part of our emit for an async function, we will need to emit the entity name of // the return type annotation as an expression. To meet the necessary runtime semantics // for __awaiter, we must also check that the type of the declaration (e.g. the static @@ -21284,7 +21284,7 @@ namespace ts { } } - function checkFunctionOrMethodDeclaration(node: FunctionDeclaration | MethodDeclaration): void { + function checkFunctionOrMethodDeclaration(node: FunctionDeclaration | MethodDeclaration | MethodSignature): void { checkDecorators(node); checkSignatureDeclaration(node); const functionFlags = getFunctionFlags(node); @@ -21326,7 +21326,8 @@ namespace ts { } } - checkSourceElement(node.body); + const body = node.kind === SyntaxKind.MethodSignature ? undefined : node.body; + checkSourceElement(body); const returnTypeNode = getEffectiveReturnTypeNode(node); if ((functionFlags & FunctionFlags.Generator) === 0) { // Async function or normal function @@ -21339,11 +21340,11 @@ namespace ts { if (produceDiagnostics && !returnTypeNode) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (noImplicitAny && nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & FunctionFlags.Generator && nodeIsPresent(node.body)) { + if (functionFlags & FunctionFlags.Generator && nodeIsPresent(body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -22008,20 +22009,6 @@ namespace ts { forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node: MethodDeclaration) { - // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === SyntaxKind.ObjectLiteralExpression) { - if (getFunctionFlags(node) & FunctionFlags.Async) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); - } - } - } - function checkExpressionStatement(node: ExpressionStatement) { // Grammar checking checkGrammarStatementInAmbientContext(node); @@ -24075,7 +24062,7 @@ namespace ts { return checkSignatureDeclaration(node); case SyntaxKind.MethodDeclaration: case SyntaxKind.MethodSignature: - return checkMethodDeclaration(node); + return checkMethodDeclaration(node); case SyntaxKind.Constructor: return checkConstructorDeclaration(node); case SyntaxKind.GetAccessor: @@ -26106,7 +26093,7 @@ namespace ts { } } - function checkGrammarFunctionLikeDeclaration(node: FunctionLikeDeclaration): boolean { + function checkGrammarFunctionLikeDeclaration(node: FunctionLikeDeclaration | MethodSignature): boolean { // Prevent cascading error by short-circuit const file = getSourceFileOfNode(node); return checkGrammarDecoratorsAndModifiers(node) || checkGrammarTypeParameterList(node.typeParameters, file) || @@ -26118,16 +26105,15 @@ namespace ts { return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } - function checkGrammarArrowFunction(node: FunctionLikeDeclaration, file: SourceFile): boolean { - if (node.kind === SyntaxKind.ArrowFunction) { - const arrowFunction = node; - const startLine = getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - const endLine = getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, Diagnostics.Line_terminator_not_permitted_before_arrow); - } + function checkGrammarArrowFunction(node: Node, file: SourceFile): boolean { + if (!isArrowFunction(node)) { + return false; } - return false; + + const { equalsGreaterThanToken } = node; + const startLine = getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + const endLine = getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node: SignatureDeclaration): boolean { @@ -26592,19 +26578,26 @@ namespace ts { } } - function checkGrammarMethod(node: MethodDeclaration) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + function checkGrammarMethod(node: MethodDeclaration | MethodSignature) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === SyntaxKind.ObjectLiteralExpression) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === SyntaxKind.MethodDeclaration) { + if (node.parent.kind === SyntaxKind.ObjectLiteralExpression) { + // We only disallow modifier on a method declaration if it is a property of object-literal-expression + if (node.modifiers && !(node.modifiers.length === 1 && first(node.modifiers).kind === SyntaxKind.AsyncKeyword)) { + return grammarErrorOnFirstToken(node, Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } @@ -26617,7 +26610,7 @@ namespace ts { if (node.flags & NodeFlags.Ambient) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === SyntaxKind.MethodDeclaration && !node.body) { return checkGrammarForInvalidDynamicName(node.name, Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6d9953b6669..b74ed84e809 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -983,6 +983,7 @@ namespace ts { export interface MethodSignature extends SignatureDeclarationBase, TypeElement { kind: SyntaxKind.MethodSignature; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; name: PropertyName; } @@ -997,6 +998,7 @@ namespace ts { // of the method, or use helpers like isObjectLiteralMethodDeclaration export interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.MethodDeclaration; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 15373167e39..90a73a823eb 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -650,10 +650,12 @@ declare namespace ts { } interface MethodSignature extends SignatureDeclarationBase, TypeElement { kind: SyntaxKind.MethodSignature; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.MethodDeclaration; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 4593f659f50..571e6aadcd3 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -650,10 +650,12 @@ declare namespace ts { } interface MethodSignature extends SignatureDeclarationBase, TypeElement { kind: SyntaxKind.MethodSignature; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.MethodDeclaration; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } From d6d9953f6df528e71bd7dcc3e5c729ce5c7d4b7b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 12 Feb 2018 11:03:26 -0800 Subject: [PATCH 124/298] Fix completion of jsx attributes in self closing element Fixes #21844 --- src/services/completions.ts | 25 +++++++++++++++--- src/services/symbolDisplay.ts | 2 ++ tests/cases/fourslash/completionsInJsxTag.ts | 27 ++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/completionsInJsxTag.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index c6d5f015279..1aac8cd2c68 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -862,6 +862,23 @@ namespace ts.Completions { parent = parent.parent; } + // Fix location + if (currentToken.parent === location) { + switch (currentToken.kind) { + case SyntaxKind.GreaterThanToken: + if (currentToken.parent.kind === SyntaxKind.JsxElement || currentToken.parent.kind === SyntaxKind.JsxOpeningElement) { + location = currentToken; + } + break; + + case SyntaxKind.SlashToken: + if (currentToken.parent.kind === SyntaxKind.JsxSelfClosingElement) { + location = currentToken; + } + break; + } + } + switch (parent.kind) { case SyntaxKind.JsxClosingElement: if (contextToken.kind === SyntaxKind.SlashToken) { @@ -1042,10 +1059,6 @@ namespace ts.Completions { return true; } - if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { - keywordFilters = KeywordCompletionFilters.FunctionLikeBodyKeywords; - } - if (classLikeContainer = tryGetClassLikeCompletionContainer(contextToken)) { // cursor inside class declaration getGetClassLikeCompletionSymbols(classLikeContainer); @@ -1067,6 +1080,10 @@ namespace ts.Completions { } } + if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { + keywordFilters = KeywordCompletionFilters.FunctionLikeBodyKeywords; + } + // Get all entities in the current scope. completionKind = CompletionKind.None; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index 9ec99f6ccaf..387d027d999 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -79,6 +79,8 @@ namespace ts.SymbolDisplay { switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. case SyntaxKind.JsxOpeningElement: + case SyntaxKind.JsxElement: + case SyntaxKind.JsxSelfClosingElement: return location.kind === SyntaxKind.Identifier ? ScriptElementKind.memberVariableElement : ScriptElementKind.jsxAttribute; case SyntaxKind.JsxAttribute: return ScriptElementKind.jsxAttribute; diff --git a/tests/cases/fourslash/completionsInJsxTag.ts b/tests/cases/fourslash/completionsInJsxTag.ts new file mode 100644 index 00000000000..a38f64e8fed --- /dev/null +++ b/tests/cases/fourslash/completionsInJsxTag.ts @@ -0,0 +1,27 @@ +/// + +// @jsx: preserve + +// @Filename: /a.tsx +////declare namespace JSX { +//// interface Element {} +//// interface IntrinsicElements { +//// div: { +//// /** Doc */ +//// foo: string +//// } +//// } +////} +////class Foo { +//// render() { +////
; +////
+//// } +////} + +goTo.marker("1"); +verify.completionListCount(1); +verify.completionListContains("foo", "(JSX attribute) foo: string", "Doc ", "JSX attribute"); +goTo.marker("2"); +verify.completionListCount(1); +verify.completionListContains("foo", "(JSX attribute) foo: string", "Doc ", "JSX attribute"); From ea8f5158c2a37a5261f7ddab1deadff107d9fe2e Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 12 Feb 2018 12:02:34 -0800 Subject: [PATCH 125/298] Revert BOM emit change --- src/compiler/sys.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index ef1a3f8fd49..8cafd8c0138 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -120,7 +120,10 @@ namespace ts { }; export let sys: System = (() => { - const utf8ByteOrderMark = "\u00EF\u00BB\u00BF"; + // NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual + // byte order mark from the specified encoding. Using any other byte order mark does + // not actually work. + const byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem(): System { const _fs = require("fs"); @@ -367,7 +370,7 @@ namespace ts { function writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } let fd: number; @@ -572,7 +575,7 @@ namespace ts { writeFile(path: string, data: string, writeByteOrderMark?: boolean) { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } ChakraHost.writeFile(path, data); From 6736ced51d4e48a17969045e85f976509452d90f Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 12 Feb 2018 12:30:29 -0800 Subject: [PATCH 126/298] Fix duplicate label in es2017 async function --- src/compiler/transformers/esnext.ts | 2 +- .../baselines/reference/asyncAwait_es2017.js | 15 +++++++++++++- .../reference/asyncAwait_es2017.symbols | 11 +++++++++- .../reference/asyncAwait_es2017.types | 17 +++++++++++++++- tests/baselines/reference/asyncAwait_es5.js | 20 +++++++++++++++++++ .../reference/asyncAwait_es5.symbols | 9 +++++++++ .../baselines/reference/asyncAwait_es5.types | 15 ++++++++++++++ tests/baselines/reference/asyncAwait_es6.js | 17 +++++++++++++++- .../reference/asyncAwait_es6.symbols | 11 +++++++++- .../baselines/reference/asyncAwait_es6.types | 17 +++++++++++++++- .../async/es2017/asyncAwait_es2017.ts | 9 ++++++++- .../conformance/async/es5/asyncAwait_es5.ts | 7 +++++++ .../conformance/async/es6/asyncAwait_es6.ts | 9 ++++++++- 13 files changed, 150 insertions(+), 9 deletions(-) diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 424371ad311..82ff52ead90 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -153,7 +153,7 @@ namespace ts { if (statement.kind === SyntaxKind.ForOfStatement && (statement).awaitModifier) { return visitForOfStatement(statement, node); } - return restoreEnclosingLabel(visitEachChild(node, visitor, context), node); + return restoreEnclosingLabel(visitEachChild(statement, visitor, context), node); } return visitEachChild(node, visitor, context); } diff --git a/tests/baselines/reference/asyncAwait_es2017.js b/tests/baselines/reference/asyncAwait_es2017.js index 314c99fa210..70a4c63be2e 100644 --- a/tests/baselines/reference/asyncAwait_es2017.js +++ b/tests/baselines/reference/asyncAwait_es2017.js @@ -14,7 +14,7 @@ let f6 = async function(): MyPromise { } let f7 = async () => { }; let f8 = async (): Promise => { }; -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; let f10 = async () => p; let f11 = async () => mp; let f12 = async (): Promise => mp; @@ -37,6 +37,13 @@ class C { module M { export async function f1() { } +} + +async function f14() { + block: { + await 1; + break block; + } } //// [asyncAwait_es2017.js] @@ -71,3 +78,9 @@ var M; async function f1() { } M.f1 = f1; })(M || (M = {})); +async function f14() { + block: { + await 1; + break block; + } +} diff --git a/tests/baselines/reference/asyncAwait_es2017.symbols b/tests/baselines/reference/asyncAwait_es2017.symbols index 0f302638276..8d8a23011c7 100644 --- a/tests/baselines/reference/asyncAwait_es2017.symbols +++ b/tests/baselines/reference/asyncAwait_es2017.symbols @@ -46,7 +46,7 @@ let f8 = async (): Promise => { }; >f8 : Symbol(f8, Decl(asyncAwait_es2017.ts, 14, 3)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; >f9 : Symbol(f9, Decl(asyncAwait_es2017.ts, 15, 3)) >MyPromise : Symbol(MyPromise, Decl(asyncAwait_es2017.ts, 0, 0), Decl(asyncAwait_es2017.ts, 1, 11)) @@ -116,3 +116,12 @@ module M { export async function f1() { } >f1 : Symbol(f1, Decl(asyncAwait_es2017.ts, 36, 10)) } + +async function f14() { +>f14 : Symbol(f14, Decl(asyncAwait_es2017.ts, 38, 1)) + + block: { + await 1; + break block; + } +} diff --git a/tests/baselines/reference/asyncAwait_es2017.types b/tests/baselines/reference/asyncAwait_es2017.types index a1226d0cbfe..42b54aa56be 100644 --- a/tests/baselines/reference/asyncAwait_es2017.types +++ b/tests/baselines/reference/asyncAwait_es2017.types @@ -51,7 +51,7 @@ let f8 = async (): Promise => { }; >async (): Promise => { } : () => Promise >Promise : Promise -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; >f9 : () => Promise >async (): MyPromise => { } : () => Promise >MyPromise : Promise @@ -127,3 +127,18 @@ module M { export async function f1() { } >f1 : () => Promise } + +async function f14() { +>f14 : () => Promise + + block: { +>block : any + + await 1; +>await 1 : 1 +>1 : 1 + + break block; +>block : any + } +} diff --git a/tests/baselines/reference/asyncAwait_es5.js b/tests/baselines/reference/asyncAwait_es5.js index 653082be8d6..6434ae5a766 100644 --- a/tests/baselines/reference/asyncAwait_es5.js +++ b/tests/baselines/reference/asyncAwait_es5.js @@ -37,6 +37,13 @@ class C { module M { export async function f1() { } +} + +async function f14() { + block: { + await 1; + break block; + } } //// [asyncAwait_es5.js] @@ -188,3 +195,16 @@ var M; } M.f1 = f1; })(M || (M = {})); +function f14() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, 1]; + case 1: + _a.sent(); + return [3 /*break*/, 2]; + case 2: return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncAwait_es5.symbols b/tests/baselines/reference/asyncAwait_es5.symbols index cdc52137ff4..e10fd971b7b 100644 --- a/tests/baselines/reference/asyncAwait_es5.symbols +++ b/tests/baselines/reference/asyncAwait_es5.symbols @@ -116,3 +116,12 @@ module M { export async function f1() { } >f1 : Symbol(f1, Decl(asyncAwait_es5.ts, 36, 10)) } + +async function f14() { +>f14 : Symbol(f14, Decl(asyncAwait_es5.ts, 38, 1)) + + block: { + await 1; + break block; + } +} diff --git a/tests/baselines/reference/asyncAwait_es5.types b/tests/baselines/reference/asyncAwait_es5.types index 4162aa84b76..6be39599fa1 100644 --- a/tests/baselines/reference/asyncAwait_es5.types +++ b/tests/baselines/reference/asyncAwait_es5.types @@ -127,3 +127,18 @@ module M { export async function f1() { } >f1 : () => Promise } + +async function f14() { +>f14 : () => Promise + + block: { +>block : any + + await 1; +>await 1 : 1 +>1 : 1 + + break block; +>block : any + } +} diff --git a/tests/baselines/reference/asyncAwait_es6.js b/tests/baselines/reference/asyncAwait_es6.js index d6635098aed..3cfe3b3ceec 100644 --- a/tests/baselines/reference/asyncAwait_es6.js +++ b/tests/baselines/reference/asyncAwait_es6.js @@ -14,7 +14,7 @@ let f6 = async function(): MyPromise { } let f7 = async () => { }; let f8 = async (): Promise => { }; -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; let f10 = async () => p; let f11 = async () => mp; let f12 = async (): Promise => mp; @@ -37,6 +37,13 @@ class C { module M { export async function f1() { } +} + +async function f14() { + block: { + await 1; + break block; + } } //// [asyncAwait_es6.js] @@ -111,3 +118,11 @@ var M; } M.f1 = f1; })(M || (M = {})); +function f14() { + return __awaiter(this, void 0, void 0, function* () { + block: { + yield 1; + break block; + } + }); +} diff --git a/tests/baselines/reference/asyncAwait_es6.symbols b/tests/baselines/reference/asyncAwait_es6.symbols index 9093fc69064..380ecbcafe3 100644 --- a/tests/baselines/reference/asyncAwait_es6.symbols +++ b/tests/baselines/reference/asyncAwait_es6.symbols @@ -46,7 +46,7 @@ let f8 = async (): Promise => { }; >f8 : Symbol(f8, Decl(asyncAwait_es6.ts, 14, 3)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; >f9 : Symbol(f9, Decl(asyncAwait_es6.ts, 15, 3)) >MyPromise : Symbol(MyPromise, Decl(asyncAwait_es6.ts, 0, 0), Decl(asyncAwait_es6.ts, 1, 11)) @@ -116,3 +116,12 @@ module M { export async function f1() { } >f1 : Symbol(f1, Decl(asyncAwait_es6.ts, 36, 10)) } + +async function f14() { +>f14 : Symbol(f14, Decl(asyncAwait_es6.ts, 38, 1)) + + block: { + await 1; + break block; + } +} diff --git a/tests/baselines/reference/asyncAwait_es6.types b/tests/baselines/reference/asyncAwait_es6.types index 5f0cd2cc35a..de6b7177e42 100644 --- a/tests/baselines/reference/asyncAwait_es6.types +++ b/tests/baselines/reference/asyncAwait_es6.types @@ -51,7 +51,7 @@ let f8 = async (): Promise => { }; >async (): Promise => { } : () => Promise >Promise : Promise -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; >f9 : () => Promise >async (): MyPromise => { } : () => Promise >MyPromise : Promise @@ -127,3 +127,18 @@ module M { export async function f1() { } >f1 : () => Promise } + +async function f14() { +>f14 : () => Promise + + block: { +>block : any + + await 1; +>await 1 : 1 +>1 : 1 + + break block; +>block : any + } +} diff --git a/tests/cases/conformance/async/es2017/asyncAwait_es2017.ts b/tests/cases/conformance/async/es2017/asyncAwait_es2017.ts index a255cb7cb71..7256762788b 100644 --- a/tests/cases/conformance/async/es2017/asyncAwait_es2017.ts +++ b/tests/cases/conformance/async/es2017/asyncAwait_es2017.ts @@ -14,7 +14,7 @@ let f6 = async function(): MyPromise { } let f7 = async () => { }; let f8 = async (): Promise => { }; -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; let f10 = async () => p; let f11 = async () => mp; let f12 = async (): Promise => mp; @@ -37,4 +37,11 @@ class C { module M { export async function f1() { } +} + +async function f14() { + block: { + await 1; + break block; + } } \ No newline at end of file diff --git a/tests/cases/conformance/async/es5/asyncAwait_es5.ts b/tests/cases/conformance/async/es5/asyncAwait_es5.ts index 88cda3201dc..5c33a42ab74 100644 --- a/tests/cases/conformance/async/es5/asyncAwait_es5.ts +++ b/tests/cases/conformance/async/es5/asyncAwait_es5.ts @@ -38,4 +38,11 @@ class C { module M { export async function f1() { } +} + +async function f14() { + block: { + await 1; + break block; + } } \ No newline at end of file diff --git a/tests/cases/conformance/async/es6/asyncAwait_es6.ts b/tests/cases/conformance/async/es6/asyncAwait_es6.ts index 8e72197a98d..203d748e114 100644 --- a/tests/cases/conformance/async/es6/asyncAwait_es6.ts +++ b/tests/cases/conformance/async/es6/asyncAwait_es6.ts @@ -14,7 +14,7 @@ let f6 = async function(): MyPromise { } let f7 = async () => { }; let f8 = async (): Promise => { }; -let f9 = async (): MyPromise => { }; +let f9 = async (): MyPromise => { }; let f10 = async () => p; let f11 = async () => mp; let f12 = async (): Promise => mp; @@ -37,4 +37,11 @@ class C { module M { export async function f1() { } +} + +async function f14() { + block: { + await 1; + break block; + } } \ No newline at end of file From c84b7caa25a1239d103e8762350838cdc81409c2 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 12 Feb 2018 13:02:47 -0800 Subject: [PATCH 127/298] Fix emit when binder treats exported const as namespace --- src/compiler/checker.ts | 2 +- .../typeFromPropertyAssignmentWithExport.js | 18 +++++++++++++++ ...peFromPropertyAssignmentWithExport.symbols | 13 +++++++++++ ...typeFromPropertyAssignmentWithExport.types | 22 +++++++++++++++++++ .../typeFromPropertyAssignmentWithExport.ts | 12 ++++++++++ 5 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/typeFromPropertyAssignmentWithExport.js create mode 100644 tests/baselines/reference/typeFromPropertyAssignmentWithExport.symbols create mode 100644 tests/baselines/reference/typeFromPropertyAssignmentWithExport.types create mode 100644 tests/cases/conformance/salsa/typeFromPropertyAssignmentWithExport.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2426c7b9508..4b24ff15ef7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -25054,7 +25054,7 @@ namespace ts { // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the // kinds that we do NOT prefix. const exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (!prefixLocals && exportSymbol.flags & SymbolFlags.ExportHasLocal) { + if (!prefixLocals && exportSymbol.flags & SymbolFlags.ExportHasLocal && !(exportSymbol.flags & SymbolFlags.Variable)) { return undefined; } symbol = exportSymbol; diff --git a/tests/baselines/reference/typeFromPropertyAssignmentWithExport.js b/tests/baselines/reference/typeFromPropertyAssignmentWithExport.js new file mode 100644 index 00000000000..34fbd5fd53e --- /dev/null +++ b/tests/baselines/reference/typeFromPropertyAssignmentWithExport.js @@ -0,0 +1,18 @@ +//// [a.js] +// this is a javascript file... + +export const Adapter = {}; + +Adapter.prop = {}; + +// comment this out, and it works +Adapter.asyncMethod = function() {} + +//// [a.js] +"use strict"; +// this is a javascript file... +exports.__esModule = true; +exports.Adapter = {}; +exports.Adapter.prop = {}; +// comment this out, and it works +exports.Adapter.asyncMethod = function () { }; diff --git a/tests/baselines/reference/typeFromPropertyAssignmentWithExport.symbols b/tests/baselines/reference/typeFromPropertyAssignmentWithExport.symbols new file mode 100644 index 00000000000..060018acdeb --- /dev/null +++ b/tests/baselines/reference/typeFromPropertyAssignmentWithExport.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/salsa/a.js === +// this is a javascript file... + +export const Adapter = {}; +>Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 4, 18)) + +Adapter.prop = {}; +>Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 4, 18)) + +// comment this out, and it works +Adapter.asyncMethod = function() {} +>Adapter : Symbol(Adapter, Decl(a.js, 2, 12), Decl(a.js, 4, 18)) + diff --git a/tests/baselines/reference/typeFromPropertyAssignmentWithExport.types b/tests/baselines/reference/typeFromPropertyAssignmentWithExport.types new file mode 100644 index 00000000000..82b0e0b48f9 --- /dev/null +++ b/tests/baselines/reference/typeFromPropertyAssignmentWithExport.types @@ -0,0 +1,22 @@ +=== tests/cases/conformance/salsa/a.js === +// this is a javascript file... + +export const Adapter = {}; +>Adapter : { [x: string]: any; } +>{} : { [x: string]: any; } + +Adapter.prop = {}; +>Adapter.prop = {} : {} +>Adapter.prop : any +>Adapter : { [x: string]: any; } +>prop : any +>{} : {} + +// comment this out, and it works +Adapter.asyncMethod = function() {} +>Adapter.asyncMethod = function() {} : () => void +>Adapter.asyncMethod : any +>Adapter : { [x: string]: any; } +>asyncMethod : any +>function() {} : () => void + diff --git a/tests/cases/conformance/salsa/typeFromPropertyAssignmentWithExport.ts b/tests/cases/conformance/salsa/typeFromPropertyAssignmentWithExport.ts new file mode 100644 index 00000000000..ed4ca168bf7 --- /dev/null +++ b/tests/cases/conformance/salsa/typeFromPropertyAssignmentWithExport.ts @@ -0,0 +1,12 @@ +// @allowJs: true +// @checkJs: true +// @Filename: a.js +// @outDir: dist +// this is a javascript file... + +export const Adapter = {}; + +Adapter.prop = {}; + +// comment this out, and it works +Adapter.asyncMethod = function() {} \ No newline at end of file From 20a6be67a0d36c67b8e32386d95c081b884d74b3 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Feb 2018 13:05:13 -0800 Subject: [PATCH 128/298] Clarify assumptions in verifyImportFixAtPosition (#21899) --- src/harness/fourslash.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index cdfe72512f1..52e335e5126 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2549,12 +2549,14 @@ Actual: ${stringify(fullActual)}`); } public verifyImportFixAtPosition(expectedTextArray: string[], errorCode?: number) { - const ranges = this.getRanges().filter(r => r.fileName === this.activeFile.fileName); + const { fileName } = this.activeFile; + const ranges = this.getRanges().filter(r => r.fileName === fileName); if (ranges.length !== 1) { this.raiseError("Exactly one range should be specified in the testfile."); } + const range = ts.first(ranges); - const codeFixes = this.getCodeFixes(this.activeFile.fileName, errorCode); + const codeFixes = this.getCodeFixes(fileName, errorCode); if (codeFixes.length === 0) { if (expectedTextArray.length !== 0) { @@ -2564,11 +2566,14 @@ Actual: ${stringify(fullActual)}`); } const actualTextArray: string[] = []; - const scriptInfo = this.languageServiceAdapterHost.getScriptInfo(codeFixes[0].changes[0].fileName); + const scriptInfo = this.languageServiceAdapterHost.getScriptInfo(fileName); const originalContent = scriptInfo.content; for (const codeFix of codeFixes) { - this.applyEdits(codeFix.changes[0].fileName, codeFix.changes[0].textChanges, /*isFormattingEdit*/ false); - const text = this.rangeText(ranges[0]); + ts.Debug.assert(codeFix.changes.length === 1); + const change = ts.first(codeFix.changes); + ts.Debug.assert(change.fileName === fileName); + this.applyEdits(change.fileName, change.textChanges, /*isFormattingEdit*/ false); + const text = this.rangeText(range); actualTextArray.push(text); scriptInfo.updateContent(originalContent); } From 458c12fa78a2e86092f2d86df3e7ed87d6ae5df6 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Feb 2018 13:05:40 -0800 Subject: [PATCH 129/298] importFixes: Fix bug by using replaceNode and removing changeIdentifierToPropertyAccess (#21898) --- src/services/codefixes/importFixes.ts | 2 +- src/services/textChanges.ts | 5 ----- .../importNameCodeFixIndentedIdentifier.ts | 22 +++++++++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 tests/cases/fourslash/importNameCodeFixIndentedIdentifier.ts diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index bc5bc008568..9f9bc959bf0 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -637,7 +637,7 @@ namespace ts.codefix { * become "ns.foo" */ const changes = ChangeTracker.with(context, tracker => - tracker.changeIdentifierToPropertyAccess(sourceFile, namespacePrefix, symbolToken)); + tracker.replaceNode(sourceFile, symbolToken, createPropertyAccess(createIdentifier(namespacePrefix), symbolToken))); return createCodeAction(Diagnostics.Change_0_to_1, [symbolName, `${namespacePrefix}.${symbolName}`], changes); } diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 994d4fcb6bf..d3f6cde8e8d 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -344,11 +344,6 @@ namespace ts.textChanges { this.replaceRange(sourceFile, { pos, end: pos }, createToken(modifier), { suffix: " " }); } - public changeIdentifierToPropertyAccess(sourceFile: SourceFile, prefix: string, node: Identifier): void { - const pos = getAdjustedStartPosition(sourceFile, node, {}, Position.Start); - this.replaceRange(sourceFile, { pos, end: pos }, createPropertyAccess(createIdentifier(prefix), ""), {}); - } - private getOptionsForInsertNodeBefore(before: Node, doubleNewlines: boolean): ChangeNodeOptions { if (isStatement(before) || isClassElement(before)) { return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; diff --git a/tests/cases/fourslash/importNameCodeFixIndentedIdentifier.ts b/tests/cases/fourslash/importNameCodeFixIndentedIdentifier.ts new file mode 100644 index 00000000000..49bb3df022b --- /dev/null +++ b/tests/cases/fourslash/importNameCodeFixIndentedIdentifier.ts @@ -0,0 +1,22 @@ +/// + +// @Filename: /a.ts +////[|import * as b from "./b"; +////{ +//// x/**/ +////}|] + +// @Filename: /b.ts +////export const x = 0; + +verify.importFixAtPosition([ +`import * as b from "./b"; +{ + b.x +}`, +`import * as b from "./b"; +import { x } from "./b"; +{ + x +}`, +]); From 6ca65b71b448c58a74ee049dab5a482724fb08fe Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 9 Feb 2018 12:23:02 -0800 Subject: [PATCH 130/298] Refactoring project updates in openFile --- src/server/editorServices.ts | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 5cdd3b05889..e1b18ed2b20 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2038,7 +2038,6 @@ namespace ts.server { openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult { let configFileName: NormalizedPath; - let sendConfigFileDiagEvent = false; let configFileErrors: ReadonlyArray; const info = this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, fileContent, scriptKind, hasMixedContent); @@ -2049,8 +2048,15 @@ namespace ts.server { project = this.findConfiguredProjectByProjectName(configFileName); if (!project) { project = this.createConfiguredProject(configFileName); - // Send the event only if the project got created as part of this open request - sendConfigFileDiagEvent = true; + // Send the event only if the project got created as part of this open request and info is part of the project + if (info.isOrphan()) { + // Since the file isnt part of configured project, do not send config file info + configFileName = undefined; + } + else { + configFileErrors = project.getAllProjectErrors(); + this.sendConfigFileDiagEvent(project as ConfiguredProject, fileName); + } } else { // Ensure project is ready to check if it contains opened script info @@ -2058,30 +2064,20 @@ namespace ts.server { } } } - if (project && !project.languageServiceEnabled) { - // if project language service is disabled then we create a program only for open files. - // this means that project should be marked as dirty to force rebuilding of the program - // on the next request - project.markAsDirty(); - } + + // Project we have at this point is going to be updated since its either found through + // - external project search, which updates the project before checking if info is present in it + // - configured project - either created or updated to ensure we know correct status of info // At this point if file is part of any any configured or external project, then it would be present in the containing projects // So if it still doesnt have any containing projects, it needs to be part of inferred project if (info.isOrphan()) { - // Since the file isnt part of configured project, do not send config file event - configFileName = undefined; - sendConfigFileDiagEvent = false; - this.assignOrphanScriptInfoToInferredProject(info, projectRootPath); } + Debug.assert(!info.isOrphan()); this.openFiles.set(info.path, projectRootPath); - if (sendConfigFileDiagEvent) { - configFileErrors = project.getAllProjectErrors(); - this.sendConfigFileDiagEvent(project as ConfiguredProject, fileName); - } - // Remove the configured projects that have zero references from open files. // This was postponed from closeOpenFile to after opening next file, // so that we can reuse the project if we need to right away From e702d90cfebc42f8acdf417baa261d2a89152eba Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 12 Feb 2018 13:11:13 -0800 Subject: [PATCH 131/298] Repro scenario for finding no project of #20629 --- .../unittests/tsserverProjectSystem.ts | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 08b04eda223..7094b7336e4 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2904,6 +2904,83 @@ namespace ts.projectSystem { tags: [] }); }); + + it("files opened, closed affecting multiple projects", () => { + const file: FileOrFolder = { + path: "/a/b/projects/config/file.ts", + content: `import {a} from "../files/file1"; export let b = a;` + }; + const config: FileOrFolder = { + path: "/a/b/projects/config/tsconfig.json", + content: "" + }; + const filesFile1: FileOrFolder = { + path: "/a/b/projects/files/file1.ts", + content: "export let a = 10;" + }; + const filesFile2: FileOrFolder = { + path: "/a/b/projects/files/file2.ts", + content: "export let aa = 10;" + }; + + const files = [config, file, filesFile1, filesFile2, libFile]; + const host = createServerHost(files); + const session = createSession(host); + // Create configured project + session.executeCommandSeq({ + command: protocol.CommandTypes.Open, + arguments: { + file: file.path + } + }); + + const projectService = session.getProjectService(); + const configuredProject = projectService.configuredProjects.get(config.path); + verifyConfiguredProject(); + + // open files/file1 = should not create another project + session.executeCommandSeq({ + command: protocol.CommandTypes.Open, + arguments: { + file: filesFile1.path + } + }); + verifyConfiguredProject(); + + // Close the file = should still have project + session.executeCommandSeq({ + command: protocol.CommandTypes.Close, + arguments: { + file: file.path + } + }); + verifyConfiguredProject(); + + // Open files/file2 - should create inferred project and close configured project + session.executeCommandSeq({ + command: protocol.CommandTypes.Open, + arguments: { + file: filesFile2.path + } + }); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(projectService.inferredProjects[0], [libFile.path, filesFile2.path]); + + // Actions on file1 would result in assert + session.executeCommandSeq({ + command: protocol.CommandTypes.Occurrences, + arguments: { + file: filesFile1.path, + line: 1, + offset: filesFile1.content.indexOf("a") + } + }); + + function verifyConfiguredProject() { + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProject, [file.path, filesFile1.path, libFile.path, config.path]); + } + }); }); describe("tsserverProjectSystem Proper errors", () => { From 6ab5d97a5d8cebf6f6b9a5fc1e012d084198e57a Mon Sep 17 00:00:00 2001 From: Adrian Leonhard Date: Mon, 12 Feb 2018 22:38:08 +0100 Subject: [PATCH 132/298] Changed "Duplicate Identifier" to "enum cannot be merged..." (#18579) * Changed "Duplicate Identifier" to "enum can only be merged..." when either declaration of the identifier is an enum. Partial (?) fix for #529 Not sure if the new test is necessary, all the cases seem to have been covered by others tests. * picked a nit --- src/compiler/binder.ts | 4 ++ src/compiler/checker.ts | 7 +- src/compiler/diagnosticMessages.json | 5 ++ .../reference/augmentedTypesClass.errors.txt | 8 +-- .../reference/augmentedTypesClass2.errors.txt | 8 +-- .../reference/augmentedTypesEnum.errors.txt | 32 ++++----- .../reference/augmentedTypesEnum2.errors.txt | 16 ++--- .../augmentedTypesFunction.errors.txt | 8 +-- .../augmentedTypesInterface.errors.txt | 8 +-- .../reference/augmentedTypesVar.errors.txt | 8 +-- .../reference/constEnumErrors.errors.txt | 8 +-- .../duplicateIdentifierEnum.errors.txt | 69 ++++++++++++++++++ .../reference/duplicateIdentifierEnum.js | 72 +++++++++++++++++++ .../reference/duplicateIdentifierEnum.symbols | 63 ++++++++++++++++ .../reference/duplicateIdentifierEnum.types | 65 +++++++++++++++++ .../reference/enumGenericTypeClash.errors.txt | 8 +-- .../reference/reservedWords2.errors.txt | 12 +++- .../cases/compiler/duplicateIdentifierEnum.ts | 37 ++++++++++ 18 files changed, 381 insertions(+), 57 deletions(-) create mode 100644 tests/baselines/reference/duplicateIdentifierEnum.errors.txt create mode 100644 tests/baselines/reference/duplicateIdentifierEnum.js create mode 100644 tests/baselines/reference/duplicateIdentifierEnum.symbols create mode 100644 tests/baselines/reference/duplicateIdentifierEnum.types create mode 100644 tests/cases/compiler/duplicateIdentifierEnum.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index d196d8add4d..dedf7cb1807 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -393,6 +393,10 @@ namespace ts { ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; + if (symbol.flags & SymbolFlags.Enum || includes & SymbolFlags.Enum) { + message = Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } + if (symbol.declarations && symbol.declarations.length) { // If the current node is a default export of some sort, then check if // there are any other default exports that we need to error on. diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4b24ff15ef7..d8f95d86662 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -863,8 +863,11 @@ namespace ts { error(getNameOfDeclaration(source.declarations[0]), Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - const message = target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable - ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0; + const message = target.flags & SymbolFlags.Enum || source.flags & SymbolFlags.Enum + ? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable + ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : Diagnostics.Duplicate_identifier_0; forEach(source.declarations, node => { error(getNameOfDeclaration(node) || node, message, symbolToString(source)); }); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 77614dd7573..f120e81283a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1984,6 +1984,11 @@ "category": "Error", "code": 2566 }, + "Enum declarations can only merge with namespace or other enum declarations.": { + "category": "Error", + "code": 2567 + }, + "JSX element attributes type '{0}' may not be a union type.": { "category": "Error", "code": 2600 diff --git a/tests/baselines/reference/augmentedTypesClass.errors.txt b/tests/baselines/reference/augmentedTypesClass.errors.txt index 2ff6889e22f..e5fd7a6d82e 100644 --- a/tests/baselines/reference/augmentedTypesClass.errors.txt +++ b/tests/baselines/reference/augmentedTypesClass.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/augmentedTypesClass.ts(2,7): error TS2300: Duplicate identifier 'c1'. tests/cases/compiler/augmentedTypesClass.ts(3,5): error TS2300: Duplicate identifier 'c1'. -tests/cases/compiler/augmentedTypesClass.ts(6,7): error TS2300: Duplicate identifier 'c4'. -tests/cases/compiler/augmentedTypesClass.ts(7,6): error TS2300: Duplicate identifier 'c4'. +tests/cases/compiler/augmentedTypesClass.ts(6,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesClass.ts(7,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. ==== tests/cases/compiler/augmentedTypesClass.ts (4 errors) ==== @@ -16,7 +16,7 @@ tests/cases/compiler/augmentedTypesClass.ts(7,6): error TS2300: Duplicate identi //// class then enum class c4 { public foo() { } } ~~ -!!! error TS2300: Duplicate identifier 'c4'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. enum c4 { One } // error ~~ -!!! error TS2300: Duplicate identifier 'c4'. \ No newline at end of file +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. \ No newline at end of file diff --git a/tests/baselines/reference/augmentedTypesClass2.errors.txt b/tests/baselines/reference/augmentedTypesClass2.errors.txt index a27189cf2c2..a7636499803 100644 --- a/tests/baselines/reference/augmentedTypesClass2.errors.txt +++ b/tests/baselines/reference/augmentedTypesClass2.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/augmentedTypesClass2.ts(16,7): error TS2300: Duplicate identifier 'c33'. -tests/cases/compiler/augmentedTypesClass2.ts(21,6): error TS2300: Duplicate identifier 'c33'. +tests/cases/compiler/augmentedTypesClass2.ts(16,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesClass2.ts(21,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. ==== tests/cases/compiler/augmentedTypesClass2.ts (2 errors) ==== @@ -20,14 +20,14 @@ tests/cases/compiler/augmentedTypesClass2.ts(21,6): error TS2300: Duplicate iden // class then enum class c33 { ~~~ -!!! error TS2300: Duplicate identifier 'c33'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. foo() { return 1; } } enum c33 { One }; ~~~ -!!! error TS2300: Duplicate identifier 'c33'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. // class then import class c44 { diff --git a/tests/baselines/reference/augmentedTypesEnum.errors.txt b/tests/baselines/reference/augmentedTypesEnum.errors.txt index 3102f9d4786..ca661e5bcf5 100644 --- a/tests/baselines/reference/augmentedTypesEnum.errors.txt +++ b/tests/baselines/reference/augmentedTypesEnum.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/augmentedTypesEnum.ts(2,6): error TS2300: Duplicate identifier 'e1111'. -tests/cases/compiler/augmentedTypesEnum.ts(3,5): error TS2300: Duplicate identifier 'e1111'. -tests/cases/compiler/augmentedTypesEnum.ts(6,6): error TS2300: Duplicate identifier 'e2'. -tests/cases/compiler/augmentedTypesEnum.ts(7,10): error TS2300: Duplicate identifier 'e2'. -tests/cases/compiler/augmentedTypesEnum.ts(9,6): error TS2300: Duplicate identifier 'e3'. -tests/cases/compiler/augmentedTypesEnum.ts(10,5): error TS2300: Duplicate identifier 'e3'. -tests/cases/compiler/augmentedTypesEnum.ts(13,6): error TS2300: Duplicate identifier 'e4'. -tests/cases/compiler/augmentedTypesEnum.ts(14,7): error TS2300: Duplicate identifier 'e4'. +tests/cases/compiler/augmentedTypesEnum.ts(2,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum.ts(3,5): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum.ts(6,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum.ts(7,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum.ts(9,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum.ts(10,5): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum.ts(13,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum.ts(14,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/augmentedTypesEnum.ts(18,11): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. tests/cases/compiler/augmentedTypesEnum.ts(20,12): error TS2300: Duplicate identifier 'One'. tests/cases/compiler/augmentedTypesEnum.ts(21,12): error TS2300: Duplicate identifier 'One'. @@ -16,33 +16,33 @@ tests/cases/compiler/augmentedTypesEnum.ts(21,12): error TS2432: In an enum with // enum then var enum e1111 { One } // error ~~~~~ -!!! error TS2300: Duplicate identifier 'e1111'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. var e1111 = 1; // error ~~~~~ -!!! error TS2300: Duplicate identifier 'e1111'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. // enum then function enum e2 { One } // error ~~ -!!! error TS2300: Duplicate identifier 'e2'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. function e2() { } // error ~~ -!!! error TS2300: Duplicate identifier 'e2'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. enum e3 { One } // error ~~ -!!! error TS2300: Duplicate identifier 'e3'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. var e3 = () => { } // error ~~ -!!! error TS2300: Duplicate identifier 'e3'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. // enum then class enum e4 { One } // error ~~ -!!! error TS2300: Duplicate identifier 'e4'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. class e4 { public foo() { } } // error ~~ -!!! error TS2300: Duplicate identifier 'e4'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. // enum then enum enum e5 { One } diff --git a/tests/baselines/reference/augmentedTypesEnum2.errors.txt b/tests/baselines/reference/augmentedTypesEnum2.errors.txt index 8c6c7382f85..2d47c26c896 100644 --- a/tests/baselines/reference/augmentedTypesEnum2.errors.txt +++ b/tests/baselines/reference/augmentedTypesEnum2.errors.txt @@ -1,18 +1,18 @@ -tests/cases/compiler/augmentedTypesEnum2.ts(2,6): error TS2300: Duplicate identifier 'e1'. -tests/cases/compiler/augmentedTypesEnum2.ts(4,11): error TS2300: Duplicate identifier 'e1'. -tests/cases/compiler/augmentedTypesEnum2.ts(11,6): error TS2300: Duplicate identifier 'e2'. -tests/cases/compiler/augmentedTypesEnum2.ts(12,7): error TS2300: Duplicate identifier 'e2'. +tests/cases/compiler/augmentedTypesEnum2.ts(2,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum2.ts(4,11): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum2.ts(11,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesEnum2.ts(12,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations. ==== tests/cases/compiler/augmentedTypesEnum2.ts (4 errors) ==== // enum then interface enum e1 { One } // error ~~ -!!! error TS2300: Duplicate identifier 'e1'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. interface e1 { // error ~~ -!!! error TS2300: Duplicate identifier 'e1'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. foo(): void; } @@ -21,10 +21,10 @@ tests/cases/compiler/augmentedTypesEnum2.ts(12,7): error TS2300: Duplicate ident // enum then class enum e2 { One }; // error ~~ -!!! error TS2300: Duplicate identifier 'e2'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. class e2 { // error ~~ -!!! error TS2300: Duplicate identifier 'e2'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. foo() { return 1; } diff --git a/tests/baselines/reference/augmentedTypesFunction.errors.txt b/tests/baselines/reference/augmentedTypesFunction.errors.txt index 8d1ce671c9e..2b17ee912fb 100644 --- a/tests/baselines/reference/augmentedTypesFunction.errors.txt +++ b/tests/baselines/reference/augmentedTypesFunction.errors.txt @@ -8,8 +8,8 @@ tests/cases/compiler/augmentedTypesFunction.ts(13,10): error TS2300: Duplicate i tests/cases/compiler/augmentedTypesFunction.ts(14,7): error TS2300: Duplicate identifier 'y3'. tests/cases/compiler/augmentedTypesFunction.ts(16,10): error TS2300: Duplicate identifier 'y3a'. tests/cases/compiler/augmentedTypesFunction.ts(17,7): error TS2300: Duplicate identifier 'y3a'. -tests/cases/compiler/augmentedTypesFunction.ts(20,10): error TS2300: Duplicate identifier 'y4'. -tests/cases/compiler/augmentedTypesFunction.ts(21,6): error TS2300: Duplicate identifier 'y4'. +tests/cases/compiler/augmentedTypesFunction.ts(20,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesFunction.ts(21,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. ==== tests/cases/compiler/augmentedTypesFunction.ts (12 errors) ==== @@ -54,10 +54,10 @@ tests/cases/compiler/augmentedTypesFunction.ts(21,6): error TS2300: Duplicate id // function then enum function y4() { } // error ~~ -!!! error TS2300: Duplicate identifier 'y4'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. enum y4 { One } // error ~~ -!!! error TS2300: Duplicate identifier 'y4'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. // function then internal module function y5() { } diff --git a/tests/baselines/reference/augmentedTypesInterface.errors.txt b/tests/baselines/reference/augmentedTypesInterface.errors.txt index 51092e1d27f..75828689619 100644 --- a/tests/baselines/reference/augmentedTypesInterface.errors.txt +++ b/tests/baselines/reference/augmentedTypesInterface.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/augmentedTypesInterface.ts(23,11): error TS2300: Duplicate identifier 'i3'. -tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate identifier 'i3'. +tests/cases/compiler/augmentedTypesInterface.ts(23,11): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. ==== tests/cases/compiler/augmentedTypesInterface.ts (2 errors) ==== @@ -27,12 +27,12 @@ tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate i // interface then enum interface i3 { // error ~~ -!!! error TS2300: Duplicate identifier 'i3'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. foo(): void; } enum i3 { One }; // error ~~ -!!! error TS2300: Duplicate identifier 'i3'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. // interface then import interface i4 { diff --git a/tests/baselines/reference/augmentedTypesVar.errors.txt b/tests/baselines/reference/augmentedTypesVar.errors.txt index 24c194d25c3..261686f3659 100644 --- a/tests/baselines/reference/augmentedTypesVar.errors.txt +++ b/tests/baselines/reference/augmentedTypesVar.errors.txt @@ -5,8 +5,8 @@ tests/cases/compiler/augmentedTypesVar.ts(13,5): error TS2300: Duplicate identif tests/cases/compiler/augmentedTypesVar.ts(14,7): error TS2300: Duplicate identifier 'x4'. tests/cases/compiler/augmentedTypesVar.ts(16,5): error TS2300: Duplicate identifier 'x4a'. tests/cases/compiler/augmentedTypesVar.ts(17,7): error TS2300: Duplicate identifier 'x4a'. -tests/cases/compiler/augmentedTypesVar.ts(20,5): error TS2300: Duplicate identifier 'x5'. -tests/cases/compiler/augmentedTypesVar.ts(21,6): error TS2300: Duplicate identifier 'x5'. +tests/cases/compiler/augmentedTypesVar.ts(20,5): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/augmentedTypesVar.ts(21,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/augmentedTypesVar.ts(27,5): error TS2300: Duplicate identifier 'x6a'. tests/cases/compiler/augmentedTypesVar.ts(28,8): error TS2300: Duplicate identifier 'x6a'. tests/cases/compiler/augmentedTypesVar.ts(30,5): error TS2300: Duplicate identifier 'x6b'. @@ -49,10 +49,10 @@ tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identif // var then enum var x5 = 1; ~~ -!!! error TS2300: Duplicate identifier 'x5'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. enum x5 { One } // error ~~ -!!! error TS2300: Duplicate identifier 'x5'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. // var then module var x6 = 1; diff --git a/tests/baselines/reference/constEnumErrors.errors.txt b/tests/baselines/reference/constEnumErrors.errors.txt index c2642c9b1ac..3763a218336 100644 --- a/tests/baselines/reference/constEnumErrors.errors.txt +++ b/tests/baselines/reference/constEnumErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/constEnumErrors.ts(1,12): error TS2300: Duplicate identifier 'E'. -tests/cases/compiler/constEnumErrors.ts(5,8): error TS2300: Duplicate identifier 'E'. +tests/cases/compiler/constEnumErrors.ts(1,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/constEnumErrors.ts(5,8): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/constEnumErrors.ts(12,9): error TS2651: A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums. tests/cases/compiler/constEnumErrors.ts(14,9): error TS2474: In 'const' enum declarations member initializer must be constant expression. tests/cases/compiler/constEnumErrors.ts(15,10): error TS2474: In 'const' enum declarations member initializer must be constant expression. @@ -16,13 +16,13 @@ tests/cases/compiler/constEnumErrors.ts(42,9): error TS2478: 'const' enum member ==== tests/cases/compiler/constEnumErrors.ts (13 errors) ==== const enum E { ~ -!!! error TS2300: Duplicate identifier 'E'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. A } module E { ~ -!!! error TS2300: Duplicate identifier 'E'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. var x = 1; } diff --git a/tests/baselines/reference/duplicateIdentifierEnum.errors.txt b/tests/baselines/reference/duplicateIdentifierEnum.errors.txt new file mode 100644 index 00000000000..69266cc5ba4 --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierEnum.errors.txt @@ -0,0 +1,69 @@ +tests/cases/compiler/duplicateIdentifierEnum_A.ts(2,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_A.ts(5,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_A.ts(9,11): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_A.ts(12,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_A.ts(16,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_A.ts(19,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_A.ts(23,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_A.ts(26,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_B.ts(1,10): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/duplicateIdentifierEnum_B.ts(4,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. + + +==== tests/cases/compiler/duplicateIdentifierEnum_A.ts (8 errors) ==== + // Test the error message when attempting to merge an enum with a class, an interface, or a function. + enum A { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + bar + } + class A { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + foo: number; + } + + interface B { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + foo: number; + } + const enum B { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + bar + } + + const enum C { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + + } + function C() { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + return 0; + } + + enum D { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + bar + } + class E { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + foo: number; + } + // also make sure the error appears when trying to merge an enum in a separate file. +==== tests/cases/compiler/duplicateIdentifierEnum_B.ts (2 errors) ==== + function D() { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + return 0; + } + enum E { + ~ +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. + bar + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateIdentifierEnum.js b/tests/baselines/reference/duplicateIdentifierEnum.js new file mode 100644 index 00000000000..c6d9fe979fa --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierEnum.js @@ -0,0 +1,72 @@ +//// [tests/cases/compiler/duplicateIdentifierEnum.ts] //// + +//// [duplicateIdentifierEnum_A.ts] +// Test the error message when attempting to merge an enum with a class, an interface, or a function. +enum A { + bar +} +class A { + foo: number; +} + +interface B { + foo: number; +} +const enum B { + bar +} + +const enum C { + +} +function C() { + return 0; +} + +enum D { + bar +} +class E { + foo: number; +} +// also make sure the error appears when trying to merge an enum in a separate file. +//// [duplicateIdentifierEnum_B.ts] +function D() { + return 0; +} +enum E { + bar +} + +//// [duplicateIdentifierEnum_A.js] +// Test the error message when attempting to merge an enum with a class, an interface, or a function. +var A; +(function (A) { + A[A["bar"] = 0] = "bar"; +})(A || (A = {})); +var A = /** @class */ (function () { + function A() { + } + return A; +}()); +function C() { + return 0; +} +var D; +(function (D) { + D[D["bar"] = 0] = "bar"; +})(D || (D = {})); +var E = /** @class */ (function () { + function E() { + } + return E; +}()); +// also make sure the error appears when trying to merge an enum in a separate file. +//// [duplicateIdentifierEnum_B.js] +function D() { + return 0; +} +var E; +(function (E) { + E[E["bar"] = 0] = "bar"; +})(E || (E = {})); diff --git a/tests/baselines/reference/duplicateIdentifierEnum.symbols b/tests/baselines/reference/duplicateIdentifierEnum.symbols new file mode 100644 index 00000000000..c69f8da48a0 --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierEnum.symbols @@ -0,0 +1,63 @@ +=== tests/cases/compiler/duplicateIdentifierEnum_A.ts === +// Test the error message when attempting to merge an enum with a class, an interface, or a function. +enum A { +>A : Symbol(A, Decl(duplicateIdentifierEnum_A.ts, 0, 0)) + + bar +>bar : Symbol(A.bar, Decl(duplicateIdentifierEnum_A.ts, 1, 8)) +} +class A { +>A : Symbol(A, Decl(duplicateIdentifierEnum_A.ts, 3, 1)) + + foo: number; +>foo : Symbol(A.foo, Decl(duplicateIdentifierEnum_A.ts, 4, 9)) +} + +interface B { +>B : Symbol(B, Decl(duplicateIdentifierEnum_A.ts, 6, 1)) + + foo: number; +>foo : Symbol(B.foo, Decl(duplicateIdentifierEnum_A.ts, 8, 13)) +} +const enum B { +>B : Symbol(B, Decl(duplicateIdentifierEnum_A.ts, 10, 1)) + + bar +>bar : Symbol(B.bar, Decl(duplicateIdentifierEnum_A.ts, 11, 14)) +} + +const enum C { +>C : Symbol(C, Decl(duplicateIdentifierEnum_A.ts, 13, 1)) + +} +function C() { +>C : Symbol(C, Decl(duplicateIdentifierEnum_A.ts, 17, 1)) + + return 0; +} + +enum D { +>D : Symbol(D, Decl(duplicateIdentifierEnum_A.ts, 20, 1)) + + bar +>bar : Symbol(D.bar, Decl(duplicateIdentifierEnum_A.ts, 22, 8)) +} +class E { +>E : Symbol(E, Decl(duplicateIdentifierEnum_A.ts, 24, 1)) + + foo: number; +>foo : Symbol(E.foo, Decl(duplicateIdentifierEnum_A.ts, 25, 9)) +} +// also make sure the error appears when trying to merge an enum in a separate file. +=== tests/cases/compiler/duplicateIdentifierEnum_B.ts === +function D() { +>D : Symbol(D, Decl(duplicateIdentifierEnum_B.ts, 0, 0)) + + return 0; +} +enum E { +>E : Symbol(E, Decl(duplicateIdentifierEnum_B.ts, 2, 1)) + + bar +>bar : Symbol(E.bar, Decl(duplicateIdentifierEnum_B.ts, 3, 8)) +} diff --git a/tests/baselines/reference/duplicateIdentifierEnum.types b/tests/baselines/reference/duplicateIdentifierEnum.types new file mode 100644 index 00000000000..7363309b3f4 --- /dev/null +++ b/tests/baselines/reference/duplicateIdentifierEnum.types @@ -0,0 +1,65 @@ +=== tests/cases/compiler/duplicateIdentifierEnum_A.ts === +// Test the error message when attempting to merge an enum with a class, an interface, or a function. +enum A { +>A : A + + bar +>bar : A +} +class A { +>A : A + + foo: number; +>foo : number +} + +interface B { +>B : B + + foo: number; +>foo : number +} +const enum B { +>B : B + + bar +>bar : B +} + +const enum C { +>C : C + +} +function C() { +>C : () => number + + return 0; +>0 : 0 +} + +enum D { +>D : D + + bar +>bar : D +} +class E { +>E : E + + foo: number; +>foo : number +} +// also make sure the error appears when trying to merge an enum in a separate file. +=== tests/cases/compiler/duplicateIdentifierEnum_B.ts === +function D() { +>D : () => number + + return 0; +>0 : 0 +} +enum E { +>E : E + + bar +>bar : E +} diff --git a/tests/baselines/reference/enumGenericTypeClash.errors.txt b/tests/baselines/reference/enumGenericTypeClash.errors.txt index 23007175e4c..5f42e7a7e2e 100644 --- a/tests/baselines/reference/enumGenericTypeClash.errors.txt +++ b/tests/baselines/reference/enumGenericTypeClash.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/enumGenericTypeClash.ts(1,7): error TS2300: Duplicate identifier 'X'. -tests/cases/compiler/enumGenericTypeClash.ts(2,6): error TS2300: Duplicate identifier 'X'. +tests/cases/compiler/enumGenericTypeClash.ts(1,7): error TS2567: Enum declarations can only merge with namespace or other enum declarations. +tests/cases/compiler/enumGenericTypeClash.ts(2,6): error TS2567: Enum declarations can only merge with namespace or other enum declarations. ==== tests/cases/compiler/enumGenericTypeClash.ts (2 errors) ==== class X { } ~ -!!! error TS2300: Duplicate identifier 'X'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. enum X { MyVal } ~ -!!! error TS2300: Duplicate identifier 'X'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. \ No newline at end of file diff --git a/tests/baselines/reference/reservedWords2.errors.txt b/tests/baselines/reference/reservedWords2.errors.txt index 5aa1df63a96..f1d781ed59e 100644 --- a/tests/baselines/reference/reservedWords2.errors.txt +++ b/tests/baselines/reference/reservedWords2.errors.txt @@ -3,6 +3,7 @@ tests/cases/compiler/reservedWords2.ts(1,14): error TS1005: '(' expected. tests/cases/compiler/reservedWords2.ts(1,16): error TS2304: Cannot find name 'require'. tests/cases/compiler/reservedWords2.ts(1,31): error TS1005: ')' expected. tests/cases/compiler/reservedWords2.ts(2,12): error TS2300: Duplicate identifier '(Missing)'. +tests/cases/compiler/reservedWords2.ts(2,12): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/reservedWords2.ts(2,14): error TS1003: Identifier expected. tests/cases/compiler/reservedWords2.ts(2,20): error TS1005: '(' expected. tests/cases/compiler/reservedWords2.ts(2,20): error TS2304: Cannot find name 'from'. @@ -10,6 +11,7 @@ tests/cases/compiler/reservedWords2.ts(2,25): error TS1005: ')' expected. tests/cases/compiler/reservedWords2.ts(4,5): error TS1134: Variable declaration expected. tests/cases/compiler/reservedWords2.ts(4,12): error TS1109: Expression expected. tests/cases/compiler/reservedWords2.ts(5,9): error TS2300: Duplicate identifier '(Missing)'. +tests/cases/compiler/reservedWords2.ts(5,9): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/reservedWords2.ts(5,10): error TS1003: Identifier expected. tests/cases/compiler/reservedWords2.ts(5,18): error TS1005: '=>' expected. tests/cases/compiler/reservedWords2.ts(6,1): error TS2304: Cannot find name 'module'. @@ -27,11 +29,11 @@ tests/cases/compiler/reservedWords2.ts(9,6): error TS1181: Array element destruc tests/cases/compiler/reservedWords2.ts(9,14): error TS1005: ';' expected. tests/cases/compiler/reservedWords2.ts(9,18): error TS1005: '(' expected. tests/cases/compiler/reservedWords2.ts(9,20): error TS1128: Declaration or statement expected. -tests/cases/compiler/reservedWords2.ts(10,5): error TS2300: Duplicate identifier '(Missing)'. +tests/cases/compiler/reservedWords2.ts(10,5): error TS2567: Enum declarations can only merge with namespace or other enum declarations. tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. -==== tests/cases/compiler/reservedWords2.ts (31 errors) ==== +==== tests/cases/compiler/reservedWords2.ts (33 errors) ==== import while = require("dfdf"); ~~~~~ !!! error TS1109: Expression expected. @@ -44,6 +46,8 @@ tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. import * as while from "foo" !!! error TS2300: Duplicate identifier '(Missing)'. + +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. ~~~~~ !!! error TS1003: Identifier expected. ~~~~ @@ -61,6 +65,8 @@ tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. function throw() {} !!! error TS2300: Duplicate identifier '(Missing)'. + +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. ~~~~~ !!! error TS1003: Identifier expected. ~ @@ -101,7 +107,7 @@ tests/cases/compiler/reservedWords2.ts(10,6): error TS1003: Identifier expected. !!! error TS1128: Declaration or statement expected. enum void {} -!!! error TS2300: Duplicate identifier '(Missing)'. +!!! error TS2567: Enum declarations can only merge with namespace or other enum declarations. ~~~~ !!! error TS1003: Identifier expected. diff --git a/tests/cases/compiler/duplicateIdentifierEnum.ts b/tests/cases/compiler/duplicateIdentifierEnum.ts new file mode 100644 index 00000000000..c4f13b24602 --- /dev/null +++ b/tests/cases/compiler/duplicateIdentifierEnum.ts @@ -0,0 +1,37 @@ +// Test the error message when attempting to merge an enum with a class, an interface, or a function. +// @Filename: duplicateIdentifierEnum_A.ts +enum A { + bar +} +class A { + foo: number; +} + +interface B { + foo: number; +} +const enum B { + bar +} + +const enum C { + +} +function C() { + return 0; +} + +enum D { + bar +} +class E { + foo: number; +} +// also make sure the error appears when trying to merge an enum in a separate file. +// @Filename: duplicateIdentifierEnum_B.ts +function D() { + return 0; +} +enum E { + bar +} \ No newline at end of file From 74f01abfcff60806e87f2af5ad31ffd425af806f Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 12 Feb 2018 14:42:16 -0800 Subject: [PATCH 133/298] Clean up findPrecedingToken and avoid returning whitespace-only jsx text token (#21903) --- src/compiler/utilities.ts | 1 + src/services/utilities.ts | 61 ++++++++++--------- .../reference/api/tsserverlibrary.d.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 + 4 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index c8541da79d1..2d5ac780d6a 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5153,6 +5153,7 @@ namespace ts { /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ export function isToken(n: Node): boolean { return n.kind >= SyntaxKind.FirstToken && n.kind <= SyntaxKind.LastToken; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 8b4bb1ad212..8df8a902734 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -761,23 +761,12 @@ namespace ts { Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); return result; - function findRightmostToken(n: Node): Node { - if (isToken(n)) { + function find(n: Node): Node | undefined { + if (isNonWhitespaceToken(n)) { return n; } - const children = n.getChildren(); - const candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - - } - - function find(n: Node): Node { - if (isToken(n)) { - return n; - } - - const children = n.getChildren(); + const children = n.getChildren(sourceFile); for (let i = 0; i < children.length; i++) { const child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). @@ -795,7 +784,7 @@ namespace ts { if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child const candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } else { // candidate should be in this node @@ -812,23 +801,37 @@ namespace ts { // Namely we are skipping the check: 'position < node.end' if (children.length) { const candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } } + } - /** - * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. - */ - function findRightmostChildNodeWithTokens(children: Node[], exclusiveStartPosition: number): Node { - for (let i = exclusiveStartPosition - 1; i >= 0; i--) { - const child = children[i]; + function isNonWhitespaceToken(n: Node): boolean { + return isToken(n) && !isWhiteSpaceOnlyJsxText(n); + } - if (isWhiteSpaceOnlyJsxText(child)) { - Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - else if (nodeHasTokens(children[i])) { - return children[i]; - } + function findRightmostToken(n: Node, sourceFile: SourceFile): Node | undefined { + if (isNonWhitespaceToken(n)) { + return n; + } + + const children = n.getChildren(sourceFile); + const candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate, sourceFile); + } + + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ + function findRightmostChildNodeWithTokens(children: Node[], exclusiveStartPosition: number): Node | undefined { + for (let i = exclusiveStartPosition - 1; i >= 0; i--) { + const child = children[i]; + + if (isWhiteSpaceOnlyJsxText(child)) { + Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { + return children[i]; } } } @@ -893,7 +896,7 @@ namespace ts { return false; } - export function isWhiteSpaceOnlyJsxText(node: Node): node is JsxText { + function isWhiteSpaceOnlyJsxText(node: Node): boolean { return isJsxText(node) && node.containsOnlyWhiteSpaces; } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 90a73a823eb..6ef91a9a057 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3211,6 +3211,7 @@ declare namespace ts { /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n: Node): boolean; function isLiteralExpression(node: Node): node is LiteralExpression; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 571e6aadcd3..b6877639e5c 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3266,6 +3266,7 @@ declare namespace ts { /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n: Node): boolean; function isLiteralExpression(node: Node): node is LiteralExpression; From a629acd8fd4844742fdd01ab6cf55afa9377db0e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 12 Feb 2018 16:20:49 -0800 Subject: [PATCH 134/298] Allow +/- to prefix 'readonly' and '?' modifiers in mapped types --- src/compiler/checker.ts | 66 +++++++++++++++++++----------- src/compiler/declarationEmitter.ts | 8 +++- src/compiler/emitter.ts | 12 ++++-- src/compiler/factory.ts | 4 +- src/compiler/parser.ts | 36 ++++++++++------ src/compiler/types.ts | 6 ++- 6 files changed, 86 insertions(+), 46 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a745a384128..75ab23407b3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -572,8 +572,10 @@ namespace ts { } const enum MappedTypeModifiers { - Readonly = 1 << 0, - Optional = 1 << 1, + IncludeReadonly = 1 << 0, + ExcludeReadonly = 1 << 1, + IncludeOptional = 1 << 2, + ExcludeOptional = 1 << 3, } const enum ExpandingFlags { @@ -2967,11 +2969,10 @@ namespace ts { function createMappedTypeNodeFromType(type: MappedType) { Debug.assert(!!(type.flags & TypeFlags.Object)); - const readonlyToken = type.declaration && type.declaration.readonlyToken ? createToken(SyntaxKind.ReadonlyKeyword) : undefined; - const questionToken = type.declaration && type.declaration.questionToken ? createToken(SyntaxKind.QuestionToken) : undefined; + const readonlyToken = type.declaration.readonlyToken ? createToken(type.declaration.readonlyToken.kind) : undefined; + const questionToken = type.declaration.questionToken ? createToken(type.declaration.questionToken.kind) : undefined; const typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); const templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); - const mappedTypeNode = createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); return setEmitFlags(mappedTypeNode, EmitFlags.SingleLine); } @@ -5819,8 +5820,9 @@ namespace ts { function resolveReverseMappedTypeMembers(type: ReverseMappedType) { const indexInfo = getIndexInfoOfType(type.source, IndexKind.String); - const readonlyMask = type.mappedType.declaration.readonlyToken ? false : true; - const optionalMask = type.mappedType.declaration.questionToken ? 0 : SymbolFlags.Optional; + const modifiers = getMappedTypeModifiers(type.mappedType); + const readonlyMask = modifiers & MappedTypeModifiers.IncludeReadonly ? false : true; + const optionalMask = modifiers & MappedTypeModifiers.IncludeOptional ? 0 : SymbolFlags.Optional; const stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); const members = createSymbolTable(); for (const prop of getPropertiesOfType(type.source)) { @@ -5846,8 +5848,7 @@ namespace ts { const constraintType = getConstraintTypeFromMappedType(type); const templateType = getTemplateTypeFromMappedType(type.target || type); const modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' - const templateReadonly = !!type.declaration.readonlyToken; - const templateOptional = !!type.declaration.questionToken; + const templateModifiers = getMappedTypeModifiers(type); const constraintDeclaration = type.declaration.typeParameter.constraint; if (constraintDeclaration.kind === SyntaxKind.TypeOperator && (constraintDeclaration).operator === SyntaxKind.KeyOfKeyword) { @@ -5888,10 +5889,17 @@ namespace ts { if (t.flags & TypeFlags.StringLiteral) { const propName = escapeLeadingUnderscores((t).value); const modifiersProp = getPropertyOfType(modifiersType, propName); - const isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & SymbolFlags.Optional); - const checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? CheckFlags.Readonly : 0; - const prop = createSymbol(SymbolFlags.Property | (isOptional ? SymbolFlags.Optional : 0), propName, checkFlags); - prop.type = propType; + const isOptional = !!(templateModifiers & MappedTypeModifiers.IncludeOptional || + !(templateModifiers & MappedTypeModifiers.ExcludeOptional) && modifiersProp && modifiersProp.flags & SymbolFlags.Optional); + const isReadonly = !!(templateModifiers & MappedTypeModifiers.IncludeReadonly || + !(templateModifiers & MappedTypeModifiers.ExcludeReadonly) && modifiersProp && isReadonlySymbol(modifiersProp)); + const prop = createSymbol(SymbolFlags.Property | (isOptional ? SymbolFlags.Optional : 0), propName, isReadonly ? CheckFlags.Readonly : 0); + // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the + // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks + // mode, if the underlying property is optional we remove 'undefined' from the type. + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & SymbolFlags.Optional ? getTypeWithFacts(propType, TypeFacts.NEUndefined) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; @@ -5900,7 +5908,7 @@ namespace ts { members.set(propName, prop); } else if (t.flags & (TypeFlags.Any | TypeFlags.String)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & MappedTypeModifiers.IncludeReadonly)); } } } @@ -5918,7 +5926,7 @@ namespace ts { function getTemplateTypeFromMappedType(type: MappedType) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & MappedTypeModifiers.IncludeOptional)), type.mapper || identityMapper) : unknownType); } @@ -5946,18 +5954,24 @@ namespace ts { } function getMappedTypeModifiers(type: MappedType): MappedTypeModifiers { - return (type.declaration.readonlyToken ? MappedTypeModifiers.Readonly : 0) | - (type.declaration.questionToken ? MappedTypeModifiers.Optional : 0); + const declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === SyntaxKind.MinusToken ? MappedTypeModifiers.ExcludeReadonly : MappedTypeModifiers.IncludeReadonly : 0) | + (declaration.questionToken ? declaration.questionToken.kind === SyntaxKind.MinusToken ? MappedTypeModifiers.ExcludeOptional : MappedTypeModifiers.IncludeOptional : 0); } - function getCombinedMappedTypeModifiers(type: MappedType): MappedTypeModifiers { + function getMappedTypeOptionality(type: MappedType): number { + const modifiers = getMappedTypeModifiers(type); + return modifiers & MappedTypeModifiers.ExcludeOptional ? -1 : modifiers & MappedTypeModifiers.IncludeOptional ? 1 : 0; + } + + function getCombinedMappedTypeOptionality(type: MappedType): number { + const optionality = getMappedTypeOptionality(type); const modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type: Type) { - return getObjectFlags(type) & ObjectFlags.Mapped && !!(type).declaration.questionToken; + return !!(getObjectFlags(type) & ObjectFlags.Mapped && getMappedTypeModifiers(type) & MappedTypeModifiers.IncludeOptional); } function isGenericMappedType(type: Type): type is MappedType { @@ -9960,7 +9974,7 @@ namespace ts { if (target.flags & TypeFlags.TypeParameter) { // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. if (getObjectFlags(source) & ObjectFlags.Mapped && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!(source).declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & MappedTypeModifiers.IncludeOptional)) { const templateType = getTemplateTypeFromMappedType(source); const indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -9999,6 +10013,8 @@ namespace ts { else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } const template = getTemplateTypeFromMappedType(target); + const modifiers = getMappedTypeModifiers(target); + if (!(modifiers & MappedTypeModifiers.ExcludeOptional)) { if (template.flags & TypeFlags.IndexedAccess && (template).objectType === source && (template).indexType === getTypeParameterFromMappedType(target)) { return Ternary.True; @@ -10013,6 +10029,7 @@ namespace ts { } } } + } if (source.flags & TypeFlags.TypeParameter) { let constraint = getConstraintForRelation(source); @@ -10162,8 +10179,7 @@ namespace ts { function mappedTypeRelatedTo(source: MappedType, target: MappedType, reportErrors: boolean): Ternary { const modifiersRelated = relation === comparableRelation || ( relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & MappedTypeModifiers.Optional) || - getCombinedMappedTypeModifiers(target) & MappedTypeModifiers.Optional); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { let result: Ternary; if (result = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -20345,7 +20361,7 @@ namespace ts { const indexType = (type).indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { if (accessNode.kind === SyntaxKind.ElementAccessExpression && isAssignmentTarget(accessNode) && - getObjectFlags(objectType) & ObjectFlags.Mapped && (objectType).declaration.readonlyToken) { + getObjectFlags(objectType) & ObjectFlags.Mapped && getMappedTypeModifiers(objectType) & MappedTypeModifiers.IncludeReadonly) { error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 24646ff31eb..f18a32889aa 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -593,7 +593,9 @@ namespace ts { writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === SyntaxKind.PlusToken ? "+readonly " : + node.readonlyToken.kind === SyntaxKind.MinusToken ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -601,7 +603,9 @@ namespace ts { emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === SyntaxKind.PlusToken ? "+?" : + node.questionToken.kind === SyntaxKind.MinusToken ? "-?" : + "?"); } write(": "); emitType(node.type); diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 3c9866b3536..735e0d67f47 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1251,14 +1251,20 @@ namespace ts { } if (node.readonlyToken) { emit(node.readonlyToken); + if (node.readonlyToken.kind !== SyntaxKind.ReadonlyKeyword) { + writeKeyword("readonly"); + } writeSpace(); } - writePunctuation("["); pipelineEmitWithNotification(EmitHint.MappedTypeParameter, node.typeParameter); writePunctuation("]"); - - emitIfPresent(node.questionToken); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== SyntaxKind.QuestionToken) { + writePunctuation("?"); + } + } writePunctuation(":"); writeSpace(); emit(node.type); diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 165c70b37e6..8166196e469 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -804,7 +804,7 @@ namespace ts { : node; } - export function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode { + export function createMappedTypeNode(readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode { const node = createSynthesizedNode(SyntaxKind.MappedType) as MappedTypeNode; node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; @@ -813,7 +813,7 @@ namespace ts { return node; } - export function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode { + export function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode { return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.questionToken !== questionToken diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 3209f234f85..b71983b9783 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -695,7 +695,7 @@ namespace ts { else if (token() === SyntaxKind.OpenBraceToken || lookAhead(() => token() === SyntaxKind.StringLiteral)) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(SyntaxKind.EndOfFileToken, /*reportAtCurrentPosition*/ false, Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(SyntaxKind.EndOfFileToken, Diagnostics.Unexpected_token); } else { parseExpected(SyntaxKind.OpenBraceToken); @@ -1135,10 +1135,10 @@ namespace ts { return undefined; } - function parseExpectedToken(t: TKind, reportAtCurrentPosition: boolean, diagnosticMessage: DiagnosticMessage, arg0?: any): Token; - function parseExpectedToken(t: SyntaxKind, reportAtCurrentPosition: boolean, diagnosticMessage: DiagnosticMessage, arg0?: any): Node { + function parseExpectedToken(t: TKind, diagnosticMessage?: DiagnosticMessage, arg0?: any): Token; + function parseExpectedToken(t: SyntaxKind, diagnosticMessage?: DiagnosticMessage, arg0?: any): Node { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || Diagnostics._0_expected, arg0 || tokenToString(t)); } function parseTokenNode(): T { @@ -2113,7 +2113,7 @@ namespace ts { literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(SyntaxKind.TemplateTail, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, tokenToString(SyntaxKind.CloseBraceToken)); + literal = parseExpectedToken(SyntaxKind.TemplateTail, Diagnostics._0_expected, tokenToString(SyntaxKind.CloseBraceToken)); } span.literal = literal; @@ -2607,6 +2607,9 @@ namespace ts { function isStartOfMappedType() { nextToken(); + if (token() === SyntaxKind.PlusToken || token() === SyntaxKind.MinusToken) { + return nextToken() === SyntaxKind.ReadonlyKeyword; + } if (token() === SyntaxKind.ReadonlyKeyword) { nextToken(); } @@ -2624,11 +2627,21 @@ namespace ts { function parseMappedType() { const node = createNode(SyntaxKind.MappedType); parseExpected(SyntaxKind.OpenBraceToken); - node.readonlyToken = parseOptionalToken(SyntaxKind.ReadonlyKeyword); + if (token() === SyntaxKind.ReadonlyKeyword || token() === SyntaxKind.PlusToken || token() === SyntaxKind.MinusToken) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== SyntaxKind.ReadonlyKeyword) { + parseExpectedToken(SyntaxKind.ReadonlyKeyword); + } + } parseExpected(SyntaxKind.OpenBracketToken); node.typeParameter = parseMappedTypeParameter(); parseExpected(SyntaxKind.CloseBracketToken); - node.questionToken = parseOptionalToken(SyntaxKind.QuestionToken); + if (token() === SyntaxKind.QuestionToken || token() === SyntaxKind.PlusToken || token() === SyntaxKind.MinusToken) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== SyntaxKind.QuestionToken) { + parseExpectedToken(SyntaxKind.QuestionToken); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(SyntaxKind.CloseBraceToken); @@ -3242,7 +3255,7 @@ namespace ts { node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); return addJSDocComment(finishNode(node)); @@ -3273,7 +3286,7 @@ namespace ts { // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. const lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(SyntaxKind.EqualsGreaterThanToken); arrowFunction.body = (lastToken === SyntaxKind.EqualsGreaterThanToken || lastToken === SyntaxKind.OpenBraceToken) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -3539,8 +3552,7 @@ namespace ts { node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(SyntaxKind.ColonToken, /*reportAtCurrentPosition*/ false, - Diagnostics._0_expected, tokenToString(SyntaxKind.ColonToken)); + node.colonToken = parseExpectedToken(SyntaxKind.ColonToken); node.whenFalse = nodeIsPresent(node.colonToken) ? parseAssignmentExpressionOrHigher() : createMissingNode(SyntaxKind.Identifier, /*reportAtCurrentPosition*/ false, Diagnostics._0_expected, tokenToString(SyntaxKind.ColonToken)); @@ -4014,7 +4026,7 @@ namespace ts { // If it wasn't then just try to parse out a '.' and report an error. const node = createNode(SyntaxKind.PropertyAccessExpression, expression.pos); node.expression = expression; - parseExpectedToken(SyntaxKind.DotToken, /*reportAtCurrentPosition*/ false, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(SyntaxKind.DotToken, Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b74ed84e809..f4a4fb8a79e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -661,6 +661,8 @@ namespace ts { export type AtToken = Token; export type ReadonlyToken = Token; export type AwaitKeywordToken = Token; + export type PlusToken = Token; + export type MinusToken = Token; export type Modifier = Token @@ -1158,9 +1160,9 @@ namespace ts { export interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; - readonlyToken?: ReadonlyToken; + readonlyToken?: ReadonlyToken | PlusToken | MinusToken; typeParameter: TypeParameterDeclaration; - questionToken?: QuestionToken; + questionToken?: QuestionToken | PlusToken | MinusToken; type?: TypeNode; } From d9d98cf11a6c522f0b3e40f98aaf7df3fc0f0d85 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 12 Feb 2018 14:55:58 -0800 Subject: [PATCH 135/298] Handle the delayed updates due to user action correctly when ensuring the project structure is upto date Fixes #20629 --- .../unittests/tsserverProjectSystem.ts | 3 - src/server/editorServices.ts | 165 ++++++------------ src/server/project.ts | 32 ++-- src/server/session.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 25 +-- 5 files changed, 82 insertions(+), 145 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 7094b7336e4..8d84732f3aa 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2111,9 +2111,6 @@ namespace ts.projectSystem { /*closedFiles*/ undefined); checkNumberOfProjects(projectService, { inferredProjects: 1 }); - const changedFiles = projectService.getChangedFiles_TestOnly(); - assert(changedFiles && changedFiles.length === 1, `expected 1 changed file, got ${JSON.stringify(changedFiles && changedFiles.length || 0)}`); - projectService.ensureInferredProjectsUpToDate_TestOnly(); checkNumberOfProjects(projectService, { inferredProjects: 2 }); }); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index e1b18ed2b20..3d0d623c6d4 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -376,9 +376,9 @@ namespace ts.server { private safelist: SafeList = defaultTypeSafeList; private legacySafelist: { [key: string]: string } = {}; - private changedFiles: ScriptInfo[]; private pendingProjectUpdates = createMap(); - private pendingInferredProjectUpdate: boolean; + /* @internal */ + pendingEnsureProjectForOpenFiles: boolean; readonly currentDirectory: string; readonly toCanonicalFileName: (f: string) => string; @@ -483,11 +483,6 @@ namespace ts.server { return getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory()); } - /* @internal */ - getChangedFiles_TestOnly() { - return this.changedFiles; - } - /* @internal */ ensureInferredProjectsUpToDate_TestOnly() { this.ensureProjectStructuresUptoDate(); @@ -552,19 +547,18 @@ namespace ts.server { this.typingsCache.deleteTypingsForProject(response.projectName); break; } - this.delayUpdateProjectGraphAndInferredProjectsRefresh(project); + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); } - private delayInferredProjectsRefresh() { - this.pendingInferredProjectUpdate = true; - this.throttledOperations.schedule("*refreshInferredProjects*", /*delay*/ 250, () => { + private delayEnsureProjectForOpenFiles() { + this.pendingEnsureProjectForOpenFiles = true; + this.throttledOperations.schedule("*ensureProjectForOpenFiles*", /*delay*/ 250, () => { if (this.pendingProjectUpdates.size !== 0) { - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); } else { - if (this.pendingInferredProjectUpdate) { - this.pendingInferredProjectUpdate = false; - this.refreshInferredProjects(); + if (this.pendingEnsureProjectForOpenFiles) { + this.ensureProjectForOpenFiles(); } // Send the event to notify that there were background project updates // send current list of open files @@ -574,6 +568,7 @@ namespace ts.server { } private delayUpdateProjectGraph(project: Project) { + project.markAsDirty(); const projectName = project.getProjectName(); this.pendingProjectUpdates.set(projectName, project); this.throttledOperations.schedule(projectName, /*delay*/ 250, () => { @@ -603,17 +598,16 @@ namespace ts.server { } /* @internal */ - delayUpdateProjectGraphAndInferredProjectsRefresh(project: Project) { - project.markAsDirty(); + delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project: Project) { this.delayUpdateProjectGraph(project); - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); } - private delayUpdateProjectGraphs(projects: Project[]) { + private delayUpdateProjectGraphs(projects: ReadonlyArray) { for (const project of projects) { this.delayUpdateProjectGraph(project); } - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); } setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void { @@ -632,7 +626,6 @@ namespace ts.server { this.compilerOptionsForInferredProjects = compilerOptions; } - const projectsToUpdate: Project[] = []; for (const project of this.inferredProjects) { // Only update compiler options in the following cases: // - Inferred projects without a projectRootPath, if the new options do not apply to @@ -648,11 +641,11 @@ namespace ts.server { project.setCompilerOptions(compilerOptions); project.compileOnSaveEnabled = compilerOptions.compileOnSave; project.markAsDirty(); - projectsToUpdate.push(project); + this.delayUpdateProjectGraph(project); } } - this.delayUpdateProjectGraphs(projectsToUpdate); + this.delayEnsureProjectForOpenFiles(); } findProject(projectName: string): Project | undefined { @@ -687,41 +680,27 @@ namespace ts.server { /** * Ensures the project structures are upto date * This means, - * - if there are changedFiles (the files were updated but their containing project graph was not upto date), - * their project graph is updated - * - If there are pendingProjectUpdates (scheduled to be updated with delay so they can batch update the graph if there are several changes in short time span) - * their project graph is updated - * - If there were project graph updates and/or there was pending inferred project update and/or called forced the inferred project structure refresh - * Inferred projects are created/updated/deleted based on open files states - * @param forceInferredProjectsRefresh when true updates the inferred projects even if there is no pending work to update the files/project structures + * - we go through all the projects and update them if they are dirty + * - if updates reflect some change in structure or there was pending request to ensure projects for open files + * ensure that each open script info has project */ - private ensureProjectStructuresUptoDate(forceInferredProjectsRefresh?: boolean) { - if (this.changedFiles) { - let projectsToUpdate: Project[]; - if (this.changedFiles.length === 1) { - // simpliest case - no allocations - projectsToUpdate = this.changedFiles[0].containingProjects; - } - else { - projectsToUpdate = []; - for (const f of this.changedFiles) { - addRange(projectsToUpdate, f.containingProjects); - } - } - this.changedFiles = undefined; - this.updateProjectGraphs(projectsToUpdate); - } + private ensureProjectStructuresUptoDate() { + let hasChanges = this.pendingEnsureProjectForOpenFiles; + this.pendingProjectUpdates.clear(); + const updateGraph = (project: Project) => { + hasChanges = this.updateProjectIfDirty(project) || hasChanges; + }; - if (this.pendingProjectUpdates.size !== 0) { - const projectsToUpdate = arrayFrom(this.pendingProjectUpdates.values()); - this.pendingProjectUpdates.clear(); - this.updateProjectGraphs(projectsToUpdate); + this.externalProjects.forEach(updateGraph); + this.configuredProjects.forEach(updateGraph); + this.inferredProjects.forEach(updateGraph); + if (hasChanges) { + this.ensureProjectForOpenFiles(); } + } - if (this.pendingInferredProjectUpdate || forceInferredProjectsRefresh) { - this.pendingInferredProjectUpdate = false; - this.refreshInferredProjects(); - } + private updateProjectIfDirty(project: Project) { + return project.dirty && project.updateGraph(); } getFormatCodeOptions(file?: NormalizedPath) { @@ -735,14 +714,6 @@ namespace ts.server { return formatCodeSettings || this.hostConfiguration.formatCodeOptions; } - private updateProjectGraphs(projects: Project[]) { - for (const p of projects) { - if (!p.updateGraph()) { - this.pendingInferredProjectUpdate = true; - } - } - } - private onSourceFileChanged(fileName: NormalizedPath, eventKind: FileWatcherEventKind) { const info = this.getScriptInfoForNormalizedPath(fileName); if (!info) { @@ -770,8 +741,6 @@ namespace ts.server { private handleDeletedFile(info: ScriptInfo) { this.stopWatchingScriptInfo(info); - // TODO: handle isOpen = true case - if (!info.isScriptOpen()) { this.deleteScriptInfo(info); @@ -808,7 +777,7 @@ namespace ts.server { // Reload is pending, do the reload if (project.pendingReload !== ConfigFileProgramReloadLevel.Full) { project.pendingReload = ConfigFileProgramReloadLevel.Partial; - this.delayUpdateProjectGraphAndInferredProjectsRefresh(project); + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); } }, flags, @@ -1317,7 +1286,11 @@ namespace ts.server { this.logger.info("Open files: "); this.openFiles.forEach((projectRootPath, path) => { - this.logger.info(`\tFileName: ${this.getScriptInfoForPath(path as Path).fileName} ProjectRootPath: ${projectRootPath}`); + const info = this.getScriptInfoForPath(path as Path); + this.logger.info(`\tFileName: ${info.fileName} ProjectRootPath: ${projectRootPath}`); + if (writeProjectFileNames) { + this.logger.info(`\t\tProjects: ${info.containingProjects.map(p => p.getProjectName())}`); + } }); this.logger.endGroup(); @@ -1896,7 +1869,7 @@ namespace ts.server { // Reload Projects this.reloadConfiguredProjectForFiles(this.openFiles, /*delayReload*/ false, returnTrue); - this.refreshInferredProjects(); + this.ensureProjectForOpenFiles(); } private delayReloadConfiguredProjectForFiles(configFileExistenceInfo: ConfigFileExistenceInfo, ignoreIfNotRootOfInferredProject: boolean) { @@ -1908,7 +1881,7 @@ namespace ts.server { isRootOfInferredProject => isRootOfInferredProject : // Reload open files if they are root of inferred project returnTrue // Reload all the open files impacted by config file ); - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); } /** @@ -1992,8 +1965,8 @@ namespace ts.server { * This will go through open files and assign them to inferred project if open file is not part of any other project * After that all the inferred project graphs are updated */ - private refreshInferredProjects() { - this.logger.info("refreshInferredProjects: updating project structure from ..."); + private ensureProjectForOpenFiles() { + this.logger.info("Structure before ensureProjectForOpenFiles:"); this.printProjects(); this.openFiles.forEach((projectRootPath, path) => { @@ -2007,12 +1980,10 @@ namespace ts.server { this.removeRootOfInferredProjectIfNowPartOfOtherProject(info); } }); + this.pendingEnsureProjectForOpenFiles = false; + this.inferredProjects.forEach(p => this.updateProjectIfDirty(p)); - for (const p of this.inferredProjects) { - p.updateGraph(); - } - - this.logger.info("refreshInferredProjects: updated project structure ..."); + this.logger.info("Structure after ensureProjectForOpenFiles:"); this.printProjects(); } @@ -2149,11 +2120,6 @@ namespace ts.server { this.closeClientFile(file); } } - // if files were open or closed then explicitly refresh list of inferred projects - // otherwise if there were only changes in files - record changed files in `changedFiles` and defer the update - if (openFiles || closedFiles) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } } /* @internal */ @@ -2163,49 +2129,33 @@ namespace ts.server { const change = changes[i]; scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); } - if (!this.changedFiles) { - this.changedFiles = [scriptInfo]; - } - else if (!contains(this.changedFiles, scriptInfo)) { - this.changedFiles.push(scriptInfo); - } } - private closeConfiguredProjectReferencedFromExternalProject(configFile: NormalizedPath): boolean { + private closeConfiguredProjectReferencedFromExternalProject(configFile: NormalizedPath) { const configuredProject = this.findConfiguredProjectByProjectName(configFile); if (configuredProject) { configuredProject.deleteExternalProjectReference(); if (!configuredProject.hasOpenRef()) { this.removeProject(configuredProject); - return true; + return; } } - return false; } - closeExternalProject(uncheckedFileName: string, suppressRefresh = false): void { + closeExternalProject(uncheckedFileName: string): void { const fileName = toNormalizedPath(uncheckedFileName); const configFiles = this.externalProjectToConfiguredProjectMap.get(fileName); if (configFiles) { - let shouldRefreshInferredProjects = false; for (const configFile of configFiles) { - if (this.closeConfiguredProjectReferencedFromExternalProject(configFile)) { - shouldRefreshInferredProjects = true; - } + this.closeConfiguredProjectReferencedFromExternalProject(configFile); } this.externalProjectToConfiguredProjectMap.delete(fileName); - if (shouldRefreshInferredProjects && !suppressRefresh) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } } else { // close external project const externalProject = this.findExternalProjectByProjectName(uncheckedFileName); if (externalProject) { this.removeProject(externalProject); - if (!suppressRefresh) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } } } } @@ -2218,17 +2168,15 @@ namespace ts.server { }); for (const externalProject of projects) { - this.openExternalProject(externalProject, /*suppressRefreshOfInferredProjects*/ true); + this.openExternalProject(externalProject); // delete project that is present in input list projectsToClose.delete(externalProject.projectFileName); } // close projects that were missing in the input list forEachKey(projectsToClose, externalProjectName => { - this.closeExternalProject(externalProjectName, /*suppressRefresh*/ true); + this.closeExternalProject(externalProjectName); }); - - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); } /** Makes a filename safe to insert in a RegExp */ @@ -2349,7 +2297,7 @@ namespace ts.server { return excludedFiles; } - openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects = false): void { + openExternalProject(proj: protocol.ExternalProject): void { // typingOptions has been deprecated and is only supported for backward compatibility // purposes. It should be removed in future releases - use typeAcquisition instead. if (proj.typingOptions && !proj.typeAcquisition) { @@ -2403,13 +2351,13 @@ namespace ts.server { } // some config files were added to external project (that previously were not there) // close existing project and later we'll open a set of configured projects for these files - this.closeExternalProject(proj.projectFileName, /*suppressRefresh*/ true); + this.closeExternalProject(proj.projectFileName); } else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) { // this project used to include config files if (!tsConfigFiles) { // config files were removed from the project - close existing external project which in turn will close configured projects - this.closeExternalProject(proj.projectFileName, /*suppressRefresh*/ true); + this.closeExternalProject(proj.projectFileName); } else { // project previously had some config files - compare them with new set of files and close all configured projects that correspond to unused files @@ -2459,9 +2407,6 @@ namespace ts.server { this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles); } - if (!suppressRefreshOfInferredProjects) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } } } } diff --git a/src/server/project.ts b/src/server/project.ts index 3094f1b0cb4..dc949b4b221 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -168,6 +168,9 @@ namespace ts.server { */ private projectStateVersion = 0; + /*@internal*/ + dirty = false; + /*@internal*/ hasChangedAutomaticTypeDirectiveNames = false; @@ -250,6 +253,7 @@ namespace ts.server { this.disableLanguageService(lastFileExceededProgramSize); } this.markAsDirty(); + this.projectService.pendingEnsureProjectForOpenFiles = true; } isKnownTypesPackageName(name: string): boolean { @@ -399,7 +403,7 @@ namespace ts.server { /*@internal*/ onInvalidatedResolution() { - this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(this); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); } /*@internal*/ @@ -417,7 +421,7 @@ namespace ts.server { /*@internal*/ onChangedAutomaticTypeDirectiveNames() { this.hasChangedAutomaticTypeDirectiveNames = true; - this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(this); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); } /*@internal*/ @@ -565,6 +569,7 @@ namespace ts.server { for (const root of this.rootFiles) { root.detachFromProject(this); } + this.projectService.pendingEnsureProjectForOpenFiles = true; this.rootFiles = undefined; this.rootFilesMap = undefined; @@ -748,7 +753,10 @@ namespace ts.server { } markAsDirty() { - this.projectStateVersion++; + if (!this.dirty) { + this.projectStateVersion++; + this.dirty = true; + } } /* @internal */ @@ -823,7 +831,9 @@ namespace ts.server { } const cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, this.lastCachedUnresolvedImportsList, hasChanges); - if (this.setTypings(cachedTypings)) { + if (!arrayIsEqualTo(this.typingFiles, cachedTypings)) { + this.typingFiles = cachedTypings; + this.markAsDirty(); hasChanges = this.updateGraphWorker() || hasChanges; } } @@ -847,15 +857,6 @@ namespace ts.server { return include.filter(i => existing.indexOf(i) < 0); } - private setTypings(typings: SortedReadonlyArray): boolean { - if (arrayIsEqualTo(this.typingFiles, typings)) { - return false; - } - this.typingFiles = typings; - this.markAsDirty(); - return true; - } - private updateGraphWorker() { const oldProgram = this.program; Debug.assert(!this.isClosed(), "Called update graph worker of closed project"); @@ -864,6 +865,7 @@ namespace ts.server { this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution(); this.resolutionCache.startCachingPerDirectoryResolution(); this.program = this.languageService.getProgram(); + this.dirty = false; this.resolutionCache.finishCachingPerDirectoryResolution(); // bump up the version if @@ -910,7 +912,7 @@ namespace ts.server { compareStringsCaseSensitive ); const elapsed = timestamp() - start; - this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} structureChanged: ${hasChanges} Elapsed: ${elapsed}ms`); + this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} Version: ${this.getProjectVersion()} structureChanged: ${hasChanges} Elapsed: ${elapsed}ms`); return hasChanges; } @@ -936,7 +938,7 @@ namespace ts.server { fileWatcher.close(); // When a missing file is created, we should update the graph. - this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(this); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); } }, WatchType.MissingFilePath, diff --git a/src/server/session.ts b/src/server/session.ts index 0704bde9e36..356ea0d254e 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1769,7 +1769,7 @@ namespace ts.server { return this.requiredResponse(response); }, [CommandNames.OpenExternalProject]: (request: protocol.OpenExternalProjectRequest) => { - this.projectService.openExternalProject(request.arguments, /*suppressRefreshOfInferredProjects*/ false); + this.projectService.openExternalProject(request.arguments); // TODO: GH#20447 report errors return this.requiredResponse(/*response*/ true); }, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 90a73a823eb..81647a8d080 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7543,7 +7543,6 @@ declare namespace ts.server { */ updateGraph(): boolean; protected removeExistingTypings(include: string[]): string[]; - private setTypings(typings); private updateGraphWorker(); private detachScriptInfoFromProject(uncheckedFileName); private addMissingFileWatcher(missingFilePath); @@ -7779,9 +7778,7 @@ declare namespace ts.server { private readonly hostConfiguration; private safelist; private legacySafelist; - private changedFiles; private pendingProjectUpdates; - private pendingInferredProjectUpdate; readonly currentDirectory: string; readonly toCanonicalFileName: (f: string) => string; readonly host: ServerHost; @@ -7803,7 +7800,7 @@ declare namespace ts.server { toPath(fileName: string): Path; private loadTypesMap(); updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void; - private delayInferredProjectsRefresh(); + private delayEnsureProjectForOpenFiles(); private delayUpdateProjectGraph(project); private sendProjectsUpdatedInBackgroundEvent(); private delayUpdateProjectGraphs(projects); @@ -7814,17 +7811,13 @@ declare namespace ts.server { /** * Ensures the project structures are upto date * This means, - * - if there are changedFiles (the files were updated but their containing project graph was not upto date), - * their project graph is updated - * - If there are pendingProjectUpdates (scheduled to be updated with delay so they can batch update the graph if there are several changes in short time span) - * their project graph is updated - * - If there were project graph updates and/or there was pending inferred project update and/or called forced the inferred project structure refresh - * Inferred projects are created/updated/deleted based on open files states - * @param forceInferredProjectsRefresh when true updates the inferred projects even if there is no pending work to update the files/project structures + * - we go through all the projects and update them if they are dirty + * - if updates reflect some change in structure or there was pending request to ensure projects for open files + * ensure that each open script info has project */ - private ensureProjectStructuresUptoDate(forceInferredProjectsRefresh?); + private ensureProjectStructuresUptoDate(); + private updateProjectIfDirty(project); getFormatCodeOptions(file?: NormalizedPath): FormatCodeSettings; - private updateProjectGraphs(projects); private onSourceFileChanged(fileName, eventKind); private handleDeletedFile(info); private onConfigChangedForConfiguredProject(project, eventKind); @@ -7937,7 +7930,7 @@ declare namespace ts.server { * This will go through open files and assign them to inferred project if open file is not part of any other project * After that all the inferred project graphs are updated */ - private refreshInferredProjects(); + private ensureProjectForOpenFiles(); /** * Open file whose contents is managed by the client * @param filename is absolute pathname @@ -7953,14 +7946,14 @@ declare namespace ts.server { closeClientFile(uncheckedFileName: string): void; private collectChanges(lastKnownProjectVersions, currentProjects, result); private closeConfiguredProjectReferencedFromExternalProject(configFile); - closeExternalProject(uncheckedFileName: string, suppressRefresh?: boolean): void; + closeExternalProject(uncheckedFileName: string): void; openExternalProjects(projects: protocol.ExternalProject[]): void; /** Makes a filename safe to insert in a RegExp */ private static readonly filenameEscapeRegexp; private static escapeFilenameForRegex(filename); resetSafeList(): void; applySafeList(proj: protocol.ExternalProject): NormalizedPath[]; - openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects?: boolean): void; + openExternalProject(proj: protocol.ExternalProject): void; } } From ebdd566c094b3b2da68c2d402f7377024f977dd8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 13 Feb 2018 06:28:52 -0800 Subject: [PATCH 136/298] Accept baseline changes --- tests/baselines/reference/api/tsserverlibrary.d.ts | 10 ++++++---- tests/baselines/reference/api/typescript.d.ts | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 6ef91a9a057..9b49636e623 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -477,6 +477,8 @@ declare namespace ts { type AtToken = Token; type ReadonlyToken = Token; type AwaitKeywordToken = Token; + type PlusToken = Token; + type MinusToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression, Declaration { @@ -766,9 +768,9 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; - readonlyToken?: ReadonlyToken; + readonlyToken?: ReadonlyToken | PlusToken | MinusToken; typeParameter: TypeParameterDeclaration; - questionToken?: QuestionToken; + questionToken?: QuestionToken | PlusToken | MinusToken; type?: TypeNode; } interface LiteralTypeNode extends TypeNode { @@ -3515,8 +3517,8 @@ declare namespace ts { function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index b6877639e5c..b513bb2b7bf 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -477,6 +477,8 @@ declare namespace ts { type AtToken = Token; type ReadonlyToken = Token; type AwaitKeywordToken = Token; + type PlusToken = Token; + type MinusToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression, Declaration { @@ -766,9 +768,9 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; - readonlyToken?: ReadonlyToken; + readonlyToken?: ReadonlyToken | PlusToken | MinusToken; typeParameter: TypeParameterDeclaration; - questionToken?: QuestionToken; + questionToken?: QuestionToken | PlusToken | MinusToken; type?: TypeNode; } interface LiteralTypeNode extends TypeNode { @@ -3462,8 +3464,8 @@ declare namespace ts { function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; From 2cc1d735ec1bb725fce914d101b256108c530ad5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 13 Feb 2018 06:47:52 -0800 Subject: [PATCH 137/298] Add Required to lib.d.ts --- src/lib/es5.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 0f773e78786..bab3bc67d38 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1317,6 +1317,13 @@ type Partial = { [P in keyof T]?: T[P]; }; +/** + * Make all properties in T required + */ +type Required = { + [P in keyof T]-?: T[P]; +}; + /** * Make all properties in T readonly */ From 23162c2638444f3474d3f93529c12aa786303abd Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 13 Feb 2018 06:48:03 -0800 Subject: [PATCH 138/298] Add tests --- .../conformance/types/mapped/mappedTypes6.ts | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 tests/cases/conformance/types/mapped/mappedTypes6.ts diff --git a/tests/cases/conformance/types/mapped/mappedTypes6.ts b/tests/cases/conformance/types/mapped/mappedTypes6.ts new file mode 100644 index 00000000000..b3beef76846 --- /dev/null +++ b/tests/cases/conformance/types/mapped/mappedTypes6.ts @@ -0,0 +1,127 @@ +// @strict: true +// @declaration: true + +type T00 = { [P in keyof T]: T[P] }; +type T01 = { [P in keyof T]?: T[P] }; +type T02 = { [P in keyof T]+?: T[P] }; +type T03 = { [P in keyof T]-?: T[P] }; + +type T04 = { readonly [P in keyof T]: T[P] }; +type T05 = { readonly [P in keyof T]?: T[P] }; +type T06 = { readonly [P in keyof T]+?: T[P] }; +type T07 = { readonly [P in keyof T]-?: T[P] }; + +type T08 = { +readonly [P in keyof T]: T[P] }; +type T09 = { +readonly [P in keyof T]?: T[P] }; +type T10 = { +readonly [P in keyof T]+?: T[P] }; +type T11 = { +readonly [P in keyof T]-?: T[P] }; + +type T12 = { -readonly [P in keyof T]: T[P] }; +type T13 = { -readonly [P in keyof T]?: T[P] }; +type T14 = { -readonly [P in keyof T]+?: T[P] }; +type T15 = { -readonly [P in keyof T]-?: T[P] }; + +function f1(x: Required, y: T, z: Partial) { + x = x; + x = y; // Error + x = z; // Error + y = x; + y = y; + y = z; // Error + z = x; + z = y; + z = z; +} + +type Denullified = { [P in keyof T]-?: NonNullable }; + +function f2(w: Denullified, x: Required, y: T, z: Partial) { + w = w; + w = x; // Error + w = y; // Error + w = z; // Error + x = w; + x = x; + x = y; // Error + x = z; // Error + y = w; + y = x; + y = y; + y = z; // Error + z = w; + z = x; + z = y; + z = z; +} + + +function f3(w: Denullified, x: Required, y: T, z: Partial) { + w = {}; // Error + x = {}; // Error + y = {}; // Error + z = {}; +} + +type Readwrite = { + -readonly [P in keyof T]: T[P]; +} + +function f10(x: Readonly, y: T, z: Readwrite) { + x = x; + x = y; + x = z; + y = x; + y = y; + y = z; + z = x; + z = y; + z = z; +} + +type Foo = { + a: number; + b: number | undefined; + c?: number; + d?: number | undefined; +} + +declare let x1: Foo; + +x1.a; // number +x1.b; // number | undefined +x1.c; // number | undefined +x1.d; // number | undefined + +x1 = { a: 1 }; // Error +x1 = { a: 1, b: 1 }; +x1 = { a: 1, b: 1, c: 1 }; +x1 = { a: 1, b: 1, c: 1, d: 1 }; + +declare let x2: Required; + +x1.a; // number +x1.b; // number | undefined +x1.c; // number +x1.d; // number + +x2 = { a: 1 }; // Error +x2 = { a: 1, b: 1 }; // Error +x2 = { a: 1, b: 1, c: 1 }; // Error +x2 = { a: 1, b: 1, c: 1, d: 1 }; + +type Bar = { + a: number; + readonly b: number; +} + +declare let x3: Bar; +x3.a = 1; +x3.b = 1; // Error + +declare let x4: Readonly; +x4.a = 1; // Error +x4.b = 1; // Error + +declare let x5: Readwrite; +x5.a = 1; +x5.b = 1; From 57fe3473d12e9b562d8d9605c55421ac90481957 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 13 Feb 2018 06:48:21 -0800 Subject: [PATCH 139/298] Accept new baselines --- .../reference/mappedTypes6.errors.txt | 195 ++++++ tests/baselines/reference/mappedTypes6.js | 273 ++++++++ .../baselines/reference/mappedTypes6.symbols | 519 +++++++++++++++ tests/baselines/reference/mappedTypes6.types | 609 ++++++++++++++++++ 4 files changed, 1596 insertions(+) create mode 100644 tests/baselines/reference/mappedTypes6.errors.txt create mode 100644 tests/baselines/reference/mappedTypes6.js create mode 100644 tests/baselines/reference/mappedTypes6.symbols create mode 100644 tests/baselines/reference/mappedTypes6.types diff --git a/tests/baselines/reference/mappedTypes6.errors.txt b/tests/baselines/reference/mappedTypes6.errors.txt new file mode 100644 index 00000000000..843a59eecb5 --- /dev/null +++ b/tests/baselines/reference/mappedTypes6.errors.txt @@ -0,0 +1,195 @@ +tests/cases/conformance/types/mapped/mappedTypes6.ts(23,5): error TS2322: Type 'T' is not assignable to type 'Required'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(24,5): error TS2322: Type 'Partial' is not assignable to type 'Required'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(27,5): error TS2322: Type 'Partial' is not assignable to type 'T'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(37,5): error TS2322: Type 'Required' is not assignable to type 'Denullified'. + Type 'T[P]' is not assignable to type 'NonNullable'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(38,5): error TS2322: Type 'T' is not assignable to type 'Denullified'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(39,5): error TS2322: Type 'Partial' is not assignable to type 'Denullified'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(42,5): error TS2322: Type 'T' is not assignable to type 'Required'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(43,5): error TS2322: Type 'Partial' is not assignable to type 'Required'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(47,5): error TS2322: Type 'Partial' is not assignable to type 'T'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(56,5): error TS2322: Type '{}' is not assignable to type 'Denullified'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(57,5): error TS2322: Type '{}' is not assignable to type 'Required'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(58,5): error TS2322: Type '{}' is not assignable to type 'T'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(92,1): error TS2322: Type '{ a: number; }' is not assignable to type 'Foo'. + Property 'b' is missing in type '{ a: number; }'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(104,1): error TS2322: Type '{ a: number; }' is not assignable to type 'Required'. + Property 'b' is missing in type '{ a: number; }'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(105,1): error TS2322: Type '{ a: number; b: number; }' is not assignable to type 'Required'. + Property 'c' is missing in type '{ a: number; b: number; }'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(106,1): error TS2322: Type '{ a: number; b: number; c: number; }' is not assignable to type 'Required'. + Property 'd' is missing in type '{ a: number; b: number; c: number; }'. +tests/cases/conformance/types/mapped/mappedTypes6.ts(116,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(119,4): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. + + +==== tests/cases/conformance/types/mapped/mappedTypes6.ts (19 errors) ==== + type T00 = { [P in keyof T]: T[P] }; + type T01 = { [P in keyof T]?: T[P] }; + type T02 = { [P in keyof T]+?: T[P] }; + type T03 = { [P in keyof T]-?: T[P] }; + + type T04 = { readonly [P in keyof T]: T[P] }; + type T05 = { readonly [P in keyof T]?: T[P] }; + type T06 = { readonly [P in keyof T]+?: T[P] }; + type T07 = { readonly [P in keyof T]-?: T[P] }; + + type T08 = { +readonly [P in keyof T]: T[P] }; + type T09 = { +readonly [P in keyof T]?: T[P] }; + type T10 = { +readonly [P in keyof T]+?: T[P] }; + type T11 = { +readonly [P in keyof T]-?: T[P] }; + + type T12 = { -readonly [P in keyof T]: T[P] }; + type T13 = { -readonly [P in keyof T]?: T[P] }; + type T14 = { -readonly [P in keyof T]+?: T[P] }; + type T15 = { -readonly [P in keyof T]-?: T[P] }; + + function f1(x: Required, y: T, z: Partial) { + x = x; + x = y; // Error + ~ +!!! error TS2322: Type 'T' is not assignable to type 'Required'. + x = z; // Error + ~ +!!! error TS2322: Type 'Partial' is not assignable to type 'Required'. + y = x; + y = y; + y = z; // Error + ~ +!!! error TS2322: Type 'Partial' is not assignable to type 'T'. + z = x; + z = y; + z = z; + } + + type Denullified = { [P in keyof T]-?: NonNullable }; + + function f2(w: Denullified, x: Required, y: T, z: Partial) { + w = w; + w = x; // Error + ~ +!!! error TS2322: Type 'Required' is not assignable to type 'Denullified'. +!!! error TS2322: Type 'T[P]' is not assignable to type 'NonNullable'. + w = y; // Error + ~ +!!! error TS2322: Type 'T' is not assignable to type 'Denullified'. + w = z; // Error + ~ +!!! error TS2322: Type 'Partial' is not assignable to type 'Denullified'. + x = w; + x = x; + x = y; // Error + ~ +!!! error TS2322: Type 'T' is not assignable to type 'Required'. + x = z; // Error + ~ +!!! error TS2322: Type 'Partial' is not assignable to type 'Required'. + y = w; + y = x; + y = y; + y = z; // Error + ~ +!!! error TS2322: Type 'Partial' is not assignable to type 'T'. + z = w; + z = x; + z = y; + z = z; + } + + + function f3(w: Denullified, x: Required, y: T, z: Partial) { + w = {}; // Error + ~ +!!! error TS2322: Type '{}' is not assignable to type 'Denullified'. + x = {}; // Error + ~ +!!! error TS2322: Type '{}' is not assignable to type 'Required'. + y = {}; // Error + ~ +!!! error TS2322: Type '{}' is not assignable to type 'T'. + z = {}; + } + + type Readwrite = { + -readonly [P in keyof T]: T[P]; + } + + function f10(x: Readonly, y: T, z: Readwrite) { + x = x; + x = y; + x = z; + y = x; + y = y; + y = z; + z = x; + z = y; + z = z; + } + + type Foo = { + a: number; + b: number | undefined; + c?: number; + d?: number | undefined; + } + + declare let x1: Foo; + + x1.a; // number + x1.b; // number | undefined + x1.c; // number | undefined + x1.d; // number | undefined + + x1 = { a: 1 }; // Error + ~~ +!!! error TS2322: Type '{ a: number; }' is not assignable to type 'Foo'. +!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. + x1 = { a: 1, b: 1 }; + x1 = { a: 1, b: 1, c: 1 }; + x1 = { a: 1, b: 1, c: 1, d: 1 }; + + declare let x2: Required; + + x1.a; // number + x1.b; // number | undefined + x1.c; // number + x1.d; // number + + x2 = { a: 1 }; // Error + ~~ +!!! error TS2322: Type '{ a: number; }' is not assignable to type 'Required'. +!!! error TS2322: Property 'b' is missing in type '{ a: number; }'. + x2 = { a: 1, b: 1 }; // Error + ~~ +!!! error TS2322: Type '{ a: number; b: number; }' is not assignable to type 'Required'. +!!! error TS2322: Property 'c' is missing in type '{ a: number; b: number; }'. + x2 = { a: 1, b: 1, c: 1 }; // Error + ~~ +!!! error TS2322: Type '{ a: number; b: number; c: number; }' is not assignable to type 'Required'. +!!! error TS2322: Property 'd' is missing in type '{ a: number; b: number; c: number; }'. + x2 = { a: 1, b: 1, c: 1, d: 1 }; + + type Bar = { + a: number; + readonly b: number; + } + + declare let x3: Bar; + x3.a = 1; + x3.b = 1; // Error + ~ +!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. + + declare let x4: Readonly; + x4.a = 1; // Error + ~ +!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. + x4.b = 1; // Error + ~ +!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. + + declare let x5: Readwrite; + x5.a = 1; + x5.b = 1; + \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypes6.js b/tests/baselines/reference/mappedTypes6.js new file mode 100644 index 00000000000..b24d210eb75 --- /dev/null +++ b/tests/baselines/reference/mappedTypes6.js @@ -0,0 +1,273 @@ +//// [mappedTypes6.ts] +type T00 = { [P in keyof T]: T[P] }; +type T01 = { [P in keyof T]?: T[P] }; +type T02 = { [P in keyof T]+?: T[P] }; +type T03 = { [P in keyof T]-?: T[P] }; + +type T04 = { readonly [P in keyof T]: T[P] }; +type T05 = { readonly [P in keyof T]?: T[P] }; +type T06 = { readonly [P in keyof T]+?: T[P] }; +type T07 = { readonly [P in keyof T]-?: T[P] }; + +type T08 = { +readonly [P in keyof T]: T[P] }; +type T09 = { +readonly [P in keyof T]?: T[P] }; +type T10 = { +readonly [P in keyof T]+?: T[P] }; +type T11 = { +readonly [P in keyof T]-?: T[P] }; + +type T12 = { -readonly [P in keyof T]: T[P] }; +type T13 = { -readonly [P in keyof T]?: T[P] }; +type T14 = { -readonly [P in keyof T]+?: T[P] }; +type T15 = { -readonly [P in keyof T]-?: T[P] }; + +function f1(x: Required, y: T, z: Partial) { + x = x; + x = y; // Error + x = z; // Error + y = x; + y = y; + y = z; // Error + z = x; + z = y; + z = z; +} + +type Denullified = { [P in keyof T]-?: NonNullable }; + +function f2(w: Denullified, x: Required, y: T, z: Partial) { + w = w; + w = x; // Error + w = y; // Error + w = z; // Error + x = w; + x = x; + x = y; // Error + x = z; // Error + y = w; + y = x; + y = y; + y = z; // Error + z = w; + z = x; + z = y; + z = z; +} + + +function f3(w: Denullified, x: Required, y: T, z: Partial) { + w = {}; // Error + x = {}; // Error + y = {}; // Error + z = {}; +} + +type Readwrite = { + -readonly [P in keyof T]: T[P]; +} + +function f10(x: Readonly, y: T, z: Readwrite) { + x = x; + x = y; + x = z; + y = x; + y = y; + y = z; + z = x; + z = y; + z = z; +} + +type Foo = { + a: number; + b: number | undefined; + c?: number; + d?: number | undefined; +} + +declare let x1: Foo; + +x1.a; // number +x1.b; // number | undefined +x1.c; // number | undefined +x1.d; // number | undefined + +x1 = { a: 1 }; // Error +x1 = { a: 1, b: 1 }; +x1 = { a: 1, b: 1, c: 1 }; +x1 = { a: 1, b: 1, c: 1, d: 1 }; + +declare let x2: Required; + +x1.a; // number +x1.b; // number | undefined +x1.c; // number +x1.d; // number + +x2 = { a: 1 }; // Error +x2 = { a: 1, b: 1 }; // Error +x2 = { a: 1, b: 1, c: 1 }; // Error +x2 = { a: 1, b: 1, c: 1, d: 1 }; + +type Bar = { + a: number; + readonly b: number; +} + +declare let x3: Bar; +x3.a = 1; +x3.b = 1; // Error + +declare let x4: Readonly; +x4.a = 1; // Error +x4.b = 1; // Error + +declare let x5: Readwrite; +x5.a = 1; +x5.b = 1; + + +//// [mappedTypes6.js] +"use strict"; +function f1(x, y, z) { + x = x; + x = y; // Error + x = z; // Error + y = x; + y = y; + y = z; // Error + z = x; + z = y; + z = z; +} +function f2(w, x, y, z) { + w = w; + w = x; // Error + w = y; // Error + w = z; // Error + x = w; + x = x; + x = y; // Error + x = z; // Error + y = w; + y = x; + y = y; + y = z; // Error + z = w; + z = x; + z = y; + z = z; +} +function f3(w, x, y, z) { + w = {}; // Error + x = {}; // Error + y = {}; // Error + z = {}; +} +function f10(x, y, z) { + x = x; + x = y; + x = z; + y = x; + y = y; + y = z; + z = x; + z = y; + z = z; +} +x1.a; // number +x1.b; // number | undefined +x1.c; // number | undefined +x1.d; // number | undefined +x1 = { a: 1 }; // Error +x1 = { a: 1, b: 1 }; +x1 = { a: 1, b: 1, c: 1 }; +x1 = { a: 1, b: 1, c: 1, d: 1 }; +x1.a; // number +x1.b; // number | undefined +x1.c; // number +x1.d; // number +x2 = { a: 1 }; // Error +x2 = { a: 1, b: 1 }; // Error +x2 = { a: 1, b: 1, c: 1 }; // Error +x2 = { a: 1, b: 1, c: 1, d: 1 }; +x3.a = 1; +x3.b = 1; // Error +x4.a = 1; // Error +x4.b = 1; // Error +x5.a = 1; +x5.b = 1; + + +//// [mappedTypes6.d.ts] +declare type T00 = { + [P in keyof T]: T[P]; +}; +declare type T01 = { + [P in keyof T]?: T[P]; +}; +declare type T02 = { + [P in keyof T]+?: T[P]; +}; +declare type T03 = { + [P in keyof T]-?: T[P]; +}; +declare type T04 = { + readonly [P in keyof T]: T[P]; +}; +declare type T05 = { + readonly [P in keyof T]?: T[P]; +}; +declare type T06 = { + readonly [P in keyof T]+?: T[P]; +}; +declare type T07 = { + readonly [P in keyof T]-?: T[P]; +}; +declare type T08 = { + +readonly [P in keyof T]: T[P]; +}; +declare type T09 = { + +readonly [P in keyof T]?: T[P]; +}; +declare type T10 = { + +readonly [P in keyof T]+?: T[P]; +}; +declare type T11 = { + +readonly [P in keyof T]-?: T[P]; +}; +declare type T12 = { + -readonly [P in keyof T]: T[P]; +}; +declare type T13 = { + -readonly [P in keyof T]?: T[P]; +}; +declare type T14 = { + -readonly [P in keyof T]+?: T[P]; +}; +declare type T15 = { + -readonly [P in keyof T]-?: T[P]; +}; +declare function f1(x: Required, y: T, z: Partial): void; +declare type Denullified = { + [P in keyof T]-?: NonNullable; +}; +declare function f2(w: Denullified, x: Required, y: T, z: Partial): void; +declare function f3(w: Denullified, x: Required, y: T, z: Partial): void; +declare type Readwrite = { + -readonly [P in keyof T]: T[P]; +}; +declare function f10(x: Readonly, y: T, z: Readwrite): void; +declare type Foo = { + a: number; + b: number | undefined; + c?: number; + d?: number | undefined; +}; +declare let x1: Foo; +declare let x2: Required; +declare type Bar = { + a: number; + readonly b: number; +}; +declare let x3: Bar; +declare let x4: Readonly; +declare let x5: Readwrite; diff --git a/tests/baselines/reference/mappedTypes6.symbols b/tests/baselines/reference/mappedTypes6.symbols new file mode 100644 index 00000000000..7cebcda184e --- /dev/null +++ b/tests/baselines/reference/mappedTypes6.symbols @@ -0,0 +1,519 @@ +=== tests/cases/conformance/types/mapped/mappedTypes6.ts === +type T00 = { [P in keyof T]: T[P] }; +>T00 : Symbol(T00, Decl(mappedTypes6.ts, 0, 0)) +>T : Symbol(T, Decl(mappedTypes6.ts, 0, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 0, 17)) +>T : Symbol(T, Decl(mappedTypes6.ts, 0, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 0, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 0, 17)) + +type T01 = { [P in keyof T]?: T[P] }; +>T01 : Symbol(T01, Decl(mappedTypes6.ts, 0, 39)) +>T : Symbol(T, Decl(mappedTypes6.ts, 1, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 1, 17)) +>T : Symbol(T, Decl(mappedTypes6.ts, 1, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 1, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 1, 17)) + +type T02 = { [P in keyof T]+?: T[P] }; +>T02 : Symbol(T02, Decl(mappedTypes6.ts, 1, 40)) +>T : Symbol(T, Decl(mappedTypes6.ts, 2, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 2, 17)) +>T : Symbol(T, Decl(mappedTypes6.ts, 2, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 2, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 2, 17)) + +type T03 = { [P in keyof T]-?: T[P] }; +>T03 : Symbol(T03, Decl(mappedTypes6.ts, 2, 41)) +>T : Symbol(T, Decl(mappedTypes6.ts, 3, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 3, 17)) +>T : Symbol(T, Decl(mappedTypes6.ts, 3, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 3, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 3, 17)) + +type T04 = { readonly [P in keyof T]: T[P] }; +>T04 : Symbol(T04, Decl(mappedTypes6.ts, 3, 41)) +>T : Symbol(T, Decl(mappedTypes6.ts, 5, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 5, 26)) +>T : Symbol(T, Decl(mappedTypes6.ts, 5, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 5, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 5, 26)) + +type T05 = { readonly [P in keyof T]?: T[P] }; +>T05 : Symbol(T05, Decl(mappedTypes6.ts, 5, 48)) +>T : Symbol(T, Decl(mappedTypes6.ts, 6, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 6, 26)) +>T : Symbol(T, Decl(mappedTypes6.ts, 6, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 6, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 6, 26)) + +type T06 = { readonly [P in keyof T]+?: T[P] }; +>T06 : Symbol(T06, Decl(mappedTypes6.ts, 6, 49)) +>T : Symbol(T, Decl(mappedTypes6.ts, 7, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 7, 26)) +>T : Symbol(T, Decl(mappedTypes6.ts, 7, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 7, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 7, 26)) + +type T07 = { readonly [P in keyof T]-?: T[P] }; +>T07 : Symbol(T07, Decl(mappedTypes6.ts, 7, 50)) +>T : Symbol(T, Decl(mappedTypes6.ts, 8, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 8, 26)) +>T : Symbol(T, Decl(mappedTypes6.ts, 8, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 8, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 8, 26)) + +type T08 = { +readonly [P in keyof T]: T[P] }; +>T08 : Symbol(T08, Decl(mappedTypes6.ts, 8, 50)) +>T : Symbol(T, Decl(mappedTypes6.ts, 10, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 10, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 10, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 10, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 10, 27)) + +type T09 = { +readonly [P in keyof T]?: T[P] }; +>T09 : Symbol(T09, Decl(mappedTypes6.ts, 10, 49)) +>T : Symbol(T, Decl(mappedTypes6.ts, 11, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 11, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 11, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 11, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 11, 27)) + +type T10 = { +readonly [P in keyof T]+?: T[P] }; +>T10 : Symbol(T10, Decl(mappedTypes6.ts, 11, 50)) +>T : Symbol(T, Decl(mappedTypes6.ts, 12, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 12, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 12, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 12, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 12, 27)) + +type T11 = { +readonly [P in keyof T]-?: T[P] }; +>T11 : Symbol(T11, Decl(mappedTypes6.ts, 12, 51)) +>T : Symbol(T, Decl(mappedTypes6.ts, 13, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 13, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 13, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 13, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 13, 27)) + +type T12 = { -readonly [P in keyof T]: T[P] }; +>T12 : Symbol(T12, Decl(mappedTypes6.ts, 13, 51)) +>T : Symbol(T, Decl(mappedTypes6.ts, 15, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 15, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 15, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 15, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 15, 27)) + +type T13 = { -readonly [P in keyof T]?: T[P] }; +>T13 : Symbol(T13, Decl(mappedTypes6.ts, 15, 49)) +>T : Symbol(T, Decl(mappedTypes6.ts, 16, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 16, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 16, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 16, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 16, 27)) + +type T14 = { -readonly [P in keyof T]+?: T[P] }; +>T14 : Symbol(T14, Decl(mappedTypes6.ts, 16, 50)) +>T : Symbol(T, Decl(mappedTypes6.ts, 17, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 17, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 17, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 17, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 17, 27)) + +type T15 = { -readonly [P in keyof T]-?: T[P] }; +>T15 : Symbol(T15, Decl(mappedTypes6.ts, 17, 51)) +>T : Symbol(T, Decl(mappedTypes6.ts, 18, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 18, 27)) +>T : Symbol(T, Decl(mappedTypes6.ts, 18, 9)) +>T : Symbol(T, Decl(mappedTypes6.ts, 18, 9)) +>P : Symbol(P, Decl(mappedTypes6.ts, 18, 27)) + +function f1(x: Required, y: T, z: Partial) { +>f1 : Symbol(f1, Decl(mappedTypes6.ts, 18, 51)) +>T : Symbol(T, Decl(mappedTypes6.ts, 20, 12)) +>x : Symbol(x, Decl(mappedTypes6.ts, 20, 15)) +>Required : Symbol(Required, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 20, 12)) +>y : Symbol(y, Decl(mappedTypes6.ts, 20, 30)) +>T : Symbol(T, Decl(mappedTypes6.ts, 20, 12)) +>z : Symbol(z, Decl(mappedTypes6.ts, 20, 36)) +>Partial : Symbol(Partial, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 20, 12)) + + x = x; +>x : Symbol(x, Decl(mappedTypes6.ts, 20, 15)) +>x : Symbol(x, Decl(mappedTypes6.ts, 20, 15)) + + x = y; // Error +>x : Symbol(x, Decl(mappedTypes6.ts, 20, 15)) +>y : Symbol(y, Decl(mappedTypes6.ts, 20, 30)) + + x = z; // Error +>x : Symbol(x, Decl(mappedTypes6.ts, 20, 15)) +>z : Symbol(z, Decl(mappedTypes6.ts, 20, 36)) + + y = x; +>y : Symbol(y, Decl(mappedTypes6.ts, 20, 30)) +>x : Symbol(x, Decl(mappedTypes6.ts, 20, 15)) + + y = y; +>y : Symbol(y, Decl(mappedTypes6.ts, 20, 30)) +>y : Symbol(y, Decl(mappedTypes6.ts, 20, 30)) + + y = z; // Error +>y : Symbol(y, Decl(mappedTypes6.ts, 20, 30)) +>z : Symbol(z, Decl(mappedTypes6.ts, 20, 36)) + + z = x; +>z : Symbol(z, Decl(mappedTypes6.ts, 20, 36)) +>x : Symbol(x, Decl(mappedTypes6.ts, 20, 15)) + + z = y; +>z : Symbol(z, Decl(mappedTypes6.ts, 20, 36)) +>y : Symbol(y, Decl(mappedTypes6.ts, 20, 30)) + + z = z; +>z : Symbol(z, Decl(mappedTypes6.ts, 20, 36)) +>z : Symbol(z, Decl(mappedTypes6.ts, 20, 36)) +} + +type Denullified = { [P in keyof T]-?: NonNullable }; +>Denullified : Symbol(Denullified, Decl(mappedTypes6.ts, 30, 1)) +>T : Symbol(T, Decl(mappedTypes6.ts, 32, 17)) +>P : Symbol(P, Decl(mappedTypes6.ts, 32, 25)) +>T : Symbol(T, Decl(mappedTypes6.ts, 32, 17)) +>NonNullable : Symbol(NonNullable, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 32, 17)) +>P : Symbol(P, Decl(mappedTypes6.ts, 32, 25)) + +function f2(w: Denullified, x: Required, y: T, z: Partial) { +>f2 : Symbol(f2, Decl(mappedTypes6.ts, 32, 62)) +>T : Symbol(T, Decl(mappedTypes6.ts, 34, 12)) +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) +>Denullified : Symbol(Denullified, Decl(mappedTypes6.ts, 30, 1)) +>T : Symbol(T, Decl(mappedTypes6.ts, 34, 12)) +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) +>Required : Symbol(Required, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 34, 12)) +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) +>T : Symbol(T, Decl(mappedTypes6.ts, 34, 12)) +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) +>Partial : Symbol(Partial, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 34, 12)) + + w = w; +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) + + w = x; // Error +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) + + w = y; // Error +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) + + w = z; // Error +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) + + x = w; +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) + + x = x; +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) + + x = y; // Error +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) + + x = z; // Error +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) + + y = w; +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) + + y = x; +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) + + y = y; +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) + + y = z; // Error +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) + + z = w; +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) +>w : Symbol(w, Decl(mappedTypes6.ts, 34, 15)) + + z = x; +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) +>x : Symbol(x, Decl(mappedTypes6.ts, 34, 33)) + + z = y; +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) +>y : Symbol(y, Decl(mappedTypes6.ts, 34, 49)) + + z = z; +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) +>z : Symbol(z, Decl(mappedTypes6.ts, 34, 55)) +} + + +function f3(w: Denullified, x: Required, y: T, z: Partial) { +>f3 : Symbol(f3, Decl(mappedTypes6.ts, 51, 1)) +>T : Symbol(T, Decl(mappedTypes6.ts, 54, 12)) +>w : Symbol(w, Decl(mappedTypes6.ts, 54, 15)) +>Denullified : Symbol(Denullified, Decl(mappedTypes6.ts, 30, 1)) +>T : Symbol(T, Decl(mappedTypes6.ts, 54, 12)) +>x : Symbol(x, Decl(mappedTypes6.ts, 54, 33)) +>Required : Symbol(Required, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 54, 12)) +>y : Symbol(y, Decl(mappedTypes6.ts, 54, 49)) +>T : Symbol(T, Decl(mappedTypes6.ts, 54, 12)) +>z : Symbol(z, Decl(mappedTypes6.ts, 54, 55)) +>Partial : Symbol(Partial, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 54, 12)) + + w = {}; // Error +>w : Symbol(w, Decl(mappedTypes6.ts, 54, 15)) + + x = {}; // Error +>x : Symbol(x, Decl(mappedTypes6.ts, 54, 33)) + + y = {}; // Error +>y : Symbol(y, Decl(mappedTypes6.ts, 54, 49)) + + z = {}; +>z : Symbol(z, Decl(mappedTypes6.ts, 54, 55)) +} + +type Readwrite = { +>Readwrite : Symbol(Readwrite, Decl(mappedTypes6.ts, 59, 1)) +>T : Symbol(T, Decl(mappedTypes6.ts, 61, 15)) + + -readonly [P in keyof T]: T[P]; +>P : Symbol(P, Decl(mappedTypes6.ts, 62, 15)) +>T : Symbol(T, Decl(mappedTypes6.ts, 61, 15)) +>T : Symbol(T, Decl(mappedTypes6.ts, 61, 15)) +>P : Symbol(P, Decl(mappedTypes6.ts, 62, 15)) +} + +function f10(x: Readonly, y: T, z: Readwrite) { +>f10 : Symbol(f10, Decl(mappedTypes6.ts, 63, 1)) +>T : Symbol(T, Decl(mappedTypes6.ts, 65, 13)) +>x : Symbol(x, Decl(mappedTypes6.ts, 65, 16)) +>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(mappedTypes6.ts, 65, 13)) +>y : Symbol(y, Decl(mappedTypes6.ts, 65, 31)) +>T : Symbol(T, Decl(mappedTypes6.ts, 65, 13)) +>z : Symbol(z, Decl(mappedTypes6.ts, 65, 37)) +>Readwrite : Symbol(Readwrite, Decl(mappedTypes6.ts, 59, 1)) +>T : Symbol(T, Decl(mappedTypes6.ts, 65, 13)) + + x = x; +>x : Symbol(x, Decl(mappedTypes6.ts, 65, 16)) +>x : Symbol(x, Decl(mappedTypes6.ts, 65, 16)) + + x = y; +>x : Symbol(x, Decl(mappedTypes6.ts, 65, 16)) +>y : Symbol(y, Decl(mappedTypes6.ts, 65, 31)) + + x = z; +>x : Symbol(x, Decl(mappedTypes6.ts, 65, 16)) +>z : Symbol(z, Decl(mappedTypes6.ts, 65, 37)) + + y = x; +>y : Symbol(y, Decl(mappedTypes6.ts, 65, 31)) +>x : Symbol(x, Decl(mappedTypes6.ts, 65, 16)) + + y = y; +>y : Symbol(y, Decl(mappedTypes6.ts, 65, 31)) +>y : Symbol(y, Decl(mappedTypes6.ts, 65, 31)) + + y = z; +>y : Symbol(y, Decl(mappedTypes6.ts, 65, 31)) +>z : Symbol(z, Decl(mappedTypes6.ts, 65, 37)) + + z = x; +>z : Symbol(z, Decl(mappedTypes6.ts, 65, 37)) +>x : Symbol(x, Decl(mappedTypes6.ts, 65, 16)) + + z = y; +>z : Symbol(z, Decl(mappedTypes6.ts, 65, 37)) +>y : Symbol(y, Decl(mappedTypes6.ts, 65, 31)) + + z = z; +>z : Symbol(z, Decl(mappedTypes6.ts, 65, 37)) +>z : Symbol(z, Decl(mappedTypes6.ts, 65, 37)) +} + +type Foo = { +>Foo : Symbol(Foo, Decl(mappedTypes6.ts, 75, 1)) + + a: number; +>a : Symbol(a, Decl(mappedTypes6.ts, 77, 12)) + + b: number | undefined; +>b : Symbol(b, Decl(mappedTypes6.ts, 78, 14)) + + c?: number; +>c : Symbol(c, Decl(mappedTypes6.ts, 79, 26)) + + d?: number | undefined; +>d : Symbol(d, Decl(mappedTypes6.ts, 80, 15)) +} + +declare let x1: Foo; +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>Foo : Symbol(Foo, Decl(mappedTypes6.ts, 75, 1)) + +x1.a; // number +>x1.a : Symbol(a, Decl(mappedTypes6.ts, 77, 12)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 77, 12)) + +x1.b; // number | undefined +>x1.b : Symbol(b, Decl(mappedTypes6.ts, 78, 14)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>b : Symbol(b, Decl(mappedTypes6.ts, 78, 14)) + +x1.c; // number | undefined +>x1.c : Symbol(c, Decl(mappedTypes6.ts, 79, 26)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>c : Symbol(c, Decl(mappedTypes6.ts, 79, 26)) + +x1.d; // number | undefined +>x1.d : Symbol(d, Decl(mappedTypes6.ts, 80, 15)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>d : Symbol(d, Decl(mappedTypes6.ts, 80, 15)) + +x1 = { a: 1 }; // Error +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 91, 6)) + +x1 = { a: 1, b: 1 }; +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 92, 6)) +>b : Symbol(b, Decl(mappedTypes6.ts, 92, 12)) + +x1 = { a: 1, b: 1, c: 1 }; +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 93, 6)) +>b : Symbol(b, Decl(mappedTypes6.ts, 93, 12)) +>c : Symbol(c, Decl(mappedTypes6.ts, 93, 18)) + +x1 = { a: 1, b: 1, c: 1, d: 1 }; +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 94, 6)) +>b : Symbol(b, Decl(mappedTypes6.ts, 94, 12)) +>c : Symbol(c, Decl(mappedTypes6.ts, 94, 18)) +>d : Symbol(d, Decl(mappedTypes6.ts, 94, 24)) + +declare let x2: Required; +>x2 : Symbol(x2, Decl(mappedTypes6.ts, 96, 11)) +>Required : Symbol(Required, Decl(lib.d.ts, --, --)) +>Foo : Symbol(Foo, Decl(mappedTypes6.ts, 75, 1)) + +x1.a; // number +>x1.a : Symbol(a, Decl(mappedTypes6.ts, 77, 12)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 77, 12)) + +x1.b; // number | undefined +>x1.b : Symbol(b, Decl(mappedTypes6.ts, 78, 14)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>b : Symbol(b, Decl(mappedTypes6.ts, 78, 14)) + +x1.c; // number +>x1.c : Symbol(c, Decl(mappedTypes6.ts, 79, 26)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>c : Symbol(c, Decl(mappedTypes6.ts, 79, 26)) + +x1.d; // number +>x1.d : Symbol(d, Decl(mappedTypes6.ts, 80, 15)) +>x1 : Symbol(x1, Decl(mappedTypes6.ts, 84, 11)) +>d : Symbol(d, Decl(mappedTypes6.ts, 80, 15)) + +x2 = { a: 1 }; // Error +>x2 : Symbol(x2, Decl(mappedTypes6.ts, 96, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 103, 6)) + +x2 = { a: 1, b: 1 }; // Error +>x2 : Symbol(x2, Decl(mappedTypes6.ts, 96, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 104, 6)) +>b : Symbol(b, Decl(mappedTypes6.ts, 104, 12)) + +x2 = { a: 1, b: 1, c: 1 }; // Error +>x2 : Symbol(x2, Decl(mappedTypes6.ts, 96, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 105, 6)) +>b : Symbol(b, Decl(mappedTypes6.ts, 105, 12)) +>c : Symbol(c, Decl(mappedTypes6.ts, 105, 18)) + +x2 = { a: 1, b: 1, c: 1, d: 1 }; +>x2 : Symbol(x2, Decl(mappedTypes6.ts, 96, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 106, 6)) +>b : Symbol(b, Decl(mappedTypes6.ts, 106, 12)) +>c : Symbol(c, Decl(mappedTypes6.ts, 106, 18)) +>d : Symbol(d, Decl(mappedTypes6.ts, 106, 24)) + +type Bar = { +>Bar : Symbol(Bar, Decl(mappedTypes6.ts, 106, 32)) + + a: number; +>a : Symbol(a, Decl(mappedTypes6.ts, 108, 12)) + + readonly b: number; +>b : Symbol(b, Decl(mappedTypes6.ts, 109, 14)) +} + +declare let x3: Bar; +>x3 : Symbol(x3, Decl(mappedTypes6.ts, 113, 11)) +>Bar : Symbol(Bar, Decl(mappedTypes6.ts, 106, 32)) + +x3.a = 1; +>x3.a : Symbol(a, Decl(mappedTypes6.ts, 108, 12)) +>x3 : Symbol(x3, Decl(mappedTypes6.ts, 113, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 108, 12)) + +x3.b = 1; // Error +>x3.b : Symbol(b, Decl(mappedTypes6.ts, 109, 14)) +>x3 : Symbol(x3, Decl(mappedTypes6.ts, 113, 11)) +>b : Symbol(b, Decl(mappedTypes6.ts, 109, 14)) + +declare let x4: Readonly; +>x4 : Symbol(x4, Decl(mappedTypes6.ts, 117, 11)) +>Readonly : Symbol(Readonly, Decl(lib.d.ts, --, --)) +>Bar : Symbol(Bar, Decl(mappedTypes6.ts, 106, 32)) + +x4.a = 1; // Error +>x4.a : Symbol(a, Decl(mappedTypes6.ts, 108, 12)) +>x4 : Symbol(x4, Decl(mappedTypes6.ts, 117, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 108, 12)) + +x4.b = 1; // Error +>x4.b : Symbol(b, Decl(mappedTypes6.ts, 109, 14)) +>x4 : Symbol(x4, Decl(mappedTypes6.ts, 117, 11)) +>b : Symbol(b, Decl(mappedTypes6.ts, 109, 14)) + +declare let x5: Readwrite; +>x5 : Symbol(x5, Decl(mappedTypes6.ts, 121, 11)) +>Readwrite : Symbol(Readwrite, Decl(mappedTypes6.ts, 59, 1)) +>Bar : Symbol(Bar, Decl(mappedTypes6.ts, 106, 32)) + +x5.a = 1; +>x5.a : Symbol(a, Decl(mappedTypes6.ts, 108, 12)) +>x5 : Symbol(x5, Decl(mappedTypes6.ts, 121, 11)) +>a : Symbol(a, Decl(mappedTypes6.ts, 108, 12)) + +x5.b = 1; +>x5.b : Symbol(b, Decl(mappedTypes6.ts, 109, 14)) +>x5 : Symbol(x5, Decl(mappedTypes6.ts, 121, 11)) +>b : Symbol(b, Decl(mappedTypes6.ts, 109, 14)) + diff --git a/tests/baselines/reference/mappedTypes6.types b/tests/baselines/reference/mappedTypes6.types new file mode 100644 index 00000000000..5b554d53fe7 --- /dev/null +++ b/tests/baselines/reference/mappedTypes6.types @@ -0,0 +1,609 @@ +=== tests/cases/conformance/types/mapped/mappedTypes6.ts === +type T00 = { [P in keyof T]: T[P] }; +>T00 : T00 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T01 = { [P in keyof T]?: T[P] }; +>T01 : T01 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T02 = { [P in keyof T]+?: T[P] }; +>T02 : T02 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T03 = { [P in keyof T]-?: T[P] }; +>T03 : T03 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T04 = { readonly [P in keyof T]: T[P] }; +>T04 : T04 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T05 = { readonly [P in keyof T]?: T[P] }; +>T05 : T05 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T06 = { readonly [P in keyof T]+?: T[P] }; +>T06 : T06 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T07 = { readonly [P in keyof T]-?: T[P] }; +>T07 : T07 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T08 = { +readonly [P in keyof T]: T[P] }; +>T08 : T08 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T09 = { +readonly [P in keyof T]?: T[P] }; +>T09 : T09 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T10 = { +readonly [P in keyof T]+?: T[P] }; +>T10 : T10 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T11 = { +readonly [P in keyof T]-?: T[P] }; +>T11 : T11 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T12 = { -readonly [P in keyof T]: T[P] }; +>T12 : T12 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T13 = { -readonly [P in keyof T]?: T[P] }; +>T13 : T13 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T14 = { -readonly [P in keyof T]+?: T[P] }; +>T14 : T14 +>T : T +>P : P +>T : T +>T : T +>P : P + +type T15 = { -readonly [P in keyof T]-?: T[P] }; +>T15 : T15 +>T : T +>P : P +>T : T +>T : T +>P : P + +function f1(x: Required, y: T, z: Partial) { +>f1 : (x: Required, y: T, z: Partial) => void +>T : T +>x : Required +>Required : Required +>T : T +>y : T +>T : T +>z : Partial +>Partial : Partial +>T : T + + x = x; +>x = x : Required +>x : Required +>x : Required + + x = y; // Error +>x = y : T +>x : Required +>y : T + + x = z; // Error +>x = z : Partial +>x : Required +>z : Partial + + y = x; +>y = x : Required +>y : T +>x : Required + + y = y; +>y = y : T +>y : T +>y : T + + y = z; // Error +>y = z : Partial +>y : T +>z : Partial + + z = x; +>z = x : Required +>z : Partial +>x : Required + + z = y; +>z = y : T +>z : Partial +>y : T + + z = z; +>z = z : Partial +>z : Partial +>z : Partial +} + +type Denullified = { [P in keyof T]-?: NonNullable }; +>Denullified : Denullified +>T : T +>P : P +>T : T +>NonNullable : NonNullable +>T : T +>P : P + +function f2(w: Denullified, x: Required, y: T, z: Partial) { +>f2 : (w: Denullified, x: Required, y: T, z: Partial) => void +>T : T +>w : Denullified +>Denullified : Denullified +>T : T +>x : Required +>Required : Required +>T : T +>y : T +>T : T +>z : Partial +>Partial : Partial +>T : T + + w = w; +>w = w : Denullified +>w : Denullified +>w : Denullified + + w = x; // Error +>w = x : Required +>w : Denullified +>x : Required + + w = y; // Error +>w = y : T +>w : Denullified +>y : T + + w = z; // Error +>w = z : Partial +>w : Denullified +>z : Partial + + x = w; +>x = w : Denullified +>x : Required +>w : Denullified + + x = x; +>x = x : Required +>x : Required +>x : Required + + x = y; // Error +>x = y : T +>x : Required +>y : T + + x = z; // Error +>x = z : Partial +>x : Required +>z : Partial + + y = w; +>y = w : Denullified +>y : T +>w : Denullified + + y = x; +>y = x : Required +>y : T +>x : Required + + y = y; +>y = y : T +>y : T +>y : T + + y = z; // Error +>y = z : Partial +>y : T +>z : Partial + + z = w; +>z = w : Denullified +>z : Partial +>w : Denullified + + z = x; +>z = x : Required +>z : Partial +>x : Required + + z = y; +>z = y : T +>z : Partial +>y : T + + z = z; +>z = z : Partial +>z : Partial +>z : Partial +} + + +function f3(w: Denullified, x: Required, y: T, z: Partial) { +>f3 : (w: Denullified, x: Required, y: T, z: Partial) => void +>T : T +>w : Denullified +>Denullified : Denullified +>T : T +>x : Required +>Required : Required +>T : T +>y : T +>T : T +>z : Partial +>Partial : Partial +>T : T + + w = {}; // Error +>w = {} : {} +>w : Denullified +>{} : {} + + x = {}; // Error +>x = {} : {} +>x : Required +>{} : {} + + y = {}; // Error +>y = {} : {} +>y : T +>{} : {} + + z = {}; +>z = {} : {} +>z : Partial +>{} : {} +} + +type Readwrite = { +>Readwrite : Readwrite +>T : T + + -readonly [P in keyof T]: T[P]; +>P : P +>T : T +>T : T +>P : P +} + +function f10(x: Readonly, y: T, z: Readwrite) { +>f10 : (x: Readonly, y: T, z: Readwrite) => void +>T : T +>x : Readonly +>Readonly : Readonly +>T : T +>y : T +>T : T +>z : Readwrite +>Readwrite : Readwrite +>T : T + + x = x; +>x = x : Readonly +>x : Readonly +>x : Readonly + + x = y; +>x = y : T +>x : Readonly +>y : T + + x = z; +>x = z : Readwrite +>x : Readonly +>z : Readwrite + + y = x; +>y = x : Readonly +>y : T +>x : Readonly + + y = y; +>y = y : T +>y : T +>y : T + + y = z; +>y = z : Readwrite +>y : T +>z : Readwrite + + z = x; +>z = x : Readonly +>z : Readwrite +>x : Readonly + + z = y; +>z = y : T +>z : Readwrite +>y : T + + z = z; +>z = z : Readwrite +>z : Readwrite +>z : Readwrite +} + +type Foo = { +>Foo : Foo + + a: number; +>a : number + + b: number | undefined; +>b : number | undefined + + c?: number; +>c : number | undefined + + d?: number | undefined; +>d : number | undefined +} + +declare let x1: Foo; +>x1 : Foo +>Foo : Foo + +x1.a; // number +>x1.a : number +>x1 : Foo +>a : number + +x1.b; // number | undefined +>x1.b : number | undefined +>x1 : Foo +>b : number | undefined + +x1.c; // number | undefined +>x1.c : number | undefined +>x1 : Foo +>c : number | undefined + +x1.d; // number | undefined +>x1.d : number | undefined +>x1 : Foo +>d : number | undefined + +x1 = { a: 1 }; // Error +>x1 = { a: 1 } : { a: number; } +>x1 : Foo +>{ a: 1 } : { a: number; } +>a : number +>1 : 1 + +x1 = { a: 1, b: 1 }; +>x1 = { a: 1, b: 1 } : { a: number; b: number; } +>x1 : Foo +>{ a: 1, b: 1 } : { a: number; b: number; } +>a : number +>1 : 1 +>b : number +>1 : 1 + +x1 = { a: 1, b: 1, c: 1 }; +>x1 = { a: 1, b: 1, c: 1 } : { a: number; b: number; c: number; } +>x1 : Foo +>{ a: 1, b: 1, c: 1 } : { a: number; b: number; c: number; } +>a : number +>1 : 1 +>b : number +>1 : 1 +>c : number +>1 : 1 + +x1 = { a: 1, b: 1, c: 1, d: 1 }; +>x1 = { a: 1, b: 1, c: 1, d: 1 } : { a: number; b: number; c: number; d: number; } +>x1 : Foo +>{ a: 1, b: 1, c: 1, d: 1 } : { a: number; b: number; c: number; d: number; } +>a : number +>1 : 1 +>b : number +>1 : 1 +>c : number +>1 : 1 +>d : number +>1 : 1 + +declare let x2: Required; +>x2 : Required +>Required : Required +>Foo : Foo + +x1.a; // number +>x1.a : number +>x1 : Foo +>a : number + +x1.b; // number | undefined +>x1.b : number | undefined +>x1 : Foo +>b : number | undefined + +x1.c; // number +>x1.c : number | undefined +>x1 : Foo +>c : number | undefined + +x1.d; // number +>x1.d : number | undefined +>x1 : Foo +>d : number | undefined + +x2 = { a: 1 }; // Error +>x2 = { a: 1 } : { a: number; } +>x2 : Required +>{ a: 1 } : { a: number; } +>a : number +>1 : 1 + +x2 = { a: 1, b: 1 }; // Error +>x2 = { a: 1, b: 1 } : { a: number; b: number; } +>x2 : Required +>{ a: 1, b: 1 } : { a: number; b: number; } +>a : number +>1 : 1 +>b : number +>1 : 1 + +x2 = { a: 1, b: 1, c: 1 }; // Error +>x2 = { a: 1, b: 1, c: 1 } : { a: number; b: number; c: number; } +>x2 : Required +>{ a: 1, b: 1, c: 1 } : { a: number; b: number; c: number; } +>a : number +>1 : 1 +>b : number +>1 : 1 +>c : number +>1 : 1 + +x2 = { a: 1, b: 1, c: 1, d: 1 }; +>x2 = { a: 1, b: 1, c: 1, d: 1 } : { a: number; b: number; c: number; d: number; } +>x2 : Required +>{ a: 1, b: 1, c: 1, d: 1 } : { a: number; b: number; c: number; d: number; } +>a : number +>1 : 1 +>b : number +>1 : 1 +>c : number +>1 : 1 +>d : number +>1 : 1 + +type Bar = { +>Bar : Bar + + a: number; +>a : number + + readonly b: number; +>b : number +} + +declare let x3: Bar; +>x3 : Bar +>Bar : Bar + +x3.a = 1; +>x3.a = 1 : 1 +>x3.a : number +>x3 : Bar +>a : number +>1 : 1 + +x3.b = 1; // Error +>x3.b = 1 : 1 +>x3.b : any +>x3 : Bar +>b : any +>1 : 1 + +declare let x4: Readonly; +>x4 : Readonly +>Readonly : Readonly +>Bar : Bar + +x4.a = 1; // Error +>x4.a = 1 : 1 +>x4.a : any +>x4 : Readonly +>a : any +>1 : 1 + +x4.b = 1; // Error +>x4.b = 1 : 1 +>x4.b : any +>x4 : Readonly +>b : any +>1 : 1 + +declare let x5: Readwrite; +>x5 : Readwrite +>Readwrite : Readwrite +>Bar : Bar + +x5.a = 1; +>x5.a = 1 : 1 +>x5.a : number +>x5 : Readwrite +>a : number +>1 : 1 + +x5.b = 1; +>x5.b = 1 : 1 +>x5.b : number +>x5 : Readwrite +>b : number +>1 : 1 + From 8c2756fdf6a832a70d75e5de8bc4314d7f481534 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 13 Feb 2018 15:18:26 -0800 Subject: [PATCH 140/298] Support getting string literal completions based on a type argument constraint (#21168) * Support getting string literal completions based on a type argument constraint * Fix bug: look for require call before argument info * Code review * @sandersn code review * Remove test cast * Reduce completions.ts diff * @weswigham review * Remove getTypeArgumentConstraint's dependence on checkTypeArgumentConstraints * Remove TODO --- src/compiler/checker.ts | 17 ++++++++++++++--- src/compiler/types.ts | 1 + src/compiler/utilities.ts | 5 +++++ src/services/completions.ts | 3 +-- ...mpletionsStringLiteral_fromTypeConstraint.ts | 6 ++++++ 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 tests/cases/fourslash/completionsStringLiteral_fromTypeConstraint.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 75ab23407b3..d62e2157b07 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -299,6 +299,10 @@ namespace ts { node = getParseTreeNode(node); return node && tryGetThisTypeAt(node); }, + getTypeArgumentConstraint: node => { + node = getParseTreeNode(node, isTypeNode); + return node && getTypeArgumentConstraint(node); + }, }; const tupleTypes: GenericType[] = []; @@ -7356,7 +7360,7 @@ namespace ts { type = getTypeReferenceType(node, symbol); } // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the - // type reference in checkTypeReferenceOrExpressionWithTypeArguments. + // type reference in checkTypeReferenceNode. links.resolvedSymbol = symbol; links.resolvedType = type; } @@ -20274,9 +20278,8 @@ namespace ts { typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - const typeArgument = typeArguments[i]; result = result && checkTypeAssignableTo( - typeArgument, + typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], Diagnostics.Type_0_does_not_satisfy_the_constraint_1); @@ -20320,6 +20323,14 @@ namespace ts { } } + function getTypeArgumentConstraint(node: TypeNode): Type | undefined { + const typeReferenceNode = tryCast(node.parent, isTypeReferenceType); + if (!typeReferenceNode) return undefined; + const typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + const constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)!]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } + function checkTypeQuery(node: TypeQueryNode) { getTypeFromTypeQueryNode(node); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f4a4fb8a79e..edfb7868ee7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2944,6 +2944,7 @@ namespace ts { /* @internal */ resolveExternalModuleSymbol(symbol: Symbol): Symbol; /** @param node A location where we might consider accessing `this`. Not necessarily a ThisExpression. */ /* @internal */ tryGetThisTypeAt(node: Node): Type | undefined; + /* @internal */ getTypeArgumentConstraint(node: TypeNode): Type | undefined; } /* @internal */ diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 2d5ac780d6a..9e010b4246d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5940,4 +5940,9 @@ namespace ts { return false; } } + + /* @internal */ + export function isTypeReferenceType(node: Node): node is TypeReferenceType { + return node.kind === SyntaxKind.TypeReference || node.kind === SyntaxKind.ExpressionWithTypeArguments; + } } diff --git a/src/services/completions.ts b/src/services/completions.ts index 1aac8cd2c68..4e9a9d1485e 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -358,8 +358,7 @@ namespace ts.Completions { case SyntaxKind.LiteralType: switch (node.parent.parent.kind) { case SyntaxKind.TypeReference: - // TODO: GH#21168 - return undefined; + return { kind: StringLiteralCompletionKind.Types, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(node.parent as LiteralTypeNode), typeChecker) }; case SyntaxKind.IndexedAccessType: // Get all apparent property names // i.e. interface Foo { diff --git a/tests/cases/fourslash/completionsStringLiteral_fromTypeConstraint.ts b/tests/cases/fourslash/completionsStringLiteral_fromTypeConstraint.ts new file mode 100644 index 00000000000..cb3f1a31fe2 --- /dev/null +++ b/tests/cases/fourslash/completionsStringLiteral_fromTypeConstraint.ts @@ -0,0 +1,6 @@ +/// + +////interface Foo { foo: string; bar: string; } +////type T = Pick; + +verify.completionsAt("", ["foo", "bar"]); From 9d39ee73025071b4460a500cd7d42be4e39d33f5 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 13 Feb 2018 16:07:49 -0800 Subject: [PATCH 141/298] Fix jake lint on Windows We need to pass `windowsVerbatimArguments: true` to `jake.exec` or it parses the arguments incorrectly and doesn't actually lint. --- Jakefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jakefile.js b/Jakefile.js index b986d81dacc..9e8c51a306e 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -1308,7 +1308,7 @@ task("lint", ["build-rules"], () => { : `Gulpfile.ts scripts/generateLocalizedDiagnosticMessages.ts "scripts/tslint/**/*.ts" "src/**/*.ts" --exclude "src/lib/*.d.ts"`; const cmd = `node node_modules/tslint/bin/tslint ${files} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`; console.log("Linting: " + cmd); - jake.exec([cmd], { interactive: true }, () => { + jake.exec([cmd], { interactive: true, windowsVerbatimArguments: true }, () => { if (fold.isTravis()) console.log(fold.end("lint")); complete(); }); From 80464e8ff145bae5f09253f626d94556f2077f0f Mon Sep 17 00:00:00 2001 From: Priyantha Lankapura <403912+lankaapura@users.noreply.github.com> Date: Wed, 14 Feb 2018 08:22:33 +0530 Subject: [PATCH 142/298] fix typo in intellisense (#21914) --- src/lib/es5.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index bab3bc67d38..1f352cd6f39 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -985,7 +985,7 @@ interface ReadonlyArray { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** @@ -1104,7 +1104,7 @@ interface Array { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** From 47d84f87ce99c63f0d447b2a4a1b4a5d31764248 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 14 Feb 2018 08:11:38 -0800 Subject: [PATCH 143/298] assertItemInCompletionList: Fix error messages (#21908) * assertItemInCompletionList: Fix error messages * Fix lint --- src/harness/fourslash.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 52e335e5126..ab07182b8e7 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -3109,6 +3109,9 @@ Actual: ${stringify(fullActual)}`); hasAction: boolean | undefined, options: FourSlashInterface.VerifyCompletionListContainsOptions | undefined, ) { + const eq = (a: T, b: T, msg: string) => { + assert.deepEqual(a, b, this.assertionMessageAtLastKnownMarker(msg + " for " + stringify(entryId))); + }; const matchingItems = items.filter(item => item.name === entryId.name && item.source === entryId.source); if (matchingItems.length === 0) { const itemsString = items.map(item => stringify({ name: item.name, source: item.source, kind: item.kind })).join(",\n"); @@ -3123,30 +3126,30 @@ Actual: ${stringify(fullActual)}`); const details = this.getCompletionEntryDetails(item.name, item.source); if (documentation !== undefined) { - assert.equal(ts.displayPartsToString(details.documentation), documentation, this.assertionMessageAtLastKnownMarker("completion item documentation for " + entryId)); + eq(ts.displayPartsToString(details.documentation), documentation, "completion item documentation"); } if (text !== undefined) { - assert.equal(ts.displayPartsToString(details.displayParts), text, this.assertionMessageAtLastKnownMarker("completion item detail text for " + entryId)); + eq(ts.displayPartsToString(details.displayParts), text, "completion item detail text"); } if (entryId.source === undefined) { - assert.equal(options && options.sourceDisplay, undefined); + eq(options && options.sourceDisplay, /*b*/ undefined, "source display"); } else { - assert.deepEqual(details.source, [ts.textPart(options!.sourceDisplay)]); + eq(details.source, [ts.textPart(options!.sourceDisplay)], "source display"); } } if (kind !== undefined) { if (typeof kind === "string") { - assert.equal(item.kind, kind, this.assertionMessageAtLastKnownMarker("completion item kind for " + entryId)); + eq(item.kind, kind, "completion item kind"); } else { if (kind.kind) { - assert.equal(item.kind, kind.kind, this.assertionMessageAtLastKnownMarker("completion item kind for " + entryId)); + eq(item.kind, kind.kind, "completion item kind"); } if (kind.kindModifiers !== undefined) { - assert.equal(item.kindModifiers, kind.kindModifiers, this.assertionMessageAtLastKnownMarker("completion item kindModifiers for " + entryId)); + eq(item.kindModifiers, kind.kindModifiers, "completion item kindModifiers"); } } } @@ -3155,14 +3158,14 @@ Actual: ${stringify(fullActual)}`); if (spanIndex !== undefined) { const span = this.getTextSpanForRangeAtIndex(spanIndex); - assert.isTrue(TestState.textSpansEqual(span, item.replacementSpan), this.assertionMessageAtLastKnownMarker(stringify(span) + " does not equal " + stringify(item.replacementSpan) + " replacement span for " + entryId)); + assert.isTrue(TestState.textSpansEqual(span, item.replacementSpan), this.assertionMessageAtLastKnownMarker(stringify(span) + " does not equal " + stringify(item.replacementSpan) + " replacement span for " + stringify(entryId))); } - assert.equal(item.hasAction, hasAction, "hasAction"); - assert.equal(item.isRecommended, options && options.isRecommended, "isRecommended"); - assert.equal(item.insertText, options && options.insertText, "insertText"); + eq(item.hasAction, hasAction, "hasAction"); + eq(item.isRecommended, options && options.isRecommended, "isRecommended"); + eq(item.insertText, options && options.insertText, "insertText"); if (options && options.replacementSpan) { // TODO: GH#21679 - assert.deepEqual(item.replacementSpan, options && options.replacementSpan && ts.createTextSpanFromRange(options.replacementSpan), "replacementSpan"); + eq(item.replacementSpan, options && options.replacementSpan && ts.createTextSpanFromRange(options.replacementSpan), "replacementSpan"); } } From 3a61f638ba9f7f5923b5a7c1614a05de5ec40ffa Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 14 Feb 2018 09:19:47 -0800 Subject: [PATCH 144/298] Instantiation of 'keyof T' for wildcard type produces wildcard type --- src/compiler/checker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 75ab23407b3..8b6f464d5ed 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7948,6 +7948,7 @@ namespace ts { function getIndexType(type: Type): Type { return maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(type) : getObjectFlags(type) & ObjectFlags.Mapped ? getConstraintTypeFromMappedType(type) : + type === wildcardType ? wildcardType : type.flags & TypeFlags.Any || getIndexInfoOfType(type, IndexKind.String) ? stringType : getLiteralTypeFromPropertyNames(type); } From 3de1cd6f2de644d0e3723935479ad06df62ff822 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 14 Feb 2018 09:20:13 -0800 Subject: [PATCH 145/298] Add regression tests --- .../types/conditional/conditionalTypes1.ts | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes1.ts b/tests/cases/conformance/types/conditional/conditionalTypes1.ts index 94a802a0ffc..9449cc6d766 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes1.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes1.ts @@ -287,3 +287,33 @@ function f50() { type A = Omit<{ a: void; b: never; }>; // 'a' type B = Omit2<{ a: void; b: never; }>; // 'a' } + +// Repro from #21862 + +type OldDiff = ( + & { [P in T]: P; } + & { [P in U]: never; } + & { [x: string]: never; } +)[T]; +type NewDiff = T extends U ? never : T; +interface A { + a: 'a'; +} +interface B1 extends A { + b: 'b'; + c: OldDiff; +} +interface B2 extends A { + b: 'b'; + c: NewDiff; +} +type c1 = B1['c']; // 'c' | 'b' +type c2 = B2['c']; // 'c' | 'b' + +// Repro from #21929 + +type NonFooKeys1 = OldDiff; +type NonFooKeys2 = Exclude; + +type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" +type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" From 9b227fc520674b8794f623dfa24578a0c94fd35a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 14 Feb 2018 09:20:21 -0800 Subject: [PATCH 146/298] Accept new baselines --- .../reference/conditionalTypes1.errors.txt | 30 ++++++ .../baselines/reference/conditionalTypes1.js | 63 ++++++++++++ .../reference/conditionalTypes1.symbols | 96 +++++++++++++++++++ .../reference/conditionalTypes1.types | 96 +++++++++++++++++++ 4 files changed, 285 insertions(+) diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 869e740ad1a..72d88b60d64 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -447,4 +447,34 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(275,43): error TS type A = Omit<{ a: void; b: never; }>; // 'a' type B = Omit2<{ a: void; b: never; }>; // 'a' } + + // Repro from #21862 + + type OldDiff = ( + & { [P in T]: P; } + & { [P in U]: never; } + & { [x: string]: never; } + )[T]; + type NewDiff = T extends U ? never : T; + interface A { + a: 'a'; + } + interface B1 extends A { + b: 'b'; + c: OldDiff; + } + interface B2 extends A { + b: 'b'; + c: NewDiff; + } + type c1 = B1['c']; // 'c' | 'b' + type c2 = B2['c']; // 'c' | 'b' + + // Repro from #21929 + + type NonFooKeys1 = OldDiff; + type NonFooKeys2 = Exclude; + + type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" + type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypes1.js b/tests/baselines/reference/conditionalTypes1.js index 9020774d7fe..c7ad450f712 100644 --- a/tests/baselines/reference/conditionalTypes1.js +++ b/tests/baselines/reference/conditionalTypes1.js @@ -285,6 +285,36 @@ function f50() { type A = Omit<{ a: void; b: never; }>; // 'a' type B = Omit2<{ a: void; b: never; }>; // 'a' } + +// Repro from #21862 + +type OldDiff = ( + & { [P in T]: P; } + & { [P in U]: never; } + & { [x: string]: never; } +)[T]; +type NewDiff = T extends U ? never : T; +interface A { + a: 'a'; +} +interface B1 extends A { + b: 'b'; + c: OldDiff; +} +interface B2 extends A { + b: 'b'; + c: NewDiff; +} +type c1 = B1['c']; // 'c' | 'b' +type c2 = B2['c']; // 'c' | 'b' + +// Repro from #21929 + +type NonFooKeys1 = OldDiff; +type NonFooKeys2 = Exclude; + +type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" +type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" //// [conditionalTypes1.js] @@ -561,3 +591,36 @@ declare type T95 = T extends string ? boolean : number; declare const f44: (value: T94) => T95; declare const f45: (value: T95) => T94; declare function f50(): void; +declare type OldDiff = ({ + [P in T]: P; +} & { + [P in U]: never; +} & { + [x: string]: never; +})[T]; +declare type NewDiff = T extends U ? never : T; +interface A { + a: 'a'; +} +interface B1 extends A { + b: 'b'; + c: OldDiff; +} +interface B2 extends A { + b: 'b'; + c: NewDiff; +} +declare type c1 = B1['c']; +declare type c2 = B2['c']; +declare type NonFooKeys1 = OldDiff; +declare type NonFooKeys2 = Exclude; +declare type Test1 = NonFooKeys1<{ + foo: 1; + bar: 2; + baz: 3; +}>; +declare type Test2 = NonFooKeys2<{ + foo: 1; + bar: 2; + baz: 3; +}>; diff --git a/tests/baselines/reference/conditionalTypes1.symbols b/tests/baselines/reference/conditionalTypes1.symbols index 6c05ee1eeee..8802f25b1a8 100644 --- a/tests/baselines/reference/conditionalTypes1.symbols +++ b/tests/baselines/reference/conditionalTypes1.symbols @@ -1121,3 +1121,99 @@ function f50() { >b : Symbol(b, Decl(conditionalTypes1.ts, 284, 29)) } +// Repro from #21862 + +type OldDiff = ( +>OldDiff : Symbol(OldDiff, Decl(conditionalTypes1.ts, 285, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 289, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 289, 30)) + + & { [P in T]: P; } +>P : Symbol(P, Decl(conditionalTypes1.ts, 290, 9)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 289, 13)) +>P : Symbol(P, Decl(conditionalTypes1.ts, 290, 9)) + + & { [P in U]: never; } +>P : Symbol(P, Decl(conditionalTypes1.ts, 291, 9)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 289, 30)) + + & { [x: string]: never; } +>x : Symbol(x, Decl(conditionalTypes1.ts, 292, 9)) + +)[T]; +>T : Symbol(T, Decl(conditionalTypes1.ts, 289, 13)) + +type NewDiff = T extends U ? never : T; +>NewDiff : Symbol(NewDiff, Decl(conditionalTypes1.ts, 293, 5)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 294, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 294, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 294, 13)) +>U : Symbol(U, Decl(conditionalTypes1.ts, 294, 15)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 294, 13)) + +interface A { +>A : Symbol(A, Decl(conditionalTypes1.ts, 294, 45)) + + a: 'a'; +>a : Symbol(A.a, Decl(conditionalTypes1.ts, 295, 13)) +} +interface B1 extends A { +>B1 : Symbol(B1, Decl(conditionalTypes1.ts, 297, 1)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 294, 45)) + + b: 'b'; +>b : Symbol(B1.b, Decl(conditionalTypes1.ts, 298, 24)) + + c: OldDiff; +>c : Symbol(B1.c, Decl(conditionalTypes1.ts, 299, 11)) +>OldDiff : Symbol(OldDiff, Decl(conditionalTypes1.ts, 285, 1)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 294, 45)) +} +interface B2 extends A { +>B2 : Symbol(B2, Decl(conditionalTypes1.ts, 301, 1)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 294, 45)) + + b: 'b'; +>b : Symbol(B2.b, Decl(conditionalTypes1.ts, 302, 24)) + + c: NewDiff; +>c : Symbol(B2.c, Decl(conditionalTypes1.ts, 303, 11)) +>NewDiff : Symbol(NewDiff, Decl(conditionalTypes1.ts, 293, 5)) +>A : Symbol(A, Decl(conditionalTypes1.ts, 294, 45)) +} +type c1 = B1['c']; // 'c' | 'b' +>c1 : Symbol(c1, Decl(conditionalTypes1.ts, 305, 1)) +>B1 : Symbol(B1, Decl(conditionalTypes1.ts, 297, 1)) + +type c2 = B2['c']; // 'c' | 'b' +>c2 : Symbol(c2, Decl(conditionalTypes1.ts, 306, 18)) +>B2 : Symbol(B2, Decl(conditionalTypes1.ts, 301, 1)) + +// Repro from #21929 + +type NonFooKeys1 = OldDiff; +>NonFooKeys1 : Symbol(NonFooKeys1, Decl(conditionalTypes1.ts, 307, 18)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 311, 17)) +>OldDiff : Symbol(OldDiff, Decl(conditionalTypes1.ts, 285, 1)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 311, 17)) + +type NonFooKeys2 = Exclude; +>NonFooKeys2 : Symbol(NonFooKeys2, Decl(conditionalTypes1.ts, 311, 61)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 312, 17)) +>Exclude : Symbol(Exclude, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(conditionalTypes1.ts, 312, 17)) + +type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" +>Test1 : Symbol(Test1, Decl(conditionalTypes1.ts, 312, 61)) +>NonFooKeys1 : Symbol(NonFooKeys1, Decl(conditionalTypes1.ts, 307, 18)) +>foo : Symbol(foo, Decl(conditionalTypes1.ts, 314, 26)) +>bar : Symbol(bar, Decl(conditionalTypes1.ts, 314, 33)) +>baz : Symbol(baz, Decl(conditionalTypes1.ts, 314, 41)) + +type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" +>Test2 : Symbol(Test2, Decl(conditionalTypes1.ts, 314, 51)) +>NonFooKeys2 : Symbol(NonFooKeys2, Decl(conditionalTypes1.ts, 311, 61)) +>foo : Symbol(foo, Decl(conditionalTypes1.ts, 315, 26)) +>bar : Symbol(bar, Decl(conditionalTypes1.ts, 315, 33)) +>baz : Symbol(baz, Decl(conditionalTypes1.ts, 315, 41)) + diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index b544acdf3e2..1eebf8ba833 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -1274,3 +1274,99 @@ function f50() { >b : never } +// Repro from #21862 + +type OldDiff = ( +>OldDiff : ({ [P in T]: P; } & { [P in U]: never; } & { [x: string]: never; })[T] +>T : T +>U : U + + & { [P in T]: P; } +>P : P +>T : T +>P : P + + & { [P in U]: never; } +>P : P +>U : U + + & { [x: string]: never; } +>x : string + +)[T]; +>T : T + +type NewDiff = T extends U ? never : T; +>NewDiff : NewDiff +>T : T +>U : U +>T : T +>U : U +>T : T + +interface A { +>A : A + + a: 'a'; +>a : "a" +} +interface B1 extends A { +>B1 : B1 +>A : A + + b: 'b'; +>b : "b" + + c: OldDiff; +>c : ({ [P in keyof this]: P; } & { a: never; } & { [x: string]: never; })[keyof this] +>OldDiff : ({ [P in T]: P; } & { [P in U]: never; } & { [x: string]: never; })[T] +>A : A +} +interface B2 extends A { +>B2 : B2 +>A : A + + b: 'b'; +>b : "b" + + c: NewDiff; +>c : NewDiff +>NewDiff : NewDiff +>A : A +} +type c1 = B1['c']; // 'c' | 'b' +>c1 : "b" | "c" +>B1 : B1 + +type c2 = B2['c']; // 'c' | 'b' +>c2 : "b" | "c" +>B2 : B2 + +// Repro from #21929 + +type NonFooKeys1 = OldDiff; +>NonFooKeys1 : ({ [P in keyof T]: P; } & { foo: never; } & { [x: string]: never; })[keyof T] +>T : T +>OldDiff : ({ [P in T]: P; } & { [P in U]: never; } & { [x: string]: never; })[T] +>T : T + +type NonFooKeys2 = Exclude; +>NonFooKeys2 : Exclude +>T : T +>Exclude : Exclude +>T : T + +type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" +>Test1 : "bar" | "baz" +>NonFooKeys1 : ({ [P in keyof T]: P; } & { foo: never; } & { [x: string]: never; })[keyof T] +>foo : 1 +>bar : 2 +>baz : 3 + +type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz" +>Test2 : "bar" | "baz" +>NonFooKeys2 : Exclude +>foo : 1 +>bar : 2 +>baz : 3 + From 2ee92948d83a35f478850471f01308ed44a740c7 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 14 Feb 2018 10:12:38 -0800 Subject: [PATCH 147/298] Support @param tag on property declaration initializer (#21907) * Support @param tag on property declaration initializer * Update test * Finish updating test --- src/compiler/utilities.ts | 24 ++++++++++--------- ...jsdocParamTagOnPropertyInitializer.symbols | 13 ++++++++++ .../jsdocParamTagOnPropertyInitializer.types | 15 ++++++++++++ .../jsdocParamTagOnPropertyInitializer.ts | 10 ++++++++ tests/cases/fourslash/commentsInheritance.ts | 12 +++++----- 5 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 tests/baselines/reference/jsdocParamTagOnPropertyInitializer.symbols create mode 100644 tests/baselines/reference/jsdocParamTagOnPropertyInitializer.types create mode 100644 tests/cases/compiler/jsdocParamTagOnPropertyInitializer.ts diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 9e010b4246d..424fc092c45 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1620,17 +1620,19 @@ namespace ts { node.expression.right; } - function getSingleInitializerOfVariableStatement(node: Node, child?: Node): Node { - return isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node: Node): Expression | undefined { + switch (node.kind) { + case ts.SyntaxKind.VariableStatement: + const v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case ts.SyntaxKind.PropertyDeclaration: + return (node as PropertyDeclaration).initializer; + } } - function getSingleVariableOfVariableStatement(node: Node, child?: Node): Node { + function getSingleVariableOfVariableStatement(node: Node): VariableDeclaration | undefined { return isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } @@ -1648,7 +1650,7 @@ namespace ts { function getJSDocCommentsAndTagsWorker(node: Node): void { const parent = node.parent; - if (parent && (parent.kind === SyntaxKind.PropertyAssignment || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.PropertyDeclaration || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. @@ -1658,10 +1660,10 @@ namespace ts { // */ // var x = function(name) { return name.length; } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== SpecialPropertyAssignmentKind.None || @@ -1704,7 +1706,7 @@ namespace ts { export function getHostSignatureFromJSDoc(node: JSDocParameterTag): FunctionLike | undefined { const host = getJSDocHost(node); const decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; diff --git a/tests/baselines/reference/jsdocParamTagOnPropertyInitializer.symbols b/tests/baselines/reference/jsdocParamTagOnPropertyInitializer.symbols new file mode 100644 index 00000000000..a2ad6028cfd --- /dev/null +++ b/tests/baselines/reference/jsdocParamTagOnPropertyInitializer.symbols @@ -0,0 +1,13 @@ +=== /a.js === +class Foo { +>Foo : Symbol(Foo, Decl(a.js, 0, 0)) + + /**@param {string} x */ + m = x => x.toLowerCase(); +>m : Symbol(Foo.m, Decl(a.js, 0, 11)) +>x : Symbol(x, Decl(a.js, 2, 7)) +>x.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(a.js, 2, 7)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +} + diff --git a/tests/baselines/reference/jsdocParamTagOnPropertyInitializer.types b/tests/baselines/reference/jsdocParamTagOnPropertyInitializer.types new file mode 100644 index 00000000000..56d1a0e14af --- /dev/null +++ b/tests/baselines/reference/jsdocParamTagOnPropertyInitializer.types @@ -0,0 +1,15 @@ +=== /a.js === +class Foo { +>Foo : Foo + + /**@param {string} x */ + m = x => x.toLowerCase(); +>m : (x: string) => string +>x => x.toLowerCase() : (x: string) => string +>x : string +>x.toLowerCase() : string +>x.toLowerCase : () => string +>x : string +>toLowerCase : () => string +} + diff --git a/tests/cases/compiler/jsdocParamTagOnPropertyInitializer.ts b/tests/cases/compiler/jsdocParamTagOnPropertyInitializer.ts new file mode 100644 index 00000000000..831b7252a3b --- /dev/null +++ b/tests/cases/compiler/jsdocParamTagOnPropertyInitializer.ts @@ -0,0 +1,10 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true +// @noImplicitAny: true + +// @Filename: /a.js +class Foo { + /**@param {string} x */ + m = x => x.toLowerCase(); +} diff --git a/tests/cases/fourslash/commentsInheritance.ts b/tests/cases/fourslash/commentsInheritance.ts index 985c55c7947..a965bf213c8 100644 --- a/tests/cases/fourslash/commentsInheritance.ts +++ b/tests/cases/fourslash/commentsInheritance.ts @@ -271,10 +271,10 @@ verify.completionListContains("i1_nc_f1", "(method) c1.i1_nc_f1(): void", ""); verify.completionListContains("i1_nc_l1", "(property) c1.i1_nc_l1: () => void", ""); verify.completionListContains("p1", "(property) c1.p1: number", "c1_p1"); verify.completionListContains("f1", "(method) c1.f1(): void", "c1_f1"); -verify.completionListContains("l1", "(property) c1.l1: () => void", ""); +verify.completionListContains("l1", "(property) c1.l1: () => void", "c1_l1"); verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1"); verify.completionListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1"); -verify.completionListContains("nc_l1", "(property) c1.nc_l1: () => void", ""); +verify.completionListContains("nc_l1", "(property) c1.nc_l1: () => void", "c1_nc_l1"); goTo.marker('7'); verify.currentSignatureHelpDocCommentIs("i1_f1"); goTo.marker('8'); @@ -288,9 +288,9 @@ verify.currentSignatureHelpDocCommentIs(""); goTo.marker('l8'); verify.currentSignatureHelpDocCommentIs(""); goTo.marker('l9'); -verify.currentSignatureHelpDocCommentIs(""); +verify.currentSignatureHelpDocCommentIs("c1_l1"); goTo.marker('l10'); -verify.currentSignatureHelpDocCommentIs(""); +verify.currentSignatureHelpDocCommentIs("c1_nc_l1"); verify.quickInfos({ "6iq": "var c1_i: c1", @@ -300,8 +300,8 @@ verify.quickInfos({ "10q": ["(method) c1.nc_f1(): void", "c1_nc_f1"], l7q: "(property) c1.i1_l1: () => void", l8q: "(property) c1.i1_nc_l1: () => void", - l9q: "(property) c1.l1: () => void", - l10q: "(property) c1.nc_l1: () => void" + l9q: ["(property) c1.l1: () => void", "c1_l1"], + l10q: ["(property) c1.nc_l1: () => void", "c1_nc_l1"], }); goTo.marker('11'); From 8518343dc8762475a5e92c9f80b5c5725bd81796 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 14 Feb 2018 13:25:04 -0800 Subject: [PATCH 148/298] Add isStringLiteralLike helper (#21953) --- src/compiler/binder.ts | 4 ++-- src/compiler/checker.ts | 23 ++++++++----------- src/compiler/transformers/utilities.ts | 3 +-- src/compiler/types.ts | 2 +- src/compiler/utilities.ts | 4 ++++ src/services/completions.ts | 2 +- src/services/findAllReferences.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 ++ tests/baselines/reference/api/typescript.d.ts | 2 ++ 9 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index dedf7cb1807..05edda7cd3c 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -760,11 +760,11 @@ namespace ts { } function isNarrowingTypeofOperands(expr1: Expression, expr2: Expression) { - return expr1.kind === SyntaxKind.TypeOfExpression && isNarrowableOperand((expr1).expression) && (expr2.kind === SyntaxKind.StringLiteral || expr2.kind === SyntaxKind.NoSubstitutionTemplateLiteral); + return isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && isStringLiteralLike(expr2); } function isNarrowableInOperands(left: Expression, right: Expression) { - return (left.kind === SyntaxKind.StringLiteral || left.kind === SyntaxKind.NoSubstitutionTemplateLiteral) && isNarrowingExpression(right); + return isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr: BinaryExpression) { diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d62e2157b07..e682c18ea95 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2033,12 +2033,9 @@ namespace ts { } function resolveExternalModuleNameWorker(location: Node, moduleReferenceExpression: Expression, moduleNotFoundError: DiagnosticMessage, isForAugmentation = false): Symbol { - if (moduleReferenceExpression.kind !== SyntaxKind.StringLiteral && moduleReferenceExpression.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) { - return; - } - - const moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location: Node, moduleReference: string, moduleNotFoundError: DiagnosticMessage, errorNode: Node, isForAugmentation = false): Symbol { @@ -12946,11 +12943,11 @@ namespace ts { const operator = expr.operatorToken.kind; const left = getReferenceCandidate(expr.left); const right = getReferenceCandidate(expr.right); - if (left.kind === SyntaxKind.TypeOfExpression && (right.kind === SyntaxKind.StringLiteral || right.kind === SyntaxKind.NoSubstitutionTemplateLiteral)) { - return narrowTypeByTypeof(type, left, operator, right, assumeTrue); + if (left.kind === SyntaxKind.TypeOfExpression && isStringLiteralLike(right)) { + return narrowTypeByTypeof(type, left, operator, right, assumeTrue); } - if (right.kind === SyntaxKind.TypeOfExpression && (left.kind === SyntaxKind.StringLiteral || left.kind === SyntaxKind.NoSubstitutionTemplateLiteral)) { - return narrowTypeByTypeof(type, right, operator, left, assumeTrue); + if (right.kind === SyntaxKind.TypeOfExpression && isStringLiteralLike(left)) { + return narrowTypeByTypeof(type, right, operator, left, assumeTrue); } if (isMatchingReference(reference, left)) { return narrowTypeByEquality(type, operator, right, assumeTrue); @@ -12972,8 +12969,8 @@ namespace ts { return narrowTypeByInstanceof(type, expr, assumeTrue); case SyntaxKind.InKeyword: const target = getReferenceCandidate(expr.right); - if ((expr.left.kind === SyntaxKind.StringLiteral || expr.left.kind === SyntaxKind.NoSubstitutionTemplateLiteral) && isMatchingReference(reference, target)) { - return narrowByInKeyword(type, expr.left, assumeTrue); + if (isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { + return narrowByInKeyword(type, expr.left, assumeTrue); } break; case SyntaxKind.CommaToken: @@ -19599,7 +19596,7 @@ namespace ts { return nullWideningType; case SyntaxKind.NoSubstitutionTemplateLiteral: case SyntaxKind.StringLiteral: - return getFreshTypeOfLiteralType(getLiteralType((node as LiteralExpression).text)); + return getFreshTypeOfLiteralType(getLiteralType((node as StringLiteralLike).text)); case SyntaxKind.NumericLiteral: checkGrammarNumericLiteral(node as NumericLiteral); return getFreshTypeOfLiteralType(getLiteralType(+(node as NumericLiteral).text)); diff --git a/src/compiler/transformers/utilities.ts b/src/compiler/transformers/utilities.ts index 9267a239bb4..f7d28d6b4fc 100644 --- a/src/compiler/transformers/utilities.ts +++ b/src/compiler/transformers/utilities.ts @@ -214,9 +214,8 @@ namespace ts { * - this is mostly subjective beyond the requirement that the expression not be sideeffecting */ export function isSimpleCopiableExpression(expression: Expression) { - return expression.kind === SyntaxKind.StringLiteral || + return isStringLiteralLike(expression) || expression.kind === SyntaxKind.NumericLiteral || - expression.kind === SyntaxKind.NoSubstitutionTemplateLiteral || isKeyword(expression.kind) || isIdentifier(expression); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index edfb7868ee7..0e3f83f6e09 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1178,7 +1178,7 @@ namespace ts { /* @internal */ singleQuote?: boolean; } - /* @internal */ export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; + export type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; // Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing. // Consider 'Expression'. Without the brand, 'Expression' is actually no different diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 424fc092c45..9023e1e62f3 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5947,4 +5947,8 @@ namespace ts { export function isTypeReferenceType(node: Node): node is TypeReferenceType { return node.kind === SyntaxKind.TypeReference || node.kind === SyntaxKind.ExpressionWithTypeArguments; } + + export function isStringLiteralLike(node: Node): node is StringLiteralLike { + return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral; + } } diff --git a/src/services/completions.ts b/src/services/completions.ts index 4e9a9d1485e..68ec65a1e19 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -42,7 +42,7 @@ namespace ts.Completions { const contextToken = findPrecedingToken(position, sourceFile); if (isInString(sourceFile, position, contextToken)) { - return !contextToken || !isStringLiteral(contextToken) && !isNoSubstitutionTemplateLiteral(contextToken) + return !contextToken || !isStringLiteralLike(contextToken) ? undefined : convertStringLiteralCompletions(getStringLiteralCompletionEntries(sourceFile, contextToken, position, typeChecker, compilerOptions, host), sourceFile, typeChecker, log); } diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index acc3e6ac4cb..b1e6909f093 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -272,7 +272,7 @@ namespace ts.FindAllReferences.Core { } function isModuleReferenceLocation(node: ts.Node): boolean { - if (node.kind !== SyntaxKind.StringLiteral && node.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) { + if (!isStringLiteralLike(node)) { return false; } switch (node.parent.kind) { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 762b225fa24..370d841a7f1 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -780,6 +780,7 @@ declare namespace ts { interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; } + type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; interface Expression extends Node { _expressionBrand: any; } @@ -3249,6 +3250,7 @@ declare namespace ts { function isSetAccessor(node: Node): node is SetAccessorDeclaration; function isGetAccessor(node: Node): node is GetAccessorDeclaration; function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; + function isStringLiteralLike(node: Node): node is StringLiteralLike; } declare namespace ts { type ErrorCallback = (message: DiagnosticMessage, length: number) => void; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index b513bb2b7bf..baed457b3b0 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -780,6 +780,7 @@ declare namespace ts { interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; } + type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; interface Expression extends Node { _expressionBrand: any; } @@ -3304,6 +3305,7 @@ declare namespace ts { function isSetAccessor(node: Node): node is SetAccessorDeclaration; function isGetAccessor(node: Node): node is GetAccessorDeclaration; function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; + function isStringLiteralLike(node: Node): node is StringLiteralLike; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; From 1b6aa1386fbb6c7a990c6cab19ba1d093df4013d Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 15 Feb 2018 09:21:33 -0800 Subject: [PATCH 149/298] Handle non-preserved const enums in debug messages (#21945) --- src/compiler/core.ts | 6 ++++-- src/services/services.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 8479cf94180..424380892c7 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2927,7 +2927,8 @@ namespace ts { } export function showSymbol(symbol: Symbol): string { - return `{ flags: ${showFlags(symbol.flags, (ts as any).SymbolFlags)}; declarations: ${map(symbol.declarations, showSyntaxKind)} }`; + const symbolFlags = (ts as any).SymbolFlags; + return `{ flags: ${symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags}; declarations: ${map(symbol.declarations, showSyntaxKind)} }`; } function showFlags(flags: number, flagsEnum: { [flag: number]: string }): string { @@ -2942,7 +2943,8 @@ namespace ts { } export function showSyntaxKind(node: Node): string { - return (ts as any).SyntaxKind[node.kind]; + const syntaxKind = (ts as any).SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); } } diff --git a/src/services/services.ts b/src/services/services.ts index d8bf5f56ed6..b8c086a67e7 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -121,7 +121,7 @@ namespace ts { const textPos = scanner.getTextPos(); if (textPos <= end) { if (token === SyntaxKind.Identifier) { - Debug.fail(`Did not expect ${(ts as any).SyntaxKind[this.kind]} to have an Identifier in its trivia`); + Debug.fail(`Did not expect ${Debug.showSyntaxKind(this)} to have an Identifier in its trivia`); } nodes.push(createNode(token, pos, textPos, this)); } From a133cec24691d72b9dbf7eaf7b778284a02b277b Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 15 Feb 2018 09:30:58 -0800 Subject: [PATCH 150/298] Fix bug: Interface type parameter merged with property is not unused (#21966) --- src/compiler/checker.ts | 30 ++++++------- .../noUnusedLocals_selfReference.errors.txt | 21 ++++++++- .../reference/noUnusedLocals_selfReference.js | 13 ++++++ .../noUnusedLocals_selfReference.symbols | 45 ++++++++++++++----- .../noUnusedLocals_selfReference.types | 23 ++++++++++ .../compiler/noUnusedLocals_selfReference.ts | 9 ++++ .../nounusedTypeParameterConstraint.ts | 3 +- 7 files changed, 115 insertions(+), 29 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e682c18ea95..df69b4d8efe 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1159,7 +1159,7 @@ namespace ts { const originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location let result: Symbol; let lastLocation: Node; - let lastNonBlockLocation: Node; + let lastSelfReferenceLocation: Node; let propertyWithInvalidInitializer: Node; const errorLocation = location; let grandparent: Node; @@ -1383,17 +1383,17 @@ namespace ts { } break; } - if (isNonBlockLocation(location)) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. - // If `result === lastNonBlockLocation.symbol`, that means that we are somewhere inside `lastNonBlockLocation` looking up a name, and resolving to `lastLocation` itself. + // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { result.isReferenced = true; } @@ -1476,17 +1476,17 @@ namespace ts { return result; } - function isNonBlockLocation({ kind }: Node): boolean { - switch (kind) { - case SyntaxKind.Block: - case SyntaxKind.ModuleBlock: - case SyntaxKind.SwitchStatement: - case SyntaxKind.CaseBlock: - case SyntaxKind.CaseClause: - case SyntaxKind.DefaultClause: - return false; - default: + function isSelfReferenceLocation(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.ClassDeclaration: + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.EnumDeclaration: + case SyntaxKind.TypeAliasDeclaration: + case SyntaxKind.ModuleDeclaration: // For `namespace N { N; }` return true; + default: + return false; } } diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt index e1d198ff559..a3aef6ced68 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt +++ b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt @@ -2,10 +2,13 @@ tests/cases/compiler/noUnusedLocals_selfReference.ts(3,10): error TS6133: 'f' is tests/cases/compiler/noUnusedLocals_selfReference.ts(5,14): error TS6133: 'g' is declared but its value is never read. tests/cases/compiler/noUnusedLocals_selfReference.ts(9,7): error TS6133: 'C' is declared but its value is never read. tests/cases/compiler/noUnusedLocals_selfReference.ts(12,6): error TS6133: 'E' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(14,19): error TS6133: 'm' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(13,11): error TS6133: 'I' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(14,6): error TS6133: 'T' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(15,11): error TS6133: 'N' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(22,19): error TS6133: 'm' is declared but its value is never read. -==== tests/cases/compiler/noUnusedLocals_selfReference.ts (5 errors) ==== +==== tests/cases/compiler/noUnusedLocals_selfReference.ts (8 errors) ==== export {}; // Make this a module scope, so these are local variables. function f() { @@ -26,6 +29,20 @@ tests/cases/compiler/noUnusedLocals_selfReference.ts(14,19): error TS6133: 'm' i enum E { A = 0, B = E.A } ~ !!! error TS6133: 'E' is declared but its value is never read. + interface I { x: I }; + ~ +!!! error TS6133: 'I' is declared but its value is never read. + type T = { x: T }; + ~ +!!! error TS6133: 'T' is declared but its value is never read. + namespace N { N; } + ~ +!!! error TS6133: 'N' is declared but its value is never read. + + // Avoid a false positive. + // Previously `T` was considered unused due to merging with the property, + // back when all non-blocks were checked for recursion. + export interface A { T: T } class P { private m() { this.m; } } ~ diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.js b/tests/baselines/reference/noUnusedLocals_selfReference.js index c23d8295340..c676560b64a 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.js +++ b/tests/baselines/reference/noUnusedLocals_selfReference.js @@ -11,6 +11,14 @@ class C { m() { C; } } enum E { A = 0, B = E.A } +interface I { x: I }; +type T = { x: T }; +namespace N { N; } + +// Avoid a false positive. +// Previously `T` was considered unused due to merging with the property, +// back when all non-blocks were checked for recursion. +export interface A { T: T } class P { private m() { this.m; } } P; @@ -40,6 +48,11 @@ var E; E[E["A"] = 0] = "A"; E[E["B"] = 0] = "B"; })(E || (E = {})); +; +var N; +(function (N) { + N; +})(N || (N = {})); var P = /** @class */ (function () { function P() { } diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.symbols b/tests/baselines/reference/noUnusedLocals_selfReference.symbols index cd4195094fe..5074fb840a4 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.symbols +++ b/tests/baselines/reference/noUnusedLocals_selfReference.symbols @@ -29,23 +29,46 @@ enum E { A = 0, B = E.A } >E : Symbol(E, Decl(noUnusedLocals_selfReference.ts, 10, 1)) >A : Symbol(E.A, Decl(noUnusedLocals_selfReference.ts, 11, 8)) +interface I { x: I }; +>I : Symbol(I, Decl(noUnusedLocals_selfReference.ts, 11, 25)) +>x : Symbol(I.x, Decl(noUnusedLocals_selfReference.ts, 12, 13)) +>I : Symbol(I, Decl(noUnusedLocals_selfReference.ts, 11, 25)) + +type T = { x: T }; +>T : Symbol(T, Decl(noUnusedLocals_selfReference.ts, 12, 21)) +>x : Symbol(x, Decl(noUnusedLocals_selfReference.ts, 13, 10)) +>T : Symbol(T, Decl(noUnusedLocals_selfReference.ts, 12, 21)) + +namespace N { N; } +>N : Symbol(N, Decl(noUnusedLocals_selfReference.ts, 13, 18)) +>N : Symbol(N, Decl(noUnusedLocals_selfReference.ts, 13, 18)) + +// Avoid a false positive. +// Previously `T` was considered unused due to merging with the property, +// back when all non-blocks were checked for recursion. +export interface A { T: T } +>A : Symbol(A, Decl(noUnusedLocals_selfReference.ts, 14, 18)) +>T : Symbol(T, Decl(noUnusedLocals_selfReference.ts, 19, 19), Decl(noUnusedLocals_selfReference.ts, 19, 23)) +>T : Symbol(T, Decl(noUnusedLocals_selfReference.ts, 19, 19), Decl(noUnusedLocals_selfReference.ts, 19, 23)) +>T : Symbol(T, Decl(noUnusedLocals_selfReference.ts, 19, 19), Decl(noUnusedLocals_selfReference.ts, 19, 23)) + class P { private m() { this.m; } } ->P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 11, 25)) ->m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 13, 9)) ->this.m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 13, 9)) ->this : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 11, 25)) ->m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 13, 9)) +>P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 19, 30)) +>m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 21, 9)) +>this.m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 21, 9)) +>this : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 19, 30)) +>m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 21, 9)) P; ->P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 11, 25)) +>P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 19, 30)) // Does not detect mutual recursion. function g() { D; } ->g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 14, 2)) ->D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 17, 19)) +>g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 22, 2)) +>D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 25, 19)) class D { m() { g; } } ->D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 17, 19)) ->m : Symbol(D.m, Decl(noUnusedLocals_selfReference.ts, 18, 9)) ->g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 14, 2)) +>D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 25, 19)) +>m : Symbol(D.m, Decl(noUnusedLocals_selfReference.ts, 26, 9)) +>g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 22, 2)) diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.types b/tests/baselines/reference/noUnusedLocals_selfReference.types index cbaa413c651..de904d98513 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.types +++ b/tests/baselines/reference/noUnusedLocals_selfReference.types @@ -30,6 +30,29 @@ enum E { A = 0, B = E.A } >E : typeof E >A : E +interface I { x: I }; +>I : I +>x : I +>I : I + +type T = { x: T }; +>T : { x: T; } +>x : { x: T; } +>T : { x: T; } + +namespace N { N; } +>N : typeof N +>N : typeof N + +// Avoid a false positive. +// Previously `T` was considered unused due to merging with the property, +// back when all non-blocks were checked for recursion. +export interface A { T: T } +>A : A +>T : T +>T : T +>T : T + class P { private m() { this.m; } } >P : P >m : () => void diff --git a/tests/cases/compiler/noUnusedLocals_selfReference.ts b/tests/cases/compiler/noUnusedLocals_selfReference.ts index 10ec9ebf782..9ae8244d0f8 100644 --- a/tests/cases/compiler/noUnusedLocals_selfReference.ts +++ b/tests/cases/compiler/noUnusedLocals_selfReference.ts @@ -1,4 +1,5 @@ // @noUnusedLocals: true +// @noUnusedParameters: true export {}; // Make this a module scope, so these are local variables. @@ -12,6 +13,14 @@ class C { m() { C; } } enum E { A = 0, B = E.A } +interface I { x: I }; +type T = { x: T }; +namespace N { N; } + +// Avoid a false positive. +// Previously `T` was considered unused due to merging with the property, +// back when all non-blocks were checked for recursion. +export interface A { T: T } class P { private m() { this.m; } } P; diff --git a/tests/cases/compiler/nounusedTypeParameterConstraint.ts b/tests/cases/compiler/nounusedTypeParameterConstraint.ts index d2c3a1677ee..8108d01d68f 100644 --- a/tests/cases/compiler/nounusedTypeParameterConstraint.ts +++ b/tests/cases/compiler/nounusedTypeParameterConstraint.ts @@ -1,4 +1,5 @@ -//@noUnusedLocals:true +// @noUnusedLocals: true +// @noUnusedParameters:true //@filename: bar.ts export interface IEventSourcedEntity { } From 81df5313d75cd6d94eecf5a0b74f3eb734069a6c Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 15 Feb 2018 13:02:32 -0800 Subject: [PATCH 151/298] Simplify getOccurrencesAtPosition (#21977) --- src/services/services.ts | 47 ++++++++++------------------------------ 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index b8c086a67e7..5eb0f6a06ca 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1567,17 +1567,17 @@ namespace ts { /// References and Occurrences function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] { - let results = getOccurrencesAtPositionCore(fileName, position); - - if (results) { - const sourceFile = getCanonicalFileName(normalizeSlashes(fileName)); - - // Get occurrences only supports reporting occurrences for the file queried. So - // filter down to that list. - results = filter(results, r => getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile); - } - - return results; + const canonicalFileName = getCanonicalFileName(normalizeSlashes(fileName)); + return flatMap(getDocumentHighlights(fileName, position, [fileName]), entry => entry.highlightSpans.map(highlightSpan => { + Debug.assert(getCanonicalFileName(normalizeSlashes(entry.fileName)) === canonicalFileName); // Get occurrences only supports reporting occurrences for the file queried. + return { + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference, + isDefinition: false, + isInString: highlightSpan.isInString, + }; + })); } function getDocumentHighlights(fileName: string, position: number, filesToSearch: ReadonlyArray): DocumentHighlights[] { @@ -1587,31 +1587,6 @@ namespace ts { return DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] { - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - - function convertDocumentHighlights(documentHighlights: DocumentHighlights[]): ReferenceEntry[] { - if (!documentHighlights) { - return undefined; - } - - const result: ReferenceEntry[] = []; - for (const entry of documentHighlights) { - for (const highlightSpan of entry.highlightSpans) { - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference, - isDefinition: false, - isInString: highlightSpan.isInString, - }); - } - } - - return result; - } - } - function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] { return getReferences(fileName, position, { findInStrings, findInComments, isForRename: true }); } From 347bff14a9dfac03bbad921514e71f3292af97e2 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 15 Feb 2018 13:02:45 -0800 Subject: [PATCH 152/298] textChanges: Simplify getChanges (#21971) * textChanges: Simplify getChanges * Return ReadonlyArray --- src/compiler/core.ts | 8 ++++++++ src/services/textChanges.ts | 30 +++++------------------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 424380892c7..212fa86b366 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1438,6 +1438,14 @@ namespace ts { } } + export function group(values: ReadonlyArray, getGroupId: (value: T) => string): ReadonlyArray> { + const groupIdToGroup = createMultiMap(); + for (const value of values) { + groupIdToGroup.add(getGroupId(value), value); + } + return arrayFrom(groupIdToGroup.values()); + } + /** * Tests whether a value is an array. */ diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index d3f6cde8e8d..1469f61bf36 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -593,32 +593,12 @@ namespace ts.textChanges { public getChanges(): FileTextChanges[] { this.finishInsertNodeAtClassStart(); - - const changesPerFile = createMap(); - // group changes per file - for (const c of this.changes) { - let changesInFile = changesPerFile.get(c.sourceFile.path); - if (!changesInFile) { - changesPerFile.set(c.sourceFile.path, changesInFile = []); - } - changesInFile.push(c); - } - // convert changes - const fileChangesList: FileTextChanges[] = []; - changesPerFile.forEach(changesInFile => { + return group(this.changes, c => c.sourceFile.path).map(changesInFile => { const sourceFile = changesInFile[0].sourceFile; - const fileTextChanges: FileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; - for (const c of ChangeTracker.normalize(changesInFile)) { - fileTextChanges.textChanges.push(createTextChange(this.computeSpan(c, sourceFile), this.computeNewText(c, sourceFile))); - } - fileChangesList.push(fileTextChanges); + const textChanges = ChangeTracker.normalize(changesInFile).map(c => + createTextChange(createTextSpanFromRange(c.range), this.computeNewText(c, sourceFile))); + return { fileName: sourceFile.fileName, textChanges }; }); - - return fileChangesList; - } - - private computeSpan(change: Change, _sourceFile: SourceFile): TextSpan { - return createTextSpanFromRange(change.range); } private computeNewText(change: Change, sourceFile: SourceFile): string { @@ -675,7 +655,7 @@ namespace ts.textChanges { return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.formatContext); } - private static normalize(changes: Change[]): Change[] { + private static normalize(changes: ReadonlyArray): ReadonlyArray { // order changes by start position const normalized = stableSort(changes, (a, b) => a.range.pos - b.range.pos); // verify that change intervals do not overlap, except possibly at end points. From f8f4bb8fdd01e848f9d3100a3fded7ad767b95ee Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 15 Feb 2018 13:02:56 -0800 Subject: [PATCH 153/298] textChanges: Clean up handling of newLineCharacter (#21970) --- src/harness/unittests/textChanges.ts | 2 +- src/services/textChanges.ts | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/harness/unittests/textChanges.ts b/src/harness/unittests/textChanges.ts index 934da4e3ba1..0a3602ea0b1 100644 --- a/src/harness/unittests/textChanges.ts +++ b/src/harness/unittests/textChanges.ts @@ -57,7 +57,7 @@ namespace ts { Harness.Baseline.runBaseline(`textChanges/${caption}.js`, () => { const sourceFile = createSourceFile("source.ts", text, ScriptTarget.ES2015, /*setParentNodes*/ true); const rulesProvider = getRuleProvider(placeOpenBraceOnNewLineForFunctions); - const changeTracker = new textChanges.ChangeTracker(printerOptions.newLine, rulesProvider, validateNodes ? verifyPositions : undefined); + const changeTracker = new textChanges.ChangeTracker(newLineCharacter, rulesProvider, validateNodes ? verifyPositions : undefined); testBlock(sourceFile, changeTracker); const changes = changeTracker.getChanges(); assert.equal(changes.length, 1); diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 1469f61bf36..04a20bbbbb8 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -197,13 +197,12 @@ namespace ts.textChanges { export class ChangeTracker { private readonly changes: Change[] = []; - private readonly newLineCharacter: string; private readonly deletedNodesInLists: true[] = []; // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. // Map from class id to nodes to insert at the start private readonly nodesInsertedAtClassStarts = createMap<{ sourceFile: SourceFile, cls: ClassLikeDeclaration, members: ClassElement[] }>(); public static fromContext(context: TextChangesContext): ChangeTracker { - return new ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options) === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed, context.formatContext); + return new ChangeTracker(getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); } public static with(context: TextChangesContext, cb: (tracker: ChangeTracker) => void): FileTextChanges[] { @@ -212,11 +211,11 @@ namespace ts.textChanges { return tracker.getChanges(); } + /** Public for tests only. Other callers should use `ChangeTracker.with`. */ constructor( - private readonly newLine: NewLineKind, + private readonly newLineCharacter: string, private readonly formatContext: ts.formatting.FormatContext, private readonly validator?: (text: NonFormattedText) => void) { - this.newLineCharacter = getNewLineCharacter({ newLine }); } public deleteRange(sourceFile: SourceFile, range: TextRange) { @@ -631,7 +630,7 @@ namespace ts.textChanges { } private getFormattedTextOfNode(node: Node, sourceFile: SourceFile, pos: number, options: ChangeNodeOptions): string { - const nonformattedText = getNonformattedText(node, sourceFile, this.newLine); + const nonformattedText = getNonformattedText(node, sourceFile, this.newLineCharacter); if (this.validator) { this.validator(nonformattedText); } @@ -671,10 +670,9 @@ namespace ts.textChanges { readonly node: Node; } - function getNonformattedText(node: Node, sourceFile: SourceFile | undefined, newLine: NewLineKind): NonFormattedText { - const options = { newLine, target: sourceFile && sourceFile.languageVersion }; - const writer = new Writer(getNewLineCharacter(options)); - const printer = createPrinter(options, writer); + function getNonformattedText(node: Node, sourceFile: SourceFile | undefined, newLine: string): NonFormattedText { + const writer = new Writer(newLine); + const printer = createPrinter({ newLine: newLine === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed }, writer); printer.writeNode(EmitHint.Unspecified, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } From a8c0be344b7574d9cd44e1ce0fa958b426b1cd1f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 15 Feb 2018 13:56:22 -0800 Subject: [PATCH 154/298] Support recursive conditional types --- src/compiler/checker.ts | 272 +++++++++++++++++++++++----------------- src/compiler/types.ts | 27 ++-- 2 files changed, 179 insertions(+), 120 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 75ab23407b3..3965ac37cca 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -57,6 +57,7 @@ namespace ts { let typeCount = 0; let symbolCount = 0; let enumCount = 0; + let typeInstantiationDepth = 0; let symbolInstantiationDepth = 0; const emptySymbols = createSymbolTable(); @@ -306,7 +307,6 @@ namespace ts { const intersectionTypes = createMap(); const literalTypes = createMap(); const indexedAccessTypes = createMap(); - const conditionalTypes = createMap(); const evolvingArrayTypes: EvolvingArrayType[] = []; const undefinedProperties = createMap() as UnderscoreEscapedMap; @@ -2957,8 +2957,8 @@ namespace ts { if (type.flags & TypeFlags.Conditional) { const checkTypeNode = typeToTypeNodeHelper((type).checkType, context); const extendsTypeNode = typeToTypeNodeHelper((type).extendsType, context); - const trueTypeNode = typeToTypeNodeHelper((type).trueType, context); - const falseTypeNode = typeToTypeNodeHelper((type).falseType, context); + const trueTypeNode = typeToTypeNodeHelper(getTrueTypeFromConditionalType(type), context); + const falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context); return createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & TypeFlags.Substitution) { @@ -5881,8 +5881,7 @@ namespace ts { // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - const iterationMapper = createTypeMapper([typeParameter], [t]); - const templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; + const templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); const propType = instantiateType(templateType, templateMapper); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. @@ -6104,22 +6103,20 @@ namespace ts { } function getDefaultConstraintOfConditionalType(type: ConditionalType) { - return getUnionType([type.trueType, type.falseType]); + return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]); } - function getConstraintOfDistributiveConditionalType(type: ConditionalType) { + function getConstraintOfDistributiveConditionalType(type: ConditionalType): Type { // Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained // type parameter. If so, create an instantiation of the conditional type where T is replaced // with its constraint. We do this because if the constraint is a union type it will be distributed // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' // removes 'undefined' from T. - if (isDistributiveConditionalType(type)) { + if (type.root.isDistributive) { const constraint = getConstraintOfType(type.checkType); if (constraint) { - const target = type.target || type; - const mapper = createTypeMapper([target.checkType], [constraint]); - const combinedMapper = type.mapper ? combineTypeMappers(mapper, type.mapper) : mapper; - return instantiateType(target, combinedMapper); + const mapper = createTypeMapper([type.root.checkType], [constraint]); + return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); } } return undefined; @@ -8121,7 +8118,7 @@ namespace ts { function substituteIndexedMappedType(objectType: MappedType, type: IndexedAccessType) { const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); const objectTypeMapper = (objectType).mapper; - const templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; + const templateMapper = combineTypeMappers(objectTypeMapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } @@ -8188,76 +8185,70 @@ namespace ts { return type.flags & TypeFlags.Substitution ? (type).typeParameter : type; } - function createConditionalType(checkType: Type, extendsType: Type, trueType: Type, falseType: Type, inferTypeParameters: TypeParameter[], target: ConditionalType, mapper: TypeMapper, aliasSymbol: Symbol, aliasTypeArguments: Type[]) { - const type = createType(TypeFlags.Conditional); - type.checkType = checkType; - type.extendsType = extendsType; - type.trueType = trueType; - type.falseType = falseType; - type.inferTypeParameters = inferTypeParameters; - type.target = target; - type.mapper = mapper; - type.aliasSymbol = aliasSymbol; - type.aliasTypeArguments = aliasTypeArguments; - return type; + function getRootTrueType(root: ConditionalRoot) { + return root.resolvedTrueType || (root.resolvedTrueType = getTypeFromTypeNode(root.node.trueType)); } - function getConditionalType(checkType: Type, baseExtendsType: Type, baseTrueType: Type, baseFalseType: Type, inferTypeParameters: TypeParameter[], target: ConditionalType, mapper: TypeMapper, aliasSymbol?: Symbol, baseAliasTypeArguments?: Type[]): Type { - // Instantiate extends type without instantiating any 'infer T' type parameters - const extendsType = instantiateType(baseExtendsType, mapper); + function getRootFalseType(root: ConditionalRoot) { + return root.resolvedFalseType || (root.resolvedFalseType = getTypeFromTypeNode(root.node.falseType)); + } + + function getConditionalType(root: ConditionalRoot, mapper: TypeMapper): Type { + let combinedMapper: TypeMapper; + const getTrueType = () => instantiateType(getRootTrueType(root), combinedMapper || mapper); + const getFalseType = () => instantiateType(getRootFalseType(root), mapper); + const checkType = instantiateType(root.checkType, mapper); + const extendsType = instantiateType(root.extendsType, mapper); // Return falseType for a definitely false extends check. We check an instantations of the two // types with type parameters mapped to the wildcard type, the most permissive instantiations // possible (the wildcard type is assignable to and from all types). If those are not related, // then no instatiations will be and we can just return the false branch type. if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { - return instantiateType(baseFalseType, mapper); + return getFalseType(); } // The check could be true for some instantiation - let combinedMapper: TypeMapper; - if (inferTypeParameters) { - const inferences = map(inferTypeParameters, createInferenceInfo); + if (root.inferTypeParameters) { + const inferences = map(root.inferTypeParameters, createInferenceInfo); // We don't want inferences from constraints as they may cause us to eagerly resolve the // conditional type instead of deferring resolution. Also, we always want strict function // types rules (i.e. proper contravariance) for inferences. inferTypes(inferences, checkType, extendsType, InferencePriority.NoConstraints | InferencePriority.AlwaysStrict); // We infer 'never' when there are no candidates for a type parameter const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || neverType); - const inferenceMapper = createTypeMapper(inferTypeParameters, inferredTypes); - combinedMapper = mapper ? combineTypeMappers(mapper, inferenceMapper) : inferenceMapper; + combinedMapper = combineTypeMappers(mapper, createTypeMapper(root.inferTypeParameters, inferredTypes)); } // Return union of trueType and falseType for any and never since they match anything if (checkType.flags & TypeFlags.Any || (checkType.flags & TypeFlags.Never && !(extendsType.flags & TypeFlags.Never))) { - return getUnionType([instantiateType(baseTrueType, combinedMapper || mapper), instantiateType(baseFalseType, mapper)]); + return getUnionType([getTrueType(), getFalseType()]); } // Instantiate the extends type including inferences for 'infer T' type parameters - const inferredExtendsType = combinedMapper ? instantiateType(baseExtendsType, combinedMapper) : extendsType; + const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; // Return trueType for a definitely true extends check. The definitely assignable relation excludes // type variable constraints from consideration. Without the definitely assignable relation, the type // type Foo = T extends { x: string } ? string : number // would immediately resolve to 'string' instead of being deferred. if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { - return instantiateType(baseTrueType, combinedMapper || mapper); + return getTrueType(); } // Return a deferred type for a check that is neither definitely true nor definitely false const erasedCheckType = getActualTypeParameter(checkType); - const trueType = instantiateType(baseTrueType, mapper); - const falseType = instantiateType(baseFalseType, mapper); - // We compute the cache key from the ids of the four constituent types, plus an indicator of whether the - // type is distributive (i.e. whether the original declaration has a type parameter as the check type). - const isDistributive = (target ? target.checkType : erasedCheckType).flags & TypeFlags.TypeParameter ? 1 : 0; - const id = erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id + "," + isDistributive; - const cached = conditionalTypes.get(id); - if (cached) { - return cached; - } - const result = createConditionalType(erasedCheckType, extendsType, trueType, falseType, - inferTypeParameters, target, mapper, aliasSymbol, instantiateTypes(baseAliasTypeArguments, mapper)); - conditionalTypes.set(id, result); + const result = createType(TypeFlags.Conditional); + result.root = root; + result.checkType = erasedCheckType; + result.extendsType = extendsType; + result.mapper = mapper; + result.trueTypeMapper = combinedMapper || mapper; + result.aliasSymbol = root.aliasSymbol; + result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper); return result; } - function isDistributiveConditionalType(type: ConditionalType) { - return !!((type.target || type).checkType.flags & TypeFlags.TypeParameter); + function getTrueTypeFromConditionalType(type: ConditionalType) { + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getRootTrueType(type.root), type.trueTypeMapper)); + } + + function getFalseTypeFromConditionalType(type: ConditionalType) { + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getRootFalseType(type.root), type.mapper)); } function getInferTypeParameters(node: ConditionalTypeNode): TypeParameter[] { @@ -8275,11 +8266,26 @@ namespace ts { function getTypeFromConditionalTypeNode(node: ConditionalTypeNode): Type { const links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getConditionalType( - getTypeFromTypeNode(node.checkType), getTypeFromTypeNode(node.extendsType), - getTypeFromTypeNode(node.trueType), getTypeFromTypeNode(node.falseType), - getInferTypeParameters(node), /*target*/ undefined, /*mapper*/ undefined, - getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + const checkType = getTypeFromTypeNode(node.checkType); + const outerTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true); + const root: ConditionalRoot = { + node, + checkType, + extendsType: getTypeFromTypeNode(node.extendsType), + isDistributive: !!(checkType.flags & TypeFlags.TypeParameter), + inferTypeParameters: getInferTypeParameters(node), + outerTypeParameters, + instantiations: undefined, + aliasSymbol: getAliasSymbolForTypeNode(node), + aliasTypeArguments: getAliasTypeArgumentsForTypeNode(node), + resolvedTrueType: undefined, + resolvedFalseType: undefined + }; + links.resolvedType = getConditionalType(root, /*mapper*/ undefined); + if (outerTypeParameters) { + root.instantiations = createMap(); + root.instantiations.set(getTypeListId(outerTypeParameters), links.resolvedType); + } } return links.resolvedType; } @@ -8670,6 +8676,8 @@ namespace ts { } function combineTypeMappers(mapper1: TypeMapper, mapper2: TypeMapper): TypeMapper { + if (!mapper1) return mapper2; + if (!mapper2) return mapper1; return t => instantiateType(mapper1(t), mapper2); } @@ -8867,71 +8875,106 @@ namespace ts { } function getConditionalTypeInstantiation(type: ConditionalType, mapper: TypeMapper): Type { - const target = type.target || type; - const combinedMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; + const root = type.root; + if (root.outerTypeParameters) { + // We are instantiating a conditional type that has one or more type parameters in scope. Apply the + // mapper to the type parameters to produce the effective list of type arguments, and compute the + // instantiation cache key from the type IDs of the type arguments. + const typeArguments = map(root.outerTypeParameters, mapper); + const id = getTypeListId(typeArguments); + let result = root.instantiations.get(id); + if (!result) { + const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments); + // sys.write(`${map(root.outerTypeParameters, t => typeToString(t)).join(",")} ===> ${map(typeArguments, t => typeToString(t)).join(",")}\n`); + // if (every(typeArguments, t => t === wildcardType)) { + // root.instantiations.set(id, wildcardType); + // } + result = instantiateConditionalType(root, newMapper); + root.instantiations.set(id, result); + } + return result; + } + return type; + } + + function instantiateConditionalType(root: ConditionalRoot, mapper: TypeMapper): Type { // Check if we have a conditional type where the check type is a naked type parameter. If so, // the conditional type is distributive over union types and when T is instantiated to a union // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). - if (isDistributiveConditionalType(target)) { - const checkType = target.checkType; - const instantiatedType = combinedMapper(checkType); + if (root.isDistributive) { + const checkType = root.checkType; + const instantiatedType = mapper(checkType); if (checkType !== instantiatedType && instantiatedType.flags & TypeFlags.Union) { - return mapType(instantiatedType, t => instantiateConditionalType(target, createReplacementMapper(checkType, t, combinedMapper))); + return mapType(instantiatedType, t => getConditionalType(root, createReplacementMapper(checkType, t, mapper))); } } - return instantiateConditionalType(target, combinedMapper); + return getConditionalType(root, mapper); } - function instantiateConditionalType(type: ConditionalType, mapper: TypeMapper): Type { - return getConditionalType(instantiateType(type.checkType, mapper), type.extendsType, type.trueType, type.falseType, - type.inferTypeParameters, type, mapper, type.aliasSymbol, type.aliasTypeArguments); + function getErrorNodeForType(type: Type): Node { + return type.aliasSymbol && type.aliasTypeArguments && getDeclarationOfKind(type.aliasSymbol, SyntaxKind.TypeAliasDeclaration); } function instantiateType(type: Type, mapper: TypeMapper): Type { if (type && mapper && mapper !== identityMapper) { - if (type.flags & TypeFlags.TypeParameter) { - return mapper(type); - } - if (type.flags & TypeFlags.Object) { - if ((type).objectFlags & ObjectFlags.Anonymous) { - // If the anonymous type originates in a declaration of a function, method, class, or - // interface, in an object type literal, or in an object literal expression, we may need - // to instantiate the type because it might reference a type parameter. - return type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral) && type.symbol.declarations ? - getAnonymousTypeInstantiation(type, mapper) : type; - } - if ((type).objectFlags & ObjectFlags.Mapped) { - return getAnonymousTypeInstantiation(type, mapper); - } - if ((type).objectFlags & ObjectFlags.Reference) { - const typeArguments = (type).typeArguments; - const newTypeArguments = instantiateTypes(typeArguments, mapper); - return newTypeArguments !== typeArguments ? createTypeReference((type).target, newTypeArguments) : type; + if (typeInstantiationDepth >= 100) { + const node = getErrorNodeForType(type); + if (node) { + error(node, Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); + return unknownType; } } - if (type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Primitive)) { - const types = (type).types; - const newTypes = instantiateTypes(types, mapper); - return newTypes !== types ? getUnionType(newTypes, UnionReduction.Literal, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; + typeInstantiationDepth++; + const result = instantiateTypeWorker(type, mapper); + typeInstantiationDepth--; + return result; + } + return type; + } + + function instantiateTypeWorker(type: Type, mapper: TypeMapper): Type { + if (type.flags & TypeFlags.TypeParameter) { + return mapper(type); + } + if (type.flags & TypeFlags.Object) { + if ((type).objectFlags & ObjectFlags.Anonymous) { + // If the anonymous type originates in a declaration of a function, method, class, or + // interface, in an object type literal, or in an object literal expression, we may need + // to instantiate the type because it might reference a type parameter. + return type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral) && type.symbol.declarations ? + getAnonymousTypeInstantiation(type, mapper) : type; } - if (type.flags & TypeFlags.Intersection) { - const types = (type).types; - const newTypes = instantiateTypes(types, mapper); - return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; + if ((type).objectFlags & ObjectFlags.Mapped) { + return getAnonymousTypeInstantiation(type, mapper); } - if (type.flags & TypeFlags.Index) { - return getIndexType(instantiateType((type).type, mapper)); - } - if (type.flags & TypeFlags.IndexedAccess) { - return getIndexedAccessType(instantiateType((type).objectType, mapper), instantiateType((type).indexType, mapper)); - } - if (type.flags & TypeFlags.Conditional) { - return getConditionalTypeInstantiation(type, mapper); - } - if (type.flags & TypeFlags.Substitution) { - return mapper((type).typeParameter); + if ((type).objectFlags & ObjectFlags.Reference) { + const typeArguments = (type).typeArguments; + const newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference((type).target, newTypeArguments) : type; } } + if (type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Primitive)) { + const types = (type).types; + const newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, UnionReduction.Literal, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; + } + if (type.flags & TypeFlags.Intersection) { + const types = (type).types; + const newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; + } + if (type.flags & TypeFlags.Index) { + return getIndexType(instantiateType((type).type, mapper)); + } + if (type.flags & TypeFlags.IndexedAccess) { + return getIndexedAccessType(instantiateType((type).objectType, mapper), instantiateType((type).indexType, mapper)); + } + if (type.flags & TypeFlags.Conditional) { + return getConditionalTypeInstantiation(type, combineTypeMappers((type).mapper, mapper)); + } + if (type.flags & TypeFlags.Substitution) { + return mapper((type).typeParameter); + } return type; } @@ -9673,11 +9716,11 @@ namespace ts { } } if (flags & TypeFlags.Conditional) { - if (result = isRelatedTo((source).checkType, (target).checkType, /*reportErrors*/ false)) { - if (result &= isRelatedTo((source).extendsType, (target).extendsType, /*reportErrors*/ false)) { - if (result &= isRelatedTo((source).trueType, (target).trueType, /*reportErrors*/ false)) { - if (result &= isRelatedTo((source).falseType, (target).falseType, /*reportErrors*/ false)) { - if (isDistributiveConditionalType(source) === isDistributiveConditionalType(target)) { + if ((source).root.isDistributive === (target).root.isDistributive) { + if (result = isRelatedTo((source).checkType, (target).checkType, /*reportErrors*/ false)) { + if (result &= isRelatedTo((source).extendsType, (target).extendsType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { + if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { return result; } } @@ -10079,8 +10122,8 @@ namespace ts { if (target.flags & TypeFlags.Conditional) { if (isTypeIdenticalTo((source).checkType, (target).checkType) && isTypeIdenticalTo((source).extendsType, (target).extendsType)) { - if (result = isRelatedTo((source).trueType, (target).trueType, reportErrors)) { - result &= isRelatedTo((source).falseType, (target).falseType, reportErrors); + if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) { + result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors); } if (result) { errorInfo = saveErrorInfo; @@ -11463,6 +11506,9 @@ namespace ts { if (!couldContainTypeVariables(target)) { return; } + if (source === wildcardType) { + source = getWildcardInstantiation(target); + } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { // Source and target are types originating in the same generic type alias declaration. // Simply infer from source type arguments to target type arguments. @@ -11577,8 +11623,8 @@ namespace ts { else if (source.flags & TypeFlags.Conditional && target.flags & TypeFlags.Conditional) { inferFromTypes((source).checkType, (target).checkType); inferFromTypes((source).extendsType, (target).extendsType); - inferFromTypes((source).trueType, (target).trueType); - inferFromTypes((source).falseType, (target).falseType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); } else if (target.flags & TypeFlags.UnionOrIntersection) { const targetTypes = (target).types; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index f4a4fb8a79e..2c73182a2c0 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3811,18 +3811,31 @@ namespace ts { type: InstantiableType | UnionOrIntersectionType; } - // T extends U ? X : Y (TypeFlags.Conditional) - export interface ConditionalType extends InstantiableType { + export interface ConditionalRoot { + node: ConditionalTypeNode; checkType: Type; extendsType: Type; - trueType: Type; - falseType: Type; - /* @internal */ + isDistributive: boolean; inferTypeParameters: TypeParameter[]; - /* @internal */ - target?: ConditionalType; + outerTypeParameters?: TypeParameter[]; + instantiations?: Map; + aliasSymbol: Symbol; + aliasTypeArguments: Type[]; + resolvedTrueType?: Type; + resolvedFalseType?: Type; + } + + // T extends U ? X : Y (TypeFlags.Conditional) + export interface ConditionalType extends InstantiableType { + root: ConditionalRoot; + checkType: Type; + extendsType: Type; + resolvedTrueType?: Type; + resolvedFalseType?: Type; /* @internal */ mapper?: TypeMapper; + /* @internal */ + trueTypeMapper?: TypeMapper; } // Type parameter substitution (TypeFlags.Substitution) From 67c7fe6680d592163686c165ab9d8328ad44ae29 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 15 Feb 2018 13:57:05 -0800 Subject: [PATCH 155/298] Accept new baselines --- .../reference/api/tsserverlibrary.d.ts | 20 ++++++++++++++++--- tests/baselines/reference/api/typescript.d.ts | 20 ++++++++++++++++--- .../baselines/reference/conditionalTypes1.js | 2 +- .../reference/conditionalTypes1.types | 8 ++++---- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 762b225fa24..7578e6985e3 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2187,11 +2187,25 @@ declare namespace ts { interface IndexType extends InstantiableType { type: InstantiableType | UnionOrIntersectionType; } - interface ConditionalType extends InstantiableType { + interface ConditionalRoot { + node: ConditionalTypeNode; checkType: Type; extendsType: Type; - trueType: Type; - falseType: Type; + isDistributive: boolean; + inferTypeParameters: TypeParameter[]; + outerTypeParameters?: TypeParameter[]; + instantiations?: Map; + aliasSymbol: Symbol; + aliasTypeArguments: Type[]; + resolvedTrueType?: Type; + resolvedFalseType?: Type; + } + interface ConditionalType extends InstantiableType { + root: ConditionalRoot; + checkType: Type; + extendsType: Type; + resolvedTrueType?: Type; + resolvedFalseType?: Type; } interface SubstitutionType extends InstantiableType { typeParameter: TypeParameter; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index b513bb2b7bf..380fa24f215 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2187,11 +2187,25 @@ declare namespace ts { interface IndexType extends InstantiableType { type: InstantiableType | UnionOrIntersectionType; } - interface ConditionalType extends InstantiableType { + interface ConditionalRoot { + node: ConditionalTypeNode; checkType: Type; extendsType: Type; - trueType: Type; - falseType: Type; + isDistributive: boolean; + inferTypeParameters: TypeParameter[]; + outerTypeParameters?: TypeParameter[]; + instantiations?: Map; + aliasSymbol: Symbol; + aliasTypeArguments: Type[]; + resolvedTrueType?: Type; + resolvedFalseType?: Type; + } + interface ConditionalType extends InstantiableType { + root: ConditionalRoot; + checkType: Type; + extendsType: Type; + resolvedTrueType?: Type; + resolvedFalseType?: Type; } interface SubstitutionType extends InstantiableType { typeParameter: TypeParameter; diff --git a/tests/baselines/reference/conditionalTypes1.js b/tests/baselines/reference/conditionalTypes1.js index 9020774d7fe..19621080e41 100644 --- a/tests/baselines/reference/conditionalTypes1.js +++ b/tests/baselines/reference/conditionalTypes1.js @@ -542,7 +542,7 @@ declare type T82 = Eq2; declare type T83 = Eq2; declare type Foo = T extends string ? boolean : number; declare type Bar = T extends string ? boolean : number; -declare const convert: (value: Foo) => Foo; +declare const convert: (value: Foo) => Bar; declare type Baz = Foo; declare const convert2: (value: Foo) => Foo; declare function f31(): void; diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index b544acdf3e2..71ebf3d043c 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -1010,8 +1010,8 @@ type Bar = T extends string ? boolean : number; >T : T const convert = (value: Foo): Bar => value; ->convert : (value: Foo) => Foo ->(value: Foo): Bar => value : (value: Foo) => Foo +>convert : (value: Foo) => Bar +>(value: Foo): Bar => value : (value: Foo) => Bar >U : U >value : Foo >Foo : Foo @@ -1095,7 +1095,7 @@ function f33() { >U : U type T2 = Bar; ->T2 : Foo +>T2 : Bar >Bar : Bar >T : T >U : U @@ -1106,7 +1106,7 @@ function f33() { var z: T2; >z : Foo ->T2 : Foo +>T2 : Bar } // Repro from #21823 From cfc234f959db400023e303ded85c2566408d807d Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 15 Feb 2018 16:29:42 -0800 Subject: [PATCH 156/298] Simplify getBraceMatchingAtPosition (#21979) --- src/services/services.ts | 60 +++++++++------------------------------- 1 file changed, 13 insertions(+), 47 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index 5eb0f6a06ca..6df52dd804e 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1767,55 +1767,21 @@ namespace ts { return OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } - function getBraceMatchingAtPosition(fileName: string, position: number) { + const braceMatching = createMapFromTemplate({ + [SyntaxKind.OpenBraceToken]: SyntaxKind.CloseBraceToken, + [SyntaxKind.OpenParenToken]: SyntaxKind.CloseParenToken, + [SyntaxKind.OpenBracketToken]: SyntaxKind.CloseBracketToken, + [SyntaxKind.GreaterThanToken]: SyntaxKind.LessThanToken, + }); + braceMatching.forEach((value, key) => braceMatching.set(value.toString(), Number(key) as SyntaxKind)); + + function getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[] { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const result: TextSpan[] = []; - const token = getTouchingToken(sourceFile, position, /*includeJsDocComment*/ false); - - if (token.getStart(sourceFile) === position) { - const matchKind = getMatchingTokenKind(token); - - // Ensure that there is a corresponding token to match ours. - if (matchKind) { - const parentElement = token.parent; - - const childNodes = parentElement.getChildren(sourceFile); - for (const current of childNodes) { - if (current.kind === matchKind) { - const range1 = createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - const range2 = createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - - // We want to order the braces when we return the result. - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - - break; - } - } - } - } - - return result; - - function getMatchingTokenKind(token: Node): ts.SyntaxKind { - switch (token.kind) { - case ts.SyntaxKind.OpenBraceToken: return ts.SyntaxKind.CloseBraceToken; - case ts.SyntaxKind.OpenParenToken: return ts.SyntaxKind.CloseParenToken; - case ts.SyntaxKind.OpenBracketToken: return ts.SyntaxKind.CloseBracketToken; - case ts.SyntaxKind.LessThanToken: return ts.SyntaxKind.GreaterThanToken; - case ts.SyntaxKind.CloseBraceToken: return ts.SyntaxKind.OpenBraceToken; - case ts.SyntaxKind.CloseParenToken: return ts.SyntaxKind.OpenParenToken; - case ts.SyntaxKind.CloseBracketToken: return ts.SyntaxKind.OpenBracketToken; - case ts.SyntaxKind.GreaterThanToken: return ts.SyntaxKind.LessThanToken; - } - - return undefined; - } + const matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined; + const match = matchKind && findChildOfKind(token.parent, matchKind, sourceFile); + // We want to order the braces when we return the result. + return match ? [createTextSpanFromNode(token, sourceFile), createTextSpanFromNode(match, sourceFile)].sort((a, b) => a.start - b.start) : emptyArray; } function getIndentationAtPosition(fileName: string, position: number, editorOptions: EditorOptions | EditorSettings) { From 06286e760a7771e099f739e4f2bf09f94968728e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 16 Feb 2018 01:17:45 -0800 Subject: [PATCH 157/298] Document 'ExportAssignment' slightly. --- src/compiler/types.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 481b91c9276..ff9f99ccd49 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2199,6 +2199,10 @@ namespace ts { export type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + /** + * This is either an `export =` or an `export default` declaration. + * Unless `isExportEquals` is set, this node was parsed as an `export default`. + */ export interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; parent?: SourceFile; From b70aa229c636210a0503806eb3df953e0aa59abd Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Feb 2018 10:48:57 -0800 Subject: [PATCH 158/298] getTextOfPropertyName: Assert input value is a PropertyName (#21981) --- src/compiler/checker.ts | 12 +++++++----- src/compiler/utilities.ts | 12 +++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2df80926c14..b817d9b965a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21909,11 +21909,13 @@ namespace ts { // check private/protected variable access const parent = node.parent.parent; const parentType = getTypeForBindingElementParent(parent); - const name = node.propertyName || node.name; - const property = getPropertyOfType(parentType, getTextOfPropertyName(name)); - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + const name = node.propertyName || node.name; + if (!isBindingPattern(name)) { + const property = getPropertyOfType(parentType, getTextOfPropertyName(name)); + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 9023e1e62f3..4e5b5700d29 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -570,17 +570,15 @@ namespace ts { export function getTextOfPropertyName(name: PropertyName): __String { switch (name.kind) { case SyntaxKind.Identifier: - return (name).escapedText; + return name.escapedText; case SyntaxKind.StringLiteral: case SyntaxKind.NumericLiteral: - return escapeLeadingUnderscores((name).text); + return escapeLeadingUnderscores(name.text); case SyntaxKind.ComputedPropertyName: - if (isStringOrNumericLiteral((name).expression)) { - return escapeLeadingUnderscores(((name).expression).text); - } + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + Debug.assertNever(name); } - - return undefined; } export function entityNameToString(name: EntityNameOrEntityNameExpression): string { From 5656f35b6a1120599fb62291b16161f6f9b818b2 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 31 Jan 2018 11:20:41 -0800 Subject: [PATCH 159/298] Introduce an organizeImports command In phase 1, it coalesces imports from the same module and sorts the results, but does not remove unused imports. Some trivia is lost during coalescing, but none should be duplicated. --- Jakefile.js | 1 + src/harness/harnessLanguageService.ts | 3 + src/harness/tsconfig.json | 1 + src/harness/unittests/organizeImports.ts | 426 ++++++++++++++++++ src/harness/unittests/session.ts | 2 + src/server/client.ts | 4 + src/server/protocol.ts | 25 + src/server/session.ts | 19 + src/services/services.ts | 287 ++++++++++++ src/services/types.ts | 3 + .../reference/api/tsserverlibrary.d.ts | 21 + tests/baselines/reference/api/typescript.d.ts | 2 + .../organizeImports/CoalesceTrivia.ts | 15 + .../reference/organizeImports/MoveToTop.ts | 18 + .../reference/organizeImports/Simple.ts | 20 + .../reference/organizeImports/SortTrivia.ts | 10 + 16 files changed, 857 insertions(+) create mode 100644 src/harness/unittests/organizeImports.ts create mode 100644 tests/baselines/reference/organizeImports/CoalesceTrivia.ts create mode 100644 tests/baselines/reference/organizeImports/MoveToTop.ts create mode 100644 tests/baselines/reference/organizeImports/Simple.ts create mode 100644 tests/baselines/reference/organizeImports/SortTrivia.ts diff --git a/Jakefile.js b/Jakefile.js index 9e8c51a306e..d676926abac 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -141,6 +141,7 @@ var harnessSources = harnessCoreSources.concat([ "typingsInstaller.ts", "projectErrors.ts", "matchFiles.ts", + "organizeImports.ts", "initializeTSConfig.ts", "extractConstants.ts", "extractFunctions.ts", diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 1c85acfb80e..d24f572d1d5 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -522,6 +522,9 @@ namespace Harness.LanguageService { getApplicableRefactors(): ts.ApplicableRefactorInfo[] { throw new Error("Not supported on the shim."); } + organizeImports(_scope: ts.OrganizeImportsScope, _formatOptions: ts.FormatCodeSettings): ReadonlyArray { + throw new Error("Not supported on the shim."); + } getEmitOutput(fileName: string): ts.EmitOutput { return unwrapJSONCallResult(this.shim.getEmitOutput(fileName)); } diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 25642ab5179..cd6dbc5e0bb 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -117,6 +117,7 @@ "./unittests/tsserverProjectSystem.ts", "./unittests/tscWatchMode.ts", "./unittests/matchFiles.ts", + "./unittests/organizeImports.ts", "./unittests/initializeTSConfig.ts", "./unittests/compileOnSave.ts", "./unittests/typingsInstaller.ts", diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts new file mode 100644 index 00000000000..5cac601d08e --- /dev/null +++ b/src/harness/unittests/organizeImports.ts @@ -0,0 +1,426 @@ +/// +/// + + +namespace ts { + describe("Organize imports", () => { + describe("Sort imports", () => { + it("No imports", () => { + assert.isEmpty(sortImports([])); + }); + + it("One import", () => { + const unsortedImports = parseImports(`import "lib";`); + const actualSortedImports = sortImports(unsortedImports); + const expectedSortedImports = unsortedImports; + assertListEqual(expectedSortedImports, actualSortedImports); + }); + + it("Stable - import kind", () => { + assertUnaffectedBySort( + `import "lib";`, + `import * as x from "lib";`, + `import x from "lib";`, + `import {x} from "lib";`); + }); + + it("Stable - default property alias", () => { + assertUnaffectedBySort( + `import x from "lib";`, + `import y from "lib";`); + }); + + it("Stable - module alias", () => { + assertUnaffectedBySort( + `import * as x from "lib";`, + `import * as y from "lib";`); + }); + + it("Stable - symbol", () => { + assertUnaffectedBySort( + `import {x} from "lib";`, + `import {y} from "lib";`); + }); + + it("Sort - non-relative vs non-relative", () => { + assertSortsBefore( + `import y from "lib1";`, + `import x from "lib2";`); + }); + + it("Sort - relative vs relative", () => { + assertSortsBefore( + `import y from "./lib1";`, + `import x from "./lib2";`); + }); + + it("Sort - invalid vs invalid", () => { + assertSortsBefore( + "import y from `${'lib1'}`;", + "import x from `${'lib2'}`;"); + }); + + it("Sort - relative vs non-relative", () => { + assertSortsBefore( + `import y from "lib";`, + `import x from "./lib";`); + }); + + it("Sort - non-relative vs invalid", () => { + assertSortsBefore( + `import y from "lib";`, + "import x from `${'lib'}`;"); + }); + + it("Sort - relative vs invalid", () => { + assertSortsBefore( + `import y from "./lib";`, + "import x from `${'lib'}`;"); + }); + + function assertUnaffectedBySort(...importStrings: string[]) { + const unsortedImports1 = parseImports(...importStrings); + assertListEqual(unsortedImports1, sortImports(unsortedImports1)); + + const unsortedImports2 = reverse(unsortedImports1); + assertListEqual(unsortedImports2, sortImports(unsortedImports2)); + } + + function assertSortsBefore(importString1: string, importString2: string) { + const imports = parseImports(importString1, importString2); + assertListEqual(imports, sortImports(imports)); + assertListEqual(imports, sortImports(reverse(imports))); + } + }); + + describe("Coalesce imports", () => { + it("No imports", () => { + assert.isEmpty(coalesceImports([])); + }); + + it("Sort specifiers", () => { + const sortedImports = parseImports(`import { default as m, a as n, b, y, z as o } from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports(`import { a as n, b, default as m, y, z as o } from "lib";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine side-effect-only imports", () => { + const sortedImports = parseImports( + `import "lib";`, + `import "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports(`import "lib";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine namespace imports", () => { + const sortedImports = parseImports( + `import * as x from "lib";`, + `import * as y from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = sortedImports; + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine default imports", () => { + const sortedImports = parseImports( + `import x from "lib";`, + `import y from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports(`import { default as x, default as y } from "lib";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine property imports", () => { + const sortedImports = parseImports( + `import { x } from "lib";`, + `import { y as z } from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports(`import { x, y as z } from "lib";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine side-effect-only import with namespace import", () => { + const sortedImports = parseImports( + `import "lib";`, + `import * as x from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = sortedImports; + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine side-effect-only import with default import", () => { + const sortedImports = parseImports( + `import "lib";`, + `import x from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = sortedImports; + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine side-effect-only import with property import", () => { + const sortedImports = parseImports( + `import "lib";`, + `import { x } from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = sortedImports; + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine namespace import with default import", () => { + const sortedImports = parseImports( + `import * as x from "lib";`, + `import y from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports( + `import y, * as x from "lib";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine namespace import with property import", () => { + const sortedImports = parseImports( + `import * as x from "lib";`, + `import { y } from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = sortedImports; + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine default import with property import", () => { + const sortedImports = parseImports( + `import x from "lib";`, + `import { y } from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports( + `import x, { y } from "lib";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine many imports", () => { + const sortedImports = parseImports( + `import "lib";`, + `import * as y from "lib";`, + `import w from "lib";`, + `import { b } from "lib";`, + `import "lib";`, + `import * as x from "lib";`, + `import z from "lib";`, + `import { a } from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports( + `import "lib";`, + `import * as x from "lib";`, + `import * as y from "lib";`, + `import { a, b, default as w, default as z } from "lib";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + it("Combine imports from different modules", () => { + const sortedImports = parseImports( + `import { d } from "lib1";`, + `import { b } from "lib1";`, + `import { c } from "lib2";`, + `import { a } from "lib2";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = parseImports( + `import { b, d } from "lib1";`, + `import { a, c } from "lib2";`); + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + + // This is descriptive, rather than normative + it("Combine two namespace imports with one default import", () => { + const sortedImports = parseImports( + `import * as x from "lib";`, + `import * as y from "lib";`, + `import z from "lib";`); + const actualCoalescedImports = coalesceImports(sortedImports); + const expectedCoalescedImports = sortedImports; + assertListEqual(expectedCoalescedImports, actualCoalescedImports); + }); + }); + + describe("Baselines", () => { + + const libFile = { + path: "/lib.ts", + content: ` +export function F1(); +export default function F2(); +`, + }; + + testOrganizeImports("Simple", + { + path: "/test.ts", + content: ` +import { F1, F2 } from "lib"; +import * as NS from "lib"; +import D from "lib"; + +NS.F1(); +D(); +F1(); +F2(); +`, + }, + libFile); + + testOrganizeImports("MoveToTop", + { + path: "/test.ts", + content: ` +import { F1, F2 } from "lib"; +F1(); +F2(); +import * as NS from "lib"; +NS.F1(); +import D from "lib"; +D(); +`, + }, + libFile); + + testOrganizeImports("CoalesceTrivia", + { + path: "/test.ts", + content: ` +/*A*/import /*B*/ { /*C*/ F2 /*D*/ } /*E*/ from /*F*/ "lib" /*G*/;/*H*/ //I +/*J*/import /*K*/ { /*L*/ F1 /*M*/ } /*N*/ from /*O*/ "lib" /*P*/;/*Q*/ //R + +F1(); +F2(); +`, + }, + libFile); + + testOrganizeImports("SortTrivia", + { + path: "/test.ts", + content: ` +/*A*/import /*B*/ "lib2" /*C*/;/*D*/ //E +/*F*/import /*G*/ "lib1" /*H*/;/*I*/ //J +`, + }, + { path: "/lib1.ts", content: "" }, + { path: "/lib2.ts", content: "" }); + + function testOrganizeImports(testName: string, testFile: TestFSWithWatch.FileOrFolder, ...otherFiles: TestFSWithWatch.FileOrFolder[]) { + it(testName, () => runBaseline(`organizeImports/${testName}.ts`, testFile, ...otherFiles)); + } + + function runBaseline(baselinePath: string, testFile: TestFSWithWatch.FileOrFolder, ...otherFiles: TestFSWithWatch.FileOrFolder[]) { + const { path: testPath, content: testContent } = testFile; + const languageService = makeLanguageService(testFile, ...otherFiles); + const changes = languageService.organizeImports({ type: "file", fileName: testPath }, testFormatOptions); + assert.equal(1, changes.length); + assert.equal(testPath, changes[0].fileName); + + Harness.Baseline.runBaseline(baselinePath, () => { + const data: string[] = []; + data.push(`// ==ORIGINAL==`); + data.push(testContent); + + data.push(`// ==ORGANIZED==`); + const newText = textChanges.applyChanges(testContent, changes[0].textChanges); + data.push(newText); + + return data.join(newLineCharacter); + }); + } + + function makeLanguageService(...files: TestFSWithWatch.FileOrFolder[]) { + const host = projectSystem.createServerHost(files); + const projectService = projectSystem.createProjectService(host, { useSingleInferredProject: true }); + files.forEach(f => projectService.openClientFile(f.path)); + return projectService.inferredProjects[0].getLanguageService(); + } + }); + + function parseImports(...importStrings: string[]): ReadonlyArray { + const sourceFile = createSourceFile("a.ts", importStrings.join("\n"), ScriptTarget.ES2015, /*setParentNodes*/ true, ScriptKind.TS); + const imports = filter(sourceFile.statements, isImportDeclaration); + assert.equal(importStrings.length, imports.length); + return imports; + } + + function assertEqual(node1?: Node, node2?: Node) { + if (node1 === undefined) { + assert.isUndefined(node2); + return; + } + else if (node2 === undefined) { + assert.isUndefined(node1); // Guaranteed to fail + return; + } + + assert.equal(node1.kind, node2.kind); + + switch(node1.kind) { + case SyntaxKind.ImportDeclaration: + const decl1 = node1 as ImportDeclaration; + const decl2 = node2 as ImportDeclaration; + assertEqual(decl1.importClause, decl2.importClause); + assertEqual(decl1.moduleSpecifier, decl2.moduleSpecifier); + break; + case SyntaxKind.ImportClause: + const clause1 = node1 as ImportClause; + const clause2 = node2 as ImportClause; + assertEqual(clause1.name, clause2.name); + assertEqual(clause1.namedBindings, clause2.namedBindings); + case SyntaxKind.NamespaceImport: + const nsi1 = node1 as NamespaceImport; + const nsi2 = node2 as NamespaceImport; + assertEqual(nsi1.name, nsi2.name); + break; + case SyntaxKind.NamedImports: + const ni1 = node1 as NamedImports; + const ni2 = node2 as NamedImports; + assertListEqual(ni1.elements, ni2.elements); + break; + case SyntaxKind.ImportSpecifier: + const is1 = node1 as ImportSpecifier; + const is2 = node2 as ImportSpecifier; + assertEqual(is1.name, is2.name); + assertEqual(is1.propertyName, is2.propertyName); + break; + case SyntaxKind.Identifier: + const id1 = node1 as Identifier; + const id2 = node2 as Identifier; + assert.equal(id1.text, id2.text); + break; + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + const sl1 = node1 as LiteralLikeNode; + const sl2 = node2 as LiteralLikeNode; + assert.equal(sl1.text, sl2.text); + break; + default: + assert.equal(node1.getText(), node2.getText()); + break; + } + } + + function assertListEqual(list1: ReadonlyArray, list2: ReadonlyArray) { + if (list1 === undefined || list2 === undefined) { + assert.isUndefined(list1); + assert.isUndefined(list2); + return; + } + + assert.equal(list1.length, list2.length); + for (let i = 0; i < list1.length; i++) { + assertEqual(list1[i], list2[i]); + } + } + + function reverse(list: ReadonlyArray) { + const result = []; + for (let i = list.length - 1; i >= 0; i--) { + result.push(list[i]); + } + return result; + } + }); +} \ No newline at end of file diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 7d1e5b0816c..765fc29ee49 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -262,6 +262,8 @@ namespace ts.server { CommandNames.GetApplicableRefactors, CommandNames.GetEditsForRefactor, CommandNames.GetEditsForRefactorFull, + CommandNames.OrganizeImports, + CommandNames.OrganizeImportsFull, ]; it("should not throw when commands are executed with invalid arguments", () => { diff --git a/src/server/client.ts b/src/server/client.ts index 8203475b06d..cee65c0e5a4 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -629,6 +629,10 @@ namespace ts.server { }; } + organizeImports(_scope: OrganizeImportsScope, _formatOptions: FormatCodeSettings): ReadonlyArray { + return notImplemented(); + } + private convertCodeEditsToTextChanges(edits: protocol.FileCodeEdits[]): FileTextChanges[] { return edits.map(edit => { const fileName = edit.fileName; diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 45c08034e6e..fbff4501133 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -113,6 +113,10 @@ namespace ts.server.protocol { /* @internal */ GetEditsForRefactorFull = "getEditsForRefactor-full", + OrganizeImports = "organizeImports", + /* @internal */ + OrganizeImportsFull = "organizeImports-full", + // NOTE: If updating this, be sure to also update `allCommandNames` in `harness/unittests/session.ts`. } @@ -547,6 +551,27 @@ namespace ts.server.protocol { renameFilename?: string; } + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ + export interface OrganizeImportsRequest extends Request { + command: CommandTypes.OrganizeImports; + arguments: OrganizeImportsRequestArgs; + } + + export type OrganizeImportsScope = GetCombinedCodeFixScope; + + export interface OrganizeImportsRequestArgs { + scope: OrganizeImportsScope; + } + + export interface OrganizeImportsResponse extends Response { + edits: ReadonlyArray; + } + /** * Request for the available codefixes at a specific position. */ diff --git a/src/server/session.ts b/src/server/session.ts index 356ea0d254e..bff19d7bc23 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1597,6 +1597,19 @@ namespace ts.server { } } + private organizeImports({ scope }: protocol.OrganizeImportsRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { + Debug.assert(scope.type === "file"); + const { file, project } = this.getFileAndProject(scope.args); + const formatOptions = this.projectService.getFormatCodeOptions(file); + const changes = project.getLanguageService().organizeImports({ type: "file", fileName: file }, formatOptions); + if (simplifiedResult) { + return this.mapTextChangesToCodeEdits(project, changes); + } + else { + return changes; + } + } + private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { if (args.errorCodes.length === 0) { return undefined; @@ -2041,6 +2054,12 @@ namespace ts.server { }, [CommandNames.GetEditsForRefactorFull]: (request: protocol.GetEditsForRefactorRequest) => { return this.requiredResponse(this.getEditsForRefactor(request.arguments, /*simplifiedResult*/ false)); + }, + [CommandNames.OrganizeImports]: (request: protocol.OrganizeImportsRequest) => { + return this.requiredResponse(this.organizeImports(request.arguments, /*simplifiedResult*/ true)); + }, + [CommandNames.OrganizeImportsFull]: (request: protocol.OrganizeImportsRequest) => { + return this.requiredResponse(this.organizeImports(request.arguments, /*simplifiedResult*/ false)); } }); diff --git a/src/services/services.ts b/src/services/services.ts index 6df52dd804e..22692f818e9 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1848,6 +1848,58 @@ namespace ts { return codefix.getAllFixes({ fixId, sourceFile, program, host, cancellationToken, formatContext }); } + function organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray { + synchronizeHostData(); + Debug.assert(scope.type === "file"); + const sourceFile = getValidSourceFile(scope.fileName); + const formatContext = formatting.getFormatContext(formatOptions); + + // All of the (old) ImportDeclarations in the file, in syntactic order. + const oldImportDecls: ImportDeclaration[] = []; + + forEachChild(sourceFile, node => { + cancellationToken.throwIfCancellationRequested(); + if (isImportDeclaration(node)) { + oldImportDecls.push(node); + } + // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) + }); + + if (oldImportDecls.length === 0) { + return []; + } + + const usedImportDecls = removeUnusedImports(oldImportDecls); + const sortedImportDecls = sortImports(usedImportDecls); + const coalescedImportDecls = coalesceImports(sortedImportDecls); + + // All of the (new) ImportDeclarations in the file, in sorted order. + const newImportDecls = coalescedImportDecls; + + const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); + + // NB: Stopping before i === 0 + for (let i = oldImportDecls.length - 1; i > 0; i--) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Delete the surrounding trivia because it will have been retained in newImportDecls. + const replaceOptions = { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: getNewLineOrDefaultFromHost(host, formatOptions), + }; + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, replaceOptions); + } + + const changes = changeTracker.getChanges(); + return changes; + } + function applyCodeActionCommand(action: CodeActionCommand): Promise; function applyCodeActionCommand(action: CodeActionCommand[]): Promise; function applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[]): Promise; @@ -2143,6 +2195,7 @@ namespace ts { getCodeFixesAtPosition, getCombinedCodeFix, applyCodeActionCommand, + organizeImports, getEmitOutput, getNonBoundSourceFile, getSourceFile, @@ -2268,4 +2321,238 @@ namespace ts { } objectAllocator = getServicesObjectAllocator(); + + function removeUnusedImports(oldImports: ReadonlyArray) { + return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) + } + + /* @internal */ // Internal for testing + export function sortImports(oldImports: ReadonlyArray) { + if (oldImports.length < 2) { + return oldImports; + } + + // NB: declaration order determines sort order + const enum ModuleNameKind { + NonRelative, + Relative, + Invalid, + } + + const importRecords = oldImports.map(createImportRecord); + + const sortedRecords = stableSort(importRecords, (import1, import2) => { + const { name: name1, kind: kind1 } = import1; + const { name: name2, kind: kind2 } = import2; + + if (kind1 !== kind2) { + return kind1 < kind2 + ? Comparison.LessThan + : Comparison.GreaterThan; + } + + // Note that we're using simple equality, retaining case-sensitivity. + if (name1 !== name2) { + return name1 < name2 + ? Comparison.LessThan + : Comparison.GreaterThan; + } + + return Comparison.EqualTo; + }); + + return sortedRecords.map(r => r.importDeclaration); + + function createImportRecord(importDeclaration: ImportDeclaration) { + const specifier = importDeclaration.moduleSpecifier; + const name = getExternalModuleName(specifier); + if (name) { + const isRelative = isExternalModuleNameRelative(name); + return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative } + } + + return { importDeclaration, name: specifier.getText(), kind: ModuleNameKind.Invalid }; + } + } + + function getExternalModuleName(specifier: Expression) { + return isStringLiteral(specifier) || isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + + /** + * @param sortedImports a non-empty list of ImportDeclarations, sorted by module name. + */ + function groupSortedImports(sortedImports: ReadonlyArray): ReadonlyArray> { + Debug.assert(length(sortedImports) > 0); + + const groups: ImportDeclaration[][] = []; + + let groupName: string | undefined = getExternalModuleName(sortedImports[0].moduleSpecifier); + let group: ImportDeclaration[] = []; + + for (const importDeclaration of sortedImports) { + const moduleName = getExternalModuleName(importDeclaration.moduleSpecifier); + if (moduleName && moduleName === groupName) { + group.push(importDeclaration); + } + else if (group.length) { + groups.push(group); + + groupName = moduleName; + group = [importDeclaration]; + } + } + + if (group.length) { + groups.push(group); + } + + return groups; + } + + /* @internal */ // Internal for testing + /** + * @param sortedImports a list of ImportDeclarations, sorted by module name. + */ + export function coalesceImports(sortedImports: ReadonlyArray) { + if (sortedImports.length === 0) { + return sortedImports; + } + + const coalescedImports: ImportDeclaration[] = []; + + const groupedImports = groupSortedImports(sortedImports); + for (const importGroup of groupedImports) { + + let seenImportWithoutClause = false; + + const defaultImports: Identifier[] = []; + const namespaceImports: NamespaceImport[] = []; + const namedImports: NamedImports[] = []; + + for (const importDeclaration of importGroup) { + if (importDeclaration.importClause === undefined) { + // Only the first such import is interesting - the others are redundant. + // Note: Unfortunately, we will lose trivia that was on this node. + if (!seenImportWithoutClause) { + coalescedImports.push(importDeclaration); + } + + seenImportWithoutClause = true; + continue; + } + + const { name, namedBindings } = importDeclaration.importClause; + + if (name) { + defaultImports.push(name); + } + + if (namedBindings) { + if (isNamespaceImport(namedBindings)) { + namespaceImports.push(namedBindings); + } + else { + namedImports.push(namedBindings); + } + } + } + + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + const defaultImportClause = defaultImports[0].parent as ImportClause; + coalescedImports.push( + updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + + continue; + } + + // For convenience, we cheat and do a little sorting during coalescing. + // Seems reasonable since we're restructuring so much anyway. + const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); + + for (const namespaceImport of sortedNamespaceImports) { + // Drop the name, if any + coalescedImports.push( + updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + } + + if (defaultImports.length === 0 && namedImports.length === 0) { + continue; + } + + let newDefaultImport: Identifier = undefined; + const newImportSpecifiers: ImportSpecifier[] = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (const defaultImport of defaultImports) { + newImportSpecifiers.push( + createImportSpecifier(createIdentifier("default"), defaultImport)); + } + } + + for (const namedImport of namedImports) { + for (const specifier of namedImport.elements) { + newImportSpecifiers.push(specifier); + } + } + + const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => { + const nameComparison = compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name); + return nameComparison != Comparison.EqualTo + ? nameComparison + : compareIdentifiers(s1.name, s2.name); + }); + + const importClause = defaultImports.length > 0 + ? defaultImports[0].parent as ImportClause + : namedImports[0].parent; + + const newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? createNamedImports(sortedImportSpecifiers) + : updateNamedImports(namedImports[0], sortedImportSpecifiers); + + coalescedImports.push( + updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + } + + return coalescedImports; + + // `undefined` is the min value. + function compareIdentifiers(s1: Identifier | undefined, s2: Identifier | undefined) { + return s1 === undefined + ? s2 === undefined + ? Comparison.EqualTo + : Comparison.LessThan + : s2 === undefined + ? Comparison.GreaterThan + : s1.text < s2.text + ? Comparison.LessThan + : s1.text > s2.text + ? Comparison.GreaterThan + : Comparison.EqualTo; + } + + function updateImportDeclarationAndClause( + importClause: ImportClause, + name: Identifier | undefined, + namedBindings: NamedImportBindings | undefined) { + + const importDeclaration = importClause.parent; + return updateImportDeclaration( + importDeclaration, + importDeclaration.decorators, + importDeclaration.modifiers, + updateImportClause(importClause, name, namedBindings), + importDeclaration.moduleSpecifier); + } + } } diff --git a/src/services/types.ts b/src/services/types.ts index 594484e1ea7..51710c88f4f 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -308,6 +308,7 @@ namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; + organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; @@ -326,6 +327,8 @@ namespace ts { export interface CombinedCodeFixScope { type: "file"; fileName: string; } + export type OrganizeImportsScope = CombinedCodeFixScope; + export interface GetCompletionsAtPositionOptions { includeExternalModuleExports: boolean; includeInsertTextCompletions: boolean; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 370d841a7f1..1a7edaa44c8 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4135,6 +4135,7 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; + organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; @@ -4143,6 +4144,7 @@ declare namespace ts { type: "file"; fileName: string; } + type OrganizeImportsScope = CombinedCodeFixScope; interface GetCompletionsAtPositionOptions { includeExternalModuleExports: boolean; includeInsertTextCompletions: boolean; @@ -5078,6 +5080,7 @@ declare namespace ts.server.protocol { GetSupportedCodeFixes = "getSupportedCodeFixes", GetApplicableRefactors = "getApplicableRefactors", GetEditsForRefactor = "getEditsForRefactor", + OrganizeImports = "organizeImports", } /** * A TypeScript Server message @@ -5429,6 +5432,23 @@ declare namespace ts.server.protocol { renameLocation?: Location; renameFilename?: string; } + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ + interface OrganizeImportsRequest extends Request { + command: CommandTypes.OrganizeImports; + arguments: OrganizeImportsRequestArgs; + } + type OrganizeImportsScope = GetCombinedCodeFixScope; + interface OrganizeImportsRequestArgs { + scope: OrganizeImportsScope; + } + interface OrganizeImportsResponse extends Response { + edits: ReadonlyArray; + } /** * Request for the available codefixes at a specific position. */ @@ -7282,6 +7302,7 @@ declare namespace ts.server { private extractPositionAndRange(args, scriptInfo); private getApplicableRefactors(args); private getEditsForRefactor(args, simplifiedResult); + private organizeImports({scope}, simplifiedResult); private getCodeFixes(args, simplifiedResult); private getCombinedCodeFix({scope, fixId}, simplifiedResult); private applyCodeActionCommand(args); diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index baed457b3b0..8f9c095090d 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4387,6 +4387,7 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; + organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; @@ -4395,6 +4396,7 @@ declare namespace ts { type: "file"; fileName: string; } + type OrganizeImportsScope = CombinedCodeFixScope; interface GetCompletionsAtPositionOptions { includeExternalModuleExports: boolean; includeInsertTextCompletions: boolean; diff --git a/tests/baselines/reference/organizeImports/CoalesceTrivia.ts b/tests/baselines/reference/organizeImports/CoalesceTrivia.ts new file mode 100644 index 00000000000..972df9e18eb --- /dev/null +++ b/tests/baselines/reference/organizeImports/CoalesceTrivia.ts @@ -0,0 +1,15 @@ +// ==ORIGINAL== + +/*A*/import /*B*/ { /*C*/ F2 /*D*/ } /*E*/ from /*F*/ "lib" /*G*/;/*H*/ //I +/*J*/import /*K*/ { /*L*/ F1 /*M*/ } /*N*/ from /*O*/ "lib" /*P*/;/*Q*/ //R + +F1(); +F2(); + +// ==ORGANIZED== + +/*A*/ import { /*L*/ F1 /*M*/, /*C*/ F2 /*D*/ } /*E*/ from "lib" /*G*/; /*H*/ //I + + +F1(); +F2(); diff --git a/tests/baselines/reference/organizeImports/MoveToTop.ts b/tests/baselines/reference/organizeImports/MoveToTop.ts new file mode 100644 index 00000000000..c0e57b930ab --- /dev/null +++ b/tests/baselines/reference/organizeImports/MoveToTop.ts @@ -0,0 +1,18 @@ +// ==ORIGINAL== + +import { F1, F2 } from "lib"; +F1(); +F2(); +import * as NS from "lib"; +NS.F1(); +import D from "lib"; +D(); + +// ==ORGANIZED== + +import * as NS from "lib"; +import D, { F1, F2 } from "lib"; +F1(); +F2(); +NS.F1(); +D(); diff --git a/tests/baselines/reference/organizeImports/Simple.ts b/tests/baselines/reference/organizeImports/Simple.ts new file mode 100644 index 00000000000..3f36ae633a6 --- /dev/null +++ b/tests/baselines/reference/organizeImports/Simple.ts @@ -0,0 +1,20 @@ +// ==ORIGINAL== + +import { F1, F2 } from "lib"; +import * as NS from "lib"; +import D from "lib"; + +NS.F1(); +D(); +F1(); +F2(); + +// ==ORGANIZED== + +import * as NS from "lib"; +import D, { F1, F2 } from "lib"; + +NS.F1(); +D(); +F1(); +F2(); diff --git a/tests/baselines/reference/organizeImports/SortTrivia.ts b/tests/baselines/reference/organizeImports/SortTrivia.ts new file mode 100644 index 00000000000..e46c836b966 --- /dev/null +++ b/tests/baselines/reference/organizeImports/SortTrivia.ts @@ -0,0 +1,10 @@ +// ==ORIGINAL== + +/*A*/import /*B*/ "lib2" /*C*/;/*D*/ //E +/*F*/import /*G*/ "lib1" /*H*/;/*I*/ //J + +// ==ORGANIZED== + +/*F*/ import "lib1" /*H*/; /*I*/ //J +/*A*/ import "lib2" /*C*/; /*D*/ //E + From 979b14689e1abb9f7ba6e314b163496bd0008ca3 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Mon, 12 Feb 2018 18:29:01 -0800 Subject: [PATCH 160/298] Fix lint errors --- src/harness/unittests/organizeImports.ts | 7 ++++++- src/services/services.ts | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts index 5cac601d08e..e78a88ca232 100644 --- a/src/harness/unittests/organizeImports.ts +++ b/src/harness/unittests/organizeImports.ts @@ -56,7 +56,9 @@ namespace ts { it("Sort - invalid vs invalid", () => { assertSortsBefore( + // tslint:disable-next-line no-invalid-template-strings "import y from `${'lib1'}`;", + // tslint:disable-next-line no-invalid-template-strings "import x from `${'lib2'}`;"); }); @@ -69,12 +71,14 @@ namespace ts { it("Sort - non-relative vs invalid", () => { assertSortsBefore( `import y from "lib";`, + // tslint:disable-next-line no-invalid-template-strings "import x from `${'lib'}`;"); }); it("Sort - relative vs invalid", () => { assertSortsBefore( `import y from "./lib";`, + // tslint:disable-next-line no-invalid-template-strings "import x from `${'lib'}`;"); }); @@ -357,7 +361,7 @@ F2(); assert.equal(node1.kind, node2.kind); - switch(node1.kind) { + switch (node1.kind) { case SyntaxKind.ImportDeclaration: const decl1 = node1 as ImportDeclaration; const decl2 = node2 as ImportDeclaration; @@ -369,6 +373,7 @@ F2(); const clause2 = node2 as ImportClause; assertEqual(clause1.name, clause2.name); assertEqual(clause1.namedBindings, clause2.namedBindings); + break; case SyntaxKind.NamespaceImport: const nsi1 = node1 as NamespaceImport; const nsi2 = node2 as NamespaceImport; diff --git a/src/services/services.ts b/src/services/services.ts index 22692f818e9..3b984c2e159 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2368,7 +2368,7 @@ namespace ts { const name = getExternalModuleName(specifier); if (name) { const isRelative = isExternalModuleNameRelative(name); - return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative } + return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative }; } return { importDeclaration, name: specifier.getText(), kind: ModuleNameKind.Invalid }; @@ -2505,7 +2505,7 @@ namespace ts { const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => { const nameComparison = compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name); - return nameComparison != Comparison.EqualTo + return nameComparison !== Comparison.EqualTo ? nameComparison : compareIdentifiers(s1.name, s2.name); }); From f4141ac6bfd726becafb9eef00adb79afbc1f027 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 13 Feb 2018 14:52:15 -0800 Subject: [PATCH 161/298] Separate OrganizeImports into its own namespace and file --- src/harness/unittests/organizeImports.ts | 42 ++-- src/services/organizeImports.ts | 291 +++++++++++++++++++++++ src/services/services.ts | 280 +--------------------- 3 files changed, 314 insertions(+), 299 deletions(-) create mode 100644 src/services/organizeImports.ts diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts index e78a88ca232..eaa21bbb72f 100644 --- a/src/harness/unittests/organizeImports.ts +++ b/src/harness/unittests/organizeImports.ts @@ -6,12 +6,12 @@ namespace ts { describe("Organize imports", () => { describe("Sort imports", () => { it("No imports", () => { - assert.isEmpty(sortImports([])); + assert.isEmpty(OrganizeImports.sortImports([])); }); it("One import", () => { const unsortedImports = parseImports(`import "lib";`); - const actualSortedImports = sortImports(unsortedImports); + const actualSortedImports = OrganizeImports.sortImports(unsortedImports); const expectedSortedImports = unsortedImports; assertListEqual(expectedSortedImports, actualSortedImports); }); @@ -84,27 +84,27 @@ namespace ts { function assertUnaffectedBySort(...importStrings: string[]) { const unsortedImports1 = parseImports(...importStrings); - assertListEqual(unsortedImports1, sortImports(unsortedImports1)); + assertListEqual(unsortedImports1, OrganizeImports.sortImports(unsortedImports1)); const unsortedImports2 = reverse(unsortedImports1); - assertListEqual(unsortedImports2, sortImports(unsortedImports2)); + assertListEqual(unsortedImports2, OrganizeImports.sortImports(unsortedImports2)); } function assertSortsBefore(importString1: string, importString2: string) { const imports = parseImports(importString1, importString2); - assertListEqual(imports, sortImports(imports)); - assertListEqual(imports, sortImports(reverse(imports))); + assertListEqual(imports, OrganizeImports.sortImports(imports)); + assertListEqual(imports, OrganizeImports.sortImports(reverse(imports))); } }); describe("Coalesce imports", () => { it("No imports", () => { - assert.isEmpty(coalesceImports([])); + assert.isEmpty(OrganizeImports.coalesceImports([])); }); it("Sort specifiers", () => { const sortedImports = parseImports(`import { default as m, a as n, b, y, z as o } from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import { a as n, b, default as m, y, z as o } from "lib";`); assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -113,7 +113,7 @@ namespace ts { const sortedImports = parseImports( `import "lib";`, `import "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import "lib";`); assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -122,7 +122,7 @@ namespace ts { const sortedImports = parseImports( `import * as x from "lib";`, `import * as y from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -131,7 +131,7 @@ namespace ts { const sortedImports = parseImports( `import x from "lib";`, `import y from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import { default as x, default as y } from "lib";`); assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -140,7 +140,7 @@ namespace ts { const sortedImports = parseImports( `import { x } from "lib";`, `import { y as z } from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import { x, y as z } from "lib";`); assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -149,7 +149,7 @@ namespace ts { const sortedImports = parseImports( `import "lib";`, `import * as x from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -158,7 +158,7 @@ namespace ts { const sortedImports = parseImports( `import "lib";`, `import x from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -167,7 +167,7 @@ namespace ts { const sortedImports = parseImports( `import "lib";`, `import { x } from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -176,7 +176,7 @@ namespace ts { const sortedImports = parseImports( `import * as x from "lib";`, `import y from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports( `import y, * as x from "lib";`); assertListEqual(expectedCoalescedImports, actualCoalescedImports); @@ -186,7 +186,7 @@ namespace ts { const sortedImports = parseImports( `import * as x from "lib";`, `import { y } from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); @@ -195,7 +195,7 @@ namespace ts { const sortedImports = parseImports( `import x from "lib";`, `import { y } from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports( `import x, { y } from "lib";`); assertListEqual(expectedCoalescedImports, actualCoalescedImports); @@ -211,7 +211,7 @@ namespace ts { `import * as x from "lib";`, `import z from "lib";`, `import { a } from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports( `import "lib";`, `import * as x from "lib";`, @@ -226,7 +226,7 @@ namespace ts { `import { b } from "lib1";`, `import { c } from "lib2";`, `import { a } from "lib2";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports( `import { b, d } from "lib1";`, `import { a, c } from "lib2";`); @@ -239,7 +239,7 @@ namespace ts { `import * as x from "lib";`, `import * as y from "lib";`, `import z from "lib";`); - const actualCoalescedImports = coalesceImports(sortedImports); + const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; assertListEqual(expectedCoalescedImports, actualCoalescedImports); }); diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts new file mode 100644 index 00000000000..aaff3331941 --- /dev/null +++ b/src/services/organizeImports.ts @@ -0,0 +1,291 @@ +/* @internal */ +namespace ts.OrganizeImports { + export function organizeImports( + sourceFile: SourceFile, + formatContext: formatting.FormatContext, + host: LanguageServiceHost, + cancellationToken: CancellationToken) { + + // All of the (old) ImportDeclarations in the file, in syntactic order. + const oldImportDecls: ImportDeclaration[] = []; + + forEachChild(sourceFile, node => { + cancellationToken.throwIfCancellationRequested(); + if (isImportDeclaration(node)) { + oldImportDecls.push(node); + } + // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) + }); + + if (oldImportDecls.length === 0) { + return []; + } + + const usedImportDecls = removeUnusedImports(oldImportDecls); + cancellationToken.throwIfCancellationRequested(); + const sortedImportDecls = sortImports(usedImportDecls); + cancellationToken.throwIfCancellationRequested(); + const coalescedImportDecls = coalesceImports(sortedImportDecls); + cancellationToken.throwIfCancellationRequested(); + + // All of the (new) ImportDeclarations in the file, in sorted order. + const newImportDecls = coalescedImportDecls; + + const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); + + // NB: Stopping before i === 0 + for (let i = oldImportDecls.length - 1; i > 0; i--) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Delete the surrounding trivia because it will have been retained in newImportDecls. + const replaceOptions = { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: getNewLineOrDefaultFromHost(host, formatContext.options), + }; + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, replaceOptions); + } + + const changes = changeTracker.getChanges(); + return changes; + } + + function removeUnusedImports(oldImports: ReadonlyArray) { + return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) + } + + /* @internal */ // Internal for testing + export function sortImports(oldImports: ReadonlyArray) { + if (oldImports.length < 2) { + return oldImports; + } + + // NB: declaration order determines sort order + const enum ModuleNameKind { + NonRelative, + Relative, + Invalid, + } + + const importRecords = oldImports.map(createImportRecord); + + const sortedRecords = stableSort(importRecords, (import1, import2) => { + const { name: name1, kind: kind1 } = import1; + const { name: name2, kind: kind2 } = import2; + + if (kind1 !== kind2) { + return kind1 < kind2 + ? Comparison.LessThan + : Comparison.GreaterThan; + } + + // Note that we're using simple equality, retaining case-sensitivity. + if (name1 !== name2) { + return name1 < name2 + ? Comparison.LessThan + : Comparison.GreaterThan; + } + + return Comparison.EqualTo; + }); + + return sortedRecords.map(r => r.importDeclaration); + + function createImportRecord(importDeclaration: ImportDeclaration) { + const specifier = importDeclaration.moduleSpecifier; + const name = getExternalModuleName(specifier); + if (name) { + const isRelative = isExternalModuleNameRelative(name); + return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative }; + } + + return { importDeclaration, name: specifier.getText(), kind: ModuleNameKind.Invalid }; + } + } + + function getExternalModuleName(specifier: Expression) { + return isStringLiteral(specifier) || isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + + /** + * @param sortedImports a non-empty list of ImportDeclarations, sorted by module name. + */ + function groupSortedImports(sortedImports: ReadonlyArray): ReadonlyArray> { + Debug.assert(length(sortedImports) > 0); + + const groups: ImportDeclaration[][] = []; + + let groupName: string | undefined = getExternalModuleName(sortedImports[0].moduleSpecifier); + let group: ImportDeclaration[] = []; + + for (const importDeclaration of sortedImports) { + const moduleName = getExternalModuleName(importDeclaration.moduleSpecifier); + if (moduleName && moduleName === groupName) { + group.push(importDeclaration); + } + else if (group.length) { + groups.push(group); + + groupName = moduleName; + group = [importDeclaration]; + } + } + + if (group.length) { + groups.push(group); + } + + return groups; + } + + /* @internal */ // Internal for testing + /** + * @param sortedImports a list of ImportDeclarations, sorted by module name. + */ + export function coalesceImports(sortedImports: ReadonlyArray) { + if (sortedImports.length === 0) { + return sortedImports; + } + + const coalescedImports: ImportDeclaration[] = []; + + const groupedImports = groupSortedImports(sortedImports); + for (const importGroup of groupedImports) { + + let seenImportWithoutClause = false; + + const defaultImports: Identifier[] = []; + const namespaceImports: NamespaceImport[] = []; + const namedImports: NamedImports[] = []; + + for (const importDeclaration of importGroup) { + if (importDeclaration.importClause === undefined) { + // Only the first such import is interesting - the others are redundant. + // Note: Unfortunately, we will lose trivia that was on this node. + if (!seenImportWithoutClause) { + coalescedImports.push(importDeclaration); + } + + seenImportWithoutClause = true; + continue; + } + + const { name, namedBindings } = importDeclaration.importClause; + + if (name) { + defaultImports.push(name); + } + + if (namedBindings) { + if (isNamespaceImport(namedBindings)) { + namespaceImports.push(namedBindings); + } + else { + namedImports.push(namedBindings); + } + } + } + + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + const defaultImportClause = defaultImports[0].parent as ImportClause; + coalescedImports.push( + updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + + continue; + } + + // For convenience, we cheat and do a little sorting during coalescing. + // Seems reasonable since we're restructuring so much anyway. + const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); + + for (const namespaceImport of sortedNamespaceImports) { + // Drop the name, if any + coalescedImports.push( + updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + } + + if (defaultImports.length === 0 && namedImports.length === 0) { + continue; + } + + let newDefaultImport: Identifier = undefined; + const newImportSpecifiers: ImportSpecifier[] = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (const defaultImport of defaultImports) { + newImportSpecifiers.push( + createImportSpecifier(createIdentifier("default"), defaultImport)); + } + } + + for (const namedImport of namedImports) { + for (const specifier of namedImport.elements) { + newImportSpecifiers.push(specifier); + } + } + + const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => { + const nameComparison = compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name); + return nameComparison !== Comparison.EqualTo + ? nameComparison + : compareIdentifiers(s1.name, s2.name); + }); + + const importClause = defaultImports.length > 0 + ? defaultImports[0].parent as ImportClause + : namedImports[0].parent; + + const newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? createNamedImports(sortedImportSpecifiers) + : updateNamedImports(namedImports[0], sortedImportSpecifiers); + + coalescedImports.push( + updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + } + + return coalescedImports; + + // `undefined` is the min value. + function compareIdentifiers(s1: Identifier | undefined, s2: Identifier | undefined) { + return s1 === undefined + ? s2 === undefined + ? Comparison.EqualTo + : Comparison.LessThan + : s2 === undefined + ? Comparison.GreaterThan + : s1.text < s2.text + ? Comparison.LessThan + : s1.text > s2.text + ? Comparison.GreaterThan + : Comparison.EqualTo; + } + + function updateImportDeclarationAndClause( + importClause: ImportClause, + name: Identifier | undefined, + namedBindings: NamedImportBindings | undefined) { + + const importDeclaration = importClause.parent; + return updateImportDeclaration( + importDeclaration, + importDeclaration.decorators, + importDeclaration.modifiers, + updateImportClause(importClause, name, namedBindings), + importDeclaration.moduleSpecifier); + } + } +} \ No newline at end of file diff --git a/src/services/services.ts b/src/services/services.ts index 3b984c2e159..37cc192442f 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -14,6 +14,7 @@ /// /// /// +/// /// /// /// @@ -1854,50 +1855,7 @@ namespace ts { const sourceFile = getValidSourceFile(scope.fileName); const formatContext = formatting.getFormatContext(formatOptions); - // All of the (old) ImportDeclarations in the file, in syntactic order. - const oldImportDecls: ImportDeclaration[] = []; - - forEachChild(sourceFile, node => { - cancellationToken.throwIfCancellationRequested(); - if (isImportDeclaration(node)) { - oldImportDecls.push(node); - } - // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) - }); - - if (oldImportDecls.length === 0) { - return []; - } - - const usedImportDecls = removeUnusedImports(oldImportDecls); - const sortedImportDecls = sortImports(usedImportDecls); - const coalescedImportDecls = coalesceImports(sortedImportDecls); - - // All of the (new) ImportDeclarations in the file, in sorted order. - const newImportDecls = coalescedImportDecls; - - const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); - - // NB: Stopping before i === 0 - for (let i = oldImportDecls.length - 1; i > 0; i--) { - changeTracker.deleteNode(sourceFile, oldImportDecls[i]); - } - - if (newImportDecls.length === 0) { - changeTracker.deleteNode(sourceFile, oldImportDecls[0]); - } - else { - // Delete the surrounding trivia because it will have been retained in newImportDecls. - const replaceOptions = { - useNonAdjustedStartPosition: false, - useNonAdjustedEndPosition: false, - suffix: getNewLineOrDefaultFromHost(host, formatOptions), - }; - changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, replaceOptions); - } - - const changes = changeTracker.getChanges(); - return changes; + return OrganizeImports.organizeImports(sourceFile, formatContext, host, cancellationToken); } function applyCodeActionCommand(action: CodeActionCommand): Promise; @@ -2321,238 +2279,4 @@ namespace ts { } objectAllocator = getServicesObjectAllocator(); - - function removeUnusedImports(oldImports: ReadonlyArray) { - return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) - } - - /* @internal */ // Internal for testing - export function sortImports(oldImports: ReadonlyArray) { - if (oldImports.length < 2) { - return oldImports; - } - - // NB: declaration order determines sort order - const enum ModuleNameKind { - NonRelative, - Relative, - Invalid, - } - - const importRecords = oldImports.map(createImportRecord); - - const sortedRecords = stableSort(importRecords, (import1, import2) => { - const { name: name1, kind: kind1 } = import1; - const { name: name2, kind: kind2 } = import2; - - if (kind1 !== kind2) { - return kind1 < kind2 - ? Comparison.LessThan - : Comparison.GreaterThan; - } - - // Note that we're using simple equality, retaining case-sensitivity. - if (name1 !== name2) { - return name1 < name2 - ? Comparison.LessThan - : Comparison.GreaterThan; - } - - return Comparison.EqualTo; - }); - - return sortedRecords.map(r => r.importDeclaration); - - function createImportRecord(importDeclaration: ImportDeclaration) { - const specifier = importDeclaration.moduleSpecifier; - const name = getExternalModuleName(specifier); - if (name) { - const isRelative = isExternalModuleNameRelative(name); - return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative }; - } - - return { importDeclaration, name: specifier.getText(), kind: ModuleNameKind.Invalid }; - } - } - - function getExternalModuleName(specifier: Expression) { - return isStringLiteral(specifier) || isNoSubstitutionTemplateLiteral(specifier) - ? specifier.text - : undefined; - } - - /** - * @param sortedImports a non-empty list of ImportDeclarations, sorted by module name. - */ - function groupSortedImports(sortedImports: ReadonlyArray): ReadonlyArray> { - Debug.assert(length(sortedImports) > 0); - - const groups: ImportDeclaration[][] = []; - - let groupName: string | undefined = getExternalModuleName(sortedImports[0].moduleSpecifier); - let group: ImportDeclaration[] = []; - - for (const importDeclaration of sortedImports) { - const moduleName = getExternalModuleName(importDeclaration.moduleSpecifier); - if (moduleName && moduleName === groupName) { - group.push(importDeclaration); - } - else if (group.length) { - groups.push(group); - - groupName = moduleName; - group = [importDeclaration]; - } - } - - if (group.length) { - groups.push(group); - } - - return groups; - } - - /* @internal */ // Internal for testing - /** - * @param sortedImports a list of ImportDeclarations, sorted by module name. - */ - export function coalesceImports(sortedImports: ReadonlyArray) { - if (sortedImports.length === 0) { - return sortedImports; - } - - const coalescedImports: ImportDeclaration[] = []; - - const groupedImports = groupSortedImports(sortedImports); - for (const importGroup of groupedImports) { - - let seenImportWithoutClause = false; - - const defaultImports: Identifier[] = []; - const namespaceImports: NamespaceImport[] = []; - const namedImports: NamedImports[] = []; - - for (const importDeclaration of importGroup) { - if (importDeclaration.importClause === undefined) { - // Only the first such import is interesting - the others are redundant. - // Note: Unfortunately, we will lose trivia that was on this node. - if (!seenImportWithoutClause) { - coalescedImports.push(importDeclaration); - } - - seenImportWithoutClause = true; - continue; - } - - const { name, namedBindings } = importDeclaration.importClause; - - if (name) { - defaultImports.push(name); - } - - if (namedBindings) { - if (isNamespaceImport(namedBindings)) { - namespaceImports.push(namedBindings); - } - else { - namedImports.push(namedBindings); - } - } - } - - // Normally, we don't combine default and namespace imports, but it would be silly to - // produce two import declarations in this special case. - if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { - // Add the namespace import to the existing default ImportDeclaration. - const defaultImportClause = defaultImports[0].parent as ImportClause; - coalescedImports.push( - updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); - - continue; - } - - // For convenience, we cheat and do a little sorting during coalescing. - // Seems reasonable since we're restructuring so much anyway. - const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); - - for (const namespaceImport of sortedNamespaceImports) { - // Drop the name, if any - coalescedImports.push( - updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); - } - - if (defaultImports.length === 0 && namedImports.length === 0) { - continue; - } - - let newDefaultImport: Identifier = undefined; - const newImportSpecifiers: ImportSpecifier[] = []; - if (defaultImports.length === 1) { - newDefaultImport = defaultImports[0]; - } - else { - for (const defaultImport of defaultImports) { - newImportSpecifiers.push( - createImportSpecifier(createIdentifier("default"), defaultImport)); - } - } - - for (const namedImport of namedImports) { - for (const specifier of namedImport.elements) { - newImportSpecifiers.push(specifier); - } - } - - const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => { - const nameComparison = compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name); - return nameComparison !== Comparison.EqualTo - ? nameComparison - : compareIdentifiers(s1.name, s2.name); - }); - - const importClause = defaultImports.length > 0 - ? defaultImports[0].parent as ImportClause - : namedImports[0].parent; - - const newNamedImports = sortedImportSpecifiers.length === 0 - ? undefined - : namedImports.length === 0 - ? createNamedImports(sortedImportSpecifiers) - : updateNamedImports(namedImports[0], sortedImportSpecifiers); - - coalescedImports.push( - updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); - } - - return coalescedImports; - - // `undefined` is the min value. - function compareIdentifiers(s1: Identifier | undefined, s2: Identifier | undefined) { - return s1 === undefined - ? s2 === undefined - ? Comparison.EqualTo - : Comparison.LessThan - : s2 === undefined - ? Comparison.GreaterThan - : s1.text < s2.text - ? Comparison.LessThan - : s1.text > s2.text - ? Comparison.GreaterThan - : Comparison.EqualTo; - } - - function updateImportDeclarationAndClause( - importClause: ImportClause, - name: Identifier | undefined, - namedBindings: NamedImportBindings | undefined) { - - const importDeclaration = importClause.parent; - return updateImportDeclaration( - importDeclaration, - importDeclaration.decorators, - importDeclaration.modifiers, - updateImportClause(importClause, name, namedBindings), - importDeclaration.moduleSpecifier); - } - } } From 36a0550852790f727f01718721e8d005ee198f47 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 16 Feb 2018 10:52:38 -0800 Subject: [PATCH 162/298] Fix issues --- src/compiler/checker.ts | 37 ++++++++++++++++++------------------- src/compiler/types.ts | 2 -- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3965ac37cca..ed1fddd2fa0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6203,7 +6203,8 @@ namespace ts { return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } if (t.flags & TypeFlags.Conditional) { - return getBaseConstraint(getConstraintOfConditionalType(t)); + const constraint = getConstraintOfConditionalType(t); + return constraint && getBaseConstraint(constraint); } if (t.flags & TypeFlags.Substitution) { return getBaseConstraint((t).substitute); @@ -8237,14 +8238,13 @@ namespace ts { result.checkType = erasedCheckType; result.extendsType = extendsType; result.mapper = mapper; - result.trueTypeMapper = combinedMapper || mapper; result.aliasSymbol = root.aliasSymbol; result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper); return result; } function getTrueTypeFromConditionalType(type: ConditionalType) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getRootTrueType(type.root), type.trueTypeMapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getRootTrueType(type.root), type.mapper)); } function getFalseTypeFromConditionalType(type: ConditionalType) { @@ -8885,10 +8885,6 @@ namespace ts { let result = root.instantiations.get(id); if (!result) { const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments); - // sys.write(`${map(root.outerTypeParameters, t => typeToString(t)).join(",")} ===> ${map(typeArguments, t => typeToString(t)).join(",")}\n`); - // if (every(typeArguments, t => t === wildcardType)) { - // root.instantiations.set(id, wildcardType); - // } result = instantiateConditionalType(root, newMapper); root.instantiations.set(id, result); } @@ -10110,15 +10106,6 @@ namespace ts { } } else if (source.flags & TypeFlags.Conditional) { - if (relation !== definitelyAssignableRelation) { - const constraint = getConstraintOfDistributiveConditionalType(source); - if (constraint) { - if (result = isRelatedTo(constraint, target, reportErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - } if (target.flags & TypeFlags.Conditional) { if (isTypeIdenticalTo((source).checkType, (target).checkType) && isTypeIdenticalTo((source).extendsType, (target).extendsType)) { @@ -10131,9 +10118,21 @@ namespace ts { } } } - else if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (relation !== definitelyAssignableRelation) { + const distributiveConstraint = getConstraintOfDistributiveConditionalType(source); + if (distributiveConstraint) { + if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + const defaultConstraint = getDefaultConstraintOfConditionalType(source); + if (defaultConstraint) { + if (result = isRelatedTo(defaultConstraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } else { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2c73182a2c0..cc57d1215f7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3834,8 +3834,6 @@ namespace ts { resolvedFalseType?: Type; /* @internal */ mapper?: TypeMapper; - /* @internal */ - trueTypeMapper?: TypeMapper; } // Type parameter substitution (TypeFlags.Substitution) From 5c278cee17008877f3805f70a214e17ba3f37949 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 14 Feb 2018 13:57:09 -0800 Subject: [PATCH 163/298] Address PR feedback Eliminate cancellation token Add organizeImports.ts to tsconfig.json Simplify ts.OrganizeImports.organizeImports Simplify sortImports Semantic change: all invalid module specifiers are now considered to be equal. Simplify comparisons using || Pull out imports with invalid modules specifiers ...for separate processing. They are tacked on to the end of the organized imports in their original order. Bonus: downstream functions can now assume imports have valid module specifiers. Rename baseline folder with leading lowercase Simplify coalesceImports Remove some unnecessary null checks Simplify baseline generation --- src/compiler/core.ts | 5 + src/harness/unittests/organizeImports.ts | 55 ++-- src/services/organizeImports.ts | 259 +++++++----------- src/services/services.ts | 2 +- src/services/tsconfig.json | 1 + .../organizeImports/MoveToTop_Invalid.ts | 22 ++ 6 files changed, 155 insertions(+), 189 deletions(-) create mode 100644 tests/baselines/reference/organizeImports/MoveToTop_Invalid.ts diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 212fa86b366..698824fa9b0 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1905,6 +1905,11 @@ namespace ts { Comparison.EqualTo; } + /** True is greater than false. */ + export function compareBooleans(a: boolean, b: boolean): Comparison { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + function compareMessageText(text1: string | DiagnosticMessageChain, text2: string | DiagnosticMessageChain): Comparison { while (text1 && text2) { // We still have both chains. diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts index eaa21bbb72f..2accc84d43f 100644 --- a/src/harness/unittests/organizeImports.ts +++ b/src/harness/unittests/organizeImports.ts @@ -54,34 +54,12 @@ namespace ts { `import x from "./lib2";`); }); - it("Sort - invalid vs invalid", () => { - assertSortsBefore( - // tslint:disable-next-line no-invalid-template-strings - "import y from `${'lib1'}`;", - // tslint:disable-next-line no-invalid-template-strings - "import x from `${'lib2'}`;"); - }); - it("Sort - relative vs non-relative", () => { assertSortsBefore( `import y from "lib";`, `import x from "./lib";`); }); - it("Sort - non-relative vs invalid", () => { - assertSortsBefore( - `import y from "lib";`, - // tslint:disable-next-line no-invalid-template-strings - "import x from `${'lib'}`;"); - }); - - it("Sort - relative vs invalid", () => { - assertSortsBefore( - `import y from "./lib";`, - // tslint:disable-next-line no-invalid-template-strings - "import x from `${'lib'}`;"); - }); - function assertUnaffectedBySort(...importStrings: string[]) { const unsortedImports1 = parseImports(...importStrings); assertListEqual(unsortedImports1, OrganizeImports.sortImports(unsortedImports1)); @@ -286,6 +264,25 @@ D(); }, libFile); + // tslint:disable no-invalid-template-strings + testOrganizeImports("MoveToTop_Invalid", + { + path: "/test.ts", + content: ` +import { F1, F2 } from "lib"; +F1(); +F2(); +import * as NS from "lib"; +NS.F1(); +import b from ${"`${'lib'}`"}; +import a from ${"`${'lib'}`"}; +import D from "lib"; +D(); +`, + }, + libFile); + // tslint:enable no-invalid-template-strings + testOrganizeImports("CoalesceTrivia", { path: "/test.ts", @@ -322,15 +319,13 @@ F2(); assert.equal(testPath, changes[0].fileName); Harness.Baseline.runBaseline(baselinePath, () => { - const data: string[] = []; - data.push(`// ==ORIGINAL==`); - data.push(testContent); - - data.push(`// ==ORGANIZED==`); const newText = textChanges.applyChanges(testContent, changes[0].textChanges); - data.push(newText); - - return data.join(newLineCharacter); + return [ + "// ==ORIGINAL==", + testContent, + "// ==ORGANIZED==", + newText, + ].join(newLineCharacter); }); } diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index aaff3331941..d6b782a19aa 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -3,56 +3,44 @@ namespace ts.OrganizeImports { export function organizeImports( sourceFile: SourceFile, formatContext: formatting.FormatContext, - host: LanguageServiceHost, - cancellationToken: CancellationToken) { + host: LanguageServiceHost) { - // All of the (old) ImportDeclarations in the file, in syntactic order. - const oldImportDecls: ImportDeclaration[] = []; + // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) - forEachChild(sourceFile, node => { - cancellationToken.throwIfCancellationRequested(); - if (isImportDeclaration(node)) { - oldImportDecls.push(node); - } - // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) - }); + // All of the old ImportDeclarations in the file, in syntactic order. + const oldImportDecls = sourceFile.statements.filter(isImportDeclaration); if (oldImportDecls.length === 0) { return []; } - const usedImportDecls = removeUnusedImports(oldImportDecls); - cancellationToken.throwIfCancellationRequested(); - const sortedImportDecls = sortImports(usedImportDecls); - cancellationToken.throwIfCancellationRequested(); - const coalescedImportDecls = coalesceImports(sortedImportDecls); - cancellationToken.throwIfCancellationRequested(); + const oldValidImportDecls = oldImportDecls.filter(importDecl => getExternalModuleName(importDecl.moduleSpecifier)); + const oldInvalidImportDecls = oldImportDecls.filter(importDecl => !getExternalModuleName(importDecl.moduleSpecifier)); - // All of the (new) ImportDeclarations in the file, in sorted order. - const newImportDecls = coalescedImportDecls; + // All of the new ImportDeclarations in the file, in sorted order. + const newImportDecls = coalesceImports(sortImports(removeUnusedImports(oldValidImportDecls))).concat(oldInvalidImportDecls); const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); - // NB: Stopping before i === 0 - for (let i = oldImportDecls.length - 1; i > 0; i--) { - changeTracker.deleteNode(sourceFile, oldImportDecls[i]); - } - + // Delete or replace the first import. if (newImportDecls.length === 0) { changeTracker.deleteNode(sourceFile, oldImportDecls[0]); } else { - // Delete the surrounding trivia because it will have been retained in newImportDecls. - const replaceOptions = { + // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { useNonAdjustedStartPosition: false, useNonAdjustedEndPosition: false, suffix: getNewLineOrDefaultFromHost(host, formatContext.options), - }; - changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, replaceOptions); + }); } - const changes = changeTracker.getChanges(); - return changes; + // Delete any subsequent imports. + for (let i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + + return changeTracker.getChanges(); } function removeUnusedImports(oldImports: ReadonlyArray) { @@ -61,51 +49,14 @@ namespace ts.OrganizeImports { /* @internal */ // Internal for testing export function sortImports(oldImports: ReadonlyArray) { - if (oldImports.length < 2) { - return oldImports; - } - - // NB: declaration order determines sort order - const enum ModuleNameKind { - NonRelative, - Relative, - Invalid, - } - - const importRecords = oldImports.map(createImportRecord); - - const sortedRecords = stableSort(importRecords, (import1, import2) => { - const { name: name1, kind: kind1 } = import1; - const { name: name2, kind: kind2 } = import2; - - if (kind1 !== kind2) { - return kind1 < kind2 - ? Comparison.LessThan - : Comparison.GreaterThan; - } - - // Note that we're using simple equality, retaining case-sensitivity. - if (name1 !== name2) { - return name1 < name2 - ? Comparison.LessThan - : Comparison.GreaterThan; - } - - return Comparison.EqualTo; + return stableSort(oldImports, (import1, import2) => { + const name1 = getExternalModuleName(import1.moduleSpecifier); + const name2 = getExternalModuleName(import2.moduleSpecifier); + Debug.assert(name1 !== undefined); + Debug.assert(name2 !== undefined); + return compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || + compareStringsCaseSensitive(name1, name2); }); - - return sortedRecords.map(r => r.importDeclaration); - - function createImportRecord(importDeclaration: ImportDeclaration) { - const specifier = importDeclaration.moduleSpecifier; - const name = getExternalModuleName(specifier); - if (name) { - const isRelative = isExternalModuleNameRelative(name); - return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative }; - } - - return { importDeclaration, name: specifier.getText(), kind: ModuleNameKind.Invalid }; - } } function getExternalModuleName(specifier: Expression) { @@ -123,11 +74,13 @@ namespace ts.OrganizeImports { const groups: ImportDeclaration[][] = []; let groupName: string | undefined = getExternalModuleName(sortedImports[0].moduleSpecifier); + Debug.assert(groupName !== undefined); let group: ImportDeclaration[] = []; for (const importDeclaration of sortedImports) { const moduleName = getExternalModuleName(importDeclaration.moduleSpecifier); - if (moduleName && moduleName === groupName) { + Debug.assert(moduleName !== undefined); + if (moduleName === groupName) { group.push(importDeclaration); } else if (group.length) { @@ -159,8 +112,71 @@ namespace ts.OrganizeImports { const groupedImports = groupSortedImports(sortedImports); for (const importGroup of groupedImports) { - let seenImportWithoutClause = false; + const { importWithoutClause, defaultImports, namespaceImports, namedImports } = getImportParts(importGroup); + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + const defaultImportClause = defaultImports[0].parent as ImportClause; + coalescedImports.push( + updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + + continue; + } + + const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); + + for (const namespaceImport of sortedNamespaceImports) { + // Drop the name, if any + coalescedImports.push( + updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + } + + if (defaultImports.length === 0 && namedImports.length === 0) { + continue; + } + + let newDefaultImport: Identifier | undefined; + const newImportSpecifiers: ImportSpecifier[] = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (const defaultImport of defaultImports) { + newImportSpecifiers.push( + createImportSpecifier(createIdentifier("default"), defaultImport)); + } + } + + newImportSpecifiers.push(...flatMap(namedImports, n => n.elements)); + + const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => + compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name)); + + const importClause = defaultImports.length > 0 + ? defaultImports[0].parent as ImportClause + : namedImports[0].parent; + + const newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? createNamedImports(sortedImportSpecifiers) + : updateNamedImports(namedImports[0], sortedImportSpecifiers); + + coalescedImports.push( + updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + } + + return coalescedImports; + + function getImportParts(importGroup: ReadonlyArray) { + let importWithoutClause: ImportDeclaration | undefined; const defaultImports: Identifier[] = []; const namespaceImports: NamespaceImport[] = []; const namedImports: NamedImports[] = []; @@ -169,11 +185,7 @@ namespace ts.OrganizeImports { if (importDeclaration.importClause === undefined) { // Only the first such import is interesting - the others are redundant. // Note: Unfortunately, we will lose trivia that was on this node. - if (!seenImportWithoutClause) { - coalescedImports.push(importDeclaration); - } - - seenImportWithoutClause = true; + importWithoutClause = importWithoutClause || importDeclaration; continue; } @@ -193,85 +205,16 @@ namespace ts.OrganizeImports { } } - // Normally, we don't combine default and namespace imports, but it would be silly to - // produce two import declarations in this special case. - if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { - // Add the namespace import to the existing default ImportDeclaration. - const defaultImportClause = defaultImports[0].parent as ImportClause; - coalescedImports.push( - updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); - - continue; - } - - // For convenience, we cheat and do a little sorting during coalescing. - // Seems reasonable since we're restructuring so much anyway. - const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); - - for (const namespaceImport of sortedNamespaceImports) { - // Drop the name, if any - coalescedImports.push( - updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); - } - - if (defaultImports.length === 0 && namedImports.length === 0) { - continue; - } - - let newDefaultImport: Identifier = undefined; - const newImportSpecifiers: ImportSpecifier[] = []; - if (defaultImports.length === 1) { - newDefaultImport = defaultImports[0]; - } - else { - for (const defaultImport of defaultImports) { - newImportSpecifiers.push( - createImportSpecifier(createIdentifier("default"), defaultImport)); - } - } - - for (const namedImport of namedImports) { - for (const specifier of namedImport.elements) { - newImportSpecifiers.push(specifier); - } - } - - const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => { - const nameComparison = compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name); - return nameComparison !== Comparison.EqualTo - ? nameComparison - : compareIdentifiers(s1.name, s2.name); - }); - - const importClause = defaultImports.length > 0 - ? defaultImports[0].parent as ImportClause - : namedImports[0].parent; - - const newNamedImports = sortedImportSpecifiers.length === 0 - ? undefined - : namedImports.length === 0 - ? createNamedImports(sortedImportSpecifiers) - : updateNamedImports(namedImports[0], sortedImportSpecifiers); - - coalescedImports.push( - updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + return { + importWithoutClause, + defaultImports, + namespaceImports, + namedImports, + }; } - return coalescedImports; - - // `undefined` is the min value. - function compareIdentifiers(s1: Identifier | undefined, s2: Identifier | undefined) { - return s1 === undefined - ? s2 === undefined - ? Comparison.EqualTo - : Comparison.LessThan - : s2 === undefined - ? Comparison.GreaterThan - : s1.text < s2.text - ? Comparison.LessThan - : s1.text > s2.text - ? Comparison.GreaterThan - : Comparison.EqualTo; + function compareIdentifiers(s1: Identifier, s2: Identifier) { + return compareStringsCaseSensitive(s1.text, s2.text); } function updateImportDeclarationAndClause( diff --git a/src/services/services.ts b/src/services/services.ts index 37cc192442f..b5d6f0ec2a6 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1855,7 +1855,7 @@ namespace ts { const sourceFile = getValidSourceFile(scope.fileName); const formatContext = formatting.getFormatContext(formatOptions); - return OrganizeImports.organizeImports(sourceFile, formatContext, host, cancellationToken); + return OrganizeImports.organizeImports(sourceFile, formatContext, host); } function applyCodeActionCommand(action: CodeActionCommand): Promise; diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index ef0d68b2041..bbd88a1a004 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -58,6 +58,7 @@ "jsTyping.ts", "navigateTo.ts", "navigationBar.ts", + "organizeImports.ts", "outliningElementsCollector.ts", "pathCompletions.ts", "patternMatcher.ts", diff --git a/tests/baselines/reference/organizeImports/MoveToTop_Invalid.ts b/tests/baselines/reference/organizeImports/MoveToTop_Invalid.ts new file mode 100644 index 00000000000..e2372f680cf --- /dev/null +++ b/tests/baselines/reference/organizeImports/MoveToTop_Invalid.ts @@ -0,0 +1,22 @@ +// ==ORIGINAL== + +import { F1, F2 } from "lib"; +F1(); +F2(); +import * as NS from "lib"; +NS.F1(); +import b from `${'lib'}`; +import a from `${'lib'}`; +import D from "lib"; +D(); + +// ==ORGANIZED== + +import * as NS from "lib"; +import D, { F1, F2 } from "lib"; +import b from `${'lib'}`; +import a from `${'lib'}`; +F1(); +F2(); +NS.F1(); +D(); From 7a313947880ba57b0628b78c158ba9210b614d89 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 15 Feb 2018 15:06:34 -0800 Subject: [PATCH 164/298] Group imports before sorting and coalescing --- src/harness/unittests/organizeImports.ts | 128 ++++-------- src/services/organizeImports.ts | 194 +++++++----------- .../CoalesceMultipleModules.ts | 11 + 3 files changed, 133 insertions(+), 200 deletions(-) create mode 100644 tests/baselines/reference/OrganizeImports/CoalesceMultipleModules.ts diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts index 2accc84d43f..8d7b0904eb7 100644 --- a/src/harness/unittests/organizeImports.ts +++ b/src/harness/unittests/organizeImports.ts @@ -5,43 +5,6 @@ namespace ts { describe("Organize imports", () => { describe("Sort imports", () => { - it("No imports", () => { - assert.isEmpty(OrganizeImports.sortImports([])); - }); - - it("One import", () => { - const unsortedImports = parseImports(`import "lib";`); - const actualSortedImports = OrganizeImports.sortImports(unsortedImports); - const expectedSortedImports = unsortedImports; - assertListEqual(expectedSortedImports, actualSortedImports); - }); - - it("Stable - import kind", () => { - assertUnaffectedBySort( - `import "lib";`, - `import * as x from "lib";`, - `import x from "lib";`, - `import {x} from "lib";`); - }); - - it("Stable - default property alias", () => { - assertUnaffectedBySort( - `import x from "lib";`, - `import y from "lib";`); - }); - - it("Stable - module alias", () => { - assertUnaffectedBySort( - `import * as x from "lib";`, - `import * as y from "lib";`); - }); - - it("Stable - symbol", () => { - assertUnaffectedBySort( - `import {x} from "lib";`, - `import {y} from "lib";`); - }); - it("Sort - non-relative vs non-relative", () => { assertSortsBefore( `import y from "lib1";`, @@ -60,18 +23,10 @@ namespace ts { `import x from "./lib";`); }); - function assertUnaffectedBySort(...importStrings: string[]) { - const unsortedImports1 = parseImports(...importStrings); - assertListEqual(unsortedImports1, OrganizeImports.sortImports(unsortedImports1)); - - const unsortedImports2 = reverse(unsortedImports1); - assertListEqual(unsortedImports2, OrganizeImports.sortImports(unsortedImports2)); - } - function assertSortsBefore(importString1: string, importString2: string) { - const imports = parseImports(importString1, importString2); - assertListEqual(imports, OrganizeImports.sortImports(imports)); - assertListEqual(imports, OrganizeImports.sortImports(reverse(imports))); + const [{moduleSpecifier: moduleSpecifier1}, {moduleSpecifier: moduleSpecifier2}] = parseImports(importString1, importString2); + assert.equal(OrganizeImports.compareModuleSpecifiers(moduleSpecifier1, moduleSpecifier2), Comparison.LessThan); + assert.equal(OrganizeImports.compareModuleSpecifiers(moduleSpecifier2, moduleSpecifier1), Comparison.GreaterThan); } }); @@ -84,7 +39,7 @@ namespace ts { const sortedImports = parseImports(`import { default as m, a as n, b, y, z as o } from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import { a as n, b, default as m, y, z as o } from "lib";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine side-effect-only imports", () => { @@ -93,7 +48,7 @@ namespace ts { `import "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import "lib";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine namespace imports", () => { @@ -102,7 +57,7 @@ namespace ts { `import * as y from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine default imports", () => { @@ -111,7 +66,7 @@ namespace ts { `import y from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import { default as x, default as y } from "lib";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine property imports", () => { @@ -120,7 +75,7 @@ namespace ts { `import { y as z } from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports(`import { x, y as z } from "lib";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine side-effect-only import with namespace import", () => { @@ -129,7 +84,7 @@ namespace ts { `import * as x from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine side-effect-only import with default import", () => { @@ -138,7 +93,7 @@ namespace ts { `import x from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine side-effect-only import with property import", () => { @@ -147,7 +102,7 @@ namespace ts { `import { x } from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine namespace import with default import", () => { @@ -157,7 +112,7 @@ namespace ts { const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports( `import y, * as x from "lib";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine namespace import with property import", () => { @@ -166,7 +121,7 @@ namespace ts { `import { y } from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine default import with property import", () => { @@ -176,7 +131,7 @@ namespace ts { const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = parseImports( `import x, { y } from "lib";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); it("Combine many imports", () => { @@ -195,20 +150,7 @@ namespace ts { `import * as x from "lib";`, `import * as y from "lib";`, `import { a, b, default as w, default as z } from "lib";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); - }); - - it("Combine imports from different modules", () => { - const sortedImports = parseImports( - `import { d } from "lib1";`, - `import { b } from "lib1";`, - `import { c } from "lib2";`, - `import { a } from "lib2";`); - const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); - const expectedCoalescedImports = parseImports( - `import { b, d } from "lib1";`, - `import { a, c } from "lib2";`); - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); // This is descriptive, rather than normative @@ -219,7 +161,7 @@ namespace ts { `import z from "lib";`); const actualCoalescedImports = OrganizeImports.coalesceImports(sortedImports); const expectedCoalescedImports = sortedImports; - assertListEqual(expectedCoalescedImports, actualCoalescedImports); + assertListEqual(actualCoalescedImports, expectedCoalescedImports); }); }); @@ -233,6 +175,17 @@ export default function F2(); `, }; + // Don't bother to actually emit a baseline for this. + it("NoImports", () => { + const testFile = { + path: "/a.ts", + content: "function F() { }", + }; + const languageService = makeLanguageService(testFile); + const changes = languageService.organizeImports({ type: "file", fileName: testFile.path }, testFormatOptions); + assert.isEmpty(changes); + }); + testOrganizeImports("Simple", { path: "/test.ts", @@ -283,6 +236,19 @@ D(); libFile); // tslint:enable no-invalid-template-strings + testOrganizeImports("CoalesceMultipleModules", + { + path: "/test.ts", + content: ` +import { d } from "lib1"; +import { b } from "lib1"; +import { c } from "lib2"; +import { a } from "lib2"; +`, + }, + { path: "/lib1.ts", content: "" }, + { path: "/lib2.ts", content: "" }); + testOrganizeImports("CoalesceTrivia", { path: "/test.ts", @@ -315,8 +281,8 @@ F2(); const { path: testPath, content: testContent } = testFile; const languageService = makeLanguageService(testFile, ...otherFiles); const changes = languageService.organizeImports({ type: "file", fileName: testPath }, testFormatOptions); - assert.equal(1, changes.length); - assert.equal(testPath, changes[0].fileName); + assert.equal(changes.length, 1); + assert.equal(changes[0].fileName, testPath); Harness.Baseline.runBaseline(baselinePath, () => { const newText = textChanges.applyChanges(testContent, changes[0].textChanges); @@ -340,7 +306,7 @@ F2(); function parseImports(...importStrings: string[]): ReadonlyArray { const sourceFile = createSourceFile("a.ts", importStrings.join("\n"), ScriptTarget.ES2015, /*setParentNodes*/ true, ScriptKind.TS); const imports = filter(sourceFile.statements, isImportDeclaration); - assert.equal(importStrings.length, imports.length); + assert.equal(imports.length, importStrings.length); return imports; } @@ -414,13 +380,5 @@ F2(); assertEqual(list1[i], list2[i]); } } - - function reverse(list: ReadonlyArray) { - const result = []; - for (let i = list.length - 1; i >= 0; i--) { - result.push(list[i]); - } - return result; - } }); } \ No newline at end of file diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index d6b782a19aa..e75db1aa59d 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -14,11 +14,15 @@ namespace ts.OrganizeImports { return []; } - const oldValidImportDecls = oldImportDecls.filter(importDecl => getExternalModuleName(importDecl.moduleSpecifier)); - const oldInvalidImportDecls = oldImportDecls.filter(importDecl => !getExternalModuleName(importDecl.moduleSpecifier)); + const oldImportGroups = group(oldImportDecls, importDecl => getExternalModuleName(importDecl.moduleSpecifier)); - // All of the new ImportDeclarations in the file, in sorted order. - const newImportDecls = coalesceImports(sortImports(removeUnusedImports(oldValidImportDecls))).concat(oldInvalidImportDecls); + const sortedImportGroups = stableSort(oldImportGroups, (group1, group2) => + compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier)); + + const newImportDecls = flatMap(sortedImportGroups, importGroup => + getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup)) + : importGroup); const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); @@ -47,132 +51,83 @@ namespace ts.OrganizeImports { return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) } - /* @internal */ // Internal for testing - export function sortImports(oldImports: ReadonlyArray) { - return stableSort(oldImports, (import1, import2) => { - const name1 = getExternalModuleName(import1.moduleSpecifier); - const name2 = getExternalModuleName(import2.moduleSpecifier); - Debug.assert(name1 !== undefined); - Debug.assert(name2 !== undefined); - return compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || - compareStringsCaseSensitive(name1, name2); - }); - } - function getExternalModuleName(specifier: Expression) { return isStringLiteral(specifier) || isNoSubstitutionTemplateLiteral(specifier) ? specifier.text : undefined; } - /** - * @param sortedImports a non-empty list of ImportDeclarations, sorted by module name. - */ - function groupSortedImports(sortedImports: ReadonlyArray): ReadonlyArray> { - Debug.assert(length(sortedImports) > 0); - - const groups: ImportDeclaration[][] = []; - - let groupName: string | undefined = getExternalModuleName(sortedImports[0].moduleSpecifier); - Debug.assert(groupName !== undefined); - let group: ImportDeclaration[] = []; - - for (const importDeclaration of sortedImports) { - const moduleName = getExternalModuleName(importDeclaration.moduleSpecifier); - Debug.assert(moduleName !== undefined); - if (moduleName === groupName) { - group.push(importDeclaration); - } - else if (group.length) { - groups.push(group); - - groupName = moduleName; - group = [importDeclaration]; - } - } - - if (group.length) { - groups.push(group); - } - - return groups; - } - /* @internal */ // Internal for testing /** - * @param sortedImports a list of ImportDeclarations, sorted by module name. + * @param importGroup a list of ImportDeclarations, all with the same module name. */ - export function coalesceImports(sortedImports: ReadonlyArray) { - if (sortedImports.length === 0) { - return sortedImports; + export function coalesceImports(importGroup: ReadonlyArray) { + if (importGroup.length === 0) { + return importGroup; } + const { importWithoutClause, defaultImports, namespaceImports, namedImports } = getImportParts(importGroup); + const coalescedImports: ImportDeclaration[] = []; - const groupedImports = groupSortedImports(sortedImports); - for (const importGroup of groupedImports) { - - const { importWithoutClause, defaultImports, namespaceImports, namedImports } = getImportParts(importGroup); - - if (importWithoutClause) { - coalescedImports.push(importWithoutClause); - } - - // Normally, we don't combine default and namespace imports, but it would be silly to - // produce two import declarations in this special case. - if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { - // Add the namespace import to the existing default ImportDeclaration. - const defaultImportClause = defaultImports[0].parent as ImportClause; - coalescedImports.push( - updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); - - continue; - } - - const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); - - for (const namespaceImport of sortedNamespaceImports) { - // Drop the name, if any - coalescedImports.push( - updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); - } - - if (defaultImports.length === 0 && namedImports.length === 0) { - continue; - } - - let newDefaultImport: Identifier | undefined; - const newImportSpecifiers: ImportSpecifier[] = []; - if (defaultImports.length === 1) { - newDefaultImport = defaultImports[0]; - } - else { - for (const defaultImport of defaultImports) { - newImportSpecifiers.push( - createImportSpecifier(createIdentifier("default"), defaultImport)); - } - } - - newImportSpecifiers.push(...flatMap(namedImports, n => n.elements)); - - const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => - compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || - compareIdentifiers(s1.name, s2.name)); - - const importClause = defaultImports.length > 0 - ? defaultImports[0].parent as ImportClause - : namedImports[0].parent; - - const newNamedImports = sortedImportSpecifiers.length === 0 - ? undefined - : namedImports.length === 0 - ? createNamedImports(sortedImportSpecifiers) - : updateNamedImports(namedImports[0], sortedImportSpecifiers); - - coalescedImports.push( - updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); } + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + const defaultImportClause = defaultImports[0].parent as ImportClause; + coalescedImports.push( + updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + + return coalescedImports; + } + + const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); + + for (const namespaceImport of sortedNamespaceImports) { + // Drop the name, if any + coalescedImports.push( + updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + } + + if (defaultImports.length === 0 && namedImports.length === 0) { + return coalescedImports; + } + + let newDefaultImport: Identifier | undefined; + const newImportSpecifiers: ImportSpecifier[] = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (const defaultImport of defaultImports) { + newImportSpecifiers.push( + createImportSpecifier(createIdentifier("default"), defaultImport)); + } + } + + newImportSpecifiers.push(...flatMap(namedImports, n => n.elements)); + + const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => + compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name)); + + const importClause = defaultImports.length > 0 + ? defaultImports[0].parent as ImportClause + : namedImports[0].parent; + + const newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? createNamedImports(sortedImportSpecifiers) + : updateNamedImports(namedImports[0], sortedImportSpecifiers); + + coalescedImports.push( + updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + return coalescedImports; function getImportParts(importGroup: ReadonlyArray) { @@ -231,4 +186,13 @@ namespace ts.OrganizeImports { importDeclaration.moduleSpecifier); } } + + /* internal */ // Exported for testing + export function compareModuleSpecifiers(m1: Expression, m2: Expression) { + const name1 = getExternalModuleName(m1); + const name2 = getExternalModuleName(m2); + return compareBooleans(name1 === undefined, name2 === undefined) || + compareBooleans(isExternalModuleNameRelative(name1), isExternalModuleNameRelative(name2)) || + compareStringsCaseSensitive(name1, name2); + } } \ No newline at end of file diff --git a/tests/baselines/reference/OrganizeImports/CoalesceMultipleModules.ts b/tests/baselines/reference/OrganizeImports/CoalesceMultipleModules.ts new file mode 100644 index 00000000000..6278722f2a9 --- /dev/null +++ b/tests/baselines/reference/OrganizeImports/CoalesceMultipleModules.ts @@ -0,0 +1,11 @@ +// ==ORIGINAL== + +import { d } from "lib1"; +import { b } from "lib1"; +import { c } from "lib2"; +import { a } from "lib2"; + +// ==ORGANIZED== + +import { b, d } from "lib1"; +import { a, c } from "lib2"; From 7e8dab681a40ba3345508c425dae2fd81f6fbe2a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 16 Feb 2018 14:00:10 -0800 Subject: [PATCH 165/298] typingsInstaller:Remove triple-slash references (#21982) Replace them with an explicit list of files in tsconfig. I got this list by adding --listFiles to the jake-generated command. --- src/server/typingsInstaller/nodeTypingsInstaller.ts | 1 - src/server/typingsInstaller/tsconfig.json | 12 ++++++++++++ src/server/typingsInstaller/typingsInstaller.ts | 9 +-------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index e51ec68561c..b0844b2369c 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -1,4 +1,3 @@ -/// /// namespace ts.server.typingsInstaller { diff --git a/src/server/typingsInstaller/tsconfig.json b/src/server/typingsInstaller/tsconfig.json index 4cfa26f8d9c..1606fbf3592 100644 --- a/src/server/typingsInstaller/tsconfig.json +++ b/src/server/typingsInstaller/tsconfig.json @@ -12,6 +12,18 @@ ] }, "files": [ + "../../compiler/types.ts", + "../../compiler/performance.ts", + "../../compiler/core.ts", + "../../compiler/sys.ts", + "../../compiler/diagnosticInformationMap.generated.ts", + "../../compiler/utilities.ts", + "../../compiler/scanner.ts", + "../../compiler/parser.ts", + "../../compiler/commandLineParser.ts", + "../../compiler/moduleNameResolver.ts", + "../../services/semver.ts", + "../../services/jsTyping.ts", "../types.ts", "../shared.ts", "typingsInstaller.ts", diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 465f281006e..059967ecb4d 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -1,10 +1,3 @@ -/// -/// -/// -/// -/// -/// - namespace ts.server.typingsInstaller { interface NpmConfig { devDependencies: MapLike; @@ -413,4 +406,4 @@ namespace ts.server.typingsInstaller { } const latestDistTag = "latest"; -} \ No newline at end of file +} From 9c2b95dae3378f2b41abfee7fde9e8d1ecc6aeee Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 16 Feb 2018 14:49:23 -0800 Subject: [PATCH 166/298] Make FAR handle non-existent imported symbols --- src/services/findAllReferences.ts | 2 +- tests/cases/fourslash/findAllRefsBadImport.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/findAllRefsBadImport.ts diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index b1e6909f093..bc36ef06226 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -356,7 +356,7 @@ namespace ts.FindAllReferences.Core { /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(symbol: Symbol, node: Node, sourceFiles: ReadonlyArray, checker: TypeChecker, cancellationToken: CancellationToken, options: Options): SymbolAndEntries[] { - symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker); + symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; // Compute the meaning from the location and the symbol it references const searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), symbol.declarations); diff --git a/tests/cases/fourslash/findAllRefsBadImport.ts b/tests/cases/fourslash/findAllRefsBadImport.ts new file mode 100644 index 00000000000..89a81d81f79 --- /dev/null +++ b/tests/cases/fourslash/findAllRefsBadImport.ts @@ -0,0 +1,7 @@ +/// + +////import { [|ab|] as [|cd|] } from "doesNotExist"; + +const [r0, r1] = test.ranges(); +verify.referencesOf(r0, [r1]); +verify.referencesOf(r1, [r1]); From 1faefc77030e41836f0a10995af97e1f91da4513 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 16 Feb 2018 14:51:31 -0800 Subject: [PATCH 167/298] Use correct lowercase name --- .../CoalesceMultipleModules.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/baselines/reference/{OrganizeImports => organizeImports}/CoalesceMultipleModules.ts (100%) diff --git a/tests/baselines/reference/OrganizeImports/CoalesceMultipleModules.ts b/tests/baselines/reference/organizeImports/CoalesceMultipleModules.ts similarity index 100% rename from tests/baselines/reference/OrganizeImports/CoalesceMultipleModules.ts rename to tests/baselines/reference/organizeImports/CoalesceMultipleModules.ts From b64eefdb2059648f4c186842f8c611699710fe44 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 16 Feb 2018 15:50:12 -0800 Subject: [PATCH 168/298] Remove redundant null check --- src/services/findAllReferences.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index bc36ef06226..5684b3f3e37 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -405,7 +405,7 @@ namespace ts.FindAllReferences.Core { } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifierOrUnion(symbol: Symbol, node: Node, checker: TypeChecker): Symbol { + function skipPastExportOrImportSpecifierOrUnion(symbol: Symbol, node: Node, checker: TypeChecker): Symbol | undefined { const { parent } = node; if (isExportSpecifier(parent)) { return getLocalSymbolForExportSpecifier(node as Identifier, symbol, parent, checker); @@ -425,7 +425,7 @@ namespace ts.FindAllReferences.Core { return isTypeLiteralNode(decl.parent) && isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) : undefined; - }) || symbol; + }); } /** From f95b9bc65de732cbc81b2e67fecfb6c08770bf2d Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 16 Feb 2018 15:53:44 -0800 Subject: [PATCH 169/298] Port generated lib files (#22003) * Port generated lib files * Port generated lib files --- src/lib/dom.generated.d.ts | 802 ++++++++++++++++--------------- src/lib/webworker.generated.d.ts | 98 ++-- 2 files changed, 462 insertions(+), 438 deletions(-) diff --git a/src/lib/dom.generated.d.ts b/src/lib/dom.generated.d.ts index ff764a8a06e..78ecb23eac3 100644 --- a/src/lib/dom.generated.d.ts +++ b/src/lib/dom.generated.d.ts @@ -1169,13 +1169,15 @@ interface WheelEventInit extends MouseEventInit { deltaZ?: number; } -type EventListener = (evt: Event) => void | { handleEvent(evt: Event): void; }; +interface EventListener { + (evt: Event): void; +} -type WebKitEntriesCallback = (entries: WebKitEntry[]) => void | { handleEvent(entries: WebKitEntry[]): void; }; +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -type WebKitErrorCallback = (err: DOMError) => void | { handleEvent(err: DOMError): void; }; +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -type WebKitFileCallback = (file: File) => void | { handleEvent(file: File): void; }; +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -1249,9 +1251,9 @@ interface ApplicationCache extends EventTarget { readonly UNCACHED: number; readonly UPDATEREADY: number; addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ApplicationCache: { @@ -1308,9 +1310,9 @@ interface AudioBufferSourceNode extends AudioNode { start(when?: number, offset?: number, duration?: number): void; stop(when?: number): void; addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var AudioBufferSourceNode: { @@ -1352,9 +1354,9 @@ interface AudioContextBase extends EventTarget { decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise; resume(): Promise; addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface AudioContext extends AudioContextBase { @@ -1462,9 +1464,9 @@ interface AudioTrackList extends EventTarget { getTrackById(id: string): AudioTrack | null; item(index: number): AudioTrack; addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; [index: number]: AudioTrack; } @@ -2383,9 +2385,9 @@ declare var CustomEvent: { interface DataCue extends TextTrackCue { data: ArrayBuffer; addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var DataCue: { @@ -3310,9 +3312,9 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven */ writeln(...content: string[]): void; addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Document: { @@ -3640,9 +3642,9 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec insertAdjacentText(where: InsertPosition, text: string): void; attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot; addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Element: { @@ -3697,9 +3699,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -3780,9 +3782,9 @@ interface FileReader extends EventTarget, MSBaseReader { readAsDataURL(blob: Blob): void; readAsText(blob: Blob, encoding?: string): void; addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var FileReader: { @@ -4015,9 +4017,9 @@ interface HTMLAnchorElement extends HTMLElement { */ toString(): string; addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLAnchorElement: { @@ -4091,9 +4093,9 @@ interface HTMLAppletElement extends HTMLElement { vspace: number; width: number; addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLAppletElement: { @@ -4161,9 +4163,9 @@ interface HTMLAreaElement extends HTMLElement { */ toString(): string; addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLAreaElement: { @@ -4181,9 +4183,9 @@ declare var HTMLAreasCollection: { interface HTMLAudioElement extends HTMLMediaElement { addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLAudioElement: { @@ -4201,9 +4203,9 @@ interface HTMLBaseElement extends HTMLElement { */ target: string; addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLBaseElement: { @@ -4221,9 +4223,9 @@ interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty */ size: number; addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLBaseFontElement: { @@ -4277,9 +4279,9 @@ interface HTMLBodyElement extends HTMLElement { text: any; vLink: any; addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLBodyElement: { @@ -4293,9 +4295,9 @@ interface HTMLBRElement extends HTMLElement { */ clear: string; addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLBRElement: { @@ -4368,9 +4370,9 @@ interface HTMLButtonElement extends HTMLElement { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLButtonElement: { @@ -4405,9 +4407,9 @@ interface HTMLCanvasElement extends HTMLElement { toDataURL(type?: string, ...args: any[]): string; toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void; addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLCanvasElement: { @@ -4442,9 +4444,9 @@ declare var HTMLCollection: { interface HTMLDataElement extends HTMLElement { value: string; addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLDataElement: { @@ -4455,9 +4457,9 @@ declare var HTMLDataElement: { interface HTMLDataListElement extends HTMLElement { options: HTMLCollectionOf; addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLDataListElement: { @@ -4468,9 +4470,9 @@ declare var HTMLDataListElement: { interface HTMLDirectoryElement extends HTMLElement { compact: boolean; addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLDirectoryElement: { @@ -4488,9 +4490,9 @@ interface HTMLDivElement extends HTMLElement { */ noWrap: boolean; addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLDivElement: { @@ -4501,9 +4503,9 @@ declare var HTMLDivElement: { interface HTMLDListElement extends HTMLElement { compact: boolean; addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLDListElement: { @@ -4513,9 +4515,9 @@ declare var HTMLDListElement: { interface HTMLDocument extends Document { addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLDocument: { @@ -4689,9 +4691,9 @@ interface HTMLElement extends Element { msGetInputContext(): MSInputMethodContext; animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLElement: { @@ -4747,9 +4749,9 @@ interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { */ width: string; addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLEmbedElement: { @@ -4790,9 +4792,9 @@ interface HTMLFieldSetElement extends HTMLElement { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLFieldSetElement: { @@ -4806,9 +4808,9 @@ interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOM */ face: string; addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLFontElement: { @@ -4895,9 +4897,9 @@ interface HTMLFormElement extends HTMLElement { reportValidity(): boolean; reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; [name: string]: any; } @@ -4972,9 +4974,9 @@ interface HTMLFrameElement extends HTMLElement, GetSVGDocument { */ width: string | number; addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLFrameElement: { @@ -5042,9 +5044,9 @@ interface HTMLFrameSetElement extends HTMLElement { */ rows: string; addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLFrameSetElement: { @@ -5055,9 +5057,9 @@ declare var HTMLFrameSetElement: { interface HTMLHeadElement extends HTMLElement { profile: string; addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLHeadElement: { @@ -5071,9 +5073,9 @@ interface HTMLHeadingElement extends HTMLElement { */ align: string; addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLHeadingElement: { @@ -5095,9 +5097,9 @@ interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2 */ width: number; addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLHRElement: { @@ -5111,9 +5113,9 @@ interface HTMLHtmlElement extends HTMLElement { */ version: string; addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLHtmlElement: { @@ -5202,9 +5204,9 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { */ srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLIFrameElement: { @@ -5295,9 +5297,9 @@ interface HTMLImageElement extends HTMLElement { readonly y: number; msGetAsCastingSource(): any; addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLImageElement: { @@ -5510,9 +5512,9 @@ interface HTMLInputElement extends HTMLElement { */ stepUp(n?: number): void; addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLInputElement: { @@ -5531,9 +5533,9 @@ interface HTMLLabelElement extends HTMLElement { htmlFor: string; readonly control: HTMLInputElement | null; addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLLabelElement: { @@ -5551,9 +5553,9 @@ interface HTMLLegendElement extends HTMLElement { */ readonly form: HTMLFormElement | null; addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLLegendElement: { @@ -5568,9 +5570,9 @@ interface HTMLLIElement extends HTMLElement { */ value: number; addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLLIElement: { @@ -5615,9 +5617,9 @@ interface HTMLLinkElement extends HTMLElement, LinkStyle { import?: Document; integrity: string; addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLLinkElement: { @@ -5635,9 +5637,9 @@ interface HTMLMapElement extends HTMLElement { */ name: string; addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLMapElement: { @@ -5669,9 +5671,9 @@ interface HTMLMarqueeElement extends HTMLElement { start(): void; stop(): void; addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLMarqueeElement: { @@ -5853,9 +5855,9 @@ interface HTMLMediaElement extends HTMLElement { readonly NETWORK_LOADING: number; readonly NETWORK_NO_SOURCE: number; addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLMediaElement: { @@ -5876,9 +5878,9 @@ interface HTMLMenuElement extends HTMLElement { compact: boolean; type: string; addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLMenuElement: { @@ -5912,9 +5914,9 @@ interface HTMLMetaElement extends HTMLElement { */ url: string; addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLMetaElement: { @@ -5930,9 +5932,9 @@ interface HTMLMeterElement extends HTMLElement { optimum: number; value: number; addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLMeterElement: { @@ -5950,9 +5952,9 @@ interface HTMLModElement extends HTMLElement { */ dateTime: string; addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLModElement: { @@ -6066,9 +6068,9 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLObjectElement: { @@ -6084,9 +6086,9 @@ interface HTMLOListElement extends HTMLElement { start: number; type: string; addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLOListElement: { @@ -6125,9 +6127,9 @@ interface HTMLOptGroupElement extends HTMLElement { */ value: string; addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLOptGroupElement: { @@ -6166,9 +6168,9 @@ interface HTMLOptionElement extends HTMLElement { */ value: string; addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLOptionElement: { @@ -6202,9 +6204,9 @@ interface HTMLOutputElement extends HTMLElement { reportValidity(): boolean; setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLOutputElement: { @@ -6219,9 +6221,9 @@ interface HTMLParagraphElement extends HTMLElement { align: string; clear: string; addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLParagraphElement: { @@ -6247,9 +6249,9 @@ interface HTMLParamElement extends HTMLElement { */ valueType: string; addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLParamElement: { @@ -6259,9 +6261,9 @@ declare var HTMLParamElement: { interface HTMLPictureElement extends HTMLElement { addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLPictureElement: { @@ -6275,9 +6277,9 @@ interface HTMLPreElement extends HTMLElement { */ width: number; addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLPreElement: { @@ -6303,9 +6305,9 @@ interface HTMLProgressElement extends HTMLElement { */ value: number; addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLProgressElement: { @@ -6319,9 +6321,9 @@ interface HTMLQuoteElement extends HTMLElement { */ cite: string; addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLQuoteElement: { @@ -6362,9 +6364,9 @@ interface HTMLScriptElement extends HTMLElement { type: string; integrity: string; addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLScriptElement: { @@ -6460,9 +6462,9 @@ interface HTMLSelectElement extends HTMLElement { */ setCustomValidity(error: string): void; addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; [name: string]: any; } @@ -6488,9 +6490,9 @@ interface HTMLSourceElement extends HTMLElement { */ type: string; addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLSourceElement: { @@ -6500,9 +6502,9 @@ declare var HTMLSourceElement: { interface HTMLSpanElement extends HTMLElement { addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLSpanElement: { @@ -6521,9 +6523,9 @@ interface HTMLStyleElement extends HTMLElement, LinkStyle { */ type: string; addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLStyleElement: { @@ -6541,9 +6543,9 @@ interface HTMLTableCaptionElement extends HTMLElement { */ vAlign: string; addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableCaptionElement: { @@ -6598,9 +6600,9 @@ interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { */ width: string; addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableCellElement: { @@ -6622,9 +6624,9 @@ interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { */ width: any; addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableColElement: { @@ -6634,9 +6636,9 @@ declare var HTMLTableColElement: { interface HTMLTableDataCellElement extends HTMLTableCellElement { addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableDataCellElement: { @@ -6749,9 +6751,9 @@ interface HTMLTableElement extends HTMLElement { */ insertRow(index?: number): HTMLTableRowElement; addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableElement: { @@ -6765,9 +6767,9 @@ interface HTMLTableHeaderCellElement extends HTMLTableCellElement { */ scope: string; addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableHeaderCellElement: { @@ -6808,9 +6810,9 @@ interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { */ insertCell(index?: number): HTMLTableDataCellElement; addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableRowElement: { @@ -6838,9 +6840,9 @@ interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { */ insertRow(index?: number): HTMLTableRowElement; addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTableSectionElement: { @@ -6851,9 +6853,9 @@ declare var HTMLTableSectionElement: { interface HTMLTemplateElement extends HTMLElement { readonly content: DocumentFragment; addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTemplateElement: { @@ -6961,9 +6963,9 @@ interface HTMLTextAreaElement extends HTMLElement { */ setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTextAreaElement: { @@ -6974,9 +6976,9 @@ declare var HTMLTextAreaElement: { interface HTMLTimeElement extends HTMLElement { dateTime: string; addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTimeElement: { @@ -6990,9 +6992,9 @@ interface HTMLTitleElement extends HTMLElement { */ text: string; addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTitleElement: { @@ -7013,9 +7015,9 @@ interface HTMLTrackElement extends HTMLElement { readonly LOADING: number; readonly NONE: number; addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLTrackElement: { @@ -7031,9 +7033,9 @@ interface HTMLUListElement extends HTMLElement { compact: boolean; type: string; addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLUListElement: { @@ -7043,9 +7045,9 @@ declare var HTMLUListElement: { interface HTMLUnknownElement extends HTMLElement { addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLUnknownElement: { @@ -7100,9 +7102,9 @@ interface HTMLVideoElement extends HTMLMediaElement { webkitExitFullscreen(): void; webkitExitFullScreen(): void; addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var HTMLVideoElement: { @@ -7162,9 +7164,9 @@ interface IDBDatabase extends EventTarget { addEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | EventListenerOptions): void; addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBDatabase: { @@ -7249,9 +7251,9 @@ interface IDBOpenDBRequest extends IDBRequest { onblocked: (this: IDBOpenDBRequest, ev: Event) => any; onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBOpenDBRequest: { @@ -7273,9 +7275,9 @@ interface IDBRequest extends EventTarget { source: IDBObjectStore | IDBIndex | IDBCursor; readonly transaction: IDBTransaction; addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBRequest: { @@ -7302,9 +7304,9 @@ interface IDBTransaction extends EventTarget { readonly READ_WRITE: string; readonly VERSION_CHANGE: string; addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBTransaction: { @@ -7474,9 +7476,9 @@ interface MediaDevices extends EventTarget { getSupportedConstraints(): MediaTrackSupportedConstraints; getUserMedia(constraints: MediaStreamConstraints): Promise; addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MediaDevices: { @@ -7648,9 +7650,9 @@ interface MediaStream extends EventTarget { removeTrack(track: MediaStreamTrack): void; stop(): void; addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MediaStream: { @@ -7722,9 +7724,9 @@ interface MediaStreamTrack extends EventTarget { getSettings(): MediaTrackSettings; stop(): void; addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MediaStreamTrack: { @@ -7774,9 +7776,9 @@ interface MessagePort extends EventTarget { postMessage(message?: any, transfer?: any[]): void; start(): void; addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MessagePort: { @@ -7881,9 +7883,9 @@ interface MSAppAsyncOperation extends EventTarget { readonly ERROR: number; readonly STARTED: number; addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MSAppAsyncOperation: { @@ -8039,9 +8041,9 @@ interface MSHTMLWebViewElement extends HTMLElement { refresh(): void; stop(): void; addEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MSHTMLWebViewElement: { @@ -8067,9 +8069,9 @@ interface MSInputMethodContext extends EventTarget { hasComposition(): boolean; isCandidateWindowVisible(): boolean; addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MSInputMethodContext: { @@ -8235,9 +8237,9 @@ interface MSStreamReader extends EventTarget, MSBaseReader { readAsDataURL(stream: MSStream, size?: number): void; readAsText(stream: MSStream, encoding?: string, size?: number): void; addEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MSStreamReader: { @@ -8266,9 +8268,9 @@ interface MSWebViewAsyncOperation extends EventTarget { readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; readonly TYPE_INVOKE_SCRIPT: number; addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MSWebViewAsyncOperation: { @@ -8559,9 +8561,9 @@ interface Notification extends EventTarget { readonly title: string; close(): void; addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Notification: { @@ -8641,9 +8643,9 @@ interface OfflineAudioContext extends AudioContextBase { startRendering(): Promise; suspend(suspendTime: number): Promise; addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var OfflineAudioContext: { @@ -8664,9 +8666,9 @@ interface OscillatorNode extends AudioNode { start(when?: number): void; stop(when?: number): void; addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var OscillatorNode: { @@ -8761,9 +8763,9 @@ interface PaymentRequest extends EventTarget { abort(): Promise; show(): Promise; addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var PaymentRequest: { @@ -9271,9 +9273,9 @@ interface RTCDtlsTransport extends RTCStatsProvider { start(remoteParameters: RTCDtlsParameters): void; stop(): void; addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCDtlsTransport: { @@ -9303,9 +9305,9 @@ interface RTCDtmfSender extends EventTarget { readonly toneBuffer: string; insertDTMF(tones: string, duration?: number, interToneGap?: number): void; addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCDtmfSender: { @@ -9356,9 +9358,9 @@ interface RTCIceGatherer extends RTCStatsProvider { getLocalCandidates(): RTCIceCandidateDictionary[]; getLocalParameters(): RTCIceParameters; addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCIceGatherer: { @@ -9396,9 +9398,9 @@ interface RTCIceTransport extends RTCStatsProvider { start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void; stop(): void; addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCIceTransport: { @@ -9453,9 +9455,9 @@ interface RTCPeerConnection extends EventTarget { setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise; addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCPeerConnection: { @@ -9487,9 +9489,9 @@ interface RTCRtpReceiver extends RTCStatsProvider { setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; stop(): void; addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCRtpReceiver: { @@ -9514,9 +9516,9 @@ interface RTCRtpSender extends RTCStatsProvider { setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void; stop(): void; addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCRtpSender: { @@ -9544,9 +9546,9 @@ interface RTCSrtpSdesTransport extends EventTarget { onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null; readonly transport: RTCIceTransport; addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var RTCSrtpSdesTransport: { @@ -9617,10 +9619,12 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Screen: { @@ -9646,9 +9650,9 @@ interface ScriptProcessorNode extends AudioNode { readonly bufferSize: number; onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any; addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ScriptProcessorNode: { @@ -9700,9 +9704,9 @@ interface ServiceWorker extends EventTarget, AbstractWorker { readonly state: ServiceWorkerState; postMessage(message: any, transfer?: any[]): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ServiceWorker: { @@ -9724,9 +9728,9 @@ interface ServiceWorkerContainer extends EventTarget { getRegistrations(): Promise; register(scriptURL: USVString, options?: RegistrationOptions): Promise; addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerContainer: { @@ -9764,9 +9768,9 @@ interface ServiceWorkerRegistration extends EventTarget { unregister(): Promise; update(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerRegistration: { @@ -9820,9 +9824,9 @@ interface SpeechSynthesis extends EventTarget { resume(): void; speak(utterance: SpeechSynthesisUtterance): void; addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SpeechSynthesis: { @@ -9867,9 +9871,9 @@ interface SpeechSynthesisUtterance extends EventTarget { voice: SpeechSynthesisVoice; volume: number; addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SpeechSynthesisUtterance: { @@ -10004,9 +10008,9 @@ declare var SubtleCrypto: { interface SVGAElement extends SVGGraphicsElement, SVGURIReference { readonly target: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGAElement: { @@ -10163,9 +10167,9 @@ interface SVGCircleElement extends SVGGraphicsElement { readonly cy: SVGAnimatedLength; readonly r: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGCircleElement: { @@ -10176,9 +10180,9 @@ declare var SVGCircleElement: { interface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes { readonly clipPathUnits: SVGAnimatedEnumeration; addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGClipPathElement: { @@ -10201,9 +10205,9 @@ interface SVGComponentTransferFunctionElement extends SVGElement { readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGComponentTransferFunctionElement: { @@ -10219,9 +10223,9 @@ declare var SVGComponentTransferFunctionElement: { interface SVGDefsElement extends SVGGraphicsElement { addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGDefsElement: { @@ -10231,9 +10235,9 @@ declare var SVGDefsElement: { interface SVGDescElement extends SVGElement { addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGDescElement: { @@ -10271,9 +10275,9 @@ interface SVGElement extends Element { readonly viewportElement: SVGElement; xmlbase: string; addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGElement: { @@ -10313,9 +10317,9 @@ interface SVGEllipseElement extends SVGGraphicsElement { readonly rx: SVGAnimatedLength; readonly ry: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGEllipseElement: { @@ -10345,9 +10349,9 @@ interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttrib readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number; readonly SVG_FEBLEND_MODE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEBlendElement: { @@ -10382,9 +10386,9 @@ interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandard readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number; readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEColorMatrixElement: { @@ -10400,9 +10404,9 @@ declare var SVGFEColorMatrixElement: { interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEComponentTransferElement: { @@ -10426,9 +10430,9 @@ interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAt readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; readonly SVG_FECOMPOSITE_OPERATOR_XOR: number; addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFECompositeElement: { @@ -10461,9 +10465,9 @@ interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStand readonly SVG_EDGEMODE_UNKNOWN: number; readonly SVG_EDGEMODE_WRAP: number; addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEConvolveMatrixElement: { @@ -10482,9 +10486,9 @@ interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStan readonly kernelUnitLengthY: SVGAnimatedNumber; readonly surfaceScale: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEDiffuseLightingElement: { @@ -10504,9 +10508,9 @@ interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStan readonly SVG_CHANNEL_R: number; readonly SVG_CHANNEL_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEDisplacementMapElement: { @@ -10523,9 +10527,9 @@ interface SVGFEDistantLightElement extends SVGElement { readonly azimuth: SVGAnimatedNumber; readonly elevation: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEDistantLightElement: { @@ -10535,9 +10539,9 @@ declare var SVGFEDistantLightElement: { interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEFloodElement: { @@ -10547,9 +10551,9 @@ declare var SVGFEFloodElement: { interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncAElement: { @@ -10559,9 +10563,9 @@ declare var SVGFEFuncAElement: { interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncBElement: { @@ -10571,9 +10575,9 @@ declare var SVGFEFuncBElement: { interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncGElement: { @@ -10583,9 +10587,9 @@ declare var SVGFEFuncGElement: { interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEFuncRElement: { @@ -10599,9 +10603,9 @@ interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandar readonly stdDeviationY: SVGAnimatedNumber; setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEGaussianBlurElement: { @@ -10612,9 +10616,9 @@ declare var SVGFEGaussianBlurElement: { interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio; addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEImageElement: { @@ -10624,9 +10628,9 @@ declare var SVGFEImageElement: { interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEMergeElement: { @@ -10637,9 +10641,9 @@ declare var SVGFEMergeElement: { interface SVGFEMergeNodeElement extends SVGElement { readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEMergeNodeElement: { @@ -10656,9 +10660,9 @@ interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardA readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number; readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEMorphologyElement: { @@ -10674,9 +10678,9 @@ interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttri readonly dy: SVGAnimatedNumber; readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEOffsetElement: { @@ -10689,9 +10693,9 @@ interface SVGFEPointLightElement extends SVGElement { readonly y: SVGAnimatedNumber; readonly z: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFEPointLightElement: { @@ -10707,9 +10711,9 @@ interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveSta readonly specularExponent: SVGAnimatedNumber; readonly surfaceScale: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFESpecularLightingElement: { @@ -10727,9 +10731,9 @@ interface SVGFESpotLightElement extends SVGElement { readonly y: SVGAnimatedNumber; readonly z: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFESpotLightElement: { @@ -10740,9 +10744,9 @@ declare var SVGFESpotLightElement: { interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { readonly in1: SVGAnimatedString; addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFETileElement: { @@ -10764,9 +10768,9 @@ interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardA readonly SVG_TURBULENCE_TYPE_TURBULENCE: number; readonly SVG_TURBULENCE_TYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFETurbulenceElement: { @@ -10791,9 +10795,9 @@ interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference { readonly y: SVGAnimatedLength; setFilterRes(filterResX: number, filterResY: number): void; addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGFilterElement: { @@ -10807,9 +10811,9 @@ interface SVGForeignObjectElement extends SVGGraphicsElement { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGForeignObjectElement: { @@ -10819,9 +10823,9 @@ declare var SVGForeignObjectElement: { interface SVGGElement extends SVGGraphicsElement { addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGGElement: { @@ -10838,9 +10842,9 @@ interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference { readonly SVG_SPREADMETHOD_REPEAT: number; readonly SVG_SPREADMETHOD_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGGradientElement: { @@ -10861,9 +10865,9 @@ interface SVGGraphicsElement extends SVGElement, SVGTests { getScreenCTM(): SVGMatrix; getTransformToElement(element: SVGElement): SVGMatrix; addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGGraphicsElement: { @@ -10878,9 +10882,9 @@ interface SVGImageElement extends SVGGraphicsElement, SVGURIReference { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGImageElement: { @@ -10946,9 +10950,9 @@ interface SVGLinearGradientElement extends SVGGradientElement { readonly y1: SVGAnimatedLength; readonly y2: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGLinearGradientElement: { @@ -10962,9 +10966,9 @@ interface SVGLineElement extends SVGGraphicsElement { readonly y1: SVGAnimatedLength; readonly y2: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGLineElement: { @@ -10989,9 +10993,9 @@ interface SVGMarkerElement extends SVGElement, SVGFitToViewBox { readonly SVG_MARKERUNITS_UNKNOWN: number; readonly SVG_MARKERUNITS_USERSPACEONUSE: number; addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGMarkerElement: { @@ -11013,9 +11017,9 @@ interface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGMaskElement: { @@ -11050,9 +11054,9 @@ declare var SVGMatrix: { interface SVGMetadataElement extends SVGElement { addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGMetadataElement: { @@ -11110,9 +11114,9 @@ interface SVGPathElement extends SVGGraphicsElement { getPointAtLength(distance: number): SVGPoint; getTotalLength(): number; addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGPathElement: { @@ -11405,9 +11409,9 @@ interface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitTo readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGPatternElement: { @@ -11444,9 +11448,9 @@ declare var SVGPointList: { interface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints { addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGPolygonElement: { @@ -11456,9 +11460,9 @@ declare var SVGPolygonElement: { interface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints { addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGPolylineElement: { @@ -11511,9 +11515,9 @@ interface SVGRadialGradientElement extends SVGGradientElement { readonly fy: SVGAnimatedLength; readonly r: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGRadialGradientElement: { @@ -11541,9 +11545,9 @@ interface SVGRectElement extends SVGGraphicsElement { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGRectElement: { @@ -11554,9 +11558,9 @@ declare var SVGRectElement: { interface SVGScriptElement extends SVGElement, SVGURIReference { type: string; addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGScriptElement: { @@ -11567,9 +11571,9 @@ declare var SVGScriptElement: { interface SVGStopElement extends SVGElement { readonly offset: SVGAnimatedNumber; addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGStopElement: { @@ -11599,9 +11603,9 @@ interface SVGStyleElement extends SVGElement { title: string; type: string; addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGStyleElement: { @@ -11662,9 +11666,9 @@ interface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewB unsuspendRedraw(suspendHandleID: number): void; unsuspendRedrawAll(): void; addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGSVGElement: { @@ -11674,9 +11678,9 @@ declare var SVGSVGElement: { interface SVGSwitchElement extends SVGGraphicsElement { addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGSwitchElement: { @@ -11686,9 +11690,9 @@ declare var SVGSwitchElement: { interface SVGSymbolElement extends SVGElement, SVGFitToViewBox { addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGSymbolElement: { @@ -11712,9 +11716,9 @@ interface SVGTextContentElement extends SVGGraphicsElement { readonly LENGTHADJUST_SPACINGANDGLYPHS: number; readonly LENGTHADJUST_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGTextContentElement: { @@ -11727,9 +11731,9 @@ declare var SVGTextContentElement: { interface SVGTextElement extends SVGTextPositioningElement { addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGTextElement: { @@ -11748,9 +11752,9 @@ interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { readonly TEXTPATH_SPACINGTYPE_EXACT: number; readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number; addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGTextPathElement: { @@ -11771,9 +11775,9 @@ interface SVGTextPositioningElement extends SVGTextContentElement { readonly x: SVGAnimatedLengthList; readonly y: SVGAnimatedLengthList; addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGTextPositioningElement: { @@ -11783,9 +11787,9 @@ declare var SVGTextPositioningElement: { interface SVGTitleElement extends SVGElement { addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGTitleElement: { @@ -11844,9 +11848,9 @@ declare var SVGTransformList: { interface SVGTSpanElement extends SVGTextPositioningElement { addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGTSpanElement: { @@ -11869,9 +11873,9 @@ interface SVGUseElement extends SVGGraphicsElement, SVGURIReference { readonly x: SVGAnimatedLength; readonly y: SVGAnimatedLength; addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGUseElement: { @@ -11882,9 +11886,9 @@ declare var SVGUseElement: { interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox { readonly viewTarget: SVGStringList; addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var SVGViewElement: { @@ -12005,9 +12009,9 @@ interface TextTrack extends EventTarget { readonly NONE: number; readonly SHOWING: number; addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var TextTrack: { @@ -12038,9 +12042,9 @@ interface TextTrackCue extends EventTarget { readonly track: TextTrack; getCueAsHTML(): DocumentFragment; addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var TextTrackCue: { @@ -12069,9 +12073,9 @@ interface TextTrackList extends EventTarget { onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null; item(index: number): TextTrack; addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; [index: number]: TextTrack; } @@ -12280,9 +12284,9 @@ interface VideoTrackList extends EventTarget { getTrackById(id: string): VideoTrack | null; item(index: number): VideoTrack; addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; [index: number]: VideoTrack; } @@ -13323,9 +13327,9 @@ declare var WebKitPoint: { interface webkitRTCPeerConnection extends RTCPeerConnection { addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var webkitRTCPeerConnection: { @@ -13358,9 +13362,9 @@ interface WebSocket extends EventTarget { readonly CONNECTING: number; readonly OPEN: number; addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var WebSocket: { @@ -13673,9 +13677,9 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window scrollTo(options?: ScrollToOptions): void; scrollBy(options?: ScrollToOptions): void; addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Window: { @@ -13692,9 +13696,9 @@ interface Worker extends EventTarget, AbstractWorker { postMessage(message: any, transfer?: any[]): void; terminate(): void; addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Worker: { @@ -13704,9 +13708,9 @@ declare var Worker: { interface XMLDocument extends Document { addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var XMLDocument: { @@ -13748,9 +13752,9 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { readonly OPENED: number; readonly UNSENT: number; addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequest: { @@ -13765,9 +13769,9 @@ declare var XMLHttpRequest: { interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequestUpload: { @@ -13873,9 +13877,9 @@ interface AbstractWorkerEventMap { interface AbstractWorker { onerror: (this: AbstractWorker, ev: ErrorEvent) => any; addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface Body { @@ -14021,9 +14025,9 @@ interface GlobalEventHandlers { onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any; onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any; addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface GlobalFetch { @@ -14076,9 +14080,9 @@ interface MSBaseReader { readonly EMPTY: number; readonly LOADING: number; addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface MSFileSaver { @@ -14227,9 +14231,9 @@ interface XMLHttpRequestEventTarget { onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any; ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any; addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface BroadcastChannel extends EventTarget { @@ -14239,9 +14243,9 @@ interface BroadcastChannel extends EventTarget { close(): void; postMessage(message: any): void; addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var BroadcastChannel: { @@ -14348,6 +14352,10 @@ interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } +interface EventListenerObject { + handleEvent(evt: Event): void; +} + interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -14853,6 +14861,12 @@ interface EventSourceInit { readonly withCredentials: boolean; } +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + interface AnimationOptions { id?: string; delay?: number; @@ -14922,6 +14936,8 @@ declare var Animation: { new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; }; +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + interface DecodeErrorCallback { (error: DOMException): void; } @@ -15384,9 +15400,9 @@ declare function atob(encodedString: string): string; declare function btoa(rawString: string): string; declare function fetch(input: RequestInfo, init?: RequestInit): Promise; declare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; -declare function addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; declare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void; -declare function removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; type BodyInit = Blob | BufferSource | FormData | string; @@ -15431,7 +15447,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; -type AnimationKeyFrame = {offset?: number | null | (number | null)[]} & {[key: string]: string | number | number[] | string[]}; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/src/lib/webworker.generated.d.ts b/src/lib/webworker.generated.d.ts index 187aa6072b2..abc25d5e077 100644 --- a/src/lib/webworker.generated.d.ts +++ b/src/lib/webworker.generated.d.ts @@ -128,7 +128,9 @@ interface SyncEventInit extends ExtendableEventInit { lastChance?: boolean; } -type EventListener = (evt: Event) => void | { handleEvent(evt: Event): void; }; +interface EventListener { + (evt: Event): void; +} interface AudioBuffer { readonly duration: number; @@ -390,9 +392,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -430,9 +432,9 @@ interface FileReader extends EventTarget, MSBaseReader { readAsDataURL(blob: Blob): void; readAsText(blob: Blob, encoding?: string): void; addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var FileReader: { @@ -515,9 +517,9 @@ interface IDBDatabase extends EventTarget { addEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: "versionchange", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | EventListenerOptions): void; addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBDatabase: { @@ -602,9 +604,9 @@ interface IDBOpenDBRequest extends IDBRequest { onblocked: (this: IDBOpenDBRequest, ev: Event) => any; onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any; addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBOpenDBRequest: { @@ -626,9 +628,9 @@ interface IDBRequest extends EventTarget { source: IDBObjectStore | IDBIndex | IDBCursor; readonly transaction: IDBTransaction; addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBRequest: { @@ -655,9 +657,9 @@ interface IDBTransaction extends EventTarget { readonly READ_WRITE: string; readonly VERSION_CHANGE: string; addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var IDBTransaction: { @@ -723,9 +725,9 @@ interface MessagePort extends EventTarget { postMessage(message?: any, transfer?: any[]): void; start(): void; addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var MessagePort: { @@ -754,9 +756,9 @@ interface Notification extends EventTarget { readonly title: string; close(): void; addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Notification: { @@ -985,9 +987,9 @@ interface ServiceWorker extends EventTarget, AbstractWorker { readonly state: ServiceWorkerState; postMessage(message: any, transfer?: any[]): void; addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ServiceWorker: { @@ -1012,9 +1014,9 @@ interface ServiceWorkerRegistration extends EventTarget { unregister(): Promise; update(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerRegistration: { @@ -1080,9 +1082,9 @@ interface WebSocket extends EventTarget { readonly CONNECTING: number; readonly OPEN: number; addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var WebSocket: { @@ -1103,9 +1105,9 @@ interface Worker extends EventTarget, AbstractWorker { postMessage(message: any, transfer?: any[]): void; terminate(): void; addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var Worker: { @@ -1146,9 +1148,9 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { readonly OPENED: number; readonly UNSENT: number; addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequest: { @@ -1163,9 +1165,9 @@ declare var XMLHttpRequest: { interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var XMLHttpRequestUpload: { @@ -1180,9 +1182,9 @@ interface AbstractWorkerEventMap { interface AbstractWorker { onerror: (this: AbstractWorker, ev: ErrorEvent) => any; addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface Body { @@ -1220,9 +1222,9 @@ interface MSBaseReader { readonly EMPTY: number; readonly LOADING: number; addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface NavigatorBeacon { @@ -1277,9 +1279,9 @@ interface XMLHttpRequestEventTarget { onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any; ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any; addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } interface Client { @@ -1315,9 +1317,9 @@ interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { close(): void; postMessage(message: any, transfer?: any[]): void; addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var DedicatedWorkerGlobalScope: { @@ -1428,9 +1430,9 @@ interface ServiceWorkerGlobalScope extends WorkerGlobalScope { readonly registration: ServiceWorkerRegistration; skipWaiting(): Promise; addEventListener(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: ServiceWorkerGlobalScope, ev: ServiceWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var ServiceWorkerGlobalScope: { @@ -1475,9 +1477,9 @@ interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, Glo createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise; createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise; addEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: WorkerGlobalScope, ev: WorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var WorkerGlobalScope: { @@ -1535,9 +1537,9 @@ interface BroadcastChannel extends EventTarget { close(): void; postMessage(message: any): void; addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; - addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; - removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var BroadcastChannel: { @@ -1617,6 +1619,10 @@ interface FilePropertyBag extends BlobPropertyBag { lastModified?: number; } +interface EventListenerObject { + handleEvent(evt: Event): void; +} + interface ProgressEventInit extends EventInit { lengthComputable?: boolean; loaded?: number; @@ -1843,6 +1849,8 @@ interface EventSourceInit { readonly withCredentials: boolean; } +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + interface DecodeErrorCallback { (error: DOMException): void; } @@ -1899,9 +1907,9 @@ declare var console: Console; declare function fetch(input: RequestInfo, init?: RequestInit): Promise; declare function dispatchEvent(evt: Event): boolean; declare function addEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; -declare function addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; declare function removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; -declare function removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions): void; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AlgorithmIdentifier = string | Algorithm; type BodyInit = Blob | BufferSource | FormData | string; type IDBKeyPath = string; From b6f82adfed459389ea9ac274bd5f37ce9a13e1e0 Mon Sep 17 00:00:00 2001 From: Sergii Bezliudnyi Date: Sat, 17 Feb 2018 01:27:57 +0100 Subject: [PATCH 170/298] add template to jsdoc completion (#21978) --- src/services/jsDoc.ts | 1 + tests/cases/fourslash/completionInJsDoc.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts index 91774e2290c..2a5b4f26ce6 100644 --- a/src/services/jsDoc.ts +++ b/src/services/jsDoc.ts @@ -37,6 +37,7 @@ namespace ts.JsDoc { "see", "since", "static", + "template", "throws", "type", "typedef", diff --git a/tests/cases/fourslash/completionInJsDoc.ts b/tests/cases/fourslash/completionInJsDoc.ts index 4c1bb004671..1a9170ca950 100644 --- a/tests/cases/fourslash/completionInJsDoc.ts +++ b/tests/cases/fourslash/completionInJsDoc.ts @@ -59,6 +59,7 @@ verify.completionListContains("constructor"); verify.completionListContains("param"); verify.completionListContains("type"); verify.completionListContains("method"); +verify.completionListContains("template"); goTo.marker('2'); verify.completionListContains("constructor"); From ecddf8468fae73208126f2bc5aba4c39ef1e0875 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 16 Feb 2018 16:37:32 -0800 Subject: [PATCH 171/298] Fix the assert for undefined leaf in LineNode (#21924) Fixes #21818 --- src/server/scriptVersionCache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scriptVersionCache.ts b/src/server/scriptVersionCache.ts index dccf4d3267b..fa4445bfc4f 100644 --- a/src/server/scriptVersionCache.ts +++ b/src/server/scriptVersionCache.ts @@ -680,7 +680,7 @@ namespace ts.server { // Skipped all children const { leaf } = this.lineNumberToInfo(this.lineCount(), 0); - return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined }; + return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf ? leaf.charCount() : 0, lineText: undefined }; } /** From 9ee51fadd9d10f2070d62608970f2868aa71452b Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Feb 2018 16:47:13 -0800 Subject: [PATCH 172/298] Have Symbol#isReferenced check the SymbolFlags of the reference (#21996) --- src/compiler/checker.ts | 19 +++++------- src/compiler/types.ts | 2 +- ...ypeParameterMergedWithParameter.errors.txt | 27 ++++++++++++++++ ...Locals_typeParameterMergedWithParameter.js | 23 ++++++++++++++ ...s_typeParameterMergedWithParameter.symbols | 31 +++++++++++++++++++ ...als_typeParameterMergedWithParameter.types | 31 +++++++++++++++++++ ...Locals_typeParameterMergedWithParameter.ts | 14 +++++++++ 7 files changed, 135 insertions(+), 12 deletions(-) create mode 100644 tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.errors.txt create mode 100644 tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.js create mode 100644 tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.symbols create mode 100644 tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.types create mode 100644 tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b817d9b965a..a8fefc17dcc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1394,7 +1394,7 @@ namespace ts { // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { - result.isReferenced = true; + result.isReferenced |= meaning; } if (!result) { @@ -15697,7 +15697,7 @@ namespace ts { if (reactSym) { // Mark local symbol as referenced here because it might not have been marked // if jsx emit was not react as there wont be error being emitted - reactSym.isReferenced = true; + reactSym.isReferenced = SymbolFlags.All; // If react symbol is alias, mark it as refereced if (reactSym.flags & SymbolFlags.Alias && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { @@ -16267,12 +16267,7 @@ namespace ts { } } - if (getCheckFlags(prop) & CheckFlags.Instantiated) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; - } + (getCheckFlags(prop) & CheckFlags.Instantiated ? getSymbolLinks(prop).target : prop).isReferenced = SymbolFlags.All; } function isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: __String): boolean { @@ -21442,7 +21437,9 @@ namespace ts { function checkUnusedLocalsAndParameters(node: Node): void { if (noUnusedIdentifiers && !(node.flags & NodeFlags.Ambient)) { node.locals.forEach(local => { - if (!local.isReferenced) { + // If it's purely a type parameter, ignore, will be checked in `checkUnusedTypeParameters`. + // If it's a type parameter merged with a parameter, check if the parameter-side is used. + if (local.flags & SymbolFlags.TypeParameter ? (local.flags & SymbolFlags.Variable && !(local.isReferenced & SymbolFlags.Variable)) : !local.isReferenced) { if (local.valueDeclaration && getRootDeclaration(local.valueDeclaration).kind === SyntaxKind.Parameter) { const parameter = getRootDeclaration(local.valueDeclaration); const name = getNameOfDeclaration(local.valueDeclaration); @@ -21453,7 +21450,7 @@ namespace ts { error(name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolName(local)); } } - else if (local.flags & SymbolFlags.TypeParameter ? compilerOptions.noUnusedParameters : compilerOptions.noUnusedLocals) { + else if (compilerOptions.noUnusedLocals) { forEach(local.declarations, d => errorUnusedLocal(d, symbolName(local))); } } @@ -21538,7 +21535,7 @@ namespace ts { return; } for (const typeParameter of node.typeParameters) { - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & SymbolFlags.TypeParameter) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, Diagnostics._0_is_declared_but_its_value_is_never_read, symbolName(typeParameter.symbol)); } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0e3f83f6e09..bb039e0e1e5 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3307,7 +3307,7 @@ namespace ts { /* @internal */ parent?: Symbol; // Parent symbol /* @internal */ exportSymbol?: Symbol; // Exported symbol associated with this symbol /* @internal */ constEnumOnlyModule?: boolean; // True if module contains only const enums or other modules with only const enums - /* @internal */ isReferenced?: boolean; // True if the symbol is referenced elsewhere + /* @internal */ isReferenced?: SymbolFlags; // True if the symbol is referenced elsewhere. Keeps track of the meaning of a reference in case a symbol is both a type parameter and parameter. /* @internal */ isReplaceableByMethod?: boolean; // Can this Javascript class property be replaced by a method symbol? /* @internal */ isAssigned?: boolean; // True if the symbol is a parameter with assignments } diff --git a/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.errors.txt b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.errors.txt new file mode 100644 index 00000000000..e3b59b34cf8 --- /dev/null +++ b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.errors.txt @@ -0,0 +1,27 @@ +tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts(1,18): error TS6133: 'T' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts(1,21): error TS6133: 'T' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts(3,19): error TS6133: 'T' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts(7,26): error TS6133: 'T' is declared but its value is never read. + + +==== tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts (4 errors) ==== + function useNone(T: number) {} + ~ +!!! error TS6133: 'T' is declared but its value is never read. + ~ +!!! error TS6133: 'T' is declared but its value is never read. + + function useParam(T: number) { + ~ +!!! error TS6133: 'T' is declared but its value is never read. + return T; + } + + function useTypeParam(T: T) {} + ~ +!!! error TS6133: 'T' is declared but its value is never read. + + function useBoth(T: T) { + return T; + } + \ No newline at end of file diff --git a/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.js b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.js new file mode 100644 index 00000000000..0b41d982012 --- /dev/null +++ b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.js @@ -0,0 +1,23 @@ +//// [noUnusedLocals_typeParameterMergedWithParameter.ts] +function useNone(T: number) {} + +function useParam(T: number) { + return T; +} + +function useTypeParam(T: T) {} + +function useBoth(T: T) { + return T; +} + + +//// [noUnusedLocals_typeParameterMergedWithParameter.js] +function useNone(T) { } +function useParam(T) { + return T; +} +function useTypeParam(T) { } +function useBoth(T) { + return T; +} diff --git a/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.symbols b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.symbols new file mode 100644 index 00000000000..e0346382055 --- /dev/null +++ b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts === +function useNone(T: number) {} +>useNone : Symbol(useNone, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 0, 0)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 0, 17), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 0, 20)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 0, 17), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 0, 20)) + +function useParam(T: number) { +>useParam : Symbol(useParam, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 0, 33)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 2, 18), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 2, 21)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 2, 18), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 2, 21)) + + return T; +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 2, 18), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 2, 21)) +} + +function useTypeParam(T: T) {} +>useTypeParam : Symbol(useTypeParam, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 4, 1)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 6, 22), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 6, 25)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 6, 22), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 6, 25)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 6, 22), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 6, 25)) + +function useBoth(T: T) { +>useBoth : Symbol(useBoth, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 6, 33)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 17), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 20)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 17), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 20)) +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 17), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 20)) + + return T; +>T : Symbol(T, Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 17), Decl(noUnusedLocals_typeParameterMergedWithParameter.ts, 8, 20)) +} + diff --git a/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.types b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.types new file mode 100644 index 00000000000..42725968779 --- /dev/null +++ b/tests/baselines/reference/noUnusedLocals_typeParameterMergedWithParameter.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts === +function useNone(T: number) {} +>useNone : (T: number) => void +>T : T +>T : number + +function useParam(T: number) { +>useParam : (T: number) => number +>T : T +>T : number + + return T; +>T : number +} + +function useTypeParam(T: T) {} +>useTypeParam : (T: T) => void +>T : T +>T : T +>T : T + +function useBoth(T: T) { +>useBoth : (T: T) => T +>T : T +>T : T +>T : T + + return T; +>T : T +} + diff --git a/tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts b/tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts new file mode 100644 index 00000000000..b0240b36381 --- /dev/null +++ b/tests/cases/compiler/noUnusedLocals_typeParameterMergedWithParameter.ts @@ -0,0 +1,14 @@ +// @noUnusedLocals: true +// @noUnusedParameters: true + +function useNone(T: number) {} + +function useParam(T: number) { + return T; +} + +function useTypeParam(T: T) {} + +function useBoth(T: T) { + return T; +} From 69abe49930761aea92dc564f9b6a5db74d6e1be9 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Feb 2018 16:48:03 -0800 Subject: [PATCH 173/298] Supports more locations for completions contextual types (#21946) --- src/compiler/checker.ts | 27 ++++++++---- src/compiler/types.ts | 2 + src/services/completions.ts | 44 ++++++++++++------- src/services/signatureHelp.ts | 9 ++-- .../completionsRecommended_contextualTypes.ts | 27 ++++++++++++ .../fourslash/signatureHelpIncompleteCalls.ts | 2 +- 6 files changed, 80 insertions(+), 31 deletions(-) create mode 100644 tests/cases/fourslash/completionsRecommended_contextualTypes.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8fefc17dcc..032a640bc1d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -191,6 +191,14 @@ namespace ts { node = getParseTreeNode(node, isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: (node, argIndex) => { + node = getParseTreeNode(node, isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: (node) => { + node = getParseTreeNode(node, isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, isContextSensitive, getFullyQualifiedName, getResolvedSignature: (node, candidatesOutArray, theArgumentCount) => { @@ -14183,14 +14191,15 @@ namespace ts { // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget: CallLikeExpression, arg: Expression): Type { const args = getEffectiveCallArguments(callTarget); - const argIndex = args.indexOf(arg); - if (argIndex >= 0) { - // If we're already in the process of resolving the given signature, don't resolve again as - // that could cause infinite recursion. Instead, return anySignature. - const signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + const argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + + function getContextualTypeForArgumentAtIndex(callTarget: CallLikeExpression, argIndex: number): Type { + // If we're already in the process of resolving the given signature, don't resolve again as + // that could cause infinite recursion. Instead, return anySignature. + const signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template: TemplateExpression, substitutionExpression: Expression) { @@ -14324,7 +14333,7 @@ namespace ts { : undefined; } - function getContextualTypeForJsxAttribute(attribute: JsxAttribute | JsxSpreadAttribute) { + function getContextualTypeForJsxAttribute(attribute: JsxAttribute | JsxSpreadAttribute): Type | undefined { // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type // which is a type of the parameter of the signature we are trying out. // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName diff --git a/src/compiler/types.ts b/src/compiler/types.ts index bb039e0e1e5..39e4f90698d 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2835,6 +2835,8 @@ namespace ts { getAugmentedPropertiesOfType(type: Type): Symbol[]; getRootSymbols(symbol: Symbol): Symbol[]; getContextualType(node: Expression): Type | undefined; + /* @internal */ getContextualTypeForArgumentAtIndex(call: CallLikeExpression, argIndex: number): Type; + /* @internal */ getContextualTypeForJsxAttribute(attribute: JsxAttribute | JsxSpreadAttribute): Type | undefined; /* @internal */ isContextSensitive(node: Expression | MethodDeclaration | ObjectLiteralElementLike | JsxAttributeLike): boolean; /** diff --git a/src/services/completions.ts b/src/services/completions.ts index 68ec65a1e19..41f9a300b2e 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -657,8 +657,8 @@ namespace ts.Completions { None, } - function getRecommendedCompletion(currentToken: Node, checker: TypeChecker): Symbol | undefined { - const ty = getContextualType(currentToken, checker); + function getRecommendedCompletion(currentToken: Node, position: number, sourceFile: SourceFile, checker: TypeChecker): Symbol | undefined { + const ty = getContextualType(currentToken, position, sourceFile, checker); const symbol = ty && ty.symbol; // Don't include make a recommended completion for an abstract class return symbol && (symbol.flags & SymbolFlags.Enum || symbol.flags & SymbolFlags.Class && !isAbstractConstructorSymbol(symbol)) @@ -666,23 +666,37 @@ namespace ts.Completions { : undefined; } - function getContextualType(currentToken: Node, checker: ts.TypeChecker): Type | undefined { + function getContextualType(currentToken: Node, position: number, sourceFile: SourceFile, checker: TypeChecker): Type | undefined { const { parent } = currentToken; switch (currentToken.kind) { - case ts.SyntaxKind.Identifier: - return getContextualTypeFromParent(currentToken as ts.Identifier, checker); - case ts.SyntaxKind.EqualsToken: - return ts.isVariableDeclaration(parent) ? checker.getContextualType(parent.initializer) : - ts.isBinaryExpression(parent) ? checker.getTypeAtLocation(parent.left) : undefined; - case ts.SyntaxKind.NewKeyword: - return checker.getContextualType(parent as ts.Expression); - case ts.SyntaxKind.CaseKeyword: - return getSwitchedType(cast(currentToken.parent, isCaseClause), checker); + case SyntaxKind.Identifier: + return getContextualTypeFromParent(currentToken as Identifier, checker); + case SyntaxKind.EqualsToken: + switch (parent.kind) { + case ts.SyntaxKind.VariableDeclaration: + return checker.getContextualType((parent as VariableDeclaration).initializer); + case ts.SyntaxKind.BinaryExpression: + return checker.getTypeAtLocation((parent as BinaryExpression).left); + case ts.SyntaxKind.JsxAttribute: + return checker.getContextualTypeForJsxAttribute(parent as JsxAttribute); + default: + return undefined; + } + case SyntaxKind.NewKeyword: + return checker.getContextualType(parent as Expression); + case SyntaxKind.CaseKeyword: + return getSwitchedType(cast(parent, isCaseClause), checker); + case SyntaxKind.OpenBraceToken: + return isJsxExpression(parent) && parent.parent.kind !== SyntaxKind.JsxElement ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: - return isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) + const argInfo = SignatureHelp.getImmediatelyContainingArgumentInfo(currentToken, position, sourceFile); + return argInfo + // At `,`, treat this as the next argument after the comma. + ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (currentToken.kind === SyntaxKind.CommaToken ? 1 : 0)) + : isEqualityOperatorKind(currentToken.kind) && isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) // completion at `x ===/**/` should be for the right side ? checker.getTypeAtLocation(parent.left) - : checker.getContextualType(currentToken as ts.Expression); + : checker.getContextualType(currentToken as Expression); } } @@ -956,7 +970,7 @@ namespace ts.Completions { log("getCompletionData: Semantic work: " + (timestamp() - semanticStart)); - const recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, typeChecker); + const recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, position, sourceFile, typeChecker); return { kind: CompletionDataKind.Data, symbols, completionKind, propertyAccessToConvert, isNewIdentifierLocation, location, keywordFilters, symbolToOriginInfoMap, recommendedCompletion, previousToken, isJsxInitializer }; type JSDocTagWithTypeExpression = JSDocParameterTag | JSDocPropertyTag | JSDocReturnTag | JSDocTypeTag | JSDocTypedefTag; diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index aa30ba0de6f..c96d621dd24 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -95,7 +95,7 @@ namespace ts.SignatureHelp { * Returns relevant information for the argument list and the current argument if we are * in the argument of an invocation; returns undefined otherwise. */ - export function getImmediatelyContainingArgumentInfo(node: Node, position: number, sourceFile: SourceFile): ArgumentListInfo { + export function getImmediatelyContainingArgumentInfo(node: Node, position: number, sourceFile: SourceFile): ArgumentListInfo | undefined { if (isCallOrNewExpression(node.parent)) { const invocation = node.parent; let list: Node; @@ -207,8 +207,7 @@ namespace ts.SignatureHelp { // that trailing comma in the list, and we'll have generated the appropriate // arg index. let argumentIndex = 0; - const listChildren = argumentsList.getChildren(); - for (const child of listChildren) { + for (const child of argumentsList.getChildren()) { if (child === node) { break; } @@ -270,9 +269,7 @@ namespace ts.SignatureHelp { function getArgumentListInfoForTemplate(tagExpression: TaggedTemplateExpression, argumentIndex: number, sourceFile: SourceFile): ArgumentListInfo { // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. - const argumentCount = tagExpression.template.kind === SyntaxKind.NoSubstitutionTemplateLiteral - ? 1 - : (tagExpression.template).templateSpans.length + 1; + const argumentCount = isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; if (argumentIndex !== 0) { Debug.assertLessThan(argumentIndex, argumentCount); diff --git a/tests/cases/fourslash/completionsRecommended_contextualTypes.ts b/tests/cases/fourslash/completionsRecommended_contextualTypes.ts new file mode 100644 index 00000000000..d5d7f50c30b --- /dev/null +++ b/tests/cases/fourslash/completionsRecommended_contextualTypes.ts @@ -0,0 +1,27 @@ +/// + +// @jsx: preserve + +// @Filename: /a.tsx +////enum E {} +////enum F {} +////function f(e: E, f: F) {} +////f(/*arg0*/, /*arg1*/); +//// +////function tag(arr: TemplateStringsArray, x: E) {} +////tag`${/*tag*/}`; +//// +////declare function MainButton(props: { e: E }): any; +//// +//// + +recommended("arg0"); +recommended("arg1", "F"); +recommended("tag"); +recommended("jsx"); +recommended("jsx2"); + +function recommended(markerName: string, enumName = "E") { + goTo.marker(markerName); + verify.completionListContains(enumName, `enum ${enumName}`, "", "enum", undefined, undefined , { isRecommended: true }); +} diff --git a/tests/cases/fourslash/signatureHelpIncompleteCalls.ts b/tests/cases/fourslash/signatureHelpIncompleteCalls.ts index ec4fcccc0fe..7403b98733d 100644 --- a/tests/cases/fourslash/signatureHelpIncompleteCalls.ts +++ b/tests/cases/fourslash/signatureHelpIncompleteCalls.ts @@ -27,5 +27,5 @@ verify.currentSignatureParameterCountIs(2); verify.currentSignatureHelpIs("f3(n: number, s: string): string"); verify.currentParameterHelpArgumentNameIs("s"); -verify.currentParameterSpanIs("s: string"); +verify.currentParameterSpanIs("s: string"); From 8e078b9fde39562d055286ac76b5403b8b3521d2 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Feb 2018 16:48:42 -0800 Subject: [PATCH 174/298] Add comment to isGlobalCompletion (#21973) --- src/services/types.ts | 1 + tests/baselines/reference/api/tsserverlibrary.d.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/services/types.ts b/src/services/types.ts index 51710c88f4f..60e33c200ad 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -727,6 +727,7 @@ namespace ts { } export interface CompletionInfo { + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 1a7edaa44c8..86a33c179a3 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4490,6 +4490,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 8f9c095090d..1c3c13f48b0 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4742,6 +4742,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** From b3edc8f9f4d9cf4203c4c4493e4f0f3dc96c845d Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 16 Feb 2018 18:38:00 -0800 Subject: [PATCH 175/298] Apply 'no-unnecessary-type-assertion' lint rule (#22005) * Apply 'no-unnecessary-type-assertion' lint rule * Fix type error * Fix tsconfig.json * Add --format back --- Gulpfile.ts | 14 +- Jakefile.js | 16 +- scripts/tslint/rules/booleanTriviaRule.ts | 4 +- .../rules/noUnnecessaryTypeAssertion2Rule.ts | 98 +++++ scripts/tslint/tsconfig.json | 1 + src/compiler/binder.ts | 27 +- src/compiler/builder.ts | 2 +- src/compiler/checker.ts | 336 +++++++++--------- src/compiler/declarationEmitter.ts | 36 +- src/compiler/emitter.ts | 12 +- src/compiler/factory.ts | 50 +-- src/compiler/parser.ts | 16 +- src/compiler/program.ts | 2 +- src/compiler/transformers/es2015.ts | 20 +- src/compiler/transformers/es2017.ts | 2 +- src/compiler/transformers/esnext.ts | 5 +- src/compiler/transformers/generators.ts | 7 +- src/compiler/transformers/jsx.ts | 20 +- src/compiler/transformers/module/module.ts | 2 +- src/compiler/transformers/module/system.ts | 11 +- src/compiler/transformers/ts.ts | 22 +- src/compiler/utilities.ts | 62 ++-- src/harness/fourslash.ts | 16 +- src/harness/harness.ts | 7 +- src/harness/harnessLanguageService.ts | 2 +- .../unittests/reuseProgramStructure.ts | 2 +- src/harness/unittests/textChanges.ts | 2 +- .../unittests/tsserverProjectSystem.ts | 2 +- src/harness/virtualFileSystem.ts | 13 +- src/server/editorServices.ts | 2 +- src/server/scriptVersionCache.ts | 6 +- src/services/breakpoints.ts | 9 +- src/services/codefixes/fixUnusedIdentifier.ts | 6 +- src/services/codefixes/helpers.ts | 2 +- src/services/codefixes/inferFromUsage.ts | 4 +- src/services/completions.ts | 12 +- src/services/findAllReferences.ts | 10 +- src/services/formatting/formatting.ts | 2 +- src/services/formatting/smartIndenter.ts | 5 +- src/services/importTracker.ts | 2 +- src/services/jsDoc.ts | 4 +- src/services/navigateTo.ts | 6 +- src/services/navigationBar.ts | 8 +- .../refactors/annotateWithTypeFromJSDoc.ts | 2 +- .../refactors/convertFunctionToEs6Class.ts | 3 +- src/services/refactors/convertToEs6Module.ts | 14 +- src/services/refactors/extractSymbol.ts | 10 +- src/services/services.ts | 8 +- src/services/signatureHelp.ts | 14 +- src/services/symbolDisplay.ts | 4 +- src/services/utilities.ts | 2 +- tslint.json | 2 + 52 files changed, 495 insertions(+), 451 deletions(-) create mode 100644 scripts/tslint/rules/noUnnecessaryTypeAssertion2Rule.ts diff --git a/Gulpfile.ts b/Gulpfile.ts index 7222c9bcd6a..e8bd7a990fe 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -53,7 +53,6 @@ const cmdLineOptions = minimist(process.argv.slice(2), { "ru": "runners", "runner": "runners", "r": "reporter", "c": "colors", "color": "colors", - "f": "files", "file": "files", "w": "workers", }, default: { @@ -69,7 +68,6 @@ const cmdLineOptions = minimist(process.argv.slice(2), { light: process.env.light === undefined || process.env.light !== "false", reporter: process.env.reporter || process.env.r, lint: process.env.lint || true, - files: process.env.f || process.env.file || process.env.files || "", workers: process.env.workerCount || os.cpus().length, } }); @@ -1112,13 +1110,11 @@ function spawnLintWorker(files: {path: string}[], callback: (failures: number) = gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are: --f[iles]=regex", ["build-rules"], () => { if (fold.isTravis()) console.log(fold.start("lint")); - const fileMatcher = cmdLineOptions.files; - const files = fileMatcher - ? `src/**/${fileMatcher}` - : `Gulpfile.ts "scripts/generateLocalizedDiagnosticMessages.ts" "scripts/tslint/**/*.ts" "src/**/*.ts" --exclude "src/lib/*.d.ts"`; - const cmd = `node node_modules/tslint/bin/tslint ${files} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`; - console.log("Linting: " + cmd); - child_process.execSync(cmd, { stdio: [0, 1, 2] }); + for (const project of ["scripts/tslint/tsconfig.json", "src/tsconfig-base.json"]) { + const cmd = `node node_modules/tslint/bin/tslint --project ${project} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`; + console.log("Linting: " + cmd); + child_process.execSync(cmd, { stdio: [0, 1, 2] }); + } if (fold.isTravis()) console.log(fold.end("lint")); }); diff --git a/Jakefile.js b/Jakefile.js index d676926abac..9935b6b0f13 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -1302,15 +1302,13 @@ function spawnLintWorker(files, callback) { desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex"); task("lint", ["build-rules"], () => { if (fold.isTravis()) console.log(fold.start("lint")); - const fileMatcher = process.env.f || process.env.file || process.env.files; - - const files = fileMatcher - ? `src/**/${fileMatcher}` - : `Gulpfile.ts scripts/generateLocalizedDiagnosticMessages.ts "scripts/tslint/**/*.ts" "src/**/*.ts" --exclude "src/lib/*.d.ts"`; - const cmd = `node node_modules/tslint/bin/tslint ${files} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`; - console.log("Linting: " + cmd); - jake.exec([cmd], { interactive: true, windowsVerbatimArguments: true }, () => { + function lint(project, cb) { + const cmd = `node node_modules/tslint/bin/tslint --project ${project} --formatters-dir ./built/local/tslint/formatters --format autolinkableStylish`; + console.log("Linting: " + cmd); + jake.exec([cmd], { interactive: true, windowsVerbatimArguments: true }, cb); + } + lint("scripts/tslint/tsconfig.json", () => lint("src/tsconfig-base.json", () => { if (fold.isTravis()) console.log(fold.end("lint")); complete(); - }); + })); }); diff --git a/scripts/tslint/rules/booleanTriviaRule.ts b/scripts/tslint/rules/booleanTriviaRule.ts index c498131be16..dbfdc28438e 100644 --- a/scripts/tslint/rules/booleanTriviaRule.ts +++ b/scripts/tslint/rules/booleanTriviaRule.ts @@ -27,7 +27,7 @@ function walk(ctx: Lint.WalkContext): void { /** Skip certain function/method names whose parameter names are not informative. */ function shouldIgnoreCalledExpression(expression: ts.Expression): boolean { if (expression.kind === ts.SyntaxKind.PropertyAccessExpression) { - const methodName = (expression as ts.PropertyAccessExpression).name.text as string; + const methodName = (expression as ts.PropertyAccessExpression).name.text; if (methodName.indexOf("set") === 0) { return true; } @@ -45,7 +45,7 @@ function walk(ctx: Lint.WalkContext): void { } } else if (expression.kind === ts.SyntaxKind.Identifier) { - const functionName = (expression as ts.Identifier).text as string; + const functionName = (expression as ts.Identifier).text; if (functionName.indexOf("set") === 0) { return true; } diff --git a/scripts/tslint/rules/noUnnecessaryTypeAssertion2Rule.ts b/scripts/tslint/rules/noUnnecessaryTypeAssertion2Rule.ts new file mode 100644 index 00000000000..bcfb91b739f --- /dev/null +++ b/scripts/tslint/rules/noUnnecessaryTypeAssertion2Rule.ts @@ -0,0 +1,98 @@ +/** + * @license + * Copyright 2016 Palantir Technologies, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as ts from "typescript"; +import * as Lint from "tslint"; + +export class Rule extends Lint.Rules.TypedRule { + /* tslint:disable:object-literal-sort-keys */ + public static metadata: Lint.IRuleMetadata = { + ruleName: "no-unnecessary-type-assertion", + description: "Warns if a type assertion does not change the type of an expression.", + options: { + type: "list", + listType: { + type: "array", + items: { type: "string" }, + }, + }, + optionsDescription: "A list of whitelisted assertion types to ignore", + type: "typescript", + hasFix: true, + typescriptOnly: true, + requiresTypeInfo: true, + }; + /* tslint:enable:object-literal-sort-keys */ + + public static FAILURE_STRING = "This assertion is unnecessary since it does not change the type of the expression."; + + public applyWithProgram(sourceFile: ts.SourceFile, program: ts.Program): Lint.RuleFailure[] { + return this.applyWithWalker(new Walker(sourceFile, this.ruleName, this.ruleArguments, program.getTypeChecker())); + } +} + +class Walker extends Lint.AbstractWalker { + constructor(sourceFile: ts.SourceFile, ruleName: string, options: string[], private readonly checker: ts.TypeChecker) { + super(sourceFile, ruleName, options); + } + + public walk(sourceFile: ts.SourceFile) { + const cb = (node: ts.Node): void => { + switch (node.kind) { + case ts.SyntaxKind.TypeAssertionExpression: + case ts.SyntaxKind.AsExpression: + this.verifyCast(node as ts.TypeAssertion | ts.AsExpression); + } + + return ts.forEachChild(node, cb); + }; + + return ts.forEachChild(sourceFile, cb); + } + + private verifyCast(node: ts.TypeAssertion | ts.NonNullExpression | ts.AsExpression) { + if (ts.isAssertionExpression(node) && this.options.indexOf(node.type.getText(this.sourceFile)) !== -1) { + return; + } + const castType = this.checker.getTypeAtLocation(node); + if (castType === undefined) { + return; + } + + if (node.kind !== ts.SyntaxKind.NonNullExpression && + (castType.flags & ts.TypeFlags.Literal || + castType.flags & ts.TypeFlags.Object && + (castType as ts.ObjectType).objectFlags & ts.ObjectFlags.Tuple) || + // Sometimes tuple types don't have ObjectFlags.Tuple set, like when + // they're being matched against an inferred type. So, in addition, + // check if any properties are numbers, which implies that this is + // likely a tuple type. + (castType.getProperties().some((symbol) => !isNaN(Number(symbol.name))))) { + + // It's not always safe to remove a cast to a literal type or tuple + // type, as those types are sometimes widened without the cast. + return; + } + + const uncastType = this.checker.getTypeAtLocation(node.expression); + if (uncastType === castType) { + this.addFailureAtNode(node, Rule.FAILURE_STRING, node.kind === ts.SyntaxKind.TypeAssertionExpression + ? Lint.Replacement.deleteFromTo(node.getStart(), node.expression.getStart()) + : Lint.Replacement.deleteFromTo(node.expression.getEnd(), node.getEnd())); + } + } +} diff --git a/scripts/tslint/tsconfig.json b/scripts/tslint/tsconfig.json index c9bf8dc01dc..9d348658394 100644 --- a/scripts/tslint/tsconfig.json +++ b/scripts/tslint/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "lib": ["es6"], "noImplicitAny": true, "noImplicitReturns": true, "noImplicitThis": true, diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 05edda7cd3c..06b15c7718d 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -264,7 +264,7 @@ namespace ts { return (isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`) as __String; } if (name.kind === SyntaxKind.ComputedPropertyName) { - const nameExpression = (name).expression; + const nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (isStringOrNumericLiteral(nameExpression)) { return escapeLeadingUnderscores(nameExpression.text); @@ -459,10 +459,7 @@ namespace ts { // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. if (node.kind === SyntaxKind.JSDocTypedefTag) Debug.assert(isInJavaScriptFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - const isJSDocTypedefInJSDocNamespace = node.kind === SyntaxKind.JSDocTypedefTag && - (node as JSDocTypedefTag).name && - (node as JSDocTypedefTag).name.kind === SyntaxKind.Identifier && - ((node as JSDocTypedefTag).name as Identifier).isInJSDocNamespace; + const isJSDocTypedefInJSDocNamespace = isJSDocTypedefTag(node) && node.name && node.name.kind === SyntaxKind.Identifier && node.name.isInJSDocNamespace; if ((!isAmbientModule(node) && (hasExportModifier || container.flags & NodeFlags.ExportContext)) || isJSDocTypedefInJSDocNamespace) { const exportKind = symbolFlags & SymbolFlags.Value ? SymbolFlags.ExportValue : 0; const local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); @@ -527,7 +524,7 @@ namespace ts { if (!isIIFE) { currentFlow = { flags: FlowFlags.Start }; if (containerFlags & (ContainerFlags.IsFunctionExpression | ContainerFlags.IsObjectLiteralOrClassExpressionMethod)) { - (currentFlow).container = node; + currentFlow.container = node; } } // We create a return control flow graph for IIFEs and constructors. For constructors @@ -997,7 +994,7 @@ namespace ts { addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); if (node.initializer.kind !== SyntaxKind.VariableDeclarationList) { - bindAssignmentTargetFlow(node.initializer); + bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); addAntecedent(preLoopLabel, currentFlow); @@ -1170,7 +1167,7 @@ namespace ts { i++; } const preCaseLabel = createBranchLabel(); - addAntecedent(preCaseLabel, createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1)); + addAntecedent(preCaseLabel, createFlowSwitchClause(preSwitchCaseFlow, node.parent, clauseStart, i + 1)); addAntecedent(preCaseLabel, fallthroughFlow); currentFlow = finishFlowLabel(preCaseLabel); const clause = clauses[i]; @@ -1251,13 +1248,13 @@ namespace ts { else if (node.kind === SyntaxKind.ObjectLiteralExpression) { for (const p of (node).properties) { if (p.kind === SyntaxKind.PropertyAssignment) { - bindDestructuringTargetFlow((p).initializer); + bindDestructuringTargetFlow(p.initializer); } else if (p.kind === SyntaxKind.ShorthandPropertyAssignment) { - bindAssignmentTargetFlow((p).name); + bindAssignmentTargetFlow(p.name); } else if (p.kind === SyntaxKind.SpreadAssignment) { - bindAssignmentTargetFlow((p).expression); + bindAssignmentTargetFlow(p.expression); } } } @@ -1572,7 +1569,7 @@ namespace ts { } function hasExportDeclarations(node: ModuleDeclaration | SourceFile): boolean { - const body = node.kind === SyntaxKind.SourceFile ? node : (node).body; + const body = node.kind === SyntaxKind.SourceFile ? node : node.body; if (body && (body.kind === SyntaxKind.SourceFile || body.kind === SyntaxKind.ModuleBlock)) { for (const stat of (body).statements) { if (stat.kind === SyntaxKind.ExportDeclaration || stat.kind === SyntaxKind.ExportAssignment) { @@ -2210,7 +2207,7 @@ namespace ts { function checkTypePredicate(node: TypePredicateNode) { const { parameterName, type } = node; if (parameterName && parameterName.kind === SyntaxKind.Identifier) { - checkStrictModeIdentifier(parameterName as Identifier); + checkStrictModeIdentifier(parameterName); } if (parameterName && parameterName.kind === SyntaxKind.ThisType) { seenThisKeyword = true; @@ -2555,13 +2552,13 @@ namespace ts { } } - checkStrictModeFunctionName(node); + checkStrictModeFunctionName(node); if (inStrictMode) { checkStrictModeFunctionDeclaration(node); bindBlockScopedDeclaration(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes); } else { - declareSymbolAndAddToSymbolTable(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes); + declareSymbolAndAddToSymbolTable(node, SymbolFlags.Function, SymbolFlags.FunctionExcludes); } } diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 121609db104..c2f816a4c71 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -228,7 +228,7 @@ namespace ts { host = oldProgramOrHost as CompilerHost; } else { - newProgram = newProgramOrRootNames as Program; + newProgram = newProgramOrRootNames; host = hostOrOptions as BuilderProgramHost; oldProgram = oldProgramOrHost as BuilderProgram; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 032a640bc1d..2768c142f5a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1277,7 +1277,7 @@ namespace ts { // by the same name as a constructor parameter or local variable are inaccessible // in initializer expressions for instance member variables. if (isClassLike(location.parent) && !hasModifier(location, ModifierFlags.Static)) { - const ctor = findConstructorDeclaration(location.parent); + const ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { if (lookup(ctor.locals, name, meaning & SymbolFlags.Value)) { // Remember the property node, it will be used later to report appropriate error @@ -1688,7 +1688,7 @@ namespace ts { if (node.moduleReference.kind === SyntaxKind.ExternalModuleReference) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, getExternalModuleImportEqualsDeclarationExpression(node))); } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); + return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } function resolveExportByName(moduleSymbol: Symbol, name: __String, dontResolveAlias: boolean) { @@ -1729,7 +1729,7 @@ namespace ts { } function getTargetOfImportClause(node: ImportClause, dontResolveAlias: boolean): Symbol { - const moduleSymbol = resolveExternalModuleName(node, (node.parent).moduleSpecifier); + const moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { let exportDefaultSymbol: Symbol; @@ -1754,7 +1754,7 @@ namespace ts { } function getTargetOfNamespaceImport(node: NamespaceImport, dontResolveAlias: boolean): Symbol { - const moduleSpecifier = (node.parent.parent).moduleSpecifier; + const moduleSpecifier = node.parent.parent.moduleSpecifier; return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias); } @@ -1844,7 +1844,7 @@ namespace ts { } function getTargetOfImportSpecifier(node: ImportSpecifier, dontResolveAlias: boolean): Symbol { - return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); + return getExternalModuleMember(node.parent.parent.parent, node, dontResolveAlias); } function getTargetOfNamespaceExportDeclaration(node: NamespaceExportDeclaration, dontResolveAlias: boolean): Symbol { @@ -1945,7 +1945,7 @@ namespace ts { } else if (isInternalModuleImportEqualsDeclaration(node)) { // import foo = - checkExpressionCached((node).moduleReference); + checkExpressionCached(node.moduleReference); } } } @@ -1998,7 +1998,7 @@ namespace ts { let left: EntityNameOrEntityNameExpression; if (name.kind === SyntaxKind.QualifiedName) { - left = (name).left; + left = name.left; } else if (name.kind === SyntaxKind.PropertyAccessExpression) { left = name.expression; @@ -3048,7 +3048,7 @@ namespace ts { function createTypeNodeFromObjectType(type: ObjectType): TypeNode { if (isGenericMappedType(type)) { - return createMappedTypeNodeFromType(type); + return createMappedTypeNodeFromType(type); } const resolved = resolveStructuredTypeMembers(type); @@ -3138,7 +3138,7 @@ namespace ts { const typeArgumentSlice = mapToTypeNodes(typeArguments.slice(start, i), context); const typeArgumentNodes = typeArgumentSlice && createNodeArray(typeArgumentSlice); const namePart = symbolToTypeReferenceName(parent); - (namePart.kind === SyntaxKind.Identifier ? namePart : namePart.right).typeArguments = typeArgumentNodes; + (namePart.kind === SyntaxKind.Identifier ? namePart : namePart.right).typeArguments = typeArgumentNodes; if (qualifiedName) { Debug.assert(!qualifiedName.right); @@ -3170,7 +3170,7 @@ namespace ts { } if (typeArgumentNodes) { - const lastIdentifier = entityName.kind === SyntaxKind.Identifier ? entityName : entityName.right; + const lastIdentifier = entityName.kind === SyntaxKind.Identifier ? entityName : entityName.right; lastIdentifier.typeArguments = undefined; } @@ -3191,7 +3191,7 @@ namespace ts { rightPart = rightPart.left; } - left.right = rightPart.left; + left.right = rightPart.left; rightPart.left = left; return right; } @@ -3326,7 +3326,7 @@ namespace ts { const typePredicate = getTypePredicateOfSignature(signature); if (typePredicate) { const parameterName = typePredicate.kind === TypePredicateKind.Identifier ? - setEmitFlags(createIdentifier((typePredicate).parameterName), EmitFlags.NoAsciiEscaping) : + setEmitFlags(createIdentifier(typePredicate.parameterName), EmitFlags.NoAsciiEscaping) : createThisTypeNode(); const typeNode = typeToTypeNodeHelper(typePredicate.type, context); returnTypeNode = createTypePredicateNode(parameterName, typeNode); @@ -3809,7 +3809,7 @@ namespace ts { if (isInternalModuleImportEqualsDeclaration(declaration)) { // Add the referenced top container visible - const internalModuleReference = (declaration).moduleReference; + const internalModuleReference = declaration.moduleReference; const firstIdentifier = getFirstIdentifier(internalModuleReference); const importSymbol = resolveName(declaration, firstIdentifier.escapedText, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, undefined, undefined, /*isUse*/ false); @@ -3934,7 +3934,7 @@ namespace ts { } function isComputedNonLiteralName(name: PropertyName): boolean { - return name.kind === SyntaxKind.ComputedPropertyName && !isStringOrNumericLiteral((name).expression); + return name.kind === SyntaxKind.ComputedPropertyName && !isStringOrNumericLiteral(name.expression); } function getRestType(source: Type, properties: PropertyName[], symbol: Symbol): Type { @@ -3992,7 +3992,7 @@ namespace ts { } const literalMembers: PropertyName[] = []; for (const element of pattern.elements) { - if (!(element as BindingElement).dotDotDotToken) { + if (!element.dotDotDotToken) { literalMembers.push(element.propertyName || element.name as Identifier); } } @@ -4088,7 +4088,7 @@ namespace ts { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === SyntaxKind.ForInStatement) { - const indexType = getIndexType(checkNonNullExpression((declaration.parent.parent).expression)); + const indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (TypeFlags.TypeParameter | TypeFlags.Index) ? indexType : stringType; } @@ -4097,7 +4097,7 @@ namespace ts { // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, // or it may have led to an error inside getElementTypeOfIterable. - const forOfStatement = declaration.parent.parent; + const forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } @@ -4150,7 +4150,7 @@ namespace ts { type = getContextualThisParameterType(func); } else { - type = getContextuallyTypedParameterType(declaration); + type = getContextuallyTypedParameterType(declaration); } if (type) { return addOptionality(type, isOptional); @@ -4171,7 +4171,7 @@ namespace ts { // If the declaration specifies a binding pattern, use the type implied by the binding pattern if (isBindingPattern(declaration.name)) { - return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true); + return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true); } // No type specified and nothing can be inferred @@ -4232,7 +4232,7 @@ namespace ts { return checkDeclarationInitializer(element); } if (isBindingPattern(element.name)) { - return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); + return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors); } if (reportErrors && noImplicitAny && !declarationBelongsToPrivateAmbientMember(element)) { reportImplicitAnyError(element, anyType); @@ -4300,8 +4300,8 @@ namespace ts { // the parameter. function getTypeFromBindingPattern(pattern: BindingPattern, includePatternInType?: boolean, reportErrors?: boolean): Type { return pattern.kind === SyntaxKind.ObjectBindingPattern - ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) - : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); + ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) + : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } // Return the type associated with a variable, parameter, or property declaration. In the simple case this is the type @@ -5976,7 +5976,7 @@ namespace ts { function getCombinedMappedTypeOptionality(type: MappedType): number { const optionality = getMappedTypeOptionality(type); const modifiersType = getModifiersTypeFromMappedType(type); - return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type: Type) { @@ -6517,9 +6517,8 @@ namespace ts { } if (node.initializer) { - const signatureDeclaration = node.parent; - const signature = getSignatureFromDeclaration(signatureDeclaration); - const parameterIndex = signatureDeclaration.parameters.indexOf(node); + const signature = getSignatureFromDeclaration(node.parent); + const parameterIndex = node.parent.parameters.indexOf(node); Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -6539,7 +6538,7 @@ namespace ts { if (parameterName.kind === SyntaxKind.Identifier) { return createIdentifierTypePredicate( parameterName && parameterName.escapedText as string, // TODO: GH#18217 - parameterName && getTypePredicateParameterIndex((node.parent as SignatureDeclaration).parameters, parameterName), + parameterName && getTypePredicateParameterIndex(node.parent.parameters, parameterName), type); } else { @@ -7187,11 +7186,11 @@ namespace ts { function getTypeReferenceName(node: TypeReferenceType): EntityNameOrEntityNameExpression | undefined { switch (node.kind) { case SyntaxKind.TypeReference: - return (node).typeName; + return node.typeName; case SyntaxKind.ExpressionWithTypeArguments: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. - const expr = (node).expression; + const expr = node.expression; if (isEntityNameExpression(expr)) { return expr; } @@ -7992,10 +7991,10 @@ namespace ts { } function getPropertyTypeForIndexType(objectType: Type, indexType: Type, accessNode: ElementAccessExpression | IndexedAccessTypeNode, cacheSymbol: boolean) { - const accessExpression = accessNode && accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode : undefined; + const accessExpression = accessNode && accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode : undefined; const propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? - getPropertyNameForKnownSymbolName(idText(((accessExpression.argumentExpression).name))) : + getPropertyNameForKnownSymbolName(idText((accessExpression.argumentExpression).name)) : undefined; if (propName !== undefined) { const prop = getPropertyOfType(objectType, propName); @@ -8039,7 +8038,7 @@ namespace ts { } } if (accessNode) { - const indexNode = accessNode.kind === SyntaxKind.ElementAccessExpression ? (accessNode).argumentExpression : (accessNode).indexType; + const indexNode = accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (TypeFlags.StringLiteral | TypeFlags.NumberLiteral)) { error(indexNode, Diagnostics.Property_0_does_not_exist_on_type_1, "" + (indexType).value, typeToString(objectType)); } @@ -8129,10 +8128,9 @@ namespace ts { } function substituteIndexedMappedType(objectType: MappedType, type: IndexedAccessType) { - const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - const objectTypeMapper = (objectType).mapper; - const templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + const mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + const templateMapper = objectType.mapper ? combineTypeMappers(objectType.mapper, mapper) : mapper; + return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode): Type { @@ -9241,13 +9239,12 @@ namespace ts { } if (source.kind === TypePredicateKind.Identifier) { - const sourcePredicate = source as IdentifierTypePredicate; const targetPredicate = target as IdentifierTypePredicate; - const sourceIndex = sourcePredicate.parameterIndex - (getThisParameter(sourceDeclaration) ? 1 : 0); + const sourceIndex = source.parameterIndex - (getThisParameter(sourceDeclaration) ? 1 : 0); const targetIndex = targetPredicate.parameterIndex - (getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return Ternary.False; @@ -10022,17 +10019,17 @@ namespace ts { } else if (isGenericMappedType(target)) { // A source type T is related to a target type { [P in X]: T[P] } - const template = getTemplateTypeFromMappedType(target); - const modifiers = getMappedTypeModifiers(target); + const template = getTemplateTypeFromMappedType(target); + const modifiers = getMappedTypeModifiers(target); if (!(modifiers & MappedTypeModifiers.ExcludeOptional)) { if (template.flags & TypeFlags.IndexedAccess && (template).objectType === source && - (template).indexType === getTypeParameterFromMappedType(target)) { + (template).indexType === getTypeParameterFromMappedType(target)) { return Ternary.True; } // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - const indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - const templateType = getTemplateTypeFromMappedType(target); + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + const indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + const templateType = getTemplateTypeFromMappedType(target); if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { errorInfo = saveErrorInfo; return result; @@ -10154,7 +10151,7 @@ namespace ts { result = Ternary.True; } else if (isGenericMappedType(target)) { - result = isGenericMappedType(source) ? mappedTypeRelatedTo(source, target, reportStructuralErrors) : Ternary.False; + result = isGenericMappedType(source) ? mappedTypeRelatedTo(source, target, reportStructuralErrors) : Ternary.False; } else { result = propertiesRelatedTo(source, target, reportStructuralErrors); @@ -10192,9 +10189,9 @@ namespace ts { getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { let result: Ternary; - if (result = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { - const mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); - return result & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); + if (result = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { + const mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); + return result & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors); } } return Ternary.False; @@ -10500,7 +10497,7 @@ namespace ts { if (isGenericMappedType(source)) { // A generic mapped type { [P in K]: T } is related to an index signature { [x: string]: U } // if T is related to U. - return kind === IndexKind.String && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); + return kind === IndexKind.String && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); } if (isObjectTypeWithInferableIndex(source)) { let related = Ternary.True; @@ -11679,8 +11676,8 @@ namespace ts { if (isGenericMappedType(source) && isGenericMappedType(target)) { // The source and target types are generic types { [P in S]: X } and { [P in T]: Y }, so we infer // from S to T and from X to Y. - inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); - inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); + inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target)); + inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target)); } if (getObjectFlags(target) & ObjectFlags.Mapped) { const constraintType = getConstraintTypeFromMappedType(target); @@ -12243,7 +12240,7 @@ namespace ts { } function getAssignedTypeOfPropertyAssignment(node: PropertyAssignment | ShorthandPropertyAssignment): Type { - return getTypeOfDestructuredProperty(getAssignedType(node.parent), node.name); + return getTypeOfDestructuredProperty(getAssignedType(node.parent), node.name); } function getAssignedTypeOfShorthandPropertyAssignment(node: ShorthandPropertyAssignment): Type { @@ -12274,7 +12271,7 @@ namespace ts { } function getInitialTypeOfBindingElement(node: BindingElement): Type { - const pattern = node.parent; + const pattern = node.parent; const parentType = getInitialType(pattern.parent); const type = pattern.kind === SyntaxKind.ObjectBindingPattern ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : @@ -12300,21 +12297,21 @@ namespace ts { return stringType; } if (node.parent.parent.kind === SyntaxKind.ForOfStatement) { - return checkRightHandSideOfForOf((node.parent.parent).expression, (node.parent.parent).awaitModifier) || unknownType; + return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node: VariableDeclaration | BindingElement) { return node.kind === SyntaxKind.VariableDeclaration ? - getInitialTypeOfVariableDeclaration(node) : - getInitialTypeOfBindingElement(node); + getInitialTypeOfVariableDeclaration(node) : + getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node: VariableDeclaration | BindingElement | Expression) { return node.kind === SyntaxKind.VariableDeclaration || node.kind === SyntaxKind.BindingElement ? getInitialType(node) : - getAssignedType(node); + getAssignedType(node); } function isEmptyArrayAssignment(node: VariableDeclaration | BindingElement | Expression) { @@ -12349,7 +12346,7 @@ namespace ts { function getTypeOfSwitchClause(clause: CaseClause | DefaultClause) { if (clause.kind === SyntaxKind.CaseClause) { - const caseType = getRegularTypeOfLiteralType(getTypeOfExpression((clause).expression)); + const caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } return neverType; @@ -12722,22 +12719,22 @@ namespace ts { if (declaredType === autoType || declaredType === autoArrayType) { const node = flow.node; const expr = node.kind === SyntaxKind.CallExpression ? - ((node).expression).expression : - ((node).left).expression; + (node.expression).expression : + (node.left).expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { const flowType = getTypeAtFlowNode(flow.antecedent); const type = getTypeFromFlowType(flowType); if (getObjectFlags(type) & ObjectFlags.EvolvingArray) { let evolvedType = type; if (node.kind === SyntaxKind.CallExpression) { - for (const arg of (node).arguments) { + for (const arg of node.arguments) { evolvedType = addEvolvingArrayElementType(evolvedType, arg); } } else { - const indexType = getTypeOfExpression(((node).left).argumentExpression); + const indexType = getTypeOfExpression((node.left).argumentExpression); if (isTypeAssignableToKind(indexType, TypeFlags.NumberLike)) { - evolvedType = addEvolvingArrayElementType(evolvedType, (node).right); + evolvedType = addEvolvingArrayElementType(evolvedType, node.right); } } return evolvedType === type ? flowType : createFlowType(evolvedType, isIncomplete(flowType)); @@ -13954,10 +13951,10 @@ namespace ts { } } - function getContainingObjectLiteral(func: FunctionLike) { + function getContainingObjectLiteral(func: FunctionLike): ObjectLiteralExpression | undefined { return (func.kind === SyntaxKind.MethodDeclaration || func.kind === SyntaxKind.GetAccessor || - func.kind === SyntaxKind.SetAccessor) && func.parent.kind === SyntaxKind.ObjectLiteralExpression ? func.parent : + func.kind === SyntaxKind.SetAccessor) && func.parent.kind === SyntaxKind.ObjectLiteralExpression ? func.parent : func.kind === SyntaxKind.FunctionExpression && func.parent.kind === SyntaxKind.PropertyAssignment ? func.parent.parent : undefined; } @@ -14097,17 +14094,17 @@ namespace ts { return getTypeFromTypeNode(typeNode); } if (declaration.kind === SyntaxKind.Parameter) { - const type = getContextuallyTypedParameterType(declaration); + const type = getContextuallyTypedParameterType(declaration); if (type) { return type; } } if (isBindingPattern(declaration.name)) { - return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false); + return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ true, /*reportErrors*/ false); } if (isBindingPattern(declaration.parent)) { const parentDeclaration = declaration.parent.parent; - const name = (declaration as BindingElement).propertyName || (declaration as BindingElement).name; + const name = (declaration as BindingElement).propertyName || declaration.name; if (parentDeclaration.kind !== SyntaxKind.BindingElement) { const parentTypeNode = getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !isBindingPattern(name)) { @@ -14891,19 +14888,19 @@ namespace ts { let type: Type; if (memberDecl.kind === SyntaxKind.PropertyAssignment) { if (memberDecl.name.kind === SyntaxKind.ComputedPropertyName) { - const t = checkComputedPropertyName(memberDecl.name); + const t = checkComputedPropertyName(memberDecl.name); if (t.flags & TypeFlags.Literal) { literalName = escapeLeadingUnderscores("" + (t as LiteralType).value); } } - type = checkPropertyAssignment(memberDecl, checkMode); + type = checkPropertyAssignment(memberDecl, checkMode); } else if (memberDecl.kind === SyntaxKind.MethodDeclaration) { - type = checkObjectLiteralMethod(memberDecl, checkMode); + type = checkObjectLiteralMethod(memberDecl, checkMode); } else { Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment); - type = checkExpressionForMutableLocation((memberDecl).name, checkMode); + type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -14922,8 +14919,8 @@ namespace ts { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. const isOptional = - (memberDecl.kind === SyntaxKind.PropertyAssignment && hasDefaultValue((memberDecl).initializer)) || - (memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment && (memberDecl).objectAssignmentInitializer); + (memberDecl.kind === SyntaxKind.PropertyAssignment && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= SymbolFlags.Optional; } @@ -14966,7 +14963,7 @@ namespace ts { hasComputedNumberProperty = false; typeFlags = 0; } - const type = checkExpression((memberDecl as SpreadAssignment).expression); + const type = checkExpression(memberDecl.expression); if (!isValidSpreadType(type)) { error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; @@ -15133,7 +15130,7 @@ namespace ts { if (isJsxAttribute(attributeDecl)) { const exprType = checkJsxAttribute(attributeDecl, checkMode); - const attributeSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.escapedName); + const attributeSymbol = createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; if (member.valueDeclaration) { @@ -15175,7 +15172,7 @@ namespace ts { const parent = openingLikeElement.parent.kind === SyntaxKind.JsxElement ? openingLikeElement.parent as JsxElement : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { - const childrenTypes: Type[] = checkJsxChildren(parent as JsxElement, checkMode); + const childrenTypes: Type[] = checkJsxChildren(parent, checkMode); if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { // Error if there is a attribute named "children" explicitly specified and children element. @@ -15239,7 +15236,7 @@ namespace ts { * @param node a JSXAttributes to be resolved of its type */ function checkJsxAttributes(node: JsxAttributes, checkMode: CheckMode) { - return createJsxAttributesTypeFromAttributesProperty(node.parent as JsxOpeningLikeElement, checkMode); + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } function getJsxType(name: __String) { @@ -15795,7 +15792,7 @@ namespace ts { if (!isJsxAttribute(attribute)) { continue; } - const attrName = attribute.name as Identifier; + const attrName = attribute.name; const isNotIgnoredJsxProperty = (isUnhyphenatedJsxName(idText(attrName)) || !!(getPropertyOfType(targetAttributesType, attrName.escapedText))); if (isNotIgnoredJsxProperty && !isKnownProperty(targetAttributesType, attrName.escapedText, /*isComparingJsxAttributes*/ true)) { error(attribute, Diagnostics.Property_0_does_not_exist_on_type_1, idText(attrName), typeToString(targetAttributesType)); @@ -15845,7 +15842,7 @@ namespace ts { function checkPropertyAccessibility(node: PropertyAccessExpression | QualifiedName | VariableLikeDeclaration, left: Expression | QualifiedName, type: Type, prop: Symbol): boolean { const flags = getDeclarationModifierFlagsFromSymbol(prop); const errorNode = node.kind === SyntaxKind.PropertyAccessExpression || node.kind === SyntaxKind.VariableDeclaration ? - (node).name : + node.name : (node).right; if (getCheckFlags(prop) & CheckFlags.ContainsPrivate) { @@ -16451,7 +16448,7 @@ namespace ts { } if (node.kind === SyntaxKind.TaggedTemplateExpression) { - checkExpression((node).template); + checkExpression(node.template); } else if (node.kind !== SyntaxKind.Decorator) { forEach((node).arguments, argument => { @@ -16542,18 +16539,15 @@ namespace ts { } if (node.kind === SyntaxKind.TaggedTemplateExpression) { - const tagExpression = node; - // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === SyntaxKind.TemplateExpression) { + if (node.template.kind === SyntaxKind.TemplateExpression) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. - const templateExpression = tagExpression.template; - const lastSpan = lastOrUndefined(templateExpression.templateSpans); + const lastSpan = lastOrUndefined(node.template.templateSpans); Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -16561,7 +16555,7 @@ namespace ts { // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, // then this might actually turn out to be a TemplateHead in the future; // so we consider the call to be incomplete. - const templateLiteral = tagExpression.template; + const templateLiteral = node.template; Debug.assert(templateLiteral.kind === SyntaxKind.NoSubstitutionTemplateLiteral); callIsIncomplete = !!templateLiteral.isUnterminated; } @@ -16571,10 +16565,9 @@ namespace ts { argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); } else { - const callExpression = node; - if (!callExpression.arguments) { + if (!node.arguments) { // This only happens when we have something of the form: 'new C' - Debug.assert(callExpression.kind === SyntaxKind.NewExpression); + Debug.assert(node.kind === SyntaxKind.NewExpression); return signature.minArgumentCount === 0; } @@ -16582,9 +16575,9 @@ namespace ts { argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; // If we are missing the close parenthesis, the call is incomplete. - callIsIncomplete = callExpression.arguments.end === callExpression.end; + callIsIncomplete = node.arguments.end === node.end; - typeArguments = callExpression.typeArguments; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } @@ -16811,7 +16804,7 @@ namespace ts { excludeArgument: boolean[], reportErrors: boolean) { if (isJsxOpeningLikeElement(node)) { - return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); + return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } const thisType = getThisTypeOfSignature(signature); if (thisType && thisType !== voidType && node.kind !== SyntaxKind.NewExpression) { @@ -16858,7 +16851,7 @@ namespace ts { */ function getThisArgumentOfCall(node: CallLikeExpression): LeftHandSideExpression { if (node.kind === SyntaxKind.CallExpression) { - const callee = (node).expression; + const callee = node.expression; if (callee.kind === SyntaxKind.PropertyAccessExpression) { return (callee as PropertyAccessExpression).expression; } @@ -16879,10 +16872,10 @@ namespace ts { */ function getEffectiveCallArguments(node: CallLikeExpression): ReadonlyArray { if (node.kind === SyntaxKind.TaggedTemplateExpression) { - const template = (node).template; + const template = node.template; const args: Expression[] = [undefined]; if (template.kind === SyntaxKind.TemplateExpression) { - forEach((template).templateSpans, span => { + forEach(template.templateSpans, span => { args.push(span.expression); }); } @@ -17134,7 +17127,7 @@ namespace ts { // a special first argument, and string literals get string literal types // unless we're reporting errors if (node.kind === SyntaxKind.Decorator) { - return getEffectiveDecoratorArgumentType(node, argIndex); + return getEffectiveDecoratorArgumentType(node, argIndex); } else if (argIndex === 0 && node.kind === SyntaxKind.TaggedTemplateExpression) { return getGlobalTemplateStringsArrayType(); @@ -17164,11 +17157,11 @@ namespace ts { function getEffectiveArgumentErrorNode(node: CallLikeExpression, argIndex: number, arg: Expression) { if (node.kind === SyntaxKind.Decorator) { // For a decorator, we use the expression of the decorator for error reporting. - return (node).expression; + return node.expression; } else if (argIndex === 0 && node.kind === SyntaxKind.TaggedTemplateExpression) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. - return (node).template; + return node.template; } else { return arg; @@ -17260,7 +17253,7 @@ namespace ts { // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. const signatureHelpTrailingComma = - candidatesOutArray && node.kind === SyntaxKind.CallExpression && (node).arguments.hasTrailingComma; + candidatesOutArray && node.kind === SyntaxKind.CallExpression && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument @@ -17814,17 +17807,17 @@ namespace ts { function resolveSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature { switch (node.kind) { case SyntaxKind.CallExpression: - return resolveCallExpression(node, candidatesOutArray); + return resolveCallExpression(node, candidatesOutArray); case SyntaxKind.NewExpression: - return resolveNewExpression(node, candidatesOutArray); + return resolveNewExpression(node, candidatesOutArray); case SyntaxKind.TaggedTemplateExpression: - return resolveTaggedTemplateExpression(node, candidatesOutArray); + return resolveTaggedTemplateExpression(node, candidatesOutArray); case SyntaxKind.Decorator: - return resolveDecorator(node, candidatesOutArray); + return resolveDecorator(node, candidatesOutArray); case SyntaxKind.JsxOpeningElement: case SyntaxKind.JsxSelfClosingElement: // This code-path is called by language service - return resolveStatelessJsxOpeningLikeElement(node, checkExpression((node).tagName), candidatesOutArray) || unknownSignature; + return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); } @@ -18210,7 +18203,7 @@ namespace ts { if (globalPromiseType !== emptyGenericType) { // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type promisedType = getAwaitedType(promisedType) || emptyObjectType; - return createTypeReference(globalPromiseType, [promisedType]); + return createTypeReference(globalPromiseType, [promisedType]); } return emptyObjectType; @@ -18241,7 +18234,7 @@ namespace ts { const functionFlags = getFunctionFlags(func); let type: Type; if (func.body.kind !== SyntaxKind.Block) { - type = checkExpressionCached(func.body, checkMode); + type = checkExpressionCached(func.body, checkMode); if (functionFlags & FunctionFlags.Async) { // From within an async function you can return either a non-promise value or a promise. Any // Promise/A+ compatible implementation will always assimilate any foreign promise, so the @@ -18526,9 +18519,9 @@ namespace ts { } if (produceDiagnostics && node.kind !== SyntaxKind.MethodDeclaration) { - checkCollisionWithCapturedSuperVariable(node, (node).name); - checkCollisionWithCapturedThisVariable(node, (node).name); - checkCollisionWithCapturedNewTargetVariable(node, (node).name); + checkCollisionWithCapturedSuperVariable(node, node.name); + checkCollisionWithCapturedThisVariable(node, node.name); + checkCollisionWithCapturedNewTargetVariable(node, node.name); } return type; @@ -18568,7 +18561,7 @@ namespace ts { // should not be checking assignability of a promise to the return type. Instead, we need to // check assignability of the awaited type of the expression body against the promised type of // its return type annotation. - const exprType = checkExpression(node.body); + const exprType = checkExpression(node.body); if (returnOrPromisedType) { if ((functionFlags & FunctionFlags.AsyncGenerator) === FunctionFlags.Async) { // Async function const awaitedType = checkAwaitedType(exprType, node.body, Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); @@ -18849,9 +18842,9 @@ namespace ts { /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType: Type, property: ObjectLiteralElementLike, allProperties?: ReadonlyArray) { if (property.kind === SyntaxKind.PropertyAssignment || property.kind === SyntaxKind.ShorthandPropertyAssignment) { - const name = (property).name; + const name = property.name; if (name.kind === SyntaxKind.ComputedPropertyName) { - checkComputedPropertyName(name); + checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { return undefined; @@ -18865,11 +18858,11 @@ namespace ts { getIndexTypeOfType(objectLiteralType, IndexKind.String); if (type) { if (property.kind === SyntaxKind.ShorthandPropertyAssignment) { - return checkDestructuringAssignment(property, type); + return checkDestructuringAssignment(property, type); } else { // non-shorthand property assignments should always have initializers - return checkDestructuringAssignment((property).initializer, type); + return checkDestructuringAssignment(property.initializer, type); } } else { @@ -18971,7 +18964,7 @@ namespace ts { target = (exprOrAssignment).name; } else { - target = exprOrAssignment; + target = exprOrAssignment; } if (target.kind === SyntaxKind.BinaryExpression && (target).operatorToken.kind === SyntaxKind.EqualsToken) { @@ -19373,7 +19366,7 @@ namespace ts { // It is worth asking whether this is what we really want though. // A place where we actually *are* concerned with the expressions' types are // in tagged templates. - forEach((node).templateSpans, templateSpan => { + forEach(node.templateSpans, templateSpan => { checkExpression(templateSpan.expression); }); @@ -19471,10 +19464,10 @@ namespace ts { // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. if (node.name.kind === SyntaxKind.ComputedPropertyName) { - checkComputedPropertyName(node.name); + checkComputedPropertyName(node.name); } - return checkExpressionForMutableLocation((node).initializer, checkMode); + return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node: MethodDeclaration, checkMode?: CheckMode): Type { @@ -19485,7 +19478,7 @@ namespace ts { // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. if (node.name.kind === SyntaxKind.ComputedPropertyName) { - checkComputedPropertyName(node.name); + checkComputedPropertyName(node.name); } const uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -19559,8 +19552,8 @@ namespace ts { type = checkQualifiedName(node); } else { - const uninstantiatedType = checkExpressionWorker(node, checkMode); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); + const uninstantiatedType = checkExpressionWorker(node, checkMode); + type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { @@ -20179,7 +20172,7 @@ namespace ts { // Skip past any prologue directives to find the first statement // to ensure that it was a super call. if (superCallShouldBeFirst) { - const statements = (node.body).statements; + const statements = node.body.statements; let superCallStatement: ExpressionStatement; for (const statement of statements) { @@ -20220,7 +20213,7 @@ namespace ts { // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. if (node.name.kind === SyntaxKind.ComputedPropertyName) { - checkComputedPropertyName(node.name); + checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 @@ -21327,7 +21320,7 @@ namespace ts { if (node.name && node.name.kind === SyntaxKind.ComputedPropertyName) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals - checkComputedPropertyName(node.name); + checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { @@ -21931,7 +21924,7 @@ namespace ts { checkExternalEmitHelpers(node, ExternalEmitHelpers.Read); } - forEach((node.name).elements, checkSourceElement); + forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body if (node.initializer && getRootDeclaration(node).kind === SyntaxKind.Parameter && nodeIsMissing((getContainingFunction(node) as FunctionLikeDeclaration).body)) { @@ -21985,7 +21978,7 @@ namespace ts { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); if (node.kind === SyntaxKind.VariableDeclaration || node.kind === SyntaxKind.BindingElement) { - checkVarDeclaredNamesNotShadowed(node); + checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); @@ -22035,7 +22028,7 @@ namespace ts { } function checkBindingElement(node: BindingElement) { - checkGrammarBindingElement(node); + checkGrammarBindingElement(node); return checkVariableLikeDeclaration(node); } @@ -22095,7 +22088,7 @@ namespace ts { forEach((node.initializer).declarations, checkVariableDeclaration); } else { - checkExpression(node.initializer); + checkExpression(node.initializer); } } @@ -22111,7 +22104,7 @@ namespace ts { checkGrammarForInOrForOfStatement(node); if (node.kind === SyntaxKind.ForOfStatement) { - if ((node).awaitModifier) { + if (node.awaitModifier) { const functionFlags = getFunctionFlags(getContainingFunction(node)); if ((functionFlags & (FunctionFlags.Invalid | FunctionFlags.Async)) === FunctionFlags.Async && languageVersion < ScriptTarget.ESNext) { // for..await..of in an async function or async generator function prior to ESNext requires the __asyncValues helper @@ -22133,7 +22126,7 @@ namespace ts { checkForInOrForOfVariableDeclaration(node); } else { - const varExpr = node.initializer; + const varExpr = node.initializer; const iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side @@ -22185,7 +22178,7 @@ namespace ts { // for (Var in Expr) Statement // Var must be an expression classified as a reference of type Any or the String primitive type, // and Expr must be an expression of type Any, an object type, or a type parameter type. - const varExpr = node.initializer; + const varExpr = node.initializer; const leftType = checkExpression(varExpr); if (varExpr.kind === SyntaxKind.ArrayLiteralExpression || varExpr.kind === SyntaxKind.ObjectLiteralExpression) { error(varExpr, Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -22652,11 +22645,10 @@ namespace ts { } if (produceDiagnostics && clause.kind === SyntaxKind.CaseClause) { - const caseClause = clause; // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. - let caseType = checkExpression(caseClause.expression); + let caseType = checkExpression(clause.expression); const caseIsLiteral = isLiteralType(caseType); let comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -22665,7 +22657,7 @@ namespace ts { } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { // expressionType is not comparable to caseType, try the reversed check and report errors if it fails - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, /*headMessage*/ undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, /*headMessage*/ undefined); } } forEach(clause.statements, checkSourceElement); @@ -22759,7 +22751,7 @@ namespace ts { }); if (getObjectFlags(type) & ObjectFlags.Class && isClassLike(type.symbol.valueDeclaration)) { - const classDeclaration = type.symbol.valueDeclaration; + const classDeclaration = type.symbol.valueDeclaration; for (const member of classDeclaration.members) { // Only process instance properties with computed names here. // Static properties cannot be in conflict with indexers, @@ -22850,7 +22842,7 @@ namespace ts { case "symbol": case "void": case "object": - error(name, message, (name).escapedText as string); + error(name, message, name.escapedText as string); } } @@ -23355,11 +23347,11 @@ namespace ts { } function computeMemberValue(member: EnumMember, autoValue: number) { - if (isComputedNonLiteralName(member.name)) { + if (isComputedNonLiteralName(member.name)) { error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums); } else { - const text = getTextOfPropertyName(member.name); + const text = getTextOfPropertyName(member.name); if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) { error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name); } @@ -23745,17 +23737,17 @@ namespace ts { function getFirstIdentifier(node: EntityNameOrEntityNameExpression): Identifier { switch (node.kind) { case SyntaxKind.Identifier: - return node; + return node; case SyntaxKind.QualifiedName: do { - node = (node).left; + node = node.left; } while (node.kind !== SyntaxKind.Identifier); - return node; + return node; case SyntaxKind.PropertyAccessExpression: do { - node = (node).expression; + node = node.expression; } while (node.kind !== SyntaxKind.Identifier); - return node; + return node; } } @@ -23765,7 +23757,7 @@ namespace ts { error(moduleName, Diagnostics.String_literal_expected); return false; } - const inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && isAmbientModule(node.parent.parent); + const inAmbientExternalModule = node.parent.kind === SyntaxKind.ModuleBlock && isAmbientModule(node.parent.parent); if (node.parent.kind !== SyntaxKind.SourceFile && !inAmbientExternalModule) { error(moduleName, node.kind === SyntaxKind.ExportDeclaration ? Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : @@ -23841,10 +23833,10 @@ namespace ts { } if (importClause.namedBindings) { if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { - checkImportBinding(importClause.namedBindings); + checkImportBinding(importClause.namedBindings); } else { - forEach((importClause.namedBindings).elements, checkImportBinding); + forEach(importClause.namedBindings.elements, checkImportBinding); } } } @@ -23868,7 +23860,7 @@ namespace ts { if (target !== unknownSymbol) { if (target.flags & SymbolFlags.Value) { // Target is a value symbol, check that it is not hidden by a local declaration with the same name - const moduleName = getFirstIdentifier(node.moduleReference); + const moduleName = getFirstIdentifier(node.moduleReference); if (!(resolveEntityName(moduleName, SymbolFlags.Value | SymbolFlags.Namespace).flags & SymbolFlags.Namespace)) { error(moduleName, Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, declarationNameToString(moduleName)); } @@ -23937,7 +23929,7 @@ namespace ts { if (compilerOptions.declaration) { collectLinkedAliases(node.propertyName || node.name, /*setVisibility*/ true); } - if (!(node.parent.parent).moduleSpecifier) { + if (!node.parent.parent.moduleSpecifier) { const exportedName = node.propertyName || node.name; // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases) const symbol = resolveName(exportedName, exportedName.escapedText, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias, @@ -23957,7 +23949,7 @@ namespace ts { return; } - const container = node.parent.kind === SyntaxKind.SourceFile ? node.parent : node.parent.parent; + const container = node.parent.kind === SyntaxKind.SourceFile ? node.parent : node.parent.parent; if (container.kind === SyntaxKind.ModuleDeclaration && !isAmbientModule(container)) { if (node.isExportEquals) { error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); @@ -24645,11 +24637,11 @@ namespace ts { /*all meanings*/ SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias); } - if (entityName.kind !== SyntaxKind.PropertyAccessExpression && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== SyntaxKind.PropertyAccessExpression && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - const importEqualsDeclaration = getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration); + const importEqualsDeclaration = getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration); Debug.assert(importEqualsDeclaration !== undefined); - return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); + return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { @@ -24843,8 +24835,8 @@ namespace ts { /** Returns the target of an export specifier without following aliases */ function getExportSpecifierLocalTargetSymbol(node: ExportSpecifier): Symbol { - return (node.parent.parent).moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : + return node.parent.parent.moduleSpecifier ? + getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias); } @@ -25305,7 +25297,7 @@ namespace ts { } function getEnumMemberValue(node: EnumMember): string | number { - computeEnumMemberValues(node.parent); + computeEnumMemberValues(node.parent); return getNodeLinks(node).enumMemberValue; } @@ -25321,7 +25313,7 @@ namespace ts { function getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number { if (node.kind === SyntaxKind.EnumMember) { - return getEnumMemberValue(node); + return getEnumMemberValue(node); } const symbol = getNodeLinks(node).resolvedSymbol; @@ -25636,7 +25628,7 @@ namespace ts { if (!moduleSymbol) { return undefined; } - return getDeclarationOfKind(moduleSymbol, SyntaxKind.SourceFile) as SourceFile; + return getDeclarationOfKind(moduleSymbol, SyntaxKind.SourceFile); } function initializeTypeChecker() { @@ -26358,13 +26350,13 @@ namespace ts { const name = prop.name; if (name.kind === SyntaxKind.ComputedPropertyName) { // If the name is not a ComputedPropertyName, the grammar checking will skip it - checkGrammarComputedPropertyName(name); + checkGrammarComputedPropertyName(name); } - if (prop.kind === SyntaxKind.ShorthandPropertyAssignment && !inDestructuring && (prop).objectAssignmentInitializer) { + if (prop.kind === SyntaxKind.ShorthandPropertyAssignment && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error - return grammarErrorOnNode((prop).equalsToken, Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); + return grammarErrorOnNode(prop.equalsToken, Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } // Modifiers are never allowed on properties except for 'async' on a method declaration @@ -26389,9 +26381,9 @@ namespace ts { case SyntaxKind.PropertyAssignment: case SyntaxKind.ShorthandPropertyAssignment: // Grammar checking for computedPropertyName and shorthandPropertyAssignment - checkGrammarForInvalidQuestionMark((prop).questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); + checkGrammarForInvalidQuestionMark(prop.questionToken, Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === SyntaxKind.NumericLiteral) { - checkGrammarNumericLiteral(name); + checkGrammarNumericLiteral(name); } // falls through case SyntaxKind.MethodDeclaration: @@ -26443,8 +26435,7 @@ namespace ts { continue; } - const jsxAttr = (attr); - const name = jsxAttr.name; + const { name, initializer } = attr; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } @@ -26452,9 +26443,8 @@ namespace ts { return grammarErrorOnNode(name, Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - const initializer = jsxAttr.initializer; - if (initializer && initializer.kind === SyntaxKind.JsxExpression && !(initializer).expression) { - return grammarErrorOnNode(jsxAttr.initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === SyntaxKind.JsxExpression && !initializer.expression) { + return grammarErrorOnNode(initializer, Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -26714,7 +26704,7 @@ namespace ts { function checkGrammarBindingElement(node: BindingElement) { if (node.dotDotDotToken) { - const elements = (node.parent).elements; + const elements = node.parent.elements; if (node !== last(elements)) { return grammarErrorOnNode(node, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } @@ -26799,7 +26789,7 @@ namespace ts { } } else { - const elements = (name).elements; + const elements = name.elements; for (const element of elements) { if (!isOmittedExpression(element)) { return checkESModuleMarker(element.name); @@ -26810,12 +26800,12 @@ namespace ts { function checkGrammarNameInLetOrConstDeclarations(name: Identifier | BindingPattern): boolean { if (name.kind === SyntaxKind.Identifier) { - if ((name).originalKeywordKind === SyntaxKind.LetKeyword) { + if (name.originalKeywordKind === SyntaxKind.LetKeyword) { return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); } } else { - const elements = (name).elements; + const elements = name.elements; for (const element of elements) { if (!isOmittedExpression(element)) { checkGrammarNameInLetOrConstDeclarations(element.name); diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index f18a32889aa..a9b3568bfe6 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -350,8 +350,8 @@ namespace ts { // and also for non-optional initialized parameters that aren't a parameter property // these types may need to add `undefined`. const shouldUseResolverType = declaration.kind === SyntaxKind.Parameter && - (resolver.isRequiredInitializedParameter(declaration as ParameterDeclaration) || - resolver.isOptionalUninitializedParameterProperty(declaration as ParameterDeclaration)); + (resolver.isRequiredInitializedParameter(declaration) || + resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { // Write the type emitType(type); @@ -839,10 +839,10 @@ namespace ts { function isVisibleNamedBinding(namedBindings: NamespaceImport | NamedImports): boolean { if (namedBindings) { if (namedBindings.kind === SyntaxKind.NamespaceImport) { - return resolver.isDeclarationVisible(namedBindings); + return resolver.isDeclarationVisible(namedBindings); } else { - return forEach((namedBindings).elements, namedImport => resolver.isDeclarationVisible(namedImport)); + return namedBindings.elements.some(namedImport => resolver.isDeclarationVisible(namedImport)); } } } @@ -865,11 +865,11 @@ namespace ts { } if (node.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { write("* as "); - writeTextOfNode(currentText, (node.importClause.namedBindings).name); + writeTextOfNode(currentText, node.importClause.namedBindings.name); } else { write("{ "); - emitCommaList((node.importClause.namedBindings).elements, emitImportOrExportSpecifier, resolver.isDeclarationVisible); + emitCommaList(node.importClause.namedBindings.elements, emitImportOrExportSpecifier, resolver.isDeclarationVisible); write(" }"); } } @@ -886,18 +886,8 @@ namespace ts { // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== SyntaxKind.ModuleDeclaration; - let moduleSpecifier: Node; - if (parent.kind === SyntaxKind.ImportEqualsDeclaration) { - const node = parent as ImportEqualsDeclaration; - moduleSpecifier = getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === SyntaxKind.ModuleDeclaration) { - moduleSpecifier = (parent).name; - } - else { - const node = parent as (ImportDeclaration | ExportDeclaration); - moduleSpecifier = node.moduleSpecifier; - } + const moduleSpecifier = parent.kind === SyntaxKind.ImportEqualsDeclaration ? getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === SyntaxKind.ModuleDeclaration ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === SyntaxKind.StringLiteral && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { const moduleName = getExternalModuleNameFromDeclaration(host, resolver, parent); @@ -1293,7 +1283,7 @@ namespace ts { // so there is no check needed to see if declaration is visible if (node.kind !== SyntaxKind.VariableDeclaration || isVariableDeclarationVisible(node)) { if (isBindingPattern(node.name)) { - emitBindingPattern(node.name); + emitBindingPattern(node.name); } else { writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); @@ -1301,7 +1291,7 @@ namespace ts { // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature || - (node.kind === SyntaxKind.Parameter && !isParameterPropertyDeclaration(node))) && hasQuestionToken(node)) { + (node.kind === SyntaxKind.Parameter && !isParameterPropertyDeclaration(node))) && hasQuestionToken(node)) { write("?"); } if ((node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature) && node.parent.kind === SyntaxKind.TypeLiteral) { @@ -1389,7 +1379,7 @@ namespace ts { if (bindingElement.name) { if (isBindingPattern(bindingElement.name)) { - emitBindingPattern(bindingElement.name); + emitBindingPattern(bindingElement.name); } else { writeTextOfNode(currentText, bindingElement.name); @@ -1782,7 +1772,7 @@ namespace ts { // For bindingPattern, we can't simply writeTextOfNode from the source file // because we want to omit the initializer and using writeTextOfNode will result in initializer get emitted. // Therefore, we will have to recursively emit each element in the bindingPattern. - emitBindingPattern(node.name); + emitBindingPattern(node.name); } else { writeTextOfNode(currentText, node.name); @@ -1921,7 +1911,7 @@ namespace ts { // emit : declare function foo([a, [[b]], c]: [number, [[string]], number]): void; // original with rest: function foo([a, ...c]) {} // emit : declare function foo([a, ...c]): void; - emitBindingPattern(bindingElement.name); + emitBindingPattern(bindingElement.name); } else { Debug.assert(bindingElement.name.kind === SyntaxKind.Identifier); diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 735e0d67f47..df1394efd00 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -951,7 +951,7 @@ namespace ts { function emitEntityName(node: EntityName) { if (node.kind === SyntaxKind.Identifier) { - emitExpression(node); + emitExpression(node); } else { emit(node); @@ -1709,7 +1709,7 @@ namespace ts { emit(node); } else { - emitExpression(node); + emitExpression(node); } } } @@ -2068,7 +2068,7 @@ namespace ts { function emitModuleReference(node: ModuleReference) { if (node.kind === SyntaxKind.Identifier) { - emitExpression(node); + emitExpression(node); } else { emit(node); @@ -2472,12 +2472,12 @@ namespace ts { function emitPrologueDirectivesIfNeeded(sourceFileOrBundle: Bundle | SourceFile) { if (isSourceFile(sourceFileOrBundle)) { - setSourceFile(sourceFileOrBundle as SourceFile); - emitPrologueDirectives((sourceFileOrBundle as SourceFile).statements); + setSourceFile(sourceFileOrBundle); + emitPrologueDirectives(sourceFileOrBundle.statements); } else { const seenPrologueDirectives = createMap(); - for (const sourceFile of (sourceFileOrBundle as Bundle).sourceFiles) { + for (const sourceFile of sourceFileOrBundle.sourceFiles) { setSourceFile(sourceFile); emitPrologueDirectives(sourceFile.statements, /*startWithNewLine*/ true, seenPrologueDirectives); } diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 8166196e469..647ae6983fa 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -644,7 +644,7 @@ namespace ts { } export function updateFunctionTypeNode(node: FunctionTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined) { - return updateSignatureDeclaration(node, typeParameters, parameters, type); + return updateSignatureDeclaration(node, typeParameters, parameters, type); } export function createConstructorTypeNode(typeParameters: TypeParameterDeclaration[] | undefined, parameters: ParameterDeclaration[], type: TypeNode | undefined) { @@ -652,7 +652,7 @@ namespace ts { } export function updateConstructorTypeNode(node: ConstructorTypeNode, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined) { - return updateSignatureDeclaration(node, typeParameters, parameters, type); + return updateSignatureDeclaration(node, typeParameters, parameters, type); } export function createTypeQueryNode(exprName: EntityName) { @@ -1285,7 +1285,7 @@ namespace ts { export function createYield(asteriskTokenOrExpression?: AsteriskToken | Expression, expression?: Expression) { const node = createSynthesizedNode(SyntaxKind.YieldExpression); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === SyntaxKind.AsteriskToken ? asteriskTokenOrExpression : undefined; - node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== SyntaxKind.AsteriskToken ? asteriskTokenOrExpression : expression; + node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== SyntaxKind.AsteriskToken ? asteriskTokenOrExpression : expression; return node; } @@ -3415,13 +3415,13 @@ namespace ts { switch (property.kind) { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); + return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); case SyntaxKind.PropertyAssignment: - return createExpressionForPropertyAssignment(property, receiver); + return createExpressionForPropertyAssignment(property, receiver); case SyntaxKind.ShorthandPropertyAssignment: - return createExpressionForShorthandPropertyAssignment(property, receiver); + return createExpressionForShorthandPropertyAssignment(property, receiver); case SyntaxKind.MethodDeclaration: - return createExpressionForMethodDeclaration(property, receiver); + return createExpressionForMethodDeclaration(property, receiver); } } @@ -4065,13 +4065,13 @@ namespace ts { export function parenthesizePostfixOperand(operand: Expression) { return isLeftHandSideExpression(operand) - ? operand + ? operand : setTextRange(createParen(operand), operand); } export function parenthesizePrefixOperand(operand: Expression) { return isUnaryExpression(operand) - ? operand + ? operand : setTextRange(createParen(operand), operand); } @@ -4203,7 +4203,7 @@ namespace ts { export function parenthesizeConciseBody(body: ConciseBody): ConciseBody { if (!isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === SyntaxKind.ObjectLiteralExpression) { - return setTextRange(createParen(body), body); + return setTextRange(createParen(body), body); } return body; @@ -4370,10 +4370,10 @@ namespace ts { const name = namespaceDeclaration.name; return isGeneratedIdentifier(name) ? name : createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name)); } - if (node.kind === SyntaxKind.ImportDeclaration && (node).importClause) { + if (node.kind === SyntaxKind.ImportDeclaration && node.importClause) { return getGeneratedNameForNode(node); } - if (node.kind === SyntaxKind.ExportDeclaration && (node).moduleSpecifier) { + if (node.kind === SyntaxKind.ExportDeclaration && node.moduleSpecifier) { return getGeneratedNameForNode(node); } return undefined; @@ -4494,7 +4494,7 @@ namespace ts { // `{a}` in `let [{a} = 1] = ...` // `[a]` in `let [[a]] = ...` // `[a]` in `let [[a] = 1] = ...` - return bindingElement.name; + return bindingElement.name; } if (isObjectLiteralElementLike(bindingElement)) { @@ -4556,12 +4556,12 @@ namespace ts { case SyntaxKind.Parameter: case SyntaxKind.BindingElement: // `...` in `let [...a] = ...` - return (bindingElement).dotDotDotToken; + return bindingElement.dotDotDotToken; case SyntaxKind.SpreadElement: case SyntaxKind.SpreadAssignment: // `...` in `[...a] = ...` - return bindingElement; + return bindingElement; } return undefined; @@ -4577,8 +4577,8 @@ namespace ts { // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` // `1` in `let { 1: b } = ...` - if ((bindingElement).propertyName) { - const propertyName = (bindingElement).propertyName; + if (bindingElement.propertyName) { + const propertyName = bindingElement.propertyName; return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; @@ -4591,8 +4591,8 @@ namespace ts { // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` // `1` in `({ 1: b } = ...)` - if ((bindingElement).name) { - const propertyName = (bindingElement).name; + if (bindingElement.name) { + const propertyName = bindingElement.name; return isComputedPropertyName(propertyName) && isStringOrNumericLiteral(propertyName.expression) ? propertyName.expression : propertyName; @@ -4602,7 +4602,7 @@ namespace ts { case SyntaxKind.SpreadAssignment: // `a` in `({ ...a } = ...)` - return (bindingElement).name; + return bindingElement.name; } const target = getTargetOfBindingOrAssignmentElement(bindingElement); @@ -4639,7 +4639,7 @@ namespace ts { Debug.assertNode(element.name, isIdentifier); return setOriginalNode(setTextRange(createSpread(element.name), element), element); } - const expression = convertToAssignmentElementTarget(element.name); + const expression = convertToAssignmentElementTarget(element.name); return element.initializer ? setOriginalNode( setTextRange( @@ -4661,7 +4661,7 @@ namespace ts { return setOriginalNode(setTextRange(createSpreadAssignment(element.name), element), element); } if (element.propertyName) { - const expression = convertToAssignmentElementTarget(element.name); + const expression = convertToAssignmentElementTarget(element.name); return setOriginalNode(setTextRange(createPropertyAssignment(element.propertyName, element.initializer ? createAssignment(expression, element.initializer) : expression), element), element); } Debug.assertNode(element.name, isIdentifier); @@ -4694,7 +4694,7 @@ namespace ts { ); } Debug.assertNode(node, isObjectLiteralExpression); - return node; + return node; } export function convertToArrayAssignmentPattern(node: ArrayBindingOrAssignmentPattern) { @@ -4708,7 +4708,7 @@ namespace ts { ); } Debug.assertNode(node, isArrayLiteralExpression); - return node; + return node; } export function convertToAssignmentElementTarget(node: BindingOrAssignmentElementTarget): Expression { @@ -4717,6 +4717,6 @@ namespace ts { } Debug.assertNode(node, isExpression); - return node; + return node; } } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index b71983b9783..70ddb7b791d 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -690,7 +690,7 @@ namespace ts { // Prime the scanner. nextToken(); if (token() === SyntaxKind.EndOfFileToken) { - sourceFile.endOfFileToken = parseTokenNode(); + sourceFile.endOfFileToken = parseTokenNode(); } else if (token() === SyntaxKind.OpenBraceToken || lookAhead(() => token() === SyntaxKind.StringLiteral)) { @@ -773,7 +773,7 @@ namespace ts { sourceFile.statements = parseList(ParsingContext.SourceElements, parseStatement); Debug.assert(token() === SyntaxKind.EndOfFileToken); - sourceFile.endOfFileToken = addJSDocComment(parseTokenNode() as EndOfFileToken); + sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); setExternalModuleIndicator(sourceFile); @@ -1794,7 +1794,7 @@ namespace ts { // into an actual .ConstructorDeclaration. const methodDeclaration = node; const nameIsConstructor = methodDeclaration.name.kind === SyntaxKind.Identifier && - (methodDeclaration.name).originalKeywordKind === SyntaxKind.ConstructorKeyword; + methodDeclaration.name.originalKeywordKind === SyntaxKind.ConstructorKeyword; return !nameIsConstructor; } @@ -3175,7 +3175,7 @@ namespace ts { // Note: we call reScanGreaterToken so that we get an appropriately merged token // for cases like `> > =` becoming `>>=` if (isLeftHandSideExpression(expr) && isAssignmentOperator(reScanGreaterToken())) { - return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); + return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } // It wasn't an assignment or a lambda. This is a conditional expression: @@ -3624,7 +3624,7 @@ namespace ts { } } else { - leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); + leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); } } @@ -4079,7 +4079,7 @@ namespace ts { else { Debug.assert(opening.kind === SyntaxKind.JsxSelfClosingElement); // Nothing else to do for self-closing elements - result = opening; + result = opening; } // If the user writes the invalid code '
' in an expression context (i.e. not wrapped in @@ -4097,7 +4097,7 @@ namespace ts { badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; - badNode.operatorToken = createMissingNode(SyntaxKind.CommaToken, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined); + badNode.operatorToken = createMissingNode(SyntaxKind.CommaToken, /*reportAtCurrentPosition*/ false, /*diagnosticMessage*/ undefined); badNode.operatorToken.pos = badNode.operatorToken.end = badNode.right.pos; return badNode; } @@ -5253,7 +5253,7 @@ namespace ts { if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - const missing = createMissingNode(SyntaxKind.MissingDeclaration, /*reportAtCurrentPosition*/ true, Diagnostics.Declaration_expected); + const missing = createMissingNode(SyntaxKind.MissingDeclaration, /*reportAtCurrentPosition*/ true, Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 1f2a3bfcd5d..2cba011131e 100755 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -812,7 +812,7 @@ namespace ts { if (!result) { // There were no unresolved/ambient resolutions. Debug.assert(resolutions.length === moduleNames.length); - return resolutions; + return resolutions; } let j = 0; diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 0956c1075ef..7e4769a3e50 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -1995,7 +1995,7 @@ namespace ts { // If we are here it is because this is a destructuring assignment. if (isDestructuringAssignment(node)) { return flattenDestructuringAssignment( - node, + node, visitor, context, FlattenLevel.All, @@ -2023,7 +2023,7 @@ namespace ts { ); } else { - assignment = createBinary(decl.name, SyntaxKind.EqualsToken, visitNode(decl.initializer, visitor, isExpression)); + assignment = createBinary(decl.name, SyntaxKind.EqualsToken, visitNode(decl.initializer, visitor, isExpression)); setTextRange(assignment, decl); } @@ -2632,10 +2632,10 @@ namespace ts { function visit(node: Identifier | BindingPattern) { if (node.kind === SyntaxKind.Identifier) { - state.hoistedLocalVariables.push((node)); + state.hoistedLocalVariables.push(node); } else { - for (const element of (node).elements) { + for (const element of node.elements) { if (!isOmittedExpression(element)) { visit(element.name); } @@ -2716,7 +2716,7 @@ namespace ts { convertedLoopState = outerConvertedLoopState; if (loopOutParameters.length || lexicalEnvironment) { - const statements = isBlock(loopBody) ? (loopBody).statements.slice() : [loopBody]; + const statements = isBlock(loopBody) ? loopBody.statements.slice() : [loopBody]; if (loopOutParameters.length) { copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements); } @@ -2856,7 +2856,7 @@ namespace ts { loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); } else { - let clone = getMutableClone(node); + let clone = getMutableClone(node); // clean statement part clone.statement = undefined; // visit childnodes to transform initializer/condition/incrementor parts @@ -3039,7 +3039,7 @@ namespace ts { switch (property.kind) { case SyntaxKind.GetAccessor: case SyntaxKind.SetAccessor: - const accessors = getAllAccessorDeclarations(node.properties, property); + const accessors = getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } @@ -3047,15 +3047,15 @@ namespace ts { break; case SyntaxKind.MethodDeclaration: - expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); + expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; case SyntaxKind.PropertyAssignment: - expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); + expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; case SyntaxKind.ShorthandPropertyAssignment: - expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); + expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: diff --git a/src/compiler/transformers/es2017.ts b/src/compiler/transformers/es2017.ts index 905686c8861..0c6b25cf0b5 100644 --- a/src/compiler/transformers/es2017.ts +++ b/src/compiler/transformers/es2017.ts @@ -183,7 +183,7 @@ namespace ts { : visitNode(node.initializer, visitor, isForInitializer), visitNode(node.condition, visitor, isExpression), visitNode(node.incrementor, visitor, isExpression), - visitNode((node).statement, asyncBodyVisitor, isStatement, liftToBlock) + visitNode(node.statement, asyncBodyVisitor, isStatement, liftToBlock) ); } diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 82ff52ead90..74afe44a097 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -167,7 +167,7 @@ namespace ts { objects.push(createObjectLiteral(chunkObject)); chunkObject = undefined; } - const target = (e as SpreadAssignment).expression; + const target = e.expression; objects.push(visitNode(target, visitor, isExpression)); } else { @@ -175,8 +175,7 @@ namespace ts { chunkObject = []; } if (e.kind === SyntaxKind.PropertyAssignment) { - const p = e as PropertyAssignment; - chunkObject.push(createPropertyAssignment(p.name, visitNode(p.initializer, visitor, isExpression))); + chunkObject.push(createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression))); } else { chunkObject.push(visitNode(e, visitor, isObjectLiteralElementLike)); diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index 8df05e4f3ab..1a4c82020c7 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -1771,16 +1771,15 @@ namespace ts { for (let i = clausesWritten; i < numClauses; i++) { const clause = caseBlock.clauses[i]; if (clause.kind === SyntaxKind.CaseClause) { - const caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } pendingClauses.push( createCaseClause( - visitNode(caseClause.expression, visitor, isExpression), + visitNode(clause.expression, visitor, isExpression), [ - createInlineBreak(clauseLabels[i], /*location*/ caseClause.expression) + createInlineBreak(clauseLabels[i], /*location*/ clause.expression) ] ) ); diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index 35eaae2a5cf..94e41af9c28 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -57,19 +57,19 @@ namespace ts { function transformJsxChildToExpression(node: JsxChild): Expression { switch (node.kind) { case SyntaxKind.JsxText: - return visitJsxText(node); + return visitJsxText(node); case SyntaxKind.JsxExpression: - return visitJsxExpression(node); + return visitJsxExpression(node); case SyntaxKind.JsxElement: - return visitJsxElement(node, /*isChild*/ true); + return visitJsxElement(node, /*isChild*/ true); case SyntaxKind.JsxSelfClosingElement: - return visitJsxSelfClosingElement(node, /*isChild*/ true); + return visitJsxSelfClosingElement(node, /*isChild*/ true); case SyntaxKind.JsxFragment: - return visitJsxFragment(node, /*isChild*/ true); + return visitJsxFragment(node, /*isChild*/ true); default: Debug.failBadSyntaxKind(node); @@ -171,15 +171,15 @@ namespace ts { else if (node.kind === SyntaxKind.StringLiteral) { // Always recreate the literal to escape any escape sequences or newlines which may be in the original jsx string and which // Need to be escaped to be handled correctly in a normal string - const literal = createLiteral(tryDecodeEntities((node).text) || (node).text); - literal.singleQuote = (node as StringLiteral).singleQuote !== undefined ? (node as StringLiteral).singleQuote : !isStringDoubleQuoted(node as StringLiteral, currentSourceFile); + const literal = createLiteral(tryDecodeEntities(node.text) || node.text); + literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !isStringDoubleQuoted(node, currentSourceFile); return setTextRange(literal, node); } else if (node.kind === SyntaxKind.JsxExpression) { if (node.expression === undefined) { return createTrue(); } - return visitJsxExpression(node); + return visitJsxExpression(node); } else { Debug.failBadSyntaxKind(node); @@ -279,10 +279,10 @@ namespace ts { function getTagName(node: JsxElement | JsxOpeningLikeElement): Expression { if (node.kind === SyntaxKind.JsxElement) { - return getTagName((node).openingElement); + return getTagName(node.openingElement); } else { - const name = (node).tagName; + const name = node.tagName; if (isIdentifier(name) && isIntrinsicJsxName(name.escapedText)) { return createLiteral(idText(name)); } diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 2c75964d616..b55dc583aa9 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -533,7 +533,7 @@ namespace ts { } if (isImportCall(node)) { - return visitImportCallExpression(node); + return visitImportCallExpression(node); } else { return visitEachChild(node, importCallExpressionVisitor, context); diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index 2e6f6d84b51..d4bae723052 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -343,13 +343,12 @@ namespace ts { continue; } - const exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { // export * from ... continue; } - for (const element of exportDecl.exportClause.elements) { + for (const element of externalImport.exportClause.elements) { // write name of indirectly exported entry, i.e. 'export {x} from ...' exportedNames.push( createPropertyAssignment( @@ -472,7 +471,7 @@ namespace ts { const importVariableName = getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { case SyntaxKind.ImportDeclaration: - if (!(entry).importClause) { + if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; @@ -491,7 +490,7 @@ namespace ts { case SyntaxKind.ExportDeclaration: Debug.assert(importVariableName !== undefined); - if ((entry).exportClause) { + if (entry.exportClause) { // export {a, b as c} from 'foo' // // emit as: @@ -501,7 +500,7 @@ namespace ts { // "c": _["b"] // }); const properties: PropertyAssignment[] = []; - for (const e of (entry).exportClause.elements) { + for (const e of entry.exportClause.elements) { properties.push( createPropertyAssignment( createLiteral(idText(e.name)), diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 0e70b3099c0..059ae73ea2b 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -242,13 +242,13 @@ namespace ts { } switch (node.kind) { case SyntaxKind.ImportDeclaration: - return visitImportDeclaration(node); + return visitImportDeclaration(node); case SyntaxKind.ImportEqualsDeclaration: - return visitImportEqualsDeclaration(node); + return visitImportEqualsDeclaration(node); case SyntaxKind.ExportAssignment: - return visitExportAssignment(node); + return visitExportAssignment(node); case SyntaxKind.ExportDeclaration: - return visitExportDeclaration(node); + return visitExportDeclaration(node); default: Debug.fail("Unhandled ellided statement"); } @@ -2010,7 +2010,7 @@ namespace ts { case SyntaxKind.Identifier: // Create a clone of the name with a new parent, and treat it as if it were // a source tree node for the purposes of the checker. - const name = getMutableClone(node); + const name = getMutableClone(node); name.flags &= ~NodeFlags.Synthesized; name.original = undefined; name.parent = getParseTreeNode(currentScope); // ensure the parent is set to a parse tree node. @@ -2027,7 +2027,7 @@ namespace ts { return name; case SyntaxKind.QualifiedName: - return serializeQualifiedNameAsExpression(node, useFallback); + return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -2091,9 +2091,9 @@ namespace ts { function getExpressionForPropertyName(member: ClassElement | EnumMember, generateNameForComputedPropertyName: boolean): Expression { const name = member.name; if (isComputedPropertyName(name)) { - return generateNameForComputedPropertyName && !isSimpleInlineableExpression((name).expression) + return generateNameForComputedPropertyName && !isSimpleInlineableExpression(name.expression) ? getGeneratedNameForNode(name) - : (name).expression; + : name.expression; } else if (isIdentifier(name)) { return createLiteral(idText(name)); @@ -2961,7 +2961,7 @@ namespace ts { const body = node.body; if (body.kind === SyntaxKind.ModuleBlock) { saveStateAndInvoke(body, body => addRange(statements, visitNodes((body).statements, namespaceElementVisitor, isStatement))); - statementsLocation = (body).statements; + statementsLocation = body.statements; blockLocation = body; } else { @@ -3547,9 +3547,7 @@ namespace ts { return undefined; } - return isPropertyAccessExpression(node) || isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return isPropertyAccessExpression(node) || isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 4e5b5700d29..63214d68e5d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -904,11 +904,10 @@ namespace ts { return; default: if (isFunctionLike(node)) { - const name = (node).name; - if (name && name.kind === SyntaxKind.ComputedPropertyName) { + if (node.name && node.name.kind === SyntaxKind.ComputedPropertyName) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse((name).expression); + traverse(node.name.expression); return; } } @@ -1219,15 +1218,15 @@ namespace ts { } export function getInvokedExpression(node: CallLikeExpression): Expression { - if (node.kind === SyntaxKind.TaggedTemplateExpression) { - return (node).tag; + switch (node.kind) { + case SyntaxKind.TaggedTemplateExpression: + return node.tag; + case SyntaxKind.JsxOpeningElement: + case SyntaxKind.JsxSelfClosingElement: + return node.tagName; + default: + return node.expression; } - else if (isJsxOpeningLikeElement(node)) { - return node.tagName; - } - - // Will either be a CallExpression, NewExpression, or Decorator. - return (node).expression; } export function nodeCanBeDecorated(node: ClassDeclaration): true; @@ -1559,7 +1558,7 @@ namespace ts { if (node.kind === SyntaxKind.ImportEqualsDeclaration) { const reference = (node).moduleReference; if (reference.kind === SyntaxKind.ExternalModuleReference) { - return (reference).expression; + return reference.expression; } } if (node.kind === SyntaxKind.ExportDeclaration) { @@ -1571,20 +1570,20 @@ namespace ts { } export function getNamespaceDeclarationNode(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): ImportEqualsDeclaration | NamespaceImport { - if (node.kind === SyntaxKind.ImportEqualsDeclaration) { - return node; - } - - const importClause = (node).importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { - return importClause.namedBindings; + switch (node.kind) { + case SyntaxKind.ImportDeclaration: + return node.importClause && tryCast(node.importClause.namedBindings, isNamespaceImport); + case SyntaxKind.ImportEqualsDeclaration: + return node; + case SyntaxKind.ExportDeclaration: + return undefined; + default: + return Debug.assertNever(node); } } export function isDefaultImport(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration) { - return node.kind === SyntaxKind.ImportDeclaration - && (node).importClause - && !!(node).importClause.name; + return node.kind === SyntaxKind.ImportDeclaration && node.importClause && !!node.importClause.name; } export function hasQuestionToken(node: Node) { @@ -2127,8 +2126,8 @@ namespace ts { export function isDynamicName(name: DeclarationName): boolean { return name.kind === SyntaxKind.ComputedPropertyName && - !isStringOrNumericLiteral((name).expression) && - !isWellKnownSymbolSyntactically((name).expression); + !isStringOrNumericLiteral(name.expression) && + !isWellKnownSymbolSyntactically(name.expression); } /** @@ -2168,7 +2167,7 @@ namespace ts { if (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) { - return (node as LiteralLikeNode).text; + return node.text; } } @@ -2183,7 +2182,7 @@ namespace ts { if (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral) { - return escapeLeadingUnderscores((node as LiteralLikeNode).text); + return escapeLeadingUnderscores(node.text); } } @@ -4258,13 +4257,12 @@ namespace ts { // Covers remaining cases switch (hostNode.kind) { case SyntaxKind.VariableStatement: - if ((hostNode as VariableStatement).declarationList && - (hostNode as VariableStatement).declarationList.declarations[0]) { - return getDeclarationIdentifier((hostNode as VariableStatement).declarationList.declarations[0]); + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { + return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; case SyntaxKind.ExpressionStatement: - const expr = (hostNode as ExpressionStatement).expression; + const expr = hostNode.expression; switch (expr.kind) { case SyntaxKind.PropertyAccessExpression: return (expr as PropertyAccessExpression).name; @@ -4297,7 +4295,7 @@ namespace ts { } export function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined { - return declaration.name || nameForNamelessJSDocTypedef(declaration as JSDocTypedefTag); + return declaration.name || nameForNamelessJSDocTypedef(declaration); } export function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined { @@ -4353,7 +4351,7 @@ namespace ts { export function getJSDocParameterTags(param: ParameterDeclaration): ReadonlyArray | undefined { if (param.name && isIdentifier(param.name)) { const name = param.name.escapedText; - return getJSDocTags(param.parent).filter((tag): tag is JSDocParameterTag => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name) as JSDocParameterTag[]; + return getJSDocTags(param.parent).filter((tag): tag is JSDocParameterTag => isJSDocParameterTag(tag) && isIdentifier(tag.name) && tag.name.escapedText === name); } // a binding pattern doesn't have a name, so it's not possible to match it a JSDoc parameter, which is identified by name return undefined; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index ab07182b8e7..fa9bf124e51 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1621,7 +1621,7 @@ Actual: ${stringify(fullActual)}`); const diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram()); for (const diagnostic of diagnostics) { if (!ts.isString(diagnostic.messageText)) { - let chainedMessage = diagnostic.messageText; + let chainedMessage = diagnostic.messageText; let indentation = " "; while (chainedMessage) { resultString += indentation + chainedMessage.messageText + Harness.IO.newLine(); @@ -3170,24 +3170,23 @@ Actual: ${stringify(fullActual)}`); } private findFile(indexOrName: string | number) { - let result: FourSlashFile; if (typeof indexOrName === "number") { - const index = indexOrName; + const index = indexOrName; if (index >= this.testData.files.length) { throw new Error(`File index (${index}) in openFile was out of range. There are only ${this.testData.files.length} files in this test.`); } else { - result = this.testData.files[index]; + return this.testData.files[index]; } } else if (ts.isString(indexOrName)) { - let name = indexOrName; + let name = indexOrName; // names are stored in the compiler with this relative path, this allows people to use goTo.file on just the fileName name = name.indexOf("/") === -1 ? (this.basePath + "/" + name) : name; const availableNames: string[] = []; - result = ts.forEach(this.testData.files, file => { + const result = ts.forEach(this.testData.files, file => { const fn = file.fileName; if (fn) { if (fn === name) { @@ -3200,12 +3199,11 @@ Actual: ${stringify(fullActual)}`); if (!result) { throw new Error(`No test file named "${name}" exists. Available file names are: ${availableNames.join(", ")}`); } + return result; } else { - throw new Error("Unknown argument type"); + return ts.Debug.assertNever(indexOrName); } - - return result; } private getLineColStringAtPosition(position: number) { diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 53f8133b8e5..e35ecba2a04 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -57,7 +57,7 @@ var assert: typeof _chai.assert = _chai.assert; } declare var __dirname: string; // Node-specific -var global: NodeJS.Global = Function("return this").call(undefined); +var global: NodeJS.Global = Function("return this").call(undefined); declare var window: {}; declare var XMLHttpRequest: { @@ -767,10 +767,9 @@ namespace Harness { return ts.matchFiles(path, extension, exclude, include, useCaseSensitiveFileNames(), getCurrentDirectory(), depth, path => { const entry = fs.traversePath(path); if (entry && entry.isDirectory()) { - const directory = entry; return { - files: ts.map(directory.getFiles(), f => f.name), - directories: ts.map(directory.getDirectories(), d => d.name) + files: ts.map(entry.getFiles(), f => f.name), + directories: ts.map(entry.getDirectories(), d => d.name) }; } return { files: [], directories: [] }; diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index d24f572d1d5..c38ab1f3c6d 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -143,7 +143,7 @@ namespace Harness.LanguageService { public getScriptInfo(fileName: string): ScriptInfo { const fileEntry = this.virtualFileSystem.traversePath(fileName); - return fileEntry && fileEntry.isFile() ? (fileEntry).content : undefined; + return fileEntry && fileEntry.isFile() ? fileEntry.content : undefined; } public addScript(fileName: string, content: string, isRootFile: boolean): void { diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts index 454e97b3133..70325831f51 100644 --- a/src/harness/unittests/reuseProgramStructure.ts +++ b/src/harness/unittests/reuseProgramStructure.ts @@ -165,7 +165,7 @@ namespace ts { export function updateProgram(oldProgram: ProgramWithSourceTexts, rootNames: ReadonlyArray, options: CompilerOptions, updater: (files: NamedSourceText[]) => void, newTexts?: NamedSourceText[]) { if (!newTexts) { - newTexts = (oldProgram).sourceTexts.slice(0); + newTexts = oldProgram.sourceTexts.slice(0); } updater(newTexts); const host = createTestCompilerHost(newTexts, options.target, oldProgram); diff --git a/src/harness/unittests/textChanges.ts b/src/harness/unittests/textChanges.ts index 0a3602ea0b1..e3f67b8c513 100644 --- a/src/harness/unittests/textChanges.ts +++ b/src/harness/unittests/textChanges.ts @@ -91,7 +91,7 @@ namespace M } }`; runSingleFileTest("extractMethodLike", /*placeOpenBraceOnNewLineForFunctions*/ true, text, /*validateNodes*/ true, (sourceFile, changeTracker) => { - const statements = ((findChild("foo", sourceFile)).body).statements.slice(1); + const statements = (findChild("foo", sourceFile)).body.statements.slice(1); const newFunction = createFunctionDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 8d84732f3aa..e09dff2a6d5 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2560,7 +2560,7 @@ namespace ts.projectSystem { } assert.equal(e.eventName, server.ProjectLanguageServiceStateEvent); assert.equal(e.data.project.getProjectName(), config.path, "project name"); - lastEvent = e; + lastEvent = e; } }); session.executeCommand({ diff --git a/src/harness/virtualFileSystem.ts b/src/harness/virtualFileSystem.ts index 54572814d8e..16267a092fc 100644 --- a/src/harness/virtualFileSystem.ts +++ b/src/harness/virtualFileSystem.ts @@ -42,12 +42,12 @@ namespace Utils { getDirectory(name: string): VirtualDirectory { const entry = this.getFileSystemEntry(name); - return entry.isDirectory() ? entry : undefined; + return entry.isDirectory() ? entry : undefined; } getFile(name: string): VirtualFile { const entry = this.getFileSystemEntry(name); - return entry.isFile() ? entry : undefined; + return entry.isFile() ? entry : undefined; } } @@ -66,7 +66,7 @@ namespace Utils { return directory; } else if (entry.isDirectory()) { - return entry; + return entry; } else { return undefined; @@ -149,7 +149,7 @@ namespace Utils { return undefined; } else if (entry.isDirectory()) { - directory = entry; + directory = entry; } else { return entry; @@ -167,10 +167,9 @@ namespace Utils { getAccessibleFileSystemEntries(path: string) { const entry = this.traversePath(path); if (entry && entry.isDirectory()) { - const directory = entry; return { - files: ts.map(directory.getFiles(), f => f.name), - directories: ts.map(directory.getDirectories(), d => d.name) + files: ts.map(entry.getFiles(), f => f.name), + directories: ts.map(entry.getDirectories(), d => d.name) }; } return { files: [], directories: [] }; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 3d0d623c6d4..c525d5a3bc8 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -2026,7 +2026,7 @@ namespace ts.server { } else { configFileErrors = project.getAllProjectErrors(); - this.sendConfigFileDiagEvent(project as ConfiguredProject, fileName); + this.sendConfigFileDiagEvent(project, fileName); } } else { diff --git a/src/server/scriptVersionCache.ts b/src/server/scriptVersionCache.ts index fa4445bfc4f..8a3f43a5434 100644 --- a/src/server/scriptVersionCache.ts +++ b/src/server/scriptVersionCache.ts @@ -765,13 +765,13 @@ namespace ts.server { for (let i = 0; i < splitNodeCount; i++) { splitNodes[i] = new LineNode(); } - let splitNode = splitNodes[0]; + let splitNode = splitNodes[0]; while (nodeIndex < nodeCount) { splitNode.add(nodes[nodeIndex]); nodeIndex++; if (splitNode.children.length === lineCollectionCapacity) { splitNodeIndex++; - splitNode = splitNodes[splitNodeIndex]; + splitNode = splitNodes[splitNodeIndex]; } } for (let i = splitNodes.length - 1; i >= 0; i--) { @@ -785,7 +785,7 @@ namespace ts.server { } this.updateCounts(); for (let i = 0; i < splitNodeCount; i++) { - (splitNodes[i]).updateCounts(); + splitNodes[i].updateCounts(); } return splitNodes; } diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index 26df417f879..efc27314a98 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -390,7 +390,7 @@ namespace ts.BreakpointResolver { // If this is a destructuring pattern, set breakpoint in binding pattern if (isBindingPattern(variableDeclaration.name)) { - return spanInBindingPattern(variableDeclaration.name); + return spanInBindingPattern(variableDeclaration.name); } // Breakpoint is possible in variableDeclaration only if there is initialization @@ -420,7 +420,7 @@ namespace ts.BreakpointResolver { function spanInParameterDeclaration(parameter: ParameterDeclaration): TextSpan { if (isBindingPattern(parameter.name)) { // Set breakpoint in binding pattern - return spanInBindingPattern(parameter.name); + return spanInBindingPattern(parameter.name); } else if (canHaveSpanInParameterDeclaration(parameter)) { return textSpan(parameter); @@ -540,10 +540,7 @@ namespace ts.BreakpointResolver { function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node: DestructuringPattern): TextSpan { Debug.assert(node.kind !== SyntaxKind.ArrayBindingPattern && node.kind !== SyntaxKind.ObjectBindingPattern); - const elements: NodeArray = - node.kind === SyntaxKind.ArrayLiteralExpression ? - (node).elements : - (node).properties; + const elements: NodeArray = node.kind === SyntaxKind.ArrayLiteralExpression ? node.elements : (node as ObjectLiteralExpression).properties; const firstBindingElement = forEach(elements, element => element.kind !== SyntaxKind.OmittedExpression ? element : undefined); diff --git a/src/services/codefixes/fixUnusedIdentifier.ts b/src/services/codefixes/fixUnusedIdentifier.ts index cb94c2112af..de053c2fe8f 100644 --- a/src/services/codefixes/fixUnusedIdentifier.ts +++ b/src/services/codefixes/fixUnusedIdentifier.ts @@ -195,7 +195,7 @@ namespace ts.codefix { } function tryDeleteNamedImportBinding(changes: textChanges.ChangeTracker, sourceFile: SourceFile, namedBindings: NamedImportBindings): void { - if ((namedBindings.parent).name) { + if (namedBindings.parent.name) { // Delete named imports while preserving the default import // import d|, * as ns| from './file' // import d|, { a }| from './file' @@ -229,7 +229,7 @@ namespace ts.codefix { } case SyntaxKind.ForOfStatement: - const forOfStatement = varDecl.parent.parent; + const forOfStatement = varDecl.parent.parent; Debug.assert(forOfStatement.initializer.kind === SyntaxKind.VariableDeclarationList); const forOfInitializer = forOfStatement.initializer; changes.replaceNode(sourceFile, forOfInitializer.declarations[0], createObjectLiteral()); @@ -240,7 +240,7 @@ namespace ts.codefix { break; default: - const variableStatement = varDecl.parent.parent; + const variableStatement = varDecl.parent.parent; if (variableStatement.declarationList.declarations.length === 1) { changes.deleteNode(sourceFile, variableStatement); } diff --git a/src/services/codefixes/helpers.ts b/src/services/codefixes/helpers.ts index 47e23e717d9..6a45c66ca81 100644 --- a/src/services/codefixes/helpers.ts +++ b/src/services/codefixes/helpers.ts @@ -24,7 +24,7 @@ namespace ts.codefix { return undefined; } - const declaration = declarations[0] as Declaration; + const declaration = declarations[0]; // Clone name to remove leading trivia. const name = getSynthesizedDeepClone(getNameOfDeclaration(declaration)) as PropertyName; const visibilityModifier = createVisibilityModifier(getModifierFlags(declaration)); diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index 902764a1729..e17c5183611 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -140,7 +140,7 @@ namespace ts.codefix { case SyntaxKind.Constructor: return true; case SyntaxKind.FunctionExpression: - return !!(declaration as FunctionExpression).name; + return !!declaration.name; } return false; } @@ -497,7 +497,7 @@ namespace ts.codefix { } function inferTypeFromSwitchStatementLabelContext(parent: CaseOrDefaultClause, checker: TypeChecker, usageContext: UsageContext): void { - addCandidateType(usageContext, checker.getTypeAtLocation((parent.parent.parent).expression)); + addCandidateType(usageContext, checker.getTypeAtLocation(parent.parent.parent.expression)); } function inferTypeFromCallExpressionContext(parent: CallExpression | NewExpression, checker: TypeChecker, usageContext: UsageContext): void { diff --git a/src/services/completions.ts b/src/services/completions.ts index 41f9a300b2e..a77185ab94e 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1082,10 +1082,10 @@ namespace ts.Completions { let attrsType: Type; if ((jsxContainer.kind === SyntaxKind.JsxSelfClosingElement) || (jsxContainer.kind === SyntaxKind.JsxOpeningElement)) { // Cursor is inside a JSX self-closing element or opening element - attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); + attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { - symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), (jsxContainer).attributes.properties); + symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes.properties); completionKind = CompletionKind.MemberLike; isNewIdentifierLocation = false; return true; @@ -1443,10 +1443,10 @@ namespace ts.Completions { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; - const typeForObject = typeChecker.getContextualType(objectLikeContainer); + const typeForObject = typeChecker.getContextualType(objectLikeContainer); if (!typeForObject) return false; typeMembers = getPropertiesForCompletion(typeForObject, typeChecker, /*isForAccess*/ false); - existingMembers = (objectLikeContainer).properties; + existingMembers = objectLikeContainer.properties; } else { Debug.assert(objectLikeContainer.kind === SyntaxKind.ObjectBindingPattern); @@ -1475,7 +1475,7 @@ namespace ts.Completions { if (!typeForObject) return false; // In a binding pattern, get only known properties. Everywhere else we will get all possible properties. typeMembers = typeChecker.getPropertiesOfType(typeForObject).filter((symbol) => !(getDeclarationModifierFlagsFromSymbol(symbol) & ModifierFlags.NonPublicAccessibilityModifier)); - existingMembers = (objectLikeContainer).elements; + existingMembers = objectLikeContainer.elements; } } @@ -2087,7 +2087,7 @@ namespace ts.Completions { } if (attr.kind === SyntaxKind.JsxAttribute) { - seenNames.set((attr).name.escapedText, true); + seenNames.set(attr.name.escapedText, true); } } diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 5684b3f3e37..8100a021fb8 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -912,7 +912,7 @@ namespace ts.FindAllReferences.Core { // For `export { foo as bar }`, rename `foo`, but not `bar`. if (!(referenceLocation === propertyName && state.options.isForRename)) { - const exportKind = (referenceLocation as Identifier).originalKeywordKind === ts.SyntaxKind.DefaultKeyword ? ExportKind.Default : ExportKind.Named; + const exportKind = referenceLocation.originalKeywordKind === ts.SyntaxKind.DefaultKeyword ? ExportKind.Default : ExportKind.Named; const exportInfo = getExportInfo(referenceSymbol, exportKind, state.checker); Debug.assert(!!exportInfo); searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); @@ -1125,7 +1125,7 @@ namespace ts.FindAllReferences.Core { } }); } - else if (isImplementationExpression(body)) { + else if (isImplementationExpression(body)) { addReference(body); } } @@ -1647,10 +1647,10 @@ namespace ts.FindAllReferences.Core { function getNameFromObjectLiteralElement(node: ObjectLiteralElement): string { if (node.name.kind === SyntaxKind.ComputedPropertyName) { - const nameExpression = (node.name).expression; + const nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (isStringOrNumericLiteral(nameExpression)) { - return (nameExpression).text; + return nameExpression.text; } return undefined; } @@ -1728,7 +1728,7 @@ namespace ts.FindAllReferences.Core { function getParentStatementOfVariableDeclaration(node: VariableDeclaration): VariableStatement { if (node.parent && node.parent.parent && node.parent.parent.kind === SyntaxKind.VariableStatement) { Debug.assert(node.parent.kind === SyntaxKind.VariableDeclarationList); - return node.parent.parent; + return node.parent.parent; } } diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 22446a98ce2..3ed602d17fb 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -200,7 +200,7 @@ namespace ts.formatting { return rangeContainsRange((parent).members, node); case SyntaxKind.ModuleDeclaration: const body = (parent).body; - return body && body.kind === SyntaxKind.ModuleBlock && rangeContainsRange((body).statements, node); + return body && body.kind === SyntaxKind.ModuleBlock && rangeContainsRange(body.statements, node); case SyntaxKind.SourceFile: case SyntaxKind.Block: case SyntaxKind.ModuleBlock: diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 1e6323be9fa..f124c444f6d 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -383,9 +383,8 @@ namespace ts.formatting { return Value.Unknown; } - if (node.parent && isCallOrNewExpression(node.parent) && (node.parent).expression !== node) { - - const fullCallOrNewExpression = (node.parent).expression; + if (node.parent && isCallOrNewExpression(node.parent) && node.parent.expression !== node) { + const fullCallOrNewExpression = node.parent.expression; const startingExpression = getStartingExpression(fullCallOrNewExpression); if (fullCallOrNewExpression === startingExpression) { diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index d3e57b124de..a9e2f202726 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -629,7 +629,7 @@ namespace ts.FindAllReferences { // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. if (symbol.declarations) { for (const declaration of symbol.declarations) { - if (isExportSpecifier(declaration) && !(declaration as ExportSpecifier).propertyName && !(declaration as ExportSpecifier).parent.parent.moduleSpecifier) { + if (isExportSpecifier(declaration) && !declaration.propertyName && !declaration.parent.parent.moduleSpecifier) { return checker.getExportSpecifierLocalTargetSymbol(declaration); } } diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts index 2a5b4f26ce6..cf3c9606fb4 100644 --- a/src/services/jsDoc.ts +++ b/src/services/jsDoc.ts @@ -269,9 +269,7 @@ namespace ts.JsDoc { let docParams = ""; for (let i = 0; i < parameters.length; i++) { const currentName = parameters[i].name; - const paramName = currentName.kind === SyntaxKind.Identifier ? - (currentName).escapedText : - "param" + i; + const paramName = currentName.kind === SyntaxKind.Identifier ? currentName.escapedText : "param" + i; if (isJavaScriptFile) { docParams += `${indentationStr} * @param {any} ${paramName}${newLine}`; } diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index 8449805ee71..3b5e5ee59ba 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -97,7 +97,7 @@ namespace ts.NavigateTo { containers.unshift(text); } else if (name.kind === SyntaxKind.ComputedPropertyName) { - return tryAddComputedPropertyName((name).expression, containers, /*includeLastPortion*/ true); + return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); } else { // Don't know how to add this. @@ -140,7 +140,7 @@ namespace ts.NavigateTo { // portion into the container array. const name = getNameOfDeclaration(declaration); if (name.kind === SyntaxKind.ComputedPropertyName) { - if (!tryAddComputedPropertyName((name).expression, containers, /*includeLastPortion*/ false)) { + if (!tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } } @@ -181,7 +181,7 @@ namespace ts.NavigateTo { function createNavigateToItem(rawItem: RawNavigateToItem): NavigateToItem { const declaration = rawItem.declaration; - const container = getContainerNode(declaration); + const container = getContainerNode(declaration); const containerName = container && getNameOfDeclaration(container); return { name: rawItem.name, diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 19a74c5af57..cdc7b2b1864 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -197,10 +197,10 @@ namespace ts.NavigationBar { const {namedBindings} = importClause; if (namedBindings) { if (namedBindings.kind === SyntaxKind.NamespaceImport) { - addLeafNode(namedBindings); + addLeafNode(namedBindings); } else { - for (const element of (namedBindings).elements) { + for (const element of namedBindings.elements) { addLeafNode(element); } } @@ -475,8 +475,8 @@ namespace ts.NavigationBar { else { const parentNode = node.parent && node.parent.parent; if (parentNode && parentNode.kind === SyntaxKind.VariableStatement) { - if ((parentNode).declarationList.declarations.length > 0) { - const nameIdentifier = (parentNode).declarationList.declarations[0].name; + if (parentNode.declarationList.declarations.length > 0) { + const nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === SyntaxKind.Identifier) { return nameIdentifier.text; } diff --git a/src/services/refactors/annotateWithTypeFromJSDoc.ts b/src/services/refactors/annotateWithTypeFromJSDoc.ts index 6f87332aa96..3258da4636a 100644 --- a/src/services/refactors/annotateWithTypeFromJSDoc.ts +++ b/src/services/refactors/annotateWithTypeFromJSDoc.ts @@ -118,7 +118,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc { case SyntaxKind.Constructor: return createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); case SyntaxKind.FunctionExpression: - return createFunctionExpression(decl.modifiers, decl.asteriskToken, (decl as FunctionExpression).name, typeParameters, parameters, returnType, decl.body); + return createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); case SyntaxKind.ArrowFunction: return createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); case SyntaxKind.MethodDeclaration: diff --git a/src/services/refactors/convertFunctionToEs6Class.ts b/src/services/refactors/convertFunctionToEs6Class.ts index 6645f8434b6..ddb13c3e04c 100644 --- a/src/services/refactors/convertFunctionToEs6Class.ts +++ b/src/services/refactors/convertFunctionToEs6Class.ts @@ -180,8 +180,7 @@ namespace ts.refactor.convertFunctionToES6Class { } // case 2: () => [1,2,3] else { - const expression = arrowFunctionBody as Expression; - bodyBlock = createBlock([createReturn(expression)]); + bodyBlock = createBlock([createReturn(arrowFunctionBody)]); } const fullModifiers = concatenate(modifiers, getModifierKindFromSource(arrowFunction, SyntaxKind.AsyncKeyword)); const method = createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, diff --git a/src/services/refactors/convertToEs6Module.ts b/src/services/refactors/convertToEs6Module.ts index f1f3c16b6bb..6ed9cbec2ee 100644 --- a/src/services/refactors/convertToEs6Module.ts +++ b/src/services/refactors/convertToEs6Module.ts @@ -194,7 +194,7 @@ namespace ts.refactor { } function convertVariableStatement(sourceFile: SourceFile, statement: VariableStatement, changes: textChanges.ChangeTracker, checker: TypeChecker, identifiers: Identifiers, target: ScriptTarget): void { - const { declarationList } = statement as VariableStatement; + const { declarationList } = statement; let foundImport = false; const newNodes = flatMap(declarationList.declarations, decl => { const { name, initializer } = decl; @@ -290,14 +290,10 @@ namespace ts.refactor { case SyntaxKind.ShorthandPropertyAssignment: case SyntaxKind.SpreadAssignment: return undefined; - case SyntaxKind.PropertyAssignment: { - const { name, initializer } = prop as PropertyAssignment; - return !isIdentifier(name) ? undefined : convertExportsDotXEquals(name.text, initializer); - } - case SyntaxKind.MethodDeclaration: { - const m = prop as MethodDeclaration; - return !isIdentifier(m.name) ? undefined : functionExpressionToDeclaration(m.name.text, [createToken(SyntaxKind.ExportKeyword)], m); - } + case SyntaxKind.PropertyAssignment: + return !isIdentifier(prop.name) ? undefined : convertExportsDotXEquals(prop.name.text, prop.initializer); + case SyntaxKind.MethodDeclaration: + return !isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [createToken(SyntaxKind.ExportKeyword)], prop); default: Debug.assertNever(prop); } diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index bf410ab27a9..65c9fd6268c 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -223,7 +223,7 @@ namespace ts.refactor.extractSymbol { return { errors: [createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] }; } const statements: Statement[] = []; - for (const statement of (start.parent).statements) { + for (const statement of start.parent.statements) { if (statement === start || statements.length) { const errors = checkNode(statement); if (errors) { @@ -1476,7 +1476,7 @@ namespace ts.refactor.extractSymbol { } const seenUsages = createMap(); - const target = isReadonlyArray(targetRange.range) ? createBlock(targetRange.range) : targetRange.range; + const target = isReadonlyArray(targetRange.range) ? createBlock(targetRange.range) : targetRange.range; const unmodifiedNode = isReadonlyArray(targetRange.range) ? first(targetRange.range) : targetRange.range; const inGenericContext = isInGenericContext(unmodifiedNode); @@ -1681,9 +1681,9 @@ namespace ts.refactor.extractSymbol { // if we get here this means that we are trying to handle 'write' and 'read' was already processed // walk scopes and update existing records. for (const perScope of usagesPerScope) { - const prevEntry = perScope.usages.get(identifier.text as string); + const prevEntry = perScope.usages.get(identifier.text); if (prevEntry) { - perScope.usages.set(identifier.text as string, { usage, symbol, node: identifier }); + perScope.usages.set(identifier.text, { usage, symbol, node: identifier }); } } return symbolId; @@ -1730,7 +1730,7 @@ namespace ts.refactor.extractSymbol { } } else { - usagesPerScope[i].usages.set(identifier.text as string, { usage, symbol, node: identifier }); + usagesPerScope[i].usages.set(identifier.text, { usage, symbol, node: identifier }); } } } diff --git a/src/services/services.ts b/src/services/services.ts index b5d6f0ec2a6..991b6c10606 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -728,7 +728,7 @@ namespace ts { } if (name.kind === SyntaxKind.ComputedPropertyName) { - const expr = (name).expression; + const expr = name.expression; if (expr.kind === SyntaxKind.PropertyAccessExpression) { return (expr).name.text; } @@ -832,10 +832,10 @@ namespace ts { // import {a, b as B} from "mod"; if (importClause.namedBindings) { if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) { - addDeclaration(importClause.namedBindings); + addDeclaration(importClause.namedBindings); } else { - forEach((importClause.namedBindings).elements, visit); + forEach(importClause.namedBindings.elements, visit); } } } @@ -2218,7 +2218,7 @@ namespace ts { case SyntaxKind.Identifier: return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression || node.parent.parent.kind === SyntaxKind.JsxAttributes) && - (node.parent).name === node ? node.parent as ObjectLiteralElement : undefined; + node.parent.name === node ? node.parent : undefined; } return undefined; } diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index c96d621dd24..250127ecfc6 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -57,14 +57,9 @@ namespace ts.SignatureHelp { } // See if we can find some symbol with the call expression name that has call signatures. - const callExpression = argumentInfo.invocation; + const callExpression = argumentInfo.invocation; const expression = callExpression.expression; - const name = expression.kind === SyntaxKind.Identifier - ? expression - : expression.kind === SyntaxKind.PropertyAccessExpression - ? (expression).name - : undefined; - + const name = isIdentifier(expression) ? expression : isPropertyAccessExpression(expression) ? expression.name : undefined; if (!name || !name.escapedText) { return undefined; } @@ -160,7 +155,7 @@ namespace ts.SignatureHelp { } else if (node.parent.kind === SyntaxKind.TemplateSpan && node.parent.parent.parent.kind === SyntaxKind.TaggedTemplateExpression) { const templateSpan = node.parent; - const templateExpression = templateSpan.parent; + const templateExpression = templateSpan.parent; const tagExpression = templateExpression.parent; Debug.assert(templateExpression.kind === SyntaxKind.TemplateExpression); @@ -270,7 +265,6 @@ namespace ts.SignatureHelp { function getArgumentListInfoForTemplate(tagExpression: TaggedTemplateExpression, argumentIndex: number, sourceFile: SourceFile): ArgumentListInfo { // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. const argumentCount = isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; - if (argumentIndex !== 0) { Debug.assertLessThan(argumentIndex, argumentCount); } @@ -311,7 +305,7 @@ namespace ts.SignatureHelp { // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. if (template.kind === SyntaxKind.TemplateExpression) { - const lastSpan = lastOrUndefined((template).templateSpans); + const lastSpan = lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); } diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index 387d027d999..135e906143f 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -146,13 +146,13 @@ namespace ts.SymbolDisplay { // try get the call/construct signature from the type if it matches let callExpressionLike: CallExpression | NewExpression | JsxOpeningLikeElement; if (isCallOrNewExpression(location)) { - callExpressionLike = location; + callExpressionLike = location; } else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { callExpressionLike = location.parent; } else if (location.parent && isJsxOpeningLikeElement(location.parent) && isFunctionLike(symbol.valueDeclaration)) { - callExpressionLike = location.parent; + callExpressionLike = location.parent; } if (callExpressionLike) { diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 8df8a902734..263ac0f4c3b 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -131,7 +131,7 @@ namespace ts { while (node.parent.kind === SyntaxKind.QualifiedName) { node = node.parent; } - return isInternalModuleImportEqualsDeclaration(node.parent) && (node.parent).moduleReference === node; + return isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; } function isNamespaceReference(node: Node): boolean { diff --git a/tslint.json b/tslint.json index b801df720f2..bd06724edb8 100644 --- a/tslint.json +++ b/tslint.json @@ -2,6 +2,8 @@ "extends": "tslint:latest", "rulesDirectory": "built/local/tslint/rules", "rules": { + "no-unnecessary-type-assertion-2": true, + "array-type": [true, "array"], "ban-types": { "options": [ From 1b3e6a0f8aaee405dff4b99d5193181008aa6284 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 16 Feb 2018 19:39:32 -0800 Subject: [PATCH 176/298] Accepted baselines. --- tests/baselines/reference/api/tsserverlibrary.d.ts | 4 ++++ tests/baselines/reference/api/typescript.d.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 78f68a80c50..88b0e4b987c 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1392,6 +1392,10 @@ declare namespace ts { name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + /** + * This is either an `export =` or an `export default` declaration. + * Unless `isExportEquals` is set, this node was parsed as an `export default`. + */ interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; parent?: SourceFile; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index bdcc29af76e..29949410ed5 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1392,6 +1392,10 @@ declare namespace ts { name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + /** + * This is either an `export =` or an `export default` declaration. + * Unless `isExportEquals` is set, this node was parsed as an `export default`. + */ interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; parent?: SourceFile; From 0cc4e8f00dc589b1bdb20f03c2de10a79ec7d549 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 18 Feb 2018 06:44:52 -1000 Subject: [PATCH 177/298] Propagate wildcard type in union types --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ed1fddd2fa0..90dcec9519e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -598,6 +598,7 @@ namespace ts { ObjectType = 1 << 9, EmptyObject = 1 << 10, Union = 1 << 11, + Wildcard = 1 << 12, } const enum MembersOrExportsResolutionKind { @@ -7618,6 +7619,7 @@ namespace ts { } else if (flags & TypeFlags.Any) { includes |= TypeIncludes.Any; + if (type === wildcardType) includes |= TypeIncludes.Wildcard; } else if (!strictNullChecks && flags & TypeFlags.Nullable) { if (flags & TypeFlags.Undefined) includes |= TypeIncludes.Undefined; @@ -7737,7 +7739,7 @@ namespace ts { const typeSet: Type[] = []; const includes = addTypesToUnion(typeSet, 0, types); if (includes & TypeIncludes.Any) { - return anyType; + return includes & TypeIncludes.Wildcard ? wildcardType : anyType; } switch (unionReduction) { case UnionReduction.Literal: From e305c5190e4eeb807350fa6d8eaf595099e58d1d Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 20 Feb 2018 05:10:17 +0000 Subject: [PATCH 178/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index e651b11346d..9c0ffaf818e 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3021,6 +3021,15 @@ + + + + + + + + + From 64c24b61f1fcb85222be94b872605c97a1901532 Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 20 Feb 2018 17:10:32 +0000 Subject: [PATCH 179/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 3de4abb5ce7..5d0a9a141b0 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3011,6 +3011,15 @@ + + + + + + + + + From 05c42d97890e3e789a7c3d8ce58af1132ae6032a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 20 Feb 2018 09:34:02 -0800 Subject: [PATCH 180/298] Update user tests (#22056) * Update user tests: 1. New error in abstract-leveldown 2. Changes in chrome-devtools I'm suggesting fixes at abstract-leveldown#204 -- they don't know much about typescript. * Further shrink chrome baselines (?) --- .../user/chrome-devtools-frontend.log | 216 ++++++++++-------- tests/baselines/reference/user/leveldown.log | 8 + 2 files changed, 123 insertions(+), 101 deletions(-) create mode 100644 tests/baselines/reference/user/leveldown.log diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 9d4a3b6b748..ff54d52ea86 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -1,19 +1,19 @@ Exit Code: 1 Standard output: -../../../../built/local/lib.dom.d.ts(1743,11): error TS2300: Duplicate identifier 'Comment'. -../../../../built/local/lib.dom.d.ts(1747,13): error TS2300: Duplicate identifier 'Comment'. -../../../../built/local/lib.dom.d.ts(1948,11): error TS2300: Duplicate identifier 'CSSRule'. -../../../../built/local/lib.dom.d.ts(1967,13): error TS2300: Duplicate identifier 'CSSRule'. -../../../../built/local/lib.dom.d.ts(3694,11): error TS2300: Duplicate identifier 'Event'. -../../../../built/local/lib.dom.d.ts(3718,13): error TS2300: Duplicate identifier 'Event'. -../../../../built/local/lib.dom.d.ts(9098,11): error TS2300: Duplicate identifier 'Position'. -../../../../built/local/lib.dom.d.ts(9103,13): error TS2300: Duplicate identifier 'Position'. -../../../../built/local/lib.dom.d.ts(9246,11): error TS2300: Duplicate identifier 'Request'. -../../../../built/local/lib.dom.d.ts(9264,13): error TS2300: Duplicate identifier 'Request'. -../../../../built/local/lib.dom.d.ts(13522,11): error TS2300: Duplicate identifier 'Window'. -../../../../built/local/lib.dom.d.ts(13711,13): error TS2300: Duplicate identifier 'Window'. +../../../../built/local/lib.dom.d.ts(1737,11): error TS2300: Duplicate identifier 'Comment'. +../../../../built/local/lib.dom.d.ts(1741,13): error TS2300: Duplicate identifier 'Comment'. +../../../../built/local/lib.dom.d.ts(1942,11): error TS2300: Duplicate identifier 'CSSRule'. +../../../../built/local/lib.dom.d.ts(1961,13): error TS2300: Duplicate identifier 'CSSRule'. +../../../../built/local/lib.dom.d.ts(3689,11): error TS2300: Duplicate identifier 'Event'. +../../../../built/local/lib.dom.d.ts(3713,13): error TS2300: Duplicate identifier 'Event'. +../../../../built/local/lib.dom.d.ts(9090,11): error TS2300: Duplicate identifier 'Position'. +../../../../built/local/lib.dom.d.ts(9095,13): error TS2300: Duplicate identifier 'Position'. +../../../../built/local/lib.dom.d.ts(9238,11): error TS2300: Duplicate identifier 'Request'. +../../../../built/local/lib.dom.d.ts(9256,13): error TS2300: Duplicate identifier 'Request'. +../../../../built/local/lib.dom.d.ts(13516,11): error TS2300: Duplicate identifier 'Window'. +../../../../built/local/lib.dom.d.ts(13705,13): error TS2300: Duplicate identifier 'Window'. ../../../../built/local/lib.es5.d.ts(1328,11): error TS2300: Duplicate identifier 'ArrayLike'. -../../../../built/local/lib.es5.d.ts(1357,6): error TS2300: Duplicate identifier 'Record'. +../../../../built/local/lib.es5.d.ts(1364,6): error TS2300: Duplicate identifier 'Record'. ../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{ [x: string]: any; }', but here has type 'NodeModule'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(43,8): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(95,28): error TS2339: Property 'response' does not exist on type 'EventTarget'. @@ -336,77 +336,84 @@ node_modules/chrome-devtools-frontend/front_end/accessibility/AccessibilityStrin node_modules/chrome-devtools-frontend/front_end/accessibility/AccessibilityStrings.js(177,15): error TS2339: Property 'AccessibilityStrings' does not exist on type 'typeof Accessibility'. node_modules/chrome-devtools-frontend/front_end/accessibility_test_runner/AccessibilityPaneTestRunner.js(11,15): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/accessibility_test_runner/AccessibilityPaneTestRunner.js(17,12): error TS2339: Property 'runtime' does not exist on type 'Window'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationGroupPreviewUI.js(7,11): error TS2339: Property 'AnimationGroupPreviewUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationGroupPreviewUI.js(9,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationGroupPreviewUI.js(14,18): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationGroupPreviewUI.js(15,39): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationGroupPreviewUI.js(17,47): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationGroupPreviewUI.js(18,30): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationGroupPreviewUI.js(70,37): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(8,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(15,26): error TS2339: Property 'animationAgent' does not exist on type '(Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(16,12): error TS2339: Property 'registerAnimationDispatcher' does not exist on type '(Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(16,54): error TS2339: Property 'AnimationDispatcher' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(17,41): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(19,41): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(25,62): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(28,62): error TS2339: Property 'ScreenshotCapture' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(28,47): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(35,5): error TS2554: Expected 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(35,60): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(35,45): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(49,29): error TS2339: Property 'remove' does not exist on type 'string[]'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(54,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(61,46): error TS2339: Property 'Animation' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(61,31): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(65,31): error TS2339: Property 'remove' does not exist on type 'string[]'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(86,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(91,23): error TS2495: Type 'IterableIterator' is not an array type or a string type. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(104,60): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(104,45): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(109,26): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(123,41): error TS2339: Property 'AnimationGroup' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(123,26): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(168,14): error TS2339: Property 'register' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(168,33): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(168,60): error TS2339: Property 'Capability' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(171,26): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(180,26): error TS2339: Property 'Animation' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(171,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(180,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(183,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(188,49): error TS2339: Property 'AnimationEffect' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(188,34): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(189,46): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(194,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(195,26): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(198,41): error TS2339: Property 'Animation' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(198,26): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(202,25): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(283,26): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(290,26): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(293,34): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(297,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(328,50): error TS2339: Property 'Animation' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(330,55): error TS2339: Property 'Animation' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(358,26): error TS2339: Property 'Animation' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(367,26): error TS2339: Property 'AnimationEffect' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(328,35): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(330,40): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(358,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(367,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(370,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(376,58): error TS2339: Property 'KeyframesRule' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(376,43): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(457,26): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(474,26): error TS2339: Property 'KeyframesRule' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(474,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(476,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(481,43): error TS2339: Property 'KeyframeStyle' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(481,28): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(486,32): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(490,43): error TS2339: Property 'KeyframeStyle' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(490,28): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(502,34): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(512,26): error TS2339: Property 'KeyframeStyle' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(512,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(514,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(553,26): error TS2339: Property 'AnimationGroup' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(553,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(557,33): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(576,34): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(583,43): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(592,27): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(656,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(661,27): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(665,52): error TS2339: Property 'Animation' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(665,37): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(683,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(691,24): error TS2304: Cannot find name 'Image'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(708,11): error TS2339: Property 'AnimationDispatcher' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(731,24): error TS2694: Namespace 'Protocol' has no exported member 'Animation'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(741,26): error TS2339: Property 'ScreenshotCapture' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(741,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(747,34): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(751,68): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(751,53): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(778,24): error TS2694: Namespace 'Protocol' has no exported member 'Page'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(782,27): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(810,65): error TS1003: Identifier expected. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(811,26): error TS2339: Property 'ScreenshotCapture' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(811,11): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationModel.js(811,44): error TS2300: Duplicate identifier 'Request'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationScreenshotPopover.js(7,11): error TS2339: Property 'AnimationScreenshotPopover' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationScreenshotPopover.js(9,23): error TS2304: Cannot find name 'Image'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationScreenshotPopover.js(18,39): error TS2345: Argument of type 'new (width?: number, height?: number) => HTMLImageElement' is not assignable to parameter of type 'Node'. Property 'attributes' is missing in type 'new (width?: number, height?: number) => HTMLImageElement'. @@ -418,6 +425,7 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationScreenshotPop node_modules/chrome-devtools-frontend/front_end/animation/AnimationScreenshotPopover.js(42,39): error TS2339: Property 'window' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationScreenshotPopover.js(53,50): error TS2339: Property 'style' does not exist on type 'new (width?: number, height?: number) => HTMLImageElement'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationScreenshotPopover.js(55,52): error TS2339: Property 'style' does not exist on type 'new (width?: number, height?: number) => HTMLImageElement'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(8,11): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(14,38): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(19,53): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(20,44): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -427,13 +435,16 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(2 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(30,33): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(33,41): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(35,67): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(36,47): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(36,63): error TS2345: Argument of type 'this' is not assignable to parameter of type '() => void'. Type '(Anonymous class)' is not assignable to type '() => void'. Type '(Anonymous class)' provides no match for the signature '(): void'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(80,34): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(81,62): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(89,34): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(90,65): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(44,67): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(52,67): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(80,19): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(81,47): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(89,19): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(90,50): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(94,24): error TS2495: Type 'IterableIterator' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(103,57): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(105,28): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -442,7 +453,7 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(1 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(113,51): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(117,46): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(118,57): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(123,58): error TS2339: Property 'GlobalPlaybackRates' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(123,40): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(125,45): error TS2345: Argument of type 'TemplateStringsArray' is not assignable to parameter of type 'string | string[]'. Type 'TemplateStringsArray' is not assignable to type 'string[]'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(125,72): error TS2555: Expected at least 2 arguments, but got 1. @@ -453,7 +464,7 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(1 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(138,35): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(139,41): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(144,48): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(145,54): error TS2339: Property '_ControlState' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(145,36): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(147,59): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(151,5): error TS2554: Expected 6-7 arguments, but got 5. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(155,5): error TS2554: Expected 6-7 arguments, but got 5. @@ -463,17 +474,18 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(1 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(176,44): error TS2339: Property 'keysArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(177,63): error TS2339: Property 'parentElement' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(194,30): error TS2304: Cannot find name 'Image'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(197,11): error TS2554: Expected 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(197,25): error TS2339: Property 'AnimationScreenshotPopover' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(208,50): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(208,67): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(216,67): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(218,51): error TS2339: Property 'Action' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(233,60): error TS2339: Property '_ControlState' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(235,65): error TS2339: Property '_ControlState' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(244,56): error TS2339: Property '_ControlState' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(233,42): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(235,47): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(244,38): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(246,36): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(249,56): error TS2339: Property '_ControlState' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(249,38): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(251,36): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(254,56): error TS2339: Property '_ControlState' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(254,38): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(256,36): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(334,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(337,51): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. @@ -482,13 +494,15 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(3 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(346,27): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(359,28): error TS2345: Argument of type '(left: any, right: any) => boolean' is not assignable to parameter of type '(a: any, b: any) => number'. Type 'boolean' is not assignable to type 'number'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(373,33): error TS2339: Property 'AnimationGroupPreviewUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(382,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(386,23): error TS2339: Property 'remove' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(390,11): error TS2339: Property 'consume' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(399,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(404,27): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(429,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(445,48): error TS2339: Property 'NodeUI' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(445,30): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(450,37): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(457,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(484,36): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(534,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. @@ -501,45 +515,47 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(6 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(627,41): error TS2339: Property 'x' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(637,23): error TS2339: Property 'x' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(640,44): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(655,29): error TS2339: Property 'GlobalPlaybackRates' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(658,29): error TS2339: Property '_ControlState' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(667,29): error TS2339: Property 'NodeUI' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(655,11): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(658,11): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(667,11): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(669,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(673,38): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(674,42): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(687,46): error TS2339: Property 'DOMPresentationUtils' does not exist on type 'typeof Components'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(713,29): error TS2339: Property 'StepTimingFunction' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(713,11): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(725,26): error TS2694: Namespace 'Animation' has no exported member 'AnimationTimeline'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(730,46): error TS2339: Property 'StepTimingFunction' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(733,46): error TS2339: Property 'StepTimingFunction' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(730,28): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(733,28): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(7,11): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(9,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(21,39): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(24,31): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(25,60): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(26,62): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(30,85): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(25,48): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(26,50): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(30,73): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(37,29): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(41,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(45,51): error TS2551: Property 'Colors' does not exist on type 'typeof (Anonymous class)'. Did you mean 'Color'? -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(46,39): error TS2551: Property 'Colors' does not exist on type 'typeof (Anonymous class)'. Did you mean 'Color'? +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(45,39): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(46,27): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(46,59): error TS2339: Property 'hashCode' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(47,40): error TS2339: Property 'Format' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(51,26): error TS2694: Namespace 'Animation' has no exported member 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(69,30): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(70,51): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(71,51): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(72,51): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(87,83): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(100,40): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(70,39): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(71,39): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(72,39): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(87,71): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(100,28): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(129,23): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(131,53): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(133,52): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(145,41): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(147,41): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(149,41): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(131,41): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(133,40): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(145,29): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(147,29): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(149,29): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(150,5): error TS2554: Expected 6-7 arguments, but got 5. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(170,32): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(173,53): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(174,53): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(173,41): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(174,41): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(178,21): error TS2339: Property 'Geometry' does not exist on type 'typeof UI'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(181,53): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(182,53): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. @@ -547,23 +563,23 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(185,11) node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(188,13): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(189,42): error TS2339: Property 'Height' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(193,13): error TS2339: Property 'style' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(196,54): error TS2339: Property 'StepTimingFunction' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(196,36): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(197,13): error TS2339: Property 'removeChildren' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(206,67): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(208,75): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(213,80): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(240,64): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(242,73): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(245,82): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(206,55): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(208,63): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(213,68): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(240,52): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(242,61): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(245,70): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(255,94): error TS2339: Property 'createSVGChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(258,11): error TS2339: Property 'style' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(264,33): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(272,82): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(281,56): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(282,56): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(293,56): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(295,61): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(306,56): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(264,21): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(272,70): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(281,44): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(282,44): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(293,44): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(295,49): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(306,44): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(316,25): error TS2694: Namespace 'Animation' has no exported member 'AnimationUI'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(321,15): error TS2339: Property 'buttons' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(327,30): error TS2339: Property 'clientX' does not exist on type 'Event'. @@ -571,11 +587,11 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(328,11) node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(330,23): error TS2339: Property 'reveal' does not exist on type '() => void'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(338,33): error TS2339: Property 'clientX' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(348,33): error TS2339: Property 'clientX' does not exist on type 'Event'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(351,56): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(351,44): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(380,11): error TS2339: Property 'consume' does not exist on type 'Event'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(387,23): error TS2339: Property 'MouseEvents' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(394,23): error TS2339: Property 'Options' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(402,23): error TS2551: Property 'Colors' does not exist on type 'typeof (Anonymous class)'. Did you mean 'Color'? +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(387,11): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(394,11): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationUI.js(402,11): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/application_test_runner/AppcacheTestRunner.js(20,26): error TS2339: Property 'resourceTreeModel' does not exist on type 'typeof TestRunner'. node_modules/chrome-devtools-frontend/front_end/application_test_runner/AppcacheTestRunner.js(31,26): error TS2339: Property 'resourceTreeModel' does not exist on type 'typeof TestRunner'. node_modules/chrome-devtools-frontend/front_end/application_test_runner/AppcacheTestRunner.js(41,26): error TS2339: Property 'resourceTreeModel' does not exist on type 'typeof TestRunner'. @@ -6957,8 +6973,9 @@ node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(921,58): node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(924,29): error TS2339: Property 'setDevicesDiscoveryConfig' does not exist on type 'typeof InspectorFrontendHost'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(930,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(933,32): error TS2503: Cannot find namespace 'Adb'. +node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(20,18): error TS2315: Type 'Object' is not generic. node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(20,34): error TS1005: '>' expected. -node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(56,48): error TS2315: Type 'any' is not generic. +node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(56,48): error TS2315: Type 'Object' is not generic. node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(56,61): error TS1009: Trailing comma not allowed. node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(56,63): error TS1005: '>' expected. node_modules/chrome-devtools-frontend/front_end/devtools_compatibility.js(110,17): error TS2503: Cannot find namespace 'Adb'. @@ -7085,11 +7102,11 @@ node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(27 node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(279,24): error TS2339: Property 'getComponentSelection' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(289,16): error TS2339: Property 'window' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(293,19): error TS2339: Property 'removeChildren' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(305,10): error TS2554: Expected 1 arguments, but got 2. +node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(305,42): error TS2559: Type 'string' has no properties in common with type 'ElementCreationOptions'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(314,34): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'. Type 'number' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(323,20): error TS2339: Property 'createElementWithClass' does not exist on type 'Document'. -node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(324,17): error TS2554: Expected 1 arguments, but got 2. +node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(324,49): error TS2559: Type 'string' has no properties in common with type 'ElementCreationOptions'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(338,19): error TS2339: Property 'createElementWithClass' does not exist on type 'Document'. node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(346,20): error TS2551: Property 'createSVGElement' does not exist on type 'Document'. Did you mean 'createElementNS'? node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(360,19): error TS2551: Property 'createSVGElement' does not exist on type 'Document'. Did you mean 'createElementNS'? @@ -8091,6 +8108,7 @@ node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTes node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(1048,6): error TS2551: Property 'panels' does not exist on type 'typeof UI'. Did you mean 'Panel'? node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(1052,6): error TS2551: Property 'panels' does not exist on type 'typeof UI'. Did you mean 'Panel'? node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(1073,35): error TS2339: Property 'OverlayAgent' does not exist on type 'typeof TestRunner'. +node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(1080,35): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; prototype: Ani...'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/SetOuterHTMLTestRunner.js(10,20): error TS2339: Property 'events' does not exist on type 'typeof ElementsTestRunner'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/SetOuterHTMLTestRunner.js(11,20): error TS2339: Property 'containerId' does not exist on type 'typeof ElementsTestRunner'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/SetOuterHTMLTestRunner.js(21,24): error TS2339: Property 'containerId' does not exist on type 'typeof ElementsTestRunner'. @@ -13048,7 +13066,7 @@ node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(806,31): e node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(819,31): error TS2345: Argument of type 'PropertyDescriptor' is not assignable to parameter of type 'T[]'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(829,8): error TS2339: Property 'sprintf' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(830,17): error TS2339: Property 'vsprintf' does not exist on type 'StringConstructor'. -node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(835,13): error TS2315: Type 'any' is not generic. +node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(835,13): error TS2315: Type 'Object' is not generic. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(835,27): error TS1009: Trailing comma not allowed. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(835,29): error TS1005: '>' expected. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(835,29): error TS8024: JSDoc '@param' tag has name 'function', but there is no parameter with that name. @@ -13060,7 +13078,7 @@ node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(911,8): er node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(941,8): error TS2339: Property 'vsprintf' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(943,8): error TS2339: Property 'format' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(944,41): error TS2339: Property 'standardFormatters' does not exist on type 'StringConstructor'. -node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(954,13): error TS2315: Type 'any' is not generic. +node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(954,13): error TS2315: Type 'Object' is not generic. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(954,27): error TS1009: Trailing comma not allowed. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(954,29): error TS1005: '>' expected. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(954,29): error TS8024: JSDoc '@param' tag has name 'function', but there is no parameter with that name. @@ -13072,9 +13090,9 @@ node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1057,39): node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1108,15): error TS2339: Property 'valuesArray' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1116,15): error TS2339: Property 'firstValue' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1126,15): error TS2339: Property 'addAll' does not exist on type 'Set'. -node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1127,17): error TS2495: Type 'T[] | Iterable' is not an array type or a string type. +node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1127,17): error TS2495: Type 'Iterable | T[]' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1136,15): error TS2339: Property 'containsAll' does not exist on type 'Set'. -node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1137,17): error TS2495: Type 'T[] | Iterable' is not an array type or a string type. +node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1137,17): error TS2495: Type 'Iterable | T[]' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1148,15): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1155,21): error TS2304: Cannot find name 'VALUE'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1157,15): error TS2339: Property 'valuesArray' does not exist on type 'Map'. @@ -15088,7 +15106,6 @@ node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(587,24): error T node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(604,48): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(608,24): error TS2694: Namespace 'Protocol' has no exported member 'CSS'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(615,32): error TS2339: Property 'remove' does not exist on type 'Map'. -node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(617,46): error TS2315: Type 'any' is not generic. node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(617,64): error TS2694: Namespace 'Protocol' has no exported member 'Page'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(617,96): error TS2694: Namespace 'Protocol' has no exported member 'CSS'. node_modules/chrome-devtools-frontend/front_end/sdk/CSSModel.js(624,35): error TS2339: Property 'remove' does not exist on type 'Map'. @@ -19500,7 +19517,6 @@ node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(27,23) node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(42,21): error TS2339: Property 'testRunner' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(45,18): error TS2339: Property 'eval' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(76,8): error TS2339: Property 'testRunner' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(117,13): error TS2315: Type 'any[]' is not generic. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(117,18): error TS1099: Type argument list cannot be empty. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(117,19): error TS1005: '>' expected. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(117,19): error TS8024: JSDoc '@param' tag has name 'function', but there is no parameter with that name. @@ -19616,7 +19632,6 @@ node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1016,1 node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1016,76): error TS2339: Property 'Events' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1025,32): error TS2339: Property '_pageLoadedCallback' does not exist on type 'typeof TestRunner'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1031,14): error TS2339: Property '_pageLoadedCallback' does not exist on type 'typeof TestRunner'. -node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1035,13): error TS2315: Type 'any[]' is not generic. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1035,18): error TS1099: Type argument list cannot be empty. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1035,19): error TS1005: '>' expected. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(1035,19): error TS8024: JSDoc '@param' tag has name 'function', but there is no parameter with that name. @@ -21674,7 +21689,6 @@ node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree. node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree.js(97,39): error TS2694: Namespace 'SDK' has no exported member 'SnapshotWithRect'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree.js(102,39): error TS2694: Namespace 'SDK' has no exported member 'SnapshotWithRect'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree.js(104,18): error TS2339: Property '_pictureForRect' does not exist on type '() => void'. -node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree.js(119,15): error TS2315: Type 'any' is not generic. node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree.js(119,44): error TS2694: Namespace 'SDK' has no exported member 'Layer'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree.js(120,29): error TS2694: Namespace 'TimelineModel' has no exported member 'TracingLayerPayload'. node_modules/chrome-devtools-frontend/front_end/timeline_model/TracingLayerTree.js(133,27): error TS2345: Argument of type '(Anonymous class)' is not assignable to parameter of type '() => void'. diff --git a/tests/baselines/reference/user/leveldown.log b/tests/baselines/reference/user/leveldown.log new file mode 100644 index 00000000000..170ed7ca0a3 --- /dev/null +++ b/tests/baselines/reference/user/leveldown.log @@ -0,0 +1,8 @@ +Exit Code: 1 +Standard output: +node_modules/abstract-leveldown/index.d.ts(43,27): error TS1005: ',' expected. +node_modules/abstract-leveldown/index.d.ts(43,28): error TS1139: Type parameter declaration expected. + + + +Standard error: From 099d3da1d0560ff6eec38a510b4d3430a405ce2d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 20 Feb 2018 07:52:07 -1000 Subject: [PATCH 181/298] Better error message for excessive instantiation depth --- src/compiler/checker.ts | 47 ++++++++++++++++++++-------- src/compiler/diagnosticMessages.json | 4 +++ 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 90dcec9519e..004fd947edc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -57,8 +57,9 @@ namespace ts { let typeCount = 0; let symbolCount = 0; let enumCount = 0; - let typeInstantiationDepth = 0; let symbolInstantiationDepth = 0; + let aliasInstantiationDepth = 0; + const aliasInstantiations: Symbol[] = []; const emptySymbols = createSymbolTable(); const identityMapper: (type: Type) => Type = identity; @@ -8909,23 +8910,43 @@ namespace ts { return getConditionalType(root, mapper); } - function getErrorNodeForType(type: Type): Node { - return type.aliasSymbol && type.aliasTypeArguments && getDeclarationOfKind(type.aliasSymbol, SyntaxKind.TypeAliasDeclaration); + function getInstantiationErrorTypeAlias() { + const counted: Symbol[] = []; + let topCount = 0; + let topSymbol: Symbol; + for (let i = 0; i < aliasInstantiationDepth - topCount; i++) { + const symbol = aliasInstantiations[i]; + if (counted.indexOf(symbol) < 0) { + counted.push(symbol); + let count = 0; + for (let j = i; j < aliasInstantiationDepth; j++) { + if (symbol === aliasInstantiations[j]) count++; + } + if (count > topCount) { + topCount = count; + topSymbol = symbol; + } + } + } + return topSymbol && getDeclarationOfKind(topSymbol, SyntaxKind.TypeAliasDeclaration); } function instantiateType(type: Type, mapper: TypeMapper): Type { if (type && mapper && mapper !== identityMapper) { - if (typeInstantiationDepth >= 100) { - const node = getErrorNodeForType(type); - if (node) { - error(node, Diagnostics.Generic_type_instantiation_is_excessively_deep_and_possibly_infinite); - return unknownType; - } + if (aliasInstantiationDepth >= 100) { + const declaration = getInstantiationErrorTypeAlias(); + error(declaration, Diagnostics.Recursive_instantiations_of_type_0_are_excessively_deep_and_possibly_infinite, + declarationNameToString(declaration.name)); + return unknownType; } - typeInstantiationDepth++; - const result = instantiateTypeWorker(type, mapper); - typeInstantiationDepth--; - return result; + if (type.aliasSymbol) { + aliasInstantiations[aliasInstantiationDepth] = type.aliasSymbol; + aliasInstantiationDepth++; + const result = instantiateTypeWorker(type, mapper); + aliasInstantiationDepth--; + return result; + } + return instantiateTypeWorker(type, mapper); } return type; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f120e81283a..a38fcd4dafa 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1988,6 +1988,10 @@ "category": "Error", "code": 2567 }, + "Recursive instantiations of type '{0}' are excessively deep and possibly infinite.": { + "category": "Error", + "code": 2568 + }, "JSX element attributes type '{0}' may not be a union type.": { "category": "Error", From fee1df34ce7cea5d76832284d542efa198e7509f Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 14 Feb 2018 13:52:48 -0800 Subject: [PATCH 182/298] Implement ts.OrganizeImports.removeUnusedImports TODO: Still need to add support for organizing imports in ambient modules --- src/harness/unittests/organizeImports.ts | 95 ++++++++++- src/services/organizeImports.ts | 152 +++++++++++++----- src/services/services.ts | 2 +- .../CoalesceMultipleModules.ts | 2 + .../organizeImports/JsxFactoryUnusedTs.ts | 6 + .../organizeImports/JsxFactoryUnusedTsx.ts | 7 + .../organizeImports/JsxFactoryUsed.ts | 11 ++ .../organizeImports/UnusedTrivia1.ts | 6 + .../organizeImports/UnusedTrivia2.ts | 12 ++ .../reference/organizeImports/Unused_All.ts | 8 + .../reference/organizeImports/Unused_Some.ts | 13 ++ 11 files changed, 273 insertions(+), 41 deletions(-) create mode 100644 tests/baselines/reference/organizeImports/JsxFactoryUnusedTs.ts create mode 100644 tests/baselines/reference/organizeImports/JsxFactoryUnusedTsx.ts create mode 100644 tests/baselines/reference/organizeImports/JsxFactoryUsed.ts create mode 100644 tests/baselines/reference/organizeImports/UnusedTrivia1.ts create mode 100644 tests/baselines/reference/organizeImports/UnusedTrivia2.ts create mode 100644 tests/baselines/reference/organizeImports/Unused_All.ts create mode 100644 tests/baselines/reference/organizeImports/Unused_Some.ts diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts index 8d7b0904eb7..0b9781462a4 100644 --- a/src/harness/unittests/organizeImports.ts +++ b/src/harness/unittests/organizeImports.ts @@ -175,6 +175,17 @@ export default function F2(); `, }; + const reactLibFile = { + path: "/react.ts", + content: ` +export const React = { +createElement: (_type, _props, _children) => {}, +}; + +export const Other = 1; +`, + }; + // Don't bother to actually emit a baseline for this. it("NoImports", () => { const testFile = { @@ -198,6 +209,30 @@ NS.F1(); D(); F1(); F2(); +`, + }, + libFile); + + testOrganizeImports("Unused_Some", + { + path: "/test.ts", + content: ` +import { F1, F2 } from "lib"; +import * as NS from "lib"; +import D from "lib"; + +D(); +`, + }, + libFile); + + testOrganizeImports("Unused_All", + { + path: "/test.ts", + content: ` +import { F1, F2 } from "lib"; +import * as NS from "lib"; +import D from "lib"; `, }, libFile); @@ -217,7 +252,7 @@ D(); }, libFile); - // tslint:disable no-invalid-template-strings + // tslint:disable no-invalid-template-strings testOrganizeImports("MoveToTop_Invalid", { path: "/test.ts", @@ -234,7 +269,7 @@ D(); `, }, libFile); - // tslint:enable no-invalid-template-strings + // tslint:enable no-invalid-template-strings testOrganizeImports("CoalesceMultipleModules", { @@ -244,10 +279,11 @@ import { d } from "lib1"; import { b } from "lib1"; import { c } from "lib2"; import { a } from "lib2"; +a + b + c + d; `, }, - { path: "/lib1.ts", content: "" }, - { path: "/lib2.ts", content: "" }); + { path: "/lib1.ts", content: "export const b = 1, d = 2;" }, + { path: "/lib2.ts", content: "export const a = 3, c = 4;" }); testOrganizeImports("CoalesceTrivia", { @@ -273,6 +309,56 @@ F2(); { path: "/lib1.ts", content: "" }, { path: "/lib2.ts", content: "" }); + testOrganizeImports("UnusedTrivia1", + { + path: "/test.ts", + content: ` +/*A*/import /*B*/ { /*C*/ F1 /*D*/ } /*E*/ from /*F*/ "lib" /*G*/;/*H*/ //I +`, + }, + libFile); + + testOrganizeImports("UnusedTrivia2", + { + path: "/test.ts", + content: ` +/*A*/import /*B*/ { /*C*/ F1 /*D*/, /*E*/ F2 /*F*/ } /*G*/ from /*H*/ "lib" /*I*/;/*J*/ //K + +F1(); +`, + }, + libFile); + + testOrganizeImports("JsxFactoryUsed", + { + path: "/test.tsx", + content: ` +import { React, Other } from "react"; + +
; +`, + }, + reactLibFile); + + // This is descriptive, rather than normative + testOrganizeImports("JsxFactoryUnusedTsx", + { + path: "/test.tsx", + content: ` +import { React, Other } from "react"; +`, + }, + reactLibFile); + + testOrganizeImports("JsxFactoryUnusedTs", + { + path: "/test.ts", + content: ` +import { React, Other } from "react"; +`, + }, + reactLibFile); + function testOrganizeImports(testName: string, testFile: TestFSWithWatch.FileOrFolder, ...otherFiles: TestFSWithWatch.FileOrFolder[]) { it(testName, () => runBaseline(`organizeImports/${testName}.ts`, testFile, ...otherFiles)); } @@ -298,6 +384,7 @@ F2(); function makeLanguageService(...files: TestFSWithWatch.FileOrFolder[]) { const host = projectSystem.createServerHost(files); const projectService = projectSystem.createProjectService(host, { useSingleInferredProject: true }); + projectService.setCompilerOptionsForInferredProjects({ jsx: files.some(f => f.path.endsWith("x")) ? JsxEmit.React : JsxEmit.None }); files.forEach(f => projectService.openClientFile(f.path)); return projectService.inferredProjects[0].getLanguageService(); } diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index e75db1aa59d..4a03864207e 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -1,9 +1,17 @@ /* @internal */ namespace ts.OrganizeImports { + + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ export function organizeImports( sourceFile: SourceFile, formatContext: formatting.FormatContext, - host: LanguageServiceHost) { + host: LanguageServiceHost, + program: Program) { // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) @@ -21,7 +29,7 @@ namespace ts.OrganizeImports { const newImportDecls = flatMap(sortedImportGroups, importGroup => getExternalModuleName(importGroup[0].moduleSpecifier) - ? coalesceImports(removeUnusedImports(importGroup)) + ? coalesceImports(removeUnusedImports(importGroup, sourceFile, program)) : importGroup); const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); @@ -47,8 +55,73 @@ namespace ts.OrganizeImports { return changeTracker.getChanges(); } - function removeUnusedImports(oldImports: ReadonlyArray) { - return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) + function removeUnusedImports(oldImports: ReadonlyArray, sourceFile: SourceFile, program: Program) { + const typeChecker = program.getTypeChecker(); + const jsxNamespace = typeChecker.getJsxNamespace(); + const jsxContext = sourceFile.languageVariant === LanguageVariant.JSX && program.getCompilerOptions().jsx; + + const usedImports: ImportDeclaration[] = []; + + for (const importDecl of oldImports) { + const {importClause} = importDecl; + + if (!importClause) { + // Imports without import clauses are assumed to be included for their side effects and are not removed. + usedImports.push(importDecl); + continue; + } + + let { name, namedBindings } = importClause; + + // Default import + if (name && !isDeclarationUsed(name)) { + name = undefined; + } + + if (namedBindings) { + if (isNamespaceImport(namedBindings)) { + // Namespace import + if (!isDeclarationUsed(namedBindings.name)) { + namedBindings = undefined; + } + } + else { + // List of named imports + const newElements = namedBindings.elements.filter(e => isDeclarationUsed(e.propertyName || e.name)); + if (newElements.length < namedBindings.elements.length) { + namedBindings = newElements.length + ? updateNamedImports(namedBindings, newElements) + : undefined; + } + } + } + + if (name || namedBindings) { + usedImports.push(updateImportDeclarationAndClause(importDecl, name, namedBindings)); + } + } + + return usedImports; + + function isDeclarationUsed(identifier: Identifier) { + const symbol = typeChecker.getSymbolAtLocation(identifier); + + // Be lenient with invalid code. + if (symbol === undefined) { + return true; + } + + // The JSX factory symbol is always used. + if (jsxContext && symbol.name === jsxNamespace) { + return true; + } + + const entries = FindAllReferences.getReferenceEntriesForNode(identifier.pos, identifier, program, [sourceFile], { + isCancellationRequested: () => false, + throwIfCancellationRequested: () => { /*noop*/ }, + }); + return entries.length > 1; + } } function getExternalModuleName(specifier: Expression) { @@ -66,7 +139,7 @@ namespace ts.OrganizeImports { return importGroup; } - const { importWithoutClause, defaultImports, namespaceImports, namedImports } = getImportParts(importGroup); + const { importWithoutClause, defaultImports, namespaceImports, namedImports } = getCategorizedImports(importGroup); const coalescedImports: ImportDeclaration[] = []; @@ -78,19 +151,20 @@ namespace ts.OrganizeImports { // produce two import declarations in this special case. if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { // Add the namespace import to the existing default ImportDeclaration. - const defaultImportClause = defaultImports[0].parent as ImportClause; + const defaultImport = defaultImports[0]; coalescedImports.push( - updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)); return coalescedImports; } - const sortedNamespaceImports = stableSort(namespaceImports, (n1, n2) => compareIdentifiers(n1.name, n2.name)); + const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => + compareIdentifiers((i1.importClause.namedBindings as NamespaceImport).name, (i2.importClause.namedBindings as NamespaceImport).name)); for (const namespaceImport of sortedNamespaceImports) { // Drop the name, if any coalescedImports.push( - updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + updateImportDeclarationAndClause(namespaceImport, /*name*/ undefined, namespaceImport.importClause.namedBindings)); } if (defaultImports.length === 0 && namedImports.length === 0) { @@ -100,41 +174,48 @@ namespace ts.OrganizeImports { let newDefaultImport: Identifier | undefined; const newImportSpecifiers: ImportSpecifier[] = []; if (defaultImports.length === 1) { - newDefaultImport = defaultImports[0]; + newDefaultImport = defaultImports[0].importClause.name; } else { for (const defaultImport of defaultImports) { newImportSpecifiers.push( - createImportSpecifier(createIdentifier("default"), defaultImport)); + createImportSpecifier(createIdentifier("default"), defaultImport.importClause.name)); } } - newImportSpecifiers.push(...flatMap(namedImports, n => n.elements)); + newImportSpecifiers.push(...flatMap(namedImports, i => (i.importClause.namedBindings as NamedImports).elements)); const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || compareIdentifiers(s1.name, s2.name)); - const importClause = defaultImports.length > 0 - ? defaultImports[0].parent as ImportClause - : namedImports[0].parent; + const importDecl = defaultImports.length > 0 + ? defaultImports[0] + : namedImports[0]; const newNamedImports = sortedImportSpecifiers.length === 0 ? undefined : namedImports.length === 0 ? createNamedImports(sortedImportSpecifiers) - : updateNamedImports(namedImports[0], sortedImportSpecifiers); + : updateNamedImports(namedImports[0].importClause.namedBindings as NamedImports, sortedImportSpecifiers); coalescedImports.push( - updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)); return coalescedImports; - function getImportParts(importGroup: ReadonlyArray) { + /* + * Returns entire import declarations because they may already have been rewritten and + * may lack parent pointers. The desired parts can easily be recovered based on the + * categorization. + * + * NB: There may be overlap between `defaultImports` and `namespaceImports`/`namedImports`. + */ + function getCategorizedImports(importGroup: ReadonlyArray) { let importWithoutClause: ImportDeclaration | undefined; - const defaultImports: Identifier[] = []; - const namespaceImports: NamespaceImport[] = []; - const namedImports: NamedImports[] = []; + const defaultImports: ImportDeclaration[] = []; + const namespaceImports: ImportDeclaration[] = []; + const namedImports: ImportDeclaration[] = []; for (const importDeclaration of importGroup) { if (importDeclaration.importClause === undefined) { @@ -147,15 +228,15 @@ namespace ts.OrganizeImports { const { name, namedBindings } = importDeclaration.importClause; if (name) { - defaultImports.push(name); + defaultImports.push(importDeclaration); } if (namedBindings) { if (isNamespaceImport(namedBindings)) { - namespaceImports.push(namedBindings); + namespaceImports.push(importDeclaration); } else { - namedImports.push(namedBindings); + namedImports.push(importDeclaration); } } } @@ -171,20 +252,19 @@ namespace ts.OrganizeImports { function compareIdentifiers(s1: Identifier, s2: Identifier) { return compareStringsCaseSensitive(s1.text, s2.text); } + } - function updateImportDeclarationAndClause( - importClause: ImportClause, - name: Identifier | undefined, - namedBindings: NamedImportBindings | undefined) { + function updateImportDeclarationAndClause( + importDeclaration: ImportDeclaration, + name: Identifier | undefined, + namedBindings: NamedImportBindings | undefined) { - const importDeclaration = importClause.parent; - return updateImportDeclaration( - importDeclaration, - importDeclaration.decorators, - importDeclaration.modifiers, - updateImportClause(importClause, name, namedBindings), - importDeclaration.moduleSpecifier); - } + return updateImportDeclaration( + importDeclaration, + importDeclaration.decorators, + importDeclaration.modifiers, + updateImportClause(importDeclaration.importClause, name, namedBindings), + importDeclaration.moduleSpecifier); } /* internal */ // Exported for testing diff --git a/src/services/services.ts b/src/services/services.ts index b5d6f0ec2a6..1aecef09e90 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1855,7 +1855,7 @@ namespace ts { const sourceFile = getValidSourceFile(scope.fileName); const formatContext = formatting.getFormatContext(formatOptions); - return OrganizeImports.organizeImports(sourceFile, formatContext, host); + return OrganizeImports.organizeImports(sourceFile, formatContext, host, program); } function applyCodeActionCommand(action: CodeActionCommand): Promise; diff --git a/tests/baselines/reference/organizeImports/CoalesceMultipleModules.ts b/tests/baselines/reference/organizeImports/CoalesceMultipleModules.ts index 6278722f2a9..c321f0f8fc5 100644 --- a/tests/baselines/reference/organizeImports/CoalesceMultipleModules.ts +++ b/tests/baselines/reference/organizeImports/CoalesceMultipleModules.ts @@ -4,8 +4,10 @@ import { d } from "lib1"; import { b } from "lib1"; import { c } from "lib2"; import { a } from "lib2"; +a + b + c + d; // ==ORGANIZED== import { b, d } from "lib1"; import { a, c } from "lib2"; +a + b + c + d; diff --git a/tests/baselines/reference/organizeImports/JsxFactoryUnusedTs.ts b/tests/baselines/reference/organizeImports/JsxFactoryUnusedTs.ts new file mode 100644 index 00000000000..60afb95a192 --- /dev/null +++ b/tests/baselines/reference/organizeImports/JsxFactoryUnusedTs.ts @@ -0,0 +1,6 @@ +// ==ORIGINAL== + +import { React, Other } from "react"; + +// ==ORGANIZED== + diff --git a/tests/baselines/reference/organizeImports/JsxFactoryUnusedTsx.ts b/tests/baselines/reference/organizeImports/JsxFactoryUnusedTsx.ts new file mode 100644 index 00000000000..6a97e7f660a --- /dev/null +++ b/tests/baselines/reference/organizeImports/JsxFactoryUnusedTsx.ts @@ -0,0 +1,7 @@ +// ==ORIGINAL== + +import { React, Other } from "react"; + +// ==ORGANIZED== + +import { React } from "react"; diff --git a/tests/baselines/reference/organizeImports/JsxFactoryUsed.ts b/tests/baselines/reference/organizeImports/JsxFactoryUsed.ts new file mode 100644 index 00000000000..430a5b12cd4 --- /dev/null +++ b/tests/baselines/reference/organizeImports/JsxFactoryUsed.ts @@ -0,0 +1,11 @@ +// ==ORIGINAL== + +import { React, Other } from "react"; + +
; + +// ==ORGANIZED== + +import { React } from "react"; + +
; diff --git a/tests/baselines/reference/organizeImports/UnusedTrivia1.ts b/tests/baselines/reference/organizeImports/UnusedTrivia1.ts new file mode 100644 index 00000000000..7c25f40e6c2 --- /dev/null +++ b/tests/baselines/reference/organizeImports/UnusedTrivia1.ts @@ -0,0 +1,6 @@ +// ==ORIGINAL== + +/*A*/import /*B*/ { /*C*/ F1 /*D*/ } /*E*/ from /*F*/ "lib" /*G*/;/*H*/ //I + +// ==ORGANIZED== + diff --git a/tests/baselines/reference/organizeImports/UnusedTrivia2.ts b/tests/baselines/reference/organizeImports/UnusedTrivia2.ts new file mode 100644 index 00000000000..f853015303e --- /dev/null +++ b/tests/baselines/reference/organizeImports/UnusedTrivia2.ts @@ -0,0 +1,12 @@ +// ==ORIGINAL== + +/*A*/import /*B*/ { /*C*/ F1 /*D*/, /*E*/ F2 /*F*/ } /*G*/ from /*H*/ "lib" /*I*/;/*J*/ //K + +F1(); + +// ==ORGANIZED== + +/*A*/ import { /*C*/ F1 /*D*/ } /*G*/ from "lib" /*I*/; /*J*/ //K + + +F1(); diff --git a/tests/baselines/reference/organizeImports/Unused_All.ts b/tests/baselines/reference/organizeImports/Unused_All.ts new file mode 100644 index 00000000000..bef217724b7 --- /dev/null +++ b/tests/baselines/reference/organizeImports/Unused_All.ts @@ -0,0 +1,8 @@ +// ==ORIGINAL== + +import { F1, F2 } from "lib"; +import * as NS from "lib"; +import D from "lib"; + +// ==ORGANIZED== + diff --git a/tests/baselines/reference/organizeImports/Unused_Some.ts b/tests/baselines/reference/organizeImports/Unused_Some.ts new file mode 100644 index 00000000000..2f0aaa6d499 --- /dev/null +++ b/tests/baselines/reference/organizeImports/Unused_Some.ts @@ -0,0 +1,13 @@ +// ==ORIGINAL== + +import { F1, F2 } from "lib"; +import * as NS from "lib"; +import D from "lib"; + +D(); + +// ==ORGANIZED== + +import D from "lib"; + +D(); From 98baea992e394d4820d4e96692ba5ca6beff3a0b Mon Sep 17 00:00:00 2001 From: Ricardo N Feliciano Date: Tue, 20 Feb 2018 14:19:15 -0500 Subject: [PATCH 183/298] Remove unneeded circleci branch in CircleCi config. (#22017) --- .circleci/config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 96873cf5f43..63e6fcedc0f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,6 @@ workflows: - release-2.5 - release-2.6 - release-2.7 - - circleci - node8: filters: branches: @@ -19,7 +18,6 @@ workflows: - release-2.5 - release-2.6 - release-2.7 - - circleci - node6: filters: branches: @@ -28,7 +26,6 @@ workflows: - release-2.5 - release-2.6 - release-2.7 - - circleci nightly: triggers: - schedule: @@ -45,7 +42,6 @@ workflows: - release-2.5 - release-2.6 - release-2.7 - - circleci context: nightlies - node8: filters: @@ -55,7 +51,6 @@ workflows: - release-2.5 - release-2.6 - release-2.7 - - circleci context: nightlies - node6: filters: @@ -65,7 +60,6 @@ workflows: - release-2.5 - release-2.6 - release-2.7 - - circleci context: nightlies base: &base From b00c13b716dedfc2d0d022bd68ecf18130d452c1 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 20 Feb 2018 14:32:51 -0800 Subject: [PATCH 184/298] Fix bug: Handle QualifiedName in getMeaningFromRightHandSideOfImportEquals (#21779) * Fix bug: Handle QualifiedName in getMeaningFromRightHandSideOfImportEquals * Fix lint --- src/harness/fourslash.ts | 15 ++++++++++----- src/services/utilities.ts | 15 ++++----------- tests/cases/fourslash/findAllRefsImportEquals.ts | 7 +++++++ tests/cases/fourslash/fourslash.ts | 4 ++-- 4 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 tests/cases/fourslash/findAllRefsImportEquals.ts diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index fa9bf124e51..7fdbbbc9640 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1086,7 +1086,7 @@ namespace FourSlash { } } - public verifyReferenceGroups(startRanges: Range | Range[], parts: FourSlashInterface.ReferenceGroup[]): void { + public verifyReferenceGroups(starts: string | string[] | Range | Range[], parts: FourSlashInterface.ReferenceGroup[]): void { interface ReferenceGroupJson { definition: string | { text: string, range: ts.TextSpan }; references: ts.ReferenceEntry[]; @@ -1105,8 +1105,13 @@ namespace FourSlash { }), })); - for (const startRange of toArray(startRanges)) { - this.goToRangeStart(startRange); + for (const start of toArray(starts)) { + if (typeof start === "string") { + this.goToMarker(start); + } + else { + this.goToRangeStart(start); + } const fullActual = ts.map(this.findReferencesAtCaret(), ({ definition, references }, i) => { const text = definition.displayParts.map(d => d.text).join(""); return { @@ -4075,8 +4080,8 @@ namespace FourSlashInterface { this.state.verifyReferencesOf(start, references); } - public referenceGroups(startRanges: FourSlash.Range[], parts: ReferenceGroup[]) { - this.state.verifyReferenceGroups(startRanges, parts); + public referenceGroups(starts: string | string[] | FourSlash.Range | FourSlash.Range[], parts: ReferenceGroup[]) { + this.state.verifyReferenceGroups(starts, parts); } public noReferences(markerNameOrRange?: string | FourSlash.Range) { diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 263ac0f4c3b..6ece5e018b3 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -92,7 +92,7 @@ namespace ts { return SemanticMeaning.All; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { - return getMeaningFromRightHandSideOfImportEquals(node); + return getMeaningFromRightHandSideOfImportEquals(node as Identifier); } else if (isDeclarationName(node)) { return getMeaningFromDeclaration(node.parent); @@ -112,19 +112,12 @@ namespace ts { } } - function getMeaningFromRightHandSideOfImportEquals(node: Node) { - Debug.assert(node.kind === SyntaxKind.Identifier); - + function getMeaningFromRightHandSideOfImportEquals(node: Node): SemanticMeaning { // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - - if (node.parent.kind === SyntaxKind.QualifiedName && - (node.parent).right === node && - node.parent.parent.kind === SyntaxKind.ImportEqualsDeclaration) { - return SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace; - } - return SemanticMeaning.Namespace; + const name = node.kind === SyntaxKind.QualifiedName ? node : isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === SyntaxKind.ImportEqualsDeclaration ? SemanticMeaning.All : SemanticMeaning.Namespace; } export function isInRightSideOfInternalImportEqualsDeclaration(node: Node) { diff --git a/tests/cases/fourslash/findAllRefsImportEquals.ts b/tests/cases/fourslash/findAllRefsImportEquals.ts new file mode 100644 index 00000000000..c6884c78b8c --- /dev/null +++ b/tests/cases/fourslash/findAllRefsImportEquals.ts @@ -0,0 +1,7 @@ +/// + +////import j = N./**/ [|q|]; +////namespace N { export const [|{| "isWriteAccess": true, "isDefinition": true |}q|] = 0; } + +goTo.marker(); +verify.referenceGroups("", [{ definition: "const N.q: 0", ranges: test.ranges() }]); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 987af1d6a3a..4d537661a27 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -256,10 +256,10 @@ declare namespace FourSlashInterface { */ referencesOf(start: Range, references: Range[]): void; /** - * For each of startRanges, asserts the ranges that are referenced from there. + * For each of starts, asserts the ranges that are referenced from there. * This uses the 'findReferences' command instead of 'getReferencesAtPosition', so references are grouped by their definition. */ - referenceGroups(startRanges: Range | Range[], parts: Array<{ definition: ReferencesDefinition, ranges: Range[] }>): void; + referenceGroups(starts: string | string[] | Range | Range[], parts: Array<{ definition: ReferencesDefinition, ranges: Range[] }>): void; singleReferenceGroup(definition: ReferencesDefinition, ranges?: Range[]): void; rangesAreOccurrences(isWriteAccess?: boolean): void; rangesWithSameTextAreRenameLocations(): void; From cc386d25a40e55bacc6f40fd937e08862d055c2c Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 20 Feb 2018 14:35:01 -0800 Subject: [PATCH 185/298] Filter FAR results to initial SourceFile --- src/services/organizeImports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index 4a03864207e..7f54d80e79d 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -119,7 +119,7 @@ namespace ts.OrganizeImports { const entries = FindAllReferences.getReferenceEntriesForNode(identifier.pos, identifier, program, [sourceFile], { isCancellationRequested: () => false, throwIfCancellationRequested: () => { /*noop*/ }, - }); + }).filter(e => e.type === "node" && e.node.getSourceFile() === sourceFile); return entries.length > 1; } } From 4833657c335bcfbc16975437ae3639c32ea148c5 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 20 Feb 2018 15:30:12 -0800 Subject: [PATCH 186/298] Use 'append' in chunkObjectLiteralElements (#22068) --- src/compiler/transformers/esnext.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 74afe44a097..2b887c9e93b 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -159,7 +159,7 @@ namespace ts { } function chunkObjectLiteralElements(elements: ReadonlyArray): Expression[] { - let chunkObject: ObjectLiteralElementLike[]; + let chunkObject: ObjectLiteralElementLike[] | undefined; const objects: Expression[] = []; for (const e of elements) { if (e.kind === SyntaxKind.SpreadAssignment) { @@ -171,15 +171,9 @@ namespace ts { objects.push(visitNode(target, visitor, isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === SyntaxKind.PropertyAssignment) { - chunkObject.push(createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression))); - } - else { - chunkObject.push(visitNode(e, visitor, isObjectLiteralElementLike)); - } + chunkObject = append(chunkObject, e.kind === SyntaxKind.PropertyAssignment + ? createPropertyAssignment(e.name, visitNode(e.initializer, visitor, isExpression)) + : visitNode(e, visitor, isObjectLiteralElementLike)); } } if (chunkObject) { From 81e5cf70a96a93b2b0d54a257e8388b870dfddb3 Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 21 Feb 2018 11:10:14 +0000 Subject: [PATCH 187/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1887cea0c87..59ede10c95b 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3021,6 +3021,15 @@ + + + + + + + + + From 6523927716a843759b247cc3f9dc3136917c59b5 Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 21 Feb 2018 17:10:30 +0000 Subject: [PATCH 188/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index c5a24f11483..1d0a08bdfe6 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3030,6 +3030,15 @@ + + + + + + + + + From 530d7e9358ee95d2101a619e73356867b617cd95 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 21 Feb 2018 09:12:48 -0800 Subject: [PATCH 189/298] Update LKG (#22085) --- lib/cs/diagnosticMessages.generated.json | 103 +- lib/de/diagnosticMessages.generated.json | 79 +- lib/enu/diagnosticMessages.generated.json.lcg | 150 +- lib/es/diagnosticMessages.generated.json | 109 +- lib/fr/diagnosticMessages.generated.json | 111 +- lib/it/diagnosticMessages.generated.json | 122 +- lib/ja/diagnosticMessages.generated.json | 289 +- lib/ko/diagnosticMessages.generated.json | 122 +- lib/lib.d.ts | 325 +- lib/lib.dom.d.ts | 270 +- lib/lib.es2015.collection.d.ts | 10 +- lib/lib.es2015.core.d.ts | 7 +- lib/lib.es2015.generator.d.ts | 1 - lib/lib.es2015.iterable.d.ts | 6 +- lib/lib.es2015.symbol.wellknown.d.ts | 2 +- lib/lib.es2016.full.d.ts | 270 +- lib/lib.es2017.full.d.ts | 270 +- lib/lib.es2017.object.d.ts | 8 +- lib/lib.es2018.d.ts | 2 +- lib/lib.es2018.full.d.ts | 271 +- lib/lib.es5.d.ts | 58 +- lib/lib.es6.d.ts | 351 +- lib/lib.esnext.array.d.ts | 223 + lib/lib.esnext.d.ts | 4 +- lib/lib.esnext.full.d.ts | 274 +- lib/lib.esnext.promise.d.ts | 32 + lib/lib.webworker.d.ts | 72 +- lib/pl/diagnosticMessages.generated.json | 114 +- lib/protocol.d.ts | 77 +- lib/pt-BR/diagnosticMessages.generated.json | 151 +- lib/ru/diagnosticMessages.generated.json | 111 +- lib/tr/diagnosticMessages.generated.json | 171 +- lib/tsc.js | 16821 +++++---- lib/tsserver.js | 25923 +++++++------- lib/tsserverlibrary.d.ts | 967 +- lib/tsserverlibrary.js | 27644 ++++++++------- lib/typescript.d.ts | 1059 +- lib/typescript.js | 28397 +++++++++------- lib/typescriptServices.d.ts | 1059 +- lib/typescriptServices.js | 28397 +++++++++------- lib/typingsInstaller.js | 4443 +-- lib/zh-CN/diagnosticMessages.generated.json | 111 +- lib/zh-TW/diagnosticMessages.generated.json | 105 +- 43 files changed, 80036 insertions(+), 59055 deletions(-) create mode 100644 lib/lib.esnext.array.d.ts create mode 100644 lib/lib.esnext.promise.d.ts diff --git a/lib/cs/diagnosticMessages.generated.json b/lib/cs/diagnosticMessages.generated.json index 8326f8fc739..1b97ea68087 100644 --- a/lib/cs/diagnosticMessages.generated.json +++ b/lib/cs/diagnosticMessages.generated.json @@ -12,11 +12,11 @@ "A_class_member_cannot_have_the_0_keyword_1248": "Člen třídy nemůže mít klíčové slovo {0}.", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "Výraz s čárkou není v názvu počítané vlastnosti povolený.", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "Název počítané vlastnosti nemůže odkazovat na parametr typu z jeho nadřazeného typu.", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Název vypočítané vlastnosti v deklaraci vlastnosti třídy musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Název vypočítané vlastnosti v přetížené metodě musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Název vypočítané vlastnosti v literálu typu musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Název vypočítané vlastnosti v ambientním kontextu musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Název vypočítané vlastnosti v rozhraní musí odkazovat na výraz, jehož typ je literál nebo jedinečný symbol.", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Název počítané vlastnosti v deklaraci vlastnosti třídy musí přímo odkazovat na výraz, jehož typ je literál nebo unique symbol.", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Název počítané vlastnosti v přetížené metodě musí odkazovat na výraz, jehož typ je literál nebo unique symbol.", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Název počítané vlastnosti v literálu typu musí odkazovat na výraz, jehož typ je literál nebo unique symbol.", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Název počítané vlastnosti v ambientním kontextu musí odkazovat na výraz, jehož typ je literál nebo unique symbol.", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Název počítané vlastnosti v rozhraní musí odkazovat na výraz, jehož typ je literál nebo unique symbol.", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Název počítané vlastnosti musí být typu string, number, symbol nebo any.", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "Název počítané vlastnosti ve formátu {0} musí být typu symbol.", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Ke členu konstantního výčtu se dá získat přístup jenom pomocí řetězcového literálu.", @@ -48,16 +48,18 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Deklarace oboru názvů nemůže být v jiném souboru než třída nebo funkce, se kterou se slučuje.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Deklarace oboru názvů nemůže být umístěná před třídou nebo funkcí, se kterou se slučuje.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Deklarace oboru názvů je povolená jenom v oboru názvů nebo v modulu.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Import stylu oboru názvů není možné vyvolat nebo konstruovat a způsobí selhání za běhu.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Inicializátor parametru je povolený jenom v implementaci funkce nebo konstruktoru.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Vlastnost parametru se nedá deklarovat pomocí parametru rest.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Vlastnost parametru je povolená jenom v implementaci konstruktoru.", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "Vlastnost parametru se nedá deklarovat pomocí vzoru vazby.", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "Cesta v možnosti extends musí být relativní nebo mít kořen, ale {0} nic z toho nesplňuje.", "A_promise_must_have_a_then_method_1059": "Příslib musí mít metodu then.", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Vlastnost třídy, jejíž typ je jedinečný symbol, musí být static a readonly.", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Vlastnost rozhraní nebo literálu typu, jehož typ je jedinečný symbol, musí být readonly.", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Vlastnost třídy, jejíž typ je unique symbol, musí být static a readonly.", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Vlastnost rozhraní nebo literálu typu, jehož typ je unique symbol, musí být readonly.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Povinný parametr nemůže následovat po nepovinném parametru.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Element rest nemůže obsahovat vzor vazby.", + "A_rest_element_cannot_have_a_property_name_2566": "Element rest nemůže mít název vlastnosti.", "A_rest_element_cannot_have_an_initializer_1186": "Element rest nemůže obsahovat inicializátor.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Element rest musí být ve vzoru destrukturalizace poslední.", "A_rest_parameter_cannot_be_optional_1047": "Parametr rest nemůže být nepovinný.", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "Predikát typu nemůže odkazovat na element {0} ve vzoru vazby.", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "Predikát typu je povolený jenom na pozici návratového typu funkcí a metod.", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "Typ predikátu typu musí být přiřaditelný k typu jeho parametru.", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Proměnná, jejíž typ je jedinečný symbol, musí být const.", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Proměnná, jejíž typ je unique symbol, musí být const.", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Výraz yield je povolený jenom v těle generátoru.", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "K abstraktní metodě {0} ve třídě {1} nejde získat přístup prostřednictvím výrazu super.", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Abstraktní metody se můžou vyskytovat jenom v abstraktní třídě.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "Modifikátor dostupnosti se už jednou vyskytl.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Přístupové objekty jsou dostupné, jenom když je cílem ECMAScript 5 a vyšší verze.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Přistupující objekty musí být abstraktní nebo neabstraktní.", - "Add_0_to_existing_import_declaration_from_1_90015": "Přidá {0} k existující deklaraci importu z {1}.", + "Add_0_to_existing_import_declaration_from_1_90015": "Přidat {0} k existující deklaraci importu z {1}", + "Add_async_modifier_to_containing_function_90029": "Přidat modifikátor async do obsahující funkce", "Add_index_signature_for_property_0_90017": "Přidat signaturu indexu pro vlastnost {0}", - "Add_missing_super_call_90001": "Přidejte chybějící volání metody super().", - "Add_this_to_unresolved_variable_90008": "Přidejte k nerozpoznané proměnné this.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Přidání souboru tsconfig.json vám pomůže uspořádat projekty, které obsahují jak soubory TypeScript, tak soubory JavaScript. Další informace najdete na adrese https://aka.ms/tsconfig.", + "Add_missing_super_call_90001": "Přidat chybějící volání metody super()", + "Add_this_to_unresolved_variable_90008": "Přidat k nerozpoznané proměnné this.", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Přidání souboru tsconfig.json vám pomůže uspořádat projekty, které obsahují jak soubory TypeScript, tak soubory JavaScript. Další informace najdete na adrese https://aka.ms/tsconfig.", "Additional_Checks_6176": "Další kontroly", "Advanced_Options_6178": "Upřesnit možnosti", "All_declarations_of_0_must_have_identical_modifiers_2687": "Všechny deklarace {0} musí mít stejné modifikátory.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "V parametru signatury indexu nemůže být modifikátor přístupnosti.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "V parametru signatury indexu nemůže být inicializátor.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "V parametru signatury indexu nemůže být anotace typu.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Typ parametru signatury indexu nemůže být alias typu. Místo toho zvažte toto zadání: [{0}: {1}]: {2}.", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Typ parametru signatury indexu nemůže být typ sjednocení. Místo toho zvažte použití namapovaného typu objektu.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Parametr signatury indexu musí být typu string nebo number.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Rozhraní může rozšířit jenom identifikátor nebo kvalifikovaný název s volitelnými argumenty typu.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Rozhraní může rozšiřovat jenom třídu nebo jiné rozhraní.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "Očekává se binární číslice.", "Binding_element_0_implicitly_has_an_1_type_7031": "Element vazby {0} má implicitně typ {1}.", "Block_scoped_variable_0_used_before_its_declaration_2448": "Proměnná bloku {0} se používá před vlastní deklarací.", - "Call_decorator_expression_90028": "Výraz pro volání dekoratéru", + "Call_decorator_expression_90028": "Zavolat výraz dekorátoru", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Signatura volání s chybějící anotací návratového typu má implicitně návratový typ any.", "Call_target_does_not_contain_any_signatures_2346": "Cíl volání neobsahuje žádné signatury.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "K {0}.{1} nelze získat přístup, protože {0} je typ, nikoli názvový prostor. Chtěli jste načíst typ vlastnosti {1} v {0} pomocí {0}[{1}]?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Soubory deklarací typů nejde importovat. Zvažte možnost místo {1} naimportovat {0}.", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Proměnnou {0} s vnějším oborem nejde inicializovat ve stejném oboru jako deklaraci {1} s oborem bloku.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Nejde vyvolat výraz, v jehož typu chybí signatura volání. Typ {0} nemá žádné kompatibilní signatury volání.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Nejde vyvolat objekt, který může být null.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Nejde vyvolat objekt, který může být null nebo nedefinovaný.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Nejde vyvolat objekt, který může být nedefinovaný.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "Typ nejde znovu exportovat, pokud je zadaný příznak --isolatedModules.", "Cannot_read_file_0_Colon_1_5012": "Nejde číst soubor {0}: {1}", "Cannot_redeclare_block_scoped_variable_0_2451": "Nejde předeklarovat proměnnou bloku {0}.", @@ -211,7 +219,7 @@ "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Proměnná klauzule catch nemůže mít anotaci typu.", "Catch_clause_variable_cannot_have_an_initializer_1197": "Proměnná klauzule catch nemůže mít inicializátor.", "Change_0_to_1_90014": "Změnit {0} na {1}", - "Change_extends_to_implements_90003": "Změňte extends na implements.", + "Change_extends_to_implements_90003": "Změnit extends na implements", "Change_spelling_to_0_90022": "Změnit pravopis na {0}", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Kontroluje se, jestli je {0} nejdelší odpovídající předpona pro {1}–{2}.", "Circular_definition_of_import_alias_0_2303": "Cyklická definice aliasu importu {0}", @@ -221,9 +229,10 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "Třída {0} definuje členskou funkci instance {1}, ale rozšířená třída {2} ji definuje jako vlastnost člena instance.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "Třída {0} definuje vlastnost člena instance {1}, ale rozšířená třída {2} ji definuje jako členskou funkci instance.", "Class_0_incorrectly_extends_base_class_1_2415": "Třída {0} nesprávně rozšiřuje základní třídu {1}.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "Třída {0} nesprávně implementuje třídu {1}. Nechtěli jste rozšířit třídu {1} a dědit její členy jako podtřídu?", "Class_0_incorrectly_implements_interface_1_2420": "Třída {0} nesprávně implementuje rozhraní {1}.", "Class_0_used_before_its_declaration_2449": "Třída {0} se používá dříve, než se deklaruje.", - "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Deklarace tříd nemůžou obsahovat více než jednu značku @augments nebo @extends.", + "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Deklarace tříd nemůžou mít více než jednu značku @augments nebo @extends.", "Class_name_cannot_be_0_2414": "Třída nemůže mít název {0}.", "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417": "Statická strana třídy {0} nesprávně rozšiřuje statickou stranu základní třídy {1}.", "Classes_can_only_extend_a_single_class_1174": "Třídy můžou rozšířit jenom jednu třídu.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Není zadaný obsažený soubor a nedá se určit kořenový adresář – přeskakuje se vyhledávání ve složce node_modules.", "Convert_function_0_to_class_95002": "Převést funkci {0} na třídu", "Convert_function_to_an_ES2015_class_95001": "Převést funkci na třídu ES2015", + "Convert_to_ES6_module_95017": "Převést na modul ES6", "Convert_to_default_import_95013": "Převést na výchozí import", "Corrupted_locale_file_0_6051": "Soubor národního prostředí {0} je poškozený.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Nenašel se soubor deklarací pro modul {0}. {1} má implicitně typ any.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Očekává se deklarace.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Název deklarace je v konfliktu s integrovaným globálním identifikátorem {0}.", "Declaration_or_statement_expected_1128": "Očekává se deklarace nebo příkaz.", - "Declare_method_0_90023": "Deklarujte metodu {0}.", - "Declare_property_0_90016": "Deklarujte vlastnost {0}.", - "Declare_static_method_0_90024": "Deklarujte statickou metodu {0}.", - "Declare_static_property_0_90027": "Deklarujte statickou vlastnost {0}.", + "Declare_method_0_90023": "Deklarovat metodu {0}", + "Declare_property_0_90016": "Deklarovat vlastnost {0}", + "Declare_static_method_0_90024": "Deklarovat statickou metodu {0}", + "Declare_static_property_0_90027": "Deklarovat statickou vlastnost {0}", "Decorators_are_not_valid_here_1206": "Dekorátory tady nejsou platné.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Dekorátory nejde použít na víc přístupových objektů get/set se stejným názvem.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Výchozí export modulu má nebo používá privátní název {0}.", @@ -305,10 +315,11 @@ "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151": "Vygeneruje jediný soubor se zdrojovými mapováními namísto samostatného souboru.", "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152": "Vygeneruje zdroj spolu se zdrojovými mapováními v jednom souboru. Vyžaduje, aby byla nastavená možnost --inlineSourceMap nebo --sourceMap.", "Enable_all_strict_type_checking_options_6180": "Povolí všechny možnosti striktní kontroly typů.", - "Enable_strict_checking_of_function_types_6186": "Povolte striktní kontrolu typů funkcí.", + "Enable_strict_checking_of_function_types_6186": "Povolí striktní kontrolu typů funkcí.", "Enable_strict_checking_of_property_initialization_in_classes_6187": "Povolí striktní kontrolu inicializace vlastností ve třídách.", "Enable_strict_null_checks_6113": "Povolte striktní kontroly hodnot null.", "Enable_tracing_of_the_name_resolution_process_6085": "Povolte trasování procesu překladu IP adres.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Povolí interoperabilitu generování mezi moduly CommonJS a ES prostřednictvím vytváření objektů oboru názvů pro všechny importy. Implikuje allowSyntheticDefaultImports.", "Enables_experimental_support_for_ES7_async_functions_6068": "Zapíná experimentální podporu asynchronních funkcí ES7.", "Enables_experimental_support_for_ES7_decorators_6065": "Povolí experimentální podporu pro dekorátory ES7.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Povolí experimentální podporu pro generování metadat typu pro dekorátory.", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "Výraz se přeloží na deklaraci proměnné _this, pomocí které kompilátor zaznamenává odkazy na příkaz this.", "Extract_constant_95006": "Extrahovat konstantu", "Extract_function_95005": "Extrahovat funkci", - "Extract_symbol_95003": "Extrahovat symbol", "Extract_to_0_in_1_95004": "Extrahovat do {0} v {1}", "Extract_to_0_in_1_scope_95008": "Extrahovat do {0} v oboru {1}", "Extract_to_0_in_enclosing_scope_95007": "Extrahovat do {0} v nadřazeném oboru", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "Název souboru {0} se od už zahrnutého názvu souboru {1} liší jenom velikostí písmen.", "File_name_0_has_a_1_extension_stripping_it_6132": "Název souboru {0} má příponu {1} – odstraňuje se", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "Specifikace souboru nemůže obsahovat nadřazený adresář (..), který se vyskytuje za rekurzivním zástupným znakem adresáře (**): {0}.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "Specifikace souboru nemůže obsahovat víc než jeden rekurzivní zástupný znak adresáře (**): {0}.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "Specifikace souboru nemůže končit rekurzivním zástupným znakem adresáře (**): {0}.", "Found_package_json_at_0_6099": "Soubor package.json se našel v {0}.", + "Found_package_json_at_0_Package_ID_is_1_6190": "V {0} se našel soubor package.json. ID balíčku je {1}.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Deklarace funkcí nejsou povolené uvnitř bloků ve striktním režimu, pokud je cíl ES3 nebo ES5.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Deklarace funkcí nejsou povolené uvnitř bloků ve striktním režimu, pokud je cíl ES3 nebo ES5. Definice tříd jsou automaticky ve striktním režimu.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Deklarace funkcí nejsou povolené uvnitř bloků ve striktním režimu, pokud je cíl ES3 nebo ES5. Moduly jsou automaticky ve striktním režimu.", @@ -405,10 +415,10 @@ "Identifier_expected_1003": "Očekával se identifikátor.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Očekává se identifikátor. __esModule je při transformaci modulů ECMAScript rezervované jako označení exportu.", "Ignore_this_error_message_90019": "Ignorovat tuto chybovou zprávu", - "Implement_inherited_abstract_class_90007": "Implementujte zděděnou abstraktní třídu.", - "Implement_interface_0_90006": "Implementujte rozhraní {0}.", + "Implement_inherited_abstract_class_90007": "Implementovat zděděnou abstraktní třídu", + "Implement_interface_0_90006": "Implementovat rozhraní {0}", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "Klauzule implements exportované třídy {0} má nebo používá privátní název {1}.", - "Import_0_from_module_1_90013": "Import {0} z modulu {1}", + "Import_0_from_module_1_90013": "Importovat {0} z modulu {1}", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Přiřazení importu nelze použít, pokud jsou cílem moduly ECMAScript. Zkuste místo toho použít import * as ns from \"mod\", import {a} from \"mod\", import d from \"mod\" nebo jiný formát modulu.", "Import_declaration_0_is_using_private_name_1_4000": "Deklarace importu {0} používá privátní název {1}.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "Deklarace importu je v konfliktu s místní deklarací {0}.", @@ -424,8 +434,8 @@ "Index_signature_is_missing_in_type_0_2329": "V typu {0} chybí signatura indexu.", "Index_signatures_are_incompatible_2330": "Signatury indexu jsou nekompatibilní.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Jednotlivé deklarace ve sloučené deklaraci {0} musí být všechny exportované nebo všechny místní.", - "Infer_parameter_types_from_usage_95012": "Odvodit typy parametrů z používání", - "Infer_type_of_0_from_usage_95011": "Odvodit typ {0} z používání", + "Infer_parameter_types_from_usage_95012": "Odvodit typy parametrů z využití", + "Infer_type_of_0_from_usage_95011": "Odvodit typ {0} z využití", "Initialize_property_0_in_the_constructor_90020": "Inicializovat vlastnost {0} v konstruktoru", "Initialize_static_property_0_90021": "Inicializovat statickou vlastnost {0}", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "Inicializátor instance členské proměnné {0} nemůže odkazovat na identifikátor {1} deklarovaný v konstruktoru.", @@ -451,8 +461,8 @@ "JSDoc_0_1_does_not_match_the_extends_2_clause_8023": "Značka JSDoc @{0} {1} neodpovídá klauzuli extends {2}.", "JSDoc_0_is_not_attached_to_a_class_8022": "Značka JSDoc @{0} není připojená k třídě.", "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028": "JSDoc ... se může nacházet jen v posledním parametru signatury.", - "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "Značka JSDoc @param má název {0}, ale žádný parametr s tímto názvem neexistuje.", - "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "Značka JSDoc @typedef by měla mít anotaci typu nebo by za ní měla následovat značka @property nebo @member.", + "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_8024": "Značka JSDoc @param má název {0}, ale neexistuje žádný parametr s tímto názvem.", + "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021": "Značka JSDoc @typedef by měla mít poznámku k typu nebo by za ní měly následovat značky @property nebo @member.", "JSDoc_types_can_only_be_used_inside_documentation_comments_8020": "Typy JSDoc se můžou používat jenom v dokumentačních komentářích.", "JSX_attribute_expected_17003": "Očekával se atribut JSX.", "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000": "Atributy JSX musí mít přiřazený neprázdný výraz.", @@ -485,6 +495,7 @@ "Longest_matching_prefix_for_0_is_1_6108": "Nejdelší odpovídající předpona pro {0} je {1}.", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Hledání ve složce node_modules, počáteční umístění {0}", "Make_super_call_the_first_statement_in_the_constructor_90002": "Nastavit volání metody super() jako první příkaz v konstruktoru", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "Typu mapovaného objektu má implicitně typ šablony any.", "Member_0_implicitly_has_an_1_type_7008": "Člen {0} má implicitně typ {1}.", "Merge_conflict_marker_encountered_1185": "Zjistila se značka konfliktu sloučení.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "Spojená deklarace {0} nemůže obsahovat výchozí deklaraci exportu. Zvažte namísto toho možnost přidat samostatnou deklaraci export default {0}.", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== Název modulu {0} byl úspěšně přeložen na {1}. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Druh překladu modulu nebyl určen, použije se {0}.", "Module_resolution_using_rootDirs_has_failed_6111": "Překlad modulu pomocí rootDirs se nepovedl.", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Více po sobě jdoucích číselných oddělovačů se nepovoluje.", "Multiple_constructor_implementations_are_not_allowed_2392": "Víc implementací konstruktoru se nepovoluje.", "NEWLINE_6061": "NOVÝ ŘÁDEK", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "Pojmenovaná vlastnost {0} není u typu {1} stejná jako u typu {2}.", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Výraz neabstraktní třídy neimplementuje zděděný abstraktní člen {0} z třídy {1}.", "Not_all_code_paths_return_a_value_7030": "Ne všechny cesty kódu vracejí hodnotu.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Typ číselného indexu {0} se nedá přiřadit k typu indexu řetězce {1}.", + "Numeric_separators_are_not_allowed_here_6188": "Číselné oddělovače tady nejsou povolené.", "Object_is_possibly_null_2531": "Objekt je pravděpodobně null.", "Object_is_possibly_null_or_undefined_2533": "Objekt je pravděpodobně null nebo undefined.", "Object_is_possibly_undefined_2532": "Objekt je pravděpodobně undefined.", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "Klíčovým slovem new se dá volat jenom funkce void.", "Only_ambient_modules_can_use_quoted_names_1035": "Názvy v uvozovkách můžou mít jenom ambientní moduly.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Spolu s --{0} se podporují jenom moduly amd a system.", + "Only_emit_d_ts_declaration_files_6014": "Bude vydávat jen soubory deklarací .d.ts.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "V klauzuli třídy extends se aktuálně podporují jenom identifikátory nebo kvalifikované názvy s volitelnými argumenty typu.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Prostřednictvím klíčového slova super jsou přístupné jenom veřejné a chráněné metody základní třídy.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Operátor {0} nejde použít u typů {1} a {2}.", @@ -596,6 +610,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Vlastnost {0} nemá žádný inicializátor a není jednoznačně přiřazena v konstruktoru.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Vlastnost {0} má implicitně typ any, protože její přistupující objekt get nemá anotaci návratového typu.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Vlastnost {0} má implicitně typ any, protože její přistupující objekt set nemá anotaci parametrového typu.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Vlastnost {0} v typu {1} nejde přiřadit ke stejné vlastnosti v základním typu {2}.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "Vlastnost {0} v typu {1} nejde přiřadit typu {2}.", "Property_0_is_declared_but_its_value_is_never_read_6138": "Deklaruje se vlastnost {0}, ale její hodnota se vůbec nečte.", "Property_0_is_incompatible_with_index_signature_2530": "Vlastnost {0} není kompatibilní se signaturou indexu.", @@ -634,7 +649,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Vyvolat chybu u výrazů a deklarací s implikovaným typem any", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Vyvolá chybu u výrazů this s implikovaným typem any.", "Redirect_output_structure_to_the_directory_6006": "Přesměrování výstupní struktury do adresáře", - "Remove_declaration_for_Colon_0_90004": "Odeberte deklaraci pro {0}.", + "Remove_declaration_for_Colon_0_90004": "Odebrat deklaraci pro {0}", + "Replace_import_with_0_95015": "Nahradí import použitím: {0}.", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Oznámí se chyba, když některé cesty kódu ve funkci nevracejí hodnotu.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Oznámí se chyby v případech fallthrough v příkazu switch.", "Report_errors_in_js_files_8019": "Ohlásit chyby v souborech .js", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "Návratový typ veřejné statické metody z exportované třídy má nebo používá privátní název {0}.", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Znovu se používají vyhodnocení modulu z {0}, protože vyhodnocení se oproti původnímu programu nezměnila.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Znovu se používá vyhodnocení modulu {0} do souboru {1} z původního programu.", - "Rewrite_as_the_indexed_access_type_0_90026": "Proveďte přepis jako indexovaný přístupový typ {0}.", + "Rewrite_as_the_indexed_access_type_0_90026": "Přepsat jako indexovaný typ přístupu {0}", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Nedá se určit kořenový adresář, přeskakují se primární cesty hledání.", "STRATEGY_6039": "STRATEGIE", "Scoped_package_detected_looking_in_0_6182": "Zjištěn balíček v oboru, hledání v: {0}", @@ -688,14 +704,14 @@ "Show_all_compiler_options_6169": "Zobrazí všechny možnosti kompilátoru.", "Show_diagnostic_information_6149": "Zobrazí diagnostické informace.", "Show_verbose_diagnostic_information_6150": "Zobrazí podrobné diagnostické informace.", - "Signature_0_must_be_a_type_predicate_1224": "Podpis {0} musí být predikát typu.", + "Signature_0_must_be_a_type_predicate_1224": "Signatura {0} musí být predikát typu.", "Skip_type_checking_of_declaration_files_6012": "Přeskočit kontrolu typu souborů deklarace", "Source_Map_Options_6175": "Možnosti zdrojového mapování", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Specializovaná signatura přetížení nejde přiřadit žádnému nespecializovanému podpisu.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Specifikátor dynamického importu nemůže být elementem Spread.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "Zadejte cílovou verzi ECMAScriptu: ES3 (výchozí), ES5, ES2015, ES2016, ES2017, nebo ESNEXT.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "Zadejte cílovou verzi ECMAScriptu: ES3 (výchozí), ES5, ES2015, ES2016, ES2017, ES2018 nebo ESNEXT.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "Zadejte generování kódu JSX: preserve, react-native, nebo react.", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Zadejte soubory knihovny, které se mají zahrnout do kompilace: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Zadejte soubory knihovny, které se mají zahrnout do kompilace.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Určete generování kódu modulu: none, commonjs, amd, system, umd, es2015 nebo ESNext.", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Zadejte strategii překladu modulu: node (Node.js) nebo classic (TypeScript verze nižší než 1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Zadejte funkci objektu pro vytváření JSX, která se použije při zaměření na generování JSX react, např. React.createElement nebo h.", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Zadejte kořenový adresář vstupních souborů. Slouží ke kontrole struktury výstupního adresáře pomocí --outDir.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "Operátor rozšíření ve výrazech new je dostupný jenom při cílení na verzi ECMAScript 5 a vyšší.", "Spread_types_may_only_be_created_from_object_types_2698": "Typy spread se dají vytvářet jenom z typů object.", + "Starting_compilation_in_watch_mode_6031": "Spouští se kompilace v režimu sledování...", "Statement_expected_1129": "Očekává se příkaz.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Příkazy se nepovolují v ambientních kontextech.", "Static_members_cannot_reference_class_type_parameters_2302": "Statické členy nemůžou odkazovat na parametry typu třídy.", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "Očekává se řetězcový literál.", "String_literal_with_double_quotes_expected_1327": "Očekával se řetězcový literál s dvojitými uvozovkami.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Stylizujte chyby a zprávy pomocí barev a kontextu (experimentální).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Deklarace následných vlastností musí obsahovat stejný typ. Vlastnost {0} musí být typu {1}, ale tady je typu {2}.", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Deklarace následných proměnných musí obsahovat stejný typ. Proměnná {0} musí být typu {1}, ale tady je typu {2}.", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "Nahrazení {0} za vzor {1} má nesprávný typ, očekával se typ string, obdržený je {2}.", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "Nahrazení {0} ve vzoru {1} může obsahovat nanejvýš jeden znak * (hvězdička).", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Typ {0} není typem pole nebo řetězce, nebo nemá metodu [Symbol.iterator](), která vrací iterátor.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Typ {0} není typem pole, nebo nemá metodu [Symbol.iterator](), která vrací iterátor.", "Type_0_is_not_assignable_to_type_1_2322": "Typ {0} nejde přiřadit typu {1}.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "Typ {0} se nedá přiřadit typu {1}. Existují dva různé typy s tímto názvem, ale nesouvisí spolu.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "Typ {0} se nedá přiřadit typu {1}. Existují dva různé typy s tímto názvem, ale nesouvisí spolu.", "Type_0_is_not_comparable_to_type_1_2678": "Typ {0} se nedá porovnat s typem {1}.", "Type_0_is_not_generic_2315": "Typ {0} není obecný.", "Type_0_provides_no_match_for_the_signature_1_2658": "Typ {0} neposkytuje žádnou shodu pro podpis {1}.", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "Neukončený literál šablony", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Volání netypové funkce nemusí přijmout argumenty typu.", "Unused_label_7028": "Nepoužívaný popisek", + "Use_synthetic_default_member_95016": "Použije syntetického výchozího člena.", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Použití řetězce v příkazu for...of se podporuje jenom v ECMAScript 5 nebo vyšší verzi.", "VERSION_6036": "VERZE", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "Hodnota typu {0} nemá žádné vlastnosti společné s typem {1}. Chtěli jste ji volat?", @@ -913,9 +931,9 @@ "const_declarations_must_be_initialized_1155": "Deklarace const se musejí inicializovat.", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "Inicializátor člena výčtu const se vyhodnotil na nekonečnou hodnotu.", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "Inicializátor člena výčtu const se vyhodnotil na nepovolenou hodnotu NaN.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Výčty const se dají použít jenom ve výrazech přístupu k vlastnosti nebo indexu nebo na pravé straně deklarace importu nebo přiřazení exportu.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Výčty const se dají použít jenom ve výrazech přístupu k vlastnosti nebo indexu nebo na pravé straně deklarace importu, přiřazení exportu nebo dotazu na typ.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "Příkaz delete nejde volat u identifikátoru ve striktním režimu.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Deklarace výčtu se dají použít jenom v souboru .ts.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Deklarace enum se dají použít jen v souboru .ts.", "export_can_only_be_used_in_a_ts_file_8003": "Možnost export= se dá použít jenom v souboru .ts.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Modifikátor export se nedá použít u ambientních modulů a rozšíření modulů, protože jsou vždy viditelné.", "extends_clause_already_seen_1172": "Klauzule extends se už jednou vyskytla.", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "Klauzule implements se už jednou vyskytla.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "Klauzule implements se dají použít jenom v souboru .ts.", "import_can_only_be_used_in_a_ts_file_8002": "Možnost import ... = se dá použít jenom v souboru .ts.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Deklarace infer jsou povolené jenom v klauzuli extends podmíněného typu.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "Deklarace rozhraní se dají použít jenom v souboru .ts.", "let_declarations_can_only_be_declared_inside_a_block_1157": "Deklarace let je možné deklarovat jenom uvnitř bloku.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "Nepovoluje se používat let jako název v deklaracích let nebo const.", @@ -937,7 +956,7 @@ "non_null_assertions_can_only_be_used_in_a_ts_file_8013": "Kontrolní výrazy nenabývající hodnoty null lze použít jen v souboru .ts.", "options_6024": "možnosti", "or_expected_1144": "Očekává se znak { nebo ;.", - "package_json_does_not_have_a_0_field_6100": "package.json nemá pole {0}.", + "package_json_does_not_have_a_0_field_6100": "Soubor package.json neobsahuje pole {0}.", "package_json_has_0_field_1_that_references_2_6101": "Soubor package.json má pole {0} {1}, které odkazuje na {2}.", "parameter_modifiers_can_only_be_used_in_a_ts_file_8012": "Modifikátory parametrů se dají použít jenom v souboru .ts.", "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091": "Je zadaná možnost paths, hledá se vzor, který odpovídá názvu modulu {0}.", @@ -963,9 +982,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "Výrazy potvrzení typu se dají použít jenom v souboru .ts.", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "Deklarace parametru typu se dají použít jenom v souboru .ts.", "types_can_only_be_used_in_a_ts_file_8010": "Typy se dají použít jenom v souboru .ts.", - "unique_symbol_types_are_not_allowed_here_1335": "Typy „jedinečný symbol“ tady nejsou povolené.", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Typy „jedinečný symbol“ jsou povolené jen u proměnných v příkazu proměnné.", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Typy „jedinečný symbol“ nejde použít v deklaraci proměnné s názvem vazby.", + "unique_symbol_types_are_not_allowed_here_1335": "Typy unique symbol tady nejsou povolené.", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Typy unique symbol jsou povolené jen u proměnných v příkazu proměnné.", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Typy unique symbol nejde použít v deklaraci proměnné s názvem vazby.", "with_statements_are_not_allowed_in_an_async_function_block_1300": "Příkazy with se ve funkčním bloku async nepovolují.", "with_statements_are_not_allowed_in_strict_mode_1101": "Příkazy with se ve striktním režimu nepovolují.", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "Výrazy yield nejde použít v inicializátoru parametru." diff --git a/lib/de/diagnosticMessages.generated.json b/lib/de/diagnosticMessages.generated.json index 96aa6222744..bff4663aa81 100644 --- a/lib/de/diagnosticMessages.generated.json +++ b/lib/de/diagnosticMessages.generated.json @@ -48,6 +48,7 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Eine Namespacedeklaration darf sich nicht in einer anderen Datei als die Klasse oder Funktion befinden, mit der sie zusammengeführt wird.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Eine Namespacedeklaration darf nicht vor der Klasse oder Funktion positioniert werden, mit der sie zusammengeführt wird.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Eine Namespacedeklaration ist nur in einem Namespace oder Modul zulässig.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Ein Import im Namespacestil kann nicht aufgerufen oder erstellt werden und verursacht zur Laufzeit einen Fehler.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Ein Parameterinitialisierer ist nur in einer Funktions- oder Konstruktorimplementierung zulässig.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Eine Parametereigenschaft darf nicht mithilfe eines rest-Parameters deklariert werden.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Eine Parametereigenschaft ist nur in einer Konstruktorimplementierung zulässig.", @@ -58,6 +59,7 @@ "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Eine Eigenschaft einer Schnittstelle oder eines Typliterals, deren Typ ein \"unique symbol\"-Typ ist, muss \"readonly\" sein.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Ein erforderlicher Parameter darf nicht auf einen optionalen Parameter folgen.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Ein rest-Element darf kein Bindungsmuster enthalten.", + "A_rest_element_cannot_have_a_property_name_2566": "Ein rest-Element darf keinen Eigenschaftennamen aufweisen.", "A_rest_element_cannot_have_an_initializer_1186": "Ein rest-Element darf keinen Initialisierer aufweisen.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Ein rest-Element muss das letzte Element in einem Destrukturierungsmuster sein.", "A_rest_parameter_cannot_be_optional_1047": "Ein rest-Parameter darf nicht optional sein.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "Der Zugriffsmodifizierer ist bereits vorhanden.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Zugriffsmethoden sind nur verfügbar, wenn das Ziel ECMAScript 5 oder höher ist.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Beide Accessoren müssen abstrakt oder nicht abstrakt sein.", - "Add_0_to_existing_import_declaration_from_1_90015": "Fügen Sie \"{0}\" zur vorhandenen Importdeklaration aus \"{1}\" hinzu.", - "Add_index_signature_for_property_0_90017": "Indexsignatur für die Eigenschaft \"{0}\" hinzufügen.", - "Add_missing_super_call_90001": "Fügen Sie den fehlenden super()-Aufruf hinzu.", - "Add_this_to_unresolved_variable_90008": "Der nicht aufgelösten Variablen \"this.\" hinzufügen.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Das Hinzufügen einer \"tsconfig.json\"-Datei erleichtert die Organisation von Projekten, die sowohl TypeScript- als auch JavaScript-Dateien enthalten. Weitere Informationen finden Sie unter https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "\"{0}\" der vorhandenen Importdeklaration aus \"{1}\" hinzufügen", + "Add_async_modifier_to_containing_function_90029": "Async-Modifizierer zur enthaltenden Funktion hinzufügen", + "Add_index_signature_for_property_0_90017": "Indexsignatur für die Eigenschaft \"{0}\" hinzufügen", + "Add_missing_super_call_90001": "Fehlenden super()-Aufruf hinzufügen", + "Add_this_to_unresolved_variable_90008": "Der nicht aufgelösten Variablen \"this.\" hinzufügen", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Das Hinzufügen einer \"tsconfig.json\"-Datei erleichtert die Organisation von Projekten, die sowohl TypeScript- als auch JavaScript-Dateien enthalten. Weitere Informationen finden Sie unter https://aka.ms/tsconfig.", "Additional_Checks_6176": "Zusätzliche Überprüfungen", "Advanced_Options_6178": "Erweiterte Optionen", "All_declarations_of_0_must_have_identical_modifiers_2687": "Alle Deklarationen von \"{0}\" müssen identische Modifizierer aufweisen.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Ein Indexsignaturparameter darf keinen Zugriffsmodifizierer besitzen.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Ein Indexsignaturparameter darf keinen Initialisierer besitzen.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "Ein Indexsignaturparameter muss eine Typanmerkung besitzen.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Ein Indexsignaturparametertyp darf kein Typalias sein. Erwägen Sie stattdessen die Schreibung \"[{0}: {1}]: {2}\".", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Ein Indexsignaturparametertyp darf kein Union-Typ sein. Erwägen Sie stattdessen die Verwendung eines zugeordneten Objekttyps.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Ein Indexsignaturparameter-Typ muss \"string\" oder \"number\" sein.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Eine Schnittstelle kann nur einen Bezeichner/\"qualified-name\" mit optionalen Typargumenten erweitern.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Eine Schnittstelle kann nur eine Klasse oder eine andere Schnittstelle erweitern.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "Es wurde eine Binärzahl erwartet.", "Binding_element_0_implicitly_has_an_1_type_7031": "Das Bindungselement \"{0}\" weist implizit einen Typ \"{1}\" auf.", "Block_scoped_variable_0_used_before_its_declaration_2448": "Die blockbezogene Variable \"{0}\" wurde vor ihrer Deklaration verwendet.", - "Call_decorator_expression_90028": "Rufen Sie den Decoratorausdruck auf.", + "Call_decorator_expression_90028": "Decorator-Ausdruck aufrufen", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Eine Aufrufsignatur ohne Rückgabetypanmerkung weist implizit einen any-Rückgabetyp auf.", "Call_target_does_not_contain_any_signatures_2346": "Das Aufrufziel enthält keine Signaturen.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Der Zugriff auf \"{0}.{1}\" ist nicht möglich, da \"{0}\" ein Typ ist, aber kein Namespace. Wollten Sie den Typ der Eigenschaft \"{1}\" in \"{0}\" mit \"{0}[\"{1}\"]\" abrufen?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Typdeklarationsdateien können nicht importiert werden. Importieren Sie ggf. \"{0}\" anstelle von \"{1}\".", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Die Variable \"{0}\" mit dem äußeren Bereich im gleichen Bereich wie die Deklaration \"{1}\" mit dem Blockbereich kann nicht initialisiert werden.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Ein Ausdruck, dessen Typ eine Aufrufsignatur fehlt, kann nicht aufgerufen werden. Der Typ \"{0}\" weist keine kompatiblen Aufrufsignaturen auf.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Ein Objekt, das möglicherweise NULL ist, kann nicht aufgerufen werden.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Ein Objekt, das möglicherweise NULL oder nicht definiert ist, kann nicht aufgerufen werden.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Ein Objekt, das möglicherweise nicht definiert ist, kann nicht aufgerufen werden.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "Ein Typ kann nicht erneut exportiert werden, wenn das Flag \"--isolatedModules\" angegeben ist.", "Cannot_read_file_0_Colon_1_5012": "Die Datei \"{0}\" kann nicht gelesen werden: {1}", "Cannot_redeclare_block_scoped_variable_0_2451": "Die blockbezogene Variable \"{0}\" Blockbereich kann nicht erneut deklariert werden.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Die Datei \"{0}\" kann nicht geschrieben werden, da sie eine Eingabedatei überschreiben würde.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Die Variable der Catch-Klausel darf keine Typanmerkung aufweisen.", "Catch_clause_variable_cannot_have_an_initializer_1197": "Die Variable der Catch-Klausel darf keinen Initialisierer aufweisen.", - "Change_0_to_1_90014": "Ändern Sie \"{0}\" in \"{1}\".", + "Change_0_to_1_90014": "\"{0}\" in \"{1}\" ändern", "Change_extends_to_implements_90003": "\"extends\" in \"implements\" ändern", - "Change_spelling_to_0_90022": "Ändern Sie die Schreibweise in \"{0}\".", + "Change_spelling_to_0_90022": "Schreibweise in \"{0}\" ändern", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Es wird überprüft, ob \"{0}\" das längste übereinstimmende Präfix für \"{1}\"–\"{2}\" ist.", "Circular_definition_of_import_alias_0_2303": "Zirkuläre Definition des Importalias \"{0}\".", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "Eine Zirkularität wurde beim Auflösen der Konfiguration erkannt: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "Die Klasse \"{0}\" definiert die Instanzmemberfunktion \"{1}\", die erweiterte Klasse \"{2}\" definiert diese jedoch als Membereigenschaft.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "Die Klasse \"{0}\" definiert die Instanzmembereigenschaft \"{1}\", die erweiterte Klasse \"{2}\" definiert diese jedoch als Instanzmemberfunktion.", "Class_0_incorrectly_extends_base_class_1_2415": "Die Klasse \"{0}\" erweitert fälschlicherweise die Basisklasse \"{1}\".", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "Die Klasse \"{0}\" implementiert fälschlicherweise die Klasse \"{1}\". Wollten Sie \"{1}\" erweitern und ihre Member als Unterklasse vererben?", "Class_0_incorrectly_implements_interface_1_2420": "Die Klasse \"{0}\" implementiert fälschlicherweise die Schnittstelle \"{1}\".", "Class_0_used_before_its_declaration_2449": "Klasse \"{0}\", die vor der Deklaration verwendet wurde.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Klassendeklarationen dürfen maximal ein \"@augments\"- oder \"@extends\"-Tag aufweisen.", @@ -234,7 +243,7 @@ "Compiler_option_0_expects_an_argument_6044": "Die Compileroption \"{0}\" erwartet ein Argument.", "Compiler_option_0_requires_a_value_of_type_1_5024": "Die Compileroption \"{0}\" erfordert einen Wert vom Typ \"{1}\".", "Computed_property_names_are_not_allowed_in_enums_1164": "Berechnete Eigenschaftennamen sind in Enumerationen unzulässig.", - "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": "Berechnete Werte sind in einer Aufzählung mit Membern mit Zeichenfolgenwerten nicht zulässig.", + "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": "Berechnete Werte sind in einer Enumeration mit Membern mit Zeichenfolgenwerten nicht zulässig.", "Concatenate_and_emit_output_to_single_file_6001": "Verketten und Ausgabe in einer Datei speichern.", "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090": "In Konflikt stehende Definitionen für \"{0}\" wurden unter \"{1}\" und \"{2}\" gefunden. Installieren Sie ggf. eine bestimmte Version dieser Bibliothek, um den Konflikt aufzulösen.", "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013": "Eine Konstruktsignatur ohne Rückgabetypanmerkung weist implizit einen any-Rückgabetyp auf.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Die enthaltene Datei wird nicht angegeben, und das Stammverzeichnis kann nicht ermittelt werden. Die Suche im Ordner \"node_modules\" wird übersprungen.", "Convert_function_0_to_class_95002": "Funktion \"{0}\" in Klasse konvertieren", "Convert_function_to_an_ES2015_class_95001": "Funktion in eine ES2015-Klasse konvertieren", + "Convert_to_ES6_module_95017": "In ES6-Modul konvertieren", "Convert_to_default_import_95013": "In Standardimport konvertieren", "Corrupted_locale_file_0_6051": "Die Gebietsschemadatei \"{0}\" ist beschädigt.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Es wurde keine Deklarationsdatei für das Modul \"{0}\" gefunden. \"{1}\" weist implizit den Typ \"any\" auf.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Es wurde eine Deklaration erwartet.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Der Deklarationsname steht in Konflikt mit dem integrierten globalen Bezeichner \"{0}\".", "Declaration_or_statement_expected_1128": "Es wurde eine Deklaration oder Anweisung erwartet.", - "Declare_method_0_90023": "Methode \"{0}\" deklarieren.", - "Declare_property_0_90016": "Eigenschaft \"{0}\" deklarieren.", - "Declare_static_method_0_90024": "Statische Methode \"{0}\" deklarieren.", - "Declare_static_property_0_90027": "Deklarieren Sie die statische Eigenschaft \"{0}\".", + "Declare_method_0_90023": "Methode \"{0}\" deklarieren", + "Declare_property_0_90016": "Eigenschaft \"{0}\" deklarieren", + "Declare_static_method_0_90024": "Statische Methode \"{0}\" deklarieren", + "Declare_static_property_0_90027": "Statische Eigenschaft \"{0}\" deklarieren", "Decorators_are_not_valid_here_1206": "Decorators sind hier ungültig.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Decorators dürfen nicht auf mehrere get-/set-Zugriffsmethoden mit dem gleichen Namen angewendet werden.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Der Standardexport des Moduls besitzt oder verwendet den privaten Namen \"{0}\".", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Veraltet] Verwenden Sie stattdessen \"--skipLibCheck\". Überspringen Sie die Typüberprüfung der Standardbibliothek-Deklarationsdateien.", "Digit_expected_1124": "Eine Ziffer wurde erwartet.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Das Verzeichnis \"{0}\" ist nicht vorhanden, Suchvorgänge darin werden übersprungen.", - "Disable_checking_for_this_file_90018": "Überprüfung für diese Datei deaktivieren.", + "Disable_checking_for_this_file_90018": "Überprüfung für diese Datei deaktivieren", "Disable_size_limitations_on_JavaScript_projects_6162": "Größenbeschränkungen für JavaScript-Projekte deaktivieren.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Deaktivieren Sie die strenge Überprüfung generischer Signaturen in Funktionstypen.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "Verweise mit uneinheitlicher Groß-/Kleinschreibung auf die gleiche Datei nicht zulassen.", @@ -309,6 +319,7 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "Aktivieren Sie die strenge Überprüfung der Eigenschafteninitialisierung in Klassen.", "Enable_strict_null_checks_6113": "Strenge NULL-Überprüfungen aktivieren.", "Enable_tracing_of_the_name_resolution_process_6085": "Ablaufverfolgung des Namensauflösungsvorgangs aktivieren.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Ermöglicht Ausgabeinteroperabilität zwischen CommonJS- und ES-Modulen durch die Erstellung von Namespaceobjekten für alle Importe. Impliziert \"AllowSyntheticDefaultImports\".", "Enables_experimental_support_for_ES7_async_functions_6068": "Ermöglicht experimentelle Unterstützung für asynchrone ES7-Funktionen.", "Enables_experimental_support_for_ES7_decorators_6065": "Ermöglicht experimentelle Unterstützung für asynchrone ES7-Decorators.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Ermöglicht experimentelle Unterstützung zum Ausgeben von Typmetadaten für Decorators.", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "Der Ausdruck wird in die Variablendeklaration \"_this\" aufgelöst, die der Compiler verwendet, um den this-Verweis zu erfassen.", "Extract_constant_95006": "Konstante extrahieren", "Extract_function_95005": "Funktion extrahieren", - "Extract_symbol_95003": "Symbol extrahieren", "Extract_to_0_in_1_95004": "Als {0} nach {1} extrahieren", "Extract_to_0_in_1_scope_95008": "Als {0} in {1}-Bereich extrahieren", "Extract_to_0_in_enclosing_scope_95007": "Als {0} in einschließenden Bereich extrahieren", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "Der Dateiname \"{0}\" unterscheidet sich vom bereits enthaltenen Dateinamen \"{1}\" nur hinsichtlich der Groß-/Kleinschreibung.", "File_name_0_has_a_1_extension_stripping_it_6132": "Der Dateiname \"{0}\" weist eine Erweiterung \"{1}\" auf. Diese wird entfernt.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "Die Dateispezifikation darf kein übergeordnetes Verzeichnis (\"..\") enthalten, das nach einem rekursiven Verzeichnisplatzhalter (\"**\") angegeben wird: \"{0}\".", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "Die Dateispezifikation darf nicht mehrere rekursive Verzeichnisplatzhalter enthalten (\"**\"): \"{0}\".", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "Die Dateispezifikation darf nicht mit einem rekursiven Verzeichnisplatzhalter (\"**\") enden: \"{0}\".", "Found_package_json_at_0_6099": "\"package.json\" wurde unter \"{0}\" gefunden.", + "Found_package_json_at_0_Package_ID_is_1_6190": "\"Package.json\" unter \"{0}\" gefunden. Paket-ID: \"{1}\".", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Funktionsdeklarationen sind in Blöcken im Strict-Modus unzulässig, wenn das Ziel \"ES3\" oder \"ES5\" ist.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Funktionsdeklarationen sind in Blöcken im Strict-Modus unzulässig, wenn das Ziel \"ES3\" oder \"ES5\" ist. Klassendefinitionen befinden sich automatisch im Strict-Modus.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Funktionsdeklarationen sind in Blöcken im Strict-Modus unzulässig, wenn das Ziel \"ES3\" oder \"ES5\" ist. Module befinden sich automatisch im Strict-Modus.", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "Es wurde ein Bezeichner erwartet. \"{0}\" ist ein reserviertes Wort im Strict-Modus. Module befinden sich automatisch im Strict-Modus.", "Identifier_expected_1003": "Es wurde ein Bezeichner erwartet.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Bezeichner erwartet. \"__esModule\" ist als exportierter Marker für die Umwandlung von ECMAScript-Modulen reserviert.", - "Ignore_this_error_message_90019": "Diese Fehlermeldung ignorieren.", + "Ignore_this_error_message_90019": "Diese Fehlermeldung ignorieren", "Implement_inherited_abstract_class_90007": "Geerbte abstrakte Klasse implementieren", "Implement_interface_0_90006": "Schnittstelle \"{0}\" implementieren", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "Die implements-Klausel der exportierten Klasse \"{0}\" besitzt oder verwendet den privaten Namen \"{1}\".", - "Import_0_from_module_1_90013": "Import von \"{0}\" aus Modul \"{1}\".", + "Import_0_from_module_1_90013": "\"{0}\" aus dem Modul \"{1}\" importieren", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Die Importzuweisung kann nicht verwendet werden, wenn das Ziel ECMAScript-Module sind. Verwenden Sie stattdessen ggf. \"import * as ns from 'mod'\", \"import {a} from 'mod'\", \"import d from 'mod'\" oder ein anderes Modulformat.", "Import_declaration_0_is_using_private_name_1_4000": "Die Importdeklaration \"{0}\" verwendet den privaten Namen \"{1}\".", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "Die Importdeklaration verursacht einen Konflikt mit der lokalen Deklaration von \"{0}\".", @@ -424,10 +434,10 @@ "Index_signature_is_missing_in_type_0_2329": "Die Indexsignatur fehlt im Typ \"{0}\".", "Index_signatures_are_incompatible_2330": "Die Indexsignaturen sind nicht kompatibel.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Einzelne Deklarationen in der gemergten Deklaration \"{0}\" müssen alle exportiert oder alle lokal sein.", - "Infer_parameter_types_from_usage_95012": "Leiten Sie Parametertypen aus der Nutzung ab.", - "Infer_type_of_0_from_usage_95011": "Leiten Sie den Typ von \"{0}\" aus der Nutzung ab.", - "Initialize_property_0_in_the_constructor_90020": "Eigenschaft '{0}' im Konstruktor initialisieren.", - "Initialize_static_property_0_90021": "Statische Eigenschaft '{0}' initialisieren.", + "Infer_parameter_types_from_usage_95012": "Parametertypen aus der Nutzung ableiten", + "Infer_type_of_0_from_usage_95011": "Typ von \"{0}\" aus der Nutzung ableiten", + "Initialize_property_0_in_the_constructor_90020": "Eigenschaft \"{0}\" im Konstruktor initialisieren", + "Initialize_static_property_0_90021": "Statische Eigenschaft \"{0}\" initialisieren", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "Der Initialisierer der Instanzmembervariablen \"{0}\" darf nicht auf den im Konstruktor deklarierten Bezeichner \"{1}\" verweisen.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "Der Initialisierer des Parameters \"{0}\" darf nicht auf den anschließend deklarierten Bezeichner \"{1}\" verweisen.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "Der Initialisierer stellt keinen Wert für dieses Bindungselement bereit, und das Bindungselement besitzt keinen Standardwert.", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "Für das Gebietsschema ist das Format oder - erforderlich, z. B. \"{0}\" oder \"{1}\".", "Longest_matching_prefix_for_0_is_1_6108": "Das längste übereinstimmende Präfix für \"{0}\" ist \"{1}\".", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Die Suche erfolgt im Ordner \"node_modules\". Anfangsspeicherort \"{0}\".", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Legen Sie den super()-Aufruf als erste Anweisung im Konstruktor fest.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "super()-Aufruf als erste Anweisung im Konstruktor festlegen", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "Der zugeordnete Objekttyp weist implizit einen any-Vorlagentyp auf.", "Member_0_implicitly_has_an_1_type_7008": "Der Member \"{0}\" weist implizit den Typ \"{1}\" auf.", "Merge_conflict_marker_encountered_1185": "Mergekonfliktmarkierung", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "Die gemergte Deklaration \"{0}\" darf keine Exportstandarddeklaration enthalten. Fügen Sie ggf. eine separate Deklaration \"export default {0}\" hinzu.", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== Der Modulname \"{0}\" wurde erfolgreich in \"{1}\" aufgelöst. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Die Art der Modulauflösung wird nicht angegeben. \"{0}\" wird verwendet.", "Module_resolution_using_rootDirs_has_failed_6111": "Fehler bei der Modulauflösung mithilfe von \"rootDirs\".", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Mehrere aufeinander folgende numerische Trennzeichen sind nicht zulässig.", "Multiple_constructor_implementations_are_not_allowed_2392": "Mehrere Konstruktorimplementierungen sind unzulässig.", "NEWLINE_6061": "NEUE ZEILE", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "Die benannte Eigenschaft \"{0}\" der Typen \"{1}\" und \"{2}\" ist nicht identisch.", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Der nicht abstrakte Ausdruck implementiert nicht den geerbten abstrakten Member \"{0}\" aus der Klasse \"{1}\".", "Not_all_code_paths_return_a_value_7030": "Nicht alle Codepfade geben einen Wert zurück.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Der numerische Indextyp \"{0}\" kann dem Zeichenfolgen-Indextyp \"{1}\" nicht zugewiesen werden.", + "Numeric_separators_are_not_allowed_here_6188": "Numerische Trennzeichen sind hier nicht zulässig.", "Object_is_possibly_null_2531": "Das Objekt ist möglicherweise \"NULL\".", "Object_is_possibly_null_or_undefined_2533": "Das Objekt ist möglicherweise \"NULL\" oder \"nicht definiert\".", "Object_is_possibly_undefined_2532": "Das Objekt ist möglicherweise \"nicht definiert\".", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "Nur eine void-Funktion kann mit dem Schlüsselwort \"new\" aufgerufen werden.", "Only_ambient_modules_can_use_quoted_names_1035": "Nur Umgebungsmodule dürfen Namen in Anführungszeichen verwenden.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Nur die Module \"amd\" und \"system\" werden in Verbindung mit --{0} unterstützt.", + "Only_emit_d_ts_declaration_files_6014": "Geben Sie nur .d.ts-Deklarationsdateien aus.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Derzeit werden nur Bezeichner/qualifizierte Namen mit optionalen Typargumenten in den \"extends\"-Klauseln einer Klasse unterstützt.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Nur auf öffentliche und geschützte Methoden der Basisklasse kann über das Schlüsselwort \"super\" zugegriffen werden.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Der Operator \"{0}\" darf nicht auf die Typen \"{1}\" und \"{2}\" angewendet werden.", @@ -584,7 +598,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Der Parametertyp des öffentlichen statischen Setters \"{0}\" aus der exportierten Klasse besitzt oder verwendet den privaten Namen \"{1}\".", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Im Strict-Modus analysieren und \"use strict\" für jede Quelldatei ausgeben.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Das Muster \"{0}\" darf höchstens ein Zeichen \"*\" aufweisen.", - "Prefix_0_with_an_underscore_90025": "Präfix \"{0}\" mit einem Unterstrich.", + "Prefix_0_with_an_underscore_90025": "\"{0}\" einen Unterstrich voranstellen", "Print_names_of_files_part_of_the_compilation_6155": "Drucknamen des Dateiteils der Kompilierung.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Drucknamen des generierten Dateiteils der Kompilierung.", "Print_the_compiler_s_version_6019": "Die Version des Compilers ausgeben.", @@ -596,6 +610,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Die Eigenschaft \"{0}\" weist keinen Initialisierer auf und ist im Konstruktor nicht definitiv zugewiesen.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Die Eigenschaft \"{0}\" weist implizit den Typ \"any\" auf, weil ihrem get-Accessor eine Parametertypanmerkung fehlt.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Die Eigenschaft \"{0}\" weist implizit den Typ \"any\" auf, weil ihrem set-Accessor eine Parametertypanmerkung fehlt.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Die Eigenschaft \"{0}\" im Typ \"{1}\" kann nicht der gleichen Eigenschaft in Basistyp \"{2}\" zugewiesen werden.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "Die Eigenschaft \"{0}\" im Typ \"{1}\" kann dem Typ \"{2}\" nicht zugewiesen werden.", "Property_0_is_declared_but_its_value_is_never_read_6138": "Die Eigenschaft \"{0}\" ist deklariert, aber ihr Wert wird nie gelesen.", "Property_0_is_incompatible_with_index_signature_2530": "Die Eigenschaft \"{0}\" ist nicht mit der Indexsignatur kompatibel.", @@ -635,6 +650,7 @@ "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Fehler für \"this\"-Ausdrücke mit einem impliziten any-Typ auslösen.", "Redirect_output_structure_to_the_directory_6006": "Die Ausgabestruktur in das Verzeichnis umleiten.", "Remove_declaration_for_Colon_0_90004": "Deklaration entfernen für: {0}", + "Replace_import_with_0_95015": "Ersetzen Sie den Import durch \"{0}\".", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Fehler melden, wenn nicht alle Codepfade in der Funktion einen Wert zurückgeben.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Für FallTrough-Fälle in switch-Anweisung Fehler melden.", "Report_errors_in_js_files_8019": "Fehler in .js-Dateien melden.", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "Der Rückgabetyp der öffentlichen statischen Methode aus der exportierten Klasse besitzt oder verwendet den privaten Namen \"{0}\".", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Modulauflösungen aus \"{0}\" werden wiederverwendet, da Auflösungen aus dem alten Programm nicht geändert wurden.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Die Auflösung des Moduls \"{0}\" in die Datei \"{1}\" aus dem alten Programm wird wiederverwendet.", - "Rewrite_as_the_indexed_access_type_0_90026": "Als indizierten Zugriffstyp \"{0}\" neu schreiben.", + "Rewrite_as_the_indexed_access_type_0_90026": "Als indizierten Zugriffstyp \"{0}\" neu schreiben", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Das Stammverzeichnis kann nicht ermittelt werden. Die primären Suchpfade werden übersprungen.", "STRATEGY_6039": "STRATEGIE", "Scoped_package_detected_looking_in_0_6182": "Bereichsbezogenes Paket erkannt. In \"{0}\" wird gesucht", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "Quellzuordnungsoptionen", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Eine spezialisierte Überladungssignatur kann keiner nicht spezialisierten Signatur zugewiesen werden.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Der Spezifizierer des dynamischen Imports darf kein Spread-Element sein.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "ECMAScript-Zielversion angeben: ES3 (Standard), ES5, ES2015, ES2016, ES2017 oder ESNEXT.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "ECMAScript-Zielversion angeben: ES3 (Standard), ES5, ES2015, ES2016, ES2017, ES2018 oder ESNEXT.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "JSX-Codegenerierung angeben: \"preserve\", \"react-native\" oder \"react\".", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Geben Sie Bibliotheksdateien an, die in die Kompilierung eingeschlossen werden sollen: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Geben Sie Bibliotheksdateien an, die in die Kompilierung eingeschlossen werden sollen.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Geben Sie die Codegenerierung für das Modul an: \"none\", \"commonjs\", \"amd\", \"system\", \"umd\", \"es2015\" oder \"ESNext\".", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Geben Sie die Modulauflösungsstrategie an: \"node\" (Node.js) oder \"classic\" (TypeScript vor Version 1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Geben Sie die JSX-Factoryfunktion an, die für eine react-JSX-Ausgabe verwendet werden soll, z. B. \"React.createElement\" oder \"h\".", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Geben Sie das Stammverzeichnis der Eingabedateien an. Verwenden Sie diese Angabe, um die Ausgabeverzeichnisstruktur mithilfe von \"-outDir\" zu steuern.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "Der Verteilungsoperator in new-Ausdrücken ist nur verfügbar, wenn das Ziel ECMAScript 5 oder höher ist.", "Spread_types_may_only_be_created_from_object_types_2698": "Spread-Typen dürfen nur aus object-Typen erstellt werden.", + "Starting_compilation_in_watch_mode_6031": "Kompilierung im Überwachungsmodus wird gestartet...", "Statement_expected_1129": "Eine Anweisung wurde erwartet.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Anweisungen sind in Umgebungskontexten unzulässig.", "Static_members_cannot_reference_class_type_parameters_2302": "Statische Member dürfen nicht auf Klassentypparameter verweisen.", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "Ein Zeichenfolgenliteral wurde erwartet.", "String_literal_with_double_quotes_expected_1327": "Ein Zeichenfolgenliteral mit doppelten Anführungszeichen wird erwartet.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Fehler und Nachrichten farbig und mit Kontext formatieren (experimentell).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Nachfolgende Eigenschaftendeklarationen müssen den gleichen Typ aufweisen. Die Eigenschaft \"{0}\" muss den Typ \"{1}\" aufweisen, ist hier aber vom Typ \"{2}\".", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Nachfolgende Variablendeklarationen müssen den gleichen Typ aufweisen. Die Variable \"{0}\" muss den Typ \"{1}\" aufweisen, ist hier aber vom Typ \"{2}\".", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "Die Ersetzung \"{0}\" für das Muster \"{1}\" weist einen falschen Typ auf. Erwartet wurde \"string\", abgerufen wurde \"{2}\".", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "Die Ersetzung \"{0}\" im Muster \"{1}\" darf höchstens ein Zeichen \"*\" aufweisen.", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Typ \"{0}\" ist kein Array-Typ oder Zeichenfolgentyp oder weist keine \"[Symbol.iterator]()\"-Methode auf, die einen Iterator zurückgibt.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Typ \"{0}\" ist kein Array-Typ oder weist keine \"[Symbol.iterator]()\"-Methode auf, die einen Iterator zurückgibt.", "Type_0_is_not_assignable_to_type_1_2322": "Der Typ \"{0}\" kann dem Typ \"{1}\" nicht zugewiesen werden.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "Typ \"{0}\" kann nicht zu Typ \"{1}\" zugewiesen werden. Es sind zwei verschiedene Typen mit diesem Namen vorhanden, diese sind jedoch nicht verwandt.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "Der Typ \"{0}\" kann dem Typ \"{1}\" nicht zugewiesen werden. Es sind zwei verschiedene Typen mit diesem Namen vorhanden, diese sind jedoch nicht verwandt.", "Type_0_is_not_comparable_to_type_1_2678": "Der Typ \"{0}\" kann nicht mit dem Typ \"{1}\" verglichen werden.", "Type_0_is_not_generic_2315": "Der Typ \"{0}\" ist nicht generisch.", "Type_0_provides_no_match_for_the_signature_1_2658": "Der Typ \"{0}\" enthält keine Entsprechung für die Signatur \"{1}\".", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "Nicht abgeschlossenes Vorlagenliteral.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Nicht typisierte Funktionsaufrufe dürfen keine Typargumente annehmen.", "Unused_label_7028": "Nicht verwendete Bezeichnung.", + "Use_synthetic_default_member_95016": "Verwenden Sie den synthetischen Member \"default\".", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Das Verwenden einer Zeichenfolge in einer for...of-Anweisung wird nur in ECMAScript 5 oder höher unterstützt.", "VERSION_6036": "VERSION", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "Der Wert des Typs \"{0}\" verfügt über keine gemeinsamen Eigenschaften mit dem Typ \"{1}\". Wollten Sie ihn aufrufen?", @@ -915,7 +933,7 @@ "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "Der const-Enumerationsmemberinitialisierer wurde in den unzulässigen Wert \"NaN\" ausgewertet.", "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "const-Enumerationen können nur in Eigenschaften- bzw. Indexzugriffsausdrücken oder auf der rechten Seite einer Importdeklaration oder Exportzuweisung verwendet werden.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "\"delete\" kann für einen Bezeichner im Strict-Modus nicht aufgerufen werden.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "\"enum declarations\" kann nur in einer TS-Datei verwendet werden.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "enum-Deklarationen können nur in einer TS-Datei verwendet werden.", "export_can_only_be_used_in_a_ts_file_8003": "\"export=\" kann nur in einer TS-Datei verwendet werden.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Der Modifizierer \"export\" kann nicht auf Umgebungsmodule und Modulerweiterungen angewendet werden, da diese immer sichtbar sind.", "extends_clause_already_seen_1172": "Die extends-Klausel ist bereits vorhanden.", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "Die implements-Klausel ist bereits vorhanden.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "\"implements clauses\" kann nur in einer TS-Datei verwendet werden.", "import_can_only_be_used_in_a_ts_file_8002": "\"import... =\" kann nur in einer TS-Datei verwendet werden.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "infer-Deklarationen sind nur in der extends-Klausel eines bedingten Typs zulässig.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "\"interface declarations\" kann nur in einer TS-Datei verwendet werden.", "let_declarations_can_only_be_declared_inside_a_block_1157": "let-Deklarationen können nur innerhalb eines Blocks deklariert werden.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "\"let\" darf nicht als Name in let- oder const-Deklarationen verwendet werden.", diff --git a/lib/enu/diagnosticMessages.generated.json.lcg b/lib/enu/diagnosticMessages.generated.json.lcg index 1cc79da6203..a7d77e9ac02 100644 --- a/lib/enu/diagnosticMessages.generated.json.lcg +++ b/lib/enu/diagnosticMessages.generated.json.lcg @@ -303,6 +303,12 @@ + + + + + + @@ -363,6 +369,12 @@ + + + + + + @@ -567,6 +579,12 @@ + + + + + + @@ -831,6 +849,18 @@ + + + + + + + + + + + + @@ -1191,6 +1221,24 @@ + + + + + + + + + + + + + + + + + + @@ -1341,6 +1389,12 @@ + + + + + + @@ -1485,6 +1539,12 @@ + + + + + + @@ -1869,6 +1929,12 @@ + + + + + + @@ -1893,6 +1959,12 @@ + + + + + + @@ -2127,12 +2199,6 @@ - - - - - - @@ -2241,12 +2307,6 @@ - - - - - - @@ -2259,6 +2319,12 @@ + + + + + + @@ -2925,6 +2991,12 @@ + + + + + + @@ -3063,6 +3135,12 @@ + + + + + + @@ -3123,6 +3201,12 @@ + + + + + + @@ -3219,6 +3303,12 @@ + + + + + + @@ -3591,6 +3681,12 @@ + + + + + + @@ -3825,6 +3921,12 @@ + + + + + + @@ -4185,9 +4287,9 @@ - + - + @@ -4245,6 +4347,12 @@ + + + + + + @@ -5163,6 +5271,12 @@ + + + + + + @@ -5495,7 +5609,7 @@ - + @@ -5583,6 +5697,12 @@ + + + + + + diff --git a/lib/es/diagnosticMessages.generated.json b/lib/es/diagnosticMessages.generated.json index 8f120671277..b44d3a14769 100644 --- a/lib/es/diagnosticMessages.generated.json +++ b/lib/es/diagnosticMessages.generated.json @@ -42,22 +42,24 @@ "A_generator_cannot_have_a_void_type_annotation_2505": "Un generador no puede tener una anotación de tipo \"void\".", "A_get_accessor_cannot_have_parameters_1054": "Un descriptor de acceso \"get\" no puede tener parámetros.", "A_get_accessor_must_return_a_value_2378": "Un descriptor de acceso \"get\" debe devolver un valor.", - "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "Un inicializador de miembro de una declaración enum no puede hacer referencia a los miembros que se declaran después de este, incluidos aquellos definidos en otras enumeraciones.", - "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": "Una clase mixin debe tener un constructor con un parámetro de REST sencillo del tipo \"any[]\".", + "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "Un inicializador de miembro de una declaración de enumeración no puede hacer referencia a los miembros que se declaran después de este, incluidos aquellos definidos en otras enumeraciones.", + "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": "Una clase mixin debe tener un constructor con un solo parámetro rest de tipo \"any[]\"", "A_module_cannot_have_multiple_default_exports_2528": "Un módulo no puede tener varias exportaciones predeterminadas.", "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Una declaración de espacio de nombres no puede estar en un archivo distinto de una clase o función con la que se combina.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Una declaración de espacio de nombres no se puede situar antes que una clase o función con la que se combina.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Una declaración de espacio de nombres solo se permite en un espacio de nombres o en un módulo.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "No se puede llamar o construir una importación de estilo de espacio de nombres, y provocará un error en tiempo de ejecución.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un inicializador de parámetros solo se permite en una implementación de función o de constructor.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Una propiedad de parámetro no se puede declarar mediante un parámetro rest.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Una propiedad de parámetro solo se permite en una implementación de constructor.", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "Una propiedad de parámetro podría no declararse mediante un patrón de enlace.", - "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "Una ruta de acceso en una opción \"extiende\" debe ser relativa o raíz, pero no '{0}'.", + "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "Una ruta de acceso en una opción \"extiende\" debe ser relativa o raíz, pero no \"{0}\".", "A_promise_must_have_a_then_method_1059": "Una promesa debe tener un método \"then\".", "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Una propiedad de una clase cuyo tipo sea \"unique symbol\" debe ser \"static\" y \"readonly\".", "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Una propiedad de una interfaz o un literal de tipo cuyo tipo sea \"unique symbol\" debe ser \"readonly\".", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Un parámetro obligatorio no puede seguir a un parámetro opcional.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Un elemento rest no puede contener un patrón de enlace.", + "A_rest_element_cannot_have_a_property_name_2566": "Un elemento rest no puede tener un nombre de propiedad.", "A_rest_element_cannot_have_an_initializer_1186": "Un elemento rest no puede tener un inicializador.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Un elemento rest debe ser el último en un patrón de desestructuración.", "A_rest_parameter_cannot_be_optional_1047": "Un parámetro rest no puede ser opcional.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "El modificador de accesibilidad ya se ha visto.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Los descriptores de acceso solo están disponibles cuando el destino es ECMAScript 5 y versiones posteriores.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Los descriptores de acceso deben ser los dos abstractos o los dos no abstractos.", - "Add_0_to_existing_import_declaration_from_1_90015": "Agregue \"{0}\" a una declaración de importación existente desde \"{1}\".", - "Add_index_signature_for_property_0_90017": "Agregue una firma de índice para la propiedad \"{0}\".", - "Add_missing_super_call_90001": "Agregue la llamada a \"super()\" que falta.", - "Add_this_to_unresolved_variable_90008": "Agrega \"this.\" a una variable no resuelta.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Agregar un archivo tsconfig.json ayuda a organizar los proyectos que contienen archivos TypeScript y JavaScript. Más información en https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "Agregar \"{0}\" a una declaración de importación existente desde \"{1}\"", + "Add_async_modifier_to_containing_function_90029": "Agregar el modificador async a la función contenedora", + "Add_index_signature_for_property_0_90017": "Agregar una signatura de índice para la propiedad \"{0}\"", + "Add_missing_super_call_90001": "Agregar la llamada a \"super()\" que falta", + "Add_this_to_unresolved_variable_90008": "Agregar \"this.\" a una variable no resuelta", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Agregar un archivo tsconfig.json ayuda a organizar los proyectos que contienen archivos TypeScript y JavaScript. Más información en https://aka.ms/tsconfig.", "Additional_Checks_6176": "Comprobaciones adicionales", "Advanced_Options_6178": "Opciones avanzadas", "All_declarations_of_0_must_have_identical_modifiers_2687": "Todas las declaraciones de '{0}' deben tener modificadores idénticos.", @@ -111,7 +114,7 @@ "An_accessor_cannot_be_declared_in_an_ambient_context_1086": "Un descriptor de acceso no se puede declarar en un contexto de ambiente.", "An_accessor_cannot_have_type_parameters_1094": "Un descriptor de acceso no puede tener parámetros de tipo.", "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234": "Una declaración de módulo de ambiente solo se permite en el nivel superior de un archivo.", - "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Un operando aritmético debe ser de tipo \"any\", \"number\" o de tipo enum.", + "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Un operando aritmético debe ser de tipo \"any\", \"number\" o un tipo de enumeración.", "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705": "Una función o un método de asincronía en ES5/ES3 requiere el constructor \"Promise\". Asegúrese de que tiene una declaración para el constructor \"Promise\" o incluya \"ES2015\" en su opción \"--lib\".", "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057": "Una función o un método asincrónico deben tener un tipo de valor devuelto válido que admita await.", "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697": "Una función o un método asincrónicos deben devolver una \"promesa\". Asegúrese de que hay una declaración de \"promesa\" o incluya \"ES2015\" en la opción \"--lib\".", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Un parámetro de signatura de índice no puede tener un modificador de accesibilidad.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Un parámetro de signatura de índice no puede tener un inicializador.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "Un parámetro de signatura de índice debe tener una anotación de tipo.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Un tipo de parámetro de firma de índice no puede ser un alias de tipo. Considere la posibilidad de escribir en su lugar \"[{0}: {1}]: {2}\".", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Un tipo de parámetro de firma de índice no puede ser un tipo de unión. Considere la posibilidad de usar en su lugar un tipo de objeto asignado.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "El tipo de un parámetro de signatura de índice debe ser \"string\" o \"number\".", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Una interfaz solo puede extender un identificador o nombre completo con argumentos de tipo opcional.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Una interfaz solo puede extender una clase u otra interfaz.", @@ -150,8 +155,8 @@ "Annotate_with_type_from_JSDoc_95009": "Anotar con tipo de JSDoc", "Annotate_with_types_from_JSDoc_95010": "Anotar con tipos de JSDoc", "Argument_expression_expected_1135": "Se esperaba una expresión de argumento.", - "Argument_for_0_option_must_be_Colon_1_6046": "El argumento para la opción '{0}' debe ser: {1}.", - "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "No se puede asignar un argumento de tipo '{0}' al parámetro de tipo '{1}'.", + "Argument_for_0_option_must_be_Colon_1_6046": "El argumento para la opción \"{0}\" debe ser {1}.", + "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "No se puede asignar un argumento de tipo \"{0}\" al parámetro de tipo \"{1}\".", "Array_element_destructuring_pattern_expected_1181": "Se esperaba un patrón de desestructuración de elementos de matriz.", "Asterisk_Slash_expected_1010": "Se esperaba \"*/\".", "Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_2669": "Los aumentos del ámbito global solo pueden anidarse directamente en módulos externos o en declaraciones de módulos de ambiente.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "Se esperaba un dígito binario.", "Binding_element_0_implicitly_has_an_1_type_7031": "El elemento de enlace '{0}' tiene un tipo '{1}' implícito.", "Block_scoped_variable_0_used_before_its_declaration_2448": "Variable con ámbito de bloque '{0}' usada antes de su declaración.", - "Call_decorator_expression_90028": "Llame a la expresión decorador.", + "Call_decorator_expression_90028": "Llamar a la expresión decorador", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signatura de llamada, que carece de una anotación de tipo de valor devuelto, tiene implícitamente un tipo de valor devuelto \"any\".", "Call_target_does_not_contain_any_signatures_2346": "El destino de llamada no contiene signaturas.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "No se puede acceder a \"{0}.{1}\" porque \"{0}\" es un tipo, no un espacio de nombres. ¿Su intención era recuperar el tipo de la propiedad \"{1}\" en \"{0}\" con \"{0}[\"{1}\"]\"?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "No se pueden importar archivos de declaración de tipos. Considere importar \"{0}\" en lugar de \"{1}\".", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "No se puede inicializar la variable '{0}' de ámbito externo en el mismo ámbito que la declaración '{1}' con ámbito de bloque.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "No se puede invocar una expresión con un tipo sin signatura de llamada. El tipo '{0}' no tiene ninguna signatura de llamada compatible.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "No se puede invocar un objeto que es posiblemente \"null\".", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "No se puede invocar un objeto que es posiblemente \"null\" o \"no definido\".", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "No se puede invocar un objeto que es posiblemente \"no definido\".", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "No se puede volver a exportar un tipo si se proporciona la marca \"--isolatedModules\".", "Cannot_read_file_0_Colon_1_5012": "No se puede leer el archivo \"{0}\": {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "No se puede volver a declarar la variable con ámbito de bloque '{0}'.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "No se puede escribir en el archivo '{0}' porque sobrescribiría el archivo de entrada.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "La variable de la cláusula catch no puede tener una anotación de tipo.", "Catch_clause_variable_cannot_have_an_initializer_1197": "La variable de la cláusula catch no puede tener un inicializador.", - "Change_0_to_1_90014": "Cambie \"{0}\" a \"{1}\".", - "Change_extends_to_implements_90003": "Cambiar \"extends\" por \"implements\".", - "Change_spelling_to_0_90022": "Cambiar la ortografía a \"{0}\".", + "Change_0_to_1_90014": "Cambiar \"{0}\" a \"{1}\"", + "Change_extends_to_implements_90003": "Cambiar \"extends\" a \"implements\"", + "Change_spelling_to_0_90022": "Cambiar la ortografía a \"{0}\"", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Comprobando si '{0}' es el prefijo coincidente más largo para '{1}' - '{2}'.", "Circular_definition_of_import_alias_0_2303": "Definición circular del alias de importación '{0}'.", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "Se detectó circularidad al resolver la configuración: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "La clase '{0}' define la función miembro de instancia como '{1}', pero la clase extendida '{2}' la define como propiedad de miembro de instancia.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "La clase '{0}' define la propiedad de miembro de instancia como '{1}', pero la clase extendida '{2}' la define como función miembro de instancia.", "Class_0_incorrectly_extends_base_class_1_2415": "La clase '{0}' extiende la clase base '{1}' de forma incorrecta.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "La clase \"{0}\" no implementa correctamente la clase \"{1}\". ¿Pretendía extender \"{1}\" y heredar sus miembros como una subclase?", "Class_0_incorrectly_implements_interface_1_2420": "La clase '{0}' implementa la interfaz '{1}' de forma incorrecta.", "Class_0_used_before_its_declaration_2449": "Se ha usado la clase \"{0}\" antes de declararla.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Las declaraciones de clase no pueden tener más de una etiqueta \"@augments\" o \"@extends\".", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "El archivo contenedor no se ha especificado y no se puede determinar el directorio raíz. Se omitirá la búsqueda en la carpeta 'node_modules'.", "Convert_function_0_to_class_95002": "Convertir la función \"{0}\" en una clase", "Convert_function_to_an_ES2015_class_95001": "Convertir la función en una clase ES2015", + "Convert_to_ES6_module_95017": "Convertir en módulo ES6", "Convert_to_default_import_95013": "Convertir en importación predeterminada", "Corrupted_locale_file_0_6051": "Archivo de configuración regional {0} dañado.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "No se encontró ningún archivo de declaración para el módulo '{0}'. '{1}' tiene un tipo \"any\" de forma implícita.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Se esperaba una declaración.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Conflictos entre nombres de declaración con el identificador global '{0}' integrado.", "Declaration_or_statement_expected_1128": "Se esperaba una declaración o una instrucción.", - "Declare_method_0_90023": "Declare el método \"{0}\".", - "Declare_property_0_90016": "Declare la propiedad \"{0}\".", - "Declare_static_method_0_90024": "Declare el método estático \"{0}\".", - "Declare_static_property_0_90027": "Declare la propiedad \"{0}\" estática.", + "Declare_method_0_90023": "Declarar el método \"{0}\"", + "Declare_property_0_90016": "Declarar la propiedad \"{0}\"", + "Declare_static_method_0_90024": "Declarar el método estático \"{0}\"", + "Declare_static_property_0_90027": "Declarar la propiedad estática \"{0}\"", "Decorators_are_not_valid_here_1206": "Los elementos Decorator no son válidos aquí.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "No se pueden aplicar elementos Decorator a varios descriptores de acceso get o set con el mismo nombre.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "La exportación predeterminada del módulo tiene o usa el nombre privado '{0}'.", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[En desuso] Use \"--skipLibCheck\" en su lugar. Omite la comprobación de tipos de los archivos de declaración de biblioteca predeterminados.", "Digit_expected_1124": "Se esperaba un dígito.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "El directorio \"{0}\" no existe, se omitirán todas las búsquedas en él.", - "Disable_checking_for_this_file_90018": "Deshabilite la comprobación para este archivo.", + "Disable_checking_for_this_file_90018": "Deshabilitar la comprobación para este archivo", "Disable_size_limitations_on_JavaScript_projects_6162": "Deshabilitar los límites de tamaño de proyectos de JavaScript.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Deshabilite la comprobación estricta de firmas genéricas en tipos de función.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "No permitir referencias al mismo archivo con un uso incoherente de mayúsculas y minúsculas.", @@ -309,15 +319,16 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "Habilite la comprobación estricta de inicialización de propiedades en las clases.", "Enable_strict_null_checks_6113": "Habilitar comprobaciones estrictas de elementos nulos.", "Enable_tracing_of_the_name_resolution_process_6085": "Habilitar seguimiento del proceso de resolución de nombres.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Permite emitir interoperabilidad entre módulos CommonJS y ES mediante la creación de objetos de espacio de nombres para todas las importaciones. Implica \"allowSyntheticDefaultImports\".", "Enables_experimental_support_for_ES7_async_functions_6068": "Habilita la compatibilidad experimental con las funciones asincrónicas de ES7.", "Enables_experimental_support_for_ES7_decorators_6065": "Habilita la compatibilidad experimental con los elementos Decorator de ES7.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Habilita la compatibilidad experimental para emitir metadatos de tipo para los elementos Decorator.", "Enum_0_used_before_its_declaration_2450": "Se ha usado la enumeración \"{0}\" antes de declararla.", - "Enum_declarations_must_all_be_const_or_non_const_2473": "Todas las declaraciones enum deben ser de tipo const o no const.", + "Enum_declarations_must_all_be_const_or_non_const_2473": "Todas las declaraciones de enumeración deben ser de tipo const o no const.", "Enum_member_expected_1132": "Se esperaba un miembro de enumeración.", "Enum_member_must_have_initializer_1061": "El miembro de enumeración debe tener un inicializador.", "Enum_name_cannot_be_0_2431": "El nombre de la enumeración no puede ser \"{0}\".", - "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535": "Tipo enum '{0}' tiene miembros con inicializadores que no son literales.", + "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535": "El tipo de enumeración \"{0}\" tiene miembros con inicializadores que no son literales.", "Examples_Colon_0_6026": "Ejemplos: {0}", "Excessive_stack_depth_comparing_types_0_and_1_2321": "Profundidad excesiva de la pila al comparar los tipos '{0}' y '{1}'.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Se esperaban argumentos de tipo {0}-{1}; proporciónelos con una etiqueta \"@extends\".", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "La expresión se resuelve en la declaración de variable \"_this\" que el compilador usa para capturar una referencia \"this\".", "Extract_constant_95006": "Extraer la constante", "Extract_function_95005": "Extraer la función", - "Extract_symbol_95003": "Extraer el símbolo", "Extract_to_0_in_1_95004": "Extraer a {0} en {1}", "Extract_to_0_in_1_scope_95008": "Extraer a {0} en el ámbito {1}", "Extract_to_0_in_enclosing_scope_95007": "Extraer a {0} en el ámbito de inclusión", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "El nombre de archivo \"{0}\" es diferente del nombre de archivo \"{1}\" ya incluido solo en el uso de mayúsculas y minúsculas.", "File_name_0_has_a_1_extension_stripping_it_6132": "El nombre de archivo \"{0}\" tiene una extensión \"{1}\" y se va a quitar.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "La especificación del archivo no puede contener un directorio primario ('..') que aparezca después de un comodín de directorios recursivo ('**'): '{0}'.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "La especificación de archivo no puede contener varios comodines de directorio recursivo ('**'): '{0}'.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "La especificación de archivo no puede finalizar en un comodín de directorio recursivo ('**'): '{0}'.", "Found_package_json_at_0_6099": "Se encontró 'package.json' en '{0}'.", + "Found_package_json_at_0_Package_ID_is_1_6190": "Se encontró \"package.json\" en \"{0}\". El identificador de paquete es \"{1}\".", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "No se permiten declaraciones de función en bloques en modo strict cuando el destino es 'ES3' o 'ES5'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "No se permiten declaraciones de función en bloques en modo strict cuando el destino es 'ES3' o 'ES5'. Las definiciones de clase están en modo strict de forma automática.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "No se permiten declaraciones de función en bloques en modo strict cuando el destino es 'ES3' o 'ES5'. Los módulos están en modo strict de forma automática.", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "Se esperaba un identificador. '{0}' es una palabra reservada en modo strict. Los módulos están en modo strict automáticamente.", "Identifier_expected_1003": "Se esperaba un identificador.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Identificador esperado. \"__esModule\" está reservado como marcador exportado al transformar módulos ECMAScript.", - "Ignore_this_error_message_90019": "Ignore este mensaje de error.", - "Implement_inherited_abstract_class_90007": "Implementar clase abstracta heredada.", - "Implement_interface_0_90006": "Implementar interfaz \"{0}\".", + "Ignore_this_error_message_90019": "Ignorar este mensaje de error", + "Implement_inherited_abstract_class_90007": "Implementar clase abstracta heredada", + "Implement_interface_0_90006": "Implementar la interfaz \"{0}\"", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "La cláusula implements de la clase '{0}' exportada tiene o usa el nombre privado '{1}'.", - "Import_0_from_module_1_90013": "Importar \"{0}\" desde el módulo \"{1}\".", + "Import_0_from_module_1_90013": "Importar \"{0}\" desde el módulo \"{1}\"", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "No se puede usar una asignación de importación cuando se eligen módulos de ECMAScript como destino. Considere la posibilidad de usar \"import * as ns from 'mod'\", \"import {a} from 'mod'\", \"import d from 'mod'\" u otro formato de módulo en su lugar.", "Import_declaration_0_is_using_private_name_1_4000": "La declaración de importación '{0}' usa el nombre privado '{1}'.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "La declaración de importación está en conflicto con la declaración local de \"{0}\".", @@ -417,17 +427,17 @@ "Import_name_cannot_be_0_2438": "El nombre de importación no puede ser \"{0}\".", "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439": "La declaración de importación o exportación de una declaración de módulo de ambiente no puede hacer referencia al módulo a través de su nombre relativo.", "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667": "No se permiten importaciones en aumentos de módulos. Considere la posibilidad de moverlas al módulo externo envolvente.", - "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "En las declaraciones enum de ambiente, el inicializador de miembro debe ser una expresión constante.", + "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "En las declaraciones de enumeración de ambiente, el inicializador de miembro debe ser una expresión constante.", "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "En una enumeración con varias declaraciones, solo una declaración puede omitir un inicializador para el primer elemento de la enumeración.", "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "El inicializador de miembro de las declaraciones de enumeración \"const\" debe ser una expresión constante.", "Index_signature_in_type_0_only_permits_reading_2542": "La signatura de índice del tipo '{0}' solo permite lectura.", "Index_signature_is_missing_in_type_0_2329": "Falta la signatura de índice en el tipo '{0}'.", "Index_signatures_are_incompatible_2330": "Las signaturas de índice no son compatibles.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Las declaraciones individuales de la declaración '{0}' combinada deben ser todas exportadas o todas locales.", - "Infer_parameter_types_from_usage_95012": "Infiera los tipos de parámetro del uso.", - "Infer_type_of_0_from_usage_95011": "Infiera el tipo de \"{0}\" del uso.", - "Initialize_property_0_in_the_constructor_90020": "Inicialice la propiedad \"{0}\" en el constructor.", - "Initialize_static_property_0_90021": "Inicialice la propiedad estática \"{0}\".", + "Infer_parameter_types_from_usage_95012": "Deducir los tipos de parámetro del uso", + "Infer_type_of_0_from_usage_95011": "Deducir el tipo de \"{0}\" del uso", + "Initialize_property_0_in_the_constructor_90020": "Inicializar la propiedad \"{0}\" en el constructor", + "Initialize_static_property_0_90021": "Inicializar la propiedad estática \"{0}\"", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "El inicializador de la variable miembro de instancia '{0}' no puede hacer referencia al identificador '{1}' declarado en el constructor.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "El inicializador del parámetro '{0}' no puede hacer referencia al identificador '{1}' declarado después.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "El inicializador no proporciona ningún valor para este elemento de enlace que, a su vez, no tiene un valor predeterminado.", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "La configuración regional debe tener el formato o -. Por ejemplo, '{0}' o '{1}'.", "Longest_matching_prefix_for_0_is_1_6108": "El prefijo coincidente más largo para \"{0}\" es \"{1}\".", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Buscando en la carpeta \"node_modules\", ubicación inicial: \"{0}\".", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Haga que la llamada a \"super()\" sea la primera instrucción del constructor.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "Hacer que la llamada a \"super()\" sea la primera instrucción del constructor", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "El tipo de objeto asignado tiene implícitamente un tipo de plantilla \"any\".", "Member_0_implicitly_has_an_1_type_7008": "El miembro '{0}' tiene un tipo '{1}' implícitamente.", "Merge_conflict_marker_encountered_1185": "Se encontró un marcador de conflicto de combinación.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "La declaración combinada '{0}' no puede incluir una declaración de exportación predeterminada. Considere la posibilidad de agregar una declaración \"export default {0}\" independiente en su lugar.", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== El nombre del módulo '{0}' se resolvió correctamente como '{1}'. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "No se ha especificado el tipo de resolución del módulo, se usará '{0}'.", "Module_resolution_using_rootDirs_has_failed_6111": "No se pudo resolver el módulo con \"rootDirs\".", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "No se permiten varios separadores numéricos consecutivos.", "Multiple_constructor_implementations_are_not_allowed_2392": "No se permiten varias implementaciones del constructor.", "NEWLINE_6061": "NUEVA LÍNEA", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "La propiedad '{0}' con nombre de los tipos '{1}' y '{2}' no es idéntica en ambos.", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Una expresión de clase no abstracta no implementa el miembro abstracto heredado '{0}' de la clase '{1}'.", "Not_all_code_paths_return_a_value_7030": "No todas las rutas de acceso de código devuelven un valor.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "El tipo de índice numérico '{0}' no se puede asignar a un tipo de índice de cadena '{1}'.", + "Numeric_separators_are_not_allowed_here_6188": "Aquí no se permiten separadores numéricos.", "Object_is_possibly_null_2531": "El objeto es posiblemente \"null\".", "Object_is_possibly_null_or_undefined_2533": "El objeto es posiblemente \"null\" o \"undefined\".", "Object_is_possibly_undefined_2532": "El objeto es posiblemente \"undefined\".", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "Solo se puede llamar a una función void con la palabra clave \"new\".", "Only_ambient_modules_can_use_quoted_names_1035": "Solo los módulos de ambiente pueden usar nombres entrecomillados.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Solo los módulos \"amd\" y \"system\" se admiten con --{0}.", + "Only_emit_d_ts_declaration_files_6014": "Solo deben emitirse archivos de declaración \".d.ts\".", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Actualmente, solo se admiten identificadores o nombres completos con argumentos de tipo opcional en la cláusula \"extends\" de una clase.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Solo es posible tener acceso a los métodos públicos y protegidos de la clase base mediante la palabra clave \"super\".", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "El operador '{0}' no se puede aplicar a los tipos '{1}' y '{2}'.", @@ -584,7 +598,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "El tipo de parámetro del establecedor estático público \"{0}\" de la clase exportada tiene o usa el nombre privado \"{1}\".", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analiza en modo strict y emite \"use strict\" para cada archivo de código fuente.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "El patrón \"{0}\" puede tener un carácter '*' como máximo.", - "Prefix_0_with_an_underscore_90025": "Prefijo '{0}' con guion bajo.", + "Prefix_0_with_an_underscore_90025": "Prefijo \"{0}\" con guion bajo", "Print_names_of_files_part_of_the_compilation_6155": "Imprimir los nombres de los archivos que forman parte de la compilación.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Imprimir los nombres de los archivos generados que forman parte de la compilación.", "Print_the_compiler_s_version_6019": "Imprima la versión del compilador.", @@ -596,6 +610,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "La propiedad \"{0}\" no tiene inicializador y no está asignada de forma definitiva en el constructor.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "La propiedad '{0}' tiene el tipo 'any' de forma implícita, porque a su descriptor de acceso get le falta una anotación de tipo de valor devuelto.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "La propiedad '{0}' tiene el tipo 'any' de forma implícita, porque a su descriptor de acceso set le falta una anotación de tipo de parámetro.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "La propiedad \"{0}\" del tipo \"{1}\" no se puede asignar a la misma propiedad del tipo base \"{2}\".", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "La propiedad \"{0}\" del tipo \"{1}\" no se puede asignar al tipo \"{2}\".", "Property_0_is_declared_but_its_value_is_never_read_6138": "La propiedad \"{0}\" se declara, pero su valor no se lee nunca.", "Property_0_is_incompatible_with_index_signature_2530": "La propiedad '{0}' es incompatible con la signatura de índice.", @@ -634,7 +649,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Generar un error en las expresiones y las declaraciones con un tipo \"any\" implícito.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Generar un error en expresiones 'this' con un tipo 'any' implícito.", "Redirect_output_structure_to_the_directory_6006": "Redirija la estructura de salida al directorio.", - "Remove_declaration_for_Colon_0_90004": "Quitar declaración de: \"{0}\".", + "Remove_declaration_for_Colon_0_90004": "Quitar declaración de: \"{0}\"", + "Replace_import_with_0_95015": "Reemplazar importación por \"{0}\".", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Notificar un error cuando no todas las rutas de acceso de código en funcionamiento devuelven un valor.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Notificar errores de los casos de fallthrough en la instrucción switch.", "Report_errors_in_js_files_8019": "Notifique los errores de los archivos .js.", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "El tipo de valor devuelto del método estático público de la clase exportada tiene o usa el nombre privado '{0}'.", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Las resoluciones de módulo cuyo origen es \"{0}\" se reutilizan, ya que las resoluciones no varían respecto al programa anterior.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Reutilizando la resolución del módulo \"{0}\" en el archivo \"{1}\" del programa anterior.", - "Rewrite_as_the_indexed_access_type_0_90026": "Reescribir como el tipo de acceso indexado \"{0}\".", + "Rewrite_as_the_indexed_access_type_0_90026": "Reescribir como tipo de acceso indexado \"{0}\"", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "No se puede determinar el directorio raíz, se omitirán las rutas de búsqueda principales.", "STRATEGY_6039": "ESTRATEGIA", "Scoped_package_detected_looking_in_0_6182": "Se detectó un paquete con ámbito al buscar en \"{0}\"", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "Opciones de mapa de origen", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "La signatura de sobrecarga especializada no se puede asignar a ninguna signatura no especializada.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "El especificador de importación dinámica no puede ser un elemento de propagación.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "Especifique la versión de ECMAScript de destino: \"ES3\" (valor predeterminado), \"ES5\", \"ES2015\", \"ES2016\", \"ES2017\" o \"ESNEXT\".", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "Especifique la versión de ECMAScript de destino: \"ES3\" (valor predeterminado), \"ES5\", \"ES2015\", \"ES2016\", \"ES2017\", \"ES2018\" o \"ESNEXT\".", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "Especifique la generación de código JSX: \"preserve\", \"react-native\" o \"react\".", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Especifique archivos de biblioteca para incluirlos en la compilación: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Especifique los archivos de biblioteca que se van a incluir en la compilación.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Especifique la generación de código del módulo: \"none\", \"commonjs\", \"amd\", \"system\", \"umd\", \"es2015\" o \"ESNext\".", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Especifique la estrategia de resolución de módulos: 'node' (Node.js) o 'classic' (TypeScript pre-1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Especifique la función de generador JSX que se usará cuando el destino sea la emisión de JSX \"react\"; por ejemplo, \"React.createElement\" o \"h\".", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Especifique el directorio raíz de los archivos de entrada. Úselo para controlar la estructura del directorio de salida con --outDir.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "El operador spread de las expresiones \"new\" solo está disponible si el destino es ECMAScript 5 y versiones posteriores.", "Spread_types_may_only_be_created_from_object_types_2698": "Los tipos spread solo se pueden crear a partir de tipos de objeto.", + "Starting_compilation_in_watch_mode_6031": "Iniciando la compilación en modo de inspección...", "Statement_expected_1129": "Se esperaba una instrucción.", "Statements_are_not_allowed_in_ambient_contexts_1036": "No se permiten instrucciones en los contextos de ambiente.", "Static_members_cannot_reference_class_type_parameters_2302": "Los miembros estáticos no pueden hacer referencia a parámetros de tipo de clase.", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "Se esperaba un literal de cadena.", "String_literal_with_double_quotes_expected_1327": "Se esperaba un literal de cadena entre comillas dobles.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Use color y contexto para estilizar los errores y los mensajes (experimental).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Las declaraciones de propiedad subsiguientes deben tener el mismo tipo. La propiedad \"{0}\" debe ser de tipo \"{1}\", pero aquí tiene el tipo \"{2}\".", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Las declaraciones de variable subsiguientes deben tener el mismo tipo. La variable '{0}' debe ser de tipo '{1}', pero aquí tiene el tipo '{2}'.", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "La sustitución '{0}' para el patrón '{1}' tiene un tipo incorrecto. Se esperaba 'string', pero se obtuvo '{2}'.", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "La sustitución \"{0}\" del patrón \"{1}\" puede tener un carácter '*' como máximo.", @@ -745,7 +762,7 @@ "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405": "La parte izquierda de una instrucción \"for...in\" debe ser de tipo \"string\" o \"any\".", "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483": "La parte izquierda de una instrucción \"for...of\" no puede usar una anotación de tipo.", "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487": "La parte izquierda de una instrucción 'for...of' debe ser una variable o el acceso a una propiedad.", - "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362": "La parte izquierda de una operación aritmética debe ser de tipo \"any\", \"number\" o un tipo enum.", + "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362": "La parte izquierda de una operación aritmética debe ser de tipo \"any\", \"number\" o un tipo de enumeración.", "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "La parte izquierda de una expresión de asignación debe ser una variable o el acceso a una propiedad.", "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "La parte izquierda de una expresión \"in\" debe ser de tipo \"any\", \"string\", \"number\" o \"symbol\".", "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "La parte izquierda de una expresión \"instanceof\" debe ser de tipo \"any\", un tipo de objeto o un parámetro de tipo.", @@ -760,7 +777,7 @@ "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058": "El tipo de valor devuelto de una función asincrónica debe ser una promesa válida o no debe contener un miembro \"then\" invocable.", "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064": "El tipo de valor devuelto de una función o un método asincrónicos debe ser el tipo Promise global.", "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407": "La parte derecha de una instrucción \"for...in\" debe ser de tipo \"any\", un tipo de objeto o un parámetro de tipo.", - "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363": "La parte derecha de una operación aritmética debe ser de tipo \"any\", \"number\" o un tipo enum.", + "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363": "La parte derecha de una operación aritmética debe ser de tipo \"any\", \"number\" o un tipo de enumeración.", "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361": "La parte derecha de una expresión \"in\" debe ser de tipo \"any\", un tipo de objeto o un parámetro de tipo.", "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359": "La parte derecha de una expresión \"instanceof\" debe ser de tipo \"any\" o un tipo que pueda asignarse al tipo de interfaz \"Function\".", "The_specified_path_does_not_exist_Colon_0_5058": "La ruta de acceso especificada no existe: \"{0}\".", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "El tipo \"{0}\" no es un tipo de matriz o un tipo de cadena o no tiene un método \"[Symbol.iterator]()\" que devuelve un iterador.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "El tipo \"{0}\" no es un tipo de matriz o no tiene un método \"[Symbol.iterator]()\" que devuelve un iterador.", "Type_0_is_not_assignable_to_type_1_2322": "El tipo '{0}' no se puede asignar al tipo '{1}'.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "El tipo \"{0}\" no se puede asignar al tipo \"{1}\". Existen dos tipos distintos con este nombre, pero no están relacionados.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "El tipo \"{0}\" no se puede asignar al tipo \"{1}\". Existen dos tipos distintos con este nombre, pero no están relacionados.", "Type_0_is_not_comparable_to_type_1_2678": "El tipo '{0}' no se puede comparar con el tipo '{1}'.", "Type_0_is_not_generic_2315": "El tipo '{0}' no es genérico.", "Type_0_provides_no_match_for_the_signature_1_2658": "El tipo \"{0}\" no proporciona ninguna coincidencia para la signatura \"{1}\".", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "Literal de plantilla sin terminar.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Las llamadas a función sin tipo no pueden aceptar argumentos de tipo.", "Unused_label_7028": "Etiqueta no usada.", + "Use_synthetic_default_member_95016": "Use el miembro sintético \"default\".", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "El uso de una cadena en una instrucción \"for...of\" solo se admite en ECMAScript 5 y versiones posteriores.", "VERSION_6036": "VERSIÓN", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "El valor de tipo \"{0}\" no tiene propiedades en común con el tipo \"{1}\". ¿Realmente quiere llamarlo?", @@ -913,9 +931,9 @@ "const_declarations_must_be_initialized_1155": "Las declaraciones \"const\" deben inicializarse.", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "El inicializador de miembros de enumeración \"const\" se evaluó con un valor no finito.", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "El inicializador de miembros de enumeración \"const\" se evaluó con un valor \"NaN\" no permitido.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Las enumeraciones \"const\" solo se pueden usar en expresiones de acceso de propiedad o índice, o en la parte derecha de una declaración de importación o una asignación de exportación.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Las enumeraciones \"const\" solo se pueden usar en expresiones de acceso de propiedad o índice, o en la parte derecha de una declaración de importación, una asignación de exportación o una consulta de tipo.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "No se puede llamar a \"delete\" en un identificador en modo strict.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "\"enum declarations\" solo se puede usar en un archivo .ts.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Las declaraciones \"enum\" solo se pueden usar en un archivo .ts.", "export_can_only_be_used_in_a_ts_file_8003": "\"export=\" solo se puede usar en un archivo .ts.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "El modificador 'export' no se puede aplicar a módulos de ambiente ni aumentos de módulos, porque siempre están visibles.", "extends_clause_already_seen_1172": "La cláusula \"extends\" ya se ha visto.", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "La cláusula \"implements\" ya se ha visto.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "\"implements clauses\" solo se puede usar en un archivo .ts.", "import_can_only_be_used_in_a_ts_file_8002": "\"import ... =\" solo se puede usar en un archivo .ts.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Las declaraciones \"infer\" solo se permiten en la cláusula \"extends\" de un tipo condicional.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "\"interface declarations\" solo se puede usar en un archivo .ts.", "let_declarations_can_only_be_declared_inside_a_block_1157": "Las declaraciones \"let\" solo se pueden declarar dentro de un bloque.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "No se permite usar \"let\" como nombre en las declaraciones \"let\" o \"const\".", diff --git a/lib/fr/diagnosticMessages.generated.json b/lib/fr/diagnosticMessages.generated.json index e3a3fea1e6b..7142fcb0d7d 100644 --- a/lib/fr/diagnosticMessages.generated.json +++ b/lib/fr/diagnosticMessages.generated.json @@ -12,11 +12,11 @@ "A_class_member_cannot_have_the_0_keyword_1248": "Un membre de classe ne peut pas avoir le mot clé '{0}'.", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "Une expression avec virgule n'est pas autorisée dans un nom de propriété calculée.", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "Un nom de propriété calculée ne peut pas référencer un paramètre de type à partir de son type conteneur.", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Un nom de propriété calculée dans une déclaration de propriété de classe doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Un nom de propriété calculée dans une surcharge de méthode doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Un nom de propriété calculée dans un littéral de type doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Un nom de propriété calculée dans un contexte ambiant doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Un nom de propriété calculée dans une interface doit faire référence à une expression dont le type est un type littéral ou un type 'symbole unique'.", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Un nom de propriété calculée dans une déclaration de propriété de classe doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Un nom de propriété calculée dans une surcharge de méthode doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Un nom de propriété calculée dans un littéral de type doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Un nom de propriété calculée dans un contexte ambiant doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Un nom de propriété calculée dans une interface doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Un nom de propriété calculée doit être de type 'string', 'number', 'symbol' ou 'any'.", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "Un nom de propriété calculée de la forme '{0}' doit être de type 'symbol'.", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Un membre d'enum const n'est accessible qu'à l'aide d'un littéral de chaîne.", @@ -48,16 +48,18 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Une déclaration d'espace de noms ne peut pas se trouver dans un autre fichier que celui d'une classe ou d'une fonction avec laquelle elle est fusionnée.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Une déclaration d'espace de noms ne peut pas se trouver avant une classe ou une fonction avec laquelle elle est fusionnée.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Une déclaration d'espace de noms est autorisée uniquement dans un espace de noms ou un module.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Impossible d'appeler ou de construire une importation de style d'espace de noms, ce qui va entraîner un échec au moment de l'exécution.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un initialiseur de paramètre est uniquement autorisé dans une implémentation de fonction ou de constructeur.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Impossible de déclarer une propriété de paramètre à l'aide d'un paramètre rest.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Une propriété de paramètre est uniquement autorisée dans une implémentation de constructeur.", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "Impossible de déclarer une propriété de paramètre à l'aide d'un modèle de liaison.", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "Un chemin dans une option 'extends' doit être relatif ou rooté, mais '{0}' n'est ni l'un ni l'autre.", "A_promise_must_have_a_then_method_1059": "Une promesse doit avoir une méthode 'then'.", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Une propriété d'une classe dont le type est un type 'symbole unique' doit être à la fois 'static' et 'readonly'.", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Une propriété d'une interface ou d'un littéral de type dont le type est un type 'symbole unique' doit être 'readonly'.", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Une propriété d'une classe dont le type est un type 'unique symbol' doit être à la fois 'static' et 'readonly'.", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Une propriété d'une interface ou d'un littéral de type dont le type est un type 'unique symbol' doit être 'readonly'.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Un paramètre obligatoire ne peut pas suivre un paramètre optionnel.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Un élément rest ne peut pas contenir de modèle de liaison.", + "A_rest_element_cannot_have_a_property_name_2566": "Un élément rest ne peut pas avoir de nom de propriété.", "A_rest_element_cannot_have_an_initializer_1186": "Un élément rest ne peut pas avoir d'initialiseur.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Un élément rest doit être le dernier dans un modèle de déstructuration.", "A_rest_parameter_cannot_be_optional_1047": "Un paramètre rest ne peut pas être facultatif.", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "Un prédicat de type ne peut pas référencer un élément '{0}' dans un modèle de liaison.", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "Un prédicat de type est autorisé uniquement dans une position de type de retour pour les fonctions et les méthodes.", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "Le type d'un prédicat de type doit être assignable au type de son paramètre.", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Une variable dont le type est un type 'symbole unique' doit être 'const'.", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Une variable dont le type est un type 'unique symbol' doit être 'const'.", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Une expression 'yield' est autorisée uniquement dans le corps d'un générateur.", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "La méthode abstraite '{0}' de la classe '{1}' n'est pas accessible au moyen de l'expression super.", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Les méthodes abstraites peuvent uniquement apparaître dans une classe abstraite.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "Modificateur d'accessibilité déjà rencontré.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Les accesseurs sont uniquement disponibles quand EcmaScript 5 ou version supérieure est ciblé.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Les accesseurs doivent être abstraits ou non abstraits.", - "Add_0_to_existing_import_declaration_from_1_90015": "Ajoutez '{0}' à une déclaration d'importation existante à partir de \"{1}\".", - "Add_index_signature_for_property_0_90017": "Ajoutez une signature d'index pour la propriété '{0}'.", - "Add_missing_super_call_90001": "Ajoutez l'appel manquant à 'super()'.", - "Add_this_to_unresolved_variable_90008": "Ajoutez 'this.' à la variable non résolue.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "L'ajout d'un fichier tsconfig.json permet d'organiser les projets qui contiennent des fichiers TypeScript et JavaScript. En savoir plus sur https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "Ajouter '{0}' à la déclaration d'importation existante de \"{1}\"", + "Add_async_modifier_to_containing_function_90029": "Ajouter le modificateur async dans la fonction conteneur", + "Add_index_signature_for_property_0_90017": "Ajouter une signature d'index pour la propriété '{0}'", + "Add_missing_super_call_90001": "Ajouter l'appel manquant à 'super()'", + "Add_this_to_unresolved_variable_90008": "Ajouter 'this.' à la variable non résolue", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "L'ajout d'un fichier tsconfig.json permet d'organiser les projets qui contiennent des fichiers TypeScript et JavaScript. En savoir plus sur https://aka.ms/tsconfig.", "Additional_Checks_6176": "Vérifications supplémentaires", "Advanced_Options_6178": "Options avancées", "All_declarations_of_0_must_have_identical_modifiers_2687": "Toutes les déclarations de '{0}' doivent avoir des modificateurs identiques.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Un paramètre de signature d'index ne peut pas avoir de modificateur d'accessibilité.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Un paramètre de signature d'index ne peut pas avoir d'initialiseur.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "Un paramètre de signature d'index doit avoir une annotation de type.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Un type de paramètre de signature d'index ne peut pas être un alias de type. Écrivez '[{0}: {1}]: {2}' à la place.", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Un type de paramètre de signature d'index ne peut pas être un type union. Utilisez un type d'objet mappé à la place.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Le type d'un paramètre de signature d'index doit être 'string' ou 'number'.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Une interface peut uniquement étendre un identificateur/nom qualifié avec des arguments de type facultatifs.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Une interface peut uniquement étendre une classe ou une autre interface.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "Chiffre binaire attendu.", "Binding_element_0_implicitly_has_an_1_type_7031": "L'élément de liaison '{0}' possède implicitement un type '{1}'.", "Block_scoped_variable_0_used_before_its_declaration_2448": "Variable de portée de bloc '{0}' utilisée avant sa déclaration.", - "Call_decorator_expression_90028": "Appelez l'expression de l'élément décoratif.", + "Call_decorator_expression_90028": "Appeler l'expression de l'élément décoratif", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La signature d'appel, qui ne dispose pas d'annotation de type de retour, possède implicitement un type de retour 'any'.", "Call_target_does_not_contain_any_signatures_2346": "La cible de l'appel ne contient aucune signature.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Impossible d'accéder à '{0}.{1}', car '{0}' est un type, mais pas un espace de noms. Voulez-vous plutôt récupérer le type de la propriété '{1}' dans '{0}' avec '{0}[\"{1}\"]' ?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Impossible d'importer les fichiers de déclaration de type. Importez '{0}' à la place de '{1}'.", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Impossible d'initialiser la variable de portée externe '{0}' dans la même portée que celle de la déclaration de portée de bloc '{1}'.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Impossible d'appeler une expression dont le type n'a pas de signature d'appel. Le type '{0}' n'a aucune signature d'appel compatible.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Impossible d'appeler un objet qui a éventuellement une valeur 'null'.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Impossible d'appeler un objet qui a éventuellement une valeur 'null' ou 'undefined'.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Impossible d'appeler un objet qui a éventuellement une valeur 'undefined'.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "Impossible de réexporter un type quand l'indicateur '--isolatedModules' est spécifié.", "Cannot_read_file_0_Colon_1_5012": "Impossible de lire le fichier '{0}' : {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "Impossible de redéclarer la variable de portée de bloc '{0}'.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Impossible d'écrire le fichier '{0}', car cela entraînerait le remplacement du fichier d'entrée.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Une variable de clause catch ne peut pas avoir d'annotation de type.", "Catch_clause_variable_cannot_have_an_initializer_1197": "Une variable de clause catch ne peut pas avoir d'initialiseur.", - "Change_0_to_1_90014": "Changez '{0}' en '{1}'.", - "Change_extends_to_implements_90003": "Changez 'extends' en 'implements'.", - "Change_spelling_to_0_90022": "Changez l'orthographe en '{0}'.", + "Change_0_to_1_90014": "Changer '{0}' en '{1}'", + "Change_extends_to_implements_90003": "Changer 'extends' en 'implements'", + "Change_spelling_to_0_90022": "Changer l'orthographe en '{0}'", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Vérification en cours pour déterminer si '{0}' est le préfixe correspondant le plus long pour '{1}' - '{2}'.", "Circular_definition_of_import_alias_0_2303": "Définition circulaire de l'alias d'importation '{0}'.", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "Circularité détectée durant la résolution de la configuration : {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "La classe '{0}' définit la fonction de membre d'instance '{1}', mais la classe étendue '{2}' le définit comme propriété de membre d'instance.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "La classe '{0}' définit la propriété de membre d'instance '{1}', mais la classe étendue '{2}' le définit comme fonction de membre d'instance.", "Class_0_incorrectly_extends_base_class_1_2415": "La classe '{0}' étend de manière incorrecte la classe de base '{1}'.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "La classe '{0}' implémente de manière incorrecte la classe '{1}'. Voulez-vous vraiment étendre '{1}' et hériter de ses membres en tant que sous-classe ?", "Class_0_incorrectly_implements_interface_1_2420": "La classe '{0}' implémente de manière incorrecte l'interface '{1}'.", "Class_0_used_before_its_declaration_2449": "Classe '{0}' utilisée avant sa déclaration.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Les déclarations de classes ne peuvent pas avoir plusieurs balises '@augments' ou '@extends'.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Fichier conteneur non spécifié et répertoire racine impossible à déterminer. Recherche ignorée dans le dossier 'node_modules'.", "Convert_function_0_to_class_95002": "Convertir la fonction '{0}' en classe", "Convert_function_to_an_ES2015_class_95001": "Convertir la fonction en classe ES2015", + "Convert_to_ES6_module_95017": "Convertir en module ES6", "Convert_to_default_import_95013": "Convertir en importation par défaut", "Corrupted_locale_file_0_6051": "Fichier de paramètres régionaux endommagé : {0}.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Le fichier de déclaration du module '{0}' est introuvable. '{1}' a implicitement un type 'any'.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Déclaration attendue.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Le nom de la déclaration est en conflit avec l'identificateur global intégré '{0}'.", "Declaration_or_statement_expected_1128": "Déclaration ou instruction attendue.", - "Declare_method_0_90023": "Déclarez la méthode '{0}'.", - "Declare_property_0_90016": "Déclarez la propriété '{0}'.", - "Declare_static_method_0_90024": "Déclarez la méthode statique '{0}'.", - "Declare_static_property_0_90027": "Déclarez la propriété statique '{0}'.", + "Declare_method_0_90023": "Déclarer la méthode '{0}'", + "Declare_property_0_90016": "Déclarer la propriété '{0}'", + "Declare_static_method_0_90024": "Déclarer la méthode statique '{0}'", + "Declare_static_property_0_90027": "Déclarer la propriété statique '{0}'", "Decorators_are_not_valid_here_1206": "Les éléments décoratifs ne sont pas valides ici.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Impossible d'appliquer des éléments décoratifs à plusieurs accesseurs get/set du même nom.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "L'exportation par défaut du module a utilisé ou utilise le nom privé '{0}'.", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Déconseillé] Utilisez '--skipLibCheck' à la place. Permet d'ignorer le contrôle de type des fichiers de déclaration de la bibliothèque par défaut.", "Digit_expected_1124": "Chiffre attendu", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Le répertoire '{0}' n'existe pas. Toutes les recherches associées sont ignorées.", - "Disable_checking_for_this_file_90018": "Désactivez la vérification de ce fichier.", + "Disable_checking_for_this_file_90018": "Désactiver la vérification de ce fichier", "Disable_size_limitations_on_JavaScript_projects_6162": "Désactivez les limitations de taille sur les projets JavaScript.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Désactivez la vérification stricte des signatures génériques dans les types de fonction.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "Interdisez les références dont la casse est incohérente dans le même fichier.", @@ -309,6 +319,7 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "Activez la vérification stricte de l'initialisation des propriétés dans les classes.", "Enable_strict_null_checks_6113": "Activez strict null checks.", "Enable_tracing_of_the_name_resolution_process_6085": "Activez le traçage du processus de résolution de noms.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Active l'interopérabilité entre les modules CommonJS et ES via la création d'objets d'espace de noms pour toutes les importations. Implique 'allowSyntheticDefaultImports'.", "Enables_experimental_support_for_ES7_async_functions_6068": "Active la prise en charge expérimentale des fonctions async ES7.", "Enables_experimental_support_for_ES7_decorators_6065": "Active la prise en charge expérimentale des éléments décoratifs ES7.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Active la prise en charge expérimentale pour l'émission des métadonnées de type pour les éléments décoratifs.", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "Expression résolue en déclaration de variable '_this' et utilisée par le compilateur pour capturer la référence 'this'.", "Extract_constant_95006": "Extraire la constante", "Extract_function_95005": "Extraire la fonction", - "Extract_symbol_95003": "Extraire le symbole", "Extract_to_0_in_1_95004": "Extraire vers {0} dans {1}", "Extract_to_0_in_1_scope_95008": "Extraire vers {0} dans la portée {1}", "Extract_to_0_in_enclosing_scope_95007": "Extraire vers {0} dans la portée englobante", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "Le nom de fichier '{0}' diffère du nom de fichier '{1}' déjà inclus uniquement par la casse.", "File_name_0_has_a_1_extension_stripping_it_6132": "Le nom de fichier '{0}' a une extension '{1}'. Suppression de l'extension.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "La spécification de fichier ne peut pas contenir un répertoire parent ('..') après un caractère générique de répertoire récursif ('**') : '{0}'.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "Une spécification de fichier ne peut pas contenir plusieurs caractères génériques de répertoires récursifs ('**') : '{0}'.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "Une spécification de fichier ne peut pas se terminer par un caractère générique de répertoire récursif ('**') : '{0}'.", "Found_package_json_at_0_6099": "'package.json' trouvé sur '{0}'.", + "Found_package_json_at_0_Package_ID_is_1_6190": "'package.json' trouvé sur '{0}'. L'ID de package est '{1}'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Les déclarations de fonction ne sont pas autorisées dans les blocs en mode strict durant le ciblage de la version 'ES3' ou 'ES5'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Les déclarations de fonction ne sont pas autorisées dans les blocs en mode strict durant le ciblage de la version 'ES3' ou 'ES5'. Les définitions de classe sont automatiquement en mode strict.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Les déclarations de fonction ne sont pas autorisées dans les blocs en mode strict durant le ciblage de la version 'ES3' ou 'ES5'. Les modules sont automatiquement en mode strict.", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "Identificateur attendu. '{0}' est un mot réservé en mode strict. Les modules sont automatiquement en mode strict.", "Identifier_expected_1003": "Identificateur attendu.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Identificateur attendu. '__esModule' est réservé en tant que marqueur exporté durant la transformation des modules ECMAScript.", - "Ignore_this_error_message_90019": "Ignorez ce message d'erreur.", - "Implement_inherited_abstract_class_90007": "Implémentez la classe abstraite héritée.", - "Implement_interface_0_90006": "Implémentez l'interface '{0}'.", + "Ignore_this_error_message_90019": "Ignorer ce message d'erreur", + "Implement_inherited_abstract_class_90007": "Implémenter la classe abstraite héritée", + "Implement_interface_0_90006": "Implémenter l'interface '{0}'", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "La clause implements de la classe exportée '{0}' possède ou utilise le nom privé '{1}'.", - "Import_0_from_module_1_90013": "Importez '{0}' à partir du module \"{1}\".", + "Import_0_from_module_1_90013": "Importer '{0}' à partir du module \"{1}\"", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Vous ne pouvez pas utiliser l'assignation d'importation pour cibler des modules ECMAScript. Utilisez plutôt 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' ou un autre format de module.", "Import_declaration_0_is_using_private_name_1_4000": "La déclaration d'importation '{0}' utilise le nom privé '{1}'.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "La déclaration d'importation est en conflit avec la déclaration locale de '{0}'.", @@ -424,10 +434,10 @@ "Index_signature_is_missing_in_type_0_2329": "Signature d'index manquante dans le type '{0}'.", "Index_signatures_are_incompatible_2330": "Les signatures d'index sont incompatibles.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Les déclarations individuelles de la déclaration fusionnée '{0}' doivent toutes être exportées ou locales.", - "Infer_parameter_types_from_usage_95012": "Déduisez les types des paramètres à partir de l'utilisation.", - "Infer_type_of_0_from_usage_95011": "Déduisez le type de '{0}' à partir de l'utilisation.", - "Initialize_property_0_in_the_constructor_90020": "Initialisez la propriété '{0}' dans le constructeur.", - "Initialize_static_property_0_90021": "Initialisez la propriété statique '{0}'.", + "Infer_parameter_types_from_usage_95012": "Déduire les types des paramètres à partir de l'utilisation", + "Infer_type_of_0_from_usage_95011": "Déduire le type de '{0}' à partir de l'utilisation", + "Initialize_property_0_in_the_constructor_90020": "Initialiser la propriété '{0}' dans le constructeur", + "Initialize_static_property_0_90021": "Initialiser la propriété statique '{0}'", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "L'initialiseur de la variable membre d'instance '{0}' ne peut pas référencer l'identificateur '{1}' déclaré dans le constructeur.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "L'initialiseur du paramètre '{0}' ne peut pas référencer l'identificateur '{1}' déclaré après lui.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "L'initialiseur ne fournit aucune valeur pour cet élément de liaison, et ce dernier n'a pas de valeur par défaut.", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "Les paramètres régionaux doivent être sous la forme ou -. Par exemple, '{0}' ou '{1}'.", "Longest_matching_prefix_for_0_is_1_6108": "Le préfixe correspondant le plus long pour '{0}' est '{1}'.", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Recherche dans le dossier 'node_modules', emplacement initial '{0}'.", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Faites de l'appel à 'super()' la première instruction du constructeur.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "Faire de l'appel à 'super()' la première instruction du constructeur", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "Le type d'objet mappé a implicitement un type de modèle 'any'.", "Member_0_implicitly_has_an_1_type_7008": "Le membre '{0}' possède implicitement un type '{1}'.", "Merge_conflict_marker_encountered_1185": "Marqueur de conflit de fusion rencontré.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "La déclaration fusionnée '{0}' ne peut pas inclure de déclaration d'exportation par défaut. Ajoutez plutôt une déclaration 'export default {0}' distincte.", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== Le nom de module '{0}' a été correctement résolu en '{1}'. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Le genre de résolution de module n'est pas spécifié. Utilisation de '{0}'.", "Module_resolution_using_rootDirs_has_failed_6111": "Échec de la résolution de module à l'aide de 'rootDirs'.", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Les séparateurs numériques consécutifs multiples ne sont pas autorisés.", "Multiple_constructor_implementations_are_not_allowed_2392": "Les implémentations de plusieurs constructeurs ne sont pas autorisées.", "NEWLINE_6061": "NOUVELLE LIGNE", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "La propriété nommée '{0}' des types '{1}' et '{2}' n'est pas identique.", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "L'expression de classe non abstraite '{0}' n'implémente pas le membre abstrait hérité '{0}' de la classe '{1}'.", "Not_all_code_paths_return_a_value_7030": "Les chemins de code ne retournent pas tous une valeur.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Impossible d'assigner le type d'index numérique '{0}' au type d'index de chaîne '{1}'.", + "Numeric_separators_are_not_allowed_here_6188": "Les séparateurs numériques ne sont pas autorisés ici.", "Object_is_possibly_null_2531": "L'objet a peut-être la valeur 'null'.", "Object_is_possibly_null_or_undefined_2533": "L'objet a peut-être la valeur 'null' ou 'undefined'.", "Object_is_possibly_undefined_2532": "L'objet a peut-être la valeur 'undefined'.", @@ -526,7 +539,7 @@ "Object_literal_s_property_0_implicitly_has_an_1_type_7018": "La propriété '{0}' du littéral d'objet possède implicitement un type '{1}'.", "Octal_digit_expected_1178": "Chiffre octal attendu.", "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017": "Les types de littéral octal doivent utiliser la syntaxe ES2015. Utilisez la syntaxe '{0}'.", - "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018": "Les littéraux octaux ne sont pas autorisés dans l'initialiseur des membres d'énumérations. Utilisez la syntaxe '{0}'.", + "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018": "Les littéraux octaux ne sont pas autorisés dans l'initialiseur des membres d'enums. Utilisez la syntaxe '{0}'.", "Octal_literals_are_not_allowed_in_strict_mode_1121": "Les littéraux octaux ne sont pas autorisés en mode strict.", "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085": "Les littéraux octaux ne sont pas disponibles lorsque vous ciblez ECMAScript 5 et ultérieur. Utilisez la syntaxe '{0}'.", "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091": "Une seule déclaration de variable est autorisée dans une instruction 'for...in'.", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "Seule une fonction void peut être appelée avec le mot clé 'new'.", "Only_ambient_modules_can_use_quoted_names_1035": "Seuls les modules ambiants peuvent utiliser des noms entre guillemets.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Seuls les modules 'amd' et 'system' sont pris en charge avec --{0}.", + "Only_emit_d_ts_declaration_files_6014": "Émettez uniquement les fichiers de déclaration '.d.ts'.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Seuls les identificateurs/noms qualifiés avec des arguments de type facultatifs sont pris en charge dans une clause 'extends' de classe.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Seules les méthodes publiques et protégées de la classe de base sont accessibles par le biais du mot clé 'super'.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Impossible d'appliquer l'opérateur '{0}' aux types '{1}' et '{2}'.", @@ -584,7 +598,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Le type de paramètre du setter public '{0}' de la classe exportée porte ou utilise le nom privé '{1}'.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analyser en mode strict et émettre \"use strict\" pour chaque fichier source.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Le modèle '{0}' ne peut avoir qu'un seul caractère '*' au maximum.", - "Prefix_0_with_an_underscore_90025": "Préfixez '{0}' avec un trait de soulignement.", + "Prefix_0_with_an_underscore_90025": "Faire précéder '{0}' d'un trait de soulignement", "Print_names_of_files_part_of_the_compilation_6155": "Imprimez les noms des fichiers faisant partie de la compilation.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Imprimez les noms des fichiers générés faisant partie de la compilation.", "Print_the_compiler_s_version_6019": "Affichez la version du compilateur.", @@ -596,6 +610,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "La propriété '{0}' n'a aucun initialiseur et n'est pas définitivement assignée dans le constructeur.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "La propriété '{0}' a implicitement le type 'any', car son accesseur get ne dispose pas d'une annotation de type de retour.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "La propriété '{0}' a implicitement le type 'any', car son accesseur set ne dispose pas d'une annotation de type de paramètre.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Impossible d'assigner la propriété '{0}' du type '{1}' à la même propriété du type de base '{2}'.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "La propriété '{0}' du type '{1}' ne peut pas être assignée au type '{2}'.", "Property_0_is_declared_but_its_value_is_never_read_6138": "La propriété '{0}' est déclarée mais sa valeur n'est jamais lue.", "Property_0_is_incompatible_with_index_signature_2530": "La propriété '{0}' est incompatible avec la signature d'index.", @@ -634,7 +649,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Lever une erreur sur les expressions et les déclarations ayant un type 'any' implicite.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Déclenche une erreur sur les expressions 'this' avec un type 'any' implicite.", "Redirect_output_structure_to_the_directory_6006": "Rediriger la structure de sortie vers le répertoire.", - "Remove_declaration_for_Colon_0_90004": "Supprimez la déclaration pour : '{0}'.", + "Remove_declaration_for_Colon_0_90004": "Supprimer la déclaration pour : '{0}'", + "Replace_import_with_0_95015": "Remplacez l'importation par '{0}'.", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Signalez une erreur quand les chemins de code de la fonction ne retournent pas tous une valeur.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Signalez les erreurs pour les case avec fallthrough dans une instruction switch.", "Report_errors_in_js_files_8019": "Signalez les erreurs dans les fichiers .js.", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "Le type de retour de la méthode statique publique de la classe exportée possède ou utilise le nom privé '{0}'.", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Réutilisation des résolutions de module provenant de '{0}', car les résolutions sont inchangées par rapport à l'ancien programme.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Réutilisation de la résolution du module '{0}' dans le fichier '{1}' à partir de l'ancien programme.", - "Rewrite_as_the_indexed_access_type_0_90026": "Réécrire en tant que type d'accès indexé '{0}'.", + "Rewrite_as_the_indexed_access_type_0_90026": "Réécrire en tant que type d'accès indexé '{0}'", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Impossible de déterminer le répertoire racine, chemins de recherche primaires ignorés.", "STRATEGY_6039": "STRATÉGIE", "Scoped_package_detected_looking_in_0_6182": "Package de portée détecté. Recherche dans '{0}'", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "Options de mappage de source", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "La signature de surcharge spécialisée n'est assignable à aucune signature non spécialisée.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Le spécificateur de l'importation dynamique ne peut pas être un élément spread.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "Spécifiez la version cible d'ECMAScript : 'ES3' (par défaut), 'ES5', 'ES2015', 'ES2016', 'ES2017' ou 'ESNEXT'.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "Spécifiez la version cible d'ECMAScript : 'ES3' (par défaut), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' ou 'ESNEXT'.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "Spécifiez la génération de code JSX : 'preserve', 'react-native' ou 'react'.", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Spécifiez les fichiers bibliothèques à inclure dans la compilation : ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Spécifiez les fichiers bibliothèques à inclure dans la compilation.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Spécifiez la génération de code du module : 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015' ou 'ESNext'.", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Spécifiez la stratégie de résolution de module : 'node' (Node.js) ou 'classic' (version de TypeScript antérieure à 1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Spécifiez la fonction de fabrique JSX à utiliser pour le ciblage d'une émission JSX 'react', par exemple 'React.createElement' ou 'h'.", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Spécifiez le répertoire racine des fichiers d'entrée. Contrôlez la structure des répertoires de sortie avec --outDir.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "L'opérateur spread dans les expressions 'new' est disponible uniquement quand ECMAScript 5 ou version supérieure est ciblé.", "Spread_types_may_only_be_created_from_object_types_2698": "Vous ne pouvez créer des types Spread qu'à partir de types d'objet.", + "Starting_compilation_in_watch_mode_6031": "Démarrage de la compilation en mode espion...", "Statement_expected_1129": "Instruction attendue.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Les instructions ne sont pas autorisées dans les contextes ambiants.", "Static_members_cannot_reference_class_type_parameters_2302": "Les membres statiques ne peuvent pas référencer des paramètres de type de classe.", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "Littéral de chaîne attendu.", "String_literal_with_double_quotes_expected_1327": "Littéral de chaîne avec guillemets doubles attendu.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Stylisez les erreurs et les messages avec de la couleur et du contexte (expérimental).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Les prochaines déclarations de propriétés doivent avoir le même type. La propriété '{0}' doit avoir le type '{1}', mais elle a ici le type '{2}'.", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Les déclarations de variable ultérieures doivent avoir le même type. La variable '{0}' doit être de type '{1}', mais elle a ici le type '{2}'.", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "Le type de la substitution '{0}' du modèle '{1}' est incorrect. Attente de 'string'. Obtention de '{2}'.", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "La substitution '{0}' dans le modèle '{1}' ne peut avoir qu'un seul caractère '*' au maximum.", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Le type '{0}' n'est pas un type tableau ou un type chaîne, ou n'a pas de méthode '[Symbol.iterator]()' qui retourne un itérateur.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Le type '{0}' n'est pas un type tableau ou n'a pas de méthode '[Symbol.iterator]()' qui retourne un itérateur.", "Type_0_is_not_assignable_to_type_1_2322": "Impossible d'assigner le type '{0}' au type '{1}'.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "Le type '{0}' ne peut pas être assigné au type '{1}'. Il existe deux types distincts portant ce nom, mais ils ne sont pas liés.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "Impossible d'assigner le type '{0}' au type '{1}'. Il existe deux types distincts portant ce nom, mais ils ne sont pas liés.", "Type_0_is_not_comparable_to_type_1_2678": "Le type '{0}' n'est pas comparable au type '{1}'.", "Type_0_is_not_generic_2315": "Le type '{0}' n'est pas générique.", "Type_0_provides_no_match_for_the_signature_1_2658": "Le type '{0}' ne fournit aucune correspondance pour la signature '{1}'.", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "Littéral de modèle inachevé.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Les appels de fonctions non typées ne peuvent pas accepter d'arguments de type.", "Unused_label_7028": "Étiquette inutilisée.", + "Use_synthetic_default_member_95016": "Utilisez un membre 'default' synthétique.", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "L'utilisation d'une chaîne dans une instruction 'for...of' est prise en charge uniquement dans ECMAScript 5 et version supérieure.", "VERSION_6036": "VERSION", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "La valeur de type '{0}' n'a aucune propriété en commun avec le type '{1}'. Voulez-vous vraiment l'appeler ?", @@ -913,9 +931,9 @@ "const_declarations_must_be_initialized_1155": "Les déclarations 'const' doivent être initialisées.", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "L'initialiseur de membre enum 'const' donne une valeur non finie.", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "L'initialiseur de membre enum 'const' donne une valeur non autorisée 'NaN'.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Les enums 'const' ne peuvent être utilisés que dans les expressions d'accès à une propriété ou un index, ou dans la partie droite d'une déclaration d'importation ou d'une assignation d'exportation.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Les enums 'const' ne peuvent être utilisés que dans les expressions d'accès à une propriété ou un index, ou dans la partie droite d'une déclaration d'importation, d'une assignation d'exportation ou d'une requête de type.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "'delete' ne peut pas être appelé dans un identificateur en mode strict.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Les déclarations 'enum' peuvent uniquement être utilisées dans un fichier .ts.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'Les déclarations enum' peuvent uniquement être utilisées dans un fichier .ts.", "export_can_only_be_used_in_a_ts_file_8003": "'export=' peut uniquement être utilisé dans un fichier .ts.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Impossible d'appliquer le modificateur 'export' aux modules ambients et aux augmentations de module, car ils sont toujours visibles.", "extends_clause_already_seen_1172": "Clause 'extends' déjà rencontrée.", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "Clause 'implements' déjà rencontrée.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "Les clauses 'implements' peuvent uniquement être utilisées dans un fichier .ts.", "import_can_only_be_used_in_a_ts_file_8002": "'import ... =' peut uniquement être utilisé dans un fichier .ts.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Les déclarations 'infer' sont uniquement autorisées dans la clause 'extends' d’un type conditionnel.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "Les 'déclarations d'interface' peuvent uniquement être utilisées dans un fichier .ts.", "let_declarations_can_only_be_declared_inside_a_block_1157": "Les déclarations 'let' ne peuvent être déclarées que dans un bloc.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "'let' ne peut pas être utilisé comme nom dans les déclarations 'let' ou 'const'.", @@ -963,9 +982,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "Les 'expressions d'assertion de type' peuvent uniquement être utilisées dans un fichier .ts.", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "Les 'déclarations de paramètre de type' peuvent uniquement être utilisées dans un fichier .ts.", "types_can_only_be_used_in_a_ts_file_8010": "Les 'types' peuvent uniquement être utilisés dans un fichier .ts.", - "unique_symbol_types_are_not_allowed_here_1335": "Les types 'symbole unique' ne sont pas autorisés ici.", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Les types 'symbole unique' sont uniquement autorisés sur les variables d'une déclaration de variable.", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Les types 'symbole unique' ne peuvent pas être utilisés dans une déclaration de variable avec un nom de liaison.", + "unique_symbol_types_are_not_allowed_here_1335": "Les types 'unique symbol' ne sont pas autorisés ici.", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Les types 'unique symbol' sont uniquement autorisés sur les variables d'une déclaration de variable.", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Les types 'unique symbol' ne peuvent pas être utilisés dans une déclaration de variable avec un nom de liaison.", "with_statements_are_not_allowed_in_an_async_function_block_1300": "Les instructions 'with' ne sont pas autorisées dans un bloc de fonctions async.", "with_statements_are_not_allowed_in_strict_mode_1101": "Les instructions 'with' ne sont pas autorisées en mode strict.", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "Impossible d'utiliser des expressions 'yield' dans un initialiseur de paramètre." diff --git a/lib/it/diagnosticMessages.generated.json b/lib/it/diagnosticMessages.generated.json index a9fffd5450d..5bd0767bb28 100644 --- a/lib/it/diagnosticMessages.generated.json +++ b/lib/it/diagnosticMessages.generated.json @@ -48,6 +48,7 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Una dichiarazione di spazio dei nomi non può essere presente in un file diverso rispetto a una classe o funzione con cui è stato eseguito il merge.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Una dichiarazione di spazio dei nomi non può essere specificata prima di una classe o funzione con cui è stato eseguito il merge.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Una dichiarazione di spazio dei nomi è consentita solo in uno spazio dei nomi o in un modulo.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Non è possibile chiamare o costruire un'importazione in stile spazio dei nomi. Questo comporterà un errore in fase di runtime.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Un inizializzatore di parametro è consentito solo in un'implementazione di funzione o costruttore.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Non è possibile dichiarare una proprietà di parametro usando un parametro REST.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Una proprietà di parametro è consentita solo in un'implementazione di costruttore.", @@ -58,6 +59,7 @@ "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Una proprietà di un'interfaccia o di un valore letterale di tipo il cui tipo è un tipo 'unique symbol' deve essere 'readonly'.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Un parametro obbligatorio non può seguire un parametro facoltativo.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Un elemento rest non può contenere un criterio di binding.", + "A_rest_element_cannot_have_a_property_name_2566": "Un elemento rest non può contenere un nome proprietà.", "A_rest_element_cannot_have_an_initializer_1186": "Un elemento rest non può includere un inizializzatore.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Un elemento rest deve essere l'ultimo di un criterio di destrutturazione.", "A_rest_parameter_cannot_be_optional_1047": "Un parametro rest non può essere facoltativo.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "Il modificatore di accessibilità è già presente.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Le funzioni di accesso sono disponibili solo se destinate a ECMAScript 5 e versioni successive.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Le funzioni di accesso devono essere tutte astratte o tutte non astratte.", - "Add_0_to_existing_import_declaration_from_1_90015": "Aggiungere '{0}' alla dichiarazione di importazione esistente da \"{1}\".", - "Add_index_signature_for_property_0_90017": "Aggiungere la firma dell'indice per la proprietà '{0}'.", - "Add_missing_super_call_90001": "Aggiunge la chiamata mancante a 'super()'.", - "Add_this_to_unresolved_variable_90008": "Aggiungi 'this.' alla variabile non risolta.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Aggiungere un file tsconfig.json per organizzare più facilmente progetti che contengono sia file TypeScript che JavaScript. Per altre informazioni, vedere https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "Aggiungere '{0}' alla dichiarazione di importazione esistente da \"{1}\"", + "Add_async_modifier_to_containing_function_90029": "Aggiungere il modificatore async alla funzione contenitore", + "Add_index_signature_for_property_0_90017": "Aggiungere la firma dell'indice per la proprietà '{0}'", + "Add_missing_super_call_90001": "Aggiungere la chiamata mancante a 'super()'", + "Add_this_to_unresolved_variable_90008": "Aggiungere 'this.' alla variabile non risolta", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Aggiungere un file tsconfig.json per organizzare più facilmente progetti che contengono sia file TypeScript che JavaScript. Per altre informazioni, vedere https://aka.ms/tsconfig.", "Additional_Checks_6176": "Controlli aggiuntivi", "Advanced_Options_6178": "Opzioni avanzate", "All_declarations_of_0_must_have_identical_modifiers_2687": "Tutte le dichiarazioni di '{0}' devono contenere modificatori identici.", @@ -111,12 +114,12 @@ "An_accessor_cannot_be_declared_in_an_ambient_context_1086": "Non è possibile dichiarare una funzione di accesso in un contesto di ambiente.", "An_accessor_cannot_have_type_parameters_1094": "Una funzione di accesso non può contenere parametri di tipo.", "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234": "Una dichiarazione di modulo di ambiente è consentita solo al primo livello in un file.", - "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Un operando aritmetico deve essere di tipo 'any', 'number' o un tipo di enum.", + "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Un operando aritmetico deve essere di tipo 'any', 'number' o un tipo di enumerazione.", "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705": "Con una funzione o un metodo asincrono in ES5/ES3 è necessario il costruttore 'Promise'. Assicurarsi che sia presente una dichiarazione per il costruttore 'Promise' oppure includere 'ES2015' nell'opzione `--lib`.", "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057": "Una funzione o un metodo asincrono deve includere un tipo restituito awaitable valido.", "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697": "Un metodo o una funzione asincrona deve restituire un elemento 'Promise'. Assicurarsi che sia presente una dichiarazione per 'Promise' oppure includere 'ES2015' nell'opzione `--lib`.", "An_async_iterator_must_have_a_next_method_2519": "Un iteratore asincrono deve contenere un metodo 'next()'.", - "An_enum_member_cannot_have_a_numeric_name_2452": "Il nome di un membro enum non può essere numerico.", + "An_enum_member_cannot_have_a_numeric_name_2452": "Il nome di un membro di enumerazione non può essere numerico.", "An_export_assignment_can_only_be_used_in_a_module_1231": "È possibile usare un'assegnazione di esportazione solo in un modulo.", "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309": "Non è possibile usare un'assegnazione di esportazione in un modulo con altri elementi esportati.", "An_export_assignment_cannot_be_used_in_a_namespace_1063": "Non è possibile usare un'assegnazione di esportazione in uno spazio dei nomi.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Un parametro della firma dell'indice non può contenere un modificatore di accessibilità.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Un parametro della firma dell'indice non può contenere un inizializzatore.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "Un parametro della firma dell'indice deve contenere un'annotazione di tipo.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Un tipo di parametro della firma dell'indice non può essere un alias di tipo. Provare a scrivere '[{0}: {1}]: {2}'.", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Un tipo di parametro della firma dell'indice non può essere un tipo di unione. Provare a usare un tipo di oggetto con mapping.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Il tipo di un parametro della firma dell'indice deve essere 'string' o 'number'.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Un'interfaccia può estendere solo un identificatore/nome qualificato con argomenti tipo facoltativi.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Un'interfaccia può estendere solo una classe o un'altra interfaccia.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "È prevista una cifra binaria.", "Binding_element_0_implicitly_has_an_1_type_7031": "L'elemento di binding '{0}' contiene implicitamente un tipo '{1}'.", "Block_scoped_variable_0_used_before_its_declaration_2448": "La variabile con ambito blocco '{0}' è stata usata prima di essere stata dichiarata.", - "Call_decorator_expression_90028": "Chiama l'espressione Decorator.", + "Call_decorator_expression_90028": "Chiamare l'espressione Decorator", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "La firma di chiamata, in cui manca l'annotazione di tipo restituito, contiene implicitamente un tipo restituito 'any'.", "Call_target_does_not_contain_any_signatures_2346": "La destinazione della chiamata non contiene alcuna firma.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Non è possibile accedere a '{0}.{1}' perché '{0}' è un tipo ma non uno spazio dei nomi. Si intendeva recuperare il tipo della proprietà '{1}' in '{0}' con '{0}[\"{1}\"]'?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Non è possibile importare file di dichiarazione di tipo. Provare a importare '{0}' invece di '{1}'.", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Non è possibile inizializzare la variabile con ambito esterna '{0}' nello stesso ambito della dichiarazione con ambito del blocco '{1}'.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Non è possibile richiamare un'espressione al cui tipo manca una firma di chiamata. Per il tipo '{0}' non esistono firme di chiamata compatibili.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Non è possibile richiamare un oggetto che è probabilmente 'null'.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Non è possibile richiamare un oggetto che è probabilmente 'null' o 'undefined'.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Non è possibile richiamare un oggetto che è probabilmente 'undefined'.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "Non è possibile riesportare un tipo quando è stato specificato il flag '--isolatedModules'.", "Cannot_read_file_0_Colon_1_5012": "Non è possibile leggere il file '{0}': {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "Non è possibile dichiarare di nuovo la variabile con ambito blocco '{0}'.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Non è possibile scrivere il file '{0}' perché sovrascriverebbe il file di input.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "La variabile della clausola catch non può contenere un'annotazione di tipo.", "Catch_clause_variable_cannot_have_an_initializer_1197": "La variabile della clausola catch non può contenere un inizializzatore.", - "Change_0_to_1_90014": "Cambia '{0}' in '{1}'.", - "Change_extends_to_implements_90003": "Cambia 'extends' in 'implements'.", - "Change_spelling_to_0_90022": "Modificare l'ortografia in '{0}'.", + "Change_0_to_1_90014": "Modificare '{0}' in '{1}'", + "Change_extends_to_implements_90003": "Cambiare 'extends' in 'implements'", + "Change_spelling_to_0_90022": "Modificare l'ortografia in '{0}'", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Verrà verificato se '{0}' è il prefisso di corrispondenza più lungo per '{1}' - '{2}'.", "Circular_definition_of_import_alias_0_2303": "Definizione circolare dell'alias di importazione '{0}'.", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "È stata rilevata una circolarità durante la risoluzione della configurazione: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "La classe '{0}' definisce '{1}' come funzione di membro di istanza, mentre la classe estesa '{2}' la definisce come proprietà di membro di istanza.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "La classe '{0}' definisce '{1}' come proprietà di membro di istanza, mentre la classe estesa '{2}' la definisce come funzione di membro di istanza.", "Class_0_incorrectly_extends_base_class_1_2415": "La classe '{0}' estende in modo errato la classe di base '{1}'.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "La classe '{0}' implementa in modo errato la classe '{1}'. Si intendeva estendere '{1}' ed ereditarne i membri come sottoclasse?", "Class_0_incorrectly_implements_interface_1_2420": "La classe '{0}' implementa in modo errato l'interfaccia '{1}'.", "Class_0_used_before_its_declaration_2449": "La classe '{0}' è stata usata prima di essere stata dichiarata.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Le dichiarazioni di classe non possono contenere più di un tag `@augments` o `@extends`.", @@ -230,7 +239,7 @@ "Classes_containing_abstract_methods_must_be_marked_abstract_2514": "Le classi che contengono metodi astratti devono essere contrassegnate come astratte.", "Command_line_Options_6171": "Opzioni della riga di comando", "Compilation_complete_Watching_for_file_changes_6042": "Compilazione completata. Verranno individuate le modifiche ai file.", - "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020": "Compila il progetto di cui è stato specificato il percorso del file di configurazione o di una cartella contenente un file 'tsconfig.json'.", + "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020": "Compila il progetto in base al percorso del file di configurazione o della cartella contenente un file 'tsconfig.json'.", "Compiler_option_0_expects_an_argument_6044": "Con l'opzione '{0}' del compilatore è previsto un argomento.", "Compiler_option_0_requires_a_value_of_type_1_5024": "Con l'opzione '{0}' del compilatore è richiesto un valore di tipo {1}.", "Computed_property_names_are_not_allowed_in_enums_1164": "I nomi di proprietà calcolati non sono consentiti nelle enumerazioni.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Il file contenitore non è specificato e non è possibile determinare la directory radice. La ricerca nella cartella 'node_modules' verrà ignorata.", "Convert_function_0_to_class_95002": "Converti la funzione '{0}' in classe", "Convert_function_to_an_ES2015_class_95001": "Converti la funzione in una classe ES2015", + "Convert_to_ES6_module_95017": "Converti in modulo ES6", "Convert_to_default_import_95013": "Converti nell'importazione predefinita", "Corrupted_locale_file_0_6051": "Il file delle impostazioni locali {0} è danneggiato.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Non è stato trovato alcun file di dichiarazione per il modulo '{0}'. A '{1}' è assegnato implicitamente un tipo 'any'.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "È prevista la dichiarazione.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Il nome della dichiarazione è in conflitto con l'identificatore globale predefinito '{0}'.", "Declaration_or_statement_expected_1128": "È prevista la dichiarazione o l'istruzione.", - "Declare_method_0_90023": "Dichiarare il metodo '{0}'.", - "Declare_property_0_90016": "Dichiarare la proprietà '{0}'.", - "Declare_static_method_0_90024": "Dichiarare il metodo statico '{0}'.", - "Declare_static_property_0_90027": "Dichiarare la proprietà statica '{0}'.", + "Declare_method_0_90023": "Dichiarare il metodo '{0}'", + "Declare_property_0_90016": "Dichiarare la proprietà '{0}'", + "Declare_static_method_0_90024": "Dichiarare il metodo statico '{0}'", + "Declare_static_property_0_90027": "Dichiarare la proprietà statica '{0}'", "Decorators_are_not_valid_here_1206": "In questo punto le espressioni Decorator non sono valide.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Non è possibile applicare le espressioni Decorator a più funzioni di accesso get/set con lo stesso nome.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "L'esportazione predefinita del modulo contiene o usa il nome privato '{0}'.", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Deprecata] In alternativa, usare '--skipLibCheck'. Ignora il controllo del tipo dei file di dichiarazione delle librerie predefinite.", "Digit_expected_1124": "È prevista la cifra.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "La directory '{0}' non esiste. Tutte le ricerche che la interessano verranno ignorate.", - "Disable_checking_for_this_file_90018": "Disabilita la verifica per questo file.", + "Disable_checking_for_this_file_90018": "Disabilitare la verifica per questo file", "Disable_size_limitations_on_JavaScript_projects_6162": "Disabilita le dimensioni relative alle dimensioni per i progetti JavaScript.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Disabilitare il controllo tassativo delle firme generiche nei tipi funzione.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "Non consente riferimenti allo stesso file in cui le maiuscole/minuscole vengono usate in modo incoerente.", @@ -275,7 +285,7 @@ "Do_not_emit_outputs_6010": "Non crea output.", "Do_not_emit_outputs_if_any_errors_were_reported_6008": "Non crea output se sono stati restituiti errori.", "Do_not_emit_use_strict_directives_in_module_output_6112": "Non crea direttive 'use strict' nell'output del modulo.", - "Do_not_erase_const_enum_declarations_in_generated_code_6007": "Non cancella le dichiarazioni enum const nel codice generato.", + "Do_not_erase_const_enum_declarations_in_generated_code_6007": "Non cancella le dichiarazioni di enumerazione const nel codice generato.", "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157": "Non genera funzioni di supporto personalizzate, come '__extends', nell'output compilato.", "Do_not_include_the_default_library_file_lib_d_ts_6158": "Non include il file di libreria predefinito (lib.d.ts).", "Do_not_report_errors_on_unreachable_code_6077": "Non segnala gli errori in caso di codice non raggiungibile.", @@ -302,20 +312,22 @@ "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015": "L'elemento contiene implicitamente un tipo 'any' perché l'espressione di indice non è di tipo 'number'.", "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017": "L'elemento contiene implicitamente un tipo 'any' perché al tipo '{0}' non è assegnata alcuna firma dell'indice.", "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164": "Crea un BOM (Byte Order Mark) UTF-8 all'inizio dei file di output.", - "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151": "Crea un unico file con i mapping d origine invece di file separati.", + "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151": "Crea un unico file con i mapping di origine invece di file separati.", "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152": "Crea l'origine unitamente alle mappe di origine all'interno di un unico file. Richiede l'impostazione di '--inlineSourceMap' o '--sourceMap'.", "Enable_all_strict_type_checking_options_6180": "Abilita tutte le opzioni per i controlli del tipo strict.", - "Enable_strict_checking_of_function_types_6186": "Abilitare il controllo tassativo dei tipi funzione.", + "Enable_strict_checking_of_function_types_6186": "Abilita il controllo tassativo dei tipi funzione.", "Enable_strict_checking_of_property_initialization_in_classes_6187": "Abilita il controllo tassativo dell'inizializzazione delle proprietà nelle classi.", "Enable_strict_null_checks_6113": "Abilita i controlli strict Null.", "Enable_tracing_of_the_name_resolution_process_6085": "Abilita la traccia del processo di risoluzione dei nomi.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Abilita l'interoperabilità di creazione tra moduli ES e CommonJS tramite la creazione di oggetti spazio dei nomi per tutte le importazioni. Implica 'allowSyntheticDefaultImports'.", "Enables_experimental_support_for_ES7_async_functions_6068": "Abilita il supporto sperimentale per le funzioni asincrone di ES7.", "Enables_experimental_support_for_ES7_decorators_6065": "Abilita il supporto sperimentale per le espressioni Decorator di ES7.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Abilita il supporto sperimentale per la creazione dei metadati dei tipi per le espressioni Decorator.", "Enum_0_used_before_its_declaration_2450": "L'enumerazione '{0}' è stata usata prima di essere stata dichiarata.", - "Enum_declarations_must_all_be_const_or_non_const_2473": "Le dichiarazioni enum devono essere tutte const o tutte non const.", - "Enum_member_expected_1132": "È previsto il membro enum.", - "Enum_member_must_have_initializer_1061": "Il membro enum deve contenere l'inizializzatore.", + "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567": "È possibile unire dichiarazioni di enumerazione solo con lo spazio dei nomi o altre dichiarazioni di enumerazione.", + "Enum_declarations_must_all_be_const_or_non_const_2473": "Le dichiarazioni di enumerazione devono essere tutte const o tutte non const.", + "Enum_member_expected_1132": "È previsto il membro di enumerazione.", + "Enum_member_must_have_initializer_1061": "Il membro di enumerazione deve contenere l'inizializzatore.", "Enum_name_cannot_be_0_2431": "Il nome dell'enumerazione non può essere '{0}'.", "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535": "Il tipo di enumerazione '{0}' contiene membri i cui inizializzatori non sono valori letterali.", "Examples_Colon_0_6026": "Esempi: {0}", @@ -324,9 +336,9 @@ "Expected_0_arguments_but_got_1_2554": "Sono previsti {0} argomenti, ma ne sono stati ottenuti {1}.", "Expected_0_arguments_but_got_1_or_more_2556": "Sono previsti {0} argomenti, ma ne sono stati ottenuti più di {1}.", "Expected_0_type_arguments_but_got_1_2558": "Sono previsti {0} argomenti tipo, ma ne sono stati ottenuti {1}.", - "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Sono previsti argomento tipo {0}. Per specificarli, usare un tag '@extends'.", + "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Sono previsti {0} argomenti tipo. Per specificarli, usare un tag '@extends'.", "Expected_at_least_0_arguments_but_got_1_2555": "Sono previsti almeno {0} argomenti, ma ne sono stati ottenuti {1}.", - "Expected_at_least_0_arguments_but_got_1_or_more_2557": "Sono previsti almeno {0} argomenti, ma ne sono stati ottenuti più di {1}.", + "Expected_at_least_0_arguments_but_got_1_or_more_2557": "Sono previsti almeno {0} argomenti, ma ne sono stati ottenuti {1} o più.", "Expected_corresponding_JSX_closing_tag_for_0_17002": "È previsto il tag di chiusura JSX corrispondente per '{0}'.", "Expected_corresponding_closing_tag_for_JSX_fragment_17015": "È previsto il tag di chiusura corrispondente per il frammento JSX.", "Expected_type_of_0_field_in_package_json_to_be_string_got_1_6105": "Il tipo previsto del campo '{0}' in 'package.json' è 'string', ma è stato ottenuto '{1}'.", @@ -352,7 +364,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "L'espressione viene risolta nella dichiarazione di variabile '_this', che è usata dal compilatore per acquisire il riferimento 'this'.", "Extract_constant_95006": "Estrarre la costante", "Extract_function_95005": "Estrarre la funzione", - "Extract_symbol_95003": "Estrarre il simbolo", "Extract_to_0_in_1_95004": "Estrarre in {0} in {1}", "Extract_to_0_in_1_scope_95008": "Estrarre in {0} nell'ambito {1}", "Extract_to_0_in_enclosing_scope_95007": "Estrarre in {0} nell'ambito che lo contiene", @@ -371,9 +382,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "Il nome file '{0}' differisce da quello già incluso '{1}' solo per l'uso di maiuscole/minuscole.", "File_name_0_has_a_1_extension_stripping_it_6132": "L'estensione del nome file '{0}' è '{1}' e verrà rimossa.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "La specifica del file non può contenere una directory padre ('..') inserita dopo un carattere jolly ('**') di directory ricorsiva: '{0}'.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "La specifica del file non può contenere più caratteri jolly ('**') di directory ricorsiva: '{0}'.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "La specifica del file non può terminare con caratteri jolly ('**') di directory ricorsiva: '{0}'.", "Found_package_json_at_0_6099": "Il file 'package.json' è stato trovato in '{0}'.", + "Found_package_json_at_0_Package_ID_is_1_6190": "Il file 'package.json' è stato trovato in '{0}'. L'ID pacchetto è '{1}'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Le dichiarazioni di funzione non sono consentite all'interno di blocchi in modalità strict quando la destinazione è 'ES3' o 'ES5'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Le dichiarazioni di funzione non sono consentite all'interno di blocchi in modalità strict quando la destinazione è 'ES3' o 'ES5'. Le definizioni di classe sono impostate automaticamente nella modalità strict.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Le dichiarazioni di funzione non sono consentite all'interno di blocchi in modalità strict quando la destinazione è 'ES3' o 'ES5'. I moduli sono impostati automaticamente nella modalità strict.", @@ -404,11 +415,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "È previsto un identificatore. '{0}' è una parola riservata in modalità strict. I moduli vengono impostati automaticamente in modalità strict.", "Identifier_expected_1003": "È previsto l'identificatore.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "È previsto un identificatore. '__esModule' è riservato come marcatore esportato durante la trasformazione di moduli ECMAScript.", - "Ignore_this_error_message_90019": "Ignora questo messaggio di errore.", - "Implement_inherited_abstract_class_90007": "Implementa la classe astratta ereditata.", - "Implement_interface_0_90006": "Implementa l'interfaccia '{0}'.", + "Ignore_this_error_message_90019": "Ignorare questo messaggio di errore", + "Implement_inherited_abstract_class_90007": "Implementare la classe astratta ereditata", + "Implement_interface_0_90006": "Implementare l'interfaccia '{0}'", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "La clausola implements della classe esportata '{0}' contiene o usa il nome privato '{1}'.", - "Import_0_from_module_1_90013": "Importa '{0}' dal modulo \"{1}\".", + "Import_0_from_module_1_90013": "Importare '{0}' dal modulo \"{1}\"", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Non è possibile usare l'assegnazione di importazione se destinata a moduli ECMAScript. Provare a usare 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' o un altro formato di modulo.", "Import_declaration_0_is_using_private_name_1_4000": "La dichiarazione di importazione '{0}' usa il nome privato '{1}'.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "La dichiarazione di importazione è in conflitto con la dichiarazione locale di '{0}'.", @@ -417,17 +428,17 @@ "Import_name_cannot_be_0_2438": "Il nome dell'importazione non può essere '{0}'.", "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439": "La dichiarazione di importazione o esportazione in una dichiarazione di modulo di ambiente non può fare riferimento al modulo tramite il nome di modulo relativo.", "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667": "Le importazioni non sono consentite negli aumenti di modulo. Provare a spostarle nel modulo esterno di inclusione.", - "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Nelle dichiarazioni enum dell'ambiente l'inizializzatore di membro deve essere un'espressione costante.", - "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "In un'enumerazione con più dichiarazioni solo una di queste può omettere un inizializzatore per il primo elemento enum.", - "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "Nelle dichiarazioni enum 'const' l'inizializzatore di membro deve essere un'espressione costante.", + "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Nelle dichiarazioni di enumerazione dell'ambiente l'inizializzatore di membro deve essere un'espressione costante.", + "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "In un'enumerazione con più dichiarazioni solo una di queste può omettere un inizializzatore per il primo elemento dell'enumerazione.", + "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "Nelle dichiarazioni di enumerazione 'const' l'inizializzatore di membro deve essere un'espressione costante.", "Index_signature_in_type_0_only_permits_reading_2542": "La firma dell'indice nel tipo '{0}' consente solo la lettura.", "Index_signature_is_missing_in_type_0_2329": "Nel tipo '{0}' manca la firma dell'indice.", "Index_signatures_are_incompatible_2330": "Le firme dell'indice sono incompatibili.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Le singole dichiarazioni della dichiarazione sottoposta a merge '{0}' devono essere tutte esportate o tutte locali.", - "Infer_parameter_types_from_usage_95012": "Deriva i tipi di parametro dall'utilizzo.", - "Infer_type_of_0_from_usage_95011": "Deriva il tipo di '{0}' dall'utilizzo.", - "Initialize_property_0_in_the_constructor_90020": "Inizializza la proprietà '{0}' nel costruttore.", - "Initialize_static_property_0_90021": "Inizializza la proprietà statica '{0}'.", + "Infer_parameter_types_from_usage_95012": "Derivare i tipi di parametro dall'utilizzo", + "Infer_type_of_0_from_usage_95011": "Derivare il tipo di '{0}' dall'utilizzo", + "Initialize_property_0_in_the_constructor_90020": "Inizializzare la proprietà '{0}' nel costruttore", + "Initialize_static_property_0_90021": "Inizializzare la proprietà statica '{0}'", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "L'inizializzatore della variabile del membro di istanza '{0}' non può fare riferimento all'identificatore '{1}' dichiarato nel costruttore.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "L'inizializzatore del parametro '{0}' non può fare riferimento all'identificatore '{1}' dichiarato dopo di esso.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "L'inizializzatore non fornisce alcun valore per questo elemento di binding e per quest'ultimo non è disponibile un valore predefinito.", @@ -484,7 +495,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "Le impostazioni locali devono essere nel formato o -, ad esempio, '{0}' o '{1}'.", "Longest_matching_prefix_for_0_is_1_6108": "Il prefisso di corrispondenza più lungo per '{0}' è '{1}'.", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Verrà eseguita la ricerca nella cartella 'node_modules'. Percorso iniziale: '{0}'.", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Imposta la chiamata a 'super()' come prima istruzione nel costruttore.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "Impostare la chiamata a 'super()' come prima istruzione nel costruttore", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "Il tipo di oggetto con mapping contiene implicitamente un tipo di modello 'any'.", "Member_0_implicitly_has_an_1_type_7008": "Il membro '{0}' contiene implicitamente un tipo '{1}'.", "Merge_conflict_marker_encountered_1185": "È stato rilevato un indicatore di conflitti di merge.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "La dichiarazione '{0}' sottoposta a merge non può includere una dichiarazione di esportazione predefinita. Provare ad aggiungere una dichiarazione 'export default {0}' distinta.", @@ -508,6 +520,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== Il nome del modulo '{0}' è stato risolto in '{1}'. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Il tipo di risoluzione del modulo non è specificato. Verrà usato '{0}'.", "Module_resolution_using_rootDirs_has_failed_6111": "La risoluzione del modulo con 'rootDirs' non è riuscita.", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Non sono consentiti più separatori numerici consecutivi.", "Multiple_constructor_implementations_are_not_allowed_2392": "Non è possibile usare più implementazioni di costruttore.", "NEWLINE_6061": "NUOVA RIGA", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "Le proprietà denominate '{0}' dei tipi '{1}' e '{2}' non sono identiche.", @@ -518,6 +531,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "L'espressione di classe non astratta non implementa il membro astratto ereditato '{0}' dalla classe '{1}'.", "Not_all_code_paths_return_a_value_7030": "Non tutti i percorsi del codice restituiscono un valore.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Il tipo di indice numerico '{0}' non è assegnabile al tipo di indice stringa '{1}'.", + "Numeric_separators_are_not_allowed_here_6188": "I separatori numerici non sono consentiti in questa posizione.", "Object_is_possibly_null_2531": "L'oggetto è probabilmente 'null'.", "Object_is_possibly_null_or_undefined_2533": "L'oggetto è probabilmente 'null' o 'undefined'.", "Object_is_possibly_undefined_2532": "L'oggetto è probabilmente 'undefined'.", @@ -534,6 +548,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "Con la parola chiave 'new' può essere chiamata solo una funzione void.", "Only_ambient_modules_can_use_quoted_names_1035": "I nomi delimitati si possono usare solo nei moduli di ambiente.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Unitamente a --{0} sono supportati solo i moduli 'amd' e 'system'.", + "Only_emit_d_ts_declaration_files_6014": "Crea solo i file di dichiarazione '.d.ts'.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Nella clausola 'extends' di una classe sono attualmente supportati solo identificatori/nomi qualificati con argomenti tipo facoltativi.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Con la parola chiave 'super' è possibile accedere solo ai metodi pubblico e protetto della classe di base.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Non è possibile applicare l'operatore '{0}' ai tipi '{1}' e '{2}'.", @@ -584,7 +599,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Il tipo di parametro del setter statico pubblico '{0}' della classe esportata contiene o usa il nome privato '{1}'.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Esegue l'analisi in modalità strict e crea la direttiva \"use strict\" per ogni file di origine.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Il criterio '{0}' deve contenere al massimo un carattere '*'.", - "Prefix_0_with_an_underscore_90025": "Anteporre un carattere di sottolineatura a '{0}'.", + "Prefix_0_with_an_underscore_90025": "Anteporre un carattere di sottolineatura a '{0}'", "Print_names_of_files_part_of_the_compilation_6155": "Stampa i nomi dei file che fanno parte della compilazione.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Stampa i nomi dei file generati che fanno parte della compilazione.", "Print_the_compiler_s_version_6019": "Stampa la versione del compilatore.", @@ -596,6 +611,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "La proprietà '{0}' non include alcun inizializzatore e non viene assolutamente assegnata nel costruttore.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "La proprietà '{0}' contiene implicitamente il tipo 'any', perché nella relativa funzione di accesso get manca un'annotazione di tipo restituito.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "La proprietà '{0}' contiene implicitamente il tipo 'any', perché nella relativa funzione di accesso set manca un'annotazione di tipo di parametro.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "La proprietà '{0}' nel tipo '{1}' non è assegnabile alla stessa proprietà nel tipo di base '{2}'.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "La proprietà '{0}' nel tipo '{1}' non è assegnabile al tipo '{2}'.", "Property_0_is_declared_but_its_value_is_never_read_6138": "La proprietà '{0}' è dichiarata, ma il suo valore non viene mai letto.", "Property_0_is_incompatible_with_index_signature_2530": "La proprietà '{0}' non è compatibile con la firma dell'indice.", @@ -634,7 +650,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Genera un errore in caso di espressioni o dichiarazioni con tipo 'any' implicito.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Genera un errore in caso di espressioni 'this con un tipo 'any' implicito.", "Redirect_output_structure_to_the_directory_6006": "Reindirizza la struttura di output alla directory.", - "Remove_declaration_for_Colon_0_90004": "Rimuovi la dichiarazione per {0}.", + "Remove_declaration_for_Colon_0_90004": "Rimuovere la dichiarazione per '{0}'", + "Replace_import_with_0_95015": "Sostituire l'importazione con '{0}'.", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Segnala l'errore quando non tutti i percorsi del codice nella funzione restituiscono un valore.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Segnala errori per i casi di fallthrough nell'istruzione switch.", "Report_errors_in_js_files_8019": "Segnala gli errori presenti nei file con estensione js.", @@ -674,13 +691,13 @@ "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055": "Il tipo restituito del metodo pubblico della classe esportata contiene o usa il nome privato '{0}'.", "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038": "Il tipo restituito del getter di proprietà pubblico '{0}' della classe esportata contiene o usa il nome '{1}' del modulo esterno '{2}', ma non può essere rinominato.", "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039": "Il tipo restituito del getter di proprietà pubblico '{0}' della classe esportata contiene o usa il nome '{1}' del modulo privato '{2}'.", - "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040": "Il tipo restituito del getter di proprietà pubblico '{0}' della classe esportata contiene o usa il nome privato '{1}'.", + "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040": "Il tipo restituito del getter statico pubblico '{0}' della classe esportata contiene o usa il nome privato '{1}'.", "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050": "Il tipo restituito del metodo statico pubblico della classe esportata contiene o usa il nome '{0}' del modulo esterno {1} ma non può essere rinominato.", "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051": "Il tipo restituito del metodo statico pubblico della classe esportata contiene o usa il nome '{0}' del modulo privato '{1}'.", "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "Il tipo restituito del metodo statico pubblico della classe esportata contiene o usa il nome privato '{0}'.", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Le risoluzioni dei moduli con origine in '{0}' verranno riutilizzate perché sono invariate rispetto al vecchio programma.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "La risoluzione del modulo '{0}' del vecchio programma verrà riutilizzata nel file '{1}'.", - "Rewrite_as_the_indexed_access_type_0_90026": "Riscrivere come tipo di accesso indicizzato '{0}'.", + "Rewrite_as_the_indexed_access_type_0_90026": "Riscrivere come tipo di accesso indicizzato '{0}'", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Non è possibile determinare la directory radice. I percorsi di ricerca primaria verranno ignorati.", "STRATEGY_6039": "STRATEGIA", "Scoped_package_detected_looking_in_0_6182": "Il pacchetto con ambito è stato rilevato. Verrà eseguita una ricerca in '{0}'", @@ -693,9 +710,9 @@ "Source_Map_Options_6175": "Opzioni per mapping di origine", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "La firma di overload specializzata non è assegnabile a una firma non specializzata.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "L'identificatore dell'importazione dinamica non può essere l'elemento spread.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "Specifica la versione di destinazione di ECMAScript: 'ES3' (predefinita), 'ES5', 'ES2015', 'ES2016', 'ES2017' o 'ESNEXT'.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "Specificare la versione di destinazione di ECMAScript: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' o 'ESNEXT'.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "Specifica la generazione del codice JSX: 'preserve', 'react-native' o 'react'.", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Specifica i file di libreria da includere nella compilazione: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Specificare i file di libreria da includere nella compilazione.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Consente di specificare il tipo di generazione del codice del modulo, ovvero 'none', commonjs', 'amd', 'system', 'umd', 'es2015' o 'ESNext'.", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Specifica la strategia di risoluzione del modulo: 'node' (Node.js) o 'classic' (TypeScript prima della versione 1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Consente di specificare la funzione della factory JSX da usare quando la destinazione è la creazione JSX 'react', ad esempio 'React.createElement' o 'h'.", @@ -705,6 +722,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Specifica la directory radice dei file di input. Usare per controllare la struttura della directory di output con --outDir.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "L'operatore Spread in espressioni 'new' è disponibile solo se destinato a ECMAScript 5 e versioni successive.", "Spread_types_may_only_be_created_from_object_types_2698": "È possibile creare tipi spread solo da tipi di oggetto.", + "Starting_compilation_in_watch_mode_6031": "Avvio della compilazione in modalità espressione di controllo...", "Statement_expected_1129": "È prevista l'istruzione.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Le istruzioni non sono consentite in contesti di ambiente.", "Static_members_cannot_reference_class_type_parameters_2302": "I membri statici non possono fare riferimento a parametri di tipo classe.", @@ -765,7 +783,7 @@ "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359": "La parte destra di un'espressione 'instanceof' deve essere di tipo 'any' o di un tipo assegnabile al tipo di interfaccia 'Function'.", "The_specified_path_does_not_exist_Colon_0_5058": "Il percorso specificato non esiste: '{0}'.", "The_target_of_an_assignment_must_be_a_variable_or_a_property_access_2541": "La destinazione di un'assegnazione deve essere una variabile o un accesso a proprietà.", - "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701": "La destinazione di un'assegnazione rimanente dell'oggetto deve essere una variabile o un accesso a proprietà.", + "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701": "La destinazione di un'assegnazione REST di oggetto deve essere una variabile o un accesso a proprietà.", "The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1_2684": "Il contesto 'this' del tipo '{0}' non è assegnabile a quello 'this' di tipo '{1}' del metodo.", "The_this_types_of_each_signature_are_incompatible_2685": "I tipi 'this' delle singole firme non sono compatibili.", "The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_typ_2453": "Non è possibile dedurre l'argomento tipo per il parametro di tipo '{0}' dall'utilizzo. Provare a specificare gli argomenti tipo in modo esplicito.", @@ -797,7 +815,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Il tipo '{0}' non è un tipo matrice o stringa oppure non contiene un metodo '[Symbol.iterator]()' che restituisce un iteratore.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Il tipo '{0}' non è un tipo matrice oppure non contiene un metodo '[Symbol.iterator]()' che restituisce un iteratore.", "Type_0_is_not_assignable_to_type_1_2322": "Il tipo '{0}' non è assegnabile al tipo '{1}'.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "Il tipo '{0}' non è assegnabile al tipo '{1}'. Sono presenti due tipi diversi con questo nome, che però non sono correlati.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "Il tipo '{0}' non è assegnabile al tipo '{1}'. Sono presenti due tipi diversi con questo nome, che però non sono correlati.", "Type_0_is_not_comparable_to_type_1_2678": "Il tipo '{0}' non è confrontabile con il tipo '{1}'.", "Type_0_is_not_generic_2315": "Il tipo '{0}' non è generico.", "Type_0_provides_no_match_for_the_signature_1_2658": "Il tipo '{0}' non fornisce corrispondenze per la firma '{1}'.", @@ -858,6 +876,7 @@ "Unterminated_template_literal_1160": "Valore letterale di modello senza terminazione.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Le chiamate di funzione non tipizzate potrebbero non accettare argomenti tipo.", "Unused_label_7028": "Etichetta non usata.", + "Use_synthetic_default_member_95016": "Usare il membro 'default' sintetico.", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "L'uso di una stringa in un'istruzione 'for...of' è supportato solo in ECMAScript 5 e versioni successive.", "VERSION_6036": "VERSIONE", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "Il valore di tipo '{0}' non ha proprietà in comune con il tipo '{1}'. Si intendeva chiamarlo?", @@ -911,11 +930,11 @@ "class_expressions_are_not_currently_supported_9003": "Le espressioni 'class' non sono attualmente supportate.", "const_declarations_can_only_be_declared_inside_a_block_1156": "Le dichiarazioni 'const' possono essere dichiarate solo all'interno di un blocco.", "const_declarations_must_be_initialized_1155": "Le dichiarazioni 'const' devono essere inizializzate.", - "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "L'inizializzatore di membro enum 'const' è stato valutato come valore non finito.", - "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "L'inizializzatore di membro enum 'const' è stato valutato come valore non consentito 'NaN'.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Le enumerazioni 'const' possono essere usate solo in espressioni di accesso a proprietà o indice oppure nella parte destra di un'assegnazione di esportazione o di una dichiarazione di importazione.", + "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "L'inizializzatore del membro di enumerazione 'const' è stato valutato come valore non finito.", + "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "L'inizializzatore del membro di enumerazione 'const' è stato valutato come valore non consentito 'NaN'.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Le enumerazioni 'const' possono essere usate solo in espressioni di accesso a proprietà o indice oppure nella parte destra di un'assegnazione di esportazione, di una dichiarazione di importazione o di una query su tipo.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "Non è possibile chiamare 'delete' su un identificatore in modalità strict.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum declarations' può essere usato solo in un file con estensione ts.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Le dichiarazioni 'enum' possono essere usate solo in un file con estensione ts.", "export_can_only_be_used_in_a_ts_file_8003": "'export=' può essere usato solo in un file con estensione ts.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Non è possibile applicare il modificatore 'export' a moduli di ambiente e aumenti di modulo perché sono sempre visibili.", "extends_clause_already_seen_1172": "La clausola 'extends' è già presente.", @@ -928,6 +947,7 @@ "implements_clause_already_seen_1175": "La clausola 'implements' è già presente.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "'implements clauses' può essere usato solo in un file con estensione ts.", "import_can_only_be_used_in_a_ts_file_8002": "'import ... =' può essere usato solo in un file con estensione ts.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Le dichiarazioni 'infer' sono consentite solo nella clausola 'extends' di un tipo condizionale.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "'interface declarations' può essere usato solo in un file con estensione ts.", "let_declarations_can_only_be_declared_inside_a_block_1157": "Le dichiarazioni 'let' possono essere dichiarate solo all'interno di un blocco.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "Non è consentito usare 'let' come nome in dichiarazioni 'let' o 'const'.", diff --git a/lib/ja/diagnosticMessages.generated.json b/lib/ja/diagnosticMessages.generated.json index 45d39e6d00b..b1c1cf848f6 100644 --- a/lib/ja/diagnosticMessages.generated.json +++ b/lib/ja/diagnosticMessages.generated.json @@ -12,11 +12,11 @@ "A_class_member_cannot_have_the_0_keyword_1248": "クラス メンバーに '{0}' キーワードを指定することはできません。", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "コンマ式は計算されたプロパティ名では使用できません。", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "計算されたプロパティ名は、型パラメーターをそれを含む型から参照することはできません。", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "クラス プロパティ宣言内の計算されたプロパティ名は、型がリテラル型または '一意のシンボル' 型の式を参照する必要があります。", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "メソッド オーバーロード内の計算されたプロパティ名は、型がリテラル型または '一意のシンボル' 型の式を参照する必要があります。", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "型リテラル内の計算されたプロパティ名は、型がリテラル型または '一意のシンボル' 型の式を参照する必要があります。", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "環境コンテキスト内の計算されたプロパティ名は、型がリテラル型または '一意のシンボル' 型の式を参照する必要があります。", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "インターフェイス内の計算されたプロパティ名は、型がリテラル型または '一意のシンボル' 型の式を参照する必要があります。", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "クラス プロパティ宣言内の計算されたプロパティ名は、型がリテラル型または 'unique symbol' 型の式を参照する必要があります。", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "メソッド オーバーロード内の計算されたプロパティ名は、型がリテラル型または 'unique symbol' 型の式を参照する必要があります。", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "型リテラル内の計算されたプロパティ名は、型がリテラル型または 'unique symbol' 型の式を参照する必要があります。", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "環境コンテキスト内の計算されたプロパティ名は、型がリテラル型または 'unique symbol' 型の式を参照する必要があります。", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "インターフェイス内の計算されたプロパティ名は、型がリテラル型または 'unique symbol' 型の式を参照する必要があります。", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "計算されたプロパティ名は 'string' 型、'number' 型、'symbol' 型、または 'any' 型のいずれかでなければなりません。", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "形式 '{0}' の計算されたプロパティ名は 'symbol' 型でなければなりません。", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "const 列挙型メンバーは、文字列リテラルを使用してのみアクセスできます。", @@ -42,22 +42,24 @@ "A_generator_cannot_have_a_void_type_annotation_2505": "ジェネレーターに 'void' 型の注釈を指定することはできません。", "A_get_accessor_cannot_have_parameters_1054": "'get' アクセサーにパラメーターを指定することはできません。", "A_get_accessor_must_return_a_value_2378": "'get' アクセサーは値を返す必要があります。", - "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "enum 宣言のメンバー初期化子は、他の enum で定義されたメンバーを含め、その後で宣言されたメンバーを参照できません。", + "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "列挙型宣言のメンバー初期化子は、他の列挙型で定義されたメンバーを含め、その後で宣言されたメンバーを参照できません。", "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": "mixin クラスには、型 'any[]' の単一の rest パラメーターを持つコンストラクターが必要です。", "A_module_cannot_have_multiple_default_exports_2528": "モジュールに複数の既定のエクスポートを含めることはできません。", "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "名前空間宣言は、それとマージするクラスや関数と異なるファイルに配置できません。", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "名前空間宣言は、それとマージするクラスや関数より前に配置できません。", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "名前空間宣言は、名前空間かモジュールでのみ使用できます。", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "名前空間スタイルのインポートを呼び出したり、構築したりすることはできません。実行時にエラーが発生する原因となります。", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "パラメーター初期化子は、関数またはコンストラクターの実装でのみ指定できます。", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "パラメーター プロパティは、rest パラメーターを使用して宣言することはできません。", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "パラメーター プロパティは、コンストラクターの実装でのみ指定できます。", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "パラメーター プロパティは、バインド パターンを使用して宣言することはできません。", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "'拡張' オプション内のパスは相対パスまたはルート パスである必要がありますが、'{0}' の場合は、その必要はありません。", "A_promise_must_have_a_then_method_1059": "Promise には 'then' メソッドが必要です。", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "型が '一意のシンボル' 型のクラスのプロパティは、'static' と 'readonly' の両方である必要があります。", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "型が '一意のシンボル' 型のインターフェイスまたは型リテラルのプロパティは、'readonly' である必要があります。", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "型が 'unique symbol' 型のクラスのプロパティは、'static' と 'readonly' の両方である必要があります。", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "型が 'unique symbol' 型のインターフェイスまたは型リテラルのプロパティは、'readonly' である必要があります。", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "必須パラメーターを省略可能なパラメーターの後に指定することはできません。", "A_rest_element_cannot_contain_a_binding_pattern_2501": "rest 要素にバインド パターンを含めることはできません。", + "A_rest_element_cannot_have_a_property_name_2566": "rest 要素にプロパティ名を指定することはできません。", "A_rest_element_cannot_have_an_initializer_1186": "rest 要素に初期化子を指定することはできません。", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "rest 要素は非構造化パターンの最後に指定する必要があります。", "A_rest_parameter_cannot_be_optional_1047": "rest パラメーターを省略可能にすることはできません。", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "型の述語は、バインド パターン内の要素 '{0}' を参照できません。", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "型の述語は、関数およびメソッドの戻り値の型の位置でのみ使用できます。", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "type 述語の型はそのパラメーターの型に割り当て可能である必要があります。", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "型が '一意のシンボル' 型の変数は、'const' である必要があります。", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "型が 'unique symbol' 型の変数は、'const' である必要があります。", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "'yield' 式は、ジェネレーター本文でのみ使用できます。", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "クラス '{1}' の抽象メソッド '{0}' には super 式を介してアクセスできません。", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "抽象メソッドは抽象クラス内でのみ使用できます。", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "アクセシビリティ修飾子は既に存在します。", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "アクセサーは ECMAScript 5 以上をターゲットにする場合にのみ使用できます。", "Accessors_must_both_be_abstract_or_non_abstract_2676": "アクセサーはどちらも抽象または非抽象である必要があります。", - "Add_0_to_existing_import_declaration_from_1_90015": "\"{1}\" から既存のインポート宣言に '{0}' を追加します。", - "Add_index_signature_for_property_0_90017": "プロパティ '{0}' のインデックス シグネチャを追加します。", - "Add_missing_super_call_90001": "欠落している 'super()' 呼び出しを追加します。", - "Add_this_to_unresolved_variable_90008": "'this.' を未解決の変数に追加します。", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "tsconfig.json ファイルを追加すると、TypeScript ファイルと JavaScript ファイルの両方を含むプロジェクトを整理できます。詳細については、https://aka.ms/tsconfig をご覧ください。", + "Add_0_to_existing_import_declaration_from_1_90015": "\"{1}\" から既存のインポート宣言に '{0}' を追加する", + "Add_async_modifier_to_containing_function_90029": "含まれている関数に async 修飾子を追加します", + "Add_index_signature_for_property_0_90017": "プロパティ '{0}' のインデックス シグネチャを追加する", + "Add_missing_super_call_90001": "欠落している 'super()' 呼び出しを追加する", + "Add_this_to_unresolved_variable_90008": "'this.' を未解決の変数に追加する", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "tsconfig.json ファイルを追加すると、TypeScript ファイルと JavaScript ファイルの両方を含むプロジェクトを整理できます。詳細については、https://aka.ms/tsconfig をご覧ください。", "Additional_Checks_6176": "追加のチェック", "Advanced_Options_6178": "詳細オプション", "All_declarations_of_0_must_have_identical_modifiers_2687": "'{0}' のすべての宣言には、同一の修飾子が必要です。", @@ -116,7 +119,7 @@ "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057": "非同期関数または非同期メソッドには、有効で待機可能な戻り値の型を指定する必要があります。", "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697": "非同期関数またはメソッドは 'Promise' を返す必要があります。'Promise' の宣言があること、または `--lib` オプションに 'ES2015' を含めていることを確認してください。", "An_async_iterator_must_have_a_next_method_2519": "非同期反復子には 'next()' メソッドが必要です。", - "An_enum_member_cannot_have_a_numeric_name_2452": "列挙メンバーに数値名を含めることはできません。", + "An_enum_member_cannot_have_a_numeric_name_2452": "列挙型メンバーに数値名を含めることはできません。", "An_export_assignment_can_only_be_used_in_a_module_1231": "エクスポートの割り当てはモジュールでのみ使用可能です。", "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309": "エクスポートの割り当ては、エクスポートされた他の要素を含むモジュールでは使用できません。", "An_export_assignment_cannot_be_used_in_a_namespace_1063": "エクスポートの割り当ては、名前空間では使用できません。", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "インデックス シグネチャのパラメーターにアクセシビリティ修飾子を指定することはできません。", "An_index_signature_parameter_cannot_have_an_initializer_1020": "インデックス シグネチャのパラメーターに初期化子を指定することはできません。", "An_index_signature_parameter_must_have_a_type_annotation_1022": "インデックス シグネチャのパラメーターには型の注釈が必要です。", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "インデックス シグネチャのパラメーターの型を型のエイリアスにすることはできません。代わりに、'[{0}: {1}]: {2}' と記述することをご検討ください。", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "インデックス シグネチャのパラメーターの型を共用体型にすることはできません。代わりに、マップされたオブジェクト型の使用をご検討ください。", "An_index_signature_parameter_type_must_be_string_or_number_1023": "インデックス シグネチャのパラメーターの型は 'string' または 'number' でなければなりません。", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "インターフェイスが拡張するのは、オプションの型引数が指定された識別子/完全修飾名のみです。", "An_interface_may_only_extend_a_class_or_another_interface_2312": "インターフェイスで拡張できるのは、クラスまたは他のインターフェイスのみです。", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "2 進の数字が必要です。", "Binding_element_0_implicitly_has_an_1_type_7031": "バインド要素 '{0}' には暗黙的に '{1}' 型が含まれます。", "Block_scoped_variable_0_used_before_its_declaration_2448": "ブロック スコープの変数 '{0}' が、宣言の前に使用されています。", - "Call_decorator_expression_90028": "デコレーター式を呼び出します。", + "Call_decorator_expression_90028": "デコレーター式を呼び出す", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "戻り値の型の注釈がない呼び出しシグネチャの戻り値の型は、暗黙的に 'any' になります。", "Call_target_does_not_contain_any_signatures_2346": "呼び出しターゲットにシグネチャが含まれていません。", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "'{0}.{1}' にアクセスできません。'{0}' は型で、名前空間ではありません。'{0}[\"{1}\"]' で '{0}' のプロパティ '{1}' の型を取得するつもりでしたか?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "型宣言ファイルをインポートできません。'{1}' の代わりに '{0}' をインポートすることを検討してください。", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "ブロック スコープ宣言 '{1}' と同じスコープ内の外部スコープ変数 '{0}' を初期化できません。", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "型に呼び出しシグネチャがない式を呼び出すことはできません。型 '{0}' には互換性のある呼び出しシグネチャがありません。", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "'null' の可能性があるオブジェクトを呼び出すことはできません。", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "'null' または 'undefined' の可能性があるオブジェクトを呼び出すことはできません。", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "'undefined' の可能性があるオブジェクトを呼び出すことはできません。", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "0'--isolatedModules' フラグが指定されている場合、型を再エクスポートできません。", "Cannot_read_file_0_Colon_1_5012": "ファイル '{0}' を読み取れません: {1}。", "Cannot_redeclare_block_scoped_variable_0_2451": "ブロック スコープの変数 '{0}' を再宣言することはできません。", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "入力ファイルを上書きすることになるため、ファイル '{0}' を書き込めません。", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "catch 句の変数に型の注釈を指定することはできません。", "Catch_clause_variable_cannot_have_an_initializer_1197": "catch 句の変数に初期化子を指定することはできません。", - "Change_0_to_1_90014": "'{0}' を '{1}' に変更します。", - "Change_extends_to_implements_90003": "'extends' を 'implements' に変更します。", - "Change_spelling_to_0_90022": "スペルを '{0}' に変更してください。", + "Change_0_to_1_90014": "'{0}' を '{1}' に変更する", + "Change_extends_to_implements_90003": "'extends' を 'implements' に変更する", + "Change_spelling_to_0_90022": "スペルを '{0}' に変更する", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "'{0}' が '{1}' - '{2}' の最長一致のプレフィックスであるかを確認しています。", "Circular_definition_of_import_alias_0_2303": "インポート エイリアス '{0}' の循環定義です。", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "構成: {0} の解決中に循環が検出されました", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "クラス '{0}' で定義されたインスタンス メンバー関数 '{1}' が、拡張されたクラス '{2}' ではインスタンス メンバー プロパティとして定義されています。", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "クラス '{0}' で定義されたインスタンス メンバー プロパティ '{1}' が、拡張されたクラス '{2}' ではインスタンス メンバー関数として定義されています。", "Class_0_incorrectly_extends_base_class_1_2415": "クラス '{0}' は基底クラス '{1}' を正しく拡張していません。", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "クラス '{0}' はクラス '{1}' を正しく実装していません。'{1}' を拡張し、そのメンバーをサブクラスとして継承しますか?", "Class_0_incorrectly_implements_interface_1_2420": "クラス '{0}' はインターフェイス '{1}' を正しく実装していません。", "Class_0_used_before_its_declaration_2449": "クラス '{0}' は宣言の前に使用されました。", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "クラス宣言で複数の '@augments' または `@extends` タグを使用することはできません。", @@ -233,8 +242,8 @@ "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020": "構成ファイルか、'tsconfig.json' を含むフォルダーにパスが指定されたプロジェクトをコンパイルします。", "Compiler_option_0_expects_an_argument_6044": "コンパイラ オプション '{0}' には引数が必要です。", "Compiler_option_0_requires_a_value_of_type_1_5024": "コンパイラ オプション '{0}' には {1} の型の値が必要です。", - "Computed_property_names_are_not_allowed_in_enums_1164": "計算されたプロパティ名は列挙では使用できません。", - "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": "文字列値のメンバーを持つ列挙では、計算値は許可されません。", + "Computed_property_names_are_not_allowed_in_enums_1164": "計算されたプロパティ名は列挙型では使用できません。", + "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": "文字列値のメンバーを持つ列挙型では、計算値は許可されません。", "Concatenate_and_emit_output_to_single_file_6001": "出力を連結して 1 つのファイルを生成します。", "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090": "'{0}' の定義が '{1}' および '{2}' で競合しています。競合を解決するには、このライブラリの特定バージョンのインストールをご検討ください。", "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013": "戻り値の型の注釈がないコンストラクト シグネチャの戻り値の型は、暗黙的に 'any' になります。", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "包含するファイルが指定されていないため、ルート ディレクトリを決定できません。'node_modules' フォルダーのルックアップをスキップします。", "Convert_function_0_to_class_95002": "関数 '{0}' をクラスに変換します", "Convert_function_to_an_ES2015_class_95001": "関数を ES2015 クラスに変換します", + "Convert_to_ES6_module_95017": "ES6 モジュールに変換します", "Convert_to_default_import_95013": "既定のインポートに変換する", "Corrupted_locale_file_0_6051": "ロケール ファイル {0} は破損しています。", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "モジュール '{0}' の宣言ファイルが見つかりませんでした。'{1}' は暗黙的に 'any' 型になります。", @@ -253,19 +263,19 @@ "Declaration_expected_1146": "宣言が必要です。", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "宣言名が組み込みのグローバル識別子 '{0}' と競合しています。", "Declaration_or_statement_expected_1128": "宣言またはステートメントが必要です。", - "Declare_method_0_90023": "メソッド '{0}' を宣言します。", - "Declare_property_0_90016": "プロパティ '{0}' を宣言します。", - "Declare_static_method_0_90024": "静的メソッド '{0}' を宣言します。", - "Declare_static_property_0_90027": "静的プロパティ '{0}' を宣言します。", + "Declare_method_0_90023": "メソッド '{0}' を宣言する", + "Declare_property_0_90016": "プロパティ '{0}' を宣言する", + "Declare_static_method_0_90024": "静的メソッド '{0}' を宣言する", + "Declare_static_property_0_90027": "静的プロパティ '{0}' を宣言する", "Decorators_are_not_valid_here_1206": "デコレーターはここでは無効です。", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "デコレーターを同じ名前の複数の get/set アクセサーに適用することはできません。", - "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "モジュールの既定エクスポートがプライベート名 '{0}' を使用しています。", + "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "モジュールの既定エクスポートがプライベート名 '{0}' を持っているか、使用しています。", "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084": "[非推奨] 代わりに '--jsxFactory' を使います。'react' JSX 発行を対象とするときに、createElement に対して呼び出されたオブジェクトを指定します", "Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file_6170": "[非推奨] 代わりに '--outFile' を使います。出力を連結して 1 つのファイルを生成します", "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[非推奨] 代わりに '--skipLibCheck' を使います。既定のライブラリ宣言ファイルの型チェックをスキップします。", "Digit_expected_1124": "数値が必要です", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "ディレクトリ '{0}' は存在していません。ディレクトリ内のすべての参照をスキップしています。", - "Disable_checking_for_this_file_90018": "このファイルのチェックを無効にします。", + "Disable_checking_for_this_file_90018": "このファイルのチェックを無効にする", "Disable_size_limitations_on_JavaScript_projects_6162": "JavaScript プロジェクトのサイズ制限を無効にします。", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "関数型の汎用シグネチャに対する厳密なチェックを無効にします。", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "同じファイルへの大文字小文字の異なる参照を許可しない。", @@ -275,7 +285,7 @@ "Do_not_emit_outputs_6010": "出力しないでください。", "Do_not_emit_outputs_if_any_errors_were_reported_6008": "エラーが報告される場合は、出力しないでください。", "Do_not_emit_use_strict_directives_in_module_output_6112": "モジュール出力で 'use strict' ディレクティブを生成しません。", - "Do_not_erase_const_enum_declarations_in_generated_code_6007": "生成されたコード内で const enum 宣言を消去しないでください。", + "Do_not_erase_const_enum_declarations_in_generated_code_6007": "生成されたコード内で const 列挙型宣言を消去しないでください。", "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157": "コンパイルされた出力で '__extends' などのカスタム ヘルパー関数を生成しないでください。", "Do_not_include_the_default_library_file_lib_d_ts_6158": "既定のライブラリ ファイル (lib.d.ts) を含めないでください。", "Do_not_report_errors_on_unreachable_code_6077": "到達できないコードに関するエラーを報告しない。", @@ -304,18 +314,19 @@ "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164": "出力ファイルの最初に UTF-8 バイト順マーク(BOM) を生成します。", "Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file_6151": "個々のファイルを持つ代わりに、複数のソース マップを含む単一ファイルを生成します。", "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152": "単一ファイル内で sourcemap と共にソースを生成します。'--inlineSourceMap' または '--sourceMap' を設定する必要があります。", - "Enable_all_strict_type_checking_options_6180": "strict 型チェックのオプションをすべて有効にします。", + "Enable_all_strict_type_checking_options_6180": "厳密な型チェックのオプションをすべて有効にします。", "Enable_strict_checking_of_function_types_6186": "関数の型の厳密なチェックを有効にします。", "Enable_strict_checking_of_property_initialization_in_classes_6187": "クラス内のプロパティの初期化の厳密なチェックを有効にします。", "Enable_strict_null_checks_6113": "厳格な null チェックを有効にします。", "Enable_tracing_of_the_name_resolution_process_6085": "名前解決の処理のトレースを有効にします。", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "すべてのインポートの名前空間オブジェクトを作成して、CommonJS と ES モジュール間の生成の相互運用性を有効にします。'allowSyntheticDefaultImports' を暗黙のうちに表します。", "Enables_experimental_support_for_ES7_async_functions_6068": "ES7 非同期関数用の実験的なサポートを有効にします。", "Enables_experimental_support_for_ES7_decorators_6065": "ES7 デコレーター用の実験的なサポートを有効にします。", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "デコレーター用の型メタデータを発行するための実験的なサポートを有効にします。", "Enum_0_used_before_its_declaration_2450": "列挙型 '{0}' は宣言の前に使用されました。", - "Enum_declarations_must_all_be_const_or_non_const_2473": "enum 宣言は、すべてが定数、またはすべてが非定数でなければなりません。", + "Enum_declarations_must_all_be_const_or_non_const_2473": "列挙型宣言は、すべてが定数、またはすべてが非定数でなければなりません。", "Enum_member_expected_1132": "列挙型メンバーが必要です。", - "Enum_member_must_have_initializer_1061": "列挙メンバーには初期化子が必要です。", + "Enum_member_must_have_initializer_1061": "列挙型メンバーには初期化子が必要です。", "Enum_name_cannot_be_0_2431": "列挙型の名前を '{0}' にすることはできません。", "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535": "列挙型 '{0}' に、リテラルではない初期化子を持つメンバーがあります。", "Examples_Colon_0_6026": "例: {0}", @@ -340,9 +351,9 @@ "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656": "エクスポートされた外部パッケージの型指定のファイル '{0}' はモジュールではありません。パッケージ定義を更新する場合は、パッケージの作成者にお問い合わせください。", "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654": "エクスポートされた外部パッケージの型指定のファイルにトリプルスラッシュ参照を含めることはできません。パッケージ定義を更新する場合は、パッケージの作成者にお問い合わせください。", "Exported_type_alias_0_has_or_is_using_private_name_1_4081": "エクスポートされた型のエイリアス '{0}' にプライベート名 '{1}' が付いているか、その名前を使用しています。", - "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023": "エクスポートされた変数 '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024": "エクスポートされた変数 '{0}' がプライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Exported_variable_0_has_or_is_using_private_name_1_4025": "エクスポートされた変数 '{0}' がプライベート名 '{1}' を使用しています。", + "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023": "エクスポートされた変数 '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024": "エクスポートされた変数 '{0}' がプライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Exported_variable_0_has_or_is_using_private_name_1_4025": "エクスポートされた変数 '{0}' がプライベート名 '{1}' を持っているか、使用しています。", "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666": "エクスポートとエクスポートの割り当てはモジュールの拡張では許可されていません。", "Expression_expected_1109": "式が必要です。", "Expression_or_comma_expected_1137": "式またはコンマが必要です。", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "式は、コンパイラが 'this' の参照をキャプチャするために使用する変数宣言 '_this' に解決されます。", "Extract_constant_95006": "定数の抽出", "Extract_function_95005": "関数の抽出", - "Extract_symbol_95003": "シンボルの抽出", "Extract_to_0_in_1_95004": "{1} 内の {0} に抽出する", "Extract_to_0_in_1_scope_95008": "{1} スコープ内の {0} に抽出する", "Extract_to_0_in_enclosing_scope_95007": "外側のスコープ内の {0} に抽出する", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "ファイル名 '{0}' は、既に含まれているファイル名 '{1}' と大文字と小文字の指定だけが異なります。", "File_name_0_has_a_1_extension_stripping_it_6132": "ファイル名 '{0}' に '{1}' 拡張子が使われています - 削除しています。", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "ファイルの指定で再帰ディレクトリのワイルドカード ('**') の後に親ディレクトリ ('..') を指定することはできません: '{0}'。", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "ファイルの指定に複数の再帰的なディレクトリのワイルドカード ('**') を含めることはできません: '{0}'。", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "ファイルの指定の末尾を再帰的なディレクトリのワイルドカード ('**') にすることはできません: '{0}'。", "Found_package_json_at_0_6099": "'{0}' で 'package.json' が見つかりました。", + "Found_package_json_at_0_Package_ID_is_1_6190": "'{0}' で 'package.json' が見つかりました。パッケージ ID は、'{1}' です。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "'ES3' または 'ES5' を対象としている場合、関数宣言は厳格モードのブロック内では許可されていません。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "'ES3' または 'ES5' を対象としている場合、関数宣言は厳格モードのブロック内では許可されていません。クラス定義は自動的に厳格モードになります。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "'ES3' または 'ES5' を対象としている場合、関数宣言は厳格モードのブロック内では許可されていません。モジュールは自動的に厳格モードになります。", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "識別子が必要です。'{0}' は、厳格モードの予約語です。モジュールは自動的に厳格モードになります。", "Identifier_expected_1003": "識別子が必要です。", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "識別子が必要です。'__esModule' は、ECMAScript モジュールを変換するときのエクスポート済みマーカーとして予約されています。", - "Ignore_this_error_message_90019": "このエラー メッセージを無視します。", - "Implement_inherited_abstract_class_90007": "継承抽象クラスを実装します。", - "Implement_interface_0_90006": "インターフェイス '{0}' を実装します。", - "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "エクスポートされたクラス '{0}' の Implements 句がプライベート名 '{1}' を使用しています。", - "Import_0_from_module_1_90013": "モジュール \"{1}\" から '{0}' をインポートします。", + "Ignore_this_error_message_90019": "このエラー メッセージを無視する", + "Implement_inherited_abstract_class_90007": "継承抽象クラスを実装する", + "Implement_interface_0_90006": "インターフェイス '{0}' を実装する", + "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "エクスポートされたクラス '{0}' の Implements 句がプライベート名 '{1}' を持っているか、使用しています。", + "Import_0_from_module_1_90013": "モジュール \"{1}\" から '{0}' をインポートする", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "ECMAScript モジュールを対象にする場合は、インポート割り当てを使用できません。代わりに 'import * as ns from \"mod\"'、'import {a} from \"mod\"'、'import d from \"mod\"' などのモジュール書式の使用をご検討ください。", "Import_declaration_0_is_using_private_name_1_4000": "インポート宣言 '{0}' がプライベート名 '{1}' を使用しています。", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "インポート宣言が、'{0}' のローカル宣言と競合しています。", @@ -418,16 +428,16 @@ "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439": "アンビエント モジュール宣言内のインポート宣言またはエクスポート宣言は、相対モジュール名を通してモジュールを参照することはできません。", "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667": "インポートはモジュールの拡張では許可されていません。外側の外部モジュールに移動することを検討してください。", "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "アンビエント列挙型の宣言では、メンバー初期化子は定数式である必要があります。", - "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "複数の宣言がある列挙で、最初の列挙要素の初期化子を省略できる宣言は 1 つのみです。", + "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "複数の宣言がある列挙型で、最初の列挙要素の初期化子を省略できる宣言は 1 つのみです。", "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "'const' 列挙型の宣言で、メンバー初期化子は定数式でなければなりません。", "Index_signature_in_type_0_only_permits_reading_2542": "型 '{0}' のインデックス シグネチャは、読み取りのみを許可します。", "Index_signature_is_missing_in_type_0_2329": "型 '{0}' のインデックス シグネチャがありません。", "Index_signatures_are_incompatible_2330": "インデックスの署名に互換性がありません。", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "マージされた宣言 '{0}' の個々の宣言はすべてエクスポートされるか、すべてローカルであるかのどちらかである必要があります。", - "Infer_parameter_types_from_usage_95012": "使用状況からパラメーターの型を推論します。", - "Infer_type_of_0_from_usage_95011": "使用状況から型 '{0}' を推論します。", - "Initialize_property_0_in_the_constructor_90020": "コンストラクターのプロパティ '{0}' を初期化します。", - "Initialize_static_property_0_90021": "静的プロパティ '{0}' を初期化します。", + "Infer_parameter_types_from_usage_95012": "使用状況からパラメーターの型を推論する", + "Infer_type_of_0_from_usage_95011": "使用状況から '{0}' の型を推論する", + "Initialize_property_0_in_the_constructor_90020": "コンストラクターのプロパティ '{0}' を初期化する", + "Initialize_static_property_0_90021": "静的プロパティ '{0}' を初期化する", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "インスタンス メンバー変数 '{0}' の初期化子はコンストラクターで宣言された識別子 '{1}' を参照できません。", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "パラメーター '{0}' の初期化子はその後で宣言された識別子 '{1}' を参照できません。", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "初期化子にこのバインド要素の値が提示されていません。またバインド要素に既定値がありません。", @@ -484,14 +494,15 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "ロケールは または - の形式で指定する必要があります (例: '{0}'、'{1}')。", "Longest_matching_prefix_for_0_is_1_6108": "'{0}' の一致する最長プレフィックスは '{1}' です。", "Looking_up_in_node_modules_folder_initial_location_0_6125": "'node_modules' フォルダーを検索しています。最初の場所は '{0}' です。", - "Make_super_call_the_first_statement_in_the_constructor_90002": "'super()' 呼び出しをコンストラクター内の最初のステートメントにします。", + "Make_super_call_the_first_statement_in_the_constructor_90002": "'super()' 呼び出しをコンストラクター内の最初のステートメントにする", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "マップされたオブジェクト型のテンプレートの型は暗黙的に 'any' になります。", "Member_0_implicitly_has_an_1_type_7008": "メンバー '{0}' の型は暗黙的に '{1}' になります。", "Merge_conflict_marker_encountered_1185": "マージ競合マーカーが検出されました。", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "マージされた宣言 '{0}' に既定のエクスポート宣言を含めることはできません。代わりに、'export default {0}' 宣言を別個に追加することを検討してください。", "Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constru_17013": "メタプロパティ '{0}' は、関数の宣言の本文、関数の式、またはコンストラクターでのみ許可されています。", "Method_0_cannot_have_an_implementation_because_it_is_marked_abstract_1245": "メソッド '{0}' は abstract に指定されているため、実装を含めることができません。", - "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101": "エクスポートされたインターフェイスのメソッド '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102": "エクスポートされたインターフェイスのメソッド '{0}' がプライベート名 '{1}' を使用しています。", + "Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4101": "エクスポートされたインターフェイスのメソッド '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Method_0_of_exported_interface_has_or_is_using_private_name_1_4102": "エクスポートされたインターフェイスのメソッド '{0}' がプライベート名 '{1}' を持っているか、使用しています。", "Modifiers_cannot_appear_here_1184": "ここで修飾子を使用することはできません。", "Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambig_2308": "モジュール {0} は既に '{1}' という名前のメンバーをエクスポートしています。あいまいさを解決するため、明示的にもう一度エクスポートすることを検討してください。", "Module_0_has_no_default_export_1192": "モジュール '{0}' に既定エクスポートがありません。", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== モジュール名 '{0}' が正常に '{1}' に解決されました。========", "Module_resolution_kind_is_not_specified_using_0_6088": "モジュール解決の種類が '{0}' を使用して指定されていません。", "Module_resolution_using_rootDirs_has_failed_6111": "'rootDirs' を使用したモジュール解決が失敗しました。", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "複数の連続した数値区切り記号を指定することはできません。", "Multiple_constructor_implementations_are_not_allowed_2392": "コンストラクターを複数実装することはできません。", "NEWLINE_6061": "改行", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "'{1}' 型および '{2}' 型の名前付きプロパティ '{0}' が一致しません。", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "非抽象クラスの式はクラス '{1}' からの継承抽象メンバー '{0}' を実装しません。", "Not_all_code_paths_return_a_value_7030": "一部のコード パスは値を返しません。", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "数値インデックス型 '{0}' を文字列インデックス型 '{1}' に割り当てることはできません。", + "Numeric_separators_are_not_allowed_here_6188": "数値の区切り記号は、ここでは使用できません。", "Object_is_possibly_null_2531": "オブジェクトは 'null' である可能性があります。", "Object_is_possibly_null_or_undefined_2533": "オブジェクトは 'null' か 'undefined' である可能性があります。", "Object_is_possibly_undefined_2532": "オブジェクトは 'undefined' である可能性があります。", @@ -526,7 +539,7 @@ "Object_literal_s_property_0_implicitly_has_an_1_type_7018": "オブジェクト リテラルのプロパティ '{0}' の型は暗黙的に '{1}' になります。", "Octal_digit_expected_1178": "8 進の数字が必要です。", "Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0_8017": "8 進数のリテラル型には、ES2015 構文を使用する必要があります。構文 '{0}' を使用してください。", - "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018": "8 進数のリテラルは、列挙メンバーの初期化子では許可されていません。構文 '{0}' を使用してください。", + "Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0_8018": "8 進数のリテラルは、列挙型メンバーの初期化子では許可されていません。構文 '{0}' を使用してください。", "Octal_literals_are_not_allowed_in_strict_mode_1121": "厳格モードでは Octal リテラルは使用できません。", "Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0_1085": "ECMAScript 5 以降を対象にする場合、8 進数のリテラルは使用できません。構文 '{0}' を使用してください。", "Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement_1091": "'for...in' ステートメントで使用できる変数宣言は 1 つのみです。", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "'new' キーワードを指定して呼び出せるのは void 関数のみです。", "Only_ambient_modules_can_use_quoted_names_1035": "引用符付きの名前を使用できるのはアンビエント モジュールのみです。", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "--{0} と共にサポートされるのは 'amd' モジュールと 'system' モジュールのみです。", + "Only_emit_d_ts_declaration_files_6014": "'.d.ts' 宣言ファイルのみを生成します。", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "クラス 'extends' 句で現在サポートされているのは、オプションの型引数が指定された ID/完全修飾名のみです。", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "'super' キーワードを使用してアクセスできるのは、基底クラスのパブリック メソッドと保護されたメソッドのみです。", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "演算子 '{0}' を型 '{1}' および '{2}' に適用することはできません。", @@ -556,46 +570,47 @@ "Parameter_0_cannot_be_referenced_in_its_initializer_2372": "パラメーター '{0}' はその初期化子内では参照できません。", "Parameter_0_implicitly_has_an_1_type_7006": "パラメーター '{0}' の型は暗黙的に '{1}' になります。", "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227": "パラメーター '{0}' がパラメーター '{1}' と同じ位置にありません。", - "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066": "エクスポートされたインターフェイスの呼び出しシグネチャのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067": "エクスポートされたインターフェイスの呼び出しシグネチャのパラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061": "エクスポートされたクラスのコンストラクターのパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062": "エクスポートされたクラスのコンストラクターのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063": "エクスポートされたクラスのコンストラクターのパラメーター '{0}' がプライベート名 '{1}' を使用しています。", - "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064": "エクスポートされたインターフェイスのコンストラクター シグネチャのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065": "エクスポートされたインターフェイスのコンストラクター シグネチャのパラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076": "エクスポートされた関数のパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077": "エクスポートされた関数のパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078": "エクスポートされた関数のパラメーター '{0}' がプライベート名 '{1}' を使用しています。", + "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066": "エクスポートされたインターフェイスの呼び出しシグネチャのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067": "エクスポートされたインターフェイスの呼び出しシグネチャのパラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061": "エクスポートされたクラスのコンストラクターのパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062": "エクスポートされたクラスのコンストラクターのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063": "エクスポートされたクラスのコンストラクターのパラメーター '{0}' がプライベート名 '{1}' を持っているか、使用しています。", + "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064": "エクスポートされたインターフェイスのコンストラクター シグネチャのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065": "エクスポートされたインターフェイスのコンストラクター シグネチャのパラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076": "エクスポートされた関数のパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077": "エクスポートされた関数のパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078": "エクスポートされた関数のパラメーター '{0}' がプライベート名 '{1}' を持っているか、使用しています。", "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091": "エクスポートされたインターフェイスのインデックス シグネチャのパラメーター '{0}' で、プライベート モジュール '{2}' の名前 '{1}' が指定されているか使用されています。", "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092": "エクスポートされたインターフェイスのインデックス シグネチャのパラメーター '{0}' で、プライベート名 '{1}' が指定されているか使用されています。", - "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074": "エクスポートされたインターフェイスのメソッドのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075": "エクスポートされたインターフェイスのメソッドのパラメーター '{0}' がプライベート名 '{1}' を使用しています。", - "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071": "エクスポートされたクラスのパブリック メソッドのパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072": "エクスポートされたクラスのパブリック メソッドのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073": "エクスポートされたクラスのパブリック メソッドのパラメーター '{0}' がプライベート名 '{1}' を使用しています。", - "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068": "エクスポートされたクラスのパブリック静的メソッドのパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069": "エクスポートされたクラスのパブリック静的メソッドのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070": "エクスポートされたクラスのパブリック静的メソッドのパラメーター '{0}' が、プライベート名 '{1}' を使用しています。", + "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074": "エクスポートされたインターフェイスのメソッドのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075": "エクスポートされたインターフェイスのメソッドのパラメーター '{0}' がプライベート名 '{1}' を持っているか、使用しています。", + "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071": "エクスポートされたクラスのパブリック メソッドのパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072": "エクスポートされたクラスのパブリック メソッドのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073": "エクスポートされたクラスのパブリック メソッドのパラメーター '{0}' がプライベート名 '{1}' を持っているか、使用しています。", + "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068": "エクスポートされたクラスのパブリック静的メソッドのパラメーター '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069": "エクスポートされたクラスのパブリック静的メソッドのパラメーター '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070": "エクスポートされたクラスのパブリック静的メソッドのパラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", "Parameter_cannot_have_question_mark_and_initializer_1015": "パラメーターに疑問符および初期化子を指定することはできません。", "Parameter_declaration_expected_1138": "パラメーター宣言が必要です。", - "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036": "エクスポートされたクラスのパブリック セッター '{0}' のパラメーター型が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037": "エクスポートされたクラスのパブリック セッター '{0}' のパラメーター型が、プライベート名 '{1}' を使用しています。", - "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034": "エクスポートされたクラスのパブリック静的セッター '{0}' のパラメーター型が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "エクスポートされたクラスのパブリック静的セッター '{0}' のパラメーター型が、プライベート名 '{1}' を使用しています。", + "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036": "エクスポートされたクラスのパブリック セッター '{0}' のパラメーター型が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037": "エクスポートされたクラスのパブリック セッター '{0}' のパラメーター型が、プライベート名 '{1}' を持っているか、使用しています。", + "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034": "エクスポートされたクラスのパブリック静的セッター '{0}' のパラメーター型が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "エクスポートされたクラスのパブリック静的セッター '{0}' のパラメーター型が、プライベート名 '{1}' を持っているか、使用しています。", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "厳格モードで解析してソース ファイルごとに \"use strict\" を生成します。", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "パターン '{0}' に使用できる '*' 文字は最大で 1 つです。", - "Prefix_0_with_an_underscore_90025": "アンダースコアを含むプレフィックス '{0}'。", + "Prefix_0_with_an_underscore_90025": "アンダースコアを含むプレフィックス '{0}'", "Print_names_of_files_part_of_the_compilation_6155": "コンパイルの一環としてファイルの名前を書き出します。", "Print_names_of_generated_files_part_of_the_compilation_6154": "コンパイルの一環として生成されたファイル名を書き出します。", "Print_the_compiler_s_version_6019": "コンパイラのバージョンを表示します。", "Print_this_message_6017": "このメッセージを表示します。", - "Property_0_does_not_exist_on_const_enum_1_2479": "プロパティ '{0}' が 'const' 列挙 '{1}' に存在しません。", + "Property_0_does_not_exist_on_const_enum_1_2479": "プロパティ '{0}' が 'const' 列挙型 '{1}' に存在しません。", "Property_0_does_not_exist_on_type_1_2339": "プロパティ '{0}' は型 '{1}' に存在しません。", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "プロパティ '{0}' は型 '{1}' に存在していません。'{2}' ですか?", "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546": "プロパティ '{0}' には競合する宣言があり、型 '{1}' ではアクセスできません。", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "プロパティ '{0}' に初期化子がなく、コンストラクターで明確に割り当てられていません。", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "プロパティ '{0}' には型 'any' が暗黙的に設定されています。get アクセサーには戻り値の型の注釈がないためです。", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "プロパティ '{0}' には型 'any' が暗黙的に設定されています。set アクセサーにはパラメーター型の注釈がないためです。", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "型 '{1}' のプロパティ '{0}' を基本データ型 '{2}' の同じプロパティに割り当てることはできません。", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "型 '{1}' のプロパティ '{0}' を型 '{2}' に割り当てることはできません。", "Property_0_is_declared_but_its_value_is_never_read_6138": "プロパティ '{0}' が宣言されていますが、その値が読み取られることはありません。", "Property_0_is_incompatible_with_index_signature_2530": "プロパティ '{0}' はインデックス シグネチャと互換性がありません。", @@ -610,8 +625,8 @@ "Property_0_is_used_before_being_assigned_2565": "プロパティ '{0}' は割り当てられる前に使用されています。", "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606": "JSX のスプレッド属性のプロパティ '{0}' をターゲット プロパティに割り当てることはできません。", "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094": "エクスポートされたクラスの式のプロパティ '{0}' が private または protected でない可能性があります。", - "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032": "エクスポートされたインターフェイスのプロパティ '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033": "エクスポートされたインターフェイスのプロパティ '{0}' が、プライベート名 '{1}' を使用しています。", + "Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2_4032": "エクスポートされたインターフェイスのプロパティ '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Property_0_of_exported_interface_has_or_is_using_private_name_1_4033": "エクスポートされたインターフェイスのプロパティ '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", "Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2_2412": "型 '{1}' のプロパティ '{0}' を数値インデックス型 '{2}' に割り当てることはできません。", "Property_0_of_type_1_is_not_assignable_to_string_index_type_2_2411": "型 '{1}' のプロパティ '{0}' を文字列インデックス型 '{2}' に割り当てることはできません。", "Property_assignment_expected_1136": "プロパティの割り当てが必要です。", @@ -619,22 +634,23 @@ "Property_or_signature_expected_1131": "プロパティまたはシグネチャが必要です。", "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328": "プロパティ値には、文字列リテラル、数値リテラル、'true'、'false'、'null'、オブジェクト リテラルまたは配列リテラルのみ使用できます。", "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179": "'for-of' の iterable、spread、'ES5' や 'ES3' をターゲットとする場合は destructuring に対してフル サポートを提供します。", - "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "エクスポートされたクラスのパブリック メソッド '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "エクスポートされたクラスのパブリック メソッド '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "エクスポートされたクラスのパブリック メソッド '{0}' がプライベート名 '{1}' を使用しています。", - "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029": "エクスポートされたクラスのパブリック プロパティ '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030": "エクスポートされたクラスのパブリック プロパティ '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031": "エクスポートされたクラスのパブリック プロパティ '{0}' が、プライベート名 '{1}' を使用しています。", - "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095": "エクスポートされたクラスのパブリック静的メソッド '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096": "エクスポートされたクラスのパブリック静的メソッド '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097": "エクスポートされたクラスのパブリック静的メソッド '{0}' が、プライベート名 '{1}' を使用しています。", - "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026": "エクスポートされたクラスのパブリック静的プロパティ '{0}' が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027": "エクスポートされたクラスのパブリック静的プロパティ '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028": "エクスポートされたクラスのパブリック静的プロパティ '{0}' が、プライベート名 '{1}' を使用しています。", + "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "エクスポートされたクラスのパブリック メソッド '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "エクスポートされたクラスのパブリック メソッド '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "エクスポートされたクラスのパブリック メソッド '{0}' がプライベート名 '{1}' を持っているか、使用しています。", + "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029": "エクスポートされたクラスのパブリック プロパティ '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030": "エクスポートされたクラスのパブリック プロパティ '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031": "エクスポートされたクラスのパブリック プロパティ '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095": "エクスポートされたクラスのパブリック静的メソッド '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096": "エクスポートされたクラスのパブリック静的メソッド '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097": "エクスポートされたクラスのパブリック静的メソッド '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026": "エクスポートされたクラスのパブリック静的プロパティ '{0}' が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027": "エクスポートされたクラスのパブリック静的プロパティ '{0}' が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028": "エクスポートされたクラスのパブリック静的プロパティ '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "暗黙的な 'any' 型を含む式と宣言に関するエラーを発生させます。", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "暗黙的な 'any' 型を持つ 'this' 式でエラーが発生します。", "Redirect_output_structure_to_the_directory_6006": "ディレクトリへ出力構造をリダイレクトします。", - "Remove_declaration_for_Colon_0_90004": "次に対する宣言を削除します: {0}。", + "Remove_declaration_for_Colon_0_90004": "次に対する宣言を削除する: '{0}'", + "Replace_import_with_0_95015": "インポートを '{0}' に置換します。", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "関数の一部のコード パスが値を返さない場合にエラーを報告します。", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "switch ステートメントに case のフォールスルーがある場合にエラーを報告します。", "Report_errors_in_js_files_8019": ".js ファイルのエラーを報告します。", @@ -654,33 +670,33 @@ "Resolving_with_primary_search_path_0_6121": "プライマリ検索パス '{0}' で解決しています。", "Rest_parameter_0_implicitly_has_an_any_type_7019": "Rest パラメーター '{0}' の型は暗黙的に 'any[]' になります。", "Rest_types_may_only_be_created_from_object_types_2700": "rest 型はオブジェクトの種類からのみ作成できます。", - "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046": "エクスポートされたインターフェイスの呼び出しシグネチャの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を使用しています。", - "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047": "エクスポートされたインターフェイスの呼び出しシグネチャの戻り値の型が、プライベート名 '{0}' を使用しています。", - "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044": "エクスポートされたインターフェイスのコンストラクター シグネチャの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を使用しています。", - "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045": "エクスポートされたインターフェイスのコンストラクター シグネチャの戻り値の型が、プライベート名 '{0}' を使用しています。", + "Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4046": "エクスポートされたインターフェイスの呼び出しシグネチャの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を持っているか、使用しています。", + "Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0_4047": "エクスポートされたインターフェイスの呼び出しシグネチャの戻り値の型が、プライベート名 '{0}' を持っているか、使用しています。", + "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_mod_4044": "エクスポートされたインターフェイスのコンストラクター シグネチャの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を持っているか、使用しています。", + "Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0_4045": "エクスポートされたインターフェイスのコンストラクター シグネチャの戻り値の型が、プライベート名 '{0}' を持っているか、使用しています。", "Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class_2409": "コンストラクター シグネチャの戻り値の型は、クラスのインスタンス型に割り当て可能でなければなりません。", - "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058": "エクスポートされた関数の戻り値の型が外部モジュール {1} の名前 '{0}' を使用していますが、名前を指定することはできません。", - "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059": "エクスポートされた関数の戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を使用しています。", - "Return_type_of_exported_function_has_or_is_using_private_name_0_4060": "エクスポートされた関数の戻り値の型が、プライベート名 '{0}' を使用しています。", - "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048": "エクスポートされたインターフェイスのインデックス シグネチャの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を使用しています。", - "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049": "エクスポートされたインターフェイスのインデックス シグネチャの戻り値の型が、プライベート名 '{0}' を使用しています。", - "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056": "エクスポートされたインターフェイスのメソッドの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を使用しています。", - "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057": "エクスポートされたインターフェイスのメソッドの戻り値の型が、プライベート名 '{0}' を使用しています。", - "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041": "エクスポートされたクラスのパブリック ゲッター '{0}' の戻り値の型が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042": "エクスポートされたクラスのパブリック ゲッター '{0}' の戻り値の型が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043": "エクスポートされたクラスのパブリック ゲッター '{0}' の戻り値の型が、プライベート名 '{1}' を使用しています。", - "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053": "エクスポートされたクラスのパブリック メソッドの戻り値の型が外部モジュール {1} の名前 '{0}' を使用していますが、名前を指定することはできません。", - "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054": "エクスポートされたクラスのパブリック メソッドの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を使用しています。", - "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055": "エクスポートされたクラスのパブリック メソッドの戻り値の型が、プライベート名 '{0}' を使用しています。", - "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038": "エクスポートされたクラスのパブリック静的ゲッター '{0}' の戻り値の型が外部モジュール {2} の名前 '{1}' を使用していますが、名前を指定することはできません。", - "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039": "エクスポートされたクラスのパブリック静的ゲッター '{0}' の戻り値の型が、プライベート モジュール '{2}' の名前 '{1}' を使用しています。", - "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040": "エクスポートされたクラスのパブリック静的ゲッター '{0}' の戻り値の型が、プライベート名 '{1}' を使用しています。", - "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050": "エクスポートされたクラスのパブリック静的メソッドの戻り値の型が外部モジュール {1} の名前 '{0}' を使用していますが、名前を指定することはできません。", - "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051": "エクスポートされたクラスのパブリック静的メソッドの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を使用しています。", - "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "エクスポートされたクラスのパブリック静的メソッドの戻り値の型が、プライベート名 '{0}' を使用しています。", + "Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named_4058": "エクスポートされた関数の戻り値の型が外部モジュール {1} の名前 '{0}' を持っているか使用していますが、名前を指定することはできません。", + "Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1_4059": "エクスポートされた関数の戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を持っているか、使用しています。", + "Return_type_of_exported_function_has_or_is_using_private_name_0_4060": "エクスポートされた関数の戻り値の型が、プライベート名 '{0}' を持っているか、使用しています。", + "Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4048": "エクスポートされたインターフェイスのインデックス シグネチャの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を持っているか、使用しています。", + "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049": "エクスポートされたインターフェイスのインデックス シグネチャの戻り値の型が、プライベート名 '{0}' を持っているか、使用しています。", + "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056": "エクスポートされたインターフェイスのメソッドの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を持っているか、使用しています。", + "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057": "エクスポートされたインターフェイスのメソッドの戻り値の型が、プライベート名 '{0}' を持っているか、使用しています。", + "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041": "エクスポートされたクラスのパブリック ゲッター '{0}' の戻り値の型が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042": "エクスポートされたクラスのパブリック ゲッター '{0}' の戻り値の型が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043": "エクスポートされたクラスのパブリック ゲッター '{0}' の戻り値の型が、プライベート名 '{1}' を持っているか、使用しています。", + "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053": "エクスポートされたクラスのパブリック メソッドの戻り値の型が外部モジュール {1} の名前 '{0}' を持っているか使用していますが、名前を指定することはできません。", + "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054": "エクスポートされたクラスのパブリック メソッドの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を持っているか、使用しています。", + "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055": "エクスポートされたクラスのパブリック メソッドの戻り値の型が、プライベート名 '{0}' を持っているか、使用しています。", + "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038": "エクスポートされたクラスのパブリック静的ゲッター '{0}' の戻り値の型が外部モジュール {2} の名前 '{1}' を持っているか使用していますが、名前を指定することはできません。", + "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039": "エクスポートされたクラスのパブリック静的ゲッター '{0}' の戻り値の型が、プライベート モジュール '{2}' の名前 '{1}' を持っているか、使用しています。", + "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040": "エクスポートされたクラスのパブリック静的ゲッター '{0}' の戻り値の型が、プライベート名 '{1}' を持っているか、使用しています。", + "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050": "エクスポートされたクラスのパブリック静的メソッドの戻り値の型が外部モジュール {1} の名前 '{0}' を持っているか使用していますが、名前を指定することはできません。", + "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051": "エクスポートされたクラスのパブリック静的メソッドの戻り値の型が、プライベート モジュール '{1}' の名前 '{0}' を持っているか、使用しています。", + "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "エクスポートされたクラスのパブリック静的メソッドの戻り値の型が、プライベート名 '{0}' を持っているか、使用しています。", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "'{0}' で生成されたモジュール解決は、前のプログラムから変更されていないため、再利用しています。", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "前のプログラムを再利用して、モジュール '{0}' をファイル '{1}' に解決しています。", - "Rewrite_as_the_indexed_access_type_0_90026": "インデックス化されたアクセスの種類 '{0}' として書き換えます。", + "Rewrite_as_the_indexed_access_type_0_90026": "インデックス付きのアクセスの種類 '{0}' として書き換える", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "ルート ディレクトリを決定できません。プライマリ検索パスをスキップします。", "STRATEGY_6039": "戦略", "Scoped_package_detected_looking_in_0_6182": "'{0}' 内を検索して、スコープ パッケージが検出されました", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "ソース マップ オプション", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "特殊化されたオーバーロード シグネチャは、特殊化されていないシグネチャに割り当てることはできません。", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "動的インポートの指定子にはスプレッド要素を指定できません。", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "ECMAScript のターゲット バージョンを指定します: 'ES3' (既定)、'ES5'、'ES2015'、'ES2016'、'ES2017'、'ESNEXT'。", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "ECMAScript のターゲット バージョンを指定します: 'ES3' (既定)、'ES5'、'ES2015'、'ES2016'、'ES2017'、'ES2018'、'ESNEXT'。", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "JSX コード生成を指定します: 'preserve'、'react-native'、'react'。", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "コンパイルに含めるライブラリ ファイルを指定します: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "コンパイルに含めるライブラリ ファイルを指定します。", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "モジュール コード生成を指定します: 'none'、'commonjs'、'amd'、'system'、'umd'、'es2015'、'ESNext'。", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "モジュールの解決方法を指定します: 'node' (Node.js) または 'classic' (TypeScript pre-1.6)。", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "'react' JSX 発行 ('React.createElement' や 'h') などを対象とするときに使用する JSX ファクトリ関数を指定します。", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "入力ファイルのルート ディレクトリを指定します。--outDir とともに、出力ディレクトリ構造の制御に使用します。", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "'new' 式のスプレッド演算子は ECMAScript 5 以上をターゲットにする場合にのみ使用できます。", "Spread_types_may_only_be_created_from_object_types_2698": "spread 型はオブジェクトの種類からのみ作成できます。", + "Starting_compilation_in_watch_mode_6031": "ウォッチ モードでのコンパイルを開始しています...", "Statement_expected_1129": "ステートメントが必要です。", "Statements_are_not_allowed_in_ambient_contexts_1036": "ステートメントは環境コンテキストでは使用できません。", "Static_members_cannot_reference_class_type_parameters_2302": "静的メンバーはクラスの型パラメーターを参照できません。", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "文字列リテラルが必要です。", "String_literal_with_double_quotes_expected_1327": "二重引用符を含む文字列リテラルが必要です。", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "色とコンテキストを使用してエラーとメッセージにスタイルを適用します (試験的)。", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "後続のプロパティ宣言は同じ型でなければなりません。プロパティ '{0}' の型は '{1}' である必要がありますが、ここでは型が '{2}' になっています。", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "後続の変数宣言は同じ型でなければなりません。変数 '{0}' の型は '{1}' である必要がありますが、'{2}' になっています。", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "パターン '{1}' の代入 '{0}' の型が正しくありません。必要な型は 'string' ですが、'{2}' を取得しました。", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "パターン '{1}' の代入 '{0}' に使用できる '*' 文字は最大 1 つです。", @@ -732,7 +749,7 @@ "The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_usi_2522": "'arguments' オブジェクトは、ES3 および ES5 の非同期関数またはメソッドで参照することはできません。標準の関数またはメソッドを使用することを検討してください。", "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313": "'if' ステートメントの本文を空のステートメントにすることはできません。", "The_character_set_of_the_input_files_6163": "入力ファイルの文字セット。", - "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "制御フロー解析に含まれている関数またはモジュールの本体が大きすぎます。", + "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563": "含まれている関数またはモジュールの本体は、制御フロー解析には大きすぎます。", "The_current_host_does_not_support_the_0_option_5001": "現在のホストは '{0}' オプションをサポートしていません。", "The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context_2714": "エクスポートの割り当ての式は、環境コンテキストの識別子または修飾名にする必要があります。", "The_files_list_in_config_file_0_is_empty_18002": "構成ファイル '{0}' の 'files' リストが空です。", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "型 '{0}' は、配列型でも文字列型でもないか、反復子を返す '[Symbol.iterator]()' メソッドを持っていません。", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "型 '{0}' は、配列型ではないか、反復子を返す '[Symbol.iterator]()' メソッドを持っていません。", "Type_0_is_not_assignable_to_type_1_2322": "型 '{0}' を型 '{1}' に割り当てることはできません。", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "型 '{0}' は型 '{1}' に割り当てられません。同じ名前で 2 つの異なる型が存在しますが、これは関連していません。", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "型 '{0}' は型 '{1}' に割り当てられません。同じ名前で 2 つの異なる型が存在しますが、これは関連していません。", "Type_0_is_not_comparable_to_type_1_2678": "型 '{0}' は型 '{1}' と比較できません。", "Type_0_is_not_generic_2315": "型 '{0}' はジェネリックではありません。", "Type_0_provides_no_match_for_the_signature_1_2658": "型 '{0}' にはシグネチャ '{1}' に一致するものがありません。", @@ -818,15 +835,15 @@ "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321": "非同期ジェネレーター内の 'yield' オペランドの型は、有効な Promise であるか、呼び出し可能な 'then' メンバーを含んでいないかのどちらかであることが必要です。", "Type_parameter_0_has_a_circular_constraint_2313": "型パラメーター '{0}' に循環制約があります。", "Type_parameter_0_has_a_circular_default_2716": "型パラメーター '{0}' に循環既定値があります。", - "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "エクスポートされたインターフェイスの呼び出しシグネチャの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "エクスポートされたインターフェイスのコンストラクター シグネチャの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "エクスポートされたクラスの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016": "エクスポートされた関数の型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004": "エクスポートされたインターフェイスの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", + "Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4008": "エクスポートされたインターフェイスの呼び出しシグネチャの型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4006": "エクスポートされたインターフェイスのコンストラクター シグネチャの型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002": "エクスポートされたクラスの型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Type_parameter_0_of_exported_function_has_or_is_using_private_name_1_4016": "エクスポートされた関数の型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004": "エクスポートされたインターフェイスの型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083": "エクスポートした型のエイリアスの型パラメーター '{0}' にプライベート名 '{1}' が指定されているか、これを使用しています。", - "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014": "エクスポートされたインターフェイスのメソッドの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012": "エクスポートされたクラスのパブリック メソッドの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", - "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010": "エクスポートされたクラスのパブリック静的メソッドの型パラメーター '{0}' が、プライベート名 '{1}' を使用しています。", + "Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4014": "エクスポートされたインターフェイスのメソッドの型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4012": "エクスポートされたクラスのパブリック メソッドの型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", + "Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4010": "エクスポートされたクラスのパブリック静的メソッドの型パラメーター '{0}' が、プライベート名 '{1}' を持っているか、使用しています。", "Type_parameter_declaration_expected_1139": "型パラメーターの宣言が必要です。", "Type_parameter_list_cannot_be_empty_1098": "型パラメーター リストを空にすることはできません。", "Type_parameter_name_cannot_be_0_2368": "型パラメーター名を '{0}' にすることはできません。", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "未終了のテンプレート リテラルです。", "Untyped_function_calls_may_not_accept_type_arguments_2347": "型指定のない関数の呼び出しで型引数を使用することはできません。", "Unused_label_7028": "未使用のラベル。", + "Use_synthetic_default_member_95016": "合成 'default' メンバーを使用します。", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "'for...of' ステートメントでの文字列の使用は ECMAScript 5 以上でのみサポートされています。", "VERSION_6036": "バージョン", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "型 '{0}' の値には、型 '{1}' と共通のプロパティがありません。呼び出しますか?", @@ -911,23 +929,24 @@ "class_expressions_are_not_currently_supported_9003": "'class' 式は現在サポートされていません。", "const_declarations_can_only_be_declared_inside_a_block_1156": "'const' 宣言は、ブロック内でのみ宣言できます。", "const_declarations_must_be_initialized_1155": "'const' 宣言は初期化する必要があります。", - "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "'const' 列挙メンバーの初期化子が、無限値に評価されました。", - "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' 列挙メンバーの初期化子が、許可されない値 'NaN' に評価されました。", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 列挙型は、プロパティまたはインデックスのアクセス式、あるいはインポート宣言またはエクスポート割り当ての右辺にのみ使用できます。", + "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "'const' 列挙型メンバーの初期化子が、無限値に評価されました。", + "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' 列挙型メンバーの初期化子が、許可されない値 'NaN' に評価されました。", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 列挙型は、プロパティまたはインデックスのアクセス式、インポート宣言またはエクスポートの割り当ての右辺、型のクエリにのみ使用できます。", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "厳格モードでは 'delete' を識別子で呼び出すことはできません。", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum 宣言' を使用できるのは .ts ファイル内のみです。", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'列挙型宣言' を使用できるのは .ts ファイル内のみです。", "export_can_only_be_used_in_a_ts_file_8003": "'export=' を使用できるのは .ts ファイル内のみです。", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "環境モジュールとモジュール拡張は常に表示されるので、これらに 'export' 修飾子を適用することはできません。", "extends_clause_already_seen_1172": "'extends' 句は既に存在します。", "extends_clause_must_precede_implements_clause_1173": "extends' 句は 'implements' 句の前に指定しなければなりません。", - "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "エクスポートされたクラス '{0}' の 'extends' 句がプライベート名 '{1}' を使用しています。", - "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "エクスポートされたインターフェイス '{0}' の 'extends' 句がプライベート名 '{1}' を使用しています。", + "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "エクスポートされたクラス '{0}' の 'extends' 句がプライベート名 '{1}' を持っているか、使用しています。", + "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "エクスポートされたインターフェイス '{0}' の 'extends' 句がプライベート名 '{1}' を持っているか、使用しています。", "file_6025": "ファイル", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' アクセサーおよび 'set' アクセサーには、同じ 'this' 型が必要です。", "get_and_set_accessor_must_have_the_same_type_2380": "'get' アクセサーと 'set' アクセサーは同じ型でなければなりません。", "implements_clause_already_seen_1175": "'implements' 句は既に存在します。", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "'implements 句' を使用できるのは .ts ファイル内のみです。", "import_can_only_be_used_in_a_ts_file_8002": "'import ... =' を使用できるのは .ts ファイル内のみです。", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "'infer' 宣言は、条件付き型の 'extends' 句でのみ許可されます。", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "'インターフェイス宣言' を使用できるのは .ts ファイル内のみです。", "let_declarations_can_only_be_declared_inside_a_block_1157": "'let' 宣言は、ブロック内でのみ宣言できます。", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "'let' は、'let' 宣言または 'const' 宣言で名前として使用することはできません。", @@ -963,9 +982,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "'型アサーション式' を使用できるのは、.ts ファイル内のみです。", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "'型パラメーター宣言' を使用できるのは .ts ファイル内のみです。", "types_can_only_be_used_in_a_ts_file_8010": "'型' を使用できるのは .ts ファイル内のみです。", - "unique_symbol_types_are_not_allowed_here_1335": "'一意のシンボル' 型はここでは許可されていません。", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "'一意のシンボル' 型は変数ステートメントの変数でのみ許可されています。", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "'一意のシンボル' 型は、バインディング名を持つ変数の宣言では使用できません。", + "unique_symbol_types_are_not_allowed_here_1335": "'unique symbol' 型はここでは許可されていません。", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "'unique symbol' 型は変数ステートメントの変数でのみ許可されています。", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "'unique symbol' 型は、バインディング名を持つ変数の宣言では使用できません。", "with_statements_are_not_allowed_in_an_async_function_block_1300": "'with' 式は、非同期関数ブロックでは使用できません。", "with_statements_are_not_allowed_in_strict_mode_1101": "厳格モードでは 'with' ステートメントは使用できません。", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "'yield' 式は、パラメーター初期化子では使用できません。" diff --git a/lib/ko/diagnosticMessages.generated.json b/lib/ko/diagnosticMessages.generated.json index 1da59779106..f0b94025468 100644 --- a/lib/ko/diagnosticMessages.generated.json +++ b/lib/ko/diagnosticMessages.generated.json @@ -12,11 +12,11 @@ "A_class_member_cannot_have_the_0_keyword_1248": "클래스 멤버에는 '{0}' 키워드를 사용할 수 없습니다.", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "쉼표 식은 컴퓨팅된 속성 이름에 사용할 수 없습니다.", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "계산된 속성 이름에서는 포함하는 형식의 형식 매개 변수를 참조할 수 없습니다.", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "클래스 속성 선언의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "메서드 오버로드의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "리터럴 형식의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "앰비언트 컨텍스트의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "인터페이스의 계산된 속성 이름은 형식이 리터럴 형식이거나 '고유 기호' 형식인 식을 참조해야 합니다.", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "클래스 속성 선언의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "메서드 오버로드의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "리터럴 형식의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "앰비언트 컨텍스트의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "인터페이스의 계산된 속성 이름은 형식이 리터럴 형식이거나 'unique symbol' 형식인 식을 참조해야 합니다.", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "계산된 속성 이름은 'string', 'number', 'symbol' 또는 'any' 형식이어야 합니다.", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "'{0}' 양식의 계산된 속성 이름은 'symbol' 형식이어야 합니다.", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "const 열거형 멤버는 문자열 리터럴을 통해서만 액세스할 수 있습니다.", @@ -33,7 +33,7 @@ "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255": "이 컨텍스트에서는 한정된 할당 어설션 '!'가 허용되지 않습니다.", "A_destructuring_declaration_must_have_an_initializer_1182": "구조 파괴 선언에 이니셜라이저가 있어야 합니다.", "A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declarat_2712": "ES5/ES3의 동적 가져오기 호출에 'Promise' 생성자가 필요합니다. 'Promise' 생성자에 대한 선언이 있거나 `--lib` 옵션에 'ES2015'가 포함되었는지 확인하세요.", - "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711": "동적 가져오기 호출은 'Promise'를 반환해야 합니다. 'Promise'에 대한 선언이 있거나 `--lib` 옵션에 'ES2015'가 포함되었는지 확인하세요.", + "A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES20_2711": "동적 가져오기 호출은 'Promise'를 반환합니다. 'Promise'에 대한 선언이 있거나 `--lib` 옵션에 'ES2015'가 포함되었는지 확인하세요.", "A_file_cannot_have_a_reference_to_itself_1006": "파일은 자신에 대한 참조를 포함할 수 없습니다.", "A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator_1103": "'for-await-of' 식은 비동기 함수 또는 비동기 생성기 내에서만 사용할 수 있습니다.", "A_function_returning_never_cannot_have_a_reachable_end_point_2534": "'never'를 반환하는 함수에는 연결 가능한 끝점이 있을 수 없습니다.", @@ -48,16 +48,18 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "네임스페이스 선언은 해당 선언이 병합된 클래스나 함수와 다른 파일에 있을 수 없습니다,", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "네임스페이스 선언은 해당 선언이 병합된 클래스나 함수 앞에 있을 수 없습니다.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "네임스페이스 선언은 네임스페이스 또는 모듈에서만 사용할 수 있습니다.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "네임스페이스 스타일 가져오기를 호출하거나 생성할 수 없으며 런타임 시 오류가 발생합니다.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "매개 변수 이니셜라이저는 함수 또는 생성자 구현에서만 허용됩니다.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "rest 매개 변수를 사용하여 매개 변수 속성을 선언할 수 없습니다.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "매개 변수 속성은 생성자 구현에서만 허용됩니다.", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "바인딩 패턴을 사용하여 매개 변수 속성을 선언할 수 없습니다.", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "'extends' 옵션의 경로는 상대 경로이거나 루트 경로여야 하지만 '{0}'은(는) 아닙니다.", "A_promise_must_have_a_then_method_1059": "프라미스에는 'then' 메서드가 있어야 합니다.", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "형식이 '고유 기호' 형식인 클래스의 속성은 'static'과 'readonly' 둘 다여야 합니다.", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "형식이 '고유 기호' 형식인 인터페이스 또는 형식 리터럴의 속성은 'readonly'여야 합니다.", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "형식이 'unique symbol' 형식인 클래스의 속성은 'static'과 'readonly' 둘 다여야 합니다.", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "형식이 'unique symbol' 형식인 인터페이스 또는 형식 리터럴의 속성은 'readonly'여야 합니다.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "필수 매개 변수는 선택적 매개 변수 뒤에 올 수 없습니다.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "rest 요소에는 바인딩 패턴이 포함될 수 없습니다.", + "A_rest_element_cannot_have_a_property_name_2566": "rest 요소에는 속성 이름을 사용할 수 없습니다.", "A_rest_element_cannot_have_an_initializer_1186": "rest 요소에는 이니셜라이저를 사용할 수 없습니다.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "rest 요소는 배열 구조 파괴 패턴의 마지막 요소여야 합니다.", "A_rest_parameter_cannot_be_optional_1047": "rest 매개 변수는 선택 사항이 될 수 없습니다.", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "형식 조건자는 바인딩 패턴에서 '{0}' 요소를 참조할 수 없습니다.", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "형식 조건자는 함수 및 메서드의 반환 형식 위치에서만 사용할 수 있습니다.", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "형식 조건자의 형식을 해당 매개 변수의 형식에 할당할 수 있어야 합니다.", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "형식이 '고유한 기호' 형식인 변수는 'const'여야 합니다.", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "형식이 'unique symbol' 형식인 변수는 'const'여야 합니다.", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "'yield' 식은 생성기 본문에서만 사용할 수 있습니다.", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "super 식을 통해 '{1}' 클래스의 추상 메서드 '{0}'에 액세스할 수 없습니다.", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "추상 메서드는 추상 클래스 내에서만 사용할 수 있습니다.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "액세스 가능성 한정자가 이미 있습니다.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "접근자는 ECMAScript 5 이상을 대상으로 지정할 때만 사용할 수 있습니다.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "접근자는 모두 추상이거나 비추상이어야 합니다.", - "Add_0_to_existing_import_declaration_from_1_90015": "\"{1}\"에서 기존 가져오기 선언에 '{0}'을(를) 추가합니다.", - "Add_index_signature_for_property_0_90017": "'{0}' 속성에 대해 인덱스 시그니처를 추가합니다.", - "Add_missing_super_call_90001": "누락된 'super()' 호출을 추가하세요.", - "Add_this_to_unresolved_variable_90008": "확인되지 않은 변수에 'this.'을 추가하세요.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "tsconfig.json 파일을 추가하면 TypeScript 파일과 JavaScript 파일이 둘 다 포함된 프로젝트를 정리하는 데 도움이 됩니다. 자세한 내용은 https://aka.ms/tsconfig를 참조하세요.", + "Add_0_to_existing_import_declaration_from_1_90015": "\"{1}\"에서 기존 가져오기 선언에 '{0}' 추가", + "Add_async_modifier_to_containing_function_90029": "포함된 함수에 async 한정자 추가", + "Add_index_signature_for_property_0_90017": "'{0}' 속성에 대해 인덱스 시그니처 추가", + "Add_missing_super_call_90001": "누락된 'super()' 호출 추가", + "Add_this_to_unresolved_variable_90008": "확인되지 않은 변수에 'this.' 추가", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "tsconfig.json 파일을 추가하면 TypeScript 파일과 JavaScript 파일이 둘 다 포함된 프로젝트를 정리하는 데 도움이 됩니다. 자세한 내용은 https://aka.ms/tsconfig를 참조하세요.", "Additional_Checks_6176": "추가 검사", "Advanced_Options_6178": "고급 옵션", "All_declarations_of_0_must_have_identical_modifiers_2687": "'{0}'의 모든 선언에는 동일한 한정자가 있어야 합니다.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "인덱스 시그니처 매개 변수에는 액세스 가능성 한정자를 사용할 수 없습니다.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "인덱스 시그니처 매개 변수에는 이니셜라이저를 사용할 수 없습니다.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "인덱스 시그니처 매개 변수에는 형식 주석을 사용할 수 없습니다.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "인덱스 시그니처 매개 변수 형식은 형식 별칭일 수 없습니다. 대신 '[{0}: {1}]: {2}'을(를) 작성하세요.", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "인덱스 시그니처 매개 변수 형식은 공용 구조체 형식일 수 없습니다. 대신 매핑된 개체 형식을 사용하세요.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "인덱스 시그니처 매개 변수 형식은 'string' 또는 'number'여야 합니다.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "인터페이스는 선택적 형식 인수가 포함된 식별자/정규화된 이름만 확장할 수 있습니다.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "인터페이스는 클래스 또는 다른 인터페이스만 확장할 수 있습니다.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "이진수가 있어야 합니다.", "Binding_element_0_implicitly_has_an_1_type_7031": "바인딩 요소 '{0}'에 암시적으로 '{1}' 형식이 있습니다.", "Block_scoped_variable_0_used_before_its_declaration_2448": "선언 전에 사용된 블록 범위 변수 '{0}'입니다.", - "Call_decorator_expression_90028": "decorator 식을 호출합니다.", + "Call_decorator_expression_90028": "데코레이터 식 호출", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "반환 형식 주석이 없는 호출 시그니처에는 암시적으로 'any' 반환 형식이 포함됩니다.", "Call_target_does_not_contain_any_signatures_2346": "호출 대상에 시그니처가 포함되어 있지 않습니다.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "'{0}'이(가) 네임스페이스가 아니라 형식이므로 '{0}.{1}'에 액세스할 수 없습니다. '{0}'에서 '{0}[\"{1}\"]'과(와) 함께 '{1}' 속성의 형식을 검색하려고 했나요?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "형식 선언 파일을 가져올 수 없습니다. '{1}' 대신 '{0}'을(를) 가져오세요.", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "블록 범위 선언 '{1}'과(와) 동일한 범위 내에서 외부 범위 변수 '{0}'을(를) 초기화할 수 없습니다.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "형식에 호출 시그니처가 없는 식을 호출할 수 없습니다. '{0}' 형식에 호환되는 호출 시그니처가 없습니다.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "'null'일 수 있는 개체를 호출할 수 없습니다.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "'null'이거나 '정의되지 않음'일 수 있는 개체를 호출할 수 없습니다.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "'정의되지 않음'일 수 있는 개체를 호출할 수 없습니다.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "'--isolatedModules' 플래그가 제공된 경우 형식을 다시 내보낼 수 없습니다.", "Cannot_read_file_0_Colon_1_5012": "파일 '{0}'을(를) 읽을 수 없습니다. {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "블록 범위 변수 '{0}'을(를) 다시 선언할 수 없습니다.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "'{0}' 파일은 입력 파일을 덮어쓰므로 쓸 수 없습니다.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Catch 절 변수에 형식 주석을 사용할 수 없습니다.", "Catch_clause_variable_cannot_have_an_initializer_1197": "Catch 절 변수에 이니셜라이저를 사용할 수 없습니다.", - "Change_0_to_1_90014": "'{0}'을(를) '{1}'(으)로 변경합니다.", - "Change_extends_to_implements_90003": "'extends'를 'implements'로 변경하세요.", - "Change_spelling_to_0_90022": "철자를 '{0}'(으)로 변경하세요.", + "Change_0_to_1_90014": "'{0}'을(를) '{1}'(으)로 변경", + "Change_extends_to_implements_90003": "'extends'를 'implements'로 변경", + "Change_spelling_to_0_90022": "맞춤법을 '{0}'(으)로 변경", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "'{0}'이(가) '{1}' - '{2}'에 대해 일치하는 가장 긴 접두사인지 확인하는 중입니다.", "Circular_definition_of_import_alias_0_2303": "가져오기 별칭 '{0}'의 순환 정의입니다.", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "구성을 확인하는 동안 순환이 검색되었습니다. {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "'{0}' 클래스가 인스턴스 멤버 함수 '{1}'을(를) 정의하지만 확장 클래스 '{2}'은(는) 이 함수를 인스턴스 멤버 속성으로 정의합니다.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "'{0}' 클래스가 인스턴스 멤버 속성 '{1}'을(를) 정의하지만 확장 클래스 '{2}'은(는) 이 속성을 인스턴스 멤버 함수로 정의합니다.", "Class_0_incorrectly_extends_base_class_1_2415": "'{0}' 클래스가 기본 클래스 '{1}'을(를) 잘못 확장합니다.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "'{0}' 클래스가 '{1}' 클래스를 잘못 구현합니다. '{1}'을(를) 확장하고 이 클래스의 멤버를 하위 클래스로 상속하시겠습니까?", "Class_0_incorrectly_implements_interface_1_2420": "'{0}' 클래스가 '{1}' 인터페이스를 잘못 구현합니다.", "Class_0_used_before_its_declaration_2449": "선언 전에 사용된 '{0}' 클래스입니다.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "클래스 선언은 '@augments' 또는 `@extends` 태그를 둘 이상 가질 수 없습니다.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "포함 파일이 지정되지 않았고 루트 디렉터리를 확인할 수 없어 'node_modules' 폴더 조회를 건너뜁니다.", "Convert_function_0_to_class_95002": "'{0}' 함수를 클래스로 변환", "Convert_function_to_an_ES2015_class_95001": "함수를 ES2015 클래스로 변환", + "Convert_to_ES6_module_95017": "ES6 모듈로 변환", "Convert_to_default_import_95013": "기본 가져오기로 변환", "Corrupted_locale_file_0_6051": "로캘 파일 {0}이(가) 손상되었습니다.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "모듈 '{0}'에 대한 선언 파일을 찾을 수 없습니다. '{1}'에는 암시적으로 'any' 형식이 포함됩니다.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "선언이 필요합니다.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "선언 이름이 기본 제공 전역 ID '{0}'과(와) 충돌합니다.", "Declaration_or_statement_expected_1128": "선언 또는 문이 필요합니다.", - "Declare_method_0_90023": "'{0}' 메서드를 선언합니다.", - "Declare_property_0_90016": "'{0}' 속성을 선언합니다.", - "Declare_static_method_0_90024": "'{0}' 정적 메서드를 선언합니다.", - "Declare_static_property_0_90027": "정적 속성 '{0}'을(를) 선언합니다.", + "Declare_method_0_90023": "'{0}' 메서드 선언", + "Declare_property_0_90016": "'{0}' 속성 선언", + "Declare_static_method_0_90024": "'{0}' 정적 메서드 선언", + "Declare_static_property_0_90027": "'{0}' 정적 속성 선언", "Decorators_are_not_valid_here_1206": "데코레이터는 여기에 사용할 수 없습니다.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "동일한 이름의 여러 get/set 접근자에 데코레이터를 적용할 수 없습니다.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "모듈의 기본 내보내기에서 전용 이름 '{0}'을(를) 가지고 있거나 사용 중입니다.", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[사용되지 않음] 대신 '--skipLibCheck'를 사용합니다. 기본 라이브러리 선언 파일의 형식 검사를 건너뜁니다.", "Digit_expected_1124": "숫자가 필요합니다.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "'{0}' 디렉터리가 없으므로 이 디렉터리에서 모든 조회를 건너뜁니다.", - "Disable_checking_for_this_file_90018": "이 파일 확인을 사용하지 않도록 설정합니다.", + "Disable_checking_for_this_file_90018": "이 파일 확인을 사용하지 않도록 설정", "Disable_size_limitations_on_JavaScript_projects_6162": "JavaScript 프로젝트에 대한 크기 제한을 사용하지 않도록 설정합니다.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "함수 형식의 제네릭 시그니처에 대한 엄격한 검사를 사용하지 않도록 설정합니다.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "동일한 파일에 대해 대/소문자를 일관되지 않게 사용한 참조를 허용하지 않습니다.", @@ -298,7 +308,7 @@ "Dynamic_import_cannot_be_used_when_targeting_ECMAScript_2015_modules_1323": "ECMAScript 2015 모듈을 대상을 지정할 때에는 동적 가져오기를 사용할 수 없습니다.", "Dynamic_import_cannot_have_type_arguments_1326": "동적 가져오기에는 형식 인수를 사용할 수 없습니다.", "Dynamic_import_must_have_one_specifier_as_an_argument_1324": "동적 가져오기에는 지정자 하나를 인수로 사용해야 합니다.", - "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "동적 가져오기의 지정자는 'string' 형식이어야 하지만 여기에는 '{0}' 형식이 있습니다.", + "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036": "동적 가져오기의 지정자는 'string' 형식이어야 하지만 여기에서 형식은 '{0}'입니다.", "Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number_7015": "인덱스 식이 'number' 형식이 아니므로 요소에 암시적으로 'any' 형식이 있습니다.", "Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature_7017": "'{0}' 형식에 인덱스 시그니처가 없으므로 요소에 암시적으로 'any' 형식이 있습니다.", "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6164": "출력 파일의 시작에서 UTF-8 BOM(바이트 순서 표시)을 내보냅니다.", @@ -306,13 +316,15 @@ "Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap__6152": "단일 파일 내에서 소스 맵과 함께 소스를 내보냅니다. '--inlineSourceMap' 또는 '--sourceMap'을 설정해야 합니다.", "Enable_all_strict_type_checking_options_6180": "엄격한 형식 검사 옵션을 모두 사용하도록 설정합니다.", "Enable_strict_checking_of_function_types_6186": "함수 형식에 대한 엄격한 검사를 사용하도록 설정합니다.", - "Enable_strict_checking_of_property_initialization_in_classes_6187": "클래스의 속성 초기화에 대해 엄격한 검사를 사용합니다.", + "Enable_strict_checking_of_property_initialization_in_classes_6187": "클래스의 속성 초기화에 대해 엄격한 검사를 사용하도록 설정합니다.", "Enable_strict_null_checks_6113": "엄격한 null 검사를 사용하도록 설정하세요.", "Enable_tracing_of_the_name_resolution_process_6085": "이름 확인 프로세스 추적을 사용하도록 설정하세요.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "모든 가져오기에 대한 네임스페이스 개체를 만들어 CommonJS 및 ES 모듈 간의 내보내기 상호 운용성을 사용하도록 설정합니다. 'allowSyntheticDefaultImports'를 의미합니다.", "Enables_experimental_support_for_ES7_async_functions_6068": "ES7 비동기 함수에 대해 실험적 지원을 사용합니다.", "Enables_experimental_support_for_ES7_decorators_6065": "ES7 데코레이터에 대해 실험적 지원을 사용합니다.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "데코레이터에 대한 형식 메타데이터를 내보내기 위해 실험적 지원을 사용합니다.", "Enum_0_used_before_its_declaration_2450": "선언 전에 사용된 '{0}' 열거형입니다.", + "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567": "열거형 선언은 네임스페이스 또는 다른 열거형 선언과만 병합할 수 있습니다.", "Enum_declarations_must_all_be_const_or_non_const_2473": "열거형 선언은 모두 const 또는 비const여야 합니다.", "Enum_member_expected_1132": "열거형 멤버가 필요합니다.", "Enum_member_must_have_initializer_1061": "열거형 멤버에는 이니셜라이저가 있어야 합니다.", @@ -333,7 +345,7 @@ "Experimental_Options_6177": "실험적 옵션", "Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_t_1219": "데코레이터에 대한 실험적 지원 기능은 이후 릴리스에서 변경될 수 있습니다. 이 경고를 제거하려면 'experimentalDecorators' 옵션을 설정하세요.", "Explicitly_specified_module_resolution_kind_Colon_0_6087": "명시적으로 지정된 모듈 확인 종류 '{0}'입니다.", - "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203": "ECMAScript 모듈을 대상으로 하는 경우 할당 내보내기를 사용할 수 없습니다. 대신 'export default'나 다른 모듈 형식 사용을 고려하세요.", + "Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203": "ECMAScript 모듈을 대상으로 하는 경우 내보내기 할당을 사용할 수 없습니다. 대신 'export default'나 다른 모듈 형식의 사용을 고려하세요.", "Export_assignment_is_not_supported_when_module_flag_is_system_1218": "'--module' 플래그가 'system'이면 내보내기 할당은 지원되지 않습니다.", "Export_declaration_conflicts_with_exported_declaration_of_0_2484": "내보내기 선언이 '{0}'의 내보낸 선언과 충돌합니다.", "Export_declarations_are_not_permitted_in_a_namespace_1194": "네임스페이스에서는 내보내기 선언이 허용되지 않습니다.", @@ -343,7 +355,7 @@ "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023": "내보낸 변수 '{0}'이(가) 외부 모듈 {2}의 '{1}' 이름을 가지고 있거나 사용 중이지만 명명할 수 없습니다.", "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024": "내보낸 변수 '{0}'이(가) 전용 모듈 '{2}'의 '{1}' 이름을 가지고 있거나 사용 중입니다.", "Exported_variable_0_has_or_is_using_private_name_1_4025": "내보낸 변수 '{0}'이(가) 전용 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.", - "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666": "내보내기 및 할당 내보내기는 모듈 확대에서 허용되지 않습니다.", + "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666": "내보내기 및 내보내기 할당는 모듈 확대에서 허용되지 않습니다.", "Expression_expected_1109": "식이 필요합니다.", "Expression_or_comma_expected_1137": "식 또는 쉼표가 필요합니다.", "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402": "컴파일러가 기본 클래스 참조를 캡처하기 위해 사용하는 '_super'로 식이 확인됩니다.", @@ -352,7 +364,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "컴파일러가 'this' 참조를 캡처하기 위해 사용하는 변수 선언 '_this'로 식이 확인됩니다.", "Extract_constant_95006": "상수 추출", "Extract_function_95005": "함수 추출", - "Extract_symbol_95003": "기호 추출", "Extract_to_0_in_1_95004": "{1}의 {0}(으)로 추출", "Extract_to_0_in_1_scope_95008": "{1} 범위의 {0}(으)로 추출", "Extract_to_0_in_enclosing_scope_95007": "바깥쪽 범위의 {0}(으)로 추출", @@ -371,9 +382,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "'{0}' 파일 이름은 이미 포함된 '{1}' 파일 이름과 대/소문자만 다릅니다.", "File_name_0_has_a_1_extension_stripping_it_6132": "파일 이름 '{0}'에 '{1}' 확장명이 있어 제거하는 중입니다.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "파일 사양은 재귀 디렉터리 와일드카드('**') 뒤에 나타나는 부모 디렉터리('..')를 포함할 수 없습니다. '{0}'.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "파일 사양은 여러 개의 재귀 디렉터리 와일드카드('**')를 포함할 수 없습니다. '{0}'.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "파일 사양은 재귀 디렉터리 와일드카드('**')로 끝날 수 없습니다. '{0}'.", "Found_package_json_at_0_6099": "'{0}'에서 'package.json'을 찾았습니다.", + "Found_package_json_at_0_Package_ID_is_1_6190": "'{0}'에서 'package.json'을 찾았습니다. 패키지 ID는 '{1}'입니다.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "'ES3' 또는 'ES5'를 대상으로 할 경우 strict 모드의 블록 내에서 함수 선언을 사용할 수 없습니다.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "'ES3' 또는 'ES5'를 대상으로 할 경우 strict 모드의 블록 내에서 함수 선언을 사용할 수 없습니다. 클래스 정의는 자동으로 strict 모드가 됩니다.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "'ES3' 또는 'ES5'를 대상으로 할 경우 strict 모드의 블록 내에서 함수 선언을 사용할 수 없습니다. 모듈은 자동으로 strict 모드가 됩니다.", @@ -404,11 +415,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "식별자가 필요합니다. '{0}'은(는) strict 모드의 예약어입니다. 모듈은 자동으로 strict 모드가 됩니다.", "Identifier_expected_1003": "식별자가 필요합니다.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "식별자가 필요합니다. '__esModule'은 ECMAScript 모듈을 변환할 때 내보낸 표식으로 예약되어 있습니다.", - "Ignore_this_error_message_90019": "이 오류 메시지를 무시합니다.", - "Implement_inherited_abstract_class_90007": "상속된 추상 클래스를 구현하세요.", - "Implement_interface_0_90006": "'{0}' 인터페이스를 구현하세요.", + "Ignore_this_error_message_90019": "이 오류 메시지 무시", + "Implement_inherited_abstract_class_90007": "상속된 추상 클래스 구현", + "Implement_interface_0_90006": "'{0}' 인터페이스 구현", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "내보낸 클래스 '{0}'의 Implements 절이 전용 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.", - "Import_0_from_module_1_90013": "\"{1}\" 모듈에서 '{0}'을(를) 가져옵니다.", + "Import_0_from_module_1_90013": "\"{1}\" 모듈에서 '{0}' 가져오기", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "ECMAScript 모듈을 대상으로 하는 경우 할당 가져오기를 사용할 수 없습니다. 대신 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' 또는 다른 모듈 형식 사용을 고려하세요.", "Import_declaration_0_is_using_private_name_1_4000": "가져오기 선언 '{0}'이(가) 전용 이름 '{1}'을(를) 사용하고 있습니다.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "가져오기 선언이 '{0}'의 로컬 선언과 충돌합니다.", @@ -424,10 +435,10 @@ "Index_signature_is_missing_in_type_0_2329": "'{0}' 형식에 인덱스 시그니처가 없습니다.", "Index_signatures_are_incompatible_2330": "인덱스 시그니처가 호환되지 않습니다.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "병합된 선언 '{0}'의 개별 선언은 모두 내보내 졌거나 모두 로컬이어야 합니다.", - "Infer_parameter_types_from_usage_95012": "사용량에서 매개 변수 형식을 유추합니다.", - "Infer_type_of_0_from_usage_95011": "사용량에서 '{0}'의 형식을 유추합니다.", - "Initialize_property_0_in_the_constructor_90020": "생성자에서 속성 '{0}'을(를) 초기화합니다.", - "Initialize_static_property_0_90021": "정적 속성 '{0}'을(를) 초기화합니다.", + "Infer_parameter_types_from_usage_95012": "사용량에서 매개 변수 형식 유추", + "Infer_type_of_0_from_usage_95011": "사용량에서 '{0}'의 형식 유추", + "Initialize_property_0_in_the_constructor_90020": "생성자에서 속성 '{0}' 초기화", + "Initialize_static_property_0_90021": "정적 속성 '{0}' 초기화", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "인스턴스 멤버 변수 '{0}'의 이니셜라이저는 생성자에 선언된 식별자 '{1}'을(를) 참조할 수 없습니다.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "매개 변수 '{0}'의 이니셜라이저는 그 다음에 선언된 식별자 '{1}'을(를) 참조할 수 없습니다.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "이니셜라이저는 이 바인딩 요소에 대한 값을 제공하지 않으며 바인딩 요소에는 기본값이 없습니다.", @@ -480,11 +491,12 @@ "List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime_6168": "런타임에 프로젝트의 구조를 나타내는 결합된 콘텐츠가 있는 루트 폴더의 목록입니다.", "Loading_0_from_the_root_dir_1_candidate_location_2_6109": "루트 디렉터리 '{1}'에서 '{0}'을(를) 로드하고 있습니다. 후보 위치: '{2}'.", "Loading_module_0_from_node_modules_folder_target_file_type_1_6098": "'node_modules' 폴더에서 '{0}' 모듈을 로드하고 있습니다. 대상 파일 형식은 '{1}'입니다.", - "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095": "모듈을 파일/폴더로 로드하고 있습니다. 후보 모듈 위치: '{0}', 대상 파일 형식: '{1}'.", + "Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1_6095": "모듈을 파일/폴더로 로드하고 있습니다. 후보 모듈 위치는 '{0}', 대상 파일 형식은 '{1}'입니다.", "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "로캘이 또는 - 형식이어야 합니다. 예를 들어 '{0}' 또는 '{1}'입니다.", "Longest_matching_prefix_for_0_is_1_6108": "'{0}'에 대해 일치하는 가장 긴 접두사는 '{1}'입니다.", "Looking_up_in_node_modules_folder_initial_location_0_6125": "'node_modules' 폴더에서 찾고 있습니다. 초기 위치: '{0}'.", - "Make_super_call_the_first_statement_in_the_constructor_90002": "생성자의 첫 번째 문을 'super()'로 호출하세요.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "생성자의 첫 번째 문을 'super()'로 호출", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "매핑된 개체 형식에는 'any' 템플릿 형식이 암시적으로 포함됩니다.", "Member_0_implicitly_has_an_1_type_7008": "'{0}' 멤버에는 암시적으로 '{1}' 형식이 포함됩니다.", "Merge_conflict_marker_encountered_1185": "병합 충돌 표식을 발견했습니다.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "병합된 선언 '{0}'에는 기본 내보내기 선언을 포함할 수 없습니다. 대신 별도의 'export default {0}' 선언을 추가하세요.", @@ -508,6 +520,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== 모듈 이름 '{0}'이(가) '{1}'(으)로 확인되었습니다. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "모듈 확인 종류가 지정되지 않았습니다. '{0}'을(를) 사용합니다.", "Module_resolution_using_rootDirs_has_failed_6111": "'rootDirs'를 사용한 모듈 확인에 실패했습니다.", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "여러 개의 연속된 숫자 구분 기호는 허용되지 않습니다.", "Multiple_constructor_implementations_are_not_allowed_2392": "여러 생성자 구현은 허용되지 않습니다.", "NEWLINE_6061": "줄 바꿈", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "명명된 속성 '{0}'의 형식 '{1}' 및 '{2}'이(가) 동일하지 않습니다.", @@ -518,6 +531,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "비추상 클래스 식은 '{1}' 클래스에서 상속된 추상 멤버 '{0}'을(를) 구현하지 않습니다.", "Not_all_code_paths_return_a_value_7030": "일부 코드 경로가 값을 반환하지 않습니다.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "숫자 인덱스 형식 '{0}'을(를) 문자열 인덱스 형식 '{1}'에 할당할 수 없습니다.", + "Numeric_separators_are_not_allowed_here_6188": "숫자 구분 기호는 여기에서 허용되지 않습니다.", "Object_is_possibly_null_2531": "개체가 'null'인 것 같습니다.", "Object_is_possibly_null_or_undefined_2533": "개체가 'null' 또는 'undefined'인 것 같습니다.", "Object_is_possibly_undefined_2532": "개체가 'undefined'인 것 같습니다.", @@ -534,6 +548,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "void 함수만 'new' 키워드로 호출할 수 있습니다.", "Only_ambient_modules_can_use_quoted_names_1035": "앰비언트 모듈만 따옴표가 붙은 이름을 사용할 수 있습니다.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "'amd' 및 'system' 모듈만 --{0}과(와) 함께 사용할 수 있습니다.", + "Only_emit_d_ts_declaration_files_6014": "'.d.ts' 선언 파일만 내보냅니다.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "선택적 형식 인수가 포함된 식별자/정규화된 이름만 현재 클래스 'extends' 절에서 지원됩니다.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "기본 클래스의 공용 및 보호된 메서드만 'super' 키워드를 통해 액세스할 수 있습니다.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "'{0}' 연산자를 '{1}' 및 '{2}' 형식에 적용할 수 없습니다.", @@ -584,7 +599,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "내보낸 클래스에 있는 공용 정적 setter '{0}'의 매개 변수 형식이 전용 이름 '{1}'을(를) 가지고 있거나 사용 중입니다.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "strict 모드에서 구문 분석하고 각 소스 파일에 대해 \"use strict\"를 내보냅니다.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "'{0}' 패턴에는 '*' 문자를 최대 하나만 사용할 수 있습니다.", - "Prefix_0_with_an_underscore_90025": "'{0}' 앞에 밑줄을 붙이세요.", + "Prefix_0_with_an_underscore_90025": "'{0}' 앞에 밑줄 추가", "Print_names_of_files_part_of_the_compilation_6155": "컴파일의 일부인 파일의 이름을 인쇄합니다.", "Print_names_of_generated_files_part_of_the_compilation_6154": "컴파일의 일부인 생성된 파일의 이름을 인쇄합니다.", "Print_the_compiler_s_version_6019": "컴파일러 버전을 인쇄합니다.", @@ -596,6 +611,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "속성 '{0}'은(는) 이니셜라이저가 없고 생성자에 할당되어 있지 않습니다.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "'{0}' 속성에는 해당 get 접근자에 반환 형식 주석이 없으므로 암시적으로 'any' 형식이 포함됩니다.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "'{0}' 속성에는 해당 set 접근자에 매개 변수 형식 주석이 없으므로 암시적으로 'any' 형식이 포함됩니다.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "'{1}' 형식의 '{0}' 속성을 기본 형식 '{2}'의 동일한 속성에 할당할 수 없습니다.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "'{1}' 형식의 '{0}' 속성을 '{2}' 형식에 할당할 수 없습니다.", "Property_0_is_declared_but_its_value_is_never_read_6138": "속성 '{0}'이(가) 선언은 되었지만 해당 값이 읽히지는 않았습니다.", "Property_0_is_incompatible_with_index_signature_2530": "'{0}' 속성이 인덱스 시그니처와 호환되지 않습니다.", @@ -634,7 +650,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "암시된 'any' 형식이 있는 식 및 선언에서 오류를 발생합니다.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "암시된 'any' 형식이 있는 'this' 식에서 오류를 발생합니다.", "Redirect_output_structure_to_the_directory_6006": "출력 구조를 디렉터리로 리디렉션합니다.", - "Remove_declaration_for_Colon_0_90004": "'{0}'에 대한 선언을 제거합니다.", + "Remove_declaration_for_Colon_0_90004": "'{0}'에 대한 선언 제거", + "Replace_import_with_0_95015": "가져오기를 '{0}'(으)로 바꿉니다.", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "함수의 일부 코드 경로가 값을 반환하지 않는 경우 오류를 보고합니다.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "switch 문의 fallthrough case에 대한 오류를 보고합니다.", "Report_errors_in_js_files_8019": ".js 파일의 오류를 보고합니다.", @@ -680,7 +697,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "내보낸 클래스에 있는 공용 정적 메서드의 반환 형식이 전용 이름 '{0}'을(를) 가지고 있거나 사용 중입니다.", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "이전 프로그램에서 변경되지 않았으므로 '{0}'에서 발생하는 모듈 확인을 다시 사용합니다.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "'{0}' 모듈 확인을 이전 프로그램의 '{1}' 파일에 다시 사용합니다.", - "Rewrite_as_the_indexed_access_type_0_90026": "인덱싱된 액세스 형식 '{0}'(으)로 다시 작성하세요.", + "Rewrite_as_the_indexed_access_type_0_90026": "인덱싱된 액세스 형식 '{0}'(으)로 다시 작성", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "루트 디렉터리를 확인할 수 없어 기본 검색 경로를 건너뜁니다.", "STRATEGY_6039": "전략", "Scoped_package_detected_looking_in_0_6182": "범위가 지정된 패키지가 검색되었습니다. '{0}'에서 찾습니다.", @@ -693,9 +710,9 @@ "Source_Map_Options_6175": "소스 맵 옵션", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "특수화된 오버로드 시그니처는 특수화되지 않은 서명에 할당할 수 없습니다.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "동적 가져오기의 지정자는 스프레드 요소일 수 없습니다.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "ECMAScript 대상 버전을 'ES3'(기본값), 'ES5', 'ES2015', 'ES2016', 'ES2017' 또는 'ESNEXT'로 지정합니다.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "ECMAScript 대상 버전을 'ES3'(기본값), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' 또는 'ESNEXT'로 지정합니다.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "JSX 코드 생성 'preserve', 'react-native' 또는 'react'를 지정합니다.", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "컴파일에 포함할 라이브러리 파일 지정: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "컴파일에 포함할 라이브러리 파일을 지정합니다.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "모듈 코드 생성을 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015' 또는 'ESNext'로 지정합니다.", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "모듈 확인 전략 지정: 'node'(Node.js) 또는 'classic'(TypeScript 1.6 이전).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "'react' JSX 내보내기를 대상으로 하는 경우 사용할 JSX 팩터리 함수를 지정합니다(예: 'React.createElement' 또는 'h').", @@ -705,6 +722,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "입력 파일의 루트 디렉터리를 지정하세요. --outDir이 포함된 출력 디렉터리 구조를 제어하는 데 사용됩니다.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "'new' 식에서 Spread 연산자는 ECMAScript 5 이상을 대상으로 하는 경우에만 사용할 수 있습니다.", "Spread_types_may_only_be_created_from_object_types_2698": "spread 유형은 개체 형식에서만 만들 수 있습니다.", + "Starting_compilation_in_watch_mode_6031": "감시 모드에서 컴파일을 시작하는 중...", "Statement_expected_1129": "문이 필요합니다.", "Statements_are_not_allowed_in_ambient_contexts_1036": "앰비언트 컨텍스트에서는 문이 허용되지 않습니다.", "Static_members_cannot_reference_class_type_parameters_2302": "정적 멤버는 클래스 형식 매개 변수를 참조할 수 없습니다.", @@ -713,7 +731,7 @@ "String_literal_expected_1141": "문자열 리터럴이 필요합니다.", "String_literal_with_double_quotes_expected_1327": "큰따옴표로 묶은 문자열 리터럴이 필요합니다.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "색과 컨텍스트를 사용하여 오류 및 메시지를 스타일화합니다(실험적).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "후속 속성 선언에 같은 형식이 있어야 합니다. '{0}' 속성이 '{1}' 형식이어야 하는데 여기에는 '{2}' 형식이 있습니다.", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "후속 변수 선언에 같은 형식이 있어야 합니다. '{0}' 변수가 '{1}' 형식이어야 하는데 여기에는 '{2}' 형식이 있습니다.", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "'{1}' 패턴에 대한 '{0}' 대체의 형식이 잘못되었습니다. 'string'이 필요한데 '{2}'을(를) 얻었습니다.", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "'{1}' 패턴의 '{0}' 대체에는 '*' 문자를 최대 하나만 사용할 수 있습니다.", @@ -797,7 +815,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "'{0}' 형식은 배열 형식 또는 문자열 형식이 아니거나, 반복기를 반환하는 '[Symbol.iterator]()' 메서드가 없습니다.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "'{0}' 형식은 배열 형식이 아니거나 반복기를 반환하는 '[Symbol.iterator]()' 메서드가 없습니다.", "Type_0_is_not_assignable_to_type_1_2322": "'{0}' 형식은 '{1}' 형식에 할당할 수 없습니다.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "'{0}' 형식을 '{1}' 형식에 할당할 수 없습니다. 이름이 같은 2개의 서로 다른 형식이 있지만 서로 관련은 없습니다.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "'{0}' 형식을 '{1}' 형식에 할당할 수 없습니다. 이름이 같은 2개의 서로 다른 형식이 있지만 서로 관련은 없습니다.", "Type_0_is_not_comparable_to_type_1_2678": "'{0}' 형식을 '{1}' 형식과 비교할 수 없습니다.", "Type_0_is_not_generic_2315": "'{0}' 형식이 제네릭이 아닙니다.", "Type_0_provides_no_match_for_the_signature_1_2658": "'{0}' 형식에서 '{1}' 시그니처에 대한 일치하는 항목을 제공하지 않습니다.", @@ -858,6 +876,7 @@ "Unterminated_template_literal_1160": "종결되지 않은 템플릿 리터럴입니다.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "형식화되지 않은 함수 호출에는 형식 인수를 사용할 수 없습니다.", "Unused_label_7028": "사용되지 않는 레이블입니다.", + "Use_synthetic_default_member_95016": "가상 '기본' 멤버를 사용합니다.", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "ECMAScript 5 이상에서만 'for...of' 문에서 문자열을 사용할 수 있습니다.", "VERSION_6036": "버전", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "'{0}' 형식의 값에 '{1}' 형식과 공통된 속성이 없습니다. 속성을 호출하려고 했습니까?", @@ -913,9 +932,9 @@ "const_declarations_must_be_initialized_1155": "'const' 선언은 초기화해야 합니다.", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "'const' 열거형 멤버 이니셜라이저가 무한 값에 대해 평가되었습니다.", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' 열거형 멤버 이니셜라이저가 허용되지 않은 'NaN' 값에 대해 평가되었습니다.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 열거형은 속성 또는 인덱스 액세스 식 또는 내보내기 할당 또는 가져오기 선언의 오른쪽에서만 사용할 수 있습니다.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 열거형은 속성 또는 인덱스 액세스 식 또는 내보내기 할당 또는 가져오기 선언의 오른쪽 또는 형식 쿼리에서만 사용할 수 있습니다.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "strict 모드에서는 식별자에 대해 'delete'를 호출할 수 없습니다.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum declarations'는 .ts 파일에서만 사용할 수 있습니다.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum 선언'은 .ts 파일에서만 사용할 수 있습니다.", "export_can_only_be_used_in_a_ts_file_8003": "'export='는 .ts 파일에서만 사용할 수 있습니다.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "앰비언트 모듈 및 모듈 확대는 항상 표시되므로 'export' 한정자를 적용할 수 없습니다.", "extends_clause_already_seen_1172": "'extends' 절이 이미 있습니다.", @@ -928,6 +947,7 @@ "implements_clause_already_seen_1175": "'implements' 절이 이미 있습니다.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "'implements clauses'는 .ts 파일에서만 사용할 수 있습니다.", "import_can_only_be_used_in_a_ts_file_8002": "'import ... ='는 .ts 파일에서만 사용할 수 있습니다.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "'infer' 선언은 조건 형식의 'extends' 절에서만 사용할 수 있습니다.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "'interface declarations'는 .ts 파일에서만 사용할 수 있습니다.", "let_declarations_can_only_be_declared_inside_a_block_1157": "'let' 선언은 블록 내부에서만 선언될 수 있습니다.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "'let'은 'let' 또는 'const' 선언에서 이름으로 사용할 수 없습니다.", @@ -963,9 +983,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "'type assertion expressions'는 .ts 파일에서만 사용할 수 있습니다.", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "'type parameter declarations'는 .ts 파일에서만 사용할 수 있습니다.", "types_can_only_be_used_in_a_ts_file_8010": "'types'는 .ts 파일에서만 사용할 수 있습니다.", - "unique_symbol_types_are_not_allowed_here_1335": "여기에서 '고유 기호' 형식은 허용되지 않습니다.", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "'고유 기호' 형식은 변수 문의 변수에만 허용됩니다.", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "'고유 기호' 형식은 바인딩 이름과 함께 변수 선언에 사용할 수 없습니다.", + "unique_symbol_types_are_not_allowed_here_1335": "여기에서 'unique symbol' 형식은 허용되지 않습니다.", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "'unique symbol' 형식은 변수 문의 변수에만 허용됩니다.", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "'unique symbol' 형식은 바인딩 이름과 함께 변수 선언에 사용할 수 없습니다.", "with_statements_are_not_allowed_in_an_async_function_block_1300": "'with' 문은 비동기 함수 블록에서 사용할 수 없습니다.", "with_statements_are_not_allowed_in_strict_mode_1101": "'with' 문은 strict 모드에서 사용할 수 없습니다.", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "'yield' 식은 매개 변수 이니셜라이저에서 사용할 수 없습니다." diff --git a/lib/lib.d.ts b/lib/lib.d.ts index 6d3d437bf6d..25d5a28dc9c 100644 --- a/lib/lib.d.ts +++ b/lib/lib.d.ts @@ -570,7 +570,7 @@ interface Math { */ atan2(y: number, x: number): number; /** - * Returns the smallest number greater than or equal to its numeric argument. + * Returns the smallest integer greater than or equal to its numeric argument. * @param x A numeric expression. */ ceil(x: number): number; @@ -585,7 +585,7 @@ interface Math { */ exp(x: number): number; /** - * Returns the greatest number less than or equal to its numeric argument. + * Returns the greatest integer less than or equal to its numeric argument. * @param x A numeric expression. */ floor(x: number): number; @@ -1005,19 +1005,19 @@ interface ReadonlyArray { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: ReadonlyArray[]): T[]; + concat(...items: ConcatArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | ReadonlyArray)[]): T[]; + concat(...items: (T | ConcatArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1107,6 +1107,13 @@ interface ReadonlyArray { readonly [n: number]: T; } +interface ConcatArray { + readonly length: number; + readonly [n: number]: T; + join(separator?: string): string; + slice(start?: number, end?: number): T[]; +} + interface Array { /** * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. @@ -1117,7 +1124,7 @@ interface Array { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** @@ -1133,12 +1140,12 @@ interface Array { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: ReadonlyArray[]): T[]; + concat(...items: ConcatArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | ReadonlyArray)[]): T[]; + concat(...items: (T | ConcatArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1330,6 +1337,13 @@ type Partial = { [P in keyof T]?: T[P]; }; +/** + * Make all properties in T required + */ +type Required = { + [P in keyof T]-?: T[P]; +}; + /** * Make all properties in T readonly */ @@ -1351,6 +1365,31 @@ type Record = { [P in K]: T; }; +/** + * Exclude from T those types that are assignable to U + */ +type Exclude = T extends U ? never : T; + +/** + * Extract from T those types that are assignable to U + */ +type Extract = T extends U ? T : never; + +/** + * Exclude null and undefined from T + */ +type NonNullable = T extends null | undefined ? never : T; + +/** + * Obtain the return type of a function type + */ +type ReturnType any> = T extends (...args: any[]) => infer R ? R : any; + +/** + * Obtain the return type of a constructor function type + */ +type InstanceType any> = T extends new (...args: any[]) => infer R ? R : any; + /** * Marker for contextual 'this' type */ @@ -4879,7 +4918,7 @@ interface ProgressEventInit extends EventInit { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } @@ -4888,7 +4927,8 @@ interface RegistrationOptions { } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -5206,7 +5246,7 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id: any; + id: BufferSource; transports?: Transport[]; type: ScopedCredentialType; } @@ -5290,17 +5330,11 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -7197,6 +7231,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -7225,8 +7260,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -7714,11 +7749,11 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec slot: string; readonly shadowRoot: ShadowRoot | null; getAttribute(name: string): string | null; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getAttributeNS(namespaceURI: string, localName: string): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: string): NodeListOf; @@ -7821,9 +7856,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -7875,9 +7910,10 @@ declare var External: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -8810,6 +8846,7 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -9015,6 +9052,7 @@ interface HTMLFormElement extends HTMLElement { */ submit(): void; reportValidity(): boolean; + reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -9318,6 +9356,10 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; + /** + * Sets or retrives the content of the page that is to contain. + */ + srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -9613,8 +9655,9 @@ interface HTMLInputElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start?: number, end?: number, direction?: string): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; /** * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * @param n Value to decrement the value by. @@ -10078,10 +10121,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -10175,6 +10214,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ readonly willValidate: boolean; + typemustmatch: boolean; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -11076,8 +11116,9 @@ interface HTMLTextAreaElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start: number, end: number): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -11480,10 +11521,10 @@ declare var IntersectionObserver: { }; interface IntersectionObserverEntry { - readonly boundingClientRect: ClientRect; + readonly boundingClientRect: ClientRect | DOMRect; readonly intersectionRatio: number; - readonly intersectionRect: ClientRect; - readonly rootBounds: ClientRect; + readonly intersectionRect: ClientRect | DOMRect; + readonly rootBounds: ClientRect | DOMRect; readonly target: Element; readonly time: number; readonly isIntersecting: boolean; @@ -11652,7 +11693,7 @@ declare var MediaKeyMessageEvent: { interface MediaKeys { createSession(sessionType?: MediaKeySessionType): MediaKeySession; - setServerCertificate(serverCertificate: any): Promise; + setServerCertificate(serverCertificate: BufferSource): Promise; } declare var MediaKeys: { @@ -11666,10 +11707,10 @@ interface MediaKeySession extends EventTarget { readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; close(): Promise; - generateRequest(initDataType: string, initData: any): Promise; + generateRequest(initDataType: string, initData: BufferSource): Promise; load(sessionId: string): Promise; remove(): Promise; - update(response: any): Promise; + update(response: BufferSource): Promise; } declare var MediaKeySession: { @@ -11680,8 +11721,8 @@ declare var MediaKeySession: { interface MediaKeyStatusMap { readonly size: number; forEach(callback: ForEachCallback): void; - get(keyId: any): MediaKeyStatus; - has(keyId: any): boolean; + get(keyId: BufferSource): MediaKeyStatus; + has(keyId: BufferSource): boolean; } declare var MediaKeyStatusMap: { @@ -13232,7 +13273,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -13281,8 +13322,8 @@ interface Range { detach(): void; expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; insertNode(newNode: Node): void; selectNode(refNode: Node): void; selectNodeContents(refNode: Node): void; @@ -13345,6 +13386,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -13734,6 +13776,8 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -16331,7 +16375,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -16419,8 +16463,8 @@ declare var WaveShaperNode: { }; interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; + getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -16672,24 +16716,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -17469,7 +17513,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -18677,7 +18721,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -18706,6 +18750,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -18775,6 +18823,23 @@ declare var HTMLSummaryElement: { new(): HTMLSummaryElement; }; +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(rectangle?: DOMRectInit): DOMRectReadOnly; +}; + interface EXT_blend_minmax { readonly MIN_EXT: number; readonly MAX_EXT: number; @@ -18793,6 +18858,25 @@ interface EXT_sRGB { readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; } +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new (x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(rectangle?: DOMRectInit): DOMRect; +}; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: number; createVertexArrayOES(): WebGLVertexArrayObjectOES; @@ -18897,6 +18981,118 @@ interface WEBGL_lose_context { restoreContext(): void; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -19061,6 +19257,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -19147,6 +19344,7 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } declare var Audio: { new(src?: string): HTMLAudioElement; }; @@ -19364,7 +19562,7 @@ declare function removeEventListener(type: K, li declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; @@ -19406,6 +19604,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/lib/lib.dom.d.ts b/lib/lib.dom.d.ts index 0c3292a3bbc..32d6620a4eb 100644 --- a/lib/lib.dom.d.ts +++ b/lib/lib.dom.d.ts @@ -781,7 +781,7 @@ interface ProgressEventInit extends EventInit { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } @@ -790,7 +790,8 @@ interface RegistrationOptions { } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -1108,7 +1109,7 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id: any; + id: BufferSource; transports?: Transport[]; type: ScopedCredentialType; } @@ -1192,17 +1193,11 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -3099,6 +3094,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -3127,8 +3123,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -3616,11 +3612,11 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec slot: string; readonly shadowRoot: ShadowRoot | null; getAttribute(name: string): string | null; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getAttributeNS(namespaceURI: string, localName: string): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: string): NodeListOf; @@ -3723,9 +3719,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -3777,9 +3773,10 @@ declare var External: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -4712,6 +4709,7 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4917,6 +4915,7 @@ interface HTMLFormElement extends HTMLElement { */ submit(): void; reportValidity(): boolean; + reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5220,6 +5219,10 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; + /** + * Sets or retrives the content of the page that is to contain. + */ + srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5515,8 +5518,9 @@ interface HTMLInputElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start?: number, end?: number, direction?: string): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; /** * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * @param n Value to decrement the value by. @@ -5980,10 +5984,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -6077,6 +6077,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ readonly willValidate: boolean; + typemustmatch: boolean; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -6978,8 +6979,9 @@ interface HTMLTextAreaElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start: number, end: number): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7382,10 +7384,10 @@ declare var IntersectionObserver: { }; interface IntersectionObserverEntry { - readonly boundingClientRect: ClientRect; + readonly boundingClientRect: ClientRect | DOMRect; readonly intersectionRatio: number; - readonly intersectionRect: ClientRect; - readonly rootBounds: ClientRect; + readonly intersectionRect: ClientRect | DOMRect; + readonly rootBounds: ClientRect | DOMRect; readonly target: Element; readonly time: number; readonly isIntersecting: boolean; @@ -7554,7 +7556,7 @@ declare var MediaKeyMessageEvent: { interface MediaKeys { createSession(sessionType?: MediaKeySessionType): MediaKeySession; - setServerCertificate(serverCertificate: any): Promise; + setServerCertificate(serverCertificate: BufferSource): Promise; } declare var MediaKeys: { @@ -7568,10 +7570,10 @@ interface MediaKeySession extends EventTarget { readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; close(): Promise; - generateRequest(initDataType: string, initData: any): Promise; + generateRequest(initDataType: string, initData: BufferSource): Promise; load(sessionId: string): Promise; remove(): Promise; - update(response: any): Promise; + update(response: BufferSource): Promise; } declare var MediaKeySession: { @@ -7582,8 +7584,8 @@ declare var MediaKeySession: { interface MediaKeyStatusMap { readonly size: number; forEach(callback: ForEachCallback): void; - get(keyId: any): MediaKeyStatus; - has(keyId: any): boolean; + get(keyId: BufferSource): MediaKeyStatus; + has(keyId: BufferSource): boolean; } declare var MediaKeyStatusMap: { @@ -9134,7 +9136,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -9183,8 +9185,8 @@ interface Range { detach(): void; expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; insertNode(newNode: Node): void; selectNode(refNode: Node): void; selectNodeContents(refNode: Node): void; @@ -9247,6 +9249,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -9636,6 +9639,8 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12233,7 +12238,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -12321,8 +12326,8 @@ declare var WaveShaperNode: { }; interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; + getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -12574,24 +12579,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -13371,7 +13376,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -14579,7 +14584,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -14608,6 +14613,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -14677,6 +14686,23 @@ declare var HTMLSummaryElement: { new(): HTMLSummaryElement; }; +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(rectangle?: DOMRectInit): DOMRectReadOnly; +}; + interface EXT_blend_minmax { readonly MIN_EXT: number; readonly MAX_EXT: number; @@ -14695,6 +14721,25 @@ interface EXT_sRGB { readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; } +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new (x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(rectangle?: DOMRectInit): DOMRect; +}; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: number; createVertexArrayOES(): WebGLVertexArrayObjectOES; @@ -14799,6 +14844,118 @@ interface WEBGL_lose_context { restoreContext(): void; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -14963,6 +15120,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -15049,6 +15207,7 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } declare var Audio: { new(src?: string): HTMLAudioElement; }; @@ -15266,7 +15425,7 @@ declare function removeEventListener(type: K, li declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; @@ -15308,6 +15467,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/lib/lib.es2015.collection.d.ts b/lib/lib.es2015.collection.d.ts index 4d84af429be..84b9ad6c0ef 100644 --- a/lib/lib.es2015.collection.d.ts +++ b/lib/lib.es2015.collection.d.ts @@ -30,7 +30,7 @@ interface Map { interface MapConstructor { new (): Map; - new (entries?: [K, V][]): Map; + new (entries?: ReadonlyArray<[K, V]>): Map; readonly prototype: Map; } declare var Map: MapConstructor; @@ -51,7 +51,7 @@ interface WeakMap { interface WeakMapConstructor { new (): WeakMap; - new (entries?: [K, V][]): WeakMap; + new (entries?: ReadonlyArray<[K, V]>): WeakMap; readonly prototype: WeakMap; } declare var WeakMap: WeakMapConstructor; @@ -67,7 +67,7 @@ interface Set { interface SetConstructor { new (): Set; - new (values?: T[]): Set; + new (values?: ReadonlyArray): Set; readonly prototype: Set; } declare var Set: SetConstructor; @@ -78,7 +78,7 @@ interface ReadonlySet { readonly size: number; } -interface WeakSet { +interface WeakSet { add(value: T): this; delete(value: T): boolean; has(value: T): boolean; @@ -86,7 +86,7 @@ interface WeakSet { interface WeakSetConstructor { new (): WeakSet; - new (values?: T[]): WeakSet; + new (values?: ReadonlyArray): WeakSet; readonly prototype: WeakSet; } declare var WeakSet: WeakSetConstructor; diff --git a/lib/lib.es2015.core.d.ts b/lib/lib.es2015.core.d.ts index f1734cedd8b..093fe1fadf1 100644 --- a/lib/lib.es2015.core.d.ts +++ b/lib/lib.es2015.core.d.ts @@ -89,7 +89,7 @@ interface ArrayConstructor { } interface DateConstructor { - new (value: Date): Date; + new (value: number | string | Date): Date; } interface Function { @@ -138,8 +138,9 @@ interface Math { log1p(x: number): number; /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). + * Returns the result of (e^x - 1), which is an implementation-dependent approximation to + * subtracting 1 from the exponential function of x (e raised to the power of x, where e + * is the base of the natural logarithms). * @param x A numeric expression. */ expm1(x: number): number; diff --git a/lib/lib.es2015.generator.d.ts b/lib/lib.es2015.generator.d.ts index d331a58b5c2..df6a987eb77 100644 --- a/lib/lib.es2015.generator.d.ts +++ b/lib/lib.es2015.generator.d.ts @@ -69,4 +69,3 @@ interface GeneratorFunctionConstructor { */ readonly prototype: GeneratorFunction; } -declare var GeneratorFunction: GeneratorFunctionConstructor; diff --git a/lib/lib.es2015.iterable.d.ts b/lib/lib.es2015.iterable.d.ts index 16db98d9919..72f20e690ea 100644 --- a/lib/lib.es2015.iterable.d.ts +++ b/lib/lib.es2015.iterable.d.ts @@ -72,7 +72,7 @@ interface ArrayConstructor { * Creates an array from an iterable object. * @param iterable An iterable object to convert to an array. */ - from(iterable: Iterable): T[]; + from(iterable: Iterable | ArrayLike): T[]; /** * Creates an array from an iterable object. @@ -80,7 +80,7 @@ interface ArrayConstructor { * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; + from(iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } interface ReadonlyArray { @@ -200,7 +200,7 @@ interface SetConstructor { new (iterable: Iterable): Set; } -interface WeakSet { } +interface WeakSet { } interface WeakSetConstructor { new (iterable: Iterable): WeakSet; diff --git a/lib/lib.es2015.symbol.wellknown.d.ts b/lib/lib.es2015.symbol.wellknown.d.ts index 0b97de7157d..65ce71cf3e3 100644 --- a/lib/lib.es2015.symbol.wellknown.d.ts +++ b/lib/lib.es2015.symbol.wellknown.d.ts @@ -138,7 +138,7 @@ interface Set { readonly [Symbol.toStringTag]: "Set"; } -interface WeakSet { +interface WeakSet { readonly [Symbol.toStringTag]: "WeakSet"; } diff --git a/lib/lib.es2016.full.d.ts b/lib/lib.es2016.full.d.ts index b8a7dae039d..6ecfa6a281d 100644 --- a/lib/lib.es2016.full.d.ts +++ b/lib/lib.es2016.full.d.ts @@ -784,7 +784,7 @@ interface ProgressEventInit extends EventInit { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } @@ -793,7 +793,8 @@ interface RegistrationOptions { } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -1111,7 +1112,7 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id: any; + id: BufferSource; transports?: Transport[]; type: ScopedCredentialType; } @@ -1195,17 +1196,11 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -3102,6 +3097,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -3130,8 +3126,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -3619,11 +3615,11 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec slot: string; readonly shadowRoot: ShadowRoot | null; getAttribute(name: string): string | null; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getAttributeNS(namespaceURI: string, localName: string): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: string): NodeListOf; @@ -3726,9 +3722,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -3780,9 +3776,10 @@ declare var External: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -4715,6 +4712,7 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4920,6 +4918,7 @@ interface HTMLFormElement extends HTMLElement { */ submit(): void; reportValidity(): boolean; + reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5223,6 +5222,10 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; + /** + * Sets or retrives the content of the page that is to contain. + */ + srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5518,8 +5521,9 @@ interface HTMLInputElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start?: number, end?: number, direction?: string): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; /** * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * @param n Value to decrement the value by. @@ -5983,10 +5987,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -6080,6 +6080,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ readonly willValidate: boolean; + typemustmatch: boolean; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -6981,8 +6982,9 @@ interface HTMLTextAreaElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start: number, end: number): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7385,10 +7387,10 @@ declare var IntersectionObserver: { }; interface IntersectionObserverEntry { - readonly boundingClientRect: ClientRect; + readonly boundingClientRect: ClientRect | DOMRect; readonly intersectionRatio: number; - readonly intersectionRect: ClientRect; - readonly rootBounds: ClientRect; + readonly intersectionRect: ClientRect | DOMRect; + readonly rootBounds: ClientRect | DOMRect; readonly target: Element; readonly time: number; readonly isIntersecting: boolean; @@ -7557,7 +7559,7 @@ declare var MediaKeyMessageEvent: { interface MediaKeys { createSession(sessionType?: MediaKeySessionType): MediaKeySession; - setServerCertificate(serverCertificate: any): Promise; + setServerCertificate(serverCertificate: BufferSource): Promise; } declare var MediaKeys: { @@ -7571,10 +7573,10 @@ interface MediaKeySession extends EventTarget { readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; close(): Promise; - generateRequest(initDataType: string, initData: any): Promise; + generateRequest(initDataType: string, initData: BufferSource): Promise; load(sessionId: string): Promise; remove(): Promise; - update(response: any): Promise; + update(response: BufferSource): Promise; } declare var MediaKeySession: { @@ -7585,8 +7587,8 @@ declare var MediaKeySession: { interface MediaKeyStatusMap { readonly size: number; forEach(callback: ForEachCallback): void; - get(keyId: any): MediaKeyStatus; - has(keyId: any): boolean; + get(keyId: BufferSource): MediaKeyStatus; + has(keyId: BufferSource): boolean; } declare var MediaKeyStatusMap: { @@ -9137,7 +9139,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -9186,8 +9188,8 @@ interface Range { detach(): void; expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; insertNode(newNode: Node): void; selectNode(refNode: Node): void; selectNodeContents(refNode: Node): void; @@ -9250,6 +9252,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -9639,6 +9642,8 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12236,7 +12241,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -12324,8 +12329,8 @@ declare var WaveShaperNode: { }; interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; + getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -12577,24 +12582,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -13374,7 +13379,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -14582,7 +14587,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -14611,6 +14616,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -14680,6 +14689,23 @@ declare var HTMLSummaryElement: { new(): HTMLSummaryElement; }; +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(rectangle?: DOMRectInit): DOMRectReadOnly; +}; + interface EXT_blend_minmax { readonly MIN_EXT: number; readonly MAX_EXT: number; @@ -14698,6 +14724,25 @@ interface EXT_sRGB { readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; } +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new (x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(rectangle?: DOMRectInit): DOMRect; +}; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: number; createVertexArrayOES(): WebGLVertexArrayObjectOES; @@ -14802,6 +14847,118 @@ interface WEBGL_lose_context { restoreContext(): void; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -14966,6 +15123,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -15052,6 +15210,7 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } declare var Audio: { new(src?: string): HTMLAudioElement; }; @@ -15269,7 +15428,7 @@ declare function removeEventListener(type: K, li declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; @@ -15311,6 +15470,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/lib/lib.es2017.full.d.ts b/lib/lib.es2017.full.d.ts index 6e021331e37..6904f7e78a4 100644 --- a/lib/lib.es2017.full.d.ts +++ b/lib/lib.es2017.full.d.ts @@ -789,7 +789,7 @@ interface ProgressEventInit extends EventInit { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } @@ -798,7 +798,8 @@ interface RegistrationOptions { } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -1116,7 +1117,7 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id: any; + id: BufferSource; transports?: Transport[]; type: ScopedCredentialType; } @@ -1200,17 +1201,11 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -3107,6 +3102,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -3135,8 +3131,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -3624,11 +3620,11 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec slot: string; readonly shadowRoot: ShadowRoot | null; getAttribute(name: string): string | null; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getAttributeNS(namespaceURI: string, localName: string): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: string): NodeListOf; @@ -3731,9 +3727,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -3785,9 +3781,10 @@ declare var External: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -4720,6 +4717,7 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4925,6 +4923,7 @@ interface HTMLFormElement extends HTMLElement { */ submit(): void; reportValidity(): boolean; + reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5228,6 +5227,10 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; + /** + * Sets or retrives the content of the page that is to contain. + */ + srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5523,8 +5526,9 @@ interface HTMLInputElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start?: number, end?: number, direction?: string): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; /** * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * @param n Value to decrement the value by. @@ -5988,10 +5992,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -6085,6 +6085,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ readonly willValidate: boolean; + typemustmatch: boolean; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -6986,8 +6987,9 @@ interface HTMLTextAreaElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start: number, end: number): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7390,10 +7392,10 @@ declare var IntersectionObserver: { }; interface IntersectionObserverEntry { - readonly boundingClientRect: ClientRect; + readonly boundingClientRect: ClientRect | DOMRect; readonly intersectionRatio: number; - readonly intersectionRect: ClientRect; - readonly rootBounds: ClientRect; + readonly intersectionRect: ClientRect | DOMRect; + readonly rootBounds: ClientRect | DOMRect; readonly target: Element; readonly time: number; readonly isIntersecting: boolean; @@ -7562,7 +7564,7 @@ declare var MediaKeyMessageEvent: { interface MediaKeys { createSession(sessionType?: MediaKeySessionType): MediaKeySession; - setServerCertificate(serverCertificate: any): Promise; + setServerCertificate(serverCertificate: BufferSource): Promise; } declare var MediaKeys: { @@ -7576,10 +7578,10 @@ interface MediaKeySession extends EventTarget { readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; close(): Promise; - generateRequest(initDataType: string, initData: any): Promise; + generateRequest(initDataType: string, initData: BufferSource): Promise; load(sessionId: string): Promise; remove(): Promise; - update(response: any): Promise; + update(response: BufferSource): Promise; } declare var MediaKeySession: { @@ -7590,8 +7592,8 @@ declare var MediaKeySession: { interface MediaKeyStatusMap { readonly size: number; forEach(callback: ForEachCallback): void; - get(keyId: any): MediaKeyStatus; - has(keyId: any): boolean; + get(keyId: BufferSource): MediaKeyStatus; + has(keyId: BufferSource): boolean; } declare var MediaKeyStatusMap: { @@ -9142,7 +9144,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -9191,8 +9193,8 @@ interface Range { detach(): void; expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; insertNode(newNode: Node): void; selectNode(refNode: Node): void; selectNodeContents(refNode: Node): void; @@ -9255,6 +9257,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -9644,6 +9647,8 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12241,7 +12246,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -12329,8 +12334,8 @@ declare var WaveShaperNode: { }; interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; + getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -12582,24 +12587,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -13379,7 +13384,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -14587,7 +14592,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -14616,6 +14621,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -14685,6 +14694,23 @@ declare var HTMLSummaryElement: { new(): HTMLSummaryElement; }; +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(rectangle?: DOMRectInit): DOMRectReadOnly; +}; + interface EXT_blend_minmax { readonly MIN_EXT: number; readonly MAX_EXT: number; @@ -14703,6 +14729,25 @@ interface EXT_sRGB { readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; } +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new (x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(rectangle?: DOMRectInit): DOMRect; +}; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: number; createVertexArrayOES(): WebGLVertexArrayObjectOES; @@ -14807,6 +14852,118 @@ interface WEBGL_lose_context { restoreContext(): void; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -14971,6 +15128,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -15057,6 +15215,7 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } declare var Audio: { new(src?: string): HTMLAudioElement; }; @@ -15274,7 +15433,7 @@ declare function removeEventListener(type: K, li declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; @@ -15316,6 +15475,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/lib/lib.es2017.object.d.ts b/lib/lib.es2017.object.d.ts index c0f782464ff..65aa1f95928 100644 --- a/lib/lib.es2017.object.d.ts +++ b/lib/lib.es2017.object.d.ts @@ -23,25 +23,25 @@ interface ObjectConstructor { * Returns an array of values of the enumerable properties of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - values(o: { [s: string]: T } | { [n: number]: T }): T[]; + values(o: { [s: string]: T } | ArrayLike): T[]; /** * Returns an array of values of the enumerable properties of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - values(o: any): any[]; + values(o: {}): any[]; /** * Returns an array of key/values of the enumerable properties of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - entries(o: { [s: string]: T } | { [n: number]: T }): [string, T][]; + entries(o: { [s: string]: T } | ArrayLike): [string, T][]; /** * Returns an array of key/values of the enumerable properties of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - entries(o: any): [string, any][]; + entries(o: {}): [string, any][]; /** * Returns an object containing all own property descriptors of an object diff --git a/lib/lib.es2018.d.ts b/lib/lib.es2018.d.ts index c7ea194ecfd..820467445eb 100644 --- a/lib/lib.es2018.d.ts +++ b/lib/lib.es2018.d.ts @@ -18,4 +18,4 @@ and limitations under the License. /// -/// \ No newline at end of file +/// diff --git a/lib/lib.es2018.full.d.ts b/lib/lib.es2018.full.d.ts index 5333251034a..eef11659216 100644 --- a/lib/lib.es2018.full.d.ts +++ b/lib/lib.es2018.full.d.ts @@ -21,6 +21,7 @@ and limitations under the License. /// + ///////////////////////////// /// DOM APIs ///////////////////////////// @@ -783,7 +784,7 @@ interface ProgressEventInit extends EventInit { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } @@ -792,7 +793,8 @@ interface RegistrationOptions { } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -1110,7 +1112,7 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id: any; + id: BufferSource; transports?: Transport[]; type: ScopedCredentialType; } @@ -1194,17 +1196,11 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -3101,6 +3097,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -3129,8 +3126,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -3618,11 +3615,11 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec slot: string; readonly shadowRoot: ShadowRoot | null; getAttribute(name: string): string | null; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getAttributeNS(namespaceURI: string, localName: string): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: string): NodeListOf; @@ -3725,9 +3722,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -3779,9 +3776,10 @@ declare var External: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -4714,6 +4712,7 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4919,6 +4918,7 @@ interface HTMLFormElement extends HTMLElement { */ submit(): void; reportValidity(): boolean; + reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5222,6 +5222,10 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; + /** + * Sets or retrives the content of the page that is to contain. + */ + srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5517,8 +5521,9 @@ interface HTMLInputElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start?: number, end?: number, direction?: string): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; /** * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * @param n Value to decrement the value by. @@ -5982,10 +5987,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -6079,6 +6080,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ readonly willValidate: boolean; + typemustmatch: boolean; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -6980,8 +6982,9 @@ interface HTMLTextAreaElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start: number, end: number): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7384,10 +7387,10 @@ declare var IntersectionObserver: { }; interface IntersectionObserverEntry { - readonly boundingClientRect: ClientRect; + readonly boundingClientRect: ClientRect | DOMRect; readonly intersectionRatio: number; - readonly intersectionRect: ClientRect; - readonly rootBounds: ClientRect; + readonly intersectionRect: ClientRect | DOMRect; + readonly rootBounds: ClientRect | DOMRect; readonly target: Element; readonly time: number; readonly isIntersecting: boolean; @@ -7556,7 +7559,7 @@ declare var MediaKeyMessageEvent: { interface MediaKeys { createSession(sessionType?: MediaKeySessionType): MediaKeySession; - setServerCertificate(serverCertificate: any): Promise; + setServerCertificate(serverCertificate: BufferSource): Promise; } declare var MediaKeys: { @@ -7570,10 +7573,10 @@ interface MediaKeySession extends EventTarget { readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; close(): Promise; - generateRequest(initDataType: string, initData: any): Promise; + generateRequest(initDataType: string, initData: BufferSource): Promise; load(sessionId: string): Promise; remove(): Promise; - update(response: any): Promise; + update(response: BufferSource): Promise; } declare var MediaKeySession: { @@ -7584,8 +7587,8 @@ declare var MediaKeySession: { interface MediaKeyStatusMap { readonly size: number; forEach(callback: ForEachCallback): void; - get(keyId: any): MediaKeyStatus; - has(keyId: any): boolean; + get(keyId: BufferSource): MediaKeyStatus; + has(keyId: BufferSource): boolean; } declare var MediaKeyStatusMap: { @@ -9136,7 +9139,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -9185,8 +9188,8 @@ interface Range { detach(): void; expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; insertNode(newNode: Node): void; selectNode(refNode: Node): void; selectNodeContents(refNode: Node): void; @@ -9249,6 +9252,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -9638,6 +9642,8 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12235,7 +12241,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -12323,8 +12329,8 @@ declare var WaveShaperNode: { }; interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; + getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -12576,24 +12582,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -13373,7 +13379,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -14581,7 +14587,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -14610,6 +14616,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -14679,6 +14689,23 @@ declare var HTMLSummaryElement: { new(): HTMLSummaryElement; }; +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(rectangle?: DOMRectInit): DOMRectReadOnly; +}; + interface EXT_blend_minmax { readonly MIN_EXT: number; readonly MAX_EXT: number; @@ -14697,6 +14724,25 @@ interface EXT_sRGB { readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; } +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new (x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(rectangle?: DOMRectInit): DOMRect; +}; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: number; createVertexArrayOES(): WebGLVertexArrayObjectOES; @@ -14801,6 +14847,118 @@ interface WEBGL_lose_context { restoreContext(): void; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -14965,6 +15123,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -15051,6 +15210,7 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } declare var Audio: { new(src?: string): HTMLAudioElement; }; @@ -15268,7 +15428,7 @@ declare function removeEventListener(type: K, li declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; @@ -15310,6 +15470,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index 07ffe74c05f..6c26ab4b63e 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -570,7 +570,7 @@ interface Math { */ atan2(y: number, x: number): number; /** - * Returns the smallest number greater than or equal to its numeric argument. + * Returns the smallest integer greater than or equal to its numeric argument. * @param x A numeric expression. */ ceil(x: number): number; @@ -585,7 +585,7 @@ interface Math { */ exp(x: number): number; /** - * Returns the greatest number less than or equal to its numeric argument. + * Returns the greatest integer less than or equal to its numeric argument. * @param x A numeric expression. */ floor(x: number): number; @@ -792,7 +792,8 @@ interface Date { interface DateConstructor { new(): Date; - new(value: string | number): Date; + new(value: number): Date; + new(value: string): Date; new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; (): string; readonly prototype: Date; @@ -1004,19 +1005,19 @@ interface ReadonlyArray { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: ReadonlyArray[]): T[]; + concat(...items: ConcatArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | ReadonlyArray)[]): T[]; + concat(...items: (T | ConcatArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1106,6 +1107,13 @@ interface ReadonlyArray { readonly [n: number]: T; } +interface ConcatArray { + readonly length: number; + readonly [n: number]: T; + join(separator?: string): string; + slice(start?: number, end?: number): T[]; +} + interface Array { /** * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. @@ -1116,7 +1124,7 @@ interface Array { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** @@ -1132,12 +1140,12 @@ interface Array { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: ReadonlyArray[]): T[]; + concat(...items: ConcatArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | ReadonlyArray)[]): T[]; + concat(...items: (T | ConcatArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1329,6 +1337,13 @@ type Partial = { [P in keyof T]?: T[P]; }; +/** + * Make all properties in T required + */ +type Required = { + [P in keyof T]-?: T[P]; +}; + /** * Make all properties in T readonly */ @@ -1350,6 +1365,31 @@ type Record = { [P in K]: T; }; +/** + * Exclude from T those types that are assignable to U + */ +type Exclude = T extends U ? never : T; + +/** + * Extract from T those types that are assignable to U + */ +type Extract = T extends U ? T : never; + +/** + * Exclude null and undefined from T + */ +type NonNullable = T extends null | undefined ? never : T; + +/** + * Obtain the return type of a function type + */ +type ReturnType any> = T extends (...args: any[]) => infer R ? R : any; + +/** + * Obtain the return type of a constructor function type + */ +type InstanceType any> = T extends new (...args: any[]) => infer R ? R : any; + /** * Marker for contextual 'this' type */ diff --git a/lib/lib.es6.d.ts b/lib/lib.es6.d.ts index 9d6b6b345fa..5275940aa24 100644 --- a/lib/lib.es6.d.ts +++ b/lib/lib.es6.d.ts @@ -570,7 +570,7 @@ interface Math { */ atan2(y: number, x: number): number; /** - * Returns the smallest number greater than or equal to its numeric argument. + * Returns the smallest integer greater than or equal to its numeric argument. * @param x A numeric expression. */ ceil(x: number): number; @@ -585,7 +585,7 @@ interface Math { */ exp(x: number): number; /** - * Returns the greatest number less than or equal to its numeric argument. + * Returns the greatest integer less than or equal to its numeric argument. * @param x A numeric expression. */ floor(x: number): number; @@ -1005,19 +1005,19 @@ interface ReadonlyArray { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: ReadonlyArray[]): T[]; + concat(...items: ConcatArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | ReadonlyArray)[]): T[]; + concat(...items: (T | ConcatArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1107,6 +1107,13 @@ interface ReadonlyArray { readonly [n: number]: T; } +interface ConcatArray { + readonly length: number; + readonly [n: number]: T; + join(separator?: string): string; + slice(start?: number, end?: number): T[]; +} + interface Array { /** * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. @@ -1117,7 +1124,7 @@ interface Array { */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods. + * Returns a string representation of an array. The elements are converted to string using their toLocalString methods. */ toLocaleString(): string; /** @@ -1133,12 +1140,12 @@ interface Array { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: ReadonlyArray[]): T[]; + concat(...items: ConcatArray[]): T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(...items: (T | ReadonlyArray)[]): T[]; + concat(...items: (T | ConcatArray)[]): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -1330,6 +1337,13 @@ type Partial = { [P in keyof T]?: T[P]; }; +/** + * Make all properties in T required + */ +type Required = { + [P in keyof T]-?: T[P]; +}; + /** * Make all properties in T readonly */ @@ -1351,6 +1365,31 @@ type Record = { [P in K]: T; }; +/** + * Exclude from T those types that are assignable to U + */ +type Exclude = T extends U ? never : T; + +/** + * Extract from T those types that are assignable to U + */ +type Extract = T extends U ? T : never; + +/** + * Exclude null and undefined from T + */ +type NonNullable = T extends null | undefined ? never : T; + +/** + * Obtain the return type of a function type + */ +type ReturnType any> = T extends (...args: any[]) => infer R ? R : any; + +/** + * Obtain the return type of a constructor function type + */ +type InstanceType any> = T extends new (...args: any[]) => infer R ? R : any; + /** * Marker for contextual 'this' type */ @@ -4187,7 +4226,7 @@ interface ArrayConstructor { } interface DateConstructor { - new (value: Date): Date; + new (value: number | string | Date): Date; } interface Function { @@ -4236,8 +4275,9 @@ interface Math { log1p(x: number): number; /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). + * Returns the result of (e^x - 1), which is an implementation-dependent approximation to + * subtracting 1 from the exponential function of x (e raised to the power of x, where e + * is the base of the natural logarithms). * @param x A numeric expression. */ expm1(x: number): number; @@ -4655,7 +4695,7 @@ interface Map { interface MapConstructor { new (): Map; - new (entries?: [K, V][]): Map; + new (entries?: ReadonlyArray<[K, V]>): Map; readonly prototype: Map; } declare var Map: MapConstructor; @@ -4676,7 +4716,7 @@ interface WeakMap { interface WeakMapConstructor { new (): WeakMap; - new (entries?: [K, V][]): WeakMap; + new (entries?: ReadonlyArray<[K, V]>): WeakMap; readonly prototype: WeakMap; } declare var WeakMap: WeakMapConstructor; @@ -4692,7 +4732,7 @@ interface Set { interface SetConstructor { new (): Set; - new (values?: T[]): Set; + new (values?: ReadonlyArray): Set; readonly prototype: Set; } declare var Set: SetConstructor; @@ -4703,7 +4743,7 @@ interface ReadonlySet { readonly size: number; } -interface WeakSet { +interface WeakSet { add(value: T): this; delete(value: T): boolean; has(value: T): boolean; @@ -4711,7 +4751,7 @@ interface WeakSet { interface WeakSetConstructor { new (): WeakSet; - new (values?: T[]): WeakSet; + new (values?: ReadonlyArray): WeakSet; readonly prototype: WeakSet; } declare var WeakSet: WeakSetConstructor; @@ -4768,7 +4808,6 @@ interface GeneratorFunctionConstructor { */ readonly prototype: GeneratorFunction; } -declare var GeneratorFunction: GeneratorFunctionConstructor; /// @@ -4825,7 +4864,7 @@ interface ArrayConstructor { * Creates an array from an iterable object. * @param iterable An iterable object to convert to an array. */ - from(iterable: Iterable): T[]; + from(iterable: Iterable | ArrayLike): T[]; /** * Creates an array from an iterable object. @@ -4833,7 +4872,7 @@ interface ArrayConstructor { * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; + from(iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } interface ReadonlyArray { @@ -4953,7 +4992,7 @@ interface SetConstructor { new (iterable: Iterable): Set; } -interface WeakSet { } +interface WeakSet { } interface WeakSetConstructor { new (iterable: Iterable): WeakSet; @@ -5648,7 +5687,7 @@ interface Set { readonly [Symbol.toStringTag]: "Set"; } -interface WeakSet { +interface WeakSet { readonly [Symbol.toStringTag]: "WeakSet"; } @@ -6590,7 +6629,7 @@ interface ProgressEventInit extends EventInit { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } @@ -6599,7 +6638,8 @@ interface RegistrationOptions { } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -6917,7 +6957,7 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id: any; + id: BufferSource; transports?: Transport[]; type: ScopedCredentialType; } @@ -7001,17 +7041,11 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -8908,6 +8942,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -8936,8 +8971,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -9425,11 +9460,11 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec slot: string; readonly shadowRoot: ShadowRoot | null; getAttribute(name: string): string | null; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getAttributeNS(namespaceURI: string, localName: string): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: string): NodeListOf; @@ -9532,9 +9567,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -9586,9 +9621,10 @@ declare var External: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -10521,6 +10557,7 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -10726,6 +10763,7 @@ interface HTMLFormElement extends HTMLElement { */ submit(): void; reportValidity(): boolean; + reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -11029,6 +11067,10 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; + /** + * Sets or retrives the content of the page that is to contain. + */ + srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -11324,8 +11366,9 @@ interface HTMLInputElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start?: number, end?: number, direction?: string): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; /** * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * @param n Value to decrement the value by. @@ -11789,10 +11832,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -11886,6 +11925,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ readonly willValidate: boolean; + typemustmatch: boolean; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -12787,8 +12827,9 @@ interface HTMLTextAreaElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start: number, end: number): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -13191,10 +13232,10 @@ declare var IntersectionObserver: { }; interface IntersectionObserverEntry { - readonly boundingClientRect: ClientRect; + readonly boundingClientRect: ClientRect | DOMRect; readonly intersectionRatio: number; - readonly intersectionRect: ClientRect; - readonly rootBounds: ClientRect; + readonly intersectionRect: ClientRect | DOMRect; + readonly rootBounds: ClientRect | DOMRect; readonly target: Element; readonly time: number; readonly isIntersecting: boolean; @@ -13363,7 +13404,7 @@ declare var MediaKeyMessageEvent: { interface MediaKeys { createSession(sessionType?: MediaKeySessionType): MediaKeySession; - setServerCertificate(serverCertificate: any): Promise; + setServerCertificate(serverCertificate: BufferSource): Promise; } declare var MediaKeys: { @@ -13377,10 +13418,10 @@ interface MediaKeySession extends EventTarget { readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; close(): Promise; - generateRequest(initDataType: string, initData: any): Promise; + generateRequest(initDataType: string, initData: BufferSource): Promise; load(sessionId: string): Promise; remove(): Promise; - update(response: any): Promise; + update(response: BufferSource): Promise; } declare var MediaKeySession: { @@ -13391,8 +13432,8 @@ declare var MediaKeySession: { interface MediaKeyStatusMap { readonly size: number; forEach(callback: ForEachCallback): void; - get(keyId: any): MediaKeyStatus; - has(keyId: any): boolean; + get(keyId: BufferSource): MediaKeyStatus; + has(keyId: BufferSource): boolean; } declare var MediaKeyStatusMap: { @@ -14943,7 +14984,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -14992,8 +15033,8 @@ interface Range { detach(): void; expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; insertNode(newNode: Node): void; selectNode(refNode: Node): void; selectNodeContents(refNode: Node): void; @@ -15056,6 +15097,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -15445,6 +15487,8 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -18042,7 +18086,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -18130,8 +18174,8 @@ declare var WaveShaperNode: { }; interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; + getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -18383,24 +18427,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -19180,7 +19224,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -20388,7 +20432,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -20417,6 +20461,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -20486,6 +20534,23 @@ declare var HTMLSummaryElement: { new(): HTMLSummaryElement; }; +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(rectangle?: DOMRectInit): DOMRectReadOnly; +}; + interface EXT_blend_minmax { readonly MIN_EXT: number; readonly MAX_EXT: number; @@ -20504,6 +20569,25 @@ interface EXT_sRGB { readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; } +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new (x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(rectangle?: DOMRectInit): DOMRect; +}; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: number; createVertexArrayOES(): WebGLVertexArrayObjectOES; @@ -20608,6 +20692,118 @@ interface WEBGL_lose_context { restoreContext(): void; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -20772,6 +20968,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -20858,6 +21055,7 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } declare var Audio: { new(src?: string): HTMLAudioElement; }; @@ -21075,7 +21273,7 @@ declare function removeEventListener(type: K, li declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; @@ -21117,6 +21315,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/lib/lib.esnext.array.d.ts b/lib/lib.esnext.array.d.ts new file mode 100644 index 00000000000..ce26358d3d6 --- /dev/null +++ b/lib/lib.esnext.array.d.ts @@ -0,0 +1,223 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +interface ReadonlyArray { + + /** + * Calls a defined callback function on each element of an array. Then, flattens the result into + * a new array. + * This is identical to a map followed by a flatten of depth 1. + * + * @param callback A function that accepts up to three arguments. The flatMap method calls the + * callback function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callback function. If + * thisArg is omitted, undefined is used as the this value. + */ + flatMap ( + callback: (this: This, value: T, index: number, array: T[]) => U|U[], + thisArg?: This + ): U[] + + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: + ReadonlyArray | + + ReadonlyArray> | + ReadonlyArray[]> | + ReadonlyArray[][]> | + ReadonlyArray[][][]> | + + ReadonlyArray>> | + ReadonlyArray[][]>> | + ReadonlyArray>[][]> | + ReadonlyArray[]>[]> | + ReadonlyArray>[]> | + ReadonlyArray[]>> | + + ReadonlyArray>>> | + ReadonlyArray[]>>> | + ReadonlyArray>[]>> | + ReadonlyArray>>[]> | + + ReadonlyArray>>>>, + depth: 4): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: + ReadonlyArray | + + ReadonlyArray[][]> | + ReadonlyArray[]> | + ReadonlyArray> | + + ReadonlyArray>> | + ReadonlyArray[]>> | + ReadonlyArray>[]> | + + ReadonlyArray>>>, + depth: 3): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: + ReadonlyArray | + + ReadonlyArray> | + ReadonlyArray[]> | + + ReadonlyArray>>, + depth: 2): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: + ReadonlyArray | + ReadonlyArray>, + depth?: 1 + ): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: + ReadonlyArray, + depth: 0 + ): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. If no depth is provided, flatten method defaults to the depth of 1. + * + * @param depth The maximum recursion depth + */ + flatten(depth?: number): any[]; + } + +interface Array { + + /** + * Calls a defined callback function on each element of an array. Then, flattens the result into + * a new array. + * This is identical to a map followed by a flatten of depth 1. + * + * @param callback A function that accepts up to three arguments. The flatMap method calls the + * callback function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callback function. If + * thisArg is omitted, undefined is used as the this value. + */ + flatMap ( + callback: (this: This, value: T, index: number, array: T[]) => U|U[], + thisArg?: This + ): U[] + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[][][][][][][][], depth: 7): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[][][][][][][], depth: 6): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[][][][][][], depth: 5): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[][][][][], depth: 4): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[][][][], depth: 3): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[][][], depth: 2): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[][], depth?: 1): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. + * + * @param depth The maximum recursion depth + */ + flatten(this: U[], depth: 0): U[]; + + /** + * Returns a new array with all sub-array elements concatenated into it recursively up to the + * specified depth. If no depth is provided, flatten method defaults to the depth of 1. + * + * @param depth The maximum recursion depth + */ + flatten(depth?: number): any[]; +} diff --git a/lib/lib.esnext.d.ts b/lib/lib.esnext.d.ts index ebc1e9d5299..0947f078418 100644 --- a/lib/lib.esnext.d.ts +++ b/lib/lib.esnext.d.ts @@ -18,5 +18,7 @@ and limitations under the License. /// -/// +/// /// +/// +/// diff --git a/lib/lib.esnext.full.d.ts b/lib/lib.esnext.full.d.ts index cb83c656085..5f047aa2673 100644 --- a/lib/lib.esnext.full.d.ts +++ b/lib/lib.esnext.full.d.ts @@ -18,8 +18,10 @@ and limitations under the License. /// -/// +/// /// +/// +/// @@ -785,7 +787,7 @@ interface ProgressEventInit extends EventInit { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } @@ -794,7 +796,8 @@ interface RegistrationOptions { } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -1112,7 +1115,7 @@ interface RTCTransportStats extends RTCStats { } interface ScopedCredentialDescriptor { - id: any; + id: BufferSource; transports?: Transport[]; type: ScopedCredentialType; } @@ -1196,17 +1199,11 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} +type WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; }; -interface WebKitErrorCallback { - (evt: Event): void; -} +type WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; }; -interface WebKitFileCallback { - (evt: Event): void; -} +type WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; }; interface AnalyserNode extends AudioNode { fftSize: number; @@ -3103,6 +3100,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Gets or sets the version attribute specified in the declaration of an XML document. */ xmlVersion: string | null; + onvisibilitychange: (this: Document, ev: Event) => any; adoptNode(source: T): T; captureEvents(): void; caretRangeFromPoint(x: number, y: number): Range; @@ -3131,8 +3129,8 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven * Creates an instance of the element for the specified tag. * @param tagName The name of an element. */ - createElement(tagName: K): HTMLElementTagNameMap[K]; - createElement(tagName: string): HTMLElement; + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "a"): SVGAElement; createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: "circle"): SVGCircleElement; @@ -3620,11 +3618,11 @@ interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelec slot: string; readonly shadowRoot: ShadowRoot | null; getAttribute(name: string): string | null; - getAttributeNode(name: string): Attr; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getAttributeNode(name: string): Attr | null; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null; getAttributeNS(namespaceURI: string, localName: string): string; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: K): NodeListOf; getElementsByTagName(name: string): NodeListOf; @@ -3727,9 +3725,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -3781,9 +3779,10 @@ declare var External: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -4716,6 +4715,7 @@ interface HTMLElement extends Element { dragDrop(): boolean; focus(): void; msGetInputContext(): MSInputMethodContext; + animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation; addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -4921,6 +4921,7 @@ interface HTMLFormElement extends HTMLElement { */ submit(): void; reportValidity(): boolean; + reportValidity(): boolean; addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5224,6 +5225,10 @@ interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { * Sets or retrieves the width of the object. */ width: string; + /** + * Sets or retrives the content of the page that is to contain. + */ + srcdoc: string; addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -5519,8 +5524,9 @@ interface HTMLInputElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start?: number, end?: number, direction?: string): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; /** * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. * @param n Value to decrement the value by. @@ -5984,10 +5990,6 @@ declare var HTMLModElement: { interface HTMLObjectElement extends HTMLElement, GetSVGDocument { align: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; /** * Gets or sets the optional alternative HTML script to execute if the object fails to load. */ @@ -6081,6 +6083,7 @@ interface HTMLObjectElement extends HTMLElement, GetSVGDocument { * Returns whether an element will successfully validate based on forms validation rules and constraints. */ readonly willValidate: boolean; + typemustmatch: boolean; /** * Returns whether a form will validate when it is submitted, without having to submit it. */ @@ -6982,8 +6985,9 @@ interface HTMLTextAreaElement extends HTMLElement { * Sets the start and end positions of a selection in a text field. * @param start The offset into the text field for the start of the selection. * @param end The offset into the text field for the end of the selection. + * @param direction The direction in which the selection is performed. */ - setSelectionRange(start: number, end: number): void; + setSelectionRange(start: number, end: number, direction?: "forward" | "backward" | "none"): void; addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -7386,10 +7390,10 @@ declare var IntersectionObserver: { }; interface IntersectionObserverEntry { - readonly boundingClientRect: ClientRect; + readonly boundingClientRect: ClientRect | DOMRect; readonly intersectionRatio: number; - readonly intersectionRect: ClientRect; - readonly rootBounds: ClientRect; + readonly intersectionRect: ClientRect | DOMRect; + readonly rootBounds: ClientRect | DOMRect; readonly target: Element; readonly time: number; readonly isIntersecting: boolean; @@ -7558,7 +7562,7 @@ declare var MediaKeyMessageEvent: { interface MediaKeys { createSession(sessionType?: MediaKeySessionType): MediaKeySession; - setServerCertificate(serverCertificate: any): Promise; + setServerCertificate(serverCertificate: BufferSource): Promise; } declare var MediaKeys: { @@ -7572,10 +7576,10 @@ interface MediaKeySession extends EventTarget { readonly keyStatuses: MediaKeyStatusMap; readonly sessionId: string; close(): Promise; - generateRequest(initDataType: string, initData: any): Promise; + generateRequest(initDataType: string, initData: BufferSource): Promise; load(sessionId: string): Promise; remove(): Promise; - update(response: any): Promise; + update(response: BufferSource): Promise; } declare var MediaKeySession: { @@ -7586,8 +7590,8 @@ declare var MediaKeySession: { interface MediaKeyStatusMap { readonly size: number; forEach(callback: ForEachCallback): void; - get(keyId: any): MediaKeyStatus; - has(keyId: any): boolean; + get(keyId: BufferSource): MediaKeyStatus; + has(keyId: BufferSource): boolean; } declare var MediaKeyStatusMap: { @@ -9138,7 +9142,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -9187,8 +9191,8 @@ interface Range { detach(): void; expand(Unit: ExpandGranularity): boolean; extractContents(): DocumentFragment; - getBoundingClientRect(): ClientRect; - getClientRects(): ClientRectList; + getBoundingClientRect(): ClientRect | DOMRect; + getClientRects(): ClientRectList | DOMRectList; insertNode(newNode: Node): void; selectNode(refNode: Node): void; selectNodeContents(refNode: Node): void; @@ -9251,6 +9255,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -9640,6 +9645,8 @@ interface Screen extends EventTarget { readonly width: number; msLockOrientation(orientations: string | string[]): boolean; msUnlockOrientation(): void; + lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean; + unlockOrientation(): void; addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -12237,7 +12244,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -12325,8 +12332,8 @@ declare var WaveShaperNode: { }; interface WebAuthentication { - getAssertion(assertionChallenge: any, options?: AssertionOptions): Promise; - makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: any, options?: ScopedCredentialOptions): Promise; + getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise; + makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise; } declare var WebAuthentication: { @@ -12578,24 +12585,24 @@ interface WebGLRenderingContext { texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void; texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void; uniform1f(location: WebGLUniformLocation | null, x: number): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform1i(location: WebGLUniformLocation | null, x: number): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void; + uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void; uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void; useProgram(program: WebGLProgram | null): void; validateProgram(program: WebGLProgram | null): void; vertexAttrib1f(indx: number, x: number): void; @@ -13375,7 +13382,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -14583,7 +14590,7 @@ interface ParentNode { interface DocumentOrShadowRoot { readonly activeElement: Element | null; - readonly stylesheets: StyleSheetList; + readonly styleSheets: StyleSheetList; getSelection(): Selection | null; elementFromPoint(x: number, y: number): Element | null; elementsFromPoint(x: number, y: number): Element[]; @@ -14612,6 +14619,10 @@ interface ElementDefinitionOptions { extends: string; } +interface ElementCreationOptions { + is?: string; +} + interface CustomElementRegistry { define(name: string, constructor: Function, options?: ElementDefinitionOptions): void; get(name: string): any; @@ -14681,6 +14692,23 @@ declare var HTMLSummaryElement: { new(): HTMLSummaryElement; }; +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(rectangle?: DOMRectInit): DOMRectReadOnly; +}; + interface EXT_blend_minmax { readonly MIN_EXT: number; readonly MAX_EXT: number; @@ -14699,6 +14727,25 @@ interface EXT_sRGB { readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number; } +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new (x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(rectangle?: DOMRectInit): DOMRect; +}; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + interface OES_vertex_array_object { readonly VERTEX_ARRAY_BINDING_OES: number; createVertexArrayOES(): WebGLVertexArrayObjectOES; @@ -14803,6 +14850,118 @@ interface WEBGL_lose_context { restoreContext(): void; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + +interface AnimationKeyFrame { + offset?: number | null | (number | null)[]; + easing?: string | string[]; + [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined; +} + +interface AnimationOptions { + id?: string; + delay?: number; + direction?: "normal" | "reverse" | "alternate" | "alternate-reverse"; + duration?: number; + easing?: string; + endDelay?: number; + fill?: "none" | "forwards" | "backwards" | "both"| "auto"; + iterationStart?: number; + iterations?: number; +} + +interface AnimationTimeline { + readonly currentTime: number | null; +} + +interface ComputedTimingProperties { + endTime: number; + activeDuration: number; + localTime: number | null; + progress: number | null; + currentIteration: number | null; +} + +interface AnimationEffectReadOnly { + readonly timing: number; + getComputedTiming(): ComputedTimingProperties; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: number | null; + timelineTime?: number | null; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: number | null; + readonly timelineTime: number | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface Animation { + currentTime: number | null; + effect: AnimationEffectReadOnly; + readonly finished: Promise; + id: string; + readonly pending: boolean; + readonly playState: "idle" | "running" | "paused" | "finished"; + playbackRate: number; + readonly ready: Promise; + startTime: number; + timeline: AnimationTimeline; + oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any; + onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any; + cancel(): void; + finish(): void; + pause(): void; + play(): void; + reverse(): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; +}; + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -14967,6 +15126,7 @@ interface HTMLElementTagNameMap { "script": HTMLScriptElement; "section": HTMLElement; "select": HTMLSelectElement; + "slot": HTMLSlotElement; "small": HTMLElement; "source": HTMLSourceElement; "span": HTMLSpanElement; @@ -15053,6 +15213,7 @@ interface SVGElementTagNameMap { "view": SVGViewElement; } +/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */ interface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { } declare var Audio: { new(src?: string): HTMLAudioElement; }; @@ -15270,7 +15431,7 @@ declare function removeEventListener(type: K, li declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AAGUID = string; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type ByteString = string; type ConstrainBoolean = boolean | ConstrainBooleanParameters; type ConstrainDOMString = string | string[] | ConstrainDOMStringParameters; @@ -15312,6 +15473,7 @@ type ScrollRestoration = "auto" | "manual"; type FormDataEntryValue = string | File; type InsertPosition = "beforebegin" | "afterbegin" | "beforeend" | "afterend"; type HeadersInit = Headers | string[][] | { [key: string]: string }; +type OrientationLockType = "any" | "natural" | "portrait" | "landscape" | "portrait-primary" | "portrait-secondary" | "landscape-primary"| "landscape-secondary"; type AppendMode = "segments" | "sequence"; type AudioContextState = "suspended" | "running" | "closed"; type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass"; diff --git a/lib/lib.esnext.promise.d.ts b/lib/lib.esnext.promise.d.ts new file mode 100644 index 00000000000..d73b4d45688 --- /dev/null +++ b/lib/lib.esnext.promise.d.ts @@ -0,0 +1,32 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise +} diff --git a/lib/lib.webworker.d.ts b/lib/lib.webworker.d.ts index cf7eea74c3c..5c1bae54f1b 100644 --- a/lib/lib.webworker.d.ts +++ b/lib/lib.webworker.d.ts @@ -86,12 +86,13 @@ interface ObjectURLOptions { } interface PushSubscriptionOptionsInit { - applicationServerKey?: any; + applicationServerKey?: BufferSource | null; userVisibleOnly?: boolean; } interface RequestInit { - body?: any; + signal?: AbortSignal; + body?: Blob | BufferSource | FormData | string | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: HeadersInit; @@ -139,7 +140,7 @@ interface NotificationEventInit extends ExtendableEventInit { } interface PushEventInit extends ExtendableEventInit { - data?: any; + data?: BufferSource | USVString; } interface SyncEventInit extends ExtendableEventInit { @@ -151,18 +152,6 @@ interface EventListener { (evt: Event): void; } -interface WebKitEntriesCallback { - (evt: Event): void; -} - -interface WebKitErrorCallback { - (evt: Event): void; -} - -interface WebKitFileCallback { - (evt: Event): void; -} - interface AudioBuffer { readonly duration: number; readonly length: number; @@ -423,9 +412,9 @@ declare var Event: { }; interface EventTarget { - addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; dispatchEvent(evt: Event): boolean; - removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; } declare var EventTarget: { @@ -434,9 +423,10 @@ declare var EventTarget: { }; interface File extends Blob { - readonly lastModifiedDate: any; + readonly lastModifiedDate: Date; readonly name: string; readonly webkitRelativePath: string; + readonly lastModified: number; } declare var File: { @@ -910,7 +900,7 @@ declare var ProgressEvent: { }; interface PushManager { - getSubscription(): Promise; + getSubscription(): Promise; permissionState(options?: PushSubscriptionOptionsInit): Promise; subscribe(options?: PushSubscriptionOptionsInit): Promise; } @@ -979,6 +969,7 @@ interface Request extends Object, Body { readonly referrerPolicy: ReferrerPolicy; readonly type: RequestType; readonly url: string; + readonly signal: AbortSignal; clone(): Request; } @@ -1081,7 +1072,7 @@ interface URL { declare var URL: { prototype: URL; - new(url: string, base?: string): URL; + new(url: string, base?: string | URL): URL; createObjectURL(object: any, options?: ObjectURLOptions): string; revokeObjectURL(url: string): void; }; @@ -1105,7 +1096,7 @@ interface WebSocket extends EventTarget { readonly readyState: number; readonly url: string; close(code?: number, reason?: string): void; - send(data: any): void; + send(data: USVString | ArrayBuffer | Blob | ArrayBufferView): void; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; @@ -1841,6 +1832,43 @@ interface AddEventListenerOptions extends EventListenerOptions { once?: boolean; } +interface AbortController { + readonly signal: AbortSignal; + abort(): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignal extends EventTarget { + readonly aborted: boolean; + onabort: (ev: Event) => any; +} + +interface EventSource extends EventTarget { + readonly url: string; + readonly withCredentials: boolean; + readonly CONNECTING: number; + readonly OPEN: number; + readonly CLOSED: number; + readonly readyState: number; + onopen: (evt: MessageEvent) => any; + onmessage: (evt: MessageEvent) => any; + onerror: (evt: MessageEvent) => any; + close(): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string, eventSourceInitDict?: EventSourceInit): EventSource; +}; + +interface EventSourceInit { + readonly withCredentials: boolean; +} + declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; interface DecodeErrorCallback { @@ -1903,7 +1931,7 @@ declare function addEventListener(type: string, listener: EventListenerOrEventLi declare function removeEventListener(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; type AlgorithmIdentifier = string | Algorithm; -type BodyInit = any; +type BodyInit = Blob | BufferSource | FormData | string; type IDBKeyPath = string; type RequestInfo = Request | string; type USVString = string; diff --git a/lib/pl/diagnosticMessages.generated.json b/lib/pl/diagnosticMessages.generated.json index 03c7be6149b..21691cd1e20 100644 --- a/lib/pl/diagnosticMessages.generated.json +++ b/lib/pl/diagnosticMessages.generated.json @@ -12,11 +12,11 @@ "A_class_member_cannot_have_the_0_keyword_1248": "Składowa klasy nie może zawierać słowa kluczowego „{0}”.", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "Wyrażenie przecinkowe nie jest dozwolone w obliczonej nazwie właściwości.", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "Obliczona nazwa właściwości nie może odwoływać się do parametru typu z zawierającego go typu.", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Nazwa właściwości obliczanej w deklaracji właściwości klasy musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Nazwa właściwości obliczanej w przeciążeniu metody musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Nazwa właściwości obliczanej w typie literału musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Nazwa właściwości obliczanej w otaczającym kontekście musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Nazwa właściwości obliczanej w interfejsie musi odwoływać się do wyrażenia, którego typem jest typ literału lub typ „unikatowy symbol”.", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Nazwa właściwości obliczanej w deklaracji właściwości klasy musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Nazwa właściwości obliczanej w przeciążeniu metody musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Nazwa właściwości obliczanej w typie literału musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Nazwa właściwości obliczanej w otaczającym kontekście musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Nazwa właściwości obliczanej w interfejsie musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Obliczona nazwa właściwości musi być typu „string”, „number”, „symbol” lub „any”.", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "Obliczona nazwa właściwości w postaci „{0}” musi być typu „symbol”.", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Dostęp do składowej wyliczenia ze specyfikatorem const można uzyskać tylko za pomocą literału ciągu.", @@ -48,16 +48,18 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Deklaracja przestrzeni nazw nie może znajdować się w innym pliku niż klasa lub funkcja, z którą ją scalono.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Deklaracja przestrzeni nazw nie może występować przed klasą lub funkcją, z którą ją scalono.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Deklaracja przestrzeni nazw jest dozwolona tylko w przestrzeni nazw lub module.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Nie można wywołać lub skonstruować importu stylu przestrzeni nazw. Spowoduje to błąd w czasie wykonania.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Inicjator parametru jest dozwolony tylko w implementacji funkcji lub konstruktora.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Właściwości parametru nie można zadeklarować za pomocą parametru rest.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Właściwość parametru jest dozwolona tylko w implementacji konstruktora.", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "Właściwości parametru nie można zadeklarować za pomocą wzorca wiązania.", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "Ścieżka w opcji „extends” musi być względna lub bezwzględna, lecz element „{0}” nie spełnia tego wymagania.", "A_promise_must_have_a_then_method_1059": "Obietnica musi mieć metodę „then”.", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Właściwość klasy, której typem jest typ „unikatowy symbol”, musi być „static” i „readonly”.", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Właściwość interfejsu lub typu, którego typem jest typ „unikatowy symbol”, musi być „readonly”.", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Właściwość klasy, której typem jest „unique symbol”, musi być określona zarówno jako „static”, jak i „readonly”.", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Właściwość klasy, której typem jest literał lub „unique symbol”, musi być określona zarówno jako „static”, jak i „readonly”.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Wymagany parametr nie może występować po opcjonalnym parametrze.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Element rest nie może zawierać wzorca wiązania.", + "A_rest_element_cannot_have_a_property_name_2566": "Element rest nie może mieć nazwy właściwości.", "A_rest_element_cannot_have_an_initializer_1186": "Element rest nie może mieć inicjatora.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Element rest musi być ostatni we wzorcu usuwającym strukturę.", "A_rest_parameter_cannot_be_optional_1047": "Parametr rest nie może być opcjonalny.", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "Predykat typów nie może zawierać odwołania do elementu „{0}” we wzorcu wiązania.", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "Predykat typów jest dozwolony tylko w położeniu zwracanego typu dla funkcji i metod.", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "Musi być możliwe przypisanie typu predykatu typów do typu jego parametru.", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Zmienna, której typem jest typ „unikatowy symbol”, musi być „const”.", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Zmienna, której typem „unique symbol”, musi być określona jako „const”.", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Wyrażenie „yield” jest dozwolone tylko w treści generatora.", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "Nie można uzyskać dostępu do metody abstrakcyjnej „{0}” w klasie „{1}” za pomocą wyrażenia super.", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Metody abstrakcyjne mogą występować tylko w klasie abstrakcyjnej.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "Napotkano już modyfikator dostępności.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Metody dostępu są dostępne tylko wtedy, gdy jest używany język ECMAScript 5 lub nowszy.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Obie metody dostępu muszą być abstrakcyjne lub nieabstrakcyjne.", - "Add_0_to_existing_import_declaration_from_1_90015": "Dodaj element „{0}” do istniejącej deklaracji importu z elementu „{1}”.", - "Add_index_signature_for_property_0_90017": "Dodaj sygnaturę indeksu dla właściwości „{0}”.", - "Add_missing_super_call_90001": "Dodaj brakujące wywołanie „super()”.", - "Add_this_to_unresolved_variable_90008": "Dodaj „this.” do nierozpoznanej zmiennej.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Dodanie pliku tsconfig.json pomoże w organizowaniu projektów, które zawierają pliki TypeScript i JavaScript. Dowiedz się więcej: https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "Dodaj element „{0}” do istniejącej deklaracji importu z elementu „{1}”", + "Add_async_modifier_to_containing_function_90029": "Dodaj modyfikator asynchroniczny do funkcji zawierającej", + "Add_index_signature_for_property_0_90017": "Dodaj sygnaturę indeksu dla właściwości „{0}”", + "Add_missing_super_call_90001": "Dodaj brakujące wywołanie „super()”", + "Add_this_to_unresolved_variable_90008": "Dodaj „this.” do nierozpoznanej zmiennej", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Dodanie pliku tsconfig.json pomoże w organizowaniu projektów, które zawierają pliki TypeScript i JavaScript. Dowiedz się więcej: https://aka.ms/tsconfig.", "Additional_Checks_6176": "Dodatkowe kontrole", "Advanced_Options_6178": "Opcje zaawansowane", "All_declarations_of_0_must_have_identical_modifiers_2687": "Wszystkie deklaracje elementu „{0}” muszą mieć identyczne modyfikatory.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Parametr sygnatury indeksu nie może mieć modyfikatora dostępności.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Parametr sygnatury indeksu nie może mieć inicjatora.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "Parametr sygnatury indeksu musi mieć adnotację typu.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Typ parametru sygnatury indeksu nie może być aliasem typu. Rozważ zastosowanie następującego zapisu: „[{0}: {1}]: {2}”.", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Typ parametru sygnatury indeksu nie może być typem unii. Rozważ użycie zamiast niego mapowanego typu obiektu.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Parametr sygnatury indeksu musi być typu „string” lub „number”.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Interfejs może rozszerzać tylko identyfikator/nazwę kwalifikowaną z opcjonalnymi argumentami typu.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Interfejs może rozszerzać tylko klasę lub inny interfejs.", @@ -147,8 +152,8 @@ "An_object_member_cannot_be_declared_optional_1162": "Składowa obiektu nie może być zadeklarowana jako opcjonalna.", "An_overload_signature_cannot_be_declared_as_a_generator_1222": "Sygnatura przeciążenia nie może być zadeklarowana jako generator.", "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "Wyrażenie jednoargumentowe z operatorem „{0}” jest niedozwolone po lewej stronie wyrażenia potęgowania. Zastanów się nad zamknięciem wyrażenia w nawiasach.", - "Annotate_with_type_from_JSDoc_95009": "Dodaj adnotację przy użyciu typu z JSDoc", - "Annotate_with_types_from_JSDoc_95010": "Dodaj adnotację przy użyciu typów z JSDoc", + "Annotate_with_type_from_JSDoc_95009": "Dodaj adnotację z typem z danych JSDoc", + "Annotate_with_types_from_JSDoc_95010": "Dodaj adnotację z typami z danych JSDoc", "Argument_expression_expected_1135": "Oczekiwano wyrażenia argumentu.", "Argument_for_0_option_must_be_Colon_1_6046": "Argumentem opcji „{0}” musi być: {1}.", "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345": "Nie można przypisać argumentu typu „{0}” do parametru typu „{1}”.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "Oczekiwano bitu.", "Binding_element_0_implicitly_has_an_1_type_7031": "Dla elementu powiązania „{0}” niejawnie określono typ „{1}”.", "Block_scoped_variable_0_used_before_its_declaration_2448": "Zmienna „{0}” o zakresie bloku została użyta przed jej deklaracją.", - "Call_decorator_expression_90028": "Wywołaj wyrażenie dekoratora.", + "Call_decorator_expression_90028": "Wywołaj wyrażenie dekoratora", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Dla sygnatury wywołania bez adnotacji zwracanego typu niejawnie określono zwracany typ „any”.", "Call_target_does_not_contain_any_signatures_2346": "Cel wywołania nie zawiera żadnych podpisów.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Nie można uzyskać dostępu do elementu „{0}.{1}”, ponieważ element „{0}” jest typem, ale nie przestrzenią nazw. Czy chcesz pobrać typ właściwości „{1}” w lokalizacji „{0}” za pomocą elementu „{0}[„{1}”]”?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Nie można zaimportować plików deklaracji typu. Rozważ zaimportowanie „{0}” zamiast „{1}”.", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Nie można zainicjować zmiennej „{0}” z zakresu zewnętrznego w tym samym zakresie co deklaracja „{1}” należąca do zakresu bloku.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Nie można wywołać wyrażenia, w którego typie nie ma sygnatury wywołania. Typ „{0}” nie ma zgodnych sygnatur wywołań.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Nie można wywołać obiektu, który ma prawdopodobnie wartość „null”.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Nie można wywołać obiektu, który ma prawdopodobnie wartość „null” lub „undefined”.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Nie można wywołać obiektu, który ma prawdopodobnie wartość „undefined”.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "Nie można ponownie wyeksportować typu, jeśli podano flagę „--isolatedModules”", "Cannot_read_file_0_Colon_1_5012": "Nie można odczytać pliku „{0}”: {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "Nie można ponownie zadeklarować zmiennej „{0}” o zakresie bloku.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Nie można zapisać pliku „{0}”, ponieważ nadpisałby plik wejściowy.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Zmienna klauzuli catch nie może mieć adnotacji typu.", "Catch_clause_variable_cannot_have_an_initializer_1197": "Zmienna klauzuli catch nie może mieć inicjatora.", - "Change_0_to_1_90014": "Zmień element „{0}” na „{1}”.", - "Change_extends_to_implements_90003": "Zmień atrybut „extends” na „implements”.", - "Change_spelling_to_0_90022": "Zmiana pisowni na „{0}”.", + "Change_0_to_1_90014": "Zmień element „{0}” na „{1}”", + "Change_extends_to_implements_90003": "Zmień atrybut „extends” na „implements”", + "Change_spelling_to_0_90022": "Zmień pisownię na „{0}”", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Sprawdzanie, czy „{0}” to najdłuższy zgodny prefiks dla „{1}” — „{2}”.", "Circular_definition_of_import_alias_0_2303": "Definicja cykliczna aliasu importu „{0}”.", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "Wykryto cykliczność podczas rozpoznawania konfiguracji: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "Klasa „{0}” definiuje funkcję składową wystąpienia „{1}”, ale rozszerzona klasa „{2}” definiuje ją jako właściwość składowej wystąpienia.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "Klasa „{0}” definiuje właściwość składowej wystąpienia „{1}”, ale rozszerzona klasa „{2}” definiuje ją jako funkcję składową wystąpienia.", "Class_0_incorrectly_extends_base_class_1_2415": "Klasa „{0}” niepoprawnie rozszerza klasę bazową „{1}”.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "Klasa „{0}” niepoprawnie implementuje klasę „{1}”. Czy chodziło o rozszerzenie „{1}” i odziedziczenie jego elementów członkowskich jako podklasy?", "Class_0_incorrectly_implements_interface_1_2420": "Klasa „{0}” zawiera niepoprawną implementację interfejsu „{1}”.", "Class_0_used_before_its_declaration_2449": "Klasa „{0}” została użyta przed zadeklarowaniem.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Deklaracje klas nie mogą mieć więcej niż jeden tag „@augments” lub „@extends”.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Nie podano pliku zawierającego i nie można określić katalogu głównego. Pomijanie wyszukiwania w folderze „node_modules”.", "Convert_function_0_to_class_95002": "Konwertuj funkcję „{0}” na klasę", "Convert_function_to_an_ES2015_class_95001": "Konwertuj funkcję na klasę ES2015", + "Convert_to_ES6_module_95017": "Konwertuj na moduł ES6", "Convert_to_default_import_95013": "Konwertuj na import domyślny", "Corrupted_locale_file_0_6051": "Uszkodzony plik ustawień regionalnych {0}.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Nie można znaleźć pliku deklaracji dla modułu „{0}”. Element „{1}” ma niejawnie typ „any”.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Oczekiwano deklaracji.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Nazwa deklaracji powoduje konflikt z wbudowanym identyfikatorem globalnym „{0}”.", "Declaration_or_statement_expected_1128": "Oczekiwano deklaracji lub instrukcji.", - "Declare_method_0_90023": "Zadeklaruj metodę „{0}”.", - "Declare_property_0_90016": "Zadeklaruj właściwość „{0}”.", - "Declare_static_method_0_90024": "Zadeklaruj metodę statyczną „{0}”.", - "Declare_static_property_0_90027": "Zadeklaruj właściwość statyczną „{0}”.", + "Declare_method_0_90023": "Zadeklaruj metodę „{0}”", + "Declare_property_0_90016": "Zadeklaruj właściwość „{0}”", + "Declare_static_method_0_90024": "Zadeklaruj metodę statyczną „{0}”", + "Declare_static_property_0_90027": "Zadeklaruj właściwość statyczną „{0}”", "Decorators_are_not_valid_here_1206": "Elementy Decorator nie są tutaj prawidłowe.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Nie można stosować elementów Decorator do wielu metod dostępu pobierania/ustawiania o takiej samej nazwie.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Domyślny eksport modułu ma nazwę prywatną „{0}” lub używa tej nazwy.", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Przestarzałe] Użyj w zastępstwie opcji „--skipLibCheck”. Pomiń sprawdzanie typów domyślnych plików deklaracji biblioteki.", "Digit_expected_1124": "Oczekiwano cyfry.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Katalog „{0}” nie istnieje. Operacje wyszukiwania w nim zostaną pominięte.", - "Disable_checking_for_this_file_90018": "Wyłącz sprawdzanie dla tego pliku.", + "Disable_checking_for_this_file_90018": "Wyłącz sprawdzanie dla tego pliku", "Disable_size_limitations_on_JavaScript_projects_6162": "Wyłącz ograniczenia rozmiarów dla projektów JavaScript.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Wyłącz dokładne sprawdzanie sygnatur ogólnych w typach funkcji.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "Nie zezwalaj na przywoływanie tego samego pliku za pomocą nazw różniących się wielkością liter.", @@ -309,10 +319,12 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "Włącz dokładne sprawdzanie inicjowania właściwości w klasach.", "Enable_strict_null_checks_6113": "Włącz dokładne sprawdzanie wartości null.", "Enable_tracing_of_the_name_resolution_process_6085": "Włącz śledzenie procesu rozpoznawania nazw.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Umożliwia współdziałanie emitowania między modułami CommonJS i ES przez tworzenie obiektów przestrzeni nazw dla wszystkich importów. Implikuje użycie ustawienia „allowSyntheticDefaultImports”.", "Enables_experimental_support_for_ES7_async_functions_6068": "Umożliwia obsługę eksperymentalną funkcji asynchronicznych języka ES7.", "Enables_experimental_support_for_ES7_decorators_6065": "Umożliwia obsługę eksperymentalną elementów Decorator języka ES7.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Umożliwia obsługę eksperymentalną emitowania metadanych typów elementów Decorator.", "Enum_0_used_before_its_declaration_2450": "Wyliczenie „{0}” zostało użyte przed zadeklarowaniem.", + "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567": "Deklaracje wyliczeń można scalać tylko z przestrzeniami nazw lub innymi deklaracjami wyliczeń.", "Enum_declarations_must_all_be_const_or_non_const_2473": "Wszystkie deklaracje wyliczeń muszą być elementami const lub żadna nie może być elementem const.", "Enum_member_expected_1132": "Oczekiwano składowych wyliczenia.", "Enum_member_must_have_initializer_1061": "Składowa wyliczenia musi mieć inicjator.", @@ -352,7 +364,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "Wynikiem rozpoznania wyrażenia jest deklaracja zmiennej „_this” używana przez kompilator do przechwycenia odwołania do elementu „this”.", "Extract_constant_95006": "Wyodrębnij stałą", "Extract_function_95005": "Wyodrębnij funkcję", - "Extract_symbol_95003": "Wyodrębnij symbol", "Extract_to_0_in_1_95004": "Wyodrębnij do {0} w {1}", "Extract_to_0_in_1_scope_95008": "Wyodrębnij do {0} w zakresie {1}", "Extract_to_0_in_enclosing_scope_95007": "Wyodrębnij do {0} w zakresie otaczającym", @@ -371,9 +382,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "Nazwa pliku „{0}” różni się od już dołączonej nazwy pliku „{1}” tylko wielkością liter.", "File_name_0_has_a_1_extension_stripping_it_6132": "Nazwa pliku „{0}” ma rozszerzenie „{1}” — zostanie ono usunięte.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "Specyfikacja pliku nie może zawierać katalogu nadrzędnego („..”) wyświetlanego po symbolu wieloznacznym katalogu rekursywnego („**”): „{0}”.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "Specyfikacja pliku nie może zawierać wielu cyklicznych symboli wieloznacznych katalogu („**”): „{0}”.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "Specyfikacja pliku nie może kończyć się cyklicznym symbolem wieloznacznym katalogu („**”): „{0}”.", "Found_package_json_at_0_6099": "Znaleziono plik „package.json” w lokalizacji „{0}”.", + "Found_package_json_at_0_Package_ID_is_1_6190": "Znaleziono plik „package.json” w lokalizacji „{0}”. Identyfikator pakietu to „{1}”.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Deklaracje funkcji nie są dozwolone wewnątrz bloków w trybie z ograniczeniami, jeśli elementem docelowym jest „ES3” lub „ES5”.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Deklaracje funkcji nie są dozwolone wewnątrz bloków w trybie z ograniczeniami, jeśli elementem docelowym jest „ES3” lub „ES5”. Definicje klas automatycznie używają trybu z ograniczeniami.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Deklaracje funkcji nie są dozwolone wewnątrz bloków w trybie z ograniczeniami, jeśli elementem docelowym jest „ES3” lub „ES5”. Moduły automatycznie używają trybu z ograniczeniami.", @@ -404,11 +415,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "Oczekiwano identyfikatora. Element „{0}” jest wyrazem zastrzeżonym w trybie z ograniczeniami. Moduły są określane automatycznie w trybie z ograniczeniami.", "Identifier_expected_1003": "Oczekiwano identyfikatora.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Oczekiwano identyfikatora. Ciąg „__esModule” jest zastrzeżony jako eksportowany znacznik podczas transformowania modułów ECMAScript.", - "Ignore_this_error_message_90019": "Ignoruj ten komunikat o błędzie.", - "Implement_inherited_abstract_class_90007": "Implementuj odziedziczoną klasę abstrakcyjną.", - "Implement_interface_0_90006": "Implementuj interfejs „{0}”.", + "Ignore_this_error_message_90019": "Ignoruj ten komunikat o błędzie", + "Implement_inherited_abstract_class_90007": "Wdróż odziedziczoną klasę abstrakcyjną", + "Implement_interface_0_90006": "Implementuj interfejs „{0}”", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "Klauzula implements wyeksportowanej klasy „{0}” ma nazwę prywatną „{1}” lub używa tej nazwy.", - "Import_0_from_module_1_90013": "Import „{0}” z modułu „{1}”.", + "Import_0_from_module_1_90013": "Importuj element „{0}” z modułu „{1}”", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Nie można użyć przypisania importu, gdy są używane moduły języka ECMAScript. Zamiast tego rozważ użycie elementu „import * as ns from \"mod\"”, „import {a} from \"mod\"” lub „import d from \"mod\"” albo innego formatu modułu.", "Import_declaration_0_is_using_private_name_1_4000": "Deklaracja importu „{0}” używa nazwy prywatnej „{1}”.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "Deklaracja importu powoduje konflikt z deklaracją lokalną „{0}”.", @@ -424,10 +435,10 @@ "Index_signature_is_missing_in_type_0_2329": "Brak sygnatury indeksu w typie „{0}”.", "Index_signatures_are_incompatible_2330": "Sygnatury indeksów są niezgodne.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Wszystkie poszczególne deklaracje w scalonej deklaracji „{0}” muszą być wyeksportowane lub lokalne.", - "Infer_parameter_types_from_usage_95012": "Wywnioskuj typy parametrów na podstawie użycia.", - "Infer_type_of_0_from_usage_95011": "Wywnioskuj typ elementu „{0}” na podstawie użycia.", - "Initialize_property_0_in_the_constructor_90020": "Zainicjuj właściwość „{0}” w konstruktorze.", - "Initialize_static_property_0_90021": "Zainicjuj właściwość statyczną „{0}”.", + "Infer_parameter_types_from_usage_95012": "Wnioskuj typy parametrów na podstawie użycia", + "Infer_type_of_0_from_usage_95011": "Wnioskuj typ elementu „{0}” na podstawie użycia", + "Initialize_property_0_in_the_constructor_90020": "Zainicjuj właściwość „{0}” w konstruktorze", + "Initialize_static_property_0_90021": "Zainicjuj właściwość statyczną „{0}”", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "Inicjator zmiennej składowej wystąpienia „{0}” nie może przywoływać identyfikatora „{1}” zadeklarowanego w konstruktorze.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "Inicjator parametru „{0}” nie może przywoływać identyfikatora „{1}” zadeklarowanego po nim.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "Inicjator nie określa żadnej wartości dla tego elementu powiązania, a element powiązania nie ma wartości domyślnej.", @@ -484,7 +495,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "Ustawienia regionalne muszą mieć postać lub -. Na przykład „{0}” lub „{1}”.", "Longest_matching_prefix_for_0_is_1_6108": "Najdłuższy zgodny prefiks dla „{0}” to „{1}”.", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Wyszukiwanie w folderze „node_modules”, początkowa lokalizacja: „{0}”.", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Ustaw wywołanie „super()” jako pierwszą instrukcję w konstruktorze.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "Ustaw wywołanie „super()” jako pierwszą instrukcję w konstruktorze", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "Zmapowany typ obiektu niejawnie ma typ szablonu „any”.", "Member_0_implicitly_has_an_1_type_7008": "Dla składowej „{0}” niejawnie określono typ „{1}”.", "Merge_conflict_marker_encountered_1185": "Napotkano znacznik konfliktu scalania.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "Scalona deklaracja „{0}” nie może zawierać domyślnej deklaracji eksportu. Rozważ dodanie oddzielnej deklaracji „export default {0}” zamiast niej.", @@ -508,6 +520,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== Nazwa modułu „{0}” została pomyślnie rozpoznana jako „{1}”. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Rodzaj rozpoznawania modułów nie został podany. Zostanie użyty rodzaj „{0}”.", "Module_resolution_using_rootDirs_has_failed_6111": "Nie można rozpoznać modułów przy użyciu opcji „rootDirs”.", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Kolejne następujące po sobie separatory liczbowe nie są dozwolone.", "Multiple_constructor_implementations_are_not_allowed_2392": "Konstruktor nie może mieć wielu implementacji.", "NEWLINE_6061": "NOWY WIERSZ", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "Nazwane właściwości „{0}” typów „{1}” i „{2}” nie są identyczne.", @@ -518,6 +531,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Wyrażenie klasy nieabstrakcyjnej nie implementuje odziedziczonej abstrakcyjnej składowej „{0}” z klasy „{1}”.", "Not_all_code_paths_return_a_value_7030": "Nie wszystkie ścieżki kodu zwracają wartość.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Nie można przypisać typu indeksu numerycznego „{0}” do typu indeksu ciągu „{1}”.", + "Numeric_separators_are_not_allowed_here_6188": "Separatory liczbowe nie są dozwolone w tym miejscu.", "Object_is_possibly_null_2531": "Obiekt ma prawdopodobnie wartość „null”.", "Object_is_possibly_null_or_undefined_2533": "Obiekt ma prawdopodobnie wartość „null” lub „undefined”.", "Object_is_possibly_undefined_2532": "Obiekt ma prawdopodobnie wartość „undefined”.", @@ -534,6 +548,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "Tylko funkcja typu void może być wywoływana za pomocą słowa kluczowego „new”.", "Only_ambient_modules_can_use_quoted_names_1035": "Tylko otaczające moduły mogą używać nazw w cudzysłowie.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Tylko moduły „amd” i „system” są obsługiwane razem z parametrem --{0}.", + "Only_emit_d_ts_declaration_files_6014": "Emituj tylko pliki deklaracji „d.ts”.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Klauzula „extends” klasy obsługuje obecnie tylko identyfikatory/nazwy kwalifikowane z opcjonalnymi argumentami typu.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Tylko publiczne i chronione metody klasy bazowej są dostępne przy użyciu słowa kluczowego „super”.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Nie można zastosować operatora „{0}” do typów „{1}” i „{2}”.", @@ -584,7 +599,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Typ parametru publicznej statycznej metody ustawiającej „{0}” z wyeksportowanej klasy ma nazwę prywatną „{1}” lub używa tej nazwy.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analizuj w trybie z ograniczeniami i emituj ciąg „use strict” dla każdego pliku źródłowego.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Wzorzec „{0}” może zawierać maksymalnie jeden znak „*”.", - "Prefix_0_with_an_underscore_90025": "Prefiks „{0}” z podkreśleniem.", + "Prefix_0_with_an_underscore_90025": "Poprzedzaj elementy „{0}” znakiem podkreślenia", "Print_names_of_files_part_of_the_compilation_6155": "Drukuj nazwy plików będących częścią kompilacji.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Drukuj nazwy wygenerowanych plików będących częścią kompilacji.", "Print_the_compiler_s_version_6019": "Wypisz wersję kompilatora.", @@ -596,6 +611,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Właściwość „{0}” nie ma inicjatora i nie jest na pewno przypisana w konstruktorze.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Dla właściwości „{0}” niejawnie określono typ „any”, ponieważ jego metoda dostępu „get” nie ma adnotacji zwracanego typu.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Dla właściwości „{0}” niejawnie określono typ „any”, ponieważ jego metoda dostępu „set” nie ma adnotacji typu parametru.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Właściwości „{0}” w typie „{1}” nie można przypisać do tej samej właściwości w typie podstawowym „{2}”.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "Właściwości „{0}” w typie „{1}” nie można przypisać do typu „{2}”.", "Property_0_is_declared_but_its_value_is_never_read_6138": "Właściwość „{0}” jest zadeklarowana, ale jej wartość nie jest nigdy odczytywana.", "Property_0_is_incompatible_with_index_signature_2530": "Właściwość „{0}” jest niezgodna z sygnaturą indeksu.", @@ -634,7 +650,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Zgłaszaj błąd w przypadku wyrażeń i deklaracji z implikowanym typem „any”.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Zgłaszaj błąd w przypadku wyrażeń „this” z niejawnym typem „any”.", "Redirect_output_structure_to_the_directory_6006": "Przekieruj strukturę wyjściową do katalogu.", - "Remove_declaration_for_Colon_0_90004": "Usuń deklarację dla: „{0}”.", + "Remove_declaration_for_Colon_0_90004": "Usuń deklarację dla: „{0}”", + "Replace_import_with_0_95015": "Zamień import na element „{0}”.", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Zgłoś błąd, gdy nie wszystkie ścieżki kodu zwracają wartość.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Zgłoś błędy dla przepuszczających klauzul case w instrukcji switch.", "Report_errors_in_js_files_8019": "Zgłaszaj błędy w plikach js.", @@ -680,7 +697,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "Zwracany typ publicznej metody statycznej z wyeksportowanej klasy ma nazwę prywatną „{0}” lub używa tej nazwy.", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Ponownie używane są rozwiązania modułu pochodzące z programu „{0}”, ponieważ rozwiązania nie zmieniły się w stosunku do starej wersji programu.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Ponownie używane jest rozwiązanie modułu „{0}” do pliku „{1}” ze starej wersji programu.", - "Rewrite_as_the_indexed_access_type_0_90026": "Zapisz ponownie jako typ dostępu indeksowanego „{0}”.", + "Rewrite_as_the_indexed_access_type_0_90026": "Napisz ponownie jako indeksowany typ dostępu „{0}”", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Nie można określić katalogu głównego. Pomijanie ścieżek wyszukiwania podstawowego.", "STRATEGY_6039": "STRATEGIA", "Scoped_package_detected_looking_in_0_6182": "Wykryto pakiet w zakresie, wyszukiwanie w „{0}”", @@ -693,9 +710,9 @@ "Source_Map_Options_6175": "Opcje mapy źródła", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Nie można przypisać specjalizowanej sygnatury przeciążenia do żadnej sygnatury niespecjalizowanej.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Specyfikator dynamicznego importowania nie może być elementem spread.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "Podaj wersję docelową języka ECMAScript: „ES3” (domyślna), „ES5”, „ES2015”, „ES2016”, „ES2017” lub „ESNEXT”.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "Podaj wersję docelową języka ECMAScript: „ES3” (domyślna), „ES5”, „ES2015”, „ES2016”, „ES2017”, „ES2018” lub „ESNEXT”.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "Wybierz sposób generowania kodu JSX: „preserve”, „react-native” lub „react”.", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Określ pliki biblioteki do uwzględnienia w kompilacji: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Określ pliki biblioteki do uwzględnienia w kompilacji.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Określ sposób generowania kodu modułu: „none”, „commonjs”, „amd”, „system”, „umd”, „es2015” lub „ESNext”.", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Określ strategię rozpoznawania modułów: „node” (Node.js) lub „classic” (TypeScript w wersji wcześniejszej niż 1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Określ funkcję fabryki JSX do użycia, gdy elementem docelowym jest emisja elementu JSX „react”, np. „React.createElement” lub „h”.", @@ -705,6 +722,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Określ katalog główny plików wejściowych. Strukturą katalogów wyjściowych można sterować przy użyciu opcji --outDir.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "Operator rozpiętości w wyrażeniach „new” jest dostępny tylko wtedy, gdy jest używany język ECMAScript 5 lub nowszy.", "Spread_types_may_only_be_created_from_object_types_2698": "Typy spread można tworzyć tylko z typów obiektu.", + "Starting_compilation_in_watch_mode_6031": "Trwa uruchamianie kompilacji w trybie śledzenia...", "Statement_expected_1129": "Oczekiwano instrukcji.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Instrukcje są niedozwolone w otaczających kontekstach.", "Static_members_cannot_reference_class_type_parameters_2302": "Statyczne składowe nie mogą przywoływać parametrów typu klasy.", @@ -713,7 +731,7 @@ "String_literal_expected_1141": "Oczekiwano literału ciągu.", "String_literal_with_double_quotes_expected_1327": "Oczekiwano literału ciągu z podwójnymi cudzysłowami.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Stosuj styl dla błędów i komunikatów za pomocą koloru i kontekstu. (eksperymentalne).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Kolejne deklaracje właściwości muszą być tego samego typu. Właściwość „{0}” musi być typu „{1}”, ale w tym miejscu jest typu „{2}”.", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Kolejne deklaracje zmiennej muszą być tego samego typu. Zmienna „{0}” musi być typu „{1}”, ale w tym miejscu jest typu „{2}”.", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "Podstawienie „{0}” dla wzorca „{1}” ma nieprawidłowy typ. Oczekiwano typu „string”, a uzyskano typ „{2}”.", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "Podstawienie „{0}” we wzorcu „{1}” może zawierać maksymalnie jeden znak „*”.", @@ -797,7 +815,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "Typ „{0}” nie jest typem tablicy ani ciągu lub nie ma metody „[Symbol.iterator]()” zwracającej iterator.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "Typ „{0}” nie jest typem tablicy lub nie ma metody „[Symbol.iterator]()” zwracającej iterator.", "Type_0_is_not_assignable_to_type_1_2322": "Typu „{0}” nie można przypisać do typu „{1}”.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "Typu „{0}” nie można przypisać do typu „{1}”. Istnieją dwa różne typy o tej nazwie, lecz są ze sobą niezwiązane.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "Typu „{0}” nie można przypisać do typu „{1}”. Istnieją dwa różne typy o tej nazwie, lecz są ze sobą niezwiązane.", "Type_0_is_not_comparable_to_type_1_2678": "Typu „{0}” nie można porównać z typem „{1}”.", "Type_0_is_not_generic_2315": "Typ „{0}” nie jest ogólny.", "Type_0_provides_no_match_for_the_signature_1_2658": "Typ „{0}” nie udostępnia dopasowania dla sygnatury „{1}”.", @@ -858,6 +876,7 @@ "Unterminated_template_literal_1160": "Niezakończony literał szablonu.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Wywołania funkcji bez typu nie mogą przyjmować argumentów typu.", "Unused_label_7028": "Nieużywana etykieta.", + "Use_synthetic_default_member_95016": "Użyj syntetycznej składowej „default”.", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Używanie ciągu w instrukcji „for...of” jest obsługiwane tylko w języku ECMAScript 5 lub nowszym.", "VERSION_6036": "WERSJA", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "Wartość typu „{0}” nie ma żadnych wspólnych właściwości z typem „{1}”. Czy jej wywołanie było zamierzone?", @@ -913,9 +932,9 @@ "const_declarations_must_be_initialized_1155": "Konieczne jest zainicjowanie deklaracji „const”.", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "Wynikiem obliczenia inicjatora składowej wyliczenia ze specyfikatorem „const” jest wartość nieskończona.", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "Wynikiem obliczenia inicjatora składowej wyliczenia ze specyfikatorem „const” jest niedozwolona wartość „NaN”.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Wyliczenia ze specyfikatorem „const” mogą być używane tylko w wyrażeniach dostępu do indeksu lub właściwości albo po prawej stronie deklaracji importu lub przypisania eksportu.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Wyliczenia ze specyfikatorem „const” mogą być używane tylko w wyrażeniach dostępu do indeksu lub właściwości albo po prawej stronie deklaracji importu, przypisania eksportu lub typu zapytania.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "Nie można wywołać elementu „delete” dla identyfikatora w trybie z ograniczeniami.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Deklaracji wyliczeń można używać tylko w pliku ts.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Deklaracji enum można używać tylko w pliku ts.", "export_can_only_be_used_in_a_ts_file_8003": "Ciągu „export=” można użyć tylko w pliku ts.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Modyfikator „export” nie może być stosowany do modułów otoczenia ani rozszerzeń modułów, ponieważ są one zawsze widoczne.", "extends_clause_already_seen_1172": "Napotkano już klauzulę „extends”.", @@ -928,6 +947,7 @@ "implements_clause_already_seen_1175": "Napotkano już klauzulę „implements”.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "Klauzul implements można używać tylko w pliku ts.", "import_can_only_be_used_in_a_ts_file_8002": "Ciągu „export ... =” można użyć tylko w pliku ts.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Deklaracje „infer” są dozwolone tylko w klauzuli „extends” typu warunkowego.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "Deklaracji interfejsów można używać tylko w pliku ts.", "let_declarations_can_only_be_declared_inside_a_block_1157": "Deklaracje „let” mogą być deklarowane tylko w bloku.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "Element „let” nie może być używany jako nazwa w deklaracjach „let” ani „const”.", @@ -963,9 +983,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "Wyrażeń asercji typów można używać tylko w pliku ts.", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "Deklaracji parametru typu można używać tylko w pliku ts.", "types_can_only_be_used_in_a_ts_file_8010": "Typów można używać tylko w pliku ts.", - "unique_symbol_types_are_not_allowed_here_1335": "Typy „unikatowy symbol” nie są dozwolone w tym miejscu.", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Typy „unikatowy symbol” są dozwolone tylko w zmiennych w instrukcji zmiennej.", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Typów „unikatowy symbol” nie można używać w deklaracji zmiennej z nazwą powiązania.", + "unique_symbol_types_are_not_allowed_here_1335": "Typy „unique symbol” nie są dozwolone w tym miejscu.", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Typy „unique symbol” są dozwolone tylko w zmiennych w instrukcji zmiennej.", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Typów „unique symbol” nie można używać w deklaracji zmiennej z nazwą powiązania.", "with_statements_are_not_allowed_in_an_async_function_block_1300": "Instrukcje „with” są niedozwolone w bloku funkcji asynchronicznej.", "with_statements_are_not_allowed_in_strict_mode_1101": "Instrukcje „with” są niedozwolone w trybie z ograniczeniami.", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "Wyrażeń „yield” nie można używać w inicjatorze parametru." diff --git a/lib/protocol.d.ts b/lib/protocol.d.ts index 2bf4ae59f07..12fcad54070 100644 --- a/lib/protocol.d.ts +++ b/lib/protocol.d.ts @@ -36,6 +36,7 @@ declare namespace ts.server.protocol { Rename = "rename", Saveto = "saveto", SignatureHelp = "signatureHelp", + Status = "status", TypeDefinition = "typeDefinition", ProjectInfo = "projectInfo", ReloadProjects = "reloadProjects", @@ -48,10 +49,12 @@ declare namespace ts.server.protocol { DocCommentTemplate = "docCommentTemplate", CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", GetCodeFixes = "getCodeFixes", + GetCombinedCodeFix = "getCombinedCodeFix", ApplyCodeActionCommand = "applyCodeActionCommand", GetSupportedCodeFixes = "getSupportedCodeFixes", GetApplicableRefactors = "getApplicableRefactors", GetEditsForRefactor = "getEditsForRefactor", + OrganizeImports = "organizeImports", } /** * A TypeScript Server message @@ -137,6 +140,21 @@ declare namespace ts.server.protocol { file: string; projectFileName?: string; } + interface StatusRequest extends Request { + command: CommandTypes.Status; + } + interface StatusResponseBody { + /** + * The TypeScript version (`ts.version`). + */ + version: string; + } + /** + * Response to StatusRequest + */ + interface StatusResponse extends Response { + body: StatusResponseBody; + } /** * Requests a JS Doc comment template for a given position */ @@ -388,6 +406,23 @@ declare namespace ts.server.protocol { renameLocation?: Location; renameFilename?: string; } + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ + interface OrganizeImportsRequest extends Request { + command: CommandTypes.OrganizeImports; + arguments: OrganizeImportsRequestArgs; + } + type OrganizeImportsScope = GetCombinedCodeFixScope; + interface OrganizeImportsRequestArgs { + scope: OrganizeImportsScope; + } + interface OrganizeImportsResponse extends Response { + edits: ReadonlyArray; + } /** * Request for the available codefixes at a specific position. */ @@ -395,6 +430,13 @@ declare namespace ts.server.protocol { command: CommandTypes.GetCodeFixes; arguments: CodeFixRequestArgs; } + interface GetCombinedCodeFixRequest extends Request { + command: CommandTypes.GetCombinedCodeFix; + arguments: GetCombinedCodeFixRequestArgs; + } + interface GetCombinedCodeFixResponse extends Response { + body: CombinedCodeActions; + } interface ApplyCodeActionCommandRequest extends Request { command: CommandTypes.ApplyCodeActionCommand; arguments: ApplyCodeActionCommandRequestArgs; @@ -426,7 +468,15 @@ declare namespace ts.server.protocol { /** * Errorcodes we want to get the fixes for. */ - errorCodes?: number[]; + errorCodes?: ReadonlyArray; + } + interface GetCombinedCodeFixRequestArgs { + scope: GetCombinedCodeFixScope; + fixId: {}; + } + interface GetCombinedCodeFixScope { + type: "file"; + args: FileRequestArgs; } interface ApplyCodeActionCommandRequestArgs { /** May also be an array of commands. */ @@ -1170,7 +1220,7 @@ declare namespace ts.server.protocol { } interface CodeFixResponse extends Response { /** The code actions that are available */ - body?: CodeAction[]; + body?: CodeFixAction[]; } interface CodeAction { /** Description of the code action to display in the UI of the editor */ @@ -1180,6 +1230,17 @@ declare namespace ts.server.protocol { /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */ commands?: {}[]; } + interface CombinedCodeActions { + changes: ReadonlyArray; + commands?: ReadonlyArray<{}>; + } + interface CodeFixAction extends CodeAction { + /** + * If present, one may call 'getCombinedCodeFix' with this fixId. + * This may be omitted to indicate that the code fix can't be applied in a group. + */ + fixId?: {}; + } /** * Format and format on key response message. */ @@ -1221,6 +1282,11 @@ declare namespace ts.server.protocol { * This affects lone identifier completions but not completions on the right hand side of `obj.`. */ includeExternalModuleExports: boolean; + /** + * If enabled, the completion list will include completions with invalid identifier names. + * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`. + */ + includeInsertTextCompletions: boolean; } /** * Completions request; value of command field is "completions". @@ -1289,6 +1355,12 @@ declare namespace ts.server.protocol { * is often the same as the name but may be different in certain circumstances. */ sortText: string; + /** + * Text to insert instead of `name`. + * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`, + * coupled with `replacementSpan` to replace a dotted access with a bracket access. + */ + insertText?: string; /** * An optional span that indicates the text to be replaced by this completion item. * If present, this span should be used instead of the default one. @@ -1962,6 +2034,7 @@ declare namespace ts.server.protocol { insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface CompilerOptions { allowJs?: boolean; diff --git a/lib/pt-BR/diagnosticMessages.generated.json b/lib/pt-BR/diagnosticMessages.generated.json index 37f410337ac..c2770a52b40 100644 --- a/lib/pt-BR/diagnosticMessages.generated.json +++ b/lib/pt-BR/diagnosticMessages.generated.json @@ -12,22 +12,22 @@ "A_class_member_cannot_have_the_0_keyword_1248": "Um membro de classe não pode ter a palavra-chave '{0}'.", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "Uma expressão de vírgula não é permitida em um nome de propriedade calculado.", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "Um nome de propriedade calculado não pode fazer referência a um parâmetro de tipo no seu tipo recipiente.", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Um nome de propriedade computado em uma declaração de propriedade de classe deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Um nome de propriedade computado em uma sobrecarga do método deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Um nome de propriedade computado em um tipo literal deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Um nome de propriedade computado em um contexto de ambiente deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Um nome de propriedade computado em uma interface deve se referir a uma expressão cujo tipo é um tipo literal ou um 'símbolo exclusivo'.", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Um nome de propriedade computado em uma declaração de propriedade de classe deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Um nome de propriedade computado em uma sobrecarga do método deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Um nome de propriedade computado em um tipo literal deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Um nome de propriedade computado em um contexto de ambiente deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Um nome de propriedade computado em uma interface deve se referir a uma expressão cujo tipo é um tipo literal ou um 'unique symbol'.", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Um nome de propriedade calculado deve ser do tipo 'string', 'number', 'symbol' ou 'any'.", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "Um nome de propriedade calculado do formulário '{0}' deve ser do tipo 'symbol'.", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Um membro const enum só pode ser acessado usando um literal de cadeia de caracteres.", - "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_1254": "Um inicializador \"const\" em um contexto de ambiente deve ser uma cadeia ou um literal numérico.", + "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_1254": "Um inicializador 'const' em um contexto de ambiente deve ser uma cadeia ou um literal numérico.", "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005": "Um construtor não pode conter uma chamada 'super' quando sua classe estende 'null'.", "A_constructor_cannot_have_a_this_parameter_2681": "Um construtor não pode ter um parâmetro 'this'.", "A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement_1104": "Uma instrução 'continue' só pode ser usada em uma instrução de iteração de circunscrição.", "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115": "Uma instrução 'continue' só pode saltar para um rótulo de uma instrução de iteração de circunscrição.", "A_declare_modifier_cannot_be_used_in_an_already_ambient_context_1038": "Um modificador 'declare' não pode ser usado em um contexto de ambiente.", "A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file_1046": "Um modificador 'declare' é necessário para uma declaração de nível superior em um arquivo .d.ts.", - "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249": "Um decorador pode decoras somente uma implementação de método, não uma sobrecarga.", + "A_decorator_can_only_decorate_a_method_implementation_not_an_overload_1249": "Um decorador pode decorar somente uma implementação de método, não uma sobrecarga.", "A_default_clause_cannot_appear_more_than_once_in_a_switch_statement_1113": "Uma cláusula 'default' não pode aparecer mais de uma vez em uma instrução 'switch'.", "A_default_export_can_only_be_used_in_an_ECMAScript_style_module_1319": "Uma exportação padrão só pode ser usada em um módulo do estilo ECMAScript.", "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255": "Uma declaração de atribuição definitiva '!' não é permitida neste contexto.", @@ -42,22 +42,24 @@ "A_generator_cannot_have_a_void_type_annotation_2505": "O gerador não pode ter uma anotação de tipo 'void'.", "A_get_accessor_cannot_have_parameters_1054": "Um acessador 'get' não pode ter parâmetros.", "A_get_accessor_must_return_a_value_2378": "Um acessador 'get' deve retornar um valor.", - "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "O inicializador de um membro em uma declaração enum não pode referenciar membros declarados depois dele, inclusive membros definidos em outros enums.", + "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "O inicializador de um membro em uma declaração de enumeração não pode referenciar membros declarados depois dele, inclusive membros definidos em outras enumerações.", "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": "Uma classe mixin deve ter um construtor um único parâmetro rest do tipo 'any[]'.", "A_module_cannot_have_multiple_default_exports_2528": "Um módulo não pode ter várias exportações padrão.", "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Uma declaração de namespace não pode estar em um arquivo diferente de uma classe ou função com a qual ela é mesclada.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Uma declaração de namespace não pode estar localizada antes de uma classe ou função com a qual ela é mesclada.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Uma declaração de namespace só é permitida e um namespace ou módulo.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Uma importação de estilo do namespace não pode ser chamada nem construída e causará uma falha no tempo de execução.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Um inicializador de parâmetro só é permitido em uma implementação de função ou de construtor.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Uma propriedade de parâmetro não pode ser declarada usando um parâmetro rest.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Uma propriedade de parâmetro somente é permitida em uma implementação de construtor.", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "Uma propriedade de parâmetro pode não ser declarada usando um padrão de associação.", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "Um caminho em uma opção 'extends' deve ser relativo ou ter raiz, mas o '{0}' não é.", "A_promise_must_have_a_then_method_1059": "Uma promessa deve ter um método 'then'.", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Uma propriedade de uma classe cujo tipo é um tipo de 'símbolo exclusivo' deve ser 'estática' e 'somente leitura'.", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Uma propriedade de uma interface ou tipo literal cujo tipo é um tipo de 'símbolo exclusivo' deve ser 'somente leitura'.", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Uma propriedade de uma classe cujo tipo é um tipo de 'unique symbol' deve ser 'static' e 'readonly'.", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Uma propriedade de uma interface ou tipo literal cujo tipo é um tipo de 'unique symbol' deve ser 'readonly'.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Um parâmetro obrigatório não pode seguir um parâmetro opcional.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Um elemento rest não pode conter um padrão de associação.", + "A_rest_element_cannot_have_a_property_name_2566": "Um elemento restante não pode ter um nome de propriedade.", "A_rest_element_cannot_have_an_initializer_1186": "Um elemento rest não pode ter um inicializador.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Um elemento rest deve ser o último em um padrão de desestruturação.", "A_rest_parameter_cannot_be_optional_1047": "Um parâmetro rest não pode ser opcional.", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "O predicado de tipo não pode fazer referência ao elemento '{0}' em um padrão de associação.", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "O predicado de tipo só é permitido na posição de tipo de retorno para funções e métodos.", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "O tipo de um predicado de tipo deve ser atribuível para o tipo de seu parâmetro.", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Uma variável cujo tipo é um tipo de 'símbolo exclusivo' deve ser 'const'.", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Uma variável cujo tipo é um tipo de 'unique symbol' deve ser 'const'.", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "A expressão 'yield' só é permitida em um corpo gerador.", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "O método abstrato '{0}' na classe '{1}' não pode ser acessado por meio da expressão super.", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Os métodos abstratos só podem aparecer dentro de uma classe abstrata.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "O modificador de acessibilidade já foi visto.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Os acessadores somente estão disponíveis no direcionamento para ECMAScript 5 e superior.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Acessadores devem ser abstratos ou não abstratos.", - "Add_0_to_existing_import_declaration_from_1_90015": "Adicione \"{0}\" à declaração de importação existente de \"{1}\".", - "Add_index_signature_for_property_0_90017": "Adicione assinatura de índice para a propriedade '{0}'.", - "Add_missing_super_call_90001": "Adicionar chamada 'super()' ausente.", - "Add_this_to_unresolved_variable_90008": "Adicione 'this.' a uma variável não resolvida.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Adicionar um arquivo tsconfig.json ajuda a organizar projetos que contêm arquivos TypeScript e JavaScript. Saiba mais em https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "Adicionar '{0}' à declaração de importação existente de \"{1}\"", + "Add_async_modifier_to_containing_function_90029": "Adicione o modificador assíncrono que contém a função", + "Add_index_signature_for_property_0_90017": "Adicionar assinatura de índice para a propriedade '{0}'", + "Add_missing_super_call_90001": "Adicionar chamada 'super()' ausente", + "Add_this_to_unresolved_variable_90008": "Adicionar 'this.' a uma variável não resolvida", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Adicionar um arquivo tsconfig.json ajudará a organizar projetos que contêm arquivos TypeScript e JavaScript. Saiba mais em https://aka.ms/tsconfig.", "Additional_Checks_6176": "Verificações Adicionais", "Advanced_Options_6178": "Opções Avançadas", "All_declarations_of_0_must_have_identical_modifiers_2687": "Todas as declarações de '{0}' devem ter modificadores idênticos.", @@ -111,12 +114,12 @@ "An_accessor_cannot_be_declared_in_an_ambient_context_1086": "Um acessador não pode ser declarado em um contexto de ambiente.", "An_accessor_cannot_have_type_parameters_1094": "Um acessador não pode ter parâmetros de tipo.", "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234": "Uma declaração de módulo de ambiente só é permitida no nível superior em um arquivo.", - "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Um operando aritmético deve ser do tipo 'any', 'number' ou um tipo enum.", + "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Um operando aritmético deve ser do tipo 'any', 'number' ou um tipo de enumeração.", "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705": "Uma função ou método assíncrono em ES5/ES3 requer o construtor 'Promise'. Verifique se você tem a declaração para o construtor 'Promise' ou inclua 'ES2015' em sua opção `--lib`.", "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057": "Um método ou função assíncrona deve ter um tipo de retorno válido que é possível aguardar.", "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697": "Um método ou função assíncrona deve retornar uma 'Promessa'. Certifique-se de ter uma declaração para 'Promessa' ou inclua 'ES2015' na sua opção `--lib`.", "An_async_iterator_must_have_a_next_method_2519": "O iterador assíncrono deve ter um método 'next()'.", - "An_enum_member_cannot_have_a_numeric_name_2452": "Um membro enum não pode ter um nome numérico.", + "An_enum_member_cannot_have_a_numeric_name_2452": "Um membro de enumeração não pode ter um nome numérico.", "An_export_assignment_can_only_be_used_in_a_module_1231": "Uma atribuição de exportação só pode ser usada em um módulo.", "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309": "Uma atribuição de exportação não pode ser usada em um módulo com outros elementos exportados.", "An_export_assignment_cannot_be_used_in_a_namespace_1063": "Uma atribuição de exportação não pode ser usada em um namespace.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Um parâmetro de assinatura de índice não pode ter um modificador de acessibilidade.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Um parâmetro de assinatura de índice não pode ter um inicializador.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "Um parâmetro de assinatura de índice deve ter uma anotação de tipo.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Um tipo de parâmetro de assinatura de índice não pode ser um alias de tipo. Considere gravar ' [{0}: {1}]: {2}' em vez disso.", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Um tipo de parâmetro de assinatura de índice não pode ser um tipo de união. Considere usar um tipo de objeto mapeado em vez disso.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Um tipo de parâmetro de assinatura de índice deve ser 'string' ou 'number'.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Uma interface só pode estender um identificador/nome qualificado com argumentos de tipo opcionais.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Uma interface só pode estender uma classe ou outra interface.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "Dígito binário esperado.", "Binding_element_0_implicitly_has_an_1_type_7031": "O elemento de associação '{0}' tem implicitamente um tipo '{1}'.", "Block_scoped_variable_0_used_before_its_declaration_2448": "Variável de escopo de bloco '{0}' usada antes da sua declaração.", - "Call_decorator_expression_90028": "Chamar expressão decoradora.", + "Call_decorator_expression_90028": "Chamar expressão do decorador", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Assinatura de chamada, que não tem a anotação de tipo de retorno, implicitamente tem um tipo de retorno 'any'.", "Call_target_does_not_contain_any_signatures_2346": "O destino da chamada não contém nenhuma assinatura.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Não foi possível acessar '{0}.{1}' porque '{0}' é um tipo, mas não um namespace. Você quis dizer recuperar o tipo da propriedade '{1}' em '{0}' com '{0}[\"{1}\"]'?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Não é possível importar arquivos de declaração de tipo. Considere a possibilidade de importar '{0}' em vez de '{1}'.", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Não é possível inicializar a variável com escopo externo '{0}' no mesmo escopo que a declaração de escopo de bloco '{1}'.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Não é possível invocar uma expressão cujo tipo não tem uma assinatura de chamada. O tipo '{0}' não tem assinaturas de chamada compatíveis.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Não é possível invocar um objeto que é possivelmente 'nulo'.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Não é possível invocar um objeto que é possivelmente 'nulo' ou 'indefinido'.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Não é possível invocar um objeto que é possivelmente 'indefinido'.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "Não será possível reexportar um tipo quando o sinalizador '--isolatedModules' for fornecido.", "Cannot_read_file_0_Colon_1_5012": "Não é possível ler o arquivo '{0}': {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "Não é possível declarar novamente a variável de escopo de bloco '{0}'.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Não é possível gravar o arquivo '{0}' porque ele substituiria o arquivo de entrada.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "A variável de cláusula catch não pode ter uma anotação de tipo.", "Catch_clause_variable_cannot_have_an_initializer_1197": "A variável de cláusula catch não pode ter um inicializador.", - "Change_0_to_1_90014": "Alterar '{0}' para '{1}'.", - "Change_extends_to_implements_90003": "Altere 'extends' para 'implements'.", - "Change_spelling_to_0_90022": "Alterar ortografia para '{0}'.", + "Change_0_to_1_90014": "Alterar '{0}' para '{1}'", + "Change_extends_to_implements_90003": "Alterar 'extends' para 'implements'", + "Change_spelling_to_0_90022": "Alterar ortografia para '{0}'", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Verificando se '{0}' é o maior prefixo correspondente para '{1}' - '{2}'.", "Circular_definition_of_import_alias_0_2303": "Definição circular do alias de importação '{0}'.", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "Circularidade detectada ao resolver a configuração: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "A classe '{0}' define a função de membro de instância '{1}', mas a classe estendida '{2}' a define como uma propriedade de membro de instância.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "A classe '{0}' define a propriedade de membro de instância '{1}', mas a classe estendida '{2}' a define como uma função de membro de instância.", "Class_0_incorrectly_extends_base_class_1_2415": "A classe '{0}' estende incorretamente a classe base '{1}'.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "A classe '{0}' implementa incorretamente a classe '{1}'. Você pretendia estender '{1}' e herdar seus membros como uma subclasse?", "Class_0_incorrectly_implements_interface_1_2420": "A classe '{0}' implementa incorretamente a interface '{1}'.", "Class_0_used_before_its_declaration_2449": "Classe '{0}' usada antes de sua declaração.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Declarações de classe não podem ter mais de uma marca `@augments` ou `@extends`.", @@ -234,7 +243,7 @@ "Compiler_option_0_expects_an_argument_6044": "A opção do compilador '{0}' espera um argumento.", "Compiler_option_0_requires_a_value_of_type_1_5024": "A opção do compilador '{0}' requer um valor do tipo {1}.", "Computed_property_names_are_not_allowed_in_enums_1164": "Nomes de propriedade calculados não são permitidos em enums.", - "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": "Os valores computados não são permitidos em um enum com membros de valor de cadeia de caracteres.", + "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": "Os valores computados não são permitidos em uma enumeração com membros de valor de cadeia de caracteres.", "Concatenate_and_emit_output_to_single_file_6001": "Concatenar e emitir saída para um arquivo único.", "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090": "Foram encontradas definições em conflito para '{0}' em '{1}' e em '{2}'. Considere instalar uma versão específica desta biblioteca para solucionar o conflito.", "Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7013": "Assinatura de constructo, que não tem a anotação de tipo de retorno, implicitamente tem um tipo de retorno 'any'.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "O arquivo contido não foi especificado e o diretório raiz não pode ser determinado, ignorando a pesquisa na pasta 'node_modules'.", "Convert_function_0_to_class_95002": "Converter função '{0}' em classe", "Convert_function_to_an_ES2015_class_95001": "Converter função em uma classe ES2015", + "Convert_to_ES6_module_95017": "Converter em módulo ES6", "Convert_to_default_import_95013": "Converter para importação padrão", "Corrupted_locale_file_0_6051": "Arquivo de localidade {0} corrompido.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Não foi possível localizar o arquivo de declaração para o módulo '{0}'. '{1}' tem implicitamente um tipo 'any'.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Declaração esperada.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "O nome de declaração entra em conflito com o identificador global integrado '{0}'.", "Declaration_or_statement_expected_1128": "Declaração ou instrução esperada.", - "Declare_method_0_90023": "Declare o método '{0}'.", - "Declare_property_0_90016": "Declare a propriedade '{0}'.", - "Declare_static_method_0_90024": "Declare o método estático '{0}'.", - "Declare_static_property_0_90027": "Declare a propriedade estática \"{0}\".", + "Declare_method_0_90023": "Declarar método '{0}'", + "Declare_property_0_90016": "Declarar propriedade '{0}'", + "Declare_static_method_0_90024": "Declarar método estático '{0}'", + "Declare_static_property_0_90027": "Declarar propriedade estática '{0}'", "Decorators_are_not_valid_here_1206": "Os decoradores não são válidos aqui.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Os decoradores não podem ser aplicados a vários acessadores get/set de mesmo nome.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "A exportação padrão do módulo tem ou está usando o nome particular '{0}'.", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Preterido] Use '--skipLibCheck' no lugar. Ignore a verificação de tipo dos arquivos de declaração de biblioteca padrão.", "Digit_expected_1124": "Dígito esperado.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "O diretório '{0}' não existe; ignorando todas as pesquisas nele.", - "Disable_checking_for_this_file_90018": "Desabilitar a verificação para esse arquivo.", + "Disable_checking_for_this_file_90018": "Desabilitar a verificação para esse arquivo", "Disable_size_limitations_on_JavaScript_projects_6162": "Desabilitar as limitações de tamanho nos projetos JavaScript.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Desabilitar verificação estrita de assinaturas genéricas em tipos de função.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "Não permitir referências com maiúsculas de minúsculas inconsistentes no mesmo arquivo.", @@ -309,15 +319,16 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "Habilite a verificação estrita de inicialização de propriedade nas classes.", "Enable_strict_null_checks_6113": "Habilite verificações nulas estritas.", "Enable_tracing_of_the_name_resolution_process_6085": "Habilite o rastreio do processo de resolução de nome.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Permite emissão de interoperabilidade entre CommonJS e Módulos ES através da criação de objetos de namespace para todas as importações. Implica em 'allowSyntheticDefaultImports'.", "Enables_experimental_support_for_ES7_async_functions_6068": "Habilita o suporte experimental para funções assíncronas de ES7.", "Enables_experimental_support_for_ES7_decorators_6065": "Habilita o suporte experimental para decoradores ES7.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Habilita o suporte experimental para a emissão de tipo de metadados para decoradores.", - "Enum_0_used_before_its_declaration_2450": "Enum '{0}' usada antes de sua declaração.", - "Enum_declarations_must_all_be_const_or_non_const_2473": "Declarações enum devem ser const ou não const.", - "Enum_member_expected_1132": "Membro enum esperado.", - "Enum_member_must_have_initializer_1061": "O membro enum deve ter um inicializador.", - "Enum_name_cannot_be_0_2431": "O nome de enum não pode ser '{0}'.", - "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535": "O tipo Enum '{0}' tem membros com inicializadores que não são literais.", + "Enum_0_used_before_its_declaration_2450": "A enumeração '{0}' usada antes de sua declaração.", + "Enum_declarations_must_all_be_const_or_non_const_2473": "Declarações de enumeração devem ser const ou não const.", + "Enum_member_expected_1132": "Membro de enumeração esperado.", + "Enum_member_must_have_initializer_1061": "O membro de enumeração deve ter um inicializador.", + "Enum_name_cannot_be_0_2431": "O nome de enumeração não pode ser '{0}'.", + "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535": "O tipo de Enumeração '{0}' tem membros com inicializadores que não são literais.", "Examples_Colon_0_6026": "Exemplos: {0}", "Excessive_stack_depth_comparing_types_0_and_1_2321": "Profundidade da pilha excessiva ao comparar tipos '{0}' e '{1}'.", "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "Espera-se {0}-{1} argumentos de tipo; forneça esses recursos com uma marca \"@extends\".", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "A expressão é resolvida como a declaração de variável '_this' que o compilador utiliza para capturar a referência 'this'.", "Extract_constant_95006": "Extrair constante", "Extract_function_95005": "Extrair função", - "Extract_symbol_95003": "Extrair símbolo", "Extract_to_0_in_1_95004": "Extrair para {0} em {1}", "Extract_to_0_in_1_scope_95008": "Extrair para {0} no escopo {1}", "Extract_to_0_in_enclosing_scope_95007": "Extrair para {0} no escopo de delimitação", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "O nome do arquivo '{0}' difere do nome de arquivo '{1}' já incluído somente em maiúsculas e minúsculas.", "File_name_0_has_a_1_extension_stripping_it_6132": "O nome do arquivo '{0}' tem uma extensão '{1}' – remoção.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "A especificação de arquivo não pode conter um diretório pai ('..') que aparece após um curinga de diretório recursivo ('**'): '{0}'.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "A especificação de arquivo não pode conter vários curingas do diretório recursivo ('**'): '{0}'.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "A especificação de arquivo não pode terminar em um curinga do diretório recursivo ('**'): '{0}'.", "Found_package_json_at_0_6099": "'package.json' encontrado em '{0}'.", + "Found_package_json_at_0_Package_ID_is_1_6190": "'package.json' encontrado em '{0}'. A ID do pacote é '{1}'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Decorações de função não são permitidas dentro de blocos em modo estrito quando o objetivo é 'ES3' ou 'ES5'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Declarações de função não são permitidas dentro de blocos em modo estrito quando o objetivo é 'ES3' ou 'ES5'. Definições de classe estão automaticamente em modo estrito.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Declarações de função não são permitidas dentro de blocos em modo estrito quando o objetivo é 'ES3' ou 'ES5'. Módulos estão automaticamente em modo estrito.", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "Identificador esperado. '{0}' é uma palavra reservada em modo estrito. Os módulos ficam automaticamente em modo estrito.", "Identifier_expected_1003": "Identificador esperado.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Identificador esperado. '__esModule' é reservado como um marcador exportado ao transformar os módulos ECMAScript.", - "Ignore_this_error_message_90019": "Ignore essa mensagem de erro.", - "Implement_inherited_abstract_class_90007": "Implemente a classe abstrata herdada.", - "Implement_interface_0_90006": "Implemente a interface '{0}'.", + "Ignore_this_error_message_90019": "Ignorar essa mensagem de erro", + "Implement_inherited_abstract_class_90007": "Implementar classe abstrata herdada", + "Implement_interface_0_90006": "Implementar a interface '{0}'", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "A cláusula implements da classe exportada '{0}' tem ou está usando o nome particular '{1}'.", - "Import_0_from_module_1_90013": "Importar '{0}' do módulo \"{1}\".", + "Import_0_from_module_1_90013": "Importar '{0}' do módulo \"{1}\"", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Não é possível usar a atribuição de importação durante o direcionamento para módulos de ECMAScript. Use 'importar * como ns de \"mod\"', 'importar {a} de \"mod\"', 'importar d de \"mod\"' ou outro formato de módulo em vez disso.", "Import_declaration_0_is_using_private_name_1_4000": "A declaração da importação '{0}' está usando o nome particular '{1}'.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "A declaração da importação está em conflito com a declaração local '{0}'.", @@ -417,17 +427,17 @@ "Import_name_cannot_be_0_2438": "O nome da importação não pode ser '{0}'.", "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439": "A declaração de importação e exportação em uma declaração de módulo de ambiente não pode fazer referência ao módulo por meio do nome do módulo relativo.", "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667": "Importações não são permitidas em acréscimos de módulo. Considere movê-las para o módulo externo delimitador.", - "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Em declarações enum de ambiente, o inicializador de membro deve ser uma expressão de constante.", - "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Em um enum com várias declarações, somente uma declaração pode omitir um inicializador para o primeiro elemento enum.", - "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "Em declarações enum 'const', o inicializador de membro deve ser uma expressão de constante.", + "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Em declarações de enumeração de ambiente, o inicializador de membro deve ser uma expressão de constante.", + "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Em uma enumeração com várias declarações, somente uma declaração pode omitir um inicializador para o primeiro elemento de enumeração.", + "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "Em declarações de enumeração 'const', o inicializador de membro deve ser uma expressão de constante.", "Index_signature_in_type_0_only_permits_reading_2542": "Assinatura de índice no tipo '{0}' permite somente leitura.", "Index_signature_is_missing_in_type_0_2329": "Assinatura de índice ausente no tipo '{0}'.", "Index_signatures_are_incompatible_2330": "As assinaturas de índice são incompatíveis.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Todas as declarações individuais na declaração mesclada '{0}' devem ser exportadas ou ficar no local.", - "Infer_parameter_types_from_usage_95012": "Inferir os tipos de parâmetro do uso.", - "Infer_type_of_0_from_usage_95011": "Inferir o tipo de '{0}' do uso.", - "Initialize_property_0_in_the_constructor_90020": "Inicializar a propriedade '{0}' no construtor.", - "Initialize_static_property_0_90021": "Inicializar a propriedade estática '{0}'.", + "Infer_parameter_types_from_usage_95012": "Inferir tipos de parâmetro pelo uso", + "Infer_type_of_0_from_usage_95011": "Inferir tipo de '{0}' pelo uso", + "Initialize_property_0_in_the_constructor_90020": "Inicializar a propriedade '{0}' no construtor", + "Initialize_static_property_0_90021": "Inicializar a propriedade estática '{0}'", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "O inicializador da variável de membro de instância '{0}' não pode referenciar o identificador '{1}' declarado no construtor.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "O inicializador do parâmetro '{0}' não pode referenciar o identificador '{1}' declarado depois dele.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "O inicializador não fornece um valor para esse elemento de associação e o elemento de associação não tem valor padrão.", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "A localidade deve estar no formato ou -. Por exemplo '{0}' ou '{1}'.", "Longest_matching_prefix_for_0_is_1_6108": "O maior prefixo correspondente para '{0}' é '{1}'.", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Pesquisando na pasta 'node_modules', local inicial '{0}'.", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Tornar a chamada 'super()' a primeira instrução no construtor.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "Tornar a chamada 'super()' a primeira instrução no construtor", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "O tipo de objeto mapeado implicitamente tem um tipo de modelo 'any'.", "Member_0_implicitly_has_an_1_type_7008": "O membro '{0}' implicitamente tem um tipo '{1}'.", "Merge_conflict_marker_encountered_1185": "Marcador de conflito de mesclagem encontrado.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "A declaração mesclada '{0}' não pode conter uma declaração de exportação padrão. Considere adicionar uma declaração 'export default {0}' independente.", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== Nome do módulo '{0}' foi resolvido com sucesso '{1}'. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Resolução de tipo não foi especificado, usando '{0}'.", "Module_resolution_using_rootDirs_has_failed_6111": "Falha na resolução de módulo usando 'rootDirs'.", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Não são permitidos vários separadores numéricos consecutivos.", "Multiple_constructor_implementations_are_not_allowed_2392": "Não são permitidas várias implementações de construtor.", "NEWLINE_6061": "NEWLINE", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "As propriedades com nome '{0}' dos tipos '{1}' e '{2}' não são idênticas.", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "A expressão da classe não abstrata não implementa o membro abstrato herdado '{0}' da classe '{1}'.", "Not_all_code_paths_return_a_value_7030": "Nem todos os caminhos de código retornam um valor.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "O tipo de índice numérico '{0}' não é atribuível ao tipo de índice de cadeia de caracteres '{1}'.", + "Numeric_separators_are_not_allowed_here_6188": "Separadores numéricos não são permitidos aqui.", "Object_is_possibly_null_2531": "Possivelmente, o objeto é 'nulo'.", "Object_is_possibly_null_or_undefined_2533": "Possivelmente, o objeto é 'nulo' ou 'indefinido'.", "Object_is_possibly_undefined_2532": "Possivelmente, o objeto é 'nulo'.", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "Apenas uma função void pode ser chamada com a palavra-chave 'new'.", "Only_ambient_modules_can_use_quoted_names_1035": "Somente os módulos de ambiente podem usar nomes entre aspas.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Há suporte somente aos módulos 'amd' e 'system' ao lado de --{0}.", + "Only_emit_d_ts_declaration_files_6014": "Emita somente arquivos de declaração '.d.ts'.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Somente os identificadores/nomes qualificados com argumentos de tipo opcionais tem suporte atualmente nas cláusulas de classe 'extends'.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Somente métodos protegidos e públicos da classe base são acessíveis pela palavra-chave 'super'.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "O operador '{0}' não pode ser aplicado aos tipos '{1}' e '{2}'.", @@ -584,18 +598,19 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "O tipo de parâmetro do setter estático público '{0}' da classe exportada tem ou está usando o nome privado '{1}'.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Analisar em modo estrito e emitir \"usar estrito\" para cada arquivo de origem.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "O padrão '{0}' pode ter no máximo um caractere '*'.", - "Prefix_0_with_an_underscore_90025": "Prefixo '{0}' com um sublinhado.", + "Prefix_0_with_an_underscore_90025": "Prefixo '{0}' com um sublinhado", "Print_names_of_files_part_of_the_compilation_6155": "Nomes de impressão das partes dos arquivos da compilação.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Nomes de impressão das partes dos arquivos gerados da compilação.", "Print_the_compiler_s_version_6019": "Imprima a versão do compilador.", "Print_this_message_6017": "Imprima esta mensagem.", - "Property_0_does_not_exist_on_const_enum_1_2479": "A propriedade '{0}' não existe no enum 'const' '{1}'.", + "Property_0_does_not_exist_on_const_enum_1_2479": "A propriedade '{0}' não existe na enumeração 'const' '{1}'.", "Property_0_does_not_exist_on_type_1_2339": "A propriedade '{0}' não existe no tipo '{1}'.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "A propriedade '{0}' não existe no tipo '{1}'. Você quis dizer '{2}'?", "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546": "A propriedade '{0}' tem declarações conflitantes e é inacessível no tipo '{1}'.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "A propriedade '{0}' não tem nenhum inicializador e não está definitivamente atribuída no construtor.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "A propriedade '{0}' tem implicitamente o tipo 'any' porque o acessador get não tem uma anotação de tipo de retorno.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "A propriedade '{0}' tem implicitamente o tipo 'any' porque o acessador set não tem uma anotação de tipo de parâmetro.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "A propriedade '{0}' no tipo '{1}' não pode ser atribuída à mesma propriedade no tipo base '{2}'.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "A propriedade '{0}' no tipo '{1}' não pode ser atribuída ao tipo '{2}'.", "Property_0_is_declared_but_its_value_is_never_read_6138": "A propriedade '{0}' é declarada, mas seu valor nunca é lido.", "Property_0_is_incompatible_with_index_signature_2530": "A propriedade '{0}' é incompatível com a assinatura de índice.", @@ -634,7 +649,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Gerar erro em expressões e declarações com um tipo 'any' implícito.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Gerar erro em expressões 'this' com um tipo 'any' implícito.", "Redirect_output_structure_to_the_directory_6006": "Redirecione a estrutura de saída para o diretório.", - "Remove_declaration_for_Colon_0_90004": "Remover declaração para: '{0}'.", + "Remove_declaration_for_Colon_0_90004": "Remover declaração para: '{0}'", + "Replace_import_with_0_95015": "Substitua a importação com '{0}'.", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Relate erro quando nem todos os caminhos de código na função retornarem um valor.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Relate erros para casos de fallthrough na instrução switch.", "Report_errors_in_js_files_8019": "Relatar erros em arquivos .js.", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "O tipo de retorno do método estático público da classe exportada tem ou está usando o nome particular '{0}'.", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Reutilizando resoluções de módulo originados em '{0}', já que as resoluções do programa antigo estão inalteradas.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Reutilizando a resolução do módulo '{0}' para o arquivo '{1}' do programa antigo.", - "Rewrite_as_the_indexed_access_type_0_90026": "Regravar como o tipo de acesso indexado '{0}'.", + "Rewrite_as_the_indexed_access_type_0_90026": "Reescrever como o tipo de acesso indexado '{0}'", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Diretório raiz não pode ser determinado, ignorando caminhos de pesquisa primários.", "STRATEGY_6039": "ESTRATÉGIA", "Scoped_package_detected_looking_in_0_6182": "Pacote com escopo detectado, procurando no '{0}'", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "Opções do Sourcemap", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "A assinatura de sobrecarga especializada não pode ser atribuída a qualquer assinatura não especializada.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "O especificador de importação dinâmica não pode ser o elemento de difusão.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "Especifique a versão de destino do ECMAScript: 'ES3' (padrão), 'ES5', 'ES2015', 'ES2016', 'ES2017' ou 'ESNEXT'.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "Especifique a versão de destino do ECMAScript: 'ES3' (padrão), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' ou 'ESNEXT'.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "Especifique a geração de código JSX: 'preserve', 'react-native' ou 'react'.", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Especifique os arquivos de biblioteca a serem incluídos na compilação: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Especifique os arquivos de biblioteca a serem incluídos na compilação.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Especifique a geração de código de módulo: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015' ou 'ESNext'.", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Especifique a estratégia de resolução de módulo: 'node' (Node.js) ou 'classic' (TypeScript pré-1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Especifique a função de fábrica JSX a ser usada ao direcionar a emissão 'react' do JSX, por ex., 'React.createElement' ou 'h'.", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Especifique o diretório raiz de arquivos de entrada. Use para controlar a estrutura do diretório de saída com --outDir.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "O operador de espalhamento só está disponível em expressões 'new' no direcionamento a ECMAScript 5 e superior.", "Spread_types_may_only_be_created_from_object_types_2698": "Os tipos de espalhamento podem ser criados apenas de tipos de objeto.", + "Starting_compilation_in_watch_mode_6031": "Iniciando compilação no modo de inspeção...", "Statement_expected_1129": "Instrução esperada.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Instruções não são permitidas em contextos de ambiente.", "Static_members_cannot_reference_class_type_parameters_2302": "Membros estáticos não podem fazer referência a parâmetros de tipo de classe.", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "Literal de cadeia de caracteres esperado.", "String_literal_with_double_quotes_expected_1327": "Literal de cadeia com aspas duplas é esperado.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Estilizar erros e mensagens usando cor e contexto (experimental).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Declarações de propriedade subsequentes devem ter o mesmo tipo. A propriedade '{0}' deve ser do tipo '{1}', mas aqui tem o tipo '{2}'.", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Declarações de variável subsequentes devem ter o mesmo tipo. A variável '{0}' deve ser do tipo '{1}', mas aqui tem o tipo '{2}'.", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "A substituição '{0}' para o padrão '{1}' tem um tipo incorreto, 'string' esperada, obteve '{2}'.", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "A substituição '{0}' no padrão '{1}' pode ter no máximo um caractere '*'.", @@ -745,7 +762,7 @@ "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405": "O lado esquerdo de uma instrução de 'for...in' deve ser do tipo 'string' ou 'any'.", "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483": "O lado esquerdo de uma instrução 'for...of' não pode usar uma anotação de tipo.", "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487": "O lado esquerdo de uma instrução 'for...of' deve ser uma variável ou um acesso à propriedade.", - "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362": "O lado esquerdo de uma operação aritmética deve ser do tipo 'any', 'number' ou enum.", + "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362": "O lado esquerdo de uma operação aritmética deve ser do tipo 'any', 'number' ou de enumeração.", "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "O lado esquerdo de uma expressão de atribuição deve ser uma variável ou um acesso à propriedade.", "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "O lado esquerdo de uma expressão 'in' deve ser do tipo 'any', 'string', 'number' ou 'symbol'.", "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "O lado esquerdo de uma expressão 'instanceof' deve ser do tipo 'any', um tipo de objeto ou um parâmetro de tipo.", @@ -760,7 +777,7 @@ "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058": "O tipo de retorno de uma função assíncrona deve ser uma promessa válida ou não deve conter um membro \"then\" que pode ser chamado.", "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064": "O tipo de retorno de uma função assíncrona ou método deve ser o tipo Promessa global.", "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407": "O lado direito de uma instrução 'for...in' deve ser do tipo 'any', um tipo de objeto ou um parâmetro de tipo.", - "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363": "O lado direito de uma operação aritmética deve ser do tipo 'any', 'number' ou enum.", + "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363": "O lado direito de uma operação aritmética deve ser do tipo 'any', 'number' ou de enumeração.", "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361": "O lado direito de uma expressão 'in' deve ser do tipo 'any', um tipo de objeto ou um parâmetro de tipo.", "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359": "O lado direito de uma expressão 'instanceof' deve ser do tipo 'any' ou de um tipo que pode ser atribuído ao tipo de interface 'Function'.", "The_specified_path_does_not_exist_Colon_0_5058": "O caminho especificado não existe: '{0}'.", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "O tipo '{0}' não é um tipo de matriz de um tipo de cadeia ou não tem um método '[Symbol.iterator]()' que retorna um iterador.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "O tipo '{0}' não é um tipo de matriz ou não tem um método '[Symbol.iterator]()' que retorna um iterador.", "Type_0_is_not_assignable_to_type_1_2322": "O tipo '{0}' não pode ser atribuído ao tipo '{1}'.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "O tipo '{0}' não é atribuível ao tipo '{1}'. Dois tipos diferentes com esse nome existem, mas eles não são relacionados.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "O tipo '{0}' não é atribuível ao tipo '{1}'. Dois tipos diferentes com esse nome existem, mas eles não estão relacionados.", "Type_0_is_not_comparable_to_type_1_2678": "O tipo '{0}' não pode ser comparável ao tipo '{1}'.", "Type_0_is_not_generic_2315": "O tipo '{0}' não é genérico.", "Type_0_provides_no_match_for_the_signature_1_2658": "O tipo '{0}' fornece nenhuma correspondência para a assinatura '{1}'.", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "Literal de modelo não finalizado.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Chamadas de função não tipadas não podem aceitar argumentos de tipo.", "Unused_label_7028": "Rótulo não utilizado.", + "Use_synthetic_default_member_95016": "Use o membro sintético 'padrão'.", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Há suporte para o uso de uma cadeia de caracteres em uma instrução 'for...of' somente no ECMAScript 5 e superior.", "VERSION_6036": "VERSÃO", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "O valor do tipo '{0}' não tem propriedades em comum com o tipo '{1}'. Você queria chamá-lo?", @@ -909,11 +927,11 @@ "can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment_1312": "'=' só pode ser usado em uma propriedade literal de objeto dentro de uma atribuição de desestruturação.", "case_or_default_expected_1130": "'case' ou 'default' esperado.", "class_expressions_are_not_currently_supported_9003": "No momento, não há suporte para expressões 'class'.", - "const_declarations_can_only_be_declared_inside_a_block_1156": "declarações 'const' só podem ser declaradas dentro de um bloco.", - "const_declarations_must_be_initialized_1155": "As declarações 'const' devem ser inicializadas.", - "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "O inicializador de membro enum 'const' foi avaliado como um valor não finito.", - "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "O inicializador de membro enum 'const' foi avaliado como o valor não permitido 'NaN'.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Enums 'const' só podem ser usados em expressões de acesso de índice ou propriedade, ou do lado direito de uma declaração de importação ou atribuição de exportação.", + "const_declarations_can_only_be_declared_inside_a_block_1156": "Declarações 'const' só podem ser declaradas dentro de um bloco.", + "const_declarations_must_be_initialized_1155": "Declarações 'const' devem ser inicializadas.", + "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "O inicializador de membro de enumeração 'const' foi avaliado como um valor não finito.", + "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "O inicializador de membro de enumeração 'const' foi avaliado como o valor não permitido 'NaN'.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Enumerações 'const' só podem ser usadas em expressões de acesso de índice ou propriedade, ou então do lado direito de uma consulta de tipo, declaração de importação ou atribuição de exportação.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "'delete' não pode ser chamado em um identificador no modo estrito.", "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum declarations' só podem ser usadas em um arquivo .ts.", "export_can_only_be_used_in_a_ts_file_8003": "'export=' só pode ser usado em um arquivo .ts.", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "A cláusula 'implements' já foi vista.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "'implements clauses' só podem ser usadas em um arquivo .ts.", "import_can_only_be_used_in_a_ts_file_8002": "'import ... =' só pode ser usado em um arquivo .ts.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "As declarações 'infer' só são permitidas na cláusula 'extends' de um tipo condicional.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "'interface declarations' só podem ser usadas em um arquivo .ts.", "let_declarations_can_only_be_declared_inside_a_block_1157": "Declarações 'let' só podem ser declaradas dentro de um bloco.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "O uso de 'let' não é permitido como um nome em declarações 'let' ou 'const'.", @@ -963,9 +982,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "'type assertion expressions' só podem ser usadas em um arquivo .ts.", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "'type parameter declarations' só podem ser usadas em um arquivo .ts.", "types_can_only_be_used_in_a_ts_file_8010": "'types' só podem ser usados em um arquivo .ts.", - "unique_symbol_types_are_not_allowed_here_1335": "tipos de 'símbolo exclusivo' não são permitidos aqui.", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "tipos de 'símbolo exclusivo' são permitidos apenas em variáveis em uma declaração de variável.", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "tipos de 'símbolo exclusivo' não podem ser usados em uma declaração de variável com um nome associado.", + "unique_symbol_types_are_not_allowed_here_1335": "Tipos de 'unique symbol' não são permitidos aqui.", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Tipos de 'unique symbol' são permitidos apenas em variáveis em uma declaração de variável.", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Tipos de 'unique symbol' não podem ser usados em uma declaração de variável com um nome associado.", "with_statements_are_not_allowed_in_an_async_function_block_1300": "As declarações 'with' não são permitidas em blocos de funções assíncronas.", "with_statements_are_not_allowed_in_strict_mode_1101": "Instruções 'with' não são permitidas no modo estrito.", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "As expressões 'yield' não podem ser usadas em inicializadores de parâmetros." diff --git a/lib/ru/diagnosticMessages.generated.json b/lib/ru/diagnosticMessages.generated.json index 87c1a222422..aee384f8f7d 100644 --- a/lib/ru/diagnosticMessages.generated.json +++ b/lib/ru/diagnosticMessages.generated.json @@ -12,11 +12,11 @@ "A_class_member_cannot_have_the_0_keyword_1248": "Элемент класса не может иметь ключевое слово \"{0}\".", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "Выражение с запятой запрещено в имени вычисляемого свойства.", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "Имя вычисляемого свойства не может ссылаться на параметр типа из содержащего его типа.", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Имя вычисляемого свойства в объявлении свойств класса должно ссылаться на выражение, тип которого — литерал или уникальный символ.", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Имя вычисляемого свойства в перегрузке метода должно ссылаться на выражение, тип которого — литерал или уникальный символ.", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Имя вычисляемого свойства в литерале должно ссылаться на выражение, тип которого — литерал или уникальный символ.", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Имя вычисляемого свойства в окружающем контексте должно ссылаться на выражение, тип которого — литерал или уникальный символ.", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Имя вычисляемого свойства в интерфейсе должно ссылаться на выражение, тип которого — литерал или уникальный символ.", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "Имя вычисляемого свойства в объявлении свойств класса должно ссылаться на выражение, тип которого — литерал или \"unique symbol\".", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "Имя вычисляемого свойства в перегрузке метода должно ссылаться на выражение, тип которого — литерал или \"unique symbol\".", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "Имя вычисляемого свойства в литерале должно ссылаться на выражение, тип которого — литерал или \"unique symbol\".", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Имя вычисляемого свойства в окружающем контексте должно ссылаться на выражение, тип которого — литерал или \"unique symbol\".", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Имя вычисляемого свойства в интерфейсе должно ссылаться на выражение, тип которого — литерал или \"unique symbol\".", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Имя вычисляемого свойства должно иметь тип string, number, symbol или any.", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "Имя вычисляемого свойства в форме \"{0}\" должно иметь тип symbol.", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Доступ к элементу перечисления констант может осуществляться только с использованием строкового литерала.", @@ -48,16 +48,18 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Объявление пространства имен и класс или функция, с которыми оно объединено, не могут находится в разных файлах.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Объявление пространства имен не может располагаться раньше класса или функции, с которыми оно объединено.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Объявление пространства имен разрешено использовать только в пространстве имен или модуле.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Импорт стиля пространства имен не может быть вызван или создан и приведет к сбою во время выполнения.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Инициализатор параметра разрешено использовать только в реализации функции или конструктора.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Свойство параметра невозможно объявить с помощью параметра REST.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Свойство параметра допускается только в реализации конструктора.", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "Свойство параметра невозможно объявить с помощью шаблона привязки.", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "Путь в параметре extends должен быть относительным или указанным от корня, но \"{0}\" не является ни тем ни другим.", "A_promise_must_have_a_then_method_1059": "Класс promise должен содержать метод then.", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Свойство класса, тип которого — уникальный символ, должно быть задано как \"static\" и \"readonly\".", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Свойство интерфейса или литерала, тип которого — уникальный символ, должно быть задано как \"readonly\".", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "Свойство класса, тип которого — \"unique symbol\", должно быть задано как \"static\" и \"readonly\".", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Свойство интерфейса или литерала, тип которого — \"unique symbol\", должно быть задано как \"readonly\".", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Обязательный параметр не должен следовать за необязательным.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "Элемент rest не может содержать шаблон привязки.", + "A_rest_element_cannot_have_a_property_name_2566": "Элемент rest не может иметь имя свойства.", "A_rest_element_cannot_have_an_initializer_1186": "Элемент rest не может содержать инициализатор.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Элемент REST должен быть последним в шаблоне деструктуризации.", "A_rest_parameter_cannot_be_optional_1047": "Параметр rest не может быть необязательным.", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "Предикат типов не может ссылаться на элемент \"{0}\" в шаблоне привязки.", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "Предикат типов разрешено использовать только в позиции типа возвращаемого значения для функций и методов.", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "Тип предиката типа должен быть доступным для назначения этому типу параметра.", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Переменная типа \"уникальный символ\" должна быть задана как \"const\".", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "Переменная, тип которой — \"unique symbol\", должна быть задана как \"const\".", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "Выражение yield разрешено использовать только в теле генератора.", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "Невозможно получить доступ к абстрактному методу \"{0}\" класса \"{1}\" с помощью выражения super.", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "Абстрактные методы могут использоваться только в абстрактных классах.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "Модификатор специальных возможностей уже встречался.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Методы доступа доступны только при разработке для ECMAScript 5 и более поздних версий.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "Методы доступа должны быть абстрактными или неабстрактными.", - "Add_0_to_existing_import_declaration_from_1_90015": "Добавьте \"{0}\" в существующее объявление импорта из \"{1}\".", - "Add_index_signature_for_property_0_90017": "Добавьте сигнатуру индекса для свойства \"{0}\".", - "Add_missing_super_call_90001": "Добавьте отсутствующий вызов \"super()\".", - "Add_this_to_unresolved_variable_90008": "Добавление \"this.\" к неразрешенной переменной.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Добавление файла tsconfig.json поможет организовать проекты, содержащие файлы TypeScript и JavaScript. Дополнительные сведения: https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "Добавьте \"{0}\" в существующее объявление импорта из \"{1}\"", + "Add_async_modifier_to_containing_function_90029": "Добавьте модификатор async в содержащую функцию", + "Add_index_signature_for_property_0_90017": "Добавьте сигнатуру индекса для свойства \"{0}\"", + "Add_missing_super_call_90001": "Добавьте отсутствующий вызов \"super()\"", + "Add_this_to_unresolved_variable_90008": "Добавьте \"this.\" к неразрешенной переменной", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Добавление файла tsconfig.json поможет организовать проекты, содержащие файлы TypeScript и JavaScript. Дополнительные сведения: https://aka.ms/tsconfig.", "Additional_Checks_6176": "Дополнительные проверки", "Advanced_Options_6178": "Дополнительные параметры", "All_declarations_of_0_must_have_identical_modifiers_2687": "Все объявления \"{0}\" должны иметь одинаковые модификаторы.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Параметра сигнатуры индекса не может содержать модификатор специальных возможностей.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Параметр сигнатуры индекса не может содержать инициализатор.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "У параметра сигнатуры индекса должна быть аннотация типа.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Тип параметра сигнатуры индекса не может быть псевдонимом типа. Вместо этого рекомендуется написать \"[{0}: {1}]: {2}\".", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Тип параметра сигнатуры индекса не может быть типом объединения. Рекомендуется использовать тип сопоставляемого объекта.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Параметр сигнатуры индекса должен иметь тип string или number.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Интерфейс может расширить только идентификатор или полное имя с дополнительными аргументами типа.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Интерфейс может расширять только класс или другой интерфейс.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "Ожидался бит.", "Binding_element_0_implicitly_has_an_1_type_7031": "Элемент привязки \"{0}\" имеет неявный тип \"{1}\".", "Block_scoped_variable_0_used_before_its_declaration_2448": "Переменная \"{0}\" с областью видимости, ограниченной блоком, использована перед своим объявлением.", - "Call_decorator_expression_90028": "Вызов выражения-декоратора.", + "Call_decorator_expression_90028": "Вызовите выражение декоратора", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Сигнатура вызова, у которой нет аннотации типа возвращаемого значения, неявно имеет тип возвращаемого значения any.", "Call_target_does_not_contain_any_signatures_2346": "Объект вызова не содержит сигнатуры.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "Не удается получить доступ к {0}.{1}, так как {0} является типом, но не является пространством имен. Вы хотели получить тип свойства {1} в {0} с использованием {0}[\"{1}\"]?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Невозможно импортировать файлы объявления типа. Рекомендуется импортировать \"{0}\" вместо \"{1}\".", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Невозможно инициализировать переменную \"{0}\" с внешней областью видимости в той же области видимости, что и объявление \"{1}\" с областью видимости \"Блок\".", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Не удается вызвать выражение, в типе которого отсутствует сигнатура вызова. Тип \"{0}\" не содержит совместимые сигнатуры вызова.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Не удается вызвать объект, который может иметь значение \"NULL\".", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Не удается вызвать объект, который может иметь значение \"NULL\" или \"undefined\".", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Не удается вызвать объект, который может иметь значение \"undefined\".", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "Невозможно повторно экспортировать тип, если установлен флажок \"--isolatedModules\".", "Cannot_read_file_0_Colon_1_5012": "Не удается считать файл \"{0}\": {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "Невозможно повторно объявить переменную \"{0}\" с областью видимости \"Блок\".", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Не удается записать файл \"{0}\", так как это привело бы к перезаписи входного файла.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Переменная оператора catch не может иметь аннотацию типа.", "Catch_clause_variable_cannot_have_an_initializer_1197": "Переменная оператора catch не может иметь инициализатор.", - "Change_0_to_1_90014": "Замена \"{0}\" на \"{1}\".", - "Change_extends_to_implements_90003": "Измените \"extends\" на \"implements\".", - "Change_spelling_to_0_90022": "Изменить правописание на \"{0}\".", + "Change_0_to_1_90014": "Измените \"{0}\" на \"{1}\"", + "Change_extends_to_implements_90003": "Измените \"extends\" на \"implements\"", + "Change_spelling_to_0_90022": "Измените написание на \"{0}\"", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "Идет проверка того, является ли \"{0}\" самым длинным соответствующим префиксом для \"{1}\" — \"{2}\".", "Circular_definition_of_import_alias_0_2303": "Циклическое определение псевдонима импорта \"{0}\".", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "Обнаружена цикличность при разрешении конфигурации: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "Класс \"{0}\" определяет функцию-элемент экземпляра \"{1}\", а расширенный класс \"{2}\" определяет ее как свойство-элемент экземпляра.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "Класс \"{0}\" определяет свойство-элемент экземпляра \"{1}\", а расширенный класс \"{2}\" определяет его как функцию-элемент экземпляра.", "Class_0_incorrectly_extends_base_class_1_2415": "Класс \"{0}\" неправильно расширяет базовый класс \"{1}\".", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "Класс \"{0}\" неправильно реализует класс \"{1}\". Вы хотели расширить \"{1}\" и унаследовать его члены в виде подкласса?", "Class_0_incorrectly_implements_interface_1_2420": "Класс \"{0}\" неправильно реализует интерфейс \"{1}\".", "Class_0_used_before_its_declaration_2449": "Класс \"{0}\" использован прежде, чем объявлен.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "В объявлении класса не может использоваться более одного тега \"@augments\" или \"@extends\".", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Содержащий файл не указан, корневой каталог невозможно определить. Выполняется пропуск поиска в папке node_modules.", "Convert_function_0_to_class_95002": "Преобразование функции \"{0}\" в класс", "Convert_function_to_an_ES2015_class_95001": "Преобразование функции в класс ES2015", + "Convert_to_ES6_module_95017": "Преобразовать в модуль ES6", "Convert_to_default_import_95013": "Преобразовать в импорт по умолчанию", "Corrupted_locale_file_0_6051": "Поврежденный файл языкового стандарта \"{0}\".", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "Не удалось найти файл объявления модуля \"{0}\". \"{1}\" имеет неявный тип \"any\".", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Ожидалось объявление.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Имя объявления конфликтует со встроенным глобальным идентификатором \"{0}\".", "Declaration_or_statement_expected_1128": "Ожидалось объявление или оператор.", - "Declare_method_0_90023": "Объявите метод \"{0}\".", - "Declare_property_0_90016": "Объявите свойство \"{0}\".", - "Declare_static_method_0_90024": "Объявите статический метод \"{0}\".", - "Declare_static_property_0_90027": "Объявление статического свойства \"{0}\".", + "Declare_method_0_90023": "Объявите метод \"{0}\"", + "Declare_property_0_90016": "Объявите свойство \"{0}\"", + "Declare_static_method_0_90024": "Объявите статический метод \"{0}\"", + "Declare_static_property_0_90027": "Объявите статическое свойство \"{0}\"", "Decorators_are_not_valid_here_1206": "Декораторы здесь недопустимы.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Декораторы нельзя применять к множественным методам доступа get или set с совпадающим именем.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Экспорт модуля по умолчанию использует или имеет закрытое имя \"{0}\".", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Устарело.] Используйте --skipLibCheck. Пропуск проверки типов для файлов объявления библиотеки по умолчанию.", "Digit_expected_1124": "Ожидалась цифра.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "Каталога \"{0}\" не существует. Поиск в нем будет пропускаться.", - "Disable_checking_for_this_file_90018": "Отключить проверку для этого файла.", + "Disable_checking_for_this_file_90018": "Отключите проверку для этого файла", "Disable_size_limitations_on_JavaScript_projects_6162": "Отключение ограничений на размеры в проектах JavaScript.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "Отключить строгую проверку универсальных сигнатур в типах функций.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "Запретить ссылки с разным регистром, указывающие на один файл.", @@ -309,6 +319,7 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "Включение строгой проверки инициализации свойств в классах.", "Enable_strict_null_checks_6113": "Включить строгие проверки NULL.", "Enable_tracing_of_the_name_resolution_process_6085": "Включить трассировку процесса разрешения имен.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Позволяет обеспечивать взаимодействие между модулями CommonJS и ES посредством создания объектов пространства имен для всех импортов. Подразумевает \"allowSyntheticDefaultImports\".", "Enables_experimental_support_for_ES7_async_functions_6068": "Включает экспериментальную поддержку для асинхронных функций ES7.", "Enables_experimental_support_for_ES7_decorators_6065": "Включает экспериментальную поддержку для декораторов ES7.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Включает экспериментальную поддержку для создания метаданных типа для декораторов.", @@ -325,7 +336,7 @@ "Expected_0_arguments_but_got_1_or_more_2556": "Ожидалось аргументов: {0}, получено: {1} или больше.", "Expected_0_type_arguments_but_got_1_2558": "Ожидались аргументы типа {0}, получены: {1}.", "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "Ожидается аргументов типа: {0}. Укажите их с тегом \"@extends\".", - "Expected_at_least_0_arguments_but_got_1_2555": "Ожидалось аргументов не менее: {0}, получено: {1}.", + "Expected_at_least_0_arguments_but_got_1_2555": "Ожидалось аргументов не меньше: {0}, получено: {1}.", "Expected_at_least_0_arguments_but_got_1_or_more_2557": "Ожидалось аргументов не меньше: {0}, получено: {1} или больше.", "Expected_corresponding_JSX_closing_tag_for_0_17002": "Ожидался соответствующий закрывающий тег JSX для \"{0}\".", "Expected_corresponding_closing_tag_for_JSX_fragment_17015": "Ожидался соответствующий закрывающий тег фрагмента JSX.", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "Разрешение выражения дает объявление переменной \"_this\", которое используется компилятором для получения ссылки this.", "Extract_constant_95006": "Извлечь константу", "Extract_function_95005": "Извлечь функцию", - "Extract_symbol_95003": "Извлечь символ", "Extract_to_0_in_1_95004": "Извлечь в {0} в {1}", "Extract_to_0_in_1_scope_95008": "Извлечь в {0} в области {1}", "Extract_to_0_in_enclosing_scope_95007": "Извлечь в {0} во включающей области", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "Файл с именем \"{0}\" отличается от уже включенного файла с именем \"{1}\" только регистром.", "File_name_0_has_a_1_extension_stripping_it_6132": "У имени файла \"{0}\" есть расширение \"{1}\"; расширение удаляется.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "Спецификация файла не может содержать родительский каталог (\"..\"), который указывается после рекурсивного подстановочного знака каталога (\"**\"): \"{0}\".", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "Спецификация файла не может содержать несколько рекурсивных подстановочных знаков каталога (\"**\"): \"{0}\".", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "Спецификация файла не может заканчиваться рекурсивным подстановочным знаком каталога (\"**\"): \"{0}\".", "Found_package_json_at_0_6099": "Обнаружен package.json в \"{0}\".", + "Found_package_json_at_0_Package_ID_is_1_6190": "Найден \"package.json\" в \"{0}\". Идентификатор пакета: \"{1}\".", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Объявления функций не разрешены в блоках в строгом режиме при нацеливании ES3 или ES5.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Объявления функций не разрешены в блоках в строгом режиме при нацеливании ES3 или ES5. Определения класса автоматически появляются в строгом режиме.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Объявления функций не разрешены в блоках в строгом режиме при нацеливании ES3 или ES5. Модули автоматически появляются в строгом режиме.", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "Ожидался идентификатор. \"{0}\" является зарезервированным словом в строгом режиме. Модули автоматически находятся в строгом режиме.", "Identifier_expected_1003": "Ожидался идентификатор.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Ожидался идентификатор. Значение \"__esModule\" зарезервировано как экспортируемый маркер при преобразовании модулей ECMAScript.", - "Ignore_this_error_message_90019": "Пропустить это сообщение об ошибке.", - "Implement_inherited_abstract_class_90007": "Реализуйте унаследованный абстрактный класс.", - "Implement_interface_0_90006": "Реализуйте интерфейс \"{0}\".", + "Ignore_this_error_message_90019": "Пропустите это сообщение об ошибке", + "Implement_inherited_abstract_class_90007": "Реализуйте наследуемый абстрактный класс", + "Implement_interface_0_90006": "Реализуйте интерфейс \"{0}\"", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "Предложение Implements экспортированного класса \"{0}\" имеет или использует закрытое имя \"{1}\".", - "Import_0_from_module_1_90013": "Импорт \"{0}\" из модуля \"{1}\".", + "Import_0_from_module_1_90013": "Импортируйте \"{0}\" из модуля \"{1}\"", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "Назначение импорта невозможно использовать при разработке для модулей ECMAScript. Попробуйте использовать \"import * as ns from \"mod\", \"import {a} from \"mod\", \"import d from \"mod\" или другой формат модуля.", "Import_declaration_0_is_using_private_name_1_4000": "Объявление импорта \"{0}\" использует закрытое имя \"{1}\".", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "Объявление импорта конфликтует с локальным объявлением \"{0}\".", @@ -424,10 +434,10 @@ "Index_signature_is_missing_in_type_0_2329": "В типе \"{0}\" отсутствует сигнатура индекса.", "Index_signatures_are_incompatible_2330": "Сигнатуры индекса несовместимы.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "Все отдельные объявления в объединенном объявлении \"{0}\" должны быть экспортированными или локальными.", - "Infer_parameter_types_from_usage_95012": "Вывод типов параметров на основе использования.", - "Infer_type_of_0_from_usage_95011": "Вывод типа \"{0}\" на основе использования.", - "Initialize_property_0_in_the_constructor_90020": "Инициализировать свойство \"{0}\" в конструкторе.", - "Initialize_static_property_0_90021": "Инициализировать статическое свойство \"{0}\".", + "Infer_parameter_types_from_usage_95012": "Выведите типы параметров на основании их использования", + "Infer_type_of_0_from_usage_95011": "Выведите тип \"{0}\" на основании его использования", + "Initialize_property_0_in_the_constructor_90020": "Инициализируйте свойство \"{0}\" в конструкторе", + "Initialize_static_property_0_90021": "Инициализируйте статическое свойство \"{0}\"", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "Инициализатор переменной-элемента экземпляра \"{0}\" не может ссылаться на идентификатор \"{1}\", объявленный в конструкторе.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "Инициализатор параметра \"{0}\" не может ссылаться на идентификатор \"{1}\", объявленный после него.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "Инициализатор не предоставляет значения для элемента привязки, который не имеет значения по умолчанию.", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "Языковой стандарт должен иметь форму <язык> или <язык>–<территория>. Например, \"{0}\" или \"{1}\".", "Longest_matching_prefix_for_0_is_1_6108": "Самый длинный соответствующий префикс для \"{0}\": \"{1}\".", "Looking_up_in_node_modules_folder_initial_location_0_6125": "Поиск в папке node_modules; первоначальное расположение: \"{0}\".", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Сделайте вызов \"super()\" первой инструкцией в конструкторе.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "Сделайте вызов \"super()\" первой инструкцией в конструкторе", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "Сопоставленный объект неявно имеет тип шаблона \"любой\".", "Member_0_implicitly_has_an_1_type_7008": "Элемент \"{0}\" неявно имеет тип \"{1}\".", "Merge_conflict_marker_encountered_1185": "Встретилась отметка о конфликте слияния.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "Объединенное объявление \"{0}\" не может включать объявление экспорта по умолчанию. Рекомендуется добавить вместо него отдельное объявление \"export default {0}\".", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== Имя модуля \"{0}\" было успешно разрешено в \"{1}\". ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Тип разрешения модуля не указан, используется \"{0}\".", "Module_resolution_using_rootDirs_has_failed_6111": "Произошел сбой при разрешении модуля с помощью \"rootDirs\".", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Использовать несколько последовательных числовых разделителей запрещено.", "Multiple_constructor_implementations_are_not_allowed_2392": "Не разрешается использование нескольких реализаций конструкторов.", "NEWLINE_6061": "НОВАЯ СТРОКА", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "Именованное свойство \"{0}\" содержит типы \"{1}\" и \"{2}\", которые не являются идентичными.", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Выражение неабстрактного класса не реализует унаследованный абстрактный элемент \"{0}\" класса \"{1}\".", "Not_all_code_paths_return_a_value_7030": "Не все пути кода возвращают значение.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "Тип числового индекса \"{0}\" нельзя назначить типу строкового индекса \"{1}\".", + "Numeric_separators_are_not_allowed_here_6188": "Числовые разделители здесь запрещены.", "Object_is_possibly_null_2531": "Возможно, объект равен null.", "Object_is_possibly_null_or_undefined_2533": "Возможно, объект равен null или undefined.", "Object_is_possibly_undefined_2532": "Возможно, объект равен undefined.", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "С помощью ключевого слова new можно вызвать только функцию void.", "Only_ambient_modules_can_use_quoted_names_1035": "Имена в кавычках могут использоваться только во внешних модулях.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "Только модули amd и system поддерживаются вместе с --{0}.", + "Only_emit_d_ts_declaration_files_6014": "Порождаются только файлы объявлений \".d.ts\".", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "В предложениях extends класса сейчас поддерживаются только идентификаторы или полные имена с необязательными аргументами типа.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "Через ключевое слово super доступны только общие и защищенные методы базового класса.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "Оператор \"{0}\" невозможно применить к типам \"{1}\" и \"{2}\".", @@ -584,7 +598,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Тип параметра открытого статического метода задания \"{0}\" из экспортированного класса имеет или использует закрытое имя \"{1}\".", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Анализ в строгом режиме и создание директивы \"use strict\" для каждого исходного файла.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "Шаблон \"{0}\" может содержать не больше одного символа \"*\".", - "Prefix_0_with_an_underscore_90025": "Добавьте к \"{0}\" префикс — символ подчеркивания.", + "Prefix_0_with_an_underscore_90025": "Добавьте к \"{0}\" префикс — символ подчеркивания", "Print_names_of_files_part_of_the_compilation_6155": "Печатать имена файлов, входящих в компиляцию.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Печатать имена создаваемых файлов, входящих в компиляцию.", "Print_the_compiler_s_version_6019": "Печать версии компилятора.", @@ -596,6 +610,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "Свойство \"{0}\" не имеет инициализатора, и ему не гарантировано присваивание в конструкторе.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "Свойство \"{0}\" неявно имеет тип \"все\", так как для его метода доступа get не задана заметка с типом возвращаемого значения.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "Свойство \"{0}\" неявно имеет тип \"все\", так как для его метода доступа set не задана заметка с типом параметра.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "Свойство \"{0}\" в типе \"{1}\" невозможно присвоить тому же свойству в базовом типе \"{2}\".", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "Свойство \"{0}\" в типе \"{1}\" не может быть присвоено типу \"{2}\".", "Property_0_is_declared_but_its_value_is_never_read_6138": "Свойство \"{0}\" объявлено, но его значение не было прочитано.", "Property_0_is_incompatible_with_index_signature_2530": "Свойство \"{0}\" несовместимо с сигнатурой индекса.", @@ -634,7 +649,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Вызывать ошибку в выражениях и объявлениях с подразумеваемым типом any.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Вызвать ошибку в выражениях this с неявным типом any.", "Redirect_output_structure_to_the_directory_6006": "Перенаправить структуру вывода в каталог.", - "Remove_declaration_for_Colon_0_90004": "Удалите объявление: \"{0}\".", + "Remove_declaration_for_Colon_0_90004": "Удалите объявление: \"{0}\"", + "Replace_import_with_0_95015": "Замена импорта на \"{0}\".", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "Сообщать об ошибке, если не все пути кода в функции возвращают значение.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "Сообщать об ошибках для случаев передачи управления в операторе switch.", "Report_errors_in_js_files_8019": "Сообщать об ошибках в JS-файлах.", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "Тип возвращаемого значения общего статического метода из экспортированного класса имеет или использует закрытое имя \"{0}\".", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Повторно используются разрешения модулей, унаследованные из \"{0}\", так как они не изменились со старой программы.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Повторно используется разрешение модуля \"{0}\" в файле \"{1}\" из старой программы.", - "Rewrite_as_the_indexed_access_type_0_90026": "Необходима перезапись с типом индексного доступа {0}.", + "Rewrite_as_the_indexed_access_type_0_90026": "Перезапишите как тип с индексным доступом \"{0}\"", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Корневой каталог невозможно определить, идет пропуск первичных путей поиска.", "STRATEGY_6039": "СТРАТЕГИЯ", "Scoped_package_detected_looking_in_0_6182": "Обнаружен пакет, относящийся к области; поиск в \"{0}\"", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "Параметры сопоставления источников", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Специализированная сигнатура перегрузки не поддерживает назначение неспециализированной сигнатуре.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Описатель динамического импорта не может быть элементом расширения.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "Укажите целевую версию ECMAScript: \"ES3\" (по умолчанию), \"ES5\", \"ES2015\", \"ES2016\", \"ES2017\" или \"ESNEXT\".", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "Укажите целевую версию ECMAScript: \"ES3\" (по умолчанию), \"ES5\", \"ES2015\", \"ES2016\", \"ES2017\", \"ES2018\" или \"ESNEXT\".", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "Укажите вариант создания кода JSX: \"preserve\", \"react-native\" или \"react\".", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Укажите файлы библиотеки для включения в компиляцию: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Укажите файлы библиотек для включения в компиляцию.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Укажите вариант создания кода модуля: \"none\", \"commonjs\", \"amd\", \"system\", \"umd\", \"es2015\", или \"ESNext\".", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Укажите стратегию разрешения модуля: node (Node.js) или classic (TypeScript pre-1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "Укажите функцию фабрики JSX, используемую при нацеливании на вывод JSX \"react\", например \"React.createElement\" или \"h\".", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Укажите корневой каталог входных файлов. Используйте его для управления структурой выходных каталогов с --outDir.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "Оператор расширения в выражениях new доступен только при разработке для ECMAScript 5 и более поздних версий.", "Spread_types_may_only_be_created_from_object_types_2698": "Типы расширения можно создавать только из типов объектов.", + "Starting_compilation_in_watch_mode_6031": "Запуск компиляции в режиме наблюдения...", "Statement_expected_1129": "Ожидался оператор.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Операторы не разрешены в окружающих контекстах.", "Static_members_cannot_reference_class_type_parameters_2302": "Статические элементы не могут ссылаться на параметры типов класса.", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "Ожидался строковый литерал.", "String_literal_with_double_quotes_expected_1327": "Ожидается строковый литерал с двойными кавычками.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Стилизовать ошибки и сообщения с помощью цвета и контекста (экспериментальная функция).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Последовательные объявления свойств должны иметь один и тот же тип. Свойство \"{0}\" должно иметь тип \"{1}\", но имеет здесь тип \"{2}\".", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Последующие объявления переменных должны иметь тот же тип. Переменная \"{0}\" должна иметь тип \"{1}\", однако имеет тип \"{2}\".", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "Подстановка \"{0}\" для шаблона \"{1}\" содержит неправильный тип, ожидается string, получен \"{2}\".", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "Подстановка \"{0}\" в шаблоне \"{1}\" может содержать не больше одного символа \"*\".", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "{0} не является типом массива или строки или в нем нет метода [Symbol.iterator](), который возвращает итератор.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "{0} не является типом массива или в нем нет метода [Symbol.iterator](), который возвращает итератор.", "Type_0_is_not_assignable_to_type_1_2322": "Тип \"{0}\" не может быть назначен для типа \"{1}\".", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "Тип \"{0}\" невозможно присвоить типу \"{1}\". Существует два разных типа с таким именем, но они не связаны.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "Тип \"{0}\" невозможно присвоить типу \"{1}\". Существует два разных типа с таким именем, но они не связаны.", "Type_0_is_not_comparable_to_type_1_2678": "Тип \"{0}\" невозможно сравнить с типом \"{1}\".", "Type_0_is_not_generic_2315": "Тип \"{0}\" не является универсальным.", "Type_0_provides_no_match_for_the_signature_1_2658": "Тип \"{0}\" не предоставляет соответствия для сигнатуры \"{1}\".", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "Незавершенный литерал шаблона.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Вызовы функций без типов не могут принимать аргументы типов.", "Unused_label_7028": "Неиспользуемая метка.", + "Use_synthetic_default_member_95016": "Используйте искусственный элемент \"default\".", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "Использование строки для оператора for...of поддерживается только в ECMAScript 5 и более поздних версиях.", "VERSION_6036": "ВЕРСИЯ", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "Значение типа \"{0}\" не имеет общих свойств со значением типа \"{1}\". Вы хотели вызвать его?", @@ -913,9 +931,9 @@ "const_declarations_must_be_initialized_1155": "Объявления \"const\" должны быть инициализированы.", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "Инициализатор элементов перечисления const был вычислен в неконечное значение.", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "Инициализатор элементов перечисления const был вычислен в запрещенное значение NaN.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Перечисления const можно использовать только в выражениях доступа к свойствам или по индексу, а также в правой части объявления присваивания импорта или экспорта.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "Перечисления const можно использовать только в выражениях доступа к свойству или индексу, а также в правой части объявления импорта, присваивания экспорта или запроса типа.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "Невозможно вызвать оператор delete с идентификатором в строгом режиме.", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Объявления перечислений могут использоваться только в TS-файле.", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "Объявления перечислений можно использовать только в TS-файле.", "export_can_only_be_used_in_a_ts_file_8003": "Элемент \"export=\" может использоваться только в TS-файле.", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "Модификатор export невозможно применить к неоднозначным модулям и улучшениям модулей, так как они всегда видимые.", "extends_clause_already_seen_1172": "Предложение extends уже существует.", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "Предложение implements уже существует.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "Предложения implements могут использоваться только в TS-файле.", "import_can_only_be_used_in_a_ts_file_8002": "Элемент \"import ... =\" может использоваться только в TS-файле.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Объявления \"infer\" допустимы только в предложении \"extends\" условного типа.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "Объявления интерфейсов могут использоваться только в TS-файле.", "let_declarations_can_only_be_declared_inside_a_block_1157": "Объявления let можно задать только в блоке.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "Не допускается использование let в качестве имени в объявлениях let или const.", @@ -963,9 +982,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "Выражения утверждения типа могут использоваться только в TS-файле.", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "Объявления параметров типа могут использоваться только в TS-файле.", "types_can_only_be_used_in_a_ts_file_8010": "Типы могут использоваться только в TS-файле.", - "unique_symbol_types_are_not_allowed_here_1335": "Типы \"уникальный символ\" здесь запрещены.", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Типы \"уникальный символ\" разрешены только в переменных в операторе с переменной.", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Типы \"уникальный символ\" невозможно использовать в объявлении переменной с именем привязки.", + "unique_symbol_types_are_not_allowed_here_1335": "Типы \"unique symbol\" здесь запрещены.", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "Типы \"unique symbol\" разрешены только у переменных в операторах с переменными.", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "Типы \"unique symbol\" невозможно использовать в объявлении переменной с именем привязки.", "with_statements_are_not_allowed_in_an_async_function_block_1300": "Операторы with не разрешено использовать в блоке асинхронной функции.", "with_statements_are_not_allowed_in_strict_mode_1101": "Операторы with не разрешено использовать в строгом режиме.", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "Выражения yield не могут быть использованы в инициализаторе параметра." diff --git a/lib/tr/diagnosticMessages.generated.json b/lib/tr/diagnosticMessages.generated.json index 73cae040499..cc088011fa5 100644 --- a/lib/tr/diagnosticMessages.generated.json +++ b/lib/tr/diagnosticMessages.generated.json @@ -42,12 +42,13 @@ "A_generator_cannot_have_a_void_type_annotation_2505": "Bir oluşturucu 'void' türündeki bir ek açıklamaya sahip olamaz.", "A_get_accessor_cannot_have_parameters_1054": "Bir 'get' erişimcisi parametrelere sahip olamaz.", "A_get_accessor_must_return_a_value_2378": "'get' erişimcisinin bir değer döndürmesi gerekir.", - "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "Numaralandırma bildirimdeki bir üye başlatıcısı, diğer numaralandırmalarda tanımlanan üyeler dahil olmak üzere kendinden sonra bildirilen üyelere başvuramaz.", + "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651": "Sabit listesi bildirimindeki bir üye başlatıcısı, diğer sabit listelerinde tanımlanan üyeler dahil olmak üzere kendinden sonra bildirilen üyelere başvuramaz.", "A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any_2545": "Mixin sınıfının 'any[]' türünde tek bir rest parametresi içeren bir oluşturucusu olmalıdır.", "A_module_cannot_have_multiple_default_exports_2528": "Modül, birden fazla varsayılan dışarı aktarmaya sahip olamaz.", "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Bir ad alanı bildirimi, birleştirildiği sınıf veya işlevden farklı bir dosyada olamaz.", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Bir ad alanı bildirimi, birleştirildiği sınıf veya işlevden önce gelemez.", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "Ad alanı bildirimine yalnızca bir ad alanında veya modülde izin verilir.", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "Bir ad alanı stili içeri aktarma işlemi çağrılamadığından veya oluşturulamadığından çalışma zamanında hataya yol açacak.", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "Parametre başlatıcısına yalnızca bir işlevde veya oluşturucu uygulamasında izin verilir.", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "Parametre özelliği, rest parametresi kullanılarak bildirilemez.", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "Parametre özelliğine yalnızca bir oluşturucu uygulamasında izin verilir.", @@ -58,6 +59,7 @@ "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "Bir 'unique symbol' türündeki arabirimin veya tür sabit değerinin özelliği 'readonly' olmalıdır.", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "Gerekli parametre, isteğe bağlı parametreden sonra gelemez.", "A_rest_element_cannot_contain_a_binding_pattern_2501": "rest öğesi bir bağlama deseni içeremez.", + "A_rest_element_cannot_have_a_property_name_2566": "Rest öğesinin özellik adı olamaz.", "A_rest_element_cannot_have_an_initializer_1186": "rest öğesi bir başlatıcıya sahip olamaz.", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Rest öğesi, yok etme desenindeki son öğe olmalıdır.", "A_rest_parameter_cannot_be_optional_1047": "rest parametresi isteğe bağlı olamaz.", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "Erişilebilirlik değiştiricisi zaten görüldü.", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "Erişimciler yalnızca ECMAScript 5 ve üzeri hedeflenirken kullanılabilir.", "Accessors_must_both_be_abstract_or_non_abstract_2676": "İki erişimci de soyut veya soyut olmayan olmalıdır.", - "Add_0_to_existing_import_declaration_from_1_90015": "'{0}' öğesini \"{1}\" konumundaki mevcut içeri aktarma bildirimine ekleyin.", - "Add_index_signature_for_property_0_90017": "'{0}' özelliği için dizin imzası ekleyin.", - "Add_missing_super_call_90001": "Eksik 'super()' çağrısını ekleyin.", - "Add_this_to_unresolved_variable_90008": "Çözümlenmemiş değişkene 'this.' ekleyin.", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "Bir tsconfig.json dosyası eklemek, hem TypeScript hem de JavaScript dosyaları içeren projeleri düzenlemenize yardımcı olur. Daha fazla bilgi edinmek için bkz. https://aka.ms/tsconfig.", + "Add_0_to_existing_import_declaration_from_1_90015": "'{0}' öğesini \"{1}\" konumundaki mevcut içeri aktarma bildirimine ekle", + "Add_async_modifier_to_containing_function_90029": "İçeren işleve zaman uyumsuz değiştirici ekle", + "Add_index_signature_for_property_0_90017": "'{0}' özelliği için dizin imzası ekle", + "Add_missing_super_call_90001": "Eksik 'super()' çağrısını ekle", + "Add_this_to_unresolved_variable_90008": "Çözümlenmemiş değişkene 'this.' ekle", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "Bir tsconfig.json dosyası eklemek, hem TypeScript hem de JavaScript dosyaları içeren projeleri düzenlemenize yardımcı olur. Daha fazla bilgi edinmek için bkz. https://aka.ms/tsconfig.", "Additional_Checks_6176": "Ek Denetimler", "Advanced_Options_6178": "Gelişmiş Seçenekler", "All_declarations_of_0_must_have_identical_modifiers_2687": "Tüm '{0}' bildirimleri aynı değiştiricilere sahip olmalıdır.", @@ -103,7 +106,7 @@ "All_declarations_of_an_abstract_method_must_be_consecutive_2516": "Soyut metoda ait tüm bildirimler ardışık olmalıdır.", "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011": "Varsayılan dışarı aktarmaya sahip olmayan modüllerde varsayılan içeri aktarmalara izin verin. Bu işlem kod üretimini etkilemez, yalnızca tür denetimini etkiler.", "Allow_javascript_files_to_be_compiled_6102": "Javascript dosyalarının derlenmesine izin ver.", - "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "'--isolatedModules' bayrağı sağlandığında çevresel const numaralandırma değerlerine izin verilmez.", + "Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided_1209": "'--isolatedModules' bayrağı sağlandığında çevresel const sabit listesi değerlerine izin verilmez.", "Ambient_module_declaration_cannot_specify_relative_module_name_2436": "Çevresel modül bildirimi göreli modül adını belirtemez.", "Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces_2435": "Çevresel modüller, diğer modüllerde veya ad alanlarında iç içe bulunamaz.", "An_AMD_module_cannot_have_multiple_name_assignments_2458": "AMD modülü birden fazla ad atamasında sahip olamaz.", @@ -111,12 +114,12 @@ "An_accessor_cannot_be_declared_in_an_ambient_context_1086": "Erişimci, çevresel bağlamda bildirilemez.", "An_accessor_cannot_have_type_parameters_1094": "Erişimci, tür parametrelerine sahip olamaz.", "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234": "Çevresel modül bildirimine yalnızca bir dosyadaki en üst düzeyde izin verilir.", - "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Aritmetik işlenen, 'any', 'number' veya numaralandırma türünde olmalıdır.", + "An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type_2356": "Aritmetik işlenen, 'any', 'number' veya sabit listesi türünde olmalıdır.", "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705": "ES5/ES3 içindeki zaman uyumsuz bir fonksiyon veya metot, 'Promise' oluşturucusu gerektiriyor. 'Promise' oluşturucusu için bir bildiriminizin olduğundan veya `--lib` seçeneğinize 'ES2015' eklediğinizden emin olun.", "An_async_function_or_method_must_have_a_valid_awaitable_return_type_1057": "Zaman uyumsuz bir işlev veya metot, geçerli bir beklenebilir dönüş türüne sahip olmalıdır.", "An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_in_2697": "Zaman uyumsuz bir işlevin veya metodun 'Promise' döndürmesi gerekir. Bir 'Promise' bildiriminiz olduğundan emin olun veya `--lib` seçeneğinize 'ES2015' ifadesini ekleyin.", "An_async_iterator_must_have_a_next_method_2519": "Zaman uyumsuz yineleyicinin bir 'next()' metodu olmalıdır.", - "An_enum_member_cannot_have_a_numeric_name_2452": "Numaralandırma üyesi, sayısal bir ada sahip olamaz.", + "An_enum_member_cannot_have_a_numeric_name_2452": "Sabit listesi üyesi, sayısal bir ada sahip olamaz.", "An_export_assignment_can_only_be_used_in_a_module_1231": "Dışarı aktarma ataması yalnızca bir modülde kullanılabilir.", "An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements_2309": "Dışarı aktarma ataması, dışarı aktarılmış diğer öğelere sahip bir modülde kullanılamaz.", "An_export_assignment_cannot_be_used_in_a_namespace_1063": "Ad alanında dışarı aktarma ataması kullanılamaz.", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "Dizin imzası parametresi, bir erişilebilirlik değiştiricisine sahip olamaz.", "An_index_signature_parameter_cannot_have_an_initializer_1020": "Dizin imzası parametresi, bir başlatıcıya sahip olamaz.", "An_index_signature_parameter_must_have_a_type_annotation_1022": "Dizin imzası parametresi, bir tür ek açıklamasına sahip olmalıdır.", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "Dizin imzası parametre türü bir tür diğer adı olamaz. Bunun yerine '[{0}: {1}]: {2}' yazabilirsiniz.", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "Dizin imzası parametre türü bir birleşim türü olamaz. Bunun yerine eşlenen nesne türü kullanabilirsiniz.", "An_index_signature_parameter_type_must_be_string_or_number_1023": "Dizin imzası parametresi, 'string' veya 'number' türünde olmalıdır.", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "Bir arabirim, isteğe bağlı tür bağımsız değişkenleri ile yalnızca bir tanımlayıcıyı/tam adı genişletebilir.", "An_interface_may_only_extend_a_class_or_another_interface_2312": "Arabirim, yalnızca bir sınıfı veya başka bir arabirimi genişletebilir.", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "İkili sayı bekleniyor.", "Binding_element_0_implicitly_has_an_1_type_7031": "'{0}' bağlama öğesi, örtük olarak '{1}' türü içeriyor.", "Block_scoped_variable_0_used_before_its_declaration_2448": "Blok kapsamlı değişken '{0}', bildirilmeden önce kullanıldı.", - "Call_decorator_expression_90028": "Dekoratör ifadesini çağırın.", + "Call_decorator_expression_90028": "Dekoratör ifadesini çağır", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "Dönüş türü ek açıklaması bulunmayan çağrı imzası, örtük olarak 'any' dönüş türüne sahip.", "Call_target_does_not_contain_any_signatures_2346": "Çağrı hedefi imza içermiyor.", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "'{0}' bir ad alanı değil tür olduğundan '{0}.{1}' erişimi sağlanamıyor. '{0}[\"{1}\"]' değerini belirterek '{0}' içindeki '{1}' özelliğinin türünü almak mı istediniz?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "Tür bildirim dosyaları içeri aktarılamıyor. '{1}' yerine '{0}' dosyasını içeri aktarmanız önerilir.", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "Dış kapsamdaki '{0}' değişkeni, blok kapsamındaki '{1}' bildirimiyle aynı kapsamda başlatılamaz.", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "Türü bir çağrı imzasına sahip olmayan bir ifade çağrılamaz. '{0}' türünün uyumlu çağrı imzası yok.", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "Muhtemelen 'null' olan bir nesne çağrılamıyor.", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "Muhtemelen 'null' veya 'undefined' olan bir nesne çağrılamıyor.", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "Muhtemelen 'undefined' olan bir nesne çağrılamıyor.", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "'--isolatedModules' bayrağı sağlandığında bir tür yeniden dışarı aktarılamaz.", "Cannot_read_file_0_Colon_1_5012": "'{0}' dosyası okunamıyor: {1}.", "Cannot_redeclare_block_scoped_variable_0_2451": "Blok kapsamlı değişken '{0}', yeniden bildirilemiyor.", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "Giriş dosyasının üzerine yazacağı için '{0}' dosyası yazılamıyor.", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Catch yan tümcesi değişkeni bir tür ek açıklamasına sahip olamaz.", "Catch_clause_variable_cannot_have_an_initializer_1197": "Catch yan tümcesi değişkeni bir başlatıcıya sahip olamaz.", - "Change_0_to_1_90014": "'{0}' değerini '{1}' olarak değiştirin.", - "Change_extends_to_implements_90003": "'extends' ifadesini 'implements' olarak değiştirin.", - "Change_spelling_to_0_90022": "Yazımı '{0}' olarak değiştirin.", + "Change_0_to_1_90014": "'{0}' değerini '{1}' olarak değiştir", + "Change_extends_to_implements_90003": "'extends' ifadesini 'implements' olarak değiştirin", + "Change_spelling_to_0_90022": "Yazımı '{0}' olarak değiştir", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "'{0}' ön ekinin '{1}' - '{2}' için eşleşen en uzun ön ek olup olmadığı denetleniyor.", "Circular_definition_of_import_alias_0_2303": "'{0}' içeri aktarma diğer adının döngüsel tanımı.", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "Yapılandırma çözümlenirken döngüsellik algılandı: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "'{0}' sınıfı, '{1}' örnek üyesi işlevini tanımlar; ancak genişletilmiş '{2}' sınıfı, bunu bir örnek üyesi özelliği olarak tanımlar.", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "'{0}' sınıfı, '{1}' örnek üyesi özelliğini tanımlar; ancak genişletilmiş '{2}' sınıfı, bunu bir örnek üyesi işlevi olarak tanımlar.", "Class_0_incorrectly_extends_base_class_1_2415": "'{0}' sınıfı, '{1}' temel sınıfını yanlış genişletiyor.", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "'{0}' sınıfı hatalı olarak '{1}' sınıfını uyguluyor. '{1}' sınıfını genişletip üyelerini bir alt sınıf olarak devralmak mı istiyordunuz?", "Class_0_incorrectly_implements_interface_1_2420": "'{0}' sınıfı, '{1}' arabirimini yanlış uyguluyor.", "Class_0_used_before_its_declaration_2449": "'{0}' sınıfı, bildiriminden önce kullanıldı.", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "Sınıf bildirimlerinde birden fazla `@augments` veya `@extends` etiketi olamaz.", @@ -233,7 +242,7 @@ "Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json_6020": "Yapılandırma dosyasının yolu veya 'tsconfig.json' dosyasını içeren klasörün yolu belirtilen projeyi derleyin.", "Compiler_option_0_expects_an_argument_6044": "'{0}' derleyici seçeneği, bağımsız değişken bekliyor.", "Compiler_option_0_requires_a_value_of_type_1_5024": "'{0}' derleyici seçeneği, {1} türünde bir değer gerektiriyor.", - "Computed_property_names_are_not_allowed_in_enums_1164": "Numaralandırmalarda hesaplanan özellik adına izin verilmiyor.", + "Computed_property_names_are_not_allowed_in_enums_1164": "Sabit listelerinde hesaplanan özellik adına izin verilmiyor.", "Computed_values_are_not_permitted_in_an_enum_with_string_valued_members_2553": "Dize değeri içeren üyelerin bulunduğu bir sabit listesinde hesaplanan değerlere izin verilmez.", "Concatenate_and_emit_output_to_single_file_6001": "Çıktıyı tek dosyaya birleştirin ve yayın.", "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090": "'{1}' ve '{2}' içinde '{0}' için çakışan tanımlar bulundu. Çakışmayı çözmek için bu kitaplığın belirli bir versiyonunu yüklemeniz önerilir.", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "Kapsayıcı dosya belirtilmedi ve kök dizini belirlenemiyor; 'node_modules' klasöründe arama atlanıyor.", "Convert_function_0_to_class_95002": "'{0}' işlevini sınıfa dönüştür", "Convert_function_to_an_ES2015_class_95001": "İşlevi bir ES2015 sınıfına dönüştür", + "Convert_to_ES6_module_95017": "ES6 modülüne dönüştür", "Convert_to_default_import_95013": "Varsayılan içeri aktarmaya dönüştür", "Corrupted_locale_file_0_6051": "{0} yerel ayar dosyası bozuk.", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "'{0}' modülü için bildirim dosyası bulunamadı. '{1}' örtülü olarak 'any' türüne sahip.", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "Bildirim bekleniyor.", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "Bildirim adı, yerleşik genel tanımlayıcı '{0}' ile çakışıyor.", "Declaration_or_statement_expected_1128": "Bildirim veya deyim bekleniyor.", - "Declare_method_0_90023": "'{0}' metodunu bildirin.", - "Declare_property_0_90016": "'{0}' özelliğini bildirin.", - "Declare_static_method_0_90024": "'{0}' statik metodunu bildirin.", - "Declare_static_property_0_90027": "'{0}' statik özelliğini bildirin.", + "Declare_method_0_90023": "'{0}' metodunu bildir", + "Declare_property_0_90016": "'{0}' özelliğini bildir", + "Declare_static_method_0_90024": "'{0}' statik metodunu bildir", + "Declare_static_property_0_90027": "'{0}' statik özelliğini bildir", "Decorators_are_not_valid_here_1206": "Buradaki dekoratörler geçerli değil.", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Dekoratörler aynı ada sahip birden fazla get/set erişimcisine uygulanamaz.", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "Modülün varsayılan dışarı aktarımı '{0}' özel adına sahip veya bu adı kullanıyor.", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[Kullanım Dışı] Bunun yerine '--skipLibCheck' kullanın. Varsayılan kitaplık bildirim dosyalarının tür denetimini atlayın.", "Digit_expected_1124": "Rakam bekleniyor.", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "'{0}' dizini yok, içindeki tüm aramalar atlanıyor.", - "Disable_checking_for_this_file_90018": "Bu dosya için denetimi devre dışı bırakın.", + "Disable_checking_for_this_file_90018": "Bu dosya için denetimi devre dışı bırak", "Disable_size_limitations_on_JavaScript_projects_6162": "JavaScript projelerinde boyut sınırlamalarını devre dışı bırakın.", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "İşlev türlerinde genel imzalar için katı denetimi devre dışı bırakın.", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "Aynı dosyaya yönelik tutarsız büyük/küçük harflere sahip başvurulara izin verme.", @@ -275,7 +285,7 @@ "Do_not_emit_outputs_6010": "Çıktıları gösterme.", "Do_not_emit_outputs_if_any_errors_were_reported_6008": "Herhangi bir hata bildirildiyse çıkışları gösterme.", "Do_not_emit_use_strict_directives_in_module_output_6112": "Modül çıkışında 'use strict' yönergeleri gösterme.", - "Do_not_erase_const_enum_declarations_in_generated_code_6007": "Oluşturulan kodda const numaralandırma bildirimlerini silme.", + "Do_not_erase_const_enum_declarations_in_generated_code_6007": "Oluşturulan kodda const sabit listesi bildirimlerini silme.", "Do_not_generate_custom_helper_functions_like_extends_in_compiled_output_6157": "Derlenen çıkışta '__extends' gibi özel yardımcı işlevler oluşturmayın.", "Do_not_include_the_default_library_file_lib_d_ts_6158": "Varsayılan kitaplık dosyasını (lib.d.ts) eklemeyin.", "Do_not_report_errors_on_unreachable_code_6077": "Erişilemeyen kod ile ilgili hataları bildirme.", @@ -309,22 +319,23 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "Sınıflarda sıkı özellik başlatma denetimini etkinleştirin.", "Enable_strict_null_checks_6113": "Katı null denetimlerini etkinleştir.", "Enable_tracing_of_the_name_resolution_process_6085": "Ad çözümleme işlemini izlemeyi etkinleştir.", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "Tüm içeri aktarma işlemleri için ad alanı nesnelerinin oluşturulması aracılığıyla CommonJS ile ES Modülleri arasında yayımlama birlikte çalışabilirliğine imkan tanır. Şu anlama gelir: 'allowSyntheticDefaultImports'.", "Enables_experimental_support_for_ES7_async_functions_6068": "Zaman uyumsuz ES7 işlevleri için deneysel desteği etkinleştirir.", "Enables_experimental_support_for_ES7_decorators_6065": "ES7 dekoratörleri için deneysel desteği etkinleştirir.", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "Dekoratörlere tür meta verisi gönderme için deneysel desteği etkinleştirir.", "Enum_0_used_before_its_declaration_2450": "'{0}' sabit listesi, bildiriminden önce kullanıldı.", - "Enum_declarations_must_all_be_const_or_non_const_2473": "Numaralandırma bildirimlerinin tümü const veya const olmayan değerler olmalıdır.", - "Enum_member_expected_1132": "Numaralandırma üyesi bekleniyor.", - "Enum_member_must_have_initializer_1061": "Numaralandırma üyesi bir başlatıcıya sahip olmalıdır.", + "Enum_declarations_must_all_be_const_or_non_const_2473": "Sabit listesi bildirimlerinin tümü const veya const olmayan değerler olmalıdır.", + "Enum_member_expected_1132": "Sabit listesi üyesi bekleniyor.", + "Enum_member_must_have_initializer_1061": "Sabit listesi üyesi bir başlatıcıya sahip olmalıdır.", "Enum_name_cannot_be_0_2431": "Sabit listesi adı '{0}' olamaz.", "Enum_type_0_has_members_with_initializers_that_are_not_literals_2535": "Sabit listesi türü '{0}', sabit değer olmayan başlatıcılara sahip üyeler içeriyor.", "Examples_Colon_0_6026": "Örnekler: {0}", "Excessive_stack_depth_comparing_types_0_and_1_2321": "Aşırı yığın derinliği, '{0}' ve '{1}' türlerini karşılaştırıyor.", - "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "{0}-{1} türünde bağımsız değişkenler bekleniyordu; bunları bir '@extends' etiketiyle sağlayın.", + "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027": "{0}-{1} tür bağımsız değişkeni bekleniyordu; bunları bir '@extends' etiketiyle sağlayın.", "Expected_0_arguments_but_got_1_2554": "{0} bağımsız değişken bekleniyordu ancak {1} alındı.", "Expected_0_arguments_but_got_1_or_more_2556": "{0} bağımsız değişken bekleniyordu ancak {1} veya daha fazla bağımsız değişken alındı.", - "Expected_0_type_arguments_but_got_1_2558": "{0} türünde bağımsız değişkenler bekleniyordu ancak {1} alındı.", - "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} türünde bağımsız değişkenler bekleniyordu; bunları bir '@extends' etiketiyle sağlayın.", + "Expected_0_type_arguments_but_got_1_2558": "{0} tür bağımsız değişkeni bekleniyordu ancak {1} alındı.", + "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026": "{0} tür bağımsız değişkeni bekleniyordu; bunları bir '@extends' etiketiyle sağlayın.", "Expected_at_least_0_arguments_but_got_1_2555": "En az {0} bağımsız değişken bekleniyordu ancak {1} alındı.", "Expected_at_least_0_arguments_but_got_1_or_more_2557": "En az {0} bağımsız değişken bekleniyordu ancak {1} veya daha fazla bağımsız değişken alındı.", "Expected_corresponding_JSX_closing_tag_for_0_17002": "'{0}' için ilgili JSX kapanış etiketi bekleniyor.", @@ -340,8 +351,8 @@ "Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_2656": "Dışarı aktarılan dış paket yazı dosyası '{0}', bir modül değil. Paket tanımını güncelleştirmek için lütfen paket yazarı ile iletişime geçin.", "Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_pack_2654": "Dışarı aktarılan dış paket yazıları, üç eğik çizgili başvurular içeremez. Paket tanımını güncelleştirmek için lütfen paket yazarı ile iletişime geçin.", "Exported_type_alias_0_has_or_is_using_private_name_1_4081": "Dışarı aktarılan '{0}' tür diğer adı, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023": "Dışarı aktarılan '{0}' değişkeni, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", - "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024": "Dışarı aktarılan '{0}' değişkeni, '{2}' özel modüldeki '{1}' özel adına sahip veya bu adı kullanıyor.", + "Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4023": "Dışarı aktarılan '{0}' değişkeni, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Exported_variable_0_has_or_is_using_name_1_from_private_module_2_4024": "Dışarı aktarılan '{0}' değişkeni, '{2}' özel modüldeki '{1}' adına sahip veya bu adı kullanıyor.", "Exported_variable_0_has_or_is_using_private_name_1_4025": "Dışarı aktarılan '{0}' değişkeni, '{1}' özel adına sahip veya bu adı kullanıyor.", "Exports_and_export_assignments_are_not_permitted_in_module_augmentations_2666": "Modül genişletmelerinde dışarı aktarmalara ve dışarı aktarma atamalarına izin verilmez.", "Expression_expected_1109": "İfade bekleniyor.", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "İfade, derleyicinin 'this' başvurusunu yakalamak için kullandığı '_this' değişken bildirimi olarak çözümleniyor.", "Extract_constant_95006": "Sabiti ayıkla", "Extract_function_95005": "İşlevi ayıkla", - "Extract_symbol_95003": "Sembolü ayıkla", "Extract_to_0_in_1_95004": "{1} içindeki {0} konumuna ayıkla", "Extract_to_0_in_1_scope_95008": "{1} kapsamındaki {0} konumuna ayıkla", "Extract_to_0_in_enclosing_scope_95007": "Çevreleyen kapsamdaki {0} konumuna ayıkla", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "'{0}' dosya adının, zaten eklenmiş olan '{1}' dosya adından tek farkı, büyük/küçük harf kullanımı.", "File_name_0_has_a_1_extension_stripping_it_6132": "'{0}' dosya adında '{1}' uzantısı var; uzantı ayrılıyor.", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "Dosya belirtimi, özyinelemeli dizin joker karakterinden ('**') sonra görünen bir üst dizin ('..') içeremez: '{0}'.", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "Dosya belirtimi, birden fazla özyinelemeli dizin joker karakter ('**') içeremez: '{0}'.", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "Dosya belirtimi, özyinelemeli dizin joker karakter ('**') ile bitemez: '{0}'.", "Found_package_json_at_0_6099": "'{0}' içinde 'package.json' bulundu.", + "Found_package_json_at_0_Package_ID_is_1_6190": "'{0}' konumunda 'package.json' bulundu. Paket kimliği '{1}'.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "Katı modda 'ES3' veya 'ES5' hedeflenirken blokların içinde işlev bildirimlerine izin verilmez.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "Katı modda 'ES3' veya 'ES5' hedeflenirken blokların içinde işlev bildirimlerine izin verilmez. Sınıf tanımları otomatik olarak katı moddadır.", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "Katı modda 'ES3' veya 'ES5' hedeflenirken blokların içinde işlev bildirimlerine izin verilmez. Modüller otomatik olarak katı moddadır.", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "Tanımlayıcı bekleniyor. '{0}', katı modda ayrılmış bir sözcüktür. Modüller otomatik olarak katı moddadır.", "Identifier_expected_1003": "Tanımlayıcı bekleniyor.", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "Tanımlayıcı bekleniyor. '__esModule', ECMAScript modülleri dönüştürülürken, dışarı aktarılan bir işaretçi olarak ayrılmış.", - "Ignore_this_error_message_90019": "Bu hata iletisini yoksayın.", - "Implement_inherited_abstract_class_90007": "Devralınmış soyut sınıfı uygulayın.", - "Implement_interface_0_90006": "'{0}' arabirimini uygulayın.", + "Ignore_this_error_message_90019": "Bu hata iletisini yoksay", + "Implement_inherited_abstract_class_90007": "Devralınan soyut sınıfı uygula", + "Implement_interface_0_90006": "'{0}' arabirimini uygula", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "'{1}' özel adına sahip veya bu adı kullanan '{0}' dışarı aktarılan sınıfının yan tümcesini uygular.", - "Import_0_from_module_1_90013": "\"{1}\" modülünden '{0}' öğesini içeri aktarın.", + "Import_0_from_module_1_90013": "\"{1}\" modülünden '{0}' öğesini içeri aktar", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "ECMAScript modülleri hedeflenirken içeri aktarma ataması kullanılamaz. Bunun yerine 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"' veya başka bir modül biçimi kullanmayı deneyin.", "Import_declaration_0_is_using_private_name_1_4000": "'{0}' içeri aktarma bildirimi, '{1}' özel adına sahip veya bu adı kullanıyor.", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "İçeri aktarma bildirimi, yerel '{0}' bildirimiyle çakışıyor.", @@ -417,17 +427,17 @@ "Import_name_cannot_be_0_2438": "İçeri aktarma adı '{0}' olamaz.", "Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relati_2439": "Çevresel modül bildirimindeki içeri veya dışarı aktarma bildirimi, göreli modül adı aracılığıyla modüle başvuramaz.", "Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_mod_2667": "Modül genişletmelerinde içeri aktarmalara izin verilmez. Bunları, kapsayan dış modüle taşımanız önerilir.", - "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Çevresel numaralandırma bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.", - "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Birden fazla bildirime sahip numaralandırmada yalnızca bir bildirim ilk numaralandırma öğesine ait başlatıcıyı atlayabilir.", - "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "'const' numaralandırma bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.", + "In_ambient_enum_declarations_member_initializer_must_be_constant_expression_1066": "Çevresel sabit listesi bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.", + "In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enu_2432": "Birden fazla bildirime sahip sabit listesinde yalnızca bir bildirim ilk sabit listesi öğesine ait başlatıcıyı atlayabilir.", + "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474": "'const' sabit listesi bildirimlerinde, üye başlatıcısı sabit ifade olmalıdır.", "Index_signature_in_type_0_only_permits_reading_2542": "'{0}' türündeki dizin imzası yalnızca okumaya izin veriyor.", "Index_signature_is_missing_in_type_0_2329": "'{0}' türündeki dizin imzası yok.", "Index_signatures_are_incompatible_2330": "Dizin imzaları uyumsuz.", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "'{0}' birleştirilmiş bildirimindeki bildirimlerin tümü dışarı aktarılmış veya yerel olmalıdır.", - "Infer_parameter_types_from_usage_95012": "Parametre türlerini kullanımdan çıkarsayın.", - "Infer_type_of_0_from_usage_95011": "'{0}' türünü kullanımdan çıkarsayın.", - "Initialize_property_0_in_the_constructor_90020": "Oluşturucu içinde '{0}' özelliğini başlatın.", - "Initialize_static_property_0_90021": "'{0}' statik özelliğini başlatın.", + "Infer_parameter_types_from_usage_95012": "Parametre türleri için kullanımdan çıkarım yap", + "Infer_type_of_0_from_usage_95011": "'{0}' türü için kullanımdan çıkarım yap", + "Initialize_property_0_in_the_constructor_90020": "Oluşturucu içinde '{0}' özelliğini başlat", + "Initialize_static_property_0_90021": "'{0}' statik özelliğini başlat", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "'{0}' örnek üyesi değişkeninin başlatıcısı, oluşturucuda bildirilen '{1}' tanımlayıcısına başvuramaz.", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "'{0}' parametresinin başlatıcısı, kendinden sonra bildirilen '{1}' tanımlayıcısına başvuramaz.", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "Başlatıcı bu bağlama öğesi için bir değer sağlamıyor ve bağlama öğesi varsayılan değere sahip değil.", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "Yerel ayar, veya - biçiminde olmalıdır. Örneğin, '{0}' veya '{1}'.", "Longest_matching_prefix_for_0_is_1_6108": "'{0}' için eşleşen en uzun ön ek: '{1}'.", "Looking_up_in_node_modules_folder_initial_location_0_6125": "'node_modules' klasöründe aranıyor; ilk konum: '{0}'.", - "Make_super_call_the_first_statement_in_the_constructor_90002": "Oluşturucudaki ilk deyime 'super()' tarafından çağrı yapılmasını sağla.", + "Make_super_call_the_first_statement_in_the_constructor_90002": "Oluşturucudaki ilk deyime 'super()' tarafından çağrı yapılmasını sağla", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "Eşleştirilmiş nesne türü örtük olarak 'any' şablon türüne sahip.", "Member_0_implicitly_has_an_1_type_7008": "'{0}' üyesi örtük olarak '{1}' türüne sahip.", "Merge_conflict_marker_encountered_1185": "Birleştirme çakışması işaretçisiyle karşılaşıldı.", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "'{0}' birleştirilen bildirimi, varsayılan bir dışarı aktarma bildirimini içeremez. Bunun yerine ayrı bir 'export default {0}' bildirimi eklemeyi göz önünde bulundurun.", @@ -502,12 +513,13 @@ "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145": "'{1}' dosyası değiştirilmediğinden '{0}' modülü, bu dosyada bildirilen çevresel modül olarak çözümlendi.", "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144": "'{0}' modülü, '{1}' dosyasında yerel olarak bildirilmiş çevresel modül olarak çözümlendi.", "Module_0_was_resolved_to_1_but_jsx_is_not_set_6142": "'{0}' modülü '{1}' olarak çözüldü ancak '--jsx' ayarlanmadı.", - "Module_Resolution_Options_6174": "Modül Çözünürlüğü Seçenekleri", + "Module_Resolution_Options_6174": "Modül Çözümleme Seçenekleri", "Module_name_0_matched_pattern_1_6092": "Modül adı: '{0}', eşleşen desen: '{1}'.", "Module_name_0_was_not_resolved_6090": "======== '{0}' modül adı çözümlenemedi. ========", "Module_name_0_was_successfully_resolved_to_1_6089": "======== '{0}' modül adı '{1}' öğesine başarıyla çözümlendi. ========", "Module_resolution_kind_is_not_specified_using_0_6088": "Modül çözümleme türü belirtilmedi, '{0}' kullanılıyor.", "Module_resolution_using_rootDirs_has_failed_6111": "'rootDirs' kullanarak modül çözümleme başarısız oldu.", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "Birbirini izleyen birden çok sayısal ayırıcıya izin verilmez.", "Multiple_constructor_implementations_are_not_allowed_2392": "Birden çok oluşturucu uygulamasına izin verilmez.", "NEWLINE_6061": "YENİ SATIR", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "'{1}' ve '{2}' türündeki '{0}' adlı özellikler aynı değil.", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "Soyut olmayan sınıf ifadesi, '{1}' sınıfından devralınan '{0}' soyut üyesini uygulamıyor.", "Not_all_code_paths_return_a_value_7030": "Tüm kod yolları bir değer döndürmez.", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "'{0}' sayısal dizin türü, '{1}' dize dizini türüne atanamaz.", + "Numeric_separators_are_not_allowed_here_6188": "Burada sayısal ayırıcılara izin verilmez.", "Object_is_possibly_null_2531": "Nesne büyük olasılıkla 'null'.", "Object_is_possibly_null_or_undefined_2533": "Nesne büyük olasılıkla 'null' veya 'undefined'.", "Object_is_possibly_undefined_2532": "Nesne büyük olasılıkla 'undefined'.", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "'new' anahtar sözcüğüyle yalnızca void işlevi çağrılabilir.", "Only_ambient_modules_can_use_quoted_names_1035": "Yalnızca çevresel modüller tırnak içinde ad kullanabilir.", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "--{0} ile birlikte yalnızca 'amd' ve 'system' modülleri desteklenir.", + "Only_emit_d_ts_declaration_files_6014": "Yalnızca '.d.ts' bildirim dosyalarını yayımla.", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "Sınıf 'extends' yan tümceleri içinde, şu an için yalnızca isteğe bağlı tür bağımsız değişkenlerine sahip tanımlayıcılar/tam adlar destekleniyor.", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "'super' anahtar sözcüğüyle yalnızca temel sınıfa ait ortak ve korunan metotlara erişilebilir.", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "'{0}' işleci, '{1}' ve '{2}' türüne uygulanamaz.", @@ -558,44 +572,45 @@ "Parameter_0_is_not_in_the_same_position_as_parameter_1_1227": "'{0}' parametresi, '{1}' parametresi ile aynı konumda değil.", "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4066": "Dışarı aktarılan arabirimdeki çağrı imzasının '{0}' parametresi, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1_4067": "Dışarı aktarılan arabirimdeki çağrı imzasının '{0}' parametresi, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061": "Dışarı aktarılan sınıftaki oluşturucunun '{0}' parametresi, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_can_4061": "Dışarı aktarılan sınıftaki oluşturucunun '{0}' parametresi, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2_4062": "Dışarı aktarılan sınıftaki oluşturucunun '{0}' parametresi, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1_4063": "Dışarı aktarılan sınıftaki oluşturucunun '{0}' parametresi, '{1}' özel adına sahip veya bu adı kullanıyor.", "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_mod_4064": "Dışarı aktarılan arabirimdeki oluşturucu imzasının '{0}' parametresi, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1_4065": "Dışarı aktarılan arabirimdeki oluşturucu imzasının '{0}' parametresi, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076": "Dışarı aktarılan işlevin '{0}' parametresi, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4076": "Dışarı aktarılan işlevin '{0}' parametresi, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2_4077": "Dışarı aktarılan işlevin '{0}' parametresi, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Parameter_0_of_exported_function_has_or_is_using_private_name_1_4078": "Dışarı aktarılan işlevin '{0}' parametresi, '{1}' özel adına sahip veya bu adı kullanıyor.", "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091": "Dışarı aktarılan arabirimin dizin imzasındaki '{0}' parametresi, '{2}' adlı özel modüldeki '{1}' adına sahip ya da bu adı kullanıyor.", "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092": "Dışarı aktarılan arabirimin dizin imzasındaki '{0}' parametresi, '{1}' adına sahip ya da bu adı kullanıyor.", "Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4074": "Dışarı aktarılan arabirimdeki metodun '{0}' parametresi, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1_4075": "Dışarı aktarılan arabirimdeki metodun '{0}' parametresi, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071": "Dışarı aktarılan sınıftaki ortak metodun '{0}' parametresi, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_c_4071": "Dışarı aktarılan sınıftaki ortak metodun '{0}' parametresi, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4072": "Dışarı aktarılan sınıftaki ortak metodun '{0}' parametresi, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1_4073": "Dışarı aktarılan sınıftaki ortak metodun '{0}' parametresi, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068": "Dışarı aktarılan sınıftaki ortak metodun '{0}' parametresi, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module__4068": "Dışarı aktarılan sınıftaki ortak metodun '{0}' parametresi, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2_4069": "Dışarı aktarılan sınıftaki statik metodun '{0}' parametresi, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1_4070": "Dışarı aktarılan sınıftaki statik metodun '{0}' parametresi, '{1}' özel adına sahip veya bu adı kullanıyor.", "Parameter_cannot_have_question_mark_and_initializer_1015": "Parametre soru işareti ve başlatıcı içeremez.", "Parameter_declaration_expected_1138": "Parametre bildirimi bekleniyor.", - "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036": "Dışarı aktarılan sınıftaki genel ayarlayıcı '{0}' için parametre türü, '{2}' özel modülündeki '{1}' adını taşıyor veya kullanıyor.", - "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037": "Dışarı aktarılan sınıftaki genel ayarlayıcı '{0}' için parametre türü, '{1}' özel adını taşıyor veya kullanıyor.", - "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034": "Dışarı aktarılan sınıftaki genel statik ayarlayıcı '{0}' için parametre türü, '{2}' özel modülündeki '{1}' adını taşıyor veya kullanıyor.", - "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Dışarı aktarılan sınıftaki genel statik ayarlayıcı '{0}' için parametre türü, '{1}' özel adını taşıyor veya kullanıyor.", + "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4036": "Dışarı aktarılan sınıftaki genel ayarlayıcı '{0}' için parametre türü, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", + "Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1_4037": "Dışarı aktarılan sınıftaki genel ayarlayıcı '{0}' için parametre türü, '{1}' özel adına sahip veya bu adı kullanıyor.", + "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_mod_4034": "Dışarı aktarılan sınıftaki genel statik ayarlayıcı '{0}' için parametre türü, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", + "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "Dışarı aktarılan sınıftaki genel statik ayarlayıcı '{0}' için parametre türü, '{1}' özel adına sahip veya bu adı kullanıyor.", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "Katı modda ayrıştırın ve her kaynak dosya için \"use strict\" kullanın.", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "'{0}' deseni en fazla bir adet '*' karakteri içerebilir.", - "Prefix_0_with_an_underscore_90025": "'{0}' için ön ek olarak alt çizgi kullanın.", + "Prefix_0_with_an_underscore_90025": "'{0}' için ön ek olarak alt çizgi kullan", "Print_names_of_files_part_of_the_compilation_6155": "Derlemenin parçası olan dosyaların adlarını yazdırın.", "Print_names_of_generated_files_part_of_the_compilation_6154": "Oluşturulan dosyalardan, derlemenin parçası olanların adlarını yazdırın.", "Print_the_compiler_s_version_6019": "Derleyici sürümünü yazdır.", "Print_this_message_6017": "Bu iletiyi yazdır.", - "Property_0_does_not_exist_on_const_enum_1_2479": "'{0}' özelliği, '{1}' 'const' numaralandırması üzerinde değil.", + "Property_0_does_not_exist_on_const_enum_1_2479": "'{0}' özelliği, '{1}' 'const' sabit listesi üzerinde değil.", "Property_0_does_not_exist_on_type_1_2339": "'{0}' özelliği, '{1}' türünde değil.", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "'{0}' özelliği '{1}' türünde yok. Bunu mu demek istediniz: '{2}'?", "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546": "'{0}' özelliği, çakışan bildirimler içeriyor ve '{1}' türü içinde erişilebilir değil.", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "'{0}' özelliği başlatıcı içermiyor ve oluşturucuda kesin olarak atanmamış.", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "'{0}' özelliği, get erişimcisinin dönüş türü ek açıklaması olmadığı için örtük olarak 'any' türü içeriyor.", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "'{0}' özelliği, set erişimcisinin parametre türü ek açıklaması olmadığı için örtük olarak 'any' türü içeriyor.", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "'{1}' türündeki '{0}' özelliği, '{2}' temel türündeki aynı özelliğe atanamaz.", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "'{1}' türündeki '{0}' özelliği, '{2}' türüne atanamaz.", "Property_0_is_declared_but_its_value_is_never_read_6138": "'{0}' özelliği bildirildi ancak değeri hiç okunmadı.", "Property_0_is_incompatible_with_index_signature_2530": "'{0}' özelliği, dizin imzasıyla uyumsuz.", @@ -622,19 +637,20 @@ "Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named_4098": "Dışarı aktarılan sınıfın '{0}' genel metodu, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4099": "Dışarı aktarılan sınıfın '{0}' genel metodu, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Public_method_0_of_exported_class_has_or_is_using_private_name_1_4100": "Dışarı aktarılan sınıfın '{0}' genel metodu, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029": "Dışarı aktarılan sınıfın '{0}' ortak özelliği, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_name_4029": "Dışarı aktarılan sınıfın '{0}' ortak özelliği, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4030": "Dışarı aktarılan sınıfın '{0}' ortak özelliği, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Public_property_0_of_exported_class_has_or_is_using_private_name_1_4031": "Dışarı aktarılan sınıfın '{0}' ortak özelliği, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095": "Dışarı aktarılan sınıfın '{0}' genel statik metodu, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_4095": "Dışarı aktarılan sınıfın '{0}' genel statik metodu, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4096": "Dışarı aktarılan sınıfın '{0}' genel statik metodu, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Public_static_method_0_of_exported_class_has_or_is_using_private_name_1_4097": "Dışarı aktarılan sınıfın '{0}' genel statik metodu, '{1}' özel adına sahip veya bu adı kullanıyor.", - "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026": "Dışarı aktarılan sınıfın '{0}' ortak statik özelliği, {2} dış modülündeki '{1}' özel adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", + "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot__4026": "Dışarı aktarılan sınıfın '{0}' ortak statik özelliği, {2} dış modülündeki '{1}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2_4027": "Dışarı aktarılan sınıfın '{0}' ortak statik özelliği, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", "Public_static_property_0_of_exported_class_has_or_is_using_private_name_1_4028": "Dışarı aktarılan sınıfın '{0}' ortak statik özelliği, '{1}' özel adına sahip veya bu adı kullanıyor.", "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "Belirtilen 'any' türüne sahip ifade ve bildirimlerde hata oluştur.", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "Örtük olarak 'any' türü içeren 'this' ifadelerinde hata tetikle.", "Redirect_output_structure_to_the_directory_6006": "Çıktı yapısını dizine yeniden yönlendir.", - "Remove_declaration_for_Colon_0_90004": "'{0}' bildirimini kaldırın.", + "Remove_declaration_for_Colon_0_90004": "'{0}' bildirimini kaldır", + "Replace_import_with_0_95015": "İçeri aktarma işlemini '{0}' ile değiştirin.", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "İşlevdeki tüm kod yolları bir değer döndürmediğinde hata bildir.", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "switch deyiminde sonraki ifadelere geçiş ile ilgili hataları bildir.", "Report_errors_in_js_files_8019": ".js dosyalarındaki hataları bildirin.", @@ -666,21 +682,21 @@ "Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0_4049": "Dışarı aktarılan arabirimdeki dizin imzasının dönüş türü, '{0}' özel adına sahip veya bu adı kullanıyor.", "Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1_4056": "Dışarı aktarılan arabirimdeki metodun dönüş türü, '{1}' özel modülündeki '{0}' adına sahip veya bu adı kullanıyor.", "Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0_4057": "Dışarı aktarılan arabirimdeki metodun dönüş türü, '{0}' özel adına sahip veya bu adı kullanıyor.", - "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041": "Dışarı aktarılan sınıftaki genel alıcı '{0}' için dönüş türü, '{2}' dış modülündeki '{1}' adını taşıyor veya kullanıyor ancak adlandırılamıyor.", - "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042": "Dışarı aktarılan sınıftaki genel alıcı '{0}' için dönüş türü, '{2}' özel modülündeki '{1}' adını taşıyor veya kullanıyor.", - "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043": "Dışarı aktarılan sınıftaki genel alıcı '{0}' için dönüş türü, '{1}' özel adını taşıyor veya kullanıyor.", + "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_4041": "Dışarı aktarılan sınıftaki genel alıcı '{0}' için dönüş türü, '{2}' dış modülündeki '{1}' adına sahip veya bu adı kullanıyor ancak adlandırılamıyor.", + "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2_4042": "Dışarı aktarılan sınıftaki genel alıcı '{0}' için dönüş türü, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", + "Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1_4043": "Dışarı aktarılan sınıftaki genel alıcı '{0}' için dönüş türü, '{1}' özel adına sahip veya bu adı kullanıyor.", "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_c_4053": "Dışarı aktarılan sınıftaki ortak metodun dönüş türü, '{1}' dış modülündeki '{0}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4054": "Dışarı aktarılan sınıftaki ortak metodun dönüş türü, '{1}' özel modülündeki '{0}' adına sahip veya bu adı kullanıyor.", "Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0_4055": "Dışarı aktarılan sınıftaki ortak metodun dönüş türü, '{0}' özel adına sahip veya bu adı kullanıyor.", - "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038": "Dışarı aktarılan sınıftaki genel statik alıcı '{0}' için dönüş türü, '{2}' dış modülündeki '{1}' adını taşıyor veya kullanıyor ancak adlandırılamıyor.", - "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039": "Dışarı aktarılan sınıftaki genel statik alıcı '{0}' için dönüş türü, '{2}' özel modülündeki '{1}' adını taşıyor veya kullanıyor.", - "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040": "Dışarı aktarılan sınıftaki genel statik alıcı '{0}' için dönüş türü, '{1}' özel adını taşıyor veya kullanıyor.", + "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_modul_4038": "Dışarı aktarılan sınıftaki genel statik alıcı '{0}' için dönüş türü, '{2}' dış modülündeki '{1}' adına sahip veya bu adı kullanıyor ancak adlandırılamıyor.", + "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_4039": "Dışarı aktarılan sınıftaki genel statik alıcı '{0}' için dönüş türü, '{2}' özel modülündeki '{1}' adına sahip veya bu adı kullanıyor.", + "Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1_4040": "Dışarı aktarılan sınıftaki genel statik alıcı '{0}' için dönüş türü, '{1}' özel adına sahip veya bu adı kullanıyor.", "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module__4050": "Dışarı aktarılan sınıftaki ortak statik metodun dönüş türü, '{1}' dış modülündeki '{0}' adına sahip veya bu adı kullanıyor, ancak adlandırılamıyor.", "Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1_4051": "Dışarı aktarılan sınıftaki ortak statik metodun dönüş türü, '{1}' özel modülündeki '{0}' adına sahip veya bu adı kullanıyor.", "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "Dışarı aktarılan sınıftaki ortak statik metodun dönüş türü, '{0}' özel adına sahip veya bu adı kullanıyor.", - "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Eski programdaki çözmeler değişmediğinden '{0}' kaynaklı modül çözmeleri yeniden kullanılıyor.", + "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "Eski programdaki çözümlemeler değişmediğinden '{0}' kaynaklı modül çözümlemeleri yeniden kullanılıyor.", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "Eski programın '{1}' dosyasında '{0}' modülü çözmesi yeniden kullanılıyor.", - "Rewrite_as_the_indexed_access_type_0_90026": "Dizine eklenmiş erişim türü '{0}' olarak yeniden yazın.", + "Rewrite_as_the_indexed_access_type_0_90026": "Dizine eklenmiş erişim türü '{0}' olarak yeniden yaz", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "Kök dizin belirlenemiyor, birincil arama yolları atlanıyor.", "STRATEGY_6039": "STRATEJİ", "Scoped_package_detected_looking_in_0_6182": "Kapsamlı paket algılandı, '{0}' içinde aranıyor", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "Kaynak Eşleme Seçenekleri", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "Özelleşmiş aşırı yükleme imzası özelleşmemiş imzalara atanamaz.", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "Dinamik içeri aktarmanın tanımlayıcısı, yayılma öğesi olamaz.", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "ECMAScript hedef sürümünü belirleyin: 'ES3' (varsayılan), 'ES5', 'ES2015', 'ES2016', 'ES2017' ya da 'ESNEXT'.", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "ECMAScript hedef sürümünü belirleyin: 'ES3' (varsayılan), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018' ya da 'ESNEXT'.", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "JSX kod oluşturma seçeneğini belirtin: 'preserve', 'react-native' veya 'react'.", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "Derlemeye dahil edilecek kitaplık dosyalarını belirtin: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "Derlemeye dahil edilecek kitaplık dosyalarını belirtin.", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "Modül kodu oluşturmayı belirtin: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015' veya 'ESNext'.", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "Modül çözümleme stratejisini belirtin: 'Node' (Node.js) veya 'classic' (TypeScript pre-1.6).", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "'React.createElement' veya 'h' gibi 'react' JSX emit hedeflerken kullanılacak JSX fabrika işlevini belirtin.", @@ -704,7 +720,8 @@ "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6003": "Hata ayıklayıcının, eşlem dosyalarını üretilen konumlar yerine nerede bulması gerektiğini belirtin.", "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "Giriş dosyalarının kök dizinini belirtin. Çıkış dizininin yapısını --outDir ile denetlemek için kullanın.", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "'new' ifadelerindeki yayılma işleci yalnızca ECMAScript 5 ve üzeri hedeflenirken kullanılabilir.", - "Spread_types_may_only_be_created_from_object_types_2698": "Spread türleri yalnızca nesne türlerinden oluşturulabilir.", + "Spread_types_may_only_be_created_from_object_types_2698": "Yayılma türleri yalnızca nesne türlerinden oluşturulabilir.", + "Starting_compilation_in_watch_mode_6031": "Derleme, izleme modunda başlatılıyor...", "Statement_expected_1129": "Deyim bekleniyor.", "Statements_are_not_allowed_in_ambient_contexts_1036": "Çevresel bağlamlarda deyimlere izin verilmez.", "Static_members_cannot_reference_class_type_parameters_2302": "Statik üyeler sınıf türündeki parametrelere başvuramaz.", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "Dize sabit değeri bekleniyor.", "String_literal_with_double_quotes_expected_1327": "Çift tırnak içine alınmış bir dize sabit değeri bekleniyor.", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "Renk ve bağlam kullanarak hataların ve iletilerin stilini belirleyin (deneysel).", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Ardışık özellik bildirimleri aynı türe sahip olmalıdır. '{0}' özelliği '{1}' türünde olmalıdır, ancak burada '{2}' türüne sahip.", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "Ardışık değişken bildirimleri aynı türe sahip olmalıdır. '{0}' değişkeni '{1}' türünde olmalıdır, ancak burada '{2}' türüne sahip.", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "'{1}' deseni için '{0}' alternatifinin türü hatalı; beklenen: 'string' alınan: '{2}'.", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "'{1}' desenindeki '{0}' değişimi, en fazla bir adet '*' karakteri içerebilir.", @@ -745,7 +762,7 @@ "The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any_2405": "'for...in' deyiminin sol tarafı 'string' veya 'any' türünde olmalıdır.", "The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation_2483": "'for...of' deyiminin sol tarafında tür ek açıklaması kullanılamaz.", "The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access_2487": "'for...of' deyiminin sol tarafında bir değişken veya özellik erişimi bulunmalıdır.", - "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362": "Aritmetik işlemin sol tarafı, 'any', 'number' veya bir numaralandırma türünde olmalıdır.", + "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2362": "Aritmetik işlemin sol tarafı, 'any', 'number' veya bir sabit listesi türünde olmalıdır.", "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "Atama ifadesinin sol tarafında bir değişken veya özellik erişimi bulunmalıdır.", "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "'in' ifadesinin sol tarafı, 'any', 'string', 'number' veya 'symbol' türünde olmalıdır.", "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "'instanceof' ifadesinin sol tarafı 'any' türünde, bir nesne türü veya tür parametresi olmalıdır.", @@ -760,7 +777,7 @@ "The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_t_1058": "Zaman uyumsuz bir işlevin dönüş türü, geçerli bir promise olmalı veya çağrılabilir 'then' üyesi içermemelidir.", "The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064": "Zaman uyumsuz bir işlevin ya da metodun döndürme türü, genel Promise türü olmalıdır.", "The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_2407": "'for...in' deyiminin sağ tarafı 'any' türünde, bir nesne türü veya tür parametresi olmalıdır.", - "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363": "Aritmetik işlemin sağ tarafı, 'any', 'number' veya bir numaralandırma türünde olmalıdır.", + "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type_2363": "Aritmetik işlemin sağ tarafı, 'any', 'number' veya bir sabit listesi türünde olmalıdır.", "The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter_2361": "'in' ifadesinin sağ tarafı 'any' türünde, bir nesne türü veya tür parametresi olmalıdır.", "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359": "'instanceof' ifadesinin sağ tarafı 'any' türünde veya 'Function' arabirim türüne atanabilir bir türde olmalıdır.", "The_specified_path_does_not_exist_Colon_0_5058": "Belirtilen yol yok: '{0}'.", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "'{0}' türü, bir dizi türü veya dize türü değil ya da bir yineleyici döndüren '[Symbol.iterator]()' metoduna sahip değil.", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "'{0}' türü, bir dizi türü değil ya da bir yineleyici döndüren '[Symbol.iterator]()' metoduna sahip değil.", "Type_0_is_not_assignable_to_type_1_2322": "'{0}' türü, '{1}' türüne atanamaz.", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "'{0}' türü '{1}' türüne atanamaz. Bu ada sahip iki farklı tür mevcut, ancak bu türler birbiriyle ilişkisiz.", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "'{0}' türü '{1}' türüne atanamaz. Bu ada sahip iki farklı tür mevcut, ancak bu türler birbiriyle ilişkisiz.", "Type_0_is_not_comparable_to_type_1_2678": "'{0}' türü '{1}' türüyle karşılaştırılamaz.", "Type_0_is_not_generic_2315": "'{0}' türü genel değil.", "Type_0_provides_no_match_for_the_signature_1_2658": "'{0}' türü, '{1}' imzası için eşleşme sağlamıyor.", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "Sonlandırılmamış şablon sabit değeri.", "Untyped_function_calls_may_not_accept_type_arguments_2347": "Türü belirtilmemiş işlev çağrıları tür bağımsız değişkenlerini kabul etmeyebilir.", "Unused_label_7028": "Kullanılmayan etiket.", + "Use_synthetic_default_member_95016": "Yapay 'default' üyesini kullanın.", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "'for...of' deyiminde dize kullanma yalnızca ECMAScript 5 veya üzerinde desteklenir.", "VERSION_6036": "SÜRÜM", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "'{0}' türünün değeri ile '{1}' türü arasında hiç ortak özellik yok. Bunun yerine çağrı yapmak mı istediniz?", @@ -911,9 +929,9 @@ "class_expressions_are_not_currently_supported_9003": "'class' ifadeleri şu anda desteklenmiyor.", "const_declarations_can_only_be_declared_inside_a_block_1156": "'const' bildirimleri yalnızca bir bloğun içinde bildirilebilir.", "const_declarations_must_be_initialized_1155": "'const' bildirimlerinin başlatılması gerekiyor.", - "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "'const' numaralandırma üyesi başlatıcısı, sonlu olmayan bir değer olarak hesaplandı.", - "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' numaralandırma üyesi başlatıcısı, izin verilmeyen 'NaN' değeri olarak hesaplandı.", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' numaralandırmaları yalnızca bir özellikte, dizin erişim ifadelerinde, içeri aktarma bildiriminin sağ tarafında veya dışarı aktarma atamasında kullanılabilir.", + "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "'const' sabit listesi üyesi başlatıcısı, sonlu olmayan bir değer olarak hesaplandı.", + "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' sabit listesi üyesi başlatıcısı, izin verilmeyen 'NaN' değeri olarak hesaplandı.", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' sabit listeleri yalnızca bir özellikte, dizin erişim ifadelerinde, içeri aktarma bildiriminin veya dışarı aktarma atamasının sağ tarafında ya da tür sorgusunda kullanılabilir.", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "'delete', katı moddaki bir tanımlayıcıda çağrılamaz.", "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum declarations' yalnızca bir .ts dosyasında kullanılabilir.", "export_can_only_be_used_in_a_ts_file_8003": "'export=' yalnızca bir .ts dosyasında kullanılabilir.", @@ -921,13 +939,14 @@ "extends_clause_already_seen_1172": "'extends' yan tümcesi zaten görüldü.", "extends_clause_must_precede_implements_clause_1173": "'extends' yan tümcesi, 'implements' yan tümcesinden önce gelmelidir.", "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "Dışarı aktarılan '{0}' sınıfının 'extends' yan tümcesi, '{1}' özel adına sahip veya bu adı kullanıyor.", - "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Dışarı aktarılan '{0}' arabirimin 'extends' yan tümcesi, '{1}' özel adına sahip veya bu adı kullanıyor.", + "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Dışarı aktarılan '{0}' arabiriminin 'extends' yan tümcesi, '{1}' özel adına sahip veya bu adı kullanıyor.", "file_6025": "dosya", "get_and_set_accessor_must_have_the_same_this_type_2682": "'get' ve 'set' erişimcisi aynı 'this' türüne sahip olmalıdır.", "get_and_set_accessor_must_have_the_same_type_2380": "'get' ve 'set' erişimcisi aynı türde olmalıdır.", "implements_clause_already_seen_1175": "'implements' yan tümcesi zaten görüldü.", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "'implements clauses' yalnızca bir .ts dosyasında kullanılabilir.", "import_can_only_be_used_in_a_ts_file_8002": "'import ... =' yalnızca bir .ts dosyasında kullanılabilir.", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "'infer' bildirimlerine yalnızca bir koşullu türün 'extends' yan tümcesinde izin verilir.", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "'interface declarations' yalnızca bir .ts dosyasında kullanılabilir.", "let_declarations_can_only_be_declared_inside_a_block_1157": "'let' bildirimleri yalnızca bu bloğun içinde bildirilebilir.", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "'let' ifadesi, 'let' veya 'const' bildirimlerinde ad olarak kullanılamaz.", diff --git a/lib/tsc.js b/lib/tsc.js index 6efd1a95483..b5c5051820e 100644 --- a/lib/tsc.js +++ b/lib/tsc.js @@ -36,24 +36,6 @@ var ts; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); - var NodeBuilderFlags; - (function (NodeBuilderFlags) { - NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; - NodeBuilderFlags[NodeBuilderFlags["NoTruncation"] = 1] = "NoTruncation"; - NodeBuilderFlags[NodeBuilderFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; - NodeBuilderFlags[NodeBuilderFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; - NodeBuilderFlags[NodeBuilderFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; - NodeBuilderFlags[NodeBuilderFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; - NodeBuilderFlags[NodeBuilderFlags["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; - NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 1024] = "AllowThisInObjectLiteral"; - NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 2048] = "AllowQualifedNameInPlaceOfIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 8192] = "AllowAnonymousIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 16384] = "AllowEmptyUnionOrIntersection"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 32768] = "AllowEmptyTuple"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 60416] = "IgnoreErrors"; - NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; - NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; - })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -149,16 +131,21 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.versionMajorMinor = "2.7"; - ts.version = ts.versionMajorMinor + ".0"; + ts.versionMajorMinor = "2.8"; + ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); (function (ts) { + ts.emptyArray = []; function createDictionaryObject() { var map = Object.create(null); map.__ = undefined; @@ -284,6 +271,9 @@ var ts; } ts.forEach = forEach; function firstDefined(array, callback) { + if (array === undefined) { + return undefined; + } for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result !== undefined) { @@ -293,6 +283,19 @@ var ts; return undefined; } ts.firstDefined = firstDefined; + function firstDefinedIterator(iter, callback) { + while (true) { + var _a = iter.next(), value = _a.value, done = _a.done; + if (done) { + return undefined; + } + var result = callback(value); + if (result !== undefined) { + return result; + } + } + } + ts.firstDefinedIterator = firstDefinedIterator; function findAncestor(node, callback) { while (node) { var result = callback(node); @@ -309,13 +312,27 @@ var ts; ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { var result = []; - Debug.assert(arrayA.length === arrayB.length); + Debug.assertEqual(arrayA.length, arrayB.length); for (var i = 0; i < arrayA.length; i++) { result.push(callback(arrayA[i], arrayB[i], i)); } return result; } ts.zipWith = zipWith; + function zipToIterator(arrayA, arrayB) { + Debug.assertEqual(arrayA.length, arrayB.length); + var i = 0; + return { + next: function () { + if (i === arrayA.length) { + return { value: undefined, done: true }; + } + i++; + return { value: [arrayA[i - 1], arrayB[i - 1]], done: false }; + } + }; + } + ts.zipToIterator = zipToIterator; function zipToMap(keys, values) { Debug.assert(keys.length === values.length); var map = createMap(); @@ -388,17 +405,11 @@ var ts; return false; } ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); } - ts.indexOf = indexOf; + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -470,31 +481,30 @@ var ts; } ts.map = map; function mapIterator(iter, mapFn) { - return { next: next }; - function next() { - var iterRes = iter.next(); - return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; - } + return { + next: function () { + var iterRes = iter.next(); + return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + } + }; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; function flatten(array) { @@ -535,25 +545,33 @@ var ts; return result; } ts.flatMap = flatMap; - function flatMapIter(iter, mapfn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapfn(value); - if (res) { - if (isArray(res)) { - result.push.apply(result, res); + function flatMapIterator(iter, mapfn) { + var first = iter.next(); + if (first.done) { + return ts.emptyIterator; + } + var currentIter = getIterator(first.value); + return { + next: function () { + while (true) { + var currentRes = currentIter.next(); + if (!currentRes.done) { + return currentRes; + } + var iterRes = iter.next(); + if (iterRes.done) { + return iterRes; + } + currentIter = getIterator(iterRes.value); } - else { - result.push(res); - } - } + }, + }; + function getIterator(x) { + var res = mapfn(x); + return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res; } - return result; } - ts.flatMapIter = flatMapIter; + ts.flatMapIterator = flatMapIterator; function sameFlatMap(array, mapfn) { var result; if (array) { @@ -576,12 +594,23 @@ var ts; return result || array; } ts.sameFlatMap = sameFlatMap; + function mapAllOrFail(array, mapFn) { + var result = []; + for (var i = 0; i < array.length; i++) { + var mapped = mapFn(array[i], i); + if (mapped === undefined) { + return undefined; + } + result.push(mapped); + } + return result; + } + ts.mapAllOrFail = mapAllOrFail; function mapDefined(array, mapFn) { var result = []; if (array) { for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); + var mapped = mapFn(array[i], i); if (mapped !== undefined) { result.push(mapped); } @@ -590,20 +619,35 @@ var ts; return result; } ts.mapDefined = mapDefined; - function mapDefinedIter(iter, mapFn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapFn(value); - if (res !== undefined) { - result.push(res); + function mapDefinedIterator(iter, mapFn) { + return { + next: function () { + while (true) { + var res = iter.next(); + if (res.done) { + return res; + } + var value = mapFn(res.value); + if (value !== undefined) { + return { value: value, done: false }; + } + } } - } - return result; + }; } - ts.mapDefinedIter = mapDefinedIter; + ts.mapDefinedIterator = mapDefinedIterator; + ts.emptyIterator = { next: function () { return ({ value: undefined, done: true }); } }; + function singleIterator(value) { + var done = false; + return { + next: function () { + var wasDone = done; + done = true; + return wasDone ? { value: undefined, done: true } : { value: value, done: false }; + } + }; + } + ts.singleIterator = singleIterator; function span(array, f) { if (array) { for (var i = 0; i < array.length; i++) { @@ -740,6 +784,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -1213,6 +1268,15 @@ var ts; } } } + function group(values, getGroupId) { + var groupIdToGroup = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + groupIdToGroup.add(getGroupId(value), value); + } + return arrayFrom(groupIdToGroup.values()); + } + ts.group = group; function isArray(value) { return Array.isArray ? Array.isArray(value) : value instanceof Array; } @@ -1232,7 +1296,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; function noop(_) { } @@ -1243,6 +1312,8 @@ var ts; ts.returnTrue = returnTrue; function identity(x) { return x; } ts.identity = identity; + function toLowerCase(x) { return x.toLowerCase(); } + ts.toLowerCase = toLowerCase; function notImplemented() { throw new Error("Not implemented"); } @@ -1533,6 +1604,10 @@ var ts; 0; } ts.compareDiagnostics = compareDiagnostics; + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { var string1 = isString(text1) ? text1 : text1.messageText; @@ -1549,10 +1624,6 @@ var ts; } return text1 ? 1 : -1; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -1570,7 +1641,7 @@ var ts; return p2 + 1; } if (path.charCodeAt(1) === 58) { - if (path.charCodeAt(2) === 47) + if (path.charCodeAt(2) === 47 || path.charCodeAt(2) === 92) return 3; } if (path.lastIndexOf("file:///", 0) === 0) { @@ -1637,10 +1708,6 @@ var ts; return /^\.\.?($|[\\/])/.test(path); } ts.pathIsRelative = pathIsRelative; - function moduleHasNonRelativeName(moduleName) { - return !ts.isExternalModuleNameRelative(moduleName); - } - ts.moduleHasNonRelativeName = moduleHasNonRelativeName; function getEmitScriptTarget(compilerOptions) { return compilerOptions.target || 0; } @@ -1663,7 +1730,9 @@ var ts; var moduleKind = getEmitModuleKind(compilerOptions); return compilerOptions.allowSyntheticDefaultImports !== undefined ? compilerOptions.allowSyntheticDefaultImports - : moduleKind === ts.ModuleKind.System; + : compilerOptions.esModuleInterop + ? moduleKind !== ts.ModuleKind.None && moduleKind < ts.ModuleKind.ES2015 + : moduleKind === ts.ModuleKind.System; } ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports; function getStrictOptionValue(compilerOptions, flag) { @@ -1946,7 +2015,6 @@ var ts; function getSubPatternFromSpec(spec, basePath, usage, _a) { var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; - var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; var components = getNormalizedPathComponents(spec, basePath); var lastComponent = lastOrUndefined(components); @@ -1961,11 +2029,7 @@ var ts; for (var _i = 0, components_1 = components; _i < components_1.length; _i++) { var component = components_1[_i]; if (component === "**") { - if (hasRecursiveDirectoryWildcard) { - return undefined; - } subpattern += doubleAsteriskRegexFragment; - hasRecursiveDirectoryWildcard = true; } else { if (usage === "directories") { @@ -2224,6 +2288,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -2233,10 +2301,10 @@ var ts; } function Signature() { } function Node(kind, pos, end) { - this.id = 0; - this.kind = kind; this.pos = pos; this.end = end; + this.kind = kind; + this.id = 0; this.flags = 0; this.modifierFlagsCache = 0; this.transformFlags = 0; @@ -2309,6 +2377,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -2327,6 +2408,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); function orderedRemoveItem(array, item) { for (var i = 0; i < array.length; i++) { @@ -2363,9 +2464,7 @@ var ts; } } function createGetCanonicalFileName(useCaseSensitiveFileNames) { - return useCaseSensitiveFileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); + return useCaseSensitiveFileNames ? identity : toLowerCase; } ts.createGetCanonicalFileName = createGetCanonicalFileName; function matchPatternOrExact(patternStrings, candidate) { @@ -2390,14 +2489,14 @@ var ts; ts.patternText = patternText; function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; function findBestPatternMatch(values, getPattern, candidate) { var matchedValue = undefined; var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -2462,170 +2561,20 @@ var ts; return function (arg) { return f(arg) && g(arg); }; } ts.and = and; + function or(f, g) { + return function (arg) { return f(arg) || g(arg); }; + } + ts.or = or; function assertTypeIsNever(_) { } ts.assertTypeIsNever = assertTypeIsNever; - function createCachedDirectoryStructureHost(host) { - var cachedReadDirectoryResult = createMap(); - var getCurrentDirectory = memoize(function () { return host.getCurrentDirectory(); }); - var getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - return { - useCaseSensitiveFileNames: host.useCaseSensitiveFileNames, - newLine: host.newLine, - readFile: function (path, encoding) { return host.readFile(path, encoding); }, - write: function (s) { return host.write(s); }, - writeFile: writeFile, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: createDirectory, - getCurrentDirectory: getCurrentDirectory, - getDirectories: getDirectories, - readDirectory: readDirectory, - addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, - addOrDeleteFile: addOrDeleteFile, - clearCache: clearCache, - exit: function (code) { return host.exit(code); } - }; - function toPath(fileName) { - return ts.toPath(fileName, getCurrentDirectory(), getCanonicalFileName); - } - function getCachedFileSystemEntries(rootDirPath) { - return cachedReadDirectoryResult.get(rootDirPath); - } - function getCachedFileSystemEntriesForBaseDir(path) { - return getCachedFileSystemEntries(getDirectoryPath(path)); - } - function getBaseNameOfFileName(fileName) { - return getBaseFileName(normalizePath(fileName)); - } - function createCachedFileSystemEntries(rootDir, rootDirPath) { - var resultFromHost = { - files: map(host.readDirectory(rootDir, undefined, undefined, ["*.*"]), getBaseNameOfFileName) || [], - directories: host.getDirectories(rootDir) || [] - }; - cachedReadDirectoryResult.set(rootDirPath, resultFromHost); - return resultFromHost; - } - function tryReadDirectory(rootDir, rootDirPath) { - var cachedResult = getCachedFileSystemEntries(rootDirPath); - if (cachedResult) { - return cachedResult; - } - try { - return createCachedFileSystemEntries(rootDir, rootDirPath); - } - catch (_e) { - Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); - return undefined; - } - } - function fileNameEqual(name1, name2) { - return getCanonicalFileName(name1) === getCanonicalFileName(name2); - } - function hasEntry(entries, name) { - return some(entries, function (file) { return fileNameEqual(file, name); }); - } - function updateFileSystemEntry(entries, baseName, isValid) { - if (hasEntry(entries, baseName)) { - if (!isValid) { - return filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); - } - } - else if (isValid) { - return entries.push(baseName); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), true); - } - return host.writeFile(fileName, data, writeByteOrderMark); - } - function fileExists(fileName) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || - host.fileExists(fileName); - } - function directoryExists(dirPath) { - var path = toPath(dirPath); - return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); - } - function createDirectory(dirPath) { - var path = toPath(dirPath); - var result = getCachedFileSystemEntriesForBaseDir(path); - var baseFileName = getBaseNameOfFileName(dirPath); - if (result) { - updateFileSystemEntry(result.directories, baseFileName, true); - } - host.createDirectory(dirPath); - } - function getDirectories(rootDir) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return result.directories.slice(); - } - return host.getDirectories(rootDir); - } - function readDirectory(rootDir, extensions, excludes, includes, depth) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return matchFiles(rootDir, extensions, excludes, includes, host.useCaseSensitiveFileNames, getCurrentDirectory(), depth, getFileSystemEntries); - } - return host.readDirectory(rootDir, extensions, excludes, includes, depth); - function getFileSystemEntries(dir) { - var path = toPath(dir); - if (path === rootDirPath) { - return result; - } - return getCachedFileSystemEntries(path) || createCachedFileSystemEntries(dir, path); - } - } - function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { - var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); - if (existingResult) { - clearCache(); - } - else { - var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); - if (parentResult) { - var baseName = getBaseNameOfFileName(fileOrDirectory); - if (parentResult) { - var fsQueryResult = { - fileExists: host.fileExists(fileOrDirectoryPath), - directoryExists: host.directoryExists(fileOrDirectoryPath) - }; - if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { - clearCache(); - } - else { - updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); - } - return fsQueryResult; - } - } - } - } - function addOrDeleteFile(fileName, filePath, eventKind) { - if (eventKind === ts.FileWatcherEventKind.Changed) { - return; - } - var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); - if (parentResult) { - updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); - } - } - function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { - updateFileSystemEntry(parentResult.files, baseName, fileExists); - } - function clearCache() { - cachedReadDirectoryResult.clear(); - } + ts.emptyFileSystemEntries = { + files: ts.emptyArray, + directories: ts.emptyArray + }; + function singleElementArray(t) { + return t === undefined ? undefined : [t]; } - ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + ts.singleElementArray = singleElementArray; })(ts || (ts = {})); var ts; (function (ts) { @@ -2657,13 +2606,28 @@ var ts; } ts.getNodeMajorVersion = getNodeMajorVersion; ts.sys = (function () { - var utf8ByteOrderMark = "\u00EF\u00BB\u00BF"; + var byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; + } var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } function createWatchedFileSet() { var dirWatchers = ts.createMap(); var fileWatcherCallbacks = ts.createMultiMap(); @@ -2821,7 +2785,7 @@ var ts; } function writeFile(fileName, data, writeByteOrderMark) { if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } var fd; try { @@ -2862,7 +2826,7 @@ var ts; return { files: files, directories: directories }; } catch (e) { - return { files: [], directories: [] }; + return ts.emptyFileSystemEntries; } } function readDirectory(path, extensions, excludes, includes, depth) { @@ -2890,6 +2854,9 @@ var ts; return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1); }); } var nodeSystem = { + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, args: process.argv.slice(2), newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, @@ -2943,11 +2910,7 @@ var ts; return undefined; } }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, getMemoryUsage: function () { if (global.gc) { global.gc(); @@ -2968,7 +2931,12 @@ var ts; process.exit(exitCode); }, realpath: function (path) { - return _fs.realpathSync(path); + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } }, debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), tryEnableSourceMapsForHost: function () { @@ -2995,7 +2963,7 @@ var ts; }, writeFile: function (path, data, writeByteOrderMark) { if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } ChakraHost.writeFile(path, data); }, @@ -3294,6 +3262,9 @@ var ts; unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts.DiagnosticCategory.Error, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), + An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -3408,6 +3379,7 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", "Numeric index type '{0}' is not assignable to string index type '{1}'."), Class_name_cannot_be_0: diag(2414, ts.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), @@ -3462,7 +3434,7 @@ var ts; Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), @@ -3550,6 +3522,8 @@ var ts; The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts.DiagnosticCategory.Error, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -3628,6 +3602,10 @@ var ts; Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -3714,7 +3692,6 @@ var ts; The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), - File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: diag(5011, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'."), Cannot_read_file_0_Colon_1: diag(5012, ts.DiagnosticCategory.Error, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), Failed_to_parse_file_0_Colon_1: diag(5014, ts.DiagnosticCategory.Error, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), Unknown_compiler_option_0: diag(5023, ts.DiagnosticCategory.Error, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), @@ -3753,6 +3730,7 @@ var ts; Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -3765,6 +3743,7 @@ var ts; Options_Colon: diag(6027, ts.DiagnosticCategory.Message, "Options_Colon_6027", "Options:"), Version_0: diag(6029, ts.DiagnosticCategory.Message, "Version_0_6029", "Version {0}"), Insert_command_line_options_and_files_from_a_file: diag(6030, ts.DiagnosticCategory.Message, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, ts.DiagnosticCategory.Message, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), File_change_detected_Starting_incremental_compilation: diag(6032, ts.DiagnosticCategory.Message, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), KIND: diag(6034, ts.DiagnosticCategory.Message, "KIND_6034", "KIND"), FILE: diag(6035, ts.DiagnosticCategory.Message, "FILE_6035", "FILE"), @@ -3805,7 +3784,7 @@ var ts; Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts.DiagnosticCategory.Message, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), - Specify_library_files_to_be_included_in_the_compilation_Colon: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", "Specify library files to be included in the compilation: "), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), Specify_JSX_code_generation_Colon_preserve_react_native_or_react: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", "Specify JSX code generation: 'preserve', 'react-native', or 'react'."), File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), @@ -3912,6 +3891,9 @@ var ts; Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6185", "Disable strict checking of generic signatures in function types."), Enable_strict_checking_of_function_types: diag(6186, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -3940,6 +3922,9 @@ var ts; Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{0}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime: diag(7038, ts.DiagnosticCategory.Error, "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038", "A namespace-style import cannot be called or constructed, and will cause a failure at runtime."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -4015,9 +4000,9 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), Declare_static_property_0: diag(90027, ts.DiagnosticCategory.Message, "Declare_static_property_0_90027", "Declare static property '{0}'"), Call_decorator_expression: diag(90028, ts.DiagnosticCategory.Message, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Extract_symbol: diag(95003, ts.DiagnosticCategory.Message, "Extract_symbol_95003", "Extract symbol"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -4029,6 +4014,9 @@ var ts; Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"), Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), }; })(ts || (ts = {})); var ts; @@ -4065,47 +4053,48 @@ var ts; "false": 86, "finally": 87, "for": 88, - "from": 141, + "from": 142, "function": 89, "get": 125, "if": 90, "implements": 108, "import": 91, "in": 92, + "infer": 126, "instanceof": 93, "interface": 109, - "is": 126, - "keyof": 127, + "is": 127, + "keyof": 128, "let": 110, - "module": 128, - "namespace": 129, - "never": 130, + "module": 129, + "namespace": 130, + "never": 131, "new": 94, "null": 95, - "number": 133, - "object": 134, + "number": 134, + "object": 135, "package": 111, "private": 112, "protected": 113, "public": 114, - "readonly": 131, - "require": 132, - "global": 142, + "readonly": 132, + "require": 133, + "global": 143, "return": 96, - "set": 135, + "set": 136, "static": 115, - "string": 136, + "string": 137, "super": 97, "switch": 98, - "symbol": 137, + "symbol": 138, "this": 99, "throw": 100, "true": 101, "try": 102, - "type": 138, + "type": 139, "typeof": 103, - "undefined": 139, - "unique": 140, + "undefined": 140, + "unique": 141, "var": 104, "void": 105, "while": 106, @@ -4113,7 +4102,7 @@ var ts; "yield": 116, "async": 120, "await": 121, - "of": 143, + "of": 144, "{": 17, "}": 18, "(": 19, @@ -4255,7 +4244,9 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -4436,7 +4427,7 @@ var ts; } function scanConflictMarkerTrivia(text, pos, error) { if (error) { - error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength); + error(ts.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); } var ch = text.charCodeAt(pos); var len = text.length; @@ -4660,19 +4651,60 @@ var ts; lookAhead: lookAhead, scanRange: scanRange, }; - function error(message, length) { + function error(message, errPos, length) { + if (errPos === void 0) { errPos = pos; } if (onError) { + var oldPos = pos; + pos = errPos; onError(message, length || 0); + pos = oldPos; } } + function scanNumberFragment() { + var start = pos; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + var result = ""; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result += text.substring(start, pos); + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + start = pos; + continue; + } + if (isDigit(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result + text.substring(start, pos); + } function scanNumber() { var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; + var mainFragment = scanNumberFragment(); + var decimalFragment; + var scientificFragment; if (text.charCodeAt(pos) === 46) { pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; + decimalFragment = scanNumberFragment(); } var end = pos; if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { @@ -4680,17 +4712,29 @@ var ts; tokenFlags |= 16; if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { + var preNumericPart = pos; + var finalFragment = scanNumberFragment(); + if (!finalFragment) { error(ts.Diagnostics.Digit_expected); } + else { + scientificFragment = text.substring(end, preNumericPart) + finalFragment; + end = pos; + } + } + if (tokenFlags & 512) { + var result = mainFragment; + if (decimalFragment) { + result += "." + decimalFragment; + } + if (scientificFragment) { + result += scientificFragment; + } + return "" + +result; + } + else { + return "" + +(text.substring(start, end)); } - return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -4699,17 +4743,35 @@ var ts; } return +(text.substring(start, pos)); } - function scanExactNumberOfHexDigits(count) { - return scanHexDigits(count, false); + function scanExactNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(count, false, canHaveSeparators); } - function scanMinimumNumberOfHexDigits(count) { - return scanHexDigits(count, true); + function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(count, true, canHaveSeparators); } - function scanHexDigits(minCount, scanAsManyAsPossible) { + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { var digits = 0; var value = 0; + var allowSeparator = false; + var isPreviousTokenSeparator = false; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; if (ch >= 48 && ch <= 57) { value = value * 16 + ch - 48; } @@ -4724,10 +4786,14 @@ var ts; } pos++; digits++; + isPreviousTokenSeparator = false; } if (digits < minCount) { value = -1; } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } return value; } function scanString(jsxAttributeString) { @@ -4863,7 +4929,7 @@ var ts; } } function scanHexadecimalEscape(numDigits) { - var escapedValue = scanExactNumberOfHexDigits(numDigits); + var escapedValue = scanExactNumberOfHexDigits(numDigits, false); if (escapedValue >= 0) { return String.fromCharCode(escapedValue); } @@ -4873,7 +4939,7 @@ var ts; } } function scanExtendedUnicodeEscape() { - var escapedValue = scanMinimumNumberOfHexDigits(1); + var escapedValue = scanMinimumNumberOfHexDigits(1, false); var isInvalidExtendedEscape = false; if (escapedValue < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); @@ -4912,7 +4978,7 @@ var ts; if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) { var start_1 = pos; pos += 2; - var value = scanExactNumberOfHexDigits(4); + var value = scanExactNumberOfHexDigits(4, false); pos = start_1; return value; } @@ -4960,8 +5026,26 @@ var ts; ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8"); var value = 0; var numberOfDigits = 0; + var separatorAllowed = false; + var isPreviousTokenSeparator = false; while (true) { var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; var valueOfCh = ch - 48; if (!isDigit(ch) || valueOfCh >= base) { break; @@ -4969,10 +5053,15 @@ var ts; value = value * base + valueOfCh; pos++; numberOfDigits++; + isPreviousTokenSeparator = false; } if (numberOfDigits === 0) { return -1; } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + return value; + } return value; } function scan() { @@ -5158,7 +5247,7 @@ var ts; case 48: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { pos += 2; - var value = scanMinimumNumberOfHexDigits(1); + var value = scanMinimumNumberOfHexDigits(1, true); if (value < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); value = 0; @@ -5479,7 +5568,7 @@ var ts; break; } } - tokenValue += text.substr(firstCharPosition, pos - firstCharPosition); + tokenValue += text.substring(firstCharPosition, pos); } return token; } @@ -5501,6 +5590,7 @@ var ts; startPos = pos; tokenPos = pos; var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 9: case 11: @@ -5511,55 +5601,30 @@ var ts; } return token = 5; case 64: - pos++; return token = 57; case 10: case 13: - pos++; return token = 4; case 42: - pos++; return token = 39; case 123: - pos++; return token = 17; case 125: - pos++; return token = 18; case 91: - pos++; return token = 21; case 93: - pos++; return token = 22; case 60: - pos++; return token = 27; - case 62: - pos++; - return token = 29; case 61: - pos++; return token = 58; case 44: - pos++; return token = 26; case 46: - pos++; - if (text.substr(tokenPos, pos + 2) === "...") { - pos += 2; - return token = 24; - } return token = 23; - case 33: - pos++; - return token = 51; - case 63: - pos++; - return token = 55; } if (isIdentifierStart(ch, 6)) { - pos++; while (isIdentifierPart(text.charCodeAt(pos), 6) && pos < end) { pos++; } @@ -5567,7 +5632,7 @@ var ts; return token = 71; } else { - return pos += 1, token = 0; + return token = 0; } } function speculationHelper(callback, isLookahead) { @@ -5644,8 +5709,9 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.emptyArray = []; + ts.resolvingEmptyArray = []; ts.emptyMap = ts.createMap(); + ts.emptyUnderscoreEscapedMap = ts.emptyMap; ts.externalHelpersModuleNameText = "tslib"; function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; @@ -5665,15 +5731,24 @@ var ts; var str = ""; var writeText = function (text) { return str += text; }; return { - string: function () { return str; }, + getText: function () { return str; }, + write: writeText, + rawWrite: writeText, + writeTextOfNode: writeText, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, writeSpace: writeText, writeStringLiteral: writeText, + writeLiteral: writeText, writeParameter: writeText, writeProperty: writeText, writeSymbol: writeText, + getTextPos: function () { return str.length; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, writeLine: function () { return str += " "; }, increaseIndent: ts.noop, decreaseIndent: ts.noop, @@ -5685,10 +5760,10 @@ var ts; }; } function usingSingleLineStringWriter(action) { - var oldString = stringWriter.string(); + var oldString = stringWriter.getText(); try { action(stringWriter); - return stringWriter.string(); + return stringWriter.getText(); } finally { stringWriter.clear(); @@ -5722,12 +5797,19 @@ var ts; return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && + oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; function packageIdIsEqual(a, b) { return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version; } + function packageIdToString(_a) { + var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; + var fullName = subModuleName ? name + "/" + subModuleName : name; + return fullName + "@" + version; + } + ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -5763,7 +5845,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269) { + while (node && node.kind !== 272) { node = node.parent; } return node; @@ -5771,11 +5853,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208: - case 236: - case 215: - case 216: - case 217: + case 211: + case 239: + case 218: + case 219: + case 220: return true; } return false; @@ -5851,7 +5933,7 @@ var ts; if (includeJsDoc && ts.hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0]); } - if (node.kind === 290 && node._children.length > 0) { + if (node.kind === 293 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -5898,7 +5980,7 @@ var ts; } ts.getEmitFlags = getEmitFlags; function getLiteralText(node, sourceFile) { - if (!nodeIsSynthesized(node) && node.parent) { + if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } var escapeText = getEmitFlags(node) & 16777216 ? escapeString : escapeNonAsciiString; @@ -5948,11 +6030,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 && node.parent.kind === 264; + return node.kind === 230 && node.parent.kind === 267; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 && + return node && node.kind === 237 && (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -5969,11 +6051,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node && node.kind === 234 && (!node.body); + return node && node.kind === 237 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 || - node.kind === 234 || + return node.kind === 272 || + node.kind === 237 || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -5986,9 +6068,9 @@ var ts; return false; } switch (node.parent.kind) { - case 269: + case 272: return ts.isExternalModule(node.parent); - case 235: + case 238: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -6000,22 +6082,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269: - case 236: - case 264: - case 234: - case 215: - case 216: - case 217: - case 153: - case 152: + case 272: + case 239: + case 267: + case 237: + case 218: + case 219: + case 220: case 154: + case 153: case 155: - case 229: - case 187: - case 188: + case 156: + case 232: + case 190: + case 191: return true; - case 208: + case 211: return parentNode && !ts.isFunctionLike(parentNode); } return false; @@ -6023,25 +6105,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156: case 157: - case 151: case 158: - case 161: - case 162: - case 277: - case 230: - case 200: - case 231: - case 232: - case 287: - case 229: case 152: + case 159: + case 162: + case 163: + case 280: + case 233: + case 203: + case 234: + case 235: + case 290: + case 232: case 153: case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: return true; default: ts.assertTypeIsNever(node); @@ -6051,8 +6133,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239: - case 238: + case 242: + case 241: return true; default: return false; @@ -6084,21 +6166,20 @@ var ts; case 9: case 8: return escapeLeadingUnderscores(name.text); - case 145: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144: + case 145: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180: + case 183: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -6108,6 +6189,11 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -6135,7 +6221,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208) { + if (node.body && node.body.kind === 211) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -6147,37 +6233,46 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269: + case 272: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 227: - case 177: case 230: - case 200: - case 231: - case 234: + case 180: case 233: - case 268: - case 229: - case 187: - case 152: - case 154: - case 155: + case 203: + case 234: + case 237: + case 236: + case 271: case 232: + case 190: + case 153: + case 155: + case 156: + case 235: errorNode = node.name; break; - case 188: + case 191: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -6186,7 +6281,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 && isConst(node); + return node.kind === 236 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -6199,15 +6294,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 && n.expression.kind === 97; + return n.kind === 185 && n.expression.kind === 97; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 && n.expression.kind === 91; + return n.kind === 185 && n.expression.kind === 91; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 + return node.kind === 214 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; @@ -6216,11 +6311,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 || - node.kind === 146 || - node.kind === 187 || - node.kind === 188 || - node.kind === 186) ? + var commentRanges = (node.kind === 148 || + node.kind === 147 || + node.kind === 190 || + node.kind === 191 || + node.kind === 189) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { @@ -6235,69 +6330,71 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 <= node.kind && node.kind <= 174) { + if (160 <= node.kind && node.kind <= 177) { return true; } switch (node.kind) { case 119: - case 133: - case 136: - case 122: + case 134: case 137: - case 139: - case 130: + case 122: + case 138: + case 140: + case 131: return true; case 105: - return node.parent.kind !== 191; - case 202: + return node.parent.kind !== 194; + case 205: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147: + return node.parent.kind === 176 || node.parent.kind === 171; case 71: - if (node.parent.kind === 144 && node.parent.right === node) { + if (node.parent.kind === 145 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 && node.parent.name === node) { + else if (node.parent.kind === 183 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 71 || node.kind === 144 || node.kind === 180, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 144: - case 180: + ts.Debug.assert(node.kind === 71 || node.kind === 145 || node.kind === 183, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 145: + case 183: case 99: var parent = node.parent; - if (parent.kind === 163) { + if (parent.kind === 164) { return false; } - if (159 <= parent.kind && parent.kind <= 174) { + if (160 <= parent.kind && parent.kind <= 177) { return true; } switch (parent.kind) { - case 202: + case 205: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146: - return node === parent.constraint; - case 150: - case 149: case 147: - case 227: + return node === parent.constraint; + case 151: + case 150: + case 148: + case 230: return node === parent.type; - case 229: - case 187: - case 188: + case 232: + case 190: + case 191: + case 154: case 153: case 152: - case 151: - case 154: case 155: - return node === parent.type; case 156: + return node === parent.type; case 157: case 158: + case 159: + return node === parent.type; + case 188: return node === parent.type; case 185: - return node === parent.type; - case 182: - case 183: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; - case 184: + case 186: + return ts.contains(parent.typeArguments, node); + case 187: return false; } } @@ -6318,23 +6415,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220: + case 223: return visitor(node); - case 236: - case 208: - case 212: - case 213: - case 214: + case 239: + case 211: case 215: case 216: case 217: - case 221: - case 222: - case 261: - case 262: - case 223: + case 218: + case 219: + case 220: + case 224: case 225: case 264: + case 265: + case 226: + case 228: + case 267: return ts.forEachChild(node, traverse); } } @@ -6344,25 +6441,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198: + case 201: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233: - case 231: + case 236: case 234: - case 232: - case 230: - case 200: + case 237: + case 235: + case 233: + case 203: return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145) { - traverse(name.expression); + if (node.name && node.name.kind === 146) { + traverse(node.name.expression); return; } } @@ -6374,10 +6470,10 @@ var ts; } ts.forEachYieldExpression = forEachYieldExpression; function getRestParameterElementType(node) { - if (node && node.kind === 165) { + if (node && node.kind === 166) { return node.elementType; } - else if (node && node.kind === 160) { + else if (node && node.kind === 161) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -6387,12 +6483,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231: - case 230: - case 200: - case 164: + case 234: + case 233: + case 203: + case 165: return node.members; - case 179: + case 182: return node.properties; } } @@ -6400,14 +6496,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177: + case 180: + case 271: + case 148: case 268: - case 147: - case 265: + case 151: case 150: - case 149: - case 266: - case 227: + case 269: + case 230: return true; } } @@ -6415,8 +6511,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 - && node.parent.parent.kind === 209; + return node.parent.kind === 231 + && node.parent.parent.kind === 212; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -6427,13 +6523,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 229: - case 187: + case 156: + case 232: + case 190: return true; } return false; @@ -6444,7 +6540,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223) { + if (node.statement.kind !== 226) { return node.statement; } node = node.statement; @@ -6452,17 +6548,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 && ts.isFunctionLike(node.parent); + return node && node.kind === 211 && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 && node.parent.kind === 179; + return node && node.kind === 153 && node.parent.kind === 182; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 && - (node.parent.kind === 179 || - node.parent.kind === 200); + return node.kind === 153 && + (node.parent.kind === 182 || + node.parent.kind === 203); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -6475,7 +6571,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265) { + if (property.kind === 268) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -6497,39 +6593,39 @@ var ts; return undefined; } switch (node.kind) { - case 145: + case 146: if (ts.isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 148: - if (node.parent.kind === 147 && ts.isClassElement(node.parent.parent)) { + case 149: + if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { node = node.parent; } break; - case 188: + case 191: if (!includeArrowFunctions) { continue; } - case 229: - case 187: - case 234: - case 150: - case 149: - case 152: + case 232: + case 190: + case 237: case 151: + case 150: case 153: + case 152: case 154: case 155: case 156: case 157: case 158: - case 233: - case 269: + case 159: + case 236: + case 272: return node; } } @@ -6539,9 +6635,9 @@ var ts; var container = getThisContainer(node, false); if (container) { switch (container.kind) { - case 153: - case 229: - case 187: + case 154: + case 232: + case 190: return container; } } @@ -6555,25 +6651,25 @@ var ts; return node; } switch (node.kind) { - case 145: + case 146: node = node.parent; break; - case 229: - case 187: - case 188: + case 232: + case 190: + case 191: if (!stopOnFunctions) { continue; } - case 150: - case 149: - case 152: case 151: + case 150: case 153: + case 152: case 154: case 155: + case 156: return node; - case 148: - if (node.parent.kind === 147 && ts.isClassElement(node.parent.parent)) { + case 149: + if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { @@ -6585,14 +6681,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 || func.kind === 188) { + if (func.kind === 190 || func.kind === 191) { var prev = func; var parent = func.parent; - while (parent.kind === 186) { + while (parent.kind === 189) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 && parent.expression === prev) { + if (parent.kind === 185 && parent.expression === prev) { return parent; } } @@ -6600,58 +6696,60 @@ var ts; ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 || kind === 181) + return (kind === 183 || kind === 184) && node.expression.kind === 97; } ts.isSuperProperty = isSuperProperty; function isThisProperty(node) { var kind = node.kind; - return (kind === 180 || kind === 181) + return (kind === 183 || kind === 184) && node.expression.kind === 99; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160: + case 161: return node.typeName; - case 202: + case 205: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71: - case 144: + case 145: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184) { - return node.tag; + switch (node.kind) { + case 187: + return node.tag; + case 255: + case 254: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230: + case 233: return true; - case 150: - return parent.kind === 230; - case 154: + case 151: + return parent.kind === 233; case 155: - case 152: + case 156: + case 153: return node.body !== undefined - && parent.kind === 230; - case 147: + && parent.kind === 233; + case 148: return parent.body !== undefined - && (parent.kind === 153 - || parent.kind === 152 - || parent.kind === 155) - && grandparent.kind === 230; + && (parent.kind === 154 + || parent.kind === 153 + || parent.kind === 156) + && grandparent.kind === 233; } return false; } @@ -6667,19 +6765,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230: + case 233: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152: - case 155: + case 153: + case 156: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 || - parent.kind === 251 || - parent.kind === 253) { + if (parent.kind === 255 || + parent.kind === 254 || + parent.kind === 256) { return parent.tagName === node; } return false; @@ -6692,45 +6790,45 @@ var ts; case 101: case 86: case 12: - case 178: - case 179: - case 180: case 181: case 182: case 183: case 184: - case 203: case 185: - case 204: case 186: case 187: - case 200: + case 206: case 188: - case 191: + case 207: case 189: case 190: - case 193: + case 203: + case 191: case 194: - case 195: - case 196: - case 199: - case 197: - case 13: - case 201: - case 250: - case 251: - case 254: - case 198: case 192: - case 205: + case 193: + case 196: + case 197: + case 198: + case 199: + case 202: + case 200: + case 13: + case 204: + case 253: + case 254: + case 257: + case 201: + case 195: + case 208: return true; - case 144: - while (node.parent.kind === 144) { + case 145: + while (node.parent.kind === 145) { node = node.parent; } - return node.parent.kind === 163 || isJSXTagName(node); + return node.parent.kind === 164 || isJSXTagName(node); case 71: - if (node.parent.kind === 163 || isJSXTagName(node)) { + if (node.parent.kind === 164 || isJSXTagName(node)) { return true; } case 8: @@ -6745,47 +6843,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227: - case 147: + case 230: + case 148: + case 151: case 150: - case 149: + case 271: case 268: - case 265: - case 177: + case 180: return parent.initializer === node; - case 211: - case 212: - case 213: case 214: - case 220: - case 221: - case 222: - case 261: - case 224: - return parent.expression === node; case 215: - var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228) || - forStatement.condition === node || - forStatement.incrementor === node; case 216: case 217: + case 223: + case 224: + case 225: + case 264: + case 227: + return parent.expression === node; + case 218: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 231) || + forStatement.condition === node || + forStatement.incrementor === node; + case 219: + case 220: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231) || forInStatement.expression === node; - case 185: - case 203: - return node === parent.expression; + case 188: case 206: return node === parent.expression; - case 145: + case 209: return node === parent.expression; - case 148: - case 260: - case 259: - case 267: + case 146: + return node === parent.expression; + case 149: + case 263: + case 262: + case 270: return true; - case 202: + case 205: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -6793,7 +6891,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 && node.moduleReference.kind === 249; + return node.kind === 241 && node.moduleReference.kind === 252; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -6802,7 +6900,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 && node.moduleReference.kind !== 249; + return node.kind === 241 && node.moduleReference.kind !== 252; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -6822,11 +6920,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 || node.typeArguments[0].kind === 133); + (node.typeArguments[0].kind === 137 || node.typeArguments[0].kind === 134); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182) { + if (callExpression.kind !== 185) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -6849,9 +6947,9 @@ var ts; } ts.isStringDoubleQuoted = isStringDoubleQuoted; function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227) { + if (s.valueDeclaration && s.valueDeclaration.kind === 230) { var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 || declaration.initializer.kind === 200); + return declaration.initializer && (declaration.initializer.kind === 190 || declaration.initializer.kind === 203); } return false; } @@ -6875,7 +6973,7 @@ var ts; if (!isInJavaScriptFile(expr)) { return 0; } - if (expr.operatorToken.kind !== 58 || expr.left.kind !== 180) { + if (expr.operatorToken.kind !== 58 || expr.left.kind !== 183) { return 0; } var lhs = expr.left; @@ -6894,7 +6992,7 @@ var ts; else if (lhs.expression.kind === 99) { return 4; } - else if (lhs.expression.kind === 180) { + else if (lhs.expression.kind === 183) { var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 71) { var innerPropertyAccessIdentifier = innerPropertyAccess.expression; @@ -6911,21 +7009,21 @@ var ts; ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 && + expr.parent && expr.parent.kind === 214 && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239) { + if (node.kind === 242) { return node.moduleSpecifier; } - if (node.kind === 238) { + if (node.kind === 241) { var reference = node.moduleReference; - if (reference.kind === 249) { + if (reference.kind === 252) { return reference.expression; } } - if (node.kind === 245) { + if (node.kind === 248) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -6934,31 +7032,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241) { - return importClause.namedBindings; + switch (node.kind) { + case 242: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241: + return node; + case 248: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 - && node.importClause - && !!node.importClause.name; + return node.kind === 242 && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147: + case 148: + case 153: case 152: + case 269: + case 268: case 151: - case 266: - case 265: case 150: - case 149: return node.questionToken !== undefined; } } @@ -6966,71 +7065,62 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 && + return node.kind === 280 && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; } ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getAllJSDocs(node) { - if (ts.isJSDocTypedefTag(node)) { - return [node.parent]; - } - return getJSDocCommentsAndTags(node); - } - ts.getAllJSDocs = getAllJSDocs; function getSourceOfAssignment(node) { return ts.isExpressionStatement(node) && node.expression && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 58 && node.expression.right; } - ts.getSourceOfAssignment = getSourceOfAssignment; - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151: + return node.initializer; + } } - ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement; - function getSingleVariableOfVariableStatement(node, child) { + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } - ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement; function getNestedModuleDeclaration(node) { - return node.kind === 234 && + return node.kind === 237 && node.body && - node.body.kind === 234 && + node.body.kind === 237 && node.body; } - ts.getNestedModuleDeclaration = getNestedModuleDeclaration; function getJSDocCommentsAndTags(node) { var result; getJSDocCommentsAndTagsWorker(node); return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 || parent.kind === 151 || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 || - node.kind === 180 && node.parent && node.parent.kind === 211) { + node.kind === 183 && node.parent && node.parent.kind === 214) { getJSDocCommentsAndTagsWorker(parent); } - if (node.kind === 147) { + if (node.kind === 148) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } - if (isVariableLike(node) && node.initializer && ts.hasJSDocNodes(node.initializer)) { + if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { result = ts.addRange(result, node.initializer.jsDoc); } if (ts.hasJSDocNodes(node)) { @@ -7058,7 +7148,7 @@ var ts; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -7066,7 +7156,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279); + ts.Debug.assert(node.parent.kind === 282); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -7089,30 +7179,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195: + case 198: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 ? 1 : 2 : 0; - case 193: - case 194: + case 196: + case 197: var unaryOperator = parent.operator; return unaryOperator === 43 || unaryOperator === 44 ? 2 : 0; - case 216: - case 217: + case 219: + case 220: return parent.initializer === node ? 1 : 0; - case 186: - case 178: - case 199: + case 189: + case 181: + case 202: + case 207: node = parent; break; - case 266: + case 269: if (parent.name !== node) { return 0; } node = parent.parent; break; - case 265: + case 268: if (parent.name === node) { return 0; } @@ -7129,6 +7220,29 @@ var ts; return getAssignmentTargetKind(node) !== 0; } ts.isAssignmentTarget = isAssignmentTarget; + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 211: + case 212: + case 224: + case 215: + case 225: + case 239: + case 264: + case 265: + case 226: + case 218: + case 219: + case 220: + case 216: + case 217: + case 228: + case 267: + return true; + } + return false; + } + ts.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration; function walkUp(node, kind) { while (node && node.kind === kind) { node = node.parent; @@ -7136,19 +7250,19 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169); + return walkUp(node, 172); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186); + return walkUp(node, 189); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function isDeleteTarget(node) { - if (node.kind !== 180 && node.kind !== 181) { + if (node.kind !== 183 && node.kind !== 184) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189; + return node && node.kind === 192; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -7188,49 +7302,49 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 || node.kind === 8) && - node.parent.kind === 145 && + node.parent.kind === 146 && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150: - case 149: - case 152: case 151: - case 154: + case 150: + case 153: + case 152: case 155: + case 156: + case 271: case 268: - case 265: - case 180: + case 183: return parent.name === node; - case 144: + case 145: if (parent.right === node) { - while (parent.kind === 144) { + while (parent.kind === 145) { parent = parent.parent; } - return parent.kind === 163; + return parent.kind === 164; } return false; - case 177: - case 243: + case 180: + case 246: return parent.propertyName === node; - case 247: - case 257: + case 250: + case 260: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 238 || - node.kind === 237 || - node.kind === 240 && !!node.name || - node.kind === 241 || - node.kind === 243 || - node.kind === 247 || - node.kind === 244 && exportAssignmentIsAlias(node); + return node.kind === 241 || + node.kind === 240 || + node.kind === 243 && !!node.name || + node.kind === 244 || + node.kind === 246 || + node.kind === 250 || + node.kind === 247 && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -7314,11 +7428,11 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 72 <= token && token <= 143; + return 72 <= token && token <= 144; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 117 <= token && token <= 143; + return 117 <= token && token <= 144; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -7340,13 +7454,13 @@ var ts; } var flags = 0; switch (node.kind) { - case 229: - case 187: - case 152: + case 232: + case 190: + case 153: if (node.asteriskToken) { flags |= 1; } - case 188: + case 191: if (hasModifier(node, 256)) { flags |= 2; } @@ -7360,10 +7474,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 229: - case 187: - case 188: - case 152: + case 232: + case 190: + case 191: + case 153: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256); @@ -7383,7 +7497,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 145 && + return name.kind === 146 && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -7399,7 +7513,7 @@ var ts; if (name.kind === 9 || name.kind === 8) { return escapeLeadingUnderscores(name.text); } - if (name.kind === 145) { + if (name.kind === 146) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -7441,6 +7555,10 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + function isKnownSymbol(symbol) { + return ts.startsWith(symbol.escapedName, "__@"); + } + ts.isKnownSymbol = isKnownSymbol; function isESSymbolIdentifier(node) { return node.kind === 71 && node.escapedText === "Symbol"; } @@ -7451,11 +7569,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 147; + return root.kind === 148; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 177) { + while (node.kind === 180) { node = node.parent.parent; } return node; @@ -7463,15 +7581,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 153 - || kind === 187 - || kind === 229 - || kind === 188 - || kind === 152 - || kind === 154 + return kind === 154 + || kind === 190 + || kind === 232 + || kind === 191 + || kind === 153 || kind === 155 - || kind === 234 - || kind === 269; + || kind === 156 + || kind === 237 + || kind === 272; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -7485,23 +7603,23 @@ var ts; ts.getOriginalSourceFile = getOriginalSourceFile; function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 183: + case 186: return hasArguments ? 0 : 1; - case 193: - case 190: - case 191: - case 189: - case 192: case 196: - case 198: - return 1; + case 193: + case 194: + case 192: case 195: + case 199: + case 201: + return 1; + case 198: switch (operator) { case 40: case 58: @@ -7525,15 +7643,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 195) { + if (expression.kind === 198) { return expression.operatorToken.kind; } - else if (expression.kind === 193 || expression.kind === 194) { + else if (expression.kind === 196 || expression.kind === 197) { return expression.operator; } else { @@ -7551,37 +7669,37 @@ var ts; case 86: case 8: case 9: - case 178: - case 179: - case 187: - case 188: - case 200: - case 250: - case 251: - case 254: - case 12: - case 13: - case 197: - case 186: - case 201: - return 19; - case 184: - case 180: case 181: - return 18; - case 183: - return hasArguments ? 18 : 17; case 182: - return 17; - case 194: - return 16; - case 193: case 190: case 191: + case 203: + case 253: + case 254: + case 257: + case 12: + case 13: + case 200: case 189: + case 204: + return 19; + case 187: + case 183: + case 184: + return 18; + case 186: + return hasArguments ? 18 : 17; + case 185: + return 17; + case 197: + return 16; + case 196: + case 193: + case 194: case 192: - return 15; case 195: + return 15; + case 198: switch (operatorKind) { case 51: case 52: @@ -7639,13 +7757,13 @@ var ts; default: return -1; } - case 196: - return 4; - case 198: - return 2; case 199: + return 4; + case 201: + return 2; + case 202: return 1; - case 293: + case 296: return 0; default: return -1; @@ -7654,9 +7772,9 @@ var ts; ts.getOperatorPrecedence = getOperatorPrecedence; function createDiagnosticCollection() { var nonFileDiagnostics = []; + var filesWithDiagnostics = []; var fileDiagnostics = ts.createMap(); var hasReadNonFileDiagnostics = false; - var diagnosticsModified = false; var modificationCount = 0; return { add: add, @@ -7678,6 +7796,7 @@ var ts; if (!diagnostics) { diagnostics = []; fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive); } } else { @@ -7687,39 +7806,23 @@ var ts; } diagnostics = nonFileDiagnostics; } - diagnostics.push(diagnostic); - diagnosticsModified = true; + ts.insertSorted(diagnostics, diagnostic, ts.compareDiagnostics); modificationCount++; } function getGlobalDiagnostics() { - sortAndDeduplicate(); hasReadNonFileDiagnostics = true; return nonFileDiagnostics; } function getDiagnostics(fileName) { - sortAndDeduplicate(); if (fileName) { return fileDiagnostics.get(fileName) || []; } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); + var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); }); + if (!nonFileDiagnostics.length) { + return fileDiags; } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - fileDiagnostics.forEach(function (diagnostics) { - ts.forEach(diagnostics, pushDiagnostic); - }); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - fileDiagnostics.forEach(function (diagnostics, key) { - fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); - }); + fileDiags.unshift.apply(fileDiags, nonFileDiagnostics); + return fileDiags; } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -7852,7 +7955,19 @@ var ts; getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, getText: function () { return output; }, isAtStartOfLine: function () { return lineStart; }, - reset: reset + clear: reset, + reportInaccessibleThisError: ts.noop, + reportPrivateInBaseOfClassExpression: ts.noop, + reportInaccessibleUniqueSymbolError: ts.noop, + trackSymbol: ts.noop, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: write }; } ts.createTextWriter = createTextWriter; @@ -7941,7 +8056,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 && nodeIsPresent(member.body)) { + if (member.kind === 154 && nodeIsPresent(member.body)) { return member; } }); @@ -7986,10 +8101,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154) { + if (accessor.kind === 155) { getAccessor = accessor; } - else if (accessor.kind === 155) { + else if (accessor.kind === 156) { setAccessor = accessor; } else { @@ -7998,7 +8113,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 || member.kind === 155) + if ((member.kind === 155 || member.kind === 156) && hasModifier(member, 32) === hasModifier(accessor, 32)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -8009,10 +8124,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 && !getAccessor) { + if (member.kind === 155 && !getAccessor) { getAccessor = member; } - if (member.kind === 155 && !setAccessor) { + if (member.kind === 156 && !setAccessor) { setAccessor = member; } } @@ -8028,7 +8143,7 @@ var ts; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (node.type) { + if (ts.hasType(node)) { return node.type; } if (checkJSDoc || isInJavaScriptFile(node)) { @@ -8263,7 +8378,7 @@ var ts; case 76: return 2048; case 79: return 512; case 120: return 256; - case 131: return 64; + case 132: return 64; } return 0; } @@ -8279,7 +8394,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 && + if (node.kind === 205 && node.parent.token === 85 && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -8297,8 +8412,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 179 - || kind === 178; + return kind === 182 + || kind === 181; } return false; } @@ -8308,7 +8423,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 + return node.kind === 205 && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 @@ -8318,21 +8433,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 || - node.kind === 180 && isEntityNameExpression(node.expression); + node.kind === 183 && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 && node.parent.right === node) || - (node.parent.kind === 180 && node.parent.name === node); + return (node.parent.kind === 145 && node.parent.right === node) || + (node.parent.kind === 183 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 && + return expression.kind === 182 && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 && + return expression.kind === 181 && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -8402,14 +8517,14 @@ var ts; ts.convertToBase64 = convertToBase64; var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; - function getNewLineCharacter(options, system) { + function getNewLineCharacter(options, getNewLine) { switch (options.newLine) { case 0: return carriageReturnLineFeed; case 1: return lineFeed; } - return system ? system.newLine : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; + return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; function formatEnum(value, enumObject, isFlags) { @@ -8545,8 +8660,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233: - case 234: + case 236: + case 237: return parseNode === parseNode.parent.name; } } @@ -8608,20 +8723,20 @@ var ts; if (!parent) return 0; switch (parent.kind) { - case 194: - case 193: + case 197: + case 196: var operator = parent.operator; return operator === 43 || operator === 44 ? writeOrReadWrite() : 0; - case 195: + case 198: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0; - case 180: + case 183: return parent.name !== node ? 0 : accessKind(parent); default: return 0; } function writeOrReadWrite() { - return parent.parent && parent.parent.kind === 211 ? 1 : 2; + return parent.parent && parent.parent.kind === 214 ? 1 : 2; } } function compareDataObjects(dst, src) { @@ -8705,6 +8820,14 @@ var ts; return checker.getSignaturesOfType(type, 0).length !== 0 || checker.getSignaturesOfType(type, 1).length !== 0; } ts.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures; + function forSomeAncestorDirectory(directory, callback) { + return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); + } + ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -8838,9 +8961,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146) { + if (d && d.kind === 147) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234) { return current; } } @@ -8848,7 +8971,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92) && node.parent.kind === 153 && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92) && node.parent.kind === 154 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -8866,7 +8989,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -8874,14 +8997,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227) { + if (node.kind === 230) { node = node.parent; } - if (node && node.kind === 228) { + if (node && node.kind === 231) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209) { + if (node && node.kind === 212) { flags |= ts.getModifierFlags(node); } return flags; @@ -8890,14 +9013,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227) { + if (node.kind === 230) { node = node.parent; } - if (node && node.kind === 228) { + if (node && node.kind === 231) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209) { + if (node && node.kind === 212) { flags |= node.flags; } return flags; @@ -9001,18 +9124,17 @@ var ts; return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 209: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211: + case 214: var expr = hostNode.expression; switch (expr.kind) { - case 180: + case 183: return expr.name; - case 181: + case 184: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -9021,10 +9143,10 @@ var ts; return undefined; case 1: return undefined; - case 186: { + case 189: { return getDeclarationIdentifier(hostNode.expression); } - case 223: { + case 226: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -9049,15 +9171,15 @@ var ts; switch (declaration.kind) { case 71: return declaration; - case 289: - case 284: { + case 292: + case 287: { var name = declaration.name; - if (name.kind === 144) { + if (name.kind === 145) { return name.right; } break; } - case 195: { + case 198: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1: @@ -9069,9 +9191,9 @@ var ts; return undefined; } } - case 288: + case 291: return getNameOfJSDocTypedef(declaration); - case 244: { + case 247: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -9088,27 +9210,27 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284); + return !!getFirstJSDocTag(node, 287); } ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282); + return getFirstJSDocTag(node, 285); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283); + return getFirstJSDocTag(node, 286); } ts.getJSDocClassTag = getJSDocClassTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285); + return getFirstJSDocTag(node, 288); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287); + return getFirstJSDocTag(node, 290); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getJSDocTypeTag(node) { - var tag = getFirstJSDocTag(node, 286); + var tag = getFirstJSDocTag(node, 289); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -9116,8 +9238,8 @@ var ts; } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286); - if (!tag && node.kind === 147) { + var tag = getFirstJSDocTag(node, 289); + if (!tag && node.kind === 148) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -9187,600 +9309,608 @@ var ts; } ts.isIdentifier = isIdentifier; function isQualifiedName(node) { - return node.kind === 144; + return node.kind === 145; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145; + return node.kind === 146; } ts.isComputedPropertyName = isComputedPropertyName; function isTypeParameterDeclaration(node) { - return node.kind === 146; + return node.kind === 147; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147; + return node.kind === 148; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148; + return node.kind === 149; } ts.isDecorator = isDecorator; function isPropertySignature(node) { - return node.kind === 149; + return node.kind === 150; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150; + return node.kind === 151; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151; + return node.kind === 152; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152; + return node.kind === 153; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153; + return node.kind === 154; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154; + return node.kind === 155; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155; + return node.kind === 156; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156; + return node.kind === 157; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157; + return node.kind === 158; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158; + return node.kind === 159; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; function isTypePredicateNode(node) { - return node.kind === 159; + return node.kind === 160; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160; + return node.kind === 161; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161; + return node.kind === 162; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162; + return node.kind === 163; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163; + return node.kind === 164; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164; + return node.kind === 165; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165; + return node.kind === 166; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166; + return node.kind === 167; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167; + return node.kind === 168; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168; + return node.kind === 169; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169; + return node.kind === 172; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170; + return node.kind === 173; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171; + return node.kind === 174; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172; + return node.kind === 175; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173; + return node.kind === 176; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174; + return node.kind === 177; } ts.isLiteralTypeNode = isLiteralTypeNode; function isObjectBindingPattern(node) { - return node.kind === 175; + return node.kind === 178; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176; + return node.kind === 179; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177; + return node.kind === 180; } ts.isBindingElement = isBindingElement; function isArrayLiteralExpression(node) { - return node.kind === 178; + return node.kind === 181; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179; + return node.kind === 182; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180; + return node.kind === 183; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181; + return node.kind === 184; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182; + return node.kind === 185; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183; + return node.kind === 186; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184; + return node.kind === 187; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185; + return node.kind === 188; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186; + return node.kind === 189; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292) { + while (node.kind === 295) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187; + return node.kind === 190; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188; + return node.kind === 191; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189; + return node.kind === 192; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 192; + return node.kind === 193; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191; + return node.kind === 194; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192; + return node.kind === 195; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193; + return node.kind === 196; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194; + return node.kind === 197; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195; + return node.kind === 198; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196; + return node.kind === 199; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197; + return node.kind === 200; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198; + return node.kind === 201; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199; + return node.kind === 202; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200; + return node.kind === 203; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201; + return node.kind === 204; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202; + return node.kind === 205; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203; + return node.kind === 206; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204; + return node.kind === 207; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205; + return node.kind === 208; } ts.isMetaProperty = isMetaProperty; function isTemplateSpan(node) { - return node.kind === 206; + return node.kind === 209; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207; + return node.kind === 210; } ts.isSemicolonClassElement = isSemicolonClassElement; function isBlock(node) { - return node.kind === 208; + return node.kind === 211; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209; + return node.kind === 212; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210; + return node.kind === 213; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211; + return node.kind === 214; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212; + return node.kind === 215; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213; + return node.kind === 216; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214; + return node.kind === 217; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215; + return node.kind === 218; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216; + return node.kind === 219; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217; + return node.kind === 220; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218; + return node.kind === 221; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219; + return node.kind === 222; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 || node.kind === 218; + return node.kind === 222 || node.kind === 221; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220; + return node.kind === 223; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221; + return node.kind === 224; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222; + return node.kind === 225; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223; + return node.kind === 226; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224; + return node.kind === 227; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225; + return node.kind === 228; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226; + return node.kind === 229; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227; + return node.kind === 230; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228; + return node.kind === 231; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229; + return node.kind === 232; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230; + return node.kind === 233; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231; + return node.kind === 234; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232; + return node.kind === 235; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233; + return node.kind === 236; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234; + return node.kind === 237; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235; + return node.kind === 238; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236; + return node.kind === 239; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237; + return node.kind === 240; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238; + return node.kind === 241; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239; + return node.kind === 242; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240; + return node.kind === 243; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241; + return node.kind === 244; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242; + return node.kind === 245; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243; + return node.kind === 246; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244; + return node.kind === 247; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245; + return node.kind === 248; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246; + return node.kind === 249; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247; + return node.kind === 250; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248; + return node.kind === 251; } ts.isMissingDeclaration = isMissingDeclaration; function isExternalModuleReference(node) { - return node.kind === 249; + return node.kind === 252; } ts.isExternalModuleReference = isExternalModuleReference; function isJsxElement(node) { - return node.kind === 250; + return node.kind === 253; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251; + return node.kind === 254; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252; + return node.kind === 255; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253; + return node.kind === 256; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254; + return node.kind === 257; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255; + return node.kind === 258; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256; + return node.kind === 259; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257; + return node.kind === 260; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258; + return node.kind === 261; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259; + return node.kind === 262; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260; + return node.kind === 263; } ts.isJsxExpression = isJsxExpression; function isCaseClause(node) { - return node.kind === 261; + return node.kind === 264; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262; + return node.kind === 265; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263; + return node.kind === 266; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264; + return node.kind === 267; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 265; + return node.kind === 268; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266; + return node.kind === 269; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267; + return node.kind === 270; } ts.isSpreadAssignment = isSpreadAssignment; function isEnumMember(node) { - return node.kind === 268; + return node.kind === 271; } ts.isEnumMember = isEnumMember; function isSourceFile(node) { - return node.kind === 269; + return node.kind === 272; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270; + return node.kind === 273; } ts.isBundle = isBundle; function isJSDocTypeExpression(node) { - return node.kind === 271; + return node.kind === 274; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272; + return node.kind === 275; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273; + return node.kind === 276; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274; + return node.kind === 277; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275; + return node.kind === 278; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276; + return node.kind === 279; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277; + return node.kind === 280; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278; + return node.kind === 281; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279; + return node.kind === 282; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282; + return node.kind === 285; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284; + return node.kind === 287; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285; + return node.kind === 288; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286; + return node.kind === 289; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287; + return node.kind === 290; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288; + return node.kind === 291; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289; + return node.kind === 292; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 || node.kind === 284; + return node.kind === 292 || node.kind === 287; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280; + return node.kind === 283; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); (function (ts) { function isSyntaxList(n) { - return n.kind === 290; + return n.kind === 293; } ts.isSyntaxList = isSyntaxList; function isNode(node) { @@ -9788,11 +9918,11 @@ var ts; } ts.isNode = isNode; function isNodeKind(kind) { - return kind >= 144; + return kind >= 145; } ts.isNodeKind = isNodeKind; function isToken(n) { - return n.kind >= 0 && n.kind <= 143; + return n.kind >= 0 && n.kind <= 144; } ts.isToken = isToken; function isNodeArray(array) { @@ -9822,7 +9952,7 @@ var ts; } ts.isStringTextContainingNode = isStringTextContainingNode; function isGeneratedIdentifier(node) { - return ts.isIdentifier(node) && node.autoGenerateKind > 0; + return ts.isIdentifier(node) && (node.autoGenerateFlags & 7) > 0; } ts.isGeneratedIdentifier = isGeneratedIdentifier; function isModifierKind(token) { @@ -9836,7 +9966,7 @@ var ts; case 114: case 112: case 113: - case 131: + case 132: case 115: return true; } @@ -9849,7 +9979,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 + return kind === 145 || kind === 71; } ts.isEntityName = isEntityName; @@ -9858,14 +9988,14 @@ var ts; return kind === 71 || kind === 9 || kind === 8 - || kind === 145; + || kind === 146; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 - || kind === 175 - || kind === 176; + || kind === 178 + || kind === 179; } ts.isBindingName = isBindingName; function isFunctionLike(node) { @@ -9878,13 +10008,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229: - case 152: + case 232: case 153: case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: return true; default: return false; @@ -9892,13 +10022,13 @@ var ts; } function isFunctionLikeKind(kind) { switch (kind) { - case 151: - case 156: + case 152: case 157: case 158: - case 161: - case 277: + case 159: case 162: + case 280: + case 163: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -9911,66 +10041,77 @@ var ts; ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock; function isClassElement(node) { var kind = node.kind; - return kind === 153 - || kind === 150 - || kind === 152 - || kind === 154 + return kind === 154 + || kind === 151 + || kind === 153 || kind === 155 - || kind === 158 - || kind === 207 - || kind === 248; + || kind === 156 + || kind === 159 + || kind === 210 + || kind === 251; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 || node.kind === 200); + return node && (node.kind === 233 || node.kind === 203); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 || node.kind === 155); + return node && (node.kind === 155 || node.kind === 156); } ts.isAccessor = isAccessor; + function isMethodOrAccessor(node) { + switch (node.kind) { + case 153: + case 155: + case 156: + return true; + default: + return false; + } + } + ts.isMethodOrAccessor = isMethodOrAccessor; function isTypeElement(node) { var kind = node.kind; - return kind === 157 - || kind === 156 - || kind === 149 - || kind === 151 - || kind === 158 - || kind === 248; + return kind === 158 + || kind === 157 + || kind === 150 + || kind === 152 + || kind === 159 + || kind === 251; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 - || kind === 266 - || kind === 267 - || kind === 152 - || kind === 154 + return kind === 268 + || kind === 269 + || kind === 270 + || kind === 153 || kind === 155 - || kind === 248; + || kind === 156 + || kind === 251; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNodeKind(kind) { - return (kind >= 159 && kind <= 174) + return (kind >= 160 && kind <= 177) || kind === 119 - || kind === 133 || kind === 134 + || kind === 135 || kind === 122 - || kind === 136 || kind === 137 + || kind === 138 || kind === 99 || kind === 105 - || kind === 139 + || kind === 140 || kind === 95 - || kind === 130 - || kind === 202 - || kind === 272 - || kind === 273 - || kind === 274 + || kind === 131 + || kind === 205 || kind === 275 || kind === 276 || kind === 277 - || kind === 278; + || kind === 278 + || kind === 279 + || kind === 280 + || kind === 281; } function isTypeNode(node) { return isTypeNodeKind(node.kind); @@ -9978,8 +10119,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161: case 162: + case 163: return true; } return false; @@ -9988,29 +10129,29 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 - || kind === 175; + return kind === 179 + || kind === 178; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 - || kind === 179; + return kind === 181 + || kind === 182; } ts.isAssignmentPattern = isAssignmentPattern; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 - || kind === 201; + return kind === 180 + || kind === 204; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227: - case 147: - case 177: + case 230: + case 148: + case 180: return true; } return false; @@ -10023,8 +10164,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175: - case 179: + case 178: + case 182: return true; } return false; @@ -10032,8 +10173,8 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176: - case 178: + case 179: + case 181: return true; } return false; @@ -10041,18 +10182,18 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 - || kind === 144; + return kind === 183 + || kind === 145; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252: - case 251: - case 182: - case 183: - case 184: - case 148: + case 255: + case 254: + case 185: + case 186: + case 187: + case 149: return true; default: return false; @@ -10060,12 +10201,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 || node.kind === 183; + return node.kind === 185 || node.kind === 186; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 + return kind === 200 || kind === 13; } ts.isTemplateLiteral = isTemplateLiteral; @@ -10075,32 +10216,32 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180: - case 181: case 183: - case 182: - case 250: - case 251: - case 254: case 184: - case 178: case 186: - case 179: - case 200: + case 185: + case 253: + case 254: + case 257: case 187: + case 181: + case 189: + case 182: + case 203: + case 190: case 71: case 12: case 8: case 9: case 13: - case 197: + case 200: case 86: case 95: case 99: case 101: case 97: - case 204: - case 205: + case 207: + case 208: case 91: return true; default: @@ -10113,13 +10254,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { + case 196: + case 197: + case 192: case 193: case 194: - case 189: - case 190: - case 191: - case 192: - case 185: + case 195: + case 188: return true; default: return isLeftHandSideExpressionKind(kind); @@ -10127,9 +10268,9 @@ var ts; } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194: + case 197: return true; - case 193: + case 196: return expr.operator === 43 || expr.operator === 44; default: @@ -10143,15 +10284,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196: - case 198: - case 188: - case 195: case 199: - case 203: case 201: - case 293: - case 292: + case 191: + case 198: + case 202: + case 206: + case 204: + case 296: + case 295: return true; default: return isUnaryExpressionKind(kind); @@ -10159,16 +10300,16 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 - || kind === 203; + return kind === 188 + || kind === 206; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 292; + return node.kind === 295; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 291; + return node.kind === 294; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -10178,20 +10319,20 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215: + case 218: + case 219: + case 220: case 216: case 217: - case 213: - case 214: return true; - case 223: + case 226: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isForInOrOfStatement(node) { - return node.kind === 216 || node.kind === 217; + return node.kind === 219 || node.kind === 220; } ts.isForInOrOfStatement = isForInOrOfStatement; function isConciseBody(node) { @@ -10210,106 +10351,106 @@ var ts; ts.isForInitializer = isForInitializer; function isModuleBody(node) { var kind = node.kind; - return kind === 235 - || kind === 234 + return kind === 238 + || kind === 237 || kind === 71; } ts.isModuleBody = isModuleBody; function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 - || kind === 234; + return kind === 238 + || kind === 237; } ts.isNamespaceBody = isNamespaceBody; function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 - || kind === 234; + || kind === 237; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 - || kind === 241; + return kind === 245 + || kind === 244; } ts.isNamedImportBindings = isNamedImportBindings; function isModuleOrEnumDeclaration(node) { - return node.kind === 234 || node.kind === 233; + return node.kind === 237 || node.kind === 236; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 - || kind === 177 - || kind === 230 - || kind === 200 - || kind === 153 + return kind === 191 + || kind === 180 || kind === 233 - || kind === 268 - || kind === 247 - || kind === 229 - || kind === 187 + || kind === 203 || kind === 154 - || kind === 240 - || kind === 238 - || kind === 243 - || kind === 231 - || kind === 257 - || kind === 152 - || kind === 151 - || kind === 234 - || kind === 237 - || kind === 241 - || kind === 147 - || kind === 265 - || kind === 150 - || kind === 149 - || kind === 155 - || kind === 266 + || kind === 236 + || kind === 271 + || kind === 250 || kind === 232 - || kind === 146 - || kind === 227 - || kind === 288; + || kind === 190 + || kind === 155 + || kind === 243 + || kind === 241 + || kind === 246 + || kind === 234 + || kind === 260 + || kind === 153 + || kind === 152 + || kind === 237 + || kind === 240 + || kind === 244 + || kind === 148 + || kind === 268 + || kind === 151 + || kind === 150 + || kind === 156 + || kind === 269 + || kind === 235 + || kind === 147 + || kind === 230 + || kind === 291; } function isDeclarationStatementKind(kind) { - return kind === 229 - || kind === 248 - || kind === 230 - || kind === 231 - || kind === 232 + return kind === 232 + || kind === 251 || kind === 233 || kind === 234 - || kind === 239 - || kind === 238 - || kind === 245 - || kind === 244 - || kind === 237; + || kind === 235 + || kind === 236 + || kind === 237 + || kind === 242 + || kind === 241 + || kind === 248 + || kind === 247 + || kind === 240; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 - || kind === 218 - || kind === 226 - || kind === 213 - || kind === 211 - || kind === 210 - || kind === 216 - || kind === 217 - || kind === 215 - || kind === 212 - || kind === 223 - || kind === 220 - || kind === 222 - || kind === 224 - || kind === 225 - || kind === 209 - || kind === 214 + return kind === 222 || kind === 221 - || kind === 291 - || kind === 295 - || kind === 294; + || kind === 229 + || kind === 216 + || kind === 214 + || kind === 213 + || kind === 219 + || kind === 220 + || kind === 218 + || kind === 215 + || kind === 226 + || kind === 223 + || kind === 225 + || kind === 227 + || kind === 228 + || kind === 212 + || kind === 217 + || kind === 224 + || kind === 294 + || kind === 298 + || kind === 297; } function isDeclaration(node) { - if (node.kind === 146) { - return node.parent.kind !== 287 || ts.isInJavaScriptFile(node); + if (node.kind === 147) { + return node.parent.kind !== 290 || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -10330,10 +10471,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208) + if (node.kind !== 211) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 || node.parent.kind === 264) { + if (node.parent.kind === 228 || node.parent.kind === 267) { return false; } } @@ -10341,8 +10482,8 @@ var ts; } function isModuleReference(node) { var kind = node.kind; - return kind === 249 - || kind === 144 + return kind === 252 + || kind === 145 || kind === 71; } ts.isModuleReference = isModuleReference; @@ -10350,66 +10491,101 @@ var ts; var kind = node.kind; return kind === 99 || kind === 71 - || kind === 180; + || kind === 183; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 250 - || kind === 260 - || kind === 251 + return kind === 253 + || kind === 263 + || kind === 254 || kind === 10 - || kind === 254; + || kind === 257; } ts.isJsxChild = isJsxChild; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 - || kind === 259; + return kind === 260 + || kind === 262; } ts.isJsxAttributeLike = isJsxAttributeLike; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 - || kind === 260; + || kind === 263; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 - || kind === 251; + return kind === 255 + || kind === 254; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 - || kind === 262; + return kind === 264 + || kind === 265; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isJSDocNode(node) { - return node.kind >= 271 && node.kind <= 289; + return node.kind >= 274 && node.kind <= 292; } ts.isJSDocNode = isJSDocNode; function isJSDocCommentContainingNode(node) { - return node.kind === 279 || isJSDocTag(node); + return node.kind === 282 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; function isJSDocTag(node) { - return node.kind >= 281 && node.kind <= 289; + return node.kind >= 284 && node.kind <= 292; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155; + return node.kind === 156; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154; + return node.kind === 155; } ts.isGetAccessor = isGetAccessor; function hasJSDocNodes(node) { return !!node.jsDoc && node.jsDoc.length > 0; } ts.hasJSDocNodes = hasJSDocNodes; + function hasType(node) { + return !!node.type; + } + ts.hasType = hasType; + function hasInitializer(node) { + return !!node.initializer; + } + ts.hasInitializer = hasInitializer; + function hasOnlyExpressionInitializer(node) { + return hasInitializer(node) && !ts.isForStatement(node) && !ts.isForInStatement(node) && !ts.isForOfStatement(node) && !ts.isJsxAttribute(node); + } + ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; + function isObjectLiteralElement(node) { + switch (node.kind) { + case 260: + case 262: + case 268: + case 269: + case 153: + case 155: + case 156: + return true; + default: + return false; + } + } + ts.isObjectLiteralElement = isObjectLiteralElement; + function isTypeReferenceType(node) { + return node.kind === 161 || node.kind === 205; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 || node.kind === 13; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -10418,7 +10594,7 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 269) { + if (kind === 272) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71) { @@ -10450,60 +10626,88 @@ var ts; } } function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143) { + if (!node || node.kind <= 144) { return; } switch (node.kind) { - case 144: + case 145: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146: + case 147: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266: + case 269: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267: + case 270: return visitNode(cbNode, node.expression); - case 147: - case 150: - case 149: - case 265: - case 227: - case 177: + case 148: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 151: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 161: + case 150: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 268: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.initializer); + case 230: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.exclamationToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 180: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 162: - case 156: + case 163: case 157: case 158: + case 159: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 187: - case 229: - case 188: + case 156: + case 190: + case 232: + case 191: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -10514,291 +10718,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160: + case 161: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159: + case 160: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163: - return visitNode(cbNode, node.exprName); case 164: - return visitNodes(cbNode, cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 165: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNode, cbNodes, node.members); case 166: - return visitNodes(cbNode, cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 167: + return visitNodes(cbNode, cbNodes, node.elementTypes); case 168: - return visitNodes(cbNode, cbNodes, node.types); case 169: + return visitNodes(cbNode, cbNodes, node.types); + case 170: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); case 171: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.typeParameter); case 172: + case 174: + return visitNode(cbNode, node.type); + case 175: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173: + case 176: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174: + case 177: return visitNode(cbNode, node.literal); - case 175: - case 176: - return visitNodes(cbNode, cbNodes, node.elements); case 178: - return visitNodes(cbNode, cbNodes, node.elements); case 179: + return visitNodes(cbNode, cbNodes, node.elements); + case 181: + return visitNodes(cbNode, cbNodes, node.elements); + case 182: return visitNodes(cbNode, cbNodes, node.properties); - case 180: + case 183: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181: + case 184: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182: - case 183: + case 185: + case 186: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184: + case 187: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185: + case 188: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186: - return visitNode(cbNode, node.expression); case 189: return visitNode(cbNode, node.expression); - case 190: - return visitNode(cbNode, node.expression); - case 191: - return visitNode(cbNode, node.expression); - case 193: - return visitNode(cbNode, node.operand); - case 198: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 192: return visitNode(cbNode, node.expression); + case 193: + return visitNode(cbNode, node.expression); case 194: + return visitNode(cbNode, node.expression); + case 196: return visitNode(cbNode, node.operand); + case 201: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); case 195: + return visitNode(cbNode, node.expression); + case 197: + return visitNode(cbNode, node.operand); + case 198: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203: + case 206: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204: + case 207: return visitNode(cbNode, node.expression); - case 205: + case 208: return visitNode(cbNode, node.name); - case 196: + case 199: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199: + case 202: return visitNode(cbNode, node.expression); - case 208: - case 235: + case 211: + case 238: return visitNodes(cbNode, cbNodes, node.statements); - case 269: + case 272: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209: + case 212: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228: + case 231: return visitNodes(cbNode, cbNodes, node.declarations); - case 211: + case 214: return visitNode(cbNode, node.expression); - case 212: + case 215: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213: + case 216: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214: + case 217: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215: + case 218: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216: + case 219: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217: + case 220: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218: - case 219: - return visitNode(cbNode, node.label); - case 220: - return visitNode(cbNode, node.expression); case 221: + case 222: + return visitNode(cbNode, node.label); + case 223: + return visitNode(cbNode, node.expression); + case 224: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222: + case 225: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236: + case 239: return visitNodes(cbNode, cbNodes, node.clauses); - case 261: + case 264: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262: + case 265: return visitNodes(cbNode, cbNodes, node.statements); - case 223: + case 226: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224: + case 227: return visitNode(cbNode, node.expression); - case 225: + case 228: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264: + case 267: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148: + case 149: return visitNode(cbNode, node.expression); - case 230: - case 200: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); - case 231: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); - case 232: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); case 233: + case 203: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 268: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 234: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || + visitNodes(cbNode, cbNodes, node.members); + case 235: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 236: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.members); + case 271: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 237: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238: + case 241: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239: + case 242: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240: + case 243: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237: + case 240: return visitNode(cbNode, node.name); - case 241: + case 244: return visitNode(cbNode, node.name); - case 242: - case 246: - return visitNodes(cbNode, cbNodes, node.elements); case 245: + case 249: + return visitNodes(cbNode, cbNodes, node.elements); + case 248: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243: - case 247: + case 246: + case 250: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244: + case 247: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197: + case 200: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206: + case 209: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145: + case 146: return visitNode(cbNode, node.expression); - case 263: + case 266: return visitNodes(cbNode, cbNodes, node.types); - case 202: + case 205: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249: + case 252: return visitNode(cbNode, node.expression); - case 248: + case 251: return visitNodes(cbNode, cbNodes, node.decorators); - case 293: + case 296: return visitNodes(cbNode, cbNodes, node.elements); - case 250: + case 253: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254: + case 257: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251: - case 252: + case 254: + case 255: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258: + case 261: return visitNodes(cbNode, cbNodes, node.properties); - case 257: + case 260: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259: + case 262: return visitNode(cbNode, node.expression); - case 260: + case 263: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253: + case 256: return visitNode(cbNode, node.tagName); - case 271: - return visitNode(cbNode, node.type); - case 275: - return visitNode(cbNode, node.type); case 274: return visitNode(cbNode, node.type); - case 276: - return visitNode(cbNode, node.type); - case 277: - return visitNodes(cbNode, cbNodes, node.parameters) || - visitNode(cbNode, node.type); case 278: return visitNode(cbNode, node.type); + case 277: + return visitNode(cbNode, node.type); case 279: + return visitNode(cbNode, node.type); + case 280: + return visitNodes(cbNode, cbNodes, node.parameters) || + visitNode(cbNode, node.type); + case 281: + return visitNode(cbNode, node.type); + case 282: return visitNodes(cbNode, cbNodes, node.tags); - case 284: - case 289: + case 287: + case 292: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -10807,17 +11018,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285: - return visitNode(cbNode, node.typeExpression); - case 286: - return visitNode(cbNode, node.typeExpression); - case 282: - return visitNode(cbNode, node.class); - case 287: - return visitNodes(cbNode, cbNodes, node.typeParameters); case 288: + return visitNode(cbNode, node.typeExpression); + case 289: + return visitNode(cbNode, node.typeExpression); + case 285: + return visitNode(cbNode, node.class); + case 290: + return visitNodes(cbNode, cbNodes, node.typeParameters); + case 291: if (node.typeExpression && - node.typeExpression.kind === 271) { + node.typeExpression.kind === 274) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -10825,7 +11036,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280: + case 283: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -10833,7 +11044,7 @@ var ts; } } return; - case 292: + case 295: return visitNode(cbNode, node.expression); } } @@ -10924,7 +11135,7 @@ var ts; else if (token() === 17 || lookAhead(function () { return token() === 9; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1, false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1, ts.Diagnostics.Unexpected_token); } else { parseExpected(17); @@ -11001,15 +11212,7 @@ var ts; if (comments) { for (var _i = 0, comments_2 = comments; _i < comments_2.length; _i++) { var comment = comments_2[_i]; - var jsDoc = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDoc) { - if (!node.jsDoc) { - node.jsDoc = [jsDoc]; - } - else { - node.jsDoc.push(jsDoc); - } - } + node.jsDoc = ts.append(node.jsDoc, JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); } } return node; @@ -11038,7 +11241,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { - var sourceFile = new SourceFileConstructor(269, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(272, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -11231,9 +11434,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -11352,7 +11555,7 @@ var ts; return parsePropertyNameWorker(true); } function parseComputedPropertyName() { - var node = createNode(145); + var node = createNode(146); parseExpected(21); node.expression = allowInAnd(parseExpression); parseExpected(22); @@ -11445,9 +11648,12 @@ var ts; return token() === 26 || token() === 24 || isIdentifierOrPattern(); case 18: return isIdentifier(); - case 11: case 15: - return token() === 26 || token() === 24 || isStartOfExpression(); + if (token() === 26) { + return true; + } + case 11: + return token() === 24 || isStartOfExpression(); case 16: return isStartOfParameter(); case 19: @@ -11495,6 +11701,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } function isListTerminator(kind) { if (token() === 1) { return true; @@ -11607,6 +11817,9 @@ var ts; if (!canReuseNode(node, parsingContext)) { return undefined; } + if (node.jsDocCache) { + node.jsDocCache = undefined; + } return node; } function consumeNode(node) { @@ -11649,14 +11862,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153: - case 158: case 154: + case 159: case 155: - case 150: - case 207: + case 156: + case 151: + case 210: return true; - case 152: + case 153: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 71 && methodDeclaration.name.originalKeywordKind === 123; @@ -11668,8 +11881,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261: - case 262: + case 264: + case 265: return true; } } @@ -11678,65 +11891,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229: - case 209: - case 208: + case 232: case 212: case 211: - case 224: - case 220: - case 222: - case 219: - case 218: - case 216: - case 217: case 215: case 214: - case 221: - case 210: - case 225: + case 227: case 223: + case 225: + case 222: + case 221: + case 219: + case 220: + case 218: + case 217: + case 224: case 213: + case 228: case 226: - case 239: - case 238: - case 245: - case 244: - case 234: - case 230: - case 231: + case 216: + case 229: + case 242: + case 241: + case 248: + case 247: + case 237: case 233: - case 232: + case 234: + case 236: + case 235: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268; + return node.kind === 271; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157: - case 151: case 158: - case 149: - case 156: + case 152: + case 159: + case 150: + case 157: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227) { + if (node.kind !== 230) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147) { + if (node.kind !== 148) { return false; } var parameter = node; @@ -11843,7 +12056,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144, entity.pos); + var node = createNode(145, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -11858,7 +12071,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197); + var template = createNode(200); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14, "Template head has wrong token kind"); var list = []; @@ -11870,7 +12083,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206); + var span = createNode(209); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18) { @@ -11878,7 +12091,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16, false, ts.Diagnostics._0_expected, ts.tokenToString(18)); + literal = parseExpectedToken(16, ts.Diagnostics._0_expected, ts.tokenToString(18)); } span.literal = literal; return finishNode(span); @@ -11907,14 +12120,14 @@ var ts; node.isUnterminated = true; } if (node.kind === 8) { - node.numericLiteralFlags = scanner.getTokenFlags() & 496; + node.numericLiteralFlags = scanner.getTokenFlags() & 1008; } nextToken(); finishNode(node); return node; } function parseTypeReference() { - var node = createNode(160); + var node = createNode(161); node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27) { node.typeArguments = parseBracketedList(19, parseType, 27, 29); @@ -11923,18 +12136,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159, lhs.pos); + var node = createNode(160, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170); + var node = createNode(173); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272); + var result = createNode(275); nextToken(); return finishNode(result); } @@ -11947,28 +12160,28 @@ var ts; token() === 29 || token() === 58 || token() === 49) { - var result = createNode(273, pos); + var result = createNode(276, pos); return finishNode(result); } else { - var result = createNode(274, pos); + var result = createNode(277, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277); + var result = createNodeWithJSDoc(280); nextToken(); fillSignature(56, 4 | 32, result); return finishNode(result); } - var node = createNode(160); + var node = createNode(161); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147); + var parameter = createNode(148); if (token() === 99 || token() === 94) { parameter.name = parseIdentifierName(); parseExpected(56); @@ -11983,13 +12196,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163); + var node = createNode(164); parseExpected(103); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146); + var node = createNode(147); node.name = parseIdentifier(); if (parseOptional(85)) { if (isStartOfType() || !isStartOfExpression()) { @@ -12023,7 +12236,7 @@ var ts; isStartOfType(true); } function parseParameter() { - var node = createNodeWithJSDoc(147); + var node = createNodeWithJSDoc(148); if (token() === 99) { node.name = createIdentifier(true); node.type = parseParameterType(); @@ -12090,7 +12303,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157) { + if (kind === 158) { parseExpected(94); } fillSignature(56, 4, node); @@ -12127,7 +12340,7 @@ var ts; return token() === 56 || token() === 26 || token() === 22; } function parseIndexSignatureDeclaration(node) { - node.kind = 158; + node.kind = 159; node.parameters = parseBracketedList(16, parseParameter, 21, 22); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -12137,11 +12350,11 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55); if (token() === 19 || token() === 27) { - node.kind = 151; + node.kind = 152; fillSignature(56, 4, node); } else { - node.kind = 149; + node.kind = 150; node.type = parseTypeAnnotation(); if (token() === 58) { node.initializer = parseInitializer(); @@ -12178,10 +12391,10 @@ var ts; } function parseTypeMember() { if (token() === 19 || token() === 27) { - return parseSignatureMember(156); + return parseSignatureMember(157); } if (token() === 94 && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157); + return parseSignatureMember(158); } var node = createNodeWithJSDoc(0); node.modifiers = parseModifiers(); @@ -12195,7 +12408,7 @@ var ts; return token() === 19 || token() === 27; } function parseTypeLiteral() { - var node = createNode(164); + var node = createNode(165); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -12212,38 +12425,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131) { + if (token() === 37 || token() === 38) { + return nextToken() === 132; + } + if (token() === 132) { nextToken(); } return token() === 21 && nextTokenIsIdentifier() && nextToken() === 92; } function parseMappedTypeParameter() { - var node = createNode(146); + var node = createNode(147); node.name = parseIdentifier(); parseExpected(92); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173); + var node = createNode(176); parseExpected(17); - node.readonlyToken = parseOptionalToken(131); + if (token() === 132 || token() === 37 || token() === 38) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132) { + parseExpectedToken(132); + } + } parseExpected(21); node.typeParameter = parseMappedTypeParameter(); parseExpected(22); - node.questionToken = parseOptionalToken(55); + if (token() === 55 || token() === 37 || token() === 38) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55) { + parseExpectedToken(55); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18); return finishNode(node); } function parseTupleType() { - var node = createNode(166); + var node = createNode(167); node.elementTypes = parseBracketedList(20, parseType, 21, 22); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169); + var node = createNode(172); parseExpected(19); node.type = parseType(); parseExpected(20); @@ -12251,7 +12477,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162) { + if (kind === 163) { parseExpected(94); } fillSignature(36, 4, node); @@ -12262,10 +12488,10 @@ var ts; return token() === 23 ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174); + var node = createNode(177); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193); + unaryMinusExpression = createNode(196); unaryMinusExpression.operator = 38; nextToken(); } @@ -12286,13 +12512,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119: - case 136: - case 133: case 137: - case 122: - case 139: - case 130: case 134: + case 138: + case 122: + case 140: + case 131: + case 135: return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39: return parseJSDocAllType(); @@ -12301,7 +12527,7 @@ var ts; case 89: return parseJSDocFunctionType(); case 51: - return parseJSDocNodeWithType(275); + return parseJSDocNodeWithType(278); case 13: case 9: case 8: @@ -12315,7 +12541,7 @@ var ts; return parseTokenNode(); case 99: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -12337,17 +12563,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119: - case 136: - case 133: - case 122: case 137: - case 140: + case 134: + case 122: + case 138: + case 141: case 105: - case 139: + case 140: case 95: case 99: case 103: - case 130: + case 131: case 17: case 21: case 27: @@ -12358,11 +12584,12 @@ var ts; case 8: case 101: case 86: - case 134: + case 135: case 39: case 55: case 51: case 24: + case 126: return true; case 38: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -12384,25 +12611,28 @@ var ts; if (!(contextFlags & 1048576)) { return type; } - type = createJSDocPostfixType(276, type); + type = createJSDocPostfixType(279, type); break; case 51: - type = createJSDocPostfixType(275, type); + type = createJSDocPostfixType(278, type); break; case 55: - type = createJSDocPostfixType(274, type); + if (!(contextFlags & 1048576) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277, type); break; case 21: parseExpected(21); if (isStartOfType()) { - var node = createNode(172, type.pos); + var node = createNode(175, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22); type = finishNode(node); } else { - var node = createNode(165, type.pos); + var node = createNode(166, type.pos); node.elementType = type; parseExpected(22); type = finishNode(node); @@ -12421,20 +12651,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171); + var node = createNode(174); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171); + parseExpected(126); + var typeParameter = createNode(147); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127: - case 140: + case 128: + case 141: return parseTypeOperator(operator); + case 126: + return parseInferType(); case 24: { - var result = createNode(278); + var result = createNode(281); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -12457,10 +12697,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168, parseTypeOperatorOrHigher, 48); + return parseUnionOrIntersectionType(169, parseTypeOperatorOrHigher, 48); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167, parseIntersectionTypeOrHigher, 49); + return parseUnionOrIntersectionType(168, parseIntersectionTypeOrHigher, 49); } function isStartOfFunctionType() { if (token() === 27) { @@ -12506,7 +12746,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159, typePredicateVariable.pos); + var node = createNode(160, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -12517,7 +12757,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -12525,14 +12765,25 @@ var ts; function parseType() { return doOutsideOfContext(20480, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161); - } - if (token() === 94) { return parseFunctionOrConstructorType(162); } - return parseUnionTypeOrHigher(); + if (token() === 94) { + return parseFunctionOrConstructorType(163); + } + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) { + var node = createNode(170, type.pos); + node.checkType = type; + node.extendsType = parseTypeWorker(true); + parseExpected(55); + node.trueType = parseTypeWorker(); + parseExpected(56); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56) ? parseType() : undefined; @@ -12645,7 +12896,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198); + var node = createNode(201); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 39 || isStartOfExpression())) { @@ -12661,17 +12912,17 @@ var ts; ts.Debug.assert(token() === 36, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188, asyncModifier.pos); + node = createNode(191, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188, identifier.pos); + node = createNode(191, identifier.pos); } - var parameter = createNode(147, identifier.pos); + var parameter = createNode(148, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36); node.body = parseArrowFunctionExpressionBody(!!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -12688,7 +12939,7 @@ var ts; } var isAsync = ts.hasModifier(arrowFunction, 256); var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36); arrowFunction.body = (lastToken === 36 || lastToken === 17) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -12813,7 +13064,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188); + var node = createNodeWithJSDoc(191); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256) ? 2 : 0; fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node); @@ -12845,12 +13096,14 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(196, leftOperand.pos); + var node = createNode(199, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56, false, ts.Diagnostics._0_expected, ts.tokenToString(56)); - node.whenFalse = parseAssignmentExpressionOrHigher(); + node.colonToken = parseExpectedToken(56); + node.whenFalse = ts.nodeIsPresent(node.colonToken) + ? parseAssignmentExpressionOrHigher() + : createMissingNode(71, false, ts.Diagnostics._0_expected, ts.tokenToString(56)); return finishNode(node); } function parseBinaryExpressionOrHigher(precedence) { @@ -12858,7 +13111,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 || t === 143; + return t === 92 || t === 144; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -12936,39 +13189,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195, left.pos); + var node = createNode(198, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203, left.pos); + var node = createNode(206, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193); + var node = createNode(196); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189); + var node = createNode(192); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190); + var node = createNode(193); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191); + var node = createNode(194); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -12983,7 +13236,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192); + var node = createNode(195); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -12999,7 +13252,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185) { + if (simpleUnaryExpression.kind === 188) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -13052,7 +13305,7 @@ var ts; } function parseUpdateExpression() { if (token() === 43 || token() === 44) { - var node = createNode(193); + var node = createNode(196); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -13064,7 +13317,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 || token() === 44) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194, expression.pos); + var node = createNode(197, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -13092,9 +13345,9 @@ var ts; if (token() === 19 || token() === 23 || token() === 21) { return expression; } - var node = createNode(180, expression.pos); + var node = createNode(183, expression.pos); node.expression = expression; - parseExpectedToken(23, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } @@ -13114,8 +13367,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252) { - var node = createNode(250, opening.pos); + if (opening.kind === 255) { + var node = createNode(253, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -13124,22 +13377,22 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255) { - var node = createNode(254, opening.pos); + else if (opening.kind === 258) { + var node = createNode(257, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251); + ts.Debug.assert(opening.kind === 254); result = opening; } if (inExpressionContext && token() === 27) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195, result.pos); + var badNode = createNode(198, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -13200,7 +13453,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258); + var jsxAttributes = createNode(261); jsxAttributes.properties = parseList(13, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -13209,14 +13462,14 @@ var ts; parseExpected(27); if (token() === 29) { parseExpected(29); - var node_1 = createNode(255, fullStart); + var node_1 = createNode(258, fullStart); return finishNode(node_1); } var tagName = parseJsxElementName(); var attributes = parseJsxAttributes(); var node; if (token() === 29) { - node = createNode(252, fullStart); + node = createNode(255, fullStart); scanJsxText(); } else { @@ -13228,7 +13481,7 @@ var ts; parseExpected(29, undefined, false); scanJsxText(); } - node = createNode(251, fullStart); + node = createNode(254, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -13239,7 +13492,7 @@ var ts; var expression = token() === 99 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23)) { - var propertyAccess = createNode(180, expression.pos); + var propertyAccess = createNode(183, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -13247,7 +13500,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260); + var node = createNode(263); parseExpected(17); if (token() !== 18) { node.dotDotDotToken = parseOptionalToken(24); @@ -13267,7 +13520,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257); + var node = createNode(260); node.name = parseIdentifierName(); if (token() === 58) { switch (scanJsxAttributeValue()) { @@ -13282,7 +13535,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259); + var node = createNode(262); parseExpected(17); parseExpected(24); node.expression = parseExpression(); @@ -13290,7 +13543,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253); + var node = createNode(256); parseExpected(28); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -13303,7 +13556,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256); + var node = createNode(259); parseExpected(28); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -13319,7 +13572,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185); + var node = createNode(188); parseExpected(27); node.type = parseType(); parseExpected(29); @@ -13330,7 +13583,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23); if (dotToken) { - var propertyAccess = createNode(180, expression.pos); + var propertyAccess = createNode(183, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -13338,13 +13591,13 @@ var ts; } if (token() === 51 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204, expression.pos); + var nonNullExpression = createNode(207, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } if (!inDecoratorContext() && parseOptional(21)) { - var indexedAccess = createNode(181, expression.pos); + var indexedAccess = createNode(184, expression.pos); indexedAccess.expression = expression; if (token() !== 22) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -13358,7 +13611,7 @@ var ts; continue; } if (token() === 13 || token() === 14) { - var tagExpression = createNode(184, expression.pos); + var tagExpression = createNode(187, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 ? parseLiteralNode() @@ -13377,7 +13630,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182, expression.pos); + var callExpr = createNode(185, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -13385,7 +13638,7 @@ var ts; continue; } else if (token() === 19) { - var callExpr = createNode(182, expression.pos); + var callExpr = createNode(185, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -13480,28 +13733,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186); + var node = createNodeWithJSDoc(189); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199); + var node = createNode(202); parseExpected(24); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 ? parseSpreadElement() : - token() === 26 ? createNode(201) : + token() === 26 ? createNode(204) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178); + var node = createNode(181); parseExpected(21); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -13513,18 +13766,18 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0); if (parseOptionalToken(24)) { - node.kind = 267; + node.kind = 270; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125)) { - return parseAccessorDeclaration(node, 154); - } - if (parseContextualModifier(135)) { return parseAccessorDeclaration(node, 155); } + if (parseContextualModifier(136)) { + return parseAccessorDeclaration(node, 156); + } var asteriskToken = parseOptionalToken(39); var tokenIsIdentifier = isIdentifier(); node.name = parsePropertyName(); @@ -13534,7 +13787,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 || token() === 18 || token() === 58); if (isShorthandPropertyAssignment) { - node.kind = 266; + node.kind = 269; var equalsToken = parseOptionalToken(58); if (equalsToken) { node.equalsToken = equalsToken; @@ -13542,14 +13795,14 @@ var ts; } } else { - node.kind = 265; + node.kind = 268; parseExpected(56); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179); + var node = createNode(182); parseExpected(17); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -13563,7 +13816,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNodeWithJSDoc(187); + var node = createNodeWithJSDoc(190); node.modifiers = parseModifiers(); parseExpected(89); node.asteriskToken = parseOptionalToken(39); @@ -13588,12 +13841,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94); if (parseOptional(23)) { - var node_2 = createNode(205, fullStart); + var node_2 = createNode(208, fullStart); node_2.keywordToken = 94; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183, fullStart); + var node = createNode(186, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19) { @@ -13602,7 +13855,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208); + var node = createNode(211); if (parseExpected(17, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -13633,12 +13886,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210); + var node = createNode(213); parseExpected(25); return finishNode(node); } function parseIfStatement() { - var node = createNode(212); + var node = createNode(215); parseExpected(90); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -13648,7 +13901,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213); + var node = createNode(216); parseExpected(81); node.statement = parseStatement(); parseExpected(106); @@ -13659,7 +13912,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214); + var node = createNode(217); parseExpected(106); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -13682,8 +13935,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143) : parseOptional(143)) { - var forOfStatement = createNode(217, pos); + if (awaitToken ? parseExpected(144) : parseOptional(144)) { + var forOfStatement = createNode(220, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -13691,14 +13944,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92)) { - var forInStatement = createNode(216, pos); + var forInStatement = createNode(219, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215, pos); + var forStatement = createNode(218, pos); forStatement.initializer = initializer; parseExpected(25); if (token() !== 25 && token() !== 20) { @@ -13716,7 +13969,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 ? 72 : 77); + parseExpected(kind === 222 ? 72 : 77); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -13724,7 +13977,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220); + var node = createNode(223); parseExpected(96); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -13733,7 +13986,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221); + var node = createNode(224); parseExpected(107); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -13742,7 +13995,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261); + var node = createNode(264); parseExpected(73); node.expression = allowInAnd(parseExpression); parseExpected(56); @@ -13750,7 +14003,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262); + var node = createNode(265); parseExpected(79); parseExpected(56); node.statements = parseList(3, parseStatement); @@ -13760,12 +14013,12 @@ var ts; return token() === 73 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222); + var node = createNode(225); parseExpected(98); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); - var caseBlock = createNode(236); + var caseBlock = createNode(239); parseExpected(17); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(18); @@ -13773,14 +14026,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(224); + var node = createNode(227); parseExpected(100); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(225); + var node = createNode(228); parseExpected(102); node.tryBlock = parseBlock(false); node.catchClause = token() === 74 ? parseCatchClause() : undefined; @@ -13791,7 +14044,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264); + var result = createNode(267); parseExpected(74); if (parseOptional(19)) { result.variableDeclaration = parseVariableDeclaration(); @@ -13804,7 +14057,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226); + var node = createNode(229); parseExpected(78); parseSemicolon(); return finishNode(node); @@ -13813,12 +14066,12 @@ var ts; var node = createNodeWithJSDoc(0); var expression = allowInAnd(parseExpression); if (expression.kind === 71 && parseOptional(56)) { - node.kind = 223; + node.kind = 226; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211; + node.kind = 214; node.expression = expression; parseSemicolon(); } @@ -13851,10 +14104,10 @@ var ts; case 83: return true; case 109: - case 138: + case 139: return nextTokenIsIdentifierOnSameLine(); - case 128: case 129: + case 130: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117: case 120: @@ -13862,13 +14115,13 @@ var ts; case 112: case 113: case 114: - case 131: + case 132: nextToken(); if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142: + case 143: nextToken(); return token() === 17 || token() === 71 || token() === 84; case 91: @@ -13927,16 +14180,16 @@ var ts; case 120: case 124: case 109: - case 128: case 129: - case 138: - case 142: + case 130: + case 139: + case 143: return true; case 114: case 112: case 113: case 115: - case 131: + case 132: return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); default: return isStartOfExpression(); @@ -13956,16 +14209,16 @@ var ts; case 17: return parseBlock(false); case 104: - return parseVariableStatement(createNodeWithJSDoc(227)); + return parseVariableStatement(createNodeWithJSDoc(230)); case 110: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227)); + return parseVariableStatement(createNodeWithJSDoc(230)); } break; case 89: - return parseFunctionDeclaration(createNodeWithJSDoc(229)); + return parseFunctionDeclaration(createNodeWithJSDoc(232)); case 75: - return parseClassDeclaration(createNodeWithJSDoc(230)); + return parseClassDeclaration(createNodeWithJSDoc(233)); case 90: return parseIfStatement(); case 81: @@ -13975,9 +14228,9 @@ var ts; case 88: return parseForOrForInOrForOfStatement(); case 77: - return parseBreakOrContinueStatement(218); + return parseBreakOrContinueStatement(221); case 72: - return parseBreakOrContinueStatement(219); + return parseBreakOrContinueStatement(222); case 96: return parseReturnStatement(); case 107: @@ -13996,9 +14249,9 @@ var ts; return parseDeclaration(); case 120: case 109: - case 138: - case 128: + case 139: case 129: + case 130: case 124: case 76: case 83: @@ -14009,8 +14262,8 @@ var ts; case 114: case 117: case 115: - case 131: - case 142: + case 132: + case 143: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -14048,13 +14301,13 @@ var ts; return parseClassDeclaration(node); case 109: return parseInterfaceDeclaration(node); - case 138: + case 139: return parseTypeAliasDeclaration(node); case 83: return parseEnumDeclaration(node); - case 142: - case 128: + case 143: case 129: + case 130: return parseModuleDeclaration(node); case 91: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -14071,7 +14324,7 @@ var ts; } default: if (node.decorators || node.modifiers) { - var missing = createMissingNode(248, true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251, true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -14092,16 +14345,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 26) { - return createNode(201); + return createNode(204); } - var node = createNode(177); + var node = createNode(180); node.dotDotDotToken = parseOptionalToken(24); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177); + var node = createNode(180); node.dotDotDotToken = parseOptionalToken(24); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -14117,14 +14370,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175); + var node = createNode(178); parseExpected(17); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(18); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176); + var node = createNode(179); parseExpected(21); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(22); @@ -14146,7 +14399,7 @@ var ts; return parseVariableDeclaration(true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227); + var node = createNode(230); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 && token() === 51 && !scanner.hasPrecedingLineBreak()) { @@ -14159,7 +14412,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228); + var node = createNode(231); switch (token()) { case 104: break; @@ -14173,7 +14426,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 143 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -14188,13 +14441,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20; } function parseVariableStatement(node) { - node.kind = 209; + node.kind = 212; node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229; + node.kind = 232; parseExpected(89); node.asteriskToken = parseOptionalToken(39); node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier(); @@ -14205,14 +14458,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153; + node.kind = 154; parseExpected(123); fillSignature(56, 0, node); node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152; + node.kind = 153; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 : 0; var isAsync = ts.hasModifier(node, 256) ? 2 : 0; @@ -14221,7 +14474,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150; + node.kind = 151; if (!node.questionToken && token() === 51 && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -14254,7 +14507,7 @@ var ts; case 112: case 113: case 115: - case 131: + case 132: return true; default: return false; @@ -14283,12 +14536,13 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 135 || idToken === 125) { + if (!ts.isKeyword(idToken) || idToken === 136 || idToken === 125) { return true; } switch (token()) { case 19: case 27: + case 51: case 56: case 58: case 55: @@ -14307,7 +14561,7 @@ var ts; if (!parseOptional(57)) { break; } - var decorator = createNode(148, decoratorStart); + var decorator = createNode(149, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -14348,7 +14602,7 @@ var ts; } function parseClassElement() { if (token() === 25) { - var result = createNode(207); + var result = createNode(210); nextToken(); return finishNode(result); } @@ -14356,11 +14610,11 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(true); if (parseContextualModifier(125)) { - return parseAccessorDeclaration(node, 154); - } - if (parseContextualModifier(135)) { return parseAccessorDeclaration(node, 155); } + if (parseContextualModifier(136)) { + return parseAccessorDeclaration(node, 156); + } if (token() === 123) { return parseConstructorDeclaration(node); } @@ -14381,10 +14635,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 200); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 203); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230); + return parseClassDeclarationOrExpression(node, 233); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -14418,7 +14672,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 || tok === 108) { - var node = createNode(263); + var node = createNode(266); node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); @@ -14427,7 +14681,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202); + var node = createNode(205); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -14444,7 +14698,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231; + node.kind = 234; parseExpected(109); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -14453,8 +14707,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232; - parseExpected(138); + node.kind = 235; + parseExpected(139); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58); @@ -14463,13 +14717,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNodeWithJSDoc(268); + var node = createNodeWithJSDoc(271); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233; + node.kind = 236; parseExpected(83); node.name = parseIdentifier(); if (parseExpected(17)) { @@ -14482,7 +14736,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235); + var node = createNode(238); if (parseExpected(17)) { node.statements = parseList(1, parseStatement); parseExpected(18); @@ -14493,7 +14747,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234; + node.kind = 237; var namespaceFlag = flags & 16; node.flags |= flags; node.name = parseIdentifier(); @@ -14503,8 +14757,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234; - if (token() === 142) { + node.kind = 237; + if (token() === 143) { node.name = parseIdentifier(); node.flags |= 512; } @@ -14522,14 +14776,14 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142) { + if (token() === 143) { return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129)) { + else if (parseOptional(130)) { flags |= 16; } else { - parseExpected(128); + parseExpected(129); if (token() === 9) { return parseAmbientExternalModuleDeclaration(node); } @@ -14537,7 +14791,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 && + return token() === 133 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -14547,9 +14801,9 @@ var ts; return nextToken() === 41; } function parseNamespaceExportDeclaration(node) { - node.kind = 237; + node.kind = 240; parseExpected(118); - parseExpected(129); + parseExpected(130); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -14560,23 +14814,23 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 && token() !== 141) { + if (token() !== 26 && token() !== 142) { return parseImportEqualsDeclaration(node, identifier); } } - node.kind = 239; + node.kind = 242; if (identifier || token() === 39 || token() === 17) { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141); + parseExpected(142); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238; + node.kind = 241; node.name = identifier; parseExpected(58); node.moduleReference = parseModuleReference(); @@ -14584,13 +14838,13 @@ var ts; return finishNode(node); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(240, fullStart); + var importClause = createNode(243, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(26)) { - importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(242); + importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(245); } return finishNode(importClause); } @@ -14600,8 +14854,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(249); - parseExpected(132); + var node = createNode(252); + parseExpected(133); parseExpected(19); node.expression = parseModuleSpecifier(); parseExpected(20); @@ -14618,7 +14872,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(241); + var namespaceImport = createNode(244); parseExpected(39); parseExpected(118); namespaceImport.name = parseIdentifier(); @@ -14626,14 +14880,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(22, kind === 242 ? parseImportSpecifier : parseExportSpecifier, 17, 18); + node.elements = parseBracketedList(22, kind === 245 ? parseImportSpecifier : parseExportSpecifier, 17, 18); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247); + return parseImportOrExportSpecifier(250); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243); + return parseImportOrExportSpecifier(246); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -14652,21 +14906,21 @@ var ts; else { node.name = identifierName; } - if (kind === 243 && checkIdentifierIsKeyword) { + if (kind === 246 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245; + node.kind = 248; if (parseOptional(39)) { - parseExpected(141); + parseExpected(142); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246); - if (token() === 141 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { - parseExpected(141); + node.exportClause = parseNamedImportsOrExports(249); + if (token() === 142 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { + parseExpected(142); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -14674,7 +14928,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244; + node.kind = 247; if (parseOptional(58)) { node.isExportEquals = true; } @@ -14766,10 +15020,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1) - || node.kind === 238 && node.moduleReference.kind === 249 - || node.kind === 239 - || node.kind === 244 - || node.kind === 245 + || node.kind === 241 && node.moduleReference.kind === 252 + || node.kind === 242 + || node.kind === 247 + || node.kind === 248 ? node : undefined; }); @@ -14788,7 +15042,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(271, scanner.getTokenPos()); + var result = createNode(274, scanner.getTokenPos()); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17); result.type = doInsideOfContext(1048576, parseType); if (!mayOmitBraces || hasBrace) { @@ -14845,7 +15099,6 @@ var ts; return result; } scanner.scanRange(start + 3, length - 5, function () { - var advanceToken = true; var state = 1; var margin = undefined; var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; @@ -14856,23 +15109,22 @@ var ts; comments.push(text); indent += text.length; } - nextJSDocToken(); - while (token() === 5) { - nextJSDocToken(); + var t = nextJSDocToken(); + while (t === 5) { + t = nextJSDocToken(); } - if (token() === 4) { + if (t === 4) { state = 0; indent = 0; - nextJSDocToken(); + t = nextJSDocToken(); } - while (token() !== 1) { - switch (token()) { + loop: while (true) { + switch (t) { case 57: if (state === 0 || state === 1) { removeTrailingNewlines(comments); parseTag(indent); state = 0; - advanceToken = false; margin = undefined; indent++; } @@ -14911,18 +15163,13 @@ var ts; indent += whitespace.length; break; case 1: - break; + break loop; default: state = 2; pushComment(scanner.getTokenText()); break; } - if (advanceToken) { - nextJSDocToken(); - } - else { - advanceToken = true; - } + t = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); @@ -14946,7 +15193,7 @@ var ts; content.charCodeAt(start + 3) !== 42; } function createJSDocComment() { - var result = createNode(279, start); + var result = createNode(282, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -15006,7 +15253,8 @@ var ts; if (!tag) { return; } - addTag(tag, parseTagComments(indent + tag.end - tag.pos)); + tag.comment = parseTagComments(indent + tag.end - tag.pos); + addTag(tag); } function parseTagComments(indent) { var comments = []; @@ -15019,8 +15267,9 @@ var ts; comments.push(text); indent += text.length; } - while (token() !== 57 && token() !== 1) { - switch (token()) { + var tok = token(); + loop: while (true) { + switch (tok) { case 4: if (state >= 1) { state = 0; @@ -15029,7 +15278,9 @@ var ts; indent = 0; break; case 57: - break; + scanner.setTextPos(scanner.getTextPos() - 1); + case 1: + break loop; case 5: if (state === 2) { pushComment(scanner.getTokenText()); @@ -15045,7 +15296,7 @@ var ts; case 39: if (state === 0) { state = 1; - indent += scanner.getTokenText().length; + indent += 1; break; } default: @@ -15053,23 +15304,19 @@ var ts; pushComment(scanner.getTokenText()); break; } - if (token() === 57) { - break; - } - nextJSDocToken(); + tok = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); - return comments; + return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(atToken, tagName) { - var result = createNode(281, atToken.pos); + var result = createNode(284, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); } - function addTag(tag, comments) { - tag.comment = comments.join(""); + function addTag(tag) { if (!tags) { tags = [tag]; tagsPos = tag.pos; @@ -15097,9 +15344,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 134: + case 135: return true; - case 165: + case 166: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object"; @@ -15115,8 +15362,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 ? - createNode(284, atToken.pos) : - createNode(289, atToken.pos); + createNode(287, atToken.pos) : + createNode(292, atToken.pos); var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name); if (nestedTypeLiteral) { typeExpression = nestedTypeLiteral; @@ -15132,21 +15379,18 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(271, scanner.getTokenPos()); + var typeLiteralExpression = createNode(274, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_2 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(1, name); })) { - if (!children) { - children = []; - } - children.push(child); + children = ts.append(children, child); } if (children) { - jsdocTypeLiteral = createNode(280, start_2); + jsdocTypeLiteral = createNode(283, start_2); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 165) { + if (typeExpression.type.kind === 166) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -15155,27 +15399,27 @@ var ts; } } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 285; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(285, atToken.pos); + var result = createNode(288, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 286; })) { + if (ts.forEach(tags, function (t) { return t.kind === 289; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(286, atToken.pos); + var result = createNode(289, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(true); return finishNode(result); } function parseAugmentsTag(atToken, tagName) { - var result = createNode(282, atToken.pos); + var result = createNode(285, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); @@ -15183,7 +15427,7 @@ var ts; } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(17); - var node = createNode(202); + var node = createNode(205); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -15195,7 +15439,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(true); while (parseOptional(23)) { - var prop = createNode(180, node.pos); + var prop = createNode(183, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -15203,7 +15447,7 @@ var ts; return node; } function parseClassTag(atToken, tagName) { - var tag = createNode(283, atToken.pos); + var tag = createNode(286, atToken.pos); tag.atToken = atToken; tag.tagName = tagName; return finishNode(tag); @@ -15211,7 +15455,7 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(288, atToken.pos); + var typedefTag = createNode(291, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(0); @@ -15234,9 +15478,9 @@ var ts; var start_3 = scanner.getStartPos(); while (child = tryParse(function () { return parseChildParameterOrPropertyTag(0); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(280, start_3); + jsdocTypeLiteral = createNode(283, start_3); } - if (child.kind === 286) { + if (child.kind === 289) { if (childTypeTag) { break; } @@ -15245,14 +15489,11 @@ var ts; } } else { - if (!jsdocTypeLiteral.jsDocPropertyTags) { - jsdocTypeLiteral.jsDocPropertyTags = []; - } - jsdocTypeLiteral.jsDocPropertyTags.push(child); + jsdocTypeLiteral.jsDocPropertyTags = ts.append(jsdocTypeLiteral.jsDocPropertyTags, child); } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 165) { + if (typeExpression && typeExpression.type.kind === 166) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -15265,7 +15506,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(23)) { - var jsDocNamespaceNode = createNode(234, pos); + var jsDocNamespaceNode = createNode(237, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4); @@ -15293,12 +15534,11 @@ var ts; var canParseTag = true; var seenAsterisk = false; while (true) { - nextJSDocToken(); - switch (token()) { + switch (nextJSDocToken()) { case 57: if (canParseTag) { var child = tryParseChildTag(target); - if (child && child.kind === 284 && + if (child && child.kind === 287 && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } @@ -15334,33 +15574,43 @@ var ts; if (!tagName) { return false; } + var t; switch (tagName.escapedText) { case "type": return target === 0 && parseTypeTag(atToken, tagName); case "prop": case "property": - return target === 0 && parseParameterOrPropertyTag(atToken, tagName, target); + t = 0; + break; case "arg": case "argument": case "param": - return target === 1 && parseParameterOrPropertyTag(atToken, tagName, target); + t = 1; + break; + default: + return false; } - return false; + if (target !== t) { + return false; + } + var tag = parseParameterOrPropertyTag(atToken, tagName, target); + tag.comment = parseTagComments(tag.end - tag.pos); + return tag; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 287; })) { + if (ts.some(tags, ts.isJSDocTemplateTag)) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } var typeParameters = []; var typeParametersPos = getNodePos(); while (true) { - var name = parseJSDocIdentifierName(); + var typeParameter = createNode(147); + var name = parseJSDocIdentifierNameWithOptionalBraces(); skipWhitespace(); if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(146, name.pos); typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); @@ -15372,13 +15622,21 @@ var ts; break; } } - var result = createNode(287, atToken.pos); + var result = createNode(290, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); finishNode(result); return result; } + function parseJSDocIdentifierNameWithOptionalBraces() { + var parsedBrace = parseOptional(17); + var res = parseJSDocIdentifierName(); + if (parsedBrace) { + parseExpected(18); + } + return res; + } function nextJSDocToken() { return currentToken = scanner.scanJSDocToken(); } @@ -15715,21 +15973,21 @@ var ts; ts.getModuleInstanceState = getModuleInstanceState; function getModuleInstanceStateWorker(node) { switch (node.kind) { - case 231: - case 232: + case 234: + case 235: return 0; - case 233: + case 236: if (ts.isConst(node)) { return 2; } break; - case 239: - case 238: + case 242: + case 241: if (!(ts.hasModifier(node, 1))) { return 0; } break; - case 235: { + case 238: { var state_1 = 0; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -15748,7 +16006,7 @@ var ts; }); return state_1; } - case 234: + case 237: return getModuleInstanceState(node); case 71: if (node.isInJSDocNamespace) { @@ -15772,6 +16030,7 @@ var ts; var parent; var container; var blockScopeContainer; + var inferenceContainer; var lastContainer; var seenThisKeyword; var currentFlow; @@ -15815,6 +16074,7 @@ var ts; parent = undefined; container = undefined; blockScopeContainer = undefined; + inferenceContainer = undefined; lastContainer = undefined; seenThisKeyword = false; currentFlow = undefined; @@ -15859,13 +16119,13 @@ var ts; if (symbolFlags & 107455) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 234)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 237)) { symbol.valueDeclaration = node; } } } function getDeclarationName(node) { - if (node.kind === 244) { + if (node.kind === 247) { return node.isExportEquals ? "export=" : "default"; } var name = ts.getNameOfDeclaration(node); @@ -15874,7 +16134,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 145) { + if (name.kind === 146) { var nameExpression = name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return ts.escapeLeadingUnderscores(nameExpression.text); @@ -15885,35 +16145,35 @@ var ts; return ts.getEscapedTextOfIdentifierOrLiteral(name); } switch (node.kind) { - case 153: + case 154: return "__constructor"; - case 161: - case 156: - return "__call"; case 162: case 157: - return "__new"; + return "__call"; + case 163: case 158: + return "__new"; + case 159: return "__index"; - case 245: + case 248: return "__export"; - case 195: + case 198: if (ts.getSpecialPropertyAssignmentKind(node) === 2) { return "export="; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 229: - case 230: + case 232: + case 233: return (ts.hasModifier(node, 512) ? "default" : undefined); - case 277: + case 280: return (ts.isJSDocConstructSignature(node) ? "__new" : "__call"); - case 147: - ts.Debug.assert(node.parent.kind === 277); + case 148: + ts.Debug.assert(node.parent.kind === 280); var functionType = node.parent; - var index = ts.indexOf(functionType.parameters, node); + var index = functionType.parameters.indexOf(node); return "arg" + index; - case 288: + case 291: var name_2 = ts.getNameOfJSDocTypedef(node); return typeof name_2 !== "undefined" ? name_2.escapedText : undefined; } @@ -15953,13 +16213,16 @@ var ts; var message_1 = symbol.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + if (symbol.flags & 384 || includes & 384) { + message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } if (symbol.declarations && symbol.declarations.length) { if (isDefaultExport) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } else { if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 244 && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 247 && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -15979,7 +16242,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 2097152) { - if (node.kind === 247 || (node.kind === 238 && hasExportModifier)) { + if (node.kind === 250 || (node.kind === 241 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -15987,12 +16250,9 @@ var ts; } } else { - if (node.kind === 288) + if (node.kind === 291) ts.Debug.assert(ts.isInJavaScriptFile(node)); - var isJSDocTypedefInJSDocNamespace = node.kind === 288 && - node.name && - node.name.kind === 71 && - node.name.isInJSDocNamespace; + var isJSDocTypedefInJSDocNamespace = ts.isJSDocTypedefTag(node) && node.name && node.name.kind === 71 && node.name.isInJSDocNamespace; if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 32)) || isJSDocTypedefInJSDocNamespace) { var exportKind = symbolFlags & 107455 ? 1048576 : 0; var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); @@ -16033,7 +16293,7 @@ var ts; currentFlow.container = node; } } - currentReturnTarget = isIIFE || node.kind === 153 ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 154 ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -16045,13 +16305,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256; } - if (node.kind === 269) { + if (node.kind === 272) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 153) { + if (node.kind === 154) { node.returnFlowNode = currentFlow; } } @@ -16069,6 +16329,13 @@ var ts; bindChildren(node); node.flags = seenThisKeyword ? node.flags | 64 : node.flags & ~64; } + else if (containerFlags & 256) { + var saveInferenceContainer = inferenceContainer; + inferenceContainer = node; + node.locals = undefined; + bindChildren(node); + inferenceContainer = saveInferenceContainer; + } else { bindChildren(node); } @@ -16135,70 +16402,70 @@ var ts; return; } switch (node.kind) { - case 214: + case 217: bindWhileStatement(node); break; - case 213: + case 216: bindDoStatement(node); break; - case 215: + case 218: bindForStatement(node); break; - case 216: - case 217: + case 219: + case 220: bindForInOrForOfStatement(node); break; - case 212: + case 215: bindIfStatement(node); break; - case 220: - case 224: + case 223: + case 227: bindReturnOrThrow(node); break; - case 219: - case 218: + case 222: + case 221: bindBreakOrContinueStatement(node); break; - case 225: + case 228: bindTryStatement(node); break; - case 222: + case 225: bindSwitchStatement(node); break; - case 236: + case 239: bindCaseBlock(node); break; - case 261: + case 264: bindCaseClause(node); break; - case 223: + case 226: bindLabeledStatement(node); break; - case 193: + case 196: bindPrefixUnaryExpressionFlow(node); break; - case 194: + case 197: bindPostfixUnaryExpressionFlow(node); break; - case 195: + case 198: bindBinaryExpressionFlow(node); break; - case 189: + case 192: bindDeleteExpressionFlow(node); break; - case 196: + case 199: bindConditionalExpressionFlow(node); break; - case 227: + case 230: bindVariableDeclarationFlow(node); break; - case 182: + case 185: bindCallExpressionFlow(node); break; - case 279: + case 282: bindJSDocComment(node); break; - case 288: + case 291: bindJSDocTypedefTag(node); break; default: @@ -16210,15 +16477,15 @@ var ts; switch (expr.kind) { case 71: case 99: - case 180: + case 183: return isNarrowableReference(expr); - case 182: + case 185: return hasNarrowableArgument(expr); - case 186: + case 189: return isNarrowingExpression(expr.expression); - case 195: + case 198: return isNarrowingBinaryExpression(expr); - case 193: + case 196: return expr.operator === 51 && isNarrowingExpression(expr.operand); } return false; @@ -16227,7 +16494,7 @@ var ts; return expr.kind === 71 || expr.kind === 99 || expr.kind === 97 || - expr.kind === 180 && isNarrowableReference(expr.expression); + expr.kind === 183 && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -16238,14 +16505,17 @@ var ts; } } } - if (expr.expression.kind === 180 && + if (expr.expression.kind === 183 && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 190 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; + return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2); + } + function isNarrowableInOperands(left, right) { + return ts.isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -16259,6 +16529,8 @@ var ts; isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); case 93: return isNarrowableOperand(expr.left); + case 92: + return isNarrowableInOperands(expr.left, expr.right); case 26: return isNarrowingExpression(expr.right); } @@ -16266,9 +16538,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 186: + case 189: return isNarrowableOperand(expr.expression); - case 195: + case 198: switch (expr.operatorToken.kind) { case 58: return isNarrowableOperand(expr.left); @@ -16345,33 +16617,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 212: - case 214: - case 213: - return parent.expression === node; case 215: - case 196: + case 217: + case 216: + return parent.expression === node; + case 218: + case 199: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 186) { + if (node.kind === 189) { node = node.expression; } - else if (node.kind === 193 && node.operator === 51) { + else if (node.kind === 196 && node.operator === 51) { node = node.operand; } else { - return node.kind === 195 && (node.operatorToken.kind === 53 || + return node.kind === 198 && (node.operatorToken.kind === 53 || node.operatorToken.kind === 54); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 186 || - node.parent.kind === 193 && + while (node.parent.kind === 189 || + node.parent.kind === 196 && node.parent.operator === 51) { node = node.parent; } @@ -16413,7 +16685,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 223 + var enclosingLabeledStatement = node.parent.kind === 226 ? ts.lastOrUndefined(activeLabels) : undefined; var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel(); @@ -16445,13 +16717,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 217) { + if (node.kind === 220) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 228) { + if (node.initializer.kind !== 231) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -16473,7 +16745,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 220) { + if (node.kind === 223) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -16493,7 +16765,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 219 ? breakTarget : continueTarget; + var flowLabel = node.kind === 222 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -16556,7 +16828,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 262; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 265; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -16621,13 +16893,13 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 213) { + if (!node.statement || node.statement.kind !== 216) { addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 195 && node.operatorToken.kind === 58) { + if (node.kind === 198 && node.operatorToken.kind === 58) { bindAssignmentTargetFlow(node.left); } else { @@ -16638,10 +16910,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 178) { + else if (node.kind === 181) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 199) { + if (e.kind === 202) { bindAssignmentTargetFlow(e.expression); } else { @@ -16649,16 +16921,16 @@ var ts; } } } - else if (node.kind === 179) { + else if (node.kind === 182) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 265) { + if (p.kind === 268) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 266) { + else if (p.kind === 269) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 267) { + else if (p.kind === 270) { bindAssignmentTargetFlow(p.expression); } } @@ -16714,7 +16986,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 58 && node.left.kind === 181) { + if (operator === 58 && node.left.kind === 184) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -16725,7 +16997,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 180) { + if (node.expression.kind === 183) { bindAssignmentTargetFlow(node.expression); } } @@ -16764,7 +17036,7 @@ var ts; } function bindJSDocComment(node) { ts.forEachChild(node, function (n) { - if (n.kind !== 288) { + if (n.kind !== 291) { bind(n); } }); @@ -16779,10 +17051,10 @@ var ts; } function bindCallExpressionFlow(node) { var expr = node.expression; - while (expr.kind === 186) { + while (expr.kind === 189) { expr = expr.expression; } - if (expr.kind === 187 || expr.kind === 188) { + if (expr.kind === 190 || expr.kind === 191) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -16790,7 +17062,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 180) { + if (node.expression.kind === 183) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -16799,52 +17071,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 200: - case 230: + case 203: case 233: - case 179: - case 164: - case 280: - case 258: + case 236: + case 182: + case 165: + case 283: + case 261: return 1; - case 231: - return 1 | 64; case 234: - case 232: - case 173: + return 1 | 64; + case 237: + case 235: + case 176: return 1 | 32; - case 269: + case 170: + return 256; + case 272: return 1 | 4 | 32; - case 152: + case 153: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } - case 153: - case 229: - case 151: case 154: + case 232: + case 152: case 155: case 156: - case 277: - case 161: case 157: - case 158: + case 280: case 162: + case 158: + case 159: + case 163: return 1 | 4 | 32 | 8; - case 187: - case 188: + case 190: + case 191: return 1 | 4 | 32 | 8 | 16; - case 235: + case 238: return 4; - case 150: + case 151: return node.initializer ? 4 : 0; - case 264: - case 215: - case 216: - case 217: - case 236: + case 267: + case 218: + case 219: + case 220: + case 239: return 2; - case 208: + case 211: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -16857,37 +17131,37 @@ var ts; } function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 234: + case 237: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 269: + case 272: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 200: - case 230: - return declareClassMember(node, symbolFlags, symbolExcludes); + case 203: case 233: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 236: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 164: - case 280: - case 179: - case 231: - case 258: + case 165: + case 283: + case 182: + case 234: + case 261: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 161: case 162: - case 156: + case 163: case 157: case 158: - case 152: - case 151: + case 159: case 153: + case 152: case 154: case 155: - case 229: - case 187: - case 188: - case 277: + case 156: case 232: - case 173: + case 190: + case 191: + case 280: + case 235: + case 176: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -16902,11 +17176,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 269 ? node : node.body; - if (body && (body.kind === 269 || body.kind === 235)) { + var body = node.kind === 272 ? node : node.body; + if (body && (body.kind === 272 || body.kind === 238)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 245 || stat.kind === 244) { + if (stat.kind === 248 || stat.kind === 247) { return true; } } @@ -16976,11 +17250,11 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 || prop.name.kind !== 71) { + if (prop.kind === 270 || prop.name.kind !== 71) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 265 || prop.kind === 266 || prop.kind === 152 + var currentKind = prop.kind === 268 || prop.kind === 269 || prop.kind === 153 ? 1 : 2; var existingKind = seen.get(identifier.escapedText); @@ -17011,10 +17285,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 234: + case 237: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 269: + case 272: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -17103,8 +17377,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 269 && - blockScopeContainer.kind !== 234 && + if (blockScopeContainer.kind !== 272 && + blockScopeContainer.kind !== 237 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -17146,7 +17420,7 @@ var ts; if (ts.isInJavaScriptFile(node)) bindJSDocTypedefTagIfAny(node); bindWorker(node); - if (node.kind > 143) { + if (node.kind > 144) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -17174,7 +17448,7 @@ var ts; } for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { var tag = _c[_b]; - if (tag.kind === 288) { + if (tag.kind === 291) { var savedParent = parent; parent = jsDoc; bind(tag); @@ -17206,18 +17480,18 @@ var ts; case 71: if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 288) { + while (parentNode && parentNode.kind !== 291) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288, 793064); break; } case 99: - if (currentFlow && (ts.isExpression(node) || parent.kind === 266)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 269)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 180: + case 183: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -17225,7 +17499,7 @@ var ts; bindSpecialPropertyDeclaration(node); } break; - case 195: + case 198: var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { case 1: @@ -17249,122 +17523,122 @@ var ts; ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 264: + case 267: return checkStrictModeCatchClause(node); - case 189: + case 192: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 194: + case 197: return checkStrictModePostfixUnaryExpression(node); - case 193: + case 196: return checkStrictModePrefixUnaryExpression(node); - case 221: + case 224: return checkStrictModeWithStatement(node); - case 170: + case 173: seenThisKeyword = true; return; - case 159: + case 160: return checkTypePredicate(node); - case 146: - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 147: + return bindTypeParameter(node); + case 148: return bindParameter(node); - case 227: + case 230: return bindVariableDeclarationOrBindingElement(node); - case 177: + case 180: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); + case 151: case 150: - case 149: return bindPropertyWorker(node); - case 265: - case 266: - return bindPropertyOrMethodOrAccessor(node, 4, 0); case 268: + case 269: + return bindPropertyOrMethodOrAccessor(node, 4, 0); + case 271: return bindPropertyOrMethodOrAccessor(node, 8, 900095); - case 156: case 157: case 158: + case 159: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 152: - case 151: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); - case 229: - return bindFunctionDeclaration(node); case 153: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 152: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); + case 232: + return bindFunctionDeclaration(node); case 154: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 155: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 156: return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 161: - case 277: case 162: - return bindFunctionOrConstructorType(node); - case 164: case 280: - case 173: + case 163: + return bindFunctionOrConstructorType(node); + case 165: + case 283: + case 176: return bindAnonymousTypeWorker(node); - case 179: - return bindObjectLiteralExpression(node); - case 187: - case 188: - return bindFunctionExpression(node); case 182: + return bindObjectLiteralExpression(node); + case 190: + case 191: + return bindFunctionExpression(node); + case 185: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 200: - case 230: + case 203: + case 233: inStrictMode = true; return bindClassLikeDeclaration(node); - case 231: - return bindBlockScopedDeclaration(node, 64, 792968); - case 232: - return bindBlockScopedDeclaration(node, 524288, 793064); - case 233: - return bindEnumDeclaration(node); case 234: - return bindModuleDeclaration(node); - case 258: - return bindJsxAttributes(node); - case 257: - return bindJsxAttribute(node, 4, 0); - case 238: - case 241: - case 243: - case 247: - return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); + return bindBlockScopedDeclaration(node, 64, 792968); + case 235: + return bindBlockScopedDeclaration(node, 524288, 793064); + case 236: + return bindEnumDeclaration(node); case 237: - return bindNamespaceExportDeclaration(node); - case 240: - return bindImportClause(node); - case 245: - return bindExportDeclaration(node); + return bindModuleDeclaration(node); + case 261: + return bindJsxAttributes(node); + case 260: + return bindJsxAttribute(node, 4, 0); + case 241: case 244: + case 246: + case 250: + return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); + case 240: + return bindNamespaceExportDeclaration(node); + case 243: + return bindImportClause(node); + case 248: + return bindExportDeclaration(node); + case 247: return bindExportAssignment(node); - case 269: + case 272: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 208: + case 211: if (!ts.isFunctionLike(node.parent)) { return; } - case 235: + case 238: return updateStrictModeStatementList(node.statements); - case 284: - if (node.parent.kind !== 280) { + case 287: + if (node.parent.kind !== 283) { break; } - case 289: + case 292: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 276 ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 279 ? 4 | 16777216 : 4; return declareSymbolAndAddToSymbolTable(propTag, flags, 0); - case 288: { + case 291: { var fullName = node.fullName; if (!fullName || fullName.kind === 71) { return bindBlockScopedDeclaration(node, 524288, 793064); @@ -17384,7 +17658,7 @@ var ts; if (parameterName && parameterName.kind === 71) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 170) { + if (parameterName && parameterName.kind === 173) { seenThisKeyword = true; } bind(type); @@ -17403,7 +17677,7 @@ var ts; bindAnonymousDeclaration(node, 2097152, getDeclarationName(node)); } else { - var flags = node.kind === 244 && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 247 && ts.exportAssignmentIsAlias(node) ? 2097152 : 4; declareSymbol(container.symbol.exports, container.symbol, node, flags, 67108863); @@ -17413,7 +17687,7 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 269) { + if (node.parent.kind !== 272) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } @@ -17456,23 +17730,9 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 | 1048576, 0); } - function isExportsOrModuleExportsOrAlias(node) { - return ts.isExportsIdentifier(node) || - ts.isModuleExportsPropertyAccessExpression(node) || - ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(node); - } - function isNameOfExportsOrModuleExportsAliasDeclaration(node) { - var symbol = lookupSymbolForName(node.escapedText); - return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && - symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer); - } - function isExportsOrModuleExportsOrAliasOrAssignment(node) { - return isExportsOrModuleExportsOrAlias(node) || - (ts.isAssignmentExpression(node, true) && (isExportsOrModuleExportsOrAliasOrAssignment(node.left) || isExportsOrModuleExportsOrAliasOrAssignment(node.right))); - } function bindModuleExportsAssignment(node) { var assignedExpression = ts.getRightMostAssignedExpression(node.right); - if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { setCommonJsModuleIndicator(node); return; } @@ -17483,16 +17743,16 @@ var ts; ts.Debug.assert(ts.isInJavaScriptFile(node)); var container = ts.getThisContainer(node, false); switch (container.kind) { - case 229: - case 187: + case 232: + case 190: container.symbol.members = container.symbol.members || ts.createSymbolTable(); declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); break; - case 153: - case 150: - case 152: case 154: + case 151: + case 153: case 155: + case 156: var containingClass = container.parent; var symbolTable = ts.hasModifier(container, 32) ? containingClass.symbol.exports : containingClass.symbol.members; declareSymbol(symbolTable, containingClass.symbol, node, 4, 0, true); @@ -17504,8 +17764,8 @@ var ts; if (node.expression.kind === 99) { bindThisPropertyAssignment(node); } - else if ((node.expression.kind === 71 || node.expression.kind === 180) && - node.parent.parent.kind === 269) { + else if ((node.expression.kind === 71 || node.expression.kind === 183) && + node.parent.parent.kind === 272) { bindStaticPropertyAssignment(node); } } @@ -17519,14 +17779,14 @@ var ts; bindPropertyAssignment(constructorFunction.escapedText, leftSideOfAssignment, true); } function bindStaticPropertyAssignment(node) { - var leftSideOfAssignment = node.kind === 180 ? node : node.left; + var leftSideOfAssignment = node.kind === 183 ? node : node.left; var target = leftSideOfAssignment.expression; if (ts.isIdentifier(target)) { target.parent = leftSideOfAssignment; - if (node.kind === 195) { + if (node.kind === 198) { leftSideOfAssignment.parent = node; } - if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + if (container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, target)) { bindExportsPropertyAssignment(node); } else { @@ -17535,26 +17795,22 @@ var ts; } } function lookupSymbolForName(name) { - var local = container.locals && container.locals.get(name); - if (local) { - return local.exportSymbol || local; - } - return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + return lookupSymbolForNameWorker(container, name); } function bindPropertyAssignment(functionName, propertyAccess, isPrototypeProperty) { var symbol = lookupSymbolForName(functionName); var targetSymbol = symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol) ? symbol.valueDeclaration.initializer.symbol : symbol; - ts.Debug.assert(propertyAccess.parent.kind === 195 || propertyAccess.parent.kind === 211); + ts.Debug.assert(propertyAccess.parent.kind === 198 || propertyAccess.parent.kind === 214); var isLegalPosition; - if (propertyAccess.parent.kind === 195) { + if (propertyAccess.parent.kind === 198) { var initializerKind = propertyAccess.parent.right.kind; - isLegalPosition = (initializerKind === 200 || initializerKind === 187) && - propertyAccess.parent.parent.parent.kind === 269; + isLegalPosition = (initializerKind === 203 || initializerKind === 190) && + propertyAccess.parent.parent.parent.kind === 272; } else { - isLegalPosition = propertyAccess.parent.parent.kind === 269; + isLegalPosition = propertyAccess.parent.parent.kind === 272; } if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & 1920)) && isLegalPosition) { ts.Debug.assert(ts.isIdentifier(propertyAccess.expression)); @@ -17582,7 +17838,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 230) { + if (node.kind === 233) { bindBlockScopedDeclaration(node, 32, 899519); } else { @@ -17630,7 +17886,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, "__" + ts.indexOf(node.parent.parameters, node)); + bindAnonymousDeclaration(node, 1, "__" + node.parent.parameters.indexOf(node)); } else { declareSymbolAndAddToSymbolTable(node, 1, 107455); @@ -17679,6 +17935,22 @@ var ts; ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + function bindTypeParameter(node) { + if (node.parent.kind === 171) { + if (inferenceContainer) { + if (!inferenceContainer.locals) { + inferenceContainer.locals = ts.createSymbolTable(); + } + declareSymbol(inferenceContainer.locals, undefined, node, 262144, 530920); + } + else { + bindAnonymousDeclaration(node, 262144, getDeclarationName(node)); + } + } + else { + declareSymbolAndAddToSymbolTable(node, 262144, 530920); + } + } function shouldReportErrorOnModuleDeclaration(node) { var instanceState = getModuleInstanceState(node); return instanceState === 1 || (instanceState === 2 && options.preserveConstEnums); @@ -17688,15 +17960,15 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 210) || - node.kind === 230 || - (node.kind === 234 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 233 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 213) || + node.kind === 233 || + (node.kind === 237 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 236 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; var reportUnreachableCode = !options.allowUnreachableCode && !(node.flags & 2097152) && - (node.kind !== 209 || + (node.kind !== 212 || ts.getCombinedNodeFlags(node.declarationList) & 3 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -17707,60 +17979,84 @@ var ts; return true; } } + function isExportsOrModuleExportsOrAlias(sourceFile, node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node); + } + ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; + function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) { + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); + return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && + symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer); + } + function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { + return isExportsOrModuleExportsOrAlias(sourceFile, node) || + (ts.isAssignmentExpression(node, true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); + } + function lookupSymbolForNameWorker(container, name) { + var local = container.locals && container.locals.get(name); + if (local) { + return local.exportSymbol || local; + } + return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + } function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 182: + case 185: return computeCallExpression(node, subtreeFlags); - case 183: - return computeNewExpression(node, subtreeFlags); - case 234: - return computeModuleDeclaration(node, subtreeFlags); case 186: + return computeNewExpression(node, subtreeFlags); + case 237: + return computeModuleDeclaration(node, subtreeFlags); + case 189: return computeParenthesizedExpression(node, subtreeFlags); - case 195: + case 198: return computeBinaryExpression(node, subtreeFlags); - case 211: + case 214: return computeExpressionStatement(node, subtreeFlags); - case 147: + case 148: return computeParameter(node, subtreeFlags); - case 188: + case 191: return computeArrowFunction(node, subtreeFlags); - case 187: + case 190: return computeFunctionExpression(node, subtreeFlags); - case 229: + case 232: return computeFunctionDeclaration(node, subtreeFlags); - case 227: - return computeVariableDeclaration(node, subtreeFlags); - case 228: - return computeVariableDeclarationList(node, subtreeFlags); - case 209: - return computeVariableStatement(node, subtreeFlags); - case 223: - return computeLabeledStatement(node, subtreeFlags); case 230: + return computeVariableDeclaration(node, subtreeFlags); + case 231: + return computeVariableDeclarationList(node, subtreeFlags); + case 212: + return computeVariableStatement(node, subtreeFlags); + case 226: + return computeLabeledStatement(node, subtreeFlags); + case 233: return computeClassDeclaration(node, subtreeFlags); - case 200: + case 203: return computeClassExpression(node, subtreeFlags); - case 263: + case 266: return computeHeritageClause(node, subtreeFlags); - case 264: + case 267: return computeCatchClause(node, subtreeFlags); - case 202: + case 205: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 153: - return computeConstructor(node, subtreeFlags); - case 150: - return computePropertyDeclaration(node, subtreeFlags); - case 152: - return computeMethod(node, subtreeFlags); case 154: + return computeConstructor(node, subtreeFlags); + case 151: + return computePropertyDeclaration(node, subtreeFlags); + case 153: + return computeMethod(node, subtreeFlags); case 155: + case 156: return computeAccessor(node, subtreeFlags); - case 238: + case 241: return computeImportEquals(node, subtreeFlags); - case 180: + case 183: return computePropertyAccess(node, subtreeFlags); + case 184: + return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); } @@ -17769,13 +18065,15 @@ var ts; function computeCallExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var expression = node.expression; - var expressionKind = expression.kind; if (node.typeArguments) { transformFlags |= 3; } if (subtreeFlags & 524288 - || isSuperOrSuperProperty(expression, expressionKind)) { + || (expression.transformFlags & (134217728 | 268435456))) { transformFlags |= 192; + if (expression.transformFlags & 268435456) { + transformFlags |= 16384; + } } if (expression.kind === 91) { transformFlags |= 67108864; @@ -17784,19 +18082,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~537396545; - } - function isSuperOrSuperProperty(node, kind) { - switch (kind) { - case 97: - return true; - case 180: - case 181: - var expression = node.expression; - var expressionKind = expression.kind; - return expressionKind === 97; - } - return false; + return transformFlags & ~940049729; } function computeNewExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -17807,16 +18093,16 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~537396545; + return transformFlags & ~940049729; } function computeBinaryExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 58 && leftKind === 179) { + if (operatorTokenKind === 58 && leftKind === 182) { transformFlags |= 8 | 192 | 3072; } - else if (operatorTokenKind === 58 && leftKind === 178) { + else if (operatorTokenKind === 58 && leftKind === 181) { transformFlags |= 192 | 3072; } else if (operatorTokenKind === 40 @@ -17824,7 +18110,7 @@ var ts; transformFlags |= 32; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -17847,15 +18133,15 @@ var ts; transformFlags |= 192 | 131072; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeParenthesizedExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var expression = node.expression; var expressionKind = expression.kind; var expressionTransformFlags = expression.transformFlags; - if (expressionKind === 203 - || expressionKind === 185) { + if (expressionKind === 206 + || expressionKind === 188) { transformFlags |= 3; } if (expressionTransformFlags & 1024) { @@ -17880,7 +18166,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~539358529; + return transformFlags & ~942011713; } function computeClassExpression(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -17892,7 +18178,7 @@ var ts; transformFlags |= 16384; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~539358529; + return transformFlags & ~942011713; } function computeHeritageClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -17908,7 +18194,7 @@ var ts; break; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -17919,7 +18205,7 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~537920833; + return transformFlags & ~940574017; } function computeExpressionWithTypeArguments(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -17927,7 +18213,7 @@ var ts; transformFlags |= 3; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeConstructor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -17939,7 +18225,7 @@ var ts; transformFlags |= 8; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601015617; + return transformFlags & ~1003668801; } function computeMethod(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -17961,7 +18247,7 @@ var ts; transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601015617; + return transformFlags & ~1003668801; } function computeAccessor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -17976,7 +18262,7 @@ var ts; transformFlags |= 8; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601015617; + return transformFlags & ~1003668801; } function computePropertyDeclaration(node, subtreeFlags) { var transformFlags = subtreeFlags | 3; @@ -17984,7 +18270,7 @@ var ts; transformFlags |= 8192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeFunctionDeclaration(node, subtreeFlags) { var transformFlags; @@ -18014,7 +18300,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601281857; + return transformFlags & ~1003935041; } function computeFunctionExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -18036,7 +18322,7 @@ var ts; transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601281857; + return transformFlags & ~1003935041; } function computeArrowFunction(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -18055,17 +18341,27 @@ var ts; transformFlags |= 32768; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601249089; + return transformFlags & ~1003902273; } function computePropertyAccess(node, subtreeFlags) { var transformFlags = subtreeFlags; - var expression = node.expression; - var expressionKind = expression.kind; - if (expressionKind === 97) { - transformFlags |= 16384; + if (transformFlags & 134217728) { + transformFlags ^= 134217728; + transformFlags |= 268435456; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~671089985; + } + function computeElementAccess(node, subtreeFlags) { + var transformFlags = subtreeFlags; + var expression = node.expression; + var expressionFlags = expression.transformFlags; + if (expressionFlags & 134217728) { + transformFlags &= ~134217728; + transformFlags |= 268435456; + } + node.transformFlags = transformFlags | 536870912; + return transformFlags & ~671089985; } function computeVariableDeclaration(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -18077,7 +18373,7 @@ var ts; transformFlags |= 3; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; @@ -18092,7 +18388,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeLabeledStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -18101,7 +18397,7 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeImportEquals(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -18109,7 +18405,7 @@ var ts; transformFlags |= 3; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeExpressionStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -18117,7 +18413,7 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeModuleDeclaration(node, subtreeFlags) { var transformFlags = 3; @@ -18126,7 +18422,7 @@ var ts; transformFlags |= subtreeFlags; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~574674241; + return transformFlags & ~977327425; } function computeVariableDeclarationList(node, subtreeFlags) { var transformFlags = subtreeFlags | 33554432; @@ -18137,53 +18433,57 @@ var ts; transformFlags |= 192 | 4194304; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~546309441; + return transformFlags & ~948962625; } function computeOther(node, kind, subtreeFlags) { var transformFlags = subtreeFlags; - var excludeFlags = 536872257; + var excludeFlags = 939525441; switch (kind) { case 120: - case 192: + case 195: transformFlags |= 8 | 16; break; + case 188: + case 206: + case 295: + transformFlags |= 3; + excludeFlags = 536872257; + break; case 114: case 112: case 113: case 117: case 124: case 76: - case 233: - case 268: - case 185: - case 203: - case 204: - case 131: + case 236: + case 271: + case 207: + case 132: transformFlags |= 3; break; - case 250: - case 251: - case 252: - case 10: case 253: case 254: case 255: + case 10: case 256: case 257: case 258: case 259: case 260: + case 261: + case 262: + case 263: transformFlags |= 4; break; case 13: case 14: case 15: case 16: - case 197: - case 184: - case 266: + case 200: + case 187: + case 269: case 115: - case 205: + case 208: transformFlags |= 192; break; case 9: @@ -18196,27 +18496,26 @@ var ts; transformFlags |= 192; } break; - case 217: + case 220: if (node.awaitModifier) { transformFlags |= 8; } transformFlags |= 192; break; - case 198: + case 201: transformFlags |= 8 | 192 | 16777216; break; case 119: - case 133: - case 130: case 134: - case 136: - case 122: + case 131: + case 135: case 137: + case 122: + case 138: case 105: - case 146: - case 149: - case 151: - case 156: + case 147: + case 150: + case 152: case 157: case 158: case 159: @@ -18230,57 +18529,61 @@ var ts; case 167: case 168: case 169: - case 231: - case 232: case 170: case 171: case 172: + case 234: + case 235: case 173: case 174: - case 237: + case 175: + case 176: + case 177: + case 240: transformFlags = 3; excludeFlags = -3; break; - case 145: + case 146: transformFlags |= 2097152; if (subtreeFlags & 16384) { transformFlags |= 65536; } break; - case 199: + case 202: transformFlags |= 192 | 524288; break; - case 267: + case 270: transformFlags |= 8 | 1048576; break; case 97: - transformFlags |= 192; + transformFlags |= 192 | 134217728; + excludeFlags = 536872257; break; case 99: transformFlags |= 16384; break; - case 175: + case 178: transformFlags |= 192 | 8388608; if (subtreeFlags & 524288) { transformFlags |= 8 | 1048576; } - excludeFlags = 537396545; + excludeFlags = 940049729; break; - case 176: + case 179: transformFlags |= 192 | 8388608; - excludeFlags = 537396545; + excludeFlags = 940049729; break; - case 177: + case 180: transformFlags |= 192; if (node.dotDotDotToken) { transformFlags |= 524288; } break; - case 148: + case 149: transformFlags |= 3 | 4096; break; - case 179: - excludeFlags = 540087617; + case 182: + excludeFlags = 942740801; if (subtreeFlags & 2097152) { transformFlags |= 192; } @@ -18291,29 +18594,29 @@ var ts; transformFlags |= 8; } break; - case 178: - case 183: - excludeFlags = 537396545; + case 181: + case 186: + excludeFlags = 940049729; if (subtreeFlags & 524288) { transformFlags |= 192; } break; - case 213: - case 214: - case 215: case 216: + case 217: + case 218: + case 219: if (subtreeFlags & 4194304) { transformFlags |= 192; } break; - case 269: + case 272: if (subtreeFlags & 32768) { transformFlags |= 192; } break; - case 220: - case 218: - case 219: + case 223: + case 221: + case 222: transformFlags |= 33554432; break; } @@ -18321,60 +18624,69 @@ var ts; return transformFlags & ~excludeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 159 && kind <= 174) { + if (kind >= 160 && kind <= 177) { return -3; } switch (kind) { - case 182: - case 183: - case 178: - return 537396545; - case 234: - return 574674241; - case 147: - return 536872257; - case 188: - return 601249089; - case 187: - case 229: - return 601281857; - case 228: - return 546309441; - case 230: - case 200: - return 539358529; - case 153: - return 601015617; - case 152: + case 185: + case 186: + case 181: + return 940049729; + case 237: + return 977327425; + case 148: + return 939525441; + case 191: + return 1003902273; + case 190: + case 232: + return 1003935041; + case 231: + return 948962625; + case 233: + case 203: + return 942011713; case 154: + return 1003668801; + case 153: case 155: - return 601015617; - case 119: - case 133: - case 130: - case 136: - case 134: - case 122: - case 137: - case 105: - case 146: - case 149: - case 151: case 156: + return 1003668801; + case 119: + case 134: + case 131: + case 137: + case 135: + case 122: + case 138: + case 105: + case 147: + case 150: + case 152: case 157: case 158: - case 231: - case 232: + case 159: + case 234: + case 235: return -3; + case 182: + return 942740801; + case 267: + return 940574017; + case 178: case 179: - return 540087617; - case 264: - return 537920833; - case 175: - case 176: - return 537396545; - default: + return 940049729; + case 188: + case 206: + case 295: + case 189: + case 97: return 536872257; + case 183: + case 184: + return 671089985; + default: + return 939525441; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; @@ -18385,7 +18697,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { return getSymbolWalker; function getSymbolWalker(accept) { if (accept === void 0) { accept = function () { return true; }; } @@ -18478,8 +18790,9 @@ var ts; visitType(type.modifiersType); } function visitSignature(signature) { - if (signature.typePredicate) { - visitType(signature.typePredicate.type); + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + visitType(typePredicate.type); } ts.forEach(signature.typeParameters, visitType); for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { @@ -18532,7 +18845,7 @@ var ts; symbol.exports.forEach(visitSymbol); } ts.forEach(symbol.declarations, function (d) { - if (d.type && d.type.kind === 163) { + if (d.type && d.type.kind === 164) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -18572,9 +18885,9 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, + resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } @@ -19007,8 +19320,8 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); + var _a = result.value, resolved = _a.resolved, originalPath = _a.originalPath, isExternalLibraryImport = _a.isExternalLibraryImport; + return createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { @@ -19025,10 +19338,16 @@ var ts; if (!resolved_1) return undefined; var resolvedValue = resolved_1.value; - if (!compilerOptions.preserveSymlinks) { - resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + var originalPath = void 0; + if (!compilerOptions.preserveSymlinks && resolvedValue) { + originalPath = resolvedValue.path; + var path = realPath(resolved_1.value.path, host, traceEnabled); + if (path === originalPath) { + originalPath = undefined; + } + resolvedValue = __assign({}, resolvedValue, { path: path }); } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, originalPath: originalPath, isExternalLibraryImport: true } }; } else { var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; @@ -19063,7 +19382,9 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return noPackageId(resolvedFromFile); + var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; + var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, false, state).packageId; + return withPackageId(packageId, resolvedFromFile); } } if (!onlyRecordFailures) { @@ -19077,6 +19398,38 @@ var ts; } return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } + var nodeModulesPathPart = "/node_modules/"; + function parseNodeModuleFromPath(resolved) { + var path = ts.normalizePath(resolved.path); + var idx = path.lastIndexOf(nodeModulesPathPart); + if (idx === -1) { + return undefined; + } + var indexAfterNodeModules = idx + nodeModulesPathPart.length; + var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules); + if (path.charCodeAt(indexAfterNodeModules) === 64) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName); + } + var packageDirectory = path.slice(0, indexAfterPackageName); + var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts"; + return { packageDirectory: packageDirectory, subModuleName: subModuleName }; + } + function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) { + var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; + } + function addExtensionAndIndex(path) { + if (path === "") { + return "index.d.ts"; + } + if (ts.endsWith(path, ".d.ts")) { + return path; + } + if (ts.endsWith(path, "/index")) { + return path + ".d.ts"; + } + return path + "/index.d.ts"; + } function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); } @@ -19150,18 +19503,41 @@ var ts; var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } - function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) { - var host = _a.host, traceEnabled = _a.traceEnabled; + function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) { + var host = state.host, traceEnabled = state.traceEnabled; var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host); var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } var packageJsonContent = readJson(packageJsonPath, host); + if (subModuleName === "") { + var path = tryReadPackageJsonFields(true, packageJsonContent, nodeModuleDirectory, state); + if (typeof path === "string") { + subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); + } + else { + var jsPath = tryReadPackageJsonFields(false, packageJsonContent, nodeModuleDirectory, state); + if (typeof jsPath === "string") { + subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js"), ".jsx") + ".d.ts"; + } + else { + subModuleName = "index.d.ts"; + } + } + } + if (!ts.endsWith(subModuleName, ".d.ts")) { + subModuleName = addExtensionAndIndex(subModuleName); + } var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string" ? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version } : undefined; + if (traceEnabled) { + if (packageId) { + trace(host, ts.Diagnostics.Found_package_json_at_0_Package_ID_is_1, packageJsonPath, ts.packageIdToString(packageId)); + } + else { + trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + } return { found: true, packageJsonContent: packageJsonContent, packageId: packageId }; } else { @@ -19304,13 +19680,17 @@ var ts; function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); if (withoutAtTypePrefix !== mangledName) { - return ts.stringContains(withoutAtTypePrefix, mangledScopedPackageSeparator) ? - "@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) : - withoutAtTypePrefix; + return getUnmangledNameForScopedPackage(withoutAtTypePrefix); } return mangledName; } ts.getPackageNameFromAtTypesDirectory = getPackageNameFromAtTypesDirectory; + function getUnmangledNameForScopedPackage(typesPackageName) { + return ts.stringContains(typesPackageName, mangledScopedPackageSeparator) ? + "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) : + typesPackageName; + } + ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { var result = cache && cache.get(containingDirectory); if (result) { @@ -19326,7 +19706,7 @@ var ts; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, undefined, false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { @@ -19364,7 +19744,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); - return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, undefined, true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; function toSearchResult(value) { @@ -19469,6 +19849,11 @@ var ts; typeToTypeNode: nodeBuilder.typeToTypeNode, indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + symbolToEntityName: nodeBuilder.symbolToEntityName, + symbolToExpression: nodeBuilder.symbolToExpression, + symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, + symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, + typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, getSymbolsInScope: function (location, meaning) { location = ts.getParseTreeNode(location); return location ? getSymbolsInScope(location, meaning) : []; @@ -19502,16 +19887,40 @@ var ts; typeToString: function (type, enclosingDeclaration, flags) { return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); }, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: function (symbol, enclosingDeclaration, meaning) { - return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + symbolToString: function (symbol, enclosingDeclaration, meaning, flags) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags); }, + typePredicateToString: function (predicate, enclosingDeclaration, flags) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags); + }, + writeSignature: function (signature, enclosingDeclaration, flags, kind, writer) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind, writer); + }, + writeType: function (type, enclosingDeclaration, flags, writer) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + writeSymbol: function (symbol, enclosingDeclaration, meaning, flags, writer) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags, writer); + }, + writeTypePredicate: function (predicate, enclosingDeclaration, flags, writer) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + getSymbolDisplayBuilder: getSymbolDisplayBuilder, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, getContextualType: function (node) { node = ts.getParseTreeNode(node, ts.isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: function (node, argIndex) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, + isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) { node = ts.getParseTreeNode(node, ts.isCallLikeExpression); @@ -19526,7 +19935,11 @@ var ts; }, isValidPropertyAccess: function (node, propertyName) { node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); - return node ? isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)) : false; + return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)); + }, + isValidPropertyAccessForCompletions: function (node, type, property) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessExpression); + return !!node && isValidPropertyAccessForCompletions(node, type, property); }, getSignatureFromDeclaration: function (declaration) { declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); @@ -19550,7 +19963,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, - getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -19590,28 +20003,40 @@ var ts; getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); }, getBaseConstraintOfType: getBaseConstraintOfType, getDefaultFromTypeParameter: function (type) { return type && type.flags & 32768 ? getDefaultFromTypeParameter(type) : undefined; }, - resolveName: function (name, location, meaning) { - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined, false); + resolveName: function (name, location, meaning, excludeGlobals) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined, false, excludeGlobals); }, getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, getAccessibleSymbolChain: getAccessibleSymbolChain, + getTypePredicateOfSignature: getTypePredicateOfSignature, + resolveExternalModuleSymbol: resolveExternalModuleSymbol, + tryGetThisTypeAt: function (node) { + node = ts.getParseTreeNode(node); + return node && tryGetThisTypeAt(node); + }, + getTypeArgumentConstraint: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, }; var tupleTypes = []; var unionTypes = ts.createMap(); var intersectionTypes = ts.createMap(); var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); + var conditionalTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4, "unknown"); var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1, "any"); var autoType = createIntrinsicType(1, "any"); + var wildcardType = createIntrinsicType(1, "any"); var unknownType = createIntrinsicType(1, "unknown"); var undefinedType = createIntrinsicType(4096, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 | 4194304, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 | 16777216, "undefined"); var nullType = createIntrinsicType(8192, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 | 4194304, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 | 16777216, "null"); var stringType = createIntrinsicType(2, "string"); var numberType = createIntrinsicType(4, "number"); var trueType = createIntrinsicType(128, "true"); @@ -19622,7 +20047,7 @@ var ts; var neverType = createIntrinsicType(16384, "never"); var silentNeverType = createIntrinsicType(16384, "never"); var implicitNeverType = createIntrinsicType(16384, "never"); - var nonPrimitiveType = createIntrinsicType(33554432, "object"); + var nonPrimitiveType = createIntrinsicType(134217728, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyTypeLiteralSymbol = createSymbol(2048, "__type"); emptyTypeLiteralSymbol.members = ts.createSymbolTable(); @@ -19630,7 +20055,7 @@ var ts; var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyGenericType.instantiations = ts.createMap(); var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); - anyFunctionType.flags |= 16777216; + anyFunctionType.flags |= 67108864; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -19638,6 +20063,7 @@ var ts; var markerSubType = createType(32768); markerSubType.constraint = markerSuperType; var markerOtherType = createType(32768); + var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType); var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, undefined, 0, false, false); var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false); @@ -19645,6 +20071,7 @@ var ts; var enumNumberIndexInfo = createIndexInfo(stringType, true); var jsObjectLiteralIndexInfo = createIndexInfo(anyType, false); var globals = ts.createSymbolTable(); + var reverseMappedCache = ts.createMap(); var ambientModulesCache; var patternAmbientModules; var globalObjectType; @@ -19736,15 +20163,148 @@ var ts; var jsxTypes = ts.createUnderscoreEscapedMap(); var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); + var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); - var _displayBuilder; var builtinGlobals = ts.createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor); initializeTypeChecker(); return checker; + function getSymbolDisplayBuilder() { + return { + buildTypeDisplay: function (type, writer, enclosingDeclaration, flags) { + typeToString(type, enclosingDeclaration, flags, emitTextWriterWrapper(writer)); + }, + buildSymbolDisplay: function (symbol, writer, enclosingDeclaration, meaning, flags) { + symbolToString(symbol, enclosingDeclaration, meaning, flags | 4, emitTextWriterWrapper(writer)); + }, + buildSignatureDisplay: function (signature, writer, enclosing, flags, kind) { + signatureToString(signature, enclosing, flags, kind, emitTextWriterWrapper(writer)); + }, + buildIndexSignatureDisplay: function (info, writer, kind, enclosing, flags) { + var sig = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, kind, enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, sig, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildParameterDisplay: function (symbol, writer, enclosing, flags) { + var node = nodeBuilder.symbolToParameterDeclaration(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplay: function (tp, writer, enclosing, flags) { + var node = nodeBuilder.typeParameterToDeclaration(tp, enclosing, toNodeBuilderFlags(flags) | 3112960 | 8192, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypePredicateDisplay: function (predicate, writer, enclosing, flags) { + typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplayFromSymbol: function (symbol, writer, enclosing, flags) { + var nodes = nodeBuilder.symbolToTypeParameterDeclarations(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeList(26896, nodes, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForParametersAndDelimiters: function (thisParameter, parameters, writer, enclosing, originalFlags) { + var printer = ts.createPrinter({ removeComments: true }); + var flags = 8192 | 3112960 | toNodeBuilderFlags(originalFlags); + var thisParameterArray = thisParameter ? [nodeBuilder.symbolToParameterDeclaration(thisParameter, enclosing, flags)] : []; + var params = ts.createNodeArray(thisParameterArray.concat(ts.map(parameters, function (param) { return nodeBuilder.symbolToParameterDeclaration(param, enclosing, flags); }))); + printer.writeList(1296, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForTypeParametersAndDelimiters: function (typeParameters, writer, enclosing, flags) { + var printer = ts.createPrinter({ removeComments: true }); + var args = ts.createNodeArray(ts.map(typeParameters, function (p) { return nodeBuilder.typeParameterToDeclaration(p, enclosing, toNodeBuilderFlags(flags)); })); + printer.writeList(26896, args, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildReturnTypeDisplay: function (signature, writer, enclosing, flags) { + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = getTypePredicateOfSignature(signature); + if (predicate) { + return typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + } + var node = nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + } + }; + function emitTextWriterWrapper(underlying) { + return { + write: ts.noop, + writeTextOfNode: ts.noop, + writeLine: ts.noop, + increaseIndent: function () { + return underlying.increaseIndent(); + }, + decreaseIndent: function () { + return underlying.decreaseIndent(); + }, + getText: function () { + return ""; + }, + rawWrite: ts.noop, + writeLiteral: function (s) { + return underlying.writeStringLiteral(s); + }, + getTextPos: function () { + return 0; + }, + getLine: function () { + return 0; + }, + getColumn: function () { + return 0; + }, + getIndent: function () { + return 0; + }, + isAtStartOfLine: function () { + return false; + }, + clear: function () { + return underlying.clear(); + }, + writeKeyword: function (text) { + return underlying.writeKeyword(text); + }, + writeOperator: function (text) { + return underlying.writeOperator(text); + }, + writePunctuation: function (text) { + return underlying.writePunctuation(text); + }, + writeSpace: function (text) { + return underlying.writeSpace(text); + }, + writeStringLiteral: function (text) { + return underlying.writeStringLiteral(text); + }, + writeParameter: function (text) { + return underlying.writeParameter(text); + }, + writeProperty: function (text) { + return underlying.writeProperty(text); + }, + writeSymbol: function (text, symbol) { + return underlying.writeSymbol(text, symbol); + }, + trackSymbol: function (symbol, enclosing, meaning) { + return underlying.trackSymbol && underlying.trackSymbol(symbol, enclosing, meaning); + }, + reportInaccessibleThisError: function () { + return underlying.reportInaccessibleThisError && underlying.reportInaccessibleThisError(); + }, + reportPrivateInBaseOfClassExpression: function (name) { + return underlying.reportPrivateInBaseOfClassExpression && underlying.reportPrivateInBaseOfClassExpression(name); + }, + reportInaccessibleUniqueSymbolError: function () { + return underlying.reportInaccessibleUniqueSymbolError && underlying.reportInaccessibleUniqueSymbolError(); + } + }; + } + } function getJsxNamespace() { if (!_jsxNamespace) { _jsxNamespace = "React"; @@ -19846,7 +20406,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 234 && source.valueDeclaration.kind !== 234))) { + (target.valueDeclaration.kind === 237 && source.valueDeclaration.kind !== 237))) { target.valueDeclaration = source.valueDeclaration; } ts.addRange(target.declarations, source.declarations); @@ -19866,8 +20426,11 @@ var ts; error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - var message_2 = target.flags & 2 || source.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message_2 = target.flags & 384 || source.flags & 384 + ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & 2 || source.flags & 2 + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); }); @@ -19953,7 +20516,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 269 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 272 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -19996,26 +20559,26 @@ var ts; return true; } var sourceFiles = host.getSourceFiles(); - return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); + return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos) { - if (declaration.kind === 177) { - var errorBindingElement = ts.getAncestor(usage, 177); + if (declaration.kind === 180) { + var errorBindingElement = ts.getAncestor(usage, 180); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 227), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 230), usage); } - else if (declaration.kind === 227) { + else if (declaration.kind === 230) { return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } return true; } - if (usage.parent.kind === 247 || (usage.parent.kind === 244 && usage.parent.isExportEquals)) { + if (usage.parent.kind === 250 || (usage.parent.kind === 247 && usage.parent.isExportEquals)) { return true; } - if (usage.kind === 244 && usage.isExportEquals) { + if (usage.kind === 247 && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -20023,9 +20586,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 209: - case 215: - case 217: + case 212: + case 218: + case 220: if (isSameScopeDescendentOf(usage, declaration, container)) { return true; } @@ -20042,16 +20605,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 150 && + current.parent.kind === 151 && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32)) { - if (declaration.kind === 152) { + if (declaration.kind === 153) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 150 && !ts.hasModifier(declaration, 32); + var isDeclarationInstanceProperty = declaration.kind === 151 && !ts.hasModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -20060,14 +20623,15 @@ var ts; }); } } - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, suggestedNameNotFoundMessage) { - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, getSymbol, suggestedNameNotFoundMessage); + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, suggestedNameNotFoundMessage) { + if (excludeGlobals === void 0) { excludeGlobals = false; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, suggestedNameNotFoundMessage); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, lookup, suggestedNameNotFoundMessage) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, suggestedNameNotFoundMessage) { var originalLocation = location; var result; var lastLocation; - var lastNonBlockLocation; + var lastSelfReferenceLocation; var propertyWithInvalidInitializer; var errorLocation = location; var grandparent; @@ -20077,20 +20641,23 @@ var ts; if (result = lookup(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 793064 && lastLocation.kind !== 279) { + if (meaning & result.flags & 793064 && lastLocation.kind !== 282) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 147 || - lastLocation.kind === 146 + lastLocation.kind === 148 || + lastLocation.kind === 147 : false; } if (meaning & 107455 && result.flags & 1) { useResult = - lastLocation.kind === 147 || + lastLocation.kind === 148 || (lastLocation === location.type && - result.valueDeclaration.kind === 147); + result.valueDeclaration.kind === 148); } } + else if (location.kind === 170) { + useResult = lastLocation === location.trueType; + } if (useResult) { break loop; } @@ -20100,13 +20667,13 @@ var ts; } } switch (location.kind) { - case 269: + case 272: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 234: + case 237: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 269 || ts.isAmbientModule(location)) { + if (location.kind === 272 || ts.isAmbientModule(location)) { if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { @@ -20117,7 +20684,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 && - ts.getDeclarationOfKind(moduleExport, 247)) { + ts.getDeclarationOfKind(moduleExport, 250)) { break; } } @@ -20125,13 +20692,13 @@ var ts; break loop; } break; - case 233: + case 236: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 151: case 150: - case 149: if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -20141,9 +20708,9 @@ var ts; } } break; - case 230: - case 200: - case 231: + case 233: + case 203: + case 234: if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 793064)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = undefined; @@ -20155,7 +20722,7 @@ var ts; } break loop; } - if (location.kind === 200 && meaning & 32) { + if (location.kind === 203 && meaning & 32) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -20163,7 +20730,7 @@ var ts; } } break; - case 202: + case 205: if (lastLocation === location.expression && location.parent.token === 85) { var container = location.parent.parent; if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064))) { @@ -20174,28 +20741,28 @@ var ts; } } break; - case 145: + case 146: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 231) { + if (ts.isClassLike(grandparent) || grandparent.kind === 234) { if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 793064)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 229: - case 188: + case 156: + case 232: + case 191: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 187: + case 190: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -20208,8 +20775,8 @@ var ts; } } break; - case 148: - if (location.parent && location.parent.kind === 147) { + case 149: + if (location.parent && location.parent.kind === 148) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -20217,23 +20784,25 @@ var ts; } break; } - if (location.kind !== 208) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { - result.isReferenced = true; + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + result.isReferenced |= meaning; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 269); + ts.Debug.assert(lastLocation.kind === 272); if (lastLocation.commonJsModuleIndicator && name === "exports") { return lastLocation.symbol; } } - result = lookup(globals, name, meaning); + if (!excludeGlobals) { + result = lookup(globals, name, meaning); + } } if (!result) { if (nameNotFoundMessage) { @@ -20274,27 +20843,40 @@ var ts; } if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 237) { + if (decls && decls.length === 1 && decls[0].kind === 240) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); } } } return result; } + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 232: + case 233: + case 234: + case 236: + case 235: + case 237: + return true; + default: + return false; + } + } function diagnosticName(nameArg) { return ts.isString(nameArg) ? ts.unescapeLeadingUnderscores(nameArg) : ts.declarationNameToString(nameArg); } function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 146 && decl.parent === container) { + if (decl.kind === 147 && decl.parent === container) { return true; } } return false; } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 71 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } var container = ts.getThisContainer(errorLocation, true); @@ -20333,9 +20915,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 71: - case 180: + case 183: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 202: + case 205: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -20396,7 +20978,7 @@ var ts; } function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384)); - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 233) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 236) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 2097152) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { if (result.flags & 2) { @@ -20415,13 +20997,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 238: - return node; - case 240: - return node.parent; case 241: - return node.parent.parent; + return node; case 243: + return node.parent; + case 244: + return node.parent.parent; + case 246: return node.parent.parent.parent; default: return undefined; @@ -20431,11 +21013,35 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 249) { + if (node.moduleReference.kind === 252) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } + function resolveExportByName(moduleSymbol, name, dontResolveAlias) { + var exportValue = moduleSymbol.exports.get("export="); + return exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), name) + : resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias); + } + function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) { + if (!allowSyntheticDefaultImports) { + return false; + } + if (!file || file.isDeclarationFile) { + if (resolveExportByName(moduleSymbol, "default", dontResolveAlias)) { + return false; + } + if (resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias)) { + return false; + } + return true; + } + if (!ts.isSourceFileJavaScript(file)) { + return hasExportAssignmentSymbol(moduleSymbol); + } + return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias); + } function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { @@ -20444,15 +21050,14 @@ var ts; exportDefaultSymbol = moduleSymbol; } else { - var exportValue = moduleSymbol.exports.get("export="); - exportDefaultSymbol = exportValue - ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") - : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", dontResolveAlias); } - if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { + var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias); + if (!exportDefaultSymbol && !hasSyntheticDefault) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } - else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + else if (!exportDefaultSymbol && hasSyntheticDefault) { return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; @@ -20540,19 +21145,19 @@ var ts; } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 238: - return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 240: - return getTargetOfImportClause(node, dontRecursivelyResolve); case 241: - return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); case 243: - return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 247: - return getTargetOfExportSpecifier(node, 107455 | 793064 | 1920, dontRecursivelyResolve); + return getTargetOfImportClause(node, dontRecursivelyResolve); case 244: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 246: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 250: + return getTargetOfExportSpecifier(node, 107455 | 793064 | 1920, dontRecursivelyResolve); + case 247: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 237: + case 240: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } @@ -20601,10 +21206,10 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 244) { + if (node.kind === 247) { checkExpressionCached(node.expression); } - else if (node.kind === 247) { + else if (node.kind === 250) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -20616,11 +21221,11 @@ var ts; if (entityName.kind === 71 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 71 || entityName.parent.kind === 144) { + if (entityName.kind === 71 || entityName.parent.kind === 145) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 238); + ts.Debug.assert(entityName.parent.kind === 241); return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias); } } @@ -20639,19 +21244,18 @@ var ts; return undefined; } } - else if (name.kind === 144 || name.kind === 180) { + else if (name.kind === 145 || name.kind === 183) { var left = void 0; - if (name.kind === 144) { + if (name.kind === 145) { left = name.left; } - else if (name.kind === 180 && - (name.expression.kind === 186 || ts.isEntityNameExpression(name.expression))) { + else if (name.kind === 183) { left = name.expression; } else { return undefined; } - var right = name.kind === 144 ? name.right : name.name; + var right = name.kind === 145 ? name.right : name.name; var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -20670,11 +21274,6 @@ var ts; return undefined; } } - else if (name.kind === 186) { - return ts.isEntityNameExpression(name.expression) ? - resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : - undefined; - } else { ts.Debug.assertNever(name, "Unknown entity name kind."); } @@ -20686,11 +21285,9 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 && moduleReferenceExpression.kind !== 13) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return ts.isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -20730,7 +21327,7 @@ var ts; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } else if (noImplicitAny && moduleNotFoundError) { - var errorInfo = !resolvedModule.isExternalLibraryImport ? undefined : ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference); + var errorInfo = resolvedModule.packageId && ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, resolvedModule.packageId.name); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } @@ -20758,8 +21355,41 @@ var ts; } function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); - if (!dontResolveAlias && symbol && !(symbol.flags & (1536 | 3))) { - error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + if (!dontResolveAlias && symbol) { + if (!(symbol.flags & (1536 | 3))) { + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + return symbol; + } + if (compilerOptions.esModuleInterop) { + var referenceParent = moduleReferenceExpression.parent; + if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) || + ts.isImportCall(referenceParent)) { + var type = getTypeOfSymbol(symbol); + var sigs = getSignaturesOfStructuredType(type, 0); + if (!sigs || !sigs.length) { + sigs = getSignaturesOfStructuredType(type, 1); + } + if (sigs && sigs.length) { + var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol); + var result = createSymbol(symbol.flags, symbol.escapedName); + result.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result.parent = symbol.parent; + result.target = symbol; + result.originatingImport = referenceParent; + if (symbol.valueDeclaration) + result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; + if (symbol.members) + result.members = ts.cloneMap(symbol.members); + if (symbol.exports) + result.exports = ts.cloneMap(symbol.exports); + var resolvedModuleType = resolveStructuredTypeMembers(moduleType); + result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.stringIndexInfo, resolvedModuleType.numberIndexInfo); + return result; + } + } + } } return symbol; } @@ -20886,7 +21516,7 @@ var ts; var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 153 && ts.nodeIsPresent(member.body)) { + if (member.kind === 154 && ts.nodeIsPresent(member.body)) { return member; } } @@ -20959,11 +21589,11 @@ var ts; } } switch (location.kind) { - case 269: + case 272: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 234: + case 237: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -20981,11 +21611,11 @@ var ts; } var visitedSymbolTables = []; return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - function getAccessibleSymbolChainFromSymbolTable(symbols) { + function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification) { if (!ts.pushIfUnique(visitedSymbolTables, symbols)) { return undefined; } - var result = trySymbolTable(symbols); + var result = trySymbolTable(symbols, ignoreQualification); visitedSymbolTables.pop(); return result; } @@ -20993,28 +21623,26 @@ var ts; return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning) || !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { + function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) && !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning)); } - function isUMDExportSymbol(symbol) { - return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); - } - function trySymbolTable(symbols) { - if (isAccessible(symbols.get(symbol.escapedName))) { + function trySymbolTable(symbols, ignoreQualification) { + if (isAccessible(symbols.get(symbol.escapedName), undefined, ignoreQualification)) { return [symbol]; } return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 2097152 && symbolFromSymbolTable.escapedName !== "export=" - && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) + && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) { + if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { return [symbolFromSymbolTable]; } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + var candidateTable = getExportsOfSymbol(resolvedImportedSymbol); + var accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable, true); if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); } @@ -21032,7 +21660,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 247)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 250)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -21046,10 +21674,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 150: - case 152: - case 154: + case 151: + case 153: case 155: + case 156: continue; default: return false; @@ -21063,6 +21691,10 @@ var ts; var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064, false); return access.accessibility === 0; } + function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 107455, false); + return access.accessibility === 0; + } function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { if (symbol && enclosingDeclaration && !(symbol.flags & 262144)) { var initialSymbol = symbol; @@ -21106,7 +21738,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 269 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 272 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -21133,13 +21765,13 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 163 || + if (entityName.parent.kind === 164 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 145) { + entityName.parent.kind === 146) { meaning = 107455 | 1048576; } - else if (entityName.kind === 144 || entityName.kind === 180 || - entityName.parent.kind === 238) { + else if (entityName.kind === 145 || entityName.kind === 183 || + entityName.parent.kind === 241) { meaning = 1920; } else { @@ -21153,97 +21785,134 @@ var ts; errorNode: firstIdentifier }; } - function writeKeyword(writer, kind) { - writer.writeKeyword(ts.tokenToString(kind)); + function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { + if (flags === void 0) { flags = 4; } + var nodeFlags = 3112960; + if (flags & 2) { + nodeFlags |= 128; + } + if (flags & 1) { + nodeFlags |= 512; + } + if (flags & 8) { + nodeFlags |= 16384; + } + var builder = flags & 4 ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; + return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); + function symbolToStringWorker(writer) { + var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4, entity, sourceFile, writer); + return writer; + } } - function writePunctuation(writer, kind) { - writer.writePunctuation(ts.tokenToString(kind)); + function signatureToString(signature, enclosingDeclaration, flags, kind, writer) { + return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker); + function signatureToStringWorker(writer) { + var sigOutput; + if (flags & 262144) { + sigOutput = kind === 1 ? 163 : 162; + } + else { + sigOutput = kind === 1 ? 158 : 157; + } + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512); + var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4, sig, sourceFile, writer); + return writer; + } } - function writeSpace(writer) { - writer.writeSpace(" "); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); - }); - } - function signatureToString(signature, enclosingDeclaration, flags, kind) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); - }); - } - function typeToString(type, enclosingDeclaration, flags) { - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | ts.NodeBuilderFlags.IgnoreErrors | ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName); + function typeToString(type, enclosingDeclaration, flags, writer) { + if (writer === void 0) { writer = ts.createTextWriter(""); } + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960, writer); ts.Debug.assert(typeNode !== undefined, "should always get typenode"); var options = { removeComments: true }; - var writer = ts.createTextWriter(""); var printer = ts.createPrinter(options); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4, typeNode, sourceFile, writer); var result = writer.getText(); - var maxLength = compilerOptions.noErrorTruncation || flags & 8 ? undefined : 100; - if (maxLength && result.length >= maxLength) { + var maxLength = compilerOptions.noErrorTruncation || flags & 1 ? undefined : 100; + if (maxLength && result && result.length >= maxLength) { return result.substr(0, maxLength - "...".length) + "..."; } return result; - function toNodeBuilderFlags(flags) { - var result = ts.NodeBuilderFlags.None; - if (!flags) { - return result; - } - if (flags & 8) { - result |= ts.NodeBuilderFlags.NoTruncation; - } - if (flags & 256) { - result |= ts.NodeBuilderFlags.UseFullyQualifiedType; - } - if (flags & 4096) { - result |= ts.NodeBuilderFlags.SuppressAnyReturnType; - } - if (flags & 1) { - result |= ts.NodeBuilderFlags.WriteArrayAsGenericType; - } - if (flags & 64) { - result |= ts.NodeBuilderFlags.WriteTypeArgumentsOfSignature; - } - return result; - } + } + function toNodeBuilderFlags(flags) { + return flags & 9469291; } function createNodeBuilder() { return { - typeToTypeNode: function (type, enclosingDeclaration, flags) { + typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = typeToTypeNodeHelper(type, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = signatureToSignatureDeclarationHelper(signature, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; - } + }, + symbolToEntityName: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToName(symbol, context, meaning, false); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToExpression: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToExpression(symbol, context, meaning); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToTypeParameterDeclarations: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParametersToTypeParameterDeclarations(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToParameterDeclaration: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToParameterDeclaration(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + typeParameterToDeclaration: function (parameter, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParameterToDeclaration(parameter, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, }; - function createNodeBuilderContext(enclosingDeclaration, flags) { + function createNodeBuilderContext(enclosingDeclaration, flags, tracker) { return { enclosingDeclaration: enclosingDeclaration, flags: flags, + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop }, encounteredError: false, symbolStack: undefined }; } function typeToTypeNodeHelper(type, context) { - var inTypeAlias = context.flags & ts.NodeBuilderFlags.InTypeAlias; - context.flags &= ~ts.NodeBuilderFlags.InTypeAlias; + var inTypeAlias = context.flags & 8388608; + context.flags &= ~8388608; if (!type) { context.encounteredError = true; return undefined; @@ -21252,10 +21921,10 @@ var ts; return ts.createKeywordTypeNode(119); } if (type.flags & 2) { - return ts.createKeywordTypeNode(136); + return ts.createKeywordTypeNode(137); } if (type.flags & 4) { - return ts.createKeywordTypeNode(133); + return ts.createKeywordTypeNode(134); } if (type.flags & 8) { return ts.createKeywordTypeNode(122); @@ -21280,31 +21949,39 @@ var ts; return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); } if (type.flags & 1024) { - return ts.createTypeOperatorNode(140, ts.createKeywordTypeNode(137)); + if (!(context.flags & 1048576)) { + if (context.tracker.reportInaccessibleUniqueSymbolError) { + context.tracker.reportInaccessibleUniqueSymbolError(); + } + } + return ts.createTypeOperatorNode(141, ts.createKeywordTypeNode(138)); } if (type.flags & 2048) { return ts.createKeywordTypeNode(105); } if (type.flags & 4096) { - return ts.createKeywordTypeNode(139); + return ts.createKeywordTypeNode(140); } if (type.flags & 8192) { return ts.createKeywordTypeNode(95); } if (type.flags & 16384) { - return ts.createKeywordTypeNode(130); + return ts.createKeywordTypeNode(131); } if (type.flags & 512) { - return ts.createKeywordTypeNode(137); + return ts.createKeywordTypeNode(138); } - if (type.flags & 33554432) { - return ts.createKeywordTypeNode(134); + if (type.flags & 134217728) { + return ts.createKeywordTypeNode(135); } if (type.flags & 32768 && type.isThisType) { - if (context.flags & ts.NodeBuilderFlags.InObjectTypeLiteral) { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowThisInObjectLiteral)) { + if (context.flags & 4194304) { + if (!context.encounteredError && !(context.flags & 32768)) { context.encounteredError = true; } + if (context.tracker.reportInaccessibleThisError) { + context.tracker.reportInaccessibleThisError(); + } } return ts.createThis(); } @@ -21317,7 +21994,7 @@ var ts; var name = type.symbol ? symbolToName(type.symbol, context, 793064, false) : ts.createIdentifier("?"); return ts.createTypeReferenceNode(name, undefined); } - if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { + if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -21326,11 +22003,11 @@ var ts; var types = type.flags & 131072 ? formatUnionTypes(type.types) : type.types; var typeNodes = mapToTypeNodes(types, context); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 ? 167 : 168, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 ? 168 : 169, typeNodes); return unionOrIntersectionTypeNode; } else { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowEmptyUnionOrIntersection)) { + if (!context.encounteredError && !(context.flags & 262144)) { context.encounteredError = true; } return undefined; @@ -21350,12 +22027,22 @@ var ts; var indexTypeNode = typeToTypeNodeHelper(type.indexType, context); return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 2097152) { + var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); + var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); + var trueTypeNode = typeToTypeNodeHelper(type.trueType, context); + var falseTypeNode = typeToTypeNodeHelper(type.falseType, context); + return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + if (type.flags & 4194304) { + return typeToTypeNodeHelper(type.typeParameter, context); + } ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { ts.Debug.assert(!!(type.flags & 65536)); - var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131) : undefined; - var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55) : undefined; - var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context); + var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined; + var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined; + var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); var mappedTypeNode = ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); return ts.setEmitFlags(mappedTypeNode, 1); @@ -21363,7 +22050,7 @@ var ts; function createAnonymousTypeNode(type) { var symbol = type.symbol; if (symbol) { - if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 203 && context.flags & 2048) || symbol.flags & (384 | 512) || shouldWriteTypeOfFunctionSymbol()) { return createTypeQueryNodeFromSymbol(symbol, 107455); @@ -21382,10 +22069,16 @@ var ts; if (!context.symbolStack) { context.symbolStack = []; } - context.symbolStack.push(symbol); - var result = createTypeNodeFromObjectType(type); - context.symbolStack.pop(); - return result; + var isConstructorObject = ts.getObjectFlags(type) & 16 && type.symbol && type.symbol.flags & 32; + if (isConstructorObject) { + return createTypeNodeFromObjectType(type); + } + else { + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } } } else { @@ -21397,10 +22090,11 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 || declaration.parent.kind === 235; + return declaration.parent.kind === 272 || declaration.parent.kind === 238; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return ts.contains(context.symbolStack, symbol); + return (!!(context.flags & 4096) || ts.contains(context.symbolStack, symbol)) && + (!(context.flags & 8) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); } } } @@ -21415,21 +22109,21 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 161, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 162, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 162, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 163, context); return signatureNode; } } var savedFlags = context.flags; - context.flags |= ts.NodeBuilderFlags.InObjectTypeLiteral; + context.flags |= 4194304; var members = createTypeNodesFromResolvedType(resolved); context.flags = savedFlags; var typeLiteralNode = ts.createTypeLiteralNode(members); - return ts.setEmitFlags(typeLiteralNode, 1); + return ts.setEmitFlags(typeLiteralNode, (context.flags & 1024) ? 0 : 1); } function createTypeQueryNodeFromSymbol(symbol, symbolFlags) { var entityName = symbolToName(symbol, context, symbolFlags, false); @@ -21442,7 +22136,7 @@ var ts; function typeReferenceToTypeNode(type) { var typeArguments = type.typeArguments || ts.emptyArray; if (type.target === globalArrayType) { - if (context.flags & ts.NodeBuilderFlags.WriteArrayAsGenericType) { + if (context.flags & 2) { var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context); return ts.createTypeReferenceNode("Array", [typeArgumentNode]); } @@ -21456,12 +22150,17 @@ var ts; return ts.createTupleTypeNode(tupleConstituentNodes); } } - if (context.encounteredError || (context.flags & ts.NodeBuilderFlags.AllowEmptyTuple)) { + if (context.encounteredError || (context.flags & 524288)) { return ts.createTupleTypeNode([]); } context.encounteredError = true; return undefined; } + else if (context.flags & 2048 && + type.symbol.valueDeclaration && + type.symbol.valueDeclaration.kind === 203) { + return createAnonymousTypeNode(type); + } else { var outerTypeParameters = type.target.outerTypeParameters; var i = 0; @@ -21530,14 +22229,17 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 156, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 157, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 157, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 158, context)); } if (resolvedType.stringIndexInfo) { - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0, context)); + var indexInfo = resolvedType.objectFlags & 2048 ? + createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : + resolvedType.stringIndexInfo; + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0, context)); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1, context)); @@ -21548,9 +22250,25 @@ var ts; } for (var _d = 0, properties_1 = properties; _d < properties_1.length; _d++) { var propertySymbol = properties_1[_d]; - var propertyType = getTypeOfSymbol(propertySymbol); + if (context.flags & 2048) { + if (propertySymbol.flags & 4194304) { + continue; + } + if (ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 | 16) && context.tracker.reportPrivateInBaseOfClassExpression) { + context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName)); + } + } + var propertyType = ts.getCheckFlags(propertySymbol) & 2048 && context.flags & 33554432 ? + anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; + if (ts.getCheckFlags(propertySymbol) & 1024) { + var decl = ts.firstOrUndefined(propertySymbol.declarations); + var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455); + if (name && context.tracker.trackSymbol) { + context.tracker.trackSymbol(name, saveEnclosingDeclaration, 107455); + } + } var propertyName = symbolToName(propertySymbol, context, 107455, true); context.enclosingDeclaration = saveEnclosingDeclaration; var optionalToken = propertySymbol.flags & 16777216 ? ts.createToken(55) : undefined; @@ -21558,15 +22276,18 @@ var ts; var signatures = getSignaturesOfType(propertyType, 0); for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { var signature = signatures_1[_e]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 151, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(methodDeclaration); } } else { + var savedFlags = context.flags; + context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048) ? 33554432 : 0; var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119); - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(131)] : undefined; + context.flags = savedFlags; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132)] : undefined; var propertySignature = ts.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode, undefined); typeElements.push(propertySignature); } @@ -21589,21 +22310,31 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 136 : 133); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 137 : 134); var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); - var typeNode = typeToTypeNodeHelper(indexInfo.type, context); - return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(131)] : undefined, [indexingParameter], typeNode); + var typeNode = indexInfo.type ? typeToTypeNodeHelper(indexInfo.type, context) : typeToTypeNodeHelper(anyType, context); + if (!indexInfo.type && !(context.flags & 2097152)) { + context.encounteredError = true; + } + return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(132)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { - var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + var typeParameters; + var typeArguments; + if (context.flags & 32 && signature.target && signature.mapper && signature.target.typeParameters) { + typeArguments = signature.target.typeParameters.map(function (parameter) { return typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context); }); + } + else { + typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + } var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); } var returnTypeNode; - if (signature.typePredicate) { - var typePredicate = signature.typePredicate; + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { var parameterName = typePredicate.kind === 1 ? ts.setEmitFlags(ts.createIdentifier(typePredicate.parameterName), 16777216) : ts.createThisTypeNode(); @@ -21614,7 +22345,7 @@ var ts; var returnType = getReturnTypeOfSignature(signature); returnTypeNode = returnType && typeToTypeNodeHelper(returnType, context); } - if (context.flags & ts.NodeBuilderFlags.SuppressAnyReturnType) { + if (context.flags & 256) { if (returnTypeNode && returnTypeNode.kind === 119) { returnTypeNode = undefined; } @@ -21622,25 +22353,28 @@ var ts; else if (!returnTypeNode) { returnTypeNode = ts.createKeywordTypeNode(119); } - return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode); + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments); } - function typeParameterToDeclaration(type, context) { + function typeParameterToDeclaration(type, context, constraint) { + if (constraint === void 0) { constraint = getConstraintFromTypeParameter(type); } + var savedContextFlags = context.flags; + context.flags &= ~512; var name = symbolToName(type.symbol, context, 793064, true); - var constraint = getConstraintFromTypeParameter(type); var constraintNode = constraint && typeToTypeNodeHelper(constraint, context); var defaultParameter = getDefaultFromTypeParameter(type); var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); + context.flags = savedContextFlags; return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); } function symbolToParameterDeclaration(parameterSymbol, context) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 147); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148); ts.Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter); var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { parameterType = getOptionalType(parameterType); } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); - var modifiers = parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); + var modifiers = !(context.flags & 8192) && parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); var dotDotDotToken = !parameterDeclaration || ts.isRestParameter(parameterDeclaration) ? ts.createToken(24) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? @@ -21657,52 +22391,27 @@ var ts; function elideInitializerAndSetEmitFlags(node) { var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 177) { + if (clone.kind === 180) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 | 16777216); } } } - function symbolToName(symbol, context, meaning, expectsIdentifier) { + function lookupSymbolChain(symbol, context, meaning) { + context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); var chain; var isTypeParameter = symbol.flags & 262144; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & ts.NodeBuilderFlags.UseFullyQualifiedType)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64)) { chain = getSymbolChain(symbol, meaning, true); ts.Debug.assert(chain && chain.length > 0); } else { chain = [symbol]; } - if (expectsIdentifier && chain.length !== 1 - && !context.encounteredError - && !(context.flags & ts.NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { - context.encounteredError = true; - } - return createEntityNameFromSymbolChain(chain, chain.length - 1); - function createEntityNameFromSymbolChain(chain, index) { - ts.Debug.assert(chain && 0 <= index && index < chain.length); - var symbol = chain[index]; - var typeParameterNodes; - if (context.flags & ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName && index > 0) { - var parentSymbol = chain[index - 1]; - var typeParameters = void 0; - if (ts.getCheckFlags(symbol) & 1) { - typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); - } - else { - var targetSymbol = getTargetSymbol(parentSymbol); - if (targetSymbol.flags & (32 | 64 | 524288)) { - typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - } - } - typeParameterNodes = mapToTypeNodes(typeParameters, context); - } - var identifier = ts.setEmitFlags(ts.createIdentifier(getNameOfSymbolAsWritten(symbol, context), typeParameterNodes), 16777216); - return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; - } + return chain; function getSymbolChain(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, false); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128)); var parentSymbol; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { @@ -21725,11 +22434,105 @@ var ts; } } } + function typeParametersToTypeParameterDeclarations(symbol, context) { + var typeParameterNodes; + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & (32 | 64 | 524288)) { + typeParameterNodes = ts.createNodeArray(ts.map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), function (tp) { return typeParameterToDeclaration(tp, context); })); + } + return typeParameterNodes; + } + function lookupTypeParameterNodes(chain, index, context) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterNodes; + if (context.flags & 512 && index < (chain.length - 1)) { + var parentSymbol = symbol; + var nextSymbol = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol) & 1) { + var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol); + typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + } + else { + typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); + } + } + return typeParameterNodes; + } + function symbolToName(symbol, context, meaning, expectsIdentifier) { + var chain = lookupSymbolChain(symbol, context, meaning); + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & 65536)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216; + } + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216); + identifier.symbol = symbol; + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + } + function symbolToExpression(symbol, context, meaning) { + var chain = lookupSymbolChain(symbol, context, meaning); + return createExpressionFromSymbolChain(chain, chain.length - 1); + function createExpressionFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216; + } + var firstChar = symbolName.charCodeAt(0); + var canUsePropertyAccess = ts.isIdentifierStart(firstChar, languageVersion); + if (index === 0 || canUsePropertyAccess) { + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216); + identifier.symbol = symbol; + return index > 0 ? ts.createPropertyAccess(createExpressionFromSymbolChain(chain, index - 1), identifier) : identifier; + } + else { + if (firstChar === 91) { + symbolName = symbolName.substring(1, symbolName.length - 1); + firstChar = symbolName.charCodeAt(0); + } + var expression = void 0; + if (ts.isSingleOrDoubleQuote(firstChar)) { + expression = ts.createLiteral(symbolName.substring(1, symbolName.length - 1).replace(/\\./g, function (s) { return s.substring(1); })); + expression.singleQuote = firstChar === 39; + } + else if (("" + +symbolName) === symbolName) { + expression = ts.createLiteral(+symbolName); + } + if (!expression) { + expression = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216); + expression.symbol = symbol; + } + return ts.createElementAccess(createExpressionFromSymbolChain(chain, index - 1), expression); + } + } + } } - function typePredicateToString(typePredicate, enclosingDeclaration, flags) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); - }); + function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) { + return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); + function typePredicateToStringWorker(writer) { + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512)); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4, predicate, sourceFile, writer); + return writer; + } } function formatUnionTypes(types) { var result = []; @@ -21769,8 +22572,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 169; }); - if (node.kind === 232) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 172; }); + if (node.kind === 235) { return getSymbolOfNode(node); } } @@ -21778,30 +22581,39 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 235 && + node.parent.kind === 238 && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 ? '"' + ts.escapeString(type.value) + '"' : "" + type.value; } + function isDefaultBindingContext(location) { + return location.kind === 272 || ts.isAmbientModule(location); + } function getNameOfSymbolAsWritten(symbol, context) { + if (context && symbol.escapedName === "default" && !(context.flags & 16384) && + (!(context.flags & 16777216) || + !symbol.declarations || + (context.enclosingDeclaration && ts.findAncestor(symbol.declarations[0], isDefaultBindingContext) !== ts.findAncestor(context.enclosingDeclaration, isDefaultBindingContext)))) { + return "default"; + } if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; var name = ts.getNameOfDeclaration(declaration); if (name) { return ts.declarationNameToString(name); } - if (declaration.parent && declaration.parent.kind === 227) { + if (declaration.parent && declaration.parent.kind === 230) { return ts.declarationNameToString(declaration.parent.name); } - if (context && !context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowAnonymousIdentifier)) { + if (context && !context.encounteredError && !(context.flags & 131072)) { context.encounteredError = true; } switch (declaration.kind) { - case 200: + case 203: return "(Anonymous class)"; - case 187: - case 188: + case 190: + case 191: return "(Anonymous function)"; } } @@ -21813,668 +22625,6 @@ var ts; } return ts.symbolName(symbol); } - function getSymbolDisplayBuilder() { - function appendSymbolNameOnly(symbol, writer) { - writer.writeSymbol(getNameOfSymbolAsWritten(symbol), symbol); - } - function appendPropertyOrElementAccessForSymbol(symbol, writer) { - var symbolName = symbol.escapedName === "default" ? "default" : getNameOfSymbolAsWritten(symbol); - var firstChar = symbolName.charCodeAt(0); - var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); - if (needsElementAccess) { - if (firstChar !== 91) { - writePunctuation(writer, 21); - } - if (ts.isSingleOrDoubleQuote(firstChar)) { - writer.writeStringLiteral(symbolName); - } - else { - writer.writeSymbol(symbolName, symbol); - } - if (firstChar !== 91) { - writePunctuation(writer, 22); - } - } - else { - writePunctuation(writer, 23); - writer.writeSymbol(symbolName, symbol); - } - } - function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { - var parentSymbol; - function appendParentTypeArgumentsAndSymbolName(symbol) { - if (parentSymbol) { - if (flags & 1) { - if (ts.getCheckFlags(symbol) & 1) { - var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol); - buildDisplayForTypeArgumentsAndDelimiters(params, symbol.mapper, writer, enclosingDeclaration); - } - else { - buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - appendPropertyOrElementAccessForSymbol(symbol, writer); - } - else { - appendSymbolNameOnly(symbol, writer); - } - parentSymbol = symbol; - } - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - function walkSymbol(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent) { - walkSymbol(parent, getQualifiedLeftMeaning(meaning), false); - } - } - if (accessibleSymbolChain) { - for (var _i = 0, accessibleSymbolChain_1 = accessibleSymbolChain; _i < accessibleSymbolChain_1.length; _i++) { - var accessibleSymbol = accessibleSymbolChain_1[_i]; - appendParentTypeArgumentsAndSymbolName(accessibleSymbol); - } - } - else if (endOfChain || - !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && - !(symbol.flags & (2048 | 4096))) { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - var isTypeParameter = symbol.flags & 262144; - var typeFormatFlag = 256 & typeFlags; - if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { - walkSymbol(symbol, meaning, true); - } - else { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, symbolStack) { - var globalFlagsToPass = globalFlags & (32 | 16384); - var inObjectTypeLiteral = false; - return writeType(type, globalFlags); - function writeType(type, flags) { - var nextFlags = flags & ~1024; - if (type.flags & 33585807) { - writer.writeKeyword(!(globalFlags & 32) && isTypeAny(type) - ? "any" - : type.intrinsicName); - } - else if (type.flags & 32768 && type.isThisType) { - if (inObjectTypeLiteral) { - writer.reportInaccessibleThisError(); - } - writer.writeKeyword("this"); - } - else if (ts.getObjectFlags(type) & 4) { - writeTypeReference(type, nextFlags); - } - else if (type.flags & 256 && !(type.flags & 131072)) { - var parent = getParentOfSymbol(type.symbol); - buildSymbolDisplay(parent, writer, enclosingDeclaration, 793064, 0, nextFlags); - if (getDeclaredTypeOfSymbol(parent) !== type) { - writePunctuation(writer, 23); - appendSymbolNameOnly(type.symbol, writer); - } - } - else if (ts.getObjectFlags(type) & 3 || type.flags & (272 | 32768)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); - } - else if (!(flags & 1024) && type.aliasSymbol && - ((flags & 65536) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); - } - else if (type.flags & 393216) { - writeUnionOrIntersectionType(type, nextFlags); - } - else if (ts.getObjectFlags(type) & (16 | 32)) { - writeAnonymousType(type, nextFlags); - } - else if (type.flags & 1024) { - if (flags & 131072) { - writeKeyword(writer, 140); - writeSpace(writer); - } - else { - writer.reportInaccessibleUniqueSymbolError(); - } - writeKeyword(writer, 137); - } - else if (type.flags & 96) { - writer.writeStringLiteral(literalTypeToString(type)); - } - else if (type.flags & 524288) { - if (flags & 128) { - writePunctuation(writer, 19); - } - writer.writeKeyword("keyof"); - writeSpace(writer); - writeType(type.type, 128); - if (flags & 128) { - writePunctuation(writer, 20); - } - } - else if (type.flags & 1048576) { - writeType(type.objectType, 128); - writePunctuation(writer, 21); - writeType(type.indexType, 0); - writePunctuation(writer, 22); - } - else { - writePunctuation(writer, 17); - writeSpace(writer); - writePunctuation(writer, 24); - writeSpace(writer); - writePunctuation(writer, 18); - } - } - function writeTypeList(types, delimiter) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - if (delimiter !== 26) { - writeSpace(writer); - } - writePunctuation(writer, delimiter); - writeSpace(writer); - } - writeType(types[i], delimiter === 26 ? 0 : 128); - } - } - function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) { - if (symbol.flags & 32 || !isReservedMemberName(symbol.escapedName)) { - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064, 0, flags); - } - if (pos < end) { - writePunctuation(writer, 27); - writeType(typeArguments[pos], 512); - pos++; - while (pos < end) { - writePunctuation(writer, 26); - writeSpace(writer); - writeType(typeArguments[pos], 0); - pos++; - } - writePunctuation(writer, 29); - } - } - function writeTypeReference(type, flags) { - var typeArguments = type.typeArguments || ts.emptyArray; - if (type.target === globalArrayType && !(flags & 1)) { - writeType(typeArguments[0], 128 | 32768); - writePunctuation(writer, 21); - writePunctuation(writer, 22); - } - else if (type.target.objectFlags & 8) { - writePunctuation(writer, 21); - writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 26); - writePunctuation(writer, 22); - } - else if (flags & 16384 && - type.symbol.valueDeclaration && - type.symbol.valueDeclaration.kind === 200) { - writeAnonymousType(type, flags); - } - else { - var outerTypeParameters = type.target.outerTypeParameters; - var i = 0; - if (outerTypeParameters) { - var length_2 = outerTypeParameters.length; - while (i < length_2) { - var start = i; - var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); - do { - i++; - } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); - if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent, typeArguments, start, i, flags); - writePunctuation(writer, 23); - } - } - } - var typeParameterCount = (type.target.typeParameters || ts.emptyArray).length; - writeSymbolTypeReference(type.symbol, typeArguments, i, typeParameterCount, flags); - } - } - function writeUnionOrIntersectionType(type, flags) { - if (flags & 128) { - writePunctuation(writer, 19); - } - if (type.flags & 131072) { - writeTypeList(formatUnionTypes(type.types), 49); - } - else { - writeTypeList(type.types, 48); - } - if (flags & 128) { - writePunctuation(writer, 20); - } - } - function writeAnonymousType(type, flags) { - var symbol = type.symbol; - if (symbol) { - if (symbol.flags & 32 && - !getBaseTypeVariableOfClass(symbol) && - !(symbol.valueDeclaration.kind === 200 && flags & 16384) || - symbol.flags & (384 | 512)) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (ts.contains(symbolStack, symbol)) { - var typeAlias = getTypeAliasForTypeLiteral(type); - if (typeAlias) { - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064, 0, flags); - } - else { - writeKeyword(writer, 119); - } - } - else { - if (!symbolStack) { - symbolStack = []; - } - var isConstructorObject = type.objectFlags & 16 && type.symbol && type.symbol.flags & 32; - if (isConstructorObject) { - writeLiteralType(type, flags); - } - else { - symbolStack.push(symbol); - writeLiteralType(type, flags); - symbolStack.pop(); - } - } - } - else { - writeLiteralType(type, flags); - } - function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192) && - ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); - var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && - (symbol.parent || - ts.some(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 || declaration.parent.kind === 235; - })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 4) || - ts.contains(symbolStack, symbol); - } - } - } - function writeTypeOfSymbol(symbol, typeFormatFlags) { - if (typeFormatFlags & 32768) { - writePunctuation(writer, 19); - } - writeKeyword(writer, 103); - writeSpace(writer); - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); - if (typeFormatFlags & 32768) { - writePunctuation(writer, 20); - } - } - function writePropertyWithModifiers(prop) { - if (isReadonlySymbol(prop)) { - writeKeyword(writer, 131); - writeSpace(writer); - } - if (ts.getCheckFlags(prop) & 1024) { - var decl = ts.firstOrUndefined(prop.declarations); - var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455); - if (name) { - writer.trackSymbol(name, enclosingDeclaration, 107455); - } - } - buildSymbolDisplay(prop, writer); - if (prop.flags & 16777216) { - writePunctuation(writer, 55); - } - } - function shouldAddParenthesisAroundFunctionType(callSignature, flags) { - if (flags & 128) { - return true; - } - else if (flags & 512) { - var typeParameters = callSignature.target && (flags & 64) ? - callSignature.target.typeParameters : callSignature.typeParameters; - return typeParameters && typeParameters.length !== 0; - } - return false; - } - function writeLiteralType(type, flags) { - if (isGenericMappedType(type)) { - writeMappedType(type); - return; - } - var resolved = resolveStructuredTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 17); - writePunctuation(writer, 18); - return; - } - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags); - if (parenthesizeSignature) { - writePunctuation(writer, 19); - } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16, undefined, symbolStack); - if (parenthesizeSignature) { - writePunctuation(writer, 20); - } - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 128) { - writePunctuation(writer, 19); - } - writeKeyword(writer, 94); - writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16, undefined, symbolStack); - if (flags & 128) { - writePunctuation(writer, 20); - } - return; - } - } - var saveInObjectTypeLiteral = inObjectTypeLiteral; - inObjectTypeLiteral = true; - writePunctuation(writer, 17); - writer.writeLine(); - writer.increaseIndent(); - writeObjectLiteralType(resolved); - writer.decreaseIndent(); - writePunctuation(writer, 18); - inObjectTypeLiteral = saveInObjectTypeLiteral; - } - function writeObjectLiteralType(resolved) { - for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { - var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { - var signature = _c[_b]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0, enclosingDeclaration, globalFlags, symbolStack); - buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1, enclosingDeclaration, globalFlags, symbolStack); - for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { - var p = _e[_d]; - if (globalFlags & 16384) { - if (p.flags & 4194304) { - continue; - } - if (ts.getDeclarationModifierFlagsFromSymbol(p) & (8 | 16)) { - writer.reportPrivateInBaseOfClassExpression(ts.symbolName(p)); - } - } - var t = getTypeOfSymbol(p); - if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { - var signatures = getSignaturesOfType(t, 0); - for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { - var signature = signatures_2[_f]; - writePropertyWithModifiers(p); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - } - else { - writePropertyWithModifiers(p); - writePunctuation(writer, 56); - writeSpace(writer); - writeType(t, globalFlags & 16384); - writePunctuation(writer, 25); - writer.writeLine(); - } - } - } - function writeMappedType(type) { - writePunctuation(writer, 17); - writer.writeLine(); - writer.increaseIndent(); - if (type.declaration.readonlyToken) { - writeKeyword(writer, 131); - writeSpace(writer); - } - writePunctuation(writer, 21); - appendSymbolNameOnly(getTypeParameterFromMappedType(type).symbol, writer); - writeSpace(writer); - writeKeyword(writer, 92); - writeSpace(writer); - writeType(getConstraintTypeFromMappedType(type), 0); - writePunctuation(writer, 22); - if (type.declaration.questionToken) { - writePunctuation(writer, 55); - } - writePunctuation(writer, 56); - writeSpace(writer); - writeType(getTemplateTypeFromMappedType(type), 0); - writePunctuation(writer, 25); - writer.writeLine(); - writer.decreaseIndent(); - writePunctuation(writer, 18); - } - } - function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration, flags) { - var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 || targetSymbol.flags & 64 || targetSymbol.flags & 524288) { - buildDisplayForTypeParametersAndDelimiters(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), writer, enclosingDeclaration, flags); - } - } - function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, symbolStack) { - appendSymbolNameOnly(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 85); - writeSpace(writer); - buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); - } - var defaultType = getDefaultFromTypeParameter(tp); - if (defaultType) { - writeSpace(writer); - writePunctuation(writer, 58); - writeSpace(writer); - buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { - var parameterNode = p.valueDeclaration; - if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { - writePunctuation(writer, 24); - } - if (parameterNode && ts.isBindingPattern(parameterNode.name)) { - buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - appendSymbolNameOnly(p, writer); - } - if (parameterNode && isOptionalParameter(parameterNode)) { - writePunctuation(writer, 55); - } - writePunctuation(writer, 56); - writeSpace(writer); - var type = getTypeOfSymbol(p); - if (parameterNode && isRequiredInitializedParameter(parameterNode)) { - type = getOptionalType(type); - } - buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - if (bindingPattern.kind === 175) { - writePunctuation(writer, 17); - buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 18); - } - else if (bindingPattern.kind === 176) { - writePunctuation(writer, 21); - var elements = bindingPattern.elements; - buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - if (elements && elements.hasTrailingComma) { - writePunctuation(writer, 26); - } - writePunctuation(writer, 22); - } - } - function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isOmittedExpression(bindingElement)) { - return; - } - ts.Debug.assert(bindingElement.kind === 177); - if (bindingElement.propertyName) { - writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); - writePunctuation(writer, 56); - writeSpace(writer); - } - if (ts.isBindingPattern(bindingElement.name)) { - buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - if (bindingElement.dotDotDotToken) { - writePunctuation(writer, 24); - } - appendSymbolNameOnly(bindingElement.symbol, writer); - } - } - function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27); - buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 29); - } - } - function buildDisplayForCommaSeparatedList(list, writer, action) { - for (var i = 0; i < list.length; i++) { - if (i > 0) { - writePunctuation(writer, 26); - writeSpace(writer); - } - action(list[i]); - } - } - function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27); - var flags = 512; - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 26); - writeSpace(writer); - flags = 0; - } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags); - } - writePunctuation(writer, 29); - } - } - function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) { - writePunctuation(writer, 19); - if (thisParameter) { - buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack); - } - for (var i = 0; i < parameters.length; i++) { - if (i > 0 || thisParameter) { - writePunctuation(writer, 26); - writeSpace(writer); - } - buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack); - } - writePunctuation(writer, 20); - } - function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isIdentifierTypePredicate(predicate)) { - writer.writeParameter(predicate.parameterName); - } - else { - writeKeyword(writer, 99); - } - writeSpace(writer); - writeKeyword(writer, 126); - writeSpace(writer); - buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { - var returnType = getReturnTypeOfSignature(signature); - if (flags & 4096 && isTypeAny(returnType)) { - return; - } - if (flags & 16) { - writeSpace(writer); - writePunctuation(writer, 36); - } - else { - writePunctuation(writer, 56); - } - writeSpace(writer); - if (signature.typePredicate) { - buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); - } - else { - buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { - if (kind === 1) { - writeKeyword(writer, 94); - writeSpace(writer); - } - if (signature.target && (flags & 64)) { - buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, symbolStack); - } - buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); - buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); - } - function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 131); - writeSpace(writer); - } - writePunctuation(writer, 21); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 56); - writeSpace(writer); - switch (kind) { - case 1: - writeKeyword(writer, 133); - break; - case 0: - writeKeyword(writer, 136); - break; - } - writePunctuation(writer, 22); - writePunctuation(writer, 56); - writeSpace(writer); - buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - } - return _displayBuilder || (_displayBuilder = { - buildSymbolDisplay: buildSymbolDisplay, - buildTypeDisplay: buildTypeDisplay, - buildTypeParameterDisplay: buildTypeParameterDisplay, - buildTypePredicateDisplay: buildTypePredicateDisplay, - buildParameterDisplay: buildParameterDisplay, - buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, - buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, - buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, - buildSignatureDisplay: buildSignatureDisplay, - buildIndexSignatureDisplay: buildIndexSignatureDisplay, - buildReturnTypeDisplay: buildReturnTypeDisplay - }); - } function isDeclarationVisible(node) { if (node) { var links = getNodeLinks(node); @@ -22486,63 +22636,63 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 177: + case 180: return isDeclarationVisible(node.parent.parent); - case 227: + case 230: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 234: - case 230: - case 231: - case 232: - case 229: + case 237: case 233: - case 238: + case 234: + case 235: + case 232: + case 236: + case 241: if (ts.isExternalModuleAugmentation(node)) { return true; } var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 238 && parent.kind !== 269 && parent.flags & 2097152)) { + !(node.kind !== 241 && parent.kind !== 272 && parent.flags & 2097152)) { return isGlobalSourceFile(parent); } return isDeclarationVisible(parent); - case 150: - case 149: - case 154: - case 155: - case 152: case 151: + case 150: + case 155: + case 156: + case 153: + case 152: if (ts.hasModifier(node, 8 | 16)) { return false; } - case 153: - case 157: - case 156: + case 154: case 158: - case 147: - case 235: - case 161: + case 157: + case 159: + case 148: + case 238: case 162: - case 164: - case 160: + case 163: case 165: + case 161: case 166: case 167: case 168: case 169: + case 172: return isDeclarationVisible(node.parent); - case 240: - case 241: case 243: - return false; - case 146: - case 269: - case 237: - return true; case 244: + case 246: + return false; + case 147: + case 272: + case 240: + return true; + case 247: return false; default: return false; @@ -22551,10 +22701,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 244) { + if (node.parent && node.parent.kind === 247) { exportSymbol = resolveName(node, node.escapedText, 107455 | 793064 | 1920 | 2097152, undefined, node, false); } - else if (node.parent.kind === 247) { + else if (node.parent.kind === 250) { exportSymbol = getTargetOfExportSpecifier(node.parent, 107455 | 793064 | 1920 | 2097152); } var result; @@ -22586,8 +22736,8 @@ var ts; function pushTypeResolution(target, propertyName) { var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { - var length_3 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_3; i++) { + var length_2 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_2; i++) { resolutionResults[i] = false; } return false; @@ -22621,6 +22771,10 @@ var ts; if (propertyName === 3) { return target.resolvedReturnType; } + if (propertyName === 4) { + var bc = target.resolvedBaseConstraint; + return bc && bc !== circularConstraintType; + } ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName); } function popTypeResolution() { @@ -22631,12 +22785,12 @@ var ts; function getDeclarationContainer(node) { node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 227: - case 228: + case 230: + case 231: + case 246: + case 245: + case 244: case 243: - case 242: - case 241: - case 240: return false; default: return true; @@ -22660,7 +22814,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false); } function isComputedNonLiteralName(name) { - return name.kind === 145 && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 146 && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 12288); }); @@ -22702,7 +22856,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 175) { + if (pattern.kind === 178) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -22726,7 +22880,8 @@ var ts; if (strictNullChecks && declaration.flags & 2097152 && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } - var declaredType = getTypeOfPropertyOfType(parentType, text); + var propType = getTypeOfPropertyOfType(parentType, text); + var declaredType = propType && getApparentTypeForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); @@ -22742,7 +22897,7 @@ var ts; type = createArrayType(elementType); } else { - var propName = "" + ts.indexOf(pattern.elements, declaration); + var propName = "" + pattern.elements.indexOf(declaration); type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : elementType; @@ -22761,7 +22916,7 @@ var ts; type = getTypeWithFacts(type, 131072); } return declaration.initializer ? - getUnionType([type, checkExpressionCached(declaration.initializer)], true) : + getUnionType([type, checkExpressionCached(declaration.initializer)], 2) : type; } function getTypeForDeclarationFromJSDocComment(declaration) { @@ -22777,31 +22932,31 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 178 && expr.elements.length === 0; + return expr.kind === 181 && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } return strictNullChecks && optional ? getOptionalType(type) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (declaration.parent.parent.kind === 216) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 219) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (32768 | 524288) ? indexType : stringType; } - if (declaration.parent.parent.kind === 217) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 220) { var forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } - var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - var declaredType = getTypeFromTypeNode(typeNode); - return addOptionality(declaredType, !!declaration.questionToken && includeOptionality); + var isOptional = !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken && includeOptionality; + var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (declaredType) { + return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) && - declaration.kind === 227 && !ts.isBindingPattern(declaration.name) && + declaration.kind === 230 && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 2097152)) { if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) { return autoType; @@ -22810,10 +22965,10 @@ var ts; return autoArrayType; } } - if (declaration.kind === 147) { + if (declaration.kind === 148) { var func = declaration.parent; - if (func.kind === 155 && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 154); + if (func.kind === 156 && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -22832,19 +22987,16 @@ var ts; type = getContextuallyTypedParameterType(declaration); } if (type) { - return addOptionality(type, !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } } if (declaration.initializer) { var type = checkDeclarationInitializer(declaration); - return addOptionality(type, !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } if (ts.isJsxAttribute(declaration)) { return trueType; } - if (declaration.kind === 266) { - return checkIdentifier(declaration.name); - } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name, false, true); } @@ -22857,14 +23009,14 @@ var ts; var jsDocType; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - var expression = declaration.kind === 195 ? declaration : - declaration.kind === 180 ? ts.getAncestor(declaration, 195) : + var expression = declaration.kind === 198 ? declaration : + declaration.kind === 183 ? ts.getAncestor(declaration, 198) : undefined; if (!expression) { return unknownType; } if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99) { - if (ts.getThisContainer(expression, false).kind === 153) { + if (ts.getThisContainer(expression, false).kind === 154) { definedInConstructor = true; } else { @@ -22887,7 +23039,7 @@ var ts; types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); } } - var type = jsDocType || getUnionType(types, true); + var type = jsDocType || getUnionType(types, 2); return getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor)); } function getTypeFromBindingElement(element, includePatternInType, reportErrors) { @@ -22947,7 +23099,7 @@ var ts; return result; } function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 175 + return pattern.kind === 178 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -22957,15 +23109,12 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - if (type.flags & 1024 && !declaration.type && type.symbol !== getSymbolOfNode(declaration)) { + if (type.flags & 1024 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) { type = esSymbolType; } - if (declaration.kind === 265) { - return type; - } return getWidenedType(type); } - type = declaration.dotDotDotToken ? anyArrayType : anyType; + type = ts.isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); @@ -22975,9 +23124,15 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 147 ? root.parent : root; + var memberDeclaration = root.kind === 148 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } + function tryGetTypeFromEffectiveTypeNode(declaration) { + var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -22988,7 +23143,7 @@ var ts; if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) { return links.type = anyType; } - if (declaration.kind === 244) { + if (declaration.kind === 247) { return links.type = checkExpression(declaration.expression); } if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) { @@ -22998,13 +23153,42 @@ var ts; return unknownType; } var type = void 0; - if (declaration.kind === 195 || - declaration.kind === 180 && declaration.parent.kind === 195) { + if (declaration.kind === 198 || + declaration.kind === 183 && declaration.parent.kind === 198) { type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } - else { + else if (ts.isJSDocPropertyTag(declaration) + || ts.isPropertyAccessExpression(declaration) + || ts.isIdentifier(declaration) + || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration)) + || ts.isMethodSignature(declaration)) { + if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType; + } + else if (ts.isPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } + else if (ts.isJsxAttribute(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } + else if (ts.isShorthandPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0); + } + else if (ts.isObjectLiteralMethod(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0); + } + else if (ts.isParameter(declaration) + || ts.isPropertyDeclaration(declaration) + || ts.isPropertySignature(declaration) + || ts.isVariableDeclaration(declaration) + || ts.isBindingElement(declaration)) { type = getWidenedTypeForVariableLikeDeclaration(declaration, true); } + else { + ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration)); + } if (!popTypeResolution()) { type = reportCircularityError(symbol); } @@ -23014,7 +23198,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 154) { + if (accessor.kind === 155) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); } @@ -23035,8 +23219,8 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 154); - var setter = ts.getDeclarationOfKind(symbol, 155); + var getter = ts.getDeclarationOfKind(symbol, 155); + var setter = ts.getDeclarationOfKind(symbol, 156); if (getter && ts.isInJavaScriptFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -23077,7 +23261,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 154); + var getter_1 = ts.getDeclarationOfKind(symbol, 155); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -23161,6 +23345,9 @@ var ts; if (ts.getCheckFlags(symbol) & 1) { return getTypeOfInstantiatedSymbol(symbol); } + if (ts.getCheckFlags(symbol) & 2048) { + return getTypeOfReverseMappedSymbol(symbol); + } if (symbol.flags & (3 | 4)) { return getTypeOfVariableOrParameterOrProperty(symbol); } @@ -23214,44 +23401,48 @@ var ts; return undefined; } switch (node.kind) { - case 230: - case 200: - case 231: - case 156: + case 233: + case 203: + case 234: case 157: - case 151: - case 161: - case 162: - case 277: - case 229: + case 158: case 152: - case 187: - case 188: + case 162: + case 163: + case 280: case 232: - case 287: - case 173: + case 153: + case 190: + case 191: + case 235: + case 290: + case 176: + case 170: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 173) { + if (node.kind === 176) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } + else if (node.kind === 170) { + return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node) || ts.emptyArray); var thisType = includeThisTypes && - (node.kind === 230 || node.kind === 200 || node.kind === 231) && + (node.kind === 233 || node.kind === 203 || node.kind === 234) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 231); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 234); return getOuterTypeParameters(declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 231 || node.kind === 230 || - node.kind === 200 || node.kind === 232) { + if (node.kind === 234 || node.kind === 233 || + node.kind === 203 || node.kind === 235) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -23352,10 +23543,10 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = ts.emptyArray; + type.resolvedBaseTypes = ts.resolvingEmptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (65536 | 262144 | 1))) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } var baseTypeNode = getBaseTypeNodeOfClass(type); var typeArgs = typeArgumentsFromTypeReferenceNode(baseTypeNode); @@ -23372,22 +23563,25 @@ var ts; var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); - return; + return type.resolvedBaseTypes = ts.emptyArray; } baseType = getReturnTypeOfSignature(constructors[0]); } if (baseType === unknownType) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { - error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - return; + error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 2)); + return type.resolvedBaseTypes = ts.emptyArray; } - type.resolvedBaseTypes = [baseType]; + if (type.resolvedBaseTypes === ts.resolvingEmptyArray) { + type.members = undefined; + } + return type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { var outerTypeParameters = type.outerTypeParameters; @@ -23399,14 +23593,14 @@ var ts; return true; } function isValidBaseType(type) { - return type.flags & (65536 | 33554432 | 1) && !isGenericMappedType(type) || + return type.flags & (65536 | 134217728 | 1) && !isGenericMappedType(type) || type.flags & 262144 && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 234 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -23421,7 +23615,7 @@ var ts; } } else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 2)); } } else { @@ -23435,7 +23629,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231) { + if (declaration.kind === 234) { if (declaration.flags & 64) { return false; } @@ -23486,9 +23680,9 @@ var ts; return unknownType; } var declaration = ts.find(symbol.declarations, function (d) { - return d.kind === 288 || d.kind === 232; + return d.kind === 291 || d.kind === 235; }); - var typeNode = declaration.kind === 288 ? declaration.typeExpression : declaration.type; + var typeNode = declaration.kind === 291 ? declaration.typeExpression : declaration.type; var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType; if (popTypeResolution()) { var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -23515,7 +23709,7 @@ var ts; case 9: case 8: return true; - case 193: + case 196: return expr.operator === 38 && expr.operand.kind === 8; case 71: @@ -23532,7 +23726,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233) { + if (declaration.kind === 236) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 9) { @@ -23559,7 +23753,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233) { + if (declaration.kind === 236) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)); @@ -23569,7 +23763,7 @@ var ts; } } if (memberTypeList.length) { - var enumType_1 = getUnionType(memberTypeList, false, symbol, undefined); + var enumType_1 = getUnionType(memberTypeList, 1, symbol, undefined); if (enumType_1.flags & 131072) { enumType_1.flags |= 256; enumType_1.symbol = symbol; @@ -23634,20 +23828,20 @@ var ts; function isThislessType(node) { switch (node.kind) { case 119: - case 136: - case 133: - case 122: case 137: case 134: + case 122: + case 138: + case 135: case 105: - case 139: + case 140: case 95: - case 130: - case 174: + case 131: + case 177: return true; - case 165: + case 166: return isThislessType(node.elementType); - case 160: + case 161: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -23657,11 +23851,11 @@ var ts; } function isThislessVariableLikeDeclaration(node) { var typeNode = ts.getEffectiveTypeAnnotationNode(node); - return typeNode ? isThislessType(typeNode) : !node.initializer; + return typeNode ? isThislessType(typeNode) : !ts.hasInitializer(node); } function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); - return (node.kind === 153 || (returnType && isThislessType(returnType))) && + return (node.kind === 154 || (returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter)); } @@ -23670,12 +23864,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 150: - case 149: - return isThislessVariableLikeDeclaration(declaration); - case 152: case 151: + case 150: + return isThislessVariableLikeDeclaration(declaration); case 153: + case 152: + case 154: return isThislessFunctionLikeDeclaration(declaration); } } @@ -23825,18 +24019,19 @@ var ts; } return symbol; } - function getTypeWithThisArgument(type, thisArgument) { + function getTypeWithThisArgument(type, thisArgument, needApparentType) { if (ts.getObjectFlags(type) & 4) { var target = type.target; var typeArguments = type.typeArguments; if (ts.length(target.typeParameters) === ts.length(typeArguments)) { - return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + var ref = createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + return needApparentType ? getApparentType(ref) : ref; } } else if (type.flags & 262144) { - return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); })); } - return type; + return needApparentType ? getApparentType(type) : type; } function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) { var mapper; @@ -23866,6 +24061,7 @@ var ts; if (source.symbol && members === getMembersOfSymbol(source.symbol)) { members = ts.createSymbolTable(source.declaredProperties); } + setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); var thisArgument = ts.lastOrUndefined(typeArguments); for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; @@ -23893,21 +24089,23 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { + function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.thisParameter = thisParameter; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; + sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasLiteralTypes = hasLiteralTypes; + sig.target = undefined; + sig.mapper = undefined; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); + return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, undefined, undefined, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); } function getDefaultConstructSignatures(classType) { var baseConstructorType = getBaseConstructorTypeOfClass(classType); @@ -23924,7 +24122,7 @@ var ts; var baseSig = baseSignatures_1[_i]; var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); var typeParamCount = ts.length(baseSig.typeParameters); - if (isJavaScript || (typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount)) { + if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; @@ -23974,12 +24172,13 @@ var ts; if (unionSignatures) { var s = signature; if (unionSignatures.length > 1) { - s = cloneSignature(signature); + var thisParameter = signature.thisParameter; if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { - var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), true); - s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); + var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType; }), 2); + thisParameter = createSymbolWithType(signature.thisParameter, thisType); } - s.resolvedReturnType = undefined; + s = cloneSignature(signature); + s.thisParameter = thisParameter; s.unionSignatures = unionSignatures; } (result || (result = [])).push(s); @@ -24001,7 +24200,7 @@ var ts; indexTypes.push(indexInfo.type); isAnyReadonly = isAnyReadonly || indexInfo.isReadonly; } - return createIndexInfo(getUnionType(indexTypes, true), isAnyReadonly); + return createIndexInfo(getUnionType(indexTypes, 2), isAnyReadonly); } function resolveUnionTypeMembers(type) { var callSignatures = getUnionSignatures(type.types, 0); @@ -24084,6 +24283,7 @@ var ts; if (symbol.exports) { members = getExportsOfSymbol(symbol); } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined); if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); var baseConstructorType = getBaseConstructorTypeOfClass(classType); @@ -24110,19 +24310,36 @@ var ts; } } } + function resolveReverseMappedTypeMembers(type) { + var indexInfo = getIndexInfoOfType(type.source, 0); + var modifiers = getMappedTypeModifiers(type.mappedType); + var readonlyMask = modifiers & 1 ? false : true; + var optionalMask = modifiers & 4 ? 0 : 16777216; + var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); + var members = ts.createSymbolTable(); + for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { + var prop = _a[_i]; + var checkFlags = 2048 | (readonlyMask && isReadonlySymbol(prop) ? 8 : 0); + var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.escapedName, checkFlags); + inferredProp.declarations = prop.declarations; + inferredProp.propertyType = getTypeOfSymbol(prop); + inferredProp.mappedType = type.mappedType; + members.set(prop.escapedName, inferredProp); + } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); + } function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); var stringIndexInfo; setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var templateType = getTemplateTypeFromMappedType(type); + var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); - var templateReadonly = !!type.declaration.readonlyToken; - var templateOptional = !!type.declaration.questionToken; + var templateModifiers = getMappedTypeModifiers(type); var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 && - constraintDeclaration.operator === 127) { + if (constraintDeclaration.kind === 174 && + constraintDeclaration.operator === 128) { for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { var propertySymbol = _a[_i]; addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); @@ -24132,7 +24349,7 @@ var ts; } } else { - var keyType = constraintType.flags & 1081344 ? getApparentType(constraintType) : constraintType; + var keyType = constraintType.flags & 7372800 ? getApparentType(constraintType) : constraintType; var iterationType = keyType.flags & 524288 ? getIndexType(getApparentType(keyType.type)) : keyType; forEachType(iterationType, addMemberForKeyType); } @@ -24148,10 +24365,14 @@ var ts; if (t.flags & 32) { var propName = ts.escapeLeadingUnderscores(t.value); var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 16777216); - var checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 : 0; - var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, checkFlags); - prop.type = propType; + var isOptional = !!(templateModifiers & 4 || + !(templateModifiers & 8) && modifiersProp && modifiersProp.flags & 16777216); + var isReadonly = !!(templateModifiers & 1 || + !(templateModifiers & 2) && modifiersProp && isReadonlySymbol(modifiersProp)); + var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, isReadonly ? 8 : 0); + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 ? getTypeWithFacts(propType, 131072) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; @@ -24160,7 +24381,7 @@ var ts; members.set(propName, prop); } else if (t.flags & (1 | 2)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1)); } } } @@ -24175,14 +24396,14 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4)), type.mapper || identityMapper) : unknownType); } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 && - constraintDeclaration.operator === 127) { + if (constraintDeclaration.kind === 174 && + constraintDeclaration.operator === 128) { type.modifiersType = instantiateType(getTypeFromTypeNode(constraintDeclaration.type), type.mapper || identityMapper); } else { @@ -24195,16 +24416,21 @@ var ts; return type.modifiersType; } function getMappedTypeModifiers(type) { - return (type.declaration.readonlyToken ? 1 : 0) | - (type.declaration.questionToken ? 2 : 0); + var declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 ? 2 : 1 : 0) | + (declaration.questionToken ? declaration.questionToken.kind === 38 ? 8 : 4 : 0); } - function getCombinedMappedTypeModifiers(type) { + function getMappedTypeOptionality(type) { + var modifiers = getMappedTypeModifiers(type); + return modifiers & 8 ? -1 : modifiers & 4 ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type) { + var optionality = getMappedTypeOptionality(type); var modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type) { - return ts.getObjectFlags(type) & 32 && !!type.declaration.questionToken; + return !!(ts.getObjectFlags(type) & 32 && getMappedTypeModifiers(type) & 4); } function isGenericMappedType(type) { return ts.getObjectFlags(type) & 32 && isGenericIndexType(getConstraintTypeFromMappedType(type)); @@ -24218,6 +24444,9 @@ var ts; else if (type.objectFlags & 3) { resolveClassOrInterfaceMembers(type); } + else if (type.objectFlags & 2048) { + resolveReverseMappedTypeMembers(type); + } else if (type.objectFlags & 16) { resolveAnonymousTypeMembers(type); } @@ -24288,7 +24517,9 @@ var ts; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { - props.set(escapedName, createUnionOrIntersectionProperty(unionType, escapedName)); + var prop = createUnionOrIntersectionProperty(unionType, escapedName); + if (prop) + props.set(escapedName, prop); } } } @@ -24297,22 +24528,44 @@ var ts; function getConstraintOfType(type) { return type.flags & 32768 ? getConstraintOfTypeParameter(type) : type.flags & 1048576 ? getConstraintOfIndexedAccess(type) : - getBaseConstraintOfType(type); + type.flags & 2097152 ? getConstraintOfConditionalType(type) : + getBaseConstraintOfType(type); } function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { - var transformed = getTransformedIndexedAccessType(type); + var transformed = getSimplifiedIndexedAccessType(type); if (transformed) { return transformed; } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); + if (baseIndexType === stringType && !getIndexInfoOfType(baseObjectType || type.objectType, 0)) { + return undefined; + } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } + function getDefaultConstraintOfConditionalType(type) { + return getUnionType([type.trueType, type.falseType]); + } + function getConstraintOfDistributiveConditionalType(type) { + if (isDistributiveConditionalType(type)) { + var constraint = getConstraintOfType(type.checkType); + if (constraint) { + var target = type.target || type; + var mapper = createTypeMapper([target.checkType], [constraint]); + var combinedMapper = type.mapper ? combineTypeMappers(mapper, type.mapper) : mapper; + return instantiateType(target, combinedMapper); + } + } + return undefined; + } + function getConstraintOfConditionalType(type) { + return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); + } function getBaseConstraintOfType(type) { - if (type.flags & (1081344 | 393216)) { + if (type.flags & (7372800 | 393216)) { var constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; @@ -24327,29 +24580,30 @@ var ts; return getResolvedBaseConstraint(type) !== circularConstraintType; } function getResolvedBaseConstraint(type) { - var typeStack; var circular; if (!type.resolvedBaseConstraint) { - typeStack = []; var constraint = getBaseConstraint(type); type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); } return type.resolvedBaseConstraint; function getBaseConstraint(t) { - if (ts.contains(typeStack, t)) { + if (!pushTypeResolution(t, 4)) { circular = true; return undefined; } - typeStack.push(t); var result = computeBaseConstraint(t); - typeStack.pop(); + if (!popTypeResolution()) { + circular = true; + return undefined; + } return result; } function computeBaseConstraint(t) { if (t.flags & 32768) { var constraint = getConstraintFromTypeParameter(t); - return t.isThisType ? constraint : - constraint ? getBaseConstraint(constraint) : undefined; + return t.isThisType || !constraint ? + constraint : + getBaseConstraint(constraint); } if (t.flags & 393216) { var types = t.types; @@ -24369,7 +24623,7 @@ var ts; return stringType; } if (t.flags & 1048576) { - var transformed = getTransformedIndexedAccessType(t); + var transformed = getSimplifiedIndexedAccessType(t); if (transformed) { return getBaseConstraint(transformed); } @@ -24378,6 +24632,12 @@ var ts; var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (t.flags & 2097152) { + return getBaseConstraint(getConstraintOfConditionalType(t)); + } + if (t.flags & 4194304) { + return getBaseConstraint(t.substitute); + } if (isGenericMappedType(t)) { return emptyObjectType; } @@ -24385,7 +24645,7 @@ var ts; } } function getApparentTypeOfIntersectionType(type) { - return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type, true)); } function getResolvedTypeParameterDefault(typeParameter) { if (!typeParameter.default) { @@ -24418,25 +24678,24 @@ var ts; return !!(typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameterDeclaration(decl) && decl.default; })); } function getApparentType(type) { - var t = type.flags & 1081344 ? getBaseConstraintOfType(type) || emptyObjectType : type; + var t = type.flags & 7897088 ? getBaseConstraintOfType(type) || emptyObjectType : type; return t.flags & 262144 ? getApparentTypeOfIntersectionType(t) : t.flags & 524322 ? globalStringType : t.flags & 84 ? globalNumberType : t.flags & 136 ? globalBooleanType : t.flags & 1536 ? getGlobalESSymbolType(languageVersion >= 2) : - t.flags & 33554432 ? emptyObjectType : + t.flags & 134217728 ? emptyObjectType : t; } function createUnionOrIntersectionProperty(containingType, name) { var props; - var types = containingType.types; var isUnion = containingType.flags & 131072; var excludeModifiers = isUnion ? 24 : 0; var commonFlags = isUnion ? 0 : 16777216; var syntheticFlag = 4; var checkFlags = 0; - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var current = types_5[_i]; + for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) { + var current = _a[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); @@ -24467,8 +24726,8 @@ var ts; var propTypes = []; var declarations = []; var commonType = undefined; - for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { - var prop = props_1[_a]; + for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { + var prop = props_1[_b]; if (prop.declarations) { ts.addRange(declarations, prop.declarations); } @@ -24559,7 +24818,7 @@ var ts; } } if (propTypes.length) { - return getUnionType(propTypes, true); + return getUnionType(propTypes, 2); } } return undefined; @@ -24583,7 +24842,7 @@ var ts; } function isJSDocOptionalParameter(node) { if (ts.isInJavaScriptFile(node)) { - if (node.type && node.type.kind === 276) { + if (node.type && node.type.kind === 279) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -24594,7 +24853,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 276; + return paramTag.typeExpression.type.kind === 279; } } } @@ -24612,9 +24871,8 @@ var ts; return true; } if (node.initializer) { - var signatureDeclaration = node.parent; - var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -24622,27 +24880,26 @@ var ts; if (iife) { return !node.type && !node.dotDotDotToken && - ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + node.parent.parameters.indexOf(node) >= iife.arguments.length; } return false; } function createTypePredicateFromTypePredicateNode(node) { var parameterName = node.parameterName; + var type = getTypeFromTypeNode(node.type); if (parameterName.kind === 71) { - return { - kind: 1, - parameterName: parameterName ? parameterName.escapedText : undefined, - parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, - type: getTypeFromTypeNode(node.type) - }; + return createIdentifierTypePredicate(parameterName && parameterName.escapedText, parameterName && getTypePredicateParameterIndex(node.parent.parameters, parameterName), type); } else { - return { - kind: 0, - type: getTypeFromTypeNode(node.type) - }; + return createThisTypePredicate(type); } } + function createIdentifierTypePredicate(parameterName, parameterIndex, type) { + return { kind: 1, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; + } + function createThisTypePredicate(type) { + return { kind: 0, type: type }; + } function getMinTypeArgumentCount(typeParameters) { var minTypeArgumentCount = 0; if (typeParameters) { @@ -24703,7 +24960,7 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 174) { + if (param.type && param.type.kind === 177) { hasLiteralTypes = true; } var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || @@ -24714,32 +24971,29 @@ var ts; minArgumentCount = parameters.length; } } - if ((declaration.kind === 154 || declaration.kind === 155) && + if ((declaration.kind === 155 || declaration.kind === 156) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 154 ? 155 : 154; + var otherKind = declaration.kind === 155 ? 156 : 155; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 153 ? + var classType = declaration.kind === 154 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 159 ? - createTypePredicateFromTypePredicateNode(declaration.type) : - undefined; var hasRestLikeParameter = ts.hasRestParameter(declaration) || ts.isInJavaScriptFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters); - links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); + links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, undefined, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); } return links.resolvedSignature; } function maybeAddJsSyntheticRestParameter(declaration, parameters) { var lastParam = ts.lastOrUndefined(declaration.parameters); var lastParamTags = lastParam && ts.getJSDocParameterTags(lastParam); - var lastParamVariadicType = lastParamTags && ts.firstDefined(lastParamTags, function (p) { + var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); if (!lastParamVariadicType && !containsArgumentsReference(declaration)) { @@ -24765,8 +25019,8 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 154 && !hasNonBindableDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 155); + if (declaration.kind === 155 && !hasNonBindableDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { @@ -24790,11 +25044,11 @@ var ts; switch (node.kind) { case 71: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 150: - case 152: - case 154: + case 151: + case 153: case 155: - return node.name.kind === 145 + case 156: + return node.name.kind === 146 && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); @@ -24808,20 +25062,20 @@ var ts; for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 161: case 162: - case 229: - case 152: - case 151: + case 163: + case 232: case 153: - case 156: + case 152: + case 154: case 157: case 158: - case 154: + case 159: case 155: - case 187: - case 188: - case 277: + case 156: + case 190: + case 191: + case 280: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -24848,6 +25102,28 @@ var ts; return getTypeOfSymbol(signature.thisParameter); } } + function signatureHasTypePredicate(signature) { + return getTypePredicateOfSignature(signature) !== undefined; + } + function getTypePredicateOfSignature(signature) { + if (!signature.resolvedTypePredicate) { + if (signature.target) { + var targetTypePredicate = getTypePredicateOfSignature(signature.target); + signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; + } + else if (signature.unionSignatures) { + signature.resolvedTypePredicate = getUnionTypePredicate(signature.unionSignatures) || noTypePredicate; + } + else { + var declaration = signature.declaration; + signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 ? + createTypePredicateFromTypePredicateNode(declaration.type) : + noTypePredicate; + } + ts.Debug.assert(!!signature.resolvedTypePredicate); + } + return signature.resolvedTypePredicate === noTypePredicate ? undefined : signature.resolvedTypePredicate; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3)) { @@ -24858,7 +25134,7 @@ var ts; type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), true); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2); } else { type = getReturnTypeFromBody(signature.declaration); @@ -24932,7 +25208,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 153 || signature.declaration.kind === 157; + var isConstructor = signature.declaration.kind === 154 || signature.declaration.kind === 158; var type = createObjectType(16); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -24946,7 +25222,7 @@ var ts; return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 133 : 136; + var syntaxKind = kind === 1 ? 134 : 137; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -24973,7 +25249,33 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return type.symbol && ts.getDeclarationOfKind(type.symbol, 146).constraint; + return type.symbol && ts.getDeclarationOfKind(type.symbol, 147).constraint; + } + function getInferredTypeParameterConstraint(typeParameter) { + var inferences; + if (typeParameter.symbol) { + for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (declaration.parent.kind === 171 && declaration.parent.parent.kind === 161) { + var typeReference = declaration.parent.parent; + var typeParameters = getTypeParametersForTypeReference(typeReference); + if (typeParameters) { + var index = typeReference.typeArguments.indexOf(declaration.parent); + if (index < typeParameters.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); + if (declaredConstraint) { + var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters)); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts.append(inferences, constraint); + } + } + } + } + } + } + } + return inferences && getIntersectionType(inferences); } function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { @@ -24983,23 +25285,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : + getInferredTypeParameterConstraint(typeParameter) || noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 146).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_4 = types.length; + var length_3 = types.length; var i = 0; - while (i < length_4) { + while (i < length_3) { var startId = types[i].id; var count = 1; - while (i + count < length_4 && types[i + count].id === startId + count) { + while (i + count < length_3 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -25016,13 +25319,13 @@ var ts; } function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } } - return result & 29360128; + return result & 117440512; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); @@ -25056,7 +25359,7 @@ var ts; var isJs = ts.isInJavaScriptFile(node); var isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - var missingAugmentsTag = isJs && node.parent.kind !== 282; + var missingAugmentsTag = isJs && node.parent.kind !== 285; var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag @@ -25064,7 +25367,7 @@ var ts; : missingAugmentsTag ? ts.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; - var typeStr = typeToString(type, undefined, 1); + var typeStr = typeToString(type, undefined, 2); error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length); if (!isJs) { return unknownType; @@ -25073,11 +25376,7 @@ var ts; var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs)); return createTypeReference(type, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); @@ -25104,17 +25403,13 @@ var ts; } return getTypeAliasInstantiation(symbol, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeReferenceName(node) { switch (node.kind) { - case 160: + case 161: return node.typeName; - case 202: + case 205: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -25138,12 +25433,10 @@ var ts; return type; } var res = tryGetDeclaredTypeOfSymbol(symbol); - if (res !== undefined) { - if (typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return res; + if (res) { + return checkNoTypeArguments(node, symbol) ? + res.flags & 32768 ? getConstrainedTypeParameter(res, node) : res : + unknownType; } if (!(symbol.flags & 107455 && isJSDocTypeReference(node))) { return unknownType; @@ -25171,42 +25464,79 @@ var ts; return getInferredClassType(symbol); } } + function getSubstitutionType(typeParameter, substitute) { + var result = createType(4194304); + result.typeParameter = typeParameter; + result.substitute = substitute; + return result; + } + function getConstrainedTypeParameter(typeParameter, node) { + var constraints; + while (ts.isPartOfTypeNode(node)) { + var parent = node.parent; + if (parent.kind === 170 && node === parent.trueType) { + if (getTypeFromTypeNode(parent.checkType) === typeParameter) { + constraints = ts.append(constraints, getTypeFromTypeNode(parent.extendsType)); + } + } + node = parent; + } + return constraints ? getSubstitutionType(typeParameter, getIntersectionType(ts.append(constraints, typeParameter))) : typeParameter; + } function isJSDocTypeReference(node) { - return node.flags & 1048576 && node.kind === 160; + return node.flags & 1048576 && node.kind === 161; + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : ts.declarationNameToString(node.typeName)); + return false; + } + return true; } function getIntendedTypeFromJSDocTypeReference(node) { if (ts.isIdentifier(node.typeName)) { - if (node.typeName.escapedText === "Object") { - if (ts.isJSDocIndexSignature(node)) { - var indexed = getTypeFromTypeNode(node.typeArguments[0]); - var target = getTypeFromTypeNode(node.typeArguments[1]); - var index = createIndexInfo(target, false); - return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); - } - return anyType; - } + var typeArgs = node.typeArguments; switch (node.typeName.escapedText) { case "String": + checkNoTypeArguments(node); return stringType; case "Number": + checkNoTypeArguments(node); return numberType; case "Boolean": + checkNoTypeArguments(node); return booleanType; case "Void": + checkNoTypeArguments(node); return voidType; case "Undefined": + checkNoTypeArguments(node); return undefinedType; case "Null": + checkNoTypeArguments(node); return nullType; case "Function": case "function": + checkNoTypeArguments(node); return globalFunctionType; case "Array": case "array": - return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined; + return !typeArgs || !typeArgs.length ? anyArrayType : undefined; case "Promise": case "promise": - return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + return !typeArgs || !typeArgs.length ? createPromiseType(anyType) : undefined; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var index = createIndexInfo(target, false); + return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); + } + return anyType; + } + checkNoTypeArguments(node); + return anyType; } } } @@ -25249,9 +25579,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 230: - case 231: case 233: + case 234: + case 236: return declaration; } } @@ -25418,37 +25748,37 @@ var ts; return true; } combined |= t.flags; - if (combined & 12288 && combined & (65536 | 33554432)) { + if (combined & 12288 && combined & (65536 | 134217728)) { return true; } } return false; } - function addTypeToUnion(typeSet, type) { + function addTypeToUnion(typeSet, includes, type) { var flags = type.flags; if (flags & 131072) { - addTypesToUnion(typeSet, type.types); + includes = addTypesToUnion(typeSet, includes, type.types); } else if (flags & 1) { - typeSet.containsAny = true; + includes |= 1; } else if (!strictNullChecks && flags & 12288) { if (flags & 4096) - typeSet.containsUndefined = true; + includes |= 2; if (flags & 8192) - typeSet.containsNull = true; - if (!(flags & 4194304)) - typeSet.containsNonWideningType = true; + includes |= 4; + if (!(flags & 16777216)) + includes |= 16; } else if (!(flags & 16384 || flags & 262144 && isEmptyIntersectionType(type))) { if (flags & 2) - typeSet.containsString = true; + includes |= 32; if (flags & 4) - typeSet.containsNumber = true; + includes |= 64; if (flags & 512) - typeSet.containsESSymbol = true; + includes |= 128; if (flags & 1120) - typeSet.containsLiteralOrUniqueESSymbol = true; + includes |= 256; var len = typeSet.length; var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues); if (index < 0) { @@ -25458,16 +25788,18 @@ var ts; } } } + return includes; } - function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var type = types_7[_i]; - addTypeToUnion(typeSet, type); + function addTypesToUnion(typeSet, includes, types) { + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; + includes = addTypeToUnion(typeSet, includes, type); } + return includes; } function containsIdenticalType(types, type) { - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -25511,21 +25843,22 @@ var ts; } } } - function removeRedundantLiteralTypes(types) { + function removeRedundantLiteralTypes(types, includes) { var i = types.length; while (i > 0) { i--; var t = types[i]; - var remove = t.flags & 32 && types.containsString || - t.flags & 64 && types.containsNumber || - t.flags & 1024 && types.containsESSymbol || - t.flags & 96 && t.flags & 2097152 && containsType(types, t.regularType); + var remove = t.flags & 32 && includes & 32 || + t.flags & 64 && includes & 64 || + t.flags & 1024 && includes & 128 || + t.flags & 96 && t.flags & 8388608 && containsType(types, t.regularType); if (remove) { ts.orderedRemoveItemAt(types, i); } } } - function getUnionType(types, subtypeReduction, aliasSymbol, aliasTypeArguments) { + function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments) { + if (unionReduction === void 0) { unionReduction = 1; } if (types.length === 0) { return neverType; } @@ -25533,23 +25866,59 @@ var ts; return types[0]; } var typeSet = []; - addTypesToUnion(typeSet, types); - if (typeSet.containsAny) { + var includes = addTypesToUnion(typeSet, 0, types); + if (includes & 1) { return anyType; } - if (subtypeReduction) { - removeSubtypes(typeSet); - } - else if (typeSet.containsLiteralOrUniqueESSymbol) { - removeRedundantLiteralTypes(typeSet); + switch (unionReduction) { + case 1: + if (includes & 256) { + removeRedundantLiteralTypes(typeSet, includes); + } + break; + case 2: + removeSubtypes(typeSet); + break; } if (typeSet.length === 0) { - return typeSet.containsNull ? typeSet.containsNonWideningType ? nullType : nullWideningType : - typeSet.containsUndefined ? typeSet.containsNonWideningType ? undefinedType : undefinedWideningType : + return includes & 4 ? includes & 16 ? nullType : nullWideningType : + includes & 2 ? includes & 16 ? undefinedType : undefinedWideningType : neverType; } return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments); } + function getUnionTypePredicate(signatures) { + var first; + var types = []; + for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { + var sig = signatures_2[_i]; + var pred = getTypePredicateOfSignature(sig); + if (!pred) { + continue; + } + if (first) { + if (!typePredicateKindsMatch(first, pred)) { + return undefined; + } + } + else { + first = pred; + } + types.push(pred.type); + } + if (!first) { + return undefined; + } + var unionType = getUnionType(types); + return ts.isIdentifierTypePredicate(first) + ? createIdentifierTypePredicate(first.parameterName, first.parameterIndex, unionType) + : createThisTypePredicate(unionType); + } + function typePredicateKindsMatch(a, b) { + return ts.isIdentifierTypePredicate(a) + ? ts.isIdentifierTypePredicate(b) && a.parameterIndex === b.parameterIndex + : !ts.isIdentifierTypePredicate(b); + } function getUnionTypeFromSortedList(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { return neverType; @@ -25572,64 +25941,67 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), false, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); } return links.resolvedType; } - function addTypeToIntersection(typeSet, type) { - if (type.flags & 262144) { - addTypesToIntersection(typeSet, type.types); + function addTypeToIntersection(typeSet, includes, type) { + var flags = type.flags; + if (flags & 262144) { + includes = addTypesToIntersection(typeSet, includes, type.types); } - else if (type.flags & 1) { - typeSet.containsAny = true; + else if (flags & 1) { + includes |= 1; } - else if (type.flags & 16384) { - typeSet.containsNever = true; + else if (flags & 16384) { + includes |= 8; } else if (ts.getObjectFlags(type) & 16 && isEmptyObjectType(type)) { - typeSet.containsEmptyObject = true; + includes |= 1024; } - else if ((strictNullChecks || !(type.flags & 12288)) && !ts.contains(typeSet, type)) { - if (type.flags & 65536) { - typeSet.containsObjectType = true; + else if ((strictNullChecks || !(flags & 12288)) && !ts.contains(typeSet, type)) { + if (flags & 65536) { + includes |= 512; } - if (type.flags & 131072 && typeSet.unionIndex === undefined) { - typeSet.unionIndex = typeSet.length; + if (flags & 131072) { + includes |= 2048; } - if (!(type.flags & 65536 && type.objectFlags & 16 && + if (!(flags & 65536 && type.objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192) && containsIdenticalType(typeSet, type))) { typeSet.push(type); } } + return includes; } - function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; - addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type)); + function addTypesToIntersection(typeSet, includes, types) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } + return includes; } function getIntersectionType(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { return emptyObjectType; } var typeSet = []; - addTypesToIntersection(typeSet, types); - if (typeSet.containsNever) { + var includes = addTypesToIntersection(typeSet, 0, types); + if (includes & 8) { return neverType; } - if (typeSet.containsAny) { + if (includes & 1) { return anyType; } - if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + if (includes & 1024 && !(includes & 512)) { typeSet.push(emptyObjectType); } if (typeSet.length === 1) { return typeSet[0]; } - var unionIndex = typeSet.unionIndex; - if (unionIndex !== undefined) { - var unionType = typeSet[unionIndex]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), false, aliasSymbol, aliasTypeArguments); + if (includes & 2048) { + var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072) !== 0; }); + var unionType = typeSet[unionIndex_1]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); var type = intersectionTypes.get(id); @@ -25658,7 +26030,7 @@ var ts; return type.resolvedIndexType; } function getLiteralTypeFromPropertyName(prop) { - return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 || ts.startsWith(prop.escapedName, "__@") ? + return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 || ts.isKnownSymbol(prop) ? neverType : getLiteralType(ts.symbolName(prop)); } @@ -25666,10 +26038,11 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return maybeTypeOfKind(type, 1081344) ? getIndexTypeForGenericType(type) : + return maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type) : ts.getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) : - type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType : - getLiteralTypeFromPropertyNames(type); + type === wildcardType ? wildcardType : + type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType : + getLiteralTypeFromPropertyNames(type); } function getIndexTypeOrString(type) { var indexType = getIndexType(type); @@ -25679,11 +26052,11 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 127: + case 128: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 140: - links.resolvedType = node.type.kind === 137 + case 141: + links.resolvedType = node.type.kind === 138 ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : unknownType; break; @@ -25698,7 +26071,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 181 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 184 ? accessNode : undefined; var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : @@ -25707,6 +26080,7 @@ var ts; var prop = getPropertyOfType(objectType, propName); if (prop) { if (accessExpression) { + markPropertyAsReferenced(prop, accessExpression, accessExpression.expression.kind === 99); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); return unknownType; @@ -25720,7 +26094,7 @@ var ts; } if (!(indexType.flags & 12288) && isTypeAssignableToKind(indexType, 524322 | 84 | 1536)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } var indexInfo = isTypeAssignableToKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || getIndexInfoOfType(objectType, 0) || @@ -25744,7 +26118,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 181 ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 184 ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 | 64)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } @@ -25759,15 +26133,10 @@ var ts; return anyType; } function isGenericObjectType(type) { - return type.flags & 1081344 ? true : - ts.getObjectFlags(type) & 32 ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : - type.flags & 393216 ? ts.forEach(type.types, isGenericObjectType) : - false; + return maybeTypeOfKind(type, 7372800 | 536870912); } function isGenericIndexType(type) { - return type.flags & (1081344 | 524288) ? true : - type.flags & 393216 ? ts.forEach(type.types, isGenericIndexType) : - false; + return maybeTypeOfKind(type, 7372800 | 524288); } function isStringIndexOnlyType(type) { if (type.flags & 65536 && !isGenericMappedType(type)) { @@ -25778,35 +26147,52 @@ var ts; } return false; } - function getTransformedIndexedAccessType(type) { + function isMappedTypeToNever(type) { + return ts.getObjectFlags(type) & 32 && getTemplateTypeFromMappedType(type) === neverType; + } + function getSimplifiedIndexedAccessType(type) { var objectType = type.objectType; - if (objectType.flags & 262144 && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { - var regularTypes = []; - var stringIndexTypes = []; - for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { - var t = _a[_i]; - if (isStringIndexOnlyType(t)) { - stringIndexTypes.push(getIndexTypeOfType(t, 0)); - } - else { - regularTypes.push(t); + if (objectType.flags & 262144 && isGenericObjectType(objectType)) { + if (ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0)); + } + else { + regularTypes.push(t); + } } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + if (ts.some(objectType.types, isMappedTypeToNever)) { + var nonNeverTypes = ts.filter(objectType.types, function (t) { return !isMappedTypeToNever(t); }); + return getIndexedAccessType(getIntersectionType(nonNeverTypes), type.indexType); } - return getUnionType([ - getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), - getIntersectionType(stringIndexTypes) - ]); } if (isGenericMappedType(objectType)) { - var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var objectTypeMapper = objectType.mapper; - var templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + return substituteIndexedMappedType(objectType, type); + } + if (objectType.flags & 32768) { + var constraint = getConstraintFromTypeParameter(objectType); + if (constraint && isGenericMappedType(constraint)) { + return substituteIndexedMappedType(constraint, type); + } } return undefined; } + function substituteIndexedMappedType(objectType, type) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + var templateMapper = objectType.mapper ? combineTypeMappers(objectType.mapper, mapper) : mapper; + return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + } function getIndexedAccessType(objectType, indexType, accessNode) { - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 181) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 184) && isGenericObjectType(objectType)) { if (objectType.flags & 1) { return objectType; } @@ -25851,6 +26237,83 @@ var ts; } return links.resolvedType; } + function getActualTypeParameter(type) { + return type.flags & 4194304 ? type.typeParameter : type; + } + function createConditionalType(checkType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, aliasTypeArguments) { + var type = createType(2097152); + type.checkType = checkType; + type.extendsType = extendsType; + type.trueType = trueType; + type.falseType = falseType; + type.inferTypeParameters = inferTypeParameters; + type.target = target; + type.mapper = mapper; + type.aliasSymbol = aliasSymbol; + type.aliasTypeArguments = aliasTypeArguments; + return type; + } + function getConditionalType(checkType, baseExtendsType, baseTrueType, baseFalseType, inferTypeParameters, target, mapper, aliasSymbol, baseAliasTypeArguments) { + var extendsType = instantiateType(baseExtendsType, mapper); + if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { + return instantiateType(baseFalseType, mapper); + } + var combinedMapper; + if (inferTypeParameters) { + var inferences = ts.map(inferTypeParameters, createInferenceInfo); + inferTypes(inferences, checkType, extendsType, 8 | 16); + var inferredTypes = ts.map(inferences, function (inference) { return getTypeFromInference(inference) || neverType; }); + var inferenceMapper = createTypeMapper(inferTypeParameters, inferredTypes); + combinedMapper = mapper ? combineTypeMappers(mapper, inferenceMapper) : inferenceMapper; + } + if (checkType.flags & 1 || (checkType.flags & 16384 && !(extendsType.flags & 16384))) { + return getUnionType([instantiateType(baseTrueType, combinedMapper || mapper), instantiateType(baseFalseType, mapper)]); + } + var inferredExtendsType = combinedMapper ? instantiateType(baseExtendsType, combinedMapper) : extendsType; + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, undefined)) { + return instantiateType(baseTrueType, combinedMapper || mapper); + } + var erasedCheckType = getActualTypeParameter(checkType); + var trueType = instantiateType(baseTrueType, mapper); + var falseType = instantiateType(baseFalseType, mapper); + var isDistributive = (target ? target.checkType : erasedCheckType).flags & 32768 ? 1 : 0; + var id = erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id + "," + isDistributive; + var cached = conditionalTypes.get(id); + if (cached) { + return cached; + } + var result = createConditionalType(erasedCheckType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, instantiateTypes(baseAliasTypeArguments, mapper)); + conditionalTypes.set(id, result); + return result; + } + function isDistributiveConditionalType(type) { + return !!((type.target || type).checkType.flags & 32768); + } + function getInferTypeParameters(node) { + var result; + if (node.locals) { + node.locals.forEach(function (symbol) { + if (symbol.flags & 262144) { + result = ts.append(result, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result; + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getConditionalType(getTypeFromTypeNode(node.checkType), getTypeFromTypeNode(node.extendsType), getTypeFromTypeNode(node.trueType), getTypeFromTypeNode(node.falseType), getInferTypeParameters(node), undefined, undefined, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -25871,13 +26334,13 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 232 ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 235 ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : undefined; } - function getSpreadType(left, right, symbol, propagatedFlags) { + function getSpreadType(left, right, symbol, typeFlags, objectFlags) { if (left.flags & 1 || right.flags & 1) { return anyType; } @@ -25888,15 +26351,12 @@ var ts; return left; } if (left.flags & 131072) { - return mapType(left, function (t) { return getSpreadType(t, right, symbol, propagatedFlags); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); }); } if (right.flags & 131072) { - return mapType(right, function (t) { return getSpreadType(left, t, symbol, propagatedFlags); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); }); } - if (right.flags & 33554432) { - return nonPrimitiveType; - } - if (right.flags & (136 | 84 | 524322 | 272)) { + if (right.flags & (136 | 84 | 524322 | 272 | 134217728)) { return left; } var members = ts.createSymbolTable(); @@ -25947,9 +26407,8 @@ var ts; } } var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo)); - spread.flags |= propagatedFlags; - spread.flags |= 2097152 | 8388608; - spread.objectFlags |= (128 | 1024); + spread.flags |= typeFlags | 33554432; + spread.objectFlags |= objectFlags | (128 | 1024); return spread; } function getNonReadonlySymbol(prop) { @@ -25979,9 +26438,9 @@ var ts; return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 96 && !(type.flags & 2097152)) { + if (type.flags & 96 && !(type.flags & 8388608)) { if (!type.freshType) { - var freshType = createLiteralType(type.flags | 2097152, type.value, type.symbol); + var freshType = createLiteralType(type.flags | 8388608, type.value, type.symbol); freshType.regularType = type; type.freshType = freshType; } @@ -25990,7 +26449,7 @@ var ts; return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 96 && type.flags & 2097152 ? type.regularType : type; + return type.flags & 96 && type.flags & 8388608 ? type.regularType : type; } function getLiteralType(value, enumId, symbol) { var qualifier = typeof value === "number" ? "#" : "@"; @@ -26018,16 +26477,16 @@ var ts; if (ts.isValidESSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); var links = getSymbolLinks(symbol); - return links.type || (links.type = createUniqueESSymbolType(symbol)); + return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); } return esSymbolType; } function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 231)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 234)) { if (!ts.hasModifier(container, 32) && - (container.kind !== 153 || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 154 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -26044,71 +26503,75 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 119: - case 272: - case 273: + case 275: + case 276: return anyType; - case 136: + case 137: return stringType; - case 133: + case 134: return numberType; case 122: return booleanType; - case 137: + case 138: return esSymbolType; case 105: return voidType; - case 139: + case 140: return undefinedType; case 95: return nullType; - case 130: + case 131: return neverType; - case 134: + case 135: return node.flags & 65536 ? anyType : nonPrimitiveType; - case 170: + case 173: case 99: return getTypeFromThisTypeNode(node); - case 174: + case 177: return getTypeFromLiteralTypeNode(node); - case 160: - return getTypeFromTypeReference(node); - case 159: - return booleanType; - case 202: - return getTypeFromTypeReference(node); - case 163: - return getTypeFromTypeQueryNode(node); - case 165: - return getTypeFromArrayTypeNode(node); - case 166: - return getTypeFromTupleTypeNode(node); - case 167: - return getTypeFromUnionTypeNode(node); - case 168: - return getTypeFromIntersectionTypeNode(node); - case 274: - return getTypeFromJSDocNullableTypeNode(node); - case 169: - case 275: - case 276: - case 271: - return getTypeFromTypeNode(node.type); - case 278: - return getTypeFromJSDocVariadicType(node); case 161: - case 162: + return getTypeFromTypeReference(node); + case 160: + return booleanType; + case 205: + return getTypeFromTypeReference(node); case 164: - case 280: + return getTypeFromTypeQueryNode(node); + case 166: + return getTypeFromArrayTypeNode(node); + case 167: + return getTypeFromTupleTypeNode(node); + case 168: + return getTypeFromUnionTypeNode(node); + case 169: + return getTypeFromIntersectionTypeNode(node); case 277: - return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 171: - return getTypeFromTypeOperatorNode(node); + return getTypeFromJSDocNullableTypeNode(node); case 172: + case 278: + case 279: + case 274: + return getTypeFromTypeNode(node.type); + case 281: + return getTypeFromJSDocVariadicType(node); + case 162: + case 163: + case 165: + case 283: + case 280: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 174: + return getTypeFromTypeOperatorNode(node); + case 175: return getTypeFromIndexedAccessTypeNode(node); - case 173: + case 176: return getTypeFromMappedTypeNode(node); + case 170: + return getTypeFromConditionalTypeNode(node); + case 171: + return getTypeFromInferTypeNode(node); case 71: - case 144: + case 145: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -26117,12 +26580,18 @@ var ts; } function instantiateList(items, mapper, instantiator) { if (items && items.length) { - var result = []; - for (var _i = 0, items_1 = items; _i < items_1.length; _i++) { - var v = items_1[_i]; - result.push(instantiator(v, mapper)); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result = i === 0 ? [] : items.slice(0, i); + result.push(mapped); + for (i++; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } } - return result; } return items; } @@ -26158,7 +26627,7 @@ var ts; return createTypeMapper(sources, undefined); } function createBackreferenceMapper(typeParameters, index) { - return function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; }; } function isInferenceContext(mapper) { return !!mapper.signature; @@ -26174,13 +26643,16 @@ var ts; function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } + function wildcardMapper(type) { + return type.flags & 32768 ? wildcardType : type; + } function cloneTypeParameter(typeParameter) { var result = createType(32768); result.symbol = typeParameter.symbol; result.target = typeParameter; return result; } - function cloneTypePredicate(predicate, mapper) { + function instantiateTypePredicate(predicate, mapper) { if (ts.isIdentifierTypePredicate(predicate)) { return { kind: 1, @@ -26198,7 +26670,6 @@ var ts; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); @@ -26207,17 +26678,17 @@ var ts; tp.mapper = mapper; } } - if (signature.typePredicate) { - freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper); - } - var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), undefined, freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); + var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), undefined, undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); result.target = signature; result.mapper = mapper; return result; } function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !maybeTypeOfKind(links.type, 65536 | 7897088)) { + return symbol; + } if (ts.getCheckFlags(symbol) & 1) { - var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } @@ -26238,14 +26709,14 @@ var ts; var target = type.objectFlags & 64 ? type.target : type; var symbol = target.symbol; var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; + var typeParameters = links.outerTypeParameters; if (!typeParameters) { var declaration_1 = symbol.declarations[0]; var outerTypeParameters = getOuterTypeParameters(declaration_1, true) || ts.emptyArray; typeParameters = symbol.flags & 2048 && !target.aliasTypeArguments ? ts.filter(outerTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration_1); }) : outerTypeParameters; - links.typeParameters = typeParameters; + links.outerTypeParameters = typeParameters; if (typeParameters.length) { links.instantiations = ts.createMap(); links.instantiations.set(getTypeListId(typeParameters), target); @@ -26268,18 +26739,18 @@ var ts; function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container_1 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 208 ? "quit" : n === container_1; })) { + if (ts.findAncestor(node, function (n) { return n.kind === 211 ? "quit" : n === container_1; })) { return ts.forEachChild(node, containsReference); } } return true; function containsReference(node) { switch (node.kind) { - case 170: + case 173: return tp.isThisType; case 71: return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; - case 163: + case 164: return true; } return ts.forEachChild(node, containsReference); @@ -26304,7 +26775,7 @@ var ts; return instantiateAnonymousType(type, mapper); } function isMappableType(type) { - return type.flags & (1 | 32768 | 65536 | 262144 | 1048576); + return type.flags & (1 | 7372800 | 65536 | 262144); } function instantiateAnonymousType(type, mapper) { var result = createObjectType(type.objectFlags | 64, type.symbol); @@ -26317,8 +26788,23 @@ var ts; result.aliasTypeArguments = instantiateTypes(type.aliasTypeArguments, mapper); return result; } + function getConditionalTypeInstantiation(type, mapper) { + var target = type.target || type; + var combinedMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; + if (isDistributiveConditionalType(target)) { + var checkType_1 = target.checkType; + var instantiatedType = combinedMapper(checkType_1); + if (checkType_1 !== instantiatedType && instantiatedType.flags & 131072) { + return mapType(instantiatedType, function (t) { return instantiateConditionalType(target, createReplacementMapper(checkType_1, t, combinedMapper)); }); + } + } + return instantiateConditionalType(target, combinedMapper); + } + function instantiateConditionalType(type, mapper) { + return getConditionalType(instantiateType(type.checkType, mapper), type.extendsType, type.trueType, type.falseType, type.inferTypeParameters, type, mapper, type.aliasSymbol, type.aliasTypeArguments); + } function instantiateType(type, mapper) { - if (type && mapper !== identityMapper) { + if (type && mapper && mapper !== identityMapper) { if (type.flags & 32768) { return mapper(type); } @@ -26331,14 +26817,20 @@ var ts; return getAnonymousTypeInstantiation(type, mapper); } if (type.objectFlags & 4) { - return createTypeReference(type.target, instantiateTypes(type.typeArguments, mapper)); + var typeArguments = type.typeArguments; + var newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type; } } if (type.flags & 131072 && !(type.flags & 16382)) { - return getUnionType(instantiateTypes(type.types, mapper), false, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, 1, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 262144) { - return getIntersectionType(instantiateTypes(type.types, mapper), type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 524288) { return getIndexType(instantiateType(type.type, mapper)); @@ -26346,38 +26838,48 @@ var ts; if (type.flags & 1048576) { return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper)); } + if (type.flags & 2097152) { + return getConditionalTypeInstantiation(type, mapper); + } + if (type.flags & 4194304) { + return mapper(type.typeParameter); + } } return type; } + function getWildcardInstantiation(type) { + return type.flags & (16382 | 1 | 16384) ? type : + type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 187: - case 188: - case 152: + case 190: + case 191: + case 153: return isContextSensitiveFunctionLikeDeclaration(node); - case 179: + case 182: return ts.forEach(node.properties, isContextSensitive); - case 178: + case 181: return ts.forEach(node.elements, isContextSensitive); - case 196: + case 199: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 195: + case 198: return node.operatorToken.kind === 54 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 265: + case 268: return isContextSensitive(node.initializer); - case 186: + case 189: return isContextSensitive(node.expression); - case 258: + case 261: return ts.forEach(node.properties, isContextSensitive); - case 257: - return node.initializer && isContextSensitive(node.initializer); case 260: + return node.initializer && isContextSensitive(node.initializer); + case 263: return node.expression && isContextSensitive(node.expression); } return false; @@ -26389,13 +26891,13 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 188) { + if (node.kind !== 191) { var parameter = ts.firstOrUndefined(node.parameters); if (!(parameter && ts.parameterIsThisKeyword(parameter))) { return true; } } - return node.body.kind === 208 ? false : isContextSensitive(node.body); + return node.body.kind === 211 ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -26435,7 +26937,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 131072 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 131072 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 1081344 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & 7372800 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); } @@ -26466,8 +26968,8 @@ var ts; source = instantiateSignatureInContextOf(source, target, undefined, compareTypes); } var kind = target.declaration ? target.declaration.kind : 0; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 152 && - kind !== 151 && kind !== 153; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 && + kind !== 152 && kind !== 154; var result = -1; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -26494,7 +26996,7 @@ var ts; var targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) && (getFalsyFlags(sourceType) & 12288) === (getFalsyFlags(targetType) & 12288); var related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 : 1, false, reportErrors, errorReporter, compareTypes) : @@ -26513,11 +27015,13 @@ var ts; return result; } var sourceReturnType = getReturnTypeOfSignature(source); - if (target.typePredicate) { - if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (targetTypePredicate) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + if (sourceTypePredicate) { + result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } - else if (ts.isIdentifierTypePredicate(target.typePredicate)) { + else if (ts.isIdentifierTypePredicate(targetTypePredicate)) { if (reportErrors) { errorReporter(ts.Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); } @@ -26540,13 +27044,12 @@ var ts; return 0; } if (source.kind === 1) { - var sourcePredicate = source; var targetPredicate = target; - var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0; @@ -26600,7 +27103,7 @@ var ts; } function isEmptyObjectType(type) { return type.flags & 65536 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : - type.flags & 33554432 ? true : + type.flags & 134217728 ? true : type.flags & 131072 ? ts.forEach(type.types, isEmptyObjectType) : type.flags & 262144 ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : false; @@ -26625,7 +27128,7 @@ var ts; var targetProperty = getPropertyOfType(targetEnumType, property.escapedName); if (!targetProperty || !(targetProperty.flags & 8)) { if (errorReporter) { - errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), undefined, 256)); + errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), undefined, 64)); } enumRelation.set(id, false); return false; @@ -26638,7 +27141,7 @@ var ts; function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { var s = source.flags; var t = target.flags; - if (t & 1 || s & 16384) + if (t & 1 || s & 16384 || source === wildcardType) return true; if (t & 16384) return false; @@ -26672,11 +27175,11 @@ var ts; return true; if (s & 8192 && (!strictNullChecks || t & 8192)) return true; - if (s & 65536 && t & 33554432) + if (s & 65536 && t & 134217728) return true; if (s & 1024 || t & 1024) return false; - if (relation === assignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { if (s & 1) return true; if (s & (4 | 64) && !(s & 256) && (t & 16 || t & 64 && t & 256)) @@ -26685,10 +27188,10 @@ var ts; return false; } function isTypeRelatedTo(source, target, relation) { - if (source.flags & 96 && source.flags & 2097152) { + if (source.flags & 96 && source.flags & 8388608) { source = source.regularType; } - if (target.flags & 96 && target.flags & 2097152) { + if (target.flags & 96 && target.flags & 8388608) { target = target.regularType; } if (source === target || @@ -26702,11 +27205,14 @@ var ts; return related === 1; } } - if (source.flags & 2064384 || target.flags & 2064384) { + if (source.flags & 8355840 || target.flags & 8355840) { return checkTypeRelatedTo(source, target, relation, undefined); } return false; } + function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { + return ts.getObjectFlags(source) & 4096 && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + } function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var maybeKeys; @@ -26724,10 +27230,22 @@ var ts; } else if (errorInfo) { if (containingMessageChain) { - errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + var chain_1 = containingMessageChain(); + if (chain_1) { + errorInfo = ts.concatenateDiagnosticMessageChains(chain_1, errorInfo); + } } diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } + if (headMessage && errorNode && !result && source.symbol) { + var links = getSymbolLinks(source.symbol); + if (links.originatingImport && !ts.isImportCall(links.originatingImport)) { + var helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target), target, relation, undefined); + if (helpfulRetry) { + diagnostics.add(ts.createDiagnosticForNode(links.originatingImport, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime)); + } + } + } return result !== 0; function reportError(message, arg0, arg1, arg2) { ts.Debug.assert(!!errorNode); @@ -26737,8 +27255,8 @@ var ts; var sourceType = typeToString(source); var targetType = typeToString(target); if (sourceType === targetType) { - sourceType = typeToString(source, undefined, 256); - targetType = typeToString(target, undefined, 256); + sourceType = typeToString(source, undefined, 64); + targetType = typeToString(target, undefined, 64); } if (!message) { if (relation === comparableRelation) { @@ -26781,12 +27299,18 @@ var ts; return false; } function isRelatedTo(source, target, reportErrors, headMessage) { - if (source.flags & 96 && source.flags & 2097152) { + if (source.flags & 96 && source.flags & 8388608) { source = source.regularType; } - if (target.flags & 96 && target.flags & 2097152) { + if (target.flags & 96 && target.flags & 8388608) { target = target.regularType; } + if (source.flags & 4194304) { + source = relation === definitelyAssignableRelation ? source.typeParameter : source.substitute; + } + if (target.flags & 4194304) { + target = target.typeParameter; + } if (source === target) return -1; if (relation === identityRelation) { @@ -26795,14 +27319,15 @@ var ts; if (relation === comparableRelation && !(target.flags & 16384) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1; - if (isObjectLiteralType(source) && source.flags & 2097152) { - if (hasExcessProperties(source, target, reportErrors)) { + if (isObjectLiteralType(source) && source.flags & 8388608) { + var discriminantType = target.flags & 131072 ? findMatchingDiscriminantType(source, target) : undefined; + if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { reportRelationError(headMessage, source, target); } return 0; } - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { source = getRegularTypeOfObjectLiteral(source); } } @@ -26847,7 +27372,7 @@ var ts; else if (source.flags & 262144) { result = someTypeRelatedToType(source, target, false); } - if (!result && (source.flags & 2064384 || target.flags & 2064384)) { + if (!result && (source.flags & 8355840 || target.flags & 8355840)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; } @@ -26867,31 +27392,54 @@ var ts; } function isIdenticalTo(source, target) { var result; - if (source.flags & 65536 && target.flags & 65536) { + var flags = source.flags & target.flags; + if (flags & 65536) { return recursiveTypeRelatedTo(source, target, false); } - if (source.flags & 131072 && target.flags & 131072 || - source.flags & 262144 && target.flags & 262144) { + if (flags & (131072 | 262144)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & 524288) { + return isRelatedTo(source.type, target.type, false); + } + if (flags & 1048576) { + if (result = isRelatedTo(source.objectType, target.objectType, false)) { + if (result &= isRelatedTo(source.indexType, target.indexType, false)) { + return result; + } + } + } + if (flags & 2097152) { + if (result = isRelatedTo(source.checkType, target.checkType, false)) { + if (result &= isRelatedTo(source.extendsType, target.extendsType, false)) { + if (result &= isRelatedTo(source.trueType, target.trueType, false)) { + if (result &= isRelatedTo(source.falseType, target.falseType, false)) { + if (isDistributiveConditionalType(source) === isDistributiveConditionalType(target)) { + return result; + } + } + } + } + } + } + if (flags & 4194304) { + return isRelatedTo(source.substitute, target.substitute, false); + } return 0; } - function hasExcessProperties(source, target, reportErrors) { + function hasExcessProperties(source, target, discriminant, reportErrors) { if (maybeTypeOfKind(target, 65536) && !(ts.getObjectFlags(target) & 512)) { - var isComparingJsxAttributes = !!(source.flags & 67108864); - if ((relation === assignableRelation || relation === comparableRelation) && + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096); + if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } - if (target.flags & 131072) { - var discriminantType = findMatchingDiscriminantType(source, target); - if (discriminantType) { - return hasExcessProperties(source, discriminantType, reportErrors); - } + if (discriminant) { + return hasExcessProperties(source, discriminant, undefined, reportErrors); } var _loop_4 = function (prop) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -27126,13 +27674,16 @@ var ts; } return result; } + function getConstraintForRelation(type) { + return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); + } function structuredTypeRelatedTo(source, target, reportErrors) { var result; var originalErrorInfo; var saveErrorInfo = errorInfo; if (target.flags & 32768) { if (ts.getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & 4)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -27147,7 +27698,7 @@ var ts; return result; } } - var constraint = getConstraintOfType(target.type); + var constraint = getConstraintForRelation(target.type); if (constraint) { if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { return result; @@ -27155,7 +27706,7 @@ var ts; } } else if (target.flags & 1048576) { - var constraint = getConstraintOfIndexedAccess(target); + var constraint = getConstraintForRelation(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { errorInfo = saveErrorInfo; @@ -27163,17 +27714,27 @@ var ts; } } } - else if (isGenericMappedType(target) && !isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (isGenericMappedType(target)) { + var template = getTemplateTypeFromMappedType(target); + var modifiers = getMappedTypeModifiers(target); + if (!(modifiers & 8)) { + if (template.flags & 1048576 && template.objectType === source && + template.indexType === getTypeParameterFromMappedType(target)) { + return -1; + } + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } if (source.flags & 32768) { - var constraint = getConstraintOfTypeParameter(source); - if (constraint || !(target.flags & 33554432)) { + var constraint = getConstraintForRelation(source); + if (constraint || !(target.flags & 134217728)) { if (!constraint || constraint.flags & 1) { constraint = emptyObjectType; } @@ -27185,23 +27746,53 @@ var ts; } } else if (source.flags & 1048576) { - var constraint = getConstraintOfIndexedAccess(source); + var constraint = getConstraintForRelation(source); if (constraint) { if (result = isRelatedTo(constraint, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } } - else if (target.flags & 1048576 && source.indexType === target.indexType) { + else if (target.flags & 1048576) { if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + result &= isRelatedTo(source.indexType, target.indexType, reportErrors); + } + if (result) { errorInfo = saveErrorInfo; return result; } } } + else if (source.flags & 2097152) { + if (relation !== definitelyAssignableRelation) { + var constraint = getConstraintOfDistributiveConditionalType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (target.flags & 2097152) { + if (isTypeIdenticalTo(source.checkType, target.checkType) && + isTypeIdenticalTo(source.extendsType, target.extendsType)) { + if (result = isRelatedTo(source.trueType, target.trueType, reportErrors)) { + result &= isRelatedTo(source.falseType, target.falseType, reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } else { if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target && - !(source.flags & 134217728 || target.flags & 134217728)) { + !(ts.getObjectFlags(source) & 8192 || ts.getObjectFlags(target) & 8192)) { var variances = getVariances(source.target); if (result = typeArgumentsRelatedTo(source, target, variances, reportErrors)) { return result; @@ -27254,8 +27845,7 @@ var ts; } function mappedTypeRelatedTo(source, target, reportErrors) { var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & 2) || - getCombinedMappedTypeModifiers(target) & 2); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { var result_1; if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -27298,6 +27888,9 @@ var ts; if (!(targetProp.flags & 4194304)) { var sourceProp = getPropertyOfType(source, targetProp.escapedName); if (sourceProp && sourceProp !== targetProp) { + if (isIgnoredJsxProperty(source, sourceProp, getTypeOfSymbol(targetProp))) { + continue; + } var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 || targetPropFlags & 8) { @@ -27366,7 +27959,7 @@ var ts; return false; } function hasCommonProperties(source, target) { - var isComparingJsxAttributes = !!(source.flags & 67108864); + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -27479,6 +28072,9 @@ var ts; var result = -1; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; + if (isIgnoredJsxProperty(source, prop, undefined)) { + continue; + } if (kind === 0 || isNumericLiteralName(prop.escapedName)) { var related = isRelatedTo(getTypeOfSymbol(prop), target, reportErrors); if (!related) { @@ -27567,7 +28163,7 @@ var ts; } function getMarkerTypeReference(type, source, target) { var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; })); - result.flags |= 134217728; + result.objectFlags |= 8192; return result; } function getVariances(type) { @@ -27619,7 +28215,7 @@ var ts; for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { var t = _a[_i]; if (isUnconstrainedTypeParameter(t)) { - var index = ts.indexOf(typeParameters, t); + var index = typeParameters.indexOf(t); if (index < 0) { index = typeParameters.length; typeParameters.push(t); @@ -27773,17 +28369,24 @@ var ts; result &= related; } if (!ignoreReturnTypes) { - result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + result &= sourceTypePredicate !== undefined || targetTypePredicate !== undefined + ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) + : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } return result; } + function compareTypePredicatesIdentical(source, target, compareTypes) { + return source === undefined || target === undefined || !typePredicateKindsMatch(source, target) ? 0 : compareTypes(source.type, target.type); + } function isRestParameterIndex(signature, parameterIndex) { return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var t = types_9[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -27806,7 +28409,7 @@ var ts; var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 12288); }); return primaryTypes.length ? getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 12288) : - getUnionType(types, true); + getUnionType(types, 2); } function getCommonSubtype(types) { return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; }); @@ -27843,8 +28446,8 @@ var ts; } function getWidenedLiteralType(type) { return type.flags & 256 ? getBaseTypeOfEnumLiteralType(type) : - type.flags & 32 && type.flags & 2097152 ? stringType : - type.flags & 64 && type.flags & 2097152 ? numberType : + type.flags & 32 && type.flags & 8388608 ? stringType : + type.flags & 64 && type.flags & 8388608 ? numberType : type.flags & 128 ? booleanType : type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) : type; @@ -27865,8 +28468,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; result |= getFalsyFlags(t); } return result; @@ -27935,7 +28538,7 @@ var ts; return members; } function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType(type) && type.flags & 2097152)) { + if (!(isObjectLiteralType(type) && type.flags & 8388608)) { return type; } var regularType = type.regularType; @@ -27945,7 +28548,7 @@ var ts; var resolved = type; var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo); - regularNew.flags = resolved.flags & ~2097152; + regularNew.flags = resolved.flags & ~8388608; regularNew.objectFlags |= 128; type.regularType = regularNew; return regularNew; @@ -28025,7 +28628,7 @@ var ts; return getWidenedTypeWithContext(type, undefined); } function getWidenedTypeWithContext(type, context) { - if (type.flags & 12582912) { + if (type.flags & 50331648) { if (type.flags & 12288) { return anyType; } @@ -28035,7 +28638,7 @@ var ts; if (type.flags & 131072) { var unionContext_1 = context || createWideningContext(undefined, undefined, type.types); var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 12288 ? t : getWidenedTypeWithContext(t, unionContext_1); }); - return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType)); + return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 : 1); } if (isArrayType(type) || isTupleType(type)) { return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); @@ -28045,7 +28648,7 @@ var ts; } function reportWideningErrorsInType(type) { var errorReported = false; - if (type.flags & 4194304) { + if (type.flags & 16777216) { if (type.flags & 131072) { if (ts.some(type.types, isEmptyObjectType)) { errorReported = true; @@ -28071,9 +28674,9 @@ var ts; for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); - if (t.flags & 4194304) { + if (t.flags & 16777216) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, ts.symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -28086,38 +28689,41 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 151: case 150: - case 149: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 147: + case 148: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 177: + case 180: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 229: + case 232: + case 153: case 152: - case 151: - case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; + case 176: + error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + return; default: diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && noImplicitAny && type.flags & 4194304) { + if (produceDiagnostics && noImplicitAny && type.flags & 16777216) { if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); } @@ -28165,6 +28771,7 @@ var ts; return { typeParameter: typeParameter, candidates: undefined, + contraCandidates: undefined, inferredType: undefined, priority: undefined, topLevel: true, @@ -28175,6 +28782,7 @@ var ts; return { typeParameter: inference.typeParameter, candidates: inference.candidates && inference.candidates.slice(), + contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), inferredType: inference.inferredType, priority: inference.priority, topLevel: inference.topLevel, @@ -28183,7 +28791,7 @@ var ts; } function couldContainTypeVariables(type) { var objectFlags = ts.getObjectFlags(type); - return !!(type.flags & (1081344 | 524288) || + return !!(type.flags & 7897088 || objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 32) || objectFlags & 32 || @@ -28206,7 +28814,7 @@ var ts; } var name = ts.escapeLeadingUnderscores(t.value); var literalProp = createSymbol(4, name); - literalProp.type = emptyObjectType; + literalProp.type = anyType; if (t.symbol) { literalProp.declarations = t.symbol.declarations; literalProp.valueDeclaration = t.symbol.valueDeclaration; @@ -28216,40 +28824,41 @@ var ts; var indexInfo = type.flags & 2 ? createIndexInfo(emptyObjectType, false) : undefined; return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined); } - function inferTypeForHomomorphicMappedType(source, target, mappedTypeStack) { + function inferTypeForHomomorphicMappedType(source, target) { + var key = source.id + "," + target.id; + if (reverseMappedCache.has(key)) { + return reverseMappedCache.get(key); + } + reverseMappedCache.set(key, undefined); + var type = createReverseMappedType(source, target); + reverseMappedCache.set(key, type); + return type; + } + function createReverseMappedType(source, target) { var properties = getPropertiesOfType(source); - var indexInfo = getIndexInfoOfType(source, 0); - if (properties.length === 0 && !indexInfo) { + if (properties.length === 0 && !getIndexInfoOfType(source, 0)) { return undefined; } - var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); - var inference = createInferenceInfo(typeParameter); - var inferences = [inference]; - var templateType = getTemplateTypeFromMappedType(target); - var readonlyMask = target.declaration.readonlyToken ? false : true; - var optionalMask = target.declaration.questionToken ? 0 : 16777216; - var members = ts.createSymbolTable(); for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { var prop = properties_4[_i]; - var propType = getTypeOfSymbol(prop); - if (propType.flags & 16777216) { + if (getTypeOfSymbol(prop).flags & 67108864) { return undefined; } - var checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 : 0; - var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.escapedName, checkFlags); - inferredProp.declarations = prop.declarations; - inferredProp.type = inferTargetType(propType); - members.set(prop.escapedName, inferredProp); - } - if (indexInfo) { - indexInfo = createIndexInfo(inferTargetType(indexInfo.type), readonlyMask && indexInfo.isReadonly); - } - return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined); - function inferTargetType(sourceType) { - inference.candidates = undefined; - inferTypes(inferences, sourceType, templateType, 0, mappedTypeStack); - return inference.candidates ? getUnionType(inference.candidates, true) : emptyObjectType; } + var reversed = createObjectType(2048 | 16, undefined); + reversed.source = source; + reversed.mappedType = target; + return reversed; + } + function getTypeOfReverseMappedSymbol(symbol) { + return inferReverseMappedType(symbol.propertyType, symbol.mappedType); + } + function inferReverseMappedType(sourceType, target) { + var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + var inference = createInferenceInfo(typeParameter); + inferTypes([inference], sourceType, templateType); + return getTypeFromInference(inference) || emptyObjectType; } function getUnmatchedProperty(source, target, requireOptionalProperties) { var properties = target.flags & 262144 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); @@ -28264,10 +28873,16 @@ var ts; } return undefined; } - function inferTypes(inferences, originalSource, originalTarget, priority, mappedTypeStack) { + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType(inference.candidates, 2) : + inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : + undefined; + } + function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; var visited; + var contravariant = false; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -28310,28 +28925,33 @@ var ts; } } if (target.flags & 1081344) { - if (source.flags & 16777216 || source === silentNeverType) { + if (source.flags & 67108864 || source === silentNeverType) { return; } var inference = getInferenceInfoForType(target); if (inference) { if (!inference.isFixed) { - var p = priority | (source === implicitNeverType ? 16 : 0); - if (!inference.candidates || p < inference.priority) { - inference.candidates = [source]; - inference.priority = p; + if (inference.priority === undefined || priority < inference.priority) { + inference.candidates = undefined; + inference.contraCandidates = undefined; + inference.priority = priority; } - else if (p === inference.priority) { - inference.candidates.push(source); + if (priority === inference.priority) { + if (contravariant) { + inference.contraCandidates = ts.append(inference.contraCandidates, source); + } + else { + inference.candidates = ts.append(inference.candidates, source); + } } - if (!(p & 8) && target.flags & 32768 && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 4) && target.flags & 32768 && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; } } return; } } - else if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target) { + if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target) { var sourceTypes = source.typeArguments || ts.emptyArray; var targetTypes = target.typeArguments || ts.emptyArray; var count = sourceTypes.length < targetTypes.length ? sourceTypes.length : targetTypes.length; @@ -28346,20 +28966,26 @@ var ts; } } else if (source.flags & 524288 && target.flags & 524288) { - priority ^= 1; + contravariant = !contravariant; inferFromTypes(source.type, target.type); - priority ^= 1; + contravariant = !contravariant; } else if ((isLiteralType(source) || source.flags & 2) && target.flags & 524288) { var empty = createEmptyObjectTypeFromStringLiteral(source); - priority ^= 1; + contravariant = !contravariant; inferFromTypes(empty, target.type); - priority ^= 1; + contravariant = !contravariant; } else if (source.flags & 1048576 && target.flags & 1048576) { inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } + else if (source.flags & 2097152 && target.flags & 2097152) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(source.trueType, target.trueType); + inferFromTypes(source.falseType, target.falseType); + } else if (target.flags & 393216) { var targetTypes = target.types; var typeVariableCount = 0; @@ -28376,7 +29002,7 @@ var ts; } if (typeVariableCount === 1) { var savePriority = priority; - priority |= 2; + priority |= 1; inferFromTypes(source, typeVariable); priority = savePriority; } @@ -28389,7 +29015,9 @@ var ts; } } else { - source = getApparentType(source); + if (!(priority && 8 && source.flags & (262144 | 7897088))) { + source = getApparentType(source); + } if (source.flags & (65536 | 262144)) { var key = source.id + "," + target.id; if (visited && visited.get(key)) { @@ -28414,10 +29042,10 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes) { - priority ^= 1; + if (strictFunctionTypes || priority & 16) { + contravariant = !contravariant; inferFromTypes(source, target); - priority ^= 1; + contravariant = !contravariant; } else { inferFromTypes(source, target); @@ -28444,16 +29072,10 @@ var ts; if (constraintType.flags & 524288) { var inference = getInferenceInfoForType(constraintType.type); if (inference && !inference.isFixed) { - var key = (source.symbol ? getSymbolId(source.symbol) + "," : "") + getSymbolId(target.symbol); - if (ts.contains(mappedTypeStack, key)) { - return; - } - (mappedTypeStack || (mappedTypeStack = [])).push(key); - var inferredType = inferTypeForHomomorphicMappedType(source, target, mappedTypeStack); - mappedTypeStack.pop(); + var inferredType = inferTypeForHomomorphicMappedType(source, target); if (inferredType) { var savePriority = priority; - priority |= 4; + priority |= 2; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -28495,8 +29117,10 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromContravariantTypes); - if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) { - inferFromTypes(source.typePredicate.type, target.typePredicate.type); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (sourceTypePredicate && targetTypePredicate && sourceTypePredicate.kind === targetTypePredicate.kind) { + inferFromTypes(sourceTypePredicate.type, targetTypePredicate.type); } else { inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -28523,8 +29147,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -28552,7 +29176,7 @@ var ts; if (candidates.length > 1) { var objectLiterals = ts.filter(candidates, isObjectLiteralType); if (objectLiterals.length) { - var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, true)); + var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, 2)); return ts.concatenate(ts.filter(candidates, function (t) { return !isObjectLiteralType(t); }), [objectLiteralsType]); } } @@ -28569,10 +29193,16 @@ var ts; !hasPrimitiveConstraint(inference.typeParameter) && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates; - var unwidenedType = inference.priority & 1 ? getCommonSubtype(baseCandidates) : - context.flags & 1 || inference.priority & 8 ? getUnionType(baseCandidates, true) : - getCommonSupertype(baseCandidates); + var unwidenedType = context.flags & 1 || inference.priority & 4 ? + getUnionType(baseCandidates, 2) : + getCommonSupertype(baseCandidates); inferredType = getWidenedType(unwidenedType); + if (inferredType.flags & 16384 && inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); + } + } + else if (inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); } else if (context.flags & 2) { inferredType = silentNeverType; @@ -28612,12 +29242,12 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; + resolveName(node, node.escapedText, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { - return !!ts.findAncestor(node, function (n) { return n.kind === 163 ? true : n.kind === 71 || n.kind === 144 ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 164 ? true : n.kind === 71 || n.kind === 145 ? false : "quit"; }); } function getFlowCacheKey(node) { if (node.kind === 71) { @@ -28627,13 +29257,13 @@ var ts; if (node.kind === 99) { return "0"; } - if (node.kind === 180) { + if (node.kind === 183) { var key = getFlowCacheKey(node.expression); return key && key + "." + ts.idText(node.name); } - if (node.kind === 177) { + if (node.kind === 180) { var container = node.parent.parent; - var key = container.kind === 177 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); + var key = container.kind === 180 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); var text = getBindingElementNameText(node); var result = key && text && (key + "." + text); return result; @@ -28641,12 +29271,12 @@ var ts; return undefined; } function getBindingElementNameText(element) { - if (element.parent.kind === 175) { + if (element.parent.kind === 178) { var name = element.propertyName || element.name; switch (name.kind) { case 71: return ts.idText(name); - case 145: + case 146: return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; case 9: case 8: @@ -28663,26 +29293,26 @@ var ts; switch (source.kind) { case 71: return target.kind === 71 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 227 || target.kind === 177) && + (target.kind === 230 || target.kind === 180) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 99: return target.kind === 99; case 97: return target.kind === 97; - case 180: - return target.kind === 180 && + case 183: + return target.kind === 183 && source.name.escapedText === target.name.escapedText && isMatchingReference(source.expression, target.expression); - case 177: - if (target.kind !== 180) + case 180: + if (target.kind !== 183) return false; var t = target; if (t.name.escapedText !== getBindingElementNameText(source)) return false; - if (source.parent.parent.kind === 177 && isMatchingReference(source.parent.parent, t.expression)) { + if (source.parent.parent.kind === 180 && isMatchingReference(source.parent.parent, t.expression)) { return true; } - if (source.parent.parent.kind === 227) { + if (source.parent.parent.kind === 230) { var maybeId = source.parent.parent.initializer; return maybeId && isMatchingReference(maybeId, t.expression); } @@ -28690,7 +29320,7 @@ var ts; return false; } function containsMatchingReference(source, target) { - while (source.kind === 180) { + while (source.kind === 183) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -28699,7 +29329,7 @@ var ts; return false; } function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 180 && + return target.kind === 183 && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); } @@ -28707,7 +29337,7 @@ var ts; if (expr.kind === 71) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 180) { + if (expr.kind === 183) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.escapedText); } @@ -28751,7 +29381,7 @@ var ts; } } } - if (callExpression.expression.kind === 180 && + if (callExpression.expression.kind === 183 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -28790,8 +29420,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getTypeFacts(t); } return result; @@ -28843,10 +29473,10 @@ var ts; if (flags & 1536) { return strictNullChecks ? 1981320 : 4193160; } - if (flags & 33554432) { + if (flags & 134217728) { return strictNullChecks ? 6166480 : 8378320; } - if (flags & 1081344) { + if (flags & 7897088) { return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 393216) { @@ -28855,14 +29485,6 @@ var ts; return 8388607; } function getTypeWithFacts(type, include) { - if (type.flags & 1048576) { - var baseConstraint = getBaseConstraintOfType(type) || emptyObjectType; - var result = filterType(baseConstraint, function (t) { return (getTypeFacts(t) & include) !== 0; }); - if (result !== baseConstraint) { - return result; - } - return type; - } return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; }); } function getTypeWithDefault(type, defaultExpression) { @@ -28888,18 +29510,18 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 178 && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 265 && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 181 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 268 && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 195 && parent.parent.left === parent || - parent.parent.kind === 217 && parent.parent.initializer === parent; + return parent.parent.kind === 198 && parent.parent.left === parent || + parent.parent.kind === 220 && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { - return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); + return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); } function getAssignedTypeOfSpreadExpression(node) { return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); @@ -28913,21 +29535,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 216: + case 219: return stringType; - case 217: + case 220: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; - case 195: + case 198: return getAssignedTypeOfBinaryExpression(parent); - case 189: + case 192: return undefinedType; - case 178: + case 181: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 199: + case 202: return getAssignedTypeOfSpreadExpression(parent); - case 265: + case 268: return getAssignedTypeOfPropertyAssignment(parent); - case 266: + case 269: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -28935,10 +29557,10 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 175 ? + var type = pattern.kind === 178 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? - getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : + getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } @@ -28950,35 +29572,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 216) { + if (node.parent.parent.kind === 219) { return stringType; } - if (node.parent.parent.kind === 217) { + if (node.parent.parent.kind === 220) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 227 ? + return node.kind === 230 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 227 || node.kind === 177 ? + return node.kind === 230 || node.kind === 180 ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 227 && node.initializer && + return node.kind === 230 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 177 && node.parent.kind === 195 && + node.kind !== 180 && node.parent.kind === 198 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 186: + case 189: return getReferenceCandidate(node.expression); - case 195: + case 198: switch (node.operatorToken.kind) { case 58: return getReferenceCandidate(node.left); @@ -28990,13 +29612,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 186 || - parent.kind === 195 && parent.operatorToken.kind === 58 && parent.left === node || - parent.kind === 195 && parent.operatorToken.kind === 26 && parent.right === node ? + return parent.kind === 189 || + parent.kind === 198 && parent.operatorToken.kind === 58 && parent.left === node || + parent.kind === 198 && parent.operatorToken.kind === 26 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 261) { + if (clause.kind === 264) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -29049,15 +29671,15 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, mapper) { + function mapType(type, mapper, noReductions) { if (!(type.flags & 131072)) { return mapper(type); } var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var current = types_13[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -29071,7 +29693,7 @@ var ts; } } } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; + return mappedTypes ? getUnionType(mappedTypes, noReductions ? 0 : 1) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -29112,7 +29734,7 @@ var ts; return elementType.flags & 16384 ? autoArrayType : createArrayType(elementType.flags & 131072 ? - getUnionType(elementType.types, true) : + getUnionType(elementType.types, 2) : elementType); } function getFinalArrayType(evolvingArrayType) { @@ -29126,8 +29748,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; if (!(t.flags & 16384)) { if (!(ts.getObjectFlags(t) & 256)) { return false; @@ -29145,11 +29767,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 180 && (parent.name.escapedText === "length" || - parent.parent.kind === 182 && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 181 && + var isLengthPushOrUnshift = parent.kind === 183 && (parent.name.escapedText === "length" || + parent.parent.kind === 185 && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 184 && parent.expression === root && - parent.parent.kind === 195 && + parent.parent.kind === 198 && parent.parent.operatorToken.kind === 58 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -29168,10 +29790,7 @@ var ts; var funcType = checkNonNullExpression(node.expression); if (funcType !== silentNeverType) { var apparentType = getApparentType(funcType); - if (apparentType !== unknownType) { - var callSignatures = getSignaturesOfType(apparentType, 0); - return !!ts.forEach(callSignatures, function (sig) { return sig.typePredicate; }); - } + return apparentType !== unknownType && ts.some(getSignaturesOfType(apparentType, 0), signatureHasTypePredicate); } } return false; @@ -29189,14 +29808,14 @@ var ts; if (flowAnalysisDisabled) { return unknownType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 35620607)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359)) { return declaredType; } var sharedFlowStart = sharedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); sharedFlowCount = sharedFlowStart; var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent && reference.parent.kind === 204 && getTypeWithFacts(resultType, 524288).flags & 16384) { + if (reference.parent && reference.parent.kind === 207 && getTypeWithFacts(resultType, 524288).flags & 16384) { return declaredType; } return resultType; @@ -29258,7 +29877,7 @@ var ts; } else if (flags & 2) { var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 180 && reference.kind !== 99) { + if (container && container !== flowContainer && reference.kind !== 183 && reference.kind !== 99) { flow = container.flowNode; continue; } @@ -29303,7 +29922,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 182 ? + var expr = node.kind === 185 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -29311,7 +29930,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 182) { + if (node.kind === 185) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -29380,7 +29999,7 @@ var ts; seenIncomplete = true; } } - return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete); + return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 : 1), seenIncomplete); } function getTypeAtFlowLoopLabel(flow) { var id = getFlowNodeId(flow); @@ -29397,7 +30016,7 @@ var ts; } for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { - return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], false), true); + return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], 1), true); } } var antecedentTypes = []; @@ -29427,7 +30046,7 @@ var ts; break; } } - var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction); + var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 : 1); if (isIncomplete(firstAntecedentType)) { return createFlowType(result, true); } @@ -29435,7 +30054,7 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - return expr.kind === 180 && + return expr.kind === 183 && computedType.flags & 131072 && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, expr.name.escapedText); @@ -29458,6 +30077,23 @@ var ts; } return type; } + function isTypePresencePossible(type, propName, assumeTrue) { + if (getIndexInfoOfType(type, 0)) { + return true; + } + var prop = getPropertyOfType(type, propName); + if (prop) { + return prop.flags & 16777216 ? true : assumeTrue; + } + return !assumeTrue; + } + function narrowByInKeyword(type, literal, assumeTrue) { + if ((type.flags & (131072 | 65536)) || (type.flags & 32768 && type.isThisType)) { + var propName_1 = ts.escapeLeadingUnderscores(literal.text); + return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); }); + } + return type; + } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { case 58: @@ -29469,10 +30105,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 190 && right_1.kind === 9) { + if (left_1.kind === 193 && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 190 && left_1.kind === 9) { + if (right_1.kind === 193 && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -29493,6 +30129,12 @@ var ts; break; case 93: return narrowTypeByInstanceof(type, expr, assumeTrue); + case 92: + var target = getReferenceCandidate(expr.right); + if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { + return narrowByInKeyword(type, expr.left, assumeTrue); + } + break; case 26: return narrowType(type, expr.right, assumeTrue); } @@ -29518,7 +30160,7 @@ var ts; assumeTrue ? 16384 : 131072; return getTypeWithFacts(type, facts); } - if (type.flags & 33620481) { + if (type.flags & 134283777) { return type; } if (assumeTrue) { @@ -29548,7 +30190,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 1081344) { + if (type.flags & 7897088) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -29570,7 +30212,7 @@ var ts; var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType); var discriminantType = getUnionType(clauseTypes); var caseType = discriminantType.flags & 16384 ? neverType : - replacePrimitivesWithLiterals(filterType(type, function (t) { return isTypeComparableTo(discriminantType, t); }), discriminantType); + replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType); if (!hasDefaultClause) { return caseType; } @@ -29637,7 +30279,7 @@ var ts; return type; } var signature = getResolvedSignature(callExpression); - var predicate = signature.typePredicate; + var predicate = getTypePredicateOfSignature(signature); if (!predicate) { return type; } @@ -29657,7 +30299,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 181 || invokedExpression.kind === 180) { + if (invokedExpression.kind === 184 || invokedExpression.kind === 183) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -29675,15 +30317,15 @@ var ts; case 71: case 99: case 97: - case 180: + case 183: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 182: + case 185: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 186: + case 189: return narrowType(type, expr.expression, assumeTrue); - case 195: + case 198: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 193: + case 196: if (expr.operator === 51) { return narrowType(type, expr.operand, !assumeTrue); } @@ -29710,9 +30352,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 235 || - node.kind === 269 || - node.kind === 150; + node.kind === 238 || + node.kind === 272 || + node.kind === 151; }); } function isParameterAssigned(symbol) { @@ -29733,7 +30375,7 @@ var ts; if (node.kind === 71) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 147) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148) { symbol.isAssigned = true; } } @@ -29747,7 +30389,7 @@ var ts; } function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 147 && + declaration.kind === 148 && declaration.initializer && getFalsyFlags(declaredType) & 4096 && !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096); @@ -29755,20 +30397,26 @@ var ts; } function isApparentTypePosition(node) { var parent = node.parent; - return parent.kind === 180 || - parent.kind === 182 && parent.expression === node || - parent.kind === 181 && parent.expression === node; + return parent.kind === 183 || + parent.kind === 185 && parent.expression === node || + parent.kind === 184 && parent.expression === node || + parent.kind === 207 || + parent.kind === 180 && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 1081344 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288); + return type.flags & 7372800 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288); } - function getDeclaredOrApparentType(symbol, node) { - var type = getTypeOfSymbol(symbol); + function getApparentTypeForLocation(type, node) { if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { return mapType(getWidenedType(type), getApparentType); } return type; } + function markAliasReferenced(symbol, location) { + if (isNonLocalAlias(symbol, 107455) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + markAliasSymbolAsReferenced(symbol); + } + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -29777,7 +30425,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 188) { + if (container.kind === 191) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256)) { @@ -29787,13 +30435,13 @@ var ts; getNodeLinks(container).flags |= 8192; return getTypeOfSymbol(symbol); } - if (isNonLocalAlias(symbol, 107455) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { - markAliasSymbolAsReferenced(symbol); + if (!(node.parent && ts.isPropertyAccessExpression(node.parent) && node.parent.expression === node)) { + markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); var declaration = localOrExportSymbol.valueDeclaration; if (localOrExportSymbol.flags & 32) { - if (declaration.kind === 230 + if (declaration.kind === 233 && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -29805,11 +30453,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 200) { + else if (declaration.kind === 203) { var container = ts.getThisContainer(node, false); while (container !== undefined) { if (container.parent === declaration) { - if (container.kind === 150 && ts.hasModifier(container, 32)) { + if (container.kind === 151 && ts.hasModifier(container, 32)) { getNodeLinks(declaration).flags |= 8388608; getNodeLinks(node).flags |= 16777216; } @@ -29823,7 +30471,7 @@ var ts; checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - var type = getDeclaredOrApparentType(localOrExportSymbol, node); + var type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { if (!(localOrExportSymbol.flags & 3)) { @@ -29850,22 +30498,23 @@ var ts; if (!declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 147; + var isParameter = ts.getRootDeclaration(declaration).kind === 148; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; - while (flowContainer !== declarationContainer && (flowContainer.kind === 187 || - flowContainer.kind === 188 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + var isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); + while (flowContainer !== declarationContainer && (flowContainer.kind === 190 || + flowContainer.kind === 191 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - var assumeInitialized = isParameter || isAlias || isOuterVariable || + var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0 || - isInTypeQuery(node) || node.parent.kind === 247) || - node.parent.kind === 204 || - declaration.kind === 227 && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 250) || + node.parent.kind === 207 || + declaration.kind === 230 && declaration.exclamationToken || declaration.flags & 2097152; - var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); @@ -29890,7 +30539,7 @@ var ts; function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 264) { + symbol.valueDeclaration.parent.kind === 267) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -29908,8 +30557,8 @@ var ts; if (usedInFunction) { getNodeLinks(current).flags |= 65536; } - if (container.kind === 215 && - ts.getAncestor(symbol.valueDeclaration, 228).parent === container && + if (container.kind === 218 && + ts.getAncestor(symbol.valueDeclaration, 231).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152; } @@ -29921,14 +30570,14 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 186) { + while (current.parent.kind === 189) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 193 || current.parent.kind === 194)) { + else if ((current.parent.kind === 196 || current.parent.kind === 197)) { var expr = current.parent; isAssigned = expr.operator === 43 || expr.operator === 44; } @@ -29939,7 +30588,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 150 || container.kind === 153) { + if (container.kind === 151 || container.kind === 154) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -29983,42 +30632,50 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 153) { + if (container.kind === 154) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 188) { + if (container.kind === 191) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 234: + case 237: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 233: + case 236: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 153: + case 154: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 151: case 150: - case 149: if (ts.hasModifier(container, 32)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 145: + case 146: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } + var type = tryGetThisTypeAt(node, container); + if (!type && noImplicitThis) { + error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + } + return type || anyType; + } + function tryGetThisTypeAt(node, container) { + if (container === void 0) { container = ts.getThisContainer(node, false); } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { - if (container.kind === 187 && - container.parent.kind === 195 && + if (container.kind === 190 && + container.parent.kind === 198 && ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { var className = container.parent .left @@ -30026,12 +30683,12 @@ var ts; .expression; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16)) { - return getInferredClassType(classSymbol); + return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { - return thisType; + return getFlowTypeOfReference(node, thisType); } } if (ts.isClassLike(container.parent)) { @@ -30042,17 +30699,13 @@ var ts; if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); if (type && type !== unknownType) { - return type; + return getFlowTypeOfReference(node, type); } } - if (noImplicitThis) { - error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); - } - return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 277) { + if (jsdocType && jsdocType.kind === 280) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -30062,14 +30715,14 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 147; }); + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 182 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 185 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 188) { + while (container && container.kind === 191) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -30077,14 +30730,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 145; }); - if (current && current.kind === 145) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146; }); + if (current && current.kind === 146) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 179)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 182)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -30092,7 +30745,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 153) { + if (!isCallExpression && container.kind === 154) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32) || isCallExpression) { @@ -30102,7 +30755,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 152 && ts.hasModifier(container, 256)) { + if (container.kind === 153 && ts.hasModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -30113,7 +30766,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 179) { + if (container.parent.kind === 182) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -30132,7 +30785,7 @@ var ts; if (!baseClassType) { return unknownType; } - if (container.kind === 153 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 154 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; } @@ -30144,24 +30797,24 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 153; + return container.kind === 154; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 179) { + if (ts.isClassLike(container.parent) || container.parent.kind === 182) { if (ts.hasModifier(container, 32)) { - return container.kind === 152 || - container.kind === 151 || - container.kind === 154 || - container.kind === 155; + return container.kind === 153 || + container.kind === 152 || + container.kind === 155 || + container.kind === 156; } else { - return container.kind === 152 || - container.kind === 151 || - container.kind === 154 || + return container.kind === 153 || + container.kind === 152 || container.kind === 155 || + container.kind === 156 || + container.kind === 151 || container.kind === 150 || - container.kind === 149 || - container.kind === 153; + container.kind === 154; } } } @@ -30169,10 +30822,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 152 || - func.kind === 154 || - func.kind === 155) && func.parent.kind === 179 ? func.parent : - func.kind === 187 && func.parent.kind === 265 ? func.parent.parent : + return (func.kind === 153 || + func.kind === 155 || + func.kind === 156) && func.parent.kind === 182 ? func.parent : + func.kind === 190 && func.parent.kind === 268 ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -30184,7 +30837,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 188) { + if (func.kind === 191) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -30208,7 +30861,7 @@ var ts; if (thisType) { return instantiateType(thisType, getContextualMapper(containingLiteral)); } - if (literal.parent.kind !== 265) { + if (literal.parent.kind !== 268) { break; } literal = literal.parent.parent; @@ -30217,9 +30870,9 @@ var ts; return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); } var parent = func.parent; - if (parent.kind === 195 && parent.operatorToken.kind === 58) { + if (parent.kind === 198 && parent.operatorToken.kind === 58) { var target = parent.left; - if (target.kind === 180 || target.kind === 181) { + if (target.kind === 183 || target.kind === 184) { var expression = target.expression; if (inJs && ts.isIdentifier(expression)) { var sourceFile = ts.getSourceFileOfNode(parent); @@ -30238,7 +30891,7 @@ var ts; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); if (iife && iife.arguments) { - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (parameter.dotDotDotToken) { var restTypes = []; for (var i = indexOfParameter; i < iife.arguments.length; i++) { @@ -30259,7 +30912,7 @@ var ts; if (contextualSignature) { var funcHasRestParameters = ts.hasRestParameter(func); var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (ts.getThisParameter(func) !== undefined && !contextualSignature.thisParameter) { ts.Debug.assert(indexOfParameter !== 0); indexOfParameter -= 1; @@ -30278,12 +30931,12 @@ var ts; } function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; - if (node === declaration.initializer || node.kind === 58) { + if (ts.hasInitializer(declaration) && node === declaration.initializer) { var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 147) { + if (declaration.kind === 148) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -30295,7 +30948,7 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 177) { + if (parentDeclaration.kind !== 180) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !ts.isBindingPattern(name)) { var text = ts.getTextOfPropertyName(name); @@ -30349,7 +31002,7 @@ var ts; return false; } function getContextualReturnType(functionDecl) { - if (functionDecl.kind === 153 || + if (functionDecl.kind === 154 || ts.getEffectiveReturnTypeNode(functionDecl) || isGetAccessorWithAnnotatedSetAccessor(functionDecl)) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); @@ -30362,15 +31015,15 @@ var ts; } function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); - var argIndex = ts.indexOf(args, arg); - if (argIndex >= 0) { - var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + var argIndex = args.indexOf(arg); + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 184) { + if (template.parent.kind === 187) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -30387,11 +31040,6 @@ var ts; case 53: case 26: return node === right ? getContextualType(binaryExpression) : undefined; - case 34: - case 32: - case 35: - case 33: - return node === operatorToken ? getTypeOfExpression(binaryExpression.left) : undefined; default: return undefined; } @@ -30416,10 +31064,10 @@ var ts; return mapType(type, function (t) { var prop = t.flags & 458752 ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; - }); + }, true); } function getIndexTypeOfContextualType(type, kind) { - return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, true); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 131072 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); @@ -30456,40 +31104,29 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + function getContextualTypeForChildJsxExpression(node) { + var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; + } function getContextualTypeForJsxExpression(node) { - var jsxAttributes = ts.isJsxAttributeLike(node.parent) ? - node.parent.parent : - ts.isJsxElement(node.parent) ? - node.parent.openingElement.attributes : - undefined; - if (!jsxAttributes) { - return undefined; - } - var attributesType = getContextualType(jsxAttributes); - if (!attributesType || isTypeAny(attributesType)) { - return undefined; - } - if (ts.isJsxAttribute(node.parent)) { - return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); - } - else if (node.parent.kind === 250) { - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; - } - else { - return attributesType; - } + var exprParent = node.parent; + return ts.isJsxAttributeLike(exprParent) + ? getContextualType(node) + : ts.isJsxElement(exprParent) + ? getContextualTypeForChildJsxExpression(exprParent) + : undefined; } function getContextualTypeForJsxAttribute(attribute) { - var attributesType = getContextualType(attribute.parent); if (ts.isJsxAttribute(attribute)) { + var attributesType = getApparentTypeOfContextualType(attribute.parent); if (!attributesType || isTypeAny(attributesType)) { return undefined; } return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { - return attributesType; + return getContextualType(attribute.parent); } } function getApparentTypeOfContextualType(node) { @@ -30503,7 +31140,7 @@ var ts; var prop = _a[_i]; if (!prop.symbol) continue; - if (prop.kind !== 265) + if (prop.kind !== 268) continue; if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) { var discriminatingType = getTypeOfNode(prop.initializer); @@ -30533,61 +31170,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 227: - case 147: + case 230: + case 148: + case 151: case 150: - case 149: - case 177: + case 180: return getContextualTypeForInitializerExpression(node); - case 188: - case 220: + case 191: + case 223: return getContextualTypeForReturnExpression(node); - case 198: + case 201: return getContextualTypeForYieldOperand(parent); - case 183: - if (node.kind === 94) { - return getContextualType(parent); - } - case 182: - return getContextualTypeForArgument(parent, node); case 185: - case 203: + case 186: + return getContextualTypeForArgument(parent, node); + case 188: + case 206: return getTypeFromTypeNode(parent.type); - case 195: + case 198: return getContextualTypeForBinaryOperand(node); - case 265: - case 266: + case 268: + case 269: return getContextualTypeForObjectLiteralElement(parent); - case 267: + case 270: return getApparentTypeOfContextualType(parent.parent); - case 178: { + case 181: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 196: + case 199: return getContextualTypeForConditionalOperand(node); - case 206: - ts.Debug.assert(parent.parent.kind === 197); + case 209: + ts.Debug.assert(parent.parent.kind === 200); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 186: { + case 189: { var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent); } - case 260: + case 263: return getContextualTypeForJsxExpression(parent); - case 257: - case 259: + case 260: + case 262: return getContextualTypeForJsxAttribute(parent); - case 252: - case 251: - return getAttributesTypeFromJsxOpeningLikeElement(parent); - case 261: { - if (node.kind === 73) { - var switchStatement = parent.parent.parent; - return getTypeOfExpression(switchStatement.expression); - } - } + case 255: + case 254: + return getContextualJsxElementAttributesType(parent); } return undefined; } @@ -30595,8 +31223,112 @@ var ts; node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); return node ? node.contextualMapper : identityMapper; } + function getContextualJsxElementAttributesType(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + var valueType = checkExpression(node.tagName); + if (isTypeAny(valueType)) { + return anyType; + } + var isJs = ts.isInJavaScriptFile(node); + return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + } + function getJsxSignaturesParameterTypes(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, false); + } + function getJsxSignaturesParameterTypesJs(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, true); + } + function getJsxSignaturesParameterTypesInternal(valueType, isJs) { + if (valueType.flags & 2) { + return anyType; + } + else if (valueType.flags & 32) { + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + if (intrinsicElementsType !== unknownType) { + var stringLiteralTypeName = valueType.value; + var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); + if (intrinsicProp) { + return getTypeOfSymbol(intrinsicProp); + } + var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0); + if (indexSignatureType) { + return indexSignatureType; + } + } + return anyType; + } + var signatures = getSignaturesOfType(valueType, 1); + var ctor = true; + if (signatures.length === 0) { + signatures = getSignaturesOfType(valueType, 0); + ctor = false; + if (signatures.length === 0) { + return unknownType; + } + } + return getUnionType(ts.map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), 0); + } + function getJsxPropsTypeFromCallSignature(sig) { + var propsType = getTypeOfFirstParameterOfSignature(sig); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + propsType = intersectTypes(intrinsicAttribs, propsType); + } + return propsType; + } + function getJsxPropsTypeFromClassType(hostClassType, isJs) { + if (isTypeAny(hostClassType)) { + return hostClassType; + } + var propsName = getJsxElementPropertiesName(); + if (propsName === undefined) { + return anyType; + } + else if (propsName === "") { + return hostClassType; + } + else { + var attributesType = getTypeOfPropertyOfType(hostClassType, propsName); + if (!attributesType) { + return emptyObjectType; + } + else if (isTypeAny(attributesType)) { + return attributesType; + } + else { + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + apparentAttributesType = intersectTypes(typeParams + ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs)) + : intrinsicClassAttribs, apparentAttributesType); + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return apparentAttributesType; + } + } + } + function getJsxPropsTypeFromConstructSignatureJs(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, true); + } + function getJsxPropsTypeFromConstructSignature(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, false); + } + function getJsxPropsTypeFromConstructSignatureInternal(sig, isJs) { + var hostClassType = getReturnTypeOfSignature(sig); + if (hostClassType) { + return getJsxPropsTypeFromClassType(hostClassType, isJs); + } + return getJsxPropsTypeFromCallSignature(sig); + } function getContextualCallSignature(type, node) { - var signatures = getSignaturesOfStructuredType(type, 0); + var signatures = getSignaturesOfType(type, 0); if (signatures.length === 1) { var signature = signatures[0]; if (!isAritySmaller(signature, node)) { @@ -30619,7 +31351,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 187 || node.kind === 188; + return node.kind === 190 || node.kind === 191; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -30632,7 +31364,7 @@ var ts; getApparentTypeOfContextualType(node); } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -30642,8 +31374,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var current = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -30660,7 +31392,6 @@ var ts; var result; if (signatureList) { result = cloneSignature(signatureList[0]); - result.resolvedReturnType = undefined; result.unionSignatures = signatureList; } return result; @@ -30673,8 +31404,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false); } function hasDefaultValue(node) { - return (node.kind === 177 && !!node.initializer) || - (node.kind === 195 && node.operatorToken.kind === 58); + return (node.kind === 180 && !!node.initializer) || + (node.kind === 198 && node.operatorToken.kind === 58); } function checkArrayLiteral(node, checkMode) { var elements = node.elements; @@ -30684,7 +31415,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); for (var index = 0; index < elements.length; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 199) { + if (inDestructuringPattern && e.kind === 202) { var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1) || getIteratedTypeOrElementType(restArrayType, undefined, false, false, false); @@ -30697,7 +31428,7 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 199; + hasSpreadElement = hasSpreadElement || e.kind === 202; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -30707,7 +31438,7 @@ var ts; } if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 176 || pattern.kind === 178)) { + if (pattern && (pattern.kind === 179 || pattern.kind === 181)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -30715,10 +31446,10 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 201) { + if (patternElement.kind !== 204) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - elementTypes.push(unknownType); + elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); } } } @@ -30728,12 +31459,12 @@ var ts; } } return createArrayType(elementTypes.length ? - getUnionType(elementTypes, true) : + getUnionType(elementTypes, 2) : strictNullChecks ? implicitNeverType : undefinedWideningType); } function isNumericName(name) { switch (name.kind) { - case 145: + case 146: return isNumericComputedName(name); case 71: return isNumericLiteralName(name.escapedText); @@ -30775,7 +31506,7 @@ var ts; propTypes.push(getTypeOfSymbol(properties[i])); } } - var unionType = propTypes.length ? getUnionType(propTypes, true) : undefinedType; + var unionType = propTypes.length ? getUnionType(propTypes, 2) : undefinedType; return createIndexInfo(unionType, false); } function checkObjectLiteral(node, checkMode) { @@ -30784,10 +31515,10 @@ var ts; var propertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; - var propagatedFlags = 0; + var propagatedFlags = 8388608; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 175 || contextualType.pattern.kind === 179); + (contextualType.pattern.kind === 178 || contextualType.pattern.kind === 182); var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; @@ -30799,16 +31530,16 @@ var ts; var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); var literalName = void 0; - if (memberDecl.kind === 265 || - memberDecl.kind === 266 || + if (memberDecl.kind === 268 || + memberDecl.kind === 269 || ts.isObjectLiteralMethod(memberDecl)) { var jsdocType = void 0; if (isInJSFile) { jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl); } var type = void 0; - if (memberDecl.kind === 265) { - if (memberDecl.name.kind === 145) { + if (memberDecl.kind === 268) { + if (memberDecl.name.kind === 146) { var t = checkComputedPropertyName(memberDecl.name); if (t.flags & 224) { literalName = ts.escapeLeadingUnderscores("" + t.value); @@ -30816,11 +31547,11 @@ var ts; } type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 152) { + else if (memberDecl.kind === 153) { type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 266); + ts.Debug.assert(memberDecl.kind === 269); type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -30833,8 +31564,8 @@ var ts; ? createSymbol(4 | member.flags, getLateBoundNameFromType(nameType), 1024) : createSymbol(4 | member.flags, literalName || member.escapedName); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 265 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 266 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 268 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 269 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216; } @@ -30860,12 +31591,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 267) { + else if (memberDecl.kind === 270) { if (languageVersion < 2) { checkExternalEmitHelpers(memberDecl, 2); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 0); propertiesArray = []; propertiesTable = ts.createSymbolTable(); hasComputedStringProperty = false; @@ -30877,12 +31608,12 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, node.symbol, propagatedFlags); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags, 0); offset = i + 1; continue; } else { - ts.Debug.assert(memberDecl.kind === 154 || memberDecl.kind === 155); + ts.Debug.assert(memberDecl.kind === 155 || memberDecl.kind === 156); checkNodeDeferred(memberDecl); } if (!literalName && hasNonBindableDynamicName(memberDecl)) { @@ -30912,7 +31643,7 @@ var ts; } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 0); } return spread; } @@ -30921,8 +31652,8 @@ var ts; var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 2097152; - result.flags |= 8388608 | freshObjectLiteralFlag | (typeFlags & 29360128); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608; + result.flags |= 33554432 | freshObjectLiteralFlag | (typeFlags & 117440512); result.objectFlags |= 128; if (patternWithComputedProperties) { result.objectFlags |= 512; @@ -30931,23 +31662,23 @@ var ts; result.pattern = node; } if (!(result.flags & 12288)) { - propagatedFlags |= (result.flags & 29360128); + propagatedFlags |= (result.flags & 117440512); } return result; } } function isValidSpreadType(type) { - return !!(type.flags & (1 | 33554432) || + return !!(type.flags & (1 | 134217728) || getFalsyFlags(type) & 14560 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 65536 && !isGenericMappedType(type) || type.flags & 393216 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } - function checkJsxSelfClosingElement(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node); + function checkJsxSelfClosingElement(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); return getJsxGlobalElementType() || anyType; } - function checkJsxElement(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); + function checkJsxElement(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement, checkMode); if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) { getIntrinsicTagSymbol(node.closingElement); } @@ -30956,8 +31687,8 @@ var ts; } return getJsxGlobalElementType() || anyType; } - function checkJsxFragment(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); + function checkJsxFragment(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); if (compilerOptions.jsx === 2 && compilerOptions.jsxFactory) { error(node, ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); } @@ -30968,7 +31699,7 @@ var ts; } function isJsxIntrinsicIdentifier(tagName) { switch (tagName.kind) { - case 180: + case 183: case 99: return false; case 71: @@ -30977,22 +31708,24 @@ var ts; ts.Debug.fail(); } } - function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + function checkJsxAttribute(node, checkMode) { + return node.initializer + ? checkExpressionForMutableLocation(node.initializer, checkMode) + : trueType; + } + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) { var attributes = openingLikeElement.attributes; var attributesTable = ts.createSymbolTable(); var spread = emptyObjectType; - var attributesArray = []; var hasSpreadAnyType = false; var typeToIntersect; var explicitlySpecifyChildrenAttribute = false; - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { var attributeDecl = _a[_i]; var member = attributeDecl.symbol; if (ts.isJsxAttribute(attributeDecl)) { - var exprType = attributeDecl.initializer ? - checkExpression(attributeDecl.initializer, checkMode) : - trueType; + var exprType = checkJsxAttribute(attributeDecl, checkMode); var attributeSymbol = createSymbol(4 | 33554432 | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; @@ -31002,24 +31735,22 @@ var ts; attributeSymbol.type = exprType; attributeSymbol.target = member; attributesTable.set(attributeSymbol.escapedName, attributeSymbol); - attributesArray.push(attributeSymbol); if (attributeDecl.name.escapedText === jsxChildrenPropertyName) { explicitlySpecifyChildrenAttribute = true; } } else { - ts.Debug.assert(attributeDecl.kind === 259); - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, 0); - attributesArray = []; + ts.Debug.assert(attributeDecl.kind === 262); + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096); attributesTable = ts.createSymbolTable(); } - var exprType = checkExpression(attributeDecl.expression); + var exprType = checkExpressionCached(attributeDecl.expression, checkMode); if (isTypeAny(exprType)) { hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType, openingLikeElement.symbol, 0); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, 0, 4096); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -31027,21 +31758,11 @@ var ts; } } if (!hasSpreadAnyType) { - if (spread !== emptyObjectType) { - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, 0); - } - attributesArray = getPropertiesOfType(spread); - } - attributesTable = ts.createSymbolTable(); - for (var _b = 0, attributesArray_1 = attributesArray; _b < attributesArray_1.length; _b++) { - var attr = attributesArray_1[_b]; - if (!filter || filter(attr)) { - attributesTable.set(attr.escapedName, attr); - } + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096); } } - var parent = openingLikeElement.parent.kind === 250 ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 253 ? openingLikeElement.parent : undefined; if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { @@ -31051,20 +31772,20 @@ var ts; var childrenPropSymbol = createSymbol(4 | 33554432, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : - createArrayType(getUnionType(childrenTypes, false)); - attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol); + createArrayType(getUnionType(childrenTypes)); + var childPropMap = ts.createSymbolTable(); + childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); + spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, undefined, undefined), attributes.symbol, 0, 4096); } } if (hasSpreadAnyType) { return anyType; } - var attributeType = createJsxAttributesType(attributes.symbol, attributesTable); - return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) : - typeToIntersect ? typeToIntersect : attributeType; - function createJsxAttributesType(symbol, attributesTable) { - var result = createAnonymousType(symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined); - result.flags |= 67108864 | 8388608; - result.objectFlags |= 128; + return typeToIntersect && spread !== emptyObjectType ? getIntersectionType([typeToIntersect, spread]) : (typeToIntersect || spread); + function createJsxAttributesType() { + var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined); + result.flags |= 33554432; + result.objectFlags |= 128 | 4096; return result; } } @@ -31078,13 +31799,13 @@ var ts; } } else { - childrenTypes.push(checkExpression(child, checkMode)); + childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } } return childrenTypes; } function checkJsxAttributes(node, checkMode) { - return createJsxAttributesTypeFromAttributesProperty(node.parent, undefined, checkMode); + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } function getJsxType(name) { var jsxType = jsxTypes.get(name); @@ -31140,14 +31861,15 @@ var ts; var signature = signatures_3[_i]; if (signature.typeParameters) { var isJavascript = ts.isInJavaScriptFile(node); - var typeArguments = fillMissingTypeArguments(undefined, signature.typeParameters, 0, isJavascript); + var inferenceContext = createInferenceContext(signature, isJavascript ? 4 : 0); + var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } else { instantiatedSignatures.push(signature); } } - return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), true); + return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2); } function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer) { var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920, undefined); @@ -31174,7 +31896,7 @@ var ts; } return _jsxElementPropertiesName; } - function getJsxElementChildrenPropertyname() { + function getJsxElementChildrenPropertyName() { if (!_hasComputedJsxElementChildrenPropertyName) { _hasComputedJsxElementChildrenPropertyName = true; _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); @@ -31261,12 +31983,11 @@ var ts; return undefined; } function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 131072) { var types = elementType.types; return getUnionType(types.map(function (type) { return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); - }), true); + }), 2); } if (elementType.flags & 2) { return anyType; @@ -31297,45 +32018,7 @@ var ts; if (elementClassType) { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - if (isTypeAny(elemInstanceType)) { - return elemInstanceType; - } - var propsName = getJsxElementPropertiesName(); - if (propsName === undefined) { - return anyType; - } - else if (propsName === "") { - return elemInstanceType; - } - else { - var attributesType = getTypeOfPropertyOfType(elemInstanceType, propsName); - if (!attributesType) { - return emptyObjectType; - } - else if (isTypeAny(attributesType) || (attributesType === unknownType)) { - return attributesType; - } - else { - var apparentAttributesType = attributesType; - var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); - if (intrinsicClassAttribs !== unknownType) { - var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); - if (typeParams) { - if (typeParams.length === 1) { - apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); - } - } - else { - apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); - } - } - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttribs !== unknownType) { - apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); - } - return apparentAttributesType; - } - } + return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement)); } function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); @@ -31355,13 +32038,7 @@ var ts; return links.resolvedJsxElementAttributesType; } function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { - var links = getNodeLinks(node); - var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; - if (!links[linkLocation]) { - var elemClassType = getJsxGlobalElementClassType(); - return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); - } - return links[linkLocation]; + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); } function getAllAttributesTypeFromJsxOpeningLikeElement(node) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -31419,7 +32096,7 @@ var ts; } } } - function checkJsxOpeningLikeElementOrOpeningFragment(node) { + function checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode) { var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(node); if (isNodeOpeningLikeElement) { checkGrammarJsxElement(node); @@ -31430,13 +32107,13 @@ var ts; var reactLocation = isNodeOpeningLikeElement ? node.tagName : node; var reactSym = resolveName(reactLocation, reactNamespace, 107455, reactRefErr, reactNamespace, true); if (reactSym) { - reactSym.isReferenced = true; + reactSym.isReferenced = 67108863; if (reactSym.flags & 2097152 && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { markAliasSymbolAsReferenced(reactSym); } } if (isNodeOpeningLikeElement) { - checkJsxAttributesAssignableToTagNameAttributes(node); + checkJsxAttributesAssignableToTagNameAttributes(node, checkMode); } else { checkJsxChildren(node.parent); @@ -31462,14 +32139,12 @@ var ts; } return false; } - function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement, checkMode) { var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : getCustomJsxElementAttributesType(openingLikeElement, false); - var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { - return isUnhyphenatedJsxName(attribute.escapedName) || !!(getPropertyOfType(targetAttributesType, attribute.escapedName)); - }); - if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode); + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName())); } else { @@ -31477,8 +32152,13 @@ var ts; if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) { for (var _i = 0, _a = openingLikeElement.attributes.properties; _i < _a.length; _i++) { var attribute = _a[_i]; - if (ts.isJsxAttribute(attribute) && !isKnownProperty(targetAttributesType, attribute.name.escapedText, true)) { - error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attribute.name), typeToString(targetAttributesType)); + if (!ts.isJsxAttribute(attribute)) { + continue; + } + var attrName = attribute.name; + var isNotIgnoredJsxProperty = (isUnhyphenatedJsxName(ts.idText(attrName)) || !!(getPropertyOfType(targetAttributesType, attrName.escapedText))); + if (isNotIgnoredJsxProperty && !isKnownProperty(targetAttributesType, attrName.escapedText, true)) { + error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attrName), typeToString(targetAttributesType)); break; } } @@ -31498,7 +32178,7 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 150; + return s.valueDeclaration ? s.valueDeclaration.kind : 151; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; @@ -31508,7 +32188,7 @@ var ts; } function checkPropertyAccessibility(node, left, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 180 || node.kind === 227 ? + var errorNode = node.kind === 183 || node.kind === 230 ? node.name : node.right; if (ts.getCheckFlags(prop) & 256) { @@ -31571,19 +32251,19 @@ var ts; function symbolHasNonMethodDeclaration(symbol) { return forEachProperty(symbol, function (prop) { var propKind = getDeclarationKindFromSymbol(prop); - return propKind !== 152 && propKind !== 151; + return propKind !== 153 && propKind !== 152; }); } - function checkNonNullExpression(node) { - return checkNonNullType(checkExpression(node), node); + function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { + return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic); } - function checkNonNullType(type, errorNode) { + function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 12288; if (kind) { - error(errorNode, kind & 4096 ? kind & 8192 ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); + error(node, kind & 4096 ? kind & 8192 ? + (nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) : + (undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) : + (nullDiagnostic || ts.Diagnostics.Object_is_possibly_null)); var t = getNonNullableType(type); return t.flags & (12288 | 16384) ? unknownType : t; } @@ -31597,15 +32277,20 @@ var ts; } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var propType; - var leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - var leftWasReferenced = leftSymbol && getSymbolLinks(leftSymbol).referenced; var leftType = checkNonNullExpression(left); + var parentSymbol = getNodeLinks(left).resolvedSymbol; var apparentType = getApparentType(getWidenedType(leftType)); if (isTypeAny(apparentType) || apparentType === silentNeverType) { + if (ts.isIdentifier(left) && parentSymbol) { + markAliasReferenced(parentSymbol, node); + } return apparentType; } var assignmentKind = ts.getAssignmentTargetKind(node); var prop = getPropertyOfType(apparentType, right.escapedText); + if (ts.isIdentifier(left) && parentSymbol && !(prop && isConstEnumOrConstEnumOnlyModule(prop))) { + markAliasReferenced(parentSymbol, node); + } if (!prop) { var indexInfo = getIndexInfoOfType(apparentType, 0); if (!(indexInfo && indexInfo.type)) { @@ -31622,11 +32307,6 @@ var ts; else { checkPropertyNotUsedBeforeDeclaration(prop, node, right); markPropertyAsReferenced(prop, node, left.kind === 99); - leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - if (leftSymbol && !leftWasReferenced && getSymbolLinks(leftSymbol).referenced && - !(isNonLocalAlias(leftSymbol, 107455) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(prop))) { - getSymbolLinks(leftSymbol).referenced = undefined; - } getNodeLinks(node).resolvedSymbol = prop; checkPropertyAccessibility(node, left, apparentType, prop); if (assignmentKind) { @@ -31635,9 +32315,9 @@ var ts; return unknownType; } } - propType = getDeclaredOrApparentType(prop, node); + propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); } - if (node.kind !== 180 || + if (node.kind !== 183 || assignmentKind === 1 || prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 131072)) { return propType; @@ -31647,7 +32327,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 153 && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 154 && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -31669,8 +32349,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right)); } - else if (valueDeclaration.kind === 230 && - node.parent.kind !== 160 && + else if (valueDeclaration.kind === 233 && + node.parent.kind !== 161 && !(valueDeclaration.flags & 2097152) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right)); @@ -31679,9 +32359,9 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 150: + case 151: return true; - case 265: + case 268: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -31689,6 +32369,9 @@ var ts; }); } function isPropertyDeclaredInAncestorClass(prop) { + if (!(prop.parent.flags & 32)) { + return false; + } var classType = getTypeOfSymbol(prop.parent); while (true) { classType = getSuperClass(classType); @@ -31735,7 +32418,7 @@ var ts; } function getSuggestionForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, undefined, outerName, false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, undefined, outerName, false, false, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); return symbol || getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), ts.arrayFrom(symbols.values()), meaning); @@ -31817,52 +32500,48 @@ var ts; return res > max ? undefined : res; } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (prop && - noUnusedIdentifiers && - (prop.flags & 106500) && - prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8) - && !(nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly))) { - if (isThisAccess) { - var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); - if (containingMethod && containingMethod.symbol === prop) { - return; - } - } - if (ts.getCheckFlags(prop) & 1) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; + if (!prop || !noUnusedIdentifiers || !(prop.flags & 106500) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8)) { + return; + } + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 && !(prop.flags & 32768))) { + return; + } + if (isThisAccess) { + var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); + if (containingMethod && containingMethod.symbol === prop) { + return; } } + (ts.getCheckFlags(prop) & 1 ? getSymbolLinks(prop).target : prop).isReferenced = 67108863; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 180 - ? node.expression - : node.left; + var left = node.kind === 183 ? node.expression : node.left; return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left))); } + function isValidPropertyAccessForCompletions(node, type, property) { + return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) + && (!(property.flags & 8192) || isValidMethodAccess(property, type)); + } + function isValidMethodAccess(method, type) { + var propType = getTypeOfFuncClassEnumModule(method); + var signatures = getSignaturesOfType(getNonNullableType(propType), 0); + ts.Debug.assert(signatures.length !== 0); + return signatures.some(function (sig) { + var thisType = getThisTypeOfSignature(sig); + return !thisType || isTypeAssignableTo(type, thisType); + }); + } function isValidPropertyAccessWithType(node, left, propertyName, type) { - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(type, propertyName); - if (prop) { - return checkPropertyAccessibility(node, left, type, prop); - } - if (ts.isInJavaScriptFile(left) && (type.flags & 131072)) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var elementType = _a[_i]; - if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) { - return true; - } - } - } - return false; + if (type === unknownType || isTypeAny(type)) { + return true; } - return true; + var prop = getPropertyOfType(type, propertyName); + return prop ? checkPropertyAccessibility(node, left, type, prop) + : ts.isInJavaScriptFile(node) && (type.flags & 131072) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); }); } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 228) { + if (initializer.kind === 231) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -31884,7 +32563,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 216 && + if (node.kind === 219 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -31902,7 +32581,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 183 && node.parent.expression === node) { + if (node.parent.kind === 186 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -31961,10 +32640,10 @@ var ts; if (callLikeExpressionMayHaveTypeArguments(node)) { ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 184) { + if (node.kind === 187) { checkExpression(node.template); } - else if (node.kind !== 148) { + else if (node.kind !== 149) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -32015,7 +32694,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 199) { + if (arg && arg.kind === 202) { return i; } } @@ -32030,35 +32709,32 @@ var ts; if (ts.isJsxOpeningLikeElement(node)) { return true; } - if (node.kind === 184) { - var tagExpression = node; + if (node.kind === 187) { argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 197) { - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + if (node.template.kind === 200) { + var lastSpan = ts.lastOrUndefined(node.template.templateSpans); ts.Debug.assert(lastSpan !== undefined); callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { - var templateLiteral = tagExpression.template; + var templateLiteral = node.template; ts.Debug.assert(templateLiteral.kind === 13); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 148) { + else if (node.kind === 149) { typeArguments = undefined; argCount = getEffectiveArgumentCount(node, undefined, signature); } else { - var callExpression = node; - if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 183); + if (!node.arguments) { + ts.Debug.assert(node.kind === 186); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; + callIsIncomplete = node.arguments.end === node.end; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } var numTypeParameters = ts.length(signature.typeParameters); @@ -32094,10 +32770,19 @@ var ts; inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); if (!contextualMapper) { - inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8); + inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 4); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJavaScriptFile(contextualSignature.declaration)); } + function inferJsxTypeArguments(signature, node, context) { + var skipContextParamType = getTypeAtPosition(signature, 0); + var checkAttrTypeSkipContextSensitive = checkExpressionWithContextualType(node.attributes, skipContextParamType, identityMapper); + inferTypes(context.inferences, checkAttrTypeSkipContextSensitive, skipContextParamType); + var paramType = getTypeAtPosition(signature, 0); + var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context); + inferTypes(context.inferences, checkAttrType, paramType); + return getInferredTypes(context); + } function inferTypeArguments(node, signature, args, excludeArgument, context) { for (var _i = 0, _a = context.inferences; _i < _a.length; _i++) { var inference = _a[_i]; @@ -32105,7 +32790,7 @@ var ts; inference.inferredType = undefined; } } - if (node.kind !== 148) { + if (node.kind !== 149) { var contextualType = getContextualType(node); if (contextualType) { var instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node))); @@ -32114,7 +32799,7 @@ var ts; getOrCreateTypeFromSignature(getSignatureInstantiation(contextualSignature, contextualSignature.typeParameters, ts.isInJavaScriptFile(node))) : instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 4); } } var thisType = getThisTypeOfSignature(signature); @@ -32126,7 +32811,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 201) { + if (arg === undefined || arg.kind !== 204) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { @@ -32157,7 +32842,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (!constraint) continue; - var errorInfo = reportErrors && headMessage && ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + var errorInfo = reportErrors && headMessage && (function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }); var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1; if (!mapper) { mapper = createTypeMapper(typeParameters, typeArgumentTypes); @@ -32191,7 +32876,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 183) { + if (thisType && thisType !== voidType && node.kind !== 186) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; var errorNode = reportErrors ? (thisArgumentNode || node) : undefined; @@ -32204,7 +32889,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 201) { + if (arg === undefined || arg.kind !== 204) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i) || checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); @@ -32218,28 +32903,28 @@ var ts; return true; } function getThisArgumentOfCall(node) { - if (node.kind === 182) { + if (node.kind === 185) { var callee = node.expression; - if (callee.kind === 180) { + if (callee.kind === 183) { return callee.expression; } - else if (callee.kind === 181) { + else if (callee.kind === 184) { return callee.expression; } } } function getEffectiveCallArguments(node) { - if (node.kind === 184) { + if (node.kind === 187) { var template = node.template; var args_4 = [undefined]; - if (template.kind === 197) { + if (template.kind === 200) { ts.forEach(template.templateSpans, function (span) { args_4.push(span.expression); }); } return args_4; } - else if (node.kind === 148) { + else if (node.kind === 149) { return undefined; } else if (ts.isJsxOpeningLikeElement(node)) { @@ -32250,21 +32935,21 @@ var ts; } } function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 148) { + if (node.kind === 149) { switch (node.parent.kind) { - case 230: - case 200: + case 233: + case 203: return 1; - case 150: + case 151: return 2; - case 152: - case 154: + case 153: case 155: + case 156: if (languageVersion === 0) { return 2; } return signature.parameters.length >= 3 ? 3 : 2; - case 147: + case 148: return 3; } } @@ -32273,41 +32958,41 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 230) { + if (node.kind === 233) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 147) { + if (node.kind === 148) { node = node.parent; - if (node.kind === 153) { + if (node.kind === 154) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 150 || - node.kind === 152 || - node.kind === 154 || - node.kind === 155) { + if (node.kind === 151 || + node.kind === 153 || + node.kind === 155 || + node.kind === 156) { return getParentTypeOfClassElement(node); } ts.Debug.fail("Unsupported decorator target."); return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 230) { + if (node.kind === 233) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 147) { + if (node.kind === 148) { node = node.parent; - if (node.kind === 153) { + if (node.kind === 154) { return anyType; } } - if (node.kind === 150 || - node.kind === 152 || - node.kind === 154 || - node.kind === 155) { + if (node.kind === 151 || + node.kind === 153 || + node.kind === 155 || + node.kind === 156) { var element = node; switch (element.name.kind) { case 71: @@ -32315,7 +33000,7 @@ var ts; case 8: case 9: return getLiteralType(element.name.text); - case 145: + case 146: var nameType = checkComputedPropertyName(element.name); if (isTypeAssignableToKind(nameType, 1536)) { return nameType; @@ -32332,20 +33017,20 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 230) { + if (node.kind === 233) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 147) { + if (node.kind === 148) { return numberType; } - if (node.kind === 150) { + if (node.kind === 151) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 152 || - node.kind === 154 || - node.kind === 155) { + if (node.kind === 153 || + node.kind === 155 || + node.kind === 156) { var propertyType = getTypeOfNode(node); return createTypedPropertyDescriptorType(propertyType); } @@ -32366,26 +33051,26 @@ var ts; return unknownType; } function getEffectiveArgumentType(node, argIndex) { - if (node.kind === 148) { + if (node.kind === 149) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 184) { + else if (argIndex === 0 && node.kind === 187) { return getGlobalTemplateStringsArrayType(); } return undefined; } function getEffectiveArgument(node, args, argIndex) { - if (node.kind === 148 || - (argIndex === 0 && node.kind === 184)) { + if (node.kind === 149 || + (argIndex === 0 && node.kind === 187)) { return undefined; } return args[argIndex]; } function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 148) { + if (node.kind === 149) { return node.expression; } - else if (argIndex === 0 && node.kind === 184) { + else if (argIndex === 0 && node.kind === 187) { return node.template; } else { @@ -32393,8 +33078,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, fallbackError) { - var isTaggedTemplate = node.kind === 184; - var isDecorator = node.kind === 148; + var isTaggedTemplate = node.kind === 187; + var isDecorator = node.kind === 149; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { @@ -32427,7 +33112,7 @@ var ts; var candidateForArgumentError; var candidateForTypeArgumentError; var result; - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 182 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 185 && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } @@ -32455,7 +33140,7 @@ var ts; max = Math.max(max, ts.length(sig.typeParameters)); } var paramCount = min < max ? min + "-" + max : min; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); + diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); } else if (args) { var min = Number.POSITIVE_INFINITY; @@ -32557,7 +33242,7 @@ var ts; } excludeCount--; if (excludeCount > 0) { - excludeArgument[ts.indexOf(excludeArgument, true)] = false; + excludeArgument[excludeArgument.indexOf(true)] = false; } else { excludeArgument = undefined; @@ -32594,7 +33279,7 @@ var ts; } return resolveUntypedCall(node); } - var funcType = checkNonNullExpression(node.expression); + var funcType = checkNonNullExpression(node.expression, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined); if (funcType === silentNeverType) { return silentNeverSignature; } @@ -32615,7 +33300,7 @@ var ts; error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); } else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0); } return resolveErrorCall(node); } @@ -32669,7 +33354,7 @@ var ts; } return signature; } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + invocationError(node, expressionType, 1); return resolveErrorCall(node); } function isConstructorAccessible(node, signature) { @@ -32707,6 +33392,24 @@ var ts; } return true; } + function invocationError(node, apparentType, kind) { + error(node, kind === 0 + ? ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures + : ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature, typeToString(apparentType)); + invocationErrorRecovery(apparentType, kind); + } + function invocationErrorRecovery(apparentType, kind) { + if (!apparentType.symbol) { + return; + } + var importNode = getSymbolLinks(apparentType.symbol).originatingImport; + if (importNode && !ts.isImportCall(importNode)) { + var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); + if (!sigs || !sigs.length) + return; + error(importNode, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime); + } + } function resolveTaggedTemplateExpression(node, candidatesOutArray) { var tagType = checkExpression(node.tag); var apparentType = getApparentType(tagType); @@ -32719,23 +33422,23 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray); } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 230: - case 200: + case 233: + case 203: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 147: + case 148: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 150: + case 151: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 152: - case 154: + case 153: case 155: + case 156: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -32761,6 +33464,7 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); errorInfo = ts.chainDiagnosticMessages(errorInfo, headMessage); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, errorInfo)); + invocationErrorRecovery(apparentType, 0); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); @@ -32780,8 +33484,8 @@ var ts; if (elementType.flags & 131072) { var types = elementType.types; var result = void 0; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var type = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var type = types_16[_i]; result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); } return result; @@ -32794,16 +33498,16 @@ var ts; } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 182: + case 185: return resolveCallExpression(node, candidatesOutArray); - case 183: + case 186: return resolveNewExpression(node, candidatesOutArray); - case 184: + case 187: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 148: + case 149: return resolveDecorator(node, candidatesOutArray); - case 252: - case 251: + case 255: + case 254: return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -32863,12 +33567,12 @@ var ts; if (node.expression.kind === 97) { return voidType; } - if (node.kind === 183) { + if (node.kind === 186) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 153 && - declaration.kind !== 157 && - declaration.kind !== 162 && + declaration.kind !== 154 && + declaration.kind !== 158 && + declaration.kind !== 163 && !ts.isJSDocConstructSignature(declaration)) { var funcSymbol = checkExpression(node.expression).symbol; if (!funcSymbol && node.expression.kind === 71) { @@ -32927,16 +33631,18 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol)); } } return createPromiseReturnType(node, anyType); } - function getTypeWithSyntheticDefaultImportType(type, symbol) { + function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) { if (allowSyntheticDefaultImports && type && type !== unknownType) { var synthType = type; if (!synthType.syntheticType) { - if (!getPropertyOfType(type, "default")) { + var file = ts.find(originalSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false); + if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152, "default"); newSymbol.target = resolveSymbol(symbol); @@ -32944,7 +33650,7 @@ var ts; var anonymousSymbol = createSymbol(2048, "__type"); var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, undefined, undefined); anonymousSymbol.type = defaultContainingObject; - synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, 0) : defaultContainingObject; } else { synthType.syntheticType = type; @@ -32968,9 +33674,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 229 + ? 232 : resolvedRequire.flags & 3 - ? 227 + ? 230 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -33009,7 +33715,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return unknownType; } - else if (container.kind === 153) { + else if (container.kind === 154) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -33022,7 +33728,7 @@ var ts; var type = getTypeOfSymbol(symbol); if (strictNullChecks) { var declaration = symbol.valueDeclaration; - if (declaration && declaration.initializer) { + if (declaration && ts.hasInitializer(declaration)) { return getOptionalType(type); } } @@ -33125,22 +33831,21 @@ var ts; return promiseType; } function getReturnTypeFromBody(func, checkMode) { - var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 208) { + if (func.body.kind !== 211) { type = checkExpressionCached(func.body, checkMode); if (functionFlags & 2) { type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { - var types = void 0; + var types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (functionFlags & 1) { - types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); if (!types || types.length === 0) { var iterableIteratorAny = functionFlags & 2 ? createAsyncIterableIteratorType(anyType) @@ -33152,7 +33857,6 @@ var ts; } } else { - types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { return functionFlags & 2 ? createPromiseReturnType(func, neverType) @@ -33164,8 +33868,9 @@ var ts; : voidType; } } - type = getUnionType(types, true); + type = getUnionType(types, 2); } + var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!contextualSignature) { reportErrorsFromWidening(func, type); } @@ -33238,7 +33943,7 @@ var ts; if (!(func.flags & 128)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 222 && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 225 && isExhaustiveSwitchStatement(statement); })) { return false; } return true; @@ -33264,8 +33969,7 @@ var ts; hasReturnWithNoExpression = true; } }); - if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 187 || func.kind === 188)) { + if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -33273,6 +33977,17 @@ var ts; } return aggregatedTypes; } + function mayReturnNever(func) { + switch (func.kind) { + case 190: + case 191: + return true; + case 153: + return func.parent.kind === 182; + default: + return false; + } + } function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { if (!produceDiagnostics) { return; @@ -33280,7 +33995,7 @@ var ts; if (returnType && maybeTypeOfKind(returnType, 1 | 2048)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 208 || !functionHasImplicitReturn(func)) { + if (func.kind === 152 || ts.nodeIsMissing(func.body) || func.body.kind !== 211 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256; @@ -33307,13 +34022,13 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 187) { + if (!hasGrammarError && node.kind === 190) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -33344,7 +34059,7 @@ var ts; checkNodeDeferred(node); } } - if (produceDiagnostics && node.kind !== 152) { + if (produceDiagnostics && node.kind !== 153) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithCapturedNewTargetVariable(node, node.name); @@ -33352,7 +34067,7 @@ var ts; return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); var returnOrPromisedType = returnTypeNode && @@ -33366,7 +34081,7 @@ var ts; if (!returnTypeNode) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 208) { + if (node.body.kind === 211) { checkSourceElement(node.body); } else { @@ -33401,10 +34116,10 @@ var ts; function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 && - (expr.kind === 180 || expr.kind === 181) && + (expr.kind === 183 || expr.kind === 184) && expr.expression.kind === 99) { var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 153)) { + if (!(func && func.kind === 154)) { return true; } return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent); @@ -33414,13 +34129,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 180 || expr.kind === 181) { + if (expr.kind === 183 || expr.kind === 184) { var node = ts.skipParentheses(expr.expression); if (node.kind === 71) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 241; + return declaration && declaration.kind === 244; } } } @@ -33428,7 +34143,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage) { var node = ts.skipOuterExpressions(expr, 2 | 1); - if (node.kind !== 71 && node.kind !== 180 && node.kind !== 181) { + if (node.kind !== 71 && node.kind !== 183 && node.kind !== 184) { error(expr, invalidReferenceMessage); return false; } @@ -33437,7 +34152,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 180 && expr.kind !== 181) { + if (expr.kind !== 183 && expr.kind !== 184) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -33517,13 +34232,13 @@ var ts; return numberType; } function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { + if (type.flags & kind || kind & 536870912 && isGenericMappedType(type)) { return true; } if (type.flags & 393216) { var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var t = types_17[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -33546,7 +34261,7 @@ var ts; (kind & 8192 && isTypeAssignableTo(source, nullType)) || (kind & 4096 && isTypeAssignableTo(source, undefinedType)) || (kind & 512 && isTypeAssignableTo(source, esSymbolType)) || - (kind & 33554432 && isTypeAssignableTo(source, nonPrimitiveType)); + (kind & 134217728 && isTypeAssignableTo(source, nonPrimitiveType)); } function allTypesAssignableToKind(source, kind, strict) { return source.flags & 131072 ? @@ -33581,13 +34296,16 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 | 1536))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 33554432 | 1081344)) { + if (!isTypeAssignableToKind(rightType, 134217728 | 7372800)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; + if (strictNullChecks && properties.length === 0) { + return checkNonNullType(sourceType, node); + } for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); @@ -33595,9 +34313,9 @@ var ts; return sourceType; } function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 265 || property.kind === 266) { + if (property.kind === 268 || property.kind === 269) { var name = property.name; - if (name.kind === 145) { + if (name.kind === 146) { checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { @@ -33610,7 +34328,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1) || getIndexTypeOfType(objectLiteralType, 0); if (type) { - if (property.kind === 266) { + if (property.kind === 269) { return checkDestructuringAssignment(property, type); } else { @@ -33621,7 +34339,7 @@ var ts; error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 267) { + else if (property.kind === 270) { if (languageVersion < 6) { checkExternalEmitHelpers(property, 4); } @@ -33652,8 +34370,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 201) { - if (element.kind !== 199) { + if (element.kind !== 204) { + if (element.kind !== 202) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -33679,7 +34397,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 195 && restExpression.operatorToken.kind === 58) { + if (restExpression.kind === 198 && restExpression.operatorToken.kind === 58) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -33692,7 +34410,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 266) { + if (exprOrAssignment.kind === 269) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && @@ -33706,21 +34424,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 195 && target.operatorToken.kind === 58) { + if (target.kind === 198 && target.operatorToken.kind === 58) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 179) { + if (target.kind === 182) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 178) { + if (target.kind === 181) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 267 ? + var error = target.parent.kind === 270 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -33734,35 +34452,35 @@ var ts; case 71: case 9: case 12: - case 184: - case 197: + case 187: + case 200: case 13: case 8: case 101: case 86: case 95: - case 139: - case 187: - case 200: - case 188: - case 178: - case 179: + case 140: case 190: - case 204: - case 251: - case 250: + case 203: + case 191: + case 181: + case 182: + case 193: + case 207: + case 254: + case 253: return true; - case 196: + case 199: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 195: + case 198: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 193: - case 194: + case 196: + case 197: switch (node.operator) { case 51: case 37: @@ -33771,9 +34489,9 @@ var ts; return true; } return false; - case 191: - case 185: - case 203: + case 194: + case 188: + case 206: default: return false; } @@ -33786,7 +34504,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 58 && (left.kind === 179 || left.kind === 178)) { + if (operator === 58 && (left.kind === 182 || left.kind === 181)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } var leftType = checkExpression(left, checkMode); @@ -33899,7 +34617,7 @@ var ts; leftType; case 54: return getTypeFacts(leftType) & 2097152 ? - getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], true) : + getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2) : leftType; case 58: checkAssignmentOperator(rightType); @@ -34015,7 +34733,7 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, checkMode); var type2 = checkExpression(node.whenFalse, checkMode); - return getUnionType([type1, type2], true); + return getUnionType([type1, type2], 2); } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { @@ -34023,21 +34741,31 @@ var ts; }); return stringType; } + function getContextNode(node) { + if (node.kind === 261) { + return node.parent.parent; + } + return node; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - var saveContextualMapper = node.contextualMapper; - node.contextualType = contextualType; - node.contextualMapper = contextualMapper; + var context = getContextNode(node); + var saveContextualType = context.contextualType; + var saveContextualMapper = context.contextualMapper; + context.contextualType = contextualType; + context.contextualMapper = contextualMapper; var checkMode = contextualMapper === identityMapper ? 1 : - contextualMapper ? 2 : 0; + contextualMapper ? 2 : 3; var result = checkExpression(node, checkMode); - node.contextualType = saveContextualType; - node.contextualMapper = saveContextualMapper; + context.contextualType = saveContextualType; + context.contextualMapper = saveContextualMapper; return result; } function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { + if (checkMode) { + return checkExpression(node, checkMode); + } var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; links.resolvedType = checkExpression(node, checkMode); @@ -34047,7 +34775,7 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 185 || node.kind === 203; + return node.kind === 188 || node.kind === 206; } function checkDeclarationInitializer(declaration) { var type = getTypeOfExpression(declaration.initializer, true); @@ -34057,14 +34785,11 @@ var ts; } function isLiteralOfContextualType(candidateType, contextualType) { if (contextualType) { - if (contextualType.flags & 131072 && !(contextualType.flags & 8)) { - var types_19 = contextualType.types; - return ts.some(types_19, function (t) { - return !(t.flags & 128 && containsType(types_19, trueType) && containsType(types_19, falseType)) && - isLiteralOfContextualType(candidateType, t); - }); + if (contextualType.flags & 393216) { + var types = contextualType.types; + return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 1081344) { + if (contextualType.flags & 7372800) { var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; return constraint.flags & 2 && maybeTypeOfKind(candidateType, 32) || constraint.flags & 4 && maybeTypeOfKind(candidateType, 64) || @@ -34088,14 +34813,14 @@ var ts; getWidenedLiteralLikeTypeForContextualType(type, contextualType); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -34117,7 +34842,7 @@ var ts; return type; } function getTypeOfExpression(node, cache) { - if (node.kind === 182 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) { + if (node.kind === 185 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -34135,7 +34860,7 @@ var ts; } function checkExpression(node, checkMode) { var type; - if (node.kind === 144) { + if (node.kind === 145) { type = checkQualifiedName(node); } else { @@ -34143,11 +34868,12 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 180 && node.parent.expression === node) || - (node.parent.kind === 181 && node.parent.expression === node) || - ((node.kind === 71 || node.kind === 144) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 183 && node.parent.expression === node) || + (node.parent.kind === 184 && node.parent.expression === node) || + ((node.kind === 71 || node.kind === 145) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 164 && node.parent.exprName === node)); if (!ok) { - error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } } return type; @@ -34179,73 +34905,73 @@ var ts; return trueType; case 86: return falseType; - case 197: + case 200: return checkTemplateExpression(node); case 12: return globalRegExpType; - case 178: - return checkArrayLiteral(node, checkMode); - case 179: - return checkObjectLiteral(node, checkMode); - case 180: - return checkPropertyAccessExpression(node); case 181: - return checkIndexedAccess(node); + return checkArrayLiteral(node, checkMode); case 182: + return checkObjectLiteral(node, checkMode); + case 183: + return checkPropertyAccessExpression(node); + case 184: + return checkIndexedAccess(node); + case 185: if (node.expression.kind === 91) { return checkImportCallExpression(node); } - case 183: - return checkCallExpression(node); - case 184: - return checkTaggedTemplateExpression(node); case 186: - return checkParenthesizedExpression(node, checkMode); - case 200: - return checkClassExpression(node); + return checkCallExpression(node); case 187: - case 188: - return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 190: - return checkTypeOfExpression(node); - case 185: - case 203: - return checkAssertion(node); - case 204: - return checkNonNullAssertion(node); - case 205: - return checkMetaProperty(node); + return checkTaggedTemplateExpression(node); case 189: - return checkDeleteExpression(node); + return checkParenthesizedExpression(node, checkMode); + case 203: + return checkClassExpression(node); + case 190: case 191: - return checkVoidExpression(node); - case 192: - return checkAwaitExpression(node); + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); case 193: - return checkPrefixUnaryExpression(node); + return checkTypeOfExpression(node); + case 188: + case 206: + return checkAssertion(node); + case 207: + return checkNonNullAssertion(node); + case 208: + return checkMetaProperty(node); + case 192: + return checkDeleteExpression(node); case 194: - return checkPostfixUnaryExpression(node); + return checkVoidExpression(node); case 195: - return checkBinaryExpression(node, checkMode); + return checkAwaitExpression(node); case 196: - return checkConditionalExpression(node, checkMode); - case 199: - return checkSpreadExpression(node, checkMode); - case 201: - return undefinedWideningType; + return checkPrefixUnaryExpression(node); + case 197: + return checkPostfixUnaryExpression(node); case 198: + return checkBinaryExpression(node, checkMode); + case 199: + return checkConditionalExpression(node, checkMode); + case 202: + return checkSpreadExpression(node, checkMode); + case 204: + return undefinedWideningType; + case 201: return checkYieldExpression(node); - case 260: + case 263: return checkJsxExpression(node, checkMode); - case 250: - return checkJsxElement(node); - case 251: - return checkJsxSelfClosingElement(node); + case 253: + return checkJsxElement(node, checkMode); case 254: - return checkJsxFragment(node); - case 258: + return checkJsxSelfClosingElement(node, checkMode); + case 257: + return checkJsxFragment(node, checkMode); + case 261: return checkJsxAttributes(node, checkMode); - case 252: + case 255: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -34277,7 +35003,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92)) { - if (!(func.kind === 153 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 154 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -34285,10 +35011,10 @@ var ts; error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && ts.isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { - if (ts.indexOf(func.parameters, node) !== 0) { + if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 153 || func.kind === 157 || func.kind === 162) { + if (func.kind === 154 || func.kind === 158 || func.kind === 163) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -34313,7 +35039,7 @@ var ts; error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); return; } - var typePredicate = getSignatureFromDeclaration(parent).typePredicate; + var typePredicate = getTypePredicateOfSignature(getSignatureFromDeclaration(parent)); if (!typePredicate) { return; } @@ -34328,7 +35054,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); }; checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, undefined, leadingError); } } @@ -34350,13 +35076,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 188: - case 156: - case 229: - case 187: - case 161: + case 191: + case 157: + case 232: + case 190: + case 162: + case 153: case 152: - case 151: var parent = node.parent; if (node === parent.type) { return parent; @@ -34374,7 +35100,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 176 || name.kind === 175) { + else if (name.kind === 179 || name.kind === 178) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -34382,12 +35108,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 158) { + if (node.kind === 159) { checkGrammarIndexSignature(node); } - else if (node.kind === 161 || node.kind === 229 || node.kind === 162 || - node.kind === 156 || node.kind === 153 || - node.kind === 157) { + else if (node.kind === 162 || node.kind === 232 || node.kind === 163 || + node.kind === 157 || node.kind === 154 || + node.kind === 158) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -34412,10 +35138,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 157: + case 158: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 156: + case 157: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -34449,7 +35175,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153) { + if (member.kind === 154) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -34463,16 +35189,16 @@ var ts; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 154: + case 155: addName(names, member.name, memberName, 1); break; - case 155: + case 156: addName(names, member.name, memberName, 2); break; - case 150: + case 151: addName(names, member.name, memberName, 3); break; - case 152: + case 153: addName(names, member.name, memberName, 4); break; } @@ -34524,7 +35250,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149) { + if (member.kind === 150) { var memberName = void 0; switch (member.name.kind) { case 9: @@ -34548,7 +35274,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 231) { + if (node.kind === 234) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -34563,7 +35289,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 136: + case 137: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -34571,7 +35297,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 133: + case 134: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -34593,7 +35319,7 @@ var ts; if (!checkGrammarMethod(node)) checkGrammarComputedPropertyName(node.name); checkFunctionOrMethodDeclaration(node); - if (ts.hasModifier(node, 128) && node.body) { + if (ts.hasModifier(node, 128) && node.kind === 153 && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -34614,24 +35340,8 @@ var ts; if (!produceDiagnostics) { return; } - function containsSuperCallAsComputedPropertyName(n) { - var name = ts.getNameOfDeclaration(n); - return name && containsSuperCall(name); - } - function containsSuperCall(n) { - if (ts.isSuperCall(n)) { - return true; - } - else if (ts.isFunctionLike(n)) { - return false; - } - else if (ts.isClassLike(n)) { - return ts.forEach(n.members, containsSuperCallAsComputedPropertyName); - } - return ts.forEachChild(n, containsSuperCall); - } function isInstancePropertyWithInitializer(n) { - return n.kind === 150 && + return n.kind === 151 && !ts.hasModifier(n, 32) && !!n.initializer; } @@ -34651,7 +35361,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 211 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -34675,18 +35385,18 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 154) { + if (node.kind === 155) { if (!(node.flags & 2097152) && ts.nodeIsPresent(node.body) && (node.flags & 128)) { if (!(node.flags & 256)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { - var otherKind = node.kind === 154 ? 155 : 154; + var otherKind = node.kind === 155 ? 156 : 155; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -34702,7 +35412,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 154) { + if (node.kind === 155) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -34719,8 +35429,10 @@ var ts; function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { - var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJavaScriptFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { var typeArguments; var mapper; var result = true; @@ -34728,18 +35440,28 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, ts.isInJavaScriptFile(typeArgumentNodes[i])); + typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(typeArgument, instantiateType(constraint, mapper), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; } + function getTypeParametersForTypeReference(node) { + var type = getTypeFromTypeReference(node); + if (type !== unknownType) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters || + (ts.getObjectFlags(type) & 4 ? type.target.localTypeParameters : undefined); + } + } + return undefined; + } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 160 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 161 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); @@ -34747,18 +35469,10 @@ var ts; if (node.typeArguments) { ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (!symbol) { - if (!ts.isJSDocIndexSignature(node)) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - } - return; + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); } - var typeParameters = symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters; - if (!typeParameters && ts.getObjectFlags(type) & 4) { - typeParameters = type.target.localTypeParameters; - } - checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } if (type.flags & 16 && getNodeLinks(node).resolvedSymbol.flags & 8) { @@ -34766,6 +35480,14 @@ var ts; } } } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType); + if (!typeReferenceNode) + return undefined; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } function checkTypeQuery(node) { getTypeFromTypeQueryNode(node); } @@ -34798,8 +35520,8 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { - if (accessNode.kind === 181 && ts.isAssignmentTarget(accessNode) && - ts.getObjectFlags(objectType) & 32 && objectType.declaration.readonlyToken) { + if (accessNode.kind === 184 && ts.isAssignmentTarget(accessNode) && + ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -34818,6 +35540,9 @@ var ts; function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); + if (noImplicitAny && !node.type) { + reportImplicitAnyError(node, anyType); + } var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); @@ -34826,14 +35551,23 @@ var ts; checkGrammarTypeOperatorNode(node); checkSourceElement(node.type); } + function checkConditionalType(node) { + ts.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 && n.parent.extendsType === n; })) { + grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + } function isPrivateWithinAmbient(node) { return ts.hasModifier(node, 8) && !!(node.flags & 2097152); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 231 && - n.parent.kind !== 230 && - n.parent.kind !== 200 && + if (n.parent.kind !== 234 && + n.parent.kind !== 233 && + n.parent.kind !== 203 && n.flags & 2097152) { if (!(flags & 2)) { flags |= 1; @@ -34913,7 +35647,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 152 || node.kind === 151) && + var reportError = (node.kind === 153 || node.kind === 152) && ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32); if (reportError) { var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -34946,11 +35680,11 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 2097152; - var inAmbientContextOrInterface = node.parent.kind === 231 || node.parent.kind === 164 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 234 || node.parent.kind === 165 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 229 || node.kind === 152 || node.kind === 151 || node.kind === 153) { + if (node.kind === 232 || node.kind === 153 || node.kind === 152 || node.kind === 154) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -35062,31 +35796,33 @@ var ts; } function getDeclarationSpaces(d) { switch (d.kind) { - case 231: - case 232: - case 288: - return 2; case 234: + case 235: + case 291: + return 2; + case 237: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4 | 1 : 4; - case 230: case 233: + case 236: return 2 | 1; - case 238: + case 272: + return 2 | 1 | 4; case 241: - case 240: + case 244: + case 243: var result_2 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); }); return result_2; - case 227: - case 177: - case 229: - case 243: + case 230: + case 180: + case 232: + case 246: return 1; default: - ts.Debug.fail(ts.SyntaxKind[d.kind]); + ts.Debug.fail(ts.Debug.showSyntaxKind(d)); } } } @@ -35127,7 +35863,7 @@ var ts; } return undefined; } - return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2); } function checkAwaitedType(type, errorNode, diagnosticMessage) { return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; @@ -35153,7 +35889,7 @@ var ts; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { if (errorNode) { error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); } @@ -35238,28 +35974,28 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 230: + case 233: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 147: + case 148: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 150: + case 151: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 152: - case 154: + case 153: case 155: + case 156: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); break; } - checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo); + checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; }); } function markTypeNodeAsReferenced(node) { markEntityNameOrEntityExpressionAsReference(node && ts.getEntityNameFromTypeNode(node)); @@ -35286,18 +36022,18 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { + case 169: case 168: - case 167: var commonEntityName = void 0; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169) { + while (typeNode.kind === 172) { typeNode = typeNode.type; } - if (typeNode.kind === 130) { + if (typeNode.kind === 131) { continue; } - if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 139)) { + if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 140)) { continue; } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -35316,9 +36052,9 @@ var ts; } } return commonEntityName; - case 169: + case 172: return getEntityNameForDecoratorMetadata(node.type); - case 160: + case 161: return node.typeName; } } @@ -35339,13 +36075,13 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8); - if (node.kind === 147) { + if (node.kind === 148) { checkExternalEmitHelpers(firstDecorator, 32); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 230: + case 233: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -35354,19 +36090,19 @@ var ts; } } break; - case 152: - case 154: + case 153: case 155: + case 156: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 150: + case 151: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 147: + case 148: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -35397,7 +36133,7 @@ var ts; function checkJSDocParameterTag(node) { checkSourceElement(node.typeExpression); if (!ts.getParameterSymbolFromJSDoc(node)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 144 ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 ? node.name.right : node.name)); } } function checkJSDocAugmentsTag(node) { @@ -35406,7 +36142,7 @@ var ts; error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName)); return; } - var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 282); + var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 285); ts.Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); @@ -35424,7 +36160,7 @@ var ts; switch (node.kind) { case 71: return node; - case 180: + case 183: return node.name; default: return undefined; @@ -35434,7 +36170,7 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var functionFlags = ts.getFunctionFlags(node); - if (node.name && node.name.kind === 145) { + if (node.name && node.name.kind === 146) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { @@ -35450,7 +36186,8 @@ var ts; } } } - checkSourceElement(node.body); + var body = node.kind === 152 ? undefined : node.body; + checkSourceElement(body); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if ((functionFlags & 1) === 0) { var returnOrPromisedType = returnTypeNode && (functionFlags & 2 @@ -35459,10 +36196,10 @@ var ts; checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !returnTypeNode) { - if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & 1 && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 && ts.nodeIsPresent(body)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } } @@ -35478,43 +36215,43 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 269: - case 234: + case 272: + case 237: checkUnusedModuleMembers(node); break; - case 230: - case 200: + case 233: + case 203: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 231: + case 234: checkUnusedTypeParameters(node); break; - case 208: - case 236: - case 215: - case 216: - case 217: + case 211: + case 239: + case 218: + case 219: + case 220: checkUnusedLocalsAndParameters(node); break; - case 153: - case 187: - case 229: - case 188: - case 152: case 154: + case 190: + case 232: + case 191: + case 153: case 155: + case 156: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 151: - case 156: + case 152: case 157: - case 161: + case 158: case 162: - case 232: + case 163: + case 235: checkUnusedTypeParameters(node); break; default: @@ -35526,8 +36263,8 @@ var ts; function checkUnusedLocalsAndParameters(node) { if (noUnusedIdentifiers && !(node.flags & 2097152)) { node.locals.forEach(function (local) { - if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 147) { + if (local.flags & 262144 ? (local.flags & 3 && !(local.isReferenced & 3)) : !local.isReferenced) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 148) { var parameter = ts.getRootDeclaration(local.valueDeclaration); var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && @@ -35555,8 +36292,8 @@ var ts; var node = ts.getNameOfDeclaration(declaration) || declaration; if (isIdentifierThatStartsWithUnderScore(node)) { var declaration_2 = ts.getRootDeclaration(node.parent); - if ((declaration_2.kind === 227 && ts.isForInOrOfStatement(declaration_2.parent.parent)) || - declaration_2.kind === 146) { + if ((declaration_2.kind === 230 && ts.isForInOrOfStatement(declaration_2.parent.parent)) || + declaration_2.kind === 147) { return; } } @@ -35572,28 +36309,40 @@ var ts; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152)) { - if (node.members) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - if (member.kind === 152 || member.kind === 150) { - if (!member.symbol.isReferenced && ts.hasModifier(member, 8)) { - error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(member.symbol)); + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 153: + case 151: + case 155: + case 156: + if (member.kind === 156 && member.symbol.flags & 32768) { + break; } - } - else if (member.kind === 153) { + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8)) { + error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)); + } + break; + case 154: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol)); } } - } + break; + case 159: + case 210: + break; + default: + ts.Debug.fail(); } } } } function checkUnusedTypeParameters(node) { - if (compilerOptions.noUnusedLocals && !(node.flags & 2097152)) { + if (compilerOptions.noUnusedParameters && !(node.flags & 2097152)) { if (node.typeParameters) { var symbol = getSymbolOfNode(node); var lastDeclaration = symbol && symbol.declarations && ts.lastOrUndefined(symbol.declarations); @@ -35602,7 +36351,7 @@ var ts; } for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) { var typeParameter = _a[_i]; - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & 262144) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(typeParameter.symbol)); } } @@ -35624,7 +36373,7 @@ var ts; } } function checkBlock(node) { - if (node.kind === 208) { + if (node.kind === 211) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -35653,19 +36402,19 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 150 || - node.kind === 149 || + if (node.kind === 151 || + node.kind === 150 || + node.kind === 153 || node.kind === 152 || - node.kind === 151 || - node.kind === 154 || - node.kind === 155) { + node.kind === 155 || + node.kind === 156) { return false; } if (node.flags & 2097152) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 147 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 148 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -35737,7 +36486,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 269 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 272 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -35749,7 +36498,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 269 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) { + if (parent.kind === 272 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -35757,7 +36506,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 227 && !node.initializer) { + if (node.kind === 230 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -35769,15 +36518,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 228); - var container = varDeclList.parent.kind === 209 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 231); + var container = varDeclList.parent.kind === 212 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 208 && ts.isFunctionLike(container.parent) || - container.kind === 235 || - container.kind === 234 || - container.kind === 269); + (container.kind === 211 && ts.isFunctionLike(container.parent) || + container.kind === 238 || + container.kind === 237 || + container.kind === 272); if (!namesShareScope) { var name = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); @@ -35787,7 +36536,7 @@ var ts; } } function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 147) { + if (ts.getRootDeclaration(node).kind !== 148) { return; } var func = ts.getContainingFunction(node); @@ -35796,7 +36545,7 @@ var ts; if (ts.isTypeNode(n) || ts.isDeclarationName(n)) { return; } - if (n.kind === 180) { + if (n.kind === 183) { return visit(n.expression); } else if (n.kind === 71) { @@ -35810,8 +36559,8 @@ var ts; } var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 147 || - symbol.valueDeclaration.kind === 177) { + if (symbol.valueDeclaration.kind === 148 || + symbol.valueDeclaration.kind === 180) { if (symbol.valueDeclaration.pos < node.pos) { return; } @@ -35820,7 +36569,7 @@ var ts; return "quit"; } return ts.isFunctionLike(current.parent) || - (current.parent.kind === 150 && + (current.parent.kind === 151 && !(ts.hasModifier(current.parent, 32)) && ts.isClassLike(current.parent.parent)); })) { @@ -35840,53 +36589,63 @@ var ts; } function checkVariableLikeDeclaration(node) { checkDecorators(node); - checkSourceElement(node.type); + if (!ts.isBindingElement(node)) { + checkSourceElement(node.type); + } if (!node.name) { return; } - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 177) { - if (node.parent.kind === 175 && languageVersion < 6) { + if (node.kind === 180) { + if (node.parent.kind === 178 && languageVersion < 6) { checkExternalEmitHelpers(node, 4); } - if (node.propertyName && node.propertyName.kind === 145) { + if (node.propertyName && node.propertyName.kind === 146) { checkComputedPropertyName(node.propertyName); } var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); - markPropertyAsReferenced(property, undefined, false); - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (!ts.isBindingPattern(name)) { + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + markPropertyAsReferenced(property, undefined, false); + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 176 && languageVersion < 2 && compilerOptions.downlevelIteration) { + if (node.name.kind === 179 && languageVersion < 2 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512); } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 147 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 148 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - if (node.initializer && node.parent.parent.kind !== 216) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); + if (node.initializer && node.parent.parent.kind !== 219) { + var initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && node.name.elements.length === 0) { + checkNonNullType(initializerType, node); + } + else { + checkTypeAssignableTo(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, undefined); + } checkParameterInitializer(node); } return; } var symbol = getSymbolOfNode(node); - var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); + var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { - if (node.initializer && node.parent.parent.kind !== 216) { + if (node.initializer && node.parent.parent.kind !== 219) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } @@ -35906,9 +36665,9 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 150 && node.kind !== 149) { + if (node.kind !== 151 && node.kind !== 150) { checkExportsOnMergedDeclarations(node); - if (node.kind === 227 || node.kind === 177) { + if (node.kind === 230 || node.kind === 180) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -35920,14 +36679,14 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 150 || nextDeclaration.kind === 149 + var message = nextDeclaration.kind === 151 || nextDeclaration.kind === 150 ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 147 && right.kind === 227) || - (left.kind === 227 && right.kind === 147)) { + if ((left.kind === 148 && right.kind === 230) || + (left.kind === 230 && right.kind === 148)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -35954,18 +36713,6 @@ var ts; checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 179) { - if (ts.getFunctionFlags(node) & 2) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } function checkExpressionStatement(node) { checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); @@ -35974,7 +36721,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 210) { + if (node.thenStatement.kind === 213) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -35991,12 +36738,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 228) { + if (node.initializer && node.initializer.kind === 231) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 228) { + if (node.initializer.kind === 231) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -36014,7 +36761,7 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.kind === 217) { + if (node.kind === 220) { if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); if ((functionFlags & (4 | 2)) === 2 && languageVersion < 6) { @@ -36025,13 +36772,13 @@ var ts; checkExternalEmitHelpers(node, 256); } } - if (node.initializer.kind === 228) { + if (node.initializer.kind === 231) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); - if (varExpr.kind === 178 || varExpr.kind === 179) { + if (varExpr.kind === 181 || varExpr.kind === 182) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -36050,7 +36797,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - if (node.initializer.kind === 228) { + if (node.initializer.kind === 231) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -36060,7 +36807,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 178 || varExpr.kind === 179) { + if (varExpr.kind === 181 || varExpr.kind === 182) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -36070,7 +36817,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAssignableToKind(rightType, 33554432 | 1081344)) { + if (!isTypeAssignableToKind(rightType, 134217728 | 7372800)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -36112,7 +36859,7 @@ var ts; var arrayTypes = inputType.types; var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 524322); }); if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, true); + arrayType = getUnionType(filteredTypes, 2); } } else if (arrayType.flags & 524322) { @@ -36149,7 +36896,7 @@ var ts; if (arrayElementType.flags & 524322) { return stringType; } - return getUnionType([arrayElementType, stringType], true); + return getUnionType([arrayElementType, stringType], 2); } return arrayElementType; } @@ -36193,7 +36940,7 @@ var ts; } return undefined; } - var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), true); + var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), 2); var iteratedType = getIteratedTypeOfIterator(returnType, errorNode, !!asyncMethodType); if (checkAssignability && errorNode && iteratedType) { checkTypeAssignableTo(type, asyncMethodType @@ -36232,7 +36979,7 @@ var ts; } return undefined; } - var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), true); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), 2); if (isTypeAny(nextResult)) { return undefined; } @@ -36267,8 +37014,8 @@ var ts; checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatedSetAccessor(node) { - return node.kind === 154 - && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 155)) !== undefined; + return node.kind === 155 + && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156)) !== undefined; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2 @@ -36277,48 +37024,48 @@ var ts; return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 2048 | 1); } function checkReturnStatement(node) { - if (!checkGrammarStatementInAmbientContext(node)) { - var functionBlock = ts.getContainingFunction(node); - if (!functionBlock) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } + if (checkGrammarStatementInAmbientContext(node)) { + return; } var func = ts.getContainingFunction(node); - if (func) { - var signature = getSignatureFromDeclaration(func); - var returnType = getReturnTypeOfSignature(signature); - var functionFlags = ts.getFunctionFlags(func); - if (functionFlags & 1) { + if (!func) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + return; + } + var signature = getSignatureFromDeclaration(func); + var returnType = getReturnTypeOfSignature(signature); + var functionFlags = ts.getFunctionFlags(func); + var isGenerator = functionFlags & 1; + if (strictNullChecks || node.expression || returnType.flags & 16384) { + var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; + if (isGenerator) { return; } - if (strictNullChecks || node.expression || returnType.flags & 16384) { - var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 155) { - if (node.expression) { - error(node, ts.Diagnostics.Setters_cannot_return_a_value); - } - } - else if (func.kind === 153) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { - error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (functionFlags & 2) { - var promisedType = getPromisedTypeOfPromise(returnType); - var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - if (promisedType) { - checkTypeAssignableTo(awaitedType, promisedType, node); - } - } - else { - checkTypeAssignableTo(exprType, returnType, node); - } + else if (func.kind === 156) { + if (node.expression) { + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind !== 153 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { - error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); + else if (func.kind === 154) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } } + else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { + if (functionFlags & 2) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + if (promisedType) { + checkTypeAssignableTo(awaitedType, promisedType, node); + } + } + else { + checkTypeAssignableTo(exprType, returnType, node); + } + } + } + else if (func.kind !== 154 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } function checkWithStatement(node) { @@ -36342,7 +37089,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 262 && !hasDuplicateDefaultClause) { + if (clause.kind === 265 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -36354,9 +37101,8 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 261) { - var caseClause = clause; - var caseType = checkExpression(caseClause.expression); + if (produceDiagnostics && clause.kind === 264) { + var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -36364,7 +37110,7 @@ var ts; comparedExpressionType = getBaseTypeOfLiteralType(expressionType); } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, undefined); } } ts.forEach(clause.statements, checkSourceElement); @@ -36379,7 +37125,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 223 && current.label.escapedText === node.label.escapedText) { + if (current.kind === 226 && current.label.escapedText === node.label.escapedText) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); return true; @@ -36464,7 +37210,7 @@ var ts; error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); } function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) { - if (!indexType) { + if (!indexType || ts.isKnownSymbol(prop)) { return; } var propDeclaration = prop.valueDeclaration; @@ -36473,8 +37219,8 @@ var ts; } var errorNode; if (propDeclaration && - (propDeclaration.kind === 195 || - ts.getNameOfDeclaration(propDeclaration).kind === 145 || + (propDeclaration.kind === 198 || + ts.getNameOfDeclaration(propDeclaration).kind === 146 || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -36565,9 +37311,10 @@ var ts; } var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); var targetConstraint = getConstraintFromTypeParameter(target); - if ((sourceConstraint || targetConstraint) && - (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { - return false; + if (sourceConstraint) { + if (!targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } } var sourceDefault = source.default && getTypeFromTypeNode(source.default); var targetDefault = getDefaultFromTypeParameter(target); @@ -36632,12 +37379,15 @@ var ts; ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; - if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { break; } } } - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var baseWithThis = getTypeWithThisArgument(baseType_1, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + } checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseConstructorType.flags & 1081344 && !isMixinConstructorType(staticType)) { error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); @@ -36663,7 +37413,13 @@ var ts; var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { if (isValidBaseType(t)) { - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + var genericDiag = t.symbol && t.symbol.flags & 32 ? + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : + ts.Diagnostics.Class_0_incorrectly_implements_interface_1; + var baseWithThis = getTypeWithThisArgument(t, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); + } } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -36678,6 +37434,32 @@ var ts; checkPropertyInitialization(node); } } + function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { + var issuedMemberError = false; + var _loop_5 = function (member) { + if (ts.hasStaticModifier(member)) { + return "continue"; + } + var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (declaredProp) { + var prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); + var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); + if (prop && baseProp) { + var rootChain = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, ts.unescapeLeadingUnderscores(declaredProp.escapedName), typeToString(typeWithThis), typeToString(baseWithThis)); }; + if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, undefined, rootChain)) { + issuedMemberError = true; + } + } + } + }; + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + _loop_5(member); + } + if (!issuedMemberError) { + checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); + } + } function checkBaseTypeAccessibility(type, node) { var signatures = getSignaturesOfType(type, 1); if (signatures.length) { @@ -36695,7 +37477,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 230 || d.kind === 231; + return d.kind === 233 || d.kind === 234; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -36713,7 +37495,7 @@ var ts; if (derived === base) { var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) { - if (derivedClassDecl.kind === 200) { + if (derivedClassDecl.kind === 203) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -36802,7 +37584,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 150 && + return node.kind === 151 && !ts.hasModifier(node, 32 | 128) && !node.exclamationToken && !node.initializer; @@ -36822,7 +37604,7 @@ var ts; checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 231); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 234); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -36918,17 +37700,17 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 193: - var value_1 = evaluate(expr.operand); - if (typeof value_1 === "number") { + case 196: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { switch (expr.operator) { - case 37: return value_1; - case 38: return -value_1; - case 52: return ~value_1; + case 37: return value_2; + case 38: return -value_2; + case 52: return ~value_2; } } break; - case 195: + case 198: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -36944,6 +37726,7 @@ var ts; case 37: return left + right; case 38: return left - right; case 42: return left % right; + case 40: return Math.pow(left, right); } } break; @@ -36952,18 +37735,18 @@ var ts; case 8: checkGrammarNumericLiteral(expr); return +expr.text; - case 186: + case 189: return evaluate(expr.expression); case 71: return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText); - case 181: - case 180: + case 184: + case 183: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384) { var name = void 0; - if (ex.kind === 180) { + if (ex.kind === 183) { name = ex.name.escapedText; } else { @@ -36995,8 +37778,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 71 || - node.kind === 180 && isConstantMemberAccess(node.expression) || - node.kind === 181 && isConstantMemberAccess(node.expression) && + node.kind === 183 && isConstantMemberAccess(node.expression) || + node.kind === 184 && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 9; } function checkEnumDeclaration(node) { @@ -37027,7 +37810,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 233) { + if (declaration.kind !== 236) { return false; } var enumDeclaration = declaration; @@ -37050,8 +37833,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { var declaration = declarations_7[_i]; - if ((declaration.kind === 230 || - (declaration.kind === 229 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 233 || + (declaration.kind === 232 && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 2097152)) { return declaration; } @@ -37110,7 +37893,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 230); + var mergedClass = ts.getDeclarationOfKind(symbol, 233); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -37153,22 +37936,22 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 209: + case 212: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 244: - case 245: + case 247: + case 248: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 238: - case 239: + case 241: + case 242: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 177: - case 227: + case 180: + case 230: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -37177,12 +37960,12 @@ var ts; } break; } - case 230: case 233: - case 229: - case 231: - case 234: + case 236: case 232: + case 234: + case 237: + case 235: if (isGlobalAugmentation) { return; } @@ -37200,12 +37983,12 @@ var ts; switch (node.kind) { case 71: return node; - case 144: + case 145: do { node = node.left; } while (node.kind !== 71); return node; - case 180: + case 183: do { node = node.expression; } while (node.kind !== 71); @@ -37218,9 +38001,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 235 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 269 && !inAmbientExternalModule) { - error(moduleName, node.kind === 245 ? + var inAmbientExternalModule = node.parent.kind === 238 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 272 && !inAmbientExternalModule) { + error(moduleName, node.kind === 248 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -37241,13 +38024,13 @@ var ts; (symbol.flags & 793064 ? 793064 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 247 ? + var message = node.kind === 250 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } if (compilerOptions.isolatedModules - && node.kind === 247 + && node.kind === 250 && !(target.flags & 107455) && !(node.flags & 2097152)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); @@ -37274,7 +38057,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241) { + if (importClause.namedBindings.kind === 244) { checkImportBinding(importClause.namedBindings); } else { @@ -37294,7 +38077,7 @@ var ts; if (ts.hasModifier(node, 1)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 249) { + if (node.moduleReference.kind !== 252) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 107455) { @@ -37325,10 +38108,10 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 235 && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 235 && + var inAmbientExternalModule = node.parent.kind === 238 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 238 && !node.moduleSpecifier && node.flags & 2097152; - if (node.parent.kind !== 269 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 272 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -37344,7 +38127,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 269 || node.parent.kind === 235 || node.parent.kind === 234; + var isInAppropriateContext = node.parent.kind === 272 || node.parent.kind === 238 || node.parent.kind === 237; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -37370,8 +38153,8 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 269 ? node.parent : node.parent.parent; - if (container.kind === 234 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 ? node.parent : node.parent.parent; + if (container.kind === 237 && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -37450,7 +38233,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 229 && declaration.kind !== 152) || + return (declaration.kind !== 232 && declaration.kind !== 153) || !!declaration.body; } function checkSourceElement(node) { @@ -37466,144 +38249,148 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { + case 237: + case 233: case 234: - case 230: - case 231: - case 229: + case 232: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 146: - return checkTypeParameter(node); case 147: + return checkTypeParameter(node); + case 148: return checkParameter(node); + case 151: case 150: - case 149: return checkPropertyDeclaration(node); - case 161: case 162: - case 156: + case 163: case 157: - return checkSignatureDeclaration(node); case 158: return checkSignatureDeclaration(node); - case 152: - case 151: - return checkMethodDeclaration(node); - case 153: - return checkConstructorDeclaration(node); - case 154: - case 155: - return checkAccessorDeclaration(node); - case 160: - return checkTypeReferenceNode(node); case 159: + return checkSignatureDeclaration(node); + case 153: + case 152: + return checkMethodDeclaration(node); + case 154: + return checkConstructorDeclaration(node); + case 155: + case 156: + return checkAccessorDeclaration(node); + case 161: + return checkTypeReferenceNode(node); + case 160: return checkTypePredicate(node); - case 163: - return checkTypeQuery(node); case 164: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 165: - return checkArrayType(node); + return checkTypeLiteral(node); case 166: - return checkTupleType(node); + return checkArrayType(node); case 167: + return checkTupleType(node); case 168: - return checkUnionOrIntersectionType(node); case 169: + return checkUnionOrIntersectionType(node); + case 172: return checkSourceElement(node.type); - case 171: + case 174: return checkTypeOperator(node); - case 282: + case 170: + return checkConditionalType(node); + case 171: + return checkInferType(node); + case 285: return checkJSDocAugmentsTag(node); - case 288: + case 291: return checkJSDocTypedefTag(node); - case 284: + case 287: return checkJSDocParameterTag(node); - case 277: + case 280: checkSignatureDeclaration(node); + case 278: + case 277: case 275: - case 274: - case 272: - case 273: + case 276: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 278: + case 281: checkJSDocVariadicType(node); return; - case 271: + case 274: return checkSourceElement(node.type); - case 172: + case 175: return checkIndexedAccessType(node); - case 173: + case 176: return checkMappedType(node); - case 229: - return checkFunctionDeclaration(node); - case 208: - case 235: - return checkBlock(node); - case 209: - return checkVariableStatement(node); - case 211: - return checkExpressionStatement(node); - case 212: - return checkIfStatement(node); - case 213: - return checkDoStatement(node); - case 214: - return checkWhileStatement(node); - case 215: - return checkForStatement(node); - case 216: - return checkForInStatement(node); - case 217: - return checkForOfStatement(node); - case 218: - case 219: - return checkBreakOrContinueStatement(node); - case 220: - return checkReturnStatement(node); - case 221: - return checkWithStatement(node); - case 222: - return checkSwitchStatement(node); - case 223: - return checkLabeledStatement(node); - case 224: - return checkThrowStatement(node); - case 225: - return checkTryStatement(node); - case 227: - return checkVariableDeclaration(node); - case 177: - return checkBindingElement(node); - case 230: - return checkClassDeclaration(node); - case 231: - return checkInterfaceDeclaration(node); case 232: - return checkTypeAliasDeclaration(node); - case 233: - return checkEnumDeclaration(node); - case 234: - return checkModuleDeclaration(node); - case 239: - return checkImportDeclaration(node); + return checkFunctionDeclaration(node); + case 211: case 238: - return checkImportEqualsDeclaration(node); - case 245: - return checkExportDeclaration(node); - case 244: - return checkExportAssignment(node); - case 210: - checkGrammarStatementInAmbientContext(node); - return; + return checkBlock(node); + case 212: + return checkVariableStatement(node); + case 214: + return checkExpressionStatement(node); + case 215: + return checkIfStatement(node); + case 216: + return checkDoStatement(node); + case 217: + return checkWhileStatement(node); + case 218: + return checkForStatement(node); + case 219: + return checkForInStatement(node); + case 220: + return checkForOfStatement(node); + case 221: + case 222: + return checkBreakOrContinueStatement(node); + case 223: + return checkReturnStatement(node); + case 224: + return checkWithStatement(node); + case 225: + return checkSwitchStatement(node); case 226: + return checkLabeledStatement(node); + case 227: + return checkThrowStatement(node); + case 228: + return checkTryStatement(node); + case 230: + return checkVariableDeclaration(node); + case 180: + return checkBindingElement(node); + case 233: + return checkClassDeclaration(node); + case 234: + return checkInterfaceDeclaration(node); + case 235: + return checkTypeAliasDeclaration(node); + case 236: + return checkEnumDeclaration(node); + case 237: + return checkModuleDeclaration(node); + case 242: + return checkImportDeclaration(node); + case 241: + return checkImportEqualsDeclaration(node); + case 248: + return checkExportDeclaration(node); + case 247: + return checkExportAssignment(node); + case 213: checkGrammarStatementInAmbientContext(node); return; - case 248: + case 229: + checkGrammarStatementInAmbientContext(node); + return; + case 251: return checkMissingDeclaration(node); } } @@ -37658,17 +38445,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 187: - case 188: + case 190: + case 191: + case 153: case 152: - case 151: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 154: case 155: + case 156: checkAccessorDeclaration(node); break; - case 200: + case 203: checkClassExpressionDeferred(node); break; } @@ -37768,24 +38555,24 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 234: + case 237: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475); break; - case 233: + case 236: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 200: + case 203: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 230: - case 231: + case 233: + case 234: if (!isStatic) { copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 793064); } break; - case 187: + case 190: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -37823,27 +38610,27 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 146: - case 230: - case 231: - case 232: + case 147: case 233: + case 234: + case 235: + case 236: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 144) { + while (node.parent && node.parent.kind === 145) { node = node.parent; } - return node.parent && node.parent.kind === 160; + return node.parent && node.parent.kind === 161; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 180) { + while (node.parent && node.parent.kind === 183) { node = node.parent; } - return node.parent && node.parent.kind === 202; + return node.parent && node.parent.kind === 205; } function forEachEnclosingClass(node, callback) { var result; @@ -37871,13 +38658,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 144) { + while (nodeOnRightSide.parent.kind === 145) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 238) { + if (nodeOnRightSide.parent.kind === 241) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 244) { + if (nodeOnRightSide.parent.kind === 247) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -37902,18 +38689,18 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJavaScriptFile(entityName) && - entityName.parent.kind === 180 && + entityName.parent.kind === 183 && entityName.parent === entityName.parent.parent.left) { var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); if (specialPropertyAssignmentSymbol) { return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 244 && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 247 && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, 107455 | 793064 | 1920 | 2097152); } - if (entityName.kind !== 180 && isInRightSideOfImportOrExportAssignment(entityName)) { - var importEqualsDeclaration = ts.getAncestor(entityName, 238); + if (entityName.kind !== 183 && isInRightSideOfImportOrExportAssignment(entityName)) { + var importEqualsDeclaration = ts.getAncestor(entityName, 241); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true); } @@ -37922,7 +38709,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 202) { + if (entityName.parent.kind === 205) { meaning = 793064; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -37932,15 +38719,15 @@ var ts; meaning = 1920; } meaning |= 2097152; - var entityNameSymbol = resolveEntityName(entityName, meaning); + var entityNameSymbol = ts.isEntityNameExpression(entityName) ? resolveEntityName(entityName, meaning) : undefined; if (entityNameSymbol) { return entityNameSymbol; } } - if (entityName.parent.kind === 284) { + if (entityName.parent.kind === 287) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 146 && entityName.parent.parent.kind === 287) { + if (entityName.parent.kind === 147 && entityName.parent.parent.kind === 290) { ts.Debug.assert(!ts.isInJavaScriptFile(entityName)); var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -37951,16 +38738,17 @@ var ts; } if (entityName.kind === 71) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { - return getIntrinsicTagSymbol(entityName.parent); + var symbol = getIntrinsicTagSymbol(entityName.parent); + return symbol === unknownSymbol ? undefined : symbol; } return resolveEntityName(entityName, 107455, false, true); } - else if (entityName.kind === 180 || entityName.kind === 144) { + else if (entityName.kind === 183 || entityName.kind === 145) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 180) { + if (entityName.kind === 183) { checkPropertyAccessExpression(entityName); } else { @@ -37970,19 +38758,19 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 160 ? 793064 : 1920; + var meaning = entityName.parent.kind === 161 ? 793064 : 1920; return resolveEntityName(entityName, meaning, false, true); } - else if (entityName.parent.kind === 257) { + else if (entityName.parent.kind === 260) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 159) { + if (entityName.parent.kind === 160) { return resolveEntityName(entityName, 1); } return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 269) { + if (node.kind === 272) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (node.flags & 4194304) { @@ -37998,8 +38786,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 177 && - node.parent.parent.kind === 175 && + else if (node.parent.kind === 180 && + node.parent.parent.kind === 178 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText); @@ -38010,8 +38798,8 @@ var ts; } switch (node.kind) { case 71: - case 180: - case 144: + case 183: + case 145: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 99: var container = ts.getThisContainer(node, false); @@ -38024,19 +38812,20 @@ var ts; if (ts.isInExpressionContext(node)) { return checkExpression(node).symbol; } - case 170: + case 173: return getTypeFromThisTypeNode(node).symbol; case 97: return checkExpression(node).symbol; case 123: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 153) { + if (constructorDeclaration && constructorDeclaration.kind === 154) { return constructorDeclaration.parent.symbol; } return undefined; case 9: + case 13: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 239 || node.parent.kind === 245) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 242 || node.parent.kind === 248) && node.parent.moduleSpecifier === node) || ((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, false)) || ts.isImportCall(node.parent))) { return resolveExternalModuleName(node, node); } @@ -38056,7 +38845,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 266) { + if (location && location.kind === 269) { return resolveEntityName(location.name, 107455 | 2097152); } return undefined; @@ -38109,29 +38898,31 @@ var ts; } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolAtLocation(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + } } return unknownType; } function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 179 || expr.kind === 178); - if (expr.parent.kind === 217) { + ts.Debug.assert(expr.kind === 182 || expr.kind === 181); + if (expr.parent.kind === 220) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 195) { + if (expr.parent.kind === 198) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 265) { + if (expr.parent.kind === 268) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } - ts.Debug.assert(expr.parent.kind === 178); + ts.Debug.assert(expr.parent.kind === 181); var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false, false) || unknownType; - return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); + return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || unknownType); } function getPropertySymbolOfDestructuringAssignment(location) { var typeOfObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(location.parent.parent); @@ -38165,41 +38956,34 @@ var ts; return ts.typeHasCallOrConstructSignatures(type, checker); } function getRootSymbols(symbol) { + var roots = getImmediateRootSymbols(symbol); + return roots ? ts.flatMap(roots, getRootSymbols) : [symbol]; + } + function getImmediateRootSymbols(symbol) { if (ts.getCheckFlags(symbol) & 6) { - var symbols_4 = []; - var name_4 = symbol.escapedName; - ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_4); - if (symbol) { - symbols_4.push(symbol); - } - }); - return symbols_4; + return ts.mapDefined(getSymbolLinks(symbol).containingType.types, function (type) { return getPropertyOfType(type, symbol.escapedName); }); } else if (symbol.flags & 33554432) { - var transient = symbol; - if (transient.leftSpread) { - return getRootSymbols(transient.leftSpread).concat(getRootSymbols(transient.rightSpread)); - } - if (transient.syntheticOrigin) { - return getRootSymbols(transient.syntheticOrigin); - } - var target = void 0; - var next = symbol; - while (next = getSymbolLinks(next).target) { - target = next; - } - if (target) { - return [target]; - } + var _a = symbol, leftSpread = _a.leftSpread, rightSpread = _a.rightSpread, syntheticOrigin = _a.syntheticOrigin; + return leftSpread ? [leftSpread, rightSpread] + : syntheticOrigin ? [syntheticOrigin] + : ts.singleElementArray(tryGetAliasTarget(symbol)); } - return [symbol]; + return undefined; + } + function tryGetAliasTarget(symbol) { + var target; + var next = symbol; + while (next = getSymbolLinks(next).target) { + target = next; + } + return target; } function isArgumentsLocalBinding(node) { if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 180 && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 183 && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -38235,14 +39019,14 @@ var ts; if (symbol) { if (symbol.flags & 1048576) { var exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (!prefixLocals && exportSymbol.flags & 944) { + if (!prefixLocals && exportSymbol.flags & 944 && !(exportSymbol.flags & 3)) { return undefined; } symbol = exportSymbol; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 269) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 272) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; @@ -38276,7 +39060,7 @@ var ts; else if (nodeLinks_1.flags & 131072) { var isDeclaredInLoop = nodeLinks_1.flags & 262144; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 208 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 211 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -38312,16 +39096,16 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 238: - case 240: case 241: case 243: - case 247: + case 244: + case 246: + case 250: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 245: + case 248: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 244: + case 247: return node.expression && node.expression.kind === 71 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -38331,7 +39115,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 269 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 272 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -38394,15 +39178,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 268: - case 180: - case 181: + case 271: + case 183: + case 184: return true; } return false; } function getConstantValue(node) { - if (node.kind === 268) { + if (node.kind === 271) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -38482,20 +39266,20 @@ var ts; : unknownType; if (type.flags & 1024 && type.symbol === symbol) { - flags |= 131072; + flags |= 1048576; } - if (flags & 8192) { + if (flags & 131072) { type = getOptionalType(type); } - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024, writer); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); - getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); + typeToString(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024, writer); } function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { var type = getWidenedType(getRegularTypeOfExpression(expr)); - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024, writer); } function hasGlobalName(name) { return globals.has(ts.escapeLeadingUnderscores(name)); @@ -38529,7 +39313,7 @@ var ts; function isLiteralConstDeclaration(node) { if (ts.isConst(node)) { var type = getTypeOfSymbol(getSymbolOfNode(node)); - return !!(type.flags & 96 && type.flags & 2097152); + return !!(type.flags & 96 && type.flags & 8388608); } return false; } @@ -38604,7 +39388,7 @@ var ts; if (!fileToDirective) { return undefined; } - var meaning = (node.kind === 180) || (node.kind === 71 && isInTypeQuery(node)) + var meaning = (node.kind === 183) || (node.kind === 71 && isInTypeQuery(node)) ? 107455 | 1048576 : 793064 | 1920; var symbol = resolveEntityName(node, meaning, true); @@ -38647,7 +39431,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 269 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 272 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -38666,7 +39450,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 269); + return ts.getDeclarationOfKind(moduleSymbol, 272); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -38699,6 +39483,8 @@ var ts; var list = augmentations_1[_d]; for (var _e = 0, list_1 = list; _e < list_1.length; _e++) { var augmentation = list_1[_e]; + if (!ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; mergeModuleAugmentation(augmentation); } } @@ -38722,6 +39508,17 @@ var ts; globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; globalThisType = getGlobalTypeOrUndefined("ThisType", 1); + if (augmentations) { + for (var _f = 0, augmentations_2 = augmentations; _f < augmentations_2.length; _f++) { + var list = augmentations_2[_f]; + for (var _g = 0, list_2 = list; _g < list_2.length; _g++) { + var augmentation = list_2[_g]; + if (ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } } function checkExternalEmitHelpers(location, helpers) { if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { @@ -38780,14 +39577,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 152 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 153 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 154 || node.kind === 155) { + else if (node.kind === 155 || node.kind === 156) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -38804,17 +39601,17 @@ var ts; var flags = 0; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 131) { - if (node.kind === 149 || node.kind === 151) { + if (modifier.kind !== 132) { + if (node.kind === 150 || node.kind === 152) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 158) { + if (node.kind === 159) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 76: - if (node.kind !== 233 && node.parent.kind === 230) { + if (node.kind !== 236 && node.parent.kind === 233) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76)); } break; @@ -38834,7 +39631,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 235 || node.parent.kind === 269) { + else if (node.parent.kind === 238 || node.parent.kind === 272) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -38857,10 +39654,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 235 || node.parent.kind === 269) { + else if (node.parent.kind === 238 || node.parent.kind === 272) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -38869,11 +39666,11 @@ var ts; flags |= 32; lastStatic = modifier; break; - case 131: + case 132: if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 150 && node.kind !== 149 && node.kind !== 158 && node.kind !== 147) { + else if (node.kind !== 151 && node.kind !== 150 && node.kind !== 159 && node.kind !== 148) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -38892,17 +39689,17 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; case 79: - var container = node.parent.kind === 269 ? node.parent : node.parent.parent; - if (container.kind === 234 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 ? node.parent : node.parent.parent; + if (container.kind === 237 && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512; @@ -38914,13 +39711,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 2097152) && node.parent.kind === 235) { + else if ((node.parent.flags & 2097152) && node.parent.kind === 238) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -38930,14 +39727,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 230) { - if (node.kind !== 152 && - node.kind !== 150 && - node.kind !== 154 && - node.kind !== 155) { + if (node.kind !== 233) { + if (node.kind !== 153 && + node.kind !== 151 && + node.kind !== 155 && + node.kind !== 156) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 230 && ts.hasModifier(node.parent, 128))) { + if (!(node.parent.kind === 233 && ts.hasModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -38956,7 +39753,7 @@ var ts; else if (flags & 2 || node.parent.flags & 2097152) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -38964,7 +39761,7 @@ var ts; break; } } - if (node.kind === 153) { + if (node.kind === 154) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -38979,13 +39776,13 @@ var ts; } return; } - else if ((node.kind === 239 || node.kind === 238) && flags & 2) { + else if ((node.kind === 242 || node.kind === 241) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 147 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 148 && (flags & 92) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 147 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 148 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -39001,37 +39798,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 154: case 155: - case 153: - case 150: - case 149: - case 152: + case 156: + case 154: case 151: - case 158: - case 234: - case 239: - case 238: - case 245: - case 244: - case 187: - case 188: - case 147: + case 150: + case 153: + case 152: + case 159: + case 237: + case 242: + case 241: + case 248: + case 247: + case 190: + case 191: + case 148: return false; default: - if (node.parent.kind === 235 || node.parent.kind === 269) { + if (node.parent.kind === 238 || node.parent.kind === 272) { return false; } switch (node.kind) { - case 229: - return nodeHasAnyModifiersExcept(node, 120); - case 230: - return nodeHasAnyModifiersExcept(node, 117); - case 231: - case 209: case 232: - return true; + return nodeHasAnyModifiersExcept(node, 120); case 233: + return nodeHasAnyModifiersExcept(node, 117); + case 234: + case 212: + case 235: + return true; + case 236: return nodeHasAnyModifiersExcept(node, 76); default: ts.Debug.fail(); @@ -39044,10 +39841,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 152: - case 229: - case 187: - case 188: + case 153: + case 232: + case 190: + case 191: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -39060,9 +39857,6 @@ var ts; } } function checkGrammarTypeParameterList(typeParameters, file) { - if (checkGrammarForDisallowedTrailingComma(typeParameters)) { - return true; - } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; @@ -39109,15 +39903,13 @@ var ts; return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 188) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } + if (!ts.isArrowFunction(node)) { + return false; } - return false; + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -39144,7 +39936,14 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 136 && parameter.type.kind !== 133) { + if (parameter.type.kind !== 137 && parameter.type.kind !== 134) { + var type = getTypeFromTypeNode(parameter.type); + if (type.flags & 2 || type.flags & 4) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type))); + } + if (allTypesAssignableToKind(type, 32, true)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead); + } return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -39170,7 +39969,7 @@ var ts; if (args) { for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; - if (arg.kind === 201) { + if (arg.kind === 204) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -39243,19 +40042,19 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 145) { + if (node.kind !== 146) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 195 && computedPropertyName.expression.operatorToken.kind === 26) { + if (computedPropertyName.expression.kind === 198 && computedPropertyName.expression.operatorToken.kind === 26) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 229 || - node.kind === 187 || - node.kind === 152); + ts.Debug.assert(node.kind === 232 || + node.kind === 190 || + node.kind === 153); if (node.flags & 2097152) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -39273,39 +40072,39 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267) { + if (prop.kind === 270) { continue; } var name = prop.name; - if (name.kind === 145) { + if (name.kind === 146) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 266 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 269 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 120 || prop.kind !== 152) { + if (mod.kind !== 120 || prop.kind !== 153) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; switch (prop.kind) { - case 265: - case 266: + case 268: + case 269: checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8) { checkGrammarNumericLiteral(name); } - case 152: + case 153: currentKind = 1; break; - case 154: + case 155: currentKind = 2; break; - case 155: + case 156: currentKind = 4; break; default: @@ -39341,20 +40140,18 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 259) { + if (attr.kind === 262) { continue; } - var jsxAttr = attr; - var name = jsxAttr.name; + var name = attr.name, initializer = attr.initializer; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 260 && !initializer.expression) { - return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === 263 && !initializer.expression) { + return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -39362,12 +40159,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 217 && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 220 && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384) === 0) { return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); } } - if (forInOrOfStatement.initializer.kind === 228) { + if (forInOrOfStatement.initializer.kind === 231) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -39375,20 +40172,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 216 + var diagnostic = forInOrOfStatement.kind === 219 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 216 + var diagnostic = forInOrOfStatement.kind === 219 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 216 + var diagnostic = forInOrOfStatement.kind === 219 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -39415,11 +40212,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 154 ? + return grammarErrorOnNode(accessor.name, kind === 155 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 155) { + else if (kind === 156) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -39438,21 +40235,21 @@ var ts; } } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 154 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 154 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 155 ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 140) { - if (node.type.kind !== 137) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(137)); + if (node.operator === 141) { + if (node.type.kind !== 138) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 227: + case 230: var decl = parent; if (decl.name.kind !== 71) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -39464,13 +40261,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 150: + case 151: if (!ts.hasModifier(parent, 32) || !ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 149: + case 150: if (!ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -39486,31 +40283,37 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === 179) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === 153) { + if (node.parent.kind === 182) { + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } if (ts.isClassLike(node.parent)) { if (node.flags & 2097152) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === 153 && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 231) { + else if (node.parent.kind === 234) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 164) { + else if (node.parent.kind === 165) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -39521,9 +40324,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 223: + case 226: if (node.label && current.label.escapedText === node.label.escapedText) { - var isMisplacedContinueLabel = node.kind === 218 + var isMisplacedContinueLabel = node.kind === 221 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -39531,8 +40334,8 @@ var ts; return false; } break; - case 222: - if (node.kind === 219 && !node.label) { + case 225: + if (node.kind === 222 && !node.label) { return false; } break; @@ -39545,13 +40348,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 219 + var message = node.kind === 222 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 219 + var message = node.kind === 222 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -39560,12 +40363,15 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== ts.lastOrUndefined(elements)) { + if (node !== ts.last(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 176 || node.name.kind === 175) { + if (node.name.kind === 179 || node.name.kind === 178) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } + if (node.propertyName) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name); + } if (node.initializer) { return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } @@ -39573,11 +40379,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 || expr.kind === 8 || - expr.kind === 193 && expr.operator === 38 && + expr.kind === 196 && expr.operator === 38 && expr.operand.kind === 8; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 216 && node.parent.parent.kind !== 217) { + if (node.parent.parent.kind !== 219 && node.parent.parent.kind !== 220) { if (node.flags & 2097152) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -39604,7 +40410,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 209 || !node.type || node.initializer || node.flags & 2097152)) { + if (node.exclamationToken && (node.parent.parent.kind !== 212 || !node.type || node.initializer || node.flags & 2097152)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && @@ -39657,15 +40463,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 212: - case 213: - case 214: - case 221: case 215: case 216: case 217: + case 224: + case 218: + case 219: + case 220: return false; - case 223: + case 226: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -39731,7 +40537,7 @@ var ts; return true; } } - else if (node.parent.kind === 231) { + else if (node.parent.kind === 234) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -39739,7 +40545,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 164) { + else if (node.parent.kind === 165) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -39750,19 +40556,19 @@ var ts; if (node.flags & 2097152 && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } - if (node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || + if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 2097152 || ts.hasModifier(node, 32 | 128))) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 231 || - node.kind === 232 || - node.kind === 239 || - node.kind === 238 || - node.kind === 245 || - node.kind === 244 || - node.kind === 237 || + if (node.kind === 234 || + node.kind === 235 || + node.kind === 242 || + node.kind === 241 || + node.kind === 248 || + node.kind === 247 || + node.kind === 240 || ts.hasModifier(node, 2 | 1 | 512)) { return false; } @@ -39771,7 +40577,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 209) { + if (ts.isDeclaration(decl) || decl.kind === 212) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -39790,7 +40596,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 208 || node.parent.kind === 235 || node.parent.kind === 269) { + if (node.parent.kind === 211 || node.parent.kind === 238 || node.parent.kind === 272) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -39806,10 +40612,10 @@ var ts; if (languageVersion >= 1) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 174)) { + else if (ts.isChildOfNodeWithKind(node, 177)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 268)) { + else if (ts.isChildOfNodeWithKind(node, 271)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -39857,22 +40663,22 @@ var ts; ts.createTypeChecker = createTypeChecker; function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 243: - case 247: - return true; + case 246: + case 250: + return ts.isIdentifier(name); default: return ts.isDeclarationName(name); } } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 240: - case 238: - case 241: case 243: + case 241: + case 244: + case 246: return true; case 71: - return decl.parent.kind === 243; + return decl.parent.kind === 246; default: return false; } @@ -39971,7 +40777,7 @@ var ts; var node = createSynthesizedNode(71); node.escapedText = ts.escapeLeadingUnderscores(text); node.originalKeywordKind = text ? ts.stringToToken(text) : 0; - node.autoGenerateKind = 0; + node.autoGenerateFlags = 0; node.autoGenerateId = 0; if (typeArguments) { node.typeArguments = createNodeArray(typeArguments); @@ -39986,20 +40792,23 @@ var ts; } ts.updateIdentifier = updateIdentifier; var nextAutoGenerateId = 0; - function createTempVariable(recordTempVariable) { + function createTempVariable(recordTempVariable, reservedInNestedScopes) { var name = createIdentifier(""); - name.autoGenerateKind = 1; + name.autoGenerateFlags = 1; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; if (recordTempVariable) { recordTempVariable(name); } + if (reservedInNestedScopes) { + name.autoGenerateFlags |= 16; + } return name; } ts.createTempVariable = createTempVariable; function createLoopVariable() { var name = createIdentifier(""); - name.autoGenerateKind = 2; + name.autoGenerateFlags = 2; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -40007,7 +40816,7 @@ var ts; ts.createLoopVariable = createLoopVariable; function createUniqueName(text) { var name = createIdentifier(text); - name.autoGenerateKind = 3; + name.autoGenerateFlags = 3; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -40015,10 +40824,12 @@ var ts; ts.createUniqueName = createUniqueName; function getGeneratedNameForNode(node, shouldSkipNameGenerationScope) { var name = createIdentifier(""); - name.autoGenerateKind = 4; + name.autoGenerateFlags = 4; name.autoGenerateId = nextAutoGenerateId; name.original = node; - name.skipNameGenerationScope = !!shouldSkipNameGenerationScope; + if (shouldSkipNameGenerationScope) { + name.autoGenerateFlags |= 8; + } nextAutoGenerateId++; return name; } @@ -40048,7 +40859,7 @@ var ts; } ts.createFalse = createFalse; function createQualifiedName(left, right) { - var node = createSynthesizedNode(144); + var node = createSynthesizedNode(145); node.left = left; node.right = asName(right); return node; @@ -40062,7 +40873,7 @@ var ts; } ts.updateQualifiedName = updateQualifiedName; function createComputedPropertyName(expression) { - var node = createSynthesizedNode(145); + var node = createSynthesizedNode(146); node.expression = expression; return node; } @@ -40074,7 +40885,7 @@ var ts; } ts.updateComputedPropertyName = updateComputedPropertyName; function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(146); + var node = createSynthesizedNode(147); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -40090,7 +40901,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(147); + var node = createSynthesizedNode(148); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -40114,7 +40925,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(148); + var node = createSynthesizedNode(149); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -40126,7 +40937,7 @@ var ts; } ts.updateDecorator = updateDecorator; function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(149); + var node = createSynthesizedNode(150); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -40145,30 +40956,32 @@ var ts; : node; } ts.updatePropertySignature = updatePropertySignature; - function createProperty(decorators, modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(150); + function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { + var node = createSynthesizedNode(151); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.questionToken = questionToken; + node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 ? questionOrExclamationToken : undefined; + node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 ? questionOrExclamationToken : undefined; node.type = type; node.initializer = initializer; return node; } ts.createProperty = createProperty; - function updateProperty(node, decorators, modifiers, name, questionToken, type, initializer) { + function updateProperty(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { return node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name - || node.questionToken !== questionToken + || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 ? questionOrExclamationToken : undefined) + || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 ? questionOrExclamationToken : undefined) || node.type !== type || node.initializer !== initializer - ? updateNode(createProperty(decorators, modifiers, name, questionToken, type, initializer), node) + ? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(151, typeParameters, parameters, type); + var node = createSignatureDeclaration(152, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -40185,7 +40998,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(152); + var node = createSynthesizedNode(153); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -40213,7 +41026,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(153); + var node = createSynthesizedNode(154); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -40233,7 +41046,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(154); + var node = createSynthesizedNode(155); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -40256,7 +41069,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(155); + var node = createSynthesizedNode(156); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -40277,7 +41090,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(156, typeParameters, parameters, type); + return createSignatureDeclaration(157, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -40285,7 +41098,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(157, typeParameters, parameters, type); + return createSignatureDeclaration(158, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -40293,7 +41106,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(158); + var node = createSynthesizedNode(159); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -40310,11 +41123,12 @@ var ts; : node; } ts.updateIndexSignature = updateIndexSignature; - function createSignatureDeclaration(kind, typeParameters, parameters, type) { + function createSignatureDeclaration(kind, typeParameters, parameters, type, typeArguments) { var node = createSynthesizedNode(kind); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createSignatureDeclaration = createSignatureDeclaration; @@ -40330,7 +41144,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(159); + var node = createSynthesizedNode(160); node.parameterName = asName(parameterName); node.type = type; return node; @@ -40344,7 +41158,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(160); + var node = createSynthesizedNode(161); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -40358,7 +41172,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(161, typeParameters, parameters, type); + return createSignatureDeclaration(162, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -40366,7 +41180,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(162, typeParameters, parameters, type); + return createSignatureDeclaration(163, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -40374,7 +41188,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(163); + var node = createSynthesizedNode(164); node.exprName = exprName; return node; } @@ -40386,7 +41200,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(164); + var node = createSynthesizedNode(165); node.members = createNodeArray(members); return node; } @@ -40398,7 +41212,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(165); + var node = createSynthesizedNode(166); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -40410,7 +41224,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(166); + var node = createSynthesizedNode(167); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -40422,7 +41236,7 @@ var ts; } ts.updateTypleTypeNode = updateTypleTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(167, types); + return createUnionOrIntersectionTypeNode(168, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -40430,7 +41244,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(168, types); + return createUnionOrIntersectionTypeNode(169, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -40448,8 +41262,38 @@ var ts; ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) : node; } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createSynthesizedNode(170); + node.checkType = ts.parenthesizeConditionalTypeMember(checkType); + node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); + node.trueType = trueType; + node.falseType = falseType; + return node; + } + ts.createConditionalTypeNode = createConditionalTypeNode; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType + || node.extendsType !== extendsType + || node.trueType !== trueType + || node.falseType !== falseType + ? updateNode(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) + : node; + } + ts.updateConditionalTypeNode = updateConditionalTypeNode; + function createInferTypeNode(typeParameter) { + var node = createSynthesizedNode(171); + node.typeParameter = typeParameter; + return node; + } + ts.createInferTypeNode = createInferTypeNode; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter + ? updateNode(createInferTypeNode(typeParameter), node) + : node; + } + ts.updateInferTypeNode = updateInferTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(169); + var node = createSynthesizedNode(172); node.type = type; return node; } @@ -40461,12 +41305,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(170); + return createSynthesizedNode(173); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(171); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 127; + var node = createSynthesizedNode(174); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 128; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -40476,7 +41320,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(172); + var node = createSynthesizedNode(175); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -40490,7 +41334,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(173); + var node = createSynthesizedNode(176); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -40508,7 +41352,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(174); + var node = createSynthesizedNode(177); node.literal = literal; return node; } @@ -40520,7 +41364,7 @@ var ts; } ts.updateLiteralTypeNode = updateLiteralTypeNode; function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(175); + var node = createSynthesizedNode(178); node.elements = createNodeArray(elements); return node; } @@ -40532,7 +41376,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(176); + var node = createSynthesizedNode(179); node.elements = createNodeArray(elements); return node; } @@ -40544,7 +41388,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(177); + var node = createSynthesizedNode(180); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -40562,7 +41406,7 @@ var ts; } ts.updateBindingElement = updateBindingElement; function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(178); + var node = createSynthesizedNode(181); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -40576,7 +41420,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(179); + var node = createSynthesizedNode(182); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -40590,7 +41434,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(180); + var node = createSynthesizedNode(183); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072); @@ -40605,7 +41449,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(181); + var node = createSynthesizedNode(184); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -40619,7 +41463,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(182); + var node = createSynthesizedNode(185); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -40635,7 +41479,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(183); + var node = createSynthesizedNode(186); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -40651,7 +41495,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, template) { - var node = createSynthesizedNode(184); + var node = createSynthesizedNode(187); node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; @@ -40665,7 +41509,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(185); + var node = createSynthesizedNode(188); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -40679,7 +41523,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(186); + var node = createSynthesizedNode(189); node.expression = expression; return node; } @@ -40691,7 +41535,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(187); + var node = createSynthesizedNode(190); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -40715,7 +41559,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(188); + var node = createSynthesizedNode(191); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -40749,7 +41593,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(189); + var node = createSynthesizedNode(192); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -40761,7 +41605,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(190); + var node = createSynthesizedNode(193); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -40773,7 +41617,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(191); + var node = createSynthesizedNode(194); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -40785,7 +41629,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(192); + var node = createSynthesizedNode(195); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -40797,7 +41641,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(193); + var node = createSynthesizedNode(196); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -40810,7 +41654,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(194); + var node = createSynthesizedNode(197); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -40823,7 +41667,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(195); + var node = createSynthesizedNode(198); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined); @@ -40840,7 +41684,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(196); + var node = createSynthesizedNode(199); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -40870,7 +41714,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(197); + var node = createSynthesizedNode(200); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -40908,7 +41752,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(198); + var node = createSynthesizedNode(201); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 ? asteriskTokenOrExpression : expression; return node; @@ -40922,7 +41766,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(199); + var node = createSynthesizedNode(202); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -40934,7 +41778,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(200); + var node = createSynthesizedNode(203); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -40955,11 +41799,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(201); + return createSynthesizedNode(204); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(202); + var node = createSynthesizedNode(205); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -40973,7 +41817,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(203); + var node = createSynthesizedNode(206); node.expression = expression; node.type = type; return node; @@ -40987,7 +41831,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(204); + var node = createSynthesizedNode(207); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -40999,7 +41843,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(205); + var node = createSynthesizedNode(208); node.keywordToken = keywordToken; node.name = name; return node; @@ -41012,7 +41856,7 @@ var ts; } ts.updateMetaProperty = updateMetaProperty; function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(206); + var node = createSynthesizedNode(209); node.expression = expression; node.literal = literal; return node; @@ -41026,11 +41870,11 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(207); + return createSynthesizedNode(210); } ts.createSemicolonClassElement = createSemicolonClassElement; function createBlock(statements, multiLine) { - var block = createSynthesizedNode(208); + var block = createSynthesizedNode(211); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -41044,7 +41888,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(209); + var node = createSynthesizedNode(212); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -41059,11 +41903,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(210); + return createSynthesizedNode(213); } ts.createEmptyStatement = createEmptyStatement; function createStatement(expression) { - var node = createSynthesizedNode(211); + var node = createSynthesizedNode(214); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -41075,7 +41919,7 @@ var ts; } ts.updateStatement = updateStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(212); + var node = createSynthesizedNode(215); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -41091,7 +41935,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(213); + var node = createSynthesizedNode(216); node.statement = statement; node.expression = expression; return node; @@ -41105,7 +41949,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(214); + var node = createSynthesizedNode(217); node.expression = expression; node.statement = statement; return node; @@ -41119,7 +41963,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(215); + var node = createSynthesizedNode(218); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -41137,7 +41981,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(216); + var node = createSynthesizedNode(219); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -41153,7 +41997,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(217); + var node = createSynthesizedNode(220); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -41171,7 +42015,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(218); + var node = createSynthesizedNode(221); node.label = asName(label); return node; } @@ -41183,7 +42027,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(219); + var node = createSynthesizedNode(222); node.label = asName(label); return node; } @@ -41195,7 +42039,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(220); + var node = createSynthesizedNode(223); node.expression = expression; return node; } @@ -41207,7 +42051,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(221); + var node = createSynthesizedNode(224); node.expression = expression; node.statement = statement; return node; @@ -41221,7 +42065,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(222); + var node = createSynthesizedNode(225); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -41235,7 +42079,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(223); + var node = createSynthesizedNode(226); node.label = asName(label); node.statement = statement; return node; @@ -41249,7 +42093,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(224); + var node = createSynthesizedNode(227); node.expression = expression; return node; } @@ -41261,7 +42105,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(225); + var node = createSynthesizedNode(228); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -41277,11 +42121,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(226); + return createSynthesizedNode(229); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(227); + var node = createSynthesizedNode(230); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -41297,7 +42141,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { - var node = createSynthesizedNode(228); + var node = createSynthesizedNode(231); node.flags |= flags & 3; node.declarations = createNodeArray(declarations); return node; @@ -41310,7 +42154,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(229); + var node = createSynthesizedNode(232); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -41336,7 +42180,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(230); + var node = createSynthesizedNode(233); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -41358,7 +42202,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(231); + var node = createSynthesizedNode(234); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -41380,7 +42224,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(232); + var node = createSynthesizedNode(235); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -41400,7 +42244,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(233); + var node = createSynthesizedNode(236); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -41418,7 +42262,7 @@ var ts; } ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { - var node = createSynthesizedNode(234); + var node = createSynthesizedNode(237); node.flags |= flags & (16 | 4 | 512); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -41437,7 +42281,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(235); + var node = createSynthesizedNode(238); node.statements = createNodeArray(statements); return node; } @@ -41449,7 +42293,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(236); + var node = createSynthesizedNode(239); node.clauses = createNodeArray(clauses); return node; } @@ -41461,7 +42305,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(237); + var node = createSynthesizedNode(240); node.name = asName(name); return node; } @@ -41473,7 +42317,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(238); + var node = createSynthesizedNode(241); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -41491,7 +42335,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(239); + var node = createSynthesizedNode(242); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -41509,7 +42353,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(240); + var node = createSynthesizedNode(243); node.name = name; node.namedBindings = namedBindings; return node; @@ -41523,7 +42367,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(241); + var node = createSynthesizedNode(244); node.name = name; return node; } @@ -41535,7 +42379,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(242); + var node = createSynthesizedNode(245); node.elements = createNodeArray(elements); return node; } @@ -41547,7 +42391,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(243); + var node = createSynthesizedNode(246); node.propertyName = propertyName; node.name = name; return node; @@ -41561,7 +42405,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(244); + var node = createSynthesizedNode(247); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -41578,7 +42422,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(245); + var node = createSynthesizedNode(248); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -41596,7 +42440,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(246); + var node = createSynthesizedNode(249); node.elements = createNodeArray(elements); return node; } @@ -41608,7 +42452,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(247); + var node = createSynthesizedNode(250); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -41622,7 +42466,7 @@ var ts; } ts.updateExportSpecifier = updateExportSpecifier; function createExternalModuleReference(expression) { - var node = createSynthesizedNode(249); + var node = createSynthesizedNode(252); node.expression = expression; return node; } @@ -41634,7 +42478,7 @@ var ts; } ts.updateExternalModuleReference = updateExternalModuleReference; function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(250); + var node = createSynthesizedNode(253); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -41650,7 +42494,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, attributes) { - var node = createSynthesizedNode(251); + var node = createSynthesizedNode(254); node.tagName = tagName; node.attributes = attributes; return node; @@ -41664,7 +42508,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, attributes) { - var node = createSynthesizedNode(252); + var node = createSynthesizedNode(255); node.tagName = tagName; node.attributes = attributes; return node; @@ -41678,7 +42522,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(253); + var node = createSynthesizedNode(256); node.tagName = tagName; return node; } @@ -41690,7 +42534,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(254); + var node = createSynthesizedNode(257); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -41706,7 +42550,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(257); + var node = createSynthesizedNode(260); node.name = name; node.initializer = initializer; return node; @@ -41720,7 +42564,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(258); + var node = createSynthesizedNode(261); node.properties = createNodeArray(properties); return node; } @@ -41732,7 +42576,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(259); + var node = createSynthesizedNode(262); node.expression = expression; return node; } @@ -41744,7 +42588,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(260); + var node = createSynthesizedNode(263); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -41757,7 +42601,7 @@ var ts; } ts.updateJsxExpression = updateJsxExpression; function createCaseClause(expression, statements) { - var node = createSynthesizedNode(261); + var node = createSynthesizedNode(264); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -41771,7 +42615,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(262); + var node = createSynthesizedNode(265); node.statements = createNodeArray(statements); return node; } @@ -41783,7 +42627,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(263); + var node = createSynthesizedNode(266); node.token = token; node.types = createNodeArray(types); return node; @@ -41796,7 +42640,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(264); + var node = createSynthesizedNode(267); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -41810,7 +42654,7 @@ var ts; } ts.updateCatchClause = updateCatchClause; function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(265); + var node = createSynthesizedNode(268); node.name = asName(name); node.questionToken = undefined; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -41825,7 +42669,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(266); + var node = createSynthesizedNode(269); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -41839,7 +42683,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(267); + var node = createSynthesizedNode(270); node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; return node; } @@ -41851,7 +42695,7 @@ var ts; } ts.updateSpreadAssignment = updateSpreadAssignment; function createEnumMember(name, initializer) { - var node = createSynthesizedNode(268); + var node = createSynthesizedNode(271); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -41866,7 +42710,7 @@ var ts; ts.updateEnumMember = updateEnumMember; function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createSynthesizedNode(269); + var updated = createSynthesizedNode(272); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -41935,28 +42779,28 @@ var ts; } ts.getMutableClone = getMutableClone; function createNotEmittedStatement(original) { - var node = createSynthesizedNode(291); + var node = createSynthesizedNode(294); node.original = original; setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(295); + var node = createSynthesizedNode(298); node.emitNode = {}; node.original = original; return node; } ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker; function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(294); + var node = createSynthesizedNode(297); node.emitNode = {}; node.original = original; return node; } ts.createMergeDeclarationMarker = createMergeDeclarationMarker; function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(292); + var node = createSynthesizedNode(295); node.expression = expression; node.original = original; setTextRange(node, original); @@ -41972,7 +42816,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 293) { + if (node.kind === 296) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26) { @@ -41982,7 +42826,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(293); + var node = createSynthesizedNode(296); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -41994,7 +42838,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createBundle(sourceFiles) { - var node = ts.createNode(270); + var node = ts.createNode(273); node.sourceFiles = sourceFiles; return node; } @@ -42097,7 +42941,7 @@ var ts; function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 269) { + if (node.kind === 272) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -42518,7 +43362,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 223 + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 226 ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -42536,13 +43380,13 @@ var ts; case 8: case 9: return false; - case 178: + case 181: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 179: + case 182: return target.properties.length > 0; default: return true; @@ -42568,7 +43412,7 @@ var ts; } else { switch (callee.kind) { - case 180: { + case 183: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); @@ -42580,7 +43424,7 @@ var ts; } break; } - case 181: { + case 184: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); @@ -42633,14 +43477,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 154: case 155: + case 156: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 265: + case 268: return createExpressionForPropertyAssignment(property, receiver); - case 266: + case 269: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 152: + case 153: return createExpressionForMethodDeclaration(property, receiver); } } @@ -42840,7 +43684,7 @@ var ts; ts.ensureUseStrict = ensureUseStrict; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 186) { + if (skipped.kind === 189) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -42849,15 +43693,15 @@ var ts; } ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(195, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(195, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(198, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(198, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { case -1: if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 - && operand.kind === 198) { + && operand.kind === 201) { return false; } return true; @@ -42896,7 +43740,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 195 && node.operatorToken.kind === 37) { + if (node.kind === 198 && node.operatorToken.kind === 37) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -42911,7 +43755,7 @@ var ts; return 0; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(196, 55); + var conditionalPrecedence = ts.getOperatorPrecedence(199, 55); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { @@ -42921,16 +43765,18 @@ var ts; } ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; function parenthesizeSubexpressionOfConditionalExpression(e) { - return e.kind === 195 && e.operatorToken.kind === 26 + var emittedExpression = ts.skipPartiallyEmittedExpressions(e); + return emittedExpression.kind === 198 && emittedExpression.operatorToken.kind === 26 || + emittedExpression.kind === 296 ? ts.createParen(e) : e; } ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; function parenthesizeDefaultExpression(e) { var check = ts.skipPartiallyEmittedExpressions(e); - return (check.kind === 200 || - check.kind === 187 || - check.kind === 293 || + return (check.kind === 203 || + check.kind === 190 || + check.kind === 296 || ts.isBinaryExpression(check) && check.operatorToken.kind === 26) ? ts.createParen(e) : e; @@ -42939,9 +43785,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, true); switch (leftmostExpr.kind) { - case 182: + case 185: return ts.createParen(expression); - case 183: + case 186: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -42952,7 +43798,7 @@ var ts; function parenthesizeForAccess(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 183 || emittedExpression.arguments)) { + && (emittedExpression.kind !== 186 || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -42990,7 +43836,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(195, 26); + var commaPrecedence = ts.getOperatorPrecedence(198, 26); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -43001,34 +43847,38 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 187 || kind === 188) { + if (kind === 190 || kind === 191) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind; - if (leftmostExpressionKind === 179 || leftmostExpressionKind === 187) { + if (leftmostExpressionKind === 182 || leftmostExpressionKind === 190) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function parenthesizeConditionalTypeMember(member) { + return member.kind === 170 ? ts.createParenthesizedType(member) : member; + } + ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 167: case 168: - case 161: + case 169: case 162: + case 163: return ts.createParenthesizedType(member); } - return member; + return parenthesizeConditionalTypeMember(member); } ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 163: - case 171: + case 164: + case 174: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -43054,24 +43904,24 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 194: + case 197: node = node.operand; continue; - case 195: + case 198: node = node.left; continue; - case 196: + case 199: node = node.condition; continue; - case 182: + case 185: if (stopAtCallExpressions) { return node; } - case 181: - case 180: + case 184: + case 183: node = node.expression; continue; - case 292: + case 295: node = node.expression; continue; } @@ -43079,7 +43929,7 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 179) { + if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 182) { return ts.setTextRange(ts.createParen(body), body); } return body; @@ -43088,13 +43938,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7; } switch (node.kind) { - case 186: + case 189: return (kinds & 1) !== 0; - case 185: - case 203: - case 204: + case 188: + case 206: + case 207: return (kinds & 2) !== 0; - case 292: + case 295: return (kinds & 4) !== 0; } return false; @@ -43119,14 +43969,14 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipParentheses(node) { - while (node.kind === 186) { + while (node.kind === 189) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 204) { + while (ts.isAssertionExpression(node) || node.kind === 207) { node = node.expression; } return node; @@ -43134,15 +43984,15 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 186: return ts.updateParen(outerExpression, expression); - case 185: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 203: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 204: return ts.updateNonNullExpression(outerExpression, expression); - case 292: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 189: return ts.updateParen(outerExpression, expression); + case 188: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 206: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 207: return ts.updateNonNullExpression(outerExpression, expression); + case 295: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { - return node.kind === 186 + return node.kind === 189 && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -43167,14 +44017,14 @@ var ts; return emitNode && emitNode.externalHelpersModuleName; } ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues) { + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) { if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(node, compilerOptions)) { var externalHelpersModuleName = getExternalHelpersModuleName(node); if (externalHelpersModuleName) { return externalHelpersModuleName; } var moduleKind = ts.getEmitModuleKind(compilerOptions); - var create = hasExportStarsToExportValues + var create = (hasExportStarsToExportValues || (compilerOptions.esModuleInterop && hasImportStarOrImportDefault)) && moduleKind !== ts.ModuleKind.System && moduleKind !== ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.ESNext; @@ -43204,10 +44054,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 239 && node.importClause) { + if (node.kind === 242 && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 245 && node.moduleSpecifier) { + if (node.kind === 248 && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -43269,11 +44119,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 265: + case 268: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 266: + case 269: return bindingElement.name; - case 267: + case 270: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -43289,11 +44139,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 147: - case 177: + case 148: + case 180: return bindingElement.dotDotDotToken; - case 199: - case 267: + case 202: + case 270: return bindingElement; } return undefined; @@ -43301,7 +44151,7 @@ var ts; ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement; function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 177: + case 180: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -43309,7 +44159,7 @@ var ts; : propertyName; } break; - case 265: + case 268: if (bindingElement.name) { var propertyName = bindingElement.name; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -43317,7 +44167,7 @@ var ts; : propertyName; } break; - case 267: + case 270: return bindingElement.name; } var target = getTargetOfBindingOrAssignmentElement(bindingElement); @@ -43331,11 +44181,11 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 175: - case 176: case 178: - return name.elements; case 179: + case 181: + return name.elements; + case 182: return name.properties; } } @@ -43374,11 +44224,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 176: - case 178: - return convertToArrayAssignmentPattern(node); - case 175: case 179: + case 181: + return convertToArrayAssignmentPattern(node); + case 178: + case 182: return convertToObjectAssignmentPattern(node); } } @@ -43410,6 +44260,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration); function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; @@ -43514,251 +44365,255 @@ var ts; return undefined; } var kind = node.kind; - if ((kind > 0 && kind <= 143) || kind === 170) { + if ((kind > 0 && kind <= 144) || kind === 173) { return node; } switch (kind) { case 71: - return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 144: - return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); case 145: - return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); case 146: - return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); case 147: - return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); case 148: - return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 149: - return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); case 150: - return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 151: - return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 152: - return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); case 153: - return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 154: - return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); case 155: - return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 156: - return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); case 157: - return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 158: - return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 159: - return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 160: - return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); case 161: - return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); case 162: - return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 163: - return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 164: - return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); case 165: - return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); case 166: - return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); case 167: - return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); case 168: - return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); case 169: - return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 170: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); case 171: - return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); case 172: - return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 173: - return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); case 174: - return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); case 175: - return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); case 176: - return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); case 177: - return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); case 178: - return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); case 179: - return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); case 180: - return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); case 181: - return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); case 182: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); case 183: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); case 184: - return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); + return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); case 185: - return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); case 186: - return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); case 187: - return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); case 188: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); case 189: - return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); case 190: - return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 191: - return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); case 192: - return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); case 193: - return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); + return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); case 194: - return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); + return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); case 195: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); + return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); case 196: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); case 197: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); case 198: - return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); case 199: - return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); case 200: - return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 201: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); case 202: - return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); case 203: - return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 204: - return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); case 205: - return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); case 206: - return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 207: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); case 208: - return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); case 209: - return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); case 211: - return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 212: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 213: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); case 214: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); case 215: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); case 216: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); case 217: - return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 218: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 219: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 220: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 221: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); case 222: - return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); case 223: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); case 224: - return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 225: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + case 226: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 227: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); case 228: - return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 229: - return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); case 230: - return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 231: - return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); case 232: - return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 233: - return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); case 234: - return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); case 235: - return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 236: - return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); case 237: - return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); case 238: - return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 239: - return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); case 240: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); case 241: - return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); case 242: - return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); case 243: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); case 244: - return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); case 245: - return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); case 246: - return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); case 247: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 248: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); case 249: - return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); case 250: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 251: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); case 252: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); case 253: - return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); case 254: - return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 255: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 256: + return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); case 257: - return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 258: - return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 259: - return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); case 260: - return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); case 261: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); case 262: - return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); case 263: - return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); case 264: - return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); case 265: - return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 266: - return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); case 267: - return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); case 268: - return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); case 269: + return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + case 270: + return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + case 271: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 272: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 292: + case 295: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 293: + case 296: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: return node; @@ -43784,52 +44639,52 @@ var ts; var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; - if ((kind > 0 && kind <= 143)) { + if ((kind > 0 && kind <= 144)) { return initial; } - if ((kind >= 159 && kind <= 174)) { + if ((kind >= 160 && kind <= 177)) { return initial; } var result = initial; switch (node.kind) { - case 207: case 210: - case 201: - case 226: - case 291: + case 213: + case 204: + case 229: + case 294: break; - case 144: + case 145: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 145: + case 146: result = reduceNode(node.expression, cbNode, result); break; - case 147: + case 148: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 148: + case 149: result = reduceNode(node.expression, cbNode, result); break; - case 149: + case 150: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 150: + case 151: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152: + case 153: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -43838,17 +44693,9 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 153: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; case 154: - result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; case 155: @@ -43856,50 +44703,58 @@ var ts; result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 175: - case 176: + case 156: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + case 178: + case 179: result = reduceNodes(node.elements, cbNodes, result); break; - case 177: + case 180: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 178: + case 181: result = reduceNodes(node.elements, cbNodes, result); break; - case 179: - result = reduceNodes(node.properties, cbNodes, result); - break; - case 180: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 181: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); - break; case 182: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); + result = reduceNodes(node.properties, cbNodes, result); break; case 183: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 184: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.argumentExpression, cbNode, result); + break; + case 185: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 184: + case 186: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 187: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 185: + case 188: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 187: + case 190: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -43907,121 +44762,121 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 188: + case 191: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 186: case 189: - case 190: - case 191: case 192: - case 198: - case 199: - case 204: - result = reduceNode(node.expression, cbNode, result); - break; case 193: case 194: + case 195: + case 201: + case 202: + case 207: + result = reduceNode(node.expression, cbNode, result); + break; + case 196: + case 197: result = reduceNode(node.operand, cbNode, result); break; - case 195: + case 198: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 196: + case 199: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 197: + case 200: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 200: + case 203: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 202: + case 205: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 203: + case 206: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; - case 206: + case 209: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; - case 208: + case 211: result = reduceNodes(node.statements, cbNodes, result); break; - case 209: + case 212: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 211: + case 214: result = reduceNode(node.expression, cbNode, result); break; - case 212: + case 215: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 213: + case 216: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 214: - case 221: + case 217: + case 224: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 215: + case 218: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216: - case 217: + case 219: + case 220: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 220: - case 224: + case 223: + case 227: result = reduceNode(node.expression, cbNode, result); break; - case 222: + case 225: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 223: + case 226: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225: + case 228: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 227: + case 230: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 228: + case 231: result = reduceNodes(node.declarations, cbNodes, result); break; - case 229: + case 232: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -44030,7 +44885,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 230: + case 233: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -44038,131 +44893,131 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 233: + case 236: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 234: + case 237: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 235: + case 238: result = reduceNodes(node.statements, cbNodes, result); break; - case 236: + case 239: result = reduceNodes(node.clauses, cbNodes, result); break; - case 238: + case 241: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 239: + case 242: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 240: + case 243: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 241: + case 244: result = reduceNode(node.name, cbNode, result); break; - case 242: - case 246: + case 245: + case 249: result = reduceNodes(node.elements, cbNodes, result); break; - case 243: - case 247: + case 246: + case 250: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 244: + case 247: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 245: + case 248: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 249: + case 252: result = reduceNode(node.expression, cbNode, result); break; - case 250: + case 253: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 254: + case 257: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 251: - case 252: + case 254: + case 255: result = reduceNode(node.tagName, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 258: + case 261: result = reduceNodes(node.properties, cbNodes, result); break; - case 253: + case 256: result = reduceNode(node.tagName, cbNode, result); break; - case 257: + case 260: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 259: - result = reduceNode(node.expression, cbNode, result); - break; - case 260: - result = reduceNode(node.expression, cbNode, result); - break; - case 261: - result = reduceNode(node.expression, cbNode, result); case 262: - result = reduceNodes(node.statements, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 263: - result = reduceNodes(node.types, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 264: - result = reduceNode(node.variableDeclaration, cbNode, result); - result = reduceNode(node.block, cbNode, result); - break; + result = reduceNode(node.expression, cbNode, result); case 265: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); + result = reduceNodes(node.statements, cbNodes, result); break; case 266: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.objectAssignmentInitializer, cbNode, result); + result = reduceNodes(node.types, cbNodes, result); break; case 267: - result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.variableDeclaration, cbNode, result); + result = reduceNode(node.block, cbNode, result); break; case 268: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; case 269: - result = reduceNodes(node.statements, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 292: + case 270: result = reduceNode(node.expression, cbNode, result); break; - case 293: + case 271: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 272: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 295: + result = reduceNode(node.expression, cbNode, result); + break; + case 296: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -44215,7 +45070,7 @@ var ts; return subtreeFlags; } function aggregateTransformFlagsForSubtree(node) { - if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 202)) { + if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 205)) { return 0; } return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes); @@ -44296,6 +45151,34 @@ var ts; return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; + function getNamedImportCount(node) { + if (!(node.importClause && node.importClause.namedBindings)) + return 0; + var names = node.importClause.namedBindings; + if (!names) + return 0; + if (!ts.isNamedImports(names)) + return 0; + return names.elements.length; + } + function containsDefaultReference(node) { + if (!node) + return false; + if (!ts.isNamedImports(node)) + return false; + return ts.some(node.elements, isNamedDefaultReference); + } + function isNamedDefaultReference(e) { + return e.propertyName && e.propertyName.escapedText === "default"; + } + function getImportNeedsImportStarHelper(node) { + return !!ts.getNamespaceDeclarationNode(node) || (getNamedImportCount(node) > 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper; + function getImportNeedsImportDefaultHelper(node) { + return ts.isDefaultImport(node) || (getNamedImportCount(node) === 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; var exportSpecifiers = ts.createMultiMap(); @@ -44305,18 +45188,20 @@ var ts; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; + var hasImportStarOrImportDefault = false; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 239: + case 242: externalImports.push(node); + hasImportStarOrImportDefault = getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 238: - if (node.moduleReference.kind === 249) { + case 241: + if (node.moduleReference.kind === 252) { externalImports.push(node); } break; - case 245: + case 248: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -44343,12 +45228,12 @@ var ts; } } break; - case 244: + case 247: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 209: + case 212: if (ts.hasModifier(node, 1)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -44356,7 +45241,7 @@ var ts; } } break; - case 229: + case 232: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -44374,7 +45259,7 @@ var ts; } } break; - case 230: + case 233: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -44394,9 +45279,10 @@ var ts; break; } } - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues); + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault); var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { + ts.addEmitFlags(externalHelpersImportDeclaration, 67108864); externalImports.unshift(externalHelpersImportDeclaration); } return { externalImports: externalImports, exportSpecifiers: exportSpecifiers, exportEquals: exportEquals, hasExportStarsToExportValues: hasExportStarsToExportValues, exportedBindings: exportedBindings, exportedNames: exportedNames, externalHelpersImportDeclaration: externalHelpersImportDeclaration }; @@ -44431,9 +45317,8 @@ var ts; return values; } function isSimpleCopiableExpression(expression) { - return expression.kind === 9 || + return ts.isStringLiteralLike(expression) || expression.kind === 8 || - expression.kind === 13 || ts.isKeyword(expression.kind) || ts.isIdentifier(expression); } @@ -44471,7 +45356,10 @@ var ts; }; if (value) { value = ts.visitNode(value, visitor, ts.isExpression); - if (needsValue) { + if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText)) { + value = ensureIdentifier(flattenContext, value, false, location); + } + else if (needsValue) { value = ensureIdentifier(flattenContext, value, true, location); } else if (ts.nodeIsSynthesized(node)) { @@ -44501,6 +45389,26 @@ var ts; } } ts.flattenDestructuringAssignment = flattenDestructuringAssignment; + function bindingOrAssignmentElementAssignsToName(element, escapedName) { + var target = ts.getTargetOfBindingOrAssignmentElement(element); + if (ts.isBindingOrAssignmentPattern(target)) { + return bindingOrAssignmentPatternAssignsToName(target, escapedName); + } + else if (ts.isIdentifier(target)) { + return target.escapedText === escapedName; + } + return false; + } + function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) { + var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; + if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { + return true; + } + } + return false; + } function flattenDestructuringBinding(node, visitor, context, level, rval, hoistTempVariables, skipInitializer) { var pendingExpressions; var pendingDeclarations = []; @@ -44517,6 +45425,13 @@ var ts; createArrayBindingOrAssignmentElement: makeBindingElement, visitor: visitor }; + if (ts.isVariableDeclaration(node)) { + var initializer = ts.getInitializerOfBindingOrAssignmentElement(node); + if (initializer && ts.isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText)) { + initializer = ensureIdentifier(flattenContext, initializer, false, initializer); + node = ts.updateVariableDeclaration(node, node.name, node.type, initializer); + } + } flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); if (pendingExpressions) { var temp = ts.createTempVariable(undefined); @@ -44772,8 +45687,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180); - context.enableSubstitution(181); + context.enableSubstitution(183); + context.enableSubstitution(184); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -44807,15 +45722,15 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 269: - case 236: - case 235: - case 208: + case 272: + case 239: + case 238: + case 211: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 230: - case 229: + case 233: + case 232: if (ts.hasModifier(node, 2)) { break; } @@ -44823,7 +45738,7 @@ var ts; recordEmittedDeclarationInScope(node); } else { - ts.Debug.assert(node.kind === 230 || ts.hasModifier(node, 512)); + ts.Debug.assert(node.kind === 233 || ts.hasModifier(node, 512)); } break; } @@ -44845,10 +45760,10 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 239: - case 238: - case 244: - case 245: + case 242: + case 241: + case 247: + case 248: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -44863,13 +45778,13 @@ var ts; return node; } switch (node.kind) { - case 239: + case 242: return visitImportDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); - case 244: + case 247: return visitExportAssignment(node); - case 245: + case 248: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -44879,11 +45794,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 245 || - node.kind === 239 || - node.kind === 240 || - (node.kind === 238 && - node.moduleReference.kind === 249)) { + if (node.kind === 248 || + node.kind === 242 || + node.kind === 243 || + (node.kind === 241 && + node.moduleReference.kind === 252)) { return undefined; } else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) { @@ -44899,15 +45814,15 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 153: - return undefined; - case 150: - case 158: case 154: + return undefined; + case 151: + case 159: case 155: - case 152: + case 156: + case 153: return visitorWorker(node); - case 207: + case 210: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -44937,85 +45852,86 @@ var ts; case 117: case 76: case 124: - case 131: - case 165: + case 132: case 166: - case 164: - case 159: - case 146: + case 167: + case 165: + case 160: + case 147: case 119: case 122: - case 136: - case 133: - case 130: - case 105: case 137: - case 162: - case 161: + case 134: + case 131: + case 105: + case 138: case 163: - case 160: - case 167: + case 162: + case 164: + case 161: case 168: case 169: case 170: - case 171: case 172: case 173: case 174: - case 158: - case 148: - case 232: + case 175: + case 176: + case 177: + case 159: + case 149: + case 235: return undefined; - case 150: + case 151: return visitPropertyDeclaration(node); - case 237: + case 240: return undefined; - case 153: - return visitConstructor(node); - case 231: - return ts.createNotEmittedStatement(node); - case 230: - return visitClassDeclaration(node); - case 200: - return visitClassExpression(node); - case 263: - return visitHeritageClause(node); - case 202: - return visitExpressionWithTypeArguments(node); - case 152: - return visitMethodDeclaration(node); case 154: - return visitGetAccessor(node); - case 155: - return visitSetAccessor(node); - case 229: - return visitFunctionDeclaration(node); - case 187: - return visitFunctionExpression(node); - case 188: - return visitArrowFunction(node); - case 147: - return visitParameter(node); - case 186: - return visitParenthesizedExpression(node); - case 185: - case 203: - return visitAssertionExpression(node); - case 182: - return visitCallExpression(node); - case 183: - return visitNewExpression(node); - case 204: - return visitNonNullExpression(node); - case 233: - return visitEnumDeclaration(node); - case 209: - return visitVariableStatement(node); - case 227: - return visitVariableDeclaration(node); + return visitConstructor(node); case 234: + return ts.createNotEmittedStatement(node); + case 233: + return visitClassDeclaration(node); + case 203: + return visitClassExpression(node); + case 266: + return visitHeritageClause(node); + case 205: + return visitExpressionWithTypeArguments(node); + case 153: + return visitMethodDeclaration(node); + case 155: + return visitGetAccessor(node); + case 156: + return visitSetAccessor(node); + case 232: + return visitFunctionDeclaration(node); + case 190: + return visitFunctionExpression(node); + case 191: + return visitArrowFunction(node); + case 148: + return visitParameter(node); + case 189: + return visitParenthesizedExpression(node); + case 188: + case 206: + return visitAssertionExpression(node); + case 185: + return visitCallExpression(node); + case 186: + return visitNewExpression(node); + case 207: + return visitNonNullExpression(node); + case 236: + return visitEnumDeclaration(node); + case 212: + return visitVariableStatement(node); + case 230: + return visitVariableDeclaration(node); + case 237: return visitModuleDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); default: ts.Debug.failBadSyntaxKind(node); @@ -45165,10 +46081,13 @@ var ts; ts.setTextRange(classExpression, node); if (ts.some(staticProperties) || ts.some(pendingExpressions)) { var expressions = []; - var temp = ts.createTempVariable(hoistVariableDeclaration); - if (resolver.getNodeCheckFlags(node) & 8388608) { + var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 8388608; + var temp = ts.createTempVariable(hoistVariableDeclaration, !!isClassWithConstructorReference); + if (isClassWithConstructorReference) { enableSubstitutionForClassAliases(); - classAliases[ts.getOriginalNodeId(node)] = ts.getSynthesizedClone(temp); + var alias = ts.getSynthesizedClone(temp); + alias.autoGenerateFlags &= ~16; + classAliases[ts.getOriginalNodeId(node)] = alias; } ts.setEmitFlags(classExpression, 65536 | ts.getEmitFlags(classExpression)); expressions.push(ts.startOnNewLine(ts.createAssignment(temp, classExpression))); @@ -45233,7 +46152,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 211 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -45267,7 +46186,7 @@ var ts; return isInitializedProperty(member, false); } function isInitializedProperty(member, isStatic) { - return member.kind === 150 + return member.kind === 151 && isStatic === ts.hasModifier(member, 32) && member.initializer !== undefined; } @@ -45342,12 +46261,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 154: case 155: + case 156: return getAllDecoratorsOfAccessors(node, member); - case 152: + case 153: return getAllDecoratorsOfMethod(member); - case 150: + case 151: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -45426,7 +46345,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 150 + ? member.kind === 151 ? ts.createVoidZero() : ts.createNull() : undefined; @@ -45510,37 +46429,37 @@ var ts; } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 152 - || kind === 154 + return kind === 153 || kind === 155 - || kind === 150; + || kind === 156 + || kind === 151; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 152; + return node.kind === 153; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 230: - case 200: + case 233: + case 203: return ts.getFirstConstructorWithBody(node) !== undefined; - case 152: - case 154: + case 153: case 155: + case 156: return true; } return false; } function serializeTypeOfNode(node) { switch (node.kind) { - case 150: - case 147: - case 154: - return serializeTypeNode(node.type); + case 151: + case 148: case 155: + return serializeTypeNode(node.type); + case 156: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 230: - case 200: - case 152: + case 233: + case 203: + case 153: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -45572,7 +46491,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 154) { + if (container && node.kind === 155) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -45595,26 +46514,26 @@ var ts; } switch (node.kind) { case 105: - case 139: + case 140: case 95: - case 130: + case 131: return ts.createVoidZero(); - case 169: + case 172: return serializeTypeNode(node.type); - case 161: case 162: + case 163: return ts.createIdentifier("Function"); - case 165: case 166: + case 167: return ts.createIdentifier("Array"); - case 159: + case 160: case 122: return ts.createIdentifier("Boolean"); - case 136: + case 137: return ts.createIdentifier("String"); - case 134: + case 135: return ts.createIdentifier("Object"); - case 174: + case 177: switch (node.literal.kind) { case 9: return ts.createIdentifier("String"); @@ -45628,24 +46547,24 @@ var ts; break; } break; - case 133: + case 134: return ts.createIdentifier("Number"); - case 137: + case 138: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 160: + case 161: return serializeTypeReferenceNode(node); + case 169: case 168: - case 167: return serializeUnionOrIntersectionType(node); - case 163: - case 171: - case 172: - case 173: case 164: + case 174: + case 175: + case 176: + case 165: case 119: - case 170: + case 173: break; default: ts.Debug.failBadSyntaxKind(node); @@ -45657,13 +46576,13 @@ var ts; var serializedUnion; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169) { + while (typeNode.kind === 172) { typeNode = typeNode.type; } - if (typeNode.kind === 130) { + if (typeNode.kind === 131) { continue; } - if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 139)) { + if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 140)) { continue; } var serializedIndividual = serializeTypeNode(typeNode); @@ -45725,7 +46644,7 @@ var ts; return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } return name; - case 144: + case 145: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -46035,11 +46954,11 @@ var ts; function addVarForEnumOrModuleDeclaration(statements, node) { var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, false, true)) - ], currentScope.kind === 269 ? 0 : 1)); + ], currentScope.kind === 272 ? 0 : 1)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 233) { + if (node.kind === 236) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -46100,7 +47019,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 235) { + if (body.kind === 238) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -46124,13 +47043,13 @@ var ts; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true); ts.setTextRange(block, blockLocation); - if (body.kind !== 235) { + if (body.kind !== 238) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 234) { + if (moduleDeclaration.body.kind === 237) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -46150,7 +47069,7 @@ var ts; return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 241) { + if (node.kind === 244) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -46285,15 +47204,15 @@ var ts; if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(71); - context.enableSubstitution(266); - context.enableEmitNotification(234); + context.enableSubstitution(269); + context.enableEmitNotification(237); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 234; + return ts.getOriginalNode(node).kind === 237; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 233; + return ts.getOriginalNode(node).kind === 236; } function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; @@ -46339,9 +47258,9 @@ var ts; switch (node.kind) { case 71: return substituteExpressionIdentifier(node); - case 180: + case 183: return substitutePropertyAccessExpression(node); - case 181: + case 184: return substituteElementAccessExpression(node); } return node; @@ -46371,9 +47290,9 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 269) { - var substitute = (applicableSubstitutions & 2 && container.kind === 234) || - (applicableSubstitutions & 8 && container.kind === 233); + if (container && container.kind !== 272) { + var substitute = (applicableSubstitutions & 2 && container.kind === 237) || + (applicableSubstitutions & 8 && container.kind === 236); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node); } @@ -46406,9 +47325,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } ts.transformTypeScript = transformTypeScript; @@ -46461,12 +47378,13 @@ var ts; var ts; (function (ts) { function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); var compilerOptions = context.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); var enabledSubstitutions; var enclosingSuperContainerFlags = 0; + var enclosingFunctionParameterNames; var previousOnEmitNode = context.onEmitNode; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; @@ -46487,20 +47405,96 @@ var ts; switch (node.kind) { case 120: return undefined; - case 192: + case 195: return visitAwaitExpression(node); - case 152: + case 153: return visitMethodDeclaration(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); - case 188: + case 191: return visitArrowFunction(node); default: return ts.visitEachChild(node, visitor, context); } } + function asyncBodyVisitor(node) { + if (ts.isNodeWithPossibleHoistedDeclaration(node)) { + switch (node.kind) { + case 212: + return visitVariableStatementInAsyncBody(node); + case 218: + return visitForStatementInAsyncBody(node); + case 219: + return visitForInStatementInAsyncBody(node); + case 220: + return visitForOfStatementInAsyncBody(node); + case 267: + return visitCatchClauseInAsyncBody(node); + case 211: + case 225: + case 239: + case 264: + case 265: + case 228: + case 216: + case 217: + case 215: + case 224: + case 226: + return ts.visitEachChild(node, asyncBodyVisitor, context); + default: + return ts.Debug.assertNever(node, "Unhandled node."); + } + } + return visitor(node); + } + function visitCatchClauseInAsyncBody(node) { + var catchClauseNames = ts.createUnderscoreEscapedMap(); + recordDeclarationName(node.variableDeclaration, catchClauseNames); + var catchClauseUnshadowedNames; + catchClauseNames.forEach(function (_, escapedName) { + if (enclosingFunctionParameterNames.has(escapedName)) { + if (!catchClauseUnshadowedNames) { + catchClauseUnshadowedNames = ts.cloneMap(enclosingFunctionParameterNames); + } + catchClauseUnshadowedNames.delete(escapedName); + } + }); + if (catchClauseUnshadowedNames) { + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = catchClauseUnshadowedNames; + var result = ts.visitEachChild(node, asyncBodyVisitor, context); + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; + } + else { + return ts.visitEachChild(node, asyncBodyVisitor, context); + } + } + function visitVariableStatementInAsyncBody(node) { + if (isVariableDeclarationListWithCollidingName(node.declarationList)) { + var expression = visitVariableDeclarationListWithCollidingNames(node.declarationList, false); + return expression ? ts.createStatement(expression) : undefined; + } + return ts.visitEachChild(node, visitor, context); + } + function visitForInStatementInAsyncBody(node) { + return ts.updateForIn(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForOfStatementInAsyncBody(node) { + return ts.updateForOf(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForStatementInAsyncBody(node) { + return ts.updateFor(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, false) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } function visitAwaitExpression(node) { return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); } @@ -46524,17 +47518,91 @@ var ts; ? transformAsyncFunctionBody(node) : ts.visitFunctionBody(node.body, visitor, context)); } + function recordDeclarationName(_a, names) { + var name = _a.name; + if (ts.isIdentifier(name)) { + names.set(name.escapedText, true); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + recordDeclarationName(element, names); + } + } + } + } + function isVariableDeclarationListWithCollidingName(node) { + return node + && ts.isVariableDeclarationList(node) + && !(node.flags & 3) + && ts.forEach(node.declarations, collidesWithParameterName); + } + function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { + hoistVariableDeclarationList(node); + var variables = ts.getInitializedVariables(node); + if (variables.length === 0) { + if (hasReceiver) { + return ts.visitNode(ts.convertToAssignmentElementTarget(node.declarations[0].name), visitor, ts.isExpression); + } + return undefined; + } + return ts.inlineExpressions(ts.map(variables, transformInitializedVariable)); + } + function hoistVariableDeclarationList(node) { + ts.forEach(node.declarations, hoistVariable); + } + function hoistVariable(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + hoistVariableDeclaration(name); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + hoistVariable(element); + } + } + } + } + function transformInitializedVariable(node) { + var converted = ts.setSourceMapRange(ts.createAssignment(ts.convertToAssignmentElementTarget(node.name), node.initializer), node); + return ts.visitNode(converted, visitor, ts.isExpression); + } + function collidesWithParameterName(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + return enclosingFunctionParameterNames.has(name.escapedText); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element) && collidesWithParameterName(element)) { + return true; + } + } + } + return false; + } function transformAsyncFunctionBody(node) { resumeLexicalEnvironment(); var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 188; + var isArrowFunction = node.kind === 191; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap(); + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + recordDeclarationName(parameter, enclosingFunctionParameterNames); + } + var result; if (!isArrowFunction) { var statements = []; var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset)))); ts.addRange(statements, endLexicalEnvironment()); var block = ts.createBlock(statements, true); ts.setTextRange(block, node.body); @@ -46548,27 +47616,28 @@ var ts; ts.addEmitHelper(block, ts.asyncSuperHelper); } } - return block; + result = block; } else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body)); var declarations = endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + result = ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + else { + result = expression; } - return expression; } + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; } - function transformFunctionBodyWorker(body, start) { + function transformAsyncFunctionBodyWorker(body, start) { if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + return ts.updateBlock(body, ts.visitNodes(body.statements, asyncBodyVisitor, ts.isStatement, start)); } else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + return ts.convertToFunctionBody(ts.visitNode(body, asyncBodyVisitor, ts.isConciseBody)); } } function getPromiseConstructor(type) { @@ -46585,14 +47654,14 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(182); - context.enableSubstitution(180); - context.enableSubstitution(181); - context.enableEmitNotification(230); - context.enableEmitNotification(152); - context.enableEmitNotification(154); - context.enableEmitNotification(155); + context.enableSubstitution(185); + context.enableSubstitution(183); + context.enableSubstitution(184); + context.enableEmitNotification(233); context.enableEmitNotification(153); + context.enableEmitNotification(155); + context.enableEmitNotification(156); + context.enableEmitNotification(154); } } function onEmitNode(hint, node, emitCallback) { @@ -46617,11 +47686,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180: + case 183: return substitutePropertyAccessExpression(node); - case 181: + case 184: return substituteElementAccessExpression(node); - case 182: + case 185: return substituteCallExpression(node); } return node; @@ -46652,11 +47721,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 - || kind === 153 - || kind === 152 + return kind === 233 || kind === 154 - || kind === 155; + || kind === 153 + || kind === 155 + || kind === 156; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -46736,45 +47805,45 @@ var ts; return node; } switch (node.kind) { - case 192: - return visitAwaitExpression(node); - case 198: - return visitYieldExpression(node); - case 223: - return visitLabeledStatement(node); - case 179: - return visitObjectLiteralExpression(node); case 195: + return visitAwaitExpression(node); + case 201: + return visitYieldExpression(node); + case 226: + return visitLabeledStatement(node); + case 182: + return visitObjectLiteralExpression(node); + case 198: return visitBinaryExpression(node, noDestructuringValue); - case 227: + case 230: return visitVariableDeclaration(node); - case 217: + case 220: return visitForOfStatement(node, undefined); - case 215: + case 218: return visitForStatement(node); - case 191: + case 194: return visitVoidExpression(node); - case 153: - return visitConstructorDeclaration(node); - case 152: - return visitMethodDeclaration(node); case 154: - return visitGetAccessorDeclaration(node); + return visitConstructorDeclaration(node); + case 153: + return visitMethodDeclaration(node); case 155: + return visitGetAccessorDeclaration(node); + case 156: return visitSetAccessorDeclaration(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); - case 188: + case 191: return visitArrowFunction(node); - case 147: + case 148: return visitParameter(node); - case 211: + case 214: return visitExpressionStatement(node); - case 186: + case 189: return visitParenthesizedExpression(node, noDestructuringValue); - case 264: + case 267: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -46794,21 +47863,21 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitLabeledStatement(node) { - if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + if (enclosingFunctionFlags & 2) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 217 && statement.awaitModifier) { + if (statement.kind === 220 && statement.awaitModifier) { return visitForOfStatement(statement, node); } - return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); } return ts.visitEachChild(node, visitor, context); } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 267) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 270) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -46817,16 +47886,9 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === 265) { - var p = e; - chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); - } - else { - chunkObject.push(ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); - } + chunkObject = ts.append(chunkObject, e.kind === 268 + ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) + : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } } if (chunkObject) { @@ -46837,7 +47899,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 1048576) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 179) { + if (objects.length && objects[0].kind !== 182) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -47088,14 +48150,14 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(182); - context.enableSubstitution(180); - context.enableSubstitution(181); - context.enableEmitNotification(230); - context.enableEmitNotification(152); - context.enableEmitNotification(154); - context.enableEmitNotification(155); + context.enableSubstitution(185); + context.enableSubstitution(183); + context.enableSubstitution(184); + context.enableEmitNotification(233); context.enableEmitNotification(153); + context.enableEmitNotification(155); + context.enableEmitNotification(156); + context.enableEmitNotification(154); } } function onEmitNode(hint, node, emitCallback) { @@ -47120,11 +48182,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180: + case 183: return substitutePropertyAccessExpression(node); - case 181: + case 184: return substituteElementAccessExpression(node); - case 182: + case 185: return substituteCallExpression(node); } return node; @@ -47155,11 +48217,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 - || kind === 153 - || kind === 152 + return kind === 233 || kind === 154 - || kind === 155; + || kind === 153 + || kind === 155 + || kind === 156; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -47222,7 +48284,7 @@ var ts; var asyncValues = { name: "typescript:asyncValues", scoped: false, - text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + text: "\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " }; function createAsyncValuesHelper(context, expression, location) { context.requestEmitHelper(asyncValues); @@ -47254,13 +48316,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 250: + case 253: return visitJsxElement(node, false); - case 251: - return visitJsxSelfClosingElement(node, false); case 254: + return visitJsxSelfClosingElement(node, false); + case 257: return visitJsxFragment(node, false); - case 260: + case 263: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -47270,13 +48332,13 @@ var ts; switch (node.kind) { case 10: return visitJsxText(node); - case 260: + case 263: return visitJsxExpression(node); - case 250: + case 253: return visitJsxElement(node, true); - case 251: - return visitJsxSelfClosingElement(node, true); case 254: + return visitJsxSelfClosingElement(node, true); + case 257: return visitJsxFragment(node, true); default: ts.Debug.failBadSyntaxKind(node); @@ -47341,7 +48403,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 260) { + else if (node.kind === 263) { if (node.expression === undefined) { return ts.createTrue(); } @@ -47401,7 +48463,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 250) { + if (node.kind === 253) { return getTagName(node.openingElement); } else { @@ -47701,7 +48763,7 @@ var ts; return node; } switch (node.kind) { - case 195: + case 198: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -47791,13 +48853,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return hierarchyFacts & 4096 - && node.kind === 220 + && node.kind === 223 && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 208))) + || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 211))) || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)) || (ts.getEmitFlags(node) & 33554432) !== 0; } @@ -47825,63 +48887,63 @@ var ts; switch (node.kind) { case 115: return undefined; - case 230: + case 233: return visitClassDeclaration(node); - case 200: + case 203: return visitClassExpression(node); - case 147: + case 148: return visitParameter(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 188: + case 191: return visitArrowFunction(node); - case 187: + case 190: return visitFunctionExpression(node); - case 227: + case 230: return visitVariableDeclaration(node); case 71: return visitIdentifier(node); - case 228: + case 231: return visitVariableDeclarationList(node); - case 222: + case 225: return visitSwitchStatement(node); - case 236: + case 239: return visitCaseBlock(node); - case 208: - return visitBlock(node, false); - case 219: - case 218: - return visitBreakOrContinueStatement(node); - case 223: - return visitLabeledStatement(node); - case 213: - case 214: - return visitDoOrWhileStatement(node, undefined); - case 215: - return visitForStatement(node, undefined); - case 216: - return visitForInStatement(node, undefined); - case 217: - return visitForOfStatement(node, undefined); case 211: + return visitBlock(node, false); + case 222: + case 221: + return visitBreakOrContinueStatement(node); + case 226: + return visitLabeledStatement(node); + case 216: + case 217: + return visitDoOrWhileStatement(node, undefined); + case 218: + return visitForStatement(node, undefined); + case 219: + return visitForInStatement(node, undefined); + case 220: + return visitForOfStatement(node, undefined); + case 214: return visitExpressionStatement(node); - case 179: - return visitObjectLiteralExpression(node); - case 264: - return visitCatchClause(node); - case 266: - return visitShorthandPropertyAssignment(node); - case 145: - return visitComputedPropertyName(node); - case 178: - return visitArrayLiteralExpression(node); case 182: + return visitObjectLiteralExpression(node); + case 267: + return visitCatchClause(node); + case 269: + return visitShorthandPropertyAssignment(node); + case 146: + return visitComputedPropertyName(node); + case 181: + return visitArrayLiteralExpression(node); + case 185: return visitCallExpression(node); - case 183: - return visitNewExpression(node); case 186: + return visitNewExpression(node); + case 189: return visitParenthesizedExpression(node, true); - case 195: + case 198: return visitBinaryExpression(node, true); case 13: case 14: @@ -47892,28 +48954,28 @@ var ts; return visitStringLiteral(node); case 8: return visitNumericLiteral(node); - case 184: + case 187: return visitTaggedTemplateExpression(node); - case 197: + case 200: return visitTemplateExpression(node); - case 198: + case 201: return visitYieldExpression(node); - case 199: + case 202: return visitSpreadElement(node); case 97: return visitSuperKeyword(false); case 99: return visitThisKeyword(node); - case 205: + case 208: return visitMetaProperty(node); - case 152: + case 153: return visitMethodDeclaration(node); - case 154: case 155: + case 156: return visitAccessorDeclaration(node); - case 209: + case 212: return visitVariableStatement(node); - case 220: + case 223: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -47994,13 +49056,13 @@ var ts; } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 219 ? 2 : 4; + var jump = node.kind === 222 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 219) { + if (node.kind === 222) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -48010,7 +49072,7 @@ var ts; } } else { - if (node.kind === 219) { + if (node.kind === 222) { labelMarker = "break-" + node.label.escapedText; setLabeledJump(convertedLoopState, true, ts.idText(node.label), labelMarker); } @@ -48106,7 +49168,7 @@ var ts; } function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), extendsClauseElement)); + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getInternalName(node))), extendsClauseElement)); } } function addConstructor(statements, node, extendsClauseElement) { @@ -48174,17 +49236,17 @@ var ts; return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 220) { + if (statement.kind === 223) { return true; } - else if (statement.kind === 212) { + else if (statement.kind === 215) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 208) { + else if (statement.kind === 211) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -48213,7 +49275,7 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 211 && ts.isSuperCall(firstStatement.expression)) { + if (firstStatement.kind === 214 && ts.isSuperCall(firstStatement.expression)) { superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } @@ -48221,8 +49283,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 | 32768))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 195 - || superCallExpression.left.kind !== 182) { + if (superCallExpression.kind !== 198 + || superCallExpression.left.kind !== 185) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536))); @@ -48323,7 +49385,7 @@ var ts; statements.push(forStatement); } function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 && node.kind !== 188) { + if (node.transformFlags & 32768 && node.kind !== 191) { captureThisForNode(statements, node, ts.createThis()); } } @@ -48341,18 +49403,18 @@ var ts; if (hierarchyFacts & 16384) { var newTarget = void 0; switch (node.kind) { - case 188: + case 191: return statements; - case 152: - case 154: + case 153: case 155: + case 156: newTarget = ts.createVoidZero(); break; - case 153: + case 154: newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"); break; - case 229: - case 187: + case 232: + case 190: newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 93, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero()); break; default: @@ -48373,20 +49435,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 207: + case 210: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 152: + case 153: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 154: case 155: + case 156: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 153: + case 154: break; default: ts.Debug.failBadSyntaxKind(node); @@ -48511,7 +49573,7 @@ var ts; : enterSubtree(16286, 65); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 && !name && (node.kind === 229 || node.kind === 187)) { + if (hierarchyFacts & 16384 && !name && (node.kind === 232 || node.kind === 190)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152, 0); @@ -48545,7 +49607,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 188); + ts.Debug.assert(node.kind === 191); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -48597,9 +49659,9 @@ var ts; } function visitExpressionStatement(node) { switch (node.expression.kind) { - case 186: + case 189: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false)); - case 195: + case 198: return ts.updateStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); @@ -48607,9 +49669,9 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { if (!needsDestructuringValue) { switch (node.expression.kind) { - case 186: + case 189: return ts.updateParen(node, visitParenthesizedExpression(node.expression, false)); - case 195: + case 198: return ts.updateParen(node, visitBinaryExpression(node.expression, false)); } } @@ -48735,14 +49797,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 213: - case 214: - return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 215: - return visitForStatement(node, outermostLabeledStatement); case 216: - return visitForInStatement(node, outermostLabeledStatement); case 217: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 218: + return visitForStatement(node, outermostLabeledStatement); + case 219: + return visitForInStatement(node, outermostLabeledStatement); + case 220: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -48868,7 +49930,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 145) { + if (property.name.kind === 146) { numInitialProperties = i; break; } @@ -48930,11 +49992,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 215: - case 216: - case 217: + case 218: + case 219: + case 220: var initializer = node.initializer; - if (initializer && initializer.kind === 228) { + if (initializer && initializer.kind === 231) { loopInitializer = initializer; } break; @@ -49160,20 +50222,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 154: case 155: + case 156: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 152: + case 153: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 265: + case 268: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 266: + case 269: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -49247,7 +50309,7 @@ var ts; if (node.transformFlags & 32768) { var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 154) { + if (node.kind === 155) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -49327,26 +50389,31 @@ var ts; return visitCallExpressionWithPotentialCapturedThisAssignment(node, false); } function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { - var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - if (node.expression.kind === 97) { - ts.setEmitFlags(thisArg, 4); + if (node.transformFlags & 524288 || + node.expression.kind === 97 || + ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) { + var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + if (node.expression.kind === 97) { + ts.setEmitFlags(thisArg, 4); + } + var resultingCall = void 0; + if (node.transformFlags & 524288) { + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); + } + else { + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); + } + if (node.expression.kind === 97) { + var actualThis = ts.createThis(); + ts.setEmitFlags(actualThis, 4); + var initializer = ts.createLogicalOr(resultingCall, actualThis); + resultingCall = assignToCapturedThis + ? ts.createAssignment(ts.createIdentifier("_this"), initializer) + : initializer; + } + return ts.setOriginalNode(resultingCall, node); } - var resultingCall; - if (node.transformFlags & 524288) { - resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); - } - else { - resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); - } - if (node.expression.kind === 97) { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4); - var initializer = ts.createLogicalOr(resultingCall, actualThis); - resultingCall = assignToCapturedThis - ? ts.createAssignment(ts.createIdentifier("_this"), initializer) - : initializer; - } - return ts.setOriginalNode(resultingCall, node); + return ts.visitEachChild(node, visitor, context); } function visitNewExpression(node) { if (node.transformFlags & 524288) { @@ -49375,7 +50442,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 178 + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 181 ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -49521,13 +50588,13 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(99); - context.enableEmitNotification(153); - context.enableEmitNotification(152); context.enableEmitNotification(154); + context.enableEmitNotification(153); context.enableEmitNotification(155); - context.enableEmitNotification(188); - context.enableEmitNotification(187); - context.enableEmitNotification(229); + context.enableEmitNotification(156); + context.enableEmitNotification(191); + context.enableEmitNotification(190); + context.enableEmitNotification(232); } } function onSubstituteNode(hint, node) { @@ -49552,10 +50619,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 177: - case 230: + case 180: case 233: - case 227: + case 236: + case 230: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -49616,11 +50683,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 211) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 214) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 182) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 185) { return false; } var callTarget = statementExpression.expression; @@ -49628,7 +50695,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 199) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 202) { return false; } var expression = callArgument.expression; @@ -49672,24 +50739,24 @@ var ts; if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(252); - context.enableEmitNotification(253); - context.enableEmitNotification(251); + context.enableEmitNotification(255); + context.enableEmitNotification(256); + context.enableEmitNotification(254); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180); - context.enableSubstitution(265); + context.enableSubstitution(183); + context.enableSubstitution(268); return transformSourceFile; function transformSourceFile(node) { return node; } function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 252: - case 253: - case 251: + case 255: + case 256: + case 254: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -49805,13 +50872,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 213: + case 216: return visitDoStatement(node); - case 214: + case 217: return visitWhileStatement(node); - case 222: + case 225: return visitSwitchStatement(node); - case 223: + case 226: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -49819,24 +50886,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); - case 154: case 155: + case 156: return visitAccessorDeclaration(node); - case 209: + case 212: return visitVariableStatement(node); - case 215: - return visitForStatement(node); - case 216: - return visitForInStatement(node); - case 219: - return visitBreakStatement(node); case 218: + return visitForStatement(node); + case 219: + return visitForInStatement(node); + case 222: + return visitBreakStatement(node); + case 221: return visitContinueStatement(node); - case 220: + case 223: return visitReturnStatement(node); default: if (node.transformFlags & 16777216) { @@ -49852,21 +50919,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 195: - return visitBinaryExpression(node); - case 196: - return visitConditionalExpression(node); case 198: + return visitBinaryExpression(node); + case 199: + return visitConditionalExpression(node); + case 201: return visitYieldExpression(node); - case 178: - return visitArrayLiteralExpression(node); - case 179: - return visitObjectLiteralExpression(node); case 181: - return visitElementAccessExpression(node); + return visitArrayLiteralExpression(node); case 182: + return visitObjectLiteralExpression(node); + case 184: + return visitElementAccessExpression(node); + case 185: return visitCallExpression(node); - case 183: + case 186: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -49874,9 +50941,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -50033,10 +51100,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 180: + case 183: target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 181: + case 184: target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -50237,35 +51304,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 208: - return transformAndEmitBlock(node); case 211: - return transformAndEmitExpressionStatement(node); - case 212: - return transformAndEmitIfStatement(node); - case 213: - return transformAndEmitDoStatement(node); + return transformAndEmitBlock(node); case 214: - return transformAndEmitWhileStatement(node); + return transformAndEmitExpressionStatement(node); case 215: - return transformAndEmitForStatement(node); + return transformAndEmitIfStatement(node); case 216: - return transformAndEmitForInStatement(node); + return transformAndEmitDoStatement(node); + case 217: + return transformAndEmitWhileStatement(node); case 218: - return transformAndEmitContinueStatement(node); + return transformAndEmitForStatement(node); case 219: - return transformAndEmitBreakStatement(node); - case 220: - return transformAndEmitReturnStatement(node); + return transformAndEmitForInStatement(node); case 221: - return transformAndEmitWithStatement(node); + return transformAndEmitContinueStatement(node); case 222: - return transformAndEmitSwitchStatement(node); + return transformAndEmitBreakStatement(node); case 223: - return transformAndEmitLabeledStatement(node); + return transformAndEmitReturnStatement(node); case 224: - return transformAndEmitThrowStatement(node); + return transformAndEmitWithStatement(node); case 225: + return transformAndEmitSwitchStatement(node); + case 226: + return transformAndEmitLabeledStatement(node); + case 227: + return transformAndEmitThrowStatement(node); + case 228: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -50559,7 +51626,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 262 && defaultClauseIndex === -1) { + if (clause.kind === 265 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -50569,13 +51636,12 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 261) { - var caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (clause.kind === 264) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } - pendingClauses.push(ts.createCaseClause(ts.visitNode(caseClause.expression, visitor, ts.isExpression), [ - createInlineBreak(clauseLabels[i], caseClause.expression) + pendingClauses.push(ts.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [ + createInlineBreak(clauseLabels[i], clause.expression) ])); } else { @@ -51385,11 +52451,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71); - context.enableSubstitution(195); - context.enableSubstitution(193); - context.enableSubstitution(194); - context.enableSubstitution(266); - context.enableEmitNotification(269); + context.enableSubstitution(198); + context.enableSubstitution(196); + context.enableSubstitution(197); + context.enableSubstitution(269); + context.enableEmitNotification(272); var moduleInfoMap = []; var deferredExports = []; var currentSourceFile; @@ -51440,7 +52506,7 @@ var ts; var define = ts.createIdentifier("define"); var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var _a = collectAsynchronousDependencies(node, true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([ ts.createArrayLiteral([ ts.createLiteral("require"), @@ -51452,6 +52518,8 @@ var ts; ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) ]))) ]), node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } function transformUMDModule(node) { var _a = collectAsynchronousDependencies(node, false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; @@ -51475,7 +52543,7 @@ var ts; ]))) ]))) ], true), undefined)); - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(umdHeader, undefined, [ ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ ts.createParameter(undefined, undefined, undefined, "require"), @@ -51483,6 +52551,8 @@ var ts; ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) ])) ]), node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } function collectAsynchronousDependencies(node, includeNonAmdDependencies) { var aliasedModuleNames = []; @@ -51515,6 +52585,17 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } + function getAMDImportExpressionForImport(node) { + if (ts.isImportEqualsDeclaration(node) || ts.isExportDeclaration(node) || !ts.getExternalModuleNameLiteral(node, currentSourceFile, host, resolver, compilerOptions)) { + return undefined; + } + var name = ts.getLocalNameForExternalImport(node, currentSourceFile); + var expr = getHelperExpressionForImport(node, name); + if (expr === name) { + return undefined; + } + return ts.createStatement(ts.createAssignment(name, expr)); + } function transformAsynchronousModuleBody(node) { startLexicalEnvironment(); var statements = []; @@ -51523,6 +52604,9 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + if (moduleKind === ts.ModuleKind.AMD) { + ts.addRange(statements, ts.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); + } ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); addExportEqualsIfNeeded(statements, true); ts.addRange(statements, endLexicalEnvironment()); @@ -51556,23 +52640,23 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 239: + case 242: return visitImportDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); - case 245: + case 248: return visitExportDeclaration(node); - case 244: + case 247: return visitExportAssignment(node); - case 209: + case 212: return visitVariableStatement(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 230: + case 233: return visitClassDeclaration(node); - case 294: + case 297: return visitMergeDeclarationMarker(node); - case 295: + case 298: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, importCallExpressionVisitor, context); @@ -51633,11 +52717,20 @@ var ts; ts.setEmitFlags(func, 8); } } - return ts.createNew(ts.createIdentifier("Promise"), undefined, [func]); + var promise = ts.createNew(ts.createIdentifier("Promise"), undefined, [func]); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.createPropertyAccess(promise, ts.createIdentifier("then")), undefined, [ts.getHelperName("__importStar")]); + } + return promise; } function createImportCallExpressionCommonJS(arg, containsLexicalThis) { var promiseResolveCall = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Promise"), "resolve"), undefined, []); var requireCall = ts.createCall(ts.createIdentifier("require"), undefined, arg ? [arg] : []); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + requireCall = ts.createCall(ts.getHelperName("__importStar"), undefined, [requireCall]); + } var func; if (languageVersion >= 2) { func = ts.createArrowFunction(undefined, undefined, [], undefined, undefined, requireCall); @@ -51650,6 +52743,20 @@ var ts; } return ts.createCall(ts.createPropertyAccess(promiseResolveCall, "then"), undefined, [func]); } + function getHelperExpressionForImport(node, innerExpr) { + if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864) { + return innerExpr; + } + if (ts.getImportNeedsImportStarHelper(node)) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.getHelperName("__importStar"), undefined, [innerExpr]); + } + if (ts.getImportNeedsImportDefaultHelper(node)) { + context.requestEmitHelper(importDefaultHelper); + return ts.createCall(ts.getHelperName("__importDefault"), undefined, [innerExpr]); + } + return innerExpr; + } function visitImportDeclaration(node) { var statements; var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); @@ -51660,10 +52767,10 @@ var ts; else { var variables = []; if (namespaceDeclaration && !ts.isDefaultImport(node)) { - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, createRequireCall(node))); + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, getHelperExpressionForImport(node, createRequireCall(node)))); } else { - variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, createRequireCall(node))); + variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, getHelperExpressionForImport(node, createRequireCall(node)))); if (namespaceDeclaration && ts.isDefaultImport(node)) { variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node))); } @@ -51838,7 +52945,7 @@ var ts; } } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -51870,10 +52977,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241: + case 244: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242: + case 245: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -51981,7 +53088,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269) { + if (node.kind === 272) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -52023,10 +53130,10 @@ var ts; switch (node.kind) { case 71: return substituteExpressionIdentifier(node); - case 195: + case 198: return substituteBinaryExpression(node); - case 194: - case 193: + case 197: + case 196: return substituteUnaryExpression(node); } return node; @@ -52041,7 +53148,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 269) { + if (exportContainer && exportContainer.kind === 272) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node); } var importDeclaration = resolver.getReferencedImportDeclaration(node); @@ -52084,7 +53191,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 + var expression = node.kind === 197 ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 ? 59 : 60), ts.createLiteral(1)), node) : node; for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { @@ -52125,6 +53232,16 @@ var ts; scoped: true, text: "\n var __syncRequire = typeof module === \"object\" && typeof module.exports === \"object\";" }; + var importStarHelper = { + name: "typescript:commonjsimportstar", + scoped: false, + text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n}" + }; + var importDefaultHelper = { + name: "typescript:commonjsimportdefault", + scoped: false, + text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n}" + }; })(ts || (ts = {})); var ts; (function (ts) { @@ -52138,10 +53255,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71); - context.enableSubstitution(195); - context.enableSubstitution(193); - context.enableSubstitution(194); - context.enableEmitNotification(269); + context.enableSubstitution(269); + context.enableSubstitution(198); + context.enableSubstitution(196); + context.enableSubstitution(197); + context.enableEmitNotification(272); var moduleInfoMap = []; var deferredExports = []; var exportFunctionsMap = []; @@ -52245,7 +53363,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 245 && externalImport.exportClause) { + if (externalImport.kind === 248 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -52268,14 +53386,13 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 245) { + if (externalImport.kind !== 248) { continue; } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { continue; } - for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { + for (var _f = 0, _g = externalImport.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(ts.idText(element.name || element.propertyName)), ts.createTrue())); } @@ -52312,23 +53429,23 @@ var ts; function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { - var group = dependencyGroups_1[_i]; - var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); + var group_1 = dependencyGroups_1[_i]; + var localName = ts.forEach(group_1.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName(""); var statements = []; - for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) { + for (var _a = 0, _b = group_1.externalImports; _a < _b.length; _a++) { var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 239: + case 242: if (!entry.importClause) { break; } - case 238: + case 241: ts.Debug.assert(importVariableName !== undefined); statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 245: + case 248: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { var properties = []; @@ -52350,13 +53467,13 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 239: + case 242: return visitImportDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); - case 245: + case 248: return undefined; - case 244: + case 247: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -52477,7 +53594,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 2097152) === 0 - && (enclosingBlockScopedContainer.kind === 269 + && (enclosingBlockScopedContainer.kind === 272 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -52499,7 +53616,7 @@ var ts; : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -52532,10 +53649,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241: + case 244: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242: + case 245: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -52635,43 +53752,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 209: + case 212: return visitVariableStatement(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 230: + case 233: return visitClassDeclaration(node); - case 215: + case 218: return visitForStatement(node); - case 216: + case 219: return visitForInStatement(node); - case 217: + case 220: return visitForOfStatement(node); - case 213: + case 216: return visitDoStatement(node); - case 214: + case 217: return visitWhileStatement(node); - case 223: + case 226: return visitLabeledStatement(node); - case 221: + case 224: return visitWithStatement(node); - case 222: - return visitSwitchStatement(node); - case 236: - return visitCaseBlock(node); - case 261: - return visitCaseClause(node); - case 262: - return visitDefaultClause(node); case 225: - return visitTryStatement(node); + return visitSwitchStatement(node); + case 239: + return visitCaseBlock(node); case 264: + return visitCaseClause(node); + case 265: + return visitDefaultClause(node); + case 228: + return visitTryStatement(node); + case 267: return visitCatchClause(node); - case 208: + case 211: return visitBlock(node); - case 294: + case 297: return visitMergeDeclarationMarker(node); - case 295: + case 298: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -52768,7 +53885,7 @@ var ts; } function destructuringAndImportCallVisitor(node) { if (node.transformFlags & 1024 - && node.kind === 195) { + && node.kind === 198) { return visitDestructuringAssignment(node); } else if (ts.isImportCall(node)) { @@ -52811,7 +53928,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 269; + return container !== undefined && container.kind === 272; } else { return false; @@ -52826,7 +53943,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269) { + if (node.kind === 272) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -52853,16 +53970,41 @@ var ts; if (hint === 1) { return substituteExpression(node); } + else if (hint === 4) { + return substituteUnspecified(node); + } + return node; + } + function substituteUnspecified(node) { + switch (node.kind) { + case 269: + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + if (!ts.isGeneratedIdentifier(name) && !ts.isLocalName(name)) { + var importDeclaration = resolver.getReferencedImportDeclaration(name); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"))), node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name))), node); + } + } + } return node; } function substituteExpression(node) { switch (node.kind) { case 71: return substituteExpressionIdentifier(node); - case 195: + case 198: return substituteBinaryExpression(node); - case 193: - case 194: + case 196: + case 197: return substituteUnaryExpression(node); } return node; @@ -52914,14 +54056,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 + var expression = node.kind === 197 ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 194) { + if (node.kind === 197) { expression = node.operator === 43 ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -52938,7 +54080,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 269) { + if (exportContainer && exportContainer.kind === 272) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -52966,7 +54108,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(269); + context.enableEmitNotification(272); context.enableSubstitution(71); var currentSourceFile; return transformSourceFile; @@ -52979,7 +54121,9 @@ var ts; if (externalHelpersModuleName) { var statements = []; var statementOffset = ts.addPrologue(statements, node.statements); - ts.append(statements, ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + var tslibImport = ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); + ts.addEmitFlags(tslibImport, 67108864); + ts.append(statements, tslibImport); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } @@ -52991,9 +54135,9 @@ var ts; } function visitor(node) { switch (node.kind) { - case 238: + case 241: return undefined; - case 244: + case 247: return visitExportAssignment(node); } return node; @@ -53075,7 +54219,7 @@ var ts; } ts.getTransformers = getTransformers; function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(296); + var enabledSyntaxKindFeatures = new Array(299); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -53335,7 +54479,7 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (sourceFileOrBundle.kind === 269) { + if (sourceFileOrBundle.kind === 272) { sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { @@ -53442,7 +54586,7 @@ var ts; source = undefined; if (source) setSourceFile(source); - if (node.kind !== 291 + if (node.kind !== 294 && (emitFlags & 16) === 0 && pos >= 0) { emitPos(skipSourceTrivia(pos)); @@ -53459,7 +54603,7 @@ var ts; } if (source) setSourceFile(source); - if (node.kind !== 291 + if (node.kind !== 294 && (emitFlags & 32) === 0 && end >= 0) { emitPos(end); @@ -53468,9 +54612,9 @@ var ts; setSourceFile(oldSource); } } - function emitTokenWithSourceMap(node, token, tokenPos, emitCallback) { + function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) { if (disabled) { - return emitCallback(token, tokenPos); + return emitCallback(token, writer, tokenPos); } var emitNode = node && node.emitNode; var emitFlags = emitNode && emitNode.flags; @@ -53479,7 +54623,7 @@ var ts; if ((emitFlags & 128) === 0 && tokenPos >= 0) { emitPos(tokenPos); } - tokenPos = emitCallback(token, tokenPos); + tokenPos = emitCallback(token, writer, tokenPos); if (range) tokenPos = range.end; if ((emitFlags & 256) === 0 && tokenPos >= 0) { @@ -53495,7 +54639,7 @@ var ts; currentSourceText = currentSource.text; var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true); - sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source); if (sourceMapSourceIndex === -1) { sourceMapSourceIndex = sourceMapData.sourceMapSources.length; sourceMapData.sourceMapSources.push(source); @@ -53601,7 +54745,7 @@ var ts; if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 291; + var isEmittedNode = node.kind !== 294; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 10; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 10; if (!skipLeadingComments) { @@ -53615,7 +54759,7 @@ var ts; } if (!skipTrailingComments) { containerEnd = end; - if (node.kind === 228) { + if (node.kind === 231) { declarationListContainerEnd = end; } } @@ -53895,8 +55039,8 @@ var ts; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; - var isBundledEmit = sourceFileOrBundle.kind === 270; + var sourceFiles = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 273; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -53958,7 +55102,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 239); + ts.Debug.assert(aliasEmitInfo.node.kind === 242); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -53975,7 +55119,7 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } - if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { + if (!isBundledEmit && ts.isExternalModule(sourceFile) && !resultHasExternalModuleIndicator) { write("export {};"); writeLine(); } @@ -54032,10 +55176,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 227) { + if (declaration.kind === 230) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 242 || declaration.kind === 243 || declaration.kind === 240) { + else if (declaration.kind === 245 || declaration.kind === 246 || declaration.kind === 243) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -54046,7 +55190,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 239) { + if (moduleElementEmitInfo.node.kind === 242) { moduleElementEmitInfo.isVisible = true; } else { @@ -54054,12 +55198,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 234) { + if (nodeToCheck.kind === 237) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 234) { + if (nodeToCheck.kind === 237) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -54127,7 +55271,7 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - var shouldUseResolverType = declaration.kind === 147 && + var shouldUseResolverType = declaration.kind === 148 && (resolver.isRequiredInitializedParameter(declaration) || resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { @@ -54135,9 +55279,9 @@ var ts; } else { errorNameNode = declaration.name; - var format = 4 | - 16384 | - (shouldUseResolverType ? 8192 : 0); + var format = 4096 | 8 | + 2048 | + (shouldUseResolverType ? 131072 : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } @@ -54150,7 +55294,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 16384, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4096 | 8 | 2048, writer); errorNameNode = undefined; } } @@ -54190,50 +55334,54 @@ var ts; function emitType(type) { switch (type.kind) { case 119: - case 136: - case 133: - case 122: - case 134: case 137: + case 134: + case 122: + case 135: + case 138: case 105: - case 139: + case 140: case 95: - case 130: - case 170: - case 174: - return writeTextOfNode(currentText, type); - case 202: - return emitExpressionWithTypeArguments(type); - case 160: - return emitTypeReference(type); - case 163: - return emitTypeQuery(type); - case 165: - return emitArrayType(type); - case 166: - return emitTupleType(type); - case 167: - return emitUnionType(type); - case 168: - return emitIntersectionType(type); - case 169: - return emitParenType(type); - case 171: - return emitTypeOperator(type); - case 172: - return emitIndexedAccessType(type); + case 131: case 173: - return emitMappedType(type); + case 177: + return writeTextOfNode(currentText, type); + case 205: + return emitExpressionWithTypeArguments(type); case 161: - case 162: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 164: + return emitTypeQuery(type); + case 166: + return emitArrayType(type); + case 167: + return emitTupleType(type); + case 168: + return emitUnionType(type); + case 169: + return emitIntersectionType(type); + case 170: + return emitConditionalType(type); + case 171: + return emitInferType(type); + case 172: + return emitParenType(type); + case 174: + return emitTypeOperator(type); + case 175: + return emitIndexedAccessType(type); + case 176: + return emitMappedType(type); + case 162: + case 163: + return emitSignatureDeclarationWithJsDocComments(type); + case 165: return emitTypeLiteral(type); case 71: return emitEntityName(type); - case 144: + case 145: return emitEntityName(type); - case 159: + case 160: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -54241,22 +55389,22 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 144 ? entityName.left : entityName.expression; - var right = entityName.kind === 144 ? entityName.right : entityName.name; + var left = entityName.kind === 145 ? entityName.left : entityName.expression; + var right = entityName.kind === 145 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 238 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 241 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 71 || node.expression.kind === 180); + ts.Debug.assert(node.expression.kind === 71 || node.expression.kind === 183); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -54297,6 +55445,22 @@ var ts; function emitIntersectionType(type) { emitSeparatedList(type.types, " & ", emitType); } + function emitConditionalType(node) { + emitType(node.checkType); + write(" extends "); + emitType(node.extendsType); + write(" ? "); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node.trueType; + emitType(node.trueType); + enclosingDeclaration = prevEnclosingDeclaration; + write(" : "); + emitType(node.falseType); + } + function emitInferType(node) { + write("infer "); + writeTextOfNode(currentText, node.typeParameter.name); + } function emitParenType(type) { write("("); emitType(type.type); @@ -54320,7 +55484,9 @@ var ts; writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === 37 ? "+readonly " : + node.readonlyToken.kind === 38 ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -54328,7 +55494,9 @@ var ts; emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === 37 ? "+?" : + node.questionToken.kind === 38 ? "-?" : + "?"); } write(": "); emitType(node.type); @@ -54380,12 +55548,15 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 16384, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4096 | 8 | 2048, writer); write(";"); writeLine(); return tempVarName; } function emitExportAssignment(node) { + if (ts.isSourceFile(node.parent)) { + resultHasExternalModuleIndicator = true; + } if (node.expression.kind === 71) { write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentText, node.expression); @@ -54412,10 +55583,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 238 || - (node.parent.kind === 269 && isCurrentFileExternalModule)) { + else if (node.kind === 241 || + (node.parent.kind === 272 && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 269) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 272) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -54424,7 +55595,7 @@ var ts; }); } else { - if (node.kind === 239) { + if (node.kind === 242) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -54442,38 +55613,39 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 229: - return writeFunctionDeclaration(node); - case 209: - return writeVariableStatement(node); - case 231: - return writeInterfaceDeclaration(node); - case 230: - return writeClassDeclaration(node); case 232: - return writeTypeAliasDeclaration(node); - case 233: - return writeEnumDeclaration(node); + return writeFunctionDeclaration(node); + case 212: + return writeVariableStatement(node); case 234: + return writeInterfaceDeclaration(node); + case 233: + return writeClassDeclaration(node); + case 235: + return writeTypeAliasDeclaration(node); + case 236: + return writeEnumDeclaration(node); + case 237: return writeModuleDeclaration(node); - case 238: + case 241: return writeImportEqualsDeclaration(node); - case 239: + case 242: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 269) { + if (node.parent.kind === 272) { var modifiers = ts.getModifierFlags(node); if (modifiers & 1) { + resultHasExternalModuleIndicator = true; write("export "); } if (modifiers & 512) { write("default "); } - else if (node.kind !== 231 && needsDeclare) { + else if (node.kind !== 234 && needsDeclare) { write("declare "); } } @@ -54523,11 +55695,11 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 241) { + if (namedBindings.kind === 244) { return resolver.isDeclarationVisible(namedBindings); } else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); + return namedBindings.elements.some(function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } } } @@ -54546,7 +55718,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 241) { + if (node.importClause.namedBindings.kind === 244) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -54563,19 +55735,9 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 234; - var moduleSpecifier; - if (parent.kind === 238) { - var node = parent; - moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === 234) { - moduleSpecifier = parent.name; - } - else { - var node = parent; - moduleSpecifier = node.moduleSpecifier; - } + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 237; + var moduleSpecifier = parent.kind === 241 ? ts.getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === 237 ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === 9 && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -54600,6 +55762,7 @@ var ts; writeAsynchronousModuleElements(nodes); } function emitExportDeclaration(node) { + resultHasExternalModuleIndicator = true; emitJsDocComments(node); write("export "); if (node.exportClause) { @@ -54637,7 +55800,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 235) { + while (node.body && node.body.kind !== 238) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -54707,7 +55870,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 152 && ts.hasModifier(node.parent, 8); + return node.parent.kind === 153 && ts.hasModifier(node.parent, 8); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -54717,15 +55880,15 @@ var ts; writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 161 || - node.parent.kind === 162 || - (node.parent.parent && node.parent.parent.kind === 164)) { - ts.Debug.assert(node.parent.kind === 152 || - node.parent.kind === 151 || - node.parent.kind === 161 || + if (node.parent.kind === 162 || + node.parent.kind === 163 || + (node.parent.parent && node.parent.parent.kind === 165)) { + ts.Debug.assert(node.parent.kind === 153 || + node.parent.kind === 152 || node.parent.kind === 162 || - node.parent.kind === 156 || - node.parent.kind === 157); + node.parent.kind === 163 || + node.parent.kind === 157 || + node.parent.kind === 158); emitType(node.constraint); } else { @@ -54734,15 +55897,15 @@ var ts; } if (node.default && !isPrivateMethodTypeParameter(node)) { write(" = "); - if (node.parent.kind === 161 || - node.parent.kind === 162 || - (node.parent.parent && node.parent.parent.kind === 164)) { - ts.Debug.assert(node.parent.kind === 152 || - node.parent.kind === 151 || - node.parent.kind === 161 || + if (node.parent.kind === 162 || + node.parent.kind === 163 || + (node.parent.parent && node.parent.parent.kind === 165)) { + ts.Debug.assert(node.parent.kind === 153 || + node.parent.kind === 152 || node.parent.kind === 162 || - node.parent.kind === 156 || - node.parent.kind === 157); + node.parent.kind === 163 || + node.parent.kind === 157 || + node.parent.kind === 158); emitType(node.default); } else { @@ -54752,34 +55915,34 @@ var ts; function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 230: + case 233: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 231: + case 234: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 157: + case 158: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156: + case 157: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 153: case 152: - case 151: if (ts.hasModifier(node.parent, 32)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230) { + else if (node.parent.parent.kind === 233) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 229: + case 232: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 232: + case 235: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -54812,7 +55975,7 @@ var ts; } function getHeritageClauseVisibilityError() { var diagnosticMessage; - if (node.parent.parent.kind === 230) { + if (node.parent.parent.kind === 233) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; @@ -54849,7 +56012,7 @@ var ts; diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: baseTypeNode, typeName: node.name - }, !ts.findAncestor(node, function (n) { return n.kind === 234; })); + }, !ts.findAncestor(node, function (n) { return n.kind === 237; })); } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -54922,17 +56085,17 @@ var ts; return resolver.isDeclarationVisible(node) || bindingNameContainsVisibleBindingElement(node.name); } function emitVariableDeclaration(node) { - if (node.kind !== 227 || isVariableDeclarationVisible(node)) { + if (node.kind !== 230 || isVariableDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); - if ((node.kind === 150 || node.kind === 149 || - (node.kind === 147 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 151 || node.kind === 150 || + (node.kind === 148 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 150 || node.kind === 149) && node.parent.kind === 164) { + if ((node.kind === 151 || node.kind === 150) && node.parent.kind === 165) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -54945,15 +56108,15 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 227) { + if (node.kind === 230) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 150 || node.kind === 149 || - (node.kind === 147 && ts.hasModifier(node.parent, 8))) { + else if (node.kind === 151 || node.kind === 150 || + (node.kind === 148 && ts.hasModifier(node.parent, 8))) { if (ts.hasModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -54961,7 +56124,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 || node.kind === 147) { + else if (node.parent.kind === 233 || node.kind === 148) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -54987,7 +56150,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 201 && isVariableDeclarationVisible(element)) { + if (element.kind !== 204 && isVariableDeclarationVisible(element)) { elements.push(element); } } @@ -55014,7 +56177,7 @@ var ts; } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { - if (node.type) { + if (ts.hasType(node)) { write(": "); emitType(node.type); } @@ -55056,7 +56219,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 154 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 155 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -55069,7 +56232,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 154 + return accessor.kind === 155 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -55092,7 +56255,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -55107,7 +56270,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 155) { + if (accessorWithTypeAnnotation.kind === 156) { if (ts.hasModifier(accessorWithTypeAnnotation, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -55148,17 +56311,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 229) { + if (node.kind === 232) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 152 || node.kind === 153) { + else if (node.kind === 153 || node.kind === 154) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 229) { + if (node.kind === 232) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 153) { + else if (node.kind === 154) { write("constructor"); } else { @@ -55185,7 +56348,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -55224,20 +56387,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 158) { + if (node.kind === 159) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 153 && ts.hasModifier(node, 8)) { + if (node.kind === 154 && ts.hasModifier(node, 8)) { write("();"); writeLine(); return; } - if (node.kind === 157 || node.kind === 162) { + if (node.kind === 158 || node.kind === 163) { write("new "); } - else if (node.kind === 161) { + else if (node.kind === 162) { var currentOutput = writer.getText(); if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") { closeParenthesizedFunctionType = true; @@ -55248,20 +56411,20 @@ var ts; write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 158) { + if (node.kind === 159) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 161 || node.kind === 162; - if (isFunctionTypeOrConstructorType || node.parent.kind === 164) { + var isFunctionTypeOrConstructorType = node.kind === 162 || node.kind === 163; + if (isFunctionTypeOrConstructorType || node.parent.kind === 165) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 153 && !ts.hasModifier(node, 8)) { + else if (node.kind !== 154 && !ts.hasModifier(node, 8)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -55275,23 +56438,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 157: + case 158: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 156: + case 157: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 158: + case 159: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 153: case 152: - case 151: if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -55299,7 +56462,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -55312,7 +56475,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 229: + case 232: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -55344,9 +56507,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 161 || - node.parent.kind === 162 || - node.parent.parent.kind === 164) { + if (node.parent.kind === 162 || + node.parent.kind === 163 || + node.parent.parent.kind === 165) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8)) { @@ -55362,26 +56525,26 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 153: + case 154: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 157: + case 158: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 156: + case 157: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 158: + case 159: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 153: case 152: - case 151: if (ts.hasModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -55389,7 +56552,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230) { + else if (node.parent.parent.kind === 233) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -55401,7 +56564,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 229: + case 232: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -55412,12 +56575,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 175) { + if (bindingPattern.kind === 178) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 176) { + else if (bindingPattern.kind === 179) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -55428,10 +56591,10 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 201) { + if (bindingElement.kind === 204) { write(" "); } - else if (bindingElement.kind === 177) { + else if (bindingElement.kind === 180) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -55453,39 +56616,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 229: - case 234: - case 238: - case 231: - case 230: case 232: + case 237: + case 241: + case 234: case 233: + case 235: + case 236: return emitModuleElement(node, isModuleElementVisible(node)); - case 209: + case 212: return emitModuleElement(node, isVariableStatementVisible(node)); - case 239: + case 242: return emitModuleElement(node, !node.importClause); - case 245: + case 248: return emitExportDeclaration(node); + case 154: case 153: case 152: - case 151: return writeFunctionDeclaration(node); - case 157: - case 156: case 158: + case 157: + case 159: return emitSignatureDeclarationWithJsDocComments(node); - case 154: case 155: + case 156: return emitAccessorDeclaration(node); + case 151: case 150: - case 149: return emitPropertyDeclaration(node); - case 268: + case 271: return emitEnumMemberDeclaration(node); - case 244: + case 247: return emitExportAssignment(node); - case 269: + case 272: return emitSourceFile(node); } } @@ -55504,7 +56667,7 @@ var ts; } return addedBundledEmitReference; function getDeclFileName(emitFileNames, sourceFileOrBundle) { - var isBundledEmit = sourceFileOrBundle.kind === 270; + var isBundledEmit = sourceFileOrBundle.kind === 273; if (isBundledEmit && !addBundledFileReference) { return; } @@ -55517,8 +56680,8 @@ var ts; function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; - if (!emitSkipped) { - var sourceFiles = sourceFileOrBundle.kind === 270 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + if (!emitSkipped || emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -55542,7 +56705,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var delimiters = createDelimiterMap(); var brackets = createBracketsMap(); function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); @@ -55552,7 +56714,10 @@ var ts; var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + if (result) { + return result; + } } } else { @@ -55561,7 +56726,10 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = !ts.isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + if (result) { + return result; + } } } } @@ -55583,7 +56751,7 @@ var ts; return ".js"; } function getOriginalSourceFileOrBundle(sourceFileOrBundle) { - if (sourceFileOrBundle.kind === 270) { + if (sourceFileOrBundle.kind === 273) { return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, ts.getOriginalSourceFile)); } return ts.getOriginalSourceFile(sourceFileOrBundle); @@ -55625,7 +56793,7 @@ var ts; }; function emitSourceFileOrBundle(_a, sourceFileOrBundle) { var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; - if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit && !compilerOptions.emitDeclarationOnly) { if (!emitOnlyDtsFiles) { printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } @@ -55649,8 +56817,8 @@ var ts; } } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { - var bundle = sourceFileOrBundle.kind === 270 ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 269 ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 272 ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); if (bundle) { @@ -55675,7 +56843,7 @@ var ts; } ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); sourceMap.reset(); - writer.reset(); + writer.clear(); currentSourceFile = undefined; bundledHelpers = undefined; isOwnFileEmit = false; @@ -55686,7 +56854,7 @@ var ts; } function emitHelpers(node, writeLines) { var helpersEmitted = false; - var bundle = node.kind === 270 ? node : undefined; + var bundle = node.kind === 273 ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -55735,14 +56903,27 @@ var ts; var generatedNames; var tempFlagsStack; var tempFlags; + var reservedNamesStack; + var reservedNames; var writer; var ownWriter; + var write = writeBase; + var commitPendingSemicolon = ts.noop; + var writeSemicolon = writeSemicolonInternal; + var pendingSemicolon = false; + if (printerOptions.omitTrailingSemicolon) { + commitPendingSemicolon = commitPendingSemicolonInternal; + writeSemicolon = deferWriteSemicolon; + } + var syntheticParent = { pos: -1, end: -1 }; reset(); return { printNode: printNode, + printList: printList, printFile: printFile, printBundle: printBundle, writeNode: writeNode, + writeList: writeList, writeFile: writeFile, writeBundle: writeBundle }; @@ -55759,12 +56940,16 @@ var ts; break; } switch (node.kind) { - case 269: return printFile(node); - case 270: return printBundle(node); + case 272: return printFile(node); + case 273: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); } + function printList(format, nodes, sourceFile) { + writeList(format, nodes, sourceFile, beginPrint()); + return endPrint(); + } function printBundle(bundle) { writeBundle(bundle, beginPrint()); return endPrint(); @@ -55780,6 +56965,16 @@ var ts; reset(); writer = previousWriter; } + function writeList(format, nodes, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList(syntheticParent, nodes, format); + reset(); + writer = previousWriter; + } function writeBundle(bundle, output) { var previousWriter = writer; setWriter(output); @@ -55807,7 +57002,7 @@ var ts; } function endPrint() { var text = ownWriter.getText(); - ownWriter.reset(); + ownWriter.clear(); return text; } function print(hint, node, sourceFile) { @@ -55833,6 +57028,7 @@ var ts; generatedNames = ts.createMap(); tempFlagsStack = []; tempFlags = 0; + reservedNamesStack = []; comments.reset(); setWriter(undefined); } @@ -55894,13 +57090,15 @@ var ts; } function emitMappedTypeParameter(node) { emit(node.name); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emit(node.constraint); } function pipelineEmitUnspecified(node) { var kind = node.kind; if (ts.isKeyword(kind)) { - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; } switch (kind) { @@ -55910,217 +57108,221 @@ var ts; return emitLiteral(node); case 71: return emitIdentifier(node); - case 144: - return emitQualifiedName(node); case 145: - return emitComputedPropertyName(node); + return emitQualifiedName(node); case 146: - return emitTypeParameter(node); + return emitComputedPropertyName(node); case 147: - return emitParameter(node); + return emitTypeParameter(node); case 148: - return emitDecorator(node); + return emitParameter(node); case 149: - return emitPropertySignature(node); + return emitDecorator(node); case 150: - return emitPropertyDeclaration(node); + return emitPropertySignature(node); case 151: - return emitMethodSignature(node); + return emitPropertyDeclaration(node); case 152: - return emitMethodDeclaration(node); + return emitMethodSignature(node); case 153: - return emitConstructor(node); + return emitMethodDeclaration(node); case 154: + return emitConstructor(node); case 155: - return emitAccessorDeclaration(node); case 156: - return emitCallSignature(node); + return emitAccessorDeclaration(node); case 157: - return emitConstructSignature(node); + return emitCallSignature(node); case 158: - return emitIndexSignature(node); + return emitConstructSignature(node); case 159: - return emitTypePredicate(node); + return emitIndexSignature(node); case 160: - return emitTypeReference(node); + return emitTypePredicate(node); case 161: - return emitFunctionType(node); - case 277: - return emitJSDocFunctionType(node); + return emitTypeReference(node); case 162: - return emitConstructorType(node); + return emitFunctionType(node); + case 280: + return emitJSDocFunctionType(node); case 163: - return emitTypeQuery(node); + return emitConstructorType(node); case 164: - return emitTypeLiteral(node); + return emitTypeQuery(node); case 165: - return emitArrayType(node); + return emitTypeLiteral(node); case 166: - return emitTupleType(node); + return emitArrayType(node); case 167: - return emitUnionType(node); + return emitTupleType(node); case 168: - return emitIntersectionType(node); + return emitUnionType(node); case 169: - return emitParenthesizedType(node); - case 202: - return emitExpressionWithTypeArguments(node); + return emitIntersectionType(node); case 170: - return emitThisType(); + return emitConditionalType(node); case 171: - return emitTypeOperator(node); + return emitInferType(node); case 172: - return emitIndexedAccessType(node); + return emitParenthesizedType(node); + case 205: + return emitExpressionWithTypeArguments(node); case 173: - return emitMappedType(node); + return emitThisType(); case 174: + return emitTypeOperator(node); + case 175: + return emitIndexedAccessType(node); + case 176: + return emitMappedType(node); + case 177: return emitLiteralType(node); - case 272: + case 275: write("*"); return; - case 273: + case 276: write("?"); return; - case 274: + case 277: return emitJSDocNullableType(node); - case 275: - return emitJSDocNonNullableType(node); - case 276: - return emitJSDocOptionalType(node); case 278: + return emitJSDocNonNullableType(node); + case 279: + return emitJSDocOptionalType(node); + case 281: return emitJSDocVariadicType(node); - case 175: + case 178: return emitObjectBindingPattern(node); - case 176: + case 179: return emitArrayBindingPattern(node); - case 177: + case 180: return emitBindingElement(node); - case 206: - return emitTemplateSpan(node); - case 207: - return emitSemicolonClassElement(); - case 208: - return emitBlock(node); case 209: - return emitVariableStatement(node); + return emitTemplateSpan(node); case 210: - return emitEmptyStatement(); + return emitSemicolonClassElement(); case 211: - return emitExpressionStatement(node); + return emitBlock(node); case 212: - return emitIfStatement(node); + return emitVariableStatement(node); case 213: - return emitDoStatement(node); + return emitEmptyStatement(); case 214: - return emitWhileStatement(node); + return emitExpressionStatement(node); case 215: - return emitForStatement(node); + return emitIfStatement(node); case 216: - return emitForInStatement(node); + return emitDoStatement(node); case 217: - return emitForOfStatement(node); + return emitWhileStatement(node); case 218: - return emitContinueStatement(node); + return emitForStatement(node); case 219: - return emitBreakStatement(node); + return emitForInStatement(node); case 220: - return emitReturnStatement(node); + return emitForOfStatement(node); case 221: - return emitWithStatement(node); + return emitContinueStatement(node); case 222: - return emitSwitchStatement(node); + return emitBreakStatement(node); case 223: - return emitLabeledStatement(node); + return emitReturnStatement(node); case 224: - return emitThrowStatement(node); + return emitWithStatement(node); case 225: - return emitTryStatement(node); + return emitSwitchStatement(node); case 226: - return emitDebuggerStatement(node); + return emitLabeledStatement(node); case 227: - return emitVariableDeclaration(node); + return emitThrowStatement(node); case 228: - return emitVariableDeclarationList(node); + return emitTryStatement(node); case 229: - return emitFunctionDeclaration(node); + return emitDebuggerStatement(node); case 230: - return emitClassDeclaration(node); + return emitVariableDeclaration(node); case 231: - return emitInterfaceDeclaration(node); + return emitVariableDeclarationList(node); case 232: - return emitTypeAliasDeclaration(node); + return emitFunctionDeclaration(node); case 233: - return emitEnumDeclaration(node); + return emitClassDeclaration(node); case 234: - return emitModuleDeclaration(node); + return emitInterfaceDeclaration(node); case 235: - return emitModuleBlock(node); + return emitTypeAliasDeclaration(node); case 236: - return emitCaseBlock(node); + return emitEnumDeclaration(node); case 237: - return emitNamespaceExportDeclaration(node); + return emitModuleDeclaration(node); case 238: - return emitImportEqualsDeclaration(node); + return emitModuleBlock(node); case 239: - return emitImportDeclaration(node); + return emitCaseBlock(node); case 240: - return emitImportClause(node); + return emitNamespaceExportDeclaration(node); case 241: - return emitNamespaceImport(node); + return emitImportEqualsDeclaration(node); case 242: - return emitNamedImports(node); + return emitImportDeclaration(node); case 243: - return emitImportSpecifier(node); + return emitImportClause(node); case 244: - return emitExportAssignment(node); + return emitNamespaceImport(node); case 245: - return emitExportDeclaration(node); + return emitNamedImports(node); case 246: - return emitNamedExports(node); + return emitImportSpecifier(node); case 247: - return emitExportSpecifier(node); + return emitExportAssignment(node); case 248: - return; + return emitExportDeclaration(node); case 249: + return emitNamedExports(node); + case 250: + return emitExportSpecifier(node); + case 251: + return; + case 252: return emitExternalModuleReference(node); case 10: return emitJsxText(node); - case 252: case 255: - return emitJsxOpeningElementOrFragment(node); - case 253: - case 256: - return emitJsxClosingElementOrFragment(node); - case 257: - return emitJsxAttribute(node); case 258: - return emitJsxAttributes(node); + return emitJsxOpeningElementOrFragment(node); + case 256: case 259: - return emitJsxSpreadAttribute(node); + return emitJsxClosingElementOrFragment(node); case 260: - return emitJsxExpression(node); + return emitJsxAttribute(node); case 261: - return emitCaseClause(node); + return emitJsxAttributes(node); case 262: - return emitDefaultClause(node); + return emitJsxSpreadAttribute(node); case 263: - return emitHeritageClause(node); + return emitJsxExpression(node); case 264: - return emitCatchClause(node); + return emitCaseClause(node); case 265: - return emitPropertyAssignment(node); + return emitDefaultClause(node); case 266: - return emitShorthandPropertyAssignment(node); + return emitHeritageClause(node); case 267: - return emitSpreadAssignment(node); + return emitCatchClause(node); case 268: + return emitPropertyAssignment(node); + case 269: + return emitShorthandPropertyAssignment(node); + case 270: + return emitSpreadAssignment(node); + case 271: return emitEnumMember(node); } if (ts.isExpression(node)) { return pipelineEmitExpression(trySubstituteNode(1, node)); } if (ts.isToken(node)) { - writeTokenNode(node); + writeTokenNode(node, writePunctuation); return; } } @@ -56141,71 +57343,71 @@ var ts; case 101: case 99: case 91: - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; - case 178: - return emitArrayLiteralExpression(node); - case 179: - return emitObjectLiteralExpression(node); - case 180: - return emitPropertyAccessExpression(node); case 181: - return emitElementAccessExpression(node); + return emitArrayLiteralExpression(node); case 182: - return emitCallExpression(node); + return emitObjectLiteralExpression(node); case 183: - return emitNewExpression(node); + return emitPropertyAccessExpression(node); case 184: - return emitTaggedTemplateExpression(node); + return emitElementAccessExpression(node); case 185: - return emitTypeAssertionExpression(node); + return emitCallExpression(node); case 186: - return emitParenthesizedExpression(node); + return emitNewExpression(node); case 187: - return emitFunctionExpression(node); + return emitTaggedTemplateExpression(node); case 188: - return emitArrowFunction(node); + return emitTypeAssertionExpression(node); case 189: - return emitDeleteExpression(node); + return emitParenthesizedExpression(node); case 190: - return emitTypeOfExpression(node); + return emitFunctionExpression(node); case 191: - return emitVoidExpression(node); + return emitArrowFunction(node); case 192: - return emitAwaitExpression(node); + return emitDeleteExpression(node); case 193: - return emitPrefixUnaryExpression(node); + return emitTypeOfExpression(node); case 194: - return emitPostfixUnaryExpression(node); + return emitVoidExpression(node); case 195: - return emitBinaryExpression(node); + return emitAwaitExpression(node); case 196: - return emitConditionalExpression(node); + return emitPrefixUnaryExpression(node); case 197: - return emitTemplateExpression(node); + return emitPostfixUnaryExpression(node); case 198: - return emitYieldExpression(node); + return emitBinaryExpression(node); case 199: - return emitSpreadExpression(node); + return emitConditionalExpression(node); case 200: - return emitClassExpression(node); + return emitTemplateExpression(node); case 201: - return; + return emitYieldExpression(node); + case 202: + return emitSpreadExpression(node); case 203: - return emitAsExpression(node); + return emitClassExpression(node); case 204: + return; + case 206: + return emitAsExpression(node); + case 207: return emitNonNullExpression(node); - case 205: + case 208: return emitMetaProperty(node); - case 250: + case 253: return emitJsxElement(node); - case 251: - return emitJsxSelfClosingElement(node); case 254: + return emitJsxSelfClosingElement(node); + case 257: return emitJsxFragment(node); - case 292: + case 295: return emitPartiallyEmittedExpression(node); - case 293: + case 296: return emitCommaList(node); } } @@ -56224,19 +57426,20 @@ var ts; var text = getLiteralTextOfNode(node); if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 || ts.isTemplateLiteralKind(node.kind))) { - writer.writeLiteral(text); + writeLiteral(text); } else { - write(text); + writeStringLiteral(text); } } function emitIdentifier(node) { - write(getTextOfNode(node, false)); - emitTypeArguments(node, node.typeArguments); + var writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode(node, false), node.symbol); + emitList(node, node.typeArguments, 26896); } function emitQualifiedName(node) { emitEntityName(node.left); - write("."); + writePunctuation("."); emit(node.right); } function emitEntityName(node) { @@ -56248,51 +57451,61 @@ var ts; } } function emitComputedPropertyName(node) { - write("["); + writePunctuation("["); emitExpression(node.expression); - write("]"); + writePunctuation("]"); } function emitTypeParameter(node) { emit(node.name); - emitWithPrefix(" extends ", node.constraint); - emitWithPrefix(" = ", node.default); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit(node.default); + } } function emitParameter(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitIfPresent(node.dotDotDotToken); if (node.name) { - emit(node.name); + emitNodeWithWriter(node.name, writeParameter); } emitIfPresent(node.questionToken); - if (node.parent && node.parent.kind === 277 && !node.name) { + if (node.parent && node.parent.kind === 280 && !node.name) { emit(node.type); } else { - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitDecorator(decorator) { - write("@"); + writePunctuation("@"); emitExpression(decorator.expression); } function emitPropertySignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - emit(node.name); + emitNodeWithWriter(node.name, writeProperty); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitPropertyDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); - write(";"); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); + writeSemicolon(); } function emitMethodSignature(node) { emitDecorators(node, node.decorators); @@ -56301,8 +57514,8 @@ var ts; emitIfPresent(node.questionToken); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitMethodDeclaration(node) { emitDecorators(node, node.decorators); @@ -56314,13 +57527,14 @@ var ts; } function emitConstructor(node) { emitModifiers(node, node.modifiers); - write("constructor"); + writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 154 ? "get " : "set "); + writeKeyword(node.kind === 155 ? "get" : "set"); + writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -56329,31 +57543,34 @@ var ts; emitModifiers(node, node.modifiers); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitConstructSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitIndexSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitParametersForIndexSignature(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitSemicolonClassElement() { - write(";"); + writeSemicolon(); } function emitTypePredicate(node) { emit(node.parameterName); - write(" is "); + writeSpace(); + writeKeyword("is"); + writeSpace(); emit(node.type); } function emitTypeReference(node) { @@ -56363,7 +57580,9 @@ var ts; function emitFunctionType(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitJSDocFunctionType(node) { @@ -56385,34 +57604,39 @@ var ts; write("="); } function emitConstructorType(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitTypeQuery(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emit(node.exprName); } function emitTypeLiteral(node) { - write("{"); + writePunctuation("{"); var flags = ts.getEmitFlags(node) & 1 ? 448 : 65; emitList(node, node.members, flags | 262144); - write("}"); + writePunctuation("}"); } function emitArrayType(node) { emit(node.elementType); - write("[]"); + writePunctuation("["); + writePunctuation("]"); } function emitJSDocVariadicType(node) { write("..."); emit(node.type); } function emitTupleType(node) { - write("["); + writePunctuation("["); emitList(node, node.elementTypes, 336); - write("]"); + writePunctuation("]"); } function emitUnionType(node) { emitList(node, node.types, 260); @@ -56420,30 +57644,50 @@ var ts; function emitIntersectionType(node) { emitList(node, node.types, 264); } + function emitConditionalType(node) { + emit(node.checkType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } function emitParenthesizedType(node) { - write("("); + writePunctuation("("); emit(node.type); - write(")"); + writePunctuation(")"); } function emitThisType() { - write("this"); + writeKeyword("this"); } function emitTypeOperator(node) { - writeTokenText(node.operator); - write(" "); + writeTokenText(node.operator, writeKeyword); + writeSpace(); emit(node.type); } function emitIndexedAccessType(node) { emit(node.objectType); - write("["); + writePunctuation("["); emit(node.indexType); - write("]"); + writePunctuation("]"); } function emitMappedType(node) { var emitFlags = ts.getEmitFlags(node); - write("{"); + writePunctuation("{"); if (emitFlags & 1) { - write(" "); + writeSpace(); } else { writeLine(); @@ -56451,54 +57695,55 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - write(" "); + if (node.readonlyToken.kind !== 132) { + writeKeyword("readonly"); + } + writeSpace(); } - write("["); + writePunctuation("["); pipelineEmitWithNotification(3, node.typeParameter); - write("]"); - emitIfPresent(node.questionToken); - write(": "); + writePunctuation("]"); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 55) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); if (emitFlags & 1) { - write(" "); + writeSpace(); } else { writeLine(); decreaseIndent(); } - write("}"); + writePunctuation("}"); } function emitLiteralType(node) { emitExpression(node.literal); } function emitObjectBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("{}"); - } - else { - write("{"); - emitList(node, elements, 432); - write("}"); - } + writePunctuation("{"); + emitList(node, node.elements, 262576); + writePunctuation("}"); } function emitArrayBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("[]"); - } - else { - write("["); - emitList(node, node.elements, 304); - write("]"); - } + writePunctuation("["); + emitList(node, node.elements, 262448); + writePunctuation("]"); } function emitBindingElement(node) { - emitWithSuffix(node.propertyName, ": "); emitIfPresent(node.dotDotDotToken); + if (node.propertyName) { + emit(node.propertyName); + writePunctuation(":"); + writeSpace(); + } emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitArrayLiteralExpression(node) { var elements = node.elements; @@ -56532,7 +57777,7 @@ var ts; emitExpression(node.expression); increaseIndentIf(indentBeforeDot); var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - write(shouldEmitDotDot ? ".." : "."); + writePunctuation(shouldEmitDotDot ? ".." : "."); increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -56553,9 +57798,9 @@ var ts; } function emitElementAccessExpression(node) { emitExpression(node.expression); - write("["); + writePunctuation("["); emitExpression(node.argumentExpression); - write("]"); + writePunctuation("]"); } function emitCallExpression(node) { emitExpression(node.expression); @@ -56563,26 +57808,27 @@ var ts; emitExpressionList(node, node.arguments, 1296); } function emitNewExpression(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); emitExpressionList(node, node.arguments, 9488); } function emitTaggedTemplateExpression(node) { emitExpression(node.tag); - write(" "); + writeSpace(); emitExpression(node.template); } function emitTypeAssertionExpression(node) { - write("<"); + writePunctuation("<"); emit(node.type); - write(">"); + writePunctuation(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { - write("("); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } function emitFunctionExpression(node) { emitFunctionDeclarationOrExpression(node); @@ -56595,42 +57841,46 @@ var ts; function emitArrowFunctionHead(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - emitWithPrefix(": ", node.type); - write(" "); + emitTypeAnnotation(node.type); + writeSpace(); emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - write("delete "); + writeKeyword("delete"); + writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - write("void "); + writeKeyword("void"); + writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - write("await "); + writeKeyword("await"); + writeSpace(); emitExpression(node.expression); } function emitPrefixUnaryExpression(node) { - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); if (shouldEmitWhitespaceBeforeOperand(node)) { - write(" "); + writeSpace(); } emitExpression(node.operand); } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 193 + return operand.kind === 196 && ((node.operator === 37 && (operand.operator === 37 || operand.operator === 43)) || (node.operator === 38 && (operand.operator === 38 || operand.operator === 44))); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand); - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); } function emitBinaryExpression(node) { var isCommaOperator = node.operatorToken.kind !== 26; @@ -56639,7 +57889,7 @@ var ts; emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); emitLeadingCommentsOfPosition(node.operatorToken.pos); - writeTokenNode(node.operatorToken); + writeTokenNode(node.operatorToken, writeOperator); emitTrailingCommentsOfPosition(node.operatorToken.end, true); increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); @@ -56667,12 +57917,12 @@ var ts; emitList(node, node.templateSpans, 131072); } function emitYieldExpression(node) { - write("yield"); + writeKeyword("yield"); emit(node.asteriskToken); - emitExpressionWithPrefix(" ", node.expression); + emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } function emitClassExpression(node) { @@ -56685,17 +57935,19 @@ var ts; function emitAsExpression(node) { emitExpression(node.expression); if (node.type) { - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.type); } } function emitNonNullExpression(node) { emitExpression(node.expression); - write("!"); + writeOperator("!"); } function emitMetaProperty(node) { - writeToken(node.keywordToken, node.pos); - write("."); + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); emit(node.name); } function emitTemplateSpan(node) { @@ -56703,12 +57955,12 @@ var ts; emit(node.literal); } function emitBlock(node) { - writeToken(17, node.pos, node); + writeToken(17, node.pos, writePunctuation, node); emitBlockStatements(node, !node.multiLine && isEmptyBlock(node)); increaseIndent(); emitLeadingCommentsOfPosition(node.statements.end); decreaseIndent(); - writeToken(18, node.statements.end, node); + writeToken(18, node.statements.end, writePunctuation, node); } function emitBlockStatements(node, forceSingleLine) { var format = forceSingleLine || ts.getEmitFlags(node) & 1 ? 384 : 65; @@ -56717,27 +57969,27 @@ var ts; function emitVariableStatement(node) { emitModifiers(node, node.modifiers); emit(node.declarationList); - write(";"); + writeSemicolon(); } function emitEmptyStatement() { - write(";"); + writeSemicolon(); } function emitExpressionStatement(node) { emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitIfStatement(node) { - var openParenPos = writeToken(90, node.pos, node); - write(" "); - writeToken(19, openParenPos, node); + var openParenPos = writeToken(90, node.pos, writeKeyword, node); + writeSpace(); + writeToken(19, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20, node.expression.end, node); + writeToken(20, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(82, node.thenStatement.end, node); - if (node.elseStatement.kind === 212) { - write(" "); + writeToken(82, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 215) { + writeSpace(); emit(node.elseStatement); } else { @@ -56746,60 +57998,68 @@ var ts; } } function emitDoStatement(node) { - write("do"); + writeKeyword("do"); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { - write(" "); + writeSpace(); } else { writeLineOrSpace(node); } - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(");"); + writePunctuation(");"); } function emitWhileStatement(node) { - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(88, node.pos); - write(" "); - writeToken(19, openParenPos, node); + var openParenPos = writeToken(88, node.pos, writeKeyword); + writeSpace(); + writeToken(19, openParenPos, writePunctuation, node); emitForBinding(node.initializer); - write(";"); - emitExpressionWithPrefix(" ", node.condition); - write(";"); - emitExpressionWithPrefix(" ", node.incrementor); - write(")"); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.condition); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.incrementor); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(88, node.pos); - write(" "); - writeToken(19, openParenPos); + var openParenPos = writeToken(88, node.pos, writeKeyword); + writeSpace(); + writeToken(19, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emitExpression(node.expression); - writeToken(20, node.expression.end); + writeToken(20, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(88, node.pos); - write(" "); - emitWithSuffix(node.awaitModifier, " "); - writeToken(19, openParenPos); + var openParenPos = writeToken(88, node.pos, writeKeyword); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + writeToken(19, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" of "); + writeSpace(); + writeKeyword("of"); + writeSpace(); emitExpression(node.expression); - writeToken(20, node.expression.end); + writeToken(20, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 228) { + if (node.kind === 231) { emit(node); } else { @@ -56808,58 +58068,62 @@ var ts; } } function emitContinueStatement(node) { - writeToken(77, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(77, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } function emitBreakStatement(node) { - writeToken(72, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(72, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } - function emitTokenWithComment(token, pos, contextNode) { + function emitTokenWithComment(token, pos, writer, contextNode) { var node = contextNode && ts.getParseTreeNode(contextNode); if (node && node.kind === contextNode.kind) { pos = ts.skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, contextNode); + pos = writeToken(token, pos, writer, contextNode); if (node && node.kind === contextNode.kind) { emitTrailingCommentsOfPosition(pos, true); } return pos; } function emitReturnStatement(node) { - emitTokenWithComment(96, node.pos, node); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + emitTokenWithComment(96, node.pos, writeKeyword, node); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitWithStatement(node) { - write("with ("); + writeKeyword("with"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(98, node.pos); - write(" "); - writeToken(19, openParenPos); + var openParenPos = writeToken(98, node.pos, writeKeyword); + writeSpace(); + writeToken(19, openParenPos, writePunctuation); emitExpression(node.expression); - writeToken(20, node.expression.end); - write(" "); + writeToken(20, node.expression.end, writePunctuation); + writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node) { emit(node.label); - write(": "); + writePunctuation(":"); + writeSpace(); emit(node.statement); } function emitThrowStatement(node) { - write("throw"); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + writeKeyword("throw"); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitTryStatement(node) { - write("try "); + writeKeyword("try"); + writeSpace(); emit(node.tryBlock); if (node.catchClause) { writeLineOrSpace(node); @@ -56867,21 +58131,23 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - write("finally "); + writeKeyword("finally"); + writeSpace(); emit(node.finallyBlock); } } function emitDebuggerStatement(node) { - writeToken(78, node.pos); - write(";"); + writeToken(78, node.pos, writeKeyword); + writeSemicolon(); } function emitVariableDeclaration(node) { emit(node.name); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); } function emitVariableDeclarationList(node) { - write(ts.isLet(node) ? "let " : ts.isConst(node) ? "const " : "var "); + writeKeyword(ts.isLet(node) ? "let" : ts.isConst(node) ? "const" : "var"); + writeSpace(); emitList(node, node.declarations, 272); } function emitFunctionDeclaration(node) { @@ -56890,9 +58156,9 @@ var ts; function emitFunctionDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("function"); + writeKeyword("function"); emitIfPresent(node.asteriskToken); - write(" "); + writeSpace(); emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -56922,19 +58188,19 @@ var ts; } else { emitSignatureHead(node); - write(" "); + writeSpace(); emitExpression(body); } } else { emitSignatureHead(node); - write(";"); + writeSemicolon(); } } function emitSignatureHead(node) { emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } function shouldEmitBlockFunctionBodyOnSingleLine(body) { if (ts.getEmitFlags(body) & 1) { @@ -56961,7 +58227,8 @@ var ts; return true; } function emitBlockFunctionBody(body) { - write(" {"); + writeSpace(); + writePunctuation("{"); increaseIndent(); var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine @@ -56973,7 +58240,7 @@ var ts; emitBlockFunctionBody(body); } decreaseIndent(); - writeToken(18, body.statements.end, body); + writeToken(18, body.statements.end, writePunctuation, body); } function emitBlockFunctionBodyOnSingleLine(body) { emitBlockFunctionBodyWorker(body, true); @@ -56997,17 +58264,21 @@ var ts; function emitClassDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("class"); - emitNodeWithPrefix(" ", node.name, emitIdentifierName); + writeKeyword("class"); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } var indentedFlag = ts.getEmitFlags(node) & 65536; if (indentedFlag) { increaseIndent(); } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65); - write("}"); + writePunctuation("}"); if (indentedFlag) { decreaseIndent(); } @@ -57015,66 +58286,77 @@ var ts; function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("interface "); + writeKeyword("interface"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65); - write("}"); + writePunctuation("}"); } function emitTypeAliasDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("type "); + writeKeyword("type"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); } function emitEnumDeclaration(node) { emitModifiers(node, node.modifiers); - write("enum "); + writeKeyword("enum"); + writeSpace(); emit(node.name); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 81); - write("}"); + writePunctuation("}"); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); if (~node.flags & 512) { - write(node.flags & 16 ? "namespace " : "module "); + writeKeyword(node.flags & 16 ? "namespace" : "module"); + writeSpace(); } emit(node.name); var body = node.body; - while (body.kind === 234) { - write("."); + while (body.kind === 237) { + writePunctuation("."); emit(body.name); body = body.body; } - write(" "); + writeSpace(); emit(body); } function emitModuleBlock(node) { pushNameGenerationScope(node); - write("{"); + writePunctuation("{"); emitBlockStatements(node, isEmptyBlock(node)); - write("}"); + writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node) { - writeToken(17, node.pos); + writeToken(17, node.pos, writePunctuation); emitList(node, node.clauses, 65); - writeToken(18, node.clauses.end); + writeToken(18, node.clauses.end, writePunctuation); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); emit(node.name); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitModuleReference(node.moduleReference); - write(";"); + writeSemicolon(); } function emitModuleReference(node) { if (node.kind === 71) { @@ -57086,23 +58368,30 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); if (node.importClause) { emit(node.importClause); - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); } emitExpression(node.moduleSpecifier); - write(";"); + writeSemicolon(); } function emitImportClause(node) { emit(node.name); if (node.name && node.namedBindings) { - write(", "); + writePunctuation(","); + writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node) { - write("* as "); + writePunctuation("*"); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.name); } function emitNamedImports(node) { @@ -57112,28 +58401,44 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); + writeKeyword("export"); + writeSpace(); + if (node.isExportEquals) { + writeOperator("="); + } + else { + writeKeyword("default"); + } + writeSpace(); emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitExportDeclaration(node) { - write("export "); + writeKeyword("export"); + writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - write("*"); + writePunctuation("*"); } if (node.moduleSpecifier) { - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); emitExpression(node.moduleSpecifier); } - write(";"); + writeSemicolon(); } function emitNamespaceExportDeclaration(node) { - write("export as namespace "); + writeKeyword("export"); + writeSpace(); + writeKeyword("as"); + writeSpace(); + writeKeyword("namespace"); + writeSpace(); emit(node.name); - write(";"); + writeSemicolon(); } function emitNamedExports(node) { emitNamedImportsOrExports(node); @@ -57142,21 +58447,24 @@ var ts; emitImportOrExportSpecifier(node); } function emitNamedImportsOrExports(node) { - write("{"); + writePunctuation("{"); emitList(node, node.elements, 432); - write("}"); + writePunctuation("}"); } function emitImportOrExportSpecifier(node) { if (node.propertyName) { emit(node.propertyName); - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); } emit(node.name); } function emitExternalModuleReference(node) { - write("require("); + writeKeyword("require"); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } function emitJsxElement(node) { emit(node.openingElement); @@ -57164,13 +58472,13 @@ var ts; emit(node.closingElement); } function emitJsxSelfClosingElement(node) { - write("<"); + writePunctuation("<"); emitJsxTagName(node.tagName); - write(" "); + writeSpace(); if (node.attributes.properties && node.attributes.properties.length > 0) { emit(node.attributes); } - write("/>"); + writePunctuation("/>"); } function emitJsxFragment(node) { emit(node.openingFragment); @@ -57178,44 +58486,45 @@ var ts; emit(node.closingFragment); } function emitJsxOpeningElementOrFragment(node) { - write("<"); + writePunctuation("<"); if (ts.isJsxOpeningElement(node)) { emitJsxTagName(node.tagName); if (node.attributes.properties && node.attributes.properties.length > 0) { - write(" "); + writeSpace(); emit(node.attributes); } } - write(">"); + writePunctuation(">"); } function emitJsxText(node) { + commitPendingSemicolon(); writer.writeLiteral(getTextOfNode(node, true)); } function emitJsxClosingElementOrFragment(node) { - write(""); + writePunctuation(">"); } function emitJsxAttributes(node) { emitList(node, node.properties, 131328); } function emitJsxAttribute(node) { emit(node.name); - emitWithPrefix("=", node.initializer); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emit); } function emitJsxSpreadAttribute(node) { - write("{..."); + writePunctuation("{..."); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } function emitJsxExpression(node) { if (node.expression) { - write("{"); + writePunctuation("{"); emitIfPresent(node.dotDotDotToken); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } } function emitJsxTagName(node) { @@ -57227,13 +58536,15 @@ var ts; } } function emitCaseClause(node) { - write("case "); + writeKeyword("case"); + writeSpace(); emitExpression(node.expression); - write(":"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitDefaultClause(node) { - write("default:"); + writeKeyword("default"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitCaseOrDefaultClauseStatements(parentNode, statements) { @@ -57246,31 +58557,32 @@ var ts; } var format = 81985; if (emitAsSingleStatement) { - write(" "); + writeSpace(); format &= ~(1 | 64); } emitList(parentNode, statements, format); } function emitHeritageClause(node) { - write(" "); - writeTokenText(node.token); - write(" "); + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); emitList(node, node.types, 272); } function emitCatchClause(node) { - var openParenPos = writeToken(74, node.pos); - write(" "); + var openParenPos = writeToken(74, node.pos, writeKeyword); + writeSpace(); if (node.variableDeclaration) { - writeToken(19, openParenPos); + writeToken(19, openParenPos, writePunctuation); emit(node.variableDeclaration); - writeToken(20, node.variableDeclaration.end); - write(" "); + writeToken(20, node.variableDeclaration.end, writePunctuation); + writeSpace(); } emit(node.block); } function emitPropertyAssignment(node) { emit(node.name); - write(": "); + writePunctuation(":"); + writeSpace(); var initializer = node.initializer; if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512) === 0) { var commentRange = ts.getCommentRange(initializer); @@ -57281,19 +58593,21 @@ var ts; function emitShorthandPropertyAssignment(node) { emit(node.name); if (node.objectAssignmentInitializer) { - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitExpression(node.objectAssignmentInitializer); } } function emitSpreadAssignment(node) { if (node.expression) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } } function emitEnumMember(node) { emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitSourceFile(node) { writeLine(); @@ -57376,33 +58690,60 @@ var ts; } } } + function emitNodeWithWriter(node, writer) { + var savedWrite = write; + write = writer; + emit(node); + write = savedWrite; + } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 131328); - write(" "); + writeSpace(); } } - function emitWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emit); - } - function emitExpressionWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emitExpression); - } - function emitNodeWithPrefix(prefix, node, emit) { + function emitTypeAnnotation(node) { if (node) { - write(prefix); + writePunctuation(":"); + writeSpace(); emit(node); } } - function emitWithSuffix(node, suffix) { + function emitInitializer(node) { + if (node) { + writeSpace(); + writeOperator("="); + writeSpace(); + emitExpression(node); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit) { + if (node) { + prefixWriter(prefix); + emit(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit(node); + } + } + function emitExpressionWithLeadingSpace(node) { + if (node) { + writeSpace(); + emitExpression(node); + } + } + function emitWithTrailingSpace(node) { if (node) { emit(node); - write(suffix); + writeSpace(); } } function emitEmbeddedStatement(parent, node) { if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1) { - write(" "); + writeSpace(); emit(node); } else { @@ -57416,13 +58757,16 @@ var ts; emitList(parentNode, decorators, 24577); } function emitTypeArguments(parentNode, typeArguments) { - emitList(parentNode, typeArguments, 26960); + emitList(parentNode, typeArguments, 26896); } function emitTypeParameters(parentNode, typeParameters) { - emitList(parentNode, typeParameters, 26960); + if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList(parentNode, typeParameters, 26896); } function emitParameters(parentNode, parameters) { - emitList(parentNode, parameters, 1360); + emitList(parentNode, parameters, 1296); } function canEmitSimpleArrowHead(parentNode, parameters) { var parameter = ts.singleOrUndefined(parameters); @@ -57442,7 +58786,7 @@ var ts; } function emitParametersForArrow(parentNode, parameters) { if (canEmitSimpleArrowHead(parentNode, parameters)) { - emitList(parentNode, parameters, 1360 & ~1024); + emitList(parentNode, parameters, 1296 & ~1024); } else { emitParameters(parentNode, parameters); @@ -57457,6 +58801,23 @@ var ts; function emitExpressionList(parentNode, children, format, start, count) { emitNodeList(emitExpression, parentNode, children, format, start, count); } + function writeDelimiter(format) { + switch (format & 28) { + case 0: + break; + case 16: + writePunctuation(","); + break; + case 4: + writeSpace(); + writePunctuation("|"); + break; + case 8: + writeSpace(); + writePunctuation("&"); + break; + } + } function emitNodeList(emit, parentNode, children, format, start, count) { if (start === void 0) { start = 0; } if (count === void 0) { count = children ? children.length - start : 0; } @@ -57475,7 +58836,7 @@ var ts; return; } if (format & 7680) { - write(getOpeningBracket(format)); + writePunctuation(getOpeningBracket(format)); } if (onBeforeEmitNodeArray) { onBeforeEmitNodeArray(children); @@ -57485,7 +58846,7 @@ var ts; writeLine(); } else if (format & 128 && !(format & 262144)) { - write(" "); + writeSpace(); } } else { @@ -57496,21 +58857,20 @@ var ts; shouldEmitInterveningComments = false; } else if (format & 128) { - write(" "); + writeSpace(); } if (format & 64) { increaseIndent(); } var previousSibling = void 0; var shouldDecreaseIndentAfterEmit = void 0; - var delimiter = getDelimiter(format); for (var i = 0; i < count; i++) { var child = children[start + i]; if (previousSibling) { - if (delimiter && previousSibling.end !== parentNode.end) { + if (format & 28 && previousSibling.end !== parentNode.end) { emitLeadingCommentsOfPosition(previousSibling.end); } - write(delimiter); + writeDelimiter(format); if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { if ((format & (3 | 64)) === 0) { increaseIndent(); @@ -57520,7 +58880,7 @@ var ts; shouldEmitInterveningComments = false; } else if (previousSibling && format & 256) { - write(" "); + writeSpace(); } } if (shouldEmitInterveningComments) { @@ -57541,9 +58901,9 @@ var ts; } var hasTrailingComma = (format & 32) && children.hasTrailingComma; if (format & 16 && hasTrailingComma) { - write(","); + writePunctuation(","); } - if (previousSibling && delimiter && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024)) { + if (previousSibling && format & 28 && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024)) { emitLeadingCommentsOfPosition(previousSibling.end); } if (format & 64) { @@ -57553,50 +58913,102 @@ var ts; writeLine(); } else if (format & 128) { - write(" "); + writeSpace(); } } if (onAfterEmitNodeArray) { onAfterEmitNodeArray(children); } if (format & 7680) { - write(getClosingBracket(format)); + writePunctuation(getClosingBracket(format)); } } - function write(s) { + function commitPendingSemicolonInternal() { + if (pendingSemicolon) { + writeSemicolonInternal(); + pendingSemicolon = false; + } + } + function writeLiteral(s) { + commitPendingSemicolon(); + writer.writeLiteral(s); + } + function writeStringLiteral(s) { + commitPendingSemicolon(); + writer.writeStringLiteral(s); + } + function writeBase(s) { + commitPendingSemicolon(); writer.write(s); } + function writeSymbol(s, sym) { + commitPendingSemicolon(); + writer.writeSymbol(s, sym); + } + function writePunctuation(s) { + commitPendingSemicolon(); + writer.writePunctuation(s); + } + function deferWriteSemicolon() { + pendingSemicolon = true; + } + function writeSemicolonInternal() { + writer.writePunctuation(";"); + } + function writeKeyword(s) { + commitPendingSemicolon(); + writer.writeKeyword(s); + } + function writeOperator(s) { + commitPendingSemicolon(); + writer.writeOperator(s); + } + function writeParameter(s) { + commitPendingSemicolon(); + writer.writeParameter(s); + } + function writeSpace() { + commitPendingSemicolon(); + writer.writeSpace(" "); + } + function writeProperty(s) { + commitPendingSemicolon(); + writer.writeProperty(s); + } function writeLine() { + commitPendingSemicolon(); writer.writeLine(); } function increaseIndent() { + commitPendingSemicolon(); writer.increaseIndent(); } function decreaseIndent() { + commitPendingSemicolon(); writer.decreaseIndent(); } - function writeToken(token, pos, contextNode) { + function writeToken(token, pos, writer, contextNode) { return onEmitSourceMapOfToken - ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) - : writeTokenText(token, pos); + ? onEmitSourceMapOfToken(contextNode, token, writer, pos, writeTokenText) + : writeTokenText(token, writer, pos); } - function writeTokenNode(node) { + function writeTokenNode(node, writer) { if (onBeforeEmitToken) { onBeforeEmitToken(node); } - write(ts.tokenToString(node.kind)); + writer(ts.tokenToString(node.kind)); if (onAfterEmitToken) { onAfterEmitToken(node); } } - function writeTokenText(token, pos) { + function writeTokenText(token, writer, pos) { var tokenString = ts.tokenToString(token); - write(tokenString); + writer(tokenString); return pos < 0 ? pos : pos + tokenString.length; } function writeLineOrSpace(node) { if (ts.getEmitFlags(node) & 1) { - write(" "); + writeSpace(); } else { writeLine(); @@ -57739,7 +59151,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 186 && ts.nodeIsSynthesized(node)) { + while (node.kind === 189 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -57779,16 +59191,24 @@ var ts; } tempFlagsStack.push(tempFlags); tempFlags = 0; + reservedNamesStack.push(reservedNames); } function popNameGenerationScope(node) { if (node && ts.getEmitFlags(node) & 524288) { return; } tempFlags = tempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name) { + if (!reservedNames || reservedNames === ts.lastOrUndefined(reservedNamesStack)) { + reservedNames = ts.createMap(); + } + reservedNames.set(name, true); } function generateName(name) { - if (name.autoGenerateKind === 4) { - if (name.skipNameGenerationScope) { + if ((name.autoGenerateFlags & 7) === 4) { + if (name.autoGenerateFlags & 8) { var savedTempFlags = tempFlags; popNameGenerationScope(undefined); var result = generateNameCached(getNodeForGeneratedName(name)); @@ -57812,7 +59232,8 @@ var ts; function isUniqueName(name) { return !(hasGlobalName && hasGlobalName(name)) && !currentSourceFile.identifiers.has(name) - && !generatedNames.has(name); + && !generatedNames.has(name) + && !(reservedNames && reservedNames.has(name)); } function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { @@ -57825,11 +59246,14 @@ var ts; } return true; } - function makeTempVariableName(flags) { + function makeTempVariableName(flags, reservedInNestedScopes) { if (flags && !(tempFlags & flags)) { var name = flags === 268435456 ? "_i" : "_n"; if (isUniqueName(name)) { tempFlags |= flags; + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -57841,6 +59265,9 @@ var ts; ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); if (isUniqueName(name)) { + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -57886,32 +59313,32 @@ var ts; switch (node.kind) { case 71: return makeUniqueName(getTextOfNode(node)); - case 234: - case 233: + case 237: + case 236: return generateNameForModuleOrEnum(node); - case 239: - case 245: + case 242: + case 248: return generateNameForImportOrExportDeclaration(node); - case 229: - case 230: - case 244: + case 232: + case 233: + case 247: return generateNameForExportDefault(); - case 200: + case 203: return generateNameForClassExpression(); - case 152: - case 154: + case 153: case 155: + case 156: return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0); } } function makeName(name) { - switch (name.autoGenerateKind) { + switch (name.autoGenerateFlags & 7) { case 1: - return makeTempVariableName(0); + return makeTempVariableName(0, !!(name.autoGenerateFlags & 16)); case 2: - return makeTempVariableName(268435456); + return makeTempVariableName(268435456, !!(name.autoGenerateFlags & 16)); case 3: return makeUniqueName(ts.idText(name)); } @@ -57924,7 +59351,7 @@ var ts; while (original) { node = original; if (ts.isIdentifier(node) - && node.autoGenerateKind === 4 + && node.autoGenerateFlags === 4 && node.autoGenerateId !== autoGenerateId) { break; } @@ -57934,17 +59361,6 @@ var ts; } } ts.createPrinter = createPrinter; - function createDelimiterMap() { - var delimiters = []; - delimiters[0] = ""; - delimiters[16] = ","; - delimiters[4] = " |"; - delimiters[8] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28]; - } function createBracketsMap() { var brackets = []; brackets[512] = ["{", "}"]; @@ -57962,6 +59378,168 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) { + if (!host.getDirectories || !host.readDirectory) { + return undefined; + } + var cachedReadDirectoryResult = ts.createMap(); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + fileExists: fileExists, + readFile: function (path, encoding) { return host.readFile(path, encoding); }, + directoryExists: host.directoryExists && directoryExists, + getDirectories: getDirectories, + readDirectory: readDirectory, + createDirectory: host.createDirectory && createDirectory, + writeFile: host.writeFile && writeFile, + addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, + addOrDeleteFile: addOrDeleteFile, + clearCache: clearCache + }; + function toPath(fileName) { + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getCachedFileSystemEntries(rootDirPath) { + return cachedReadDirectoryResult.get(rootDirPath); + } + function getCachedFileSystemEntriesForBaseDir(path) { + return getCachedFileSystemEntries(ts.getDirectoryPath(path)); + } + function getBaseNameOfFileName(fileName) { + return ts.getBaseFileName(ts.normalizePath(fileName)); + } + function createCachedFileSystemEntries(rootDir, rootDirPath) { + var resultFromHost = { + files: ts.map(host.readDirectory(rootDir, undefined, undefined, ["*.*"]), getBaseNameOfFileName) || [], + directories: host.getDirectories(rootDir) || [] + }; + cachedReadDirectoryResult.set(rootDirPath, resultFromHost); + return resultFromHost; + } + function tryReadDirectory(rootDir, rootDirPath) { + var cachedResult = getCachedFileSystemEntries(rootDirPath); + if (cachedResult) { + return cachedResult; + } + try { + return createCachedFileSystemEntries(rootDir, rootDirPath); + } + catch (_e) { + ts.Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); + return undefined; + } + } + function fileNameEqual(name1, name2) { + return getCanonicalFileName(name1) === getCanonicalFileName(name2); + } + function hasEntry(entries, name) { + return ts.some(entries, function (file) { return fileNameEqual(file, name); }); + } + function updateFileSystemEntry(entries, baseName, isValid) { + if (hasEntry(entries, baseName)) { + if (!isValid) { + return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); + } + } + else if (isValid) { + return entries.push(baseName); + } + } + function writeFile(fileName, data, writeByteOrderMark) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + if (result) { + updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), true); + } + return host.writeFile(fileName, data, writeByteOrderMark); + } + function fileExists(fileName) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || + host.fileExists(fileName); + } + function directoryExists(dirPath) { + var path = toPath(dirPath); + return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); + } + function createDirectory(dirPath) { + var path = toPath(dirPath); + var result = getCachedFileSystemEntriesForBaseDir(path); + var baseFileName = getBaseNameOfFileName(dirPath); + if (result) { + updateFileSystemEntry(result.directories, baseFileName, true); + } + host.createDirectory(dirPath); + } + function getDirectories(rootDir) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return result.directories.slice(); + } + return host.getDirectories(rootDir); + } + function readDirectory(rootDir, extensions, excludes, includes, depth) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries); + } + return host.readDirectory(rootDir, extensions, excludes, includes, depth); + function getFileSystemEntries(dir) { + var path = toPath(dir); + if (path === rootDirPath) { + return result; + } + return tryReadDirectory(dir, path) || ts.emptyFileSystemEntries; + } + } + function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { + var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); + if (existingResult) { + clearCache(); + return undefined; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); + if (!parentResult) { + return undefined; + } + if (!host.directoryExists) { + clearCache(); + return undefined; + } + var baseName = getBaseNameOfFileName(fileOrDirectory); + var fsQueryResult = { + fileExists: host.fileExists(fileOrDirectoryPath), + directoryExists: host.directoryExists(fileOrDirectoryPath) + }; + if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { + clearCache(); + } + else { + updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); + } + return fsQueryResult; + } + function addOrDeleteFile(fileName, filePath, eventKind) { + if (eventKind === ts.FileWatcherEventKind.Changed) { + return; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); + if (parentResult) { + updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); + } + } + function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { + updateFileSystemEntry(parentResult.files, baseName, fileExists); + } + function clearCache() { + cachedReadDirectoryResult.clear(); + } + } + ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; var ConfigFileProgramReloadLevel; (function (ConfigFileProgramReloadLevel) { ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["None"] = 0] = "None"; @@ -57998,6 +59576,13 @@ var ts; } } ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories; + function isEmittedFileOfProgram(program, file) { + if (!program) { + return false; + } + return program.isEmittedFile(file); + } + ts.isEmittedFileOfProgram = isEmittedFileOfProgram; function addFileWatcher(host, file, cb) { return host.watchFile(file, cb); } @@ -58073,346 +59658,6 @@ var ts; ts.closeFileWatcherOf = closeFileWatcherOf; })(ts || (ts = {})); var ts; -(function (ts) { - function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { - var outputFiles = []; - var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); - return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; - function writeFile(fileName, text, writeByteOrderMark) { - outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); - } - } - ts.getFileEmitOutput = getFileEmitOutput; - function createBuilder(options) { - var isModuleEmit; - var fileInfos = ts.createMap(); - var semanticDiagnosticsPerFile = ts.createMap(); - var changedFilesSet = ts.createMap(); - var hasShapeChanged = ts.createMap(); - var allFilesExcludingDefaultLibraryFile; - var emitHandler; - return { - updateProgram: updateProgram, - getFilesAffectedBy: getFilesAffectedBy, - emitChangedFiles: emitChangedFiles, - getSemanticDiagnostics: getSemanticDiagnostics, - clear: clear - }; - function createProgramGraph(program) { - var currentIsModuleEmit = program.getCompilerOptions().module !== ts.ModuleKind.None; - if (isModuleEmit !== currentIsModuleEmit) { - isModuleEmit = currentIsModuleEmit; - emitHandler = isModuleEmit ? getModuleEmitHandler() : getNonModuleEmitHandler(); - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - } - hasShapeChanged.clear(); - allFilesExcludingDefaultLibraryFile = undefined; - ts.mutateMap(fileInfos, ts.arrayToMap(program.getSourceFiles(), function (sourceFile) { return sourceFile.path; }), { - createNewValue: function (_path, sourceFile) { return addNewFileInfo(program, sourceFile); }, - onDeleteValue: removeExistingFileInfo, - onExistingValue: function (existingInfo, sourceFile) { return updateExistingFileInfo(program, existingInfo, sourceFile); } - }); - } - function registerChangedFile(path) { - changedFilesSet.set(path, true); - semanticDiagnosticsPerFile.delete(path); - } - function addNewFileInfo(program, sourceFile) { - registerChangedFile(sourceFile.path); - emitHandler.onAddSourceFile(program, sourceFile); - return { version: sourceFile.version, signature: undefined }; - } - function removeExistingFileInfo(_existingFileInfo, path) { - changedFilesSet.delete(path); - semanticDiagnosticsPerFile.delete(path); - emitHandler.onRemoveSourceFile(path); - } - function updateExistingFileInfo(program, existingInfo, sourceFile) { - if (existingInfo.version !== sourceFile.version) { - registerChangedFile(sourceFile.path); - existingInfo.version = sourceFile.version; - emitHandler.onUpdateSourceFile(program, sourceFile); - } - else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) { - registerChangedFile(sourceFile.path); - } - } - function ensureProgramGraph(program) { - if (!emitHandler) { - createProgramGraph(program); - } - } - function updateProgram(newProgram) { - if (emitHandler) { - createProgramGraph(newProgram); - } - } - function getFilesAffectedBy(program, path) { - ensureProgramGraph(program); - var sourceFile = program.getSourceFileByPath(path); - if (!sourceFile) { - return ts.emptyArray; - } - if (!updateShapeSignature(program, sourceFile)) { - return [sourceFile]; - } - return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile); - } - function emitChangedFiles(program, writeFileCallback) { - ensureProgramGraph(program); - var compilerOptions = program.getCompilerOptions(); - if (!changedFilesSet.size) { - return ts.emptyArray; - } - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - changedFilesSet.clear(); - return [program.emit(undefined, writeFileCallback)]; - } - var seenFiles = ts.createMap(); - var result; - changedFilesSet.forEach(function (_true, path) { - var affectedFiles = getFilesAffectedBy(program, path); - affectedFiles.forEach(function (affectedFile) { - semanticDiagnosticsPerFile.delete(affectedFile.path); - if (!seenFiles.has(affectedFile.path)) { - seenFiles.set(affectedFile.path, true); - (result || (result = [])).push(program.emit(affectedFile, writeFileCallback)); - } - }); - }); - changedFilesSet.clear(); - return result || ts.emptyArray; - } - function getSemanticDiagnostics(program, cancellationToken) { - ensureProgramGraph(program); - ts.Debug.assert(changedFilesSet.size === 0); - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - return program.getSemanticDiagnostics(undefined, cancellationToken); - } - var diagnostics; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken)); - } - return diagnostics || ts.emptyArray; - } - function getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken) { - var path = sourceFile.path; - var cachedDiagnostics = semanticDiagnosticsPerFile.get(path); - if (cachedDiagnostics) { - return cachedDiagnostics; - } - var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); - semanticDiagnosticsPerFile.set(path, diagnostics); - return diagnostics; - } - function clear() { - isModuleEmit = undefined; - emitHandler = undefined; - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - changedFilesSet.clear(); - hasShapeChanged.clear(); - } - function containsOnlyAmbientModules(sourceFile) { - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - if (!ts.isModuleWithStringLiteralName(statement)) { - return false; - } - } - return true; - } - function updateShapeSignature(program, sourceFile) { - ts.Debug.assert(!!sourceFile); - if (hasShapeChanged.has(sourceFile.path)) { - return false; - } - hasShapeChanged.set(sourceFile.path, true); - var info = fileInfos.get(sourceFile.path); - ts.Debug.assert(!!info); - var prevSignature = info.signature; - var latestSignature; - if (sourceFile.isDeclarationFile) { - latestSignature = sourceFile.version; - info.signature = latestSignature; - } - else { - var emitOutput = getFileEmitOutput(program, sourceFile, true); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - latestSignature = options.computeHash(emitOutput.outputFiles[0].text); - info.signature = latestSignature; - } - else { - latestSignature = prevSignature; - } - } - return !prevSignature || latestSignature !== prevSignature; - } - function getReferencedFiles(program, sourceFile) { - var referencedFiles; - if (sourceFile.imports && sourceFile.imports.length > 0) { - var checker = program.getTypeChecker(); - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var importName = _a[_i]; - var symbol = checker.getSymbolAtLocation(importName); - if (symbol && symbol.declarations && symbol.declarations[0]) { - var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); - if (declarationSourceFile) { - addReferencedFile(declarationSourceFile.path); - } - } - } - } - var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { - var referencedFile = _c[_b]; - var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(referencedPath); - } - } - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { - if (!resolvedTypeReferenceDirective) { - return; - } - var fileName = resolvedTypeReferenceDirective.resolvedFileName; - var typeFilePath = ts.toPath(fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(typeFilePath); - }); - } - return referencedFiles; - function addReferencedFile(referencedPath) { - if (!referencedFiles) { - referencedFiles = ts.createMap(); - } - referencedFiles.set(referencedPath, true); - } - } - function getAllFilesExcludingDefaultLibraryFile(program, firstSourceFile) { - if (allFilesExcludingDefaultLibraryFile) { - return allFilesExcludingDefaultLibraryFile; - } - var result; - addSourceFile(firstSourceFile); - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - if (sourceFile !== firstSourceFile) { - addSourceFile(sourceFile); - } - } - allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; - return allFilesExcludingDefaultLibraryFile; - function addSourceFile(sourceFile) { - if (!program.isSourceFileDefaultLibrary(sourceFile)) { - (result || (result = [])).push(sourceFile); - } - } - } - function getNonModuleEmitHandler() { - return { - onAddSourceFile: ts.noop, - onRemoveSourceFile: ts.noop, - onUpdateSourceFile: ts.noop, - onUpdateSourceFileWithSameVersion: ts.returnFalse, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function getFilesAffectedByUpdatedShape(program, sourceFile) { - var options = program.getCompilerOptions(); - if (options && (options.out || options.outFile)) { - return [sourceFile]; - } - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - } - function getModuleEmitHandler() { - var references = ts.createMap(); - return { - onAddSourceFile: setReferences, - onRemoveSourceFile: onRemoveSourceFile, - onUpdateSourceFile: updateReferences, - onUpdateSourceFileWithSameVersion: updateReferencesTrackingChangedReferences, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function setReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - } - function updateReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - else { - references.delete(sourceFile.path); - } - } - function updateReferencesTrackingChangedReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (!newReferences) { - return references.delete(sourceFile.path); - } - var oldReferences = references.get(sourceFile.path); - references.set(sourceFile.path, newReferences); - if (!oldReferences || oldReferences.size !== newReferences.size) { - return true; - } - return ts.forEachEntry(newReferences, function (_true, referencedPath) { return !oldReferences.delete(referencedPath); }) || - !!oldReferences.size; - } - function onRemoveSourceFile(removedFilePath) { - references.forEach(function (referencesInFile, filePath) { - if (referencesInFile.has(removedFilePath)) { - var referencedByInfo = fileInfos.get(filePath); - if (referencedByInfo) { - registerChangedFile(filePath); - } - } - }); - references.delete(removedFilePath); - } - function getReferencedByPaths(referencedFilePath) { - return ts.mapDefinedIter(references.entries(), function (_a) { - var filePath = _a[0], referencesInFile = _a[1]; - return referencesInFile.has(referencedFilePath) ? filePath : undefined; - }); - } - function getFilesAffectedByUpdatedShape(program, sourceFile) { - if (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile)) { - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { - return [sourceFile]; - } - var seenFileNamesMap = ts.createMap(); - var path = sourceFile.path; - seenFileNamesMap.set(path, sourceFile); - var queue = getReferencedByPaths(path); - while (queue.length > 0) { - var currentPath = queue.pop(); - if (!seenFileNamesMap.has(currentPath)) { - var currentSourceFile = program.getSourceFileByPath(currentPath); - seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(program, currentSourceFile)) { - queue.push.apply(queue, getReferencedByPaths(currentPath)); - } - } - } - return ts.flatMapIter(seenFileNamesMap.values(), function (value) { return value; }); - } - } - } - ts.createBuilder = createBuilder; -})(ts || (ts = {})); -var ts; (function (ts) { var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; function findConfigFile(searchPath, fileExists, configName) { @@ -58595,23 +59840,29 @@ var ts; return errorMessage; } ts.formatDiagnostic = formatDiagnostic; - var redForegroundEscapeSequence = "\u001b[91m"; - var yellowForegroundEscapeSequence = "\u001b[93m"; - var blueForegroundEscapeSequence = "\u001b[93m"; + var ForegroundColorEscapeSequences; + (function (ForegroundColorEscapeSequences) { + ForegroundColorEscapeSequences["Grey"] = "\u001B[90m"; + ForegroundColorEscapeSequences["Red"] = "\u001B[91m"; + ForegroundColorEscapeSequences["Yellow"] = "\u001B[93m"; + ForegroundColorEscapeSequences["Blue"] = "\u001B[94m"; + ForegroundColorEscapeSequences["Cyan"] = "\u001B[96m"; + })(ForegroundColorEscapeSequences = ts.ForegroundColorEscapeSequences || (ts.ForegroundColorEscapeSequences = {})); var gutterStyleSequence = "\u001b[30;47m"; var gutterSeparator = " "; var resetEscapeSequence = "\u001b[0m"; var ellipsis = "..."; function getCategoryFormat(category) { switch (category) { - case ts.DiagnosticCategory.Warning: return yellowForegroundEscapeSequence; - case ts.DiagnosticCategory.Error: return redForegroundEscapeSequence; - case ts.DiagnosticCategory.Message: return blueForegroundEscapeSequence; + case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } - function formatAndReset(text, formatStyle) { + function formatColorAndReset(text, formatStyle) { return formatStyle + text + resetEscapeSequence; } + ts.formatColorAndReset = formatColorAndReset; function padLeft(s, length) { while (s.length < length) { s = " " + s; @@ -58624,9 +59875,9 @@ var ts; var diagnostic = diagnostics_2[_i]; var context = ""; if (diagnostic.file) { - var start = diagnostic.start, length_5 = diagnostic.length, file = diagnostic.file; + var start = diagnostic.start, length_4 = diagnostic.length, file = diagnostic.file; var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; - var _b = ts.getLineAndCharacterOfPosition(file, start + length_5), lastLine = _b.line, lastLineChar = _b.character; + var _b = ts.getLineAndCharacterOfPosition(file, start + length_4), lastLine = _b.line, lastLineChar = _b.character; var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line; var relativeFileName = host ? ts.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : file.fileName; var hasMoreThanFiveLines = (lastLine - firstLine) >= 4; @@ -58637,7 +59888,7 @@ var ts; context += host.getNewLine(); for (var i = firstLine; i <= lastLine; i++) { if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { - context += formatAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + context += formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); i = lastLine - 1; } var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0); @@ -58645,10 +59896,10 @@ var ts; var lineContent = file.text.slice(lineStart, lineEnd); lineContent = lineContent.replace(/\s+$/g, ""); lineContent = lineContent.replace("\t", " "); - context += formatAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; context += lineContent + host.getNewLine(); - context += formatAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; - context += redForegroundEscapeSequence; + context += formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += ForegroundColorEscapeSequences.Red; if (i === firstLine) { var lastCharForLine = i === lastLine ? lastLineChar : undefined; context += lineContent.slice(0, firstLineChar).replace(/\S/g, " "); @@ -58662,19 +59913,25 @@ var ts; } context += resetEscapeSequence; } - output += host.getNewLine(); - output += relativeFileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; + output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan); + output += ":"; + output += formatColorAndReset("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow); + output += ":"; + output += formatColorAndReset("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); + output += " - "; } var categoryColor = getCategoryFormat(diagnostic.category); var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatAndReset(category, categoryColor) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); + output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey); + output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); if (diagnostic.file) { output += host.getNewLine(); output += context; } output += host.getNewLine(); } - return output; + return output + host.getNewLine(); } ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext; function flattenDiagnosticMessageText(messageText, newLine) { @@ -58882,7 +60139,8 @@ var ts; dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, sourceFileToPackageName: sourceFileToPackageName, - redirectTargetsSet: redirectTargetsSet + redirectTargetsSet: redirectTargetsSet, + isEmittedFile: isEmittedFile }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -58987,8 +60245,9 @@ var ts; ts.Debug.assert(j === resolutions.length); return result; function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, oldProgramState) { - var resolutionToFile = ts.getResolvedModule(oldProgramState.file, moduleName); - if (resolutionToFile) { + var resolutionToFile = ts.getResolvedModule(oldProgramState.oldSourceFile, moduleName); + var resolvedFile = resolutionToFile && oldProgramState.program && oldProgramState.program.getSourceFile(resolutionToFile.resolvedFileName); + if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) { return false; } var ambientModule = oldProgramState.program && oldProgramState.program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(moduleName); @@ -59107,7 +60366,7 @@ var ts; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = getModuleNames(newSourceFile); - var oldProgramState = { program: oldProgram, file: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, oldProgramState); var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { @@ -59205,24 +60464,26 @@ var ts; } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; - if (options.noEmit) { - return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; - } - if (options.noEmitOnError) { - var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); - if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { - declarationDiagnostics = program.getDeclarationDiagnostics(undefined, cancellationToken); + if (!emitOnlyDtsFiles) { + if (options.noEmit) { + return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; } - if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { - return { - diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), - sourceMaps: undefined, - emittedFiles: undefined, - emitSkipped: true - }; + if (options.noEmitOnError) { + var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); + if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { + declarationDiagnostics = program.getDeclarationDiagnostics(undefined, cancellationToken); + } + if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { + return { + diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), + sourceMaps: undefined, + emittedFiles: undefined, + emitSkipped: true + }; + } } } - var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); + var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); ts.performance.mark("beforeEmit"); var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); @@ -59334,62 +60595,62 @@ var ts; return diagnostics; function walk(node) { switch (parent.kind) { - case 147: - case 150: + case 148: + case 151: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 187: - case 229: - case 188: - case 227: + case 156: + case 190: + case 232: + case 191: + case 230: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); return; } } switch (node.kind) { - case 238: + case 241: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 244: + case 247: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 263: + case 266: var heritageClause = node; if (heritageClause.token === 108) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 231: + case 234: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 234: + case 237: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 232: + case 235: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 233: + case 236: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 204: + case 207: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 203: + case 206: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 185: + case 188: ts.Debug.fail(); } var prevParent = parent; @@ -59402,25 +60663,25 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 230: - case 152: - case 151: + case 233: case 153: + case 152: case 154: case 155: - case 187: - case 229: - case 188: + case 156: + case 190: + case 232: + case 191: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } - case 209: + case 212: if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 209); + return checkModifiers(nodes, parent.kind === 212); } break; - case 150: + case 151: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -59431,15 +60692,15 @@ var ts; return; } break; - case 147: + case 148: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 182: - case 183: - case 202: + case 185: + case 186: + case 205: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); return; @@ -59462,7 +60723,7 @@ var ts; case 114: case 112: case 113: - case 131: + case 132: case 124: case 117: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); @@ -59544,6 +60805,7 @@ var ts; && !file.isDeclarationFile) { var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); var importDecl = ts.createImportDeclaration(undefined, undefined, undefined); + ts.addEmitFlags(importDecl, 67108864); externalHelpersModuleReference.parent = importDecl; importDecl.parent = file; imports = [externalHelpersModuleReference]; @@ -59561,9 +60823,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 239: - case 238: - case 245: + case 242: + case 241: + case 248: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || !ts.isStringLiteral(moduleNameExpr)) { break; @@ -59575,7 +60837,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 234: + case 237: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || file.isDeclarationFile)) { var moduleName = node.name; var nameText = ts.getTextOfIdentifierOrLiteral(moduleName); @@ -59711,7 +60973,7 @@ var ts; } }, shouldCreateNewSourceFile); if (packageId) { - var packageIdKey = packageId.name + "/" + packageId.subModuleName + "@" + packageId.version; + var packageIdKey = ts.packageIdToString(packageId); var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); if (fileFromPackageId) { var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); @@ -59823,7 +61085,7 @@ var ts; collectExternalModuleReferences(file); if (file.imports.length || file.moduleAugmentations.length) { var moduleNames = getModuleNames(file); - var oldProgramState = { program: oldProgram, file: file, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory), file, oldProgramState); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { @@ -60015,6 +61277,14 @@ var ts; if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } + if (options.emitDeclarationOnly) { + if (!options.declaration) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations"); + } + if (options.noEmit) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); + } + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); @@ -60034,7 +61304,9 @@ var ts; var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createMap(); ts.forEachEmittedFile(emitHost, function (emitFileNames) { - verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + if (!options.emitDeclarationOnly) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + } verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); } @@ -60042,12 +61314,12 @@ var ts; if (emitFileName) { var emitFilePath = toPath(emitFileName); if (filesByName.has(emitFilePath)) { - var chain_1; + var chain_2; if (!options.configFilePath) { - chain_1 = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + chain_2 = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } - chain_1 = ts.chainDiagnosticMessages(chain_1, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); - blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_1)); + chain_2 = ts.chainDiagnosticMessages(chain_2, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_2)); } var emitFileKey = !host.useCaseSensitiveFileNames() ? emitFilePath.toLocaleLowerCase() : emitFilePath; if (emitFilesSeen.has(emitFileKey)) { @@ -60141,6 +61413,31 @@ var ts; hasEmitBlockingDiagnostics.set(toPath(emitFileName), true); programDiagnostics.add(diag); } + function isEmittedFile(file) { + if (options.noEmit) { + return false; + } + var filePath = toPath(file); + if (getSourceFileByPath(filePath)) { + return false; + } + var out = options.outFile || options.out; + if (out) { + return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts"); + } + if (options.outDir) { + return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); + } + if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts")) { + var filePathWithoutExtension = ts.removeFileExtension(filePath); + return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts")) || + !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx")); + } + return false; + } + function isSameFile(file1, file2) { + return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0; + } } ts.createProgram = createProgram; function getResolutionDiagnostic(options, _a) { @@ -60181,9 +61478,516 @@ var ts; } })(ts || (ts = {})); var ts; +(function (ts) { + function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { + var outputFiles = []; + var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; + function writeFile(fileName, text, writeByteOrderMark) { + outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); + } + } + ts.getFileEmitOutput = getFileEmitOutput; +})(ts || (ts = {})); +(function (ts) { + var BuilderState; + (function (BuilderState) { + function getReferencedFiles(program, sourceFile, getCanonicalFileName) { + var referencedFiles; + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = program.getTypeChecker(); + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importName = _a[_i]; + var symbol = checker.getSymbolAtLocation(importName); + if (symbol && symbol.declarations && symbol.declarations[0]) { + var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); + if (declarationSourceFile) { + addReferencedFile(declarationSourceFile.path); + } + } + } + } + var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(referencedPath); + } + } + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = ts.toPath(fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }); + } + return referencedFiles; + function addReferencedFile(referencedPath) { + if (!referencedFiles) { + referencedFiles = ts.createMap(); + } + referencedFiles.set(referencedPath, true); + } + } + function canReuseOldState(newReferencedMap, oldState) { + return oldState && !oldState.referencedMap === !newReferencedMap; + } + BuilderState.canReuseOldState = canReuseOldState; + function create(newProgram, getCanonicalFileName, oldState) { + var fileInfos = ts.createMap(); + var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? ts.createMap() : undefined; + var hasCalledUpdateShapeSignature = ts.createMap(); + var useOldState = canReuseOldState(referencedMap, oldState); + for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var version_1 = sourceFile.version; + var oldInfo = useOldState && oldState.fileInfos.get(sourceFile.path); + if (referencedMap) { + var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); + if (newReferences) { + referencedMap.set(sourceFile.path, newReferences); + } + } + fileInfos.set(sourceFile.path, { version: version_1, signature: oldInfo && oldInfo.signature }); + } + return { + fileInfos: fileInfos, + referencedMap: referencedMap, + hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature, + allFilesExcludingDefaultLibraryFile: undefined, + allFileNames: undefined + }; + } + BuilderState.create = create; + function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature) { + var signatureCache = cacheToUpdateSignature || ts.createMap(); + var sourceFile = programOfThisState.getSourceFileByPath(path); + if (!sourceFile) { + return ts.emptyArray; + } + if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash)) { + return [sourceFile]; + } + var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash); + if (!cacheToUpdateSignature) { + updateSignaturesFromCache(state, signatureCache); + } + return result; + } + BuilderState.getFilesAffectedBy = getFilesAffectedBy; + function updateSignaturesFromCache(state, signatureCache) { + signatureCache.forEach(function (signature, path) { + state.fileInfos.get(path).signature = signature; + state.hasCalledUpdateShapeSignature.set(path, true); + }); + } + BuilderState.updateSignaturesFromCache = updateSignaturesFromCache; + function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash) { + ts.Debug.assert(!!sourceFile); + if (state.hasCalledUpdateShapeSignature.has(sourceFile.path) || cacheToUpdateSignature.has(sourceFile.path)) { + return false; + } + var info = state.fileInfos.get(sourceFile.path); + ts.Debug.assert(!!info); + var prevSignature = info.signature; + var latestSignature; + if (sourceFile.isDeclarationFile) { + latestSignature = sourceFile.version; + } + else { + var emitOutput = ts.getFileEmitOutput(programOfThisState, sourceFile, true, cancellationToken); + if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { + latestSignature = computeHash(emitOutput.outputFiles[0].text); + } + else { + latestSignature = prevSignature; + } + } + cacheToUpdateSignature.set(sourceFile.path, latestSignature); + return !prevSignature || latestSignature !== prevSignature; + } + function getAllDependencies(state, programOfThisState, sourceFile) { + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + return getAllFileNames(state, programOfThisState); + } + if (!state.referencedMap || (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile))) { + return getAllFileNames(state, programOfThisState); + } + var seenMap = ts.createMap(); + var queue = [sourceFile.path]; + while (queue.length) { + var path = queue.pop(); + if (!seenMap.has(path)) { + seenMap.set(path, true); + var references = state.referencedMap.get(path); + if (references) { + var iterator = references.keys(); + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + queue.push(value); + } + } + } + } + return ts.arrayFrom(ts.mapDefinedIterator(seenMap.keys(), function (path) { + var file = programOfThisState.getSourceFileByPath(path); + return file ? file.fileName : path; + })); + var _b; + } + BuilderState.getAllDependencies = getAllDependencies; + function getAllFileNames(state, programOfThisState) { + if (!state.allFileNames) { + var sourceFiles = programOfThisState.getSourceFiles(); + state.allFileNames = sourceFiles === ts.emptyArray ? ts.emptyArray : sourceFiles.map(function (file) { return file.fileName; }); + } + return state.allFileNames; + } + function getReferencedByPaths(state, referencedFilePath) { + return ts.arrayFrom(ts.mapDefinedIterator(state.referencedMap.entries(), function (_a) { + var filePath = _a[0], referencesInFile = _a[1]; + return referencesInFile.has(referencedFilePath) ? filePath : undefined; + })); + } + function containsOnlyAmbientModules(sourceFile) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (!ts.isModuleWithStringLiteralName(statement)) { + return false; + } + } + return true; + } + function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { + if (state.allFilesExcludingDefaultLibraryFile) { + return state.allFilesExcludingDefaultLibraryFile; + } + var result; + addSourceFile(firstSourceFile); + for (var _i = 0, _a = programOfThisState.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + if (sourceFile !== firstSourceFile) { + addSourceFile(sourceFile); + } + } + state.allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; + return state.allFilesExcludingDefaultLibraryFile; + function addSourceFile(sourceFile) { + if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { + (result || (result = [])).push(sourceFile); + } + } + } + function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash) { + if (!ts.isExternalModule(sourceFileWithUpdatedShape) && !containsOnlyAmbientModules(sourceFileWithUpdatedShape)) { + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + var seenFileNamesMap = ts.createMap(); + seenFileNamesMap.set(sourceFileWithUpdatedShape.path, sourceFileWithUpdatedShape); + var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.path); + while (queue.length > 0) { + var currentPath = queue.pop(); + if (!seenFileNamesMap.has(currentPath)) { + var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); + seenFileNamesMap.set(currentPath, currentSourceFile); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash)) { + queue.push.apply(queue, getReferencedByPaths(state, currentPath)); + } + } + } + return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); + } + })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + function hasSameKeys(map1, map2) { + return map1 === map2 || map1 && map2 && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); }); + } + function createBuilderProgramState(newProgram, getCanonicalFileName, oldState) { + var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState); + state.program = newProgram; + var compilerOptions = newProgram.getCompilerOptions(); + if (!compilerOptions.outFile && !compilerOptions.out) { + state.semanticDiagnosticsPerFile = ts.createMap(); + } + state.changedFilesSet = ts.createMap(); + var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState); + var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile; + if (useOldState) { + if (!oldState.currentChangedFilePath) { + ts.Debug.assert(!oldState.affectedFiles && (!oldState.currentAffectedFilesSignatures || !oldState.currentAffectedFilesSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated"); + } + if (canCopySemanticDiagnostics) { + ts.Debug.assert(!ts.forEachKey(oldState.changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files"); + } + ts.copyEntries(oldState.changedFilesSet, state.changedFilesSet); + } + var referencedMap = state.referencedMap; + var oldReferencedMap = useOldState && oldState.referencedMap; + state.fileInfos.forEach(function (info, sourceFilePath) { + var oldInfo; + var newReferences; + if (!useOldState || + !(oldInfo = oldState.fileInfos.get(sourceFilePath)) || + oldInfo.version !== info.version || + !hasSameKeys(newReferences = referencedMap && referencedMap.get(sourceFilePath), oldReferencedMap && oldReferencedMap.get(sourceFilePath)) || + newReferences && ts.forEachKey(newReferences, function (path) { return !state.fileInfos.has(path) && oldState.fileInfos.has(path); })) { + state.changedFilesSet.set(sourceFilePath, true); + } + else if (canCopySemanticDiagnostics) { + var diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath); + if (diagnostics) { + state.semanticDiagnosticsPerFile.set(sourceFilePath, diagnostics); + } + } + }); + return state; + } + function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) { + ts.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.path)); + } + function getNextAffectedFile(state, cancellationToken, computeHash) { + while (true) { + var affectedFiles = state.affectedFiles; + if (affectedFiles) { + var seenAffectedFiles = state.seenAffectedFiles, semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile; + var affectedFilesIndex = state.affectedFilesIndex; + while (affectedFilesIndex < affectedFiles.length) { + var affectedFile = affectedFiles[affectedFilesIndex]; + if (!seenAffectedFiles.has(affectedFile.path)) { + state.affectedFilesIndex = affectedFilesIndex; + semanticDiagnosticsPerFile.delete(affectedFile.path); + return affectedFile; + } + seenAffectedFiles.set(affectedFile.path, true); + affectedFilesIndex++; + } + state.changedFilesSet.delete(state.currentChangedFilePath); + state.currentChangedFilePath = undefined; + ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures); + state.currentAffectedFilesSignatures.clear(); + state.affectedFiles = undefined; + } + var nextKey = state.changedFilesSet.keys().next(); + if (nextKey.done) { + return undefined; + } + var compilerOptions = state.program.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + ts.Debug.assert(!state.semanticDiagnosticsPerFile); + return state.program; + } + state.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures || ts.createMap(); + state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, state.program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures); + state.currentChangedFilePath = nextKey.value; + state.semanticDiagnosticsPerFile.delete(nextKey.value); + state.affectedFilesIndex = 0; + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); + } + } + function doneWithAffectedFile(state, affected) { + if (affected === state.program) { + state.changedFilesSet.clear(); + } + else { + state.seenAffectedFiles.set(affected.path, true); + state.affectedFilesIndex++; + } + } + function toAffectedFileResult(state, result, affected) { + doneWithAffectedFile(state, affected); + return { result: result, affected: affected }; + } + function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) { + var path = sourceFile.path; + var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); + if (cachedDiagnostics) { + return cachedDiagnostics; + } + var diagnostics = state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + state.semanticDiagnosticsPerFile.set(path, diagnostics); + return diagnostics; + } + var BuilderProgramKind; + (function (BuilderProgramKind) { + BuilderProgramKind[BuilderProgramKind["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram"; + BuilderProgramKind[BuilderProgramKind["EmitAndSemanticDiagnosticsBuilderProgram"] = 1] = "EmitAndSemanticDiagnosticsBuilderProgram"; + })(BuilderProgramKind = ts.BuilderProgramKind || (ts.BuilderProgramKind = {})); + function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + var host; + var newProgram; + if (ts.isArray(newProgramOrRootNames)) { + newProgram = ts.createProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram && oldProgram.getProgram()); + host = oldProgramOrHost; + } + else { + newProgram = newProgramOrRootNames; + host = hostOrOptions; + oldProgram = oldProgramOrHost; + } + return { host: host, newProgram: newProgram, oldProgram: oldProgram }; + } + ts.getBuilderCreationParameters = getBuilderCreationParameters; + function createBuilderProgram(kind, _a) { + var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram; + var oldState = oldProgram && oldProgram.getState(); + if (oldState && newProgram === oldState.program) { + newProgram = undefined; + oldState = undefined; + return oldProgram; + } + var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + var computeHash = host.createHash || ts.identity; + var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); + newProgram = undefined; + oldProgram = undefined; + oldState = undefined; + var result = { + getState: function () { return state; }, + getProgram: function () { return state.program; }, + getCompilerOptions: function () { return state.program.getCompilerOptions(); }, + getSourceFile: function (fileName) { return state.program.getSourceFile(fileName); }, + getSourceFiles: function () { return state.program.getSourceFiles(); }, + getOptionsDiagnostics: function (cancellationToken) { return state.program.getOptionsDiagnostics(cancellationToken); }, + getGlobalDiagnostics: function (cancellationToken) { return state.program.getGlobalDiagnostics(cancellationToken); }, + getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return state.program.getSyntacticDiagnostics(sourceFile, cancellationToken); }, + getSemanticDiagnostics: getSemanticDiagnostics, + emit: emit, + getAllDependencies: function (sourceFile) { return ts.BuilderState.getAllDependencies(state, state.program, sourceFile); }, + getCurrentDirectory: function () { return state.program.getCurrentDirectory(); } + }; + if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { + result.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; + } + else if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + result.emitNextAffectedFile = emitNextAffectedFile; + } + else { + ts.notImplemented(); + } + return result; + function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash); + if (!affected) { + return undefined; + } + return toAffectedFileResult(state, state.program.emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected); + } + function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); + if (!targetSourceFile) { + var sourceMaps = []; + var emitSkipped = void 0; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; + } + } + return state.program.emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + } + function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) { + while (true) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash); + if (!affected) { + return undefined; + } + else if (affected === state.program) { + return toAffectedFileResult(state, state.program.getSemanticDiagnostics(undefined, cancellationToken), affected); + } + if (ignoreSourceFile && ignoreSourceFile(affected)) { + doneWithAffectedFile(state, affected); + continue; + } + return toAffectedFileResult(state, getSemanticDiagnosticsOfFile(state, affected, cancellationToken), affected); + } + } + function getSemanticDiagnostics(sourceFile, cancellationToken) { + assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); + var compilerOptions = state.program.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + ts.Debug.assert(!state.semanticDiagnosticsPerFile); + return state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + } + if (sourceFile) { + return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); + } + if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { + var affected = void 0; + while (affected = getNextAffectedFile(state, cancellationToken, computeHash)) { + doneWithAffectedFile(state, affected); + } + } + var diagnostics; + for (var _i = 0, _a = state.program.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile_1 = _a[_i]; + diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile_1, cancellationToken)); + } + return diagnostics || ts.emptyArray; + } + } + ts.createBuilderProgram = createBuilderProgram; +})(ts || (ts = {})); +(function (ts) { + function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + return ts.createBuilderProgram(ts.BuilderProgramKind.SemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram)); + } + ts.createSemanticDiagnosticsBuilderProgram = createSemanticDiagnosticsBuilderProgram; + function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + return ts.createBuilderProgram(ts.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram)); + } + ts.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram; + function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + var program = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram).newProgram; + return { + getProgram: function () { return program; }, + getState: ts.notImplemented, + getCompilerOptions: ts.notImplemented, + getSourceFile: ts.notImplemented, + getSourceFiles: ts.notImplemented, + getOptionsDiagnostics: ts.notImplemented, + getGlobalDiagnostics: ts.notImplemented, + getSyntacticDiagnostics: ts.notImplemented, + getSemanticDiagnostics: ts.notImplemented, + emit: ts.notImplemented, + getAllDependencies: ts.notImplemented, + getCurrentDirectory: ts.notImplemented + }; + } + ts.createAbstractBuilder = createAbstractBuilder; +})(ts || (ts = {})); +var ts; (function (ts) { ts.maxNumberOfFilesToIterateForInvalidation = 256; - function createResolutionCache(resolutionHost, rootDirForResolution) { + function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var allFilesHaveInvalidatedResolution = false; @@ -60192,6 +61996,7 @@ var ts; var resolvedTypeReferenceDirectives = ts.createMap(); var perDirectoryResolvedTypeReferenceDirectives = ts.createMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); var failedLookupDefaultExtensions = [".ts", ".tsx", ".js", ".jsx", ".json"]; var customFailedLookupPaths = ts.createMap(); var directoryWatchesOfFailedLookups = ts.createMap(); @@ -60241,8 +62046,8 @@ var ts; filesWithChangedSetOfUnresolvedImports = undefined; return collected; } - function createHasInvalidatedResolution() { - if (allFilesHaveInvalidatedResolution) { + function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { + if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { filesWithInvalidatedResolutions = undefined; return ts.returnTrue; } @@ -60353,8 +62158,8 @@ var ts; function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile) { return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, undefined, false); } - function resolveModuleNames(moduleNames, containingFile, reusedNames, logChanges) { - return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChanges); + function resolveModuleNames(moduleNames, containingFile, reusedNames) { + return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChangesWhenResolvingModule); } function isNodeModulesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules"); @@ -60475,8 +62280,8 @@ var ts; function createDirectoryWatcher(directory, dirPath) { return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (resolutionHost.getCachedDirectoryStructureHost) { - resolutionHost.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } if (!allFilesHaveInvalidatedResolution && dirPath === rootPath || isNodeModulesDirectory(dirPath) || ts.getDirectoryPath(fileOrDirectoryPath) === dirPath) { @@ -60554,6 +62359,9 @@ var ts; if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) { return false; } + if (ts.isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { + return false; + } isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } @@ -60568,8 +62376,8 @@ var ts; function createTypeRootsWatch(_typeRootPath, typeRoot) { return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (resolutionHost.getCachedDirectoryStructureHost) { - resolutionHost.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } resolutionHost.onChangedAutomaticTypeDirectiveNames(); }, 1); @@ -60601,91 +62409,112 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var defaultFormatDiagnosticsHost = ts.sys ? { + var sysFormatDiagnosticsHost = ts.sys ? { getCurrentDirectory: function () { return ts.sys.getCurrentDirectory(); }, getNewLine: function () { return ts.sys.newLine; }, getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames) } : undefined; - function createDiagnosticReporter(system, worker, formatDiagnosticsHost) { - if (system === void 0) { system = ts.sys; } - if (worker === void 0) { worker = reportDiagnosticSimply; } - return function (diagnostic) { return worker(diagnostic, getFormatDiagnosticsHost(), system); }; - function getFormatDiagnosticsHost() { - return formatDiagnosticsHost || (formatDiagnosticsHost = system === ts.sys ? defaultFormatDiagnosticsHost : { - getCurrentDirectory: function () { return system.getCurrentDirectory(); }, - getNewLine: function () { return system.newLine; }, - getCanonicalFileName: ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames), - }); + function createDiagnosticReporter(system, pretty) { + var host = system === ts.sys ? sysFormatDiagnosticsHost : { + getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getNewLine: function () { return system.newLine; }, + getCanonicalFileName: ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames), + }; + if (!pretty) { + return function (diagnostic) { return system.write(ts.formatDiagnostic(diagnostic, host)); }; } - } - ts.createDiagnosticReporter = createDiagnosticReporter; - function createWatchDiagnosticReporter(system) { - if (system === void 0) { system = ts.sys; } + var diagnostics = new Array(1); return function (diagnostic) { - var output = new Date().toLocaleTimeString() + " - "; - output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine + system.newLine); - system.write(output); + diagnostics[0] = diagnostic; + system.write(ts.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine()); + diagnostics[0] = undefined; }; } - ts.createWatchDiagnosticReporter = createWatchDiagnosticReporter; - function reportDiagnostics(diagnostics, reportDiagnostic) { - for (var _i = 0, diagnostics_3 = diagnostics; _i < diagnostics_3.length; _i++) { - var diagnostic = diagnostics_3[_i]; - reportDiagnostic(diagnostic); + ts.createDiagnosticReporter = createDiagnosticReporter; + function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { + if (system.clearScreen && + diagnostic.code !== ts.Diagnostics.Compilation_complete_Watching_for_file_changes.code && + !options.extendedDiagnostics && + !options.diagnostics) { + system.clearScreen(); } } - ts.reportDiagnostics = reportDiagnostics; - function reportDiagnosticSimply(diagnostic, host, system) { - system.write(ts.formatDiagnostic(diagnostic, host)); + function createWatchStatusReporter(system, pretty) { + return pretty ? + function (diagnostic, newLine, options) { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + var output = "[" + ts.formatColorAndReset(new Date().toLocaleTimeString(), ts.ForegroundColorEscapeSequences.Grey) + "] "; + output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine + newLine); + system.write(output); + } : + function (diagnostic, newLine, options) { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + var output = new Date().toLocaleTimeString() + " - "; + output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine + newLine); + system.write(output); + }; } - ts.reportDiagnosticSimply = reportDiagnosticSimply; - function reportDiagnosticWithColorAndContext(diagnostic, host, system) { - system.write(ts.formatDiagnosticsWithColorAndContext([diagnostic], host) + host.getNewLine()); + ts.createWatchStatusReporter = createWatchStatusReporter; + function parseConfigFileWithSystem(configFileName, optionsToExtend, system, reportDiagnostic) { + var host = system; + host.onConfigFileDiagnostic = reportDiagnostic; + host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(ts.sys, reportDiagnostic, diagnostic); }; + var result = getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host); + host.onConfigFileDiagnostic = undefined; + host.onUnRecoverableConfigFileDiagnostic = undefined; + return result; } - ts.reportDiagnosticWithColorAndContext = reportDiagnosticWithColorAndContext; - function parseConfigFile(configFileName, optionsToExtend, system, reportDiagnostic, reportWatchDiagnostic) { + ts.parseConfigFileWithSystem = parseConfigFileWithSystem; + function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) { var configFileText; try { - configFileText = system.readFile(configFileName); + configFileText = host.readFile(configFileName); } catch (e) { var error = ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, configFileName, e.message); - reportWatchDiagnostic(error); - system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); - return; + host.onUnRecoverableConfigFileDiagnostic(error); + return undefined; } if (!configFileText) { var error = ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, configFileName); - reportDiagnostics([error], reportDiagnostic); - system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); - return; + host.onUnRecoverableConfigFileDiagnostic(error); + return undefined; } var result = ts.parseJsonText(configFileName, configFileText); - reportDiagnostics(result.parseDiagnostics, reportDiagnostic); - var cwd = system.getCurrentDirectory(); - var configParseResult = ts.parseJsonSourceFileConfigFileContent(result, system, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd)); - reportDiagnostics(configParseResult.errors, reportDiagnostic); + result.parseDiagnostics.forEach(function (diagnostic) { return host.onConfigFileDiagnostic(diagnostic); }); + var cwd = host.getCurrentDirectory(); + var configParseResult = ts.parseJsonSourceFileConfigFileContent(result, host, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd)); + configParseResult.errors.forEach(function (diagnostic) { return host.onConfigFileDiagnostic(diagnostic); }); return configParseResult; } - ts.parseConfigFile = parseConfigFile; - function reportEmittedFiles(files, system) { - if (!files || files.length === 0) { - return; + ts.getParsedCommandLineOfConfigFile = getParsedCommandLineOfConfigFile; + function emitFilesAndReportErrors(program, reportDiagnostic, writeFileName) { + var diagnostics = program.getSyntacticDiagnostics().slice(); + var reportSemanticDiagnostics = false; + if (diagnostics.length === 0) { + ts.addRange(diagnostics, program.getOptionsDiagnostics()); + ts.addRange(diagnostics, program.getGlobalDiagnostics()); + if (diagnostics.length === 0) { + reportSemanticDiagnostics = true; + } } - var currentDir = system.getCurrentDirectory(); - for (var _i = 0, files_2 = files; _i < files_2.length; _i++) { - var file = files_2[_i]; - var filepath = ts.getNormalizedAbsolutePath(file, currentDir); - system.write("TSFILE: " + filepath + system.newLine); + var _a = program.emit(), emittedFiles = _a.emittedFiles, emitSkipped = _a.emitSkipped, emitDiagnostics = _a.diagnostics; + ts.addRange(diagnostics, emitDiagnostics); + if (reportSemanticDiagnostics) { + ts.addRange(diagnostics, program.getSemanticDiagnostics()); } - } - function handleEmitOutputAndReportErrors(system, program, emittedFiles, emitSkipped, diagnostics, reportDiagnostic) { - reportDiagnostics(ts.sortAndDeduplicateDiagnostics(diagnostics), reportDiagnostic); - reportEmittedFiles(emittedFiles, system); - if (program.getCompilerOptions().listFiles) { - ts.forEach(program.getSourceFiles(), function (file) { - system.write(file.fileName + system.newLine); + ts.sortAndDeduplicateDiagnostics(diagnostics).forEach(reportDiagnostic); + if (writeFileName) { + var currentDir_1 = program.getCurrentDirectory(); + ts.forEach(emittedFiles, function (file) { + var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1); + writeFileName("TSFILE: " + filepath); }); + if (program.getCompilerOptions().listFiles) { + ts.forEach(program.getSourceFiles(), function (file) { + writeFileName(file.fileName); + }); + } } if (emitSkipped && diagnostics.length > 0) { return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped; @@ -60695,89 +62524,91 @@ var ts; } return ts.ExitStatus.Success; } - ts.handleEmitOutputAndReportErrors = handleEmitOutputAndReportErrors; - function createWatchingSystemHost(pretty, system, parseConfigFile, reportDiagnostic, reportWatchDiagnostic) { + ts.emitFilesAndReportErrors = emitFilesAndReportErrors; + var noopFileWatcher = { close: ts.noop }; + function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { if (system === void 0) { system = ts.sys; } - reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system, pretty ? reportDiagnosticWithColorAndContext : reportDiagnosticSimply); - reportWatchDiagnostic = reportWatchDiagnostic || createWatchDiagnosticReporter(system); - parseConfigFile = parseConfigFile || ts.parseConfigFile; + if (!createProgram) { + createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram; + } + var host = system; + var useCaseSensitiveFileNames = function () { return system.useCaseSensitiveFileNames; }; + var writeFileName = function (s) { return system.write(s + system.newLine); }; return { - system: system, - parseConfigFile: parseConfigFile, - reportDiagnostic: reportDiagnostic, - reportWatchDiagnostic: reportWatchDiagnostic, - beforeCompile: ts.noop, - afterCompile: compileWatchedProgram, + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + getNewLine: function () { return system.newLine; }, + getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getDefaultLibLocation: getDefaultLibLocation, + getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); }, + fileExists: function (path) { return system.fileExists(path); }, + readFile: function (path, encoding) { return system.readFile(path, encoding); }, + directoryExists: function (path) { return system.directoryExists(path); }, + getDirectories: function (path) { return system.getDirectories(path); }, + readDirectory: function (path, extensions, exclude, include, depth) { return system.readDirectory(path, extensions, exclude, include, depth); }, + realpath: system.realpath && (function (path) { return system.realpath(path); }), + getEnvironmentVariable: system.getEnvironmentVariable && (function (name) { return system.getEnvironmentVariable(name); }), + watchFile: system.watchFile ? (function (path, callback, pollingInterval) { return system.watchFile(path, callback, pollingInterval); }) : function () { return noopFileWatcher; }, + watchDirectory: system.watchDirectory ? (function (path, callback, recursive) { return system.watchDirectory(path, callback, recursive); }) : function () { return noopFileWatcher; }, + setTimeout: system.setTimeout ? (function (callback, ms) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return (_a = system.setTimeout).call.apply(_a, [system, callback, ms].concat(args)); + var _a; + }) : ts.noop, + clearTimeout: system.clearTimeout ? (function (timeoutId) { return system.clearTimeout(timeoutId); }) : ts.noop, + trace: function (s) { return system.write(s); }, + onWatchStatusChange: reportWatchStatus || createWatchStatusReporter(system), + createDirectory: function (path) { return system.createDirectory(path); }, + writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, + onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, + createHash: system.createHash && (function (s) { return system.createHash(s); }), + createProgram: createProgram, + afterProgramCreate: emitFilesAndReportErrorUsingBuilder }; - function compileWatchedProgram(host, program, builder) { - var diagnostics = program.getSyntacticDiagnostics().slice(); - var reportSemanticDiagnostics = false; - if (diagnostics.length === 0) { - ts.addRange(diagnostics, program.getOptionsDiagnostics()); - ts.addRange(diagnostics, program.getGlobalDiagnostics()); - if (diagnostics.length === 0) { - reportSemanticDiagnostics = true; - } - } - var emittedFiles = program.getCompilerOptions().listEmittedFiles ? [] : undefined; - var sourceMaps; - var emitSkipped; - var result = builder.emitChangedFiles(program, writeFile); - if (result.length === 0) { - emitSkipped = true; - } - else { - for (var _i = 0, result_4 = result; _i < result_4.length; _i++) { - var emitOutput = result_4[_i]; - if (emitOutput.emitSkipped) { - emitSkipped = true; - } - ts.addRange(diagnostics, emitOutput.diagnostics); - sourceMaps = ts.concatenate(sourceMaps, emitOutput.sourceMaps); - } - } - if (reportSemanticDiagnostics) { - ts.addRange(diagnostics, builder.getSemanticDiagnostics(program)); - } - return handleEmitOutputAndReportErrors(host, program, emittedFiles, emitSkipped, diagnostics, reportDiagnostic); - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - host.createDirectory(directoryPath); - } - } - function writeFile(fileName, text, writeByteOrderMark, onError) { - try { - ts.performance.mark("beforeIOWrite"); - ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); - host.writeFile(fileName, text, writeByteOrderMark); - ts.performance.mark("afterIOWrite"); - ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); - if (emittedFiles) { - emittedFiles.push(fileName); - } - } - catch (e) { - if (onError) { - onError(e.message); - } - } - } + function getDefaultLibLocation() { + return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); + } + function emitFilesAndReportErrorUsingBuilder(builderProgram) { + emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName); } } - ts.createWatchingSystemHost = createWatchingSystemHost; - function createWatchModeWithConfigFile(configParseResult, optionsToExtend, watchingHost) { - if (optionsToExtend === void 0) { optionsToExtend = {}; } - return createWatchMode(configParseResult.fileNames, configParseResult.options, watchingHost, configParseResult.options.configFilePath, configParseResult.configFileSpecs, configParseResult.wildcardDirectories, optionsToExtend); + function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) { + reportDiagnostic(diagnostic); + system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } - ts.createWatchModeWithConfigFile = createWatchModeWithConfigFile; - function createWatchModeWithoutConfigFile(rootFileNames, compilerOptions, watchingHost) { - return createWatchMode(rootFileNames, compilerOptions, watchingHost); + function createWatchCompilerHostOfConfigFile(configFileName, optionsToExtend, system, createProgram, reportDiagnostic, reportWatchStatus) { + reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system); + var host = createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus); + host.onConfigFileDiagnostic = reportDiagnostic; + host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); }; + host.configFileName = configFileName; + host.optionsToExtend = optionsToExtend; + return host; } - ts.createWatchModeWithoutConfigFile = createWatchModeWithoutConfigFile; - function createWatchMode(rootFileNames, compilerOptions, watchingHost, configFileName, configFileSpecs, configFileWildCardDirectories, optionsToExtendForConfigFile) { - var program; + ts.createWatchCompilerHostOfConfigFile = createWatchCompilerHostOfConfigFile; + function createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, system, createProgram, reportDiagnostic, reportWatchStatus) { + var host = createWatchCompilerHost(system, createProgram, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus); + host.rootFiles = rootFiles; + host.options = options; + return host; + } + ts.createWatchCompilerHostOfFilesAndCompilerOptions = createWatchCompilerHostOfFilesAndCompilerOptions; +})(ts || (ts = {})); +(function (ts) { + function createWatchCompilerHost(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus) { + if (ts.isArray(rootFilesOrConfigFileName)) { + return ts.createWatchCompilerHostOfFilesAndCompilerOptions(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus); + } + else { + return ts.createWatchCompilerHostOfConfigFile(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus); + } + } + ts.createWatchCompilerHost = createWatchCompilerHost; + var initialVersion = 1; + function createWatchProgram(host) { + var builderProgram; var reloadLevel; var missingFilesMap; var watchedWildcardDirectories; @@ -60786,83 +62617,122 @@ var ts; var missingFilePathsRequestedForRelease; var hasChangedCompilerOptions = false; var hasChangedAutomaticTypeDirectiveNames = false; - var loggingEnabled = compilerOptions.diagnostics || compilerOptions.extendedDiagnostics; - var writeLog = loggingEnabled ? function (s) { system.write(s); system.write(system.newLine); } : ts.noop; + var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + var currentDirectory = host.getCurrentDirectory(); + var getCurrentDirectory = function () { return currentDirectory; }; + var readFile = function (path, encoding) { return host.readFile(path, encoding); }; + var configFileName = host.configFileName, _a = host.optionsToExtend, optionsToExtendForConfigFile = _a === void 0 ? {} : _a, createProgram = host.createProgram; + var rootFileNames = host.rootFiles, compilerOptions = host.options, configFileSpecs = host.configFileSpecs, configFileWildCardDirectories = host.configFileWildCardDirectories; + var cachedDirectoryStructureHost = configFileName && ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); + if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { + host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); + } + var directoryStructureHost = cachedDirectoryStructureHost || host; + var parseConfigFileHost = { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + readDirectory: function (path, extensions, exclude, include, depth) { return directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }, + fileExists: function (path) { return host.fileExists(path); }, + readFile: readFile, + getCurrentDirectory: getCurrentDirectory, + onConfigFileDiagnostic: host.onConfigFileDiagnostic, + onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic + }; + if (configFileName && !rootFileNames) { + parseConfigFile(); + } + var trace = host.trace && (function (s) { host.trace(s + newLine); }); + var loggingEnabled = trace && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); + var writeLog = loggingEnabled ? trace : ts.noop; var watchFile = compilerOptions.extendedDiagnostics ? ts.addFileWatcherWithLogging : loggingEnabled ? ts.addFileWatcherWithOnlyTriggerLogging : ts.addFileWatcher; var watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; var watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; - watchingHost = watchingHost || createWatchingSystemHost(compilerOptions.pretty); - var system = watchingHost.system, parseConfigFile = watchingHost.parseConfigFile, reportDiagnostic = watchingHost.reportDiagnostic, reportWatchDiagnostic = watchingHost.reportWatchDiagnostic, beforeCompile = watchingHost.beforeCompile, afterCompile = watchingHost.afterCompile; - var directoryStructureHost = configFileName ? ts.createCachedDirectoryStructureHost(system) : system; + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + var newLine = updateNewLine(); + writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames); if (configFileName) { - watchFile(system, configFileName, scheduleProgramReload, writeLog); + watchFile(host, configFileName, scheduleProgramReload, writeLog); } - var getCurrentDirectory = ts.memoize(function () { return directoryStructureHost.getCurrentDirectory(); }); - var realpath = system.realpath && (function (path) { return system.realpath(path); }); - var getCachedDirectoryStructureHost = configFileName && (function () { return directoryStructureHost; }); - var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames); - var newLine = ts.getNewLineCharacter(compilerOptions, system); var compilerHost = { getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { return getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile); }, getSourceFileByPath: getVersionedSourceFileByPath, - getDefaultLibLocation: getDefaultLibLocation, - getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); }, - writeFile: ts.notImplemented, + getDefaultLibLocation: host.getDefaultLibLocation && (function () { return host.getDefaultLibLocation(); }), + getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, + writeFile: writeFile, getCurrentDirectory: getCurrentDirectory, - useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; }, + useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, getCanonicalFileName: getCanonicalFileName, getNewLine: function () { return newLine; }, fileExists: fileExists, - readFile: function (fileName) { return system.readFile(fileName); }, - trace: function (s) { return system.write(s + newLine); }, - directoryExists: function (directoryName) { return directoryStructureHost.directoryExists(directoryName); }, - getEnvironmentVariable: function (name) { return system.getEnvironmentVariable ? system.getEnvironmentVariable(name) : ""; }, - getDirectories: function (path) { return directoryStructureHost.getDirectories(path); }, - realpath: realpath, - resolveTypeReferenceDirectives: function (typeDirectiveNames, containingFile) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }, - resolveModuleNames: function (moduleNames, containingFile, reusedNames) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, false); }, + readFile: readFile, + trace: trace, + directoryExists: directoryStructureHost.directoryExists && (function (path) { return directoryStructureHost.directoryExists(path); }), + getDirectories: directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); }), + realpath: host.realpath && (function (s) { return host.realpath(s); }), + getEnvironmentVariable: host.getEnvironmentVariable ? (function (name) { return host.getEnvironmentVariable(name); }) : (function () { return ""; }), onReleaseOldSourceFile: onReleaseOldSourceFile, + createHash: host.createHash && (function (data) { return host.createHash(data); }), toPath: toPath, getCompilationSettings: function () { return compilerOptions; }, watchDirectoryOfFailedLookupLocation: watchDirectory, watchTypeRootsDirectory: watchDirectory, - getCachedDirectoryStructureHost: getCachedDirectoryStructureHost, + getCachedDirectoryStructureHost: function () { return cachedDirectoryStructureHost; }, onInvalidatedResolution: scheduleProgramUpdate, onChangedAutomaticTypeDirectiveNames: function () { hasChangedAutomaticTypeDirectiveNames = true; scheduleProgramUpdate(); }, + maxNumberOfFilesToIterateForInvalidation: host.maxNumberOfFilesToIterateForInvalidation, + getCurrentProgram: getCurrentProgram, writeLog: writeLog }; var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ? - ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, getCurrentDirectory())) : - getCurrentDirectory()); - var builder = ts.createBuilder({ getCanonicalFileName: getCanonicalFileName, computeHash: computeHash }); + ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) : + currentDirectory, false); + compilerHost.resolveModuleNames = host.resolveModuleNames ? + (function (moduleNames, containingFile, reusedNames) { return host.resolveModuleNames(moduleNames, containingFile, reusedNames); }) : + (function (moduleNames, containingFile, reusedNames) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames); }); + compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ? + (function (typeDirectiveNames, containingFile) { return host.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }) : + (function (typeDirectiveNames, containingFile) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }); + var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives; + reportWatchDiagnostic(ts.Diagnostics.Starting_compilation_in_watch_mode); synchronizeProgram(); watchConfigFileWildCardDirectories(); - return function () { return program; }; + return configFileName ? + { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames }; + function getCurrentBuilderProgram() { + return builderProgram; + } + function getCurrentProgram() { + return builderProgram && builderProgram.getProgram(); + } function synchronizeProgram() { writeLog("Synchronizing program"); + var program = getCurrentProgram(); if (hasChangedCompilerOptions) { - newLine = ts.getNewLineCharacter(compilerOptions, system); + newLine = updateNewLine(); if (program && ts.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { resolutionCache.clear(); } } - var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(); - if (ts.isProgramUptoDate(program, rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames)) { - return; + var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution); + if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames)) { + return builderProgram; + } + if (loggingEnabled) { + writeLog("CreatingProgramWith::"); + writeLog(" roots: " + JSON.stringify(rootFileNames)); + writeLog(" options: " + JSON.stringify(compilerOptions)); } - beforeCompile(compilerOptions); var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; hasChangedCompilerOptions = false; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; - program = ts.createProgram(rootFileNames, compilerOptions, compilerHost, program); + builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram); resolutionCache.finishCachingPerDirectoryResolution(); - builder.updateProgram(program); - ts.updateMissingFilePathsWatch(program, missingFilesMap || (missingFilesMap = ts.createMap()), watchMissingFilePath); + ts.updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = ts.createMap()), watchMissingFilePath); if (needsUpdateInTypeRootWatch) { resolutionCache.updateTypeRootsWatch(); } @@ -60875,29 +62745,42 @@ var ts; } missingFilePathsRequestedForRelease = undefined; } - afterCompile(directoryStructureHost, program, builder); - reportWatchDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Compilation_complete_Watching_for_file_changes)); + if (host.afterProgramCreate) { + host.afterProgramCreate(builderProgram); + } + reportWatchDiagnostic(ts.Diagnostics.Compilation_complete_Watching_for_file_changes); + return builderProgram; + } + function updateRootFileNames(files) { + ts.Debug.assert(!configFileName, "Cannot update root file names with config file watch mode"); + rootFileNames = files; + scheduleProgramUpdate(); + } + function updateNewLine() { + return ts.getNewLineCharacter(compilerOptions, function () { return host.getNewLine(); }); } function toPath(fileName) { - return ts.toPath(fileName, getCurrentDirectory(), getCanonicalFileName); + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function isFileMissingOnHost(hostSourceFile) { + return typeof hostSourceFile === "number"; + } + function isFilePresentOnHost(hostSourceFile) { + return !!hostSourceFile.sourceFile; } function fileExists(fileName) { var path = toPath(fileName); - var hostSourceFileInfo = sourceFilesCache.get(path); - if (hostSourceFileInfo !== undefined) { - return !ts.isString(hostSourceFileInfo); + if (isFileMissingOnHost(sourceFilesCache.get(path))) { + return true; } return directoryStructureHost.fileExists(fileName); } - function getDefaultLibLocation() { - return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); - } function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) { var hostSourceFile = sourceFilesCache.get(path); - if (ts.isString(hostSourceFile)) { + if (isFileMissingOnHost(hostSourceFile)) { return undefined; } - if (!hostSourceFile || shouldCreateNewSourceFile || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { + if (!hostSourceFile || shouldCreateNewSourceFile || !isFilePresentOnHost(hostSourceFile) || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { var sourceFile = getNewSourceFile(); if (hostSourceFile) { if (shouldCreateNewSourceFile) { @@ -60907,23 +62790,24 @@ var ts; hostSourceFile.sourceFile = sourceFile; sourceFile.version = hostSourceFile.version.toString(); if (!hostSourceFile.fileWatcher) { - hostSourceFile.fileWatcher = watchFilePath(system, fileName, onSourceFileChange, path, writeLog); + hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); } } else { - hostSourceFile.fileWatcher.close(); - sourceFilesCache.set(path, hostSourceFile.version.toString()); + if (isFilePresentOnHost(hostSourceFile)) { + hostSourceFile.fileWatcher.close(); + } + sourceFilesCache.set(path, hostSourceFile.version); } } else { - var fileWatcher = void 0; if (sourceFile) { - sourceFile.version = "0"; - fileWatcher = watchFilePath(system, fileName, onSourceFileChange, path, writeLog); - sourceFilesCache.set(path, { sourceFile: sourceFile, version: 0, fileWatcher: fileWatcher }); + sourceFile.version = initialVersion.toString(); + var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); + sourceFilesCache.set(path, { sourceFile: sourceFile, version: initialVersion, fileWatcher: fileWatcher }); } else { - sourceFilesCache.set(path, "0"); + sourceFilesCache.set(path, initialVersion); } } return sourceFile; @@ -60933,7 +62817,7 @@ var ts; var text; try { ts.performance.mark("beforeIORead"); - text = system.readFile(fileName, compilerOptions.charset); + text = host.readFile(fileName, compilerOptions.charset); ts.performance.mark("afterIORead"); ts.performance.measure("I/O Read", "beforeIORead", "afterIORead"); } @@ -60945,24 +62829,25 @@ var ts; return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; } } - function removeSourceFile(path) { + function nextSourceFileVersion(path) { var hostSourceFile = sourceFilesCache.get(path); if (hostSourceFile !== undefined) { - if (!ts.isString(hostSourceFile)) { - hostSourceFile.fileWatcher.close(); - resolutionCache.invalidateResolutionOfFile(path); + if (isFileMissingOnHost(hostSourceFile)) { + sourceFilesCache.set(path, { version: Number(hostSourceFile) + 1 }); + } + else { + hostSourceFile.version++; } - sourceFilesCache.delete(path); } } function getSourceVersion(path) { var hostSourceFile = sourceFilesCache.get(path); - return !hostSourceFile || ts.isString(hostSourceFile) ? undefined : hostSourceFile.version.toString(); + return !hostSourceFile || isFileMissingOnHost(hostSourceFile) ? undefined : hostSourceFile.version.toString(); } function onReleaseOldSourceFile(oldSourceFile, _oldOptions) { var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.path); if (hostSourceFileInfo) { - if (ts.isString(hostSourceFileInfo)) { + if (isFileMissingOnHost(hostSourceFileInfo)) { (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); } else if (hostSourceFileInfo.sourceFile === oldSourceFile) { @@ -60971,14 +62856,19 @@ var ts; } } } + function reportWatchDiagnostic(message) { + if (host.onWatchStatusChange) { + host.onWatchStatusChange(ts.createCompilerDiagnostic(message), newLine, compilerOptions); + } + } function scheduleProgramUpdate() { - if (!system.setTimeout || !system.clearTimeout) { + if (!host.setTimeout || !host.clearTimeout) { return; } if (timerToUpdateProgram) { - system.clearTimeout(timerToUpdateProgram); + host.clearTimeout(timerToUpdateProgram); } - timerToUpdateProgram = system.setTimeout(updateProgram, 250); + timerToUpdateProgram = host.setTimeout(updateProgram, 250); } function scheduleProgramReload() { ts.Debug.assert(!!configFileName); @@ -60987,20 +62877,21 @@ var ts; } function updateProgram() { timerToUpdateProgram = undefined; - reportWatchDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation)); + reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); switch (reloadLevel) { case ts.ConfigFileProgramReloadLevel.Partial: return reloadFileNamesFromConfigFile(); case ts.ConfigFileProgramReloadLevel.Full: return reloadConfigFile(); default: - return synchronizeProgram(); + synchronizeProgram(); + return; } } function reloadFileNamesFromConfigFile() { - var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getDirectoryPath(configFileName), compilerOptions, directoryStructureHost); + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getDirectoryPath(configFileName), compilerOptions, parseConfigFileHost); if (!configFileSpecs.filesSpecs && result.fileNames.length === 0) { - reportDiagnostic(ts.getErrorForNoInputFiles(configFileSpecs, configFileName)); + host.onConfigFileDiagnostic(ts.getErrorForNoInputFiles(configFileSpecs, configFileName)); } rootFileNames = result.fileNames; synchronizeProgram(); @@ -61008,74 +62899,65 @@ var ts; function reloadConfigFile() { writeLog("Reloading config file: " + configFileName); reloadLevel = ts.ConfigFileProgramReloadLevel.None; - var cachedHost = directoryStructureHost; - cachedHost.clearCache(); - var configParseResult = parseConfigFile(configFileName, optionsToExtendForConfigFile, cachedHost, reportDiagnostic, reportWatchDiagnostic); - rootFileNames = configParseResult.fileNames; - compilerOptions = configParseResult.options; + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.clearCache(); + } + parseConfigFile(); hasChangedCompilerOptions = true; - configFileSpecs = configParseResult.configFileSpecs; - configFileWildCardDirectories = configParseResult.wildcardDirectories; synchronizeProgram(); watchConfigFileWildCardDirectories(); } + function parseConfigFile() { + var configParseResult = ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost); + rootFileNames = configParseResult.fileNames; + compilerOptions = configParseResult.options; + configFileSpecs = configParseResult.configFileSpecs; + configFileWildCardDirectories = configParseResult.wildcardDirectories; + } function onSourceFileChange(fileName, eventKind, path) { updateCachedSystemWithFile(fileName, path, eventKind); - var hostSourceFile = sourceFilesCache.get(path); - if (hostSourceFile) { - if (eventKind === ts.FileWatcherEventKind.Deleted) { - resolutionCache.invalidateResolutionOfFile(path); - if (!ts.isString(hostSourceFile)) { - hostSourceFile.fileWatcher.close(); - sourceFilesCache.set(path, (hostSourceFile.version++).toString()); - } - } - else { - if (ts.isString(hostSourceFile)) { - sourceFilesCache.delete(path); - } - else { - hostSourceFile.version++; - } - } + if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.get(path)) { + resolutionCache.invalidateResolutionOfFile(path); } + nextSourceFileVersion(path); scheduleProgramUpdate(); } function updateCachedSystemWithFile(fileName, path, eventKind) { - if (configFileName) { - directoryStructureHost.addOrDeleteFile(fileName, path, eventKind); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind); } } function watchDirectory(directory, cb, flags) { - return watchDirectoryWorker(system, directory, cb, flags, writeLog); + return watchDirectoryWorker(host, directory, cb, flags, writeLog); } function watchMissingFilePath(missingFilePath) { - return watchFilePath(system, missingFilePath, onMissingFileChange, missingFilePath, writeLog); + return watchFilePath(host, missingFilePath, onMissingFileChange, missingFilePath, writeLog); } function onMissingFileChange(fileName, eventKind, missingFilePath) { updateCachedSystemWithFile(fileName, missingFilePath, eventKind); if (eventKind === ts.FileWatcherEventKind.Created && missingFilesMap.has(missingFilePath)) { missingFilesMap.get(missingFilePath).close(); missingFilesMap.delete(missingFilePath); - removeSourceFile(missingFilePath); + nextSourceFileVersion(missingFilePath); scheduleProgramUpdate(); } } function watchConfigFileWildCardDirectories() { - ts.updateWatchingWildcardDirectories(watchedWildcardDirectories || (watchedWildcardDirectories = ts.createMap()), ts.createMapFromTemplate(configFileWildCardDirectories), watchWildcardDirectory); + if (configFileWildCardDirectories) { + ts.updateWatchingWildcardDirectories(watchedWildcardDirectories || (watchedWildcardDirectories = ts.createMap()), ts.createMapFromTemplate(configFileWildCardDirectories), watchWildcardDirectory); + } + else if (watchedWildcardDirectories) { + ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf); + } } function watchWildcardDirectory(directory, flags) { return watchDirectory(directory, function (fileOrDirectory) { ts.Debug.assert(!!configFileName); var fileOrDirectoryPath = toPath(fileOrDirectory); - var result = directoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); - var hostSourceFile = sourceFilesCache.get(fileOrDirectoryPath); - if (hostSourceFile && !ts.isString(hostSourceFile) && (result ? result.fileExists : directoryStructureHost.fileExists(fileOrDirectory))) { - hostSourceFile.version++; - } - else { - removeSourceFile(fileOrDirectoryPath); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } + nextSourceFileVersion(fileOrDirectoryPath); if (fileOrDirectoryPath !== directory && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, compilerOptions)) { writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory); return; @@ -61086,10 +62968,29 @@ var ts; } }, flags); } - function computeHash(data) { - return system.createHash ? system.createHash(data) : data; + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + host.createDirectory(directoryPath); + } + } + function writeFile(fileName, text, writeByteOrderMark, onError) { + try { + ts.performance.mark("beforeIOWrite"); + ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); + host.writeFile(fileName, text, writeByteOrderMark); + ts.performance.mark("afterIOWrite"); + ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } + catch (e) { + if (onError) { + onError(e.message); + } + } } } + ts.createWatchProgram = createWatchProgram; })(ts || (ts = {})); var ts; (function (ts) { @@ -61224,12 +63125,14 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", + "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, - description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation }, { name: "allowJs", @@ -61264,6 +63167,12 @@ var ts; category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_d_ts_file, }, + { + name: "emitDeclarationOnly", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Only_emit_d_ts_declaration_files, + }, { name: "sourceMap", type: "boolean", @@ -61470,6 +63379,13 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "esModuleInterop", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports + }, { name: "preserveSymlinks", type: "boolean", @@ -61750,17 +63666,17 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1, - strict: true + strict: true, + esModuleInterop: true }; var optionNameMapCache; function convertEnableAutoDiscoveryToEnable(typeAcquisition) { if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { - var result = { + return { enable: typeAcquisition.enableAutoDiscovery, include: typeAcquisition.include || [], exclude: typeAcquisition.exclude || [] }; - return result; } return typeAcquisition; } @@ -62026,7 +63942,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265) { + if (element.kind !== 268) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -62095,13 +64011,13 @@ var ts; case 8: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193: + case 196: if (valueExpression.operator !== 38 || valueExpression.operand.kind !== 8) { break; } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179: + case 182: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; if (option) { @@ -62111,7 +64027,7 @@ var ts; else { return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined); } - case 178: + case 181: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -62173,7 +64089,7 @@ var ts; function serializeCompilerOptions(options) { var result = ts.createMap(); var optionsNameMap = getOptionNameMap().optionNameMap; - var _loop_5 = function (name) { + var _loop_6 = function (name) { if (ts.hasProperty(options, name)) { if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { return "continue"; @@ -62197,7 +64113,7 @@ var ts; } }; for (var name in options) { - _loop_5(name); + _loop_6(name); } return result; } @@ -62297,7 +64213,7 @@ var ts; return x === undefined || x === null; } function directoryOfCombinedPath(fileName, basePath) { - return ts.getDirectoryPath(ts.toPath(fileName, basePath, ts.identity)); + return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath)); } function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } @@ -62305,8 +64221,7 @@ var ts; if (extraFileExtensions === void 0) { extraFileExtensions = []; } ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); var errors = []; - var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors); + var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); var raw = parsedConfig.raw; var options = ts.extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName; @@ -62386,19 +64301,19 @@ var ts; function isSuccessfulParsedTsconfig(value) { return !!value.options; } - function parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors) { + function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors) { basePath = ts.normalizeSlashes(basePath); - var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); + var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))); return { raw: json || convertToObject(sourceFile, errors) }; } var ownConfig = json ? - parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) : - parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors); + parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : + parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); if (ownConfig.extendedConfigPath) { resolutionStack = resolutionStack.concat([resolvedPath]); - var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { var baseRaw_1 = extendedConfig.raw; var raw_1 = ownConfig.raw; @@ -62419,7 +64334,7 @@ var ts; } return ownConfig; } - function parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { if (ts.hasProperty(json, "excludes")) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } @@ -62433,12 +64348,12 @@ var ts; } else { var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, getCanonicalFileName, errors, ts.createCompilerDiagnostic); + extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, ts.createCompilerDiagnostic); } } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { var options = getDefaultCompilerOptions(configFileName); var typeAcquisition, typingOptionstypeAcquisition; var extendedConfigPath; @@ -62456,7 +64371,7 @@ var ts; switch (key) { case "extends": var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(value, host, newBase, getCanonicalFileName, errors, function (message, arg0) { + extendedConfigPath = getExtendsConfigPath(value, host, newBase, errors, function (message, arg0) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0); }); return; @@ -62490,13 +64405,13 @@ var ts; } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function getExtendsConfigPath(extendedConfig, host, basePath, getCanonicalFileName, errors, createDiagnostic) { + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { extendedConfig = ts.normalizeSlashes(extendedConfig); if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../"))) { errors.push(createDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); return undefined; } - var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); + var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath); if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) { extendedConfigPath = extendedConfigPath + ".json"; if (!host.fileExists(extendedConfigPath)) { @@ -62506,7 +64421,7 @@ var ts; } return extendedConfigPath; } - function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors) { + function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) { var extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); if (sourceFile) { (sourceFile.extendedSourceFiles || (sourceFile.extendedSourceFiles = [])).push(extendedResult.fileName); @@ -62516,12 +64431,12 @@ var ts; return undefined; } var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var extendedConfig = parseConfig(undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), getCanonicalFileName, resolutionStack, errors); + var extendedConfig = parseConfig(undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors); if (sourceFile) { (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); } if (isSuccessfulParsedTsconfig(extendedConfig)) { - var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; var mapPropertiesInRawIfNotUndefined = function (propertyName) { if (raw_2[propertyName]) { @@ -62560,7 +64475,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -62570,8 +64485,7 @@ var ts; return options; } function getDefaultTypeAcquisition(configFileName) { - var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; - return options; + return { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { var options = getDefaultTypeAcquisition(configFileName); @@ -62652,7 +64566,6 @@ var ts; return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, ""); } var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; - var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; @@ -62735,9 +64648,6 @@ var ts; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } - else if (invalidMultipleRecursionPatterns.test(spec)) { - return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; - } else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } @@ -62871,10 +64781,10 @@ var ts; var diagnostic = ts.createCompilerDiagnostic.apply(undefined, arguments); return diagnostic.messageText; } - var reportDiagnostic = ts.createDiagnosticReporter(ts.sys, ts.reportDiagnosticSimply); + var reportDiagnostic = ts.createDiagnosticReporter(ts.sys); function udpateReportDiagnostic(options) { if (options.pretty) { - reportDiagnostic = ts.createDiagnosticReporter(ts.sys, ts.reportDiagnosticWithColorAndContext); + reportDiagnostic = ts.createDiagnosticReporter(ts.sys, true); } } function padLeft(s, length) { @@ -62896,7 +64806,7 @@ var ts; ts.validateLocaleAndSetLanguage(commandLine.options.locale, ts.sys, commandLine.errors); } if (commandLine.errors.length > 0) { - ts.reportDiagnostics(commandLine.errors, reportDiagnostic); + commandLine.errors.forEach(reportDiagnostic); return ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); } if (commandLine.options.init) { @@ -62944,12 +64854,11 @@ var ts; } var commandLineOptions = commandLine.options; if (configFileName) { - var reportWatchDiagnostic = ts.createWatchDiagnosticReporter(); - var configParseResult = ts.parseConfigFile(configFileName, commandLineOptions, ts.sys, reportDiagnostic, reportWatchDiagnostic); + var configParseResult = ts.parseConfigFileWithSystem(configFileName, commandLineOptions, ts.sys, reportDiagnostic); udpateReportDiagnostic(configParseResult.options); if (ts.isWatchSet(configParseResult.options)) { reportWatchModeWithoutSysSupport(); - ts.createWatchModeWithConfigFile(configParseResult, commandLineOptions, createWatchingSystemHost(reportWatchDiagnostic)); + createWatchOfConfigFile(configParseResult, commandLineOptions); } else { performCompilation(configParseResult.fileNames, configParseResult.options); @@ -62959,7 +64868,7 @@ var ts; udpateReportDiagnostic(commandLineOptions); if (ts.isWatchSet(commandLineOptions)) { reportWatchModeWithoutSysSupport(); - ts.createWatchModeWithoutConfigFile(commandLine.fileNames, commandLineOptions, createWatchingSystemHost()); + createWatchOfFilesAndCompilerOptions(commandLine.fileNames, commandLineOptions); } else { performCompilation(commandLine.fileNames, commandLineOptions); @@ -62977,32 +64886,38 @@ var ts; var compilerHost = ts.createCompilerHost(compilerOptions); enableStatistics(compilerOptions); var program = ts.createProgram(rootFileNames, compilerOptions, compilerHost); - var exitStatus = compileProgram(program); + var exitStatus = ts.emitFilesAndReportErrors(program, reportDiagnostic, function (s) { return ts.sys.write(s + ts.sys.newLine); }); reportStatistics(program); return ts.sys.exit(exitStatus); } - function createWatchingSystemHost(reportWatchDiagnostic) { - var watchingHost = ts.createWatchingSystemHost(undefined, ts.sys, ts.parseConfigFile, reportDiagnostic, reportWatchDiagnostic); - watchingHost.beforeCompile = enableStatistics; - var afterCompile = watchingHost.afterCompile; - watchingHost.afterCompile = function (host, program, builder) { - afterCompile(host, program, builder); - reportStatistics(program); + function updateWatchCompilationHost(watchCompilerHost) { + var compileUsingBuilder = watchCompilerHost.createProgram; + watchCompilerHost.createProgram = function (rootNames, options, host, oldProgram) { + enableStatistics(options); + return compileUsingBuilder(rootNames, options, host, oldProgram); + }; + var emitFilesUsingBuilder = watchCompilerHost.afterProgramCreate; + watchCompilerHost.afterProgramCreate = function (builderProgram) { + emitFilesUsingBuilder(builderProgram); + reportStatistics(builderProgram.getProgram()); }; - return watchingHost; } - function compileProgram(program) { - var diagnostics; - diagnostics = program.getSyntacticDiagnostics().slice(); - if (diagnostics.length === 0) { - diagnostics = program.getOptionsDiagnostics().concat(program.getGlobalDiagnostics()); - if (diagnostics.length === 0) { - diagnostics = program.getSemanticDiagnostics().slice(); - } - } - var _a = program.emit(), emittedFiles = _a.emittedFiles, emitSkipped = _a.emitSkipped, emitDiagnostics = _a.diagnostics; - ts.addRange(diagnostics, emitDiagnostics); - return ts.handleEmitOutputAndReportErrors(ts.sys, program, emittedFiles, emitSkipped, diagnostics, reportDiagnostic); + function createWatchStatusReporter(options) { + return ts.createWatchStatusReporter(ts.sys, !!options.pretty); + } + function createWatchOfConfigFile(configParseResult, optionsToExtend) { + var watchCompilerHost = ts.createWatchCompilerHostOfConfigFile(configParseResult.options.configFilePath, optionsToExtend, ts.sys, undefined, reportDiagnostic, createWatchStatusReporter(configParseResult.options)); + updateWatchCompilationHost(watchCompilerHost); + watchCompilerHost.rootFiles = configParseResult.fileNames; + watchCompilerHost.options = configParseResult.options; + watchCompilerHost.configFileSpecs = configParseResult.configFileSpecs; + watchCompilerHost.configFileWildCardDirectories = configParseResult.wildcardDirectories; + ts.createWatchProgram(watchCompilerHost); + } + function createWatchOfFilesAndCompilerOptions(rootFiles, options) { + var watchCompilerHost = ts.createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, ts.sys, undefined, reportDiagnostic, createWatchStatusReporter(options)); + updateWatchCompilationHost(watchCompilerHost); + ts.createWatchProgram(watchCompilerHost); } function enableStatistics(compilerOptions) { if (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics) { diff --git a/lib/tsserver.js b/lib/tsserver.js index 30fde91af76..103918e21dc 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -168,177 +168,180 @@ var ts; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 140] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 141] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 142] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 143] = "OfKeyword"; - SyntaxKind[SyntaxKind["QualifiedName"] = 144] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 145] = "ComputedPropertyName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 146] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 147] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 148] = "Decorator"; - SyntaxKind[SyntaxKind["PropertySignature"] = 149] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 150] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 151] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 152] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 153] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 154] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 155] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 156] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 157] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 158] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypePredicate"] = 159] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 160] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 161] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 162] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 163] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 164] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 165] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 166] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 167] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 168] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 169] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 170] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 171] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 172] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 173] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 174] = "LiteralType"; - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 175] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 176] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 177] = "BindingElement"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 180] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 181] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 182] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 183] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 184] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 185] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 186] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 187] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 188] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 189] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 190] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 191] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 192] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 193] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 194] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 195] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 196] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 197] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 198] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 199] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 200] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 201] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 202] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 203] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 204] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 205] = "MetaProperty"; - SyntaxKind[SyntaxKind["TemplateSpan"] = 206] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 207] = "SemicolonClassElement"; - SyntaxKind[SyntaxKind["Block"] = 208] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 209] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 210] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 211] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 212] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 213] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 214] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 215] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 216] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 217] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 218] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 219] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 220] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 221] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 222] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 223] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 224] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 225] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 226] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 227] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 228] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 229] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 230] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 231] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 232] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 233] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 234] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 235] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 236] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 237] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 238] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 239] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 240] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 241] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 242] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 243] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 244] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 245] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 246] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 247] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 248] = "MissingDeclaration"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 249] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["JsxElement"] = 250] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 251] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 252] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 253] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 254] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 255] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 256] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 257] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 258] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 259] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 260] = "JsxExpression"; - SyntaxKind[SyntaxKind["CaseClause"] = 261] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 262] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 263] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 264] = "CatchClause"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 265] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 266] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 267] = "SpreadAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 268] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 269] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 270] = "Bundle"; - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 271] = "JSDocTypeExpression"; - SyntaxKind[SyntaxKind["JSDocAllType"] = 272] = "JSDocAllType"; - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 273] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 274] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 275] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 276] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 277] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 278] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 279] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 280] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocTag"] = 281] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 282] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 283] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 284] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 285] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 286] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 287] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 288] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 289] = "JSDocPropertyTag"; - SyntaxKind[SyntaxKind["SyntaxList"] = 290] = "SyntaxList"; - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 291] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 292] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 293] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 294] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 295] = "EndOfDeclarationMarker"; - SyntaxKind[SyntaxKind["Count"] = 296] = "Count"; + SyntaxKind[SyntaxKind["InferKeyword"] = 126] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 127] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 128] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 129] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 130] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 131] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 132] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 133] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 134] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 135] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 136] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 137] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 138] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 142] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 143] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 144] = "OfKeyword"; + SyntaxKind[SyntaxKind["QualifiedName"] = 145] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 146] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["TypeParameter"] = 147] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 148] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 149] = "Decorator"; + SyntaxKind[SyntaxKind["PropertySignature"] = 150] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 151] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 152] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 153] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 154] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 155] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 156] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 157] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 158] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 159] = "IndexSignature"; + SyntaxKind[SyntaxKind["TypePredicate"] = 160] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 161] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 162] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 163] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 164] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 165] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 166] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 167] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 168] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 169] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 170] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 171] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 172] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 173] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 174] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 175] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 176] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 177] = "LiteralType"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 178] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 179] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 180] = "BindingElement"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 181] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 182] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 183] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 184] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 185] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 186] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 187] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 188] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 189] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 190] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 191] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 192] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 193] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 194] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 195] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 196] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 197] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 198] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 199] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 200] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 201] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 202] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 203] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 204] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 205] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 206] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 207] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 208] = "MetaProperty"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 209] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 210] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["Block"] = 211] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 212] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 213] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 214] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 215] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 216] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 217] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 218] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 219] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 220] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 221] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 222] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 223] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 224] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 225] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 226] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 227] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 228] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 229] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 230] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 231] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 232] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 233] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 234] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 235] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 236] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 237] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 238] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 239] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 240] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 241] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 242] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 243] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 244] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 245] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 246] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 247] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 248] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 249] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 250] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 251] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 252] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["JsxElement"] = 253] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 254] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 255] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 256] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 257] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 258] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 259] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 260] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 261] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 262] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 263] = "JsxExpression"; + SyntaxKind[SyntaxKind["CaseClause"] = 264] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 265] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 266] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 267] = "CatchClause"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 268] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 269] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 270] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["EnumMember"] = 271] = "EnumMember"; + SyntaxKind[SyntaxKind["SourceFile"] = 272] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 273] = "Bundle"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 274] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 275] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 276] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 277] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 278] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 279] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 280] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 281] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 283] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocTag"] = 284] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 285] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 286] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 287] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 288] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 289] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 290] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 291] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 292] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 296] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 297] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 298] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["Count"] = 299] = "Count"; SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; SyntaxKind[SyntaxKind["FirstCompoundAssignment"] = 59] = "FirstCompoundAssignment"; @@ -346,15 +349,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 143] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 144] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 159] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 174] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 160] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 177] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 143] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 144] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -363,13 +366,13 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 144] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 271] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 289] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 281] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 289] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 145] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 274] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 284] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword"; - SyntaxKind[SyntaxKind["LastContextualKeyword"] = 143] = "LastContextualKeyword"; + SyntaxKind[SyntaxKind["LastContextualKeyword"] = 144] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -437,14 +440,17 @@ var ts; RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); - var GeneratedIdentifierKind; - (function (GeneratedIdentifierKind) { - GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; - })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var GeneratedIdentifierFlags; + (function (GeneratedIdentifierFlags) { + GeneratedIdentifierFlags[GeneratedIdentifierFlags["None"] = 0] = "None"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Auto"] = 1] = "Auto"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Loop"] = 2] = "Loop"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Unique"] = 3] = "Unique"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Node"] = 4] = "Node"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["KindMask"] = 7] = "KindMask"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["SkipNameGenerationScope"] = 8] = "SkipNameGenerationScope"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 16] = "ReservedInNestedScopes"; + })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); var TokenFlags; (function (TokenFlags) { TokenFlags[TokenFlags["None"] = 0] = "None"; @@ -457,8 +463,9 @@ var ts; TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; - TokenFlags[TokenFlags["NumericLiteralFlags"] = 496] = "NumericLiteralFlags"; + TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; })(TokenFlags = ts.TokenFlags || (ts.TokenFlags = {})); var FlowFlags; (function (FlowFlags) { @@ -496,49 +503,72 @@ var ts; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + var UnionReduction; + (function (UnionReduction) { + UnionReduction[UnionReduction["None"] = 0] = "None"; + UnionReduction[UnionReduction["Literal"] = 1] = "Literal"; + UnionReduction[UnionReduction["Subtype"] = 2] = "Subtype"; + })(UnionReduction = ts.UnionReduction || (ts.UnionReduction = {})); var NodeBuilderFlags; (function (NodeBuilderFlags) { NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; NodeBuilderFlags[NodeBuilderFlags["NoTruncation"] = 1] = "NoTruncation"; NodeBuilderFlags[NodeBuilderFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + NodeBuilderFlags[NodeBuilderFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; NodeBuilderFlags[NodeBuilderFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; NodeBuilderFlags[NodeBuilderFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + NodeBuilderFlags[NodeBuilderFlags["UseOnlyExternalAliasing"] = 128] = "UseOnlyExternalAliasing"; NodeBuilderFlags[NodeBuilderFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; NodeBuilderFlags[NodeBuilderFlags["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; - NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 1024] = "AllowThisInObjectLiteral"; - NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 2048] = "AllowQualifedNameInPlaceOfIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 8192] = "AllowAnonymousIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 16384] = "AllowEmptyUnionOrIntersection"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 32768] = "AllowEmptyTuple"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 60416] = "IgnoreErrors"; - NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + NodeBuilderFlags[NodeBuilderFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + NodeBuilderFlags[NodeBuilderFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + NodeBuilderFlags[NodeBuilderFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; + NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; + NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; + NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeFormatFlags; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 8] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 16] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 32] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 64] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 128] = "InElementType"; - TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; - TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; - TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; - TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; - TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; - TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; - TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; - TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 131072] = "AllowUniqueESSymbolType"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 1] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + TypeFormatFlags[TypeFormatFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + TypeFormatFlags[TypeFormatFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; + TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 131072] = "AddUndefined"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 262144] = "WriteArrowStyleSignature"; + TypeFormatFlags[TypeFormatFlags["InArrayType"] = 524288] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 2097152] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["NodeBuilderFlagsMask"] = 9469291] = "NodeBuilderFlagsMask"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind"; + SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope"; })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); var SymbolAccessibility; (function (SymbolAccessibility) { @@ -654,6 +684,7 @@ var ts; CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; CheckFlags[CheckFlags["Late"] = 1024] = "Late"; + CheckFlags[CheckFlags["ReverseMapped"] = 2048] = "ReverseMapped"; CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); var InternalSymbolName; @@ -722,13 +753,14 @@ var ts; TypeFlags[TypeFlags["Intersection"] = 262144] = "Intersection"; TypeFlags[TypeFlags["Index"] = 524288] = "Index"; TypeFlags[TypeFlags["IndexedAccess"] = 1048576] = "IndexedAccess"; - TypeFlags[TypeFlags["FreshLiteral"] = 2097152] = "FreshLiteral"; - TypeFlags[TypeFlags["ContainsWideningType"] = 4194304] = "ContainsWideningType"; - TypeFlags[TypeFlags["ContainsObjectLiteral"] = 8388608] = "ContainsObjectLiteral"; - TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 16777216] = "ContainsAnyFunctionType"; - TypeFlags[TypeFlags["NonPrimitive"] = 33554432] = "NonPrimitive"; - TypeFlags[TypeFlags["JsxAttributes"] = 67108864] = "JsxAttributes"; - TypeFlags[TypeFlags["MarkerType"] = 134217728] = "MarkerType"; + TypeFlags[TypeFlags["Conditional"] = 2097152] = "Conditional"; + TypeFlags[TypeFlags["Substitution"] = 4194304] = "Substitution"; + TypeFlags[TypeFlags["FreshLiteral"] = 8388608] = "FreshLiteral"; + TypeFlags[TypeFlags["ContainsWideningType"] = 16777216] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 33554432] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 67108864] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 134217728] = "NonPrimitive"; + TypeFlags[TypeFlags["GenericMappedType"] = 536870912] = "GenericMappedType"; TypeFlags[TypeFlags["Nullable"] = 12288] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; TypeFlags[TypeFlags["Unit"] = 13536] = "Unit"; @@ -736,7 +768,7 @@ var ts; TypeFlags[TypeFlags["StringOrNumberLiteralOrUnique"] = 1120] = "StringOrNumberLiteralOrUnique"; TypeFlags[TypeFlags["DefinitelyFalsy"] = 14560] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 14574] = "PossiblyFalsy"; - TypeFlags[TypeFlags["Intrinsic"] = 33585807] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 134249103] = "Intrinsic"; TypeFlags[TypeFlags["Primitive"] = 16382] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 524322] = "StringLike"; TypeFlags[TypeFlags["NumberLike"] = 84] = "NumberLike"; @@ -745,12 +777,15 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 1536] = "ESSymbolLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 393216] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 458752] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 2064384] = "StructuredOrTypeVariable"; TypeFlags[TypeFlags["TypeVariable"] = 1081344] = "TypeVariable"; - TypeFlags[TypeFlags["Narrowable"] = 35620607] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33620481] = "NotUnionOrUnit"; - TypeFlags[TypeFlags["RequiresWidening"] = 12582912] = "RequiresWidening"; - TypeFlags[TypeFlags["PropagatingFlags"] = 29360128] = "PropagatingFlags"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 7372800] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 524288] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 7897088] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 8355840] = "StructuredOrInstantiable"; + TypeFlags[TypeFlags["Narrowable"] = 142575359] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 134283777] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["RequiresWidening"] = 50331648] = "RequiresWidening"; + TypeFlags[TypeFlags["PropagatingFlags"] = 117440512] = "PropagatingFlags"; })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); var ObjectFlags; (function (ObjectFlags) { @@ -765,6 +800,9 @@ var ts; ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; ObjectFlags[ObjectFlags["ContainsSpread"] = 1024] = "ContainsSpread"; + ObjectFlags[ObjectFlags["ReverseMapped"] = 2048] = "ReverseMapped"; + ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes"; + ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); var Variance; @@ -787,14 +825,15 @@ var ts; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); var InferencePriority; (function (InferencePriority) { - InferencePriority[InferencePriority["Contravariant"] = 1] = "Contravariant"; - InferencePriority[InferencePriority["NakedTypeVariable"] = 2] = "NakedTypeVariable"; - InferencePriority[InferencePriority["MappedType"] = 4] = "MappedType"; - InferencePriority[InferencePriority["ReturnType"] = 8] = "ReturnType"; - InferencePriority[InferencePriority["NeverType"] = 16] = "NeverType"; + InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; + InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + InferencePriority[InferencePriority["NoConstraints"] = 8] = "NoConstraints"; + InferencePriority[InferencePriority["AlwaysStrict"] = 16] = "AlwaysStrict"; })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); var InferenceFlags; (function (InferenceFlags) { + InferenceFlags[InferenceFlags["None"] = 0] = "None"; InferenceFlags[InferenceFlags["InferUnionTypes"] = 1] = "InferUnionTypes"; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; @@ -1051,6 +1090,8 @@ var ts; TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; TransformFlags[TransformFlags["ContainsDynamicImport"] = 67108864] = "ContainsDynamicImport"; + TransformFlags[TransformFlags["Super"] = 134217728] = "Super"; + TransformFlags[TransformFlags["ContainsSuper"] = 268435456] = "ContainsSuper"; TransformFlags[TransformFlags["HasComputedFlags"] = 536870912] = "HasComputedFlags"; TransformFlags[TransformFlags["AssertTypeScript"] = 3] = "AssertTypeScript"; TransformFlags[TransformFlags["AssertJsx"] = 4] = "AssertJsx"; @@ -1060,20 +1101,22 @@ var ts; TransformFlags[TransformFlags["AssertES2015"] = 192] = "AssertES2015"; TransformFlags[TransformFlags["AssertGenerator"] = 768] = "AssertGenerator"; TransformFlags[TransformFlags["AssertDestructuringAssignment"] = 3072] = "AssertDestructuringAssignment"; - TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; - TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; - TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; - TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; - TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; - TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; - TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["OuterExpressionExcludes"] = 536872257] = "OuterExpressionExcludes"; + TransformFlags[TransformFlags["PropertyAccessExcludes"] = 671089985] = "PropertyAccessExcludes"; + TransformFlags[TransformFlags["NodeExcludes"] = 939525441] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 1003902273] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 1003935041] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 1003668801] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 1003668801] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 942011713] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 977327425] = "ModuleExcludes"; TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; - TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; - TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; - TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; - TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; - TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; - TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 942740801] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 940049729] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 948962625] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 939525441] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 940574017] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 940049729] = "BindingPatternExcludes"; TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; TransformFlags[TransformFlags["ES2015FunctionSyntaxMask"] = 163840] = "ES2015FunctionSyntaxMask"; })(TransformFlags = ts.TransformFlags || (ts.TransformFlags = {})); @@ -1108,6 +1151,7 @@ var ts; EmitFlags[EmitFlags["Iterator"] = 8388608] = "Iterator"; EmitFlags[EmitFlags["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; EmitFlags[EmitFlags["TypeScriptClassWrapper"] = 33554432] = "TypeScriptClassWrapper"; + EmitFlags[EmitFlags["NeverApplyImportHelper"] = 67108864] = "NeverApplyImportHelper"; })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); var ExternalEmitHelpers; (function (ExternalEmitHelpers) { @@ -1144,6 +1188,72 @@ var ts; EmitHint[EmitHint["MappedTypeParameter"] = 3] = "MappedTypeParameter"; EmitHint[EmitHint["Unspecified"] = 4] = "Unspecified"; })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); + var ListFormat; + (function (ListFormat) { + ListFormat[ListFormat["None"] = 0] = "None"; + ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; + ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; + ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; + ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; + ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; + ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; + ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; + ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; + ListFormat[ListFormat["Indented"] = 64] = "Indented"; + ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; + ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; + ListFormat[ListFormat["Braces"] = 512] = "Braces"; + ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; + ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; + ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; + ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; + ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; + ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; + ListFormat[ListFormat["Optional"] = 24576] = "Optional"; + ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; + ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; + ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; + ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; + ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; + ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; + ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; + ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; + ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; + ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; + ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; + ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; + ListFormat[ListFormat["ObjectBindingPatternElements"] = 262576] = "ObjectBindingPatternElements"; + ListFormat[ListFormat["ArrayBindingPatternElements"] = 262448] = "ArrayBindingPatternElements"; + ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; + ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; + ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; + ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; + ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; + ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; + ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; + ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; + ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; + ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; + ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; + ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; + ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; + ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; + ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; + ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; + ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; + ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; + ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; + ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; + ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; + ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; + ListFormat[ListFormat["TypeArguments"] = 26896] = "TypeArguments"; + ListFormat[ListFormat["TypeParameters"] = 26896] = "TypeParameters"; + ListFormat[ListFormat["Parameters"] = 1296] = "Parameters"; + ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; + })(ListFormat = ts.ListFormat || (ts.ListFormat = {})); })(ts || (ts = {})); var ts; (function (ts) { @@ -1204,16 +1314,21 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.versionMajorMinor = "2.7"; - ts.version = ts.versionMajorMinor + ".0"; + ts.versionMajorMinor = "2.8"; + ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); (function (ts) { + ts.emptyArray = []; function createDictionaryObject() { var map = Object.create(null); map.__ = undefined; @@ -1339,6 +1454,9 @@ var ts; } ts.forEach = forEach; function firstDefined(array, callback) { + if (array === undefined) { + return undefined; + } for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result !== undefined) { @@ -1348,6 +1466,19 @@ var ts; return undefined; } ts.firstDefined = firstDefined; + function firstDefinedIterator(iter, callback) { + while (true) { + var _a = iter.next(), value = _a.value, done = _a.done; + if (done) { + return undefined; + } + var result = callback(value); + if (result !== undefined) { + return result; + } + } + } + ts.firstDefinedIterator = firstDefinedIterator; function findAncestor(node, callback) { while (node) { var result = callback(node); @@ -1364,13 +1495,27 @@ var ts; ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { var result = []; - Debug.assert(arrayA.length === arrayB.length); + Debug.assertEqual(arrayA.length, arrayB.length); for (var i = 0; i < arrayA.length; i++) { result.push(callback(arrayA[i], arrayB[i], i)); } return result; } ts.zipWith = zipWith; + function zipToIterator(arrayA, arrayB) { + Debug.assertEqual(arrayA.length, arrayB.length); + var i = 0; + return { + next: function () { + if (i === arrayA.length) { + return { value: undefined, done: true }; + } + i++; + return { value: [arrayA[i - 1], arrayB[i - 1]], done: false }; + } + }; + } + ts.zipToIterator = zipToIterator; function zipToMap(keys, values) { Debug.assert(keys.length === values.length); var map = createMap(); @@ -1443,17 +1588,11 @@ var ts; return false; } ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); } - ts.indexOf = indexOf; + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -1525,31 +1664,30 @@ var ts; } ts.map = map; function mapIterator(iter, mapFn) { - return { next: next }; - function next() { - var iterRes = iter.next(); - return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; - } + return { + next: function () { + var iterRes = iter.next(); + return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + } + }; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; function flatten(array) { @@ -1590,25 +1728,33 @@ var ts; return result; } ts.flatMap = flatMap; - function flatMapIter(iter, mapfn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapfn(value); - if (res) { - if (isArray(res)) { - result.push.apply(result, res); + function flatMapIterator(iter, mapfn) { + var first = iter.next(); + if (first.done) { + return ts.emptyIterator; + } + var currentIter = getIterator(first.value); + return { + next: function () { + while (true) { + var currentRes = currentIter.next(); + if (!currentRes.done) { + return currentRes; + } + var iterRes = iter.next(); + if (iterRes.done) { + return iterRes; + } + currentIter = getIterator(iterRes.value); } - else { - result.push(res); - } - } + }, + }; + function getIterator(x) { + var res = mapfn(x); + return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res; } - return result; } - ts.flatMapIter = flatMapIter; + ts.flatMapIterator = flatMapIterator; function sameFlatMap(array, mapfn) { var result; if (array) { @@ -1631,12 +1777,23 @@ var ts; return result || array; } ts.sameFlatMap = sameFlatMap; + function mapAllOrFail(array, mapFn) { + var result = []; + for (var i = 0; i < array.length; i++) { + var mapped = mapFn(array[i], i); + if (mapped === undefined) { + return undefined; + } + result.push(mapped); + } + return result; + } + ts.mapAllOrFail = mapAllOrFail; function mapDefined(array, mapFn) { var result = []; if (array) { for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); + var mapped = mapFn(array[i], i); if (mapped !== undefined) { result.push(mapped); } @@ -1645,20 +1802,35 @@ var ts; return result; } ts.mapDefined = mapDefined; - function mapDefinedIter(iter, mapFn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapFn(value); - if (res !== undefined) { - result.push(res); + function mapDefinedIterator(iter, mapFn) { + return { + next: function () { + while (true) { + var res = iter.next(); + if (res.done) { + return res; + } + var value = mapFn(res.value); + if (value !== undefined) { + return { value: value, done: false }; + } + } } - } - return result; + }; } - ts.mapDefinedIter = mapDefinedIter; + ts.mapDefinedIterator = mapDefinedIterator; + ts.emptyIterator = { next: function () { return ({ value: undefined, done: true }); } }; + function singleIterator(value) { + var done = false; + return { + next: function () { + var wasDone = done; + done = true; + return wasDone ? { value: undefined, done: true } : { value: value, done: false }; + } + }; + } + ts.singleIterator = singleIterator; function span(array, f) { if (array) { for (var i = 0; i < array.length; i++) { @@ -1795,6 +1967,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -2268,6 +2451,15 @@ var ts; } } } + function group(values, getGroupId) { + var groupIdToGroup = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + groupIdToGroup.add(getGroupId(value), value); + } + return arrayFrom(groupIdToGroup.values()); + } + ts.group = group; function isArray(value) { return Array.isArray ? Array.isArray(value) : value instanceof Array; } @@ -2287,7 +2479,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; function noop(_) { } @@ -2298,6 +2495,8 @@ var ts; ts.returnTrue = returnTrue; function identity(x) { return x; } ts.identity = identity; + function toLowerCase(x) { return x.toLowerCase(); } + ts.toLowerCase = toLowerCase; function notImplemented() { throw new Error("Not implemented"); } @@ -2588,6 +2787,10 @@ var ts; 0; } ts.compareDiagnostics = compareDiagnostics; + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { var string1 = isString(text1) ? text1 : text1.messageText; @@ -2604,10 +2807,6 @@ var ts; } return text1 ? 1 : -1; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -2625,7 +2824,7 @@ var ts; return p2 + 1; } if (path.charCodeAt(1) === 58) { - if (path.charCodeAt(2) === 47) + if (path.charCodeAt(2) === 47 || path.charCodeAt(2) === 92) return 3; } if (path.lastIndexOf("file:///", 0) === 0) { @@ -2692,10 +2891,6 @@ var ts; return /^\.\.?($|[\\/])/.test(path); } ts.pathIsRelative = pathIsRelative; - function moduleHasNonRelativeName(moduleName) { - return !ts.isExternalModuleNameRelative(moduleName); - } - ts.moduleHasNonRelativeName = moduleHasNonRelativeName; function getEmitScriptTarget(compilerOptions) { return compilerOptions.target || 0; } @@ -2718,7 +2913,9 @@ var ts; var moduleKind = getEmitModuleKind(compilerOptions); return compilerOptions.allowSyntheticDefaultImports !== undefined ? compilerOptions.allowSyntheticDefaultImports - : moduleKind === ts.ModuleKind.System; + : compilerOptions.esModuleInterop + ? moduleKind !== ts.ModuleKind.None && moduleKind < ts.ModuleKind.ES2015 + : moduleKind === ts.ModuleKind.System; } ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports; function getStrictOptionValue(compilerOptions, flag) { @@ -3001,7 +3198,6 @@ var ts; function getSubPatternFromSpec(spec, basePath, usage, _a) { var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; - var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; var components = getNormalizedPathComponents(spec, basePath); var lastComponent = lastOrUndefined(components); @@ -3016,11 +3212,7 @@ var ts; for (var _i = 0, components_1 = components; _i < components_1.length; _i++) { var component = components_1[_i]; if (component === "**") { - if (hasRecursiveDirectoryWildcard) { - return undefined; - } subpattern += doubleAsteriskRegexFragment; - hasRecursiveDirectoryWildcard = true; } else { if (usage === "directories") { @@ -3286,6 +3478,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -3295,10 +3491,10 @@ var ts; } function Signature() { } function Node(kind, pos, end) { - this.id = 0; - this.kind = kind; this.pos = pos; this.end = end; + this.kind = kind; + this.id = 0; this.flags = 0; this.modifierFlagsCache = 0; this.transformFlags = 0; @@ -3378,6 +3574,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -3396,6 +3605,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); function orderedRemoveItem(array, item) { for (var i = 0; i < array.length; i++) { @@ -3432,9 +3661,7 @@ var ts; } } function createGetCanonicalFileName(useCaseSensitiveFileNames) { - return useCaseSensitiveFileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); + return useCaseSensitiveFileNames ? identity : toLowerCase; } ts.createGetCanonicalFileName = createGetCanonicalFileName; function matchPatternOrExact(patternStrings, candidate) { @@ -3459,14 +3686,14 @@ var ts; ts.patternText = patternText; function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; function findBestPatternMatch(values, getPattern, candidate) { var matchedValue = undefined; var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -3531,170 +3758,20 @@ var ts; return function (arg) { return f(arg) && g(arg); }; } ts.and = and; + function or(f, g) { + return function (arg) { return f(arg) || g(arg); }; + } + ts.or = or; function assertTypeIsNever(_) { } ts.assertTypeIsNever = assertTypeIsNever; - function createCachedDirectoryStructureHost(host) { - var cachedReadDirectoryResult = createMap(); - var getCurrentDirectory = memoize(function () { return host.getCurrentDirectory(); }); - var getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - return { - useCaseSensitiveFileNames: host.useCaseSensitiveFileNames, - newLine: host.newLine, - readFile: function (path, encoding) { return host.readFile(path, encoding); }, - write: function (s) { return host.write(s); }, - writeFile: writeFile, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: createDirectory, - getCurrentDirectory: getCurrentDirectory, - getDirectories: getDirectories, - readDirectory: readDirectory, - addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, - addOrDeleteFile: addOrDeleteFile, - clearCache: clearCache, - exit: function (code) { return host.exit(code); } - }; - function toPath(fileName) { - return ts.toPath(fileName, getCurrentDirectory(), getCanonicalFileName); - } - function getCachedFileSystemEntries(rootDirPath) { - return cachedReadDirectoryResult.get(rootDirPath); - } - function getCachedFileSystemEntriesForBaseDir(path) { - return getCachedFileSystemEntries(getDirectoryPath(path)); - } - function getBaseNameOfFileName(fileName) { - return getBaseFileName(normalizePath(fileName)); - } - function createCachedFileSystemEntries(rootDir, rootDirPath) { - var resultFromHost = { - files: map(host.readDirectory(rootDir, undefined, undefined, ["*.*"]), getBaseNameOfFileName) || [], - directories: host.getDirectories(rootDir) || [] - }; - cachedReadDirectoryResult.set(rootDirPath, resultFromHost); - return resultFromHost; - } - function tryReadDirectory(rootDir, rootDirPath) { - var cachedResult = getCachedFileSystemEntries(rootDirPath); - if (cachedResult) { - return cachedResult; - } - try { - return createCachedFileSystemEntries(rootDir, rootDirPath); - } - catch (_e) { - Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); - return undefined; - } - } - function fileNameEqual(name1, name2) { - return getCanonicalFileName(name1) === getCanonicalFileName(name2); - } - function hasEntry(entries, name) { - return some(entries, function (file) { return fileNameEqual(file, name); }); - } - function updateFileSystemEntry(entries, baseName, isValid) { - if (hasEntry(entries, baseName)) { - if (!isValid) { - return filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); - } - } - else if (isValid) { - return entries.push(baseName); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), true); - } - return host.writeFile(fileName, data, writeByteOrderMark); - } - function fileExists(fileName) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || - host.fileExists(fileName); - } - function directoryExists(dirPath) { - var path = toPath(dirPath); - return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); - } - function createDirectory(dirPath) { - var path = toPath(dirPath); - var result = getCachedFileSystemEntriesForBaseDir(path); - var baseFileName = getBaseNameOfFileName(dirPath); - if (result) { - updateFileSystemEntry(result.directories, baseFileName, true); - } - host.createDirectory(dirPath); - } - function getDirectories(rootDir) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return result.directories.slice(); - } - return host.getDirectories(rootDir); - } - function readDirectory(rootDir, extensions, excludes, includes, depth) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return matchFiles(rootDir, extensions, excludes, includes, host.useCaseSensitiveFileNames, getCurrentDirectory(), depth, getFileSystemEntries); - } - return host.readDirectory(rootDir, extensions, excludes, includes, depth); - function getFileSystemEntries(dir) { - var path = toPath(dir); - if (path === rootDirPath) { - return result; - } - return getCachedFileSystemEntries(path) || createCachedFileSystemEntries(dir, path); - } - } - function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { - var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); - if (existingResult) { - clearCache(); - } - else { - var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); - if (parentResult) { - var baseName = getBaseNameOfFileName(fileOrDirectory); - if (parentResult) { - var fsQueryResult = { - fileExists: host.fileExists(fileOrDirectoryPath), - directoryExists: host.directoryExists(fileOrDirectoryPath) - }; - if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { - clearCache(); - } - else { - updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); - } - return fsQueryResult; - } - } - } - } - function addOrDeleteFile(fileName, filePath, eventKind) { - if (eventKind === ts.FileWatcherEventKind.Changed) { - return; - } - var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); - if (parentResult) { - updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); - } - } - function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { - updateFileSystemEntry(parentResult.files, baseName, fileExists); - } - function clearCache() { - cachedReadDirectoryResult.clear(); - } + ts.emptyFileSystemEntries = { + files: ts.emptyArray, + directories: ts.emptyArray + }; + function singleElementArray(t) { + return t === undefined ? undefined : [t]; } - ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + ts.singleElementArray = singleElementArray; })(ts || (ts = {})); var ts; (function (ts) { @@ -3726,13 +3803,28 @@ var ts; } ts.getNodeMajorVersion = getNodeMajorVersion; ts.sys = (function () { - var utf8ByteOrderMark = "\u00EF\u00BB\u00BF"; + var byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; + } var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } function createWatchedFileSet() { var dirWatchers = ts.createMap(); var fileWatcherCallbacks = ts.createMultiMap(); @@ -3890,7 +3982,7 @@ var ts; } function writeFile(fileName, data, writeByteOrderMark) { if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } var fd; try { @@ -3931,7 +4023,7 @@ var ts; return { files: files, directories: directories }; } catch (e) { - return { files: [], directories: [] }; + return ts.emptyFileSystemEntries; } } function readDirectory(path, extensions, excludes, includes, depth) { @@ -3964,6 +4056,9 @@ var ts; return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1); }); } var nodeSystem = { + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, args: process.argv.slice(2), newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, @@ -4017,11 +4112,7 @@ var ts; return undefined; } }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, getMemoryUsage: function () { if (global.gc) { global.gc(); @@ -4042,7 +4133,12 @@ var ts; process.exit(exitCode); }, realpath: function (path) { - return _fs.realpathSync(path); + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } }, debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), tryEnableSourceMapsForHost: function () { @@ -4069,7 +4165,7 @@ var ts; }, writeFile: function (path, data, writeByteOrderMark) { if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } ChakraHost.writeFile(path, data); }, @@ -4368,6 +4464,9 @@ var ts; unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts.DiagnosticCategory.Error, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), + An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -4482,6 +4581,7 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", "Numeric index type '{0}' is not assignable to string index type '{1}'."), Class_name_cannot_be_0: diag(2414, ts.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), @@ -4536,7 +4636,7 @@ var ts; Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), @@ -4624,6 +4724,8 @@ var ts; The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts.DiagnosticCategory.Error, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -4702,6 +4804,10 @@ var ts; Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -4788,7 +4894,6 @@ var ts; The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), - File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: diag(5011, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'."), Cannot_read_file_0_Colon_1: diag(5012, ts.DiagnosticCategory.Error, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), Failed_to_parse_file_0_Colon_1: diag(5014, ts.DiagnosticCategory.Error, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), Unknown_compiler_option_0: diag(5023, ts.DiagnosticCategory.Error, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), @@ -4827,6 +4932,7 @@ var ts; Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -4839,6 +4945,7 @@ var ts; Options_Colon: diag(6027, ts.DiagnosticCategory.Message, "Options_Colon_6027", "Options:"), Version_0: diag(6029, ts.DiagnosticCategory.Message, "Version_0_6029", "Version {0}"), Insert_command_line_options_and_files_from_a_file: diag(6030, ts.DiagnosticCategory.Message, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, ts.DiagnosticCategory.Message, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), File_change_detected_Starting_incremental_compilation: diag(6032, ts.DiagnosticCategory.Message, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), KIND: diag(6034, ts.DiagnosticCategory.Message, "KIND_6034", "KIND"), FILE: diag(6035, ts.DiagnosticCategory.Message, "FILE_6035", "FILE"), @@ -4879,7 +4986,7 @@ var ts; Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts.DiagnosticCategory.Message, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), - Specify_library_files_to_be_included_in_the_compilation_Colon: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", "Specify library files to be included in the compilation: "), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), Specify_JSX_code_generation_Colon_preserve_react_native_or_react: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", "Specify JSX code generation: 'preserve', 'react-native', or 'react'."), File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), @@ -4986,6 +5093,9 @@ var ts; Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6185", "Disable strict checking of generic signatures in function types."), Enable_strict_checking_of_function_types: diag(6186, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -5014,6 +5124,9 @@ var ts; Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{0}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime: diag(7038, ts.DiagnosticCategory.Error, "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038", "A namespace-style import cannot be called or constructed, and will cause a failure at runtime."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -5089,9 +5202,9 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), Declare_static_property_0: diag(90027, ts.DiagnosticCategory.Message, "Declare_static_property_0_90027", "Declare static property '{0}'"), Call_decorator_expression: diag(90028, ts.DiagnosticCategory.Message, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Extract_symbol: diag(95003, ts.DiagnosticCategory.Message, "Extract_symbol_95003", "Extract symbol"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -5103,6 +5216,9 @@ var ts; Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"), Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), }; })(ts || (ts = {})); var ts; @@ -5134,9 +5250,9 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, + resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } @@ -5569,8 +5685,8 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); + var _a = result.value, resolved = _a.resolved, originalPath = _a.originalPath, isExternalLibraryImport = _a.isExternalLibraryImport; + return createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { @@ -5587,10 +5703,16 @@ var ts; if (!resolved_1) return undefined; var resolvedValue = resolved_1.value; - if (!compilerOptions.preserveSymlinks) { - resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + var originalPath = void 0; + if (!compilerOptions.preserveSymlinks && resolvedValue) { + originalPath = resolvedValue.path; + var path = realPath(resolved_1.value.path, host, traceEnabled); + if (path === originalPath) { + originalPath = undefined; + } + resolvedValue = __assign({}, resolvedValue, { path: path }); } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, originalPath: originalPath, isExternalLibraryImport: true } }; } else { var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; @@ -5625,7 +5747,9 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return noPackageId(resolvedFromFile); + var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; + var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, false, state).packageId; + return withPackageId(packageId, resolvedFromFile); } } if (!onlyRecordFailures) { @@ -5639,6 +5763,38 @@ var ts; } return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } + var nodeModulesPathPart = "/node_modules/"; + function parseNodeModuleFromPath(resolved) { + var path = ts.normalizePath(resolved.path); + var idx = path.lastIndexOf(nodeModulesPathPart); + if (idx === -1) { + return undefined; + } + var indexAfterNodeModules = idx + nodeModulesPathPart.length; + var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules); + if (path.charCodeAt(indexAfterNodeModules) === 64) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName); + } + var packageDirectory = path.slice(0, indexAfterPackageName); + var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts"; + return { packageDirectory: packageDirectory, subModuleName: subModuleName }; + } + function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) { + var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; + } + function addExtensionAndIndex(path) { + if (path === "") { + return "index.d.ts"; + } + if (ts.endsWith(path, ".d.ts")) { + return path; + } + if (ts.endsWith(path, "/index")) { + return path + ".d.ts"; + } + return path + "/index.d.ts"; + } function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); } @@ -5712,18 +5868,41 @@ var ts; var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } - function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) { - var host = _a.host, traceEnabled = _a.traceEnabled; + function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) { + var host = state.host, traceEnabled = state.traceEnabled; var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host); var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } var packageJsonContent = readJson(packageJsonPath, host); + if (subModuleName === "") { + var path = tryReadPackageJsonFields(true, packageJsonContent, nodeModuleDirectory, state); + if (typeof path === "string") { + subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); + } + else { + var jsPath = tryReadPackageJsonFields(false, packageJsonContent, nodeModuleDirectory, state); + if (typeof jsPath === "string") { + subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js"), ".jsx") + ".d.ts"; + } + else { + subModuleName = "index.d.ts"; + } + } + } + if (!ts.endsWith(subModuleName, ".d.ts")) { + subModuleName = addExtensionAndIndex(subModuleName); + } var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string" ? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version } : undefined; + if (traceEnabled) { + if (packageId) { + trace(host, ts.Diagnostics.Found_package_json_at_0_Package_ID_is_1, packageJsonPath, ts.packageIdToString(packageId)); + } + else { + trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + } return { found: true, packageJsonContent: packageJsonContent, packageId: packageId }; } else { @@ -5866,13 +6045,17 @@ var ts; function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); if (withoutAtTypePrefix !== mangledName) { - return ts.stringContains(withoutAtTypePrefix, mangledScopedPackageSeparator) ? - "@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) : - withoutAtTypePrefix; + return getUnmangledNameForScopedPackage(withoutAtTypePrefix); } return mangledName; } ts.getPackageNameFromAtTypesDirectory = getPackageNameFromAtTypesDirectory; + function getUnmangledNameForScopedPackage(typesPackageName) { + return ts.stringContains(typesPackageName, mangledScopedPackageSeparator) ? + "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) : + typesPackageName; + } + ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { var result = cache && cache.get(containingDirectory); if (result) { @@ -5888,7 +6071,7 @@ var ts; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, undefined, false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { @@ -5926,7 +6109,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); - return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, undefined, true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; function toSearchResult(value) { @@ -5935,8 +6118,9 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.emptyArray = []; + ts.resolvingEmptyArray = []; ts.emptyMap = ts.createMap(); + ts.emptyUnderscoreEscapedMap = ts.emptyMap; ts.externalHelpersModuleNameText = "tslib"; function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; @@ -5956,15 +6140,24 @@ var ts; var str = ""; var writeText = function (text) { return str += text; }; return { - string: function () { return str; }, + getText: function () { return str; }, + write: writeText, + rawWrite: writeText, + writeTextOfNode: writeText, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, writeSpace: writeText, writeStringLiteral: writeText, + writeLiteral: writeText, writeParameter: writeText, writeProperty: writeText, writeSymbol: writeText, + getTextPos: function () { return str.length; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, writeLine: function () { return str += " "; }, increaseIndent: ts.noop, decreaseIndent: ts.noop, @@ -5976,10 +6169,10 @@ var ts; }; } function usingSingleLineStringWriter(action) { - var oldString = stringWriter.string(); + var oldString = stringWriter.getText(); try { action(stringWriter); - return stringWriter.string(); + return stringWriter.getText(); } finally { stringWriter.clear(); @@ -6013,12 +6206,19 @@ var ts; return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && + oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; function packageIdIsEqual(a, b) { return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version; } + function packageIdToString(_a) { + var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; + var fullName = subModuleName ? name + "/" + subModuleName : name; + return fullName + "@" + version; + } + ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -6054,7 +6254,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269) { + while (node && node.kind !== 272) { node = node.parent; } return node; @@ -6062,11 +6262,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208: - case 236: - case 215: - case 216: - case 217: + case 211: + case 239: + case 218: + case 219: + case 220: return true; } return false; @@ -6142,7 +6342,7 @@ var ts; if (includeJsDoc && ts.hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0]); } - if (node.kind === 290 && node._children.length > 0) { + if (node.kind === 293 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -6189,7 +6389,7 @@ var ts; } ts.getEmitFlags = getEmitFlags; function getLiteralText(node, sourceFile) { - if (!nodeIsSynthesized(node) && node.parent) { + if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } var escapeText = getEmitFlags(node) & 16777216 ? escapeString : escapeNonAsciiString; @@ -6239,11 +6439,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 && node.parent.kind === 264; + return node.kind === 230 && node.parent.kind === 267; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 && + return node && node.kind === 237 && (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -6260,11 +6460,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node && node.kind === 234 && (!node.body); + return node && node.kind === 237 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 || - node.kind === 234 || + return node.kind === 272 || + node.kind === 237 || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -6277,9 +6477,9 @@ var ts; return false; } switch (node.parent.kind) { - case 269: + case 272: return ts.isExternalModule(node.parent); - case 235: + case 238: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -6291,22 +6491,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269: - case 236: - case 264: - case 234: - case 215: - case 216: - case 217: - case 153: - case 152: + case 272: + case 239: + case 267: + case 237: + case 218: + case 219: + case 220: case 154: + case 153: case 155: - case 229: - case 187: - case 188: + case 156: + case 232: + case 190: + case 191: return true; - case 208: + case 211: return parentNode && !ts.isFunctionLike(parentNode); } return false; @@ -6314,25 +6514,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156: case 157: - case 151: case 158: - case 161: - case 162: - case 277: - case 230: - case 200: - case 231: - case 232: - case 287: - case 229: case 152: + case 159: + case 162: + case 163: + case 280: + case 233: + case 203: + case 234: + case 235: + case 290: + case 232: case 153: case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: return true; default: ts.assertTypeIsNever(node); @@ -6342,8 +6542,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239: - case 238: + case 242: + case 241: return true; default: return false; @@ -6375,21 +6575,20 @@ var ts; case 9: case 8: return escapeLeadingUnderscores(name.text); - case 145: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144: + case 145: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180: + case 183: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -6399,6 +6598,11 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -6426,7 +6630,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208) { + if (node.body && node.body.kind === 211) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -6438,37 +6642,46 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269: + case 272: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 227: - case 177: case 230: - case 200: - case 231: - case 234: + case 180: case 233: - case 268: - case 229: - case 187: - case 152: - case 154: - case 155: + case 203: + case 234: + case 237: + case 236: + case 271: case 232: + case 190: + case 153: + case 155: + case 156: + case 235: errorNode = node.name; break; - case 188: + case 191: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -6477,7 +6690,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 && isConst(node); + return node.kind === 236 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -6490,15 +6703,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 && n.expression.kind === 97; + return n.kind === 185 && n.expression.kind === 97; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 && n.expression.kind === 91; + return n.kind === 185 && n.expression.kind === 91; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 + return node.kind === 214 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; @@ -6507,11 +6720,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 || - node.kind === 146 || - node.kind === 187 || - node.kind === 188 || - node.kind === 186) ? + var commentRanges = (node.kind === 148 || + node.kind === 147 || + node.kind === 190 || + node.kind === 191 || + node.kind === 189) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { @@ -6526,69 +6739,71 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 <= node.kind && node.kind <= 174) { + if (160 <= node.kind && node.kind <= 177) { return true; } switch (node.kind) { case 119: - case 133: - case 136: - case 122: + case 134: case 137: - case 139: - case 130: + case 122: + case 138: + case 140: + case 131: return true; case 105: - return node.parent.kind !== 191; - case 202: + return node.parent.kind !== 194; + case 205: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147: + return node.parent.kind === 176 || node.parent.kind === 171; case 71: - if (node.parent.kind === 144 && node.parent.right === node) { + if (node.parent.kind === 145 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 && node.parent.name === node) { + else if (node.parent.kind === 183 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 71 || node.kind === 144 || node.kind === 180, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 144: - case 180: + ts.Debug.assert(node.kind === 71 || node.kind === 145 || node.kind === 183, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 145: + case 183: case 99: var parent = node.parent; - if (parent.kind === 163) { + if (parent.kind === 164) { return false; } - if (159 <= parent.kind && parent.kind <= 174) { + if (160 <= parent.kind && parent.kind <= 177) { return true; } switch (parent.kind) { - case 202: + case 205: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146: - return node === parent.constraint; - case 150: - case 149: case 147: - case 227: + return node === parent.constraint; + case 151: + case 150: + case 148: + case 230: return node === parent.type; - case 229: - case 187: - case 188: + case 232: + case 190: + case 191: + case 154: case 153: case 152: - case 151: - case 154: case 155: - return node === parent.type; case 156: + return node === parent.type; case 157: case 158: + case 159: + return node === parent.type; + case 188: return node === parent.type; case 185: - return node === parent.type; - case 182: - case 183: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; - case 184: + case 186: + return ts.contains(parent.typeArguments, node); + case 187: return false; } } @@ -6609,23 +6824,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220: + case 223: return visitor(node); - case 236: - case 208: - case 212: - case 213: - case 214: + case 239: + case 211: case 215: case 216: case 217: - case 221: - case 222: - case 261: - case 262: - case 223: + case 218: + case 219: + case 220: + case 224: case 225: case 264: + case 265: + case 226: + case 228: + case 267: return ts.forEachChild(node, traverse); } } @@ -6635,25 +6850,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198: + case 201: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233: - case 231: + case 236: case 234: - case 232: - case 230: - case 200: + case 237: + case 235: + case 233: + case 203: return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145) { - traverse(name.expression); + if (node.name && node.name.kind === 146) { + traverse(node.name.expression); return; } } @@ -6665,10 +6879,10 @@ var ts; } ts.forEachYieldExpression = forEachYieldExpression; function getRestParameterElementType(node) { - if (node && node.kind === 165) { + if (node && node.kind === 166) { return node.elementType; } - else if (node && node.kind === 160) { + else if (node && node.kind === 161) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -6678,12 +6892,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231: - case 230: - case 200: - case 164: + case 234: + case 233: + case 203: + case 165: return node.members; - case 179: + case 182: return node.properties; } } @@ -6691,14 +6905,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177: + case 180: + case 271: + case 148: case 268: - case 147: - case 265: + case 151: case 150: - case 149: - case 266: - case 227: + case 269: + case 230: return true; } } @@ -6706,8 +6920,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 - && node.parent.parent.kind === 209; + return node.parent.kind === 231 + && node.parent.parent.kind === 212; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -6718,13 +6932,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 229: - case 187: + case 156: + case 232: + case 190: return true; } return false; @@ -6735,7 +6949,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223) { + if (node.statement.kind !== 226) { return node.statement; } node = node.statement; @@ -6743,17 +6957,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 && ts.isFunctionLike(node.parent); + return node && node.kind === 211 && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 && node.parent.kind === 179; + return node && node.kind === 153 && node.parent.kind === 182; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 && - (node.parent.kind === 179 || - node.parent.kind === 200); + return node.kind === 153 && + (node.parent.kind === 182 || + node.parent.kind === 203); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -6766,7 +6980,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265) { + if (property.kind === 268) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -6788,39 +7002,39 @@ var ts; return undefined; } switch (node.kind) { - case 145: + case 146: if (ts.isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 148: - if (node.parent.kind === 147 && ts.isClassElement(node.parent.parent)) { + case 149: + if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { node = node.parent; } break; - case 188: + case 191: if (!includeArrowFunctions) { continue; } - case 229: - case 187: - case 234: - case 150: - case 149: - case 152: + case 232: + case 190: + case 237: case 151: + case 150: case 153: + case 152: case 154: case 155: case 156: case 157: case 158: - case 233: - case 269: + case 159: + case 236: + case 272: return node; } } @@ -6830,9 +7044,9 @@ var ts; var container = getThisContainer(node, false); if (container) { switch (container.kind) { - case 153: - case 229: - case 187: + case 154: + case 232: + case 190: return container; } } @@ -6846,25 +7060,25 @@ var ts; return node; } switch (node.kind) { - case 145: + case 146: node = node.parent; break; - case 229: - case 187: - case 188: + case 232: + case 190: + case 191: if (!stopOnFunctions) { continue; } - case 150: - case 149: - case 152: case 151: + case 150: case 153: + case 152: case 154: case 155: + case 156: return node; - case 148: - if (node.parent.kind === 147 && ts.isClassElement(node.parent.parent)) { + case 149: + if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { @@ -6876,14 +7090,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 || func.kind === 188) { + if (func.kind === 190 || func.kind === 191) { var prev = func; var parent = func.parent; - while (parent.kind === 186) { + while (parent.kind === 189) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 && parent.expression === prev) { + if (parent.kind === 185 && parent.expression === prev) { return parent; } } @@ -6891,58 +7105,60 @@ var ts; ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 || kind === 181) + return (kind === 183 || kind === 184) && node.expression.kind === 97; } ts.isSuperProperty = isSuperProperty; function isThisProperty(node) { var kind = node.kind; - return (kind === 180 || kind === 181) + return (kind === 183 || kind === 184) && node.expression.kind === 99; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160: + case 161: return node.typeName; - case 202: + case 205: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71: - case 144: + case 145: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184) { - return node.tag; + switch (node.kind) { + case 187: + return node.tag; + case 255: + case 254: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230: + case 233: return true; - case 150: - return parent.kind === 230; - case 154: + case 151: + return parent.kind === 233; case 155: - case 152: + case 156: + case 153: return node.body !== undefined - && parent.kind === 230; - case 147: + && parent.kind === 233; + case 148: return parent.body !== undefined - && (parent.kind === 153 - || parent.kind === 152 - || parent.kind === 155) - && grandparent.kind === 230; + && (parent.kind === 154 + || parent.kind === 153 + || parent.kind === 156) + && grandparent.kind === 233; } return false; } @@ -6958,19 +7174,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230: + case 233: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152: - case 155: + case 153: + case 156: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 || - parent.kind === 251 || - parent.kind === 253) { + if (parent.kind === 255 || + parent.kind === 254 || + parent.kind === 256) { return parent.tagName === node; } return false; @@ -6983,45 +7199,45 @@ var ts; case 101: case 86: case 12: - case 178: - case 179: - case 180: case 181: case 182: case 183: case 184: - case 203: case 185: - case 204: case 186: case 187: - case 200: + case 206: case 188: - case 191: + case 207: case 189: case 190: - case 193: + case 203: + case 191: case 194: - case 195: - case 196: - case 199: - case 197: - case 13: - case 201: - case 250: - case 251: - case 254: - case 198: case 192: - case 205: + case 193: + case 196: + case 197: + case 198: + case 199: + case 202: + case 200: + case 13: + case 204: + case 253: + case 254: + case 257: + case 201: + case 195: + case 208: return true; - case 144: - while (node.parent.kind === 144) { + case 145: + while (node.parent.kind === 145) { node = node.parent; } - return node.parent.kind === 163 || isJSXTagName(node); + return node.parent.kind === 164 || isJSXTagName(node); case 71: - if (node.parent.kind === 163 || isJSXTagName(node)) { + if (node.parent.kind === 164 || isJSXTagName(node)) { return true; } case 8: @@ -7036,47 +7252,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227: - case 147: + case 230: + case 148: + case 151: case 150: - case 149: + case 271: case 268: - case 265: - case 177: + case 180: return parent.initializer === node; - case 211: - case 212: - case 213: case 214: - case 220: - case 221: - case 222: - case 261: - case 224: - return parent.expression === node; case 215: - var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228) || - forStatement.condition === node || - forStatement.incrementor === node; case 216: case 217: + case 223: + case 224: + case 225: + case 264: + case 227: + return parent.expression === node; + case 218: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 231) || + forStatement.condition === node || + forStatement.incrementor === node; + case 219: + case 220: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231) || forInStatement.expression === node; - case 185: - case 203: - return node === parent.expression; + case 188: case 206: return node === parent.expression; - case 145: + case 209: return node === parent.expression; - case 148: - case 260: - case 259: - case 267: + case 146: + return node === parent.expression; + case 149: + case 263: + case 262: + case 270: return true; - case 202: + case 205: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -7084,7 +7300,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 && node.moduleReference.kind === 249; + return node.kind === 241 && node.moduleReference.kind === 252; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -7093,7 +7309,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 && node.moduleReference.kind !== 249; + return node.kind === 241 && node.moduleReference.kind !== 252; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -7113,11 +7329,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 || node.typeArguments[0].kind === 133); + (node.typeArguments[0].kind === 137 || node.typeArguments[0].kind === 134); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182) { + if (callExpression.kind !== 185) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -7140,9 +7356,9 @@ var ts; } ts.isStringDoubleQuoted = isStringDoubleQuoted; function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227) { + if (s.valueDeclaration && s.valueDeclaration.kind === 230) { var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 || declaration.initializer.kind === 200); + return declaration.initializer && (declaration.initializer.kind === 190 || declaration.initializer.kind === 203); } return false; } @@ -7166,7 +7382,7 @@ var ts; if (!isInJavaScriptFile(expr)) { return 0; } - if (expr.operatorToken.kind !== 58 || expr.left.kind !== 180) { + if (expr.operatorToken.kind !== 58 || expr.left.kind !== 183) { return 0; } var lhs = expr.left; @@ -7185,7 +7401,7 @@ var ts; else if (lhs.expression.kind === 99) { return 4; } - else if (lhs.expression.kind === 180) { + else if (lhs.expression.kind === 183) { var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 71) { var innerPropertyAccessIdentifier = innerPropertyAccess.expression; @@ -7202,21 +7418,21 @@ var ts; ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 && + expr.parent && expr.parent.kind === 214 && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239) { + if (node.kind === 242) { return node.moduleSpecifier; } - if (node.kind === 238) { + if (node.kind === 241) { var reference = node.moduleReference; - if (reference.kind === 249) { + if (reference.kind === 252) { return reference.expression; } } - if (node.kind === 245) { + if (node.kind === 248) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -7225,31 +7441,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241) { - return importClause.namedBindings; + switch (node.kind) { + case 242: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241: + return node; + case 248: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 - && node.importClause - && !!node.importClause.name; + return node.kind === 242 && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147: + case 148: + case 153: case 152: + case 269: + case 268: case 151: - case 266: - case 265: case 150: - case 149: return node.questionToken !== undefined; } } @@ -7257,71 +7474,62 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 && + return node.kind === 280 && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; } ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getAllJSDocs(node) { - if (ts.isJSDocTypedefTag(node)) { - return [node.parent]; - } - return getJSDocCommentsAndTags(node); - } - ts.getAllJSDocs = getAllJSDocs; function getSourceOfAssignment(node) { return ts.isExpressionStatement(node) && node.expression && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 58 && node.expression.right; } - ts.getSourceOfAssignment = getSourceOfAssignment; - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151: + return node.initializer; + } } - ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement; - function getSingleVariableOfVariableStatement(node, child) { + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } - ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement; function getNestedModuleDeclaration(node) { - return node.kind === 234 && + return node.kind === 237 && node.body && - node.body.kind === 234 && + node.body.kind === 237 && node.body; } - ts.getNestedModuleDeclaration = getNestedModuleDeclaration; function getJSDocCommentsAndTags(node) { var result; getJSDocCommentsAndTagsWorker(node); return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 || parent.kind === 151 || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 || - node.kind === 180 && node.parent && node.parent.kind === 211) { + node.kind === 183 && node.parent && node.parent.kind === 214) { getJSDocCommentsAndTagsWorker(parent); } - if (node.kind === 147) { + if (node.kind === 148) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } - if (isVariableLike(node) && node.initializer && ts.hasJSDocNodes(node.initializer)) { + if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { result = ts.addRange(result, node.initializer.jsDoc); } if (ts.hasJSDocNodes(node)) { @@ -7349,7 +7557,7 @@ var ts; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -7357,7 +7565,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279); + ts.Debug.assert(node.parent.kind === 282); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -7386,30 +7594,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195: + case 198: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 ? 1 : 2 : 0; - case 193: - case 194: + case 196: + case 197: var unaryOperator = parent.operator; return unaryOperator === 43 || unaryOperator === 44 ? 2 : 0; - case 216: - case 217: + case 219: + case 220: return parent.initializer === node ? 1 : 0; - case 186: - case 178: - case 199: + case 189: + case 181: + case 202: + case 207: node = parent; break; - case 266: + case 269: if (parent.name !== node) { return 0; } node = parent.parent; break; - case 265: + case 268: if (parent.name === node) { return 0; } @@ -7426,6 +7635,29 @@ var ts; return getAssignmentTargetKind(node) !== 0; } ts.isAssignmentTarget = isAssignmentTarget; + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 211: + case 212: + case 224: + case 215: + case 225: + case 239: + case 264: + case 265: + case 226: + case 218: + case 219: + case 220: + case 216: + case 217: + case 228: + case 267: + return true; + } + return false; + } + ts.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration; function walkUp(node, kind) { while (node && node.kind === kind) { node = node.parent; @@ -7433,19 +7665,19 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169); + return walkUp(node, 172); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186); + return walkUp(node, 189); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function isDeleteTarget(node) { - if (node.kind !== 180 && node.kind !== 181) { + if (node.kind !== 183 && node.kind !== 184) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189; + return node && node.kind === 192; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -7485,49 +7717,49 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 || node.kind === 8) && - node.parent.kind === 145 && + node.parent.kind === 146 && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150: - case 149: - case 152: case 151: - case 154: + case 150: + case 153: + case 152: case 155: + case 156: + case 271: case 268: - case 265: - case 180: + case 183: return parent.name === node; - case 144: + case 145: if (parent.right === node) { - while (parent.kind === 144) { + while (parent.kind === 145) { parent = parent.parent; } - return parent.kind === 163; + return parent.kind === 164; } return false; - case 177: - case 243: + case 180: + case 246: return parent.propertyName === node; - case 247: - case 257: + case 250: + case 260: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 238 || - node.kind === 237 || - node.kind === 240 && !!node.name || - node.kind === 241 || - node.kind === 243 || - node.kind === 247 || - node.kind === 244 && exportAssignmentIsAlias(node); + return node.kind === 241 || + node.kind === 240 || + node.kind === 243 && !!node.name || + node.kind === 244 || + node.kind === 246 || + node.kind === 250 || + node.kind === 247 && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -7611,11 +7843,11 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 72 <= token && token <= 143; + return 72 <= token && token <= 144; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 117 <= token && token <= 143; + return 117 <= token && token <= 144; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -7645,13 +7877,13 @@ var ts; } var flags = 0; switch (node.kind) { - case 229: - case 187: - case 152: + case 232: + case 190: + case 153: if (node.asteriskToken) { flags |= 1; } - case 188: + case 191: if (hasModifier(node, 256)) { flags |= 2; } @@ -7665,10 +7897,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 229: - case 187: - case 188: - case 152: + case 232: + case 190: + case 191: + case 153: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256); @@ -7688,7 +7920,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 145 && + return name.kind === 146 && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -7704,7 +7936,7 @@ var ts; if (name.kind === 9 || name.kind === 8) { return escapeLeadingUnderscores(name.text); } - if (name.kind === 145) { + if (name.kind === 146) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -7746,6 +7978,10 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + function isKnownSymbol(symbol) { + return ts.startsWith(symbol.escapedName, "__@"); + } + ts.isKnownSymbol = isKnownSymbol; function isESSymbolIdentifier(node) { return node.kind === 71 && node.escapedText === "Symbol"; } @@ -7756,11 +7992,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 147; + return root.kind === 148; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 177) { + while (node.kind === 180) { node = node.parent.parent; } return node; @@ -7768,15 +8004,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 153 - || kind === 187 - || kind === 229 - || kind === 188 - || kind === 152 - || kind === 154 + return kind === 154 + || kind === 190 + || kind === 232 + || kind === 191 + || kind === 153 || kind === 155 - || kind === 234 - || kind === 269; + || kind === 156 + || kind === 237 + || kind === 272; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -7795,23 +8031,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 183: + case 186: return hasArguments ? 0 : 1; - case 193: - case 190: - case 191: - case 189: - case 192: case 196: - case 198: - return 1; + case 193: + case 194: + case 192: case 195: + case 199: + case 201: + return 1; + case 198: switch (operator) { case 40: case 58: @@ -7835,15 +8071,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 195) { + if (expression.kind === 198) { return expression.operatorToken.kind; } - else if (expression.kind === 193 || expression.kind === 194) { + else if (expression.kind === 196 || expression.kind === 197) { return expression.operator; } else { @@ -7861,37 +8097,37 @@ var ts; case 86: case 8: case 9: - case 178: - case 179: - case 187: - case 188: - case 200: - case 250: - case 251: - case 254: - case 12: - case 13: - case 197: - case 186: - case 201: - return 19; - case 184: - case 180: case 181: - return 18; - case 183: - return hasArguments ? 18 : 17; case 182: - return 17; - case 194: - return 16; - case 193: case 190: case 191: + case 203: + case 253: + case 254: + case 257: + case 12: + case 13: + case 200: case 189: + case 204: + return 19; + case 187: + case 183: + case 184: + return 18; + case 186: + return hasArguments ? 18 : 17; + case 185: + return 17; + case 197: + return 16; + case 196: + case 193: + case 194: case 192: - return 15; case 195: + return 15; + case 198: switch (operatorKind) { case 51: case 52: @@ -7949,13 +8185,13 @@ var ts; default: return -1; } - case 196: - return 4; - case 198: - return 2; case 199: + return 4; + case 201: + return 2; + case 202: return 1; - case 293: + case 296: return 0; default: return -1; @@ -7964,9 +8200,9 @@ var ts; ts.getOperatorPrecedence = getOperatorPrecedence; function createDiagnosticCollection() { var nonFileDiagnostics = []; + var filesWithDiagnostics = []; var fileDiagnostics = ts.createMap(); var hasReadNonFileDiagnostics = false; - var diagnosticsModified = false; var modificationCount = 0; return { add: add, @@ -7988,6 +8224,7 @@ var ts; if (!diagnostics) { diagnostics = []; fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive); } } else { @@ -7997,39 +8234,23 @@ var ts; } diagnostics = nonFileDiagnostics; } - diagnostics.push(diagnostic); - diagnosticsModified = true; + ts.insertSorted(diagnostics, diagnostic, ts.compareDiagnostics); modificationCount++; } function getGlobalDiagnostics() { - sortAndDeduplicate(); hasReadNonFileDiagnostics = true; return nonFileDiagnostics; } function getDiagnostics(fileName) { - sortAndDeduplicate(); if (fileName) { return fileDiagnostics.get(fileName) || []; } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); + var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); }); + if (!nonFileDiagnostics.length) { + return fileDiags; } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - fileDiagnostics.forEach(function (diagnostics) { - ts.forEach(diagnostics, pushDiagnostic); - }); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - fileDiagnostics.forEach(function (diagnostics, key) { - fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); - }); + fileDiags.unshift.apply(fileDiags, nonFileDiagnostics); + return fileDiags; } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -8162,7 +8383,19 @@ var ts; getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, getText: function () { return output; }, isAtStartOfLine: function () { return lineStart; }, - reset: reset + clear: reset, + reportInaccessibleThisError: ts.noop, + reportPrivateInBaseOfClassExpression: ts.noop, + reportInaccessibleUniqueSymbolError: ts.noop, + trackSymbol: ts.noop, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: write }; } ts.createTextWriter = createTextWriter; @@ -8251,7 +8484,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 && nodeIsPresent(member.body)) { + if (member.kind === 154 && nodeIsPresent(member.body)) { return member; } }); @@ -8296,10 +8529,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154) { + if (accessor.kind === 155) { getAccessor = accessor; } - else if (accessor.kind === 155) { + else if (accessor.kind === 156) { setAccessor = accessor; } else { @@ -8308,7 +8541,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 || member.kind === 155) + if ((member.kind === 155 || member.kind === 156) && hasModifier(member, 32) === hasModifier(accessor, 32)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -8319,10 +8552,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 && !getAccessor) { + if (member.kind === 155 && !getAccessor) { getAccessor = member; } - if (member.kind === 155 && !setAccessor) { + if (member.kind === 156 && !setAccessor) { setAccessor = member; } } @@ -8338,7 +8571,7 @@ var ts; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (node.type) { + if (ts.hasType(node)) { return node.type; } if (checkJSDoc || isInJavaScriptFile(node)) { @@ -8573,7 +8806,7 @@ var ts; case 76: return 2048; case 79: return 512; case 120: return 256; - case 131: return 64; + case 132: return 64; } return 0; } @@ -8589,7 +8822,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 && + if (node.kind === 205 && node.parent.token === 85 && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -8607,8 +8840,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 179 - || kind === 178; + return kind === 182 + || kind === 181; } return false; } @@ -8618,7 +8851,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 + return node.kind === 205 && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 @@ -8628,21 +8861,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 || - node.kind === 180 && isEntityNameExpression(node.expression); + node.kind === 183 && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 && node.parent.right === node) || - (node.parent.kind === 180 && node.parent.name === node); + return (node.parent.kind === 145 && node.parent.right === node) || + (node.parent.kind === 183 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 && + return expression.kind === 182 && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 && + return expression.kind === 181 && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -8712,14 +8945,14 @@ var ts; ts.convertToBase64 = convertToBase64; var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; - function getNewLineCharacter(options, system) { + function getNewLineCharacter(options, getNewLine) { switch (options.newLine) { case 0: return carriageReturnLineFeed; case 1: return lineFeed; } - return system ? system.newLine : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; + return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; function formatEnum(value, enumObject, isFlags) { @@ -8855,8 +9088,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233: - case 234: + case 236: + case 237: return parseNode === parseNode.parent.name; } } @@ -8924,20 +9157,20 @@ var ts; if (!parent) return 0; switch (parent.kind) { - case 194: - case 193: + case 197: + case 196: var operator = parent.operator; return operator === 43 || operator === 44 ? writeOrReadWrite() : 0; - case 195: + case 198: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0; - case 180: + case 183: return parent.name !== node ? 0 : accessKind(parent); default: return 0; } function writeOrReadWrite() { - return parent.parent && parent.parent.kind === 211 ? 1 : 2; + return parent.parent && parent.parent.kind === 214 ? 1 : 2; } } function compareDataObjects(dst, src) { @@ -9021,6 +9254,14 @@ var ts; return checker.getSignaturesOfType(type, 0).length !== 0 || checker.getSignaturesOfType(type, 1).length !== 0; } ts.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures; + function forSomeAncestorDirectory(directory, callback) { + return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); + } + ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -9154,9 +9395,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146) { + if (d && d.kind === 147) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234) { return current; } } @@ -9164,7 +9405,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92) && node.parent.kind === 153 && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92) && node.parent.kind === 154 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -9182,7 +9423,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -9190,14 +9431,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227) { + if (node.kind === 230) { node = node.parent; } - if (node && node.kind === 228) { + if (node && node.kind === 231) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209) { + if (node && node.kind === 212) { flags |= ts.getModifierFlags(node); } return flags; @@ -9206,14 +9447,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227) { + if (node.kind === 230) { node = node.parent; } - if (node && node.kind === 228) { + if (node && node.kind === 231) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209) { + if (node && node.kind === 212) { flags |= node.flags; } return flags; @@ -9317,18 +9558,17 @@ var ts; return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 209: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211: + case 214: var expr = hostNode.expression; switch (expr.kind) { - case 180: + case 183: return expr.name; - case 181: + case 184: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -9337,10 +9577,10 @@ var ts; return undefined; case 1: return undefined; - case 186: { + case 189: { return getDeclarationIdentifier(hostNode.expression); } - case 223: { + case 226: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -9365,15 +9605,15 @@ var ts; switch (declaration.kind) { case 71: return declaration; - case 289: - case 284: { + case 292: + case 287: { var name = declaration.name; - if (name.kind === 144) { + if (name.kind === 145) { return name.right; } break; } - case 195: { + case 198: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1: @@ -9385,9 +9625,9 @@ var ts; return undefined; } } - case 288: + case 291: return getNameOfJSDocTypedef(declaration); - case 244: { + case 247: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -9404,27 +9644,27 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284); + return !!getFirstJSDocTag(node, 287); } ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282); + return getFirstJSDocTag(node, 285); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283); + return getFirstJSDocTag(node, 286); } ts.getJSDocClassTag = getJSDocClassTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285); + return getFirstJSDocTag(node, 288); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287); + return getFirstJSDocTag(node, 290); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getJSDocTypeTag(node) { - var tag = getFirstJSDocTag(node, 286); + var tag = getFirstJSDocTag(node, 289); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -9432,8 +9672,8 @@ var ts; } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286); - if (!tag && node.kind === 147) { + var tag = getFirstJSDocTag(node, 289); + if (!tag && node.kind === 148) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -9503,600 +9743,608 @@ var ts; } ts.isIdentifier = isIdentifier; function isQualifiedName(node) { - return node.kind === 144; + return node.kind === 145; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145; + return node.kind === 146; } ts.isComputedPropertyName = isComputedPropertyName; function isTypeParameterDeclaration(node) { - return node.kind === 146; + return node.kind === 147; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147; + return node.kind === 148; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148; + return node.kind === 149; } ts.isDecorator = isDecorator; function isPropertySignature(node) { - return node.kind === 149; + return node.kind === 150; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150; + return node.kind === 151; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151; + return node.kind === 152; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152; + return node.kind === 153; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153; + return node.kind === 154; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154; + return node.kind === 155; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155; + return node.kind === 156; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156; + return node.kind === 157; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157; + return node.kind === 158; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158; + return node.kind === 159; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; function isTypePredicateNode(node) { - return node.kind === 159; + return node.kind === 160; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160; + return node.kind === 161; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161; + return node.kind === 162; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162; + return node.kind === 163; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163; + return node.kind === 164; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164; + return node.kind === 165; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165; + return node.kind === 166; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166; + return node.kind === 167; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167; + return node.kind === 168; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168; + return node.kind === 169; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169; + return node.kind === 172; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170; + return node.kind === 173; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171; + return node.kind === 174; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172; + return node.kind === 175; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173; + return node.kind === 176; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174; + return node.kind === 177; } ts.isLiteralTypeNode = isLiteralTypeNode; function isObjectBindingPattern(node) { - return node.kind === 175; + return node.kind === 178; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176; + return node.kind === 179; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177; + return node.kind === 180; } ts.isBindingElement = isBindingElement; function isArrayLiteralExpression(node) { - return node.kind === 178; + return node.kind === 181; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179; + return node.kind === 182; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180; + return node.kind === 183; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181; + return node.kind === 184; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182; + return node.kind === 185; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183; + return node.kind === 186; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184; + return node.kind === 187; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185; + return node.kind === 188; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186; + return node.kind === 189; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292) { + while (node.kind === 295) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187; + return node.kind === 190; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188; + return node.kind === 191; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189; + return node.kind === 192; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 192; + return node.kind === 193; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191; + return node.kind === 194; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192; + return node.kind === 195; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193; + return node.kind === 196; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194; + return node.kind === 197; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195; + return node.kind === 198; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196; + return node.kind === 199; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197; + return node.kind === 200; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198; + return node.kind === 201; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199; + return node.kind === 202; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200; + return node.kind === 203; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201; + return node.kind === 204; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202; + return node.kind === 205; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203; + return node.kind === 206; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204; + return node.kind === 207; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205; + return node.kind === 208; } ts.isMetaProperty = isMetaProperty; function isTemplateSpan(node) { - return node.kind === 206; + return node.kind === 209; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207; + return node.kind === 210; } ts.isSemicolonClassElement = isSemicolonClassElement; function isBlock(node) { - return node.kind === 208; + return node.kind === 211; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209; + return node.kind === 212; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210; + return node.kind === 213; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211; + return node.kind === 214; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212; + return node.kind === 215; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213; + return node.kind === 216; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214; + return node.kind === 217; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215; + return node.kind === 218; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216; + return node.kind === 219; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217; + return node.kind === 220; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218; + return node.kind === 221; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219; + return node.kind === 222; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 || node.kind === 218; + return node.kind === 222 || node.kind === 221; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220; + return node.kind === 223; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221; + return node.kind === 224; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222; + return node.kind === 225; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223; + return node.kind === 226; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224; + return node.kind === 227; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225; + return node.kind === 228; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226; + return node.kind === 229; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227; + return node.kind === 230; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228; + return node.kind === 231; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229; + return node.kind === 232; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230; + return node.kind === 233; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231; + return node.kind === 234; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232; + return node.kind === 235; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233; + return node.kind === 236; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234; + return node.kind === 237; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235; + return node.kind === 238; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236; + return node.kind === 239; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237; + return node.kind === 240; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238; + return node.kind === 241; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239; + return node.kind === 242; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240; + return node.kind === 243; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241; + return node.kind === 244; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242; + return node.kind === 245; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243; + return node.kind === 246; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244; + return node.kind === 247; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245; + return node.kind === 248; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246; + return node.kind === 249; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247; + return node.kind === 250; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248; + return node.kind === 251; } ts.isMissingDeclaration = isMissingDeclaration; function isExternalModuleReference(node) { - return node.kind === 249; + return node.kind === 252; } ts.isExternalModuleReference = isExternalModuleReference; function isJsxElement(node) { - return node.kind === 250; + return node.kind === 253; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251; + return node.kind === 254; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252; + return node.kind === 255; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253; + return node.kind === 256; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254; + return node.kind === 257; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255; + return node.kind === 258; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256; + return node.kind === 259; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257; + return node.kind === 260; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258; + return node.kind === 261; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259; + return node.kind === 262; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260; + return node.kind === 263; } ts.isJsxExpression = isJsxExpression; function isCaseClause(node) { - return node.kind === 261; + return node.kind === 264; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262; + return node.kind === 265; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263; + return node.kind === 266; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264; + return node.kind === 267; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 265; + return node.kind === 268; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266; + return node.kind === 269; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267; + return node.kind === 270; } ts.isSpreadAssignment = isSpreadAssignment; function isEnumMember(node) { - return node.kind === 268; + return node.kind === 271; } ts.isEnumMember = isEnumMember; function isSourceFile(node) { - return node.kind === 269; + return node.kind === 272; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270; + return node.kind === 273; } ts.isBundle = isBundle; function isJSDocTypeExpression(node) { - return node.kind === 271; + return node.kind === 274; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272; + return node.kind === 275; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273; + return node.kind === 276; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274; + return node.kind === 277; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275; + return node.kind === 278; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276; + return node.kind === 279; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277; + return node.kind === 280; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278; + return node.kind === 281; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279; + return node.kind === 282; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282; + return node.kind === 285; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284; + return node.kind === 287; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285; + return node.kind === 288; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286; + return node.kind === 289; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287; + return node.kind === 290; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288; + return node.kind === 291; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289; + return node.kind === 292; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 || node.kind === 284; + return node.kind === 292 || node.kind === 287; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280; + return node.kind === 283; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); (function (ts) { function isSyntaxList(n) { - return n.kind === 290; + return n.kind === 293; } ts.isSyntaxList = isSyntaxList; function isNode(node) { @@ -10104,11 +10352,11 @@ var ts; } ts.isNode = isNode; function isNodeKind(kind) { - return kind >= 144; + return kind >= 145; } ts.isNodeKind = isNodeKind; function isToken(n) { - return n.kind >= 0 && n.kind <= 143; + return n.kind >= 0 && n.kind <= 144; } ts.isToken = isToken; function isNodeArray(array) { @@ -10138,7 +10386,7 @@ var ts; } ts.isStringTextContainingNode = isStringTextContainingNode; function isGeneratedIdentifier(node) { - return ts.isIdentifier(node) && node.autoGenerateKind > 0; + return ts.isIdentifier(node) && (node.autoGenerateFlags & 7) > 0; } ts.isGeneratedIdentifier = isGeneratedIdentifier; function isModifierKind(token) { @@ -10152,7 +10400,7 @@ var ts; case 114: case 112: case 113: - case 131: + case 132: case 115: return true; } @@ -10165,7 +10413,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 + return kind === 145 || kind === 71; } ts.isEntityName = isEntityName; @@ -10174,14 +10422,14 @@ var ts; return kind === 71 || kind === 9 || kind === 8 - || kind === 145; + || kind === 146; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 - || kind === 175 - || kind === 176; + || kind === 178 + || kind === 179; } ts.isBindingName = isBindingName; function isFunctionLike(node) { @@ -10194,13 +10442,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229: - case 152: + case 232: case 153: case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: return true; default: return false; @@ -10208,13 +10456,13 @@ var ts; } function isFunctionLikeKind(kind) { switch (kind) { - case 151: - case 156: + case 152: case 157: case 158: - case 161: - case 277: + case 159: case 162: + case 280: + case 163: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -10227,66 +10475,77 @@ var ts; ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock; function isClassElement(node) { var kind = node.kind; - return kind === 153 - || kind === 150 - || kind === 152 - || kind === 154 + return kind === 154 + || kind === 151 + || kind === 153 || kind === 155 - || kind === 158 - || kind === 207 - || kind === 248; + || kind === 156 + || kind === 159 + || kind === 210 + || kind === 251; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 || node.kind === 200); + return node && (node.kind === 233 || node.kind === 203); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 || node.kind === 155); + return node && (node.kind === 155 || node.kind === 156); } ts.isAccessor = isAccessor; + function isMethodOrAccessor(node) { + switch (node.kind) { + case 153: + case 155: + case 156: + return true; + default: + return false; + } + } + ts.isMethodOrAccessor = isMethodOrAccessor; function isTypeElement(node) { var kind = node.kind; - return kind === 157 - || kind === 156 - || kind === 149 - || kind === 151 - || kind === 158 - || kind === 248; + return kind === 158 + || kind === 157 + || kind === 150 + || kind === 152 + || kind === 159 + || kind === 251; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 - || kind === 266 - || kind === 267 - || kind === 152 - || kind === 154 + return kind === 268 + || kind === 269 + || kind === 270 + || kind === 153 || kind === 155 - || kind === 248; + || kind === 156 + || kind === 251; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNodeKind(kind) { - return (kind >= 159 && kind <= 174) + return (kind >= 160 && kind <= 177) || kind === 119 - || kind === 133 || kind === 134 + || kind === 135 || kind === 122 - || kind === 136 || kind === 137 + || kind === 138 || kind === 99 || kind === 105 - || kind === 139 + || kind === 140 || kind === 95 - || kind === 130 - || kind === 202 - || kind === 272 - || kind === 273 - || kind === 274 + || kind === 131 + || kind === 205 || kind === 275 || kind === 276 || kind === 277 - || kind === 278; + || kind === 278 + || kind === 279 + || kind === 280 + || kind === 281; } function isTypeNode(node) { return isTypeNodeKind(node.kind); @@ -10294,8 +10553,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161: case 162: + case 163: return true; } return false; @@ -10304,29 +10563,29 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 - || kind === 175; + return kind === 179 + || kind === 178; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 - || kind === 179; + return kind === 181 + || kind === 182; } ts.isAssignmentPattern = isAssignmentPattern; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 - || kind === 201; + return kind === 180 + || kind === 204; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227: - case 147: - case 177: + case 230: + case 148: + case 180: return true; } return false; @@ -10339,8 +10598,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175: - case 179: + case 178: + case 182: return true; } return false; @@ -10348,8 +10607,8 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176: - case 178: + case 179: + case 181: return true; } return false; @@ -10357,18 +10616,18 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 - || kind === 144; + return kind === 183 + || kind === 145; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252: - case 251: - case 182: - case 183: - case 184: - case 148: + case 255: + case 254: + case 185: + case 186: + case 187: + case 149: return true; default: return false; @@ -10376,12 +10635,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 || node.kind === 183; + return node.kind === 185 || node.kind === 186; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 + return kind === 200 || kind === 13; } ts.isTemplateLiteral = isTemplateLiteral; @@ -10391,32 +10650,32 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180: - case 181: case 183: - case 182: - case 250: - case 251: - case 254: case 184: - case 178: case 186: - case 179: - case 200: + case 185: + case 253: + case 254: + case 257: case 187: + case 181: + case 189: + case 182: + case 203: + case 190: case 71: case 12: case 8: case 9: case 13: - case 197: + case 200: case 86: case 95: case 99: case 101: case 97: - case 204: - case 205: + case 207: + case 208: case 91: return true; default: @@ -10429,13 +10688,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { + case 196: + case 197: + case 192: case 193: case 194: - case 189: - case 190: - case 191: - case 192: - case 185: + case 195: + case 188: return true; default: return isLeftHandSideExpressionKind(kind); @@ -10443,9 +10702,9 @@ var ts; } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194: + case 197: return true; - case 193: + case 196: return expr.operator === 43 || expr.operator === 44; default: @@ -10459,15 +10718,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196: - case 198: - case 188: - case 195: case 199: - case 203: case 201: - case 293: - case 292: + case 191: + case 198: + case 202: + case 206: + case 204: + case 296: + case 295: return true; default: return isUnaryExpressionKind(kind); @@ -10475,16 +10734,16 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 - || kind === 203; + return kind === 188 + || kind === 206; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 292; + return node.kind === 295; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 291; + return node.kind === 294; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -10494,20 +10753,20 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215: + case 218: + case 219: + case 220: case 216: case 217: - case 213: - case 214: return true; - case 223: + case 226: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isForInOrOfStatement(node) { - return node.kind === 216 || node.kind === 217; + return node.kind === 219 || node.kind === 220; } ts.isForInOrOfStatement = isForInOrOfStatement; function isConciseBody(node) { @@ -10526,106 +10785,106 @@ var ts; ts.isForInitializer = isForInitializer; function isModuleBody(node) { var kind = node.kind; - return kind === 235 - || kind === 234 + return kind === 238 + || kind === 237 || kind === 71; } ts.isModuleBody = isModuleBody; function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 - || kind === 234; + return kind === 238 + || kind === 237; } ts.isNamespaceBody = isNamespaceBody; function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 - || kind === 234; + || kind === 237; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 - || kind === 241; + return kind === 245 + || kind === 244; } ts.isNamedImportBindings = isNamedImportBindings; function isModuleOrEnumDeclaration(node) { - return node.kind === 234 || node.kind === 233; + return node.kind === 237 || node.kind === 236; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 - || kind === 177 - || kind === 230 - || kind === 200 - || kind === 153 + return kind === 191 + || kind === 180 || kind === 233 - || kind === 268 - || kind === 247 - || kind === 229 - || kind === 187 + || kind === 203 || kind === 154 - || kind === 240 - || kind === 238 - || kind === 243 - || kind === 231 - || kind === 257 - || kind === 152 - || kind === 151 - || kind === 234 - || kind === 237 - || kind === 241 - || kind === 147 - || kind === 265 - || kind === 150 - || kind === 149 - || kind === 155 - || kind === 266 + || kind === 236 + || kind === 271 + || kind === 250 || kind === 232 - || kind === 146 - || kind === 227 - || kind === 288; + || kind === 190 + || kind === 155 + || kind === 243 + || kind === 241 + || kind === 246 + || kind === 234 + || kind === 260 + || kind === 153 + || kind === 152 + || kind === 237 + || kind === 240 + || kind === 244 + || kind === 148 + || kind === 268 + || kind === 151 + || kind === 150 + || kind === 156 + || kind === 269 + || kind === 235 + || kind === 147 + || kind === 230 + || kind === 291; } function isDeclarationStatementKind(kind) { - return kind === 229 - || kind === 248 - || kind === 230 - || kind === 231 - || kind === 232 + return kind === 232 + || kind === 251 || kind === 233 || kind === 234 - || kind === 239 - || kind === 238 - || kind === 245 - || kind === 244 - || kind === 237; + || kind === 235 + || kind === 236 + || kind === 237 + || kind === 242 + || kind === 241 + || kind === 248 + || kind === 247 + || kind === 240; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 - || kind === 218 - || kind === 226 - || kind === 213 - || kind === 211 - || kind === 210 - || kind === 216 - || kind === 217 - || kind === 215 - || kind === 212 - || kind === 223 - || kind === 220 - || kind === 222 - || kind === 224 - || kind === 225 - || kind === 209 - || kind === 214 + return kind === 222 || kind === 221 - || kind === 291 - || kind === 295 - || kind === 294; + || kind === 229 + || kind === 216 + || kind === 214 + || kind === 213 + || kind === 219 + || kind === 220 + || kind === 218 + || kind === 215 + || kind === 226 + || kind === 223 + || kind === 225 + || kind === 227 + || kind === 228 + || kind === 212 + || kind === 217 + || kind === 224 + || kind === 294 + || kind === 298 + || kind === 297; } function isDeclaration(node) { - if (node.kind === 146) { - return node.parent.kind !== 287 || ts.isInJavaScriptFile(node); + if (node.kind === 147) { + return node.parent.kind !== 290 || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -10646,10 +10905,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208) + if (node.kind !== 211) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 || node.parent.kind === 264) { + if (node.parent.kind === 228 || node.parent.kind === 267) { return false; } } @@ -10657,8 +10916,8 @@ var ts; } function isModuleReference(node) { var kind = node.kind; - return kind === 249 - || kind === 144 + return kind === 252 + || kind === 145 || kind === 71; } ts.isModuleReference = isModuleReference; @@ -10666,66 +10925,101 @@ var ts; var kind = node.kind; return kind === 99 || kind === 71 - || kind === 180; + || kind === 183; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 250 - || kind === 260 - || kind === 251 + return kind === 253 + || kind === 263 + || kind === 254 || kind === 10 - || kind === 254; + || kind === 257; } ts.isJsxChild = isJsxChild; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 - || kind === 259; + return kind === 260 + || kind === 262; } ts.isJsxAttributeLike = isJsxAttributeLike; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 - || kind === 260; + || kind === 263; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 - || kind === 251; + return kind === 255 + || kind === 254; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 - || kind === 262; + return kind === 264 + || kind === 265; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isJSDocNode(node) { - return node.kind >= 271 && node.kind <= 289; + return node.kind >= 274 && node.kind <= 292; } ts.isJSDocNode = isJSDocNode; function isJSDocCommentContainingNode(node) { - return node.kind === 279 || isJSDocTag(node); + return node.kind === 282 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; function isJSDocTag(node) { - return node.kind >= 281 && node.kind <= 289; + return node.kind >= 284 && node.kind <= 292; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155; + return node.kind === 156; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154; + return node.kind === 155; } ts.isGetAccessor = isGetAccessor; function hasJSDocNodes(node) { return !!node.jsDoc && node.jsDoc.length > 0; } ts.hasJSDocNodes = hasJSDocNodes; + function hasType(node) { + return !!node.type; + } + ts.hasType = hasType; + function hasInitializer(node) { + return !!node.initializer; + } + ts.hasInitializer = hasInitializer; + function hasOnlyExpressionInitializer(node) { + return hasInitializer(node) && !ts.isForStatement(node) && !ts.isForInStatement(node) && !ts.isForOfStatement(node) && !ts.isJsxAttribute(node); + } + ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; + function isObjectLiteralElement(node) { + switch (node.kind) { + case 260: + case 262: + case 268: + case 269: + case 153: + case 155: + case 156: + return true; + default: + return false; + } + } + ts.isObjectLiteralElement = isObjectLiteralElement; + function isTypeReferenceType(node) { + return node.kind === 161 || node.kind === 205; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 || node.kind === 13; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -10761,47 +11055,48 @@ var ts; "false": 86, "finally": 87, "for": 88, - "from": 141, + "from": 142, "function": 89, "get": 125, "if": 90, "implements": 108, "import": 91, "in": 92, + "infer": 126, "instanceof": 93, "interface": 109, - "is": 126, - "keyof": 127, + "is": 127, + "keyof": 128, "let": 110, - "module": 128, - "namespace": 129, - "never": 130, + "module": 129, + "namespace": 130, + "never": 131, "new": 94, "null": 95, - "number": 133, - "object": 134, + "number": 134, + "object": 135, "package": 111, "private": 112, "protected": 113, "public": 114, - "readonly": 131, - "require": 132, - "global": 142, + "readonly": 132, + "require": 133, + "global": 143, "return": 96, - "set": 135, + "set": 136, "static": 115, - "string": 136, + "string": 137, "super": 97, "switch": 98, - "symbol": 137, + "symbol": 138, "this": 99, "throw": 100, "true": 101, "try": 102, - "type": 138, + "type": 139, "typeof": 103, - "undefined": 139, - "unique": 140, + "undefined": 140, + "unique": 141, "var": 104, "void": 105, "while": 106, @@ -10809,7 +11104,7 @@ var ts; "yield": 116, "async": 120, "await": 121, - "of": 143, + "of": 144, "{": 17, "}": 18, "(": 19, @@ -10951,7 +11246,9 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -11132,7 +11429,7 @@ var ts; } function scanConflictMarkerTrivia(text, pos, error) { if (error) { - error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength); + error(ts.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); } var ch = text.charCodeAt(pos); var len = text.length; @@ -11356,19 +11653,60 @@ var ts; lookAhead: lookAhead, scanRange: scanRange, }; - function error(message, length) { + function error(message, errPos, length) { + if (errPos === void 0) { errPos = pos; } if (onError) { + var oldPos = pos; + pos = errPos; onError(message, length || 0); + pos = oldPos; } } + function scanNumberFragment() { + var start = pos; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + var result = ""; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result += text.substring(start, pos); + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + start = pos; + continue; + } + if (isDigit(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result + text.substring(start, pos); + } function scanNumber() { var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; + var mainFragment = scanNumberFragment(); + var decimalFragment; + var scientificFragment; if (text.charCodeAt(pos) === 46) { pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; + decimalFragment = scanNumberFragment(); } var end = pos; if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { @@ -11376,17 +11714,29 @@ var ts; tokenFlags |= 16; if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { + var preNumericPart = pos; + var finalFragment = scanNumberFragment(); + if (!finalFragment) { error(ts.Diagnostics.Digit_expected); } + else { + scientificFragment = text.substring(end, preNumericPart) + finalFragment; + end = pos; + } + } + if (tokenFlags & 512) { + var result = mainFragment; + if (decimalFragment) { + result += "." + decimalFragment; + } + if (scientificFragment) { + result += scientificFragment; + } + return "" + +result; + } + else { + return "" + +(text.substring(start, end)); } - return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -11395,17 +11745,35 @@ var ts; } return +(text.substring(start, pos)); } - function scanExactNumberOfHexDigits(count) { - return scanHexDigits(count, false); + function scanExactNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(count, false, canHaveSeparators); } - function scanMinimumNumberOfHexDigits(count) { - return scanHexDigits(count, true); + function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(count, true, canHaveSeparators); } - function scanHexDigits(minCount, scanAsManyAsPossible) { + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { var digits = 0; var value = 0; + var allowSeparator = false; + var isPreviousTokenSeparator = false; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; if (ch >= 48 && ch <= 57) { value = value * 16 + ch - 48; } @@ -11420,10 +11788,14 @@ var ts; } pos++; digits++; + isPreviousTokenSeparator = false; } if (digits < minCount) { value = -1; } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } return value; } function scanString(jsxAttributeString) { @@ -11559,7 +11931,7 @@ var ts; } } function scanHexadecimalEscape(numDigits) { - var escapedValue = scanExactNumberOfHexDigits(numDigits); + var escapedValue = scanExactNumberOfHexDigits(numDigits, false); if (escapedValue >= 0) { return String.fromCharCode(escapedValue); } @@ -11569,7 +11941,7 @@ var ts; } } function scanExtendedUnicodeEscape() { - var escapedValue = scanMinimumNumberOfHexDigits(1); + var escapedValue = scanMinimumNumberOfHexDigits(1, false); var isInvalidExtendedEscape = false; if (escapedValue < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); @@ -11608,7 +11980,7 @@ var ts; if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) { var start_1 = pos; pos += 2; - var value = scanExactNumberOfHexDigits(4); + var value = scanExactNumberOfHexDigits(4, false); pos = start_1; return value; } @@ -11656,8 +12028,26 @@ var ts; ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8"); var value = 0; var numberOfDigits = 0; + var separatorAllowed = false; + var isPreviousTokenSeparator = false; while (true) { var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; var valueOfCh = ch - 48; if (!isDigit(ch) || valueOfCh >= base) { break; @@ -11665,10 +12055,15 @@ var ts; value = value * base + valueOfCh; pos++; numberOfDigits++; + isPreviousTokenSeparator = false; } if (numberOfDigits === 0) { return -1; } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + return value; + } return value; } function scan() { @@ -11854,7 +12249,7 @@ var ts; case 48: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { pos += 2; - var value = scanMinimumNumberOfHexDigits(1); + var value = scanMinimumNumberOfHexDigits(1, true); if (value < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); value = 0; @@ -12175,7 +12570,7 @@ var ts; break; } } - tokenValue += text.substr(firstCharPosition, pos - firstCharPosition); + tokenValue += text.substring(firstCharPosition, pos); } return token; } @@ -12197,6 +12592,7 @@ var ts; startPos = pos; tokenPos = pos; var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 9: case 11: @@ -12207,55 +12603,30 @@ var ts; } return token = 5; case 64: - pos++; return token = 57; case 10: case 13: - pos++; return token = 4; case 42: - pos++; return token = 39; case 123: - pos++; return token = 17; case 125: - pos++; return token = 18; case 91: - pos++; return token = 21; case 93: - pos++; return token = 22; case 60: - pos++; return token = 27; - case 62: - pos++; - return token = 29; case 61: - pos++; return token = 58; case 44: - pos++; return token = 26; case 46: - pos++; - if (text.substr(tokenPos, pos + 2) === "...") { - pos += 2; - return token = 24; - } return token = 23; - case 33: - pos++; - return token = 51; - case 63: - pos++; - return token = 55; } if (isIdentifierStart(ch, 6)) { - pos++; while (isIdentifierPart(text.charCodeAt(pos), 6) && pos < end) { pos++; } @@ -12263,7 +12634,7 @@ var ts; return token = 71; } else { - return pos += 1, token = 0; + return token = 0; } } function speculationHelper(callback, isLookahead) { @@ -12355,7 +12726,7 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 269) { + if (kind === 272) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71) { @@ -12387,60 +12758,88 @@ var ts; } } function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143) { + if (!node || node.kind <= 144) { return; } switch (node.kind) { - case 144: + case 145: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146: + case 147: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266: + case 269: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267: + case 270: return visitNode(cbNode, node.expression); - case 147: - case 150: - case 149: - case 265: - case 227: - case 177: + case 148: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 151: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 161: + case 150: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 268: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.initializer); + case 230: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.exclamationToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 180: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 162: - case 156: + case 163: case 157: case 158: + case 159: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 187: - case 229: - case 188: + case 156: + case 190: + case 232: + case 191: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -12451,291 +12850,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160: + case 161: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159: + case 160: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163: - return visitNode(cbNode, node.exprName); case 164: - return visitNodes(cbNode, cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 165: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNode, cbNodes, node.members); case 166: - return visitNodes(cbNode, cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 167: + return visitNodes(cbNode, cbNodes, node.elementTypes); case 168: - return visitNodes(cbNode, cbNodes, node.types); case 169: + return visitNodes(cbNode, cbNodes, node.types); + case 170: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); case 171: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.typeParameter); case 172: + case 174: + return visitNode(cbNode, node.type); + case 175: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173: + case 176: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174: + case 177: return visitNode(cbNode, node.literal); - case 175: - case 176: - return visitNodes(cbNode, cbNodes, node.elements); case 178: - return visitNodes(cbNode, cbNodes, node.elements); case 179: + return visitNodes(cbNode, cbNodes, node.elements); + case 181: + return visitNodes(cbNode, cbNodes, node.elements); + case 182: return visitNodes(cbNode, cbNodes, node.properties); - case 180: + case 183: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181: + case 184: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182: - case 183: + case 185: + case 186: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184: + case 187: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185: + case 188: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186: - return visitNode(cbNode, node.expression); case 189: return visitNode(cbNode, node.expression); - case 190: - return visitNode(cbNode, node.expression); - case 191: - return visitNode(cbNode, node.expression); - case 193: - return visitNode(cbNode, node.operand); - case 198: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 192: return visitNode(cbNode, node.expression); + case 193: + return visitNode(cbNode, node.expression); case 194: + return visitNode(cbNode, node.expression); + case 196: return visitNode(cbNode, node.operand); + case 201: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); case 195: + return visitNode(cbNode, node.expression); + case 197: + return visitNode(cbNode, node.operand); + case 198: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203: + case 206: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204: + case 207: return visitNode(cbNode, node.expression); - case 205: + case 208: return visitNode(cbNode, node.name); - case 196: + case 199: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199: + case 202: return visitNode(cbNode, node.expression); - case 208: - case 235: + case 211: + case 238: return visitNodes(cbNode, cbNodes, node.statements); - case 269: + case 272: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209: + case 212: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228: + case 231: return visitNodes(cbNode, cbNodes, node.declarations); - case 211: + case 214: return visitNode(cbNode, node.expression); - case 212: + case 215: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213: + case 216: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214: + case 217: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215: + case 218: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216: + case 219: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217: + case 220: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218: - case 219: - return visitNode(cbNode, node.label); - case 220: - return visitNode(cbNode, node.expression); case 221: + case 222: + return visitNode(cbNode, node.label); + case 223: + return visitNode(cbNode, node.expression); + case 224: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222: + case 225: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236: + case 239: return visitNodes(cbNode, cbNodes, node.clauses); - case 261: + case 264: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262: + case 265: return visitNodes(cbNode, cbNodes, node.statements); - case 223: + case 226: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224: + case 227: return visitNode(cbNode, node.expression); - case 225: + case 228: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264: + case 267: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148: + case 149: return visitNode(cbNode, node.expression); - case 230: - case 200: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); - case 231: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); - case 232: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); case 233: + case 203: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 268: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 234: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || + visitNodes(cbNode, cbNodes, node.members); + case 235: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 236: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.members); + case 271: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 237: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238: + case 241: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239: + case 242: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240: + case 243: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237: + case 240: return visitNode(cbNode, node.name); - case 241: + case 244: return visitNode(cbNode, node.name); - case 242: - case 246: - return visitNodes(cbNode, cbNodes, node.elements); case 245: + case 249: + return visitNodes(cbNode, cbNodes, node.elements); + case 248: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243: - case 247: + case 246: + case 250: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244: + case 247: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197: + case 200: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206: + case 209: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145: + case 146: return visitNode(cbNode, node.expression); - case 263: + case 266: return visitNodes(cbNode, cbNodes, node.types); - case 202: + case 205: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249: + case 252: return visitNode(cbNode, node.expression); - case 248: + case 251: return visitNodes(cbNode, cbNodes, node.decorators); - case 293: + case 296: return visitNodes(cbNode, cbNodes, node.elements); - case 250: + case 253: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254: + case 257: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251: - case 252: + case 254: + case 255: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258: + case 261: return visitNodes(cbNode, cbNodes, node.properties); - case 257: + case 260: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259: + case 262: return visitNode(cbNode, node.expression); - case 260: + case 263: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253: + case 256: return visitNode(cbNode, node.tagName); - case 271: - return visitNode(cbNode, node.type); - case 275: - return visitNode(cbNode, node.type); case 274: return visitNode(cbNode, node.type); - case 276: - return visitNode(cbNode, node.type); - case 277: - return visitNodes(cbNode, cbNodes, node.parameters) || - visitNode(cbNode, node.type); case 278: return visitNode(cbNode, node.type); + case 277: + return visitNode(cbNode, node.type); case 279: + return visitNode(cbNode, node.type); + case 280: + return visitNodes(cbNode, cbNodes, node.parameters) || + visitNode(cbNode, node.type); + case 281: + return visitNode(cbNode, node.type); + case 282: return visitNodes(cbNode, cbNodes, node.tags); - case 284: - case 289: + case 287: + case 292: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -12744,17 +13150,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285: - return visitNode(cbNode, node.typeExpression); - case 286: - return visitNode(cbNode, node.typeExpression); - case 282: - return visitNode(cbNode, node.class); - case 287: - return visitNodes(cbNode, cbNodes, node.typeParameters); case 288: + return visitNode(cbNode, node.typeExpression); + case 289: + return visitNode(cbNode, node.typeExpression); + case 285: + return visitNode(cbNode, node.class); + case 290: + return visitNodes(cbNode, cbNodes, node.typeParameters); + case 291: if (node.typeExpression && - node.typeExpression.kind === 271) { + node.typeExpression.kind === 274) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -12762,7 +13168,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280: + case 283: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -12770,7 +13176,7 @@ var ts; } } return; - case 292: + case 295: return visitNode(cbNode, node.expression); } } @@ -12861,7 +13267,7 @@ var ts; else if (token() === 17 || lookAhead(function () { return token() === 9; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1, false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1, ts.Diagnostics.Unexpected_token); } else { parseExpected(17); @@ -12938,15 +13344,7 @@ var ts; if (comments) { for (var _i = 0, comments_2 = comments; _i < comments_2.length; _i++) { var comment = comments_2[_i]; - var jsDoc = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDoc) { - if (!node.jsDoc) { - node.jsDoc = [jsDoc]; - } - else { - node.jsDoc.push(jsDoc); - } - } + node.jsDoc = ts.append(node.jsDoc, JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); } } return node; @@ -12975,7 +13373,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { - var sourceFile = new SourceFileConstructor(269, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(272, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -13168,9 +13566,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -13289,7 +13687,7 @@ var ts; return parsePropertyNameWorker(true); } function parseComputedPropertyName() { - var node = createNode(145); + var node = createNode(146); parseExpected(21); node.expression = allowInAnd(parseExpression); parseExpected(22); @@ -13382,9 +13780,12 @@ var ts; return token() === 26 || token() === 24 || isIdentifierOrPattern(); case 18: return isIdentifier(); - case 11: case 15: - return token() === 26 || token() === 24 || isStartOfExpression(); + if (token() === 26) { + return true; + } + case 11: + return token() === 24 || isStartOfExpression(); case 16: return isStartOfParameter(); case 19: @@ -13432,6 +13833,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } function isListTerminator(kind) { if (token() === 1) { return true; @@ -13544,6 +13949,9 @@ var ts; if (!canReuseNode(node, parsingContext)) { return undefined; } + if (node.jsDocCache) { + node.jsDocCache = undefined; + } return node; } function consumeNode(node) { @@ -13586,14 +13994,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153: - case 158: case 154: + case 159: case 155: - case 150: - case 207: + case 156: + case 151: + case 210: return true; - case 152: + case 153: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 71 && methodDeclaration.name.originalKeywordKind === 123; @@ -13605,8 +14013,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261: - case 262: + case 264: + case 265: return true; } } @@ -13615,65 +14023,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229: - case 209: - case 208: + case 232: case 212: case 211: - case 224: - case 220: - case 222: - case 219: - case 218: - case 216: - case 217: case 215: case 214: - case 221: - case 210: - case 225: + case 227: case 223: + case 225: + case 222: + case 221: + case 219: + case 220: + case 218: + case 217: + case 224: case 213: + case 228: case 226: - case 239: - case 238: - case 245: - case 244: - case 234: - case 230: - case 231: + case 216: + case 229: + case 242: + case 241: + case 248: + case 247: + case 237: case 233: - case 232: + case 234: + case 236: + case 235: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268; + return node.kind === 271; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157: - case 151: case 158: - case 149: - case 156: + case 152: + case 159: + case 150: + case 157: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227) { + if (node.kind !== 230) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147) { + if (node.kind !== 148) { return false; } var parameter = node; @@ -13780,7 +14188,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144, entity.pos); + var node = createNode(145, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -13795,7 +14203,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197); + var template = createNode(200); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14, "Template head has wrong token kind"); var list = []; @@ -13807,7 +14215,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206); + var span = createNode(209); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18) { @@ -13815,7 +14223,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16, false, ts.Diagnostics._0_expected, ts.tokenToString(18)); + literal = parseExpectedToken(16, ts.Diagnostics._0_expected, ts.tokenToString(18)); } span.literal = literal; return finishNode(span); @@ -13844,14 +14252,14 @@ var ts; node.isUnterminated = true; } if (node.kind === 8) { - node.numericLiteralFlags = scanner.getTokenFlags() & 496; + node.numericLiteralFlags = scanner.getTokenFlags() & 1008; } nextToken(); finishNode(node); return node; } function parseTypeReference() { - var node = createNode(160); + var node = createNode(161); node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27) { node.typeArguments = parseBracketedList(19, parseType, 27, 29); @@ -13860,18 +14268,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159, lhs.pos); + var node = createNode(160, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170); + var node = createNode(173); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272); + var result = createNode(275); nextToken(); return finishNode(result); } @@ -13884,28 +14292,28 @@ var ts; token() === 29 || token() === 58 || token() === 49) { - var result = createNode(273, pos); + var result = createNode(276, pos); return finishNode(result); } else { - var result = createNode(274, pos); + var result = createNode(277, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277); + var result = createNodeWithJSDoc(280); nextToken(); fillSignature(56, 4 | 32, result); return finishNode(result); } - var node = createNode(160); + var node = createNode(161); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147); + var parameter = createNode(148); if (token() === 99 || token() === 94) { parameter.name = parseIdentifierName(); parseExpected(56); @@ -13920,13 +14328,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163); + var node = createNode(164); parseExpected(103); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146); + var node = createNode(147); node.name = parseIdentifier(); if (parseOptional(85)) { if (isStartOfType() || !isStartOfExpression()) { @@ -13960,7 +14368,7 @@ var ts; isStartOfType(true); } function parseParameter() { - var node = createNodeWithJSDoc(147); + var node = createNodeWithJSDoc(148); if (token() === 99) { node.name = createIdentifier(true); node.type = parseParameterType(); @@ -14027,7 +14435,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157) { + if (kind === 158) { parseExpected(94); } fillSignature(56, 4, node); @@ -14064,7 +14472,7 @@ var ts; return token() === 56 || token() === 26 || token() === 22; } function parseIndexSignatureDeclaration(node) { - node.kind = 158; + node.kind = 159; node.parameters = parseBracketedList(16, parseParameter, 21, 22); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -14074,11 +14482,11 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55); if (token() === 19 || token() === 27) { - node.kind = 151; + node.kind = 152; fillSignature(56, 4, node); } else { - node.kind = 149; + node.kind = 150; node.type = parseTypeAnnotation(); if (token() === 58) { node.initializer = parseInitializer(); @@ -14115,10 +14523,10 @@ var ts; } function parseTypeMember() { if (token() === 19 || token() === 27) { - return parseSignatureMember(156); + return parseSignatureMember(157); } if (token() === 94 && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157); + return parseSignatureMember(158); } var node = createNodeWithJSDoc(0); node.modifiers = parseModifiers(); @@ -14132,7 +14540,7 @@ var ts; return token() === 19 || token() === 27; } function parseTypeLiteral() { - var node = createNode(164); + var node = createNode(165); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -14149,38 +14557,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131) { + if (token() === 37 || token() === 38) { + return nextToken() === 132; + } + if (token() === 132) { nextToken(); } return token() === 21 && nextTokenIsIdentifier() && nextToken() === 92; } function parseMappedTypeParameter() { - var node = createNode(146); + var node = createNode(147); node.name = parseIdentifier(); parseExpected(92); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173); + var node = createNode(176); parseExpected(17); - node.readonlyToken = parseOptionalToken(131); + if (token() === 132 || token() === 37 || token() === 38) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132) { + parseExpectedToken(132); + } + } parseExpected(21); node.typeParameter = parseMappedTypeParameter(); parseExpected(22); - node.questionToken = parseOptionalToken(55); + if (token() === 55 || token() === 37 || token() === 38) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55) { + parseExpectedToken(55); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18); return finishNode(node); } function parseTupleType() { - var node = createNode(166); + var node = createNode(167); node.elementTypes = parseBracketedList(20, parseType, 21, 22); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169); + var node = createNode(172); parseExpected(19); node.type = parseType(); parseExpected(20); @@ -14188,7 +14609,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162) { + if (kind === 163) { parseExpected(94); } fillSignature(36, 4, node); @@ -14199,10 +14620,10 @@ var ts; return token() === 23 ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174); + var node = createNode(177); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193); + unaryMinusExpression = createNode(196); unaryMinusExpression.operator = 38; nextToken(); } @@ -14223,13 +14644,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119: - case 136: - case 133: case 137: - case 122: - case 139: - case 130: case 134: + case 138: + case 122: + case 140: + case 131: + case 135: return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39: return parseJSDocAllType(); @@ -14238,7 +14659,7 @@ var ts; case 89: return parseJSDocFunctionType(); case 51: - return parseJSDocNodeWithType(275); + return parseJSDocNodeWithType(278); case 13: case 9: case 8: @@ -14252,7 +14673,7 @@ var ts; return parseTokenNode(); case 99: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -14274,17 +14695,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119: - case 136: - case 133: - case 122: case 137: - case 140: + case 134: + case 122: + case 138: + case 141: case 105: - case 139: + case 140: case 95: case 99: case 103: - case 130: + case 131: case 17: case 21: case 27: @@ -14295,11 +14716,12 @@ var ts; case 8: case 101: case 86: - case 134: + case 135: case 39: case 55: case 51: case 24: + case 126: return true; case 38: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -14321,25 +14743,28 @@ var ts; if (!(contextFlags & 1048576)) { return type; } - type = createJSDocPostfixType(276, type); + type = createJSDocPostfixType(279, type); break; case 51: - type = createJSDocPostfixType(275, type); + type = createJSDocPostfixType(278, type); break; case 55: - type = createJSDocPostfixType(274, type); + if (!(contextFlags & 1048576) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277, type); break; case 21: parseExpected(21); if (isStartOfType()) { - var node = createNode(172, type.pos); + var node = createNode(175, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22); type = finishNode(node); } else { - var node = createNode(165, type.pos); + var node = createNode(166, type.pos); node.elementType = type; parseExpected(22); type = finishNode(node); @@ -14358,20 +14783,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171); + var node = createNode(174); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171); + parseExpected(126); + var typeParameter = createNode(147); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127: - case 140: + case 128: + case 141: return parseTypeOperator(operator); + case 126: + return parseInferType(); case 24: { - var result = createNode(278); + var result = createNode(281); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -14394,10 +14829,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168, parseTypeOperatorOrHigher, 48); + return parseUnionOrIntersectionType(169, parseTypeOperatorOrHigher, 48); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167, parseIntersectionTypeOrHigher, 49); + return parseUnionOrIntersectionType(168, parseIntersectionTypeOrHigher, 49); } function isStartOfFunctionType() { if (token() === 27) { @@ -14443,7 +14878,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159, typePredicateVariable.pos); + var node = createNode(160, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -14454,7 +14889,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -14462,14 +14897,25 @@ var ts; function parseType() { return doOutsideOfContext(20480, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161); - } - if (token() === 94) { return parseFunctionOrConstructorType(162); } - return parseUnionTypeOrHigher(); + if (token() === 94) { + return parseFunctionOrConstructorType(163); + } + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) { + var node = createNode(170, type.pos); + node.checkType = type; + node.extendsType = parseTypeWorker(true); + parseExpected(55); + node.trueType = parseTypeWorker(); + parseExpected(56); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56) ? parseType() : undefined; @@ -14582,7 +15028,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198); + var node = createNode(201); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 39 || isStartOfExpression())) { @@ -14598,17 +15044,17 @@ var ts; ts.Debug.assert(token() === 36, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188, asyncModifier.pos); + node = createNode(191, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188, identifier.pos); + node = createNode(191, identifier.pos); } - var parameter = createNode(147, identifier.pos); + var parameter = createNode(148, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36); node.body = parseArrowFunctionExpressionBody(!!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -14625,7 +15071,7 @@ var ts; } var isAsync = ts.hasModifier(arrowFunction, 256); var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36); arrowFunction.body = (lastToken === 36 || lastToken === 17) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -14750,7 +15196,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188); + var node = createNodeWithJSDoc(191); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256) ? 2 : 0; fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node); @@ -14782,12 +15228,14 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(196, leftOperand.pos); + var node = createNode(199, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56, false, ts.Diagnostics._0_expected, ts.tokenToString(56)); - node.whenFalse = parseAssignmentExpressionOrHigher(); + node.colonToken = parseExpectedToken(56); + node.whenFalse = ts.nodeIsPresent(node.colonToken) + ? parseAssignmentExpressionOrHigher() + : createMissingNode(71, false, ts.Diagnostics._0_expected, ts.tokenToString(56)); return finishNode(node); } function parseBinaryExpressionOrHigher(precedence) { @@ -14795,7 +15243,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 || t === 143; + return t === 92 || t === 144; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -14873,39 +15321,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195, left.pos); + var node = createNode(198, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203, left.pos); + var node = createNode(206, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193); + var node = createNode(196); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189); + var node = createNode(192); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190); + var node = createNode(193); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191); + var node = createNode(194); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -14920,7 +15368,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192); + var node = createNode(195); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -14936,7 +15384,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185) { + if (simpleUnaryExpression.kind === 188) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -14989,7 +15437,7 @@ var ts; } function parseUpdateExpression() { if (token() === 43 || token() === 44) { - var node = createNode(193); + var node = createNode(196); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -15001,7 +15449,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 || token() === 44) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194, expression.pos); + var node = createNode(197, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -15029,9 +15477,9 @@ var ts; if (token() === 19 || token() === 23 || token() === 21) { return expression; } - var node = createNode(180, expression.pos); + var node = createNode(183, expression.pos); node.expression = expression; - parseExpectedToken(23, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } @@ -15051,8 +15499,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252) { - var node = createNode(250, opening.pos); + if (opening.kind === 255) { + var node = createNode(253, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -15061,22 +15509,22 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255) { - var node = createNode(254, opening.pos); + else if (opening.kind === 258) { + var node = createNode(257, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251); + ts.Debug.assert(opening.kind === 254); result = opening; } if (inExpressionContext && token() === 27) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195, result.pos); + var badNode = createNode(198, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -15137,7 +15585,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258); + var jsxAttributes = createNode(261); jsxAttributes.properties = parseList(13, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -15146,14 +15594,14 @@ var ts; parseExpected(27); if (token() === 29) { parseExpected(29); - var node_1 = createNode(255, fullStart); + var node_1 = createNode(258, fullStart); return finishNode(node_1); } var tagName = parseJsxElementName(); var attributes = parseJsxAttributes(); var node; if (token() === 29) { - node = createNode(252, fullStart); + node = createNode(255, fullStart); scanJsxText(); } else { @@ -15165,7 +15613,7 @@ var ts; parseExpected(29, undefined, false); scanJsxText(); } - node = createNode(251, fullStart); + node = createNode(254, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -15176,7 +15624,7 @@ var ts; var expression = token() === 99 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23)) { - var propertyAccess = createNode(180, expression.pos); + var propertyAccess = createNode(183, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -15184,7 +15632,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260); + var node = createNode(263); parseExpected(17); if (token() !== 18) { node.dotDotDotToken = parseOptionalToken(24); @@ -15204,7 +15652,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257); + var node = createNode(260); node.name = parseIdentifierName(); if (token() === 58) { switch (scanJsxAttributeValue()) { @@ -15219,7 +15667,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259); + var node = createNode(262); parseExpected(17); parseExpected(24); node.expression = parseExpression(); @@ -15227,7 +15675,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253); + var node = createNode(256); parseExpected(28); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -15240,7 +15688,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256); + var node = createNode(259); parseExpected(28); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -15256,7 +15704,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185); + var node = createNode(188); parseExpected(27); node.type = parseType(); parseExpected(29); @@ -15267,7 +15715,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23); if (dotToken) { - var propertyAccess = createNode(180, expression.pos); + var propertyAccess = createNode(183, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -15275,13 +15723,13 @@ var ts; } if (token() === 51 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204, expression.pos); + var nonNullExpression = createNode(207, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } if (!inDecoratorContext() && parseOptional(21)) { - var indexedAccess = createNode(181, expression.pos); + var indexedAccess = createNode(184, expression.pos); indexedAccess.expression = expression; if (token() !== 22) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -15295,7 +15743,7 @@ var ts; continue; } if (token() === 13 || token() === 14) { - var tagExpression = createNode(184, expression.pos); + var tagExpression = createNode(187, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 ? parseLiteralNode() @@ -15314,7 +15762,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182, expression.pos); + var callExpr = createNode(185, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -15322,7 +15770,7 @@ var ts; continue; } else if (token() === 19) { - var callExpr = createNode(182, expression.pos); + var callExpr = createNode(185, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -15417,28 +15865,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186); + var node = createNodeWithJSDoc(189); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199); + var node = createNode(202); parseExpected(24); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 ? parseSpreadElement() : - token() === 26 ? createNode(201) : + token() === 26 ? createNode(204) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178); + var node = createNode(181); parseExpected(21); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -15450,18 +15898,18 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0); if (parseOptionalToken(24)) { - node.kind = 267; + node.kind = 270; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125)) { - return parseAccessorDeclaration(node, 154); - } - if (parseContextualModifier(135)) { return parseAccessorDeclaration(node, 155); } + if (parseContextualModifier(136)) { + return parseAccessorDeclaration(node, 156); + } var asteriskToken = parseOptionalToken(39); var tokenIsIdentifier = isIdentifier(); node.name = parsePropertyName(); @@ -15471,7 +15919,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 || token() === 18 || token() === 58); if (isShorthandPropertyAssignment) { - node.kind = 266; + node.kind = 269; var equalsToken = parseOptionalToken(58); if (equalsToken) { node.equalsToken = equalsToken; @@ -15479,14 +15927,14 @@ var ts; } } else { - node.kind = 265; + node.kind = 268; parseExpected(56); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179); + var node = createNode(182); parseExpected(17); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -15500,7 +15948,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNodeWithJSDoc(187); + var node = createNodeWithJSDoc(190); node.modifiers = parseModifiers(); parseExpected(89); node.asteriskToken = parseOptionalToken(39); @@ -15525,12 +15973,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94); if (parseOptional(23)) { - var node_2 = createNode(205, fullStart); + var node_2 = createNode(208, fullStart); node_2.keywordToken = 94; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183, fullStart); + var node = createNode(186, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19) { @@ -15539,7 +15987,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208); + var node = createNode(211); if (parseExpected(17, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -15570,12 +16018,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210); + var node = createNode(213); parseExpected(25); return finishNode(node); } function parseIfStatement() { - var node = createNode(212); + var node = createNode(215); parseExpected(90); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -15585,7 +16033,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213); + var node = createNode(216); parseExpected(81); node.statement = parseStatement(); parseExpected(106); @@ -15596,7 +16044,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214); + var node = createNode(217); parseExpected(106); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -15619,8 +16067,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143) : parseOptional(143)) { - var forOfStatement = createNode(217, pos); + if (awaitToken ? parseExpected(144) : parseOptional(144)) { + var forOfStatement = createNode(220, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -15628,14 +16076,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92)) { - var forInStatement = createNode(216, pos); + var forInStatement = createNode(219, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215, pos); + var forStatement = createNode(218, pos); forStatement.initializer = initializer; parseExpected(25); if (token() !== 25 && token() !== 20) { @@ -15653,7 +16101,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 ? 72 : 77); + parseExpected(kind === 222 ? 72 : 77); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -15661,7 +16109,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220); + var node = createNode(223); parseExpected(96); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -15670,7 +16118,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221); + var node = createNode(224); parseExpected(107); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -15679,7 +16127,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261); + var node = createNode(264); parseExpected(73); node.expression = allowInAnd(parseExpression); parseExpected(56); @@ -15687,7 +16135,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262); + var node = createNode(265); parseExpected(79); parseExpected(56); node.statements = parseList(3, parseStatement); @@ -15697,12 +16145,12 @@ var ts; return token() === 73 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222); + var node = createNode(225); parseExpected(98); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); - var caseBlock = createNode(236); + var caseBlock = createNode(239); parseExpected(17); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(18); @@ -15710,14 +16158,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(224); + var node = createNode(227); parseExpected(100); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(225); + var node = createNode(228); parseExpected(102); node.tryBlock = parseBlock(false); node.catchClause = token() === 74 ? parseCatchClause() : undefined; @@ -15728,7 +16176,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264); + var result = createNode(267); parseExpected(74); if (parseOptional(19)) { result.variableDeclaration = parseVariableDeclaration(); @@ -15741,7 +16189,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226); + var node = createNode(229); parseExpected(78); parseSemicolon(); return finishNode(node); @@ -15750,12 +16198,12 @@ var ts; var node = createNodeWithJSDoc(0); var expression = allowInAnd(parseExpression); if (expression.kind === 71 && parseOptional(56)) { - node.kind = 223; + node.kind = 226; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211; + node.kind = 214; node.expression = expression; parseSemicolon(); } @@ -15788,10 +16236,10 @@ var ts; case 83: return true; case 109: - case 138: + case 139: return nextTokenIsIdentifierOnSameLine(); - case 128: case 129: + case 130: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117: case 120: @@ -15799,13 +16247,13 @@ var ts; case 112: case 113: case 114: - case 131: + case 132: nextToken(); if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142: + case 143: nextToken(); return token() === 17 || token() === 71 || token() === 84; case 91: @@ -15864,16 +16312,16 @@ var ts; case 120: case 124: case 109: - case 128: case 129: - case 138: - case 142: + case 130: + case 139: + case 143: return true; case 114: case 112: case 113: case 115: - case 131: + case 132: return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); default: return isStartOfExpression(); @@ -15893,16 +16341,16 @@ var ts; case 17: return parseBlock(false); case 104: - return parseVariableStatement(createNodeWithJSDoc(227)); + return parseVariableStatement(createNodeWithJSDoc(230)); case 110: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227)); + return parseVariableStatement(createNodeWithJSDoc(230)); } break; case 89: - return parseFunctionDeclaration(createNodeWithJSDoc(229)); + return parseFunctionDeclaration(createNodeWithJSDoc(232)); case 75: - return parseClassDeclaration(createNodeWithJSDoc(230)); + return parseClassDeclaration(createNodeWithJSDoc(233)); case 90: return parseIfStatement(); case 81: @@ -15912,9 +16360,9 @@ var ts; case 88: return parseForOrForInOrForOfStatement(); case 77: - return parseBreakOrContinueStatement(218); + return parseBreakOrContinueStatement(221); case 72: - return parseBreakOrContinueStatement(219); + return parseBreakOrContinueStatement(222); case 96: return parseReturnStatement(); case 107: @@ -15933,9 +16381,9 @@ var ts; return parseDeclaration(); case 120: case 109: - case 138: - case 128: + case 139: case 129: + case 130: case 124: case 76: case 83: @@ -15946,8 +16394,8 @@ var ts; case 114: case 117: case 115: - case 131: - case 142: + case 132: + case 143: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -15985,13 +16433,13 @@ var ts; return parseClassDeclaration(node); case 109: return parseInterfaceDeclaration(node); - case 138: + case 139: return parseTypeAliasDeclaration(node); case 83: return parseEnumDeclaration(node); - case 142: - case 128: + case 143: case 129: + case 130: return parseModuleDeclaration(node); case 91: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -16008,7 +16456,7 @@ var ts; } default: if (node.decorators || node.modifiers) { - var missing = createMissingNode(248, true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251, true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -16029,16 +16477,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 26) { - return createNode(201); + return createNode(204); } - var node = createNode(177); + var node = createNode(180); node.dotDotDotToken = parseOptionalToken(24); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177); + var node = createNode(180); node.dotDotDotToken = parseOptionalToken(24); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -16054,14 +16502,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175); + var node = createNode(178); parseExpected(17); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(18); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176); + var node = createNode(179); parseExpected(21); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(22); @@ -16083,7 +16531,7 @@ var ts; return parseVariableDeclaration(true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227); + var node = createNode(230); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 && token() === 51 && !scanner.hasPrecedingLineBreak()) { @@ -16096,7 +16544,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228); + var node = createNode(231); switch (token()) { case 104: break; @@ -16110,7 +16558,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 143 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -16125,13 +16573,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20; } function parseVariableStatement(node) { - node.kind = 209; + node.kind = 212; node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229; + node.kind = 232; parseExpected(89); node.asteriskToken = parseOptionalToken(39); node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier(); @@ -16142,14 +16590,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153; + node.kind = 154; parseExpected(123); fillSignature(56, 0, node); node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152; + node.kind = 153; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 : 0; var isAsync = ts.hasModifier(node, 256) ? 2 : 0; @@ -16158,7 +16606,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150; + node.kind = 151; if (!node.questionToken && token() === 51 && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -16191,7 +16639,7 @@ var ts; case 112: case 113: case 115: - case 131: + case 132: return true; default: return false; @@ -16220,12 +16668,13 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 135 || idToken === 125) { + if (!ts.isKeyword(idToken) || idToken === 136 || idToken === 125) { return true; } switch (token()) { case 19: case 27: + case 51: case 56: case 58: case 55: @@ -16244,7 +16693,7 @@ var ts; if (!parseOptional(57)) { break; } - var decorator = createNode(148, decoratorStart); + var decorator = createNode(149, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -16285,7 +16734,7 @@ var ts; } function parseClassElement() { if (token() === 25) { - var result = createNode(207); + var result = createNode(210); nextToken(); return finishNode(result); } @@ -16293,11 +16742,11 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(true); if (parseContextualModifier(125)) { - return parseAccessorDeclaration(node, 154); - } - if (parseContextualModifier(135)) { return parseAccessorDeclaration(node, 155); } + if (parseContextualModifier(136)) { + return parseAccessorDeclaration(node, 156); + } if (token() === 123) { return parseConstructorDeclaration(node); } @@ -16318,10 +16767,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 200); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 203); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230); + return parseClassDeclarationOrExpression(node, 233); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -16355,7 +16804,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 || tok === 108) { - var node = createNode(263); + var node = createNode(266); node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); @@ -16364,7 +16813,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202); + var node = createNode(205); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -16381,7 +16830,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231; + node.kind = 234; parseExpected(109); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -16390,8 +16839,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232; - parseExpected(138); + node.kind = 235; + parseExpected(139); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58); @@ -16400,13 +16849,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNodeWithJSDoc(268); + var node = createNodeWithJSDoc(271); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233; + node.kind = 236; parseExpected(83); node.name = parseIdentifier(); if (parseExpected(17)) { @@ -16419,7 +16868,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235); + var node = createNode(238); if (parseExpected(17)) { node.statements = parseList(1, parseStatement); parseExpected(18); @@ -16430,7 +16879,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234; + node.kind = 237; var namespaceFlag = flags & 16; node.flags |= flags; node.name = parseIdentifier(); @@ -16440,8 +16889,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234; - if (token() === 142) { + node.kind = 237; + if (token() === 143) { node.name = parseIdentifier(); node.flags |= 512; } @@ -16459,14 +16908,14 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142) { + if (token() === 143) { return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129)) { + else if (parseOptional(130)) { flags |= 16; } else { - parseExpected(128); + parseExpected(129); if (token() === 9) { return parseAmbientExternalModuleDeclaration(node); } @@ -16474,7 +16923,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 && + return token() === 133 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -16484,9 +16933,9 @@ var ts; return nextToken() === 41; } function parseNamespaceExportDeclaration(node) { - node.kind = 237; + node.kind = 240; parseExpected(118); - parseExpected(129); + parseExpected(130); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -16497,23 +16946,23 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 && token() !== 141) { + if (token() !== 26 && token() !== 142) { return parseImportEqualsDeclaration(node, identifier); } } - node.kind = 239; + node.kind = 242; if (identifier || token() === 39 || token() === 17) { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141); + parseExpected(142); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238; + node.kind = 241; node.name = identifier; parseExpected(58); node.moduleReference = parseModuleReference(); @@ -16521,13 +16970,13 @@ var ts; return finishNode(node); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(240, fullStart); + var importClause = createNode(243, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(26)) { - importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(242); + importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(245); } return finishNode(importClause); } @@ -16537,8 +16986,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(249); - parseExpected(132); + var node = createNode(252); + parseExpected(133); parseExpected(19); node.expression = parseModuleSpecifier(); parseExpected(20); @@ -16555,7 +17004,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(241); + var namespaceImport = createNode(244); parseExpected(39); parseExpected(118); namespaceImport.name = parseIdentifier(); @@ -16563,14 +17012,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(22, kind === 242 ? parseImportSpecifier : parseExportSpecifier, 17, 18); + node.elements = parseBracketedList(22, kind === 245 ? parseImportSpecifier : parseExportSpecifier, 17, 18); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247); + return parseImportOrExportSpecifier(250); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243); + return parseImportOrExportSpecifier(246); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -16589,21 +17038,21 @@ var ts; else { node.name = identifierName; } - if (kind === 243 && checkIdentifierIsKeyword) { + if (kind === 246 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245; + node.kind = 248; if (parseOptional(39)) { - parseExpected(141); + parseExpected(142); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246); - if (token() === 141 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { - parseExpected(141); + node.exportClause = parseNamedImportsOrExports(249); + if (token() === 142 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { + parseExpected(142); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -16611,7 +17060,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244; + node.kind = 247; if (parseOptional(58)) { node.isExportEquals = true; } @@ -16703,10 +17152,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1) - || node.kind === 238 && node.moduleReference.kind === 249 - || node.kind === 239 - || node.kind === 244 - || node.kind === 245 + || node.kind === 241 && node.moduleReference.kind === 252 + || node.kind === 242 + || node.kind === 247 + || node.kind === 248 ? node : undefined; }); @@ -16758,7 +17207,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(271, scanner.getTokenPos()); + var result = createNode(274, scanner.getTokenPos()); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17); result.type = doInsideOfContext(1048576, parseType); if (!mayOmitBraces || hasBrace) { @@ -16826,7 +17275,6 @@ var ts; return result; } scanner.scanRange(start + 3, length - 5, function () { - var advanceToken = true; var state = 1; var margin = undefined; var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; @@ -16837,23 +17285,22 @@ var ts; comments.push(text); indent += text.length; } - nextJSDocToken(); - while (token() === 5) { - nextJSDocToken(); + var t = nextJSDocToken(); + while (t === 5) { + t = nextJSDocToken(); } - if (token() === 4) { + if (t === 4) { state = 0; indent = 0; - nextJSDocToken(); + t = nextJSDocToken(); } - while (token() !== 1) { - switch (token()) { + loop: while (true) { + switch (t) { case 57: if (state === 0 || state === 1) { removeTrailingNewlines(comments); parseTag(indent); state = 0; - advanceToken = false; margin = undefined; indent++; } @@ -16892,18 +17339,13 @@ var ts; indent += whitespace.length; break; case 1: - break; + break loop; default: state = 2; pushComment(scanner.getTokenText()); break; } - if (advanceToken) { - nextJSDocToken(); - } - else { - advanceToken = true; - } + t = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); @@ -16927,7 +17369,7 @@ var ts; content.charCodeAt(start + 3) !== 42; } function createJSDocComment() { - var result = createNode(279, start); + var result = createNode(282, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -16987,7 +17429,8 @@ var ts; if (!tag) { return; } - addTag(tag, parseTagComments(indent + tag.end - tag.pos)); + tag.comment = parseTagComments(indent + tag.end - tag.pos); + addTag(tag); } function parseTagComments(indent) { var comments = []; @@ -17000,8 +17443,9 @@ var ts; comments.push(text); indent += text.length; } - while (token() !== 57 && token() !== 1) { - switch (token()) { + var tok = token(); + loop: while (true) { + switch (tok) { case 4: if (state >= 1) { state = 0; @@ -17010,7 +17454,9 @@ var ts; indent = 0; break; case 57: - break; + scanner.setTextPos(scanner.getTextPos() - 1); + case 1: + break loop; case 5: if (state === 2) { pushComment(scanner.getTokenText()); @@ -17026,7 +17472,7 @@ var ts; case 39: if (state === 0) { state = 1; - indent += scanner.getTokenText().length; + indent += 1; break; } default: @@ -17034,23 +17480,19 @@ var ts; pushComment(scanner.getTokenText()); break; } - if (token() === 57) { - break; - } - nextJSDocToken(); + tok = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); - return comments; + return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(atToken, tagName) { - var result = createNode(281, atToken.pos); + var result = createNode(284, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); } - function addTag(tag, comments) { - tag.comment = comments.join(""); + function addTag(tag) { if (!tags) { tags = [tag]; tagsPos = tag.pos; @@ -17078,9 +17520,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 134: + case 135: return true; - case 165: + case 166: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object"; @@ -17096,8 +17538,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 ? - createNode(284, atToken.pos) : - createNode(289, atToken.pos); + createNode(287, atToken.pos) : + createNode(292, atToken.pos); var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name); if (nestedTypeLiteral) { typeExpression = nestedTypeLiteral; @@ -17113,21 +17555,18 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(271, scanner.getTokenPos()); + var typeLiteralExpression = createNode(274, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_2 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(1, name); })) { - if (!children) { - children = []; - } - children.push(child); + children = ts.append(children, child); } if (children) { - jsdocTypeLiteral = createNode(280, start_2); + jsdocTypeLiteral = createNode(283, start_2); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 165) { + if (typeExpression.type.kind === 166) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -17136,27 +17575,27 @@ var ts; } } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 285; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(285, atToken.pos); + var result = createNode(288, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 286; })) { + if (ts.forEach(tags, function (t) { return t.kind === 289; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(286, atToken.pos); + var result = createNode(289, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(true); return finishNode(result); } function parseAugmentsTag(atToken, tagName) { - var result = createNode(282, atToken.pos); + var result = createNode(285, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); @@ -17164,7 +17603,7 @@ var ts; } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(17); - var node = createNode(202); + var node = createNode(205); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -17176,7 +17615,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(true); while (parseOptional(23)) { - var prop = createNode(180, node.pos); + var prop = createNode(183, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -17184,7 +17623,7 @@ var ts; return node; } function parseClassTag(atToken, tagName) { - var tag = createNode(283, atToken.pos); + var tag = createNode(286, atToken.pos); tag.atToken = atToken; tag.tagName = tagName; return finishNode(tag); @@ -17192,7 +17631,7 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(288, atToken.pos); + var typedefTag = createNode(291, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(0); @@ -17215,9 +17654,9 @@ var ts; var start_3 = scanner.getStartPos(); while (child = tryParse(function () { return parseChildParameterOrPropertyTag(0); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(280, start_3); + jsdocTypeLiteral = createNode(283, start_3); } - if (child.kind === 286) { + if (child.kind === 289) { if (childTypeTag) { break; } @@ -17226,14 +17665,11 @@ var ts; } } else { - if (!jsdocTypeLiteral.jsDocPropertyTags) { - jsdocTypeLiteral.jsDocPropertyTags = []; - } - jsdocTypeLiteral.jsDocPropertyTags.push(child); + jsdocTypeLiteral.jsDocPropertyTags = ts.append(jsdocTypeLiteral.jsDocPropertyTags, child); } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 165) { + if (typeExpression && typeExpression.type.kind === 166) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -17246,7 +17682,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(23)) { - var jsDocNamespaceNode = createNode(234, pos); + var jsDocNamespaceNode = createNode(237, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4); @@ -17274,12 +17710,11 @@ var ts; var canParseTag = true; var seenAsterisk = false; while (true) { - nextJSDocToken(); - switch (token()) { + switch (nextJSDocToken()) { case 57: if (canParseTag) { var child = tryParseChildTag(target); - if (child && child.kind === 284 && + if (child && child.kind === 287 && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } @@ -17315,33 +17750,43 @@ var ts; if (!tagName) { return false; } + var t; switch (tagName.escapedText) { case "type": return target === 0 && parseTypeTag(atToken, tagName); case "prop": case "property": - return target === 0 && parseParameterOrPropertyTag(atToken, tagName, target); + t = 0; + break; case "arg": case "argument": case "param": - return target === 1 && parseParameterOrPropertyTag(atToken, tagName, target); + t = 1; + break; + default: + return false; } - return false; + if (target !== t) { + return false; + } + var tag = parseParameterOrPropertyTag(atToken, tagName, target); + tag.comment = parseTagComments(tag.end - tag.pos); + return tag; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 287; })) { + if (ts.some(tags, ts.isJSDocTemplateTag)) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } var typeParameters = []; var typeParametersPos = getNodePos(); while (true) { - var name = parseJSDocIdentifierName(); + var typeParameter = createNode(147); + var name = parseJSDocIdentifierNameWithOptionalBraces(); skipWhitespace(); if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(146, name.pos); typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); @@ -17353,13 +17798,21 @@ var ts; break; } } - var result = createNode(287, atToken.pos); + var result = createNode(290, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); finishNode(result); return result; } + function parseJSDocIdentifierNameWithOptionalBraces() { + var parsedBrace = parseOptional(17); + var res = parseJSDocIdentifierName(); + if (parsedBrace) { + parseExpected(18); + } + return res; + } function nextJSDocToken() { return currentToken = scanner.scanJSDocToken(); } @@ -17706,21 +18159,21 @@ var ts; ts.getModuleInstanceState = getModuleInstanceState; function getModuleInstanceStateWorker(node) { switch (node.kind) { - case 231: - case 232: + case 234: + case 235: return 0; - case 233: + case 236: if (ts.isConst(node)) { return 2; } break; - case 239: - case 238: + case 242: + case 241: if (!(ts.hasModifier(node, 1))) { return 0; } break; - case 235: { + case 238: { var state_1 = 0; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -17739,7 +18192,7 @@ var ts; }); return state_1; } - case 234: + case 237: return getModuleInstanceState(node); case 71: if (node.isInJSDocNamespace) { @@ -17759,6 +18212,7 @@ var ts; ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals"; ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; + ContainerFlags[ContainerFlags["IsInferenceContainer"] = 256] = "IsInferenceContainer"; })(ContainerFlags || (ContainerFlags = {})); var binder = createBinder(); function bindSourceFile(file, options) { @@ -17775,6 +18229,7 @@ var ts; var parent; var container; var blockScopeContainer; + var inferenceContainer; var lastContainer; var seenThisKeyword; var currentFlow; @@ -17818,6 +18273,7 @@ var ts; parent = undefined; container = undefined; blockScopeContainer = undefined; + inferenceContainer = undefined; lastContainer = undefined; seenThisKeyword = false; currentFlow = undefined; @@ -17862,13 +18318,13 @@ var ts; if (symbolFlags & 107455) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 234)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 237)) { symbol.valueDeclaration = node; } } } function getDeclarationName(node) { - if (node.kind === 244) { + if (node.kind === 247) { return node.isExportEquals ? "export=" : "default"; } var name = ts.getNameOfDeclaration(node); @@ -17877,7 +18333,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 145) { + if (name.kind === 146) { var nameExpression = name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return ts.escapeLeadingUnderscores(nameExpression.text); @@ -17888,35 +18344,35 @@ var ts; return ts.getEscapedTextOfIdentifierOrLiteral(name); } switch (node.kind) { - case 153: + case 154: return "__constructor"; - case 161: - case 156: - return "__call"; case 162: case 157: - return "__new"; + return "__call"; + case 163: case 158: + return "__new"; + case 159: return "__index"; - case 245: + case 248: return "__export"; - case 195: + case 198: if (ts.getSpecialPropertyAssignmentKind(node) === 2) { return "export="; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 229: - case 230: + case 232: + case 233: return (ts.hasModifier(node, 512) ? "default" : undefined); - case 277: + case 280: return (ts.isJSDocConstructSignature(node) ? "__new" : "__call"); - case 147: - ts.Debug.assert(node.parent.kind === 277); + case 148: + ts.Debug.assert(node.parent.kind === 280); var functionType = node.parent; - var index = ts.indexOf(functionType.parameters, node); + var index = functionType.parameters.indexOf(node); return "arg" + index; - case 288: + case 291: var name_2 = ts.getNameOfJSDocTypedef(node); return typeof name_2 !== "undefined" ? name_2.escapedText : undefined; } @@ -17956,13 +18412,16 @@ var ts; var message_1 = symbol.flags & 2 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + if (symbol.flags & 384 || includes & 384) { + message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } if (symbol.declarations && symbol.declarations.length) { if (isDefaultExport) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } else { if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 244 && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 247 && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -17982,7 +18441,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1; if (symbolFlags & 2097152) { - if (node.kind === 247 || (node.kind === 238 && hasExportModifier)) { + if (node.kind === 250 || (node.kind === 241 && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -17990,12 +18449,9 @@ var ts; } } else { - if (node.kind === 288) + if (node.kind === 291) ts.Debug.assert(ts.isInJavaScriptFile(node)); - var isJSDocTypedefInJSDocNamespace = node.kind === 288 && - node.name && - node.name.kind === 71 && - node.name.isInJSDocNamespace; + var isJSDocTypedefInJSDocNamespace = ts.isJSDocTypedefTag(node) && node.name && node.name.kind === 71 && node.name.isInJSDocNamespace; if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 32)) || isJSDocTypedefInJSDocNamespace) { var exportKind = symbolFlags & 107455 ? 1048576 : 0; var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); @@ -18036,7 +18492,7 @@ var ts; currentFlow.container = node; } } - currentReturnTarget = isIIFE || node.kind === 153 ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 154 ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -18048,13 +18504,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256; } - if (node.kind === 269) { + if (node.kind === 272) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 153) { + if (node.kind === 154) { node.returnFlowNode = currentFlow; } } @@ -18072,6 +18528,13 @@ var ts; bindChildren(node); node.flags = seenThisKeyword ? node.flags | 64 : node.flags & ~64; } + else if (containerFlags & 256) { + var saveInferenceContainer = inferenceContainer; + inferenceContainer = node; + node.locals = undefined; + bindChildren(node); + inferenceContainer = saveInferenceContainer; + } else { bindChildren(node); } @@ -18138,70 +18601,70 @@ var ts; return; } switch (node.kind) { - case 214: + case 217: bindWhileStatement(node); break; - case 213: + case 216: bindDoStatement(node); break; - case 215: + case 218: bindForStatement(node); break; - case 216: - case 217: + case 219: + case 220: bindForInOrForOfStatement(node); break; - case 212: + case 215: bindIfStatement(node); break; - case 220: - case 224: + case 223: + case 227: bindReturnOrThrow(node); break; - case 219: - case 218: + case 222: + case 221: bindBreakOrContinueStatement(node); break; - case 225: + case 228: bindTryStatement(node); break; - case 222: + case 225: bindSwitchStatement(node); break; - case 236: + case 239: bindCaseBlock(node); break; - case 261: + case 264: bindCaseClause(node); break; - case 223: + case 226: bindLabeledStatement(node); break; - case 193: + case 196: bindPrefixUnaryExpressionFlow(node); break; - case 194: + case 197: bindPostfixUnaryExpressionFlow(node); break; - case 195: + case 198: bindBinaryExpressionFlow(node); break; - case 189: + case 192: bindDeleteExpressionFlow(node); break; - case 196: + case 199: bindConditionalExpressionFlow(node); break; - case 227: + case 230: bindVariableDeclarationFlow(node); break; - case 182: + case 185: bindCallExpressionFlow(node); break; - case 279: + case 282: bindJSDocComment(node); break; - case 288: + case 291: bindJSDocTypedefTag(node); break; default: @@ -18213,15 +18676,15 @@ var ts; switch (expr.kind) { case 71: case 99: - case 180: + case 183: return isNarrowableReference(expr); - case 182: + case 185: return hasNarrowableArgument(expr); - case 186: + case 189: return isNarrowingExpression(expr.expression); - case 195: + case 198: return isNarrowingBinaryExpression(expr); - case 193: + case 196: return expr.operator === 51 && isNarrowingExpression(expr.operand); } return false; @@ -18230,7 +18693,7 @@ var ts; return expr.kind === 71 || expr.kind === 99 || expr.kind === 97 || - expr.kind === 180 && isNarrowableReference(expr.expression); + expr.kind === 183 && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -18241,14 +18704,17 @@ var ts; } } } - if (expr.expression.kind === 180 && + if (expr.expression.kind === 183 && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 190 && isNarrowableOperand(expr1.expression) && expr2.kind === 9; + return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2); + } + function isNarrowableInOperands(left, right) { + return ts.isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -18262,6 +18728,8 @@ var ts; isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); case 93: return isNarrowableOperand(expr.left); + case 92: + return isNarrowableInOperands(expr.left, expr.right); case 26: return isNarrowingExpression(expr.right); } @@ -18269,9 +18737,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 186: + case 189: return isNarrowableOperand(expr.expression); - case 195: + case 198: switch (expr.operatorToken.kind) { case 58: return isNarrowableOperand(expr.left); @@ -18348,33 +18816,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 212: - case 214: - case 213: - return parent.expression === node; case 215: - case 196: + case 217: + case 216: + return parent.expression === node; + case 218: + case 199: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 186) { + if (node.kind === 189) { node = node.expression; } - else if (node.kind === 193 && node.operator === 51) { + else if (node.kind === 196 && node.operator === 51) { node = node.operand; } else { - return node.kind === 195 && (node.operatorToken.kind === 53 || + return node.kind === 198 && (node.operatorToken.kind === 53 || node.operatorToken.kind === 54); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 186 || - node.parent.kind === 193 && + while (node.parent.kind === 189 || + node.parent.kind === 196 && node.parent.operator === 51) { node = node.parent; } @@ -18416,7 +18884,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 223 + var enclosingLabeledStatement = node.parent.kind === 226 ? ts.lastOrUndefined(activeLabels) : undefined; var preConditionLabel = enclosingLabeledStatement ? enclosingLabeledStatement.continueTarget : createBranchLabel(); @@ -18448,13 +18916,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 217) { + if (node.kind === 220) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 228) { + if (node.initializer.kind !== 231) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -18476,7 +18944,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 220) { + if (node.kind === 223) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -18496,7 +18964,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 219 ? breakTarget : continueTarget; + var flowLabel = node.kind === 222 ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -18559,7 +19027,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 262; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 265; }); node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; if (!hasDefault) { addAntecedent(postSwitchLabel, createFlowSwitchClause(preSwitchCaseFlow, node, 0, 0)); @@ -18624,13 +19092,13 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 213) { + if (!node.statement || node.statement.kind !== 216) { addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 195 && node.operatorToken.kind === 58) { + if (node.kind === 198 && node.operatorToken.kind === 58) { bindAssignmentTargetFlow(node.left); } else { @@ -18641,10 +19109,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 178) { + else if (node.kind === 181) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 199) { + if (e.kind === 202) { bindAssignmentTargetFlow(e.expression); } else { @@ -18652,16 +19120,16 @@ var ts; } } } - else if (node.kind === 179) { + else if (node.kind === 182) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 265) { + if (p.kind === 268) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 266) { + else if (p.kind === 269) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 267) { + else if (p.kind === 270) { bindAssignmentTargetFlow(p.expression); } } @@ -18717,7 +19185,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 58 && node.left.kind === 181) { + if (operator === 58 && node.left.kind === 184) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -18728,7 +19196,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 180) { + if (node.expression.kind === 183) { bindAssignmentTargetFlow(node.expression); } } @@ -18767,7 +19235,7 @@ var ts; } function bindJSDocComment(node) { ts.forEachChild(node, function (n) { - if (n.kind !== 288) { + if (n.kind !== 291) { bind(n); } }); @@ -18782,10 +19250,10 @@ var ts; } function bindCallExpressionFlow(node) { var expr = node.expression; - while (expr.kind === 186) { + while (expr.kind === 189) { expr = expr.expression; } - if (expr.kind === 187 || expr.kind === 188) { + if (expr.kind === 190 || expr.kind === 191) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -18793,7 +19261,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 180) { + if (node.expression.kind === 183) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -18802,52 +19270,54 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 200: - case 230: + case 203: case 233: - case 179: - case 164: - case 280: - case 258: + case 236: + case 182: + case 165: + case 283: + case 261: return 1; - case 231: - return 1 | 64; case 234: - case 232: - case 173: + return 1 | 64; + case 237: + case 235: + case 176: return 1 | 32; - case 269: + case 170: + return 256; + case 272: return 1 | 4 | 32; - case 152: + case 153: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 | 4 | 32 | 8 | 128; } - case 153: - case 229: - case 151: case 154: + case 232: + case 152: case 155: case 156: - case 277: - case 161: case 157: - case 158: + case 280: case 162: + case 158: + case 159: + case 163: return 1 | 4 | 32 | 8; - case 187: - case 188: + case 190: + case 191: return 1 | 4 | 32 | 8 | 16; - case 235: + case 238: return 4; - case 150: + case 151: return node.initializer ? 4 : 0; - case 264: - case 215: - case 216: - case 217: - case 236: + case 267: + case 218: + case 219: + case 220: + case 239: return 2; - case 208: + case 211: return ts.isFunctionLike(node.parent) ? 0 : 2; } return 0; @@ -18860,37 +19330,37 @@ var ts; } function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { switch (container.kind) { - case 234: + case 237: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 269: + case 272: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 200: - case 230: - return declareClassMember(node, symbolFlags, symbolExcludes); + case 203: case 233: + return declareClassMember(node, symbolFlags, symbolExcludes); + case 236: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 164: - case 280: - case 179: - case 231: - case 258: + case 165: + case 283: + case 182: + case 234: + case 261: return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 161: case 162: - case 156: + case 163: case 157: case 158: - case 152: - case 151: + case 159: case 153: + case 152: case 154: case 155: - case 229: - case 187: - case 188: - case 277: + case 156: case 232: - case 173: + case 190: + case 191: + case 280: + case 235: + case 176: return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); } } @@ -18905,11 +19375,11 @@ var ts; : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 269 ? node : node.body; - if (body && (body.kind === 269 || body.kind === 235)) { + var body = node.kind === 272 ? node : node.body; + if (body && (body.kind === 272 || body.kind === 238)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 245 || stat.kind === 244) { + if (stat.kind === 248 || stat.kind === 247) { return true; } } @@ -18984,11 +19454,11 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 || prop.name.kind !== 71) { + if (prop.kind === 270 || prop.name.kind !== 71) { continue; } var identifier = prop.name; - var currentKind = prop.kind === 265 || prop.kind === 266 || prop.kind === 152 + var currentKind = prop.kind === 268 || prop.kind === 269 || prop.kind === 153 ? 1 : 2; var existingKind = seen.get(identifier.escapedText); @@ -19019,10 +19489,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 234: + case 237: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 269: + case 272: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -19111,8 +19581,8 @@ var ts; } function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2) { - if (blockScopeContainer.kind !== 269 && - blockScopeContainer.kind !== 234 && + if (blockScopeContainer.kind !== 272 && + blockScopeContainer.kind !== 237 && !ts.isFunctionLike(blockScopeContainer)) { var errorSpan = ts.getErrorSpanForNode(file, node); file.bindDiagnostics.push(ts.createFileDiagnostic(file, errorSpan.start, errorSpan.length, getStrictModeBlockScopeFunctionDeclarationMessage(node))); @@ -19154,7 +19624,7 @@ var ts; if (ts.isInJavaScriptFile(node)) bindJSDocTypedefTagIfAny(node); bindWorker(node); - if (node.kind > 143) { + if (node.kind > 144) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -19182,7 +19652,7 @@ var ts; } for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { var tag = _c[_b]; - if (tag.kind === 288) { + if (tag.kind === 291) { var savedParent = parent; parent = jsDoc; bind(tag); @@ -19214,18 +19684,18 @@ var ts; case 71: if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 288) { + while (parentNode && parentNode.kind !== 291) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288, 793064); break; } case 99: - if (currentFlow && (ts.isExpression(node) || parent.kind === 266)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 269)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 180: + case 183: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -19233,7 +19703,7 @@ var ts; bindSpecialPropertyDeclaration(node); } break; - case 195: + case 198: var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { case 1: @@ -19257,122 +19727,122 @@ var ts; ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 264: + case 267: return checkStrictModeCatchClause(node); - case 189: + case 192: return checkStrictModeDeleteExpression(node); case 8: return checkStrictModeNumericLiteral(node); - case 194: + case 197: return checkStrictModePostfixUnaryExpression(node); - case 193: + case 196: return checkStrictModePrefixUnaryExpression(node); - case 221: + case 224: return checkStrictModeWithStatement(node); - case 170: + case 173: seenThisKeyword = true; return; - case 159: + case 160: return checkTypePredicate(node); - case 146: - return declareSymbolAndAddToSymbolTable(node, 262144, 530920); case 147: + return bindTypeParameter(node); + case 148: return bindParameter(node); - case 227: + case 230: return bindVariableDeclarationOrBindingElement(node); - case 177: + case 180: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); + case 151: case 150: - case 149: return bindPropertyWorker(node); - case 265: - case 266: - return bindPropertyOrMethodOrAccessor(node, 4, 0); case 268: + case 269: + return bindPropertyOrMethodOrAccessor(node, 4, 0); + case 271: return bindPropertyOrMethodOrAccessor(node, 8, 900095); - case 156: case 157: case 158: + case 159: return declareSymbolAndAddToSymbolTable(node, 131072, 0); - case 152: - case 151: - return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); - case 229: - return bindFunctionDeclaration(node); case 153: - return declareSymbolAndAddToSymbolTable(node, 16384, 0); + case 152: + return bindPropertyOrMethodOrAccessor(node, 8192 | (node.questionToken ? 16777216 : 0), ts.isObjectLiteralMethod(node) ? 0 : 99263); + case 232: + return bindFunctionDeclaration(node); case 154: - return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + return declareSymbolAndAddToSymbolTable(node, 16384, 0); case 155: + return bindPropertyOrMethodOrAccessor(node, 32768, 41919); + case 156: return bindPropertyOrMethodOrAccessor(node, 65536, 74687); - case 161: - case 277: case 162: - return bindFunctionOrConstructorType(node); - case 164: case 280: - case 173: + case 163: + return bindFunctionOrConstructorType(node); + case 165: + case 283: + case 176: return bindAnonymousTypeWorker(node); - case 179: - return bindObjectLiteralExpression(node); - case 187: - case 188: - return bindFunctionExpression(node); case 182: + return bindObjectLiteralExpression(node); + case 190: + case 191: + return bindFunctionExpression(node); + case 185: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; - case 200: - case 230: + case 203: + case 233: inStrictMode = true; return bindClassLikeDeclaration(node); - case 231: - return bindBlockScopedDeclaration(node, 64, 792968); - case 232: - return bindBlockScopedDeclaration(node, 524288, 793064); - case 233: - return bindEnumDeclaration(node); case 234: - return bindModuleDeclaration(node); - case 258: - return bindJsxAttributes(node); - case 257: - return bindJsxAttribute(node, 4, 0); - case 238: - case 241: - case 243: - case 247: - return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); + return bindBlockScopedDeclaration(node, 64, 792968); + case 235: + return bindBlockScopedDeclaration(node, 524288, 793064); + case 236: + return bindEnumDeclaration(node); case 237: - return bindNamespaceExportDeclaration(node); - case 240: - return bindImportClause(node); - case 245: - return bindExportDeclaration(node); + return bindModuleDeclaration(node); + case 261: + return bindJsxAttributes(node); + case 260: + return bindJsxAttribute(node, 4, 0); + case 241: case 244: + case 246: + case 250: + return declareSymbolAndAddToSymbolTable(node, 2097152, 2097152); + case 240: + return bindNamespaceExportDeclaration(node); + case 243: + return bindImportClause(node); + case 248: + return bindExportDeclaration(node); + case 247: return bindExportAssignment(node); - case 269: + case 272: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 208: + case 211: if (!ts.isFunctionLike(node.parent)) { return; } - case 235: + case 238: return updateStrictModeStatementList(node.statements); - case 284: - if (node.parent.kind !== 280) { + case 287: + if (node.parent.kind !== 283) { break; } - case 289: + case 292: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 276 ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 279 ? 4 | 16777216 : 4; return declareSymbolAndAddToSymbolTable(propTag, flags, 0); - case 288: { + case 291: { var fullName = node.fullName; if (!fullName || fullName.kind === 71) { return bindBlockScopedDeclaration(node, 524288, 793064); @@ -19392,7 +19862,7 @@ var ts; if (parameterName && parameterName.kind === 71) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 170) { + if (parameterName && parameterName.kind === 173) { seenThisKeyword = true; } bind(type); @@ -19411,7 +19881,7 @@ var ts; bindAnonymousDeclaration(node, 2097152, getDeclarationName(node)); } else { - var flags = node.kind === 244 && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 247 && ts.exportAssignmentIsAlias(node) ? 2097152 : 4; declareSymbol(container.symbol.exports, container.symbol, node, flags, 67108863); @@ -19421,7 +19891,7 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 269) { + if (node.parent.kind !== 272) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } @@ -19464,23 +19934,9 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 | 1048576, 0); } - function isExportsOrModuleExportsOrAlias(node) { - return ts.isExportsIdentifier(node) || - ts.isModuleExportsPropertyAccessExpression(node) || - ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(node); - } - function isNameOfExportsOrModuleExportsAliasDeclaration(node) { - var symbol = lookupSymbolForName(node.escapedText); - return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && - symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer); - } - function isExportsOrModuleExportsOrAliasOrAssignment(node) { - return isExportsOrModuleExportsOrAlias(node) || - (ts.isAssignmentExpression(node, true) && (isExportsOrModuleExportsOrAliasOrAssignment(node.left) || isExportsOrModuleExportsOrAliasOrAssignment(node.right))); - } function bindModuleExportsAssignment(node) { var assignedExpression = ts.getRightMostAssignedExpression(node.right); - if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { setCommonJsModuleIndicator(node); return; } @@ -19491,16 +19947,16 @@ var ts; ts.Debug.assert(ts.isInJavaScriptFile(node)); var container = ts.getThisContainer(node, false); switch (container.kind) { - case 229: - case 187: + case 232: + case 190: container.symbol.members = container.symbol.members || ts.createSymbolTable(); declareSymbol(container.symbol.members, container.symbol, node, 4, 0 & ~4); break; - case 153: - case 150: - case 152: case 154: + case 151: + case 153: case 155: + case 156: var containingClass = container.parent; var symbolTable = ts.hasModifier(container, 32) ? containingClass.symbol.exports : containingClass.symbol.members; declareSymbol(symbolTable, containingClass.symbol, node, 4, 0, true); @@ -19512,8 +19968,8 @@ var ts; if (node.expression.kind === 99) { bindThisPropertyAssignment(node); } - else if ((node.expression.kind === 71 || node.expression.kind === 180) && - node.parent.parent.kind === 269) { + else if ((node.expression.kind === 71 || node.expression.kind === 183) && + node.parent.parent.kind === 272) { bindStaticPropertyAssignment(node); } } @@ -19527,14 +19983,14 @@ var ts; bindPropertyAssignment(constructorFunction.escapedText, leftSideOfAssignment, true); } function bindStaticPropertyAssignment(node) { - var leftSideOfAssignment = node.kind === 180 ? node : node.left; + var leftSideOfAssignment = node.kind === 183 ? node : node.left; var target = leftSideOfAssignment.expression; if (ts.isIdentifier(target)) { target.parent = leftSideOfAssignment; - if (node.kind === 195) { + if (node.kind === 198) { leftSideOfAssignment.parent = node; } - if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + if (container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, target)) { bindExportsPropertyAssignment(node); } else { @@ -19543,26 +19999,22 @@ var ts; } } function lookupSymbolForName(name) { - var local = container.locals && container.locals.get(name); - if (local) { - return local.exportSymbol || local; - } - return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + return lookupSymbolForNameWorker(container, name); } function bindPropertyAssignment(functionName, propertyAccess, isPrototypeProperty) { var symbol = lookupSymbolForName(functionName); var targetSymbol = symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol) ? symbol.valueDeclaration.initializer.symbol : symbol; - ts.Debug.assert(propertyAccess.parent.kind === 195 || propertyAccess.parent.kind === 211); + ts.Debug.assert(propertyAccess.parent.kind === 198 || propertyAccess.parent.kind === 214); var isLegalPosition; - if (propertyAccess.parent.kind === 195) { + if (propertyAccess.parent.kind === 198) { var initializerKind = propertyAccess.parent.right.kind; - isLegalPosition = (initializerKind === 200 || initializerKind === 187) && - propertyAccess.parent.parent.parent.kind === 269; + isLegalPosition = (initializerKind === 203 || initializerKind === 190) && + propertyAccess.parent.parent.parent.kind === 272; } else { - isLegalPosition = propertyAccess.parent.parent.kind === 269; + isLegalPosition = propertyAccess.parent.parent.kind === 272; } if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & 1920)) && isLegalPosition) { ts.Debug.assert(ts.isIdentifier(propertyAccess.expression)); @@ -19590,7 +20042,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 230) { + if (node.kind === 233) { bindBlockScopedDeclaration(node, 32, 899519); } else { @@ -19638,7 +20090,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1, "__" + ts.indexOf(node.parent.parameters, node)); + bindAnonymousDeclaration(node, 1, "__" + node.parent.parameters.indexOf(node)); } else { declareSymbolAndAddToSymbolTable(node, 1, 107455); @@ -19687,6 +20139,22 @@ var ts; ? bindAnonymousDeclaration(node, symbolFlags, "__computed") : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + function bindTypeParameter(node) { + if (node.parent.kind === 171) { + if (inferenceContainer) { + if (!inferenceContainer.locals) { + inferenceContainer.locals = ts.createSymbolTable(); + } + declareSymbol(inferenceContainer.locals, undefined, node, 262144, 530920); + } + else { + bindAnonymousDeclaration(node, 262144, getDeclarationName(node)); + } + } + else { + declareSymbolAndAddToSymbolTable(node, 262144, 530920); + } + } function shouldReportErrorOnModuleDeclaration(node) { var instanceState = getModuleInstanceState(node); return instanceState === 1 || (instanceState === 2 && options.preserveConstEnums); @@ -19696,15 +20164,15 @@ var ts; return false; } if (currentFlow === unreachableFlow) { - var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 210) || - node.kind === 230 || - (node.kind === 234 && shouldReportErrorOnModuleDeclaration(node)) || - (node.kind === 233 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + var reportError = (ts.isStatementButNotDeclaration(node) && node.kind !== 213) || + node.kind === 233 || + (node.kind === 237 && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 236 && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; var reportUnreachableCode = !options.allowUnreachableCode && !(node.flags & 2097152) && - (node.kind !== 209 || + (node.kind !== 212 || ts.getCombinedNodeFlags(node.declarationList) & 3 || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -19715,60 +20183,84 @@ var ts; return true; } } + function isExportsOrModuleExportsOrAlias(sourceFile, node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node); + } + ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; + function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) { + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); + return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && + symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer); + } + function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { + return isExportsOrModuleExportsOrAlias(sourceFile, node) || + (ts.isAssignmentExpression(node, true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); + } + function lookupSymbolForNameWorker(container, name) { + var local = container.locals && container.locals.get(name); + if (local) { + return local.exportSymbol || local; + } + return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + } function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 182: + case 185: return computeCallExpression(node, subtreeFlags); - case 183: - return computeNewExpression(node, subtreeFlags); - case 234: - return computeModuleDeclaration(node, subtreeFlags); case 186: + return computeNewExpression(node, subtreeFlags); + case 237: + return computeModuleDeclaration(node, subtreeFlags); + case 189: return computeParenthesizedExpression(node, subtreeFlags); - case 195: + case 198: return computeBinaryExpression(node, subtreeFlags); - case 211: + case 214: return computeExpressionStatement(node, subtreeFlags); - case 147: + case 148: return computeParameter(node, subtreeFlags); - case 188: + case 191: return computeArrowFunction(node, subtreeFlags); - case 187: + case 190: return computeFunctionExpression(node, subtreeFlags); - case 229: + case 232: return computeFunctionDeclaration(node, subtreeFlags); - case 227: - return computeVariableDeclaration(node, subtreeFlags); - case 228: - return computeVariableDeclarationList(node, subtreeFlags); - case 209: - return computeVariableStatement(node, subtreeFlags); - case 223: - return computeLabeledStatement(node, subtreeFlags); case 230: + return computeVariableDeclaration(node, subtreeFlags); + case 231: + return computeVariableDeclarationList(node, subtreeFlags); + case 212: + return computeVariableStatement(node, subtreeFlags); + case 226: + return computeLabeledStatement(node, subtreeFlags); + case 233: return computeClassDeclaration(node, subtreeFlags); - case 200: + case 203: return computeClassExpression(node, subtreeFlags); - case 263: + case 266: return computeHeritageClause(node, subtreeFlags); - case 264: + case 267: return computeCatchClause(node, subtreeFlags); - case 202: + case 205: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 153: - return computeConstructor(node, subtreeFlags); - case 150: - return computePropertyDeclaration(node, subtreeFlags); - case 152: - return computeMethod(node, subtreeFlags); case 154: + return computeConstructor(node, subtreeFlags); + case 151: + return computePropertyDeclaration(node, subtreeFlags); + case 153: + return computeMethod(node, subtreeFlags); case 155: + case 156: return computeAccessor(node, subtreeFlags); - case 238: + case 241: return computeImportEquals(node, subtreeFlags); - case 180: + case 183: return computePropertyAccess(node, subtreeFlags); + case 184: + return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); } @@ -19777,13 +20269,15 @@ var ts; function computeCallExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var expression = node.expression; - var expressionKind = expression.kind; if (node.typeArguments) { transformFlags |= 3; } if (subtreeFlags & 524288 - || isSuperOrSuperProperty(expression, expressionKind)) { + || (expression.transformFlags & (134217728 | 268435456))) { transformFlags |= 192; + if (expression.transformFlags & 268435456) { + transformFlags |= 16384; + } } if (expression.kind === 91) { transformFlags |= 67108864; @@ -19792,19 +20286,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~537396545; - } - function isSuperOrSuperProperty(node, kind) { - switch (kind) { - case 97: - return true; - case 180: - case 181: - var expression = node.expression; - var expressionKind = expression.kind; - return expressionKind === 97; - } - return false; + return transformFlags & ~940049729; } function computeNewExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -19815,16 +20297,16 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~537396545; + return transformFlags & ~940049729; } function computeBinaryExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 58 && leftKind === 179) { + if (operatorTokenKind === 58 && leftKind === 182) { transformFlags |= 8 | 192 | 3072; } - else if (operatorTokenKind === 58 && leftKind === 178) { + else if (operatorTokenKind === 58 && leftKind === 181) { transformFlags |= 192 | 3072; } else if (operatorTokenKind === 40 @@ -19832,7 +20314,7 @@ var ts; transformFlags |= 32; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -19855,15 +20337,15 @@ var ts; transformFlags |= 192 | 131072; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeParenthesizedExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var expression = node.expression; var expressionKind = expression.kind; var expressionTransformFlags = expression.transformFlags; - if (expressionKind === 203 - || expressionKind === 185) { + if (expressionKind === 206 + || expressionKind === 188) { transformFlags |= 3; } if (expressionTransformFlags & 1024) { @@ -19888,7 +20370,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~539358529; + return transformFlags & ~942011713; } function computeClassExpression(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -19900,7 +20382,7 @@ var ts; transformFlags |= 16384; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~539358529; + return transformFlags & ~942011713; } function computeHeritageClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -19916,7 +20398,7 @@ var ts; break; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -19927,7 +20409,7 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~537920833; + return transformFlags & ~940574017; } function computeExpressionWithTypeArguments(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -19935,7 +20417,7 @@ var ts; transformFlags |= 3; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeConstructor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -19947,7 +20429,7 @@ var ts; transformFlags |= 8; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601015617; + return transformFlags & ~1003668801; } function computeMethod(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -19969,7 +20451,7 @@ var ts; transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601015617; + return transformFlags & ~1003668801; } function computeAccessor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -19984,7 +20466,7 @@ var ts; transformFlags |= 8; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601015617; + return transformFlags & ~1003668801; } function computePropertyDeclaration(node, subtreeFlags) { var transformFlags = subtreeFlags | 3; @@ -19992,7 +20474,7 @@ var ts; transformFlags |= 8192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeFunctionDeclaration(node, subtreeFlags) { var transformFlags; @@ -20022,7 +20504,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601281857; + return transformFlags & ~1003935041; } function computeFunctionExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -20044,7 +20526,7 @@ var ts; transformFlags |= 768; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601281857; + return transformFlags & ~1003935041; } function computeArrowFunction(node, subtreeFlags) { var transformFlags = subtreeFlags | 192; @@ -20063,17 +20545,27 @@ var ts; transformFlags |= 32768; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~601249089; + return transformFlags & ~1003902273; } function computePropertyAccess(node, subtreeFlags) { var transformFlags = subtreeFlags; - var expression = node.expression; - var expressionKind = expression.kind; - if (expressionKind === 97) { - transformFlags |= 16384; + if (transformFlags & 134217728) { + transformFlags ^= 134217728; + transformFlags |= 268435456; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~671089985; + } + function computeElementAccess(node, subtreeFlags) { + var transformFlags = subtreeFlags; + var expression = node.expression; + var expressionFlags = expression.transformFlags; + if (expressionFlags & 134217728) { + transformFlags &= ~134217728; + transformFlags |= 268435456; + } + node.transformFlags = transformFlags | 536870912; + return transformFlags & ~671089985; } function computeVariableDeclaration(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -20085,7 +20577,7 @@ var ts; transformFlags |= 3; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; @@ -20100,7 +20592,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeLabeledStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -20109,7 +20601,7 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeImportEquals(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -20117,7 +20609,7 @@ var ts; transformFlags |= 3; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeExpressionStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -20125,7 +20617,7 @@ var ts; transformFlags |= 192; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~536872257; + return transformFlags & ~939525441; } function computeModuleDeclaration(node, subtreeFlags) { var transformFlags = 3; @@ -20134,7 +20626,7 @@ var ts; transformFlags |= subtreeFlags; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~574674241; + return transformFlags & ~977327425; } function computeVariableDeclarationList(node, subtreeFlags) { var transformFlags = subtreeFlags | 33554432; @@ -20145,53 +20637,57 @@ var ts; transformFlags |= 192 | 4194304; } node.transformFlags = transformFlags | 536870912; - return transformFlags & ~546309441; + return transformFlags & ~948962625; } function computeOther(node, kind, subtreeFlags) { var transformFlags = subtreeFlags; - var excludeFlags = 536872257; + var excludeFlags = 939525441; switch (kind) { case 120: - case 192: + case 195: transformFlags |= 8 | 16; break; + case 188: + case 206: + case 295: + transformFlags |= 3; + excludeFlags = 536872257; + break; case 114: case 112: case 113: case 117: case 124: case 76: - case 233: - case 268: - case 185: - case 203: - case 204: - case 131: + case 236: + case 271: + case 207: + case 132: transformFlags |= 3; break; - case 250: - case 251: - case 252: - case 10: case 253: case 254: case 255: + case 10: case 256: case 257: case 258: case 259: case 260: + case 261: + case 262: + case 263: transformFlags |= 4; break; case 13: case 14: case 15: case 16: - case 197: - case 184: - case 266: + case 200: + case 187: + case 269: case 115: - case 205: + case 208: transformFlags |= 192; break; case 9: @@ -20204,27 +20700,26 @@ var ts; transformFlags |= 192; } break; - case 217: + case 220: if (node.awaitModifier) { transformFlags |= 8; } transformFlags |= 192; break; - case 198: + case 201: transformFlags |= 8 | 192 | 16777216; break; case 119: - case 133: - case 130: case 134: - case 136: - case 122: + case 131: + case 135: case 137: + case 122: + case 138: case 105: - case 146: - case 149: - case 151: - case 156: + case 147: + case 150: + case 152: case 157: case 158: case 159: @@ -20238,57 +20733,61 @@ var ts; case 167: case 168: case 169: - case 231: - case 232: case 170: case 171: case 172: + case 234: + case 235: case 173: case 174: - case 237: + case 175: + case 176: + case 177: + case 240: transformFlags = 3; excludeFlags = -3; break; - case 145: + case 146: transformFlags |= 2097152; if (subtreeFlags & 16384) { transformFlags |= 65536; } break; - case 199: + case 202: transformFlags |= 192 | 524288; break; - case 267: + case 270: transformFlags |= 8 | 1048576; break; case 97: - transformFlags |= 192; + transformFlags |= 192 | 134217728; + excludeFlags = 536872257; break; case 99: transformFlags |= 16384; break; - case 175: + case 178: transformFlags |= 192 | 8388608; if (subtreeFlags & 524288) { transformFlags |= 8 | 1048576; } - excludeFlags = 537396545; + excludeFlags = 940049729; break; - case 176: + case 179: transformFlags |= 192 | 8388608; - excludeFlags = 537396545; + excludeFlags = 940049729; break; - case 177: + case 180: transformFlags |= 192; if (node.dotDotDotToken) { transformFlags |= 524288; } break; - case 148: + case 149: transformFlags |= 3 | 4096; break; - case 179: - excludeFlags = 540087617; + case 182: + excludeFlags = 942740801; if (subtreeFlags & 2097152) { transformFlags |= 192; } @@ -20299,29 +20798,29 @@ var ts; transformFlags |= 8; } break; - case 178: - case 183: - excludeFlags = 537396545; + case 181: + case 186: + excludeFlags = 940049729; if (subtreeFlags & 524288) { transformFlags |= 192; } break; - case 213: - case 214: - case 215: case 216: + case 217: + case 218: + case 219: if (subtreeFlags & 4194304) { transformFlags |= 192; } break; - case 269: + case 272: if (subtreeFlags & 32768) { transformFlags |= 192; } break; - case 220: - case 218: - case 219: + case 223: + case 221: + case 222: transformFlags |= 33554432; break; } @@ -20329,60 +20828,69 @@ var ts; return transformFlags & ~excludeFlags; } function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 159 && kind <= 174) { + if (kind >= 160 && kind <= 177) { return -3; } switch (kind) { - case 182: - case 183: - case 178: - return 537396545; - case 234: - return 574674241; - case 147: - return 536872257; - case 188: - return 601249089; - case 187: - case 229: - return 601281857; - case 228: - return 546309441; - case 230: - case 200: - return 539358529; - case 153: - return 601015617; - case 152: + case 185: + case 186: + case 181: + return 940049729; + case 237: + return 977327425; + case 148: + return 939525441; + case 191: + return 1003902273; + case 190: + case 232: + return 1003935041; + case 231: + return 948962625; + case 233: + case 203: + return 942011713; case 154: + return 1003668801; + case 153: case 155: - return 601015617; - case 119: - case 133: - case 130: - case 136: - case 134: - case 122: - case 137: - case 105: - case 146: - case 149: - case 151: case 156: + return 1003668801; + case 119: + case 134: + case 131: + case 137: + case 135: + case 122: + case 138: + case 105: + case 147: + case 150: + case 152: case 157: case 158: - case 231: - case 232: + case 159: + case 234: + case 235: return -3; + case 182: + return 942740801; + case 267: + return 940574017; + case 178: case 179: - return 540087617; - case 264: - return 537920833; - case 175: - case 176: - return 537396545; - default: + return 940049729; + case 188: + case 206: + case 295: + case 189: + case 97: return 536872257; + case 183: + case 184: + return 671089985; + default: + return 939525441; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; @@ -20393,7 +20901,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { return getSymbolWalker; function getSymbolWalker(accept) { if (accept === void 0) { accept = function () { return true; }; } @@ -20486,8 +20994,9 @@ var ts; visitType(type.modifiersType); } function visitSignature(signature) { - if (signature.typePredicate) { - visitType(signature.typePredicate.type); + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + visitType(typePredicate.type); } ts.forEach(signature.typeParameters, visitType); for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { @@ -20540,7 +21049,7 @@ var ts; symbol.exports.forEach(visitSymbol); } ts.forEach(symbol.declarations, function (d) { - if (d.type && d.type.kind === 163) { + if (d.type && d.type.kind === 164) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -20649,6 +21158,11 @@ var ts; typeToTypeNode: nodeBuilder.typeToTypeNode, indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + symbolToEntityName: nodeBuilder.symbolToEntityName, + symbolToExpression: nodeBuilder.symbolToExpression, + symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, + symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, + typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, getSymbolsInScope: function (location, meaning) { location = ts.getParseTreeNode(location); return location ? getSymbolsInScope(location, meaning) : []; @@ -20682,16 +21196,40 @@ var ts; typeToString: function (type, enclosingDeclaration, flags) { return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); }, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: function (symbol, enclosingDeclaration, meaning) { - return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + symbolToString: function (symbol, enclosingDeclaration, meaning, flags) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags); }, + typePredicateToString: function (predicate, enclosingDeclaration, flags) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags); + }, + writeSignature: function (signature, enclosingDeclaration, flags, kind, writer) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind, writer); + }, + writeType: function (type, enclosingDeclaration, flags, writer) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + writeSymbol: function (symbol, enclosingDeclaration, meaning, flags, writer) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags, writer); + }, + writeTypePredicate: function (predicate, enclosingDeclaration, flags, writer) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + getSymbolDisplayBuilder: getSymbolDisplayBuilder, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, getContextualType: function (node) { node = ts.getParseTreeNode(node, ts.isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: function (node, argIndex) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, + isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) { node = ts.getParseTreeNode(node, ts.isCallLikeExpression); @@ -20706,7 +21244,11 @@ var ts; }, isValidPropertyAccess: function (node, propertyName) { node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); - return node ? isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)) : false; + return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)); + }, + isValidPropertyAccessForCompletions: function (node, type, property) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessExpression); + return !!node && isValidPropertyAccessForCompletions(node, type, property); }, getSignatureFromDeclaration: function (declaration) { declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); @@ -20730,7 +21272,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, - getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -20770,28 +21312,40 @@ var ts; getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); }, getBaseConstraintOfType: getBaseConstraintOfType, getDefaultFromTypeParameter: function (type) { return type && type.flags & 32768 ? getDefaultFromTypeParameter(type) : undefined; }, - resolveName: function (name, location, meaning) { - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined, false); + resolveName: function (name, location, meaning, excludeGlobals) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, undefined, undefined, false, excludeGlobals); }, getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, getAccessibleSymbolChain: getAccessibleSymbolChain, + getTypePredicateOfSignature: getTypePredicateOfSignature, + resolveExternalModuleSymbol: resolveExternalModuleSymbol, + tryGetThisTypeAt: function (node) { + node = ts.getParseTreeNode(node); + return node && tryGetThisTypeAt(node); + }, + getTypeArgumentConstraint: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, }; var tupleTypes = []; var unionTypes = ts.createMap(); var intersectionTypes = ts.createMap(); var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); + var conditionalTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4, "unknown"); var resolvingSymbol = createSymbol(0, "__resolving__"); var anyType = createIntrinsicType(1, "any"); var autoType = createIntrinsicType(1, "any"); + var wildcardType = createIntrinsicType(1, "any"); var unknownType = createIntrinsicType(1, "unknown"); var undefinedType = createIntrinsicType(4096, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 | 4194304, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 | 16777216, "undefined"); var nullType = createIntrinsicType(8192, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 | 4194304, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 | 16777216, "null"); var stringType = createIntrinsicType(2, "string"); var numberType = createIntrinsicType(4, "number"); var trueType = createIntrinsicType(128, "true"); @@ -20802,7 +21356,7 @@ var ts; var neverType = createIntrinsicType(16384, "never"); var silentNeverType = createIntrinsicType(16384, "never"); var implicitNeverType = createIntrinsicType(16384, "never"); - var nonPrimitiveType = createIntrinsicType(33554432, "object"); + var nonPrimitiveType = createIntrinsicType(134217728, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyTypeLiteralSymbol = createSymbol(2048, "__type"); emptyTypeLiteralSymbol.members = ts.createSymbolTable(); @@ -20810,7 +21364,7 @@ var ts; var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); emptyGenericType.instantiations = ts.createMap(); var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); - anyFunctionType.flags |= 16777216; + anyFunctionType.flags |= 67108864; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -20818,6 +21372,7 @@ var ts; var markerSubType = createType(32768); markerSubType.constraint = markerSuperType; var markerOtherType = createType(32768); + var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType); var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false); var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, undefined, 0, false, false); var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, undefined, 0, false, false); @@ -20825,6 +21380,7 @@ var ts; var enumNumberIndexInfo = createIndexInfo(stringType, true); var jsObjectLiteralIndexInfo = createIndexInfo(anyType, false); var globals = ts.createSymbolTable(); + var reverseMappedCache = ts.createMap(); var ambientModulesCache; var patternAmbientModules; var globalObjectType; @@ -20976,22 +21532,24 @@ var ts; var jsxTypes = ts.createUnderscoreEscapedMap(); var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); + var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); - var _displayBuilder; var TypeSystemPropertyName; (function (TypeSystemPropertyName) { TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstraint"] = 4] = "ResolvedBaseConstraint"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); var CheckMode; (function (CheckMode) { CheckMode[CheckMode["Normal"] = 0] = "Normal"; CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + CheckMode[CheckMode["Contextual"] = 3] = "Contextual"; })(CheckMode || (CheckMode = {})); var CallbackCheck; (function (CallbackCheck) { @@ -21001,8 +21559,10 @@ var ts; })(CallbackCheck || (CallbackCheck = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { - MappedTypeModifiers[MappedTypeModifiers["Readonly"] = 1] = "Readonly"; - MappedTypeModifiers[MappedTypeModifiers["Optional"] = 2] = "Optional"; + MappedTypeModifiers[MappedTypeModifiers["IncludeReadonly"] = 1] = "IncludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeReadonly"] = 2] = "ExcludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["IncludeOptional"] = 4] = "IncludeOptional"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeOptional"] = 8] = "ExcludeOptional"; })(MappedTypeModifiers || (MappedTypeModifiers = {})); var ExpandingFlags; (function (ExpandingFlags) { @@ -21011,6 +21571,21 @@ var ts; ExpandingFlags[ExpandingFlags["Target"] = 2] = "Target"; ExpandingFlags[ExpandingFlags["Both"] = 3] = "Both"; })(ExpandingFlags || (ExpandingFlags = {})); + var TypeIncludes; + (function (TypeIncludes) { + TypeIncludes[TypeIncludes["Any"] = 1] = "Any"; + TypeIncludes[TypeIncludes["Undefined"] = 2] = "Undefined"; + TypeIncludes[TypeIncludes["Null"] = 4] = "Null"; + TypeIncludes[TypeIncludes["Never"] = 8] = "Never"; + TypeIncludes[TypeIncludes["NonWideningType"] = 16] = "NonWideningType"; + TypeIncludes[TypeIncludes["String"] = 32] = "String"; + TypeIncludes[TypeIncludes["Number"] = 64] = "Number"; + TypeIncludes[TypeIncludes["ESSymbol"] = 128] = "ESSymbol"; + TypeIncludes[TypeIncludes["LiteralOrUniqueESSymbol"] = 256] = "LiteralOrUniqueESSymbol"; + TypeIncludes[TypeIncludes["ObjectType"] = 512] = "ObjectType"; + TypeIncludes[TypeIncludes["EmptyObject"] = 1024] = "EmptyObject"; + TypeIncludes[TypeIncludes["Union"] = 2048] = "Union"; + })(TypeIncludes || (TypeIncludes = {})); var MembersOrExportsResolutionKind; (function (MembersOrExportsResolutionKind) { MembersOrExportsResolutionKind["resolvedExports"] = "resolvedExports"; @@ -21021,6 +21596,139 @@ var ts; var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor); initializeTypeChecker(); return checker; + function getSymbolDisplayBuilder() { + return { + buildTypeDisplay: function (type, writer, enclosingDeclaration, flags) { + typeToString(type, enclosingDeclaration, flags, emitTextWriterWrapper(writer)); + }, + buildSymbolDisplay: function (symbol, writer, enclosingDeclaration, meaning, flags) { + symbolToString(symbol, enclosingDeclaration, meaning, flags | 4, emitTextWriterWrapper(writer)); + }, + buildSignatureDisplay: function (signature, writer, enclosing, flags, kind) { + signatureToString(signature, enclosing, flags, kind, emitTextWriterWrapper(writer)); + }, + buildIndexSignatureDisplay: function (info, writer, kind, enclosing, flags) { + var sig = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, kind, enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, sig, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildParameterDisplay: function (symbol, writer, enclosing, flags) { + var node = nodeBuilder.symbolToParameterDeclaration(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplay: function (tp, writer, enclosing, flags) { + var node = nodeBuilder.typeParameterToDeclaration(tp, enclosing, toNodeBuilderFlags(flags) | 3112960 | 8192, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypePredicateDisplay: function (predicate, writer, enclosing, flags) { + typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplayFromSymbol: function (symbol, writer, enclosing, flags) { + var nodes = nodeBuilder.symbolToTypeParameterDeclarations(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeList(26896, nodes, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForParametersAndDelimiters: function (thisParameter, parameters, writer, enclosing, originalFlags) { + var printer = ts.createPrinter({ removeComments: true }); + var flags = 8192 | 3112960 | toNodeBuilderFlags(originalFlags); + var thisParameterArray = thisParameter ? [nodeBuilder.symbolToParameterDeclaration(thisParameter, enclosing, flags)] : []; + var params = ts.createNodeArray(thisParameterArray.concat(ts.map(parameters, function (param) { return nodeBuilder.symbolToParameterDeclaration(param, enclosing, flags); }))); + printer.writeList(1296, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForTypeParametersAndDelimiters: function (typeParameters, writer, enclosing, flags) { + var printer = ts.createPrinter({ removeComments: true }); + var args = ts.createNodeArray(ts.map(typeParameters, function (p) { return nodeBuilder.typeParameterToDeclaration(p, enclosing, toNodeBuilderFlags(flags)); })); + printer.writeList(26896, args, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildReturnTypeDisplay: function (signature, writer, enclosing, flags) { + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = getTypePredicateOfSignature(signature); + if (predicate) { + return typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + } + var node = nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosing, toNodeBuilderFlags(flags) | 3112960, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + } + }; + function emitTextWriterWrapper(underlying) { + return { + write: ts.noop, + writeTextOfNode: ts.noop, + writeLine: ts.noop, + increaseIndent: function () { + return underlying.increaseIndent(); + }, + decreaseIndent: function () { + return underlying.decreaseIndent(); + }, + getText: function () { + return ""; + }, + rawWrite: ts.noop, + writeLiteral: function (s) { + return underlying.writeStringLiteral(s); + }, + getTextPos: function () { + return 0; + }, + getLine: function () { + return 0; + }, + getColumn: function () { + return 0; + }, + getIndent: function () { + return 0; + }, + isAtStartOfLine: function () { + return false; + }, + clear: function () { + return underlying.clear(); + }, + writeKeyword: function (text) { + return underlying.writeKeyword(text); + }, + writeOperator: function (text) { + return underlying.writeOperator(text); + }, + writePunctuation: function (text) { + return underlying.writePunctuation(text); + }, + writeSpace: function (text) { + return underlying.writeSpace(text); + }, + writeStringLiteral: function (text) { + return underlying.writeStringLiteral(text); + }, + writeParameter: function (text) { + return underlying.writeParameter(text); + }, + writeProperty: function (text) { + return underlying.writeProperty(text); + }, + writeSymbol: function (text, symbol) { + return underlying.writeSymbol(text, symbol); + }, + trackSymbol: function (symbol, enclosing, meaning) { + return underlying.trackSymbol && underlying.trackSymbol(symbol, enclosing, meaning); + }, + reportInaccessibleThisError: function () { + return underlying.reportInaccessibleThisError && underlying.reportInaccessibleThisError(); + }, + reportPrivateInBaseOfClassExpression: function (name) { + return underlying.reportPrivateInBaseOfClassExpression && underlying.reportPrivateInBaseOfClassExpression(name); + }, + reportInaccessibleUniqueSymbolError: function () { + return underlying.reportInaccessibleUniqueSymbolError && underlying.reportInaccessibleUniqueSymbolError(); + } + }; + } + } function getJsxNamespace() { if (!_jsxNamespace) { _jsxNamespace = "React"; @@ -21122,7 +21830,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 234 && source.valueDeclaration.kind !== 234))) { + (target.valueDeclaration.kind === 237 && source.valueDeclaration.kind !== 237))) { target.valueDeclaration = source.valueDeclaration; } ts.addRange(target.declarations, source.declarations); @@ -21142,8 +21850,11 @@ var ts; error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - var message_2 = target.flags & 2 || source.flags & 2 - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message_2 = target.flags & 384 || source.flags & 384 + ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & 2 || source.flags & 2 + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); }); @@ -21229,7 +21940,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 269 && !ts.isExternalOrCommonJsModule(node); + return node.kind === 272 && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -21272,26 +21983,26 @@ var ts; return true; } var sourceFiles = host.getSourceFiles(); - return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); + return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos) { - if (declaration.kind === 177) { - var errorBindingElement = ts.getAncestor(usage, 177); + if (declaration.kind === 180) { + var errorBindingElement = ts.getAncestor(usage, 180); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 227), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 230), usage); } - else if (declaration.kind === 227) { + else if (declaration.kind === 230) { return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } return true; } - if (usage.parent.kind === 247 || (usage.parent.kind === 244 && usage.parent.isExportEquals)) { + if (usage.parent.kind === 250 || (usage.parent.kind === 247 && usage.parent.isExportEquals)) { return true; } - if (usage.kind === 244 && usage.isExportEquals) { + if (usage.kind === 247 && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -21299,9 +22010,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 209: - case 215: - case 217: + case 212: + case 218: + case 220: if (isSameScopeDescendentOf(usage, declaration, container)) { return true; } @@ -21318,16 +22029,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 150 && + current.parent.kind === 151 && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32)) { - if (declaration.kind === 152) { + if (declaration.kind === 153) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 150 && !ts.hasModifier(declaration, 32); + var isDeclarationInstanceProperty = declaration.kind === 151 && !ts.hasModifier(declaration, 32); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -21336,14 +22047,15 @@ var ts; }); } } - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, suggestedNameNotFoundMessage) { - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, getSymbol, suggestedNameNotFoundMessage); + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, suggestedNameNotFoundMessage) { + if (excludeGlobals === void 0) { excludeGlobals = false; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, suggestedNameNotFoundMessage); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, lookup, suggestedNameNotFoundMessage) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, suggestedNameNotFoundMessage) { var originalLocation = location; var result; var lastLocation; - var lastNonBlockLocation; + var lastSelfReferenceLocation; var propertyWithInvalidInitializer; var errorLocation = location; var grandparent; @@ -21353,20 +22065,23 @@ var ts; if (result = lookup(location.locals, name, meaning)) { var useResult = true; if (ts.isFunctionLike(location) && lastLocation && lastLocation !== location.body) { - if (meaning & result.flags & 793064 && lastLocation.kind !== 279) { + if (meaning & result.flags & 793064 && lastLocation.kind !== 282) { useResult = result.flags & 262144 ? lastLocation === location.type || - lastLocation.kind === 147 || - lastLocation.kind === 146 + lastLocation.kind === 148 || + lastLocation.kind === 147 : false; } if (meaning & 107455 && result.flags & 1) { useResult = - lastLocation.kind === 147 || + lastLocation.kind === 148 || (lastLocation === location.type && - result.valueDeclaration.kind === 147); + result.valueDeclaration.kind === 148); } } + else if (location.kind === 170) { + useResult = lastLocation === location.trueType; + } if (useResult) { break loop; } @@ -21376,13 +22091,13 @@ var ts; } } switch (location.kind) { - case 269: + case 272: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; - case 234: + case 237: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 269 || ts.isAmbientModule(location)) { + if (location.kind === 272 || ts.isAmbientModule(location)) { if (result = moduleExports.get("default")) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { @@ -21393,7 +22108,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 && - ts.getDeclarationOfKind(moduleExport, 247)) { + ts.getDeclarationOfKind(moduleExport, 250)) { break; } } @@ -21401,13 +22116,13 @@ var ts; break loop; } break; - case 233: + case 236: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8)) { break loop; } break; + case 151: case 150: - case 149: if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { @@ -21417,9 +22132,9 @@ var ts; } } break; - case 230: - case 200: - case 231: + case 233: + case 203: + case 234: if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 793064)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { result = undefined; @@ -21431,7 +22146,7 @@ var ts; } break loop; } - if (location.kind === 200 && meaning & 32) { + if (location.kind === 203 && meaning & 32) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -21439,7 +22154,7 @@ var ts; } } break; - case 202: + case 205: if (lastLocation === location.expression && location.parent.token === 85) { var container = location.parent.parent; if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064))) { @@ -21450,28 +22165,28 @@ var ts; } } break; - case 145: + case 146: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 231) { + if (ts.isClassLike(grandparent) || grandparent.kind === 234) { if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 793064)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 229: - case 188: + case 156: + case 232: + case 191: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 187: + case 190: if (meaning & 3 && name === "arguments") { result = argumentsSymbol; break loop; @@ -21484,8 +22199,8 @@ var ts; } } break; - case 148: - if (location.parent && location.parent.kind === 147) { + case 149: + if (location.parent && location.parent.kind === 148) { location = location.parent; } if (location.parent && ts.isClassElement(location.parent)) { @@ -21493,23 +22208,25 @@ var ts; } break; } - if (location.kind !== 208) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { - result.isReferenced = true; + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + result.isReferenced |= meaning; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 269); + ts.Debug.assert(lastLocation.kind === 272); if (lastLocation.commonJsModuleIndicator && name === "exports") { return lastLocation.symbol; } } - result = lookup(globals, name, meaning); + if (!excludeGlobals) { + result = lookup(globals, name, meaning); + } } if (!result) { if (nameNotFoundMessage) { @@ -21550,27 +22267,40 @@ var ts; } if (result && isInExternalModule && (meaning & 107455) === 107455) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 237) { + if (decls && decls.length === 1 && decls[0].kind === 240) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); } } } return result; } + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 232: + case 233: + case 234: + case 236: + case 235: + case 237: + return true; + default: + return false; + } + } function diagnosticName(nameArg) { return ts.isString(nameArg) ? ts.unescapeLeadingUnderscores(nameArg) : ts.declarationNameToString(nameArg); } function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 146 && decl.parent === container) { + if (decl.kind === 147 && decl.parent === container) { return true; } } return false; } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 71 && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } var container = ts.getThisContainer(errorLocation, true); @@ -21609,9 +22339,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 71: - case 180: + case 183: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 202: + case 205: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -21672,7 +22402,7 @@ var ts; } function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 || result.flags & 32 || result.flags & 384)); - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 233) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 236) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 2097152) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { if (result.flags & 2) { @@ -21691,13 +22421,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 238: - return node; - case 240: - return node.parent; case 241: - return node.parent.parent; + return node; case 243: + return node.parent; + case 244: + return node.parent.parent; + case 246: return node.parent.parent.parent; default: return undefined; @@ -21707,11 +22437,35 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 249) { + if (node.moduleReference.kind === 252) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } + function resolveExportByName(moduleSymbol, name, dontResolveAlias) { + var exportValue = moduleSymbol.exports.get("export="); + return exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), name) + : resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias); + } + function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) { + if (!allowSyntheticDefaultImports) { + return false; + } + if (!file || file.isDeclarationFile) { + if (resolveExportByName(moduleSymbol, "default", dontResolveAlias)) { + return false; + } + if (resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias)) { + return false; + } + return true; + } + if (!ts.isSourceFileJavaScript(file)) { + return hasExportAssignmentSymbol(moduleSymbol); + } + return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias); + } function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { @@ -21720,15 +22474,14 @@ var ts; exportDefaultSymbol = moduleSymbol; } else { - var exportValue = moduleSymbol.exports.get("export="); - exportDefaultSymbol = exportValue - ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") - : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", dontResolveAlias); } - if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { + var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias); + if (!exportDefaultSymbol && !hasSyntheticDefault) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } - else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + else if (!exportDefaultSymbol && hasSyntheticDefault) { return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; @@ -21816,19 +22569,19 @@ var ts; } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 238: - return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 240: - return getTargetOfImportClause(node, dontRecursivelyResolve); case 241: - return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); case 243: - return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 247: - return getTargetOfExportSpecifier(node, 107455 | 793064 | 1920, dontRecursivelyResolve); + return getTargetOfImportClause(node, dontRecursivelyResolve); case 244: + return getTargetOfNamespaceImport(node, dontRecursivelyResolve); + case 246: + return getTargetOfImportSpecifier(node, dontRecursivelyResolve); + case 250: + return getTargetOfExportSpecifier(node, 107455 | 793064 | 1920, dontRecursivelyResolve); + case 247: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 237: + case 240: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } @@ -21877,10 +22630,10 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 244) { + if (node.kind === 247) { checkExpressionCached(node.expression); } - else if (node.kind === 247) { + else if (node.kind === 250) { checkExpressionCached(node.propertyName || node.name); } else if (ts.isInternalModuleImportEqualsDeclaration(node)) { @@ -21892,11 +22645,11 @@ var ts; if (entityName.kind === 71 && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { entityName = entityName.parent; } - if (entityName.kind === 71 || entityName.parent.kind === 144) { + if (entityName.kind === 71 || entityName.parent.kind === 145) { return resolveEntityName(entityName, 1920, false, dontResolveAlias); } else { - ts.Debug.assert(entityName.parent.kind === 238); + ts.Debug.assert(entityName.parent.kind === 241); return resolveEntityName(entityName, 107455 | 793064 | 1920, false, dontResolveAlias); } } @@ -21915,19 +22668,18 @@ var ts; return undefined; } } - else if (name.kind === 144 || name.kind === 180) { + else if (name.kind === 145 || name.kind === 183) { var left = void 0; - if (name.kind === 144) { + if (name.kind === 145) { left = name.left; } - else if (name.kind === 180 && - (name.expression.kind === 186 || ts.isEntityNameExpression(name.expression))) { + else if (name.kind === 183) { left = name.expression; } else { return undefined; } - var right = name.kind === 144 ? name.right : name.name; + var right = name.kind === 145 ? name.right : name.name; var namespace = resolveEntityName(left, 1920, ignoreErrors, false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -21946,11 +22698,6 @@ var ts; return undefined; } } - else if (name.kind === 186) { - return ts.isEntityNameExpression(name.expression) ? - resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : - undefined; - } else { ts.Debug.assertNever(name, "Unknown entity name kind."); } @@ -21962,11 +22709,9 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 && moduleReferenceExpression.kind !== 13) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return ts.isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -22006,7 +22751,7 @@ var ts; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } else if (noImplicitAny && moduleNotFoundError) { - var errorInfo = !resolvedModule.isExternalLibraryImport ? undefined : ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference); + var errorInfo = resolvedModule.packageId && ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, resolvedModule.packageId.name); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } @@ -22034,8 +22779,41 @@ var ts; } function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); - if (!dontResolveAlias && symbol && !(symbol.flags & (1536 | 3))) { - error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + if (!dontResolveAlias && symbol) { + if (!(symbol.flags & (1536 | 3))) { + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + return symbol; + } + if (compilerOptions.esModuleInterop) { + var referenceParent = moduleReferenceExpression.parent; + if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) || + ts.isImportCall(referenceParent)) { + var type = getTypeOfSymbol(symbol); + var sigs = getSignaturesOfStructuredType(type, 0); + if (!sigs || !sigs.length) { + sigs = getSignaturesOfStructuredType(type, 1); + } + if (sigs && sigs.length) { + var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol); + var result = createSymbol(symbol.flags, symbol.escapedName); + result.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result.parent = symbol.parent; + result.target = symbol; + result.originatingImport = referenceParent; + if (symbol.valueDeclaration) + result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; + if (symbol.members) + result.members = ts.cloneMap(symbol.members); + if (symbol.exports) + result.exports = ts.cloneMap(symbol.exports); + var resolvedModuleType = resolveStructuredTypeMembers(moduleType); + result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.stringIndexInfo, resolvedModuleType.numberIndexInfo); + return result; + } + } + } } return symbol; } @@ -22162,7 +22940,7 @@ var ts; var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 153 && ts.nodeIsPresent(member.body)) { + if (member.kind === 154 && ts.nodeIsPresent(member.body)) { return member; } } @@ -22235,11 +23013,11 @@ var ts; } } switch (location.kind) { - case 269: + case 272: if (!ts.isExternalOrCommonJsModule(location)) { break; } - case 234: + case 237: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -22257,11 +23035,11 @@ var ts; } var visitedSymbolTables = []; return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - function getAccessibleSymbolChainFromSymbolTable(symbols) { + function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification) { if (!ts.pushIfUnique(visitedSymbolTables, symbols)) { return undefined; } - var result = trySymbolTable(symbols); + var result = trySymbolTable(symbols, ignoreQualification); visitedSymbolTables.pop(); return result; } @@ -22269,28 +23047,26 @@ var ts; return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning) || !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { + function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) && !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning)); } - function isUMDExportSymbol(symbol) { - return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); - } - function trySymbolTable(symbols) { - if (isAccessible(symbols.get(symbol.escapedName))) { + function trySymbolTable(symbols, ignoreQualification) { + if (isAccessible(symbols.get(symbol.escapedName), undefined, ignoreQualification)) { return [symbol]; } return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 2097152 && symbolFromSymbolTable.escapedName !== "export=" - && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) + && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) { + if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { return [symbolFromSymbolTable]; } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + var candidateTable = getExportsOfSymbol(resolvedImportedSymbol); + var accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable, true); if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); } @@ -22308,7 +23084,7 @@ var ts; if (symbolFromSymbolTable === symbol) { return true; } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 247)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 250)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -22322,10 +23098,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 150: - case 152: - case 154: + case 151: + case 153: case 155: + case 156: continue; default: return false; @@ -22339,6 +23115,10 @@ var ts; var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064, false); return access.accessibility === 0; } + function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 107455, false); + return access.accessibility === 0; + } function isSymbolAccessible(symbol, enclosingDeclaration, meaning, shouldComputeAliasesToMakeVisible) { if (symbol && enclosingDeclaration && !(symbol.flags & 262144)) { var initialSymbol = symbol; @@ -22382,7 +23162,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 269 && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 272 && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -22409,13 +23189,13 @@ var ts; } function isEntityNameVisible(entityName, enclosingDeclaration) { var meaning; - if (entityName.parent.kind === 163 || + if (entityName.parent.kind === 164 || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 145) { + entityName.parent.kind === 146) { meaning = 107455 | 1048576; } - else if (entityName.kind === 144 || entityName.kind === 180 || - entityName.parent.kind === 238) { + else if (entityName.kind === 145 || entityName.kind === 183 || + entityName.parent.kind === 241) { meaning = 1920; } else { @@ -22429,97 +23209,134 @@ var ts; errorNode: firstIdentifier }; } - function writeKeyword(writer, kind) { - writer.writeKeyword(ts.tokenToString(kind)); + function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { + if (flags === void 0) { flags = 4; } + var nodeFlags = 3112960; + if (flags & 2) { + nodeFlags |= 128; + } + if (flags & 1) { + nodeFlags |= 512; + } + if (flags & 8) { + nodeFlags |= 16384; + } + var builder = flags & 4 ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; + return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); + function symbolToStringWorker(writer) { + var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4, entity, sourceFile, writer); + return writer; + } } - function writePunctuation(writer, kind) { - writer.writePunctuation(ts.tokenToString(kind)); + function signatureToString(signature, enclosingDeclaration, flags, kind, writer) { + return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker); + function signatureToStringWorker(writer) { + var sigOutput; + if (flags & 262144) { + sigOutput = kind === 1 ? 163 : 162; + } + else { + sigOutput = kind === 1 ? 158 : 157; + } + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512); + var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4, sig, sourceFile, writer); + return writer; + } } - function writeSpace(writer) { - writer.writeSpace(" "); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); - }); - } - function signatureToString(signature, enclosingDeclaration, flags, kind) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); - }); - } - function typeToString(type, enclosingDeclaration, flags) { - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | ts.NodeBuilderFlags.IgnoreErrors | ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName); + function typeToString(type, enclosingDeclaration, flags, writer) { + if (writer === void 0) { writer = ts.createTextWriter(""); } + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960, writer); ts.Debug.assert(typeNode !== undefined, "should always get typenode"); var options = { removeComments: true }; - var writer = ts.createTextWriter(""); var printer = ts.createPrinter(options); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4, typeNode, sourceFile, writer); var result = writer.getText(); - var maxLength = compilerOptions.noErrorTruncation || flags & 8 ? undefined : 100; - if (maxLength && result.length >= maxLength) { + var maxLength = compilerOptions.noErrorTruncation || flags & 1 ? undefined : 100; + if (maxLength && result && result.length >= maxLength) { return result.substr(0, maxLength - "...".length) + "..."; } return result; - function toNodeBuilderFlags(flags) { - var result = ts.NodeBuilderFlags.None; - if (!flags) { - return result; - } - if (flags & 8) { - result |= ts.NodeBuilderFlags.NoTruncation; - } - if (flags & 256) { - result |= ts.NodeBuilderFlags.UseFullyQualifiedType; - } - if (flags & 4096) { - result |= ts.NodeBuilderFlags.SuppressAnyReturnType; - } - if (flags & 1) { - result |= ts.NodeBuilderFlags.WriteArrayAsGenericType; - } - if (flags & 64) { - result |= ts.NodeBuilderFlags.WriteTypeArgumentsOfSignature; - } - return result; - } + } + function toNodeBuilderFlags(flags) { + return flags & 9469291; } function createNodeBuilder() { return { - typeToTypeNode: function (type, enclosingDeclaration, flags) { + typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = typeToTypeNodeHelper(type, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = signatureToSignatureDeclarationHelper(signature, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; - } + }, + symbolToEntityName: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToName(symbol, context, meaning, false); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToExpression: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToExpression(symbol, context, meaning); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToTypeParameterDeclarations: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParametersToTypeParameterDeclarations(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToParameterDeclaration: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToParameterDeclaration(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + typeParameterToDeclaration: function (parameter, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParameterToDeclaration(parameter, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, }; - function createNodeBuilderContext(enclosingDeclaration, flags) { + function createNodeBuilderContext(enclosingDeclaration, flags, tracker) { return { enclosingDeclaration: enclosingDeclaration, flags: flags, + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop }, encounteredError: false, symbolStack: undefined }; } function typeToTypeNodeHelper(type, context) { - var inTypeAlias = context.flags & ts.NodeBuilderFlags.InTypeAlias; - context.flags &= ~ts.NodeBuilderFlags.InTypeAlias; + var inTypeAlias = context.flags & 8388608; + context.flags &= ~8388608; if (!type) { context.encounteredError = true; return undefined; @@ -22528,10 +23345,10 @@ var ts; return ts.createKeywordTypeNode(119); } if (type.flags & 2) { - return ts.createKeywordTypeNode(136); + return ts.createKeywordTypeNode(137); } if (type.flags & 4) { - return ts.createKeywordTypeNode(133); + return ts.createKeywordTypeNode(134); } if (type.flags & 8) { return ts.createKeywordTypeNode(122); @@ -22556,31 +23373,39 @@ var ts; return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); } if (type.flags & 1024) { - return ts.createTypeOperatorNode(140, ts.createKeywordTypeNode(137)); + if (!(context.flags & 1048576)) { + if (context.tracker.reportInaccessibleUniqueSymbolError) { + context.tracker.reportInaccessibleUniqueSymbolError(); + } + } + return ts.createTypeOperatorNode(141, ts.createKeywordTypeNode(138)); } if (type.flags & 2048) { return ts.createKeywordTypeNode(105); } if (type.flags & 4096) { - return ts.createKeywordTypeNode(139); + return ts.createKeywordTypeNode(140); } if (type.flags & 8192) { return ts.createKeywordTypeNode(95); } if (type.flags & 16384) { - return ts.createKeywordTypeNode(130); + return ts.createKeywordTypeNode(131); } if (type.flags & 512) { - return ts.createKeywordTypeNode(137); + return ts.createKeywordTypeNode(138); } - if (type.flags & 33554432) { - return ts.createKeywordTypeNode(134); + if (type.flags & 134217728) { + return ts.createKeywordTypeNode(135); } if (type.flags & 32768 && type.isThisType) { - if (context.flags & ts.NodeBuilderFlags.InObjectTypeLiteral) { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowThisInObjectLiteral)) { + if (context.flags & 4194304) { + if (!context.encounteredError && !(context.flags & 32768)) { context.encounteredError = true; } + if (context.tracker.reportInaccessibleThisError) { + context.tracker.reportInaccessibleThisError(); + } } return ts.createThis(); } @@ -22593,7 +23418,7 @@ var ts; var name = type.symbol ? symbolToName(type.symbol, context, 793064, false) : ts.createIdentifier("?"); return ts.createTypeReferenceNode(name, undefined); } - if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { + if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -22602,11 +23427,11 @@ var ts; var types = type.flags & 131072 ? formatUnionTypes(type.types) : type.types; var typeNodes = mapToTypeNodes(types, context); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 ? 167 : 168, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 ? 168 : 169, typeNodes); return unionOrIntersectionTypeNode; } else { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowEmptyUnionOrIntersection)) { + if (!context.encounteredError && !(context.flags & 262144)) { context.encounteredError = true; } return undefined; @@ -22626,12 +23451,22 @@ var ts; var indexTypeNode = typeToTypeNodeHelper(type.indexType, context); return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 2097152) { + var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); + var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); + var trueTypeNode = typeToTypeNodeHelper(type.trueType, context); + var falseTypeNode = typeToTypeNodeHelper(type.falseType, context); + return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + if (type.flags & 4194304) { + return typeToTypeNodeHelper(type.typeParameter, context); + } ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { ts.Debug.assert(!!(type.flags & 65536)); - var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131) : undefined; - var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55) : undefined; - var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context); + var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined; + var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined; + var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); var mappedTypeNode = ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); return ts.setEmitFlags(mappedTypeNode, 1); @@ -22639,7 +23474,7 @@ var ts; function createAnonymousTypeNode(type) { var symbol = type.symbol; if (symbol) { - if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) || + if (symbol.flags & 32 && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 203 && context.flags & 2048) || symbol.flags & (384 | 512) || shouldWriteTypeOfFunctionSymbol()) { return createTypeQueryNodeFromSymbol(symbol, 107455); @@ -22658,10 +23493,16 @@ var ts; if (!context.symbolStack) { context.symbolStack = []; } - context.symbolStack.push(symbol); - var result = createTypeNodeFromObjectType(type); - context.symbolStack.pop(); - return result; + var isConstructorObject = ts.getObjectFlags(type) & 16 && type.symbol && type.symbol.flags & 32; + if (isConstructorObject) { + return createTypeNodeFromObjectType(type); + } + else { + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } } } else { @@ -22673,10 +23514,11 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && (symbol.parent || ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 || declaration.parent.kind === 235; + return declaration.parent.kind === 272 || declaration.parent.kind === 238; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return ts.contains(context.symbolStack, symbol); + return (!!(context.flags & 4096) || ts.contains(context.symbolStack, symbol)) && + (!(context.flags & 8) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); } } } @@ -22691,21 +23533,21 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 161, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 162, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 162, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 163, context); return signatureNode; } } var savedFlags = context.flags; - context.flags |= ts.NodeBuilderFlags.InObjectTypeLiteral; + context.flags |= 4194304; var members = createTypeNodesFromResolvedType(resolved); context.flags = savedFlags; var typeLiteralNode = ts.createTypeLiteralNode(members); - return ts.setEmitFlags(typeLiteralNode, 1); + return ts.setEmitFlags(typeLiteralNode, (context.flags & 1024) ? 0 : 1); } function createTypeQueryNodeFromSymbol(symbol, symbolFlags) { var entityName = symbolToName(symbol, context, symbolFlags, false); @@ -22718,7 +23560,7 @@ var ts; function typeReferenceToTypeNode(type) { var typeArguments = type.typeArguments || ts.emptyArray; if (type.target === globalArrayType) { - if (context.flags & ts.NodeBuilderFlags.WriteArrayAsGenericType) { + if (context.flags & 2) { var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context); return ts.createTypeReferenceNode("Array", [typeArgumentNode]); } @@ -22732,12 +23574,17 @@ var ts; return ts.createTupleTypeNode(tupleConstituentNodes); } } - if (context.encounteredError || (context.flags & ts.NodeBuilderFlags.AllowEmptyTuple)) { + if (context.encounteredError || (context.flags & 524288)) { return ts.createTupleTypeNode([]); } context.encounteredError = true; return undefined; } + else if (context.flags & 2048 && + type.symbol.valueDeclaration && + type.symbol.valueDeclaration.kind === 203) { + return createAnonymousTypeNode(type); + } else { var outerTypeParameters = type.target.outerTypeParameters; var i = 0; @@ -22806,14 +23653,17 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 156, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 157, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 157, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 158, context)); } if (resolvedType.stringIndexInfo) { - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0, context)); + var indexInfo = resolvedType.objectFlags & 2048 ? + createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : + resolvedType.stringIndexInfo; + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0, context)); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1, context)); @@ -22824,9 +23674,25 @@ var ts; } for (var _d = 0, properties_1 = properties; _d < properties_1.length; _d++) { var propertySymbol = properties_1[_d]; - var propertyType = getTypeOfSymbol(propertySymbol); + if (context.flags & 2048) { + if (propertySymbol.flags & 4194304) { + continue; + } + if (ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 | 16) && context.tracker.reportPrivateInBaseOfClassExpression) { + context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName)); + } + } + var propertyType = ts.getCheckFlags(propertySymbol) & 2048 && context.flags & 33554432 ? + anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; + if (ts.getCheckFlags(propertySymbol) & 1024) { + var decl = ts.firstOrUndefined(propertySymbol.declarations); + var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455); + if (name && context.tracker.trackSymbol) { + context.tracker.trackSymbol(name, saveEnclosingDeclaration, 107455); + } + } var propertyName = symbolToName(propertySymbol, context, 107455, true); context.enclosingDeclaration = saveEnclosingDeclaration; var optionalToken = propertySymbol.flags & 16777216 ? ts.createToken(55) : undefined; @@ -22834,15 +23700,18 @@ var ts; var signatures = getSignaturesOfType(propertyType, 0); for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { var signature = signatures_1[_e]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 151, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(methodDeclaration); } } else { + var savedFlags = context.flags; + context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048) ? 33554432 : 0; var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119); - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(131)] : undefined; + context.flags = savedFlags; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132)] : undefined; var propertySignature = ts.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode, undefined); typeElements.push(propertySignature); } @@ -22865,21 +23734,31 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 136 : 133); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 ? 137 : 134); var indexingParameter = ts.createParameter(undefined, undefined, undefined, name, undefined, indexerTypeNode, undefined); - var typeNode = typeToTypeNodeHelper(indexInfo.type, context); - return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(131)] : undefined, [indexingParameter], typeNode); + var typeNode = indexInfo.type ? typeToTypeNodeHelper(indexInfo.type, context) : typeToTypeNodeHelper(anyType, context); + if (!indexInfo.type && !(context.flags & 2097152)) { + context.encounteredError = true; + } + return ts.createIndexSignature(undefined, indexInfo.isReadonly ? [ts.createToken(132)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { - var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + var typeParameters; + var typeArguments; + if (context.flags & 32 && signature.target && signature.mapper && signature.target.typeParameters) { + typeArguments = signature.target.typeParameters.map(function (parameter) { return typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context); }); + } + else { + typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + } var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); } var returnTypeNode; - if (signature.typePredicate) { - var typePredicate = signature.typePredicate; + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { var parameterName = typePredicate.kind === 1 ? ts.setEmitFlags(ts.createIdentifier(typePredicate.parameterName), 16777216) : ts.createThisTypeNode(); @@ -22890,7 +23769,7 @@ var ts; var returnType = getReturnTypeOfSignature(signature); returnTypeNode = returnType && typeToTypeNodeHelper(returnType, context); } - if (context.flags & ts.NodeBuilderFlags.SuppressAnyReturnType) { + if (context.flags & 256) { if (returnTypeNode && returnTypeNode.kind === 119) { returnTypeNode = undefined; } @@ -22898,25 +23777,28 @@ var ts; else if (!returnTypeNode) { returnTypeNode = ts.createKeywordTypeNode(119); } - return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode); + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments); } - function typeParameterToDeclaration(type, context) { + function typeParameterToDeclaration(type, context, constraint) { + if (constraint === void 0) { constraint = getConstraintFromTypeParameter(type); } + var savedContextFlags = context.flags; + context.flags &= ~512; var name = symbolToName(type.symbol, context, 793064, true); - var constraint = getConstraintFromTypeParameter(type); var constraintNode = constraint && typeToTypeNodeHelper(constraint, context); var defaultParameter = getDefaultFromTypeParameter(type); var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); + context.flags = savedContextFlags; return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); } function symbolToParameterDeclaration(parameterSymbol, context) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 147); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148); ts.Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter); var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { parameterType = getOptionalType(parameterType); } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); - var modifiers = parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); + var modifiers = !(context.flags & 8192) && parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); var dotDotDotToken = !parameterDeclaration || ts.isRestParameter(parameterDeclaration) ? ts.createToken(24) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? @@ -22933,52 +23815,27 @@ var ts; function elideInitializerAndSetEmitFlags(node) { var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 177) { + if (clone.kind === 180) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 | 16777216); } } } - function symbolToName(symbol, context, meaning, expectsIdentifier) { + function lookupSymbolChain(symbol, context, meaning) { + context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); var chain; var isTypeParameter = symbol.flags & 262144; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & ts.NodeBuilderFlags.UseFullyQualifiedType)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64)) { chain = getSymbolChain(symbol, meaning, true); ts.Debug.assert(chain && chain.length > 0); } else { chain = [symbol]; } - if (expectsIdentifier && chain.length !== 1 - && !context.encounteredError - && !(context.flags & ts.NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { - context.encounteredError = true; - } - return createEntityNameFromSymbolChain(chain, chain.length - 1); - function createEntityNameFromSymbolChain(chain, index) { - ts.Debug.assert(chain && 0 <= index && index < chain.length); - var symbol = chain[index]; - var typeParameterNodes; - if (context.flags & ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName && index > 0) { - var parentSymbol = chain[index - 1]; - var typeParameters = void 0; - if (ts.getCheckFlags(symbol) & 1) { - typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); - } - else { - var targetSymbol = getTargetSymbol(parentSymbol); - if (targetSymbol.flags & (32 | 64 | 524288)) { - typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - } - } - typeParameterNodes = mapToTypeNodes(typeParameters, context); - } - var identifier = ts.setEmitFlags(ts.createIdentifier(getNameOfSymbolAsWritten(symbol, context), typeParameterNodes), 16777216); - return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; - } + return chain; function getSymbolChain(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, false); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128)); var parentSymbol; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { @@ -23001,11 +23858,105 @@ var ts; } } } + function typeParametersToTypeParameterDeclarations(symbol, context) { + var typeParameterNodes; + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & (32 | 64 | 524288)) { + typeParameterNodes = ts.createNodeArray(ts.map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), function (tp) { return typeParameterToDeclaration(tp, context); })); + } + return typeParameterNodes; + } + function lookupTypeParameterNodes(chain, index, context) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterNodes; + if (context.flags & 512 && index < (chain.length - 1)) { + var parentSymbol = symbol; + var nextSymbol = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol) & 1) { + var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol); + typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + } + else { + typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); + } + } + return typeParameterNodes; + } + function symbolToName(symbol, context, meaning, expectsIdentifier) { + var chain = lookupSymbolChain(symbol, context, meaning); + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & 65536)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216; + } + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216); + identifier.symbol = symbol; + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + } + function symbolToExpression(symbol, context, meaning) { + var chain = lookupSymbolChain(symbol, context, meaning); + return createExpressionFromSymbolChain(chain, chain.length - 1); + function createExpressionFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216; + } + var firstChar = symbolName.charCodeAt(0); + var canUsePropertyAccess = ts.isIdentifierStart(firstChar, languageVersion); + if (index === 0 || canUsePropertyAccess) { + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216); + identifier.symbol = symbol; + return index > 0 ? ts.createPropertyAccess(createExpressionFromSymbolChain(chain, index - 1), identifier) : identifier; + } + else { + if (firstChar === 91) { + symbolName = symbolName.substring(1, symbolName.length - 1); + firstChar = symbolName.charCodeAt(0); + } + var expression = void 0; + if (ts.isSingleOrDoubleQuote(firstChar)) { + expression = ts.createLiteral(symbolName.substring(1, symbolName.length - 1).replace(/\\./g, function (s) { return s.substring(1); })); + expression.singleQuote = firstChar === 39; + } + else if (("" + +symbolName) === symbolName) { + expression = ts.createLiteral(+symbolName); + } + if (!expression) { + expression = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216); + expression.symbol = symbol; + } + return ts.createElementAccess(createExpressionFromSymbolChain(chain, index - 1), expression); + } + } + } } - function typePredicateToString(typePredicate, enclosingDeclaration, flags) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); - }); + function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) { + return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); + function typePredicateToStringWorker(writer) { + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 | 512)); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4, predicate, sourceFile, writer); + return writer; + } } function formatUnionTypes(types) { var result = []; @@ -23045,8 +23996,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 169; }); - if (node.kind === 232) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 172; }); + if (node.kind === 235) { return getSymbolOfNode(node); } } @@ -23054,30 +24005,39 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 235 && + node.parent.kind === 238 && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 ? '"' + ts.escapeString(type.value) + '"' : "" + type.value; } + function isDefaultBindingContext(location) { + return location.kind === 272 || ts.isAmbientModule(location); + } function getNameOfSymbolAsWritten(symbol, context) { + if (context && symbol.escapedName === "default" && !(context.flags & 16384) && + (!(context.flags & 16777216) || + !symbol.declarations || + (context.enclosingDeclaration && ts.findAncestor(symbol.declarations[0], isDefaultBindingContext) !== ts.findAncestor(context.enclosingDeclaration, isDefaultBindingContext)))) { + return "default"; + } if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; var name = ts.getNameOfDeclaration(declaration); if (name) { return ts.declarationNameToString(name); } - if (declaration.parent && declaration.parent.kind === 227) { + if (declaration.parent && declaration.parent.kind === 230) { return ts.declarationNameToString(declaration.parent.name); } - if (context && !context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowAnonymousIdentifier)) { + if (context && !context.encounteredError && !(context.flags & 131072)) { context.encounteredError = true; } switch (declaration.kind) { - case 200: + case 203: return "(Anonymous class)"; - case 187: - case 188: + case 190: + case 191: return "(Anonymous function)"; } } @@ -23089,668 +24049,6 @@ var ts; } return ts.symbolName(symbol); } - function getSymbolDisplayBuilder() { - function appendSymbolNameOnly(symbol, writer) { - writer.writeSymbol(getNameOfSymbolAsWritten(symbol), symbol); - } - function appendPropertyOrElementAccessForSymbol(symbol, writer) { - var symbolName = symbol.escapedName === "default" ? "default" : getNameOfSymbolAsWritten(symbol); - var firstChar = symbolName.charCodeAt(0); - var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); - if (needsElementAccess) { - if (firstChar !== 91) { - writePunctuation(writer, 21); - } - if (ts.isSingleOrDoubleQuote(firstChar)) { - writer.writeStringLiteral(symbolName); - } - else { - writer.writeSymbol(symbolName, symbol); - } - if (firstChar !== 91) { - writePunctuation(writer, 22); - } - } - else { - writePunctuation(writer, 23); - writer.writeSymbol(symbolName, symbol); - } - } - function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { - var parentSymbol; - function appendParentTypeArgumentsAndSymbolName(symbol) { - if (parentSymbol) { - if (flags & 1) { - if (ts.getCheckFlags(symbol) & 1) { - var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 ? resolveAlias(parentSymbol) : parentSymbol); - buildDisplayForTypeArgumentsAndDelimiters(params, symbol.mapper, writer, enclosingDeclaration); - } - else { - buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - appendPropertyOrElementAccessForSymbol(symbol, writer); - } - else { - appendSymbolNameOnly(symbol, writer); - } - parentSymbol = symbol; - } - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - function walkSymbol(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent) { - walkSymbol(parent, getQualifiedLeftMeaning(meaning), false); - } - } - if (accessibleSymbolChain) { - for (var _i = 0, accessibleSymbolChain_1 = accessibleSymbolChain; _i < accessibleSymbolChain_1.length; _i++) { - var accessibleSymbol = accessibleSymbolChain_1[_i]; - appendParentTypeArgumentsAndSymbolName(accessibleSymbol); - } - } - else if (endOfChain || - !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && - !(symbol.flags & (2048 | 4096))) { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - var isTypeParameter = symbol.flags & 262144; - var typeFormatFlag = 256 & typeFlags; - if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { - walkSymbol(symbol, meaning, true); - } - else { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, symbolStack) { - var globalFlagsToPass = globalFlags & (32 | 16384); - var inObjectTypeLiteral = false; - return writeType(type, globalFlags); - function writeType(type, flags) { - var nextFlags = flags & ~1024; - if (type.flags & 33585807) { - writer.writeKeyword(!(globalFlags & 32) && isTypeAny(type) - ? "any" - : type.intrinsicName); - } - else if (type.flags & 32768 && type.isThisType) { - if (inObjectTypeLiteral) { - writer.reportInaccessibleThisError(); - } - writer.writeKeyword("this"); - } - else if (ts.getObjectFlags(type) & 4) { - writeTypeReference(type, nextFlags); - } - else if (type.flags & 256 && !(type.flags & 131072)) { - var parent = getParentOfSymbol(type.symbol); - buildSymbolDisplay(parent, writer, enclosingDeclaration, 793064, 0, nextFlags); - if (getDeclaredTypeOfSymbol(parent) !== type) { - writePunctuation(writer, 23); - appendSymbolNameOnly(type.symbol, writer); - } - } - else if (ts.getObjectFlags(type) & 3 || type.flags & (272 | 32768)) { - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064, 0, nextFlags); - } - else if (!(flags & 1024) && type.aliasSymbol && - ((flags & 65536) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); - } - else if (type.flags & 393216) { - writeUnionOrIntersectionType(type, nextFlags); - } - else if (ts.getObjectFlags(type) & (16 | 32)) { - writeAnonymousType(type, nextFlags); - } - else if (type.flags & 1024) { - if (flags & 131072) { - writeKeyword(writer, 140); - writeSpace(writer); - } - else { - writer.reportInaccessibleUniqueSymbolError(); - } - writeKeyword(writer, 137); - } - else if (type.flags & 96) { - writer.writeStringLiteral(literalTypeToString(type)); - } - else if (type.flags & 524288) { - if (flags & 128) { - writePunctuation(writer, 19); - } - writer.writeKeyword("keyof"); - writeSpace(writer); - writeType(type.type, 128); - if (flags & 128) { - writePunctuation(writer, 20); - } - } - else if (type.flags & 1048576) { - writeType(type.objectType, 128); - writePunctuation(writer, 21); - writeType(type.indexType, 0); - writePunctuation(writer, 22); - } - else { - writePunctuation(writer, 17); - writeSpace(writer); - writePunctuation(writer, 24); - writeSpace(writer); - writePunctuation(writer, 18); - } - } - function writeTypeList(types, delimiter) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - if (delimiter !== 26) { - writeSpace(writer); - } - writePunctuation(writer, delimiter); - writeSpace(writer); - } - writeType(types[i], delimiter === 26 ? 0 : 128); - } - } - function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) { - if (symbol.flags & 32 || !isReservedMemberName(symbol.escapedName)) { - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064, 0, flags); - } - if (pos < end) { - writePunctuation(writer, 27); - writeType(typeArguments[pos], 512); - pos++; - while (pos < end) { - writePunctuation(writer, 26); - writeSpace(writer); - writeType(typeArguments[pos], 0); - pos++; - } - writePunctuation(writer, 29); - } - } - function writeTypeReference(type, flags) { - var typeArguments = type.typeArguments || ts.emptyArray; - if (type.target === globalArrayType && !(flags & 1)) { - writeType(typeArguments[0], 128 | 32768); - writePunctuation(writer, 21); - writePunctuation(writer, 22); - } - else if (type.target.objectFlags & 8) { - writePunctuation(writer, 21); - writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 26); - writePunctuation(writer, 22); - } - else if (flags & 16384 && - type.symbol.valueDeclaration && - type.symbol.valueDeclaration.kind === 200) { - writeAnonymousType(type, flags); - } - else { - var outerTypeParameters = type.target.outerTypeParameters; - var i = 0; - if (outerTypeParameters) { - var length_2 = outerTypeParameters.length; - while (i < length_2) { - var start = i; - var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); - do { - i++; - } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); - if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent, typeArguments, start, i, flags); - writePunctuation(writer, 23); - } - } - } - var typeParameterCount = (type.target.typeParameters || ts.emptyArray).length; - writeSymbolTypeReference(type.symbol, typeArguments, i, typeParameterCount, flags); - } - } - function writeUnionOrIntersectionType(type, flags) { - if (flags & 128) { - writePunctuation(writer, 19); - } - if (type.flags & 131072) { - writeTypeList(formatUnionTypes(type.types), 49); - } - else { - writeTypeList(type.types, 48); - } - if (flags & 128) { - writePunctuation(writer, 20); - } - } - function writeAnonymousType(type, flags) { - var symbol = type.symbol; - if (symbol) { - if (symbol.flags & 32 && - !getBaseTypeVariableOfClass(symbol) && - !(symbol.valueDeclaration.kind === 200 && flags & 16384) || - symbol.flags & (384 | 512)) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (ts.contains(symbolStack, symbol)) { - var typeAlias = getTypeAliasForTypeLiteral(type); - if (typeAlias) { - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064, 0, flags); - } - else { - writeKeyword(writer, 119); - } - } - else { - if (!symbolStack) { - symbolStack = []; - } - var isConstructorObject = type.objectFlags & 16 && type.symbol && type.symbol.flags & 32; - if (isConstructorObject) { - writeLiteralType(type, flags); - } - else { - symbolStack.push(symbol); - writeLiteralType(type, flags); - symbolStack.pop(); - } - } - } - else { - writeLiteralType(type, flags); - } - function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192) && - ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32); }); - var isNonLocalFunctionSymbol = !!(symbol.flags & 16) && - (symbol.parent || - ts.some(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 || declaration.parent.kind === 235; - })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 4) || - ts.contains(symbolStack, symbol); - } - } - } - function writeTypeOfSymbol(symbol, typeFormatFlags) { - if (typeFormatFlags & 32768) { - writePunctuation(writer, 19); - } - writeKeyword(writer, 103); - writeSpace(writer); - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 107455, 0, typeFormatFlags); - if (typeFormatFlags & 32768) { - writePunctuation(writer, 20); - } - } - function writePropertyWithModifiers(prop) { - if (isReadonlySymbol(prop)) { - writeKeyword(writer, 131); - writeSpace(writer); - } - if (ts.getCheckFlags(prop) & 1024) { - var decl = ts.firstOrUndefined(prop.declarations); - var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455); - if (name) { - writer.trackSymbol(name, enclosingDeclaration, 107455); - } - } - buildSymbolDisplay(prop, writer); - if (prop.flags & 16777216) { - writePunctuation(writer, 55); - } - } - function shouldAddParenthesisAroundFunctionType(callSignature, flags) { - if (flags & 128) { - return true; - } - else if (flags & 512) { - var typeParameters = callSignature.target && (flags & 64) ? - callSignature.target.typeParameters : callSignature.typeParameters; - return typeParameters && typeParameters.length !== 0; - } - return false; - } - function writeLiteralType(type, flags) { - if (isGenericMappedType(type)) { - writeMappedType(type); - return; - } - var resolved = resolveStructuredTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 17); - writePunctuation(writer, 18); - return; - } - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags); - if (parenthesizeSignature) { - writePunctuation(writer, 19); - } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16, undefined, symbolStack); - if (parenthesizeSignature) { - writePunctuation(writer, 20); - } - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 128) { - writePunctuation(writer, 19); - } - writeKeyword(writer, 94); - writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16, undefined, symbolStack); - if (flags & 128) { - writePunctuation(writer, 20); - } - return; - } - } - var saveInObjectTypeLiteral = inObjectTypeLiteral; - inObjectTypeLiteral = true; - writePunctuation(writer, 17); - writer.writeLine(); - writer.increaseIndent(); - writeObjectLiteralType(resolved); - writer.decreaseIndent(); - writePunctuation(writer, 18); - inObjectTypeLiteral = saveInObjectTypeLiteral; - } - function writeObjectLiteralType(resolved) { - for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { - var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { - var signature = _c[_b]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0, enclosingDeclaration, globalFlags, symbolStack); - buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1, enclosingDeclaration, globalFlags, symbolStack); - for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { - var p = _e[_d]; - if (globalFlags & 16384) { - if (p.flags & 4194304) { - continue; - } - if (ts.getDeclarationModifierFlagsFromSymbol(p) & (8 | 16)) { - writer.reportPrivateInBaseOfClassExpression(ts.symbolName(p)); - } - } - var t = getTypeOfSymbol(p); - if (p.flags & (16 | 8192) && !getPropertiesOfObjectType(t).length) { - var signatures = getSignaturesOfType(t, 0); - for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { - var signature = signatures_2[_f]; - writePropertyWithModifiers(p); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, undefined, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - } - else { - writePropertyWithModifiers(p); - writePunctuation(writer, 56); - writeSpace(writer); - writeType(t, globalFlags & 16384); - writePunctuation(writer, 25); - writer.writeLine(); - } - } - } - function writeMappedType(type) { - writePunctuation(writer, 17); - writer.writeLine(); - writer.increaseIndent(); - if (type.declaration.readonlyToken) { - writeKeyword(writer, 131); - writeSpace(writer); - } - writePunctuation(writer, 21); - appendSymbolNameOnly(getTypeParameterFromMappedType(type).symbol, writer); - writeSpace(writer); - writeKeyword(writer, 92); - writeSpace(writer); - writeType(getConstraintTypeFromMappedType(type), 0); - writePunctuation(writer, 22); - if (type.declaration.questionToken) { - writePunctuation(writer, 55); - } - writePunctuation(writer, 56); - writeSpace(writer); - writeType(getTemplateTypeFromMappedType(type), 0); - writePunctuation(writer, 25); - writer.writeLine(); - writer.decreaseIndent(); - writePunctuation(writer, 18); - } - } - function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration, flags) { - var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 || targetSymbol.flags & 64 || targetSymbol.flags & 524288) { - buildDisplayForTypeParametersAndDelimiters(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), writer, enclosingDeclaration, flags); - } - } - function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, symbolStack) { - appendSymbolNameOnly(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 85); - writeSpace(writer); - buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); - } - var defaultType = getDefaultFromTypeParameter(tp); - if (defaultType) { - writeSpace(writer); - writePunctuation(writer, 58); - writeSpace(writer); - buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { - var parameterNode = p.valueDeclaration; - if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { - writePunctuation(writer, 24); - } - if (parameterNode && ts.isBindingPattern(parameterNode.name)) { - buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - appendSymbolNameOnly(p, writer); - } - if (parameterNode && isOptionalParameter(parameterNode)) { - writePunctuation(writer, 55); - } - writePunctuation(writer, 56); - writeSpace(writer); - var type = getTypeOfSymbol(p); - if (parameterNode && isRequiredInitializedParameter(parameterNode)) { - type = getOptionalType(type); - } - buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - if (bindingPattern.kind === 175) { - writePunctuation(writer, 17); - buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 18); - } - else if (bindingPattern.kind === 176) { - writePunctuation(writer, 21); - var elements = bindingPattern.elements; - buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - if (elements && elements.hasTrailingComma) { - writePunctuation(writer, 26); - } - writePunctuation(writer, 22); - } - } - function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isOmittedExpression(bindingElement)) { - return; - } - ts.Debug.assert(bindingElement.kind === 177); - if (bindingElement.propertyName) { - writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); - writePunctuation(writer, 56); - writeSpace(writer); - } - if (ts.isBindingPattern(bindingElement.name)) { - buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - if (bindingElement.dotDotDotToken) { - writePunctuation(writer, 24); - } - appendSymbolNameOnly(bindingElement.symbol, writer); - } - } - function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27); - buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 29); - } - } - function buildDisplayForCommaSeparatedList(list, writer, action) { - for (var i = 0; i < list.length; i++) { - if (i > 0) { - writePunctuation(writer, 26); - writeSpace(writer); - } - action(list[i]); - } - } - function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27); - var flags = 512; - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 26); - writeSpace(writer); - flags = 0; - } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags); - } - writePunctuation(writer, 29); - } - } - function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) { - writePunctuation(writer, 19); - if (thisParameter) { - buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack); - } - for (var i = 0; i < parameters.length; i++) { - if (i > 0 || thisParameter) { - writePunctuation(writer, 26); - writeSpace(writer); - } - buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack); - } - writePunctuation(writer, 20); - } - function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isIdentifierTypePredicate(predicate)) { - writer.writeParameter(predicate.parameterName); - } - else { - writeKeyword(writer, 99); - } - writeSpace(writer); - writeKeyword(writer, 126); - writeSpace(writer); - buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { - var returnType = getReturnTypeOfSignature(signature); - if (flags & 4096 && isTypeAny(returnType)) { - return; - } - if (flags & 16) { - writeSpace(writer); - writePunctuation(writer, 36); - } - else { - writePunctuation(writer, 56); - } - writeSpace(writer); - if (signature.typePredicate) { - buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); - } - else { - buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { - if (kind === 1) { - writeKeyword(writer, 94); - writeSpace(writer); - } - if (signature.target && (flags & 64)) { - buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, symbolStack); - } - buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); - buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); - } - function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 131); - writeSpace(writer); - } - writePunctuation(writer, 21); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 56); - writeSpace(writer); - switch (kind) { - case 1: - writeKeyword(writer, 133); - break; - case 0: - writeKeyword(writer, 136); - break; - } - writePunctuation(writer, 22); - writePunctuation(writer, 56); - writeSpace(writer); - buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); - writePunctuation(writer, 25); - writer.writeLine(); - } - } - return _displayBuilder || (_displayBuilder = { - buildSymbolDisplay: buildSymbolDisplay, - buildTypeDisplay: buildTypeDisplay, - buildTypeParameterDisplay: buildTypeParameterDisplay, - buildTypePredicateDisplay: buildTypePredicateDisplay, - buildParameterDisplay: buildParameterDisplay, - buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, - buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, - buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, - buildSignatureDisplay: buildSignatureDisplay, - buildIndexSignatureDisplay: buildIndexSignatureDisplay, - buildReturnTypeDisplay: buildReturnTypeDisplay - }); - } function isDeclarationVisible(node) { if (node) { var links = getNodeLinks(node); @@ -23762,63 +24060,63 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 177: + case 180: return isDeclarationVisible(node.parent.parent); - case 227: + case 230: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { return false; } - case 234: - case 230: - case 231: - case 232: - case 229: + case 237: case 233: - case 238: + case 234: + case 235: + case 232: + case 236: + case 241: if (ts.isExternalModuleAugmentation(node)) { return true; } var parent = getDeclarationContainer(node); if (!(ts.getCombinedModifierFlags(node) & 1) && - !(node.kind !== 238 && parent.kind !== 269 && parent.flags & 2097152)) { + !(node.kind !== 241 && parent.kind !== 272 && parent.flags & 2097152)) { return isGlobalSourceFile(parent); } return isDeclarationVisible(parent); - case 150: - case 149: - case 154: - case 155: - case 152: case 151: + case 150: + case 155: + case 156: + case 153: + case 152: if (ts.hasModifier(node, 8 | 16)) { return false; } - case 153: - case 157: - case 156: + case 154: case 158: - case 147: - case 235: - case 161: + case 157: + case 159: + case 148: + case 238: case 162: - case 164: - case 160: + case 163: case 165: + case 161: case 166: case 167: case 168: case 169: + case 172: return isDeclarationVisible(node.parent); - case 240: - case 241: case 243: - return false; - case 146: - case 269: - case 237: - return true; case 244: + case 246: + return false; + case 147: + case 272: + case 240: + return true; + case 247: return false; default: return false; @@ -23827,10 +24125,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 244) { + if (node.parent && node.parent.kind === 247) { exportSymbol = resolveName(node, node.escapedText, 107455 | 793064 | 1920 | 2097152, undefined, node, false); } - else if (node.parent.kind === 247) { + else if (node.parent.kind === 250) { exportSymbol = getTargetOfExportSpecifier(node.parent, 107455 | 793064 | 1920 | 2097152); } var result; @@ -23862,8 +24160,8 @@ var ts; function pushTypeResolution(target, propertyName) { var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { - var length_3 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_3; i++) { + var length_2 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_2; i++) { resolutionResults[i] = false; } return false; @@ -23897,6 +24195,10 @@ var ts; if (propertyName === 3) { return target.resolvedReturnType; } + if (propertyName === 4) { + var bc = target.resolvedBaseConstraint; + return bc && bc !== circularConstraintType; + } ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName); } function popTypeResolution() { @@ -23907,12 +24209,12 @@ var ts; function getDeclarationContainer(node) { node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 227: - case 228: + case 230: + case 231: + case 246: + case 245: + case 244: case 243: - case 242: - case 241: - case 240: return false; default: return true; @@ -23936,7 +24238,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false); } function isComputedNonLiteralName(name) { - return name.kind === 145 && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 146 && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 12288); }); @@ -23978,7 +24280,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 175) { + if (pattern.kind === 178) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -24002,7 +24304,8 @@ var ts; if (strictNullChecks && declaration.flags & 2097152 && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } - var declaredType = getTypeOfPropertyOfType(parentType, text); + var propType = getTypeOfPropertyOfType(parentType, text); + var declaredType = propType && getApparentTypeForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1) || getIndexTypeOfType(parentType, 0); @@ -24018,7 +24321,7 @@ var ts; type = createArrayType(elementType); } else { - var propName = "" + ts.indexOf(pattern.elements, declaration); + var propName = "" + pattern.elements.indexOf(declaration); type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : elementType; @@ -24037,7 +24340,7 @@ var ts; type = getTypeWithFacts(type, 131072); } return declaration.initializer ? - getUnionType([type, checkExpressionCached(declaration.initializer)], true) : + getUnionType([type, checkExpressionCached(declaration.initializer)], 2) : type; } function getTypeForDeclarationFromJSDocComment(declaration) { @@ -24053,31 +24356,31 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 178 && expr.elements.length === 0; + return expr.kind === 181 && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } return strictNullChecks && optional ? getOptionalType(type) : type; } function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { - if (declaration.parent.parent.kind === 216) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 219) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (32768 | 524288) ? indexType : stringType; } - if (declaration.parent.parent.kind === 217) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 220) { var forOfStatement = declaration.parent.parent; return checkRightHandSideOfForOf(forOfStatement.expression, forOfStatement.awaitModifier) || anyType; } if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } - var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - var declaredType = getTypeFromTypeNode(typeNode); - return addOptionality(declaredType, !!declaration.questionToken && includeOptionality); + var isOptional = !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken && includeOptionality; + var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (declaredType) { + return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) && - declaration.kind === 227 && !ts.isBindingPattern(declaration.name) && + declaration.kind === 230 && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1) && !(declaration.flags & 2097152)) { if (!(ts.getCombinedNodeFlags(declaration) & 2) && (!declaration.initializer || isNullOrUndefined(declaration.initializer))) { return autoType; @@ -24086,10 +24389,10 @@ var ts; return autoArrayType; } } - if (declaration.kind === 147) { + if (declaration.kind === 148) { var func = declaration.parent; - if (func.kind === 155 && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 154); + if (func.kind === 156 && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -24108,19 +24411,16 @@ var ts; type = getContextuallyTypedParameterType(declaration); } if (type) { - return addOptionality(type, !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } } if (declaration.initializer) { var type = checkDeclarationInitializer(declaration); - return addOptionality(type, !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } if (ts.isJsxAttribute(declaration)) { return trueType; } - if (declaration.kind === 266) { - return checkIdentifier(declaration.name); - } if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name, false, true); } @@ -24133,14 +24433,14 @@ var ts; var jsDocType; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - var expression = declaration.kind === 195 ? declaration : - declaration.kind === 180 ? ts.getAncestor(declaration, 195) : + var expression = declaration.kind === 198 ? declaration : + declaration.kind === 183 ? ts.getAncestor(declaration, 198) : undefined; if (!expression) { return unknownType; } if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99) { - if (ts.getThisContainer(expression, false).kind === 153) { + if (ts.getThisContainer(expression, false).kind === 154) { definedInConstructor = true; } else { @@ -24163,7 +24463,7 @@ var ts; types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); } } - var type = jsDocType || getUnionType(types, true); + var type = jsDocType || getUnionType(types, 2); return getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor)); } function getTypeFromBindingElement(element, includePatternInType, reportErrors) { @@ -24223,7 +24523,7 @@ var ts; return result; } function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 175 + return pattern.kind === 178 ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -24233,15 +24533,12 @@ var ts; if (reportErrors) { reportErrorsFromWidening(declaration, type); } - if (type.flags & 1024 && !declaration.type && type.symbol !== getSymbolOfNode(declaration)) { + if (type.flags & 1024 && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) { type = esSymbolType; } - if (declaration.kind === 265) { - return type; - } return getWidenedType(type); } - type = declaration.dotDotDotToken ? anyArrayType : anyType; + type = ts.isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType; if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { reportImplicitAnyError(declaration, type); @@ -24251,9 +24548,15 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 147 ? root.parent : root; + var memberDeclaration = root.kind === 148 ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } + function tryGetTypeFromEffectiveTypeNode(declaration) { + var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -24264,7 +24567,7 @@ var ts; if (ts.isCatchClauseVariableDeclarationOrBindingElement(declaration)) { return links.type = anyType; } - if (declaration.kind === 244) { + if (declaration.kind === 247) { return links.type = checkExpression(declaration.expression); } if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) { @@ -24274,13 +24577,42 @@ var ts; return unknownType; } var type = void 0; - if (declaration.kind === 195 || - declaration.kind === 180 && declaration.parent.kind === 195) { + if (declaration.kind === 198 || + declaration.kind === 183 && declaration.parent.kind === 198) { type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } - else { + else if (ts.isJSDocPropertyTag(declaration) + || ts.isPropertyAccessExpression(declaration) + || ts.isIdentifier(declaration) + || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration)) + || ts.isMethodSignature(declaration)) { + if (symbol.flags & (16 | 8192 | 32 | 384 | 512)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType; + } + else if (ts.isPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } + else if (ts.isJsxAttribute(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } + else if (ts.isShorthandPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0); + } + else if (ts.isObjectLiteralMethod(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0); + } + else if (ts.isParameter(declaration) + || ts.isPropertyDeclaration(declaration) + || ts.isPropertySignature(declaration) + || ts.isVariableDeclaration(declaration) + || ts.isBindingElement(declaration)) { type = getWidenedTypeForVariableLikeDeclaration(declaration, true); } + else { + ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration)); + } if (!popTypeResolution()) { type = reportCircularityError(symbol); } @@ -24290,7 +24622,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 154) { + if (accessor.kind === 155) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); } @@ -24311,8 +24643,8 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 154); - var setter = ts.getDeclarationOfKind(symbol, 155); + var getter = ts.getDeclarationOfKind(symbol, 155); + var setter = ts.getDeclarationOfKind(symbol, 156); if (getter && ts.isInJavaScriptFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -24353,7 +24685,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 154); + var getter_1 = ts.getDeclarationOfKind(symbol, 155); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -24437,6 +24769,9 @@ var ts; if (ts.getCheckFlags(symbol) & 1) { return getTypeOfInstantiatedSymbol(symbol); } + if (ts.getCheckFlags(symbol) & 2048) { + return getTypeOfReverseMappedSymbol(symbol); + } if (symbol.flags & (3 | 4)) { return getTypeOfVariableOrParameterOrProperty(symbol); } @@ -24490,44 +24825,48 @@ var ts; return undefined; } switch (node.kind) { - case 230: - case 200: - case 231: - case 156: + case 233: + case 203: + case 234: case 157: - case 151: - case 161: - case 162: - case 277: - case 229: + case 158: case 152: - case 187: - case 188: + case 162: + case 163: + case 280: case 232: - case 287: - case 173: + case 153: + case 190: + case 191: + case 235: + case 290: + case 176: + case 170: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 173) { + if (node.kind === 176) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } + else if (node.kind === 170) { + return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node) || ts.emptyArray); var thisType = includeThisTypes && - (node.kind === 230 || node.kind === 200 || node.kind === 231) && + (node.kind === 233 || node.kind === 203 || node.kind === 234) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } } } function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 231); + var declaration = symbol.flags & 32 ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 234); return getOuterTypeParameters(declaration); } function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 231 || node.kind === 230 || - node.kind === 200 || node.kind === 232) { + if (node.kind === 234 || node.kind === 233 || + node.kind === 203 || node.kind === 235) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -24628,10 +24967,10 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = ts.emptyArray; + type.resolvedBaseTypes = ts.resolvingEmptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (65536 | 262144 | 1))) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } var baseTypeNode = getBaseTypeNodeOfClass(type); var typeArgs = typeArgumentsFromTypeReferenceNode(baseTypeNode); @@ -24648,22 +24987,25 @@ var ts; var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); - return; + return type.resolvedBaseTypes = ts.emptyArray; } baseType = getReturnTypeOfSignature(constructors[0]); } if (baseType === unknownType) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { - error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); - return; + error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 2)); + return type.resolvedBaseTypes = ts.emptyArray; } - type.resolvedBaseTypes = [baseType]; + if (type.resolvedBaseTypes === ts.resolvingEmptyArray) { + type.members = undefined; + } + return type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { var outerTypeParameters = type.outerTypeParameters; @@ -24675,14 +25017,14 @@ var ts; return true; } function isValidBaseType(type) { - return type.flags & (65536 | 33554432 | 1) && !isGenericMappedType(type) || + return type.flags & (65536 | 134217728 | 1) && !isGenericMappedType(type) || type.flags & 262144 && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 234 && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -24697,7 +25039,7 @@ var ts; } } else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1)); + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 2)); } } else { @@ -24711,7 +25053,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231) { + if (declaration.kind === 234) { if (declaration.flags & 64) { return false; } @@ -24762,9 +25104,9 @@ var ts; return unknownType; } var declaration = ts.find(symbol.declarations, function (d) { - return d.kind === 288 || d.kind === 232; + return d.kind === 291 || d.kind === 235; }); - var typeNode = declaration.kind === 288 ? declaration.typeExpression : declaration.type; + var typeNode = declaration.kind === 291 ? declaration.typeExpression : declaration.type; var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType; if (popTypeResolution()) { var typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); @@ -24791,7 +25133,7 @@ var ts; case 9: case 8: return true; - case 193: + case 196: return expr.operator === 38 && expr.operand.kind === 8; case 71: @@ -24808,7 +25150,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233) { + if (declaration.kind === 236) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 9) { @@ -24835,7 +25177,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233) { + if (declaration.kind === 236) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)); @@ -24845,7 +25187,7 @@ var ts; } } if (memberTypeList.length) { - var enumType_1 = getUnionType(memberTypeList, false, symbol, undefined); + var enumType_1 = getUnionType(memberTypeList, 1, symbol, undefined); if (enumType_1.flags & 131072) { enumType_1.flags |= 256; enumType_1.symbol = symbol; @@ -24910,20 +25252,20 @@ var ts; function isThislessType(node) { switch (node.kind) { case 119: - case 136: - case 133: - case 122: case 137: case 134: + case 122: + case 138: + case 135: case 105: - case 139: + case 140: case 95: - case 130: - case 174: + case 131: + case 177: return true; - case 165: + case 166: return isThislessType(node.elementType); - case 160: + case 161: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -24933,11 +25275,11 @@ var ts; } function isThislessVariableLikeDeclaration(node) { var typeNode = ts.getEffectiveTypeAnnotationNode(node); - return typeNode ? isThislessType(typeNode) : !node.initializer; + return typeNode ? isThislessType(typeNode) : !ts.hasInitializer(node); } function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); - return (node.kind === 153 || (returnType && isThislessType(returnType))) && + return (node.kind === 154 || (returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter)); } @@ -24946,12 +25288,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 150: - case 149: - return isThislessVariableLikeDeclaration(declaration); - case 152: case 151: + case 150: + return isThislessVariableLikeDeclaration(declaration); case 153: + case 152: + case 154: return isThislessFunctionLikeDeclaration(declaration); } } @@ -25101,18 +25443,19 @@ var ts; } return symbol; } - function getTypeWithThisArgument(type, thisArgument) { + function getTypeWithThisArgument(type, thisArgument, needApparentType) { if (ts.getObjectFlags(type) & 4) { var target = type.target; var typeArguments = type.typeArguments; if (ts.length(target.typeParameters) === ts.length(typeArguments)) { - return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + var ref = createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + return needApparentType ? getApparentType(ref) : ref; } } else if (type.flags & 262144) { - return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); })); } - return type; + return needApparentType ? getApparentType(type) : type; } function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) { var mapper; @@ -25142,6 +25485,7 @@ var ts; if (source.symbol && members === getMembersOfSymbol(source.symbol)) { members = ts.createSymbolTable(source.declaredProperties); } + setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); var thisArgument = ts.lastOrUndefined(typeArguments); for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; @@ -25169,21 +25513,23 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { + function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.thisParameter = thisParameter; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; + sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasLiteralTypes = hasLiteralTypes; + sig.target = undefined; + sig.mapper = undefined; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); + return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, undefined, undefined, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); } function getDefaultConstructSignatures(classType) { var baseConstructorType = getBaseConstructorTypeOfClass(classType); @@ -25200,7 +25546,7 @@ var ts; var baseSig = baseSignatures_1[_i]; var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); var typeParamCount = ts.length(baseSig.typeParameters); - if (isJavaScript || (typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount)) { + if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; @@ -25250,12 +25596,13 @@ var ts; if (unionSignatures) { var s = signature; if (unionSignatures.length > 1) { - s = cloneSignature(signature); + var thisParameter = signature.thisParameter; if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { - var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), true); - s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); + var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType; }), 2); + thisParameter = createSymbolWithType(signature.thisParameter, thisType); } - s.resolvedReturnType = undefined; + s = cloneSignature(signature); + s.thisParameter = thisParameter; s.unionSignatures = unionSignatures; } (result || (result = [])).push(s); @@ -25277,7 +25624,7 @@ var ts; indexTypes.push(indexInfo.type); isAnyReadonly = isAnyReadonly || indexInfo.isReadonly; } - return createIndexInfo(getUnionType(indexTypes, true), isAnyReadonly); + return createIndexInfo(getUnionType(indexTypes, 2), isAnyReadonly); } function resolveUnionTypeMembers(type) { var callSignatures = getUnionSignatures(type.types, 0); @@ -25360,6 +25707,7 @@ var ts; if (symbol.exports) { members = getExportsOfSymbol(symbol); } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined); if (symbol.flags & 32) { var classType = getDeclaredTypeOfClassOrInterface(symbol); var baseConstructorType = getBaseConstructorTypeOfClass(classType); @@ -25386,19 +25734,36 @@ var ts; } } } + function resolveReverseMappedTypeMembers(type) { + var indexInfo = getIndexInfoOfType(type.source, 0); + var modifiers = getMappedTypeModifiers(type.mappedType); + var readonlyMask = modifiers & 1 ? false : true; + var optionalMask = modifiers & 4 ? 0 : 16777216; + var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); + var members = ts.createSymbolTable(); + for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { + var prop = _a[_i]; + var checkFlags = 2048 | (readonlyMask && isReadonlySymbol(prop) ? 8 : 0); + var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.escapedName, checkFlags); + inferredProp.declarations = prop.declarations; + inferredProp.propertyType = getTypeOfSymbol(prop); + inferredProp.mappedType = type.mappedType; + members.set(prop.escapedName, inferredProp); + } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); + } function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); var stringIndexInfo; setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var templateType = getTemplateTypeFromMappedType(type); + var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); - var templateReadonly = !!type.declaration.readonlyToken; - var templateOptional = !!type.declaration.questionToken; + var templateModifiers = getMappedTypeModifiers(type); var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 && - constraintDeclaration.operator === 127) { + if (constraintDeclaration.kind === 174 && + constraintDeclaration.operator === 128) { for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { var propertySymbol = _a[_i]; addMemberForKeyType(getLiteralTypeFromPropertyName(propertySymbol), propertySymbol); @@ -25408,7 +25773,7 @@ var ts; } } else { - var keyType = constraintType.flags & 1081344 ? getApparentType(constraintType) : constraintType; + var keyType = constraintType.flags & 7372800 ? getApparentType(constraintType) : constraintType; var iterationType = keyType.flags & 524288 ? getIndexType(getApparentType(keyType.type)) : keyType; forEachType(iterationType, addMemberForKeyType); } @@ -25424,10 +25789,14 @@ var ts; if (t.flags & 32) { var propName = ts.escapeLeadingUnderscores(t.value); var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 16777216); - var checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 : 0; - var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, checkFlags); - prop.type = propType; + var isOptional = !!(templateModifiers & 4 || + !(templateModifiers & 8) && modifiersProp && modifiersProp.flags & 16777216); + var isReadonly = !!(templateModifiers & 1 || + !(templateModifiers & 2) && modifiersProp && isReadonlySymbol(modifiersProp)); + var prop = createSymbol(4 | (isOptional ? 16777216 : 0), propName, isReadonly ? 8 : 0); + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 ? getTypeWithFacts(propType, 131072) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; @@ -25436,7 +25805,7 @@ var ts; members.set(propName, prop); } else if (t.flags & (1 | 2)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1)); } } } @@ -25451,14 +25820,14 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4)), type.mapper || identityMapper) : unknownType); } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 && - constraintDeclaration.operator === 127) { + if (constraintDeclaration.kind === 174 && + constraintDeclaration.operator === 128) { type.modifiersType = instantiateType(getTypeFromTypeNode(constraintDeclaration.type), type.mapper || identityMapper); } else { @@ -25471,16 +25840,21 @@ var ts; return type.modifiersType; } function getMappedTypeModifiers(type) { - return (type.declaration.readonlyToken ? 1 : 0) | - (type.declaration.questionToken ? 2 : 0); + var declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 ? 2 : 1 : 0) | + (declaration.questionToken ? declaration.questionToken.kind === 38 ? 8 : 4 : 0); } - function getCombinedMappedTypeModifiers(type) { + function getMappedTypeOptionality(type) { + var modifiers = getMappedTypeModifiers(type); + return modifiers & 8 ? -1 : modifiers & 4 ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type) { + var optionality = getMappedTypeOptionality(type); var modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type) { - return ts.getObjectFlags(type) & 32 && !!type.declaration.questionToken; + return !!(ts.getObjectFlags(type) & 32 && getMappedTypeModifiers(type) & 4); } function isGenericMappedType(type) { return ts.getObjectFlags(type) & 32 && isGenericIndexType(getConstraintTypeFromMappedType(type)); @@ -25494,6 +25868,9 @@ var ts; else if (type.objectFlags & 3) { resolveClassOrInterfaceMembers(type); } + else if (type.objectFlags & 2048) { + resolveReverseMappedTypeMembers(type); + } else if (type.objectFlags & 16) { resolveAnonymousTypeMembers(type); } @@ -25564,7 +25941,9 @@ var ts; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { - props.set(escapedName, createUnionOrIntersectionProperty(unionType, escapedName)); + var prop = createUnionOrIntersectionProperty(unionType, escapedName); + if (prop) + props.set(escapedName, prop); } } } @@ -25573,22 +25952,44 @@ var ts; function getConstraintOfType(type) { return type.flags & 32768 ? getConstraintOfTypeParameter(type) : type.flags & 1048576 ? getConstraintOfIndexedAccess(type) : - getBaseConstraintOfType(type); + type.flags & 2097152 ? getConstraintOfConditionalType(type) : + getBaseConstraintOfType(type); } function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { - var transformed = getTransformedIndexedAccessType(type); + var transformed = getSimplifiedIndexedAccessType(type); if (transformed) { return transformed; } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); + if (baseIndexType === stringType && !getIndexInfoOfType(baseObjectType || type.objectType, 0)) { + return undefined; + } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } + function getDefaultConstraintOfConditionalType(type) { + return getUnionType([type.trueType, type.falseType]); + } + function getConstraintOfDistributiveConditionalType(type) { + if (isDistributiveConditionalType(type)) { + var constraint = getConstraintOfType(type.checkType); + if (constraint) { + var target = type.target || type; + var mapper = createTypeMapper([target.checkType], [constraint]); + var combinedMapper = type.mapper ? combineTypeMappers(mapper, type.mapper) : mapper; + return instantiateType(target, combinedMapper); + } + } + return undefined; + } + function getConstraintOfConditionalType(type) { + return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); + } function getBaseConstraintOfType(type) { - if (type.flags & (1081344 | 393216)) { + if (type.flags & (7372800 | 393216)) { var constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; @@ -25603,29 +26004,30 @@ var ts; return getResolvedBaseConstraint(type) !== circularConstraintType; } function getResolvedBaseConstraint(type) { - var typeStack; var circular; if (!type.resolvedBaseConstraint) { - typeStack = []; var constraint = getBaseConstraint(type); type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); } return type.resolvedBaseConstraint; function getBaseConstraint(t) { - if (ts.contains(typeStack, t)) { + if (!pushTypeResolution(t, 4)) { circular = true; return undefined; } - typeStack.push(t); var result = computeBaseConstraint(t); - typeStack.pop(); + if (!popTypeResolution()) { + circular = true; + return undefined; + } return result; } function computeBaseConstraint(t) { if (t.flags & 32768) { var constraint = getConstraintFromTypeParameter(t); - return t.isThisType ? constraint : - constraint ? getBaseConstraint(constraint) : undefined; + return t.isThisType || !constraint ? + constraint : + getBaseConstraint(constraint); } if (t.flags & 393216) { var types = t.types; @@ -25645,7 +26047,7 @@ var ts; return stringType; } if (t.flags & 1048576) { - var transformed = getTransformedIndexedAccessType(t); + var transformed = getSimplifiedIndexedAccessType(t); if (transformed) { return getBaseConstraint(transformed); } @@ -25654,6 +26056,12 @@ var ts; var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (t.flags & 2097152) { + return getBaseConstraint(getConstraintOfConditionalType(t)); + } + if (t.flags & 4194304) { + return getBaseConstraint(t.substitute); + } if (isGenericMappedType(t)) { return emptyObjectType; } @@ -25661,7 +26069,7 @@ var ts; } } function getApparentTypeOfIntersectionType(type) { - return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type, true)); } function getResolvedTypeParameterDefault(typeParameter) { if (!typeParameter.default) { @@ -25694,25 +26102,24 @@ var ts; return !!(typeParameter.symbol && ts.forEach(typeParameter.symbol.declarations, function (decl) { return ts.isTypeParameterDeclaration(decl) && decl.default; })); } function getApparentType(type) { - var t = type.flags & 1081344 ? getBaseConstraintOfType(type) || emptyObjectType : type; + var t = type.flags & 7897088 ? getBaseConstraintOfType(type) || emptyObjectType : type; return t.flags & 262144 ? getApparentTypeOfIntersectionType(t) : t.flags & 524322 ? globalStringType : t.flags & 84 ? globalNumberType : t.flags & 136 ? globalBooleanType : t.flags & 1536 ? getGlobalESSymbolType(languageVersion >= 2) : - t.flags & 33554432 ? emptyObjectType : + t.flags & 134217728 ? emptyObjectType : t; } function createUnionOrIntersectionProperty(containingType, name) { var props; - var types = containingType.types; var isUnion = containingType.flags & 131072; var excludeModifiers = isUnion ? 24 : 0; var commonFlags = isUnion ? 0 : 16777216; var syntheticFlag = 4; var checkFlags = 0; - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var current = types_5[_i]; + for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) { + var current = _a[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); @@ -25743,8 +26150,8 @@ var ts; var propTypes = []; var declarations = []; var commonType = undefined; - for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { - var prop = props_1[_a]; + for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { + var prop = props_1[_b]; if (prop.declarations) { ts.addRange(declarations, prop.declarations); } @@ -25835,7 +26242,7 @@ var ts; } } if (propTypes.length) { - return getUnionType(propTypes, true); + return getUnionType(propTypes, 2); } } return undefined; @@ -25859,7 +26266,7 @@ var ts; } function isJSDocOptionalParameter(node) { if (ts.isInJavaScriptFile(node)) { - if (node.type && node.type.kind === 276) { + if (node.type && node.type.kind === 279) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -25870,7 +26277,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 276; + return paramTag.typeExpression.type.kind === 279; } } } @@ -25888,9 +26295,8 @@ var ts; return true; } if (node.initializer) { - var signatureDeclaration = node.parent; - var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -25898,27 +26304,26 @@ var ts; if (iife) { return !node.type && !node.dotDotDotToken && - ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + node.parent.parameters.indexOf(node) >= iife.arguments.length; } return false; } function createTypePredicateFromTypePredicateNode(node) { var parameterName = node.parameterName; + var type = getTypeFromTypeNode(node.type); if (parameterName.kind === 71) { - return { - kind: 1, - parameterName: parameterName ? parameterName.escapedText : undefined, - parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, - type: getTypeFromTypeNode(node.type) - }; + return createIdentifierTypePredicate(parameterName && parameterName.escapedText, parameterName && getTypePredicateParameterIndex(node.parent.parameters, parameterName), type); } else { - return { - kind: 0, - type: getTypeFromTypeNode(node.type) - }; + return createThisTypePredicate(type); } } + function createIdentifierTypePredicate(parameterName, parameterIndex, type) { + return { kind: 1, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; + } + function createThisTypePredicate(type) { + return { kind: 0, type: type }; + } function getMinTypeArgumentCount(typeParameters) { var minTypeArgumentCount = 0; if (typeParameters) { @@ -25979,7 +26384,7 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 174) { + if (param.type && param.type.kind === 177) { hasLiteralTypes = true; } var isOptionalParameter_1 = param.initializer || param.questionToken || param.dotDotDotToken || @@ -25990,32 +26395,29 @@ var ts; minArgumentCount = parameters.length; } } - if ((declaration.kind === 154 || declaration.kind === 155) && + if ((declaration.kind === 155 || declaration.kind === 156) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 154 ? 155 : 154; + var otherKind = declaration.kind === 155 ? 156 : 155; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 153 ? + var classType = declaration.kind === 154 ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 159 ? - createTypePredicateFromTypePredicateNode(declaration.type) : - undefined; var hasRestLikeParameter = ts.hasRestParameter(declaration) || ts.isInJavaScriptFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters); - links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); + links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, undefined, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); } return links.resolvedSignature; } function maybeAddJsSyntheticRestParameter(declaration, parameters) { var lastParam = ts.lastOrUndefined(declaration.parameters); var lastParamTags = lastParam && ts.getJSDocParameterTags(lastParam); - var lastParamVariadicType = lastParamTags && ts.firstDefined(lastParamTags, function (p) { + var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); if (!lastParamVariadicType && !containsArgumentsReference(declaration)) { @@ -26041,8 +26443,8 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 154 && !hasNonBindableDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 155); + if (declaration.kind === 155 && !hasNonBindableDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { @@ -26066,11 +26468,11 @@ var ts; switch (node.kind) { case 71: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 150: - case 152: - case 154: + case 151: + case 153: case 155: - return node.name.kind === 145 + case 156: + return node.name.kind === 146 && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); @@ -26084,20 +26486,20 @@ var ts; for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 161: case 162: - case 229: - case 152: - case 151: + case 163: + case 232: case 153: - case 156: + case 152: + case 154: case 157: case 158: - case 154: + case 159: case 155: - case 187: - case 188: - case 277: + case 156: + case 190: + case 191: + case 280: if (i > 0 && node.body) { var previous = symbol.declarations[i - 1]; if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { @@ -26124,6 +26526,28 @@ var ts; return getTypeOfSymbol(signature.thisParameter); } } + function signatureHasTypePredicate(signature) { + return getTypePredicateOfSignature(signature) !== undefined; + } + function getTypePredicateOfSignature(signature) { + if (!signature.resolvedTypePredicate) { + if (signature.target) { + var targetTypePredicate = getTypePredicateOfSignature(signature.target); + signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; + } + else if (signature.unionSignatures) { + signature.resolvedTypePredicate = getUnionTypePredicate(signature.unionSignatures) || noTypePredicate; + } + else { + var declaration = signature.declaration; + signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 ? + createTypePredicateFromTypePredicateNode(declaration.type) : + noTypePredicate; + } + ts.Debug.assert(!!signature.resolvedTypePredicate); + } + return signature.resolvedTypePredicate === noTypePredicate ? undefined : signature.resolvedTypePredicate; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3)) { @@ -26134,7 +26558,7 @@ var ts; type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), true); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2); } else { type = getReturnTypeFromBody(signature.declaration); @@ -26208,7 +26632,7 @@ var ts; } function getOrCreateTypeFromSignature(signature) { if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 153 || signature.declaration.kind === 157; + var isConstructor = signature.declaration.kind === 154 || signature.declaration.kind === 158; var type = createObjectType(16); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -26222,7 +26646,7 @@ var ts; return symbol.members.get("__index"); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 ? 133 : 136; + var syntaxKind = kind === 1 ? 134 : 137; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -26249,7 +26673,33 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return type.symbol && ts.getDeclarationOfKind(type.symbol, 146).constraint; + return type.symbol && ts.getDeclarationOfKind(type.symbol, 147).constraint; + } + function getInferredTypeParameterConstraint(typeParameter) { + var inferences; + if (typeParameter.symbol) { + for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (declaration.parent.kind === 171 && declaration.parent.parent.kind === 161) { + var typeReference = declaration.parent.parent; + var typeParameters = getTypeParametersForTypeReference(typeReference); + if (typeParameters) { + var index = typeReference.typeArguments.indexOf(declaration.parent); + if (index < typeParameters.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); + if (declaredConstraint) { + var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters)); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts.append(inferences, constraint); + } + } + } + } + } + } + } + return inferences && getIntersectionType(inferences); } function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { @@ -26259,23 +26709,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : + getInferredTypeParameterConstraint(typeParameter) || noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 146).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_4 = types.length; + var length_3 = types.length; var i = 0; - while (i < length_4) { + while (i < length_3) { var startId = types[i].id; var count = 1; - while (i + count < length_4 && types[i + count].id === startId + count) { + while (i + count < length_3 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -26292,13 +26743,13 @@ var ts; } function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } } - return result & 29360128; + return result & 117440512; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); @@ -26332,7 +26783,7 @@ var ts; var isJs = ts.isInJavaScriptFile(node); var isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - var missingAugmentsTag = isJs && node.parent.kind !== 282; + var missingAugmentsTag = isJs && node.parent.kind !== 285; var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag @@ -26340,7 +26791,7 @@ var ts; : missingAugmentsTag ? ts.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; - var typeStr = typeToString(type, undefined, 1); + var typeStr = typeToString(type, undefined, 2); error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length); if (!isJs) { return unknownType; @@ -26349,11 +26800,7 @@ var ts; var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs)); return createTypeReference(type, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); @@ -26380,17 +26827,13 @@ var ts; } return getTypeAliasInstantiation(symbol, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeReferenceName(node) { switch (node.kind) { - case 160: + case 161: return node.typeName; - case 202: + case 205: var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; @@ -26414,12 +26857,10 @@ var ts; return type; } var res = tryGetDeclaredTypeOfSymbol(symbol); - if (res !== undefined) { - if (typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return res; + if (res) { + return checkNoTypeArguments(node, symbol) ? + res.flags & 32768 ? getConstrainedTypeParameter(res, node) : res : + unknownType; } if (!(symbol.flags & 107455 && isJSDocTypeReference(node))) { return unknownType; @@ -26447,42 +26888,79 @@ var ts; return getInferredClassType(symbol); } } + function getSubstitutionType(typeParameter, substitute) { + var result = createType(4194304); + result.typeParameter = typeParameter; + result.substitute = substitute; + return result; + } + function getConstrainedTypeParameter(typeParameter, node) { + var constraints; + while (ts.isPartOfTypeNode(node)) { + var parent = node.parent; + if (parent.kind === 170 && node === parent.trueType) { + if (getTypeFromTypeNode(parent.checkType) === typeParameter) { + constraints = ts.append(constraints, getTypeFromTypeNode(parent.extendsType)); + } + } + node = parent; + } + return constraints ? getSubstitutionType(typeParameter, getIntersectionType(ts.append(constraints, typeParameter))) : typeParameter; + } function isJSDocTypeReference(node) { - return node.flags & 1048576 && node.kind === 160; + return node.flags & 1048576 && node.kind === 161; + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : ts.declarationNameToString(node.typeName)); + return false; + } + return true; } function getIntendedTypeFromJSDocTypeReference(node) { if (ts.isIdentifier(node.typeName)) { - if (node.typeName.escapedText === "Object") { - if (ts.isJSDocIndexSignature(node)) { - var indexed = getTypeFromTypeNode(node.typeArguments[0]); - var target = getTypeFromTypeNode(node.typeArguments[1]); - var index = createIndexInfo(target, false); - return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); - } - return anyType; - } + var typeArgs = node.typeArguments; switch (node.typeName.escapedText) { case "String": + checkNoTypeArguments(node); return stringType; case "Number": + checkNoTypeArguments(node); return numberType; case "Boolean": + checkNoTypeArguments(node); return booleanType; case "Void": + checkNoTypeArguments(node); return voidType; case "Undefined": + checkNoTypeArguments(node); return undefinedType; case "Null": + checkNoTypeArguments(node); return nullType; case "Function": case "function": + checkNoTypeArguments(node); return globalFunctionType; case "Array": case "array": - return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined; + return !typeArgs || !typeArgs.length ? anyArrayType : undefined; case "Promise": case "promise": - return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + return !typeArgs || !typeArgs.length ? createPromiseType(anyType) : undefined; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var index = createIndexInfo(target, false); + return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); + } + return anyType; + } + checkNoTypeArguments(node); + return anyType; } } } @@ -26525,9 +27003,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 230: - case 231: case 233: + case 234: + case 236: return declaration; } } @@ -26694,37 +27172,37 @@ var ts; return true; } combined |= t.flags; - if (combined & 12288 && combined & (65536 | 33554432)) { + if (combined & 12288 && combined & (65536 | 134217728)) { return true; } } return false; } - function addTypeToUnion(typeSet, type) { + function addTypeToUnion(typeSet, includes, type) { var flags = type.flags; if (flags & 131072) { - addTypesToUnion(typeSet, type.types); + includes = addTypesToUnion(typeSet, includes, type.types); } else if (flags & 1) { - typeSet.containsAny = true; + includes |= 1; } else if (!strictNullChecks && flags & 12288) { if (flags & 4096) - typeSet.containsUndefined = true; + includes |= 2; if (flags & 8192) - typeSet.containsNull = true; - if (!(flags & 4194304)) - typeSet.containsNonWideningType = true; + includes |= 4; + if (!(flags & 16777216)) + includes |= 16; } else if (!(flags & 16384 || flags & 262144 && isEmptyIntersectionType(type))) { if (flags & 2) - typeSet.containsString = true; + includes |= 32; if (flags & 4) - typeSet.containsNumber = true; + includes |= 64; if (flags & 512) - typeSet.containsESSymbol = true; + includes |= 128; if (flags & 1120) - typeSet.containsLiteralOrUniqueESSymbol = true; + includes |= 256; var len = typeSet.length; var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues); if (index < 0) { @@ -26734,16 +27212,18 @@ var ts; } } } + return includes; } - function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var type = types_7[_i]; - addTypeToUnion(typeSet, type); + function addTypesToUnion(typeSet, includes, types) { + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; + includes = addTypeToUnion(typeSet, includes, type); } + return includes; } function containsIdenticalType(types, type) { - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -26787,21 +27267,22 @@ var ts; } } } - function removeRedundantLiteralTypes(types) { + function removeRedundantLiteralTypes(types, includes) { var i = types.length; while (i > 0) { i--; var t = types[i]; - var remove = t.flags & 32 && types.containsString || - t.flags & 64 && types.containsNumber || - t.flags & 1024 && types.containsESSymbol || - t.flags & 96 && t.flags & 2097152 && containsType(types, t.regularType); + var remove = t.flags & 32 && includes & 32 || + t.flags & 64 && includes & 64 || + t.flags & 1024 && includes & 128 || + t.flags & 96 && t.flags & 8388608 && containsType(types, t.regularType); if (remove) { ts.orderedRemoveItemAt(types, i); } } } - function getUnionType(types, subtypeReduction, aliasSymbol, aliasTypeArguments) { + function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments) { + if (unionReduction === void 0) { unionReduction = 1; } if (types.length === 0) { return neverType; } @@ -26809,23 +27290,59 @@ var ts; return types[0]; } var typeSet = []; - addTypesToUnion(typeSet, types); - if (typeSet.containsAny) { + var includes = addTypesToUnion(typeSet, 0, types); + if (includes & 1) { return anyType; } - if (subtypeReduction) { - removeSubtypes(typeSet); - } - else if (typeSet.containsLiteralOrUniqueESSymbol) { - removeRedundantLiteralTypes(typeSet); + switch (unionReduction) { + case 1: + if (includes & 256) { + removeRedundantLiteralTypes(typeSet, includes); + } + break; + case 2: + removeSubtypes(typeSet); + break; } if (typeSet.length === 0) { - return typeSet.containsNull ? typeSet.containsNonWideningType ? nullType : nullWideningType : - typeSet.containsUndefined ? typeSet.containsNonWideningType ? undefinedType : undefinedWideningType : + return includes & 4 ? includes & 16 ? nullType : nullWideningType : + includes & 2 ? includes & 16 ? undefinedType : undefinedWideningType : neverType; } return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments); } + function getUnionTypePredicate(signatures) { + var first; + var types = []; + for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { + var sig = signatures_2[_i]; + var pred = getTypePredicateOfSignature(sig); + if (!pred) { + continue; + } + if (first) { + if (!typePredicateKindsMatch(first, pred)) { + return undefined; + } + } + else { + first = pred; + } + types.push(pred.type); + } + if (!first) { + return undefined; + } + var unionType = getUnionType(types); + return ts.isIdentifierTypePredicate(first) + ? createIdentifierTypePredicate(first.parameterName, first.parameterIndex, unionType) + : createThisTypePredicate(unionType); + } + function typePredicateKindsMatch(a, b) { + return ts.isIdentifierTypePredicate(a) + ? ts.isIdentifierTypePredicate(b) && a.parameterIndex === b.parameterIndex + : !ts.isIdentifierTypePredicate(b); + } function getUnionTypeFromSortedList(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { return neverType; @@ -26848,64 +27365,67 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), false, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); } return links.resolvedType; } - function addTypeToIntersection(typeSet, type) { - if (type.flags & 262144) { - addTypesToIntersection(typeSet, type.types); + function addTypeToIntersection(typeSet, includes, type) { + var flags = type.flags; + if (flags & 262144) { + includes = addTypesToIntersection(typeSet, includes, type.types); } - else if (type.flags & 1) { - typeSet.containsAny = true; + else if (flags & 1) { + includes |= 1; } - else if (type.flags & 16384) { - typeSet.containsNever = true; + else if (flags & 16384) { + includes |= 8; } else if (ts.getObjectFlags(type) & 16 && isEmptyObjectType(type)) { - typeSet.containsEmptyObject = true; + includes |= 1024; } - else if ((strictNullChecks || !(type.flags & 12288)) && !ts.contains(typeSet, type)) { - if (type.flags & 65536) { - typeSet.containsObjectType = true; + else if ((strictNullChecks || !(flags & 12288)) && !ts.contains(typeSet, type)) { + if (flags & 65536) { + includes |= 512; } - if (type.flags & 131072 && typeSet.unionIndex === undefined) { - typeSet.unionIndex = typeSet.length; + if (flags & 131072) { + includes |= 2048; } - if (!(type.flags & 65536 && type.objectFlags & 16 && + if (!(flags & 65536 && type.objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192) && containsIdenticalType(typeSet, type))) { typeSet.push(type); } } + return includes; } - function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; - addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type)); + function addTypesToIntersection(typeSet, includes, types) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } + return includes; } function getIntersectionType(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { return emptyObjectType; } var typeSet = []; - addTypesToIntersection(typeSet, types); - if (typeSet.containsNever) { + var includes = addTypesToIntersection(typeSet, 0, types); + if (includes & 8) { return neverType; } - if (typeSet.containsAny) { + if (includes & 1) { return anyType; } - if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + if (includes & 1024 && !(includes & 512)) { typeSet.push(emptyObjectType); } if (typeSet.length === 1) { return typeSet[0]; } - var unionIndex = typeSet.unionIndex; - if (unionIndex !== undefined) { - var unionType = typeSet[unionIndex]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), false, aliasSymbol, aliasTypeArguments); + if (includes & 2048) { + var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072) !== 0; }); + var unionType = typeSet[unionIndex_1]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); var type = intersectionTypes.get(id); @@ -26934,7 +27454,7 @@ var ts; return type.resolvedIndexType; } function getLiteralTypeFromPropertyName(prop) { - return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 || ts.startsWith(prop.escapedName, "__@") ? + return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 || ts.isKnownSymbol(prop) ? neverType : getLiteralType(ts.symbolName(prop)); } @@ -26942,10 +27462,11 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return maybeTypeOfKind(type, 1081344) ? getIndexTypeForGenericType(type) : + return maybeTypeOfKind(type, 7372800) ? getIndexTypeForGenericType(type) : ts.getObjectFlags(type) & 32 ? getConstraintTypeFromMappedType(type) : - type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType : - getLiteralTypeFromPropertyNames(type); + type === wildcardType ? wildcardType : + type.flags & 1 || getIndexInfoOfType(type, 0) ? stringType : + getLiteralTypeFromPropertyNames(type); } function getIndexTypeOrString(type) { var indexType = getIndexType(type); @@ -26955,11 +27476,11 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 127: + case 128: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 140: - links.resolvedType = node.type.kind === 137 + case 141: + links.resolvedType = node.type.kind === 138 ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : unknownType; break; @@ -26974,7 +27495,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 181 ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 184 ? accessNode : undefined; var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, false) ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : @@ -26983,6 +27504,7 @@ var ts; var prop = getPropertyOfType(objectType, propName); if (prop) { if (accessExpression) { + markPropertyAsReferenced(prop, accessExpression, accessExpression.expression.kind === 99); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); return unknownType; @@ -26996,7 +27518,7 @@ var ts; } if (!(indexType.flags & 12288) && isTypeAssignableToKind(indexType, 524322 | 84 | 1536)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } var indexInfo = isTypeAssignableToKind(indexType, 84) && getIndexInfoOfType(objectType, 1) || getIndexInfoOfType(objectType, 0) || @@ -27020,7 +27542,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 181 ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 184 ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 | 64)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } @@ -27035,15 +27557,10 @@ var ts; return anyType; } function isGenericObjectType(type) { - return type.flags & 1081344 ? true : - ts.getObjectFlags(type) & 32 ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : - type.flags & 393216 ? ts.forEach(type.types, isGenericObjectType) : - false; + return maybeTypeOfKind(type, 7372800 | 536870912); } function isGenericIndexType(type) { - return type.flags & (1081344 | 524288) ? true : - type.flags & 393216 ? ts.forEach(type.types, isGenericIndexType) : - false; + return maybeTypeOfKind(type, 7372800 | 524288); } function isStringIndexOnlyType(type) { if (type.flags & 65536 && !isGenericMappedType(type)) { @@ -27054,35 +27571,52 @@ var ts; } return false; } - function getTransformedIndexedAccessType(type) { + function isMappedTypeToNever(type) { + return ts.getObjectFlags(type) & 32 && getTemplateTypeFromMappedType(type) === neverType; + } + function getSimplifiedIndexedAccessType(type) { var objectType = type.objectType; - if (objectType.flags & 262144 && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { - var regularTypes = []; - var stringIndexTypes = []; - for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { - var t = _a[_i]; - if (isStringIndexOnlyType(t)) { - stringIndexTypes.push(getIndexTypeOfType(t, 0)); - } - else { - regularTypes.push(t); + if (objectType.flags & 262144 && isGenericObjectType(objectType)) { + if (ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0)); + } + else { + regularTypes.push(t); + } } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + if (ts.some(objectType.types, isMappedTypeToNever)) { + var nonNeverTypes = ts.filter(objectType.types, function (t) { return !isMappedTypeToNever(t); }); + return getIndexedAccessType(getIntersectionType(nonNeverTypes), type.indexType); } - return getUnionType([ - getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), - getIntersectionType(stringIndexTypes) - ]); } if (isGenericMappedType(objectType)) { - var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var objectTypeMapper = objectType.mapper; - var templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + return substituteIndexedMappedType(objectType, type); + } + if (objectType.flags & 32768) { + var constraint = getConstraintFromTypeParameter(objectType); + if (constraint && isGenericMappedType(constraint)) { + return substituteIndexedMappedType(constraint, type); + } } return undefined; } + function substituteIndexedMappedType(objectType, type) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + var templateMapper = objectType.mapper ? combineTypeMappers(objectType.mapper, mapper) : mapper; + return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + } function getIndexedAccessType(objectType, indexType, accessNode) { - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 181) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 184) && isGenericObjectType(objectType)) { if (objectType.flags & 1) { return objectType; } @@ -27127,6 +27661,83 @@ var ts; } return links.resolvedType; } + function getActualTypeParameter(type) { + return type.flags & 4194304 ? type.typeParameter : type; + } + function createConditionalType(checkType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, aliasTypeArguments) { + var type = createType(2097152); + type.checkType = checkType; + type.extendsType = extendsType; + type.trueType = trueType; + type.falseType = falseType; + type.inferTypeParameters = inferTypeParameters; + type.target = target; + type.mapper = mapper; + type.aliasSymbol = aliasSymbol; + type.aliasTypeArguments = aliasTypeArguments; + return type; + } + function getConditionalType(checkType, baseExtendsType, baseTrueType, baseFalseType, inferTypeParameters, target, mapper, aliasSymbol, baseAliasTypeArguments) { + var extendsType = instantiateType(baseExtendsType, mapper); + if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { + return instantiateType(baseFalseType, mapper); + } + var combinedMapper; + if (inferTypeParameters) { + var inferences = ts.map(inferTypeParameters, createInferenceInfo); + inferTypes(inferences, checkType, extendsType, 8 | 16); + var inferredTypes = ts.map(inferences, function (inference) { return getTypeFromInference(inference) || neverType; }); + var inferenceMapper = createTypeMapper(inferTypeParameters, inferredTypes); + combinedMapper = mapper ? combineTypeMappers(mapper, inferenceMapper) : inferenceMapper; + } + if (checkType.flags & 1 || (checkType.flags & 16384 && !(extendsType.flags & 16384))) { + return getUnionType([instantiateType(baseTrueType, combinedMapper || mapper), instantiateType(baseFalseType, mapper)]); + } + var inferredExtendsType = combinedMapper ? instantiateType(baseExtendsType, combinedMapper) : extendsType; + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, undefined)) { + return instantiateType(baseTrueType, combinedMapper || mapper); + } + var erasedCheckType = getActualTypeParameter(checkType); + var trueType = instantiateType(baseTrueType, mapper); + var falseType = instantiateType(baseFalseType, mapper); + var isDistributive = (target ? target.checkType : erasedCheckType).flags & 32768 ? 1 : 0; + var id = erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id + "," + isDistributive; + var cached = conditionalTypes.get(id); + if (cached) { + return cached; + } + var result = createConditionalType(erasedCheckType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, instantiateTypes(baseAliasTypeArguments, mapper)); + conditionalTypes.set(id, result); + return result; + } + function isDistributiveConditionalType(type) { + return !!((type.target || type).checkType.flags & 32768); + } + function getInferTypeParameters(node) { + var result; + if (node.locals) { + node.locals.forEach(function (symbol) { + if (symbol.flags & 262144) { + result = ts.append(result, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result; + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getConditionalType(getTypeFromTypeNode(node.checkType), getTypeFromTypeNode(node.extendsType), getTypeFromTypeNode(node.trueType), getTypeFromTypeNode(node.falseType), getInferTypeParameters(node), undefined, undefined, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -27147,13 +27758,13 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 232 ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 235 ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); return symbol ? getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) : undefined; } - function getSpreadType(left, right, symbol, propagatedFlags) { + function getSpreadType(left, right, symbol, typeFlags, objectFlags) { if (left.flags & 1 || right.flags & 1) { return anyType; } @@ -27164,15 +27775,12 @@ var ts; return left; } if (left.flags & 131072) { - return mapType(left, function (t) { return getSpreadType(t, right, symbol, propagatedFlags); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); }); } if (right.flags & 131072) { - return mapType(right, function (t) { return getSpreadType(left, t, symbol, propagatedFlags); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); }); } - if (right.flags & 33554432) { - return nonPrimitiveType; - } - if (right.flags & (136 | 84 | 524322 | 272)) { + if (right.flags & (136 | 84 | 524322 | 272 | 134217728)) { return left; } var members = ts.createSymbolTable(); @@ -27223,9 +27831,8 @@ var ts; } } var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo)); - spread.flags |= propagatedFlags; - spread.flags |= 2097152 | 8388608; - spread.objectFlags |= (128 | 1024); + spread.flags |= typeFlags | 33554432; + spread.objectFlags |= objectFlags | (128 | 1024); return spread; } function getNonReadonlySymbol(prop) { @@ -27255,9 +27862,9 @@ var ts; return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 96 && !(type.flags & 2097152)) { + if (type.flags & 96 && !(type.flags & 8388608)) { if (!type.freshType) { - var freshType = createLiteralType(type.flags | 2097152, type.value, type.symbol); + var freshType = createLiteralType(type.flags | 8388608, type.value, type.symbol); freshType.regularType = type; type.freshType = freshType; } @@ -27266,7 +27873,7 @@ var ts; return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 96 && type.flags & 2097152 ? type.regularType : type; + return type.flags & 96 && type.flags & 8388608 ? type.regularType : type; } function getLiteralType(value, enumId, symbol) { var qualifier = typeof value === "number" ? "#" : "@"; @@ -27294,16 +27901,16 @@ var ts; if (ts.isValidESSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); var links = getSymbolLinks(symbol); - return links.type || (links.type = createUniqueESSymbolType(symbol)); + return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); } return esSymbolType; } function getThisType(node) { var container = ts.getThisContainer(node, false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 231)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 234)) { if (!ts.hasModifier(container, 32) && - (container.kind !== 153 || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 154 || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -27320,71 +27927,75 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 119: - case 272: - case 273: + case 275: + case 276: return anyType; - case 136: + case 137: return stringType; - case 133: + case 134: return numberType; case 122: return booleanType; - case 137: + case 138: return esSymbolType; case 105: return voidType; - case 139: + case 140: return undefinedType; case 95: return nullType; - case 130: + case 131: return neverType; - case 134: + case 135: return node.flags & 65536 ? anyType : nonPrimitiveType; - case 170: + case 173: case 99: return getTypeFromThisTypeNode(node); - case 174: + case 177: return getTypeFromLiteralTypeNode(node); - case 160: - return getTypeFromTypeReference(node); - case 159: - return booleanType; - case 202: - return getTypeFromTypeReference(node); - case 163: - return getTypeFromTypeQueryNode(node); - case 165: - return getTypeFromArrayTypeNode(node); - case 166: - return getTypeFromTupleTypeNode(node); - case 167: - return getTypeFromUnionTypeNode(node); - case 168: - return getTypeFromIntersectionTypeNode(node); - case 274: - return getTypeFromJSDocNullableTypeNode(node); - case 169: - case 275: - case 276: - case 271: - return getTypeFromTypeNode(node.type); - case 278: - return getTypeFromJSDocVariadicType(node); case 161: - case 162: + return getTypeFromTypeReference(node); + case 160: + return booleanType; + case 205: + return getTypeFromTypeReference(node); case 164: - case 280: + return getTypeFromTypeQueryNode(node); + case 166: + return getTypeFromArrayTypeNode(node); + case 167: + return getTypeFromTupleTypeNode(node); + case 168: + return getTypeFromUnionTypeNode(node); + case 169: + return getTypeFromIntersectionTypeNode(node); case 277: - return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 171: - return getTypeFromTypeOperatorNode(node); + return getTypeFromJSDocNullableTypeNode(node); case 172: + case 278: + case 279: + case 274: + return getTypeFromTypeNode(node.type); + case 281: + return getTypeFromJSDocVariadicType(node); + case 162: + case 163: + case 165: + case 283: + case 280: + return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); + case 174: + return getTypeFromTypeOperatorNode(node); + case 175: return getTypeFromIndexedAccessTypeNode(node); - case 173: + case 176: return getTypeFromMappedTypeNode(node); + case 170: + return getTypeFromConditionalTypeNode(node); + case 171: + return getTypeFromInferTypeNode(node); case 71: - case 144: + case 145: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -27393,12 +28004,18 @@ var ts; } function instantiateList(items, mapper, instantiator) { if (items && items.length) { - var result = []; - for (var _i = 0, items_1 = items; _i < items_1.length; _i++) { - var v = items_1[_i]; - result.push(instantiator(v, mapper)); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result = i === 0 ? [] : items.slice(0, i); + result.push(mapped); + for (i++; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } } - return result; } return items; } @@ -27434,7 +28051,7 @@ var ts; return createTypeMapper(sources, undefined); } function createBackreferenceMapper(typeParameters, index) { - return function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; }; } function isInferenceContext(mapper) { return !!mapper.signature; @@ -27450,13 +28067,16 @@ var ts; function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } + function wildcardMapper(type) { + return type.flags & 32768 ? wildcardType : type; + } function cloneTypeParameter(typeParameter) { var result = createType(32768); result.symbol = typeParameter.symbol; result.target = typeParameter; return result; } - function cloneTypePredicate(predicate, mapper) { + function instantiateTypePredicate(predicate, mapper) { if (ts.isIdentifierTypePredicate(predicate)) { return { kind: 1, @@ -27474,7 +28094,6 @@ var ts; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { freshTypeParameters = ts.map(signature.typeParameters, cloneTypeParameter); mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); @@ -27483,17 +28102,17 @@ var ts; tp.mapper = mapper; } } - if (signature.typePredicate) { - freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper); - } - var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), undefined, freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); + var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), undefined, undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); result.target = signature; result.mapper = mapper; return result; } function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !maybeTypeOfKind(links.type, 65536 | 7897088)) { + return symbol; + } if (ts.getCheckFlags(symbol) & 1) { - var links = getSymbolLinks(symbol); symbol = links.target; mapper = combineTypeMappers(links.mapper, mapper); } @@ -27514,14 +28133,14 @@ var ts; var target = type.objectFlags & 64 ? type.target : type; var symbol = target.symbol; var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; + var typeParameters = links.outerTypeParameters; if (!typeParameters) { var declaration_1 = symbol.declarations[0]; var outerTypeParameters = getOuterTypeParameters(declaration_1, true) || ts.emptyArray; typeParameters = symbol.flags & 2048 && !target.aliasTypeArguments ? ts.filter(outerTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration_1); }) : outerTypeParameters; - links.typeParameters = typeParameters; + links.outerTypeParameters = typeParameters; if (typeParameters.length) { links.instantiations = ts.createMap(); links.instantiations.set(getTypeListId(typeParameters), target); @@ -27544,18 +28163,18 @@ var ts; function isTypeParameterPossiblyReferenced(tp, node) { if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container_1 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 208 ? "quit" : n === container_1; })) { + if (ts.findAncestor(node, function (n) { return n.kind === 211 ? "quit" : n === container_1; })) { return ts.forEachChild(node, containsReference); } } return true; function containsReference(node) { switch (node.kind) { - case 170: + case 173: return tp.isThisType; case 71: return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; - case 163: + case 164: return true; } return ts.forEachChild(node, containsReference); @@ -27580,7 +28199,7 @@ var ts; return instantiateAnonymousType(type, mapper); } function isMappableType(type) { - return type.flags & (1 | 32768 | 65536 | 262144 | 1048576); + return type.flags & (1 | 7372800 | 65536 | 262144); } function instantiateAnonymousType(type, mapper) { var result = createObjectType(type.objectFlags | 64, type.symbol); @@ -27593,8 +28212,23 @@ var ts; result.aliasTypeArguments = instantiateTypes(type.aliasTypeArguments, mapper); return result; } + function getConditionalTypeInstantiation(type, mapper) { + var target = type.target || type; + var combinedMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; + if (isDistributiveConditionalType(target)) { + var checkType_1 = target.checkType; + var instantiatedType = combinedMapper(checkType_1); + if (checkType_1 !== instantiatedType && instantiatedType.flags & 131072) { + return mapType(instantiatedType, function (t) { return instantiateConditionalType(target, createReplacementMapper(checkType_1, t, combinedMapper)); }); + } + } + return instantiateConditionalType(target, combinedMapper); + } + function instantiateConditionalType(type, mapper) { + return getConditionalType(instantiateType(type.checkType, mapper), type.extendsType, type.trueType, type.falseType, type.inferTypeParameters, type, mapper, type.aliasSymbol, type.aliasTypeArguments); + } function instantiateType(type, mapper) { - if (type && mapper !== identityMapper) { + if (type && mapper && mapper !== identityMapper) { if (type.flags & 32768) { return mapper(type); } @@ -27607,14 +28241,20 @@ var ts; return getAnonymousTypeInstantiation(type, mapper); } if (type.objectFlags & 4) { - return createTypeReference(type.target, instantiateTypes(type.typeArguments, mapper)); + var typeArguments = type.typeArguments; + var newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type; } } if (type.flags & 131072 && !(type.flags & 16382)) { - return getUnionType(instantiateTypes(type.types, mapper), false, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, 1, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 262144) { - return getIntersectionType(instantiateTypes(type.types, mapper), type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 524288) { return getIndexType(instantiateType(type.type, mapper)); @@ -27622,38 +28262,48 @@ var ts; if (type.flags & 1048576) { return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper)); } + if (type.flags & 2097152) { + return getConditionalTypeInstantiation(type, mapper); + } + if (type.flags & 4194304) { + return mapper(type.typeParameter); + } } return type; } + function getWildcardInstantiation(type) { + return type.flags & (16382 | 1 | 16384) ? type : + type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 187: - case 188: - case 152: + case 190: + case 191: + case 153: return isContextSensitiveFunctionLikeDeclaration(node); - case 179: + case 182: return ts.forEach(node.properties, isContextSensitive); - case 178: + case 181: return ts.forEach(node.elements, isContextSensitive); - case 196: + case 199: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 195: + case 198: return node.operatorToken.kind === 54 && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 265: + case 268: return isContextSensitive(node.initializer); - case 186: + case 189: return isContextSensitive(node.expression); - case 258: + case 261: return ts.forEach(node.properties, isContextSensitive); - case 257: - return node.initializer && isContextSensitive(node.initializer); case 260: + return node.initializer && isContextSensitive(node.initializer); + case 263: return node.expression && isContextSensitive(node.expression); } return false; @@ -27665,13 +28315,13 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 188) { + if (node.kind !== 191) { var parameter = ts.firstOrUndefined(node.parameters); if (!(parameter && ts.parameterIsThisKeyword(parameter))) { return true; } } - return node.body.kind === 208 ? false : isContextSensitive(node.body); + return node.body.kind === 211 ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -27711,7 +28361,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 131072 ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 131072 ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 1081344 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & 7372800 ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); } @@ -27742,8 +28392,8 @@ var ts; source = instantiateSignatureInContextOf(source, target, undefined, compareTypes); } var kind = target.declaration ? target.declaration.kind : 0; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 152 && - kind !== 151 && kind !== 153; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 && + kind !== 152 && kind !== 154; var result = -1; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -27770,7 +28420,7 @@ var ts; var targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) && (getFalsyFlags(sourceType) & 12288) === (getFalsyFlags(targetType) & 12288); var related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 : 1, false, reportErrors, errorReporter, compareTypes) : @@ -27789,11 +28439,13 @@ var ts; return result; } var sourceReturnType = getReturnTypeOfSignature(source); - if (target.typePredicate) { - if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (targetTypePredicate) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + if (sourceTypePredicate) { + result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } - else if (ts.isIdentifierTypePredicate(target.typePredicate)) { + else if (ts.isIdentifierTypePredicate(targetTypePredicate)) { if (reportErrors) { errorReporter(ts.Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); } @@ -27816,13 +28468,12 @@ var ts; return 0; } if (source.kind === 1) { - var sourcePredicate = source; var targetPredicate = target; - var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0; @@ -27876,7 +28527,7 @@ var ts; } function isEmptyObjectType(type) { return type.flags & 65536 ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : - type.flags & 33554432 ? true : + type.flags & 134217728 ? true : type.flags & 131072 ? ts.forEach(type.types, isEmptyObjectType) : type.flags & 262144 ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : false; @@ -27901,7 +28552,7 @@ var ts; var targetProperty = getPropertyOfType(targetEnumType, property.escapedName); if (!targetProperty || !(targetProperty.flags & 8)) { if (errorReporter) { - errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), undefined, 256)); + errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), undefined, 64)); } enumRelation.set(id, false); return false; @@ -27914,7 +28565,7 @@ var ts; function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { var s = source.flags; var t = target.flags; - if (t & 1 || s & 16384) + if (t & 1 || s & 16384 || source === wildcardType) return true; if (t & 16384) return false; @@ -27948,11 +28599,11 @@ var ts; return true; if (s & 8192 && (!strictNullChecks || t & 8192)) return true; - if (s & 65536 && t & 33554432) + if (s & 65536 && t & 134217728) return true; if (s & 1024 || t & 1024) return false; - if (relation === assignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { if (s & 1) return true; if (s & (4 | 64) && !(s & 256) && (t & 16 || t & 64 && t & 256)) @@ -27961,10 +28612,10 @@ var ts; return false; } function isTypeRelatedTo(source, target, relation) { - if (source.flags & 96 && source.flags & 2097152) { + if (source.flags & 96 && source.flags & 8388608) { source = source.regularType; } - if (target.flags & 96 && target.flags & 2097152) { + if (target.flags & 96 && target.flags & 8388608) { target = target.regularType; } if (source === target || @@ -27978,11 +28629,14 @@ var ts; return related === 1; } } - if (source.flags & 2064384 || target.flags & 2064384) { + if (source.flags & 8355840 || target.flags & 8355840) { return checkTypeRelatedTo(source, target, relation, undefined); } return false; } + function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { + return ts.getObjectFlags(source) & 4096 && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + } function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { var errorInfo; var maybeKeys; @@ -28000,10 +28654,22 @@ var ts; } else if (errorInfo) { if (containingMessageChain) { - errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + var chain_1 = containingMessageChain(); + if (chain_1) { + errorInfo = ts.concatenateDiagnosticMessageChains(chain_1, errorInfo); + } } diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } + if (headMessage && errorNode && !result && source.symbol) { + var links = getSymbolLinks(source.symbol); + if (links.originatingImport && !ts.isImportCall(links.originatingImport)) { + var helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target), target, relation, undefined); + if (helpfulRetry) { + diagnostics.add(ts.createDiagnosticForNode(links.originatingImport, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime)); + } + } + } return result !== 0; function reportError(message, arg0, arg1, arg2) { ts.Debug.assert(!!errorNode); @@ -28013,8 +28679,8 @@ var ts; var sourceType = typeToString(source); var targetType = typeToString(target); if (sourceType === targetType) { - sourceType = typeToString(source, undefined, 256); - targetType = typeToString(target, undefined, 256); + sourceType = typeToString(source, undefined, 64); + targetType = typeToString(target, undefined, 64); } if (!message) { if (relation === comparableRelation) { @@ -28057,12 +28723,18 @@ var ts; return false; } function isRelatedTo(source, target, reportErrors, headMessage) { - if (source.flags & 96 && source.flags & 2097152) { + if (source.flags & 96 && source.flags & 8388608) { source = source.regularType; } - if (target.flags & 96 && target.flags & 2097152) { + if (target.flags & 96 && target.flags & 8388608) { target = target.regularType; } + if (source.flags & 4194304) { + source = relation === definitelyAssignableRelation ? source.typeParameter : source.substitute; + } + if (target.flags & 4194304) { + target = target.typeParameter; + } if (source === target) return -1; if (relation === identityRelation) { @@ -28071,14 +28743,15 @@ var ts; if (relation === comparableRelation && !(target.flags & 16384) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1; - if (isObjectLiteralType(source) && source.flags & 2097152) { - if (hasExcessProperties(source, target, reportErrors)) { + if (isObjectLiteralType(source) && source.flags & 8388608) { + var discriminantType = target.flags & 131072 ? findMatchingDiscriminantType(source, target) : undefined; + if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { reportRelationError(headMessage, source, target); } return 0; } - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { source = getRegularTypeOfObjectLiteral(source); } } @@ -28123,7 +28796,7 @@ var ts; else if (source.flags & 262144) { result = someTypeRelatedToType(source, target, false); } - if (!result && (source.flags & 2064384 || target.flags & 2064384)) { + if (!result && (source.flags & 8355840 || target.flags & 8355840)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; } @@ -28143,31 +28816,54 @@ var ts; } function isIdenticalTo(source, target) { var result; - if (source.flags & 65536 && target.flags & 65536) { + var flags = source.flags & target.flags; + if (flags & 65536) { return recursiveTypeRelatedTo(source, target, false); } - if (source.flags & 131072 && target.flags & 131072 || - source.flags & 262144 && target.flags & 262144) { + if (flags & (131072 | 262144)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & 524288) { + return isRelatedTo(source.type, target.type, false); + } + if (flags & 1048576) { + if (result = isRelatedTo(source.objectType, target.objectType, false)) { + if (result &= isRelatedTo(source.indexType, target.indexType, false)) { + return result; + } + } + } + if (flags & 2097152) { + if (result = isRelatedTo(source.checkType, target.checkType, false)) { + if (result &= isRelatedTo(source.extendsType, target.extendsType, false)) { + if (result &= isRelatedTo(source.trueType, target.trueType, false)) { + if (result &= isRelatedTo(source.falseType, target.falseType, false)) { + if (isDistributiveConditionalType(source) === isDistributiveConditionalType(target)) { + return result; + } + } + } + } + } + } + if (flags & 4194304) { + return isRelatedTo(source.substitute, target.substitute, false); + } return 0; } - function hasExcessProperties(source, target, reportErrors) { + function hasExcessProperties(source, target, discriminant, reportErrors) { if (maybeTypeOfKind(target, 65536) && !(ts.getObjectFlags(target) & 512)) { - var isComparingJsxAttributes = !!(source.flags & 67108864); - if ((relation === assignableRelation || relation === comparableRelation) && + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096); + if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } - if (target.flags & 131072) { - var discriminantType = findMatchingDiscriminantType(source, target); - if (discriminantType) { - return hasExcessProperties(source, discriminantType, reportErrors); - } + if (discriminant) { + return hasExcessProperties(source, discriminant, undefined, reportErrors); } var _loop_4 = function (prop) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -28402,13 +29098,16 @@ var ts; } return result; } + function getConstraintForRelation(type) { + return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); + } function structuredTypeRelatedTo(source, target, reportErrors) { var result; var originalErrorInfo; var saveErrorInfo = errorInfo; if (target.flags & 32768) { if (ts.getObjectFlags(source) & 32 && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & 4)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -28423,7 +29122,7 @@ var ts; return result; } } - var constraint = getConstraintOfType(target.type); + var constraint = getConstraintForRelation(target.type); if (constraint) { if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { return result; @@ -28431,7 +29130,7 @@ var ts; } } else if (target.flags & 1048576) { - var constraint = getConstraintOfIndexedAccess(target); + var constraint = getConstraintForRelation(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { errorInfo = saveErrorInfo; @@ -28439,17 +29138,27 @@ var ts; } } } - else if (isGenericMappedType(target) && !isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (isGenericMappedType(target)) { + var template = getTemplateTypeFromMappedType(target); + var modifiers = getMappedTypeModifiers(target); + if (!(modifiers & 8)) { + if (template.flags & 1048576 && template.objectType === source && + template.indexType === getTypeParameterFromMappedType(target)) { + return -1; + } + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } if (source.flags & 32768) { - var constraint = getConstraintOfTypeParameter(source); - if (constraint || !(target.flags & 33554432)) { + var constraint = getConstraintForRelation(source); + if (constraint || !(target.flags & 134217728)) { if (!constraint || constraint.flags & 1) { constraint = emptyObjectType; } @@ -28461,23 +29170,53 @@ var ts; } } else if (source.flags & 1048576) { - var constraint = getConstraintOfIndexedAccess(source); + var constraint = getConstraintForRelation(source); if (constraint) { if (result = isRelatedTo(constraint, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } } - else if (target.flags & 1048576 && source.indexType === target.indexType) { + else if (target.flags & 1048576) { if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + result &= isRelatedTo(source.indexType, target.indexType, reportErrors); + } + if (result) { errorInfo = saveErrorInfo; return result; } } } + else if (source.flags & 2097152) { + if (relation !== definitelyAssignableRelation) { + var constraint = getConstraintOfDistributiveConditionalType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (target.flags & 2097152) { + if (isTypeIdenticalTo(source.checkType, target.checkType) && + isTypeIdenticalTo(source.extendsType, target.extendsType)) { + if (result = isRelatedTo(source.trueType, target.trueType, reportErrors)) { + result &= isRelatedTo(source.falseType, target.falseType, reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } else { if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target && - !(source.flags & 134217728 || target.flags & 134217728)) { + !(ts.getObjectFlags(source) & 8192 || ts.getObjectFlags(target) & 8192)) { var variances = getVariances(source.target); if (result = typeArgumentsRelatedTo(source, target, variances, reportErrors)) { return result; @@ -28530,8 +29269,7 @@ var ts; } function mappedTypeRelatedTo(source, target, reportErrors) { var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & 2) || - getCombinedMappedTypeModifiers(target) & 2); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { var result_1; if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -28574,6 +29312,9 @@ var ts; if (!(targetProp.flags & 4194304)) { var sourceProp = getPropertyOfType(source, targetProp.escapedName); if (sourceProp && sourceProp !== targetProp) { + if (isIgnoredJsxProperty(source, sourceProp, getTypeOfSymbol(targetProp))) { + continue; + } var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 || targetPropFlags & 8) { @@ -28642,7 +29383,7 @@ var ts; return false; } function hasCommonProperties(source, target) { - var isComparingJsxAttributes = !!(source.flags & 67108864); + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -28755,6 +29496,9 @@ var ts; var result = -1; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; + if (isIgnoredJsxProperty(source, prop, undefined)) { + continue; + } if (kind === 0 || isNumericLiteralName(prop.escapedName)) { var related = isRelatedTo(getTypeOfSymbol(prop), target, reportErrors); if (!related) { @@ -28843,7 +29587,7 @@ var ts; } function getMarkerTypeReference(type, source, target) { var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; })); - result.flags |= 134217728; + result.objectFlags |= 8192; return result; } function getVariances(type) { @@ -28895,7 +29639,7 @@ var ts; for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { var t = _a[_i]; if (isUnconstrainedTypeParameter(t)) { - var index = ts.indexOf(typeParameters, t); + var index = typeParameters.indexOf(t); if (index < 0) { index = typeParameters.length; typeParameters.push(t); @@ -29049,17 +29793,24 @@ var ts; result &= related; } if (!ignoreReturnTypes) { - result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + result &= sourceTypePredicate !== undefined || targetTypePredicate !== undefined + ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) + : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } return result; } + function compareTypePredicatesIdentical(source, target, compareTypes) { + return source === undefined || target === undefined || !typePredicateKindsMatch(source, target) ? 0 : compareTypes(source.type, target.type); + } function isRestParameterIndex(signature, parameterIndex) { return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var t = types_9[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -29082,7 +29833,7 @@ var ts; var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 12288); }); return primaryTypes.length ? getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 12288) : - getUnionType(types, true); + getUnionType(types, 2); } function getCommonSubtype(types) { return ts.reduceLeft(types, function (s, t) { return isTypeSubtypeOf(t, s) ? t : s; }); @@ -29119,8 +29870,8 @@ var ts; } function getWidenedLiteralType(type) { return type.flags & 256 ? getBaseTypeOfEnumLiteralType(type) : - type.flags & 32 && type.flags & 2097152 ? stringType : - type.flags & 64 && type.flags & 2097152 ? numberType : + type.flags & 32 && type.flags & 8388608 ? stringType : + type.flags & 64 && type.flags & 8388608 ? numberType : type.flags & 128 ? booleanType : type.flags & 131072 ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) : type; @@ -29141,8 +29892,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; result |= getFalsyFlags(t); } return result; @@ -29211,7 +29962,7 @@ var ts; return members; } function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType(type) && type.flags & 2097152)) { + if (!(isObjectLiteralType(type) && type.flags & 8388608)) { return type; } var regularType = type.regularType; @@ -29221,7 +29972,7 @@ var ts; var resolved = type; var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo); - regularNew.flags = resolved.flags & ~2097152; + regularNew.flags = resolved.flags & ~8388608; regularNew.objectFlags |= 128; type.regularType = regularNew; return regularNew; @@ -29301,7 +30052,7 @@ var ts; return getWidenedTypeWithContext(type, undefined); } function getWidenedTypeWithContext(type, context) { - if (type.flags & 12582912) { + if (type.flags & 50331648) { if (type.flags & 12288) { return anyType; } @@ -29311,7 +30062,7 @@ var ts; if (type.flags & 131072) { var unionContext_1 = context || createWideningContext(undefined, undefined, type.types); var widenedTypes = ts.sameMap(type.types, function (t) { return t.flags & 12288 ? t : getWidenedTypeWithContext(t, unionContext_1); }); - return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType)); + return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 : 1); } if (isArrayType(type) || isTupleType(type)) { return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); @@ -29321,7 +30072,7 @@ var ts; } function reportWideningErrorsInType(type) { var errorReported = false; - if (type.flags & 4194304) { + if (type.flags & 16777216) { if (type.flags & 131072) { if (ts.some(type.types, isEmptyObjectType)) { errorReported = true; @@ -29347,9 +30098,9 @@ var ts; for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); - if (t.flags & 4194304) { + if (t.flags & 16777216) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, ts.symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -29362,38 +30113,41 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { + case 151: case 150: - case 149: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 147: + case 148: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 177: + case 180: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 229: + case 232: + case 153: case 152: - case 151: - case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; + case 176: + error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + return; default: diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && noImplicitAny && type.flags & 4194304) { + if (produceDiagnostics && noImplicitAny && type.flags & 16777216) { if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); } @@ -29441,6 +30195,7 @@ var ts; return { typeParameter: typeParameter, candidates: undefined, + contraCandidates: undefined, inferredType: undefined, priority: undefined, topLevel: true, @@ -29451,6 +30206,7 @@ var ts; return { typeParameter: inference.typeParameter, candidates: inference.candidates && inference.candidates.slice(), + contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), inferredType: inference.inferredType, priority: inference.priority, topLevel: inference.topLevel, @@ -29459,7 +30215,7 @@ var ts; } function couldContainTypeVariables(type) { var objectFlags = ts.getObjectFlags(type); - return !!(type.flags & (1081344 | 524288) || + return !!(type.flags & 7897088 || objectFlags & 4 && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 2048 | 32) || objectFlags & 32 || @@ -29482,7 +30238,7 @@ var ts; } var name = ts.escapeLeadingUnderscores(t.value); var literalProp = createSymbol(4, name); - literalProp.type = emptyObjectType; + literalProp.type = anyType; if (t.symbol) { literalProp.declarations = t.symbol.declarations; literalProp.valueDeclaration = t.symbol.valueDeclaration; @@ -29492,40 +30248,41 @@ var ts; var indexInfo = type.flags & 2 ? createIndexInfo(emptyObjectType, false) : undefined; return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined); } - function inferTypeForHomomorphicMappedType(source, target, mappedTypeStack) { + function inferTypeForHomomorphicMappedType(source, target) { + var key = source.id + "," + target.id; + if (reverseMappedCache.has(key)) { + return reverseMappedCache.get(key); + } + reverseMappedCache.set(key, undefined); + var type = createReverseMappedType(source, target); + reverseMappedCache.set(key, type); + return type; + } + function createReverseMappedType(source, target) { var properties = getPropertiesOfType(source); - var indexInfo = getIndexInfoOfType(source, 0); - if (properties.length === 0 && !indexInfo) { + if (properties.length === 0 && !getIndexInfoOfType(source, 0)) { return undefined; } - var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); - var inference = createInferenceInfo(typeParameter); - var inferences = [inference]; - var templateType = getTemplateTypeFromMappedType(target); - var readonlyMask = target.declaration.readonlyToken ? false : true; - var optionalMask = target.declaration.questionToken ? 0 : 16777216; - var members = ts.createSymbolTable(); for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { var prop = properties_4[_i]; - var propType = getTypeOfSymbol(prop); - if (propType.flags & 16777216) { + if (getTypeOfSymbol(prop).flags & 67108864) { return undefined; } - var checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 : 0; - var inferredProp = createSymbol(4 | prop.flags & optionalMask, prop.escapedName, checkFlags); - inferredProp.declarations = prop.declarations; - inferredProp.type = inferTargetType(propType); - members.set(prop.escapedName, inferredProp); - } - if (indexInfo) { - indexInfo = createIndexInfo(inferTargetType(indexInfo.type), readonlyMask && indexInfo.isReadonly); - } - return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined); - function inferTargetType(sourceType) { - inference.candidates = undefined; - inferTypes(inferences, sourceType, templateType, 0, mappedTypeStack); - return inference.candidates ? getUnionType(inference.candidates, true) : emptyObjectType; } + var reversed = createObjectType(2048 | 16, undefined); + reversed.source = source; + reversed.mappedType = target; + return reversed; + } + function getTypeOfReverseMappedSymbol(symbol) { + return inferReverseMappedType(symbol.propertyType, symbol.mappedType); + } + function inferReverseMappedType(sourceType, target) { + var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + var inference = createInferenceInfo(typeParameter); + inferTypes([inference], sourceType, templateType); + return getTypeFromInference(inference) || emptyObjectType; } function getUnmatchedProperty(source, target, requireOptionalProperties) { var properties = target.flags & 262144 ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); @@ -29540,10 +30297,16 @@ var ts; } return undefined; } - function inferTypes(inferences, originalSource, originalTarget, priority, mappedTypeStack) { + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType(inference.candidates, 2) : + inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : + undefined; + } + function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; var visited; + var contravariant = false; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -29586,28 +30349,33 @@ var ts; } } if (target.flags & 1081344) { - if (source.flags & 16777216 || source === silentNeverType) { + if (source.flags & 67108864 || source === silentNeverType) { return; } var inference = getInferenceInfoForType(target); if (inference) { if (!inference.isFixed) { - var p = priority | (source === implicitNeverType ? 16 : 0); - if (!inference.candidates || p < inference.priority) { - inference.candidates = [source]; - inference.priority = p; + if (inference.priority === undefined || priority < inference.priority) { + inference.candidates = undefined; + inference.contraCandidates = undefined; + inference.priority = priority; } - else if (p === inference.priority) { - inference.candidates.push(source); + if (priority === inference.priority) { + if (contravariant) { + inference.contraCandidates = ts.append(inference.contraCandidates, source); + } + else { + inference.candidates = ts.append(inference.candidates, source); + } } - if (!(p & 8) && target.flags & 32768 && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 4) && target.flags & 32768 && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; } } return; } } - else if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target) { + if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target) { var sourceTypes = source.typeArguments || ts.emptyArray; var targetTypes = target.typeArguments || ts.emptyArray; var count = sourceTypes.length < targetTypes.length ? sourceTypes.length : targetTypes.length; @@ -29622,20 +30390,26 @@ var ts; } } else if (source.flags & 524288 && target.flags & 524288) { - priority ^= 1; + contravariant = !contravariant; inferFromTypes(source.type, target.type); - priority ^= 1; + contravariant = !contravariant; } else if ((isLiteralType(source) || source.flags & 2) && target.flags & 524288) { var empty = createEmptyObjectTypeFromStringLiteral(source); - priority ^= 1; + contravariant = !contravariant; inferFromTypes(empty, target.type); - priority ^= 1; + contravariant = !contravariant; } else if (source.flags & 1048576 && target.flags & 1048576) { inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } + else if (source.flags & 2097152 && target.flags & 2097152) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(source.trueType, target.trueType); + inferFromTypes(source.falseType, target.falseType); + } else if (target.flags & 393216) { var targetTypes = target.types; var typeVariableCount = 0; @@ -29652,7 +30426,7 @@ var ts; } if (typeVariableCount === 1) { var savePriority = priority; - priority |= 2; + priority |= 1; inferFromTypes(source, typeVariable); priority = savePriority; } @@ -29665,7 +30439,9 @@ var ts; } } else { - source = getApparentType(source); + if (!(priority && 8 && source.flags & (262144 | 7897088))) { + source = getApparentType(source); + } if (source.flags & (65536 | 262144)) { var key = source.id + "," + target.id; if (visited && visited.get(key)) { @@ -29690,10 +30466,10 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes) { - priority ^= 1; + if (strictFunctionTypes || priority & 16) { + contravariant = !contravariant; inferFromTypes(source, target); - priority ^= 1; + contravariant = !contravariant; } else { inferFromTypes(source, target); @@ -29720,16 +30496,10 @@ var ts; if (constraintType.flags & 524288) { var inference = getInferenceInfoForType(constraintType.type); if (inference && !inference.isFixed) { - var key = (source.symbol ? getSymbolId(source.symbol) + "," : "") + getSymbolId(target.symbol); - if (ts.contains(mappedTypeStack, key)) { - return; - } - (mappedTypeStack || (mappedTypeStack = [])).push(key); - var inferredType = inferTypeForHomomorphicMappedType(source, target, mappedTypeStack); - mappedTypeStack.pop(); + var inferredType = inferTypeForHomomorphicMappedType(source, target); if (inferredType) { var savePriority = priority; - priority |= 4; + priority |= 2; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -29771,8 +30541,10 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromContravariantTypes); - if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) { - inferFromTypes(source.typePredicate.type, target.typePredicate.type); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (sourceTypePredicate && targetTypePredicate && sourceTypePredicate.kind === targetTypePredicate.kind) { + inferFromTypes(sourceTypePredicate.type, targetTypePredicate.type); } else { inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -29799,8 +30571,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -29828,7 +30600,7 @@ var ts; if (candidates.length > 1) { var objectLiterals = ts.filter(candidates, isObjectLiteralType); if (objectLiterals.length) { - var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, true)); + var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, 2)); return ts.concatenate(ts.filter(candidates, function (t) { return !isObjectLiteralType(t); }), [objectLiteralsType]); } } @@ -29845,10 +30617,16 @@ var ts; !hasPrimitiveConstraint(inference.typeParameter) && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates; - var unwidenedType = inference.priority & 1 ? getCommonSubtype(baseCandidates) : - context.flags & 1 || inference.priority & 8 ? getUnionType(baseCandidates, true) : - getCommonSupertype(baseCandidates); + var unwidenedType = context.flags & 1 || inference.priority & 4 ? + getUnionType(baseCandidates, 2) : + getCommonSupertype(baseCandidates); inferredType = getWidenedType(unwidenedType); + if (inferredType.flags & 16384 && inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); + } + } + else if (inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); } else if (context.flags & 2) { inferredType = silentNeverType; @@ -29888,12 +30666,12 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; + resolveName(node, node.escapedText, 107455 | 1048576, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; } function isInTypeQuery(node) { - return !!ts.findAncestor(node, function (n) { return n.kind === 163 ? true : n.kind === 71 || n.kind === 144 ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 164 ? true : n.kind === 71 || n.kind === 145 ? false : "quit"; }); } function getFlowCacheKey(node) { if (node.kind === 71) { @@ -29903,13 +30681,13 @@ var ts; if (node.kind === 99) { return "0"; } - if (node.kind === 180) { + if (node.kind === 183) { var key = getFlowCacheKey(node.expression); return key && key + "." + ts.idText(node.name); } - if (node.kind === 177) { + if (node.kind === 180) { var container = node.parent.parent; - var key = container.kind === 177 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); + var key = container.kind === 180 ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); var text = getBindingElementNameText(node); var result = key && text && (key + "." + text); return result; @@ -29917,12 +30695,12 @@ var ts; return undefined; } function getBindingElementNameText(element) { - if (element.parent.kind === 175) { + if (element.parent.kind === 178) { var name = element.propertyName || element.name; switch (name.kind) { case 71: return ts.idText(name); - case 145: + case 146: return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; case 9: case 8: @@ -29939,26 +30717,26 @@ var ts; switch (source.kind) { case 71: return target.kind === 71 && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 227 || target.kind === 177) && + (target.kind === 230 || target.kind === 180) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 99: return target.kind === 99; case 97: return target.kind === 97; - case 180: - return target.kind === 180 && + case 183: + return target.kind === 183 && source.name.escapedText === target.name.escapedText && isMatchingReference(source.expression, target.expression); - case 177: - if (target.kind !== 180) + case 180: + if (target.kind !== 183) return false; var t = target; if (t.name.escapedText !== getBindingElementNameText(source)) return false; - if (source.parent.parent.kind === 177 && isMatchingReference(source.parent.parent, t.expression)) { + if (source.parent.parent.kind === 180 && isMatchingReference(source.parent.parent, t.expression)) { return true; } - if (source.parent.parent.kind === 227) { + if (source.parent.parent.kind === 230) { var maybeId = source.parent.parent.initializer; return maybeId && isMatchingReference(maybeId, t.expression); } @@ -29966,7 +30744,7 @@ var ts; return false; } function containsMatchingReference(source, target) { - while (source.kind === 180) { + while (source.kind === 183) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -29975,7 +30753,7 @@ var ts; return false; } function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 180 && + return target.kind === 183 && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); } @@ -29983,7 +30761,7 @@ var ts; if (expr.kind === 71) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 180) { + if (expr.kind === 183) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.escapedText); } @@ -30027,7 +30805,7 @@ var ts; } } } - if (callExpression.expression.kind === 180 && + if (callExpression.expression.kind === 183 && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -30066,8 +30844,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getTypeFacts(t); } return result; @@ -30119,10 +30897,10 @@ var ts; if (flags & 1536) { return strictNullChecks ? 1981320 : 4193160; } - if (flags & 33554432) { + if (flags & 134217728) { return strictNullChecks ? 6166480 : 8378320; } - if (flags & 1081344) { + if (flags & 7897088) { return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 393216) { @@ -30131,14 +30909,6 @@ var ts; return 8388607; } function getTypeWithFacts(type, include) { - if (type.flags & 1048576) { - var baseConstraint = getBaseConstraintOfType(type) || emptyObjectType; - var result = filterType(baseConstraint, function (t) { return (getTypeFacts(t) & include) !== 0; }); - if (result !== baseConstraint) { - return result; - } - return type; - } return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; }); } function getTypeWithDefault(type, defaultExpression) { @@ -30164,18 +30934,18 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, undefined, false, false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 178 && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 265 && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 181 && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 268 && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 195 && parent.parent.left === parent || - parent.parent.kind === 217 && parent.parent.initializer === parent; + return parent.parent.kind === 198 && parent.parent.left === parent || + parent.parent.kind === 220 && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { - return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); + return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); } function getAssignedTypeOfSpreadExpression(node) { return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); @@ -30189,21 +30959,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 216: + case 219: return stringType; - case 217: + case 220: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; - case 195: + case 198: return getAssignedTypeOfBinaryExpression(parent); - case 189: + case 192: return undefinedType; - case 178: + case 181: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 199: + case 202: return getAssignedTypeOfSpreadExpression(parent); - case 265: + case 268: return getAssignedTypeOfPropertyAssignment(parent); - case 266: + case 269: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -30211,10 +30981,10 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 175 ? + var type = pattern.kind === 178 ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? - getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : + getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } @@ -30226,35 +30996,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 216) { + if (node.parent.parent.kind === 219) { return stringType; } - if (node.parent.parent.kind === 217) { + if (node.parent.parent.kind === 220) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 227 ? + return node.kind === 230 ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 227 || node.kind === 177 ? + return node.kind === 230 || node.kind === 180 ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 227 && node.initializer && + return node.kind === 230 && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 177 && node.parent.kind === 195 && + node.kind !== 180 && node.parent.kind === 198 && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 186: + case 189: return getReferenceCandidate(node.expression); - case 195: + case 198: switch (node.operatorToken.kind) { case 58: return getReferenceCandidate(node.left); @@ -30266,13 +31036,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 186 || - parent.kind === 195 && parent.operatorToken.kind === 58 && parent.left === node || - parent.kind === 195 && parent.operatorToken.kind === 26 && parent.right === node ? + return parent.kind === 189 || + parent.kind === 198 && parent.operatorToken.kind === 58 && parent.left === node || + parent.kind === 198 && parent.operatorToken.kind === 26 && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 261) { + if (clause.kind === 264) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -30325,15 +31095,15 @@ var ts; } return f(type) ? type : neverType; } - function mapType(type, mapper) { + function mapType(type, mapper, noReductions) { if (!(type.flags & 131072)) { return mapper(type); } var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var current = types_13[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -30347,7 +31117,7 @@ var ts; } } } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; + return mappedTypes ? getUnionType(mappedTypes, noReductions ? 0 : 1) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -30388,7 +31158,7 @@ var ts; return elementType.flags & 16384 ? autoArrayType : createArrayType(elementType.flags & 131072 ? - getUnionType(elementType.types, true) : + getUnionType(elementType.types, 2) : elementType); } function getFinalArrayType(evolvingArrayType) { @@ -30402,8 +31172,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; if (!(t.flags & 16384)) { if (!(ts.getObjectFlags(t) & 256)) { return false; @@ -30421,11 +31191,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 180 && (parent.name.escapedText === "length" || - parent.parent.kind === 182 && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 181 && + var isLengthPushOrUnshift = parent.kind === 183 && (parent.name.escapedText === "length" || + parent.parent.kind === 185 && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 184 && parent.expression === root && - parent.parent.kind === 195 && + parent.parent.kind === 198 && parent.parent.operatorToken.kind === 58 && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -30444,10 +31214,7 @@ var ts; var funcType = checkNonNullExpression(node.expression); if (funcType !== silentNeverType) { var apparentType = getApparentType(funcType); - if (apparentType !== unknownType) { - var callSignatures = getSignaturesOfType(apparentType, 0); - return !!ts.forEach(callSignatures, function (sig) { return sig.typePredicate; }); - } + return apparentType !== unknownType && ts.some(getSignaturesOfType(apparentType, 0), signatureHasTypePredicate); } } return false; @@ -30465,14 +31232,14 @@ var ts; if (flowAnalysisDisabled) { return unknownType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 35620607)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359)) { return declaredType; } var sharedFlowStart = sharedFlowCount; var evolvedType = getTypeFromFlowType(getTypeAtFlowNode(reference.flowNode)); sharedFlowCount = sharedFlowStart; var resultType = ts.getObjectFlags(evolvedType) & 256 && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent && reference.parent.kind === 204 && getTypeWithFacts(resultType, 524288).flags & 16384) { + if (reference.parent && reference.parent.kind === 207 && getTypeWithFacts(resultType, 524288).flags & 16384) { return declaredType; } return resultType; @@ -30534,7 +31301,7 @@ var ts; } else if (flags & 2) { var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 180 && reference.kind !== 99) { + if (container && container !== flowContainer && reference.kind !== 183 && reference.kind !== 99) { flow = container.flowNode; continue; } @@ -30579,7 +31346,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 182 ? + var expr = node.kind === 185 ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -30587,7 +31354,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256) { var evolvedType_1 = type; - if (node.kind === 182) { + if (node.kind === 185) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -30656,7 +31423,7 @@ var ts; seenIncomplete = true; } } - return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete); + return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 : 1), seenIncomplete); } function getTypeAtFlowLoopLabel(flow) { var id = getFlowNodeId(flow); @@ -30673,7 +31440,7 @@ var ts; } for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { - return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], false), true); + return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], 1), true); } } var antecedentTypes = []; @@ -30703,7 +31470,7 @@ var ts; break; } } - var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction); + var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 : 1); if (isIncomplete(firstAntecedentType)) { return createFlowType(result, true); } @@ -30711,7 +31478,7 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - return expr.kind === 180 && + return expr.kind === 183 && computedType.flags & 131072 && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, expr.name.escapedText); @@ -30734,6 +31501,23 @@ var ts; } return type; } + function isTypePresencePossible(type, propName, assumeTrue) { + if (getIndexInfoOfType(type, 0)) { + return true; + } + var prop = getPropertyOfType(type, propName); + if (prop) { + return prop.flags & 16777216 ? true : assumeTrue; + } + return !assumeTrue; + } + function narrowByInKeyword(type, literal, assumeTrue) { + if ((type.flags & (131072 | 65536)) || (type.flags & 32768 && type.isThisType)) { + var propName_1 = ts.escapeLeadingUnderscores(literal.text); + return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); }); + } + return type; + } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { case 58: @@ -30745,10 +31529,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 190 && right_1.kind === 9) { + if (left_1.kind === 193 && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 190 && left_1.kind === 9) { + if (right_1.kind === 193 && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -30769,6 +31553,12 @@ var ts; break; case 93: return narrowTypeByInstanceof(type, expr, assumeTrue); + case 92: + var target = getReferenceCandidate(expr.right); + if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { + return narrowByInKeyword(type, expr.left, assumeTrue); + } + break; case 26: return narrowType(type, expr.right, assumeTrue); } @@ -30794,7 +31584,7 @@ var ts; assumeTrue ? 16384 : 131072; return getTypeWithFacts(type, facts); } - if (type.flags & 33620481) { + if (type.flags & 134283777) { return type; } if (assumeTrue) { @@ -30824,7 +31614,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 1081344) { + if (type.flags & 7897088) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -30846,7 +31636,7 @@ var ts; var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType); var discriminantType = getUnionType(clauseTypes); var caseType = discriminantType.flags & 16384 ? neverType : - replacePrimitivesWithLiterals(filterType(type, function (t) { return isTypeComparableTo(discriminantType, t); }), discriminantType); + replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType); if (!hasDefaultClause) { return caseType; } @@ -30913,7 +31703,7 @@ var ts; return type; } var signature = getResolvedSignature(callExpression); - var predicate = signature.typePredicate; + var predicate = getTypePredicateOfSignature(signature); if (!predicate) { return type; } @@ -30933,7 +31723,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 181 || invokedExpression.kind === 180) { + if (invokedExpression.kind === 184 || invokedExpression.kind === 183) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -30951,15 +31741,15 @@ var ts; case 71: case 99: case 97: - case 180: + case 183: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 182: + case 185: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 186: + case 189: return narrowType(type, expr.expression, assumeTrue); - case 195: + case 198: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 193: + case 196: if (expr.operator === 51) { return narrowType(type, expr.operand, !assumeTrue); } @@ -30986,9 +31776,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 235 || - node.kind === 269 || - node.kind === 150; + node.kind === 238 || + node.kind === 272 || + node.kind === 151; }); } function isParameterAssigned(symbol) { @@ -31009,7 +31799,7 @@ var ts; if (node.kind === 71) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 147) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148) { symbol.isAssigned = true; } } @@ -31023,7 +31813,7 @@ var ts; } function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 147 && + declaration.kind === 148 && declaration.initializer && getFalsyFlags(declaredType) & 4096 && !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096); @@ -31031,20 +31821,26 @@ var ts; } function isApparentTypePosition(node) { var parent = node.parent; - return parent.kind === 180 || - parent.kind === 182 && parent.expression === node || - parent.kind === 181 && parent.expression === node; + return parent.kind === 183 || + parent.kind === 185 && parent.expression === node || + parent.kind === 184 && parent.expression === node || + parent.kind === 207 || + parent.kind === 180 && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 1081344 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288); + return type.flags & 7372800 && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288); } - function getDeclaredOrApparentType(symbol, node) { - var type = getTypeOfSymbol(symbol); + function getApparentTypeForLocation(type, node) { if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { return mapType(getWidenedType(type), getApparentType); } return type; } + function markAliasReferenced(symbol, location) { + if (isNonLocalAlias(symbol, 107455) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + markAliasSymbolAsReferenced(symbol); + } + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -31053,7 +31849,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2) { - if (container.kind === 188) { + if (container.kind === 191) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256)) { @@ -31063,13 +31859,13 @@ var ts; getNodeLinks(container).flags |= 8192; return getTypeOfSymbol(symbol); } - if (isNonLocalAlias(symbol, 107455) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { - markAliasSymbolAsReferenced(symbol); + if (!(node.parent && ts.isPropertyAccessExpression(node.parent) && node.parent.expression === node)) { + markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); var declaration = localOrExportSymbol.valueDeclaration; if (localOrExportSymbol.flags & 32) { - if (declaration.kind === 230 + if (declaration.kind === 233 && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -31081,11 +31877,11 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 200) { + else if (declaration.kind === 203) { var container = ts.getThisContainer(node, false); while (container !== undefined) { if (container.parent === declaration) { - if (container.kind === 150 && ts.hasModifier(container, 32)) { + if (container.kind === 151 && ts.hasModifier(container, 32)) { getNodeLinks(declaration).flags |= 8388608; getNodeLinks(node).flags |= 16777216; } @@ -31099,7 +31895,7 @@ var ts; checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - var type = getDeclaredOrApparentType(localOrExportSymbol, node); + var type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { if (!(localOrExportSymbol.flags & 3)) { @@ -31126,22 +31922,23 @@ var ts; if (!declaration) { return type; } - var isParameter = ts.getRootDeclaration(declaration).kind === 147; + var isParameter = ts.getRootDeclaration(declaration).kind === 148; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; - while (flowContainer !== declarationContainer && (flowContainer.kind === 187 || - flowContainer.kind === 188 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + var isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); + while (flowContainer !== declarationContainer && (flowContainer.kind === 190 || + flowContainer.kind === 191 || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } - var assumeInitialized = isParameter || isAlias || isOuterVariable || + var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1) !== 0 || - isInTypeQuery(node) || node.parent.kind === 247) || - node.parent.kind === 204 || - declaration.kind === 227 && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 250) || + node.parent.kind === 207 || + declaration.kind === 230 && declaration.exclamationToken || declaration.flags & 2097152; - var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); @@ -31166,7 +31963,7 @@ var ts; function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 || (symbol.flags & (2 | 32)) === 0 || - symbol.valueDeclaration.parent.kind === 264) { + symbol.valueDeclaration.parent.kind === 267) { return; } var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); @@ -31184,8 +31981,8 @@ var ts; if (usedInFunction) { getNodeLinks(current).flags |= 65536; } - if (container.kind === 215 && - ts.getAncestor(symbol.valueDeclaration, 228).parent === container && + if (container.kind === 218 && + ts.getAncestor(symbol.valueDeclaration, 231).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152; } @@ -31197,14 +31994,14 @@ var ts; } function isAssignedInBodyOfForStatement(node, container) { var current = node; - while (current.parent.kind === 186) { + while (current.parent.kind === 189) { current = current.parent; } var isAssigned = false; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 193 || current.parent.kind === 194)) { + else if ((current.parent.kind === 196 || current.parent.kind === 197)) { var expr = current.parent; isAssigned = expr.operator === 43 || expr.operator === 44; } @@ -31215,7 +32012,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2; - if (container.kind === 150 || container.kind === 153) { + if (container.kind === 151 || container.kind === 154) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4; } @@ -31259,42 +32056,50 @@ var ts; function checkThisExpression(node) { var container = ts.getThisContainer(node, true); var needToCaptureLexicalThis = false; - if (container.kind === 153) { + if (container.kind === 154) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } - if (container.kind === 188) { + if (container.kind === 191) { container = ts.getThisContainer(container, false); needToCaptureLexicalThis = (languageVersion < 2); } switch (container.kind) { - case 234: + case 237: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); break; - case 233: + case 236: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); break; - case 153: + case 154: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); } break; + case 151: case 150: - case 149: if (ts.hasModifier(container, 32)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); } break; - case 145: + case 146: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } + var type = tryGetThisTypeAt(node, container); + if (!type && noImplicitThis) { + error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + } + return type || anyType; + } + function tryGetThisTypeAt(node, container) { + if (container === void 0) { container = ts.getThisContainer(node, false); } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { - if (container.kind === 187 && - container.parent.kind === 195 && + if (container.kind === 190 && + container.parent.kind === 198 && ts.getSpecialPropertyAssignmentKind(container.parent) === 3) { var className = container.parent .left @@ -31302,12 +32107,12 @@ var ts; .expression; var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16)) { - return getInferredClassType(classSymbol); + return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { - return thisType; + return getFlowTypeOfReference(node, thisType); } } if (ts.isClassLike(container.parent)) { @@ -31318,17 +32123,13 @@ var ts; if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); if (type && type !== unknownType) { - return type; + return getFlowTypeOfReference(node, type); } } - if (noImplicitThis) { - error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); - } - return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 277) { + if (jsdocType && jsdocType.kind === 280) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -31338,14 +32139,14 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 147; }); + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 182 && node.parent.expression === node; + var isCallExpression = node.parent.kind === 185 && node.parent.expression === node; var container = ts.getSuperContainer(node, true); var needToCaptureLexicalThis = false; if (!isCallExpression) { - while (container && container.kind === 188) { + while (container && container.kind === 191) { container = ts.getSuperContainer(container, true); needToCaptureLexicalThis = languageVersion < 2; } @@ -31353,14 +32154,14 @@ var ts; var canUseSuperExpression = isLegalUsageOfSuperExpression(container); var nodeCheckFlag = 0; if (!canUseSuperExpression) { - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 145; }); - if (current && current.kind === 145) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146; }); + if (current && current.kind === 146) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 179)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 182)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -31368,7 +32169,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 153) { + if (!isCallExpression && container.kind === 154) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32) || isCallExpression) { @@ -31378,7 +32179,7 @@ var ts; nodeCheckFlag = 256; } getNodeLinks(node).flags |= nodeCheckFlag; - if (container.kind === 152 && ts.hasModifier(container, 256)) { + if (container.kind === 153 && ts.hasModifier(container, 256)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096; } @@ -31389,7 +32190,7 @@ var ts; if (needToCaptureLexicalThis) { captureLexicalThis(node.parent, container); } - if (container.parent.kind === 179) { + if (container.parent.kind === 182) { if (languageVersion < 2) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -31408,7 +32209,7 @@ var ts; if (!baseClassType) { return unknownType; } - if (container.kind === 153 && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 154 && isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; } @@ -31420,24 +32221,24 @@ var ts; return false; } if (isCallExpression) { - return container.kind === 153; + return container.kind === 154; } else { - if (ts.isClassLike(container.parent) || container.parent.kind === 179) { + if (ts.isClassLike(container.parent) || container.parent.kind === 182) { if (ts.hasModifier(container, 32)) { - return container.kind === 152 || - container.kind === 151 || - container.kind === 154 || - container.kind === 155; + return container.kind === 153 || + container.kind === 152 || + container.kind === 155 || + container.kind === 156; } else { - return container.kind === 152 || - container.kind === 151 || - container.kind === 154 || + return container.kind === 153 || + container.kind === 152 || container.kind === 155 || + container.kind === 156 || + container.kind === 151 || container.kind === 150 || - container.kind === 149 || - container.kind === 153; + container.kind === 154; } } } @@ -31445,10 +32246,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 152 || - func.kind === 154 || - func.kind === 155) && func.parent.kind === 179 ? func.parent : - func.kind === 187 && func.parent.kind === 265 ? func.parent.parent : + return (func.kind === 153 || + func.kind === 155 || + func.kind === 156) && func.parent.kind === 182 ? func.parent : + func.kind === 190 && func.parent.kind === 268 ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -31460,7 +32261,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 188) { + if (func.kind === 191) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -31484,7 +32285,7 @@ var ts; if (thisType) { return instantiateType(thisType, getContextualMapper(containingLiteral)); } - if (literal.parent.kind !== 265) { + if (literal.parent.kind !== 268) { break; } literal = literal.parent.parent; @@ -31493,9 +32294,9 @@ var ts; return contextualType ? getNonNullableType(contextualType) : checkExpressionCached(containingLiteral); } var parent = func.parent; - if (parent.kind === 195 && parent.operatorToken.kind === 58) { + if (parent.kind === 198 && parent.operatorToken.kind === 58) { var target = parent.left; - if (target.kind === 180 || target.kind === 181) { + if (target.kind === 183 || target.kind === 184) { var expression = target.expression; if (inJs && ts.isIdentifier(expression)) { var sourceFile = ts.getSourceFileOfNode(parent); @@ -31514,7 +32315,7 @@ var ts; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); if (iife && iife.arguments) { - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (parameter.dotDotDotToken) { var restTypes = []; for (var i = indexOfParameter; i < iife.arguments.length; i++) { @@ -31535,7 +32336,7 @@ var ts; if (contextualSignature) { var funcHasRestParameters = ts.hasRestParameter(func); var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (ts.getThisParameter(func) !== undefined && !contextualSignature.thisParameter) { ts.Debug.assert(indexOfParameter !== 0); indexOfParameter -= 1; @@ -31554,12 +32355,12 @@ var ts; } function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; - if (node === declaration.initializer || node.kind === 58) { + if (ts.hasInitializer(declaration) && node === declaration.initializer) { var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 147) { + if (declaration.kind === 148) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -31571,7 +32372,7 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 177) { + if (parentDeclaration.kind !== 180) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !ts.isBindingPattern(name)) { var text = ts.getTextOfPropertyName(name); @@ -31625,7 +32426,7 @@ var ts; return false; } function getContextualReturnType(functionDecl) { - if (functionDecl.kind === 153 || + if (functionDecl.kind === 154 || ts.getEffectiveReturnTypeNode(functionDecl) || isGetAccessorWithAnnotatedSetAccessor(functionDecl)) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); @@ -31638,15 +32439,15 @@ var ts; } function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); - var argIndex = ts.indexOf(args, arg); - if (argIndex >= 0) { - var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + var argIndex = args.indexOf(arg); + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 184) { + if (template.parent.kind === 187) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -31663,11 +32464,6 @@ var ts; case 53: case 26: return node === right ? getContextualType(binaryExpression) : undefined; - case 34: - case 32: - case 35: - case 33: - return node === operatorToken ? getTypeOfExpression(binaryExpression.left) : undefined; default: return undefined; } @@ -31692,10 +32488,10 @@ var ts; return mapType(type, function (t) { var prop = t.flags & 458752 ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; - }); + }, true); } function getIndexTypeOfContextualType(type, kind) { - return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, true); } function contextualTypeIsTupleLikeType(type) { return !!(type.flags & 131072 ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); @@ -31732,40 +32528,29 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + function getContextualTypeForChildJsxExpression(node) { + var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; + } function getContextualTypeForJsxExpression(node) { - var jsxAttributes = ts.isJsxAttributeLike(node.parent) ? - node.parent.parent : - ts.isJsxElement(node.parent) ? - node.parent.openingElement.attributes : - undefined; - if (!jsxAttributes) { - return undefined; - } - var attributesType = getContextualType(jsxAttributes); - if (!attributesType || isTypeAny(attributesType)) { - return undefined; - } - if (ts.isJsxAttribute(node.parent)) { - return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); - } - else if (node.parent.kind === 250) { - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; - } - else { - return attributesType; - } + var exprParent = node.parent; + return ts.isJsxAttributeLike(exprParent) + ? getContextualType(node) + : ts.isJsxElement(exprParent) + ? getContextualTypeForChildJsxExpression(exprParent) + : undefined; } function getContextualTypeForJsxAttribute(attribute) { - var attributesType = getContextualType(attribute.parent); if (ts.isJsxAttribute(attribute)) { + var attributesType = getApparentTypeOfContextualType(attribute.parent); if (!attributesType || isTypeAny(attributesType)) { return undefined; } return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { - return attributesType; + return getContextualType(attribute.parent); } } function getApparentTypeOfContextualType(node) { @@ -31779,7 +32564,7 @@ var ts; var prop = _a[_i]; if (!prop.symbol) continue; - if (prop.kind !== 265) + if (prop.kind !== 268) continue; if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) { var discriminatingType = getTypeOfNode(prop.initializer); @@ -31809,61 +32594,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 227: - case 147: + case 230: + case 148: + case 151: case 150: - case 149: - case 177: + case 180: return getContextualTypeForInitializerExpression(node); - case 188: - case 220: + case 191: + case 223: return getContextualTypeForReturnExpression(node); - case 198: + case 201: return getContextualTypeForYieldOperand(parent); - case 183: - if (node.kind === 94) { - return getContextualType(parent); - } - case 182: - return getContextualTypeForArgument(parent, node); case 185: - case 203: + case 186: + return getContextualTypeForArgument(parent, node); + case 188: + case 206: return getTypeFromTypeNode(parent.type); - case 195: + case 198: return getContextualTypeForBinaryOperand(node); - case 265: - case 266: + case 268: + case 269: return getContextualTypeForObjectLiteralElement(parent); - case 267: + case 270: return getApparentTypeOfContextualType(parent.parent); - case 178: { + case 181: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 196: + case 199: return getContextualTypeForConditionalOperand(node); - case 206: - ts.Debug.assert(parent.parent.kind === 197); + case 209: + ts.Debug.assert(parent.parent.kind === 200); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 186: { + case 189: { var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent); } - case 260: + case 263: return getContextualTypeForJsxExpression(parent); - case 257: - case 259: + case 260: + case 262: return getContextualTypeForJsxAttribute(parent); - case 252: - case 251: - return getAttributesTypeFromJsxOpeningLikeElement(parent); - case 261: { - if (node.kind === 73) { - var switchStatement = parent.parent.parent; - return getTypeOfExpression(switchStatement.expression); - } - } + case 255: + case 254: + return getContextualJsxElementAttributesType(parent); } return undefined; } @@ -31871,8 +32647,112 @@ var ts; node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); return node ? node.contextualMapper : identityMapper; } + function getContextualJsxElementAttributesType(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + var valueType = checkExpression(node.tagName); + if (isTypeAny(valueType)) { + return anyType; + } + var isJs = ts.isInJavaScriptFile(node); + return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + } + function getJsxSignaturesParameterTypes(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, false); + } + function getJsxSignaturesParameterTypesJs(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, true); + } + function getJsxSignaturesParameterTypesInternal(valueType, isJs) { + if (valueType.flags & 2) { + return anyType; + } + else if (valueType.flags & 32) { + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + if (intrinsicElementsType !== unknownType) { + var stringLiteralTypeName = valueType.value; + var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); + if (intrinsicProp) { + return getTypeOfSymbol(intrinsicProp); + } + var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0); + if (indexSignatureType) { + return indexSignatureType; + } + } + return anyType; + } + var signatures = getSignaturesOfType(valueType, 1); + var ctor = true; + if (signatures.length === 0) { + signatures = getSignaturesOfType(valueType, 0); + ctor = false; + if (signatures.length === 0) { + return unknownType; + } + } + return getUnionType(ts.map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), 0); + } + function getJsxPropsTypeFromCallSignature(sig) { + var propsType = getTypeOfFirstParameterOfSignature(sig); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + propsType = intersectTypes(intrinsicAttribs, propsType); + } + return propsType; + } + function getJsxPropsTypeFromClassType(hostClassType, isJs) { + if (isTypeAny(hostClassType)) { + return hostClassType; + } + var propsName = getJsxElementPropertiesName(); + if (propsName === undefined) { + return anyType; + } + else if (propsName === "") { + return hostClassType; + } + else { + var attributesType = getTypeOfPropertyOfType(hostClassType, propsName); + if (!attributesType) { + return emptyObjectType; + } + else if (isTypeAny(attributesType)) { + return attributesType; + } + else { + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + apparentAttributesType = intersectTypes(typeParams + ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs)) + : intrinsicClassAttribs, apparentAttributesType); + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return apparentAttributesType; + } + } + } + function getJsxPropsTypeFromConstructSignatureJs(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, true); + } + function getJsxPropsTypeFromConstructSignature(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, false); + } + function getJsxPropsTypeFromConstructSignatureInternal(sig, isJs) { + var hostClassType = getReturnTypeOfSignature(sig); + if (hostClassType) { + return getJsxPropsTypeFromClassType(hostClassType, isJs); + } + return getJsxPropsTypeFromCallSignature(sig); + } function getContextualCallSignature(type, node) { - var signatures = getSignaturesOfStructuredType(type, 0); + var signatures = getSignaturesOfType(type, 0); if (signatures.length === 1) { var signature = signatures[0]; if (!isAritySmaller(signature, node)) { @@ -31895,7 +32775,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 187 || node.kind === 188; + return node.kind === 190 || node.kind === 191; } function getContextualSignatureForFunctionLikeDeclaration(node) { return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) @@ -31908,7 +32788,7 @@ var ts; getApparentTypeOfContextualType(node); } function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -31918,8 +32798,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var current = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -31936,7 +32816,6 @@ var ts; var result; if (signatureList) { result = cloneSignature(signatureList[0]); - result.resolvedReturnType = undefined; result.unionSignatures = signatureList; } return result; @@ -31949,8 +32828,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false, false); } function hasDefaultValue(node) { - return (node.kind === 177 && !!node.initializer) || - (node.kind === 195 && node.operatorToken.kind === 58); + return (node.kind === 180 && !!node.initializer) || + (node.kind === 198 && node.operatorToken.kind === 58); } function checkArrayLiteral(node, checkMode) { var elements = node.elements; @@ -31960,7 +32839,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); for (var index = 0; index < elements.length; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 199) { + if (inDestructuringPattern && e.kind === 202) { var restArrayType = checkExpression(e.expression, checkMode); var restElementType = getIndexTypeOfType(restArrayType, 1) || getIteratedTypeOrElementType(restArrayType, undefined, false, false, false); @@ -31973,7 +32852,7 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 199; + hasSpreadElement = hasSpreadElement || e.kind === 202; } if (!hasSpreadElement) { if (inDestructuringPattern && elementTypes.length) { @@ -31983,7 +32862,7 @@ var ts; } if (contextualType && contextualTypeIsTupleLikeType(contextualType)) { var pattern = contextualType.pattern; - if (pattern && (pattern.kind === 176 || pattern.kind === 178)) { + if (pattern && (pattern.kind === 179 || pattern.kind === 181)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -31991,10 +32870,10 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 201) { + if (patternElement.kind !== 204) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - elementTypes.push(unknownType); + elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); } } } @@ -32004,12 +32883,12 @@ var ts; } } return createArrayType(elementTypes.length ? - getUnionType(elementTypes, true) : + getUnionType(elementTypes, 2) : strictNullChecks ? implicitNeverType : undefinedWideningType); } function isNumericName(name) { switch (name.kind) { - case 145: + case 146: return isNumericComputedName(name); case 71: return isNumericLiteralName(name.escapedText); @@ -32051,7 +32930,7 @@ var ts; propTypes.push(getTypeOfSymbol(properties[i])); } } - var unionType = propTypes.length ? getUnionType(propTypes, true) : undefinedType; + var unionType = propTypes.length ? getUnionType(propTypes, 2) : undefinedType; return createIndexInfo(unionType, false); } function checkObjectLiteral(node, checkMode) { @@ -32060,10 +32939,10 @@ var ts; var propertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; - var propagatedFlags = 0; + var propagatedFlags = 8388608; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 175 || contextualType.pattern.kind === 179); + (contextualType.pattern.kind === 178 || contextualType.pattern.kind === 182); var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; @@ -32075,16 +32954,16 @@ var ts; var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); var literalName = void 0; - if (memberDecl.kind === 265 || - memberDecl.kind === 266 || + if (memberDecl.kind === 268 || + memberDecl.kind === 269 || ts.isObjectLiteralMethod(memberDecl)) { var jsdocType = void 0; if (isInJSFile) { jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl); } var type = void 0; - if (memberDecl.kind === 265) { - if (memberDecl.name.kind === 145) { + if (memberDecl.kind === 268) { + if (memberDecl.name.kind === 146) { var t = checkComputedPropertyName(memberDecl.name); if (t.flags & 224) { literalName = ts.escapeLeadingUnderscores("" + t.value); @@ -32092,11 +32971,11 @@ var ts; } type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 152) { + else if (memberDecl.kind === 153) { type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 266); + ts.Debug.assert(memberDecl.kind === 269); type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -32109,8 +32988,8 @@ var ts; ? createSymbol(4 | member.flags, getLateBoundNameFromType(nameType), 1024) : createSymbol(4 | member.flags, literalName || member.escapedName); if (inDestructuringPattern) { - var isOptional = (memberDecl.kind === 265 && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 266 && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 268 && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 269 && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216; } @@ -32136,12 +33015,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 267) { + else if (memberDecl.kind === 270) { if (languageVersion < 2) { checkExternalEmitHelpers(memberDecl, 2); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 0); propertiesArray = []; propertiesTable = ts.createSymbolTable(); hasComputedStringProperty = false; @@ -32153,12 +33032,12 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, node.symbol, propagatedFlags); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags, 0); offset = i + 1; continue; } else { - ts.Debug.assert(memberDecl.kind === 154 || memberDecl.kind === 155); + ts.Debug.assert(memberDecl.kind === 155 || memberDecl.kind === 156); checkNodeDeferred(memberDecl); } if (!literalName && hasNonBindableDynamicName(memberDecl)) { @@ -32188,7 +33067,7 @@ var ts; } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, 0); } return spread; } @@ -32197,8 +33076,8 @@ var ts; var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0) : undefined; var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 2097152; - result.flags |= 8388608 | freshObjectLiteralFlag | (typeFlags & 29360128); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608; + result.flags |= 33554432 | freshObjectLiteralFlag | (typeFlags & 117440512); result.objectFlags |= 128; if (patternWithComputedProperties) { result.objectFlags |= 512; @@ -32207,23 +33086,23 @@ var ts; result.pattern = node; } if (!(result.flags & 12288)) { - propagatedFlags |= (result.flags & 29360128); + propagatedFlags |= (result.flags & 117440512); } return result; } } function isValidSpreadType(type) { - return !!(type.flags & (1 | 33554432) || + return !!(type.flags & (1 | 134217728) || getFalsyFlags(type) & 14560 && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 65536 && !isGenericMappedType(type) || type.flags & 393216 && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } - function checkJsxSelfClosingElement(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node); + function checkJsxSelfClosingElement(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); return getJsxGlobalElementType() || anyType; } - function checkJsxElement(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); + function checkJsxElement(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement, checkMode); if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) { getIntrinsicTagSymbol(node.closingElement); } @@ -32232,8 +33111,8 @@ var ts; } return getJsxGlobalElementType() || anyType; } - function checkJsxFragment(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); + function checkJsxFragment(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); if (compilerOptions.jsx === 2 && compilerOptions.jsxFactory) { error(node, ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); } @@ -32244,7 +33123,7 @@ var ts; } function isJsxIntrinsicIdentifier(tagName) { switch (tagName.kind) { - case 180: + case 183: case 99: return false; case 71: @@ -32253,22 +33132,24 @@ var ts; ts.Debug.fail(); } } - function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + function checkJsxAttribute(node, checkMode) { + return node.initializer + ? checkExpressionForMutableLocation(node.initializer, checkMode) + : trueType; + } + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) { var attributes = openingLikeElement.attributes; var attributesTable = ts.createSymbolTable(); var spread = emptyObjectType; - var attributesArray = []; var hasSpreadAnyType = false; var typeToIntersect; var explicitlySpecifyChildrenAttribute = false; - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { var attributeDecl = _a[_i]; var member = attributeDecl.symbol; if (ts.isJsxAttribute(attributeDecl)) { - var exprType = attributeDecl.initializer ? - checkExpression(attributeDecl.initializer, checkMode) : - trueType; + var exprType = checkJsxAttribute(attributeDecl, checkMode); var attributeSymbol = createSymbol(4 | 33554432 | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; @@ -32278,24 +33159,22 @@ var ts; attributeSymbol.type = exprType; attributeSymbol.target = member; attributesTable.set(attributeSymbol.escapedName, attributeSymbol); - attributesArray.push(attributeSymbol); if (attributeDecl.name.escapedText === jsxChildrenPropertyName) { explicitlySpecifyChildrenAttribute = true; } } else { - ts.Debug.assert(attributeDecl.kind === 259); - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, 0); - attributesArray = []; + ts.Debug.assert(attributeDecl.kind === 262); + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096); attributesTable = ts.createSymbolTable(); } - var exprType = checkExpression(attributeDecl.expression); + var exprType = checkExpressionCached(attributeDecl.expression, checkMode); if (isTypeAny(exprType)) { hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType, openingLikeElement.symbol, 0); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, 0, 4096); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -32303,21 +33182,11 @@ var ts; } } if (!hasSpreadAnyType) { - if (spread !== emptyObjectType) { - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, 0); - } - attributesArray = getPropertiesOfType(spread); - } - attributesTable = ts.createSymbolTable(); - for (var _b = 0, attributesArray_1 = attributesArray; _b < attributesArray_1.length; _b++) { - var attr = attributesArray_1[_b]; - if (!filter || filter(attr)) { - attributesTable.set(attr.escapedName, attr); - } + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 0, 4096); } } - var parent = openingLikeElement.parent.kind === 250 ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 253 ? openingLikeElement.parent : undefined; if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") { @@ -32327,20 +33196,20 @@ var ts; var childrenPropSymbol = createSymbol(4 | 33554432, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : - createArrayType(getUnionType(childrenTypes, false)); - attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol); + createArrayType(getUnionType(childrenTypes)); + var childPropMap = ts.createSymbolTable(); + childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); + spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, undefined, undefined), attributes.symbol, 0, 4096); } } if (hasSpreadAnyType) { return anyType; } - var attributeType = createJsxAttributesType(attributes.symbol, attributesTable); - return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) : - typeToIntersect ? typeToIntersect : attributeType; - function createJsxAttributesType(symbol, attributesTable) { - var result = createAnonymousType(symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined); - result.flags |= 67108864 | 8388608; - result.objectFlags |= 128; + return typeToIntersect && spread !== emptyObjectType ? getIntersectionType([typeToIntersect, spread]) : (typeToIntersect || spread); + function createJsxAttributesType() { + var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, undefined, undefined); + result.flags |= 33554432; + result.objectFlags |= 128 | 4096; return result; } } @@ -32354,13 +33223,13 @@ var ts; } } else { - childrenTypes.push(checkExpression(child, checkMode)); + childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } } return childrenTypes; } function checkJsxAttributes(node, checkMode) { - return createJsxAttributesTypeFromAttributesProperty(node.parent, undefined, checkMode); + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } function getJsxType(name) { var jsxType = jsxTypes.get(name); @@ -32416,14 +33285,15 @@ var ts; var signature = signatures_3[_i]; if (signature.typeParameters) { var isJavascript = ts.isInJavaScriptFile(node); - var typeArguments = fillMissingTypeArguments(undefined, signature.typeParameters, 0, isJavascript); + var inferenceContext = createInferenceContext(signature, isJavascript ? 4 : 0); + var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } else { instantiatedSignatures.push(signature); } } - return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), true); + return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2); } function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer) { var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920, undefined); @@ -32450,7 +33320,7 @@ var ts; } return _jsxElementPropertiesName; } - function getJsxElementChildrenPropertyname() { + function getJsxElementChildrenPropertyName() { if (!_hasComputedJsxElementChildrenPropertyName) { _hasComputedJsxElementChildrenPropertyName = true; _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); @@ -32537,12 +33407,11 @@ var ts; return undefined; } function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 131072) { var types = elementType.types; return getUnionType(types.map(function (type) { return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); - }), true); + }), 2); } if (elementType.flags & 2) { return anyType; @@ -32573,45 +33442,7 @@ var ts; if (elementClassType) { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - if (isTypeAny(elemInstanceType)) { - return elemInstanceType; - } - var propsName = getJsxElementPropertiesName(); - if (propsName === undefined) { - return anyType; - } - else if (propsName === "") { - return elemInstanceType; - } - else { - var attributesType = getTypeOfPropertyOfType(elemInstanceType, propsName); - if (!attributesType) { - return emptyObjectType; - } - else if (isTypeAny(attributesType) || (attributesType === unknownType)) { - return attributesType; - } - else { - var apparentAttributesType = attributesType; - var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); - if (intrinsicClassAttribs !== unknownType) { - var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); - if (typeParams) { - if (typeParams.length === 1) { - apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); - } - } - else { - apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); - } - } - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttribs !== unknownType) { - apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); - } - return apparentAttributesType; - } - } + return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement)); } function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) { ts.Debug.assert(isJsxIntrinsicIdentifier(node.tagName)); @@ -32631,13 +33462,7 @@ var ts; return links.resolvedJsxElementAttributesType; } function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { - var links = getNodeLinks(node); - var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; - if (!links[linkLocation]) { - var elemClassType = getJsxGlobalElementClassType(); - return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, undefined, elemClassType); - } - return links[linkLocation]; + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); } function getAllAttributesTypeFromJsxOpeningLikeElement(node) { if (isJsxIntrinsicIdentifier(node.tagName)) { @@ -32695,7 +33520,7 @@ var ts; } } } - function checkJsxOpeningLikeElementOrOpeningFragment(node) { + function checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode) { var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(node); if (isNodeOpeningLikeElement) { checkGrammarJsxElement(node); @@ -32706,13 +33531,13 @@ var ts; var reactLocation = isNodeOpeningLikeElement ? node.tagName : node; var reactSym = resolveName(reactLocation, reactNamespace, 107455, reactRefErr, reactNamespace, true); if (reactSym) { - reactSym.isReferenced = true; + reactSym.isReferenced = 67108863; if (reactSym.flags & 2097152 && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { markAliasSymbolAsReferenced(reactSym); } } if (isNodeOpeningLikeElement) { - checkJsxAttributesAssignableToTagNameAttributes(node); + checkJsxAttributesAssignableToTagNameAttributes(node, checkMode); } else { checkJsxChildren(node.parent); @@ -32738,14 +33563,12 @@ var ts; } return false; } - function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement, checkMode) { var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : getCustomJsxElementAttributesType(openingLikeElement, false); - var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { - return isUnhyphenatedJsxName(attribute.escapedName) || !!(getPropertyOfType(targetAttributesType, attribute.escapedName)); - }); - if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode); + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName())); } else { @@ -32753,8 +33576,13 @@ var ts; if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) { for (var _i = 0, _a = openingLikeElement.attributes.properties; _i < _a.length; _i++) { var attribute = _a[_i]; - if (ts.isJsxAttribute(attribute) && !isKnownProperty(targetAttributesType, attribute.name.escapedText, true)) { - error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attribute.name), typeToString(targetAttributesType)); + if (!ts.isJsxAttribute(attribute)) { + continue; + } + var attrName = attribute.name; + var isNotIgnoredJsxProperty = (isUnhyphenatedJsxName(ts.idText(attrName)) || !!(getPropertyOfType(targetAttributesType, attrName.escapedText))); + if (isNotIgnoredJsxProperty && !isKnownProperty(targetAttributesType, attrName.escapedText, true)) { + error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attrName), typeToString(targetAttributesType)); break; } } @@ -32774,7 +33602,7 @@ var ts; } } function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 150; + return s.valueDeclaration ? s.valueDeclaration.kind : 151; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; @@ -32784,7 +33612,7 @@ var ts; } function checkPropertyAccessibility(node, left, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 180 || node.kind === 227 ? + var errorNode = node.kind === 183 || node.kind === 230 ? node.name : node.right; if (ts.getCheckFlags(prop) & 256) { @@ -32847,19 +33675,19 @@ var ts; function symbolHasNonMethodDeclaration(symbol) { return forEachProperty(symbol, function (prop) { var propKind = getDeclarationKindFromSymbol(prop); - return propKind !== 152 && propKind !== 151; + return propKind !== 153 && propKind !== 152; }); } - function checkNonNullExpression(node) { - return checkNonNullType(checkExpression(node), node); + function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { + return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic); } - function checkNonNullType(type, errorNode) { + function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 12288; if (kind) { - error(errorNode, kind & 4096 ? kind & 8192 ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); + error(node, kind & 4096 ? kind & 8192 ? + (nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) : + (undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) : + (nullDiagnostic || ts.Diagnostics.Object_is_possibly_null)); var t = getNonNullableType(type); return t.flags & (12288 | 16384) ? unknownType : t; } @@ -32873,15 +33701,20 @@ var ts; } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var propType; - var leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - var leftWasReferenced = leftSymbol && getSymbolLinks(leftSymbol).referenced; var leftType = checkNonNullExpression(left); + var parentSymbol = getNodeLinks(left).resolvedSymbol; var apparentType = getApparentType(getWidenedType(leftType)); if (isTypeAny(apparentType) || apparentType === silentNeverType) { + if (ts.isIdentifier(left) && parentSymbol) { + markAliasReferenced(parentSymbol, node); + } return apparentType; } var assignmentKind = ts.getAssignmentTargetKind(node); var prop = getPropertyOfType(apparentType, right.escapedText); + if (ts.isIdentifier(left) && parentSymbol && !(prop && isConstEnumOrConstEnumOnlyModule(prop))) { + markAliasReferenced(parentSymbol, node); + } if (!prop) { var indexInfo = getIndexInfoOfType(apparentType, 0); if (!(indexInfo && indexInfo.type)) { @@ -32898,11 +33731,6 @@ var ts; else { checkPropertyNotUsedBeforeDeclaration(prop, node, right); markPropertyAsReferenced(prop, node, left.kind === 99); - leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - if (leftSymbol && !leftWasReferenced && getSymbolLinks(leftSymbol).referenced && - !(isNonLocalAlias(leftSymbol, 107455) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(prop))) { - getSymbolLinks(leftSymbol).referenced = undefined; - } getNodeLinks(node).resolvedSymbol = prop; checkPropertyAccessibility(node, left, apparentType, prop); if (assignmentKind) { @@ -32911,9 +33739,9 @@ var ts; return unknownType; } } - propType = getDeclaredOrApparentType(prop, node); + propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); } - if (node.kind !== 180 || + if (node.kind !== 183 || assignmentKind === 1 || prop && !(prop.flags & (3 | 4 | 98304)) && !(prop.flags & 8192 && propType.flags & 131072)) { return propType; @@ -32923,7 +33751,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 153 && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 154 && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -32945,8 +33773,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right)); } - else if (valueDeclaration.kind === 230 && - node.parent.kind !== 160 && + else if (valueDeclaration.kind === 233 && + node.parent.kind !== 161 && !(valueDeclaration.flags & 2097152) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right)); @@ -32955,9 +33783,9 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 150: + case 151: return true; - case 265: + case 268: return false; default: return ts.isExpressionNode(node) ? false : "quit"; @@ -32965,6 +33793,9 @@ var ts; }); } function isPropertyDeclaredInAncestorClass(prop) { + if (!(prop.parent.flags & 32)) { + return false; + } var classType = getTypeOfSymbol(prop.parent); while (true) { classType = getSuperClass(classType); @@ -33011,7 +33842,7 @@ var ts; } function getSuggestionForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, undefined, outerName, false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, undefined, outerName, false, false, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); return symbol || getSpellingSuggestionForName(ts.unescapeLeadingUnderscores(name), ts.arrayFrom(symbols.values()), meaning); @@ -33093,52 +33924,48 @@ var ts; return res > max ? undefined : res; } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (prop && - noUnusedIdentifiers && - (prop.flags & 106500) && - prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8) - && !(nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly))) { - if (isThisAccess) { - var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); - if (containingMethod && containingMethod.symbol === prop) { - return; - } - } - if (ts.getCheckFlags(prop) & 1) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; + if (!prop || !noUnusedIdentifiers || !(prop.flags & 106500) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8)) { + return; + } + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 && !(prop.flags & 32768))) { + return; + } + if (isThisAccess) { + var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); + if (containingMethod && containingMethod.symbol === prop) { + return; } } + (ts.getCheckFlags(prop) & 1 ? getSymbolLinks(prop).target : prop).isReferenced = 67108863; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 180 - ? node.expression - : node.left; + var left = node.kind === 183 ? node.expression : node.left; return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left))); } + function isValidPropertyAccessForCompletions(node, type, property) { + return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) + && (!(property.flags & 8192) || isValidMethodAccess(property, type)); + } + function isValidMethodAccess(method, type) { + var propType = getTypeOfFuncClassEnumModule(method); + var signatures = getSignaturesOfType(getNonNullableType(propType), 0); + ts.Debug.assert(signatures.length !== 0); + return signatures.some(function (sig) { + var thisType = getThisTypeOfSignature(sig); + return !thisType || isTypeAssignableTo(type, thisType); + }); + } function isValidPropertyAccessWithType(node, left, propertyName, type) { - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(type, propertyName); - if (prop) { - return checkPropertyAccessibility(node, left, type, prop); - } - if (ts.isInJavaScriptFile(left) && (type.flags & 131072)) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var elementType = _a[_i]; - if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) { - return true; - } - } - } - return false; + if (type === unknownType || isTypeAny(type)) { + return true; } - return true; + var prop = getPropertyOfType(type, propertyName); + return prop ? checkPropertyAccessibility(node, left, type, prop) + : ts.isInJavaScriptFile(node) && (type.flags & 131072) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); }); } function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 228) { + if (initializer.kind === 231) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -33160,7 +33987,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 216 && + if (node.kind === 219 && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -33178,7 +34005,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 183 && node.parent.expression === node) { + if (node.parent.kind === 186 && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -33237,10 +34064,10 @@ var ts; if (callLikeExpressionMayHaveTypeArguments(node)) { ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 184) { + if (node.kind === 187) { checkExpression(node.template); } - else if (node.kind !== 148) { + else if (node.kind !== 149) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -33291,7 +34118,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 199) { + if (arg && arg.kind === 202) { return i; } } @@ -33306,35 +34133,32 @@ var ts; if (ts.isJsxOpeningLikeElement(node)) { return true; } - if (node.kind === 184) { - var tagExpression = node; + if (node.kind === 187) { argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 197) { - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + if (node.template.kind === 200) { + var lastSpan = ts.lastOrUndefined(node.template.templateSpans); ts.Debug.assert(lastSpan !== undefined); callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } else { - var templateLiteral = tagExpression.template; + var templateLiteral = node.template; ts.Debug.assert(templateLiteral.kind === 13); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 148) { + else if (node.kind === 149) { typeArguments = undefined; argCount = getEffectiveArgumentCount(node, undefined, signature); } else { - var callExpression = node; - if (!callExpression.arguments) { - ts.Debug.assert(callExpression.kind === 183); + if (!node.arguments) { + ts.Debug.assert(node.kind === 186); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; + callIsIncomplete = node.arguments.end === node.end; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } var numTypeParameters = ts.length(signature.typeParameters); @@ -33370,10 +34194,19 @@ var ts; inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); if (!contextualMapper) { - inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8); + inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 4); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJavaScriptFile(contextualSignature.declaration)); } + function inferJsxTypeArguments(signature, node, context) { + var skipContextParamType = getTypeAtPosition(signature, 0); + var checkAttrTypeSkipContextSensitive = checkExpressionWithContextualType(node.attributes, skipContextParamType, identityMapper); + inferTypes(context.inferences, checkAttrTypeSkipContextSensitive, skipContextParamType); + var paramType = getTypeAtPosition(signature, 0); + var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context); + inferTypes(context.inferences, checkAttrType, paramType); + return getInferredTypes(context); + } function inferTypeArguments(node, signature, args, excludeArgument, context) { for (var _i = 0, _a = context.inferences; _i < _a.length; _i++) { var inference = _a[_i]; @@ -33381,7 +34214,7 @@ var ts; inference.inferredType = undefined; } } - if (node.kind !== 148) { + if (node.kind !== 149) { var contextualType = getContextualType(node); if (contextualType) { var instantiatedType = instantiateType(contextualType, cloneTypeMapper(getContextualMapper(node))); @@ -33390,7 +34223,7 @@ var ts; getOrCreateTypeFromSignature(getSignatureInstantiation(contextualSignature, contextualSignature.typeParameters, ts.isInJavaScriptFile(node))) : instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 4); } } var thisType = getThisTypeOfSignature(signature); @@ -33402,7 +34235,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 201) { + if (arg === undefined || arg.kind !== 204) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); if (argType === undefined) { @@ -33433,7 +34266,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (!constraint) continue; - var errorInfo = reportErrors && headMessage && ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + var errorInfo = reportErrors && headMessage && (function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }); var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1; if (!mapper) { mapper = createTypeMapper(typeParameters, typeArgumentTypes); @@ -33467,7 +34300,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 183) { + if (thisType && thisType !== voidType && node.kind !== 186) { var thisArgumentNode = getThisArgumentOfCall(node); var thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; var errorNode = reportErrors ? (thisArgumentNode || node) : undefined; @@ -33480,7 +34313,7 @@ var ts; var argCount = getEffectiveArgumentCount(node, args, signature); for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); - if (arg === undefined || arg.kind !== 201) { + if (arg === undefined || arg.kind !== 204) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i) || checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); @@ -33494,28 +34327,28 @@ var ts; return true; } function getThisArgumentOfCall(node) { - if (node.kind === 182) { + if (node.kind === 185) { var callee = node.expression; - if (callee.kind === 180) { + if (callee.kind === 183) { return callee.expression; } - else if (callee.kind === 181) { + else if (callee.kind === 184) { return callee.expression; } } } function getEffectiveCallArguments(node) { - if (node.kind === 184) { + if (node.kind === 187) { var template = node.template; var args_4 = [undefined]; - if (template.kind === 197) { + if (template.kind === 200) { ts.forEach(template.templateSpans, function (span) { args_4.push(span.expression); }); } return args_4; } - else if (node.kind === 148) { + else if (node.kind === 149) { return undefined; } else if (ts.isJsxOpeningLikeElement(node)) { @@ -33526,21 +34359,21 @@ var ts; } } function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 148) { + if (node.kind === 149) { switch (node.parent.kind) { - case 230: - case 200: + case 233: + case 203: return 1; - case 150: + case 151: return 2; - case 152: - case 154: + case 153: case 155: + case 156: if (languageVersion === 0) { return 2; } return signature.parameters.length >= 3 ? 3 : 2; - case 147: + case 148: return 3; } } @@ -33549,41 +34382,41 @@ var ts; } } function getEffectiveDecoratorFirstArgumentType(node) { - if (node.kind === 230) { + if (node.kind === 233) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 147) { + if (node.kind === 148) { node = node.parent; - if (node.kind === 153) { + if (node.kind === 154) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 150 || - node.kind === 152 || - node.kind === 154 || - node.kind === 155) { + if (node.kind === 151 || + node.kind === 153 || + node.kind === 155 || + node.kind === 156) { return getParentTypeOfClassElement(node); } ts.Debug.fail("Unsupported decorator target."); return unknownType; } function getEffectiveDecoratorSecondArgumentType(node) { - if (node.kind === 230) { + if (node.kind === 233) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 147) { + if (node.kind === 148) { node = node.parent; - if (node.kind === 153) { + if (node.kind === 154) { return anyType; } } - if (node.kind === 150 || - node.kind === 152 || - node.kind === 154 || - node.kind === 155) { + if (node.kind === 151 || + node.kind === 153 || + node.kind === 155 || + node.kind === 156) { var element = node; switch (element.name.kind) { case 71: @@ -33591,7 +34424,7 @@ var ts; case 8: case 9: return getLiteralType(element.name.text); - case 145: + case 146: var nameType = checkComputedPropertyName(element.name); if (isTypeAssignableToKind(nameType, 1536)) { return nameType; @@ -33608,20 +34441,20 @@ var ts; return unknownType; } function getEffectiveDecoratorThirdArgumentType(node) { - if (node.kind === 230) { + if (node.kind === 233) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 147) { + if (node.kind === 148) { return numberType; } - if (node.kind === 150) { + if (node.kind === 151) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 152 || - node.kind === 154 || - node.kind === 155) { + if (node.kind === 153 || + node.kind === 155 || + node.kind === 156) { var propertyType = getTypeOfNode(node); return createTypedPropertyDescriptorType(propertyType); } @@ -33642,26 +34475,26 @@ var ts; return unknownType; } function getEffectiveArgumentType(node, argIndex) { - if (node.kind === 148) { + if (node.kind === 149) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 184) { + else if (argIndex === 0 && node.kind === 187) { return getGlobalTemplateStringsArrayType(); } return undefined; } function getEffectiveArgument(node, args, argIndex) { - if (node.kind === 148 || - (argIndex === 0 && node.kind === 184)) { + if (node.kind === 149 || + (argIndex === 0 && node.kind === 187)) { return undefined; } return args[argIndex]; } function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 148) { + if (node.kind === 149) { return node.expression; } - else if (argIndex === 0 && node.kind === 184) { + else if (argIndex === 0 && node.kind === 187) { return node.template; } else { @@ -33669,8 +34502,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, fallbackError) { - var isTaggedTemplate = node.kind === 184; - var isDecorator = node.kind === 148; + var isTaggedTemplate = node.kind === 187; + var isDecorator = node.kind === 149; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { @@ -33703,7 +34536,7 @@ var ts; var candidateForArgumentError; var candidateForTypeArgumentError; var result; - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 182 && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 185 && node.arguments.hasTrailingComma; if (candidates.length > 1) { result = chooseOverload(candidates, subtypeRelation, signatureHelpTrailingComma); } @@ -33731,7 +34564,7 @@ var ts; max = Math.max(max, ts.length(sig.typeParameters)); } var paramCount = min < max ? min + "-" + max : min; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); + diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); } else if (args) { var min = Number.POSITIVE_INFINITY; @@ -33833,7 +34666,7 @@ var ts; } excludeCount--; if (excludeCount > 0) { - excludeArgument[ts.indexOf(excludeArgument, true)] = false; + excludeArgument[excludeArgument.indexOf(true)] = false; } else { excludeArgument = undefined; @@ -33870,7 +34703,7 @@ var ts; } return resolveUntypedCall(node); } - var funcType = checkNonNullExpression(node.expression); + var funcType = checkNonNullExpression(node.expression, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined); if (funcType === silentNeverType) { return silentNeverSignature; } @@ -33891,7 +34724,7 @@ var ts; error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); } else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0); } return resolveErrorCall(node); } @@ -33945,7 +34778,7 @@ var ts; } return signature; } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + invocationError(node, expressionType, 1); return resolveErrorCall(node); } function isConstructorAccessible(node, signature) { @@ -33983,6 +34816,24 @@ var ts; } return true; } + function invocationError(node, apparentType, kind) { + error(node, kind === 0 + ? ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures + : ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature, typeToString(apparentType)); + invocationErrorRecovery(apparentType, kind); + } + function invocationErrorRecovery(apparentType, kind) { + if (!apparentType.symbol) { + return; + } + var importNode = getSymbolLinks(apparentType.symbol).originatingImport; + if (importNode && !ts.isImportCall(importNode)) { + var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); + if (!sigs || !sigs.length) + return; + error(importNode, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime); + } + } function resolveTaggedTemplateExpression(node, candidatesOutArray) { var tagType = checkExpression(node.tag); var apparentType = getApparentType(tagType); @@ -33995,23 +34846,23 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray); } function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 230: - case 200: + case 233: + case 203: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 147: + case 148: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 150: + case 151: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 152: - case 154: + case 153: case 155: + case 156: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -34037,6 +34888,7 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); errorInfo = ts.chainDiagnosticMessages(errorInfo, headMessage); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, errorInfo)); + invocationErrorRecovery(apparentType, 0); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); @@ -34056,8 +34908,8 @@ var ts; if (elementType.flags & 131072) { var types = elementType.types; var result = void 0; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var type = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var type = types_16[_i]; result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); } return result; @@ -34070,16 +34922,16 @@ var ts; } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 182: + case 185: return resolveCallExpression(node, candidatesOutArray); - case 183: + case 186: return resolveNewExpression(node, candidatesOutArray); - case 184: + case 187: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 148: + case 149: return resolveDecorator(node, candidatesOutArray); - case 252: - case 251: + case 255: + case 254: return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } ts.Debug.assertNever(node, "Branch in 'resolveSignature' should be unreachable."); @@ -34139,12 +34991,12 @@ var ts; if (node.expression.kind === 97) { return voidType; } - if (node.kind === 183) { + if (node.kind === 186) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 153 && - declaration.kind !== 157 && - declaration.kind !== 162 && + declaration.kind !== 154 && + declaration.kind !== 158 && + declaration.kind !== 163 && !ts.isJSDocConstructSignature(declaration)) { var funcSymbol = checkExpression(node.expression).symbol; if (!funcSymbol && node.expression.kind === 71) { @@ -34203,16 +35055,18 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol)); } } return createPromiseReturnType(node, anyType); } - function getTypeWithSyntheticDefaultImportType(type, symbol) { + function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) { if (allowSyntheticDefaultImports && type && type !== unknownType) { var synthType = type; if (!synthType.syntheticType) { - if (!getPropertyOfType(type, "default")) { + var file = ts.find(originalSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false); + if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152, "default"); newSymbol.target = resolveSymbol(symbol); @@ -34220,7 +35074,7 @@ var ts; var anonymousSymbol = createSymbol(2048, "__type"); var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, undefined, undefined); anonymousSymbol.type = defaultContainingObject; - synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, 0, 0) : defaultContainingObject; } else { synthType.syntheticType = type; @@ -34244,9 +35098,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 - ? 229 + ? 232 : resolvedRequire.flags & 3 - ? 227 + ? 230 : 0; if (targetDeclarationKind !== 0) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -34285,7 +35139,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return unknownType; } - else if (container.kind === 153) { + else if (container.kind === 154) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -34298,7 +35152,7 @@ var ts; var type = getTypeOfSymbol(symbol); if (strictNullChecks) { var declaration = symbol.valueDeclaration; - if (declaration && declaration.initializer) { + if (declaration && ts.hasInitializer(declaration)) { return getOptionalType(type); } } @@ -34401,22 +35255,21 @@ var ts; return promiseType; } function getReturnTypeFromBody(func, checkMode) { - var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 208) { + if (func.body.kind !== 211) { type = checkExpressionCached(func.body, checkMode); if (functionFlags & 2) { type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); } } else { - var types = void 0; + var types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (functionFlags & 1) { - types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); if (!types || types.length === 0) { var iterableIteratorAny = functionFlags & 2 ? createAsyncIterableIteratorType(anyType) @@ -34428,7 +35281,6 @@ var ts; } } else { - types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { return functionFlags & 2 ? createPromiseReturnType(func, neverType) @@ -34440,8 +35292,9 @@ var ts; : voidType; } } - type = getUnionType(types, true); + type = getUnionType(types, 2); } + var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!contextualSignature) { reportErrorsFromWidening(func, type); } @@ -34514,7 +35367,7 @@ var ts; if (!(func.flags & 128)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 222 && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 225 && isExhaustiveSwitchStatement(statement); })) { return false; } return true; @@ -34540,8 +35393,7 @@ var ts; hasReturnWithNoExpression = true; } }); - if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 187 || func.kind === 188)) { + if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -34549,6 +35401,17 @@ var ts; } return aggregatedTypes; } + function mayReturnNever(func) { + switch (func.kind) { + case 190: + case 191: + return true; + case 153: + return func.parent.kind === 182; + default: + return false; + } + } function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) { if (!produceDiagnostics) { return; @@ -34556,7 +35419,7 @@ var ts; if (returnType && maybeTypeOfKind(returnType, 1 | 2048)) { return; } - if (ts.nodeIsMissing(func.body) || func.body.kind !== 208 || !functionHasImplicitReturn(func)) { + if (func.kind === 152 || ts.nodeIsMissing(func.body) || func.body.kind !== 211 || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256; @@ -34583,13 +35446,13 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); if (checkMode === 1 && isContextSensitive(node)) { checkNodeDeferred(node); return anyFunctionType; } var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 187) { + if (!hasGrammarError && node.kind === 190) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -34620,7 +35483,7 @@ var ts; checkNodeDeferred(node); } } - if (produceDiagnostics && node.kind !== 152) { + if (produceDiagnostics && node.kind !== 153) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithCapturedNewTargetVariable(node, node.name); @@ -34628,7 +35491,7 @@ var ts; return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 152 || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); var returnOrPromisedType = returnTypeNode && @@ -34642,7 +35505,7 @@ var ts; if (!returnTypeNode) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 208) { + if (node.body.kind === 211) { checkSourceElement(node.body); } else { @@ -34677,10 +35540,10 @@ var ts; function isReferenceToReadonlyEntity(expr, symbol) { if (isReadonlySymbol(symbol)) { if (symbol.flags & 4 && - (expr.kind === 180 || expr.kind === 181) && + (expr.kind === 183 || expr.kind === 184) && expr.expression.kind === 99) { var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 153)) { + if (!(func && func.kind === 154)) { return true; } return !(func.parent === symbol.valueDeclaration.parent || func === symbol.valueDeclaration.parent); @@ -34690,13 +35553,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 180 || expr.kind === 181) { + if (expr.kind === 183 || expr.kind === 184) { var node = ts.skipParentheses(expr.expression); if (node.kind === 71) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 241; + return declaration && declaration.kind === 244; } } } @@ -34704,7 +35567,7 @@ var ts; } function checkReferenceExpression(expr, invalidReferenceMessage) { var node = ts.skipOuterExpressions(expr, 2 | 1); - if (node.kind !== 71 && node.kind !== 180 && node.kind !== 181) { + if (node.kind !== 71 && node.kind !== 183 && node.kind !== 184) { error(expr, invalidReferenceMessage); return false; } @@ -34713,7 +35576,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 180 && expr.kind !== 181) { + if (expr.kind !== 183 && expr.kind !== 184) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -34793,13 +35656,13 @@ var ts; return numberType; } function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { + if (type.flags & kind || kind & 536870912 && isGenericMappedType(type)) { return true; } if (type.flags & 393216) { var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var t = types_17[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -34822,7 +35685,7 @@ var ts; (kind & 8192 && isTypeAssignableTo(source, nullType)) || (kind & 4096 && isTypeAssignableTo(source, undefinedType)) || (kind & 512 && isTypeAssignableTo(source, esSymbolType)) || - (kind & 33554432 && isTypeAssignableTo(source, nonPrimitiveType)); + (kind & 134217728 && isTypeAssignableTo(source, nonPrimitiveType)); } function allTypesAssignableToKind(source, kind, strict) { return source.flags & 131072 ? @@ -34857,13 +35720,16 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 | 1536))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 33554432 | 1081344)) { + if (!isTypeAssignableToKind(rightType, 134217728 | 7372800)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; + if (strictNullChecks && properties.length === 0) { + return checkNonNullType(sourceType, node); + } for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); @@ -34871,9 +35737,9 @@ var ts; return sourceType; } function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 265 || property.kind === 266) { + if (property.kind === 268 || property.kind === 269) { var name = property.name; - if (name.kind === 145) { + if (name.kind === 146) { checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { @@ -34886,7 +35752,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1) || getIndexTypeOfType(objectLiteralType, 0); if (type) { - if (property.kind === 266) { + if (property.kind === 269) { return checkDestructuringAssignment(property, type); } else { @@ -34897,7 +35763,7 @@ var ts; error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 267) { + else if (property.kind === 270) { if (languageVersion < 6) { checkExternalEmitHelpers(property, 4); } @@ -34928,8 +35794,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 201) { - if (element.kind !== 199) { + if (element.kind !== 204) { + if (element.kind !== 202) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -34955,7 +35821,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 195 && restExpression.operatorToken.kind === 58) { + if (restExpression.kind === 198 && restExpression.operatorToken.kind === 58) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -34968,7 +35834,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 266) { + if (exprOrAssignment.kind === 269) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { if (strictNullChecks && @@ -34982,21 +35848,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 195 && target.operatorToken.kind === 58) { + if (target.kind === 198 && target.operatorToken.kind === 58) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 179) { + if (target.kind === 182) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 178) { + if (target.kind === 181) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 267 ? + var error = target.parent.kind === 270 ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -35010,35 +35876,35 @@ var ts; case 71: case 9: case 12: - case 184: - case 197: + case 187: + case 200: case 13: case 8: case 101: case 86: case 95: - case 139: - case 187: - case 200: - case 188: - case 178: - case 179: + case 140: case 190: - case 204: - case 251: - case 250: + case 203: + case 191: + case 181: + case 182: + case 193: + case 207: + case 254: + case 253: return true; - case 196: + case 199: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 195: + case 198: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 193: - case 194: + case 196: + case 197: switch (node.operator) { case 51: case 37: @@ -35047,9 +35913,9 @@ var ts; return true; } return false; - case 191: - case 185: - case 203: + case 194: + case 188: + case 206: default: return false; } @@ -35062,7 +35928,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 58 && (left.kind === 179 || left.kind === 178)) { + if (operator === 58 && (left.kind === 182 || left.kind === 181)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } var leftType = checkExpression(left, checkMode); @@ -35175,7 +36041,7 @@ var ts; leftType; case 54: return getTypeFacts(leftType) & 2097152 ? - getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], true) : + getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2) : leftType; case 58: checkAssignmentOperator(rightType); @@ -35291,7 +36157,7 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, checkMode); var type2 = checkExpression(node.whenFalse, checkMode); - return getUnionType([type1, type2], true); + return getUnionType([type1, type2], 2); } function checkTemplateExpression(node) { ts.forEach(node.templateSpans, function (templateSpan) { @@ -35299,21 +36165,31 @@ var ts; }); return stringType; } + function getContextNode(node) { + if (node.kind === 261) { + return node.parent.parent; + } + return node; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - var saveContextualMapper = node.contextualMapper; - node.contextualType = contextualType; - node.contextualMapper = contextualMapper; + var context = getContextNode(node); + var saveContextualType = context.contextualType; + var saveContextualMapper = context.contextualMapper; + context.contextualType = contextualType; + context.contextualMapper = contextualMapper; var checkMode = contextualMapper === identityMapper ? 1 : - contextualMapper ? 2 : 0; + contextualMapper ? 2 : 3; var result = checkExpression(node, checkMode); - node.contextualType = saveContextualType; - node.contextualMapper = saveContextualMapper; + context.contextualType = saveContextualType; + context.contextualMapper = saveContextualMapper; return result; } function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { + if (checkMode) { + return checkExpression(node, checkMode); + } var saveFlowLoopStart = flowLoopStart; flowLoopStart = flowLoopCount; links.resolvedType = checkExpression(node, checkMode); @@ -35323,7 +36199,7 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 185 || node.kind === 203; + return node.kind === 188 || node.kind === 206; } function checkDeclarationInitializer(declaration) { var type = getTypeOfExpression(declaration.initializer, true); @@ -35333,14 +36209,11 @@ var ts; } function isLiteralOfContextualType(candidateType, contextualType) { if (contextualType) { - if (contextualType.flags & 131072 && !(contextualType.flags & 8)) { - var types_19 = contextualType.types; - return ts.some(types_19, function (t) { - return !(t.flags & 128 && containsType(types_19, trueType) && containsType(types_19, falseType)) && - isLiteralOfContextualType(candidateType, t); - }); + if (contextualType.flags & 393216) { + var types = contextualType.types; + return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 1081344) { + if (contextualType.flags & 7372800) { var constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; return constraint.flags & 2 && maybeTypeOfKind(candidateType, 32) || constraint.flags & 4 && maybeTypeOfKind(candidateType, 64) || @@ -35364,14 +36237,14 @@ var ts; getWidenedLiteralLikeTypeForContextualType(type, contextualType); } function checkPropertyAssignment(node, checkMode) { - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); } function checkObjectLiteralMethod(node, checkMode) { checkGrammarMethod(node); - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -35393,7 +36266,7 @@ var ts; return type; } function getTypeOfExpression(node, cache) { - if (node.kind === 182 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) { + if (node.kind === 185 && node.expression.kind !== 97 && !ts.isRequireCall(node, true) && !isSymbolOrSymbolForCall(node)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -35411,7 +36284,7 @@ var ts; } function checkExpression(node, checkMode) { var type; - if (node.kind === 144) { + if (node.kind === 145) { type = checkQualifiedName(node); } else { @@ -35419,11 +36292,12 @@ var ts; type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, checkMode); } if (isConstEnumObjectType(type)) { - var ok = (node.parent.kind === 180 && node.parent.expression === node) || - (node.parent.kind === 181 && node.parent.expression === node) || - ((node.kind === 71 || node.kind === 144) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 183 && node.parent.expression === node) || + (node.parent.kind === 184 && node.parent.expression === node) || + ((node.kind === 71 || node.kind === 145) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 164 && node.parent.exprName === node)); if (!ok) { - error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } } return type; @@ -35455,73 +36329,73 @@ var ts; return trueType; case 86: return falseType; - case 197: + case 200: return checkTemplateExpression(node); case 12: return globalRegExpType; - case 178: - return checkArrayLiteral(node, checkMode); - case 179: - return checkObjectLiteral(node, checkMode); - case 180: - return checkPropertyAccessExpression(node); case 181: - return checkIndexedAccess(node); + return checkArrayLiteral(node, checkMode); case 182: + return checkObjectLiteral(node, checkMode); + case 183: + return checkPropertyAccessExpression(node); + case 184: + return checkIndexedAccess(node); + case 185: if (node.expression.kind === 91) { return checkImportCallExpression(node); } - case 183: - return checkCallExpression(node); - case 184: - return checkTaggedTemplateExpression(node); case 186: - return checkParenthesizedExpression(node, checkMode); - case 200: - return checkClassExpression(node); + return checkCallExpression(node); case 187: - case 188: - return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 190: - return checkTypeOfExpression(node); - case 185: - case 203: - return checkAssertion(node); - case 204: - return checkNonNullAssertion(node); - case 205: - return checkMetaProperty(node); + return checkTaggedTemplateExpression(node); case 189: - return checkDeleteExpression(node); + return checkParenthesizedExpression(node, checkMode); + case 203: + return checkClassExpression(node); + case 190: case 191: - return checkVoidExpression(node); - case 192: - return checkAwaitExpression(node); + return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); case 193: - return checkPrefixUnaryExpression(node); + return checkTypeOfExpression(node); + case 188: + case 206: + return checkAssertion(node); + case 207: + return checkNonNullAssertion(node); + case 208: + return checkMetaProperty(node); + case 192: + return checkDeleteExpression(node); case 194: - return checkPostfixUnaryExpression(node); + return checkVoidExpression(node); case 195: - return checkBinaryExpression(node, checkMode); + return checkAwaitExpression(node); case 196: - return checkConditionalExpression(node, checkMode); - case 199: - return checkSpreadExpression(node, checkMode); - case 201: - return undefinedWideningType; + return checkPrefixUnaryExpression(node); + case 197: + return checkPostfixUnaryExpression(node); case 198: + return checkBinaryExpression(node, checkMode); + case 199: + return checkConditionalExpression(node, checkMode); + case 202: + return checkSpreadExpression(node, checkMode); + case 204: + return undefinedWideningType; + case 201: return checkYieldExpression(node); - case 260: + case 263: return checkJsxExpression(node, checkMode); - case 250: - return checkJsxElement(node); - case 251: - return checkJsxSelfClosingElement(node); + case 253: + return checkJsxElement(node, checkMode); case 254: - return checkJsxFragment(node); - case 258: + return checkJsxSelfClosingElement(node, checkMode); + case 257: + return checkJsxFragment(node, checkMode); + case 261: return checkJsxAttributes(node, checkMode); - case 252: + case 255: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -35553,7 +36427,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92)) { - if (!(func.kind === 153 && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 154 && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -35561,10 +36435,10 @@ var ts; error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && ts.isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { - if (ts.indexOf(func.parameters, node) !== 0) { + if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 153 || func.kind === 157 || func.kind === 162) { + if (func.kind === 154 || func.kind === 158 || func.kind === 163) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -35589,7 +36463,7 @@ var ts; error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); return; } - var typePredicate = getSignatureFromDeclaration(parent).typePredicate; + var typePredicate = getTypePredicateOfSignature(getSignatureFromDeclaration(parent)); if (!typePredicate) { return; } @@ -35604,7 +36478,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); }; checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, undefined, leadingError); } } @@ -35626,13 +36500,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 188: - case 156: - case 229: - case 187: - case 161: + case 191: + case 157: + case 232: + case 190: + case 162: + case 153: case 152: - case 151: var parent = node.parent; if (node === parent.type) { return parent; @@ -35650,7 +36524,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 176 || name.kind === 175) { + else if (name.kind === 179 || name.kind === 178) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -35658,12 +36532,12 @@ var ts; } } function checkSignatureDeclaration(node) { - if (node.kind === 158) { + if (node.kind === 159) { checkGrammarIndexSignature(node); } - else if (node.kind === 161 || node.kind === 229 || node.kind === 162 || - node.kind === 156 || node.kind === 153 || - node.kind === 157) { + else if (node.kind === 162 || node.kind === 232 || node.kind === 163 || + node.kind === 157 || node.kind === 154 || + node.kind === 158) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -35688,10 +36562,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 157: + case 158: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 156: + case 157: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -35732,7 +36606,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153) { + if (member.kind === 154) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -35746,16 +36620,16 @@ var ts; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 154: + case 155: addName(names, member.name, memberName, 1); break; - case 155: + case 156: addName(names, member.name, memberName, 2); break; - case 150: + case 151: addName(names, member.name, memberName, 3); break; - case 152: + case 153: addName(names, member.name, memberName, 4); break; } @@ -35807,7 +36681,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149) { + if (member.kind === 150) { var memberName = void 0; switch (member.name.kind) { case 9: @@ -35831,7 +36705,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 231) { + if (node.kind === 234) { var nodeSymbol = getSymbolOfNode(node); if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { return; @@ -35846,7 +36720,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 136: + case 137: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -35854,7 +36728,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 133: + case 134: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -35876,7 +36750,7 @@ var ts; if (!checkGrammarMethod(node)) checkGrammarComputedPropertyName(node.name); checkFunctionOrMethodDeclaration(node); - if (ts.hasModifier(node, 128) && node.body) { + if (ts.hasModifier(node, 128) && node.kind === 153 && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -35897,24 +36771,8 @@ var ts; if (!produceDiagnostics) { return; } - function containsSuperCallAsComputedPropertyName(n) { - var name = ts.getNameOfDeclaration(n); - return name && containsSuperCall(name); - } - function containsSuperCall(n) { - if (ts.isSuperCall(n)) { - return true; - } - else if (ts.isFunctionLike(n)) { - return false; - } - else if (ts.isClassLike(n)) { - return ts.forEach(n.members, containsSuperCallAsComputedPropertyName); - } - return ts.forEachChild(n, containsSuperCall); - } function isInstancePropertyWithInitializer(n) { - return n.kind === 150 && + return n.kind === 151 && !ts.hasModifier(n, 32) && !!n.initializer; } @@ -35934,7 +36792,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 211 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -35958,18 +36816,18 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 154) { + if (node.kind === 155) { if (!(node.flags & 2097152) && ts.nodeIsPresent(node.body) && (node.flags & 128)) { if (!(node.flags & 256)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); } } } - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { - var otherKind = node.kind === 154 ? 155 : 154; + var otherKind = node.kind === 155 ? 156 : 155; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -35985,7 +36843,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 154) { + if (node.kind === 155) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -36002,8 +36860,10 @@ var ts; function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { - var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJavaScriptFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { var typeArguments; var mapper; var result = true; @@ -36011,18 +36871,28 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, ts.isInJavaScriptFile(typeArgumentNodes[i])); + typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(typeArgument, instantiateType(constraint, mapper), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; } + function getTypeParametersForTypeReference(node) { + var type = getTypeFromTypeReference(node); + if (type !== unknownType) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters || + (ts.getObjectFlags(type) & 4 ? type.target.localTypeParameters : undefined); + } + } + return undefined; + } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 160 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 161 && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); @@ -36030,18 +36900,10 @@ var ts; if (node.typeArguments) { ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (!symbol) { - if (!ts.isJSDocIndexSignature(node)) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - } - return; + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); } - var typeParameters = symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters; - if (!typeParameters && ts.getObjectFlags(type) & 4) { - typeParameters = type.target.localTypeParameters; - } - checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } if (type.flags & 16 && getNodeLinks(node).resolvedSymbol.flags & 8) { @@ -36049,6 +36911,14 @@ var ts; } } } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType); + if (!typeReferenceNode) + return undefined; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } function checkTypeQuery(node) { getTypeFromTypeQueryNode(node); } @@ -36081,8 +36951,8 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { - if (accessNode.kind === 181 && ts.isAssignmentTarget(accessNode) && - ts.getObjectFlags(objectType) & 32 && objectType.declaration.readonlyToken) { + if (accessNode.kind === 184 && ts.isAssignmentTarget(accessNode) && + ts.getObjectFlags(objectType) & 32 && getMappedTypeModifiers(objectType) & 1) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -36101,6 +36971,9 @@ var ts; function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); + if (noImplicitAny && !node.type) { + reportImplicitAnyError(node, anyType); + } var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); @@ -36109,14 +36982,23 @@ var ts; checkGrammarTypeOperatorNode(node); checkSourceElement(node.type); } + function checkConditionalType(node) { + ts.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 && n.parent.extendsType === n; })) { + grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + } function isPrivateWithinAmbient(node) { return ts.hasModifier(node, 8) && !!(node.flags & 2097152); } function getEffectiveDeclarationFlags(n, flagsToCheck) { var flags = ts.getCombinedModifierFlags(n); - if (n.parent.kind !== 231 && - n.parent.kind !== 230 && - n.parent.kind !== 200 && + if (n.parent.kind !== 234 && + n.parent.kind !== 233 && + n.parent.kind !== 203 && n.flags & 2097152) { if (!(flags & 2)) { flags |= 1; @@ -36196,7 +37078,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 152 || node.kind === 151) && + var reportError = (node.kind === 153 || node.kind === 152) && ts.hasModifier(node, 32) !== ts.hasModifier(subsequentNode, 32); if (reportError) { var diagnostic = ts.hasModifier(node, 32) ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; @@ -36229,11 +37111,11 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 2097152; - var inAmbientContextOrInterface = node.parent.kind === 231 || node.parent.kind === 164 || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 234 || node.parent.kind === 165 || inAmbientContext; if (inAmbientContextOrInterface) { previousDeclaration = undefined; } - if (node.kind === 229 || node.kind === 152 || node.kind === 151 || node.kind === 153) { + if (node.kind === 232 || node.kind === 153 || node.kind === 152 || node.kind === 154) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -36352,31 +37234,33 @@ var ts; })(DeclarationSpaces || (DeclarationSpaces = {})); function getDeclarationSpaces(d) { switch (d.kind) { - case 231: - case 232: - case 288: - return 2; case 234: + case 235: + case 291: + return 2; + case 237: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 ? 4 | 1 : 4; - case 230: case 233: + case 236: return 2 | 1; - case 238: + case 272: + return 2 | 1 | 4; case 241: - case 240: + case 244: + case 243: var result_2 = 0; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); }); return result_2; - case 227: - case 177: - case 229: - case 243: + case 230: + case 180: + case 232: + case 246: return 1; default: - ts.Debug.fail(ts.SyntaxKind[d.kind]); + ts.Debug.fail(ts.Debug.showSyntaxKind(d)); } } } @@ -36417,7 +37301,7 @@ var ts; } return undefined; } - return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2); } function checkAwaitedType(type, errorNode, diagnosticMessage) { return getAwaitedType(type, errorNode, diagnosticMessage) || unknownType; @@ -36443,7 +37327,7 @@ var ts; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { if (errorNode) { error(errorNode, ts.Diagnostics.Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method); } @@ -36528,28 +37412,28 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 230: + case 233: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 147: + case 148: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 150: + case 151: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 152: - case 154: + case 153: case 155: + case 156: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); break; } - checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo); + checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; }); } function markTypeNodeAsReferenced(node) { markEntityNameOrEntityExpressionAsReference(node && ts.getEntityNameFromTypeNode(node)); @@ -36576,18 +37460,18 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { + case 169: case 168: - case 167: var commonEntityName = void 0; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169) { + while (typeNode.kind === 172) { typeNode = typeNode.type; } - if (typeNode.kind === 130) { + if (typeNode.kind === 131) { continue; } - if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 139)) { + if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 140)) { continue; } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -36606,9 +37490,9 @@ var ts; } } return commonEntityName; - case 169: + case 172: return getEntityNameForDecoratorMetadata(node.type); - case 160: + case 161: return node.typeName; } } @@ -36629,13 +37513,13 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8); - if (node.kind === 147) { + if (node.kind === 148) { checkExternalEmitHelpers(firstDecorator, 32); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16); switch (node.kind) { - case 230: + case 233: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -36644,19 +37528,19 @@ var ts; } } break; - case 152: - case 154: + case 153: case 155: + case 156: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 150: + case 151: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 147: + case 148: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -36687,7 +37571,7 @@ var ts; function checkJSDocParameterTag(node) { checkSourceElement(node.typeExpression); if (!ts.getParameterSymbolFromJSDoc(node)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 144 ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 ? node.name.right : node.name)); } } function checkJSDocAugmentsTag(node) { @@ -36696,7 +37580,7 @@ var ts; error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName)); return; } - var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 282); + var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 285); ts.Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); @@ -36714,7 +37598,7 @@ var ts; switch (node.kind) { case 71: return node; - case 180: + case 183: return node.name; default: return undefined; @@ -36724,7 +37608,7 @@ var ts; checkDecorators(node); checkSignatureDeclaration(node); var functionFlags = ts.getFunctionFlags(node); - if (node.name && node.name.kind === 145) { + if (node.name && node.name.kind === 146) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { @@ -36740,7 +37624,8 @@ var ts; } } } - checkSourceElement(node.body); + var body = node.kind === 152 ? undefined : node.body; + checkSourceElement(body); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if ((functionFlags & 1) === 0) { var returnOrPromisedType = returnTypeNode && (functionFlags & 2 @@ -36749,10 +37634,10 @@ var ts; checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } if (produceDiagnostics && !returnTypeNode) { - if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & 1 && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 && ts.nodeIsPresent(body)) { getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } } @@ -36768,43 +37653,43 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 269: - case 234: + case 272: + case 237: checkUnusedModuleMembers(node); break; - case 230: - case 200: + case 233: + case 203: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 231: + case 234: checkUnusedTypeParameters(node); break; - case 208: - case 236: - case 215: - case 216: - case 217: + case 211: + case 239: + case 218: + case 219: + case 220: checkUnusedLocalsAndParameters(node); break; - case 153: - case 187: - case 229: - case 188: - case 152: case 154: + case 190: + case 232: + case 191: + case 153: case 155: + case 156: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 151: - case 156: + case 152: case 157: - case 161: + case 158: case 162: - case 232: + case 163: + case 235: checkUnusedTypeParameters(node); break; default: @@ -36816,8 +37701,8 @@ var ts; function checkUnusedLocalsAndParameters(node) { if (noUnusedIdentifiers && !(node.flags & 2097152)) { node.locals.forEach(function (local) { - if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 147) { + if (local.flags & 262144 ? (local.flags & 3 && !(local.isReferenced & 3)) : !local.isReferenced) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 148) { var parameter = ts.getRootDeclaration(local.valueDeclaration); var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && @@ -36845,8 +37730,8 @@ var ts; var node = ts.getNameOfDeclaration(declaration) || declaration; if (isIdentifierThatStartsWithUnderScore(node)) { var declaration_2 = ts.getRootDeclaration(node.parent); - if ((declaration_2.kind === 227 && ts.isForInOrOfStatement(declaration_2.parent.parent)) || - declaration_2.kind === 146) { + if ((declaration_2.kind === 230 && ts.isForInOrOfStatement(declaration_2.parent.parent)) || + declaration_2.kind === 147) { return; } } @@ -36862,28 +37747,40 @@ var ts; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152)) { - if (node.members) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - if (member.kind === 152 || member.kind === 150) { - if (!member.symbol.isReferenced && ts.hasModifier(member, 8)) { - error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(member.symbol)); + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 153: + case 151: + case 155: + case 156: + if (member.kind === 156 && member.symbol.flags & 32768) { + break; } - } - else if (member.kind === 153) { + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8)) { + error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)); + } + break; + case 154: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol)); } } - } + break; + case 159: + case 210: + break; + default: + ts.Debug.fail(); } } } } function checkUnusedTypeParameters(node) { - if (compilerOptions.noUnusedLocals && !(node.flags & 2097152)) { + if (compilerOptions.noUnusedParameters && !(node.flags & 2097152)) { if (node.typeParameters) { var symbol = getSymbolOfNode(node); var lastDeclaration = symbol && symbol.declarations && ts.lastOrUndefined(symbol.declarations); @@ -36892,7 +37789,7 @@ var ts; } for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) { var typeParameter = _a[_i]; - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & 262144) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(typeParameter.symbol)); } } @@ -36914,7 +37811,7 @@ var ts; } } function checkBlock(node) { - if (node.kind === 208) { + if (node.kind === 211) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -36943,19 +37840,19 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 150 || - node.kind === 149 || + if (node.kind === 151 || + node.kind === 150 || + node.kind === 153 || node.kind === 152 || - node.kind === 151 || - node.kind === 154 || - node.kind === 155) { + node.kind === 155 || + node.kind === 156) { return false; } if (node.flags & 2097152) { return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 147 && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 148 && ts.nodeIsMissing(root.parent.body)) { return false; } return true; @@ -37027,7 +37924,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 269 && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 272 && ts.isExternalOrCommonJsModule(parent)) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -37039,7 +37936,7 @@ var ts; return; } var parent = getDeclarationContainer(node); - if (parent.kind === 269 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) { + if (parent.kind === 272 && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024) { error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } } @@ -37047,7 +37944,7 @@ var ts; if ((ts.getCombinedNodeFlags(node) & 3) !== 0 || ts.isParameterDeclaration(node)) { return; } - if (node.kind === 227 && !node.initializer) { + if (node.kind === 230 && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -37059,15 +37956,15 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 228); - var container = varDeclList.parent.kind === 209 && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 231); + var container = varDeclList.parent.kind === 212 && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; var namesShareScope = container && - (container.kind === 208 && ts.isFunctionLike(container.parent) || - container.kind === 235 || - container.kind === 234 || - container.kind === 269); + (container.kind === 211 && ts.isFunctionLike(container.parent) || + container.kind === 238 || + container.kind === 237 || + container.kind === 272); if (!namesShareScope) { var name = symbolToString(localDeclarationSymbol); error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name, name); @@ -37077,7 +37974,7 @@ var ts; } } function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 147) { + if (ts.getRootDeclaration(node).kind !== 148) { return; } var func = ts.getContainingFunction(node); @@ -37086,7 +37983,7 @@ var ts; if (ts.isTypeNode(n) || ts.isDeclarationName(n)) { return; } - if (n.kind === 180) { + if (n.kind === 183) { return visit(n.expression); } else if (n.kind === 71) { @@ -37100,8 +37997,8 @@ var ts; } var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 147 || - symbol.valueDeclaration.kind === 177) { + if (symbol.valueDeclaration.kind === 148 || + symbol.valueDeclaration.kind === 180) { if (symbol.valueDeclaration.pos < node.pos) { return; } @@ -37110,7 +38007,7 @@ var ts; return "quit"; } return ts.isFunctionLike(current.parent) || - (current.parent.kind === 150 && + (current.parent.kind === 151 && !(ts.hasModifier(current.parent, 32)) && ts.isClassLike(current.parent.parent)); })) { @@ -37130,53 +38027,63 @@ var ts; } function checkVariableLikeDeclaration(node) { checkDecorators(node); - checkSourceElement(node.type); + if (!ts.isBindingElement(node)) { + checkSourceElement(node.type); + } if (!node.name) { return; } - if (node.name.kind === 145) { + if (node.name.kind === 146) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 177) { - if (node.parent.kind === 175 && languageVersion < 6) { + if (node.kind === 180) { + if (node.parent.kind === 178 && languageVersion < 6) { checkExternalEmitHelpers(node, 4); } - if (node.propertyName && node.propertyName.kind === 145) { + if (node.propertyName && node.propertyName.kind === 146) { checkComputedPropertyName(node.propertyName); } var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); - markPropertyAsReferenced(property, undefined, false); - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (!ts.isBindingPattern(name)) { + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + markPropertyAsReferenced(property, undefined, false); + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 176 && languageVersion < 2 && compilerOptions.downlevelIteration) { + if (node.name.kind === 179 && languageVersion < 2 && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512); } ts.forEach(node.name.elements, checkSourceElement); } - if (node.initializer && ts.getRootDeclaration(node).kind === 147 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 148 && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } if (ts.isBindingPattern(node.name)) { - if (node.initializer && node.parent.parent.kind !== 216) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); + if (node.initializer && node.parent.parent.kind !== 219) { + var initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && node.name.elements.length === 0) { + checkNonNullType(initializerType, node); + } + else { + checkTypeAssignableTo(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, undefined); + } checkParameterInitializer(node); } return; } var symbol = getSymbolOfNode(node); - var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); + var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { - if (node.initializer && node.parent.parent.kind !== 216) { + if (node.initializer && node.parent.parent.kind !== 219) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); checkParameterInitializer(node); } @@ -37196,9 +38103,9 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 150 && node.kind !== 149) { + if (node.kind !== 151 && node.kind !== 150) { checkExportsOnMergedDeclarations(node); - if (node.kind === 227 || node.kind === 177) { + if (node.kind === 230 || node.kind === 180) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -37210,14 +38117,14 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 150 || nextDeclaration.kind === 149 + var message = nextDeclaration.kind === 151 || nextDeclaration.kind === 150 ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 147 && right.kind === 227) || - (left.kind === 227 && right.kind === 147)) { + if ((left.kind === 148 && right.kind === 230) || + (left.kind === 230 && right.kind === 148)) { return true; } if (ts.hasQuestionToken(left) !== ts.hasQuestionToken(right)) { @@ -37244,18 +38151,6 @@ var ts; checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - if (node.modifiers && node.parent.kind === 179) { - if (ts.getFunctionFlags(node) & 2) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } function checkExpressionStatement(node) { checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); @@ -37264,7 +38159,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 210) { + if (node.thenStatement.kind === 213) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -37281,12 +38176,12 @@ var ts; } function checkForStatement(node) { if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 228) { + if (node.initializer && node.initializer.kind === 231) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 228) { + if (node.initializer.kind === 231) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -37304,7 +38199,7 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.kind === 217) { + if (node.kind === 220) { if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); if ((functionFlags & (4 | 2)) === 2 && languageVersion < 6) { @@ -37315,13 +38210,13 @@ var ts; checkExternalEmitHelpers(node, 256); } } - if (node.initializer.kind === 228) { + if (node.initializer.kind === 231) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); - if (varExpr.kind === 178 || varExpr.kind === 179) { + if (varExpr.kind === 181 || varExpr.kind === 182) { checkDestructuringAssignment(varExpr, iteratedType || unknownType); } else { @@ -37340,7 +38235,7 @@ var ts; function checkForInStatement(node) { checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - if (node.initializer.kind === 228) { + if (node.initializer.kind === 231) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -37350,7 +38245,7 @@ var ts; else { var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 178 || varExpr.kind === 179) { + if (varExpr.kind === 181 || varExpr.kind === 182) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -37360,7 +38255,7 @@ var ts; checkReferenceExpression(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access); } } - if (!isTypeAssignableToKind(rightType, 33554432 | 1081344)) { + if (!isTypeAssignableToKind(rightType, 134217728 | 7372800)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -37402,7 +38297,7 @@ var ts; var arrayTypes = inputType.types; var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 524322); }); if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, true); + arrayType = getUnionType(filteredTypes, 2); } } else if (arrayType.flags & 524322) { @@ -37439,7 +38334,7 @@ var ts; if (arrayElementType.flags & 524322) { return stringType; } - return getUnionType([arrayElementType, stringType], true); + return getUnionType([arrayElementType, stringType], 2); } return arrayElementType; } @@ -37483,7 +38378,7 @@ var ts; } return undefined; } - var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), true); + var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), 2); var iteratedType = getIteratedTypeOfIterator(returnType, errorNode, !!asyncMethodType); if (checkAssignability && errorNode && iteratedType) { checkTypeAssignableTo(type, asyncMethodType @@ -37522,7 +38417,7 @@ var ts; } return undefined; } - var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), true); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), 2); if (isTypeAny(nextResult)) { return undefined; } @@ -37557,8 +38452,8 @@ var ts; checkGrammarBreakOrContinueStatement(node); } function isGetAccessorWithAnnotatedSetAccessor(node) { - return node.kind === 154 - && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 155)) !== undefined; + return node.kind === 155 + && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156)) !== undefined; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { var unwrappedReturnType = (ts.getFunctionFlags(func) & 3) === 2 @@ -37567,48 +38462,48 @@ var ts; return unwrappedReturnType && maybeTypeOfKind(unwrappedReturnType, 2048 | 1); } function checkReturnStatement(node) { - if (!checkGrammarStatementInAmbientContext(node)) { - var functionBlock = ts.getContainingFunction(node); - if (!functionBlock) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } + if (checkGrammarStatementInAmbientContext(node)) { + return; } var func = ts.getContainingFunction(node); - if (func) { - var signature = getSignatureFromDeclaration(func); - var returnType = getReturnTypeOfSignature(signature); - var functionFlags = ts.getFunctionFlags(func); - if (functionFlags & 1) { + if (!func) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + return; + } + var signature = getSignatureFromDeclaration(func); + var returnType = getReturnTypeOfSignature(signature); + var functionFlags = ts.getFunctionFlags(func); + var isGenerator = functionFlags & 1; + if (strictNullChecks || node.expression || returnType.flags & 16384) { + var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; + if (isGenerator) { return; } - if (strictNullChecks || node.expression || returnType.flags & 16384) { - var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 155) { - if (node.expression) { - error(node, ts.Diagnostics.Setters_cannot_return_a_value); - } - } - else if (func.kind === 153) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { - error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (functionFlags & 2) { - var promisedType = getPromisedTypeOfPromise(returnType); - var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - if (promisedType) { - checkTypeAssignableTo(awaitedType, promisedType, node); - } - } - else { - checkTypeAssignableTo(exprType, returnType, node); - } + else if (func.kind === 156) { + if (node.expression) { + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind !== 153 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { - error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); + else if (func.kind === 154) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } } + else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { + if (functionFlags & 2) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + if (promisedType) { + checkTypeAssignableTo(awaitedType, promisedType, node); + } + } + else { + checkTypeAssignableTo(exprType, returnType, node); + } + } + } + else if (func.kind !== 154 && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } function checkWithStatement(node) { @@ -37632,7 +38527,7 @@ var ts; var expressionType = checkExpression(node.expression); var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { - if (clause.kind === 262 && !hasDuplicateDefaultClause) { + if (clause.kind === 265 && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -37644,9 +38539,8 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 261) { - var caseClause = clause; - var caseType = checkExpression(caseClause.expression); + if (produceDiagnostics && clause.kind === 264) { + var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -37654,7 +38548,7 @@ var ts; comparedExpressionType = getBaseTypeOfLiteralType(expressionType); } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, undefined); } } ts.forEach(clause.statements, checkSourceElement); @@ -37669,7 +38563,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 223 && current.label.escapedText === node.label.escapedText) { + if (current.kind === 226 && current.label.escapedText === node.label.escapedText) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); return true; @@ -37754,7 +38648,7 @@ var ts; error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); } function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) { - if (!indexType) { + if (!indexType || ts.isKnownSymbol(prop)) { return; } var propDeclaration = prop.valueDeclaration; @@ -37763,8 +38657,8 @@ var ts; } var errorNode; if (propDeclaration && - (propDeclaration.kind === 195 || - ts.getNameOfDeclaration(propDeclaration).kind === 145 || + (propDeclaration.kind === 198 || + ts.getNameOfDeclaration(propDeclaration).kind === 146 || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -37855,9 +38749,10 @@ var ts; } var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); var targetConstraint = getConstraintFromTypeParameter(target); - if ((sourceConstraint || targetConstraint) && - (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { - return false; + if (sourceConstraint) { + if (!targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } } var sourceDefault = source.default && getTypeFromTypeNode(source.default); var targetDefault = getDefaultFromTypeParameter(target); @@ -37922,12 +38817,15 @@ var ts; ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; - if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { break; } } } - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var baseWithThis = getTypeWithThisArgument(baseType_1, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + } checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseConstructorType.flags & 1081344 && !isMixinConstructorType(staticType)) { error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); @@ -37953,7 +38851,13 @@ var ts; var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { if (isValidBaseType(t)) { - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + var genericDiag = t.symbol && t.symbol.flags & 32 ? + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : + ts.Diagnostics.Class_0_incorrectly_implements_interface_1; + var baseWithThis = getTypeWithThisArgument(t, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); + } } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -37968,6 +38872,32 @@ var ts; checkPropertyInitialization(node); } } + function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { + var issuedMemberError = false; + var _loop_5 = function (member) { + if (ts.hasStaticModifier(member)) { + return "continue"; + } + var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (declaredProp) { + var prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); + var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); + if (prop && baseProp) { + var rootChain = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, ts.unescapeLeadingUnderscores(declaredProp.escapedName), typeToString(typeWithThis), typeToString(baseWithThis)); }; + if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, undefined, rootChain)) { + issuedMemberError = true; + } + } + } + }; + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + _loop_5(member); + } + if (!issuedMemberError) { + checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); + } + } function checkBaseTypeAccessibility(type, node) { var signatures = getSignaturesOfType(type, 1); if (signatures.length) { @@ -37985,7 +38915,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 230 || d.kind === 231; + return d.kind === 233 || d.kind === 234; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -38003,7 +38933,7 @@ var ts; if (derived === base) { var derivedClassDecl = ts.getClassLikeDeclarationOfSymbol(type.symbol); if (baseDeclarationFlags & 128 && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128))) { - if (derivedClassDecl.kind === 200) { + if (derivedClassDecl.kind === 203) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -38092,7 +39022,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 150 && + return node.kind === 151 && !ts.hasModifier(node, 32 | 128) && !node.exclamationToken && !node.initializer; @@ -38112,7 +39042,7 @@ var ts; checkExportsOnMergedDeclarations(node); var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 231); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 234); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -38208,17 +39138,17 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 193: - var value_1 = evaluate(expr.operand); - if (typeof value_1 === "number") { + case 196: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { switch (expr.operator) { - case 37: return value_1; - case 38: return -value_1; - case 52: return ~value_1; + case 37: return value_2; + case 38: return -value_2; + case 52: return ~value_2; } } break; - case 195: + case 198: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -38234,6 +39164,7 @@ var ts; case 37: return left + right; case 38: return left - right; case 42: return left % right; + case 40: return Math.pow(left, right); } } break; @@ -38242,18 +39173,18 @@ var ts; case 8: checkGrammarNumericLiteral(expr); return +expr.text; - case 186: + case 189: return evaluate(expr.expression); case 71: return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText); - case 181: - case 180: + case 184: + case 183: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384) { var name = void 0; - if (ex.kind === 180) { + if (ex.kind === 183) { name = ex.name.escapedText; } else { @@ -38285,8 +39216,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 71 || - node.kind === 180 && isConstantMemberAccess(node.expression) || - node.kind === 181 && isConstantMemberAccess(node.expression) && + node.kind === 183 && isConstantMemberAccess(node.expression) || + node.kind === 184 && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 9; } function checkEnumDeclaration(node) { @@ -38317,7 +39248,7 @@ var ts; } var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 233) { + if (declaration.kind !== 236) { return false; } var enumDeclaration = declaration; @@ -38340,8 +39271,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { var declaration = declarations_7[_i]; - if ((declaration.kind === 230 || - (declaration.kind === 229 && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 233 || + (declaration.kind === 232 && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 2097152)) { return declaration; } @@ -38400,7 +39331,7 @@ var ts; error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); } } - var mergedClass = ts.getDeclarationOfKind(symbol, 230); + var mergedClass = ts.getDeclarationOfKind(symbol, 233); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768; @@ -38443,22 +39374,22 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 209: + case 212: for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 244: - case 245: + case 247: + case 248: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 238: - case 239: + case 241: + case 242: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 177: - case 227: + case 180: + case 230: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -38467,12 +39398,12 @@ var ts; } break; } - case 230: case 233: - case 229: - case 231: - case 234: + case 236: case 232: + case 234: + case 237: + case 235: if (isGlobalAugmentation) { return; } @@ -38490,12 +39421,12 @@ var ts; switch (node.kind) { case 71: return node; - case 144: + case 145: do { node = node.left; } while (node.kind !== 71); return node; - case 180: + case 183: do { node = node.expression; } while (node.kind !== 71); @@ -38508,9 +39439,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 235 && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 269 && !inAmbientExternalModule) { - error(moduleName, node.kind === 245 ? + var inAmbientExternalModule = node.parent.kind === 238 && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 272 && !inAmbientExternalModule) { + error(moduleName, node.kind === 248 ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -38531,13 +39462,13 @@ var ts; (symbol.flags & 793064 ? 793064 : 0) | (symbol.flags & 1920 ? 1920 : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 247 ? + var message = node.kind === 250 ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } if (compilerOptions.isolatedModules - && node.kind === 247 + && node.kind === 250 && !(target.flags & 107455) && !(node.flags & 2097152)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); @@ -38564,7 +39495,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241) { + if (importClause.namedBindings.kind === 244) { checkImportBinding(importClause.namedBindings); } else { @@ -38584,7 +39515,7 @@ var ts; if (ts.hasModifier(node, 1)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 249) { + if (node.moduleReference.kind !== 252) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 107455) { @@ -38615,10 +39546,10 @@ var ts; if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { if (node.exportClause) { ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 235 && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 235 && + var inAmbientExternalModule = node.parent.kind === 238 && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 238 && !node.moduleSpecifier && node.flags & 2097152; - if (node.parent.kind !== 269 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 272 && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -38634,7 +39565,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 269 || node.parent.kind === 235 || node.parent.kind === 234; + var isInAppropriateContext = node.parent.kind === 272 || node.parent.kind === 238 || node.parent.kind === 237; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -38660,8 +39591,8 @@ var ts; if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { return; } - var container = node.parent.kind === 269 ? node.parent : node.parent.parent; - if (container.kind === 234 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 ? node.parent : node.parent.parent; + if (container.kind === 237 && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -38740,7 +39671,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 229 && declaration.kind !== 152) || + return (declaration.kind !== 232 && declaration.kind !== 153) || !!declaration.body; } function checkSourceElement(node) { @@ -38756,144 +39687,148 @@ var ts; var kind = node.kind; if (cancellationToken) { switch (kind) { + case 237: + case 233: case 234: - case 230: - case 231: - case 229: + case 232: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 146: - return checkTypeParameter(node); case 147: + return checkTypeParameter(node); + case 148: return checkParameter(node); + case 151: case 150: - case 149: return checkPropertyDeclaration(node); - case 161: case 162: - case 156: + case 163: case 157: - return checkSignatureDeclaration(node); case 158: return checkSignatureDeclaration(node); - case 152: - case 151: - return checkMethodDeclaration(node); - case 153: - return checkConstructorDeclaration(node); - case 154: - case 155: - return checkAccessorDeclaration(node); - case 160: - return checkTypeReferenceNode(node); case 159: + return checkSignatureDeclaration(node); + case 153: + case 152: + return checkMethodDeclaration(node); + case 154: + return checkConstructorDeclaration(node); + case 155: + case 156: + return checkAccessorDeclaration(node); + case 161: + return checkTypeReferenceNode(node); + case 160: return checkTypePredicate(node); - case 163: - return checkTypeQuery(node); case 164: - return checkTypeLiteral(node); + return checkTypeQuery(node); case 165: - return checkArrayType(node); + return checkTypeLiteral(node); case 166: - return checkTupleType(node); + return checkArrayType(node); case 167: + return checkTupleType(node); case 168: - return checkUnionOrIntersectionType(node); case 169: + return checkUnionOrIntersectionType(node); + case 172: return checkSourceElement(node.type); - case 171: + case 174: return checkTypeOperator(node); - case 282: + case 170: + return checkConditionalType(node); + case 171: + return checkInferType(node); + case 285: return checkJSDocAugmentsTag(node); - case 288: + case 291: return checkJSDocTypedefTag(node); - case 284: + case 287: return checkJSDocParameterTag(node); - case 277: + case 280: checkSignatureDeclaration(node); + case 278: + case 277: case 275: - case 274: - case 272: - case 273: + case 276: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 278: + case 281: checkJSDocVariadicType(node); return; - case 271: + case 274: return checkSourceElement(node.type); - case 172: + case 175: return checkIndexedAccessType(node); - case 173: + case 176: return checkMappedType(node); - case 229: - return checkFunctionDeclaration(node); - case 208: - case 235: - return checkBlock(node); - case 209: - return checkVariableStatement(node); - case 211: - return checkExpressionStatement(node); - case 212: - return checkIfStatement(node); - case 213: - return checkDoStatement(node); - case 214: - return checkWhileStatement(node); - case 215: - return checkForStatement(node); - case 216: - return checkForInStatement(node); - case 217: - return checkForOfStatement(node); - case 218: - case 219: - return checkBreakOrContinueStatement(node); - case 220: - return checkReturnStatement(node); - case 221: - return checkWithStatement(node); - case 222: - return checkSwitchStatement(node); - case 223: - return checkLabeledStatement(node); - case 224: - return checkThrowStatement(node); - case 225: - return checkTryStatement(node); - case 227: - return checkVariableDeclaration(node); - case 177: - return checkBindingElement(node); - case 230: - return checkClassDeclaration(node); - case 231: - return checkInterfaceDeclaration(node); case 232: - return checkTypeAliasDeclaration(node); - case 233: - return checkEnumDeclaration(node); - case 234: - return checkModuleDeclaration(node); - case 239: - return checkImportDeclaration(node); + return checkFunctionDeclaration(node); + case 211: case 238: - return checkImportEqualsDeclaration(node); - case 245: - return checkExportDeclaration(node); - case 244: - return checkExportAssignment(node); - case 210: - checkGrammarStatementInAmbientContext(node); - return; + return checkBlock(node); + case 212: + return checkVariableStatement(node); + case 214: + return checkExpressionStatement(node); + case 215: + return checkIfStatement(node); + case 216: + return checkDoStatement(node); + case 217: + return checkWhileStatement(node); + case 218: + return checkForStatement(node); + case 219: + return checkForInStatement(node); + case 220: + return checkForOfStatement(node); + case 221: + case 222: + return checkBreakOrContinueStatement(node); + case 223: + return checkReturnStatement(node); + case 224: + return checkWithStatement(node); + case 225: + return checkSwitchStatement(node); case 226: + return checkLabeledStatement(node); + case 227: + return checkThrowStatement(node); + case 228: + return checkTryStatement(node); + case 230: + return checkVariableDeclaration(node); + case 180: + return checkBindingElement(node); + case 233: + return checkClassDeclaration(node); + case 234: + return checkInterfaceDeclaration(node); + case 235: + return checkTypeAliasDeclaration(node); + case 236: + return checkEnumDeclaration(node); + case 237: + return checkModuleDeclaration(node); + case 242: + return checkImportDeclaration(node); + case 241: + return checkImportEqualsDeclaration(node); + case 248: + return checkExportDeclaration(node); + case 247: + return checkExportAssignment(node); + case 213: checkGrammarStatementInAmbientContext(node); return; - case 248: + case 229: + checkGrammarStatementInAmbientContext(node); + return; + case 251: return checkMissingDeclaration(node); } } @@ -38948,17 +39883,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 187: - case 188: + case 190: + case 191: + case 153: case 152: - case 151: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 154: case 155: + case 156: checkAccessorDeclaration(node); break; - case 200: + case 203: checkClassExpressionDeferred(node); break; } @@ -39058,24 +39993,24 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 234: + case 237: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475); break; - case 233: + case 236: copySymbols(getSymbolOfNode(location).exports, meaning & 8); break; - case 200: + case 203: var className = location.name; if (className) { copySymbol(location.symbol, meaning); } - case 230: - case 231: + case 233: + case 234: if (!isStatic) { copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 793064); } break; - case 187: + case 190: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -39113,27 +40048,27 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 146: - case 230: - case 231: - case 232: + case 147: case 233: + case 234: + case 235: + case 236: return true; } } function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 144) { + while (node.parent && node.parent.kind === 145) { node = node.parent; } - return node.parent && node.parent.kind === 160; + return node.parent && node.parent.kind === 161; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 180) { + while (node.parent && node.parent.kind === 183) { node = node.parent; } - return node.parent && node.parent.kind === 202; + return node.parent && node.parent.kind === 205; } function forEachEnclosingClass(node, callback) { var result; @@ -39161,13 +40096,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 144) { + while (nodeOnRightSide.parent.kind === 145) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 238) { + if (nodeOnRightSide.parent.kind === 241) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 244) { + if (nodeOnRightSide.parent.kind === 247) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -39192,18 +40127,18 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJavaScriptFile(entityName) && - entityName.parent.kind === 180 && + entityName.parent.kind === 183 && entityName.parent === entityName.parent.parent.left) { var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); if (specialPropertyAssignmentSymbol) { return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 244 && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 247 && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, 107455 | 793064 | 1920 | 2097152); } - if (entityName.kind !== 180 && isInRightSideOfImportOrExportAssignment(entityName)) { - var importEqualsDeclaration = ts.getAncestor(entityName, 238); + if (entityName.kind !== 183 && isInRightSideOfImportOrExportAssignment(entityName)) { + var importEqualsDeclaration = ts.getAncestor(entityName, 241); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, true); } @@ -39212,7 +40147,7 @@ var ts; } if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0; - if (entityName.parent.kind === 202) { + if (entityName.parent.kind === 205) { meaning = 793064; if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { meaning |= 107455; @@ -39222,15 +40157,15 @@ var ts; meaning = 1920; } meaning |= 2097152; - var entityNameSymbol = resolveEntityName(entityName, meaning); + var entityNameSymbol = ts.isEntityNameExpression(entityName) ? resolveEntityName(entityName, meaning) : undefined; if (entityNameSymbol) { return entityNameSymbol; } } - if (entityName.parent.kind === 284) { + if (entityName.parent.kind === 287) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 146 && entityName.parent.parent.kind === 287) { + if (entityName.parent.kind === 147 && entityName.parent.parent.kind === 290) { ts.Debug.assert(!ts.isInJavaScriptFile(entityName)); var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -39241,16 +40176,17 @@ var ts; } if (entityName.kind === 71) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { - return getIntrinsicTagSymbol(entityName.parent); + var symbol = getIntrinsicTagSymbol(entityName.parent); + return symbol === unknownSymbol ? undefined : symbol; } return resolveEntityName(entityName, 107455, false, true); } - else if (entityName.kind === 180 || entityName.kind === 144) { + else if (entityName.kind === 183 || entityName.kind === 145) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 180) { + if (entityName.kind === 183) { checkPropertyAccessExpression(entityName); } else { @@ -39260,19 +40196,19 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 160 ? 793064 : 1920; + var meaning = entityName.parent.kind === 161 ? 793064 : 1920; return resolveEntityName(entityName, meaning, false, true); } - else if (entityName.parent.kind === 257) { + else if (entityName.parent.kind === 260) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 159) { + if (entityName.parent.kind === 160) { return resolveEntityName(entityName, 1); } return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 269) { + if (node.kind === 272) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (node.flags & 4194304) { @@ -39288,8 +40224,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 177 && - node.parent.parent.kind === 175 && + else if (node.parent.kind === 180 && + node.parent.parent.kind === 178 && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText); @@ -39300,8 +40236,8 @@ var ts; } switch (node.kind) { case 71: - case 180: - case 144: + case 183: + case 145: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 99: var container = ts.getThisContainer(node, false); @@ -39314,19 +40250,20 @@ var ts; if (ts.isInExpressionContext(node)) { return checkExpression(node).symbol; } - case 170: + case 173: return getTypeFromThisTypeNode(node).symbol; case 97: return checkExpression(node).symbol; case 123: var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 153) { + if (constructorDeclaration && constructorDeclaration.kind === 154) { return constructorDeclaration.parent.symbol; } return undefined; case 9: + case 13: if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 239 || node.parent.kind === 245) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 242 || node.parent.kind === 248) && node.parent.moduleSpecifier === node) || ((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, false)) || ts.isImportCall(node.parent))) { return resolveExternalModuleName(node, node); } @@ -39346,7 +40283,7 @@ var ts; } } function getShorthandAssignmentValueSymbol(location) { - if (location && location.kind === 266) { + if (location && location.kind === 269) { return resolveEntityName(location.name, 107455 | 2097152); } return undefined; @@ -39399,29 +40336,31 @@ var ts; } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolAtLocation(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + } } return unknownType; } function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 179 || expr.kind === 178); - if (expr.parent.kind === 217) { + ts.Debug.assert(expr.kind === 182 || expr.kind === 181); + if (expr.parent.kind === 220) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 195) { + if (expr.parent.kind === 198) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } - if (expr.parent.kind === 265) { + if (expr.parent.kind === 268) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } - ts.Debug.assert(expr.parent.kind === 178); + ts.Debug.assert(expr.parent.kind === 181); var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, false, false) || unknownType; - return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); + return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || unknownType); } function getPropertySymbolOfDestructuringAssignment(location) { var typeOfObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(location.parent.parent); @@ -39455,41 +40394,34 @@ var ts; return ts.typeHasCallOrConstructSignatures(type, checker); } function getRootSymbols(symbol) { + var roots = getImmediateRootSymbols(symbol); + return roots ? ts.flatMap(roots, getRootSymbols) : [symbol]; + } + function getImmediateRootSymbols(symbol) { if (ts.getCheckFlags(symbol) & 6) { - var symbols_4 = []; - var name_4 = symbol.escapedName; - ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_4); - if (symbol) { - symbols_4.push(symbol); - } - }); - return symbols_4; + return ts.mapDefined(getSymbolLinks(symbol).containingType.types, function (type) { return getPropertyOfType(type, symbol.escapedName); }); } else if (symbol.flags & 33554432) { - var transient = symbol; - if (transient.leftSpread) { - return getRootSymbols(transient.leftSpread).concat(getRootSymbols(transient.rightSpread)); - } - if (transient.syntheticOrigin) { - return getRootSymbols(transient.syntheticOrigin); - } - var target = void 0; - var next = symbol; - while (next = getSymbolLinks(next).target) { - target = next; - } - if (target) { - return [target]; - } + var _a = symbol, leftSpread = _a.leftSpread, rightSpread = _a.rightSpread, syntheticOrigin = _a.syntheticOrigin; + return leftSpread ? [leftSpread, rightSpread] + : syntheticOrigin ? [syntheticOrigin] + : ts.singleElementArray(tryGetAliasTarget(symbol)); } - return [symbol]; + return undefined; + } + function tryGetAliasTarget(symbol) { + var target; + var next = symbol; + while (next = getSymbolLinks(next).target) { + target = next; + } + return target; } function isArgumentsLocalBinding(node) { if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 180 && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 183 && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -39525,14 +40457,14 @@ var ts; if (symbol) { if (symbol.flags & 1048576) { var exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (!prefixLocals && exportSymbol.flags & 944) { + if (!prefixLocals && exportSymbol.flags & 944 && !(exportSymbol.flags & 3)) { return undefined; } symbol = exportSymbol; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 269) { + if (parentSymbol_1.flags & 512 && parentSymbol_1.valueDeclaration.kind === 272) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); var symbolIsUmdExport = symbolFile !== referenceFile; @@ -39566,7 +40498,7 @@ var ts; else if (nodeLinks_1.flags & 131072) { var isDeclaredInLoop = nodeLinks_1.flags & 262144; var inLoopInitializer = ts.isIterationStatement(container, false); - var inLoopBodyBlock = container.kind === 208 && ts.isIterationStatement(container.parent, false); + var inLoopBodyBlock = container.kind === 211 && ts.isIterationStatement(container.parent, false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -39602,16 +40534,16 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 238: - case 240: case 241: case 243: - case 247: + case 244: + case 246: + case 250: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 245: + case 248: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 244: + case 247: return node.expression && node.expression.kind === 71 ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -39621,7 +40553,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 269 || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 272 || !ts.isInternalModuleImportEqualsDeclaration(node)) { return false; } var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); @@ -39684,15 +40616,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 268: - case 180: - case 181: + case 271: + case 183: + case 184: return true; } return false; } function getConstantValue(node) { - if (node.kind === 268) { + if (node.kind === 271) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -39772,20 +40704,20 @@ var ts; : unknownType; if (type.flags & 1024 && type.symbol === symbol) { - flags |= 131072; + flags |= 1048576; } - if (flags & 8192) { + if (flags & 131072) { type = getOptionalType(type); } - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024, writer); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); - getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); + typeToString(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024, writer); } function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { var type = getWidenedType(getRegularTypeOfExpression(expr)); - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024, writer); } function hasGlobalName(name) { return globals.has(ts.escapeLeadingUnderscores(name)); @@ -39819,7 +40751,7 @@ var ts; function isLiteralConstDeclaration(node) { if (ts.isConst(node)) { var type = getTypeOfSymbol(getSymbolOfNode(node)); - return !!(type.flags & 96 && type.flags & 2097152); + return !!(type.flags & 96 && type.flags & 8388608); } return false; } @@ -39894,7 +40826,7 @@ var ts; if (!fileToDirective) { return undefined; } - var meaning = (node.kind === 180) || (node.kind === 71 && isInTypeQuery(node)) + var meaning = (node.kind === 183) || (node.kind === 71 && isInTypeQuery(node)) ? 107455 | 1048576 : 793064 | 1920; var symbol = resolveEntityName(node, meaning, true); @@ -39937,7 +40869,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 269 && current.flags & 512) { + if (current.valueDeclaration && current.valueDeclaration.kind === 272 && current.flags & 512) { return false; } for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -39956,7 +40888,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 269); + return ts.getDeclarationOfKind(moduleSymbol, 272); } function initializeTypeChecker() { for (var _i = 0, _a = host.getSourceFiles(); _i < _a.length; _i++) { @@ -39989,6 +40921,8 @@ var ts; var list = augmentations_1[_d]; for (var _e = 0, list_1 = list; _e < list_1.length; _e++) { var augmentation = list_1[_e]; + if (!ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; mergeModuleAugmentation(augmentation); } } @@ -40012,6 +40946,17 @@ var ts; globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; globalThisType = getGlobalTypeOrUndefined("ThisType", 1); + if (augmentations) { + for (var _f = 0, augmentations_2 = augmentations; _f < augmentations_2.length; _f++) { + var list = augmentations_2[_f]; + for (var _g = 0, list_2 = list; _g < list_2.length; _g++) { + var augmentation = list_2[_g]; + if (ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } } function checkExternalEmitHelpers(location, helpers) { if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { @@ -40070,14 +41015,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 152 && !ts.nodeIsPresent(node.body)) { + if (node.kind === 153 && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 154 || node.kind === 155) { + else if (node.kind === 155 || node.kind === 156) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -40094,17 +41039,17 @@ var ts; var flags = 0; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 131) { - if (node.kind === 149 || node.kind === 151) { + if (modifier.kind !== 132) { + if (node.kind === 150 || node.kind === 152) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 158) { + if (node.kind === 159) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 76: - if (node.kind !== 233 && node.parent.kind === 230) { + if (node.kind !== 236 && node.parent.kind === 233) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76)); } break; @@ -40124,7 +41069,7 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 235 || node.parent.kind === 269) { + else if (node.parent.kind === 238 || node.parent.kind === 272) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128) { @@ -40147,10 +41092,10 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 235 || node.parent.kind === 269) { + else if (node.parent.kind === 238 || node.parent.kind === 272) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128) { @@ -40159,11 +41104,11 @@ var ts; flags |= 32; lastStatic = modifier; break; - case 131: + case 132: if (flags & 64) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 150 && node.kind !== 149 && node.kind !== 158 && node.kind !== 147) { + else if (node.kind !== 151 && node.kind !== 150 && node.kind !== 159 && node.kind !== 148) { return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } flags |= 64; @@ -40182,17 +41127,17 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1; break; case 79: - var container = node.parent.kind === 269 ? node.parent : node.parent.parent; - if (container.kind === 234 && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 ? node.parent : node.parent.parent; + if (container.kind === 237 && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512; @@ -40204,13 +41149,13 @@ var ts; else if (flags & 256) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 2097152) && node.parent.kind === 235) { + else if ((node.parent.flags & 2097152) && node.parent.kind === 238) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2; @@ -40220,14 +41165,14 @@ var ts; if (flags & 128) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 230) { - if (node.kind !== 152 && - node.kind !== 150 && - node.kind !== 154 && - node.kind !== 155) { + if (node.kind !== 233) { + if (node.kind !== 153 && + node.kind !== 151 && + node.kind !== 155 && + node.kind !== 156) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 230 && ts.hasModifier(node.parent, 128))) { + if (!(node.parent.kind === 233 && ts.hasModifier(node.parent, 128))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32) { @@ -40246,7 +41191,7 @@ var ts; else if (flags & 2 || node.parent.flags & 2097152) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 147) { + else if (node.kind === 148) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256; @@ -40254,7 +41199,7 @@ var ts; break; } } - if (node.kind === 153) { + if (node.kind === 154) { if (flags & 32) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -40269,13 +41214,13 @@ var ts; } return; } - else if ((node.kind === 239 || node.kind === 238) && flags & 2) { + else if ((node.kind === 242 || node.kind === 241) && flags & 2) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 147 && (flags & 92) && ts.isBindingPattern(node.name)) { + else if (node.kind === 148 && (flags & 92) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 147 && (flags & 92) && node.dotDotDotToken) { + else if (node.kind === 148 && (flags & 92) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256) { @@ -40291,37 +41236,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 154: case 155: - case 153: - case 150: - case 149: - case 152: + case 156: + case 154: case 151: - case 158: - case 234: - case 239: - case 238: - case 245: - case 244: - case 187: - case 188: - case 147: + case 150: + case 153: + case 152: + case 159: + case 237: + case 242: + case 241: + case 248: + case 247: + case 190: + case 191: + case 148: return false; default: - if (node.parent.kind === 235 || node.parent.kind === 269) { + if (node.parent.kind === 238 || node.parent.kind === 272) { return false; } switch (node.kind) { - case 229: - return nodeHasAnyModifiersExcept(node, 120); - case 230: - return nodeHasAnyModifiersExcept(node, 117); - case 231: - case 209: case 232: - return true; + return nodeHasAnyModifiersExcept(node, 120); case 233: + return nodeHasAnyModifiersExcept(node, 117); + case 234: + case 212: + case 235: + return true; + case 236: return nodeHasAnyModifiersExcept(node, 76); default: ts.Debug.fail(); @@ -40334,10 +41279,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 152: - case 229: - case 187: - case 188: + case 153: + case 232: + case 190: + case 191: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -40350,9 +41295,6 @@ var ts; } } function checkGrammarTypeParameterList(typeParameters, file) { - if (checkGrammarForDisallowedTrailingComma(typeParameters)) { - return true; - } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; @@ -40399,15 +41341,13 @@ var ts; return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 188) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } + if (!ts.isArrowFunction(node)) { + return false; } - return false; + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -40434,7 +41374,14 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 136 && parameter.type.kind !== 133) { + if (parameter.type.kind !== 137 && parameter.type.kind !== 134) { + var type = getTypeFromTypeNode(parameter.type); + if (type.flags & 2 || type.flags & 4) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type))); + } + if (allTypesAssignableToKind(type, 32, true)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead); + } return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -40460,7 +41407,7 @@ var ts; if (args) { for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; - if (arg.kind === 201) { + if (arg.kind === 204) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -40533,19 +41480,19 @@ var ts; return false; } function checkGrammarComputedPropertyName(node) { - if (node.kind !== 145) { + if (node.kind !== 146) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 195 && computedPropertyName.expression.operatorToken.kind === 26) { + if (computedPropertyName.expression.kind === 198 && computedPropertyName.expression.operatorToken.kind === 26) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 229 || - node.kind === 187 || - node.kind === 152); + ts.Debug.assert(node.kind === 232 || + node.kind === 190 || + node.kind === 153); if (node.flags & 2097152) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -40570,39 +41517,39 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267) { + if (prop.kind === 270) { continue; } var name = prop.name; - if (name.kind === 145) { + if (name.kind === 146) { checkGrammarComputedPropertyName(name); } - if (prop.kind === 266 && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 269 && !inDestructuring && prop.objectAssignmentInitializer) { return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); } if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 120 || prop.kind !== 152) { + if (mod.kind !== 120 || prop.kind !== 153) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } } var currentKind = void 0; switch (prop.kind) { - case 265: - case 266: + case 268: + case 269: checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8) { checkGrammarNumericLiteral(name); } - case 152: + case 153: currentKind = 1; break; - case 154: + case 155: currentKind = 2; break; - case 155: + case 156: currentKind = 4; break; default: @@ -40638,20 +41585,18 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 259) { + if (attr.kind === 262) { continue; } - var jsxAttr = attr; - var name = jsxAttr.name; + var name = attr.name, initializer = attr.initializer; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 260 && !initializer.expression) { - return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === 263 && !initializer.expression) { + return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -40659,12 +41604,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 217 && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 220 && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384) === 0) { return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); } } - if (forInOrOfStatement.initializer.kind === 228) { + if (forInOrOfStatement.initializer.kind === 231) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -40672,20 +41617,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 216 + var diagnostic = forInOrOfStatement.kind === 219 ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 216 + var diagnostic = forInOrOfStatement.kind === 219 ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 216 + var diagnostic = forInOrOfStatement.kind === 219 ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -40712,11 +41657,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 154 ? + return grammarErrorOnNode(accessor.name, kind === 155 ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 155) { + else if (kind === 156) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -40735,21 +41680,21 @@ var ts; } } function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 154 ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 154 ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 155 ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 140) { - if (node.type.kind !== 137) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(137)); + if (node.operator === 141) { + if (node.type.kind !== 138) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 227: + case 230: var decl = parent; if (decl.name.kind !== 71) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -40761,13 +41706,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 150: + case 151: if (!ts.hasModifier(parent, 32) || !ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 149: + case 150: if (!ts.hasModifier(parent, 64)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -40783,31 +41728,37 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === 179) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === 153) { + if (node.parent.kind === 182) { + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } if (ts.isClassLike(node.parent)) { if (node.flags & 2097152) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === 153 && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 231) { + else if (node.parent.kind === 234) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 164) { + else if (node.parent.kind === 165) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -40818,9 +41769,9 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 223: + case 226: if (node.label && current.label.escapedText === node.label.escapedText) { - var isMisplacedContinueLabel = node.kind === 218 + var isMisplacedContinueLabel = node.kind === 221 && !ts.isIterationStatement(current.statement, true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -40828,8 +41779,8 @@ var ts; return false; } break; - case 222: - if (node.kind === 219 && !node.label) { + case 225: + if (node.kind === 222 && !node.label) { return false; } break; @@ -40842,13 +41793,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 219 + var message = node.kind === 222 ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 219 + var message = node.kind === 222 ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -40857,12 +41808,15 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== ts.lastOrUndefined(elements)) { + if (node !== ts.last(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 176 || node.name.kind === 175) { + if (node.name.kind === 179 || node.name.kind === 178) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } + if (node.propertyName) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name); + } if (node.initializer) { return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } @@ -40870,11 +41824,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 || expr.kind === 8 || - expr.kind === 193 && expr.operator === 38 && + expr.kind === 196 && expr.operator === 38 && expr.operand.kind === 8; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 216 && node.parent.parent.kind !== 217) { + if (node.parent.parent.kind !== 219 && node.parent.parent.kind !== 220) { if (node.flags & 2097152) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -40901,7 +41855,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 209 || !node.type || node.initializer || node.flags & 2097152)) { + if (node.exclamationToken && (node.parent.parent.kind !== 212 || !node.type || node.initializer || node.flags & 2097152)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && @@ -40954,15 +41908,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 212: - case 213: - case 214: - case 221: case 215: case 216: case 217: + case 224: + case 218: + case 219: + case 220: return false; - case 223: + case 226: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -41028,7 +41982,7 @@ var ts; return true; } } - else if (node.parent.kind === 231) { + else if (node.parent.kind === 234) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -41036,7 +41990,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 164) { + else if (node.parent.kind === 165) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -41047,19 +42001,19 @@ var ts; if (node.flags & 2097152 && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } - if (node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || + if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 2097152 || ts.hasModifier(node, 32 | 128))) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } } function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - if (node.kind === 231 || - node.kind === 232 || - node.kind === 239 || - node.kind === 238 || - node.kind === 245 || - node.kind === 244 || - node.kind === 237 || + if (node.kind === 234 || + node.kind === 235 || + node.kind === 242 || + node.kind === 241 || + node.kind === 248 || + node.kind === 247 || + node.kind === 240 || ts.hasModifier(node, 2 | 1 | 512)) { return false; } @@ -41068,7 +42022,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 209) { + if (ts.isDeclaration(decl) || decl.kind === 212) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -41087,7 +42041,7 @@ var ts; if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); } - if (node.parent.kind === 208 || node.parent.kind === 235 || node.parent.kind === 269) { + if (node.parent.kind === 211 || node.parent.kind === 238 || node.parent.kind === 272) { var links_1 = getNodeLinks(node.parent); if (!links_1.hasReportedStatementInAmbientContext) { return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); @@ -41103,10 +42057,10 @@ var ts; if (languageVersion >= 1) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 174)) { + else if (ts.isChildOfNodeWithKind(node, 177)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 268)) { + else if (ts.isChildOfNodeWithKind(node, 271)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -41154,22 +42108,22 @@ var ts; ts.createTypeChecker = createTypeChecker; function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 243: - case 247: - return true; + case 246: + case 250: + return ts.isIdentifier(name); default: return ts.isDeclarationName(name); } } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 240: - case 238: - case 241: case 243: + case 241: + case 244: + case 246: return true; case 71: - return decl.parent.kind === 243; + return decl.parent.kind === 246; default: return false; } @@ -41268,7 +42222,7 @@ var ts; var node = createSynthesizedNode(71); node.escapedText = ts.escapeLeadingUnderscores(text); node.originalKeywordKind = text ? ts.stringToToken(text) : 0; - node.autoGenerateKind = 0; + node.autoGenerateFlags = 0; node.autoGenerateId = 0; if (typeArguments) { node.typeArguments = createNodeArray(typeArguments); @@ -41283,20 +42237,23 @@ var ts; } ts.updateIdentifier = updateIdentifier; var nextAutoGenerateId = 0; - function createTempVariable(recordTempVariable) { + function createTempVariable(recordTempVariable, reservedInNestedScopes) { var name = createIdentifier(""); - name.autoGenerateKind = 1; + name.autoGenerateFlags = 1; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; if (recordTempVariable) { recordTempVariable(name); } + if (reservedInNestedScopes) { + name.autoGenerateFlags |= 16; + } return name; } ts.createTempVariable = createTempVariable; function createLoopVariable() { var name = createIdentifier(""); - name.autoGenerateKind = 2; + name.autoGenerateFlags = 2; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -41304,7 +42261,7 @@ var ts; ts.createLoopVariable = createLoopVariable; function createUniqueName(text) { var name = createIdentifier(text); - name.autoGenerateKind = 3; + name.autoGenerateFlags = 3; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -41312,10 +42269,12 @@ var ts; ts.createUniqueName = createUniqueName; function getGeneratedNameForNode(node, shouldSkipNameGenerationScope) { var name = createIdentifier(""); - name.autoGenerateKind = 4; + name.autoGenerateFlags = 4; name.autoGenerateId = nextAutoGenerateId; name.original = node; - name.skipNameGenerationScope = !!shouldSkipNameGenerationScope; + if (shouldSkipNameGenerationScope) { + name.autoGenerateFlags |= 8; + } nextAutoGenerateId++; return name; } @@ -41345,7 +42304,7 @@ var ts; } ts.createFalse = createFalse; function createQualifiedName(left, right) { - var node = createSynthesizedNode(144); + var node = createSynthesizedNode(145); node.left = left; node.right = asName(right); return node; @@ -41359,7 +42318,7 @@ var ts; } ts.updateQualifiedName = updateQualifiedName; function createComputedPropertyName(expression) { - var node = createSynthesizedNode(145); + var node = createSynthesizedNode(146); node.expression = expression; return node; } @@ -41371,7 +42330,7 @@ var ts; } ts.updateComputedPropertyName = updateComputedPropertyName; function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(146); + var node = createSynthesizedNode(147); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -41387,7 +42346,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(147); + var node = createSynthesizedNode(148); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -41411,7 +42370,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(148); + var node = createSynthesizedNode(149); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -41423,7 +42382,7 @@ var ts; } ts.updateDecorator = updateDecorator; function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(149); + var node = createSynthesizedNode(150); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -41442,30 +42401,32 @@ var ts; : node; } ts.updatePropertySignature = updatePropertySignature; - function createProperty(decorators, modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(150); + function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { + var node = createSynthesizedNode(151); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.questionToken = questionToken; + node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 ? questionOrExclamationToken : undefined; + node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 ? questionOrExclamationToken : undefined; node.type = type; node.initializer = initializer; return node; } ts.createProperty = createProperty; - function updateProperty(node, decorators, modifiers, name, questionToken, type, initializer) { + function updateProperty(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { return node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name - || node.questionToken !== questionToken + || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 ? questionOrExclamationToken : undefined) + || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 ? questionOrExclamationToken : undefined) || node.type !== type || node.initializer !== initializer - ? updateNode(createProperty(decorators, modifiers, name, questionToken, type, initializer), node) + ? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(151, typeParameters, parameters, type); + var node = createSignatureDeclaration(152, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -41482,7 +42443,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(152); + var node = createSynthesizedNode(153); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -41510,7 +42471,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(153); + var node = createSynthesizedNode(154); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -41530,7 +42491,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(154); + var node = createSynthesizedNode(155); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -41553,7 +42514,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(155); + var node = createSynthesizedNode(156); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -41574,7 +42535,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(156, typeParameters, parameters, type); + return createSignatureDeclaration(157, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -41582,7 +42543,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(157, typeParameters, parameters, type); + return createSignatureDeclaration(158, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -41590,7 +42551,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(158); + var node = createSynthesizedNode(159); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -41607,11 +42568,12 @@ var ts; : node; } ts.updateIndexSignature = updateIndexSignature; - function createSignatureDeclaration(kind, typeParameters, parameters, type) { + function createSignatureDeclaration(kind, typeParameters, parameters, type, typeArguments) { var node = createSynthesizedNode(kind); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createSignatureDeclaration = createSignatureDeclaration; @@ -41627,7 +42589,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(159); + var node = createSynthesizedNode(160); node.parameterName = asName(parameterName); node.type = type; return node; @@ -41641,7 +42603,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(160); + var node = createSynthesizedNode(161); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -41655,7 +42617,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(161, typeParameters, parameters, type); + return createSignatureDeclaration(162, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -41663,7 +42625,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(162, typeParameters, parameters, type); + return createSignatureDeclaration(163, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -41671,7 +42633,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(163); + var node = createSynthesizedNode(164); node.exprName = exprName; return node; } @@ -41683,7 +42645,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(164); + var node = createSynthesizedNode(165); node.members = createNodeArray(members); return node; } @@ -41695,7 +42657,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(165); + var node = createSynthesizedNode(166); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -41707,7 +42669,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(166); + var node = createSynthesizedNode(167); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -41719,7 +42681,7 @@ var ts; } ts.updateTypleTypeNode = updateTypleTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(167, types); + return createUnionOrIntersectionTypeNode(168, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -41727,7 +42689,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(168, types); + return createUnionOrIntersectionTypeNode(169, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -41745,8 +42707,38 @@ var ts; ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) : node; } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createSynthesizedNode(170); + node.checkType = ts.parenthesizeConditionalTypeMember(checkType); + node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); + node.trueType = trueType; + node.falseType = falseType; + return node; + } + ts.createConditionalTypeNode = createConditionalTypeNode; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType + || node.extendsType !== extendsType + || node.trueType !== trueType + || node.falseType !== falseType + ? updateNode(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) + : node; + } + ts.updateConditionalTypeNode = updateConditionalTypeNode; + function createInferTypeNode(typeParameter) { + var node = createSynthesizedNode(171); + node.typeParameter = typeParameter; + return node; + } + ts.createInferTypeNode = createInferTypeNode; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter + ? updateNode(createInferTypeNode(typeParameter), node) + : node; + } + ts.updateInferTypeNode = updateInferTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(169); + var node = createSynthesizedNode(172); node.type = type; return node; } @@ -41758,12 +42750,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(170); + return createSynthesizedNode(173); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(171); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 127; + var node = createSynthesizedNode(174); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 128; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -41773,7 +42765,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(172); + var node = createSynthesizedNode(175); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -41787,7 +42779,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(173); + var node = createSynthesizedNode(176); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -41805,7 +42797,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(174); + var node = createSynthesizedNode(177); node.literal = literal; return node; } @@ -41817,7 +42809,7 @@ var ts; } ts.updateLiteralTypeNode = updateLiteralTypeNode; function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(175); + var node = createSynthesizedNode(178); node.elements = createNodeArray(elements); return node; } @@ -41829,7 +42821,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(176); + var node = createSynthesizedNode(179); node.elements = createNodeArray(elements); return node; } @@ -41841,7 +42833,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(177); + var node = createSynthesizedNode(180); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -41859,7 +42851,7 @@ var ts; } ts.updateBindingElement = updateBindingElement; function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(178); + var node = createSynthesizedNode(181); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -41873,7 +42865,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(179); + var node = createSynthesizedNode(182); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -41887,7 +42879,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(180); + var node = createSynthesizedNode(183); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072); @@ -41902,7 +42894,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(181); + var node = createSynthesizedNode(184); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -41916,7 +42908,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(182); + var node = createSynthesizedNode(185); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -41932,7 +42924,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(183); + var node = createSynthesizedNode(186); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -41948,7 +42940,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, template) { - var node = createSynthesizedNode(184); + var node = createSynthesizedNode(187); node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; @@ -41962,7 +42954,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(185); + var node = createSynthesizedNode(188); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -41976,7 +42968,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(186); + var node = createSynthesizedNode(189); node.expression = expression; return node; } @@ -41988,7 +42980,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(187); + var node = createSynthesizedNode(190); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -42012,7 +43004,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(188); + var node = createSynthesizedNode(191); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -42046,7 +43038,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(189); + var node = createSynthesizedNode(192); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -42058,7 +43050,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(190); + var node = createSynthesizedNode(193); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -42070,7 +43062,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(191); + var node = createSynthesizedNode(194); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -42082,7 +43074,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(192); + var node = createSynthesizedNode(195); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -42094,7 +43086,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(193); + var node = createSynthesizedNode(196); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -42107,7 +43099,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(194); + var node = createSynthesizedNode(197); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -42120,7 +43112,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(195); + var node = createSynthesizedNode(198); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, true, undefined); @@ -42137,7 +43129,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(196); + var node = createSynthesizedNode(199); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -42167,7 +43159,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(197); + var node = createSynthesizedNode(200); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -42205,7 +43197,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(198); + var node = createSynthesizedNode(201); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 ? asteriskTokenOrExpression : expression; return node; @@ -42219,7 +43211,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(199); + var node = createSynthesizedNode(202); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -42231,7 +43223,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(200); + var node = createSynthesizedNode(203); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -42252,11 +43244,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(201); + return createSynthesizedNode(204); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(202); + var node = createSynthesizedNode(205); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -42270,7 +43262,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(203); + var node = createSynthesizedNode(206); node.expression = expression; node.type = type; return node; @@ -42284,7 +43276,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(204); + var node = createSynthesizedNode(207); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -42296,7 +43288,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(205); + var node = createSynthesizedNode(208); node.keywordToken = keywordToken; node.name = name; return node; @@ -42309,7 +43301,7 @@ var ts; } ts.updateMetaProperty = updateMetaProperty; function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(206); + var node = createSynthesizedNode(209); node.expression = expression; node.literal = literal; return node; @@ -42323,11 +43315,11 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(207); + return createSynthesizedNode(210); } ts.createSemicolonClassElement = createSemicolonClassElement; function createBlock(statements, multiLine) { - var block = createSynthesizedNode(208); + var block = createSynthesizedNode(211); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -42341,7 +43333,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(209); + var node = createSynthesizedNode(212); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -42356,11 +43348,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(210); + return createSynthesizedNode(213); } ts.createEmptyStatement = createEmptyStatement; function createStatement(expression) { - var node = createSynthesizedNode(211); + var node = createSynthesizedNode(214); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -42372,7 +43364,7 @@ var ts; } ts.updateStatement = updateStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(212); + var node = createSynthesizedNode(215); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -42388,7 +43380,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(213); + var node = createSynthesizedNode(216); node.statement = statement; node.expression = expression; return node; @@ -42402,7 +43394,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(214); + var node = createSynthesizedNode(217); node.expression = expression; node.statement = statement; return node; @@ -42416,7 +43408,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(215); + var node = createSynthesizedNode(218); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -42434,7 +43426,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(216); + var node = createSynthesizedNode(219); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -42450,7 +43442,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(217); + var node = createSynthesizedNode(220); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -42468,7 +43460,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(218); + var node = createSynthesizedNode(221); node.label = asName(label); return node; } @@ -42480,7 +43472,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(219); + var node = createSynthesizedNode(222); node.label = asName(label); return node; } @@ -42492,7 +43484,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(220); + var node = createSynthesizedNode(223); node.expression = expression; return node; } @@ -42504,7 +43496,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(221); + var node = createSynthesizedNode(224); node.expression = expression; node.statement = statement; return node; @@ -42518,7 +43510,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(222); + var node = createSynthesizedNode(225); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -42532,7 +43524,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(223); + var node = createSynthesizedNode(226); node.label = asName(label); node.statement = statement; return node; @@ -42546,7 +43538,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(224); + var node = createSynthesizedNode(227); node.expression = expression; return node; } @@ -42558,7 +43550,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(225); + var node = createSynthesizedNode(228); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -42574,11 +43566,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(226); + return createSynthesizedNode(229); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(227); + var node = createSynthesizedNode(230); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -42594,7 +43586,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { - var node = createSynthesizedNode(228); + var node = createSynthesizedNode(231); node.flags |= flags & 3; node.declarations = createNodeArray(declarations); return node; @@ -42607,7 +43599,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(229); + var node = createSynthesizedNode(232); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -42633,7 +43625,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(230); + var node = createSynthesizedNode(233); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -42655,7 +43647,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(231); + var node = createSynthesizedNode(234); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -42677,7 +43669,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(232); + var node = createSynthesizedNode(235); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -42697,7 +43689,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(233); + var node = createSynthesizedNode(236); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -42715,7 +43707,7 @@ var ts; } ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { - var node = createSynthesizedNode(234); + var node = createSynthesizedNode(237); node.flags |= flags & (16 | 4 | 512); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -42734,7 +43726,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(235); + var node = createSynthesizedNode(238); node.statements = createNodeArray(statements); return node; } @@ -42746,7 +43738,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(236); + var node = createSynthesizedNode(239); node.clauses = createNodeArray(clauses); return node; } @@ -42758,7 +43750,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(237); + var node = createSynthesizedNode(240); node.name = asName(name); return node; } @@ -42770,7 +43762,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(238); + var node = createSynthesizedNode(241); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -42788,7 +43780,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(239); + var node = createSynthesizedNode(242); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -42806,7 +43798,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(240); + var node = createSynthesizedNode(243); node.name = name; node.namedBindings = namedBindings; return node; @@ -42820,7 +43812,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(241); + var node = createSynthesizedNode(244); node.name = name; return node; } @@ -42832,7 +43824,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(242); + var node = createSynthesizedNode(245); node.elements = createNodeArray(elements); return node; } @@ -42844,7 +43836,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(243); + var node = createSynthesizedNode(246); node.propertyName = propertyName; node.name = name; return node; @@ -42858,7 +43850,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(244); + var node = createSynthesizedNode(247); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -42875,7 +43867,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(245); + var node = createSynthesizedNode(248); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -42893,7 +43885,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(246); + var node = createSynthesizedNode(249); node.elements = createNodeArray(elements); return node; } @@ -42905,7 +43897,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(247); + var node = createSynthesizedNode(250); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -42919,7 +43911,7 @@ var ts; } ts.updateExportSpecifier = updateExportSpecifier; function createExternalModuleReference(expression) { - var node = createSynthesizedNode(249); + var node = createSynthesizedNode(252); node.expression = expression; return node; } @@ -42931,7 +43923,7 @@ var ts; } ts.updateExternalModuleReference = updateExternalModuleReference; function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(250); + var node = createSynthesizedNode(253); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -42947,7 +43939,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, attributes) { - var node = createSynthesizedNode(251); + var node = createSynthesizedNode(254); node.tagName = tagName; node.attributes = attributes; return node; @@ -42961,7 +43953,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, attributes) { - var node = createSynthesizedNode(252); + var node = createSynthesizedNode(255); node.tagName = tagName; node.attributes = attributes; return node; @@ -42975,7 +43967,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(253); + var node = createSynthesizedNode(256); node.tagName = tagName; return node; } @@ -42987,7 +43979,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(254); + var node = createSynthesizedNode(257); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -43003,7 +43995,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(257); + var node = createSynthesizedNode(260); node.name = name; node.initializer = initializer; return node; @@ -43017,7 +44009,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(258); + var node = createSynthesizedNode(261); node.properties = createNodeArray(properties); return node; } @@ -43029,7 +44021,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(259); + var node = createSynthesizedNode(262); node.expression = expression; return node; } @@ -43041,7 +44033,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(260); + var node = createSynthesizedNode(263); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -43054,7 +44046,7 @@ var ts; } ts.updateJsxExpression = updateJsxExpression; function createCaseClause(expression, statements) { - var node = createSynthesizedNode(261); + var node = createSynthesizedNode(264); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -43068,7 +44060,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(262); + var node = createSynthesizedNode(265); node.statements = createNodeArray(statements); return node; } @@ -43080,7 +44072,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(263); + var node = createSynthesizedNode(266); node.token = token; node.types = createNodeArray(types); return node; @@ -43093,7 +44085,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(264); + var node = createSynthesizedNode(267); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -43107,7 +44099,7 @@ var ts; } ts.updateCatchClause = updateCatchClause; function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(265); + var node = createSynthesizedNode(268); node.name = asName(name); node.questionToken = undefined; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -43122,7 +44114,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(266); + var node = createSynthesizedNode(269); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -43136,7 +44128,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(267); + var node = createSynthesizedNode(270); node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; return node; } @@ -43148,7 +44140,7 @@ var ts; } ts.updateSpreadAssignment = updateSpreadAssignment; function createEnumMember(name, initializer) { - var node = createSynthesizedNode(268); + var node = createSynthesizedNode(271); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -43163,7 +44155,7 @@ var ts; ts.updateEnumMember = updateEnumMember; function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createSynthesizedNode(269); + var updated = createSynthesizedNode(272); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -43232,28 +44224,28 @@ var ts; } ts.getMutableClone = getMutableClone; function createNotEmittedStatement(original) { - var node = createSynthesizedNode(291); + var node = createSynthesizedNode(294); node.original = original; setTextRange(node, original); return node; } ts.createNotEmittedStatement = createNotEmittedStatement; function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(295); + var node = createSynthesizedNode(298); node.emitNode = {}; node.original = original; return node; } ts.createEndOfDeclarationMarker = createEndOfDeclarationMarker; function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(294); + var node = createSynthesizedNode(297); node.emitNode = {}; node.original = original; return node; } ts.createMergeDeclarationMarker = createMergeDeclarationMarker; function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(292); + var node = createSynthesizedNode(295); node.expression = expression; node.original = original; setTextRange(node, original); @@ -43269,7 +44261,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 293) { + if (node.kind === 296) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26) { @@ -43279,7 +44271,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(293); + var node = createSynthesizedNode(296); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -43291,7 +44283,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createBundle(sourceFiles) { - var node = ts.createNode(270); + var node = ts.createNode(273); node.sourceFiles = sourceFiles; return node; } @@ -43394,7 +44386,7 @@ var ts; function getOrCreateEmitNode(node) { if (!node.emitNode) { if (ts.isParseTreeNode(node)) { - if (node.kind === 269) { + if (node.kind === 272) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -43815,7 +44807,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 223 + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 226 ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -43833,13 +44825,13 @@ var ts; case 8: case 9: return false; - case 178: + case 181: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 179: + case 182: return target.properties.length > 0; default: return true; @@ -43865,7 +44857,7 @@ var ts; } else { switch (callee.kind) { - case 180: { + case 183: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createPropertyAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.name); @@ -43877,7 +44869,7 @@ var ts; } break; } - case 181: { + case 184: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { thisArg = ts.createTempVariable(recordTempVariable); target = ts.createElementAccess(ts.setTextRange(ts.createAssignment(thisArg, callee.expression), callee.expression), callee.argumentExpression); @@ -43930,14 +44922,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 154: case 155: + case 156: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 265: + case 268: return createExpressionForPropertyAssignment(property, receiver); - case 266: + case 269: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 152: + case 153: return createExpressionForMethodDeclaration(property, receiver); } } @@ -44137,7 +45129,7 @@ var ts; ts.ensureUseStrict = ensureUseStrict; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); - if (skipped.kind === 186) { + if (skipped.kind === 189) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -44146,15 +45138,15 @@ var ts; } ts.parenthesizeBinaryOperand = parenthesizeBinaryOperand; function binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { - var binaryOperatorPrecedence = ts.getOperatorPrecedence(195, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(195, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(198, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(198, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { case -1: if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 - && operand.kind === 198) { + && operand.kind === 201) { return false; } return true; @@ -44193,7 +45185,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 195 && node.operatorToken.kind === 37) { + if (node.kind === 198 && node.operatorToken.kind === 37) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -44208,7 +45200,7 @@ var ts; return 0; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(196, 55); + var conditionalPrecedence = ts.getOperatorPrecedence(199, 55); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1) { @@ -44218,16 +45210,18 @@ var ts; } ts.parenthesizeForConditionalHead = parenthesizeForConditionalHead; function parenthesizeSubexpressionOfConditionalExpression(e) { - return e.kind === 195 && e.operatorToken.kind === 26 + var emittedExpression = ts.skipPartiallyEmittedExpressions(e); + return emittedExpression.kind === 198 && emittedExpression.operatorToken.kind === 26 || + emittedExpression.kind === 296 ? ts.createParen(e) : e; } ts.parenthesizeSubexpressionOfConditionalExpression = parenthesizeSubexpressionOfConditionalExpression; function parenthesizeDefaultExpression(e) { var check = ts.skipPartiallyEmittedExpressions(e); - return (check.kind === 200 || - check.kind === 187 || - check.kind === 293 || + return (check.kind === 203 || + check.kind === 190 || + check.kind === 296 || ts.isBinaryExpression(check) && check.operatorToken.kind === 26) ? ts.createParen(e) : e; @@ -44236,9 +45230,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, true); switch (leftmostExpr.kind) { - case 182: + case 185: return ts.createParen(expression); - case 183: + case 186: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -44249,7 +45243,7 @@ var ts; function parenthesizeForAccess(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 183 || emittedExpression.arguments)) { + && (emittedExpression.kind !== 186 || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -44287,7 +45281,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(195, 26); + var commaPrecedence = ts.getOperatorPrecedence(198, 26); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -44298,34 +45292,38 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 187 || kind === 188) { + if (kind === 190 || kind === 191) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, false).kind; - if (leftmostExpressionKind === 179 || leftmostExpressionKind === 187) { + if (leftmostExpressionKind === 182 || leftmostExpressionKind === 190) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function parenthesizeConditionalTypeMember(member) { + return member.kind === 170 ? ts.createParenthesizedType(member) : member; + } + ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 167: case 168: - case 161: + case 169: case 162: + case 163: return ts.createParenthesizedType(member); } - return member; + return parenthesizeConditionalTypeMember(member); } ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 163: - case 171: + case 164: + case 174: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -44351,24 +45349,24 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 194: + case 197: node = node.operand; continue; - case 195: + case 198: node = node.left; continue; - case 196: + case 199: node = node.condition; continue; - case 182: + case 185: if (stopAtCallExpressions) { return node; } - case 181: - case 180: + case 184: + case 183: node = node.expression; continue; - case 292: + case 295: node = node.expression; continue; } @@ -44376,7 +45374,7 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 179) { + if (!ts.isBlock(body) && getLeftmostExpression(body, false).kind === 182) { return ts.setTextRange(ts.createParen(body), body); } return body; @@ -44392,13 +45390,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7; } switch (node.kind) { - case 186: + case 189: return (kinds & 1) !== 0; - case 185: - case 203: - case 204: + case 188: + case 206: + case 207: return (kinds & 2) !== 0; - case 292: + case 295: return (kinds & 4) !== 0; } return false; @@ -44423,14 +45421,14 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipParentheses(node) { - while (node.kind === 186) { + while (node.kind === 189) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 204) { + while (ts.isAssertionExpression(node) || node.kind === 207) { node = node.expression; } return node; @@ -44438,15 +45436,15 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 186: return ts.updateParen(outerExpression, expression); - case 185: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 203: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 204: return ts.updateNonNullExpression(outerExpression, expression); - case 292: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 189: return ts.updateParen(outerExpression, expression); + case 188: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 206: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 207: return ts.updateNonNullExpression(outerExpression, expression); + case 295: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } function isIgnorableParen(node) { - return node.kind === 186 + return node.kind === 189 && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -44471,14 +45469,14 @@ var ts; return emitNode && emitNode.externalHelpersModuleName; } ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues) { + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) { if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(node, compilerOptions)) { var externalHelpersModuleName = getExternalHelpersModuleName(node); if (externalHelpersModuleName) { return externalHelpersModuleName; } var moduleKind = ts.getEmitModuleKind(compilerOptions); - var create = hasExportStarsToExportValues + var create = (hasExportStarsToExportValues || (compilerOptions.esModuleInterop && hasImportStarOrImportDefault)) && moduleKind !== ts.ModuleKind.System && moduleKind !== ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.ESNext; @@ -44508,10 +45506,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 239 && node.importClause) { + if (node.kind === 242 && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 245 && node.moduleSpecifier) { + if (node.kind === 248 && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -44573,11 +45571,11 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 265: + case 268: return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 266: + case 269: return bindingElement.name; - case 267: + case 270: return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } return undefined; @@ -44593,11 +45591,11 @@ var ts; ts.getTargetOfBindingOrAssignmentElement = getTargetOfBindingOrAssignmentElement; function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 147: - case 177: + case 148: + case 180: return bindingElement.dotDotDotToken; - case 199: - case 267: + case 202: + case 270: return bindingElement; } return undefined; @@ -44605,7 +45603,7 @@ var ts; ts.getRestIndicatorOfBindingOrAssignmentElement = getRestIndicatorOfBindingOrAssignmentElement; function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 177: + case 180: if (bindingElement.propertyName) { var propertyName = bindingElement.propertyName; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -44613,7 +45611,7 @@ var ts; : propertyName; } break; - case 265: + case 268: if (bindingElement.name) { var propertyName = bindingElement.name; return ts.isComputedPropertyName(propertyName) && ts.isStringOrNumericLiteral(propertyName.expression) @@ -44621,7 +45619,7 @@ var ts; : propertyName; } break; - case 267: + case 270: return bindingElement.name; } var target = getTargetOfBindingOrAssignmentElement(bindingElement); @@ -44635,11 +45633,11 @@ var ts; ts.getPropertyNameOfBindingOrAssignmentElement = getPropertyNameOfBindingOrAssignmentElement; function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 175: - case 176: case 178: - return name.elements; case 179: + case 181: + return name.elements; + case 182: return name.properties; } } @@ -44678,11 +45676,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 176: - case 178: - return convertToArrayAssignmentPattern(node); - case 175: case 179: + case 181: + return convertToArrayAssignmentPattern(node); + case 178: + case 182: return convertToObjectAssignmentPattern(node); } } @@ -44714,6 +45712,7 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + var isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration); function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; @@ -44818,251 +45817,255 @@ var ts; return undefined; } var kind = node.kind; - if ((kind > 0 && kind <= 143) || kind === 170) { + if ((kind > 0 && kind <= 144) || kind === 173) { return node; } switch (kind) { case 71: - return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 144: - return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); + return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); case 145: - return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); case 146: - return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); + return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); case 147: - return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); case 148: - return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 149: - return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); case 150: - return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 151: - return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); + return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 152: - return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); case 153: - return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 154: - return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); case 155: - return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); + return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 156: - return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); case 157: - return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 158: - return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 159: - return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 160: - return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); + return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); case 161: - return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); case 162: - return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 163: - return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); + return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 164: - return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); + return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); case 165: - return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); + return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); case 166: - return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); + return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); case 167: - return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); case 168: - return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); case 169: - return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); + case 170: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); case 171: - return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); case 172: - return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 173: - return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); case 174: - return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); + return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); case 175: - return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); + return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); case 176: - return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); + return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); case 177: - return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); case 178: - return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); + return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); case 179: - return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); + return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); case 180: - return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); case 181: - return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); + return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); case 182: - return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); case 183: - return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); + return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); case 184: - return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); + return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); case 185: - return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); case 186: - return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); case 187: - return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); case 188: - return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); + return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); case 189: - return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); case 190: - return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 191: - return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); case 192: - return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); case 193: - return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); + return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); case 194: - return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); + return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); case 195: - return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); + return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); case 196: - return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); + return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); case 197: - return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); case 198: - return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); case 199: - return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); case 200: - return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); + case 201: + return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); case 202: - return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); case 203: - return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 204: - return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); case 205: - return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); case 206: - return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); + return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); + case 207: + return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); case 208: - return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); case 209: - return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); + return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); case 211: - return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 212: - return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 213: - return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); case 214: - return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); case 215: - return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); case 216: - return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); case 217: - return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 218: - return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); + return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 219: - return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); + return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 220: - return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 221: - return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); case 222: - return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); case 223: - return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); case 224: - return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 225: - return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); + return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); + case 226: + return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); case 227: - return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); case 228: - return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 229: - return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); + return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); case 230: - return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); + return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); case 231: - return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); + return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); case 232: - return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); + return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); case 233: - return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); + return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); case 234: - return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); + return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); case 235: - return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); case 236: - return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); + return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); case 237: - return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); case 238: - return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); + return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 239: - return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); case 240: - return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); + return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); case 241: - return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); case 242: - return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); + return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); case 243: - return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); case 244: - return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); case 245: - return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); + return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); case 246: - return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); + return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); case 247: - return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); + return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); + case 248: + return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); case 249: - return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); case 250: - return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 251: - return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); case 252: - return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); case 253: - return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); + return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); case 254: - return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); + return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 255: + return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); + case 256: + return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); case 257: - return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 258: - return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 259: - return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); case 260: - return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); case 261: - return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); case 262: - return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); + return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); case 263: - return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); + return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); case 264: - return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); + return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); case 265: - return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); case 266: - return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); case 267: - return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); case 268: - return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); case 269: + return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); + case 270: + return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); + case 271: + return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); + case 272: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); - case 292: + case 295: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 293: + case 296: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: return node; @@ -45088,52 +46091,52 @@ var ts; var reduceNodes = cbNodeArray ? reduceNodeArray : ts.reduceLeft; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; - if ((kind > 0 && kind <= 143)) { + if ((kind > 0 && kind <= 144)) { return initial; } - if ((kind >= 159 && kind <= 174)) { + if ((kind >= 160 && kind <= 177)) { return initial; } var result = initial; switch (node.kind) { - case 207: case 210: - case 201: - case 226: - case 291: + case 213: + case 204: + case 229: + case 294: break; - case 144: + case 145: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 145: + case 146: result = reduceNode(node.expression, cbNode, result); break; - case 147: + case 148: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 148: + case 149: result = reduceNode(node.expression, cbNode, result); break; - case 149: + case 150: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 150: + case 151: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152: + case 153: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -45142,17 +46145,9 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 153: - result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.body, cbNode, result); - break; case 154: - result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); - result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); - result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; case 155: @@ -45160,50 +46155,58 @@ var ts; result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 175: - case 176: + case 156: + result = reduceNodes(node.decorators, cbNodes, result); + result = reduceNodes(node.modifiers, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNodes(node.parameters, cbNodes, result); + result = reduceNode(node.body, cbNode, result); + break; + case 178: + case 179: result = reduceNodes(node.elements, cbNodes, result); break; - case 177: + case 180: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 178: + case 181: result = reduceNodes(node.elements, cbNodes, result); break; - case 179: - result = reduceNodes(node.properties, cbNodes, result); - break; - case 180: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.name, cbNode, result); - break; - case 181: - result = reduceNode(node.expression, cbNode, result); - result = reduceNode(node.argumentExpression, cbNode, result); - break; case 182: - result = reduceNode(node.expression, cbNode, result); - result = reduceNodes(node.typeArguments, cbNodes, result); - result = reduceNodes(node.arguments, cbNodes, result); + result = reduceNodes(node.properties, cbNodes, result); break; case 183: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.name, cbNode, result); + break; + case 184: + result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.argumentExpression, cbNode, result); + break; + case 185: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 184: + case 186: + result = reduceNode(node.expression, cbNode, result); + result = reduceNodes(node.typeArguments, cbNodes, result); + result = reduceNodes(node.arguments, cbNodes, result); + break; + case 187: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 185: + case 188: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 187: + case 190: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -45211,121 +46214,121 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 188: + case 191: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 186: case 189: - case 190: - case 191: case 192: - case 198: - case 199: - case 204: - result = reduceNode(node.expression, cbNode, result); - break; case 193: case 194: + case 195: + case 201: + case 202: + case 207: + result = reduceNode(node.expression, cbNode, result); + break; + case 196: + case 197: result = reduceNode(node.operand, cbNode, result); break; - case 195: + case 198: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 196: + case 199: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 197: + case 200: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 200: + case 203: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 202: + case 205: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 203: + case 206: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; - case 206: + case 209: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; - case 208: + case 211: result = reduceNodes(node.statements, cbNodes, result); break; - case 209: + case 212: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 211: + case 214: result = reduceNode(node.expression, cbNode, result); break; - case 212: + case 215: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 213: + case 216: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 214: - case 221: + case 217: + case 224: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 215: + case 218: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216: - case 217: + case 219: + case 220: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 220: - case 224: + case 223: + case 227: result = reduceNode(node.expression, cbNode, result); break; - case 222: + case 225: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 223: + case 226: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225: + case 228: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 227: + case 230: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 228: + case 231: result = reduceNodes(node.declarations, cbNodes, result); break; - case 229: + case 232: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -45334,7 +46337,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 230: + case 233: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -45342,131 +46345,131 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 233: + case 236: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 234: + case 237: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 235: + case 238: result = reduceNodes(node.statements, cbNodes, result); break; - case 236: + case 239: result = reduceNodes(node.clauses, cbNodes, result); break; - case 238: + case 241: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 239: + case 242: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 240: + case 243: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 241: + case 244: result = reduceNode(node.name, cbNode, result); break; - case 242: - case 246: + case 245: + case 249: result = reduceNodes(node.elements, cbNodes, result); break; - case 243: - case 247: + case 246: + case 250: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 244: + case 247: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 245: + case 248: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 249: + case 252: result = reduceNode(node.expression, cbNode, result); break; - case 250: + case 253: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 254: + case 257: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 251: - case 252: + case 254: + case 255: result = reduceNode(node.tagName, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 258: + case 261: result = reduceNodes(node.properties, cbNodes, result); break; - case 253: + case 256: result = reduceNode(node.tagName, cbNode, result); break; - case 257: + case 260: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 259: - result = reduceNode(node.expression, cbNode, result); - break; - case 260: - result = reduceNode(node.expression, cbNode, result); - break; - case 261: - result = reduceNode(node.expression, cbNode, result); case 262: - result = reduceNodes(node.statements, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 263: - result = reduceNodes(node.types, cbNodes, result); + result = reduceNode(node.expression, cbNode, result); break; case 264: - result = reduceNode(node.variableDeclaration, cbNode, result); - result = reduceNode(node.block, cbNode, result); - break; + result = reduceNode(node.expression, cbNode, result); case 265: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.initializer, cbNode, result); + result = reduceNodes(node.statements, cbNodes, result); break; case 266: - result = reduceNode(node.name, cbNode, result); - result = reduceNode(node.objectAssignmentInitializer, cbNode, result); + result = reduceNodes(node.types, cbNodes, result); break; case 267: - result = reduceNode(node.expression, cbNode, result); + result = reduceNode(node.variableDeclaration, cbNode, result); + result = reduceNode(node.block, cbNode, result); break; case 268: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; case 269: - result = reduceNodes(node.statements, cbNodes, result); + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 292: + case 270: result = reduceNode(node.expression, cbNode, result); break; - case 293: + case 271: + result = reduceNode(node.name, cbNode, result); + result = reduceNode(node.initializer, cbNode, result); + break; + case 272: + result = reduceNodes(node.statements, cbNodes, result); + break; + case 295: + result = reduceNode(node.expression, cbNode, result); + break; + case 296: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -45519,7 +46522,7 @@ var ts; return subtreeFlags; } function aggregateTransformFlagsForSubtree(node) { - if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 202)) { + if (ts.hasModifier(node, 2) || (ts.isTypeNode(node) && node.kind !== 205)) { return 0; } return reduceEachChild(node, 0, aggregateTransformFlagsForChildNode, aggregateTransformFlagsForChildNodes); @@ -45600,6 +46603,34 @@ var ts; return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; + function getNamedImportCount(node) { + if (!(node.importClause && node.importClause.namedBindings)) + return 0; + var names = node.importClause.namedBindings; + if (!names) + return 0; + if (!ts.isNamedImports(names)) + return 0; + return names.elements.length; + } + function containsDefaultReference(node) { + if (!node) + return false; + if (!ts.isNamedImports(node)) + return false; + return ts.some(node.elements, isNamedDefaultReference); + } + function isNamedDefaultReference(e) { + return e.propertyName && e.propertyName.escapedText === "default"; + } + function getImportNeedsImportStarHelper(node) { + return !!ts.getNamespaceDeclarationNode(node) || (getNamedImportCount(node) > 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper; + function getImportNeedsImportDefaultHelper(node) { + return ts.isDefaultImport(node) || (getNamedImportCount(node) === 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; var exportSpecifiers = ts.createMultiMap(); @@ -45609,18 +46640,20 @@ var ts; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; + var hasImportStarOrImportDefault = false; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 239: + case 242: externalImports.push(node); + hasImportStarOrImportDefault = getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 238: - if (node.moduleReference.kind === 249) { + case 241: + if (node.moduleReference.kind === 252) { externalImports.push(node); } break; - case 245: + case 248: if (node.moduleSpecifier) { if (!node.exportClause) { externalImports.push(node); @@ -45647,12 +46680,12 @@ var ts; } } break; - case 244: + case 247: if (node.isExportEquals && !exportEquals) { exportEquals = node; } break; - case 209: + case 212: if (ts.hasModifier(node, 1)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -45660,7 +46693,7 @@ var ts; } } break; - case 229: + case 232: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -45678,7 +46711,7 @@ var ts; } } break; - case 230: + case 233: if (ts.hasModifier(node, 1)) { if (ts.hasModifier(node, 512)) { if (!hasExportDefault) { @@ -45698,9 +46731,10 @@ var ts; break; } } - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues); + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault); var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { + ts.addEmitFlags(externalHelpersImportDeclaration, 67108864); externalImports.unshift(externalHelpersImportDeclaration); } return { externalImports: externalImports, exportSpecifiers: exportSpecifiers, exportEquals: exportEquals, hasExportStarsToExportValues: hasExportStarsToExportValues, exportedBindings: exportedBindings, exportedNames: exportedNames, externalHelpersImportDeclaration: externalHelpersImportDeclaration }; @@ -45735,9 +46769,8 @@ var ts; return values; } function isSimpleCopiableExpression(expression) { - return expression.kind === 9 || + return ts.isStringLiteralLike(expression) || expression.kind === 8 || - expression.kind === 13 || ts.isKeyword(expression.kind) || ts.isIdentifier(expression); } @@ -45780,7 +46813,10 @@ var ts; }; if (value) { value = ts.visitNode(value, visitor, ts.isExpression); - if (needsValue) { + if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText)) { + value = ensureIdentifier(flattenContext, value, false, location); + } + else if (needsValue) { value = ensureIdentifier(flattenContext, value, true, location); } else if (ts.nodeIsSynthesized(node)) { @@ -45810,6 +46846,26 @@ var ts; } } ts.flattenDestructuringAssignment = flattenDestructuringAssignment; + function bindingOrAssignmentElementAssignsToName(element, escapedName) { + var target = ts.getTargetOfBindingOrAssignmentElement(element); + if (ts.isBindingOrAssignmentPattern(target)) { + return bindingOrAssignmentPatternAssignsToName(target, escapedName); + } + else if (ts.isIdentifier(target)) { + return target.escapedText === escapedName; + } + return false; + } + function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) { + var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; + if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { + return true; + } + } + return false; + } function flattenDestructuringBinding(node, visitor, context, level, rval, hoistTempVariables, skipInitializer) { var pendingExpressions; var pendingDeclarations = []; @@ -45826,6 +46882,13 @@ var ts; createArrayBindingOrAssignmentElement: makeBindingElement, visitor: visitor }; + if (ts.isVariableDeclaration(node)) { + var initializer = ts.getInitializerOfBindingOrAssignmentElement(node); + if (initializer && ts.isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText)) { + initializer = ensureIdentifier(flattenContext, initializer, false, initializer); + node = ts.updateVariableDeclaration(node, node.name, node.type, initializer); + } + } flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); if (pendingExpressions) { var temp = ts.createTempVariable(undefined); @@ -46103,8 +47166,8 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180); - context.enableSubstitution(181); + context.enableSubstitution(183); + context.enableSubstitution(184); var currentSourceFile; var currentNamespace; var currentNamespaceContainerName; @@ -46138,15 +47201,15 @@ var ts; } function onBeforeVisitNode(node) { switch (node.kind) { - case 269: - case 236: - case 235: - case 208: + case 272: + case 239: + case 238: + case 211: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 230: - case 229: + case 233: + case 232: if (ts.hasModifier(node, 2)) { break; } @@ -46154,7 +47217,7 @@ var ts; recordEmittedDeclarationInScope(node); } else { - ts.Debug.assert(node.kind === 230 || ts.hasModifier(node, 512)); + ts.Debug.assert(node.kind === 233 || ts.hasModifier(node, 512)); } break; } @@ -46176,10 +47239,10 @@ var ts; } function sourceElementVisitorWorker(node) { switch (node.kind) { - case 239: - case 238: - case 244: - case 245: + case 242: + case 241: + case 247: + case 248: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -46194,13 +47257,13 @@ var ts; return node; } switch (node.kind) { - case 239: + case 242: return visitImportDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); - case 244: + case 247: return visitExportAssignment(node); - case 245: + case 248: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -46210,11 +47273,11 @@ var ts; return saveStateAndInvoke(node, namespaceElementVisitorWorker); } function namespaceElementVisitorWorker(node) { - if (node.kind === 245 || - node.kind === 239 || - node.kind === 240 || - (node.kind === 238 && - node.moduleReference.kind === 249)) { + if (node.kind === 248 || + node.kind === 242 || + node.kind === 243 || + (node.kind === 241 && + node.moduleReference.kind === 252)) { return undefined; } else if (node.transformFlags & 1 || ts.hasModifier(node, 1)) { @@ -46230,15 +47293,15 @@ var ts; } function classElementVisitorWorker(node) { switch (node.kind) { - case 153: - return undefined; - case 150: - case 158: case 154: + return undefined; + case 151: + case 159: case 155: - case 152: + case 156: + case 153: return visitorWorker(node); - case 207: + case 210: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -46268,85 +47331,86 @@ var ts; case 117: case 76: case 124: - case 131: - case 165: + case 132: case 166: - case 164: - case 159: - case 146: + case 167: + case 165: + case 160: + case 147: case 119: case 122: - case 136: - case 133: - case 130: - case 105: case 137: - case 162: - case 161: + case 134: + case 131: + case 105: + case 138: case 163: - case 160: - case 167: + case 162: + case 164: + case 161: case 168: case 169: case 170: - case 171: case 172: case 173: case 174: - case 158: - case 148: - case 232: + case 175: + case 176: + case 177: + case 159: + case 149: + case 235: return undefined; - case 150: + case 151: return visitPropertyDeclaration(node); - case 237: + case 240: return undefined; - case 153: - return visitConstructor(node); - case 231: - return ts.createNotEmittedStatement(node); - case 230: - return visitClassDeclaration(node); - case 200: - return visitClassExpression(node); - case 263: - return visitHeritageClause(node); - case 202: - return visitExpressionWithTypeArguments(node); - case 152: - return visitMethodDeclaration(node); case 154: - return visitGetAccessor(node); - case 155: - return visitSetAccessor(node); - case 229: - return visitFunctionDeclaration(node); - case 187: - return visitFunctionExpression(node); - case 188: - return visitArrowFunction(node); - case 147: - return visitParameter(node); - case 186: - return visitParenthesizedExpression(node); - case 185: - case 203: - return visitAssertionExpression(node); - case 182: - return visitCallExpression(node); - case 183: - return visitNewExpression(node); - case 204: - return visitNonNullExpression(node); - case 233: - return visitEnumDeclaration(node); - case 209: - return visitVariableStatement(node); - case 227: - return visitVariableDeclaration(node); + return visitConstructor(node); case 234: + return ts.createNotEmittedStatement(node); + case 233: + return visitClassDeclaration(node); + case 203: + return visitClassExpression(node); + case 266: + return visitHeritageClause(node); + case 205: + return visitExpressionWithTypeArguments(node); + case 153: + return visitMethodDeclaration(node); + case 155: + return visitGetAccessor(node); + case 156: + return visitSetAccessor(node); + case 232: + return visitFunctionDeclaration(node); + case 190: + return visitFunctionExpression(node); + case 191: + return visitArrowFunction(node); + case 148: + return visitParameter(node); + case 189: + return visitParenthesizedExpression(node); + case 188: + case 206: + return visitAssertionExpression(node); + case 185: + return visitCallExpression(node); + case 186: + return visitNewExpression(node); + case 207: + return visitNonNullExpression(node); + case 236: + return visitEnumDeclaration(node); + case 212: + return visitVariableStatement(node); + case 230: + return visitVariableDeclaration(node); + case 237: return visitModuleDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); default: ts.Debug.failBadSyntaxKind(node); @@ -46496,10 +47560,13 @@ var ts; ts.setTextRange(classExpression, node); if (ts.some(staticProperties) || ts.some(pendingExpressions)) { var expressions = []; - var temp = ts.createTempVariable(hoistVariableDeclaration); - if (resolver.getNodeCheckFlags(node) & 8388608) { + var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 8388608; + var temp = ts.createTempVariable(hoistVariableDeclaration, !!isClassWithConstructorReference); + if (isClassWithConstructorReference) { enableSubstitutionForClassAliases(); - classAliases[ts.getOriginalNodeId(node)] = ts.getSynthesizedClone(temp); + var alias = ts.getSynthesizedClone(temp); + alias.autoGenerateFlags &= ~16; + classAliases[ts.getOriginalNodeId(node)] = alias; } ts.setEmitFlags(classExpression, 65536 | ts.getEmitFlags(classExpression)); expressions.push(ts.startOnNewLine(ts.createAssignment(temp, classExpression))); @@ -46564,7 +47631,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 211 && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -46598,7 +47665,7 @@ var ts; return isInitializedProperty(member, false); } function isInitializedProperty(member, isStatic) { - return member.kind === 150 + return member.kind === 151 && isStatic === ts.hasModifier(member, 32) && member.initializer !== undefined; } @@ -46673,12 +47740,12 @@ var ts; } function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 154: case 155: + case 156: return getAllDecoratorsOfAccessors(node, member); - case 152: + case 153: return getAllDecoratorsOfMethod(member); - case 150: + case 151: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -46757,7 +47824,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, true); var descriptor = languageVersion > 0 - ? member.kind === 150 + ? member.kind === 151 ? ts.createVoidZero() : ts.createNull() : undefined; @@ -46841,37 +47908,37 @@ var ts; } function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 152 - || kind === 154 + return kind === 153 || kind === 155 - || kind === 150; + || kind === 156 + || kind === 151; } function shouldAddReturnTypeMetadata(node) { - return node.kind === 152; + return node.kind === 153; } function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 230: - case 200: + case 233: + case 203: return ts.getFirstConstructorWithBody(node) !== undefined; - case 152: - case 154: + case 153: case 155: + case 156: return true; } return false; } function serializeTypeOfNode(node) { switch (node.kind) { - case 150: - case 147: - case 154: - return serializeTypeNode(node.type); + case 151: + case 148: case 155: + return serializeTypeNode(node.type); + case 156: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 230: - case 200: - case 152: + case 233: + case 203: + case 153: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -46903,7 +47970,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 154) { + if (container && node.kind === 155) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -46926,26 +47993,26 @@ var ts; } switch (node.kind) { case 105: - case 139: + case 140: case 95: - case 130: + case 131: return ts.createVoidZero(); - case 169: + case 172: return serializeTypeNode(node.type); - case 161: case 162: + case 163: return ts.createIdentifier("Function"); - case 165: case 166: + case 167: return ts.createIdentifier("Array"); - case 159: + case 160: case 122: return ts.createIdentifier("Boolean"); - case 136: + case 137: return ts.createIdentifier("String"); - case 134: + case 135: return ts.createIdentifier("Object"); - case 174: + case 177: switch (node.literal.kind) { case 9: return ts.createIdentifier("String"); @@ -46959,24 +48026,24 @@ var ts; break; } break; - case 133: + case 134: return ts.createIdentifier("Number"); - case 137: + case 138: return languageVersion < 2 ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 160: + case 161: return serializeTypeReferenceNode(node); + case 169: case 168: - case 167: return serializeUnionOrIntersectionType(node); - case 163: - case 171: - case 172: - case 173: case 164: + case 174: + case 175: + case 176: + case 165: case 119: - case 170: + case 173: break; default: ts.Debug.failBadSyntaxKind(node); @@ -46988,13 +48055,13 @@ var ts; var serializedUnion; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169) { + while (typeNode.kind === 172) { typeNode = typeNode.type; } - if (typeNode.kind === 130) { + if (typeNode.kind === 131) { continue; } - if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 139)) { + if (!strictNullChecks && (typeNode.kind === 95 || typeNode.kind === 140)) { continue; } var serializedIndividual = serializeTypeNode(typeNode); @@ -47056,7 +48123,7 @@ var ts; return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } return name; - case 144: + case 145: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -47366,11 +48433,11 @@ var ts; function addVarForEnumOrModuleDeclaration(statements, node) { var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, false, true)) - ], currentScope.kind === 269 ? 0 : 1)); + ], currentScope.kind === 272 ? 0 : 1)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { - if (node.kind === 233) { + if (node.kind === 236) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -47431,7 +48498,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 235) { + if (body.kind === 238) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -47455,13 +48522,13 @@ var ts; currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName; var block = ts.createBlock(ts.setTextRange(ts.createNodeArray(statements), statementsLocation), true); ts.setTextRange(block, blockLocation); - if (body.kind !== 235) { + if (body.kind !== 238) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 234) { + if (moduleDeclaration.body.kind === 237) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -47481,7 +48548,7 @@ var ts; return (name || namedBindings) ? ts.updateImportClause(node, name, namedBindings) : undefined; } function visitNamedImportBindings(node) { - if (node.kind === 241) { + if (node.kind === 244) { return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } else { @@ -47616,15 +48683,15 @@ var ts; if ((enabledSubstitutions & 2) === 0) { enabledSubstitutions |= 2; context.enableSubstitution(71); - context.enableSubstitution(266); - context.enableEmitNotification(234); + context.enableSubstitution(269); + context.enableEmitNotification(237); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 234; + return ts.getOriginalNode(node).kind === 237; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 233; + return ts.getOriginalNode(node).kind === 236; } function onEmitNode(hint, node, emitCallback) { var savedApplicableSubstitutions = applicableSubstitutions; @@ -47670,9 +48737,9 @@ var ts; switch (node.kind) { case 71: return substituteExpressionIdentifier(node); - case 180: + case 183: return substitutePropertyAccessExpression(node); - case 181: + case 184: return substituteElementAccessExpression(node); } return node; @@ -47702,9 +48769,9 @@ var ts; function trySubstituteNamespaceExportedName(node) { if (enabledSubstitutions & applicableSubstitutions && !ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var container = resolver.getReferencedExportContainer(node, false); - if (container && container.kind !== 269) { - var substitute = (applicableSubstitutions & 2 && container.kind === 234) || - (applicableSubstitutions & 8 && container.kind === 233); + if (container && container.kind !== 272) { + var substitute = (applicableSubstitutions & 2 && container.kind === 237) || + (applicableSubstitutions & 8 && container.kind === 236); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), node); } @@ -47737,9 +48804,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } ts.transformTypeScript = transformTypeScript; @@ -47796,12 +48861,13 @@ var ts; ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); var compilerOptions = context.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); var enabledSubstitutions; var enclosingSuperContainerFlags = 0; + var enclosingFunctionParameterNames; var previousOnEmitNode = context.onEmitNode; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; @@ -47822,20 +48888,96 @@ var ts; switch (node.kind) { case 120: return undefined; - case 192: + case 195: return visitAwaitExpression(node); - case 152: + case 153: return visitMethodDeclaration(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); - case 188: + case 191: return visitArrowFunction(node); default: return ts.visitEachChild(node, visitor, context); } } + function asyncBodyVisitor(node) { + if (ts.isNodeWithPossibleHoistedDeclaration(node)) { + switch (node.kind) { + case 212: + return visitVariableStatementInAsyncBody(node); + case 218: + return visitForStatementInAsyncBody(node); + case 219: + return visitForInStatementInAsyncBody(node); + case 220: + return visitForOfStatementInAsyncBody(node); + case 267: + return visitCatchClauseInAsyncBody(node); + case 211: + case 225: + case 239: + case 264: + case 265: + case 228: + case 216: + case 217: + case 215: + case 224: + case 226: + return ts.visitEachChild(node, asyncBodyVisitor, context); + default: + return ts.Debug.assertNever(node, "Unhandled node."); + } + } + return visitor(node); + } + function visitCatchClauseInAsyncBody(node) { + var catchClauseNames = ts.createUnderscoreEscapedMap(); + recordDeclarationName(node.variableDeclaration, catchClauseNames); + var catchClauseUnshadowedNames; + catchClauseNames.forEach(function (_, escapedName) { + if (enclosingFunctionParameterNames.has(escapedName)) { + if (!catchClauseUnshadowedNames) { + catchClauseUnshadowedNames = ts.cloneMap(enclosingFunctionParameterNames); + } + catchClauseUnshadowedNames.delete(escapedName); + } + }); + if (catchClauseUnshadowedNames) { + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = catchClauseUnshadowedNames; + var result = ts.visitEachChild(node, asyncBodyVisitor, context); + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; + } + else { + return ts.visitEachChild(node, asyncBodyVisitor, context); + } + } + function visitVariableStatementInAsyncBody(node) { + if (isVariableDeclarationListWithCollidingName(node.declarationList)) { + var expression = visitVariableDeclarationListWithCollidingNames(node.declarationList, false); + return expression ? ts.createStatement(expression) : undefined; + } + return ts.visitEachChild(node, visitor, context); + } + function visitForInStatementInAsyncBody(node) { + return ts.updateForIn(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForOfStatementInAsyncBody(node) { + return ts.updateForOf(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForStatementInAsyncBody(node) { + return ts.updateFor(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, false) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } function visitAwaitExpression(node) { return ts.setOriginalNode(ts.setTextRange(ts.createYield(undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node); } @@ -47859,17 +49001,91 @@ var ts; ? transformAsyncFunctionBody(node) : ts.visitFunctionBody(node.body, visitor, context)); } + function recordDeclarationName(_a, names) { + var name = _a.name; + if (ts.isIdentifier(name)) { + names.set(name.escapedText, true); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + recordDeclarationName(element, names); + } + } + } + } + function isVariableDeclarationListWithCollidingName(node) { + return node + && ts.isVariableDeclarationList(node) + && !(node.flags & 3) + && ts.forEach(node.declarations, collidesWithParameterName); + } + function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { + hoistVariableDeclarationList(node); + var variables = ts.getInitializedVariables(node); + if (variables.length === 0) { + if (hasReceiver) { + return ts.visitNode(ts.convertToAssignmentElementTarget(node.declarations[0].name), visitor, ts.isExpression); + } + return undefined; + } + return ts.inlineExpressions(ts.map(variables, transformInitializedVariable)); + } + function hoistVariableDeclarationList(node) { + ts.forEach(node.declarations, hoistVariable); + } + function hoistVariable(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + hoistVariableDeclaration(name); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + hoistVariable(element); + } + } + } + } + function transformInitializedVariable(node) { + var converted = ts.setSourceMapRange(ts.createAssignment(ts.convertToAssignmentElementTarget(node.name), node.initializer), node); + return ts.visitNode(converted, visitor, ts.isExpression); + } + function collidesWithParameterName(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + return enclosingFunctionParameterNames.has(name.escapedText); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element) && collidesWithParameterName(element)) { + return true; + } + } + } + return false; + } function transformAsyncFunctionBody(node) { resumeLexicalEnvironment(); var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 188; + var isArrowFunction = node.kind === 191; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192) !== 0; + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap(); + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + recordDeclarationName(parameter, enclosingFunctionParameterNames); + } + var result; if (!isArrowFunction) { var statements = []; var statementOffset = ts.addPrologue(statements, node.body.statements, false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset)))); ts.addRange(statements, endLexicalEnvironment()); var block = ts.createBlock(statements, true); ts.setTextRange(block, node.body); @@ -47883,27 +49099,28 @@ var ts; ts.addEmitHelper(block, ts.asyncSuperHelper); } } - return block; + result = block; } else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body)); var declarations = endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + result = ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + else { + result = expression; } - return expression; } + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; } - function transformFunctionBodyWorker(body, start) { + function transformAsyncFunctionBodyWorker(body, start) { if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + return ts.updateBlock(body, ts.visitNodes(body.statements, asyncBodyVisitor, ts.isStatement, start)); } else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + return ts.convertToFunctionBody(ts.visitNode(body, asyncBodyVisitor, ts.isConciseBody)); } } function getPromiseConstructor(type) { @@ -47920,14 +49137,14 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(182); - context.enableSubstitution(180); - context.enableSubstitution(181); - context.enableEmitNotification(230); - context.enableEmitNotification(152); - context.enableEmitNotification(154); - context.enableEmitNotification(155); + context.enableSubstitution(185); + context.enableSubstitution(183); + context.enableSubstitution(184); + context.enableEmitNotification(233); context.enableEmitNotification(153); + context.enableEmitNotification(155); + context.enableEmitNotification(156); + context.enableEmitNotification(154); } } function onEmitNode(hint, node, emitCallback) { @@ -47952,11 +49169,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180: + case 183: return substitutePropertyAccessExpression(node); - case 181: + case 184: return substituteElementAccessExpression(node); - case 182: + case 185: return substituteCallExpression(node); } return node; @@ -47987,11 +49204,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 - || kind === 153 - || kind === 152 + return kind === 233 || kind === 154 - || kind === 155; + || kind === 153 + || kind === 155 + || kind === 156; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -48075,45 +49292,45 @@ var ts; return node; } switch (node.kind) { - case 192: - return visitAwaitExpression(node); - case 198: - return visitYieldExpression(node); - case 223: - return visitLabeledStatement(node); - case 179: - return visitObjectLiteralExpression(node); case 195: + return visitAwaitExpression(node); + case 201: + return visitYieldExpression(node); + case 226: + return visitLabeledStatement(node); + case 182: + return visitObjectLiteralExpression(node); + case 198: return visitBinaryExpression(node, noDestructuringValue); - case 227: + case 230: return visitVariableDeclaration(node); - case 217: + case 220: return visitForOfStatement(node, undefined); - case 215: + case 218: return visitForStatement(node); - case 191: + case 194: return visitVoidExpression(node); - case 153: - return visitConstructorDeclaration(node); - case 152: - return visitMethodDeclaration(node); case 154: - return visitGetAccessorDeclaration(node); + return visitConstructorDeclaration(node); + case 153: + return visitMethodDeclaration(node); case 155: + return visitGetAccessorDeclaration(node); + case 156: return visitSetAccessorDeclaration(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); - case 188: + case 191: return visitArrowFunction(node); - case 147: + case 148: return visitParameter(node); - case 211: + case 214: return visitExpressionStatement(node); - case 186: + case 189: return visitParenthesizedExpression(node, noDestructuringValue); - case 264: + case 267: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -48133,21 +49350,21 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitLabeledStatement(node) { - if (enclosingFunctionFlags & 2 && enclosingFunctionFlags & 1) { + if (enclosingFunctionFlags & 2) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 217 && statement.awaitModifier) { + if (statement.kind === 220 && statement.awaitModifier) { return visitForOfStatement(statement, node); } - return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); } return ts.visitEachChild(node, visitor, context); } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 267) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 270) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -48156,16 +49373,9 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === 265) { - var p = e; - chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); - } - else { - chunkObject.push(ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); - } + chunkObject = ts.append(chunkObject, e.kind === 268 + ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) + : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } } if (chunkObject) { @@ -48176,7 +49386,7 @@ var ts; function visitObjectLiteralExpression(node) { if (node.transformFlags & 1048576) { var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 179) { + if (objects.length && objects[0].kind !== 182) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -48427,14 +49637,14 @@ var ts; function enableSubstitutionForAsyncMethodsWithSuper() { if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; - context.enableSubstitution(182); - context.enableSubstitution(180); - context.enableSubstitution(181); - context.enableEmitNotification(230); - context.enableEmitNotification(152); - context.enableEmitNotification(154); - context.enableEmitNotification(155); + context.enableSubstitution(185); + context.enableSubstitution(183); + context.enableSubstitution(184); + context.enableEmitNotification(233); context.enableEmitNotification(153); + context.enableEmitNotification(155); + context.enableEmitNotification(156); + context.enableEmitNotification(154); } } function onEmitNode(hint, node, emitCallback) { @@ -48459,11 +49669,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180: + case 183: return substitutePropertyAccessExpression(node); - case 181: + case 184: return substituteElementAccessExpression(node); - case 182: + case 185: return substituteCallExpression(node); } return node; @@ -48494,11 +49704,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 - || kind === 153 - || kind === 152 + return kind === 233 || kind === 154 - || kind === 155; + || kind === 153 + || kind === 155 + || kind === 156; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096) { @@ -48561,7 +49771,7 @@ var ts; var asyncValues = { name: "typescript:asyncValues", scoped: false, - text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + text: "\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " }; function createAsyncValuesHelper(context, expression, location) { context.requestEmitHelper(asyncValues); @@ -48593,13 +49803,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 250: + case 253: return visitJsxElement(node, false); - case 251: - return visitJsxSelfClosingElement(node, false); case 254: + return visitJsxSelfClosingElement(node, false); + case 257: return visitJsxFragment(node, false); - case 260: + case 263: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -48609,13 +49819,13 @@ var ts; switch (node.kind) { case 10: return visitJsxText(node); - case 260: + case 263: return visitJsxExpression(node); - case 250: + case 253: return visitJsxElement(node, true); - case 251: - return visitJsxSelfClosingElement(node, true); case 254: + return visitJsxSelfClosingElement(node, true); + case 257: return visitJsxFragment(node, true); default: ts.Debug.failBadSyntaxKind(node); @@ -48680,7 +49890,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 260) { + else if (node.kind === 263) { if (node.expression === undefined) { return ts.createTrue(); } @@ -48740,7 +49950,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 250) { + if (node.kind === 253) { return getTagName(node.openingElement); } else { @@ -49040,7 +50250,7 @@ var ts; return node; } switch (node.kind) { - case 195: + case 198: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -49199,13 +50409,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return hierarchyFacts & 4096 - && node.kind === 220 + && node.kind === 223 && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 208))) + || (hierarchyFacts & 4096 && (ts.isStatement(node) || (node.kind === 211))) || (ts.isIterationStatement(node, false) && shouldConvertIterationStatementBody(node)) || (ts.getEmitFlags(node) & 33554432) !== 0; } @@ -49233,63 +50443,63 @@ var ts; switch (node.kind) { case 115: return undefined; - case 230: + case 233: return visitClassDeclaration(node); - case 200: + case 203: return visitClassExpression(node); - case 147: + case 148: return visitParameter(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 188: + case 191: return visitArrowFunction(node); - case 187: + case 190: return visitFunctionExpression(node); - case 227: + case 230: return visitVariableDeclaration(node); case 71: return visitIdentifier(node); - case 228: + case 231: return visitVariableDeclarationList(node); - case 222: + case 225: return visitSwitchStatement(node); - case 236: + case 239: return visitCaseBlock(node); - case 208: - return visitBlock(node, false); - case 219: - case 218: - return visitBreakOrContinueStatement(node); - case 223: - return visitLabeledStatement(node); - case 213: - case 214: - return visitDoOrWhileStatement(node, undefined); - case 215: - return visitForStatement(node, undefined); - case 216: - return visitForInStatement(node, undefined); - case 217: - return visitForOfStatement(node, undefined); case 211: + return visitBlock(node, false); + case 222: + case 221: + return visitBreakOrContinueStatement(node); + case 226: + return visitLabeledStatement(node); + case 216: + case 217: + return visitDoOrWhileStatement(node, undefined); + case 218: + return visitForStatement(node, undefined); + case 219: + return visitForInStatement(node, undefined); + case 220: + return visitForOfStatement(node, undefined); + case 214: return visitExpressionStatement(node); - case 179: - return visitObjectLiteralExpression(node); - case 264: - return visitCatchClause(node); - case 266: - return visitShorthandPropertyAssignment(node); - case 145: - return visitComputedPropertyName(node); - case 178: - return visitArrayLiteralExpression(node); case 182: + return visitObjectLiteralExpression(node); + case 267: + return visitCatchClause(node); + case 269: + return visitShorthandPropertyAssignment(node); + case 146: + return visitComputedPropertyName(node); + case 181: + return visitArrayLiteralExpression(node); + case 185: return visitCallExpression(node); - case 183: - return visitNewExpression(node); case 186: + return visitNewExpression(node); + case 189: return visitParenthesizedExpression(node, true); - case 195: + case 198: return visitBinaryExpression(node, true); case 13: case 14: @@ -49300,28 +50510,28 @@ var ts; return visitStringLiteral(node); case 8: return visitNumericLiteral(node); - case 184: + case 187: return visitTaggedTemplateExpression(node); - case 197: + case 200: return visitTemplateExpression(node); - case 198: + case 201: return visitYieldExpression(node); - case 199: + case 202: return visitSpreadElement(node); case 97: return visitSuperKeyword(false); case 99: return visitThisKeyword(node); - case 205: + case 208: return visitMetaProperty(node); - case 152: + case 153: return visitMethodDeclaration(node); - case 154: case 155: + case 156: return visitAccessorDeclaration(node); - case 209: + case 212: return visitVariableStatement(node); - case 220: + case 223: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -49402,13 +50612,13 @@ var ts; } function visitBreakOrContinueStatement(node) { if (convertedLoopState) { - var jump = node.kind === 219 ? 2 : 4; + var jump = node.kind === 222 ? 2 : 4; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 219) { + if (node.kind === 222) { convertedLoopState.nonLocalJumps |= 2; labelMarker = "break"; } @@ -49418,7 +50628,7 @@ var ts; } } else { - if (node.kind === 219) { + if (node.kind === 222) { labelMarker = "break-" + node.label.escapedText; setLabeledJump(convertedLoopState, true, ts.idText(node.label), labelMarker); } @@ -49514,7 +50724,7 @@ var ts; } function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), extendsClauseElement)); + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getInternalName(node))), extendsClauseElement)); } } function addConstructor(statements, node, extendsClauseElement) { @@ -49582,17 +50792,17 @@ var ts; return block; } function isSufficientlyCoveredByReturnStatements(statement) { - if (statement.kind === 220) { + if (statement.kind === 223) { return true; } - else if (statement.kind === 212) { + else if (statement.kind === 215) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 208) { + else if (statement.kind === 211) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -49621,7 +50831,7 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 211 && ts.isSuperCall(firstStatement.expression)) { + if (firstStatement.kind === 214 && ts.isSuperCall(firstStatement.expression)) { superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } @@ -49629,8 +50839,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 | 32768))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 195 - || superCallExpression.left.kind !== 182) { + if (superCallExpression.kind !== 198 + || superCallExpression.left.kind !== 185) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } ts.setCommentRange(returnStatement, ts.getCommentRange(ts.setEmitFlags(superCallExpression.left, 1536))); @@ -49731,7 +50941,7 @@ var ts; statements.push(forStatement); } function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 && node.kind !== 188) { + if (node.transformFlags & 32768 && node.kind !== 191) { captureThisForNode(statements, node, ts.createThis()); } } @@ -49749,18 +50959,18 @@ var ts; if (hierarchyFacts & 16384) { var newTarget = void 0; switch (node.kind) { - case 188: + case 191: return statements; - case 152: - case 154: + case 153: case 155: + case 156: newTarget = ts.createVoidZero(); break; - case 153: + case 154: newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"); break; - case 229: - case 187: + case 232: + case 190: newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4), 93, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4), "constructor"), ts.createVoidZero()); break; default: @@ -49781,20 +50991,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 207: + case 210: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 152: + case 153: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 154: case 155: + case 156: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 153: + case 154: break; default: ts.Debug.failBadSyntaxKind(node); @@ -49919,7 +51129,7 @@ var ts; : enterSubtree(16286, 65); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 && !name && (node.kind === 229 || node.kind === 187)) { + if (hierarchyFacts & 16384 && !name && (node.kind === 232 || node.kind === 190)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152, 0); @@ -49953,7 +51163,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 188); + ts.Debug.assert(node.kind === 191); statementsLocation = ts.moveRangeEnd(body, -1); var equalsGreaterThanToken = node.equalsGreaterThanToken; if (!ts.nodeIsSynthesized(equalsGreaterThanToken) && !ts.nodeIsSynthesized(body)) { @@ -50005,9 +51215,9 @@ var ts; } function visitExpressionStatement(node) { switch (node.expression.kind) { - case 186: + case 189: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, false)); - case 195: + case 198: return ts.updateStatement(node, visitBinaryExpression(node.expression, false)); } return ts.visitEachChild(node, visitor, context); @@ -50015,9 +51225,9 @@ var ts; function visitParenthesizedExpression(node, needsDestructuringValue) { if (!needsDestructuringValue) { switch (node.expression.kind) { - case 186: + case 189: return ts.updateParen(node, visitParenthesizedExpression(node.expression, false)); - case 195: + case 198: return ts.updateParen(node, visitBinaryExpression(node.expression, false)); } } @@ -50143,14 +51353,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 213: - case 214: - return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 215: - return visitForStatement(node, outermostLabeledStatement); case 216: - return visitForInStatement(node, outermostLabeledStatement); case 217: + return visitDoOrWhileStatement(node, outermostLabeledStatement); + case 218: + return visitForStatement(node, outermostLabeledStatement); + case 219: + return visitForInStatement(node, outermostLabeledStatement); + case 220: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -50276,7 +51486,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 145) { + if (property.name.kind === 146) { numInitialProperties = i; break; } @@ -50338,11 +51548,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 215: - case 216: - case 217: + case 218: + case 219: + case 220: var initializer = node.initializer; - if (initializer && initializer.kind === 228) { + if (initializer && initializer.kind === 231) { loopInitializer = initializer; } break; @@ -50568,20 +51778,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 154: case 155: + case 156: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 152: + case 153: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 265: + case 268: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 266: + case 269: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -50655,7 +51865,7 @@ var ts; if (node.transformFlags & 32768) { var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 154) { + if (node.kind === 155) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -50735,26 +51945,31 @@ var ts; return visitCallExpressionWithPotentialCapturedThisAssignment(node, false); } function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { - var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - if (node.expression.kind === 97) { - ts.setEmitFlags(thisArg, 4); + if (node.transformFlags & 524288 || + node.expression.kind === 97 || + ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) { + var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + if (node.expression.kind === 97) { + ts.setEmitFlags(thisArg, 4); + } + var resultingCall = void 0; + if (node.transformFlags & 524288) { + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); + } + else { + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); + } + if (node.expression.kind === 97) { + var actualThis = ts.createThis(); + ts.setEmitFlags(actualThis, 4); + var initializer = ts.createLogicalOr(resultingCall, actualThis); + resultingCall = assignToCapturedThis + ? ts.createAssignment(ts.createIdentifier("_this"), initializer) + : initializer; + } + return ts.setOriginalNode(resultingCall, node); } - var resultingCall; - if (node.transformFlags & 524288) { - resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, false, false, false)); - } - else { - resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), node); - } - if (node.expression.kind === 97) { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4); - var initializer = ts.createLogicalOr(resultingCall, actualThis); - resultingCall = assignToCapturedThis - ? ts.createAssignment(ts.createIdentifier("_this"), initializer) - : initializer; - } - return ts.setOriginalNode(resultingCall, node); + return ts.visitEachChild(node, visitor, context); } function visitNewExpression(node) { if (node.transformFlags & 524288) { @@ -50783,7 +51998,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 178 + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 181 ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -50929,13 +52144,13 @@ var ts; if ((enabledSubstitutions & 1) === 0) { enabledSubstitutions |= 1; context.enableSubstitution(99); - context.enableEmitNotification(153); - context.enableEmitNotification(152); context.enableEmitNotification(154); + context.enableEmitNotification(153); context.enableEmitNotification(155); - context.enableEmitNotification(188); - context.enableEmitNotification(187); - context.enableEmitNotification(229); + context.enableEmitNotification(156); + context.enableEmitNotification(191); + context.enableEmitNotification(190); + context.enableEmitNotification(232); } } function onSubstituteNode(hint, node) { @@ -50960,10 +52175,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 177: - case 230: + case 180: case 233: - case 227: + case 236: + case 230: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -51024,11 +52239,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 211) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 214) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 182) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 185) { return false; } var callTarget = statementExpression.expression; @@ -51036,7 +52251,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 199) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 202) { return false; } var expression = callArgument.expression; @@ -51188,13 +52403,13 @@ var ts; } function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 213: + case 216: return visitDoStatement(node); - case 214: + case 217: return visitWhileStatement(node); - case 222: + case 225: return visitSwitchStatement(node); - case 223: + case 226: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -51202,24 +52417,24 @@ var ts; } function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); - case 154: case 155: + case 156: return visitAccessorDeclaration(node); - case 209: + case 212: return visitVariableStatement(node); - case 215: - return visitForStatement(node); - case 216: - return visitForInStatement(node); - case 219: - return visitBreakStatement(node); case 218: + return visitForStatement(node); + case 219: + return visitForInStatement(node); + case 222: + return visitBreakStatement(node); + case 221: return visitContinueStatement(node); - case 220: + case 223: return visitReturnStatement(node); default: if (node.transformFlags & 16777216) { @@ -51235,21 +52450,21 @@ var ts; } function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 195: - return visitBinaryExpression(node); - case 196: - return visitConditionalExpression(node); case 198: + return visitBinaryExpression(node); + case 199: + return visitConditionalExpression(node); + case 201: return visitYieldExpression(node); - case 178: - return visitArrayLiteralExpression(node); - case 179: - return visitObjectLiteralExpression(node); case 181: - return visitElementAccessExpression(node); + return visitArrayLiteralExpression(node); case 182: + return visitObjectLiteralExpression(node); + case 184: + return visitElementAccessExpression(node); + case 185: return visitCallExpression(node); - case 183: + case 186: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -51257,9 +52472,9 @@ var ts; } function visitGenerator(node) { switch (node.kind) { - case 229: + case 232: return visitFunctionDeclaration(node); - case 187: + case 190: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -51416,10 +52631,10 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 180: + case 183: target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 181: + case 184: target = ts.updateElementAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))); break; default: @@ -51620,35 +52835,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 208: - return transformAndEmitBlock(node); case 211: - return transformAndEmitExpressionStatement(node); - case 212: - return transformAndEmitIfStatement(node); - case 213: - return transformAndEmitDoStatement(node); + return transformAndEmitBlock(node); case 214: - return transformAndEmitWhileStatement(node); + return transformAndEmitExpressionStatement(node); case 215: - return transformAndEmitForStatement(node); + return transformAndEmitIfStatement(node); case 216: - return transformAndEmitForInStatement(node); + return transformAndEmitDoStatement(node); + case 217: + return transformAndEmitWhileStatement(node); case 218: - return transformAndEmitContinueStatement(node); + return transformAndEmitForStatement(node); case 219: - return transformAndEmitBreakStatement(node); - case 220: - return transformAndEmitReturnStatement(node); + return transformAndEmitForInStatement(node); case 221: - return transformAndEmitWithStatement(node); + return transformAndEmitContinueStatement(node); case 222: - return transformAndEmitSwitchStatement(node); + return transformAndEmitBreakStatement(node); case 223: - return transformAndEmitLabeledStatement(node); + return transformAndEmitReturnStatement(node); case 224: - return transformAndEmitThrowStatement(node); + return transformAndEmitWithStatement(node); case 225: + return transformAndEmitSwitchStatement(node); + case 226: + return transformAndEmitLabeledStatement(node); + case 227: + return transformAndEmitThrowStatement(node); + case 228: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -51942,7 +53157,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 262 && defaultClauseIndex === -1) { + if (clause.kind === 265 && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -51952,13 +53167,12 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 261) { - var caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (clause.kind === 264) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } - pendingClauses.push(ts.createCaseClause(ts.visitNode(caseClause.expression, visitor, ts.isExpression), [ - createInlineBreak(clauseLabels[i], caseClause.expression) + pendingClauses.push(ts.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [ + createInlineBreak(clauseLabels[i], clause.expression) ])); } else { @@ -52756,24 +53970,24 @@ var ts; if (compilerOptions.jsx === 1 || compilerOptions.jsx === 3) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(252); - context.enableEmitNotification(253); - context.enableEmitNotification(251); + context.enableEmitNotification(255); + context.enableEmitNotification(256); + context.enableEmitNotification(254); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180); - context.enableSubstitution(265); + context.enableSubstitution(183); + context.enableSubstitution(268); return transformSourceFile; function transformSourceFile(node) { return node; } function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 252: - case 253: - case 251: + case 255: + case 256: + case 254: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -52838,11 +54052,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71); - context.enableSubstitution(195); - context.enableSubstitution(193); - context.enableSubstitution(194); - context.enableSubstitution(266); - context.enableEmitNotification(269); + context.enableSubstitution(198); + context.enableSubstitution(196); + context.enableSubstitution(197); + context.enableSubstitution(269); + context.enableEmitNotification(272); var moduleInfoMap = []; var deferredExports = []; var currentSourceFile; @@ -52893,7 +54107,7 @@ var ts; var define = ts.createIdentifier("define"); var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions); var _a = collectAsynchronousDependencies(node, true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(define, undefined, (moduleName ? [moduleName] : []).concat([ ts.createArrayLiteral([ ts.createLiteral("require"), @@ -52905,6 +54119,8 @@ var ts; ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) ]))) ]), node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } function transformUMDModule(node) { var _a = collectAsynchronousDependencies(node, false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames; @@ -52928,7 +54144,7 @@ var ts; ]))) ]))) ], true), undefined)); - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(umdHeader, undefined, [ ts.createFunctionExpression(undefined, undefined, undefined, undefined, [ ts.createParameter(undefined, undefined, undefined, "require"), @@ -52936,6 +54152,8 @@ var ts; ].concat(importAliasNames), undefined, transformAsynchronousModuleBody(node)) ])) ]), node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } function collectAsynchronousDependencies(node, includeNonAmdDependencies) { var aliasedModuleNames = []; @@ -52968,6 +54186,17 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } + function getAMDImportExpressionForImport(node) { + if (ts.isImportEqualsDeclaration(node) || ts.isExportDeclaration(node) || !ts.getExternalModuleNameLiteral(node, currentSourceFile, host, resolver, compilerOptions)) { + return undefined; + } + var name = ts.getLocalNameForExternalImport(node, currentSourceFile); + var expr = getHelperExpressionForImport(node, name); + if (expr === name) { + return undefined; + } + return ts.createStatement(ts.createAssignment(name, expr)); + } function transformAsynchronousModuleBody(node) { startLexicalEnvironment(); var statements = []; @@ -52976,6 +54205,9 @@ var ts; ts.append(statements, createUnderscoreUnderscoreESModule()); } ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + if (moduleKind === ts.ModuleKind.AMD) { + ts.addRange(statements, ts.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); + } ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); addExportEqualsIfNeeded(statements, true); ts.addRange(statements, endLexicalEnvironment()); @@ -53009,23 +54241,23 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 239: + case 242: return visitImportDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); - case 245: + case 248: return visitExportDeclaration(node); - case 244: + case 247: return visitExportAssignment(node); - case 209: + case 212: return visitVariableStatement(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 230: + case 233: return visitClassDeclaration(node); - case 294: + case 297: return visitMergeDeclarationMarker(node); - case 295: + case 298: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, importCallExpressionVisitor, context); @@ -53086,11 +54318,20 @@ var ts; ts.setEmitFlags(func, 8); } } - return ts.createNew(ts.createIdentifier("Promise"), undefined, [func]); + var promise = ts.createNew(ts.createIdentifier("Promise"), undefined, [func]); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.createPropertyAccess(promise, ts.createIdentifier("then")), undefined, [ts.getHelperName("__importStar")]); + } + return promise; } function createImportCallExpressionCommonJS(arg, containsLexicalThis) { var promiseResolveCall = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Promise"), "resolve"), undefined, []); var requireCall = ts.createCall(ts.createIdentifier("require"), undefined, arg ? [arg] : []); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + requireCall = ts.createCall(ts.getHelperName("__importStar"), undefined, [requireCall]); + } var func; if (languageVersion >= 2) { func = ts.createArrowFunction(undefined, undefined, [], undefined, undefined, requireCall); @@ -53103,6 +54344,20 @@ var ts; } return ts.createCall(ts.createPropertyAccess(promiseResolveCall, "then"), undefined, [func]); } + function getHelperExpressionForImport(node, innerExpr) { + if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864) { + return innerExpr; + } + if (ts.getImportNeedsImportStarHelper(node)) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.getHelperName("__importStar"), undefined, [innerExpr]); + } + if (ts.getImportNeedsImportDefaultHelper(node)) { + context.requestEmitHelper(importDefaultHelper); + return ts.createCall(ts.getHelperName("__importDefault"), undefined, [innerExpr]); + } + return innerExpr; + } function visitImportDeclaration(node) { var statements; var namespaceDeclaration = ts.getNamespaceDeclarationNode(node); @@ -53113,10 +54368,10 @@ var ts; else { var variables = []; if (namespaceDeclaration && !ts.isDefaultImport(node)) { - variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, createRequireCall(node))); + variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, getHelperExpressionForImport(node, createRequireCall(node)))); } else { - variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, createRequireCall(node))); + variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), undefined, getHelperExpressionForImport(node, createRequireCall(node)))); if (namespaceDeclaration && ts.isDefaultImport(node)) { variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), undefined, ts.getGeneratedNameForNode(node))); } @@ -53291,7 +54546,7 @@ var ts; } } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -53323,10 +54578,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241: + case 244: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242: + case 245: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -53434,7 +54689,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269) { + if (node.kind === 272) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -53476,10 +54731,10 @@ var ts; switch (node.kind) { case 71: return substituteExpressionIdentifier(node); - case 195: + case 198: return substituteBinaryExpression(node); - case 194: - case 193: + case 197: + case 196: return substituteUnaryExpression(node); } return node; @@ -53494,7 +54749,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 269) { + if (exportContainer && exportContainer.kind === 272) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), node); } var importDeclaration = resolver.getReferencedImportDeclaration(node); @@ -53537,7 +54792,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 + var expression = node.kind === 197 ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 ? 59 : 60), ts.createLiteral(1)), node) : node; for (var _i = 0, exportedNames_2 = exportedNames; _i < exportedNames_2.length; _i++) { @@ -53578,6 +54833,16 @@ var ts; scoped: true, text: "\n var __syncRequire = typeof module === \"object\" && typeof module.exports === \"object\";" }; + var importStarHelper = { + name: "typescript:commonjsimportstar", + scoped: false, + text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n}" + }; + var importDefaultHelper = { + name: "typescript:commonjsimportdefault", + scoped: false, + text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n}" + }; })(ts || (ts = {})); var ts; (function (ts) { @@ -53591,10 +54856,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71); - context.enableSubstitution(195); - context.enableSubstitution(193); - context.enableSubstitution(194); - context.enableEmitNotification(269); + context.enableSubstitution(269); + context.enableSubstitution(198); + context.enableSubstitution(196); + context.enableSubstitution(197); + context.enableEmitNotification(272); var moduleInfoMap = []; var deferredExports = []; var exportFunctionsMap = []; @@ -53698,7 +54964,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 245 && externalImport.exportClause) { + if (externalImport.kind === 248 && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -53721,14 +54987,13 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 245) { + if (externalImport.kind !== 248) { continue; } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { continue; } - for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { + for (var _f = 0, _g = externalImport.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(ts.idText(element.name || element.propertyName)), ts.createTrue())); } @@ -53765,23 +55030,23 @@ var ts; function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { - var group = dependencyGroups_1[_i]; - var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); + var group_1 = dependencyGroups_1[_i]; + var localName = ts.forEach(group_1.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName(""); var statements = []; - for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) { + for (var _a = 0, _b = group_1.externalImports; _a < _b.length; _a++) { var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 239: + case 242: if (!entry.importClause) { break; } - case 238: + case 241: ts.Debug.assert(importVariableName !== undefined); statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 245: + case 248: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { var properties = []; @@ -53803,13 +55068,13 @@ var ts; } function sourceElementVisitor(node) { switch (node.kind) { - case 239: + case 242: return visitImportDeclaration(node); - case 238: + case 241: return visitImportEqualsDeclaration(node); - case 245: + case 248: return undefined; - case 244: + case 247: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -53930,7 +55195,7 @@ var ts; } function shouldHoistVariableDeclarationList(node) { return (ts.getEmitFlags(node) & 2097152) === 0 - && (enclosingBlockScopedContainer.kind === 269 + && (enclosingBlockScopedContainer.kind === 272 || (ts.getOriginalNode(node).flags & 3) === 0); } function transformInitializedVariable(node, isExportedDeclaration) { @@ -53952,7 +55217,7 @@ var ts; : preventSubstitution(ts.setTextRange(ts.createAssignment(name, value), location)); } function visitMergeDeclarationMarker(node) { - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -53985,10 +55250,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241: + case 244: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242: + case 245: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -54088,43 +55353,43 @@ var ts; } function nestedElementVisitor(node) { switch (node.kind) { - case 209: + case 212: return visitVariableStatement(node); - case 229: + case 232: return visitFunctionDeclaration(node); - case 230: + case 233: return visitClassDeclaration(node); - case 215: + case 218: return visitForStatement(node); - case 216: + case 219: return visitForInStatement(node); - case 217: + case 220: return visitForOfStatement(node); - case 213: + case 216: return visitDoStatement(node); - case 214: + case 217: return visitWhileStatement(node); - case 223: + case 226: return visitLabeledStatement(node); - case 221: + case 224: return visitWithStatement(node); - case 222: - return visitSwitchStatement(node); - case 236: - return visitCaseBlock(node); - case 261: - return visitCaseClause(node); - case 262: - return visitDefaultClause(node); case 225: - return visitTryStatement(node); + return visitSwitchStatement(node); + case 239: + return visitCaseBlock(node); case 264: + return visitCaseClause(node); + case 265: + return visitDefaultClause(node); + case 228: + return visitTryStatement(node); + case 267: return visitCatchClause(node); - case 208: + case 211: return visitBlock(node); - case 294: + case 297: return visitMergeDeclarationMarker(node); - case 295: + case 298: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -54221,7 +55486,7 @@ var ts; } function destructuringAndImportCallVisitor(node) { if (node.transformFlags & 1024 - && node.kind === 195) { + && node.kind === 198) { return visitDestructuringAssignment(node); } else if (ts.isImportCall(node)) { @@ -54264,7 +55529,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 269; + return container !== undefined && container.kind === 272; } else { return false; @@ -54279,7 +55544,7 @@ var ts; return node; } function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269) { + if (node.kind === 272) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -54306,16 +55571,41 @@ var ts; if (hint === 1) { return substituteExpression(node); } + else if (hint === 4) { + return substituteUnspecified(node); + } + return node; + } + function substituteUnspecified(node) { + switch (node.kind) { + case 269: + return substituteShorthandPropertyAssignment(node); + } + return node; + } + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + if (!ts.isGeneratedIdentifier(name) && !ts.isLocalName(name)) { + var importDeclaration = resolver.getReferencedImportDeclaration(name); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"))), node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name))), node); + } + } + } return node; } function substituteExpression(node) { switch (node.kind) { case 71: return substituteExpressionIdentifier(node); - case 195: + case 198: return substituteBinaryExpression(node); - case 193: - case 194: + case 196: + case 197: return substituteUnaryExpression(node); } return node; @@ -54367,14 +55657,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 + var expression = node.kind === 197 ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 194) { + if (node.kind === 197) { expression = node.operator === 43 ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -54391,7 +55681,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, false); - if (exportContainer && exportContainer.kind === 269) { + if (exportContainer && exportContainer.kind === 272) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -54419,7 +55709,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(269); + context.enableEmitNotification(272); context.enableSubstitution(71); var currentSourceFile; return transformSourceFile; @@ -54432,7 +55722,9 @@ var ts; if (externalHelpersModuleName) { var statements = []; var statementOffset = ts.addPrologue(statements, node.statements); - ts.append(statements, ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + var tslibImport = ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); + ts.addEmitFlags(tslibImport, 67108864); + ts.append(statements, tslibImport); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } @@ -54444,9 +55736,9 @@ var ts; } function visitor(node) { switch (node.kind) { - case 238: + case 241: return undefined; - case 244: + case 247: return visitExportAssignment(node); } return node; @@ -54540,7 +55832,7 @@ var ts; } ts.getTransformers = getTransformers; function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(296); + var enabledSyntaxKindFeatures = new Array(299); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -54747,8 +56039,8 @@ var ts; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; - var isBundledEmit = sourceFileOrBundle.kind === 270; + var sourceFiles = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 273; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -54810,7 +56102,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 239); + ts.Debug.assert(aliasEmitInfo.node.kind === 242); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -54827,7 +56119,7 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } - if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { + if (!isBundledEmit && ts.isExternalModule(sourceFile) && !resultHasExternalModuleIndicator) { write("export {};"); writeLine(); } @@ -54884,10 +56176,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 227) { + if (declaration.kind === 230) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 242 || declaration.kind === 243 || declaration.kind === 240) { + else if (declaration.kind === 245 || declaration.kind === 246 || declaration.kind === 243) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -54898,7 +56190,7 @@ var ts; moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); } if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 239) { + if (moduleElementEmitInfo.node.kind === 242) { moduleElementEmitInfo.isVisible = true; } else { @@ -54906,12 +56198,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 234) { + if (nodeToCheck.kind === 237) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 234) { + if (nodeToCheck.kind === 237) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -54979,7 +56271,7 @@ var ts; function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; write(": "); - var shouldUseResolverType = declaration.kind === 147 && + var shouldUseResolverType = declaration.kind === 148 && (resolver.isRequiredInitializedParameter(declaration) || resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { @@ -54987,9 +56279,9 @@ var ts; } else { errorNameNode = declaration.name; - var format = 4 | - 16384 | - (shouldUseResolverType ? 8192 : 0); + var format = 4096 | 8 | + 2048 | + (shouldUseResolverType ? 131072 : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } @@ -55002,7 +56294,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 | 16384, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4096 | 8 | 2048, writer); errorNameNode = undefined; } } @@ -55042,50 +56334,54 @@ var ts; function emitType(type) { switch (type.kind) { case 119: - case 136: - case 133: - case 122: - case 134: case 137: + case 134: + case 122: + case 135: + case 138: case 105: - case 139: + case 140: case 95: - case 130: - case 170: - case 174: - return writeTextOfNode(currentText, type); - case 202: - return emitExpressionWithTypeArguments(type); - case 160: - return emitTypeReference(type); - case 163: - return emitTypeQuery(type); - case 165: - return emitArrayType(type); - case 166: - return emitTupleType(type); - case 167: - return emitUnionType(type); - case 168: - return emitIntersectionType(type); - case 169: - return emitParenType(type); - case 171: - return emitTypeOperator(type); - case 172: - return emitIndexedAccessType(type); + case 131: case 173: - return emitMappedType(type); + case 177: + return writeTextOfNode(currentText, type); + case 205: + return emitExpressionWithTypeArguments(type); case 161: - case 162: - return emitSignatureDeclarationWithJsDocComments(type); + return emitTypeReference(type); case 164: + return emitTypeQuery(type); + case 166: + return emitArrayType(type); + case 167: + return emitTupleType(type); + case 168: + return emitUnionType(type); + case 169: + return emitIntersectionType(type); + case 170: + return emitConditionalType(type); + case 171: + return emitInferType(type); + case 172: + return emitParenType(type); + case 174: + return emitTypeOperator(type); + case 175: + return emitIndexedAccessType(type); + case 176: + return emitMappedType(type); + case 162: + case 163: + return emitSignatureDeclarationWithJsDocComments(type); + case 165: return emitTypeLiteral(type); case 71: return emitEntityName(type); - case 144: + case 145: return emitEntityName(type); - case 159: + case 160: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -55093,22 +56389,22 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 144 ? entityName.left : entityName.expression; - var right = entityName.kind === 144 ? entityName.right : entityName.name; + var left = entityName.kind === 145 ? entityName.left : entityName.expression; + var right = entityName.kind === 145 ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); } } function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 238 ? entityName.parent : enclosingDeclaration); + var visibilityResult = resolver.isEntityNameVisible(entityName, entityName.parent.kind === 241 ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 71 || node.expression.kind === 180); + ts.Debug.assert(node.expression.kind === 71 || node.expression.kind === 183); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -55149,6 +56445,22 @@ var ts; function emitIntersectionType(type) { emitSeparatedList(type.types, " & ", emitType); } + function emitConditionalType(node) { + emitType(node.checkType); + write(" extends "); + emitType(node.extendsType); + write(" ? "); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node.trueType; + emitType(node.trueType); + enclosingDeclaration = prevEnclosingDeclaration; + write(" : "); + emitType(node.falseType); + } + function emitInferType(node) { + write("infer "); + writeTextOfNode(currentText, node.typeParameter.name); + } function emitParenType(type) { write("("); emitType(type.type); @@ -55172,7 +56484,9 @@ var ts; writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === 37 ? "+readonly " : + node.readonlyToken.kind === 38 ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -55180,7 +56494,9 @@ var ts; emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === 37 ? "+?" : + node.questionToken.kind === 38 ? "-?" : + "?"); } write(": "); emitType(node.type); @@ -55232,12 +56548,15 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 | 16384, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4096 | 8 | 2048, writer); write(";"); writeLine(); return tempVarName; } function emitExportAssignment(node) { + if (ts.isSourceFile(node.parent)) { + resultHasExternalModuleIndicator = true; + } if (node.expression.kind === 71) { write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentText, node.expression); @@ -55264,10 +56583,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 238 || - (node.parent.kind === 269 && isCurrentFileExternalModule)) { + else if (node.kind === 241 || + (node.parent.kind === 272 && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 269) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 272) { asynchronousSubModuleDeclarationEmitInfo.push({ node: node, outputPos: writer.getTextPos(), @@ -55276,7 +56595,7 @@ var ts; }); } else { - if (node.kind === 239) { + if (node.kind === 242) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -55294,38 +56613,39 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 229: - return writeFunctionDeclaration(node); - case 209: - return writeVariableStatement(node); - case 231: - return writeInterfaceDeclaration(node); - case 230: - return writeClassDeclaration(node); case 232: - return writeTypeAliasDeclaration(node); - case 233: - return writeEnumDeclaration(node); + return writeFunctionDeclaration(node); + case 212: + return writeVariableStatement(node); case 234: + return writeInterfaceDeclaration(node); + case 233: + return writeClassDeclaration(node); + case 235: + return writeTypeAliasDeclaration(node); + case 236: + return writeEnumDeclaration(node); + case 237: return writeModuleDeclaration(node); - case 238: + case 241: return writeImportEqualsDeclaration(node); - case 239: + case 242: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); } } function emitModuleElementDeclarationFlags(node) { - if (node.parent.kind === 269) { + if (node.parent.kind === 272) { var modifiers = ts.getModifierFlags(node); if (modifiers & 1) { + resultHasExternalModuleIndicator = true; write("export "); } if (modifiers & 512) { write("default "); } - else if (node.kind !== 231 && needsDeclare) { + else if (node.kind !== 234 && needsDeclare) { write("declare "); } } @@ -55375,11 +56695,11 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 241) { + if (namedBindings.kind === 244) { return resolver.isDeclarationVisible(namedBindings); } else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); + return namedBindings.elements.some(function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } } } @@ -55398,7 +56718,7 @@ var ts; if (currentWriterPos !== writer.getTextPos()) { write(", "); } - if (node.importClause.namedBindings.kind === 241) { + if (node.importClause.namedBindings.kind === 244) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -55415,19 +56735,9 @@ var ts; writer.writeLine(); } function emitExternalModuleSpecifier(parent) { - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 234; - var moduleSpecifier; - if (parent.kind === 238) { - var node = parent; - moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === 234) { - moduleSpecifier = parent.name; - } - else { - var node = parent; - moduleSpecifier = node.moduleSpecifier; - } + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 237; + var moduleSpecifier = parent.kind === 241 ? ts.getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === 237 ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === 9 && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -55452,6 +56762,7 @@ var ts; writeAsynchronousModuleElements(nodes); } function emitExportDeclaration(node) { + resultHasExternalModuleIndicator = true; emitJsDocComments(node); write("export "); if (node.exportClause) { @@ -55489,7 +56800,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 235) { + while (node.body && node.body.kind !== 238) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -55559,7 +56870,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 152 && ts.hasModifier(node.parent, 8); + return node.parent.kind === 153 && ts.hasModifier(node.parent, 8); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -55569,15 +56880,15 @@ var ts; writeTextOfNode(currentText, node.name); if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 161 || - node.parent.kind === 162 || - (node.parent.parent && node.parent.parent.kind === 164)) { - ts.Debug.assert(node.parent.kind === 152 || - node.parent.kind === 151 || - node.parent.kind === 161 || + if (node.parent.kind === 162 || + node.parent.kind === 163 || + (node.parent.parent && node.parent.parent.kind === 165)) { + ts.Debug.assert(node.parent.kind === 153 || + node.parent.kind === 152 || node.parent.kind === 162 || - node.parent.kind === 156 || - node.parent.kind === 157); + node.parent.kind === 163 || + node.parent.kind === 157 || + node.parent.kind === 158); emitType(node.constraint); } else { @@ -55586,15 +56897,15 @@ var ts; } if (node.default && !isPrivateMethodTypeParameter(node)) { write(" = "); - if (node.parent.kind === 161 || - node.parent.kind === 162 || - (node.parent.parent && node.parent.parent.kind === 164)) { - ts.Debug.assert(node.parent.kind === 152 || - node.parent.kind === 151 || - node.parent.kind === 161 || + if (node.parent.kind === 162 || + node.parent.kind === 163 || + (node.parent.parent && node.parent.parent.kind === 165)) { + ts.Debug.assert(node.parent.kind === 153 || + node.parent.kind === 152 || node.parent.kind === 162 || - node.parent.kind === 156 || - node.parent.kind === 157); + node.parent.kind === 163 || + node.parent.kind === 157 || + node.parent.kind === 158); emitType(node.default); } else { @@ -55604,34 +56915,34 @@ var ts; function getTypeParameterConstraintVisibilityError() { var diagnosticMessage; switch (node.parent.kind) { - case 230: + case 233: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 231: + case 234: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 157: + case 158: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156: + case 157: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; + case 153: case 152: - case 151: if (ts.hasModifier(node.parent, 32)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230) { + else if (node.parent.parent.kind === 233) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 229: + case 232: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 232: + case 235: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -55664,7 +56975,7 @@ var ts; } function getHeritageClauseVisibilityError() { var diagnosticMessage; - if (node.parent.parent.kind === 230) { + if (node.parent.parent.kind === 233) { diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; @@ -55701,7 +57012,7 @@ var ts; diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: baseTypeNode, typeName: node.name - }, !ts.findAncestor(node, function (n) { return n.kind === 234; })); + }, !ts.findAncestor(node, function (n) { return n.kind === 237; })); } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -55774,17 +57085,17 @@ var ts; return resolver.isDeclarationVisible(node) || bindingNameContainsVisibleBindingElement(node.name); } function emitVariableDeclaration(node) { - if (node.kind !== 227 || isVariableDeclarationVisible(node)) { + if (node.kind !== 230 || isVariableDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } else { writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); - if ((node.kind === 150 || node.kind === 149 || - (node.kind === 147 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 151 || node.kind === 150 || + (node.kind === 148 && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 150 || node.kind === 149) && node.parent.kind === 164) { + if ((node.kind === 151 || node.kind === 150) && node.parent.kind === 165) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -55797,15 +57108,15 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 227) { + if (node.kind === 230) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 150 || node.kind === 149 || - (node.kind === 147 && ts.hasModifier(node.parent, 8))) { + else if (node.kind === 151 || node.kind === 150 || + (node.kind === 148 && ts.hasModifier(node.parent, 8))) { if (ts.hasModifier(node, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -55813,7 +57124,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 || node.kind === 147) { + else if (node.parent.kind === 233 || node.kind === 148) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -55839,7 +57150,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 201 && isVariableDeclarationVisible(element)) { + if (element.kind !== 204 && isVariableDeclarationVisible(element)) { elements.push(element); } } @@ -55866,7 +57177,7 @@ var ts; } } function emitTypeOfVariableDeclarationFromTypeLiteral(node) { - if (node.type) { + if (ts.hasType(node)) { write(": "); emitType(node.type); } @@ -55908,7 +57219,7 @@ var ts; accessorWithTypeAnnotation = node; var type = getTypeAnnotationFromAccessor(node); if (!type) { - var anotherAccessor = node.kind === 154 ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 155 ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -55921,7 +57232,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 154 + return accessor.kind === 155 ? accessor.type : accessor.parameters.length > 0 ? accessor.parameters[0].type @@ -55944,7 +57255,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -55959,7 +57270,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 155) { + if (accessorWithTypeAnnotation.kind === 156) { if (ts.hasModifier(accessorWithTypeAnnotation, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2 : @@ -56000,17 +57311,17 @@ var ts; } if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 229) { + if (node.kind === 232) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 152 || node.kind === 153) { + else if (node.kind === 153 || node.kind === 154) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 229) { + if (node.kind === 232) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 153) { + else if (node.kind === 154) { write("constructor"); } else { @@ -56037,7 +57348,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -56076,20 +57387,20 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 158) { + if (node.kind === 159) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 153 && ts.hasModifier(node, 8)) { + if (node.kind === 154 && ts.hasModifier(node, 8)) { write("();"); writeLine(); return; } - if (node.kind === 157 || node.kind === 162) { + if (node.kind === 158 || node.kind === 163) { write("new "); } - else if (node.kind === 161) { + else if (node.kind === 162) { var currentOutput = writer.getText(); if (node.typeParameters && currentOutput.charAt(currentOutput.length - 1) === "<") { closeParenthesizedFunctionType = true; @@ -56100,20 +57411,20 @@ var ts; write("("); } emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 158) { + if (node.kind === 159) { write("]"); } else { write(")"); } - var isFunctionTypeOrConstructorType = node.kind === 161 || node.kind === 162; - if (isFunctionTypeOrConstructorType || node.parent.kind === 164) { + var isFunctionTypeOrConstructorType = node.kind === 162 || node.kind === 163; + if (isFunctionTypeOrConstructorType || node.parent.kind === 165) { if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 153 && !ts.hasModifier(node, 8)) { + else if (node.kind !== 154 && !ts.hasModifier(node, 8)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -56127,23 +57438,23 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 157: + case 158: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 156: + case 157: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 158: + case 159: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; + case 153: case 152: - case 151: if (ts.hasModifier(node, 32)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -56151,7 +57462,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 230) { + else if (node.parent.kind === 233) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -56164,7 +57475,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 229: + case 232: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -56196,9 +57507,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 161 || - node.parent.kind === 162 || - node.parent.parent.kind === 164) { + if (node.parent.kind === 162 || + node.parent.kind === 163 || + node.parent.parent.kind === 165) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8)) { @@ -56214,26 +57525,26 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 153: + case 154: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 157: + case 158: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 156: + case 157: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 158: + case 159: return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; + case 153: case 152: - case 151: if (ts.hasModifier(node.parent, 32)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? @@ -56241,7 +57552,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230) { + else if (node.parent.parent.kind === 233) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -56253,7 +57564,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 229: + case 232: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -56264,12 +57575,12 @@ var ts; } } function emitBindingPattern(bindingPattern) { - if (bindingPattern.kind === 175) { + if (bindingPattern.kind === 178) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 176) { + else if (bindingPattern.kind === 179) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -56280,10 +57591,10 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 201) { + if (bindingElement.kind === 204) { write(" "); } - else if (bindingElement.kind === 177) { + else if (bindingElement.kind === 180) { if (bindingElement.propertyName) { writeTextOfNode(currentText, bindingElement.propertyName); write(": "); @@ -56305,39 +57616,39 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 229: - case 234: - case 238: - case 231: - case 230: case 232: + case 237: + case 241: + case 234: case 233: + case 235: + case 236: return emitModuleElement(node, isModuleElementVisible(node)); - case 209: + case 212: return emitModuleElement(node, isVariableStatementVisible(node)); - case 239: + case 242: return emitModuleElement(node, !node.importClause); - case 245: + case 248: return emitExportDeclaration(node); + case 154: case 153: case 152: - case 151: return writeFunctionDeclaration(node); - case 157: - case 156: case 158: + case 157: + case 159: return emitSignatureDeclarationWithJsDocComments(node); - case 154: case 155: + case 156: return emitAccessorDeclaration(node); + case 151: case 150: - case 149: return emitPropertyDeclaration(node); - case 268: + case 271: return emitEnumMemberDeclaration(node); - case 244: + case 247: return emitExportAssignment(node); - case 269: + case 272: return emitSourceFile(node); } } @@ -56356,7 +57667,7 @@ var ts; } return addedBundledEmitReference; function getDeclFileName(emitFileNames, sourceFileOrBundle) { - var isBundledEmit = sourceFileOrBundle.kind === 270; + var isBundledEmit = sourceFileOrBundle.kind === 273; if (isBundledEmit && !addBundledFileReference) { return; } @@ -56369,8 +57680,8 @@ var ts; function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; - if (!emitSkipped) { - var sourceFiles = sourceFileOrBundle.kind === 270 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + if (!emitSkipped || emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -56458,7 +57769,7 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (sourceFileOrBundle.kind === 269) { + if (sourceFileOrBundle.kind === 272) { sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); } if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { @@ -56565,7 +57876,7 @@ var ts; source = undefined; if (source) setSourceFile(source); - if (node.kind !== 291 + if (node.kind !== 294 && (emitFlags & 16) === 0 && pos >= 0) { emitPos(skipSourceTrivia(pos)); @@ -56582,7 +57893,7 @@ var ts; } if (source) setSourceFile(source); - if (node.kind !== 291 + if (node.kind !== 294 && (emitFlags & 32) === 0 && end >= 0) { emitPos(end); @@ -56591,9 +57902,9 @@ var ts; setSourceFile(oldSource); } } - function emitTokenWithSourceMap(node, token, tokenPos, emitCallback) { + function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) { if (disabled) { - return emitCallback(token, tokenPos); + return emitCallback(token, writer, tokenPos); } var emitNode = node && node.emitNode; var emitFlags = emitNode && emitNode.flags; @@ -56602,7 +57913,7 @@ var ts; if ((emitFlags & 128) === 0 && tokenPos >= 0) { emitPos(tokenPos); } - tokenPos = emitCallback(token, tokenPos); + tokenPos = emitCallback(token, writer, tokenPos); if (range) tokenPos = range.end; if ((emitFlags & 256) === 0 && tokenPos >= 0) { @@ -56618,7 +57929,7 @@ var ts; currentSourceText = currentSource.text; var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, true); - sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source); if (sourceMapSourceIndex === -1) { sourceMapSourceIndex = sourceMapData.sourceMapSources.length; sourceMapData.sourceMapSources.push(source); @@ -56724,7 +58035,7 @@ var ts; if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 291; + var isEmittedNode = node.kind !== 294; var skipLeadingComments = pos < 0 || (emitFlags & 512) !== 0 || node.kind === 10; var skipTrailingComments = end < 0 || (emitFlags & 1024) !== 0 || node.kind === 10; if (!skipLeadingComments) { @@ -56738,7 +58049,7 @@ var ts; } if (!skipTrailingComments) { containerEnd = end; - if (node.kind === 228) { + if (node.kind === 231) { declarationListContainerEnd = end; } } @@ -57007,7 +58318,6 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - var delimiters = createDelimiterMap(); var brackets = createBracketsMap(); function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, emitOnlyDtsFiles) { var sourceFiles = ts.isArray(sourceFilesOrTargetSourceFile) ? sourceFilesOrTargetSourceFile : ts.getSourceFilesToEmit(host, sourceFilesOrTargetSourceFile); @@ -57017,7 +58327,10 @@ var ts; var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" : ""; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + if (result) { + return result; + } } } else { @@ -57026,7 +58339,10 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = !ts.isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + if (result) { + return result; + } } } } @@ -57048,7 +58364,7 @@ var ts; return ".js"; } function getOriginalSourceFileOrBundle(sourceFileOrBundle) { - if (sourceFileOrBundle.kind === 270) { + if (sourceFileOrBundle.kind === 273) { return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, ts.getOriginalSourceFile)); } return ts.getOriginalSourceFile(sourceFileOrBundle); @@ -57090,7 +58406,7 @@ var ts; }; function emitSourceFileOrBundle(_a, sourceFileOrBundle) { var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; - if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit && !compilerOptions.emitDeclarationOnly) { if (!emitOnlyDtsFiles) { printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } @@ -57114,8 +58430,8 @@ var ts; } } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { - var bundle = sourceFileOrBundle.kind === 270 ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 269 ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 273 ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 272 ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); if (bundle) { @@ -57140,7 +58456,7 @@ var ts; } ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); sourceMap.reset(); - writer.reset(); + writer.clear(); currentSourceFile = undefined; bundledHelpers = undefined; isOwnFileEmit = false; @@ -57151,7 +58467,7 @@ var ts; } function emitHelpers(node, writeLines) { var helpersEmitted = false; - var bundle = node.kind === 270 ? node : undefined; + var bundle = node.kind === 273 ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -57200,14 +58516,27 @@ var ts; var generatedNames; var tempFlagsStack; var tempFlags; + var reservedNamesStack; + var reservedNames; var writer; var ownWriter; + var write = writeBase; + var commitPendingSemicolon = ts.noop; + var writeSemicolon = writeSemicolonInternal; + var pendingSemicolon = false; + if (printerOptions.omitTrailingSemicolon) { + commitPendingSemicolon = commitPendingSemicolonInternal; + writeSemicolon = deferWriteSemicolon; + } + var syntheticParent = { pos: -1, end: -1 }; reset(); return { printNode: printNode, + printList: printList, printFile: printFile, printBundle: printBundle, writeNode: writeNode, + writeList: writeList, writeFile: writeFile, writeBundle: writeBundle }; @@ -57224,12 +58553,16 @@ var ts; break; } switch (node.kind) { - case 269: return printFile(node); - case 270: return printBundle(node); + case 272: return printFile(node); + case 273: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); } + function printList(format, nodes, sourceFile) { + writeList(format, nodes, sourceFile, beginPrint()); + return endPrint(); + } function printBundle(bundle) { writeBundle(bundle, beginPrint()); return endPrint(); @@ -57245,6 +58578,16 @@ var ts; reset(); writer = previousWriter; } + function writeList(format, nodes, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList(syntheticParent, nodes, format); + reset(); + writer = previousWriter; + } function writeBundle(bundle, output) { var previousWriter = writer; setWriter(output); @@ -57272,7 +58615,7 @@ var ts; } function endPrint() { var text = ownWriter.getText(); - ownWriter.reset(); + ownWriter.clear(); return text; } function print(hint, node, sourceFile) { @@ -57298,6 +58641,7 @@ var ts; generatedNames = ts.createMap(); tempFlagsStack = []; tempFlags = 0; + reservedNamesStack = []; comments.reset(); setWriter(undefined); } @@ -57359,13 +58703,15 @@ var ts; } function emitMappedTypeParameter(node) { emit(node.name); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emit(node.constraint); } function pipelineEmitUnspecified(node) { var kind = node.kind; if (ts.isKeyword(kind)) { - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; } switch (kind) { @@ -57375,217 +58721,221 @@ var ts; return emitLiteral(node); case 71: return emitIdentifier(node); - case 144: - return emitQualifiedName(node); case 145: - return emitComputedPropertyName(node); + return emitQualifiedName(node); case 146: - return emitTypeParameter(node); + return emitComputedPropertyName(node); case 147: - return emitParameter(node); + return emitTypeParameter(node); case 148: - return emitDecorator(node); + return emitParameter(node); case 149: - return emitPropertySignature(node); + return emitDecorator(node); case 150: - return emitPropertyDeclaration(node); + return emitPropertySignature(node); case 151: - return emitMethodSignature(node); + return emitPropertyDeclaration(node); case 152: - return emitMethodDeclaration(node); + return emitMethodSignature(node); case 153: - return emitConstructor(node); + return emitMethodDeclaration(node); case 154: + return emitConstructor(node); case 155: - return emitAccessorDeclaration(node); case 156: - return emitCallSignature(node); + return emitAccessorDeclaration(node); case 157: - return emitConstructSignature(node); + return emitCallSignature(node); case 158: - return emitIndexSignature(node); + return emitConstructSignature(node); case 159: - return emitTypePredicate(node); + return emitIndexSignature(node); case 160: - return emitTypeReference(node); + return emitTypePredicate(node); case 161: - return emitFunctionType(node); - case 277: - return emitJSDocFunctionType(node); + return emitTypeReference(node); case 162: - return emitConstructorType(node); + return emitFunctionType(node); + case 280: + return emitJSDocFunctionType(node); case 163: - return emitTypeQuery(node); + return emitConstructorType(node); case 164: - return emitTypeLiteral(node); + return emitTypeQuery(node); case 165: - return emitArrayType(node); + return emitTypeLiteral(node); case 166: - return emitTupleType(node); + return emitArrayType(node); case 167: - return emitUnionType(node); + return emitTupleType(node); case 168: - return emitIntersectionType(node); + return emitUnionType(node); case 169: - return emitParenthesizedType(node); - case 202: - return emitExpressionWithTypeArguments(node); + return emitIntersectionType(node); case 170: - return emitThisType(); + return emitConditionalType(node); case 171: - return emitTypeOperator(node); + return emitInferType(node); case 172: - return emitIndexedAccessType(node); + return emitParenthesizedType(node); + case 205: + return emitExpressionWithTypeArguments(node); case 173: - return emitMappedType(node); + return emitThisType(); case 174: + return emitTypeOperator(node); + case 175: + return emitIndexedAccessType(node); + case 176: + return emitMappedType(node); + case 177: return emitLiteralType(node); - case 272: + case 275: write("*"); return; - case 273: + case 276: write("?"); return; - case 274: + case 277: return emitJSDocNullableType(node); - case 275: - return emitJSDocNonNullableType(node); - case 276: - return emitJSDocOptionalType(node); case 278: + return emitJSDocNonNullableType(node); + case 279: + return emitJSDocOptionalType(node); + case 281: return emitJSDocVariadicType(node); - case 175: + case 178: return emitObjectBindingPattern(node); - case 176: + case 179: return emitArrayBindingPattern(node); - case 177: + case 180: return emitBindingElement(node); - case 206: - return emitTemplateSpan(node); - case 207: - return emitSemicolonClassElement(); - case 208: - return emitBlock(node); case 209: - return emitVariableStatement(node); + return emitTemplateSpan(node); case 210: - return emitEmptyStatement(); + return emitSemicolonClassElement(); case 211: - return emitExpressionStatement(node); + return emitBlock(node); case 212: - return emitIfStatement(node); + return emitVariableStatement(node); case 213: - return emitDoStatement(node); + return emitEmptyStatement(); case 214: - return emitWhileStatement(node); + return emitExpressionStatement(node); case 215: - return emitForStatement(node); + return emitIfStatement(node); case 216: - return emitForInStatement(node); + return emitDoStatement(node); case 217: - return emitForOfStatement(node); + return emitWhileStatement(node); case 218: - return emitContinueStatement(node); + return emitForStatement(node); case 219: - return emitBreakStatement(node); + return emitForInStatement(node); case 220: - return emitReturnStatement(node); + return emitForOfStatement(node); case 221: - return emitWithStatement(node); + return emitContinueStatement(node); case 222: - return emitSwitchStatement(node); + return emitBreakStatement(node); case 223: - return emitLabeledStatement(node); + return emitReturnStatement(node); case 224: - return emitThrowStatement(node); + return emitWithStatement(node); case 225: - return emitTryStatement(node); + return emitSwitchStatement(node); case 226: - return emitDebuggerStatement(node); + return emitLabeledStatement(node); case 227: - return emitVariableDeclaration(node); + return emitThrowStatement(node); case 228: - return emitVariableDeclarationList(node); + return emitTryStatement(node); case 229: - return emitFunctionDeclaration(node); + return emitDebuggerStatement(node); case 230: - return emitClassDeclaration(node); + return emitVariableDeclaration(node); case 231: - return emitInterfaceDeclaration(node); + return emitVariableDeclarationList(node); case 232: - return emitTypeAliasDeclaration(node); + return emitFunctionDeclaration(node); case 233: - return emitEnumDeclaration(node); + return emitClassDeclaration(node); case 234: - return emitModuleDeclaration(node); + return emitInterfaceDeclaration(node); case 235: - return emitModuleBlock(node); + return emitTypeAliasDeclaration(node); case 236: - return emitCaseBlock(node); + return emitEnumDeclaration(node); case 237: - return emitNamespaceExportDeclaration(node); + return emitModuleDeclaration(node); case 238: - return emitImportEqualsDeclaration(node); + return emitModuleBlock(node); case 239: - return emitImportDeclaration(node); + return emitCaseBlock(node); case 240: - return emitImportClause(node); + return emitNamespaceExportDeclaration(node); case 241: - return emitNamespaceImport(node); + return emitImportEqualsDeclaration(node); case 242: - return emitNamedImports(node); + return emitImportDeclaration(node); case 243: - return emitImportSpecifier(node); + return emitImportClause(node); case 244: - return emitExportAssignment(node); + return emitNamespaceImport(node); case 245: - return emitExportDeclaration(node); + return emitNamedImports(node); case 246: - return emitNamedExports(node); + return emitImportSpecifier(node); case 247: - return emitExportSpecifier(node); + return emitExportAssignment(node); case 248: - return; + return emitExportDeclaration(node); case 249: + return emitNamedExports(node); + case 250: + return emitExportSpecifier(node); + case 251: + return; + case 252: return emitExternalModuleReference(node); case 10: return emitJsxText(node); - case 252: case 255: - return emitJsxOpeningElementOrFragment(node); - case 253: - case 256: - return emitJsxClosingElementOrFragment(node); - case 257: - return emitJsxAttribute(node); case 258: - return emitJsxAttributes(node); + return emitJsxOpeningElementOrFragment(node); + case 256: case 259: - return emitJsxSpreadAttribute(node); + return emitJsxClosingElementOrFragment(node); case 260: - return emitJsxExpression(node); + return emitJsxAttribute(node); case 261: - return emitCaseClause(node); + return emitJsxAttributes(node); case 262: - return emitDefaultClause(node); + return emitJsxSpreadAttribute(node); case 263: - return emitHeritageClause(node); + return emitJsxExpression(node); case 264: - return emitCatchClause(node); + return emitCaseClause(node); case 265: - return emitPropertyAssignment(node); + return emitDefaultClause(node); case 266: - return emitShorthandPropertyAssignment(node); + return emitHeritageClause(node); case 267: - return emitSpreadAssignment(node); + return emitCatchClause(node); case 268: + return emitPropertyAssignment(node); + case 269: + return emitShorthandPropertyAssignment(node); + case 270: + return emitSpreadAssignment(node); + case 271: return emitEnumMember(node); } if (ts.isExpression(node)) { return pipelineEmitExpression(trySubstituteNode(1, node)); } if (ts.isToken(node)) { - writeTokenNode(node); + writeTokenNode(node, writePunctuation); return; } } @@ -57606,71 +58956,71 @@ var ts; case 101: case 99: case 91: - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; - case 178: - return emitArrayLiteralExpression(node); - case 179: - return emitObjectLiteralExpression(node); - case 180: - return emitPropertyAccessExpression(node); case 181: - return emitElementAccessExpression(node); + return emitArrayLiteralExpression(node); case 182: - return emitCallExpression(node); + return emitObjectLiteralExpression(node); case 183: - return emitNewExpression(node); + return emitPropertyAccessExpression(node); case 184: - return emitTaggedTemplateExpression(node); + return emitElementAccessExpression(node); case 185: - return emitTypeAssertionExpression(node); + return emitCallExpression(node); case 186: - return emitParenthesizedExpression(node); + return emitNewExpression(node); case 187: - return emitFunctionExpression(node); + return emitTaggedTemplateExpression(node); case 188: - return emitArrowFunction(node); + return emitTypeAssertionExpression(node); case 189: - return emitDeleteExpression(node); + return emitParenthesizedExpression(node); case 190: - return emitTypeOfExpression(node); + return emitFunctionExpression(node); case 191: - return emitVoidExpression(node); + return emitArrowFunction(node); case 192: - return emitAwaitExpression(node); + return emitDeleteExpression(node); case 193: - return emitPrefixUnaryExpression(node); + return emitTypeOfExpression(node); case 194: - return emitPostfixUnaryExpression(node); + return emitVoidExpression(node); case 195: - return emitBinaryExpression(node); + return emitAwaitExpression(node); case 196: - return emitConditionalExpression(node); + return emitPrefixUnaryExpression(node); case 197: - return emitTemplateExpression(node); + return emitPostfixUnaryExpression(node); case 198: - return emitYieldExpression(node); + return emitBinaryExpression(node); case 199: - return emitSpreadExpression(node); + return emitConditionalExpression(node); case 200: - return emitClassExpression(node); + return emitTemplateExpression(node); case 201: - return; + return emitYieldExpression(node); + case 202: + return emitSpreadExpression(node); case 203: - return emitAsExpression(node); + return emitClassExpression(node); case 204: + return; + case 206: + return emitAsExpression(node); + case 207: return emitNonNullExpression(node); - case 205: + case 208: return emitMetaProperty(node); - case 250: + case 253: return emitJsxElement(node); - case 251: - return emitJsxSelfClosingElement(node); case 254: + return emitJsxSelfClosingElement(node); + case 257: return emitJsxFragment(node); - case 292: + case 295: return emitPartiallyEmittedExpression(node); - case 293: + case 296: return emitCommaList(node); } } @@ -57689,19 +59039,20 @@ var ts; var text = getLiteralTextOfNode(node); if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 || ts.isTemplateLiteralKind(node.kind))) { - writer.writeLiteral(text); + writeLiteral(text); } else { - write(text); + writeStringLiteral(text); } } function emitIdentifier(node) { - write(getTextOfNode(node, false)); - emitTypeArguments(node, node.typeArguments); + var writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode(node, false), node.symbol); + emitList(node, node.typeArguments, 26896); } function emitQualifiedName(node) { emitEntityName(node.left); - write("."); + writePunctuation("."); emit(node.right); } function emitEntityName(node) { @@ -57713,51 +59064,61 @@ var ts; } } function emitComputedPropertyName(node) { - write("["); + writePunctuation("["); emitExpression(node.expression); - write("]"); + writePunctuation("]"); } function emitTypeParameter(node) { emit(node.name); - emitWithPrefix(" extends ", node.constraint); - emitWithPrefix(" = ", node.default); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit(node.default); + } } function emitParameter(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitIfPresent(node.dotDotDotToken); if (node.name) { - emit(node.name); + emitNodeWithWriter(node.name, writeParameter); } emitIfPresent(node.questionToken); - if (node.parent && node.parent.kind === 277 && !node.name) { + if (node.parent && node.parent.kind === 280 && !node.name) { emit(node.type); } else { - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitDecorator(decorator) { - write("@"); + writePunctuation("@"); emitExpression(decorator.expression); } function emitPropertySignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - emit(node.name); + emitNodeWithWriter(node.name, writeProperty); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitPropertyDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); - write(";"); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); + writeSemicolon(); } function emitMethodSignature(node) { emitDecorators(node, node.decorators); @@ -57766,8 +59127,8 @@ var ts; emitIfPresent(node.questionToken); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitMethodDeclaration(node) { emitDecorators(node, node.decorators); @@ -57779,13 +59140,14 @@ var ts; } function emitConstructor(node) { emitModifiers(node, node.modifiers); - write("constructor"); + writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 154 ? "get " : "set "); + writeKeyword(node.kind === 155 ? "get" : "set"); + writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -57794,31 +59156,34 @@ var ts; emitModifiers(node, node.modifiers); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitConstructSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitIndexSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitParametersForIndexSignature(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitSemicolonClassElement() { - write(";"); + writeSemicolon(); } function emitTypePredicate(node) { emit(node.parameterName); - write(" is "); + writeSpace(); + writeKeyword("is"); + writeSpace(); emit(node.type); } function emitTypeReference(node) { @@ -57828,7 +59193,9 @@ var ts; function emitFunctionType(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitJSDocFunctionType(node) { @@ -57850,34 +59217,39 @@ var ts; write("="); } function emitConstructorType(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitTypeQuery(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emit(node.exprName); } function emitTypeLiteral(node) { - write("{"); + writePunctuation("{"); var flags = ts.getEmitFlags(node) & 1 ? 448 : 65; emitList(node, node.members, flags | 262144); - write("}"); + writePunctuation("}"); } function emitArrayType(node) { emit(node.elementType); - write("[]"); + writePunctuation("["); + writePunctuation("]"); } function emitJSDocVariadicType(node) { write("..."); emit(node.type); } function emitTupleType(node) { - write("["); + writePunctuation("["); emitList(node, node.elementTypes, 336); - write("]"); + writePunctuation("]"); } function emitUnionType(node) { emitList(node, node.types, 260); @@ -57885,30 +59257,50 @@ var ts; function emitIntersectionType(node) { emitList(node, node.types, 264); } + function emitConditionalType(node) { + emit(node.checkType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } function emitParenthesizedType(node) { - write("("); + writePunctuation("("); emit(node.type); - write(")"); + writePunctuation(")"); } function emitThisType() { - write("this"); + writeKeyword("this"); } function emitTypeOperator(node) { - writeTokenText(node.operator); - write(" "); + writeTokenText(node.operator, writeKeyword); + writeSpace(); emit(node.type); } function emitIndexedAccessType(node) { emit(node.objectType); - write("["); + writePunctuation("["); emit(node.indexType); - write("]"); + writePunctuation("]"); } function emitMappedType(node) { var emitFlags = ts.getEmitFlags(node); - write("{"); + writePunctuation("{"); if (emitFlags & 1) { - write(" "); + writeSpace(); } else { writeLine(); @@ -57916,54 +59308,55 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - write(" "); + if (node.readonlyToken.kind !== 132) { + writeKeyword("readonly"); + } + writeSpace(); } - write("["); + writePunctuation("["); pipelineEmitWithNotification(3, node.typeParameter); - write("]"); - emitIfPresent(node.questionToken); - write(": "); + writePunctuation("]"); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 55) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); if (emitFlags & 1) { - write(" "); + writeSpace(); } else { writeLine(); decreaseIndent(); } - write("}"); + writePunctuation("}"); } function emitLiteralType(node) { emitExpression(node.literal); } function emitObjectBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("{}"); - } - else { - write("{"); - emitList(node, elements, 432); - write("}"); - } + writePunctuation("{"); + emitList(node, node.elements, 262576); + writePunctuation("}"); } function emitArrayBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("[]"); - } - else { - write("["); - emitList(node, node.elements, 304); - write("]"); - } + writePunctuation("["); + emitList(node, node.elements, 262448); + writePunctuation("]"); } function emitBindingElement(node) { - emitWithSuffix(node.propertyName, ": "); emitIfPresent(node.dotDotDotToken); + if (node.propertyName) { + emit(node.propertyName); + writePunctuation(":"); + writeSpace(); + } emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitArrayLiteralExpression(node) { var elements = node.elements; @@ -57997,7 +59390,7 @@ var ts; emitExpression(node.expression); increaseIndentIf(indentBeforeDot); var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - write(shouldEmitDotDot ? ".." : "."); + writePunctuation(shouldEmitDotDot ? ".." : "."); increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -58018,9 +59411,9 @@ var ts; } function emitElementAccessExpression(node) { emitExpression(node.expression); - write("["); + writePunctuation("["); emitExpression(node.argumentExpression); - write("]"); + writePunctuation("]"); } function emitCallExpression(node) { emitExpression(node.expression); @@ -58028,26 +59421,27 @@ var ts; emitExpressionList(node, node.arguments, 1296); } function emitNewExpression(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); emitExpressionList(node, node.arguments, 9488); } function emitTaggedTemplateExpression(node) { emitExpression(node.tag); - write(" "); + writeSpace(); emitExpression(node.template); } function emitTypeAssertionExpression(node) { - write("<"); + writePunctuation("<"); emit(node.type); - write(">"); + writePunctuation(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { - write("("); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } function emitFunctionExpression(node) { emitFunctionDeclarationOrExpression(node); @@ -58060,42 +59454,46 @@ var ts; function emitArrowFunctionHead(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - emitWithPrefix(": ", node.type); - write(" "); + emitTypeAnnotation(node.type); + writeSpace(); emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - write("delete "); + writeKeyword("delete"); + writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - write("void "); + writeKeyword("void"); + writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - write("await "); + writeKeyword("await"); + writeSpace(); emitExpression(node.expression); } function emitPrefixUnaryExpression(node) { - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); if (shouldEmitWhitespaceBeforeOperand(node)) { - write(" "); + writeSpace(); } emitExpression(node.operand); } function shouldEmitWhitespaceBeforeOperand(node) { var operand = node.operand; - return operand.kind === 193 + return operand.kind === 196 && ((node.operator === 37 && (operand.operator === 37 || operand.operator === 43)) || (node.operator === 38 && (operand.operator === 38 || operand.operator === 44))); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand); - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); } function emitBinaryExpression(node) { var isCommaOperator = node.operatorToken.kind !== 26; @@ -58104,7 +59502,7 @@ var ts; emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); emitLeadingCommentsOfPosition(node.operatorToken.pos); - writeTokenNode(node.operatorToken); + writeTokenNode(node.operatorToken, writeOperator); emitTrailingCommentsOfPosition(node.operatorToken.end, true); increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); @@ -58132,12 +59530,12 @@ var ts; emitList(node, node.templateSpans, 131072); } function emitYieldExpression(node) { - write("yield"); + writeKeyword("yield"); emit(node.asteriskToken); - emitExpressionWithPrefix(" ", node.expression); + emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } function emitClassExpression(node) { @@ -58150,17 +59548,19 @@ var ts; function emitAsExpression(node) { emitExpression(node.expression); if (node.type) { - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.type); } } function emitNonNullExpression(node) { emitExpression(node.expression); - write("!"); + writeOperator("!"); } function emitMetaProperty(node) { - writeToken(node.keywordToken, node.pos); - write("."); + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); emit(node.name); } function emitTemplateSpan(node) { @@ -58168,12 +59568,12 @@ var ts; emit(node.literal); } function emitBlock(node) { - writeToken(17, node.pos, node); + writeToken(17, node.pos, writePunctuation, node); emitBlockStatements(node, !node.multiLine && isEmptyBlock(node)); increaseIndent(); emitLeadingCommentsOfPosition(node.statements.end); decreaseIndent(); - writeToken(18, node.statements.end, node); + writeToken(18, node.statements.end, writePunctuation, node); } function emitBlockStatements(node, forceSingleLine) { var format = forceSingleLine || ts.getEmitFlags(node) & 1 ? 384 : 65; @@ -58182,27 +59582,27 @@ var ts; function emitVariableStatement(node) { emitModifiers(node, node.modifiers); emit(node.declarationList); - write(";"); + writeSemicolon(); } function emitEmptyStatement() { - write(";"); + writeSemicolon(); } function emitExpressionStatement(node) { emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitIfStatement(node) { - var openParenPos = writeToken(90, node.pos, node); - write(" "); - writeToken(19, openParenPos, node); + var openParenPos = writeToken(90, node.pos, writeKeyword, node); + writeSpace(); + writeToken(19, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20, node.expression.end, node); + writeToken(20, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(82, node.thenStatement.end, node); - if (node.elseStatement.kind === 212) { - write(" "); + writeToken(82, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 215) { + writeSpace(); emit(node.elseStatement); } else { @@ -58211,60 +59611,68 @@ var ts; } } function emitDoStatement(node) { - write("do"); + writeKeyword("do"); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { - write(" "); + writeSpace(); } else { writeLineOrSpace(node); } - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(");"); + writePunctuation(");"); } function emitWhileStatement(node) { - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(88, node.pos); - write(" "); - writeToken(19, openParenPos, node); + var openParenPos = writeToken(88, node.pos, writeKeyword); + writeSpace(); + writeToken(19, openParenPos, writePunctuation, node); emitForBinding(node.initializer); - write(";"); - emitExpressionWithPrefix(" ", node.condition); - write(";"); - emitExpressionWithPrefix(" ", node.incrementor); - write(")"); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.condition); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.incrementor); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(88, node.pos); - write(" "); - writeToken(19, openParenPos); + var openParenPos = writeToken(88, node.pos, writeKeyword); + writeSpace(); + writeToken(19, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emitExpression(node.expression); - writeToken(20, node.expression.end); + writeToken(20, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(88, node.pos); - write(" "); - emitWithSuffix(node.awaitModifier, " "); - writeToken(19, openParenPos); + var openParenPos = writeToken(88, node.pos, writeKeyword); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + writeToken(19, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" of "); + writeSpace(); + writeKeyword("of"); + writeSpace(); emitExpression(node.expression); - writeToken(20, node.expression.end); + writeToken(20, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 228) { + if (node.kind === 231) { emit(node); } else { @@ -58273,58 +59681,62 @@ var ts; } } function emitContinueStatement(node) { - writeToken(77, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(77, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } function emitBreakStatement(node) { - writeToken(72, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(72, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } - function emitTokenWithComment(token, pos, contextNode) { + function emitTokenWithComment(token, pos, writer, contextNode) { var node = contextNode && ts.getParseTreeNode(contextNode); if (node && node.kind === contextNode.kind) { pos = ts.skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, contextNode); + pos = writeToken(token, pos, writer, contextNode); if (node && node.kind === contextNode.kind) { emitTrailingCommentsOfPosition(pos, true); } return pos; } function emitReturnStatement(node) { - emitTokenWithComment(96, node.pos, node); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + emitTokenWithComment(96, node.pos, writeKeyword, node); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitWithStatement(node) { - write("with ("); + writeKeyword("with"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(98, node.pos); - write(" "); - writeToken(19, openParenPos); + var openParenPos = writeToken(98, node.pos, writeKeyword); + writeSpace(); + writeToken(19, openParenPos, writePunctuation); emitExpression(node.expression); - writeToken(20, node.expression.end); - write(" "); + writeToken(20, node.expression.end, writePunctuation); + writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node) { emit(node.label); - write(": "); + writePunctuation(":"); + writeSpace(); emit(node.statement); } function emitThrowStatement(node) { - write("throw"); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + writeKeyword("throw"); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitTryStatement(node) { - write("try "); + writeKeyword("try"); + writeSpace(); emit(node.tryBlock); if (node.catchClause) { writeLineOrSpace(node); @@ -58332,21 +59744,23 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - write("finally "); + writeKeyword("finally"); + writeSpace(); emit(node.finallyBlock); } } function emitDebuggerStatement(node) { - writeToken(78, node.pos); - write(";"); + writeToken(78, node.pos, writeKeyword); + writeSemicolon(); } function emitVariableDeclaration(node) { emit(node.name); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); } function emitVariableDeclarationList(node) { - write(ts.isLet(node) ? "let " : ts.isConst(node) ? "const " : "var "); + writeKeyword(ts.isLet(node) ? "let" : ts.isConst(node) ? "const" : "var"); + writeSpace(); emitList(node, node.declarations, 272); } function emitFunctionDeclaration(node) { @@ -58355,9 +59769,9 @@ var ts; function emitFunctionDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("function"); + writeKeyword("function"); emitIfPresent(node.asteriskToken); - write(" "); + writeSpace(); emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -58387,19 +59801,19 @@ var ts; } else { emitSignatureHead(node); - write(" "); + writeSpace(); emitExpression(body); } } else { emitSignatureHead(node); - write(";"); + writeSemicolon(); } } function emitSignatureHead(node) { emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } function shouldEmitBlockFunctionBodyOnSingleLine(body) { if (ts.getEmitFlags(body) & 1) { @@ -58426,7 +59840,8 @@ var ts; return true; } function emitBlockFunctionBody(body) { - write(" {"); + writeSpace(); + writePunctuation("{"); increaseIndent(); var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine @@ -58438,7 +59853,7 @@ var ts; emitBlockFunctionBody(body); } decreaseIndent(); - writeToken(18, body.statements.end, body); + writeToken(18, body.statements.end, writePunctuation, body); } function emitBlockFunctionBodyOnSingleLine(body) { emitBlockFunctionBodyWorker(body, true); @@ -58462,17 +59877,21 @@ var ts; function emitClassDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("class"); - emitNodeWithPrefix(" ", node.name, emitIdentifierName); + writeKeyword("class"); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } var indentedFlag = ts.getEmitFlags(node) & 65536; if (indentedFlag) { increaseIndent(); } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65); - write("}"); + writePunctuation("}"); if (indentedFlag) { decreaseIndent(); } @@ -58480,66 +59899,77 @@ var ts; function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("interface "); + writeKeyword("interface"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65); - write("}"); + writePunctuation("}"); } function emitTypeAliasDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("type "); + writeKeyword("type"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); } function emitEnumDeclaration(node) { emitModifiers(node, node.modifiers); - write("enum "); + writeKeyword("enum"); + writeSpace(); emit(node.name); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 81); - write("}"); + writePunctuation("}"); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); if (~node.flags & 512) { - write(node.flags & 16 ? "namespace " : "module "); + writeKeyword(node.flags & 16 ? "namespace" : "module"); + writeSpace(); } emit(node.name); var body = node.body; - while (body.kind === 234) { - write("."); + while (body.kind === 237) { + writePunctuation("."); emit(body.name); body = body.body; } - write(" "); + writeSpace(); emit(body); } function emitModuleBlock(node) { pushNameGenerationScope(node); - write("{"); + writePunctuation("{"); emitBlockStatements(node, isEmptyBlock(node)); - write("}"); + writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node) { - writeToken(17, node.pos); + writeToken(17, node.pos, writePunctuation); emitList(node, node.clauses, 65); - writeToken(18, node.clauses.end); + writeToken(18, node.clauses.end, writePunctuation); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); emit(node.name); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitModuleReference(node.moduleReference); - write(";"); + writeSemicolon(); } function emitModuleReference(node) { if (node.kind === 71) { @@ -58551,23 +59981,30 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); if (node.importClause) { emit(node.importClause); - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); } emitExpression(node.moduleSpecifier); - write(";"); + writeSemicolon(); } function emitImportClause(node) { emit(node.name); if (node.name && node.namedBindings) { - write(", "); + writePunctuation(","); + writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node) { - write("* as "); + writePunctuation("*"); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.name); } function emitNamedImports(node) { @@ -58577,28 +60014,44 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); + writeKeyword("export"); + writeSpace(); + if (node.isExportEquals) { + writeOperator("="); + } + else { + writeKeyword("default"); + } + writeSpace(); emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitExportDeclaration(node) { - write("export "); + writeKeyword("export"); + writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - write("*"); + writePunctuation("*"); } if (node.moduleSpecifier) { - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); emitExpression(node.moduleSpecifier); } - write(";"); + writeSemicolon(); } function emitNamespaceExportDeclaration(node) { - write("export as namespace "); + writeKeyword("export"); + writeSpace(); + writeKeyword("as"); + writeSpace(); + writeKeyword("namespace"); + writeSpace(); emit(node.name); - write(";"); + writeSemicolon(); } function emitNamedExports(node) { emitNamedImportsOrExports(node); @@ -58607,21 +60060,24 @@ var ts; emitImportOrExportSpecifier(node); } function emitNamedImportsOrExports(node) { - write("{"); + writePunctuation("{"); emitList(node, node.elements, 432); - write("}"); + writePunctuation("}"); } function emitImportOrExportSpecifier(node) { if (node.propertyName) { emit(node.propertyName); - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); } emit(node.name); } function emitExternalModuleReference(node) { - write("require("); + writeKeyword("require"); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } function emitJsxElement(node) { emit(node.openingElement); @@ -58629,13 +60085,13 @@ var ts; emit(node.closingElement); } function emitJsxSelfClosingElement(node) { - write("<"); + writePunctuation("<"); emitJsxTagName(node.tagName); - write(" "); + writeSpace(); if (node.attributes.properties && node.attributes.properties.length > 0) { emit(node.attributes); } - write("/>"); + writePunctuation("/>"); } function emitJsxFragment(node) { emit(node.openingFragment); @@ -58643,44 +60099,45 @@ var ts; emit(node.closingFragment); } function emitJsxOpeningElementOrFragment(node) { - write("<"); + writePunctuation("<"); if (ts.isJsxOpeningElement(node)) { emitJsxTagName(node.tagName); if (node.attributes.properties && node.attributes.properties.length > 0) { - write(" "); + writeSpace(); emit(node.attributes); } } - write(">"); + writePunctuation(">"); } function emitJsxText(node) { + commitPendingSemicolon(); writer.writeLiteral(getTextOfNode(node, true)); } function emitJsxClosingElementOrFragment(node) { - write(""); + writePunctuation(">"); } function emitJsxAttributes(node) { emitList(node, node.properties, 131328); } function emitJsxAttribute(node) { emit(node.name); - emitWithPrefix("=", node.initializer); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emit); } function emitJsxSpreadAttribute(node) { - write("{..."); + writePunctuation("{..."); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } function emitJsxExpression(node) { if (node.expression) { - write("{"); + writePunctuation("{"); emitIfPresent(node.dotDotDotToken); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } } function emitJsxTagName(node) { @@ -58692,13 +60149,15 @@ var ts; } } function emitCaseClause(node) { - write("case "); + writeKeyword("case"); + writeSpace(); emitExpression(node.expression); - write(":"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitDefaultClause(node) { - write("default:"); + writeKeyword("default"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitCaseOrDefaultClauseStatements(parentNode, statements) { @@ -58711,31 +60170,32 @@ var ts; } var format = 81985; if (emitAsSingleStatement) { - write(" "); + writeSpace(); format &= ~(1 | 64); } emitList(parentNode, statements, format); } function emitHeritageClause(node) { - write(" "); - writeTokenText(node.token); - write(" "); + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); emitList(node, node.types, 272); } function emitCatchClause(node) { - var openParenPos = writeToken(74, node.pos); - write(" "); + var openParenPos = writeToken(74, node.pos, writeKeyword); + writeSpace(); if (node.variableDeclaration) { - writeToken(19, openParenPos); + writeToken(19, openParenPos, writePunctuation); emit(node.variableDeclaration); - writeToken(20, node.variableDeclaration.end); - write(" "); + writeToken(20, node.variableDeclaration.end, writePunctuation); + writeSpace(); } emit(node.block); } function emitPropertyAssignment(node) { emit(node.name); - write(": "); + writePunctuation(":"); + writeSpace(); var initializer = node.initializer; if (emitTrailingCommentsOfPosition && (ts.getEmitFlags(initializer) & 512) === 0) { var commentRange = ts.getCommentRange(initializer); @@ -58746,19 +60206,21 @@ var ts; function emitShorthandPropertyAssignment(node) { emit(node.name); if (node.objectAssignmentInitializer) { - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitExpression(node.objectAssignmentInitializer); } } function emitSpreadAssignment(node) { if (node.expression) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } } function emitEnumMember(node) { emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitSourceFile(node) { writeLine(); @@ -58841,33 +60303,60 @@ var ts; } } } + function emitNodeWithWriter(node, writer) { + var savedWrite = write; + write = writer; + emit(node); + write = savedWrite; + } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 131328); - write(" "); + writeSpace(); } } - function emitWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emit); - } - function emitExpressionWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emitExpression); - } - function emitNodeWithPrefix(prefix, node, emit) { + function emitTypeAnnotation(node) { if (node) { - write(prefix); + writePunctuation(":"); + writeSpace(); emit(node); } } - function emitWithSuffix(node, suffix) { + function emitInitializer(node) { + if (node) { + writeSpace(); + writeOperator("="); + writeSpace(); + emitExpression(node); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit) { + if (node) { + prefixWriter(prefix); + emit(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit(node); + } + } + function emitExpressionWithLeadingSpace(node) { + if (node) { + writeSpace(); + emitExpression(node); + } + } + function emitWithTrailingSpace(node) { if (node) { emit(node); - write(suffix); + writeSpace(); } } function emitEmbeddedStatement(parent, node) { if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1) { - write(" "); + writeSpace(); emit(node); } else { @@ -58881,13 +60370,16 @@ var ts; emitList(parentNode, decorators, 24577); } function emitTypeArguments(parentNode, typeArguments) { - emitList(parentNode, typeArguments, 26960); + emitList(parentNode, typeArguments, 26896); } function emitTypeParameters(parentNode, typeParameters) { - emitList(parentNode, typeParameters, 26960); + if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList(parentNode, typeParameters, 26896); } function emitParameters(parentNode, parameters) { - emitList(parentNode, parameters, 1360); + emitList(parentNode, parameters, 1296); } function canEmitSimpleArrowHead(parentNode, parameters) { var parameter = ts.singleOrUndefined(parameters); @@ -58907,7 +60399,7 @@ var ts; } function emitParametersForArrow(parentNode, parameters) { if (canEmitSimpleArrowHead(parentNode, parameters)) { - emitList(parentNode, parameters, 1360 & ~1024); + emitList(parentNode, parameters, 1296 & ~1024); } else { emitParameters(parentNode, parameters); @@ -58922,6 +60414,23 @@ var ts; function emitExpressionList(parentNode, children, format, start, count) { emitNodeList(emitExpression, parentNode, children, format, start, count); } + function writeDelimiter(format) { + switch (format & 28) { + case 0: + break; + case 16: + writePunctuation(","); + break; + case 4: + writeSpace(); + writePunctuation("|"); + break; + case 8: + writeSpace(); + writePunctuation("&"); + break; + } + } function emitNodeList(emit, parentNode, children, format, start, count) { if (start === void 0) { start = 0; } if (count === void 0) { count = children ? children.length - start : 0; } @@ -58940,7 +60449,7 @@ var ts; return; } if (format & 7680) { - write(getOpeningBracket(format)); + writePunctuation(getOpeningBracket(format)); } if (onBeforeEmitNodeArray) { onBeforeEmitNodeArray(children); @@ -58950,7 +60459,7 @@ var ts; writeLine(); } else if (format & 128 && !(format & 262144)) { - write(" "); + writeSpace(); } } else { @@ -58961,21 +60470,20 @@ var ts; shouldEmitInterveningComments = false; } else if (format & 128) { - write(" "); + writeSpace(); } if (format & 64) { increaseIndent(); } var previousSibling = void 0; var shouldDecreaseIndentAfterEmit = void 0; - var delimiter = getDelimiter(format); for (var i = 0; i < count; i++) { var child = children[start + i]; if (previousSibling) { - if (delimiter && previousSibling.end !== parentNode.end) { + if (format & 28 && previousSibling.end !== parentNode.end) { emitLeadingCommentsOfPosition(previousSibling.end); } - write(delimiter); + writeDelimiter(format); if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { if ((format & (3 | 64)) === 0) { increaseIndent(); @@ -58985,7 +60493,7 @@ var ts; shouldEmitInterveningComments = false; } else if (previousSibling && format & 256) { - write(" "); + writeSpace(); } } if (shouldEmitInterveningComments) { @@ -59006,9 +60514,9 @@ var ts; } var hasTrailingComma = (format & 32) && children.hasTrailingComma; if (format & 16 && hasTrailingComma) { - write(","); + writePunctuation(","); } - if (previousSibling && delimiter && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024)) { + if (previousSibling && format & 28 && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024)) { emitLeadingCommentsOfPosition(previousSibling.end); } if (format & 64) { @@ -59018,50 +60526,102 @@ var ts; writeLine(); } else if (format & 128) { - write(" "); + writeSpace(); } } if (onAfterEmitNodeArray) { onAfterEmitNodeArray(children); } if (format & 7680) { - write(getClosingBracket(format)); + writePunctuation(getClosingBracket(format)); } } - function write(s) { + function commitPendingSemicolonInternal() { + if (pendingSemicolon) { + writeSemicolonInternal(); + pendingSemicolon = false; + } + } + function writeLiteral(s) { + commitPendingSemicolon(); + writer.writeLiteral(s); + } + function writeStringLiteral(s) { + commitPendingSemicolon(); + writer.writeStringLiteral(s); + } + function writeBase(s) { + commitPendingSemicolon(); writer.write(s); } + function writeSymbol(s, sym) { + commitPendingSemicolon(); + writer.writeSymbol(s, sym); + } + function writePunctuation(s) { + commitPendingSemicolon(); + writer.writePunctuation(s); + } + function deferWriteSemicolon() { + pendingSemicolon = true; + } + function writeSemicolonInternal() { + writer.writePunctuation(";"); + } + function writeKeyword(s) { + commitPendingSemicolon(); + writer.writeKeyword(s); + } + function writeOperator(s) { + commitPendingSemicolon(); + writer.writeOperator(s); + } + function writeParameter(s) { + commitPendingSemicolon(); + writer.writeParameter(s); + } + function writeSpace() { + commitPendingSemicolon(); + writer.writeSpace(" "); + } + function writeProperty(s) { + commitPendingSemicolon(); + writer.writeProperty(s); + } function writeLine() { + commitPendingSemicolon(); writer.writeLine(); } function increaseIndent() { + commitPendingSemicolon(); writer.increaseIndent(); } function decreaseIndent() { + commitPendingSemicolon(); writer.decreaseIndent(); } - function writeToken(token, pos, contextNode) { + function writeToken(token, pos, writer, contextNode) { return onEmitSourceMapOfToken - ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) - : writeTokenText(token, pos); + ? onEmitSourceMapOfToken(contextNode, token, writer, pos, writeTokenText) + : writeTokenText(token, writer, pos); } - function writeTokenNode(node) { + function writeTokenNode(node, writer) { if (onBeforeEmitToken) { onBeforeEmitToken(node); } - write(ts.tokenToString(node.kind)); + writer(ts.tokenToString(node.kind)); if (onAfterEmitToken) { onAfterEmitToken(node); } } - function writeTokenText(token, pos) { + function writeTokenText(token, writer, pos) { var tokenString = ts.tokenToString(token); - write(tokenString); + writer(tokenString); return pos < 0 ? pos : pos + tokenString.length; } function writeLineOrSpace(node) { if (ts.getEmitFlags(node) & 1) { - write(" "); + writeSpace(); } else { writeLine(); @@ -59204,7 +60764,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 186 && ts.nodeIsSynthesized(node)) { + while (node.kind === 189 && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -59244,16 +60804,24 @@ var ts; } tempFlagsStack.push(tempFlags); tempFlags = 0; + reservedNamesStack.push(reservedNames); } function popNameGenerationScope(node) { if (node && ts.getEmitFlags(node) & 524288) { return; } tempFlags = tempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name) { + if (!reservedNames || reservedNames === ts.lastOrUndefined(reservedNamesStack)) { + reservedNames = ts.createMap(); + } + reservedNames.set(name, true); } function generateName(name) { - if (name.autoGenerateKind === 4) { - if (name.skipNameGenerationScope) { + if ((name.autoGenerateFlags & 7) === 4) { + if (name.autoGenerateFlags & 8) { var savedTempFlags = tempFlags; popNameGenerationScope(undefined); var result = generateNameCached(getNodeForGeneratedName(name)); @@ -59277,7 +60845,8 @@ var ts; function isUniqueName(name) { return !(hasGlobalName && hasGlobalName(name)) && !currentSourceFile.identifiers.has(name) - && !generatedNames.has(name); + && !generatedNames.has(name) + && !(reservedNames && reservedNames.has(name)); } function isUniqueLocalName(name, container) { for (var node = container; ts.isNodeDescendantOf(node, container); node = node.nextContainer) { @@ -59290,11 +60859,14 @@ var ts; } return true; } - function makeTempVariableName(flags) { + function makeTempVariableName(flags, reservedInNestedScopes) { if (flags && !(tempFlags & flags)) { var name = flags === 268435456 ? "_i" : "_n"; if (isUniqueName(name)) { tempFlags |= flags; + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -59306,6 +60878,9 @@ var ts; ? "_" + String.fromCharCode(97 + count) : "_" + (count - 26); if (isUniqueName(name)) { + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -59351,32 +60926,32 @@ var ts; switch (node.kind) { case 71: return makeUniqueName(getTextOfNode(node)); - case 234: - case 233: + case 237: + case 236: return generateNameForModuleOrEnum(node); - case 239: - case 245: + case 242: + case 248: return generateNameForImportOrExportDeclaration(node); - case 229: - case 230: - case 244: + case 232: + case 233: + case 247: return generateNameForExportDefault(); - case 200: + case 203: return generateNameForClassExpression(); - case 152: - case 154: + case 153: case 155: + case 156: return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0); } } function makeName(name) { - switch (name.autoGenerateKind) { + switch (name.autoGenerateFlags & 7) { case 1: - return makeTempVariableName(0); + return makeTempVariableName(0, !!(name.autoGenerateFlags & 16)); case 2: - return makeTempVariableName(268435456); + return makeTempVariableName(268435456, !!(name.autoGenerateFlags & 16)); case 3: return makeUniqueName(ts.idText(name)); } @@ -59389,7 +60964,7 @@ var ts; while (original) { node = original; if (ts.isIdentifier(node) - && node.autoGenerateKind === 4 + && node.autoGenerateFlags === 4 && node.autoGenerateId !== autoGenerateId) { break; } @@ -59399,17 +60974,6 @@ var ts; } } ts.createPrinter = createPrinter; - function createDelimiterMap() { - var delimiters = []; - delimiters[0] = ""; - delimiters[16] = ","; - delimiters[4] = " |"; - delimiters[8] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28]; - } function createBracketsMap() { var brackets = []; brackets[512] = ["{", "}"]; @@ -59430,412 +60994,6 @@ var ts; TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; TempFlags[TempFlags["_i"] = 268435456] = "_i"; })(TempFlags || (TempFlags = {})); - var ListFormat; - (function (ListFormat) { - ListFormat[ListFormat["None"] = 0] = "None"; - ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; - ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; - ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; - ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; - ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; - ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; - ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; - ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; - ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; - ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; - ListFormat[ListFormat["Indented"] = 64] = "Indented"; - ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; - ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; - ListFormat[ListFormat["Braces"] = 512] = "Braces"; - ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; - ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; - ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; - ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; - ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; - ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; - ListFormat[ListFormat["Optional"] = 24576] = "Optional"; - ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; - ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; - ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; - ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; - ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; - ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; - ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; - ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; - ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; - ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; - ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; - ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; - ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements"; - ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements"; - ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; - ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; - ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; - ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; - ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; - ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; - ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; - ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; - ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; - ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; - ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; - ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; - ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; - ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; - ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; - ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; - ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; - ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; - ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; - ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; - ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; - ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; - ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; - ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments"; - ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters"; - ListFormat[ListFormat["Parameters"] = 1360] = "Parameters"; - ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; - })(ListFormat || (ListFormat = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { - var outputFiles = []; - var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); - return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; - function writeFile(fileName, text, writeByteOrderMark) { - outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); - } - } - ts.getFileEmitOutput = getFileEmitOutput; - function createBuilder(options) { - var isModuleEmit; - var fileInfos = ts.createMap(); - var semanticDiagnosticsPerFile = ts.createMap(); - var changedFilesSet = ts.createMap(); - var hasShapeChanged = ts.createMap(); - var allFilesExcludingDefaultLibraryFile; - var emitHandler; - return { - updateProgram: updateProgram, - getFilesAffectedBy: getFilesAffectedBy, - emitChangedFiles: emitChangedFiles, - getSemanticDiagnostics: getSemanticDiagnostics, - clear: clear - }; - function createProgramGraph(program) { - var currentIsModuleEmit = program.getCompilerOptions().module !== ts.ModuleKind.None; - if (isModuleEmit !== currentIsModuleEmit) { - isModuleEmit = currentIsModuleEmit; - emitHandler = isModuleEmit ? getModuleEmitHandler() : getNonModuleEmitHandler(); - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - } - hasShapeChanged.clear(); - allFilesExcludingDefaultLibraryFile = undefined; - ts.mutateMap(fileInfos, ts.arrayToMap(program.getSourceFiles(), function (sourceFile) { return sourceFile.path; }), { - createNewValue: function (_path, sourceFile) { return addNewFileInfo(program, sourceFile); }, - onDeleteValue: removeExistingFileInfo, - onExistingValue: function (existingInfo, sourceFile) { return updateExistingFileInfo(program, existingInfo, sourceFile); } - }); - } - function registerChangedFile(path) { - changedFilesSet.set(path, true); - semanticDiagnosticsPerFile.delete(path); - } - function addNewFileInfo(program, sourceFile) { - registerChangedFile(sourceFile.path); - emitHandler.onAddSourceFile(program, sourceFile); - return { version: sourceFile.version, signature: undefined }; - } - function removeExistingFileInfo(_existingFileInfo, path) { - changedFilesSet.delete(path); - semanticDiagnosticsPerFile.delete(path); - emitHandler.onRemoveSourceFile(path); - } - function updateExistingFileInfo(program, existingInfo, sourceFile) { - if (existingInfo.version !== sourceFile.version) { - registerChangedFile(sourceFile.path); - existingInfo.version = sourceFile.version; - emitHandler.onUpdateSourceFile(program, sourceFile); - } - else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) { - registerChangedFile(sourceFile.path); - } - } - function ensureProgramGraph(program) { - if (!emitHandler) { - createProgramGraph(program); - } - } - function updateProgram(newProgram) { - if (emitHandler) { - createProgramGraph(newProgram); - } - } - function getFilesAffectedBy(program, path) { - ensureProgramGraph(program); - var sourceFile = program.getSourceFileByPath(path); - if (!sourceFile) { - return ts.emptyArray; - } - if (!updateShapeSignature(program, sourceFile)) { - return [sourceFile]; - } - return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile); - } - function emitChangedFiles(program, writeFileCallback) { - ensureProgramGraph(program); - var compilerOptions = program.getCompilerOptions(); - if (!changedFilesSet.size) { - return ts.emptyArray; - } - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - changedFilesSet.clear(); - return [program.emit(undefined, writeFileCallback)]; - } - var seenFiles = ts.createMap(); - var result; - changedFilesSet.forEach(function (_true, path) { - var affectedFiles = getFilesAffectedBy(program, path); - affectedFiles.forEach(function (affectedFile) { - semanticDiagnosticsPerFile.delete(affectedFile.path); - if (!seenFiles.has(affectedFile.path)) { - seenFiles.set(affectedFile.path, true); - (result || (result = [])).push(program.emit(affectedFile, writeFileCallback)); - } - }); - }); - changedFilesSet.clear(); - return result || ts.emptyArray; - } - function getSemanticDiagnostics(program, cancellationToken) { - ensureProgramGraph(program); - ts.Debug.assert(changedFilesSet.size === 0); - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - return program.getSemanticDiagnostics(undefined, cancellationToken); - } - var diagnostics; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken)); - } - return diagnostics || ts.emptyArray; - } - function getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken) { - var path = sourceFile.path; - var cachedDiagnostics = semanticDiagnosticsPerFile.get(path); - if (cachedDiagnostics) { - return cachedDiagnostics; - } - var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); - semanticDiagnosticsPerFile.set(path, diagnostics); - return diagnostics; - } - function clear() { - isModuleEmit = undefined; - emitHandler = undefined; - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - changedFilesSet.clear(); - hasShapeChanged.clear(); - } - function containsOnlyAmbientModules(sourceFile) { - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - if (!ts.isModuleWithStringLiteralName(statement)) { - return false; - } - } - return true; - } - function updateShapeSignature(program, sourceFile) { - ts.Debug.assert(!!sourceFile); - if (hasShapeChanged.has(sourceFile.path)) { - return false; - } - hasShapeChanged.set(sourceFile.path, true); - var info = fileInfos.get(sourceFile.path); - ts.Debug.assert(!!info); - var prevSignature = info.signature; - var latestSignature; - if (sourceFile.isDeclarationFile) { - latestSignature = sourceFile.version; - info.signature = latestSignature; - } - else { - var emitOutput = getFileEmitOutput(program, sourceFile, true); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - latestSignature = options.computeHash(emitOutput.outputFiles[0].text); - info.signature = latestSignature; - } - else { - latestSignature = prevSignature; - } - } - return !prevSignature || latestSignature !== prevSignature; - } - function getReferencedFiles(program, sourceFile) { - var referencedFiles; - if (sourceFile.imports && sourceFile.imports.length > 0) { - var checker = program.getTypeChecker(); - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var importName = _a[_i]; - var symbol = checker.getSymbolAtLocation(importName); - if (symbol && symbol.declarations && symbol.declarations[0]) { - var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); - if (declarationSourceFile) { - addReferencedFile(declarationSourceFile.path); - } - } - } - } - var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { - var referencedFile = _c[_b]; - var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(referencedPath); - } - } - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { - if (!resolvedTypeReferenceDirective) { - return; - } - var fileName = resolvedTypeReferenceDirective.resolvedFileName; - var typeFilePath = ts.toPath(fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(typeFilePath); - }); - } - return referencedFiles; - function addReferencedFile(referencedPath) { - if (!referencedFiles) { - referencedFiles = ts.createMap(); - } - referencedFiles.set(referencedPath, true); - } - } - function getAllFilesExcludingDefaultLibraryFile(program, firstSourceFile) { - if (allFilesExcludingDefaultLibraryFile) { - return allFilesExcludingDefaultLibraryFile; - } - var result; - addSourceFile(firstSourceFile); - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - if (sourceFile !== firstSourceFile) { - addSourceFile(sourceFile); - } - } - allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; - return allFilesExcludingDefaultLibraryFile; - function addSourceFile(sourceFile) { - if (!program.isSourceFileDefaultLibrary(sourceFile)) { - (result || (result = [])).push(sourceFile); - } - } - } - function getNonModuleEmitHandler() { - return { - onAddSourceFile: ts.noop, - onRemoveSourceFile: ts.noop, - onUpdateSourceFile: ts.noop, - onUpdateSourceFileWithSameVersion: ts.returnFalse, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function getFilesAffectedByUpdatedShape(program, sourceFile) { - var options = program.getCompilerOptions(); - if (options && (options.out || options.outFile)) { - return [sourceFile]; - } - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - } - function getModuleEmitHandler() { - var references = ts.createMap(); - return { - onAddSourceFile: setReferences, - onRemoveSourceFile: onRemoveSourceFile, - onUpdateSourceFile: updateReferences, - onUpdateSourceFileWithSameVersion: updateReferencesTrackingChangedReferences, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function setReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - } - function updateReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - else { - references.delete(sourceFile.path); - } - } - function updateReferencesTrackingChangedReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (!newReferences) { - return references.delete(sourceFile.path); - } - var oldReferences = references.get(sourceFile.path); - references.set(sourceFile.path, newReferences); - if (!oldReferences || oldReferences.size !== newReferences.size) { - return true; - } - return ts.forEachEntry(newReferences, function (_true, referencedPath) { return !oldReferences.delete(referencedPath); }) || - !!oldReferences.size; - } - function onRemoveSourceFile(removedFilePath) { - references.forEach(function (referencesInFile, filePath) { - if (referencesInFile.has(removedFilePath)) { - var referencedByInfo = fileInfos.get(filePath); - if (referencedByInfo) { - registerChangedFile(filePath); - } - } - }); - references.delete(removedFilePath); - } - function getReferencedByPaths(referencedFilePath) { - return ts.mapDefinedIter(references.entries(), function (_a) { - var filePath = _a[0], referencesInFile = _a[1]; - return referencesInFile.has(referencedFilePath) ? filePath : undefined; - }); - } - function getFilesAffectedByUpdatedShape(program, sourceFile) { - if (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile)) { - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { - return [sourceFile]; - } - var seenFileNamesMap = ts.createMap(); - var path = sourceFile.path; - seenFileNamesMap.set(path, sourceFile); - var queue = getReferencedByPaths(path); - while (queue.length > 0) { - var currentPath = queue.pop(); - if (!seenFileNamesMap.has(currentPath)) { - var currentSourceFile = program.getSourceFileByPath(currentPath); - seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(program, currentSourceFile)) { - queue.push.apply(queue, getReferencedByPaths(currentPath)); - } - } - } - return ts.flatMapIter(seenFileNamesMap.values(), function (value) { return value; }); - } - } - } - ts.createBuilder = createBuilder; })(ts || (ts = {})); var ts; (function (ts) { @@ -60020,23 +61178,29 @@ var ts; return errorMessage; } ts.formatDiagnostic = formatDiagnostic; - var redForegroundEscapeSequence = "\u001b[91m"; - var yellowForegroundEscapeSequence = "\u001b[93m"; - var blueForegroundEscapeSequence = "\u001b[93m"; + var ForegroundColorEscapeSequences; + (function (ForegroundColorEscapeSequences) { + ForegroundColorEscapeSequences["Grey"] = "\u001B[90m"; + ForegroundColorEscapeSequences["Red"] = "\u001B[91m"; + ForegroundColorEscapeSequences["Yellow"] = "\u001B[93m"; + ForegroundColorEscapeSequences["Blue"] = "\u001B[94m"; + ForegroundColorEscapeSequences["Cyan"] = "\u001B[96m"; + })(ForegroundColorEscapeSequences = ts.ForegroundColorEscapeSequences || (ts.ForegroundColorEscapeSequences = {})); var gutterStyleSequence = "\u001b[30;47m"; var gutterSeparator = " "; var resetEscapeSequence = "\u001b[0m"; var ellipsis = "..."; function getCategoryFormat(category) { switch (category) { - case ts.DiagnosticCategory.Warning: return yellowForegroundEscapeSequence; - case ts.DiagnosticCategory.Error: return redForegroundEscapeSequence; - case ts.DiagnosticCategory.Message: return blueForegroundEscapeSequence; + case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } - function formatAndReset(text, formatStyle) { + function formatColorAndReset(text, formatStyle) { return formatStyle + text + resetEscapeSequence; } + ts.formatColorAndReset = formatColorAndReset; function padLeft(s, length) { while (s.length < length) { s = " " + s; @@ -60049,9 +61213,9 @@ var ts; var diagnostic = diagnostics_2[_i]; var context = ""; if (diagnostic.file) { - var start = diagnostic.start, length_5 = diagnostic.length, file = diagnostic.file; + var start = diagnostic.start, length_4 = diagnostic.length, file = diagnostic.file; var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; - var _b = ts.getLineAndCharacterOfPosition(file, start + length_5), lastLine = _b.line, lastLineChar = _b.character; + var _b = ts.getLineAndCharacterOfPosition(file, start + length_4), lastLine = _b.line, lastLineChar = _b.character; var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line; var relativeFileName = host ? ts.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : file.fileName; var hasMoreThanFiveLines = (lastLine - firstLine) >= 4; @@ -60062,7 +61226,7 @@ var ts; context += host.getNewLine(); for (var i = firstLine; i <= lastLine; i++) { if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { - context += formatAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + context += formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); i = lastLine - 1; } var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0); @@ -60070,10 +61234,10 @@ var ts; var lineContent = file.text.slice(lineStart, lineEnd); lineContent = lineContent.replace(/\s+$/g, ""); lineContent = lineContent.replace("\t", " "); - context += formatAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; context += lineContent + host.getNewLine(); - context += formatAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; - context += redForegroundEscapeSequence; + context += formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += ForegroundColorEscapeSequences.Red; if (i === firstLine) { var lastCharForLine = i === lastLine ? lastLineChar : undefined; context += lineContent.slice(0, firstLineChar).replace(/\S/g, " "); @@ -60087,19 +61251,25 @@ var ts; } context += resetEscapeSequence; } - output += host.getNewLine(); - output += relativeFileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; + output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan); + output += ":"; + output += formatColorAndReset("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow); + output += ":"; + output += formatColorAndReset("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); + output += " - "; } var categoryColor = getCategoryFormat(diagnostic.category); var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatAndReset(category, categoryColor) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); + output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey); + output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); if (diagnostic.file) { output += host.getNewLine(); output += context; } output += host.getNewLine(); } - return output; + return output + host.getNewLine(); } ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext; function flattenDiagnosticMessageText(messageText, newLine) { @@ -60307,7 +61477,8 @@ var ts; dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, sourceFileToPackageName: sourceFileToPackageName, - redirectTargetsSet: redirectTargetsSet + redirectTargetsSet: redirectTargetsSet, + isEmittedFile: isEmittedFile }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -60412,8 +61583,9 @@ var ts; ts.Debug.assert(j === resolutions.length); return result; function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, oldProgramState) { - var resolutionToFile = ts.getResolvedModule(oldProgramState.file, moduleName); - if (resolutionToFile) { + var resolutionToFile = ts.getResolvedModule(oldProgramState.oldSourceFile, moduleName); + var resolvedFile = resolutionToFile && oldProgramState.program && oldProgramState.program.getSourceFile(resolutionToFile.resolvedFileName); + if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) { return false; } var ambientModule = oldProgramState.program && oldProgramState.program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(moduleName); @@ -60537,7 +61709,7 @@ var ts; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = getModuleNames(newSourceFile); - var oldProgramState = { program: oldProgram, file: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, oldProgramState); var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); if (resolutionsChanged) { @@ -60635,24 +61807,26 @@ var ts; } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; - if (options.noEmit) { - return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; - } - if (options.noEmitOnError) { - var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); - if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { - declarationDiagnostics = program.getDeclarationDiagnostics(undefined, cancellationToken); + if (!emitOnlyDtsFiles) { + if (options.noEmit) { + return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; } - if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { - return { - diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), - sourceMaps: undefined, - emittedFiles: undefined, - emitSkipped: true - }; + if (options.noEmitOnError) { + var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); + if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { + declarationDiagnostics = program.getDeclarationDiagnostics(undefined, cancellationToken); + } + if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { + return { + diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), + sourceMaps: undefined, + emittedFiles: undefined, + emitSkipped: true + }; + } } } - var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); + var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); ts.performance.mark("beforeEmit"); var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); @@ -60764,62 +61938,62 @@ var ts; return diagnostics; function walk(node) { switch (parent.kind) { - case 147: - case 150: + case 148: + case 151: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 187: - case 229: - case 188: - case 227: + case 156: + case 190: + case 232: + case 191: + case 230: if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); return; } } switch (node.kind) { - case 238: + case 241: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 244: + case 247: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 263: + case 266: var heritageClause = node; if (heritageClause.token === 108) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 231: + case 234: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 234: + case 237: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 232: + case 235: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 233: + case 236: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 204: + case 207: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 203: + case 206: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 185: + case 188: ts.Debug.fail(); } var prevParent = parent; @@ -60832,25 +62006,25 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 230: - case 152: - case 151: + case 233: case 153: + case 152: case 154: case 155: - case 187: - case 229: - case 188: + case 156: + case 190: + case 232: + case 191: if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } - case 209: + case 212: if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 209); + return checkModifiers(nodes, parent.kind === 212); } break; - case 150: + case 151: if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { var modifier = _a[_i]; @@ -60861,15 +62035,15 @@ var ts; return; } break; - case 147: + case 148: if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 182: - case 183: - case 202: + case 185: + case 186: + case 205: if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); return; @@ -60892,7 +62066,7 @@ var ts; case 114: case 112: case 113: - case 131: + case 132: case 124: case 117: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); @@ -60974,6 +62148,7 @@ var ts; && !file.isDeclarationFile) { var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); var importDecl = ts.createImportDeclaration(undefined, undefined, undefined); + ts.addEmitFlags(importDecl, 67108864); externalHelpersModuleReference.parent = importDecl; importDecl.parent = file; imports = [externalHelpersModuleReference]; @@ -60991,9 +62166,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 239: - case 238: - case 245: + case 242: + case 241: + case 248: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || !ts.isStringLiteral(moduleNameExpr)) { break; @@ -61005,7 +62180,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 234: + case 237: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2) || file.isDeclarationFile)) { var moduleName = node.name; var nameText = ts.getTextOfIdentifierOrLiteral(moduleName); @@ -61141,7 +62316,7 @@ var ts; } }, shouldCreateNewSourceFile); if (packageId) { - var packageIdKey = packageId.name + "/" + packageId.subModuleName + "@" + packageId.version; + var packageIdKey = ts.packageIdToString(packageId); var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); if (fileFromPackageId) { var dupFile = createRedirectSourceFile(fileFromPackageId, file, fileName, path); @@ -61253,7 +62428,7 @@ var ts; collectExternalModuleReferences(file); if (file.imports.length || file.moduleAugmentations.length) { var moduleNames = getModuleNames(file); - var oldProgramState = { program: oldProgram, file: file, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory), file, oldProgramState); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { @@ -61445,6 +62620,14 @@ var ts; if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } + if (options.emitDeclarationOnly) { + if (!options.declaration) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations"); + } + if (options.noEmit) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); + } + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); @@ -61464,7 +62647,9 @@ var ts; var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createMap(); ts.forEachEmittedFile(emitHost, function (emitFileNames) { - verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + if (!options.emitDeclarationOnly) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + } verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); } @@ -61472,12 +62657,12 @@ var ts; if (emitFileName) { var emitFilePath = toPath(emitFileName); if (filesByName.has(emitFilePath)) { - var chain_1; + var chain_2; if (!options.configFilePath) { - chain_1 = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + chain_2 = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } - chain_1 = ts.chainDiagnosticMessages(chain_1, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); - blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_1)); + chain_2 = ts.chainDiagnosticMessages(chain_2, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_2)); } var emitFileKey = !host.useCaseSensitiveFileNames() ? emitFilePath.toLocaleLowerCase() : emitFilePath; if (emitFilesSeen.has(emitFileKey)) { @@ -61571,6 +62756,31 @@ var ts; hasEmitBlockingDiagnostics.set(toPath(emitFileName), true); programDiagnostics.add(diag); } + function isEmittedFile(file) { + if (options.noEmit) { + return false; + } + var filePath = toPath(file); + if (getSourceFileByPath(filePath)) { + return false; + } + var out = options.outFile || options.out; + if (out) { + return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts"); + } + if (options.outDir) { + return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); + } + if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts")) { + var filePathWithoutExtension = ts.removeFileExtension(filePath); + return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts")) || + !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx")); + } + return false; + } + function isSameFile(file1, file2) { + return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0; + } } ts.createProgram = createProgram; function getResolutionDiagnostic(options, _a) { @@ -61743,12 +62953,14 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", + "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, - description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation }, { name: "allowJs", @@ -61783,6 +62995,12 @@ var ts; category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_d_ts_file, }, + { + name: "emitDeclarationOnly", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Only_emit_d_ts_declaration_files, + }, { name: "sourceMap", type: "boolean", @@ -61989,6 +63207,13 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "esModuleInterop", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports + }, { name: "preserveSymlinks", type: "boolean", @@ -62269,17 +63494,17 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1, - strict: true + strict: true, + esModuleInterop: true }; var optionNameMapCache; function convertEnableAutoDiscoveryToEnable(typeAcquisition) { if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { - var result = { + return { enable: typeAcquisition.enableAutoDiscovery, include: typeAcquisition.include || [], exclude: typeAcquisition.exclude || [] }; - return result; } return typeAcquisition; } @@ -62545,7 +63770,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265) { + if (element.kind !== 268) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -62614,13 +63839,13 @@ var ts; case 8: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193: + case 196: if (valueExpression.operator !== 38 || valueExpression.operand.kind !== 8) { break; } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179: + case 182: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; if (option) { @@ -62630,7 +63855,7 @@ var ts; else { return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined); } - case 178: + case 181: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -62692,7 +63917,7 @@ var ts; function serializeCompilerOptions(options) { var result = ts.createMap(); var optionsNameMap = getOptionNameMap().optionNameMap; - var _loop_5 = function (name) { + var _loop_6 = function (name) { if (ts.hasProperty(options, name)) { if (optionsNameMap.has(name) && optionsNameMap.get(name).category === ts.Diagnostics.Command_line_Options) { return "continue"; @@ -62716,7 +63941,7 @@ var ts; } }; for (var name in options) { - _loop_5(name); + _loop_6(name); } return result; } @@ -62816,7 +64041,7 @@ var ts; return x === undefined || x === null; } function directoryOfCombinedPath(fileName, basePath) { - return ts.getDirectoryPath(ts.toPath(fileName, basePath, ts.identity)); + return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath)); } function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } @@ -62824,8 +64049,7 @@ var ts; if (extraFileExtensions === void 0) { extraFileExtensions = []; } ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); var errors = []; - var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors); + var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); var raw = parsedConfig.raw; var options = ts.extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName; @@ -62905,19 +64129,19 @@ var ts; function isSuccessfulParsedTsconfig(value) { return !!value.options; } - function parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors) { + function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors) { basePath = ts.normalizeSlashes(basePath); - var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); + var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))); return { raw: json || convertToObject(sourceFile, errors) }; } var ownConfig = json ? - parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) : - parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors); + parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : + parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); if (ownConfig.extendedConfigPath) { resolutionStack = resolutionStack.concat([resolvedPath]); - var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { var baseRaw_1 = extendedConfig.raw; var raw_1 = ownConfig.raw; @@ -62938,7 +64162,7 @@ var ts; } return ownConfig; } - function parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { if (ts.hasProperty(json, "excludes")) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } @@ -62952,12 +64176,12 @@ var ts; } else { var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, getCanonicalFileName, errors, ts.createCompilerDiagnostic); + extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, ts.createCompilerDiagnostic); } } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { var options = getDefaultCompilerOptions(configFileName); var typeAcquisition, typingOptionstypeAcquisition; var extendedConfigPath; @@ -62975,7 +64199,7 @@ var ts; switch (key) { case "extends": var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(value, host, newBase, getCanonicalFileName, errors, function (message, arg0) { + extendedConfigPath = getExtendsConfigPath(value, host, newBase, errors, function (message, arg0) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0); }); return; @@ -63009,13 +64233,13 @@ var ts; } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function getExtendsConfigPath(extendedConfig, host, basePath, getCanonicalFileName, errors, createDiagnostic) { + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { extendedConfig = ts.normalizeSlashes(extendedConfig); if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../"))) { errors.push(createDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); return undefined; } - var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); + var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath); if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) { extendedConfigPath = extendedConfigPath + ".json"; if (!host.fileExists(extendedConfigPath)) { @@ -63025,7 +64249,7 @@ var ts; } return extendedConfigPath; } - function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors) { + function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) { var extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); if (sourceFile) { (sourceFile.extendedSourceFiles || (sourceFile.extendedSourceFiles = [])).push(extendedResult.fileName); @@ -63035,12 +64259,12 @@ var ts; return undefined; } var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var extendedConfig = parseConfig(undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), getCanonicalFileName, resolutionStack, errors); + var extendedConfig = parseConfig(undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors); if (sourceFile) { (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); } if (isSuccessfulParsedTsconfig(extendedConfig)) { - var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; var mapPropertiesInRawIfNotUndefined = function (propertyName) { if (raw_2[propertyName]) { @@ -63079,7 +64303,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -63089,8 +64313,7 @@ var ts; return options; } function getDefaultTypeAcquisition(configFileName) { - var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; - return options; + return { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { var options = getDefaultTypeAcquisition(configFileName); @@ -63171,7 +64394,6 @@ var ts; return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, ""); } var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; - var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; @@ -63254,9 +64476,6 @@ var ts; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } - else if (invalidMultipleRecursionPatterns.test(spec)) { - return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; - } else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } @@ -63517,6 +64736,7 @@ var ts; ScriptElementKindModifier["ambientModifier"] = "declare"; ScriptElementKindModifier["staticModifier"] = "static"; ScriptElementKindModifier["abstractModifier"] = "abstract"; + ScriptElementKindModifier["optionalModifier"] = "optional"; })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); var ClassificationTypeNames; (function (ClassificationTypeNames) { @@ -63585,35 +64805,35 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 147: - case 227: - case 177: - case 150: - case 149: - case 265: - case 266: - case 152: + case 148: + case 230: + case 180: case 151: + case 150: + case 268: + case 269: case 153: + case 152: case 154: case 155: - case 229: - case 187: - case 188: - case 264: - case 257: - return 1; - case 146: - case 231: + case 156: case 232: - case 164: - return 2; - case 288: - return node.name === undefined ? 1 | 2 : 2; - case 268: - case 230: - return 1 | 2; + case 190: + case 191: + case 267: + case 260: + return 1; + case 147: case 234: + case 235: + case 165: + return 2; + case 291: + return node.name === undefined ? 1 | 2 : 2; + case 271: + case 233: + return 1 | 2; + case 237: if (ts.isAmbientModule(node)) { return 4 | 1; } @@ -63623,25 +64843,25 @@ var ts; else { return 4; } - case 233: - case 242: - case 243: - case 238: - case 239: - case 244: + case 236: case 245: + case 246: + case 241: + case 242: + case 247: + case 248: return 7; - case 269: + case 272: return 4 | 1; } return 7; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.kind === 269) { + if (node.kind === 272) { return 1; } - else if (node.parent.kind === 244) { + else if (node.parent.kind === 247) { return 7; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -63666,16 +64886,11 @@ var ts; } ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 71); - if (node.parent.kind === 144 && - node.parent.right === node && - node.parent.parent.kind === 238) { - return 1 | 2 | 4; - } - return 4; + var name = node.kind === 145 ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 241 ? 7 : 4; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 144) { + while (node.parent.kind === 145) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -63687,27 +64902,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 144) { - while (root.parent && root.parent.kind === 144) { + if (root.parent.kind === 145) { + while (root.parent && root.parent.kind === 145) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 160 && !isLastClause; + return root.parent.kind === 161 && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 180) { - while (root.parent && root.parent.kind === 180) { + if (root.parent.kind === 183) { + while (root.parent && root.parent.kind === 183) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 202 && root.parent.parent.kind === 263) { + if (!isLastClause && root.parent.kind === 205 && root.parent.parent.kind === 266) { var decl = root.parent.parent.parent; - return (decl.kind === 230 && root.parent.parent.token === 108) || - (decl.kind === 231 && root.parent.parent.token === 85); + return (decl.kind === 233 && root.parent.parent.token === 108) || + (decl.kind === 234 && root.parent.parent.token === 85); } return false; } @@ -63718,23 +64933,23 @@ var ts; switch (node.kind) { case 99: return !ts.isExpressionNode(node); - case 170: + case 173: return true; } switch (node.parent.kind) { - case 160: + case 161: return true; - case 202: + case 205: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 182); + return isCallOrNewExpressionTarget(node, 185); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 183); + return isCallOrNewExpressionTarget(node, 186); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -63747,7 +64962,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 223 && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 226 && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -63757,13 +64972,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 71 && - (node.parent.kind === 219 || node.parent.kind === 218) && + (node.parent.kind === 222 || node.parent.kind === 221) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 71 && - node.parent.kind === 223 && + node.parent.kind === 226 && node.parent.label === node; } function isLabelName(node) { @@ -63771,15 +64986,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 144 && node.parent.right === node; + return node.parent.kind === 145 && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 180 && node.parent.name === node; + return node && node.parent && node.parent.kind === 183 && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 234 && node.parent.name === node; + return node.parent.kind === 237 && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -63789,22 +65004,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 150: - case 149: - case 265: - case 268: - case 152: case 151: - case 154: + case 150: + case 268: + case 271: + case 153: + case 152: case 155: - case 234: + case 156: + case 237: return ts.getNameOfDeclaration(node.parent) === node; - case 181: + case 184: return node.parent.argumentExpression === node; - case 145: + case 146: return true; - case 174: - return node.parent.parent.kind === 172; + case 177: + return node.parent.parent.kind === 175; } } ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess; @@ -63814,7 +65029,7 @@ var ts; } ts.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration; function getContainerNode(node) { - if (node.kind === 288) { + if (node.kind === 291) { node = node.parent.parent; } while (true) { @@ -63823,17 +65038,17 @@ var ts; return undefined; } switch (node.kind) { - case 269: + case 272: + case 153: case 152: - case 151: - case 229: - case 187: - case 154: + case 232: + case 190: case 155: - case 230: - case 231: + case 156: case 233: case 234: + case 236: + case 237: return node; } } @@ -63841,48 +65056,48 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 269: + case 272: return ts.isExternalModule(node) ? "module" : "script"; - case 234: + case 237: return "module"; - case 230: - case 200: + case 233: + case 203: return "class"; - case 231: return "interface"; - case 232: return "type"; - case 233: return "enum"; - case 227: + case 234: return "interface"; + case 235: return "type"; + case 236: return "enum"; + case 230: return getKindOfVariableDeclaration(node); - case 177: + case 180: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 188: - case 229: - case 187: + case 191: + case 232: + case 190: return "function"; - case 154: return "getter"; - case 155: return "setter"; + case 155: return "getter"; + case 156: return "setter"; + case 153: case 152: - case 151: return "method"; + case 151: case 150: - case 149: return "property"; - case 158: return "index"; - case 157: return "construct"; - case 156: return "call"; - case 153: return "constructor"; - case 146: return "type parameter"; - case 268: return "enum member"; - case 147: return ts.hasModifier(node, 92) ? "property" : "parameter"; - case 238: - case 243: - case 240: - case 247: + case 159: return "index"; + case 158: return "construct"; + case 157: return "call"; + case 154: return "constructor"; + case 147: return "type parameter"; + case 271: return "enum member"; + case 148: return ts.hasModifier(node, 92) ? "property" : "parameter"; case 241: + case 246: + case 243: + case 250: + case 244: return "alias"; - case 288: + case 291: return "type"; - case 195: + case 198: var kind = ts.getSpecialPropertyAssignmentKind(node); var right = node.right; switch (kind) { @@ -63920,7 +65135,7 @@ var ts; case 99: return true; case 71: - return ts.identifierIsThisKeyword(node) && node.parent.kind === 147; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 148; default: return false; } @@ -63965,41 +65180,41 @@ var ts; return false; } switch (n.kind) { - case 230: - case 231: case 233: - case 179: - case 175: - case 164: - case 208: - case 235: + case 234: case 236: - case 242: - case 246: + case 182: + case 178: + case 165: + case 211: + case 238: + case 239: + case 245: + case 249: return nodeEndsWith(n, 18, sourceFile); - case 264: + case 267: return isCompletedNode(n.block, sourceFile); - case 183: + case 186: if (!n.arguments) { return true; } - case 182: - case 186: - case 169: + case 185: + case 189: + case 172: return nodeEndsWith(n, 20, sourceFile); - case 161: case 162: + case 163: return isCompletedNode(n.type, sourceFile); - case 153: case 154: case 155: - case 229: - case 187: - case 152: - case 151: - case 157: case 156: - case 188: + case 232: + case 190: + case 153: + case 152: + case 158: + case 157: + case 191: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -64007,71 +65222,68 @@ var ts; return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 20, sourceFile); - case 234: + case 237: return n.body && isCompletedNode(n.body, sourceFile); - case 212: + case 215: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 211: + case 214: return isCompletedNode(n.expression, sourceFile) || - hasChildOfKind(n, 25); - case 178: - case 176: + hasChildOfKind(n, 25, sourceFile); case 181: - case 145: - case 166: + case 179: + case 184: + case 146: + case 167: return nodeEndsWith(n, 22, sourceFile); - case 158: + case 159: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22, sourceFile); - case 261: - case 262: + case 264: + case 265: return false; - case 215: - case 216: + case 218: + case 219: + case 220: case 217: - case 214: return isCompletedNode(n.statement, sourceFile); - case 213: - var hasWhileKeyword = findChildOfKind(n, 106, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 20, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - case 163: + case 216: + return hasChildOfKind(n, 106, sourceFile) + ? nodeEndsWith(n, 20, sourceFile) + : isCompletedNode(n.statement, sourceFile); + case 164: return isCompletedNode(n.exprName, sourceFile); - case 190: - case 189: - case 191: - case 198: - case 199: + case 193: + case 192: + case 194: + case 201: + case 202: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 184: + case 187: return isCompletedNode(n.template, sourceFile); - case 197: + case 200: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 206: + case 209: return ts.nodeIsPresent(n.literal); - case 245: - case 239: + case 248: + case 242: return ts.nodeIsPresent(n.moduleSpecifier); - case 193: - return isCompletedNode(n.operand, sourceFile); - case 195: - return isCompletedNode(n.right, sourceFile); case 196: + return isCompletedNode(n.operand, sourceFile); + case 198: + return isCompletedNode(n.right, sourceFile); + case 199: return isCompletedNode(n.whenFalse, sourceFile); default: return true; } } - ts.isCompletedNode = isCompletedNode; function nodeEndsWith(n, expectedLastToken, sourceFile) { var children = n.getChildren(sourceFile); if (children.length) { @@ -64103,7 +65315,7 @@ var ts; } ts.hasChildOfKind = hasChildOfKind; function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + return ts.find(n.getChildren(sourceFile), function (c) { return c.kind === kind; }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { @@ -64193,19 +65405,11 @@ var ts; var result = find(startNode || sourceFile); ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); return result; - function findRightmostToken(n) { - if (ts.isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); - } function find(n) { - if (ts.isToken(n)) { + if (isNonWhitespaceToken(n)) { return n; } - var children = n.getChildren(); + var children = n.getChildren(sourceFile); for (var i = 0; i < children.length; i++) { var child = children[i]; if (position < child.end) { @@ -64215,34 +65419,45 @@ var ts; isWhiteSpaceOnlyJsxText(child); if (lookInPreviousChild) { var candidate = findRightmostChildNodeWithTokens(children, i); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } else { return find(child); } } } - ts.Debug.assert(startNode !== undefined || n.kind === 269 || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 272 || ts.isJSDocCommentContainingNode(n)); if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); - } - } - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - var child = children[i]; - if (isWhiteSpaceOnlyJsxText(child)) { - ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - else if (nodeHasTokens(children[i])) { - return children[i]; - } + return candidate && findRightmostToken(candidate, sourceFile); } } } ts.findPrecedingToken = findPrecedingToken; - function isInString(sourceFile, position) { - var previousToken = findPrecedingToken(position, sourceFile); + function isNonWhitespaceToken(n) { + return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n); + } + function findRightmostToken(n, sourceFile) { + if (isNonWhitespaceToken(n)) { + return n; + } + var children = n.getChildren(sourceFile); + var candidate = findRightmostChildNodeWithTokens(children, children.length); + return candidate && findRightmostToken(candidate, sourceFile); + } + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { + for (var i = exclusiveStartPosition - 1; i >= 0; i--) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } + function isInString(sourceFile, position, previousToken) { + if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); } if (previousToken && ts.isStringTextContainingNode(previousToken)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); @@ -64267,13 +65482,13 @@ var ts; if (token.kind === 27 && token.parent.kind === 10) { return true; } - if (token.kind === 27 && token.parent.kind === 260) { + if (token.kind === 27 && token.parent.kind === 263) { return true; } - if (token && token.kind === 18 && token.parent.kind === 260) { + if (token && token.kind === 18 && token.parent.kind === 263) { return true; } - if (token.kind === 27 && token.parent.kind === 253) { + if (token.kind === 27 && token.parent.kind === 256) { return true; } return false; @@ -64282,7 +65497,6 @@ var ts; function isWhiteSpaceOnlyJsxText(node) { return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; } - ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); @@ -64326,10 +65540,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 160 || node.kind === 182) { + if (node.kind === 161 || node.kind === 185) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 230 || node.kind === 231) { + if (ts.isFunctionLike(node) || node.kind === 233 || node.kind === 234) { return node.typeParameters; } return undefined; @@ -64381,18 +65595,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 178 || - node.kind === 179) { - if (node.parent.kind === 195 && + if (node.kind === 181 || + node.kind === 182) { + if (node.parent.kind === 198 && node.parent.left === node && node.parent.operatorToken.kind === 58) { return true; } - if (node.parent.kind === 217 && + if (node.parent.kind === 220 && node.parent.initializer === node) { return true; } - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 265 ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 268 ? node.parent.parent : node.parent)) { return true; } } @@ -64426,15 +65640,27 @@ var ts; return ts.createTextSpanFromBounds(range.pos, range.end); } ts.createTextSpanFromRange = createTextSpanFromRange; + function createTextChangeFromStartLength(start, length, newText) { + return createTextChange(ts.createTextSpan(start, length), newText); + } + ts.createTextChangeFromStartLength = createTextChangeFromStartLength; + function createTextChange(span, newText) { + return { span: span, newText: newText }; + } + ts.createTextChange = createTextChange; ts.typeKeywords = [ 119, 122, - 130, - 133, + 128, + 131, + 95, 134, - 136, + 135, 137, + 138, 105, + 140, + 141, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); @@ -64453,10 +65679,31 @@ var ts; }; } ts.nodeSeenTracker = nodeSeenTracker; + function addToSeen(seen, key) { + key = String(key); + if (seen.has(key)) { + return false; + } + seen.set(key, true); + return true; + } + ts.addToSeen = addToSeen; + function getSnapshotText(snap) { + return snap.getText(0, snap.getLength()); + } + ts.getSnapshotText = getSnapshotText; + function repeatString(str, count) { + var result = ""; + for (var i = 0; i < count; i++) { + result += str; + } + return result; + } + ts.repeatString = repeatString; })(ts || (ts = {})); (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 147; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 148; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -64465,6 +65712,7 @@ var ts; var lineStart; var indent; resetWriter(); + var unknownWrite = function (text) { return writeKind(text, ts.SymbolDisplayPartKind.text); }; return { displayParts: function () { return displayParts; }, writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, @@ -64474,8 +65722,18 @@ var ts; writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, + writeLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeSymbol: writeSymbol, writeLine: writeLine, + write: unknownWrite, + writeTextOfNode: unknownWrite, + getText: function () { return ""; }, + getTextPos: function () { return 0; }, + getColumn: function () { return 0; }, + getLine: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + rawWrite: ts.notImplemented, + getIndent: function () { return indent; }, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, @@ -64593,8 +65851,10 @@ var ts; } ts.textPart = textPart; var carriageReturnLineFeed = "\r\n"; - function getNewLineOrDefaultFromHost(host) { - return host.getNewLine ? host.getNewLine() : carriageReturnLineFeed; + function getNewLineOrDefaultFromHost(host, formatSettings) { + return (formatSettings && formatSettings.newLineCharacter) || + (host.getNewLine && host.getNewLine()) || + carriageReturnLineFeed; } ts.getNewLineOrDefaultFromHost = getNewLineOrDefaultFromHost; function lineBreakPart() { @@ -64613,45 +65873,41 @@ var ts; ts.mapToDisplayParts = mapToDisplayParts; function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) { return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typechecker.writeType(type, enclosingDeclaration, flags | 1024, writer); }); } ts.typeToDisplayParts = typeToDisplayParts; function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { return mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags); + typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8, writer); }); } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { - flags |= 65536; + flags |= 16384 | 1024 | 32 | 8192; return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + typechecker.writeSignature(signature, enclosingDeclaration, flags, undefined, writer); }); } ts.signatureToDisplayParts = signatureToDisplayParts; - function getDeclaredName(typeChecker, symbol, location) { - if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 145) { - return ts.getTextOfIdentifierOrLiteral(location); - } - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - return typeChecker.symbolToString(localExportDefaultSymbol || symbol); - } - ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 243 || location.parent.kind === 247) && + (location.parent.kind === 246 || location.parent.kind === 250) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; function stripQuotes(name) { var length = name.length; - if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && ts.isSingleOrDoubleQuote(name.charCodeAt(0))) { + if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { return name.substring(1, length - 1); } return name; } ts.stripQuotes = stripQuotes; + function startsWithQuote(name) { + return ts.isSingleOrDoubleQuote(name.charCodeAt(0)); + } + ts.startsWithQuote = startsWithQuote; function scriptKindIs(fileName, host) { var scriptKinds = []; for (var _i = 2; _i < arguments.length; _i++) { @@ -64676,53 +65932,6 @@ var ts; return position; } ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; - function getOpenBrace(constructor, sourceFile) { - return constructor.body.getFirstToken(sourceFile); - } - ts.getOpenBrace = getOpenBrace; - function getOpenBraceOfClassLike(declaration, sourceFile) { - return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1, false); - } - ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; - function getSourceFileImportLocation(_a) { - var text = _a.text; - var shebang = ts.getShebang(text); - var position = 0; - if (shebang !== undefined) { - position = shebang.length; - advancePastLineBreak(); - } - var ranges = ts.getLeadingCommentRanges(text, position); - if (!ranges) - return position; - if (ranges.length && ranges[0].kind === 3 && ts.isPinnedComment(text, ranges[0])) { - position = ranges[0].end; - advancePastLineBreak(); - ranges = ranges.slice(1); - } - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - if (range.kind === 2 && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { - position = range.end; - advancePastLineBreak(); - continue; - } - break; - } - return position; - function advancePastLineBreak() { - if (position < text.length) { - var charCode = text.charCodeAt(position); - if (ts.isLineBreak(charCode)) { - position++; - if (position < text.length && charCode === 13 && text.charCodeAt(position) === 10) { - position++; - } - } - } - } - } - ts.getSourceFileImportLocation = getSourceFileImportLocation; function getSynthesizedDeepClone(node) { if (node === undefined) { return undefined; @@ -64744,6 +65953,10 @@ var ts; return visited; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(getSynthesizedDeepClone), nodes.hasTrailingComma); + } + ts.getSynthesizedDeepClones = getSynthesizedDeepClones; function suppressLeadingAndTrailingTrivia(node) { ts.Debug.assert(node !== undefined); suppressLeading(node); @@ -64818,89 +66031,89 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 209: + case 212: return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 227: - case 150: - case 149: - return spanInVariableDeclaration(node); - case 147: - return spanInParameterDeclaration(node); - case 229: - case 152: + case 230: case 151: - case 154: - case 155: + case 150: + return spanInVariableDeclaration(node); + case 148: + return spanInParameterDeclaration(node); + case 232: case 153: - case 187: - case 188: + case 152: + case 155: + case 156: + case 154: + case 190: + case 191: return spanInFunctionDeclaration(node); - case 208: + case 211: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } - case 235: - return spanInBlock(node); - case 264: - return spanInBlock(node.block); - case 211: - return textSpan(node.expression); - case 220: - return textSpan(node.getChildAt(0), node.expression); - case 214: - return textSpanEndingAtNextToken(node, node.expression); - case 213: - return spanInNode(node.statement); - case 226: - return textSpan(node.getChildAt(0)); - case 212: - return textSpanEndingAtNextToken(node, node.expression); - case 223: - return spanInNode(node.statement); - case 219: - case 218: - return textSpan(node.getChildAt(0), node.label); - case 215: - return spanInForStatement(node); - case 216: - return textSpanEndingAtNextToken(node, node.expression); - case 217: - return spanInInitializerOfForLike(node); - case 222: - return textSpanEndingAtNextToken(node, node.expression); - case 261: - case 262: - return spanInNode(node.statements[0]); - case 225: - return spanInBlock(node.tryBlock); - case 224: - return textSpan(node, node.expression); - case 244: - return textSpan(node, node.expression); case 238: + return spanInBlock(node); + case 267: + return spanInBlock(node.block); + case 214: + return textSpan(node.expression); + case 223: + return textSpan(node.getChildAt(0), node.expression); + case 217: + return textSpanEndingAtNextToken(node, node.expression); + case 216: + return spanInNode(node.statement); + case 229: + return textSpan(node.getChildAt(0)); + case 215: + return textSpanEndingAtNextToken(node, node.expression); + case 226: + return spanInNode(node.statement); + case 222: + case 221: + return textSpan(node.getChildAt(0), node.label); + case 218: + return spanInForStatement(node); + case 219: + return textSpanEndingAtNextToken(node, node.expression); + case 220: + return spanInInitializerOfForLike(node); + case 225: + return textSpanEndingAtNextToken(node, node.expression); + case 264: + case 265: + return spanInNode(node.statements[0]); + case 228: + return spanInBlock(node.tryBlock); + case 227: + return textSpan(node, node.expression); + case 247: + return textSpan(node, node.expression); + case 241: return textSpan(node, node.moduleReference); - case 239: + case 242: return textSpan(node, node.moduleSpecifier); - case 245: + case 248: return textSpan(node, node.moduleSpecifier); - case 234: + case 237: if (ts.getModuleInstanceState(node) !== 1) { return undefined; } - case 230: case 233: - case 268: - case 177: + case 236: + case 271: + case 180: return textSpan(node); - case 221: + case 224: return spanInNode(node.statement); - case 148: + case 149: return spanInNodeArray(node.parent.decorators); - case 175: - case 176: + case 178: + case 179: return spanInBindingPattern(node); - case 231: - case 232: + case 234: + case 235: return undefined; case 25: case 1: @@ -64928,20 +66141,20 @@ var ts; case 74: case 87: return spanInNextNode(node); - case 143: + case 144: return spanInOfKeyword(node); default: if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } if ((node.kind === 71 || - node.kind === 199 || - node.kind === 265 || - node.kind === 266) && + node.kind === 202 || + node.kind === 268 || + node.kind === 269) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 195) { + if (node.kind === 198) { var binaryExpression = node; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); @@ -64956,38 +66169,38 @@ var ts; } if (ts.isExpressionNode(node)) { switch (node.parent.kind) { - case 213: + case 216: return spanInPreviousNode(node); - case 148: + case 149: return spanInNode(node.parent); - case 215: - case 217: + case 218: + case 220: return textSpan(node); - case 195: + case 198: if (node.parent.operatorToken.kind === 26) { return textSpan(node); } break; - case 188: + case 191: if (node.parent.body === node) { return textSpan(node); } break; } } - if (node.parent.kind === 265 && + if (node.parent.kind === 268 && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } - if (node.parent.kind === 185 && node.parent.type === node) { + if (node.parent.kind === 188 && node.parent.type === node) { return spanInNextNode(node.parent.type); } if (ts.isFunctionLike(node.parent) && node.parent.type === node) { return spanInPreviousNode(node); } - if ((node.parent.kind === 227 || - node.parent.kind === 147)) { + if ((node.parent.kind === 230 || + node.parent.kind === 148)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -64995,7 +66208,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 195) { + if (node.parent.kind === 198) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -65007,7 +66220,7 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 228 && + if (variableDeclaration.parent.kind === 231 && variableDeclaration.parent.declarations[0] === variableDeclaration) { return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } @@ -65016,7 +66229,7 @@ var ts; } } function spanInVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.parent.kind === 216) { + if (variableDeclaration.parent.parent.kind === 219) { return spanInNode(variableDeclaration.parent.parent); } if (ts.isBindingPattern(variableDeclaration.name)) { @@ -65024,10 +66237,10 @@ var ts; } if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1) || - variableDeclaration.parent.parent.kind === 217) { + variableDeclaration.parent.parent.kind === 220) { return textSpanFromVariableDeclaration(variableDeclaration); } - if (variableDeclaration.parent.kind === 228 && + if (variableDeclaration.parent.kind === 231 && variableDeclaration.parent.declarations[0] !== variableDeclaration) { return spanInNode(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent)); } @@ -65045,8 +66258,9 @@ var ts; } else { var functionDeclaration = parameter.parent; - var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); - if (indexOfParameter) { + var indexOfParameter = functionDeclaration.parameters.indexOf(parameter); + ts.Debug.assert(indexOfParameter !== -1); + if (indexOfParameter !== 0) { return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); } else { @@ -65056,7 +66270,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1) || - (functionDeclaration.parent.kind === 230 && functionDeclaration.kind !== 153); + (functionDeclaration.parent.kind === 233 && functionDeclaration.kind !== 154); } function spanInFunctionDeclaration(functionDeclaration) { if (!functionDeclaration.body) { @@ -65076,22 +66290,22 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 234: + case 237: if (ts.getModuleInstanceState(block.parent) !== 1) { return undefined; } - case 214: - case 212: - case 216: - return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - case 215: case 217: + case 215: + case 219: + return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); + case 218: + case 220: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 228) { + if (forLikeStatement.initializer.kind === 231) { var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { return spanInNode(variableDeclarationList.declarations[0]); @@ -65113,62 +66327,60 @@ var ts; } } function spanInBindingPattern(bindingPattern) { - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 201 ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 204 ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } - if (bindingPattern.parent.kind === 177) { + if (bindingPattern.parent.kind === 180) { return textSpan(bindingPattern.parent); } return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 176 && node.kind !== 175); - var elements = node.kind === 178 ? - node.elements : - node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 201 ? element : undefined; }); + ts.Debug.assert(node.kind !== 179 && node.kind !== 178); + var elements = node.kind === 181 ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 204 ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } - return textSpan(node.parent.kind === 195 ? node.parent : node); + return textSpan(node.parent.kind === 198 ? node.parent : node); } function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 233: + case 236: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 230: + case 233: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 236: + case 239: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } return spanInNode(node.parent); } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 235: + case 238: if (ts.getModuleInstanceState(node.parent.parent) !== 1) { return undefined; } + case 236: case 233: - case 230: return textSpan(node); - case 208: + case 211: if (ts.isFunctionBlock(node.parent)) { return textSpan(node); } - case 264: + case 267: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 236: + case 239: var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); if (lastClause) { return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 175: + case 178: var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -65181,7 +66393,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 176: + case 179: var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); default: @@ -65193,33 +66405,33 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 213 || - node.parent.kind === 182 || - node.parent.kind === 183) { + if (node.parent.kind === 216 || + node.parent.kind === 185 || + node.parent.kind === 186) { return spanInPreviousNode(node); } - if (node.parent.kind === 186) { + if (node.parent.kind === 189) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInCloseParenToken(node) { switch (node.parent.kind) { - case 187: - case 229: - case 188: - case 152: - case 151: - case 154: - case 155: + case 190: + case 232: + case 191: case 153: - case 214: - case 213: - case 215: + case 152: + case 155: + case 156: + case 154: case 217: - case 182: - case 183: + case 216: + case 218: + case 220: + case 185: case 186: + case 189: return spanInPreviousNode(node); default: return spanInNode(node.parent); @@ -65227,26 +66439,26 @@ var ts; } function spanInColonToken(node) { if (ts.isFunctionLike(node.parent) || - node.parent.kind === 265 || - node.parent.kind === 147) { + node.parent.kind === 268 || + node.parent.kind === 148) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 185) { + if (node.parent.kind === 188) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 213) { + if (node.parent.kind === 216) { return textSpanEndingAtNextToken(node, node.parent.expression); } return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 217) { + if (node.parent.kind === 220) { return spanInNextNode(node); } return spanInNode(node.parent); @@ -65311,10 +66523,10 @@ var ts; } break; case 119: - case 136: - case 133: - case 122: case 137: + case 134: + case 122: + case 138: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { token = 71; } @@ -65428,7 +66640,7 @@ var ts; var lastEnd = 0; for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_6 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; if (lastEnd >= 0) { var whitespaceLength_1 = start - lastEnd; @@ -65436,8 +66648,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_6, classification: convertClassification(type) }); - lastEnd = start + length_6; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -65472,7 +66684,7 @@ var ts; } switch (keyword2) { case 125: - case 135: + case 136: case 123: case 115: return true; @@ -65595,10 +66807,10 @@ var ts; ts.getSemanticClassifications = getSemanticClassifications; function checkForClassificationCancellation(cancellationToken, kind) { switch (kind) { + case 237: + case 233: case 234: - case 230: - case 231: - case 229: + case 232: cancellationToken.throwIfCancellationRequested(); } } @@ -65727,23 +66939,29 @@ var ts; if (!ts.isTrivia(kind)) { return start; } - if (kind === 4 || kind === 5) { - continue; - } - if (ts.isComment(kind)) { - classifyComment(token, kind, start, width); - triviaScanner.setTextPos(end); - continue; - } - if (kind === 7) { - var text = sourceFile.text; - var ch = text.charCodeAt(start); - if (ch === 60 || ch === 62) { - pushClassification(start, width, 1); + switch (kind) { + case 4: + case 5: continue; - } - ts.Debug.assert(ch === 124 || ch === 61); - classifyDisabledMergeCode(text, start, end); + case 2: + case 3: + classifyComment(token, kind, start, width); + triviaScanner.setTextPos(end); + continue; + case 7: + var text = sourceFile.text; + var ch = text.charCodeAt(start); + if (ch === 60 || ch === 62) { + pushClassification(start, width, 1); + continue; + } + ts.Debug.assert(ch === 124 || ch === 61); + classifyDisabledMergeCode(text, start, end); + break; + case 6: + break; + default: + ts.Debug.assertNever(kind); } } } @@ -65773,16 +66991,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18); pos = tag.tagName.end; switch (tag.kind) { - case 284: + case 287: processJSDocParameterTag(tag); break; - case 287: + case 290: processJSDocTemplateTag(tag); break; - case 286: + case 289: processElement(tag.typeExpression); break; - case 285: + case 288: processElement(tag.typeExpression); break; } @@ -65863,22 +67081,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 252: + case 255: if (token.parent.tagName === token) { return 19; } break; - case 253: + case 256: if (token.parent.tagName === token) { return 20; } break; - case 251: + case 254: if (token.parent.tagName === token) { return 21; } break; - case 257: + case 260: if (token.parent.name === token) { return 22; } @@ -65898,17 +67116,17 @@ var ts; if (ts.isPunctuation(tokenKind)) { if (token) { if (tokenKind === 58) { - if (token.parent.kind === 227 || - token.parent.kind === 150 || - token.parent.kind === 147 || - token.parent.kind === 257) { + if (token.parent.kind === 230 || + token.parent.kind === 151 || + token.parent.kind === 148 || + token.parent.kind === 260) { return 5; } } - if (token.parent.kind === 195 || - token.parent.kind === 193 || - token.parent.kind === 194 || - token.parent.kind === 196) { + if (token.parent.kind === 198 || + token.parent.kind === 196 || + token.parent.kind === 197 || + token.parent.kind === 199) { return 5; } } @@ -65918,7 +67136,7 @@ var ts; return 4; } else if (tokenKind === 9) { - return token.parent.kind === 257 ? 24 : 6; + return token.parent.kind === 260 ? 24 : 6; } else if (tokenKind === 12) { return 6; @@ -65932,32 +67150,32 @@ var ts; else if (tokenKind === 71) { if (token) { switch (token.parent.kind) { - case 230: + case 233: if (token.parent.name === token) { return 11; } return; - case 146: + case 147: if (token.parent.name === token) { return 15; } return; - case 231: + case 234: if (token.parent.name === token) { return 13; } return; - case 233: + case 236: if (token.parent.name === token) { return 12; } return; - case 234: + case 237: if (token.parent.name === token) { return 14; } return; - case 147: + case 148: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 : 17; } @@ -65990,11 +67208,14 @@ var ts; (function (Completions) { var PathCompletions; (function (PathCompletions) { - function getStringLiteralCompletionsFromModuleNames(node, compilerOptions, host, typeChecker) { + function createPathCompletion(name, kind, span) { + return { name: name, kind: kind, span: span }; + } + function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); - var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); + var span = getDirectoryFragmentTextSpan(node.text, node.getStart(sourceFile) + 1); if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { @@ -66052,12 +67273,12 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles.get(foundFileName)) { + if (!foundFiles.has(foundFileName)) { foundFiles.set(foundFileName, true); } } ts.forEachKey(foundFiles, function (foundFile) { - result.push(createCompletionEntryForModule(foundFile, "script", span)); + result.push(createPathCompletion(foundFile, "script", span)); }); } var directories = tryGetDirectories(host, baseDirectory); @@ -66065,7 +67286,7 @@ var ts; for (var _a = 0, directories_1 = directories; _a < directories_1.length; _a++) { var directory = directories_1[_a]; var directoryName = ts.getBaseFileName(ts.normalizePath(directory)); - result.push(createCompletionEntryForModule(directoryName, "directory", span)); + result.push(createPathCompletion(directoryName, "directory", span)); } } } @@ -66079,36 +67300,19 @@ var ts; var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, false, span, host, undefined, result); - var _loop_6 = function (path) { - if (!paths.hasOwnProperty(path)) - return "continue"; - var patterns = paths[path]; - if (!patterns) - return "continue"; - if (path === "*") { - for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) { - var pattern = patterns_1[_i]; - var _loop_7 = function (match) { - if (result.some(function (entry) { return entry.name === match; })) - return "continue"; - result.push(createCompletionEntryForModule(match, "external module name", span)); - }; - for (var _a = 0, _b = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _a < _b.length; _a++) { - var match = _b[_a]; - _loop_7(match); - } - } - } - else if (ts.startsWith(path, fragment)) { - if (patterns.length === 1) { - if (result.some(function (entry) { return entry.name === path; })) - return "continue"; - result.push(createCompletionEntryForModule(path, "external module name", span)); - } - } - }; for (var path in paths) { - _loop_6(path); + var patterns = paths[path]; + if (paths.hasOwnProperty(path) && patterns) { + var _loop_7 = function (name, kind) { + if (!result.some(function (entry) { return entry.name === name; })) { + result.push(createPathCompletion(name, kind, span)); + } + }; + for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host); _i < _a.length; _i++) { + var _b = _a[_i], name = _b.name, kind = _b.kind; + _loop_7(name, kind); + } + } } } if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) { @@ -66120,43 +67324,54 @@ var ts; }); } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _i = 0, _a = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name", span)); + for (var _c = 0, _d = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _c < _d.length; _c++) { + var moduleName = _d[_c]; + result.push(createPathCompletion(moduleName, "external module name", span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { - if (host.readDirectory) { - var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; - if (parsed) { - var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); - var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); - var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); - var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); - var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; - var normalizedSuffix = ts.normalizePath(parsed.suffix); - var baseDirectory = ts.combinePaths(baseUrl, expandedPrefixDirectory); - var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; - var includeGlob = normalizedSuffix ? "**/*" : "./*"; - var matches = tryReadDirectory(host, baseDirectory, fileExtensions, undefined, [includeGlob]); - if (matches) { - var result = []; - for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { - var match = matches_1[_i]; - var normalizedMatch = ts.normalizePath(match); - if (!ts.endsWith(normalizedMatch, normalizedSuffix) || !ts.startsWith(normalizedMatch, completePrefix)) { - continue; - } - var start = completePrefix.length; - var length_7 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_7))); - } - return result; - } - } + function getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host) { + if (!ts.endsWith(path, "*")) { + return !ts.stringContains(path, "*") && ts.startsWith(path, fragment) ? [{ name: path, kind: "directory" }] : ts.emptyArray; } - return undefined; + var pathPrefix = path.slice(0, path.length - 1); + if (!ts.startsWith(fragment, pathPrefix)) { + return [{ name: pathPrefix, kind: "directory" }]; + } + var remainingFragment = fragment.slice(pathPrefix.length); + return ts.flatMap(patterns, function (pattern) { return getModulesForPathsPattern(remainingFragment, baseUrl, pattern, fileExtensions, host); }); + } + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { + if (!host.readDirectory) { + return undefined; + } + var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; + if (!parsed) { + return undefined; + } + var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); + var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); + var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); + var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); + var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; + var normalizedSuffix = ts.normalizePath(parsed.suffix); + var baseDirectory = ts.normalizePath(ts.combinePaths(baseUrl, expandedPrefixDirectory)); + var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + var includeGlob = normalizedSuffix ? "**/*" : "./*"; + var matches = tryReadDirectory(host, baseDirectory, fileExtensions, undefined, [includeGlob]).map(function (name) { return ({ name: name, kind: "script" }); }); + var directories = tryGetDirectories(host, baseDirectory).map(function (d) { return ts.combinePaths(baseDirectory, d); }).map(function (name) { return ({ name: name, kind: "directory" }); }); + return ts.mapDefined(ts.concatenate(matches, directories), function (_a) { + var name = _a.name, kind = _a.kind; + var normalizedMatch = ts.normalizePath(name); + var inner = withoutStartAndEnd(normalizedMatch, completePrefix, normalizedSuffix); + return inner !== undefined ? { name: removeLeadingDirectorySeparator(ts.removeFileExtension(inner)), kind: kind } : undefined; + }); + } + function withoutStartAndEnd(s, start, end) { + return ts.startsWith(s, start) && ts.endsWith(s, end) ? s.slice(start.length, s.length - end.length) : undefined; + } + function removeLeadingDirectorySeparator(path) { + return path[0] === ts.directorySeparator ? path.slice(1) : path; } function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { var isNestedModule = ts.stringContains(fragment, ts.directorySeparator); @@ -66220,10 +67435,12 @@ var ts; PathCompletions.getTripleSlashReferenceCompletion = getTripleSlashReferenceCompletion; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } + var seen = ts.createMap(); if (options.types) { for (var _i = 0, _a = options.types; _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name", span)); + var typesName = _a[_i]; + var moduleName = ts.getUnmangledNameForScopedPackage(typesName); + pushResult(moduleName); } } else if (host.getDirectories) { @@ -66235,30 +67452,37 @@ var ts; if (typeRoots) { for (var _c = 0, typeRoots_2 = typeRoots; _c < typeRoots_2.length; _c++) { var root = typeRoots_2[_c]; - getCompletionEntriesFromDirectories(host, root, span, result); + getCompletionEntriesFromDirectories(root); } } - } - if (host.getDirectories) { for (var _d = 0, _e = findPackageJsons(scriptPath, host); _d < _e.length; _d++) { var packageJson = _e[_d]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); - getCompletionEntriesFromDirectories(host, typesDir, span, result); + getCompletionEntriesFromDirectories(typesDir); } } return result; - } - function getCompletionEntriesFromDirectories(host, directory, span, result) { - if (host.getDirectories && tryDirectoryExists(host, directory)) { - var directories = tryGetDirectories(host, directory); - if (directories) { - for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { - var typeDirectory = directories_2[_i]; - typeDirectory = ts.normalizePath(typeDirectory); - result.push(createCompletionEntryForModule(ts.getBaseFileName(typeDirectory), "external module name", span)); + function getCompletionEntriesFromDirectories(directory) { + ts.Debug.assert(!!host.getDirectories); + if (tryDirectoryExists(host, directory)) { + var directories = tryGetDirectories(host, directory); + if (directories) { + for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { + var typeDirectory = directories_2[_i]; + typeDirectory = ts.normalizePath(typeDirectory); + var directoryName = ts.getBaseFileName(typeDirectory); + var moduleName = ts.getUnmangledNameForScopedPackage(directoryName); + pushResult(moduleName); + } } } } + function pushResult(moduleName) { + if (!seen.has(moduleName)) { + result.push(createPathCompletion(moduleName, "external module name", span)); + seen.set(moduleName, true); + } + } } function findPackageJsons(directory, host) { var paths = []; @@ -66316,9 +67540,6 @@ var ts; } } } - function createCompletionEntryForModule(name, kind, replacementSpan) { - return { name: name, kind: kind, kindModifiers: "", sortText: name, replacementSpan: replacementSpan }; - } function getDirectoryFragmentTextSpan(text, textStart) { var index = text.lastIndexOf(ts.directorySeparator); var offset = index !== -1 ? index + 1 : 0; @@ -66333,15 +67554,19 @@ var ts; return false; } function normalizeAndPreserveTrailingSlash(path) { - return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); + if (ts.normalizeSlashes(path) === "./") { + return ""; + } + var norm = ts.normalizePath(path); + return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(norm) : norm; } var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* 0) { - symbols = filterObjectMembersList(typeMembers, existingMembers); + symbols = filterObjectMembersList(typeMembers, ts.Debug.assertDefined(existingMembers)); } return true; } function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 242 ? - 239 : - 245; + var declarationKind = namedImportsOrExports.kind === 245 ? + 242 : + 248; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { return false; } - isMemberCompletion = true; + completionKind = 3; isNewIdentifierLocation = false; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) { @@ -67257,7 +68607,7 @@ var ts; return true; } function getGetClassLikeCompletionSymbols(classLikeDeclaration) { - isMemberCompletion = true; + completionKind = 3; isNewIdentifierLocation = true; keywordFilters = 1; var baseTypeNode = ts.getClassExtendsHeritageClauseElement(classLikeDeclaration); @@ -67312,8 +68662,8 @@ var ts; case 17: case 26: switch (contextToken.parent.kind) { - case 242: - case 246: + case 245: + case 249: return contextToken.parent; } } @@ -67362,7 +68712,7 @@ var ts; } } } - if (location && location.kind === 290 && ts.isClassLike(location.parent)) { + if (location && location.kind === 293 && ts.isClassLike(location.parent)) { return location.parent; } return undefined; @@ -67381,6 +68731,21 @@ var ts; } return undefined; } + function tryGetFunctionLikeBodyCompletionContainer(contextToken) { + if (contextToken) { + var prev_1; + var container = ts.findAncestor(contextToken.parent, function (node) { + if (ts.isClassLike(node)) { + return "quit"; + } + if (ts.isFunctionLikeDeclaration(node) && prev_1 === node.body) { + return true; + } + prev_1 = node; + }); + return container && container; + } + } function tryGetContainingJsxElement(contextToken) { if (contextToken) { var parent = contextToken.parent; @@ -67388,29 +68753,29 @@ var ts; case 28: case 41: case 71: - case 180: - case 258: - case 257: - case 259: - if (parent && (parent.kind === 251 || parent.kind === 252)) { + case 183: + case 261: + case 260: + case 262: + if (parent && (parent.kind === 254 || parent.kind === 255)) { return parent; } - else if (parent.kind === 257) { + else if (parent.kind === 260) { return parent.parent.parent; } break; case 9: - if (parent && ((parent.kind === 257) || (parent.kind === 259))) { + if (parent && ((parent.kind === 260) || (parent.kind === 262))) { return parent.parent.parent; } break; case 18: if (parent && - parent.kind === 260 && - parent.parent && parent.parent.kind === 257) { + parent.kind === 263 && + parent.parent && parent.parent.kind === 260) { return parent.parent.parent.parent; } - if (parent && parent.kind === 259) { + if (parent && parent.kind === 262) { return parent.parent.parent; } break; @@ -67422,57 +68787,57 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 26: - return containingNodeKind === 227 || - containingNodeKind === 228 || - containingNodeKind === 209 || - containingNodeKind === 233 || - isFunctionLikeButNotConstructor(containingNodeKind) || + return containingNodeKind === 230 || containingNodeKind === 231 || - containingNodeKind === 176 || - containingNodeKind === 232 || + containingNodeKind === 212 || + containingNodeKind === 236 || + isFunctionLikeButNotConstructor(containingNodeKind) || + containingNodeKind === 234 || + containingNodeKind === 179 || + containingNodeKind === 235 || (ts.isClassLike(contextToken.parent) && contextToken.parent.typeParameters && contextToken.parent.typeParameters.end >= contextToken.pos); case 23: - return containingNodeKind === 176; + return containingNodeKind === 179; case 56: - return containingNodeKind === 177; + return containingNodeKind === 180; case 21: - return containingNodeKind === 176; + return containingNodeKind === 179; case 19: - return containingNodeKind === 264 || + return containingNodeKind === 267 || isFunctionLikeButNotConstructor(containingNodeKind); case 17: - return containingNodeKind === 233 || - containingNodeKind === 231 || - containingNodeKind === 164; + return containingNodeKind === 236 || + containingNodeKind === 234 || + containingNodeKind === 165; case 25: - return containingNodeKind === 149 && + return containingNodeKind === 150 && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 231 || - contextToken.parent.parent.kind === 164); + (contextToken.parent.parent.kind === 234 || + contextToken.parent.parent.kind === 165); case 27: - return containingNodeKind === 230 || - containingNodeKind === 200 || - containingNodeKind === 231 || - containingNodeKind === 232 || + return containingNodeKind === 233 || + containingNodeKind === 203 || + containingNodeKind === 234 || + containingNodeKind === 235 || ts.isFunctionLikeKind(containingNodeKind); case 115: - return containingNodeKind === 150 && !ts.isClassLike(contextToken.parent.parent); + return containingNodeKind === 151 && !ts.isClassLike(contextToken.parent.parent); case 24: - return containingNodeKind === 147 || + return containingNodeKind === 148 || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 176); + contextToken.parent.parent.kind === 179); case 114: case 112: case 113: - return containingNodeKind === 147 && !ts.isConstructorDeclaration(contextToken.parent.parent); + return containingNodeKind === 148 && !ts.isConstructorDeclaration(contextToken.parent.parent); case 118: - return containingNodeKind === 243 || - containingNodeKind === 247 || - containingNodeKind === 241; + return containingNodeKind === 246 || + containingNodeKind === 250 || + containingNodeKind === 244; case 125: - case 135: + case 136: if (isFromClassElementDeclaration(contextToken)) { return false; } @@ -67485,7 +68850,7 @@ var ts; case 110: case 76: case 116: - case 138: + case 139: return true; } if (isClassMemberCompletionKeywordText(contextToken.getText()) && @@ -67517,10 +68882,12 @@ var ts; case "yield": return true; } - return ts.isDeclarationName(contextToken) && !ts.isJsxAttribute(contextToken.parent); + return ts.isDeclarationName(contextToken) + && !ts.isJsxAttribute(contextToken.parent) + && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 153; + return ts.isFunctionLikeKind(kind) && kind !== 154; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8) { @@ -67539,31 +68906,28 @@ var ts; var name = element.propertyName || element.name; existingImportsOrExports.set(name.escapedText, true); } - if (existingImportsOrExports.size === 0) { - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default"; }); - } - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" && !existingImportsOrExports.get(e.escapedName); }); + return exportsOfModule.filter(function (e) { return e.escapedName !== "default" && !existingImportsOrExports.get(e.escapedName); }); } function filterObjectMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { + if (existingMembers.length === 0) { return contextualMemberSymbols; } var existingMemberNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; - if (m.kind !== 265 && - m.kind !== 266 && - m.kind !== 177 && - m.kind !== 152 && - m.kind !== 154 && - m.kind !== 155) { + if (m.kind !== 268 && + m.kind !== 269 && + m.kind !== 180 && + m.kind !== 153 && + m.kind !== 155 && + m.kind !== 156) { continue; } if (isCurrentlyEditingNode(m)) { continue; } var existingName = void 0; - if (m.kind === 177 && m.propertyName) { + if (m.kind === 180 && m.propertyName) { if (m.propertyName.kind === 71) { existingName = m.propertyName.escapedText; } @@ -67574,16 +68938,16 @@ var ts; } existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.escapedName); }); + return contextualMemberSymbols.filter(function (m) { return !existingMemberNames.get(m.escapedName); }); } function filterClassMembersList(baseSymbols, implementingTypeSymbols, existingMembers, currentClassElementModifierFlags) { var existingMemberNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; - if (m.kind !== 150 && - m.kind !== 152 && - m.kind !== 154 && - m.kind !== 155) { + if (m.kind !== 151 && + m.kind !== 153 && + m.kind !== 155 && + m.kind !== 156) { continue; } if (isCurrentlyEditingNode(m)) { @@ -67628,77 +68992,72 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 257) { + if (attr.kind === 260) { seenNames.set(attr.name.escapedText, true); } } - return ts.filter(symbols, function (a) { return !seenNames.get(a.escapedName); }); + return symbols.filter(function (a) { return !seenNames.get(a.escapedName); }); } function isCurrentlyEditingNode(node) { return node.getStart() <= position && position <= node.getEnd(); } } - function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, allowStringLiteral, origin) { + function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind) { var name = getSymbolName(symbol, origin, target); - if (!name) + if (name === undefined + || symbol.flags & 1536 && ts.startsWithQuote(name) + || ts.isKnownSymbol(symbol)) { return undefined; - if (symbol.flags & 1920) { - var firstCharCode = name.charCodeAt(0); - if (ts.isSingleOrDoubleQuote(firstCharCode)) { + } + var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + if (ts.isIdentifierText(name, target)) + return validIdentiferResult; + switch (kind) { + case 3: return undefined; - } + case 0: + return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; + case 2: + case 5: + case 1: + return name.charCodeAt(0) === 32 ? undefined : { name: name, needsConvertPropertyAccess: true }; + case 4: + return validIdentiferResult; + default: + ts.Debug.assertNever(kind); } - if (symbol.flags & 106500) { - var escapedName = symbol.escapedName; - if (escapedName.length >= 3 && - escapedName.charCodeAt(0) === 95 && - escapedName.charCodeAt(1) === 95 && - escapedName.charCodeAt(2) === 64) { - return undefined; - } - } - return getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral); - } - function getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral) { - if (performCharacterChecks && !ts.isIdentifierText(name, target)) { - return allowStringLiteral ? JSON.stringify(name) : undefined; - } - return name; } var _keywordCompletions = []; - function getKeywordCompletions(keywordFilter) { - var completions = _keywordCompletions[keywordFilter]; - if (completions) { - return completions; + var allKeywordsCompletions = ts.memoize(function () { + var res = []; + for (var i = 72; i <= 144; i++) { + res.push({ + name: ts.tokenToString(i), + kind: "keyword", + kindModifiers: "", + sortText: "0" + }); } - return _keywordCompletions[keywordFilter] = generateKeywordCompletions(keywordFilter); - function generateKeywordCompletions(keywordFilter) { + return res; + }); + function getKeywordCompletions(keywordFilter) { + return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter(function (entry) { + var kind = ts.stringToToken(entry.name); switch (keywordFilter) { case 0: - return getAllKeywordCompletions(); + return kind !== 140; case 1: - return getFilteredKeywordCompletions(isClassMemberCompletionKeywordText); + return isClassMemberCompletionKeyword(kind); case 2: - return getFilteredKeywordCompletions(isConstructorParameterCompletionKeywordText); + return isConstructorParameterCompletionKeyword(kind); + case 3: + return isFunctionLikeBodyCompletionKeyword(kind); + case 4: + return ts.isTypeKeyword(kind); + default: + return ts.Debug.assertNever(keywordFilter); } - } - function getAllKeywordCompletions() { - var allKeywordsCompletions = []; - for (var i = 72; i <= 143; i++) { - if (i === 139) - continue; - allKeywordsCompletions.push({ - name: ts.tokenToString(i), - kind: "keyword", - kindModifiers: "", - sortText: "0" - }); - } - return allKeywordsCompletions; - } - function getFilteredKeywordCompletions(filterFn) { - return ts.filter(getKeywordCompletions(0), function (entry) { return filterFn(entry.name); }); - } + })); } function isClassMemberCompletionKeyword(kind) { switch (kind) { @@ -67708,9 +69067,9 @@ var ts; case 117: case 115: case 123: - case 131: + case 132: case 125: - case 135: + case 136: case 120: return true; } @@ -67723,21 +69082,39 @@ var ts; case 114: case 112: case 113: - case 131: + case 132: return true; } } function isConstructorParameterCompletionKeywordText(text) { return isConstructorParameterCompletionKeyword(ts.stringToToken(text)); } - function isEqualityExpression(node) { - return ts.isBinaryExpression(node) && isEqualityOperatorKind(node.operatorToken.kind); + function isFunctionLikeBodyCompletionKeyword(kind) { + switch (kind) { + case 114: + case 112: + case 113: + case 132: + case 123: + case 115: + case 117: + case 125: + case 136: + case 140: + return false; + } + return true; } function isEqualityOperatorKind(kind) { - return kind === 32 || - kind === 33 || - kind === 34 || - kind === 35; + switch (kind) { + case 34: + case 32: + case 35: + case 33: + return true; + default: + return false; + } } function getJsDocTagAtPosition(node, position) { var jsDoc = getJsDocHavingNode(node).jsDoc; @@ -67769,13 +69146,13 @@ var ts; } function getPropertiesForCompletion(type, checker, isForAccess) { if (!(type.flags & 131072)) { - return type.getApparentProperties(); + return ts.Debug.assertEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } var types = type.types; var filteredTypes = isForAccess ? types : types.filter(function (memberType) { return !(memberType.flags & 16382 || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker)); }); - return checker.getAllPossiblePropertiesOfTypes(filteredTypes); + return ts.Debug.assertEachDefined(checker.getAllPossiblePropertiesOfTypes(filteredTypes), "getAllPossiblePropertiesOfTypes() should all be defined"); } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); @@ -67785,10 +69162,7 @@ var ts; (function (DocumentHighlights) { function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) { var node = ts.getTouchingWord(sourceFile, position, true); - if (node === sourceFile) - return undefined; - ts.Debug.assert(node.parent !== undefined); - if (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent)) { + if (node.parent && (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent))) { var _a = node.parent.parent, openingElement = _a.openingElement, closingElement = _a.closingElement; var highlightSpans = [openingElement, closingElement].map(function (_a) { var tagName = _a.tagName; @@ -67796,7 +69170,7 @@ var ts; }); return [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; } - return getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); + return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); } DocumentHighlights.getDocumentHighlights = getDocumentHighlights; function getHighlightSpanForNode(node, sourceFile) { @@ -67806,8 +69180,8 @@ var ts; kind: "none" }; } - function getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) { - var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(node, program, sourceFilesToSearch, cancellationToken); + function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { + var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken); return referenceEntries && convertReferencedSymbols(referenceEntries); } function convertReferencedSymbols(referenceEntries) { @@ -67860,15 +69234,20 @@ var ts; case 81: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, true); }, getLoopBreakContinueOccurrences); case 123: - return useParent(node.parent, ts.isConstructorDeclaration, getConstructorOccurrences); + return getFromAllDeclarations(ts.isConstructorDeclaration, [123]); case 125: - case 135: - return useParent(node.parent, ts.isAccessor, getGetAndSetOccurrences); + case 136: + return getFromAllDeclarations(ts.isAccessor, [125, 136]); default: return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : undefined; } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, function (decl) { return ts.mapDefined(decl.symbol.declarations, function (d) { + return nodeTest(d) ? ts.find(d.getChildren(sourceFile), function (c) { return ts.contains(keywords, c.kind); }) : undefined; + }); }); + } function useParent(node, nodeTest, getNodes) { return nodeTest(node) ? highlightSpans(getNodes(node, sourceFile)) : undefined; } @@ -67877,58 +69256,40 @@ var ts; } } function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (ts.isThrowStatement(node)) { - statementAccumulator.push(node); - } - else if (ts.isTryStatement(node)) { - if (node.catchClause) { - aggregate(node.catchClause); - } - else { - aggregate(node.tryBlock); - } - if (node.finallyBlock) { - aggregate(node.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } + if (ts.isThrowStatement(node)) { + return [node]; } + else if (ts.isTryStatement(node)) { + return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), aggregateOwnedThrowStatements(node.finallyBlock)); + } + return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements); } function getThrowStatementOwner(throwStatement) { var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 269) { + if (ts.isFunctionBlock(parent) || parent.kind === 272) { return parent; } - if (parent.kind === 225) { - var tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } + if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) { + return child; } child = parent; } return undefined; } function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 219 || node.kind === 218) { - statementAccumulator.push(node); + return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + var result = []; + node.forEachChild(function (child) { + var value = cb(child); + if (value !== undefined) { + result.push.apply(result, ts.toArray(value)); } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } + }); + return result; } function ownsBreakOrContinueStatement(owner, statement) { var actualOwner = getBreakOrContinueOwner(statement); @@ -67937,25 +69298,22 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 222: - if (statement.kind === 218) { + case 225: + if (statement.kind === 221) { return false; } - case 215: - case 216: + case 218: + case 219: + case 220: case 217: - case 214: - case 213: - return !statement.label || isLabeledBy(node, statement.label.text); + case 216: + return !statement.label || isLabeledBy(node, statement.label.escapedText); default: return (ts.isFunctionLike(node) && "quit"); } }); } function getModifierOccurrences(modifier, declaration) { - if (!isLegalModifier(modifier, declaration)) { - return undefined; - } var modifierFlag = ts.modifierToFlag(modifier); return ts.mapDefined(getNodesToSearchForModifier(declaration, modifierFlag), function (node) { if (ts.getModifierFlags(node) & modifierFlag) { @@ -67968,21 +69326,24 @@ var ts; function getNodesToSearchForModifier(declaration, modifierFlag) { var container = declaration.parent; switch (container.kind) { - case 235: - case 269: - case 208: - case 261: - case 262: - if (modifierFlag & 128) { + case 238: + case 272: + case 211: + case 264: + case 265: + if (modifierFlag & 128 && ts.isClassDeclaration(declaration)) { return declaration.members.concat([declaration]); } else { return container.statements; } + case 154: case 153: - return container.parameters.concat(container.parent.members); - case 230: - case 200: + case 232: { + return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : [])); + } + case 233: + case 203: var nodes = container.members; if (modifierFlag & 28) { var constructor = ts.find(container.members, ts.isConstructorDeclaration); @@ -67995,33 +69356,7 @@ var ts; } return nodes; default: - ts.Debug.fail("Invalid container kind."); - } - } - function isLegalModifier(modifier, declaration) { - var container = declaration.parent; - switch (modifier) { - case 112: - case 113: - case 114: - switch (container.kind) { - case 230: - case 200: - return true; - case 153: - return declaration.kind === 147; - default: - return false; - } - case 115: - return container.kind === 230 || container.kind === 200; - case 84: - case 124: - return container.kind === 235 || container.kind === 269; - case 117: - return container.kind === 230 || declaration.kind === 230; - default: - return false; + ts.Debug.assertNever(container, "Invalid container kind."); } } function pushKeywordIf(keywordList, token) { @@ -68035,32 +69370,10 @@ var ts; } return false; } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 154); - tryPushAccessorKeyword(accessorDeclaration.symbol, 155); - return keywords; - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 125, 135); }); - } - } - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 123); - }); - }); - return keywords; - } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 88, 106, 81)) { - if (loopNode.kind === 213) { + if (loopNode.kind === 216) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 106)) { @@ -68069,8 +69382,7 @@ var ts; } } } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72, 77); } @@ -68081,13 +69393,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 215: + case 218: + case 219: + case 220: case 216: case 217: - case 213: - case 214: return getLoopBreakContinueOccurrences(owner); - case 222: + case 225: return getSwitchCaseDefaultOccurrences(owner); } } @@ -68098,8 +69410,7 @@ var ts; pushKeywordIf(keywords, switchStatement.getFirstToken(), 98); ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 73, 79); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72); } @@ -68119,33 +69430,33 @@ var ts; } return keywords; } - function getThrowOccurrences(throwStatement) { + function getThrowOccurrences(throwStatement, sourceFile) { var owner = getThrowStatementOwner(throwStatement); if (!owner) { return undefined; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100); + keywords.push(ts.findChildOfKind(throwStatement, 100, sourceFile)); }); if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96); + keywords.push(ts.findChildOfKind(returnStatement, 96, sourceFile)); }); } return keywords; } - function getReturnOccurrences(returnStatement) { + function getReturnOccurrences(returnStatement, sourceFile) { var func = ts.getContainingFunction(returnStatement); if (!func) { return undefined; } var keywords = []; ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96); + keywords.push(ts.findChildOfKind(returnStatement, 96, sourceFile)); }); ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100); + keywords.push(ts.findChildOfKind(throwStatement, 100, sourceFile)); }); return keywords; } @@ -68198,12 +69509,7 @@ var ts; return keywords; } function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 223; owner = owner.parent) { - if (owner.label.escapedText === labelName) { - return true; - } - } - return false; + return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName; }); } })(DocumentHighlights = ts.DocumentHighlights || (ts.DocumentHighlights = {})); })(ts || (ts = {})); @@ -68362,10 +69668,10 @@ var ts; } cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 182: + case 185: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 && parent.kind === 227) { + if (exportKind === 2 && parent.kind === 230) { var name = parent.name; if (name.kind === 71) { directImports.push(name); @@ -68375,19 +69681,24 @@ var ts; addIndirectUser(direct.getSourceFile()); } break; - case 238: + case 241: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1)); break; - case 239: + case 242: var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241) { + if (namedBindings && namedBindings.kind === 244) { handleNamespaceImport(direct, namedBindings.name); } + else if (ts.isDefaultImport(direct)) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(direct); + addIndirectUser(sourceFileLike); + directImports.push(direct); + } else { directImports.push(direct); } break; - case 245: + case 248: if (!direct.exportClause) { handleDirectImports(getContainingModuleSymbol(direct, checker)); } @@ -68405,7 +69716,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 269 || sourceFileLike.kind === 234); + ts.Debug.assert(sourceFileLike.kind === 272 || sourceFileLike.kind === 237); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -68454,7 +69765,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 238) { + if (decl.kind === 241) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -68467,7 +69778,7 @@ var ts; if (decl.moduleSpecifier.kind !== 9) { return; } - if (decl.kind === 245) { + if (decl.kind === 248) { searchForNamedImport(decl.exportClause); return; } @@ -68476,7 +69787,7 @@ var ts; return; } var namedBindings = importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241) { + if (namedBindings && namedBindings.kind === 244) { handleNamespaceImportLike(namedBindings.name); return; } @@ -68516,7 +69827,7 @@ var ts; } } else { - var localSymbol = element.kind === 247 && element.propertyName + var localSymbol = element.kind === 250 && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -68530,7 +69841,7 @@ var ts; function findNamespaceReExports(sourceFileLike, name, checker) { var namespaceImportSymbol = checker.getSymbolAtLocation(name); return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { - if (statement.kind !== 245) + if (statement.kind !== 248) return; var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; if (moduleSpecifier || !exportClause) @@ -68549,7 +69860,7 @@ var ts; for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { var referencingFile = sourceFiles_4[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 269) { + if (searchSourceFile.kind === 272) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -68594,7 +69905,7 @@ var ts; return map; } function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 269 ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 272 ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -68608,18 +69919,18 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 245: - case 239: { + case 248: + case 242: { var decl = statement; if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9) { action(decl, decl.moduleSpecifier); } break; } - case 238: { + case 241: { var decl = statement; var moduleReference = decl.moduleReference; - if (moduleReference.kind === 249 && + if (moduleReference.kind === 252 && moduleReference.expression.kind === 9) { action(decl, moduleReference.expression); } @@ -68632,11 +69943,11 @@ var ts; function importerFromModuleSpecifier(moduleSpecifier) { var decl = moduleSpecifier.parent; switch (decl.kind) { - case 182: - case 239: - case 245: + case 185: + case 242: + case 248: return decl; - case 249: + case 252: return decl.parent; default: ts.Debug.fail("Unexpected module specifier parent: " + decl.kind); @@ -68647,7 +69958,7 @@ var ts; function getExport() { var parent = node.parent; if (symbol.exportSymbol) { - if (parent.kind === 180) { + if (parent.kind === 183) { return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(parent.parent) ? getSpecialPropertyExport(parent.parent, false) : undefined; @@ -68684,8 +69995,7 @@ var ts; } } function getExportAssignmentExport(ex) { - var exportingModuleSymbol = ex.symbol.parent; - ts.Debug.assert(!!exportingModuleSymbol); + var exportingModuleSymbol = ts.Debug.assertDefined(ex.symbol.parent, "Expected export symbol to have a parent"); var exportKind = ex.isExportEquals ? 2 : 1; return { kind: 1, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } }; } @@ -68701,7 +70011,10 @@ var ts; default: return undefined; } - var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.cast(node.left, ts.isPropertyAccessExpression).name) : symbol; + if (sym && !(checker.getMergedSymbol(sym.parent).flags & 1536)) { + ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.showSymbol(sym) + ", parent is " + ts.Debug.showSymbol(sym.parent)); + } return sym && exportInfo(sym, kind); } } @@ -68732,22 +70045,22 @@ var ts; FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; function getExportEqualsLocalSymbol(importedSymbol, checker) { if (importedSymbol.flags & 2097152) { - return checker.getImmediateAliasedSymbol(importedSymbol); + return ts.Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol)); } var decl = importedSymbol.valueDeclaration; if (ts.isExportAssignment(decl)) { - return decl.expression.symbol; + return ts.Debug.assertDefined(decl.expression.symbol); } else if (ts.isBinaryExpression(decl)) { - return decl.right.symbol; + return ts.Debug.assertDefined(decl.right.symbol); } - ts.Debug.fail(); + return ts.Debug.fail(); } function getExportNode(parent, node) { - if (parent.kind === 227) { + if (parent.kind === 230) { var p = parent; return p.name !== node ? undefined : - p.parent.kind === 264 ? undefined : p.parent.parent.kind === 209 ? p.parent.parent : undefined; + p.parent.kind === 267 ? undefined : p.parent.parent.kind === 212 ? p.parent.parent : undefined; } else { return parent; @@ -68756,14 +70069,14 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 238: + case 241: return parent.name === node && isExternalModuleImportEquals(parent) ? { isNamedImport: false } : undefined; - case 243: + case 246: return parent.propertyName ? undefined : { isNamedImport: true }; - case 240: - case 241: + case 243: + case 244: ts.Debug.assert(parent.name === node); return { isNamedImport: false }; default: @@ -68771,7 +70084,10 @@ var ts; } } function getExportInfo(exportSymbol, exportKind, checker) { - var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); + var moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return undefined; + var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; } FindAllReferences.getExportInfo = getExportInfo; @@ -68799,22 +70115,22 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 182) { + if (node.kind === 185) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 269) { + if (parent.kind === 272) { return parent; } - ts.Debug.assert(parent.kind === 235 && isAmbientModuleDeclaration(parent.parent)); + ts.Debug.assert(parent.kind === 238 && isAmbientModuleDeclaration(parent.parent)); return parent.parent; } function isAmbientModuleDeclaration(node) { - return node.kind === 234 && node.name.kind === 9; + return node.kind === 237 && node.name.kind === 9; } function isExternalModuleImportEquals(_a) { var moduleReference = _a.moduleReference; - return moduleReference.kind === 249 && moduleReference.expression.kind === 9; + return moduleReference.kind === 252 && moduleReference.expression.kind === 9; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -68828,33 +70144,26 @@ var ts; FindAllReferences.nodeEntry = nodeEntry; function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { var referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); - if (!referencedSymbols || !referencedSymbols.length) { - return undefined; - } - var out = []; var checker = program.getTypeChecker(); - for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { - var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; - if (definition) { - out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); - } - } - return out; + return !referencedSymbols || !referencedSymbols.length ? undefined : ts.mapDefined(referencedSymbols, function (_a) { + var definition = _a.definition, references = _a.references; + return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }; + }); } FindAllReferences.findReferencedSymbols = findReferencedSymbols; function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) { var node = ts.getTouchingPropertyName(sourceFile, position, false); - var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node); + var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); var checker = program.getTypeChecker(); return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; - function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node) { - if (node.kind === 269) { + function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { + if (node.kind === 272) { return undefined; } var checker = program.getTypeChecker(); - if (node.parent.kind === 266) { + if (node.parent.kind === 269) { var result_4 = []; FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_4.push(nodeEntry(node)); }); return result_4; @@ -68864,7 +70173,7 @@ var ts; return symbol.valueDeclaration && [nodeEntry(symbol.valueDeclaration)]; } else { - return getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, { implementations: true }); + return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { implementations: true }); } } function findReferencedEntries(program, cancellationToken, sourceFiles, sourceFile, position, options) { @@ -68872,14 +70181,14 @@ var ts; return ts.map(x, toReferenceEntry); } FindAllReferences.findReferencedEntries = findReferencedEntries; - function getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options)); + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)); } FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; function findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options) { var node = ts.getTouchingPropertyName(sourceFile, position, true); - return FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options); + return FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); } function flattenEntries(referenceSymbols) { return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); @@ -68890,8 +70199,8 @@ var ts; case "symbol": { var symbol = def.symbol, node_3 = def.node; var _a = getDefinitionKindAndDisplayParts(symbol, node_3, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; - var name_5 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: node_3, name: name_5, kind: kind_1, displayParts: displayParts_1 }; + var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_3, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case "label": { var node_4 = def.node; @@ -68899,8 +70208,8 @@ var ts; } case "keyword": { var node_5 = def.node; - var name_6 = ts.tokenToString(node_5.kind); - return { node: node_5, name: name_6, kind: "keyword", displayParts: [{ text: name_6, kind: "keyword" }] }; + var name_5 = ts.tokenToString(node_5.kind); + return { node: node_5, name: name_5, kind: "keyword", displayParts: [{ text: name_5, kind: "keyword" }] }; } case "this": { var node_6 = def.node; @@ -68963,13 +70272,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, node, checker); } - else if (node.kind === 179) { + else if (node.kind === 182) { return { kind: "interface", displayParts: [ts.punctuationPart(19), ts.textPart("object literal"), ts.punctuationPart(20)] }; } - else if (node.kind === 200) { + else if (node.kind === 203) { return { kind: "local class", displayParts: [ts.punctuationPart(19), ts.textPart("anonymous local class"), ts.punctuationPart(20)] @@ -69014,10 +70323,11 @@ var ts; (function (FindAllReferences) { var Core; (function (Core) { - function getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - if (node.kind === 269) { - return undefined; + if (ts.isSourceFile(node)) { + var reference = ts.GoToDefinition.getReferenceAtPosition(node, position, program); + return reference && getReferencedSymbolsForModule(program, program.getTypeChecker().getMergedSymbol(reference.file.symbol), sourceFiles); } if (!options.implementations) { var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); @@ -69028,10 +70338,7 @@ var ts; var checker = program.getTypeChecker(); var symbol = checker.getSymbolAtLocation(node); if (!symbol) { - if (!options.implementations && node.kind === 9) { - return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); - } - return undefined; + return !options.implementations && ts.isStringLiteral(node) ? getReferencesForStringLiteral(node, sourceFiles, cancellationToken) : undefined; } if (symbol.flags & 1536 && isModuleReferenceLocation(node)) { return getReferencedSymbolsForModule(program, symbol, sourceFiles); @@ -69040,16 +70347,16 @@ var ts; } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; function isModuleReferenceLocation(node) { - if (node.kind !== 9) { + if (!ts.isStringLiteralLike(node)) { return false; } switch (node.parent.kind) { - case 234: - case 249: - case 239: - case 245: + case 237: + case 252: + case 242: + case 248: return true; - case 182: + case 185: return ts.isRequireCall(node.parent, false) || ts.isImportCall(node.parent); default: return false; @@ -69072,9 +70379,9 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 269: + case 272: break; - case 234: + case 237: references.push({ type: "node", node: decl.name }); break; default: @@ -69108,13 +70415,13 @@ var ts; return undefined; } function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { - symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); var result = []; - var state = new State(sourceFiles, node.kind === 123, checker, cancellationToken, searchMeaning, options, result); + var state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result); if (node.kind === 79) { addReference(node, symbol, node, state); - searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: 1 }, state); + searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 }, state); } else { var search = state.createSearch(node, symbol, undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); @@ -69132,7 +70439,20 @@ var ts; } return result; } - function skipPastExportOrImportSpecifier(symbol, node, checker) { + function getSpecialSearchKind(node) { + switch (node.kind) { + case 123: + return 1; + case 71: + if (ts.isClassLike(node.parent)) { + ts.Debug.assert(node.parent.name === node); + return 2; + } + default: + return 0; + } + } + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { var parent = node.parent; if (ts.isExportSpecifier(parent)) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); @@ -69140,12 +70460,26 @@ var ts; if (ts.isImportSpecifier(parent) && parent.propertyName === node) { return checker.getImmediateAliasedSymbol(symbol); } - return symbol; + return ts.firstDefined(symbol.declarations, function (decl) { + if (!decl.parent) { + ts.Debug.assert(decl.kind === 272); + ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); + } + return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent) + ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) + : undefined; + }); } + var SpecialSearchKind; + (function (SpecialSearchKind) { + SpecialSearchKind[SpecialSearchKind["None"] = 0] = "None"; + SpecialSearchKind[SpecialSearchKind["Constructor"] = 1] = "Constructor"; + SpecialSearchKind[SpecialSearchKind["Class"] = 2] = "Class"; + })(SpecialSearchKind || (SpecialSearchKind = {})); var State = (function () { - function State(sourceFiles, isForConstructor, checker, cancellationToken, searchMeaning, options, result) { + function State(sourceFiles, specialSearchKind, checker, cancellationToken, searchMeaning, options, result) { this.sourceFiles = sourceFiles; - this.isForConstructor = isForConstructor; + this.specialSearchKind = specialSearchKind; this.checker = checker; this.cancellationToken = cancellationToken; this.searchMeaning = searchMeaning; @@ -69244,9 +70578,9 @@ var ts; checker.getPropertySymbolOfDestructuringAssignment(location); } function getObjectBindingElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 177); + var bindingElement = ts.getDeclarationOfKind(symbol, 180); if (bindingElement && - bindingElement.parent.kind === 175 && + bindingElement.parent.kind === 178 && !bindingElement.propertyName) { return bindingElement; } @@ -69265,7 +70599,7 @@ var ts; } function getSymbolScope(symbol) { var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 187 || valueDeclaration.kind === 200)) { + if (valueDeclaration && (valueDeclaration.kind === 190 || valueDeclaration.kind === 203)) { return valueDeclaration; } if (!declarations) { @@ -69274,7 +70608,7 @@ var ts; if (flags & (4 | 8192)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 230); + return ts.getAncestor(privateDeclaration, 233); } return undefined; } @@ -69292,7 +70626,7 @@ var ts; if (scope && scope !== container) { return undefined; } - if (!container || container.kind === 269 && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 272 && !ts.isExternalOrCommonJsModule(container)) { return undefined; } scope = container; @@ -69411,11 +70745,18 @@ var ts; getReferenceForShorthandProperty(referenceSymbol, search, state); return; } - if (state.isForConstructor) { - findConstructorReferences(referenceLocation, sourceFile, search, state); - } - else { - addReference(referenceLocation, relatedSymbol, search.location, state); + switch (state.specialSearchKind) { + case 0: + addReference(referenceLocation, relatedSymbol, search.location, state); + break; + case 1: + addConstructorReferences(referenceLocation, sourceFile, search, state); + break; + case 2: + addClassStaticThisReferences(referenceLocation, search, state); + break; + default: + ts.Debug.assertNever(state.specialSearchKind); } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } @@ -69449,14 +70790,16 @@ var ts; searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); } if (search.comingFrom !== 1 && exportDeclaration.moduleSpecifier && !propertyName) { - searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); } function addRef() { addReference(referenceLocation, localSymbol, search.location, state); } } function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; } function isExportSpecifierAlias(referenceLocation, exportSpecifier) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; @@ -69498,22 +70841,45 @@ var ts; addRef(referenceLocation); } } - function findConstructorReferences(referenceLocation, sourceFile, search, state) { + function addConstructorReferences(referenceLocation, sourceFile, search, state) { if (ts.isNewExpressionTarget(referenceLocation)) { addReference(referenceLocation, search.symbol, search.location, state); } - var pusher = state.referenceAdder(search.symbol, search.location); + var pusher = function () { return state.referenceAdder(search.symbol, search.location); }; if (ts.isClassLike(referenceLocation.parent)) { - ts.Debug.assert(referenceLocation.parent.name === referenceLocation); - findOwnConstructorReferences(search.symbol, sourceFile, pusher); + ts.Debug.assert(referenceLocation.kind === 79 || referenceLocation.parent.name === referenceLocation); + findOwnConstructorReferences(search.symbol, sourceFile, pusher()); } else { var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending)) { - findSuperConstructorAccesses(classExtending, pusher); + if (classExtending) { + findSuperConstructorAccesses(classExtending, pusher()); } } } + function addClassStaticThisReferences(referenceLocation, search, state) { + addReference(referenceLocation, search.symbol, search.location, state); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location)); + } + } + function addStaticThisReferences(classLike, pusher) { + for (var _i = 0, _a = classLike.members; _i < _a.length; _i++) { + var member = _a[_i]; + if (!(ts.isMethodOrAccessor(member) && ts.hasModifier(member, 32))) { + continue; + } + member.body.forEachChild(function cb(node) { + if (node.kind === 99) { + pusher(node); + } + else if (!ts.isFunctionLike(node)) { + node.forEachChild(cb); + } + }); + } + } function getPropertyAccessExpressionFromRightHandSide(node) { return ts.isRightSideOfPropertyAccess(node) && node.parent; } @@ -69521,12 +70887,12 @@ var ts; for (var _i = 0, _a = classSymbol.members.get("__constructor").declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 123, sourceFile); - ts.Debug.assert(decl.kind === 153 && !!ctrKeyword); + ts.Debug.assert(decl.kind === 154 && !!ctrKeyword); addNode(ctrKeyword); } classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 152) { + if (decl && decl.kind === 153) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 99, function (thisKeyword) { @@ -69546,7 +70912,7 @@ var ts; } for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 153); + ts.Debug.assert(decl.kind === 154); var body = decl.body; if (body) { forEachDescendantOfKind(body, 97, function (node) { @@ -69565,7 +70931,7 @@ var ts; if (refNode.kind !== 71) { return; } - if (refNode.parent.kind === 266) { + if (refNode.parent.kind === 269) { getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } var containingClass = getContainingClassIfInHeritageClause(refNode); @@ -69576,12 +70942,12 @@ var ts; var containingTypeReference = getContainingTypeReference(refNode); if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { var parent = containingTypeReference.parent; - if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + if (ts.hasType(parent) && parent.type === containingTypeReference && ts.hasInitializer(parent) && isImplementationExpression(parent.initializer)) { addReference(parent.initializer); } else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { var body = parent.body; - if (body.kind === 208) { + if (body.kind === 211) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { addReference(returnStatement.expression); @@ -69622,12 +70988,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 202 - && node.parent.kind === 263 + if (node.kind === 205 + && node.parent.kind === 266 && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 71 || node.kind === 180) { + else if (node.kind === 71 || node.kind === 183) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -69635,13 +71001,13 @@ var ts; } function isImplementationExpression(node) { switch (node.kind) { - case 186: + case 189: return isImplementationExpression(node.expression); - case 188: - case 187: - case 179: - case 200: - case 178: + case 191: + case 190: + case 182: + case 203: + case 181: return true; default: return false; @@ -69675,7 +71041,7 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 231) { + else if (declaration.kind === 234) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } @@ -69702,13 +71068,13 @@ var ts; } var staticFlag = 32; switch (searchSpaceNode.kind) { - case 150: - case 149: - case 152: case 151: + case 150: case 153: + case 152: case 154: case 155: + case 156: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; @@ -69735,81 +71101,81 @@ var ts; var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); var staticFlag = 32; switch (searchSpaceNode.kind) { + case 153: case 152: - case 151: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } + case 151: case 150: - case 149: - case 153: case 154: case 155: + case 156: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; break; - case 269: + case 272: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } - case 229: - case 187: + case 232: + case 190: break; default: return undefined; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 269) { + if (searchSpaceNode.kind === 272) { ts.forEach(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this"); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, staticFlag, references); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, references); } return [{ definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - var node = ts.getTouchingWord(sourceFile, position, false); - if (!node || !ts.isThis(node)) { - return; - } - var container = ts.getThisContainer(node, false); - switch (searchSpaceNode.kind) { - case 187: - case 229: - if (searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 152: - case 151: - if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 200: - case 230: - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32) === staticFlag) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 269: - if (container.kind === 269 && !ts.isExternalModule(container)) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - } - }); - } + } + function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, result) { + ts.forEach(possiblePositions, function (position) { + var node = ts.getTouchingWord(sourceFile, position, false); + if (!node || !ts.isThis(node)) { + return; + } + var container = ts.getThisContainer(node, false); + switch (searchSpaceNode.kind) { + case 190: + case 232: + if (searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 153: + case 152: + if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 203: + case 233: + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32) === staticFlag) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 272: + if (container.kind === 272 && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + } + }); } function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; @@ -69834,18 +71200,19 @@ var ts; } } function populateSearchSymbolSet(symbol, location, checker, implementations) { - var result = [symbol]; + var result = []; var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { - if (containingObjectLiteralElement.kind !== 266) { + if (containingObjectLiteralElement.kind !== 269) { var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); if (propertySymbol) { result.push(propertySymbol); } } - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - ts.addRange(result, checker.getRootSymbols(contextualSymbol)); - }); + for (var _i = 0, _a = getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker); _i < _a.length; _i++) { + var contextualSymbol = _a[_i]; + addRootSymbols(contextualSymbol); + } var shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); if (shorthandValueSymbol) { result.push(shorthandValueSymbol); @@ -69862,9 +71229,7 @@ var ts; function addRootSymbols(sym) { for (var _i = 0, _a = checker.getRootSymbols(sym); _i < _a.length; _i++) { var rootSymbol = _a[_i]; - if (rootSymbol !== sym) { - result.push(rootSymbol); - } + result.push(rootSymbol); if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, ts.createSymbolTable(), checker); } @@ -69889,7 +71254,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 231) { + else if (declaration.kind === 234) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -69923,9 +71288,7 @@ var ts; } var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - return ts.find(checker.getRootSymbols(contextualSymbol), search.includes); - }); + var contextualSymbol = ts.firstDefined(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), findRootSymbol); if (contextualSymbol) { return contextualSymbol; } @@ -69942,16 +71305,16 @@ var ts; } return findRootSymbol(referenceSymbol); function findRootSymbol(sym) { - return ts.forEach(state.checker.getRootSymbols(sym), function (rootSymbol) { + return ts.firstDefined(checker.getRootSymbols(sym), function (rootSymbol) { if (search.includes(rootSymbol)) { return rootSymbol; } if (rootSymbol.parent && rootSymbol.parent.flags & (32 | 64)) { - if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, checker); })) { return undefined; } var result = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, ts.createSymbolTable(), state.checker); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, ts.createSymbolTable(), checker); return ts.find(result, search.includes); } return undefined; @@ -69959,7 +71322,7 @@ var ts; } } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 145) { + if (node.name.kind === 146) { var nameExpression = node.name.expression; if (ts.isStringOrNumericLiteral(nameExpression)) { return nameExpression.text; @@ -69969,26 +71332,11 @@ var ts; return ts.getTextOfIdentifierOrLiteral(node.name); } function getPropertySymbolsFromContextualType(node, checker) { - var objectLiteral = node.parent; - var contextualType = checker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(node.parent); var name = getNameFromObjectLiteralElement(node); - if (name && contextualType) { - var result_5 = []; - var symbol = contextualType.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - if (contextualType.flags & 131072) { - ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - }); - } - return result_5; - } - return undefined; + var symbol = contextualType && name && contextualType.getProperty(name); + return symbol ? [symbol] : + contextualType && contextualType.flags & 131072 ? ts.mapDefined(contextualType.types, function (t) { return t.getProperty(name); }) : ts.emptyArray; } function getIntersectingMeaningFromDeclarations(meaning, declarations) { if (declarations) { @@ -70010,32 +71358,30 @@ var ts; if (!node) { return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 227) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2); - } + else if (ts.isVariableLike(node) && ts.hasInitializer(node)) { + return true; + } + else if (node.kind === 230) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2); } else if (ts.isFunctionLike(node)) { return !!node.body || ts.hasModifier(node, 2); } else { switch (node.kind) { - case 230: - case 200: case 233: - case 234: + case 203: + case 236: + case 237: return true; } } return false; } function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 209) { - ts.Debug.assert(node.parent.kind === 228); + if (node.parent && node.parent.parent && node.parent.parent.kind === 212) { + ts.Debug.assert(node.parent.kind === 231); return node.parent.parent; } } @@ -70093,18 +71439,9 @@ var ts; var GoToDefinition; (function (GoToDefinition) { function getDefinitionAtPosition(program, sourceFile, position) { - var comment = findReferenceInPosition(sourceFile.referencedFiles, position); - if (comment) { - var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); - if (referenceFile) { - return [getDefinitionInfoForFileReference(comment.fileName, referenceFile.fileName)]; - } - } - var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); - if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); - return referenceFile && referenceFile.resolvedFileName && - [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; + var reference = getReferenceAtPosition(sourceFile, position, program); + if (reference) { + return [getDefinitionInfoForFileReference(reference.fileName, reference.file.fileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position, true); if (node === sourceFile) { @@ -70130,7 +71467,7 @@ var ts; symbol = aliased; } } - if (node.parent.kind === 266) { + if (node.parent.kind === 269) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -70160,32 +71497,35 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; + function getReferenceAtPosition(sourceFile, position, program) { + var referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); + if (referencePath) { + var file = ts.tryResolveScriptReference(program, sourceFile, referencePath); + return file && { fileName: referencePath.fileName, file: file }; + } + var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); + if (typeReferenceDirective) { + var reference = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + var file = reference && program.getSourceFile(reference.resolvedFileName); + return file && { fileName: typeReferenceDirective.fileName, file: file }; + } + return undefined; + } + GoToDefinition.getReferenceAtPosition = getReferenceAtPosition; function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) { var node = ts.getTouchingPropertyName(sourceFile, position, true); if (node === sourceFile) { return undefined; } var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - return undefined; - } - var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + var type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node); if (!type) { return undefined; } if (type.flags & 131072 && !(type.flags & 16)) { - var result_6 = []; - ts.forEach(type.types, function (t) { - if (t.symbol) { - ts.addRange(result_6, getDefinitionFromSymbol(typeChecker, t.symbol, node)); - } - }); - return result_6; + return ts.flatMap(type.types, function (t) { return t.symbol && getDefinitionFromSymbol(typeChecker, t.symbol, node); }); } - if (!type.symbol) { - return undefined; - } - return getDefinitionFromSymbol(typeChecker, type.symbol, node); + return type.symbol && getDefinitionFromSymbol(typeChecker, type.symbol, node); } GoToDefinition.getTypeDefinitionAtPosition = getTypeDefinitionAtPosition; function getDefinitionAndBoundSpan(program, sourceFile, position) { @@ -70195,10 +71535,7 @@ var ts; } var comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (comment) { - return { - definitions: definitions, - textSpan: ts.createTextSpanFromBounds(comment.pos, comment.end) - }; + return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) }; } var node = ts.getTouchingPropertyName(sourceFile, position, true); var textSpan = ts.createTextSpan(node.getStart(), node.getWidth()); @@ -70213,73 +71550,46 @@ var ts; return true; } switch (declaration.kind) { - case 240: - case 238: - return true; case 243: - return declaration.parent.kind === 242; + case 241: + return true; + case 246: + return declaration.parent.kind === 245; default: return false; } } function getDefinitionFromSymbol(typeChecker, symbol, node) { - var result = []; - var declarations = symbol.getDeclarations(); var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); - } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (ts.isNewExpressionTarget(location) || location.kind === 123) { - if (symbol.flags & 32) { - for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.isClassLike(declaration)) { - return tryAddSignature(declaration.members, true, symbolKind, symbolName, containerName, result); - } - } - ts.Debug.fail("Expected declaration to have at least one class-like declaration"); - } + return getConstructSignatureDefinition() || getCallSignatureDefinition() || ts.map(symbol.declarations, function (declaration) { return createDefinitionInfo(declaration, symbolKind, symbolName, containerName); }); + function getConstructSignatureDefinition() { + if (symbol.flags & 32 && (ts.isNewExpressionTarget(node) || node.kind === 123)) { + var cls = ts.find(symbol.declarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); + return getSignatureDefinition(cls.members, true); } - return false; } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location) || ts.isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); - } - return false; + function getCallSignatureDefinition() { + return ts.isCallExpressionTarget(node) || ts.isNewExpressionTarget(node) || ts.isNameOfFunctionDeclaration(node) + ? getSignatureDefinition(symbol.declarations, false) + : undefined; } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + function getSignatureDefinition(signatureDeclarations, selectConstructors) { if (!signatureDeclarations) { - return false; + return undefined; } - var declarations = []; - var definition; - for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { - var d = signatureDeclarations_1[_i]; - if (selectConstructors ? d.kind === 153 : isSignatureDeclaration(d)) { - declarations.push(d); - if (d.body) - definition = d; - } - } - if (declarations.length) { - result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); - return true; - } - return false; + var declarations = signatureDeclarations.filter(selectConstructors ? ts.isConstructorDeclaration : isSignatureDeclaration); + return declarations.length + ? [createDefinitionInfo(ts.find(declarations, function (d) { return !!d.body; }) || ts.last(declarations), symbolKind, symbolName, containerName)] + : undefined; } } function isSignatureDeclaration(node) { switch (node.kind) { + case 154: + case 158: + case 232: case 153: - case 229: case 152: - case 151: return true; default: return false; @@ -70319,6 +71629,7 @@ var ts; } return undefined; } + GoToDefinition.findReferenceInPosition = findReferenceInPosition; function getDefinitionInfoForFileReference(name, targetFileName) { return { fileName: targetFileName, @@ -70354,7 +71665,6 @@ var ts; (function (ts) { var JsDoc; (function (JsDoc) { - var singleLineTemplate = { newText: "/** */", caretOffset: 3 }; var jsDocTagNames = [ "augments", "author", @@ -70392,6 +71702,7 @@ var ts; "see", "since", "static", + "template", "throws", "type", "typedef", @@ -70402,18 +71713,29 @@ var ts; function getJsDocCommentsFromDeclarations(declarations) { var documentationComment = []; forEachUnique(declarations, function (declaration) { - ts.forEach(ts.getAllJSDocs(declaration), function (doc) { - if (doc.comment) { - if (documentationComment.length) { - documentationComment.push(ts.lineBreakPart()); - } - documentationComment.push(ts.textPart(doc.comment)); + for (var _i = 0, _a = getCommentHavingNodes(declaration); _i < _a.length; _i++) { + var comment = _a[_i].comment; + if (comment === undefined) + continue; + if (documentationComment.length) { + documentationComment.push(ts.lineBreakPart()); } - }); + documentationComment.push(ts.textPart(comment)); + } }); return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getCommentHavingNodes(declaration) { + switch (declaration.kind) { + case 292: + return [declaration]; + case 291: + return [declaration.parent]; + default: + return ts.getJSDocCommentsAndTags(declaration); + } + } function getJsDocTagsFromDeclarations(declarations) { var tags = []; forEachUnique(declarations, function (declaration) { @@ -70428,31 +71750,34 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 282: + case 285: return withNode(tag.class); - case 287: + case 290: return withList(tag.typeParameters); - case 286: - return withNode(tag.typeExpression); - case 288: case 289: - case 284: + return withNode(tag.typeExpression); + case 291: + case 292: + case 287: var name = tag.name; return name ? withNode(name) : comment; default: return comment; } function withNode(node) { - return node.getText() + " " + comment; + return addComment(node.getText()); } function withList(list) { - return list.map(function (x) { return x.getText(); }) + " " + comment; + return addComment(list.map(function (x) { return x.getText(); }).join(", ")); + } + function addComment(s) { + return comment === undefined ? s : s + " " + comment; } } function forEachUnique(array, callback) { if (array) { for (var i = 0; i < array.length; i++) { - if (ts.indexOf(array, array[i]) === i) { + if (array.indexOf(array[i]) === i) { var result = callback(array[i], i); if (result) { return result; @@ -70541,25 +71866,31 @@ var ts; } var commentOwnerInfo = getCommentOwnerInfo(tokenAtPos); if (!commentOwnerInfo) { - return singleLineTemplate; - } - var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; - if (commentOwner.kind === 10) { return undefined; } - if (commentOwner.getStart() < position || parameters.length === 0) { - return singleLineTemplate; + var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; + if (commentOwner.getStart() < position) { + return undefined; + } + if (!parameters || parameters.length === 0) { + var singleLineResult = "/** */"; + return { newText: singleLineResult, caretOffset: 3 }; } var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); - var docParams = parameters.map(function (_a, i) { - var name = _a.name; - var nameText = ts.isIdentifier(name) ? name.text : "param" + i; - var type = isJavaScriptFile ? "{any} " : ""; - return indentationStr + " * @param " + type + nameText + newLine; - }).join(""); + var docParams = ""; + for (var i = 0; i < parameters.length; i++) { + var currentName = parameters[i].name; + var paramName = currentName.kind === 71 ? currentName.escapedText : "param" + i; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } + } var preamble = "/**" + newLine + indentationStr + " * "; var result = preamble + newLine + @@ -70572,23 +71903,32 @@ var ts; function getCommentOwnerInfo(tokenAtPos) { for (var commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 229: - case 152: + case 232: case 153: - case 151: + case 154: + case 152: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 209: { + case 233: + case 234: + case 150: + case 236: + case 271: + case 235: + return { commentOwner: commentOwner }; + case 212: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer) : undefined; - return parameters_1 ? { commentOwner: commentOwner, parameters: parameters_1 } : undefined; + return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 269: + case 272: return undefined; - case 195: { + case 237: + return commentOwner.parent.kind === 237 ? undefined : { commentOwner: commentOwner }; + case 198: { var be = commentOwner; if (ts.getSpecialPropertyAssignmentKind(be) === 0) { return undefined; @@ -70596,25 +71936,21 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 10: { - var parameters_3 = ts.emptyArray; - return { commentOwner: commentOwner, parameters: parameters_3 }; - } } } } function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 186) { + while (rightHandSide.kind === 189) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 187: - case 188: + case 190: + case 191: return rightHandSide.parameters; - case 200: + case 203: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153) { + if (member.kind === 154) { return member.parameters; } } @@ -70625,9 +71961,70 @@ var ts; })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); var ts; +(function (ts) { + function stringToInt(str) { + var n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error("Error in parseInt(" + JSON.stringify(str) + ")"); + } + return n; + } + var isPrereleaseRegex = /^(.*)-next.\d+/; + var prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + var semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + var Semver = (function () { + function Semver(major, minor, patch, isPrerelease) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.isPrerelease = isPrerelease; + } + Semver.parse = function (semver) { + var isPrerelease = isPrereleaseRegex.test(semver); + var result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error("Unexpected semver: " + semver + " (isPrerelease: " + isPrerelease + ")"); + } + return result; + }; + Semver.fromRaw = function (_a) { + var major = _a.major, minor = _a.minor, patch = _a.patch, isPrerelease = _a.isPrerelease; + return new Semver(major, minor, patch, isPrerelease); + }; + Semver.tryParse = function (semver, isPrerelease) { + var rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; + var match = rgx.exec(semver); + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; + }; + Object.defineProperty(Semver.prototype, "versionString", { + get: function () { + return this.isPrerelease ? this.major + "." + this.minor + ".0-next." + this.patch : this.major + "." + this.minor + "." + this.patch; + }, + enumerable: true, + configurable: true + }); + Semver.prototype.equals = function (sem) { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + }; + Semver.prototype.greaterThan = function (sem) { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); + }; + return Semver; + }()); + ts.Semver = Semver; +})(ts || (ts = {})); +var ts; (function (ts) { var JsTyping; (function (JsTyping) { + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = ts.Semver.parse(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest")); + return !availableVersion.greaterThan(cachedTyping.version); + } + JsTyping.isTypingUpToDate = isTypingUpToDate; JsTyping.nodeCoreModuleList = [ "buffer", "querystring", "events", "http", "cluster", "zlib", "os", "https", "punycode", "repl", "readline", @@ -70650,7 +72047,7 @@ var ts; return undefined; } JsTyping.loadTypesMap = loadTypesMap; - function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; } @@ -70682,9 +72079,9 @@ var ts; var module_1 = ts.deduplicate(unresolvedImports.map(function (moduleId) { return nodeCoreModules.has(moduleId) ? "node" : moduleId; }), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); addInferredTypings(module_1, "Inferred typings from unresolved imports"); } - packageNameToTypingLocation.forEach(function (typingLocation, name) { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); + packageNameToTypingLocation.forEach(function (typing, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { + inferredTypings.set(name, typing.typingLocation); } }); for (var _i = 0, exclude_1 = exclude; _i < exclude_1.length; _i++) { @@ -70760,8 +72157,8 @@ var ts; if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } - var result_7 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - var packageJson = result_7.config; + var result_5 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + var packageJson = result_5.config; if (baseFileName === "package.json" && packageJson._requiredBy && ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { continue; @@ -70891,9 +72288,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 240: case 243: - case 238: + case 246: + case 241: var importer = checker.getSymbolAtLocation(declaration.name); var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -70903,8 +72300,8 @@ var ts; } function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); - for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { - var match = matches_2[_i]; + for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { + var match = matches_1[_i]; if (!match.isCaseSensitive) { return false; } @@ -70919,7 +72316,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (name.kind === 145) { + else if (name.kind === 146) { return tryAddComputedPropertyName(name.expression, containers, true); } else { @@ -70937,7 +72334,7 @@ var ts; } return true; } - if (expression.kind === 180) { + if (expression.kind === 183) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -70949,7 +72346,7 @@ var ts; function getContainers(declaration) { var containers = []; var name = ts.getNameOfDeclaration(declaration); - if (name.kind === 145) { + if (name.kind === 146) { if (!tryAddComputedPropertyName(name.expression, containers, false)) { return undefined; } @@ -70966,8 +72363,8 @@ var ts; function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); var bestMatchKind = ts.PatternMatchKind.camelCase; - for (var _i = 0, matches_3 = matches; _i < matches_3.length; _i++) { - var match = matches_3[_i]; + for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { + var match = matches_2[_i]; var kind = match.kind; if (kind < bestMatchKind) { bestMatchKind = kind; @@ -71098,7 +72495,7 @@ var ts; return; } switch (node.kind) { - case 153: + case 154: var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) { @@ -71108,28 +72505,28 @@ var ts; } } break; - case 152: - case 154: + case 153: case 155: - case 151: + case 156: + case 152: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; + case 151: case 150: - case 149: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 240: + case 243: var importClause = node; if (importClause.name) { addLeafNode(importClause); } var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 241) { + if (namedBindings.kind === 244) { addLeafNode(namedBindings); } else { @@ -71140,8 +72537,8 @@ var ts; } } break; - case 177: - case 227: + case 180: + case 230: var _d = node, name = _d.name, initializer = _d.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -71160,12 +72557,12 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 188: - case 229: - case 187: + case 191: + case 232: + case 190: addNodeWithRecursiveChild(node, node.body); break; - case 233: + case 236: startNode(node); for (var _e = 0, _f = node.members; _e < _f.length; _e++) { var member = _f[_e]; @@ -71175,9 +72572,9 @@ var ts; } endNode(); break; - case 230: - case 200: - case 231: + case 233: + case 203: + case 234: startNode(node); for (var _g = 0, _h = node.members; _g < _h.length; _g++) { var member = _h[_g]; @@ -71185,18 +72582,18 @@ var ts; } endNode(); break; - case 234: + case 237: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 247: - case 238: - case 158: - case 156: + case 250: + case 241: + case 159: case 157: - case 232: + case 158: + case 235: addLeafNode(node); break; - case 195: { + case 198: { var special = ts.getSpecialPropertyAssignmentKind(node); switch (special) { case 1: @@ -71216,7 +72613,7 @@ var ts; if (ts.hasJSDocNodes(node)) { ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 288) { + if (tag.kind === 291) { addLeafNode(tag); } }); @@ -71270,19 +72667,19 @@ var ts; return false; } switch (a.kind) { - case 150: - case 152: - case 154: + case 151: + case 153: case 155: + case 156: return ts.hasModifier(a, 32) === ts.hasModifier(b, 32); - case 234: + case 237: return areSameModule(a, b); default: return true; } } function areSameModule(a, b) { - return a.body.kind === b.body.kind && (a.body.kind !== 234 || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 237 || areSameModule(a.body, b.body)); } function merge(target, source) { target.additionalNodes = target.additionalNodes || []; @@ -71305,7 +72702,7 @@ var ts; || ts.compareValues(navigationBarNodeKind(child1), navigationBarNodeKind(child2)); } function tryGetName(node) { - if (node.kind === 234) { + if (node.kind === 237) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -71313,18 +72710,18 @@ var ts; return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName)); } switch (node.kind) { - case 187: - case 188: - case 200: + case 190: + case 191: + case 203: return getFunctionOrClassName(node); - case 288: + case 291: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 234) { + if (node.kind === 237) { return getModuleName(node); } var name = ts.getNameOfDeclaration(node); @@ -71335,29 +72732,29 @@ var ts; } } switch (node.kind) { - case 269: + case 272: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 188: - case 229: - case 187: - case 230: - case 200: + case 191: + case 232: + case 190: + case 233: + case 203: if (ts.getModifierFlags(node) & 512) { return "default"; } return getFunctionOrClassName(node); - case 153: + case 154: return "constructor"; - case 157: - return "new()"; - case 156: - return "()"; case 158: + return "new()"; + case 157: + return "()"; + case 159: return "[]"; - case 288: + case 291: return getJSDocTypedefTagName(node); default: return ""; @@ -71369,7 +72766,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 209) { + if (parentNode && parentNode.kind === 212) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 71) { @@ -71397,24 +72794,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 230: - case 200: case 233: - case 231: + case 203: + case 236: case 234: - case 269: - case 232: - case 288: + case 237: + case 272: + case 235: + case 291: return true; - case 153: - case 152: case 154: + case 153: case 155: - case 227: + case 156: + case 230: return hasSomeImportantChild(item); - case 188: - case 229: - case 187: + case 191: + case 232: + case 190: return isTopLevelFunctionDeclaration(item); default: return false; @@ -71424,10 +72821,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 235: - case 269: - case 152: + case 238: + case 272: case 153: + case 154: return true; default: return hasSomeImportantChild(item); @@ -71436,7 +72833,7 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 227 && childKind !== 177; + return childKind !== 230 && childKind !== 180; }); } } @@ -71490,25 +72887,23 @@ var ts; } var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 234) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 237) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } return result.join("."); } function getInteriorModule(decl) { - return decl.body.kind === 234 ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 237 ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 145; + return !member.name || member.name.kind === 146; } function getNodeSpan(node) { - return node.kind === 269 - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 272 ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 227) { + if (node.parent && node.parent.kind === 230) { node = node.parent; } return ts.getNodeModifiers(node); @@ -71517,14 +72912,14 @@ var ts; if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 227) { + else if (node.parent.kind === 230) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 195 && + else if (node.parent.kind === 198 && node.parent.operatorToken.kind === 58) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 265 && node.parent.name) { + else if (node.parent.kind === 268 && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512) { @@ -71536,9 +72931,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 188: - case 187: - case 200: + case 191: + case 190: + case 203: return true; default: return false; @@ -71547,6 +72942,147 @@ var ts; })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var OrganizeImports; + (function (OrganizeImports) { + function organizeImports(sourceFile, formatContext, host) { + var oldImportDecls = sourceFile.statements.filter(ts.isImportDeclaration); + if (oldImportDecls.length === 0) { + return []; + } + var oldImportGroups = ts.group(oldImportDecls, function (importDecl) { return getExternalModuleName(importDecl.moduleSpecifier); }); + var sortedImportGroups = ts.stableSort(oldImportGroups, function (group1, group2) { + return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); + }); + var newImportDecls = ts.flatMap(sortedImportGroups, function (importGroup) { + return getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup)) + : importGroup; + }); + var changeTracker = ts.textChanges.ChangeTracker.fromContext({ host: host, formatContext: formatContext }); + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: ts.getNewLineOrDefaultFromHost(host, formatContext.options), + }); + } + for (var i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + return changeTracker.getChanges(); + } + OrganizeImports.organizeImports = organizeImports; + function removeUnusedImports(oldImports) { + return oldImports; + } + function getExternalModuleName(specifier) { + return ts.isStringLiteral(specifier) || ts.isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + function coalesceImports(importGroup) { + if (importGroup.length === 0) { + return importGroup; + } + var _a = getImportParts(importGroup), importWithoutClause = _a.importWithoutClause, defaultImports = _a.defaultImports, namespaceImports = _a.namespaceImports, namedImports = _a.namedImports; + var coalescedImports = []; + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + var defaultImportClause = defaultImports[0].parent; + coalescedImports.push(updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + return coalescedImports; + } + var sortedNamespaceImports = ts.stableSort(namespaceImports, function (n1, n2) { return compareIdentifiers(n1.name, n2.name); }); + for (var _i = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _i < sortedNamespaceImports_1.length; _i++) { + var namespaceImport = sortedNamespaceImports_1[_i]; + coalescedImports.push(updateImportDeclarationAndClause(namespaceImport.parent, undefined, namespaceImport)); + } + if (defaultImports.length === 0 && namedImports.length === 0) { + return coalescedImports; + } + var newDefaultImport; + var newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (var _b = 0, defaultImports_1 = defaultImports; _b < defaultImports_1.length; _b++) { + var defaultImport = defaultImports_1[_b]; + newImportSpecifiers.push(ts.createImportSpecifier(ts.createIdentifier("default"), defaultImport)); + } + } + newImportSpecifiers.push.apply(newImportSpecifiers, ts.flatMap(namedImports, function (n) { return n.elements; })); + var sortedImportSpecifiers = ts.stableSort(newImportSpecifiers, function (s1, s2) { + return compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name); + }); + var importClause = defaultImports.length > 0 + ? defaultImports[0].parent + : namedImports[0].parent; + var newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? ts.createNamedImports(sortedImportSpecifiers) + : ts.updateNamedImports(namedImports[0], sortedImportSpecifiers); + coalescedImports.push(updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + return coalescedImports; + function getImportParts(importGroup) { + var importWithoutClause; + var defaultImports = []; + var namespaceImports = []; + var namedImports = []; + for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) { + var importDeclaration = importGroup_1[_i]; + if (importDeclaration.importClause === undefined) { + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + var _a = importDeclaration.importClause, name = _a.name, namedBindings = _a.namedBindings; + if (name) { + defaultImports.push(name); + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + namespaceImports.push(namedBindings); + } + else { + namedImports.push(namedBindings); + } + } + } + return { + importWithoutClause: importWithoutClause, + defaultImports: defaultImports, + namespaceImports: namespaceImports, + namedImports: namedImports, + }; + } + function compareIdentifiers(s1, s2) { + return ts.compareStringsCaseSensitive(s1.text, s2.text); + } + function updateImportDeclarationAndClause(importClause, name, namedBindings) { + var importDeclaration = importClause.parent; + return ts.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.updateImportClause(importClause, name, namedBindings), importDeclaration.moduleSpecifier); + } + } + OrganizeImports.coalesceImports = coalesceImports; + function compareModuleSpecifiers(m1, m2) { + var name1 = getExternalModuleName(m1); + var name2 = getExternalModuleName(m2); + return ts.compareBooleans(name1 === undefined, name2 === undefined) || + ts.compareBooleans(ts.isExternalModuleNameRelative(name1), ts.isExternalModuleNameRelative(name2)) || + ts.compareStringsCaseSensitive(name1, name2); + } + OrganizeImports.compareModuleSpecifiers = compareModuleSpecifiers; + })(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { @@ -71638,21 +73174,21 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 208: + case 211: if (ts.isFunctionBlock(n)) { - return spanForNode(n.parent, n.parent.kind !== 188); + return spanForNode(n.parent, n.parent.kind !== 191); } switch (n.parent.kind) { - case 213: case 216: - case 217: + case 219: + case 220: + case 218: case 215: - case 212: - case 214: - case 221: - case 264: + case 217: + case 224: + case 267: return spanForNode(n.parent); - case 225: + case 228: var tryStatement = n.parent; if (tryStatement.tryBlock === n) { return spanForNode(n.parent); @@ -71663,16 +73199,16 @@ var ts; default: return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile)); } - case 235: + case 238: return spanForNode(n.parent); - case 230: - case 231: case 233: + case 234: case 236: + case 239: return spanForNode(n); - case 179: + case 182: return spanForObjectOrArrayLiteral(n); - case 178: + case 181: return spanForObjectOrArrayLiteral(n, 21); } function spanForObjectOrArrayLiteral(node, open) { @@ -72174,7 +73710,7 @@ var ts; var token = ts.scanner.getToken(); if (token === 124) { token = nextToken(); - if (token === 128) { + if (token === 129) { token = nextToken(); if (token === 9) { recordAmbientExternalModule(); @@ -72202,7 +73738,7 @@ var ts; else { if (token === 71 || ts.isKeyword(token)) { token = nextToken(); - if (token === 141) { + if (token === 142) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -72228,7 +73764,7 @@ var ts; } if (token === 18) { token = nextToken(); - if (token === 141) { + if (token === 142) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -72242,7 +73778,7 @@ var ts; token = nextToken(); if (token === 71 || ts.isKeyword(token)) { token = nextToken(); - if (token === 141) { + if (token === 142) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -72268,7 +73804,7 @@ var ts; } if (token === 18) { token = nextToken(); - if (token === 141) { + if (token === 142) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -72278,7 +73814,7 @@ var ts; } else if (token === 39) { token = nextToken(); - if (token === 141) { + if (token === 142) { token = nextToken(); if (token === 9) { recordModuleName(); @@ -72302,7 +73838,7 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 132) { + if (token === 133) { token = nextToken(); if (token === 19) { token = nextToken(); @@ -72432,9 +73968,16 @@ var ts; symbol.parent.flags & 1536) { return undefined; } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + if (!kind) { + return undefined; + } + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 146) + ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) + : undefined; + var displayName = specifierName || typeChecker.symbolToString(symbol); + var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); + return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile); } } else if (node.kind === 9) { @@ -72525,16 +74068,12 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 182) { + if (argumentInfo.invocation.kind !== 185) { return undefined; } var callExpression = argumentInfo.invocation; var expression = callExpression.expression; - var name = expression.kind === 71 - ? expression - : expression.kind === 180 - ? expression.name - : undefined; + var name = ts.isIdentifier(expression) ? expression : ts.isPropertyAccessExpression(expression) ? expression.name : undefined; if (!name || !name.escapedText) { return undefined; } @@ -72584,23 +74123,23 @@ var ts; var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } - else if (node.kind === 13 && node.parent.kind === 184) { + else if (node.kind === 13 && node.parent.kind === 187) { if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, 0, sourceFile); } } - else if (node.kind === 14 && node.parent.parent.kind === 184) { + else if (node.kind === 14 && node.parent.parent.kind === 187) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197); + ts.Debug.assert(templateExpression.kind === 200); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 206 && node.parent.parent.parent.kind === 184) { + else if (node.parent.kind === 209 && node.parent.parent.parent.kind === 187) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197); + ts.Debug.assert(templateExpression.kind === 200); if (node.kind === 16 && !ts.isInsideTemplateLiteral(node, position)) { return undefined; } @@ -72624,9 +74163,8 @@ var ts; SignatureHelp.getImmediatelyContainingArgumentInfo = getImmediatelyContainingArgumentInfo; function getArgumentIndex(argumentsList, node) { var argumentIndex = 0; - var listChildren = argumentsList.getChildren(); - for (var _i = 0, listChildren_1 = listChildren; _i < listChildren_1.length; _i++) { - var child = listChildren_1[_i]; + for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; if (child === node) { break; } @@ -72655,9 +74193,7 @@ var ts; return spanIndex + 1; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { - var argumentCount = tagExpression.template.kind === 13 - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = ts.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; if (argumentIndex !== 0) { ts.Debug.assertLessThan(argumentIndex, argumentCount); } @@ -72678,7 +74214,7 @@ var ts; var template = taggedTemplate.template; var applicableSpanStart = template.getStart(); var applicableSpanEnd = template.getEnd(); - if (template.kind === 197) { + if (template.kind === 200) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); @@ -72687,7 +74223,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 269; n = n.parent) { + for (var n = node; n.kind !== 272; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -72708,12 +74244,14 @@ var ts; ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); return children[indexOfOpenerToken + 1]; } + var signatureHelpNodeBuilderFlags = 8192 | 3112960; function createSignatureHelpItems(candidates, resolvedSignature, argumentListInfo, typeChecker) { var argumentCount = argumentListInfo.argumentCount, applicableSpan = argumentListInfo.argumentsSpan, invocation = argumentListInfo.invocation, argumentIndex = argumentListInfo.argumentIndex; var isTypeParameterList = argumentListInfo.kind === 0; var callTarget = ts.getInvokedExpression(invocation); var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined); + var printer = ts.createPrinter({ removeComments: true }); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; var prefixDisplayParts = []; @@ -72729,14 +74267,19 @@ var ts; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : ts.emptyArray; suffixDisplayParts.push(ts.punctuationPart(29)); var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.thisParameter, candidateSignature.parameters, writer, invocation); + var thisParameter = candidateSignature.thisParameter ? [typeChecker.symbolToParameterDeclaration(candidateSignature.thisParameter, invocation, signatureHelpNodeBuilderFlags)] : []; + var params = ts.createNodeArray(thisParameter.concat(ts.map(candidateSignature.parameters, function (param) { return typeChecker.symbolToParameterDeclaration(param, invocation, signatureHelpNodeBuilderFlags); }))); + printer.writeList(1296, params, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); ts.addRange(suffixDisplayParts, parameterParts); } else { isVariadic = candidateSignature.hasRestParameter; var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); + if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { + var args = ts.createNodeArray(ts.map(candidateSignature.typeParameters, function (p) { return typeChecker.typeParameterToDeclaration(p, invocation); })); + printer.writeList(26896, args, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); + } }); ts.addRange(prefixDisplayParts, typeParameterParts); prefixDisplayParts.push(ts.punctuationPart(19)); @@ -72744,7 +74287,15 @@ var ts; suffixDisplayParts.push(ts.punctuationPart(20)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = typeChecker.getTypePredicateOfSignature(candidateSignature); + if (predicate) { + typeChecker.writeTypePredicate(predicate, invocation, undefined, writer); + } + else { + typeChecker.writeType(typeChecker.getReturnTypeOfSignature(candidateSignature), invocation, undefined, writer); + } }); ts.addRange(suffixDisplayParts, returnTypeParts); return { @@ -72765,7 +74316,8 @@ var ts; return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; function createSignatureHelpParameterForParameter(parameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); + var param = typeChecker.symbolToParameterDeclaration(parameter, invocation, signatureHelpNodeBuilderFlags); + printer.writeNode(4, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: parameter.name, @@ -72776,7 +74328,8 @@ var ts; } function createSignatureHelpParameterForTypeParameter(typeParameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); + var param = typeChecker.typeParameterToDeclaration(typeParameter, invocation); + printer.writeNode(4, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: typeParameter.symbol.name, @@ -72795,7 +74348,7 @@ var ts; function getSymbolKind(typeChecker, symbol, location) { var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32) { - return ts.getDeclarationOfKind(symbol, 200) ? + return ts.getDeclarationOfKind(symbol, 203) ? "local class" : "class"; } if (flags & 384) @@ -72872,9 +74425,11 @@ var ts; return unionPropertyKind; } switch (location.parent && location.parent.kind) { - case 252: + case 255: + case 253: + case 254: return location.kind === 71 ? "property" : "JSX attribute"; - case 257: + case 260: return "JSX attribute"; default: return "property"; @@ -72883,12 +74438,16 @@ var ts; return ""; } function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 + var nodeModifiers = symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) : ""; + var symbolModifiers = symbol && symbol.flags & 16777216 ? + "optional" + : ""; + return nodeModifiers && symbolModifiers ? nodeModifiers + "," + symbolModifiers : nodeModifiers || symbolModifiers; } SymbolDisplay.getSymbolModifiers = getSymbolModifiers; - function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { + function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning, alias) { if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; @@ -72898,13 +74457,15 @@ var ts; var hasAddedSymbolInfo; var isThisExpression = location.kind === 99 && ts.isExpression(location); var type; + var printer; + var documentationFromAlias; if (symbolKind !== "" || symbolFlags & 32 || symbolFlags & 2097152) { if (symbolKind === "getter" || symbolKind === "setter") { symbolKind = "property"; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 180) { + if (location.parent && location.parent.kind === 183) { var right = location.parent.name; if (right === location || (right && right.getFullWidth() === 0)) { location = location.parent; @@ -72923,7 +74484,7 @@ var ts; if (callExpressionLike) { var candidateSignatures = []; signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - var useConstructSignatures = callExpressionLike.kind === 183 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97); + var useConstructSignatures = callExpressionLike.kind === 186 || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { signature = allSignatures.length ? allSignatures[0] : undefined; @@ -72957,14 +74518,14 @@ var ts; displayParts.push(ts.punctuationPart(56)); displayParts.push(ts.spacePart()); if (!(type.flags & 65536 && type.objectFlags & 16) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1)); + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 4 | 1)); displayParts.push(ts.lineBreakPart()); } if (useConstructSignatures) { displayParts.push(ts.keywordPart(94)); displayParts.push(ts.spacePart()); } - addSignatureDisplayParts(signature, allSignatures, 16); + addSignatureDisplayParts(signature, allSignatures, 262144); break; default: addSignatureDisplayParts(signature, allSignatures); @@ -72973,25 +74534,25 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304)) || - (location.kind === 123 && location.parent.kind === 153)) { + (location.kind === 123 && location.parent.kind === 154)) { var functionDeclaration_1 = location.parent; var locationIsSymbolDeclaration = ts.find(symbol.declarations, function (declaration) { return declaration === (location.kind === 123 ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 153 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 154 ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 153) { + if (functionDeclaration_1.kind === 154) { symbolKind = "constructor"; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 156 && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 157 && !(type.symbol.flags & 2048 || type.symbol.flags & 4096) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -73000,7 +74561,8 @@ var ts; } } if (symbolFlags & 32 && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 200)) { + addAliasPrefixIfNecessary(); + if (ts.getDeclarationOfKind(symbol, 203)) { pushTypePart("local class"); } else { @@ -73011,25 +74573,25 @@ var ts; writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64) && (semanticMeaning & 2)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(109)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(138)); + prefixNextMeaning(); + displayParts.push(ts.keywordPart(139)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58)); displayParts.push(ts.spacePart()); - ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 1024)); + ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608)); } if (symbolFlags & 384) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { displayParts.push(ts.keywordPart(76)); displayParts.push(ts.spacePart()); @@ -73039,15 +74601,15 @@ var ts; addFullSymbolName(symbol); } if (symbolFlags & 1536) { - addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 234); + prefixNextMeaning(); + var declaration = ts.getDeclarationOfKind(symbol, 237); var isNamespace = declaration && declaration.name && declaration.name.kind === 71; - displayParts.push(ts.keywordPart(isNamespace ? 129 : 128)); + displayParts.push(ts.keywordPart(isNamespace ? 130 : 129)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if ((symbolFlags & 262144) && (semanticMeaning & 2)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.punctuationPart(19)); displayParts.push(ts.textPart("type parameter")); displayParts.push(ts.punctuationPart(20)); @@ -73059,25 +74621,25 @@ var ts; writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); } else { - var decl = ts.getDeclarationOfKind(symbol, 146); + var decl = ts.getDeclarationOfKind(symbol, 147); ts.Debug.assert(decl !== undefined); var declaration = decl.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 157) { + if (declaration.kind === 158) { displayParts.push(ts.keywordPart(94)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 156 && declaration.name) { + else if (declaration.kind !== 157 && declaration.name) { addFullSymbolName(declaration.symbol); } - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 64)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32)); } - else if (declaration.kind === 232) { + else if (declaration.kind === 235) { addInPrefix(); - displayParts.push(ts.keywordPart(138)); + displayParts.push(ts.keywordPart(139)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -73089,7 +74651,7 @@ var ts; symbolKind = "enum member"; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 268) { + if (declaration.kind === 271) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -73100,14 +74662,30 @@ var ts; } } if (symbolFlags & 2097152) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); + if (!hasAddedSymbolInfo) { + var resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { + var resolvedNode = resolvedSymbol.declarations[0]; + var declarationName = ts.getNameOfDeclaration(resolvedNode); + if (declarationName) { + var isExternalModuleDeclaration = ts.isModuleWithStringLiteralName(resolvedNode) && + ts.hasModifier(resolvedNode, 2); + var shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; + var resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, resolvedSymbol, ts.getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, semanticMeaning, shouldUseAliasName ? symbol : resolvedSymbol); + displayParts.push.apply(displayParts, resolvedInfo.displayParts); + displayParts.push(ts.lineBreakPart()); + documentationFromAlias = resolvedInfo.documentation; + } + } + } switch (symbol.declarations[0].kind) { - case 237: + case 240: displayParts.push(ts.keywordPart(84)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(129)); + displayParts.push(ts.keywordPart(130)); break; - case 244: + case 247: displayParts.push(ts.keywordPart(84)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 58 : 79)); @@ -73118,13 +74696,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 238) { + if (declaration.kind === 241) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(132)); + displayParts.push(ts.keywordPart(133)); displayParts.push(ts.punctuationPart(19)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(20)); @@ -73146,7 +74724,7 @@ var ts; if (symbolKind !== "") { if (type) { if (isThisExpression) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(99)); } else { @@ -73161,7 +74739,8 @@ var ts; displayParts.push(ts.spacePart()); if (type.symbol && type.symbol.flags & 262144) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + var param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration); + getPrinter().writeNode(4, param, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -73190,10 +74769,10 @@ var ts; documentation = symbol.getDocumentationComment(typeChecker); tags = symbol.getJsDocTags(); if (documentation.length === 0 && symbolFlags & 4) { - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 269; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 272; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 195) { + if (!declaration.parent || declaration.parent.kind !== 198) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -73209,26 +74788,45 @@ var ts; } } } + if (documentation.length === 0 && documentationFromAlias) { + documentation = documentationFromAlias; + } return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; - function addNewLineIfDisplayPartsExist() { + function getPrinter() { + if (!printer) { + printer = ts.createPrinter({ removeComments: true }); + } + return printer; + } + function prefixNextMeaning() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); } + addAliasPrefixIfNecessary(); + } + function addAliasPrefixIfNecessary() { + if (alias) { + pushTypePart("alias"); + displayParts.push(ts.spacePart()); + } } function addInPrefix() { displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(92)); displayParts.push(ts.spacePart()); } - function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 | 2); + function addFullSymbolName(symbolToDisplay, enclosingDeclaration) { + if (alias && symbolToDisplay === symbol) { + symbolToDisplay = alias; + } + var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbolToDisplay, enclosingDeclaration || sourceFile, undefined, 1 | 2 | 4); ts.addRange(displayParts, fullSymbolDisplayParts); } function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (symbolKind) { pushTypePart(symbolKind); - if (!ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { + if (symbol && !ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -73251,7 +74849,7 @@ var ts; } } function addSignatureDisplayParts(signature, allSignatures, flags) { - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 64)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(19)); @@ -73266,7 +74864,8 @@ var ts; } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + var params = typeChecker.symbolToTypeParameterDeclarations(symbol, enclosingDeclaration); + getPrinter().writeList(26896, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -73277,14 +74876,14 @@ var ts; return false; } return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 187) { + if (declaration.kind === 190) { return true; } - if (declaration.kind !== 227 && declaration.kind !== 229) { + if (declaration.kind !== 230 && declaration.kind !== 232) { return false; } for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { - if (parent.kind === 269 || parent.kind === 235) { + if (parent.kind === 272 || parent.kind === 238) { return false; } } @@ -73556,10 +75155,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 257: - case 252: - case 253: - case 251: + case 260: + case 255: + case 256: + case 254: return ts.isKeyword(node.kind) || node.kind === 71; } } @@ -73718,17 +75317,21 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0; token <= 143; token++) { + for (var token = 0; token <= 144; token++) { allTokens.push(token); } - function anyTokenExcept(token) { - return { tokens: allTokens.filter(function (t) { return t !== token; }), isSpecific: false }; + function anyTokenExcept() { + var tokens = []; + for (var _i = 0; _i < arguments.length; _i++) { + tokens[_i] = arguments[_i]; + } + return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false }; } var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3])); - var keywords = tokenRangeFromRange(72, 143); + var keywords = tokenRangeFromRange(72, 144); var binaryOperators = tokenRangeFromRange(27, 70); - var binaryKeywordOperators = [92, 93, 143, 118, 126]; + var binaryKeywordOperators = [92, 93, 144, 118, 127]; var unaryPrefixOperators = [43, 44, 52, 51]; var unaryPrefixExpressions = [ 8, 71, 19, 21, @@ -73746,7 +75349,7 @@ var ts; var highPriorityCommonRules = [ rule("IgnoreBeforeComment", anyToken, comments, formatting.anyContext, 1), rule("IgnoreAfterLineComment", 2, anyToken, formatting.anyContext, 1), - rule("NoSpaceBeforeColon", anyToken, 56, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8), + rule("NotSpaceBeforeColon", anyToken, 56, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 8), rule("SpaceAfterColon", 56, anyToken, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 2), rule("NoSpaceBeforeQuestionMark", anyToken, 55, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8), rule("SpaceAfterQuestionMarkInConditionalOperator", 55, anyToken, [isNonJsxSameLineTokenContext, isConditionalOperatorContext], 2), @@ -73764,17 +75367,18 @@ var ts; rule("SpaceAfterPostdecrementWhenFollowedBySubtract", 44, 38, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2), rule("SpaceAfterSubtractWhenFollowedByUnaryMinus", 38, 38, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2), rule("SpaceAfterSubtractWhenFollowedByPredecrement", 38, 44, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2), - rule("NoSpaceAfterCloseBrace", 18, [22, 26, 25], [isNonJsxSameLineTokenContext], 8), + rule("NoSpaceAfterCloseBrace", 18, [26, 25], [isNonJsxSameLineTokenContext], 8), rule("NewLineBeforeCloseBraceInBlockContext", anyTokenIncludingMultilineComments, 18, [isMultilineBlockContext], 4), rule("SpaceAfterCloseBrace", 18, anyTokenExcept(20), [isNonJsxSameLineTokenContext, isAfterCodeBlockContext], 2), rule("SpaceBetweenCloseBraceAndElse", 18, 82, [isNonJsxSameLineTokenContext], 2), rule("SpaceBetweenCloseBraceAndWhile", 18, 106, [isNonJsxSameLineTokenContext], 2), rule("NoSpaceBetweenEmptyBraceBrackets", 17, 18, [isNonJsxSameLineTokenContext, isObjectContext], 8), + rule("SpaceAfterConditionalClosingParen", 20, 21, [isControlDeclContext], 2), rule("NoSpaceBetweenFunctionKeywordAndStar", 89, 39, [isFunctionDeclarationOrFunctionExpressionContext], 8), rule("SpaceAfterStarInGeneratorDeclaration", 39, [71, 19], [isFunctionDeclarationOrFunctionExpressionContext], 2), rule("SpaceAfterFunctionInFuncDecl", 89, anyToken, [isFunctionDeclContext], 2), rule("NewLineAfterOpenBraceInBlockContext", 17, anyToken, [isMultilineBlockContext], 4), - rule("SpaceAfterGetSetInMember", [125, 135], 71, [isFunctionDeclContext], 2), + rule("SpaceAfterGetSetInMember", [125, 136], 71, [isFunctionDeclContext], 2), rule("NoSpaceBetweenYieldKeywordAndStar", 116, 39, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8), rule("SpaceBetweenYieldOrYieldStarAndOperand", [116, 39], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2), rule("NoSpaceBetweenReturnAndSemicolon", 96, 25, [isNonJsxSameLineTokenContext], 8), @@ -73792,7 +75396,7 @@ var ts; rule("NoSpaceBeforeGreaterThanTokenInJsxOpeningElement", 41, 29, [isJsxSelfClosingElementContext, isNonJsxSameLineTokenContext], 8), rule("NoSpaceBeforeEqualInJsxAttribute", anyToken, 58, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8), rule("NoSpaceAfterEqualInJsxAttribute", 58, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8), - rule("NoSpaceAfterModuleImport", [128, 132], 19, [isNonJsxSameLineTokenContext], 8), + rule("NoSpaceAfterModuleImport", [129, 133], 19, [isNonJsxSameLineTokenContext], 8), rule("SpaceAfterCertainTypeScriptKeywords", [ 117, 75, @@ -73805,19 +75409,20 @@ var ts; 108, 91, 109, - 128, 129, + 130, 112, 114, 113, - 131, - 135, + 132, + 136, 115, - 138, - 141, - 127, + 139, + 142, + 128, + 126, ], anyToken, [isNonJsxSameLineTokenContext], 2), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85, 108, 141], [isNonJsxSameLineTokenContext], 2), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85, 108, 142], [isNonJsxSameLineTokenContext], 2), rule("SpaceAfterModuleName", 9, 17, [isModuleDeclContext], 2), rule("SpaceBeforeArrow", anyToken, 36, [isNonJsxSameLineTokenContext], 2), rule("SpaceAfterArrow", 36, anyToken, [isNonJsxSameLineTokenContext], 2), @@ -73829,7 +75434,7 @@ var ts; rule("NoSpaceAfterOpenAngularBracket", 27, anyToken, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8), rule("NoSpaceBeforeCloseAngularBracket", anyToken, 29, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8), rule("NoSpaceAfterCloseAngularBracket", 29, [19, 21, 29, 26], [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8), - rule("SpaceBeforeAt", anyToken, 57, [isNonJsxSameLineTokenContext], 2), + rule("SpaceBeforeAt", [20, 71], 57, [isNonJsxSameLineTokenContext], 2), rule("NoSpaceAfterAt", 57, anyToken, [isNonJsxSameLineTokenContext], 8), rule("SpaceAfterDecorator", anyToken, [ 117, @@ -73842,7 +75447,7 @@ var ts; 112, 113, 125, - 135, + 136, 21, 39, ], [isEndOfDecoratorContextOnSameLine], 2), @@ -73852,8 +75457,8 @@ var ts; var userConfigurableRules = [ rule("SpaceAfterConstructor", 123, 19, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 2), rule("NoSpaceAfterConstructor", 123, 19, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 8), - rule("SpaceAfterComma", 26, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext, isNextTokenNotCloseBracket], 2), - rule("NoSpaceAfterComma", 26, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext], 8), + rule("SpaceAfterComma", 26, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket], 2), + rule("NoSpaceAfterComma", 26, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 8), rule("SpaceAfterAnonymousFunctionKeyword", 89, 19, [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 2), rule("NoSpaceAfterAnonymousFunctionKeyword", 89, 19, [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 8), rule("SpaceAfterKeywordInControl", keywords, 19, [isOptionEnabled("insertSpaceAfterKeywordsInControlFlowStatements"), isControlDeclContext], 2), @@ -73895,6 +75500,8 @@ var ts; rule("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17, [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], 4, 1), rule("SpaceAfterTypeAssertion", 29, anyToken, [isOptionEnabled("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 2), rule("NoSpaceAfterTypeAssertion", 29, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 8), + rule("SpaceBeforeTypeAnnotation", anyToken, 56, [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 2), + rule("NoSpaceBeforeTypeAnnotation", anyToken, 56, [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 8), ]; var lowPriorityCommonRules = [ rule("NoSpaceBeforeSemicolon", anyToken, 25, [isNonJsxSameLineTokenContext], 8), @@ -73902,10 +75509,11 @@ var ts; rule("SpaceBeforeOpenBraceInFunction", functionOpenBraceLeftTokenRange, 17, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2, 1), rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2, 1), rule("NoSpaceBeforeComma", anyToken, 26, [isNonJsxSameLineTokenContext], 8), - rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120), 21, [isNonJsxSameLineTokenContext], 8), + rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120, 73), 21, [isNonJsxSameLineTokenContext], 8), rule("NoSpaceAfterCloseBracket", 22, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 8), rule("SpaceAfterSemicolon", 25, anyToken, [isNonJsxSameLineTokenContext], 2), - rule("SpaceBetweenStatements", [20, 81, 82, 73], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementContext, isNotForContext], 2), + rule("SpaceBetweenForAndAwaitKeyword", 88, 121, [isNonJsxSameLineTokenContext], 2), + rule("SpaceBetweenStatements", [20, 81, 82, 73], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2), rule("SpaceAfterTryFinally", [102, 87], 17, [isNonJsxSameLineTokenContext], 2), ]; return highPriorityCommonRules.concat(userConfigurableRules, lowPriorityCommonRules); @@ -73947,50 +75555,65 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 215; + return context.contextNode.kind === 218; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 195: - case 196: - case 203: - case 247: - case 243: - case 159: - case 167: + case 198: + case 199: + case 170: + case 206: + case 250: + case 246: + case 160: case 168: + case 169: return true; - case 177: - case 232: - case 238: - case 227: - case 147: - case 268: + case 180: + case 235: + case 241: + case 230: + case 148: + case 271: + case 151: case 150: - case 149: return context.currentTokenSpan.kind === 58 || context.nextTokenSpan.kind === 58; - case 216: - case 146: + case 219: + case 147: return context.currentTokenSpan.kind === 92 || context.nextTokenSpan.kind === 92; - case 217: - return context.currentTokenSpan.kind === 143 || context.nextTokenSpan.kind === 143; + case 220: + return context.currentTokenSpan.kind === 144 || context.nextTokenSpan.kind === 144; } return false; } function isNotBinaryOpContext(context) { return !isBinaryOpContext(context); } + function isNotTypeAnnotationContext(context) { + return !isTypeAnnotationContext(context); + } + function isTypeAnnotationContext(context) { + var contextKind = context.contextNode.kind; + return contextKind === 151 || + contextKind === 150 || + contextKind === 148 || + contextKind === 230 || + ts.isFunctionLikeKind(contextKind); + } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 196; + return context.contextNode.kind === 199 || + context.contextNode.kind === 170; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 175 || isSingleLineBlockContext(context); + return context.contextNode.kind === 178 || + context.contextNode.kind === 176 || + isSingleLineBlockContext(context); } function isBeforeMultilineBlockContext(context) { return isBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); @@ -74012,64 +75635,64 @@ var ts; return true; } switch (node.kind) { - case 208: - case 236: - case 179: - case 235: + case 211: + case 239: + case 182: + case 238: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 229: + case 232: + case 153: case 152: - case 151: - case 154: case 155: case 156: - case 187: - case 153: - case 188: - case 231: + case 157: + case 190: + case 154: + case 191: + case 234: return true; } return false; } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 229 || context.contextNode.kind === 187; + return context.contextNode.kind === 232 || context.contextNode.kind === 190; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 230: - case 200: - case 231: case 233: - case 164: + case 203: case 234: - case 245: - case 246: - case 239: + case 236: + case 165: + case 237: + case 248: + case 249: case 242: + case 245: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 230: - case 234: case 233: - case 264: - case 235: - case 222: + case 237: + case 236: + case 267: + case 238: + case 225: return true; - case 208: { + case 211: { var blockParent = context.currentTokenParent.parent; - if (!blockParent || blockParent.kind !== 188 && blockParent.kind !== 187) { + if (!blockParent || blockParent.kind !== 191 && blockParent.kind !== 190) { return true; } } @@ -74078,29 +75701,29 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 212: - case 222: case 215: - case 216: - case 217: - case 214: case 225: - case 213: - case 221: - case 264: + case 218: + case 219: + case 220: + case 217: + case 228: + case 216: + case 224: + case 267: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 179; - } - function isFunctionCallContext(context) { return context.contextNode.kind === 182; } + function isFunctionCallContext(context) { + return context.contextNode.kind === 185; + } function isNewContext(context) { - return context.contextNode.kind === 183; + return context.contextNode.kind === 186; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -74112,25 +75735,25 @@ var ts; return context.nextTokenSpan.kind !== 22; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 188; + return context.contextNode.kind === 191; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10; } - function isNonJsxElementContext(context) { - return context.contextNode.kind !== 250; + function isNonJsxElementOrFragmentContext(context) { + return context.contextNode.kind !== 253 && context.contextNode.kind !== 257; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 260; + return context.contextNode.kind === 263 || context.contextNode.kind === 262; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 257; + return context.nextTokenParent.kind === 260; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 257; + return context.contextNode.kind === 260; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 251; + return context.contextNode.kind === 254; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -74145,45 +75768,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 148; + return node.kind === 149; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 228 && + return context.currentTokenParent.kind === 231 && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2; } function isModuleDeclContext(context) { - return context.contextNode.kind === 234; + return context.contextNode.kind === 237; } function isObjectTypeContext(context) { - return context.contextNode.kind === 164; + return context.contextNode.kind === 165; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 157; + return context.contextNode.kind === 158; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 27 && token.kind !== 29) { return false; } switch (parent.kind) { - case 160: - case 185: - case 232: - case 230: - case 200: - case 231: - case 229: - case 187: + case 161: case 188: + case 235: + case 233: + case 203: + case 234: + case 232: + case 190: + case 191: + case 153: case 152: - case 151: - case 156: case 157: - case 182: - case 183: - case 202: + case 158: + case 185: + case 186: + case 205: return true; default: return false; @@ -74194,16 +75817,16 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 185; + return context.contextNode.kind === 188; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 105 && context.currentTokenParent.kind === 191; + return context.currentTokenSpan.kind === 105 && context.currentTokenParent.kind === 194; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 198 && context.contextNode.expression !== undefined; + return context.contextNode.kind === 201 && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 204; + return context.contextNode.kind === 207; } })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -74251,12 +75874,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 143 && column <= 143, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 144 && column <= 144, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; - var mapRowLength = 143 + 1; + var mapRowLength = 144 + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; @@ -74376,17 +75999,17 @@ var ts; } function isListElement(parent, node) { switch (parent.kind) { - case 230: - case 231: - return ts.rangeContainsRange(parent.members, node); + case 233: case 234: + return ts.rangeContainsRange(parent.members, node); + case 237: var body = parent.body; - return body && body.kind === 235 && ts.rangeContainsRange(body.statements, node); - case 269: - case 208: - case 235: + return body && body.kind === 238 && ts.rangeContainsRange(body.statements, node); + case 272: + case 211: + case 238: return ts.rangeContainsRange(parent.statements, node); - case 264: + case 267: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -74529,44 +76152,45 @@ var ts; return -1; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { - var indentation = inheritedIndentation; var delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; if (effectiveParentStartLine === startLine) { - indentation = startLine === lastIndentedLine - ? indentationOnLastIndentedLine - : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta); + return { + indentation: startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(), + delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta) + }; } - else if (indentation === -1) { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); + else if (inheritedIndentation === -1) { + if (node.kind === 19 && startLine === lastIndentedLine) { + return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) }; + } + else if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + return { indentation: parentDynamicIndentation.getIndentation(), delta: delta }; } else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node); + return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta }; } } - return { - indentation: indentation, - delta: delta - }; + else { + return { indentation: inheritedIndentation, delta: delta }; + } } function getFirstNonDecoratorTokenOfNode(node) { if (node.modifiers && node.modifiers.length) { return node.modifiers[0].kind; } switch (node.kind) { - case 230: return 75; - case 231: return 109; - case 229: return 89; - case 233: return 233; - case 154: return 125; - case 155: return 135; - case 152: + case 233: return 75; + case 234: return 109; + case 232: return 89; + case 236: return 236; + case 155: return 125; + case 156: return 136; + case 153: if (node.asteriskToken) { return 39; } - case 150: - case 147: + case 151: + case 148: return ts.getNameOfDeclaration(node).kind; } } @@ -74577,64 +76201,52 @@ var ts; case 18: case 22: case 20: - return indentation + getEffectiveDelta(delta, container); + return indentation + getDelta(container); } return tokenIndentation !== -1 ? tokenIndentation : indentation; }, getIndentationForToken: function (line, kind, container) { - if (nodeStartLine !== line && node.decorators) { - if (kind === getFirstNonDecoratorTokenOfNode(node)) { - return indentation; - } - } - switch (kind) { - case 17: - case 18: - case 19: - case 20: - case 82: - case 106: - case 57: - return indentation; - case 41: - case 29: { - if (container.kind === 252 || - container.kind === 253 || - container.kind === 251) { - return indentation; - } - break; - } - case 21: - case 22: { - if (container.kind !== 173) { - return indentation; - } - break; - } - } - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + return shouldAddDelta(line, kind, container) ? indentation + getDelta(container) : indentation; }, getIndentation: function () { return indentation; }, - getDelta: function (child) { return getEffectiveDelta(delta, child); }, + getDelta: getDelta, recomputeIndentation: function (lineAdded) { if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent, node)) { - if (lineAdded) { - indentation += options.indentSize; - } - else { - indentation -= options.indentSize; - } - if (formatting.SmartIndenter.shouldIndentChildNode(node)) { - delta = options.indentSize; - } - else { - delta = 0; - } + indentation += lineAdded ? options.indentSize : -options.indentSize; + delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; } } }; - function getEffectiveDelta(delta, child) { + function shouldAddDelta(line, kind, container) { + switch (kind) { + case 17: + case 18: + case 19: + case 20: + case 82: + case 106: + case 57: + return false; + case 41: + case 29: + switch (container.kind) { + case 255: + case 256: + case 254: + return false; + } + break; + case 21: + case 22: + if (container.kind !== 176) { + return false; + } + break; + } + return nodeStartLine !== line + && !(node.decorators && kind === getFirstNonDecoratorTokenOfNode(node)); + } + function getDelta(child) { return formatting.SmartIndenter.nodeWillIndentChild(node, child, true) ? delta : 0; } } @@ -74695,7 +76307,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 148 ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 149 ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 10) { @@ -74703,7 +76315,7 @@ var ts; indentMultilineCommentOrJsxText(range, childIndentation.indentation, true, false); } childContextNode = node; - if (isFirstListItem && parent.kind === 178 && inheritedIndentation === -1) { + if (isFirstListItem && parent.kind === 181 && inheritedIndentation === -1) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -74844,18 +76456,20 @@ var ts; var trimTrailingWhitespaces; var lineAction = 0; if (rule) { - applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); - if (rule.action & (2 | 8) && currentStartLine !== previousStartLine) { - lineAction = 2; - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(false); - } - } - else if (rule.action & 4 && currentStartLine === previousStartLine) { - lineAction = 1; - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(true); - } + lineAction = applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + switch (lineAction) { + case 2: + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(false); + } + break; + case 1: + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(true); + } + break; + default: + ts.Debug.assert(lineAction === 0); } trimTrailingWhitespaces = !(rule.action & 8) && rule.flags !== 1; } @@ -74974,47 +76588,48 @@ var ts; var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); } - function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; - } function recordDelete(start, len) { if (len) { - edits.push(newTextChange(start, len, "")); + edits.push(ts.createTextChangeFromStartLength(start, len, "")); } } function recordReplace(start, len, newText) { if (len || newText) { - edits.push(newTextChange(start, len, newText)); + edits.push(ts.createTextChangeFromStartLength(start, len, newText)); } } function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { + var onLaterLine = currentStartLine !== previousStartLine; switch (rule.action) { case 1: - return; + return 0; case 8: if (previousRange.end !== currentRange.pos) { recordDelete(previousRange.end, currentRange.pos - previousRange.end); + return onLaterLine ? 2 : 0; } break; case 4: if (rule.flags !== 1 && previousStartLine !== currentStartLine) { - return; + return 0; } var lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.newLineCharacter); + return onLaterLine ? 0 : 1; } break; case 2: if (rule.flags !== 1 && previousStartLine !== currentStartLine) { - return; + return 0; } var posDelta = currentRange.pos - previousRange.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + return onLaterLine ? 2 : 0; } - break; } + return 0; } } var LineAction; @@ -75051,12 +76666,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { + case 154: + case 232: + case 190: case 153: - case 229: - case 187: case 152: - case 151: - case 188: + case 191: if (node.typeParameters === list) { return 27; } @@ -75064,8 +76679,8 @@ var ts; return 19; } break; - case 182: - case 183: + case 185: + case 186: if (node.typeArguments === list) { return 27; } @@ -75073,7 +76688,7 @@ var ts; return 19; } break; - case 160: + case 161: if (node.typeArguments === list) { return 27; } @@ -75106,12 +76721,12 @@ var ts; internedTabsIndentation = []; } if (internedTabsIndentation[tabs] === undefined) { - internedTabsIndentation[tabs] = tabString = repeat("\t", tabs); + internedTabsIndentation[tabs] = tabString = ts.repeatString("\t", tabs); } else { tabString = internedTabsIndentation[tabs]; } - return spaces ? tabString + repeat(" ", spaces) : tabString; + return spaces ? tabString + ts.repeatString(" ", spaces) : tabString; } else { var spacesString = void 0; @@ -75121,20 +76736,13 @@ var ts; internedSpacesIndentation = []; } if (internedSpacesIndentation[quotient] === undefined) { - spacesString = repeat(" ", options.indentSize * quotient); + spacesString = ts.repeatString(" ", options.indentSize * quotient); internedSpacesIndentation[quotient] = spacesString; } else { spacesString = internedSpacesIndentation[quotient]; } - return remainder ? spacesString + repeat(" ", remainder) : spacesString; - } - function repeat(value, count) { - var s = ""; - for (var i = 0; i < count; i++) { - s += value; - } - return s; + return remainder ? spacesString + ts.repeatString(" ", remainder) : spacesString; } } formatting.getIndentationString = getIndentationString; @@ -75174,7 +76782,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 26 && precedingToken.parent.kind !== 195) { + if (precedingToken.kind === 26 && precedingToken.parent.kind !== 198) { var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1) { return actualIndentation; @@ -75297,7 +76905,7 @@ var ts; } function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 269 || !parentAndChildShareLine); + (parent.kind === 272 || !parentAndChildShareLine); if (!useActualIndentation) { return -1; } @@ -75336,7 +76944,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 212 && parent.elseStatement === child) { + if (parent.kind === 215 && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 82, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -75351,37 +76959,37 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 160: + case 161: return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); - case 179: + case 182: return node.parent.properties; - case 178: + case 181: return node.parent.elements; - case 229: - case 187: - case 188: - case 152: - case 151: - case 156: + case 232: + case 190: + case 191: case 153: - case 162: - case 157: { + case 152: + case 157: + case 154: + case 163: + case 158: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 230: + case 233: return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); - case 183: - case 182: { + case 186: + case 185: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } - case 228: + case 231: return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); - case 242: - case 246: + case 245: + case 249: return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } @@ -75390,11 +76998,13 @@ var ts; SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); - return containingList ? getActualIndentationFromList(containingList) : -1; - function getActualIndentationFromList(list) { - var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1; + if (containingList) { + var index = containingList.indexOf(node); + if (index !== -1) { + return deriveActualIndentationFromList(containingList, index, sourceFile, options); + } } + return -1; } function getLineIndentationWhenExpressionIsInMultiLine(node, sourceFile, options) { if (node.kind === 20) { @@ -75417,10 +77027,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 182: + case 185: + case 186: case 183: - case 180: - case 181: + case 184: node = node.expression; break; default: @@ -75474,51 +77084,52 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 211: - case 230: - case 200: - case 231: + case 214: case 233: - case 232: - case 178: - case 208: - case 235: - case 179: - case 164: - case 173: - case 166: + case 203: + case 234: case 236: - case 262: - case 261: - case 186: - case 180: + case 235: + case 181: + case 211: + case 238: case 182: - case 183: - case 209: - case 227: - case 244: - case 220: - case 196: + case 165: case 176: - case 175: - case 252: - case 251: - case 260: - case 151: - case 156: - case 157: - case 147: - case 161: - case 162: - case 169: - case 184: - case 192: - case 246: - case 242: - case 247: - case 243: + case 167: + case 239: case 265: - case 150: + case 264: + case 189: + case 183: + case 185: + case 186: + case 212: + case 230: + case 247: + case 223: + case 199: + case 179: + case 178: + case 255: + case 258: + case 254: + case 263: + case 152: + case 157: + case 158: + case 148: + case 162: + case 163: + case 172: + case 187: + case 195: + case 249: + case 245: + case 250: + case 246: + case 268: + case 151: return true; } return false; @@ -75526,55 +77137,57 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0; switch (parent.kind) { - case 213: - case 214: case 216: case 217: + case 219: + case 220: + case 218: case 215: - case 212: - case 229: - case 187: - case 152: - case 188: + case 232: + case 190: case 153: + case 191: case 154: case 155: - return childKind !== 208; - case 245: - return childKind !== 246; - case 239: - return childKind !== 240 || - (!!child.namedBindings && child.namedBindings.kind !== 242); - case 250: - return childKind !== 253; + case 156: + return childKind !== 211; + case 248: + return childKind !== 249; + case 242: + return childKind !== 243 || + (!!child.namedBindings && child.namedBindings.kind !== 245); + case 253: + return childKind !== 256; + case 257: + return childKind !== 259; } return indentByDefault; } SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 220: - case 224: + case 223: + case 227: switch (parent.kind) { - case 208: + case 211: var grandParent = parent.parent; switch (grandParent && grandParent.kind) { - case 229: - case 187: + case 232: + case 190: return false; default: return true; } - case 261: - case 262: - case 269: - case 235: + case 264: + case 265: + case 272: + case 238: return true; default: throw ts.Debug.fail(); } - case 218: - case 219: + case 221: + case 222: return true; default: return false; @@ -75592,7 +77205,7 @@ var ts; var ts; (function (ts) { var textChanges; - (function (textChanges) { + (function (textChanges_1) { function getPos(n) { var result = n.__pos; ts.Debug.assert(typeof result === "number"); @@ -75615,7 +77228,7 @@ var ts; (function (Position) { Position[Position["FullStart"] = 0] = "FullStart"; Position[Position["Start"] = 1] = "Start"; - })(Position = textChanges.Position || (textChanges.Position = {})); + })(Position = textChanges_1.Position || (textChanges_1.Position = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, false, true); } @@ -75631,6 +77244,10 @@ var ts; } return false; } + textChanges_1.useNonAdjustedPositions = { + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; var ChangeKind; (function (ChangeKind) { ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; @@ -75640,10 +77257,10 @@ var ts; function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } - textChanges.getSeparatorCharacter = getSeparatorCharacter; + textChanges_1.getSeparatorCharacter = getSeparatorCharacter; function getAdjustedStartPosition(sourceFile, node, options, position) { if (options.useNonAdjustedStartPosition) { - return node.getFullStart(); + return node.getStart(); } var fullStart = node.getFullStart(); var start = node.getStart(sourceFile); @@ -75660,7 +77277,7 @@ var ts; adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } - textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + textChanges_1.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); @@ -75671,9 +77288,9 @@ var ts; ? newEnd : end; } - textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + textChanges_1.getAdjustedEndPosition = getAdjustedEndPosition; function isSeparator(node, candidate) { - return candidate && node.parent && (candidate.kind === 26 || (candidate.kind === 25 && node.parent.kind === 179)); + return candidate && node.parent && (candidate.kind === 26 || (candidate.kind === 25 && node.parent.kind === 182)); } function spaces(count) { var s = ""; @@ -75683,15 +77300,16 @@ var ts; return s; } var ChangeTracker = (function () { - function ChangeTracker(newLine, formatContext, validator) { - this.newLine = newLine; + function ChangeTracker(newLineCharacter, formatContext, validator) { + this.newLineCharacter = newLineCharacter; this.formatContext = formatContext; this.validator = validator; this.changes = []; - this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + this.deletedNodesInLists = []; + this.nodesInsertedAtClassStarts = ts.createMap(); } ChangeTracker.fromContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 : 0, context.formatContext); + return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); }; ChangeTracker.with = function (context, cb) { var tracker = ChangeTracker.fromContext(context); @@ -75706,14 +77324,14 @@ var ts; if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -75730,6 +77348,9 @@ var ts; this.deleteNode(sourceFile, node); return this; } + var id = ts.getNodeId(node); + ts.Debug.assert(!this.deletedNodesInLists[id], "Deleting a node twice"); + this.deletedNodesInLists[id] = true; if (index !== containingList.length - 1) { var nextToken = ts.getTokenAtPosition(sourceFile, node.end, false); if (nextToken && isSeparator(node, nextToken)) { @@ -75740,9 +77361,17 @@ var ts; } } else { - var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, false); - if (previousToken && isSeparator(node, previousToken)) { - this.deleteNodeRange(sourceFile, previousToken, node); + var prev = containingList[index - 1]; + if (this.deletedNodesInLists[ts.getNodeId(prev)]) { + var pos = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), false, true); + var end = getAdjustedEndPosition(sourceFile, node, {}); + this.deleteRange(sourceFile, { pos: pos, end: end }); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, false); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } } } return this; @@ -75754,70 +77383,113 @@ var ts; }; ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; - ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithSingleNode, - sourceFile: sourceFile, - options: options, - node: newNode, - range: { pos: startPosition, end: endPosition } - }); - return this; - }; - ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithMultipleNodes, - sourceFile: sourceFile, - options: options, - nodes: newNodes, - range: { pos: startPosition, end: endPosition } - }); + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { - return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { - if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); + ChangeTracker.prototype.insertNodeAtTopOfFile = function (sourceFile, newNode, blankLineBetween) { + var pos = getInsertionPositionAtSourceFileTop(sourceFile); + this.insertNodeAt(sourceFile, pos, newNode, { + prefix: pos === 0 ? undefined : this.newLineCharacter, + suffix: (ts.isLineBreak(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : ""), + }); }; - ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { - if (options === void 0) { options = {}; } - if ((ts.isStatementButNotDeclaration(after)) || + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { + if (blankLineBetween === void 0) { blankLineBetween = false; } + var pos = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); + return this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); + }; + ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { + var pos = before.getStart(sourceFile); + this.replaceRange(sourceFile, { pos: pos, end: pos }, ts.createToken(modifier), { suffix: " " }); + }; + ChangeTracker.prototype.getOptionsForInsertNodeBefore = function (before, doubleNewlines) { + if (ts.isStatement(before) || ts.isClassElement(before)) { + return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(before)) { + return { suffix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(before); + }; + ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) { + var firstStatement = ts.firstOrUndefined(ctr.body.statements); + if (!firstStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements)); + } + else { + this.insertNodeBefore(sourceFile, firstStatement, newStatement); + } + }; + ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) { + var lastStatement = ts.lastOrUndefined(ctr.body.statements); + if (!lastStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement])); + } + else { + this.insertNodeAfter(sourceFile, lastStatement, newStatement); + } + }; + ChangeTracker.prototype.replaceConstructorBody = function (sourceFile, ctr, statements) { + this.replaceNode(sourceFile, ctr.body, ts.createBlock(statements, true), { useNonAdjustedEndPosition: true }); + }; + ChangeTracker.prototype.insertNodeAtEndOfScope = function (sourceFile, scope, newNode) { + var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); + this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, { + prefix: ts.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, + suffix: this.newLineCharacter + }); + }; + ChangeTracker.prototype.insertNodeAtClassStart = function (sourceFile, cls, newElement) { + var firstMember = ts.firstOrUndefined(cls.members); + if (!firstMember) { + var id = ts.getNodeId(cls).toString(); + var newMembers = this.nodesInsertedAtClassStarts.get(id); + if (newMembers) { + ts.Debug.assert(newMembers.sourceFile === sourceFile && newMembers.cls === cls); + newMembers.members.push(newElement); + } + else { + this.nodesInsertedAtClassStarts.set(id, { sourceFile: sourceFile, cls: cls, members: [newElement] }); + } + } + else { + this.insertNodeBefore(sourceFile, firstMember, newElement); + } + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) { + if (ts.isStatementButNotDeclaration(after) || + after.kind === 151 || after.kind === 150 || - after.kind === 149 || - after.kind === 151) { + after.kind === 152) { if (sourceFile.text.charCodeAt(after.end - 1) !== 59) { this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, @@ -75828,8 +77500,20 @@ var ts; }); } } - var endPosition = getAdjustedEndPosition(sourceFile, after, options); - return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); + var endPosition = getAdjustedEndPosition(sourceFile, after, {}); + return this.replaceRange(sourceFile, { pos: endPosition, end: endPosition }, newNode, this.getInsertNodeAfterOptions(after)); + }; + ChangeTracker.prototype.getInsertNodeAfterOptions = function (node) { + if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) { + return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; + } + else if (ts.isStatement(node) || ts.isClassElement(node) || ts.isTypeElement(node)) { + return { suffix: this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(node)) { + return { prefix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(node); }; ChangeTracker.prototype.insertNodeInListAfter = function (sourceFile, after, newNode) { var containingList = ts.formatting.SmartIndenter.getContainingList(after, sourceFile); @@ -75918,34 +77602,26 @@ var ts; } return this; }; + ChangeTracker.prototype.finishInsertNodeAtClassStart = function () { + var _this = this; + this.nodesInsertedAtClassStarts.forEach(function (_a) { + var sourceFile = _a.sourceFile, cls = _a.cls, members = _a.members; + var newCls = cls.kind === 233 + ? ts.updateClassDeclaration(cls, cls.decorators, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members) + : ts.updateClassExpression(cls, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members); + _this.replaceNode(sourceFile, cls, newCls, { useNonAdjustedEndPosition: true }); + }); + }; ChangeTracker.prototype.getChanges = function () { var _this = this; - var changesPerFile = ts.createMap(); - for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { - var c = _a[_i]; - var changesInFile = changesPerFile.get(c.sourceFile.path); - if (!changesInFile) { - changesPerFile.set(c.sourceFile.path, changesInFile = []); - } - changesInFile.push(c); - } - var fileChangesList = []; - changesPerFile.forEach(function (changesInFile) { + this.finishInsertNodeAtClassStart(); + return ts.group(this.changes, function (c) { return c.sourceFile.path; }).map(function (changesInFile) { var sourceFile = changesInFile[0].sourceFile; - var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; - for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { - var c = _a[_i]; - fileTextChanges.textChanges.push({ - span: _this.computeSpan(c, sourceFile), - newText: _this.computeNewText(c, sourceFile) - }); - } - fileChangesList.push(fileTextChanges); + var textChanges = ChangeTracker.normalize(changesInFile).map(function (c) { + return ts.createTextChange(ts.createTextSpanFromRange(c.range), _this.computeNewText(c, sourceFile)); + }); + return { fileName: sourceFile.fileName, textChanges: textChanges }; }); - return fileChangesList; - }; - ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { - return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { var _this = this; @@ -75957,8 +77633,14 @@ var ts; var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); - text = parts.join(change.options.nodeSeparator); + var lastIndex_1 = change.nodes.length - 1; + var parts = change.nodes.map(function (n, index) { + var formatted = _this.getFormattedTextOfNode(n, sourceFile, pos, options); + return index === lastIndex_1 || ts.endsWith(formatted, _this.newLineCharacter) + ? formatted + : (formatted + _this.newLineCharacter); + }); + text = parts.join(""); } else { ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); @@ -75968,7 +77650,7 @@ var ts; return (options.prefix || "") + text + (options.suffix || ""); }; ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { - var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); + var nonformattedText = getNonformattedText(node, sourceFile, this.newLineCharacter); if (this.validator) { this.validator(nonformattedText); } @@ -75995,11 +77677,10 @@ var ts; }; return ChangeTracker; }()); - textChanges.ChangeTracker = ChangeTracker; + textChanges_1.ChangeTracker = ChangeTracker; function getNonformattedText(node, sourceFile, newLine) { - var options = { newLine: newLine, target: sourceFile && sourceFile.languageVersion }; - var writer = new Writer(ts.getNewLineCharacter(options)); - var printer = ts.createPrinter(options, writer); + var writer = new Writer(newLine); + var printer = ts.createPrinter({ newLine: newLine === "\n" ? 1 : 0 }, writer); printer.writeNode(4, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } @@ -76020,7 +77701,7 @@ var ts; } return text; } - textChanges.applyChanges = applyChanges; + textChanges_1.applyChanges = applyChanges; function isTrivia(s) { return ts.skipTrivia(s, 0) === s.length; } @@ -76090,6 +77771,38 @@ var ts; this.writer.write(s); this.setLastNonTriviaPosition(s, false); }; + Writer.prototype.writeKeyword = function (s) { + this.writer.writeKeyword(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeOperator = function (s) { + this.writer.writeOperator(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writePunctuation = function (s) { + this.writer.writePunctuation(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeParameter = function (s) { + this.writer.writeParameter(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeProperty = function (s) { + this.writer.writeProperty(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeSpace = function (s) { + this.writer.writeSpace(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeStringLiteral = function (s) { + this.writer.writeStringLiteral(s); + this.setLastNonTriviaPosition(s, false); + }; + Writer.prototype.writeSymbol = function (s, sym) { + this.writer.writeSymbol(s, sym); + this.setLastNonTriviaPosition(s, false); + }; Writer.prototype.writeTextOfNode = function (text, node) { this.writer.writeTextOfNode(text, node); }; @@ -76128,36 +77841,83 @@ var ts; Writer.prototype.isAtStartOfLine = function () { return this.writer.isAtStartOfLine(); }; - Writer.prototype.reset = function () { - this.writer.reset(); + Writer.prototype.clear = function () { + this.writer.clear(); this.lastNonTriviaPosition = 0; }; return Writer; }()); + function getInsertionPositionAtSourceFileTop(_a) { + var text = _a.text; + var shebang = ts.getShebang(text); + var position = 0; + if (shebang !== undefined) { + position = shebang.length; + advancePastLineBreak(); + } + var ranges = ts.getLeadingCommentRanges(text, position); + if (!ranges) + return position; + if (ranges.length && ranges[0].kind === 3 && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end; + advancePastLineBreak(); + ranges = ranges.slice(1); + } + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { + position = range.end; + advancePastLineBreak(); + continue; + } + break; + } + return position; + function advancePastLineBreak() { + if (position < text.length) { + var charCode = text.charCodeAt(position); + if (ts.isLineBreak(charCode)) { + position++; + if (position < text.length && charCode === 13 && text.charCodeAt(position) === 10) { + position++; + } + } + } + } + } })(textChanges = ts.textChanges || (ts.textChanges = {})); })(ts || (ts = {})); var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = []; - function registerCodeFix(codeFix) { - ts.forEach(codeFix.errorCodes, function (error) { - var fixes = codeFixes[error]; - if (!fixes) { - fixes = []; - codeFixes[error] = fixes; + var codeFixRegistrations = []; + var fixIdToRegistration = ts.createMap(); + function registerCodeFix(reg) { + for (var _i = 0, _a = reg.errorCodes; _i < _a.length; _i++) { + var error = _a[_i]; + var registrations = codeFixRegistrations[error]; + if (!registrations) { + registrations = []; + codeFixRegistrations[error] = registrations; } - fixes.push(codeFix); - }); + registrations.push(reg); + } + if (reg.fixIds) { + for (var _b = 0, _c = reg.fixIds; _b < _c.length; _b++) { + var fixId = _c[_b]; + ts.Debug.assert(!fixIdToRegistration.has(fixId)); + fixIdToRegistration.set(fixId, reg); + } + } } codefix.registerCodeFix = registerCodeFix; function getSupportedErrorCodes() { - return Object.keys(codeFixes); + return Object.keys(codeFixRegistrations); } codefix.getSupportedErrorCodes = getSupportedErrorCodes; function getFixes(context) { - var fixes = codeFixes[context.errorCode]; + var fixes = codeFixRegistrations[context.errorCode]; var allActions = []; ts.forEach(fixes, function (f) { var actions = f.getCodeActions(context); @@ -76176,6 +77936,41 @@ var ts; return allActions; } codefix.getFixes = getFixes; + function getAllFixes(context) { + return fixIdToRegistration.get(ts.cast(context.fixId, ts.isString)).getAllCodeActions(context); + } + codefix.getAllFixes = getAllFixes; + function createCombinedCodeActions(changes, commands) { + return { changes: changes, commands: commands }; + } + function createFileTextChanges(fileName, textChanges) { + return { fileName: fileName, textChanges: textChanges }; + } + codefix.createFileTextChanges = createFileTextChanges; + function codeFixAll(context, errorCodes, use) { + var commands = []; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return eachDiagnostic(context, errorCodes, function (diag) { return use(t, diag, commands); }); + }); + return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands); + } + codefix.codeFixAll = codeFixAll; + function codeFixAllWithTextChanges(context, errorCodes, use) { + var changes = []; + eachDiagnostic(context, errorCodes, function (diag) { return use(changes, diag); }); + changes.sort(function (a, b) { return b.span.start - a.span.start; }); + return createCombinedCodeActions([createFileTextChanges(context.sourceFile.fileName, changes)]); + } + codefix.codeFixAllWithTextChanges = codeFixAllWithTextChanges; + function eachDiagnostic(_a, errorCodes, cb) { + var program = _a.program, sourceFile = _a.sourceFile; + for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile); _i < _b.length; _i++) { + var diag = _b[_i]; + if (ts.contains(errorCodes, diag.code)) { + cb(diag); + } + } + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; @@ -76183,14 +77978,14 @@ var ts; var refactor; (function (refactor_1) { var refactors = ts.createMap(); - function registerRefactor(refactor) { - refactors.set(refactor.name, refactor); + function registerRefactor(name, refactor) { + refactors.set(name, refactor); } refactor_1.registerRefactor = registerRefactor; function getApplicableRefactors(context) { - return ts.flatMapIter(refactors.values(), function (refactor) { + return ts.arrayFrom(ts.flatMapIterator(refactors.values(), function (refactor) { return context.cancellationToken && context.cancellationToken.isCancellationRequested() ? undefined : refactor.getAvailableActions(context); - }); + })); } refactor_1.getApplicableRefactors = getApplicableRefactors; function getEditsForRefactor(context, refactorName, actionName) { @@ -76208,102 +78003,119 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "addMissingInvocationForDecorator"; + var errorCodes = [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, false); - var decorator = ts.getAncestor(token, 148); - ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); - var replacement = ts.createCall(decorator.expression, undefined, undefined); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, decorator.expression, replacement); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), - changes: changeTracker.getChanges() - }]; - } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); }, }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, false); + var decorator = ts.findAncestor(token, ts.isDecorator); + ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); + var replacement = ts.createCall(decorator.expression, undefined, undefined); + changeTracker.replaceNode(sourceFile, decorator.expression, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "correctQualifiedNameToIndexedAccessType"; + var errorCodes = [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, false); - var qualifiedName = ts.getAncestor(token, 144); - ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); - if (!ts.isIdentifier(qualifiedName.left)) { + var qualifiedName = getQualifiedName(context.sourceFile, context.span.start); + if (!qualifiedName) return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]"]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var q = getQualifiedName(diag.file, diag.start); + if (q) { + doChange(changes, diag.file, q); } - var leftText = qualifiedName.left.getText(sourceFile); - var rightText = qualifiedName.right.getText(sourceFile); - var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, qualifiedName, replacement); - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [leftText + "[\"" + rightText + "\"]"]), - changes: changeTracker.getChanges() - }]; - } + }); }, }); + function getQualifiedName(sourceFile, pos) { + var qualifiedName = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, true), ts.isQualifiedName); + ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); + return ts.isIdentifier(qualifiedName.left) ? qualifiedName : undefined; + } + function doChange(changeTracker, sourceFile, qualifiedName) { + var rightText = qualifiedName.right.text; + var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); + changeTracker.replaceNode(sourceFile, qualifiedName, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code, + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code]; + var fixId = "fixClassIncorrectlyImplementsInterface"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], - getCodeActions: getActionForClassLikeIncorrectImplementsInterface + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var classDeclaration = getClass(sourceFile, span.start); + var checker = program.getTypeChecker(); + return ts.mapDefined(ts.getClassImplementsHeritageClauseElements(classDeclaration), function (implementedTypeNode) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t); }); + if (changes.length === 0) + return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + return { description: description, changes: changes, fixId: fixId }; + }); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenClassDeclarations = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { + for (var _i = 0, _a = ts.getClassImplementsHeritageClauseElements(classDeclaration); _i < _a.length; _i++) { + var implementedTypeNode = _a[_i]; + addMissingDeclarations(context.program.getTypeChecker(), implementedTypeNode, diag.file, classDeclaration, changes); + } + } + }); + }, }); - function getActionForClassLikeIncorrectImplementsInterface(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, false); - var checker = context.program.getTypeChecker(); - var classDeclaration = ts.getContainingClass(token); - if (!classDeclaration) { - return undefined; - } - var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + function getClass(sourceFile, pos) { + var classDeclaration = ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, false)); + ts.Debug.assert(!!classDeclaration); + return classDeclaration; + } + function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker) { + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8); }); var classType = checker.getTypeAtLocation(classDeclaration); - var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); - var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1); - var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0); - var result = []; - for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { - var implementedTypeNode = implementedTypeNodes_2[_i]; - var implementedType = checker.getTypeAtLocation(implementedTypeNode); - var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); - var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8); }); - var newNodes = []; - createAndAddMissingIndexSignatureDeclaration(implementedType, 1, hasNumericIndexSignature, newNodes); - createAndAddMissingIndexSignatureDeclaration(implementedType, 0, hasStringIndexSignature, newNodes); - newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); - var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); - if (newNodes.length > 0) { - pushAction(result, newNodes, message); - } + if (!checker.getIndexTypeOfType(classType, 1)) { + createMissingIndexSignatureDeclaration(implementedType, 1); } - return result; - function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { - if (hasIndexSigOfKind) { - return; - } + if (!checker.getIndexTypeOfType(classType, 0)) { + createMissingIndexSignatureDeclaration(implementedType, 0); + } + codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + function createMissingIndexSignatureDeclaration(type, kind) { var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); - if (!indexInfoOfKind) { - return; + if (indexInfoOfKind) { + changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration)); } - var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); - newNodes.push(newIndexSignatureDeclaration); - } - function pushAction(result, newNodes, description) { - result.push({ description: description, changes: codefix.newNodesToChanges(newNodes, openBrace, context) }); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -76312,140 +78124,156 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ]; + var fixId = "addMissingMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, - ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code], - getCodeActions: getActionsForAddMissingMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var info = getInfo(context.sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + var methodCodeAction = call && getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + var addMember = inJs ? + ts.singleElementArray(getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, token.text, makeStatic)) : + getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic); + return ts.concatenate(ts.singleElementArray(methodCodeAction), addMember); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenNames = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var program = context.program; + var info = getInfo(diag.file, diag.start, program.getTypeChecker()); + if (!info) + return; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + if (!ts.addToSeen(seenNames, token.text)) { + return; + } + if (call) { + addMethodDeclaration(changes, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + } + else { + if (inJs) { + addMissingMemberInJs(changes, classDeclarationSourceFile, classDeclaration, token.text, makeStatic); + } + else { + var typeNode = getTypeNode(program.getTypeChecker(), classDeclaration, token); + addPropertyDeclaration(changes, classDeclarationSourceFile, classDeclaration, token.text, typeNode, makeStatic); + } + } + }); + }, }); - function getActionsForAddMissingMember(context) { - var tokenSourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(tokenSourceFile, start, false); - if (token.kind !== 71) { + function getInfo(tokenSourceFile, tokenPos, checker) { + var token = ts.getTokenAtPosition(tokenSourceFile, tokenPos, false); + if (!ts.isIdentifier(token)) { return undefined; } - if (!ts.isPropertyAccessExpression(token.parent)) { + var classAndMakeStatic = getClassAndMakeStatic(token, checker); + if (!classAndMakeStatic) { return undefined; } - var tokenName = token.getText(tokenSourceFile); - var makeStatic = false; - var classDeclaration; - if (token.parent.expression.kind === 99) { + var classDeclaration = classAndMakeStatic.classDeclaration, makeStatic = classAndMakeStatic.makeStatic; + var classDeclarationSourceFile = classDeclaration.getSourceFile(); + var inJs = ts.isInJavaScriptFile(classDeclarationSourceFile); + var call = ts.tryCast(token.parent.parent, ts.isCallExpression); + return { token: token, classDeclaration: classDeclaration, makeStatic: makeStatic, classDeclarationSourceFile: classDeclarationSourceFile, inJs: inJs, call: call }; + } + function getClassAndMakeStatic(token, checker) { + var parent = token.parent; + if (!ts.isPropertyAccessExpression(parent)) { + return undefined; + } + if (parent.expression.kind === 99) { var containingClassMemberDeclaration = ts.getThisContainer(token, false); if (!ts.isClassElement(containingClassMemberDeclaration)) { return undefined; } - classDeclaration = containingClassMemberDeclaration.parent; - makeStatic = classDeclaration && ts.hasModifier(containingClassMemberDeclaration, 32); + var classDeclaration = containingClassMemberDeclaration.parent; + return ts.isClassLike(classDeclaration) ? { classDeclaration: classDeclaration, makeStatic: ts.hasModifier(containingClassMemberDeclaration, 32) } : undefined; } else { - var checker = context.program.getTypeChecker(); - var leftExpression = token.parent.expression; - var leftExpressionType = checker.getTypeAtLocation(leftExpression); - if (leftExpressionType.flags & 65536) { - var symbol = leftExpressionType.symbol; - if (symbol.flags & 32) { - classDeclaration = symbol.declarations && symbol.declarations[0]; - if (leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol)) { - makeStatic = true; - } - } + var leftExpressionType = checker.getTypeAtLocation(parent.expression); + var symbol = leftExpressionType.symbol; + if (!(symbol && leftExpressionType.flags & 65536 && symbol.flags & 32)) { + return undefined; } + var classDeclaration = ts.cast(ts.first(symbol.declarations), ts.isClassLike); + return { classDeclaration: classDeclaration, makeStatic: leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol) }; } - if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + } + function getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingMemberInJs(t, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic); }); + if (changes.length === 0) return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Initialize_static_property_0 : ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]); + return { description: description, changes: changes, fixId: fixId }; + } + function addMissingMemberInJs(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + if (makeStatic) { + if (classDeclaration.kind === 203) { + return; + } + var className = classDeclaration.name.getText(); + var staticInitialization = initializePropertyToUndefined(ts.createIdentifier(className), tokenName); + changeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization); } - var classDeclarationSourceFile = ts.getSourceFileOfNode(classDeclaration); - var classOpenBrace = ts.getOpenBraceOfClassLike(classDeclaration, classDeclarationSourceFile); - return ts.isInJavaScriptFile(classDeclarationSourceFile) ? - getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) : - getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic); - function getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(false); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - if (makeStatic) { - if (classDeclaration.kind === 200) { - return actions; - } - var className = classDeclaration.name.getText(); - var staticInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier(className), tokenName), ts.createIdentifier("undefined"))); - var staticInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - staticInitializationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); - var initializeStaticAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [tokenName]), - changes: staticInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeStaticAction); - return actions; - } - else { - var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); - if (!classConstructor) { - return actions; - } - var propertyInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), tokenName), ts.createIdentifier("undefined"))); - var propertyInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyInitializationChangeTracker.insertNodeBefore(classDeclarationSourceFile, classConstructor.body.getLastToken(), propertyInitialization, { suffix: context.newLineCharacter }); - var initializeAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]), - changes: propertyInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeAction); - return actions; + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return; } + var propertyInitialization = initializePropertyToUndefined(ts.createThis(), tokenName); + changeTracker.insertNodeAtConstructorEnd(classDeclarationSourceFile, classConstructor, propertyInitialization); } - function getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(true); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - var typeNode; - if (token.parent.parent.kind === 195) { - var binaryExpression = token.parent.parent; - var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; - var checker = context.program.getTypeChecker(); - var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); - typeNode = checker.typeToTypeNode(widenedType, classDeclaration); - } - typeNode = typeNode || ts.createKeywordTypeNode(119); - var property = ts.createProperty(undefined, makeStatic ? [ts.createToken(115)] : undefined, tokenName, undefined, typeNode, undefined); - var propertyChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, property, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0; - actions = ts.append(actions, { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: propertyChangeTracker.getChanges() - }); - if (!makeStatic) { - var stringTypeNode = ts.createKeywordTypeNode(136); - var indexingParameter = ts.createParameter(undefined, undefined, undefined, "x", undefined, stringTypeNode, undefined); - var indexSignature = ts.createIndexSignature(undefined, undefined, [indexingParameter], typeNode); - var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - indexSignatureChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, indexSignature, { suffix: context.newLineCharacter }); - actions.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), - changes: indexSignatureChangeTracker.getChanges() - }); - } - return actions; - } - function getActionForMethodDeclaration(includeTypeScriptSyntax) { - if (token.parent.parent.kind === 182) { - var callExpression = token.parent.parent; - var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, tokenName, includeTypeScriptSyntax, makeStatic); - var methodDeclarationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - methodDeclarationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, methodDeclaration, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0; - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: methodDeclarationChangeTracker.getChanges() - }; - } + } + function initializePropertyToUndefined(obj, propertyName) { + return ts.createStatement(ts.createAssignment(ts.createPropertyAccess(obj, propertyName), ts.createIdentifier("undefined"))); + } + function getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic) { + var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); + var addProp = createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, token.text, typeNode); + return makeStatic ? [addProp] : [addProp, createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, token.text, typeNode)]; + } + function getTypeNode(checker, classDeclaration, token) { + var typeNode; + if (token.parent.parent.kind === 198) { + var binaryExpression = token.parent.parent; + var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); } + return typeNode || ts.createKeywordTypeNode(119); + } + function createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0), [tokenName]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addPropertyDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + var property = ts.createProperty(undefined, makeStatic ? [ts.createToken(115)] : undefined, tokenName, undefined, typeNode, undefined); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, property); + } + function createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, tokenName, typeNode) { + var stringTypeNode = ts.createKeywordTypeNode(137); + var indexingParameter = ts.createParameter(undefined, undefined, undefined, "x", undefined, stringTypeNode, undefined); + var indexSignature = ts.createIndexSignature(undefined, undefined, [indexingParameter], typeNode); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, indexSignature); }); + return { description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), changes: changes, fixId: undefined }; + } + function getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0), [token.text]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addMethodDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, token.text, inJs, makeStatic); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, methodDeclaration); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -76453,15 +78281,32 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixSpelling"; + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + ]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, - ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code], - getCodeActions: getActionsForCorrectSpelling + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var node = info.node, suggestion = info.suggestion; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, node, suggestion); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, context.program.getTypeChecker()); + if (info) + doChange(changes, context.sourceFile, info.node, info.suggestion); + }); }, }); - function getActionsForCorrectSpelling(context) { - var sourceFile = context.sourceFile; - var node = ts.getTokenAtPosition(sourceFile, context.span.start, false); - var checker = context.program.getTypeChecker(); + function getInfo(sourceFile, pos, checker) { + var node = ts.getTokenAtPosition(sourceFile, pos, false); var suggestion; if (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) { ts.Debug.assert(node.kind === 71); @@ -76474,18 +78319,10 @@ var ts; ts.Debug.assert(name !== undefined, "name should be defined"); suggestion = checker.getSuggestionForNonexistentSymbol(node, name, convertSemanticMeaningToSymbolFlags(meaning)); } - if (suggestion) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: node.getStart(), length: node.getWidth() }, - newText: suggestion - }], - }], - }]; - } + return suggestion === undefined ? undefined : { node: node, suggestion: suggestion }; + } + function doChange(changes, sourceFile, node, suggestion) { + changes.replaceNode(sourceFile, node, ts.createIdentifier(suggestion)); } function convertSemanticMeaningToSymbolFlags(meaning) { var flags = 0; @@ -76506,30 +78343,38 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixCannotFindModule"; + var errorCodes = [ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code]; codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, - ], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile, start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, false); - if (!ts.isStringLiteral(token)) { - throw ts.Debug.fail(); - } - var action = tryGetCodeActionForInstallPackageTypes(context.host, sourceFile.fileName, token.text); - return action && [action]; + var codeAction = tryGetCodeActionForInstallPackageTypes(context.host, context.sourceFile.fileName, getModuleName(context.sourceFile, context.span.start)); + return codeAction && [__assign({ fixId: fixId }, codeAction)]; }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (_, diag, commands) { + var pkg = getTypesPackageNameToInstall(context.host, getModuleName(diag.file, diag.start)); + if (pkg) { + commands.push(getCommand(diag.file.fileName, pkg)); + } + }); }, }); - function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + function getModuleName(sourceFile, pos) { + return ts.cast(ts.getTokenAtPosition(sourceFile, pos, false), ts.isStringLiteral).text; + } + function getCommand(fileName, packageName) { + return { type: "install package", file: fileName, packageName: packageName }; + } + function getTypesPackageNameToInstall(host, moduleName) { var packageName = ts.getPackageName(moduleName).packageName; - if (!host.isKnownTypesPackageName(packageName)) { - return undefined; - } - var typesPackageName = ts.getTypesPackageName(packageName); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [typesPackageName]), + return host.isKnownTypesPackageName(packageName) ? ts.getTypesPackageName(packageName) : undefined; + } + function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + var packageName = getTypesPackageNameToInstall(host, moduleName); + return packageName === undefined ? undefined : { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [packageName]), changes: [], - commands: [{ type: "install package", file: fileName, packageName: typesPackageName }], + commands: [getCommand(fileName, packageName)], }; } codefix.tryGetCodeActionForInstallPackageTypes = tryGetCodeActionForInstallPackageTypes; @@ -76539,40 +78384,39 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code, + ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code, + ]; + var fixId = "fixClassDoesntImplementInheritedAbstractMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], - getCodeActions: getActionForClassLikeMissingAbstractMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t); + }); + return changes.length === 0 ? undefined : [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + addMissingMembers(getClass(diag.file, diag.start), context.sourceFile, context.program.getTypeChecker(), changes); + }); }, }); - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], - getCodeActions: getActionForClassLikeMissingAbstractMember - }); - function getActionForClassLikeMissingAbstractMember(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, false); - var checker = context.program.getTypeChecker(); - if (ts.isClassLike(token.parent)) { - var classDeclaration = token.parent; - var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); - var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); - var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); - var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); - var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); - var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); - if (changes && changes.length > 0) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), - changes: changes - }]; - } - } - return undefined; + function getClass(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, false); + var classDeclaration = token.parent; + ts.Debug.assert(ts.isClassLike(classDeclaration)); + return classDeclaration; + } + function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker) { + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); + codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); } function symbolPointsToNonPrivateAndAbstractMember(symbol) { - var decls = symbol.getDeclarations(); - ts.Debug.assert(!!(decls && decls.length > 0)); - var flags = ts.getModifierFlags(decls[0]); + var flags = ts.getModifierFlags(ts.first(symbol.getDeclarations())); return !(flags & 8) && !!(flags & 128); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -76581,357 +78425,524 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "classSuperMustPrecedeThisAccess"; + var errorCodes = [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], + errorCodes: errorCodes, getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var constructor = nodes.constructor, superCall = nodes.superCall; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, constructor, superCall); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, false); - if (token.kind !== 99) { - return undefined; - } - var constructor = ts.getContainingFunction(token); - var superCall = findSuperCall(constructor.body); - if (!superCall) { - return undefined; - } - if (superCall.expression && superCall.expression.kind === 182) { - var expressionArguments = superCall.expression.arguments; - for (var _i = 0, expressionArguments_1 = expressionArguments; _i < expressionArguments_1.length; _i++) { - var arg = expressionArguments_1[_i]; - if (arg.expression === token) { - return undefined; - } + var seenClasses = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + var constructor = nodes.constructor, superCall = nodes.superCall; + if (ts.addToSeen(seenClasses, ts.getNodeId(constructor.parent))) { + doChange(changes, sourceFile, constructor, superCall); } - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); - changeTracker.deleteNode(sourceFile, superCall); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changeTracker.getChanges() - }]; - function findSuperCall(n) { - if (n.kind === 211 && ts.isSuperCall(n.expression)) { - return n; - } - if (ts.isFunctionLike(n)) { - return undefined; - } - return ts.forEachChild(n, findSuperCall); - } - } + }); + }, }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, false); - if (token.kind !== 123) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var superCall = ts.createStatement(ts.createCall(ts.createSuper(), undefined, ts.emptyArray)); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: changeTracker.getChanges() - }]; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, false); - var classDeclNode = ts.getContainingClass(token); - if (!(token.kind === 71 && ts.isClassLike(classDeclNode))) { - return undefined; - } - var heritageClauses = classDeclNode.heritageClauses; - if (!(heritageClauses && heritageClauses.length > 0)) { - return undefined; - } - var extendsToken = heritageClauses[0].getFirstToken(); - if (!(extendsToken && extendsToken.kind === 85)) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(108)); - for (var i = 1; i < heritageClauses.length; i++) { - var keywordToken = heritageClauses[i].getFirstToken(); - if (keywordToken) { - changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(26)); - } - } - var result = [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), - changes: changeTracker.getChanges() - }]; - return result; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, false); - if (token.kind !== 71) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), - changes: changeTracker.getChanges() - }]; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, - ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, false); - if (token.kind === 21) { - token = ts.getTokenAtPosition(sourceFile, start + 1, false); - } - switch (token.kind) { - case 71: - return deleteIdentifierOrPrefixWithUnderscore(token, context.errorCode); - case 150: - case 241: - return [deleteNode(token.parent)]; - default: - return deleteDefault(); - } - function deleteDefault() { - if (ts.isDeclarationName(token)) { - return [deleteNode(token.parent)]; - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return [deleteNode(token.parent.parent)]; - } - else { - return undefined; - } - } - function prefixIdentifierWithUnderscore(identifier) { - var startPosition = identifier.getStart(sourceFile, false); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), { 0: token.getText() }), - changes: [{ - fileName: sourceFile.path, - textChanges: [{ - span: { start: startPosition, length: 0 }, - newText: "_" - }] - }] - }; - } - function deleteIdentifierOrPrefixWithUnderscore(identifier, errorCode) { - var parent = identifier.parent; - switch (parent.kind) { - case 227: - return deleteVariableDeclarationOrPrefixWithUnderscore(identifier, parent); - case 146: - var typeParameters = parent.parent.typeParameters; - if (typeParameters.length === 1) { - var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, false); - var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, false); - ts.Debug.assert(previousToken.kind === 27); - ts.Debug.assert(nextToken.kind === 29); - return [deleteNodeRange(previousToken, nextToken)]; - } - else { - return [deleteNodeInList(parent)]; - } - case 147: - var functionDeclaration = parent.parent; - var deleteAction = functionDeclaration.parameters.length === 1 ? deleteNode(parent) : deleteNodeInList(parent); - return errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ? [deleteAction] - : [deleteAction, prefixIdentifierWithUnderscore(identifier)]; - case 238: - var importEquals = ts.getAncestor(identifier, 238); - return [deleteNode(importEquals)]; - case 243: - var namedImports = parent.parent; - if (namedImports.elements.length === 1) { - return deleteNamedImportBinding(namedImports); - } - else { - return [deleteNodeInList(parent)]; - } - case 240: - var importClause = parent; - if (!importClause.namedBindings) { - var importDecl = ts.getAncestor(importClause, 239); - return [deleteNode(importDecl)]; - } - else { - var start_6 = importClause.name.getStart(sourceFile); - var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, false); - if (nextToken && nextToken.kind === 26) { - return [deleteRange({ pos: start_6, end: ts.skipTrivia(sourceFile.text, nextToken.end, false, true) })]; - } - else { - return [deleteNode(importClause.name)]; - } - } - case 241: - return deleteNamedImportBinding(parent); - default: - return deleteDefault(); - } - } - function deleteNamedImportBinding(namedBindings) { - if (namedBindings.parent.name) { - var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, false); - if (previousToken && previousToken.kind === 26) { - return [deleteRange({ pos: previousToken.getStart(), end: namedBindings.end })]; - } - return undefined; - } - else { - var importDecl = ts.getAncestor(namedBindings, 239); - return [deleteNode(importDecl)]; - } - } - function deleteVariableDeclarationOrPrefixWithUnderscore(identifier, varDecl) { - switch (varDecl.parent.parent.kind) { - case 215: - var forStatement = varDecl.parent.parent; - var forInitializer = forStatement.initializer; - return [forInitializer.declarations.length === 1 ? deleteNode(forInitializer) : deleteNodeInList(varDecl)]; - case 217: - var forOfStatement = varDecl.parent.parent; - ts.Debug.assert(forOfStatement.initializer.kind === 228); - var forOfInitializer = forOfStatement.initializer; - return [ - replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()), - prefixIdentifierWithUnderscore(identifier) - ]; - case 216: - return [prefixIdentifierWithUnderscore(identifier)]; - default: - var variableStatement = varDecl.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return [deleteNode(variableStatement)]; - } - else { - return [deleteNodeInList(varDecl)]; - } - } - } - function deleteNode(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNode(sourceFile, n)); - } - function deleteRange(range) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteRange(sourceFile, range)); - } - function deleteNodeInList(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeInList(sourceFile, n)); - } - function deleteNodeRange(start, end) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeRange(sourceFile, start, end)); - } - function replaceNode(n, newNode) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).replaceNode(sourceFile, n, newNode)); - } - function makeChange(changeTracker) { - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), - changes: changeTracker.getChanges() - }; - } - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code], - getCodeActions: getActionsForJSDocTypes - }); - function getActionsForJSDocTypes(context) { - var sourceFile = context.sourceFile; - var node = ts.getTokenAtPosition(sourceFile, context.span.start, false); - var decl = ts.findAncestor(node, function (n) { - return n.kind === 203 || - n.kind === 156 || - n.kind === 157 || - n.kind === 229 || - n.kind === 154 || - n.kind === 158 || - n.kind === 173 || - n.kind === 152 || - n.kind === 151 || - n.kind === 147 || - n.kind === 150 || - n.kind === 149 || - n.kind === 155 || - n.kind === 232 || - n.kind === 185 || - n.kind === 227; - }); - if (!decl) - return; - var checker = context.program.getTypeChecker(); - var jsdocType = decl.type; - if (!jsdocType) - return; - var original = ts.getTextOfNode(jsdocType); - var type = checker.getTypeFromTypeNode(jsdocType); - var actions = [createAction(jsdocType, sourceFile.fileName, original, checker.typeToString(type, undefined, 8))]; - if (jsdocType.kind === 274) { - var replacementWithUndefined = checker.typeToString(checker.getNullableType(type, 4096), undefined, 8); - actions.push(createAction(jsdocType, sourceFile.fileName, original, replacementWithUndefined)); - } - return actions; + function doChange(changes, sourceFile, constructor, superCall) { + changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); + changes.deleteNode(sourceFile, superCall); } - function createAction(declaration, fileName, original, replacement) { + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, false); + if (token.kind !== 99) + return undefined; + var constructor = ts.getContainingFunction(token); + var superCall = findSuperCall(constructor.body); + return superCall && !superCall.expression.arguments.some(function (arg) { return ts.isPropertyAccessExpression(arg) && arg.expression === token; }) ? { constructor: constructor, superCall: superCall } : undefined; + } + function findSuperCall(n) { + return ts.isExpressionStatement(n) && ts.isSuperCall(n.expression) + ? n + : ts.isFunctionLike(n) + ? undefined + : ts.forEachChild(n, findSuperCall); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "constructorForDerivedNeedSuperCall"; + var errorCodes = [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var ctr = getNode(sourceFile, span.start); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, ctr); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + return doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, + }); + function getNode(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, false); + ts.Debug.assert(token.kind === 123); + return token.parent; + } + function doChange(changes, sourceFile, ctr) { + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), undefined, ts.emptyArray)); + changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "extendsInterfaceBecomesImplements"; + var errorCodes = [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var nodes = getNodes(sourceFile, context.span.start); + if (!nodes) + return undefined; + var extendsToken = nodes.extendsToken, heritageClauses = nodes.heritageClauses; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChanges(t, sourceFile, extendsToken, heritageClauses); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (nodes) + doChanges(changes, diag.file, nodes.extendsToken, nodes.heritageClauses); + }); }, + }); + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, false); + var heritageClauses = ts.getContainingClass(token).heritageClauses; + var extendsToken = heritageClauses[0].getFirstToken(); + return extendsToken.kind === 85 ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; + } + function doChanges(changes, sourceFile, extendsToken, heritageClauses) { + changes.replaceNode(sourceFile, extendsToken, ts.createToken(108), ts.textChanges.useNonAdjustedPositions); + if (heritageClauses.length === 2 && + heritageClauses[0].token === 85 && + heritageClauses[1].token === 108) { + var implementsToken = heritageClauses[1].getFirstToken(); + var implementsFullStart = implementsToken.getFullStart(); + changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, ts.createToken(26)); + var text = sourceFile.text; + var end = implementsToken.end; + while (end < text.length && ts.isWhiteSpaceSingleLine(text.charCodeAt(end))) { + end++; + } + changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end: end }); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "forgottenThisPropertyAccess"; + var errorCodes = [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getNode(sourceFile, context.span.start); + if (!token) { + return undefined; + } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, token); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, + }); + function getNode(sourceFile, pos) { + var node = ts.getTokenAtPosition(sourceFile, pos, false); + return ts.isIdentifier(node) ? node : undefined; + } + function doChange(changes, sourceFile, token) { + if (!token) { + return; + } + ts.suppressLeadingAndTrailingTrivia(token); + changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token), ts.textChanges.useNonAdjustedPositions); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixIdPrefix = "unusedIdentifier_prefix"; + var fixIdDelete = "unusedIdentifier_delete"; + var errorCodes = [ + ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, + ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getToken(sourceFile, context.span.start); + var result = []; + var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token); }); + if (deletion.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), [token.getText()]); + result.push({ description: description, changes: deletion, fixId: fixIdDelete }); + } + var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, context.errorCode, sourceFile, token); }); + if (prefix.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), [token.getText()]); + result.push({ description: description, changes: prefix, fixId: fixIdPrefix }); + } + return result; + }, + fixIds: [fixIdPrefix, fixIdDelete], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var sourceFile = context.sourceFile; + var token = getToken(diag.file, diag.start); + switch (context.fixId) { + case fixIdPrefix: + if (ts.isIdentifier(token) && canPrefix(token)) { + tryPrefixDeclaration(changes, diag.code, sourceFile, token); + } + break; + case fixIdDelete: + tryDeleteDeclaration(changes, sourceFile, token); + break; + default: + ts.Debug.fail(JSON.stringify(context.fixId)); + } + }); }, + }); + function getToken(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, false); + return token.kind === 21 ? ts.getTokenAtPosition(sourceFile, pos + 1, false) : token; + } + function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { + if (errorCode !== ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code && ts.isIdentifier(token) && canPrefix(token)) { + changes.replaceNode(sourceFile, token, ts.createIdentifier("_" + token.text)); + } + } + function canPrefix(token) { + switch (token.parent.kind) { + case 148: + return true; + case 230: { + var varDecl = token.parent; + switch (varDecl.parent.parent.kind) { + case 220: + case 219: + return true; + } + } + } + return false; + } + function tryDeleteDeclaration(changes, sourceFile, token) { + switch (token.kind) { + case 71: + tryDeleteIdentifier(changes, sourceFile, token); + break; + case 151: + case 244: + changes.deleteNode(sourceFile, token.parent); + break; + default: + tryDeleteDefault(changes, sourceFile, token); + } + } + function tryDeleteDefault(changes, sourceFile, token) { + if (ts.isDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent.parent); + } + } + function tryDeleteIdentifier(changes, sourceFile, identifier) { + var parent = identifier.parent; + switch (parent.kind) { + case 230: + tryDeleteVariableDeclaration(changes, sourceFile, parent); + break; + case 147: + var typeParameters = parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, false); + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, false); + ts.Debug.assert(previousToken.kind === 27); + ts.Debug.assert(nextToken.kind === 29); + changes.deleteNodeRange(sourceFile, previousToken, nextToken); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 148: + var oldFunction = parent.parent; + if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) { + var newFunction = ts.updateArrowFunction(oldFunction, oldFunction.modifiers, oldFunction.typeParameters, undefined, oldFunction.type, oldFunction.equalsGreaterThanToken, oldFunction.body); + ts.suppressLeadingAndTrailingTrivia(newFunction); + changes.replaceNode(sourceFile, oldFunction, newFunction, ts.textChanges.useNonAdjustedPositions); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 241: + var importEquals = ts.getAncestor(identifier, 241); + changes.deleteNode(sourceFile, importEquals); + break; + case 246: + var namedImports = parent.parent; + if (namedImports.elements.length === 1) { + tryDeleteNamedImportBinding(changes, sourceFile, namedImports); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 243: + var importClause = parent; + if (!importClause.namedBindings) { + changes.deleteNode(sourceFile, ts.getAncestor(importClause, 242)); + } + else { + var start = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, false); + if (nextToken && nextToken.kind === 26) { + var end = ts.skipTrivia(sourceFile.text, nextToken.end, false, true); + changes.deleteRange(sourceFile, { pos: start, end: end }); + } + else { + changes.deleteNode(sourceFile, importClause.name); + } + } + break; + case 244: + tryDeleteNamedImportBinding(changes, sourceFile, parent); + break; + default: + tryDeleteDefault(changes, sourceFile, identifier); + break; + } + } + function tryDeleteNamedImportBinding(changes, sourceFile, namedBindings) { + if (namedBindings.parent.name) { + var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, false); + if (previousToken && previousToken.kind === 26) { + changes.deleteRange(sourceFile, { pos: previousToken.getStart(), end: namedBindings.end }); + } + } + else { + var importDecl = ts.getAncestor(namedBindings, 242); + changes.deleteNode(sourceFile, importDecl); + } + } + function tryDeleteVariableDeclaration(changes, sourceFile, varDecl) { + switch (varDecl.parent.parent.kind) { + case 218: { + var forStatement = varDecl.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + changes.deleteNode(sourceFile, forInitializer); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + break; + } + case 220: + var forOfStatement = varDecl.parent.parent; + ts.Debug.assert(forOfStatement.initializer.kind === 231); + var forOfInitializer = forOfStatement.initializer; + changes.replaceNode(sourceFile, forOfInitializer.declarations[0], ts.createObjectLiteral()); + break; + case 219: + case 228: + break; + default: + var variableStatement = varDecl.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + changes.deleteNode(sourceFile, variableStatement); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixIdPlain = "fixJSDocTypes_plain"; + var fixIdNullable = "fixJSDocTypes_nullable"; + var errorCodes = [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var checker = context.program.getTypeChecker(); + var info = getInfo(sourceFile, context.span.start, checker); + if (!info) + return undefined; + var typeNode = info.typeNode, type = info.type; + var original = typeNode.getText(sourceFile); + var actions = [fix(type, fixIdPlain)]; + if (typeNode.kind === 277) { + actions.push(fix(checker.getNullableType(type, 4096), fixIdNullable)); + } + return actions; + function fix(type, fixId) { + var newText = typeString(type, checker); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [createChange(typeNode, sourceFile, newText)])], + fixId: fixId, + }; + } + }, + fixIds: [fixIdPlain, fixIdNullable], + getAllCodeActions: function (context) { + var fixId = context.fixId, program = context.program, sourceFile = context.sourceFile; + var checker = program.getTypeChecker(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var info = getInfo(err.file, err.start, checker); + if (!info) + return; + var typeNode = info.typeNode, type = info.type; + var fixedType = typeNode.kind === 277 && fixId === fixIdNullable ? checker.getNullableType(type, 4096) : type; + changes.push(createChange(typeNode, sourceFile, typeString(fixedType, checker))); + }); + } + }); + function getInfo(sourceFile, pos, checker) { + var decl = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, false), isTypeContainer); + var typeNode = decl && decl.type; + return typeNode && { typeNode: typeNode, type: checker.getTypeFromTypeNode(typeNode) }; + } + function createChange(declaration, sourceFile, newText) { + return ts.createTextChange(ts.createTextSpanFromNode(declaration, sourceFile), newText); + } + function typeString(type, checker) { + return checker.typeToString(type, undefined, 1); + } + function isTypeContainer(node) { + switch (node.kind) { + case 206: + case 157: + case 158: + case 232: + case 155: + case 159: + case 176: + case 153: + case 152: + case 148: + case 151: + case 150: + case 156: + case 235: + case 188: + case 230: + return true; + default: + return false; + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixAwaitInSyncFunction"; + var errorCodes = [ + ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function.code, + ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, nodes); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_async_modifier_to_containing_function), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + doChange(changes, context.sourceFile, nodes); + }); }, + }); + function getReturnType(expr) { + if (expr.type) { + return expr.type; + } + if (ts.isVariableDeclaration(expr.parent) && + expr.parent.type && + ts.isFunctionTypeNode(expr.parent.type)) { + return expr.parent.type.type; + } + } + function getNodes(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start, false); + var containingFunction = ts.getContainingFunction(token); + var insertBefore; + switch (containingFunction.kind) { + case 153: + insertBefore = containingFunction.name; + break; + case 232: + case 190: + insertBefore = ts.findChildOfKind(containingFunction, 89, sourceFile); + break; + case 191: + insertBefore = ts.findChildOfKind(containingFunction, 19, sourceFile) || ts.first(containingFunction.parameters); + break; + default: + return; + } return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, replacement]), - changes: [{ - fileName: fileName, - textChanges: [{ - span: { start: declaration.getStart(), length: declaration.getWidth() }, - newText: replacement - }] - }], + insertBefore: insertBefore, + returnType: getReturnType(containingFunction) }; } + function doChange(changes, sourceFile, _a) { + var insertBefore = _a.insertBefore, returnType = _a.returnType; + if (returnType) { + var entityName = ts.getEntityNameFromTypeNode(returnType); + if (!entityName || entityName.kind !== 71 || entityName.text !== "Promise") { + changes.replaceNode(sourceFile, returnType, ts.createTypeReferenceNode("Promise", ts.createNodeArray([returnType]))); + } + } + changes.insertModifierBefore(sourceFile, 120, insertBefore); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; @@ -76946,110 +78957,29 @@ var ts; ts.Diagnostics.Cannot_find_namespace_0.code, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code ], - getCodeActions: getImportCodeActions + getCodeActions: getImportCodeActions, + fixIds: [], + getAllCodeActions: ts.notImplemented, }); - var ModuleSpecifierComparison; - (function (ModuleSpecifierComparison) { - ModuleSpecifierComparison[ModuleSpecifierComparison["Better"] = 0] = "Better"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; - })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = (function () { - function ImportCodeActionMap() { - this.symbolIdToActionMap = []; - } - ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { - var actions = this.symbolIdToActionMap[symbolId]; - if (!actions) { - this.symbolIdToActionMap[symbolId] = [newAction]; - return; - } - if (newAction.kind === "CodeChange") { - actions.push(newAction); - return; - } - var updatedNewImports = []; - for (var _i = 0, _a = this.symbolIdToActionMap[symbolId]; _i < _a.length; _i++) { - var existingAction = _a[_i]; - if (existingAction.kind === "CodeChange") { - updatedNewImports.push(existingAction); - continue; - } - switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { - case 0: - if (newAction.kind === "NewImport") { - return; - } - case 1: - updatedNewImports.push(existingAction); - break; - case 2: - continue; - } - } - updatedNewImports.push(newAction); - this.symbolIdToActionMap[symbolId] = updatedNewImports; - }; - ImportCodeActionMap.prototype.addActions = function (symbolId, newActions) { - for (var _i = 0, newActions_1 = newActions; _i < newActions_1.length; _i++) { - var newAction = newActions_1[_i]; - this.addAction(symbolId, newAction); - } - }; - ImportCodeActionMap.prototype.getAllActions = function () { - var result = []; - for (var key in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[key]); - } - return result; - }; - ImportCodeActionMap.prototype.compareModuleSpecifiers = function (moduleSpecifier1, moduleSpecifier2) { - if (moduleSpecifier1 === moduleSpecifier2) { - return 1; - } - if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { - return 0; - } - if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { - return 2; - } - if (ts.isExternalModuleNameRelative(moduleSpecifier1) && ts.isExternalModuleNameRelative(moduleSpecifier2)) { - var regex = new RegExp(ts.directorySeparator, "g"); - var moduleSpecifier1LevelCount = (moduleSpecifier1.match(regex) || []).length; - var moduleSpecifier2LevelCount = (moduleSpecifier2.match(regex) || []).length; - return moduleSpecifier1LevelCount < moduleSpecifier2LevelCount - ? 0 - : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount - ? 1 - : 2; - } - return 1; - }; - return ImportCodeActionMap; - }()); - function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { - return { - description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: changes, - kind: kind, - moduleSpecifier: moduleSpecifier - }; + function createCodeAction(descriptionDiagnostic, diagnosticArgs, changes) { + var description = ts.formatMessage.apply(undefined, [undefined, descriptionDiagnostic].concat(diagnosticArgs)); + return { description: description, changes: changes, fixId: undefined }; } - function convertToImportCodeFixContext(context) { + function convertToImportCodeFixContext(context, symbolToken, symbolName) { var useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; - var checker = context.program.getTypeChecker(); - var symbolToken = ts.getTokenAtPosition(context.sourceFile, context.span.start, false); + var program = context.program; + var checker = program.getTypeChecker(); return { host: context.host, - newLineCharacter: context.newLineCharacter, formatContext: context.formatContext, sourceFile: context.sourceFile, + program: program, checker: checker, - compilerOptions: context.program.getCompilerOptions(), + compilerOptions: program.getCompilerOptions(), cachedImportDeclarations: [], getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), - symbolName: symbolToken.getText(), - symbolToken: symbolToken, + symbolName: symbolName, + symbolToken: symbolToken }; } var ImportKind; @@ -77058,42 +78988,63 @@ var ts; ImportKind[ImportKind["Default"] = 1] = "Default"; ImportKind[ImportKind["Namespace"] = 2] = "Namespace"; ImportKind[ImportKind["Equals"] = 3] = "Equals"; - })(ImportKind = codefix.ImportKind || (codefix.ImportKind = {})); - function getCodeActionForImport(moduleSymbols, context) { - moduleSymbols = ts.toArray(moduleSymbols); - var declarations = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getImportDeclarations(moduleSymbol, context.checker, context.sourceFile, context.cachedImportDeclarations); - }); - var actions = []; - if (context.symbolToken) { - for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { - var declaration = declarations_13[_i]; - var namespace = getNamespaceImportName(declaration); - if (namespace) { - actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken)); + })(ImportKind || (ImportKind = {})); + function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, symbolToken) { + var exportInfos = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); + ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol; })); + var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, exportInfos, compilerOptions, getCanonicalFileName, host)).moduleSpecifier; + var ctx = { host: host, program: program, checker: checker, compilerOptions: compilerOptions, sourceFile: sourceFile, formatContext: formatContext, symbolName: symbolName, getCanonicalFileName: getCanonicalFileName, symbolToken: symbolToken }; + return { moduleSpecifier: moduleSpecifier, codeAction: ts.first(getCodeActionsForImport(exportInfos, ctx)) }; + } + codefix.getImportCompletionAction = getImportCompletionAction; + function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { + var result = []; + forEachExternalModule(checker, allSourceFiles, function (moduleSymbol) { + for (var _i = 0, _a = checker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { + var exported = _a[_i]; + if (ts.skipAlias(exported, checker) === exportedSymbol) { + var isDefaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol) === exported; + result.push({ moduleSymbol: moduleSymbol, importKind: isDefaultExport ? 1 : 0 }); } } - } - return actions.concat(getCodeActionsForAddImport(moduleSymbols, context, declarations)); + }); + return result; + } + function getCodeActionsForImport(exportInfos, context) { + var existingImports = ts.flatMap(exportInfos, function (info) { + return getImportDeclarations(info, context.checker, context.sourceFile, context.cachedImportDeclarations); + }); + var useExistingImportActions = !context.symbolToken || !ts.isIdentifier(context.symbolToken) ? ts.emptyArray : ts.mapDefined(existingImports, function (_a) { + var declaration = _a.declaration; + var namespace = getNamespaceImportName(declaration); + if (namespace) { + var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); + if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { + return getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken); + } + } + }); + return useExistingImportActions.concat(getCodeActionsForAddImport(exportInfos, context, existingImports)); } - codefix.getCodeActionForImport = getCodeActionForImport; function getNamespaceImportName(declaration) { - if (declaration.kind === 239) { + if (declaration.kind === 242) { var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings; - return namedBindings && namedBindings.kind === 241 ? namedBindings.name : undefined; + return namedBindings && namedBindings.kind === 244 ? namedBindings.name : undefined; } else { return declaration.name; } } - function getImportDeclarations(moduleSymbol, checker, _a, cachedImportDeclarations) { - var imports = _a.imports; + function getImportDeclarations(_a, checker, _b, cachedImportDeclarations) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var imports = _b.imports; if (cachedImportDeclarations === void 0) { cachedImportDeclarations = []; } var moduleSymbolId = ts.getUniqueSymbolId(moduleSymbol, checker); var cached = cachedImportDeclarations[moduleSymbolId]; if (!cached) { cached = cachedImportDeclarations[moduleSymbolId] = ts.mapDefined(imports, function (importModuleSpecifier) { - return checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + var declaration = checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + return declaration && { declaration: declaration, importKind: importKind }; }); } return cached; @@ -77101,34 +79052,35 @@ var ts; function getImportDeclaration(_a) { var parent = _a.parent; switch (parent.kind) { - case 239: + case 242: return parent; - case 249: + case 252: return parent.parent; - case 245: - case 182: + case 248: + case 185: return undefined; default: ts.Debug.fail(); } } - function getCodeActionForNewImport(context, moduleSpecifier) { - var kind = context.kind, sourceFile = context.sourceFile, newLineCharacter = context.newLineCharacter, symbolName = context.symbolName; + function getCodeActionForNewImport(context, _a) { + var moduleSpecifier = _a.moduleSpecifier, importKind = _a.importKind; + var sourceFile = context.sourceFile, symbolName = context.symbolName; var lastImportDeclaration = ts.findLast(sourceFile.statements, ts.isAnyImportSyntax); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier); var quotedModuleSpecifier = createStringLiteralWithQuoteStyle(sourceFile, moduleSpecifierWithoutQuotes); - var importDecl = kind !== 3 - ? ts.createImportDeclaration(undefined, undefined, createImportClauseOfKind(kind, symbolName), quotedModuleSpecifier) + var importDecl = importKind !== 3 + ? ts.createImportDeclaration(undefined, undefined, createImportClauseOfKind(importKind, symbolName), quotedModuleSpecifier) : ts.createImportEqualsDeclaration(undefined, undefined, ts.createIdentifier(symbolName), ts.createExternalModuleReference(quotedModuleSpecifier)); var changes = ChangeTracker.with(context, function (changeTracker) { if (lastImportDeclaration) { - changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: newLineCharacter }); + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); } else { - changeTracker.insertNodeAt(sourceFile, ts.getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + newLineCharacter + newLineCharacter }); + changeTracker.insertNodeAtTopOfFile(sourceFile, importDecl, true); } }); - return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes); } function createStringLiteralWithQuoteStyle(sourceFile, text) { var literal = ts.createLiteral(text); @@ -77136,6 +79088,12 @@ var ts; literal.singleQuote = !!firstModuleSpecifier && !ts.isStringDoubleQuoted(firstModuleSpecifier, sourceFile); return literal; } + function usesJsExtensionOnImports(sourceFile) { + return ts.firstDefined(sourceFile.imports, function (_a) { + var text = _a.text; + return ts.pathIsRelative(text) ? ts.fileExtensionIs(text, ".js") : undefined; + }) || false; + } function createImportClauseOfKind(kind, symbolName) { var id = ts.createIdentifier(symbolName); switch (kind) { @@ -77149,40 +79107,55 @@ var ts; ts.Debug.assertNever(kind); } } - function getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, options, getCanonicalFileName, host) { + function getNewImportInfos(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { var baseUrl = options.baseUrl, paths = options.paths, rootDirs = options.rootDirs; - var choicesForEachExportingModule = ts.mapIterator(ts.arrayIterator(moduleSymbols), function (moduleSymbol) { - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; - var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); - var global = tryGetModuleNameFromAmbientModule(moduleSymbol) - || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) - || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) - || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); - if (global) { - return [global]; - } - var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options); - if (!baseUrl) { - return [relativePath]; - } - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); - if (!relativeToBaseUrl) { - return [relativePath]; - } - var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options); - if (paths) { - var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - if (fromPaths) { - return [fromPaths]; + var addJsExtension = usesJsExtensionOnImports(sourceFile); + var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (_a) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var modulePathsGroups = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { + var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); + var global = tryGetModuleNameFromAmbientModule(moduleSymbol) + || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) + || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) + || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); + if (global) { + return [global]; } - } - var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); - var relativeFirst = getRelativePathNParents(pathFromSourceToBaseUrl) < getRelativePathNParents(relativePath); - return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options, addJsExtension); + if (!baseUrl) { + return [relativePath]; + } + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); + if (!relativeToBaseUrl) { + return [relativePath]; + } + var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options, addJsExtension); + if (paths) { + var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); + if (fromPaths) { + return [fromPaths]; + } + } + if (isPathRelativeToParent(relativeToBaseUrl)) { + return [relativePath]; + } + var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); + var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl); + return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + }); + return modulePathsGroups.map(function (group) { return group.map(function (moduleSpecifier) { return ({ moduleSpecifier: moduleSpecifier, importKind: importKind }); }); }); }); - return ts.best(choicesForEachExportingModule, function (a, b) { return a[0].length < b[0].length; }); + return ts.flatten(choicesForEachExportingModule.sort(function (a, b) { return ts.first(a).moduleSpecifier.length - ts.first(b).moduleSpecifier.length; })); + } + function getAllModulePaths(program, _a) { + var fileName = _a.fileName; + var symlinks = ts.mapDefined(program.getSourceFiles(), function (sf) { + return sf.resolvedModules && ts.firstDefinedIterator(sf.resolvedModules.values(), function (res) { + return res && res.resolvedFileName === fileName ? res.originalPath : undefined; + }); + }); + return symlinks.length === 0 ? [fileName] : symlinks; } - codefix.getModuleSpecifiersForNewImport = getModuleSpecifiersForNewImport; function getRelativePathNParents(relativePath) { var count = 0; for (var i = 0; i + 3 <= relativePath.length && relativePath.slice(i, i + 3) === "../"; i += 3) { @@ -77196,10 +79169,11 @@ var ts; return decl.name.text; } } - function tryGetModuleNameFromPaths(relativeNameWithIndex, relativeName, paths) { + function tryGetModuleNameFromPaths(relativeToBaseUrlWithIndex, relativeToBaseUrl, paths) { for (var key in paths) { for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) { - var pattern = _a[_i]; + var patternText_1 = _a[_i]; + var pattern = ts.removeFileExtension(ts.normalizePath(patternText_1)); var indexOfStar = pattern.indexOf("*"); if (indexOfStar === 0 && pattern.length === 1) { continue; @@ -77207,14 +79181,14 @@ var ts; else if (indexOfStar !== -1) { var prefix = pattern.substr(0, indexOfStar); var suffix = pattern.substr(indexOfStar + 1); - if (relativeName.length >= prefix.length + suffix.length && - ts.startsWith(relativeName, prefix) && - ts.endsWith(relativeName, suffix)) { - var matchedStar = relativeName.substr(prefix.length, relativeName.length - suffix.length); - return key.replace("\*", matchedStar); + if (relativeToBaseUrl.length >= prefix.length + suffix.length && + ts.startsWith(relativeToBaseUrl, prefix) && + ts.endsWith(relativeToBaseUrl, suffix)) { + var matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length); + return key.replace("*", matchedStar); } } - else if (pattern === relativeName || pattern === relativeNameWithIndex) { + else if (pattern === relativeToBaseUrl || pattern === relativeToBaseUrlWithIndex) { return key; } } @@ -77229,12 +79203,12 @@ var ts; var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath, getCanonicalFileName) : normalizedTargetPath; return ts.removeFileExtension(relativePath); } - function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) { + function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) { var roots = ts.getEffectiveTypeRoots(options, host); - return roots && ts.firstDefined(roots, function (unNormalizedTypeRoot) { + return ts.firstDefined(roots, function (unNormalizedTypeRoot) { var typeRoot = ts.toPath(unNormalizedTypeRoot, undefined, getCanonicalFileName); if (ts.startsWith(moduleFileName, typeRoot)) { - return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options); + return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options, addJsExtension); } }); } @@ -77330,60 +79304,74 @@ var ts; return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined; } function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) { - return ts.firstDefined(rootDirs, function (rootDir) { return getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); }); + return ts.firstDefined(rootDirs, function (rootDir) { + var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); + return isPathRelativeToParent(relativePath) ? undefined : relativePath; + }); } - function removeExtensionAndIndexPostFix(fileName, options) { + function removeExtensionAndIndexPostFix(fileName, options, addJsExtension) { var noExtension = ts.removeFileExtension(fileName); - return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs ? ts.removeSuffix(noExtension, "/index") : noExtension; + return addJsExtension + ? noExtension + ".js" + : ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs + ? ts.removeSuffix(noExtension, "/index") + : noExtension; } function getRelativePathIfInDirectory(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); - return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; + return ts.isRootedDiskPath(relativePath) ? undefined : relativePath; + } + function isPathRelativeToParent(path) { + return ts.startsWith(path, ".."); } function getRelativePath(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, false); return !ts.pathIsRelative(relativePath) ? "./" + relativePath : relativePath; } - function getCodeActionsForAddImport(moduleSymbols, ctx, declarations) { - var fromExistingImport = ts.firstDefined(declarations, function (declaration) { - if (declaration.kind === 239 && declaration.importClause) { - var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined); + function getCodeActionsForAddImport(exportInfos, ctx, existingImports) { + var fromExistingImport = ts.firstDefined(existingImports, function (_a) { + var declaration = _a.declaration, importKind = _a.importKind; + if (declaration.kind === 242 && declaration.importClause) { + var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined, importKind); if (changes) { var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText()); - return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes); } } }); if (fromExistingImport) { return [fromExistingImport]; } - var existingDeclaration = ts.firstDefined(declarations, moduleSpecifierFromAnyImport); - var moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); - return moduleSpecifiers.map(function (spec) { return getCodeActionForNewImport(ctx, spec); }); + var existingDeclaration = ts.firstDefined(existingImports, newImportInfoFromExistingSpecifier); + var newImportInfos = existingDeclaration + ? [existingDeclaration] + : getNewImportInfos(ctx.program, ctx.sourceFile, exportInfos, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); + return newImportInfos.map(function (info) { return getCodeActionForNewImport(ctx, info); }); } - function moduleSpecifierFromAnyImport(node) { - var expression = node.kind === 239 - ? node.moduleSpecifier - : node.moduleReference.kind === 249 - ? node.moduleReference.expression + function newImportInfoFromExistingSpecifier(_a) { + var declaration = _a.declaration, importKind = _a.importKind; + var expression = declaration.kind === 242 + ? declaration.moduleSpecifier + : declaration.moduleReference.kind === 252 + ? declaration.moduleReference.expression : undefined; - return expression && ts.isStringLiteral(expression) ? expression.text : undefined; + return expression && ts.isStringLiteral(expression) ? { moduleSpecifier: expression.text, importKind: importKind } : undefined; } - function tryUpdateExistingImport(context, importClause) { - var symbolName = context.symbolName, sourceFile = context.sourceFile, kind = context.kind; + function tryUpdateExistingImport(context, importClause, importKind) { + var symbolName = context.symbolName, sourceFile = context.sourceFile; var name = importClause.name; - var namedBindings = (importClause.kind !== 238 && importClause).namedBindings; - switch (kind) { + var namedBindings = (importClause.kind !== 241 && importClause).namedBindings; + switch (importKind) { case 1: return name ? undefined : ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(ts.createIdentifier(symbolName), namedBindings)); }); case 0: { var newImportSpecifier_1 = ts.createImportSpecifier(undefined, ts.createIdentifier(symbolName)); - if (namedBindings && namedBindings.kind === 242 && namedBindings.elements.length !== 0) { + if (namedBindings && namedBindings.kind === 245 && namedBindings.elements.length !== 0) { return ChangeTracker.with(context, function (t) { return t.insertNodeInListAfter(sourceFile, namedBindings.elements[namedBindings.elements.length - 1], newImportSpecifier_1); }); } - if (!namedBindings || namedBindings.kind === 242 && namedBindings.elements.length === 0) { + if (!namedBindings || namedBindings.kind === 245 && namedBindings.elements.length === 0) { return ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(name, ts.createNamedImports([newImportSpecifier_1]))); }); @@ -77397,38 +79385,42 @@ var ts; case 3: return undefined; default: - ts.Debug.assertNever(kind); + ts.Debug.assertNever(importKind); } } function getCodeActionForUseExistingNamespaceImport(namespacePrefix, context, symbolToken) { var symbolName = context.symbolName, sourceFile = context.sourceFile; - return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], ChangeTracker.with(context, function (tracker) { - return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolName)); - }), "CodeChange", undefined); + var changes = ChangeTracker.with(context, function (tracker) { + return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolToken)); + }); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes); } function getImportCodeActions(context) { - var importFixContext = convertToImportCodeFixContext(context); return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code - ? getActionsForUMDImport(importFixContext) - : getActionsForNonUMDImport(importFixContext, context.program.getSourceFiles(), context.cancellationToken); + ? getActionsForUMDImport(context) + : getActionsForNonUMDImport(context); } function getActionsForUMDImport(context) { - var checker = context.checker, symbolToken = context.symbolToken, compilerOptions = context.compilerOptions; - var umdSymbol = checker.getSymbolAtLocation(symbolToken); - var symbol; - var symbolName; - if (umdSymbol.flags & 2097152) { - symbol = checker.getAliasedSymbol(umdSymbol); - symbolName = context.symbolName; + var token = ts.getTokenAtPosition(context.sourceFile, context.span.start, false); + var checker = context.program.getTypeChecker(); + var umdSymbol; + if (ts.isIdentifier(token)) { + umdSymbol = checker.getSymbolAtLocation(token); } - else if (ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken) { - symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), symbolToken.parent.tagName, 107455)); - symbolName = symbol.name; + if (!ts.isUMDExportSymbol(umdSymbol)) { + var parent = token.parent; + var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(parent); + if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 258) { + umdSymbol = checker.resolveName(checker.getJsxNamespace(), isNodeOpeningLikeElement ? parent.tagName : parent, 107455, false); + } } - else { - throw ts.Debug.fail("Either the symbol or the JSX namespace should be a UMD global if we got here"); + if (ts.isUMDExportSymbol(umdSymbol)) { + var symbol = checker.getAliasedSymbol(umdSymbol); + if (symbol) { + return getCodeActionsForImport([{ moduleSymbol: symbol, importKind: getUmdImportKind(context.program.getCompilerOptions()) }], convertToImportCodeFixContext(context, token, umdSymbol.name)); + } } - return getCodeActionForImport(symbol, __assign({}, context, { symbolName: symbolName, kind: getUmdImportKind(compilerOptions) })); + return undefined; } function getUmdImportKind(compilerOptions) { if (ts.getAllowSyntheticDefaultImports(compilerOptions)) { @@ -77449,29 +79441,55 @@ var ts; throw ts.Debug.assertNever(moduleKind); } } - function getActionsForNonUMDImport(context, allSourceFiles, cancellationToken) { - var sourceFile = context.sourceFile, checker = context.checker, symbolName = context.symbolName, symbolToken = context.symbolToken; + function getActionsForNonUMDImport(context) { + var sourceFile = context.sourceFile, span = context.span, program = context.program, cancellationToken = context.cancellationToken; + var checker = program.getTypeChecker(); + var symbolToken = ts.getTokenAtPosition(sourceFile, span.start, false); + var isJsxNamespace = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken; + if (!isJsxNamespace && !ts.isIdentifier(symbolToken)) { + return undefined; + } + var symbolName = isJsxNamespace ? checker.getJsxNamespace() : symbolToken.text; + var allSourceFiles = program.getSourceFiles(); + var compilerOptions = program.getCompilerOptions(); ts.Debug.assert(symbolName !== "default"); - var symbolIdActionMap = new ImportCodeActionMap(); var currentTokenMeaning = ts.getMeaningFromLocation(symbolToken); + var originalSymbolToExportInfos = ts.createMultiMap(); + function addSymbol(moduleSymbol, exportedSymbol, importKind) { + originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind }); + } forEachExternalModuleToImportFrom(checker, sourceFile, allSourceFiles, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); if (defaultExport) { var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport); - if ((localSymbol && localSymbol.escapedName === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, context.compilerOptions.target) === symbolName) - && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { - var symbolId = ts.getUniqueSymbolId(localSymbol || defaultExport, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 1 }))); + if ((localSymbol && localSymbol.escapedName === symbolName || + getEscapedNameForExportDefault(defaultExport) === symbolName || + moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { + addSymbol(moduleSymbol, localSymbol || defaultExport, 1); } } var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - var symbolId = ts.getUniqueSymbolId(exportSymbolWithIdenticalName, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 0 }))); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0); + } + function getEscapedNameForExportDefault(symbol) { + return ts.firstDefined(symbol.declarations, function (declaration) { + if (ts.isExportAssignment(declaration)) { + if (ts.isIdentifier(declaration.expression)) { + return declaration.expression.escapedText; + } + } + else if (ts.isExportSpecifier(declaration)) { + ts.Debug.assert(declaration.name.escapedText === "default"); + if (declaration.propertyName) { + return declaration.propertyName.escapedText; + } + } + }); } }); - return symbolIdActionMap.getAllActions(); + return ts.arrayFrom(ts.flatMapIterator(originalSymbolToExportInfos.values(), function (exportInfos) { return getCodeActionsForImport(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName)); })); } function checkSymbolHasMeaning(_a, meaning) { var declarations = _a.declarations; @@ -77497,7 +79515,6 @@ var ts; } } } - codefix.forEachExternalModule = forEachExternalModule; function isImportablePath(fromPath, toPath) { var toNodeModules = ts.forEachAncestorDirectory(toPath, function (ancestor) { return ts.getBaseFileName(ancestor) === "node_modules" ? ancestor : undefined; }); return toNodeModules === undefined || ts.startsWith(fromPath, ts.getDirectoryPath(toNodeModules)); @@ -77530,66 +79547,64 @@ var ts; } return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } + codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "disableJsDiagnostics"; + var errorCodes = ts.mapDefined(Object.keys(ts.Diagnostics), function (key) { + var diag = ts.Diagnostics[key]; + return diag.category === ts.DiagnosticCategory.Error ? diag.code : undefined; + }); codefix.registerCodeFix({ - errorCodes: getApplicableDiagnosticCodes(), - getCodeActions: getDisableJsDiagnosticsCodeActions + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter).change])], + fixId: fixId, + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [ + ts.createTextChange(sourceFile.checkJsDirective ? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter), + ])], + fixId: undefined, + }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenLines = ts.createMap(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + if (err.start !== undefined) { + var _a = getIgnoreCommentLocationForLocation(err.file, err.start, ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options)), lineNumber = _a.lineNumber, change = _a.change; + if (ts.addToSeen(seenLines, lineNumber)) { + changes.push(change); + } + } + }); + }, }); - function getApplicableDiagnosticCodes() { - var allDiagnostcs = ts.Diagnostics; - return Object.keys(allDiagnostcs) - .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) - .map(function (d) { return allDiagnostcs[d].code; }); - } function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { - var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; - var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var lineNumber = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(lineNumber, sourceFile); var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { var token = ts.getTouchingToken(sourceFile, startPosition, false); - var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); - if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { - return { - span: { start: startPosition, length: 0 }, - newText: "// @ts-ignore" + newLineCharacter - }; + var tokenLeadingComments = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingComments || !tokenLeadingComments.length || tokenLeadingComments[0].pos >= startPosition) { + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(startPosition, 0, "// @ts-ignore" + newLineCharacter) }; } } - return { - span: { start: position, length: 0 }, - newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter - }; - } - function getDisableJsDiagnosticsCodeActions(context) { - var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; - if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { - return undefined; - } - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] - }] - }, - { - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { - start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, - length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 - }, - newText: "// @ts-nocheck" + newLineCharacter - }] - }] - }]; + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(position, 0, (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter) }; } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -77597,132 +79612,93 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function newNodesToChanges(newNodes, insertAfter, context) { - var sourceFile = context.sourceFile; - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { - var newNode = newNodes_1[_i]; - changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); - } - var changes = changeTracker.getChanges(); - if (!ts.some(changes)) { - return changes; - } - ts.Debug.assert(changes.length === 1); - var consolidatedChanges = [{ - fileName: changes[0].fileName, - textChanges: [{ - span: changes[0].textChanges[0].span, - newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") - }] - }]; - return consolidatedChanges; - } - codefix.newNodesToChanges = newNodesToChanges; - function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker, out) { var classMembers = classDeclaration.symbol.members; - var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.escapedName); }); - var newNodes = []; - for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { - var symbol = missingMembers_1[_i]; - var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); - if (newNode) { - if (Array.isArray(newNode)) { - newNodes = newNodes.concat(newNode); - } - else { - newNodes.push(newNode); - } + for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) { + var symbol = possiblyMissingSymbols_1[_i]; + if (!classMembers.has(symbol.escapedName)) { + addNewNodeForMemberSymbol(symbol, classDeclaration, checker, out); } } - return newNodes; } codefix.createMissingMemberNodes = createMissingMemberNodes; - function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker, out) { var declarations = symbol.getDeclarations(); if (!(declarations && declarations.length)) { return undefined; } var declaration = declarations[0]; - var name = ts.getSynthesizedClone(ts.getNameOfDeclaration(declaration)); + var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration)); var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); var optional = !!(symbol.flags & 16777216); switch (declaration.kind) { - case 154: case 155: - case 149: + case 156: case 150: - var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); - var property = ts.createProperty(undefined, modifiers, name, optional ? ts.createToken(55) : undefined, typeNode, undefined); - return property; case 151: + var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); + out(ts.createProperty(undefined, modifiers, name, optional ? ts.createToken(55) : undefined, typeNode, undefined)); + break; case 152: + case 153: var signatures = checker.getSignaturesOfType(type, 0); if (!ts.some(signatures)) { - return undefined; + break; } if (declarations.length === 1) { ts.Debug.assert(signatures.length === 1); var signature = signatures[0]; - return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + outputMethod(signature, modifiers, name, createStubbedMethodBody()); + break; } - var signatureDeclarations = []; for (var _i = 0, signatures_8 = signatures; _i < signatures_8.length; _i++) { var signature = signatures_8[_i]; - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + outputMethod(signature, getSynthesizedDeepClones(modifiers), ts.getSynthesizedDeepClone(name)); } if (declarations.length > signatures.length) { var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + outputMethod(signature, modifiers, name, createStubbedMethodBody()); } else { ts.Debug.assert(declarations.length === signatures.length); - var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); - signatureDeclarations.push(methodImplementingSignatures); + out(createMethodImplementingSignatures(signatures, name, optional, modifiers)); } - return signatureDeclarations; - default: - return undefined; + break; } - function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 152, enclosingDeclaration, ts.NodeBuilderFlags.SuppressAnyReturnType); - if (signatureDeclaration) { - signatureDeclaration.decorators = undefined; - signatureDeclaration.modifiers = modifiers; - signatureDeclaration.name = name; - signatureDeclaration.questionToken = optional ? ts.createToken(55) : undefined; - signatureDeclaration.body = body; - } - return signatureDeclaration; + function outputMethod(signature, modifiers, name, body) { + var method = signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body); + if (method) + out(method); } } - function createMethodFromCallExpression(callExpression, methodName, includeTypeScriptSyntax, makeStatic) { - var parameters = createDummyParameters(callExpression.arguments.length, undefined, undefined, includeTypeScriptSyntax); - var typeParameters; - if (includeTypeScriptSyntax) { - var typeArgCount = ts.length(callExpression.typeArguments); - for (var i = 0; i < typeArgCount; i++) { - var name = typeArgCount < 8 ? String.fromCharCode(84 + i) : "T" + i; - var typeParameter = ts.createTypeParameterDeclaration(name, undefined, undefined); - (typeParameters ? typeParameters : typeParameters = []).push(typeParameter); - } + function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 153, enclosingDeclaration, 256); + if (!signatureDeclaration) { + return undefined; } - var newMethod = ts.createMethod(undefined, makeStatic ? [ts.createToken(115)] : undefined, undefined, methodName, undefined, typeParameters, parameters, includeTypeScriptSyntax ? ts.createKeywordTypeNode(119) : undefined, createStubbedMethodBody()); - return newMethod; + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(55) : undefined; + signatureDeclaration.body = body; + return signatureDeclaration; + } + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(ts.getSynthesizedDeepClone)); + } + function createMethodFromCallExpression(_a, methodName, inJs, makeStatic) { + var typeArguments = _a.typeArguments, args = _a.arguments; + return ts.createMethod(undefined, makeStatic ? [ts.createToken(115)] : undefined, undefined, methodName, undefined, inJs ? undefined : ts.map(typeArguments, function (_, i) { + return ts.createTypeParameterDeclaration(84 + typeArguments.length - 1 <= 90 ? String.fromCharCode(84 + i) : "T" + i); + }), createDummyParameters(args.length, undefined, undefined, inJs), inJs ? undefined : ts.createKeywordTypeNode(119), createStubbedMethodBody()); } codefix.createMethodFromCallExpression = createMethodFromCallExpression; - function createDummyParameters(argCount, names, minArgumentCount, addAnyType) { + function createDummyParameters(argCount, names, minArgumentCount, inJs) { var parameters = []; for (var i = 0; i < argCount; i++) { - var newParameter = ts.createParameter(undefined, undefined, undefined, names && names[i] || "arg" + i, minArgumentCount !== undefined && i >= minArgumentCount ? ts.createToken(55) : undefined, addAnyType ? ts.createKeywordTypeNode(119) : undefined, undefined); + var newParameter = ts.createParameter(undefined, undefined, undefined, names && names[i] || "arg" + i, minArgumentCount !== undefined && i >= minArgumentCount ? ts.createToken(55) : undefined, inJs ? undefined : ts.createKeywordTypeNode(119), undefined); parameters.push(newParameter); } return parameters; @@ -77743,7 +79719,7 @@ var ts; } var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.name; }); - var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, true); + var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, false); if (someSigHasRestParameter) { var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(119)); var restParameter = ts.createParameter(undefined, undefined, ts.createToken(24), maxArgsParameterSymbolNames[maxNonRestArgs] || "rest", maxNonRestArgs >= minArgumentCount ? ts.createToken(55) : undefined, anyArrayType, undefined); @@ -77754,7 +79730,6 @@ var ts; function createStubbedMethod(modifiers, name, optional, typeParameters, parameters, returnType) { return ts.createMethod(undefined, modifiers, undefined, name, optional ? ts.createToken(55) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); } - codefix.createStubbedMethod = createStubbedMethod; function createStubbedMethodBody() { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), undefined, [ts.createLiteral("Method not implemented.")]))], true); } @@ -77773,216 +79748,224 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "inferFromUsage"; + var errorCodes = [ + ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, + ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, + ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, + ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, + ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, + ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, + ]; codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, - ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, - ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, - ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, - ], - getCodeActions: getActionsForAddExplicitTypeAnnotation + errorCodes: errorCodes, + getCodeActions: function (_a) { + var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; + if (ts.isSourceFileJavaScript(sourceFile)) { + return undefined; + } + var token = ts.getTokenAtPosition(sourceFile, start, false); + var fix = getFix(sourceFile, token, errorCode, program, cancellationToken); + if (!fix) + return undefined; + var declaration = fix.declaration, textChanges = fix.textChanges; + var name = ts.getNameOfDeclaration(declaration); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name.getText()]); + return [{ description: description, changes: [{ fileName: sourceFile.fileName, textChanges: textChanges }], fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken; + var seenFunctions = ts.createMap(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var fix = getFix(sourceFile, ts.getTokenAtPosition(err.file, err.start, false), err.code, program, cancellationToken, seenFunctions); + if (fix) + changes.push.apply(changes, fix.textChanges); + }); + }, }); - function getActionsForAddExplicitTypeAnnotation(_a) { - var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; - var token = ts.getTokenAtPosition(sourceFile, start, false); - var writer; - if (ts.isInJavaScriptFile(token)) { + function getDiagnostic(errorCode, token) { + switch (errorCode) { + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + return ts.isSetAccessor(ts.getContainingFunction(token)) ? ts.Diagnostics.Infer_type_of_0_from_usage : ts.Diagnostics.Infer_parameter_types_from_usage; + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return ts.Diagnostics.Infer_parameter_types_from_usage; + default: + return ts.Diagnostics.Infer_type_of_0_from_usage; + } + } + function getFix(sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { + if (!isAllowedTokenKind(token.kind)) { return undefined; } - switch (token.kind) { + switch (errorCode) { + case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: + case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: + return getCodeActionForVariableDeclaration(token.parent, program, cancellationToken); + case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: { + var symbol = program.getTypeChecker().getSymbolAtLocation(token); + return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration, program, cancellationToken); + } + } + var containingFunction = ts.getContainingFunction(token); + if (containingFunction === undefined) { + return undefined; + } + switch (errorCode) { + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + if (ts.isSetAccessor(containingFunction)) { + return getCodeActionForSetAccessor(containingFunction, program, cancellationToken); + } + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return !seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction)) + ? getCodeActionForParameters(ts.cast(token.parent, ts.isParameter), containingFunction, sourceFile, program, cancellationToken) + : undefined; + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: + case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: + return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: + return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, program, cancellationToken) : undefined; + default: + throw ts.Debug.fail(String(errorCode)); + } + } + function isAllowedTokenKind(kind) { + switch (kind) { case 71: case 24: case 114: case 112: case 113: - case 131: - break; + case 132: + return true; default: - return undefined; + return false; } - var containingFunction = ts.getContainingFunction(token); - var checker = program.getTypeChecker(); - switch (errorCode) { - case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: - case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: - return getCodeActionForVariableDeclaration(token.parent); - case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: - return getCodeActionForVariableUsage(token); - case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: - if (ts.isSetAccessor(containingFunction)) { - return getCodeActionForSetAccessor(containingFunction); - } - case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - return getCodeActionForParameters(token.parent); - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: - case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: - return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction) : undefined; - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: - return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction) : undefined; + } + function getCodeActionForVariableDeclaration(declaration, program, cancellationToken) { + if (!ts.isIdentifier(declaration.name)) + return undefined; + var type = inferTypeForVariableFromUsage(declaration.name, program, cancellationToken); + return makeFix(declaration, declaration.name.getEnd(), type, program); + } + function isApplicableFunctionForInference(declaration) { + switch (declaration.kind) { + case 232: + case 153: + case 154: + return true; + case 190: + return !!declaration.name; } - return undefined; - function getCodeActionForVariableDeclaration(declaration) { - if (!ts.isIdentifier(declaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(declaration.name); - var typeString = type && typeToString(type, declaration); - if (!typeString) { - return undefined; - } - return createCodeActions(declaration.name.getText(), declaration.name.getEnd(), ": " + typeString); - } - function getCodeActionForVariableUsage(token) { - var symbol = checker.getSymbolAtLocation(token); - return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration); - } - function isApplicableFunctionForInference(declaration) { - switch (declaration.kind) { - case 229: - case 152: - case 153: - return true; - case 187: - return !!declaration.name; - } - return false; - } - function getCodeActionForParameters(parameterDeclaration) { - if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { - return undefined; - } - var types = inferTypeForParametersFromUsage(containingFunction) || - ts.map(containingFunction.parameters, function (p) { return ts.isIdentifier(p.name) && inferTypeForVariableFromUsage(p.name); }); - if (!types) { - return undefined; - } - var textChanges = ts.zipWith(containingFunction.parameters, types, function (parameter, type) { - if (type && !parameter.type && !parameter.initializer) { - var typeString = typeToString(type, containingFunction); - return typeString ? { - span: { start: parameter.end, length: 0 }, - newText: ": " + typeString - } : undefined; - } - }).filter(function (c) { return !!c; }); - return textChanges.length ? [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_parameter_types_from_usage), [parameterDeclaration.name.getText()]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: textChanges - }] - }] : undefined; - } - function getCodeActionForSetAccessor(setAccessorDeclaration) { - var setAccessorParameter = setAccessorDeclaration.parameters[0]; - if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name) || - inferTypeForVariableFromUsage(setAccessorParameter.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - return createCodeActions(setAccessorDeclaration.name.getText(), setAccessorParameter.name.getEnd(), ": " + typeString); - } - function getCodeActionForGetAccessor(getAccessorDeclaration) { - if (!ts.isIdentifier(getAccessorDeclaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - var closeParenToken = getFirstChildOfKind(getAccessorDeclaration, sourceFile, 20); - return createCodeActions(getAccessorDeclaration.name.getText(), closeParenToken.getEnd(), ": " + typeString); - } - function createCodeActions(name, start, typeString) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_type_of_0_from_usage), [name]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: start, length: 0 }, - newText: typeString - }] - }] - }]; - } - function getReferences(token) { - var references = ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), token.getSourceFile(), token.getStart()); - ts.Debug.assert(!!references, "Found no references!"); - ts.Debug.assert(references.length === 1, "Found more references than expected"); - return ts.map(references[0].references, function (r) { return ts.getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, false); }); - } - function inferTypeForVariableFromUsage(token) { - return InferFromReference.inferTypeFromReferences(getReferences(token), checker, cancellationToken); - } - function inferTypeForParametersFromUsage(containingFunction) { - switch (containingFunction.kind) { - case 153: - case 187: - case 229: - case 152: - var isConstructor = containingFunction.kind === 153; - var searchToken = isConstructor ? - getFirstChildOfKind(containingFunction, sourceFile, 123) : - containingFunction.name; - if (searchToken) { - return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken), containingFunction, checker, cancellationToken); - } - } - } - function getTypeAccessiblityWriter() { - if (!writer) { - var str_1 = ""; - var typeIsAccessible_1 = true; - var writeText = function (text) { return str_1 += text; }; - writer = { - string: function () { return typeIsAccessible_1 ? str_1 : undefined; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeProperty: writeText, - writeSymbol: writeText, - writeLine: function () { return str_1 += " "; }, - increaseIndent: ts.noop, - decreaseIndent: ts.noop, - clear: function () { str_1 = ""; typeIsAccessible_1 = true; }, - trackSymbol: function (symbol, declaration, meaning) { - if (checker.isSymbolAccessible(symbol, declaration, meaning, false).accessibility !== 0) { - typeIsAccessible_1 = false; - } - }, - reportInaccessibleThisError: function () { typeIsAccessible_1 = false; }, - reportPrivateInBaseOfClassExpression: function () { typeIsAccessible_1 = false; }, - reportInaccessibleUniqueSymbolError: function () { typeIsAccessible_1 = false; } - }; - } - writer.clear(); - return writer; - } - function typeToString(type, enclosingDeclaration) { - var writer = getTypeAccessiblityWriter(); - checker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration); - return writer.string(); - } - function getFirstChildOfKind(node, sourcefile, kind) { - for (var _i = 0, _a = node.getChildren(sourcefile); _i < _a.length; _i++) { - var child = _a[_i]; - if (child.kind === kind) - return child; - } + return false; + } + function getCodeActionForParameters(parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { return undefined; } + var types = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) || + containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : undefined; }); + if (!types) + return undefined; + if (containingFunction.parameters.length !== types.length) { + return undefined; + } + var textChanges = ts.arrayFrom(ts.mapDefinedIterator(ts.zipToIterator(containingFunction.parameters, types), function (_a) { + var parameter = _a[0], type = _a[1]; + return type && !parameter.type && !parameter.initializer ? makeChange(containingFunction, parameter.end, type, program) : undefined; + })); + return textChanges.length ? { declaration: parameterDeclaration, textChanges: textChanges } : undefined; + } + function getCodeActionForSetAccessor(setAccessorDeclaration, program, cancellationToken) { + var setAccessorParameter = setAccessorDeclaration.parameters[0]; + if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken) || + inferTypeForVariableFromUsage(setAccessorParameter.name, program, cancellationToken); + return makeFix(setAccessorParameter, setAccessorParameter.name.getEnd(), type, program); + } + function getCodeActionForGetAccessor(getAccessorDeclaration, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(getAccessorDeclaration.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name, program, cancellationToken); + var closeParenToken = ts.findChildOfKind(getAccessorDeclaration, 20, sourceFile); + return makeFix(getAccessorDeclaration, closeParenToken.getEnd(), type, program); + } + function makeFix(declaration, start, type, program) { + return type && { declaration: declaration, textChanges: [makeChange(declaration, start, type, program)] }; + } + function makeChange(declaration, start, type, program) { + var typeString = type && typeToString(type, declaration, program.getTypeChecker()); + return typeString === undefined ? undefined : ts.createTextChangeFromStartLength(start, 0, ": " + typeString); + } + function getReferences(token, program, cancellationToken) { + return ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function (entry) { + return entry.type === "node" ? ts.tryCast(entry.node, ts.isIdentifier) : undefined; + }); + } + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + return InferFromReference.inferTypeFromReferences(getReferences(token, program, cancellationToken), program.getTypeChecker(), cancellationToken); + } + function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) { + switch (containingFunction.kind) { + case 154: + case 190: + case 232: + case 153: + var isConstructor = containingFunction.kind === 154; + var searchToken = isConstructor ? + ts.findChildOfKind(containingFunction, 123, sourceFile) : + containingFunction.name; + if (searchToken) { + return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); + } + } + } + function getTypeAccessiblityWriter(checker) { + var str = ""; + var typeIsAccessible = true; + var writeText = function (text) { return str += text; }; + return { + getText: function () { return typeIsAccessible ? str : undefined; }, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: writeText, + write: writeText, + writeTextOfNode: writeText, + rawWrite: writeText, + writeLiteral: writeText, + getTextPos: function () { return 0; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + writeLine: function () { return writeText(" "); }, + increaseIndent: ts.noop, + decreaseIndent: ts.noop, + clear: function () { str = ""; typeIsAccessible = true; }, + trackSymbol: function (symbol, declaration, meaning) { + if (checker.isSymbolAccessible(symbol, declaration, meaning, false).accessibility !== 0) { + typeIsAccessible = false; + } + }, + reportInaccessibleThisError: function () { typeIsAccessible = false; }, + reportPrivateInBaseOfClassExpression: function () { typeIsAccessible = false; }, + reportInaccessibleUniqueSymbolError: function () { typeIsAccessible = false; } + }; + } + function typeToString(type, enclosingDeclaration, checker) { + var writer = getTypeAccessiblityWriter(checker); + checker.writeType(type, enclosingDeclaration, undefined, writer); + return writer.getText(); } var InferFromReference; (function (InferFromReference) { @@ -77997,40 +79980,43 @@ var ts; } InferFromReference.inferTypeFromReferences = inferTypeFromReferences; function inferTypeForParametersFromReferences(references, declaration, checker, cancellationToken) { - if (declaration.parameters) { - var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; - cancellationToken.throwIfCancellationRequested(); - inferTypeFromContext(reference, checker, usageContext); - } - var isConstructor = declaration.kind === 153; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - if (callContexts) { - var paramTypes = []; - for (var parameterIndex = 0; parameterIndex < declaration.parameters.length; parameterIndex++) { - var types = []; - var isRestParameter_1 = ts.isRestParameter(declaration.parameters[parameterIndex]); - for (var _a = 0, callContexts_1 = callContexts; _a < callContexts_1.length; _a++) { - var callContext = callContexts_1[_a]; - if (callContext.argumentTypes.length > parameterIndex) { - if (isRestParameter_1) { - types = ts.concatenate(types, ts.map(callContext.argumentTypes.slice(parameterIndex), function (a) { return checker.getBaseTypeOfLiteralType(a); })); - } - else { - types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); - } - } - } - if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, true)); - paramTypes[parameterIndex] = isRestParameter_1 ? checker.createArrayType(type) : type; + if (references.length === 0) { + return undefined; + } + if (!declaration.parameters) { + return undefined; + } + var usageContext = {}; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + var isConstructor = declaration.kind === 154; + var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; + return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var types = []; + var isRestParameter = ts.isRestParameter(parameter); + for (var _i = 0, callContexts_1 = callContexts; _i < callContexts_1.length; _i++) { + var callContext = callContexts_1[_i]; + if (callContext.argumentTypes.length <= parameterIndex) { + continue; + } + if (isRestParameter) { + for (var i = parameterIndex; i < callContext.argumentTypes.length; i++) { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); } } - return paramTypes; + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } } - } - return undefined; + if (!types.length) { + return undefined; + } + var type = checker.getWidenedType(checker.getUnionType(types, 2)); + return isRestParameter ? checker.createArrayType(type) : type; + }); } InferFromReference.inferTypeForParametersFromReferences = inferTypeForParametersFromReferences; function inferTypeFromContext(node, checker, usageContext) { @@ -78038,21 +80024,21 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 194: + case 197: usageContext.isNumber = true; break; - case 193: + case 196: inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); break; - case 195: + case 198: inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); break; - case 261: - case 262: + case 264: + case 265: inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); break; - case 182: - case 183: + case 185: + case 186: if (node.parent.expression === node) { inferTypeFromCallExpressionContext(node.parent, checker, usageContext); } @@ -78060,10 +80046,10 @@ var ts; inferTypeFromContextualType(node, checker, usageContext); } break; - case 180: + case 183: inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); break; - case 181: + case 184: inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); break; default: @@ -78154,7 +80140,7 @@ var ts; break; case 54: if (node === parent.left && - (node.parent.parent.kind === 227 || ts.isAssignmentExpression(node.parent.parent, true))) { + (node.parent.parent.kind === 230 || ts.isAssignmentExpression(node.parent.parent, true))) { addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); } break; @@ -78179,7 +80165,7 @@ var ts; } } inferTypeFromContext(parent, checker, callContext.returnType); - if (parent.kind === 182) { + if (parent.kind === 185) { (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); } else { @@ -78223,12 +80209,12 @@ var ts; return checker.getStringType(); } else if (usageContext.candidateTypes) { - return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), true)); + return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), 2)); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, false, checker); var types = paramType.getCallSignatures().map(function (c) { return c.getReturnType(); }); - return checker.createPromiseType(types.length ? checker.getUnionType(types, true) : checker.getAnyType()); + return checker.createPromiseType(types.length ? checker.getUnionType(types, 2) : checker.getAnyType()); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("push"))) { return checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, false, checker)); @@ -78286,7 +80272,7 @@ var ts; } } if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, true)); + var type = checker.getWidenedType(checker.getUnionType(types, 2)); return isRestParameter ? checker.createArrayType(type) : type; } return undefined; @@ -78313,19 +80299,81 @@ var ts; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime.code], + getCodeActions: getActionsForInvalidImport + }); + function getActionsForInvalidImport(context) { + var sourceFile = context.sourceFile; + var node = ts.getTokenAtPosition(sourceFile, context.span.start, false).parent; + if (!ts.isImportDeclaration(node)) { + return []; + } + return getCodeFixesForImportDeclaration(context, node); + } + function getCodeFixesForImportDeclaration(context, node) { + var sourceFile = ts.getSourceFileOfNode(node); + var namespace = ts.getNamespaceDeclarationNode(node); + var opts = context.program.getCompilerOptions(); + var variations = []; + variations.push(createAction(context, sourceFile, node, ts.createImportDeclaration(undefined, undefined, ts.createImportClause(namespace.name, undefined), node.moduleSpecifier))); + if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) { + variations.push(createAction(context, sourceFile, node, ts.createImportEqualsDeclaration(undefined, undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)))); + } + return variations; + } + function createAction(context, sourceFile, node, replacement) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceRange(sourceFile, { pos: node.getStart(), end: node.end }, replacement); }); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), + changes: changes, + }; + } + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code, + ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature.code, + ], + getCodeActions: getActionsForUsageOfInvalidImport + }); + function getActionsForUsageOfInvalidImport(context) { + var sourceFile = context.sourceFile; + var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 185 : 186; + var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start, false), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); }); + if (!node) { + return []; + } + var expr = node.expression; + var type = context.program.getTypeChecker().getTypeAtLocation(expr); + if (!(type.symbol && type.symbol.originatingImport)) { + return []; + } + var fixes = []; + var relatedImport = type.symbol.originatingImport; + if (!ts.isImportCall(relatedImport)) { + ts.addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport)); + } + fixes.push({ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Use_synthetic_default_member), + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, expr, ts.createPropertyAccess(expr, "default"), {}); }), + }); + return fixes; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var refactor; (function (refactor) { var annotateWithTypeFromJSDoc; (function (annotateWithTypeFromJSDoc) { + var refactorName = "Annotate with type from JSDoc"; var actionName = "annotate"; - var annotateTypeFromJSDoc = { - name: "Annotate with type from JSDoc", - description: ts.Diagnostics.Annotate_with_type_from_JSDoc.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(annotateTypeFromJSDoc); + var description = ts.Diagnostics.Annotate_with_type_from_JSDoc.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.isInJavaScriptFile(context.file)) { return undefined; @@ -78333,11 +80381,11 @@ var ts; var node = ts.getTokenAtPosition(context.file, context.startPosition, false); if (hasUsableJSDoc(ts.findAncestor(node, isDeclarationWithType))) { return [{ - name: annotateTypeFromJSDoc.name, - description: annotateTypeFromJSDoc.description, + name: refactorName, + description: description, actions: [ { - description: annotateTypeFromJSDoc.description, + description: description, name: actionName } ] @@ -78364,7 +80412,7 @@ var ts; } var jsdocType = ts.getJSDocType(decl); var isFunctionWithJSDoc = ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); })); - if (isFunctionWithJSDoc || jsdocType && decl.kind === 147) { + if (isFunctionWithJSDoc || jsdocType && decl.kind === 148) { return getEditsForFunctionAnnotation(context); } else if (jsdocType) { @@ -78385,7 +80433,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var declarationWithType = addType(decl, transformJSDocType(jsdocType)); ts.suppressLeadingAndTrailingTrivia(declarationWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, declarationWithType); + changeTracker.replaceNode(sourceFile, decl, declarationWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -78399,7 +80447,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var functionWithType = addTypesToFunctionLike(decl); ts.suppressLeadingAndTrailingTrivia(functionWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, functionWithType); + changeTracker.replaceNode(sourceFile, decl, functionWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -78408,29 +80456,29 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 227 || - node.kind === 147 || - node.kind === 149 || - node.kind === 150; + node.kind === 230 || + node.kind === 148 || + node.kind === 150 || + node.kind === 151; } function addTypesToFunctionLike(decl) { var typeParameters = ts.getEffectiveTypeParameterDeclarations(decl, true); var parameters = decl.parameters.map(function (p) { return ts.createParameter(p.decorators, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, transformJSDocType(ts.getEffectiveTypeAnnotationNode(p, true)), p.initializer); }); var returnType = transformJSDocType(ts.getEffectiveReturnTypeNode(decl, true)); switch (decl.kind) { - case 229: + case 232: return ts.createFunctionDeclaration(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 153: - return ts.createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); - case 187: - return ts.createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 188: - return ts.createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); - case 152: - return ts.createMethod(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, decl.questionToken, typeParameters, parameters, returnType, decl.body); case 154: - return ts.createGetAccessor(decl.decorators, decl.modifiers, decl.name, decl.parameters, returnType, decl.body); + return ts.createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); + case 190: + return ts.createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); + case 191: + return ts.createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); + case 153: + return ts.createMethod(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, decl.questionToken, typeParameters, parameters, returnType, decl.body); case 155: + return ts.createGetAccessor(decl.decorators, decl.modifiers, decl.name, decl.parameters, returnType, decl.body); + case 156: return ts.createSetAccessor(decl.decorators, decl.modifiers, decl.name, parameters, decl.body); default: return ts.Debug.assertNever(decl, "Unexpected SyntaxKind: " + decl.kind); @@ -78438,11 +80486,11 @@ var ts; } function addType(decl, jsdocType) { switch (decl.kind) { - case 227: + case 230: return ts.createVariableDeclaration(decl.name, jsdocType, decl.initializer); - case 149: - return ts.createPropertySignature(decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); case 150: + return ts.createPropertySignature(decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); + case 151: return ts.createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); default: return ts.Debug.fail("Unexpected SyntaxKind: " + decl.kind); @@ -78453,22 +80501,22 @@ var ts; return undefined; } switch (node.kind) { - case 272: - case 273: - return ts.createTypeReferenceNode("any", ts.emptyArray); - case 276: - return transformJSDocOptionalType(node); case 275: - return transformJSDocType(node.type); - case 274: - return transformJSDocNullableType(node); + case 276: + return ts.createTypeReferenceNode("any", ts.emptyArray); + case 279: + return transformJSDocOptionalType(node); case 278: - return transformJSDocVariadicType(node); + return transformJSDocType(node.type); case 277: + return transformJSDocNullableType(node); + case 281: + return transformJSDocVariadicType(node); + case 280: return transformJSDocFunctionType(node); - case 147: + case 148: return transformJSDocParameter(node); - case 160: + case 161: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, undefined); @@ -78491,7 +80539,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 278 && index === node.parent.parameters.length - 1; + var isRest = node.type.kind === 281 && index === node.parent.parameters.length - 1; var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(24) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -78528,7 +80576,7 @@ var ts; return ts.createTypeReferenceNode(name, args); } function transformJSDocIndexSignature(node) { - var index = ts.createParameter(undefined, undefined, undefined, node.typeArguments[0].kind === 133 ? "n" : "s", undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 133 ? "number" : "string", []), undefined); + var index = ts.createParameter(undefined, undefined, undefined, node.typeArguments[0].kind === 134 ? "n" : "s", undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 134 ? "number" : "string", []), undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(undefined, undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1); return indexSignature; @@ -78541,15 +80589,11 @@ var ts; var refactor; (function (refactor) { var convertFunctionToES6Class; - (function (convertFunctionToES6Class_1) { + (function (convertFunctionToES6Class) { + var refactorName = "Convert to ES2015 class"; var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); + var description = ts.Diagnostics.Convert_function_to_an_ES2015_class.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (!ts.isInJavaScriptFile(context.file)) { return undefined; @@ -78564,11 +80608,11 @@ var ts; if ((symbol.flags & 16) && symbol.members && (symbol.members.size > 0)) { return [ { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, + name: refactorName, + description: description, actions: [ { - description: convertFunctionToES6Class.description, + description: description, name: actionName } ] @@ -78582,7 +80626,6 @@ var ts; } var sourceFile = context.file; var ctorSymbol = getConstructorSymbol(context); - var newLine = context.formatContext.options.newLineCharacter; var deletedNodes = []; var deletes = []; if (!(ctorSymbol.flags & (16 | 3))) { @@ -78593,12 +80636,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 229: + case 232: precedingNode = ctorDeclaration; deleteNode(ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 227: + case 230: precedingNode = ctorDeclaration.parent.parent; if (ctorDeclaration.parent.declarations.length === 1) { deleteNode(precedingNode); @@ -78612,7 +80655,7 @@ var ts; if (!newClassDeclaration) { return undefined; } - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { var deleteCallback = deletes_1[_i]; deleteCallback(); @@ -78666,30 +80709,29 @@ var ts; if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { return; } - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 211 + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 214 ? assignmentBinaryExpression.parent : assignmentBinaryExpression; deleteNode(nodeToDelete); if (!assignmentBinaryExpression.right) { return ts.createProperty([], modifiers, symbol.name, undefined, undefined, undefined); } switch (assignmentBinaryExpression.right.kind) { - case 187: { + case 190: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120)); var method = ts.createMethod(undefined, fullModifiers, undefined, memberDeclaration.name, undefined, undefined, functionExpression.parameters, undefined, functionExpression.body); copyComments(assignmentBinaryExpression, method); return method; } - case 188: { + case 191: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; - if (arrowFunctionBody.kind === 208) { + if (arrowFunctionBody.kind === 211) { bodyBlock = arrowFunctionBody; } else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + bodyBlock = ts.createBlock([ts.createReturn(arrowFunctionBody)]); } var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120)); var method = ts.createMethod(undefined, fullModifiers, undefined, memberDeclaration.name, undefined, undefined, arrowFunction.parameters, undefined, bodyBlock); @@ -78721,7 +80763,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 187) { + if (!initializer || initializer.kind !== 190) { return undefined; } if (node.name.kind !== 71) { @@ -78758,18 +80800,446 @@ var ts; })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); var ts; +(function (ts) { + var refactor; + (function (refactor) { + var actionName = "Convert to ES6 module"; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); + function getAvailableActions(context) { + var file = context.file, startPosition = context.startPosition; + if (!ts.isSourceFileJavaScript(file) || !file.commonJsModuleIndicator) { + return undefined; + } + var node = ts.getTokenAtPosition(file, startPosition, false); + return !isAtTriggerLocation(file, node) ? undefined : [ + { + name: actionName, + description: description, + actions: [ + { + description: description, + name: actionName, + }, + ], + }, + ]; + } + function isAtTriggerLocation(sourceFile, node, onSecondTry) { + if (onSecondTry === void 0) { onSecondTry = false; } + switch (node.kind) { + case 185: + return isAtTopLevelRequire(node); + case 183: + return ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression); + case 231: + return isVariableDeclarationTriggerLocation(ts.firstOrUndefined(node.declarations)); + case 230: + return isVariableDeclarationTriggerLocation(node); + default: + return ts.isExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, true); + } + function isVariableDeclarationTriggerLocation(decl) { + return !!decl && !!decl.initializer && ts.isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); + } + } + function isAtTopLevelRequire(call) { + if (!ts.isRequireCall(call, true)) { + return false; + } + var propAccess = call.parent; + var varDecl = ts.isPropertyAccessExpression(propAccess) ? propAccess.parent : propAccess; + if (ts.isExpressionStatement(varDecl) && ts.isSourceFile(varDecl.parent)) { + return true; + } + if (!ts.isVariableDeclaration(varDecl)) { + return false; + } + var varDeclList = varDecl.parent; + if (varDeclList.kind !== 231) { + return false; + } + var varStatement = varDeclList.parent; + return varStatement.kind === 212 && varStatement.parent.kind === 272; + } + function getEditsForAction(context, _actionName) { + ts.Debug.assertEqual(actionName, _actionName); + var file = context.file, program = context.program; + ts.Debug.assert(ts.isSourceFileJavaScript(file)); + var edits = ts.textChanges.ChangeTracker.with(context, function (changes) { + var moduleExportsChangedToDefault = convertFileToEs6Module(file, program.getTypeChecker(), changes, program.getCompilerOptions().target); + if (moduleExportsChangedToDefault) { + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var importingFile = _a[_i]; + fixImportOfModuleExports(importingFile, file, changes); + } + } + }); + return { edits: edits, renameFilename: undefined, renameLocation: undefined }; + } + function fixImportOfModuleExports(importingFile, exportingFile, changes) { + for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + var parent = moduleSpecifier.parent; + switch (parent.kind) { + case 252: { + var importEq = parent.parent; + changes.replaceNode(importingFile, importEq, makeImport(importEq.name, undefined, moduleSpecifier.text)); + break; + } + case 185: { + var call = parent; + if (ts.isRequireCall(call, false)) { + changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); + } + break; + } + } + } + } + function convertFileToEs6Module(sourceFile, checker, changes, target) { + var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; + var exports = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports, changes); + var moduleExportsChangedToDefault = false; + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + var res = ts.createMap(); + forEachExportReference(sourceFile, function (node) { + var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; + if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) + || checker.resolveName(node.name.text, node, 107455, true))) { + res.set(text, makeUniqueName("_" + text, identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports, changes) { + forEachExportReference(sourceFile, function (node, isAssignmentLhs) { + if (isAssignmentLhs) { + return; + } + var text = node.name.text; + changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { + var parent = node.parent; + cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { + switch (statement.kind) { + case 212: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); + return false; + case 214: { + var expression = statement.expression; + switch (expression.kind) { + case 185: { + if (ts.isRequireCall(expression, true)) { + changes.replaceNode(sourceFile, statement, makeImport(undefined, undefined, expression.arguments[0].text)); + } + return false; + } + case 198: { + var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return operatorToken.kind === 58 && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); + } + } + } + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { + var declarationList = statement.declarationList; + var foundImport = false; + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { + var name = decl.name, initializer = decl.initializer; + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + foundImport = true; + return []; + } + if (ts.isRequireCall(initializer, true)) { + foundImport = true; + return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); + } + else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, true)) { + foundImport = true; + return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); + } + else { + return ts.createVariableStatement(undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); + } + }); + if (foundImport) { + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + } + function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { + switch (name.kind) { + case 178: + case 179: { + var tmp = makeUniqueName(propertyName, identifiers); + return [ + makeSingleImport(tmp, propertyName, moduleSpecifier), + makeConst(undefined, name, ts.createIdentifier(tmp)), + ]; + } + case 71: + return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; + default: + ts.Debug.assertNever(name); + } + } + function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { + if (!ts.isPropertyAccessExpression(left)) { + return false; + } + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { + changes.deleteNode(sourceFile, statement); + } + else { + var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; + var changedToDefaultExport = false; + if (!newNodes) { + (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); + } + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + return changedToDefaultExport; + } + } + else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, statement, left.name, right, changes, exports); + } + return false; + var _a; + } + function tryChangeModuleExportsObject(object) { + return ts.mapAllOrFail(object.properties, function (prop) { + switch (prop.kind) { + case 155: + case 156: + case 269: + case 270: + return undefined; + case 268: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals(prop.name.text, prop.initializer); + case 153: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(84)], prop); + default: + ts.Debug.assertNever(prop); + } + }); + } + function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { + var text = propertyName.text; + var rename = exports.get(text); + if (rename !== undefined) { + var newNodes = [ + makeConst(undefined, rename, right), + makeExportDeclaration([ts.createExportSpecifier(rename, text)]), + ]; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + else { + changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); + } + } + function convertModuleExportsToExportDefault(exported, checker) { + var modifiers = [ts.createToken(84), ts.createToken(79)]; + switch (exported.kind) { + case 190: + case 191: { + var fn = exported; + return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; + } + case 203: { + var cls = exported; + return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; + } + case 185: + if (ts.isRequireCall(exported, true)) { + return convertReExportAll(exported.arguments[0], checker); + } + default: + return [[ts.createExportAssignment(undefined, undefined, false, exported)], true]; + } + } + function convertReExportAll(reExported, checker) { + var moduleSpecifier = reExported.text; + var moduleSymbol = checker.getSymbolAtLocation(reExported); + var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; + return exports.has("export=") + ? [[reExportDefault(moduleSpecifier)], true] + : !exports.has("default") + ? [[reExportStar(moduleSpecifier)], false] + : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration(undefined, moduleSpecifier); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([ts.createExportSpecifier(undefined, "default")], moduleSpecifier); + } + function convertExportsDotXEquals(name, exported) { + var modifiers = [ts.createToken(84)]; + switch (exported.kind) { + case 190: { + var expressionName = exported.name; + if (expressionName && expressionName.text !== name) { + return exportConst(); + } + } + case 191: + return functionExpressionToDeclaration(name, modifiers, exported); + case 203: + return classExpressionToDeclaration(name, modifiers, exported); + default: + return exportConst(); + } + function exportConst() { + return makeConst(modifiers, ts.createIdentifier(name), exported); + } + } + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { + switch (name.kind) { + case 178: { + var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { + return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) + ? undefined + : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); + }); + if (importSpecifiers) { + return [makeImport(undefined, importSpecifiers, moduleSpecifier)]; + } + } + case 179: { + var tmp = makeUniqueName(ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); + return [ + makeImport(ts.createIdentifier(tmp), undefined, moduleSpecifier), + makeConst(undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), + ]; + } + case 71: + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); + default: + ts.Debug.assertNever(name); + } + } + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { + var nameSymbol = checker.getSymbolAtLocation(name); + var namedBindingsNames = ts.createMap(); + var needDefaultImport = false; + for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { + var use = _a[_i]; + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { + continue; + } + var parent = use.parent; + if (ts.isPropertyAccessExpression(parent)) { + var expression = parent.expression, propertyName = parent.name.text; + ts.Debug.assert(expression === use); + var idName = namedBindingsNames.get(propertyName); + if (idName === undefined) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + changes.replaceNode(file, parent, ts.createIdentifier(idName)); + } + else { + needDefaultImport = true; + } + } + var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { + var propertyName = _a[0], idName = _a[1]; + return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); + })); + if (!namedBindings) { + needDefaultImport = true; + } + return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; + } + function makeUniqueName(name, identifiers) { + while (identifiers.original.has(name) || identifiers.additional.has(name)) { + name = "_" + name; + } + identifiers.additional.set(name, true); + return name; + } + function collectFreeIdentifiers(file) { + var map = ts.createMultiMap(); + file.forEachChild(function recur(node) { + if (ts.isIdentifier(node) && isFreeIdentifier(node)) { + map.add(node.text, node); + } + node.forEachChild(recur); + }); + return map; + } + function isFreeIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 183: + return parent.name !== node; + case 180: + return parent.propertyName !== node; + default: + return true; + } + } + function functionExpressionToDeclaration(name, additionalModifiers, fn) { + return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); + } + function classExpressionToDeclaration(name, additionalModifiers, cls) { + return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); + } + function makeSingleImport(localName, propertyName, moduleSpecifier) { + return propertyName === "default" + ? makeImport(ts.createIdentifier(localName), undefined, moduleSpecifier) + : makeImport(undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); + } + function makeImport(name, namedImports, moduleSpecifier) { + var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); + return ts.createImportDeclaration(undefined, undefined, importClause, ts.createLiteral(moduleSpecifier)); + } + function makeImportSpecifier(propertyName, name) { + return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); + } + function makeConst(modifiers, name, init) { + return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, undefined, init)], 2)); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return ts.createExportDeclaration(undefined, undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); + } + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var refactor; (function (refactor) { var extractSymbol; - (function (extractSymbol_1) { - var extractSymbol = { - name: "Extract Symbol", - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_symbol), - getAvailableActions: getAvailableActions, - getEditsForAction: getEditsForAction, - }; - refactor.registerRefactor(extractSymbol); + (function (extractSymbol) { + var refactorName = "Extract Symbol"; + refactor.registerRefactor(refactorName, { getAvailableActions: getAvailableActions, getEditsForAction: getEditsForAction }); function getAvailableActions(context) { var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: ts.getRefactorContextLength(context) }); var targetRange = rangeToExtract.targetRange; @@ -78812,21 +81282,21 @@ var ts; var infos = []; if (functionActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_function), actions: functionActions }); } if (constantActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_constant), actions: constantActions }); } return infos.length ? infos : undefined; } - extractSymbol_1.getAvailableActions = getAvailableActions; + extractSymbol.getAvailableActions = getAvailableActions; function getEditsForAction(context, actionName) { var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: ts.getRefactorContextLength(context) }); var targetRange = rangeToExtract.targetRange; @@ -78844,7 +81314,7 @@ var ts; } ts.Debug.fail("Unrecognized action name"); } - extractSymbol_1.getEditsForAction = getEditsForAction; + extractSymbol.getEditsForAction = getEditsForAction; var Messages; (function (Messages) { function createMessage(message) { @@ -78872,7 +81342,7 @@ var ts; Messages.cannotExtractToOtherFunctionLike = createMessage("Cannot extract method to a function-like scope that is not a function"); Messages.cannotExtractToJSClass = createMessage("Cannot extract constant to a class scope in JS"); Messages.cannotExtractToExpressionArrowFunction = createMessage("Cannot extract constant to an arrow function without a block"); - })(Messages = extractSymbol_1.Messages || (extractSymbol_1.Messages = {})); + })(Messages = extractSymbol.Messages || (extractSymbol.Messages = {})); var RangeFacts; (function (RangeFacts) { RangeFacts[RangeFacts["None"] = 0] = "None"; @@ -78915,6 +81385,9 @@ var ts; break; } } + if (!statements.length) { + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] }; + } return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; } if (ts.isReturnStatement(start) && !start.expression) { @@ -78962,20 +81435,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 150) { + if (current.kind === 151) { if (ts.hasModifier(current, 32)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 147) { + else if (current.kind === 148) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 153) { + if (ctorOrMethod.kind === 154) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 152) { + else if (current.kind === 153) { if (ts.hasModifier(current, 32)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -78991,6 +81464,8 @@ var ts; PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; })(PermittedJumps || (PermittedJumps = {})); + ts.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(!ts.positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); if (!ts.isStatement(nodeToCheck) && !(ts.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) { return [ts.createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; } @@ -79011,7 +81486,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 227) ? node.parent.parent : node; + var declaringNode = (node.kind === 230) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1)) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); return true; @@ -79019,11 +81494,11 @@ var ts; declarations.push(node.symbol); } switch (node.kind) { - case 239: + case 242: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 97: - if (node.parent.kind === 182) { + if (node.parent.kind === 185) { var containingClass_1 = ts.getContainingClass(node); if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractSuper)); @@ -79037,9 +81512,9 @@ var ts; } if (!node || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 229: - case 230: - if (node.parent.kind === 269 && node.parent.externalModuleIndicator === undefined) { + case 232: + case 233: + if (node.parent.kind === 272 && node.parent.externalModuleIndicator === undefined) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } break; @@ -79048,18 +81523,18 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 212: + case 215: permittedJumps = 0; break; - case 225: + case 228: permittedJumps = 0; break; - case 208: - if (node.parent && node.parent.kind === 225 && node.parent.finallyBlock === node) { + case 211: + if (node.parent && node.parent.kind === 228 && node.parent.finallyBlock === node) { permittedJumps = 4; } break; - case 261: + case 264: permittedJumps |= 1; break; default: @@ -79069,11 +81544,11 @@ var ts; break; } switch (node.kind) { - case 170: + case 173: case 99: rangeFacts |= RangeFacts.UsesThis; break; - case 223: + case 226: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); @@ -79081,8 +81556,8 @@ var ts; seenLabels.pop(); break; } - case 219: - case 218: + case 222: + case 221: { var label = node.label; if (label) { @@ -79091,19 +81566,19 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 219 ? 1 : 2))) { + if (!(permittedJumps & (node.kind === 222 ? 1 : 2))) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 192: + case 195: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 198: + case 201: rangeFacts |= RangeFacts.IsGenerator; break; - case 220: + case 223: if (permittedJumps & 4) { rangeFacts |= RangeFacts.HasReturn; } @@ -79119,7 +81594,7 @@ var ts; } } } - extractSymbol_1.getRangeToExtract = getRangeToExtract; + extractSymbol.getRangeToExtract = getRangeToExtract; function getStatementOrExpressionRange(node) { if (ts.isStatement(node)) { return [node]; @@ -79146,12 +81621,12 @@ var ts; var scopes = []; while (true) { current = current.parent; - if (current.kind === 147) { + if (current.kind === 148) { current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } if (isScope(current)) { scopes.push(current); - if (current.kind === 269) { + if (current.kind === 272) { return scopes; } } @@ -79234,33 +81709,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 153: - return "constructor"; - case 187: - return scope.name - ? "function expression '" + scope.name.text + "'" - : "anonymous function expression"; - case 229: - return "function '" + scope.name.text + "'"; - case 188: - return "arrow function"; - case 152: - return "method '" + scope.name.getText(); case 154: - return "'get " + scope.name.getText() + "'"; + return "constructor"; + case 190: + case 232: + return scope.name + ? "function '" + scope.name.text + "'" + : "anonymous function"; + case 191: + return "arrow function"; + case 153: + return "method '" + scope.name.getText(); case 155: + return "'get " + scope.name.getText() + "'"; + case 156: return "'set " + scope.name.getText() + "'"; default: ts.Debug.assertNever(scope); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 230 - ? "class '" + scope.name.text + "'" + return scope.kind === 233 + ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 235 + return scope.kind === 238 ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 : 1; } @@ -79292,7 +81766,7 @@ var ts; if (!isJS) { var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); type = checker.getBaseTypeOfLiteralType(type); - typeNode = checker.typeToTypeNode(type, scope, ts.NodeBuilderFlags.NoTruncation); + typeNode = checker.typeToTypeNode(type, scope, 1); } var paramDecl = ts.createParameter(undefined, undefined, undefined, name, undefined, typeNode); parameters.push(paramDecl); @@ -79311,7 +81785,7 @@ var ts; : undefined; if (ts.isExpression(node) && !isJS) { var contextualType = checker.getContextualType(node); - returnType = checker.typeToTypeNode(contextualType, scope, ts.NodeBuilderFlags.NoTruncation); + returnType = checker.typeToTypeNode(contextualType, scope, 1); } var _b = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)), body = _b.body, returnValueProperty = _b.returnValueProperty; ts.suppressLeadingAndTrailingTrivia(body); @@ -79333,13 +81807,10 @@ var ts; var minInsertionPos = (isReadonlyArray(range.range) ? ts.last(range.range) : range.range).end; var nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope); if (nodeToInsertBefore) { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, true); } else { - changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { - prefix: ts.isLineBreak(file.text.charCodeAt(scope.getLastToken().pos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter, - suffix: context.newLineCharacter - }); + changeTracker.insertNodeAtEndOfScope(context.file, scope, newFunction); } var newNodes = []; var called = getCalledExpression(scope, range, functionNameText); @@ -79365,7 +81836,7 @@ var ts; for (var _i = 0, exposedVariableDeclarations_1 = exposedVariableDeclarations; _i < exposedVariableDeclarations_1.length; _i++) { var variableDeclaration = exposedVariableDeclarations_1[_i]; bindingElements.push(ts.createBindingElement(undefined, undefined, ts.getSynthesizedDeepClone(variableDeclaration.name))); - var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, ts.NodeBuilderFlags.NoTruncation); + var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, 1); typeElements.push(ts.createPropertySignature(undefined, variableDeclaration.symbol.name, undefined, variableType, undefined)); sawExplicitType = sawExplicitType || variableDeclaration.type !== undefined; commonNodeFlags = commonNodeFlags & variableDeclaration.parent.flags; @@ -79420,10 +81891,12 @@ var ts; newNodes.push(call); } } - var replacementRange = isReadonlyArray(range.range) - ? { pos: ts.first(range.range).getStart(), end: ts.last(range.range).end } - : { pos: range.range.getStart(), end: range.range.end }; - changeTracker.replaceRangeWithNodes(context.file, replacementRange, newNodes, { nodeSeparator: context.newLineCharacter }); + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodeRangeWithNodes(context.file, ts.first(range.range), ts.last(range.range), newNodes); + } + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); + } var edits = changeTracker.getChanges(); var renameRange = isReadonlyArray(range.range) ? ts.first(range.range) : range.range; var renameFilename = renameRange.getSourceFile().fileName; @@ -79438,9 +81911,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 139; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 140; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(139)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(140)]); } } function extractConstantInScope(node, scope, _a, rangeFacts, context) { @@ -79449,9 +81922,9 @@ var ts; var file = scope.getSourceFile(); var localNameText = getUniqueName(ts.isClassLike(scope) ? "newProperty" : "newLocal", file.text); var isJS = ts.isInJavaScriptFile(scope); - var variableType = isJS + var variableType = isJS || !checker.isContextSensitive(node) ? undefined - : checker.typeToTypeNode(checker.getContextualType(node), scope, ts.NodeBuilderFlags.NoTruncation); + : checker.typeToTypeNode(checker.getContextualType(node), scope, 1); var initializer = transformConstantInitializer(node, substitutions); ts.suppressLeadingAndTrailingTrivia(initializer); var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -79462,47 +81935,43 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(115)); } - modifiers.push(ts.createToken(131)); + modifiers.push(ts.createToken(132)); var newVariable = ts.createProperty(undefined, modifiers, localNameText, undefined, variableType, initializer); var localReference = ts.createPropertyAccess(rangeFacts & RangeFacts.InStaticRegion ? ts.createIdentifier(scope.name.getText()) : ts.createThis(), ts.createIdentifier(localNameText)); var maxInsertionPos = node.pos; var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, { suffix: context.newLineCharacter + context.newLineCharacter }); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, true); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } else { var newVariableDeclaration = ts.createVariableDeclaration(localNameText, variableType, initializer); var oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope); if (oldVariableDeclaration) { - changeTracker.insertNodeAt(context.file, oldVariableDeclaration.getStart(), newVariableDeclaration, { suffix: ", " }); + changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } - else if (node.parent.kind === 211 && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 214 && scope === ts.findAncestor(node, isScope)) { var newVariableStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2)); - changeTracker.replaceRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }, newVariableStatement); + changeTracker.replaceNode(context.file, node.parent, newVariableStatement, ts.textChanges.useNonAdjustedPositions); } else { var newVariableStatement = ts.createVariableStatement(undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2)); var nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope); if (nodeToInsertBefore.pos === 0) { - var insertionPos = ts.getSourceFileImportLocation(file); - changeTracker.insertNodeAt(context.file, insertionPos, newVariableStatement, { - prefix: insertionPos === 0 ? undefined : context.newLineCharacter, - suffix: ts.isLineBreak(file.text.charCodeAt(insertionPos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter - }); + changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement, false); } else { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, false); } - if (node.parent.kind === 211) { - changeTracker.deleteRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }); + if (node.parent.kind === 214) { + changeTracker.deleteNode(context.file, node.parent, ts.textChanges.useNonAdjustedPositions); } else { var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } } } @@ -79528,10 +81997,10 @@ var ts; var delta = 0; var lastPos = -1; for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], fileName = _a.fileName, textChanges_1 = _a.textChanges; + var _a = edits_1[_i], fileName = _a.fileName, textChanges_2 = _a.textChanges; ts.Debug.assert(fileName === renameFilename); - for (var _b = 0, textChanges_2 = textChanges_1; _b < textChanges_2.length; _b++) { - var change = textChanges_2[_b]; + for (var _b = 0, textChanges_3 = textChanges_2; _b < textChanges_3.length; _b++) { + var change = textChanges_3[_b]; var span_15 = change.span, newText = change.newText; var index = newText.indexOf(functionNameText); if (index !== -1) { @@ -79602,7 +82071,7 @@ var ts; return { body: ts.createBlock(statements, true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 220 && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 223 && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -79698,6 +82167,10 @@ var ts; } prevStatement = statement; } + if (!prevStatement && ts.isCaseClause(curr)) { + ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent)); + return curr.parent.parent; + } ts.Debug.assert(prevStatement !== undefined); return prevStatement; } @@ -79758,7 +82231,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 229 + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 232 ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -79939,7 +82412,8 @@ var ts; } return symbolId; } - var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + var decls = symbol.getDeclarations(); + var declInFile = decls && ts.find(decls, function (d) { return d.getSourceFile() === sourceFile; }); if (!declInFile) { return undefined; } @@ -79959,7 +82433,7 @@ var ts; } for (var i = 0; i < scopes.length; i++) { var scope = scopes[i]; - var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags, false); if (resolvedSymbol === symbol) { continue; } @@ -80015,7 +82489,8 @@ var ts; if (!symbol) { return undefined; } - if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + var decls = symbol.getDeclarations(); + if (decls && decls.some(function (d) { return d.parent === scopeDecl; })) { return ts.createIdentifier(symbol.name); } var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); @@ -80043,30 +82518,30 @@ var ts; } function isExtractableExpression(node) { switch (node.parent.kind) { - case 268: + case 271: return false; } switch (node.kind) { case 9: - return node.parent.kind !== 239 && - node.parent.kind !== 243; - case 199: - case 175: - case 177: + return node.parent.kind !== 242 && + node.parent.kind !== 246; + case 202: + case 178: + case 180: return false; case 71: - return node.parent.kind !== 177 && - node.parent.kind !== 243 && - node.parent.kind !== 247; + return node.parent.kind !== 180 && + node.parent.kind !== 246 && + node.parent.kind !== 250; } return true; } function isBlockLike(node) { switch (node.kind) { - case 208: - case 269: - case 235: - case 261: + case 211: + case 272: + case 238: + case 264: return true; default: return false; @@ -80080,15 +82555,11 @@ var ts; var refactor; (function (refactor) { var installTypesForPackage; - (function (installTypesForPackage_1) { + (function (installTypesForPackage) { + var refactorName = "Install missing types package"; var actionName = "install"; - var installTypesForPackage = { - name: "Install missing types package", - description: "Install missing types package", - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(installTypesForPackage); + var description = "Install missing types package"; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.getStrictOptionValue(context.program.getCompilerOptions(), "noImplicitAny")) { return undefined; @@ -80096,8 +82567,8 @@ var ts; var action = getAction(context); return action && [ { - name: installTypesForPackage.name, - description: installTypesForPackage.description, + name: refactorName, + description: description, actions: [ { description: action.description, @@ -80131,8 +82602,8 @@ var ts; } function isModuleIdentifier(node) { switch (node.parent.kind) { - case 239: - case 249: + case 242: + case 252: return true; default: return false; @@ -80148,16 +82619,11 @@ var ts; var installTypesForPackage; (function (installTypesForPackage) { var actionName = "Convert to default import"; - var useDefaultImport = { - name: actionName, - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import), - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(useDefaultImport); + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { var file = context.file, startPosition = context.startPosition, program = context.program; - if (!program.getCompilerOptions().allowSyntheticDefaultImports) { + if (!ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { return undefined; } var importInfo = getConvertibleImportAtPosition(file, startPosition); @@ -80165,17 +82631,17 @@ var ts; return undefined; } var module = ts.getResolvedModule(file, importInfo.moduleSpecifier.text); - var resolvedFile = program.getSourceFile(module.resolvedFileName); - if (!(resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { + var resolvedFile = module && program.getSourceFile(module.resolvedFileName); + if (!(resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { return undefined; } return [ { - name: useDefaultImport.name, - description: useDefaultImport.description, + name: actionName, + description: description, actions: [ { - description: useDefaultImport.description, + description: description, name: actionName, }, ], @@ -80202,20 +82668,20 @@ var ts; var node = ts.getTokenAtPosition(file, startPosition, false); while (true) { switch (node.kind) { - case 238: + case 241: var eq = node; var moduleReference = eq.moduleReference; - return moduleReference.kind === 249 && ts.isStringLiteral(moduleReference.expression) + return moduleReference.kind === 252 && ts.isStringLiteral(moduleReference.expression) ? { importStatement: eq, name: eq.name, moduleSpecifier: moduleReference.expression } : undefined; - case 239: + case 242: var d = node; var importClause = d.importClause; - return !importClause.name && importClause.namedBindings.kind === 241 && ts.isStringLiteral(d.moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings.kind === 244 && ts.isStringLiteral(d.moduleSpecifier) ? { importStatement: d, name: importClause.namedBindings.name, moduleSpecifier: d.moduleSpecifier } : undefined; - case 241: - case 249: + case 244: + case 252: case 91: case 71: case 9: @@ -80297,6 +82763,9 @@ var ts; var token = ts.scanner.scan(); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { + if (token === 71) { + ts.Debug.fail("Did not expect " + ts.Debug.showSyntaxKind(this) + " to have an Identifier in its trivia"); + } nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; @@ -80307,7 +82776,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(290, nodes.pos, nodes.end, this); + var list = createNode(293, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { @@ -80388,8 +82857,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 271 || kid.kind > 289; }); - return child.kind < 144 ? + var child = ts.find(children, function (kid) { return kid.kind < 274 || kid.kind > 292; }); + return child.kind < 145 ? child : child.getFirstToken(sourceFile); }; @@ -80400,7 +82869,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 144 ? child : child.getLastToken(sourceFile); + return child.kind < 145 ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -80723,13 +83192,13 @@ var ts; function getDeclarationName(declaration) { var name = ts.getNameOfDeclaration(declaration); if (name) { - var result_8 = ts.getTextOfIdentifierOrLiteral(name); - if (result_8 !== undefined) { - return result_8; + var result_6 = ts.getTextOfIdentifierOrLiteral(name); + if (result_6 !== undefined) { + return result_6; } - if (name.kind === 145) { + if (name.kind === 146) { var expr = name.expression; - if (expr.kind === 180) { + if (expr.kind === 183) { return expr.name.text; } return ts.getTextOfIdentifierOrLiteral(expr); @@ -80739,10 +83208,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 229: - case 187: + case 232: + case 190: + case 153: case 152: - case 151: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -80759,29 +83228,29 @@ var ts; } ts.forEachChild(node, visit); break; - case 230: - case 200: - case 231: - case 232: case 233: + case 203: case 234: - case 238: - case 247: - case 243: - case 240: + case 235: + case 236: + case 237: case 241: - case 154: + case 250: + case 246: + case 243: + case 244: case 155: - case 164: + case 156: + case 165: addDeclaration(node); ts.forEachChild(node, visit); break; - case 147: + case 148: if (!ts.hasModifier(node, 92)) { break; } - case 227: - case 177: { + case 230: + case 180: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -80791,24 +83260,24 @@ var ts; visit(decl.initializer); } } - case 268: + case 271: + case 151: case 150: - case 149: addDeclaration(node); break; - case 245: + case 248: if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 239: + case 242: var importClause = node.importClause; if (importClause) { if (importClause.name) { addDeclaration(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241) { + if (importClause.namedBindings.kind === 244) { addDeclaration(importClause.namedBindings); } else { @@ -80817,7 +83286,7 @@ var ts; } } break; - case 195: + case 198: if (ts.getSpecialPropertyAssignmentKind(node) !== 0) { addDeclaration(node); } @@ -80985,8 +83454,7 @@ var ts; sourceFile.scriptSnapshot = scriptSnapshot; } function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents, scriptKind) { - var text = scriptSnapshot.getText(0, scriptSnapshot.getLength()); - var sourceFile = ts.createSourceFile(fileName, text, scriptTarget, setNodeParents, scriptKind); + var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTarget, setNodeParents, scriptKind); setSourceFileFields(sourceFile, scriptSnapshot, version); return sourceFile; } @@ -81122,7 +83590,7 @@ var ts; getCancellationToken: function () { return cancellationToken; }, getCanonicalFileName: getCanonicalFileName, useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return ts.getNewLineCharacter(newSettings, { newLine: ts.getNewLineOrDefaultFromHost(host) }); }, + getNewLine: function () { return ts.getNewLineCharacter(newSettings, function () { return ts.getNewLineOrDefaultFromHost(host); }); }, getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, writeFile: ts.noop, getCurrentDirectory: function () { return currentDirectory; }, @@ -81131,10 +83599,11 @@ var ts; var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); var entry = hostCache.getEntryByPath(path); if (entry) { - return ts.isString(entry) ? undefined : entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); } return host.readFile && host.readFile(fileName); }, + realpath: host.realpath && (function (path) { return host.realpath(path); }), directoryExists: function (directoryName) { return ts.directoryProbablyExists(directoryName, host); }, @@ -81226,13 +83695,13 @@ var ts; return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); } function getCompletionsAtPosition(fileName, position, options) { - if (options === void 0) { options = { includeExternalModuleExports: false }; } + if (options === void 0) { options = { includeExternalModuleExports: false, includeInsertTextCompletions: false }; } synchronizeHostData(); return ts.Completions.getCompletionsAtPosition(host, program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, program.getSourceFiles(), options); } function getCompletionEntryDetails(fileName, position, name, formattingOptions, source) { synchronizeHostData(); - return ts.Completions.getCompletionEntryDetails(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); + return ts.Completions.getCompletionEntryDetails(program, log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); } function getCompletionEntrySymbol(fileName, position, name, source) { synchronizeHostData(); @@ -81253,10 +83722,10 @@ var ts; if (!symbol || typeChecker.isUnknownSymbol(symbol)) { switch (node.kind) { case 71: - case 180: - case 144: + case 183: + case 145: case 99: - case 170: + case 173: case 97: var type = typeChecker.getTypeAtLocation(node); if (type) { @@ -81313,42 +83782,24 @@ var ts; return ts.FindAllReferences.getImplementationsAtPosition(program, cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position); } function getOccurrencesAtPosition(fileName, position) { - var results = getOccurrencesAtPositionCore(fileName, position); - if (results) { - var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); - } - return results; + var canonicalFileName = getCanonicalFileName(ts.normalizeSlashes(fileName)); + return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { + ts.Debug.assert(getCanonicalFileName(ts.normalizeSlashes(entry.fileName)) === canonicalFileName); + return { + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === "writtenReference", + isDefinition: false, + isInString: highlightSpan.isInString, + }; + }); }); } function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); - var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); }); + var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return ts.Debug.assertDefined(program.getSourceFile(f)); }); var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function getOccurrencesAtPositionCore(fileName, position) { - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - function convertDocumentHighlights(documentHighlights) { - if (!documentHighlights) { - return undefined; - } - var result = []; - for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) { - var entry = documentHighlights_1[_i]; - for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { - var highlightSpan = _b[_a]; - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === "writtenReference", - isDefinition: false, - isInString: highlightSpan.isInString, - }); - } - } - return result; - } - } function findRenameLocations(fileName, position, findInStrings, findInComments) { return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } @@ -81404,15 +83855,15 @@ var ts; return; } switch (node.kind) { - case 180: - case 144: + case 183: + case 145: case 9: case 86: case 101: case 95: case 97: case 99: - case 170: + case 173: case 71: break; default: @@ -81424,7 +83875,7 @@ var ts; nodeForStartPos = nodeForStartPos.parent; } else if (ts.isNameOfModuleDeclaration(nodeForStartPos)) { - if (nodeForStartPos.parent.parent.kind === 234 && + if (nodeForStartPos.parent.parent.kind === 237 && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { nodeForStartPos = nodeForStartPos.parent.parent.name; } @@ -81476,45 +83927,19 @@ var ts; var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } + var braceMatching = ts.createMapFromTemplate((_a = {}, + _a[17] = 18, + _a[19] = 20, + _a[21] = 22, + _a[29] = 27, + _a)); + braceMatching.forEach(function (value, key) { return braceMatching.set(value.toString(), Number(key)); }); function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var result = []; var token = ts.getTouchingToken(sourceFile, position, false); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) { - var current = childNodes_1[_i]; - if (current.kind === matchKind) { - var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 17: return 18; - case 19: return 20; - case 21: return 22; - case 27: return 29; - case 18: return 17; - case 20: return 19; - case 22: return 21; - case 29: return 27; - } - return undefined; - } + var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined; + var match = matchKind && ts.findChildOfKind(token.parent, matchKind, sourceFile); + return match ? [ts.createTextSpanFromNode(token, sourceFile), ts.createTextSpanFromNode(match, sourceFile)].sort(function (a, b) { return a.start - b.start; }) : ts.emptyArray; } function getIndentationAtPosition(fileName, position, editorOptions) { var start = ts.timestamp(); @@ -81554,13 +83979,26 @@ var ts; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = ts.createTextSpanFromBounds(start, end); - var newLineCharacter = ts.getNewLineOrDefaultFromHost(host); var formatContext = ts.formatting.getFormatContext(formatOptions); return ts.flatMap(ts.deduplicate(errorCodes, ts.equateValues, ts.compareValues), function (errorCode) { cancellationToken.throwIfCancellationRequested(); - return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, newLineCharacter: newLineCharacter, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); }); } + function getCombinedCodeFix(scope, fixId, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.codefix.getAllFixes({ fixId: fixId, sourceFile: sourceFile, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + } + function organizeImports(scope, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host); + } function applyCodeActionCommand(fileName, actionOrUndefined) { var action = typeof fileName === "string" ? actionOrUndefined : fileName; return ts.isArray(action) ? Promise.all(action.map(applySingleCodeActionCommand)) : applySingleCodeActionCommand(action); @@ -81674,7 +84112,6 @@ var ts; startPosition: startPosition, endPosition: endPosition, program: getProgram(), - newLineCharacter: formatOptions ? formatOptions.newLineCharacter : host.getNewLine(), host: host, formatContext: ts.formatting.getFormatContext(formatOptions), cancellationToken: cancellationToken, @@ -81731,7 +84168,9 @@ var ts; isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, + getCombinedCodeFix: getCombinedCodeFix, applyCodeActionCommand: applyCodeActionCommand, + organizeImports: organizeImports, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, getSourceFile: getSourceFile, @@ -81739,6 +84178,7 @@ var ts; getApplicableRefactors: getApplicableRefactors, getEditsForRefactor: getEditsForRefactor, }; + var _a; } ts.createLanguageService = createLanguageService; function getNameTable(sourceFile) { @@ -81766,33 +84206,20 @@ var ts; } function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 249 || + node.parent.kind === 252 || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } - function isObjectLiteralElement(node) { - switch (node.kind) { - case 257: - case 259: - case 265: - case 266: - case 152: - case 154: - case 155: - return true; - } - return false; - } function getContainingObjectLiteralElement(node) { switch (node.kind) { case 9: case 8: - if (node.parent.kind === 145) { - return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + if (node.parent.kind === 146) { + return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } case 71: - return isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 179 || node.parent.parent.kind === 258) && + return ts.isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 182 || node.parent.parent.kind === 261) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -81807,20 +84234,20 @@ var ts; function getPropertySymbolsFromType(type, propName) { var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); if (name && type) { - var result_9 = []; + var result_7 = []; var symbol = type.getProperty(name); if (type.flags & 131072) { ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { - result_9.push(symbol); + result_7.push(symbol); } }); - return result_9; + return result_7; } if (symbol) { - result_9.push(symbol); - return result_9; + result_7.push(symbol); + return result_7; } } return undefined; @@ -81829,7 +84256,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 181 && + node.parent.kind === 184 && node.parent.argumentExpression === node; } function getDefaultLibFilePath(options) { @@ -82244,7 +84671,7 @@ var ts; LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, options, source) { var _this = this; return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { - var localOptions = JSON.parse(options); + var localOptions = options === undefined ? undefined : JSON.parse(options); return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source); }); }; @@ -82374,7 +84801,7 @@ var ts; CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { var _this = this; return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), true, true); + var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), true, true); return { referencedFiles: _this.convertFileReferences(result.referencedFiles), importedFiles: _this.convertFileReferences(result.importedFiles), @@ -82409,8 +84836,7 @@ var ts; CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) { var _this = this; return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () { - var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); - var result = ts.parseJsonText(fileName, text); + var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot)); var normalizedFileName = ts.normalizeSlashes(fileName); var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), {}, normalizedFileName); return { @@ -82433,7 +84859,7 @@ var ts; if (_this.safeList === undefined) { _this.safeList = ts.JsTyping.loadSafeList(_this.host, ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName)); } - return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports); + return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports, info.typesRegistry); }); }; return CoreServicesShimObject; @@ -82560,17 +84986,6 @@ var ts; Msg["Info"] = "Info"; Msg["Perf"] = "Perf"; })(Msg = server.Msg || (server.Msg = {})); - function getProjectRootPath(project) { - switch (project.projectKind) { - case server.ProjectKind.Configured: - return ts.getDirectoryPath(project.getProjectName()); - case server.ProjectKind.Inferred: - return ""; - case server.ProjectKind.External: - var projectName = ts.normalizeSlashes(project.getProjectName()); - return ts.getDirectoryPath(projectName); - } - } function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { return { projectName: project.getProjectName(), @@ -82578,7 +84993,7 @@ var ts; compilerOptions: project.getCompilationSettings(), typeAcquisition: typeAcquisition, unresolvedImports: unresolvedImports, - projectRootPath: getProjectRootPath(project), + projectRootPath: project.getCurrentDirectory(), cachePath: cachePath, kind: "discover" }; @@ -82735,17 +85150,6 @@ var ts; return base === "tsconfig.json" || base === "jsconfig.json" ? base : undefined; } server.getBaseConfigFileName = getBaseConfigFileName; - function insertSorted(array, insert, compare) { - if (array.length === 0) { - array.push(insert); - return; - } - var insertIndex = ts.binarySearch(array, insert, ts.identity, compare); - if (insertIndex < 0) { - array.splice(~insertIndex, 0, insert); - } - } - server.insertSorted = insertSorted; function removeSorted(array, remove, compare) { if (!array || array.length === 0) { return; @@ -82872,6 +85276,7 @@ var ts; CommandTypes["Saveto"] = "saveto"; CommandTypes["SignatureHelp"] = "signatureHelp"; CommandTypes["SignatureHelpFull"] = "signatureHelp-full"; + CommandTypes["Status"] = "status"; CommandTypes["TypeDefinition"] = "typeDefinition"; CommandTypes["ProjectInfo"] = "projectInfo"; CommandTypes["ReloadProjects"] = "reloadProjects"; @@ -82892,12 +85297,16 @@ var ts; CommandTypes["BreakpointStatement"] = "breakpointStatement"; CommandTypes["CompilerOptionsForInferredProjects"] = "compilerOptionsForInferredProjects"; CommandTypes["GetCodeFixes"] = "getCodeFixes"; - CommandTypes["ApplyCodeActionCommand"] = "applyCodeActionCommand"; CommandTypes["GetCodeFixesFull"] = "getCodeFixes-full"; + CommandTypes["GetCombinedCodeFix"] = "getCombinedCodeFix"; + CommandTypes["GetCombinedCodeFixFull"] = "getCombinedCodeFix-full"; + CommandTypes["ApplyCodeActionCommand"] = "applyCodeActionCommand"; CommandTypes["GetSupportedCodeFixes"] = "getSupportedCodeFixes"; CommandTypes["GetApplicableRefactors"] = "getApplicableRefactors"; CommandTypes["GetEditsForRefactor"] = "getEditsForRefactor"; CommandTypes["GetEditsForRefactorFull"] = "getEditsForRefactor-full"; + CommandTypes["OrganizeImports"] = "organizeImports"; + CommandTypes["OrganizeImportsFull"] = "organizeImports-full"; })(CommandTypes = protocol.CommandTypes || (protocol.CommandTypes = {})); var IndentStyle; (function (IndentStyle) { @@ -83064,7 +85473,7 @@ var ts; }()); server.TextStorage = TextStorage; function isDynamicFileName(fileName) { - return ts.getBaseFileName(fileName)[0] === "^"; + return fileName[0] === "^" || ts.getBaseFileName(fileName)[0] === "^"; } server.isDynamicFileName = isDynamicFileName; var ScriptInfo = (function () { @@ -83079,6 +85488,7 @@ var ts; this.textStorage = new TextStorage(host, fileName); if (hasMixedContent || this.isDynamic) { this.textStorage.reload(""); + this.realpath = this.path; } this.scriptKind = scriptKind ? scriptKind @@ -83112,6 +85522,25 @@ var ts; ScriptInfo.prototype.getSnapshot = function () { return this.textStorage.getSnapshot(); }; + ScriptInfo.prototype.ensureRealPath = function () { + if (this.realpath === undefined) { + this.realpath = this.path; + if (this.host.realpath) { + ts.Debug.assert(!!this.containingProjects.length); + var project = this.containingProjects[0]; + var realpath = this.host.realpath(this.path); + if (realpath) { + this.realpath = project.toPath(realpath); + if (this.realpath !== this.path) { + project.projectService.realpathToScriptInfos.add(this.realpath, this); + } + } + } + } + }; + ScriptInfo.prototype.getRealpathIfDifferent = function () { + return this.realpath && this.realpath !== this.path ? this.realpath : undefined; + }; ScriptInfo.prototype.getFormatCodeSettings = function () { return this.formatCodeSettings; }; @@ -83119,6 +85548,9 @@ var ts; var isNew = !this.isAttached(project); if (isNew) { this.containingProjects.push(project); + if (!project.getCompilerOptions().preserveSymlinks) { + this.ensureRealPath(); + } } return isNew; }; @@ -83156,7 +85588,7 @@ var ts; for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { var p = _a[_i]; if (p.projectKind === server.ProjectKind.Configured) { - p.directoryStructureHost.addOrDeleteFile(this.fileName, this.path, ts.FileWatcherEventKind.Deleted); + p.getCachedDirectoryStructureHost().addOrDeleteFile(this.fileName, this.path, ts.FileWatcherEventKind.Deleted); } var isInfoRoot = p.isRoot(this); p.removeFile(this, false, false); @@ -83204,8 +85636,7 @@ var ts; return this.textStorage.getVersion(); }; ScriptInfo.prototype.saveTo = function (fileName) { - var snap = this.textStorage.getSnapshot(); - this.host.writeFile(fileName, snap.getText(0, snap.getLength())); + this.host.writeFile(fileName, ts.getSnapshotText(this.textStorage.getSnapshot())); }; ScriptInfo.prototype.delayReloadNonMixedContentFile = function () { ts.Debug.assert(!this.isDynamicOrHasMixedContent()); @@ -83258,6 +85689,168 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) { + if (!host.getDirectories || !host.readDirectory) { + return undefined; + } + var cachedReadDirectoryResult = ts.createMap(); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + fileExists: fileExists, + readFile: function (path, encoding) { return host.readFile(path, encoding); }, + directoryExists: host.directoryExists && directoryExists, + getDirectories: getDirectories, + readDirectory: readDirectory, + createDirectory: host.createDirectory && createDirectory, + writeFile: host.writeFile && writeFile, + addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, + addOrDeleteFile: addOrDeleteFile, + clearCache: clearCache + }; + function toPath(fileName) { + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getCachedFileSystemEntries(rootDirPath) { + return cachedReadDirectoryResult.get(rootDirPath); + } + function getCachedFileSystemEntriesForBaseDir(path) { + return getCachedFileSystemEntries(ts.getDirectoryPath(path)); + } + function getBaseNameOfFileName(fileName) { + return ts.getBaseFileName(ts.normalizePath(fileName)); + } + function createCachedFileSystemEntries(rootDir, rootDirPath) { + var resultFromHost = { + files: ts.map(host.readDirectory(rootDir, undefined, undefined, ["*.*"]), getBaseNameOfFileName) || [], + directories: host.getDirectories(rootDir) || [] + }; + cachedReadDirectoryResult.set(rootDirPath, resultFromHost); + return resultFromHost; + } + function tryReadDirectory(rootDir, rootDirPath) { + var cachedResult = getCachedFileSystemEntries(rootDirPath); + if (cachedResult) { + return cachedResult; + } + try { + return createCachedFileSystemEntries(rootDir, rootDirPath); + } + catch (_e) { + ts.Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); + return undefined; + } + } + function fileNameEqual(name1, name2) { + return getCanonicalFileName(name1) === getCanonicalFileName(name2); + } + function hasEntry(entries, name) { + return ts.some(entries, function (file) { return fileNameEqual(file, name); }); + } + function updateFileSystemEntry(entries, baseName, isValid) { + if (hasEntry(entries, baseName)) { + if (!isValid) { + return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); + } + } + else if (isValid) { + return entries.push(baseName); + } + } + function writeFile(fileName, data, writeByteOrderMark) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + if (result) { + updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), true); + } + return host.writeFile(fileName, data, writeByteOrderMark); + } + function fileExists(fileName) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || + host.fileExists(fileName); + } + function directoryExists(dirPath) { + var path = toPath(dirPath); + return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); + } + function createDirectory(dirPath) { + var path = toPath(dirPath); + var result = getCachedFileSystemEntriesForBaseDir(path); + var baseFileName = getBaseNameOfFileName(dirPath); + if (result) { + updateFileSystemEntry(result.directories, baseFileName, true); + } + host.createDirectory(dirPath); + } + function getDirectories(rootDir) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return result.directories.slice(); + } + return host.getDirectories(rootDir); + } + function readDirectory(rootDir, extensions, excludes, includes, depth) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries); + } + return host.readDirectory(rootDir, extensions, excludes, includes, depth); + function getFileSystemEntries(dir) { + var path = toPath(dir); + if (path === rootDirPath) { + return result; + } + return tryReadDirectory(dir, path) || ts.emptyFileSystemEntries; + } + } + function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { + var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); + if (existingResult) { + clearCache(); + return undefined; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); + if (!parentResult) { + return undefined; + } + if (!host.directoryExists) { + clearCache(); + return undefined; + } + var baseName = getBaseNameOfFileName(fileOrDirectory); + var fsQueryResult = { + fileExists: host.fileExists(fileOrDirectoryPath), + directoryExists: host.directoryExists(fileOrDirectoryPath) + }; + if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { + clearCache(); + } + else { + updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); + } + return fsQueryResult; + } + function addOrDeleteFile(fileName, filePath, eventKind) { + if (eventKind === ts.FileWatcherEventKind.Changed) { + return; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); + if (parentResult) { + updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); + } + } + function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { + updateFileSystemEntry(parentResult.files, baseName, fileExists); + } + function clearCache() { + cachedReadDirectoryResult.clear(); + } + } + ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; var ConfigFileProgramReloadLevel; (function (ConfigFileProgramReloadLevel) { ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["None"] = 0] = "None"; @@ -83294,6 +85887,13 @@ var ts; } } ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories; + function isEmittedFileOfProgram(program, file) { + if (!program) { + return false; + } + return program.isEmittedFile(file); + } + ts.isEmittedFileOfProgram = isEmittedFileOfProgram; function addFileWatcher(host, file, cb) { return host.watchFile(file, cb); } @@ -83371,7 +85971,7 @@ var ts; var ts; (function (ts) { ts.maxNumberOfFilesToIterateForInvalidation = 256; - function createResolutionCache(resolutionHost, rootDirForResolution) { + function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var allFilesHaveInvalidatedResolution = false; @@ -83380,6 +85980,7 @@ var ts; var resolvedTypeReferenceDirectives = ts.createMap(); var perDirectoryResolvedTypeReferenceDirectives = ts.createMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); var failedLookupDefaultExtensions = [".ts", ".tsx", ".js", ".jsx", ".json"]; var customFailedLookupPaths = ts.createMap(); var directoryWatchesOfFailedLookups = ts.createMap(); @@ -83429,8 +86030,8 @@ var ts; filesWithChangedSetOfUnresolvedImports = undefined; return collected; } - function createHasInvalidatedResolution() { - if (allFilesHaveInvalidatedResolution) { + function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { + if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { filesWithInvalidatedResolutions = undefined; return ts.returnTrue; } @@ -83541,8 +86142,8 @@ var ts; function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile) { return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, undefined, false); } - function resolveModuleNames(moduleNames, containingFile, reusedNames, logChanges) { - return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChanges); + function resolveModuleNames(moduleNames, containingFile, reusedNames) { + return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChangesWhenResolvingModule); } function isNodeModulesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules"); @@ -83663,8 +86264,8 @@ var ts; function createDirectoryWatcher(directory, dirPath) { return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (resolutionHost.getCachedDirectoryStructureHost) { - resolutionHost.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } if (!allFilesHaveInvalidatedResolution && dirPath === rootPath || isNodeModulesDirectory(dirPath) || ts.getDirectoryPath(fileOrDirectoryPath) === dirPath) { @@ -83742,6 +86343,9 @@ var ts; if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) { return false; } + if (ts.isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { + return false; + } isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } } @@ -83756,8 +86360,8 @@ var ts; function createTypeRootsWatch(_typeRootPath, typeRoot) { return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (resolutionHost.getCachedDirectoryStructureHost) { - resolutionHost.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } resolutionHost.onChangedAutomaticTypeDirectiveNames(); }, 1); @@ -83903,6 +86507,243 @@ var ts; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); var ts; +(function (ts) { + function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { + var outputFiles = []; + var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; + function writeFile(fileName, text, writeByteOrderMark) { + outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); + } + } + ts.getFileEmitOutput = getFileEmitOutput; +})(ts || (ts = {})); +(function (ts) { + var BuilderState; + (function (BuilderState) { + function getReferencedFiles(program, sourceFile, getCanonicalFileName) { + var referencedFiles; + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = program.getTypeChecker(); + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importName = _a[_i]; + var symbol = checker.getSymbolAtLocation(importName); + if (symbol && symbol.declarations && symbol.declarations[0]) { + var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); + if (declarationSourceFile) { + addReferencedFile(declarationSourceFile.path); + } + } + } + } + var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(referencedPath); + } + } + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = ts.toPath(fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }); + } + return referencedFiles; + function addReferencedFile(referencedPath) { + if (!referencedFiles) { + referencedFiles = ts.createMap(); + } + referencedFiles.set(referencedPath, true); + } + } + function canReuseOldState(newReferencedMap, oldState) { + return oldState && !oldState.referencedMap === !newReferencedMap; + } + BuilderState.canReuseOldState = canReuseOldState; + function create(newProgram, getCanonicalFileName, oldState) { + var fileInfos = ts.createMap(); + var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? ts.createMap() : undefined; + var hasCalledUpdateShapeSignature = ts.createMap(); + var useOldState = canReuseOldState(referencedMap, oldState); + for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var version_1 = sourceFile.version; + var oldInfo = useOldState && oldState.fileInfos.get(sourceFile.path); + if (referencedMap) { + var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); + if (newReferences) { + referencedMap.set(sourceFile.path, newReferences); + } + } + fileInfos.set(sourceFile.path, { version: version_1, signature: oldInfo && oldInfo.signature }); + } + return { + fileInfos: fileInfos, + referencedMap: referencedMap, + hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature, + allFilesExcludingDefaultLibraryFile: undefined, + allFileNames: undefined + }; + } + BuilderState.create = create; + function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature) { + var signatureCache = cacheToUpdateSignature || ts.createMap(); + var sourceFile = programOfThisState.getSourceFileByPath(path); + if (!sourceFile) { + return ts.emptyArray; + } + if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash)) { + return [sourceFile]; + } + var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash); + if (!cacheToUpdateSignature) { + updateSignaturesFromCache(state, signatureCache); + } + return result; + } + BuilderState.getFilesAffectedBy = getFilesAffectedBy; + function updateSignaturesFromCache(state, signatureCache) { + signatureCache.forEach(function (signature, path) { + state.fileInfos.get(path).signature = signature; + state.hasCalledUpdateShapeSignature.set(path, true); + }); + } + BuilderState.updateSignaturesFromCache = updateSignaturesFromCache; + function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash) { + ts.Debug.assert(!!sourceFile); + if (state.hasCalledUpdateShapeSignature.has(sourceFile.path) || cacheToUpdateSignature.has(sourceFile.path)) { + return false; + } + var info = state.fileInfos.get(sourceFile.path); + ts.Debug.assert(!!info); + var prevSignature = info.signature; + var latestSignature; + if (sourceFile.isDeclarationFile) { + latestSignature = sourceFile.version; + } + else { + var emitOutput = ts.getFileEmitOutput(programOfThisState, sourceFile, true, cancellationToken); + if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { + latestSignature = computeHash(emitOutput.outputFiles[0].text); + } + else { + latestSignature = prevSignature; + } + } + cacheToUpdateSignature.set(sourceFile.path, latestSignature); + return !prevSignature || latestSignature !== prevSignature; + } + function getAllDependencies(state, programOfThisState, sourceFile) { + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + return getAllFileNames(state, programOfThisState); + } + if (!state.referencedMap || (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile))) { + return getAllFileNames(state, programOfThisState); + } + var seenMap = ts.createMap(); + var queue = [sourceFile.path]; + while (queue.length) { + var path = queue.pop(); + if (!seenMap.has(path)) { + seenMap.set(path, true); + var references = state.referencedMap.get(path); + if (references) { + var iterator = references.keys(); + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + queue.push(value); + } + } + } + } + return ts.arrayFrom(ts.mapDefinedIterator(seenMap.keys(), function (path) { + var file = programOfThisState.getSourceFileByPath(path); + return file ? file.fileName : path; + })); + var _b; + } + BuilderState.getAllDependencies = getAllDependencies; + function getAllFileNames(state, programOfThisState) { + if (!state.allFileNames) { + var sourceFiles = programOfThisState.getSourceFiles(); + state.allFileNames = sourceFiles === ts.emptyArray ? ts.emptyArray : sourceFiles.map(function (file) { return file.fileName; }); + } + return state.allFileNames; + } + function getReferencedByPaths(state, referencedFilePath) { + return ts.arrayFrom(ts.mapDefinedIterator(state.referencedMap.entries(), function (_a) { + var filePath = _a[0], referencesInFile = _a[1]; + return referencesInFile.has(referencedFilePath) ? filePath : undefined; + })); + } + function containsOnlyAmbientModules(sourceFile) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (!ts.isModuleWithStringLiteralName(statement)) { + return false; + } + } + return true; + } + function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { + if (state.allFilesExcludingDefaultLibraryFile) { + return state.allFilesExcludingDefaultLibraryFile; + } + var result; + addSourceFile(firstSourceFile); + for (var _i = 0, _a = programOfThisState.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + if (sourceFile !== firstSourceFile) { + addSourceFile(sourceFile); + } + } + state.allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; + return state.allFilesExcludingDefaultLibraryFile; + function addSourceFile(sourceFile) { + if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { + (result || (result = [])).push(sourceFile); + } + } + } + function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash) { + if (!ts.isExternalModule(sourceFileWithUpdatedShape) && !containsOnlyAmbientModules(sourceFileWithUpdatedShape)) { + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + var seenFileNamesMap = ts.createMap(); + seenFileNamesMap.set(sourceFileWithUpdatedShape.path, sourceFileWithUpdatedShape); + var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.path); + while (queue.length > 0) { + var currentPath = queue.pop(); + if (!seenFileNamesMap.has(currentPath)) { + var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); + seenFileNamesMap.set(currentPath, currentSourceFile); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash)) { + queue.push.apply(queue, getReferencedByPaths(state, currentPath)); + } + } + } + return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); + } + })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var server; (function (server) { @@ -83985,22 +86826,24 @@ var ts; } server.isScriptInfo = isScriptInfo; var Project = (function () { - function Project(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled, directoryStructureHost, currentDirectory) { + function Project(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, directoryStructureHost, currentDirectory) { this.projectName = projectName; this.projectKind = projectKind; this.projectService = projectService; this.documentRegistry = documentRegistry; this.compilerOptions = compilerOptions; this.compileOnSaveEnabled = compileOnSaveEnabled; - this.directoryStructureHost = directoryStructureHost; this.rootFiles = []; this.rootFilesMap = ts.createMap(); + this.plugins = []; this.cachedUnresolvedImportsPerFile = new UnresolvedImportsMap(); this.languageServiceEnabled = true; this.lastReportedVersion = 0; this.projectStructureVersion = 0; this.projectStateVersion = 0; + this.dirty = false; this.hasChangedAutomaticTypeDirectiveNames = false; + this.directoryStructureHost = directoryStructureHost; this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory || ""); this.cancellationToken = new ts.ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds); if (!this.compilerOptions) { @@ -84019,12 +86862,13 @@ var ts; if (host.realpath) { this.realpath = function (path) { return host.realpath(path); }; } - this.resolutionCache = ts.createResolutionCache(this, currentDirectory && this.currentDirectory); + this.resolutionCache = ts.createResolutionCache(this, currentDirectory && this.currentDirectory, true); this.languageService = ts.createLanguageService(this, this.documentRegistry); - if (!languageServiceEnabled) { - this.disableLanguageService(); + if (lastFileExceededProgramSize) { + this.disableLanguageService(lastFileExceededProgramSize); } this.markAsDirty(); + this.projectService.pendingEnsureProjectForOpenFiles = true; } Project.prototype.isNonTsProject = function () { this.updateGraph(); @@ -84068,7 +86912,7 @@ var ts; return this.getCompilationSettings(); }; Project.prototype.getNewLine = function () { - return this.directoryStructureHost.newLine; + return this.projectService.host.newLine; }; Project.prototype.getProjectVersion = function () { return this.projectStateVersion.toString(); @@ -84123,20 +86967,20 @@ var ts; return ts.combinePaths(nodeModuleBinDir, ts.getDefaultLibFileName(this.compilerOptions)); }; Project.prototype.useCaseSensitiveFileNames = function () { - return this.directoryStructureHost.useCaseSensitiveFileNames; + return this.projectService.host.useCaseSensitiveFileNames; }; Project.prototype.readDirectory = function (path, extensions, exclude, include, depth) { return this.directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }; Project.prototype.readFile = function (fileName) { - return this.directoryStructureHost.readFile(fileName); + return this.projectService.host.readFile(fileName); }; Project.prototype.fileExists = function (file) { var path = this.toPath(file); return !this.isWatchedMissingFile(path) && this.directoryStructureHost.fileExists(file); }; Project.prototype.resolveModuleNames = function (moduleNames, containingFile, reusedNames) { - return this.resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, true); + return this.resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames); }; Project.prototype.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) { return this.resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); @@ -84147,6 +86991,9 @@ var ts; Project.prototype.getDirectories = function (path) { return this.directoryStructureHost.getDirectories(path); }; + Project.prototype.getCachedDirectoryStructureHost = function () { + return undefined; + }; Project.prototype.toPath = function (fileName) { return ts.toPath(fileName, this.currentDirectory, this.projectService.toCanonicalFileName); }; @@ -84154,14 +87001,14 @@ var ts; return this.projectService.watchDirectory(this.projectService.host, directory, cb, flags, "Directory of Failed lookup locations in module resolution", this); }; Project.prototype.onInvalidatedResolution = function () { - this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(this); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); }; Project.prototype.watchTypeRootsDirectory = function (directory, cb, flags) { return this.projectService.watchDirectory(this.projectService.host, directory, cb, flags, "Type root directory", this); }; Project.prototype.onChangedAutomaticTypeDirectiveNames = function () { this.hasChangedAutomaticTypeDirectiveNames = true; - this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(this); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); }; Project.prototype.getGlobalCache = function () { return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : undefined; @@ -84169,6 +87016,12 @@ var ts; Project.prototype.writeLog = function (s) { this.projectService.logger.info(s); }; + Project.prototype.log = function (s) { + this.writeLog(s); + }; + Project.prototype.error = function (s) { + this.projectService.logger.msg(s, server.Msg.Err); + }; Project.prototype.setInternalCompilerOptionsForEmittingJsFiles = function () { if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) { this.compilerOptions.noEmitForJsFiles = true; @@ -84187,15 +87040,6 @@ var ts; } return this.languageService; }; - Project.prototype.ensureBuilder = function () { - var _this = this; - if (!this.builder) { - this.builder = ts.createBuilder({ - getCanonicalFileName: this.projectService.toCanonicalFileName, - computeHash: function (data) { return _this.projectService.host.createHash(data); } - }); - } - }; Project.prototype.shouldEmitFile = function (scriptInfo) { return scriptInfo && !scriptInfo.isDynamicOrHasMixedContent(); }; @@ -84205,8 +87049,8 @@ var ts; return []; } this.updateGraph(); - this.ensureBuilder(); - return ts.mapDefined(this.builder.getFilesAffectedBy(this.program, scriptInfo.path), function (sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); + this.builderState = ts.BuilderState.create(this.program, this.projectService.toCanonicalFileName, this.builderState); + return ts.mapDefined(ts.BuilderState.getFilesAffectedBy(this.builderState, this.program, scriptInfo.path, this.cancellationToken, function (data) { return _this.projectService.host.createHash(data); }), function (sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); }; Project.prototype.emitFile = function (scriptInfo, writeFile) { if (!this.languageServiceEnabled || !this.shouldEmitFile(scriptInfo)) { @@ -84227,22 +87071,44 @@ var ts; return; } this.languageServiceEnabled = true; + this.lastFileExceededProgramSize = undefined; this.projectService.onUpdateLanguageServiceStateForProject(this, true); }; - Project.prototype.disableLanguageService = function () { + Project.prototype.disableLanguageService = function (lastFileExceededProgramSize) { if (!this.languageServiceEnabled) { return; } this.languageService.cleanupSemanticCache(); this.languageServiceEnabled = false; + this.lastFileExceededProgramSize = lastFileExceededProgramSize; + this.builderState = undefined; this.resolutionCache.closeTypeRootsWatch(); this.projectService.onUpdateLanguageServiceStateForProject(this, false); }; Project.prototype.getProjectName = function () { return this.projectName; }; + Project.prototype.removeLocalTypingsFromTypeAcquisition = function (newTypeAcquisition) { + if (!newTypeAcquisition || !newTypeAcquisition.include) { + return newTypeAcquisition; + } + return __assign({}, newTypeAcquisition, { include: this.removeExistingTypings(newTypeAcquisition.include) }); + }; Project.prototype.getExternalFiles = function () { - return server.emptyArray; + var _this = this; + return server.toSortedArray(ts.flatMap(this.plugins, function (plugin) { + if (typeof plugin.getExternalFiles !== "function") + return; + try { + return plugin.getExternalFiles(_this); + } + catch (e) { + _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e); + if (e.stack) { + _this.projectService.logger.info(e.stack); + } + } + })); }; Project.prototype.getSourceFile = function (path) { if (!this.program) { @@ -84263,11 +87129,12 @@ var ts; var root = _c[_b]; root.detachFromProject(this); } + this.projectService.pendingEnsureProjectForOpenFiles = true; this.rootFiles = undefined; this.rootFilesMap = undefined; this.externalFiles = undefined; this.program = undefined; - this.builder = undefined; + this.builderState = undefined; this.resolutionCache.clear(); this.resolutionCache = undefined; this.cachedUnresolvedImportsPerFile = undefined; @@ -84415,9 +87282,12 @@ var ts; (this.updatedFileNames || (this.updatedFileNames = ts.createMap())).set(fileName, true); }; Project.prototype.markAsDirty = function () { - this.projectStateVersion++; + if (!this.dirty) { + this.projectStateVersion++; + this.dirty = true; + } }; - Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result) { + Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result, ambientModules) { var cached = this.cachedUnresolvedImportsPerFile.get(file.path); if (cached) { for (var _i = 0, cached_2 = cached; _i < cached_2.length; _i++) { @@ -84429,7 +87299,7 @@ var ts; var unresolvedImports; if (file.resolvedModules) { file.resolvedModules.forEach(function (resolvedModule, name) { - if (!resolvedModule && !ts.isExternalModuleNameRelative(name)) { + if (!resolvedModule && !ts.isExternalModuleNameRelative(name) && !isAmbientlyDeclaredModule(name)) { var trimmed = name.trim(); var i = trimmed.indexOf("/"); if (i !== -1 && trimmed.charCodeAt(0) === 64) { @@ -84444,6 +87314,9 @@ var ts; }); } this.cachedUnresolvedImportsPerFile.set(file.path, unresolvedImports || server.emptyArray); + function isAmbientlyDeclaredModule(name) { + return ambientModules.some(function (m) { return m === name; }); + } }; Project.prototype.updateGraph = function () { this.resolutionCache.startRecordingFilesWithChangedResolutions(); @@ -84456,38 +87329,34 @@ var ts; if (this.languageServiceEnabled) { if (hasChanges || changedFiles.length) { var result = []; + var ambientModules = this.program.getTypeChecker().getAmbientModules().map(function (mod) { return ts.stripQuotes(mod.getName()); }); for (var _a = 0, _b = this.program.getSourceFiles(); _a < _b.length; _a++) { var sourceFile = _b[_a]; - this.extractUnresolvedImportsFromSourceFile(sourceFile, result); + this.extractUnresolvedImportsFromSourceFile(sourceFile, result, ambientModules); } this.lastCachedUnresolvedImportsList = server.toDeduplicatedSortedArray(result); } var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, this.lastCachedUnresolvedImportsList, hasChanges); - if (this.setTypings(cachedTypings)) { + if (!ts.arrayIsEqualTo(this.typingFiles, cachedTypings)) { + this.typingFiles = cachedTypings; + this.markAsDirty(); hasChanges = this.updateGraphWorker() || hasChanges; } - if (this.builder) { - this.builder.updateProgram(this.program); - } } else { this.lastCachedUnresolvedImportsList = undefined; - if (this.builder) { - this.builder.clear(); - } } if (hasChanges) { this.projectStructureVersion++; } return !hasChanges; }; - Project.prototype.setTypings = function (typings) { - if (ts.arrayIsEqualTo(this.typingFiles, typings)) { - return false; - } - this.typingFiles = typings; - this.markAsDirty(); - return true; + Project.prototype.getCurrentProgram = function () { + return this.program; + }; + Project.prototype.removeExistingTypings = function (include) { + var existing = ts.getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost); + return include.filter(function (i) { return existing.indexOf(i) < 0; }); }; Project.prototype.updateGraphWorker = function () { var _this = this; @@ -84498,6 +87367,7 @@ var ts; this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution(); this.resolutionCache.startCachingPerDirectoryResolution(); this.program = this.languageService.getProgram(); + this.dirty = false; this.resolutionCache.finishCachingPerDirectoryResolution(); var hasChanges = !oldProgram || (this.program !== oldProgram && !(oldProgram.structureIsReused & 2)); this.hasChangedAutomaticTypeDirectiveNames = false; @@ -84523,7 +87393,7 @@ var ts; scriptInfo.attachToProject(_this); }, function (removed) { return _this.detachScriptInfoFromProject(removed); }, ts.compareStringsCaseSensitive); var elapsed = ts.timestamp() - start; - this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " structureChanged: " + hasChanges + " Elapsed: " + elapsed + "ms"); + this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " Version: " + this.getProjectVersion() + " structureChanged: " + hasChanges + " Elapsed: " + elapsed + "ms"); return hasChanges; }; Project.prototype.detachScriptInfoFromProject = function (uncheckedFileName) { @@ -84537,12 +87407,12 @@ var ts; var _this = this; var fileWatcher = this.projectService.watchFile(this.projectService.host, missingFilePath, function (fileName, eventKind) { if (_this.projectKind === ProjectKind.Configured) { - _this.directoryStructureHost.addOrDeleteFile(fileName, missingFilePath, eventKind); + _this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind); } if (eventKind === ts.FileWatcherEventKind.Created && _this.missingFilesMap.has(missingFilePath)) { _this.missingFilesMap.delete(missingFilePath); fileWatcher.close(); - _this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(_this); + _this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(_this); } }, "Missing file from program", this); return fileWatcher; @@ -84597,7 +87467,8 @@ var ts; version: this.projectStructureVersion, isInferred: this.projectKind === ProjectKind.Inferred, options: this.getCompilationSettings(), - languageServiceDisabled: !this.languageServiceEnabled + languageServiceDisabled: !this.languageServiceEnabled, + lastFileExceededProgramSize: this.lastFileExceededProgramSize }; var updatedFileNames = this.updatedFileNames; this.updatedFileNames = undefined; @@ -84638,15 +87509,86 @@ var ts; ts.orderedRemoveItem(this.rootFiles, info); this.rootFilesMap.delete(info.path); }; + Project.prototype.enableGlobalPlugins = function () { + var host = this.projectService.host; + var options = this.getCompilationSettings(); + if (!host.require) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + var searchPaths = [ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations); + if (this.projectService.globalPlugins) { + var _loop_11 = function (globalPluginName) { + if (!globalPluginName) + return "continue"; + if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) + return "continue"; + this_1.projectService.logger.info("Loading global plugin " + globalPluginName); + this_1.enablePlugin({ name: globalPluginName, global: true }, searchPaths); + }; + var this_1 = this; + for (var _i = 0, _a = this.projectService.globalPlugins; _i < _a.length; _i++) { + var globalPluginName = _a[_i]; + _loop_11(globalPluginName); + } + } + }; + Project.prototype.enablePlugin = function (pluginConfigEntry, searchPaths) { + var _this = this; + this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(",")); + var log = function (message) { + _this.projectService.logger.info(message); + }; + for (var _i = 0, searchPaths_1 = searchPaths; _i < searchPaths_1.length; _i++) { + var searchPath = searchPaths_1[_i]; + var resolvedModule = Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log); + if (resolvedModule) { + this.enableProxy(resolvedModule, pluginConfigEntry); + return; + } + } + this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name); + }; + Project.prototype.enableProxy = function (pluginModuleFactory, configEntry) { + try { + if (typeof pluginModuleFactory !== "function") { + this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did expose a proper factory function"); + return; + } + var info = { + config: configEntry, + project: this, + languageService: this.languageService, + languageServiceHost: this, + serverHost: this.projectService.host + }; + var pluginModule = pluginModuleFactory({ typescript: ts }); + var newLS = pluginModule.create(info); + for (var _i = 0, _a = Object.keys(this.languageService); _i < _a.length; _i++) { + var k = _a[_i]; + if (!(k in newLS)) { + this.projectService.logger.info("Plugin activation warning: Missing proxied method " + k + " in created LS. Patching."); + newLS[k] = this.languageService[k]; + } + } + this.projectService.logger.info("Plugin validation succeded"); + this.languageService = newLS; + this.plugins.push(pluginModule); + } + catch (e) { + this.projectService.logger.info("Plugin activation failed: " + e); + } + }; return Project; }()); server.Project = Project; var InferredProject = (function (_super) { __extends(InferredProject, _super); function InferredProject(projectService, documentRegistry, compilerOptions, projectRootPath, currentDirectory) { - var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, true, compilerOptions, false, projectService.host, currentDirectory) || this; + var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, undefined, undefined, compilerOptions, false, projectService.host, currentDirectory) || this; _this._isJsInferredProject = false; _this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); + _this.enableGlobalPlugins(); return _this; } InferredProject.prototype.toggleJsInferredProject = function (isJsInferredProject) { @@ -84715,10 +87657,9 @@ var ts; server.InferredProject = InferredProject; var ConfiguredProject = (function (_super) { __extends(ConfiguredProject, _super); - function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, cachedDirectoryStructureHost) { - var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; + function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, cachedDirectoryStructureHost) { + var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; _this.compileOnSaveEnabled = compileOnSaveEnabled; - _this.plugins = []; _this.externalProjectRefCount = 0; _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); _this.enablePlugins(); @@ -84762,67 +87703,7 @@ var ts; this.enablePlugin(pluginConfigEntry, searchPaths); } } - if (this.projectService.globalPlugins) { - var _loop_11 = function (globalPluginName) { - if (!globalPluginName) - return "continue"; - if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) - return "continue"; - this_1.projectService.logger.info("Loading global plugin " + globalPluginName); - this_1.enablePlugin({ name: globalPluginName, global: true }, searchPaths); - }; - var this_1 = this; - for (var _b = 0, _c = this.projectService.globalPlugins; _b < _c.length; _b++) { - var globalPluginName = _c[_b]; - _loop_11(globalPluginName); - } - } - }; - ConfiguredProject.prototype.enablePlugin = function (pluginConfigEntry, searchPaths) { - var _this = this; - this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(",")); - var log = function (message) { - _this.projectService.logger.info(message); - }; - for (var _i = 0, searchPaths_1 = searchPaths; _i < searchPaths_1.length; _i++) { - var searchPath = searchPaths_1[_i]; - var resolvedModule = Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log); - if (resolvedModule) { - this.enableProxy(resolvedModule, pluginConfigEntry); - return; - } - } - this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name); - }; - ConfiguredProject.prototype.enableProxy = function (pluginModuleFactory, configEntry) { - try { - if (typeof pluginModuleFactory !== "function") { - this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did expose a proper factory function"); - return; - } - var info = { - config: configEntry, - project: this, - languageService: this.languageService, - languageServiceHost: this, - serverHost: this.projectService.host - }; - var pluginModule = pluginModuleFactory({ typescript: ts }); - var newLS = pluginModule.create(info); - for (var _i = 0, _a = Object.keys(this.languageService); _i < _a.length; _i++) { - var k = _a[_i]; - if (!(k in newLS)) { - this.projectService.logger.info("Plugin activation warning: Missing proxied method " + k + " in created LS. Patching."); - newLS[k] = this.languageService[k]; - } - } - this.projectService.logger.info("Plugin validation succeded"); - this.languageService = newLS; - this.plugins.push(pluginModule); - } - catch (e) { - this.projectService.logger.info("Plugin activation failed: " + e); - } + this.enableGlobalPlugins(); }; ConfiguredProject.prototype.getGlobalProjectErrors = function () { return ts.filter(this.projectErrors, function (diagnostic) { return !diagnostic.file; }) || server.emptyArray; @@ -84834,27 +87715,11 @@ var ts; this.projectErrors = projectErrors; }; ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { - this.typeAcquisition = newTypeAcquisition; + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); }; ConfiguredProject.prototype.getTypeAcquisition = function () { return this.typeAcquisition; }; - ConfiguredProject.prototype.getExternalFiles = function () { - var _this = this; - return server.toSortedArray(ts.flatMap(this.plugins, function (plugin) { - if (typeof plugin.getExternalFiles !== "function") - return; - try { - return plugin.getExternalFiles(_this); - } - catch (e) { - _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e); - if (e.stack) { - _this.projectService.logger.info(e.stack); - } - } - })); - }; ConfiguredProject.prototype.watchWildcards = function (wildcardDirectories) { var _this = this; ts.updateWatchingWildcardDirectories(this.directoriesWatchedForWildcards || (this.directoriesWatchedForWildcards = ts.createMap()), wildcardDirectories, function (directory, flags) { return _this.projectService.watchWildcardDirectory(directory, flags, _this); }); @@ -84911,8 +87776,8 @@ var ts; server.ConfiguredProject = ConfiguredProject; var ExternalProject = (function (_super) { __extends(ExternalProject, _super); - function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, projectFilePath) { - var _this = _super.call(this, externalProjectName, ProjectKind.External, projectService, documentRegistry, true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled, projectService.host, ts.getDirectoryPath(projectFilePath || ts.normalizeSlashes(externalProjectName))) || this; + function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, projectFilePath) { + var _this = _super.call(this, externalProjectName, ProjectKind.External, projectService, documentRegistry, true, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, projectService.host, ts.getDirectoryPath(projectFilePath || ts.normalizeSlashes(externalProjectName))) || this; _this.externalProjectName = externalProjectName; _this.compileOnSaveEnabled = compileOnSaveEnabled; _this.excludedFiles = []; @@ -84929,7 +87794,7 @@ var ts; ts.Debug.assert(!!newTypeAcquisition.include, "newTypeAcquisition.include may not be null/undefined"); ts.Debug.assert(!!newTypeAcquisition.exclude, "newTypeAcquisition.exclude may not be null/undefined"); ts.Debug.assert(typeof newTypeAcquisition.enable === "boolean", "newTypeAcquisition.enable may not be null/undefined"); - this.typeAcquisition = newTypeAcquisition; + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); }; return ExternalProject; }(Project)); @@ -85027,13 +87892,6 @@ var ts; } } server.convertScriptKindName = convertScriptKindName; - function combineProjectOutput(projects, action, comparer, areEqual) { - var outputs = ts.flatMap(projects, action); - return comparer - ? ts.sortAndDeduplicate(outputs, comparer, areEqual) - : ts.deduplicate(outputs, areEqual); - } - server.combineProjectOutput = combineProjectOutput; var fileNamePropertyReader = { getFileName: function (x) { return x; }, getScriptKind: function (fileName, extraFileExtensions) { @@ -85117,6 +87975,9 @@ var ts; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; this.typesMapLocation = (opts.typesMapLocation === undefined) ? ts.combinePaths(this.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); + if (this.host.realpath) { + this.realpathToScriptInfos = ts.createMultiMap(); + } this.currentDirectory = this.host.getCurrentDirectory(); this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); this.throttledOperations = new server.ThrottledOperations(this.host, this.logger); @@ -85164,9 +88025,6 @@ var ts; ProjectService.prototype.getNormalizedAbsolutePath = function (fileName) { return ts.getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory()); }; - ProjectService.prototype.getChangedFiles_TestOnly = function () { - return this.changedFiles; - }; ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () { this.ensureProjectStructuresUptoDate(); }; @@ -85215,25 +88073,26 @@ var ts; } switch (response.kind) { case server.ActionSet: + project.resolutionCache.clear(); this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings); break; case server.ActionInvalidate: + project.resolutionCache.clear(); this.typingsCache.deleteTypingsForProject(response.projectName); break; } - this.delayUpdateProjectGraphAndInferredProjectsRefresh(project); + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); }; - ProjectService.prototype.delayInferredProjectsRefresh = function () { + ProjectService.prototype.delayEnsureProjectForOpenFiles = function () { var _this = this; - this.pendingInferredProjectUpdate = true; - this.throttledOperations.schedule("*refreshInferredProjects*", 250, function () { + this.pendingEnsureProjectForOpenFiles = true; + this.throttledOperations.schedule("*ensureProjectForOpenFiles*", 250, function () { if (_this.pendingProjectUpdates.size !== 0) { - _this.delayInferredProjectsRefresh(); + _this.delayEnsureProjectForOpenFiles(); } else { - if (_this.pendingInferredProjectUpdate) { - _this.pendingInferredProjectUpdate = false; - _this.refreshInferredProjects(); + if (_this.pendingEnsureProjectForOpenFiles) { + _this.ensureProjectForOpenFiles(); } _this.sendProjectsUpdatedInBackgroundEvent(); } @@ -85241,6 +88100,7 @@ var ts; }; ProjectService.prototype.delayUpdateProjectGraph = function (project) { var _this = this; + project.markAsDirty(); var projectName = project.getProjectName(); this.pendingProjectUpdates.set(projectName, project); this.throttledOperations.schedule(projectName, 250, function () { @@ -85265,17 +88125,16 @@ var ts; }; this.eventHandler(event); }; - ProjectService.prototype.delayUpdateProjectGraphAndInferredProjectsRefresh = function (project) { - project.markAsDirty(); + ProjectService.prototype.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles = function (project) { this.delayUpdateProjectGraph(project); - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); }; ProjectService.prototype.delayUpdateProjectGraphs = function (projects) { for (var _i = 0, projects_2 = projects; _i < projects_2.length; _i++) { var project = projects_2[_i]; this.delayUpdateProjectGraph(project); } - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); }; ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions, projectRootPath) { ts.Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); @@ -85288,7 +88147,6 @@ var ts; else { this.compilerOptionsForInferredProjects = compilerOptions; } - var projectsToUpdate = []; for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { var project = _a[_i]; if (canonicalProjectRootPath ? @@ -85297,10 +88155,10 @@ var ts; project.setCompilerOptions(compilerOptions); project.compileOnSaveEnabled = compilerOptions.compileOnSave; project.markAsDirty(); - projectsToUpdate.push(project); + this.delayUpdateProjectGraph(project); } } - this.delayUpdateProjectGraphs(projectsToUpdate); + this.delayEnsureProjectForOpenFiles(); }; ProjectService.prototype.findProject = function (projectName) { if (projectName === undefined) { @@ -85314,7 +88172,7 @@ var ts; }; ProjectService.prototype.getDefaultProjectForFile = function (fileName, ensureProject) { var scriptInfo = this.getScriptInfoForNormalizedPath(fileName); - if (ensureProject && !scriptInfo || scriptInfo.isOrphan()) { + if (ensureProject && (!scriptInfo || scriptInfo.isOrphan())) { this.ensureProjectStructuresUptoDate(); scriptInfo = this.getScriptInfoForNormalizedPath(fileName); if (!scriptInfo) { @@ -85328,40 +88186,22 @@ var ts; this.ensureProjectStructuresUptoDate(); return this.getScriptInfo(uncheckedFileName); }; - ProjectService.prototype.ensureProjectStructuresUptoDate = function (forceInferredProjectsRefresh) { - if (this.changedFiles) { - var projectsToUpdate = void 0; - if (this.changedFiles.length === 1) { - projectsToUpdate = this.changedFiles[0].containingProjects; - } - else { - projectsToUpdate = []; - for (var _i = 0, _a = this.changedFiles; _i < _a.length; _i++) { - var f = _a[_i]; - ts.addRange(projectsToUpdate, f.containingProjects); - } - } - this.changedFiles = undefined; - this.updateProjectGraphs(projectsToUpdate); - } - if (this.pendingProjectUpdates.size !== 0) { - var projectsToUpdate = ts.arrayFrom(this.pendingProjectUpdates.values()); - this.pendingProjectUpdates.clear(); - this.updateProjectGraphs(projectsToUpdate); - } - if (this.pendingInferredProjectUpdate || forceInferredProjectsRefresh) { - this.pendingInferredProjectUpdate = false; - this.refreshInferredProjects(); + ProjectService.prototype.ensureProjectStructuresUptoDate = function () { + var _this = this; + var hasChanges = this.pendingEnsureProjectForOpenFiles; + this.pendingProjectUpdates.clear(); + var updateGraph = function (project) { + hasChanges = _this.updateProjectIfDirty(project) || hasChanges; + }; + this.externalProjects.forEach(updateGraph); + this.configuredProjects.forEach(updateGraph); + this.inferredProjects.forEach(updateGraph); + if (hasChanges) { + this.ensureProjectForOpenFiles(); } }; - ProjectService.prototype.findContainingExternalProject = function (fileName) { - for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - if (proj.containsFile(fileName)) { - return proj; - } - } - return undefined; + ProjectService.prototype.updateProjectIfDirty = function (project) { + return project.dirty && project.updateGraph(); }; ProjectService.prototype.getFormatCodeOptions = function (file) { var formatCodeSettings; @@ -85373,14 +88213,6 @@ var ts; } return formatCodeSettings || this.hostConfiguration.formatCodeOptions; }; - ProjectService.prototype.updateProjectGraphs = function (projects) { - for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { - var p = projects_3[_i]; - if (!p.updateGraph()) { - this.pendingInferredProjectUpdate = true; - } - } - }; ProjectService.prototype.onSourceFileChanged = function (fileName, eventKind) { var info = this.getScriptInfoForNormalizedPath(fileName); if (!info) { @@ -85392,7 +88224,7 @@ var ts; else if (!info.isScriptOpen()) { if (info.containingProjects.length === 0) { this.stopWatchingScriptInfo(info); - this.filenameToScriptInfo.delete(info.path); + this.deleteScriptInfo(info); } else { info.delayReloadNonMixedContentFile(); @@ -85403,7 +88235,7 @@ var ts; ProjectService.prototype.handleDeletedFile = function (info) { this.stopWatchingScriptInfo(info); if (!info.isScriptOpen()) { - this.filenameToScriptInfo.delete(info.path); + this.deleteScriptInfo(info); var containingProjects = info.containingProjects.slice(); info.detachAllProjects(); this.delayUpdateProjectGraphs(containingProjects); @@ -85421,7 +88253,7 @@ var ts; } if (project.pendingReload !== ts.ConfigFileProgramReloadLevel.Full) { project.pendingReload = ts.ConfigFileProgramReloadLevel.Partial; - _this.delayUpdateProjectGraphAndInferredProjectsRefresh(project); + _this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); } }, flags, "Wild card directory", project); }; @@ -85476,7 +88308,7 @@ var ts; ts.Debug.assert(info.isOrphan()); var project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath) || this.getOrCreateSingleInferredProjectIfEnabled() || - this.createInferredProject(ts.getDirectoryPath(info.path)); + this.createInferredProject(info.isDynamic ? this.currentDirectory : ts.getDirectoryPath(info.path)); project.addRoot(info); project.updateGraph(); if (!this.useSingleInferredProject && !project.projectRootPath) { @@ -85546,10 +88378,17 @@ var ts; this.filenameToScriptInfo.forEach(function (info) { if (!info.isScriptOpen() && info.isOrphan()) { _this.stopWatchingScriptInfo(info); - _this.filenameToScriptInfo.delete(info.path); + _this.deleteScriptInfo(info); } }); }; + ProjectService.prototype.deleteScriptInfo = function (info) { + this.filenameToScriptInfo.delete(info.path); + var realpath = info.getRealpathIfDifferent(); + if (realpath) { + this.realpathToScriptInfos.remove(realpath, info); + } + }; ProjectService.prototype.configFileExists = function (configFileName, canonicalConfigFilePath, info) { var configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); if (configFileExistenceInfo) { @@ -85732,8 +88571,8 @@ var ts; this.logger.startGroup(); var counter = 0; var printProjects = function (projects, counter) { - for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { - var project = projects_4[_i]; + for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { + var project = projects_3[_i]; _this.logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); _this.logger.info(project.filesToString(writeProjectFileNames)); _this.logger.info("-----------------------------------------------"); @@ -85746,7 +88585,11 @@ var ts; printProjects(this.inferredProjects, counter); this.logger.info("Open files: "); this.openFiles.forEach(function (projectRootPath, path) { - _this.logger.info("\tFileName: " + _this.getScriptInfoForPath(path).fileName + " ProjectRootPath: " + projectRootPath); + var info = _this.getScriptInfoForPath(path); + _this.logger.info("\tFileName: " + info.fileName + " ProjectRootPath: " + projectRootPath); + if (writeProjectFileNames) { + _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); })); + } }); this.logger.endGroup(); }; @@ -85786,9 +88629,9 @@ var ts; }; return { projectOptions: projectOptions, configFileErrors: errors, configFileSpecs: parsedCommandLine.configFileSpecs }; }; - ProjectService.prototype.exceededTotalSizeLimitForNonTsFiles = function (name, options, fileNames, propertyReader) { + ProjectService.prototype.getFilenameForExceededTotalSizeLimitForNonTsFiles = function (name, options, fileNames, propertyReader) { if (options && options.disableSizeLimit || !this.host.getFileSize) { - return false; + return; } var availableSpace = server.maxProgramSizeForNonTsFiles; this.projectToSizeMap.set(name, 0); @@ -85801,17 +88644,13 @@ var ts; continue; } totalNonTsFileSize += this.host.getFileSize(fileName); - if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles) { + if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles || totalNonTsFileSize > availableSpace) { this.logger.info(getExceedLimitMessage({ propertyReader: propertyReader, hasTypeScriptFileExtension: ts.hasTypeScriptFileExtension, host: this.host }, totalNonTsFileSize)); - return true; + return fileName; } } - if (totalNonTsFileSize > availableSpace) { - this.logger.info(getExceedLimitMessage({ propertyReader: propertyReader, hasTypeScriptFileExtension: ts.hasTypeScriptFileExtension, host: this.host }, totalNonTsFileSize)); - return true; - } this.projectToSizeMap.set(name, totalNonTsFileSize); - return false; + return; function getExceedLimitMessage(context, totalNonTsFileSize) { var files = getTop5LargestFiles(context); return "Non TS file size exceeded limit (" + totalNonTsFileSize + "). Largest files: " + files.map(function (file) { return file.name + ":" + file.size; }).join(", "); @@ -85827,7 +88666,7 @@ var ts; }; ProjectService.prototype.createExternalProject = function (projectFileName, files, options, typeAcquisition, excludedFiles) { var compilerOptions = convertCompilerOptions(options); - var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, !this.exceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); + var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, this.getFilenameForExceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); project.excludedFiles = excludedFiles; this.addFilesToNonInferredProjectAndUpdateGraph(project, files, externalFilePropertyReader, typeAcquisition); this.externalProjects.push(project); @@ -85881,14 +88720,14 @@ var ts; }; ProjectService.prototype.createConfiguredProject = function (configFileName) { var _this = this; - var cachedDirectoryStructureHost = ts.createCachedDirectoryStructureHost(this.host); + var cachedDirectoryStructureHost = ts.createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames); var _a = this.convertConfigFileContentToProjectOptions(configFileName, cachedDirectoryStructureHost), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors, configFileSpecs = _a.configFileSpecs; this.logger.info("Opened configuration file " + configFileName); - var languageServiceEnabled = !this.exceededTotalSizeLimitForNonTsFiles(configFileName, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); - var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, languageServiceEnabled, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave, cachedDirectoryStructureHost); + var lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(configFileName, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); + var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, lastFileExceededProgramSize, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave, cachedDirectoryStructureHost); project.configFileSpecs = configFileSpecs; project.configFileWatcher = this.watchFile(this.host, configFileName, function (_fileName, eventKind) { return _this.onConfigChangedForConfiguredProject(project, eventKind); }, "Config file for the program", project); - if (languageServiceEnabled) { + if (!lastFileExceededProgramSize) { project.watchWildcards(projectOptions.wildcardDirectories); } project.setProjectErrors(configFileErrors); @@ -85969,8 +88808,9 @@ var ts; var _a = this.convertConfigFileContentToProjectOptions(configFileName, host), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors, configFileSpecs = _a.configFileSpecs; project.configFileSpecs = configFileSpecs; project.setProjectErrors(configFileErrors); - if (this.exceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader)) { - project.disableLanguageService(); + var lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); + if (lastFileExceededProgramSize) { + project.disableLanguageService(lastFileExceededProgramSize); project.stopWatchingWildCards(); } else { @@ -85990,7 +88830,7 @@ var ts; }); }; ProjectService.prototype.getOrCreateInferredProjectForProjectRootPathIfEnabled = function (info, projectRootPath) { - if (!this.useInferredProjectPerProjectRoot) { + if (info.isDynamic || !this.useInferredProjectPerProjectRoot) { return undefined; } if (projectRootPath) { @@ -86042,6 +88882,38 @@ var ts; ProjectService.prototype.getScriptInfo = function (uncheckedFileName) { return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); }; + ProjectService.prototype.getSymlinkedProjects = function (info) { + var projects; + if (this.realpathToScriptInfos) { + var realpath = info.getRealpathIfDifferent(); + if (realpath) { + ts.forEach(this.realpathToScriptInfos.get(realpath), combineProjects); + } + ts.forEach(this.realpathToScriptInfos.get(info.path), combineProjects); + } + return projects; + function combineProjects(toAddInfo) { + if (toAddInfo !== info) { + var _loop_12 = function (project) { + if (project.languageServiceEnabled && + !project.getCompilerOptions().preserveSymlinks && + !ts.contains(info.containingProjects, project)) { + if (!projects) { + projects = ts.createMultiMap(); + projects.add(toAddInfo.path, project); + } + else if (!ts.forEachEntry(projects, function (projs, path) { return path === toAddInfo.path ? false : ts.contains(projs, project); })) { + projects.add(toAddInfo.path, project); + } + } + }; + for (var _i = 0, _a = toAddInfo.containingProjects; _i < _a.length; _i++) { + var project = _a[_i]; + _loop_12(project); + } + } + } + }; ProjectService.prototype.watchClosedScriptInfo = function (info) { var _this = this; ts.Debug.assert(!info.fileWatcher); @@ -86066,13 +88938,15 @@ var ts; return this.getOrCreateScriptInfoWorker(fileName, this.currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn); }; ProjectService.prototype.getOrCreateScriptInfoWorker = function (fileName, currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + var _this = this; ts.Debug.assert(fileContent === undefined || openedByClient, "ScriptInfo needs to be opened by client to be able to set its user defined content"); var path = server.normalizedPathToPath(fileName, currentDirectory, this.toCanonicalFileName); var info = this.getScriptInfoForPath(path); if (!info) { - ts.Debug.assert(ts.isRootedDiskPath(fileName) || openedByClient, "Script info with relative file name can only be open script info"); - ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "Open script files with non rooted disk path opened with current directory context cannot have same canonical names"); var isDynamic = server.isDynamicFileName(fileName); + ts.Debug.assert(ts.isRootedDiskPath(fileName) || isDynamic || openedByClient, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nScript info with non-dynamic relative file name can only be open script info"; }); + ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names"; }); + ts.Debug.assert(!isDynamic || this.currentDirectory === currentDirectory, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nDynamic files must always have current directory context since containing external project name will always match the script info name."; }); if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) { return; } @@ -86134,13 +89008,13 @@ var ts; ProjectService.prototype.reloadProjects = function () { this.logger.info("reload projects."); this.reloadConfiguredProjectForFiles(this.openFiles, false, ts.returnTrue); - this.refreshInferredProjects(); + this.ensureProjectForOpenFiles(); }; ProjectService.prototype.delayReloadConfiguredProjectForFiles = function (configFileExistenceInfo, ignoreIfNotRootOfInferredProject) { this.reloadConfiguredProjectForFiles(configFileExistenceInfo.openFilesImpactedByConfigFile, true, ignoreIfNotRootOfInferredProject ? function (isRootOfInferredProject) { return isRootOfInferredProject; } : ts.returnTrue); - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); }; ProjectService.prototype.reloadConfiguredProjectForFiles = function (openFiles, delayReload, shouldReloadProjectFor) { var _this = this; @@ -86184,9 +89058,9 @@ var ts; } } }; - ProjectService.prototype.refreshInferredProjects = function () { + ProjectService.prototype.ensureProjectForOpenFiles = function () { var _this = this; - this.logger.info("refreshInferredProjects: updating project structure from ..."); + this.logger.info("Structure before ensureProjectForOpenFiles:"); this.printProjects(); this.openFiles.forEach(function (projectRootPath, path) { var info = _this.getScriptInfoForPath(path); @@ -86197,47 +89071,54 @@ var ts; _this.removeRootOfInferredProjectIfNowPartOfOtherProject(info); } }); - for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { - var p = _a[_i]; - p.updateGraph(); - } - this.logger.info("refreshInferredProjects: updated project structure ..."); + this.pendingEnsureProjectForOpenFiles = false; + this.inferredProjects.forEach(function (p) { return _this.updateProjectIfDirty(p); }); + this.logger.info("Structure after ensureProjectForOpenFiles:"); this.printProjects(); }; ProjectService.prototype.openClientFile = function (fileName, fileContent, scriptKind, projectRootPath) { return this.openClientFileWithNormalizedPath(server.toNormalizedPath(fileName), fileContent, scriptKind, false, projectRootPath ? server.toNormalizedPath(projectRootPath) : undefined); }; + ProjectService.prototype.findExternalProjetContainingOpenScriptInfo = function (info) { + for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + proj.updateGraph(); + if (proj.containsScriptInfo(info)) { + return proj; + } + } + return undefined; + }; ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { var _this = this; var configFileName; - var sendConfigFileDiagEvent = false; var configFileErrors; var info = this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, fileContent, scriptKind, hasMixedContent); - var project = this.findContainingExternalProject(fileName); + var project = this.findExternalProjetContainingOpenScriptInfo(info); if (!project) { configFileName = this.getConfigFileNameForFile(info, projectRootPath); if (configFileName) { project = this.findConfiguredProjectByProjectName(configFileName); if (!project) { project = this.createConfiguredProject(configFileName); - sendConfigFileDiagEvent = true; + if (info.isOrphan()) { + configFileName = undefined; + } + else { + configFileErrors = project.getAllProjectErrors(); + this.sendConfigFileDiagEvent(project, fileName); + } + } + else { + project.updateGraph(); } } } - if (project && !project.languageServiceEnabled) { - project.markAsDirty(); - } if (info.isOrphan()) { - configFileName = undefined; - sendConfigFileDiagEvent = false; this.assignOrphanScriptInfoToInferredProject(info, projectRootPath); } ts.Debug.assert(!info.isOrphan()); this.openFiles.set(info.path, projectRootPath); - if (sendConfigFileDiagEvent) { - configFileErrors = project.getAllProjectErrors(); - this.sendConfigFileDiagEvent(project, fileName); - } this.configuredProjects.forEach(function (project) { if (!project.hasOpenRef()) { _this.removeProject(project); @@ -86255,13 +89136,13 @@ var ts; this.printProjects(); }; ProjectService.prototype.collectChanges = function (lastKnownProjectVersions, currentProjects, result) { - var _loop_12 = function (proj) { + var _loop_13 = function (proj) { var knownProject = ts.forEach(lastKnownProjectVersions, function (p) { return p.projectName === proj.getProjectName() && p; }); result.push(proj.getChangesSinceVersion(knownProject && knownProject.version)); }; for (var _i = 0, currentProjects_1 = currentProjects; _i < currentProjects_1.length; _i++) { var proj = currentProjects_1[_i]; - _loop_12(proj); + _loop_13(proj); } }; ProjectService.prototype.synchronizeProjectList = function (knownProjects) { @@ -86295,21 +89176,12 @@ var ts; this.closeClientFile(file); } } - if (openFiles || closedFiles) { - this.ensureProjectStructuresUptoDate(true); - } }; ProjectService.prototype.applyChangesToFile = function (scriptInfo, changes) { for (var i = changes.length - 1; i >= 0; i--) { var change = changes[i]; scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); } - if (!this.changedFiles) { - this.changedFiles = [scriptInfo]; - } - else if (!ts.contains(this.changedFiles, scriptInfo)) { - this.changedFiles.push(scriptInfo); - } }; ProjectService.prototype.closeConfiguredProjectReferencedFromExternalProject = function (configFile) { var configuredProject = this.findConfiguredProjectByProjectName(configFile); @@ -86317,35 +89189,24 @@ var ts; configuredProject.deleteExternalProjectReference(); if (!configuredProject.hasOpenRef()) { this.removeProject(configuredProject); - return true; + return; } } - return false; }; - ProjectService.prototype.closeExternalProject = function (uncheckedFileName, suppressRefresh) { - if (suppressRefresh === void 0) { suppressRefresh = false; } + ProjectService.prototype.closeExternalProject = function (uncheckedFileName) { var fileName = server.toNormalizedPath(uncheckedFileName); var configFiles = this.externalProjectToConfiguredProjectMap.get(fileName); if (configFiles) { - var shouldRefreshInferredProjects = false; for (var _i = 0, configFiles_1 = configFiles; _i < configFiles_1.length; _i++) { var configFile = configFiles_1[_i]; - if (this.closeConfiguredProjectReferencedFromExternalProject(configFile)) { - shouldRefreshInferredProjects = true; - } + this.closeConfiguredProjectReferencedFromExternalProject(configFile); } this.externalProjectToConfiguredProjectMap.delete(fileName); - if (shouldRefreshInferredProjects && !suppressRefresh) { - this.ensureProjectStructuresUptoDate(true); - } } else { var externalProject = this.findExternalProjectByProjectName(uncheckedFileName); if (externalProject) { this.removeProject(externalProject); - if (!suppressRefresh) { - this.ensureProjectStructuresUptoDate(true); - } } } }; @@ -86355,15 +89216,14 @@ var ts; ts.forEachKey(this.externalProjectToConfiguredProjectMap, function (externalProjectName) { projectsToClose.set(externalProjectName, true); }); - for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { - var externalProject = projects_5[_i]; - this.openExternalProject(externalProject, true); + for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { + var externalProject = projects_4[_i]; + this.openExternalProject(externalProject); projectsToClose.delete(externalProject.projectFileName); } ts.forEachKey(projectsToClose, function (externalProjectName) { - _this.closeExternalProject(externalProjectName, true); + _this.closeExternalProject(externalProjectName); }); - this.ensureProjectStructuresUptoDate(true); }; ProjectService.escapeFilenameForRegex = function (filename) { return filename.replace(this.filenameEscapeRegexp, "\\$&"); @@ -86382,7 +89242,7 @@ var ts; var excludeRules = []; var normalizedNames = rootFiles.map(function (f) { return ts.normalizeSlashes(f.fileName); }); var excludedFiles = []; - var _loop_13 = function (name) { + var _loop_14 = function (name) { var rule = this_2.safelist[name]; for (var _i = 0, normalizedNames_1 = normalizedNames; _i < normalizedNames_1.length; _i++) { var root = normalizedNames_1[_i]; @@ -86397,7 +89257,7 @@ var ts; } } if (rule.exclude) { - var _loop_14 = function (exclude) { + var _loop_15 = function (exclude) { var processedRule = root.replace(rule.match, function () { var groups = []; for (var _i = 0; _i < arguments.length; _i++) { @@ -86420,7 +89280,7 @@ var ts; }; for (var _c = 0, _d = rule.exclude; _c < _d.length; _c++) { var exclude = _d[_c]; - _loop_14(exclude); + _loop_15(exclude); } } else { @@ -86435,11 +89295,11 @@ var ts; var this_2 = this; for (var _i = 0, _a = Object.keys(this.safelist); _i < _a.length; _i++) { var name = _a[_i]; - _loop_13(name); + _loop_14(name); } var excludeRegexes = excludeRules.map(function (e) { return new RegExp(e, "i"); }); var filesToKeep = []; - var _loop_15 = function (i) { + var _loop_16 = function (i) { if (excludeRegexes.some(function (re) { return re.test(normalizedNames[i]); })) { excludedFiles.push(normalizedNames[i]); } @@ -86473,13 +89333,12 @@ var ts; }; var this_3 = this; for (var i = 0; i < proj.rootFiles.length; i++) { - _loop_15(i); + _loop_16(i); } proj.rootFiles = filesToKeep; return excludedFiles; }; - ProjectService.prototype.openExternalProject = function (proj, suppressRefreshOfInferredProjects) { - if (suppressRefreshOfInferredProjects === void 0) { suppressRefreshOfInferredProjects = false; } + ProjectService.prototype.openExternalProject = function (proj) { if (proj.typingOptions && !proj.typeAcquisition) { var typeAcquisition = ts.convertEnableAutoDiscoveryToEnable(proj.typingOptions); proj.typeAcquisition = typeAcquisition; @@ -86514,8 +89373,9 @@ var ts; externalProject.excludedFiles = excludedFiles; if (!tsConfigFiles) { var compilerOptions = convertCompilerOptions(proj.options); - if (this.exceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader)) { - externalProject.disableLanguageService(); + var lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader); + if (lastFileExceededProgramSize) { + externalProject.disableLanguageService(lastFileExceededProgramSize); } else { externalProject.enableLanguageService(); @@ -86523,11 +89383,11 @@ var ts; this.updateNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave); return; } - this.closeExternalProject(proj.projectFileName, true); + this.closeExternalProject(proj.projectFileName); } else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) { if (!tsConfigFiles) { - this.closeExternalProject(proj.projectFileName, true); + this.closeExternalProject(proj.projectFileName); } else { var oldConfigFiles = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName); @@ -86571,9 +89431,6 @@ var ts; this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles); } - if (!suppressRefreshOfInferredProjects) { - this.ensureProjectStructuresUptoDate(true); - } }; ProjectService.filenameEscapeRegexp = /[-\/\\^$*+?.()|[\]{}]/g; return ProjectService; @@ -86746,13 +89603,32 @@ var ts; }; } server.toEvent = toEvent; + function isProjectsArray(projects) { + return !!projects.length; + } + function combineProjectOutput(defaultValue, getValue, projects, action, comparer, areEqual) { + var outputs = ts.flatMap(isProjectsArray(projects) ? projects : projects.projects, function (project) { return action(project, defaultValue); }); + if (!isProjectsArray(projects) && projects.symLinkedProjects) { + projects.symLinkedProjects.forEach(function (projects, path) { + var value = getValue(path); + outputs.push.apply(outputs, ts.flatMap(projects, function (project) { return action(project, value); })); + }); + } + return comparer + ? ts.sortAndDeduplicate(outputs, comparer, areEqual) + : ts.deduplicate(outputs, areEqual); + } var Session = (function () { function Session(opts) { var _this = this; this.changeSeq = 0; this.handlers = ts.createMapFromTemplate((_a = {}, + _a[server.CommandNames.Status] = function () { + var response = { version: ts.version }; + return _this.requiredResponse(response); + }, _a[server.CommandNames.OpenExternalProject] = function (request) { - _this.projectService.openExternalProject(request.arguments, false); + _this.projectService.openExternalProject(request.arguments); return _this.requiredResponse(true); }, _a[server.CommandNames.OpenExternalProjects] = function (request) { @@ -86996,9 +89872,14 @@ var ts; _a[server.CommandNames.GetCodeFixesFull] = function (request) { return _this.requiredResponse(_this.getCodeFixes(request.arguments, false)); }, + _a[server.CommandNames.GetCombinedCodeFix] = function (request) { + return _this.requiredResponse(_this.getCombinedCodeFix(request.arguments, true)); + }, + _a[server.CommandNames.GetCombinedCodeFixFull] = function (request) { + return _this.requiredResponse(_this.getCombinedCodeFix(request.arguments, false)); + }, _a[server.CommandNames.ApplyCodeActionCommand] = function (request) { - _this.applyCodeActionCommand(request.command, request.seq, request.arguments); - return _this.notRequired(); + return _this.requiredResponse(_this.applyCodeActionCommand(request.arguments)); }, _a[server.CommandNames.GetSupportedCodeFixes] = function () { return _this.requiredResponse(_this.getSupportedCodeFixes()); @@ -87012,6 +89893,12 @@ var ts; _a[server.CommandNames.GetEditsForRefactorFull] = function (request) { return _this.requiredResponse(_this.getEditsForRefactor(request.arguments, false)); }, + _a[server.CommandNames.OrganizeImports] = function (request) { + return _this.requiredResponse(_this.organizeImports(request.arguments, true)); + }, + _a[server.CommandNames.OrganizeImportsFull] = function (request) { + return _this.requiredResponse(_this.organizeImports(request.arguments, false)); + }, _a)); this.host = opts.host; this.cancellationToken = opts.cancellationToken; @@ -87198,8 +90085,8 @@ var ts; return; } this.logger.info("cleaning " + caption); - for (var _i = 0, projects_6 = projects; _i < projects_6.length; _i++) { - var p = projects_6[_i]; + for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { + var p = projects_5[_i]; p.getLanguageService(false).cleanupSemanticCache(); } }; @@ -87434,6 +90321,7 @@ var ts; }; Session.prototype.getProjects = function (args) { var projects; + var symLinkedProjects; if (args.projectFileName) { var project = this.getProject(args.projectFileName); if (project) { @@ -87443,12 +90331,13 @@ var ts; else { var scriptInfo = this.projectService.getScriptInfo(args.file); projects = scriptInfo.containingProjects; + symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo); } projects = ts.filter(projects, function (p) { return p.languageServiceEnabled; }); - if (!projects || !projects.length) { + if ((!projects || !projects.length) && !symLinkedProjects) { return server.Errors.ThrowNoProject(); } - return projects; + return symLinkedProjects ? { projects: projects, symLinkedProjects: symLinkedProjects } : projects; }; Session.prototype.getDefaultProject = function (args) { if (args.projectFileName) { @@ -87461,6 +90350,7 @@ var ts; return info.getDefaultProject(); }; Session.prototype.getRenameLocations = function (args, simplifiedResult) { + var _this = this; var file = server.toNormalizedPath(args.file); var position = this.getPositionInFile(args, file); var projects = this.getProjects(args); @@ -87476,7 +90366,7 @@ var ts; locs: server.emptyArray }; } - var fileSpans = server.combineProjectOutput(projects, function (project) { + var fileSpans = combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (project, file) { var renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); if (!renameLocations) { return server.emptyArray; @@ -87509,7 +90399,7 @@ var ts; return { info: renameInfo, locs: locs }; } else { - return server.combineProjectOutput(projects, function (p) { return p.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); }, undefined, renameLocationIsEqualTo); + return combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (p, file) { return p.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); }, undefined, renameLocationIsEqualTo); } function renameLocationIsEqualTo(a, b) { if (a === b) { @@ -87543,6 +90433,7 @@ var ts; } }; Session.prototype.getReferences = function (args, simplifiedResult) { + var _this = this; var file = server.toNormalizedPath(args.file); var projects = this.getProjects(args); var defaultProject = this.getDefaultProject(args); @@ -87557,7 +90448,7 @@ var ts; var nameSpan = nameInfo.textSpan; var nameColStart = scriptInfo.positionToLineOffset(nameSpan.start).offset; var nameText = scriptInfo.getSnapshot().getText(nameSpan.start, ts.textSpanEnd(nameSpan)); - var refs = server.combineProjectOutput(projects, function (project) { + var refs = combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (project, file) { var references = project.getLanguageService().getReferencesAtPosition(file, position); if (!references) { return server.emptyArray; @@ -87585,7 +90476,7 @@ var ts; }; } else { - return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().findReferences(file, position); }, undefined, ts.equateValues); + return combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (project, file) { return project.getLanguageService().findReferences(file, position); }, undefined, ts.equateValues); } function areReferencesResponseItemsForTheSameLocation(a, b) { if (a && b) { @@ -87770,9 +90661,9 @@ var ts; if (simplifiedResult) { return ts.mapDefined(completions && completions.entries, function (entry) { if (completions.isMemberCompletion || ts.startsWith(entry.name.toLowerCase(), prefix.toLowerCase())) { - var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan, hasAction = entry.hasAction, source = entry.source, isRecommended = entry.isRecommended; + var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, insertText = entry.insertText, replacementSpan = entry.replacementSpan, hasAction = entry.hasAction, source = entry.source, isRecommended = entry.isRecommended; var convertedSpan = replacementSpan ? _this.toLocationTextSpan(replacementSpan, scriptInfo) : undefined; - return { name: name, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan, hasAction: hasAction || undefined, source: source, isRecommended: isRecommended }; + return { name: name, kind: kind, kindModifiers: kindModifiers, sortText: sortText, insertText: insertText, replacementSpan: convertedSpan, hasAction: hasAction || undefined, source: source, isRecommended: isRecommended }; } }).sort(function (a, b) { return ts.compareStringsCaseSensitiveUI(a.name, b.name); }); } @@ -87791,27 +90682,28 @@ var ts; return project.getLanguageService().getCompletionEntryDetails(file, position, name, formattingOptions, source); }); return simplifiedResult - ? result.map(function (details) { return (__assign({}, details, { codeActions: ts.map(details.codeActions, function (action) { return _this.mapCodeAction(action, scriptInfo); }) })); }) + ? result.map(function (details) { return (__assign({}, details, { codeActions: ts.map(details.codeActions, function (action) { return _this.mapCodeAction(project, action); }) })); }) : result; }; Session.prototype.getCompileOnSaveAffectedFileList = function (args) { + var _this = this; var info = this.projectService.getScriptInfoEnsuringProjectsUptoDate(args.file); if (!info) { return server.emptyArray; } - var result = []; - var projectsToSearch = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; - for (var _i = 0, projectsToSearch_1 = projectsToSearch; _i < projectsToSearch_1.length; _i++) { - var project = projectsToSearch_1[_i]; + var projects = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; + var symLinkedProjects = !args.projectFileName && this.projectService.getSymlinkedProjects(info); + return combineProjectOutput(info, function (path) { return _this.projectService.getScriptInfoForPath(path); }, symLinkedProjects ? { projects: projects, symLinkedProjects: symLinkedProjects } : projects, function (project, info) { + var result; if (project.compileOnSaveEnabled && project.languageServiceEnabled && !project.getCompilationSettings().noEmit) { - result.push({ + result = { projectFileName: project.getProjectName(), fileNames: project.getCompileOnSaveAffectedFileList(info), projectUsesOutFile: !!project.getCompilationSettings().outFile || !!project.getCompilationSettings().out - }); + }; } - } - return result; + return result; + }); }; Session.prototype.emitFile = function (args) { var _this = this; @@ -87950,7 +90842,10 @@ var ts; var projects = this.getProjects(args); var fileName = args.currentFileOnly ? args.file && ts.normalizeSlashes(args.file) : undefined; if (simplifiedResult) { - return server.combineProjectOutput(projects, function (project) { + return combineProjectOutput(fileName, function () { return undefined; }, projects, function (project, file) { + if (fileName && !file) { + return undefined; + } var navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); if (!navItems) { return server.emptyArray; @@ -87981,7 +90876,12 @@ var ts; }, undefined, areNavToItemsForTheSameLocation); } else { - return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); }, undefined, navigateToItemIsEqualTo); + return combineProjectOutput(fileName, function () { return undefined; }, projects, function (project, file) { + if (fileName && !file) { + return undefined; + } + return project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, project.isNonTsProject()); + }, undefined, navigateToItemIsEqualTo); } function navigateToItemIsEqualTo(a, b) { if (a === b) { @@ -88038,7 +90938,6 @@ var ts; return project.getLanguageService().getApplicableRefactors(file, position || textRange); }; Session.prototype.getEditsForRefactor = function (args, simplifiedResult) { - var _this = this; var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; var scriptInfo = project.getScriptInfoForNormalizedPath(file); var _b = this.extractPositionAndRange(args, scriptInfo), position = _b.position, textRange = _b.textRange; @@ -88053,20 +90952,27 @@ var ts; var mappedRenameLocation = void 0; if (renameFilename !== undefined && renameLocation !== undefined) { var renameScriptInfo = project.getScriptInfoForNormalizedPath(server.toNormalizedPath(renameFilename)); - var snapshot = renameScriptInfo.getSnapshot(); - var oldText = snapshot.getText(0, snapshot.getLength()); - mappedRenameLocation = getLocationInNewDocument(oldText, renameFilename, renameLocation, edits); + mappedRenameLocation = getLocationInNewDocument(ts.getSnapshotText(renameScriptInfo.getSnapshot()), renameFilename, renameLocation, edits); } - return { - renameLocation: mappedRenameLocation, - renameFilename: renameFilename, - edits: edits.map(function (change) { return _this.mapTextChangesToCodeEdits(project, change); }) - }; + return { renameLocation: mappedRenameLocation, renameFilename: renameFilename, edits: this.mapTextChangesToCodeEdits(project, edits) }; } else { return result; } }; + Session.prototype.organizeImports = function (_a, simplifiedResult) { + var scope = _a.scope; + ts.Debug.assert(scope.type === "file"); + var _b = this.getFileAndProject(scope.args), file = _b.file, project = _b.project; + var formatOptions = this.projectService.getFormatCodeOptions(file); + var changes = project.getLanguageService().organizeImports({ type: "file", fileName: file }, formatOptions); + if (simplifiedResult) { + return this.mapTextChangesToCodeEdits(project, changes); + } + else { + return changes; + } + }; Session.prototype.getCodeFixes = function (args, simplifiedResult) { var _this = this; if (args.errorCodes.length === 0) { @@ -88081,25 +90987,33 @@ var ts; return undefined; } if (simplifiedResult) { - return codeActions.map(function (codeAction) { return _this.mapCodeAction(codeAction, scriptInfo); }); + return codeActions.map(function (codeAction) { return _this.mapCodeAction(project, codeAction); }); } else { return codeActions; } }; - Session.prototype.applyCodeActionCommand = function (commandName, requestSeq, args) { - var _this = this; + Session.prototype.getCombinedCodeFix = function (_a, simplifiedResult) { + var scope = _a.scope, fixId = _a.fixId; + ts.Debug.assert(scope.type === "file"); + var _b = this.getFileAndProject(scope.args), file = _b.file, project = _b.project; + var formatOptions = this.projectService.getFormatCodeOptions(file); + var res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId, formatOptions); + if (simplifiedResult) { + return { changes: this.mapTextChangesToCodeEdits(project, res.changes), commands: res.commands }; + } + else { + return res; + } + }; + Session.prototype.applyCodeActionCommand = function (args) { var commands = args.command; - var _loop_16 = function (command) { - var project = this_4.getFileAndProject(command).project; - var output = function (success, message) { return _this.doOutput({}, commandName, requestSeq, success, message); }; - project.getLanguageService().applyCodeActionCommand(command).then(function (result) { output(true, result.successMessage); }, function (error) { output(false, error); }); - }; - var this_4 = this; for (var _i = 0, _a = ts.toArray(commands); _i < _a.length; _i++) { var command = _a[_i]; - _loop_16(command); + var project = this.getFileAndProject(command).project; + project.getLanguageService().applyCodeActionCommand(command).then(function (_result) { }, function (_error) { }); } + return {}; }; Session.prototype.getStartAndEndPosition = function (args, scriptInfo) { var startPosition = undefined, endPosition = undefined; @@ -88119,18 +91033,18 @@ var ts; } return { startPosition: startPosition, endPosition: endPosition }; }; - Session.prototype.mapCodeAction = function (_a, scriptInfo) { + Session.prototype.mapCodeAction = function (project, _a) { var _this = this; - var description = _a.description, unmappedChanges = _a.changes, commands = _a.commands; - var changes = unmappedChanges.map(function (change) { return ({ - fileName: change.fileName, - textChanges: change.textChanges.map(function (textChange) { return _this.convertTextChangeToCodeEdit(textChange, scriptInfo); }) - }); }); - return { description: description, changes: changes, commands: commands }; + var description = _a.description, unmappedChanges = _a.changes, commands = _a.commands, fixId = _a.fixId; + var changes = unmappedChanges.map(function (change) { return _this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(server.toNormalizedPath(change.fileName))); }); + return { description: description, changes: changes, commands: commands, fixId: fixId }; }; Session.prototype.mapTextChangesToCodeEdits = function (project, textChanges) { var _this = this; - var scriptInfo = project.getScriptInfoForNormalizedPath(server.toNormalizedPath(textChanges.fileName)); + return textChanges.map(function (change) { return _this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(server.toNormalizedPath(change.fileName))); }); + }; + Session.prototype.mapTextChangesToCodeEditsUsingScriptinfo = function (textChanges, scriptInfo) { + var _this = this; return { fileName: textChanges.fileName, textChanges: textChanges.textChanges.map(function (textChange) { return _this.convertTextChangeToCodeEdit(textChange, scriptInfo); }) @@ -88290,13 +91204,13 @@ var ts; server.getLocationInNewDocument = getLocationInNewDocument; function applyEdits(text, textFilename, edits) { for (var _i = 0, edits_3 = edits; _i < edits_3.length; _i++) { - var _a = edits_3[_i], fileName = _a.fileName, textChanges_3 = _a.textChanges; + var _a = edits_3[_i], fileName = _a.fileName, textChanges_4 = _a.textChanges; if (fileName !== textFilename) { continue; } - for (var i = textChanges_3.length - 1; i >= 0; i--) { - var _b = textChanges_3[i], newText = _b.newText, _c = _b.span, start = _c.start, length_8 = _c.length; - text = text.slice(0, start) + newText + text.slice(start + length_8); + for (var i = textChanges_4.length - 1; i >= 0; i--) { + var _b = textChanges_4[i], newText = _b.newText, _c = _b.span, start = _c.start, length_6 = _c.length; + text = text.slice(0, start) + newText + text.slice(start + length_6); } } return text; @@ -88620,7 +91534,7 @@ var ts; return this.index.getText(rangeStart, rangeEnd - rangeStart); }; LineIndexSnapshot.prototype.getLength = function () { - return this.index.root.charCount(); + return this.index.getLength(); }; LineIndexSnapshot.prototype.getChangeRange = function (oldSnapshot) { if (oldSnapshot instanceof LineIndexSnapshot && this.cache === oldSnapshot.cache) { @@ -88893,7 +91807,7 @@ var ts; } } var leaf = this.lineNumberToInfo(this.lineCount(), 0).leaf; - return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined }; + return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf ? leaf.charCount() : 0, lineText: undefined }; }; LineNode.prototype.lineNumberToInfo = function (relativeOneBasedLine, positionAccumulator) { for (var _i = 0, _a = this.children; _i < _a.length; _i++) { @@ -89634,7 +92548,8 @@ var ts; } var logger = createLogger(); var sys = ts.sys; - var useWatchGuard = process.platform === "win32" && ts.getNodeMajorVersion() >= 4; + var nodeVersion = ts.getNodeMajorVersion(); + var useWatchGuard = process.platform === "win32" && nodeVersion >= 4; var originalWatchDirectory = sys.watchDirectory.bind(sys); var noopWatcher = { close: ts.noop }; function watchDirectorySwallowingException(path, callback, recursive) { @@ -89769,6 +92684,10 @@ var ts; pluginProbeLocations: pluginProbeLocations, allowLocalPluginLoads: allowLocalPluginLoads }; + logger.info("Starting TS Server"); + logger.info("Version: " + ts.version); + logger.info("Arguments: " + process.argv.join(" ")); + logger.info("Platform: " + os.platform() + " NodeVersion: " + nodeVersion + " CaseSensitive: " + sys.useCaseSensitiveFileNames); var ioSession = new IOSession(options); process.on("uncaughtException", function (err) { ioSession.logError(err, "unknown"); diff --git a/lib/tsserverlibrary.d.ts b/lib/tsserverlibrary.d.ts index 6fd389d170a..8739616ce14 100644 --- a/lib/tsserverlibrary.d.ts +++ b/lib/tsserverlibrary.d.ts @@ -59,6 +59,7 @@ declare namespace ts { pos: number; end: number; } + type JsDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.Unknown; enum SyntaxKind { Unknown = 0, EndOfFileToken = 1, @@ -186,177 +187,180 @@ declare namespace ts { ConstructorKeyword = 123, DeclareKeyword = 124, GetKeyword = 125, - IsKeyword = 126, - KeyOfKeyword = 127, - ModuleKeyword = 128, - NamespaceKeyword = 129, - NeverKeyword = 130, - ReadonlyKeyword = 131, - RequireKeyword = 132, - NumberKeyword = 133, - ObjectKeyword = 134, - SetKeyword = 135, - StringKeyword = 136, - SymbolKeyword = 137, - TypeKeyword = 138, - UndefinedKeyword = 139, - UniqueKeyword = 140, - FromKeyword = 141, - GlobalKeyword = 142, - OfKeyword = 143, - QualifiedName = 144, - ComputedPropertyName = 145, - TypeParameter = 146, - Parameter = 147, - Decorator = 148, - PropertySignature = 149, - PropertyDeclaration = 150, - MethodSignature = 151, - MethodDeclaration = 152, - Constructor = 153, - GetAccessor = 154, - SetAccessor = 155, - CallSignature = 156, - ConstructSignature = 157, - IndexSignature = 158, - TypePredicate = 159, - TypeReference = 160, - FunctionType = 161, - ConstructorType = 162, - TypeQuery = 163, - TypeLiteral = 164, - ArrayType = 165, - TupleType = 166, - UnionType = 167, - IntersectionType = 168, - ParenthesizedType = 169, - ThisType = 170, - TypeOperator = 171, - IndexedAccessType = 172, - MappedType = 173, - LiteralType = 174, - ObjectBindingPattern = 175, - ArrayBindingPattern = 176, - BindingElement = 177, - ArrayLiteralExpression = 178, - ObjectLiteralExpression = 179, - PropertyAccessExpression = 180, - ElementAccessExpression = 181, - CallExpression = 182, - NewExpression = 183, - TaggedTemplateExpression = 184, - TypeAssertionExpression = 185, - ParenthesizedExpression = 186, - FunctionExpression = 187, - ArrowFunction = 188, - DeleteExpression = 189, - TypeOfExpression = 190, - VoidExpression = 191, - AwaitExpression = 192, - PrefixUnaryExpression = 193, - PostfixUnaryExpression = 194, - BinaryExpression = 195, - ConditionalExpression = 196, - TemplateExpression = 197, - YieldExpression = 198, - SpreadElement = 199, - ClassExpression = 200, - OmittedExpression = 201, - ExpressionWithTypeArguments = 202, - AsExpression = 203, - NonNullExpression = 204, - MetaProperty = 205, - TemplateSpan = 206, - SemicolonClassElement = 207, - Block = 208, - VariableStatement = 209, - EmptyStatement = 210, - ExpressionStatement = 211, - IfStatement = 212, - DoStatement = 213, - WhileStatement = 214, - ForStatement = 215, - ForInStatement = 216, - ForOfStatement = 217, - ContinueStatement = 218, - BreakStatement = 219, - ReturnStatement = 220, - WithStatement = 221, - SwitchStatement = 222, - LabeledStatement = 223, - ThrowStatement = 224, - TryStatement = 225, - DebuggerStatement = 226, - VariableDeclaration = 227, - VariableDeclarationList = 228, - FunctionDeclaration = 229, - ClassDeclaration = 230, - InterfaceDeclaration = 231, - TypeAliasDeclaration = 232, - EnumDeclaration = 233, - ModuleDeclaration = 234, - ModuleBlock = 235, - CaseBlock = 236, - NamespaceExportDeclaration = 237, - ImportEqualsDeclaration = 238, - ImportDeclaration = 239, - ImportClause = 240, - NamespaceImport = 241, - NamedImports = 242, - ImportSpecifier = 243, - ExportAssignment = 244, - ExportDeclaration = 245, - NamedExports = 246, - ExportSpecifier = 247, - MissingDeclaration = 248, - ExternalModuleReference = 249, - JsxElement = 250, - JsxSelfClosingElement = 251, - JsxOpeningElement = 252, - JsxClosingElement = 253, - JsxFragment = 254, - JsxOpeningFragment = 255, - JsxClosingFragment = 256, - JsxAttribute = 257, - JsxAttributes = 258, - JsxSpreadAttribute = 259, - JsxExpression = 260, - CaseClause = 261, - DefaultClause = 262, - HeritageClause = 263, - CatchClause = 264, - PropertyAssignment = 265, - ShorthandPropertyAssignment = 266, - SpreadAssignment = 267, - EnumMember = 268, - SourceFile = 269, - Bundle = 270, - JSDocTypeExpression = 271, - JSDocAllType = 272, - JSDocUnknownType = 273, - JSDocNullableType = 274, - JSDocNonNullableType = 275, - JSDocOptionalType = 276, - JSDocFunctionType = 277, - JSDocVariadicType = 278, - JSDocComment = 279, - JSDocTypeLiteral = 280, - JSDocTag = 281, - JSDocAugmentsTag = 282, - JSDocClassTag = 283, - JSDocParameterTag = 284, - JSDocReturnTag = 285, - JSDocTypeTag = 286, - JSDocTemplateTag = 287, - JSDocTypedefTag = 288, - JSDocPropertyTag = 289, - SyntaxList = 290, - NotEmittedStatement = 291, - PartiallyEmittedExpression = 292, - CommaListExpression = 293, - MergeDeclarationMarker = 294, - EndOfDeclarationMarker = 295, - Count = 296, + InferKeyword = 126, + IsKeyword = 127, + KeyOfKeyword = 128, + ModuleKeyword = 129, + NamespaceKeyword = 130, + NeverKeyword = 131, + ReadonlyKeyword = 132, + RequireKeyword = 133, + NumberKeyword = 134, + ObjectKeyword = 135, + SetKeyword = 136, + StringKeyword = 137, + SymbolKeyword = 138, + TypeKeyword = 139, + UndefinedKeyword = 140, + UniqueKeyword = 141, + FromKeyword = 142, + GlobalKeyword = 143, + OfKeyword = 144, + QualifiedName = 145, + ComputedPropertyName = 146, + TypeParameter = 147, + Parameter = 148, + Decorator = 149, + PropertySignature = 150, + PropertyDeclaration = 151, + MethodSignature = 152, + MethodDeclaration = 153, + Constructor = 154, + GetAccessor = 155, + SetAccessor = 156, + CallSignature = 157, + ConstructSignature = 158, + IndexSignature = 159, + TypePredicate = 160, + TypeReference = 161, + FunctionType = 162, + ConstructorType = 163, + TypeQuery = 164, + TypeLiteral = 165, + ArrayType = 166, + TupleType = 167, + UnionType = 168, + IntersectionType = 169, + ConditionalType = 170, + InferType = 171, + ParenthesizedType = 172, + ThisType = 173, + TypeOperator = 174, + IndexedAccessType = 175, + MappedType = 176, + LiteralType = 177, + ObjectBindingPattern = 178, + ArrayBindingPattern = 179, + BindingElement = 180, + ArrayLiteralExpression = 181, + ObjectLiteralExpression = 182, + PropertyAccessExpression = 183, + ElementAccessExpression = 184, + CallExpression = 185, + NewExpression = 186, + TaggedTemplateExpression = 187, + TypeAssertionExpression = 188, + ParenthesizedExpression = 189, + FunctionExpression = 190, + ArrowFunction = 191, + DeleteExpression = 192, + TypeOfExpression = 193, + VoidExpression = 194, + AwaitExpression = 195, + PrefixUnaryExpression = 196, + PostfixUnaryExpression = 197, + BinaryExpression = 198, + ConditionalExpression = 199, + TemplateExpression = 200, + YieldExpression = 201, + SpreadElement = 202, + ClassExpression = 203, + OmittedExpression = 204, + ExpressionWithTypeArguments = 205, + AsExpression = 206, + NonNullExpression = 207, + MetaProperty = 208, + TemplateSpan = 209, + SemicolonClassElement = 210, + Block = 211, + VariableStatement = 212, + EmptyStatement = 213, + ExpressionStatement = 214, + IfStatement = 215, + DoStatement = 216, + WhileStatement = 217, + ForStatement = 218, + ForInStatement = 219, + ForOfStatement = 220, + ContinueStatement = 221, + BreakStatement = 222, + ReturnStatement = 223, + WithStatement = 224, + SwitchStatement = 225, + LabeledStatement = 226, + ThrowStatement = 227, + TryStatement = 228, + DebuggerStatement = 229, + VariableDeclaration = 230, + VariableDeclarationList = 231, + FunctionDeclaration = 232, + ClassDeclaration = 233, + InterfaceDeclaration = 234, + TypeAliasDeclaration = 235, + EnumDeclaration = 236, + ModuleDeclaration = 237, + ModuleBlock = 238, + CaseBlock = 239, + NamespaceExportDeclaration = 240, + ImportEqualsDeclaration = 241, + ImportDeclaration = 242, + ImportClause = 243, + NamespaceImport = 244, + NamedImports = 245, + ImportSpecifier = 246, + ExportAssignment = 247, + ExportDeclaration = 248, + NamedExports = 249, + ExportSpecifier = 250, + MissingDeclaration = 251, + ExternalModuleReference = 252, + JsxElement = 253, + JsxSelfClosingElement = 254, + JsxOpeningElement = 255, + JsxClosingElement = 256, + JsxFragment = 257, + JsxOpeningFragment = 258, + JsxClosingFragment = 259, + JsxAttribute = 260, + JsxAttributes = 261, + JsxSpreadAttribute = 262, + JsxExpression = 263, + CaseClause = 264, + DefaultClause = 265, + HeritageClause = 266, + CatchClause = 267, + PropertyAssignment = 268, + ShorthandPropertyAssignment = 269, + SpreadAssignment = 270, + EnumMember = 271, + SourceFile = 272, + Bundle = 273, + JSDocTypeExpression = 274, + JSDocAllType = 275, + JSDocUnknownType = 276, + JSDocNullableType = 277, + JSDocNonNullableType = 278, + JSDocOptionalType = 279, + JSDocFunctionType = 280, + JSDocVariadicType = 281, + JSDocComment = 282, + JSDocTypeLiteral = 283, + JSDocTag = 284, + JSDocAugmentsTag = 285, + JSDocClassTag = 286, + JSDocParameterTag = 287, + JSDocReturnTag = 288, + JSDocTypeTag = 289, + JSDocTemplateTag = 290, + JSDocTypedefTag = 291, + JSDocPropertyTag = 292, + SyntaxList = 293, + NotEmittedStatement = 294, + PartiallyEmittedExpression = 295, + CommaListExpression = 296, + MergeDeclarationMarker = 297, + EndOfDeclarationMarker = 298, + Count = 299, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -364,15 +368,15 @@ declare namespace ts { FirstReservedWord = 72, LastReservedWord = 107, FirstKeyword = 72, - LastKeyword = 143, + LastKeyword = 144, FirstFutureReservedWord = 108, LastFutureReservedWord = 116, - FirstTypeNode = 159, - LastTypeNode = 174, + FirstTypeNode = 160, + LastTypeNode = 177, FirstPunctuation = 17, LastPunctuation = 70, FirstToken = 0, - LastToken = 143, + LastToken = 144, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -381,11 +385,11 @@ declare namespace ts { LastTemplateToken = 16, FirstBinaryOperator = 27, LastBinaryOperator = 70, - FirstNode = 144, - FirstJSDocNode = 271, - LastJSDocNode = 289, - FirstJSDocTagNode = 281, - LastJSDocTagNode = 289, + FirstNode = 145, + FirstJSDocNode = 274, + LastJSDocNode = 292, + FirstJSDocTagNode = 284, + LastJSDocTagNode = 292, } enum NodeFlags { None = 0, @@ -453,6 +457,9 @@ declare namespace ts { interface JSDocContainer { } type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | EndOfFileToken; + type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; + type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; + type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; interface NodeArray extends ReadonlyArray, TextRange { hasTrailingComma?: boolean; } @@ -470,6 +477,8 @@ declare namespace ts { type AtToken = Token; type ReadonlyToken = Token; type AwaitKeywordToken = Token; + type PlusToken = Token; + type MinusToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression, Declaration { @@ -513,7 +522,7 @@ declare namespace ts { } interface TypeParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.TypeParameter; - parent?: DeclarationWithTypeParameters; + parent?: DeclarationWithTypeParameters | InferTypeNode; name: Identifier; constraint?: TypeNode; default?: TypeNode; @@ -604,15 +613,7 @@ declare namespace ts { kind: SyntaxKind.SpreadAssignment; expression: Expression; } - interface VariableLikeDeclaration extends NamedDeclaration { - propertyName?: PropertyName; - dotDotDotToken?: DotDotDotToken; - name: DeclarationName; - questionToken?: QuestionToken; - exclamationToken?: ExclamationToken; - type?: TypeNode; - initializer?: Expression; - } + type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag; interface PropertyLikeDeclaration extends NamedDeclaration { name: PropertyName; } @@ -643,7 +644,7 @@ declare namespace ts { body?: Block | Expression; } type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction; - type FunctionLike = FunctionLikeDeclaration | FunctionTypeNode | ConstructorTypeNode | IndexSignatureDeclaration | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration; + type FunctionLike = FunctionLikeDeclaration | FunctionTypeNode | ConstructorTypeNode | IndexSignatureDeclaration | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration | JSDocFunctionType; interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.FunctionDeclaration; name?: Identifier; @@ -651,39 +652,41 @@ declare namespace ts { } interface MethodSignature extends SignatureDeclarationBase, TypeElement { kind: SyntaxKind.MethodSignature; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.MethodDeclaration; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer { kind: SyntaxKind.Constructor; - parent?: ClassDeclaration | ClassExpression; + parent?: ClassLikeDeclaration; body?: FunctionBody; } /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ interface SemicolonClassElement extends ClassElement { kind: SyntaxKind.SemicolonClassElement; - parent?: ClassDeclaration | ClassExpression; + parent?: ClassLikeDeclaration; } interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.GetAccessor; - parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.SetAccessor; - parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; - parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; } interface TypeNode extends Node { _typeNodeBrand: any; @@ -738,6 +741,17 @@ declare namespace ts { kind: SyntaxKind.IntersectionType; types: NodeArray; } + interface ConditionalTypeNode extends TypeNode { + kind: SyntaxKind.ConditionalType; + checkType: TypeNode; + extendsType: TypeNode; + trueType: TypeNode; + falseType: TypeNode; + } + interface InferTypeNode extends TypeNode { + kind: SyntaxKind.InferType; + typeParameter: TypeParameterDeclaration; + } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; type: TypeNode; @@ -754,9 +768,9 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; - readonlyToken?: ReadonlyToken; + readonlyToken?: ReadonlyToken | PlusToken | MinusToken; typeParameter: TypeParameterDeclaration; - questionToken?: QuestionToken; + questionToken?: QuestionToken | PlusToken | MinusToken; type?: TypeNode; } interface LiteralTypeNode extends TypeNode { @@ -766,6 +780,7 @@ declare namespace ts { interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; } + type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; interface Expression extends Node { _expressionBrand: any; } @@ -881,7 +896,7 @@ declare namespace ts { type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment; type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression | Identifier | PropertyAccessExpression | ElementAccessExpression; type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment; - type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Expression; + type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression; type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression; type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression; type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression; @@ -905,6 +920,7 @@ declare namespace ts { kind: SyntaxKind.ArrowFunction; equalsGreaterThanToken: EqualsGreaterThanToken; body: ConciseBody; + name: never; } interface LiteralLikeNode extends Node { text: string; @@ -972,7 +988,7 @@ declare namespace ts { interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; @@ -1255,6 +1271,7 @@ declare namespace ts { } interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.ClassDeclaration; + /** May be undefined in `export default class { ... }`. */ name?: Identifier; } interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression { @@ -1279,7 +1296,7 @@ declare namespace ts { } interface HeritageClause extends Node { kind: SyntaxKind.HeritageClause; - parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; + parent?: InterfaceDeclaration | ClassLikeDeclaration; token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; types: NodeArray; } @@ -1366,6 +1383,7 @@ declare namespace ts { interface ExportDeclaration extends DeclarationStatement { kind: SyntaxKind.ExportDeclaration; parent?: SourceFile | ModuleBlock; + /** Will not be assigned in the case of `export * from "foo";` */ exportClause?: NamedExports; /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier?: Expression; @@ -1394,6 +1412,10 @@ declare namespace ts { name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + /** + * This is either an `export =` or an `export default` declaration. + * Unless `isExportEquals` is set, this node was parsed as an `export default`. + */ interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; parent?: SourceFile; @@ -1620,7 +1642,7 @@ declare namespace ts { } interface ParseConfigHost { useCaseSensitiveFileNames: boolean; - readDirectory(rootDir: string, extensions: ReadonlyArray, excludes: ReadonlyArray, includes: ReadonlyArray, depth: number): string[]; + readDirectory(rootDir: string, extensions: ReadonlyArray, excludes: ReadonlyArray | undefined, includes: ReadonlyArray, depth?: number): string[]; /** * Gets a value indicating whether the specified path exists and is a file. * @param path The path to test. @@ -1728,9 +1750,21 @@ declare namespace ts { /** Note that the resulting nodes cannot be checked. */ typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode; /** Note that the resulting nodes cannot be checked. */ - signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; + signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration & { + typeArguments?: NodeArray; + } | undefined; /** Note that the resulting nodes cannot be checked. */ - indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): EntityName | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Expression | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): NodeArray | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): ParameterDeclaration | undefined; + /** Note that the resulting nodes cannot be checked. */ + typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeParameterDeclaration | undefined; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol | undefined; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -1750,7 +1784,8 @@ declare namespace ts { getTypeFromTypeNode(node: TypeNode): Type; signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; + symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string; + typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; /** * @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead * This will be removed in a future version. @@ -1790,33 +1825,80 @@ declare namespace ts { None = 0, NoTruncation = 1, WriteArrayAsGenericType = 2, + UseStructuralFallback = 8, + WriteTypeArgumentsOfSignature = 32, + UseFullyQualifiedType = 64, + UseOnlyExternalAliasing = 128, + SuppressAnyReturnType = 256, + WriteTypeParametersInQualifiedName = 512, + MultilineObjectLiterals = 1024, + WriteClassExpressionAsTypeLiteral = 2048, + UseTypeOfFunction = 4096, + OmitParameterModifiers = 8192, + UseAliasDefinedOutsideCurrentScope = 16384, + AllowThisInObjectLiteral = 32768, + AllowQualifedNameInPlaceOfIdentifier = 65536, + AllowAnonymousIdentifier = 131072, + AllowEmptyUnionOrIntersection = 262144, + AllowEmptyTuple = 524288, + AllowUniqueESSymbolType = 1048576, + AllowEmptyIndexInfoType = 2097152, + IgnoreErrors = 3112960, + InObjectTypeLiteral = 4194304, + InTypeAlias = 8388608, + InInitialEntityName = 16777216, + InReverseMappedType = 33554432, + } + enum TypeFormatFlags { + None = 0, + NoTruncation = 1, + WriteArrayAsGenericType = 2, + UseStructuralFallback = 8, WriteTypeArgumentsOfSignature = 32, UseFullyQualifiedType = 64, SuppressAnyReturnType = 256, - WriteTypeParametersInQualifiedName = 512, - AllowThisInObjectLiteral = 1024, - AllowQualifedNameInPlaceOfIdentifier = 2048, - AllowAnonymousIdentifier = 8192, - AllowEmptyUnionOrIntersection = 16384, - AllowEmptyTuple = 32768, - IgnoreErrors = 60416, - InObjectTypeLiteral = 1048576, + MultilineObjectLiterals = 1024, + WriteClassExpressionAsTypeLiteral = 2048, + UseTypeOfFunction = 4096, + OmitParameterModifiers = 8192, + UseAliasDefinedOutsideCurrentScope = 16384, + AllowUniqueESSymbolType = 1048576, + AddUndefined = 131072, + WriteArrowStyleSignature = 262144, + InArrayType = 524288, + InElementType = 2097152, + InFirstTypeArgument = 4194304, InTypeAlias = 8388608, + /** @deprecated */ WriteOwnNameForAnyLike = 0, + NodeBuilderFlagsMask = 9469291, } + enum SymbolFormatFlags { + None = 0, + WriteTypeParametersOrArguments = 1, + UseOnlyExternalAliasing = 2, + AllowAnyNodeKind = 4, + UseAliasDefinedOutsideCurrentScope = 8, + } + /** + * @deprecated + */ interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; - buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; + /** @deprecated */ buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + /** @deprecated */ buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; + /** @deprecated */ buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; } - interface SymbolWriter { + /** + * @deprecated Migrate to other methods of generating symbol names, ex symbolToEntityName + a printer or symbolToString + */ + interface SymbolWriter extends SymbolTracker { writeKeyword(text: string): void; writeOperator(text: string): void; writePunctuation(text: string): void; @@ -1829,34 +1911,6 @@ declare namespace ts { increaseIndent(): void; decreaseIndent(): void; clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - reportInaccessibleThisError(): void; - reportPrivateInBaseOfClassExpression(propertyName: string): void; - reportInaccessibleUniqueSymbolError(): void; - } - enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 4, - NoTruncation = 8, - WriteArrowStyleSignature = 16, - WriteOwnNameForAnyLike = 32, - WriteTypeArgumentsOfSignature = 64, - InElementType = 128, - UseFullyQualifiedType = 256, - InFirstTypeArgument = 512, - InTypeAlias = 1024, - SuppressAnyReturnType = 4096, - AddUndefined = 8192, - WriteClassExpressionAsTypeLiteral = 16384, - InArrayType = 32768, - UseAliasDefinedOutsideCurrentScope = 65536, - AllowUniqueESSymbolType = 131072, - } - enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, } enum TypePredicateKind { This = 0, @@ -2017,8 +2071,9 @@ declare namespace ts { Intersection = 262144, Index = 524288, IndexedAccess = 1048576, - NonPrimitive = 33554432, - MarkerType = 134217728, + Conditional = 2097152, + Substitution = 4194304, + NonPrimitive = 134217728, Literal = 224, Unit = 13536, StringOrNumberLiteral = 96, @@ -2030,10 +2085,13 @@ declare namespace ts { ESSymbolLike = 1536, UnionOrIntersection = 393216, StructuredType = 458752, - StructuredOrTypeVariable = 2064384, TypeVariable = 1081344, - Narrowable = 35620607, - NotUnionOrUnit = 33620481, + InstantiableNonPrimitive = 7372800, + InstantiablePrimitive = 524288, + Instantiable = 7897088, + StructuredOrInstantiable = 8355840, + Narrowable = 142575359, + NotUnionOrUnit = 134283777, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { @@ -2071,6 +2129,9 @@ declare namespace ts { EvolvingArray = 256, ObjectLiteralPatternWithComputedProperties = 512, ContainsSpread = 1024, + ReverseMapped = 2048, + JsxAttributes = 4096, + MarkerType = 8192, ClassOrInterface = 3, } interface ObjectType extends Type { @@ -2119,17 +2180,27 @@ declare namespace ts { elementType: Type; finalArrayType?: Type; } - interface TypeVariable extends Type { + interface InstantiableType extends Type { } - interface TypeParameter extends TypeVariable { + interface TypeParameter extends InstantiableType { } - interface IndexedAccessType extends TypeVariable { + interface IndexedAccessType extends InstantiableType { objectType: Type; indexType: Type; constraint?: Type; } - interface IndexType extends Type { - type: TypeVariable | UnionOrIntersectionType; + interface IndexType extends InstantiableType { + type: InstantiableType | UnionOrIntersectionType; + } + interface ConditionalType extends InstantiableType { + checkType: Type; + extendsType: Type; + trueType: Type; + falseType: Type; + } + interface SubstitutionType extends InstantiableType { + typeParameter: TypeParameter; + substitute: Type; } enum SignatureKind { Call = 0, @@ -2150,21 +2221,23 @@ declare namespace ts { declaration?: SignatureDeclaration; } enum InferencePriority { - Contravariant = 1, - NakedTypeVariable = 2, - MappedType = 4, - ReturnType = 8, - NeverType = 16, + NakedTypeVariable = 1, + MappedType = 2, + ReturnType = 4, + NoConstraints = 8, + AlwaysStrict = 16, } interface InferenceInfo { typeParameter: TypeParameter; candidates: Type[]; + contraCandidates: Type[]; inferredType: Type; priority: InferencePriority; topLevel: boolean; isFixed: boolean; } enum InferenceFlags { + None = 0, InferUnionTypes = 1, NoDefault = 2, AnyDefault = 4, @@ -2239,6 +2312,7 @@ declare namespace ts { charset?: string; checkJs?: boolean; declaration?: boolean; + emitDeclarationOnly?: boolean; declarationDir?: string; disableSizeLimit?: boolean; downlevelIteration?: boolean; @@ -2299,6 +2373,7 @@ declare namespace ts { types?: string[]; /** Paths used to compute primary types search locations */ typeRoots?: string[]; + esModuleInterop?: boolean; [option: string]: CompilerOptionsValue | JsonSourceFile | undefined; } interface TypeAcquisition { @@ -2308,15 +2383,6 @@ declare namespace ts { exclude?: string[]; [option: string]: string[] | boolean | undefined; } - interface DiscoverTypingsInfo { - fileNames: string[]; - projectRootPath: string; - safeListPath: string; - packageNameToTypingLocation: Map; - typeAcquisition: TypeAcquisition; - compilerOptions: CompilerOptions; - unresolvedImports: ReadonlyArray; - } enum ModuleKind { None = 0, CommonJS = 1, @@ -2472,12 +2538,13 @@ declare namespace ts { getCanonicalFileName(fileName: string): string; useCaseSensitiveFileNames(): boolean; getNewLine(): string; - resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; + resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): (ResolvedModule | undefined)[]; /** * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files */ - resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; + resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): (ResolvedTypeReferenceDirective | undefined)[]; getEnvironmentVariable?(name: string): string; + createHash?(data: string): string; } interface SourceMapRange extends TextRange { source?: SourceMapSource; @@ -2634,6 +2701,10 @@ declare namespace ts { * collisions. */ printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; + /** + * Prints a list of nodes using the given format flags + */ + printList(format: ListFormat, list: NodeArray, sourceFile: SourceFile): string; /** * Prints a source file as-is, without any emit transformations. */ @@ -2689,6 +2760,13 @@ declare namespace ts { interface PrinterOptions { removeComments?: boolean; newLine?: NewLineKind; + omitTrailingSemicolon?: boolean; + } + interface SymbolTracker { + trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; + reportInaccessibleThisError?(): void; + reportPrivateInBaseOfClassExpression?(propertyName: string): void; + reportInaccessibleUniqueSymbolError?(): void; } interface TextSpan { start: number; @@ -2698,17 +2776,86 @@ declare namespace ts { span: TextSpan; newLength: number; } + interface SortedArray extends Array { + " __sortedArrayBrand": any; + } interface SyntaxList extends Node { _children: Node[]; } + enum ListFormat { + None = 0, + SingleLine = 0, + MultiLine = 1, + PreserveLines = 2, + LinesMask = 3, + NotDelimited = 0, + BarDelimited = 4, + AmpersandDelimited = 8, + CommaDelimited = 16, + DelimitersMask = 28, + AllowTrailingComma = 32, + Indented = 64, + SpaceBetweenBraces = 128, + SpaceBetweenSiblings = 256, + Braces = 512, + Parenthesis = 1024, + AngleBrackets = 2048, + SquareBrackets = 4096, + BracketsMask = 7680, + OptionalIfUndefined = 8192, + OptionalIfEmpty = 16384, + Optional = 24576, + PreferNewLine = 32768, + NoTrailingNewLine = 65536, + NoInterveningComments = 131072, + NoSpaceIfEmpty = 262144, + SingleElement = 524288, + Modifiers = 131328, + HeritageClauses = 256, + SingleLineTypeLiteralMembers = 448, + MultiLineTypeLiteralMembers = 65, + TupleTypeElements = 336, + UnionTypeConstituents = 260, + IntersectionTypeConstituents = 264, + ObjectBindingPatternElements = 262576, + ArrayBindingPatternElements = 262448, + ObjectLiteralExpressionProperties = 263122, + ArrayLiteralExpressionElements = 4466, + CommaListElements = 272, + CallExpressionArguments = 1296, + NewExpressionArguments = 9488, + TemplateExpressionSpans = 131072, + SingleLineBlockStatements = 384, + MultiLineBlockStatements = 65, + VariableDeclarationList = 272, + SingleLineFunctionBodyStatements = 384, + MultiLineFunctionBodyStatements = 1, + ClassHeritageClauses = 256, + ClassMembers = 65, + InterfaceMembers = 65, + EnumMembers = 81, + CaseBlockClauses = 65, + NamedImportsOrExportsElements = 432, + JsxElementOrFragmentChildren = 131072, + JsxElementAttributes = 131328, + CaseOrDefaultClauseStatements = 81985, + HeritageClauseTypes = 272, + SourceFileStatements = 65537, + Decorators = 24577, + TypeArguments = 26896, + TypeParameters = 26896, + Parameters = 1296, + IndexSignatureParameters = 4432, + } } declare namespace ts { - const versionMajorMinor = "2.7"; + const versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ const version: string; } declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; + function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): Diagnostic[]; } declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; declare function clearTimeout(handle: any): void; @@ -2725,26 +2872,14 @@ declare namespace ts { callback: FileWatcherCallback; mtime?: Date; } - /** - * Partial interface of the System thats needed to support the caching of directory structure - */ - interface DirectoryStructureHost { + interface System { + args: string[]; newLine: string; useCaseSensitiveFileNames: boolean; write(s: string): void; readFile(path: string, encoding?: string): string | undefined; - writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; - fileExists(path: string): boolean; - directoryExists(path: string): boolean; - createDirectory(path: string): void; - getCurrentDirectory(): string; - getDirectories(path: string): string[]; - readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; - exit(exitCode?: number): void; - } - interface System extends DirectoryStructureHost { - args: string[]; getFileSize?(path: string): number; + writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; /** * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that * use native OS file watching @@ -2752,7 +2887,13 @@ declare namespace ts { watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; resolvePath(path: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + createDirectory(path: string): void; getExecutingFilePath(): string; + getCurrentDirectory(): string; + getDirectories(path: string): string[]; + readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; getModifiedTime?(path: string): Date; /** * This should be cryptographically secure. @@ -2760,9 +2901,11 @@ declare namespace ts { */ createHash?(data: string): string; getMemoryUsage?(): number; + exit(exitCode?: number): void; realpath?(path: string): string; setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; clearTimeout?(timeoutId: any): void; + clearScreen?(): void; } interface FileWatcher { close(): void; @@ -2915,7 +3058,7 @@ declare namespace ts { function isStringLiteral(node: Node): node is StringLiteral; function isJsxText(node: Node): node is JsxText; function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral; - function isNoSubstitutionTemplateLiteral(node: Node): node is LiteralExpression; + function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral; function isTemplateHead(node: Node): node is TemplateHead; function isTemplateMiddle(node: Node): node is TemplateMiddle; function isTemplateTail(node: Node): node is TemplateTail; @@ -2945,6 +3088,8 @@ declare namespace ts { function isTupleTypeNode(node: Node): node is TupleTypeNode; function isUnionTypeNode(node: Node): node is UnionTypeNode; function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode; + function isConditionalTypeNode(node: Node): node is ConditionalTypeNode; + function isInferTypeNode(node: Node): node is InferTypeNode; function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode; function isThisTypeNode(node: Node): node is ThisTypeNode; function isTypeOperatorNode(node: Node): node is TypeOperatorNode; @@ -3073,6 +3218,7 @@ declare namespace ts { /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n: Node): boolean; function isLiteralExpression(node: Node): node is LiteralExpression; @@ -3107,6 +3253,8 @@ declare namespace ts { function isJSDocCommentContainingNode(node: Node): boolean; function isSetAccessor(node: Node): node is SetAccessorDeclaration; function isGetAccessor(node: Node): node is GetAccessorDeclaration; + function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; + function isStringLiteralLike(node: Node): node is StringLiteralLike; } declare namespace ts { type ErrorCallback = (message: DiagnosticMessage, length: number) => void; @@ -3129,7 +3277,7 @@ declare namespace ts { scanJsxAttributeValue(): SyntaxKind; reScanJsxToken(): SyntaxKind; scanJsxToken(): SyntaxKind; - scanJSDocToken(): SyntaxKind; + scanJSDocToken(): JsDocSyntaxKind; scan(): SyntaxKind; getText(): string; setText(text: string, start?: number, length?: number): void; @@ -3149,8 +3297,10 @@ declare namespace ts { function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; - function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; @@ -3288,13 +3438,13 @@ declare namespace ts { declare namespace ts { function createNodeArray(elements?: ReadonlyArray, hasTrailingComma?: boolean): NodeArray; /** If a node is passed, creates a string literal whose source text is read from a source node during emit. */ - function createLiteral(value: string | StringLiteral | NumericLiteral | Identifier): StringLiteral; + function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; function createLiteral(value: number): NumericLiteral; function createLiteral(value: boolean): BooleanLiteral; function createLiteral(value: string | number | boolean): PrimaryExpression; function createNumericLiteral(value: string): NumericLiteral; function createIdentifier(text: string): Identifier; - function updateIdentifier(node: Identifier, typeArguments: NodeArray | undefined): Identifier; + function updateIdentifier(node: Identifier): Identifier; /** Create a unique temporary variable. */ function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; /** Create a unique temporary variable for use in a loop. */ @@ -3321,8 +3471,8 @@ declare namespace ts { function updateDecorator(node: Decorator, expression: Expression): Decorator; function createPropertySignature(modifiers: ReadonlyArray | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; function updatePropertySignature(node: PropertySignature, modifiers: ReadonlyArray | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; - function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; function createMethodSignature(typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function createMethod(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; @@ -3361,6 +3511,10 @@ declare namespace ts { function createIntersectionTypeNode(types: TypeNode[]): IntersectionTypeNode; function updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray): IntersectionTypeNode; function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray): UnionOrIntersectionTypeNode; + function createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; + function updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; function createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; @@ -3369,8 +3523,8 @@ declare namespace ts { function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; @@ -3763,18 +3917,7 @@ declare namespace ts { function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; } declare namespace ts { - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } -} -declare namespace ts { - function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; + function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined; function resolveTripleslashReference(moduleName: string, containingFile: string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -3924,6 +4067,7 @@ declare namespace ts { useCaseSensitiveFileNames?(): boolean; readDirectory?(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; readFile?(path: string, encoding?: string): string | undefined; + realpath?(path: string): string; fileExists?(path: string): boolean; getTypeRootsVersion?(): number; resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; @@ -3982,7 +4126,8 @@ declare namespace ts { getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan; - getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray, formatOptions: FormatCodeSettings): ReadonlyArray; + getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings): CombinedCodeActions; applyCodeActionCommand(action: CodeActionCommand): Promise; applyCodeActionCommand(action: CodeActionCommand[]): Promise; applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[]): Promise; @@ -3994,12 +4139,19 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; + organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; } + interface CombinedCodeFixScope { + type: "file"; + fileName: string; + } + type OrganizeImportsScope = CombinedCodeFixScope; interface GetCompletionsAtPositionOptions { includeExternalModuleExports: boolean; + includeInsertTextCompletions: boolean; } interface ApplyCodeActionCommandResult { successMessage: string; @@ -4074,6 +4226,17 @@ declare namespace ts { */ commands?: CodeActionCommand[]; } + interface CodeFixAction extends CodeAction { + /** + * If present, one may call 'getCombinedCodeFix' with this fixId. + * This may be omitted to indicate that the code fix can't be applied in a group. + */ + fixId?: {}; + } + interface CombinedCodeActions { + changes: ReadonlyArray; + commands: ReadonlyArray | undefined; + } type CodeActionCommand = InstallPackageAction; interface InstallPackageAction { } @@ -4210,6 +4373,7 @@ declare namespace ts { InsertSpaceBeforeFunctionParenthesis?: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface FormatCodeSettings extends EditorSettings { insertSpaceAfterCommaDelimiter?: boolean; @@ -4227,6 +4391,7 @@ declare namespace ts { insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface DefinitionInfo { fileName: string; @@ -4329,6 +4494,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** @@ -4342,6 +4508,7 @@ declare namespace ts { kind: ScriptElementKind; kindModifiers: string; sortText: string; + insertText?: string; /** * An optional span that indicates the text to be replaced by this completion item. * If present, this span should be used instead of the default one. @@ -4508,6 +4675,7 @@ declare namespace ts { ambientModifier = "declare", staticModifier = "static", abstractModifier = "abstract", + optionalModifier = "optional", } enum ClassificationTypeNames { comment = "comment", @@ -4653,9 +4821,6 @@ declare namespace ts { declare namespace ts { /** The version of the language service API */ const servicesVersion = "0.7"; - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings; function displayPartsToString(displayParts: SymbolDisplayPart[]): string; function getDefaultCompilerOptions(): CompilerOptions; @@ -4688,6 +4853,8 @@ declare namespace ts.server { }; }; interface ServerHost extends System { + watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; + watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; clearTimeout(timeoutId: any): void; setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; @@ -4696,9 +4863,6 @@ declare namespace ts.server { trace?(s: string): void; require?(initialPath: string, moduleName: string): RequireResult; } - interface SortedArray extends Array { - " __sortedArrayBrand": any; - } interface SortedReadonlyArray extends ReadonlyArray { " __sortedArrayBrand": any; } @@ -4903,6 +5067,7 @@ declare namespace ts.server.protocol { Rename = "rename", Saveto = "saveto", SignatureHelp = "signatureHelp", + Status = "status", TypeDefinition = "typeDefinition", ProjectInfo = "projectInfo", ReloadProjects = "reloadProjects", @@ -4915,10 +5080,12 @@ declare namespace ts.server.protocol { DocCommentTemplate = "docCommentTemplate", CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", GetCodeFixes = "getCodeFixes", + GetCombinedCodeFix = "getCombinedCodeFix", ApplyCodeActionCommand = "applyCodeActionCommand", GetSupportedCodeFixes = "getSupportedCodeFixes", GetApplicableRefactors = "getApplicableRefactors", GetEditsForRefactor = "getEditsForRefactor", + OrganizeImports = "organizeImports", } /** * A TypeScript Server message @@ -5004,6 +5171,21 @@ declare namespace ts.server.protocol { file: string; projectFileName?: string; } + interface StatusRequest extends Request { + command: CommandTypes.Status; + } + interface StatusResponseBody { + /** + * The TypeScript version (`ts.version`). + */ + version: string; + } + /** + * Response to StatusRequest + */ + interface StatusResponse extends Response { + body: StatusResponseBody; + } /** * Requests a JS Doc comment template for a given position */ @@ -5255,6 +5437,23 @@ declare namespace ts.server.protocol { renameLocation?: Location; renameFilename?: string; } + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ + interface OrganizeImportsRequest extends Request { + command: CommandTypes.OrganizeImports; + arguments: OrganizeImportsRequestArgs; + } + type OrganizeImportsScope = GetCombinedCodeFixScope; + interface OrganizeImportsRequestArgs { + scope: OrganizeImportsScope; + } + interface OrganizeImportsResponse extends Response { + edits: ReadonlyArray; + } /** * Request for the available codefixes at a specific position. */ @@ -5262,6 +5461,13 @@ declare namespace ts.server.protocol { command: CommandTypes.GetCodeFixes; arguments: CodeFixRequestArgs; } + interface GetCombinedCodeFixRequest extends Request { + command: CommandTypes.GetCombinedCodeFix; + arguments: GetCombinedCodeFixRequestArgs; + } + interface GetCombinedCodeFixResponse extends Response { + body: CombinedCodeActions; + } interface ApplyCodeActionCommandRequest extends Request { command: CommandTypes.ApplyCodeActionCommand; arguments: ApplyCodeActionCommandRequestArgs; @@ -5293,7 +5499,15 @@ declare namespace ts.server.protocol { /** * Errorcodes we want to get the fixes for. */ - errorCodes?: number[]; + errorCodes?: ReadonlyArray; + } + interface GetCombinedCodeFixRequestArgs { + scope: GetCombinedCodeFixScope; + fixId: {}; + } + interface GetCombinedCodeFixScope { + type: "file"; + args: FileRequestArgs; } interface ApplyCodeActionCommandRequestArgs { /** May also be an array of commands. */ @@ -6037,7 +6251,7 @@ declare namespace ts.server.protocol { } interface CodeFixResponse extends Response { /** The code actions that are available */ - body?: CodeAction[]; + body?: CodeFixAction[]; } interface CodeAction { /** Description of the code action to display in the UI of the editor */ @@ -6047,6 +6261,17 @@ declare namespace ts.server.protocol { /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */ commands?: {}[]; } + interface CombinedCodeActions { + changes: ReadonlyArray; + commands?: ReadonlyArray<{}>; + } + interface CodeFixAction extends CodeAction { + /** + * If present, one may call 'getCombinedCodeFix' with this fixId. + * This may be omitted to indicate that the code fix can't be applied in a group. + */ + fixId?: {}; + } /** * Format and format on key response message. */ @@ -6088,6 +6313,11 @@ declare namespace ts.server.protocol { * This affects lone identifier completions but not completions on the right hand side of `obj.`. */ includeExternalModuleExports: boolean; + /** + * If enabled, the completion list will include completions with invalid identifier names. + * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`. + */ + includeInsertTextCompletions: boolean; } /** * Completions request; value of command field is "completions". @@ -6156,6 +6386,12 @@ declare namespace ts.server.protocol { * is often the same as the name but may be different in certain circumstances. */ sortText: string; + /** + * Text to insert instead of `name`. + * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`, + * coupled with `replacementSpan` to replace a dotted access with a bracket access. + */ + insertText?: string; /** * An optional span that indicates the text to be replaced by this completion item. * If present, this span should be used instead of the default one. @@ -6829,6 +7065,7 @@ declare namespace ts.server.protocol { insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface CompilerOptions { allowJs?: boolean; @@ -7070,11 +7307,14 @@ declare namespace ts.server { private extractPositionAndRange(args, scriptInfo); private getApplicableRefactors(args); private getEditsForRefactor(args, simplifiedResult); + private organizeImports({scope}, simplifiedResult); private getCodeFixes(args, simplifiedResult); - private applyCodeActionCommand(commandName, requestSeq, args); + private getCombinedCodeFix({scope, fixId}, simplifiedResult); + private applyCodeActionCommand(args); private getStartAndEndPosition(args, scriptInfo); - private mapCodeAction({description, changes: unmappedChanges, commands}, scriptInfo); + private mapCodeAction(project, {description, changes: unmappedChanges, commands, fixId}); private mapTextChangesToCodeEdits(project, textChanges); + private mapTextChangesToCodeEditsUsingScriptinfo(textChanges, scriptInfo); private convertTextChangeToCodeEdit(change, scriptInfo); private getBraceMatching(args, simplifiedResult); private getDiagnosticsForProject(next, delay, fileName); @@ -7113,6 +7353,7 @@ declare namespace ts.server { open(newText: string): void; close(fileExists?: boolean): void; getSnapshot(): IScriptSnapshot; + private ensureRealPath(); getFormatCodeSettings(): FormatCodeSettings; attachToProject(project: Project): boolean; isAttached(project: Project): boolean; @@ -7166,6 +7407,17 @@ declare namespace ts.server { onProjectClosed(project: Project): void; } } +declare namespace ts { + interface EmitOutput { + outputFiles: OutputFile[]; + emitSkipped: boolean; + } + interface OutputFile { + name: string; + writeByteOrderMark: boolean; + text: string; + } +} declare namespace ts.server { enum ProjectKind { Inferred = 0, @@ -7209,19 +7461,20 @@ declare namespace ts.server { private documentRegistry; private compilerOptions; compileOnSaveEnabled: boolean; - directoryStructureHost: DirectoryStructureHost; private rootFiles; private rootFilesMap; private program; private externalFiles; private missingFilesMap; + private plugins; private cachedUnresolvedImportsPerFile; private lastCachedUnresolvedImportsList; + private lastFileExceededProgramSize; protected languageService: LanguageService; languageServiceEnabled: boolean; readonly trace?: (s: string) => void; readonly realpath?: (path: string) => string; - private builder; + private builderState; /** * Set of files names that were updated since the last call to getChangesSinceVersion. */ @@ -7275,6 +7528,8 @@ declare namespace ts.server { resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; directoryExists(path: string): boolean; getDirectories(path: string): string[]; + log(s: string): void; + error(s: string): void; private setInternalCompilerOptionsForEmittingJsFiles(); /** * Get the errors that dont have any file name associated @@ -7282,7 +7537,6 @@ declare namespace ts.server { getGlobalProjectErrors(): ReadonlyArray; getAllProjectErrors(): ReadonlyArray; getLanguageService(ensureSynchronized?: boolean): LanguageService; - private ensureBuilder(); private shouldEmitFile(scriptInfo); getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; /** @@ -7290,9 +7544,10 @@ declare namespace ts.server { */ emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): boolean; enableLanguageService(): void; - disableLanguageService(): void; + disableLanguageService(lastFileExceededProgramSize?: string): void; getProjectName(): string; abstract getTypeAcquisition(): TypeAcquisition; + protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition; getExternalFiles(): SortedReadonlyArray; getSourceFile(path: Path): SourceFile; close(): void; @@ -7313,13 +7568,12 @@ declare namespace ts.server { removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void; registerFileUpdate(fileName: string): void; markAsDirty(): void; - private extractUnresolvedImportsFromSourceFile(file, result); /** * Updates set of files that contribute to this project * @returns: true if set of files in the project stays the same and false - otherwise. */ updateGraph(): boolean; - private setTypings(typings); + protected removeExistingTypings(include: string[]): string[]; private updateGraphWorker(); private detachScriptInfoFromProject(uncheckedFileName); private addMissingFileWatcher(missingFilePath); @@ -7329,6 +7583,9 @@ declare namespace ts.server { filesToString(writeProjectFileNames: boolean): string; setCompilerOptions(compilerOptions: CompilerOptions): void; protected removeRoot(info: ScriptInfo): void; + protected enableGlobalPlugins(): void; + protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void; + private enableProxy(pluginModuleFactory, configEntry); } /** * If a file is opened and no tsconfig (or jsconfig) is found, @@ -7357,7 +7614,6 @@ declare namespace ts.server { private typeAcquisition; private directoriesWatchedForWildcards; readonly canonicalConfigFilePath: NormalizedPath; - private plugins; /** Ref count to the project when opened from external project */ private externalProjectRefCount; private projectErrors; @@ -7368,8 +7624,6 @@ declare namespace ts.server { updateGraph(): boolean; getConfigFilePath(): NormalizedPath; enablePlugins(): void; - private enablePlugin(pluginConfigEntry, searchPaths); - private enableProxy(pluginModuleFactory, configEntry); /** * Get the errors that dont have any file name associated */ @@ -7381,7 +7635,6 @@ declare namespace ts.server { setProjectErrors(projectErrors: Diagnostic[]): void; setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; getTypeAcquisition(): TypeAcquisition; - getExternalFiles(): SortedReadonlyArray; close(): void; getEffectiveTypeRoots(): string[]; } @@ -7484,10 +7737,6 @@ declare namespace ts.server { function convertCompilerOptions(protocolOptions: protocol.ExternalProjectCompilerOptions): CompilerOptions & protocol.CompileOnSaveMixin; function tryConvertScriptKindName(scriptKindName: protocol.ScriptKindName | ScriptKind): ScriptKind; function convertScriptKindName(scriptKindName: protocol.ScriptKindName): ScriptKind.Unknown | ScriptKind.JS | ScriptKind.JSX | ScriptKind.TS | ScriptKind.TSX; - /** - * This helper function processes a list of projects and return the concatenated, sortd and deduplicated output of processing each project. - */ - function combineProjectOutput(projects: ReadonlyArray, action: (project: Project) => ReadonlyArray, comparer?: (a: T, b: T) => number, areEqual?: (a: T, b: T) => boolean): T[]; interface HostConfiguration { formatCodeOptions: FormatCodeSettings; hostInfo: string; @@ -7560,9 +7809,7 @@ declare namespace ts.server { private readonly hostConfiguration; private safelist; private legacySafelist; - private changedFiles; private pendingProjectUpdates; - private pendingInferredProjectUpdate; readonly currentDirectory: string; readonly toCanonicalFileName: (f: string) => string; readonly host: ServerHost; @@ -7584,7 +7831,7 @@ declare namespace ts.server { toPath(fileName: string): Path; private loadTypesMap(); updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void; - private delayInferredProjectsRefresh(); + private delayEnsureProjectForOpenFiles(); private delayUpdateProjectGraph(project); private sendProjectsUpdatedInBackgroundEvent(); private delayUpdateProjectGraphs(projects); @@ -7595,18 +7842,13 @@ declare namespace ts.server { /** * Ensures the project structures are upto date * This means, - * - if there are changedFiles (the files were updated but their containing project graph was not upto date), - * their project graph is updated - * - If there are pendingProjectUpdates (scheduled to be updated with delay so they can batch update the graph if there are several changes in short time span) - * their project graph is updated - * - If there were project graph updates and/or there was pending inferred project update and/or called forced the inferred project structure refresh - * Inferred projects are created/updated/deleted based on open files states - * @param forceInferredProjectsRefresh when true updates the inferred projects even if there is no pending work to update the files/project structures + * - we go through all the projects and update them if they are dirty + * - if updates reflect some change in structure or there was pending request to ensure projects for open files + * ensure that each open script info has project */ - private ensureProjectStructuresUptoDate(forceInferredProjectsRefresh?); - private findContainingExternalProject(fileName); + private ensureProjectStructuresUptoDate(); + private updateProjectIfDirty(project); getFormatCodeOptions(file?: NormalizedPath): FormatCodeSettings; - private updateProjectGraphs(projects); private onSourceFileChanged(fileName, eventKind); private handleDeletedFile(info); private onConfigChangedForConfiguredProject(project, eventKind); @@ -7623,6 +7865,7 @@ declare namespace ts.server { */ private closeOpenFile(info); private deleteOrphanScriptInfoNotInAnyProject(); + private deleteScriptInfo(info); private configFileExists(configFileName, canonicalConfigFilePath, info); private setConfigFileExistenceByNewConfiguredProject(project); /** @@ -7667,7 +7910,8 @@ declare namespace ts.server { private getConfiguredProjectByCanonicalConfigFilePath(canonicalConfigFilePath); private findExternalProjectByProjectName(projectFileName); private convertConfigFileContentToProjectOptions(configFilename, cachedDirectoryStructureHost); - private exceededTotalSizeLimitForNonTsFiles(name, options, fileNames, propertyReader); + /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */ + private getFilenameForExceededTotalSizeLimitForNonTsFiles(name, options, fileNames, propertyReader); private createExternalProject(projectFileName, files, options, typeAcquisition, excludedFiles); private sendProjectTelemetry(projectKey, project, projectOptions?); private addFilesToNonInferredProjectAndUpdateGraph(project, files, propertyReader, typeAcquisition); @@ -7681,7 +7925,9 @@ declare namespace ts.server { getScriptInfo(uncheckedFileName: string): ScriptInfo; private watchClosedScriptInfo(info); private stopWatchingScriptInfo(info); - getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: DirectoryStructureHost): ScriptInfo; + getOrCreateScriptInfoForNormalizedPath(fileName: NormalizedPath, openedByClient: boolean, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, hostToQueryFileExistsOn?: { + fileExists(path: string): boolean; + }): ScriptInfo; private getOrCreateScriptInfoWorker(fileName, currentDirectory, openedByClient, fileContent?, scriptKind?, hasMixedContent?, hostToQueryFileExistsOn?); /** * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred @@ -7715,13 +7961,14 @@ declare namespace ts.server { * This will go through open files and assign them to inferred project if open file is not part of any other project * After that all the inferred project graphs are updated */ - private refreshInferredProjects(); + private ensureProjectForOpenFiles(); /** * Open file whose contents is managed by the client * @param filename is absolute pathname * @param fileContent is a known version of the file content that is more up to date than the one on disk */ openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult; + private findExternalProjetContainingOpenScriptInfo(info); openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult; /** * Close file whose contents is managed by the client @@ -7730,14 +7977,14 @@ declare namespace ts.server { closeClientFile(uncheckedFileName: string): void; private collectChanges(lastKnownProjectVersions, currentProjects, result); private closeConfiguredProjectReferencedFromExternalProject(configFile); - closeExternalProject(uncheckedFileName: string, suppressRefresh?: boolean): void; + closeExternalProject(uncheckedFileName: string): void; openExternalProjects(projects: protocol.ExternalProject[]): void; /** Makes a filename safe to insert in a RegExp */ private static readonly filenameEscapeRegexp; private static escapeFilenameForRegex(filename); resetSafeList(): void; applySafeList(proj: protocol.ExternalProject): NormalizedPath[]; - openExternalProject(proj: protocol.ExternalProject, suppressRefreshOfInferredProjects?: boolean): void; + openExternalProject(proj: protocol.ExternalProject): void; } } diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index a65ef12d200..a75f0454587 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -182,198 +182,201 @@ var ts; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 140] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 141] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 142] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 143] = "OfKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 126] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 127] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 128] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 129] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 130] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 131] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 132] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 133] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 134] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 135] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 136] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 137] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 138] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 142] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 143] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 144] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 144] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 145] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 145] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 146] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 146] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 147] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 148] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 147] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 148] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 149] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 149] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 150] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 151] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 152] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 153] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 154] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 155] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 156] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 157] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 158] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 150] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 151] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 152] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 153] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 154] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 155] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 156] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 157] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 158] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 159] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 159] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 160] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 161] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 162] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 163] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 164] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 165] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 166] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 167] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 168] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 169] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 170] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 171] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 172] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 173] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 174] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 160] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 161] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 162] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 163] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 164] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 165] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 166] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 167] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 168] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 169] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 170] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 171] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 172] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 173] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 174] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 175] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 176] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 177] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 175] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 176] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 177] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 178] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 179] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 180] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 180] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 181] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 182] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 183] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 184] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 185] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 186] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 187] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 188] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 189] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 190] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 191] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 192] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 193] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 194] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 195] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 196] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 197] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 198] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 199] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 200] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 201] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 202] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 203] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 204] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 205] = "MetaProperty"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 181] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 182] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 183] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 184] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 185] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 186] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 187] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 188] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 189] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 190] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 191] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 192] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 193] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 194] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 195] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 196] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 197] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 198] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 199] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 200] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 201] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 202] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 203] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 204] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 205] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 206] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 207] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 208] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 206] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 207] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 209] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 210] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 208] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 209] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 210] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 211] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 212] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 213] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 214] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 215] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 216] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 217] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 218] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 219] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 220] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 221] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 222] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 223] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 224] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 225] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 226] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 227] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 228] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 229] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 230] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 231] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 232] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 233] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 234] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 235] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 236] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 237] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 238] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 239] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 240] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 241] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 242] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 243] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 244] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 245] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 246] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 247] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 248] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 211] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 212] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 213] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 214] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 215] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 216] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 217] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 218] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 219] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 220] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 221] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 222] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 223] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 224] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 225] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 226] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 227] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 228] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 229] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 230] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 231] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 232] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 233] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 234] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 235] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 236] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 237] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 238] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 239] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 240] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 241] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 242] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 243] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 244] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 245] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 246] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 247] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 248] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 249] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 250] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 251] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 249] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 252] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 250] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 251] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 252] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 253] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 254] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 255] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 256] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 257] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 258] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 259] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 260] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 253] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 254] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 255] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 256] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 257] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 258] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 259] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 260] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 261] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 262] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 263] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 261] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 262] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 263] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 264] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 264] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 265] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 266] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 267] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 265] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 266] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 267] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 268] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 269] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 270] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 268] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 271] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 269] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 270] = "Bundle"; + SyntaxKind[SyntaxKind["SourceFile"] = 272] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 273] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 271] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 274] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 272] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 275] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 273] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 274] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 275] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 276] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 277] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 278] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 279] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 280] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocTag"] = 281] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 282] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 283] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 284] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 285] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 286] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 287] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 288] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 289] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 276] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 277] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 278] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 279] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 280] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 281] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 283] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocTag"] = 284] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 285] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 286] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 287] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 288] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 289] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 290] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 291] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 292] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 290] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 291] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 292] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 293] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 294] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 295] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 296] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 297] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 298] = "EndOfDeclarationMarker"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 296] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 299] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; @@ -382,15 +385,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 143] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 144] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 159] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 174] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 160] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 177] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 143] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 144] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -399,13 +402,13 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 144] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 271] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 289] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 281] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 289] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 145] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 274] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 284] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 143] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 144] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -489,14 +492,19 @@ var ts; RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); /*@internal*/ - var GeneratedIdentifierKind; - (function (GeneratedIdentifierKind) { - GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; - })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var GeneratedIdentifierFlags; + (function (GeneratedIdentifierFlags) { + // Kinds + GeneratedIdentifierFlags[GeneratedIdentifierFlags["None"] = 0] = "None"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Auto"] = 1] = "Auto"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Loop"] = 2] = "Loop"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Unique"] = 3] = "Unique"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Node"] = 4] = "Node"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["KindMask"] = 7] = "KindMask"; + // Flags + GeneratedIdentifierFlags[GeneratedIdentifierFlags["SkipNameGenerationScope"] = 8] = "SkipNameGenerationScope"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 16] = "ReservedInNestedScopes"; + })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); /* @internal */ var TokenFlags; (function (TokenFlags) { @@ -510,8 +518,9 @@ var ts; TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; - TokenFlags[TokenFlags["NumericLiteralFlags"] = 496] = "NumericLiteralFlags"; + TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; })(TokenFlags = ts.TokenFlags || (ts.TokenFlags = {})); var FlowFlags; (function (FlowFlags) { @@ -556,47 +565,79 @@ var ts; // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + /* @internal */ + var UnionReduction; + (function (UnionReduction) { + UnionReduction[UnionReduction["None"] = 0] = "None"; + UnionReduction[UnionReduction["Literal"] = 1] = "Literal"; + UnionReduction[UnionReduction["Subtype"] = 2] = "Subtype"; + })(UnionReduction = ts.UnionReduction || (ts.UnionReduction = {})); var NodeBuilderFlags; (function (NodeBuilderFlags) { NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; // Options NodeBuilderFlags[NodeBuilderFlags["NoTruncation"] = 1] = "NoTruncation"; NodeBuilderFlags[NodeBuilderFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + // empty space + NodeBuilderFlags[NodeBuilderFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + // empty space NodeBuilderFlags[NodeBuilderFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; NodeBuilderFlags[NodeBuilderFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + NodeBuilderFlags[NodeBuilderFlags["UseOnlyExternalAliasing"] = 128] = "UseOnlyExternalAliasing"; NodeBuilderFlags[NodeBuilderFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; NodeBuilderFlags[NodeBuilderFlags["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + NodeBuilderFlags[NodeBuilderFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + NodeBuilderFlags[NodeBuilderFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + NodeBuilderFlags[NodeBuilderFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; // Error handling - NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 1024] = "AllowThisInObjectLiteral"; - NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 2048] = "AllowQualifedNameInPlaceOfIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 8192] = "AllowAnonymousIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 16384] = "AllowEmptyUnionOrIntersection"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 32768] = "AllowEmptyTuple"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 60416] = "IgnoreErrors"; + NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; + NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; // State - NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); + // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 8] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 16] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 32] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 64] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 128] = "InElementType"; - TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; - TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; - TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; - TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; - TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; - TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; - TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 1] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + // hole because there's a hole in node builder flags + TypeFormatFlags[TypeFormatFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + // hole because there's a hole in node builder flags + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + // hole because `UseOnlyExternalAliasing` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` instead + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + // hole because `WriteTypeParametersInQualifiedName` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` for this instead + TypeFormatFlags[TypeFormatFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; // even though `T` can't be accessed in the current scope. - TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 131072] = "AllowUniqueESSymbolType"; + // Error Handling + TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + // TypeFormatFlags exclusive + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 131072] = "AddUndefined"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 262144] = "WriteArrowStyleSignature"; + // State + TypeFormatFlags[TypeFormatFlags["InArrayType"] = 524288] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 2097152] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + /** @deprecated */ TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["NodeBuilderFlagsMask"] = 9469291] = "NodeBuilderFlagsMask"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -604,12 +645,16 @@ var ts; // Write symbols's type argument if it is instantiated symbol // eg. class C { p: T } <-- Show p as C.p here // var a: C; - // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p + // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; // Use only external alias information to get the symbol name in the given context // eg. module m { export class c { } } import x = m.c; // When this flag is specified m.c will be used to refer to the class instead of alias symbol x SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + // Build symbol name using any nodes needed, instead of just components of an entity name + SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind"; + // Prefer aliases which are not directly visible + SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope"; })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); /* @internal */ var SymbolAccessibility; @@ -745,6 +790,7 @@ var ts; CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; CheckFlags[CheckFlags["Late"] = 1024] = "Late"; + CheckFlags[CheckFlags["ReverseMapped"] = 2048] = "ReverseMapped"; CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); var InternalSymbolName; @@ -814,18 +860,19 @@ var ts; TypeFlags[TypeFlags["Intersection"] = 262144] = "Intersection"; TypeFlags[TypeFlags["Index"] = 524288] = "Index"; TypeFlags[TypeFlags["IndexedAccess"] = 1048576] = "IndexedAccess"; + TypeFlags[TypeFlags["Conditional"] = 2097152] = "Conditional"; + TypeFlags[TypeFlags["Substitution"] = 4194304] = "Substitution"; /* @internal */ - TypeFlags[TypeFlags["FreshLiteral"] = 2097152] = "FreshLiteral"; + TypeFlags[TypeFlags["FreshLiteral"] = 8388608] = "FreshLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsWideningType"] = 4194304] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsWideningType"] = 16777216] = "ContainsWideningType"; /* @internal */ - TypeFlags[TypeFlags["ContainsObjectLiteral"] = 8388608] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 33554432] = "ContainsObjectLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 16777216] = "ContainsAnyFunctionType"; - TypeFlags[TypeFlags["NonPrimitive"] = 33554432] = "NonPrimitive"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 67108864] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 134217728] = "NonPrimitive"; /* @internal */ - TypeFlags[TypeFlags["JsxAttributes"] = 67108864] = "JsxAttributes"; - TypeFlags[TypeFlags["MarkerType"] = 134217728] = "MarkerType"; + TypeFlags[TypeFlags["GenericMappedType"] = 536870912] = "GenericMappedType"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 12288] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; @@ -837,7 +884,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 14560] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 14574] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 33585807] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 134249103] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 16382] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 524322] = "StringLike"; @@ -847,16 +894,20 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 1536] = "ESSymbolLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 393216] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 458752] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 2064384] = "StructuredOrTypeVariable"; TypeFlags[TypeFlags["TypeVariable"] = 1081344] = "TypeVariable"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 7372800] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 524288] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 7897088] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 8355840] = "StructuredOrInstantiable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 35620607] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33620481] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 142575359] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 134283777] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 12582912] = "RequiresWidening"; + TypeFlags[TypeFlags["RequiresWidening"] = 50331648] = "RequiresWidening"; + /* @internal */ + TypeFlags[TypeFlags["PropagatingFlags"] = 117440512] = "PropagatingFlags"; /* @internal */ - TypeFlags[TypeFlags["PropagatingFlags"] = 29360128] = "PropagatingFlags"; })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); var ObjectFlags; (function (ObjectFlags) { @@ -871,6 +922,9 @@ var ts; ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; ObjectFlags[ObjectFlags["ContainsSpread"] = 1024] = "ContainsSpread"; + ObjectFlags[ObjectFlags["ReverseMapped"] = 2048] = "ReverseMapped"; + ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes"; + ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ @@ -894,14 +948,15 @@ var ts; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); var InferencePriority; (function (InferencePriority) { - InferencePriority[InferencePriority["Contravariant"] = 1] = "Contravariant"; - InferencePriority[InferencePriority["NakedTypeVariable"] = 2] = "NakedTypeVariable"; - InferencePriority[InferencePriority["MappedType"] = 4] = "MappedType"; - InferencePriority[InferencePriority["ReturnType"] = 8] = "ReturnType"; - InferencePriority[InferencePriority["NeverType"] = 16] = "NeverType"; + InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; + InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + InferencePriority[InferencePriority["NoConstraints"] = 8] = "NoConstraints"; + InferencePriority[InferencePriority["AlwaysStrict"] = 16] = "AlwaysStrict"; })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); var InferenceFlags; (function (InferenceFlags) { + InferenceFlags[InferenceFlags["None"] = 0] = "None"; InferenceFlags[InferenceFlags["InferUnionTypes"] = 1] = "InferUnionTypes"; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; @@ -1181,6 +1236,8 @@ var ts; TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; TransformFlags[TransformFlags["ContainsDynamicImport"] = 67108864] = "ContainsDynamicImport"; + TransformFlags[TransformFlags["Super"] = 134217728] = "Super"; + TransformFlags[TransformFlags["ContainsSuper"] = 268435456] = "ContainsSuper"; // Please leave this as 1 << 29. // It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system. // It is a good reminder of how much room we have left @@ -1198,20 +1255,22 @@ var ts; // Scope Exclusions // - Bitmasks that exclude flags from propagating out of a specific context // into the subtree flags of their container. - TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; - TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; - TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; - TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; - TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; - TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; - TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["OuterExpressionExcludes"] = 536872257] = "OuterExpressionExcludes"; + TransformFlags[TransformFlags["PropertyAccessExcludes"] = 671089985] = "PropertyAccessExcludes"; + TransformFlags[TransformFlags["NodeExcludes"] = 939525441] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 1003902273] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 1003935041] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 1003668801] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 1003668801] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 942011713] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 977327425] = "ModuleExcludes"; TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; - TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; - TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; - TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; - TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; - TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; - TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 942740801] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 940049729] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 948962625] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 939525441] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 940574017] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 940049729] = "BindingPatternExcludes"; // Masks // - Additional bitmasks TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; @@ -1248,6 +1307,7 @@ var ts; EmitFlags[EmitFlags["Iterator"] = 8388608] = "Iterator"; EmitFlags[EmitFlags["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; /*@internal*/ EmitFlags[EmitFlags["TypeScriptClassWrapper"] = 33554432] = "TypeScriptClassWrapper"; + /*@internal*/ EmitFlags[EmitFlags["NeverApplyImportHelper"] = 67108864] = "NeverApplyImportHelper"; })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); /** * Used by the checker, this enum keeps track of external emit helpers that should be type @@ -1294,6 +1354,78 @@ var ts; EmitHint[EmitHint["MappedTypeParameter"] = 3] = "MappedTypeParameter"; EmitHint[EmitHint["Unspecified"] = 4] = "Unspecified"; })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); + var ListFormat; + (function (ListFormat) { + ListFormat[ListFormat["None"] = 0] = "None"; + // Line separators + ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; + ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; + ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; + ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; + // Delimiters + ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; + ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; + ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; + ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; + // Whitespace + ListFormat[ListFormat["Indented"] = 64] = "Indented"; + ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; + ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; + // Brackets/Braces + ListFormat[ListFormat["Braces"] = 512] = "Braces"; + ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; + ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; + ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; + ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; + ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; + ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; + ListFormat[ListFormat["Optional"] = 24576] = "Optional"; + // Other + ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; + ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; + ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; + ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; + ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; + // Precomputed Formats + ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; + ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; + ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; + ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; + ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; + ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; + ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; + ListFormat[ListFormat["ObjectBindingPatternElements"] = 262576] = "ObjectBindingPatternElements"; + ListFormat[ListFormat["ArrayBindingPatternElements"] = 262448] = "ArrayBindingPatternElements"; + ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; + ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; + ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; + ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; + ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; + ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; + ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; + ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; + ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; + ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; + ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; + ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; + ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; + ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; + ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; + ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; + ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; + ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; + ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; + ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; + ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; + ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; + ListFormat[ListFormat["TypeArguments"] = 26896] = "TypeArguments"; + ListFormat[ListFormat["TypeParameters"] = 26896] = "TypeParameters"; + ListFormat[ListFormat["Parameters"] = 1296] = "Parameters"; + ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; + })(ListFormat = ts.ListFormat || (ts.ListFormat = {})); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1394,9 +1526,9 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "2.7"; + ts.versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".0"; + ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -1406,9 +1538,14 @@ var ts; return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); /* @internal */ (function (ts) { + ts.emptyArray = []; /** Create a MapLike with good performance. */ function createDictionaryObject() { var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword @@ -1552,6 +1689,9 @@ var ts; ts.forEach = forEach; /** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */ function firstDefined(array, callback) { + if (array === undefined) { + return undefined; + } for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result !== undefined) { @@ -1561,6 +1701,19 @@ var ts; return undefined; } ts.firstDefined = firstDefined; + function firstDefinedIterator(iter, callback) { + while (true) { + var _a = iter.next(), value = _a.value, done = _a.done; + if (done) { + return undefined; + } + var result = callback(value); + if (result !== undefined) { + return result; + } + } + } + ts.firstDefinedIterator = firstDefinedIterator; function findAncestor(node, callback) { while (node) { var result = callback(node); @@ -1577,13 +1730,27 @@ var ts; ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { var result = []; - Debug.assert(arrayA.length === arrayB.length); + Debug.assertEqual(arrayA.length, arrayB.length); for (var i = 0; i < arrayA.length; i++) { result.push(callback(arrayA[i], arrayB[i], i)); } return result; } ts.zipWith = zipWith; + function zipToIterator(arrayA, arrayB) { + Debug.assertEqual(arrayA.length, arrayB.length); + var i = 0; + return { + next: function () { + if (i === arrayA.length) { + return { value: undefined, done: true }; + } + i++; + return { value: [arrayA[i - 1], arrayB[i - 1]], done: false }; + } + }; + } + ts.zipToIterator = zipToIterator; function zipToMap(keys, values) { Debug.assert(keys.length === values.length); var map = createMap(); @@ -1666,17 +1833,11 @@ var ts; return false; } ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); } - ts.indexOf = indexOf; + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -1748,31 +1909,30 @@ var ts; } ts.map = map; function mapIterator(iter, mapFn) { - return { next: next }; - function next() { - var iterRes = iter.next(); - return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; - } + return { + next: function () { + var iterRes = iter.next(); + return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + } + }; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; /** @@ -1824,25 +1984,33 @@ var ts; return result; } ts.flatMap = flatMap; - function flatMapIter(iter, mapfn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapfn(value); - if (res) { - if (isArray(res)) { - result.push.apply(result, res); + function flatMapIterator(iter, mapfn) { + var first = iter.next(); + if (first.done) { + return ts.emptyIterator; + } + var currentIter = getIterator(first.value); + return { + next: function () { + while (true) { + var currentRes = currentIter.next(); + if (!currentRes.done) { + return currentRes; + } + var iterRes = iter.next(); + if (iterRes.done) { + return iterRes; + } + currentIter = getIterator(iterRes.value); } - else { - result.push(res); - } - } + }, + }; + function getIterator(x) { + var res = mapfn(x); + return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res; } - return result; } - ts.flatMapIter = flatMapIter; + ts.flatMapIterator = flatMapIterator; function sameFlatMap(array, mapfn) { var result; if (array) { @@ -1865,12 +2033,23 @@ var ts; return result || array; } ts.sameFlatMap = sameFlatMap; + function mapAllOrFail(array, mapFn) { + var result = []; + for (var i = 0; i < array.length; i++) { + var mapped = mapFn(array[i], i); + if (mapped === undefined) { + return undefined; + } + result.push(mapped); + } + return result; + } + ts.mapAllOrFail = mapAllOrFail; function mapDefined(array, mapFn) { var result = []; if (array) { for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); + var mapped = mapFn(array[i], i); if (mapped !== undefined) { result.push(mapped); } @@ -1879,20 +2058,35 @@ var ts; return result; } ts.mapDefined = mapDefined; - function mapDefinedIter(iter, mapFn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapFn(value); - if (res !== undefined) { - result.push(res); + function mapDefinedIterator(iter, mapFn) { + return { + next: function () { + while (true) { + var res = iter.next(); + if (res.done) { + return res; + } + var value = mapFn(res.value); + if (value !== undefined) { + return { value: value, done: false }; + } + } } - } - return result; + }; } - ts.mapDefinedIter = mapDefinedIter; + ts.mapDefinedIterator = mapDefinedIterator; + ts.emptyIterator = { next: function () { return ({ value: undefined, done: true }); } }; + function singleIterator(value) { + var done = false; + return { + next: function () { + var wasDone = done; + done = true; + return wasDone ? { value: undefined, done: true } : { value: value, done: false }; + } + }; + } + ts.singleIterator = singleIterator; /** * Computes the first matching span of elements and returns a tuple of the first span * and the remaining elements. @@ -2055,6 +2249,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -2158,7 +2363,7 @@ var ts; var result = 0; for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { var v = array_5[_i]; - // Note: we need the following type assertion because of GH #17069 + // TODO: Remove the following type assertion once the fix for #17069 is merged result += v[prop]; } return result; @@ -2625,6 +2830,15 @@ var ts; } } } + function group(values, getGroupId) { + var groupIdToGroup = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + groupIdToGroup.add(getGroupId(value), value); + } + return arrayFrom(groupIdToGroup.values()); + } + ts.group = group; /** * Tests whether a value is an array. */ @@ -2650,7 +2864,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; /** Does nothing. */ @@ -2665,6 +2884,9 @@ var ts; /** Returns its argument. */ function identity(x) { return x; } ts.identity = identity; + /** Returns lower case string */ + function toLowerCase(x) { return x.toLowerCase(); } + ts.toLowerCase = toLowerCase; /** Throws an error because a function is not implemented. */ function notImplemented() { throw new Error("Not implemented"); @@ -3026,6 +3248,11 @@ var ts; 0 /* EqualTo */; } ts.compareDiagnostics = compareDiagnostics; + /** True is greater than false. */ + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { // We still have both chains. @@ -3045,10 +3272,6 @@ var ts; // We still have one chain remaining. The shorter chain should come first. return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -3069,7 +3292,7 @@ var ts; return p2 + 1; } if (path.charCodeAt(1) === 58 /* colon */) { - if (path.charCodeAt(2) === 47 /* slash */) + if (path.charCodeAt(2) === 47 /* slash */ || path.charCodeAt(2) === 92 /* backslash */) return 3; } // Per RFC 1738 'file' URI schema has the shape file:/// @@ -3149,11 +3372,6 @@ var ts; return /^\.\.?($|[\\/])/.test(path); } ts.pathIsRelative = pathIsRelative; - /** @deprecated Use `!isExternalModuleNameRelative(moduleName)` instead. */ - function moduleHasNonRelativeName(moduleName) { - return !ts.isExternalModuleNameRelative(moduleName); - } - ts.moduleHasNonRelativeName = moduleHasNonRelativeName; function getEmitScriptTarget(compilerOptions) { return compilerOptions.target || 0 /* ES3 */; } @@ -3176,7 +3394,9 @@ var ts; var moduleKind = getEmitModuleKind(compilerOptions); return compilerOptions.allowSyntheticDefaultImports !== undefined ? compilerOptions.allowSyntheticDefaultImports - : moduleKind === ts.ModuleKind.System; + : compilerOptions.esModuleInterop + ? moduleKind !== ts.ModuleKind.None && moduleKind < ts.ModuleKind.ES2015 + : moduleKind === ts.ModuleKind.System; } ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports; function getStrictOptionValue(compilerOptions, flag) { @@ -3236,7 +3456,7 @@ var ts; ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { // Get root length of http://www.website.com/folder1/folder2/ - // In this example the root is: http://www.website.com/ + // In this example the root is: http://www.website.com/ // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; // Initial root length is http:// part @@ -3266,7 +3486,7 @@ var ts; } else { // Can't find the host assume the rest of the string as component - // but make sure we append "/" to it as root is not joined using "/" + // but make sure we append "/" to it as root is not joined using "/" // eg. if url passed in was http://website.com we want to use root as [http://website.com/] // so that other path manipulations will be correct and it can be merged with relative paths correctly return [url + ts.directorySeparator]; @@ -3285,7 +3505,7 @@ var ts; var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name - // that is ["test", "cases", ""] needs to be actually ["test", "cases"] + // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.pop(); } // Find the component that differs @@ -3507,7 +3727,6 @@ var ts; function getSubPatternFromSpec(spec, basePath, usage, _a) { var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; - var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; var components = getNormalizedPathComponents(spec, basePath); var lastComponent = lastOrUndefined(components); @@ -3524,11 +3743,7 @@ var ts; for (var _i = 0, components_1 = components; _i < components_1.length; _i++) { var component = components_1[_i]; if (component === "**") { - if (hasRecursiveDirectoryWildcard) { - return undefined; - } subpattern += doubleAsteriskRegexFragment; - hasRecursiveDirectoryWildcard = true; } else { if (usage === "directories") { @@ -3845,6 +4060,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -3854,10 +4073,10 @@ var ts; } function Signature() { } // tslint:disable-line no-empty function Node(kind, pos, end) { - this.id = 0; - this.kind = kind; this.pos = pos; this.end = end; + this.kind = kind; + this.id = 0; this.flags = 0 /* None */; this.modifierFlagsCache = 0 /* None */; this.transformFlags = 0 /* None */; @@ -3937,6 +4156,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -3955,6 +4187,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); /** Remove an item from an array, moving everything to its right one space left. */ function orderedRemoveItem(array, item) { @@ -3997,9 +4249,7 @@ var ts; } } function createGetCanonicalFileName(useCaseSensitiveFileNames) { - return useCaseSensitiveFileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); + return useCaseSensitiveFileNames ? identity : toLowerCase; } ts.createGetCanonicalFileName = createGetCanonicalFileName; /** @@ -4034,7 +4284,7 @@ var ts; */ function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; /** Return the object corresponding to the best pattern to match `candidate`. */ @@ -4042,8 +4292,8 @@ var ts; var matchedValue = undefined; // use length of prefix as betterness criteria var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -4118,182 +4368,20 @@ var ts; return function (arg) { return f(arg) && g(arg); }; } ts.and = and; + function or(f, g) { + return function (arg) { return f(arg) || g(arg); }; + } + ts.or = or; function assertTypeIsNever(_) { } // tslint:disable-line no-empty ts.assertTypeIsNever = assertTypeIsNever; - function createCachedDirectoryStructureHost(host) { - var cachedReadDirectoryResult = createMap(); - var getCurrentDirectory = memoize(function () { return host.getCurrentDirectory(); }); - var getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - return { - useCaseSensitiveFileNames: host.useCaseSensitiveFileNames, - newLine: host.newLine, - readFile: function (path, encoding) { return host.readFile(path, encoding); }, - write: function (s) { return host.write(s); }, - writeFile: writeFile, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: createDirectory, - getCurrentDirectory: getCurrentDirectory, - getDirectories: getDirectories, - readDirectory: readDirectory, - addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, - addOrDeleteFile: addOrDeleteFile, - clearCache: clearCache, - exit: function (code) { return host.exit(code); } - }; - function toPath(fileName) { - return ts.toPath(fileName, getCurrentDirectory(), getCanonicalFileName); - } - function getCachedFileSystemEntries(rootDirPath) { - return cachedReadDirectoryResult.get(rootDirPath); - } - function getCachedFileSystemEntriesForBaseDir(path) { - return getCachedFileSystemEntries(getDirectoryPath(path)); - } - function getBaseNameOfFileName(fileName) { - return getBaseFileName(normalizePath(fileName)); - } - function createCachedFileSystemEntries(rootDir, rootDirPath) { - var resultFromHost = { - files: map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [], - directories: host.getDirectories(rootDir) || [] - }; - cachedReadDirectoryResult.set(rootDirPath, resultFromHost); - return resultFromHost; - } - /** - * If the readDirectory result was already cached, it returns that - * Otherwise gets result from host and caches it. - * The host request is done under try catch block to avoid caching incorrect result - */ - function tryReadDirectory(rootDir, rootDirPath) { - var cachedResult = getCachedFileSystemEntries(rootDirPath); - if (cachedResult) { - return cachedResult; - } - try { - return createCachedFileSystemEntries(rootDir, rootDirPath); - } - catch (_e) { - // If there is exception to read directories, dont cache the result and direct the calls to host - Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); - return undefined; - } - } - function fileNameEqual(name1, name2) { - return getCanonicalFileName(name1) === getCanonicalFileName(name2); - } - function hasEntry(entries, name) { - return some(entries, function (file) { return fileNameEqual(file, name); }); - } - function updateFileSystemEntry(entries, baseName, isValid) { - if (hasEntry(entries, baseName)) { - if (!isValid) { - return filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); - } - } - else if (isValid) { - return entries.push(baseName); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), /*fileExists*/ true); - } - return host.writeFile(fileName, data, writeByteOrderMark); - } - function fileExists(fileName) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || - host.fileExists(fileName); - } - function directoryExists(dirPath) { - var path = toPath(dirPath); - return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); - } - function createDirectory(dirPath) { - var path = toPath(dirPath); - var result = getCachedFileSystemEntriesForBaseDir(path); - var baseFileName = getBaseNameOfFileName(dirPath); - if (result) { - updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true); - } - host.createDirectory(dirPath); - } - function getDirectories(rootDir) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return result.directories.slice(); - } - return host.getDirectories(rootDir); - } - function readDirectory(rootDir, extensions, excludes, includes, depth) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return matchFiles(rootDir, extensions, excludes, includes, host.useCaseSensitiveFileNames, getCurrentDirectory(), depth, getFileSystemEntries); - } - return host.readDirectory(rootDir, extensions, excludes, includes, depth); - function getFileSystemEntries(dir) { - var path = toPath(dir); - if (path === rootDirPath) { - return result; - } - return getCachedFileSystemEntries(path) || createCachedFileSystemEntries(dir, path); - } - } - function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { - var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); - if (existingResult) { - // Just clear the cache for now - // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated - clearCache(); - } - else { - // This was earlier a file (hence not in cached directory contents) - // or we never cached the directory containing it - var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); - if (parentResult) { - var baseName = getBaseNameOfFileName(fileOrDirectory); - if (parentResult) { - var fsQueryResult = { - fileExists: host.fileExists(fileOrDirectoryPath), - directoryExists: host.directoryExists(fileOrDirectoryPath) - }; - if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { - // Folder added or removed, clear the cache instead of updating the folder and its structure - clearCache(); - } - else { - // No need to update the directory structure, just files - updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); - } - return fsQueryResult; - } - } - } - } - function addOrDeleteFile(fileName, filePath, eventKind) { - if (eventKind === ts.FileWatcherEventKind.Changed) { - return; - } - var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); - if (parentResult) { - updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); - } - } - function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { - updateFileSystemEntry(parentResult.files, baseName, fileExists); - } - function clearCache() { - cachedReadDirectoryResult.clear(); - } + ts.emptyFileSystemEntries = { + files: ts.emptyArray, + directories: ts.emptyArray + }; + function singleElementArray(t) { + return t === undefined ? undefined : [t]; } - ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + ts.singleElementArray = singleElementArray; })(ts || (ts = {})); /// var ts; @@ -4332,13 +4420,36 @@ var ts; } ts.getNodeMajorVersion = getNodeMajorVersion; ts.sys = (function () { - var utf8ByteOrderMark = "\u00EF\u00BB\u00BF"; + // NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual + // byte order mark from the specified encoding. Using any other byte order mark does + // not actually work. + var byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); + // crypto can be absent on reduced node installations + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; + } var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + /** + * djb2 hashing algorithm + * http://www.cse.yorku.ca/~oz/hash.html + */ + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } function createWatchedFileSet() { var dirWatchers = ts.createMap(); // One file can have multiple watchers @@ -4525,7 +4636,7 @@ var ts; function writeFile(fileName, data, writeByteOrderMark) { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } var fd; try { @@ -4568,7 +4679,7 @@ var ts; return { files: files, directories: directories }; } catch (e) { - return { files: [], directories: [] }; + return ts.emptyFileSystemEntries; } } function readDirectory(path, extensions, excludes, includes, depth) { @@ -4601,6 +4712,9 @@ var ts; return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1 /* Directory */); }); } var nodeSystem = { + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, args: process.argv.slice(2), newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, @@ -4660,11 +4774,7 @@ var ts; return undefined; } }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, getMemoryUsage: function () { if (global.gc) { global.gc(); @@ -4685,7 +4795,12 @@ var ts; process.exit(exitCode); }, realpath: function (path) { - return _fs.realpathSync(path); + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } }, debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), tryEnableSourceMapsForHost: function () { @@ -4715,7 +4830,7 @@ var ts; writeFile: function (path, data, writeByteOrderMark) { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } ChakraHost.writeFile(path, data); }, @@ -5022,6 +5137,9 @@ var ts; unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts.DiagnosticCategory.Error, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), + An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -5136,6 +5254,7 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", "Numeric index type '{0}' is not assignable to string index type '{1}'."), Class_name_cannot_be_0: diag(2414, ts.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), @@ -5190,7 +5309,7 @@ var ts; Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), @@ -5278,6 +5397,8 @@ var ts; The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts.DiagnosticCategory.Error, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5356,6 +5477,10 @@ var ts; Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5442,7 +5567,6 @@ var ts; The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), - File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: diag(5011, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'."), Cannot_read_file_0_Colon_1: diag(5012, ts.DiagnosticCategory.Error, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), Failed_to_parse_file_0_Colon_1: diag(5014, ts.DiagnosticCategory.Error, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), Unknown_compiler_option_0: diag(5023, ts.DiagnosticCategory.Error, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), @@ -5481,6 +5605,7 @@ var ts; Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -5493,6 +5618,7 @@ var ts; Options_Colon: diag(6027, ts.DiagnosticCategory.Message, "Options_Colon_6027", "Options:"), Version_0: diag(6029, ts.DiagnosticCategory.Message, "Version_0_6029", "Version {0}"), Insert_command_line_options_and_files_from_a_file: diag(6030, ts.DiagnosticCategory.Message, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, ts.DiagnosticCategory.Message, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), File_change_detected_Starting_incremental_compilation: diag(6032, ts.DiagnosticCategory.Message, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), KIND: diag(6034, ts.DiagnosticCategory.Message, "KIND_6034", "KIND"), FILE: diag(6035, ts.DiagnosticCategory.Message, "FILE_6035", "FILE"), @@ -5533,7 +5659,7 @@ var ts; Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts.DiagnosticCategory.Message, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), - Specify_library_files_to_be_included_in_the_compilation_Colon: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", "Specify library files to be included in the compilation: "), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), Specify_JSX_code_generation_Colon_preserve_react_native_or_react: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", "Specify JSX code generation: 'preserve', 'react-native', or 'react'."), File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), @@ -5640,6 +5766,9 @@ var ts; Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6185", "Disable strict checking of generic signatures in function types."), Enable_strict_checking_of_function_types: diag(6186, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -5668,6 +5797,9 @@ var ts; Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{0}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime: diag(7038, ts.DiagnosticCategory.Error, "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038", "A namespace-style import cannot be called or constructed, and will cause a failure at runtime."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -5743,9 +5875,9 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), Declare_static_property_0: diag(90027, ts.DiagnosticCategory.Message, "Declare_static_property_0_90027", "Declare static property '{0}'"), Call_decorator_expression: diag(90028, ts.DiagnosticCategory.Message, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Extract_symbol: diag(95003, ts.DiagnosticCategory.Message, "Extract_symbol_95003", "Extract symbol"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -5757,14 +5889,18 @@ var ts; Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"), Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), }; })(ts || (ts = {})); /// /* @internal */ var ts; (function (ts) { - ts.emptyArray = []; + ts.resolvingEmptyArray = []; ts.emptyMap = ts.createMap(); + ts.emptyUnderscoreEscapedMap = ts.emptyMap; ts.externalHelpersModuleNameText = "tslib"; function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; @@ -5784,15 +5920,24 @@ var ts; var str = ""; var writeText = function (text) { return str += text; }; return { - string: function () { return str; }, + getText: function () { return str; }, + write: writeText, + rawWrite: writeText, + writeTextOfNode: writeText, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, writeSpace: writeText, writeStringLiteral: writeText, + writeLiteral: writeText, writeParameter: writeText, writeProperty: writeText, writeSymbol: writeText, + getTextPos: function () { return str.length; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, // Completely ignore indentation for string writers. And map newlines to // a single space. writeLine: function () { return str += " "; }, @@ -5806,10 +5951,10 @@ var ts; }; } function usingSingleLineStringWriter(action) { - var oldString = stringWriter.string(); + var oldString = stringWriter.getText(); try { action(stringWriter); - return stringWriter.string(); + return stringWriter.getText(); } finally { stringWriter.clear(); @@ -5843,12 +5988,19 @@ var ts; return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && + oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; function packageIdIsEqual(a, b) { return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version; } + function packageIdToString(_a) { + var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; + var fullName = subModuleName ? name + "/" + subModuleName : name; + return fullName + "@" + version; + } + ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -5892,7 +6044,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269 /* SourceFile */) { + while (node && node.kind !== 272 /* SourceFile */) { node = node.parent; } return node; @@ -5900,11 +6052,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return true; } return false; @@ -6013,7 +6165,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 290 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 293 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -6069,7 +6221,7 @@ var ts; function getLiteralText(node, sourceFile) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent) { + if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } var escapeText = getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; @@ -6130,11 +6282,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 /* VariableDeclaration */ && node.parent.kind === 264 /* CatchClause */; + return node.kind === 230 /* VariableDeclaration */ && node.parent.kind === 267 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 /* ModuleDeclaration */ && + return node && node.kind === 237 /* ModuleDeclaration */ && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -6153,11 +6305,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 234 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 237 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 /* SourceFile */ || - node.kind === 234 /* ModuleDeclaration */ || + return node.kind === 272 /* SourceFile */ || + node.kind === 237 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -6173,9 +6325,9 @@ var ts; return false; } switch (node.parent.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node.parent); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -6187,22 +6339,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 264 /* CatchClause */: - case 234 /* ModuleDeclaration */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 267 /* CatchClause */: + case 237 /* ModuleDeclaration */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; - case 208 /* Block */: + case 211 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !ts.isFunctionLike(parentNode); @@ -6212,25 +6364,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: ts.assertTypeIsNever(node); @@ -6240,8 +6392,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: return true; default: return false; @@ -6278,21 +6430,20 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return escapeLeadingUnderscores(name.text); - case 145 /* ComputedPropertyName */: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146 /* ComputedPropertyName */: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -6302,6 +6453,11 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -6329,7 +6485,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208 /* Block */) { + if (node.body && node.body.kind === 211 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -6343,7 +6499,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -6352,23 +6508,23 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 232 /* TypeAliasDeclaration */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -6376,9 +6532,19 @@ var ts; // construct. return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + // These asserts should all be satisfied for a properly constructed `errorNode`. + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -6387,7 +6553,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */ && isConst(node); + return node.kind === 236 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -6400,15 +6566,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 /* ExpressionStatement */ + return node.kind === 214 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -6417,11 +6583,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 /* Parameter */ || - node.kind === 146 /* TypeParameter */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 188 /* ArrowFunction */ || - node.kind === 186 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 148 /* Parameter */ || + node.kind === 147 /* TypeParameter */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 191 /* ArrowFunction */ || + node.kind === 189 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -6437,40 +6603,42 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 /* FirstTypeNode */ <= node.kind && node.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= node.kind && node.kind <= 177 /* LastTypeNode */) { return true; } switch (node.kind) { case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: + case 138 /* SymbolKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: return true; case 105 /* VoidKeyword */: - return node.parent.kind !== 191 /* VoidExpression */; - case 202 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 194 /* VoidExpression */; + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147 /* TypeParameter */: + return node.parent.kind === 176 /* MappedType */ || node.parent.kind === 171 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 71 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */ || node.kind === 180 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */ || node.kind === 183 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 144 /* QualifiedName */: - case 180 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: var parent = node.parent; - if (parent.kind === 163 /* TypeQuery */) { + if (parent.kind === 164 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -6479,38 +6647,38 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (159 /* FirstTypeNode */ <= parent.kind && parent.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= parent.kind && parent.kind <= 177 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return node === parent.constraint; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: return node === parent.type; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node === parent.type; - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return node === parent.type; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return node === parent.type; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; - case 184 /* TaggedTemplateExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + return ts.contains(parent.typeArguments, node); + case 187 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -6534,23 +6702,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitor(node); - case 236 /* CaseBlock */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 223 /* LabeledStatement */: - case 225 /* TryStatement */: - case 264 /* CatchClause */: + case 239 /* CaseBlock */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -6560,30 +6728,29 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(name.expression); + traverse(node.name.expression); return; } } @@ -6603,10 +6770,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 165 /* ArrayType */) { + if (node && node.kind === 166 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 160 /* TypeReference */) { + else if (node && node.kind === 161 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -6616,12 +6783,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 164 /* TypeLiteral */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 165 /* TypeLiteral */: return node.members; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.properties; } } @@ -6629,14 +6796,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177 /* BindingElement */: - case 268 /* EnumMember */: - case 147 /* Parameter */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 266 /* ShorthandPropertyAssignment */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 271 /* EnumMember */: + case 148 /* Parameter */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 269 /* ShorthandPropertyAssignment */: + case 230 /* VariableDeclaration */: return true; } } @@ -6644,8 +6811,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 /* VariableDeclarationList */ - && node.parent.parent.kind === 209 /* VariableStatement */; + return node.parent.kind === 231 /* VariableDeclarationList */ + && node.parent.parent.kind === 212 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -6656,13 +6823,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return true; } return false; @@ -6673,7 +6840,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223 /* LabeledStatement */) { + if (node.statement.kind !== 226 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -6681,17 +6848,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 211 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 /* MethodDeclaration */ && node.parent.kind === 179 /* ObjectLiteralExpression */; + return node && node.kind === 153 /* MethodDeclaration */ && node.parent.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 /* MethodDeclaration */ && - (node.parent.kind === 179 /* ObjectLiteralExpression */ || - node.parent.kind === 200 /* ClassExpression */); + return node.kind === 153 /* MethodDeclaration */ && + (node.parent.kind === 182 /* ObjectLiteralExpression */ || + node.parent.kind === 203 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -6704,7 +6871,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265 /* PropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -6726,7 +6893,7 @@ var ts; return undefined; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -6741,9 +6908,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -6754,26 +6921,26 @@ var ts; node = node.parent; } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 234 /* ModuleDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 233 /* EnumDeclaration */: - case 269 /* SourceFile */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 237 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 236 /* EnumDeclaration */: + case 272 /* SourceFile */: return node; } } @@ -6783,9 +6950,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return container; } } @@ -6807,27 +6974,27 @@ var ts; return node; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: node = node.parent; break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -6843,14 +7010,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */) { + if (func.kind === 190 /* FunctionExpression */ || func.kind === 191 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 186 /* ParenthesizedExpression */) { + while (parent.kind === 189 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 185 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -6861,7 +7028,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 97 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -6870,57 +7037,58 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 99 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { - return node.tag; + switch (node.kind) { + case 187 /* TaggedTemplateExpression */: + return node.tag; + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - // Will either be a CallExpression, NewExpression, or Decorator. - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // classes are valid targets return true; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 230 /* ClassDeclaration */; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + return parent.kind === 233 /* ClassDeclaration */; + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 230 /* ClassDeclaration */; - case 147 /* Parameter */: + && parent.kind === 233 /* ClassDeclaration */; + case 148 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 153 /* Constructor */ - || parent.kind === 152 /* MethodDeclaration */ - || parent.kind === 155 /* SetAccessor */) - && grandparent.kind === 230 /* ClassDeclaration */; + && (parent.kind === 154 /* Constructor */ + || parent.kind === 153 /* MethodDeclaration */ + || parent.kind === 156 /* SetAccessor */) + && grandparent.kind === 233 /* ClassDeclaration */; } return false; } @@ -6936,19 +7104,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152 /* MethodDeclaration */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 156 /* SetAccessor */: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 /* JsxOpeningElement */ || - parent.kind === 251 /* JsxSelfClosingElement */ || - parent.kind === 253 /* JsxClosingElement */) { + if (parent.kind === 255 /* JsxOpeningElement */ || + parent.kind === 254 /* JsxSelfClosingElement */ || + parent.kind === 256 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -6961,45 +7129,45 @@ var ts; case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 12 /* RegularExpressionLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 203 /* AsExpression */: - case 185 /* TypeAssertionExpression */: - case 204 /* NonNullExpression */: - case 186 /* ParenthesizedExpression */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 199 /* SpreadElement */: - case 197 /* TemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 206 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 207 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 202 /* SpreadElement */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: - case 201 /* OmittedExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 198 /* YieldExpression */: - case 192 /* AwaitExpression */: - case 205 /* MetaProperty */: + case 204 /* OmittedExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 201 /* YieldExpression */: + case 195 /* AwaitExpression */: + case 208 /* MetaProperty */: return true; - case 144 /* QualifiedName */: - while (node.parent.kind === 144 /* QualifiedName */) { + case 145 /* QualifiedName */: + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node); case 71 /* Identifier */: - if (node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -7015,47 +7183,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 180 /* BindingElement */: return parent.initializer === node; - case 211 /* ExpressionStatement */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 220 /* ReturnStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 224 /* ThrowStatement */: + case 214 /* ExpressionStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 223 /* ReturnStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 227 /* ThrowStatement */: return parent.expression === node; - case 215 /* ForStatement */: + case 218 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forInStatement.expression === node; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return node === parent.expression; - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return node === parent.expression; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return node === parent.expression; - case 148 /* Decorator */: - case 260 /* JsxExpression */: - case 259 /* JsxSpreadAttribute */: - case 267 /* SpreadAssignment */: + case 149 /* Decorator */: + case 263 /* JsxExpression */: + case 262 /* JsxSpreadAttribute */: + case 270 /* SpreadAssignment */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -7063,7 +7231,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -7072,7 +7240,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 252 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -7092,16 +7260,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 /* StringKeyword */ || node.typeArguments[0].kind === 133 /* NumberKeyword */); + (node.typeArguments[0].kind === 137 /* StringKeyword */ || node.typeArguments[0].kind === 134 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; - /** - * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one argument (of the form 'require("name")'). - * This function does not test if the node is in a JavaScript file or not. - */ function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182 /* CallExpression */) { + if (callExpression.kind !== 185 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -7128,9 +7291,9 @@ var ts; * This function does not test if the node is in a JavaScript file or not. */ function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227 /* VariableDeclaration */) { + if (s.valueDeclaration && s.valueDeclaration.kind === 230 /* VariableDeclaration */) { var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 /* FunctionExpression */ || declaration.initializer.kind === 200 /* ClassExpression */); + return declaration.initializer && (declaration.initializer.kind === 190 /* FunctionExpression */ || declaration.initializer.kind === 203 /* ClassExpression */); } return false; } @@ -7156,7 +7319,7 @@ var ts; if (!isInJavaScriptFile(expr)) { return 0 /* None */; } - if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 180 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 183 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; @@ -7178,7 +7341,7 @@ var ts; else if (lhs.expression.kind === 99 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 180 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 183 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 71 /* Identifier */) { @@ -7197,21 +7360,21 @@ var ts; ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 214 /* ExpressionStatement */ && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 238 /* ImportEqualsDeclaration */) { + if (node.kind === 241 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 249 /* ExternalModuleReference */) { + if (reference.kind === 252 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 245 /* ExportDeclaration */) { + if (node.kind === 248 /* ExportDeclaration */) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -7220,31 +7383,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238 /* ImportEqualsDeclaration */) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241 /* NamespaceImport */) { - return importClause.namedBindings; + switch (node.kind) { + case 242 /* ImportDeclaration */: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241 /* ImportEqualsDeclaration */: + return node; + case 248 /* ExportDeclaration */: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 /* ImportDeclaration */ - && node.importClause - && !!node.importClause.name; + return node.kind === 242 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147 /* Parameter */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 266 /* ShorthandPropertyAssignment */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 269 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -7252,54 +7416,45 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 /* JSDocFunctionType */ && + return node.kind === 280 /* JSDocFunctionType */ && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; } ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getAllJSDocs(node) { - if (ts.isJSDocTypedefTag(node)) { - return [node.parent]; - } - return getJSDocCommentsAndTags(node); - } - ts.getAllJSDocs = getAllJSDocs; function getSourceOfAssignment(node) { return ts.isExpressionStatement(node) && node.expression && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 58 /* EqualsToken */ && node.expression.right; } - ts.getSourceOfAssignment = getSourceOfAssignment; - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212 /* VariableStatement */: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151 /* PropertyDeclaration */: + return node.initializer; + } } - ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement; - function getSingleVariableOfVariableStatement(node, child) { + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } - ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement; function getNestedModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && + return node.kind === 237 /* ModuleDeclaration */ && node.body && - node.body.kind === 234 /* ModuleDeclaration */ && + node.body.kind === 237 /* ModuleDeclaration */ && node.body; } - ts.getNestedModuleDeclaration = getNestedModuleDeclaration; function getJSDocCommentsAndTags(node) { var result; getJSDocCommentsAndTagsWorker(node); return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 /* PropertyAssignment */ || parent.kind === 151 /* PropertyDeclaration */ || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. @@ -7309,21 +7464,21 @@ var ts; // */ // var x = function(name) { return name.length; } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 /* None */ || - node.kind === 180 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 211 /* ExpressionStatement */) { + node.kind === 183 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 214 /* ExpressionStatement */) { getJSDocCommentsAndTagsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } - if (isVariableLike(node) && node.initializer && ts.hasJSDocNodes(node.initializer)) { + if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { result = ts.addRange(result, node.initializer.jsDoc); } if (ts.hasJSDocNodes(node)) { @@ -7352,7 +7507,7 @@ var ts; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -7360,7 +7515,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 282 /* JSDocComment */); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -7389,30 +7544,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 43 /* PlusPlusToken */ || unaryOperator === 44 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 186 /* ParenthesizedExpression */: - case 178 /* ArrayLiteralExpression */: - case 199 /* SpreadElement */: + case 189 /* ParenthesizedExpression */: + case 181 /* ArrayLiteralExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: node = parent; break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -7433,6 +7589,33 @@ var ts; return getAssignmentTargetKind(node) !== 0 /* None */; } ts.isAssignmentTarget = isAssignmentTarget; + /** + * Indicates whether a node could contain a `var` VariableDeclarationList that contributes to + * the same `var` declaration scope as the node's parent. + */ + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 211 /* Block */: + case 212 /* VariableStatement */: + case 224 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: + return true; + } + return false; + } + ts.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration; function walkUp(node, kind) { while (node && node.kind === kind) { node = node.parent; @@ -7440,20 +7623,20 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169 /* ParenthesizedType */); + return walkUp(node, 172 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186 /* ParenthesizedExpression */); + return walkUp(node, 189 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189 /* DeleteExpression */; + return node && node.kind === 192 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -7495,7 +7678,7 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 145 /* ComputedPropertyName */ && + node.parent.kind === 146 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -7503,32 +7686,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 180 /* PropertyAccessExpression */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 183 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 144 /* QualifiedName */) { + while (parent.kind === 145 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 163 /* TypeQuery */; + return parent.kind === 164 /* TypeQuery */; } return false; - case 177 /* BindingElement */: - case 243 /* ImportSpecifier */: + case 180 /* BindingElement */: + case 246 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 247 /* ExportSpecifier */: - case 257 /* JsxAttribute */: + case 250 /* ExportSpecifier */: + case 260 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -7544,13 +7727,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 237 /* NamespaceExportDeclaration */ || - node.kind === 240 /* ImportClause */ && !!node.name || - node.kind === 241 /* NamespaceImport */ || - node.kind === 243 /* ImportSpecifier */ || - node.kind === 247 /* ExportSpecifier */ || - node.kind === 244 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 240 /* NamespaceExportDeclaration */ || + node.kind === 243 /* ImportClause */ && !!node.name || + node.kind === 244 /* NamespaceImport */ || + node.kind === 246 /* ImportSpecifier */ || + node.kind === 250 /* ExportSpecifier */ || + node.kind === 247 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -7634,11 +7817,11 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 72 /* FirstKeyword */ <= token && token <= 143 /* LastKeyword */; + return 72 /* FirstKeyword */ <= token && token <= 144 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 117 /* FirstContextualKeyword */ <= token && token <= 143 /* LastContextualKeyword */; + return 117 /* FirstContextualKeyword */ <= token && token <= 144 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -7668,14 +7851,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -7689,10 +7872,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -7719,7 +7902,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 145 /* ComputedPropertyName */ && + return name.kind === 146 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -7740,7 +7923,7 @@ var ts; if (name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */) { return escapeLeadingUnderscores(name.text); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -7782,6 +7965,10 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + function isKnownSymbol(symbol) { + return ts.startsWith(symbol.escapedName, "__@"); + } + ts.isKnownSymbol = isKnownSymbol; /** * Includes the word "Symbol" with unicode escapes */ @@ -7795,11 +7982,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 147 /* Parameter */; + return root.kind === 148 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 177 /* BindingElement */) { + while (node.kind === 180 /* BindingElement */) { node = node.parent.parent; } return node; @@ -7807,15 +7994,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 187 /* FunctionExpression */ - || kind === 229 /* FunctionDeclaration */ - || kind === 188 /* ArrowFunction */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 234 /* ModuleDeclaration */ - || kind === 269 /* SourceFile */; + return kind === 154 /* Constructor */ + || kind === 190 /* FunctionExpression */ + || kind === 232 /* FunctionDeclaration */ + || kind === 191 /* ArrowFunction */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 237 /* ModuleDeclaration */ + || kind === 272 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -7834,23 +8021,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 183 /* NewExpression */: + case 186 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 193 /* PrefixUnaryExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 192 /* AwaitExpression */: - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: + case 196 /* PrefixUnaryExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 195 /* AwaitExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: return 1 /* Right */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (operator) { case 40 /* AsteriskAsteriskToken */: case 58 /* EqualsToken */: @@ -7874,15 +8061,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 195 /* BinaryExpression */) { + if (expression.kind === 198 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 193 /* PrefixUnaryExpression */ || expression.kind === 194 /* PostfixUnaryExpression */) { + else if (expression.kind === 196 /* PrefixUnaryExpression */ || expression.kind === 197 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -7900,37 +8087,37 @@ var ts; case 86 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: case 12 /* RegularExpressionLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: - case 186 /* ParenthesizedExpression */: - case 201 /* OmittedExpression */: + case 200 /* TemplateExpression */: + case 189 /* ParenthesizedExpression */: + case 204 /* OmittedExpression */: return 19; - case 184 /* TaggedTemplateExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 187 /* TaggedTemplateExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return 18; - case 183 /* NewExpression */: + case 186 /* NewExpression */: return hasArguments ? 18 : 17; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return 17; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return 16; - case 193 /* PrefixUnaryExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 192 /* AwaitExpression */: + case 196 /* PrefixUnaryExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 195 /* AwaitExpression */: return 15; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (operatorKind) { case 51 /* ExclamationToken */: case 52 /* TildeToken */: @@ -7988,13 +8175,13 @@ var ts; default: return -1; } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return 4; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return 2; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return 1; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return 0; default: return -1; @@ -8003,9 +8190,9 @@ var ts; ts.getOperatorPrecedence = getOperatorPrecedence; function createDiagnosticCollection() { var nonFileDiagnostics = []; + var filesWithDiagnostics = []; var fileDiagnostics = ts.createMap(); var hasReadNonFileDiagnostics = false; - var diagnosticsModified = false; var modificationCount = 0; return { add: add, @@ -8027,6 +8214,7 @@ var ts; if (!diagnostics) { diagnostics = []; fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive); } } else { @@ -8037,39 +8225,23 @@ var ts; } diagnostics = nonFileDiagnostics; } - diagnostics.push(diagnostic); - diagnosticsModified = true; + ts.insertSorted(diagnostics, diagnostic, ts.compareDiagnostics); modificationCount++; } function getGlobalDiagnostics() { - sortAndDeduplicate(); hasReadNonFileDiagnostics = true; return nonFileDiagnostics; } function getDiagnostics(fileName) { - sortAndDeduplicate(); if (fileName) { return fileDiagnostics.get(fileName) || []; } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); + var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); }); + if (!nonFileDiagnostics.length) { + return fileDiags; } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - fileDiagnostics.forEach(function (diagnostics) { - ts.forEach(diagnostics, pushDiagnostic); - }); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - fileDiagnostics.forEach(function (diagnostics, key) { - fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); - }); + fileDiags.unshift.apply(fileDiags, nonFileDiagnostics); + return fileDiags; } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -8214,7 +8386,19 @@ var ts; getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, getText: function () { return output; }, isAtStartOfLine: function () { return lineStart; }, - reset: reset + clear: reset, + reportInaccessibleThisError: ts.noop, + reportPrivateInBaseOfClassExpression: ts.noop, + reportInaccessibleUniqueSymbolError: ts.noop, + trackSymbol: ts.noop, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: write }; } ts.createTextWriter = createTextWriter; @@ -8317,7 +8501,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -8363,10 +8547,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 155 /* SetAccessor */) { + else if (accessor.kind === 156 /* SetAccessor */) { setAccessor = accessor; } else { @@ -8375,7 +8559,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 /* GetAccessor */ || member.kind === 155 /* SetAccessor */) + if ((member.kind === 155 /* GetAccessor */ || member.kind === 156 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -8386,10 +8570,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 /* GetAccessor */ && !getAccessor) { + if (member.kind === 155 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 155 /* SetAccessor */ && !setAccessor) { + if (member.kind === 156 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -8409,7 +8593,7 @@ var ts; * parsed in a JavaScript file, gets the type annotation from JSDoc. */ function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (node.type) { + if (ts.hasType(node)) { return node.type; } if (checkJSDoc || isInJavaScriptFile(node)) { @@ -8700,7 +8884,7 @@ var ts; case 76 /* ConstKeyword */: return 2048 /* Const */; case 79 /* DefaultKeyword */: return 512 /* Default */; case 120 /* AsyncKeyword */: return 256 /* Async */; - case 131 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 132 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -8717,7 +8901,7 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ && + if (node.kind === 205 /* ExpressionWithTypeArguments */ && node.parent.token === 85 /* ExtendsKeyword */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -8735,8 +8919,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 179 /* ObjectLiteralExpression */ - || kind === 178 /* ArrayLiteralExpression */; + return kind === 182 /* ObjectLiteralExpression */ + || kind === 181 /* ArrayLiteralExpression */; } return false; } @@ -8746,7 +8930,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */ + return node.kind === 205 /* ExpressionWithTypeArguments */ && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 /* ImplementsKeyword */ @@ -8756,21 +8940,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + node.kind === 183 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 /* ObjectLiteralExpression */ && + return expression.kind === 182 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 /* ArrayLiteralExpression */ && + return expression.kind === 181 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -8854,14 +9038,14 @@ var ts; ts.convertToBase64 = convertToBase64; var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; - function getNewLineCharacter(options, system) { + function getNewLineCharacter(options, getNewLine) { switch (options.newLine) { case 0 /* CarriageReturnLineFeed */: return carriageReturnLineFeed; case 1 /* LineFeed */: return lineFeed; } - return system ? system.newLine : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; + return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; /** @@ -9039,8 +9223,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -9113,21 +9297,21 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 43 /* PlusPlusToken */ || operator === 44 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0 /* Read */; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && parent.parent.kind === 211 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && parent.parent.kind === 214 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function compareDataObjects(dst, src) { @@ -9224,6 +9408,14 @@ var ts; return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0; } ts.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures; + function forSomeAncestorDirectory(directory, callback) { + return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); + } + ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -9430,8 +9622,8 @@ var ts; // // { // oldStart3: Min(oldStart1, oldStart2), - // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), - // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // oldEnd3: Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3: Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) // } var oldStart1 = oldStartN; var oldEnd1 = oldEndN; @@ -9447,9 +9639,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146 /* TypeParameter */) { + if (d && d.kind === 147 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234 /* InterfaceDeclaration */) { return current; } } @@ -9457,7 +9649,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 153 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 154 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -9475,7 +9667,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -9483,14 +9675,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -9506,14 +9698,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -9649,18 +9841,17 @@ var ts; } // Covers remaining cases switch (hostNode.kind) { - case 209 /* VariableStatement */: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212 /* VariableStatement */: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: var expr = hostNode.expression; switch (expr.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return expr.name; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -9669,10 +9860,10 @@ var ts; return undefined; case 1 /* EndOfFileToken */: return undefined; - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 223 /* LabeledStatement */: { + case 226 /* LabeledStatement */: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -9697,15 +9888,15 @@ var ts; switch (declaration.kind) { case 71 /* Identifier */: return declaration; - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: { + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { return name.right; } break; } - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1 /* ExportsProperty */: @@ -9717,9 +9908,9 @@ var ts; return undefined; } } - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 244 /* ExportAssignment */: { + case 247 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -9756,33 +9947,33 @@ var ts; * for example on a variable declaration whose initializer is a function expression. */ function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284 /* JSDocParameterTag */); + return !!getFirstJSDocTag(node, 287 /* JSDocParameterTag */); } ts.hasJSDocParameterTags = hasJSDocParameterTags; /** Gets the JSDoc augments tag for the node if present */ function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 285 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; /** Gets the JSDoc class tag for the node if present */ function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283 /* JSDocClassTag */); + return getFirstJSDocTag(node, 286 /* JSDocClassTag */); } ts.getJSDocClassTag = getJSDocClassTag; /** Gets the JSDoc return tag for the node if present */ function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 288 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; /** Gets the JSDoc template tag for the node if present */ function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 290 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; /** Gets the JSDoc type tag for the node if present and valid */ function getJSDocTypeTag(node) { // We should have already issued an error if there were multiple type jsdocs, so just use the first one. - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -9801,8 +9992,8 @@ var ts; * tag directly on the node would be returned. */ function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); - if (!tag && node.kind === 147 /* Parameter */) { + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); + if (!tag && node.kind === 148 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -9886,608 +10077,616 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 144 /* QualifiedName */; + return node.kind === 145 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145 /* ComputedPropertyName */; + return node.kind === 146 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 146 /* TypeParameter */; + return node.kind === 147 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147 /* Parameter */; + return node.kind === 148 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 149 /* PropertySignature */; + return node.kind === 150 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150 /* PropertyDeclaration */; + return node.kind === 151 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151 /* MethodSignature */; + return node.kind === 152 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153 /* Constructor */; + return node.kind === 154 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156 /* CallSignature */; + return node.kind === 157 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157 /* ConstructSignature */; + return node.kind === 158 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158 /* IndexSignature */; + return node.kind === 159 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 159 /* TypePredicate */; + return node.kind === 160 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160 /* TypeReference */; + return node.kind === 161 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161 /* FunctionType */; + return node.kind === 162 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162 /* ConstructorType */; + return node.kind === 163 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163 /* TypeQuery */; + return node.kind === 164 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164 /* TypeLiteral */; + return node.kind === 165 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165 /* ArrayType */; + return node.kind === 166 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166 /* TupleType */; + return node.kind === 167 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167 /* UnionType */; + return node.kind === 168 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168 /* IntersectionType */; + return node.kind === 169 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170 /* ConditionalType */; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171 /* InferType */; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169 /* ParenthesizedType */; + return node.kind === 172 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170 /* ThisType */; + return node.kind === 173 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171 /* TypeOperator */; + return node.kind === 174 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172 /* IndexedAccessType */; + return node.kind === 175 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173 /* MappedType */; + return node.kind === 176 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174 /* LiteralType */; + return node.kind === 177 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 175 /* ObjectBindingPattern */; + return node.kind === 178 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176 /* ArrayBindingPattern */; + return node.kind === 179 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177 /* BindingElement */; + return node.kind === 180 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 178 /* ArrayLiteralExpression */; + return node.kind === 181 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179 /* ObjectLiteralExpression */; + return node.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180 /* PropertyAccessExpression */; + return node.kind === 183 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181 /* ElementAccessExpression */; + return node.kind === 184 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182 /* CallExpression */; + return node.kind === 185 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183 /* NewExpression */; + return node.kind === 186 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184 /* TaggedTemplateExpression */; + return node.kind === 187 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185 /* TypeAssertionExpression */; + return node.kind === 188 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186 /* ParenthesizedExpression */; + return node.kind === 189 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292 /* PartiallyEmittedExpression */) { + while (node.kind === 295 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187 /* FunctionExpression */; + return node.kind === 190 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188 /* ArrowFunction */; + return node.kind === 191 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189 /* DeleteExpression */; + return node.kind === 192 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 193 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191 /* VoidExpression */; + return node.kind === 194 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 195 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193 /* PrefixUnaryExpression */; + return node.kind === 196 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194 /* PostfixUnaryExpression */; + return node.kind === 197 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195 /* BinaryExpression */; + return node.kind === 198 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196 /* ConditionalExpression */; + return node.kind === 199 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197 /* TemplateExpression */; + return node.kind === 200 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198 /* YieldExpression */; + return node.kind === 201 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199 /* SpreadElement */; + return node.kind === 202 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200 /* ClassExpression */; + return node.kind === 203 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201 /* OmittedExpression */; + return node.kind === 204 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */; + return node.kind === 205 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203 /* AsExpression */; + return node.kind === 206 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204 /* NonNullExpression */; + return node.kind === 207 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205 /* MetaProperty */; + return node.kind === 208 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 206 /* TemplateSpan */; + return node.kind === 209 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207 /* SemicolonClassElement */; + return node.kind === 210 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 208 /* Block */; + return node.kind === 211 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209 /* VariableStatement */; + return node.kind === 212 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210 /* EmptyStatement */; + return node.kind === 213 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211 /* ExpressionStatement */; + return node.kind === 214 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212 /* IfStatement */; + return node.kind === 215 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213 /* DoStatement */; + return node.kind === 216 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214 /* WhileStatement */; + return node.kind === 217 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215 /* ForStatement */; + return node.kind === 218 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216 /* ForInStatement */; + return node.kind === 219 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217 /* ForOfStatement */; + return node.kind === 220 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218 /* ContinueStatement */; + return node.kind === 221 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219 /* BreakStatement */; + return node.kind === 222 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */; + return node.kind === 222 /* BreakStatement */ || node.kind === 221 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220 /* ReturnStatement */; + return node.kind === 223 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221 /* WithStatement */; + return node.kind === 224 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222 /* SwitchStatement */; + return node.kind === 225 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223 /* LabeledStatement */; + return node.kind === 226 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224 /* ThrowStatement */; + return node.kind === 227 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225 /* TryStatement */; + return node.kind === 228 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226 /* DebuggerStatement */; + return node.kind === 229 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227 /* VariableDeclaration */; + return node.kind === 230 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228 /* VariableDeclarationList */; + return node.kind === 231 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229 /* FunctionDeclaration */; + return node.kind === 232 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230 /* ClassDeclaration */; + return node.kind === 233 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231 /* InterfaceDeclaration */; + return node.kind === 234 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232 /* TypeAliasDeclaration */; + return node.kind === 235 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */; + return node.kind === 236 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */; + return node.kind === 237 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235 /* ModuleBlock */; + return node.kind === 238 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236 /* CaseBlock */; + return node.kind === 239 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237 /* NamespaceExportDeclaration */; + return node.kind === 240 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */; + return node.kind === 241 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239 /* ImportDeclaration */; + return node.kind === 242 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240 /* ImportClause */; + return node.kind === 243 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241 /* NamespaceImport */; + return node.kind === 244 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242 /* NamedImports */; + return node.kind === 245 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243 /* ImportSpecifier */; + return node.kind === 246 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244 /* ExportAssignment */; + return node.kind === 247 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245 /* ExportDeclaration */; + return node.kind === 248 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246 /* NamedExports */; + return node.kind === 249 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247 /* ExportSpecifier */; + return node.kind === 250 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248 /* MissingDeclaration */; + return node.kind === 251 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 249 /* ExternalModuleReference */; + return node.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 250 /* JsxElement */; + return node.kind === 253 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251 /* JsxSelfClosingElement */; + return node.kind === 254 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252 /* JsxOpeningElement */; + return node.kind === 255 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253 /* JsxClosingElement */; + return node.kind === 256 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254 /* JsxFragment */; + return node.kind === 257 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255 /* JsxOpeningFragment */; + return node.kind === 258 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256 /* JsxClosingFragment */; + return node.kind === 259 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257 /* JsxAttribute */; + return node.kind === 260 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258 /* JsxAttributes */; + return node.kind === 261 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259 /* JsxSpreadAttribute */; + return node.kind === 262 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260 /* JsxExpression */; + return node.kind === 263 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 261 /* CaseClause */; + return node.kind === 264 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262 /* DefaultClause */; + return node.kind === 265 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263 /* HeritageClause */; + return node.kind === 266 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264 /* CatchClause */; + return node.kind === 267 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 265 /* PropertyAssignment */; + return node.kind === 268 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266 /* ShorthandPropertyAssignment */; + return node.kind === 269 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267 /* SpreadAssignment */; + return node.kind === 270 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 269 /* SourceFile */; + return node.kind === 272 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270 /* Bundle */; + return node.kind === 273 /* Bundle */; } ts.isBundle = isBundle; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 271 /* JSDocTypeExpression */; + return node.kind === 274 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272 /* JSDocAllType */; + return node.kind === 275 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273 /* JSDocUnknownType */; + return node.kind === 276 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274 /* JSDocNullableType */; + return node.kind === 277 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275 /* JSDocNonNullableType */; + return node.kind === 278 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276 /* JSDocOptionalType */; + return node.kind === 279 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277 /* JSDocFunctionType */; + return node.kind === 280 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278 /* JSDocVariadicType */; + return node.kind === 281 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279 /* JSDocComment */; + return node.kind === 282 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282 /* JSDocAugmentsTag */; + return node.kind === 285 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284 /* JSDocParameterTag */; + return node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285 /* JSDocReturnTag */; + return node.kind === 288 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286 /* JSDocTypeTag */; + return node.kind === 289 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287 /* JSDocTemplateTag */; + return node.kind === 290 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288 /* JSDocTypedefTag */; + return node.kind === 291 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289 /* JSDocPropertyTag */; + return node.kind === 292 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 /* JSDocPropertyTag */ || node.kind === 284 /* JSDocParameterTag */; + return node.kind === 292 /* JSDocPropertyTag */ || node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280 /* JSDocTypeLiteral */; + return node.kind === 283 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); @@ -10498,7 +10697,7 @@ var ts; (function (ts) { /* @internal */ function isSyntaxList(n) { - return n.kind === 290 /* SyntaxList */; + return n.kind === 293 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -10508,15 +10707,16 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 144 /* FirstNode */; + return kind >= 145 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 143 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 144 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -10555,7 +10755,7 @@ var ts; /* @internal */ function isGeneratedIdentifier(node) { // Using `>` here catches both `GeneratedIdentifierKind.None` and `undefined`. - return ts.isIdentifier(node) && node.autoGenerateKind > 0 /* None */; + return ts.isIdentifier(node) && (node.autoGenerateFlags & 7 /* KindMask */) > 0 /* None */; } ts.isGeneratedIdentifier = isGeneratedIdentifier; // Keywords @@ -10571,7 +10771,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 115 /* StaticKeyword */: return true; } @@ -10584,7 +10784,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 /* QualifiedName */ + return kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isEntityName = isEntityName; @@ -10593,14 +10793,14 @@ var ts; return kind === 71 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 145 /* ComputedPropertyName */; + || kind === 146 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 175 /* ObjectBindingPattern */ - || kind === 176 /* ArrayBindingPattern */; + || kind === 178 /* ObjectBindingPattern */ + || kind === 179 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -10615,13 +10815,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: return false; @@ -10630,13 +10830,13 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -10651,68 +10851,80 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 150 /* PropertyDeclaration */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 158 /* IndexSignature */ - || kind === 207 /* SemicolonClassElement */ - || kind === 248 /* MissingDeclaration */; + return kind === 154 /* Constructor */ + || kind === 151 /* PropertyDeclaration */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 159 /* IndexSignature */ + || kind === 210 /* SemicolonClassElement */ + || kind === 251 /* MissingDeclaration */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */); + return node && (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */); + return node && (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */); } ts.isAccessor = isAccessor; + /* @internal */ + function isMethodOrAccessor(node) { + switch (node.kind) { + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return true; + default: + return false; + } + } + ts.isMethodOrAccessor = isMethodOrAccessor; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 157 /* ConstructSignature */ - || kind === 156 /* CallSignature */ - || kind === 149 /* PropertySignature */ - || kind === 151 /* MethodSignature */ - || kind === 158 /* IndexSignature */ - || kind === 248 /* MissingDeclaration */; + return kind === 158 /* ConstructSignature */ + || kind === 157 /* CallSignature */ + || kind === 150 /* PropertySignature */ + || kind === 152 /* MethodSignature */ + || kind === 159 /* IndexSignature */ + || kind === 251 /* MissingDeclaration */; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 /* PropertyAssignment */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 267 /* SpreadAssignment */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 248 /* MissingDeclaration */; + return kind === 268 /* PropertyAssignment */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 270 /* SpreadAssignment */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 251 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) + return (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) || kind === 119 /* AnyKeyword */ - || kind === 133 /* NumberKeyword */ - || kind === 134 /* ObjectKeyword */ + || kind === 134 /* NumberKeyword */ + || kind === 135 /* ObjectKeyword */ || kind === 122 /* BooleanKeyword */ - || kind === 136 /* StringKeyword */ - || kind === 137 /* SymbolKeyword */ + || kind === 137 /* StringKeyword */ + || kind === 138 /* SymbolKeyword */ || kind === 99 /* ThisKeyword */ || kind === 105 /* VoidKeyword */ - || kind === 139 /* UndefinedKeyword */ + || kind === 140 /* UndefinedKeyword */ || kind === 95 /* NullKeyword */ - || kind === 130 /* NeverKeyword */ - || kind === 202 /* ExpressionWithTypeArguments */ - || kind === 272 /* JSDocAllType */ - || kind === 273 /* JSDocUnknownType */ - || kind === 274 /* JSDocNullableType */ - || kind === 275 /* JSDocNonNullableType */ - || kind === 276 /* JSDocOptionalType */ - || kind === 277 /* JSDocFunctionType */ - || kind === 278 /* JSDocVariadicType */; + || kind === 131 /* NeverKeyword */ + || kind === 205 /* ExpressionWithTypeArguments */ + || kind === 275 /* JSDocAllType */ + || kind === 276 /* JSDocUnknownType */ + || kind === 277 /* JSDocNullableType */ + || kind === 278 /* JSDocNonNullableType */ + || kind === 279 /* JSDocOptionalType */ + || kind === 280 /* JSDocFunctionType */ + || kind === 281 /* JSDocVariadicType */; } /** * Node test that determines whether a node is a valid type node. @@ -10725,8 +10937,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return true; } return false; @@ -10737,8 +10949,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 /* ArrayBindingPattern */ - || kind === 175 /* ObjectBindingPattern */; + return kind === 179 /* ArrayBindingPattern */ + || kind === 178 /* ObjectBindingPattern */; } return false; } @@ -10746,15 +10958,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 /* ArrayLiteralExpression */ - || kind === 179 /* ObjectLiteralExpression */; + return kind === 181 /* ArrayLiteralExpression */ + || kind === 182 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 /* BindingElement */ - || kind === 201 /* OmittedExpression */; + return kind === 180 /* BindingElement */ + || kind === 204 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -10763,9 +10975,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 180 /* BindingElement */: return true; } return false; @@ -10786,8 +10998,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return true; } return false; @@ -10799,8 +11011,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return true; } return false; @@ -10809,18 +11021,18 @@ var ts; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 /* PropertyAccessExpression */ - || kind === 144 /* QualifiedName */; + return kind === 183 /* PropertyAccessExpression */ + || kind === 145 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 148 /* Decorator */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 149 /* Decorator */: return true; default: return false; @@ -10828,12 +11040,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 /* CallExpression */ || node.kind === 183 /* NewExpression */; + return node.kind === 185 /* CallExpression */ || node.kind === 186 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 /* TemplateExpression */ + return kind === 200 /* TemplateExpression */ || kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -10844,32 +11056,32 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 183 /* NewExpression */: - case 182 /* CallExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 184 /* TaggedTemplateExpression */: - case 178 /* ArrayLiteralExpression */: - case 186 /* ParenthesizedExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 187 /* FunctionExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 186 /* NewExpression */: + case 185 /* CallExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 187 /* TaggedTemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 189 /* ParenthesizedExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 190 /* FunctionExpression */: case 71 /* Identifier */: case 12 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 101 /* TrueKeyword */: case 97 /* SuperKeyword */: - case 204 /* NonNullExpression */: - case 205 /* MetaProperty */: + case 207 /* NonNullExpression */: + case 208 /* MetaProperty */: case 91 /* ImportKeyword */:// technically this is only an Expression if it's in a CallExpression return true; default: @@ -10883,13 +11095,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 185 /* TypeAssertionExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 188 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -10898,9 +11110,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; default: @@ -10919,15 +11131,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: - case 188 /* ArrowFunction */: - case 195 /* BinaryExpression */: - case 199 /* SpreadElement */: - case 203 /* AsExpression */: - case 201 /* OmittedExpression */: - case 293 /* CommaListExpression */: - case 292 /* PartiallyEmittedExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: + case 191 /* ArrowFunction */: + case 198 /* BinaryExpression */: + case 202 /* SpreadElement */: + case 206 /* AsExpression */: + case 204 /* OmittedExpression */: + case 296 /* CommaListExpression */: + case 295 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -10935,18 +11147,18 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 /* TypeAssertionExpression */ - || kind === 203 /* AsExpression */; + return kind === 188 /* TypeAssertionExpression */ + || kind === 206 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 292 /* PartiallyEmittedExpression */; + return node.kind === 295 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 291 /* NotEmittedStatement */; + return node.kind === 294 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ @@ -10958,13 +11170,13 @@ var ts; // Statement function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return true; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -10972,7 +11184,7 @@ var ts; ts.isIterationStatement = isIterationStatement; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 216 /* ForInStatement */ || node.kind === 217 /* ForOfStatement */; + return node.kind === 219 /* ForInStatement */ || node.kind === 220 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -10996,111 +11208,111 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */ + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */ || kind === 71 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */; + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 234 /* ModuleDeclaration */; + || kind === 237 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 /* NamedImports */ - || kind === 241 /* NamespaceImport */; + return kind === 245 /* NamedImports */ + || kind === 244 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ || node.kind === 233 /* EnumDeclaration */; + return node.kind === 237 /* ModuleDeclaration */ || node.kind === 236 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 /* ArrowFunction */ - || kind === 177 /* BindingElement */ - || kind === 230 /* ClassDeclaration */ - || kind === 200 /* ClassExpression */ - || kind === 153 /* Constructor */ - || kind === 233 /* EnumDeclaration */ - || kind === 268 /* EnumMember */ - || kind === 247 /* ExportSpecifier */ - || kind === 229 /* FunctionDeclaration */ - || kind === 187 /* FunctionExpression */ - || kind === 154 /* GetAccessor */ - || kind === 240 /* ImportClause */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 243 /* ImportSpecifier */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 257 /* JsxAttribute */ - || kind === 152 /* MethodDeclaration */ - || kind === 151 /* MethodSignature */ - || kind === 234 /* ModuleDeclaration */ - || kind === 237 /* NamespaceExportDeclaration */ - || kind === 241 /* NamespaceImport */ - || kind === 147 /* Parameter */ - || kind === 265 /* PropertyAssignment */ - || kind === 150 /* PropertyDeclaration */ - || kind === 149 /* PropertySignature */ - || kind === 155 /* SetAccessor */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 146 /* TypeParameter */ - || kind === 227 /* VariableDeclaration */ - || kind === 288 /* JSDocTypedefTag */; + return kind === 191 /* ArrowFunction */ + || kind === 180 /* BindingElement */ + || kind === 233 /* ClassDeclaration */ + || kind === 203 /* ClassExpression */ + || kind === 154 /* Constructor */ + || kind === 236 /* EnumDeclaration */ + || kind === 271 /* EnumMember */ + || kind === 250 /* ExportSpecifier */ + || kind === 232 /* FunctionDeclaration */ + || kind === 190 /* FunctionExpression */ + || kind === 155 /* GetAccessor */ + || kind === 243 /* ImportClause */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 246 /* ImportSpecifier */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 260 /* JsxAttribute */ + || kind === 153 /* MethodDeclaration */ + || kind === 152 /* MethodSignature */ + || kind === 237 /* ModuleDeclaration */ + || kind === 240 /* NamespaceExportDeclaration */ + || kind === 244 /* NamespaceImport */ + || kind === 148 /* Parameter */ + || kind === 268 /* PropertyAssignment */ + || kind === 151 /* PropertyDeclaration */ + || kind === 150 /* PropertySignature */ + || kind === 156 /* SetAccessor */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 147 /* TypeParameter */ + || kind === 230 /* VariableDeclaration */ + || kind === 291 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 229 /* FunctionDeclaration */ - || kind === 248 /* MissingDeclaration */ - || kind === 230 /* ClassDeclaration */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 233 /* EnumDeclaration */ - || kind === 234 /* ModuleDeclaration */ - || kind === 239 /* ImportDeclaration */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 245 /* ExportDeclaration */ - || kind === 244 /* ExportAssignment */ - || kind === 237 /* NamespaceExportDeclaration */; + return kind === 232 /* FunctionDeclaration */ + || kind === 251 /* MissingDeclaration */ + || kind === 233 /* ClassDeclaration */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 236 /* EnumDeclaration */ + || kind === 237 /* ModuleDeclaration */ + || kind === 242 /* ImportDeclaration */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 248 /* ExportDeclaration */ + || kind === 247 /* ExportAssignment */ + || kind === 240 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 /* BreakStatement */ - || kind === 218 /* ContinueStatement */ - || kind === 226 /* DebuggerStatement */ - || kind === 213 /* DoStatement */ - || kind === 211 /* ExpressionStatement */ - || kind === 210 /* EmptyStatement */ - || kind === 216 /* ForInStatement */ - || kind === 217 /* ForOfStatement */ - || kind === 215 /* ForStatement */ - || kind === 212 /* IfStatement */ - || kind === 223 /* LabeledStatement */ - || kind === 220 /* ReturnStatement */ - || kind === 222 /* SwitchStatement */ - || kind === 224 /* ThrowStatement */ - || kind === 225 /* TryStatement */ - || kind === 209 /* VariableStatement */ - || kind === 214 /* WhileStatement */ - || kind === 221 /* WithStatement */ - || kind === 291 /* NotEmittedStatement */ - || kind === 295 /* EndOfDeclarationMarker */ - || kind === 294 /* MergeDeclarationMarker */; + return kind === 222 /* BreakStatement */ + || kind === 221 /* ContinueStatement */ + || kind === 229 /* DebuggerStatement */ + || kind === 216 /* DoStatement */ + || kind === 214 /* ExpressionStatement */ + || kind === 213 /* EmptyStatement */ + || kind === 219 /* ForInStatement */ + || kind === 220 /* ForOfStatement */ + || kind === 218 /* ForStatement */ + || kind === 215 /* IfStatement */ + || kind === 226 /* LabeledStatement */ + || kind === 223 /* ReturnStatement */ + || kind === 225 /* SwitchStatement */ + || kind === 227 /* ThrowStatement */ + || kind === 228 /* TryStatement */ + || kind === 212 /* VariableStatement */ + || kind === 217 /* WhileStatement */ + || kind === 224 /* WithStatement */ + || kind === 294 /* NotEmittedStatement */ + || kind === 298 /* EndOfDeclarationMarker */ + || kind === 297 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 146 /* TypeParameter */) { - return node.parent.kind !== 287 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); + if (node.kind === 147 /* TypeParameter */) { + return node.parent.kind !== 290 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -11127,10 +11339,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208 /* Block */) + if (node.kind !== 211 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 /* TryStatement */ || node.parent.kind === 264 /* CatchClause */) { + if (node.parent.kind === 228 /* TryStatement */ || node.parent.kind === 267 /* CatchClause */) { return false; } } @@ -11140,8 +11352,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 249 /* ExternalModuleReference */ - || kind === 144 /* QualifiedName */ + return kind === 252 /* ExternalModuleReference */ + || kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -11151,70 +11363,70 @@ var ts; var kind = node.kind; return kind === 99 /* ThisKeyword */ || kind === 71 /* Identifier */ - || kind === 180 /* PropertyAccessExpression */; + || kind === 183 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 250 /* JsxElement */ - || kind === 260 /* JsxExpression */ - || kind === 251 /* JsxSelfClosingElement */ + return kind === 253 /* JsxElement */ + || kind === 263 /* JsxExpression */ + || kind === 254 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */ - || kind === 254 /* JsxFragment */; + || kind === 257 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 /* JsxAttribute */ - || kind === 259 /* JsxSpreadAttribute */; + return kind === 260 /* JsxAttribute */ + || kind === 262 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 260 /* JsxExpression */; + || kind === 263 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 /* JsxOpeningElement */ - || kind === 251 /* JsxSelfClosingElement */; + return kind === 255 /* JsxOpeningElement */ + || kind === 254 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 /* CaseClause */ - || kind === 262 /* DefaultClause */; + return kind === 264 /* CaseClause */ + || kind === 265 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 271 /* FirstJSDocNode */ && node.kind <= 289 /* LastJSDocNode */; + return node.kind >= 274 /* FirstJSDocNode */ && node.kind <= 292 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 279 /* JSDocComment */ || isJSDocTag(node); + return node.kind === 282 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 281 /* FirstJSDocTagNode */ && node.kind <= 289 /* LastJSDocTagNode */; + return node.kind >= 284 /* FirstJSDocTagNode */ && node.kind <= 292 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -11223,6 +11435,48 @@ var ts; return !!node.jsDoc && node.jsDoc.length > 0; } ts.hasJSDocNodes = hasJSDocNodes; + /** True if has type node attached to it. */ + /* @internal */ + function hasType(node) { + return !!node.type; + } + ts.hasType = hasType; + /** True if has initializer node attached to it. */ + /* @internal */ + function hasInitializer(node) { + return !!node.initializer; + } + ts.hasInitializer = hasInitializer; + /** True if has initializer node attached to it. */ + /* @internal */ + function hasOnlyExpressionInitializer(node) { + return hasInitializer(node) && !ts.isForStatement(node) && !ts.isForInStatement(node) && !ts.isForOfStatement(node) && !ts.isJsxAttribute(node); + } + ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; + function isObjectLiteralElement(node) { + switch (node.kind) { + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return true; + default: + return false; + } + } + ts.isObjectLiteralElement = isObjectLiteralElement; + /* @internal */ + function isTypeReferenceType(node) { + return node.kind === 161 /* TypeReference */ || node.kind === 205 /* ExpressionWithTypeArguments */; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); /// /// @@ -11262,47 +11516,48 @@ var ts; "false": 86 /* FalseKeyword */, "finally": 87 /* FinallyKeyword */, "for": 88 /* ForKeyword */, - "from": 141 /* FromKeyword */, + "from": 142 /* FromKeyword */, "function": 89 /* FunctionKeyword */, "get": 125 /* GetKeyword */, "if": 90 /* IfKeyword */, "implements": 108 /* ImplementsKeyword */, "import": 91 /* ImportKeyword */, "in": 92 /* InKeyword */, + "infer": 126 /* InferKeyword */, "instanceof": 93 /* InstanceOfKeyword */, "interface": 109 /* InterfaceKeyword */, - "is": 126 /* IsKeyword */, - "keyof": 127 /* KeyOfKeyword */, + "is": 127 /* IsKeyword */, + "keyof": 128 /* KeyOfKeyword */, "let": 110 /* LetKeyword */, - "module": 128 /* ModuleKeyword */, - "namespace": 129 /* NamespaceKeyword */, - "never": 130 /* NeverKeyword */, + "module": 129 /* ModuleKeyword */, + "namespace": 130 /* NamespaceKeyword */, + "never": 131 /* NeverKeyword */, "new": 94 /* NewKeyword */, "null": 95 /* NullKeyword */, - "number": 133 /* NumberKeyword */, - "object": 134 /* ObjectKeyword */, + "number": 134 /* NumberKeyword */, + "object": 135 /* ObjectKeyword */, "package": 111 /* PackageKeyword */, "private": 112 /* PrivateKeyword */, "protected": 113 /* ProtectedKeyword */, "public": 114 /* PublicKeyword */, - "readonly": 131 /* ReadonlyKeyword */, - "require": 132 /* RequireKeyword */, - "global": 142 /* GlobalKeyword */, + "readonly": 132 /* ReadonlyKeyword */, + "require": 133 /* RequireKeyword */, + "global": 143 /* GlobalKeyword */, "return": 96 /* ReturnKeyword */, - "set": 135 /* SetKeyword */, + "set": 136 /* SetKeyword */, "static": 115 /* StaticKeyword */, - "string": 136 /* StringKeyword */, + "string": 137 /* StringKeyword */, "super": 97 /* SuperKeyword */, "switch": 98 /* SwitchKeyword */, - "symbol": 137 /* SymbolKeyword */, + "symbol": 138 /* SymbolKeyword */, "this": 99 /* ThisKeyword */, "throw": 100 /* ThrowKeyword */, "true": 101 /* TrueKeyword */, "try": 102 /* TryKeyword */, - "type": 138 /* TypeKeyword */, + "type": 139 /* TypeKeyword */, "typeof": 103 /* TypeOfKeyword */, - "undefined": 139 /* UndefinedKeyword */, - "unique": 140 /* UniqueKeyword */, + "undefined": 140 /* UndefinedKeyword */, + "unique": 141 /* UniqueKeyword */, "var": 104 /* VarKeyword */, "void": 105 /* VoidKeyword */, "while": 106 /* WhileKeyword */, @@ -11310,7 +11565,7 @@ var ts; "yield": 116 /* YieldKeyword */, "async": 120 /* AsyncKeyword */, "await": 121 /* AwaitKeyword */, - "of": 143 /* OfKeyword */, + "of": 144 /* OfKeyword */, "{": 17 /* OpenBraceToken */, "}": 18 /* CloseBraceToken */, "(": 19 /* OpenParenToken */, @@ -11369,7 +11624,7 @@ var ts; /* As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers IdentifierStart :: - Can contain Unicode 3.0.0 categories: + Can contain Unicode 3.0.0 categories: Uppercase letter (Lu), Lowercase letter (Ll), Titlecase letter (Lt), @@ -11377,7 +11632,7 @@ var ts; Other letter (Lo), or Letter number (Nl). IdentifierPart :: = - Can contain IdentifierStart + Unicode 3.0.0 categories: + Can contain IdentifierStart + Unicode 3.0.0 categories: Non-spacing mark (Mn), Combining spacing mark (Mc), Decimal number (Nd), or @@ -11391,7 +11646,7 @@ var ts; /* As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers IdentifierStart :: - Can contain Unicode 6.2 categories: + Can contain Unicode 6.2 categories: Uppercase letter (Lu), Lowercase letter (Ll), Titlecase letter (Lt), @@ -11399,7 +11654,7 @@ var ts; Other letter (Lo), or Letter number (Nl). IdentifierPart :: - Can contain IdentifierStart + Unicode 6.2 categories: + Can contain IdentifierStart + Unicode 6.2 categories: Non-spacing mark (Mn), Combining spacing mark (Mc), Decimal number (Nd), @@ -11501,7 +11756,9 @@ var ts; ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -11718,7 +11975,7 @@ var ts; } function scanConflictMarkerTrivia(text, pos, error) { if (error) { - error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength); + error(ts.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); } var ch = text.charCodeAt(pos); var len = text.length; @@ -11974,19 +12231,60 @@ var ts; lookAhead: lookAhead, scanRange: scanRange, }; - function error(message, length) { + function error(message, errPos, length) { + if (errPos === void 0) { errPos = pos; } if (onError) { + var oldPos = pos; + pos = errPos; onError(message, length || 0); + pos = oldPos; } } + function scanNumberFragment() { + var start = pos; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + var result = ""; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result += text.substring(start, pos); + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + start = pos; + continue; + } + if (isDigit(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result + text.substring(start, pos); + } function scanNumber() { var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; + var mainFragment = scanNumberFragment(); + var decimalFragment; + var scientificFragment; if (text.charCodeAt(pos) === 46 /* dot */) { pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; + decimalFragment = scanNumberFragment(); } var end = pos; if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { @@ -11994,17 +12292,29 @@ var ts; tokenFlags |= 16 /* Scientific */; if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { + var preNumericPart = pos; + var finalFragment = scanNumberFragment(); + if (!finalFragment) { error(ts.Diagnostics.Digit_expected); } + else { + scientificFragment = text.substring(end, preNumericPart) + finalFragment; + end = pos; + } + } + if (tokenFlags & 512 /* ContainsSeparator */) { + var result = mainFragment; + if (decimalFragment) { + result += "." + decimalFragment; + } + if (scientificFragment) { + result += scientificFragment; + } + return "" + +result; + } + else { + return "" + +(text.substring(start, end)); // No need to use all the fragments; no _ removal needed } - return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -12017,21 +12327,39 @@ var ts; * Scans the given number of hexadecimal digits in the text, * returning -1 if the given number is unavailable. */ - function scanExactNumberOfHexDigits(count) { - return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false); + function scanExactNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false, canHaveSeparators); } /** * Scans as many hexadecimal digits as are available in the text, * returning -1 if the given number of digits was unavailable. */ - function scanMinimumNumberOfHexDigits(count) { - return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true); + function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true, canHaveSeparators); } - function scanHexDigits(minCount, scanAsManyAsPossible) { + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { var digits = 0; var value = 0; + var allowSeparator = false; + var isPreviousTokenSeparator = false; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; } @@ -12046,10 +12374,14 @@ var ts; } pos++; digits++; + isPreviousTokenSeparator = false; } if (digits < minCount) { value = -1; } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } return value; } function scanString(jsxAttributeString) { @@ -12200,7 +12532,7 @@ var ts; } } function scanHexadecimalEscape(numDigits) { - var escapedValue = scanExactNumberOfHexDigits(numDigits); + var escapedValue = scanExactNumberOfHexDigits(numDigits, /*canHaveSeparators*/ false); if (escapedValue >= 0) { return String.fromCharCode(escapedValue); } @@ -12210,7 +12542,7 @@ var ts; } } function scanExtendedUnicodeEscape() { - var escapedValue = scanMinimumNumberOfHexDigits(1); + var escapedValue = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false); var isInvalidExtendedEscape = false; // Validate the value of the digit if (escapedValue < 0) { @@ -12254,7 +12586,7 @@ var ts; if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) { var start_1 = pos; pos += 2; - var value = scanExactNumberOfHexDigits(4); + var value = scanExactNumberOfHexDigits(4, /*canHaveSeparators*/ false); pos = start_1; return value; } @@ -12306,8 +12638,27 @@ var ts; // For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b. // Similarly valid octalIntegerLiteral must have at least one octal digit following o or O. var numberOfDigits = 0; + var separatorAllowed = false; + var isPreviousTokenSeparator = false; while (true) { var ch = text.charCodeAt(pos); + // Numeric seperators are allowed anywhere within a numeric literal, except not at the beginning, or following another separator + if (ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; var valueOfCh = ch - 48 /* _0 */; if (!isDigit(ch) || valueOfCh >= base) { break; @@ -12315,11 +12666,17 @@ var ts; value = value * base + valueOfCh; pos++; numberOfDigits++; + isPreviousTokenSeparator = false; } // Invalid binaryIntegerLiteral or octalIntegerLiteral if (numberOfDigits === 0) { return -1; } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + // Literal ends with underscore - not allowed + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + return value; + } return value; } function scan() { @@ -12509,7 +12866,7 @@ var ts; case 48 /* _0 */: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; - var value = scanMinimumNumberOfHexDigits(1); + var value = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ true); if (value < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); value = 0; @@ -12855,7 +13212,7 @@ var ts; break; } } - tokenValue += text.substr(firstCharPosition, pos - firstCharPosition); + tokenValue += text.substring(firstCharPosition, pos); } return token; } @@ -12878,6 +13235,7 @@ var ts; startPos = pos; tokenPos = pos; var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 9 /* tab */: case 11 /* verticalTab */: @@ -12888,55 +13246,30 @@ var ts; } return token = 5 /* WhitespaceTrivia */; case 64 /* at */: - pos++; return token = 57 /* AtToken */; case 10 /* lineFeed */: case 13 /* carriageReturn */: - pos++; return token = 4 /* NewLineTrivia */; case 42 /* asterisk */: - pos++; return token = 39 /* AsteriskToken */; case 123 /* openBrace */: - pos++; return token = 17 /* OpenBraceToken */; case 125 /* closeBrace */: - pos++; return token = 18 /* CloseBraceToken */; case 91 /* openBracket */: - pos++; return token = 21 /* OpenBracketToken */; case 93 /* closeBracket */: - pos++; return token = 22 /* CloseBracketToken */; case 60 /* lessThan */: - pos++; return token = 27 /* LessThanToken */; - case 62 /* greaterThan */: - pos++; - return token = 29 /* GreaterThanToken */; case 61 /* equals */: - pos++; return token = 58 /* EqualsToken */; case 44 /* comma */: - pos++; return token = 26 /* CommaToken */; case 46 /* dot */: - pos++; - if (text.substr(tokenPos, pos + 2) === "...") { - pos += 2; - return token = 24 /* DotDotDotToken */; - } return token = 23 /* DotToken */; - case 33 /* exclamation */: - pos++; - return token = 51 /* ExclamationToken */; - case 63 /* question */: - pos++; - return token = 55 /* QuestionToken */; } if (isIdentifierStart(ch, 6 /* Latest */)) { - pos++; while (isIdentifierPart(text.charCodeAt(pos), 6 /* Latest */) && pos < end) { pos++; } @@ -12944,7 +13277,7 @@ var ts; return token = 71 /* Identifier */; } else { - return pos += 1, token = 0 /* Unknown */; + return token = 0 /* Unknown */; } } function speculationHelper(callback, isLookahead) { @@ -13042,7 +13375,7 @@ var ts; var SourceFileConstructor; // tslint:enable variable-name function createNode(kind, pos, end) { - if (kind === 269 /* SourceFile */) { + if (kind === 272 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71 /* Identifier */) { @@ -13087,60 +13420,88 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143 /* LastToken */) { + if (!node || node.kind <= 144 /* LastToken */) { return; } switch (node.kind) { - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: + case 148 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 151 /* PropertyDeclaration */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 150 /* PropertySignature */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 268 /* PropertyAssignment */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.initializer); + case 230 /* VariableDeclaration */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.exclamationToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 180 /* BindingElement */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13151,291 +13512,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 166 /* TupleType */: + case 167 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 169 /* ParenthesizedType */: - case 171 /* TypeOperator */: + case 170 /* ConditionalType */: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); + case 171 /* InferType */: + return visitNode(cbNode, node.typeParameter); + case 172 /* ParenthesizedType */: + case 174 /* TypeOperator */: return visitNode(cbNode, node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173 /* MappedType */: + case 176 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return visitNode(cbNode, node.literal); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitNode(cbNode, node.name); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return visitNode(cbNode, node.label); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148 /* Decorator */: + case 149 /* Decorator */: return visitNode(cbNode, node.expression); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -13444,17 +13812,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return visitNode(cbNode, node.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return visitNodes(cbNode, cbNodes, node.typeParameters); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: if (node.typeExpression && - node.typeExpression.kind === 271 /* JSDocTypeExpression */) { + node.typeExpression.kind === 274 /* JSDocTypeExpression */) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -13462,7 +13830,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280 /* JSDocTypeLiteral */: + case 283 /* JSDocTypeLiteral */: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -13470,7 +13838,7 @@ var ts; } } return; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -13572,7 +13940,7 @@ var ts; // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost // all nodes would need extra state on them to store this info. // - // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 // grammar specification. // // An important thing about these context concepts. By default they are effectively inherited @@ -13668,7 +14036,7 @@ var ts; else if (token() === 17 /* OpenBraceToken */ || lookAhead(function () { return token() === 9 /* StringLiteral */; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token); } else { parseExpected(17 /* OpenBraceToken */); @@ -13750,15 +14118,7 @@ var ts; if (comments) { for (var _i = 0, comments_2 = comments; _i < comments_2.length; _i++) { var comment = comments_2[_i]; - var jsDoc = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDoc) { - if (!node.jsDoc) { - node.jsDoc = [jsDoc]; - } - else { - node.jsDoc.push(jsDoc); - } - } + node.jsDoc = ts.append(node.jsDoc, JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); } } return node; @@ -13796,7 +14156,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(269 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(272 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14042,9 +14402,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -14180,7 +14540,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(145 /* ComputedPropertyName */); + var node = createNode(146 /* ComputedPropertyName */); parseExpected(21 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -14295,9 +14655,13 @@ var ts; return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isIdentifierOrPattern(); case 18 /* TypeParameters */: return isIdentifier(); - case 11 /* ArgumentExpressions */: case 15 /* ArrayLiteralMembers */: - return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isStartOfExpression(); + if (token() === 26 /* CommaToken */) { + return true; + } + // falls through + case 11 /* ArgumentExpressions */: + return token() === 24 /* DotDotDotToken */ || isStartOfExpression(); case 16 /* Parameters */: return isStartOfParameter(); case 19 /* TypeArguments */: @@ -14317,7 +14681,7 @@ var ts; function isValidHeritageClauseObjectLiteral() { ts.Debug.assert(token() === 17 /* OpenBraceToken */); if (nextToken() === 18 /* CloseBraceToken */) { - // if we see "extends {}" then only treat the {} as what we're extending (and not + // if we see "extends {}" then only treat the {} as what we're extending (and not // the class body) if we have: // // extends {} { @@ -14352,6 +14716,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } // True if positioned at a list terminator function isListTerminator(kind) { if (token() === 1 /* EndOfFileToken */) { @@ -14401,7 +14769,7 @@ var ts; } function isVariableDeclaratorListTerminator() { // If we can consume a semicolon (either explicitly, or with ASI), then consider us done - // with parsing the list of variable declarators. + // with parsing the list of variable declarators. if (canParseSemicolon()) { return true; } @@ -14506,6 +14874,10 @@ var ts; if (!canReuseNode(node, parsingContext)) { return undefined; } + if (node.jsDocCache) { + // jsDocCache may include tags from parent nodes, which might have been modified. + node.jsDocCache = undefined; + } return node; } function consumeNode(node) { @@ -14579,14 +14951,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153 /* Constructor */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 150 /* PropertyDeclaration */: - case 207 /* SemicolonClassElement */: + case 154 /* Constructor */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 210 /* SemicolonClassElement */: return true; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -14601,8 +14973,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: return true; } } @@ -14611,58 +14983,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 209 /* VariableStatement */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 211 /* ExpressionStatement */: - case 224 /* ThrowStatement */: - case 220 /* ReturnStatement */: - case 222 /* SwitchStatement */: - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 210 /* EmptyStatement */: - case 225 /* TryStatement */: - case 223 /* LabeledStatement */: - case 213 /* DoStatement */: - case 226 /* DebuggerStatement */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 212 /* VariableStatement */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 214 /* ExpressionStatement */: + case 227 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 225 /* SwitchStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 213 /* EmptyStatement */: + case 228 /* TryStatement */: + case 226 /* LabeledStatement */: + case 216 /* DoStatement */: + case 229 /* DebuggerStatement */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 149 /* PropertySignature */: - case 156 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 150 /* PropertySignature */: + case 157 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227 /* VariableDeclaration */) { + if (node.kind !== 230 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -14683,7 +15055,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147 /* Parameter */) { + if (node.kind !== 148 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -14812,7 +15184,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144 /* QualifiedName */, entity.pos); + var node = createNode(145 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -14849,7 +15221,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197 /* TemplateExpression */); + var template = createNode(200 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -14861,7 +15233,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206 /* TemplateSpan */); + var span = createNode(209 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18 /* CloseBraceToken */) { @@ -14869,7 +15241,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); + literal = parseExpectedToken(16 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -14904,7 +15276,7 @@ var ts; // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. if (node.kind === 8 /* NumericLiteral */) { - node.numericLiteralFlags = scanner.getTokenFlags() & 496 /* NumericLiteralFlags */; + node.numericLiteralFlags = scanner.getTokenFlags() & 1008 /* NumericLiteralFlags */; } nextToken(); finishNode(node); @@ -14912,7 +15284,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */); @@ -14921,18 +15293,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159 /* TypePredicate */, lhs.pos); + var node = createNode(160 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170 /* ThisType */); + var node = createNode(173 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272 /* JSDocAllType */); + var result = createNode(275 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -14955,28 +15327,28 @@ var ts; token() === 29 /* GreaterThanToken */ || token() === 58 /* EqualsToken */ || token() === 49 /* BarToken */) { - var result = createNode(273 /* JSDocUnknownType */, pos); + var result = createNode(276 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(274 /* JSDocNullableType */, pos); + var result = createNode(277 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(280 /* JSDocFunctionType */); nextToken(); fillSignature(56 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147 /* Parameter */); + var parameter = createNode(148 /* Parameter */); if (token() === 99 /* ThisKeyword */ || token() === 94 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(56 /* ColonToken */); @@ -14991,13 +15363,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163 /* TypeQuery */); + var node = createNode(164 /* TypeQuery */); parseExpected(103 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(85 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -15014,7 +15386,7 @@ var ts; // // // - // We do *not* want to consume the > as we're consuming the expression for "". + // We do *not* want to consume the `>` as we're consuming the expression for "". node.expression = parseUnaryExpressionOrHigher(); } } @@ -15042,7 +15414,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ true); } function parseParameter() { - var node = createNodeWithJSDoc(147 /* Parameter */); + var node = createNodeWithJSDoc(148 /* Parameter */); if (token() === 99 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -15141,7 +15513,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157 /* ConstructSignature */) { + if (kind === 158 /* ConstructSignature */) { parseExpected(94 /* NewKeyword */); } fillSignature(56 /* ColonToken */, 4 /* Type */, node); @@ -15202,7 +15574,7 @@ var ts; return token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 22 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 158 /* IndexSignature */; + node.kind = 159 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -15212,13 +15584,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55 /* QuestionToken */); if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - node.kind = 151 /* MethodSignature */; + node.kind = 152 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(56 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 149 /* PropertySignature */; + node.kind = 150 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 58 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -15264,10 +15636,10 @@ var ts; } function parseTypeMember() { if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - return parseSignatureMember(156 /* CallSignature */); + return parseSignatureMember(157 /* CallSignature */); } if (token() === 94 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157 /* ConstructSignature */); + return parseSignatureMember(158 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -15281,7 +15653,7 @@ var ts; return token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(164 /* TypeLiteral */); + var node = createNode(165 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -15298,38 +15670,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131 /* ReadonlyKeyword */) { + if (token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + return nextToken() === 132 /* ReadonlyKeyword */; + } + if (token() === 132 /* ReadonlyKeyword */) { nextToken(); } return token() === 21 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 92 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(92 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173 /* MappedType */); + var node = createNode(176 /* MappedType */); parseExpected(17 /* OpenBraceToken */); - node.readonlyToken = parseOptionalToken(131 /* ReadonlyKeyword */); + if (token() === 132 /* ReadonlyKeyword */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + parseExpectedToken(132 /* ReadonlyKeyword */); + } + } parseExpected(21 /* OpenBracketToken */); node.typeParameter = parseMappedTypeParameter(); parseExpected(22 /* CloseBracketToken */); - node.questionToken = parseOptionalToken(55 /* QuestionToken */); + if (token() === 55 /* QuestionToken */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + parseExpectedToken(55 /* QuestionToken */); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseTupleType() { - var node = createNode(166 /* TupleType */); + var node = createNode(167 /* TupleType */); node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169 /* ParenthesizedType */); + var node = createNode(172 /* ParenthesizedType */); parseExpected(19 /* OpenParenToken */); node.type = parseType(); parseExpected(20 /* CloseParenToken */); @@ -15337,7 +15722,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162 /* ConstructorType */) { + if (kind === 163 /* ConstructorType */) { parseExpected(94 /* NewKeyword */); } fillSignature(36 /* EqualsGreaterThanToken */, 4 /* Type */, node); @@ -15348,10 +15733,10 @@ var ts; return token() === 23 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174 /* LiteralType */); + var node = createNode(177 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(196 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 38 /* MinusToken */; nextToken(); } @@ -15372,13 +15757,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 137 /* SymbolKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 138 /* SymbolKeyword */: case 122 /* BooleanKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39 /* AsteriskToken */: @@ -15388,7 +15773,7 @@ var ts; case 89 /* FunctionKeyword */: return parseJSDocFunctionType(); case 51 /* ExclamationToken */: - return parseJSDocNodeWithType(275 /* JSDocNonNullableType */); + return parseJSDocNodeWithType(278 /* JSDocNonNullableType */); case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -15402,7 +15787,7 @@ var ts; return parseTokenNode(); case 99 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -15424,17 +15809,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 140 /* UniqueKeyword */: + case 138 /* SymbolKeyword */: + case 141 /* UniqueKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 103 /* TypeOfKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: case 17 /* OpenBraceToken */: case 21 /* OpenBracketToken */: case 27 /* LessThanToken */: @@ -15445,11 +15830,12 @@ var ts; case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: case 39 /* AsteriskToken */: case 55 /* QuestionToken */: case 51 /* ExclamationToken */: case 24 /* DotDotDotToken */: + case 126 /* InferKeyword */: return true; case 38 /* MinusToken */: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -15474,25 +15860,29 @@ var ts; if (!(contextFlags & 1048576 /* JSDoc */)) { return type; } - type = createJSDocPostfixType(276 /* JSDocOptionalType */, type); + type = createJSDocPostfixType(279 /* JSDocOptionalType */, type); break; case 51 /* ExclamationToken */: - type = createJSDocPostfixType(275 /* JSDocNonNullableType */, type); + type = createJSDocPostfixType(278 /* JSDocNonNullableType */, type); break; case 55 /* QuestionToken */: - type = createJSDocPostfixType(274 /* JSDocNullableType */, type); + // If not in JSDoc and next token is start of a type we have a conditional type + if (!(contextFlags & 1048576 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277 /* JSDocNullableType */, type); break; case 21 /* OpenBracketToken */: parseExpected(21 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(172 /* IndexedAccessType */, type.pos); + var node = createNode(175 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(165 /* ArrayType */, type.pos); + var node = createNode(166 /* ArrayType */, type.pos); node.elementType = type; parseExpected(22 /* CloseBracketToken */); type = finishNode(node); @@ -15511,20 +15901,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171 /* TypeOperator */); + var node = createNode(174 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171 /* InferType */); + parseExpected(126 /* InferKeyword */); + var typeParameter = createNode(147 /* TypeParameter */); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127 /* KeyOfKeyword */: - case 140 /* UniqueKeyword */: + case 128 /* KeyOfKeyword */: + case 141 /* UniqueKeyword */: return parseTypeOperator(operator); + case 126 /* InferKeyword */: + return parseInferType(); case 24 /* DotDotDotToken */: { - var result = createNode(278 /* JSDocVariadicType */); + var result = createNode(281 /* JSDocVariadicType */); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -15547,10 +15947,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); + return parseUnionOrIntersectionType(169 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); + return parseUnionOrIntersectionType(168 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); } function isStartOfFunctionType() { if (token() === 27 /* LessThanToken */) { @@ -15607,7 +16007,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(160 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -15618,7 +16018,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -15628,14 +16028,26 @@ var ts; // apply to 'type' contexts. So we disable these parameters here before moving on. return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161 /* FunctionType */); + return parseFunctionOrConstructorType(162 /* FunctionType */); } if (token() === 94 /* NewKeyword */) { - return parseFunctionOrConstructorType(162 /* ConstructorType */); + return parseFunctionOrConstructorType(163 /* ConstructorType */); } - return parseUnionTypeOrHigher(); + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85 /* ExtendsKeyword */)) { + var node = createNode(170 /* ConditionalType */, type.pos); + node.checkType = type; + // The type following 'extends' is not permitted to be another conditional type + node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); + parseExpected(55 /* QuestionToken */); + node.trueType = parseTypeWorker(); + parseExpected(56 /* ColonToken */); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56 /* ColonToken */) ? parseType() : undefined; @@ -15754,7 +16166,7 @@ var ts; // And production (2) is parsed in "tryParseParenthesizedArrowFunctionExpression". // // If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is - // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done + // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression(); if (arrowExpression) { @@ -15781,7 +16193,7 @@ var ts; // we're in '2' or '3'. Consume the assignment and return. // // Note: we call reScanGreaterToken so that we get an appropriately merged token - // for cases like > > = becoming >>= + // for cases like `> > =` becoming `>>=` if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } @@ -15818,7 +16230,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198 /* YieldExpression */); + var node = createNode(201 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -15840,17 +16252,17 @@ var ts; ts.Debug.assert(token() === 36 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188 /* ArrowFunction */, asyncModifier.pos); + node = createNode(191 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188 /* ArrowFunction */, identifier.pos); + node = createNode(191 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(147 /* Parameter */, identifier.pos); + var parameter = createNode(148 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -15875,7 +16287,7 @@ var ts; // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); arrowFunction.body = (lastToken === 36 /* EqualsGreaterThanToken */ || lastToken === 17 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -15912,7 +16324,7 @@ var ts; var second = nextToken(); if (first === 19 /* OpenParenToken */) { if (second === 20 /* CloseParenToken */) { - // Simple cases: "() =>", "(): ", and "() {". + // Simple cases: "() =>", "(): ", and "() {". // This is an arrow function with no parameters. // The last one is not actually an arrow function, // but this is probably what the user intended. @@ -16042,7 +16454,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188 /* ArrowFunction */); + var node = createNodeWithJSDoc(191 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -16108,12 +16520,14 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(196 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(199 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); - node.whenFalse = parseAssignmentExpressionOrHigher(); + node.colonToken = parseExpectedToken(56 /* ColonToken */); + node.whenFalse = ts.nodeIsPresent(node.colonToken) + ? parseAssignmentExpressionOrHigher() + : createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); return finishNode(node); } function parseBinaryExpressionOrHigher(precedence) { @@ -16121,7 +16535,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 /* InKeyword */ || t === 143 /* OfKeyword */; + return t === 92 /* InKeyword */ || t === 144 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16229,39 +16643,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195 /* BinaryExpression */, left.pos); + var node = createNode(198 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203 /* AsExpression */, left.pos); + var node = createNode(206 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189 /* DeleteExpression */); + var node = createNode(192 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190 /* TypeOfExpression */); + var node = createNode(193 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191 /* VoidExpression */); + var node = createNode(194 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16277,7 +16691,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192 /* AwaitExpression */); + var node = createNode(195 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16320,7 +16734,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 188 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -16417,7 +16831,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -16430,7 +16844,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(197 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -16475,7 +16889,8 @@ var ts; // We don't want to eagerly consume all import keyword as import call expression so we look a head to find "(" // For example: // var foo3 = require("subfolder - // import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression + // import * as foo1 from "module-from-node + // We want this import to be a statement rather than import call expression sourceFile.flags |= 524288 /* PossiblyContainsDynamicImport */; expression = parseTokenNode(); } @@ -16523,7 +16938,7 @@ var ts; // treated as the invocation of "new Foo". We disambiguate that in code (to match // the original grammar) by making sure that if we see an ObjectCreationExpression // we always consume arguments if they are there. So we treat "new Foo()" as an - // object creation only, and not at all as an invocation) Another way to think + // object creation only, and not at all as an invocation. Another way to think // about this is that for every "new" that we see, we will consume an argument list if // it is there as part of the *associated* object creation node. Any additional // argument lists we see, will become invocation expressions. @@ -16544,9 +16959,9 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(180 /* PropertyAccessExpression */, expression.pos); + var node = createNode(183 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - parseExpectedToken(23 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } @@ -16569,8 +16984,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252 /* JsxOpeningElement */) { - var node = createNode(250 /* JsxElement */, opening.pos); + if (opening.kind === 255 /* JsxOpeningElement */) { + var node = createNode(253 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -16579,15 +16994,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255 /* JsxOpeningFragment */) { - var node = createNode(254 /* JsxFragment */, opening.pos); + else if (opening.kind === 258 /* JsxOpeningFragment */) { + var node = createNode(257 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 254 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -16602,7 +17017,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195 /* BinaryExpression */, result.pos); + var badNode = createNode(198 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -16666,7 +17081,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258 /* JsxAttributes */); + var jsxAttributes = createNode(261 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -16675,7 +17090,7 @@ var ts; parseExpected(27 /* LessThanToken */); if (token() === 29 /* GreaterThanToken */) { parseExpected(29 /* GreaterThanToken */); - var node_1 = createNode(255 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(258 /* JsxOpeningFragment */, fullStart); return finishNode(node_1); } var tagName = parseJsxElementName(); @@ -16685,7 +17100,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(252 /* JsxOpeningElement */, fullStart); + node = createNode(255 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -16697,7 +17112,7 @@ var ts; parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(251 /* JsxSelfClosingElement */, fullStart); + node = createNode(254 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -16713,7 +17128,7 @@ var ts; var expression = token() === 99 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23 /* DotToken */)) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16721,7 +17136,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260 /* JsxExpression */); + var node = createNode(263 /* JsxExpression */); parseExpected(17 /* OpenBraceToken */); if (token() !== 18 /* CloseBraceToken */) { node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); @@ -16741,7 +17156,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257 /* JsxAttribute */); + var node = createNode(260 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 58 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -16756,7 +17171,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259 /* JsxSpreadAttribute */); + var node = createNode(262 /* JsxSpreadAttribute */); parseExpected(17 /* OpenBraceToken */); parseExpected(24 /* DotDotDotToken */); node.expression = parseExpression(); @@ -16764,7 +17179,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253 /* JsxClosingElement */); + var node = createNode(256 /* JsxClosingElement */); parseExpected(28 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -16777,7 +17192,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256 /* JsxClosingFragment */); + var node = createNode(259 /* JsxClosingFragment */); parseExpected(28 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -16793,7 +17208,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185 /* TypeAssertionExpression */); + var node = createNode(188 /* TypeAssertionExpression */); parseExpected(27 /* LessThanToken */); node.type = parseType(); parseExpected(29 /* GreaterThanToken */); @@ -16804,7 +17219,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16812,14 +17227,14 @@ var ts; } if (token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(207 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(21 /* OpenBracketToken */)) { - var indexedAccess = createNode(181 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(184 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -16835,7 +17250,7 @@ var ts; continue; } if (token() === 13 /* NoSubstitutionTemplateLiteral */ || token() === 14 /* TemplateHead */) { - var tagExpression = createNode(184 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(187 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -16858,7 +17273,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -16866,7 +17281,7 @@ var ts; continue; } else if (token() === 19 /* OpenParenToken */) { - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -16887,7 +17302,7 @@ var ts; } var typeArguments = parseDelimitedList(19 /* TypeArguments */, parseType); if (!parseExpected(29 /* GreaterThanToken */)) { - // If it doesn't have the closing > then it's definitely not an type argument list. + // If it doesn't have the closing `>` then it's definitely not an type argument list. return undefined; } // If we have a '<', then only parse this as a argument list if the type arguments @@ -16976,28 +17391,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(189 /* ParenthesizedExpression */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199 /* SpreadElement */); + var node = createNode(202 /* SpreadElement */); parseExpected(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 26 /* CommaToken */ ? createNode(201 /* OmittedExpression */) : + token() === 26 /* CommaToken */ ? createNode(204 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178 /* ArrayLiteralExpression */); + var node = createNode(181 /* ArrayLiteralExpression */); parseExpected(21 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17009,17 +17424,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(24 /* DotDotDotToken */)) { - node.kind = 267 /* SpreadAssignment */; + node.kind = 270 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } var asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -17036,7 +17451,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 /* CommaToken */ || token() === 18 /* CloseBraceToken */ || token() === 58 /* EqualsToken */); if (isShorthandPropertyAssignment) { - node.kind = 266 /* ShorthandPropertyAssignment */; + node.kind = 269 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(58 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -17044,14 +17459,14 @@ var ts; } } else { - node.kind = 265 /* PropertyAssignment */; + node.kind = 268 /* PropertyAssignment */; parseExpected(56 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179 /* ObjectLiteralExpression */); + var node = createNode(182 /* ObjectLiteralExpression */); parseExpected(17 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17070,7 +17485,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(187 /* FunctionExpression */); + var node = createNodeWithJSDoc(190 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); @@ -17095,12 +17510,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94 /* NewKeyword */); if (parseOptional(23 /* DotToken */)) { - var node_2 = createNode(205 /* MetaProperty */, fullStart); + var node_2 = createNode(208 /* MetaProperty */, fullStart); node_2.keywordToken = 94 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183 /* NewExpression */, fullStart); + var node = createNode(186 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19 /* OpenParenToken */) { @@ -17110,7 +17525,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208 /* Block */); + var node = createNode(211 /* Block */); if (parseExpected(17 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17143,12 +17558,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210 /* EmptyStatement */); + var node = createNode(213 /* EmptyStatement */); parseExpected(25 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(212 /* IfStatement */); + var node = createNode(215 /* IfStatement */); parseExpected(90 /* IfKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17158,7 +17573,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213 /* DoStatement */); + var node = createNode(216 /* DoStatement */); parseExpected(81 /* DoKeyword */); node.statement = parseStatement(); parseExpected(106 /* WhileKeyword */); @@ -17173,7 +17588,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214 /* WhileStatement */); + var node = createNode(217 /* WhileStatement */); parseExpected(106 /* WhileKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17196,8 +17611,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143 /* OfKeyword */) : parseOptional(143 /* OfKeyword */)) { - var forOfStatement = createNode(217 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(144 /* OfKeyword */) : parseOptional(144 /* OfKeyword */)) { + var forOfStatement = createNode(220 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -17205,14 +17620,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92 /* InKeyword */)) { - var forInStatement = createNode(216 /* ForInStatement */, pos); + var forInStatement = createNode(219 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215 /* ForStatement */, pos); + var forStatement = createNode(218 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(25 /* SemicolonToken */); if (token() !== 25 /* SemicolonToken */ && token() !== 20 /* CloseParenToken */) { @@ -17230,7 +17645,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); + parseExpected(kind === 222 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17238,7 +17653,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220 /* ReturnStatement */); + var node = createNode(223 /* ReturnStatement */); parseExpected(96 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -17247,7 +17662,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221 /* WithStatement */); + var node = createNode(224 /* WithStatement */); parseExpected(107 /* WithKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17256,7 +17671,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261 /* CaseClause */); + var node = createNode(264 /* CaseClause */); parseExpected(73 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(56 /* ColonToken */); @@ -17264,7 +17679,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262 /* DefaultClause */); + var node = createNode(265 /* DefaultClause */); parseExpected(79 /* DefaultKeyword */); parseExpected(56 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -17274,12 +17689,12 @@ var ts; return token() === 73 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222 /* SwitchStatement */); + var node = createNode(225 /* SwitchStatement */); parseExpected(98 /* SwitchKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); - var caseBlock = createNode(236 /* CaseBlock */); + var caseBlock = createNode(239 /* CaseBlock */); parseExpected(17 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(18 /* CloseBraceToken */); @@ -17294,7 +17709,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(224 /* ThrowStatement */); + var node = createNode(227 /* ThrowStatement */); parseExpected(100 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -17302,7 +17717,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(225 /* TryStatement */); + var node = createNode(228 /* TryStatement */); parseExpected(102 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -17315,7 +17730,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264 /* CatchClause */); + var result = createNode(267 /* CatchClause */); parseExpected(74 /* CatchKeyword */); if (parseOptional(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -17329,7 +17744,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226 /* DebuggerStatement */); + var node = createNode(229 /* DebuggerStatement */); parseExpected(78 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -17341,12 +17756,12 @@ var ts; var node = createNodeWithJSDoc(0 /* Unknown */); var expression = allowInAnd(parseExpression); if (expression.kind === 71 /* Identifier */ && parseOptional(56 /* ColonToken */)) { - node.kind = 223 /* LabeledStatement */; + node.kind = 226 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211 /* ExpressionStatement */; + node.kind = 214 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -17400,10 +17815,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117 /* AbstractKeyword */: case 120 /* AsyncKeyword */: @@ -17411,14 +17826,14 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 114 /* PublicKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142 /* GlobalKeyword */: + case 143 /* GlobalKeyword */: nextToken(); return token() === 17 /* OpenBraceToken */ || token() === 71 /* Identifier */ || token() === 84 /* ExportKeyword */; case 91 /* ImportKeyword */: @@ -17479,17 +17894,17 @@ var ts; case 120 /* AsyncKeyword */: case 124 /* DeclareKeyword */: case 109 /* InterfaceKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: - case 138 /* TypeKeyword */: - case 142 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 143 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -17513,16 +17928,16 @@ var ts; case 17 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 104 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); case 110 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); } break; case 89 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(229 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(232 /* FunctionDeclaration */)); case 75 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(230 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(233 /* ClassDeclaration */)); case 90 /* IfKeyword */: return parseIfStatement(); case 81 /* DoKeyword */: @@ -17532,9 +17947,9 @@ var ts; case 88 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 77 /* ContinueKeyword */: - return parseBreakOrContinueStatement(218 /* ContinueStatement */); + return parseBreakOrContinueStatement(221 /* ContinueStatement */); case 72 /* BreakKeyword */: - return parseBreakOrContinueStatement(219 /* BreakStatement */); + return parseBreakOrContinueStatement(222 /* BreakStatement */); case 96 /* ReturnKeyword */: return parseReturnStatement(); case 107 /* WithKeyword */: @@ -17554,9 +17969,9 @@ var ts; return parseDeclaration(); case 120 /* AsyncKeyword */: case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: case 83 /* EnumKeyword */: @@ -17567,8 +17982,8 @@ var ts; case 114 /* PublicKeyword */: case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: - case 142 /* GlobalKeyword */: + case 132 /* ReadonlyKeyword */: + case 143 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -17606,13 +18021,13 @@ var ts; return parseClassDeclaration(node); case 109 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 83 /* EnumKeyword */: return parseEnumDeclaration(node); - case 142 /* GlobalKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 143 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 91 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -17631,7 +18046,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(248 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -17653,16 +18068,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 26 /* CommaToken */) { - return createNode(201 /* OmittedExpression */); + return createNode(204 /* OmittedExpression */); } - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -17678,14 +18093,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175 /* ObjectBindingPattern */); + var node = createNode(178 /* ObjectBindingPattern */); parseExpected(17 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176 /* ArrayBindingPattern */); + var node = createNode(179 /* ArrayBindingPattern */); parseExpected(21 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(22 /* CloseBracketToken */); @@ -17707,7 +18122,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227 /* VariableDeclaration */); + var node = createNode(230 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 /* Identifier */ && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -17720,7 +18135,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228 /* VariableDeclarationList */); + var node = createNode(231 /* VariableDeclarationList */); switch (token()) { case 104 /* VarKeyword */: break; @@ -17743,7 +18158,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 143 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -17758,13 +18173,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 209 /* VariableStatement */; + node.kind = 212 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229 /* FunctionDeclaration */; + node.kind = 232 /* FunctionDeclaration */; parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); node.name = ts.hasModifier(node, 512 /* Default */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -17775,14 +18190,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153 /* Constructor */; + node.kind = 154 /* Constructor */; parseExpected(123 /* ConstructorKeyword */); fillSignature(56 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152 /* MethodDeclaration */; + node.kind = 153 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; @@ -17791,7 +18206,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150 /* PropertyDeclaration */; + node.kind = 151 /* PropertyDeclaration */; if (!node.questionToken && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -17801,8 +18216,8 @@ var ts; // off. The grammar would look something like this: // // MemberVariableDeclaration[Yield]: - // AccessibilityModifier_opt PropertyName TypeAnnotation_opt Initializer_opt[In]; - // AccessibilityModifier_opt static_opt PropertyName TypeAnnotation_opt Initializer_opt[In, ?Yield]; + // AccessibilityModifier_opt PropertyName TypeAnnotation_opt Initializer_opt[In]; + // AccessibilityModifier_opt static_opt PropertyName TypeAnnotation_opt Initializer_opt[In, ?Yield]; // // The checker may still error in the static case to explicitly disallow the yield expression. node.initializer = ts.hasModifier(node, 32 /* Static */) @@ -17835,7 +18250,7 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; default: return false; @@ -17876,7 +18291,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 135 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 136 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -17884,6 +18299,7 @@ var ts; switch (token()) { case 19 /* OpenParenToken */: // Method declaration case 27 /* LessThanToken */: // Generic Method declaration + case 51 /* ExclamationToken */: // Non-null assertion on property name case 56 /* ColonToken */: // Type Annotation for declaration case 58 /* EqualsToken */: // Initializer for declaration case 55 /* QuestionToken */:// Not valid, but permitted so that it gets caught later on. @@ -17907,7 +18323,7 @@ var ts; if (!parseOptional(57 /* AtToken */)) { break; } - var decorator = createNode(148 /* Decorator */, decoratorStart); + var decorator = createNode(149 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -17957,7 +18373,7 @@ var ts; } function parseClassElement() { if (token() === 25 /* SemicolonToken */) { - var result = createNode(207 /* SemicolonClassElement */); + var result = createNode(210 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -17965,10 +18381,10 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } if (token() === 123 /* ConstructorKeyword */) { return parseConstructorDeclaration(node); @@ -17994,10 +18410,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 200 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 203 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 233 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -18040,7 +18456,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 /* ExtendsKeyword */ || tok === 108 /* ImplementsKeyword */) { - var node = createNode(263 /* HeritageClause */); + var node = createNode(266 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -18049,7 +18465,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -18066,7 +18482,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231 /* InterfaceDeclaration */; + node.kind = 234 /* InterfaceDeclaration */; parseExpected(109 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -18075,8 +18491,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232 /* TypeAliasDeclaration */; - parseExpected(138 /* TypeKeyword */); + node.kind = 235 /* TypeAliasDeclaration */; + parseExpected(139 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58 /* EqualsToken */); @@ -18089,13 +18505,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(268 /* EnumMember */); + var node = createNodeWithJSDoc(271 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233 /* EnumDeclaration */; + node.kind = 236 /* EnumDeclaration */; parseExpected(83 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(17 /* OpenBraceToken */)) { @@ -18108,7 +18524,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235 /* ModuleBlock */); + var node = createNode(238 /* ModuleBlock */); if (parseExpected(17 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(18 /* CloseBraceToken */); @@ -18119,7 +18535,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234 /* ModuleDeclaration */; + node.kind = 237 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -18131,8 +18547,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234 /* ModuleDeclaration */; - if (token() === 142 /* GlobalKeyword */) { + node.kind = 237 /* ModuleDeclaration */; + if (token() === 143 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18151,15 +18567,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142 /* GlobalKeyword */) { + if (token() === 143 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129 /* NamespaceKeyword */)) { + else if (parseOptional(130 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(128 /* ModuleKeyword */); + parseExpected(129 /* ModuleKeyword */); if (token() === 9 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -18167,7 +18583,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 /* RequireKeyword */ && + return token() === 133 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -18177,9 +18593,9 @@ var ts; return nextToken() === 41 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 237 /* NamespaceExportDeclaration */; + node.kind = 240 /* NamespaceExportDeclaration */; parseExpected(118 /* AsKeyword */); - parseExpected(129 /* NamespaceKeyword */); + parseExpected(130 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -18190,12 +18606,12 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 /* CommaToken */ && token() !== 141 /* FromKeyword */) { + if (token() !== 26 /* CommaToken */ && token() !== 142 /* FromKeyword */) { return parseImportEqualsDeclaration(node, identifier); } } // Import statement - node.kind = 239 /* ImportDeclaration */; + node.kind = 242 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -18203,14 +18619,14 @@ var ts; token() === 39 /* AsteriskToken */ || // import * token() === 17 /* OpenBraceToken */) { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238 /* ImportEqualsDeclaration */; + node.kind = 241 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(58 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -18224,7 +18640,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(240 /* ImportClause */, fullStart); + var importClause = createNode(243 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18234,7 +18650,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(26 /* CommaToken */)) { - importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(242 /* NamedImports */); + importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(245 /* NamedImports */); } return finishNode(importClause); } @@ -18244,8 +18660,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(249 /* ExternalModuleReference */); - parseExpected(132 /* RequireKeyword */); + var node = createNode(252 /* ExternalModuleReference */); + parseExpected(133 /* RequireKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(20 /* CloseParenToken */); @@ -18267,7 +18683,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(241 /* NamespaceImport */); + var namespaceImport = createNode(244 /* NamespaceImport */); parseExpected(39 /* AsteriskToken */); parseExpected(118 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -18282,14 +18698,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 242 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 245 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247 /* ExportSpecifier */); + return parseImportOrExportSpecifier(250 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243 /* ImportSpecifier */); + return parseImportOrExportSpecifier(246 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18314,25 +18730,25 @@ var ts; else { node.name = identifierName; } - if (kind === 243 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 246 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245 /* ExportDeclaration */; + node.kind = 248 /* ExportDeclaration */; if (parseOptional(39 /* AsteriskToken */)) { - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(249 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 141 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(141 /* FromKeyword */); + if (token() === 142 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18340,7 +18756,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244 /* ExportAssignment */; + node.kind = 247 /* ExportAssignment */; if (parseOptional(58 /* EqualsToken */)) { node.isExportEquals = true; } @@ -18435,10 +18851,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1 /* Export */) - || node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */ - || node.kind === 239 /* ImportDeclaration */ - || node.kind === 244 /* ExportAssignment */ - || node.kind === 245 /* ExportDeclaration */ + || node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */ + || node.kind === 242 /* ImportDeclaration */ + || node.kind === 247 /* ExportAssignment */ + || node.kind === 248 /* ExportDeclaration */ ? node : undefined; }); @@ -18491,7 +18907,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(271 /* JSDocTypeExpression */, scanner.getTokenPos()); + var result = createNode(274 /* JSDocTypeExpression */, scanner.getTokenPos()); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17 /* OpenBraceToken */); result.type = doInsideOfContext(1048576 /* JSDoc */, parseType); if (!mayOmitBraces || hasBrace) { @@ -18563,7 +18979,6 @@ var ts; scanner.scanRange(start + 3, length - 5, function () { // Initially we can parse out a tag. We also have seen a starting asterisk. // This is so that /** * @type */ doesn't parse. - var advanceToken = true; var state = 1 /* SawAsterisk */; var margin = undefined; // + 4 for leading '/** ' @@ -18575,17 +18990,17 @@ var ts; comments.push(text); indent += text.length; } - nextJSDocToken(); - while (token() === 5 /* WhitespaceTrivia */) { - nextJSDocToken(); + var t = nextJSDocToken(); + while (t === 5 /* WhitespaceTrivia */) { + t = nextJSDocToken(); } - if (token() === 4 /* NewLineTrivia */) { + if (t === 4 /* NewLineTrivia */) { state = 0 /* BeginningOfLine */; indent = 0; - nextJSDocToken(); + t = nextJSDocToken(); } - while (token() !== 1 /* EndOfFileToken */) { - switch (token()) { + loop: while (true) { + switch (t) { case 57 /* AtToken */: if (state === 0 /* BeginningOfLine */ || state === 1 /* SawAsterisk */) { removeTrailingNewlines(comments); @@ -18594,7 +19009,6 @@ var ts; // Real-world comments may break this rule, so "BeginningOfLine" will not be a real line beginning // for malformed examples like `/** @param {string} x @returns {number} the length */` state = 0 /* BeginningOfLine */; - advanceToken = false; margin = undefined; indent++; } @@ -18639,19 +19053,14 @@ var ts; indent += whitespace.length; break; case 1 /* EndOfFileToken */: - break; + break loop; default: // anything other than whitespace or asterisk at the beginning of the line starts the comment text state = 2 /* SavingComments */; pushComment(scanner.getTokenText()); break; } - if (advanceToken) { - nextJSDocToken(); - } - else { - advanceToken = true; - } + t = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); @@ -18675,7 +19084,7 @@ var ts; content.charCodeAt(start + 3) !== 42 /* asterisk */; } function createJSDocComment() { - var result = createNode(279 /* JSDocComment */, start); + var result = createNode(282 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -18736,7 +19145,8 @@ var ts; // a badly malformed tag should not be added to the list of tags return; } - addTag(tag, parseTagComments(indent + tag.end - tag.pos)); + tag.comment = parseTagComments(indent + tag.end - tag.pos); + addTag(tag); } function parseTagComments(indent) { var comments = []; @@ -18749,8 +19159,9 @@ var ts; comments.push(text); indent += text.length; } - while (token() !== 57 /* AtToken */ && token() !== 1 /* EndOfFileToken */) { - switch (token()) { + var tok = token(); + loop: while (true) { + switch (tok) { case 4 /* NewLineTrivia */: if (state >= 1 /* SawAsterisk */) { state = 0 /* BeginningOfLine */; @@ -18759,8 +19170,11 @@ var ts; indent = 0; break; case 57 /* AtToken */: + scanner.setTextPos(scanner.getTextPos() - 1); + // falls through + case 1 /* EndOfFileToken */: // Done - break; + break loop; case 5 /* WhitespaceTrivia */: if (state === 2 /* SavingComments */) { pushComment(scanner.getTokenText()); @@ -18778,7 +19192,7 @@ var ts; if (state === 0 /* BeginningOfLine */) { // leading asterisks start recording on the *next* (non-whitespace) token state = 1 /* SawAsterisk */; - indent += scanner.getTokenText().length; + indent += 1; break; } // record the * as a comment @@ -18788,24 +19202,19 @@ var ts; pushComment(scanner.getTokenText()); break; } - if (token() === 57 /* AtToken */) { - // Done - break; - } - nextJSDocToken(); + tok = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); - return comments; + return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(atToken, tagName) { - var result = createNode(281 /* JSDocTag */, atToken.pos); + var result = createNode(284 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); } - function addTag(tag, comments) { - tag.comment = comments.join(""); + function addTag(tag) { if (!tags) { tags = [tag]; tagsPos = tag.pos; @@ -18835,9 +19244,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object"; @@ -18853,8 +19262,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Parameter */ ? - createNode(284 /* JSDocParameterTag */, atToken.pos) : - createNode(289 /* JSDocPropertyTag */, atToken.pos); + createNode(287 /* JSDocParameterTag */, atToken.pos) : + createNode(292 /* JSDocPropertyTag */, atToken.pos); var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name); if (nestedTypeLiteral) { typeExpression = nestedTypeLiteral; @@ -18870,21 +19279,18 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(271 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(274 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_2 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(1 /* Parameter */, name); })) { - if (!children) { - children = []; - } - children.push(child); + children = ts.append(children, child); } if (children) { - jsdocTypeLiteral = createNode(280 /* JSDocTypeLiteral */, start_2); + jsdocTypeLiteral = createNode(283 /* JSDocTypeLiteral */, start_2); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 165 /* ArrayType */) { + if (typeExpression.type.kind === 166 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -18893,27 +19299,27 @@ var ts; } } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 285 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(285 /* JSDocReturnTag */, atToken.pos); + var result = createNode(288 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 286 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 289 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(286 /* JSDocTypeTag */, atToken.pos); + var result = createNode(289 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAugmentsTag(atToken, tagName) { - var result = createNode(282 /* JSDocAugmentsTag */, atToken.pos); + var result = createNode(285 /* JSDocAugmentsTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); @@ -18921,7 +19327,7 @@ var ts; } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(17 /* OpenBraceToken */); - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -18933,7 +19339,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(/*createIfMissing*/ true); while (parseOptional(23 /* DotToken */)) { - var prop = createNode(180 /* PropertyAccessExpression */, node.pos); + var prop = createNode(183 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -18941,7 +19347,7 @@ var ts; return node; } function parseClassTag(atToken, tagName) { - var tag = createNode(283 /* JSDocClassTag */, atToken.pos); + var tag = createNode(286 /* JSDocClassTag */, atToken.pos); tag.atToken = atToken; tag.tagName = tagName; return finishNode(tag); @@ -18949,7 +19355,7 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(288 /* JSDocTypedefTag */, atToken.pos); + var typedefTag = createNode(291 /* JSDocTypedefTag */, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(/*flags*/ 0); @@ -18974,9 +19380,9 @@ var ts; var start_3 = scanner.getStartPos(); while (child = tryParse(function () { return parseChildParameterOrPropertyTag(0 /* Property */); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(280 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(283 /* JSDocTypeLiteral */, start_3); } - if (child.kind === 286 /* JSDocTypeTag */) { + if (child.kind === 289 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -18985,14 +19391,11 @@ var ts; } } else { - if (!jsdocTypeLiteral.jsDocPropertyTags) { - jsdocTypeLiteral.jsDocPropertyTags = []; - } - jsdocTypeLiteral.jsDocPropertyTags.push(child); + jsdocTypeLiteral.jsDocPropertyTags = ts.append(jsdocTypeLiteral.jsDocPropertyTags, child); } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 165 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 166 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -19005,7 +19408,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(23 /* DotToken */)) { - var jsDocNamespaceNode = createNode(234 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(237 /* ModuleDeclaration */, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4 /* NestedNamespace */); @@ -19033,12 +19436,11 @@ var ts; var canParseTag = true; var seenAsterisk = false; while (true) { - nextJSDocToken(); - switch (token()) { + switch (nextJSDocToken()) { case 57 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target); - if (child && child.kind === 284 /* JSDocParameterTag */ && + if (child && child.kind === 287 /* JSDocParameterTag */ && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } @@ -19074,34 +19476,44 @@ var ts; if (!tagName) { return false; } + var t; switch (tagName.escapedText) { case "type": return target === 0 /* Property */ && parseTypeTag(atToken, tagName); case "prop": case "property": - return target === 0 /* Property */ && parseParameterOrPropertyTag(atToken, tagName, target); + t = 0 /* Property */; + break; case "arg": case "argument": case "param": - return target === 1 /* Parameter */ && parseParameterOrPropertyTag(atToken, tagName, target); + t = 1 /* Parameter */; + break; + default: + return false; } - return false; + if (target !== t) { + return false; + } + var tag = parseParameterOrPropertyTag(atToken, tagName, target); + tag.comment = parseTagComments(tag.end - tag.pos); + return tag; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 287 /* JSDocTemplateTag */; })) { + if (ts.some(tags, ts.isJSDocTemplateTag)) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } // Type parameter list looks like '@template T,U,V' var typeParameters = []; var typeParametersPos = getNodePos(); while (true) { - var name = parseJSDocIdentifierName(); + var typeParameter = createNode(147 /* TypeParameter */); + var name = parseJSDocIdentifierNameWithOptionalBraces(); skipWhitespace(); if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(146 /* TypeParameter */, name.pos); typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); @@ -19113,13 +19525,21 @@ var ts; break; } } - var result = createNode(287 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(290 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); finishNode(result); return result; } + function parseJSDocIdentifierNameWithOptionalBraces() { + var parsedBrace = parseOptional(17 /* OpenBraceToken */); + var res = parseJSDocIdentifierName(); + if (parsedBrace) { + parseExpected(18 /* CloseBraceToken */); + } + return res; + } function nextJSDocToken() { return currentToken = scanner.scanJSDocToken(); } @@ -19298,7 +19718,7 @@ var ts; // We may need to update both the 'pos' and the 'end' of the element. // If the 'pos' is before the start of the change, then we don't need to touch it. // If it isn't, then the 'pos' must be inside the change. How we update it will - // depend if delta is positive or negative. If delta is positive then we have + // depend if delta is positive or negative. If delta is positive then we have // something like: // // -------------------AAA----------------- @@ -19322,7 +19742,7 @@ var ts; element.pos = Math.min(element.pos, changeRangeNewEnd); // If the 'end' is after the change range, then we always adjust it by the delta // amount. However, if the end is in the change range, then how we adjust it - // will depend on if delta is positive or negative. If delta is positive then we + // will depend on if delta is positive or negative. If delta is positive then we // have something like: // // -------------------AAA----------------- @@ -19786,12 +20206,14 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", + "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, - description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation }, { name: "allowJs", @@ -19826,6 +20248,12 @@ var ts; category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_d_ts_file, }, + { + name: "emitDeclarationOnly", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Only_emit_d_ts_declaration_files, + }, { name: "sourceMap", type: "boolean", @@ -20039,6 +20467,13 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "esModuleInterop", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports + }, { name: "preserveSymlinks", type: "boolean", @@ -20329,19 +20764,19 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1 /* ES5 */, - strict: true + strict: true, + esModuleInterop: true }; var optionNameMapCache; /* @internal */ function convertEnableAutoDiscoveryToEnable(typeAcquisition) { // Convert deprecated typingOptions.enableAutoDiscovery to typeAcquisition.enable if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { - var result = { + return { enable: typeAcquisition.enableAutoDiscovery, include: typeAcquisition.include || [], exclude: typeAcquisition.exclude || [] }; - return result; } return typeAcquisition; } @@ -20635,7 +21070,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265 /* PropertyAssignment */) { + if (element.kind !== 268 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -20710,13 +21145,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (valueExpression.operator !== 38 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -20733,7 +21168,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -20953,9 +21388,9 @@ var ts; return x === undefined || x === null; } function directoryOfCombinedPath(fileName, basePath) { - // Use the `identity` function to avoid canonicalizing the path, as it must remain noncanonical + // Use the `getNormalizedAbsolutePath` function to avoid canonicalizing the path, as it must remain noncanonical // until consistient casing errors are reported - return ts.getDirectoryPath(ts.toPath(fileName, basePath, ts.identity)); + return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath)); } /** * Parse the contents of a config file from json or json source file (tsconfig.json). @@ -20972,8 +21407,7 @@ var ts; if (extraFileExtensions === void 0) { extraFileExtensions = []; } ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); var errors = []; - var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors); + var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); var raw = parsedConfig.raw; var options = ts.extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName; @@ -21059,20 +21493,20 @@ var ts; * This *just* extracts options/include/exclude/files out of a config file. * It does *not* resolve the included files. */ - function parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors) { + function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors) { basePath = ts.normalizeSlashes(basePath); - var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); + var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))); return { raw: json || convertToObject(sourceFile, errors) }; } var ownConfig = json ? - parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) : - parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors); + parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : + parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); - var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { var baseRaw_1 = extendedConfig.raw; var raw_1 = ownConfig.raw; @@ -21094,7 +21528,7 @@ var ts; } return ownConfig; } - function parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { if (ts.hasProperty(json, "excludes")) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } @@ -21110,12 +21544,12 @@ var ts; } else { var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, getCanonicalFileName, errors, ts.createCompilerDiagnostic); + extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, ts.createCompilerDiagnostic); } } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { var options = getDefaultCompilerOptions(configFileName); var typeAcquisition, typingOptionstypeAcquisition; var extendedConfigPath; @@ -21133,7 +21567,7 @@ var ts; switch (key) { case "extends": var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(value, host, newBase, getCanonicalFileName, errors, function (message, arg0) { + extendedConfigPath = getExtendsConfigPath(value, host, newBase, errors, function (message, arg0) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0); }); return; @@ -21167,14 +21601,14 @@ var ts; } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function getExtendsConfigPath(extendedConfig, host, basePath, getCanonicalFileName, errors, createDiagnostic) { + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { extendedConfig = ts.normalizeSlashes(extendedConfig); // If the path isn't a rooted or relative path, don't try to resolve it (we reserve the right to special case module-id like paths in the future) if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../"))) { errors.push(createDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); return undefined; } - var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); + var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath); if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) { extendedConfigPath = extendedConfigPath + ".json"; if (!host.fileExists(extendedConfigPath)) { @@ -21184,7 +21618,7 @@ var ts; } return extendedConfigPath; } - function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors) { + function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) { var extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); if (sourceFile) { (sourceFile.extendedSourceFiles || (sourceFile.extendedSourceFiles = [])).push(extendedResult.fileName); @@ -21194,13 +21628,13 @@ var ts; return undefined; } var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), getCanonicalFileName, resolutionStack, errors); + var extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors); if (sourceFile) { (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); } if (isSuccessfulParsedTsconfig(extendedConfig)) { // Update the paths to reflect base path - var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; var mapPropertiesInRawIfNotUndefined = function (propertyName) { if (raw_2[propertyName]) { @@ -21239,7 +21673,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -21249,8 +21683,7 @@ var ts; return options; } function getDefaultTypeAcquisition(configFileName) { - var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; - return options; + return { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { var options = getDefaultTypeAcquisition(configFileName); @@ -21342,20 +21775,6 @@ var ts; * \/?$ # matches an optional trailing directory separator at the end of the string. */ var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; - /** - * Tests for a path with multiple recursive directory wildcards. - * Matches **\** and **\a\**, but not **\a**b. - * - * NOTE: used \ in place of / above to avoid issues with multiline comments. - * - * Breakdown: - * (^|\/) # matches either the beginning of the string or a directory separator. - * \*\*\/ # matches a recursive directory wildcard "**" followed by a directory separator. - * (.*\/)? # optionally matches any number of characters followed by a directory separator. - * \*\* # matches a recursive directory wildcard "**" - * ($|\/) # matches either the end of the string or a directory separator. - */ - var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; /** * Tests for a path where .. appears after a recursive directory wildcard. * Matches **\..\*, **\a\..\*, and **\.., but not ..\**\* @@ -21524,9 +21943,6 @@ var ts; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } - else if (invalidMultipleRecursionPatterns.test(spec)) { - return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; - } else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } @@ -21727,9 +22143,9 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, + resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } @@ -22283,8 +22699,8 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); + var _a = result.value, resolved = _a.resolved, originalPath = _a.originalPath, isExternalLibraryImport = _a.isExternalLibraryImport; + return createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { @@ -22301,11 +22717,17 @@ var ts; if (!resolved_1) return undefined; var resolvedValue = resolved_1.value; - if (!compilerOptions.preserveSymlinks) { - resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + var originalPath = void 0; + if (!compilerOptions.preserveSymlinks && resolvedValue) { + originalPath = resolvedValue.path; + var path = realPath(resolved_1.value.path, host, traceEnabled); + if (path === originalPath) { + originalPath = undefined; + } + resolvedValue = __assign({}, resolvedValue, { path: path }); } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, originalPath: originalPath, isExternalLibraryImport: true } }; } else { var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; @@ -22341,7 +22763,9 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return noPackageId(resolvedFromFile); + var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; + var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, /*onlyRecordFailures*/ false, state).packageId; + return withPackageId(packageId, resolvedFromFile); } } if (!onlyRecordFailures) { @@ -22355,6 +22779,49 @@ var ts; } return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } + var nodeModulesPathPart = "/node_modules/"; + /** + * This will be called on the successfully resolved path from `loadModuleFromFile`. + * (Not neeeded for `loadModuleFromNodeModules` as that looks up the `package.json` as part of resolution.) + * + * packageDirectory is the directory of the package itself. + * subModuleName is the path within the package. + * For `blah/node_modules/foo/index.d.ts` this is { packageDirectory: "foo", subModuleName: "index.d.ts" }. (Part before "/node_modules/" is ignored.) + * For `/node_modules/foo/bar.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. + * For `/node_modules/@types/foo/bar/index.d.ts` this is { packageDirectory: "@types/foo", subModuleName: "bar/index.d.ts" }. + * For `/node_modules/foo/bar/index.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. + */ + function parseNodeModuleFromPath(resolved) { + var path = ts.normalizePath(resolved.path); + var idx = path.lastIndexOf(nodeModulesPathPart); + if (idx === -1) { + return undefined; + } + var indexAfterNodeModules = idx + nodeModulesPathPart.length; + var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules); + if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName); + } + var packageDirectory = path.slice(0, indexAfterPackageName); + var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts" /* Dts */; + return { packageDirectory: packageDirectory, subModuleName: subModuleName }; + } + function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) { + var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; + } + function addExtensionAndIndex(path) { + if (path === "") { + return "index.d.ts"; + } + if (ts.endsWith(path, ".d.ts")) { + return path; + } + if (ts.endsWith(path, "/index")) { + return path + ".d.ts"; + } + return path + "/index.d.ts"; + } /* @internal */ function directoryProbablyExists(directoryName, host) { // if host does not support 'directoryExists' assume that directory will exist @@ -22440,18 +22907,41 @@ var ts; var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } - function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) { - var host = _a.host, traceEnabled = _a.traceEnabled; + function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) { + var host = state.host, traceEnabled = state.traceEnabled; var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host); var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } var packageJsonContent = readJson(packageJsonPath, host); + if (subModuleName === "") { + var path = tryReadPackageJsonFields(/*readTypes*/ true, packageJsonContent, nodeModuleDirectory, state); + if (typeof path === "string") { + subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); + } + else { + var jsPath = tryReadPackageJsonFields(/*readTypes*/ false, packageJsonContent, nodeModuleDirectory, state); + if (typeof jsPath === "string") { + subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js" /* Js */), ".jsx" /* Jsx */) + ".d.ts" /* Dts */; + } + else { + subModuleName = "index.d.ts"; + } + } + } + if (!ts.endsWith(subModuleName, ".d.ts" /* Dts */)) { + subModuleName = addExtensionAndIndex(subModuleName); + } var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string" ? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version } : undefined; + if (traceEnabled) { + if (packageId) { + trace(host, ts.Diagnostics.Found_package_json_at_0_Package_ID_is_1, packageJsonPath, ts.packageIdToString(packageId)); + } + else { + trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + } return { found: true, packageJsonContent: packageJsonContent, packageId: packageId }; } else { @@ -22609,13 +23099,18 @@ var ts; function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); if (withoutAtTypePrefix !== mangledName) { - return ts.stringContains(withoutAtTypePrefix, mangledScopedPackageSeparator) ? - "@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) : - withoutAtTypePrefix; + return getUnmangledNameForScopedPackage(withoutAtTypePrefix); } return mangledName; } ts.getPackageNameFromAtTypesDirectory = getPackageNameFromAtTypesDirectory; + /* @internal */ + function getUnmangledNameForScopedPackage(typesPackageName) { + return ts.stringContains(typesPackageName, mangledScopedPackageSeparator) ? + "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) : + typesPackageName; + } + ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { var result = cache && cache.get(containingDirectory); if (result) { @@ -22631,7 +23126,8 @@ var ts; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + // No originalPath because classic resolution doesn't resolve realPath + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*originalPath*/ undefined, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { @@ -22676,7 +23172,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*originalPath*/ undefined, /*isExternalLibraryImport*/ true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -22706,24 +23202,24 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (ts.isConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. other uninstantiated module declarations. - case 235 /* ModuleBlock */: { + case 238 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -22745,7 +23241,7 @@ var ts; }); return state_1; } - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return getModuleInstanceState(node); case 71 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -22779,6 +23275,7 @@ var ts; ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals"; ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; + ContainerFlags[ContainerFlags["IsInferenceContainer"] = 256] = "IsInferenceContainer"; })(ContainerFlags || (ContainerFlags = {})); var binder = createBinder(); function bindSourceFile(file, options) { @@ -22795,6 +23292,7 @@ var ts; var parent; var container; var blockScopeContainer; + var inferenceContainer; var lastContainer; var seenThisKeyword; // state used by control flow analysis @@ -22850,6 +23348,7 @@ var ts; parent = undefined; container = undefined; blockScopeContainer = undefined; + inferenceContainer = undefined; lastContainer = undefined; seenThisKeyword = false; currentFlow = undefined; @@ -22895,7 +23394,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 234 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 237 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -22904,7 +23403,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -22913,7 +23412,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -22925,38 +23424,38 @@ var ts; return ts.getEscapedTextOfIdentifierOrLiteral(name); } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "__constructor" /* Constructor */; - case 161 /* FunctionType */: - case 156 /* CallSignature */: + case 162 /* FunctionType */: + case 157 /* CallSignature */: return "__call" /* Call */; - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: return "__new" /* New */; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "__index" /* Index */; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: return (ts.hasModifier(node, 512 /* Default */) ? "default" /* Default */ : undefined); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 147 /* Parameter */: + case 148 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 277 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 280 /* JSDocFunctionType */); var functionType = node.parent; - var index = ts.indexOf(functionType.parameters, node); + var index = functionType.parameters.indexOf(node); return "arg" + index; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: var name_2 = ts.getNameOfJSDocTypedef(node); return typeof name_2 !== "undefined" ? name_2.escapedText : undefined; } @@ -23033,6 +23532,9 @@ var ts; var message_1 = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) { + message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } if (symbol.declarations && symbol.declarations.length) { // If the current node is a default export of some sort, then check if // there are any other default exports that we need to error on. @@ -23046,7 +23548,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 244 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 247 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -23066,7 +23568,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 247 /* ExportSpecifier */ || (node.kind === 238 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 250 /* ExportSpecifier */ || (node.kind === 241 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -23088,12 +23590,9 @@ var ts; // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - if (node.kind === 288 /* JSDocTypedefTag */) + if (node.kind === 291 /* JSDocTypedefTag */) ts.Debug.assert(ts.isInJavaScriptFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - var isJSDocTypedefInJSDocNamespace = node.kind === 288 /* JSDocTypedefTag */ && - node.name && - node.name.kind === 71 /* Identifier */ && - node.name.isInJSDocNamespace; + var isJSDocTypedefInJSDocNamespace = ts.isJSDocTypedefTag(node) && node.name && node.name.kind === 71 /* Identifier */ && node.name.isInJSDocNamespace; if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 32 /* ExportContext */)) || isJSDocTypedefInJSDocNamespace) { var exportKind = symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0; var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); @@ -23161,7 +23660,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property intialization checks. - currentReturnTarget = isIIFE || node.kind === 153 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 154 /* Constructor */ ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -23174,13 +23673,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -23198,6 +23697,13 @@ var ts; bindChildren(node); node.flags = seenThisKeyword ? node.flags | 64 /* ContainsThis */ : node.flags & ~64 /* ContainsThis */; } + else if (containerFlags & 256 /* IsInferenceContainer */) { + var saveInferenceContainer = inferenceContainer; + inferenceContainer = node; + node.locals = undefined; + bindChildren(node); + inferenceContainer = saveInferenceContainer; + } else { bindChildren(node); } @@ -23267,70 +23773,70 @@ var ts; return; } switch (node.kind) { - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: bindWhileStatement(node); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: bindDoStatement(node); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: bindForStatement(node); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: bindIfStatement(node); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: bindTryStatement(node); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: bindSwitchStatement(node); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: bindCaseBlock(node); break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: bindCaseClause(node); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: bindLabeledStatement(node); break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: bindCallExpressionFlow(node); break; - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: bindJSDocComment(node); break; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: bindJSDocTypedefTag(node); break; default: @@ -23342,15 +23848,15 @@ var ts; switch (expr.kind) { case 71 /* Identifier */: case 99 /* ThisKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return hasNarrowableArgument(expr); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 51 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; @@ -23359,7 +23865,7 @@ var ts; return expr.kind === 71 /* Identifier */ || expr.kind === 99 /* ThisKeyword */ || expr.kind === 97 /* SuperKeyword */ || - expr.kind === 180 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + expr.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -23370,14 +23876,17 @@ var ts; } } } - if (expr.expression.kind === 180 /* PropertyAccessExpression */ && + if (expr.expression.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 190 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; + return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2); + } + function isNarrowableInOperands(left, right) { + return ts.isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -23391,6 +23900,8 @@ var ts; isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); case 93 /* InstanceOfKeyword */: return isNarrowableOperand(expr.left); + case 92 /* InKeyword */: + return isNarrowableInOperands(expr.left, expr.right); case 26 /* CommaToken */: return isNarrowingExpression(expr.right); } @@ -23398,9 +23909,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -23478,33 +23989,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: return parent.expression === node; - case 215 /* ForStatement */: - case 196 /* ConditionalExpression */: + case 218 /* ForStatement */: + case 199 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 186 /* ParenthesizedExpression */) { + if (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 193 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { + else if (node.kind === 196 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 195 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || + return node.kind === 198 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 54 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 186 /* ParenthesizedExpression */ || - node.parent.kind === 193 /* PrefixUnaryExpression */ && + while (node.parent.kind === 189 /* ParenthesizedExpression */ || + node.parent.kind === 196 /* PrefixUnaryExpression */ && node.parent.operator === 51 /* ExclamationToken */) { node = node.parent; } @@ -23546,7 +24057,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 223 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 226 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -23580,13 +24091,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 228 /* VariableDeclarationList */) { + if (node.initializer.kind !== 231 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -23608,7 +24119,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 220 /* ReturnStatement */) { + if (node.kind === 223 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -23628,7 +24139,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 219 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 222 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -23724,7 +24235,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 262 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 265 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -23791,14 +24302,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 213 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 216 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -23809,10 +24320,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 178 /* ArrayLiteralExpression */) { + else if (node.kind === 181 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 199 /* SpreadElement */) { + if (e.kind === 202 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -23820,16 +24331,16 @@ var ts; } } } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 265 /* PropertyAssignment */) { + if (p.kind === 268 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 266 /* ShorthandPropertyAssignment */) { + else if (p.kind === 269 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 267 /* SpreadAssignment */) { + else if (p.kind === 270 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -23885,7 +24396,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 58 /* EqualsToken */ && node.left.kind === 181 /* ElementAccessExpression */) { + if (operator === 58 /* EqualsToken */ && node.left.kind === 184 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -23896,7 +24407,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -23935,7 +24446,7 @@ var ts; } function bindJSDocComment(node) { ts.forEachChild(node, function (n) { - if (n.kind !== 288 /* JSDocTypedefTag */) { + if (n.kind !== 291 /* JSDocTypedefTag */) { bind(n); } }); @@ -23956,10 +24467,10 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = node.expression; - while (expr.kind === 186 /* ParenthesizedExpression */) { + while (expr.kind === 189 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 187 /* FunctionExpression */ || expr.kind === 188 /* ArrowFunction */) { + if (expr.kind === 190 /* FunctionExpression */ || expr.kind === 191 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -23967,7 +24478,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -23976,53 +24487,55 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 258 /* JsxAttributes */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 261 /* JsxAttributes */: return 1 /* IsContainer */; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 269 /* SourceFile */: + case 170 /* ConditionalType */: + return 256 /* IsInferenceContainer */; + case 272 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 277 /* JSDocFunctionType */: - case 161 /* FunctionType */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 162 /* ConstructorType */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 280 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 163 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 264 /* CatchClause */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 236 /* CaseBlock */: + case 267 /* CatchClause */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 239 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 208 /* Block */: + case 211 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -24055,42 +24568,42 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 179 /* ObjectLiteralExpression */: - case 231 /* InterfaceDeclaration */: - case 258 /* JsxAttributes */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 182 /* ObjectLiteralExpression */: + case 234 /* InterfaceDeclaration */: + case 261 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -24111,11 +24624,11 @@ var ts; : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 269 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 269 /* SourceFile */ || body.kind === 235 /* ModuleBlock */)) { + var body = node.kind === 272 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 272 /* SourceFile */ || body.kind === 238 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 245 /* ExportDeclaration */ || stat.kind === 244 /* ExportAssignment */) { + if (stat.kind === 248 /* ExportDeclaration */ || stat.kind === 247 /* ExportAssignment */) { return true; } } @@ -24182,7 +24695,7 @@ var ts; // to the one we would get for: { <...>(...): T } // // We do that by making an anonymous type literal symbol, and then setting the function - // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable // from an actual type literal symbol you would have gotten had you used the long form. var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); addDeclarationToSymbol(symbol, node, 131072 /* Signature */); @@ -24201,7 +24714,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { + if (prop.kind === 270 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { continue; } var identifier = prop.name; @@ -24213,7 +24726,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 265 /* PropertyAssignment */ || prop.kind === 266 /* ShorthandPropertyAssignment */ || prop.kind === 152 /* MethodDeclaration */ + var currentKind = prop.kind === 268 /* PropertyAssignment */ || prop.kind === 269 /* ShorthandPropertyAssignment */ || prop.kind === 153 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -24244,10 +24757,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -24357,8 +24870,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 269 /* SourceFile */ && - blockScopeContainer.kind !== 234 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 272 /* SourceFile */ && + blockScopeContainer.kind !== 237 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -24432,7 +24945,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 143 /* LastToken */) { + if (node.kind > 144 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -24460,7 +24973,7 @@ var ts; } for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { var tag = _c[_b]; - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { var savedParent = parent; parent = jsDoc; bind(tag); @@ -24499,7 +25012,7 @@ var ts; // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 288 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 291 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); @@ -24507,11 +25020,11 @@ var ts; } // falls through case 99 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 266 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 269 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -24519,7 +25032,7 @@ var ts; bindSpecialPropertyDeclaration(node); } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -24544,132 +25057,132 @@ var ts; ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return checkStrictModeCatchClause(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkStrictModeWithStatement(node); - case 170 /* ThisType */: + case 173 /* ThisType */: seenThisKeyword = true; return; - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 146 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 147 /* Parameter */: + case 147 /* TypeParameter */: + return bindTypeParameter(node); + case 148 /* Parameter */: return bindParameter(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return bindPropertyWorker(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 173 /* MappedType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 176 /* MappedType */: return bindAnonymousTypeWorker(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return bindFunctionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return bindJsxAttributes(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return bindImportClause(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return bindExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return bindExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 208 /* Block */: + case 211 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 284 /* JSDocParameterTag */: - if (node.parent.kind !== 280 /* JSDocTypeLiteral */) { + case 287 /* JSDocParameterTag */: + if (node.parent.kind !== 283 /* JSDocTypeLiteral */) { break; } // falls through - case 289 /* JSDocPropertyTag */: + case 292 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 276 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 279 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 288 /* JSDocTypedefTag */: { + case 291 /* JSDocTypedefTag */: { var fullName = node.fullName; if (!fullName || fullName.kind === 71 /* Identifier */) { return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); @@ -24689,7 +25202,7 @@ var ts; if (parameterName && parameterName.kind === 71 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 170 /* ThisType */) { + if (parameterName && parameterName.kind === 173 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -24709,7 +25222,7 @@ var ts; bindAnonymousDeclaration(node, 2097152 /* Alias */, getDeclarationName(node)); } else { - var flags = node.kind === 244 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 247 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) // An export default clause with an EntityNameExpression exports all meanings of that identifier ? 2097152 /* Alias */ // An export default clause with any other expression exports a value @@ -24723,7 +25236,7 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 269 /* SourceFile */) { + if (node.parent.kind !== 272 /* SourceFile */) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } @@ -24770,27 +25283,13 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); } - function isExportsOrModuleExportsOrAlias(node) { - return ts.isExportsIdentifier(node) || - ts.isModuleExportsPropertyAccessExpression(node) || - ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(node); - } - function isNameOfExportsOrModuleExportsAliasDeclaration(node) { - var symbol = lookupSymbolForName(node.escapedText); - return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && - symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer); - } - function isExportsOrModuleExportsOrAliasOrAssignment(node) { - return isExportsOrModuleExportsOrAlias(node) || - (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(node.left) || isExportsOrModuleExportsOrAliasOrAssignment(node.right))); - } function bindModuleExportsAssignment(node) { // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' // is still pointing to 'module.exports'. // We do not want to consider this as 'export=' since a module can have only one of these. // Similarly we do not want to treat 'module.exports = exports' as an 'export='. var assignedExpression = ts.getRightMostAssignedExpression(node.right); - if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { // Mark it as a module in case there are no other exports in the file setCommonJsModuleIndicator(node); return; @@ -24803,18 +25302,18 @@ var ts; ts.Debug.assert(ts.isInJavaScriptFile(node)); var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (container.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Declare a 'member' if the container is an ES5 class or ES6 constructor container.symbol.members = container.symbol.members || ts.createSymbolTable(); // It's acceptable for multiple 'this' assignments of the same identifier to occur declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); break; - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = container.parent; @@ -24828,8 +25327,8 @@ var ts; if (node.expression.kind === 99 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */) && - node.parent.parent.kind === 269 /* SourceFile */) { + else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */) && + node.parent.parent.kind === 272 /* SourceFile */) { bindStaticPropertyAssignment(node); } } @@ -24853,15 +25352,15 @@ var ts; function bindStaticPropertyAssignment(node) { // Look up the function in the local scope, since static assignments should // follow the function declaration - var leftSideOfAssignment = node.kind === 180 /* PropertyAccessExpression */ ? node : node.left; + var leftSideOfAssignment = node.kind === 183 /* PropertyAccessExpression */ ? node : node.left; var target = leftSideOfAssignment.expression; if (ts.isIdentifier(target)) { // Fix up parent pointers since we're going to use these nodes before we bind into them target.parent = leftSideOfAssignment; - if (node.kind === 195 /* BinaryExpression */) { + if (node.kind === 198 /* BinaryExpression */) { leftSideOfAssignment.parent = node; } - if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + if (container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, target)) { // This can be an alias for the 'exports' or 'module.exports' names, e.g. // var util = module.exports; // util.property = function ... @@ -24873,26 +25372,22 @@ var ts; } } function lookupSymbolForName(name) { - var local = container.locals && container.locals.get(name); - if (local) { - return local.exportSymbol || local; - } - return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + return lookupSymbolForNameWorker(container, name); } function bindPropertyAssignment(functionName, propertyAccess, isPrototypeProperty) { var symbol = lookupSymbolForName(functionName); var targetSymbol = symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol) ? symbol.valueDeclaration.initializer.symbol : symbol; - ts.Debug.assert(propertyAccess.parent.kind === 195 /* BinaryExpression */ || propertyAccess.parent.kind === 211 /* ExpressionStatement */); + ts.Debug.assert(propertyAccess.parent.kind === 198 /* BinaryExpression */ || propertyAccess.parent.kind === 214 /* ExpressionStatement */); var isLegalPosition; - if (propertyAccess.parent.kind === 195 /* BinaryExpression */) { + if (propertyAccess.parent.kind === 198 /* BinaryExpression */) { var initializerKind = propertyAccess.parent.right.kind; - isLegalPosition = (initializerKind === 200 /* ClassExpression */ || initializerKind === 187 /* FunctionExpression */) && - propertyAccess.parent.parent.parent.kind === 269 /* SourceFile */; + isLegalPosition = (initializerKind === 203 /* ClassExpression */ || initializerKind === 190 /* FunctionExpression */) && + propertyAccess.parent.parent.parent.kind === 272 /* SourceFile */; } else { - isLegalPosition = propertyAccess.parent.parent.kind === 269 /* SourceFile */; + isLegalPosition = propertyAccess.parent.parent.kind === 272 /* SourceFile */; } if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & 1920 /* Namespace */)) && isLegalPosition) { ts.Debug.assert(ts.isIdentifier(propertyAccess.expression)); @@ -24924,7 +25419,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -24993,7 +25488,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + ts.indexOf(node.parent.parameters, node)); + bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + node.parent.parameters.indexOf(node)); } else { declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); @@ -25044,6 +25539,22 @@ var ts; ? bindAnonymousDeclaration(node, symbolFlags, "__computed" /* Computed */) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + function bindTypeParameter(node) { + if (node.parent.kind === 171 /* InferType */) { + if (inferenceContainer) { + if (!inferenceContainer.locals) { + inferenceContainer.locals = ts.createSymbolTable(); + } + declareSymbol(inferenceContainer.locals, /*parent*/ undefined, node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); + } + else { + bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); + } + } + else { + declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); + } + } // reachability checks function shouldReportErrorOnModuleDeclaration(node) { var instanceState = getModuleInstanceState(node); @@ -25056,13 +25567,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 210 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 213 /* EmptyStatement */) || // report error on class declarations - node.kind === 230 /* ClassDeclaration */ || + node.kind === 233 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 234 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 237 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 233 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 236 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -25076,7 +25587,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !(node.flags & 2097152 /* Ambient */) && - (node.kind !== 209 /* VariableStatement */ || + (node.kind !== 212 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -25087,6 +25598,29 @@ var ts; return true; } } + /* @internal */ + function isExportsOrModuleExportsOrAlias(sourceFile, node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node); + } + ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; + function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) { + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); + return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && + symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer); + } + function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { + return isExportsOrModuleExportsOrAlias(sourceFile, node) || + (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); + } + function lookupSymbolForNameWorker(container, name) { + var local = container.locals && container.locals.get(name); + if (local) { + return local.exportSymbol || local; + } + return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + } /** * Computes the transform flags for a node, given the transform flags of its subtree * @@ -25096,57 +25630,59 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 147 /* Parameter */: + case 148 /* Parameter */: return computeParameter(node, subtreeFlags); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 153 /* Constructor */: + case 154 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); + case 184 /* ElementAccessExpression */: + return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); } @@ -25155,15 +25691,19 @@ var ts; function computeCallExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var expression = node.expression; - var expressionKind = expression.kind; if (node.typeArguments) { transformFlags |= 3 /* AssertTypeScript */; } if (subtreeFlags & 524288 /* ContainsSpread */ - || isSuperOrSuperProperty(expression, expressionKind)) { + || (expression.transformFlags & (134217728 /* Super */ | 268435456 /* ContainsSuper */))) { // If the this node contains a SpreadExpression, or is a super call, then it is an ES6 // node. transformFlags |= 192 /* AssertES2015 */; + // super property or element accesses could be inside lambdas, etc, and need a captured `this`, + // while super keyword for super calls (indicated by TransformFlags.Super) does not (since it can only be top-level in a constructor) + if (expression.transformFlags & 268435456 /* ContainsSuper */) { + transformFlags |= 16384 /* ContainsLexicalThis */; + } } if (expression.kind === 91 /* ImportKeyword */) { transformFlags |= 67108864 /* ContainsDynamicImport */; @@ -25174,19 +25714,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537396545 /* ArrayLiteralOrCallOrNewExcludes */; - } - function isSuperOrSuperProperty(node, kind) { - switch (kind) { - case 97 /* SuperKeyword */: - return true; - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - var expression = node.expression; - var expressionKind = expression.kind; - return expressionKind === 97 /* SuperKeyword */; - } - return false; + return transformFlags & ~940049729 /* ArrayLiteralOrCallOrNewExcludes */; } function computeNewExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25199,18 +25727,18 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537396545 /* ArrayLiteralOrCallOrNewExcludes */; + return transformFlags & ~940049729 /* ArrayLiteralOrCallOrNewExcludes */; } function computeBinaryExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 179 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 182 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ESNext if they contain rest transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 178 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 181 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } @@ -25220,7 +25748,7 @@ var ts; transformFlags |= 32 /* AssertES2016 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25249,7 +25777,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */ | 131072 /* ContainsDefaultValueAssignments */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* ParameterExcludes */; + return transformFlags & ~939525441 /* ParameterExcludes */; } function computeParenthesizedExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25259,8 +25787,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 203 /* AsExpression */ - || expressionKind === 185 /* TypeAssertionExpression */) { + if (expressionKind === 206 /* AsExpression */ + || expressionKind === 188 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -25269,7 +25797,7 @@ var ts; transformFlags |= 1024 /* DestructuringAssignment */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~536872257 /* OuterExpressionExcludes */; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; @@ -25295,7 +25823,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~539358529 /* ClassExcludes */; + return transformFlags & ~942011713 /* ClassExcludes */; } function computeClassExpression(node, subtreeFlags) { // A ClassExpression is ES6 syntax. @@ -25312,7 +25840,7 @@ var ts; transformFlags |= 16384 /* ContainsLexicalThis */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~539358529 /* ClassExcludes */; + return transformFlags & ~942011713 /* ClassExcludes */; } function computeHeritageClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25330,7 +25858,7 @@ var ts; break; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25341,7 +25869,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537920833 /* CatchClauseExcludes */; + return transformFlags & ~940574017 /* CatchClauseExcludes */; } function computeExpressionWithTypeArguments(node, subtreeFlags) { // An ExpressionWithTypeArguments is ES6 syntax, as it is used in the @@ -25353,7 +25881,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeConstructor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25367,7 +25895,7 @@ var ts; transformFlags |= 8 /* AssertESNext */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* ConstructorExcludes */; + return transformFlags & ~1003668801 /* ConstructorExcludes */; } function computeMethod(node, subtreeFlags) { // A MethodDeclaration is ES6 syntax. @@ -25394,7 +25922,7 @@ var ts; transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* MethodOrAccessorExcludes */; + return transformFlags & ~1003668801 /* MethodOrAccessorExcludes */; } function computeAccessor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25412,7 +25940,7 @@ var ts; transformFlags |= 8 /* AssertESNext */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* MethodOrAccessorExcludes */; + return transformFlags & ~1003668801 /* MethodOrAccessorExcludes */; } function computePropertyDeclaration(node, subtreeFlags) { // A PropertyDeclaration is TypeScript syntax. @@ -25423,7 +25951,7 @@ var ts; transformFlags |= 8192 /* ContainsPropertyInitializer */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeFunctionDeclaration(node, subtreeFlags) { var transformFlags; @@ -25467,7 +25995,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601281857 /* FunctionExcludes */; + return transformFlags & ~1003935041 /* FunctionExcludes */; } function computeFunctionExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25499,7 +26027,7 @@ var ts; transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601281857 /* FunctionExcludes */; + return transformFlags & ~1003935041 /* FunctionExcludes */; } function computeArrowFunction(node, subtreeFlags) { // An ArrowFunction is ES6 syntax, and excludes markers that should not escape the scope of an ArrowFunction. @@ -25524,19 +26052,31 @@ var ts; transformFlags |= 32768 /* ContainsCapturedLexicalThis */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601249089 /* ArrowFunctionExcludes */; + return transformFlags & ~1003902273 /* ArrowFunctionExcludes */; } function computePropertyAccess(node, subtreeFlags) { var transformFlags = subtreeFlags; - var expression = node.expression; - var expressionKind = expression.kind; // If a PropertyAccessExpression starts with a super keyword, then it is // ES6 syntax, and requires a lexical `this` binding. - if (expressionKind === 97 /* SuperKeyword */) { - transformFlags |= 16384 /* ContainsLexicalThis */; + if (transformFlags & 134217728 /* Super */) { + transformFlags ^= 134217728 /* Super */; + transformFlags |= 268435456 /* ContainsSuper */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~671089985 /* PropertyAccessExcludes */; + } + function computeElementAccess(node, subtreeFlags) { + var transformFlags = subtreeFlags; + var expression = node.expression; + var expressionFlags = expression.transformFlags; // We do not want to aggregate flags from the argument expression for super/this capturing + // If an ElementAccessExpression starts with a super keyword, then it is + // ES6 syntax, and requires a lexical `this` binding. + if (expressionFlags & 134217728 /* Super */) { + transformFlags &= ~134217728 /* Super */; + transformFlags |= 268435456 /* ContainsSuper */; + } + node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; + return transformFlags & ~671089985 /* PropertyAccessExcludes */; } function computeVariableDeclaration(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25550,7 +26090,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; @@ -25566,7 +26106,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeLabeledStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25576,7 +26116,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeImportEquals(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25585,7 +26125,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeExpressionStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -25596,7 +26136,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeModuleDeclaration(node, subtreeFlags) { var transformFlags = 3 /* AssertTypeScript */; @@ -25605,7 +26145,7 @@ var ts; transformFlags |= subtreeFlags; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~574674241 /* ModuleExcludes */; + return transformFlags & ~977327425 /* ModuleExcludes */; } function computeVariableDeclarationList(node, subtreeFlags) { var transformFlags = subtreeFlags | 33554432 /* ContainsHoistedDeclarationOrCompletion */; @@ -25617,45 +26157,50 @@ var ts; transformFlags |= 192 /* AssertES2015 */ | 4194304 /* ContainsBlockScopedBinding */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~546309441 /* VariableDeclarationListExcludes */; + return transformFlags & ~948962625 /* VariableDeclarationListExcludes */; } function computeOther(node, kind, subtreeFlags) { // Mark transformations needed for each node var transformFlags = subtreeFlags; - var excludeFlags = 536872257 /* NodeExcludes */; + var excludeFlags = 939525441 /* NodeExcludes */; switch (kind) { case 120 /* AsyncKeyword */: - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + // These nodes are TypeScript syntax. + transformFlags |= 3 /* AssertTypeScript */; + excludeFlags = 536872257 /* OuterExpressionExcludes */; + break; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 117 /* AbstractKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: - case 131 /* ReadonlyKeyword */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 207 /* NonNullExpression */: + case 132 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: case 10 /* JsxText */: - case 253 /* JsxClosingElement */: - case 254 /* JsxFragment */: - case 255 /* JsxOpeningFragment */: - case 256 /* JsxClosingFragment */: - case 257 /* JsxAttribute */: - case 258 /* JsxAttributes */: - case 259 /* JsxSpreadAttribute */: - case 260 /* JsxExpression */: + case 256 /* JsxClosingElement */: + case 257 /* JsxFragment */: + case 258 /* JsxOpeningFragment */: + case 259 /* JsxClosingFragment */: + case 260 /* JsxAttribute */: + case 261 /* JsxAttributes */: + case 262 /* JsxSpreadAttribute */: + case 263 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; @@ -25663,11 +26208,11 @@ var ts; case 14 /* TemplateHead */: case 15 /* TemplateMiddle */: case 16 /* TemplateTail */: - case 197 /* TemplateExpression */: - case 184 /* TaggedTemplateExpression */: - case 266 /* ShorthandPropertyAssignment */: + case 200 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 269 /* ShorthandPropertyAssignment */: case 115 /* StaticKeyword */: - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; @@ -25681,56 +26226,58 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 8 /* AssertESNext */; } transformFlags |= 192 /* AssertES2015 */; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; break; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 159 /* TypePredicate */: - case 160 /* TypeReference */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 163 /* TypeQuery */: - case 164 /* TypeLiteral */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: - case 237 /* NamespaceExportDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 160 /* TypePredicate */: + case 161 /* TypeReference */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 164 /* TypeQuery */: + case 165 /* TypeLiteral */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 171 /* InferType */: + case 172 /* ParenthesizedType */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: + case 240 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. @@ -25747,43 +26294,44 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; case 97 /* SuperKeyword */: // This node is ES6 syntax. - transformFlags |= 192 /* AssertES2015 */; + transformFlags |= 192 /* AssertES2015 */ | 134217728 /* Super */; + excludeFlags = 536872257 /* OuterExpressionExcludes */; // must be set to persist `Super` break; case 99 /* ThisKeyword */: // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } - excludeFlags = 537396545 /* BindingPatternExcludes */; + excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; - excludeFlags = 537396545 /* BindingPatternExcludes */; + excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 179 /* ObjectLiteralExpression */: - excludeFlags = 540087617 /* ObjectLiteralExcludes */; + case 182 /* ObjectLiteralExpression */: + excludeFlags = 942740801 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it // is an ES6 node. @@ -25800,32 +26348,32 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 178 /* ArrayLiteralExpression */: - case 183 /* NewExpression */: - excludeFlags = 537396545 /* ArrayLiteralOrCallOrNewExcludes */; + case 181 /* ArrayLiteralExpression */: + case 186 /* NewExpression */: + excludeFlags = 940049729 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 // node. transformFlags |= 192 /* AssertES2015 */; } break; - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 220 /* ReturnStatement */: - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 223 /* ReturnStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -25841,60 +26389,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) { + if (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 178 /* ArrayLiteralExpression */: - return 537396545 /* ArrayLiteralOrCallOrNewExcludes */; - case 234 /* ModuleDeclaration */: - return 574674241 /* ModuleExcludes */; - case 147 /* Parameter */: - return 536872257 /* ParameterExcludes */; - case 188 /* ArrowFunction */: - return 601249089 /* ArrowFunctionExcludes */; - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - return 601281857 /* FunctionExcludes */; - case 228 /* VariableDeclarationList */: - return 546309441 /* VariableDeclarationListExcludes */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return 539358529 /* ClassExcludes */; - case 153 /* Constructor */: - return 601015617 /* ConstructorExcludes */; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return 601015617 /* MethodOrAccessorExcludes */; + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 181 /* ArrayLiteralExpression */: + return 940049729 /* ArrayLiteralOrCallOrNewExcludes */; + case 237 /* ModuleDeclaration */: + return 977327425 /* ModuleExcludes */; + case 148 /* Parameter */: + return 939525441 /* ParameterExcludes */; + case 191 /* ArrowFunction */: + return 1003902273 /* ArrowFunctionExcludes */; + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + return 1003935041 /* FunctionExcludes */; + case 231 /* VariableDeclarationList */: + return 948962625 /* VariableDeclarationListExcludes */; + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + return 942011713 /* ClassExcludes */; + case 154 /* Constructor */: + return 1003668801 /* ConstructorExcludes */; + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return 1003668801 /* MethodOrAccessorExcludes */; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 136 /* StringKeyword */: - case 134 /* ObjectKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 135 /* ObjectKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 179 /* ObjectLiteralExpression */: - return 540087617 /* ObjectLiteralExcludes */; - case 264 /* CatchClause */: - return 537920833 /* CatchClauseExcludes */; - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - return 537396545 /* BindingPatternExcludes */; + case 182 /* ObjectLiteralExpression */: + return 942740801 /* ObjectLiteralExcludes */; + case 267 /* CatchClause */: + return 940574017 /* CatchClauseExcludes */; + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + return 940049729 /* BindingPatternExcludes */; + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + case 189 /* ParenthesizedExpression */: + case 97 /* SuperKeyword */: + return 536872257 /* OuterExpressionExcludes */; + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + return 671089985 /* PropertyAccessExcludes */; default: - return 536872257 /* NodeExcludes */; + return 939525441 /* NodeExcludes */; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; @@ -25910,7 +26467,7 @@ var ts; /** @internal */ var ts; (function (ts) { - function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { return getSymbolWalker; function getSymbolWalker(accept) { if (accept === void 0) { accept = function () { return true; }; } @@ -26006,8 +26563,9 @@ var ts; visitType(type.modifiersType); } function visitSignature(signature) { - if (signature.typePredicate) { - visitType(signature.typePredicate.type); + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + visitType(typePredicate.type); } ts.forEach(signature.typeParameters, visitType); for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { @@ -26065,7 +26623,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 163 /* TypeQuery */) { + if (d.type && d.type.kind === 164 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -26195,6 +26753,11 @@ var ts; typeToTypeNode: nodeBuilder.typeToTypeNode, indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + symbolToEntityName: nodeBuilder.symbolToEntityName, + symbolToExpression: nodeBuilder.symbolToExpression, + symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, + symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, + typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, getSymbolsInScope: function (location, meaning) { location = ts.getParseTreeNode(location); return location ? getSymbolsInScope(location, meaning) : []; @@ -26228,16 +26791,40 @@ var ts; typeToString: function (type, enclosingDeclaration, flags) { return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); }, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: function (symbol, enclosingDeclaration, meaning) { - return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + symbolToString: function (symbol, enclosingDeclaration, meaning, flags) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags); }, + typePredicateToString: function (predicate, enclosingDeclaration, flags) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags); + }, + writeSignature: function (signature, enclosingDeclaration, flags, kind, writer) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind, writer); + }, + writeType: function (type, enclosingDeclaration, flags, writer) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + writeSymbol: function (symbol, enclosingDeclaration, meaning, flags, writer) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags, writer); + }, + writeTypePredicate: function (predicate, enclosingDeclaration, flags, writer) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + getSymbolDisplayBuilder: getSymbolDisplayBuilder, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, getContextualType: function (node) { node = ts.getParseTreeNode(node, ts.isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: function (node, argIndex) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, + isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) { node = ts.getParseTreeNode(node, ts.isCallLikeExpression); @@ -26252,7 +26839,11 @@ var ts; }, isValidPropertyAccess: function (node, propertyName) { node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); - return node ? isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)) : false; + return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)); + }, + isValidPropertyAccessForCompletions: function (node, type, property) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessExpression); + return !!node && isValidPropertyAccessForCompletions(node, type, property); }, getSignatureFromDeclaration: function (declaration) { declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); @@ -26276,7 +26867,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, - getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -26318,28 +26909,40 @@ var ts; getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); }, getBaseConstraintOfType: getBaseConstraintOfType, getDefaultFromTypeParameter: function (type) { return type && type.flags & 32768 /* TypeParameter */ ? getDefaultFromTypeParameter(type) : undefined; }, - resolveName: function (name, location, meaning) { - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); + resolveName: function (name, location, meaning, excludeGlobals) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals); }, getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, getAccessibleSymbolChain: getAccessibleSymbolChain, + getTypePredicateOfSignature: getTypePredicateOfSignature, + resolveExternalModuleSymbol: resolveExternalModuleSymbol, + tryGetThisTypeAt: function (node) { + node = ts.getParseTreeNode(node); + return node && tryGetThisTypeAt(node); + }, + getTypeArgumentConstraint: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, }; var tupleTypes = []; var unionTypes = ts.createMap(); var intersectionTypes = ts.createMap(); var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); + var conditionalTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); var undefinedType = createIntrinsicType(4096 /* Undefined */, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 4194304 /* ContainsWideningType */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 16777216 /* ContainsWideningType */, "undefined"); var nullType = createIntrinsicType(8192 /* Null */, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 4194304 /* ContainsWideningType */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 16777216 /* ContainsWideningType */, "null"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); var trueType = createIntrinsicType(128 /* BooleanLiteral */, "true"); @@ -26350,7 +26953,7 @@ var ts; var neverType = createIntrinsicType(16384 /* Never */, "never"); var silentNeverType = createIntrinsicType(16384 /* Never */, "never"); var implicitNeverType = createIntrinsicType(16384 /* Never */, "never"); - var nonPrimitiveType = createIntrinsicType(33554432 /* NonPrimitive */, "object"); + var nonPrimitiveType = createIntrinsicType(134217728 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = ts.createSymbolTable(); @@ -26360,7 +26963,7 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. - anyFunctionType.flags |= 16777216 /* ContainsAnyFunctionType */; + anyFunctionType.flags |= 67108864 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -26368,13 +26971,15 @@ var ts; var markerSubType = createType(32768 /* TypeParameter */); markerSubType.constraint = markerSuperType; var markerOtherType = createType(32768 /* TypeParameter */); - var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType); + var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); var jsObjectLiteralIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); var globals = ts.createSymbolTable(); + var reverseMappedCache = ts.createMap(); var ambientModulesCache; /** * List of every ambient module with a "*" wildcard. @@ -26538,23 +27143,24 @@ var ts; var jsxTypes = ts.createUnderscoreEscapedMap(); var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); + var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); - // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. - var _displayBuilder; var TypeSystemPropertyName; (function (TypeSystemPropertyName) { TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstraint"] = 4] = "ResolvedBaseConstraint"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); var CheckMode; (function (CheckMode) { CheckMode[CheckMode["Normal"] = 0] = "Normal"; CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + CheckMode[CheckMode["Contextual"] = 3] = "Contextual"; })(CheckMode || (CheckMode = {})); var CallbackCheck; (function (CallbackCheck) { @@ -26564,8 +27170,10 @@ var ts; })(CallbackCheck || (CallbackCheck = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { - MappedTypeModifiers[MappedTypeModifiers["Readonly"] = 1] = "Readonly"; - MappedTypeModifiers[MappedTypeModifiers["Optional"] = 2] = "Optional"; + MappedTypeModifiers[MappedTypeModifiers["IncludeReadonly"] = 1] = "IncludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeReadonly"] = 2] = "ExcludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["IncludeOptional"] = 4] = "IncludeOptional"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeOptional"] = 8] = "ExcludeOptional"; })(MappedTypeModifiers || (MappedTypeModifiers = {})); var ExpandingFlags; (function (ExpandingFlags) { @@ -26574,6 +27182,21 @@ var ts; ExpandingFlags[ExpandingFlags["Target"] = 2] = "Target"; ExpandingFlags[ExpandingFlags["Both"] = 3] = "Both"; })(ExpandingFlags || (ExpandingFlags = {})); + var TypeIncludes; + (function (TypeIncludes) { + TypeIncludes[TypeIncludes["Any"] = 1] = "Any"; + TypeIncludes[TypeIncludes["Undefined"] = 2] = "Undefined"; + TypeIncludes[TypeIncludes["Null"] = 4] = "Null"; + TypeIncludes[TypeIncludes["Never"] = 8] = "Never"; + TypeIncludes[TypeIncludes["NonWideningType"] = 16] = "NonWideningType"; + TypeIncludes[TypeIncludes["String"] = 32] = "String"; + TypeIncludes[TypeIncludes["Number"] = 64] = "Number"; + TypeIncludes[TypeIncludes["ESSymbol"] = 128] = "ESSymbol"; + TypeIncludes[TypeIncludes["LiteralOrUniqueESSymbol"] = 256] = "LiteralOrUniqueESSymbol"; + TypeIncludes[TypeIncludes["ObjectType"] = 512] = "ObjectType"; + TypeIncludes[TypeIncludes["EmptyObject"] = 1024] = "EmptyObject"; + TypeIncludes[TypeIncludes["Union"] = 2048] = "Union"; + })(TypeIncludes || (TypeIncludes = {})); var MembersOrExportsResolutionKind; (function (MembersOrExportsResolutionKind) { MembersOrExportsResolutionKind["resolvedExports"] = "resolvedExports"; @@ -26584,6 +27207,142 @@ var ts; var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor); initializeTypeChecker(); return checker; + /** + * @deprecated + */ + function getSymbolDisplayBuilder() { + return { + buildTypeDisplay: function (type, writer, enclosingDeclaration, flags) { + typeToString(type, enclosingDeclaration, flags, emitTextWriterWrapper(writer)); + }, + buildSymbolDisplay: function (symbol, writer, enclosingDeclaration, meaning, flags) { + symbolToString(symbol, enclosingDeclaration, meaning, flags | 4 /* AllowAnyNodeKind */, emitTextWriterWrapper(writer)); + }, + buildSignatureDisplay: function (signature, writer, enclosing, flags, kind) { + signatureToString(signature, enclosing, flags, kind, emitTextWriterWrapper(writer)); + }, + buildIndexSignatureDisplay: function (info, writer, kind, enclosing, flags) { + var sig = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, kind, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, sig, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildParameterDisplay: function (symbol, writer, enclosing, flags) { + var node = nodeBuilder.symbolToParameterDeclaration(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplay: function (tp, writer, enclosing, flags) { + var node = nodeBuilder.typeParameterToDeclaration(tp, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 8192 /* OmitParameterModifiers */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypePredicateDisplay: function (predicate, writer, enclosing, flags) { + typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplayFromSymbol: function (symbol, writer, enclosing, flags) { + var nodes = nodeBuilder.symbolToTypeParameterDeclarations(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeList(26896 /* TypeParameters */, nodes, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForParametersAndDelimiters: function (thisParameter, parameters, writer, enclosing, originalFlags) { + var printer = ts.createPrinter({ removeComments: true }); + var flags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */ | toNodeBuilderFlags(originalFlags); + var thisParameterArray = thisParameter ? [nodeBuilder.symbolToParameterDeclaration(thisParameter, enclosing, flags)] : []; + var params = ts.createNodeArray(thisParameterArray.concat(ts.map(parameters, function (param) { return nodeBuilder.symbolToParameterDeclaration(param, enclosing, flags); }))); + printer.writeList(1296 /* CallExpressionArguments */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForTypeParametersAndDelimiters: function (typeParameters, writer, enclosing, flags) { + var printer = ts.createPrinter({ removeComments: true }); + var args = ts.createNodeArray(ts.map(typeParameters, function (p) { return nodeBuilder.typeParameterToDeclaration(p, enclosing, toNodeBuilderFlags(flags)); })); + printer.writeList(26896 /* TypeParameters */, args, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildReturnTypeDisplay: function (signature, writer, enclosing, flags) { + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = getTypePredicateOfSignature(signature); + if (predicate) { + return typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + } + var node = nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + } + }; + function emitTextWriterWrapper(underlying) { + return { + write: ts.noop, + writeTextOfNode: ts.noop, + writeLine: ts.noop, + increaseIndent: function () { + return underlying.increaseIndent(); + }, + decreaseIndent: function () { + return underlying.decreaseIndent(); + }, + getText: function () { + return ""; + }, + rawWrite: ts.noop, + writeLiteral: function (s) { + return underlying.writeStringLiteral(s); + }, + getTextPos: function () { + return 0; + }, + getLine: function () { + return 0; + }, + getColumn: function () { + return 0; + }, + getIndent: function () { + return 0; + }, + isAtStartOfLine: function () { + return false; + }, + clear: function () { + return underlying.clear(); + }, + writeKeyword: function (text) { + return underlying.writeKeyword(text); + }, + writeOperator: function (text) { + return underlying.writeOperator(text); + }, + writePunctuation: function (text) { + return underlying.writePunctuation(text); + }, + writeSpace: function (text) { + return underlying.writeSpace(text); + }, + writeStringLiteral: function (text) { + return underlying.writeStringLiteral(text); + }, + writeParameter: function (text) { + return underlying.writeParameter(text); + }, + writeProperty: function (text) { + return underlying.writeProperty(text); + }, + writeSymbol: function (text, symbol) { + return underlying.writeSymbol(text, symbol); + }, + trackSymbol: function (symbol, enclosing, meaning) { + return underlying.trackSymbol && underlying.trackSymbol(symbol, enclosing, meaning); + }, + reportInaccessibleThisError: function () { + return underlying.reportInaccessibleThisError && underlying.reportInaccessibleThisError(); + }, + reportPrivateInBaseOfClassExpression: function (name) { + return underlying.reportPrivateInBaseOfClassExpression && underlying.reportPrivateInBaseOfClassExpression(name); + }, + reportInaccessibleUniqueSymbolError: function () { + return underlying.reportInaccessibleUniqueSymbolError && underlying.reportInaccessibleUniqueSymbolError(); + } + }; + } + } function getJsxNamespace() { if (!_jsxNamespace) { _jsxNamespace = "React"; @@ -26689,7 +27448,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 234 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 234 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 237 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 237 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -26710,8 +27469,11 @@ var ts; error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - var message_2 = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message_2 = target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */ + ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); }); @@ -26807,7 +27569,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -26861,21 +27623,21 @@ var ts; return true; } var sourceFiles = host.getSourceFiles(); - return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); + return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 177 /* BindingElement */) { + if (declaration.kind === 180 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 177 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 180 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 227 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 230 /* VariableDeclaration */), usage); } - else if (declaration.kind === 227 /* VariableDeclaration */) { + else if (declaration.kind === 230 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -26889,12 +27651,12 @@ var ts; // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === 247 /* ExportSpecifier */ || (usage.parent.kind === 244 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 250 /* ExportSpecifier */ || (usage.parent.kind === 247 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 244 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 247 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -26902,9 +27664,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 209 /* VariableStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 212 /* VariableStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -26924,16 +27686,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 150 /* PropertyDeclaration */ && + current.parent.kind === 151 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 152 /* MethodDeclaration */) { + if (declaration.kind === 153 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 150 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -26949,14 +27711,15 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, suggestedNameNotFoundMessage) { - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, getSymbol, suggestedNameNotFoundMessage); + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, suggestedNameNotFoundMessage) { + if (excludeGlobals === void 0) { excludeGlobals = false; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, suggestedNameNotFoundMessage); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, lookup, suggestedNameNotFoundMessage) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, suggestedNameNotFoundMessage) { var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; var lastLocation; - var lastNonBlockLocation; + var lastSelfReferenceLocation; var propertyWithInvalidInitializer; var errorLocation = location; var grandparent; @@ -26973,12 +27736,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 279 /* JSDocComment */) { + if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 282 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 147 /* Parameter */ || - lastLocation.kind === 146 /* TypeParameter */ + lastLocation.kind === 148 /* Parameter */ || + lastLocation.kind === 147 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -26988,11 +27751,16 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 147 /* Parameter */ || + lastLocation.kind === 148 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 147 /* Parameter */); + result.valueDeclaration.kind === 148 /* Parameter */); } } + else if (location.kind === 170 /* ConditionalType */) { + // A type parameter declared using 'infer T' in a conditional type is visible only in + // the true branch of the conditional type. + useResult = lastLocation === location.trueType; + } if (useResult) { break loop; } @@ -27002,17 +27770,17 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 269 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. - if (result = moduleExports.get("default")) { + if (result = moduleExports.get("default" /* Default */)) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { break loop; @@ -27033,7 +27801,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - ts.getDeclarationOfKind(moduleExport, 247 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExport, 250 /* ExportSpecifier */)) { break; } } @@ -27041,13 +27809,13 @@ var ts; break loop; } break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -27064,9 +27832,9 @@ var ts; } } break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 793064 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { // ignore type parameters not declared in this container @@ -27082,7 +27850,7 @@ var ts; } break loop; } - if (location.kind === 200 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 203 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -27090,7 +27858,7 @@ var ts; } } break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 85 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -27110,9 +27878,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 231 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 234 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -27120,19 +27888,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -27145,7 +27913,7 @@ var ts; } } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -27154,7 +27922,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 147 /* Parameter */) { + if (location.parent && location.parent.kind === 148 /* Parameter */) { location = location.parent; } // @@ -27168,26 +27936,28 @@ var ts; } break; } - if (location.kind !== 208 /* Block */) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. - // If `result === lastLocation.symbol`, that means that we are somewhere inside `lastLocation` looking up a name, and resolving to `lastLocation` itself. + // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { - result.isReferenced = true; + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + result.isReferenced |= meaning; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 269 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 272 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports") { return lastLocation.symbol; } } - result = lookup(globals, name, meaning); + if (!excludeGlobals) { + result = lookup(globals, name, meaning); + } } if (!result) { if (nameNotFoundMessage) { @@ -27243,27 +28013,40 @@ var ts; // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 237 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 240 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); } } } return result; } + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 237 /* ModuleDeclaration */:// For `namespace N { N; }` + return true; + default: + return false; + } + } function diagnosticName(nameArg) { return ts.isString(nameArg) ? ts.unescapeLeadingUnderscores(nameArg) : ts.declarationNameToString(nameArg); } function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 146 /* TypeParameter */ && decl.parent === container) { + if (decl.kind === 147 /* TypeParameter */ && decl.parent === container) { return true; } } return false; } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 71 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); @@ -27309,9 +28092,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -27374,7 +28157,7 @@ var ts; function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 233 /* EnumDeclaration */) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 236 /* EnumDeclaration */) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { if (result.flags & 2 /* BlockScopedVariable */) { @@ -27397,13 +28180,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return node; - case 240 /* ImportClause */: + case 243 /* ImportClause */: return node.parent; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return node.parent.parent; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -27413,11 +28196,46 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } + function resolveExportByName(moduleSymbol, name, dontResolveAlias) { + var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); + return exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), name) + : resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias); + } + function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) { + if (!allowSyntheticDefaultImports) { + return false; + } + // Declaration files (and ambient modules) + if (!file || file.isDeclarationFile) { + // Definitely cannot have a synthetic default if they have a default member specified + if (resolveExportByName(moduleSymbol, "default" /* Default */, dontResolveAlias)) { + return false; + } + // It _might_ still be incorrect to assume there is no __esModule marker on the import at runtime, even if there is no `default` member + // So we check a bit more, + if (resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias)) { + // If there is an `__esModule` specified in the declaration (meaning someone explicitly added it or wrote it in their code), + // it definitely is a module and does not have a synthetic default + return false; + } + // There are _many_ declaration files not written with esmodules in mind that still get compiled into a format with __esModule set + // Meaning there may be no default at runtime - however to be on the permissive side, we allow access to a synthetic default member + // as there is no marker to indicate if the accompanying JS has `__esModule` or not, or is even native esm + return true; + } + // TypeScript files never have a synthetic default (as they are always emitted with an __esModule marker) _unless_ they contain an export= statement + if (!ts.isSourceFileJavaScript(file)) { + return hasExportAssignmentSymbol(moduleSymbol); + } + // JS files have a synthetic default if they do not contain ES2015+ module syntax (export = is not valid in js) _and_ do not have an __esModule marker + return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias); + } function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { @@ -27426,15 +28244,15 @@ var ts; exportDefaultSymbol = moduleSymbol; } else { - var exportValue = moduleSymbol.exports.get("export="); - exportDefaultSymbol = exportValue - ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") - : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, dontResolveAlias); } - if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { + var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias); + if (!exportDefaultSymbol && !hasSyntheticDefault) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } - else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + else if (!exportDefaultSymbol && hasSyntheticDefault) { + // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; @@ -27514,7 +28332,7 @@ var ts; symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); var symbolFromModule = getExportOfModule(targetSymbol, name.escapedText, dontResolveAlias); // If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default - if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default") { + if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default" /* Default */) { symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? @@ -27543,19 +28361,19 @@ var ts; } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } @@ -27610,11 +28428,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 247 /* ExportSpecifier */) { + else if (node.kind === 250 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -27636,13 +28454,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 144 /* QualifiedName */) { + if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 145 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 238 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 241 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -27664,13 +28482,12 @@ var ts; return undefined; } } - else if (name.kind === 144 /* QualifiedName */ || name.kind === 180 /* PropertyAccessExpression */) { + else if (name.kind === 145 /* QualifiedName */ || name.kind === 183 /* PropertyAccessExpression */) { var left = void 0; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { left = name.left; } - else if (name.kind === 180 /* PropertyAccessExpression */ && - (name.expression.kind === 186 /* ParenthesizedExpression */ || ts.isEntityNameExpression(name.expression))) { + else if (name.kind === 183 /* PropertyAccessExpression */) { left = name.expression; } else { @@ -27680,7 +28497,7 @@ var ts; // i.e class C extends foo()./*do language service operation here*/B {} return undefined; } - var right = name.kind === 144 /* QualifiedName */ ? name.right : name.name; + var right = name.kind === 145 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -27699,15 +28516,6 @@ var ts; return undefined; } } - else if (name.kind === 186 /* ParenthesizedExpression */) { - // If the expression in parenthesizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. - // This is the case when we are trying to do any language service operation in heritage clauses. - // By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression will attempt to checkPropertyAccessExpression to resolve symbol. - // i.e class C extends foo()./*do language service operation here*/B {} - return ts.isEntityNameExpression(name.expression) ? - resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : - undefined; - } else { ts.Debug.assertNever(name, "Unknown entity name kind."); } @@ -27719,11 +28527,9 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 13 /* NoSubstitutionTemplateLiteral */) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return ts.isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -27766,7 +28572,7 @@ var ts; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } else if (noImplicitAny && moduleNotFoundError) { - var errorInfo = !resolvedModule.isExternalLibraryImport ? undefined : ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference); + var errorInfo = resolvedModule.packageId && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, resolvedModule.packageId.name); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } @@ -27801,8 +28607,42 @@ var ts; // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); - if (!dontResolveAlias && symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { - error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + if (!dontResolveAlias && symbol) { + if (!(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + return symbol; + } + if (compilerOptions.esModuleInterop) { + var referenceParent = moduleReferenceExpression.parent; + if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) || + ts.isImportCall(referenceParent)) { + var type = getTypeOfSymbol(symbol); + var sigs = getSignaturesOfStructuredType(type, 0 /* Call */); + if (!sigs || !sigs.length) { + sigs = getSignaturesOfStructuredType(type, 1 /* Construct */); + } + if (sigs && sigs.length) { + var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol); + // Create a new symbol which has the module's type less the call and construct signatures + var result = createSymbol(symbol.flags, symbol.escapedName); + result.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result.parent = symbol.parent; + result.target = symbol; + result.originatingImport = referenceParent; + if (symbol.valueDeclaration) + result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; + if (symbol.members) + result.members = ts.cloneMap(symbol.members); + if (symbol.exports) + result.exports = ts.cloneMap(symbol.exports); + var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above + result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.stringIndexInfo, resolvedModuleType.numberIndexInfo); + return result; + } + } + } } return symbol; } @@ -27855,7 +28695,7 @@ var ts; if (!source) return; source.forEach(function (sourceSymbol, id) { - if (id === "default") + if (id === "default" /* Default */) return; var targetSymbol = target.get(id); if (!targetSymbol) { @@ -27938,7 +28778,7 @@ var ts; var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 153 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -28016,12 +28856,12 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -28040,11 +28880,14 @@ var ts; } var visitedSymbolTables = []; return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - function getAccessibleSymbolChainFromSymbolTable(symbols) { + /** + * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already) + */ + function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification) { if (!ts.pushIfUnique(visitedSymbolTables, symbols)) { return undefined; } - var result = trySymbolTable(symbols); + var result = trySymbolTable(symbols, ignoreQualification); visitedSymbolTables.pop(); return result; } @@ -28054,36 +28897,34 @@ var ts; // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { + function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) && // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) // and if symbolFromSymbolTable or alias resolution matches the symbol, // check the symbol can be qualified, it is only then this symbol is accessible !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning)); } - function isUMDExportSymbol(symbol) { - return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); - } - function trySymbolTable(symbols) { + function trySymbolTable(symbols, ignoreQualification) { // If symbol is directly available by its name in the symbol table - if (isAccessible(symbols.get(symbol.escapedName))) { + if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification)) { return [symbol]; } // Check if symbol is any of the alias return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" - && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) + && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) { + if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { return [symbolFromSymbolTable]; } // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain // but only if the symbolFromSymbolTable can be qualified - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + var candidateTable = getExportsOfSymbol(resolvedImportedSymbol); + var accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable, /*ignoreQualification*/ true); if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); } @@ -28106,7 +28947,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 247 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 250 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -28121,10 +28962,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: continue; default: return false; @@ -28138,6 +28979,10 @@ var ts; var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); return access.accessibility === 0 /* Accessible */; } + function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 107455 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false); + return access.accessibility === 0 /* Accessible */; + } /** * Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested * @@ -28206,7 +29051,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -28240,14 +29085,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 163 /* TypeQuery */ || + if (entityName.parent.kind === 164 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 145 /* ComputedPropertyName */) { + entityName.parent.kind === 146 /* ComputedPropertyName */) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 144 /* QualifiedName */ || entityName.kind === 180 /* PropertyAccessExpression */ || - entityName.parent.kind === 238 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 145 /* QualifiedName */ || entityName.kind === 183 /* PropertyAccessExpression */ || + entityName.parent.kind === 241 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -28265,97 +29110,134 @@ var ts; errorNode: firstIdentifier }; } - function writeKeyword(writer, kind) { - writer.writeKeyword(ts.tokenToString(kind)); + function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { + if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } + var nodeFlags = 3112960 /* IgnoreErrors */; + if (flags & 2 /* UseOnlyExternalAliasing */) { + nodeFlags |= 128 /* UseOnlyExternalAliasing */; + } + if (flags & 1 /* WriteTypeParametersOrArguments */) { + nodeFlags |= 512 /* WriteTypeParametersInQualifiedName */; + } + if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) { + nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; + } + var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; + return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); + function symbolToStringWorker(writer) { + var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); + return writer; + } } - function writePunctuation(writer, kind) { - writer.writePunctuation(ts.tokenToString(kind)); + function signatureToString(signature, enclosingDeclaration, flags, kind, writer) { + return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker); + function signatureToStringWorker(writer) { + var sigOutput; + if (flags & 262144 /* WriteArrowStyleSignature */) { + sigOutput = kind === 1 /* Construct */ ? 163 /* ConstructorType */ : 162 /* FunctionType */; + } + else { + sigOutput = kind === 1 /* Construct */ ? 158 /* ConstructSignature */ : 157 /* CallSignature */; + } + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, writer); + return writer; + } } - function writeSpace(writer) { - writer.writeSpace(" "); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); - }); - } - function signatureToString(signature, enclosingDeclaration, flags, kind) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); - }); - } - function typeToString(type, enclosingDeclaration, flags) { - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | ts.NodeBuilderFlags.IgnoreErrors | ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName); + function typeToString(type, enclosingDeclaration, flags, writer) { + if (writer === void 0) { writer = ts.createTextWriter(""); } + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); ts.Debug.assert(typeNode !== undefined, "should always get typenode"); var options = { removeComments: true }; - var writer = ts.createTextWriter(""); var printer = ts.createPrinter(options); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ sourceFile, writer); var result = writer.getText(); - var maxLength = compilerOptions.noErrorTruncation || flags & 8 /* NoTruncation */ ? undefined : 100; - if (maxLength && result.length >= maxLength) { + var maxLength = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */ ? undefined : 100; + if (maxLength && result && result.length >= maxLength) { return result.substr(0, maxLength - "...".length) + "..."; } return result; - function toNodeBuilderFlags(flags) { - var result = ts.NodeBuilderFlags.None; - if (!flags) { - return result; - } - if (flags & 8 /* NoTruncation */) { - result |= ts.NodeBuilderFlags.NoTruncation; - } - if (flags & 256 /* UseFullyQualifiedType */) { - result |= ts.NodeBuilderFlags.UseFullyQualifiedType; - } - if (flags & 4096 /* SuppressAnyReturnType */) { - result |= ts.NodeBuilderFlags.SuppressAnyReturnType; - } - if (flags & 1 /* WriteArrayAsGenericType */) { - result |= ts.NodeBuilderFlags.WriteArrayAsGenericType; - } - if (flags & 64 /* WriteTypeArgumentsOfSignature */) { - result |= ts.NodeBuilderFlags.WriteTypeArgumentsOfSignature; - } - return result; - } + } + function toNodeBuilderFlags(flags) { + return flags & 9469291 /* NodeBuilderFlagsMask */; } function createNodeBuilder() { return { - typeToTypeNode: function (type, enclosingDeclaration, flags) { + typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = typeToTypeNodeHelper(type, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = signatureToSignatureDeclarationHelper(signature, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; - } + }, + symbolToEntityName: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToName(symbol, context, meaning, /*expectsIdentifier*/ false); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToExpression: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToExpression(symbol, context, meaning); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToTypeParameterDeclarations: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParametersToTypeParameterDeclarations(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToParameterDeclaration: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToParameterDeclaration(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + typeParameterToDeclaration: function (parameter, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParameterToDeclaration(parameter, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, }; - function createNodeBuilderContext(enclosingDeclaration, flags) { + function createNodeBuilderContext(enclosingDeclaration, flags, tracker) { return { enclosingDeclaration: enclosingDeclaration, flags: flags, + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop }, encounteredError: false, symbolStack: undefined }; } function typeToTypeNodeHelper(type, context) { - var inTypeAlias = context.flags & ts.NodeBuilderFlags.InTypeAlias; - context.flags &= ~ts.NodeBuilderFlags.InTypeAlias; + var inTypeAlias = context.flags & 8388608 /* InTypeAlias */; + context.flags &= ~8388608 /* InTypeAlias */; if (!type) { context.encounteredError = true; return undefined; @@ -28364,10 +29246,10 @@ var ts; return ts.createKeywordTypeNode(119 /* AnyKeyword */); } if (type.flags & 2 /* String */) { - return ts.createKeywordTypeNode(136 /* StringKeyword */); + return ts.createKeywordTypeNode(137 /* StringKeyword */); } if (type.flags & 4 /* Number */) { - return ts.createKeywordTypeNode(133 /* NumberKeyword */); + return ts.createKeywordTypeNode(134 /* NumberKeyword */); } if (type.flags & 8 /* Boolean */) { return ts.createKeywordTypeNode(122 /* BooleanKeyword */); @@ -28392,31 +29274,39 @@ var ts; return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); } if (type.flags & 1024 /* UniqueESSymbol */) { - return ts.createTypeOperatorNode(140 /* UniqueKeyword */, ts.createKeywordTypeNode(137 /* SymbolKeyword */)); + if (!(context.flags & 1048576 /* AllowUniqueESSymbolType */)) { + if (context.tracker.reportInaccessibleUniqueSymbolError) { + context.tracker.reportInaccessibleUniqueSymbolError(); + } + } + return ts.createTypeOperatorNode(141 /* UniqueKeyword */, ts.createKeywordTypeNode(138 /* SymbolKeyword */)); } if (type.flags & 2048 /* Void */) { return ts.createKeywordTypeNode(105 /* VoidKeyword */); } if (type.flags & 4096 /* Undefined */) { - return ts.createKeywordTypeNode(139 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(140 /* UndefinedKeyword */); } if (type.flags & 8192 /* Null */) { return ts.createKeywordTypeNode(95 /* NullKeyword */); } if (type.flags & 16384 /* Never */) { - return ts.createKeywordTypeNode(130 /* NeverKeyword */); + return ts.createKeywordTypeNode(131 /* NeverKeyword */); } if (type.flags & 512 /* ESSymbol */) { - return ts.createKeywordTypeNode(137 /* SymbolKeyword */); + return ts.createKeywordTypeNode(138 /* SymbolKeyword */); } - if (type.flags & 33554432 /* NonPrimitive */) { - return ts.createKeywordTypeNode(134 /* ObjectKeyword */); + if (type.flags & 134217728 /* NonPrimitive */) { + return ts.createKeywordTypeNode(135 /* ObjectKeyword */); } if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { - if (context.flags & ts.NodeBuilderFlags.InObjectTypeLiteral) { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowThisInObjectLiteral)) { + if (context.flags & 4194304 /* InObjectTypeLiteral */) { + if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) { context.encounteredError = true; } + if (context.tracker.reportInaccessibleThisError) { + context.tracker.reportInaccessibleThisError(); + } } return ts.createThis(); } @@ -28430,7 +29320,7 @@ var ts; // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } - if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { + if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -28439,11 +29329,11 @@ var ts; var types = type.flags & 131072 /* Union */ ? formatUnionTypes(type.types) : type.types; var typeNodes = mapToTypeNodes(types, context); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 167 /* UnionType */ : 168 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 168 /* UnionType */ : 169 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowEmptyUnionOrIntersection)) { + if (!context.encounteredError && !(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) { context.encounteredError = true; } return undefined; @@ -28464,12 +29354,22 @@ var ts; var indexTypeNode = typeToTypeNodeHelper(type.indexType, context); return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 2097152 /* Conditional */) { + var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); + var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); + var trueTypeNode = typeToTypeNodeHelper(type.trueType, context); + var falseTypeNode = typeToTypeNodeHelper(type.falseType, context); + return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + if (type.flags & 4194304 /* Substitution */) { + return typeToTypeNodeHelper(type.typeParameter, context); + } ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { ts.Debug.assert(!!(type.flags & 65536 /* Object */)); - var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131 /* ReadonlyKeyword */) : undefined; - var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55 /* QuestionToken */) : undefined; - var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context); + var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined; + var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined; + var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); var mappedTypeNode = ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); @@ -28478,7 +29378,7 @@ var ts; var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 203 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return createTypeQueryNodeFromSymbol(symbol, 107455 /* Value */); @@ -28501,10 +29401,16 @@ var ts; if (!context.symbolStack) { context.symbolStack = []; } - context.symbolStack.push(symbol); - var result = createTypeNodeFromObjectType(type); - context.symbolStack.pop(); - return result; + var isConstructorObject = ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; + if (isConstructorObject) { + return createTypeNodeFromObjectType(type); + } + else { + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } } } else { @@ -28517,11 +29423,12 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; + return declaration.parent.kind === 272 /* SourceFile */ || declaration.parent.kind === 238 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions - return ts.contains(context.symbolStack, symbol); // it is type of the symbol uses itself recursively + return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ts.contains(context.symbolStack, symbol)) && // it is type of the symbol uses itself recursively + (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); // And the build is going to succeed without visibility error or there is no structural fallback allowed } } } @@ -28536,21 +29443,21 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 161 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 163 /* ConstructorType */, context); return signatureNode; } } var savedFlags = context.flags; - context.flags |= ts.NodeBuilderFlags.InObjectTypeLiteral; + context.flags |= 4194304 /* InObjectTypeLiteral */; var members = createTypeNodesFromResolvedType(resolved); context.flags = savedFlags; var typeLiteralNode = ts.createTypeLiteralNode(members); - return ts.setEmitFlags(typeLiteralNode, 1 /* SingleLine */); + return ts.setEmitFlags(typeLiteralNode, (context.flags & 1024 /* MultilineObjectLiterals */) ? 0 : 1 /* SingleLine */); } function createTypeQueryNodeFromSymbol(symbol, symbolFlags) { var entityName = symbolToName(symbol, context, symbolFlags, /*expectsIdentifier*/ false); @@ -28564,7 +29471,7 @@ var ts; function typeReferenceToTypeNode(type) { var typeArguments = type.typeArguments || ts.emptyArray; if (type.target === globalArrayType) { - if (context.flags & ts.NodeBuilderFlags.WriteArrayAsGenericType) { + if (context.flags & 2 /* WriteArrayAsGenericType */) { var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context); return ts.createTypeReferenceNode("Array", [typeArgumentNode]); } @@ -28578,12 +29485,17 @@ var ts; return ts.createTupleTypeNode(tupleConstituentNodes); } } - if (context.encounteredError || (context.flags & ts.NodeBuilderFlags.AllowEmptyTuple)) { + if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { return ts.createTupleTypeNode([]); } context.encounteredError = true; return undefined; } + else if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && + type.symbol.valueDeclaration && + type.symbol.valueDeclaration.kind === 203 /* ClassExpression */) { + return createAnonymousTypeNode(type); + } else { var outerTypeParameters = type.target.outerTypeParameters; var i = 0; @@ -28655,14 +29567,17 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 156 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 158 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context)); + var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? + createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : + resolvedType.stringIndexInfo; + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -28673,9 +29588,25 @@ var ts; } for (var _d = 0, properties_1 = properties; _d < properties_1.length; _d++) { var propertySymbol = properties_1[_d]; - var propertyType = getTypeOfSymbol(propertySymbol); + if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) { + if (propertySymbol.flags & 4194304 /* Prototype */) { + continue; + } + if (ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 /* Private */ | 16 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) { + context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName)); + } + } + var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; + if (ts.getCheckFlags(propertySymbol) & 1024 /* Late */) { + var decl = ts.firstOrUndefined(propertySymbol.declarations); + var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); + if (name && context.tracker.trackSymbol) { + context.tracker.trackSymbol(name, saveEnclosingDeclaration, 107455 /* Value */); + } + } var propertyName = symbolToName(propertySymbol, context, 107455 /* Value */, /*expectsIdentifier*/ true); context.enclosingDeclaration = saveEnclosingDeclaration; var optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? ts.createToken(55 /* QuestionToken */) : undefined; @@ -28683,15 +29614,18 @@ var ts; var signatures = getSignaturesOfType(propertyType, 0 /* Call */); for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { var signature = signatures_1[_e]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 151 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(methodDeclaration); } } else { + var savedFlags = context.flags; + context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119 /* AnyKeyword */); - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined; + context.flags = savedFlags; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined; var propertySignature = ts.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode, /*initializer*/ undefined); typeElements.push(propertySignature); @@ -28715,27 +29649,37 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 136 /* StringKeyword */ : 133 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 137 /* StringKeyword */ : 134 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name, /*questionToken*/ undefined, indexerTypeNode, /*initializer*/ undefined); - var typeNode = typeToTypeNodeHelper(indexInfo.type, context); + var typeNode = indexInfo.type ? typeToTypeNodeHelper(indexInfo.type, context) : typeToTypeNodeHelper(anyType, context); + if (!indexInfo.type && !(context.flags & 2097152 /* AllowEmptyIndexInfoType */)) { + context.encounteredError = true; + } return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { - var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + var typeParameters; + var typeArguments; + if (context.flags & 32 /* WriteTypeArgumentsOfSignature */ && signature.target && signature.mapper && signature.target.typeParameters) { + typeArguments = signature.target.typeParameters.map(function (parameter) { return typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context); }); + } + else { + typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + } var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); } var returnTypeNode; - if (signature.typePredicate) { - var typePredicate = signature.typePredicate; + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { var parameterName = typePredicate.kind === 1 /* Identifier */ ? ts.setEmitFlags(ts.createIdentifier(typePredicate.parameterName), 16777216 /* NoAsciiEscaping */) : ts.createThisTypeNode(); @@ -28746,7 +29690,7 @@ var ts; var returnType = getReturnTypeOfSignature(signature); returnTypeNode = returnType && typeToTypeNodeHelper(returnType, context); } - if (context.flags & ts.NodeBuilderFlags.SuppressAnyReturnType) { + if (context.flags & 256 /* SuppressAnyReturnType */) { if (returnTypeNode && returnTypeNode.kind === 119 /* AnyKeyword */) { returnTypeNode = undefined; } @@ -28754,25 +29698,28 @@ var ts; else if (!returnTypeNode) { returnTypeNode = ts.createKeywordTypeNode(119 /* AnyKeyword */); } - return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode); + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments); } - function typeParameterToDeclaration(type, context) { + function typeParameterToDeclaration(type, context, constraint) { + if (constraint === void 0) { constraint = getConstraintFromTypeParameter(type); } + var savedContextFlags = context.flags; + context.flags &= ~512 /* WriteTypeParametersInQualifiedName */; // Avoids potential infinite loop when building for a claimspace with a generic var name = symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ true); - var constraint = getConstraintFromTypeParameter(type); var constraintNode = constraint && typeToTypeNodeHelper(constraint, context); var defaultParameter = getDefaultFromTypeParameter(type); var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); + context.flags = savedContextFlags; return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); } function symbolToParameterDeclaration(parameterSymbol, context) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 147 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148 /* Parameter */); ts.Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter); var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { parameterType = getOptionalType(parameterType); } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); - var modifiers = parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); + var modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); var dotDotDotToken = !parameterDeclaration || ts.isRestParameter(parameterDeclaration) ? ts.createToken(24 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? @@ -28791,54 +29738,29 @@ var ts; function elideInitializerAndSetEmitFlags(node) { var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 177 /* BindingElement */) { + if (clone.kind === 180 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); } } } - function symbolToName(symbol, context, meaning, expectsIdentifier) { + function lookupSymbolChain(symbol, context, meaning) { + context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & ts.NodeBuilderFlags.UseFullyQualifiedType)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */)) { chain = getSymbolChain(symbol, meaning, /*endOfChain*/ true); ts.Debug.assert(chain && chain.length > 0); } else { chain = [symbol]; } - if (expectsIdentifier && chain.length !== 1 - && !context.encounteredError - && !(context.flags & ts.NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { - context.encounteredError = true; - } - return createEntityNameFromSymbolChain(chain, chain.length - 1); - function createEntityNameFromSymbolChain(chain, index) { - ts.Debug.assert(chain && 0 <= index && index < chain.length); - var symbol = chain[index]; - var typeParameterNodes; - if (context.flags & ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName && index > 0) { - var parentSymbol = chain[index - 1]; - var typeParameters = void 0; - if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); - } - else { - var targetSymbol = getTargetSymbol(parentSymbol); - if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { - typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - } - } - typeParameterNodes = mapToTypeNodes(typeParameters, context); - } - var identifier = ts.setEmitFlags(ts.createIdentifier(getNameOfSymbolAsWritten(symbol, context), typeParameterNodes), 16777216 /* NoAsciiEscaping */); - return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; - } + return chain; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); var parentSymbol; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { @@ -28866,11 +29788,105 @@ var ts; } } } + function typeParametersToTypeParameterDeclarations(symbol, context) { + var typeParameterNodes; + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { + typeParameterNodes = ts.createNodeArray(ts.map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), function (tp) { return typeParameterToDeclaration(tp, context); })); + } + return typeParameterNodes; + } + function lookupTypeParameterNodes(chain, index, context) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterNodes; + if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { + var parentSymbol = symbol; + var nextSymbol = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); + typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + } + else { + typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); + } + } + return typeParameterNodes; + } + function symbolToName(symbol, context, meaning, expectsIdentifier) { + var chain = lookupSymbolChain(symbol, context, meaning); + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & 65536 /* AllowQualifedNameInPlaceOfIdentifier */)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216 /* InInitialEntityName */; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216 /* InInitialEntityName */; + } + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + identifier.symbol = symbol; + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + } + function symbolToExpression(symbol, context, meaning) { + var chain = lookupSymbolChain(symbol, context, meaning); + return createExpressionFromSymbolChain(chain, chain.length - 1); + function createExpressionFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216 /* InInitialEntityName */; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216 /* InInitialEntityName */; + } + var firstChar = symbolName.charCodeAt(0); + var canUsePropertyAccess = ts.isIdentifierStart(firstChar, languageVersion); + if (index === 0 || canUsePropertyAccess) { + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + identifier.symbol = symbol; + return index > 0 ? ts.createPropertyAccess(createExpressionFromSymbolChain(chain, index - 1), identifier) : identifier; + } + else { + if (firstChar === 91 /* openBracket */) { + symbolName = symbolName.substring(1, symbolName.length - 1); + firstChar = symbolName.charCodeAt(0); + } + var expression = void 0; + if (ts.isSingleOrDoubleQuote(firstChar)) { + expression = ts.createLiteral(symbolName.substring(1, symbolName.length - 1).replace(/\\./g, function (s) { return s.substring(1); })); + expression.singleQuote = firstChar === 39 /* singleQuote */; + } + else if (("" + +symbolName) === symbolName) { + expression = ts.createLiteral(+symbolName); + } + if (!expression) { + expression = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + expression.symbol = symbol; + } + return ts.createElementAccess(createExpressionFromSymbolChain(chain, index - 1), expression); + } + } + } } - function typePredicateToString(typePredicate, enclosingDeclaration, flags) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); - }); + function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) { + return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); + function typePredicateToStringWorker(writer) { + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); + return writer; + } } function formatUnionTypes(types) { var result = []; @@ -28910,8 +29926,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 169 /* ParenthesizedType */; }); - if (node.kind === 232 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 172 /* ParenthesizedType */; }); + if (node.kind === 235 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -28919,12 +29935,15 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 235 /* ModuleBlock */ && + node.parent.kind === 238 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? '"' + ts.escapeString(type.value) + '"' : "" + type.value; } + function isDefaultBindingContext(location) { + return location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location); + } /** * Gets a human-readable name for a symbol. * Should *not* be used for the right-hand side of a `.` -- use `symbolName(symbol)` for that instead. @@ -28933,23 +29952,32 @@ var ts; * It will also use a representation of a number as written instead of a decimal form, e.g. `0o11` instead of `9`. */ function getNameOfSymbolAsWritten(symbol, context) { + if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && + // If it's not the first part of an entity name, it must print as `default` + (!(context.flags & 16777216 /* InInitialEntityName */) || + // if the symbol is synthesized, it will only be referenced externally it must print as `default` + !symbol.declarations || + // if not in the same binding context (source file, module declaration), it must print as `default` + (context.enclosingDeclaration && ts.findAncestor(symbol.declarations[0], isDefaultBindingContext) !== ts.findAncestor(context.enclosingDeclaration, isDefaultBindingContext)))) { + return "default"; + } if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; var name = ts.getNameOfDeclaration(declaration); if (name) { return ts.declarationNameToString(name); } - if (declaration.parent && declaration.parent.kind === 227 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } - if (context && !context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowAnonymousIdentifier)) { + if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } switch (declaration.kind) { - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return "(Anonymous class)"; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return "(Anonymous function)"; } } @@ -28961,727 +29989,6 @@ var ts; } return ts.symbolName(symbol); } - function getSymbolDisplayBuilder() { - /** - * Writes only the name of the symbol out to the writer. Uses the original source text - * for the name of the symbol if it is available to match how the user wrote the name. - */ - function appendSymbolNameOnly(symbol, writer) { - writer.writeSymbol(getNameOfSymbolAsWritten(symbol), symbol); - } - /** - * Writes a property access or element access with the name of the symbol out to the writer. - * Uses the original source text for the name of the symbol if it is available to match how the user wrote the name, - * ensuring that any names written with literals use element accesses. - */ - function appendPropertyOrElementAccessForSymbol(symbol, writer) { - var symbolName = symbol.escapedName === "default" ? "default" : getNameOfSymbolAsWritten(symbol); - var firstChar = symbolName.charCodeAt(0); - var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); - if (needsElementAccess) { - if (firstChar !== 91 /* openBracket */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - } - if (ts.isSingleOrDoubleQuote(firstChar)) { - writer.writeStringLiteral(symbolName); - } - else { - writer.writeSymbol(symbolName, symbol); - } - if (firstChar !== 91 /* openBracket */) { - writePunctuation(writer, 22 /* CloseBracketToken */); - } - } - else { - writePunctuation(writer, 23 /* DotToken */); - writer.writeSymbol(symbolName, symbol); - } - } - /** - * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope - * Meaning needs to be specified if the enclosing declaration is given - */ - function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { - var parentSymbol; - function appendParentTypeArgumentsAndSymbolName(symbol) { - if (parentSymbol) { - // Write type arguments of instantiated class/interface here - if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - buildDisplayForTypeArgumentsAndDelimiters(params, symbol.mapper, writer, enclosingDeclaration); - } - else { - buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - appendPropertyOrElementAccessForSymbol(symbol, writer); - } - else { - appendSymbolNameOnly(symbol, writer); - } - parentSymbol = symbol; - } - // Let the writer know we just wrote out a symbol. The declaration emitter writer uses - // this to determine if an import it has previously seen (and not written out) needs - // to be written to the file once the walk of the tree is complete. - // - // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree - // up front (for example, during checking) could determine if we need to emit the imports - // and we could then access that data during declaration emit. - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ - function walkSymbol(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - // Go up and add our parent. - var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent) { - walkSymbol(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); - } - } - if (accessibleSymbolChain) { - for (var _i = 0, accessibleSymbolChain_1 = accessibleSymbolChain; _i < accessibleSymbolChain_1.length; _i++) { - var accessibleSymbol = accessibleSymbolChain_1[_i]; - appendParentTypeArgumentsAndSymbolName(accessibleSymbol); - } - } - else if ( - // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. - endOfChain || - // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) - !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && - // If a parent symbol is an anonymous type, don't write it. - !(symbol.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - // Get qualified name if the symbol is not a type parameter - // and there is an enclosing declaration or we specifically - // asked for it - var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - var typeFormatFlag = 256 /* UseFullyQualifiedType */ & typeFlags; - if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { - walkSymbol(symbol, meaning, /*endOfChain*/ true); - } - else { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, symbolStack) { - var globalFlagsToPass = globalFlags & (32 /* WriteOwnNameForAnyLike */ | 16384 /* WriteClassExpressionAsTypeLiteral */); - var inObjectTypeLiteral = false; - return writeType(type, globalFlags); - function writeType(type, flags) { - var nextFlags = flags & ~1024 /* InTypeAlias */; - // Write undefined/null type as any - if (type.flags & 33585807 /* Intrinsic */) { - // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving - writer.writeKeyword(!(globalFlags & 32 /* WriteOwnNameForAnyLike */) && isTypeAny(type) - ? "any" - : type.intrinsicName); - } - else if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { - if (inObjectTypeLiteral) { - writer.reportInaccessibleThisError(); - } - writer.writeKeyword("this"); - } - else if (ts.getObjectFlags(type) & 4 /* Reference */) { - writeTypeReference(type, nextFlags); - } - else if (type.flags & 256 /* EnumLiteral */ && !(type.flags & 131072 /* Union */)) { - var parent = getParentOfSymbol(type.symbol); - buildSymbolDisplay(parent, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); - // In a literal enum type with a single member E { A }, E and E.A denote the - // same type. We always display this type simply as E. - if (getDeclaredTypeOfSymbol(parent) !== type) { - writePunctuation(writer, 23 /* DotToken */); - appendSymbolNameOnly(type.symbol, writer); - } - } - else if (ts.getObjectFlags(type) & 3 /* ClassOrInterface */ || type.flags & (272 /* EnumLike */ | 32768 /* TypeParameter */)) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); - } - else if (!(flags & 1024 /* InTypeAlias */) && type.aliasSymbol && - ((flags & 65536 /* UseAliasDefinedOutsideCurrentScope */) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); - } - else if (type.flags & 393216 /* UnionOrIntersection */) { - writeUnionOrIntersectionType(type, nextFlags); - } - else if (ts.getObjectFlags(type) & (16 /* Anonymous */ | 32 /* Mapped */)) { - writeAnonymousType(type, nextFlags); - } - else if (type.flags & 1024 /* UniqueESSymbol */) { - if (flags & 131072 /* AllowUniqueESSymbolType */) { - writeKeyword(writer, 140 /* UniqueKeyword */); - writeSpace(writer); - } - else { - writer.reportInaccessibleUniqueSymbolError(); - } - writeKeyword(writer, 137 /* SymbolKeyword */); - } - else if (type.flags & 96 /* StringOrNumberLiteral */) { - writer.writeStringLiteral(literalTypeToString(type)); - } - else if (type.flags & 524288 /* Index */) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writer.writeKeyword("keyof"); - writeSpace(writer); - writeType(type.type, 128 /* InElementType */); - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - else if (type.flags & 1048576 /* IndexedAccess */) { - writeType(type.objectType, 128 /* InElementType */); - writePunctuation(writer, 21 /* OpenBracketToken */); - writeType(type.indexType, 0 /* None */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else { - // Should never get here - // { ... } - writePunctuation(writer, 17 /* OpenBraceToken */); - writeSpace(writer); - writePunctuation(writer, 24 /* DotDotDotToken */); - writeSpace(writer); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - } - function writeTypeList(types, delimiter) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - if (delimiter !== 26 /* CommaToken */) { - writeSpace(writer); - } - writePunctuation(writer, delimiter); - writeSpace(writer); - } - writeType(types[i], delimiter === 26 /* CommaToken */ ? 0 /* None */ : 128 /* InElementType */); - } - } - function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) { - // Unnamed function expressions and arrow functions have reserved names that we don't want to display - if (symbol.flags & 32 /* Class */ || !isReservedMemberName(symbol.escapedName)) { - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, flags); - } - if (pos < end) { - writePunctuation(writer, 27 /* LessThanToken */); - writeType(typeArguments[pos], 512 /* InFirstTypeArgument */); - pos++; - while (pos < end) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - writeType(typeArguments[pos], 0 /* None */); - pos++; - } - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function writeTypeReference(type, flags) { - var typeArguments = type.typeArguments || ts.emptyArray; - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(typeArguments[0], 128 /* InElementType */ | 32768 /* InArrayType */); - writePunctuation(writer, 21 /* OpenBracketToken */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else if (type.target.objectFlags & 8 /* Tuple */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 26 /* CommaToken */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else if (flags & 16384 /* WriteClassExpressionAsTypeLiteral */ && - type.symbol.valueDeclaration && - type.symbol.valueDeclaration.kind === 200 /* ClassExpression */) { - writeAnonymousType(type, flags); - } - else { - // Write the type reference in the format f.g.C where A and B are type arguments - // for outer type parameters, and f and g are the respective declaring containers of those - // type parameters. - var outerTypeParameters = type.target.outerTypeParameters; - var i = 0; - if (outerTypeParameters) { - var length_2 = outerTypeParameters.length; - while (i < length_2) { - // Find group of type arguments for type parameters with the same declaring container. - var start = i; - var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); - do { - i++; - } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); - // When type parameters are their own type arguments for the whole group (i.e. we have - // the default outer type arguments), we don't show the group. - if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent, typeArguments, start, i, flags); - writePunctuation(writer, 23 /* DotToken */); - } - } - } - var typeParameterCount = (type.target.typeParameters || ts.emptyArray).length; - writeSymbolTypeReference(type.symbol, typeArguments, i, typeParameterCount, flags); - } - } - function writeUnionOrIntersectionType(type, flags) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - if (type.flags & 131072 /* Union */) { - writeTypeList(formatUnionTypes(type.types), 49 /* BarToken */); - } - else { - writeTypeList(type.types, 48 /* AmpersandToken */); - } - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - function writeAnonymousType(type, flags) { - var symbol = type.symbol; - if (symbol) { - // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && - !getBaseTypeVariableOfClass(symbol) && - !(symbol.valueDeclaration.kind === 200 /* ClassExpression */ && flags & 16384 /* WriteClassExpressionAsTypeLiteral */) || - symbol.flags & (384 /* Enum */ | 512 /* ValueModule */)) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (ts.contains(symbolStack, symbol)) { - // If type is an anonymous type literal in a type alias declaration, use type alias name - var typeAlias = getTypeAliasForTypeLiteral(type); - if (typeAlias) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, flags); - } - else { - // Recursive usage, use any - writeKeyword(writer, 119 /* AnyKeyword */); - } - } - else { - // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead - // of types allows us to catch circular references to instantiations of the same anonymous type - // However, in case of class expressions, we want to write both the static side and the instance side. - // We skip adding the static side so that the instance side has a chance to be written - // before checking for circular references. - if (!symbolStack) { - symbolStack = []; - } - var isConstructorObject = type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; - if (isConstructorObject) { - writeLiteralType(type, flags); - } - else { - symbolStack.push(symbol); - writeLiteralType(type, flags); - symbolStack.pop(); - } - } - } - else { - // Anonymous types with no symbol are never circular - writeLiteralType(type, flags); - } - function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method - ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32 /* Static */); }); - var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || // is exported function symbol - ts.some(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; - })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - // typeof is allowed only for static/non local functions - return !!(flags & 4 /* UseTypeOfFunction */) || // use typeof if format flags specify it - ts.contains(symbolStack, symbol); // it is type of the symbol uses itself recursively - } - } - } - function writeTypeOfSymbol(symbol, typeFormatFlags) { - if (typeFormatFlags & 32768 /* InArrayType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writeKeyword(writer, 103 /* TypeOfKeyword */); - writeSpace(writer); - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); - if (typeFormatFlags & 32768 /* InArrayType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - function writePropertyWithModifiers(prop) { - if (isReadonlySymbol(prop)) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - if (ts.getCheckFlags(prop) & 1024 /* Late */) { - var decl = ts.firstOrUndefined(prop.declarations); - var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); - if (name) { - writer.trackSymbol(name, enclosingDeclaration, 107455 /* Value */); - } - } - buildSymbolDisplay(prop, writer); - if (prop.flags & 16777216 /* Optional */) { - writePunctuation(writer, 55 /* QuestionToken */); - } - } - function shouldAddParenthesisAroundFunctionType(callSignature, flags) { - if (flags & 128 /* InElementType */) { - return true; - } - else if (flags & 512 /* InFirstTypeArgument */) { - // Add parenthesis around function type for the first type argument to avoid ambiguity - var typeParameters = callSignature.target && (flags & 64 /* WriteTypeArgumentsOfSignature */) ? - callSignature.target.typeParameters : callSignature.typeParameters; - return typeParameters && typeParameters.length !== 0; - } - return false; - } - function writeLiteralType(type, flags) { - if (isGenericMappedType(type)) { - writeMappedType(type); - return; - } - var resolved = resolveStructuredTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 17 /* OpenBraceToken */); - writePunctuation(writer, 18 /* CloseBraceToken */); - return; - } - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags); - if (parenthesizeSignature) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); - if (parenthesizeSignature) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writeKeyword(writer, 94 /* NewKeyword */); - writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - return; - } - } - var saveInObjectTypeLiteral = inObjectTypeLiteral; - inObjectTypeLiteral = true; - writePunctuation(writer, 17 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - writeObjectLiteralType(resolved); - writer.decreaseIndent(); - writePunctuation(writer, 18 /* CloseBraceToken */); - inObjectTypeLiteral = saveInObjectTypeLiteral; - } - function writeObjectLiteralType(resolved) { - for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { - var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { - var signature = _c[_b]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1 /* Construct */, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0 /* String */, enclosingDeclaration, globalFlags, symbolStack); - buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1 /* Number */, enclosingDeclaration, globalFlags, symbolStack); - for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { - var p = _e[_d]; - if (globalFlags & 16384 /* WriteClassExpressionAsTypeLiteral */) { - if (p.flags & 4194304 /* Prototype */) { - continue; - } - if (ts.getDeclarationModifierFlagsFromSymbol(p) & (8 /* Private */ | 16 /* Protected */)) { - writer.reportPrivateInBaseOfClassExpression(ts.symbolName(p)); - } - } - var t = getTypeOfSymbol(p); - if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { - var signature = signatures_2[_f]; - writePropertyWithModifiers(p); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - else { - writePropertyWithModifiers(p); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - writeType(t, globalFlags & 16384 /* WriteClassExpressionAsTypeLiteral */); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - } - function writeMappedType(type) { - writePunctuation(writer, 17 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - if (type.declaration.readonlyToken) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 21 /* OpenBracketToken */); - appendSymbolNameOnly(getTypeParameterFromMappedType(type).symbol, writer); - writeSpace(writer); - writeKeyword(writer, 92 /* InKeyword */); - writeSpace(writer); - writeType(getConstraintTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 22 /* CloseBracketToken */); - if (type.declaration.questionToken) { - writePunctuation(writer, 55 /* QuestionToken */); - } - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - writeType(getTemplateTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - writer.decreaseIndent(); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - } - function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration, flags) { - var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */ || targetSymbol.flags & 524288 /* TypeAlias */) { - buildDisplayForTypeParametersAndDelimiters(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), writer, enclosingDeclaration, flags); - } - } - function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, symbolStack) { - appendSymbolNameOnly(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 85 /* ExtendsKeyword */); - writeSpace(writer); - buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); - } - var defaultType = getDefaultFromTypeParameter(tp); - if (defaultType) { - writeSpace(writer); - writePunctuation(writer, 58 /* EqualsToken */); - writeSpace(writer); - buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { - var parameterNode = p.valueDeclaration; - if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { - writePunctuation(writer, 24 /* DotDotDotToken */); - } - if (parameterNode && ts.isBindingPattern(parameterNode.name)) { - buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - appendSymbolNameOnly(p, writer); - } - if (parameterNode && isOptionalParameter(parameterNode)) { - writePunctuation(writer, 55 /* QuestionToken */); - } - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - var type = getTypeOfSymbol(p); - if (parameterNode && isRequiredInitializedParameter(parameterNode)) { - type = getOptionalType(type); - } - buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - // We have to explicitly emit square bracket and bracket because these tokens are not stored inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { - writePunctuation(writer, 17 /* OpenBraceToken */); - buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - var elements = bindingPattern.elements; - buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - if (elements && elements.hasTrailingComma) { - writePunctuation(writer, 26 /* CommaToken */); - } - writePunctuation(writer, 22 /* CloseBracketToken */); - } - } - function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isOmittedExpression(bindingElement)) { - return; - } - ts.Debug.assert(bindingElement.kind === 177 /* BindingElement */); - if (bindingElement.propertyName) { - writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - } - if (ts.isBindingPattern(bindingElement.name)) { - buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - if (bindingElement.dotDotDotToken) { - writePunctuation(writer, 24 /* DotDotDotToken */); - } - appendSymbolNameOnly(bindingElement.symbol, writer); - } - } - function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27 /* LessThanToken */); - buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function buildDisplayForCommaSeparatedList(list, writer, action) { - for (var i = 0; i < list.length; i++) { - if (i > 0) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - } - action(list[i]); - } - } - function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27 /* LessThanToken */); - var flags = 512 /* InFirstTypeArgument */; - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - flags = 0 /* None */; - } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags); - } - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) { - writePunctuation(writer, 19 /* OpenParenToken */); - if (thisParameter) { - buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack); - } - for (var i = 0; i < parameters.length; i++) { - if (i > 0 || thisParameter) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - } - buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack); - } - writePunctuation(writer, 20 /* CloseParenToken */); - } - function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isIdentifierTypePredicate(predicate)) { - writer.writeParameter(predicate.parameterName); - } - else { - writeKeyword(writer, 99 /* ThisKeyword */); - } - writeSpace(writer); - writeKeyword(writer, 126 /* IsKeyword */); - writeSpace(writer); - buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { - var returnType = getReturnTypeOfSignature(signature); - if (flags & 4096 /* SuppressAnyReturnType */ && isTypeAny(returnType)) { - return; - } - if (flags & 16 /* WriteArrowStyleSignature */) { - writeSpace(writer); - writePunctuation(writer, 36 /* EqualsGreaterThanToken */); - } - else { - writePunctuation(writer, 56 /* ColonToken */); - } - writeSpace(writer); - if (signature.typePredicate) { - buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); - } - else { - buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { - if (kind === 1 /* Construct */) { - writeKeyword(writer, 94 /* NewKeyword */); - writeSpace(writer); - } - if (signature.target && (flags & 64 /* WriteTypeArgumentsOfSignature */)) { - // Instantiated signature, write type arguments instead - // This is achieved by passing in the mapper separately - buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, symbolStack); - } - buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); - buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); - } - function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 21 /* OpenBracketToken */); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - switch (kind) { - case 1 /* Number */: - writeKeyword(writer, 133 /* NumberKeyword */); - break; - case 0 /* String */: - writeKeyword(writer, 136 /* StringKeyword */); - break; - } - writePunctuation(writer, 22 /* CloseBracketToken */); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - return _displayBuilder || (_displayBuilder = { - buildSymbolDisplay: buildSymbolDisplay, - buildTypeDisplay: buildTypeDisplay, - buildTypeParameterDisplay: buildTypeParameterDisplay, - buildTypePredicateDisplay: buildTypePredicateDisplay, - buildParameterDisplay: buildParameterDisplay, - buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, - buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, - buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, - buildSignatureDisplay: buildSignatureDisplay, - buildIndexSignatureDisplay: buildIndexSignatureDisplay, - buildReturnTypeDisplay: buildReturnTypeDisplay - }); - } function isDeclarationVisible(node) { if (node) { var links = getNodeLinks(node); @@ -29693,22 +30000,22 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 229 /* FunctionDeclaration */: - case 233 /* EnumDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 236 /* EnumDeclaration */: + case 241 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -29716,53 +30023,53 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 238 /* ImportEqualsDeclaration */ && parent.kind !== 269 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { + !(node.kind !== 241 /* ImportEqualsDeclaration */ && parent.kind !== 272 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 153 /* Constructor */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: - case 147 /* Parameter */: - case 235 /* ModuleBlock */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 160 /* TypeReference */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: + case 148 /* Parameter */: + case 238 /* ModuleBlock */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 161 /* TypeReference */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 172 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: return false; // Type parameters are always visible - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: // Source file and namespace export are always visible - case 269 /* SourceFile */: - case 237 /* NamespaceExportDeclaration */: + case 272 /* SourceFile */: + case 240 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return false; default: return false; @@ -29771,10 +30078,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 244 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 247 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 247 /* ExportSpecifier */) { + else if (node.parent.kind === 250 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -29819,8 +30126,8 @@ var ts; var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found - var length_3 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_3; i++) { + var length_2 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_2; i++) { resolutionResults[i] = false; } return false; @@ -29854,6 +30161,10 @@ var ts; if (propertyName === 3 /* ResolvedReturnType */) { return target.resolvedReturnType; } + if (propertyName === 4 /* ResolvedBaseConstraint */) { + var bc = target.resolvedBaseConstraint; + return bc && bc !== circularConstraintType; + } ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName); } // Pop an entry from the type resolution stack and return its associated result value. The result value will @@ -29866,12 +30177,12 @@ var ts; function getDeclarationContainer(node) { node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 227 /* VariableDeclaration */: - case 228 /* VariableDeclarationList */: - case 243 /* ImportSpecifier */: - case 242 /* NamedImports */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 230 /* VariableDeclaration */: + case 231 /* VariableDeclarationList */: + case 246 /* ImportSpecifier */: + case 245 /* NamedImports */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: return false; default: return true; @@ -29902,7 +30213,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 145 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 146 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 12288 /* Nullable */); }); @@ -29949,7 +30260,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 175 /* ObjectBindingPattern */) { + if (pattern.kind === 178 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -29978,7 +30289,8 @@ var ts; if (strictNullChecks && declaration.flags & 2097152 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } - var declaredType = getTypeOfPropertyOfType(parentType, text); + var propType = getTypeOfPropertyOfType(parentType, text); + var declaredType = propType && getApparentTypeForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); @@ -29999,7 +30311,7 @@ var ts; } else { // Use specific property type when parent is a tuple or numeric index type when parent is an array - var propName = "" + ts.indexOf(pattern.elements, declaration); + var propName = "" + pattern.elements.indexOf(declaration); type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : elementType; @@ -30020,7 +30332,7 @@ var ts; type = getTypeWithFacts(type, 131072 /* NEUndefined */); } return declaration.initializer ? - getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : + getUnionType([type, checkExpressionCached(declaration.initializer)], 2 /* Subtype */) : type; } function getTypeForDeclarationFromJSDocComment(declaration) { @@ -30036,7 +30348,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 178 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 181 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -30046,11 +30358,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (declaration.parent.parent.kind === 216 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 219 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (32768 /* TypeParameter */ | 524288 /* Index */) ? indexType : stringType; } - if (declaration.parent.parent.kind === 217 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 220 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -30061,14 +30373,14 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } + var isOptional = !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken && includeOptionality; // Use type from type annotation if one is present - var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - var declaredType = getTypeFromTypeNode(typeNode); - return addOptionality(declaredType, /*optional*/ !!declaration.questionToken && includeOptionality); + var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (declaredType) { + return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) && - declaration.kind === 227 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 230 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 2097152 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -30082,11 +30394,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 155 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 154 /* GetAccessor */); + if (func.kind === 156 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -30107,23 +30419,19 @@ var ts; type = getContextuallyTypedParameterType(declaration); } if (type) { - return addOptionality(type, /*optional*/ !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } } // Use the type of the initializer expression if one is present if (declaration.initializer) { var type = checkDeclarationInitializer(declaration); - return addOptionality(type, /*optional*/ !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } if (ts.isJsxAttribute(declaration)) { // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true. // I.e is sugar for return trueType; } - // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 266 /* ShorthandPropertyAssignment */) { - return checkIdentifier(declaration.name); - } // If the declaration specifies a binding pattern, use the type implied by the binding pattern if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true); @@ -30138,14 +30446,14 @@ var ts; var jsDocType; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - var expression = declaration.kind === 195 /* BinaryExpression */ ? declaration : - declaration.kind === 180 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 195 /* BinaryExpression */) : + var expression = declaration.kind === 198 /* BinaryExpression */ ? declaration : + declaration.kind === 183 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 198 /* BinaryExpression */) : undefined; if (!expression) { return unknownType; } if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99 /* ThisKeyword */) { - if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 153 /* Constructor */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 154 /* Constructor */) { definedInConstructor = true; } else { @@ -30170,7 +30478,7 @@ var ts; types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); } } - var type = jsDocType || getUnionType(types, /*subtypeReduction*/ true); + var type = jsDocType || getUnionType(types, 2 /* Subtype */); return getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor)); } // Return the type implied by a binding pattern element. This is the type of the initializer of the element if @@ -30244,7 +30552,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 175 /* ObjectBindingPattern */ + return pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -30264,19 +30572,13 @@ var ts; reportErrorsFromWidening(declaration, type); } // always widen a 'unique symbol' type if the type was created for a different declaration. - if (type.flags & 1024 /* UniqueESSymbol */ && !declaration.type && type.symbol !== getSymbolOfNode(declaration)) { + if (type.flags & 1024 /* UniqueESSymbol */ && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) { type = esSymbolType; } - // During a normal type check we'll never get to here with a property assignment (the check of the containing - // object literal uses a different path). We exclude widening only so that language services and type verification - // tools see the actual type. - if (declaration.kind === 265 /* PropertyAssignment */) { - return type; - } return getWidenedType(type); } // Rest parameters default to type any[], other parameters default to type any - type = declaration.dotDotDotToken ? anyArrayType : anyType; + type = ts.isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType; // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { @@ -30287,9 +30589,15 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 147 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 148 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } + function tryGetTypeFromEffectiveTypeNode(declaration) { + var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -30303,7 +30611,7 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 244 /* ExportAssignment */) { + if (declaration.kind === 247 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) { @@ -30319,13 +30627,43 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 195 /* BinaryExpression */ || - declaration.kind === 180 /* PropertyAccessExpression */ && declaration.parent.kind === 195 /* BinaryExpression */) { + if (declaration.kind === 198 /* BinaryExpression */ || + declaration.kind === 183 /* PropertyAccessExpression */ && declaration.parent.kind === 198 /* BinaryExpression */) { type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } - else { + else if (ts.isJSDocPropertyTag(declaration) + || ts.isPropertyAccessExpression(declaration) + || ts.isIdentifier(declaration) + || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration)) + || ts.isMethodSignature(declaration)) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType; + } + else if (ts.isPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } + else if (ts.isJsxAttribute(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } + else if (ts.isShorthandPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */); + } + else if (ts.isObjectLiteralMethod(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */); + } + else if (ts.isParameter(declaration) + || ts.isPropertyDeclaration(declaration) + || ts.isPropertySignature(declaration) + || ts.isVariableDeclaration(declaration) + || ts.isBindingElement(declaration)) { type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } + else { + ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration)); + } if (!popTypeResolution()) { type = reportCircularityError(symbol); } @@ -30335,7 +30673,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); } @@ -30356,8 +30694,8 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 155 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 156 /* SetAccessor */); if (getter && ts.isInJavaScriptFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -30401,7 +30739,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -30492,6 +30830,9 @@ var ts; if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } + if (ts.getCheckFlags(symbol) & 2048 /* ReverseMapped */) { + return getTypeOfReverseMappedSymbol(symbol); + } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } @@ -30549,29 +30890,33 @@ var ts; return undefined; } switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 173 /* MappedType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 176 /* MappedType */: + case 170 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 173 /* MappedType */) { + if (node.kind === 176 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } + else if (node.kind === 170 /* ConditionalType */) { + return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node) || ts.emptyArray); var thisType = includeThisTypes && - (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */ || node.kind === 231 /* InterfaceDeclaration */) && + (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */ || node.kind === 234 /* InterfaceDeclaration */) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -30579,7 +30924,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); return getOuterTypeParameters(declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -30588,8 +30933,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 231 /* InterfaceDeclaration */ || node.kind === 230 /* ClassDeclaration */ || - node.kind === 200 /* ClassExpression */ || node.kind === 232 /* TypeAliasDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */ || node.kind === 233 /* ClassDeclaration */ || + node.kind === 203 /* ClassExpression */ || node.kind === 235 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -30705,10 +31050,10 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = ts.emptyArray; + type.resolvedBaseTypes = ts.resolvingEmptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (65536 /* Object */ | 262144 /* Intersection */ | 1 /* Any */))) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } var baseTypeNode = getBaseTypeNodeOfClass(type); var typeArgs = typeArgumentsFromTypeReferenceNode(baseTypeNode); @@ -30731,22 +31076,29 @@ var ts; var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); - return; + return type.resolvedBaseTypes = ts.emptyArray; } baseType = getReturnTypeOfSignature(constructors[0]); } if (baseType === unknownType) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { - error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); - return; + error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */)); + return type.resolvedBaseTypes = ts.emptyArray; } - type.resolvedBaseTypes = [baseType]; + if (type.resolvedBaseTypes === ts.resolvingEmptyArray) { + // Circular reference, likely through instantiation of default parameters + // (otherwise there'd be an error from hasBaseType) - this is fine, but `.members` should be reset + // as `getIndexedAccessType` via `instantiateType` via `getTypeFromClassOrInterfaceReference` forces a + // partial instantiation of the members without the base types fully resolved + type.members = undefined; + } + return type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { // An unapplied type parameter has its symbol still the same as the matching argument symbol. @@ -30762,14 +31114,14 @@ var ts; // A valid base type is `any`, any non-generic object type or intersection of non-generic // object types. function isValidBaseType(type) { - return type.flags & (65536 /* Object */ | 33554432 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + return type.flags & (65536 /* Object */ | 134217728 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || type.flags & 262144 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 234 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -30784,7 +31136,7 @@ var ts; } } else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */)); } } else { @@ -30805,7 +31157,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */) { + if (declaration.kind === 234 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -30863,9 +31215,9 @@ var ts; return unknownType; } var declaration = ts.find(symbol.declarations, function (d) { - return d.kind === 288 /* JSDocTypedefTag */ || d.kind === 232 /* TypeAliasDeclaration */; + return d.kind === 291 /* JSDocTypedefTag */ || d.kind === 235 /* TypeAliasDeclaration */; }); - var typeNode = declaration.kind === 288 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; + var typeNode = declaration.kind === 291 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; // If typeNode is missing, we will error in checkJSDocTypedefTag. var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType; if (popTypeResolution()) { @@ -30895,7 +31247,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 71 /* Identifier */: @@ -30912,7 +31264,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 9 /* StringLiteral */) { @@ -30939,7 +31291,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)); @@ -30949,7 +31301,7 @@ var ts; } } if (memberTypeList.length) { - var enumType_1 = getUnionType(memberTypeList, /*subtypeReduction*/ false, symbol, /*aliasTypeArguments*/ undefined); + var enumType_1 = getUnionType(memberTypeList, 1 /* Literal */, symbol, /*aliasTypeArguments*/ undefined); if (enumType_1.flags & 131072 /* Union */) { enumType_1.flags |= 256 /* EnumLiteral */; enumType_1.symbol = symbol; @@ -31019,20 +31371,20 @@ var ts; function isThislessType(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 134 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 177 /* LiteralType */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isThislessType(node.elementType); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -31047,7 +31399,7 @@ var ts; */ function isThislessVariableLikeDeclaration(node) { var typeNode = ts.getEffectiveTypeAnnotationNode(node); - return typeNode ? isThislessType(typeNode) : !node.initializer; + return typeNode ? isThislessType(typeNode) : !ts.hasInitializer(node); } /** * A function-like declaration is considered free of `this` references if it has a return type @@ -31056,7 +31408,7 @@ var ts; */ function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); - return (node.kind === 153 /* Constructor */ || (returnType && isThislessType(returnType))) && + return (node.kind === 154 /* Constructor */ || (returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter)); } @@ -31072,12 +31424,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -31309,18 +31661,19 @@ var ts; } return symbol; } - function getTypeWithThisArgument(type, thisArgument) { + function getTypeWithThisArgument(type, thisArgument, needApparentType) { if (ts.getObjectFlags(type) & 4 /* Reference */) { var target = type.target; var typeArguments = type.typeArguments; if (ts.length(target.typeParameters) === ts.length(typeArguments)) { - return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + var ref = createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + return needApparentType ? getApparentType(ref) : ref; } } else if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); })); } - return type; + return needApparentType ? getApparentType(type) : type; } function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) { var mapper; @@ -31350,6 +31703,7 @@ var ts; if (source.symbol && members === getMembersOfSymbol(source.symbol)) { members = ts.createSymbolTable(source.declaredProperties); } + setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); var thisArgument = ts.lastOrUndefined(typeArguments); for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; @@ -31377,27 +31731,30 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { + function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.thisParameter = thisParameter; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; + sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasLiteralTypes = hasLiteralTypes; + sig.target = undefined; + sig.mapper = undefined; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); + return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); } function getDefaultConstructSignatures(classType) { var baseConstructorType = getBaseConstructorTypeOfClass(classType); var baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); if (baseSignatures.length === 0) { - return [createSignature(undefined, classType.localTypeParameters, undefined, ts.emptyArray, classType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; + return [createSignature(undefined, classType.localTypeParameters, undefined, ts.emptyArray, classType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); @@ -31408,7 +31765,7 @@ var ts; var baseSig = baseSignatures_1[_i]; var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); var typeParamCount = ts.length(baseSig.typeParameters); - if (isJavaScript || (typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount)) { + if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; @@ -31467,13 +31824,13 @@ var ts; var s = signature; // Union the result types when more than one signature matches if (unionSignatures.length > 1) { - s = cloneSignature(signature); + var thisParameter = signature.thisParameter; if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { - var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), /*subtypeReduction*/ true); - s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); + var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType; }), 2 /* Subtype */); + thisParameter = createSymbolWithType(signature.thisParameter, thisType); } - // Clear resolved return type we possibly got from cloneSignature - s.resolvedReturnType = undefined; + s = cloneSignature(signature); + s.thisParameter = thisParameter; s.unionSignatures = unionSignatures; } (result || (result = [])).push(s); @@ -31495,7 +31852,7 @@ var ts; indexTypes.push(indexInfo.type); isAnyReadonly = isAnyReadonly || indexInfo.isReadonly; } - return createIndexInfo(getUnionType(indexTypes, /*subtypeReduction*/ true), isAnyReadonly); + return createIndexInfo(getUnionType(indexTypes, 2 /* Subtype */), isAnyReadonly); } function resolveUnionTypeMembers(type) { // The members and properties collections are empty for union types. To get all properties of a union @@ -31591,6 +31948,7 @@ var ts; if (symbol.exports) { members = getExportsOfSymbol(symbol); } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined); if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); var baseConstructorType = getBaseConstructorTypeOfClass(classType); @@ -31622,6 +31980,24 @@ var ts; } } } + function resolveReverseMappedTypeMembers(type) { + var indexInfo = getIndexInfoOfType(type.source, 0 /* String */); + var modifiers = getMappedTypeModifiers(type.mappedType); + var readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true; + var optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */; + var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); + var members = ts.createSymbolTable(); + for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { + var prop = _a[_i]; + var checkFlags = 2048 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); + var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); + inferredProp.declarations = prop.declarations; + inferredProp.propertyType = getTypeOfSymbol(prop); + inferredProp.mappedType = type.mappedType; + members.set(prop.escapedName, inferredProp); + } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); + } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); @@ -31632,13 +32008,12 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var templateType = getTemplateTypeFromMappedType(type); + var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' - var templateReadonly = !!type.declaration.readonlyToken; - var templateOptional = !!type.declaration.questionToken; + var templateModifiers = getMappedTypeModifiers(type); var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // We have a { [P in keyof T]: X } for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { var propertySymbol = _a[_i]; @@ -31652,7 +32027,7 @@ var ts; // First, if the constraint type is a type parameter, obtain the base constraint. Then, // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. // Finally, iterate over the constituents of the resulting iteration type. - var keyType = constraintType.flags & 1081344 /* TypeVariable */ ? getApparentType(constraintType) : constraintType; + var keyType = constraintType.flags & 7372800 /* InstantiableNonPrimitive */ ? getApparentType(constraintType) : constraintType; var iterationType = keyType.flags & 524288 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; forEachType(iterationType, addMemberForKeyType); } @@ -31676,10 +32051,17 @@ var ts; if (t.flags & 32 /* StringLiteral */) { var propName = ts.escapeLeadingUnderscores(t.value); var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 16777216 /* Optional */); - var checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; - var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, checkFlags); - prop.type = propType; + var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || + !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); + var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || + !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp)); + var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, isReadonly ? 8 /* Readonly */ : 0); + // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the + // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks + // mode, if the underlying property is optional we remove 'undefined' from the type. + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */ ? getTypeWithFacts(propType, 131072 /* NEUndefined */) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; @@ -31688,7 +32070,7 @@ var ts; members.set(propName, prop); } else if (t.flags & (1 /* Any */ | 2 /* String */)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } } } @@ -31703,14 +32085,14 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : unknownType); } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. @@ -31729,16 +32111,21 @@ var ts; return type.modifiersType; } function getMappedTypeModifiers(type) { - return (type.declaration.readonlyToken ? 1 /* Readonly */ : 0) | - (type.declaration.questionToken ? 2 /* Optional */ : 0); + var declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 /* MinusToken */ ? 2 /* ExcludeReadonly */ : 1 /* IncludeReadonly */ : 0) | + (declaration.questionToken ? declaration.questionToken.kind === 38 /* MinusToken */ ? 8 /* ExcludeOptional */ : 4 /* IncludeOptional */ : 0); } - function getCombinedMappedTypeModifiers(type) { + function getMappedTypeOptionality(type) { + var modifiers = getMappedTypeModifiers(type); + return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type) { + var optionality = getMappedTypeOptionality(type); var modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type) { - return ts.getObjectFlags(type) & 32 /* Mapped */ && !!type.declaration.questionToken; + return !!(ts.getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */); } function isGenericMappedType(type) { return ts.getObjectFlags(type) & 32 /* Mapped */ && isGenericIndexType(getConstraintTypeFromMappedType(type)); @@ -31752,6 +32139,9 @@ var ts; else if (type.objectFlags & 3 /* ClassOrInterface */) { resolveClassOrInterfaceMembers(type); } + else if (type.objectFlags & 2048 /* ReverseMapped */) { + resolveReverseMappedTypeMembers(type); + } else if (type.objectFlags & 16 /* Anonymous */) { resolveAnonymousTypeMembers(type); } @@ -31828,7 +32218,10 @@ var ts; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { - props.set(escapedName, createUnionOrIntersectionProperty(unionType, escapedName)); + var prop = createUnionOrIntersectionProperty(unionType, escapedName); + // May be undefined if the property is private + if (prop) + props.set(escapedName, prop); } } } @@ -31837,22 +32230,51 @@ var ts; function getConstraintOfType(type) { return type.flags & 32768 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : type.flags & 1048576 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : - getBaseConstraintOfType(type); + type.flags & 2097152 /* Conditional */ ? getConstraintOfConditionalType(type) : + getBaseConstraintOfType(type); } function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { - var transformed = getTransformedIndexedAccessType(type); + var transformed = getSimplifiedIndexedAccessType(type); if (transformed) { return transformed; } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); + if (baseIndexType === stringType && !getIndexInfoOfType(baseObjectType || type.objectType, 0 /* String */)) { + // getIndexedAccessType returns `any` for X[string] where X doesn't have an index signature. + // to avoid this, return `undefined`. + return undefined; + } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } + function getDefaultConstraintOfConditionalType(type) { + return getUnionType([type.trueType, type.falseType]); + } + function getConstraintOfDistributiveConditionalType(type) { + // Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained + // type parameter. If so, create an instantiation of the conditional type where T is replaced + // with its constraint. We do this because if the constraint is a union type it will be distributed + // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' + // removes 'undefined' from T. + if (isDistributiveConditionalType(type)) { + var constraint = getConstraintOfType(type.checkType); + if (constraint) { + var target = type.target || type; + var mapper = createTypeMapper([target.checkType], [constraint]); + var combinedMapper = type.mapper ? combineTypeMappers(mapper, type.mapper) : mapper; + return instantiateType(target, combinedMapper); + } + } + return undefined; + } + function getConstraintOfConditionalType(type) { + return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); + } function getBaseConstraintOfType(type) { - if (type.flags & (1081344 /* TypeVariable */ | 393216 /* UnionOrIntersection */)) { + if (type.flags & (7372800 /* InstantiableNonPrimitive */ | 393216 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; @@ -31872,29 +32294,30 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - var typeStack; var circular; if (!type.resolvedBaseConstraint) { - typeStack = []; var constraint = getBaseConstraint(type); type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); } return type.resolvedBaseConstraint; function getBaseConstraint(t) { - if (ts.contains(typeStack, t)) { + if (!pushTypeResolution(t, 4 /* ResolvedBaseConstraint */)) { circular = true; return undefined; } - typeStack.push(t); var result = computeBaseConstraint(t); - typeStack.pop(); + if (!popTypeResolution()) { + circular = true; + return undefined; + } return result; } function computeBaseConstraint(t) { if (t.flags & 32768 /* TypeParameter */) { var constraint = getConstraintFromTypeParameter(t); - return t.isThisType ? constraint : - constraint ? getBaseConstraint(constraint) : undefined; + return t.isThisType || !constraint ? + constraint : + getBaseConstraint(constraint); } if (t.flags & 393216 /* UnionOrIntersection */) { var types = t.types; @@ -31914,7 +32337,7 @@ var ts; return stringType; } if (t.flags & 1048576 /* IndexedAccess */) { - var transformed = getTransformedIndexedAccessType(t); + var transformed = getSimplifiedIndexedAccessType(t); if (transformed) { return getBaseConstraint(transformed); } @@ -31923,6 +32346,12 @@ var ts; var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (t.flags & 2097152 /* Conditional */) { + return getBaseConstraint(getConstraintOfConditionalType(t)); + } + if (t.flags & 4194304 /* Substitution */) { + return getBaseConstraint(t.substitute); + } if (isGenericMappedType(t)) { return emptyObjectType; } @@ -31930,7 +32359,7 @@ var ts; } } function getApparentTypeOfIntersectionType(type) { - return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type, /*apparentType*/ true)); } function getResolvedTypeParameterDefault(typeParameter) { if (!typeParameter.default) { @@ -31981,26 +32410,25 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 1081344 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + var t = type.flags & 7897088 /* Instantiable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; return t.flags & 262144 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 524322 /* StringLike */ ? globalStringType : t.flags & 84 /* NumberLike */ ? globalNumberType : t.flags & 136 /* BooleanLike */ ? globalBooleanType : t.flags & 1536 /* ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : - t.flags & 33554432 /* NonPrimitive */ ? emptyObjectType : + t.flags & 134217728 /* NonPrimitive */ ? emptyObjectType : t; } function createUnionOrIntersectionProperty(containingType, name) { var props; - var types = containingType.types; var isUnion = containingType.flags & 131072 /* Union */; var excludeModifiers = isUnion ? 24 /* NonPublicAccessibilityModifier */ : 0; // Flags we want to propagate to the result if they exist in all source symbols var commonFlags = isUnion ? 0 /* None */ : 16777216 /* Optional */; var syntheticFlag = 4 /* SyntheticMethod */; var checkFlags = 0; - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var current = types_5[_i]; + for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) { + var current = _a[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); @@ -32031,8 +32459,8 @@ var ts; var propTypes = []; var declarations = []; var commonType = undefined; - for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { - var prop = props_1[_a]; + for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { + var prop = props_1[_b]; if (prop.declarations) { ts.addRange(declarations, prop.declarations); } @@ -32145,7 +32573,7 @@ var ts; } } if (propTypes.length) { - return getUnionType(propTypes, /*subtypeReduction*/ true); + return getUnionType(propTypes, 2 /* Subtype */); } } return undefined; @@ -32171,7 +32599,7 @@ var ts; } function isJSDocOptionalParameter(node) { if (ts.isInJavaScriptFile(node)) { - if (node.type && node.type.kind === 276 /* JSDocOptionalType */) { + if (node.type && node.type.kind === 279 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -32182,7 +32610,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 276 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 279 /* JSDocOptionalType */; } } } @@ -32201,9 +32629,8 @@ var ts; return true; } if (node.initializer) { - var signatureDeclaration = node.parent; - var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -32211,27 +32638,27 @@ var ts; if (iife) { return !node.type && !node.dotDotDotToken && - ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + node.parent.parameters.indexOf(node) >= iife.arguments.length; } return false; } function createTypePredicateFromTypePredicateNode(node) { var parameterName = node.parameterName; + var type = getTypeFromTypeNode(node.type); if (parameterName.kind === 71 /* Identifier */) { - return { - kind: 1 /* Identifier */, - parameterName: parameterName ? parameterName.escapedText : undefined, - parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, - type: getTypeFromTypeNode(node.type) - }; + return createIdentifierTypePredicate(parameterName && parameterName.escapedText, // TODO: GH#18217 + parameterName && getTypePredicateParameterIndex(node.parent.parameters, parameterName), type); } else { - return { - kind: 0 /* This */, - type: getTypeFromTypeNode(node.type) - }; + return createThisTypePredicate(type); } } + function createIdentifierTypePredicate(parameterName, parameterIndex, type) { + return { kind: 1 /* Identifier */, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; + } + function createThisTypePredicate(type) { + return { kind: 0 /* This */, type: type }; + } /** * Gets the minimum number of type arguments needed to satisfy all non-optional type * parameters. @@ -32311,7 +32738,7 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 174 /* LiteralType */) { + if (param.type && param.type.kind === 177 /* LiteralType */) { hasLiteralTypes = true; } // Record a new minimum argument count if this is not an optional parameter @@ -32324,25 +32751,22 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 154 /* GetAccessor */ || declaration.kind === 155 /* SetAccessor */) && + if ((declaration.kind === 155 /* GetAccessor */ || declaration.kind === 156 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = declaration.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 153 /* Constructor */ ? + var classType = declaration.kind === 154 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 159 /* TypePredicate */ ? - createTypePredicateFromTypePredicateNode(declaration.type) : - undefined; var hasRestLikeParameter = ts.hasRestParameter(declaration) || ts.isInJavaScriptFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters); - links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); + links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, /*resolvedTypePredicate*/ undefined, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); } return links.resolvedSignature; } @@ -32352,7 +32776,7 @@ var ts; // b) It references `arguments` somewhere var lastParam = ts.lastOrUndefined(declaration.parameters); var lastParamTags = lastParam && ts.getJSDocParameterTags(lastParam); - var lastParamVariadicType = lastParamTags && ts.firstDefined(lastParamTags, function (p) { + var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); if (!lastParamVariadicType && !containsArgumentsReference(declaration)) { @@ -32381,8 +32805,8 @@ var ts; } // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 154 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 155 /* SetAccessor */); + if (declaration.kind === 155 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { @@ -32406,11 +32830,11 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return node.name.kind === 145 /* ComputedPropertyName */ + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return node.name.kind === 146 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); @@ -32424,20 +32848,20 @@ var ts; for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -32467,6 +32891,28 @@ var ts; return getTypeOfSymbol(signature.thisParameter); } } + function signatureHasTypePredicate(signature) { + return getTypePredicateOfSignature(signature) !== undefined; + } + function getTypePredicateOfSignature(signature) { + if (!signature.resolvedTypePredicate) { + if (signature.target) { + var targetTypePredicate = getTypePredicateOfSignature(signature.target); + signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; + } + else if (signature.unionSignatures) { + signature.resolvedTypePredicate = getUnionTypePredicate(signature.unionSignatures) || noTypePredicate; + } + else { + var declaration = signature.declaration; + signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 /* TypePredicate */ ? + createTypePredicateFromTypePredicateNode(declaration.type) : + noTypePredicate; + } + ts.Debug.assert(!!signature.resolvedTypePredicate); + } + return signature.resolvedTypePredicate === noTypePredicate ? undefined : signature.resolvedTypePredicate; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) { @@ -32477,7 +32923,7 @@ var ts; type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } else { type = getReturnTypeFromBody(signature.declaration); @@ -32562,7 +33008,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 153 /* Constructor */ || signature.declaration.kind === 157 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 154 /* Constructor */ || signature.declaration.kind === 158 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -32576,7 +33022,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 133 /* NumberKeyword */ : 136 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 134 /* NumberKeyword */ : 137 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -32603,7 +33049,43 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return type.symbol && ts.getDeclarationOfKind(type.symbol, 146 /* TypeParameter */).constraint; + return type.symbol && ts.getDeclarationOfKind(type.symbol, 147 /* TypeParameter */).constraint; + } + function getInferredTypeParameterConstraint(typeParameter) { + var inferences; + if (typeParameter.symbol) { + for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + // When an 'infer T' declaration is immediately contained in a type reference node + // (such as 'Foo'), T's constraint is inferred from the constraint of the + // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are + // present, we form an intersection of the inferred constraint types. + if (declaration.parent.kind === 171 /* InferType */ && declaration.parent.parent.kind === 161 /* TypeReference */) { + var typeReference = declaration.parent.parent; + var typeParameters = getTypeParametersForTypeReference(typeReference); + if (typeParameters) { + var index = typeReference.typeArguments.indexOf(declaration.parent); + if (index < typeParameters.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); + if (declaredConstraint) { + // Type parameter constraints can reference other type parameters so + // constraints need to be instantiated. If instantiation produces the + // type parameter itself, we discard that inference. For example, in + // type Foo = [T, U]; + // type Bar = T extends Foo ? Foo : T; + // the instantiated constraint for U is X, so we discard that inference. + var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters)); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts.append(inferences, constraint); + } + } + } + } + } + } + } + return inferences && getIntersectionType(inferences); } function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { @@ -32613,23 +33095,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : + getInferredTypeParameterConstraint(typeParameter) || noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 146 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_4 = types.length; + var length_3 = types.length; var i = 0; - while (i < length_4) { + while (i < length_3) { var startId = types[i].id; var count = 1; - while (i + count < length_4 && types[i + count].id === startId + count) { + while (i + count < length_3 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -32650,13 +33133,13 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } } - return result & 29360128 /* PropagatingFlags */; + return result & 117440512 /* PropagatingFlags */; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); @@ -32693,7 +33176,7 @@ var ts; var isJs = ts.isInJavaScriptFile(node); var isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - var missingAugmentsTag = isJs && node.parent.kind !== 282 /* JSDocAugmentsTag */; + var missingAugmentsTag = isJs && node.parent.kind !== 285 /* JSDocAugmentsTag */; var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag @@ -32701,7 +33184,7 @@ var ts; : missingAugmentsTag ? ts.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; - var typeStr = typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */); + var typeStr = typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */); error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length); if (!isJs) { // TODO: Adopt same permissive behavior in TS as in JS to reduce follow-on editing experience failures (requires editing fillMissingTypeArguments) @@ -32714,11 +33197,7 @@ var ts; var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs)); return createTypeReference(type, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); @@ -32750,17 +33229,13 @@ var ts; } return getTypeAliasInstantiation(symbol, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeReferenceName(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -32787,12 +33262,10 @@ var ts; } // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); - if (res !== undefined) { - if (typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return res; + if (res) { + return checkNoTypeArguments(node, symbol) ? + res.flags & 32768 /* TypeParameter */ ? getConstrainedTypeParameter(res, node) : res : + unknownType; } if (!(symbol.flags & 107455 /* Value */ && isJSDocTypeReference(node))) { return unknownType; @@ -32824,42 +33297,79 @@ var ts; return getInferredClassType(symbol); } } + function getSubstitutionType(typeParameter, substitute) { + var result = createType(4194304 /* Substitution */); + result.typeParameter = typeParameter; + result.substitute = substitute; + return result; + } + function getConstrainedTypeParameter(typeParameter, node) { + var constraints; + while (ts.isPartOfTypeNode(node)) { + var parent = node.parent; + if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) { + if (getTypeFromTypeNode(parent.checkType) === typeParameter) { + constraints = ts.append(constraints, getTypeFromTypeNode(parent.extendsType)); + } + } + node = parent; + } + return constraints ? getSubstitutionType(typeParameter, getIntersectionType(ts.append(constraints, typeParameter))) : typeParameter; + } function isJSDocTypeReference(node) { - return node.flags & 1048576 /* JSDoc */ && node.kind === 160 /* TypeReference */; + return node.flags & 1048576 /* JSDoc */ && node.kind === 161 /* TypeReference */; + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : ts.declarationNameToString(node.typeName)); + return false; + } + return true; } function getIntendedTypeFromJSDocTypeReference(node) { if (ts.isIdentifier(node.typeName)) { - if (node.typeName.escapedText === "Object") { - if (ts.isJSDocIndexSignature(node)) { - var indexed = getTypeFromTypeNode(node.typeArguments[0]); - var target = getTypeFromTypeNode(node.typeArguments[1]); - var index = createIndexInfo(target, /*isReadonly*/ false); - return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); - } - return anyType; - } + var typeArgs = node.typeArguments; switch (node.typeName.escapedText) { case "String": + checkNoTypeArguments(node); return stringType; case "Number": + checkNoTypeArguments(node); return numberType; case "Boolean": + checkNoTypeArguments(node); return booleanType; case "Void": + checkNoTypeArguments(node); return voidType; case "Undefined": + checkNoTypeArguments(node); return undefinedType; case "Null": + checkNoTypeArguments(node); return nullType; case "Function": case "function": + checkNoTypeArguments(node); return globalFunctionType; case "Array": case "array": - return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined; + return !typeArgs || !typeArgs.length ? anyArrayType : undefined; case "Promise": case "promise": - return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + return !typeArgs || !typeArgs.length ? createPromiseType(anyType) : undefined; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var index = createIndexInfo(target, /*isReadonly*/ false); + return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); + } + return anyType; + } + checkNoTypeArguments(node); + return anyType; } } } @@ -32882,7 +33392,7 @@ var ts; type = getTypeReferenceType(node, symbol); } // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the - // type reference in checkTypeReferenceOrExpressionWithTypeArguments. + // type reference in checkTypeReferenceNode. links.resolvedSymbol = symbol; links.resolvedType = type; } @@ -32908,9 +33418,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: return declaration; } } @@ -33094,27 +33604,27 @@ var ts; return true; } combined |= t.flags; - if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 33554432 /* NonPrimitive */)) { + if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 134217728 /* NonPrimitive */)) { return true; } } return false; } - function addTypeToUnion(typeSet, type) { + function addTypeToUnion(typeSet, includes, type) { var flags = type.flags; if (flags & 131072 /* Union */) { - addTypesToUnion(typeSet, type.types); + includes = addTypesToUnion(typeSet, includes, type.types); } else if (flags & 1 /* Any */) { - typeSet.containsAny = true; + includes |= 1 /* Any */; } else if (!strictNullChecks && flags & 12288 /* Nullable */) { if (flags & 4096 /* Undefined */) - typeSet.containsUndefined = true; + includes |= 2 /* Undefined */; if (flags & 8192 /* Null */) - typeSet.containsNull = true; - if (!(flags & 4194304 /* ContainsWideningType */)) - typeSet.containsNonWideningType = true; + includes |= 4 /* Null */; + if (!(flags & 16777216 /* ContainsWideningType */)) + includes |= 16 /* NonWideningType */; } else if (!(flags & 16384 /* Never */ || flags & 262144 /* Intersection */ && isEmptyIntersectionType(type))) { // We ignore 'never' types in unions. Likewise, we ignore intersections of unit types as they are @@ -33122,13 +33632,13 @@ var ts; // intersections of unit types into 'never' upon construction, but deferring the reduction makes it // easier to reason about their origin. if (flags & 2 /* String */) - typeSet.containsString = true; + includes |= 32 /* String */; if (flags & 4 /* Number */) - typeSet.containsNumber = true; + includes |= 64 /* Number */; if (flags & 512 /* ESSymbol */) - typeSet.containsESSymbol = true; + includes |= 128 /* ESSymbol */; if (flags & 1120 /* StringOrNumberLiteralOrUnique */) - typeSet.containsLiteralOrUniqueESSymbol = true; + includes |= 256 /* LiteralOrUniqueESSymbol */; var len = typeSet.length; var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues); if (index < 0) { @@ -33138,18 +33648,20 @@ var ts; } } } + return includes; } // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. - function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var type = types_7[_i]; - addTypeToUnion(typeSet, type); + function addTypesToUnion(typeSet, includes, types) { + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; + includes = addTypeToUnion(typeSet, includes, type); } + return includes; } function containsIdenticalType(types, type) { - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -33193,15 +33705,15 @@ var ts; } } } - function removeRedundantLiteralTypes(types) { + function removeRedundantLiteralTypes(types, includes) { var i = types.length; while (i > 0) { i--; var t = types[i]; - var remove = t.flags & 32 /* StringLiteral */ && types.containsString || - t.flags & 64 /* NumberLiteral */ && types.containsNumber || - t.flags & 1024 /* UniqueESSymbol */ && types.containsESSymbol || - t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 2097152 /* FreshLiteral */ && containsType(types, t.regularType); + var remove = t.flags & 32 /* StringLiteral */ && includes & 32 /* String */ || + t.flags & 64 /* NumberLiteral */ && includes & 64 /* Number */ || + t.flags & 1024 /* UniqueESSymbol */ && includes & 128 /* ESSymbol */ || + t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 8388608 /* FreshLiteral */ && containsType(types, t.regularType); if (remove) { ts.orderedRemoveItemAt(types, i); } @@ -33214,7 +33726,8 @@ var ts; // expression constructs such as array literals and the || and ?: operators). Named types can // circularly reference themselves and therefore cannot be subtype reduced during their declaration. // For example, "type Item = string | (() => Item" is a named type that circularly references itself. - function getUnionType(types, subtypeReduction, aliasSymbol, aliasTypeArguments) { + function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments) { + if (unionReduction === void 0) { unionReduction = 1 /* Literal */; } if (types.length === 0) { return neverType; } @@ -33222,23 +33735,61 @@ var ts; return types[0]; } var typeSet = []; - addTypesToUnion(typeSet, types); - if (typeSet.containsAny) { + var includes = addTypesToUnion(typeSet, 0, types); + if (includes & 1 /* Any */) { return anyType; } - if (subtypeReduction) { - removeSubtypes(typeSet); - } - else if (typeSet.containsLiteralOrUniqueESSymbol) { - removeRedundantLiteralTypes(typeSet); + switch (unionReduction) { + case 1 /* Literal */: + if (includes & 256 /* LiteralOrUniqueESSymbol */) { + removeRedundantLiteralTypes(typeSet, includes); + } + break; + case 2 /* Subtype */: + removeSubtypes(typeSet); + break; } if (typeSet.length === 0) { - return typeSet.containsNull ? typeSet.containsNonWideningType ? nullType : nullWideningType : - typeSet.containsUndefined ? typeSet.containsNonWideningType ? undefinedType : undefinedWideningType : + return includes & 4 /* Null */ ? includes & 16 /* NonWideningType */ ? nullType : nullWideningType : + includes & 2 /* Undefined */ ? includes & 16 /* NonWideningType */ ? undefinedType : undefinedWideningType : neverType; } return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments); } + function getUnionTypePredicate(signatures) { + var first; + var types = []; + for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { + var sig = signatures_2[_i]; + var pred = getTypePredicateOfSignature(sig); + if (!pred) { + continue; + } + if (first) { + if (!typePredicateKindsMatch(first, pred)) { + // No common type predicate. + return undefined; + } + } + else { + first = pred; + } + types.push(pred.type); + } + if (!first) { + // No union signatures had a type predicate. + return undefined; + } + var unionType = getUnionType(types); + return ts.isIdentifierTypePredicate(first) + ? createIdentifierTypePredicate(first.parameterName, first.parameterIndex, unionType) + : createThisTypePredicate(unionType); + } + function typePredicateKindsMatch(a, b) { + return ts.isIdentifierTypePredicate(a) + ? ts.isIdentifierTypePredicate(b) && a.parameterIndex === b.parameterIndex + : !ts.isIdentifierTypePredicate(b); + } // This function assumes the constituent type list is sorted and deduplicated. function getUnionTypeFromSortedList(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { @@ -33268,43 +33819,46 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), /*subtypeReduction*/ false, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1 /* Literal */, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); } return links.resolvedType; } - function addTypeToIntersection(typeSet, type) { - if (type.flags & 262144 /* Intersection */) { - addTypesToIntersection(typeSet, type.types); + function addTypeToIntersection(typeSet, includes, type) { + var flags = type.flags; + if (flags & 262144 /* Intersection */) { + includes = addTypesToIntersection(typeSet, includes, type.types); } - else if (type.flags & 1 /* Any */) { - typeSet.containsAny = true; + else if (flags & 1 /* Any */) { + includes |= 1 /* Any */; } - else if (type.flags & 16384 /* Never */) { - typeSet.containsNever = true; + else if (flags & 16384 /* Never */) { + includes |= 8 /* Never */; } else if (ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { - typeSet.containsEmptyObject = true; + includes |= 1024 /* EmptyObject */; } - else if ((strictNullChecks || !(type.flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { - if (type.flags & 65536 /* Object */) { - typeSet.containsObjectType = true; + else if ((strictNullChecks || !(flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { + if (flags & 65536 /* Object */) { + includes |= 512 /* ObjectType */; } - if (type.flags & 131072 /* Union */ && typeSet.unionIndex === undefined) { - typeSet.unionIndex = typeSet.length; + if (flags & 131072 /* Union */) { + includes |= 2048 /* Union */; } - if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + if (!(flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { typeSet.push(type); } } + return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. - function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; - addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type)); + function addTypesToIntersection(typeSet, includes, types) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } + return includes; } // We normalize combinations of intersection and union types based on the distributive property of the '&' // operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection @@ -33321,26 +33875,25 @@ var ts; return emptyObjectType; } var typeSet = []; - addTypesToIntersection(typeSet, types); - if (typeSet.containsNever) { + var includes = addTypesToIntersection(typeSet, 0, types); + if (includes & 8 /* Never */) { return neverType; } - if (typeSet.containsAny) { + if (includes & 1 /* Any */) { return anyType; } - if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + if (includes & 1024 /* EmptyObject */ && !(includes & 512 /* ObjectType */)) { typeSet.push(emptyObjectType); } if (typeSet.length === 1) { return typeSet[0]; } - var unionIndex = typeSet.unionIndex; - if (unionIndex !== undefined) { + if (includes & 2048 /* Union */) { // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. - var unionType = typeSet[unionIndex]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), - /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments); + var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072 /* Union */) !== 0; }); + var unionType = typeSet[unionIndex_1]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); var type = intersectionTypes.get(id); @@ -33369,7 +33922,7 @@ var ts; return type.resolvedIndexType; } function getLiteralTypeFromPropertyName(prop) { - return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.startsWith(prop.escapedName, "__@") ? + return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.isKnownSymbol(prop) ? neverType : getLiteralType(ts.symbolName(prop)); } @@ -33377,10 +33930,11 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return maybeTypeOfKind(type, 1081344 /* TypeVariable */) ? getIndexTypeForGenericType(type) : + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) : ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : - type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : - getLiteralTypeFromPropertyNames(type); + type === wildcardType ? wildcardType : + type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : + getLiteralTypeFromPropertyNames(type); } function getIndexTypeOrString(type) { var indexType = getIndexType(type); @@ -33390,11 +33944,11 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 127 /* KeyOfKeyword */: + case 128 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 140 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 137 /* SymbolKeyword */ + case 141 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 138 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : unknownType; break; @@ -33409,7 +33963,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode : undefined; var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : @@ -33418,6 +33972,7 @@ var ts; var prop = getPropertyOfType(objectType, propName); if (prop) { if (accessExpression) { + markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 99 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); return unknownType; @@ -33431,7 +33986,7 @@ var ts; } if (!(indexType.flags & 12288 /* Nullable */) && isTypeAssignableToKind(indexType, 524322 /* StringLike */ | 84 /* NumberLike */ | 1536 /* ESSymbolLike */)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } var indexInfo = isTypeAssignableToKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || getIndexInfoOfType(objectType, 0 /* String */) || @@ -33455,7 +34010,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } @@ -33470,15 +34025,10 @@ var ts; return anyType; } function isGenericObjectType(type) { - return type.flags & 1081344 /* TypeVariable */ ? true : - ts.getObjectFlags(type) & 32 /* Mapped */ ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericObjectType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 536870912 /* GenericMappedType */); } function isGenericIndexType(type) { - return type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) ? true : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericIndexType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 524288 /* Index */); } // Return true if the given type is a non-generic object type with a string index signature and no // other members. @@ -33491,49 +34041,70 @@ var ts; } return false; } + function isMappedTypeToNever(type) { + return ts.getObjectFlags(type) & 32 /* Mapped */ && getTemplateTypeFromMappedType(type) === neverType; + } // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return // undefined if no transformation is possible. - function getTransformedIndexedAccessType(type) { + function getSimplifiedIndexedAccessType(type) { var objectType = type.objectType; - // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or - // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a - // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed - // access types with default property values as expressed by D. - if (objectType.flags & 262144 /* Intersection */ && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { - var regularTypes = []; - var stringIndexTypes = []; - for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { - var t = _a[_i]; - if (isStringIndexOnlyType(t)) { - stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); - } - else { - regularTypes.push(t); + if (objectType.flags & 262144 /* Intersection */ && isGenericObjectType(objectType)) { + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a + // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed + // access types with default property values as expressed by D. + if (ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); + } + else { + regularTypes.push(t); + } } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more mapped types with a template type `never`, '(U & V & { [P in T]: never })[K]', return a + // transformed type that removes the never-mapped type: '(U & V)[K]'. This mirrors what would happen + // eventually anyway, but it easier to reason about. + if (ts.some(objectType.types, isMappedTypeToNever)) { + var nonNeverTypes = ts.filter(objectType.types, function (t) { return !isMappedTypeToNever(t); }); + return getIndexedAccessType(getIntersectionType(nonNeverTypes), type.indexType); } - return getUnionType([ - getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), - getIntersectionType(stringIndexTypes) - ]); } // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we // construct the type Box. if (isGenericMappedType(objectType)) { - var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var objectTypeMapper = objectType.mapper; - var templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + return substituteIndexedMappedType(objectType, type); + } + if (objectType.flags & 32768 /* TypeParameter */) { + var constraint = getConstraintFromTypeParameter(objectType); + if (constraint && isGenericMappedType(constraint)) { + return substituteIndexedMappedType(constraint, type); + } } return undefined; } + function substituteIndexedMappedType(objectType, type) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + var templateMapper = objectType.mapper ? combineTypeMappers(objectType.mapper, mapper) : mapper; + return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + } function getIndexedAccessType(objectType, indexType, accessNode) { // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 181 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 184 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } @@ -33584,6 +34155,102 @@ var ts; } return links.resolvedType; } + function getActualTypeParameter(type) { + return type.flags & 4194304 /* Substitution */ ? type.typeParameter : type; + } + function createConditionalType(checkType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, aliasTypeArguments) { + var type = createType(2097152 /* Conditional */); + type.checkType = checkType; + type.extendsType = extendsType; + type.trueType = trueType; + type.falseType = falseType; + type.inferTypeParameters = inferTypeParameters; + type.target = target; + type.mapper = mapper; + type.aliasSymbol = aliasSymbol; + type.aliasTypeArguments = aliasTypeArguments; + return type; + } + function getConditionalType(checkType, baseExtendsType, baseTrueType, baseFalseType, inferTypeParameters, target, mapper, aliasSymbol, baseAliasTypeArguments) { + // Instantiate extends type without instantiating any 'infer T' type parameters + var extendsType = instantiateType(baseExtendsType, mapper); + // Return falseType for a definitely false extends check. We check an instantations of the two + // types with type parameters mapped to the wildcard type, the most permissive instantiations + // possible (the wildcard type is assignable to and from all types). If those are not related, + // then no instatiations will be and we can just return the false branch type. + if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { + return instantiateType(baseFalseType, mapper); + } + // The check could be true for some instantiation + var combinedMapper; + if (inferTypeParameters) { + var inferences = ts.map(inferTypeParameters, createInferenceInfo); + // We don't want inferences from constraints as they may cause us to eagerly resolve the + // conditional type instead of deferring resolution. Also, we always want strict function + // types rules (i.e. proper contravariance) for inferences. + inferTypes(inferences, checkType, extendsType, 8 /* NoConstraints */ | 16 /* AlwaysStrict */); + // We infer 'never' when there are no candidates for a type parameter + var inferredTypes = ts.map(inferences, function (inference) { return getTypeFromInference(inference) || neverType; }); + var inferenceMapper = createTypeMapper(inferTypeParameters, inferredTypes); + combinedMapper = mapper ? combineTypeMappers(mapper, inferenceMapper) : inferenceMapper; + } + // Return union of trueType and falseType for any and never since they match anything + if (checkType.flags & 1 /* Any */ || (checkType.flags & 16384 /* Never */ && !(extendsType.flags & 16384 /* Never */))) { + return getUnionType([instantiateType(baseTrueType, combinedMapper || mapper), instantiateType(baseFalseType, mapper)]); + } + // Instantiate the extends type including inferences for 'infer T' type parameters + var inferredExtendsType = combinedMapper ? instantiateType(baseExtendsType, combinedMapper) : extendsType; + // Return trueType for a definitely true extends check. The definitely assignable relation excludes + // type variable constraints from consideration. Without the definitely assignable relation, the type + // type Foo = T extends { x: string } ? string : number + // would immediately resolve to 'string' instead of being deferred. + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + return instantiateType(baseTrueType, combinedMapper || mapper); + } + // Return a deferred type for a check that is neither definitely true nor definitely false + var erasedCheckType = getActualTypeParameter(checkType); + var trueType = instantiateType(baseTrueType, mapper); + var falseType = instantiateType(baseFalseType, mapper); + // We compute the cache key from the ids of the four constituent types, plus an indicator of whether the + // type is distributive (i.e. whether the original declaration has a type parameter as the check type). + var isDistributive = (target ? target.checkType : erasedCheckType).flags & 32768 /* TypeParameter */ ? 1 : 0; + var id = erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id + "," + isDistributive; + var cached = conditionalTypes.get(id); + if (cached) { + return cached; + } + var result = createConditionalType(erasedCheckType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, instantiateTypes(baseAliasTypeArguments, mapper)); + conditionalTypes.set(id, result); + return result; + } + function isDistributiveConditionalType(type) { + return !!((type.target || type).checkType.flags & 32768 /* TypeParameter */); + } + function getInferTypeParameters(node) { + var result; + if (node.locals) { + node.locals.forEach(function (symbol) { + if (symbol.flags & 262144 /* TypeParameter */) { + result = ts.append(result, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result; + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getConditionalType(getTypeFromTypeNode(node.checkType), getTypeFromTypeNode(node.extendsType), getTypeFromTypeNode(node.trueType), getTypeFromTypeNode(node.falseType), getInferTypeParameters(node), /*target*/ undefined, /*mapper*/ undefined, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -33605,7 +34272,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 232 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 235 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -33616,7 +34283,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, propagatedFlags) { + function getSpreadType(left, right, symbol, typeFlags, objectFlags) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -33627,15 +34294,12 @@ var ts; return left; } if (left.flags & 131072 /* Union */) { - return mapType(left, function (t) { return getSpreadType(t, right, symbol, propagatedFlags); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); }); } if (right.flags & 131072 /* Union */) { - return mapType(right, function (t) { return getSpreadType(left, t, symbol, propagatedFlags); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); }); } - if (right.flags & 33554432 /* NonPrimitive */) { - return nonPrimitiveType; - } - if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */)) { + if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */ | 134217728 /* NonPrimitive */)) { return left; } var members = ts.createSymbolTable(); @@ -33688,9 +34352,8 @@ var ts; } } var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo)); - spread.flags |= propagatedFlags; - spread.flags |= 2097152 /* FreshLiteral */ | 8388608 /* ContainsObjectLiteral */; - spread.objectFlags |= (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); + spread.flags |= typeFlags | 33554432 /* ContainsObjectLiteral */; + spread.objectFlags |= objectFlags | (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); return spread; } function getNonReadonlySymbol(prop) { @@ -33720,9 +34383,9 @@ var ts; return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 2097152 /* FreshLiteral */)) { + if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 8388608 /* FreshLiteral */)) { if (!type.freshType) { - var freshType = createLiteralType(type.flags | 2097152 /* FreshLiteral */, type.value, type.symbol); + var freshType = createLiteralType(type.flags | 8388608 /* FreshLiteral */, type.value, type.symbol); freshType.regularType = type; type.freshType = freshType; } @@ -33731,7 +34394,7 @@ var ts; return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? type.regularType : type; + return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? type.regularType : type; } function getLiteralType(value, enumId, symbol) { // We store all literal types in a single map with keys of the form '#NNN' and '@SSS', @@ -33763,16 +34426,16 @@ var ts; if (ts.isValidESSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); var links = getSymbolLinks(symbol); - return links.type || (links.type = createUniqueESSymbolType(symbol)); + return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); } return esSymbolType; } function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 231 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 234 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && - (container.kind !== 153 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 154 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -33789,73 +34452,77 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return anyType; - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return stringType; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return numberType; case 122 /* BooleanKeyword */: return booleanType; - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return esSymbolType; case 105 /* VoidKeyword */: return voidType; - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: return undefinedType; case 95 /* NullKeyword */: return nullType; - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return neverType; - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return node.flags & 65536 /* JavaScriptFile */ ? anyType : nonPrimitiveType; - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getTypeFromTypeReference(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return booleanType; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 169 /* ParenthesizedType */: - case 275 /* JSDocNonNullableType */: - case 276 /* JSDocOptionalType */: - case 271 /* JSDocTypeExpression */: + case 172 /* ParenthesizedType */: + case 278 /* JSDocNonNullableType */: + case 279 /* JSDocOptionalType */: + case 274 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 280 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return getTypeFromMappedTypeNode(node); + case 170 /* ConditionalType */: + return getTypeFromConditionalTypeNode(node); + case 171 /* InferType */: + return getTypeFromInferTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -33864,12 +34531,18 @@ var ts; } function instantiateList(items, mapper, instantiator) { if (items && items.length) { - var result = []; - for (var _i = 0, items_1 = items; _i < items_1.length; _i++) { - var v = items_1[_i]; - result.push(instantiator(v, mapper)); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result = i === 0 ? [] : items.slice(0, i); + result.push(mapped); + for (i++; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } } - return result; } return items; } @@ -33909,7 +34582,7 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(typeParameters, index) { - return function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; }; } function isInferenceContext(mapper) { return !!mapper.signature; @@ -33925,13 +34598,16 @@ var ts; function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } + function wildcardMapper(type) { + return type.flags & 32768 /* TypeParameter */ ? wildcardType : type; + } function cloneTypeParameter(typeParameter) { var result = createType(32768 /* TypeParameter */); result.symbol = typeParameter.symbol; result.target = typeParameter; return result; } - function cloneTypePredicate(predicate, mapper) { + function instantiateTypePredicate(predicate, mapper) { if (ts.isIdentifierTypePredicate(predicate)) { return { kind: 1 /* Identifier */, @@ -33949,7 +34625,6 @@ var ts; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { // First create a fresh set of type parameters, then include a mapping from the old to the // new type parameters in the mapper function. Finally store this mapper in the new type @@ -33961,18 +34636,24 @@ var ts; tp.mapper = mapper; } } - if (signature.typePredicate) { - freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper); - } + // Don't compute resolvedReturnType and resolvedTypePredicate now, + // because using `mapper` now could trigger inferences to become fixed. (See `createInferenceContext`.) + // See GH#17600. var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), - /*resolvedReturnType*/ undefined, freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); + /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); result.target = signature; result.mapper = mapper; return result; } function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !maybeTypeOfKind(links.type, 65536 /* Object */ | 7897088 /* Instantiable */)) { + // If the type of the symbol is already resolved, and if that type could not possibly + // be affected by instantiation, simply return the symbol itself. + return symbol; + } if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var links = getSymbolLinks(symbol); // If symbol being instantiated is itself a instantiation, fetch the original target and combine the // type mappers. This ensures that original type identities are properly preserved and that aliases // always reference a non-aliases. @@ -33998,7 +34679,7 @@ var ts; var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var symbol = target.symbol; var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; + var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type // parameters that are in scope (and therefore potentially referenced). For type literals that @@ -34009,7 +34690,7 @@ var ts; typeParameters = symbol.flags & 2048 /* TypeLiteral */ && !target.aliasTypeArguments ? ts.filter(outerTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration_1); }) : outerTypeParameters; - links.typeParameters = typeParameters; + links.outerTypeParameters = typeParameters; if (typeParameters.length) { links.instantiations = ts.createMap(); links.instantiations.set(getTypeListId(typeParameters), target); @@ -34038,18 +34719,18 @@ var ts; // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced. if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container_1 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 208 /* Block */ ? "quit" : n === container_1; })) { + if (ts.findAncestor(node, function (n) { return n.kind === 211 /* Block */ ? "quit" : n === container_1; })) { return ts.forEachChild(node, containsReference); } } return true; function containsReference(node) { switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: return tp.isThisType; case 71 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return true; } return ts.forEachChild(node, containsReference); @@ -34079,7 +34760,7 @@ var ts; return instantiateAnonymousType(type, mapper); } function isMappableType(type) { - return type.flags & (1 /* Any */ | 32768 /* TypeParameter */ | 65536 /* Object */ | 262144 /* Intersection */ | 1048576 /* IndexedAccess */); + return type.flags & (1 /* Any */ | 7372800 /* InstantiableNonPrimitive */ | 65536 /* Object */ | 262144 /* Intersection */); } function instantiateAnonymousType(type, mapper) { var result = createObjectType(type.objectFlags | 64 /* Instantiated */, type.symbol); @@ -34092,8 +34773,26 @@ var ts; result.aliasTypeArguments = instantiateTypes(type.aliasTypeArguments, mapper); return result; } + function getConditionalTypeInstantiation(type, mapper) { + var target = type.target || type; + var combinedMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; + // Check if we have a conditional type where the check type is a naked type parameter. If so, + // the conditional type is distributive over union types and when T is instantiated to a union + // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). + if (isDistributiveConditionalType(target)) { + var checkType_1 = target.checkType; + var instantiatedType = combinedMapper(checkType_1); + if (checkType_1 !== instantiatedType && instantiatedType.flags & 131072 /* Union */) { + return mapType(instantiatedType, function (t) { return instantiateConditionalType(target, createReplacementMapper(checkType_1, t, combinedMapper)); }); + } + } + return instantiateConditionalType(target, combinedMapper); + } + function instantiateConditionalType(type, mapper) { + return getConditionalType(instantiateType(type.checkType, mapper), type.extendsType, type.trueType, type.falseType, type.inferTypeParameters, type, mapper, type.aliasSymbol, type.aliasTypeArguments); + } function instantiateType(type, mapper) { - if (type && mapper !== identityMapper) { + if (type && mapper && mapper !== identityMapper) { if (type.flags & 32768 /* TypeParameter */) { return mapper(type); } @@ -34109,14 +34808,20 @@ var ts; return getAnonymousTypeInstantiation(type, mapper); } if (type.objectFlags & 4 /* Reference */) { - return createTypeReference(type.target, instantiateTypes(type.typeArguments, mapper)); + var typeArguments = type.typeArguments; + var newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type; } } if (type.flags & 131072 /* Union */ && !(type.flags & 16382 /* Primitive */)) { - return getUnionType(instantiateTypes(type.types, mapper), /*subtypeReduction*/ false, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, 1 /* Literal */, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(instantiateTypes(type.types, mapper), type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 524288 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); @@ -34124,41 +34829,51 @@ var ts; if (type.flags & 1048576 /* IndexedAccess */) { return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper)); } + if (type.flags & 2097152 /* Conditional */) { + return getConditionalTypeInstantiation(type, mapper); + } + if (type.flags & 4194304 /* Substitution */) { + return mapper(type.typeParameter); + } } return type; } + function getWildcardInstantiation(type) { + return type.flags & (16382 /* Primitive */ | 1 /* Any */ | 16384 /* Never */) ? type : + type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return node.operatorToken.kind === 54 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.forEach(node.properties, isContextSensitive); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. return node.initializer && isContextSensitive(node.initializer); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: // It is possible to that node.expression is undefined (e.g
) return node.expression && isContextSensitive(node.expression); } @@ -34173,7 +34888,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 188 /* ArrowFunction */) { + if (node.kind !== 191 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -34182,7 +34897,7 @@ var ts; } } // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return node.body.kind === 208 /* Block */ ? false : isContextSensitive(node.body); + return node.body.kind === 211 /* Block */ ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -34231,7 +34946,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 131072 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 131072 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 1081344 /* TypeVariable */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & 7372800 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); } @@ -34281,8 +34996,8 @@ var ts; source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes); } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 152 /* MethodDeclaration */ && - kind !== 151 /* MethodSignature */ && kind !== 153 /* Constructor */; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 /* MethodDeclaration */ && + kind !== 152 /* MethodSignature */ && kind !== 154 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -34318,7 +35033,7 @@ var ts; // with respect to T. var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) && (getFalsyFlags(sourceType) & 12288 /* Nullable */) === (getFalsyFlags(targetType) & 12288 /* Nullable */); var related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 /* Strict */ : 1 /* Bivariant */, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : @@ -34338,11 +35053,13 @@ var ts; } var sourceReturnType = getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions - if (target.typePredicate) { - if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (targetTypePredicate) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + if (sourceTypePredicate) { + result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } - else if (ts.isIdentifierTypePredicate(target.typePredicate)) { + else if (ts.isIdentifierTypePredicate(targetTypePredicate)) { if (reportErrors) { errorReporter(ts.Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); } @@ -34368,13 +35085,12 @@ var ts; return 0 /* False */; } if (source.kind === 1 /* Identifier */) { - var sourcePredicate = source; var targetPredicate = target; - var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0 /* False */; @@ -34432,7 +35148,7 @@ var ts; } function isEmptyObjectType(type) { return type.flags & 65536 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : - type.flags & 33554432 /* NonPrimitive */ ? true : + type.flags & 134217728 /* NonPrimitive */ ? true : type.flags & 131072 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : type.flags & 262144 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : false; @@ -34457,7 +35173,7 @@ var ts; var targetProperty = getPropertyOfType(targetEnumType, property.escapedName); if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) { if (errorReporter) { - errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */)); + errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */)); } enumRelation.set(id, false); return false; @@ -34470,7 +35186,7 @@ var ts; function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { var s = source.flags; var t = target.flags; - if (t & 1 /* Any */ || s & 16384 /* Never */) + if (t & 1 /* Any */ || s & 16384 /* Never */ || source === wildcardType) return true; if (t & 16384 /* Never */) return false; @@ -34504,11 +35220,11 @@ var ts; return true; if (s & 8192 /* Null */ && (!strictNullChecks || t & 8192 /* Null */)) return true; - if (s & 65536 /* Object */ && t & 33554432 /* NonPrimitive */) + if (s & 65536 /* Object */ && t & 134217728 /* NonPrimitive */) return true; if (s & 1024 /* UniqueESSymbol */ || t & 1024 /* UniqueESSymbol */) return false; - if (relation === assignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { if (s & 1 /* Any */) return true; // Type number or any numeric literal type is assignable to any numeric enum type or any @@ -34520,10 +35236,10 @@ var ts; return false; } function isTypeRelatedTo(source, target, relation) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } if (source === target || @@ -34537,11 +35253,14 @@ var ts; return related === 1 /* Succeeded */; } } - if (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */) { + if (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } + function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { + return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -34569,10 +35288,24 @@ var ts; } else if (errorInfo) { if (containingMessageChain) { - errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + var chain_1 = containingMessageChain(); + if (chain_1) { + errorInfo = ts.concatenateDiagnosticMessageChains(chain_1, errorInfo); + } } diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } + // Check if we should issue an extra diagnostic to produce a quickfix for a slightly incorrect import statement + if (headMessage && errorNode && !result && source.symbol) { + var links = getSymbolLinks(source.symbol); + if (links.originatingImport && !ts.isImportCall(links.originatingImport)) { + var helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target), target, relation, /*errorNode*/ undefined); + if (helpfulRetry) { + // Likely an incorrect import. Issue a helpful diagnostic to produce a quickfix to change the import + diagnostics.add(ts.createDiagnosticForNode(links.originatingImport, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime)); + } + } + } return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { ts.Debug.assert(!!errorNode); @@ -34582,8 +35315,8 @@ var ts; var sourceType = typeToString(source); var targetType = typeToString(target); if (sourceType === targetType) { - sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */); - targetType = typeToString(target, /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */); + sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); + targetType = typeToString(target, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); } if (!message) { if (relation === comparableRelation) { @@ -34634,12 +35367,18 @@ var ts; * * Ternary.False if they are not related. */ function isRelatedTo(source, target, reportErrors, headMessage) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } + if (source.flags & 4194304 /* Substitution */) { + source = relation === definitelyAssignableRelation ? source.typeParameter : source.substitute; + } + if (target.flags & 4194304 /* Substitution */) { + target = target.typeParameter; + } // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return -1 /* True */; @@ -34649,8 +35388,9 @@ var ts; if (relation === comparableRelation && !(target.flags & 16384 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1 /* True */; - if (isObjectLiteralType(source) && source.flags & 2097152 /* FreshLiteral */) { - if (hasExcessProperties(source, target, reportErrors)) { + if (isObjectLiteralType(source) && source.flags & 8388608 /* FreshLiteral */) { + var discriminantType = target.flags & 131072 /* Union */ ? findMatchingDiscriminantType(source, target) : undefined; + if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { reportRelationError(headMessage, source, target); } @@ -34660,7 +35400,7 @@ var ts; // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { source = getRegularTypeOfObjectLiteral(source); } } @@ -34721,7 +35461,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false); } - if (!result && (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */)) { + if (!result && (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; } @@ -34741,32 +35481,55 @@ var ts; } function isIdenticalTo(source, target) { var result; - if (source.flags & 65536 /* Object */ && target.flags & 65536 /* Object */) { + var flags = source.flags & target.flags; + if (flags & 65536 /* Object */) { return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } - if (source.flags & 131072 /* Union */ && target.flags & 131072 /* Union */ || - source.flags & 262144 /* Intersection */ && target.flags & 262144 /* Intersection */) { + if (flags & (131072 /* Union */ | 262144 /* Intersection */)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & 524288 /* Index */) { + return isRelatedTo(source.type, target.type, /*reportErrors*/ false); + } + if (flags & 1048576 /* IndexedAccess */) { + if (result = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { + return result; + } + } + } + if (flags & 2097152 /* Conditional */) { + if (result = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.trueType, target.trueType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.falseType, target.falseType, /*reportErrors*/ false)) { + if (isDistributiveConditionalType(source) === isDistributiveConditionalType(target)) { + return result; + } + } + } + } + } + } + if (flags & 4194304 /* Substitution */) { + return isRelatedTo(source.substitute, target.substitute, /*reportErrors*/ false); + } return 0 /* False */; } - function hasExcessProperties(source, target, reportErrors) { + function hasExcessProperties(source, target, discriminant, reportErrors) { if (maybeTypeOfKind(target, 65536 /* Object */) && !(ts.getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); - if ((relation === assignableRelation || relation === comparableRelation) && + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); + if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } - if (target.flags & 131072 /* Union */) { - var discriminantType = findMatchingDiscriminantType(source, target); - if (discriminantType) { - // check excess properties against discriminant type only, not the entire union - return hasExcessProperties(source, discriminantType, reportErrors); - } + if (discriminant) { + // check excess properties against discriminant type only, not the entire union + return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } var _loop_5 = function (prop) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -35030,6 +35793,9 @@ var ts; } return result; } + function getConstraintForRelation(type) { + return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); + } function structuredTypeRelatedTo(source, target, reportErrors) { var result; var originalErrorInfo; @@ -35037,7 +35803,7 @@ var ts; if (target.flags & 32768 /* TypeParameter */) { // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. if (ts.getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -35055,7 +35821,7 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // constraint of T. - var constraint = getConstraintOfType(target.type); + var constraint = getConstraintForRelation(target.type); if (constraint) { if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { return result; @@ -35064,8 +35830,8 @@ var ts; } else if (target.flags & 1048576 /* IndexedAccess */) { // A type S is related to a type T[K] if S is related to A[K], where K is string-like and - // A is the apparent type of S. - var constraint = getConstraintOfIndexedAccess(target); + // A is the apparent type of T. + var constraint = getConstraintForRelation(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { errorInfo = saveErrorInfo; @@ -35073,19 +35839,30 @@ var ts; } } } - else if (isGenericMappedType(target) && !isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (isGenericMappedType(target)) { + // A source type T is related to a target type { [P in X]: T[P] } + var template = getTemplateTypeFromMappedType(target); + var modifiers = getMappedTypeModifiers(target); + if (!(modifiers & 8 /* ExcludeOptional */)) { + if (template.flags & 1048576 /* IndexedAccess */ && template.objectType === source && + template.indexType === getTypeParameterFromMappedType(target)) { + return -1 /* True */; + } + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } if (source.flags & 32768 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(source); + var constraint = getConstraintForRelation(source); // A type parameter with no constraint is not related to the non-primitive object type. - if (constraint || !(target.flags & 33554432 /* NonPrimitive */)) { + if (constraint || !(target.flags & 134217728 /* NonPrimitive */)) { if (!constraint || constraint.flags & 1 /* Any */) { constraint = emptyObjectType; } @@ -35100,25 +35877,53 @@ var ts; else if (source.flags & 1048576 /* IndexedAccess */) { // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and // A is the apparent type of S. - var constraint = getConstraintOfIndexedAccess(source); + var constraint = getConstraintForRelation(source); if (constraint) { if (result = isRelatedTo(constraint, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } } - else if (target.flags & 1048576 /* IndexedAccess */ && source.indexType === target.indexType) { - // if we have indexed access types with identical index types, see if relationship holds for - // the two object types. + else if (target.flags & 1048576 /* IndexedAccess */) { if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + result &= isRelatedTo(source.indexType, target.indexType, reportErrors); + } + if (result) { errorInfo = saveErrorInfo; return result; } } } + else if (source.flags & 2097152 /* Conditional */) { + if (relation !== definitelyAssignableRelation) { + var constraint = getConstraintOfDistributiveConditionalType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (target.flags & 2097152 /* Conditional */) { + if (isTypeIdenticalTo(source.checkType, target.checkType) && + isTypeIdenticalTo(source.extendsType, target.extendsType)) { + if (result = isRelatedTo(source.trueType, target.trueType, reportErrors)) { + result &= isRelatedTo(source.falseType, target.falseType, reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } else { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && - !(source.flags & 134217728 /* MarkerType */ || target.flags & 134217728 /* MarkerType */)) { + !(ts.getObjectFlags(source) & 8192 /* MarkerType */ || ts.getObjectFlags(target) & 8192 /* MarkerType */)) { // We have type references to the same generic type, and the type references are not marker // type references (which are intended by be compared structurally). Obtain the variance // information for the type parameters and relate the type arguments accordingly. @@ -35200,8 +36005,7 @@ var ts; // that S and T are contra-variant whereas X and Y are co-variant. function mappedTypeRelatedTo(source, target, reportErrors) { var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & 2 /* Optional */) || - getCombinedMappedTypeModifiers(target) & 2 /* Optional */); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { var result_1; if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -35244,6 +36048,9 @@ var ts; if (!(targetProp.flags & 4194304 /* Prototype */)) { var sourceProp = getPropertyOfType(source, targetProp.escapedName); if (sourceProp && sourceProp !== targetProp) { + if (isIgnoredJsxProperty(source, sourceProp, getTypeOfSymbol(targetProp))) { + continue; + } var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { @@ -35324,7 +36131,7 @@ var ts; return false; } function hasCommonProperties(source, target) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -35454,6 +36261,9 @@ var ts; var result = -1 /* True */; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; + if (isIgnoredJsxProperty(source, prop, /*targetMemberType*/ undefined)) { + continue; + } if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) { var related = isRelatedTo(getTypeOfSymbol(prop), target, reportErrors); if (!related) { @@ -35550,7 +36360,7 @@ var ts; // type, and flag the result as a marker type reference. function getMarkerTypeReference(type, source, target) { var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; })); - result.flags |= 134217728 /* MarkerType */; + result.objectFlags |= 8192 /* MarkerType */; return result; } // Return an array containing the variance of each type parameter. The variance is effectively @@ -35623,7 +36433,7 @@ var ts; for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { var t = _a[_i]; if (isUnconstrainedTypeParameter(t)) { - var index = ts.indexOf(typeParameters, t); + var index = typeParameters.indexOf(t); if (index < 0) { index = typeParameters.length; typeParameters.push(t); @@ -35814,17 +36624,25 @@ var ts; result &= related; } if (!ignoreReturnTypes) { - result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + result &= sourceTypePredicate !== undefined || targetTypePredicate !== undefined + ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) + // If they're both type predicates their return types will both be `boolean`, so no need to compare those. + : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } return result; } + function compareTypePredicatesIdentical(source, target, compareTypes) { + return source === undefined || target === undefined || !typePredicateKindsMatch(source, target) ? 0 /* False */ : compareTypes(source.type, target.type); + } function isRestParameterIndex(signature, parameterIndex) { return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var t = types_9[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -35850,7 +36668,7 @@ var ts; var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 12288 /* Nullable */); }); return primaryTypes.length ? getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 12288 /* Nullable */) : - getUnionType(types, /*subtypeReduction*/ true); + getUnionType(types, 2 /* Subtype */); } // Return the leftmost type for which no type to the right is a subtype. function getCommonSubtype(types) { @@ -35890,8 +36708,8 @@ var ts; } function getWidenedLiteralType(type) { return type.flags & 256 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : - type.flags & 32 /* StringLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? stringType : - type.flags & 64 /* NumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? numberType : + type.flags & 32 /* StringLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? stringType : + type.flags & 64 /* NumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? numberType : type.flags & 128 /* BooleanLiteral */ ? booleanType : type.flags & 131072 /* Union */ ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) : type; @@ -35916,8 +36734,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; result |= getFalsyFlags(t); } return result; @@ -36003,7 +36821,7 @@ var ts; * Leave signatures alone since they are not subject to the check. */ function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType(type) && type.flags & 2097152 /* FreshLiteral */)) { + if (!(isObjectLiteralType(type) && type.flags & 8388608 /* FreshLiteral */)) { return type; } var regularType = type.regularType; @@ -36013,7 +36831,7 @@ var ts; var resolved = type; var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo); - regularNew.flags = resolved.flags & ~2097152 /* FreshLiteral */; + regularNew.flags = resolved.flags & ~8388608 /* FreshLiteral */; regularNew.objectFlags |= 128 /* ObjectLiteral */; type.regularType = regularNew; return regularNew; @@ -36095,7 +36913,7 @@ var ts; return getWidenedTypeWithContext(type, /*context*/ undefined); } function getWidenedTypeWithContext(type, context) { - if (type.flags & 12582912 /* RequiresWidening */) { + if (type.flags & 50331648 /* RequiresWidening */) { if (type.flags & 12288 /* Nullable */) { return anyType; } @@ -36108,7 +36926,7 @@ var ts; // Widening an empty object literal transitions from a highly restrictive type to // a highly inclusive one. For that reason we perform subtype reduction here if the // union includes empty object types (e.g. reducing {} | string to just {}). - return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType)); + return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); } if (isArrayType(type) || isTupleType(type)) { return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); @@ -36129,7 +36947,7 @@ var ts; */ function reportWideningErrorsInType(type) { var errorReported = false; - if (type.flags & 4194304 /* ContainsWideningType */) { + if (type.flags & 16777216 /* ContainsWideningType */) { if (type.flags & 131072 /* Union */) { if (ts.some(type.types, isEmptyObjectType)) { errorReported = true; @@ -36155,9 +36973,9 @@ var ts; for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); - if (t.flags & 4194304 /* ContainsWideningType */) { + if (t.flags & 16777216 /* ContainsWideningType */) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, ts.symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -36170,38 +36988,41 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 147 /* Parameter */: + case 148 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; + case 176 /* MappedType */: + error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + return; default: diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && noImplicitAny && type.flags & 4194304 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 16777216 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -36250,6 +37071,7 @@ var ts; return { typeParameter: typeParameter, candidates: undefined, + contraCandidates: undefined, inferredType: undefined, priority: undefined, topLevel: true, @@ -36260,6 +37082,7 @@ var ts; return { typeParameter: inference.typeParameter, candidates: inference.candidates && inference.candidates.slice(), + contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), inferredType: inference.inferredType, priority: inference.priority, topLevel: inference.topLevel, @@ -36271,7 +37094,7 @@ var ts; // results for union and intersection types for performance reasons. function couldContainTypeVariables(type) { var objectFlags = ts.getObjectFlags(type); - return !!(type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) || + return !!(type.flags & 7897088 /* Instantiable */ || objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || objectFlags & 32 /* Mapped */ || @@ -36286,7 +37109,7 @@ var ts; function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 393216 /* UnionOrIntersection */ && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - /** Create an object with properties named in the string literal type. Every property has type `{}` */ + /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { var members = ts.createSymbolTable(); forEachType(type, function (t) { @@ -36295,7 +37118,7 @@ var ts; } var name = ts.escapeLeadingUnderscores(t.value); var literalProp = createSymbol(4 /* Property */, name); - literalProp.type = emptyObjectType; + literalProp.type = anyType; if (t.symbol) { literalProp.declarations = t.symbol.declarations; literalProp.valueDeclaration = t.symbol.valueDeclaration; @@ -36311,42 +37134,43 @@ var ts; * property is computed by inferring from the source property type to X for the type * variable T[P] (i.e. we treat the type T[P] as the type variable we're inferring for). */ - function inferTypeForHomomorphicMappedType(source, target, mappedTypeStack) { + function inferTypeForHomomorphicMappedType(source, target) { + var key = source.id + "," + target.id; + if (reverseMappedCache.has(key)) { + return reverseMappedCache.get(key); + } + reverseMappedCache.set(key, undefined); + var type = createReverseMappedType(source, target); + reverseMappedCache.set(key, type); + return type; + } + function createReverseMappedType(source, target) { var properties = getPropertiesOfType(source); - var indexInfo = getIndexInfoOfType(source, 0 /* String */); - if (properties.length === 0 && !indexInfo) { + if (properties.length === 0 && !getIndexInfoOfType(source, 0 /* String */)) { return undefined; } - var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); - var inference = createInferenceInfo(typeParameter); - var inferences = [inference]; - var templateType = getTemplateTypeFromMappedType(target); - var readonlyMask = target.declaration.readonlyToken ? false : true; - var optionalMask = target.declaration.questionToken ? 0 : 16777216 /* Optional */; - var members = ts.createSymbolTable(); + // If any property contains context sensitive functions that have been skipped, the source type + // is incomplete and we can't infer a meaningful input type. for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { var prop = properties_4[_i]; - var propType = getTypeOfSymbol(prop); - // If any property contains context sensitive functions that have been skipped, the source type - // is incomplete and we can't infer a meaningful input type. - if (propType.flags & 16777216 /* ContainsAnyFunctionType */) { + if (getTypeOfSymbol(prop).flags & 67108864 /* ContainsAnyFunctionType */) { return undefined; } - var checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0; - var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); - inferredProp.declarations = prop.declarations; - inferredProp.type = inferTargetType(propType); - members.set(prop.escapedName, inferredProp); - } - if (indexInfo) { - indexInfo = createIndexInfo(inferTargetType(indexInfo.type), readonlyMask && indexInfo.isReadonly); - } - return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined); - function inferTargetType(sourceType) { - inference.candidates = undefined; - inferTypes(inferences, sourceType, templateType, 0, mappedTypeStack); - return inference.candidates ? getUnionType(inference.candidates, /*subtypeReduction*/ true) : emptyObjectType; } + var reversed = createObjectType(2048 /* ReverseMapped */ | 16 /* Anonymous */, /*symbol*/ undefined); + reversed.source = source; + reversed.mappedType = target; + return reversed; + } + function getTypeOfReverseMappedSymbol(symbol) { + return inferReverseMappedType(symbol.propertyType, symbol.mappedType); + } + function inferReverseMappedType(sourceType, target) { + var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + var inference = createInferenceInfo(typeParameter); + inferTypes([inference], sourceType, templateType); + return getTypeFromInference(inference) || emptyObjectType; } function getUnmatchedProperty(source, target, requireOptionalProperties) { var properties = target.flags & 262144 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); @@ -36361,10 +37185,16 @@ var ts; } return undefined; } - function inferTypes(inferences, originalSource, originalTarget, priority, mappedTypeStack) { + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : + inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : + undefined; + } + function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; var visited; + var contravariant = false; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -36427,31 +37257,33 @@ var ts; // not contain anyFunctionType when we come back to this argument for its second round // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard // when constructing types from type parameters that had no inference candidates). - if (source.flags & 16777216 /* ContainsAnyFunctionType */ || source === silentNeverType) { + if (source.flags & 67108864 /* ContainsAnyFunctionType */ || source === silentNeverType) { return; } var inference = getInferenceInfoForType(target); if (inference) { if (!inference.isFixed) { - // We give lowest priority to inferences of implicitNeverType (which is used as the - // element type for empty array literals). Thus, inferences from empty array literals - // only matter when no other inferences are made. - var p = priority | (source === implicitNeverType ? 16 /* NeverType */ : 0); - if (!inference.candidates || p < inference.priority) { - inference.candidates = [source]; - inference.priority = p; + if (inference.priority === undefined || priority < inference.priority) { + inference.candidates = undefined; + inference.contraCandidates = undefined; + inference.priority = priority; } - else if (p === inference.priority) { - inference.candidates.push(source); + if (priority === inference.priority) { + if (contravariant) { + inference.contraCandidates = ts.append(inference.contraCandidates, source); + } + else { + inference.candidates = ts.append(inference.candidates, source); + } } - if (!(p & 8 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 4 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; } } return; } } - else if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { + if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { // If source and target are references to the same generic type, infer from type arguments var sourceTypes = source.typeArguments || ts.emptyArray; var targetTypes = target.typeArguments || ts.emptyArray; @@ -36467,20 +37299,26 @@ var ts; } } else if (source.flags & 524288 /* Index */ && target.flags & 524288 /* Index */) { - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; inferFromTypes(source.type, target.type); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else if ((isLiteralType(source) || source.flags & 2 /* String */) && target.flags & 524288 /* Index */) { var empty = createEmptyObjectTypeFromStringLiteral(source); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; inferFromTypes(empty, target.type); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else if (source.flags & 1048576 /* IndexedAccess */ && target.flags & 1048576 /* IndexedAccess */) { inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } + else if (source.flags & 2097152 /* Conditional */ && target.flags & 2097152 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(source.trueType, target.trueType); + inferFromTypes(source.falseType, target.falseType); + } else if (target.flags & 393216 /* UnionOrIntersection */) { var targetTypes = target.types; var typeVariableCount = 0; @@ -36501,7 +37339,7 @@ var ts; // types in contra-variant positions (such as callback parameters). if (typeVariableCount === 1) { var savePriority = priority; - priority |= 2 /* NakedTypeVariable */; + priority |= 1 /* NakedTypeVariable */; inferFromTypes(source, typeVariable); priority = savePriority; } @@ -36515,7 +37353,9 @@ var ts; } } else { - source = getApparentType(source); + if (!(priority && 8 /* NoConstraints */ && source.flags & (262144 /* Intersection */ | 7897088 /* Instantiable */))) { + source = getApparentType(source); + } if (source.flags & (65536 /* Object */ | 262144 /* Intersection */)) { var key = source.id + "," + target.id; if (visited && visited.get(key)) { @@ -36544,10 +37384,10 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes) { - priority ^= 1 /* Contravariant */; + if (strictFunctionTypes || priority & 16 /* AlwaysStrict */) { + contravariant = !contravariant; inferFromTypes(source, target); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else { inferFromTypes(source, target); @@ -36580,16 +37420,10 @@ var ts; // such that direct inferences to T get priority over inferences to Partial, for example. var inference = getInferenceInfoForType(constraintType.type); if (inference && !inference.isFixed) { - var key = (source.symbol ? getSymbolId(source.symbol) + "," : "") + getSymbolId(target.symbol); - if (ts.contains(mappedTypeStack, key)) { - return; - } - (mappedTypeStack || (mappedTypeStack = [])).push(key); - var inferredType = inferTypeForHomomorphicMappedType(source, target, mappedTypeStack); - mappedTypeStack.pop(); + var inferredType = inferTypeForHomomorphicMappedType(source, target); if (inferredType) { var savePriority = priority; - priority |= 4 /* MappedType */; + priority |= 2 /* MappedType */; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -36635,8 +37469,10 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromContravariantTypes); - if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) { - inferFromTypes(source.typePredicate.type, target.typePredicate.type); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (sourceTypePredicate && targetTypePredicate && sourceTypePredicate.kind === targetTypePredicate.kind) { + inferFromTypes(sourceTypePredicate.type, targetTypePredicate.type); } else { inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -36663,8 +37499,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -36696,7 +37532,7 @@ var ts; if (candidates.length > 1) { var objectLiterals = ts.filter(candidates, isObjectLiteralType); if (objectLiterals.length) { - var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, /*subtypeReduction*/ true)); + var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, 2 /* Subtype */)); return ts.concatenate(ts.filter(candidates, function (t) { return !isObjectLiteralType(t); }), [objectLiteralsType]); } } @@ -36721,10 +37557,19 @@ var ts; // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if // union types were requested or if all inferences were made from the return type position, infer a // union type. Otherwise, infer a common supertype. - var unwidenedType = inference.priority & 1 /* Contravariant */ ? getCommonSubtype(baseCandidates) : - context.flags & 1 /* InferUnionTypes */ || inference.priority & 8 /* ReturnType */ ? getUnionType(baseCandidates, /*subtypeReduction*/ true) : - getCommonSupertype(baseCandidates); + var unwidenedType = context.flags & 1 /* InferUnionTypes */ || inference.priority & 4 /* ReturnType */ ? + getUnionType(baseCandidates, 2 /* Subtype */) : + getCommonSupertype(baseCandidates); inferredType = getWidenedType(unwidenedType); + // If we have inferred 'never' but have contravariant candidates. To get a more specific type we + // infer from the contravariant candidates instead. + if (inferredType.flags & 16384 /* Never */ && inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); + } + } + else if (inference.contraCandidates) { + // We only have contravariant inferences, infer the best common subtype of those + inferredType = getCommonSubtype(inference.contraCandidates); } else if (context.flags & 2 /* NoDefault */) { // We use silentNeverType as the wildcard that signals no inferences. @@ -36773,7 +37618,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; + resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), + /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; } @@ -36781,7 +37627,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 163 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 144 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 164 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 145 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -36797,13 +37643,13 @@ var ts; if (node.kind === 99 /* ThisKeyword */) { return "0"; } - if (node.kind === 180 /* PropertyAccessExpression */) { + if (node.kind === 183 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + ts.idText(node.name); } - if (node.kind === 177 /* BindingElement */) { + if (node.kind === 180 /* BindingElement */) { var container = node.parent.parent; - var key = container.kind === 177 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); + var key = container.kind === 180 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); var text = getBindingElementNameText(node); var result = key && text && (key + "." + text); return result; @@ -36811,12 +37657,12 @@ var ts; return undefined; } function getBindingElementNameText(element) { - if (element.parent.kind === 175 /* ObjectBindingPattern */) { + if (element.parent.kind === 178 /* ObjectBindingPattern */) { var name = element.propertyName || element.name; switch (name.kind) { case 71 /* Identifier */: return ts.idText(name); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -36834,26 +37680,26 @@ var ts; switch (source.kind) { case 71 /* Identifier */: return target.kind === 71 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 227 /* VariableDeclaration */ || target.kind === 177 /* BindingElement */) && + (target.kind === 230 /* VariableDeclaration */ || target.kind === 180 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 99 /* ThisKeyword */: return target.kind === 99 /* ThisKeyword */; case 97 /* SuperKeyword */: return target.kind === 97 /* SuperKeyword */; - case 180 /* PropertyAccessExpression */: - return target.kind === 180 /* PropertyAccessExpression */ && + case 183 /* PropertyAccessExpression */: + return target.kind === 183 /* PropertyAccessExpression */ && source.name.escapedText === target.name.escapedText && isMatchingReference(source.expression, target.expression); - case 177 /* BindingElement */: - if (target.kind !== 180 /* PropertyAccessExpression */) + case 180 /* BindingElement */: + if (target.kind !== 183 /* PropertyAccessExpression */) return false; var t = target; if (t.name.escapedText !== getBindingElementNameText(source)) return false; - if (source.parent.parent.kind === 177 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { + if (source.parent.parent.kind === 180 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { return true; } - if (source.parent.parent.kind === 227 /* VariableDeclaration */) { + if (source.parent.parent.kind === 230 /* VariableDeclaration */) { var maybeId = source.parent.parent.initializer; return maybeId && isMatchingReference(maybeId, t.expression); } @@ -36861,7 +37707,7 @@ var ts; return false; } function containsMatchingReference(source, target) { - while (source.kind === 180 /* PropertyAccessExpression */) { + while (source.kind === 183 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -36874,7 +37720,7 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 180 /* PropertyAccessExpression */ && + return target.kind === 183 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); } @@ -36882,7 +37728,7 @@ var ts; if (expr.kind === 71 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.escapedText); } @@ -36926,7 +37772,7 @@ var ts; } } } - if (callExpression.expression.kind === 180 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 183 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -36968,8 +37814,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getTypeFacts(t); } return result; @@ -37023,10 +37869,10 @@ var ts; if (flags & 1536 /* ESSymbolLike */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 33554432 /* NonPrimitive */) { + if (flags & 134217728 /* NonPrimitive */) { return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; } - if (flags & 1081344 /* TypeVariable */) { + if (flags & 7897088 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 393216 /* UnionOrIntersection */) { @@ -37035,16 +37881,6 @@ var ts; return 8388607 /* All */; } function getTypeWithFacts(type, include) { - if (type.flags & 1048576 /* IndexedAccess */) { - // TODO (weswig): This is a substitute for a lazy negated type to remove the types indicated by the TypeFacts from the (potential) union the IndexedAccess refers to - // - See discussion in https://github.com/Microsoft/TypeScript/pull/19275 for details, and test `strictNullNotNullIndexTypeShouldWork` for current behavior - var baseConstraint = getBaseConstraintOfType(type) || emptyObjectType; - var result = filterType(baseConstraint, function (t) { return (getTypeFacts(t) & include) !== 0; }); - if (result !== baseConstraint) { - return result; - } - return type; - } return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; }); } function getTypeWithDefault(type, defaultExpression) { @@ -37070,18 +37906,18 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 178 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 181 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 268 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 195 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 217 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 220 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { - return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); + return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); } function getAssignedTypeOfSpreadExpression(node) { return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); @@ -37095,21 +37931,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return stringType; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return undefinedType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -37117,10 +37953,10 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 175 /* ObjectBindingPattern */ ? + var type = pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? - getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : + getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } @@ -37135,35 +37971,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 216 /* ForInStatement */) { + if (node.parent.parent.kind === 219 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.parent.kind === 220 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 227 /* VariableDeclaration */ ? + return node.kind === 230 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */ ? + return node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 227 /* VariableDeclaration */ && node.initializer && + return node.kind === 230 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 177 /* BindingElement */ && node.parent.kind === 195 /* BinaryExpression */ && + node.kind !== 180 /* BindingElement */ && node.parent.kind === 198 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (node.operatorToken.kind) { case 58 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -37175,13 +38011,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 186 /* ParenthesizedExpression */ || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? + return parent.kind === 189 /* ParenthesizedExpression */ || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 261 /* CaseClause */) { + if (clause.kind === 264 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -37239,15 +38075,15 @@ var ts; // Apply a mapping function to a type and return the resulting type. If the source type // is a union type, the mapping function is applied to each constituent type and a union // of the resulting types is returned. - function mapType(type, mapper) { + function mapType(type, mapper, noReductions) { if (!(type.flags & 131072 /* Union */)) { return mapper(type); } var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var current = types_13[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -37261,7 +38097,7 @@ var ts; } } } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; + return mappedTypes ? getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -37312,7 +38148,7 @@ var ts; return elementType.flags & 16384 /* Never */ ? autoArrayType : createArrayType(elementType.flags & 131072 /* Union */ ? - getUnionType(elementType.types, /*subtypeReduction*/ true) : + getUnionType(elementType.types, 2 /* Subtype */) : elementType); } // We perform subtype reduction upon obtaining the final array type from an evolving array type. @@ -37327,8 +38163,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; if (!(t.flags & 16384 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -37351,11 +38187,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 180 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || - parent.parent.kind === 182 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 181 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 183 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || + parent.parent.kind === 185 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 184 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 195 /* BinaryExpression */ && + parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -37374,10 +38210,7 @@ var ts; var funcType = checkNonNullExpression(node.expression); if (funcType !== silentNeverType) { var apparentType = getApparentType(funcType); - if (apparentType !== unknownType) { - var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - return !!ts.forEach(callSignatures, function (sig) { return sig.typePredicate; }); - } + return apparentType !== unknownType && ts.some(getSignaturesOfType(apparentType, 0 /* Call */), signatureHasTypePredicate); } } return false; @@ -37395,7 +38228,7 @@ var ts; if (flowAnalysisDisabled) { return unknownType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 35620607 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359 /* Narrowable */)) { return declaredType; } var sharedFlowStart = sharedFlowCount; @@ -37406,7 +38239,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent && reference.parent.kind === 204 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { + if (reference.parent && reference.parent.kind === 207 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { return declaredType; } return resultType; @@ -37477,7 +38310,7 @@ var ts; else if (flags & 2 /* Start */) { // Check if we should continue with the control flow of the containing function. var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 180 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { + if (container && container !== flowContainer && reference.kind !== 183 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -37533,7 +38366,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 182 /* CallExpression */ ? + var expr = node.kind === 185 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -37541,7 +38374,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -37627,7 +38460,7 @@ var ts; seenIncomplete = true; } } - return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete); + return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */), seenIncomplete); } function getTypeAtFlowLoopLabel(flow) { // If we have previously computed the control flow type for the reference at @@ -37655,7 +38488,7 @@ var ts; // path that leads to the top. for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { - return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], /*subtypeReduction*/ false), /*incomplete*/ true); + return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], 1 /* Literal */), /*incomplete*/ true); } } // Add the flow loop junction and reference to the in-process stack and analyze @@ -37675,7 +38508,7 @@ var ts; firstAntecedentType = flowType; } var type = getTypeFromFlowType(flowType); - // If we see a value appear in the cache it is a sign that control flow analysis + // If we see a value appear in the cache it is a sign that control flow analysis // was restarted and completed by checkExpressionCached. We can simply pick up // the resulting type and bail out. var cached_1 = cache.get(key); @@ -37698,7 +38531,7 @@ var ts; } // The result is incomplete if the first antecedent (the non-looping control flow path) // is incomplete. - var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction); + var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */); if (isIncomplete(firstAntecedentType)) { return createFlowType(result, /*incomplete*/ true); } @@ -37706,7 +38539,7 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - return expr.kind === 180 /* PropertyAccessExpression */ && + return expr.kind === 183 /* PropertyAccessExpression */ && computedType.flags & 131072 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, expr.name.escapedText); @@ -37729,6 +38562,23 @@ var ts; } return type; } + function isTypePresencePossible(type, propName, assumeTrue) { + if (getIndexInfoOfType(type, 0 /* String */)) { + return true; + } + var prop = getPropertyOfType(type, propName); + if (prop) { + return prop.flags & 16777216 /* Optional */ ? true : assumeTrue; + } + return !assumeTrue; + } + function narrowByInKeyword(type, literal, assumeTrue) { + if ((type.flags & (131072 /* Union */ | 65536 /* Object */)) || (type.flags & 32768 /* TypeParameter */ && type.isThisType)) { + var propName_1 = ts.escapeLeadingUnderscores(literal.text); + return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); }); + } + return type; + } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: @@ -37740,10 +38590,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 190 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { + if (left_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 190 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { + if (right_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -37764,6 +38614,12 @@ var ts; break; case 93 /* InstanceOfKeyword */: return narrowTypeByInstanceof(type, expr, assumeTrue); + case 92 /* InKeyword */: + var target = getReferenceCandidate(expr.right); + if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { + return narrowByInKeyword(type, expr.left, assumeTrue); + } + break; case 26 /* CommaToken */: return narrowType(type, expr.right, assumeTrue); } @@ -37789,7 +38645,7 @@ var ts; assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33620481 /* NotUnionOrUnit */) { + if (type.flags & 134283777 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -37825,7 +38681,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 1081344 /* TypeVariable */) { + if (type.flags & 7897088 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -37848,7 +38704,7 @@ var ts; var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType); var discriminantType = getUnionType(clauseTypes); var caseType = discriminantType.flags & 16384 /* Never */ ? neverType : - replacePrimitivesWithLiterals(filterType(type, function (t) { return isTypeComparableTo(discriminantType, t); }), discriminantType); + replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType); if (!hasDefaultClause) { return caseType; } @@ -37928,7 +38784,7 @@ var ts; return type; } var signature = getResolvedSignature(callExpression); - var predicate = signature.typePredicate; + var predicate = getTypePredicateOfSignature(signature); if (!predicate) { return type; } @@ -37949,7 +38805,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 181 /* ElementAccessExpression */ || invokedExpression.kind === 180 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 184 /* ElementAccessExpression */ || invokedExpression.kind === 183 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -37969,15 +38825,15 @@ var ts; case 71 /* Identifier */: case 99 /* ThisKeyword */: case 97 /* SuperKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (expr.operator === 51 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -38013,9 +38869,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 235 /* ModuleBlock */ || - node.kind === 269 /* SourceFile */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 238 /* ModuleBlock */ || + node.kind === 272 /* SourceFile */ || + node.kind === 151 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -38037,7 +38893,7 @@ var ts; if (node.kind === 71 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 147 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148 /* Parameter */) { symbol.isAssigned = true; } } @@ -38052,7 +38908,7 @@ var ts; /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 147 /* Parameter */ && + declaration.kind === 148 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 4096 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096 /* Undefined */); @@ -38060,24 +38916,30 @@ var ts; } function isApparentTypePosition(node) { var parent = node.parent; - return parent.kind === 180 /* PropertyAccessExpression */ || - parent.kind === 182 /* CallExpression */ && parent.expression === node || - parent.kind === 181 /* ElementAccessExpression */ && parent.expression === node; + return parent.kind === 183 /* PropertyAccessExpression */ || + parent.kind === 185 /* CallExpression */ && parent.expression === node || + parent.kind === 184 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 207 /* NonNullExpression */ || + parent.kind === 180 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 1081344 /* TypeVariable */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); + return type.flags & 7372800 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); } - function getDeclaredOrApparentType(symbol, node) { + function getApparentTypeForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, // and the type of the node includes type variables with constraints that are nullable, we fetch the // apparent type of the node *before* performing control flow analysis such that narrowings apply to // the constraint type. - var type = getTypeOfSymbol(symbol); if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { return mapType(getWidenedType(type), getApparentType); } return type; } + function markAliasReferenced(symbol, location) { + if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + markAliasSymbolAsReferenced(symbol); + } + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -38092,7 +38954,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -38103,9 +38965,9 @@ var ts; return getTypeOfSymbol(symbol); } // We should only mark aliases as referenced if there isn't a local value declaration - // for the symbol. - if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { - markAliasSymbolAsReferenced(symbol); + // for the symbol. Also, don't mark any property access expression LHS - checkPropertyAccessExpression will handle that + if (!(node.parent && ts.isPropertyAccessExpression(node.parent) && node.parent.expression === node)) { + markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -38113,7 +38975,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 230 /* ClassDeclaration */ + if (declaration.kind === 233 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -38125,14 +38987,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 200 /* ClassExpression */) { + else if (declaration.kind === 203 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); while (container !== undefined) { if (container.parent === declaration) { - if (container.kind === 150 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 151 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -38146,7 +39008,7 @@ var ts; checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - var type = getDeclaredOrApparentType(localOrExportSymbol, node); + var type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { if (!(localOrExportSymbol.flags & 3 /* Variable */)) { @@ -38178,28 +39040,29 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 147 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 148 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; + var isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 187 /* FunctionExpression */ || - flowContainer.kind === 188 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 190 /* FunctionExpression */ || + flowContainer.kind === 191 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } // We only look for uninitialized variables in strict null checking mode, and only when we can analyze // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). - var assumeInitialized = isParameter || isAlias || isOuterVariable || + var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || - isInTypeQuery(node) || node.parent.kind === 247 /* ExportSpecifier */) || - node.parent.kind === 204 /* NonNullExpression */ || - declaration.kind === 227 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 250 /* ExportSpecifier */) || + node.parent.kind === 207 /* NonNullExpression */ || + declaration.kind === 230 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 2097152 /* Ambient */; - var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); @@ -38228,7 +39091,7 @@ var ts; function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 264 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 267 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -38253,8 +39116,8 @@ var ts; } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. - if (container.kind === 215 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 228 /* VariableDeclarationList */).parent === container && + if (container.kind === 218 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 231 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -38268,7 +39131,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 186 /* ParenthesizedExpression */) { + while (current.parent.kind === 189 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -38276,7 +39139,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 193 /* PrefixUnaryExpression */ || current.parent.kind === 194 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 196 /* PrefixUnaryExpression */ || current.parent.kind === 197 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; } @@ -38289,7 +39152,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 150 /* PropertyDeclaration */ || container.kind === 153 /* Constructor */) { + if (container.kind === 151 /* PropertyDeclaration */ || container.kind === 154 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -38357,51 +39220,60 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 153 /* Constructor */) { + if (container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES2015 */); } switch (container.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 153 /* Constructor */: + case 154 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } + var type = tryGetThisTypeAt(node, container); + if (!type && noImplicitThis) { + // With noImplicitThis, functions may not reference 'this' if it has type 'any' + error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + } + return type || anyType; + } + function tryGetThisTypeAt(node, container) { + if (container === void 0) { container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (container.kind === 187 /* FunctionExpression */ && - container.parent.kind === 195 /* BinaryExpression */ && + if (container.kind === 190 /* FunctionExpression */ && + container.parent.kind === 198 /* BinaryExpression */ && ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.prototype.y = f @@ -38410,12 +39282,12 @@ var ts; .expression; // x var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { - return getInferredClassType(classSymbol); + return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { - return thisType; + return getFlowTypeOfReference(node, thisType); } } if (ts.isClassLike(container.parent)) { @@ -38426,18 +39298,13 @@ var ts; if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); if (type && type !== unknownType) { - return type; + return getFlowTypeOfReference(node, type); } } - if (noImplicitThis) { - // With noImplicitThis, functions may not reference 'this' if it has type 'any' - error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); - } - return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 277 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 280 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -38447,15 +39314,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 147 /* Parameter */; }); + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 182 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 185 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 188 /* ArrowFunction */) { + while (container && container.kind === 191 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -38468,14 +39335,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 145 /* ComputedPropertyName */; }); - if (current && current.kind === 145 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146 /* ComputedPropertyName */; }); + if (current && current.kind === 146 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -38483,7 +39350,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 153 /* Constructor */) { + if (!isCallExpression && container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -38549,7 +39416,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 152 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 153 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -38563,7 +39430,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (container.parent.kind === 182 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -38584,7 +39451,7 @@ var ts; if (!baseClassType) { return unknownType; } - if (container.kind === 153 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 154 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -38599,7 +39466,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 153 /* Constructor */; + return container.kind === 154 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -38607,21 +39474,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */; } else { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */ || - container.kind === 150 /* PropertyDeclaration */ || - container.kind === 149 /* PropertySignature */ || - container.kind === 153 /* Constructor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */ || + container.kind === 151 /* PropertyDeclaration */ || + container.kind === 150 /* PropertySignature */ || + container.kind === 154 /* Constructor */; } } } @@ -38629,10 +39496,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 152 /* MethodDeclaration */ || - func.kind === 154 /* GetAccessor */ || - func.kind === 155 /* SetAccessor */) && func.parent.kind === 179 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 187 /* FunctionExpression */ && func.parent.kind === 265 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 153 /* MethodDeclaration */ || + func.kind === 155 /* GetAccessor */ || + func.kind === 156 /* SetAccessor */) && func.parent.kind === 182 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 190 /* FunctionExpression */ && func.parent.kind === 268 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -38644,7 +39511,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 188 /* ArrowFunction */) { + if (func.kind === 191 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -38671,7 +39538,7 @@ var ts; if (thisType) { return instantiateType(thisType, getContextualMapper(containingLiteral)); } - if (literal.parent.kind !== 265 /* PropertyAssignment */) { + if (literal.parent.kind !== 268 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -38685,9 +39552,9 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = func.parent; - if (parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { + if (parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { var target = parent.left; - if (target.kind === 180 /* PropertyAccessExpression */ || target.kind === 181 /* ElementAccessExpression */) { + if (target.kind === 183 /* PropertyAccessExpression */ || target.kind === 184 /* ElementAccessExpression */) { var expression = target.expression; // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }` if (inJs && ts.isIdentifier(expression)) { @@ -38708,7 +39575,7 @@ var ts; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); if (iife && iife.arguments) { - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (parameter.dotDotDotToken) { var restTypes = []; for (var i = indexOfParameter; i < iife.arguments.length; i++) { @@ -38729,7 +39596,7 @@ var ts; if (contextualSignature) { var funcHasRestParameters = ts.hasRestParameter(func); var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (ts.getThisParameter(func) !== undefined && !contextualSignature.thisParameter) { ts.Debug.assert(indexOfParameter !== 0); // Otherwise we should not have called `getContextuallyTypedParameterType`. indexOfParameter -= 1; @@ -38757,12 +39624,12 @@ var ts; // the contextual type of an initializer expression is the type annotation of the containing declaration, if present. function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; - if (node === declaration.initializer || node.kind === 58 /* EqualsToken */) { + if (ts.hasInitializer(declaration) && node === declaration.initializer) { var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -38774,7 +39641,7 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 177 /* BindingElement */) { + if (parentDeclaration.kind !== 180 /* BindingElement */) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !ts.isBindingPattern(name)) { var text = ts.getTextOfPropertyName(name); @@ -38830,7 +39697,7 @@ var ts; function getContextualReturnType(functionDecl) { // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed - if (functionDecl.kind === 153 /* Constructor */ || + if (functionDecl.kind === 154 /* Constructor */ || ts.getEffectiveReturnTypeNode(functionDecl) || isGetAccessorWithAnnotatedSetAccessor(functionDecl)) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); @@ -38846,17 +39713,17 @@ var ts; // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); - var argIndex = ts.indexOf(args, arg); - if (argIndex >= 0) { - // If we're already in the process of resolving the given signature, don't resolve again as - // that could cause infinite recursion. Instead, return anySignature. - var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + // If we're already in the process of resolving the given signature, don't resolve again as + // that could cause infinite recursion. Instead, return anySignature. + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 184 /* TaggedTemplateExpression */) { + if (template.parent.kind === 187 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -38875,12 +39742,6 @@ var ts; case 53 /* AmpersandAmpersandToken */: case 26 /* CommaToken */: return node === right ? getContextualType(binaryExpression) : undefined; - case 34 /* EqualsEqualsEqualsToken */: - case 32 /* EqualsEqualsToken */: - case 35 /* ExclamationEqualsEqualsToken */: - case 33 /* ExclamationEqualsToken */: - // For completions after `x === ` - return node === operatorToken ? getTypeOfExpression(binaryExpression.left) : undefined; default: return undefined; } @@ -38909,10 +39770,10 @@ var ts; return mapType(type, function (t) { var prop = t.flags & 458752 /* StructuredType */ ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; - }); + }, /*noReductions*/ true); } function getIndexTypeOfContextualType(type, kind) { - return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, /*noReductions*/ true); } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { @@ -38962,50 +39823,33 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + function getContextualTypeForChildJsxExpression(node) { + var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); + // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; + } function getContextualTypeForJsxExpression(node) { - // JSX expression can appear in two position : JSX Element's children or JSX attribute - var jsxAttributes = ts.isJsxAttributeLike(node.parent) ? - node.parent.parent : - ts.isJsxElement(node.parent) ? - node.parent.openingElement.attributes : - undefined; // node.parent is JsxFragment with no attributes - if (!jsxAttributes) { - return undefined; // don't check children of a fragment - } - // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type - // which is a type of the parameter of the signature we are trying out. - // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName - var attributesType = getContextualType(jsxAttributes); - if (!attributesType || isTypeAny(attributesType)) { - return undefined; - } - if (ts.isJsxAttribute(node.parent)) { - // JSX expression is in JSX attribute - return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); - } - else if (node.parent.kind === 250 /* JsxElement */) { - // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; - } - else { - // JSX expression is in JSX spread attribute - return attributesType; - } + var exprParent = node.parent; + return ts.isJsxAttributeLike(exprParent) + ? getContextualType(node) + : ts.isJsxElement(exprParent) + ? getContextualTypeForChildJsxExpression(exprParent) + : undefined; } function getContextualTypeForJsxAttribute(attribute) { // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type // which is a type of the parameter of the signature we are trying out. // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName - var attributesType = getContextualType(attribute.parent); if (ts.isJsxAttribute(attribute)) { + var attributesType = getApparentTypeOfContextualType(attribute.parent); if (!attributesType || isTypeAny(attributesType)) { return undefined; } return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { - return attributesType; + return getContextualType(attribute.parent); } } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily @@ -39022,7 +39866,7 @@ var ts; var prop = _a[_i]; if (!prop.symbol) continue; - if (prop.kind !== 265 /* PropertyAssignment */) + if (prop.kind !== 268 /* PropertyAssignment */) continue; if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) { var discriminatingType = getTypeOfNode(prop.initializer); @@ -39070,63 +39914,53 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 180 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 188 /* ArrowFunction */: - case 220 /* ReturnStatement */: + case 191 /* ArrowFunction */: + case 223 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 183 /* NewExpression */: - if (node.kind === 94 /* NewKeyword */) { - return getContextualType(parent); - } - // falls through - case 182 /* CallExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent); - case 178 /* ArrayLiteralExpression */: { + case 181 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 206 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 197 /* TemplateExpression */); + case 209 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 200 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent); } - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - return getAttributesTypeFromJsxOpeningLikeElement(parent); - case 261 /* CaseClause */: { - if (node.kind === 73 /* CaseKeyword */) { - var switchStatement = parent.parent.parent; - return getTypeOfExpression(switchStatement.expression); - } - } + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return getContextualJsxElementAttributesType(parent); } return undefined; } @@ -39134,10 +39968,128 @@ var ts; node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); return node ? node.contextualMapper : identityMapper; } + function getContextualJsxElementAttributesType(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + var valueType = checkExpression(node.tagName); + if (isTypeAny(valueType)) { + // Short-circuit if the class tag is using an element type 'any' + return anyType; + } + var isJs = ts.isInJavaScriptFile(node); + return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + } + function getJsxSignaturesParameterTypes(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ false); + } + function getJsxSignaturesParameterTypesJs(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ true); + } + function getJsxSignaturesParameterTypesInternal(valueType, isJs) { + // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type + if (valueType.flags & 2 /* String */) { + return anyType; + } + else if (valueType.flags & 32 /* StringLiteral */) { + // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type + // For example: + // var CustomTag: "h1" = "h1"; + // Hello World + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + if (intrinsicElementsType !== unknownType) { + var stringLiteralTypeName = valueType.value; + var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); + if (intrinsicProp) { + return getTypeOfSymbol(intrinsicProp); + } + var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */); + if (indexSignatureType) { + return indexSignatureType; + } + } + return anyType; + } + // Resolve the signatures, preferring constructor + var signatures = getSignaturesOfType(valueType, 1 /* Construct */); + var ctor = true; + if (signatures.length === 0) { + // No construct signatures, try call signatures + signatures = getSignaturesOfType(valueType, 0 /* Call */); + ctor = false; + if (signatures.length === 0) { + // We found no signatures at all, which is an error + return unknownType; + } + } + return getUnionType(ts.map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), 0 /* None */); + } + function getJsxPropsTypeFromCallSignature(sig) { + var propsType = getTypeOfFirstParameterOfSignature(sig); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + propsType = intersectTypes(intrinsicAttribs, propsType); + } + return propsType; + } + function getJsxPropsTypeFromClassType(hostClassType, isJs) { + if (isTypeAny(hostClassType)) { + return hostClassType; + } + var propsName = getJsxElementPropertiesName(); + if (propsName === undefined) { + // There is no type ElementAttributesProperty, return 'any' + return anyType; + } + else if (propsName === "") { + // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead + return hostClassType; + } + else { + var attributesType = getTypeOfPropertyOfType(hostClassType, propsName); + if (!attributesType) { + // There is no property named 'props' on this instance type + return emptyObjectType; + } + else if (isTypeAny(attributesType)) { + // Props is of type 'any' or unknown + return attributesType; + } + else { + // Normal case -- add in IntrinsicClassElements and IntrinsicElements + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + apparentAttributesType = intersectTypes(typeParams + ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs)) + : intrinsicClassAttribs, apparentAttributesType); + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return apparentAttributesType; + } + } + } + function getJsxPropsTypeFromConstructSignatureJs(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ true); + } + function getJsxPropsTypeFromConstructSignature(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ false); + } + function getJsxPropsTypeFromConstructSignatureInternal(sig, isJs) { + var hostClassType = getReturnTypeOfSignature(sig); + if (hostClassType) { + return getJsxPropsTypeFromClassType(hostClassType, isJs); + } + return getJsxPropsTypeFromCallSignature(sig); + } // If the given type is an object or union type with a single signature, and if that signature has at // least as many parameters as the given function, return the signature. Otherwise return undefined. function getContextualCallSignature(type, node) { - var signatures = getSignaturesOfStructuredType(type, 0 /* Call */); + var signatures = getSignaturesOfType(type, 0 /* Call */); if (signatures.length === 1) { var signature = signatures[0]; if (!isAritySmaller(signature, node)) { @@ -39161,7 +40113,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 187 /* FunctionExpression */ || node.kind === 188 /* ArrowFunction */; + return node.kind === 190 /* FunctionExpression */ || node.kind === 191 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -39180,7 +40132,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -39190,8 +40142,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var current = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -39212,8 +40164,6 @@ var ts; var result; if (signatureList) { result = cloneSignature(signatureList[0]); - // Clear resolved return type we possibly got from cloneSignature - result.resolvedReturnType = undefined; result.unionSignatures = signatureList; } return result; @@ -39226,8 +40176,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); } function hasDefaultValue(node) { - return (node.kind === 177 /* BindingElement */ && !!node.initializer) || - (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); + return (node.kind === 180 /* BindingElement */ && !!node.initializer) || + (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); } function checkArrayLiteral(node, checkMode) { var elements = node.elements; @@ -39237,7 +40187,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); for (var index = 0; index < elements.length; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 199 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 202 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -39262,7 +40212,7 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 199 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 202 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -39276,7 +40226,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 176 /* ArrayBindingPattern */ || pattern.kind === 178 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 179 /* ArrayBindingPattern */ || pattern.kind === 181 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -39284,10 +40234,10 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 201 /* OmittedExpression */) { + if (patternElement.kind !== 204 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - elementTypes.push(unknownType); + elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); } } } @@ -39297,12 +40247,12 @@ var ts; } } return createArrayType(elementTypes.length ? - getUnionType(elementTypes, /*subtypeReduction*/ true) : + getUnionType(elementTypes, 2 /* Subtype */) : strictNullChecks ? implicitNeverType : undefinedWideningType); } function isNumericName(name) { switch (name.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return isNumericComputedName(name); case 71 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -39369,7 +40319,7 @@ var ts; propTypes.push(getTypeOfSymbol(properties[i])); } } - var unionType = propTypes.length ? getUnionType(propTypes, /*subtypeReduction*/ true) : undefinedType; + var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } function checkObjectLiteral(node, checkMode) { @@ -39379,10 +40329,10 @@ var ts; var propertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; - var propagatedFlags = 0; + var propagatedFlags = 8388608 /* FreshLiteral */; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 175 /* ObjectBindingPattern */ || contextualType.pattern.kind === 179 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 178 /* ObjectBindingPattern */ || contextualType.pattern.kind === 182 /* ObjectLiteralExpression */); var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; @@ -39394,16 +40344,16 @@ var ts; var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); var literalName = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */ || - memberDecl.kind === 266 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 268 /* PropertyAssignment */ || + memberDecl.kind === 269 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var jsdocType = void 0; if (isInJSFile) { jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl); } var type = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */) { - if (memberDecl.name.kind === 145 /* ComputedPropertyName */) { + if (memberDecl.kind === 268 /* PropertyAssignment */) { + if (memberDecl.name.kind === 146 /* ComputedPropertyName */) { var t = checkComputedPropertyName(memberDecl.name); if (t.flags & 224 /* Literal */) { literalName = ts.escapeLeadingUnderscores("" + t.value); @@ -39411,11 +40361,11 @@ var ts; } type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 152 /* MethodDeclaration */) { + else if (memberDecl.kind === 153 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 266 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 269 /* ShorthandPropertyAssignment */); type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -39430,8 +40380,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 265 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 266 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 268 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 269 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -39459,12 +40409,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 267 /* SpreadAssignment */) { + else if (memberDecl.kind === 270 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); propertiesArray = []; propertiesTable = ts.createSymbolTable(); hasComputedStringProperty = false; @@ -39476,7 +40426,7 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, node.symbol, propagatedFlags); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags, /*objectFlags*/ 0); offset = i + 1; continue; } @@ -39486,7 +40436,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 154 /* GetAccessor */ || memberDecl.kind === 155 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 155 /* GetAccessor */ || memberDecl.kind === 156 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (!literalName && hasNonBindableDynamicName(memberDecl)) { @@ -39518,7 +40468,7 @@ var ts; } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); } return spread; } @@ -39527,8 +40477,8 @@ var ts; var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 2097152 /* FreshLiteral */; - result.flags |= 8388608 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 29360128 /* PropagatingFlags */); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608 /* FreshLiteral */; + result.flags |= 33554432 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 117440512 /* PropagatingFlags */); result.objectFlags |= 128 /* ObjectLiteral */; if (patternWithComputedProperties) { result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; @@ -39537,24 +40487,24 @@ var ts; result.pattern = node; } if (!(result.flags & 12288 /* Nullable */)) { - propagatedFlags |= (result.flags & 29360128 /* PropagatingFlags */); + propagatedFlags |= (result.flags & 117440512 /* PropagatingFlags */); } return result; } } function isValidSpreadType(type) { - return !!(type.flags & (1 /* Any */ | 33554432 /* NonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 134217728 /* NonPrimitive */) || getFalsyFlags(type) & 14560 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 65536 /* Object */ && !isGenericMappedType(type) || type.flags & 393216 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } - function checkJsxSelfClosingElement(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node); + function checkJsxSelfClosingElement(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); return getJsxGlobalElementType() || anyType; } - function checkJsxElement(node) { + function checkJsxElement(node, checkMode) { // Check attributes - checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); + checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement, checkMode); // Perform resolution on the closing tag so that rename/go to definition/etc work if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) { getIntrinsicTagSymbol(node.closingElement); @@ -39564,8 +40514,8 @@ var ts; } return getJsxGlobalElementType() || anyType; } - function checkJsxFragment(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); + function checkJsxFragment(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); if (compilerOptions.jsx === 2 /* React */ && compilerOptions.jsxFactory) { error(node, ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); } @@ -39584,7 +40534,7 @@ var ts; function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment switch (tagName.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: return false; case 71 /* Identifier */: @@ -39593,6 +40543,11 @@ var ts; ts.Debug.fail(); } } + function checkJsxAttribute(node, checkMode) { + return node.initializer + ? checkExpressionForMutableLocation(node.initializer, checkMode) + : trueType; // is sugar for + } /** * Get attributes type of the JSX opening-like element. The result is from resolving "attributes" property of the opening-like element. * @@ -39602,22 +40557,19 @@ var ts; * @remarks Because this function calls getSpreadType, it needs to use the same checks as checkObjectLiteral, * which also calls getSpreadType. */ - function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) { var attributes = openingLikeElement.attributes; var attributesTable = ts.createSymbolTable(); var spread = emptyObjectType; - var attributesArray = []; var hasSpreadAnyType = false; var typeToIntersect; var explicitlySpecifyChildrenAttribute = false; - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { var attributeDecl = _a[_i]; var member = attributeDecl.symbol; if (ts.isJsxAttribute(attributeDecl)) { - var exprType = attributeDecl.initializer ? - checkExpression(attributeDecl.initializer, checkMode) : - trueType; // is sugar for + var exprType = checkJsxAttribute(attributeDecl, checkMode); var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; @@ -39627,24 +40579,22 @@ var ts; attributeSymbol.type = exprType; attributeSymbol.target = member; attributesTable.set(attributeSymbol.escapedName, attributeSymbol); - attributesArray.push(attributeSymbol); if (attributeDecl.name.escapedText === jsxChildrenPropertyName) { explicitlySpecifyChildrenAttribute = true; } } else { - ts.Debug.assert(attributeDecl.kind === 259 /* JsxSpreadAttribute */); - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); - attributesArray = []; + ts.Debug.assert(attributeDecl.kind === 262 /* JsxSpreadAttribute */); + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); attributesTable = ts.createSymbolTable(); } - var exprType = checkExpression(attributeDecl.expression); + var exprType = checkExpressionCached(attributeDecl.expression, checkMode); if (isTypeAny(exprType)) { hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*propagatedFlags*/ 0); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -39652,22 +40602,12 @@ var ts; } } if (!hasSpreadAnyType) { - if (spread !== emptyObjectType) { - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); - } - attributesArray = getPropertiesOfType(spread); - } - attributesTable = ts.createSymbolTable(); - for (var _b = 0, attributesArray_1 = attributesArray; _b < attributesArray_1.length; _b++) { - var attr = attributesArray_1[_b]; - if (!filter || filter(attr)) { - attributesTable.set(attr.escapedName, attr); - } + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 250 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 253 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -39678,29 +40618,29 @@ var ts; if (explicitlySpecifyChildrenAttribute) { error(attributes, ts.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName)); } - // If there are children in the body of JSX element, create dummy attribute "children" with anyType so that it will pass the attribute checking process + // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : - createArrayType(getUnionType(childrenTypes, /*subtypeReduction*/ false)); - attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol); + createArrayType(getUnionType(childrenTypes)); + var childPropMap = ts.createSymbolTable(); + childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); + spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } if (hasSpreadAnyType) { return anyType; } - var attributeType = createJsxAttributesType(attributes.symbol, attributesTable); - return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) : - typeToIntersect ? typeToIntersect : attributeType; + return typeToIntersect && spread !== emptyObjectType ? getIntersectionType([typeToIntersect, spread]) : (typeToIntersect || spread); /** * Create anonymous type from given attributes symbol table. * @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable * @param attributesTable a symbol table of attributes property */ - function createJsxAttributesType(symbol, attributesTable) { - var result = createAnonymousType(symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); - result.flags |= 67108864 /* JsxAttributes */ | 8388608 /* ContainsObjectLiteral */; - result.objectFlags |= 128 /* ObjectLiteral */; + function createJsxAttributesType() { + var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + result.flags |= 33554432 /* ContainsObjectLiteral */; + result.objectFlags |= 128 /* ObjectLiteral */ | 4096 /* JsxAttributes */; return result; } } @@ -39716,7 +40656,7 @@ var ts; } } else { - childrenTypes.push(checkExpression(child, checkMode)); + childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } } return childrenTypes; @@ -39727,7 +40667,7 @@ var ts; * @param node a JSXAttributes to be resolved of its type */ function checkJsxAttributes(node, checkMode) { - return createJsxAttributesTypeFromAttributesProperty(node.parent, /*filter*/ undefined, checkMode); + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } function getJsxType(name) { var jsxType = jsxTypes.get(name); @@ -39796,19 +40736,21 @@ var ts; return unknownType; } } + // Instantiate in context of source type var instantiatedSignatures = []; for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { var signature = signatures_3[_i]; if (signature.typeParameters) { var isJavascript = ts.isInJavaScriptFile(node); - var typeArguments = fillMissingTypeArguments(/*typeArguments*/ undefined, signature.typeParameters, /*minTypeArgumentCount*/ 0, isJavascript); + var inferenceContext = createInferenceContext(signature, /*flags*/ isJavascript ? 4 /* AnyDefault */ : 0 /* None */); + var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } else { instantiatedSignatures.push(signature); } } - return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -39853,7 +40795,7 @@ var ts; } return _jsxElementPropertiesName; } - function getJsxElementChildrenPropertyname() { + function getJsxElementChildrenPropertyName() { if (!_hasComputedJsxElementChildrenPropertyName) { _hasComputedJsxElementChildrenPropertyName = true; _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); @@ -39976,6 +40918,7 @@ var ts; * * @param openingLikeElement a non-intrinsic JSXOPeningLikeElement * @param shouldIncludeAllStatelessAttributesType a boolean indicating whether to include all attributes types from all stateless function signature + * @param sourceAttributesType Is the attributes type the user passed, and is used to create inferences in the target type if present * @param elementType an instance type of the given opening-like element. If undefined, the function will check type openinglikeElement's tagname. * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global (imported from react.d.ts) * @return attributes type if able to resolve the type of node @@ -39983,12 +40926,11 @@ var ts; * emptyObjectType if there is no "prop" in the element instance type */ function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 131072 /* Union */) { var types = elementType.types; return getUnionType(types.map(function (type) { return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); - }), /*subtypeReduction*/ true); + }), 2 /* Subtype */); } // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type if (elementType.flags & 2 /* String */) { @@ -40029,50 +40971,7 @@ var ts; if (elementClassType) { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - if (isTypeAny(elemInstanceType)) { - return elemInstanceType; - } - var propsName = getJsxElementPropertiesName(); - if (propsName === undefined) { - // There is no type ElementAttributesProperty, return 'any' - return anyType; - } - else if (propsName === "") { - // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead - return elemInstanceType; - } - else { - var attributesType = getTypeOfPropertyOfType(elemInstanceType, propsName); - if (!attributesType) { - // There is no property named 'props' on this instance type - return emptyObjectType; - } - else if (isTypeAny(attributesType) || (attributesType === unknownType)) { - // Props is of type 'any' or unknown - return attributesType; - } - else { - // Normal case -- add in IntrinsicClassElements and IntrinsicElements - var apparentAttributesType = attributesType; - var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); - if (intrinsicClassAttribs !== unknownType) { - var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); - if (typeParams) { - if (typeParams.length === 1) { - apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); - } - } - else { - apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); - } - } - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttribs !== unknownType) { - apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); - } - return apparentAttributesType; - } - } + return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement)); } /** * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. @@ -40103,13 +41002,7 @@ var ts; * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component */ function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { - var links = getNodeLinks(node); - var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; - if (!links[linkLocation]) { - var elemClassType = getJsxGlobalElementClassType(); - return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); - } - return links[linkLocation]; + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); } /** * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. @@ -40188,7 +41081,7 @@ var ts; } } } - function checkJsxOpeningLikeElementOrOpeningFragment(node) { + function checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode) { var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(node); if (isNodeOpeningLikeElement) { checkGrammarJsxElement(node); @@ -40203,14 +41096,14 @@ var ts; if (reactSym) { // Mark local symbol as referenced here because it might not have been marked // if jsx emit was not react as there wont be error being emitted - reactSym.isReferenced = true; + reactSym.isReferenced = 67108863 /* All */; // If react symbol is alias, mark it as refereced if (reactSym.flags & 2097152 /* Alias */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { markAliasSymbolAsReferenced(reactSym); } } if (isNodeOpeningLikeElement) { - checkJsxAttributesAssignableToTagNameAttributes(node); + checkJsxAttributesAssignableToTagNameAttributes(node, checkMode); } else { checkJsxChildren(node.parent); @@ -40256,37 +41149,40 @@ var ts; * Check assignablity between given attributes property, "source attributes", and the "target attributes" * @param openingLikeElement an opening-like JSX element to check its JSXAttributes */ - function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement, checkMode) { // The function involves following steps: // 1. Figure out expected attributes type by resolving tagName of the JSX opening-like element, targetAttributesType. // During these steps, we will try to resolve the tagName as intrinsic name, stateless function, stateful component (in the order) // 2. Solved JSX attributes type given by users, sourceAttributesType, which is by resolving "attributes" property of the JSX opening-like element. // 3. Check if the two are assignable to each other - // targetAttributesType is a type of an attributes from resolving tagName of an opening-like JSX element. + // targetAttributesType is a type of an attribute from resolving tagName of an opening-like JSX element. var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : getCustomJsxElementAttributesType(openingLikeElement, /*shouldIncludeAllStatelessAttributesType*/ false); // sourceAttributesType is a type of an attributes properties. // i.e
// attr1 and attr2 are treated as JSXAttributes attached in the JsxOpeningLikeElement as "attributes". - var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { - return isUnhyphenatedJsxName(attribute.escapedName) || !!(getPropertyOfType(targetAttributesType, attribute.escapedName)); - }); + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode); // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. - if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName())); } else { // Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties var isSourceAttributeTypeAssignableToTarget = checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); // After we check for assignability, we will do another pass to check that all explicitly specified attributes have correct name corresponding in targetAttributeType. - // This will allow excess properties in spread type as it is very common pattern to spread outter attributes into React component in its render method. + // This will allow excess properties in spread type as it is very common pattern to spread outer attributes into React component in its render method. if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) { for (var _i = 0, _a = openingLikeElement.attributes.properties; _i < _a.length; _i++) { var attribute = _a[_i]; - if (ts.isJsxAttribute(attribute) && !isKnownProperty(targetAttributesType, attribute.name.escapedText, /*isComparingJsxAttributes*/ true)) { - error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attribute.name), typeToString(targetAttributesType)); + if (!ts.isJsxAttribute(attribute)) { + continue; + } + var attrName = attribute.name; + var isNotIgnoredJsxProperty = (isUnhyphenatedJsxName(ts.idText(attrName)) || !!(getPropertyOfType(targetAttributesType, attrName.escapedText))); + if (isNotIgnoredJsxProperty && !isKnownProperty(targetAttributesType, attrName.escapedText, /*isComparingJsxAttributes*/ true)) { + error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attrName), typeToString(targetAttributesType)); // We break here so that errors won't be cascading break; } @@ -40309,7 +41205,7 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 150 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 151 /* PropertyDeclaration */; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; @@ -40327,7 +41223,7 @@ var ts; */ function checkPropertyAccessibility(node, left, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 180 /* PropertyAccessExpression */ || node.kind === 227 /* VariableDeclaration */ ? + var errorNode = node.kind === 183 /* PropertyAccessExpression */ || node.kind === 230 /* VariableDeclaration */ ? node.name : node.right; if (ts.getCheckFlags(prop) & 256 /* ContainsPrivate */) { @@ -40413,19 +41309,19 @@ var ts; function symbolHasNonMethodDeclaration(symbol) { return forEachProperty(symbol, function (prop) { var propKind = getDeclarationKindFromSymbol(prop); - return propKind !== 152 /* MethodDeclaration */ && propKind !== 151 /* MethodSignature */; + return propKind !== 153 /* MethodDeclaration */ && propKind !== 152 /* MethodSignature */; }); } - function checkNonNullExpression(node) { - return checkNonNullType(checkExpression(node), node); + function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { + return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic); } - function checkNonNullType(type, errorNode) { + function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 12288 /* Nullable */; if (kind) { - error(errorNode, kind & 4096 /* Undefined */ ? kind & 8192 /* Null */ ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); + error(node, kind & 4096 /* Undefined */ ? kind & 8192 /* Null */ ? + (nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) : + (undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) : + (nullDiagnostic || ts.Diagnostics.Object_is_possibly_null)); var t = getNonNullableType(type); return t.flags & (12288 /* Nullable */ | 16384 /* Never */) ? unknownType : t; } @@ -40439,15 +41335,20 @@ var ts; } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var propType; - var leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - var leftWasReferenced = leftSymbol && getSymbolLinks(leftSymbol).referenced; var leftType = checkNonNullExpression(left); + var parentSymbol = getNodeLinks(left).resolvedSymbol; var apparentType = getApparentType(getWidenedType(leftType)); if (isTypeAny(apparentType) || apparentType === silentNeverType) { + if (ts.isIdentifier(left) && parentSymbol) { + markAliasReferenced(parentSymbol, node); + } return apparentType; } var assignmentKind = ts.getAssignmentTargetKind(node); var prop = getPropertyOfType(apparentType, right.escapedText); + if (ts.isIdentifier(left) && parentSymbol && !(prop && isConstEnumOrConstEnumOnlyModule(prop))) { + markAliasReferenced(parentSymbol, node); + } if (!prop) { var indexInfo = getIndexInfoOfType(apparentType, 0 /* String */); if (!(indexInfo && indexInfo.type)) { @@ -40464,12 +41365,6 @@ var ts; else { checkPropertyNotUsedBeforeDeclaration(prop, node, right); markPropertyAsReferenced(prop, node, left.kind === 99 /* ThisKeyword */); - // Reset the referenced-ness of the LHS expression if this access refers to a const enum or const enum only module - leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - if (leftSymbol && !leftWasReferenced && getSymbolLinks(leftSymbol).referenced && - !(isNonLocalAlias(leftSymbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(prop))) { - getSymbolLinks(leftSymbol).referenced = undefined; - } getNodeLinks(node).resolvedSymbol = prop; checkPropertyAccessibility(node, left, apparentType, prop); if (assignmentKind) { @@ -40478,12 +41373,12 @@ var ts; return unknownType; } } - propType = getDeclaredOrApparentType(prop, node); + propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); } // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 180 /* PropertyAccessExpression */ || + if (node.kind !== 183 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 131072 /* Union */)) { return propType; @@ -40497,7 +41392,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 153 /* Constructor */ && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 154 /* Constructor */ && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -40520,8 +41415,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right)); } - else if (valueDeclaration.kind === 230 /* ClassDeclaration */ && - node.parent.kind !== 160 /* TypeReference */ && + else if (valueDeclaration.kind === 233 /* ClassDeclaration */ && + node.parent.kind !== 161 /* TypeReference */ && !(valueDeclaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right)); @@ -40530,9 +41425,9 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return true; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // We might be in `a = { b: this.b }`, so keep looking. See `tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts`. return false; default: @@ -40545,6 +41440,9 @@ var ts; * In that case we won't consider it used before its declaration, because it gets its value from the superclass' declaration. */ function isPropertyDeclaredInAncestorClass(prop) { + if (!(prop.parent.flags & 32 /* Class */)) { + return false; + } var classType = getTypeOfSymbol(prop.parent); while (true) { classType = getSuperClass(classType); @@ -40591,7 +41489,7 @@ var ts; } function getSuggestionForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -40696,57 +41594,53 @@ var ts; return res > max ? undefined : res; } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (prop && - noUnusedIdentifiers && - (prop.flags & 106500 /* ClassMember */) && - prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8 /* Private */) - && !(nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly))) { - if (isThisAccess) { - // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters). - var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); - if (containingMethod && containingMethod.symbol === prop) { - return; - } - } - if (ts.getCheckFlags(prop) & 1 /* Instantiated */) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; + if (!prop || !noUnusedIdentifiers || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + return; + } + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + return; + } + if (isThisAccess) { + // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters). + var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); + if (containingMethod && containingMethod.symbol === prop) { + return; } } + (ts.getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 180 /* PropertyAccessExpression */ - ? node.expression - : node.left; + var left = node.kind === 183 /* PropertyAccessExpression */ ? node.expression : node.left; return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left))); } + function isValidPropertyAccessForCompletions(node, type, property) { + return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) + && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); + } + function isValidMethodAccess(method, type) { + var propType = getTypeOfFuncClassEnumModule(method); + var signatures = getSignaturesOfType(getNonNullableType(propType), 0 /* Call */); + ts.Debug.assert(signatures.length !== 0); + return signatures.some(function (sig) { + var thisType = getThisTypeOfSignature(sig); + return !thisType || isTypeAssignableTo(type, thisType); + }); + } function isValidPropertyAccessWithType(node, left, propertyName, type) { - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(type, propertyName); - if (prop) { - return checkPropertyAccessibility(node, left, type, prop); - } - // In js files properties of unions are allowed in completion - if (ts.isInJavaScriptFile(left) && (type.flags & 131072 /* Union */)) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var elementType = _a[_i]; - if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) { - return true; - } - } - } - return false; + if (type === unknownType || isTypeAny(type)) { + return true; } - return true; + var prop = getPropertyOfType(type, propertyName); + return prop ? checkPropertyAccessibility(node, left, type, prop) + // In js files properties of unions are allowed in completion + : ts.isInJavaScriptFile(node) && (type.flags & 131072 /* Union */) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); }); } /** * Return the symbol of the for-in variable declared or referenced by the given for-in statement. */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer.kind === 231 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -40775,7 +41669,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 216 /* ForInStatement */ && + if (node.kind === 219 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -40793,7 +41687,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 183 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 186 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -40860,10 +41754,10 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 148 /* Decorator */) { + else if (node.kind !== 149 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -40929,7 +41823,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 199 /* SpreadElement */) { + if (arg && arg.kind === 202 /* SpreadElement */) { return i; } } @@ -40945,17 +41839,15 @@ var ts; // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". return true; } - if (node.kind === 184 /* TaggedTemplateExpression */) { - var tagExpression = node; + if (node.kind === 187 /* TaggedTemplateExpression */) { // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 197 /* TemplateExpression */) { + if (node.template.kind === 200 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + var lastSpan = ts.lastOrUndefined(node.template.templateSpans); ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -40963,26 +41855,25 @@ var ts; // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, // then this might actually turn out to be a TemplateHead in the future; // so we consider the call to be incomplete. - var templateLiteral = tagExpression.template; + var templateLiteral = node.template; ts.Debug.assert(templateLiteral.kind === 13 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); } else { - var callExpression = node; - if (!callExpression.arguments) { + if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 183 /* NewExpression */); + ts.Debug.assert(node.kind === 186 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; // If we are missing the close parenthesis, the call is incomplete. - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; + callIsIncomplete = node.arguments.end === node.end; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match @@ -41026,10 +41917,21 @@ var ts; inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); if (!contextualMapper) { - inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8 /* ReturnType */); + inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 4 /* ReturnType */); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJavaScriptFile(contextualSignature.declaration)); } + function inferJsxTypeArguments(signature, node, context) { + // Skip context sensitive pass + var skipContextParamType = getTypeAtPosition(signature, 0); + var checkAttrTypeSkipContextSensitive = checkExpressionWithContextualType(node.attributes, skipContextParamType, identityMapper); + inferTypes(context.inferences, checkAttrTypeSkipContextSensitive, skipContextParamType); + // Standard pass + var paramType = getTypeAtPosition(signature, 0); + var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context); + inferTypes(context.inferences, checkAttrType, paramType); + return getInferredTypes(context); + } function inferTypeArguments(node, signature, args, excludeArgument, context) { // Clear out all the inference results from the last time inferTypeArguments was called on this context for (var _i = 0, _a = context.inferences; _i < _a.length; _i++) { @@ -41046,7 +41948,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 148 /* Decorator */) { + if (node.kind !== 149 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the contextual mapper to avoid disturbing a resolution in progress for an @@ -41066,7 +41968,7 @@ var ts; instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); // Inferences made from return types have lower priority than all other inferences. - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8 /* ReturnType */); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 4 /* ReturnType */); } } var thisType = getThisTypeOfSignature(signature); @@ -41081,7 +41983,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -41122,7 +42024,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (!constraint) continue; - var errorInfo = reportErrors && headMessage && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + var errorInfo = reportErrors && headMessage && (function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }); var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1; if (!mapper) { mapper = createTypeMapper(typeParameters, typeArgumentTypes); @@ -41171,7 +42073,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 183 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 186 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -41188,7 +42090,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); // If the effective argument type is undefined, there is no synthetic type for the argument. @@ -41212,12 +42114,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 180 /* PropertyAccessExpression */) { + if (callee.kind === 183 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 181 /* ElementAccessExpression */) { + else if (callee.kind === 184 /* ElementAccessExpression */) { return callee.expression; } } @@ -41232,17 +42134,17 @@ var ts; * will be supplied from calls to `getEffectiveArgumentCount` and `getEffectiveArgumentType`. */ function getEffectiveCallArguments(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { var template = node.template; var args_4 = [undefined]; - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_4.push(span.expression); }); } return args_4; } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. @@ -41269,19 +42171,19 @@ var ts; * Otherwise, the argument count is the length of the 'args' array. */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -41291,7 +42193,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 147 /* Parameter */: + case 148 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -41315,25 +42217,25 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -41360,23 +42262,23 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } // For a non-constructor parameter decorator, the `propertyKey` will be either // a string or a symbol, based on the name of the parameter's containing method. } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -41388,7 +42290,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralType(element.name.text); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeAssignableToKind(nameType, 1536 /* ESSymbolLike */)) { return nameType; @@ -41414,21 +42316,21 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a parameter decorator - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 150 /* PropertyDeclaration */) { + if (node.kind === 151 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -41460,10 +42362,10 @@ var ts; // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -41475,8 +42377,8 @@ var ts; */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 148 /* Decorator */ || - (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */)) { + if (node.kind === 149 /* Decorator */ || + (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -41485,11 +42387,11 @@ var ts; * Gets the error node to use when reporting errors for an effective argument. */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -41498,8 +42400,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, fallbackError) { - var isTaggedTemplate = node.kind === 184 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 148 /* Decorator */; + var isTaggedTemplate = node.kind === 187 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 149 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { @@ -41573,7 +42475,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 182 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 185 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -41621,7 +42523,7 @@ var ts; max = Math.max(max, ts.length(sig.typeParameters)); } var paramCount = min < max ? min + "-" + max : min; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); + diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); } else if (args) { var min = Number.POSITIVE_INFINITY; @@ -41699,7 +42601,7 @@ var ts; } var candidate = void 0; var inferenceContext = originalCandidate.typeParameters ? - createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0) : + createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0 /* None */) : undefined; while (true) { candidate = originalCandidate; @@ -41731,7 +42633,7 @@ var ts; } excludeCount--; if (excludeCount > 0) { - excludeArgument[ts.indexOf(excludeArgument, /*value*/ true)] = false; + excludeArgument[excludeArgument.indexOf(/*value*/ true)] = false; } else { excludeArgument = undefined; @@ -41770,7 +42672,7 @@ var ts; } return resolveUntypedCall(node); } - var funcType = checkNonNullExpression(node.expression); + var funcType = checkNonNullExpression(node.expression, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined); if (funcType === silentNeverType) { return silentNeverSignature; } @@ -41804,7 +42706,7 @@ var ts; error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); } else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0 /* Call */); } return resolveErrorCall(node); } @@ -41885,7 +42787,7 @@ var ts; } return signature; } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + invocationError(node, expressionType, 1 /* Construct */); return resolveErrorCall(node); } function isConstructorAccessible(node, signature) { @@ -41925,6 +42827,26 @@ var ts; } return true; } + function invocationError(node, apparentType, kind) { + error(node, kind === 0 /* Call */ + ? ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures + : ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature, typeToString(apparentType)); + invocationErrorRecovery(apparentType, kind); + } + function invocationErrorRecovery(apparentType, kind) { + if (!apparentType.symbol) { + return; + } + var importNode = getSymbolLinks(apparentType.symbol).originatingImport; + // Create a diagnostic on the originating import if possible onto which we can attach a quickfix + // An import call expression cannot be rewritten into another form to correct the error - the only solution is to use `.default` at the use-site + if (importNode && !ts.isImportCall(importNode)) { + var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); + if (!sigs || !sigs.length) + return; + error(importNode, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime); + } + } function resolveTaggedTemplateExpression(node, candidatesOutArray) { var tagType = checkExpression(node.tag); var apparentType = getApparentType(tagType); @@ -41938,7 +42860,7 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0 /* Call */); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray); @@ -41948,16 +42870,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -41986,6 +42908,7 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); errorInfo = ts.chainDiagnosticMessages(errorInfo, headMessage); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, errorInfo)); + invocationErrorRecovery(apparentType, 0 /* Call */); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); @@ -42030,8 +42953,8 @@ var ts; if (elementType.flags & 131072 /* Union */) { var types = elementType.types; var result = void 0; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var type = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var type = types_16[_i]; result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); } return result; @@ -42044,16 +42967,16 @@ var ts; } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 148 /* Decorator */: + case 149 /* Decorator */: return resolveDecorator(node, candidatesOutArray); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: // This code-path is called by language service return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } @@ -42139,12 +43062,12 @@ var ts; if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; } - if (node.kind === 183 /* NewExpression */) { + if (node.kind === 186 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 153 /* Constructor */ && - declaration.kind !== 157 /* ConstructSignature */ && - declaration.kind !== 162 /* ConstructorType */ && + declaration.kind !== 154 /* Constructor */ && + declaration.kind !== 158 /* ConstructSignature */ && + declaration.kind !== 163 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -42215,16 +43138,18 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol)); } } return createPromiseReturnType(node, anyType); } - function getTypeWithSyntheticDefaultImportType(type, symbol) { + function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) { if (allowSyntheticDefaultImports && type && type !== unknownType) { var synthType = type; if (!synthType.syntheticType) { - if (!getPropertyOfType(type, "default" /* Default */)) { + var file = ts.find(originalSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, /*dontResolveAlias*/ false); + if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); newSymbol.target = resolveSymbol(symbol); @@ -42232,7 +43157,7 @@ var ts; var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); anonymousSymbol.type = defaultContainingObject; - synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*typeFLags*/ 0, /*objectFlags*/ 0) : defaultContainingObject; } else { synthType.syntheticType = type; @@ -42259,9 +43184,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 229 /* FunctionDeclaration */ + ? 232 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 227 /* VariableDeclaration */ + ? 230 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -42301,7 +43226,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return unknownType; } - else if (container.kind === 153 /* Constructor */) { + else if (container.kind === 154 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -42314,7 +43239,7 @@ var ts; var type = getTypeOfSymbol(symbol); if (strictNullChecks) { var declaration = symbol.valueDeclaration; - if (declaration && declaration.initializer) { + if (declaration && ts.hasInitializer(declaration)) { return getOptionalType(type); } } @@ -42423,13 +43348,12 @@ var ts; return promiseType; } function getReturnTypeFromBody(func, checkMode) { - var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 208 /* Block */) { + if (func.body.kind !== 211 /* Block */) { type = checkExpressionCached(func.body, checkMode); if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any @@ -42440,9 +43364,9 @@ var ts; } } else { - var types = void 0; + var types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (functionFlags & 1 /* Generator */) { - types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); if (!types || types.length === 0) { var iterableIteratorAny = functionFlags & 2 /* Async */ ? createAsyncIterableIteratorType(anyType) // AsyncGenerator function @@ -42454,7 +43378,6 @@ var ts; } } else { - types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { // For an async function, the return type will not be never, but rather a Promise for never. return functionFlags & 2 /* Async */ @@ -42469,8 +43392,9 @@ var ts; } } // Return a union of the return expression types. - type = getUnionType(types, /*subtypeReduction*/ true); + type = getUnionType(types, 2 /* Subtype */); } + var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!contextualSignature) { reportErrorsFromWidening(func, type); } @@ -42547,11 +43471,12 @@ var ts; if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 222 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 225 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { return false; } return true; } + /** NOTE: Return value of `[]` means a different thing than `undefined`. `[]` means return `void`, `undefined` means return `never`. */ function checkAndAggregateReturnExpressionTypes(func, checkMode) { var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; @@ -42577,8 +43502,7 @@ var ts; hasReturnWithNoExpression = true; } }); - if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */)) { + if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -42586,6 +43510,17 @@ var ts; } return aggregatedTypes; } + function mayReturnNever(func) { + switch (func.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + return true; + case 153 /* MethodDeclaration */: + return func.parent.kind === 182 /* ObjectLiteralExpression */; + default: + return false; + } + } /** * TypeScript Specification 1.0 (6.3) - July 2014 * An explicitly typed function whose return type isn't the Void type, @@ -42605,7 +43540,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 208 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 152 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 211 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -42638,7 +43573,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); @@ -42646,7 +43581,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 187 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 190 /* FunctionExpression */) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -42681,7 +43616,7 @@ var ts; checkNodeDeferred(node); } } - if (produceDiagnostics && node.kind !== 152 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 153 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithCapturedNewTargetVariable(node, node.name); @@ -42689,7 +43624,7 @@ var ts; return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); var returnOrPromisedType = returnTypeNode && @@ -42709,7 +43644,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 208 /* Block */) { + if (node.body.kind === 211 /* Block */) { checkSourceElement(node.body); } else { @@ -42756,11 +43691,11 @@ var ts; if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) && + (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) && expr.expression.kind === 99 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 153 /* Constructor */)) { + if (!(func && func.kind === 154 /* Constructor */)) { return true; } // If func.parent is a class and symbol is a (readonly) property of that class, or @@ -42773,13 +43708,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); if (node.kind === 71 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 241 /* NamespaceImport */; + return declaration && declaration.kind === 244 /* NamespaceImport */; } } } @@ -42788,7 +43723,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); - if (node.kind !== 71 /* Identifier */ && node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 71 /* Identifier */ && node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -42797,7 +43732,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 180 /* PropertyAccessExpression */ && expr.kind !== 181 /* ElementAccessExpression */) { + if (expr.kind !== 183 /* PropertyAccessExpression */ && expr.kind !== 184 /* ElementAccessExpression */) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -42882,13 +43817,13 @@ var ts; // Return true if type might be of the given kind. A union or intersection type might be of a given // kind if at least one constituent type is of the given kind. function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { + if (type.flags & kind || kind & 536870912 /* GenericMappedType */ && isGenericMappedType(type)) { return true; } if (type.flags & 393216 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var t = types_17[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -42911,7 +43846,7 @@ var ts; (kind & 8192 /* Null */ && isTypeAssignableTo(source, nullType)) || (kind & 4096 /* Undefined */ && isTypeAssignableTo(source, undefinedType)) || (kind & 512 /* ESSymbol */ && isTypeAssignableTo(source, esSymbolType)) || - (kind & 33554432 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); + (kind & 134217728 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); } function allTypesAssignableToKind(source, kind, strict) { return source.flags & 131072 /* Union */ ? @@ -42956,13 +43891,16 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 /* NumberLike */ | 1536 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; + if (strictNullChecks && properties.length === 0) { + return checkNonNullType(sourceType, node); + } for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); @@ -42971,9 +43909,9 @@ var ts; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 265 /* PropertyAssignment */ || property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */ || property.kind === 269 /* ShorthandPropertyAssignment */) { var name = property.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { @@ -42986,7 +43924,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 269 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -42998,7 +43936,7 @@ var ts; error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 267 /* SpreadAssignment */) { + else if (property.kind === 270 /* SpreadAssignment */) { if (languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(property, 4 /* Rest */); } @@ -43032,8 +43970,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 201 /* OmittedExpression */) { - if (element.kind !== 199 /* SpreadElement */) { + if (element.kind !== 204 /* OmittedExpression */) { + if (element.kind !== 202 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -43061,7 +43999,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 195 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { + if (restExpression.kind === 198 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -43074,7 +44012,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 266 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 269 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -43090,21 +44028,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 195 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { + if (target.kind === 198 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 179 /* ObjectLiteralExpression */) { + if (target.kind === 182 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 178 /* ArrayLiteralExpression */) { + if (target.kind === 181 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 267 /* SpreadAssignment */ ? + var error = target.parent.kind === 270 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -43126,35 +44064,35 @@ var ts; case 71 /* Identifier */: case 9 /* StringLiteral */: case 12 /* RegularExpressionLiteral */: - case 184 /* TaggedTemplateExpression */: - case 197 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: - case 139 /* UndefinedKeyword */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 190 /* TypeOfExpression */: - case 204 /* NonNullExpression */: - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: + case 140 /* UndefinedKeyword */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 193 /* TypeOfExpression */: + case 207 /* NonNullExpression */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: return true; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -43166,9 +44104,9 @@ var ts; } return false; // Some forms listed here for clarity - case 191 /* VoidExpression */: // Explicit opt-out - case 185 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 203 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 194 /* VoidExpression */: // Explicit opt-out + case 188 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 206 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -43181,7 +44119,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 58 /* EqualsToken */ && (left.kind === 179 /* ObjectLiteralExpression */ || left.kind === 178 /* ArrayLiteralExpression */)) { + if (operator === 58 /* EqualsToken */ && (left.kind === 182 /* ObjectLiteralExpression */ || left.kind === 181 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } var leftType = checkExpression(left, checkMode); @@ -43303,7 +44241,7 @@ var ts; leftType; case 54 /* BarBarToken */: return getTypeFacts(leftType) & 2097152 /* Falsy */ ? - getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], /*subtypeReduction*/ true) : + getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) : leftType; case 58 /* EqualsToken */: checkAssignmentOperator(rightType); @@ -43439,7 +44377,7 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, checkMode); var type2 = checkExpression(node.whenFalse, checkMode); - return getUnionType([type1, type2], /*subtypeReduction*/ true); + return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { // We just want to check each expressions, but we are unconcerned with @@ -43452,21 +44390,31 @@ var ts; }); return stringType; } + function getContextNode(node) { + if (node.kind === 261 /* JsxAttributes */) { + return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) + } + return node; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - var saveContextualMapper = node.contextualMapper; - node.contextualType = contextualType; - node.contextualMapper = contextualMapper; + var context = getContextNode(node); + var saveContextualType = context.contextualType; + var saveContextualMapper = context.contextualMapper; + context.contextualType = contextualType; + context.contextualMapper = contextualMapper; var checkMode = contextualMapper === identityMapper ? 1 /* SkipContextSensitive */ : - contextualMapper ? 2 /* Inferential */ : 0 /* Normal */; + contextualMapper ? 2 /* Inferential */ : 3 /* Contextual */; var result = checkExpression(node, checkMode); - node.contextualType = saveContextualType; - node.contextualMapper = saveContextualMapper; + context.contextualType = saveContextualType; + context.contextualMapper = saveContextualMapper; return result; } function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { + if (checkMode) { + return checkExpression(node, checkMode); + } // When computing a type that we're going to cache, we need to ignore any ongoing control flow // analysis because variables may have transient types in indeterminable states. Moving flowLoopStart // to the top of the stack ensures all transient types are computed from a known point. @@ -43479,7 +44427,7 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 185 /* TypeAssertionExpression */ || node.kind === 203 /* AsExpression */; + return node.kind === 188 /* TypeAssertionExpression */ || node.kind === 206 /* AsExpression */; } function checkDeclarationInitializer(declaration) { var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); @@ -43489,16 +44437,11 @@ var ts; } function isLiteralOfContextualType(candidateType, contextualType) { if (contextualType) { - if (contextualType.flags & 131072 /* Union */ && !(contextualType.flags & 8 /* Boolean */)) { - // If the contextual type is a union containing both of the 'true' and 'false' types we - // don't consider it a literal context for boolean literals. - var types_19 = contextualType.types; - return ts.some(types_19, function (t) { - return !(t.flags & 128 /* BooleanLiteral */ && containsType(types_19, trueType) && containsType(types_19, falseType)) && - isLiteralOfContextualType(candidateType, t); - }); + if (contextualType.flags & 393216 /* UnionOrIntersection */) { + var types = contextualType.types; + return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 1081344 /* TypeVariable */) { + if (contextualType.flags & 7372800 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -43530,7 +44473,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -43541,7 +44484,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -43571,7 +44514,7 @@ var ts; function getTypeOfExpression(node, cache) { // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (node.kind === 182 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { + if (node.kind === 185 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -43606,7 +44549,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpression(node, checkMode) { var type; - if (node.kind === 144 /* QualifiedName */) { + if (node.kind === 145 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -43618,11 +44561,12 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 181 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 164 /* TypeQuery */ && node.parent.exprName === node)); if (!ok) { - error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } } return type; @@ -43654,74 +44598,74 @@ var ts; return trueType; case 86 /* FalseKeyword */: return falseType; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return checkTemplateExpression(node); case 12 /* RegularExpressionLiteral */: return globalRegExpType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (node.expression.kind === 91 /* ImportKeyword */) { return checkImportCallExpression(node); } /* falls through */ - case 183 /* NewExpression */: + case 186 /* NewExpression */: return checkCallExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return checkClassExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return checkAssertion(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return checkNonNullAssertion(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return checkMetaProperty(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkDeleteExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return checkVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return checkAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return undefinedWideningType; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return checkYieldExpression(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 250 /* JsxElement */: - return checkJsxElement(node); - case 251 /* JsxSelfClosingElement */: - return checkJsxSelfClosingElement(node); - case 254 /* JsxFragment */: - return checkJsxFragment(node); - case 258 /* JsxAttributes */: + case 253 /* JsxElement */: + return checkJsxElement(node, checkMode); + case 254 /* JsxSelfClosingElement */: + return checkJsxSelfClosingElement(node, checkMode); + case 257 /* JsxFragment */: + return checkJsxFragment(node, checkMode); + case 261 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -43759,7 +44703,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 153 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 154 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -43767,10 +44711,10 @@ var ts; error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && ts.isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { - if (ts.indexOf(func.parameters, node) !== 0) { + if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 153 /* Constructor */ || func.kind === 157 /* ConstructSignature */ || func.kind === 162 /* ConstructorType */) { + if (func.kind === 154 /* Constructor */ || func.kind === 158 /* ConstructSignature */ || func.kind === 163 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -43798,7 +44742,7 @@ var ts; error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); return; } - var typePredicate = getSignatureFromDeclaration(parent).typePredicate; + var typePredicate = getTypePredicateOfSignature(getSignatureFromDeclaration(parent)); if (!typePredicate) { return; } @@ -43813,7 +44757,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); }; checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, /*headMessage*/ undefined, leadingError); } @@ -43836,13 +44780,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 188 /* ArrowFunction */: - case 156 /* CallSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 161 /* FunctionType */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 191 /* ArrowFunction */: + case 157 /* CallSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 162 /* FunctionType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -43860,7 +44804,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 176 /* ArrayBindingPattern */ || name.kind === 175 /* ObjectBindingPattern */) { + else if (name.kind === 179 /* ArrayBindingPattern */ || name.kind === 178 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -43869,12 +44813,12 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 161 /* FunctionType */ || node.kind === 229 /* FunctionDeclaration */ || node.kind === 162 /* ConstructorType */ || - node.kind === 156 /* CallSignature */ || node.kind === 153 /* Constructor */ || - node.kind === 157 /* ConstructSignature */) { + else if (node.kind === 162 /* FunctionType */ || node.kind === 232 /* FunctionDeclaration */ || node.kind === 163 /* ConstructorType */ || + node.kind === 157 /* CallSignature */ || node.kind === 154 /* Constructor */ || + node.kind === 158 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -43904,10 +44848,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -43954,7 +44898,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -43968,16 +44912,16 @@ var ts; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: addName(names, member.name, memberName, 4 /* Method */); break; } @@ -44040,7 +44984,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* PropertySignature */) { + if (member.kind === 150 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: @@ -44064,7 +45008,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 231 /* InterfaceDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -44084,7 +45028,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -44092,7 +45036,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -44119,7 +45063,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 153 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -44144,24 +45088,8 @@ var ts; if (!produceDiagnostics) { return; } - function containsSuperCallAsComputedPropertyName(n) { - var name = ts.getNameOfDeclaration(n); - return name && containsSuperCall(name); - } - function containsSuperCall(n) { - if (ts.isSuperCall(n)) { - return true; - } - else if (ts.isFunctionLike(n)) { - return false; - } - else if (ts.isClassLike(n)) { - return ts.forEach(n.members, containsSuperCallAsComputedPropertyName); - } - return ts.forEachChild(n, containsSuperCall); - } function isInstancePropertyWithInitializer(n) { - return n.kind === 150 /* PropertyDeclaration */ && + return n.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -44191,7 +45119,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -44216,7 +45144,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { if (!(node.flags & 2097152 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -44226,13 +45154,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = node.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -44250,7 +45178,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -44267,8 +45195,10 @@ var ts; function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { - var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJavaScriptFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { var typeArguments; var mapper; var result = true; @@ -44276,18 +45206,28 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, ts.isInJavaScriptFile(typeArgumentNodes[i])); + typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(typeArgument, instantiateType(constraint, mapper), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; } + function getTypeParametersForTypeReference(node) { + var type = getTypeFromTypeReference(node); + if (type !== unknownType) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || + (ts.getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : undefined); + } + } + return undefined; + } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 160 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 161 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); @@ -44296,22 +45236,10 @@ var ts; // Do type argument local checks only if referenced type is successfully resolved ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (!symbol) { - // There is no resolved symbol cached if the type resolved to a builtin - // via JSDoc type reference resolution (eg, Boolean became boolean), none - // of which are generic when they have no associated symbol - // (additionally, JSDoc's index signature syntax, Object actually uses generic syntax without being generic) - if (!ts.isJSDocIndexSignature(node)) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - } - return; + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); } - var typeParameters = symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters; - if (!typeParameters && ts.getObjectFlags(type) & 4 /* Reference */) { - typeParameters = type.target.localTypeParameters; - } - checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } if (type.flags & 16 /* Enum */ && getNodeLinks(node).resolvedSymbol.flags & 8 /* EnumMember */) { @@ -44319,6 +45247,14 @@ var ts; } } } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType); + if (!typeReferenceNode) + return undefined; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } function checkTypeQuery(node) { getTypeFromTypeQueryNode(node); } @@ -44353,8 +45289,8 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { - if (accessNode.kind === 181 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && - ts.getObjectFlags(objectType) & 32 /* Mapped */ && objectType.declaration.readonlyToken) { + if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -44375,6 +45311,9 @@ var ts; function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); + if (noImplicitAny && !node.type) { + reportImplicitAnyError(node, anyType); + } var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); @@ -44383,6 +45322,15 @@ var ts; checkGrammarTypeOperatorNode(node); checkSourceElement(node.type); } + function checkConditionalType(node) { + ts.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 /* ConditionalType */ && n.parent.extendsType === n; })) { + grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + } function isPrivateWithinAmbient(node) { return ts.hasModifier(node, 8 /* Private */) && !!(node.flags & 2097152 /* Ambient */); } @@ -44390,9 +45338,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 231 /* InterfaceDeclaration */ && - n.parent.kind !== 230 /* ClassDeclaration */ && - n.parent.kind !== 200 /* ClassExpression */ && + if (n.parent.kind !== 234 /* InterfaceDeclaration */ && + n.parent.kind !== 233 /* ClassDeclaration */ && + n.parent.kind !== 203 /* ClassExpression */ && n.flags & 2097152 /* Ambient */) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -44483,7 +45431,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */) && + var reportError = (node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -44522,7 +45470,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 2097152 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 231 /* InterfaceDeclaration */ || node.parent.kind === 164 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 234 /* InterfaceDeclaration */ || node.parent.kind === 165 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -44533,7 +45481,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 229 /* FunctionDeclaration */ || node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */ || node.kind === 153 /* Constructor */) { + if (node.kind === 232 /* FunctionDeclaration */ || node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */ || node.kind === 154 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -44661,33 +45609,35 @@ var ts; })(DeclarationSpaces || (DeclarationSpaces = {})); function getDeclarationSpaces(d) { switch (d.kind) { - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: // A jsdoc typedef is, by definition, a type alias - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return 2 /* ExportType */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: return 2 /* ExportType */ | 1 /* ExportValue */; + case 272 /* SourceFile */: + return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; // The below options all declare an Alias, which is allowed to merge with other values within the importing module - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: var result_2 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); }); return result_2; - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 229 /* FunctionDeclaration */: - case 243 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 232 /* FunctionDeclaration */: + case 246 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 return 1 /* ExportValue */; default: - ts.Debug.fail(ts.SyntaxKind[d.kind]); + ts.Debug.fail(ts.Debug.showSyntaxKind(d)); } } } @@ -44742,7 +45692,7 @@ var ts; } return undefined; } - return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2 /* Subtype */); } /** * Gets the "awaited type" of a type. @@ -44775,7 +45725,7 @@ var ts; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -44954,28 +45904,28 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 147 /* Parameter */: + case 148 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); break; } - checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo); + checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; }); } /** * If a TypeNode can be resolved to a value symbol imported from an external module, it is @@ -45013,18 +45963,18 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: var commonEntityName = void 0; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -45050,9 +46000,9 @@ var ts; } } return commonEntityName; - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; } } @@ -45076,14 +46026,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -45092,19 +46042,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 147 /* Parameter */: + case 148 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -45136,7 +46086,7 @@ var ts; function checkJSDocParameterTag(node) { checkSourceElement(node.typeExpression); if (!ts.getParameterSymbolFromJSDoc(node)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 144 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 /* QualifiedName */ ? node.name.right : node.name)); } } function checkJSDocAugmentsTag(node) { @@ -45145,7 +46095,7 @@ var ts; error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName)); return; } - var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 282 /* JSDocAugmentsTag */); + var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 285 /* JSDocAugmentsTag */); ts.Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); @@ -45163,7 +46113,7 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -45176,7 +46126,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -45205,7 +46155,8 @@ var ts; } } } - checkSourceElement(node.body); + var body = node.kind === 152 /* MethodSignature */ ? undefined : node.body; + checkSourceElement(body); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if ((functionFlags & 1 /* Generator */) === 0) { var returnOrPromisedType = returnTypeNode && (functionFlags & 2 /* Async */ @@ -45216,10 +46167,10 @@ var ts; if (produceDiagnostics && !returnTypeNode) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -45238,43 +46189,43 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 269 /* SourceFile */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 237 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 232 /* TypeAliasDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 235 /* TypeAliasDeclaration */: checkUnusedTypeParameters(node); break; default: @@ -45286,8 +46237,10 @@ var ts; function checkUnusedLocalsAndParameters(node) { if (noUnusedIdentifiers && !(node.flags & 2097152 /* Ambient */)) { node.locals.forEach(function (local) { - if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 147 /* Parameter */) { + // If it's purely a type parameter, ignore, will be checked in `checkUnusedTypeParameters`. + // If it's a type parameter merged with a parameter, check if the parameter-side is used. + if (local.flags & 262144 /* TypeParameter */ ? (local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : !local.isReferenced) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 148 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && @@ -45315,8 +46268,8 @@ var ts; var node = ts.getNameOfDeclaration(declaration) || declaration; if (isIdentifierThatStartsWithUnderScore(node)) { var declaration_2 = ts.getRootDeclaration(node.parent); - if ((declaration_2.kind === 227 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || - declaration_2.kind === 146 /* TypeParameter */) { + if ((declaration_2.kind === 230 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || + declaration_2.kind === 147 /* TypeParameter */) { return; } } @@ -45332,28 +46285,42 @@ var ts; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { - if (node.members) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - if (member.kind === 152 /* MethodDeclaration */ || member.kind === 150 /* PropertyDeclaration */) { - if (!member.symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(member.symbol)); + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 153 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + if (member.kind === 156 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. + break; } - } - else if (member.kind === 153 /* Constructor */) { + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)); + } + break; + case 154 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol)); } } - } + break; + case 159 /* IndexSignature */: + case 210 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } } function checkUnusedTypeParameters(node) { - if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { + if (compilerOptions.noUnusedParameters && !(node.flags & 2097152 /* Ambient */)) { if (node.typeParameters) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. @@ -45364,7 +46331,7 @@ var ts; } for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) { var typeParameter = _a[_i]; - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & 262144 /* TypeParameter */) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(typeParameter.symbol)); } } @@ -45387,7 +46354,7 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 208 /* Block */) { + if (node.kind === 211 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -45417,12 +46384,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 151 /* MethodSignature */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 152 /* MethodSignature */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -45431,7 +46398,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 147 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 148 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -45510,7 +46477,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -45525,7 +46492,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -45560,7 +46527,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 227 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 230 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -45572,17 +46539,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 228 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 209 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 231 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 212 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 208 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 235 /* ModuleBlock */ || - container.kind === 234 /* ModuleDeclaration */ || - container.kind === 269 /* SourceFile */); + (container.kind === 211 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 238 /* ModuleBlock */ || + container.kind === 237 /* ModuleDeclaration */ || + container.kind === 272 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -45597,7 +46564,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 147 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 148 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -45608,7 +46575,7 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 180 /* PropertyAccessExpression */) { + if (n.kind === 183 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } @@ -45627,8 +46594,8 @@ var ts; // so we need to do a bit of extra work to check if reference is legal var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 147 /* Parameter */ || - symbol.valueDeclaration.kind === 177 /* BindingElement */) { + if (symbol.valueDeclaration.kind === 148 /* Parameter */ || + symbol.valueDeclaration.kind === 180 /* BindingElement */) { // it is ok to reference parameter in initializer if either // - parameter is located strictly on the left of current parameter declaration if (symbol.valueDeclaration.pos < node.pos) { @@ -45642,7 +46609,7 @@ var ts; return ts.isFunctionLike(current.parent) || // computed property names/initializers in instance property declaration of class like entities // are executed in constructor and thus deferred - (current.parent.kind === 150 /* PropertyDeclaration */ && + (current.parent.kind === 151 /* PropertyDeclaration */ && !(ts.hasModifier(current.parent, 32 /* Static */)) && ts.isClassLike(current.parent.parent)); })) { @@ -45664,7 +46631,9 @@ var ts; // Check variable, parameter, or property declaration function checkVariableLikeDeclaration(node) { checkDecorators(node); - checkSourceElement(node.type); + if (!ts.isBindingElement(node)) { + checkSourceElement(node.type); + } // JSDoc `function(string, string): string` syntax results in parameters with no name if (!node.name) { return; @@ -45673,57 +46642,65 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 177 /* BindingElement */) { - if (node.parent.kind === 175 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { + if (node.kind === 180 /* BindingElement */) { + if (node.parent.kind === 178 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 145 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (!ts.isBindingPattern(name)) { + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 176 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 179 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 147 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 148 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { + var initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && node.name.elements.length === 0) { + checkNonNullType(initializerType, node); + } + else { + checkTypeAssignableTo(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); + } checkParameterInitializer(node); } return; } var symbol = getSymbolOfNode(node); - var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); + var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -45745,10 +46722,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */) { + if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */) { + if (node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -45760,14 +46737,14 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 150 /* PropertyDeclaration */ || nextDeclaration.kind === 149 /* PropertySignature */ + var message = nextDeclaration.kind === 151 /* PropertyDeclaration */ || nextDeclaration.kind === 150 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 147 /* Parameter */ && right.kind === 227 /* VariableDeclaration */) || - (left.kind === 227 /* VariableDeclaration */ && right.kind === 147 /* Parameter */)) { + if ((left.kind === 148 /* Parameter */ && right.kind === 230 /* VariableDeclaration */) || + (left.kind === 230 /* VariableDeclaration */ && right.kind === 148 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -45796,19 +46773,6 @@ var ts; checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (ts.getFunctionFlags(node) & 2 /* Async */) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } function checkExpressionStatement(node) { // Grammar checking checkGrammarStatementInAmbientContext(node); @@ -45819,7 +46783,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 210 /* EmptyStatement */) { + if (node.thenStatement.kind === 213 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -45839,12 +46803,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 231 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -45862,7 +46826,7 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 6 /* ESNext */) { @@ -45880,14 +46844,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -45914,12 +46878,12 @@ var ts; // Grammar checking checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - // TypeScript 1.0 spec (April 2014): 5.4 + // TypeScript 1.0 spec (April 2014): 5.4 // In a 'for-in' statement of the form // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -45933,7 +46897,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -45946,7 +46910,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -46003,7 +46967,7 @@ var ts; var arrayTypes = inputType.types; var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 524322 /* StringLike */); }); if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); + arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } else if (arrayType.flags & 524322 /* StringLike */) { @@ -46048,7 +47012,7 @@ var ts; if (arrayElementType.flags & 524322 /* StringLike */) { return stringType; } - return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } return arrayElementType; } @@ -46135,7 +47099,7 @@ var ts; } return undefined; } - var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), 2 /* Subtype */); var iteratedType = getIteratedTypeOfIterator(returnType, errorNode, /*isAsyncIterator*/ !!asyncMethodType); if (checkAssignability && errorNode && iteratedType) { // If `checkAssignability` was specified, we were called from @@ -46203,7 +47167,7 @@ var ts; } return undefined; } - var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), 2 /* Subtype */); if (isTypeAny(nextResult)) { return undefined; } @@ -46247,8 +47211,8 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return node.kind === 154 /* GetAccessor */ - && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 155 /* SetAccessor */)) !== undefined; + return node.kind === 155 /* GetAccessor */ + && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156 /* SetAccessor */)) !== undefined; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncGenerator */) === 2 /* Async */ @@ -46258,56 +47222,56 @@ var ts; } function checkReturnStatement(node) { // Grammar checking - if (!checkGrammarStatementInAmbientContext(node)) { - var functionBlock = ts.getContainingFunction(node); - if (!functionBlock) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } + if (checkGrammarStatementInAmbientContext(node)) { + return; } var func = ts.getContainingFunction(node); - if (func) { - var signature = getSignatureFromDeclaration(func); - var returnType = getReturnTypeOfSignature(signature); - var functionFlags = ts.getFunctionFlags(func); - if (functionFlags & 1 /* Generator */) { + if (!func) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + return; + } + var signature = getSignatureFromDeclaration(func); + var returnType = getReturnTypeOfSignature(signature); + var functionFlags = ts.getFunctionFlags(func); + var isGenerator = functionFlags & 1 /* Generator */; + if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { + var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; + if (isGenerator) { // A generator does not need its return expressions checked against its return type. // Instead, the yield expressions are checked against the element type. - // TODO: Check return expressions of generators when return type tracking is added + // TODO: Check return types of generators when return type tracking is added // for generators. return; } - if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { - var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 155 /* SetAccessor */) { - if (node.expression) { - error(node, ts.Diagnostics.Setters_cannot_return_a_value); - } - } - else if (func.kind === 153 /* Constructor */) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { - error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (functionFlags & 2 /* Async */) { - var promisedType = getPromisedTypeOfPromise(returnType); - var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - if (promisedType) { - // If the function has a return type, but promisedType is - // undefined, an error will be reported in checkAsyncFunctionReturnType - // so we don't need to report one here. - checkTypeAssignableTo(awaitedType, promisedType, node); - } - } - else { - checkTypeAssignableTo(exprType, returnType, node); - } + else if (func.kind === 156 /* SetAccessor */) { + if (node.expression) { + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind !== 153 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { - // The function has a return type, but the return statement doesn't have an expression. - error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); + else if (func.kind === 154 /* Constructor */) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } } + else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { + if (functionFlags & 2 /* Async */) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + if (promisedType) { + // If the function has a return type, but promisedType is + // undefined, an error will be reported in checkAsyncFunctionReturnType + // so we don't need to report one here. + checkTypeAssignableTo(awaitedType, promisedType, node); + } + } + else { + checkTypeAssignableTo(exprType, returnType, node); + } + } + } + else if (func.kind !== 154 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + // The function has a return type, but the return statement doesn't have an expression. + error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } function checkWithStatement(node) { @@ -46334,7 +47298,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 262 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 265 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -46346,12 +47310,11 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 261 /* CaseClause */) { - var caseClause = clause; + if (produceDiagnostics && clause.kind === 264 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. - var caseType = checkExpression(caseClause.expression); + var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -46360,7 +47323,7 @@ var ts; } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { // expressionType is not comparable to caseType, try the reversed check and report errors if it fails - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, /*headMessage*/ undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, /*headMessage*/ undefined); } } ts.forEach(clause.statements, checkSourceElement); @@ -46376,7 +47339,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 223 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 226 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); return true; @@ -46469,7 +47432,8 @@ var ts; error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); } function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) { - if (!indexType) { + // ESSymbol properties apply to neither string nor numeric indexers. + if (!indexType || ts.isKnownSymbol(prop)) { return; } var propDeclaration = prop.valueDeclaration; @@ -46481,8 +47445,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && - (propDeclaration.kind === 195 /* BinaryExpression */ || - ts.getNameOfDeclaration(propDeclaration).kind === 145 /* ComputedPropertyName */ || + (propDeclaration.kind === 198 /* BinaryExpression */ || + ts.getNameOfDeclaration(propDeclaration).kind === 146 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -46588,9 +47552,11 @@ var ts; // type parameter at this position, we report an error. var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); var targetConstraint = getConstraintFromTypeParameter(target); - if ((sourceConstraint || targetConstraint) && - (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { - return false; + if (sourceConstraint) { + // relax check if later interface augmentation has no constraint + if (!targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } } // If the type parameter node has a default and it is not identical to the default // for the type parameter at this position, we report an error. @@ -46658,12 +47624,15 @@ var ts; ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; - if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { break; } } } - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var baseWithThis = getTypeWithThisArgument(baseType_1, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + } checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseConstructorType.flags & 1081344 /* TypeVariable */ && !isMixinConstructorType(staticType)) { error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); @@ -46693,7 +47662,13 @@ var ts; var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { if (isValidBaseType(t)) { - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + var genericDiag = t.symbol && t.symbol.flags & 32 /* Class */ ? + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : + ts.Diagnostics.Class_0_incorrectly_implements_interface_1; + var baseWithThis = getTypeWithThisArgument(t, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); + } } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -46708,6 +47683,35 @@ var ts; checkPropertyInitialization(node); } } + function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { + // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible + var issuedMemberError = false; + var _loop_6 = function (member) { + if (ts.hasStaticModifier(member)) { + return "continue"; + } + var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (declaredProp) { + var prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); + var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); + if (prop && baseProp) { + var rootChain = function () { return ts.chainDiagnosticMessages( + /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, ts.unescapeLeadingUnderscores(declaredProp.escapedName), typeToString(typeWithThis), typeToString(baseWithThis)); }; + if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, /*message*/ undefined, rootChain)) { + issuedMemberError = true; + } + } + } + }; + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + _loop_6(member); + } + if (!issuedMemberError) { + // check again with diagnostics to generate a less-specific error + checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); + } + } function checkBaseTypeAccessibility(type, node) { var signatures = getSignaturesOfType(type, 1 /* Construct */); if (signatures.length) { @@ -46727,7 +47731,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 230 /* ClassDeclaration */ || d.kind === 231 /* InterfaceDeclaration */; + return d.kind === 233 /* ClassDeclaration */ || d.kind === 234 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -46766,7 +47770,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { - if (derivedClassDecl.kind === 200 /* ClassExpression */) { + if (derivedClassDecl.kind === 203 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -46858,7 +47862,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 150 /* PropertyDeclaration */ && + return node.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -46880,7 +47884,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -46985,17 +47989,17 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 193 /* PrefixUnaryExpression */: - var value_1 = evaluate(expr.operand); - if (typeof value_1 === "number") { + case 196 /* PrefixUnaryExpression */: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { switch (expr.operator) { - case 37 /* PlusToken */: return value_1; - case 38 /* MinusToken */: return -value_1; - case 52 /* TildeToken */: return ~value_1; + case 37 /* PlusToken */: return value_2; + case 38 /* MinusToken */: return -value_2; + case 52 /* TildeToken */: return ~value_2; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -47011,6 +48015,7 @@ var ts; case 37 /* PlusToken */: return left + right; case 38 /* MinusToken */: return left - right; case 42 /* PercentToken */: return left % right; + case 40 /* AsteriskAsteriskToken */: return Math.pow(left, right); } } break; @@ -47019,18 +48024,18 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return evaluate(expr.expression); case 71 /* Identifier */: return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText); - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 180 /* PropertyAccessExpression */) { + if (ex.kind === 183 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -47062,8 +48067,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 181 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 183 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 184 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 9 /* StringLiteral */; } function checkEnumDeclaration(node) { @@ -47103,7 +48108,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 233 /* EnumDeclaration */) { + if (declaration.kind !== 236 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -47126,8 +48131,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { var declaration = declarations_7[_i]; - if ((declaration.kind === 230 /* ClassDeclaration */ || - (declaration.kind === 229 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 233 /* ClassDeclaration */ || + (declaration.kind === 232 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 2097152 /* Ambient */)) { return declaration; } @@ -47191,7 +48196,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 230 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 233 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -47242,23 +48247,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -47269,12 +48274,12 @@ var ts; break; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 229 /* FunctionDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -47297,12 +48302,12 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: do { node = node.left; } while (node.kind !== 71 /* Identifier */); return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 71 /* Identifier */); @@ -47315,9 +48320,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 245 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 248 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -47350,14 +48355,14 @@ var ts; (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 247 /* ExportSpecifier */ ? + var message = node.kind === 250 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 247 /* ExportSpecifier */ + && node.kind === 250 /* ExportSpecifier */ && !(target.flags & 107455 /* Value */) && !(node.flags & 2097152 /* Ambient */)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); @@ -47385,7 +48390,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -47406,7 +48411,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 252 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 107455 /* Value */) { @@ -47442,10 +48447,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 235 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 238 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 2097152 /* Ambient */; - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -47462,7 +48467,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 269 /* SourceFile */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 234 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 272 /* SourceFile */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 237 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -47491,8 +48496,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -47580,7 +48585,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 229 /* FunctionDeclaration */ && declaration.kind !== 152 /* MethodDeclaration */) || + return (declaration.kind !== 232 /* FunctionDeclaration */ && declaration.kind !== 153 /* MethodDeclaration */) || !!declaration.body; } function checkSourceElement(node) { @@ -47598,145 +48603,149 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return checkTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return checkParameter(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return checkPropertyDeclaration(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return checkSignatureDeclaration(node); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return checkMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return checkConstructorDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return checkAccessorDeclaration(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return checkTypeReferenceNode(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return checkTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return checkTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return checkArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return checkTupleType(node); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return checkSourceElement(node.type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return checkTypeOperator(node); - case 282 /* JSDocAugmentsTag */: + case 170 /* ConditionalType */: + return checkConditionalType(node); + case 171 /* InferType */: + return checkInferType(node); + case 285 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return checkJSDocTypedefTag(node); - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: checkSignatureDeclaration(node); // falls through - case 275 /* JSDocNonNullableType */: - case 274 /* JSDocNullableType */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 278 /* JSDocNonNullableType */: + case 277 /* JSDocNullableType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return checkMappedType(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return checkBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return checkVariableStatement(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return checkExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return checkIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return checkDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return checkWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return checkForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return checkForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkForOfStatement(node); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return checkReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return checkSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return checkLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return checkThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return checkTryStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return checkBindingElement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return checkClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return checkImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return checkExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return checkExportAssignment(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -47810,17 +48819,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -47939,13 +48948,13 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -47953,8 +48962,8 @@ var ts; // falls through // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -47963,7 +48972,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 793064 /* Type */); } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -48011,28 +49020,28 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 146 /* TypeParameter */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 147 /* TypeParameter */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 144 /* QualifiedName */) { + while (node.parent && node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 160 /* TypeReference */; + return node.parent && node.parent.kind === 161 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 180 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 183 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 202 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 205 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -48060,13 +49069,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 144 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 145 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 238 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 241 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 244 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 247 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -48091,7 +49100,7 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJavaScriptFile(entityName) && - entityName.parent.kind === 180 /* PropertyAccessExpression */ && + entityName.parent.kind === 183 /* PropertyAccessExpression */ && entityName.parent === entityName.parent.parent.left) { // Check if this is a special property assignment var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); @@ -48099,13 +49108,13 @@ var ts; return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 244 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 247 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } - if (entityName.kind !== 180 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 183 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 238 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 241 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -48115,7 +49124,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 202 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 205 /* ExpressionWithTypeArguments */) { meaning = 793064 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -48126,15 +49135,15 @@ var ts; meaning = 1920 /* Namespace */; } meaning |= 2097152 /* Alias */; - var entityNameSymbol = resolveEntityName(entityName, meaning); + var entityNameSymbol = ts.isEntityNameExpression(entityName) ? resolveEntityName(entityName, meaning) : undefined; if (entityNameSymbol) { return entityNameSymbol; } } - if (entityName.parent.kind === 284 /* JSDocParameterTag */) { + if (entityName.parent.kind === 287 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 146 /* TypeParameter */ && entityName.parent.parent.kind === 287 /* JSDocTemplateTag */) { + if (entityName.parent.kind === 147 /* TypeParameter */ && entityName.parent.parent.kind === 290 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJavaScriptFile(entityName)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -48146,16 +49155,17 @@ var ts; } if (entityName.kind === 71 /* Identifier */) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { - return getIntrinsicTagSymbol(entityName.parent); + var symbol = getIntrinsicTagSymbol(entityName.parent); + return symbol === unknownSymbol ? undefined : symbol; } return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 180 /* PropertyAccessExpression */ || entityName.kind === 144 /* QualifiedName */) { + else if (entityName.kind === 183 /* PropertyAccessExpression */ || entityName.kind === 145 /* QualifiedName */) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 180 /* PropertyAccessExpression */) { + if (entityName.kind === 183 /* PropertyAccessExpression */) { checkPropertyAccessExpression(entityName); } else { @@ -48165,20 +49175,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 160 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = entityName.parent.kind === 161 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 257 /* JsxAttribute */) { + else if (entityName.parent.kind === 260 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 159 /* TypePredicate */) { + if (entityName.parent.kind === 160 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (node.flags & 4194304 /* InWithStatement */) { @@ -48196,8 +49206,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 177 /* BindingElement */ && - node.parent.parent.kind === 175 /* ObjectBindingPattern */ && + else if (node.parent.kind === 180 /* BindingElement */ && + node.parent.parent.kind === 178 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText); @@ -48208,8 +49218,8 @@ var ts; } switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 99 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -48223,23 +49233,24 @@ var ts; return checkExpression(node).symbol; } // falls through - case 170 /* ThisType */: + case 173 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 97 /* SuperKeyword */: return checkExpression(node).symbol; case 123 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 153 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 154 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 9 /* StringLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: // 1). import x = require("./mo/*gotToDefinitionHere*/d") // 2). External module name in an import declaration // 3). Dynamic import call or require in javascript if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 242 /* ImportDeclaration */ || node.parent.kind === 248 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || ts.isImportCall(node.parent))) { return resolveExternalModuleName(node, node); } @@ -48264,7 +49275,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 266 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 269 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -48323,8 +49334,10 @@ var ts; } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolAtLocation(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + } } return unknownType; } @@ -48335,32 +49348,32 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 179 /* ObjectLiteralExpression */ || expr.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 182 /* ObjectLiteralExpression */ || expr.kind === 181 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 217 /* ForOfStatement */) { + if (expr.parent.kind === 220 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 195 /* BinaryExpression */) { + if (expr.parent.kind === 198 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 265 /* PropertyAssignment */) { + if (expr.parent.kind === 268 /* PropertyAssignment */) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 181 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType; - return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); + return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || unknownType); } // Gets the property symbol corresponding to the property in destructuring assignment // 'property1' from @@ -48407,42 +49420,35 @@ var ts; return ts.typeHasCallOrConstructSignatures(type, checker); } function getRootSymbols(symbol) { + var roots = getImmediateRootSymbols(symbol); + return roots ? ts.flatMap(roots, getRootSymbols) : [symbol]; + } + function getImmediateRootSymbols(symbol) { if (ts.getCheckFlags(symbol) & 6 /* Synthetic */) { - var symbols_4 = []; - var name_4 = symbol.escapedName; - ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_4); - if (symbol) { - symbols_4.push(symbol); - } - }); - return symbols_4; + return ts.mapDefined(getSymbolLinks(symbol).containingType.types, function (type) { return getPropertyOfType(type, symbol.escapedName); }); } else if (symbol.flags & 33554432 /* Transient */) { - var transient = symbol; - if (transient.leftSpread) { - return getRootSymbols(transient.leftSpread).concat(getRootSymbols(transient.rightSpread)); - } - if (transient.syntheticOrigin) { - return getRootSymbols(transient.syntheticOrigin); - } - var target = void 0; - var next = symbol; - while (next = getSymbolLinks(next).target) { - target = next; - } - if (target) { - return [target]; - } + var _a = symbol, leftSpread = _a.leftSpread, rightSpread = _a.rightSpread, syntheticOrigin = _a.syntheticOrigin; + return leftSpread ? [leftSpread, rightSpread] + : syntheticOrigin ? [syntheticOrigin] + : ts.singleElementArray(tryGetAliasTarget(symbol)); } - return [symbol]; + return undefined; + } + function tryGetAliasTarget(symbol) { + var target; + var next = symbol; + while (next = getSymbolLinks(next).target) { + target = next; + } + return target; } // Emitter support function isArgumentsLocalBinding(node) { if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -48492,14 +49498,14 @@ var ts; // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the // kinds that we do NOT prefix. var exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */) { + if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */ && !(exportSymbol.flags & 3 /* Variable */)) { return undefined; } symbol = exportSymbol; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 269 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 272 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -48543,7 +49549,7 @@ var ts; // AND // - binding is not declared in loop, should be renamed to avoid name reuse across siblings // let a, b - // { let x = 1; a = () => x; } + // { let x = 1; a = () => x; } // { let x = 100; b = () => x; } // console.log(a()); // should print '1' // console.log(b()); // should print '100' @@ -48554,7 +49560,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 262144 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 208 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 211 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -48595,16 +49601,16 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return node.expression && node.expression.kind === 71 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -48614,7 +49620,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 269 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 272 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -48692,15 +49698,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 268 /* EnumMember */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 271 /* EnumMember */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 268 /* EnumMember */) { + if (node.kind === 271 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -48786,20 +49792,20 @@ var ts; : unknownType; if (type.flags & 1024 /* UniqueESSymbol */ && type.symbol === symbol) { - flags |= 131072 /* AllowUniqueESSymbolType */; + flags |= 1048576 /* AllowUniqueESSymbolType */; } - if (flags & 8192 /* AddUndefined */) { + if (flags & 131072 /* AddUndefined */) { type = getOptionalType(type); } - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); - getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); + typeToString(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { var type = getWidenedType(getRegularTypeOfExpression(expr)); - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function hasGlobalName(name) { return globals.has(ts.escapeLeadingUnderscores(name)); @@ -48835,7 +49841,7 @@ var ts; function isLiteralConstDeclaration(node) { if (ts.isConst(node)) { var type = getTypeOfSymbol(getSymbolOfNode(node)); - return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */); + return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */); } return false; } @@ -48920,7 +49926,7 @@ var ts; // property access can only be used as values // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries - var meaning = (node.kind === 180 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) + var meaning = (node.kind === 183 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) ? 107455 /* Value */ | 1048576 /* ExportValue */ : 793064 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -48971,7 +49977,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 269 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 272 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -48991,7 +49997,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 269 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 272 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -49022,13 +50028,21 @@ var ts; }); } } + // We do global augmentations seperately from module augmentations (and before creating global types) because they + // 1. Affect global types. We won't have the correct global types until global augmentations are merged. Also, + // 2. Module augmentation instantiation requires creating the type of a module, which, in turn, can require + // checking for an export or property on the module (if export=) which, in turn, can fall back to the + // apparent type of the module - either globalObjectType or globalFunctionType - which wouldn't exist if we + // did module augmentations prior to finalizing the global types. if (augmentations) { - // merge module augmentations. + // merge _global_ module augmentations. // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed for (var _d = 0, augmentations_1 = augmentations; _d < augmentations_1.length; _d++) { var list = augmentations_1[_d]; for (var _e = 0, list_1 = list; _e < list_1.length; _e++) { var augmentation = list_1[_e]; + if (!ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; mergeModuleAugmentation(augmentation); } } @@ -49055,6 +50069,19 @@ var ts; globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; globalThisType = getGlobalTypeOrUndefined("ThisType", /*arity*/ 1); + if (augmentations) { + // merge _nonglobal_ module augmentations. + // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed + for (var _f = 0, augmentations_2 = augmentations; _f < augmentations_2.length; _f++) { + var list = augmentations_2[_f]; + for (var _g = 0, list_2 = list; _g < list_2.length; _g++) { + var augmentation = list_2[_g]; + if (ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } } function checkExternalEmitHelpers(location, helpers) { if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { @@ -49114,14 +50141,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 152 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 153 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */) { + else if (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -49138,17 +50165,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 131 /* ReadonlyKeyword */) { - if (node.kind === 149 /* PropertySignature */ || node.kind === 151 /* MethodSignature */) { + if (modifier.kind !== 132 /* ReadonlyKeyword */) { + if (node.kind === 150 /* PropertySignature */ || node.kind === 152 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 76 /* ConstKeyword */: - if (node.kind !== 233 /* EnumDeclaration */ && node.parent.kind === 230 /* ClassDeclaration */) { + if (node.kind !== 236 /* EnumDeclaration */ && node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76 /* ConstKeyword */)); } break; @@ -49168,7 +50195,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -49191,10 +50218,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -49203,11 +50230,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */ && node.kind !== 158 /* IndexSignature */ && node.kind !== 147 /* Parameter */) { + else if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */ && node.kind !== 159 /* IndexSignature */ && node.kind !== 148 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -49227,17 +50254,17 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 79 /* DefaultKeyword */: - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -49249,13 +50276,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 235 /* ModuleBlock */) { + else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 238 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -49265,14 +50292,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 230 /* ClassDeclaration */) { - if (node.kind !== 152 /* MethodDeclaration */ && - node.kind !== 150 /* PropertyDeclaration */ && - node.kind !== 154 /* GetAccessor */ && - node.kind !== 155 /* SetAccessor */) { + if (node.kind !== 233 /* ClassDeclaration */) { + if (node.kind !== 153 /* MethodDeclaration */ && + node.kind !== 151 /* PropertyDeclaration */ && + node.kind !== 155 /* GetAccessor */ && + node.kind !== 156 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 230 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 233 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -49291,7 +50318,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -49299,7 +50326,7 @@ var ts; break; } } - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -49314,13 +50341,13 @@ var ts; } return; } - else if ((node.kind === 239 /* ImportDeclaration */ || node.kind === 238 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 242 /* ImportDeclaration */ || node.kind === 241 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -49340,37 +50367,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 234 /* ModuleDeclaration */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 147 /* Parameter */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 237 /* ModuleDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 148 /* Parameter */: return false; default: - if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return false; } switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 120 /* AsyncKeyword */); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 117 /* AbstractKeyword */); - case 231 /* InterfaceDeclaration */: - case 209 /* VariableStatement */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 212 /* VariableStatement */: + case 235 /* TypeAliasDeclaration */: return true; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 76 /* ConstKeyword */); default: ts.Debug.fail(); @@ -49383,10 +50410,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -49399,9 +50426,6 @@ var ts; } } function checkGrammarTypeParameterList(typeParameters, file) { - if (checkGrammarForDisallowedTrailingComma(typeParameters)) { - return true; - } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; @@ -49449,15 +50473,13 @@ var ts; return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 188 /* ArrowFunction */) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } + if (!ts.isArrowFunction(node)) { + return false; } - return false; + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -49484,7 +50506,14 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 136 /* StringKeyword */ && parameter.type.kind !== 133 /* NumberKeyword */) { + if (parameter.type.kind !== 137 /* StringKeyword */ && parameter.type.kind !== 134 /* NumberKeyword */) { + var type = getTypeFromTypeNode(parameter.type); + if (type.flags & 2 /* String */ || type.flags & 4 /* Number */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type))); + } + if (allTypesAssignableToKind(type, 32 /* StringLiteral */, /*strict*/ true)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead); + } return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -49511,7 +50540,7 @@ var ts; if (args) { for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; - if (arg.kind === 201 /* OmittedExpression */) { + if (arg.kind === 204 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -49587,19 +50616,19 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 145 /* ComputedPropertyName */) { + if (node.kind !== 146 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 195 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { + if (computedPropertyName.expression.kind === 198 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 229 /* FunctionDeclaration */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 152 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 232 /* FunctionDeclaration */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 153 /* MethodDeclaration */); if (node.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -49624,15 +50653,15 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */) { + if (prop.kind === 270 /* SpreadAssignment */) { continue; } var name = prop.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 266 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 269 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -49641,7 +50670,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 152 /* MethodDeclaration */) { + if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 153 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -49656,21 +50685,21 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { checkGrammarNumericLiteral(name); } // falls through - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: currentKind = 1 /* Property */; break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: currentKind = 2 /* GetAccessor */; break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: currentKind = 4 /* SetAccessor */; break; default: @@ -49706,20 +50735,18 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 259 /* JsxSpreadAttribute */) { + if (attr.kind === 262 /* JsxSpreadAttribute */) { continue; } - var jsxAttr = attr; - var name = jsxAttr.name; + var name = attr.name, initializer = attr.initializer; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 260 /* JsxExpression */ && !initializer.expression) { - return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === 263 /* JsxExpression */ && !initializer.expression) { + return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -49727,12 +50754,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 217 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 220 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); } } - if (forInOrOfStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 231 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -49747,20 +50774,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -49787,11 +50814,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 154 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 155 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 155 /* SetAccessor */) { + else if (kind === 156 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -49814,21 +50841,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 140 /* UniqueKeyword */) { - if (node.type.kind !== 137 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(137 /* SymbolKeyword */)); + if (node.operator === 141 /* UniqueKeyword */) { + if (node.type.kind !== 138 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 71 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -49840,13 +50867,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -49862,17 +50889,24 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === 153 /* MethodDeclaration */) { + if (node.parent.kind === 182 /* ObjectLiteralExpression */) { + // We only disallow modifier on a method declaration if it is a property of object-literal-expression + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120 /* AsyncKeyword */)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } if (ts.isClassLike(node.parent)) { @@ -49884,14 +50918,14 @@ var ts; if (node.flags & 2097152 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === 153 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -49902,11 +50936,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 218 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 221 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -49914,8 +50948,8 @@ var ts; return false; } break; - case 222 /* SwitchStatement */: - if (node.kind === 219 /* BreakStatement */ && !node.label) { + case 225 /* SwitchStatement */: + if (node.kind === 222 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -49930,13 +50964,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -49945,12 +50979,15 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== ts.lastOrUndefined(elements)) { + if (node !== ts.last(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 176 /* ArrayBindingPattern */ || node.name.kind === 175 /* ObjectBindingPattern */) { + if (node.name.kind === 179 /* ArrayBindingPattern */ || node.name.kind === 178 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } + if (node.propertyName) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name); + } if (node.initializer) { // Error on equals token which immediately precedes the initializer return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); @@ -49959,11 +50996,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 193 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && + expr.kind === 196 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 216 /* ForInStatement */ && node.parent.parent.kind !== 217 /* ForOfStatement */) { + if (node.parent.parent.kind !== 219 /* ForInStatement */ && node.parent.parent.kind !== 220 /* ForOfStatement */) { if (node.flags & 2097152 /* Ambient */) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -49992,7 +51029,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 209 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 212 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && @@ -50051,15 +51088,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return false; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -50125,7 +51162,7 @@ var ts; return true; } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -50133,7 +51170,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -50144,7 +51181,7 @@ var ts; if (node.flags & 2097152 /* Ambient */ && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } - if (node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || + if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 2097152 /* Ambient */ || ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */))) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } @@ -50162,13 +51199,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 231 /* InterfaceDeclaration */ || - node.kind === 232 /* TypeAliasDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 245 /* ExportDeclaration */ || - node.kind === 244 /* ExportAssignment */ || - node.kind === 237 /* NamespaceExportDeclaration */ || + if (node.kind === 234 /* InterfaceDeclaration */ || + node.kind === 235 /* TypeAliasDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 248 /* ExportDeclaration */ || + node.kind === 247 /* ExportAssignment */ || + node.kind === 240 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -50177,7 +51214,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 209 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 212 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -50203,7 +51240,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 208 /* Block */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 211 /* Block */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -50224,10 +51261,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 174 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 177 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 268 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 271 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -50279,23 +51316,23 @@ var ts; /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: - return true; + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: + return ts.isIdentifier(name); default: return ts.isDeclarationName(name); } } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 240 /* ImportClause */: // For default import - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */:// For rename import `x as y` + case 243 /* ImportClause */: // For default import + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */:// For rename import `x as y` return true; case 71 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 243 /* ImportSpecifier */; + return decl.parent.kind === 246 /* ImportSpecifier */; default: return false; } @@ -50409,7 +51446,7 @@ var ts; var node = createSynthesizedNode(71 /* Identifier */); node.escapedText = ts.escapeLeadingUnderscores(text); node.originalKeywordKind = text ? ts.stringToToken(text) : 0 /* Unknown */; - node.autoGenerateKind = 0 /* None */; + node.autoGenerateFlags = 0 /* None */; node.autoGenerateId = 0; if (typeArguments) { node.typeArguments = createNodeArray(typeArguments); @@ -50424,22 +51461,24 @@ var ts; } ts.updateIdentifier = updateIdentifier; var nextAutoGenerateId = 0; - /** Create a unique temporary variable. */ - function createTempVariable(recordTempVariable) { + function createTempVariable(recordTempVariable, reservedInNestedScopes) { var name = createIdentifier(""); - name.autoGenerateKind = 1 /* Auto */; + name.autoGenerateFlags = 1 /* Auto */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; if (recordTempVariable) { recordTempVariable(name); } + if (reservedInNestedScopes) { + name.autoGenerateFlags |= 16 /* ReservedInNestedScopes */; + } return name; } ts.createTempVariable = createTempVariable; /** Create a unique temporary variable for use in a loop. */ function createLoopVariable() { var name = createIdentifier(""); - name.autoGenerateKind = 2 /* Loop */; + name.autoGenerateFlags = 2 /* Loop */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -50448,7 +51487,7 @@ var ts; /** Create a unique name based on the supplied text. */ function createUniqueName(text) { var name = createIdentifier(text); - name.autoGenerateKind = 3 /* Unique */; + name.autoGenerateFlags = 3 /* Unique */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -50456,10 +51495,12 @@ var ts; ts.createUniqueName = createUniqueName; function getGeneratedNameForNode(node, shouldSkipNameGenerationScope) { var name = createIdentifier(""); - name.autoGenerateKind = 4 /* Node */; + name.autoGenerateFlags = 4 /* Node */; name.autoGenerateId = nextAutoGenerateId; name.original = node; - name.skipNameGenerationScope = !!shouldSkipNameGenerationScope; + if (shouldSkipNameGenerationScope) { + name.autoGenerateFlags |= 8 /* SkipNameGenerationScope */; + } nextAutoGenerateId++; return name; } @@ -50492,7 +51533,7 @@ var ts; ts.createFalse = createFalse; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(144 /* QualifiedName */); + var node = createSynthesizedNode(145 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -50506,7 +51547,7 @@ var ts; } ts.updateQualifiedName = updateQualifiedName; function createComputedPropertyName(expression) { - var node = createSynthesizedNode(145 /* ComputedPropertyName */); + var node = createSynthesizedNode(146 /* ComputedPropertyName */); node.expression = expression; return node; } @@ -50519,7 +51560,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(146 /* TypeParameter */); + var node = createSynthesizedNode(147 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -50535,7 +51576,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(147 /* Parameter */); + var node = createSynthesizedNode(148 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -50559,7 +51600,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(148 /* Decorator */); + var node = createSynthesizedNode(149 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -50572,7 +51613,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(149 /* PropertySignature */); + var node = createSynthesizedNode(150 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -50591,30 +51632,32 @@ var ts; : node; } ts.updatePropertySignature = updatePropertySignature; - function createProperty(decorators, modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(150 /* PropertyDeclaration */); + function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { + var node = createSynthesizedNode(151 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.questionToken = questionToken; + node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined; + node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined; node.type = type; node.initializer = initializer; return node; } ts.createProperty = createProperty; - function updateProperty(node, decorators, modifiers, name, questionToken, type, initializer) { + function updateProperty(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { return node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name - || node.questionToken !== questionToken + || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined) + || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined) || node.type !== type || node.initializer !== initializer - ? updateNode(createProperty(decorators, modifiers, name, questionToken, type, initializer), node) + ? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(151 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(152 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -50631,7 +51674,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(152 /* MethodDeclaration */); + var node = createSynthesizedNode(153 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -50659,7 +51702,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(153 /* Constructor */); + var node = createSynthesizedNode(154 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -50679,7 +51722,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(154 /* GetAccessor */); + var node = createSynthesizedNode(155 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50702,7 +51745,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(155 /* SetAccessor */); + var node = createSynthesizedNode(156 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50723,7 +51766,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(156 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(157 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -50731,7 +51774,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(157 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(158 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -50739,7 +51782,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(158 /* IndexSignature */); + var node = createSynthesizedNode(159 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -50757,11 +51800,12 @@ var ts; } ts.updateIndexSignature = updateIndexSignature; /* @internal */ - function createSignatureDeclaration(kind, typeParameters, parameters, type) { + function createSignatureDeclaration(kind, typeParameters, parameters, type, typeArguments) { var node = createSynthesizedNode(kind); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createSignatureDeclaration = createSignatureDeclaration; @@ -50778,7 +51822,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(159 /* TypePredicate */); + var node = createSynthesizedNode(160 /* TypePredicate */); node.parameterName = asName(parameterName); node.type = type; return node; @@ -50792,7 +51836,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(160 /* TypeReference */); + var node = createSynthesizedNode(161 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -50806,7 +51850,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(161 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(162 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -50814,7 +51858,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(162 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(163 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -50822,7 +51866,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(163 /* TypeQuery */); + var node = createSynthesizedNode(164 /* TypeQuery */); node.exprName = exprName; return node; } @@ -50834,7 +51878,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(164 /* TypeLiteral */); + var node = createSynthesizedNode(165 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -50846,7 +51890,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(165 /* ArrayType */); + var node = createSynthesizedNode(166 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -50858,7 +51902,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(166 /* TupleType */); + var node = createSynthesizedNode(167 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -50870,7 +51914,7 @@ var ts; } ts.updateTypleTypeNode = updateTypleTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(167 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(168 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -50878,7 +51922,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(168 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(169 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -50896,8 +51940,38 @@ var ts; ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) : node; } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createSynthesizedNode(170 /* ConditionalType */); + node.checkType = ts.parenthesizeConditionalTypeMember(checkType); + node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); + node.trueType = trueType; + node.falseType = falseType; + return node; + } + ts.createConditionalTypeNode = createConditionalTypeNode; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType + || node.extendsType !== extendsType + || node.trueType !== trueType + || node.falseType !== falseType + ? updateNode(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) + : node; + } + ts.updateConditionalTypeNode = updateConditionalTypeNode; + function createInferTypeNode(typeParameter) { + var node = createSynthesizedNode(171 /* InferType */); + node.typeParameter = typeParameter; + return node; + } + ts.createInferTypeNode = createInferTypeNode; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter + ? updateNode(createInferTypeNode(typeParameter), node) + : node; + } + ts.updateInferTypeNode = updateInferTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(169 /* ParenthesizedType */); + var node = createSynthesizedNode(172 /* ParenthesizedType */); node.type = type; return node; } @@ -50909,12 +51983,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(170 /* ThisType */); + return createSynthesizedNode(173 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(171 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 127 /* KeyOfKeyword */; + var node = createSynthesizedNode(174 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 128 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -50924,7 +51998,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(172 /* IndexedAccessType */); + var node = createSynthesizedNode(175 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -50938,7 +52012,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(173 /* MappedType */); + var node = createSynthesizedNode(176 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -50956,7 +52030,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(174 /* LiteralType */); + var node = createSynthesizedNode(177 /* LiteralType */); node.literal = literal; return node; } @@ -50969,7 +52043,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(175 /* ObjectBindingPattern */); + var node = createSynthesizedNode(178 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -50981,7 +52055,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(176 /* ArrayBindingPattern */); + var node = createSynthesizedNode(179 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -50993,7 +52067,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(177 /* BindingElement */); + var node = createSynthesizedNode(180 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -51012,7 +52086,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(178 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(181 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -51026,7 +52100,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(179 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(182 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -51040,7 +52114,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(180 /* PropertyAccessExpression */); + var node = createSynthesizedNode(183 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -51057,7 +52131,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(181 /* ElementAccessExpression */); + var node = createSynthesizedNode(184 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -51071,7 +52145,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(182 /* CallExpression */); + var node = createSynthesizedNode(185 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -51087,7 +52161,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(183 /* NewExpression */); + var node = createSynthesizedNode(186 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -51103,7 +52177,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, template) { - var node = createSynthesizedNode(184 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(187 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; @@ -51117,7 +52191,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(185 /* TypeAssertionExpression */); + var node = createSynthesizedNode(188 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -51131,7 +52205,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(186 /* ParenthesizedExpression */); + var node = createSynthesizedNode(189 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -51143,7 +52217,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(187 /* FunctionExpression */); + var node = createSynthesizedNode(190 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -51167,7 +52241,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(188 /* ArrowFunction */); + var node = createSynthesizedNode(191 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -51201,7 +52275,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(189 /* DeleteExpression */); + var node = createSynthesizedNode(192 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -51213,7 +52287,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(190 /* TypeOfExpression */); + var node = createSynthesizedNode(193 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -51225,7 +52299,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(191 /* VoidExpression */); + var node = createSynthesizedNode(194 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -51237,7 +52311,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(192 /* AwaitExpression */); + var node = createSynthesizedNode(195 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -51249,7 +52323,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(193 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(196 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -51262,7 +52336,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(194 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(197 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -51275,7 +52349,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(195 /* BinaryExpression */); + var node = createSynthesizedNode(198 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -51292,7 +52366,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(196 /* ConditionalExpression */); + var node = createSynthesizedNode(199 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -51322,7 +52396,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(197 /* TemplateExpression */); + var node = createSynthesizedNode(200 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -51360,7 +52434,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(198 /* YieldExpression */); + var node = createSynthesizedNode(201 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -51374,7 +52448,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(199 /* SpreadElement */); + var node = createSynthesizedNode(202 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -51386,7 +52460,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(200 /* ClassExpression */); + var node = createSynthesizedNode(203 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -51407,11 +52481,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(201 /* OmittedExpression */); + return createSynthesizedNode(204 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(202 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(205 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -51425,7 +52499,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(203 /* AsExpression */); + var node = createSynthesizedNode(206 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -51439,7 +52513,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(204 /* NonNullExpression */); + var node = createSynthesizedNode(207 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -51451,7 +52525,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(205 /* MetaProperty */); + var node = createSynthesizedNode(208 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -51465,7 +52539,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(206 /* TemplateSpan */); + var node = createSynthesizedNode(209 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -51479,12 +52553,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(207 /* SemicolonClassElement */); + return createSynthesizedNode(210 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(208 /* Block */); + var block = createSynthesizedNode(211 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -51498,7 +52572,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(209 /* VariableStatement */); + var node = createSynthesizedNode(212 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -51513,11 +52587,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(210 /* EmptyStatement */); + return createSynthesizedNode(213 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createStatement(expression) { - var node = createSynthesizedNode(211 /* ExpressionStatement */); + var node = createSynthesizedNode(214 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -51529,7 +52603,7 @@ var ts; } ts.updateStatement = updateStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(212 /* IfStatement */); + var node = createSynthesizedNode(215 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -51545,7 +52619,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(213 /* DoStatement */); + var node = createSynthesizedNode(216 /* DoStatement */); node.statement = statement; node.expression = expression; return node; @@ -51559,7 +52633,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(214 /* WhileStatement */); + var node = createSynthesizedNode(217 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; @@ -51573,7 +52647,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(215 /* ForStatement */); + var node = createSynthesizedNode(218 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -51591,7 +52665,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(216 /* ForInStatement */); + var node = createSynthesizedNode(219 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -51607,7 +52681,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(217 /* ForOfStatement */); + var node = createSynthesizedNode(220 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -51625,7 +52699,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(218 /* ContinueStatement */); + var node = createSynthesizedNode(221 /* ContinueStatement */); node.label = asName(label); return node; } @@ -51637,7 +52711,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(219 /* BreakStatement */); + var node = createSynthesizedNode(222 /* BreakStatement */); node.label = asName(label); return node; } @@ -51649,7 +52723,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(220 /* ReturnStatement */); + var node = createSynthesizedNode(223 /* ReturnStatement */); node.expression = expression; return node; } @@ -51661,7 +52735,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(221 /* WithStatement */); + var node = createSynthesizedNode(224 /* WithStatement */); node.expression = expression; node.statement = statement; return node; @@ -51675,7 +52749,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(222 /* SwitchStatement */); + var node = createSynthesizedNode(225 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -51689,7 +52763,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(223 /* LabeledStatement */); + var node = createSynthesizedNode(226 /* LabeledStatement */); node.label = asName(label); node.statement = statement; return node; @@ -51703,7 +52777,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(224 /* ThrowStatement */); + var node = createSynthesizedNode(227 /* ThrowStatement */); node.expression = expression; return node; } @@ -51715,7 +52789,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(225 /* TryStatement */); + var node = createSynthesizedNode(228 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -51731,11 +52805,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(226 /* DebuggerStatement */); + return createSynthesizedNode(229 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(227 /* VariableDeclaration */); + var node = createSynthesizedNode(230 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -51751,7 +52825,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { - var node = createSynthesizedNode(228 /* VariableDeclarationList */); + var node = createSynthesizedNode(231 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -51764,7 +52838,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(229 /* FunctionDeclaration */); + var node = createSynthesizedNode(232 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -51790,7 +52864,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(230 /* ClassDeclaration */); + var node = createSynthesizedNode(233 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -51812,7 +52886,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(231 /* InterfaceDeclaration */); + var node = createSynthesizedNode(234 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -51834,7 +52908,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(232 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(235 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -51854,7 +52928,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(233 /* EnumDeclaration */); + var node = createSynthesizedNode(236 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -51872,7 +52946,7 @@ var ts; } ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { - var node = createSynthesizedNode(234 /* ModuleDeclaration */); + var node = createSynthesizedNode(237 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 512 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -51891,7 +52965,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(235 /* ModuleBlock */); + var node = createSynthesizedNode(238 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -51903,7 +52977,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(236 /* CaseBlock */); + var node = createSynthesizedNode(239 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -51915,7 +52989,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(237 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(240 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -51927,7 +53001,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(238 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(241 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -51945,7 +53019,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(239 /* ImportDeclaration */); + var node = createSynthesizedNode(242 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -51963,7 +53037,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(240 /* ImportClause */); + var node = createSynthesizedNode(243 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; @@ -51977,7 +53051,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(241 /* NamespaceImport */); + var node = createSynthesizedNode(244 /* NamespaceImport */); node.name = name; return node; } @@ -51989,7 +53063,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(242 /* NamedImports */); + var node = createSynthesizedNode(245 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -52001,7 +53075,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(243 /* ImportSpecifier */); + var node = createSynthesizedNode(246 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -52015,7 +53089,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(244 /* ExportAssignment */); + var node = createSynthesizedNode(247 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -52032,7 +53106,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(245 /* ExportDeclaration */); + var node = createSynthesizedNode(248 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -52050,7 +53124,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(246 /* NamedExports */); + var node = createSynthesizedNode(249 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -52062,7 +53136,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(247 /* ExportSpecifier */); + var node = createSynthesizedNode(250 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -52077,7 +53151,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(249 /* ExternalModuleReference */); + var node = createSynthesizedNode(252 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -52090,7 +53164,7 @@ var ts; ts.updateExternalModuleReference = updateExternalModuleReference; // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(250 /* JsxElement */); + var node = createSynthesizedNode(253 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -52106,7 +53180,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, attributes) { - var node = createSynthesizedNode(251 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(254 /* JsxSelfClosingElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -52120,7 +53194,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, attributes) { - var node = createSynthesizedNode(252 /* JsxOpeningElement */); + var node = createSynthesizedNode(255 /* JsxOpeningElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -52134,7 +53208,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(253 /* JsxClosingElement */); + var node = createSynthesizedNode(256 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -52146,7 +53220,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(254 /* JsxFragment */); + var node = createSynthesizedNode(257 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -52162,7 +53236,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(257 /* JsxAttribute */); + var node = createSynthesizedNode(260 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -52176,7 +53250,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(258 /* JsxAttributes */); + var node = createSynthesizedNode(261 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -52188,7 +53262,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(259 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(262 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -52200,7 +53274,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(260 /* JsxExpression */); + var node = createSynthesizedNode(263 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -52214,7 +53288,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(261 /* CaseClause */); + var node = createSynthesizedNode(264 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -52228,7 +53302,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(262 /* DefaultClause */); + var node = createSynthesizedNode(265 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -52240,7 +53314,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(263 /* HeritageClause */); + var node = createSynthesizedNode(266 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -52253,7 +53327,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(264 /* CatchClause */); + var node = createSynthesizedNode(267 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -52268,7 +53342,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(265 /* PropertyAssignment */); + var node = createSynthesizedNode(268 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -52283,7 +53357,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(266 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(269 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -52297,7 +53371,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(267 /* SpreadAssignment */); + var node = createSynthesizedNode(270 /* SpreadAssignment */); node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; return node; } @@ -52310,7 +53384,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(268 /* EnumMember */); + var node = createSynthesizedNode(271 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -52326,7 +53400,7 @@ var ts; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createSynthesizedNode(269 /* SourceFile */); + var updated = createSynthesizedNode(272 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -52405,7 +53479,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(291 /* NotEmittedStatement */); + var node = createSynthesizedNode(294 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -52417,7 +53491,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(295 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(298 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -52429,7 +53503,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(294 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(297 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -52444,7 +53518,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(292 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(295 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -52460,7 +53534,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 293 /* CommaListExpression */) { + if (node.kind === 296 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26 /* CommaToken */) { @@ -52470,7 +53544,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(293 /* CommaListExpression */); + var node = createSynthesizedNode(296 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -52482,7 +53556,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createBundle(sourceFiles) { - var node = ts.createNode(270 /* Bundle */); + var node = ts.createNode(273 /* Bundle */); node.sourceFiles = sourceFiles; return node; } @@ -52618,7 +53692,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -53119,7 +54193,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 223 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 226 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -53137,13 +54211,13 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return false; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -53169,7 +54243,7 @@ var ts; } else { switch (callee.kind) { - case 180 /* PropertyAccessExpression */: { + case 183 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -53182,7 +54256,7 @@ var ts; } break; } - case 181 /* ElementAccessExpression */: { + case 184 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -53239,14 +54313,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -53570,7 +54644,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 186 /* ParenthesizedExpression */) { + if (skipped.kind === 189 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -53604,8 +54678,8 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(195 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(198 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { @@ -53614,7 +54688,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 198 /* YieldExpression */) { + && operand.kind === 201 /* YieldExpression */) { return false; } return true; @@ -53624,13 +54698,13 @@ var ts; if (isLeftSideOfBinary) { // No need to parenthesize the left operand when the binary operator is // left associative: - // (a*b)/x -> a*b/x - // (a**b)/x -> a**b/x + // (a*b)/x -> a*b/x + // (a**b)/x -> a**b/x // // Parentheses are needed for the left operand when the binary operator is // right associative: - // (a/b)**x -> (a/b)**x - // (a**b)**x -> (a**b)**x + // (a/b)**x -> (a/b)**x + // (a**b)**x -> (a**b)**x return binaryOperatorAssociativity === 1 /* Right */; } else { @@ -53702,7 +54776,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -53717,7 +54791,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(196 /* ConditionalExpression */, 55 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(199 /* ConditionalExpression */, 55 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { @@ -53730,7 +54804,9 @@ var ts; // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions // so in case when comma expression is introduced as a part of previous transformations // if should be wrapped in parens since comma operator has the lowest precedence - return e.kind === 195 /* BinaryExpression */ && e.operatorToken.kind === 26 /* CommaToken */ + var emittedExpression = ts.skipPartiallyEmittedExpressions(e); + return emittedExpression.kind === 198 /* BinaryExpression */ && emittedExpression.operatorToken.kind === 26 /* CommaToken */ || + emittedExpression.kind === 296 /* CommaListExpression */ ? ts.createParen(e) : e; } @@ -53748,9 +54824,9 @@ var ts; */ function parenthesizeDefaultExpression(e) { var check = ts.skipPartiallyEmittedExpressions(e); - return (check.kind === 200 /* ClassExpression */ || - check.kind === 187 /* FunctionExpression */ || - check.kind === 293 /* CommaListExpression */ || + return (check.kind === 203 /* ClassExpression */ || + check.kind === 190 /* FunctionExpression */ || + check.kind === 296 /* CommaListExpression */ || ts.isBinaryExpression(check) && check.operatorToken.kind === 26 /* CommaToken */) ? ts.createParen(e) : e; @@ -53765,9 +54841,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.createParen(expression); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -53790,7 +54866,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 183 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 186 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -53828,7 +54904,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, 26 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, 26 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -53839,34 +54915,38 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 187 /* FunctionExpression */ || kind === 188 /* ArrowFunction */) { + if (kind === 190 /* FunctionExpression */ || kind === 191 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 179 /* ObjectLiteralExpression */ || leftmostExpressionKind === 187 /* FunctionExpression */) { + if (leftmostExpressionKind === 182 /* ObjectLiteralExpression */ || leftmostExpressionKind === 190 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function parenthesizeConditionalTypeMember(member) { + return member.kind === 170 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + } + ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createParenthesizedType(member); } - return member; + return parenthesizeConditionalTypeMember(member); } ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -53892,25 +54972,25 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: node = node.operand; continue; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: node = node.left; continue; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: node = node.condition; continue; - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: node = node.expression; continue; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -53918,7 +54998,7 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 179 /* ObjectLiteralExpression */) { + if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 182 /* ObjectLiteralExpression */) { return ts.setTextRange(ts.createParen(body), body); } return body; @@ -53934,13 +55014,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 207 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -53965,14 +55045,14 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */) { + while (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 204 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 207 /* NonNullExpression */) { node = node.expression; } return node; @@ -53980,11 +55060,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 186 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 185 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 203 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 204 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 292 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 189 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 206 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -54002,7 +55082,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 186 /* ParenthesizedExpression */ + return node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -54027,14 +55107,14 @@ var ts; return emitNode && emitNode.externalHelpersModuleName; } ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues) { + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) { if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(node, compilerOptions)) { var externalHelpersModuleName = getExternalHelpersModuleName(node); if (externalHelpersModuleName) { return externalHelpersModuleName; } var moduleKind = ts.getEmitModuleKind(compilerOptions); - var create = hasExportStarsToExportValues + var create = (hasExportStarsToExportValues || (compilerOptions.esModuleInterop && hasImportStarOrImportDefault)) && moduleKind !== ts.ModuleKind.System && moduleKind !== ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.ESNext; @@ -54067,10 +55147,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 239 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 242 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 245 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 248 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -54188,7 +55268,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -54200,11 +55280,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -54236,12 +55316,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 148 /* Parameter */: + case 180 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 199 /* SpreadElement */: - case 267 /* SpreadAssignment */: + case 202 /* SpreadElement */: + case 270 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -54253,7 +55333,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -54265,7 +55345,7 @@ var ts; : propertyName; } break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -54277,7 +55357,7 @@ var ts; : propertyName; } break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -54295,13 +55375,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -54341,11 +55421,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -54380,6 +55460,7 @@ var ts; /// var ts; (function (ts) { + var isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration); function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; @@ -54508,266 +55589,270 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */) || kind === 170 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */) || kind === 173 /* ThisType */) { return node; } switch (kind) { // Names case 71 /* Identifier */: - return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 144 /* QualifiedName */: + return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); + case 145 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 148 /* Decorator */: + case 149 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 166 /* TupleType */: + case 167 /* TupleType */: return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 167 /* UnionType */: + case 168 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); + case 171 /* InferType */: + return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); + case 172 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 173 /* MappedType */: + case 176 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 208 /* Block */: + case 211 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 217 /* ForOfStatement */: - return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 218 /* ContinueStatement */: + case 220 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 221 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -54809,58 +55894,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 159 /* TypePredicate */ && kind <= 174 /* LiteralType */)) { + if ((kind >= 160 /* TypePredicate */ && kind <= 177 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 207 /* SemicolonClassElement */: - case 210 /* EmptyStatement */: - case 201 /* OmittedExpression */: - case 226 /* DebuggerStatement */: - case 291 /* NotEmittedStatement */: + case 210 /* SemicolonClassElement */: + case 213 /* EmptyStatement */: + case 204 /* OmittedExpression */: + case 229 /* DebuggerStatement */: + case 294 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 147 /* Parameter */: + case 148 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 148 /* Decorator */: + case 149 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -54869,12 +55954,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 153 /* Constructor */: + case 154 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -54882,7 +55967,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -54890,49 +55975,49 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 183 /* NewExpression */: + case 186 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -54940,123 +56025,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 186 /* ParenthesizedExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: - case 204 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 203 /* AsExpression */: + case 206 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 208 /* Block */: + case 211 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 214 /* WhileStatement */: - case 221 /* WithStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -55065,7 +56150,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -55073,139 +56158,139 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 264 /* CatchClause */: + case 267 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -55278,7 +56363,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 202 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 205 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -55369,6 +56454,34 @@ var ts; return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; + function getNamedImportCount(node) { + if (!(node.importClause && node.importClause.namedBindings)) + return 0; + var names = node.importClause.namedBindings; + if (!names) + return 0; + if (!ts.isNamedImports(names)) + return 0; + return names.elements.length; + } + function containsDefaultReference(node) { + if (!node) + return false; + if (!ts.isNamedImports(node)) + return false; + return ts.some(node.elements, isNamedDefaultReference); + } + function isNamedDefaultReference(e) { + return e.propertyName && e.propertyName.escapedText === "default" /* Default */; + } + function getImportNeedsImportStarHelper(node) { + return !!ts.getNamespaceDeclarationNode(node) || (getNamedImportCount(node) > 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper; + function getImportNeedsImportDefaultHelper(node) { + return ts.isDefaultImport(node) || (getNamedImportCount(node) === 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; var exportSpecifiers = ts.createMultiMap(); @@ -55378,23 +56491,25 @@ var ts; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; + var hasImportStarOrImportDefault = false; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" // import { x, y } from "mod" externalImports.push(node); + hasImportStarOrImportDefault = getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 238 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + case 241 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -55424,13 +56539,13 @@ var ts; } } break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -55438,7 +56553,7 @@ var ts; } } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -55458,7 +56573,7 @@ var ts; } } break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -55480,11 +56595,12 @@ var ts; break; } } - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues); + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault); var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { + ts.addEmitFlags(externalHelpersImportDeclaration, 67108864 /* NeverApplyImportHelper */); externalImports.unshift(externalHelpersImportDeclaration); } return { externalImports: externalImports, exportSpecifiers: exportSpecifiers, exportEquals: exportEquals, hasExportStarsToExportValues: hasExportStarsToExportValues, exportedBindings: exportedBindings, exportedNames: exportedNames, externalHelpersImportDeclaration: externalHelpersImportDeclaration }; @@ -55525,9 +56641,8 @@ var ts; * - this is mostly subjective beyond the requirement that the expression not be sideeffecting */ function isSimpleCopiableExpression(expression) { - return expression.kind === 9 /* StringLiteral */ || + return ts.isStringLiteralLike(expression) || expression.kind === 8 /* NumericLiteral */ || - expression.kind === 13 /* NoSubstitutionTemplateLiteral */ || ts.isKeyword(expression.kind) || ts.isIdentifier(expression); } @@ -55584,7 +56699,12 @@ var ts; }; if (value) { value = ts.visitNode(value, visitor, ts.isExpression); - if (needsValue) { + if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText)) { + // If the right-hand value of the assignment is also an assignment target then + // we need to cache the right-hand value. + value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ false, location); + } + else if (needsValue) { // If the right-hand value of the destructuring assignment needs to be preserved (as // is the case when the destructuring assignment is part of a larger expression), // then we need to cache the right-hand value. @@ -55628,6 +56748,26 @@ var ts; } } ts.flattenDestructuringAssignment = flattenDestructuringAssignment; + function bindingOrAssignmentElementAssignsToName(element, escapedName) { + var target = ts.getTargetOfBindingOrAssignmentElement(element); + if (ts.isBindingOrAssignmentPattern(target)) { + return bindingOrAssignmentPatternAssignsToName(target, escapedName); + } + else if (ts.isIdentifier(target)) { + return target.escapedText === escapedName; + } + return false; + } + function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) { + var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; + if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { + return true; + } + } + return false; + } /** * Flattens a VariableDeclaration or ParameterDeclaration to one or more variable declarations. * @@ -55655,6 +56795,15 @@ var ts; createArrayBindingOrAssignmentElement: makeBindingElement, visitor: visitor }; + if (ts.isVariableDeclaration(node)) { + var initializer = ts.getInitializerOfBindingOrAssignmentElement(node); + if (initializer && ts.isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText)) { + // If the right-hand value of the assignment is also an assignment target then + // we need to cache the right-hand value. + initializer = ensureIdentifier(flattenContext, initializer, /*reuseIdentifierExpressions*/ false, initializer); + node = ts.updateVariableDeclaration(node, node.name, node.type, initializer); + } + } flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); if (pendingExpressions) { var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); @@ -56024,8 +57173,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -56043,7 +57192,7 @@ var ts; */ var classAliases; /** - * Keeps track of whether we are within any containing namespaces when performing + * Keeps track of whether we are within any containing namespaces when performing * just-in-time substitution while printing an expression identifier. */ var applicableSubstitutions; @@ -56094,15 +57243,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 235 /* ModuleBlock */: - case 208 /* Block */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 238 /* ModuleBlock */: + case 211 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 230 /* ClassDeclaration */: - case 229 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -56114,7 +57263,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 230 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 233 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } break; } @@ -56158,10 +57307,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -56182,13 +57331,13 @@ var ts; return node; } switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -56208,11 +57357,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 245 /* ExportDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 240 /* ImportClause */ || - (node.kind === 238 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 249 /* ExternalModuleReference */)) { + if (node.kind === 248 /* ExportDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 243 /* ImportClause */ || + (node.kind === 241 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 252 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -56242,19 +57391,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 150 /* PropertyDeclaration */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -56292,53 +57441,54 @@ var ts; case 117 /* AbstractKeyword */: case 76 /* ConstKeyword */: case 124 /* DeclareKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 164 /* TypeLiteral */: - case 159 /* TypePredicate */: - case 146 /* TypeParameter */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 165 /* TypeLiteral */: + case 160 /* TypePredicate */: + case 147 /* TypeParameter */: case 119 /* AnyKeyword */: case 122 /* BooleanKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: case 105 /* VoidKeyword */: - case 137 /* SymbolKeyword */: - case 162 /* ConstructorType */: - case 161 /* FunctionType */: - case 163 /* TypeQuery */: - case 160 /* TypeReference */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: + case 138 /* SymbolKeyword */: + case 163 /* ConstructorType */: + case 162 /* FunctionType */: + case 164 /* TypeQuery */: + case 161 /* TypeReference */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 172 /* ParenthesizedType */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: // TypeScript type nodes are elided. - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // TypeScript index signatures are elided. - case 148 /* Decorator */: + case 149 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructor(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -56349,7 +57499,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -56360,35 +57510,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -56398,33 +57548,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -56740,11 +57890,14 @@ var ts; ts.setTextRange(classExpression, node); if (ts.some(staticProperties) || ts.some(pendingExpressions)) { var expressions = []; - var temp = ts.createTempVariable(hoistVariableDeclaration); - if (resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */) { + var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */; + var temp = ts.createTempVariable(hoistVariableDeclaration, !!isClassWithConstructorReference); + if (isClassWithConstructorReference) { // record an alias as the class name is not in scope for statics. enableSubstitutionForClassAliases(); - classAliases[ts.getOriginalNodeId(node)] = ts.getSynthesizedClone(temp); + var alias = ts.getSynthesizedClone(temp); + alias.autoGenerateFlags &= ~16 /* ReservedInNestedScopes */; + classAliases[ts.getOriginalNodeId(node)] = alias; } // To preserve the behavior of the old emitter, we explicitly indent // the body of a class with static initializers. @@ -56903,7 +58056,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -56974,7 +58127,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 150 /* PropertyDeclaration */ + return member.kind === 151 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -57112,12 +58265,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -57270,7 +58423,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 150 /* PropertyDeclaration */ + ? member.kind === 151 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -57393,10 +58546,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 150 /* PropertyDeclaration */; + return kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 151 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -57406,7 +58559,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -57417,12 +58570,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; } return false; @@ -57434,15 +58587,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: - case 154 /* GetAccessor */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 155 /* GetAccessor */: return serializeTypeNode(node.type); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 153 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -57479,7 +58632,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 154 /* GetAccessor */) { + if (container && node.kind === 155 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -57525,26 +58678,26 @@ var ts; } switch (node.kind) { case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return ts.createVoidZero(); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createIdentifier("Function"); - case 165 /* ArrayType */: - case 166 /* TupleType */: + case 166 /* ArrayType */: + case 167 /* TupleType */: return ts.createIdentifier("Array"); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: case 122 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return ts.createIdentifier("String"); - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 174 /* LiteralType */: + case 177 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); @@ -57558,24 +58711,24 @@ var ts; break; } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return serializeTypeReferenceNode(node); - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: return serializeUnionOrIntersectionType(node); - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 164 /* TypeLiteral */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 165 /* TypeLiteral */: case 119 /* AnyKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -57589,13 +58742,13 @@ var ts; var serializedUnion; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -57676,7 +58829,7 @@ var ts; return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } return name; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -58251,12 +59404,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentScope.kind === 269 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentScope.kind === 272 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 233 /* EnumDeclaration */) { + if (node.kind === 236 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -58375,7 +59528,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 235 /* ModuleBlock */) { + if (body.kind === 238 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -58421,13 +59574,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 235 /* ModuleBlock */) { + if (body.kind !== 238 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -58468,7 +59621,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 241 /* NamespaceImport */) { + if (node.kind === 244 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -58700,16 +59853,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(71 /* Identifier */); - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(234 /* ModuleDeclaration */); + context.enableEmitNotification(237 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 234 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 237 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 233 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 236 /* EnumDeclaration */; } /** * Hook for node emit. @@ -58770,9 +59923,9 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -58810,9 +59963,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 269 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 234 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 233 /* EnumDeclaration */); + if (container && container.kind !== 272 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 237 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 236 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -58847,9 +60000,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } ts.transformTypeScript = transformTypeScript; @@ -58913,7 +60064,7 @@ var ts; ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); var compilerOptions = context.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -58927,6 +60078,7 @@ var ts; * just-in-time substitution for `super` expressions inside of async methods. */ var enclosingSuperContainerFlags = 0; + var enclosingFunctionParameterNames; // Save the previous transformation hooks. var previousOnEmitNode = context.onEmitNode; var previousOnSubstituteNode = context.onSubstituteNode; @@ -58950,20 +60102,97 @@ var ts; case 120 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); default: return ts.visitEachChild(node, visitor, context); } } + function asyncBodyVisitor(node) { + if (ts.isNodeWithPossibleHoistedDeclaration(node)) { + switch (node.kind) { + case 212 /* VariableStatement */: + return visitVariableStatementInAsyncBody(node); + case 218 /* ForStatement */: + return visitForStatementInAsyncBody(node); + case 219 /* ForInStatement */: + return visitForInStatementInAsyncBody(node); + case 220 /* ForOfStatement */: + return visitForOfStatementInAsyncBody(node); + case 267 /* CatchClause */: + return visitCatchClauseInAsyncBody(node); + case 211 /* Block */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 224 /* WithStatement */: + case 226 /* LabeledStatement */: + return ts.visitEachChild(node, asyncBodyVisitor, context); + default: + return ts.Debug.assertNever(node, "Unhandled node."); + } + } + return visitor(node); + } + function visitCatchClauseInAsyncBody(node) { + var catchClauseNames = ts.createUnderscoreEscapedMap(); + recordDeclarationName(node.variableDeclaration, catchClauseNames); + // names declared in a catch variable are block scoped + var catchClauseUnshadowedNames; + catchClauseNames.forEach(function (_, escapedName) { + if (enclosingFunctionParameterNames.has(escapedName)) { + if (!catchClauseUnshadowedNames) { + catchClauseUnshadowedNames = ts.cloneMap(enclosingFunctionParameterNames); + } + catchClauseUnshadowedNames.delete(escapedName); + } + }); + if (catchClauseUnshadowedNames) { + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = catchClauseUnshadowedNames; + var result = ts.visitEachChild(node, asyncBodyVisitor, context); + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; + } + else { + return ts.visitEachChild(node, asyncBodyVisitor, context); + } + } + function visitVariableStatementInAsyncBody(node) { + if (isVariableDeclarationListWithCollidingName(node.declarationList)) { + var expression = visitVariableDeclarationListWithCollidingNames(node.declarationList, /*hasReceiver*/ false); + return expression ? ts.createStatement(expression) : undefined; + } + return ts.visitEachChild(node, visitor, context); + } + function visitForInStatementInAsyncBody(node) { + return ts.updateForIn(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForOfStatementInAsyncBody(node) { + return ts.updateForOf(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForStatementInAsyncBody(node) { + return ts.updateFor(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ false) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } /** * Visits an AwaitExpression node. * @@ -59038,22 +60267,96 @@ var ts; ? transformAsyncFunctionBody(node) : ts.visitFunctionBody(node.body, visitor, context)); } + function recordDeclarationName(_a, names) { + var name = _a.name; + if (ts.isIdentifier(name)) { + names.set(name.escapedText, true); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + recordDeclarationName(element, names); + } + } + } + } + function isVariableDeclarationListWithCollidingName(node) { + return node + && ts.isVariableDeclarationList(node) + && !(node.flags & 3 /* BlockScoped */) + && ts.forEach(node.declarations, collidesWithParameterName); + } + function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { + hoistVariableDeclarationList(node); + var variables = ts.getInitializedVariables(node); + if (variables.length === 0) { + if (hasReceiver) { + return ts.visitNode(ts.convertToAssignmentElementTarget(node.declarations[0].name), visitor, ts.isExpression); + } + return undefined; + } + return ts.inlineExpressions(ts.map(variables, transformInitializedVariable)); + } + function hoistVariableDeclarationList(node) { + ts.forEach(node.declarations, hoistVariable); + } + function hoistVariable(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + hoistVariableDeclaration(name); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + hoistVariable(element); + } + } + } + } + function transformInitializedVariable(node) { + var converted = ts.setSourceMapRange(ts.createAssignment(ts.convertToAssignmentElementTarget(node.name), node.initializer), node); + return ts.visitNode(converted, visitor, ts.isExpression); + } + function collidesWithParameterName(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + return enclosingFunctionParameterNames.has(name.escapedText); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element) && collidesWithParameterName(element)) { + return true; + } + } + } + return false; + } function transformAsyncFunctionBody(node) { resumeLexicalEnvironment(); var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 188 /* ArrowFunction */; + var isArrowFunction = node.kind === 191 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current // `this` and `arguments` objects to `__awaiter`. The generator function // passed to `__awaiter` is executed inside of the callback to the // promise constructor. + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap(); + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + recordDeclarationName(parameter, enclosingFunctionParameterNames); + } + var result; if (!isArrowFunction) { var statements = []; var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset)))); ts.addRange(statements, endLexicalEnvironment()); var block = ts.createBlock(statements, /*multiLine*/ true); ts.setTextRange(block, node.body); @@ -59069,27 +60372,28 @@ var ts; ts.addEmitHelper(block, ts.asyncSuperHelper); } } - return block; + result = block; } else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body)); var declarations = endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + result = ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + else { + result = expression; } - return expression; } + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; } - function transformFunctionBodyWorker(body, start) { + function transformAsyncFunctionBodyWorker(body, start) { if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + return ts.updateBlock(body, ts.visitNodes(body.statements, asyncBodyVisitor, ts.isStatement, start)); } else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + return ts.convertToFunctionBody(ts.visitNode(body, asyncBodyVisitor, ts.isConciseBody)); } } function getPromiseConstructor(type) { @@ -59108,15 +60412,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -59156,11 +60460,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -59192,11 +60496,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -59294,45 +60598,45 @@ var ts; return node; } switch (node.kind) { - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitVoidExpression(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructorDeclaration(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -59353,21 +60657,21 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitLabeledStatement(node) { - if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 217 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 220 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } - return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); } return ts.visitEachChild(node, visitor, context); } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 267 /* SpreadAssignment */) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 270 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -59376,16 +60680,9 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === 265 /* PropertyAssignment */) { - var p = e; - chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); - } - else { - chunkObject.push(ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); - } + chunkObject = ts.append(chunkObject, e.kind === 268 /* PropertyAssignment */ + ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) + : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } } if (chunkObject) { @@ -59401,7 +60698,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 179 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 182 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -59709,15 +61006,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -59757,11 +61054,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -59793,11 +61090,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -59867,7 +61164,7 @@ var ts; var asyncValues = { name: "typescript:asyncValues", scoped: false, - text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + text: "\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " }; function createAsyncValuesHelper(context, expression, location) { context.requestEmitHelper(asyncValues); @@ -59909,13 +61206,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -59925,13 +61222,13 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -60005,7 +61302,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 260 /* JsxExpression */) { + else if (node.kind === 263 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -60099,7 +61396,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 250 /* JsxElement */) { + if (node.kind === 253 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -60407,7 +61704,7 @@ var ts; return node; } switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -60643,13 +61940,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ - && node.kind === 220 /* ReturnStatement */ + && node.kind === 223 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 208 /* Block */))) + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 211 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -60677,63 +61974,63 @@ var ts; switch (node.kind) { case 115 /* StaticKeyword */: return undefined; // elide static keyword - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return visitClassExpression(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); case 71 /* Identifier */: return visitIdentifier(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 13 /* NoSubstitutionTemplateLiteral */: case 14 /* TemplateHead */: @@ -60744,28 +62041,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitSpreadElement(node); case 97 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 99 /* ThisKeyword */: return visitThisKeyword(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitMetaProperty(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -60852,13 +62149,13 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 219 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 222 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -60869,7 +62166,7 @@ var ts; } } else { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { labelMarker = "break-" + node.label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(node.label), labelMarker); } @@ -61050,7 +62347,7 @@ var ts; */ function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getInternalName(node))), /*location*/ extendsClauseElement)); } } @@ -61169,17 +62466,17 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 220 /* ReturnStatement */) { + if (statement.kind === 223 /* ReturnStatement */) { return true; } - else if (statement.kind === 212 /* IfStatement */) { + else if (statement.kind === 215 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 208 /* Block */) { + else if (statement.kind === 211 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -61237,7 +62534,7 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + if (firstStatement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } @@ -61247,8 +62544,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 195 /* BinaryExpression */ - || superCallExpression.left.kind !== 182 /* CallExpression */) { + if (superCallExpression.kind !== 198 /* BinaryExpression */ + || superCallExpression.left.kind !== 185 /* CallExpression */) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } // Shift comments from the original super call to the return statement. @@ -61445,7 +62742,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 188 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 191 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -61465,22 +62762,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return statements; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 93 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -61512,20 +62809,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -61717,7 +63014,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 229 /* FunctionDeclaration */ || node.kind === 187 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 232 /* FunctionDeclaration */ || node.kind === 190 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); @@ -61765,7 +63062,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 188 /* ArrowFunction */); + ts.Debug.assert(node.kind === 191 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -61832,9 +63129,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -61853,9 +63150,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -62057,14 +63354,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -62234,7 +63531,7 @@ var ts; ])); } /** - * Visits an ObjectLiteralExpression with computed propety names. + * Visits an ObjectLiteralExpression with computed property names. * * @param node An ObjectLiteralExpression node. */ @@ -62252,7 +63549,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 145 /* ComputedPropertyName */) { + if (property.name.kind === 146 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -62324,11 +63621,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 231 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -62608,20 +63905,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -62731,7 +64028,7 @@ var ts; if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */) { var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -62909,49 +64206,54 @@ var ts; function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { // We are here either because SuperKeyword was used somewhere in the expression, or // because we contain a SpreadElementExpression. - var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - if (node.expression.kind === 97 /* SuperKeyword */) { - ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); + if (node.transformFlags & 524288 /* ContainsSpread */ || + node.expression.kind === 97 /* SuperKeyword */ || + ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) { + var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + if (node.expression.kind === 97 /* SuperKeyword */) { + ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); + } + var resultingCall = void 0; + if (node.transformFlags & 524288 /* ContainsSpread */) { + // [source] + // f(...a, b) + // x.m(...a, b) + // super(...a, b) + // super.m(...a, b) // in static + // super.m(...a, b) // in instance + // + // [output] + // f.apply(void 0, a.concat([b])) + // (_a = x).m.apply(_a, a.concat([b])) + // _super.apply(this, a.concat([b])) + // _super.m.apply(this, a.concat([b])) + // _super.prototype.m.apply(this, a.concat([b])) + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); + } + else { + // [source] + // super(a) + // super.m(a) // in static + // super.m(a) // in instance + // + // [output] + // _super.call(this, a) + // _super.m.call(this, a) + // _super.prototype.m.call(this, a) + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), + /*location*/ node); + } + if (node.expression.kind === 97 /* SuperKeyword */) { + var actualThis = ts.createThis(); + ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); + var initializer = ts.createLogicalOr(resultingCall, actualThis); + resultingCall = assignToCapturedThis + ? ts.createAssignment(ts.createIdentifier("_this"), initializer) + : initializer; + } + return ts.setOriginalNode(resultingCall, node); } - var resultingCall; - if (node.transformFlags & 524288 /* ContainsSpread */) { - // [source] - // f(...a, b) - // x.m(...a, b) - // super(...a, b) - // super.m(...a, b) // in static - // super.m(...a, b) // in instance - // - // [output] - // f.apply(void 0, a.concat([b])) - // (_a = x).m.apply(_a, a.concat([b])) - // _super.apply(this, a.concat([b])) - // _super.m.apply(this, a.concat([b])) - // _super.prototype.m.apply(this, a.concat([b])) - resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); - } - else { - // [source] - // super(a) - // super.m(a) // in static - // super.m(a) // in instance - // - // [output] - // _super.call(this, a) - // _super.m.call(this, a) - // _super.prototype.m.call(this, a) - resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), - /*location*/ node); - } - if (node.expression.kind === 97 /* SuperKeyword */) { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); - var initializer = ts.createLogicalOr(resultingCall, actualThis); - resultingCall = assignToCapturedThis - ? ts.createAssignment(ts.createIdentifier("_this"), initializer) - : initializer; - } - return ts.setOriginalNode(resultingCall, node); + return ts.visitEachChild(node, visitor, context); } /** * Visits a NewExpression that contains a spread element. @@ -63006,7 +64308,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 178 /* ArrayLiteralExpression */ + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 181 /* ArrayLiteralExpression */ ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -63269,13 +64571,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(99 /* ThisKeyword */); - context.enableEmitNotification(153 /* Constructor */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(188 /* ArrowFunction */); - context.enableEmitNotification(187 /* FunctionExpression */); - context.enableEmitNotification(229 /* FunctionDeclaration */); + context.enableEmitNotification(154 /* Constructor */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(191 /* ArrowFunction */); + context.enableEmitNotification(190 /* FunctionExpression */); + context.enableEmitNotification(232 /* FunctionDeclaration */); } } /** @@ -63317,10 +64619,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 230 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -63402,11 +64704,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 211 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 214 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 182 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 185 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -63414,7 +64716,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 199 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 202 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -63719,13 +65021,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -63738,24 +65040,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return visitBreakStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return visitContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -63776,21 +65078,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitConditionalExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -63803,9 +65105,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -64033,7 +65335,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -64045,7 +65347,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -64421,35 +65723,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 208 /* Block */: + case 211 /* Block */: return transformAndEmitBlock(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return transformAndEmitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return transformAndEmitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return transformAndEmitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return transformAndEmitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -64879,7 +66181,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 262 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 265 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -64892,13 +66194,12 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 261 /* CaseClause */) { - var caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (clause.kind === 264 /* CaseClause */) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } - pendingClauses.push(ts.createCaseClause(ts.visitNode(caseClause.expression, visitor, ts.isExpression), [ - createInlineBreak(clauseLabels[i], /*location*/ caseClause.expression) + pendingClauses.push(ts.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [ + createInlineBreak(clauseLabels[i], /*location*/ clause.expression) ])); } else { @@ -66038,8 +67339,8 @@ var ts; // `throw` methods that step through the generator when invoked. // // parameters: - // thisArg The value to use as the `this` binding for the transformed generator body. - // body A function that acts as the transformed generator body. + // @param thisArg The value to use as the `this` binding for the transformed generator body. + // @param body A function that acts as the transformed generator body. // // variables: // _ Persistent state for the generator that is shared between the helper and the @@ -66116,15 +67417,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(252 /* JsxOpeningElement */); - context.enableEmitNotification(253 /* JsxClosingElement */); - context.enableEmitNotification(251 /* JsxSelfClosingElement */); + context.enableEmitNotification(255 /* JsxOpeningElement */); + context.enableEmitNotification(256 /* JsxClosingElement */); + context.enableEmitNotification(254 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(265 /* PropertyAssignment */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(268 /* PropertyAssignment */); return transformSourceFile; /** * Transforms an ES5 source file to ES3. @@ -66143,9 +67444,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -66235,11 +67536,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -66331,7 +67632,7 @@ var ts; // Create an updated SourceFile: // // define(moduleName?, ["module1", "module2"], function ... - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(define, /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ // Add the dependency array argument: @@ -66356,6 +67657,8 @@ var ts; ]))) ]), /*location*/ node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } /** * Transforms a SourceFile into a UMD module. @@ -66406,7 +67709,7 @@ var ts; // define(["require", "exports"], factory); // } // })(function ...) - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(umdHeader, /*typeArguments*/ undefined, [ // Add the module body function argument: @@ -66424,6 +67727,8 @@ var ts; ])) ]), /*location*/ node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } /** * Collect the additional asynchronous dependencies for the module. @@ -66475,6 +67780,17 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } + function getAMDImportExpressionForImport(node) { + if (ts.isImportEqualsDeclaration(node) || ts.isExportDeclaration(node) || !ts.getExternalModuleNameLiteral(node, currentSourceFile, host, resolver, compilerOptions)) { + return undefined; + } + var name = ts.getLocalNameForExternalImport(node, currentSourceFile); + var expr = getHelperExpressionForImport(node, name); + if (expr === name) { + return undefined; + } + return ts.createStatement(ts.createAssignment(name, expr)); + } /** * Transforms a SourceFile into an AMD or UMD module body. * @@ -66489,6 +67805,9 @@ var ts; } // Visit each statement of the module body. ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + if (moduleKind === ts.ModuleKind.AMD) { + ts.addRange(statements, ts.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); + } ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); // Append the 'export =' statement if provided. addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); @@ -66543,23 +67862,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, importCallExpressionVisitor, context); @@ -66660,7 +67979,12 @@ var ts; ts.setEmitFlags(func, 8 /* CapturesThis */); } } - return ts.createNew(ts.createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); + var promise = ts.createNew(ts.createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.createPropertyAccess(promise, ts.createIdentifier("then")), /*typeArguments*/ undefined, [ts.getHelperName("__importStar")]); + } + return promise; } function createImportCallExpressionCommonJS(arg, containsLexicalThis) { // import("./blah") @@ -66670,6 +67994,10 @@ var ts; // if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately var promiseResolveCall = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []); var requireCall = ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, arg ? [arg] : []); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + requireCall = ts.createCall(ts.getHelperName("__importStar"), /*typeArguments*/ undefined, [requireCall]); + } var func; if (languageVersion >= 2 /* ES2015 */) { func = ts.createArrowFunction( @@ -66696,6 +68024,20 @@ var ts; } return ts.createCall(ts.createPropertyAccess(promiseResolveCall, "then"), /*typeArguments*/ undefined, [func]); } + function getHelperExpressionForImport(node, innerExpr) { + if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) { + return innerExpr; + } + if (ts.getImportNeedsImportStarHelper(node)) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.getHelperName("__importStar"), /*typeArguments*/ undefined, [innerExpr]); + } + if (ts.getImportNeedsImportDefaultHelper(node)) { + context.requestEmitHelper(importDefaultHelper); + return ts.createCall(ts.getHelperName("__importDefault"), /*typeArguments*/ undefined, [innerExpr]); + } + return innerExpr; + } /** * Visits an ImportDeclaration node. * @@ -66714,7 +68056,7 @@ var ts; if (namespaceDeclaration && !ts.isDefaultImport(node)) { // import * as n from "mod"; variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, createRequireCall(node))); + /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node)))); } else { // import d from "mod"; @@ -66722,7 +68064,7 @@ var ts; // import d, { x, y } from "mod"; // import d, * as n from "mod"; variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), - /*type*/ undefined, createRequireCall(node))); + /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node)))); if (namespaceDeclaration && ts.isDefaultImport(node)) { variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), /*type*/ undefined, ts.getGeneratedNameForNode(node))); @@ -66985,7 +68327,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -67040,10 +68382,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -67242,7 +68584,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -67306,10 +68648,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -67330,7 +68672,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -67405,7 +68747,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 /* PlusPlusToken */ ? 59 /* PlusEqualsToken */ : 60 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -67455,6 +68797,18 @@ var ts; scoped: true, text: "\n var __syncRequire = typeof module === \"object\" && typeof module.exports === \"object\";" }; + // emit helper for `import * as Name from "foo"` + var importStarHelper = { + name: "typescript:commonjsimportstar", + scoped: false, + text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n}" + }; + // emit helper for `import Name from "foo"` + var importDefaultHelper = { + name: "typescript:commonjsimportdefault", + scoped: false, + text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n}" + }; })(ts || (ts = {})); /// /// @@ -67472,10 +68826,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -67696,7 +69051,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 245 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 248 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -67721,15 +69076,14 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 245 /* ExportDeclaration */) { + if (externalImport.kind !== 248 /* ExportDeclaration */) { continue; } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { // export * from ... continue; } - for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { + for (var _f = 0, _g = externalImport.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; // write name of indirectly exported entry, i.e. 'export {x} from ...' exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(ts.idText(element.name || element.propertyName)), ts.createTrue())); @@ -67791,28 +69145,28 @@ var ts; function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { - var group = dependencyGroups_1[_i]; + var group_1 = dependencyGroups_1[_i]; // derive a unique name for parameter from the first named entry in the group - var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); + var localName = ts.forEach(group_1.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName(""); var statements = []; - for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) { + for (var _a = 0, _b = group_1.externalImports; _a < _b.length; _a++) { var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -67862,15 +69216,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -68046,7 +69400,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 269 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 272 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -68110,7 +69464,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -68166,10 +69520,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -68349,43 +69703,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitDefaultClause(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitTryStatement(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -68571,7 +69925,7 @@ var ts; */ function destructuringAndImportCallVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 195 /* BinaryExpression */) { + && node.kind === 198 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (ts.isImportCall(node)) { @@ -68636,7 +69990,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 269 /* SourceFile */; + return container !== undefined && container.kind === 272 /* SourceFile */; } else { return false; @@ -68669,7 +70023,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -68705,6 +70059,43 @@ var ts; if (hint === 1 /* Expression */) { return substituteExpression(node); } + else if (hint === 4 /* Unspecified */) { + return substituteUnspecified(node); + } + return node; + } + /** + * Substitute the node, if necessary. + * + * @param node The node to substitute. + */ + function substituteUnspecified(node) { + switch (node.kind) { + case 269 /* ShorthandPropertyAssignment */: + return substituteShorthandPropertyAssignment(node); + } + return node; + } + /** + * Substitution for a ShorthandPropertyAssignment whose name that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + if (!ts.isGeneratedIdentifier(name) && !ts.isLocalName(name)) { + var importDeclaration = resolver.getReferencedImportDeclaration(name); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"))), + /*location*/ node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name))), + /*location*/ node); + } + } + } return node; } /** @@ -68716,10 +70107,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -68812,14 +70203,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 194 /* PostfixUnaryExpression */) { + if (node.kind === 197 /* PostfixUnaryExpression */) { expression = node.operator === 43 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -68841,7 +70232,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -68882,7 +70273,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(269 /* SourceFile */); + context.enableEmitNotification(272 /* SourceFile */); context.enableSubstitution(71 /* Identifier */); var currentSourceFile; return transformSourceFile; @@ -68895,9 +70286,11 @@ var ts; if (externalHelpersModuleName) { var statements = []; var statementOffset = ts.addPrologue(statements, node.statements); - ts.append(statements, ts.createImportDeclaration( + var tslibImport = ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); + ts.addEmitFlags(tslibImport, 67108864 /* NeverApplyImportHelper */); + ts.append(statements, tslibImport); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } @@ -68909,10 +70302,10 @@ var ts; } function visitor(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); } return node; @@ -69052,7 +70445,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(296 /* Count */); + var enabledSyntaxKindFeatures = new Array(299 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -69320,8 +70713,8 @@ var ts; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -69395,7 +70788,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 239 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 242 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -69412,8 +70805,8 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } - if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { - // if file was external module with augmentations - this fact should be preserved in .d.ts as well. + if (!isBundledEmit && ts.isExternalModule(sourceFile) && !resultHasExternalModuleIndicator) { + // if file was external module this fact should be preserved in .d.ts as well. // in case if we didn't write any external module specifiers in .d.ts we need to emit something // that will force compiler to think that this file is an external module - 'export {}' is a reasonable choice here. write("export {};"); @@ -69472,10 +70865,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 227 /* VariableDeclaration */) { + if (declaration.kind === 230 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 242 /* NamedImports */ || declaration.kind === 243 /* ImportSpecifier */ || declaration.kind === 240 /* ImportClause */) { + else if (declaration.kind === 245 /* NamedImports */ || declaration.kind === 246 /* ImportSpecifier */ || declaration.kind === 243 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -69493,7 +70886,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 239 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 242 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -69503,12 +70896,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -69582,7 +70975,7 @@ var ts; // for optional parameter properties // and also for non-optional initialized parameters that aren't a parameter property // these types may need to add `undefined`. - var shouldUseResolverType = declaration.kind === 147 /* Parameter */ && + var shouldUseResolverType = declaration.kind === 148 /* Parameter */ && (resolver.isRequiredInitializedParameter(declaration) || resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { @@ -69591,9 +70984,9 @@ var ts; } else { errorNameNode = declaration.name; - var format = 4 /* UseTypeOfFunction */ | - 16384 /* WriteClassExpressionAsTypeLiteral */ | - (shouldUseResolverType ? 8192 /* AddUndefined */ : 0); + var format = 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | + 2048 /* WriteClassExpressionAsTypeLiteral */ | + (shouldUseResolverType ? 131072 /* AddUndefined */ : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } @@ -69607,7 +71000,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 2048 /* WriteClassExpressionAsTypeLiteral */, writer); errorNameNode = undefined; } } @@ -69648,50 +71041,54 @@ var ts; function emitType(type) { switch (type.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 134 /* ObjectKeyword */: - case 137 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 170 /* ThisType */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 173 /* ThisType */: + case 177 /* LiteralType */: return writeTextOfNode(currentText, type); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(type); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(type); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(type); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(type); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(type); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(type); + case 171 /* InferType */: + return emitInferType(type); + case 172 /* ParenthesizedType */: return emitParenType(type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(type); case 71 /* Identifier */: return emitEntityName(type); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitEntityName(type); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -69699,8 +71096,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 144 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 144 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 145 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 145 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -69709,14 +71106,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 238 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 241 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -69757,6 +71154,22 @@ var ts; function emitIntersectionType(type) { emitSeparatedList(type.types, " & ", emitType); } + function emitConditionalType(node) { + emitType(node.checkType); + write(" extends "); + emitType(node.extendsType); + write(" ? "); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node.trueType; + emitType(node.trueType); + enclosingDeclaration = prevEnclosingDeclaration; + write(" : "); + emitType(node.falseType); + } + function emitInferType(node) { + write("infer "); + writeTextOfNode(currentText, node.typeParameter.name); + } function emitParenType(type) { write("("); emitType(type.type); @@ -69780,7 +71193,9 @@ var ts; writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === 37 /* PlusToken */ ? "+readonly " : + node.readonlyToken.kind === 38 /* MinusToken */ ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -69788,7 +71203,9 @@ var ts; emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === 37 /* PlusToken */ ? "+?" : + node.questionToken.kind === 38 /* MinusToken */ ? "-?" : + "?"); } write(": "); emitType(node.type); @@ -69845,12 +71262,15 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 2048 /* WriteClassExpressionAsTypeLiteral */, writer); write(";"); writeLine(); return tempVarName; } function emitExportAssignment(node) { + if (ts.isSourceFile(node.parent)) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators + } if (node.expression.kind === 71 /* Identifier */) { write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentText, node.expression); @@ -69879,10 +71299,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 238 /* ImportEqualsDeclaration */ || - (node.parent.kind === 269 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 241 /* ImportEqualsDeclaration */ || + (node.parent.kind === 272 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 269 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 272 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -69892,7 +71312,7 @@ var ts; }); } else { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -69910,23 +71330,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return writeVariableStatement(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return writeClassDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -69934,16 +71354,17 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 272 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators write("export "); } if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 231 /* InterfaceDeclaration */ && needsDeclare) { + else if (node.kind !== 234 /* InterfaceDeclaration */ && needsDeclare) { write("declare "); } } @@ -69995,11 +71416,11 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); + return namedBindings.elements.some(function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } } } @@ -70019,7 +71440,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 244 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -70040,19 +71461,9 @@ var ts; // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 234 /* ModuleDeclaration */; - var moduleSpecifier; - if (parent.kind === 238 /* ImportEqualsDeclaration */) { - var node = parent; - moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === 234 /* ModuleDeclaration */) { - moduleSpecifier = parent.name; - } - else { - var node = parent; - moduleSpecifier = node.moduleSpecifier; - } + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 237 /* ModuleDeclaration */; + var moduleSpecifier = parent.kind === 241 /* ImportEqualsDeclaration */ ? ts.getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === 237 /* ModuleDeclaration */ ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === 9 /* StringLiteral */ && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -70079,6 +71490,7 @@ var ts; writeAsynchronousModuleElements(nodes); } function emitExportDeclaration(node) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators emitJsDocComments(node); write("export "); if (node.exportClause) { @@ -70116,7 +71528,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 235 /* ModuleBlock */) { + while (node.body && node.body.kind !== 238 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -70186,7 +71598,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 152 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 153 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -70197,15 +71609,15 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.constraint); } else { @@ -70214,15 +71626,15 @@ var ts; } if (node.default && !isPrivateMethodTypeParameter(node)) { write(" = "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.default); } else { @@ -70233,34 +71645,34 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -70294,7 +71706,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + if (node.parent.parent.kind === 233 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -70333,7 +71745,7 @@ var ts; diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: baseTypeNode, typeName: node.name - }, !ts.findAncestor(node, function (n) { return n.kind === 234 /* ModuleDeclaration */; })); + }, !ts.findAncestor(node, function (n) { return n.kind === 237 /* ModuleDeclaration */; })); } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -70408,7 +71820,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 227 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { + if (node.kind !== 230 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -70416,11 +71828,11 @@ var ts; writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */) && node.parent.kind === 164 /* TypeLiteral */) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */) && node.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -70433,15 +71845,15 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -70450,7 +71862,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */ || node.kind === 147 /* Parameter */) { + else if (node.parent.kind === 233 /* ClassDeclaration */ || node.kind === 148 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70482,7 +71894,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 201 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { + if (element.kind !== 204 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { elements.push(element); } } @@ -70512,7 +71924,7 @@ var ts; // if this is property of type literal, // or is parameter of method/call/construct/index signature of type literal // emit only if type is specified - if (node.type) { + if (ts.hasType(node)) { write(": "); emitType(node.type); } @@ -70556,7 +71968,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 154 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 155 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -70569,7 +71981,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 154 /* GetAccessor */ + return accessor.kind === 155 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -70592,7 +72004,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70607,7 +72019,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 155 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 156 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(accessorWithTypeAnnotation, 32 /* Static */)) { @@ -70652,17 +72064,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 152 /* MethodDeclaration */ || node.kind === 153 /* Constructor */) { + else if (node.kind === 153 /* MethodDeclaration */ || node.kind === 154 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 153 /* Constructor */) { + else if (node.kind === 154 /* Constructor */) { write("constructor"); } else { @@ -70689,7 +72101,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70733,22 +72145,22 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 153 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { + if (node.kind === 154 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { write("();"); writeLine(); return; } // Construct signature or constructor type write new Signature - if (node.kind === 157 /* ConstructSignature */ || node.kind === 162 /* ConstructorType */) { + if (node.kind === 158 /* ConstructSignature */ || node.kind === 163 /* ConstructorType */) { write("new "); } - else if (node.kind === 161 /* FunctionType */) { + else if (node.kind === 162 /* FunctionType */) { var currentOutput = writer.getText(); // Do not generate incorrect type when function type with type parameters is type argument // This could happen if user used space between two '<' making it error free @@ -70763,22 +72175,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 161 /* FunctionType */ || node.kind === 162 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 164 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 162 /* FunctionType */ || node.kind === 163 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 165 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 153 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 154 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -70792,26 +72204,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -70819,7 +72231,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -70833,7 +72245,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -70868,9 +72280,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.parent.kind === 164 /* TypeLiteral */) { + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -70886,29 +72298,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -70916,7 +72328,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70929,7 +72341,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70941,12 +72353,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 178 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 179 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -70957,16 +72369,17 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 201 /* OmittedExpression */) { + if (bindingElement.kind === 204 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) // Example: // original: function foo([, x, ,]) {} + // tslint:disable-next-line no-double-space // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 177 /* BindingElement */) { + else if (bindingElement.kind === 180 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -71005,40 +72418,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return writeFunctionDeclaration(node); - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return emitPropertyDeclaration(node); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return emitSourceFile(node); } } @@ -71066,7 +72479,7 @@ var ts; return addedBundledEmitReference; function getDeclFileName(emitFileNames, sourceFileOrBundle) { // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -71080,8 +72493,8 @@ var ts; function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; - if (!emitSkipped) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + if (!emitSkipped || emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -71191,7 +72604,7 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (sourceFileOrBundle.kind === 269 /* SourceFile */) { + if (sourceFileOrBundle.kind === 272 /* SourceFile */) { // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); @@ -71336,7 +72749,7 @@ var ts; source = undefined; if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(skipSourceTrivia(pos)); @@ -71353,7 +72766,7 @@ var ts; } if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -71370,9 +72783,9 @@ var ts; * @param tokenStartPos The start pos of the token. * @param emitCallback The callback used to emit the token. */ - function emitTokenWithSourceMap(node, token, tokenPos, emitCallback) { + function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) { if (disabled) { - return emitCallback(token, tokenPos); + return emitCallback(token, writer, tokenPos); } var emitNode = node && node.emitNode; var emitFlags = emitNode && emitNode.flags; @@ -71381,7 +72794,7 @@ var ts; if ((emitFlags & 128 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) { emitPos(tokenPos); } - tokenPos = emitCallback(token, tokenPos); + tokenPos = emitCallback(token, writer, tokenPos); if (range) tokenPos = range.end; if ((emitFlags & 256 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) { @@ -71406,7 +72819,7 @@ var ts; var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, /*isAbsolutePathAnUrl*/ true); - sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source); if (sourceMapSourceIndex === -1) { sourceMapSourceIndex = sourceMapData.sourceMapSources.length; sourceMapData.sourceMapSources.push(source); @@ -71530,7 +72943,7 @@ var ts; if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 291 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 294 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 10 /* JsxText */; @@ -71551,7 +72964,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -71847,7 +73260,6 @@ var ts; /// var ts; (function (ts) { - var delimiters = createDelimiterMap(); var brackets = createBracketsMap(); /*@internal*/ /** @@ -71867,7 +73279,10 @@ var ts; var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" /* Dts */ : ""; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + if (result) { + return result; + } } } else { @@ -71876,7 +73291,10 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = !ts.isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + if (result) { + return result; + } } } } @@ -71902,7 +73320,7 @@ var ts; return ".js" /* Js */; } function getOriginalSourceFileOrBundle(sourceFileOrBundle) { - if (sourceFileOrBundle.kind === 270 /* Bundle */) { + if (sourceFileOrBundle.kind === 273 /* Bundle */) { return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, ts.getOriginalSourceFile)); } return ts.getOriginalSourceFile(sourceFileOrBundle); @@ -71955,7 +73373,7 @@ var ts; function emitSourceFileOrBundle(_a, sourceFileOrBundle) { var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; // Make sure not to write js file and source map file if any of them cannot be written - if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit && !compilerOptions.emitDeclarationOnly) { if (!emitOnlyDtsFiles) { printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } @@ -71979,8 +73397,8 @@ var ts; } } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { - var bundle = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 269 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 272 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); if (bundle) { @@ -72009,7 +73427,7 @@ var ts; ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); // Reset state sourceMap.reset(); - writer.reset(); + writer.clear(); currentSourceFile = undefined; bundledHelpers = undefined; isOwnFileEmit = false; @@ -72020,7 +73438,7 @@ var ts; } function emitHelpers(node, writeLines) { var helpersEmitted = false; - var bundle = node.kind === 270 /* Bundle */ ? node : undefined; + var bundle = node.kind === 273 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -72075,16 +73493,29 @@ var ts; var generatedNames; // Set of names generated by the NameGenerator. var tempFlagsStack; // Stack of enclosing name generation scopes. var tempFlags; // TempFlags for the current name generation scope. + var reservedNamesStack; // Stack of TempFlags reserved in enclosing name generation scopes. + var reservedNames; // TempFlags to reserve in nested name generation scopes. var writer; var ownWriter; + var write = writeBase; + var commitPendingSemicolon = ts.noop; + var writeSemicolon = writeSemicolonInternal; + var pendingSemicolon = false; + if (printerOptions.omitTrailingSemicolon) { + commitPendingSemicolon = commitPendingSemicolonInternal; + writeSemicolon = deferWriteSemicolon; + } + var syntheticParent = { pos: -1, end: -1 }; reset(); return { // public API printNode: printNode, + printList: printList, printFile: printFile, printBundle: printBundle, // internal API writeNode: writeNode, + writeList: writeList, writeFile: writeFile, writeBundle: writeBundle }; @@ -72101,12 +73532,16 @@ var ts; break; } switch (node.kind) { - case 269 /* SourceFile */: return printFile(node); - case 270 /* Bundle */: return printBundle(node); + case 272 /* SourceFile */: return printFile(node); + case 273 /* Bundle */: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); } + function printList(format, nodes, sourceFile) { + writeList(format, nodes, sourceFile, beginPrint()); + return endPrint(); + } function printBundle(bundle) { writeBundle(bundle, beginPrint()); return endPrint(); @@ -72122,6 +73557,16 @@ var ts; reset(); writer = previousWriter; } + function writeList(format, nodes, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList(syntheticParent, nodes, format); + reset(); + writer = previousWriter; + } function writeBundle(bundle, output) { var previousWriter = writer; setWriter(output); @@ -72149,7 +73594,7 @@ var ts; } function endPrint() { var text = ownWriter.getText(); - ownWriter.reset(); + ownWriter.clear(); return text; } function print(hint, node, sourceFile) { @@ -72175,6 +73620,7 @@ var ts; generatedNames = ts.createMap(); tempFlagsStack = []; tempFlags = 0 /* Auto */; + reservedNamesStack = []; comments.reset(); setWriter(/*output*/ undefined); } @@ -72238,7 +73684,9 @@ var ts; } function emitMappedTypeParameter(node) { emit(node.name); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emit(node.constraint); } function pipelineEmitUnspecified(node) { @@ -72247,7 +73695,7 @@ var ts; // Strict mode reserved words // Contextual keywords if (ts.isKeyword(kind)) { - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; } switch (kind) { @@ -72261,222 +73709,226 @@ var ts; return emitIdentifier(node); // Parse tree nodes // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitQualifiedName(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return emitTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return emitParameter(node); - case 148 /* Decorator */: + case 149 /* Decorator */: return emitDecorator(node); // Type members - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return emitPropertySignature(node); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return emitMethodSignature(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return emitConstructor(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return emitCallSignature(node); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return emitConstructSignature(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return emitIndexSignature(node); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(node); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return emitFunctionType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return emitConstructorType(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(node); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(node); + case 171 /* InferType */: + return emitInferType(node); + case 172 /* ParenthesizedType */: return emitParenthesizedType(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return emitThisType(); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return emitLiteralType(node); - case 272 /* JSDocAllType */: + case 275 /* JSDocAllType */: write("*"); return; - case 273 /* JSDocUnknownType */: + case 276 /* JSDocUnknownType */: write("?"); return; - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return emitJSDocVariadicType(node); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return emitBindingElement(node); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return emitTemplateSpan(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 208 /* Block */: + case 211 /* Block */: return emitBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitVariableStatement(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: return emitEmptyStatement(); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return emitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return emitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return emitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return emitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return emitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return emitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return emitForOfStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return emitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return emitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return emitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return emitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return emitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return emitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return emitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return emitTryStatement(node); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return emitClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return emitModuleBlock(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return emitCaseBlock(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return emitImportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return emitImportClause(node); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return emitNamespaceImport(node); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return emitNamedImports(node); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return emitImportSpecifier(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return emitNamedExports(node); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return emitExportSpecifier(node); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 252 /* JsxOpeningElement */: - case 255 /* JsxOpeningFragment */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 253 /* JsxClosingElement */: - case 256 /* JsxClosingFragment */: + case 256 /* JsxClosingElement */: + case 259 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return emitJsxAttribute(node); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return emitJsxAttributes(node); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return emitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return emitDefaultClause(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return emitHeritageClause(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMember(node); } // If the node is an expression, try to emit it as an expression with @@ -72485,7 +73937,7 @@ var ts; return pipelineEmitExpression(trySubstituteNode(1 /* Expression */, node)); } if (ts.isToken(node)) { - writeTokenNode(node); + writeTokenNode(node, writePunctuation); return; } } @@ -72509,74 +73961,74 @@ var ts; case 101 /* TrueKeyword */: case 99 /* ThisKeyword */: case 91 /* ImportKeyword */: - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; // Expressions - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return emitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return emitNewExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return emitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return emitArrowFunction(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return emitDeleteExpression(node); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return emitVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return emitAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return emitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return emitConditionalExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return emitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return emitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return emitSpreadExpression(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return emitClassExpression(node); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: return emitAsExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return emitNonNullExpression(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return emitJsxElement(node); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return emitCommaList(node); } } @@ -72605,25 +74057,27 @@ var ts; var text = getLiteralTextOfNode(node); if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { - writer.writeLiteral(text); + writeLiteral(text); } else { - write(text); + // Quick info expects all literals to be called with writeStringLiteral, as there's no specific type for numberLiterals + writeStringLiteral(text); } } // // Identifiers // function emitIdentifier(node) { - write(getTextOfNode(node, /*includeTrivia*/ false)); - emitTypeArguments(node, node.typeArguments); + var writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode(node, /*includeTrivia*/ false), node.symbol); + emitList(node, node.typeArguments, 26896 /* TypeParameters */); // Call emitList directly since it could be an array of TypeParameterDeclarations _or_ type arguments } // // Names // function emitQualifiedName(node) { emitEntityName(node.left); - write("."); + writePunctuation("."); emit(node.right); } function emitEntityName(node) { @@ -72635,36 +74089,46 @@ var ts; } } function emitComputedPropertyName(node) { - write("["); + writePunctuation("["); emitExpression(node.expression); - write("]"); + writePunctuation("]"); } // // Signature elements // function emitTypeParameter(node) { emit(node.name); - emitWithPrefix(" extends ", node.constraint); - emitWithPrefix(" = ", node.default); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit(node.default); + } } function emitParameter(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitIfPresent(node.dotDotDotToken); if (node.name) { - emit(node.name); + emitNodeWithWriter(node.name, writeParameter); } emitIfPresent(node.questionToken); - if (node.parent && node.parent.kind === 277 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 280 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitDecorator(decorator) { - write("@"); + writePunctuation("@"); emitExpression(decorator.expression); } // @@ -72673,19 +74137,19 @@ var ts; function emitPropertySignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - emit(node.name); + emitNodeWithWriter(node.name, writeProperty); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitPropertyDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); - write(";"); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); + writeSemicolon(); } function emitMethodSignature(node) { emitDecorators(node, node.decorators); @@ -72694,8 +74158,8 @@ var ts; emitIfPresent(node.questionToken); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitMethodDeclaration(node) { emitDecorators(node, node.decorators); @@ -72707,13 +74171,14 @@ var ts; } function emitConstructor(node) { emitModifiers(node, node.modifiers); - write("constructor"); + writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 154 /* GetAccessor */ ? "get " : "set "); + writeKeyword(node.kind === 155 /* GetAccessor */ ? "get" : "set"); + writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -72722,34 +74187,37 @@ var ts; emitModifiers(node, node.modifiers); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitConstructSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitIndexSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitParametersForIndexSignature(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitSemicolonClassElement() { - write(";"); + writeSemicolon(); } // // Types // function emitTypePredicate(node) { emit(node.parameterName); - write(" is "); + writeSpace(); + writeKeyword("is"); + writeSpace(); emit(node.type); } function emitTypeReference(node) { @@ -72759,7 +74227,9 @@ var ts; function emitFunctionType(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitJSDocFunctionType(node) { @@ -72781,34 +74251,39 @@ var ts; write("="); } function emitConstructorType(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitTypeQuery(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emit(node.exprName); } function emitTypeLiteral(node) { - write("{"); + writePunctuation("{"); var flags = ts.getEmitFlags(node) & 1 /* SingleLine */ ? 448 /* SingleLineTypeLiteralMembers */ : 65 /* MultiLineTypeLiteralMembers */; emitList(node, node.members, flags | 262144 /* NoSpaceIfEmpty */); - write("}"); + writePunctuation("}"); } function emitArrayType(node) { emit(node.elementType); - write("[]"); + writePunctuation("["); + writePunctuation("]"); } function emitJSDocVariadicType(node) { write("..."); emit(node.type); } function emitTupleType(node) { - write("["); + writePunctuation("["); emitList(node, node.elementTypes, 336 /* TupleTypeElements */); - write("]"); + writePunctuation("]"); } function emitUnionType(node) { emitList(node, node.types, 260 /* UnionTypeConstituents */); @@ -72816,30 +74291,50 @@ var ts; function emitIntersectionType(node) { emitList(node, node.types, 264 /* IntersectionTypeConstituents */); } + function emitConditionalType(node) { + emit(node.checkType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } function emitParenthesizedType(node) { - write("("); + writePunctuation("("); emit(node.type); - write(")"); + writePunctuation(")"); } function emitThisType() { - write("this"); + writeKeyword("this"); } function emitTypeOperator(node) { - writeTokenText(node.operator); - write(" "); + writeTokenText(node.operator, writeKeyword); + writeSpace(); emit(node.type); } function emitIndexedAccessType(node) { emit(node.objectType); - write("["); + writePunctuation("["); emit(node.indexType); - write("]"); + writePunctuation("]"); } function emitMappedType(node) { var emitFlags = ts.getEmitFlags(node); - write("{"); + writePunctuation("{"); if (emitFlags & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); @@ -72847,23 +74342,32 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - write(" "); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + writeKeyword("readonly"); + } + writeSpace(); } - write("["); + writePunctuation("["); pipelineEmitWithNotification(3 /* MappedTypeParameter */, node.typeParameter); - write("]"); - emitIfPresent(node.questionToken); - write(": "); + writePunctuation("]"); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); if (emitFlags & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); decreaseIndent(); } - write("}"); + writePunctuation("}"); } function emitLiteralType(node) { emitExpression(node.literal); @@ -72872,32 +74376,24 @@ var ts; // Binding patterns // function emitObjectBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("{}"); - } - else { - write("{"); - emitList(node, elements, 432 /* ObjectBindingPatternElements */); - write("}"); - } + writePunctuation("{"); + emitList(node, node.elements, 262576 /* ObjectBindingPatternElements */); + writePunctuation("}"); } function emitArrayBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("[]"); - } - else { - write("["); - emitList(node, node.elements, 304 /* ArrayBindingPatternElements */); - write("]"); - } + writePunctuation("["); + emitList(node, node.elements, 262448 /* ArrayBindingPatternElements */); + writePunctuation("]"); } function emitBindingElement(node) { - emitWithSuffix(node.propertyName, ": "); emitIfPresent(node.dotDotDotToken); + if (node.propertyName) { + emit(node.propertyName); + writePunctuation(":"); + writeSpace(); + } emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } // // Expressions @@ -72934,7 +74430,7 @@ var ts; emitExpression(node.expression); increaseIndentIf(indentBeforeDot); var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - write(shouldEmitDotDot ? ".." : "."); + writePunctuation(shouldEmitDotDot ? ".." : "."); increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -72960,9 +74456,9 @@ var ts; } function emitElementAccessExpression(node) { emitExpression(node.expression); - write("["); + writePunctuation("["); emitExpression(node.argumentExpression); - write("]"); + writePunctuation("]"); } function emitCallExpression(node) { emitExpression(node.expression); @@ -72970,26 +74466,27 @@ var ts; emitExpressionList(node, node.arguments, 1296 /* CallExpressionArguments */); } function emitNewExpression(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); emitExpressionList(node, node.arguments, 9488 /* NewExpressionArguments */); } function emitTaggedTemplateExpression(node) { emitExpression(node.tag); - write(" "); + writeSpace(); emitExpression(node.template); } function emitTypeAssertionExpression(node) { - write("<"); + writePunctuation("<"); emit(node.type); - write(">"); + writePunctuation(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { - write("("); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } function emitFunctionExpression(node) { emitFunctionDeclarationOrExpression(node); @@ -73002,30 +74499,34 @@ var ts; function emitArrowFunctionHead(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - emitWithPrefix(": ", node.type); - write(" "); + emitTypeAnnotation(node.type); + writeSpace(); emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - write("delete "); + writeKeyword("delete"); + writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - write("void "); + writeKeyword("void"); + writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - write("await "); + writeKeyword("await"); + writeSpace(); emitExpression(node.expression); } function emitPrefixUnaryExpression(node) { - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); if (shouldEmitWhitespaceBeforeOperand(node)) { - write(" "); + writeSpace(); } emitExpression(node.operand); } @@ -73043,13 +74544,13 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 193 /* PrefixUnaryExpression */ + return operand.kind === 196 /* PrefixUnaryExpression */ && ((node.operator === 37 /* PlusToken */ && (operand.operator === 37 /* PlusToken */ || operand.operator === 43 /* PlusPlusToken */)) || (node.operator === 38 /* MinusToken */ && (operand.operator === 38 /* MinusToken */ || operand.operator === 44 /* MinusMinusToken */))); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand); - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); } function emitBinaryExpression(node) { var isCommaOperator = node.operatorToken.kind !== 26 /* CommaToken */; @@ -73058,7 +74559,7 @@ var ts; emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); emitLeadingCommentsOfPosition(node.operatorToken.pos); - writeTokenNode(node.operatorToken); + writeTokenNode(node.operatorToken, writeOperator); emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); @@ -73086,12 +74587,12 @@ var ts; emitList(node, node.templateSpans, 131072 /* TemplateExpressionSpans */); } function emitYieldExpression(node) { - write("yield"); + writeKeyword("yield"); emit(node.asteriskToken); - emitExpressionWithPrefix(" ", node.expression); + emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } function emitClassExpression(node) { @@ -73104,17 +74605,19 @@ var ts; function emitAsExpression(node) { emitExpression(node.expression); if (node.type) { - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.type); } } function emitNonNullExpression(node) { emitExpression(node.expression); - write("!"); + writeOperator("!"); } function emitMetaProperty(node) { - writeToken(node.keywordToken, node.pos); - write("."); + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); emit(node.name); } // @@ -73128,13 +74631,13 @@ var ts; // Statements // function emitBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos, /*contextNode*/ node); + writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node); emitBlockStatements(node, /*forceSingleLine*/ !node.multiLine && isEmptyBlock(node)); // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted increaseIndent(); emitLeadingCommentsOfPosition(node.statements.end); decreaseIndent(); - writeToken(18 /* CloseBraceToken */, node.statements.end, /*contextNode*/ node); + writeToken(18 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node); } function emitBlockStatements(node, forceSingleLine) { var format = forceSingleLine || ts.getEmitFlags(node) & 1 /* SingleLine */ ? 384 /* SingleLineBlockStatements */ : 65 /* MultiLineBlockStatements */; @@ -73143,27 +74646,27 @@ var ts; function emitVariableStatement(node) { emitModifiers(node, node.modifiers); emit(node.declarationList); - write(";"); + writeSemicolon(); } function emitEmptyStatement() { - write(";"); + writeSemicolon(); } function emitExpressionStatement(node) { emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitIfStatement(node) { - var openParenPos = writeToken(90 /* IfKeyword */, node.pos, node); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos, node); + var openParenPos = writeToken(90 /* IfKeyword */, node.pos, writeKeyword, node); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, node); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(82 /* ElseKeyword */, node.thenStatement.end, node); - if (node.elseStatement.kind === 212 /* IfStatement */) { - write(" "); + writeToken(82 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 215 /* IfStatement */) { + writeSpace(); emit(node.elseStatement); } else { @@ -73172,60 +74675,68 @@ var ts; } } function emitDoStatement(node) { - write("do"); + writeKeyword("do"); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { - write(" "); + writeSpace(); } else { writeLineOrSpace(node); } - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(");"); + writePunctuation(");"); } function emitWhileStatement(node) { - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos, /*contextNode*/ node); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); emitForBinding(node.initializer); - write(";"); - emitExpressionWithPrefix(" ", node.condition); - write(";"); - emitExpressionWithPrefix(" ", node.incrementor); - write(")"); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.condition); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.incrementor); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - emitWithSuffix(node.awaitModifier, " "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" of "); + writeSpace(); + writeKeyword("of"); + writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { emit(node); } else { @@ -73234,58 +74745,62 @@ var ts; } } function emitContinueStatement(node) { - writeToken(77 /* ContinueKeyword */, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(77 /* ContinueKeyword */, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } function emitBreakStatement(node) { - writeToken(72 /* BreakKeyword */, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(72 /* BreakKeyword */, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } - function emitTokenWithComment(token, pos, contextNode) { + function emitTokenWithComment(token, pos, writer, contextNode) { var node = contextNode && ts.getParseTreeNode(contextNode); if (node && node.kind === contextNode.kind) { pos = ts.skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, /*contextNode*/ contextNode); + pos = writeToken(token, pos, writer, /*contextNode*/ contextNode); if (node && node.kind === contextNode.kind) { emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); } return pos; } function emitReturnStatement(node) { - emitTokenWithComment(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + emitTokenWithComment(96 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitWithStatement(node) { - write("with ("); + writeKeyword("with"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); - write(" "); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node) { emit(node.label); - write(": "); + writePunctuation(":"); + writeSpace(); emit(node.statement); } function emitThrowStatement(node) { - write("throw"); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + writeKeyword("throw"); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitTryStatement(node) { - write("try "); + writeKeyword("try"); + writeSpace(); emit(node.tryBlock); if (node.catchClause) { writeLineOrSpace(node); @@ -73293,24 +74808,26 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - write("finally "); + writeKeyword("finally"); + writeSpace(); emit(node.finallyBlock); } } function emitDebuggerStatement(node) { - writeToken(78 /* DebuggerKeyword */, node.pos); - write(";"); + writeToken(78 /* DebuggerKeyword */, node.pos, writeKeyword); + writeSemicolon(); } // // Declarations // function emitVariableDeclaration(node) { emit(node.name); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); } function emitVariableDeclarationList(node) { - write(ts.isLet(node) ? "let " : ts.isConst(node) ? "const " : "var "); + writeKeyword(ts.isLet(node) ? "let" : ts.isConst(node) ? "const" : "var"); + writeSpace(); emitList(node, node.declarations, 272 /* VariableDeclarationList */); } function emitFunctionDeclaration(node) { @@ -73319,9 +74836,9 @@ var ts; function emitFunctionDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("function"); + writeKeyword("function"); emitIfPresent(node.asteriskToken); - write(" "); + writeSpace(); emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -73351,19 +74868,19 @@ var ts; } else { emitSignatureHead(node); - write(" "); + writeSpace(); emitExpression(body); } } else { emitSignatureHead(node); - write(";"); + writeSemicolon(); } } function emitSignatureHead(node) { emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } function shouldEmitBlockFunctionBodyOnSingleLine(body) { // We must emit a function body as a single-line body in the following case: @@ -73396,7 +74913,8 @@ var ts; return true; } function emitBlockFunctionBody(body) { - write(" {"); + writeSpace(); + writePunctuation("{"); increaseIndent(); var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine @@ -73408,7 +74926,7 @@ var ts; emitBlockFunctionBody(body); } decreaseIndent(); - writeToken(18 /* CloseBraceToken */, body.statements.end, body); + writeToken(18 /* CloseBraceToken */, body.statements.end, writePunctuation, body); } function emitBlockFunctionBodyOnSingleLine(body) { emitBlockFunctionBodyWorker(body, /*emitBlockFunctionBodyOnSingleLine*/ true); @@ -73433,17 +74951,21 @@ var ts; function emitClassDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("class"); - emitNodeWithPrefix(" ", node.name, emitIdentifierName); + writeKeyword("class"); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */; if (indentedFlag) { increaseIndent(); } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* ClassHeritageClauses */); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65 /* ClassMembers */); - write("}"); + writePunctuation("}"); if (indentedFlag) { decreaseIndent(); } @@ -73451,66 +74973,77 @@ var ts; function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("interface "); + writeKeyword("interface"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* HeritageClauses */); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65 /* InterfaceMembers */); - write("}"); + writePunctuation("}"); } function emitTypeAliasDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("type "); + writeKeyword("type"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); } function emitEnumDeclaration(node) { emitModifiers(node, node.modifiers); - write("enum "); + writeKeyword("enum"); + writeSpace(); emit(node.name); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 81 /* EnumMembers */); - write("}"); + writePunctuation("}"); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); if (~node.flags & 512 /* GlobalAugmentation */) { - write(node.flags & 16 /* Namespace */ ? "namespace " : "module "); + writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); + writeSpace(); } emit(node.name); var body = node.body; - while (body.kind === 234 /* ModuleDeclaration */) { - write("."); + while (body.kind === 237 /* ModuleDeclaration */) { + writePunctuation("."); emit(body.name); body = body.body; } - write(" "); + writeSpace(); emit(body); } function emitModuleBlock(node) { pushNameGenerationScope(node); - write("{"); + writePunctuation("{"); emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node)); - write("}"); + writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos); + writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation); emitList(node, node.clauses, 65 /* CaseBlockClauses */); - writeToken(18 /* CloseBraceToken */, node.clauses.end); + writeToken(18 /* CloseBraceToken */, node.clauses.end, writePunctuation); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); emit(node.name); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitModuleReference(node.moduleReference); - write(";"); + writeSemicolon(); } function emitModuleReference(node) { if (node.kind === 71 /* Identifier */) { @@ -73522,23 +75055,30 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); if (node.importClause) { emit(node.importClause); - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); } emitExpression(node.moduleSpecifier); - write(";"); + writeSemicolon(); } function emitImportClause(node) { emit(node.name); if (node.name && node.namedBindings) { - write(", "); + writePunctuation(","); + writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node) { - write("* as "); + writePunctuation("*"); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.name); } function emitNamedImports(node) { @@ -73548,28 +75088,44 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); + writeKeyword("export"); + writeSpace(); + if (node.isExportEquals) { + writeOperator("="); + } + else { + writeKeyword("default"); + } + writeSpace(); emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitExportDeclaration(node) { - write("export "); + writeKeyword("export"); + writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - write("*"); + writePunctuation("*"); } if (node.moduleSpecifier) { - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); emitExpression(node.moduleSpecifier); } - write(";"); + writeSemicolon(); } function emitNamespaceExportDeclaration(node) { - write("export as namespace "); + writeKeyword("export"); + writeSpace(); + writeKeyword("as"); + writeSpace(); + writeKeyword("namespace"); + writeSpace(); emit(node.name); - write(";"); + writeSemicolon(); } function emitNamedExports(node) { emitNamedImportsOrExports(node); @@ -73578,14 +75134,16 @@ var ts; emitImportOrExportSpecifier(node); } function emitNamedImportsOrExports(node) { - write("{"); + writePunctuation("{"); emitList(node, node.elements, 432 /* NamedImportsOrExportsElements */); - write("}"); + writePunctuation("}"); } function emitImportOrExportSpecifier(node) { if (node.propertyName) { emit(node.propertyName); - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); } emit(node.name); } @@ -73593,9 +75151,10 @@ var ts; // Module references // function emitExternalModuleReference(node) { - write("require("); + writeKeyword("require"); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } // // JSX @@ -73606,14 +75165,14 @@ var ts; emit(node.closingElement); } function emitJsxSelfClosingElement(node) { - write("<"); + writePunctuation("<"); emitJsxTagName(node.tagName); - write(" "); + writeSpace(); // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap if (node.attributes.properties && node.attributes.properties.length > 0) { emit(node.attributes); } - write("/>"); + writePunctuation("/>"); } function emitJsxFragment(node) { emit(node.openingFragment); @@ -73621,45 +75180,46 @@ var ts; emit(node.closingFragment); } function emitJsxOpeningElementOrFragment(node) { - write("<"); + writePunctuation("<"); if (ts.isJsxOpeningElement(node)) { emitJsxTagName(node.tagName); // We are checking here so we won't re-enter the emitting pipeline and emit extra sourcemap if (node.attributes.properties && node.attributes.properties.length > 0) { - write(" "); + writeSpace(); emit(node.attributes); } } - write(">"); + writePunctuation(">"); } function emitJsxText(node) { + commitPendingSemicolon(); writer.writeLiteral(getTextOfNode(node, /*includeTrivia*/ true)); } function emitJsxClosingElementOrFragment(node) { - write(""); + writePunctuation(">"); } function emitJsxAttributes(node) { emitList(node, node.properties, 131328 /* JsxElementAttributes */); } function emitJsxAttribute(node) { emit(node.name); - emitWithPrefix("=", node.initializer); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emit); } function emitJsxSpreadAttribute(node) { - write("{..."); + writePunctuation("{..."); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } function emitJsxExpression(node) { if (node.expression) { - write("{"); + writePunctuation("{"); emitIfPresent(node.dotDotDotToken); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } } function emitJsxTagName(node) { @@ -73674,13 +75234,15 @@ var ts; // Clauses // function emitCaseClause(node) { - write("case "); + writeKeyword("case"); + writeSpace(); emitExpression(node.expression); - write(":"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitDefaultClause(node) { - write("default:"); + writeKeyword("default"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitCaseOrDefaultClauseStatements(parentNode, statements) { @@ -73707,25 +75269,25 @@ var ts; } var format = 81985 /* CaseOrDefaultClauseStatements */; if (emitAsSingleStatement) { - write(" "); + writeSpace(); format &= ~(1 /* MultiLine */ | 64 /* Indented */); } emitList(parentNode, statements, format); } function emitHeritageClause(node) { - write(" "); - writeTokenText(node.token); - write(" "); + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - var openParenPos = writeToken(74 /* CatchKeyword */, node.pos); - write(" "); + var openParenPos = writeToken(74 /* CatchKeyword */, node.pos, writeKeyword); + writeSpace(); if (node.variableDeclaration) { - writeToken(19 /* OpenParenToken */, openParenPos); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emit(node.variableDeclaration); - writeToken(20 /* CloseParenToken */, node.variableDeclaration.end); - write(" "); + writeToken(20 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation); + writeSpace(); } emit(node.block); } @@ -73734,7 +75296,8 @@ var ts; // function emitPropertyAssignment(node) { emit(node.name); - write(": "); + writePunctuation(":"); + writeSpace(); // This is to ensure that we emit comment in the following case: // For example: // obj = { @@ -73752,13 +75315,15 @@ var ts; function emitShorthandPropertyAssignment(node) { emit(node.name); if (node.objectAssignmentInitializer) { - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitExpression(node.objectAssignmentInitializer); } } function emitSpreadAssignment(node) { if (node.expression) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } } @@ -73767,7 +75332,7 @@ var ts; // function emitEnumMember(node) { emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } // // Top-level nodes @@ -73865,33 +75430,60 @@ var ts; // // Helpers // + function emitNodeWithWriter(node, writer) { + var savedWrite = write; + write = writer; + emit(node); + write = savedWrite; + } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 131328 /* Modifiers */); - write(" "); + writeSpace(); } } - function emitWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emit); - } - function emitExpressionWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emitExpression); - } - function emitNodeWithPrefix(prefix, node, emit) { + function emitTypeAnnotation(node) { if (node) { - write(prefix); + writePunctuation(":"); + writeSpace(); emit(node); } } - function emitWithSuffix(node, suffix) { + function emitInitializer(node) { + if (node) { + writeSpace(); + writeOperator("="); + writeSpace(); + emitExpression(node); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit) { + if (node) { + prefixWriter(prefix); + emit(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit(node); + } + } + function emitExpressionWithLeadingSpace(node) { + if (node) { + writeSpace(); + emitExpression(node); + } + } + function emitWithTrailingSpace(node) { if (node) { emit(node); - write(suffix); + writeSpace(); } } function emitEmbeddedStatement(parent, node) { if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1 /* SingleLine */) { - write(" "); + writeSpace(); emit(node); } else { @@ -73905,13 +75497,16 @@ var ts; emitList(parentNode, decorators, 24577 /* Decorators */); } function emitTypeArguments(parentNode, typeArguments) { - emitList(parentNode, typeArguments, 26960 /* TypeArguments */); + emitList(parentNode, typeArguments, 26896 /* TypeArguments */); } function emitTypeParameters(parentNode, typeParameters) { - emitList(parentNode, typeParameters, 26960 /* TypeParameters */); + if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList(parentNode, typeParameters, 26896 /* TypeParameters */); } function emitParameters(parentNode, parameters) { - emitList(parentNode, parameters, 1360 /* Parameters */); + emitList(parentNode, parameters, 1296 /* Parameters */); } function canEmitSimpleArrowHead(parentNode, parameters) { var parameter = ts.singleOrUndefined(parameters); @@ -73931,7 +75526,7 @@ var ts; } function emitParametersForArrow(parentNode, parameters) { if (canEmitSimpleArrowHead(parentNode, parameters)) { - emitList(parentNode, parameters, 1360 /* Parameters */ & ~1024 /* Parenthesis */); + emitList(parentNode, parameters, 1296 /* Parameters */ & ~1024 /* Parenthesis */); } else { emitParameters(parentNode, parameters); @@ -73946,6 +75541,23 @@ var ts; function emitExpressionList(parentNode, children, format, start, count) { emitNodeList(emitExpression, parentNode, children, format, start, count); } + function writeDelimiter(format) { + switch (format & 28 /* DelimitersMask */) { + case 0 /* None */: + break; + case 16 /* CommaDelimited */: + writePunctuation(","); + break; + case 4 /* BarDelimited */: + writeSpace(); + writePunctuation("|"); + break; + case 8 /* AmpersandDelimited */: + writeSpace(); + writePunctuation("&"); + break; + } + } function emitNodeList(emit, parentNode, children, format, start, count) { if (start === void 0) { start = 0; } if (count === void 0) { count = children ? children.length - start : 0; } @@ -73964,7 +75576,7 @@ var ts; return; } if (format & 7680 /* BracketsMask */) { - write(getOpeningBracket(format)); + writePunctuation(getOpeningBracket(format)); } if (onBeforeEmitNodeArray) { onBeforeEmitNodeArray(children); @@ -73975,7 +75587,7 @@ var ts; writeLine(); } else if (format & 128 /* SpaceBetweenBraces */ && !(format & 262144 /* NoSpaceIfEmpty */)) { - write(" "); + writeSpace(); } } else { @@ -73987,7 +75599,7 @@ var ts; shouldEmitInterveningComments = false; } else if (format & 128 /* SpaceBetweenBraces */) { - write(" "); + writeSpace(); } // Increase the indent, if requested. if (format & 64 /* Indented */) { @@ -73996,7 +75608,6 @@ var ts; // Emit each child. var previousSibling = void 0; var shouldDecreaseIndentAfterEmit = void 0; - var delimiter = getDelimiter(format); for (var i = 0; i < count; i++) { var child = children[start + i]; // Write the delimiter if this is not the first node. @@ -74007,10 +75618,10 @@ var ts; // a // /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline // , - if (delimiter && previousSibling.end !== parentNode.end) { + if (format & 28 /* DelimitersMask */ && previousSibling.end !== parentNode.end) { emitLeadingCommentsOfPosition(previousSibling.end); } - write(delimiter); + writeDelimiter(format); // Write either a line terminator or whitespace to separate the elements. if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { // If a synthesized node in a single-line list starts on a new @@ -74023,7 +75634,7 @@ var ts; shouldEmitInterveningComments = false; } else if (previousSibling && format & 256 /* SpaceBetweenSiblings */) { - write(" "); + writeSpace(); } } // Emit this child. @@ -74046,7 +75657,7 @@ var ts; // Write a trailing comma, if requested. var hasTrailingComma = (format & 32 /* AllowTrailingComma */) && children.hasTrailingComma; if (format & 16 /* CommaDelimited */ && hasTrailingComma) { - write(","); + writePunctuation(","); } // Emit any trailing comment of the last element in the list // i.e @@ -74054,7 +75665,7 @@ var ts; // 2 // /* end of element 2 */ // ]; - if (previousSibling && delimiter && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024 /* NoTrailingComments */)) { + if (previousSibling && format & 28 /* DelimitersMask */ && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024 /* NoTrailingComments */)) { emitLeadingCommentsOfPosition(previousSibling.end); } // Decrease the indent, if requested. @@ -74066,50 +75677,102 @@ var ts; writeLine(); } else if (format & 128 /* SpaceBetweenBraces */) { - write(" "); + writeSpace(); } } if (onAfterEmitNodeArray) { onAfterEmitNodeArray(children); } if (format & 7680 /* BracketsMask */) { - write(getClosingBracket(format)); + writePunctuation(getClosingBracket(format)); } } - function write(s) { + function commitPendingSemicolonInternal() { + if (pendingSemicolon) { + writeSemicolonInternal(); + pendingSemicolon = false; + } + } + function writeLiteral(s) { + commitPendingSemicolon(); + writer.writeLiteral(s); + } + function writeStringLiteral(s) { + commitPendingSemicolon(); + writer.writeStringLiteral(s); + } + function writeBase(s) { + commitPendingSemicolon(); writer.write(s); } + function writeSymbol(s, sym) { + commitPendingSemicolon(); + writer.writeSymbol(s, sym); + } + function writePunctuation(s) { + commitPendingSemicolon(); + writer.writePunctuation(s); + } + function deferWriteSemicolon() { + pendingSemicolon = true; + } + function writeSemicolonInternal() { + writer.writePunctuation(";"); + } + function writeKeyword(s) { + commitPendingSemicolon(); + writer.writeKeyword(s); + } + function writeOperator(s) { + commitPendingSemicolon(); + writer.writeOperator(s); + } + function writeParameter(s) { + commitPendingSemicolon(); + writer.writeParameter(s); + } + function writeSpace() { + commitPendingSemicolon(); + writer.writeSpace(" "); + } + function writeProperty(s) { + commitPendingSemicolon(); + writer.writeProperty(s); + } function writeLine() { + commitPendingSemicolon(); writer.writeLine(); } function increaseIndent() { + commitPendingSemicolon(); writer.increaseIndent(); } function decreaseIndent() { + commitPendingSemicolon(); writer.decreaseIndent(); } - function writeToken(token, pos, contextNode) { + function writeToken(token, pos, writer, contextNode) { return onEmitSourceMapOfToken - ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) - : writeTokenText(token, pos); + ? onEmitSourceMapOfToken(contextNode, token, writer, pos, writeTokenText) + : writeTokenText(token, writer, pos); } - function writeTokenNode(node) { + function writeTokenNode(node, writer) { if (onBeforeEmitToken) { onBeforeEmitToken(node); } - write(ts.tokenToString(node.kind)); + writer(ts.tokenToString(node.kind)); if (onAfterEmitToken) { onAfterEmitToken(node); } } - function writeTokenText(token, pos) { + function writeTokenText(token, writer, pos) { var tokenString = ts.tokenToString(token); - write(tokenString); + writer(tokenString); return pos < 0 ? pos : pos + tokenString.length; } function writeLineOrSpace(node) { if (ts.getEmitFlags(node) & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); @@ -74257,7 +75920,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -74300,6 +75963,7 @@ var ts; } tempFlagsStack.push(tempFlags); tempFlags = 0; + reservedNamesStack.push(reservedNames); } /** * Pop the current name generation scope. @@ -74309,15 +75973,22 @@ var ts; return; } tempFlags = tempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name) { + if (!reservedNames || reservedNames === ts.lastOrUndefined(reservedNamesStack)) { + reservedNames = ts.createMap(); + } + reservedNames.set(name, true); } /** * Generate the text for a generated identifier. */ function generateName(name) { - if (name.autoGenerateKind === 4 /* Node */) { + if ((name.autoGenerateFlags & 7 /* KindMask */) === 4 /* Node */) { // Node names generate unique names based on their original node // and are cached based on that node's id. - if (name.skipNameGenerationScope) { + if (name.autoGenerateFlags & 8 /* SkipNameGenerationScope */) { var savedTempFlags = tempFlags; popNameGenerationScope(/*node*/ undefined); var result = generateNameCached(getNodeForGeneratedName(name)); @@ -74347,7 +76018,8 @@ var ts; function isUniqueName(name) { return !(hasGlobalName && hasGlobalName(name)) && !currentSourceFile.identifiers.has(name) - && !generatedNames.has(name); + && !generatedNames.has(name) + && !(reservedNames && reservedNames.has(name)); } /** * Returns a value indicating whether a name is unique within a container. @@ -74369,11 +76041,14 @@ var ts; * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. */ - function makeTempVariableName(flags) { + function makeTempVariableName(flags, reservedInNestedScopes) { if (flags && !(tempFlags & flags)) { var name = flags === 268435456 /* _i */ ? "_i" : "_n"; if (isUniqueName(name)) { tempFlags |= flags; + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -74386,6 +76061,9 @@ var ts; ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); if (isUniqueName(name)) { + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -74454,21 +76132,21 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - case 244 /* ExportAssignment */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 247 /* ExportAssignment */: return generateNameForExportDefault(); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return generateNameForClassExpression(); - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); @@ -74478,11 +76156,11 @@ var ts; * Generates a unique identifier for a node. */ function makeName(name) { - switch (name.autoGenerateKind) { + switch (name.autoGenerateFlags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(0 /* Auto */); + return makeTempVariableName(0 /* Auto */, !!(name.autoGenerateFlags & 16 /* ReservedInNestedScopes */)); case 2 /* Loop */: - return makeTempVariableName(268435456 /* _i */); + return makeTempVariableName(268435456 /* _i */, !!(name.autoGenerateFlags & 16 /* ReservedInNestedScopes */)); case 3 /* Unique */: return makeUniqueName(ts.idText(name)); } @@ -74500,7 +76178,7 @@ var ts; // if "node" is a different generated name (having a different // "autoGenerateId"), use it and stop traversing. if (ts.isIdentifier(node) - && node.autoGenerateKind === 4 /* Node */ + && node.autoGenerateFlags === 4 /* Node */ && node.autoGenerateId !== autoGenerateId) { break; } @@ -74511,17 +76189,6 @@ var ts; } } ts.createPrinter = createPrinter; - function createDelimiterMap() { - var delimiters = []; - delimiters[0 /* None */] = ""; - delimiters[16 /* CommaDelimited */] = ","; - delimiters[4 /* BarDelimited */] = " |"; - delimiters[8 /* AmpersandDelimited */] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28 /* DelimitersMask */]; - } function createBracketsMap() { var brackets = []; brackets[512 /* Braces */] = ["{", "}"]; @@ -74543,474 +76210,10 @@ var ts; TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; TempFlags[TempFlags["_i"] = 268435456] = "_i"; })(TempFlags || (TempFlags = {})); - var ListFormat; - (function (ListFormat) { - ListFormat[ListFormat["None"] = 0] = "None"; - // Line separators - ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; - ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; - ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; - ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; - // Delimiters - ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; - ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; - ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; - ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; - ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; - ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; - // Whitespace - ListFormat[ListFormat["Indented"] = 64] = "Indented"; - ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; - ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; - // Brackets/Braces - ListFormat[ListFormat["Braces"] = 512] = "Braces"; - ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; - ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; - ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; - ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; - ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; - ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; - ListFormat[ListFormat["Optional"] = 24576] = "Optional"; - // Other - ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; - ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; - ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; - ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; - ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; - // Precomputed Formats - ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; - ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; - ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; - ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; - ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; - ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; - ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; - ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements"; - ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements"; - ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; - ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; - ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; - ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; - ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; - ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; - ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; - ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; - ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; - ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; - ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; - ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; - ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; - ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; - ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; - ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; - ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; - ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; - ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; - ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; - ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; - ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; - ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; - ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments"; - ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters"; - ListFormat[ListFormat["Parameters"] = 1360] = "Parameters"; - ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; - })(ListFormat || (ListFormat = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { - var outputFiles = []; - var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); - return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; - function writeFile(fileName, text, writeByteOrderMark) { - outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); - } - } - ts.getFileEmitOutput = getFileEmitOutput; - function createBuilder(options) { - var isModuleEmit; - var fileInfos = ts.createMap(); - var semanticDiagnosticsPerFile = ts.createMap(); - /** The map has key by source file's path that has been changed */ - var changedFilesSet = ts.createMap(); - var hasShapeChanged = ts.createMap(); - var allFilesExcludingDefaultLibraryFile; - var emitHandler; - return { - updateProgram: updateProgram, - getFilesAffectedBy: getFilesAffectedBy, - emitChangedFiles: emitChangedFiles, - getSemanticDiagnostics: getSemanticDiagnostics, - clear: clear - }; - function createProgramGraph(program) { - var currentIsModuleEmit = program.getCompilerOptions().module !== ts.ModuleKind.None; - if (isModuleEmit !== currentIsModuleEmit) { - isModuleEmit = currentIsModuleEmit; - emitHandler = isModuleEmit ? getModuleEmitHandler() : getNonModuleEmitHandler(); - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - } - hasShapeChanged.clear(); - allFilesExcludingDefaultLibraryFile = undefined; - ts.mutateMap(fileInfos, ts.arrayToMap(program.getSourceFiles(), function (sourceFile) { return sourceFile.path; }), { - // Add new file info - createNewValue: function (_path, sourceFile) { return addNewFileInfo(program, sourceFile); }, - // Remove existing file info - onDeleteValue: removeExistingFileInfo, - // We will update in place instead of deleting existing value and adding new one - onExistingValue: function (existingInfo, sourceFile) { return updateExistingFileInfo(program, existingInfo, sourceFile); } - }); - } - function registerChangedFile(path) { - changedFilesSet.set(path, true); - // All changed files need to re-evaluate its semantic diagnostics - semanticDiagnosticsPerFile.delete(path); - } - function addNewFileInfo(program, sourceFile) { - registerChangedFile(sourceFile.path); - emitHandler.onAddSourceFile(program, sourceFile); - return { version: sourceFile.version, signature: undefined }; - } - function removeExistingFileInfo(_existingFileInfo, path) { - // Since we dont need to track removed file as changed file - // We can just remove its diagnostics - changedFilesSet.delete(path); - semanticDiagnosticsPerFile.delete(path); - emitHandler.onRemoveSourceFile(path); - } - function updateExistingFileInfo(program, existingInfo, sourceFile) { - if (existingInfo.version !== sourceFile.version) { - registerChangedFile(sourceFile.path); - existingInfo.version = sourceFile.version; - emitHandler.onUpdateSourceFile(program, sourceFile); - } - else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) { - registerChangedFile(sourceFile.path); - } - } - function ensureProgramGraph(program) { - if (!emitHandler) { - createProgramGraph(program); - } - } - function updateProgram(newProgram) { - if (emitHandler) { - createProgramGraph(newProgram); - } - } - function getFilesAffectedBy(program, path) { - ensureProgramGraph(program); - var sourceFile = program.getSourceFileByPath(path); - if (!sourceFile) { - return ts.emptyArray; - } - if (!updateShapeSignature(program, sourceFile)) { - return [sourceFile]; - } - return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile); - } - function emitChangedFiles(program, writeFileCallback) { - ensureProgramGraph(program); - var compilerOptions = program.getCompilerOptions(); - if (!changedFilesSet.size) { - return ts.emptyArray; - } - // With --out or --outFile all outputs go into single file, do it only once - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - changedFilesSet.clear(); - return [program.emit(/*targetSourceFile*/ undefined, writeFileCallback)]; - } - var seenFiles = ts.createMap(); - var result; - changedFilesSet.forEach(function (_true, path) { - // Get the affected Files by this program - var affectedFiles = getFilesAffectedBy(program, path); - affectedFiles.forEach(function (affectedFile) { - // Affected files shouldnt have cached diagnostics - semanticDiagnosticsPerFile.delete(affectedFile.path); - if (!seenFiles.has(affectedFile.path)) { - seenFiles.set(affectedFile.path, true); - // Emit the affected file - (result || (result = [])).push(program.emit(affectedFile, writeFileCallback)); - } - }); - }); - changedFilesSet.clear(); - return result || ts.emptyArray; - } - function getSemanticDiagnostics(program, cancellationToken) { - ensureProgramGraph(program); - ts.Debug.assert(changedFilesSet.size === 0); - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - // We dont need to cache the diagnostics just return them from program - return program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken); - } - var diagnostics; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken)); - } - return diagnostics || ts.emptyArray; - } - function getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken) { - var path = sourceFile.path; - var cachedDiagnostics = semanticDiagnosticsPerFile.get(path); - // Report the semantic diagnostics from the cache if we already have those diagnostics present - if (cachedDiagnostics) { - return cachedDiagnostics; - } - // Diagnostics werent cached, get them from program, and cache the result - var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); - semanticDiagnosticsPerFile.set(path, diagnostics); - return diagnostics; - } - function clear() { - isModuleEmit = undefined; - emitHandler = undefined; - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - changedFilesSet.clear(); - hasShapeChanged.clear(); - } - /** - * For script files that contains only ambient external modules, although they are not actually external module files, - * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore, - * there are no point to rebuild all script files if these special files have changed. However, if any statement - * in the file is not ambient external module, we treat it as a regular script file. - */ - function containsOnlyAmbientModules(sourceFile) { - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - if (!ts.isModuleWithStringLiteralName(statement)) { - return false; - } - } - return true; - } - /** - * @return {boolean} indicates if the shape signature has changed since last update. - */ - function updateShapeSignature(program, sourceFile) { - ts.Debug.assert(!!sourceFile); - // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate - if (hasShapeChanged.has(sourceFile.path)) { - return false; - } - hasShapeChanged.set(sourceFile.path, true); - var info = fileInfos.get(sourceFile.path); - ts.Debug.assert(!!info); - var prevSignature = info.signature; - var latestSignature; - if (sourceFile.isDeclarationFile) { - latestSignature = sourceFile.version; - info.signature = latestSignature; - } - else { - var emitOutput = getFileEmitOutput(program, sourceFile, /*emitOnlyDtsFiles*/ true); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - latestSignature = options.computeHash(emitOutput.outputFiles[0].text); - info.signature = latestSignature; - } - else { - latestSignature = prevSignature; - } - } - return !prevSignature || latestSignature !== prevSignature; - } - /** - * Gets the referenced files for a file from the program with values for the keys as referenced file's path to be true - */ - function getReferencedFiles(program, sourceFile) { - var referencedFiles; - // We need to use a set here since the code can contain the same import twice, - // but that will only be one dependency. - // To avoid invernal conversion, the key of the referencedFiles map must be of type Path - if (sourceFile.imports && sourceFile.imports.length > 0) { - var checker = program.getTypeChecker(); - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var importName = _a[_i]; - var symbol = checker.getSymbolAtLocation(importName); - if (symbol && symbol.declarations && symbol.declarations[0]) { - var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); - if (declarationSourceFile) { - addReferencedFile(declarationSourceFile.path); - } - } - } - } - var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); - // Handle triple slash references - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { - var referencedFile = _c[_b]; - var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(referencedPath); - } - } - // Handle type reference directives - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { - if (!resolvedTypeReferenceDirective) { - return; - } - var fileName = resolvedTypeReferenceDirective.resolvedFileName; - var typeFilePath = ts.toPath(fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(typeFilePath); - }); - } - return referencedFiles; - function addReferencedFile(referencedPath) { - if (!referencedFiles) { - referencedFiles = ts.createMap(); - } - referencedFiles.set(referencedPath, true); - } - } - /** - * Gets all files of the program excluding the default library file - */ - function getAllFilesExcludingDefaultLibraryFile(program, firstSourceFile) { - // Use cached result - if (allFilesExcludingDefaultLibraryFile) { - return allFilesExcludingDefaultLibraryFile; - } - var result; - addSourceFile(firstSourceFile); - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - if (sourceFile !== firstSourceFile) { - addSourceFile(sourceFile); - } - } - allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; - return allFilesExcludingDefaultLibraryFile; - function addSourceFile(sourceFile) { - if (!program.isSourceFileDefaultLibrary(sourceFile)) { - (result || (result = [])).push(sourceFile); - } - } - } - function getNonModuleEmitHandler() { - return { - onAddSourceFile: ts.noop, - onRemoveSourceFile: ts.noop, - onUpdateSourceFile: ts.noop, - onUpdateSourceFileWithSameVersion: ts.returnFalse, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function getFilesAffectedByUpdatedShape(program, sourceFile) { - var options = program.getCompilerOptions(); - // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, - // so returning the file itself is good enough. - if (options && (options.out || options.outFile)) { - return [sourceFile]; - } - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - } - function getModuleEmitHandler() { - var references = ts.createMap(); - return { - onAddSourceFile: setReferences, - onRemoveSourceFile: onRemoveSourceFile, - onUpdateSourceFile: updateReferences, - onUpdateSourceFileWithSameVersion: updateReferencesTrackingChangedReferences, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function setReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - } - function updateReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - else { - references.delete(sourceFile.path); - } - } - function updateReferencesTrackingChangedReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (!newReferences) { - // Changed if we had references - return references.delete(sourceFile.path); - } - var oldReferences = references.get(sourceFile.path); - references.set(sourceFile.path, newReferences); - if (!oldReferences || oldReferences.size !== newReferences.size) { - return true; - } - // If there are any new references that werent present previously there is change - return ts.forEachEntry(newReferences, function (_true, referencedPath) { return !oldReferences.delete(referencedPath); }) || - // Otherwise its changed if there are more references previously than now - !!oldReferences.size; - } - function onRemoveSourceFile(removedFilePath) { - // Remove existing references - references.forEach(function (referencesInFile, filePath) { - if (referencesInFile.has(removedFilePath)) { - // add files referencing the removedFilePath, as changed files too - var referencedByInfo = fileInfos.get(filePath); - if (referencedByInfo) { - registerChangedFile(filePath); - } - } - }); - // Delete the entry for the removed file path - references.delete(removedFilePath); - } - function getReferencedByPaths(referencedFilePath) { - return ts.mapDefinedIter(references.entries(), function (_a) { - var filePath = _a[0], referencesInFile = _a[1]; - return referencesInFile.has(referencedFilePath) ? filePath : undefined; - }); - } - function getFilesAffectedByUpdatedShape(program, sourceFile) { - if (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile)) { - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { - return [sourceFile]; - } - // Now we need to if each file in the referencedBy list has a shape change as well. - // Because if so, its own referencedBy files need to be saved as well to make the - // emitting result consistent with files on disk. - var seenFileNamesMap = ts.createMap(); - // Start with the paths this file was referenced by - var path = sourceFile.path; - seenFileNamesMap.set(path, sourceFile); - var queue = getReferencedByPaths(path); - while (queue.length > 0) { - var currentPath = queue.pop(); - if (!seenFileNamesMap.has(currentPath)) { - var currentSourceFile = program.getSourceFileByPath(currentPath); - seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(program, currentSourceFile)) { - queue.push.apply(queue, getReferencedByPaths(currentPath)); - } - } - } - // Return array of values that needs emit - return ts.flatMapIter(seenFileNamesMap.values(), function (value) { return value; }); - } - } - } - ts.createBuilder = createBuilder; })(ts || (ts = {})); /// /// /// -/// var ts; (function (ts) { var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; @@ -75204,23 +76407,31 @@ var ts; return errorMessage; } ts.formatDiagnostic = formatDiagnostic; - var redForegroundEscapeSequence = "\u001b[91m"; - var yellowForegroundEscapeSequence = "\u001b[93m"; - var blueForegroundEscapeSequence = "\u001b[93m"; + /** @internal */ + var ForegroundColorEscapeSequences; + (function (ForegroundColorEscapeSequences) { + ForegroundColorEscapeSequences["Grey"] = "\u001B[90m"; + ForegroundColorEscapeSequences["Red"] = "\u001B[91m"; + ForegroundColorEscapeSequences["Yellow"] = "\u001B[93m"; + ForegroundColorEscapeSequences["Blue"] = "\u001B[94m"; + ForegroundColorEscapeSequences["Cyan"] = "\u001B[96m"; + })(ForegroundColorEscapeSequences = ts.ForegroundColorEscapeSequences || (ts.ForegroundColorEscapeSequences = {})); var gutterStyleSequence = "\u001b[30;47m"; var gutterSeparator = " "; var resetEscapeSequence = "\u001b[0m"; var ellipsis = "..."; function getCategoryFormat(category) { switch (category) { - case ts.DiagnosticCategory.Warning: return yellowForegroundEscapeSequence; - case ts.DiagnosticCategory.Error: return redForegroundEscapeSequence; - case ts.DiagnosticCategory.Message: return blueForegroundEscapeSequence; + case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } - function formatAndReset(text, formatStyle) { + /** @internal */ + function formatColorAndReset(text, formatStyle) { return formatStyle + text + resetEscapeSequence; } + ts.formatColorAndReset = formatColorAndReset; function padLeft(s, length) { while (s.length < length) { s = " " + s; @@ -75233,9 +76444,9 @@ var ts; var diagnostic = diagnostics_2[_i]; var context = ""; if (diagnostic.file) { - var start = diagnostic.start, length_5 = diagnostic.length, file = diagnostic.file; + var start = diagnostic.start, length_4 = diagnostic.length, file = diagnostic.file; var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; - var _b = ts.getLineAndCharacterOfPosition(file, start + length_5), lastLine = _b.line, lastLineChar = _b.character; + var _b = ts.getLineAndCharacterOfPosition(file, start + length_4), lastLine = _b.line, lastLineChar = _b.character; var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line; var relativeFileName = host ? ts.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : file.fileName; var hasMoreThanFiveLines = (lastLine - firstLine) >= 4; @@ -75248,7 +76459,7 @@ var ts; // If the error spans over 5 lines, we'll only show the first 2 and last 2 lines, // so we'll skip ahead to the second-to-last line. if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { - context += formatAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + context += formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); i = lastLine - 1; } var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0); @@ -75257,11 +76468,11 @@ var ts; lineContent = lineContent.replace(/\s+$/g, ""); // trim from end lineContent = lineContent.replace("\t", " "); // convert tabs to single spaces // Output the gutter and the actual contents of the line. - context += formatAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; context += lineContent + host.getNewLine(); // Output the gutter and the error span for the line using tildes. - context += formatAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; - context += redForegroundEscapeSequence; + context += formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += ForegroundColorEscapeSequences.Red; if (i === firstLine) { // If we're on the last line, then limit it to the last character of the last line. // Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position. @@ -75278,19 +76489,25 @@ var ts; } context += resetEscapeSequence; } - output += host.getNewLine(); - output += relativeFileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; + output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan); + output += ":"; + output += formatColorAndReset("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow); + output += ":"; + output += formatColorAndReset("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); + output += " - "; } var categoryColor = getCategoryFormat(diagnostic.category); var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatAndReset(category, categoryColor) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); + output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey); + output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); if (diagnostic.file) { output += host.getNewLine(); output += context; } output += host.getNewLine(); } - return output; + return output + host.getNewLine(); } ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext; function flattenDiagnosticMessageText(messageText, newLine) { @@ -75340,7 +76557,7 @@ var ts; */ /* @internal */ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames) { - // If we haven't create a program yet or has changed automatic type directives, then it is not up-to-date + // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date if (!program || hasChangedAutomaticTypeDirectiveNames) { return false; } @@ -75374,10 +76591,10 @@ var ts; } ts.isProgramUptoDate = isProgramUptoDate; /** - * Determined if source file needs to be re-created even if its text hasnt changed + * Determined if source file needs to be re-created even if its text hasn't changed */ function shouldProgramCreateNewSourceFiles(program, newOptions) { - // If any of these options change, we cant reuse old source file even if version match + // If any of these options change, we can't reuse old source file even if version match // The change in options like these could result in change in syntax tree change var oldOptions = program && program.getCompilerOptions(); return oldOptions && (oldOptions.target !== newOptions.target || @@ -75558,7 +76775,8 @@ var ts; dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, sourceFileToPackageName: sourceFileToPackageName, - redirectTargetsSet: redirectTargetsSet + redirectTargetsSet: redirectTargetsSet, + isEmittedFile: isEmittedFile }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -75705,9 +76923,13 @@ var ts; // If we change our policy of rechecking failed lookups on each program create, // we should adjust the value returned here. function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, oldProgramState) { - var resolutionToFile = ts.getResolvedModule(oldProgramState.file, moduleName); - if (resolutionToFile) { - // module used to be resolved to file - ignore it + var resolutionToFile = ts.getResolvedModule(oldProgramState.oldSourceFile, moduleName); + var resolvedFile = resolutionToFile && oldProgramState.program && oldProgramState.program.getSourceFile(resolutionToFile.resolvedFileName); + if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) { + // In the old program, we resolved to an ambient module that was in the same + // place as we expected to find an actual module file. + // We actually need to return 'false' here even though this seems like a 'true' case + // because the normal module resolution algorithm will find this anyway. return false; } var ambientModule = oldProgramState.program && oldProgramState.program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(moduleName); @@ -75860,7 +77082,7 @@ var ts; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = getModuleNames(newSourceFile); - var oldProgramState = { program: oldProgram, file: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, oldProgramState); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); @@ -75964,24 +77186,26 @@ var ts; } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; - if (options.noEmit) { - return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; - } - // If the noEmitOnError flag is set, then check if we have any errors so far. If so, - // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we - // get any preEmit diagnostics, not just the ones - if (options.noEmitOnError) { - var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); - if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { - declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); + if (!emitOnlyDtsFiles) { + if (options.noEmit) { + return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; } - if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { - return { - diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), - sourceMaps: undefined, - emittedFiles: undefined, - emitSkipped: true - }; + // If the noEmitOnError flag is set, then check if we have any errors so far. If so, + // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we + // get any preEmit diagnostics, not just the ones + if (options.noEmitOnError) { + var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); + if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { + declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); + } + if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { + return { + diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), + sourceMaps: undefined, + emittedFiles: undefined, + emitSkipped: true + }; + } } } // Create the emit resolver outside of the "emitTime" tracking code below. That way @@ -75992,7 +77216,7 @@ var ts; // This is because in the -out scenario all files need to be emitted, and therefore all // files need to be type checked. And the way to specify that all files need to be type // checked is to not pass the file to getEmitResolver. - var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); + var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); ts.performance.mark("beforeEmit"); var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); @@ -76127,22 +77351,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } // falls through - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 227 /* VariableDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 230 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -76150,41 +77374,41 @@ var ts; } } switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 108 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } var prevParent = parent; @@ -76197,28 +77421,28 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 233 /* ClassDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } // falls through - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 209 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 212 /* VariableStatement */); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -76230,16 +77454,16 @@ var ts; return; } break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -76265,7 +77489,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 124 /* DeclareKeyword */: case 117 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); @@ -76355,6 +77579,7 @@ var ts; // synthesize 'import "tslib"' declaration var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); externalHelpersModuleReference.parent = importDecl; importDecl.parent = file; imports = [externalHelpersModuleReference]; @@ -76372,9 +77597,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || !ts.isStringLiteral(moduleNameExpr)) { break; @@ -76389,7 +77614,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) { var moduleName = node.name; var nameText = ts.getTextOfIdentifierOrLiteral(moduleName); @@ -76544,7 +77769,7 @@ var ts; } }, shouldCreateNewSourceFile); if (packageId) { - var packageIdKey = packageId.name + "/" + packageId.subModuleName + "@" + packageId.version; + var packageIdKey = ts.packageIdToString(packageId); var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); if (fileFromPackageId) { // Some other SourceFile already exists with this package name and version. @@ -76671,7 +77896,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var oldProgramState = { program: oldProgram, file: file, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory), file, oldProgramState); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { @@ -76878,6 +78103,14 @@ var ts; if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } + if (options.emitDeclarationOnly) { + if (!options.declaration) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations"); + } + if (options.noEmit) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); + } + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); @@ -76898,7 +78131,9 @@ var ts; var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createMap(); ts.forEachEmittedFile(emitHost, function (emitFileNames) { - verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + if (!options.emitDeclarationOnly) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + } verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); } @@ -76908,13 +78143,13 @@ var ts; var emitFilePath = toPath(emitFileName); // Report error if the output overwrites input file if (filesByName.has(emitFilePath)) { - var chain_1; + var chain_2; if (!options.configFilePath) { // The program is from either an inferred project or an external project - chain_1 = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + chain_2 = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } - chain_1 = ts.chainDiagnosticMessages(chain_1, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); - blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_1)); + chain_2 = ts.chainDiagnosticMessages(chain_2, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_2)); } var emitFileKey = !host.useCaseSensitiveFileNames() ? emitFilePath.toLocaleLowerCase() : emitFilePath; // Report error if multiple files write into same file @@ -77010,6 +78245,35 @@ var ts; hasEmitBlockingDiagnostics.set(toPath(emitFileName), true); programDiagnostics.add(diag); } + function isEmittedFile(file) { + if (options.noEmit) { + return false; + } + // If this is source file, its not emitted file + var filePath = toPath(file); + if (getSourceFileByPath(filePath)) { + return false; + } + // If options have --outFile or --out just check that + var out = options.outFile || options.out; + if (out) { + return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts" /* Dts */); + } + // If --outDir, check if file is in that directory + if (options.outDir) { + return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); + } + if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts" /* Dts */)) { + // Otherwise just check if sourceFile with the name exists + var filePathWithoutExtension = ts.removeFileExtension(filePath); + return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts" /* Ts */)) || + !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx" /* Tsx */)); + } + return false; + } + function isSameFile(file1, file2) { + return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */; + } } ts.createProgram = createProgram; /* @internal */ @@ -77235,6 +78499,7 @@ var ts; ScriptElementKindModifier["ambientModifier"] = "declare"; ScriptElementKindModifier["staticModifier"] = "static"; ScriptElementKindModifier["abstractModifier"] = "abstract"; + ScriptElementKindModifier["optionalModifier"] = "optional"; })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); var ClassificationTypeNames; (function (ClassificationTypeNames) { @@ -77305,36 +78570,36 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 264 /* CatchClause */: - case 257 /* JsxAttribute */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 267 /* CatchClause */: + case 260 /* JsxAttribute */: return 1 /* Value */; - case 146 /* TypeParameter */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 164 /* TypeLiteral */: + case 147 /* TypeParameter */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 165 /* TypeLiteral */: return 2 /* Type */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 268 /* EnumMember */: - case 230 /* ClassDeclaration */: + case 271 /* EnumMember */: + case 233 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -77344,26 +78609,26 @@ var ts; else { return 4 /* Namespace */; } - case 233 /* EnumDeclaration */: - case 242 /* NamedImports */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 236 /* EnumDeclaration */: + case 245 /* NamedImports */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 269 /* SourceFile */: + case 272 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 244 /* ExportAssignment */) { + else if (node.parent.kind === 247 /* ExportAssignment */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -77388,19 +78653,14 @@ var ts; } ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 71 /* Identifier */); // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 144 /* QualifiedName */ && - node.parent.right === node && - node.parent.parent.kind === 238 /* ImportEqualsDeclaration */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - return 4 /* Namespace */; + var name = node.kind === 145 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 241 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 144 /* QualifiedName */) { + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -77412,27 +78672,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 144 /* QualifiedName */) { - while (root.parent && root.parent.kind === 144 /* QualifiedName */) { + if (root.parent.kind === 145 /* QualifiedName */) { + while (root.parent && root.parent.kind === 145 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 160 /* TypeReference */ && !isLastClause; + return root.parent.kind === 161 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 180 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 180 /* PropertyAccessExpression */) { + if (root.parent.kind === 183 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 183 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 202 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 263 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 205 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 266 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 230 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || - (decl.kind === 231 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); + return (decl.kind === 233 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || + (decl.kind === 234 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); } return false; } @@ -77443,23 +78703,23 @@ var ts; switch (node.kind) { case 99 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return true; } switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 182 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 185 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 183 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 186 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -77472,7 +78732,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 223 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 226 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -77482,13 +78742,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 71 /* Identifier */ && - (node.parent.kind === 219 /* BreakStatement */ || node.parent.kind === 218 /* ContinueStatement */) && + (node.parent.kind === 222 /* BreakStatement */ || node.parent.kind === 221 /* ContinueStatement */) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 71 /* Identifier */ && - node.parent.kind === 223 /* LabeledStatement */ && + node.parent.kind === 226 /* LabeledStatement */ && node.parent.label === node; } function isLabelName(node) { @@ -77496,15 +78756,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 234 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 237 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -77514,22 +78774,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 268 /* EnumMember */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 234 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 271 /* EnumMember */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 237 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return true; - case 174 /* LiteralType */: - return node.parent.parent.kind === 172 /* IndexedAccessType */; + case 177 /* LiteralType */: + return node.parent.parent.kind === 175 /* IndexedAccessType */; } } ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess; @@ -77539,7 +78799,7 @@ var ts; } ts.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration; function getContainerNode(node) { - if (node.kind === 288 /* JSDocTypedefTag */) { + if (node.kind === 291 /* JSDocTypedefTag */) { // This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope. // node.parent = the JSDoc comment, node.parent.parent = the node having the comment. // Then we get parent again in the loop. @@ -77551,17 +78811,17 @@ var ts; return undefined; } switch (node.kind) { - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return node; } } @@ -77569,48 +78829,48 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return "class" /* classElement */; - case 231 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 232 /* TypeAliasDeclaration */: return "type" /* typeElement */; - case 233 /* EnumDeclaration */: return "enum" /* enumElement */; - case 227 /* VariableDeclaration */: + case 234 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 235 /* TypeAliasDeclaration */: return "type" /* typeElement */; + case 236 /* EnumDeclaration */: return "enum" /* enumElement */; + case 230 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return "function" /* functionElement */; - case 154 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 155 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 155 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 156 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return "property" /* memberVariableElement */; - case 158 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 157 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 156 /* CallSignature */: return "call" /* callSignatureElement */; - case 153 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 146 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 268 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 147 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 238 /* ImportEqualsDeclaration */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 247 /* ExportSpecifier */: - case 241 /* NamespaceImport */: + case 159 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 158 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 157 /* CallSignature */: return "call" /* callSignatureElement */; + case 154 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 147 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 271 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 148 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 241 /* ImportEqualsDeclaration */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 250 /* ExportSpecifier */: + case 244 /* NamespaceImport */: return "alias" /* alias */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var kind = ts.getSpecialPropertyAssignmentKind(node); var right = node.right; switch (kind) { @@ -77651,7 +78911,7 @@ var ts; return true; case 71 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 147 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 148 /* Parameter */; default: return false; } @@ -77700,42 +78960,42 @@ var ts; return false; } switch (n.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 175 /* ObjectBindingPattern */: - case 164 /* TypeLiteral */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 236 /* CaseBlock */: - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 165 /* TypeLiteral */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 239 /* CaseBlock */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return nodeEndsWith(n, 18 /* CloseBraceToken */, sourceFile); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 183 /* NewExpression */: + case 186 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 182 /* CallExpression */: - case 186 /* ParenthesizedExpression */: - case 169 /* ParenthesizedType */: + case 185 /* CallExpression */: + case 189 /* ParenthesizedExpression */: + case 172 /* ParenthesizedType */: return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 191 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -77745,73 +79005,70 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 20 /* CloseParenToken */, sourceFile); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 212 /* IfStatement */: + case 215 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || - hasChildOfKind(n, 25 /* SemicolonToken */); - case 178 /* ArrayLiteralExpression */: - case 176 /* ArrayBindingPattern */: - case 181 /* ElementAccessExpression */: - case 145 /* ComputedPropertyName */: - case 166 /* TupleType */: + hasChildOfKind(n, 25 /* SemicolonToken */, sourceFile); + case 181 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 184 /* ElementAccessExpression */: + case 146 /* ComputedPropertyName */: + case 167 /* TupleType */: return nodeEndsWith(n, 22 /* CloseBracketToken */, sourceFile); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; - var hasWhileKeyword = findChildOfKind(n, 106 /* WhileKeyword */, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - case 163 /* TypeQuery */: + return hasChildOfKind(n, 106 /* WhileKeyword */, sourceFile) + ? nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile) + : isCompletedNode(n.statement, sourceFile); + case 164 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 190 /* TypeOfExpression */: - case 189 /* DeleteExpression */: - case 191 /* VoidExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: + case 193 /* TypeOfExpression */: + case 192 /* DeleteExpression */: + case 194 /* VoidExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; } } - ts.isCompletedNode = isCompletedNode; /* * Checks if node ends with 'expectedLastToken'. * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. @@ -77851,7 +79108,7 @@ var ts; } ts.hasChildOfKind = hasChildOfKind; function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + return ts.find(n.getChildren(sourceFile), function (c) { return c.kind === kind; }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { @@ -77980,19 +79237,11 @@ var ts; var result = find(startNode || sourceFile); ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); return result; - function findRightmostToken(n) { - if (ts.isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } function find(n) { - if (ts.isToken(n)) { + if (isNonWhitespaceToken(n)) { return n; } - var children = n.getChildren(); + var children = n.getChildren(sourceFile); for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). @@ -78008,7 +79257,7 @@ var ts; if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } else { // candidate should be in this node @@ -78016,34 +79265,45 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 269 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 272 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. // Namely we are skipping the check: 'position < node.end' if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } - } - /** - * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. - */ - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - var child = children[i]; - if (isWhiteSpaceOnlyJsxText(child)) { - ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - else if (nodeHasTokens(children[i])) { - return children[i]; - } + return candidate && findRightmostToken(candidate, sourceFile); } } } ts.findPrecedingToken = findPrecedingToken; - function isInString(sourceFile, position) { - var previousToken = findPrecedingToken(position, sourceFile); + function isNonWhitespaceToken(n) { + return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n); + } + function findRightmostToken(n, sourceFile) { + if (isNonWhitespaceToken(n)) { + return n; + } + var children = n.getChildren(sourceFile); + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate, sourceFile); + } + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { + for (var i = exclusiveStartPosition - 1; i >= 0; i--) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } + function isInString(sourceFile, position, previousToken) { + if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); } if (previousToken && ts.isStringTextContainingNode(previousToken)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); @@ -78077,17 +79337,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
|
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 253 /* JsxClosingElement */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 256 /* JsxClosingElement */) { return true; } return false; @@ -78096,7 +79356,6 @@ var ts; function isWhiteSpaceOnlyJsxText(node) { return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; } - ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); @@ -78149,10 +79408,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 160 /* TypeReference */ || node.kind === 182 /* CallExpression */) { + if (node.kind === 161 /* TypeReference */ || node.kind === 185 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 230 /* ClassDeclaration */ || node.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 233 /* ClassDeclaration */ || node.kind === 234 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -78204,18 +79463,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 178 /* ArrayLiteralExpression */ || - node.kind === 179 /* ObjectLiteralExpression */) { + if (node.kind === 181 /* ArrayLiteralExpression */ || + node.kind === 182 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 195 /* BinaryExpression */ && + if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 217 /* ForOfStatement */ && + if (node.parent.kind === 220 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -78223,7 +79482,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 265 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 268 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -78257,15 +79516,27 @@ var ts; return ts.createTextSpanFromBounds(range.pos, range.end); } ts.createTextSpanFromRange = createTextSpanFromRange; + function createTextChangeFromStartLength(start, length, newText) { + return createTextChange(ts.createTextSpan(start, length), newText); + } + ts.createTextChangeFromStartLength = createTextChangeFromStartLength; + function createTextChange(span, newText) { + return { span: span, newText: newText }; + } + ts.createTextChange = createTextChange; ts.typeKeywords = [ 119 /* AnyKeyword */, 122 /* BooleanKeyword */, - 130 /* NeverKeyword */, - 133 /* NumberKeyword */, - 134 /* ObjectKeyword */, - 136 /* StringKeyword */, - 137 /* SymbolKeyword */, + 128 /* KeyOfKeyword */, + 131 /* NeverKeyword */, + 95 /* NullKeyword */, + 134 /* NumberKeyword */, + 135 /* ObjectKeyword */, + 137 /* StringKeyword */, + 138 /* SymbolKeyword */, 105 /* VoidKeyword */, + 140 /* UndefinedKeyword */, + 141 /* UniqueKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); @@ -78286,12 +79557,34 @@ var ts; }; } ts.nodeSeenTracker = nodeSeenTracker; + /** Add a value to a set, and return true if it wasn't already present. */ + function addToSeen(seen, key) { + key = String(key); + if (seen.has(key)) { + return false; + } + seen.set(key, true); + return true; + } + ts.addToSeen = addToSeen; + function getSnapshotText(snap) { + return snap.getText(0, snap.getLength()); + } + ts.getSnapshotText = getSnapshotText; + function repeatString(str, count) { + var result = ""; + for (var i = 0; i < count; i++) { + result += str; + } + return result; + } + ts.repeatString = repeatString; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 147 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 148 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -78300,6 +79593,7 @@ var ts; var lineStart; var indent; resetWriter(); + var unknownWrite = function (text) { return writeKind(text, ts.SymbolDisplayPartKind.text); }; return { displayParts: function () { return displayParts; }, writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, @@ -78309,8 +79603,18 @@ var ts; writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, + writeLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeSymbol: writeSymbol, writeLine: writeLine, + write: unknownWrite, + writeTextOfNode: unknownWrite, + getText: function () { return ""; }, + getTextPos: function () { return 0; }, + getColumn: function () { return 0; }, + getLine: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + rawWrite: ts.notImplemented, + getIndent: function () { return indent; }, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, @@ -78431,14 +79735,17 @@ var ts; /** * The default is CRLF. */ - function getNewLineOrDefaultFromHost(host) { - return host.getNewLine ? host.getNewLine() : carriageReturnLineFeed; + function getNewLineOrDefaultFromHost(host, formatSettings) { + return (formatSettings && formatSettings.newLineCharacter) || + (host.getNewLine && host.getNewLine()) || + carriageReturnLineFeed; } ts.getNewLineOrDefaultFromHost = getNewLineOrDefaultFromHost; function lineBreakPart() { return displayPart("\n", ts.SymbolDisplayPartKind.lineBreak); } ts.lineBreakPart = lineBreakPart; + /* @internal */ function mapToDisplayParts(writeDisplayParts) { try { writeDisplayParts(displayPartWriter); @@ -78451,38 +79758,26 @@ var ts; ts.mapToDisplayParts = mapToDisplayParts; function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) { return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); }); } ts.typeToDisplayParts = typeToDisplayParts; function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { return mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags); + typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8 /* UseAliasDefinedOutsideCurrentScope */, writer); }); } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { - flags |= 65536 /* UseAliasDefinedOutsideCurrentScope */; + flags |= 16384 /* UseAliasDefinedOutsideCurrentScope */ | 1024 /* MultilineObjectLiterals */ | 32 /* WriteTypeArgumentsOfSignature */ | 8192 /* OmitParameterModifiers */; return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + typechecker.writeSignature(signature, enclosingDeclaration, flags, /*signatureKind*/ undefined, writer); }); } ts.signatureToDisplayParts = signatureToDisplayParts; - function getDeclaredName(typeChecker, symbol, location) { - // If this is an export or import specifier it could have been renamed using the 'as' syntax. - // If so we want to search for whatever is under the cursor. - if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 145 /* ComputedPropertyName */) { - return ts.getTextOfIdentifierOrLiteral(location); - } - // Try to get the local symbol if we're dealing with an 'export default' - // since that symbol has the "true" name. - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - return typeChecker.symbolToString(localExportDefaultSymbol || symbol); - } - ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 243 /* ImportSpecifier */ || location.parent.kind === 247 /* ExportSpecifier */) && + (location.parent.kind === 246 /* ImportSpecifier */ || location.parent.kind === 250 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -78493,12 +79788,16 @@ var ts; */ function stripQuotes(name) { var length = name.length; - if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && ts.isSingleOrDoubleQuote(name.charCodeAt(0))) { + if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { return name.substring(1, length - 1); } return name; } ts.stripQuotes = stripQuotes; + function startsWithQuote(name) { + return ts.isSingleOrDoubleQuote(name.charCodeAt(0)); + } + ts.startsWithQuote = startsWithQuote; function scriptKindIs(fileName, host) { var scriptKinds = []; for (var _i = 2; _i < arguments.length; _i++) { @@ -78525,57 +79824,6 @@ var ts; return position; } ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; - function getOpenBrace(constructor, sourceFile) { - // First token is the open curly, this is where we want to put the 'super' call. - return constructor.body.getFirstToken(sourceFile); - } - ts.getOpenBrace = getOpenBrace; - function getOpenBraceOfClassLike(declaration, sourceFile) { - return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1, /*includeJsDocComment*/ false); - } - ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; - function getSourceFileImportLocation(_a) { - var text = _a.text; - var shebang = ts.getShebang(text); - var position = 0; - if (shebang !== undefined) { - position = shebang.length; - advancePastLineBreak(); - } - // For a source file, it is possible there are detached comments we should not skip - var ranges = ts.getLeadingCommentRanges(text, position); - if (!ranges) - return position; - // However we should still skip a pinned comment at the top - if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { - position = ranges[0].end; - advancePastLineBreak(); - ranges = ranges.slice(1); - } - // As well as any triple slash references - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { - position = range.end; - advancePastLineBreak(); - continue; - } - break; - } - return position; - function advancePastLineBreak() { - if (position < text.length) { - var charCode = text.charCodeAt(position); - if (ts.isLineBreak(charCode)) { - position++; - if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) { - position++; - } - } - } - } - } - ts.getSourceFileImportLocation = getSourceFileImportLocation; /** * Creates a deep, memberwise clone of a node with no source map location. * @@ -78607,6 +79855,10 @@ var ts; return visited; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(getSynthesizedDeepClone), nodes.hasTrailingComma); + } + ts.getSynthesizedDeepClones = getSynthesizedDeepClones; /** * Sets EmitFlags to suppress leading and trailing trivia on the node. */ @@ -78702,114 +79954,114 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 227 /* VariableDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 230 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return spanInVariableDeclaration(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return spanInParameterDeclaration(node); - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanInBlock(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInBlock(node.block); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return spanInForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 177 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 180 /* BindingElement */: // span on complete node return textSpan(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 148 /* Decorator */: + case 149 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return undefined; // Tokens: case 25 /* SemicolonToken */: @@ -78839,7 +80091,7 @@ var ts; case 74 /* CatchKeyword */: case 87 /* FinallyKeyword */: return spanInNextNode(node); - case 143 /* OfKeyword */: + case 144 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -78849,16 +80101,16 @@ var ts; return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } // Set breakpoint on identifier element of destructuring pattern - // a or ...c or d: x from - // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern + // `a` or `...c` or `d: x` from + // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 71 /* Identifier */ || - node.kind === 199 /* SpreadElement */ || - node.kind === 265 /* PropertyAssignment */ || - node.kind === 266 /* ShorthandPropertyAssignment */) && + node.kind === 202 /* SpreadElement */ || + node.kind === 268 /* PropertyAssignment */ || + node.kind === 269 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 195 /* BinaryExpression */) { + if (node.kind === 198 /* BinaryExpression */) { var binaryExpression = node; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -78881,22 +80133,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (node.parent.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 148 /* Decorator */: + case 149 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return textSpan(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (node.parent.operatorToken.kind === 26 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -78905,13 +80157,13 @@ var ts; } } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 265 /* PropertyAssignment */ && + if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 185 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 188 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNextNode(node.parent.type); } // return type of function go to previous token @@ -78919,8 +80171,8 @@ var ts; return spanInPreviousNode(node); } // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 227 /* VariableDeclaration */ || - node.parent.kind === 147 /* Parameter */)) { + if ((node.parent.kind === 230 /* VariableDeclaration */ || + node.parent.kind === 148 /* Parameter */)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -78928,7 +80180,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 195 /* BinaryExpression */) { + if (node.parent.kind === 198 /* BinaryExpression */) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -78942,7 +80194,7 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (variableDeclaration.parent.kind === 231 /* VariableDeclarationList */ && variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); @@ -78954,7 +80206,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 216 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 219 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -78965,10 +80217,10 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 217 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 220 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (variableDeclaration.parent.kind === 231 /* VariableDeclarationList */ && variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and @@ -78992,8 +80244,9 @@ var ts; } else { var functionDeclaration = parameter.parent; - var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); - if (indexOfParameter) { + var indexOfParameter = functionDeclaration.parameters.indexOf(parameter); + ts.Debug.assert(indexOfParameter !== -1); + if (indexOfParameter !== 0) { // Not a first parameter, go to previous parameter return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); } @@ -79005,7 +80258,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 230 /* ClassDeclaration */ && functionDeclaration.kind !== 153 /* Constructor */); + (functionDeclaration.parent.kind === 233 /* ClassDeclaration */ && functionDeclaration.kind !== 154 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -79028,26 +80281,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // falls through // Set on parent if on same line otherwise on first statement - case 214 /* WhileStatement */: - case 212 /* IfStatement */: - case 216 /* ForInStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 219 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 231 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -79072,23 +80325,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 177 /* BindingElement */) { + if (bindingPattern.parent.kind === 180 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 176 /* ArrayBindingPattern */ && node.kind !== 175 /* ObjectBindingPattern */); - var elements = node.kind === 178 /* ArrayLiteralExpression */ ? - node.elements : - node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 179 /* ArrayBindingPattern */ && node.kind !== 178 /* ObjectBindingPattern */); + var elements = node.kind === 181 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -79096,18 +80347,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 195 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 198 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -79115,25 +80366,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 233 /* EnumDeclaration */: - case 230 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -79141,7 +80392,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -79157,7 +80408,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -79172,12 +80423,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 213 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 182 /* CallExpression */ || - node.parent.kind === 183 /* NewExpression */) { + if (node.parent.kind === 216 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 185 /* CallExpression */ || + node.parent.kind === 186 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 186 /* ParenthesizedExpression */) { + if (node.parent.kind === 189 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -79186,21 +80437,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 186 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 189 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -79210,20 +80461,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ || - node.parent.kind === 147 /* Parameter */) { + node.parent.kind === 268 /* PropertyAssignment */ || + node.parent.kind === 148 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 185 /* TypeAssertionExpression */) { + if (node.parent.kind === 188 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 213 /* DoStatement */) { + if (node.parent.kind === 216 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -79231,7 +80482,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.kind === 220 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -79343,10 +80594,10 @@ var ts; } break; case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -79484,7 +80735,7 @@ var ts; var lastEnd = 0; for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_6 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; // Make a whitespace entry between the last item and this one. if (lastEnd >= 0) { @@ -79493,8 +80744,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_6, classification: convertClassification(type) }); - lastEnd = start + length_6; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -79532,7 +80783,7 @@ var ts; } switch (keyword2) { case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 123 /* ConstructorKeyword */: case 115 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -79671,10 +80922,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -79817,32 +81068,39 @@ var ts; if (!ts.isTrivia(kind)) { return start; } - // Don't bother with newlines/whitespace. - if (kind === 4 /* NewLineTrivia */ || kind === 5 /* WhitespaceTrivia */) { - continue; - } - // Only bother with the trivia if it at least intersects the span of interest. - if (ts.isComment(kind)) { - classifyComment(token, kind, start, width); - // Classifying a comment might cause us to reuse the trivia scanner - // (because of jsdoc comments). So after we classify the comment make - // sure we set the scanner position back to where it needs to be. - triviaScanner.setTextPos(end); - continue; - } - if (kind === 7 /* ConflictMarkerTrivia */) { - var text = sourceFile.text; - var ch = text.charCodeAt(start); - // for the <<<<<<< and >>>>>>> markers, we just add them in as comments - // in the classification stream. - if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - pushClassification(start, width, 1 /* comment */); + switch (kind) { + case 4 /* NewLineTrivia */: + case 5 /* WhitespaceTrivia */: + // Don't bother with newlines/whitespace. continue; - } - // for the ||||||| and ======== markers, add a comment for the first line, - // and then lex all subsequent lines up until the end of the conflict marker. - ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); - classifyDisabledMergeCode(text, start, end); + case 2 /* SingleLineCommentTrivia */: + case 3 /* MultiLineCommentTrivia */: + // Only bother with the trivia if it at least intersects the span of interest. + classifyComment(token, kind, start, width); + // Classifying a comment might cause us to reuse the trivia scanner + // (because of jsdoc comments). So after we classify the comment make + // sure we set the scanner position back to where it needs to be. + triviaScanner.setTextPos(end); + continue; + case 7 /* ConflictMarkerTrivia */: + var text = sourceFile.text; + var ch = text.charCodeAt(start); + // for the <<<<<<< and >>>>>>> markers, we just add them in as comments + // in the classification stream. + if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { + pushClassification(start, width, 1 /* comment */); + continue; + } + // for the ||||||| and ======== markers, add a comment for the first line, + // and then lex all subsequent lines up until the end of the conflict marker. + ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); + classifyDisabledMergeCode(text, start, end); + break; + case 6 /* ShebangTrivia */: + // TODO: Maybe we should classify these. + break; + default: + ts.Debug.assertNever(kind); } } } @@ -79878,16 +81136,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -79974,22 +81232,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -80004,7 +81262,7 @@ var ts; if (ts.isKeyword(tokenKind)) { return 3 /* keyword */; } - // Special case < and > If they appear in a generic context they are punctuation, + // Special case `<` and `>`: If they appear in a generic context they are punctuation, // not operators. if (tokenKind === 27 /* LessThanToken */ || tokenKind === 29 /* GreaterThanToken */) { // If the node owning the token has a type argument list or type parameter list, then @@ -80017,17 +81275,17 @@ var ts; if (token) { if (tokenKind === 58 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 227 /* VariableDeclaration */ || - token.parent.kind === 150 /* PropertyDeclaration */ || - token.parent.kind === 147 /* Parameter */ || - token.parent.kind === 257 /* JsxAttribute */) { + if (token.parent.kind === 230 /* VariableDeclaration */ || + token.parent.kind === 151 /* PropertyDeclaration */ || + token.parent.kind === 148 /* Parameter */ || + token.parent.kind === 260 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 195 /* BinaryExpression */ || - token.parent.kind === 193 /* PrefixUnaryExpression */ || - token.parent.kind === 194 /* PostfixUnaryExpression */ || - token.parent.kind === 196 /* ConditionalExpression */) { + if (token.parent.kind === 198 /* BinaryExpression */ || + token.parent.kind === 196 /* PrefixUnaryExpression */ || + token.parent.kind === 197 /* PostfixUnaryExpression */ || + token.parent.kind === 199 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -80037,7 +81295,7 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 257 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 260 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 12 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -80053,32 +81311,32 @@ var ts; else if (tokenKind === 71 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 147 /* Parameter */: + case 148 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -80114,11 +81372,14 @@ var ts; (function (Completions) { var PathCompletions; (function (PathCompletions) { - function getStringLiteralCompletionsFromModuleNames(node, compilerOptions, host, typeChecker) { + function createPathCompletion(name, kind, span) { + return { name: name, kind: kind, span: span }; + } + function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); - var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); + var span = getDirectoryFragmentTextSpan(node.text, node.getStart(sourceFile) + 1); if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { @@ -80198,12 +81459,12 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles.get(foundFileName)) { + if (!foundFiles.has(foundFileName)) { foundFiles.set(foundFileName, true); } } ts.forEachKey(foundFiles, function (foundFile) { - result.push(createCompletionEntryForModule(foundFile, "script" /* scriptElement */, span)); + result.push(createPathCompletion(foundFile, "script" /* scriptElement */, span)); }); } // If possible, get folder completion as well @@ -80212,7 +81473,7 @@ var ts; for (var _a = 0, directories_1 = directories; _a < directories_1.length; _a++) { var directory = directories_1[_a]; var directoryName = ts.getBaseFileName(ts.normalizePath(directory)); - result.push(createCompletionEntryForModule(directoryName, "directory" /* directory */, span)); + result.push(createPathCompletion(directoryName, "directory" /* directory */, span)); } } } @@ -80233,37 +81494,20 @@ var ts; var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host, /*exclude*/ undefined, result); - var _loop_6 = function (path) { - if (!paths.hasOwnProperty(path)) - return "continue"; - var patterns = paths[path]; - if (!patterns) - return "continue"; - if (path === "*") { - for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) { - var pattern = patterns_1[_i]; - var _loop_7 = function (match) { - // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. - if (result.some(function (entry) { return entry.name === match; })) - return "continue"; - result.push(createCompletionEntryForModule(match, "external module name" /* externalModuleName */, span)); - }; - for (var _a = 0, _b = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _a < _b.length; _a++) { - var match = _b[_a]; - _loop_7(match); - } - } - } - else if (ts.startsWith(path, fragment)) { - if (patterns.length === 1) { - if (result.some(function (entry) { return entry.name === path; })) - return "continue"; - result.push(createCompletionEntryForModule(path, "external module name" /* externalModuleName */, span)); - } - } - }; for (var path in paths) { - _loop_6(path); + var patterns = paths[path]; + if (paths.hasOwnProperty(path) && patterns) { + var _loop_7 = function (name, kind) { + // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. + if (!result.some(function (entry) { return entry.name === name; })) { + result.push(createPathCompletion(name, kind, span)); + } + }; + for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host); _i < _a.length; _i++) { + var _b = _a[_i], name = _b.name, kind = _b.kind; + _loop_7(name, kind); + } + } } } if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) { @@ -80275,50 +81519,63 @@ var ts; }); } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _i = 0, _a = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + for (var _c = 0, _d = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _c < _d.length; _c++) { + var moduleName = _d[_c]; + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { - if (host.readDirectory) { - var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; - if (parsed) { - // The prefix has two effective parts: the directory path and the base component after the filepath that is not a - // full directory component. For example: directory/path/of/prefix/base* - var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); - var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); - var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); - var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); - // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call - var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; - var normalizedSuffix = ts.normalizePath(parsed.suffix); - var baseDirectory = ts.combinePaths(baseUrl, expandedPrefixDirectory); - var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; - // If we have a suffix, then we need to read the directory all the way down. We could create a glob - // that encodes the suffix, but we would have to escape the character "?" which readDirectory - // doesn't support. For now, this is safer but slower - var includeGlob = normalizedSuffix ? "**/*" : "./*"; - var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]); - if (matches) { - var result = []; - // Trim away prefix and suffix - for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { - var match = matches_1[_i]; - var normalizedMatch = ts.normalizePath(match); - if (!ts.endsWith(normalizedMatch, normalizedSuffix) || !ts.startsWith(normalizedMatch, completePrefix)) { - continue; - } - var start = completePrefix.length; - var length_7 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_7))); - } - return result; - } - } + function getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host) { + if (!ts.endsWith(path, "*")) { + // For a path mapping "foo": ["/x/y/z.ts"], add "foo" itself as a completion. + return !ts.stringContains(path, "*") && ts.startsWith(path, fragment) ? [{ name: path, kind: "directory" /* directory */ }] : ts.emptyArray; } - return undefined; + var pathPrefix = path.slice(0, path.length - 1); + if (!ts.startsWith(fragment, pathPrefix)) { + return [{ name: pathPrefix, kind: "directory" /* directory */ }]; + } + var remainingFragment = fragment.slice(pathPrefix.length); + return ts.flatMap(patterns, function (pattern) { return getModulesForPathsPattern(remainingFragment, baseUrl, pattern, fileExtensions, host); }); + } + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { + if (!host.readDirectory) { + return undefined; + } + var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; + if (!parsed) { + return undefined; + } + // The prefix has two effective parts: the directory path and the base component after the filepath that is not a + // full directory component. For example: directory/path/of/prefix/base* + var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); + var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); + var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); + var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); + // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call + var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; + var normalizedSuffix = ts.normalizePath(parsed.suffix); + // Need to normalize after combining: If we combinePaths("a", "../b"), we want "b" and not "a/../b". + var baseDirectory = ts.normalizePath(ts.combinePaths(baseUrl, expandedPrefixDirectory)); + var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + // If we have a suffix, then we need to read the directory all the way down. We could create a glob + // that encodes the suffix, but we would have to escape the character "?" which readDirectory + // doesn't support. For now, this is safer but slower + var includeGlob = normalizedSuffix ? "**/*" : "./*"; + var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]).map(function (name) { return ({ name: name, kind: "script" /* scriptElement */ }); }); + var directories = tryGetDirectories(host, baseDirectory).map(function (d) { return ts.combinePaths(baseDirectory, d); }).map(function (name) { return ({ name: name, kind: "directory" /* directory */ }); }); + // Trim away prefix and suffix + return ts.mapDefined(ts.concatenate(matches, directories), function (_a) { + var name = _a.name, kind = _a.kind; + var normalizedMatch = ts.normalizePath(name); + var inner = withoutStartAndEnd(normalizedMatch, completePrefix, normalizedSuffix); + return inner !== undefined ? { name: removeLeadingDirectorySeparator(ts.removeFileExtension(inner)), kind: kind } : undefined; + }); + } + function withoutStartAndEnd(s, start, end) { + return ts.startsWith(s, start) && ts.endsWith(s, end) ? s.slice(start.length, s.length - end.length) : undefined; + } + function removeLeadingDirectorySeparator(path) { + return path[0] === ts.directorySeparator ? path.slice(1) : path; } function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { // Check If this is a nested module @@ -80390,10 +81647,12 @@ var ts; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } // Check for typings specified in compiler options + var seen = ts.createMap(); if (options.types) { for (var _i = 0, _a = options.types; _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + var typesName = _a[_i]; + var moduleName = ts.getUnmangledNameForScopedPackage(typesName); + pushResult(moduleName); } } else if (host.getDirectories) { @@ -80405,31 +81664,38 @@ var ts; if (typeRoots) { for (var _c = 0, typeRoots_2 = typeRoots; _c < typeRoots_2.length; _c++) { var root = typeRoots_2[_c]; - getCompletionEntriesFromDirectories(host, root, span, result); + getCompletionEntriesFromDirectories(root); } } - } - if (host.getDirectories) { // Also get all @types typings installed in visible node_modules directories for (var _d = 0, _e = findPackageJsons(scriptPath, host); _d < _e.length; _d++) { var packageJson = _e[_d]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); - getCompletionEntriesFromDirectories(host, typesDir, span, result); + getCompletionEntriesFromDirectories(typesDir); } } return result; - } - function getCompletionEntriesFromDirectories(host, directory, span, result) { - if (host.getDirectories && tryDirectoryExists(host, directory)) { - var directories = tryGetDirectories(host, directory); - if (directories) { - for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { - var typeDirectory = directories_2[_i]; - typeDirectory = ts.normalizePath(typeDirectory); - result.push(createCompletionEntryForModule(ts.getBaseFileName(typeDirectory), "external module name" /* externalModuleName */, span)); + function getCompletionEntriesFromDirectories(directory) { + ts.Debug.assert(!!host.getDirectories); + if (tryDirectoryExists(host, directory)) { + var directories = tryGetDirectories(host, directory); + if (directories) { + for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { + var typeDirectory = directories_2[_i]; + typeDirectory = ts.normalizePath(typeDirectory); + var directoryName = ts.getBaseFileName(typeDirectory); + var moduleName = ts.getUnmangledNameForScopedPackage(directoryName); + pushResult(moduleName); + } } } } + function pushResult(moduleName) { + if (!seen.has(moduleName)) { + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); + seen.set(moduleName, true); + } + } } function findPackageJsons(directory, host) { var paths = []; @@ -80488,9 +81754,6 @@ var ts; } } } - function createCompletionEntryForModule(name, kind, replacementSpan) { - return { name: name, kind: kind, kindModifiers: "" /* none */, sortText: name, replacementSpan: replacementSpan }; - } // Replace everything after the last directory seperator that appears function getDirectoryFragmentTextSpan(text, textStart) { var index = text.lastIndexOf(ts.directorySeparator); @@ -80507,7 +81770,13 @@ var ts; return false; } function normalizeAndPreserveTrailingSlash(path) { - return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); + if (ts.normalizeSlashes(path) === "./") { + // normalizePath turns "./" into "". "" + "/" would then be a rooted path instead of a relative one, so avoid this particular case. + // There is no problem for adding "/" to a non-empty string -- it's only a problem at the beginning. + return ""; + } + var norm = ts.normalizePath(path); + return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(norm) : norm; } /** * Matches a triple slash reference directive with an incomplete string literal for its path. Used @@ -80524,10 +81793,10 @@ var ts; var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* completion list at "1" will contain "div" with type any + // var x =
+ // The completion list at "1" will contain "div" with type any var tagName = location.parent.parent.openingElement.tagName; return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [{ @@ -80596,37 +81923,37 @@ var ts; sortText: "0", }] }; } - if (request) { - var entries_3 = request.kind === "JsDocTagName" - // If the current position is a jsDoc tag name, only tag names should be provided for completion - ? ts.JsDoc.getJSDocTagNameCompletions() - : request.kind === "JsDocTag" - // If the current position is a jsDoc tag, only tags should be provided for completion - ? ts.JsDoc.getJSDocTagCompletions() - : ts.JsDoc.getJSDocParameterNameCompletions(request.tag); - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_3 }; - } var entries = []; if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap); + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries); } else { if ((!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { return undefined; } - getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap); + getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); } // TODO add filter for keyword based on type/value/namespace and also location // Add all keywords if // - this is not a member completion list (all the keywords) // - other filters are enabled in required scenario so add those keywords + var isMemberCompletion = isMemberCompletionKind(completionKind); if (keywordFilters !== 0 /* None */ || !isMemberCompletion) { ts.addRange(entries, getKeywordCompletions(keywordFilters)); } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + return { isGlobalCompletion: completionKind === 1 /* Global */, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + } + function isMemberCompletionKind(kind) { + switch (kind) { + case 0 /* ObjectPropertyDeclaration */: + case 3 /* MemberLike */: + case 2 /* PropertyAccess */: + return true; + default: + return false; + } } - Completions.getCompletionsAtPosition = getCompletionsAtPosition; function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames, target, entries) { ts.getNameTable(sourceFile).forEach(function (pos, name) { // Skip identifiers produced only from the current location @@ -80634,14 +81961,9 @@ var ts; return; } var realName = ts.unescapeLeadingUnderscores(name); - if (uniqueNames.has(realName) || ts.isStringANonContextualKeyword(realName)) { - return; - } - uniqueNames.set(realName, true); - var displayName = getCompletionEntryDisplayName(realName, target, /*performCharacterChecks*/ true, /*allowStringLiteral*/ false); - if (displayName) { + if (ts.addToSeen(uniqueNames, realName) && ts.isIdentifierText(realName, target) && !ts.isStringANonContextualKeyword(realName)) { entries.push({ - name: displayName, + name: realName, kind: "warning" /* warning */, kindModifiers: "", sortText: "1" @@ -80649,12 +81971,35 @@ var ts; } }); } - function createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target, allowStringLiteral, origin, recommendedCompletion) { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, allowStringLiteral, origin); - if (!displayName) { + function createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, includeInsertTextCompletions) { + var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind); + if (!info) { + return undefined; + } + var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess; + var insertText; + var replacementSpan; + if (includeInsertTextCompletions) { + if (origin && origin.type === "this-type") { + insertText = needsConvertPropertyAccess ? "this[" + quote(name) + "]" : "this." + name; + } + else if (needsConvertPropertyAccess) { + insertText = "[" + quote(name) + "]"; + var dot = ts.findChildOfKind(propertyAccessToConvert, 23 /* DotToken */, sourceFile); + // If the text after the '.' starts with this name, write over it. Else, add new text. + var end = ts.startsWith(name, propertyAccessToConvert.name.text) ? propertyAccessToConvert.name.end : dot.end; + replacementSpan = ts.createTextSpanFromBounds(dot.getStart(sourceFile), end); + } + if (isJsxInitializer) { + if (insertText === undefined) + insertText = name; + insertText = "{" + insertText + "}"; + if (typeof isJsxInitializer !== "boolean") { + replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile); + } + } + } + if (insertText !== undefined && !includeInsertTextCompletions) { return undefined; } // TODO(drosen): Right now we just permit *all* semantic meanings when calling @@ -80665,15 +82010,21 @@ var ts; // Use a 'sortText' of 0' so that all symbol completion entries come before any other // entries (like JavaScript identifier entries). return { - name: displayName, + name: name, kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), sortText: "0", source: getSourceFromOrigin(origin), - hasAction: trueOrUndefined(origin !== undefined), + hasAction: trueOrUndefined(!!origin && origin.type === "export"), isRecommended: trueOrUndefined(isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker)), + insertText: insertText, + replacementSpan: replacementSpan, }; } + function quote(text) { + // TODO: GH#20619 Use configured quote style + return JSON.stringify(text); + } function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { return localSymbol === recommendedCompletion || !!(localSymbol.flags & 1048576 /* ExportValue */) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion; @@ -80682,213 +82033,194 @@ var ts; return b ? true : undefined; } function getSourceFromOrigin(origin) { - return origin && ts.stripQuotes(origin.moduleSymbol.name); + return origin && origin.type === "export" ? ts.stripQuotes(origin.moduleSymbol.name) : undefined; } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks, typeChecker, target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap) { + function getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, target, log, kind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap) { var start = ts.timestamp(); // Tracks unique names. // We don't set this for global variables or completions from external module exports, because we can have multiple of those. // Based on the order we add things we will always see locals first, then globals, then module exports. // So adding a completion for a local will prevent us from adding completions for external module exports sharing the same name. var uniques = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_5 = symbols; _i < symbols_5.length; _i++) { - var symbol = symbols_5[_i]; - var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined; - var entry = createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target, allowStringLiteral, origin, recommendedCompletion); - if (!entry) { - continue; - } - var name = entry.name; - if (uniques.has(name)) { - continue; - } - // Latter case tests whether this is a global variable. - if (!origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }))) { - uniques.set(name, true); - } - entries.push(entry); + for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { + var symbol = symbols_4[_i]; + var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined; + var entry = createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, includeInsertTextCompletions); + if (!entry) { + continue; } + var name = entry.name; + if (uniques.has(name)) { + continue; + } + // Latter case tests whether this is a global variable. + if (!origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }))) { + uniques.set(name, true); + } + entries.push(entry); } log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); return uniques; } - function getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9 /* StringLiteral */) { - return undefined; - } - if (node.parent.kind === 265 /* PropertyAssignment */ && - node.parent.parent.kind === 179 /* ObjectLiteralExpression */ && - node.parent.name === node) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent, typeChecker, compilerOptions.target, log); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - return getStringLiteralCompletionEntriesFromElementAccess(node.parent, typeChecker, compilerOptions.target, log); - } - else if (node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */ - || ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent) - || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node)) { - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // var y = import("/*completion position*/"); - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - // export * from "/*completion position*/"; - var entries = Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(node, compilerOptions, host, typeChecker); - return pathCompletionsInfo(entries); - } - else if (isEqualityExpression(node.parent)) { - // Get completions from the type of the other operand - // i.e. switch (a) { - // case '/*completion position*/' - // } - return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.left === node ? node.parent.right : node.parent.left), typeChecker); - } - else if (ts.isCaseOrDefaultClause(node.parent)) { - // Get completions from the type of the switch expression - // i.e. x === '/*completion position' - return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.parent.parent.expression), typeChecker); - } - else { - var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker); - } - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(node), typeChecker); + function getLabelCompletionAtPosition(node) { + var entries = getLabelStatementCompletions(node); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } } - function pathCompletionsInfo(entries) { - return { - // We don't want the editor to offer any other completions, such as snippets, inside a comment. - isGlobalCompletion: false, - isMemberCompletion: false, - // The user may type in a path that doesn't yet exist, creating a "new identifier" - // with respect to the collection of identifiers the server is aware of. - isNewIdentifierLocation: true, - entries: entries, - }; - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element, typeChecker, target, log) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false, typeChecker, target, log, /*allowStringLiteral*/ true); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { - var candidates = []; + function getLabelStatementCompletions(node) { var entries = []; var uniques = ts.createMap(); - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates, argumentInfo.argumentCount); - for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { - var candidate = candidates_1[_i]; - addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker, uniques); - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node, typeChecker, target, log) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false, typeChecker, target, log, /*allowStringLiteral*/ true); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + var current = node; + while (current) { + if (ts.isFunctionLike(current)) { + break; } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromType(type, typeChecker) { - if (type) { - var entries = []; - addStringLiteralCompletionsFromType(type, entries, typeChecker); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; + if (ts.isLabeledStatement(current)) { + var name = current.label.text; + if (!uniques.has(name)) { + uniques.set(name, true); + entries.push({ + name: name, + kindModifiers: "" /* none */, + kind: "label" /* label */, + sortText: "0" + }); + } } + current = current.parent; } - return undefined; + return entries; } - function addStringLiteralCompletionsFromType(type, result, typeChecker, uniques) { + var StringLiteralCompletionKind; + (function (StringLiteralCompletionKind) { + StringLiteralCompletionKind[StringLiteralCompletionKind["Paths"] = 0] = "Paths"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Properties"] = 1] = "Properties"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; + })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); + function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { + switch (node.parent.kind) { + case 177 /* LiteralType */: + switch (node.parent.parent.kind) { + case 161 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(node.parent), typeChecker) }; + case 175 /* IndexedAccessType */: + // Get all apparent property names + // i.e. interface Foo { + // foo: string; + // bar: string; + // } + // let x: Foo["/*completion position*/"] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeFromTypeNode(node.parent.parent.objectType).getApparentProperties() }; + default: + return undefined; + } + case 268 /* PropertyAssignment */: + if (ts.isObjectLiteralExpression(node.parent.parent) && node.parent.name === node) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + var type = typeChecker.getContextualType(node.parent.parent); + return { kind: 1 /* Properties */, symbols: type && type.getApparentProperties() }; + } + return fromContextualType(); + case 184 /* ElementAccessExpression */: { + var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeAtLocation(expression).getApparentProperties() }; + } + return undefined; + } + case 185 /* CallExpression */: + case 186 /* NewExpression */: + if (!ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) && !ts.isImportCall(node.parent)) { + var argumentInfo_1 = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + if (argumentInfo_1) { + var candidates = []; + typeChecker.getResolvedSignature(argumentInfo_1.invocation, candidates, argumentInfo_1.argumentCount); + var uniques_1 = ts.createMap(); + return { kind: 2 /* Types */, types: ts.flatMap(candidates, function (candidate) { return getStringLiteralTypes(typeChecker.getParameterType(candidate, argumentInfo_1.argumentIndex), typeChecker, uniques_1); }) }; + } + return fromContextualType(); + } + // falls through (is `require("")` or `import("")`) + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 252 /* ExternalModuleReference */: + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // var y = import("/*completion position*/"); + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + // export * from "/*completion position*/"; + return { kind: 0 /* Paths */, paths: Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; + default: + return fromContextualType(); + } + function fromContextualType() { + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker), typeChecker) }; + } + } + function getStringLiteralTypes(type, typeChecker, uniques) { if (uniques === void 0) { uniques = ts.createMap(); } if (type && type.flags & 32768 /* TypeParameter */) { - type = typeChecker.getBaseConstraintOfType(type); - } - if (!type) { - return; - } - if (type.flags & 131072 /* Union */) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - addStringLiteralCompletionsFromType(t, result, typeChecker, uniques); - } - } - else if (type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */)) { - var name = type.value; - if (!uniques.has(name)) { - uniques.set(name, true); - result.push({ - name: name, - kindModifiers: "" /* none */, - kind: "var" /* variableElement */, - sortText: "0" - }); - } + type = type.getConstraint(); } + return type && type.flags & 131072 /* Union */ + ? ts.flatMap(type.types, function (t) { return getStringLiteralTypes(t, typeChecker, uniques); }) + : type && type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */) && ts.addToSeen(uniques, type.value) + ? [type] + : ts.emptyArray; } function getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, _a, allSourceFiles) { var name = _a.name, source = _a.source; - var completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, { includeExternalModuleExports: true }, compilerOptions.target); + var completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, { includeExternalModuleExports: true, includeInsertTextCompletions: true }, compilerOptions.target); if (!completionData) { return { type: "none" }; } - var symbols = completionData.symbols, location = completionData.location, allowStringLiteral = completionData.allowStringLiteral, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, request = completionData.request; - if (request) { - return { type: "request", request: request }; + if (completionData.kind !== 0 /* Data */) { + return { type: "request", request: completionData }; } + var symbols = completionData.symbols, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.find(symbols, function (s) { - var origin = symbolToOriginInfoMap[ts.getSymbolId(s)]; - return getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral, origin) === name - && getSourceFromOrigin(origin) === source; - }); - return symbol ? { type: "symbol", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap } : { type: "none" }; + return ts.firstDefined(symbols, function (symbol) { + var origin = symbolToOriginInfoMap[ts.getSymbolId(symbol)]; + var info = getCompletionEntryDisplayNameForSymbol(symbol, compilerOptions.target, origin, completionKind); + return info && info.name === name && getSourceFromOrigin(origin) === source ? { type: "symbol", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap, previousToken: previousToken, isJsxInitializer: isJsxInitializer } : undefined; + }) || { type: "none" }; } function getSymbolName(symbol, origin, target) { - return origin && origin.isDefaultExport && symbol.name === "default" ? ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) : symbol.name; + return origin && origin.type === "export" && origin.isDefaultExport && symbol.escapedName === "default" /* Default */ + // Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase. + ? ts.firstDefined(symbol.declarations, function (d) { return ts.isExportAssignment(d) && ts.isIdentifier(d.expression) ? d.expression.text : undefined; }) + || ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) + : symbol.name; } - function getCompletionEntryDetails(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles, host, formatContext, getCanonicalFileName) { + function getCompletionEntryDetails(program, log, compilerOptions, sourceFile, position, entryId, allSourceFiles, host, formatContext, getCanonicalFileName) { + var typeChecker = program.getTypeChecker(); var name = entryId.name; // Compute all the completion symbols again. var symbolCompletion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); @@ -80896,26 +82228,26 @@ var ts; case "request": { var request = symbolCompletion.request; switch (request.kind) { - case "JsDocTagName": + case 1 /* JsDocTagName */: return ts.JsDoc.getJSDocTagNameCompletionDetails(name); - case "JsDocTag": + case 2 /* JsDocTag */: return ts.JsDoc.getJSDocTagCompletionDetails(name); - case "JsDocParameterName": + case 3 /* JsDocParameterName */: return ts.JsDoc.getJSDocParameterNameCompletionDetails(name); default: return ts.Debug.assertNever(request); } } case "symbol": { - var symbol = symbolCompletion.symbol, location = symbolCompletion.location, symbolToOriginInfoMap = symbolCompletion.symbolToOriginInfoMap; - var _a = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, typeChecker, host, compilerOptions, sourceFile, formatContext, getCanonicalFileName, allSourceFiles), codeActions = _a.codeActions, sourceDisplay = _a.sourceDisplay; + var symbol = symbolCompletion.symbol, location = symbolCompletion.location, symbolToOriginInfoMap = symbolCompletion.symbolToOriginInfoMap, previousToken = symbolCompletion.previousToken; + var _a = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, typeChecker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles), codeActions = _a.codeActions, sourceDisplay = _a.sourceDisplay; var kindModifiers = ts.SymbolDisplay.getSymbolModifiers(symbol); var _b = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location, location, 7 /* All */), displayParts = _b.displayParts, documentation = _b.documentation, symbolKind = _b.symbolKind, tags = _b.tags; return { name: name, kindModifiers: kindModifiers, kind: symbolKind, displayParts: displayParts, documentation: documentation, tags: tags, codeActions: codeActions, source: sourceDisplay }; } case "none": { // Didn't find a symbol with this name. See if we can find a keyword instead. - if (ts.some(getKeywordCompletions(0 /* None */), function (c) { return c.name === name; })) { + if (allKeywordsCompletions().some(function (c) { return c.name === name; })) { return { name: name, kind: "keyword" /* keyword */, @@ -80932,66 +82264,111 @@ var ts; } } Completions.getCompletionEntryDetails = getCompletionEntryDetails; - function getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, checker, host, compilerOptions, sourceFile, formatContext, getCanonicalFileName, allSourceFiles) { + function getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { var symbolOriginInfo = symbolToOriginInfoMap[ts.getSymbolId(symbol)]; - if (!symbolOriginInfo) { - return { codeActions: undefined, sourceDisplay: undefined }; - } - var moduleSymbol = symbolOriginInfo.moduleSymbol, isDefaultExport = symbolOriginInfo.isDefaultExport; - var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); - var moduleSymbols = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); - ts.Debug.assert(ts.contains(moduleSymbols, moduleSymbol)); - var sourceDisplay = [ts.textPart(ts.first(ts.codefix.getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, compilerOptions, getCanonicalFileName, host)))]; - var codeActions = ts.codefix.getCodeActionForImport(moduleSymbols, { - host: host, - checker: checker, - newLineCharacter: host.getNewLine(), - compilerOptions: compilerOptions, - sourceFile: sourceFile, - formatContext: formatContext, - symbolName: getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), - getCanonicalFileName: getCanonicalFileName, - symbolToken: undefined, - kind: isDefaultExport ? 1 /* Default */ : 0 /* Named */, - }); - return { sourceDisplay: sourceDisplay, codeActions: codeActions }; + return symbolOriginInfo && symbolOriginInfo.type === "export" + ? getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) + : { codeActions: undefined, sourceDisplay: undefined }; } - function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { - var result = []; - ts.codefix.forEachExternalModule(checker, allSourceFiles, function (module) { - for (var _i = 0, _a = checker.getExportsOfModule(module); _i < _a.length; _i++) { - var exported = _a[_i]; - if (ts.skipAlias(exported, checker) === exportedSymbol) { - result.push(module); - } - } - }); - return result; + function getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { + var moduleSymbol = symbolOriginInfo.moduleSymbol; + var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); + var _a = ts.codefix.getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, previousToken), moduleSpecifier = _a.moduleSpecifier, codeAction = _a.codeAction; + return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] }; } function getCompletionEntrySymbol(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles) { var completion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); return completion.type === "symbol" ? completion.symbol : undefined; } Completions.getCompletionEntrySymbol = getCompletionEntrySymbol; - function getRecommendedCompletion(currentToken, checker /*, symbolToOriginInfoMap: SymbolOriginInfoMap*/) { - var ty = checker.getContextualType(currentToken); + var CompletionDataKind; + (function (CompletionDataKind) { + CompletionDataKind[CompletionDataKind["Data"] = 0] = "Data"; + CompletionDataKind[CompletionDataKind["JsDocTagName"] = 1] = "JsDocTagName"; + CompletionDataKind[CompletionDataKind["JsDocTag"] = 2] = "JsDocTag"; + CompletionDataKind[CompletionDataKind["JsDocParameterName"] = 3] = "JsDocParameterName"; + })(CompletionDataKind || (CompletionDataKind = {})); + var CompletionKind; + (function (CompletionKind) { + CompletionKind[CompletionKind["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; + /** Note that sometimes we access completions from global scope, but use "None" instead of this. See isGlobalCompletionScope. */ + CompletionKind[CompletionKind["Global"] = 1] = "Global"; + CompletionKind[CompletionKind["PropertyAccess"] = 2] = "PropertyAccess"; + CompletionKind[CompletionKind["MemberLike"] = 3] = "MemberLike"; + CompletionKind[CompletionKind["String"] = 4] = "String"; + CompletionKind[CompletionKind["None"] = 5] = "None"; + })(CompletionKind || (CompletionKind = {})); + function getRecommendedCompletion(currentToken, position, sourceFile, checker) { + var ty = getContextualType(currentToken, position, sourceFile, checker); var symbol = ty && ty.symbol; // Don't include make a recommended completion for an abstract class return symbol && (symbol.flags & 384 /* Enum */ || symbol.flags & 32 /* Class */ && !ts.isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, currentToken, checker) : undefined; } + function getContextualType(currentToken, position, sourceFile, checker) { + var parent = currentToken.parent; + switch (currentToken.kind) { + case 71 /* Identifier */: + return getContextualTypeFromParent(currentToken, checker); + case 58 /* EqualsToken */: + switch (parent.kind) { + case 230 /* VariableDeclaration */: + return checker.getContextualType(parent.initializer); + case 198 /* BinaryExpression */: + return checker.getTypeAtLocation(parent.left); + case 260 /* JsxAttribute */: + return checker.getContextualTypeForJsxAttribute(parent); + default: + return undefined; + } + case 94 /* NewKeyword */: + return checker.getContextualType(parent); + case 73 /* CaseKeyword */: + return getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); + case 17 /* OpenBraceToken */: + return ts.isJsxExpression(parent) && parent.parent.kind !== 253 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + default: + var argInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(currentToken, position, sourceFile); + return argInfo + // At `,`, treat this as the next argument after the comma. + ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (currentToken.kind === 26 /* CommaToken */ ? 1 : 0)) + : isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) + // completion at `x ===/**/` should be for the right side + ? checker.getTypeAtLocation(parent.left) + : checker.getContextualType(currentToken); + } + } + function getContextualTypeFromParent(node, checker) { + var parent = node.parent; + switch (parent.kind) { + case 186 /* NewExpression */: + return checker.getContextualType(parent); + case 198 /* BinaryExpression */: { + var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return isEqualityOperatorKind(operatorToken.kind) + ? checker.getTypeAtLocation(node === right ? left : right) + : checker.getContextualType(node); + } + case 264 /* CaseClause */: + return parent.expression === node ? getSwitchedType(parent, checker) : undefined; + default: + return checker.getContextualType(node); + } + } + function getSwitchedType(caseClause, checker) { + return checker.getTypeAtLocation(caseClause.parent.parent.expression); + } function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { var chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ 67108863 /* All */, /*useOnlyExternalAliasing*/ false); if (chain) return ts.first(chain); - return isModuleSymbol(symbol.parent) ? symbol : symbol.parent && getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 269 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 272 /* SourceFile */; }); } function getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, options, target) { - var request; var start = ts.timestamp(); var currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); // TODO: GH#15853 // We will check for jsdoc comments with insideComment and getJsDocTagAtPosition. (TODO: that seems rather inefficient to check the same thing so many times.) @@ -81006,7 +82383,7 @@ var ts; if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { // The current position is next to the '@' sign, when no tag name being provided yet. // Provide a full list of tag names - request = { kind: "JsDocTagName" }; + return { kind: 1 /* JsDocTagName */ }; } else { // When completion is requested without "@", we will have check to make sure that @@ -81027,7 +82404,7 @@ var ts; // */ var lineStart = ts.getLineStartPositionForPosition(position, sourceFile); if (!(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/))) { - request = { kind: "JsDocTag" }; + return { kind: 2 /* JsDocTag */ }; } } } @@ -81037,37 +82414,22 @@ var ts; var tag = getJsDocTagAtPosition(currentToken, position); if (tag) { if (tag.tagName.pos <= position && position <= tag.tagName.end) { - request = { kind: "JsDocTagName" }; + return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 271 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 274 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ true); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 289 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 292 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); } } if (ts.isJSDocParameterTag(tag) && (ts.nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) { - request = { kind: "JsDocParameterName", tag: tag }; + return { kind: 3 /* JsDocParameterName */, tag: tag }; } } - if (request) { - return { - symbols: ts.emptyArray, - isGlobalCompletion: false, - isMemberCompletion: false, - allowStringLiteral: false, - isNewIdentifierLocation: false, - location: undefined, - isRightOfDot: false, - request: request, - keywordFilters: 0 /* None */, - symbolToOriginInfoMap: undefined, - recommendedCompletion: undefined, - }; - } if (!insideJsDocTagTypeExpression) { // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal // comment or the plain text part of a jsDoc comment, so no completion should be available @@ -81092,9 +82454,11 @@ var ts; // Also determine whether we are trying to complete with members of that node // or attributes of a JSX tag. var node = currentToken; + var propertyAccessToConvert; var isRightOfDot = false; var isRightOfOpenTag = false; var isStartingCloseTag = false; + var isJsxInitializer = false; var location = ts.getTouchingPropertyName(sourceFile, position, insideJsDocTagTypeExpression); // TODO: GH#15853 if (contextToken) { // Bail out if this is a known invalid completion location @@ -81104,57 +82468,82 @@ var ts; } var parent = contextToken.parent; if (contextToken.kind === 23 /* DotToken */) { - if (parent.kind === 180 /* PropertyAccessExpression */) { - node = contextToken.parent.expression; - isRightOfDot = true; - } - else if (parent.kind === 144 /* QualifiedName */) { - node = contextToken.parent.left; - isRightOfDot = true; - } - else { - // There is nothing that precedes the dot, so this likely just a stray character - // or leading into a '...' token. Just bail out instead. - return undefined; + isRightOfDot = true; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + propertyAccessToConvert = parent; + node = propertyAccessToConvert.expression; + break; + case 145 /* QualifiedName */: + node = parent.left; + break; + default: + // There is nothing that precedes the dot, so this likely just a stray character + // or leading into a '...' token. Just bail out instead. + return undefined; } } else if (sourceFile.languageVariant === 1 /* JSX */) { // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 180 /* PropertyAccessExpression */) { + if (parent && parent.kind === 183 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } + // Fix location + if (currentToken.parent === location) { + switch (currentToken.kind) { + case 29 /* GreaterThanToken */: + if (currentToken.parent.kind === 253 /* JsxElement */ || currentToken.parent.kind === 255 /* JsxOpeningElement */) { + location = currentToken; + } + break; + case 41 /* SlashToken */: + if (currentToken.parent.kind === 254 /* JsxSelfClosingElement */) { + location = currentToken; + } + break; + } + } switch (parent.kind) { - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (contextToken.kind === 41 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (!(parent.left.flags & 32768 /* ThisNodeHasError */)) { // It has a left-hand side, so we're not in an opening JSX tag. break; } // falls through - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: + case 255 /* JsxOpeningElement */: if (contextToken.kind === 27 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; + case 260 /* JsxAttribute */: + switch (previousToken.kind) { + case 58 /* EqualsToken */: + isJsxInitializer = true; + break; + case 71 /* Identifier */: + if (previousToken !== parent.name) { + isJsxInitializer = previousToken; + } + } + break; } } } var semanticStart = ts.timestamp(); - var isGlobalCompletion = false; - var isMemberCompletion; - var allowStringLiteral = false; - var isNewIdentifierLocation; + var completionKind = 5 /* None */; + var isNewIdentifierLocation = false; var keywordFilters = 0 /* None */; var symbols = []; var symbolToOriginInfoMap = []; @@ -81162,24 +82551,22 @@ var ts; getTypeScriptMemberSymbols(); } else if (isRightOfOpenTag) { - var tagSymbols = typeChecker.getJsxIntrinsicTagNames(); + var tagSymbols = ts.Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNames(), "getJsxIntrinsicTagNames() should all be defined"); if (tryGetGlobalSymbols()) { symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & (107455 /* Value */ | 2097152 /* Alias */)); })); } else { symbols = tagSymbols; } - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 3 /* MemberLike */; } else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; var tagSymbol = typeChecker.getSymbolAtLocation(tagName); - if (!typeChecker.isUnknownSymbol(tagSymbol)) { + if (tagSymbol) { symbols = [tagSymbol]; } - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 3 /* MemberLike */; } else { // For JavaScript or TypeScript, if we're not after a dot, then just try to get the @@ -81190,23 +82577,21 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - var recommendedCompletion = getRecommendedCompletion(previousToken, typeChecker); - return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, allowStringLiteral: allowStringLiteral, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request: request, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion }; + var recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, position, sourceFile, typeChecker); + return { kind: 0 /* Data */, symbols: symbols, completionKind: completionKind, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: - case 285 /* JSDocReturnTag */: - case 286 /* JSDocTypeTag */: - case 288 /* JSDocTypedefTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: + case 288 /* JSDocReturnTag */: + case 289 /* JSDocTypeTag */: + case 291 /* JSDocTypedefTag */: return true; } } function getTypeScriptMemberSymbols() { // Right of dot member completion list - isGlobalCompletion = false; - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 2 /* PropertyAccess */; // Since this is qualified name check its a type node location var isTypeLocation = insideJsDocTagTypeExpression || ts.isPartOfTypeNode(node.parent); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); @@ -81216,7 +82601,7 @@ var ts; symbol = ts.skipAlias(symbol, typeChecker); if (symbol.flags & (1536 /* Module */ | 384 /* Enum */)) { // Extract module or enum members - var exportedSymbols = typeChecker.getExportsOfModule(symbol); + var exportedSymbols = ts.Debug.assertEachDefined(typeChecker.getExportsOfModule(symbol), "getExportsOfModule() should all be defined"); var isValidValueAccess_1 = function (symbol) { return typeChecker.isValidPropertyAccess((node.parent), symbol.name); }; var isValidTypeAccess_1 = function (symbol) { return symbolCanBeReferencedAtTypeLocation(symbol); }; var isValidAccess = isRhsOfImportDeclaration ? @@ -81230,7 +82615,7 @@ var ts; } } // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). - if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 269 /* SourceFile */ && d.kind !== 234 /* ModuleDeclaration */ && d.kind !== 233 /* EnumDeclaration */; })) { + if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 272 /* SourceFile */ && d.kind !== 237 /* ModuleDeclaration */ && d.kind !== 236 /* EnumDeclaration */; })) { addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node)); } return; @@ -81251,10 +82636,9 @@ var ts; symbols.push.apply(symbols, getPropertiesForCompletion(type, typeChecker, /*isForAccess*/ true)); } else { - // Filter private properties for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccessForCompletions((node.parent), type, symbol)) { symbols.push(symbol); } } @@ -81275,7 +82659,7 @@ var ts; } if (tryGetConstructorLikeCompletionContainer(contextToken)) { // no members, only keywords - isMemberCompletion = false; + completionKind = 5 /* None */; // Declaring new property/method/accessor isNewIdentifierLocation = true; // Has keywords for constructor parameter @@ -81289,19 +82673,22 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 251 /* JsxSelfClosingElement */) || (jsxContainer.kind === 252 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 254 /* JsxSelfClosingElement */) || (jsxContainer.kind === 255 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes.properties); - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; isNewIdentifierLocation = false; return true; } } } + if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { + keywordFilters = 3 /* FunctionLikeBodyKeywords */; + } // Get all entities in the current scope. - isMemberCompletion = false; + completionKind = 5 /* None */; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); @@ -81335,40 +82722,55 @@ var ts; previousToken.getStart() : position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - if (scopeNode) { - isGlobalCompletion = - scopeNode.kind === 269 /* SourceFile */ || - scopeNode.kind === 197 /* TemplateExpression */ || - scopeNode.kind === 260 /* JsxExpression */ || - scopeNode.kind === 208 /* Block */ || // Some blocks aren't statements, but all get global completions - ts.isStatement(scopeNode); + if (isGlobalCompletionScope(scopeNode)) { + completionKind = 1 /* Global */; } var symbolMeanings = 793064 /* Type */ | 107455 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); + symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); + // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` + if (options.includeInsertTextCompletions && scopeNode.kind !== 272 /* SourceFile */) { + var thisType = typeChecker.tryGetThisTypeAt(scopeNode); + if (thisType) { + for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker, /*isForAccess*/ true); _i < _a.length; _i++) { + var symbol = _a[_i]; + symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { type: "this-type" }; + symbols.push(symbol); + } + } + } if (options.includeExternalModuleExports) { getSymbolsFromOtherSourceFileExports(symbols, previousToken && ts.isIdentifier(previousToken) ? previousToken.text : "", target); } filterGlobalCompletion(symbols); return true; } + function isGlobalCompletionScope(scopeNode) { + switch (scopeNode.kind) { + case 272 /* SourceFile */: + case 200 /* TemplateExpression */: + case 263 /* JsxExpression */: + case 211 /* Block */: + return true; + default: + return ts.isStatement(scopeNode); + } + } function filterGlobalCompletion(symbols) { + var isTypeCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + if (isTypeCompletion) + keywordFilters = 4 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { // export = /**/ here we want to get all meanings, so any symbol is ok if (ts.isExportAssignment(location.parent)) { return true; } - // This is an alias, follow what it aliases - if (symbol && symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } + symbol = ts.skipAlias(symbol, typeChecker); // import m = /**/ <-- It can only access namespace (if typing import = x. this would get member symbols and not namespace) if (ts.isInRightSideOfInternalImportEqualsDeclaration(location)) { return !!(symbol.flags & 1920 /* Namespace */); } - if (insideJsDocTagTypeExpression || - (!isContextTokenValueLocation(contextToken) && - (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)))) { + if (isTypeCompletion) { // Its a type, but you can reach it by namespace.type as well return symbolCanBeReferencedAtTypeLocation(symbol); } @@ -81380,24 +82782,25 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 103 /* TypeOfKeyword */ && - contextToken.parent.kind === 163 /* TypeQuery */; + contextToken.parent.kind === 164 /* TypeQuery */; } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 56 /* ColonToken */: - return parentKind === 150 /* PropertyDeclaration */ || - parentKind === 149 /* PropertySignature */ || - parentKind === 147 /* Parameter */ || - parentKind === 227 /* VariableDeclaration */ || + return parentKind === 151 /* PropertyDeclaration */ || + parentKind === 150 /* PropertySignature */ || + parentKind === 148 /* Parameter */ || + parentKind === 230 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 58 /* EqualsToken */: - return parentKind === 232 /* TypeAliasDeclaration */; + return parentKind === 235 /* TypeAliasDeclaration */; case 118 /* AsKeyword */: - return parentKind === 203 /* AsExpression */; + return parentKind === 206 /* AsExpression */; } } + return false; } function symbolCanBeReferencedAtTypeLocation(symbol) { symbol = symbol.exportSymbol || symbol; @@ -81418,27 +82821,24 @@ var ts; ts.codefix.forEachExternalModuleToImportFrom(typeChecker, sourceFile, allSourceFiles, function (moduleSymbol) { for (var _i = 0, _a = typeChecker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { var symbol = _a[_i]; - var name = symbol.name; // Don't add a completion for a re-export, only for the original. - // If `symbol.parent !== moduleSymbol`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. + // The actual import fix might end up coming from a re-export -- we don't compute that until getting completion details. + // This is just to avoid adding duplicate completion entries. + // + // If `symbol.parent !== ...`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. // If `some(...)`, this comes from an `export { foo } from "foo"` re-export, which creates a new symbol (thus isn't caught by the first check). - if (symbol.parent !== moduleSymbol || ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier; })) { + if (typeChecker.getMergedSymbol(symbol.parent) !== typeChecker.resolveExternalModuleSymbol(moduleSymbol) + || ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier; })) { continue; } - var isDefaultExport = name === "default"; + var isDefaultExport = symbol.name === "default" /* Default */; if (isDefaultExport) { - var localSymbol = ts.getLocalSymbolForExportDefault(symbol); - if (localSymbol) { - symbol = localSymbol; - name = localSymbol.name; - } - else { - name = ts.codefix.moduleSymbolToValidIdentifier(moduleSymbol, target); - } + symbol = ts.getLocalSymbolForExportDefault(symbol) || symbol; } - if (stringContainsCharactersInOrder(name.toLowerCase(), tokenTextLowerCase)) { + var origin = { type: "export", moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport }; + if (stringContainsCharactersInOrder(getSymbolName(symbol, origin, target).toLowerCase(), tokenTextLowerCase)) { symbols.push(symbol); - symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport }; + symbolToOriginInfoMap[ts.getSymbolId(symbol)] = origin; } } }); @@ -81489,11 +82889,11 @@ var ts; return true; } if (contextToken.kind === 29 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 252 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 255 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 253 /* JsxClosingElement */ || contextToken.parent.kind === 251 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 250 /* JsxElement */; + if (contextToken.parent.kind === 256 /* JsxClosingElement */ || contextToken.parent.kind === 254 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 253 /* JsxElement */; } } return false; @@ -81503,40 +82903,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 182 /* CallExpression */ // func( a, | - || containingNodeKind === 153 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 183 /* NewExpression */ // new C(a, | - || containingNodeKind === 178 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 195 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 161 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 185 /* CallExpression */ // func( a, | + || containingNodeKind === 154 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 186 /* NewExpression */ // new C(a, | + || containingNodeKind === 181 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 198 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 162 /* FunctionType */; // var x: (s: string, list| case 19 /* OpenParenToken */: - return containingNodeKind === 182 /* CallExpression */ // func( | - || containingNodeKind === 153 /* Constructor */ // constructor( | - || containingNodeKind === 183 /* NewExpression */ // new C(a| - || containingNodeKind === 186 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 169 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 185 /* CallExpression */ // func( | + || containingNodeKind === 154 /* Constructor */ // constructor( | + || containingNodeKind === 186 /* NewExpression */ // new C(a| + || containingNodeKind === 189 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 172 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 21 /* OpenBracketToken */: - return containingNodeKind === 178 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 158 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 145 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 128 /* ModuleKeyword */: // module | - case 129 /* NamespaceKeyword */:// namespace | + return containingNodeKind === 181 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 159 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 146 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 129 /* ModuleKeyword */: // module | + case 130 /* NamespaceKeyword */:// namespace | return true; case 23 /* DotToken */: - return containingNodeKind === 234 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 237 /* ModuleDeclaration */; // module A.| case 17 /* OpenBraceToken */: - return containingNodeKind === 230 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 233 /* ClassDeclaration */; // class A{ | case 58 /* EqualsToken */: - return containingNodeKind === 227 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 195 /* BinaryExpression */; // x = a| + return containingNodeKind === 230 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 198 /* BinaryExpression */; // x = a| case 14 /* TemplateHead */: - return containingNodeKind === 197 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 200 /* TemplateExpression */; // `aa ${| case 15 /* TemplateMiddle */: - return containingNodeKind === 206 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 209 /* TemplateSpan */; // `aa ${10} dd ${| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 151 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -81576,11 +82976,10 @@ var ts; */ function tryGetObjectLikeCompletionSymbols(objectLikeContainer) { // We're looking up possible property names from contextual/inferred/declared type. - isMemberCompletion = true; - allowStringLiteral = true; + completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 179 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 182 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -81591,7 +82990,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 175 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 178 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -81602,12 +83001,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = rootDeclaration.initializer || rootDeclaration.type || rootDeclaration.parent.parent.kind === 217 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 147 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 220 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 148 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 152 /* MethodDeclaration */ || rootDeclaration.parent.kind === 155 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 153 /* MethodDeclaration */ || rootDeclaration.parent.kind === 156 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -81622,7 +83021,7 @@ var ts; } if (typeMembers && typeMembers.length > 0) { // Add filtered items to the completion list - symbols = filterObjectMembersList(typeMembers, existingMembers); + symbols = filterObjectMembersList(typeMembers, ts.Debug.assertDefined(existingMembers)); } return true; } @@ -81642,15 +83041,15 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 242 /* NamedImports */ ? - 239 /* ImportDeclaration */ : - 245 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 245 /* NamedImports */ ? + 242 /* ImportDeclaration */ : + 248 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { return false; } - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; isNewIdentifierLocation = false; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) { @@ -81667,7 +83066,7 @@ var ts; */ function getGetClassLikeCompletionSymbols(classLikeDeclaration) { // We're looking up possible property names from parent type. - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; // Declaring new property/method/accessor isNewIdentifierLocation = true; // Has keywords for class elements @@ -81736,8 +83135,8 @@ var ts; case 17 /* OpenBraceToken */: // import { | case 26 /* CommaToken */:// import { a as 0, | switch (contextToken.parent.kind) { - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return contextToken.parent; } } @@ -81795,7 +83194,7 @@ var ts; } } // class c { method() { } | method2() { } } - if (location && location.kind === 290 /* SyntaxList */ && ts.isClassLike(location.parent)) { + if (location && location.kind === 293 /* SyntaxList */ && ts.isClassLike(location.parent)) { return location.parent; } return undefined; @@ -81818,6 +83217,21 @@ var ts; } return undefined; } + function tryGetFunctionLikeBodyCompletionContainer(contextToken) { + if (contextToken) { + var prev_1; + var container = ts.findAncestor(contextToken.parent, function (node) { + if (ts.isClassLike(node)) { + return "quit"; + } + if (ts.isFunctionLikeDeclaration(node) && prev_1 === node.body) { + return true; + } + prev_1 = node; + }); + return container && container; + } + } function tryGetContainingJsxElement(contextToken) { if (contextToken) { var parent = contextToken.parent; @@ -81825,14 +83239,14 @@ var ts; case 28 /* LessThanSlashToken */: case 41 /* SlashToken */: case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 258 /* JsxAttributes */: - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 251 /* JsxSelfClosingElement */ || parent.kind === 252 /* JsxOpeningElement */)) { + case 183 /* PropertyAccessExpression */: + case 261 /* JsxAttributes */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 254 /* JsxSelfClosingElement */ || parent.kind === 255 /* JsxOpeningElement */)) { return parent; } - else if (parent.kind === 257 /* JsxAttribute */) { + else if (parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81844,7 +83258,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent && ((parent.kind === 257 /* JsxAttribute */) || (parent.kind === 259 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 260 /* JsxAttribute */) || (parent.kind === 262 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81854,8 +83268,8 @@ var ts; break; case 18 /* CloseBraceToken */: if (parent && - parent.kind === 260 /* JsxExpression */ && - parent.parent && parent.parent.kind === 257 /* JsxAttribute */) { + parent.kind === 263 /* JsxExpression */ && + parent.parent && parent.parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81863,7 +83277,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 259 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 262 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81882,59 +83296,59 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 227 /* VariableDeclaration */ || - containingNodeKind === 228 /* VariableDeclarationList */ || - containingNodeKind === 209 /* VariableStatement */ || - containingNodeKind === 233 /* EnumDeclaration */ || // enum a { foo, | + return containingNodeKind === 230 /* VariableDeclaration */ || + containingNodeKind === 231 /* VariableDeclarationList */ || + containingNodeKind === 212 /* VariableStatement */ || + containingNodeKind === 236 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 23 /* DotToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [.| case 56 /* ColonToken */: - return containingNodeKind === 177 /* BindingElement */; // var {x :html| + return containingNodeKind === 180 /* BindingElement */; // var {x :html| case 21 /* OpenBracketToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [x| case 19 /* OpenParenToken */: - return containingNodeKind === 264 /* CatchClause */ || + return containingNodeKind === 267 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 17 /* OpenBraceToken */: - return containingNodeKind === 233 /* EnumDeclaration */ || // enum a { | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface a { | - containingNodeKind === 164 /* TypeLiteral */; // const x : { | + return containingNodeKind === 236 /* EnumDeclaration */ || // enum a { | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface a { | + containingNodeKind === 165 /* TypeLiteral */; // const x : { | case 25 /* SemicolonToken */: - return containingNodeKind === 149 /* PropertySignature */ && + return containingNodeKind === 150 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 231 /* InterfaceDeclaration */ || // interface a { f; | - contextToken.parent.parent.kind === 164 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 234 /* InterfaceDeclaration */ || // interface a { f; | + contextToken.parent.parent.kind === 165 /* TypeLiteral */); // const x : { a; | case 27 /* LessThanToken */: - return containingNodeKind === 230 /* ClassDeclaration */ || // class A< | - containingNodeKind === 200 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 232 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 233 /* ClassDeclaration */ || // class A< | + containingNodeKind === 203 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 235 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 115 /* StaticKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); + return containingNodeKind === 151 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); case 24 /* DotDotDotToken */: - return containingNodeKind === 147 /* Parameter */ || + return containingNodeKind === 148 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 176 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 179 /* ArrayBindingPattern */); // var [...z| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 147 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); + return containingNodeKind === 148 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); case 118 /* AsKeyword */: - return containingNodeKind === 243 /* ImportSpecifier */ || - containingNodeKind === 247 /* ExportSpecifier */ || - containingNodeKind === 241 /* NamespaceImport */; + return containingNodeKind === 246 /* ImportSpecifier */ || + containingNodeKind === 250 /* ExportSpecifier */ || + containingNodeKind === 244 /* NamespaceImport */; case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: if (isFromClassElementDeclaration(contextToken)) { return false; } @@ -81948,7 +83362,7 @@ var ts; case 110 /* LetKeyword */: case 76 /* ConstKeyword */: case 116 /* YieldKeyword */: - case 138 /* TypeKeyword */:// type htm| + case 139 /* TypeKeyword */:// type htm| return true; } // If the previous token is keyword correspoding to class member completion keyword @@ -81987,10 +83401,14 @@ var ts; case "yield": return true; } - return ts.isDeclarationName(contextToken) && !ts.isJsxAttribute(contextToken.parent); + return ts.isDeclarationName(contextToken) + && !ts.isJsxAttribute(contextToken.parent) + // Don't block completions if we're in `class C /**/`, because we're *past* the end of the identifier and might want to complete `extends`. + // If `contextToken !== previousToken`, this is `class C ex/**/`. + && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 153 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 154 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -82019,10 +83437,7 @@ var ts; var name = element.propertyName || element.name; existingImportsOrExports.set(name.escapedText, true); } - if (existingImportsOrExports.size === 0) { - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default"; }); - } - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" && !existingImportsOrExports.get(e.escapedName); }); + return exportsOfModule.filter(function (e) { return e.escapedName !== "default" /* Default */ && !existingImportsOrExports.get(e.escapedName); }); } /** * Filters out completion suggestions for named imports or exports. @@ -82031,19 +83446,19 @@ var ts; * do not occur at the current position and have not otherwise been typed. */ function filterObjectMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { + if (existingMembers.length === 0) { return contextualMemberSymbols; } var existingMemberNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 265 /* PropertyAssignment */ && - m.kind !== 266 /* ShorthandPropertyAssignment */ && - m.kind !== 177 /* BindingElement */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 268 /* PropertyAssignment */ && + m.kind !== 269 /* ShorthandPropertyAssignment */ && + m.kind !== 180 /* BindingElement */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -82051,7 +83466,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 177 /* BindingElement */ && m.propertyName) { + if (m.kind === 180 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 71 /* Identifier */) { existingName = m.propertyName.escapedText; @@ -82066,7 +83481,7 @@ var ts; } existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.escapedName); }); + return contextualMemberSymbols.filter(function (m) { return !existingMemberNames.get(m.escapedName); }); } /** * Filters out completion suggestions for class elements. @@ -82078,10 +83493,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 150 /* PropertyDeclaration */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 151 /* PropertyDeclaration */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -82136,98 +83551,79 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 257 /* JsxAttribute */) { + if (attr.kind === 260 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } } - return ts.filter(symbols, function (a) { return !seenNames.get(a.escapedName); }); + return symbols.filter(function (a) { return !seenNames.get(a.escapedName); }); } function isCurrentlyEditingNode(node) { return node.getStart() <= position && position <= node.getEnd(); } } - /** - * Get the name to be display in completion from a given symbol. - * - * @return undefined if the name is of external module - */ - function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, allowStringLiteral, origin) { + function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind) { var name = getSymbolName(symbol, origin, target); - if (!name) + if (name === undefined + // If the symbol is external module, don't show it in the completion list + // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) + || symbol.flags & 1536 /* Module */ && ts.startsWithQuote(name) + // If the symbol is the internal name of an ES symbol, it is not a valid entry. Internal names for ES symbols start with "__@" + || ts.isKnownSymbol(symbol)) { return undefined; - // First check of the displayName is not external module; if it is an external module, it is not valid entry - if (symbol.flags & 1920 /* Namespace */) { - var firstCharCode = name.charCodeAt(0); - if (ts.isSingleOrDoubleQuote(firstCharCode)) { - // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) + } + var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + if (ts.isIdentifierText(name, target)) + return validIdentiferResult; + switch (kind) { + case 3 /* MemberLike */: return undefined; - } + case 0 /* ObjectPropertyDeclaration */: + // TODO: GH#18169 + return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; + case 2 /* PropertyAccess */: + case 5 /* None */: + case 1 /* Global */: + // Don't add a completion for a name starting with a space. See https://github.com/Microsoft/TypeScript/pull/20547 + return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; + case 4 /* String */: + return validIdentiferResult; + default: + ts.Debug.assertNever(kind); } - // If the symbol is for a member of an object type and is the internal name of an ES - // symbol, it is not a valid entry. Internal names for ES symbols start with "__@" - if (symbol.flags & 106500 /* ClassMember */) { - var escapedName = symbol.escapedName; - if (escapedName.length >= 3 && - escapedName.charCodeAt(0) === 95 /* _ */ && - escapedName.charCodeAt(1) === 95 /* _ */ && - escapedName.charCodeAt(2) === 64 /* at */) { - return undefined; - } - } - return getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral); - } - /** - * Get a displayName from a given for completion list, performing any necessary quotes stripping - * and checking whether the name is valid identifier name. - */ - function getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral) { - // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an - // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. - // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. - // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. - if (performCharacterChecks && !ts.isIdentifierText(name, target)) { - // TODO: GH#18169 - return allowStringLiteral ? JSON.stringify(name) : undefined; - } - return name; } // A cache of completion entries for keywords, these do not change between sessions var _keywordCompletions = []; - function getKeywordCompletions(keywordFilter) { - var completions = _keywordCompletions[keywordFilter]; - if (completions) { - return completions; + var allKeywordsCompletions = ts.memoize(function () { + var res = []; + for (var i = 72 /* FirstKeyword */; i <= 144 /* LastKeyword */; i++) { + res.push({ + name: ts.tokenToString(i), + kind: "keyword" /* keyword */, + kindModifiers: "" /* none */, + sortText: "0" + }); } - return _keywordCompletions[keywordFilter] = generateKeywordCompletions(keywordFilter); - function generateKeywordCompletions(keywordFilter) { + return res; + }); + function getKeywordCompletions(keywordFilter) { + return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter(function (entry) { + var kind = ts.stringToToken(entry.name); switch (keywordFilter) { case 0 /* None */: - return getAllKeywordCompletions(); + // "undefined" is a global variable, so don't need a keyword completion for it. + return kind !== 140 /* UndefinedKeyword */; case 1 /* ClassElementKeywords */: - return getFilteredKeywordCompletions(isClassMemberCompletionKeywordText); + return isClassMemberCompletionKeyword(kind); case 2 /* ConstructorParameterKeywords */: - return getFilteredKeywordCompletions(isConstructorParameterCompletionKeywordText); + return isConstructorParameterCompletionKeyword(kind); + case 3 /* FunctionLikeBodyKeywords */: + return isFunctionLikeBodyCompletionKeyword(kind); + case 4 /* TypeKeywords */: + return ts.isTypeKeyword(kind); + default: + return ts.Debug.assertNever(keywordFilter); } - } - function getAllKeywordCompletions() { - var allKeywordsCompletions = []; - for (var i = 72 /* FirstKeyword */; i <= 143 /* LastKeyword */; i++) { - // "undefined" is a global variable, so don't need a keyword completion for it. - if (i === 139 /* UndefinedKeyword */) - continue; - allKeywordsCompletions.push({ - name: ts.tokenToString(i), - kind: "keyword" /* keyword */, - kindModifiers: "" /* none */, - sortText: "0" - }); - } - return allKeywordsCompletions; - } - function getFilteredKeywordCompletions(filterFn) { - return ts.filter(getKeywordCompletions(0 /* None */), function (entry) { return filterFn(entry.name); }); - } + })); } function isClassMemberCompletionKeyword(kind) { switch (kind) { @@ -82237,9 +83633,9 @@ var ts; case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: case 123 /* ConstructorKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 120 /* AsyncKeyword */: return true; } @@ -82252,21 +83648,39 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; } } function isConstructorParameterCompletionKeywordText(text) { return isConstructorParameterCompletionKeyword(ts.stringToToken(text)); } - function isEqualityExpression(node) { - return ts.isBinaryExpression(node) && isEqualityOperatorKind(node.operatorToken.kind); + function isFunctionLikeBodyCompletionKeyword(kind) { + switch (kind) { + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 132 /* ReadonlyKeyword */: + case 123 /* ConstructorKeyword */: + case 115 /* StaticKeyword */: + case 117 /* AbstractKeyword */: + case 125 /* GetKeyword */: + case 136 /* SetKeyword */: + case 140 /* UndefinedKeyword */: + return false; + } + return true; } function isEqualityOperatorKind(kind) { - return kind === 32 /* EqualsEqualsToken */ || - kind === 33 /* ExclamationEqualsToken */ || - kind === 34 /* EqualsEqualsEqualsToken */ || - kind === 35 /* ExclamationEqualsEqualsToken */; + switch (kind) { + case 34 /* EqualsEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + return true; + default: + return false; + } } /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */ function getJsDocTagAtPosition(node, position) { @@ -82300,19 +83714,18 @@ var ts; } /** * Gets all properties on a type, but if that type is a union of several types, - * tries to only include those types which declare properties, not methods. - * This ensures that we don't try providing completions for all the methods on e.g. Array. + * excludes array-like types or callable/constructable types. */ function getPropertiesForCompletion(type, checker, isForAccess) { if (!(type.flags & 131072 /* Union */)) { - return type.getApparentProperties(); + return ts.Debug.assertEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } var types = type.types; // If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals. var filteredTypes = isForAccess ? types : types.filter(function (memberType) { return !(memberType.flags & 16382 /* Primitive */ || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker)); }); - return checker.getAllPossiblePropertiesOfTypes(filteredTypes); + return ts.Debug.assertEachDefined(checker.getAllPossiblePropertiesOfTypes(filteredTypes), "getAllPossiblePropertiesOfTypes() should all be defined"); } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); @@ -82323,11 +83736,7 @@ var ts; (function (DocumentHighlights) { function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) { var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); - // Note that getTouchingWord indicates failure by returning the sourceFile node. - if (node === sourceFile) - return undefined; - ts.Debug.assert(node.parent !== undefined); - if (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent)) { + if (node.parent && (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent))) { // For a JSX element, just highlight the matching tag, not all references. var _a = node.parent.parent, openingElement = _a.openingElement, closingElement = _a.closingElement; var highlightSpans = [openingElement, closingElement].map(function (_a) { @@ -82336,7 +83745,7 @@ var ts; }); return [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; } - return getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); + return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); } DocumentHighlights.getDocumentHighlights = getDocumentHighlights; function getHighlightSpanForNode(node, sourceFile) { @@ -82346,8 +83755,8 @@ var ts; kind: "none" /* none */ }; } - function getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) { - var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(node, program, sourceFilesToSearch, cancellationToken); + function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { + var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken); return referenceEntries && convertReferencedSymbols(referenceEntries); } function convertReferencedSymbols(referenceEntries) { @@ -82400,15 +83809,20 @@ var ts; case 81 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); case 123 /* ConstructorKeyword */: - return useParent(node.parent, ts.isConstructorDeclaration, getConstructorOccurrences); + return getFromAllDeclarations(ts.isConstructorDeclaration, [123 /* ConstructorKeyword */]); case 125 /* GetKeyword */: - case 135 /* SetKeyword */: - return useParent(node.parent, ts.isAccessor, getGetAndSetOccurrences); + case 136 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [125 /* GetKeyword */, 136 /* SetKeyword */]); default: return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : undefined; } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, function (decl) { return ts.mapDefined(decl.symbol.declarations, function (d) { + return nodeTest(d) ? ts.find(d.getChildren(sourceFile), function (c) { return ts.contains(keywords, c.kind); }) : undefined; + }); }); + } function useParent(node, nodeTest, getNodes) { return nodeTest(node) ? highlightSpans(getNodes(node, sourceFile)) : undefined; } @@ -82421,30 +83835,15 @@ var ts; * into function boundaries and try-blocks with catch-clauses. */ function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (ts.isThrowStatement(node)) { - statementAccumulator.push(node); - } - else if (ts.isTryStatement(node)) { - if (node.catchClause) { - aggregate(node.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(node.tryBlock); - } - if (node.finallyBlock) { - aggregate(node.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } + if (ts.isThrowStatement(node)) { + return [node]; } + else if (ts.isTryStatement(node)) { + // Exceptions thrown within a try block lacking a catch clause are "owned" in the current context. + return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), aggregateOwnedThrowStatements(node.finallyBlock)); + } + // Do not cross function boundaries. + return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements); } /** * For lack of a better name, this function takes a throw statement and returns the @@ -82455,33 +83854,30 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 269 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 272 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === 225 /* TryStatement */) { - var tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } + if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) { + return child; } child = parent; } return undefined; } function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */) { - statementAccumulator.push(node); + return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + var result = []; + node.forEachChild(function (child) { + var value = cb(child); + if (value !== undefined) { + result.push.apply(result, ts.toArray(value)); } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } + }); + return result; } function ownsBreakOrContinueStatement(owner, statement) { var actualOwner = getBreakOrContinueOwner(statement); @@ -82490,17 +83886,17 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 222 /* SwitchStatement */: - if (statement.kind === 218 /* ContinueStatement */) { + case 225 /* SwitchStatement */: + if (statement.kind === 221 /* ContinueStatement */) { return false; } // falls through - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - return !statement.label || isLabeledBy(node, statement.label.text); + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. // TODO: GH#20090 @@ -82509,10 +83905,6 @@ var ts; }); } function getModifierOccurrences(modifier, declaration) { - // Make sure we only highlight the keyword when it makes sense to do so. - if (!isLegalModifier(modifier, declaration)) { - return undefined; - } var modifierFlag = ts.modifierToFlag(modifier); return ts.mapDefined(getNodesToSearchForModifier(declaration, modifierFlag), function (node) { if (ts.getModifierFlags(node) & modifierFlag) { @@ -82523,24 +83915,28 @@ var ts; }); } function getNodesToSearchForModifier(declaration, modifierFlag) { + // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 208 /* Block */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 211 /* Block */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration - if (modifierFlag & 128 /* Abstract */) { + if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return declaration.members.concat([declaration]); } else { return container.statements; } - case 153 /* Constructor */: - return container.parameters.concat(container.parent.members); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: { + return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : [])); + } + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -82555,33 +83951,7 @@ var ts; } return nodes; default: - ts.Debug.fail("Invalid container kind."); - } - } - function isLegalModifier(modifier, declaration) { - var container = declaration.parent; - switch (modifier) { - case 112 /* PrivateKeyword */: - case 113 /* ProtectedKeyword */: - case 114 /* PublicKeyword */: - switch (container.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return true; - case 153 /* Constructor */: - return declaration.kind === 147 /* Parameter */; - default: - return false; - } - case 115 /* StaticKeyword */: - return container.kind === 230 /* ClassDeclaration */ || container.kind === 200 /* ClassExpression */; - case 84 /* ExportKeyword */: - case 124 /* DeclareKeyword */: - return container.kind === 235 /* ModuleBlock */ || container.kind === 269 /* SourceFile */; - case 117 /* AbstractKeyword */: - return container.kind === 230 /* ClassDeclaration */ || declaration.kind === 230 /* ClassDeclaration */; - default: - return false; + ts.Debug.assertNever(container, "Invalid container kind."); } } function pushKeywordIf(keywordList, token) { @@ -82595,33 +83965,11 @@ var ts; } return false; } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 154 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 155 /* SetAccessor */); - return keywords; - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 125 /* GetKeyword */, 135 /* SetKeyword */); }); - } - } - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 123 /* ConstructorKeyword */); - }); - }); - return keywords; - } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 88 /* ForKeyword */, 106 /* WhileKeyword */, 81 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 213 /* DoStatement */) { + if (loopNode.kind === 216 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 106 /* WhileKeyword */)) { @@ -82630,8 +83978,7 @@ var ts; } } } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */, 77 /* ContinueKeyword */); } @@ -82642,13 +83989,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -82660,8 +84007,7 @@ var ts; // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 73 /* CaseKeyword */, 79 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */); } @@ -82681,36 +84027,36 @@ var ts; } return keywords; } - function getThrowOccurrences(throwStatement) { + function getThrowOccurrences(throwStatement, sourceFile) { var owner = getThrowStatementOwner(throwStatement); if (!owner) { return undefined; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); // If the "owner" is a function, then we equate 'return' and 'throw' statements in their // ability to "jump out" of the function, and include occurrences for both. if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); } return keywords; } - function getReturnOccurrences(returnStatement) { + function getReturnOccurrences(returnStatement, sourceFile) { var func = ts.getContainingFunction(returnStatement); if (!func) { return undefined; } var keywords = []; ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); // Include 'throw' statements that do not occur within a try block. ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); return keywords; } @@ -82774,12 +84120,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 223 /* LabeledStatement */; owner = owner.parent) { - if (owner.label.escapedText === labelName) { - return true; - } - } - return false; + return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName; }); } })(DocumentHighlights = ts.DocumentHighlights || (ts.DocumentHighlights = {})); })(ts || (ts = {})); @@ -82956,10 +84297,10 @@ var ts; } cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 227 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 230 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 71 /* Identifier */) { directImports.push(name); @@ -82970,19 +84311,24 @@ var ts; addIndirectUser(direct.getSourceFile()); } break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name); } + else if (ts.isDefaultImport(direct)) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(direct); + addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + directImports.push(direct); + } else { directImports.push(direct); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -83003,7 +84349,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 269 /* SourceFile */ || sourceFileLike.kind === 234 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 272 /* SourceFile */ || sourceFileLike.kind === 237 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -83058,7 +84404,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 238 /* ImportEqualsDeclaration */) { + if (decl.kind === 241 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -83072,7 +84418,7 @@ var ts; if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { return; } - if (decl.kind === 245 /* ExportDeclaration */) { + if (decl.kind === 248 /* ExportDeclaration */) { searchForNamedImport(decl.exportClause); return; } @@ -83081,7 +84427,7 @@ var ts; return; } var namedBindings = importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImportLike(namedBindings.name); return; } @@ -83133,7 +84479,7 @@ var ts; } } else { - var localSymbol = element.kind === 247 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 250 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -83142,14 +84488,14 @@ var ts; } function isNameMatch(name) { // Use name of "default" even in `export =` case because we may have allowSyntheticDefaultImports - return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === "default"; + return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === "default" /* Default */; } } /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */ function findNamespaceReExports(sourceFileLike, name, checker) { var namespaceImportSymbol = checker.getSymbolAtLocation(name); return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { - if (statement.kind !== 245 /* ExportDeclaration */) + if (statement.kind !== 248 /* ExportDeclaration */) return; var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; if (moduleSpecifier || !exportClause) @@ -83168,7 +84514,7 @@ var ts; for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { var referencingFile = sourceFiles_4[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 269 /* SourceFile */) { + if (searchSourceFile.kind === 272 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -83215,7 +84561,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 269 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 272 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -83230,18 +84576,18 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: { + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { action(decl, decl.moduleSpecifier); } break; } - case 238 /* ImportEqualsDeclaration */: { + case 241 /* ImportEqualsDeclaration */: { var decl = statement; var moduleReference = decl.moduleReference; - if (moduleReference.kind === 249 /* ExternalModuleReference */ && + if (moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */) { action(decl, moduleReference.expression); } @@ -83254,11 +84600,11 @@ var ts; function importerFromModuleSpecifier(moduleSpecifier) { var decl = moduleSpecifier.parent; switch (decl.kind) { - case 182 /* CallExpression */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 185 /* CallExpression */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return decl; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return decl.parent; default: ts.Debug.fail("Unexpected module specifier parent: " + decl.kind); @@ -83276,7 +84622,7 @@ var ts; function getExport() { var parent = node.parent; if (symbol.exportSymbol) { - if (parent.kind === 180 /* PropertyAccessExpression */) { + if (parent.kind === 183 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(parent.parent) @@ -83317,8 +84663,7 @@ var ts; } function getExportAssignmentExport(ex) { // Get the symbol for the `export =` node; its parent is the module it's the export of. - var exportingModuleSymbol = ex.symbol.parent; - ts.Debug.assert(!!exportingModuleSymbol); + var exportingModuleSymbol = ts.Debug.assertDefined(ex.symbol.parent, "Expected export symbol to have a parent"); var exportKind = ex.isExportEquals ? 2 /* ExportEquals */ : 1 /* Default */; return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } }; } @@ -83334,7 +84679,11 @@ var ts; default: return undefined; } - var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.cast(node.left, ts.isPropertyAccessExpression).name) : symbol; + // Better detection for GH#20803 + if (sym && !(checker.getMergedSymbol(sym.parent).flags & 1536 /* Module */)) { + ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.showSymbol(sym) + ", parent is " + ts.Debug.showSymbol(sym.parent)); + } return sym && exportInfo(sym, kind); } } @@ -83356,7 +84705,7 @@ var ts; // If `importedName` is undefined, do continue searching as the export is anonymous. // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.) var importedName = symbolName(importedSymbol); - if (importedName === undefined || importedName === "default" || importedName === symbol.escapedName) { + if (importedName === undefined || importedName === "default" /* Default */ || importedName === symbol.escapedName) { return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); } } @@ -83372,24 +84721,24 @@ var ts; FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; function getExportEqualsLocalSymbol(importedSymbol, checker) { if (importedSymbol.flags & 2097152 /* Alias */) { - return checker.getImmediateAliasedSymbol(importedSymbol); + return ts.Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol)); } var decl = importedSymbol.valueDeclaration; if (ts.isExportAssignment(decl)) { - return decl.expression.symbol; + return ts.Debug.assertDefined(decl.expression.symbol); } else if (ts.isBinaryExpression(decl)) { - return decl.right.symbol; + return ts.Debug.assertDefined(decl.right.symbol); } - ts.Debug.fail(); + return ts.Debug.fail(); } // If a reference is a class expression, the exported node would be its parent. // If a reference is a variable declaration, the exported node would be the variable statement. function getExportNode(parent, node) { - if (parent.kind === 227 /* VariableDeclaration */) { + if (parent.kind === 230 /* VariableDeclaration */) { var p = parent; return p.name !== node ? undefined : - p.parent.kind === 264 /* CatchClause */ ? undefined : p.parent.parent.kind === 209 /* VariableStatement */ ? p.parent.parent : undefined; + p.parent.kind === 267 /* CatchClause */ ? undefined : p.parent.parent.kind === 212 /* VariableStatement */ ? p.parent.parent : undefined; } else { return parent; @@ -83398,15 +84747,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent) ? { isNamedImport: false } : undefined; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return parent.propertyName ? undefined : { isNamedImport: true }; - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return { isNamedImport: false }; default: @@ -83414,13 +84763,16 @@ var ts; } } function getExportInfo(exportSymbol, exportKind, checker) { - var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + var moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return undefined; // This can happen if an `export` is not at the top-level (which is a compile error). + var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation. // `export` may appear in a namespace. In that case, just rely on global search. return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; } FindAllReferences.getExportInfo = getExportInfo; function symbolName(symbol) { - if (symbol.escapedName !== "default") { + if (symbol.escapedName !== "default" /* Default */) { return symbol.escapedName; } return ts.forEach(symbol.declarations, function (decl) { @@ -83430,7 +84782,7 @@ var ts; } /** If at an export specifier, go to the symbol it refers to. */ function skipExportSpecifierSymbol(symbol, checker) { - // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. + // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. if (symbol.declarations) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; @@ -83445,22 +84797,22 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 269 /* SourceFile */) { + if (parent.kind === 272 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 235 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); + ts.Debug.assert(parent.kind === 238 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); return parent.parent; } function isAmbientModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + return node.kind === 237 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; } function isExternalModuleImportEquals(_a) { var moduleReference = _a.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + return moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -83476,37 +84828,30 @@ var ts; FindAllReferences.nodeEntry = nodeEntry; function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { var referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); - if (!referencedSymbols || !referencedSymbols.length) { - return undefined; - } - var out = []; var checker = program.getTypeChecker(); - for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { - var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + return !referencedSymbols || !referencedSymbols.length ? undefined : ts.mapDefined(referencedSymbols, function (_a) { + var definition = _a.definition, references = _a.references; // Only include referenced symbols that have a valid definition. - if (definition) { - out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); - } - } - return out; + return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }; + }); } FindAllReferences.findReferencedSymbols = findReferencedSymbols; function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) { // A node in a JSDoc comment can't have an implementation anyway. var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ false); - var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node); + var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); var checker = program.getTypeChecker(); return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; - function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node) { - if (node.kind === 269 /* SourceFile */) { + function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { + if (node.kind === 272 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var result_4 = []; FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_4.push(nodeEntry(node)); }); return result_4; @@ -83519,7 +84864,7 @@ var ts; } else { // Perform "Find all References" and retrieve only those that are implementations - return getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, { implementations: true }); + return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { implementations: true }); } } function findReferencedEntries(program, cancellationToken, sourceFiles, sourceFile, position, options) { @@ -83527,14 +84872,14 @@ var ts; return ts.map(x, toReferenceEntry); } FindAllReferences.findReferencedEntries = findReferencedEntries; - function getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options)); + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)); } FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; function findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options) { var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - return FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options); + return FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); } function flattenEntries(referenceSymbols) { return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); @@ -83545,8 +84890,8 @@ var ts; case "symbol": { var symbol = def.symbol, node_3 = def.node; var _a = getDefinitionKindAndDisplayParts(symbol, node_3, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; - var name_5 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: node_3, name: name_5, kind: kind_1, displayParts: displayParts_1 }; + var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_3, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case "label": { var node_4 = def.node; @@ -83554,8 +84899,8 @@ var ts; } case "keyword": { var node_5 = def.node; - var name_6 = ts.tokenToString(node_5.kind); - return { node: node_5, name: name_6, kind: "keyword" /* keyword */, displayParts: [{ text: name_6, kind: "keyword" /* keyword */ }] }; + var name_5 = ts.tokenToString(node_5.kind); + return { node: node_5, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; } case "this": { var node_6 = def.node; @@ -83618,13 +84963,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, node, checker); } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(20 /* CloseParenToken */)] }; } - else if (node.kind === 200 /* ClassExpression */) { + else if (node.kind === 203 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(20 /* CloseParenToken */)] @@ -83673,10 +85018,11 @@ var ts; var Core; (function (Core) { /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ - function getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - if (node.kind === 269 /* SourceFile */) { - return undefined; + if (ts.isSourceFile(node)) { + var reference = ts.GoToDefinition.getReferenceAtPosition(node, position, program); + return reference && getReferencedSymbolsForModule(program, program.getTypeChecker().getMergedSymbol(reference.file.symbol), sourceFiles); } if (!options.implementations) { var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); @@ -83689,11 +85035,7 @@ var ts; // Could not find a symbol e.g. unknown identifier if (!symbol) { // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial. - if (!options.implementations && node.kind === 9 /* StringLiteral */) { - return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); - } - // Can't have references to something that we have no symbol for. - return undefined; + return !options.implementations && ts.isStringLiteral(node) ? getReferencesForStringLiteral(node, sourceFiles, cancellationToken) : undefined; } if (symbol.flags & 1536 /* Module */ && isModuleReferenceLocation(node)) { return getReferencedSymbolsForModule(program, symbol, sourceFiles); @@ -83702,16 +85044,16 @@ var ts; } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; function isModuleReferenceLocation(node) { - if (node.kind !== 9 /* StringLiteral */) { + if (!ts.isStringLiteralLike(node)) { return false; } switch (node.parent.kind) { - case 234 /* ModuleDeclaration */: - case 249 /* ExternalModuleReference */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 237 /* ModuleDeclaration */: + case 252 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return true; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent); default: return false; @@ -83734,10 +85076,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: references.push({ type: "node", node: decl.name }); break; default: @@ -83777,14 +85119,14 @@ var ts; } /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { - symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; // Compute the meaning from the location and the symbol it references var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); var result = []; - var state = new State(sourceFiles, /*isForConstructor*/ node.kind === 123 /* ConstructorKeyword */, checker, cancellationToken, searchMeaning, options, result); + var state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result); if (node.kind === 79 /* DefaultKeyword */) { addReference(node, symbol, node, state); - searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: 1 /* Default */ }, state); + searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } else { var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); @@ -83805,8 +85147,22 @@ var ts; } return result; } + function getSpecialSearchKind(node) { + switch (node.kind) { + case 123 /* ConstructorKeyword */: + return 1 /* Constructor */; + case 71 /* Identifier */: + if (ts.isClassLike(node.parent)) { + ts.Debug.assert(node.parent.name === node); + return 2 /* Class */; + } + // falls through + default: + return 0 /* None */; + } + } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifier(symbol, node, checker) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { var parent = node.parent; if (ts.isExportSpecifier(parent)) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); @@ -83815,18 +85171,34 @@ var ts; // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. return checker.getImmediateAliasedSymbol(symbol); } - return symbol; + // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. + return ts.firstDefined(symbol.declarations, function (decl) { + if (!decl.parent) { + // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. + ts.Debug.assert(decl.kind === 272 /* SourceFile */); + ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); + } + return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent) + ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) + : undefined; + }); } + var SpecialSearchKind; + (function (SpecialSearchKind) { + SpecialSearchKind[SpecialSearchKind["None"] = 0] = "None"; + SpecialSearchKind[SpecialSearchKind["Constructor"] = 1] = "Constructor"; + SpecialSearchKind[SpecialSearchKind["Class"] = 2] = "Class"; + })(SpecialSearchKind || (SpecialSearchKind = {})); /** * Holds all state needed for the finding references. * Unlike `Search`, there is only one `State`. */ var State = /** @class */ (function () { function State(sourceFiles, - /** True if we're searching for constructor references. */ - isForConstructor, checker, cancellationToken, searchMeaning, options, result) { + /** True if we're searching for constructor references. */ + specialSearchKind, checker, cancellationToken, searchMeaning, options, result) { this.sourceFiles = sourceFiles; - this.isForConstructor = isForConstructor; + this.specialSearchKind = specialSearchKind; this.checker = checker; this.cancellationToken = cancellationToken; this.searchMeaning = searchMeaning; @@ -83868,6 +85240,9 @@ var ts; State.prototype.createSearch = function (location, symbol, comingFrom, searchOptions) { if (searchOptions === void 0) { searchOptions = {}; } // Note: if this is an external module symbol, the name doesn't include quotes. + // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`. + // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form + // here appears to be intentional). var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; var escapedText = ts.escapeLeadingUnderscores(text); var parents = this.options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, this.checker); @@ -83960,9 +85335,9 @@ var ts; checker.getPropertySymbolOfDestructuringAssignment(location); } function getObjectBindingElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 177 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 180 /* BindingElement */); if (bindingElement && - bindingElement.parent.kind === 175 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 178 /* ObjectBindingPattern */ && !bindingElement.propertyName) { return bindingElement; } @@ -83992,7 +85367,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 187 /* FunctionExpression */ || valueDeclaration.kind === 200 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 190 /* FunctionExpression */ || valueDeclaration.kind === 203 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -84002,7 +85377,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 230 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 233 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -84031,7 +85406,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -84180,11 +85555,18 @@ var ts; getReferenceForShorthandProperty(referenceSymbol, search, state); return; } - if (state.isForConstructor) { - findConstructorReferences(referenceLocation, sourceFile, search, state); - } - else { - addReference(referenceLocation, relatedSymbol, search.location, state); + switch (state.specialSearchKind) { + case 0 /* None */: + addReference(referenceLocation, relatedSymbol, search.location, state); + break; + case 1 /* Constructor */: + addConstructorReferences(referenceLocation, sourceFile, search, state); + break; + case 2 /* Class */: + addClassStaticThisReferences(referenceLocation, search, state); + break; + default: + ts.Debug.assertNever(state.specialSearchKind); } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } @@ -84222,14 +85604,16 @@ var ts; } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { - searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); } function addRef() { addReference(referenceLocation, localSymbol, search.location, state); } } function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; } function isExportSpecifierAlias(referenceLocation, exportSpecifier) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; @@ -84283,24 +85667,48 @@ var ts; } } /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ - function findConstructorReferences(referenceLocation, sourceFile, search, state) { + function addConstructorReferences(referenceLocation, sourceFile, search, state) { if (ts.isNewExpressionTarget(referenceLocation)) { addReference(referenceLocation, search.symbol, search.location, state); } - var pusher = state.referenceAdder(search.symbol, search.location); + var pusher = function () { return state.referenceAdder(search.symbol, search.location); }; if (ts.isClassLike(referenceLocation.parent)) { - ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + ts.Debug.assert(referenceLocation.kind === 79 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); // This is the class declaration containing the constructor. - findOwnConstructorReferences(search.symbol, sourceFile, pusher); + findOwnConstructorReferences(search.symbol, sourceFile, pusher()); } else { // If this class appears in `extends C`, then the extending class' "super" calls are references. var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending)) { - findSuperConstructorAccesses(classExtending, pusher); + if (classExtending) { + findSuperConstructorAccesses(classExtending, pusher()); } } } + function addClassStaticThisReferences(referenceLocation, search, state) { + addReference(referenceLocation, search.symbol, search.location, state); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + // This is the class declaration. + addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location)); + } + } + function addStaticThisReferences(classLike, pusher) { + for (var _i = 0, _a = classLike.members; _i < _a.length; _i++) { + var member = _a[_i]; + if (!(ts.isMethodOrAccessor(member) && ts.hasModifier(member, 32 /* Static */))) { + continue; + } + member.body.forEachChild(function cb(node) { + if (node.kind === 99 /* ThisKeyword */) { + pusher(node); + } + else if (!ts.isFunctionLike(node)) { + node.forEachChild(cb); + } + }); + } + } function getPropertyAccessExpressionFromRightHandSide(node) { return ts.isRightSideOfPropertyAccess(node) && node.parent; } @@ -84312,12 +85720,12 @@ var ts; for (var _i = 0, _a = classSymbol.members.get("__constructor" /* Constructor */).declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 123 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 153 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 154 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 152 /* MethodDeclaration */) { + if (decl && decl.kind === 153 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 99 /* ThisKeyword */, function (thisKeyword) { @@ -84338,7 +85746,7 @@ var ts; } for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 153 /* Constructor */); + ts.Debug.assert(decl.kind === 154 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 97 /* SuperKeyword */, function (node) { @@ -84358,7 +85766,7 @@ var ts; if (refNode.kind !== 71 /* Identifier */) { return; } - if (refNode.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 269 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -84372,12 +85780,12 @@ var ts; var containingTypeReference = getContainingTypeReference(refNode); if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { var parent = containingTypeReference.parent; - if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + if (ts.hasType(parent) && parent.type === containingTypeReference && ts.hasInitializer(parent) && isImplementationExpression(parent.initializer)) { addReference(parent.initializer); } else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { var body = parent.body; - if (body.kind === 208 /* Block */) { + if (body.kind === 211 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { addReference(returnStatement.expression); @@ -84418,12 +85826,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ - && node.parent.kind === 263 /* HeritageClause */ + if (node.kind === 205 /* ExpressionWithTypeArguments */ + && node.parent.kind === 266 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 71 /* Identifier */ || node.kind === 180 /* PropertyAccessExpression */) { + else if (node.kind === 71 /* Identifier */ || node.kind === 183 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -84434,13 +85842,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 178 /* ArrayLiteralExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 181 /* ArrayLiteralExpression */: return true; default: return false; @@ -84494,7 +85902,7 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } @@ -84522,13 +85930,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -84559,27 +85967,27 @@ var ts; // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -84588,58 +85996,58 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 269 /* SourceFile */) { + if (searchSpaceNode.kind === 272 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this"); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, staticFlag, references); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, references); } return [{ definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (!node || !ts.isThis(node)) { - return; - } - var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); - switch (searchSpaceNode.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - if (searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - // Make sure the container belongs to the same class - // and has the appropriate static modifier from the original container. - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 269 /* SourceFile */: - if (container.kind === 269 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - } - }); - } + } + function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, result) { + ts.forEach(possiblePositions, function (position) { + var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); + if (!node || !ts.isThis(node)) { + return; + } + var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); + switch (searchSpaceNode.kind) { + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + if (searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 272 /* SourceFile */: + if (container.kind === 272 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + } + }); } function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; @@ -84667,13 +86075,13 @@ var ts; // This is not needed when searching for re-exports. function populateSearchSymbolSet(symbol, location, checker, implementations) { // The search set contains at least the current symbol - var result = [symbol]; + var result = []; var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { // If the location is name of property symbol from object literal destructuring pattern // Search the property symbol // for ( { property: p2 } of elems) { } - if (containingObjectLiteralElement.kind !== 266 /* ShorthandPropertyAssignment */) { + if (containingObjectLiteralElement.kind !== 269 /* ShorthandPropertyAssignment */) { var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); if (propertySymbol) { result.push(propertySymbol); @@ -84682,9 +86090,10 @@ var ts; // If the location is in a context sensitive location (i.e. in an object literal) try // to get a contextual type for it, and add the property symbol from the contextual // type to the search set - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - ts.addRange(result, checker.getRootSymbols(contextualSymbol)); - }); + for (var _i = 0, _a = getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker); _i < _a.length; _i++) { + var contextualSymbol = _a[_i]; + addRootSymbols(contextualSymbol); + } /* Because in short-hand property assignment, location has two meaning : property name and as value of the property * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of * property name and variable declaration of the identifier. @@ -84720,9 +86129,7 @@ var ts; // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list for (var _i = 0, _a = checker.getRootSymbols(sym); _i < _a.length; _i++) { var rootSymbol = _a[_i]; - if (rootSymbol !== sym) { - result.push(rootSymbol); - } + result.push(rootSymbol); // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), checker); @@ -84767,7 +86174,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -84805,9 +86212,7 @@ var ts; // compare to our searchSymbol var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - return ts.find(checker.getRootSymbols(contextualSymbol), search.includes); - }); + var contextualSymbol = ts.firstDefined(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), findRootSymbol); if (contextualSymbol) { return contextualSymbol; } @@ -84833,7 +86238,7 @@ var ts; function findRootSymbol(sym) { // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) // Or a union property, use its underlying unioned symbols - return ts.forEach(state.checker.getRootSymbols(sym), function (rootSymbol) { + return ts.firstDefined(checker.getRootSymbols(sym), function (rootSymbol) { // if it is in the list, then we are done if (search.includes(rootSymbol)) { return rootSymbol; @@ -84843,11 +86248,11 @@ var ts; // parent symbol if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { // Parents will only be defined if implementations is true - if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, checker); })) { return undefined; } var result = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), state.checker); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), checker); return ts.find(result, search.includes); } return undefined; @@ -84855,7 +86260,7 @@ var ts; } } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -84867,26 +86272,11 @@ var ts; } /** Gets all symbols for one property. Does not get symbols for every property. */ function getPropertySymbolsFromContextualType(node, checker) { - var objectLiteral = node.parent; - var contextualType = checker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(node.parent); var name = getNameFromObjectLiteralElement(node); - if (name && contextualType) { - var result_5 = []; - var symbol = contextualType.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - if (contextualType.flags & 131072 /* Union */) { - ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - }); - } - return result_5; - } - return undefined; + var symbol = contextualType && name && contextualType.getProperty(name); + return symbol ? [symbol] : + contextualType && contextualType.flags & 131072 /* Union */ ? ts.mapDefined(contextualType.types, function (t) { return t.getProperty(name); }) : ts.emptyArray; } /** * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations @@ -84921,32 +86311,30 @@ var ts; if (!node) { return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 227 /* VariableDeclaration */) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); - } + else if (ts.isVariableLike(node) && ts.hasInitializer(node)) { + return true; + } + else if (node.kind === 230 /* VariableDeclaration */) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); } else if (ts.isFunctionLike(node)) { return !!node.body || ts.hasModifier(node, 2 /* Ambient */); } else { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return true; } } return false; } function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 209 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 228 /* VariableDeclarationList */); + if (node.parent && node.parent.parent && node.parent.parent.kind === 212 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 231 /* VariableDeclarationList */); return node.parent.parent; } } @@ -85012,21 +86400,9 @@ var ts; var GoToDefinition; (function (GoToDefinition) { function getDefinitionAtPosition(program, sourceFile, position) { - /// Triple slash reference comments - var comment = findReferenceInPosition(sourceFile.referencedFiles, position); - if (comment) { - var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); - if (referenceFile) { - return [getDefinitionInfoForFileReference(comment.fileName, referenceFile.fileName)]; - } - // Might still be on jsdoc, so keep looking. - } - // Type reference directives - var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); - if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); - return referenceFile && referenceFile.resolvedFileName && - [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; + var reference = getReferenceAtPosition(sourceFile, position, program); + if (reference) { + return [getDefinitionInfoForFileReference(reference.fileName, reference.file.fileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); if (node === sourceFile) { @@ -85064,7 +86440,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -85114,6 +86490,21 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; + function getReferenceAtPosition(sourceFile, position, program) { + var referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); + if (referencePath) { + var file = ts.tryResolveScriptReference(program, sourceFile, referencePath); + return file && { fileName: referencePath.fileName, file: file }; + } + var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); + if (typeReferenceDirective) { + var reference = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + var file = reference && program.getSourceFile(reference.resolvedFileName); + return file && { fileName: typeReferenceDirective.fileName, file: file }; + } + return undefined; + } + GoToDefinition.getReferenceAtPosition = getReferenceAtPosition; /// Goto type function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) { var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); @@ -85121,26 +86512,14 @@ var ts; return undefined; } var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - return undefined; - } - var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + var type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node); if (!type) { return undefined; } if (type.flags & 131072 /* Union */ && !(type.flags & 16 /* Enum */)) { - var result_6 = []; - ts.forEach(type.types, function (t) { - if (t.symbol) { - ts.addRange(/*to*/ result_6, /*from*/ getDefinitionFromSymbol(typeChecker, t.symbol, node)); - } - }); - return result_6; + return ts.flatMap(type.types, function (t) { return t.symbol && getDefinitionFromSymbol(typeChecker, t.symbol, node); }); } - if (!type.symbol) { - return undefined; - } - return getDefinitionFromSymbol(typeChecker, type.symbol, node); + return type.symbol && getDefinitionFromSymbol(typeChecker, type.symbol, node); } GoToDefinition.getTypeDefinitionAtPosition = getTypeDefinitionAtPosition; function getDefinitionAndBoundSpan(program, sourceFile, position) { @@ -85151,10 +86530,7 @@ var ts; // Check if position is on triple slash reference. var comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (comment) { - return { - definitions: definitions, - textSpan: ts.createTextSpanFromBounds(comment.pos, comment.end) - }; + return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) }; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); var textSpan = ts.createTextSpan(node.getStart(), node.getWidth()); @@ -85174,77 +86550,48 @@ var ts; return true; } switch (declaration.kind) { - case 240 /* ImportClause */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: return true; - case 243 /* ImportSpecifier */: - return declaration.parent.kind === 242 /* NamedImports */; + case 246 /* ImportSpecifier */: + return declaration.parent.kind === 245 /* NamedImports */; default: return false; } } function getDefinitionFromSymbol(typeChecker, symbol, node) { - var result = []; - var declarations = symbol.getDeclarations(); var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); - } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { + return getConstructSignatureDefinition() || getCallSignatureDefinition() || ts.map(symbol.declarations, function (declaration) { return createDefinitionInfo(declaration, symbolKind, symbolName, containerName); }); + function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (ts.isNewExpressionTarget(location) || location.kind === 123 /* ConstructorKeyword */) { - if (symbol.flags & 32 /* Class */) { - // Find the first class-like declaration and try to get the construct signature. - for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.isClassLike(declaration)) { - return tryAddSignature(declaration.members, /*selectConstructors*/ true, symbolKind, symbolName, containerName, result); - } - } - ts.Debug.fail("Expected declaration to have at least one class-like declaration"); - } + if (symbol.flags & 32 /* Class */ && (ts.isNewExpressionTarget(node) || node.kind === 123 /* ConstructorKeyword */)) { + var cls = ts.find(symbol.declarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); + return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } - return false; } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location) || ts.isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result); - } - return false; + function getCallSignatureDefinition() { + return ts.isCallExpressionTarget(node) || ts.isNewExpressionTarget(node) || ts.isNameOfFunctionDeclaration(node) + ? getSignatureDefinition(symbol.declarations, /*selectConstructors*/ false) + : undefined; } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + function getSignatureDefinition(signatureDeclarations, selectConstructors) { if (!signatureDeclarations) { - return false; + return undefined; } - var declarations = []; - var definition; - for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { - var d = signatureDeclarations_1[_i]; - if (selectConstructors ? d.kind === 153 /* Constructor */ : isSignatureDeclaration(d)) { - declarations.push(d); - if (d.body) - definition = d; - } - } - if (declarations.length) { - result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); - return true; - } - return false; + var declarations = signatureDeclarations.filter(selectConstructors ? ts.isConstructorDeclaration : isSignatureDeclaration); + return declarations.length + ? [createDefinitionInfo(ts.find(declarations, function (d) { return !!d.body; }) || ts.last(declarations), symbolKind, symbolName, containerName)] + : undefined; } } function isSignatureDeclaration(node) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return true; default: return false; @@ -85286,6 +86633,7 @@ var ts; } return undefined; } + GoToDefinition.findReferenceInPosition = findReferenceInPosition; function getDefinitionInfoForFileReference(name, targetFileName) { return { fileName: targetFileName, @@ -85324,7 +86672,6 @@ var ts; (function (ts) { var JsDoc; (function (JsDoc) { - var singleLineTemplate = { newText: "/** */", caretOffset: 3 }; var jsDocTagNames = [ "augments", "author", @@ -85362,6 +86709,7 @@ var ts; "see", "since", "static", + "template", "throws", "type", "typedef", @@ -85378,18 +86726,29 @@ var ts; // from Array - Array and Array var documentationComment = []; forEachUnique(declarations, function (declaration) { - ts.forEach(ts.getAllJSDocs(declaration), function (doc) { - if (doc.comment) { - if (documentationComment.length) { - documentationComment.push(ts.lineBreakPart()); - } - documentationComment.push(ts.textPart(doc.comment)); + for (var _i = 0, _a = getCommentHavingNodes(declaration); _i < _a.length; _i++) { + var comment = _a[_i].comment; + if (comment === undefined) + continue; + if (documentationComment.length) { + documentationComment.push(ts.lineBreakPart()); } - }); + documentationComment.push(ts.textPart(comment)); + } }); return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getCommentHavingNodes(declaration) { + switch (declaration.kind) { + case 292 /* JSDocPropertyTag */: + return [declaration]; + case 291 /* JSDocTypedefTag */: + return [declaration.parent]; + default: + return ts.getJSDocCommentsAndTags(declaration); + } + } function getJsDocTagsFromDeclarations(declarations) { // Only collect doc comments from duplicate declarations once. var tags = []; @@ -85405,25 +86764,28 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return withNode(tag.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 288 /* JSDocTypedefTag */: - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: + case 291 /* JSDocTypedefTag */: + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: return comment; } function withNode(node) { - return node.getText() + " " + comment; + return addComment(node.getText()); } function withList(list) { - return list.map(function (x) { return x.getText(); }) + " " + comment; + return addComment(list.map(function (x) { return x.getText(); }).join(", ")); + } + function addComment(s) { + return comment === undefined ? s : s + " " + comment; } } /** @@ -85434,7 +86796,7 @@ var ts; function forEachUnique(array, callback) { if (array) { for (var i = 0; i < array.length; i++) { - if (ts.indexOf(array, array[i]) === i) { + if (array.indexOf(array[i]) === i) { var result = callback(array[i], i); if (result) { return result; @@ -85515,9 +86877,16 @@ var ts; /** * Checks if position points to a valid position to add JSDoc comments, and if so, * returns the appropriate template. Otherwise returns an empty string. - * Invalid positions are - * - within comments, strings (including template literals and regex), and JSXText - * - within a token + * Valid positions are + * - outside of comments, statements, and expressions, and + * - preceding a: + * - function/constructor/method declaration + * - class declarations + * - variable statements + * - namespace declarations + * - interface declarations + * - method signatures + * - type alias declarations * * Hosts should ideally check that: * - The line is all whitespace up to 'position' before performing the insertion. @@ -85540,29 +86909,33 @@ var ts; } var commentOwnerInfo = getCommentOwnerInfo(tokenAtPos); if (!commentOwnerInfo) { - // if climbing the tree did not find a declaration with parameters, complete to a single line comment - return singleLineTemplate; - } - var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; - if (commentOwner.kind === 10 /* JsxText */) { return undefined; } - if (commentOwner.getStart() < position || parameters.length === 0) { - // if climbing the tree found a declaration with parameters but the request was made inside it - // or if there are no parameters, complete to a single line comment - return singleLineTemplate; + var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; + if (commentOwner.getStart() < position) { + return undefined; + } + if (!parameters || parameters.length === 0) { + // if there are no parameters, just complete to a single line JSDoc comment + var singleLineResult = "/** */"; + return { newText: singleLineResult, caretOffset: 3 }; } var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; // replace non-whitespace characters in prefix with spaces. var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); - var docParams = parameters.map(function (_a, i) { - var name = _a.name; - var nameText = ts.isIdentifier(name) ? name.text : "param" + i; - var type = isJavaScriptFile ? "{any} " : ""; - return indentationStr + " * @param " + type + nameText + newLine; - }).join(""); + var docParams = ""; + for (var i = 0; i < parameters.length; i++) { + var currentName = parameters[i].name; + var paramName = currentName.kind === 71 /* Identifier */ ? currentName.escapedText : "param" + i; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } + } // A doc comment consists of the following // * The opening comment line // * the first line (without a param) for the object's untagged info (this is also where the caret ends up) @@ -85582,23 +86955,35 @@ var ts; function getCommentOwnerInfo(tokenAtPos) { for (var commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 152 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 209 /* VariableStatement */: { + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 150 /* PropertySignature */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 235 /* TypeAliasDeclaration */: + return { commentOwner: commentOwner }; + case 212 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer) : undefined; - return parameters_1 ? { commentOwner: commentOwner, parameters: parameters_1 } : undefined; + return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 269 /* SourceFile */: + case 272 /* SourceFile */: return undefined; - case 195 /* BinaryExpression */: { + case 237 /* ModuleDeclaration */: + // If in walking up the tree, we hit a a nested namespace declaration, + // then we must be somewhere within a dotted namespace name; however we don't + // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. + return commentOwner.parent.kind === 237 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 198 /* BinaryExpression */: { var be = commentOwner; if (ts.getSpecialPropertyAssignmentKind(be) === 0 /* None */) { return undefined; @@ -85606,10 +86991,6 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 10 /* JsxText */: { - var parameters_3 = ts.emptyArray; - return { commentOwner: commentOwner, parameters: parameters_3 }; - } } } } @@ -85622,17 +87003,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 186 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 189 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return rightHandSide.parameters; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { return member.parameters; } } @@ -85642,16 +87023,88 @@ var ts; } })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + function stringToInt(str) { + var n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error("Error in parseInt(" + JSON.stringify(str) + ")"); + } + return n; + } + var isPrereleaseRegex = /^(.*)-next.\d+/; + var prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + var semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + var Semver = /** @class */ (function () { + function Semver(major, minor, patch, + /** + * If true, this is `major.minor.0-next.patch`. + * If false, this is `major.minor.patch`. + */ + isPrerelease) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.isPrerelease = isPrerelease; + } + Semver.parse = function (semver) { + var isPrerelease = isPrereleaseRegex.test(semver); + var result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error("Unexpected semver: " + semver + " (isPrerelease: " + isPrerelease + ")"); + } + return result; + }; + Semver.fromRaw = function (_a) { + var major = _a.major, minor = _a.minor, patch = _a.patch, isPrerelease = _a.isPrerelease; + return new Semver(major, minor, patch, isPrerelease); + }; + // This must parse the output of `versionString`. + Semver.tryParse = function (semver, isPrerelease) { + // Per the semver spec : + // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." + var rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; + var match = rgx.exec(semver); + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; + }; + Object.defineProperty(Semver.prototype, "versionString", { + get: function () { + return this.isPrerelease ? this.major + "." + this.minor + ".0-next." + this.patch : this.major + "." + this.minor + "." + this.patch; + }, + enumerable: true, + configurable: true + }); + Semver.prototype.equals = function (sem) { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + }; + Semver.prototype.greaterThan = function (sem) { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); + }; + return Semver; + }()); + ts.Semver = Semver; +})(ts || (ts = {})); // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// /// /// +/// /* @internal */ var ts; (function (ts) { var JsTyping; (function (JsTyping) { + /* @internal */ + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = ts.Semver.parse(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest")); + return !availableVersion.greaterThan(cachedTyping.version); + } + JsTyping.isTypingUpToDate = isTypingUpToDate; /* @internal */ JsTyping.nodeCoreModuleList = [ "buffer", "querystring", "events", "http", "cluster", @@ -85680,11 +87133,11 @@ var ts; * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ - function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; } @@ -85721,9 +87174,9 @@ var ts; addInferredTypings(module, "Inferred typings from unresolved imports"); } // Add the cached typing locations for inferred typings that are already installed - packageNameToTypingLocation.forEach(function (typingLocation, name) { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); + packageNameToTypingLocation.forEach(function (typing, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { + inferredTypings.set(name, typing.typingLocation); } }); // Remove typings that the user has added to the exclude list @@ -85815,8 +87268,8 @@ var ts; if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } - var result_7 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - var packageJson = result_7.config; + var result_5 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + var packageJson = result_5.config; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. @@ -85947,7 +87400,7 @@ var ts; if (!shouldKeepItem(declaration, checker)) { continue; } - // It was a match! If the pattern has dots in it, then also see if the + // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. var containerMatches = matches; if (patternMatcher.patternContainsDots) { @@ -85963,9 +87416,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 240 /* ImportClause */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -85976,8 +87429,8 @@ var ts; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); // This is a case sensitive match, only if all the submatches were case sensitive. - for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { - var match = matches_2[_i]; + for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { + var match = matches_1[_i]; if (!match.isCaseSensitive) { return false; } @@ -85992,7 +87445,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (name.kind === 145 /* ComputedPropertyName */) { + else if (name.kind === 146 /* ComputedPropertyName */) { return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); } else { @@ -86014,7 +87467,7 @@ var ts; } return true; } - if (expression.kind === 180 /* PropertyAccessExpression */) { + if (expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -86028,7 +87481,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -86046,8 +87499,8 @@ var ts; function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); var bestMatchKind = ts.PatternMatchKind.camelCase; - for (var _i = 0, matches_3 = matches; _i < matches_3.length; _i++) { - var match = matches_3[_i]; + for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { + var match = matches_2[_i]; var kind = match.kind; if (kind < bestMatchKind) { bestMatchKind = kind; @@ -86209,7 +87662,7 @@ var ts; return; } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -86221,21 +87674,21 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 152 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -86247,7 +87700,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -86258,8 +87711,8 @@ var ts; } } break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var _d = node, name = _d.name, initializer = _d.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -86280,12 +87733,12 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: startNode(node); for (var _e = 0, _f = node.members; _e < _f.length; _e++) { var member = _f[_e]; @@ -86295,9 +87748,9 @@ var ts; } endNode(); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: startNode(node); for (var _g = 0, _h = node.members; _g < _h.length; _g++) { var member = _h[_g]; @@ -86305,18 +87758,18 @@ var ts; } endNode(); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 247 /* ExportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 158 /* IndexSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 232 /* TypeAliasDeclaration */: + case 250 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 159 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 235 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var special = ts.getSpecialPropertyAssignmentKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -86337,7 +87790,7 @@ var ts; if (ts.hasJSDocNodes(node)) { ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -86394,12 +87847,12 @@ var ts; return false; } switch (a.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -86408,7 +87861,7 @@ var ts; // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { - return a.body.kind === b.body.kind && (a.body.kind !== 234 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 237 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -86438,7 +87891,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -86446,18 +87899,18 @@ var ts; return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName)); } switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: return getFunctionOrClassName(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var name = ts.getNameOfDeclaration(node); @@ -86468,16 +87921,16 @@ var ts; } } switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -86485,15 +87938,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return "new()"; - case 156 /* CallSignature */: + case 157 /* CallSignature */: return "()"; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "[]"; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -86505,7 +87958,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 209 /* VariableStatement */) { + if (parentNode && parentNode.kind === 212 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 71 /* Identifier */) { @@ -86534,24 +87987,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 269 /* SourceFile */: - case 232 /* TypeAliasDeclaration */: - case 288 /* JSDocTypedefTag */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 235 /* TypeAliasDeclaration */: + case 291 /* JSDocTypedefTag */: return true; - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 227 /* VariableDeclaration */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 230 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -86561,10 +88014,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -86573,7 +88026,7 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 227 /* VariableDeclaration */ && childKind !== 177 /* BindingElement */; + return childKind !== 230 /* VariableDeclaration */ && childKind !== 180 /* BindingElement */; }); } } @@ -86629,7 +88082,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -86640,18 +88093,16 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 234 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 237 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 145 /* ComputedPropertyName */; + return !member.name || member.name.kind === 146 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 269 /* SourceFile */ - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 272 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 227 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 230 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -86660,14 +88111,14 @@ var ts; if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 227 /* VariableDeclaration */) { + else if (node.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 195 /* BinaryExpression */ && + else if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 265 /* PropertyAssignment */ && node.parent.name) { + else if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512 /* Default */) { @@ -86679,9 +88130,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: return true; default: return false; @@ -86691,6 +88142,164 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var OrganizeImports; + (function (OrganizeImports) { + function organizeImports(sourceFile, formatContext, host) { + // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) + // All of the old ImportDeclarations in the file, in syntactic order. + var oldImportDecls = sourceFile.statements.filter(ts.isImportDeclaration); + if (oldImportDecls.length === 0) { + return []; + } + var oldImportGroups = ts.group(oldImportDecls, function (importDecl) { return getExternalModuleName(importDecl.moduleSpecifier); }); + var sortedImportGroups = ts.stableSort(oldImportGroups, function (group1, group2) { + return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); + }); + var newImportDecls = ts.flatMap(sortedImportGroups, function (importGroup) { + return getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup)) + : importGroup; + }); + var changeTracker = ts.textChanges.ChangeTracker.fromContext({ host: host, formatContext: formatContext }); + // Delete or replace the first import. + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: ts.getNewLineOrDefaultFromHost(host, formatContext.options), + }); + } + // Delete any subsequent imports. + for (var i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + return changeTracker.getChanges(); + } + OrganizeImports.organizeImports = organizeImports; + function removeUnusedImports(oldImports) { + return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) + } + function getExternalModuleName(specifier) { + return ts.isStringLiteral(specifier) || ts.isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + /* @internal */ // Internal for testing + /** + * @param importGroup a list of ImportDeclarations, all with the same module name. + */ + function coalesceImports(importGroup) { + if (importGroup.length === 0) { + return importGroup; + } + var _a = getImportParts(importGroup), importWithoutClause = _a.importWithoutClause, defaultImports = _a.defaultImports, namespaceImports = _a.namespaceImports, namedImports = _a.namedImports; + var coalescedImports = []; + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + var defaultImportClause = defaultImports[0].parent; + coalescedImports.push(updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + return coalescedImports; + } + var sortedNamespaceImports = ts.stableSort(namespaceImports, function (n1, n2) { return compareIdentifiers(n1.name, n2.name); }); + for (var _i = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _i < sortedNamespaceImports_1.length; _i++) { + var namespaceImport = sortedNamespaceImports_1[_i]; + // Drop the name, if any + coalescedImports.push(updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + } + if (defaultImports.length === 0 && namedImports.length === 0) { + return coalescedImports; + } + var newDefaultImport; + var newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (var _b = 0, defaultImports_1 = defaultImports; _b < defaultImports_1.length; _b++) { + var defaultImport = defaultImports_1[_b]; + newImportSpecifiers.push(ts.createImportSpecifier(ts.createIdentifier("default"), defaultImport)); + } + } + newImportSpecifiers.push.apply(newImportSpecifiers, ts.flatMap(namedImports, function (n) { return n.elements; })); + var sortedImportSpecifiers = ts.stableSort(newImportSpecifiers, function (s1, s2) { + return compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name); + }); + var importClause = defaultImports.length > 0 + ? defaultImports[0].parent + : namedImports[0].parent; + var newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? ts.createNamedImports(sortedImportSpecifiers) + : ts.updateNamedImports(namedImports[0], sortedImportSpecifiers); + coalescedImports.push(updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + return coalescedImports; + function getImportParts(importGroup) { + var importWithoutClause; + var defaultImports = []; + var namespaceImports = []; + var namedImports = []; + for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) { + var importDeclaration = importGroup_1[_i]; + if (importDeclaration.importClause === undefined) { + // Only the first such import is interesting - the others are redundant. + // Note: Unfortunately, we will lose trivia that was on this node. + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + var _a = importDeclaration.importClause, name = _a.name, namedBindings = _a.namedBindings; + if (name) { + defaultImports.push(name); + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + namespaceImports.push(namedBindings); + } + else { + namedImports.push(namedBindings); + } + } + } + return { + importWithoutClause: importWithoutClause, + defaultImports: defaultImports, + namespaceImports: namespaceImports, + namedImports: namedImports, + }; + } + function compareIdentifiers(s1, s2) { + return ts.compareStringsCaseSensitive(s1.text, s2.text); + } + function updateImportDeclarationAndClause(importClause, name, namedBindings) { + var importDeclaration = importClause.parent; + return ts.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.updateImportClause(importClause, name, namedBindings), importDeclaration.moduleSpecifier); + } + } + OrganizeImports.coalesceImports = coalesceImports; + /* internal */ // Exported for testing + function compareModuleSpecifiers(m1, m2) { + var name1 = getExternalModuleName(m1); + var name2 = getExternalModuleName(m2); + return ts.compareBooleans(name1 === undefined, name2 === undefined) || + ts.compareBooleans(ts.isExternalModuleNameRelative(name1), ts.isExternalModuleNameRelative(name2)) || + ts.compareStringsCaseSensitive(name1, name2); + } + OrganizeImports.compareModuleSpecifiers = compareModuleSpecifiers; + })(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { @@ -86785,24 +88394,24 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(n)) { - return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 188 /* ArrowFunction */); + return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 191 /* ArrowFunction */); } // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 213 /* DoStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 264 /* CatchClause */: + case 216 /* DoStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 267 /* CatchClause */: return spanForNode(n.parent); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -86817,16 +88426,16 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile)); } - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanForNode(n.parent); - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 236 /* CaseBlock */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 239 /* CaseBlock */: return spanForNode(n); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 21 /* OpenBracketToken */); } function spanForObjectOrArrayLiteral(node, open) { @@ -87488,7 +89097,7 @@ var ts; if (token === 124 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 128 /* ModuleKeyword */) { + if (token === 129 /* ModuleKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { recordAmbientExternalModule(); @@ -87521,7 +89130,7 @@ var ts; else { if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -87552,7 +89161,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -87568,7 +89177,7 @@ var ts; token = nextToken(); if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -87598,7 +89207,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -87610,7 +89219,7 @@ var ts; } else if (token === 39 /* AsteriskToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -87635,7 +89244,7 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 132 /* RequireKeyword */) { + if (token === 133 /* RequireKeyword */) { token = nextToken(); if (token === 19 /* OpenParenToken */) { token = nextToken(); @@ -87692,7 +89301,7 @@ var ts; // import "mod"; // import d from "mod" // import {a as A } from "mod"; - // import * as NS from "mod" + // import * as NS from "mod" // import d, {a, b as B} from "mod" // import i = require("mod"); // import("mod"); @@ -87792,9 +89401,16 @@ var ts; symbol.parent.flags & 1536 /* Module */) { return undefined; } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + if (!kind) { + return undefined; + } + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 146 /* ComputedPropertyName */) + ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) + : undefined; + var displayName = specifierName || typeChecker.symbolToString(symbol); + var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); + return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile); } } else if (node.kind === 9 /* StringLiteral */) { @@ -87893,17 +89509,13 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 182 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 185 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. var callExpression = argumentInfo.invocation; var expression = callExpression.expression; - var name = expression.kind === 71 /* Identifier */ - ? expression - : expression.kind === 180 /* PropertyAccessExpression */ - ? expression.name - : undefined; + var name = ts.isIdentifier(expression) ? expression : ts.isPropertyAccessExpression(expression) ? expression.name : undefined; if (!name || !name.escapedText) { return undefined; } @@ -87979,25 +89591,25 @@ var ts; var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } - else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 187 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0, sourceFile); } } - else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 206 /* TemplateSpan */ && node.parent.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 209 /* TemplateSpan */ && node.parent.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 16 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -88028,7 +89640,7 @@ var ts; function getArgumentIndex(argumentsList, node) { // The list we got back can include commas. In the presence of errors it may // also just have nodes without commas. For example "Foo(a b c)" will have 3 - // args without commas. We want to find what index we're at. So we count + // args without commas. We want to find what index we're at. So we count // forward until we hit ourselves, only incrementing the index if it isn't a // comma. // @@ -88038,9 +89650,8 @@ var ts; // that trailing comma in the list, and we'll have generated the appropriate // arg index. var argumentIndex = 0; - var listChildren = argumentsList.getChildren(); - for (var _i = 0, listChildren_1 = listChildren; _i < listChildren_1.length; _i++) { - var child = listChildren_1[_i]; + for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; if (child === node) { break; } @@ -88054,12 +89665,12 @@ var ts; // The argument count for a list is normally the number of non-comma children it has. // For example, if you have "Foo(a,b)" then there will be three children of the arg // list 'a' '' 'b'. So, in this case the arg count will be 2. However, there - // is a small subtlety. If you have "Foo(a,)", then the child list will just have + // is a small subtlety. If you have "Foo(a,)", then the child list will just have // 'a' ''. So, in the case where the last child is a comma, we increase the // arg count by one to compensate. // - // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then - // we'll have: 'a' '' '' + // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then + // we'll have: 'a' '' '' // That will give us 2 non-commas. We then add one for the last comma, giving us an // arg count of 3. var listChildren = argumentsList.getChildren(); @@ -88080,9 +89691,11 @@ var ts; // not enough to put us in the substitution expression; we should consider ourselves part of // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). // + // tslint:disable no-double-space // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` // ^ ^ ^ ^ ^ ^ ^ ^ ^ // Case: 1 1 3 2 1 3 2 2 1 + // tslint:enable no-double-space ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); if (ts.isTemplateLiteralKind(node.kind)) { if (ts.isInsideTemplateLiteral(node, position)) { @@ -88094,9 +89707,7 @@ var ts; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. - var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = ts.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; if (argumentIndex !== 0) { ts.Debug.assertLessThan(argumentIndex, argumentCount); } @@ -88129,12 +89740,11 @@ var ts; // Otherwise, we will not show signature help past the expression. // For example, // - // ` ${ 1 + 1 foo(10) - // | | - // + // ` ${ 1 + 1 foo(10) + // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -88143,7 +89753,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 269 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 272 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -88167,12 +89777,14 @@ var ts; ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); return children[indexOfOpenerToken + 1]; } + var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */; function createSignatureHelpItems(candidates, resolvedSignature, argumentListInfo, typeChecker) { var argumentCount = argumentListInfo.argumentCount, applicableSpan = argumentListInfo.argumentsSpan, invocation = argumentListInfo.invocation, argumentIndex = argumentListInfo.argumentIndex; var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */; var callTarget = ts.getInvokedExpression(invocation); var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); + var printer = ts.createPrinter({ removeComments: true }); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; var prefixDisplayParts = []; @@ -88188,14 +89800,19 @@ var ts; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : ts.emptyArray; suffixDisplayParts.push(ts.punctuationPart(29 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.thisParameter, candidateSignature.parameters, writer, invocation); + var thisParameter = candidateSignature.thisParameter ? [typeChecker.symbolToParameterDeclaration(candidateSignature.thisParameter, invocation, signatureHelpNodeBuilderFlags)] : []; + var params = ts.createNodeArray(thisParameter.concat(ts.map(candidateSignature.parameters, function (param) { return typeChecker.symbolToParameterDeclaration(param, invocation, signatureHelpNodeBuilderFlags); }))); + printer.writeList(1296 /* CallExpressionArguments */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); ts.addRange(suffixDisplayParts, parameterParts); } else { isVariadic = candidateSignature.hasRestParameter; var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); + if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { + var args = ts.createNodeArray(ts.map(candidateSignature.typeParameters, function (p) { return typeChecker.typeParameterToDeclaration(p, invocation); })); + printer.writeList(26896 /* TypeParameters */, args, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); + } }); ts.addRange(prefixDisplayParts, typeParameterParts); prefixDisplayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); @@ -88203,7 +89820,15 @@ var ts; suffixDisplayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = typeChecker.getTypePredicateOfSignature(candidateSignature); + if (predicate) { + typeChecker.writeTypePredicate(predicate, invocation, /*flags*/ undefined, writer); + } + else { + typeChecker.writeType(typeChecker.getReturnTypeOfSignature(candidateSignature), invocation, /*flags*/ undefined, writer); + } }); ts.addRange(suffixDisplayParts, returnTypeParts); return { @@ -88224,7 +89849,8 @@ var ts; return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; function createSignatureHelpParameterForParameter(parameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); + var param = typeChecker.symbolToParameterDeclaration(parameter, invocation, signatureHelpNodeBuilderFlags); + printer.writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: parameter.name, @@ -88235,7 +89861,8 @@ var ts; } function createSignatureHelpParameterForTypeParameter(typeParameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); + var param = typeChecker.typeParameterToDeclaration(typeParameter, invocation); + printer.writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: typeParameter.symbol.name, @@ -88256,7 +89883,7 @@ var ts; function getSymbolKind(typeChecker, symbol, location) { var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -88339,9 +89966,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: return location.kind === 71 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -88350,13 +89979,17 @@ var ts; return "" /* unknown */; } function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 + var nodeModifiers = symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) : "" /* none */; + var symbolModifiers = symbol && symbol.flags & 16777216 /* Optional */ ? + "optional" /* optionalModifier */ + : "" /* none */; + return nodeModifiers && symbolModifiers ? nodeModifiers + "," + symbolModifiers : nodeModifiers || symbolModifiers; } SymbolDisplay.getSymbolModifiers = getSymbolModifiers; // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location - function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { + function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning, alias) { if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; @@ -88366,6 +89999,8 @@ var ts; var hasAddedSymbolInfo; var isThisExpression = location.kind === 99 /* ThisKeyword */ && ts.isExpression(location); var type; + var printer; + var documentationFromAlias; // Class at constructor site need to be shown as constructor apart from property,method, vars if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) { // If it is accessor they are allowed only if location is at name of the accessor @@ -88374,7 +90009,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 180 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 183 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -88395,7 +90030,7 @@ var ts; if (callExpressionLike) { var candidateSignatures = []; signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - var useConstructSignatures = callExpressionLike.kind === 183 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 186 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -88433,14 +90068,14 @@ var ts; displayParts.push(ts.punctuationPart(56 /* ColonToken */)); displayParts.push(ts.spacePart()); if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 4 /* AllowAnyNodeKind */ | 1 /* WriteTypeParametersOrArguments */)); displayParts.push(ts.lineBreakPart()); } if (useConstructSignatures) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - addSignatureDisplayParts(signature, allSignatures, 16 /* WriteArrowStyleSignature */); + addSignatureDisplayParts(signature, allSignatures, 262144 /* WriteArrowStyleSignature */); break; default: // Just signature @@ -88450,7 +90085,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 153 /* Constructor */)) { + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 154 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -88458,21 +90093,21 @@ var ts; return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 153 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 154 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 153 /* Constructor */) { + if (functionDeclaration_1.kind === 154 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 156 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 157 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -88481,7 +90116,8 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */)) { + addAliasPrefixIfNecessary(); + if (ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -88496,25 +90132,25 @@ var ts; writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(109 /* InterfaceKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288 /* TypeAlias */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + prefixNextMeaning(); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 1024 /* InTypeAlias */)); + ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */)); } if (symbolFlags & 384 /* Enum */) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { displayParts.push(ts.keywordPart(76 /* ConstKeyword */)); displayParts.push(ts.spacePart()); @@ -88524,15 +90160,15 @@ var ts; addFullSymbolName(symbol); } if (symbolFlags & 1536 /* Module */) { - addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 234 /* ModuleDeclaration */); + prefixNextMeaning(); + var declaration = ts.getDeclarationOfKind(symbol, 237 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 71 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 129 /* NamespaceKeyword */ : 128 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 130 /* NamespaceKeyword */ : 129 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.textPart("type parameter")); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -88546,28 +90182,28 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 146 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 147 /* TypeParameter */); ts.Debug.assert(decl !== undefined); var declaration = decl.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 157 /* ConstructSignature */) { + if (declaration.kind === 158 /* ConstructSignature */) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 156 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 157 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 64 /* WriteTypeArgumentsOfSignature */)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 232 /* TypeAliasDeclaration */) { + else if (declaration.kind === 235 /* TypeAliasDeclaration */) { // Type alias type parameter // For example - // type list = T[]; // Both T will go through same code path + // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -88579,7 +90215,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 268 /* EnumMember */) { + if (declaration.kind === 271 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -88590,14 +90226,30 @@ var ts; } } if (symbolFlags & 2097152 /* Alias */) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); + if (!hasAddedSymbolInfo) { + var resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { + var resolvedNode = resolvedSymbol.declarations[0]; + var declarationName = ts.getNameOfDeclaration(resolvedNode); + if (declarationName) { + var isExternalModuleDeclaration = ts.isModuleWithStringLiteralName(resolvedNode) && + ts.hasModifier(resolvedNode, 2 /* Ambient */); + var shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; + var resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, resolvedSymbol, ts.getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, semanticMeaning, shouldUseAliasName ? symbol : resolvedSymbol); + displayParts.push.apply(displayParts, resolvedInfo.displayParts); + displayParts.push(ts.lineBreakPart()); + documentationFromAlias = resolvedInfo.documentation; + } + } + } switch (symbol.declarations[0].kind) { - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(129 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(130 /* NamespaceKeyword */)); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 58 /* EqualsToken */ : 79 /* DefaultKeyword */)); @@ -88608,13 +90260,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 238 /* ImportEqualsDeclaration */) { + if (declaration.kind === 241 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(132 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(133 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -88636,7 +90288,7 @@ var ts; if (symbolKind !== "" /* unknown */) { if (type) { if (isThisExpression) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(99 /* ThisKeyword */)); } else { @@ -88653,7 +90305,8 @@ var ts; // If the type is type parameter, format it specially if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + var param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration); + getPrinter().writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -88685,10 +90338,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 269 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 272 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 195 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 198 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -88704,26 +90357,45 @@ var ts; } } } + if (documentation.length === 0 && documentationFromAlias) { + documentation = documentationFromAlias; + } return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; - function addNewLineIfDisplayPartsExist() { + function getPrinter() { + if (!printer) { + printer = ts.createPrinter({ removeComments: true }); + } + return printer; + } + function prefixNextMeaning() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); } + addAliasPrefixIfNecessary(); + } + function addAliasPrefixIfNecessary() { + if (alias) { + pushTypePart("alias" /* alias */); + displayParts.push(ts.spacePart()); + } } function addInPrefix() { displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(92 /* InKeyword */)); displayParts.push(ts.spacePart()); } - function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); + function addFullSymbolName(symbolToDisplay, enclosingDeclaration) { + if (alias && symbolToDisplay === symbol) { + symbolToDisplay = alias; + } + var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbolToDisplay, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */ | 4 /* AllowAnyNodeKind */); ts.addRange(displayParts, fullSymbolDisplayParts); } function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (symbolKind) { pushTypePart(symbolKind); - if (!ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { + if (symbol && !ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -88746,7 +90418,7 @@ var ts; } } function addSignatureDisplayParts(signature, allSignatures, flags) { - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 64 /* WriteTypeArgumentsOfSignature */)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); @@ -88761,7 +90433,8 @@ var ts; } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + var params = typeChecker.symbolToTypeParameterDeclarations(symbol, enclosingDeclaration); + getPrinter().writeList(26896 /* TypeParameters */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -88773,16 +90446,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 187 /* FunctionExpression */) { + if (declaration.kind === 190 /* FunctionExpression */) { return true; } - if (declaration.kind !== 227 /* VariableDeclaration */ && declaration.kind !== 229 /* FunctionDeclaration */) { + if (declaration.kind !== 230 /* VariableDeclaration */ && declaration.kind !== 232 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 269 /* SourceFile */ || parent.kind === 235 /* ModuleBlock */) { + if (parent.kind === 272 /* SourceFile */ || parent.kind === 238 /* ModuleBlock */) { return false; } } @@ -89092,10 +90765,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 257 /* JsxAttribute */: - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 260 /* JsxAttribute */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 71 /* Identifier */; } @@ -89272,17 +90945,21 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 143 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 144 /* LastToken */; token++) { allTokens.push(token); } - function anyTokenExcept(token) { - return { tokens: allTokens.filter(function (t) { return t !== token; }), isSpecific: false }; + function anyTokenExcept() { + var tokens = []; + for (var _i = 0; _i < arguments.length; _i++) { + tokens[_i] = arguments[_i]; + } + return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false }; } var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */])); - var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 143 /* LastKeyword */); + var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 144 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(27 /* FirstBinaryOperator */, 70 /* LastBinaryOperator */); - var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 143 /* OfKeyword */, 118 /* AsKeyword */, 126 /* IsKeyword */]; + var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 144 /* OfKeyword */, 118 /* AsKeyword */, 127 /* IsKeyword */]; var unaryPrefixOperators = [43 /* PlusPlusToken */, 44 /* MinusMinusToken */, 52 /* TildeToken */, 51 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 71 /* Identifier */, 19 /* OpenParenToken */, 21 /* OpenBracketToken */, @@ -89306,7 +90983,7 @@ var ts; // Leave comments alone rule("IgnoreBeforeComment", anyToken, comments, formatting.anyContext, 1 /* Ignore */), rule("IgnoreAfterLineComment", 2 /* SingleLineCommentTrivia */, anyToken, formatting.anyContext, 1 /* Ignore */), - rule("NoSpaceBeforeColon", anyToken, 56 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8 /* Delete */), + rule("NotSpaceBeforeColon", anyToken, 56 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 8 /* Delete */), rule("SpaceAfterColon", 56 /* ColonToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 2 /* Space */), rule("NoSpaceBeforeQuestionMark", anyToken, 55 /* QuestionToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8 /* Delete */), // insert space after '?' only when it is used in conditional operator @@ -89324,17 +91001,17 @@ var ts; rule("NoSpaceBeforeUnaryPostincrementOperator", unaryPostincrementExpressions, 43 /* PlusPlusToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceBeforeUnaryPostdecrementOperator", unaryPostdecrementExpressions, 44 /* MinusMinusToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // More unary operator special-casing. - // DevDiv 181814: Be careful when removing leading whitespace + // DevDiv 181814: Be careful when removing leading whitespace // around unary operators. Examples: - // 1 - -2 --X--> 1--2 - // a + ++b --X--> a+++b + // 1 - -2 --X--> 1--2 + // a + ++b --X--> a+++b rule("SpaceAfterPostincrementWhenFollowedByAdd", 43 /* PlusPlusToken */, 37 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterAddWhenFollowedByUnaryPlus", 37 /* PlusToken */, 37 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterAddWhenFollowedByPreincrement", 37 /* PlusToken */, 43 /* PlusPlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterPostdecrementWhenFollowedBySubtract", 44 /* MinusMinusToken */, 38 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterSubtractWhenFollowedByUnaryMinus", 38 /* MinusToken */, 38 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterSubtractWhenFollowedByPredecrement", 38 /* MinusToken */, 44 /* MinusMinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), - rule("NoSpaceAfterCloseBrace", 18 /* CloseBraceToken */, [22 /* CloseBracketToken */, 26 /* CommaToken */, 25 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterCloseBrace", 18 /* CloseBraceToken */, [26 /* CommaToken */, 25 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 8 /* Delete */), // For functions and control block place } on a new line [multi-line rule] rule("NewLineBeforeCloseBraceInBlockContext", anyTokenIncludingMultilineComments, 18 /* CloseBraceToken */, [isMultilineBlockContext], 4 /* NewLine */), // Space/new line after }. @@ -89344,6 +91021,8 @@ var ts; rule("SpaceBetweenCloseBraceAndElse", 18 /* CloseBraceToken */, 82 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("SpaceBetweenCloseBraceAndWhile", 18 /* CloseBraceToken */, 106 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceBetweenEmptyBraceBrackets", 17 /* OpenBraceToken */, 18 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 8 /* Delete */), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule("SpaceAfterConditionalClosingParen", 20 /* CloseParenToken */, 21 /* OpenBracketToken */, [isControlDeclContext], 2 /* Space */), rule("NoSpaceBetweenFunctionKeywordAndStar", 89 /* FunctionKeyword */, 39 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 8 /* Delete */), rule("SpaceAfterStarInGeneratorDeclaration", 39 /* AsteriskToken */, [71 /* Identifier */, 19 /* OpenParenToken */], [isFunctionDeclarationOrFunctionExpressionContext], 2 /* Space */), rule("SpaceAfterFunctionInFuncDecl", 89 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 2 /* Space */), @@ -89353,7 +91032,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 135 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), + rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 136 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), rule("NoSpaceBetweenYieldKeywordAndStar", 116 /* YieldKeyword */, 39 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8 /* Delete */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [116 /* YieldKeyword */, 39 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2 /* Space */), rule("NoSpaceBetweenReturnAndSemicolon", 96 /* ReturnKeyword */, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -89377,7 +91056,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 58 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [128 /* ModuleKeyword */, 132 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterModuleImport", [129 /* ModuleKeyword */, 133 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 117 /* AbstractKeyword */, @@ -89391,19 +91070,20 @@ var ts; 108 /* ImplementsKeyword */, 91 /* ImportKeyword */, 109 /* InterfaceKeyword */, - 128 /* ModuleKeyword */, - 129 /* NamespaceKeyword */, + 129 /* ModuleKeyword */, + 130 /* NamespaceKeyword */, 112 /* PrivateKeyword */, 114 /* PublicKeyword */, 113 /* ProtectedKeyword */, - 131 /* ReadonlyKeyword */, - 135 /* SetKeyword */, + 132 /* ReadonlyKeyword */, + 136 /* SetKeyword */, 115 /* StaticKeyword */, - 138 /* TypeKeyword */, - 141 /* FromKeyword */, - 127 /* KeyOfKeyword */, + 139 /* TypeKeyword */, + 142 /* FromKeyword */, + 128 /* KeyOfKeyword */, + 126 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 141 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 142 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 9 /* StringLiteral */, 17 /* OpenBraceToken */, [isModuleDeclContext], 2 /* Space */), // Lambda expressions @@ -89421,7 +91101,7 @@ var ts; rule("NoSpaceBeforeCloseAngularBracket", anyToken, 29 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8 /* Delete */), rule("NoSpaceAfterCloseAngularBracket", 29 /* GreaterThanToken */, [19 /* OpenParenToken */, 21 /* OpenBracketToken */, 29 /* GreaterThanToken */, 26 /* CommaToken */], [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8 /* Delete */), // decorators - rule("SpaceBeforeAt", anyToken, 57 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeAt", [20 /* CloseParenToken */, 71 /* Identifier */], 57 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceAfterAt", 57 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Insert space after @ in decorator rule("SpaceAfterDecorator", anyToken, [ @@ -89435,7 +91115,7 @@ var ts; 112 /* PrivateKeyword */, 113 /* ProtectedKeyword */, 125 /* GetKeyword */, - 135 /* SetKeyword */, + 136 /* SetKeyword */, 21 /* OpenBracketToken */, 39 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 2 /* Space */), @@ -89447,8 +91127,8 @@ var ts; // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses rule("SpaceAfterConstructor", 123 /* ConstructorKeyword */, 19 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceAfterConstructor", 123 /* ConstructorKeyword */, 19 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 8 /* Delete */), - rule("SpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext, isNextTokenNotCloseBracket], 2 /* Space */), - rule("NoSpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext], 8 /* Delete */), + rule("SpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket], 2 /* Space */), + rule("NoSpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 8 /* Delete */), // Insert space after function keyword for anonymous functions rule("SpaceAfterAnonymousFunctionKeyword", 89 /* FunctionKeyword */, 19 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 2 /* Space */), rule("NoSpaceAfterAnonymousFunctionKeyword", 89 /* FunctionKeyword */, 19 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 8 /* Delete */), @@ -89503,8 +91183,10 @@ var ts; rule("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], 4 /* NewLine */, 1 /* CanDeleteNewLines */), rule("SpaceAfterTypeAssertion", 29 /* GreaterThanToken */, anyToken, [isOptionEnabled("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 2 /* Space */), rule("NoSpaceAfterTypeAssertion", 29 /* GreaterThanToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 8 /* Delete */), + rule("SpaceBeforeTypeAnnotation", anyToken, 56 /* ColonToken */, [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 2 /* Space */), + rule("NoSpaceBeforeTypeAnnotation", anyToken, 56 /* ColonToken */, [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 8 /* Delete */), ]; - // These rules are lower in priority than user-configurable + // These rules are lower in priority than user-configurable. Rules earlier in this list have priority over rules later in the list. var lowPriorityCommonRules = [ // Space after keyword but not before ; or : or ? rule("NoSpaceBeforeSemicolon", anyToken, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -89512,13 +91194,15 @@ var ts; rule("SpaceBeforeOpenBraceInFunction", functionOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2 /* Space */, 1 /* CanDeleteNewLines */), rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2 /* Space */, 1 /* CanDeleteNewLines */), rule("NoSpaceBeforeComma", anyToken, 26 /* CommaToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), - // No space before and after indexer - rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + // No space before and after indexer `x[]` + rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */, 73 /* CaseKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterCloseBracket", 22 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 8 /* Delete */), rule("SpaceAfterSemicolon", 25 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), + // Remove extra space between for and await + rule("SpaceBetweenForAndAwaitKeyword", 88 /* ForKeyword */, 121 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] - rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementContext, isNotForContext], 2 /* Space */), + rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2 /* Space */), // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. rule("SpaceAfterTryFinally", [102 /* TryKeyword */, 87 /* FinallyKeyword */], 17 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), ]; @@ -89564,58 +91248,73 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 215 /* ForStatement */; + return context.contextNode.kind === 218 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 203 /* AsExpression */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 159 /* TypePredicate */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 170 /* ConditionalType */: + case 206 /* AsExpression */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 160 /* TypePredicate */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 177 /* BindingElement */: + case 180 /* BindingElement */: // equals in type X = ... - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: // equal in p = 0; - case 147 /* Parameter */: - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return context.currentTokenSpan.kind === 58 /* EqualsToken */ || context.nextTokenSpan.kind === 58 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return context.currentTokenSpan.kind === 92 /* InKeyword */ || context.nextTokenSpan.kind === 92 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 217 /* ForOfStatement */: - return context.currentTokenSpan.kind === 143 /* OfKeyword */ || context.nextTokenSpan.kind === 143 /* OfKeyword */; + case 220 /* ForOfStatement */: + return context.currentTokenSpan.kind === 144 /* OfKeyword */ || context.nextTokenSpan.kind === 144 /* OfKeyword */; } return false; } function isNotBinaryOpContext(context) { return !isBinaryOpContext(context); } + function isNotTypeAnnotationContext(context) { + return !isTypeAnnotationContext(context); + } + function isTypeAnnotationContext(context) { + var contextKind = context.contextNode.kind; + return contextKind === 151 /* PropertyDeclaration */ || + contextKind === 150 /* PropertySignature */ || + contextKind === 148 /* Parameter */ || + contextKind === 230 /* VariableDeclaration */ || + ts.isFunctionLikeKind(contextKind); + } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 196 /* ConditionalExpression */; + return context.contextNode.kind === 199 /* ConditionalExpression */ || + context.contextNode.kind === 170 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 175 /* ObjectBindingPattern */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 178 /* ObjectBindingPattern */ || + context.contextNode.kind === 176 /* MappedType */ || + isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration function isBeforeMultilineBlockContext(context) { @@ -89640,70 +91339,70 @@ var ts; return true; } switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 179 /* ObjectLiteralExpression */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 182 /* ObjectLiteralExpression */: + case 238 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 156 /* CallSignature */: - case 187 /* FunctionExpression */: - case 153 /* Constructor */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 190 /* FunctionExpression */: + case 154 /* Constructor */: + case 191 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 231 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one + case 234 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 229 /* FunctionDeclaration */ || context.contextNode.kind === 187 /* FunctionExpression */; + return context.contextNode.kind === 232 /* FunctionDeclaration */ || context.contextNode.kind === 190 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 164 /* TypeLiteral */: - case 234 /* ModuleDeclaration */: - case 245 /* ExportDeclaration */: - case 246 /* NamedExports */: - case 239 /* ImportDeclaration */: - case 242 /* NamedImports */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 165 /* TypeLiteral */: + case 237 /* ModuleDeclaration */: + case 248 /* ExportDeclaration */: + case 249 /* NamedExports */: + case 242 /* ImportDeclaration */: + case 245 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 230 /* ClassDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 264 /* CatchClause */: - case 235 /* ModuleBlock */: - case 222 /* SwitchStatement */: + case 233 /* ClassDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 267 /* CatchClause */: + case 238 /* ModuleBlock */: + case 225 /* SwitchStatement */: return true; - case 208 /* Block */: { + case 211 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 188 /* ArrowFunction */ && blockParent.kind !== 187 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 191 /* ArrowFunction */ && blockParent.kind !== 190 /* FunctionExpression */) { return true; } } @@ -89712,31 +91411,31 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 212 /* IfStatement */: - case 222 /* SwitchStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 225 /* TryStatement */: - case 213 /* DoStatement */: - case 221 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 224 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 264 /* CatchClause */: + case 267 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 179 /* ObjectLiteralExpression */; + return context.contextNode.kind === 182 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 182 /* CallExpression */; + return context.contextNode.kind === 185 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 183 /* NewExpression */; + return context.contextNode.kind === 186 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -89748,25 +91447,25 @@ var ts; return context.nextTokenSpan.kind !== 22 /* CloseBracketToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 188 /* ArrowFunction */; + return context.contextNode.kind === 191 /* ArrowFunction */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; } - function isNonJsxElementContext(context) { - return context.contextNode.kind !== 250 /* JsxElement */; + function isNonJsxElementOrFragmentContext(context) { + return context.contextNode.kind !== 253 /* JsxElement */ && context.contextNode.kind !== 257 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 260 /* JsxExpression */; + return context.contextNode.kind === 263 /* JsxExpression */ || context.contextNode.kind === 262 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 257 /* JsxAttribute */; + return context.nextTokenParent.kind === 260 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 257 /* JsxAttribute */; + return context.contextNode.kind === 260 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 251 /* JsxSelfClosingElement */; + return context.contextNode.kind === 254 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -89781,45 +91480,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 228 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 231 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 234 /* ModuleDeclaration */; + return context.contextNode.kind === 237 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 164 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 165 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 157 /* ConstructSignature */; + return context.contextNode.kind === 158 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 27 /* LessThanToken */ && token.kind !== 29 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 160 /* TypeReference */: - case 185 /* TypeAssertionExpression */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 161 /* TypeReference */: + case 188 /* TypeAssertionExpression */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -89830,16 +91529,16 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 185 /* TypeAssertionExpression */; + return context.contextNode.kind === 188 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 191 /* VoidExpression */; + return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 194 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 198 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 201 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 204 /* NonNullExpression */; + return context.contextNode.kind === 207 /* NonNullExpression */; } })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -89891,12 +91590,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 143 /* LastKeyword */ && column <= 143 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 144 /* LastKeyword */ && column <= 144 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 143 /* LastToken */ + 1; + var mapRowLength = 144 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; @@ -90078,17 +91777,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 235 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 269 /* SourceFile */: - case 208 /* Block */: - case 235 /* ModuleBlock */: + return body && body.kind === 238 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 272 /* SourceFile */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -90279,48 +91978,51 @@ var ts; return -1 /* Unknown */; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { - var indentation = inheritedIndentation; var delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; if (effectiveParentStartLine === startLine) { // if node is located on the same line with the parent // - inherit indentation from the parent // - push children if either parent of node itself has non-zero delta - indentation = startLine === lastIndentedLine - ? indentationOnLastIndentedLine - : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta); + return { + indentation: startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(), + delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta) + }; } - else if (indentation === -1 /* Unknown */) { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); + else if (inheritedIndentation === -1 /* Unknown */) { + if (node.kind === 19 /* OpenParenToken */ && startLine === lastIndentedLine) { + // the is used for chaining methods formatting + // - we need to get the indentation on last line and the delta of parent + return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) }; + } + else if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + return { indentation: parentDynamicIndentation.getIndentation(), delta: delta }; } else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node); + return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta }; } } - return { - indentation: indentation, - delta: delta - }; + else { + return { indentation: inheritedIndentation, delta: delta }; + } } function getFirstNonDecoratorTokenOfNode(node) { if (node.modifiers && node.modifiers.length) { return node.modifiers[0].kind; } switch (node.kind) { - case 230 /* ClassDeclaration */: return 75 /* ClassKeyword */; - case 231 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; - case 229 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; - case 233 /* EnumDeclaration */: return 233 /* EnumDeclaration */; - case 154 /* GetAccessor */: return 125 /* GetKeyword */; - case 155 /* SetAccessor */: return 135 /* SetKeyword */; - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: return 75 /* ClassKeyword */; + case 234 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; + case 232 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; + case 236 /* EnumDeclaration */: return 236 /* EnumDeclaration */; + case 155 /* GetAccessor */: return 125 /* GetKeyword */; + case 156 /* SetAccessor */: return 136 /* SetKeyword */; + case 153 /* MethodDeclaration */: if (node.asteriskToken) { return 39 /* AsteriskToken */; } // falls through - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: return ts.getNameOfDeclaration(node).kind; } } @@ -90335,67 +92037,55 @@ var ts; case 18 /* CloseBraceToken */: case 22 /* CloseBracketToken */: case 20 /* CloseParenToken */: - return indentation + getEffectiveDelta(delta, container); + return indentation + getDelta(container); } return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation; }, getIndentationForToken: function (line, kind, container) { - if (nodeStartLine !== line && node.decorators) { - if (kind === getFirstNonDecoratorTokenOfNode(node)) { - // if this token is the first token following the list of decorators, we do not need to indent - return indentation; - } - } - switch (kind) { - // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent - case 17 /* OpenBraceToken */: - case 18 /* CloseBraceToken */: - case 19 /* OpenParenToken */: - case 20 /* CloseParenToken */: - case 82 /* ElseKeyword */: - case 106 /* WhileKeyword */: - case 57 /* AtToken */: - return indentation; - case 41 /* SlashToken */: - case 29 /* GreaterThanToken */: { - if (container.kind === 252 /* JsxOpeningElement */ || - container.kind === 253 /* JsxClosingElement */ || - container.kind === 251 /* JsxSelfClosingElement */) { - return indentation; - } - break; - } - case 21 /* OpenBracketToken */: - case 22 /* CloseBracketToken */: { - if (container.kind !== 173 /* MappedType */) { - return indentation; - } - break; - } - } - // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + return shouldAddDelta(line, kind, container) ? indentation + getDelta(container) : indentation; }, getIndentation: function () { return indentation; }, - getDelta: function (child) { return getEffectiveDelta(delta, child); }, + getDelta: getDelta, recomputeIndentation: function (lineAdded) { if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent, node)) { - if (lineAdded) { - indentation += options.indentSize; - } - else { - indentation -= options.indentSize; - } - if (formatting.SmartIndenter.shouldIndentChildNode(node)) { - delta = options.indentSize; - } - else { - delta = 0; - } + indentation += lineAdded ? options.indentSize : -options.indentSize; + delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; } } }; - function getEffectiveDelta(delta, child) { + function shouldAddDelta(line, kind, container) { + switch (kind) { + // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent + case 17 /* OpenBraceToken */: + case 18 /* CloseBraceToken */: + case 19 /* OpenParenToken */: + case 20 /* CloseParenToken */: + case 82 /* ElseKeyword */: + case 106 /* WhileKeyword */: + case 57 /* AtToken */: + return false; + case 41 /* SlashToken */: + case 29 /* GreaterThanToken */: + switch (container.kind) { + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: + return false; + } + break; + case 21 /* OpenBracketToken */: + case 22 /* CloseBracketToken */: + if (container.kind !== 176 /* MappedType */) { + return false; + } + break; + } + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation + return nodeStartLine !== line + // if this token is the first token following the list of decorators, we do not need to indent + && !(node.decorators && kind === getFirstNonDecoratorTokenOfNode(node)); + } + function getDelta(child) { // Delta value should be zero when the node explicitly prevents indentation of the child node return formatting.SmartIndenter.nodeWillIndentChild(node, child, /*indentByDefault*/ true) ? delta : 0; } @@ -90418,7 +92108,7 @@ var ts; // context node is set to parent of the token after processing every token var childContextNode = contextNode; // if there are any tokens that logically belong to node and interleave child nodes - // such tokens will be consumed in processChildNode for for the child that follows them + // such tokens will be consumed in processChildNode for the child that follows them ts.forEachChild(node, function (child) { processChildNode(child, /*inheritedIndentation*/ -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, /*isListItem*/ false); }, function (nodes) { @@ -90477,7 +92167,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 148 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 149 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 10 /* JsxText */) { @@ -90485,7 +92175,7 @@ var ts; indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false); } childContextNode = node; - if (isFirstListItem && parent.kind === 178 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 181 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -90640,23 +92330,25 @@ var ts; var trimTrailingWhitespaces; var lineAction = 0 /* None */; if (rule) { - applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); - if (rule.action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { - lineAction = 2 /* LineRemoved */; - // Handle the case where the next line is moved to be the end of this line. - // In this case we don't indent the next line in the next pass. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false); - } - } - else if (rule.action & 4 /* NewLine */ && currentStartLine === previousStartLine) { - lineAction = 1 /* LineAdded */; - // Handle the case where token2 is moved to the new line. - // In this case we indent token2 in the next pass but we set - // sameLineIndent flag to notify the indenter that the indentation is within the line. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true); - } + lineAction = applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + switch (lineAction) { + case 2 /* LineRemoved */: + // Handle the case where the next line is moved to be the end of this line. + // In this case we don't indent the next line in the next pass. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false); + } + break; + case 1 /* LineAdded */: + // Handle the case where token2 is moved to the new line. + // In this case we indent token2 in the next pass but we set + // sameLineIndent flag to notify the indenter that the indentation is within the line. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true); + } + break; + default: + ts.Debug.assert(lineAction === 0 /* None */); } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line trimTrailingWhitespaces = !(rule.action & 8 /* Delete */) && rule.flags !== 1 /* CanDeleteNewLines */; @@ -90790,28 +92482,27 @@ var ts; var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); } - function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; - } function recordDelete(start, len) { if (len) { - edits.push(newTextChange(start, len, "")); + edits.push(ts.createTextChangeFromStartLength(start, len, "")); } } function recordReplace(start, len, newText) { if (len || newText) { - edits.push(newTextChange(start, len, newText)); + edits.push(ts.createTextChangeFromStartLength(start, len, newText)); } } function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { + var onLaterLine = currentStartLine !== previousStartLine; switch (rule.action) { case 1 /* Ignore */: // no action required - return; + return 0 /* None */; case 8 /* Delete */: if (previousRange.end !== currentRange.pos) { // delete characters starting from t1.end up to t2.pos exclusive recordDelete(previousRange.end, currentRange.pos - previousRange.end); + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 4 /* NewLine */: @@ -90819,25 +92510,27 @@ var ts; // if line1 and line2 are on subsequent lines then no edits are required - ok to exit // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; + return 0 /* None */; } // edit should not be applied if we have one line feed between elements var lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.newLineCharacter); + return onLaterLine ? 0 /* None */ : 1 /* LineAdded */; } break; case 2 /* Space */: // exit early if we on different lines and rule cannot change number of newlines if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; + return 0 /* None */; } var posDelta = currentRange.pos - previousRange.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } - break; } + return 0 /* None */; } } var LineAction; @@ -90850,7 +92543,7 @@ var ts; * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. */ function getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine, precedingToken, // tslint:disable-line:no-null-keyword - tokenAtPosition, predicate) { + tokenAtPosition, predicate) { if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); } var tokenStart = tokenAtPosition.getStart(sourceFile); if (tokenStart <= position && position < tokenAtPosition.getEnd()) { @@ -90893,12 +92586,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 191 /* ArrowFunction */: if (node.typeParameters === list) { return 27 /* LessThanToken */; } @@ -90906,8 +92599,8 @@ var ts; return 19 /* OpenParenToken */; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -90915,7 +92608,7 @@ var ts; return 19 /* OpenParenToken */; } break; - case 160 /* TypeReference */: + case 161 /* TypeReference */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -90949,12 +92642,12 @@ var ts; internedTabsIndentation = []; } if (internedTabsIndentation[tabs] === undefined) { - internedTabsIndentation[tabs] = tabString = repeat("\t", tabs); + internedTabsIndentation[tabs] = tabString = ts.repeatString("\t", tabs); } else { tabString = internedTabsIndentation[tabs]; } - return spaces ? tabString + repeat(" ", spaces) : tabString; + return spaces ? tabString + ts.repeatString(" ", spaces) : tabString; } else { var spacesString = void 0; @@ -90964,20 +92657,13 @@ var ts; internedSpacesIndentation = []; } if (internedSpacesIndentation[quotient] === undefined) { - spacesString = repeat(" ", options.indentSize * quotient); + spacesString = ts.repeatString(" ", options.indentSize * quotient); internedSpacesIndentation[quotient] = spacesString; } else { spacesString = internedSpacesIndentation[quotient]; } - return remainder ? spacesString + repeat(" ", remainder) : spacesString; - } - function repeat(value, count) { - var s = ""; - for (var i = 0; i < count; i++) { - s += value; - } - return s; + return remainder ? spacesString + ts.repeatString(" ", remainder) : spacesString; } } formatting.getIndentationString = getIndentationString; @@ -91039,7 +92725,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 195 /* BinaryExpression */) { + if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 198 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -91195,7 +92881,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 269 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 272 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -91243,7 +92929,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 212 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 215 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 82 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -91258,37 +92944,37 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.parent.properties; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return node.parent.elements; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 153 /* Constructor */: - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: { + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 154 /* Constructor */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); - case 183 /* NewExpression */: - case 182 /* CallExpression */: { + case 186 /* NewExpression */: + case 185 /* CallExpression */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } @@ -91297,11 +92983,13 @@ var ts; SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); - return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; - function getActualIndentationFromList(list) { - var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1 /* Unknown */; + if (containingList) { + var index = containingList.indexOf(node); + if (index !== -1) { + return deriveActualIndentationFromList(containingList, index, sourceFile, options); + } } + return -1 /* Unknown */; } function getLineIndentationWhenExpressionIsInMultiLine(node, sourceFile, options) { // actual indentation should not be used when: @@ -91326,10 +93014,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: node = node.expression; break; default: @@ -91393,51 +93081,52 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 211 /* ExpressionStatement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 178 /* ArrayLiteralExpression */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 173 /* MappedType */: - case 166 /* TupleType */: - case 236 /* CaseBlock */: - case 262 /* DefaultClause */: - case 261 /* CaseClause */: - case 186 /* ParenthesizedExpression */: - case 180 /* PropertyAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 209 /* VariableStatement */: - case 227 /* VariableDeclaration */: - case 244 /* ExportAssignment */: - case 220 /* ReturnStatement */: - case 196 /* ConditionalExpression */: - case 176 /* ArrayBindingPattern */: - case 175 /* ObjectBindingPattern */: - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 260 /* JsxExpression */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 147 /* Parameter */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 169 /* ParenthesizedType */: - case 184 /* TaggedTemplateExpression */: - case 192 /* AwaitExpression */: - case 246 /* NamedExports */: - case 242 /* NamedImports */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: + case 214 /* ExpressionStatement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 181 /* ArrayLiteralExpression */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 176 /* MappedType */: + case 167 /* TupleType */: + case 239 /* CaseBlock */: + case 265 /* DefaultClause */: + case 264 /* CaseClause */: + case 189 /* ParenthesizedExpression */: + case 183 /* PropertyAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 212 /* VariableStatement */: + case 230 /* VariableDeclaration */: + case 247 /* ExportAssignment */: + case 223 /* ReturnStatement */: + case 199 /* ConditionalExpression */: + case 179 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: + case 254 /* JsxSelfClosingElement */: + case 263 /* JsxExpression */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 148 /* Parameter */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 172 /* ParenthesizedType */: + case 187 /* TaggedTemplateExpression */: + case 195 /* AwaitExpression */: + case 249 /* NamedExports */: + case 245 /* NamedImports */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: return true; } return false; @@ -91445,27 +93134,29 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return childKind !== 208 /* Block */; - case 245 /* ExportDeclaration */: - return childKind !== 246 /* NamedExports */; - case 239 /* ImportDeclaration */: - return childKind !== 240 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 242 /* NamedImports */); - case 250 /* JsxElement */: - return childKind !== 253 /* JsxClosingElement */; + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return childKind !== 211 /* Block */; + case 248 /* ExportDeclaration */: + return childKind !== 249 /* NamedExports */; + case 242 /* ImportDeclaration */: + return childKind !== 243 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 245 /* NamedImports */); + case 253 /* JsxElement */: + return childKind !== 256 /* JsxClosingElement */; + case 257 /* JsxFragment */: + return childKind !== 259 /* JsxClosingFragment */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -91473,29 +93164,29 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: switch (parent.kind) { - case 208 /* Block */: + case 211 /* Block */: var grandParent = parent.parent; switch (grandParent && grandParent.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // We may want to write inner functions after this. return false; default: return true; } - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: return true; default: throw ts.Debug.fail(); } - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return true; default: return false; @@ -91518,7 +93209,7 @@ var ts; var ts; (function (ts) { var textChanges; - (function (textChanges) { + (function (textChanges_1) { /** * Currently for simplicity we store recovered positions on the node itself. * It can be changed to side-table later if we decide that current design is too invasive. @@ -91545,7 +93236,7 @@ var ts; (function (Position) { Position[Position["FullStart"] = 0] = "FullStart"; Position[Position["Start"] = 1] = "Start"; - })(Position = textChanges.Position || (textChanges.Position = {})); + })(Position = textChanges_1.Position || (textChanges_1.Position = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); } @@ -91561,6 +93252,10 @@ var ts; } return false; } + textChanges_1.useNonAdjustedPositions = { + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; var ChangeKind; (function (ChangeKind) { ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; @@ -91570,10 +93265,10 @@ var ts; function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } - textChanges.getSeparatorCharacter = getSeparatorCharacter; + textChanges_1.getSeparatorCharacter = getSeparatorCharacter; function getAdjustedStartPosition(sourceFile, node, options, position) { if (options.useNonAdjustedStartPosition) { - return node.getFullStart(); + return node.getStart(); } var fullStart = node.getFullStart(); var start = node.getStart(sourceFile); @@ -91600,7 +93295,7 @@ var ts; adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } - textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + textChanges_1.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); @@ -91611,12 +93306,12 @@ var ts; ? newEnd : end; } - textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + textChanges_1.getAdjustedEndPosition = getAdjustedEndPosition; /** * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 179 /* ObjectLiteralExpression */)); + return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 182 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -91626,15 +93321,18 @@ var ts; return s; } var ChangeTracker = /** @class */ (function () { - function ChangeTracker(newLine, formatContext, validator) { - this.newLine = newLine; + /** Public for tests only. Other callers should use `ChangeTracker.with`. */ + function ChangeTracker(newLineCharacter, formatContext, validator) { + this.newLineCharacter = newLineCharacter; this.formatContext = formatContext; this.validator = validator; this.changes = []; - this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + this.deletedNodesInLists = []; // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. + // Map from class id to nodes to insert at the start + this.nodesInsertedAtClassStarts = ts.createMap(); } ChangeTracker.fromContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.formatContext); + return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); }; ChangeTracker.with = function (context, cb) { var tracker = ChangeTracker.fromContext(context); @@ -91649,14 +93347,14 @@ var ts; if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -91673,6 +93371,9 @@ var ts; this.deleteNode(sourceFile, node); return this; } + var id = ts.getNodeId(node); + ts.Debug.assert(!this.deletedNodesInLists[id], "Deleting a node twice"); + this.deletedNodesInLists[id] = true; if (index !== containingList.length - 1) { var nextToken = ts.getTokenAtPosition(sourceFile, node.end, /*includeJsDocComment*/ false); if (nextToken && isSeparator(node, nextToken)) { @@ -91686,84 +93387,138 @@ var ts; } } else { - var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false); - if (previousToken && isSeparator(node, previousToken)) { - this.deleteNodeRange(sourceFile, previousToken, node); + var prev = containingList[index - 1]; + if (this.deletedNodesInLists[ts.getNodeId(prev)]) { + var pos = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + var end = getAdjustedEndPosition(sourceFile, node, {}); + this.deleteRange(sourceFile, { pos: pos, end: end }); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } } } return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; - ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithSingleNode, - sourceFile: sourceFile, - options: options, - node: newNode, - range: { pos: startPosition, end: endPosition } - }); - return this; - }; - ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithMultipleNodes, - sourceFile: sourceFile, - options: options, - nodes: newNodes, - range: { pos: startPosition, end: endPosition } - }); + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { - return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { - if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); + ChangeTracker.prototype.insertNodeAtTopOfFile = function (sourceFile, newNode, blankLineBetween) { + var pos = getInsertionPositionAtSourceFileTop(sourceFile); + this.insertNodeAt(sourceFile, pos, newNode, { + prefix: pos === 0 ? undefined : this.newLineCharacter, + suffix: (ts.isLineBreak(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : ""), + }); }; - ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { - if (options === void 0) { options = {}; } - if ((ts.isStatementButNotDeclaration(after)) || - after.kind === 150 /* PropertyDeclaration */ || - after.kind === 149 /* PropertySignature */ || - after.kind === 151 /* MethodSignature */) { + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { + if (blankLineBetween === void 0) { blankLineBetween = false; } + var pos = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); + return this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); + }; + ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { + var pos = before.getStart(sourceFile); + this.replaceRange(sourceFile, { pos: pos, end: pos }, ts.createToken(modifier), { suffix: " " }); + }; + ChangeTracker.prototype.getOptionsForInsertNodeBefore = function (before, doubleNewlines) { + if (ts.isStatement(before) || ts.isClassElement(before)) { + return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(before)) { + return { suffix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it + }; + ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) { + var firstStatement = ts.firstOrUndefined(ctr.body.statements); + if (!firstStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements)); + } + else { + this.insertNodeBefore(sourceFile, firstStatement, newStatement); + } + }; + ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) { + var lastStatement = ts.lastOrUndefined(ctr.body.statements); + if (!lastStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement])); + } + else { + this.insertNodeAfter(sourceFile, lastStatement, newStatement); + } + }; + ChangeTracker.prototype.replaceConstructorBody = function (sourceFile, ctr, statements) { + this.replaceNode(sourceFile, ctr.body, ts.createBlock(statements, /*multiLine*/ true), { useNonAdjustedEndPosition: true }); + }; + ChangeTracker.prototype.insertNodeAtEndOfScope = function (sourceFile, scope, newNode) { + var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); + this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, { + prefix: ts.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, + suffix: this.newLineCharacter + }); + }; + ChangeTracker.prototype.insertNodeAtClassStart = function (sourceFile, cls, newElement) { + var firstMember = ts.firstOrUndefined(cls.members); + if (!firstMember) { + var id = ts.getNodeId(cls).toString(); + var newMembers = this.nodesInsertedAtClassStarts.get(id); + if (newMembers) { + ts.Debug.assert(newMembers.sourceFile === sourceFile && newMembers.cls === cls); + newMembers.members.push(newElement); + } + else { + this.nodesInsertedAtClassStarts.set(id, { sourceFile: sourceFile, cls: cls, members: [newElement] }); + } + } + else { + this.insertNodeBefore(sourceFile, firstMember, newElement); + } + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) { + if (ts.isStatementButNotDeclaration(after) || + after.kind === 151 /* PropertyDeclaration */ || + after.kind === 150 /* PropertySignature */ || + after.kind === 152 /* MethodSignature */) { // check if previous statement ends with semicolon // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { @@ -91776,8 +93531,20 @@ var ts; }); } } - var endPosition = getAdjustedEndPosition(sourceFile, after, options); - return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); + var endPosition = getAdjustedEndPosition(sourceFile, after, {}); + return this.replaceRange(sourceFile, { pos: endPosition, end: endPosition }, newNode, this.getInsertNodeAfterOptions(after)); + }; + ChangeTracker.prototype.getInsertNodeAfterOptions = function (node) { + if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) { + return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; + } + else if (ts.isStatement(node) || ts.isClassElement(node) || ts.isTypeElement(node)) { + return { suffix: this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(node)) { + return { prefix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it }; /** * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, @@ -91918,36 +93685,26 @@ var ts; } return this; }; + ChangeTracker.prototype.finishInsertNodeAtClassStart = function () { + var _this = this; + this.nodesInsertedAtClassStarts.forEach(function (_a) { + var sourceFile = _a.sourceFile, cls = _a.cls, members = _a.members; + var newCls = cls.kind === 233 /* ClassDeclaration */ + ? ts.updateClassDeclaration(cls, cls.decorators, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members) + : ts.updateClassExpression(cls, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members); + _this.replaceNode(sourceFile, cls, newCls, { useNonAdjustedEndPosition: true }); + }); + }; ChangeTracker.prototype.getChanges = function () { var _this = this; - var changesPerFile = ts.createMap(); - // group changes per file - for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { - var c = _a[_i]; - var changesInFile = changesPerFile.get(c.sourceFile.path); - if (!changesInFile) { - changesPerFile.set(c.sourceFile.path, changesInFile = []); - } - changesInFile.push(c); - } - // convert changes - var fileChangesList = []; - changesPerFile.forEach(function (changesInFile) { + this.finishInsertNodeAtClassStart(); + return ts.group(this.changes, function (c) { return c.sourceFile.path; }).map(function (changesInFile) { var sourceFile = changesInFile[0].sourceFile; - var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; - for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { - var c = _a[_i]; - fileTextChanges.textChanges.push({ - span: _this.computeSpan(c, sourceFile), - newText: _this.computeNewText(c, sourceFile) - }); - } - fileChangesList.push(fileTextChanges); + var textChanges = ChangeTracker.normalize(changesInFile).map(function (c) { + return ts.createTextChange(ts.createTextSpanFromRange(c.range), _this.computeNewText(c, sourceFile)); + }); + return { fileName: sourceFile.fileName, textChanges: textChanges }; }); - return fileChangesList; - }; - ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { - return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { var _this = this; @@ -91960,8 +93717,14 @@ var ts; var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); - text = parts.join(change.options.nodeSeparator); + var lastIndex_1 = change.nodes.length - 1; + var parts = change.nodes.map(function (n, index) { + var formatted = _this.getFormattedTextOfNode(n, sourceFile, pos, options); + return index === lastIndex_1 || ts.endsWith(formatted, _this.newLineCharacter) + ? formatted + : (formatted + _this.newLineCharacter); + }); + text = parts.join(""); } else { ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); @@ -91972,7 +93735,7 @@ var ts; return (options.prefix || "") + text + (options.suffix || ""); }; ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { - var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); + var nonformattedText = getNonformattedText(node, sourceFile, this.newLineCharacter); if (this.validator) { this.validator(nonformattedText); } @@ -92001,11 +93764,10 @@ var ts; }; return ChangeTracker; }()); - textChanges.ChangeTracker = ChangeTracker; + textChanges_1.ChangeTracker = ChangeTracker; function getNonformattedText(node, sourceFile, newLine) { - var options = { newLine: newLine, target: sourceFile && sourceFile.languageVersion }; - var writer = new Writer(ts.getNewLineCharacter(options)); - var printer = ts.createPrinter(options, writer); + var writer = new Writer(newLine); + var printer = ts.createPrinter({ newLine: newLine === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */ }, writer); printer.writeNode(4 /* Unspecified */, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } @@ -92026,7 +93788,7 @@ var ts; } return text; } - textChanges.applyChanges = applyChanges; + textChanges_1.applyChanges = applyChanges; function isTrivia(s) { return ts.skipTrivia(s, 0) === s.length; } @@ -92099,6 +93861,38 @@ var ts; this.writer.write(s); this.setLastNonTriviaPosition(s, /*force*/ false); }; + Writer.prototype.writeKeyword = function (s) { + this.writer.writeKeyword(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeOperator = function (s) { + this.writer.writeOperator(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writePunctuation = function (s) { + this.writer.writePunctuation(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeParameter = function (s) { + this.writer.writeParameter(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeProperty = function (s) { + this.writer.writeProperty(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeSpace = function (s) { + this.writer.writeSpace(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeStringLiteral = function (s) { + this.writer.writeStringLiteral(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeSymbol = function (s, sym) { + this.writer.writeSymbol(s, sym); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; Writer.prototype.writeTextOfNode = function (text, node) { this.writer.writeTextOfNode(text, node); }; @@ -92137,12 +93931,53 @@ var ts; Writer.prototype.isAtStartOfLine = function () { return this.writer.isAtStartOfLine(); }; - Writer.prototype.reset = function () { - this.writer.reset(); + Writer.prototype.clear = function () { + this.writer.clear(); this.lastNonTriviaPosition = 0; }; return Writer; }()); + function getInsertionPositionAtSourceFileTop(_a) { + var text = _a.text; + var shebang = ts.getShebang(text); + var position = 0; + if (shebang !== undefined) { + position = shebang.length; + advancePastLineBreak(); + } + // For a source file, it is possible there are detached comments we should not skip + var ranges = ts.getLeadingCommentRanges(text, position); + if (!ranges) + return position; + // However we should still skip a pinned comment at the top + if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end; + advancePastLineBreak(); + ranges = ranges.slice(1); + } + // As well as any triple slash references + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { + position = range.end; + advancePastLineBreak(); + continue; + } + break; + } + return position; + function advancePastLineBreak() { + if (position < text.length) { + var charCode = text.charCodeAt(position); + if (ts.isLineBreak(charCode)) { + position++; + if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) { + position++; + } + } + } + } + } })(textChanges = ts.textChanges || (ts.textChanges = {})); })(ts || (ts = {})); /* @internal */ @@ -92150,24 +93985,33 @@ var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = []; - function registerCodeFix(codeFix) { - ts.forEach(codeFix.errorCodes, function (error) { - var fixes = codeFixes[error]; - if (!fixes) { - fixes = []; - codeFixes[error] = fixes; + var codeFixRegistrations = []; + var fixIdToRegistration = ts.createMap(); + function registerCodeFix(reg) { + for (var _i = 0, _a = reg.errorCodes; _i < _a.length; _i++) { + var error = _a[_i]; + var registrations = codeFixRegistrations[error]; + if (!registrations) { + registrations = []; + codeFixRegistrations[error] = registrations; } - fixes.push(codeFix); - }); + registrations.push(reg); + } + if (reg.fixIds) { + for (var _b = 0, _c = reg.fixIds; _b < _c.length; _b++) { + var fixId = _c[_b]; + ts.Debug.assert(!fixIdToRegistration.has(fixId)); + fixIdToRegistration.set(fixId, reg); + } + } } codefix.registerCodeFix = registerCodeFix; function getSupportedErrorCodes() { - return Object.keys(codeFixes); + return Object.keys(codeFixRegistrations); } codefix.getSupportedErrorCodes = getSupportedErrorCodes; function getFixes(context) { - var fixes = codeFixes[context.errorCode]; + var fixes = codeFixRegistrations[context.errorCode]; var allActions = []; ts.forEach(fixes, function (f) { var actions = f.getCodeActions(context); @@ -92186,6 +94030,42 @@ var ts; return allActions; } codefix.getFixes = getFixes; + function getAllFixes(context) { + // Currently fixId is always a string. + return fixIdToRegistration.get(ts.cast(context.fixId, ts.isString)).getAllCodeActions(context); + } + codefix.getAllFixes = getAllFixes; + function createCombinedCodeActions(changes, commands) { + return { changes: changes, commands: commands }; + } + function createFileTextChanges(fileName, textChanges) { + return { fileName: fileName, textChanges: textChanges }; + } + codefix.createFileTextChanges = createFileTextChanges; + function codeFixAll(context, errorCodes, use) { + var commands = []; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return eachDiagnostic(context, errorCodes, function (diag) { return use(t, diag, commands); }); + }); + return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands); + } + codefix.codeFixAll = codeFixAll; + function codeFixAllWithTextChanges(context, errorCodes, use) { + var changes = []; + eachDiagnostic(context, errorCodes, function (diag) { return use(changes, diag); }); + changes.sort(function (a, b) { return b.span.start - a.span.start; }); + return createCombinedCodeActions([createFileTextChanges(context.sourceFile.fileName, changes)]); + } + codefix.codeFixAllWithTextChanges = codeFixAllWithTextChanges; + function eachDiagnostic(_a, errorCodes, cb) { + var program = _a.program, sourceFile = _a.sourceFile; + for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile); _i < _b.length; _i++) { + var diag = _b[_i]; + if (ts.contains(errorCodes, diag.code)) { + cb(diag); + } + } + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92196,14 +94076,15 @@ var ts; // A map with the refactor code as key, the refactor itself as value // e.g. nonSuggestableRefactors[refactorCode] -> the refactor you want var refactors = ts.createMap(); - function registerRefactor(refactor) { - refactors.set(refactor.name, refactor); + /** @param name An unique code associated with each refactor. Does not have to be human-readable. */ + function registerRefactor(name, refactor) { + refactors.set(name, refactor); } refactor_1.registerRefactor = registerRefactor; function getApplicableRefactors(context) { - return ts.flatMapIter(refactors.values(), function (refactor) { + return ts.arrayFrom(ts.flatMapIterator(refactors.values(), function (refactor) { return context.cancellationToken && context.cancellationToken.isCancellationRequested() ? undefined : refactor.getAvailableActions(context); - }); + })); } refactor_1.getApplicableRefactors = getApplicableRefactors; function getEditsForRefactor(context, refactorName, actionName) { @@ -92222,22 +94103,24 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "addMissingInvocationForDecorator"; + var errorCodes = [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - var decorator = ts.getAncestor(token, 148 /* Decorator */); - ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); - var replacement = ts.createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, decorator.expression, replacement); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), - changes: changeTracker.getChanges() - }]; - } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); }, }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var decorator = ts.findAncestor(token, ts.isDecorator); + ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); + var replacement = ts.createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined); + changeTracker.replaceNode(sourceFile, decorator.expression, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92245,27 +94128,36 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "correctQualifiedNameToIndexedAccessType"; + var errorCodes = [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - var qualifiedName = ts.getAncestor(token, 144 /* QualifiedName */); - ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); - if (!ts.isIdentifier(qualifiedName.left)) { + var qualifiedName = getQualifiedName(context.sourceFile, context.span.start); + if (!qualifiedName) return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]"]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var q = getQualifiedName(diag.file, diag.start); + if (q) { + doChange(changes, diag.file, q); } - var leftText = qualifiedName.left.getText(sourceFile); - var rightText = qualifiedName.right.getText(sourceFile); - var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, qualifiedName, replacement); - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [leftText + "[\"" + rightText + "\"]"]), - changes: changeTracker.getChanges() - }]; - } + }); }, }); + function getQualifiedName(sourceFile, pos) { + var qualifiedName = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ true), ts.isQualifiedName); + ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); + return ts.isIdentifier(qualifiedName.left) ? qualifiedName : undefined; + } + function doChange(changeTracker, sourceFile, qualifiedName) { + var rightText = qualifiedName.right.text; + var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); + changeTracker.replaceNode(sourceFile, qualifiedName, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92273,55 +94165,61 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code, + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code]; + var fixId = "fixClassIncorrectlyImplementsInterface"; // TODO: share a group with fixClassDoesntImplementInheritedAbstractMember? codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], - getCodeActions: getActionForClassLikeIncorrectImplementsInterface + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var classDeclaration = getClass(sourceFile, span.start); + var checker = program.getTypeChecker(); + return ts.mapDefined(ts.getClassImplementsHeritageClauseElements(classDeclaration), function (implementedTypeNode) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t); }); + if (changes.length === 0) + return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + return { description: description, changes: changes, fixId: fixId }; + }); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenClassDeclarations = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { + for (var _i = 0, _a = ts.getClassImplementsHeritageClauseElements(classDeclaration); _i < _a.length; _i++) { + var implementedTypeNode = _a[_i]; + addMissingDeclarations(context.program.getTypeChecker(), implementedTypeNode, diag.file, classDeclaration, changes); + } + } + }); + }, }); - function getActionForClassLikeIncorrectImplementsInterface(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - var classDeclaration = ts.getContainingClass(token); - if (!classDeclaration) { - return undefined; - } - var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + function getClass(sourceFile, pos) { + var classDeclaration = ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false)); + ts.Debug.assert(!!classDeclaration); + return classDeclaration; + } + function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker) { + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); var classType = checker.getTypeAtLocation(classDeclaration); - var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); - var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1 /* Number */); - var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0 /* String */); - var result = []; - for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { - var implementedTypeNode = implementedTypeNodes_2[_i]; - // Note that this is ultimately derived from a map indexed by symbol names, - // so duplicates cannot occur. - var implementedType = checker.getTypeAtLocation(implementedTypeNode); - var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); - var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); - var newNodes = []; - createAndAddMissingIndexSignatureDeclaration(implementedType, 1 /* Number */, hasNumericIndexSignature, newNodes); - createAndAddMissingIndexSignatureDeclaration(implementedType, 0 /* String */, hasStringIndexSignature, newNodes); - newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); - var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); - if (newNodes.length > 0) { - pushAction(result, newNodes, message); - } + if (!checker.getIndexTypeOfType(classType, 1 /* Number */)) { + createMissingIndexSignatureDeclaration(implementedType, 1 /* Number */); } - return result; - function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { - if (hasIndexSigOfKind) { - return; - } + if (!checker.getIndexTypeOfType(classType, 0 /* String */)) { + createMissingIndexSignatureDeclaration(implementedType, 0 /* String */); + } + codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + function createMissingIndexSignatureDeclaration(type, kind) { var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); - if (!indexInfoOfKind) { - return; + if (indexInfoOfKind) { + changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration)); } - var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); - newNodes.push(newIndexSignatureDeclaration); - } - function pushAction(result, newNodes, description) { - result.push({ description: description, changes: codefix.newNodesToChanges(newNodes, openBrace, context) }); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -92331,157 +94229,175 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ]; + var fixId = "addMissingMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, - ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code], - getCodeActions: getActionsForAddMissingMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var info = getInfo(context.sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + var methodCodeAction = call && getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + var addMember = inJs ? + ts.singleElementArray(getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, token.text, makeStatic)) : + getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic); + return ts.concatenate(ts.singleElementArray(methodCodeAction), addMember); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenNames = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var program = context.program; + var info = getInfo(diag.file, diag.start, program.getTypeChecker()); + if (!info) + return; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + if (!ts.addToSeen(seenNames, token.text)) { + return; + } + // Always prefer to add a method declaration if possible. + if (call) { + addMethodDeclaration(changes, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + } + else { + if (inJs) { + addMissingMemberInJs(changes, classDeclarationSourceFile, classDeclaration, token.text, makeStatic); + } + else { + var typeNode = getTypeNode(program.getTypeChecker(), classDeclaration, token); + addPropertyDeclaration(changes, classDeclarationSourceFile, classDeclaration, token.text, typeNode, makeStatic); + } + } + }); + }, }); - function getActionsForAddMissingMember(context) { - var tokenSourceFile = context.sourceFile; - var start = context.span.start; + function getInfo(tokenSourceFile, tokenPos, checker) { // The identifier of the missing property. eg: // this.missing = 1; // ^^^^^^^ - var token = ts.getTokenAtPosition(tokenSourceFile, start, /*includeJsDocComment*/ false); - if (token.kind !== 71 /* Identifier */) { + var token = ts.getTokenAtPosition(tokenSourceFile, tokenPos, /*includeJsDocComment*/ false); + if (!ts.isIdentifier(token)) { return undefined; } - if (!ts.isPropertyAccessExpression(token.parent)) { + var classAndMakeStatic = getClassAndMakeStatic(token, checker); + if (!classAndMakeStatic) { return undefined; } - var tokenName = token.getText(tokenSourceFile); - var makeStatic = false; - var classDeclaration; - if (token.parent.expression.kind === 99 /* ThisKeyword */) { + var classDeclaration = classAndMakeStatic.classDeclaration, makeStatic = classAndMakeStatic.makeStatic; + var classDeclarationSourceFile = classDeclaration.getSourceFile(); + var inJs = ts.isInJavaScriptFile(classDeclarationSourceFile); + var call = ts.tryCast(token.parent.parent, ts.isCallExpression); + return { token: token, classDeclaration: classDeclaration, makeStatic: makeStatic, classDeclarationSourceFile: classDeclarationSourceFile, inJs: inJs, call: call }; + } + function getClassAndMakeStatic(token, checker) { + var parent = token.parent; + if (!ts.isPropertyAccessExpression(parent)) { + return undefined; + } + if (parent.expression.kind === 99 /* ThisKeyword */) { var containingClassMemberDeclaration = ts.getThisContainer(token, /*includeArrowFunctions*/ false); if (!ts.isClassElement(containingClassMemberDeclaration)) { return undefined; } - classDeclaration = containingClassMemberDeclaration.parent; + var classDeclaration = containingClassMemberDeclaration.parent; // Property accesses on `this` in a static method are accesses of a static member. - makeStatic = classDeclaration && ts.hasModifier(containingClassMemberDeclaration, 32 /* Static */); + return ts.isClassLike(classDeclaration) ? { classDeclaration: classDeclaration, makeStatic: ts.hasModifier(containingClassMemberDeclaration, 32 /* Static */) } : undefined; } else { - var checker = context.program.getTypeChecker(); - var leftExpression = token.parent.expression; - var leftExpressionType = checker.getTypeAtLocation(leftExpression); - if (leftExpressionType.flags & 65536 /* Object */) { - var symbol = leftExpressionType.symbol; - if (symbol.flags & 32 /* Class */) { - classDeclaration = symbol.declarations && symbol.declarations[0]; - if (leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol)) { - // The expression is a class symbol but the type is not the instance-side. - makeStatic = true; - } - } + var leftExpressionType = checker.getTypeAtLocation(parent.expression); + var symbol = leftExpressionType.symbol; + if (!(symbol && leftExpressionType.flags & 65536 /* Object */ && symbol.flags & 32 /* Class */)) { + return undefined; } + var classDeclaration = ts.cast(ts.first(symbol.declarations), ts.isClassLike); + // The expression is a class symbol but the type is not the instance-side. + return { classDeclaration: classDeclaration, makeStatic: leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol) }; } - if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + } + function getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingMemberInJs(t, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic); }); + if (changes.length === 0) return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Initialize_static_property_0 : ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]); + return { description: description, changes: changes, fixId: fixId }; + } + function addMissingMemberInJs(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + if (makeStatic) { + if (classDeclaration.kind === 203 /* ClassExpression */) { + return; + } + var className = classDeclaration.name.getText(); + var staticInitialization = initializePropertyToUndefined(ts.createIdentifier(className), tokenName); + changeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization); } - var classDeclarationSourceFile = ts.getSourceFileOfNode(classDeclaration); - var classOpenBrace = ts.getOpenBraceOfClassLike(classDeclaration, classDeclarationSourceFile); - return ts.isInJavaScriptFile(classDeclarationSourceFile) ? - getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) : - getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic); - function getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ false); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - if (makeStatic) { - if (classDeclaration.kind === 200 /* ClassExpression */) { - return actions; - } - var className = classDeclaration.name.getText(); - var staticInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier(className), tokenName), ts.createIdentifier("undefined"))); - var staticInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - staticInitializationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); - var initializeStaticAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [tokenName]), - changes: staticInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeStaticAction); - return actions; - } - else { - var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); - if (!classConstructor) { - return actions; - } - var propertyInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), tokenName), ts.createIdentifier("undefined"))); - var propertyInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyInitializationChangeTracker.insertNodeBefore(classDeclarationSourceFile, classConstructor.body.getLastToken(), propertyInitialization, { suffix: context.newLineCharacter }); - var initializeAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]), - changes: propertyInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeAction); - return actions; + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return; } + var propertyInitialization = initializePropertyToUndefined(ts.createThis(), tokenName); + changeTracker.insertNodeAtConstructorEnd(classDeclarationSourceFile, classConstructor, propertyInitialization); } - function getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ true); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - var typeNode; - if (token.parent.parent.kind === 195 /* BinaryExpression */) { - var binaryExpression = token.parent.parent; - var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; - var checker = context.program.getTypeChecker(); - var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); - typeNode = checker.typeToTypeNode(widenedType, classDeclaration); - } - typeNode = typeNode || ts.createKeywordTypeNode(119 /* AnyKeyword */); - var property = ts.createProperty( - /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, tokenName, - /*questionToken*/ undefined, typeNode, - /*initializer*/ undefined); - var propertyChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, property, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0; - actions = ts.append(actions, { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: propertyChangeTracker.getChanges() - }); - if (!makeStatic) { - // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(136 /* StringKeyword */); - var indexingParameter = ts.createParameter( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, "x", - /*questionToken*/ undefined, stringTypeNode, - /*initializer*/ undefined); - var indexSignature = ts.createIndexSignature( - /*decorators*/ undefined, - /*modifiers*/ undefined, [indexingParameter], typeNode); - var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - indexSignatureChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, indexSignature, { suffix: context.newLineCharacter }); - actions.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), - changes: indexSignatureChangeTracker.getChanges() - }); - } - return actions; - } - function getActionForMethodDeclaration(includeTypeScriptSyntax) { - if (token.parent.parent.kind === 182 /* CallExpression */) { - var callExpression = token.parent.parent; - var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, tokenName, includeTypeScriptSyntax, makeStatic); - var methodDeclarationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - methodDeclarationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, methodDeclaration, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0; - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: methodDeclarationChangeTracker.getChanges() - }; - } + } + function initializePropertyToUndefined(obj, propertyName) { + return ts.createStatement(ts.createAssignment(ts.createPropertyAccess(obj, propertyName), ts.createIdentifier("undefined"))); + } + function getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic) { + var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); + var addProp = createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, token.text, typeNode); + return makeStatic ? [addProp] : [addProp, createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, token.text, typeNode)]; + } + function getTypeNode(checker, classDeclaration, token) { + var typeNode; + if (token.parent.parent.kind === 198 /* BinaryExpression */) { + var binaryExpression = token.parent.parent; + var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); } + return typeNode || ts.createKeywordTypeNode(119 /* AnyKeyword */); + } + function createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0), [tokenName]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addPropertyDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + var property = ts.createProperty( + /*decorators*/ undefined, + /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, tokenName, + /*questionToken*/ undefined, typeNode, + /*initializer*/ undefined); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, property); + } + function createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, tokenName, typeNode) { + // Index signatures cannot have the static modifier. + var stringTypeNode = ts.createKeywordTypeNode(137 /* StringKeyword */); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, "x", + /*questionToken*/ undefined, stringTypeNode, + /*initializer*/ undefined); + var indexSignature = ts.createIndexSignature( + /*decorators*/ undefined, + /*modifiers*/ undefined, [indexingParameter], typeNode); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, indexSignature); }); + // No fixId here because code-fix-all currently only works on adding individual named properties. + return { description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), changes: changes, fixId: undefined }; + } + function getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0), [token.text]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addMethodDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, token.text, inJs, makeStatic); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, methodDeclaration); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -92490,18 +94406,35 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixSpelling"; + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + ]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, - ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code], - getCodeActions: getActionsForCorrectSpelling + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var node = info.node, suggestion = info.suggestion; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, node, suggestion); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, context.program.getTypeChecker()); + if (info) + doChange(changes, context.sourceFile, info.node, info.suggestion); + }); }, }); - function getActionsForCorrectSpelling(context) { - var sourceFile = context.sourceFile; + function getInfo(sourceFile, pos, checker) { // This is the identifier of the misspelled word. eg: // this.speling = 1; // ^^^^^^^ - var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); // TODO: GH#15852 - var checker = context.program.getTypeChecker(); + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); // TODO: GH#15852 var suggestion; if (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) { ts.Debug.assert(node.kind === 71 /* Identifier */); @@ -92514,18 +94447,10 @@ var ts; ts.Debug.assert(name !== undefined, "name should be defined"); suggestion = checker.getSuggestionForNonexistentSymbol(node, name, convertSemanticMeaningToSymbolFlags(meaning)); } - if (suggestion) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: node.getStart(), length: node.getWidth() }, - newText: suggestion - }], - }], - }]; - } + return suggestion === undefined ? undefined : { node: node, suggestion: suggestion }; + } + function doChange(changes, sourceFile, node, suggestion) { + changes.replaceNode(sourceFile, node, ts.createIdentifier(suggestion)); } function convertSemanticMeaningToSymbolFlags(meaning) { var flags = 0; @@ -92547,31 +94472,39 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixCannotFindModule"; + var errorCodes = [ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code]; codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, - ], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile, start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - if (!ts.isStringLiteral(token)) { - throw ts.Debug.fail(); // These errors should only happen on the module name. - } - var action = tryGetCodeActionForInstallPackageTypes(context.host, sourceFile.fileName, token.text); - return action && [action]; + var codeAction = tryGetCodeActionForInstallPackageTypes(context.host, context.sourceFile.fileName, getModuleName(context.sourceFile, context.span.start)); + return codeAction && [__assign({ fixId: fixId }, codeAction)]; }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (_, diag, commands) { + var pkg = getTypesPackageNameToInstall(context.host, getModuleName(diag.file, diag.start)); + if (pkg) { + commands.push(getCommand(diag.file.fileName, pkg)); + } + }); }, }); - function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + function getModuleName(sourceFile, pos) { + return ts.cast(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), ts.isStringLiteral).text; + } + function getCommand(fileName, packageName) { + return { type: "install package", file: fileName, packageName: packageName }; + } + function getTypesPackageNameToInstall(host, moduleName) { var packageName = ts.getPackageName(moduleName).packageName; - if (!host.isKnownTypesPackageName(packageName)) { - // If !registry, registry not available yet, can't do anything. - return undefined; - } - var typesPackageName = ts.getTypesPackageName(packageName); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [typesPackageName]), + // If !registry, registry not available yet, can't do anything. + return host.isKnownTypesPackageName(packageName) ? ts.getTypesPackageName(packageName) : undefined; + } + function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + var packageName = getTypesPackageNameToInstall(host, moduleName); + return packageName === undefined ? undefined : { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [packageName]), changes: [], - commands: [{ type: "install package", file: fileName, packageName: typesPackageName }], + commands: [getCommand(fileName, packageName)], }; } codefix.tryGetCodeActionForInstallPackageTypes = tryGetCodeActionForInstallPackageTypes; @@ -92582,44 +94515,45 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code, + ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code, + ]; + var fixId = "fixClassDoesntImplementInheritedAbstractMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], - getCodeActions: getActionForClassLikeMissingAbstractMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t); + }); + return changes.length === 0 ? undefined : [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + addMissingMembers(getClass(diag.file, diag.start), context.sourceFile, context.program.getTypeChecker(), changes); + }); }, }); - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], - getCodeActions: getActionForClassLikeMissingAbstractMember - }); - function getActionForClassLikeMissingAbstractMember(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; + function getClass(sourceFile, pos) { // This is the identifier in the case of a class declaration // or the class keyword token in the case of a class expression. - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - if (ts.isClassLike(token.parent)) { - var classDeclaration = token.parent; - var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); - var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); - // Note that this is ultimately derived from a map indexed by symbol names, - // so duplicates cannot occur. - var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); - var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); - var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); - var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); - if (changes && changes.length > 0) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), - changes: changes - }]; - } - } - return undefined; + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var classDeclaration = token.parent; + ts.Debug.assert(ts.isClassLike(classDeclaration)); + return classDeclaration; + } + function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker) { + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); + codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); } function symbolPointsToNonPrivateAndAbstractMember(symbol) { - var decls = symbol.getDeclarations(); - ts.Debug.assert(!!(decls && decls.length > 0)); - var flags = ts.getModifierFlags(decls[0]); + // See `codeFixClassExtendAbstractProtectedProperty.ts` in https://github.com/Microsoft/TypeScript/pull/11547/files + // (now named `codeFixClassExtendAbstractPrivateProperty.ts`) + var flags = ts.getModifierFlags(ts.first(symbol.getDeclarations())); return !(flags & 8 /* Private */) && !!(flags & 128 /* Abstract */); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -92629,48 +94563,55 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "classSuperMustPrecedeThisAccess"; + var errorCodes = [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], + errorCodes: errorCodes, getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var constructor = nodes.constructor, superCall = nodes.superCall; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, constructor, superCall); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 99 /* ThisKeyword */) { - return undefined; - } - var constructor = ts.getContainingFunction(token); - var superCall = findSuperCall(constructor.body); - if (!superCall) { - return undefined; - } - // figure out if the `this` access is actually inside the supercall - // i.e. super(this.a), since in that case we won't suggest a fix - if (superCall.expression && superCall.expression.kind === 182 /* CallExpression */) { - var expressionArguments = superCall.expression.arguments; - for (var _i = 0, expressionArguments_1 = expressionArguments; _i < expressionArguments_1.length; _i++) { - var arg = expressionArguments_1[_i]; - if (arg.expression === token) { - return undefined; - } + var seenClasses = ts.createMap(); // Ensure we only do this once per class. + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + var constructor = nodes.constructor, superCall = nodes.superCall; + if (ts.addToSeen(seenClasses, ts.getNodeId(constructor.parent))) { + doChange(changes, sourceFile, constructor, superCall); } - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); - changeTracker.deleteNode(sourceFile, superCall); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changeTracker.getChanges() - }]; - function findSuperCall(n) { - if (n.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { - return n; - } - if (ts.isFunctionLike(n)) { - return undefined; - } - return ts.forEachChild(n, findSuperCall); - } - } + }); + }, }); + function doChange(changes, sourceFile, constructor, superCall) { + changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); + changes.deleteNode(sourceFile, superCall); + } + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + if (token.kind !== 99 /* ThisKeyword */) + return undefined; + var constructor = ts.getContainingFunction(token); + var superCall = findSuperCall(constructor.body); + // figure out if the `this` access is actually inside the supercall + // i.e. super(this.a), since in that case we won't suggest a fix + return superCall && !superCall.expression.arguments.some(function (arg) { return ts.isPropertyAccessExpression(arg) && arg.expression === token; }) ? { constructor: constructor, superCall: superCall } : undefined; + } + function findSuperCall(n) { + return ts.isExpressionStatement(n) && ts.isSuperCall(n.expression) + ? n + : ts.isFunctionLike(n) + ? undefined + : ts.forEachChild(n, findSuperCall); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92678,23 +94619,30 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "constructorForDerivedNeedSuperCall"; + var errorCodes = [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 123 /* ConstructorKeyword */) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: changeTracker.getChanges() - }]; - } + var sourceFile = context.sourceFile, span = context.span; + var ctr = getNode(sourceFile, span.start); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, ctr); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + return doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, }); + function getNode(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + ts.Debug.assert(token.kind === 123 /* ConstructorKeyword */); + return token.parent; + } + function doChange(changes, sourceFile, ctr) { + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); + changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92702,247 +94650,314 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "extendsInterfaceBecomesImplements"; + var errorCodes = [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + errorCodes: errorCodes, getCodeActions: function (context) { var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var classDeclNode = ts.getContainingClass(token); - if (!(token.kind === 71 /* Identifier */ && ts.isClassLike(classDeclNode))) { + var nodes = getNodes(sourceFile, context.span.start); + if (!nodes) + return undefined; + var extendsToken = nodes.extendsToken, heritageClauses = nodes.heritageClauses; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChanges(t, sourceFile, extendsToken, heritageClauses); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (nodes) + doChanges(changes, diag.file, nodes.extendsToken, nodes.heritageClauses); + }); }, + }); + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var heritageClauses = ts.getContainingClass(token).heritageClauses; + var extendsToken = heritageClauses[0].getFirstToken(); + return extendsToken.kind === 85 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; + } + function doChanges(changes, sourceFile, extendsToken, heritageClauses) { + changes.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */), ts.textChanges.useNonAdjustedPositions); + // If there is already an implements clause, replace the implements keyword with a comma. + if (heritageClauses.length === 2 && + heritageClauses[0].token === 85 /* ExtendsKeyword */ && + heritageClauses[1].token === 108 /* ImplementsKeyword */) { + var implementsToken = heritageClauses[1].getFirstToken(); + var implementsFullStart = implementsToken.getFullStart(); + changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, ts.createToken(26 /* CommaToken */)); + // Rough heuristic: delete trailing whitespace after keyword so that it's not excessive. + // (Trailing because leading might be indentation, which is more sensitive.) + var text = sourceFile.text; + var end = implementsToken.end; + while (end < text.length && ts.isWhiteSpaceSingleLine(text.charCodeAt(end))) { + end++; + } + changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end: end }); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "forgottenThisPropertyAccess"; + var errorCodes = [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getNode(sourceFile, context.span.start); + if (!token) { return undefined; } - var heritageClauses = classDeclNode.heritageClauses; - if (!(heritageClauses && heritageClauses.length > 0)) { - return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, token); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, + }); + function getNode(sourceFile, pos) { + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return ts.isIdentifier(node) ? node : undefined; + } + function doChange(changes, sourceFile, token) { + if (!token) { + return; + } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper + ts.suppressLeadingAndTrailingTrivia(token); + changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token), ts.textChanges.useNonAdjustedPositions); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixIdPrefix = "unusedIdentifier_prefix"; + var fixIdDelete = "unusedIdentifier_delete"; + var errorCodes = [ + ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, + ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getToken(sourceFile, context.span.start); + var result = []; + var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token); }); + if (deletion.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), [token.getText()]); + result.push({ description: description, changes: deletion, fixId: fixIdDelete }); } - var extendsToken = heritageClauses[0].getFirstToken(); - if (!(extendsToken && extendsToken.kind === 85 /* ExtendsKeyword */)) { - return undefined; + var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, context.errorCode, sourceFile, token); }); + if (prefix.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), [token.getText()]); + result.push({ description: description, changes: prefix, fixId: fixIdPrefix }); } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */)); - // We replace existing keywords with commas. - for (var i = 1; i < heritageClauses.length; i++) { - var keywordToken = heritageClauses[i].getFirstToken(); - if (keywordToken) { - changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(26 /* CommaToken */)); - } - } - var result = [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), - changes: changeTracker.getChanges() - }]; return result; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], - getCodeActions: function (context) { + }, + fixIds: [fixIdPrefix, fixIdDelete], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 71 /* Identifier */) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), - changes: changeTracker.getChanges() - }]; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, - ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - // this handles var ["computed"] = 12; - if (token.kind === 21 /* OpenBracketToken */) { - token = ts.getTokenAtPosition(sourceFile, start + 1, /*includeJsDocComment*/ false); - } - switch (token.kind) { - case 71 /* Identifier */: - return deleteIdentifierOrPrefixWithUnderscore(token, context.errorCode); - case 150 /* PropertyDeclaration */: - case 241 /* NamespaceImport */: - return [deleteNode(token.parent)]; - default: - return deleteDefault(); - } - function deleteDefault() { - if (ts.isDeclarationName(token)) { - return [deleteNode(token.parent)]; - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return [deleteNode(token.parent.parent)]; - } - else { - return undefined; - } - } - function prefixIdentifierWithUnderscore(identifier) { - var startPosition = identifier.getStart(sourceFile, /*includeJsDocComment*/ false); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), { 0: token.getText() }), - changes: [{ - fileName: sourceFile.path, - textChanges: [{ - span: { start: startPosition, length: 0 }, - newText: "_" - }] - }] - }; - } - function deleteIdentifierOrPrefixWithUnderscore(identifier, errorCode) { - var parent = identifier.parent; - switch (parent.kind) { - case 227 /* VariableDeclaration */: - return deleteVariableDeclarationOrPrefixWithUnderscore(identifier, parent); - case 146 /* TypeParameter */: - var typeParameters = parent.parent.typeParameters; - if (typeParameters.length === 1) { - var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); - var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false); - ts.Debug.assert(previousToken.kind === 27 /* LessThanToken */); - ts.Debug.assert(nextToken.kind === 29 /* GreaterThanToken */); - return [deleteNodeRange(previousToken, nextToken)]; - } - else { - return [deleteNodeInList(parent)]; - } - case 147 /* Parameter */: - var functionDeclaration = parent.parent; - var deleteAction = functionDeclaration.parameters.length === 1 ? deleteNode(parent) : deleteNodeInList(parent); - return errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ? [deleteAction] - : [deleteAction, prefixIdentifierWithUnderscore(identifier)]; - // handle case where 'import a = A;' - case 238 /* ImportEqualsDeclaration */: - var importEquals = ts.getAncestor(identifier, 238 /* ImportEqualsDeclaration */); - return [deleteNode(importEquals)]; - case 243 /* ImportSpecifier */: - var namedImports = parent.parent; - if (namedImports.elements.length === 1) { - return deleteNamedImportBinding(namedImports); - } - else { - // delete import specifier - return [deleteNodeInList(parent)]; - } - case 240 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' - var importClause = parent; - if (!importClause.namedBindings) { - var importDecl = ts.getAncestor(importClause, 239 /* ImportDeclaration */); - return [deleteNode(importDecl)]; - } - else { - // import |d,| * as ns from './file' - var start_6 = importClause.name.getStart(sourceFile); - var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false); - if (nextToken && nextToken.kind === 26 /* CommaToken */) { - // shift first non-whitespace position after comma to the start position of the node - return [deleteRange({ pos: start_6, end: ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true) })]; - } - else { - return [deleteNode(importClause.name)]; - } - } - case 241 /* NamespaceImport */: - return deleteNamedImportBinding(parent); - default: - return deleteDefault(); - } - } - function deleteNamedImportBinding(namedBindings) { - if (namedBindings.parent.name) { - // Delete named imports while preserving the default import - // import d|, * as ns| from './file' - // import d|, { a }| from './file' - var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false); - if (previousToken && previousToken.kind === 26 /* CommaToken */) { - return [deleteRange({ pos: previousToken.getStart(), end: namedBindings.end })]; + var token = getToken(diag.file, diag.start); + switch (context.fixId) { + case fixIdPrefix: + if (ts.isIdentifier(token) && canPrefix(token)) { + tryPrefixDeclaration(changes, diag.code, sourceFile, token); } - return undefined; - } - else { - // Delete the entire import declaration - // |import * as ns from './file'| - // |import { a } from './file'| - var importDecl = ts.getAncestor(namedBindings, 239 /* ImportDeclaration */); - return [deleteNode(importDecl)]; - } + break; + case fixIdDelete: + tryDeleteDeclaration(changes, sourceFile, token); + break; + default: + ts.Debug.fail(JSON.stringify(context.fixId)); } - // token.parent is a variableDeclaration - function deleteVariableDeclarationOrPrefixWithUnderscore(identifier, varDecl) { + }); }, + }); + function getToken(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + // this handles var ["computed"] = 12; + return token.kind === 21 /* OpenBracketToken */ ? ts.getTokenAtPosition(sourceFile, pos + 1, /*includeJsDocComment*/ false) : token; + } + function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { + // Don't offer to prefix a property. + if (errorCode !== ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code && ts.isIdentifier(token) && canPrefix(token)) { + changes.replaceNode(sourceFile, token, ts.createIdentifier("_" + token.text)); + } + } + function canPrefix(token) { + switch (token.parent.kind) { + case 148 /* Parameter */: + return true; + case 230 /* VariableDeclaration */: { + var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 215 /* ForStatement */: - var forStatement = varDecl.parent.parent; - var forInitializer = forStatement.initializer; - return [forInitializer.declarations.length === 1 ? deleteNode(forInitializer) : deleteNodeInList(varDecl)]; - case 217 /* ForOfStatement */: - var forOfStatement = varDecl.parent.parent; - ts.Debug.assert(forOfStatement.initializer.kind === 228 /* VariableDeclarationList */); - var forOfInitializer = forOfStatement.initializer; - return [ - replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()), - prefixIdentifierWithUnderscore(identifier) - ]; - case 216 /* ForInStatement */: - // There is no valid fix in the case of: - // for .. in - return [prefixIdentifierWithUnderscore(identifier)]; - default: - var variableStatement = varDecl.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return [deleteNode(variableStatement)]; - } - else { - return [deleteNodeInList(varDecl)]; - } + case 220 /* ForOfStatement */: + case 219 /* ForInStatement */: + return true; } } - function deleteNode(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNode(sourceFile, n)); - } - function deleteRange(range) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteRange(sourceFile, range)); - } - function deleteNodeInList(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeInList(sourceFile, n)); - } - function deleteNodeRange(start, end) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeRange(sourceFile, start, end)); - } - function replaceNode(n, newNode) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).replaceNode(sourceFile, n, newNode)); - } - function makeChange(changeTracker) { - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), - changes: changeTracker.getChanges() - }; - } } - }); + return false; + } + function tryDeleteDeclaration(changes, sourceFile, token) { + switch (token.kind) { + case 71 /* Identifier */: + tryDeleteIdentifier(changes, sourceFile, token); + break; + case 151 /* PropertyDeclaration */: + case 244 /* NamespaceImport */: + changes.deleteNode(sourceFile, token.parent); + break; + default: + tryDeleteDefault(changes, sourceFile, token); + } + } + function tryDeleteDefault(changes, sourceFile, token) { + if (ts.isDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent.parent); + } + } + function tryDeleteIdentifier(changes, sourceFile, identifier) { + var parent = identifier.parent; + switch (parent.kind) { + case 230 /* VariableDeclaration */: + tryDeleteVariableDeclaration(changes, sourceFile, parent); + break; + case 147 /* TypeParameter */: + var typeParameters = parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false); + ts.Debug.assert(previousToken.kind === 27 /* LessThanToken */); + ts.Debug.assert(nextToken.kind === 29 /* GreaterThanToken */); + changes.deleteNodeRange(sourceFile, previousToken, nextToken); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 148 /* Parameter */: + var oldFunction = parent.parent; + if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) { + // Lambdas with exactly one parameter are special because, after removal, there + // must be an empty parameter list (i.e. `()`) and this won't necessarily be the + // case if the parameter is simply removed (e.g. in `x => 1`). + var newFunction = ts.updateArrowFunction(oldFunction, oldFunction.modifiers, oldFunction.typeParameters, + /*parameters*/ undefined, oldFunction.type, oldFunction.equalsGreaterThanToken, oldFunction.body); + // Drop leading and trailing trivia of the new function because we're only going + // to replace the span (vs the full span) of the old function - the old leading + // and trailing trivia will remain. + ts.suppressLeadingAndTrailingTrivia(newFunction); + changes.replaceNode(sourceFile, oldFunction, newFunction, ts.textChanges.useNonAdjustedPositions); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + // handle case where 'import a = A;' + case 241 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(identifier, 241 /* ImportEqualsDeclaration */); + changes.deleteNode(sourceFile, importEquals); + break; + case 246 /* ImportSpecifier */: + var namedImports = parent.parent; + if (namedImports.elements.length === 1) { + tryDeleteNamedImportBinding(changes, sourceFile, namedImports); + } + else { + // delete import specifier + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 243 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' + var importClause = parent; + if (!importClause.namedBindings) { + changes.deleteNode(sourceFile, ts.getAncestor(importClause, 242 /* ImportDeclaration */)); + } + else { + // import |d,| * as ns from './file' + var start = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false); + if (nextToken && nextToken.kind === 26 /* CommaToken */) { + // shift first non-whitespace position after comma to the start position of the node + var end = ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true); + changes.deleteRange(sourceFile, { pos: start, end: end }); + } + else { + changes.deleteNode(sourceFile, importClause.name); + } + } + break; + case 244 /* NamespaceImport */: + tryDeleteNamedImportBinding(changes, sourceFile, parent); + break; + default: + tryDeleteDefault(changes, sourceFile, identifier); + break; + } + } + function tryDeleteNamedImportBinding(changes, sourceFile, namedBindings) { + if (namedBindings.parent.name) { + // Delete named imports while preserving the default import + // import d|, * as ns| from './file' + // import d|, { a }| from './file' + var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false); + if (previousToken && previousToken.kind === 26 /* CommaToken */) { + changes.deleteRange(sourceFile, { pos: previousToken.getStart(), end: namedBindings.end }); + } + } + else { + // Delete the entire import declaration + // |import * as ns from './file'| + // |import { a } from './file'| + var importDecl = ts.getAncestor(namedBindings, 242 /* ImportDeclaration */); + changes.deleteNode(sourceFile, importDecl); + } + } + // token.parent is a variableDeclaration + function tryDeleteVariableDeclaration(changes, sourceFile, varDecl) { + switch (varDecl.parent.parent.kind) { + case 218 /* ForStatement */: { + var forStatement = varDecl.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + changes.deleteNode(sourceFile, forInitializer); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + break; + } + case 220 /* ForOfStatement */: + var forOfStatement = varDecl.parent.parent; + ts.Debug.assert(forOfStatement.initializer.kind === 231 /* VariableDeclarationList */); + var forOfInitializer = forOfStatement.initializer; + changes.replaceNode(sourceFile, forOfInitializer.declarations[0], ts.createObjectLiteral()); + break; + case 219 /* ForInStatement */: + case 228 /* TryStatement */: + break; + default: + var variableStatement = varDecl.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + changes.deleteNode(sourceFile, variableStatement); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + } + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92950,62 +94965,158 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixIdPlain = "fixJSDocTypes_plain"; + var fixIdNullable = "fixJSDocTypes_nullable"; + var errorCodes = [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code], - getCodeActions: getActionsForJSDocTypes + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var checker = context.program.getTypeChecker(); + var info = getInfo(sourceFile, context.span.start, checker); + if (!info) + return undefined; + var typeNode = info.typeNode, type = info.type; + var original = typeNode.getText(sourceFile); + var actions = [fix(type, fixIdPlain)]; + if (typeNode.kind === 277 /* JSDocNullableType */) { + // for nullable types, suggest the flow-compatible `T | null | undefined` + // in addition to the jsdoc/closure-compatible `T | null` + actions.push(fix(checker.getNullableType(type, 4096 /* Undefined */), fixIdNullable)); + } + return actions; + function fix(type, fixId) { + var newText = typeString(type, checker); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [createChange(typeNode, sourceFile, newText)])], + fixId: fixId, + }; + } + }, + fixIds: [fixIdPlain, fixIdNullable], + getAllCodeActions: function (context) { + var fixId = context.fixId, program = context.program, sourceFile = context.sourceFile; + var checker = program.getTypeChecker(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var info = getInfo(err.file, err.start, checker); + if (!info) + return; + var typeNode = info.typeNode, type = info.type; + var fixedType = typeNode.kind === 277 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 4096 /* Undefined */) : type; + changes.push(createChange(typeNode, sourceFile, typeString(fixedType, checker))); + }); + } }); - function getActionsForJSDocTypes(context) { - var sourceFile = context.sourceFile; - var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); + function getInfo(sourceFile, pos, checker) { + var decl = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isTypeContainer); + var typeNode = decl && decl.type; + return typeNode && { typeNode: typeNode, type: checker.getTypeFromTypeNode(typeNode) }; + } + function createChange(declaration, sourceFile, newText) { + return ts.createTextChange(ts.createTextSpanFromNode(declaration, sourceFile), newText); + } + function typeString(type, checker) { + return checker.typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* NoTruncation */); + } + function isTypeContainer(node) { // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments - var decl = ts.findAncestor(node, function (n) { - return n.kind === 203 /* AsExpression */ || - n.kind === 156 /* CallSignature */ || - n.kind === 157 /* ConstructSignature */ || - n.kind === 229 /* FunctionDeclaration */ || - n.kind === 154 /* GetAccessor */ || - n.kind === 158 /* IndexSignature */ || - n.kind === 173 /* MappedType */ || - n.kind === 152 /* MethodDeclaration */ || - n.kind === 151 /* MethodSignature */ || - n.kind === 147 /* Parameter */ || - n.kind === 150 /* PropertyDeclaration */ || - n.kind === 149 /* PropertySignature */ || - n.kind === 155 /* SetAccessor */ || - n.kind === 232 /* TypeAliasDeclaration */ || - n.kind === 185 /* TypeAssertionExpression */ || - n.kind === 227 /* VariableDeclaration */; - }); - if (!decl) - return; - var checker = context.program.getTypeChecker(); - var jsdocType = decl.type; - if (!jsdocType) - return; - var original = ts.getTextOfNode(jsdocType); - var type = checker.getTypeFromTypeNode(jsdocType); - var actions = [createAction(jsdocType, sourceFile.fileName, original, checker.typeToString(type, /*enclosingDeclaration*/ undefined, 8 /* NoTruncation */))]; - if (jsdocType.kind === 274 /* JSDocNullableType */) { - // for nullable types, suggest the flow-compatible `T | null | undefined` - // in addition to the jsdoc/closure-compatible `T | null` - var replacementWithUndefined = checker.typeToString(checker.getNullableType(type, 4096 /* Undefined */), /*enclosingDeclaration*/ undefined, 8 /* NoTruncation */); - actions.push(createAction(jsdocType, sourceFile.fileName, original, replacementWithUndefined)); + switch (node.kind) { + case 206 /* AsExpression */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 155 /* GetAccessor */: + case 159 /* IndexSignature */: + case 176 /* MappedType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: + case 188 /* TypeAssertionExpression */: + case 230 /* VariableDeclaration */: + return true; + default: + return false; } - return actions; } - function createAction(declaration, fileName, original, replacement) { + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixAwaitInSyncFunction"; + var errorCodes = [ + ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function.code, + ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, nodes); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_async_modifier_to_containing_function), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + doChange(changes, context.sourceFile, nodes); + }); }, + }); + function getReturnType(expr) { + if (expr.type) { + return expr.type; + } + if (ts.isVariableDeclaration(expr.parent) && + expr.parent.type && + ts.isFunctionTypeNode(expr.parent.type)) { + return expr.parent.type.type; + } + } + function getNodes(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var containingFunction = ts.getContainingFunction(token); + var insertBefore; + switch (containingFunction.kind) { + case 153 /* MethodDeclaration */: + insertBefore = containingFunction.name; + break; + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + insertBefore = ts.findChildOfKind(containingFunction, 89 /* FunctionKeyword */, sourceFile); + break; + case 191 /* ArrowFunction */: + insertBefore = ts.findChildOfKind(containingFunction, 19 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); + break; + default: + return; + } return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, replacement]), - changes: [{ - fileName: fileName, - textChanges: [{ - span: { start: declaration.getStart(), length: declaration.getWidth() }, - newText: replacement - }] - }], + insertBefore: insertBefore, + returnType: getReturnType(containingFunction) }; } + function doChange(changes, sourceFile, _a) { + var insertBefore = _a.insertBefore, returnType = _a.returnType; + if (returnType) { + var entityName = ts.getEntityNameFromTypeNode(returnType); + if (!entityName || entityName.kind !== 71 /* Identifier */ || entityName.text !== "Promise") { + changes.replaceNode(sourceFile, returnType, ts.createTypeReferenceNode("Promise", ts.createNodeArray([returnType]))); + } + } + changes.insertModifierBefore(sourceFile, 120 /* AsyncKeyword */, insertBefore); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -93021,125 +95132,31 @@ var ts; ts.Diagnostics.Cannot_find_namespace_0.code, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code ], - getCodeActions: getImportCodeActions + getCodeActions: getImportCodeActions, + // TODO: GH#20315 + fixIds: [], + getAllCodeActions: ts.notImplemented, }); - var ModuleSpecifierComparison; - (function (ModuleSpecifierComparison) { - ModuleSpecifierComparison[ModuleSpecifierComparison["Better"] = 0] = "Better"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; - })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = /** @class */ (function () { - function ImportCodeActionMap() { - this.symbolIdToActionMap = []; - } - ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { - var actions = this.symbolIdToActionMap[symbolId]; - if (!actions) { - this.symbolIdToActionMap[symbolId] = [newAction]; - return; - } - if (newAction.kind === "CodeChange") { - actions.push(newAction); - return; - } - var updatedNewImports = []; - for (var _i = 0, _a = this.symbolIdToActionMap[symbolId]; _i < _a.length; _i++) { - var existingAction = _a[_i]; - if (existingAction.kind === "CodeChange") { - // only import actions should compare - updatedNewImports.push(existingAction); - continue; - } - switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { - case 0 /* Better */: - // the new one is not worth considering if it is a new import. - // However if it is instead a insertion into existing import, the user might want to use - // the module specifier even it is worse by our standards. So keep it. - if (newAction.kind === "NewImport") { - return; - } - // falls through - case 1 /* Equal */: - // the current one is safe. But it is still possible that the new one is worse - // than another existing one. For example, you may have new imports from "./foo/bar" - // and "bar", when the new one is "bar/bar2" and the current one is "./foo/bar". The new - // one and the current one are not comparable (one relative path and one absolute path), - // but the new one is worse than the other one, so should not add to the list. - updatedNewImports.push(existingAction); - break; - case 2 /* Worse */: - // the existing one is worse, remove from the list. - continue; - } - } - // if we reach here, it means the new one is better or equal to all of the existing ones. - updatedNewImports.push(newAction); - this.symbolIdToActionMap[symbolId] = updatedNewImports; - }; - ImportCodeActionMap.prototype.addActions = function (symbolId, newActions) { - for (var _i = 0, newActions_1 = newActions; _i < newActions_1.length; _i++) { - var newAction = newActions_1[_i]; - this.addAction(symbolId, newAction); - } - }; - ImportCodeActionMap.prototype.getAllActions = function () { - var result = []; - for (var key in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[key]); - } - return result; - }; - ImportCodeActionMap.prototype.compareModuleSpecifiers = function (moduleSpecifier1, moduleSpecifier2) { - if (moduleSpecifier1 === moduleSpecifier2) { - return 1 /* Equal */; - } - // if moduleSpecifier1 (ms1) is a substring of ms2, then it is better - if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { - return 0 /* Better */; - } - if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { - return 2 /* Worse */; - } - // if both are relative paths, and ms1 has fewer levels, then it is better - if (ts.isExternalModuleNameRelative(moduleSpecifier1) && ts.isExternalModuleNameRelative(moduleSpecifier2)) { - var regex = new RegExp(ts.directorySeparator, "g"); - var moduleSpecifier1LevelCount = (moduleSpecifier1.match(regex) || []).length; - var moduleSpecifier2LevelCount = (moduleSpecifier2.match(regex) || []).length; - return moduleSpecifier1LevelCount < moduleSpecifier2LevelCount - ? 0 /* Better */ - : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount - ? 1 /* Equal */ - : 2 /* Worse */; - } - // the equal cases include when the two specifiers are not comparable. - return 1 /* Equal */; - }; - return ImportCodeActionMap; - }()); - function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { - return { - description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: changes, - kind: kind, - moduleSpecifier: moduleSpecifier - }; + function createCodeAction(descriptionDiagnostic, diagnosticArgs, changes) { + var description = ts.formatMessage.apply(undefined, [undefined, descriptionDiagnostic].concat(diagnosticArgs)); + // TODO: GH#20315 + return { description: description, changes: changes, fixId: undefined }; } - function convertToImportCodeFixContext(context) { + function convertToImportCodeFixContext(context, symbolToken, symbolName) { var useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; - var checker = context.program.getTypeChecker(); - var symbolToken = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var program = context.program; + var checker = program.getTypeChecker(); return { host: context.host, - newLineCharacter: context.newLineCharacter, formatContext: context.formatContext, sourceFile: context.sourceFile, + program: program, checker: checker, - compilerOptions: context.program.getCompilerOptions(), + compilerOptions: program.getCompilerOptions(), cachedImportDeclarations: [], getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), - symbolName: symbolToken.getText(), - symbolToken: symbolToken, + symbolName: symbolName, + symbolToken: symbolToken }; } var ImportKind; @@ -93148,55 +95165,77 @@ var ts; ImportKind[ImportKind["Default"] = 1] = "Default"; ImportKind[ImportKind["Namespace"] = 2] = "Namespace"; ImportKind[ImportKind["Equals"] = 3] = "Equals"; - })(ImportKind = codefix.ImportKind || (codefix.ImportKind = {})); - function getCodeActionForImport(moduleSymbols, context) { - moduleSymbols = ts.toArray(moduleSymbols); - var declarations = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getImportDeclarations(moduleSymbol, context.checker, context.sourceFile, context.cachedImportDeclarations); - }); - var actions = []; - if (context.symbolToken) { - // It is possible that multiple import statements with the same specifier exist in the file. - // e.g. - // - // import * as ns from "foo"; - // import { member1, member2 } from "foo"; - // - // member3/**/ <-- cusor here - // - // in this case we should provie 2 actions: - // 1. change "member3" to "ns.member3" - // 2. add "member3" to the second import statement's import list - // and it is up to the user to decide which one fits best. - for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { - var declaration = declarations_13[_i]; - var namespace = getNamespaceImportName(declaration); - if (namespace) { - actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken)); + })(ImportKind || (ImportKind = {})); + function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, symbolToken) { + var exportInfos = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); + ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol; })); + // We sort the best codefixes first, so taking `first` is best for completions. + var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, exportInfos, compilerOptions, getCanonicalFileName, host)).moduleSpecifier; + var ctx = { host: host, program: program, checker: checker, compilerOptions: compilerOptions, sourceFile: sourceFile, formatContext: formatContext, symbolName: symbolName, getCanonicalFileName: getCanonicalFileName, symbolToken: symbolToken }; + return { moduleSpecifier: moduleSpecifier, codeAction: ts.first(getCodeActionsForImport(exportInfos, ctx)) }; + } + codefix.getImportCompletionAction = getImportCompletionAction; + function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { + var result = []; + forEachExternalModule(checker, allSourceFiles, function (moduleSymbol) { + for (var _i = 0, _a = checker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { + var exported = _a[_i]; + if (ts.skipAlias(exported, checker) === exportedSymbol) { + var isDefaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol) === exported; + result.push({ moduleSymbol: moduleSymbol, importKind: isDefaultExport ? 1 /* Default */ : 0 /* Named */ }); } } - } - return actions.concat(getCodeActionsForAddImport(moduleSymbols, context, declarations)); + }); + return result; + } + function getCodeActionsForImport(exportInfos, context) { + var existingImports = ts.flatMap(exportInfos, function (info) { + return getImportDeclarations(info, context.checker, context.sourceFile, context.cachedImportDeclarations); + }); + // It is possible that multiple import statements with the same specifier exist in the file. + // e.g. + // + // import * as ns from "foo"; + // import { member1, member2 } from "foo"; + // + // member3/**/ <-- cusor here + // + // in this case we should provie 2 actions: + // 1. change "member3" to "ns.member3" + // 2. add "member3" to the second import statement's import list + // and it is up to the user to decide which one fits best. + var useExistingImportActions = !context.symbolToken || !ts.isIdentifier(context.symbolToken) ? ts.emptyArray : ts.mapDefined(existingImports, function (_a) { + var declaration = _a.declaration; + var namespace = getNamespaceImportName(declaration); + if (namespace) { + var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); + if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { + return getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken); + } + } + }); + return useExistingImportActions.concat(getCodeActionsForAddImport(exportInfos, context, existingImports)); } - codefix.getCodeActionForImport = getCodeActionForImport; function getNamespaceImportName(declaration) { - if (declaration.kind === 239 /* ImportDeclaration */) { + if (declaration.kind === 242 /* ImportDeclaration */) { var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings; - return namedBindings && namedBindings.kind === 241 /* NamespaceImport */ ? namedBindings.name : undefined; + return namedBindings && namedBindings.kind === 244 /* NamespaceImport */ ? namedBindings.name : undefined; } else { return declaration.name; } } // TODO(anhans): This doesn't seem important to cache... just use an iterator instead of creating a new array? - function getImportDeclarations(moduleSymbol, checker, _a, cachedImportDeclarations) { - var imports = _a.imports; + function getImportDeclarations(_a, checker, _b, cachedImportDeclarations) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var imports = _b.imports; if (cachedImportDeclarations === void 0) { cachedImportDeclarations = []; } var moduleSymbolId = ts.getUniqueSymbolId(moduleSymbol, checker); var cached = cachedImportDeclarations[moduleSymbolId]; if (!cached) { cached = cachedImportDeclarations[moduleSymbolId] = ts.mapDefined(imports, function (importModuleSpecifier) { - return checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + var declaration = checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + return declaration && { declaration: declaration, importKind: importKind }; }); } return cached; @@ -93204,42 +95243,43 @@ var ts; function getImportDeclaration(_a) { var parent = _a.parent; switch (parent.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return parent; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return parent.parent; - case 245 /* ExportDeclaration */: - case 182 /* CallExpression */:// For "require()" calls + case 248 /* ExportDeclaration */: + case 185 /* CallExpression */:// For "require()" calls // Ignore these, can't add imports to them. return undefined; default: ts.Debug.fail(); } } - function getCodeActionForNewImport(context, moduleSpecifier) { - var kind = context.kind, sourceFile = context.sourceFile, newLineCharacter = context.newLineCharacter, symbolName = context.symbolName; + function getCodeActionForNewImport(context, _a) { + var moduleSpecifier = _a.moduleSpecifier, importKind = _a.importKind; + var sourceFile = context.sourceFile, symbolName = context.symbolName; var lastImportDeclaration = ts.findLast(sourceFile.statements, ts.isAnyImportSyntax); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier); var quotedModuleSpecifier = createStringLiteralWithQuoteStyle(sourceFile, moduleSpecifierWithoutQuotes); - var importDecl = kind !== 3 /* Equals */ + var importDecl = importKind !== 3 /* Equals */ ? ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClauseOfKind(kind, symbolName), quotedModuleSpecifier) + /*modifiers*/ undefined, createImportClauseOfKind(importKind, symbolName), quotedModuleSpecifier) : ts.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createIdentifier(symbolName), ts.createExternalModuleReference(quotedModuleSpecifier)); var changes = ChangeTracker.with(context, function (changeTracker) { if (lastImportDeclaration) { - changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: newLineCharacter }); + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); } else { - changeTracker.insertNodeAt(sourceFile, ts.getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + newLineCharacter + newLineCharacter }); + changeTracker.insertNodeAtTopOfFile(sourceFile, importDecl, /*blankLineBetween*/ true); } }); // if this file doesn't have any import statements, insert an import statement and then insert a new line // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. - return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes); } function createStringLiteralWithQuoteStyle(sourceFile, text) { var literal = ts.createLiteral(text); @@ -93247,6 +95287,12 @@ var ts; literal.singleQuote = !!firstModuleSpecifier && !ts.isStringDoubleQuoted(firstModuleSpecifier, sourceFile); return literal; } + function usesJsExtensionOnImports(sourceFile) { + return ts.firstDefined(sourceFile.imports, function (_a) { + var text = _a.text; + return ts.pathIsRelative(text) ? ts.fileExtensionIs(text, ".js" /* Js */) : undefined; + }) || false; + } function createImportClauseOfKind(kind, symbolName) { var id = ts.createIdentifier(symbolName); switch (kind) { @@ -93260,68 +95306,87 @@ var ts; ts.Debug.assertNever(kind); } } - function getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, options, getCanonicalFileName, host) { + function getNewImportInfos(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { var baseUrl = options.baseUrl, paths = options.paths, rootDirs = options.rootDirs; - var choicesForEachExportingModule = ts.mapIterator(ts.arrayIterator(moduleSymbols), function (moduleSymbol) { - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; - var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); - var global = tryGetModuleNameFromAmbientModule(moduleSymbol) - || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) - || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) - || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); - if (global) { - return [global]; - } - var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options); - if (!baseUrl) { - return [relativePath]; - } - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); - if (!relativeToBaseUrl) { - return [relativePath]; - } - var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options); - if (paths) { - var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - if (fromPaths) { - return [fromPaths]; + var addJsExtension = usesJsExtensionOnImports(sourceFile); + var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (_a) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var modulePathsGroups = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { + var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); + var global = tryGetModuleNameFromAmbientModule(moduleSymbol) + || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) + || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) + || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); + if (global) { + return [global]; } - } - /* - Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl. + var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options, addJsExtension); + if (!baseUrl) { + return [relativePath]; + } + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); + if (!relativeToBaseUrl) { + return [relativePath]; + } + var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options, addJsExtension); + if (paths) { + var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); + if (fromPaths) { + return [fromPaths]; + } + } + if (isPathRelativeToParent(relativeToBaseUrl)) { + return [relativePath]; + } + /* + Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl. - Suppose we have: - baseUrl = /base - sourceDirectory = /base/a/b - moduleFileName = /base/foo/bar - Then: - relativePath = ../../foo/bar - getRelativePathNParents(relativePath) = 2 - pathFromSourceToBaseUrl = ../../ - getRelativePathNParents(pathFromSourceToBaseUrl) = 2 - 2 < 2 = false - In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar". + Suppose we have: + baseUrl = /base + sourceDirectory = /base/a/b + moduleFileName = /base/foo/bar + Then: + relativePath = ../../foo/bar + getRelativePathNParents(relativePath) = 2 + pathFromSourceToBaseUrl = ../../ + getRelativePathNParents(pathFromSourceToBaseUrl) = 2 + 2 < 2 = false + In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar". - Suppose we have: - baseUrl = /base - sourceDirectory = /base/foo/a - moduleFileName = /base/foo/bar - Then: - relativePath = ../a - getRelativePathNParents(relativePath) = 1 - pathFromSourceToBaseUrl = ../../ - getRelativePathNParents(pathFromSourceToBaseUrl) = 2 - 1 < 2 = true - In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a". - */ - var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); - var relativeFirst = getRelativePathNParents(pathFromSourceToBaseUrl) < getRelativePathNParents(relativePath); - return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + Suppose we have: + baseUrl = /base + sourceDirectory = /base/foo/a + moduleFileName = /base/foo/bar + Then: + relativePath = ../a + getRelativePathNParents(relativePath) = 1 + pathFromSourceToBaseUrl = ../../ + getRelativePathNParents(pathFromSourceToBaseUrl) = 2 + 1 < 2 = true + In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a". + */ + var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); + var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl); + return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + }); + return modulePathsGroups.map(function (group) { return group.map(function (moduleSpecifier) { return ({ moduleSpecifier: moduleSpecifier, importKind: importKind }); }); }); }); - // Only return results for the re-export with the shortest possible path (and also give the other path even if that's long.) - return ts.best(choicesForEachExportingModule, function (a, b) { return a[0].length < b[0].length; }); + // Sort to keep the shortest paths first, but keep [relativePath, importRelativeToBaseUrl] groups together + return ts.flatten(choicesForEachExportingModule.sort(function (a, b) { return ts.first(a).moduleSpecifier.length - ts.first(b).moduleSpecifier.length; })); + } + /** + * Looks for a existing imports that use symlinks to this module. + * Only if no symlink is available, the real path will be used. + */ + function getAllModulePaths(program, _a) { + var fileName = _a.fileName; + var symlinks = ts.mapDefined(program.getSourceFiles(), function (sf) { + return sf.resolvedModules && ts.firstDefinedIterator(sf.resolvedModules.values(), function (res) { + return res && res.resolvedFileName === fileName ? res.originalPath : undefined; + }); + }); + return symlinks.length === 0 ? [fileName] : symlinks; } - codefix.getModuleSpecifiersForNewImport = getModuleSpecifiersForNewImport; function getRelativePathNParents(relativePath) { var count = 0; for (var i = 0; i + 3 <= relativePath.length && relativePath.slice(i, i + 3) === "../"; i += 3) { @@ -93335,10 +95400,11 @@ var ts; return decl.name.text; } } - function tryGetModuleNameFromPaths(relativeNameWithIndex, relativeName, paths) { + function tryGetModuleNameFromPaths(relativeToBaseUrlWithIndex, relativeToBaseUrl, paths) { for (var key in paths) { for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) { - var pattern = _a[_i]; + var patternText_1 = _a[_i]; + var pattern = ts.removeFileExtension(ts.normalizePath(patternText_1)); var indexOfStar = pattern.indexOf("*"); if (indexOfStar === 0 && pattern.length === 1) { continue; @@ -93346,14 +95412,14 @@ var ts; else if (indexOfStar !== -1) { var prefix = pattern.substr(0, indexOfStar); var suffix = pattern.substr(indexOfStar + 1); - if (relativeName.length >= prefix.length + suffix.length && - ts.startsWith(relativeName, prefix) && - ts.endsWith(relativeName, suffix)) { - var matchedStar = relativeName.substr(prefix.length, relativeName.length - suffix.length); - return key.replace("\*", matchedStar); + if (relativeToBaseUrl.length >= prefix.length + suffix.length && + ts.startsWith(relativeToBaseUrl, prefix) && + ts.endsWith(relativeToBaseUrl, suffix)) { + var matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length); + return key.replace("*", matchedStar); } } - else if (pattern === relativeName || pattern === relativeNameWithIndex) { + else if (pattern === relativeToBaseUrl || pattern === relativeToBaseUrlWithIndex) { return key; } } @@ -93368,12 +95434,12 @@ var ts; var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath, getCanonicalFileName) : normalizedTargetPath; return ts.removeFileExtension(relativePath); } - function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) { + function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) { var roots = ts.getEffectiveTypeRoots(options, host); - return roots && ts.firstDefined(roots, function (unNormalizedTypeRoot) { + return ts.firstDefined(roots, function (unNormalizedTypeRoot) { var typeRoot = ts.toPath(unNormalizedTypeRoot, /*basePath*/ undefined, getCanonicalFileName); if (ts.startsWith(moduleFileName, typeRoot)) { - return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options); + return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options, addJsExtension); } }); } @@ -93481,61 +95547,75 @@ var ts; return state > 1 /* NodeModules */ ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined; } function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) { - return ts.firstDefined(rootDirs, function (rootDir) { return getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); }); + return ts.firstDefined(rootDirs, function (rootDir) { + var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); + return isPathRelativeToParent(relativePath) ? undefined : relativePath; + }); } - function removeExtensionAndIndexPostFix(fileName, options) { + function removeExtensionAndIndexPostFix(fileName, options, addJsExtension) { var noExtension = ts.removeFileExtension(fileName); - return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs ? ts.removeSuffix(noExtension, "/index") : noExtension; + return addJsExtension + ? noExtension + ".js" + : ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs + ? ts.removeSuffix(noExtension, "/index") + : noExtension; } function getRelativePathIfInDirectory(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; + return ts.isRootedDiskPath(relativePath) ? undefined : relativePath; + } + function isPathRelativeToParent(path) { + return ts.startsWith(path, ".."); } function getRelativePath(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); return !ts.pathIsRelative(relativePath) ? "./" + relativePath : relativePath; } - function getCodeActionsForAddImport(moduleSymbols, ctx, declarations) { - var fromExistingImport = ts.firstDefined(declarations, function (declaration) { - if (declaration.kind === 239 /* ImportDeclaration */ && declaration.importClause) { - var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined); + function getCodeActionsForAddImport(exportInfos, ctx, existingImports) { + var fromExistingImport = ts.firstDefined(existingImports, function (_a) { + var declaration = _a.declaration, importKind = _a.importKind; + if (declaration.kind === 242 /* ImportDeclaration */ && declaration.importClause) { + var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined, importKind); if (changes) { var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText()); - return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes); } } }); if (fromExistingImport) { return [fromExistingImport]; } - var existingDeclaration = ts.firstDefined(declarations, moduleSpecifierFromAnyImport); - var moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); - return moduleSpecifiers.map(function (spec) { return getCodeActionForNewImport(ctx, spec); }); + var existingDeclaration = ts.firstDefined(existingImports, newImportInfoFromExistingSpecifier); + var newImportInfos = existingDeclaration + ? [existingDeclaration] + : getNewImportInfos(ctx.program, ctx.sourceFile, exportInfos, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); + return newImportInfos.map(function (info) { return getCodeActionForNewImport(ctx, info); }); } - function moduleSpecifierFromAnyImport(node) { - var expression = node.kind === 239 /* ImportDeclaration */ - ? node.moduleSpecifier - : node.moduleReference.kind === 249 /* ExternalModuleReference */ - ? node.moduleReference.expression + function newImportInfoFromExistingSpecifier(_a) { + var declaration = _a.declaration, importKind = _a.importKind; + var expression = declaration.kind === 242 /* ImportDeclaration */ + ? declaration.moduleSpecifier + : declaration.moduleReference.kind === 252 /* ExternalModuleReference */ + ? declaration.moduleReference.expression : undefined; - return expression && ts.isStringLiteral(expression) ? expression.text : undefined; + return expression && ts.isStringLiteral(expression) ? { moduleSpecifier: expression.text, importKind: importKind } : undefined; } - function tryUpdateExistingImport(context, importClause) { - var symbolName = context.symbolName, sourceFile = context.sourceFile, kind = context.kind; + function tryUpdateExistingImport(context, importClause, importKind) { + var symbolName = context.symbolName, sourceFile = context.sourceFile; var name = importClause.name; - var namedBindings = (importClause.kind !== 238 /* ImportEqualsDeclaration */ && importClause).namedBindings; - switch (kind) { + var namedBindings = (importClause.kind !== 241 /* ImportEqualsDeclaration */ && importClause).namedBindings; + switch (importKind) { case 1 /* Default */: return name ? undefined : ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(ts.createIdentifier(symbolName), namedBindings)); }); case 0 /* Named */: { var newImportSpecifier_1 = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(symbolName)); - if (namedBindings && namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length !== 0) { + if (namedBindings && namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length !== 0) { // There are already named imports; add another. return ChangeTracker.with(context, function (t) { return t.insertNodeInListAfter(sourceFile, namedBindings.elements[namedBindings.elements.length - 1], newImportSpecifier_1); }); } - if (!namedBindings || namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length === 0) { + if (!namedBindings || namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length === 0) { return ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(name, ts.createNamedImports([newImportSpecifier_1]))); }); @@ -93549,7 +95629,7 @@ var ts; case 3 /* Equals */: return undefined; default: - ts.Debug.assertNever(kind); + ts.Debug.assertNever(importKind); } } function getCodeActionForUseExistingNamespaceImport(namespacePrefix, context, symbolToken) { @@ -93564,35 +95644,39 @@ var ts; * namespace instead of altering the import declaration. For example, "foo" would * become "ns.foo" */ - return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], ChangeTracker.with(context, function (tracker) { - return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolName)); - }), "CodeChange", - /*moduleSpecifier*/ undefined); + var changes = ChangeTracker.with(context, function (tracker) { + return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolToken)); + }); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes); } function getImportCodeActions(context) { - var importFixContext = convertToImportCodeFixContext(context); return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code - ? getActionsForUMDImport(importFixContext) - : getActionsForNonUMDImport(importFixContext, context.program.getSourceFiles(), context.cancellationToken); + ? getActionsForUMDImport(context) + : getActionsForNonUMDImport(context); } function getActionsForUMDImport(context) { - var checker = context.checker, symbolToken = context.symbolToken, compilerOptions = context.compilerOptions; - var umdSymbol = checker.getSymbolAtLocation(symbolToken); - var symbol; - var symbolName; - if (umdSymbol.flags & 2097152 /* Alias */) { - symbol = checker.getAliasedSymbol(umdSymbol); - symbolName = context.symbolName; + var token = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var checker = context.program.getTypeChecker(); + var umdSymbol; + if (ts.isIdentifier(token)) { + // try the identifier to see if it is the umd symbol + umdSymbol = checker.getSymbolAtLocation(token); } - else if (ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken) { + if (!ts.isUMDExportSymbol(umdSymbol)) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), symbolToken.parent.tagName, 107455 /* Value */)); - symbolName = symbol.name; + var parent = token.parent; + var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(parent); + if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 258 /* JsxOpeningFragment */) { + umdSymbol = checker.resolveName(checker.getJsxNamespace(), isNodeOpeningLikeElement ? parent.tagName : parent, 107455 /* Value */, /*excludeGlobals*/ false); + } } - else { - throw ts.Debug.fail("Either the symbol or the JSX namespace should be a UMD global if we got here"); + if (ts.isUMDExportSymbol(umdSymbol)) { + var symbol = checker.getAliasedSymbol(umdSymbol); + if (symbol) { + return getCodeActionsForImport([{ moduleSymbol: symbol, importKind: getUmdImportKind(context.program.getCompilerOptions()) }], convertToImportCodeFixContext(context, token, umdSymbol.name)); + } } - return getCodeActionForImport(symbol, __assign({}, context, { symbolName: symbolName, kind: getUmdImportKind(compilerOptions) })); + return undefined; } function getUmdImportKind(compilerOptions) { // Import a synthetic `default` if enabled. @@ -93616,33 +95700,61 @@ var ts; throw ts.Debug.assertNever(moduleKind); } } - function getActionsForNonUMDImport(context, allSourceFiles, cancellationToken) { - var sourceFile = context.sourceFile, checker = context.checker, symbolName = context.symbolName, symbolToken = context.symbolToken; + function getActionsForNonUMDImport(context) { + // This will always be an Identifier, since the diagnostics we fix only fail on identifiers. + var sourceFile = context.sourceFile, span = context.span, program = context.program, cancellationToken = context.cancellationToken; + var checker = program.getTypeChecker(); + var symbolToken = ts.getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false); + var isJsxNamespace = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken; + if (!isJsxNamespace && !ts.isIdentifier(symbolToken)) { + return undefined; + } + var symbolName = isJsxNamespace ? checker.getJsxNamespace() : symbolToken.text; + var allSourceFiles = program.getSourceFiles(); + var compilerOptions = program.getCompilerOptions(); // "default" is a keyword and not a legal identifier for the import, so we don't expect it here ts.Debug.assert(symbolName !== "default"); - var symbolIdActionMap = new ImportCodeActionMap(); var currentTokenMeaning = ts.getMeaningFromLocation(symbolToken); + // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. + // Maps symbol id to info for modules providing that symbol (original export + re-exports). + var originalSymbolToExportInfos = ts.createMultiMap(); + function addSymbol(moduleSymbol, exportedSymbol, importKind) { + originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind }); + } forEachExternalModuleToImportFrom(checker, sourceFile, allSourceFiles, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); // check the default export - var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); + var defaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol); if (defaultExport) { var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport); - if ((localSymbol && localSymbol.escapedName === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, context.compilerOptions.target) === symbolName) - && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { - // check if this symbol is already used - var symbolId = ts.getUniqueSymbolId(localSymbol || defaultExport, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 1 /* Default */ }))); + if ((localSymbol && localSymbol.escapedName === symbolName || + getEscapedNameForExportDefault(defaultExport) === symbolName || + moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { + addSymbol(moduleSymbol, localSymbol || defaultExport, 1 /* Default */); } } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - var symbolId = ts.getUniqueSymbolId(exportSymbolWithIdenticalName, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 0 /* Named */ }))); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); + } + function getEscapedNameForExportDefault(symbol) { + return ts.firstDefined(symbol.declarations, function (declaration) { + if (ts.isExportAssignment(declaration)) { + if (ts.isIdentifier(declaration.expression)) { + return declaration.expression.escapedText; + } + } + else if (ts.isExportSpecifier(declaration)) { + ts.Debug.assert(declaration.name.escapedText === "default" /* Default */); + if (declaration.propertyName) { + return declaration.propertyName.escapedText; + } + } + }); } }); - return symbolIdActionMap.getAllActions(); + return ts.arrayFrom(ts.flatMapIterator(originalSymbolToExportInfos.values(), function (exportInfos) { return getCodeActionsForImport(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName)); })); } function checkSymbolHasMeaning(_a, meaning) { var declarations = _a.declarations; @@ -93668,7 +95780,6 @@ var ts; } } } - codefix.forEachExternalModule = forEachExternalModule; /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -93707,6 +95818,7 @@ var ts; // Need `|| "_"` to ensure result isn't empty. return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } + codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -93714,19 +95826,49 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "disableJsDiagnostics"; + var errorCodes = ts.mapDefined(Object.keys(ts.Diagnostics), function (key) { + var diag = ts.Diagnostics[key]; + return diag.category === ts.DiagnosticCategory.Error ? diag.code : undefined; + }); codefix.registerCodeFix({ - errorCodes: getApplicableDiagnosticCodes(), - getCodeActions: getDisableJsDiagnosticsCodeActions + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter).change])], + fixId: fixId, + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [ + ts.createTextChange(sourceFile.checkJsDirective ? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter), + ])], + // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. + fixId: undefined, + }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenLines = ts.createMap(); // Only need to add `// @ts-ignore` for a line once. + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + if (err.start !== undefined) { + var _a = getIgnoreCommentLocationForLocation(err.file, err.start, ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options)), lineNumber = _a.lineNumber, change = _a.change; + if (ts.addToSeen(seenLines, lineNumber)) { + changes.push(change); + } + } + }); + }, }); - function getApplicableDiagnosticCodes() { - var allDiagnostcs = ts.Diagnostics; - return Object.keys(allDiagnostcs) - .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) - .map(function (d) { return allDiagnostcs[d].code; }); - } function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { - var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; - var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var lineNumber = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(lineNumber, sourceFile); var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); // First try to see if we can put the '// @ts-ignore' on the previous line. // We need to make sure that we are not in the middle of a string literal or a comment. @@ -93734,45 +95876,13 @@ var ts; // if so, we do not want to separate the node from its comment if we can. if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { var token = ts.getTouchingToken(sourceFile, startPosition, /*includeJsDocComment*/ false); - var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); - if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { - return { - span: { start: startPosition, length: 0 }, - newText: "// @ts-ignore" + newLineCharacter - }; + var tokenLeadingComments = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingComments || !tokenLeadingComments.length || tokenLeadingComments[0].pos >= startPosition) { + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(startPosition, 0, "// @ts-ignore" + newLineCharacter) }; } } // If all fails, add an extra new line immediately before the error span. - return { - span: { start: position, length: 0 }, - newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter - }; - } - function getDisableJsDiagnosticsCodeActions(context) { - var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; - if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { - return undefined; - } - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] - }] - }, - { - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { - start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, - length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 - }, - newText: "// @ts-nocheck" + newLineCharacter - }] - }] - }]; + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(position, 0, (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter) }; } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -93781,80 +95891,49 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function newNodesToChanges(newNodes, insertAfter, context) { - var sourceFile = context.sourceFile; - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { - var newNode = newNodes_1[_i]; - changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); - } - var changes = changeTracker.getChanges(); - if (!ts.some(changes)) { - return changes; - } - ts.Debug.assert(changes.length === 1); - var consolidatedChanges = [{ - fileName: changes[0].fileName, - textChanges: [{ - span: changes[0].textChanges[0].span, - newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") - }] - }]; - return consolidatedChanges; - } - codefix.newNodesToChanges = newNodesToChanges; /** * Finds members of the resolved type that are missing in the class pointed to by class decl * and generates source code for the missing members. * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. * @returns Empty string iff there are no member insertions. */ - function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker, out) { var classMembers = classDeclaration.symbol.members; - var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.escapedName); }); - var newNodes = []; - for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { - var symbol = missingMembers_1[_i]; - var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); - if (newNode) { - if (Array.isArray(newNode)) { - newNodes = newNodes.concat(newNode); - } - else { - newNodes.push(newNode); - } + for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) { + var symbol = possiblyMissingSymbols_1[_i]; + if (!classMembers.has(symbol.escapedName)) { + addNewNodeForMemberSymbol(symbol, classDeclaration, checker, out); } } - return newNodes; } codefix.createMissingMemberNodes = createMissingMemberNodes; /** * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. */ - function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker, out) { var declarations = symbol.getDeclarations(); if (!(declarations && declarations.length)) { return undefined; } var declaration = declarations[0]; // Clone name to remove leading trivia. - var name = ts.getSynthesizedClone(ts.getNameOfDeclaration(declaration)); + var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration)); var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); var optional = !!(symbol.flags & 16777216 /* Optional */); switch (declaration.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 149 /* PropertySignature */: - case 150 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 150 /* PropertySignature */: + case 151 /* PropertyDeclaration */: var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); - var property = ts.createProperty( + out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeNode, - /*initializer*/ undefined); - return property; - case 151 /* MethodSignature */: - case 152 /* MethodDeclaration */: + /*initializer*/ undefined)); + break; + case 152 /* MethodSignature */: + case 153 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -93864,70 +95943,65 @@ var ts; // correspondence of declarations and signatures. var signatures = checker.getSignaturesOfType(type, 0 /* Call */); if (!ts.some(signatures)) { - return undefined; + break; } if (declarations.length === 1) { ts.Debug.assert(signatures.length === 1); var signature = signatures[0]; - return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + outputMethod(signature, modifiers, name, createStubbedMethodBody()); + break; } - var signatureDeclarations = []; for (var _i = 0, signatures_8 = signatures; _i < signatures_8.length; _i++) { var signature = signatures_8[_i]; - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + // Need to ensure nodes are fresh each time so they can have different positions. + outputMethod(signature, getSynthesizedDeepClones(modifiers), ts.getSynthesizedDeepClone(name)); } if (declarations.length > signatures.length) { var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + outputMethod(signature, modifiers, name, createStubbedMethodBody()); } else { ts.Debug.assert(declarations.length === signatures.length); - var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); - signatureDeclarations.push(methodImplementingSignatures); + out(createMethodImplementingSignatures(signatures, name, optional, modifiers)); } - return signatureDeclarations; - default: - return undefined; + break; } - function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 152 /* MethodDeclaration */, enclosingDeclaration, ts.NodeBuilderFlags.SuppressAnyReturnType); - if (signatureDeclaration) { - signatureDeclaration.decorators = undefined; - signatureDeclaration.modifiers = modifiers; - signatureDeclaration.name = name; - signatureDeclaration.questionToken = optional ? ts.createToken(55 /* QuestionToken */) : undefined; - signatureDeclaration.body = body; - } - return signatureDeclaration; + function outputMethod(signature, modifiers, name, body) { + var method = signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body); + if (method) + out(method); } } - function createMethodFromCallExpression(callExpression, methodName, includeTypeScriptSyntax, makeStatic) { - var parameters = createDummyParameters(callExpression.arguments.length, /*names*/ undefined, /*minArgumentCount*/ undefined, includeTypeScriptSyntax); - var typeParameters; - if (includeTypeScriptSyntax) { - var typeArgCount = ts.length(callExpression.typeArguments); - for (var i = 0; i < typeArgCount; i++) { - var name = typeArgCount < 8 ? String.fromCharCode(84 /* T */ + i) : "T" + i; - var typeParameter = ts.createTypeParameterDeclaration(name, /*constraint*/ undefined, /*defaultType*/ undefined); - (typeParameters ? typeParameters : typeParameters = []).push(typeParameter); - } + function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 153 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); + if (!signatureDeclaration) { + return undefined; } - var newMethod = ts.createMethod( + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(55 /* QuestionToken */) : undefined; + signatureDeclaration.body = body; + return signatureDeclaration; + } + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(ts.getSynthesizedDeepClone)); + } + function createMethodFromCallExpression(_a, methodName, inJs, makeStatic) { + var typeArguments = _a.typeArguments, args = _a.arguments; + return ts.createMethod( /*decorators*/ undefined, /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, /*asteriskToken*/ undefined, methodName, - /*questionToken*/ undefined, typeParameters, parameters, - /*type*/ includeTypeScriptSyntax ? ts.createKeywordTypeNode(119 /* AnyKeyword */) : undefined, createStubbedMethodBody()); - return newMethod; + /*questionToken*/ undefined, + /*typeParameters*/ inJs ? undefined : ts.map(typeArguments, function (_, i) { + return ts.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i); + }), + /*parameters*/ createDummyParameters(args.length, /*names*/ undefined, /*minArgumentCount*/ undefined, inJs), + /*type*/ inJs ? undefined : ts.createKeywordTypeNode(119 /* AnyKeyword */), createStubbedMethodBody()); } codefix.createMethodFromCallExpression = createMethodFromCallExpression; - function createDummyParameters(argCount, names, minArgumentCount, addAnyType) { + function createDummyParameters(argCount, names, minArgumentCount, inJs) { var parameters = []; for (var i = 0; i < argCount; i++) { var newParameter = ts.createParameter( @@ -93936,7 +96010,7 @@ var ts; /*dotDotDotToken*/ undefined, /*name*/ names && names[i] || "arg" + i, /*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.createToken(55 /* QuestionToken */) : undefined, - /*type*/ addAnyType ? ts.createKeywordTypeNode(119 /* AnyKeyword */) : undefined, + /*type*/ inJs ? undefined : ts.createKeywordTypeNode(119 /* AnyKeyword */), /*initializer*/ undefined); parameters.push(newParameter); } @@ -93962,7 +96036,7 @@ var ts; } var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.name; }); - var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*addAnyType*/ true); + var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*inJs*/ false); if (someSigHasRestParameter) { var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(119 /* AnyKeyword */)); var restParameter = ts.createParameter( @@ -93981,7 +96055,6 @@ var ts; /*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); } - codefix.createStubbedMethod = createStubbedMethod; function createStubbedMethodBody() { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.")]))], @@ -94003,228 +96076,237 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "inferFromUsage"; + var errorCodes = [ + // Variable declarations + ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, + // Variable uses + ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, + // Parameter declarations + ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, + ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, + // Get Accessor declarations + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, + ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, + // Set Accessor declarations + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, + // Property declarations + ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, + ]; codefix.registerCodeFix({ - errorCodes: [ - // Variable declarations - ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, - // Variable uses - ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, - // Parameter declarations - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, - // Get Accessor declarations - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, - ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, - // Set Accessor declarations - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, - // Property declarations - ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, - ], - getCodeActions: getActionsForAddExplicitTypeAnnotation + errorCodes: errorCodes, + getCodeActions: function (_a) { + var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; + if (ts.isSourceFileJavaScript(sourceFile)) { + return undefined; // TODO: GH#20113 + } + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var fix = getFix(sourceFile, token, errorCode, program, cancellationToken); + if (!fix) + return undefined; + var declaration = fix.declaration, textChanges = fix.textChanges; + var name = ts.getNameOfDeclaration(declaration); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name.getText()]); + return [{ description: description, changes: [{ fileName: sourceFile.fileName, textChanges: textChanges }], fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken; + var seenFunctions = ts.createMap(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var fix = getFix(sourceFile, ts.getTokenAtPosition(err.file, err.start, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions); + if (fix) + changes.push.apply(changes, fix.textChanges); + }); + }, }); - function getActionsForAddExplicitTypeAnnotation(_a) { - var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var writer; - if (ts.isInJavaScriptFile(token)) { + function getDiagnostic(errorCode, token) { + switch (errorCode) { + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + return ts.isSetAccessor(ts.getContainingFunction(token)) ? ts.Diagnostics.Infer_type_of_0_from_usage : ts.Diagnostics.Infer_parameter_types_from_usage; + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return ts.Diagnostics.Infer_parameter_types_from_usage; + default: + return ts.Diagnostics.Infer_type_of_0_from_usage; + } + } + function getFix(sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { + if (!isAllowedTokenKind(token.kind)) { return undefined; } - switch (token.kind) { + switch (errorCode) { + // Variable and Property declarations + case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: + case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: + return getCodeActionForVariableDeclaration(token.parent, program, cancellationToken); + case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: { + var symbol = program.getTypeChecker().getSymbolAtLocation(token); + return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration, program, cancellationToken); + } + } + var containingFunction = ts.getContainingFunction(token); + if (containingFunction === undefined) { + return undefined; + } + switch (errorCode) { + // Parameter declarations + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + if (ts.isSetAccessor(containingFunction)) { + return getCodeActionForSetAccessor(containingFunction, program, cancellationToken); + } + // falls through + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return !seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction)) + ? getCodeActionForParameters(ts.cast(token.parent, ts.isParameter), containingFunction, sourceFile, program, cancellationToken) + : undefined; + // Get Accessor declarations + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: + case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: + return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + // Set Accessor declarations + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: + return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, program, cancellationToken) : undefined; + default: + throw ts.Debug.fail(String(errorCode)); + } + } + function isAllowedTokenKind(kind) { + switch (kind) { case 71 /* Identifier */: case 24 /* DotDotDotToken */: case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: - // Allowed - break; + case 132 /* ReadonlyKeyword */: + return true; default: - return undefined; + return false; } - var containingFunction = ts.getContainingFunction(token); - var checker = program.getTypeChecker(); - switch (errorCode) { - // Variable and Property declarations - case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: - case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: - return getCodeActionForVariableDeclaration(token.parent); - case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: - return getCodeActionForVariableUsage(token); - // Parameter declarations - case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: - if (ts.isSetAccessor(containingFunction)) { - return getCodeActionForSetAccessor(containingFunction); - } - // falls through - case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - return getCodeActionForParameters(token.parent); - // Get Accessor declarations - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: - case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: - return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction) : undefined; - // Set Accessor declarations - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: - return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction) : undefined; + } + function getCodeActionForVariableDeclaration(declaration, program, cancellationToken) { + if (!ts.isIdentifier(declaration.name)) + return undefined; + var type = inferTypeForVariableFromUsage(declaration.name, program, cancellationToken); + return makeFix(declaration, declaration.name.getEnd(), type, program); + } + function isApplicableFunctionForInference(declaration) { + switch (declaration.kind) { + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + return true; + case 190 /* FunctionExpression */: + return !!declaration.name; } - return undefined; - function getCodeActionForVariableDeclaration(declaration) { - if (!ts.isIdentifier(declaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(declaration.name); - var typeString = type && typeToString(type, declaration); - if (!typeString) { - return undefined; - } - return createCodeActions(declaration.name.getText(), declaration.name.getEnd(), ": " + typeString); - } - function getCodeActionForVariableUsage(token) { - var symbol = checker.getSymbolAtLocation(token); - return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration); - } - function isApplicableFunctionForInference(declaration) { - switch (declaration.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - return true; - case 187 /* FunctionExpression */: - return !!declaration.name; - } - return false; - } - function getCodeActionForParameters(parameterDeclaration) { - if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { - return undefined; - } - var types = inferTypeForParametersFromUsage(containingFunction) || - ts.map(containingFunction.parameters, function (p) { return ts.isIdentifier(p.name) && inferTypeForVariableFromUsage(p.name); }); - if (!types) { - return undefined; - } - var textChanges = ts.zipWith(containingFunction.parameters, types, function (parameter, type) { - if (type && !parameter.type && !parameter.initializer) { - var typeString = typeToString(type, containingFunction); - return typeString ? { - span: { start: parameter.end, length: 0 }, - newText: ": " + typeString - } : undefined; - } - }).filter(function (c) { return !!c; }); - return textChanges.length ? [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_parameter_types_from_usage), [parameterDeclaration.name.getText()]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: textChanges - }] - }] : undefined; - } - function getCodeActionForSetAccessor(setAccessorDeclaration) { - var setAccessorParameter = setAccessorDeclaration.parameters[0]; - if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name) || - inferTypeForVariableFromUsage(setAccessorParameter.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - return createCodeActions(setAccessorDeclaration.name.getText(), setAccessorParameter.name.getEnd(), ": " + typeString); - } - function getCodeActionForGetAccessor(getAccessorDeclaration) { - if (!ts.isIdentifier(getAccessorDeclaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - var closeParenToken = getFirstChildOfKind(getAccessorDeclaration, sourceFile, 20 /* CloseParenToken */); - return createCodeActions(getAccessorDeclaration.name.getText(), closeParenToken.getEnd(), ": " + typeString); - } - function createCodeActions(name, start, typeString) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_type_of_0_from_usage), [name]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: start, length: 0 }, - newText: typeString - }] - }] - }]; - } - function getReferences(token) { - var references = ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), token.getSourceFile(), token.getStart()); - ts.Debug.assert(!!references, "Found no references!"); - ts.Debug.assert(references.length === 1, "Found more references than expected"); - return ts.map(references[0].references, function (r) { return ts.getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false); }); - } - function inferTypeForVariableFromUsage(token) { - return InferFromReference.inferTypeFromReferences(getReferences(token), checker, cancellationToken); - } - function inferTypeForParametersFromUsage(containingFunction) { - switch (containingFunction.kind) { - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - var isConstructor = containingFunction.kind === 153 /* Constructor */; - var searchToken = isConstructor ? - getFirstChildOfKind(containingFunction, sourceFile, 123 /* ConstructorKeyword */) : - containingFunction.name; - if (searchToken) { - return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken), containingFunction, checker, cancellationToken); - } - } - } - function getTypeAccessiblityWriter() { - if (!writer) { - var str_1 = ""; - var typeIsAccessible_1 = true; - var writeText = function (text) { return str_1 += text; }; - writer = { - string: function () { return typeIsAccessible_1 ? str_1 : undefined; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeProperty: writeText, - writeSymbol: writeText, - writeLine: function () { return str_1 += " "; }, - increaseIndent: ts.noop, - decreaseIndent: ts.noop, - clear: function () { str_1 = ""; typeIsAccessible_1 = true; }, - trackSymbol: function (symbol, declaration, meaning) { - if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { - typeIsAccessible_1 = false; - } - }, - reportInaccessibleThisError: function () { typeIsAccessible_1 = false; }, - reportPrivateInBaseOfClassExpression: function () { typeIsAccessible_1 = false; }, - reportInaccessibleUniqueSymbolError: function () { typeIsAccessible_1 = false; } - }; - } - writer.clear(); - return writer; - } - function typeToString(type, enclosingDeclaration) { - var writer = getTypeAccessiblityWriter(); - checker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration); - return writer.string(); - } - function getFirstChildOfKind(node, sourcefile, kind) { - for (var _i = 0, _a = node.getChildren(sourcefile); _i < _a.length; _i++) { - var child = _a[_i]; - if (child.kind === kind) - return child; - } + return false; + } + function getCodeActionForParameters(parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { return undefined; } + var types = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) || + containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : undefined; }); + if (!types) + return undefined; + // We didn't actually find a set of type inference positions matching each parameter position + if (containingFunction.parameters.length !== types.length) { + return undefined; + } + var textChanges = ts.arrayFrom(ts.mapDefinedIterator(ts.zipToIterator(containingFunction.parameters, types), function (_a) { + var parameter = _a[0], type = _a[1]; + return type && !parameter.type && !parameter.initializer ? makeChange(containingFunction, parameter.end, type, program) : undefined; + })); + return textChanges.length ? { declaration: parameterDeclaration, textChanges: textChanges } : undefined; + } + function getCodeActionForSetAccessor(setAccessorDeclaration, program, cancellationToken) { + var setAccessorParameter = setAccessorDeclaration.parameters[0]; + if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken) || + inferTypeForVariableFromUsage(setAccessorParameter.name, program, cancellationToken); + return makeFix(setAccessorParameter, setAccessorParameter.name.getEnd(), type, program); + } + function getCodeActionForGetAccessor(getAccessorDeclaration, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(getAccessorDeclaration.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name, program, cancellationToken); + var closeParenToken = ts.findChildOfKind(getAccessorDeclaration, 20 /* CloseParenToken */, sourceFile); + return makeFix(getAccessorDeclaration, closeParenToken.getEnd(), type, program); + } + function makeFix(declaration, start, type, program) { + return type && { declaration: declaration, textChanges: [makeChange(declaration, start, type, program)] }; + } + function makeChange(declaration, start, type, program) { + var typeString = type && typeToString(type, declaration, program.getTypeChecker()); + return typeString === undefined ? undefined : ts.createTextChangeFromStartLength(start, 0, ": " + typeString); + } + function getReferences(token, program, cancellationToken) { + // Position shouldn't matter since token is not a SourceFile. + return ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function (entry) { + return entry.type === "node" ? ts.tryCast(entry.node, ts.isIdentifier) : undefined; + }); + } + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + return InferFromReference.inferTypeFromReferences(getReferences(token, program, cancellationToken), program.getTypeChecker(), cancellationToken); + } + function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) { + switch (containingFunction.kind) { + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + var isConstructor = containingFunction.kind === 154 /* Constructor */; + var searchToken = isConstructor ? + ts.findChildOfKind(containingFunction, 123 /* ConstructorKeyword */, sourceFile) : + containingFunction.name; + if (searchToken) { + return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); + } + } + } + function getTypeAccessiblityWriter(checker) { + var str = ""; + var typeIsAccessible = true; + var writeText = function (text) { return str += text; }; + return { + getText: function () { return typeIsAccessible ? str : undefined; }, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: writeText, + write: writeText, + writeTextOfNode: writeText, + rawWrite: writeText, + writeLiteral: writeText, + getTextPos: function () { return 0; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + writeLine: function () { return writeText(" "); }, + increaseIndent: ts.noop, + decreaseIndent: ts.noop, + clear: function () { str = ""; typeIsAccessible = true; }, + trackSymbol: function (symbol, declaration, meaning) { + if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { + typeIsAccessible = false; + } + }, + reportInaccessibleThisError: function () { typeIsAccessible = false; }, + reportPrivateInBaseOfClassExpression: function () { typeIsAccessible = false; }, + reportInaccessibleUniqueSymbolError: function () { typeIsAccessible = false; } + }; + } + function typeToString(type, enclosingDeclaration, checker) { + var writer = getTypeAccessiblityWriter(checker); + checker.writeType(type, enclosingDeclaration, /*flags*/ undefined, writer); + return writer.getText(); } var InferFromReference; (function (InferFromReference) { @@ -94239,40 +96321,43 @@ var ts; } InferFromReference.inferTypeFromReferences = inferTypeFromReferences; function inferTypeForParametersFromReferences(references, declaration, checker, cancellationToken) { - if (declaration.parameters) { - var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; - cancellationToken.throwIfCancellationRequested(); - inferTypeFromContext(reference, checker, usageContext); - } - var isConstructor = declaration.kind === 153 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - if (callContexts) { - var paramTypes = []; - for (var parameterIndex = 0; parameterIndex < declaration.parameters.length; parameterIndex++) { - var types = []; - var isRestParameter_1 = ts.isRestParameter(declaration.parameters[parameterIndex]); - for (var _a = 0, callContexts_1 = callContexts; _a < callContexts_1.length; _a++) { - var callContext = callContexts_1[_a]; - if (callContext.argumentTypes.length > parameterIndex) { - if (isRestParameter_1) { - types = ts.concatenate(types, ts.map(callContext.argumentTypes.slice(parameterIndex), function (a) { return checker.getBaseTypeOfLiteralType(a); })); - } - else { - types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); - } - } - } - if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); - paramTypes[parameterIndex] = isRestParameter_1 ? checker.createArrayType(type) : type; + if (references.length === 0) { + return undefined; + } + if (!declaration.parameters) { + return undefined; + } + var usageContext = {}; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + var isConstructor = declaration.kind === 154 /* Constructor */; + var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; + return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var types = []; + var isRestParameter = ts.isRestParameter(parameter); + for (var _i = 0, callContexts_1 = callContexts; _i < callContexts_1.length; _i++) { + var callContext = callContexts_1[_i]; + if (callContext.argumentTypes.length <= parameterIndex) { + continue; + } + if (isRestParameter) { + for (var i = parameterIndex; i < callContext.argumentTypes.length; i++) { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); } } - return paramTypes; + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } } - } - return undefined; + if (!types.length) { + return undefined; + } + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); + return isRestParameter ? checker.createArrayType(type) : type; + }); } InferFromReference.inferTypeForParametersFromReferences = inferTypeForParametersFromReferences; function inferTypeFromContext(node, checker, usageContext) { @@ -94280,21 +96365,21 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: usageContext.isNumber = true; break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); break; - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpressionContext(node.parent, checker, usageContext); } @@ -94302,10 +96387,10 @@ var ts; inferTypeFromContextualType(node, checker, usageContext); } break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); break; default: @@ -94405,7 +96490,7 @@ var ts; // LogicalOperator case 54 /* BarBarToken */: if (node === parent.left && - (node.parent.parent.kind === 227 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 230 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); @@ -94433,7 +96518,7 @@ var ts; } } inferTypeFromContext(parent, checker, callContext.returnType); - if (parent.kind === 182 /* CallExpression */) { + if (parent.kind === 185 /* CallExpression */) { (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); } else { @@ -94477,12 +96562,12 @@ var ts; return checker.getStringType(); } else if (usageContext.candidateTypes) { - return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), /*subtypeReduction*/ true)); + return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), 2 /* Subtype */)); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, /*isRestParameter*/ false, checker); var types = paramType.getCallSignatures().map(function (c) { return c.getReturnType(); }); - return checker.createPromiseType(types.length ? checker.getUnionType(types, /*subtypeReduction*/ true) : checker.getAnyType()); + return checker.createPromiseType(types.length ? checker.getUnionType(types, 2 /* Subtype */) : checker.getAnyType()); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("push"))) { return checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, /*isRestParameter*/ false, checker)); @@ -94540,7 +96625,7 @@ var ts; } } if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); return isRestParameter ? checker.createArrayType(type) : type; } return undefined; @@ -94566,6 +96651,84 @@ var ts; })(InferFromReference || (InferFromReference = {})); })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime.code], + getCodeActions: getActionsForInvalidImport + }); + function getActionsForInvalidImport(context) { + var sourceFile = context.sourceFile; + // This is the whole import statement, eg: + // import * as Bluebird from 'bluebird'; + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false).parent; + if (!ts.isImportDeclaration(node)) { + // No import quick fix for import calls + return []; + } + return getCodeFixesForImportDeclaration(context, node); + } + function getCodeFixesForImportDeclaration(context, node) { + var sourceFile = ts.getSourceFileOfNode(node); + var namespace = ts.getNamespaceDeclarationNode(node); + var opts = context.program.getCompilerOptions(); + var variations = []; + // import Bluebird from "bluebird"; + variations.push(createAction(context, sourceFile, node, ts.createImportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createImportClause(namespace.name, /*namedBindings*/ undefined), node.moduleSpecifier))); + if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) { + // import Bluebird = require("bluebird"); + variations.push(createAction(context, sourceFile, node, ts.createImportEqualsDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)))); + } + return variations; + } + function createAction(context, sourceFile, node, replacement) { + // TODO: GH#21246 Should be able to use `replaceNode`, but be sure to preserve comments (see `codeFixCalledES2015Import11.ts`) + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceRange(sourceFile, { pos: node.getStart(), end: node.end }, replacement); }); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), + changes: changes, + }; + } + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code, + ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature.code, + ], + getCodeActions: getActionsForUsageOfInvalidImport + }); + function getActionsForUsageOfInvalidImport(context) { + var sourceFile = context.sourceFile; + var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 185 /* CallExpression */ : 186 /* NewExpression */; + var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); }); + if (!node) { + return []; + } + var expr = node.expression; + var type = context.program.getTypeChecker().getTypeAtLocation(expr); + if (!(type.symbol && type.symbol.originatingImport)) { + return []; + } + var fixes = []; + var relatedImport = type.symbol.originatingImport; + if (!ts.isImportCall(relatedImport)) { + ts.addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport)); + } + fixes.push({ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Use_synthetic_default_member), + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, expr, ts.createPropertyAccess(expr, "default"), {}); }), + }); + return fixes; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); /// /// /// @@ -94579,10 +96742,12 @@ var ts; /// /// /// +/// /// /// /// /// +/// /* @internal */ var ts; (function (ts) { @@ -94590,14 +96755,10 @@ var ts; (function (refactor) { var annotateWithTypeFromJSDoc; (function (annotateWithTypeFromJSDoc) { + var refactorName = "Annotate with type from JSDoc"; var actionName = "annotate"; - var annotateTypeFromJSDoc = { - name: "Annotate with type from JSDoc", - description: ts.Diagnostics.Annotate_with_type_from_JSDoc.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(annotateTypeFromJSDoc); + var description = ts.Diagnostics.Annotate_with_type_from_JSDoc.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.isInJavaScriptFile(context.file)) { return undefined; @@ -94605,11 +96766,11 @@ var ts; var node = ts.getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false); if (hasUsableJSDoc(ts.findAncestor(node, isDeclarationWithType))) { return [{ - name: annotateTypeFromJSDoc.name, - description: annotateTypeFromJSDoc.description, + name: refactorName, + description: description, actions: [ { - description: annotateTypeFromJSDoc.description, + description: description, name: actionName } ] @@ -94636,7 +96797,7 @@ var ts; } var jsdocType = ts.getJSDocType(decl); var isFunctionWithJSDoc = ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); })); - if (isFunctionWithJSDoc || jsdocType && decl.kind === 147 /* Parameter */) { + if (isFunctionWithJSDoc || jsdocType && decl.kind === 148 /* Parameter */) { return getEditsForFunctionAnnotation(context); } else if (jsdocType) { @@ -94657,7 +96818,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var declarationWithType = addType(decl, transformJSDocType(jsdocType)); ts.suppressLeadingAndTrailingTrivia(declarationWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, declarationWithType); + changeTracker.replaceNode(sourceFile, decl, declarationWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -94671,7 +96832,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var functionWithType = addTypesToFunctionLike(decl); ts.suppressLeadingAndTrailingTrivia(functionWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, functionWithType); + changeTracker.replaceNode(sourceFile, decl, functionWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -94680,29 +96841,29 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 227 /* VariableDeclaration */ || - node.kind === 147 /* Parameter */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 230 /* VariableDeclaration */ || + node.kind === 148 /* Parameter */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 151 /* PropertyDeclaration */; } function addTypesToFunctionLike(decl) { var typeParameters = ts.getEffectiveTypeParameterDeclarations(decl, /*checkJSDoc*/ true); var parameters = decl.parameters.map(function (p) { return ts.createParameter(p.decorators, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, transformJSDocType(ts.getEffectiveTypeAnnotationNode(p, /*checkJSDoc*/ true)), p.initializer); }); var returnType = transformJSDocType(ts.getEffectiveReturnTypeNode(decl, /*checkJSDoc*/ true)); switch (decl.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.createFunctionDeclaration(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.createMethod(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, decl.questionToken, typeParameters, parameters, returnType, decl.body); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.createGetAccessor(decl.decorators, decl.modifiers, decl.name, decl.parameters, returnType, decl.body); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.createSetAccessor(decl.decorators, decl.modifiers, decl.name, parameters, decl.body); default: return ts.Debug.assertNever(decl, "Unexpected SyntaxKind: " + decl.kind); @@ -94710,11 +96871,11 @@ var ts; } function addType(decl, jsdocType) { switch (decl.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.createVariableDeclaration(decl.name, jsdocType, decl.initializer); - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.createPropertySignature(decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); default: return ts.Debug.fail("Unexpected SyntaxKind: " + decl.kind); @@ -94725,22 +96886,22 @@ var ts; return undefined; } switch (node.kind) { - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return transformJSDocParameter(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); @@ -94763,7 +96924,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 278 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + var isRest = node.type.kind === 281 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(24 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -94803,8 +96964,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -94819,15 +96980,11 @@ var ts; var refactor; (function (refactor) { var convertFunctionToES6Class; - (function (convertFunctionToES6Class_1) { + (function (convertFunctionToES6Class) { + var refactorName = "Convert to ES2015 class"; var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); + var description = ts.Diagnostics.Convert_function_to_an_ES2015_class.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (!ts.isInJavaScriptFile(context.file)) { return undefined; @@ -94842,11 +96999,11 @@ var ts; if ((symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { return [ { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, + name: refactorName, + description: description, actions: [ { - description: convertFunctionToES6Class.description, + description: description, name: actionName } ] @@ -94861,7 +97018,6 @@ var ts; } var sourceFile = context.file; var ctorSymbol = getConstructorSymbol(context); - var newLine = context.formatContext.options.newLineCharacter; var deletedNodes = []; var deletes = []; if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { @@ -94872,12 +97028,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: precedingNode = ctorDeclaration; deleteNode(ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; if (ctorDeclaration.parent.declarations.length === 1) { deleteNode(precedingNode); @@ -94892,7 +97048,7 @@ var ts; return undefined; } // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { var deleteCallback = deletes_1[_i]; deleteCallback(); @@ -94953,7 +97109,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 211 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 214 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; deleteNode(nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -94961,7 +97117,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 187 /* FunctionExpression */: { + case 190 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -94969,17 +97125,16 @@ var ts; copyComments(assignmentBinaryExpression, method); return method; } - case 188 /* ArrowFunction */: { + case 191 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 208 /* Block */) { + if (arrowFunctionBody.kind === 211 /* Block */) { bodyBlock = arrowFunctionBody; } else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + bodyBlock = ts.createBlock([ts.createReturn(arrowFunctionBody)]); } var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -95017,7 +97172,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 187 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 190 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 71 /* Identifier */) { @@ -95057,6 +97212,496 @@ var ts; })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var refactor; + (function (refactor) { + var actionName = "Convert to ES6 module"; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); + function getAvailableActions(context) { + var file = context.file, startPosition = context.startPosition; + if (!ts.isSourceFileJavaScript(file) || !file.commonJsModuleIndicator) { + return undefined; + } + var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); + return !isAtTriggerLocation(file, node) ? undefined : [ + { + name: actionName, + description: description, + actions: [ + { + description: description, + name: actionName, + }, + ], + }, + ]; + } + function isAtTriggerLocation(sourceFile, node, onSecondTry) { + if (onSecondTry === void 0) { onSecondTry = false; } + switch (node.kind) { + case 185 /* CallExpression */: + return isAtTopLevelRequire(node); + case 183 /* PropertyAccessExpression */: + return ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression); + case 231 /* VariableDeclarationList */: + return isVariableDeclarationTriggerLocation(ts.firstOrUndefined(node.declarations)); + case 230 /* VariableDeclaration */: + return isVariableDeclarationTriggerLocation(node); + default: + return ts.isExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, /*onSecondTry*/ true); + } + function isVariableDeclarationTriggerLocation(decl) { + return !!decl && !!decl.initializer && ts.isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); + } + } + function isAtTopLevelRequire(call) { + if (!ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ true)) { + return false; + } + var propAccess = call.parent; + var varDecl = ts.isPropertyAccessExpression(propAccess) ? propAccess.parent : propAccess; + if (ts.isExpressionStatement(varDecl) && ts.isSourceFile(varDecl.parent)) { + return true; + } + if (!ts.isVariableDeclaration(varDecl)) { + return false; + } + var varDeclList = varDecl.parent; + if (varDeclList.kind !== 231 /* VariableDeclarationList */) { + return false; + } + var varStatement = varDeclList.parent; + return varStatement.kind === 212 /* VariableStatement */ && varStatement.parent.kind === 272 /* SourceFile */; + } + function getEditsForAction(context, _actionName) { + ts.Debug.assertEqual(actionName, _actionName); + var file = context.file, program = context.program; + ts.Debug.assert(ts.isSourceFileJavaScript(file)); + var edits = ts.textChanges.ChangeTracker.with(context, function (changes) { + var moduleExportsChangedToDefault = convertFileToEs6Module(file, program.getTypeChecker(), changes, program.getCompilerOptions().target); + if (moduleExportsChangedToDefault) { + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var importingFile = _a[_i]; + fixImportOfModuleExports(importingFile, file, changes); + } + } + }); + return { edits: edits, renameFilename: undefined, renameLocation: undefined }; + } + function fixImportOfModuleExports(importingFile, exportingFile, changes) { + for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + var parent = moduleSpecifier.parent; + switch (parent.kind) { + case 252 /* ExternalModuleReference */: { + var importEq = parent.parent; + changes.replaceNode(importingFile, importEq, makeImport(importEq.name, /*namedImports*/ undefined, moduleSpecifier.text)); + break; + } + case 185 /* CallExpression */: { + var call = parent; + if (ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ false)) { + changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); + } + break; + } + } + } + } + /** @returns Whether we converted a `module.exports =` to a default export. */ + function convertFileToEs6Module(sourceFile, checker, changes, target) { + var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; + var exports = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports, changes); + var moduleExportsChangedToDefault = false; + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + var res = ts.createMap(); + forEachExportReference(sourceFile, function (node) { + var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; + if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) + || checker.resolveName(node.name.text, node, 107455 /* Value */, /*excludeGlobals*/ true))) { + // Unconditionally add an underscore in case `text` is a keyword. + res.set(text, makeUniqueName("_" + text, identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports, changes) { + forEachExportReference(sourceFile, function (node, isAssignmentLhs) { + if (isAssignmentLhs) { + return; + } + var text = node.name.text; + changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { + var parent = node.parent; + cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58 /* EqualsToken */); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { + switch (statement.kind) { + case 212 /* VariableStatement */: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); + return false; + case 214 /* ExpressionStatement */: { + var expression = statement.expression; + switch (expression.kind) { + case 185 /* CallExpression */: { + if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteral*/ true)) { + // For side-effecting require() call, just make a side-effecting import. + changes.replaceNode(sourceFile, statement, makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0].text)); + } + return false; + } + case 198 /* BinaryExpression */: { + var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return operatorToken.kind === 58 /* EqualsToken */ && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); + } + } + } + // falls through + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { + var declarationList = statement.declarationList; + var foundImport = false; + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { + var name = decl.name, initializer = decl.initializer; + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + // `const alias = module.exports;` can be removed. + foundImport = true; + return []; + } + if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); + } + else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); + } + else { + // Move it out to its own variable statement. + return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); + } + }); + if (foundImport) { + // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + } + /** Converts `const name = require("moduleSpecifier").propertyName` */ + function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: { + // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` + var tmp = makeUniqueName(propertyName, identifiers); + return [ + makeSingleImport(tmp, propertyName, moduleSpecifier), + makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + // `const a = require("b").c` --> `import { c as a } from "./b"; + return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; + default: + ts.Debug.assertNever(name); + } + } + function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { + if (!ts.isPropertyAccessExpression(left)) { + return false; + } + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { + // `const alias = module.exports;` or `module.exports = alias;` can be removed. + changes.deleteNode(sourceFile, statement); + } + else { + var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; + var changedToDefaultExport = false; + if (!newNodes) { + (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); + } + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + return changedToDefaultExport; + } + } + else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, statement, left.name, right, changes, exports); + } + return false; + var _a; + } + /** + * Convert `module.exports = { ... }` to individual exports.. + * We can't always do this if the module has interesting members -- then it will be a default export instead. + */ + function tryChangeModuleExportsObject(object) { + return ts.mapAllOrFail(object.properties, function (prop) { + switch (prop.kind) { + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. + case 269 /* ShorthandPropertyAssignment */: + case 270 /* SpreadAssignment */: + return undefined; + case 268 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals(prop.name.text, prop.initializer); + case 153 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(84 /* ExportKeyword */)], prop); + default: + ts.Debug.assertNever(prop); + } + }); + } + function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { + // If "originalKeywordKind" was set, this is e.g. `exports. + var text = propertyName.text; + var rename = exports.get(text); + if (rename !== undefined) { + /* + const _class = 0; + export { _class as class }; + */ + var newNodes = [ + makeConst(/*modifiers*/ undefined, rename, right), + makeExportDeclaration([ts.createExportSpecifier(rename, text)]), + ]; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + else { + changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); + } + } + function convertModuleExportsToExportDefault(exported, checker) { + var modifiers = [ts.createToken(84 /* ExportKeyword */), ts.createToken(79 /* DefaultKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: { + // `module.exports = function f() {}` --> `export default function f() {}` + var fn = exported; + return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; + } + case 203 /* ClassExpression */: { + // `module.exports = class C {}` --> `export default class C {}` + var cls = exported; + return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; + } + case 185 /* CallExpression */: + if (ts.isRequireCall(exported, /*checkArgumentIsStringLiteral*/ true)) { + return convertReExportAll(exported.arguments[0], checker); + } + // falls through + default: + // `module.exports = 0;` --> `export default 0;` + return [[ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, exported)], true]; + } + } + function convertReExportAll(reExported, checker) { + // `module.exports = require("x");` ==> `export * from "x"; export { default } from "x";` + var moduleSpecifier = reExported.text; + var moduleSymbol = checker.getSymbolAtLocation(reExported); + var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; + return exports.has("export=") + ? [[reExportDefault(moduleSpecifier)], true] + : !exports.has("default") + ? [[reExportStar(moduleSpecifier)], false] + // If there's some non-default export, must include both `export *` and `export default`. + : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([ts.createExportSpecifier(/*propertyName*/ undefined, "default")], moduleSpecifier); + } + function convertExportsDotXEquals(name, exported) { + var modifiers = [ts.createToken(84 /* ExportKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: { + var expressionName = exported.name; + if (expressionName && expressionName.text !== name) { + // `exports.f = function g() {}` -> `export const f = function g() {}` + return exportConst(); + } + } + // falls through + case 191 /* ArrowFunction */: + // `exports.f = function() {}` --> `export function f() {}` + return functionExpressionToDeclaration(name, modifiers, exported); + case 203 /* ClassExpression */: + // `exports.C = class {}` --> `export class C {}` + return classExpressionToDeclaration(name, modifiers, exported); + default: + return exportConst(); + } + function exportConst() { + // `exports.x = 0;` --> `export const x = 0;` + return makeConst(modifiers, ts.createIdentifier(name), exported); + } + } + /** + * Converts `const <> = require("x");`. + * Returns nodes that will replace the variable declaration for the commonjs import. + * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. + */ + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: { + var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { + return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) + ? undefined + : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); + }); + if (importSpecifiers) { + return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier)]; + } + } + // falls through -- object destructuring has an interesting pattern and must be a variable declaration + case 179 /* ArrayBindingPattern */: { + /* + import x from "x"; + const [a, b, c] = x; + */ + var tmp = makeUniqueName(ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); + return [ + makeImport(ts.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), + makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); + default: + ts.Debug.assertNever(name); + } + } + /** + * Convert `import x = require("x").` + * Also converts uses like `x.y()` to `y()` and uses a named import. + */ + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { + var nameSymbol = checker.getSymbolAtLocation(name); + // Maps from module property name to name actually used. (The same if there isn't shadowing.) + var namedBindingsNames = ts.createMap(); + // True if there is some non-property use like `x()` or `f(x)`. + var needDefaultImport = false; + for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { + var use = _a[_i]; + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { + // This was a use of a different symbol with the same name, due to shadowing. Ignore. + continue; + } + var parent = use.parent; + if (ts.isPropertyAccessExpression(parent)) { + var expression = parent.expression, propertyName = parent.name.text; + ts.Debug.assert(expression === use); // Else shouldn't have been in `collectIdentifiers` + var idName = namedBindingsNames.get(propertyName); + if (idName === undefined) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + changes.replaceNode(file, parent, ts.createIdentifier(idName)); + } + else { + needDefaultImport = true; + } + } + var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { + var propertyName = _a[0], idName = _a[1]; + return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); + })); + if (!namedBindings) { + // If it was unused, ensure that we at least import *something*. + needDefaultImport = true; + } + return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; + } + // Identifiers helpers + function makeUniqueName(name, identifiers) { + while (identifiers.original.has(name) || identifiers.additional.has(name)) { + name = "_" + name; + } + identifiers.additional.set(name, true); + return name; + } + function collectFreeIdentifiers(file) { + var map = ts.createMultiMap(); + file.forEachChild(function recur(node) { + if (ts.isIdentifier(node) && isFreeIdentifier(node)) { + map.add(node.text, node); + } + node.forEachChild(recur); + }); + return map; + } + function isFreeIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + return parent.name !== node; + case 180 /* BindingElement */: + return parent.propertyName !== node; + default: + return true; + } + } + // Node helpers + function functionExpressionToDeclaration(name, additionalModifiers, fn) { + return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); + } + function classExpressionToDeclaration(name, additionalModifiers, cls) { + return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); + } + function makeSingleImport(localName, propertyName, moduleSpecifier) { + return propertyName === "default" + ? makeImport(ts.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier) + : makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); + } + function makeImport(name, namedImports, moduleSpecifier) { + var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); + return ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifier)); + } + function makeImportSpecifier(propertyName, name) { + return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); + } + function makeConst(modifiers, name, init) { + return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, /*type*/ undefined, init)], 2 /* Const */)); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return ts.createExportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); + } + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); /// /// /* @internal */ @@ -95065,14 +97710,9 @@ var ts; var refactor; (function (refactor) { var extractSymbol; - (function (extractSymbol_1) { - var extractSymbol = { - name: "Extract Symbol", - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_symbol), - getAvailableActions: getAvailableActions, - getEditsForAction: getEditsForAction, - }; - refactor.registerRefactor(extractSymbol); + (function (extractSymbol) { + var refactorName = "Extract Symbol"; + refactor.registerRefactor(refactorName, { getAvailableActions: getAvailableActions, getEditsForAction: getEditsForAction }); /** * Compute the associated code actions * Exported for tests. @@ -95130,21 +97770,21 @@ var ts; var infos = []; if (functionActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_function), actions: functionActions }); } if (constantActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_constant), actions: constantActions }); } return infos.length ? infos : undefined; } - extractSymbol_1.getAvailableActions = getAvailableActions; + extractSymbol.getAvailableActions = getAvailableActions; /* Exported for tests */ function getEditsForAction(context, actionName) { var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: ts.getRefactorContextLength(context) }); @@ -95163,7 +97803,7 @@ var ts; } ts.Debug.fail("Unrecognized action name"); } - extractSymbol_1.getEditsForAction = getEditsForAction; + extractSymbol.getEditsForAction = getEditsForAction; // Move these into diagnostic messages if they become user-facing var Messages; (function (Messages) { @@ -95192,7 +97832,7 @@ var ts; Messages.cannotExtractToOtherFunctionLike = createMessage("Cannot extract method to a function-like scope that is not a function"); Messages.cannotExtractToJSClass = createMessage("Cannot extract constant to a class scope in JS"); Messages.cannotExtractToExpressionArrowFunction = createMessage("Cannot extract constant to an arrow function without a block"); - })(Messages = extractSymbol_1.Messages || (extractSymbol_1.Messages = {})); + })(Messages = extractSymbol.Messages || (extractSymbol.Messages = {})); var RangeFacts; (function (RangeFacts) { RangeFacts[RangeFacts["None"] = 0] = "None"; @@ -95253,6 +97893,14 @@ var ts; break; } } + if (!statements.length) { + // https://github.com/Microsoft/TypeScript/issues/20559 + // Ranges like [|case 1: break;|] will fail to populate `statements` because + // they will never find `start` in `start.parent.statements`. + // Consider: We could support ranges like [|case 1:|] by refining them to just + // the expression. + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] }; + } return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; } if (ts.isReturnStatement(start) && !start.expression) { @@ -95307,20 +97955,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 150 /* PropertyDeclaration */) { + if (current.kind === 151 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 147 /* Parameter */) { + else if (current.kind === 148 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 153 /* Constructor */) { + if (ctorOrMethod.kind === 154 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 152 /* MethodDeclaration */) { + else if (current.kind === 153 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -95337,6 +97985,10 @@ var ts; PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; })(PermittedJumps || (PermittedJumps = {})); + // We believe it's true because the node is from the (unmodified) tree. + ts.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + // For understanding how skipTrivia functioned: + ts.Debug.assert(!ts.positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); if (!ts.isStatement(nodeToCheck) && !(ts.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) { return [ts.createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; } @@ -95359,7 +98011,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 227 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 230 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); return true; @@ -95368,13 +98020,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 97 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 182 /* CallExpression */) { + if (node.parent.kind === 185 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -95389,9 +98041,9 @@ var ts; } if (!node || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - if (node.parent.kind === 269 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + if (node.parent.kind === 272 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } @@ -95402,20 +98054,20 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 212 /* IfStatement */: + case 215 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 208 /* Block */: - if (node.parent && node.parent.kind === 225 /* TryStatement */ && node.parent.finallyBlock === node) { + case 211 /* Block */: + if (node.parent && node.parent.kind === 228 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -95427,11 +98079,11 @@ var ts; break; } switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); @@ -95439,8 +98091,8 @@ var ts; seenLabels.pop(); break; } - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: { var label = node.label; if (label) { @@ -95450,20 +98102,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 219 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 222 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -95479,7 +98131,7 @@ var ts; } } } - extractSymbol_1.getRangeToExtract = getRangeToExtract; + extractSymbol.getRangeToExtract = getRangeToExtract; function getStatementOrExpressionRange(node) { if (ts.isStatement(node)) { return [node]; @@ -95517,7 +98169,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 147 /* Parameter */) { + if (current.kind === 148 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -95528,7 +98180,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 269 /* SourceFile */) { + if (current.kind === 272 /* SourceFile */) { return scopes; } } @@ -95618,33 +98270,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: return scope.name - ? "function expression '" + scope.name.text + "'" - : "anonymous function expression"; - case 229 /* FunctionDeclaration */: - return "function '" + scope.name.text + "'"; - case 188 /* ArrowFunction */: + ? "function '" + scope.name.text + "'" + : "anonymous function"; + case 191 /* ArrowFunction */: return "arrow function"; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return "method '" + scope.name.getText(); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: ts.Debug.assertNever(scope); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 230 /* ClassDeclaration */ - ? "class '" + scope.name.text + "'" + return scope.kind === 233 /* ClassDeclaration */ + ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 235 /* ModuleBlock */ + return scope.kind === 238 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -95682,7 +98333,7 @@ var ts; var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" type = checker.getBaseTypeOfLiteralType(type); - typeNode = checker.typeToTypeNode(type, scope, ts.NodeBuilderFlags.NoTruncation); + typeNode = checker.typeToTypeNode(type, scope, 1 /* NoTruncation */); } var paramDecl = ts.createParameter( /*decorators*/ undefined, @@ -95710,7 +98361,7 @@ var ts; // to avoid problems when there are literal types present if (ts.isExpression(node) && !isJS) { var contextualType = checker.getContextualType(node); - returnType = checker.typeToTypeNode(contextualType, scope, ts.NodeBuilderFlags.NoTruncation); + returnType = checker.typeToTypeNode(contextualType, scope, 1 /* NoTruncation */); } var _b = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)), body = _b.body, returnValueProperty = _b.returnValueProperty; ts.suppressLeadingAndTrailingTrivia(body); @@ -95736,13 +98387,10 @@ var ts; var minInsertionPos = (isReadonlyArray(range.range) ? ts.last(range.range) : range.range).end; var nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope); if (nodeToInsertBefore) { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, /*blankLineBetween*/ true); } else { - changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { - prefix: ts.isLineBreak(file.text.charCodeAt(scope.getLastToken().pos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter, - suffix: context.newLineCharacter - }); + changeTracker.insertNodeAtEndOfScope(context.file, scope, newFunction); } var newNodes = []; // replace range with function call @@ -95781,7 +98429,7 @@ var ts; /*propertyName*/ undefined, /*name*/ ts.getSynthesizedDeepClone(variableDeclaration.name))); // Being returned through an object literal will have widened the type. - var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, ts.NodeBuilderFlags.NoTruncation); + var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, 1 /* NoTruncation */); typeElements.push(ts.createPropertySignature( /*modifiers*/ undefined, /*name*/ variableDeclaration.symbol.name, @@ -95854,10 +98502,12 @@ var ts; newNodes.push(call); } } - var replacementRange = isReadonlyArray(range.range) - ? { pos: ts.first(range.range).getStart(), end: ts.last(range.range).end } - : { pos: range.range.getStart(), end: range.range.end }; - changeTracker.replaceRangeWithNodes(context.file, replacementRange, newNodes, { nodeSeparator: context.newLineCharacter }); + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodeRangeWithNodes(context.file, ts.first(range.range), ts.last(range.range), newNodes); + } + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); + } var edits = changeTracker.getChanges(); var renameRange = isReadonlyArray(range.range) ? ts.first(range.range) : range.range; var renameFilename = renameRange.getSourceFile().fileName; @@ -95872,9 +98522,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 139 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 140 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(139 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(140 /* UndefinedKeyword */)]); } } /** @@ -95888,9 +98538,9 @@ var ts; var file = scope.getSourceFile(); var localNameText = getUniqueName(ts.isClassLike(scope) ? "newProperty" : "newLocal", file.text); var isJS = ts.isInJavaScriptFile(scope); - var variableType = isJS + var variableType = isJS || !checker.isContextSensitive(node) ? undefined - : checker.typeToTypeNode(checker.getContextualType(node), scope, ts.NodeBuilderFlags.NoTruncation); + : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */); var initializer = transformConstantInitializer(node, substitutions); ts.suppressLeadingAndTrailingTrivia(initializer); var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -95901,7 +98551,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(115 /* StaticKeyword */)); } - modifiers.push(ts.createToken(131 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(132 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -95911,9 +98561,9 @@ var ts; // Declare var maxInsertionPos = node.pos; var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true); // Consume - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } else { var newVariableDeclaration = ts.createVariableDeclaration(localNameText, variableType, initializer); @@ -95924,18 +98574,18 @@ var ts; var oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope); if (oldVariableDeclaration) { // Declare - // CONSIDER: could detect that each is on a separate line - changeTracker.insertNodeAt(context.file, oldVariableDeclaration.getStart(), newVariableDeclaration, { suffix: ", " }); + // CONSIDER: could detect that each is on a separate line (See `extractConstant_VariableList_MultipleLines` in `extractConstants.ts`) + changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); // Consume var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } - else if (node.parent.kind === 211 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 214 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)); - changeTracker.replaceRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }, newVariableStatement); + changeTracker.replaceNode(context.file, node.parent, newVariableStatement, ts.textChanges.useNonAdjustedPositions); } else { var newVariableStatement = ts.createVariableStatement( @@ -95943,26 +98593,19 @@ var ts; // Declare var nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope); if (nodeToInsertBefore.pos === 0) { - // If we're at the beginning of the file, we need to take care not to insert before header comments - // (e.g. copyright, triple-slash references). Fortunately, this problem has already been solved - // for imports. - var insertionPos = ts.getSourceFileImportLocation(file); - changeTracker.insertNodeAt(context.file, insertionPos, newVariableStatement, { - prefix: insertionPos === 0 ? undefined : context.newLineCharacter, - suffix: ts.isLineBreak(file.text.charCodeAt(insertionPos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter - }); + changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement, /*blankLineBetween*/ false); } else { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 211 /* ExpressionStatement */) { + if (node.parent.kind === 214 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. - changeTracker.deleteRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }); + changeTracker.deleteNode(context.file, node.parent, ts.textChanges.useNonAdjustedPositions); } else { var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } } } @@ -95993,10 +98636,10 @@ var ts; var delta = 0; var lastPos = -1; for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], fileName = _a.fileName, textChanges_1 = _a.textChanges; + var _a = edits_1[_i], fileName = _a.fileName, textChanges_2 = _a.textChanges; ts.Debug.assert(fileName === renameFilename); - for (var _b = 0, textChanges_2 = textChanges_1; _b < textChanges_2.length; _b++) { - var change = textChanges_2[_b]; + for (var _b = 0, textChanges_3 = textChanges_2; _b < textChanges_3.length; _b++) { + var change = textChanges_3[_b]; var span_15 = change.span, newText = change.newText; var index = newText.indexOf(functionNameText); if (index !== -1) { @@ -96073,7 +98716,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 220 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 223 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -96175,6 +98818,11 @@ var ts; } prevStatement = statement; } + if (!prevStatement && ts.isCaseClause(curr)) { + // We must have been in the expression of the case clause. + ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent)); + return curr.parent.parent; + } // There must be at least one statement since we started in one. ts.Debug.assert(prevStatement !== undefined); return prevStatement; @@ -96248,7 +98896,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 229 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 232 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -96460,7 +99108,8 @@ var ts; return symbolId; } // find first declaration in this file - var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + var decls = symbol.getDeclarations(); + var declInFile = decls && ts.find(decls, function (d) { return d.getSourceFile() === sourceFile; }); if (!declInFile) { return undefined; } @@ -96483,7 +99132,7 @@ var ts; } for (var i = 0; i < scopes.length; i++) { var scope = scopes[i]; - var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags, /*excludeGlobals*/ false); if (resolvedSymbol === symbol) { continue; } @@ -96550,7 +99199,8 @@ var ts; if (!symbol) { return undefined; } - if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + var decls = symbol.getDeclarations(); + if (decls && decls.some(function (d) { return d.parent === scopeDecl; })) { return ts.createIdentifier(symbol.name); } var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); @@ -96585,30 +99235,30 @@ var ts; */ function isExtractableExpression(node) { switch (node.parent.kind) { - case 268 /* EnumMember */: + case 271 /* EnumMember */: return false; } switch (node.kind) { case 9 /* StringLiteral */: - return node.parent.kind !== 239 /* ImportDeclaration */ && - node.parent.kind !== 243 /* ImportSpecifier */; - case 199 /* SpreadElement */: - case 175 /* ObjectBindingPattern */: - case 177 /* BindingElement */: + return node.parent.kind !== 242 /* ImportDeclaration */ && + node.parent.kind !== 246 /* ImportSpecifier */; + case 202 /* SpreadElement */: + case 178 /* ObjectBindingPattern */: + case 180 /* BindingElement */: return false; case 71 /* Identifier */: - return node.parent.kind !== 177 /* BindingElement */ && - node.parent.kind !== 243 /* ImportSpecifier */ && - node.parent.kind !== 247 /* ExportSpecifier */; + return node.parent.kind !== 180 /* BindingElement */ && + node.parent.kind !== 246 /* ImportSpecifier */ && + node.parent.kind !== 250 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 208 /* Block */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: - case 261 /* CaseClause */: + case 211 /* Block */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: + case 264 /* CaseClause */: return true; default: return false; @@ -96623,15 +99273,11 @@ var ts; var refactor; (function (refactor) { var installTypesForPackage; - (function (installTypesForPackage_1) { + (function (installTypesForPackage) { + var refactorName = "Install missing types package"; var actionName = "install"; - var installTypesForPackage = { - name: "Install missing types package", - description: "Install missing types package", - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(installTypesForPackage); + var description = "Install missing types package"; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.getStrictOptionValue(context.program.getCompilerOptions(), "noImplicitAny")) { // Then it will be available via `fixCannotFindModule`. @@ -96640,8 +99286,8 @@ var ts; var action = getAction(context); return action && [ { - name: installTypesForPackage.name, - description: installTypesForPackage.description, + name: refactorName, + description: description, actions: [ { description: action.description, @@ -96678,8 +99324,8 @@ var ts; } function isModuleIdentifier(node) { switch (node.parent.kind) { - case 239 /* ImportDeclaration */: - case 249 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 252 /* ExternalModuleReference */: return true; default: return false; @@ -96696,16 +99342,11 @@ var ts; var installTypesForPackage; (function (installTypesForPackage) { var actionName = "Convert to default import"; - var useDefaultImport = { - name: actionName, - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import), - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(useDefaultImport); + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { var file = context.file, startPosition = context.startPosition, program = context.program; - if (!program.getCompilerOptions().allowSyntheticDefaultImports) { + if (!ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { return undefined; } var importInfo = getConvertibleImportAtPosition(file, startPosition); @@ -96713,17 +99354,17 @@ var ts; return undefined; } var module = ts.getResolvedModule(file, importInfo.moduleSpecifier.text); - var resolvedFile = program.getSourceFile(module.resolvedFileName); - if (!(resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { + var resolvedFile = module && program.getSourceFile(module.resolvedFileName); + if (!(resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { return undefined; } return [ { - name: useDefaultImport.name, - description: useDefaultImport.description, + name: actionName, + description: description, actions: [ { - description: useDefaultImport.description, + description: description, name: actionName, }, ], @@ -96750,21 +99391,21 @@ var ts; var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); while (true) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: var eq = node; var moduleReference = eq.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) + return moduleReference.kind === 252 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) ? { importStatement: eq, name: eq.name, moduleSpecifier: moduleReference.expression } : undefined; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var d = node; var importClause = d.importClause; - return !importClause.name && importClause.namedBindings.kind === 241 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings.kind === 244 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) ? { importStatement: d, name: importClause.namedBindings.name, moduleSpecifier: d.moduleSpecifier } : undefined; // For known child node kinds of convertible imports, try again with parent node. - case 241 /* NamespaceImport */: - case 249 /* ExternalModuleReference */: + case 244 /* NamespaceImport */: + case 252 /* ExternalModuleReference */: case 91 /* ImportKeyword */: case 71 /* Identifier */: case 9 /* StringLiteral */: @@ -96781,6 +99422,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /// /// /// @@ -96799,6 +99441,7 @@ var ts; /// /// /// +/// /// /// /// @@ -96882,6 +99525,9 @@ var ts; var token = ts.scanner.scan(); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { + if (token === 71 /* Identifier */) { + ts.Debug.fail("Did not expect " + ts.Debug.showSyntaxKind(this) + " to have an Identifier in its trivia"); + } nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; @@ -96892,7 +99538,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(290 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(293 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { @@ -96978,8 +99624,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 271 /* FirstJSDocNode */ || kid.kind > 289 /* LastJSDocNode */; }); - return child.kind < 144 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 274 /* FirstJSDocNode */ || kid.kind > 292 /* LastJSDocNode */; }); + return child.kind < 145 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -96990,7 +99636,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 144 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 145 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -97333,13 +99979,13 @@ var ts; function getDeclarationName(declaration) { var name = ts.getNameOfDeclaration(declaration); if (name) { - var result_8 = ts.getTextOfIdentifierOrLiteral(name); - if (result_8 !== undefined) { - return result_8; + var result_6 = ts.getTextOfIdentifierOrLiteral(name); + if (result_6 !== undefined) { + return result_6; } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var expr = name.expression; - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { return expr.name.text; } return ts.getTextOfIdentifierOrLiteral(expr); @@ -97349,10 +99995,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -97372,31 +100018,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 164 /* TypeLiteral */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 165 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: { + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -97407,19 +100053,19 @@ var ts; } } // falls through - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: addDeclaration(node); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -97431,7 +100077,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -97440,7 +100086,7 @@ var ts; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -97620,8 +100266,7 @@ var ts; sourceFile.scriptSnapshot = scriptSnapshot; } function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents, scriptKind) { - var text = scriptSnapshot.getText(0, scriptSnapshot.getLength()); - var sourceFile = ts.createSourceFile(fileName, text, scriptTarget, setNodeParents, scriptKind); + var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTarget, setNodeParents, scriptKind); setSourceFileFields(sourceFile, scriptSnapshot, version); return sourceFile; } @@ -97785,7 +100430,7 @@ var ts; getCancellationToken: function () { return cancellationToken; }, getCanonicalFileName: getCanonicalFileName, useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return ts.getNewLineCharacter(newSettings, { newLine: ts.getNewLineOrDefaultFromHost(host) }); }, + getNewLine: function () { return ts.getNewLineCharacter(newSettings, function () { return ts.getNewLineOrDefaultFromHost(host); }); }, getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, writeFile: ts.noop, getCurrentDirectory: function () { return currentDirectory; }, @@ -97795,10 +100440,11 @@ var ts; var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); var entry = hostCache.getEntryByPath(path); if (entry) { - return ts.isString(entry) ? undefined : entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); } return host.readFile && host.readFile(fileName); }, + realpath: host.realpath && (function (path) { return host.realpath(path); }), directoryExists: function (directoryName) { return ts.directoryProbablyExists(directoryName, host); }, @@ -97937,13 +100583,13 @@ var ts; return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); } function getCompletionsAtPosition(fileName, position, options) { - if (options === void 0) { options = { includeExternalModuleExports: false }; } + if (options === void 0) { options = { includeExternalModuleExports: false, includeInsertTextCompletions: false }; } synchronizeHostData(); return ts.Completions.getCompletionsAtPosition(host, program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, program.getSourceFiles(), options); } function getCompletionEntryDetails(fileName, position, name, formattingOptions, source) { synchronizeHostData(); - return ts.Completions.getCompletionEntryDetails(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); + return ts.Completions.getCompletionEntryDetails(program, log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); } function getCompletionEntrySymbol(fileName, position, name, source) { synchronizeHostData(); @@ -97965,10 +100611,10 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 97 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -98029,44 +100675,24 @@ var ts; } /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { - var results = getOccurrencesAtPositionCore(fileName, position); - if (results) { - var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - // Get occurrences only supports reporting occurrences for the file queried. So - // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); - } - return results; + var canonicalFileName = getCanonicalFileName(ts.normalizeSlashes(fileName)); + return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { + ts.Debug.assert(getCanonicalFileName(ts.normalizeSlashes(entry.fileName)) === canonicalFileName); // Get occurrences only supports reporting occurrences for the file queried. + return { + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, + isDefinition: false, + isInString: highlightSpan.isInString, + }; + }); }); } function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); - var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); }); + var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return ts.Debug.assertDefined(program.getSourceFile(f)); }); var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function getOccurrencesAtPositionCore(fileName, position) { - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - function convertDocumentHighlights(documentHighlights) { - if (!documentHighlights) { - return undefined; - } - var result = []; - for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) { - var entry = documentHighlights_1[_i]; - for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { - var highlightSpan = _b[_a]; - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, - isDefinition: false, - isInString: highlightSpan.isInString, - }); - } - } - return result; - } - } function findRenameLocations(fileName, position, findInStrings, findInComments) { return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } @@ -98130,15 +100756,15 @@ var ts; return; } switch (node.kind) { - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 9 /* StringLiteral */: case 86 /* FalseKeyword */: case 101 /* TrueKeyword */: case 95 /* NullKeyword */: case 97 /* SuperKeyword */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 71 /* Identifier */: break; // Cant create the text span @@ -98155,7 +100781,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 234 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 237 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -98216,47 +100842,20 @@ var ts; var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } + var braceMatching = ts.createMapFromTemplate((_a = {}, + _a[17 /* OpenBraceToken */] = 18 /* CloseBraceToken */, + _a[19 /* OpenParenToken */] = 20 /* CloseParenToken */, + _a[21 /* OpenBracketToken */] = 22 /* CloseBracketToken */, + _a[29 /* GreaterThanToken */] = 27 /* LessThanToken */, + _a)); + braceMatching.forEach(function (value, key) { return braceMatching.set(value.toString(), Number(key)); }); function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var result = []; var token = ts.getTouchingToken(sourceFile, position, /*includeJsDocComment*/ false); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - // Ensure that there is a corresponding token to match ours. - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) { - var current = childNodes_1[_i]; - if (current.kind === matchKind) { - var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - // We want to order the braces when we return the result. - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 17 /* OpenBraceToken */: return 18 /* CloseBraceToken */; - case 19 /* OpenParenToken */: return 20 /* CloseParenToken */; - case 21 /* OpenBracketToken */: return 22 /* CloseBracketToken */; - case 27 /* LessThanToken */: return 29 /* GreaterThanToken */; - case 18 /* CloseBraceToken */: return 17 /* OpenBraceToken */; - case 20 /* CloseParenToken */: return 19 /* OpenParenToken */; - case 22 /* CloseBracketToken */: return 21 /* OpenBracketToken */; - case 29 /* GreaterThanToken */: return 27 /* LessThanToken */; - } - return undefined; - } + var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined; + var match = matchKind && ts.findChildOfKind(token.parent, matchKind, sourceFile); + // We want to order the braces when we return the result. + return match ? [ts.createTextSpanFromNode(token, sourceFile), ts.createTextSpanFromNode(match, sourceFile)].sort(function (a, b) { return a.start - b.start; }) : ts.emptyArray; } function getIndentationAtPosition(fileName, position, editorOptions) { var start = ts.timestamp(); @@ -98296,13 +100895,26 @@ var ts; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = ts.createTextSpanFromBounds(start, end); - var newLineCharacter = ts.getNewLineOrDefaultFromHost(host); var formatContext = ts.formatting.getFormatContext(formatOptions); return ts.flatMap(ts.deduplicate(errorCodes, ts.equateValues, ts.compareValues), function (errorCode) { cancellationToken.throwIfCancellationRequested(); - return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, newLineCharacter: newLineCharacter, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); }); } + function getCombinedCodeFix(scope, fixId, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.codefix.getAllFixes({ fixId: fixId, sourceFile: sourceFile, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + } + function organizeImports(scope, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host); + } function applyCodeActionCommand(fileName, actionOrUndefined) { var action = typeof fileName === "string" ? actionOrUndefined : fileName; return ts.isArray(action) ? Promise.all(action.map(applySingleCodeActionCommand)) : applySingleCodeActionCommand(action); @@ -98419,7 +101031,7 @@ var ts; return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } function getTodoCommentsRegExp() { - // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to + // NOTE: `?:` means 'non-capture group'. It allows us to have groups without having to // filter them out later in the final result array. // TODO comments can appear in one of the following forms: // @@ -98489,7 +101101,6 @@ var ts; startPosition: startPosition, endPosition: endPosition, program: getProgram(), - newLineCharacter: formatOptions ? formatOptions.newLineCharacter : host.getNewLine(), host: host, formatContext: ts.formatting.getFormatContext(formatOptions), cancellationToken: cancellationToken, @@ -98546,7 +101157,9 @@ var ts; isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, + getCombinedCodeFix: getCombinedCodeFix, applyCodeActionCommand: applyCodeActionCommand, + organizeImports: organizeImports, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, getSourceFile: getSourceFile, @@ -98554,6 +101167,7 @@ var ts; getApplicableRefactors: getApplicableRefactors, getEditsForRefactor: getEditsForRefactor, }; + var _a; } ts.createLanguageService = createLanguageService; /* @internal */ @@ -98589,23 +101203,10 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 249 /* ExternalModuleReference */ || + node.parent.kind === 252 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } - function isObjectLiteralElement(node) { - switch (node.kind) { - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return true; - } - return false; - } /** * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } */ @@ -98614,13 +101215,13 @@ var ts; switch (node.kind) { case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 145 /* ComputedPropertyName */) { - return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + if (node.parent.kind === 146 /* ComputedPropertyName */) { + return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 71 /* Identifier */: - return isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 179 /* ObjectLiteralExpression */ || node.parent.parent.kind === 258 /* JsxAttributes */) && + return ts.isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 182 /* ObjectLiteralExpression */ || node.parent.parent.kind === 261 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -98637,20 +101238,20 @@ var ts; function getPropertySymbolsFromType(type, propName) { var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); if (name && type) { - var result_9 = []; + var result_7 = []; var symbol = type.getProperty(name); if (type.flags & 131072 /* Union */) { ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { - result_9.push(symbol); + result_7.push(symbol); } }); - return result_9; + return result_7; } if (symbol) { - result_9.push(symbol); - return result_9; + result_7.push(symbol); + return result_7; } } return undefined; @@ -98659,7 +101260,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 181 /* ElementAccessExpression */ && + node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -98740,18 +101341,6 @@ var ts; Msg["Info"] = "Info"; Msg["Perf"] = "Perf"; })(Msg = server.Msg || (server.Msg = {})); - function getProjectRootPath(project) { - switch (project.projectKind) { - case server.ProjectKind.Configured: - return ts.getDirectoryPath(project.getProjectName()); - case server.ProjectKind.Inferred: - // TODO: fixme - return ""; - case server.ProjectKind.External: - var projectName = ts.normalizeSlashes(project.getProjectName()); - return ts.getDirectoryPath(projectName); - } - } function createInstallTypingsRequest(project, typeAcquisition, unresolvedImports, cachePath) { return { projectName: project.getProjectName(), @@ -98759,7 +101348,7 @@ var ts; compilerOptions: project.getCompilationSettings(), typeAcquisition: typeAcquisition, unresolvedImports: unresolvedImports, - projectRootPath: getProjectRootPath(project), + projectRootPath: project.getCurrentDirectory(), cachePath: cachePath, kind: "discover" }; @@ -98927,17 +101516,6 @@ var ts; return base === "tsconfig.json" || base === "jsconfig.json" ? base : undefined; } server.getBaseConfigFileName = getBaseConfigFileName; - function insertSorted(array, insert, compare) { - if (array.length === 0) { - array.push(insert); - return; - } - var insertIndex = ts.binarySearch(array, insert, ts.identity, compare); - if (insertIndex < 0) { - array.splice(~insertIndex, 0, insert); - } - } - server.insertSorted = insertSorted; function removeSorted(array, remove, compare) { if (!array || array.length === 0) { return; @@ -99088,6 +101666,7 @@ var ts; CommandTypes["SignatureHelp"] = "signatureHelp"; /* @internal */ CommandTypes["SignatureHelpFull"] = "signatureHelp-full"; + CommandTypes["Status"] = "status"; CommandTypes["TypeDefinition"] = "typeDefinition"; CommandTypes["ProjectInfo"] = "projectInfo"; CommandTypes["ReloadProjects"] = "reloadProjects"; @@ -99116,14 +101695,20 @@ var ts; CommandTypes["BreakpointStatement"] = "breakpointStatement"; CommandTypes["CompilerOptionsForInferredProjects"] = "compilerOptionsForInferredProjects"; CommandTypes["GetCodeFixes"] = "getCodeFixes"; - CommandTypes["ApplyCodeActionCommand"] = "applyCodeActionCommand"; /* @internal */ CommandTypes["GetCodeFixesFull"] = "getCodeFixes-full"; + CommandTypes["GetCombinedCodeFix"] = "getCombinedCodeFix"; + /* @internal */ + CommandTypes["GetCombinedCodeFixFull"] = "getCombinedCodeFix-full"; + CommandTypes["ApplyCodeActionCommand"] = "applyCodeActionCommand"; CommandTypes["GetSupportedCodeFixes"] = "getSupportedCodeFixes"; CommandTypes["GetApplicableRefactors"] = "getApplicableRefactors"; CommandTypes["GetEditsForRefactor"] = "getEditsForRefactor"; /* @internal */ CommandTypes["GetEditsForRefactorFull"] = "getEditsForRefactor-full"; + CommandTypes["OrganizeImports"] = "organizeImports"; + /* @internal */ + CommandTypes["OrganizeImportsFull"] = "organizeImports-full"; // NOTE: If updating this, be sure to also update `allCommandNames` in `harness/unittests/session.ts`. })(CommandTypes = protocol.CommandTypes || (protocol.CommandTypes = {})); var IndentStyle; @@ -99360,24 +101945,46 @@ var ts; }; } server.toEvent = toEvent; + function isProjectsArray(projects) { + return !!projects.length; + } + /** + * This helper function processes a list of projects and return the concatenated, sortd and deduplicated output of processing each project. + */ + function combineProjectOutput(defaultValue, getValue, projects, action, comparer, areEqual) { + var outputs = ts.flatMap(isProjectsArray(projects) ? projects : projects.projects, function (project) { return action(project, defaultValue); }); + if (!isProjectsArray(projects) && projects.symLinkedProjects) { + projects.symLinkedProjects.forEach(function (projects, path) { + var value = getValue(path); + outputs.push.apply(outputs, ts.flatMap(projects, function (project) { return action(project, value); })); + }); + } + return comparer + ? ts.sortAndDeduplicate(outputs, comparer, areEqual) + : ts.deduplicate(outputs, areEqual); + } var Session = /** @class */ (function () { function Session(opts) { var _this = this; this.changeSeq = 0; this.handlers = ts.createMapFromTemplate((_a = {}, + _a[server.CommandNames.Status] = function () { + var response = { version: ts.version }; + return _this.requiredResponse(response); + }, _a[server.CommandNames.OpenExternalProject] = function (request) { - _this.projectService.openExternalProject(request.arguments, /*suppressRefreshOfInferredProjects*/ false); - // TODO: report errors + _this.projectService.openExternalProject(request.arguments); + // TODO: GH#20447 report errors return _this.requiredResponse(/*response*/ true); }, _a[server.CommandNames.OpenExternalProjects] = function (request) { _this.projectService.openExternalProjects(request.arguments.projects); - // TODO: report errors + // TODO: GH#20447 report errors return _this.requiredResponse(/*response*/ true); }, _a[server.CommandNames.CloseExternalProject] = function (request) { _this.projectService.closeExternalProject(request.arguments.projectFileName); - // TODO: report errors + // TODO: GH#20447 report errors return _this.requiredResponse(/*response*/ true); }, _a[server.CommandNames.SynchronizeProjectList] = function (request) { @@ -99614,9 +102221,14 @@ var ts; _a[server.CommandNames.GetCodeFixesFull] = function (request) { return _this.requiredResponse(_this.getCodeFixes(request.arguments, /*simplifiedResult*/ false)); }, + _a[server.CommandNames.GetCombinedCodeFix] = function (request) { + return _this.requiredResponse(_this.getCombinedCodeFix(request.arguments, /*simplifiedResult*/ true)); + }, + _a[server.CommandNames.GetCombinedCodeFixFull] = function (request) { + return _this.requiredResponse(_this.getCombinedCodeFix(request.arguments, /*simplifiedResult*/ false)); + }, _a[server.CommandNames.ApplyCodeActionCommand] = function (request) { - _this.applyCodeActionCommand(request.command, request.seq, request.arguments); - return _this.notRequired(); // Response will come asynchronously. + return _this.requiredResponse(_this.applyCodeActionCommand(request.arguments)); }, _a[server.CommandNames.GetSupportedCodeFixes] = function () { return _this.requiredResponse(_this.getSupportedCodeFixes()); @@ -99630,6 +102242,12 @@ var ts; _a[server.CommandNames.GetEditsForRefactorFull] = function (request) { return _this.requiredResponse(_this.getEditsForRefactor(request.arguments, /*simplifiedResult*/ false)); }, + _a[server.CommandNames.OrganizeImports] = function (request) { + return _this.requiredResponse(_this.organizeImports(request.arguments, /*simplifiedResult*/ true)); + }, + _a[server.CommandNames.OrganizeImportsFull] = function (request) { + return _this.requiredResponse(_this.organizeImports(request.arguments, /*simplifiedResult*/ false)); + }, _a)); this.host = opts.host; this.cancellationToken = opts.cancellationToken; @@ -100062,6 +102680,7 @@ var ts; }; Session.prototype.getProjects = function (args) { var projects; + var symLinkedProjects; if (args.projectFileName) { var project = this.getProject(args.projectFileName); if (project) { @@ -100071,13 +102690,14 @@ var ts; else { var scriptInfo = this.projectService.getScriptInfo(args.file); projects = scriptInfo.containingProjects; + symLinkedProjects = this.projectService.getSymlinkedProjects(scriptInfo); } // filter handles case when 'projects' is undefined projects = ts.filter(projects, function (p) { return p.languageServiceEnabled; }); - if (!projects || !projects.length) { + if ((!projects || !projects.length) && !symLinkedProjects) { return server.Errors.ThrowNoProject(); } - return projects; + return symLinkedProjects ? { projects: projects, symLinkedProjects: symLinkedProjects } : projects; }; Session.prototype.getDefaultProject = function (args) { if (args.projectFileName) { @@ -100090,6 +102710,7 @@ var ts; return info.getDefaultProject(); }; Session.prototype.getRenameLocations = function (args, simplifiedResult) { + var _this = this; var file = server.toNormalizedPath(args.file); var position = this.getPositionInFile(args, file); var projects = this.getProjects(args); @@ -100106,7 +102727,7 @@ var ts; locs: server.emptyArray }; } - var fileSpans = server.combineProjectOutput(projects, function (project) { + var fileSpans = combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (project, file) { var renameLocations = project.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); if (!renameLocations) { return server.emptyArray; @@ -100139,7 +102760,7 @@ var ts; return { info: renameInfo, locs: locs }; } else { - return server.combineProjectOutput(projects, function (p) { return p.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); }, + return combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (p, file) { return p.getLanguageService().findRenameLocations(file, position, args.findInStrings, args.findInComments); }, /*comparer*/ undefined, renameLocationIsEqualTo); } function renameLocationIsEqualTo(a, b) { @@ -100175,6 +102796,7 @@ var ts; } }; Session.prototype.getReferences = function (args, simplifiedResult) { + var _this = this; var file = server.toNormalizedPath(args.file); var projects = this.getProjects(args); var defaultProject = this.getDefaultProject(args); @@ -100189,7 +102811,7 @@ var ts; var nameSpan = nameInfo.textSpan; var nameColStart = scriptInfo.positionToLineOffset(nameSpan.start).offset; var nameText = scriptInfo.getSnapshot().getText(nameSpan.start, ts.textSpanEnd(nameSpan)); - var refs = server.combineProjectOutput(projects, function (project) { + var refs = combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (project, file) { var references = project.getLanguageService().getReferencesAtPosition(file, position); if (!references) { return server.emptyArray; @@ -100217,7 +102839,7 @@ var ts; }; } else { - return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().findReferences(file, position); }, + return combineProjectOutput(file, function (path) { return _this.projectService.getScriptInfoForPath(path).fileName; }, projects, function (project, file) { return project.getLanguageService().findReferences(file, position); }, /*comparer*/ undefined, ts.equateValues); } function areReferencesResponseItemsForTheSameLocation(a, b) { @@ -100417,10 +103039,10 @@ var ts; if (simplifiedResult) { return ts.mapDefined(completions && completions.entries, function (entry) { if (completions.isMemberCompletion || ts.startsWith(entry.name.toLowerCase(), prefix.toLowerCase())) { - var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, replacementSpan = entry.replacementSpan, hasAction = entry.hasAction, source = entry.source, isRecommended = entry.isRecommended; + var name = entry.name, kind = entry.kind, kindModifiers = entry.kindModifiers, sortText = entry.sortText, insertText = entry.insertText, replacementSpan = entry.replacementSpan, hasAction = entry.hasAction, source = entry.source, isRecommended = entry.isRecommended; var convertedSpan = replacementSpan ? _this.toLocationTextSpan(replacementSpan, scriptInfo) : undefined; // Use `hasAction || undefined` to avoid serializing `false`. - return { name: name, kind: kind, kindModifiers: kindModifiers, sortText: sortText, replacementSpan: convertedSpan, hasAction: hasAction || undefined, source: source, isRecommended: isRecommended }; + return { name: name, kind: kind, kindModifiers: kindModifiers, sortText: sortText, insertText: insertText, replacementSpan: convertedSpan, hasAction: hasAction || undefined, source: source, isRecommended: isRecommended }; } }).sort(function (a, b) { return ts.compareStringsCaseSensitiveUI(a.name, b.name); }); } @@ -100439,28 +103061,29 @@ var ts; return project.getLanguageService().getCompletionEntryDetails(file, position, name, formattingOptions, source); }); return simplifiedResult - ? result.map(function (details) { return (__assign({}, details, { codeActions: ts.map(details.codeActions, function (action) { return _this.mapCodeAction(action, scriptInfo); }) })); }) + ? result.map(function (details) { return (__assign({}, details, { codeActions: ts.map(details.codeActions, function (action) { return _this.mapCodeAction(project, action); }) })); }) : result; }; Session.prototype.getCompileOnSaveAffectedFileList = function (args) { + var _this = this; var info = this.projectService.getScriptInfoEnsuringProjectsUptoDate(args.file); if (!info) { return server.emptyArray; } - var result = []; // if specified a project, we only return affected file list in this project - var projectsToSearch = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; - for (var _i = 0, projectsToSearch_1 = projectsToSearch; _i < projectsToSearch_1.length; _i++) { - var project = projectsToSearch_1[_i]; + var projects = args.projectFileName ? [this.projectService.findProject(args.projectFileName)] : info.containingProjects; + var symLinkedProjects = !args.projectFileName && this.projectService.getSymlinkedProjects(info); + return combineProjectOutput(info, function (path) { return _this.projectService.getScriptInfoForPath(path); }, symLinkedProjects ? { projects: projects, symLinkedProjects: symLinkedProjects } : projects, function (project, info) { + var result; if (project.compileOnSaveEnabled && project.languageServiceEnabled && !project.getCompilationSettings().noEmit) { - result.push({ + result = { projectFileName: project.getProjectName(), fileNames: project.getCompileOnSaveAffectedFileList(info), projectUsesOutFile: !!project.getCompilationSettings().outFile || !!project.getCompilationSettings().out - }); + }; } - } - return result; + return result; + }); }; Session.prototype.emitFile = function (args) { var _this = this; @@ -100600,7 +103223,10 @@ var ts; var projects = this.getProjects(args); var fileName = args.currentFileOnly ? args.file && ts.normalizeSlashes(args.file) : undefined; if (simplifiedResult) { - return server.combineProjectOutput(projects, function (project) { + return combineProjectOutput(fileName, function () { return undefined; }, projects, function (project, file) { + if (fileName && !file) { + return undefined; + } var navItems = project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, /*excludeDts*/ project.isNonTsProject()); if (!navItems) { return server.emptyArray; @@ -100632,7 +103258,12 @@ var ts; /*comparer*/ undefined, areNavToItemsForTheSameLocation); } else { - return server.combineProjectOutput(projects, function (project) { return project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, /*excludeDts*/ project.isNonTsProject()); }, + return combineProjectOutput(fileName, function () { return undefined; }, projects, function (project, file) { + if (fileName && !file) { + return undefined; + } + return project.getLanguageService().getNavigateToItems(args.searchValue, args.maxResultCount, fileName, /*excludeDts*/ project.isNonTsProject()); + }, /*comparer*/ undefined, navigateToItemIsEqualTo); } function navigateToItemIsEqualTo(a, b) { @@ -100690,7 +103321,6 @@ var ts; return project.getLanguageService().getApplicableRefactors(file, position || textRange); }; Session.prototype.getEditsForRefactor = function (args, simplifiedResult) { - var _this = this; var _a = this.getFileAndProject(args), file = _a.file, project = _a.project; var scriptInfo = project.getScriptInfoForNormalizedPath(file); var _b = this.extractPositionAndRange(args, scriptInfo), position = _b.position, textRange = _b.textRange; @@ -100705,20 +103335,27 @@ var ts; var mappedRenameLocation = void 0; if (renameFilename !== undefined && renameLocation !== undefined) { var renameScriptInfo = project.getScriptInfoForNormalizedPath(server.toNormalizedPath(renameFilename)); - var snapshot = renameScriptInfo.getSnapshot(); - var oldText = snapshot.getText(0, snapshot.getLength()); - mappedRenameLocation = getLocationInNewDocument(oldText, renameFilename, renameLocation, edits); + mappedRenameLocation = getLocationInNewDocument(ts.getSnapshotText(renameScriptInfo.getSnapshot()), renameFilename, renameLocation, edits); } - return { - renameLocation: mappedRenameLocation, - renameFilename: renameFilename, - edits: edits.map(function (change) { return _this.mapTextChangesToCodeEdits(project, change); }) - }; + return { renameLocation: mappedRenameLocation, renameFilename: renameFilename, edits: this.mapTextChangesToCodeEdits(project, edits) }; } else { return result; } }; + Session.prototype.organizeImports = function (_a, simplifiedResult) { + var scope = _a.scope; + ts.Debug.assert(scope.type === "file"); + var _b = this.getFileAndProject(scope.args), file = _b.file, project = _b.project; + var formatOptions = this.projectService.getFormatCodeOptions(file); + var changes = project.getLanguageService().organizeImports({ type: "file", fileName: file }, formatOptions); + if (simplifiedResult) { + return this.mapTextChangesToCodeEdits(project, changes); + } + else { + return changes; + } + }; Session.prototype.getCodeFixes = function (args, simplifiedResult) { var _this = this; if (args.errorCodes.length === 0) { @@ -100733,25 +103370,33 @@ var ts; return undefined; } if (simplifiedResult) { - return codeActions.map(function (codeAction) { return _this.mapCodeAction(codeAction, scriptInfo); }); + return codeActions.map(function (codeAction) { return _this.mapCodeAction(project, codeAction); }); } else { return codeActions; } }; - Session.prototype.applyCodeActionCommand = function (commandName, requestSeq, args) { - var _this = this; + Session.prototype.getCombinedCodeFix = function (_a, simplifiedResult) { + var scope = _a.scope, fixId = _a.fixId; + ts.Debug.assert(scope.type === "file"); + var _b = this.getFileAndProject(scope.args), file = _b.file, project = _b.project; + var formatOptions = this.projectService.getFormatCodeOptions(file); + var res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId, formatOptions); + if (simplifiedResult) { + return { changes: this.mapTextChangesToCodeEdits(project, res.changes), commands: res.commands }; + } + else { + return res; + } + }; + Session.prototype.applyCodeActionCommand = function (args) { var commands = args.command; // They should be sending back the command we sent them. - var _loop_11 = function (command) { - var project = this_1.getFileAndProject(command).project; - var output = function (success, message) { return _this.doOutput({}, commandName, requestSeq, success, message); }; - project.getLanguageService().applyCodeActionCommand(command).then(function (result) { output(/*success*/ true, result.successMessage); }, function (error) { output(/*success*/ false, error); }); - }; - var this_1 = this; for (var _i = 0, _a = ts.toArray(commands); _i < _a.length; _i++) { var command = _a[_i]; - _loop_11(command); + var project = this.getFileAndProject(command).project; + project.getLanguageService().applyCodeActionCommand(command).then(function (_result) { }, function (_error) { }); } + return {}; }; Session.prototype.getStartAndEndPosition = function (args, scriptInfo) { var startPosition = undefined, endPosition = undefined; @@ -100772,18 +103417,18 @@ var ts; } return { startPosition: startPosition, endPosition: endPosition }; }; - Session.prototype.mapCodeAction = function (_a, scriptInfo) { + Session.prototype.mapCodeAction = function (project, _a) { var _this = this; - var description = _a.description, unmappedChanges = _a.changes, commands = _a.commands; - var changes = unmappedChanges.map(function (change) { return ({ - fileName: change.fileName, - textChanges: change.textChanges.map(function (textChange) { return _this.convertTextChangeToCodeEdit(textChange, scriptInfo); }) - }); }); - return { description: description, changes: changes, commands: commands }; + var description = _a.description, unmappedChanges = _a.changes, commands = _a.commands, fixId = _a.fixId; + var changes = unmappedChanges.map(function (change) { return _this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(server.toNormalizedPath(change.fileName))); }); + return { description: description, changes: changes, commands: commands, fixId: fixId }; }; Session.prototype.mapTextChangesToCodeEdits = function (project, textChanges) { var _this = this; - var scriptInfo = project.getScriptInfoForNormalizedPath(server.toNormalizedPath(textChanges.fileName)); + return textChanges.map(function (change) { return _this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(server.toNormalizedPath(change.fileName))); }); + }; + Session.prototype.mapTextChangesToCodeEditsUsingScriptinfo = function (textChanges, scriptInfo) { + var _this = this; return { fileName: textChanges.fileName, textChanges: textChanges.textChanges.map(function (textChange) { return _this.convertTextChangeToCodeEdit(textChange, scriptInfo); }) @@ -100951,13 +103596,13 @@ var ts; server.getLocationInNewDocument = getLocationInNewDocument; function applyEdits(text, textFilename, edits) { for (var _i = 0, edits_3 = edits; _i < edits_3.length; _i++) { - var _a = edits_3[_i], fileName = _a.fileName, textChanges_3 = _a.textChanges; + var _a = edits_3[_i], fileName = _a.fileName, textChanges_4 = _a.textChanges; if (fileName !== textFilename) { continue; } - for (var i = textChanges_3.length - 1; i >= 0; i--) { - var _b = textChanges_3[i], newText = _b.newText, _c = _b.span, start = _c.start, length_8 = _c.length; - text = text.slice(0, start) + newText + text.slice(start + length_8); + for (var i = textChanges_4.length - 1; i >= 0; i--) { + var _b = textChanges_4[i], newText = _b.newText, _c = _b.span, start = _c.start, length_6 = _c.length; + text = text.slice(0, start) + newText + text.slice(start + length_6); } } return text; @@ -101296,7 +103941,7 @@ var ts; return this.index.getText(rangeStart, rangeEnd - rangeStart); }; LineIndexSnapshot.prototype.getLength = function () { - return this.index.root.charCount(); + return this.index.getLength(); }; LineIndexSnapshot.prototype.getChangeRange = function (oldSnapshot) { if (oldSnapshot instanceof LineIndexSnapshot && this.cache === oldSnapshot.cache) { @@ -101584,7 +104229,7 @@ var ts; } // Skipped all children var leaf = this.lineNumberToInfo(this.lineCount(), 0).leaf; - return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf.charCount(), lineText: undefined }; + return { oneBasedLine: this.lineCount(), zeroBasedColumn: leaf ? leaf.charCount() : 0, lineText: undefined }; }; /** * Input line number is relative to the start of this node. @@ -101872,7 +104517,7 @@ var ts; server.TextStorage = TextStorage; /*@internal*/ function isDynamicFileName(fileName) { - return ts.getBaseFileName(fileName)[0] === "^"; + return fileName[0] === "^" || ts.getBaseFileName(fileName)[0] === "^"; } server.isDynamicFileName = isDynamicFileName; var ScriptInfo = /** @class */ (function () { @@ -101890,6 +104535,7 @@ var ts; this.textStorage = new TextStorage(host, fileName); if (hasMixedContent || this.isDynamic) { this.textStorage.reload(""); + this.realpath = this.path; } this.scriptKind = scriptKind ? scriptKind @@ -101925,6 +104571,28 @@ var ts; ScriptInfo.prototype.getSnapshot = function () { return this.textStorage.getSnapshot(); }; + ScriptInfo.prototype.ensureRealPath = function () { + if (this.realpath === undefined) { + // Default is just the path + this.realpath = this.path; + if (this.host.realpath) { + ts.Debug.assert(!!this.containingProjects.length); + var project = this.containingProjects[0]; + var realpath = this.host.realpath(this.path); + if (realpath) { + this.realpath = project.toPath(realpath); + // If it is different from this.path, add to the map + if (this.realpath !== this.path) { + project.projectService.realpathToScriptInfos.add(this.realpath, this); + } + } + } + } + }; + /*@internal*/ + ScriptInfo.prototype.getRealpathIfDifferent = function () { + return this.realpath && this.realpath !== this.path ? this.realpath : undefined; + }; ScriptInfo.prototype.getFormatCodeSettings = function () { return this.formatCodeSettings; }; @@ -101932,6 +104600,9 @@ var ts; var isNew = !this.isAttached(project); if (isNew) { this.containingProjects.push(project); + if (!project.getCompilerOptions().preserveSymlinks) { + this.ensureRealPath(); + } } return isNew; }; @@ -101971,7 +104642,7 @@ var ts; for (var _i = 0, _a = this.containingProjects; _i < _a.length; _i++) { var p = _a[_i]; if (p.projectKind === server.ProjectKind.Configured) { - p.directoryStructureHost.addOrDeleteFile(this.fileName, this.path, ts.FileWatcherEventKind.Deleted); + p.getCachedDirectoryStructureHost().addOrDeleteFile(this.fileName, this.path, ts.FileWatcherEventKind.Deleted); } var isInfoRoot = p.isRoot(this); // detach is unnecessary since we'll clean the list of containing projects anyways @@ -102025,8 +104696,7 @@ var ts; return this.textStorage.getVersion(); }; ScriptInfo.prototype.saveTo = function (fileName) { - var snap = this.textStorage.getSnapshot(); - this.host.writeFile(fileName, snap.getText(0, snap.getLength())); + this.host.writeFile(fileName, ts.getSnapshotText(this.textStorage.getSnapshot())); }; /*@internal*/ ScriptInfo.prototype.delayReloadNonMixedContentFile = function () { @@ -102090,6 +104760,181 @@ var ts; /* @internal */ var ts; (function (ts) { + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) { + if (!host.getDirectories || !host.readDirectory) { + return undefined; + } + var cachedReadDirectoryResult = ts.createMap(); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + fileExists: fileExists, + readFile: function (path, encoding) { return host.readFile(path, encoding); }, + directoryExists: host.directoryExists && directoryExists, + getDirectories: getDirectories, + readDirectory: readDirectory, + createDirectory: host.createDirectory && createDirectory, + writeFile: host.writeFile && writeFile, + addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, + addOrDeleteFile: addOrDeleteFile, + clearCache: clearCache + }; + function toPath(fileName) { + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getCachedFileSystemEntries(rootDirPath) { + return cachedReadDirectoryResult.get(rootDirPath); + } + function getCachedFileSystemEntriesForBaseDir(path) { + return getCachedFileSystemEntries(ts.getDirectoryPath(path)); + } + function getBaseNameOfFileName(fileName) { + return ts.getBaseFileName(ts.normalizePath(fileName)); + } + function createCachedFileSystemEntries(rootDir, rootDirPath) { + var resultFromHost = { + files: ts.map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [], + directories: host.getDirectories(rootDir) || [] + }; + cachedReadDirectoryResult.set(rootDirPath, resultFromHost); + return resultFromHost; + } + /** + * If the readDirectory result was already cached, it returns that + * Otherwise gets result from host and caches it. + * The host request is done under try catch block to avoid caching incorrect result + */ + function tryReadDirectory(rootDir, rootDirPath) { + var cachedResult = getCachedFileSystemEntries(rootDirPath); + if (cachedResult) { + return cachedResult; + } + try { + return createCachedFileSystemEntries(rootDir, rootDirPath); + } + catch (_e) { + // If there is exception to read directories, dont cache the result and direct the calls to host + ts.Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); + return undefined; + } + } + function fileNameEqual(name1, name2) { + return getCanonicalFileName(name1) === getCanonicalFileName(name2); + } + function hasEntry(entries, name) { + return ts.some(entries, function (file) { return fileNameEqual(file, name); }); + } + function updateFileSystemEntry(entries, baseName, isValid) { + if (hasEntry(entries, baseName)) { + if (!isValid) { + return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); + } + } + else if (isValid) { + return entries.push(baseName); + } + } + function writeFile(fileName, data, writeByteOrderMark) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + if (result) { + updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), /*fileExists*/ true); + } + return host.writeFile(fileName, data, writeByteOrderMark); + } + function fileExists(fileName) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || + host.fileExists(fileName); + } + function directoryExists(dirPath) { + var path = toPath(dirPath); + return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); + } + function createDirectory(dirPath) { + var path = toPath(dirPath); + var result = getCachedFileSystemEntriesForBaseDir(path); + var baseFileName = getBaseNameOfFileName(dirPath); + if (result) { + updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true); + } + host.createDirectory(dirPath); + } + function getDirectories(rootDir) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return result.directories.slice(); + } + return host.getDirectories(rootDir); + } + function readDirectory(rootDir, extensions, excludes, includes, depth) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries); + } + return host.readDirectory(rootDir, extensions, excludes, includes, depth); + function getFileSystemEntries(dir) { + var path = toPath(dir); + if (path === rootDirPath) { + return result; + } + return tryReadDirectory(dir, path) || ts.emptyFileSystemEntries; + } + } + function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { + var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); + if (existingResult) { + // Just clear the cache for now + // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated + clearCache(); + return undefined; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); + if (!parentResult) { + return undefined; + } + // This was earlier a file (hence not in cached directory contents) + // or we never cached the directory containing it + if (!host.directoryExists) { + // Since host doesnt support directory exists, clear the cache as otherwise it might not be same + clearCache(); + return undefined; + } + var baseName = getBaseNameOfFileName(fileOrDirectory); + var fsQueryResult = { + fileExists: host.fileExists(fileOrDirectoryPath), + directoryExists: host.directoryExists(fileOrDirectoryPath) + }; + if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { + // Folder added or removed, clear the cache instead of updating the folder and its structure + clearCache(); + } + else { + // No need to update the directory structure, just files + updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); + } + return fsQueryResult; + } + function addOrDeleteFile(fileName, filePath, eventKind) { + if (eventKind === ts.FileWatcherEventKind.Changed) { + return; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); + if (parentResult) { + updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); + } + } + function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { + updateFileSystemEntry(parentResult.files, baseName, fileExists); + } + function clearCache() { + cachedReadDirectoryResult.clear(); + } + } + ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; var ConfigFileProgramReloadLevel; (function (ConfigFileProgramReloadLevel) { ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["None"] = 0] = "None"; @@ -102146,6 +104991,13 @@ var ts; } } ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories; + function isEmittedFileOfProgram(program, file) { + if (!program) { + return false; + } + return program.isEmittedFile(file); + } + ts.isEmittedFileOfProgram = isEmittedFileOfProgram; function addFileWatcher(host, file, cb) { return host.watchFile(file, cb); } @@ -102227,7 +105079,7 @@ var ts; var ts; (function (ts) { ts.maxNumberOfFilesToIterateForInvalidation = 256; - function createResolutionCache(resolutionHost, rootDirForResolution) { + function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var allFilesHaveInvalidatedResolution = false; @@ -102239,6 +105091,7 @@ var ts; var resolvedTypeReferenceDirectives = ts.createMap(); var perDirectoryResolvedTypeReferenceDirectives = ts.createMap(); var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); /** * These are the extensions that failed lookup files will have by default, * any other extension of failed lookup will be store that path in custom failed lookup path @@ -102299,8 +105152,8 @@ var ts; filesWithChangedSetOfUnresolvedImports = undefined; return collected; } - function createHasInvalidatedResolution() { - if (allFilesHaveInvalidatedResolution) { + function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { + if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { // Any file asked would have invalidated resolution filesWithInvalidatedResolutions = undefined; return ts.returnTrue; @@ -102421,8 +105274,8 @@ var ts; return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, /*reusedNames*/ undefined, /*logChanges*/ false); } - function resolveModuleNames(moduleNames, containingFile, reusedNames, logChanges) { - return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChanges); + function resolveModuleNames(moduleNames, containingFile, reusedNames) { + return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChangesWhenResolvingModule); } function isNodeModulesDirectory(dirPath) { return ts.endsWith(dirPath, "/node_modules"); @@ -102561,9 +105414,9 @@ var ts; function createDirectoryWatcher(directory, dirPath) { return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (resolutionHost.getCachedDirectoryStructureHost) { + if (cachedDirectoryStructureHost) { // Since the file existance changed, update the sourceFiles cache - resolutionHost.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } // If the files are added to project root or node_modules directory, always run through the invalidation process // Otherwise run through invalidation only if adding to the immediate directory @@ -102654,6 +105507,10 @@ var ts; if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) { return false; } + // Ignore emits from the program + if (ts.isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { + return false; + } // Resolution need to be invalidated if failed lookup location is same as the file or directory getting created isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; } @@ -102672,9 +105529,9 @@ var ts; // Create new watch and recursive info return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); - if (resolutionHost.getCachedDirectoryStructureHost) { + if (cachedDirectoryStructureHost) { // Since the file existance changed, update the sourceFiles cache - resolutionHost.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } // For now just recompile // We could potentially store more data here about whether it was/would be really be used or not @@ -102841,12 +105698,319 @@ var ts; server.TypingsCache = TypingsCache; })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); +/// +/*@internal*/ +var ts; +(function (ts) { + function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { + var outputFiles = []; + var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; + function writeFile(fileName, text, writeByteOrderMark) { + outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); + } + } + ts.getFileEmitOutput = getFileEmitOutput; +})(ts || (ts = {})); +/*@internal*/ +(function (ts) { + var BuilderState; + (function (BuilderState) { + /** + * Gets the referenced files for a file from the program with values for the keys as referenced file's path to be true + */ + function getReferencedFiles(program, sourceFile, getCanonicalFileName) { + var referencedFiles; + // We need to use a set here since the code can contain the same import twice, + // but that will only be one dependency. + // To avoid invernal conversion, the key of the referencedFiles map must be of type Path + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = program.getTypeChecker(); + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importName = _a[_i]; + var symbol = checker.getSymbolAtLocation(importName); + if (symbol && symbol.declarations && symbol.declarations[0]) { + var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); + if (declarationSourceFile) { + addReferencedFile(declarationSourceFile.path); + } + } + } + } + var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); + // Handle triple slash references + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(referencedPath); + } + } + // Handle type reference directives + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = ts.toPath(fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }); + } + return referencedFiles; + function addReferencedFile(referencedPath) { + if (!referencedFiles) { + referencedFiles = ts.createMap(); + } + referencedFiles.set(referencedPath, true); + } + } + /** + * Returns true if oldState is reusable, that is the emitKind = module/non module has not changed + */ + function canReuseOldState(newReferencedMap, oldState) { + return oldState && !oldState.referencedMap === !newReferencedMap; + } + BuilderState.canReuseOldState = canReuseOldState; + /** + * Creates the state of file references and signature for the new program from oldState if it is safe + */ + function create(newProgram, getCanonicalFileName, oldState) { + var fileInfos = ts.createMap(); + var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? ts.createMap() : undefined; + var hasCalledUpdateShapeSignature = ts.createMap(); + var useOldState = canReuseOldState(referencedMap, oldState); + // Create the reference map, and set the file infos + for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var version_1 = sourceFile.version; + var oldInfo = useOldState && oldState.fileInfos.get(sourceFile.path); + if (referencedMap) { + var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); + if (newReferences) { + referencedMap.set(sourceFile.path, newReferences); + } + } + fileInfos.set(sourceFile.path, { version: version_1, signature: oldInfo && oldInfo.signature }); + } + return { + fileInfos: fileInfos, + referencedMap: referencedMap, + hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature, + allFilesExcludingDefaultLibraryFile: undefined, + allFileNames: undefined + }; + } + BuilderState.create = create; + /** + * Gets the files affected by the path from the program + */ + function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature) { + // Since the operation could be cancelled, the signatures are always stored in the cache + // They will be commited once it is safe to use them + // eg when calling this api from tsserver, if there is no cancellation of the operation + // In the other cases the affected files signatures are commited only after the iteration through the result is complete + var signatureCache = cacheToUpdateSignature || ts.createMap(); + var sourceFile = programOfThisState.getSourceFileByPath(path); + if (!sourceFile) { + return ts.emptyArray; + } + if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash)) { + return [sourceFile]; + } + var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash); + if (!cacheToUpdateSignature) { + // Commit all the signatures in the signature cache + updateSignaturesFromCache(state, signatureCache); + } + return result; + } + BuilderState.getFilesAffectedBy = getFilesAffectedBy; + /** + * Updates the signatures from the cache into state's fileinfo signatures + * This should be called whenever it is safe to commit the state of the builder + */ + function updateSignaturesFromCache(state, signatureCache) { + signatureCache.forEach(function (signature, path) { + state.fileInfos.get(path).signature = signature; + state.hasCalledUpdateShapeSignature.set(path, true); + }); + } + BuilderState.updateSignaturesFromCache = updateSignaturesFromCache; + /** + * Returns if the shape of the signature has changed since last emit + */ + function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash) { + ts.Debug.assert(!!sourceFile); + // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate + if (state.hasCalledUpdateShapeSignature.has(sourceFile.path) || cacheToUpdateSignature.has(sourceFile.path)) { + return false; + } + var info = state.fileInfos.get(sourceFile.path); + ts.Debug.assert(!!info); + var prevSignature = info.signature; + var latestSignature; + if (sourceFile.isDeclarationFile) { + latestSignature = sourceFile.version; + } + else { + var emitOutput = ts.getFileEmitOutput(programOfThisState, sourceFile, /*emitOnlyDtsFiles*/ true, cancellationToken); + if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { + latestSignature = computeHash(emitOutput.outputFiles[0].text); + } + else { + latestSignature = prevSignature; + } + } + cacheToUpdateSignature.set(sourceFile.path, latestSignature); + return !prevSignature || latestSignature !== prevSignature; + } + /** + * Get all the dependencies of the sourceFile + */ + function getAllDependencies(state, programOfThisState, sourceFile) { + var compilerOptions = programOfThisState.getCompilerOptions(); + // With --out or --outFile all outputs go into single file, all files depend on each other + if (compilerOptions.outFile || compilerOptions.out) { + return getAllFileNames(state, programOfThisState); + } + // If this is non module emit, or its a global file, it depends on all the source files + if (!state.referencedMap || (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile))) { + return getAllFileNames(state, programOfThisState); + } + // Get the references, traversing deep from the referenceMap + var seenMap = ts.createMap(); + var queue = [sourceFile.path]; + while (queue.length) { + var path = queue.pop(); + if (!seenMap.has(path)) { + seenMap.set(path, true); + var references = state.referencedMap.get(path); + if (references) { + var iterator = references.keys(); + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + queue.push(value); + } + } + } + } + return ts.arrayFrom(ts.mapDefinedIterator(seenMap.keys(), function (path) { + var file = programOfThisState.getSourceFileByPath(path); + return file ? file.fileName : path; + })); + var _b; + } + BuilderState.getAllDependencies = getAllDependencies; + /** + * Gets the names of all files from the program + */ + function getAllFileNames(state, programOfThisState) { + if (!state.allFileNames) { + var sourceFiles = programOfThisState.getSourceFiles(); + state.allFileNames = sourceFiles === ts.emptyArray ? ts.emptyArray : sourceFiles.map(function (file) { return file.fileName; }); + } + return state.allFileNames; + } + /** + * Gets the files referenced by the the file path + */ + function getReferencedByPaths(state, referencedFilePath) { + return ts.arrayFrom(ts.mapDefinedIterator(state.referencedMap.entries(), function (_a) { + var filePath = _a[0], referencesInFile = _a[1]; + return referencesInFile.has(referencedFilePath) ? filePath : undefined; + })); + } + /** + * For script files that contains only ambient external modules, although they are not actually external module files, + * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore, + * there are no point to rebuild all script files if these special files have changed. However, if any statement + * in the file is not ambient external module, we treat it as a regular script file. + */ + function containsOnlyAmbientModules(sourceFile) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (!ts.isModuleWithStringLiteralName(statement)) { + return false; + } + } + return true; + } + /** + * Gets all files of the program excluding the default library file + */ + function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { + // Use cached result + if (state.allFilesExcludingDefaultLibraryFile) { + return state.allFilesExcludingDefaultLibraryFile; + } + var result; + addSourceFile(firstSourceFile); + for (var _i = 0, _a = programOfThisState.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + if (sourceFile !== firstSourceFile) { + addSourceFile(sourceFile); + } + } + state.allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; + return state.allFilesExcludingDefaultLibraryFile; + function addSourceFile(sourceFile) { + if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { + (result || (result = [])).push(sourceFile); + } + } + } + /** + * When program emits non modular code, gets the files affected by the sourceFile whose shape has changed + */ + function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { + var compilerOptions = programOfThisState.getCompilerOptions(); + // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, + // so returning the file itself is good enough. + if (compilerOptions && (compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + /** + * When program emits modular code, gets the files affected by the sourceFile whose shape has changed + */ + function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash) { + if (!ts.isExternalModule(sourceFileWithUpdatedShape) && !containsOnlyAmbientModules(sourceFileWithUpdatedShape)) { + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + // Now we need to if each file in the referencedBy list has a shape change as well. + // Because if so, its own referencedBy files need to be saved as well to make the + // emitting result consistent with files on disk. + var seenFileNamesMap = ts.createMap(); + // Start with the paths this file was referenced by + seenFileNamesMap.set(sourceFileWithUpdatedShape.path, sourceFileWithUpdatedShape); + var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.path); + while (queue.length > 0) { + var currentPath = queue.pop(); + if (!seenFileNamesMap.has(currentPath)) { + var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); + seenFileNamesMap.set(currentPath, currentSourceFile); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash)) { + queue.push.apply(queue, getReferencedByPaths(state, currentPath)); + } + } + } + // Return array of values that needs emit + // Return array of values that needs emit + return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); + } + })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); +})(ts || (ts = {})); /// /// /// /// /// -/// +/// var ts; (function (ts) { var server; @@ -102935,17 +106099,16 @@ var ts; var Project = /** @class */ (function () { /*@internal*/ function Project( - /*@internal*/ projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled, - /*@internal*/ directoryStructureHost, currentDirectory) { + /*@internal*/ projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, directoryStructureHost, currentDirectory) { this.projectName = projectName; this.projectKind = projectKind; this.projectService = projectService; this.documentRegistry = documentRegistry; this.compilerOptions = compilerOptions; this.compileOnSaveEnabled = compileOnSaveEnabled; - this.directoryStructureHost = directoryStructureHost; this.rootFiles = []; this.rootFilesMap = ts.createMap(); + this.plugins = []; this.cachedUnresolvedImportsPerFile = new UnresolvedImportsMap(); this.languageServiceEnabled = true; /** @@ -102965,7 +106128,10 @@ var ts; */ this.projectStateVersion = 0; /*@internal*/ + this.dirty = false; + /*@internal*/ this.hasChangedAutomaticTypeDirectiveNames = false; + this.directoryStructureHost = directoryStructureHost; this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory || ""); this.cancellationToken = new ts.ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds); if (!this.compilerOptions) { @@ -102986,12 +106152,13 @@ var ts; this.realpath = function (path) { return host.realpath(path); }; } // Use the current directory as resolution root only if the project created using current directory string - this.resolutionCache = ts.createResolutionCache(this, currentDirectory && this.currentDirectory); + this.resolutionCache = ts.createResolutionCache(this, currentDirectory && this.currentDirectory, /*logChangesWhenResolvingModule*/ true); this.languageService = ts.createLanguageService(this, this.documentRegistry); - if (!languageServiceEnabled) { - this.disableLanguageService(); + if (lastFileExceededProgramSize) { + this.disableLanguageService(lastFileExceededProgramSize); } this.markAsDirty(); + this.projectService.pendingEnsureProjectForOpenFiles = true; } Project.prototype.isNonTsProject = function () { this.updateGraph(); @@ -103037,7 +106204,7 @@ var ts; return this.getCompilationSettings(); }; Project.prototype.getNewLine = function () { - return this.directoryStructureHost.newLine; + return this.projectService.host.newLine; }; Project.prototype.getProjectVersion = function () { return this.projectStateVersion.toString(); @@ -103094,13 +106261,13 @@ var ts; return ts.combinePaths(nodeModuleBinDir, ts.getDefaultLibFileName(this.compilerOptions)); }; Project.prototype.useCaseSensitiveFileNames = function () { - return this.directoryStructureHost.useCaseSensitiveFileNames; + return this.projectService.host.useCaseSensitiveFileNames; }; Project.prototype.readDirectory = function (path, extensions, exclude, include, depth) { return this.directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }; Project.prototype.readFile = function (fileName) { - return this.directoryStructureHost.readFile(fileName); + return this.projectService.host.readFile(fileName); }; Project.prototype.fileExists = function (file) { // As an optimization, don't hit the disks for files we already know don't exist @@ -103109,7 +106276,7 @@ var ts; return !this.isWatchedMissingFile(path) && this.directoryStructureHost.fileExists(file); }; Project.prototype.resolveModuleNames = function (moduleNames, containingFile, reusedNames) { - return this.resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames, /*logChanges*/ true); + return this.resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames); }; Project.prototype.resolveTypeReferenceDirectives = function (typeDirectiveNames, containingFile) { return this.resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); @@ -103121,6 +106288,10 @@ var ts; return this.directoryStructureHost.getDirectories(path); }; /*@internal*/ + Project.prototype.getCachedDirectoryStructureHost = function () { + return undefined; + }; + /*@internal*/ Project.prototype.toPath = function (fileName) { return ts.toPath(fileName, this.currentDirectory, this.projectService.toCanonicalFileName); }; @@ -103130,7 +106301,7 @@ var ts; }; /*@internal*/ Project.prototype.onInvalidatedResolution = function () { - this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(this); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); }; /*@internal*/ Project.prototype.watchTypeRootsDirectory = function (directory, cb, flags) { @@ -103139,7 +106310,7 @@ var ts; /*@internal*/ Project.prototype.onChangedAutomaticTypeDirectiveNames = function () { this.hasChangedAutomaticTypeDirectiveNames = true; - this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(this); + this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this); }; /*@internal*/ Project.prototype.getGlobalCache = function () { @@ -103149,6 +106320,12 @@ var ts; Project.prototype.writeLog = function (s) { this.projectService.logger.info(s); }; + Project.prototype.log = function (s) { + this.writeLog(s); + }; + Project.prototype.error = function (s) { + this.projectService.logger.msg(s, server.Msg.Err); + }; Project.prototype.setInternalCompilerOptionsForEmittingJsFiles = function () { if (this.projectKind === ProjectKind.Inferred || this.projectKind === ProjectKind.External) { this.compilerOptions.noEmitForJsFiles = true; @@ -103170,15 +106347,6 @@ var ts; } return this.languageService; }; - Project.prototype.ensureBuilder = function () { - var _this = this; - if (!this.builder) { - this.builder = ts.createBuilder({ - getCanonicalFileName: this.projectService.toCanonicalFileName, - computeHash: function (data) { return _this.projectService.host.createHash(data); } - }); - } - }; Project.prototype.shouldEmitFile = function (scriptInfo) { return scriptInfo && !scriptInfo.isDynamicOrHasMixedContent(); }; @@ -103188,8 +106356,8 @@ var ts; return []; } this.updateGraph(); - this.ensureBuilder(); - return ts.mapDefined(this.builder.getFilesAffectedBy(this.program, scriptInfo.path), function (sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); + this.builderState = ts.BuilderState.create(this.program, this.projectService.toCanonicalFileName, this.builderState); + return ts.mapDefined(ts.BuilderState.getFilesAffectedBy(this.builderState, this.program, scriptInfo.path, this.cancellationToken, function (data) { return _this.projectService.host.createHash(data); }), function (sourceFile) { return _this.shouldEmitFile(_this.projectService.getScriptInfoForPath(sourceFile.path)) ? sourceFile.fileName : undefined; }); }; /** * Returns true if emit was conducted @@ -103213,22 +106381,45 @@ var ts; return; } this.languageServiceEnabled = true; + this.lastFileExceededProgramSize = undefined; this.projectService.onUpdateLanguageServiceStateForProject(this, /*languageServiceEnabled*/ true); }; - Project.prototype.disableLanguageService = function () { + Project.prototype.disableLanguageService = function (lastFileExceededProgramSize) { if (!this.languageServiceEnabled) { return; } this.languageService.cleanupSemanticCache(); this.languageServiceEnabled = false; + this.lastFileExceededProgramSize = lastFileExceededProgramSize; + this.builderState = undefined; this.resolutionCache.closeTypeRootsWatch(); this.projectService.onUpdateLanguageServiceStateForProject(this, /*languageServiceEnabled*/ false); }; Project.prototype.getProjectName = function () { return this.projectName; }; + Project.prototype.removeLocalTypingsFromTypeAcquisition = function (newTypeAcquisition) { + if (!newTypeAcquisition || !newTypeAcquisition.include) { + // Nothing to filter out, so just return as-is + return newTypeAcquisition; + } + return __assign({}, newTypeAcquisition, { include: this.removeExistingTypings(newTypeAcquisition.include) }); + }; Project.prototype.getExternalFiles = function () { - return server.emptyArray; + var _this = this; + return server.toSortedArray(ts.flatMap(this.plugins, function (plugin) { + if (typeof plugin.getExternalFiles !== "function") + return; + try { + return plugin.getExternalFiles(_this); + } + catch (e) { + _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e); + if (e.stack) { + _this.projectService.logger.info(e.stack); + } + } + })); }; Project.prototype.getSourceFile = function (path) { if (!this.program) { @@ -103254,11 +106445,12 @@ var ts; var root = _c[_b]; root.detachFromProject(this); } + this.projectService.pendingEnsureProjectForOpenFiles = true; this.rootFiles = undefined; this.rootFilesMap = undefined; this.externalFiles = undefined; this.program = undefined; - this.builder = undefined; + this.builderState = undefined; this.resolutionCache.clear(); this.resolutionCache = undefined; this.cachedUnresolvedImportsPerFile = undefined; @@ -103416,9 +106608,13 @@ var ts; (this.updatedFileNames || (this.updatedFileNames = ts.createMap())).set(fileName, true); }; Project.prototype.markAsDirty = function () { - this.projectStateVersion++; + if (!this.dirty) { + this.projectStateVersion++; + this.dirty = true; + } }; - Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result) { + /* @internal */ + Project.prototype.extractUnresolvedImportsFromSourceFile = function (file, result, ambientModules) { var cached = this.cachedUnresolvedImportsPerFile.get(file.path); if (cached) { // found cached result - use it and return @@ -103432,7 +106628,7 @@ var ts; if (file.resolvedModules) { file.resolvedModules.forEach(function (resolvedModule, name) { // pick unresolved non-relative names - if (!resolvedModule && !ts.isExternalModuleNameRelative(name)) { + if (!resolvedModule && !ts.isExternalModuleNameRelative(name) && !isAmbientlyDeclaredModule(name)) { // for non-scoped names extract part up-to the first slash // for scoped names - extract up to the second slash var trimmed = name.trim(); @@ -103449,6 +106645,9 @@ var ts; }); } this.cachedUnresolvedImportsPerFile.set(file.path, unresolvedImports || server.emptyArray); + function isAmbientlyDeclaredModule(name) { + return ambientModules.some(function (m) { return m === name; }); + } }; /** * Updates set of files that contribute to this project @@ -103474,38 +106673,35 @@ var ts; // 4. compilation settings were changed in the way that might affect module resolution - drop all caches and collect all data from the scratch if (hasChanges || changedFiles.length) { var result = []; + var ambientModules = this.program.getTypeChecker().getAmbientModules().map(function (mod) { return ts.stripQuotes(mod.getName()); }); for (var _a = 0, _b = this.program.getSourceFiles(); _a < _b.length; _a++) { var sourceFile = _b[_a]; - this.extractUnresolvedImportsFromSourceFile(sourceFile, result); + this.extractUnresolvedImportsFromSourceFile(sourceFile, result, ambientModules); } this.lastCachedUnresolvedImportsList = server.toDeduplicatedSortedArray(result); } var cachedTypings = this.projectService.typingsCache.getTypingsForProject(this, this.lastCachedUnresolvedImportsList, hasChanges); - if (this.setTypings(cachedTypings)) { + if (!ts.arrayIsEqualTo(this.typingFiles, cachedTypings)) { + this.typingFiles = cachedTypings; + this.markAsDirty(); hasChanges = this.updateGraphWorker() || hasChanges; } - if (this.builder) { - this.builder.updateProgram(this.program); - } } else { this.lastCachedUnresolvedImportsList = undefined; - if (this.builder) { - this.builder.clear(); - } } if (hasChanges) { this.projectStructureVersion++; } return !hasChanges; }; - Project.prototype.setTypings = function (typings) { - if (ts.arrayIsEqualTo(this.typingFiles, typings)) { - return false; - } - this.typingFiles = typings; - this.markAsDirty(); - return true; + /* @internal */ + Project.prototype.getCurrentProgram = function () { + return this.program; + }; + Project.prototype.removeExistingTypings = function (include) { + var existing = ts.getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost); + return include.filter(function (i) { return existing.indexOf(i) < 0; }); }; Project.prototype.updateGraphWorker = function () { var _this = this; @@ -103516,6 +106712,7 @@ var ts; this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution(); this.resolutionCache.startCachingPerDirectoryResolution(); this.program = this.languageService.getProgram(); + this.dirty = false; this.resolutionCache.finishCachingPerDirectoryResolution(); // bump up the version if // - oldProgram is not set - this is a first time updateGraph is called @@ -103553,7 +106750,7 @@ var ts; scriptInfo.attachToProject(_this); }, function (removed) { return _this.detachScriptInfoFromProject(removed); }, ts.compareStringsCaseSensitive); var elapsed = ts.timestamp() - start; - this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " structureChanged: " + hasChanges + " Elapsed: " + elapsed + "ms"); + this.writeLog("Finishing updateGraphWorker: Project: " + this.getProjectName() + " Version: " + this.getProjectVersion() + " structureChanged: " + hasChanges + " Elapsed: " + elapsed + "ms"); return hasChanges; }; Project.prototype.detachScriptInfoFromProject = function (uncheckedFileName) { @@ -103567,13 +106764,13 @@ var ts; var _this = this; var fileWatcher = this.projectService.watchFile(this.projectService.host, missingFilePath, function (fileName, eventKind) { if (_this.projectKind === ProjectKind.Configured) { - _this.directoryStructureHost.addOrDeleteFile(fileName, missingFilePath, eventKind); + _this.getCachedDirectoryStructureHost().addOrDeleteFile(fileName, missingFilePath, eventKind); } if (eventKind === ts.FileWatcherEventKind.Created && _this.missingFilesMap.has(missingFilePath)) { _this.missingFilesMap.delete(missingFilePath); fileWatcher.close(); // When a missing file is created, we should update the graph. - _this.projectService.delayUpdateProjectGraphAndInferredProjectsRefresh(_this); + _this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(_this); } }, "Missing file from program" /* MissingFilePath */, this); return fileWatcher; @@ -103630,7 +106827,8 @@ var ts; version: this.projectStructureVersion, isInferred: this.projectKind === ProjectKind.Inferred, options: this.getCompilationSettings(), - languageServiceDisabled: !this.languageServiceEnabled + languageServiceDisabled: !this.languageServiceEnabled, + lastFileExceededProgramSize: this.lastFileExceededProgramSize }; var updatedFileNames = this.updatedFileNames; this.updatedFileNames = undefined; @@ -103676,6 +106874,82 @@ var ts; ts.orderedRemoveItem(this.rootFiles, info); this.rootFilesMap.delete(info.path); }; + Project.prototype.enableGlobalPlugins = function () { + var host = this.projectService.host; + var options = this.getCompilationSettings(); + if (!host.require) { + this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded"); + return; + } + // Search our peer node_modules, then any globally-specified probe paths + // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/ + var searchPaths = [ts.combinePaths(this.projectService.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations); + if (this.projectService.globalPlugins) { + var _loop_11 = function (globalPluginName) { + // Skip empty names from odd commandline parses + if (!globalPluginName) + return "continue"; + // Skip already-locally-loaded plugins + if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) + return "continue"; + // Provide global: true so plugins can detect why they can't find their config + this_1.projectService.logger.info("Loading global plugin " + globalPluginName); + this_1.enablePlugin({ name: globalPluginName, global: true }, searchPaths); + }; + var this_1 = this; + // Enable global plugins with synthetic configuration entries + for (var _i = 0, _a = this.projectService.globalPlugins; _i < _a.length; _i++) { + var globalPluginName = _a[_i]; + _loop_11(globalPluginName); + } + } + }; + Project.prototype.enablePlugin = function (pluginConfigEntry, searchPaths) { + var _this = this; + this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(",")); + var log = function (message) { + _this.projectService.logger.info(message); + }; + for (var _i = 0, searchPaths_1 = searchPaths; _i < searchPaths_1.length; _i++) { + var searchPath = searchPaths_1[_i]; + var resolvedModule = Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log); + if (resolvedModule) { + this.enableProxy(resolvedModule, pluginConfigEntry); + return; + } + } + this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name); + }; + Project.prototype.enableProxy = function (pluginModuleFactory, configEntry) { + try { + if (typeof pluginModuleFactory !== "function") { + this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did expose a proper factory function"); + return; + } + var info = { + config: configEntry, + project: this, + languageService: this.languageService, + languageServiceHost: this, + serverHost: this.projectService.host + }; + var pluginModule = pluginModuleFactory({ typescript: ts }); + var newLS = pluginModule.create(info); + for (var _i = 0, _a = Object.keys(this.languageService); _i < _a.length; _i++) { + var k = _a[_i]; + if (!(k in newLS)) { + this.projectService.logger.info("Plugin activation warning: Missing proxied method " + k + " in created LS. Patching."); + newLS[k] = this.languageService[k]; + } + } + this.projectService.logger.info("Plugin validation succeded"); + this.languageService = newLS; + this.plugins.push(pluginModule); + } + catch (e) { + this.projectService.logger.info("Plugin activation failed: " + e); + } + }; return Project; }()); server.Project = Project; @@ -103689,10 +106963,11 @@ var ts; function InferredProject(projectService, documentRegistry, compilerOptions, projectRootPath, currentDirectory) { var _this = _super.call(this, InferredProject.newName(), ProjectKind.Inferred, projectService, documentRegistry, /*files*/ undefined, - /*languageServiceEnabled*/ true, compilerOptions, + /*lastFileExceededProgramSize*/ undefined, compilerOptions, /*compileOnSaveEnabled*/ false, projectService.host, currentDirectory) || this; _this._isJsInferredProject = false; _this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); + _this.enableGlobalPlugins(); return _this; } InferredProject.prototype.toggleJsInferredProject = function (isJsInferredProject) { @@ -103771,10 +107046,9 @@ var ts; var ConfiguredProject = /** @class */ (function (_super) { __extends(ConfiguredProject, _super); /*@internal*/ - function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, cachedDirectoryStructureHost) { - var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; + function ConfiguredProject(configFileName, projectService, documentRegistry, hasExplicitListOfFiles, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, cachedDirectoryStructureHost) { + var _this = _super.call(this, configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, cachedDirectoryStructureHost, ts.getDirectoryPath(configFileName)) || this; _this.compileOnSaveEnabled = compileOnSaveEnabled; - _this.plugins = []; /** Ref count to the project when opened from external project */ _this.externalProjectRefCount = 0; _this.canonicalConfigFilePath = server.asNormalizedPath(projectService.toCanonicalFileName(configFileName)); @@ -103827,71 +107101,7 @@ var ts; this.enablePlugin(pluginConfigEntry, searchPaths); } } - if (this.projectService.globalPlugins) { - var _loop_12 = function (globalPluginName) { - // Skip empty names from odd commandline parses - if (!globalPluginName) - return "continue"; - // Skip already-locally-loaded plugins - if (options.plugins && options.plugins.some(function (p) { return p.name === globalPluginName; })) - return "continue"; - // Provide global: true so plugins can detect why they can't find their config - this_2.projectService.logger.info("Loading global plugin " + globalPluginName); - this_2.enablePlugin({ name: globalPluginName, global: true }, searchPaths); - }; - var this_2 = this; - // Enable global plugins with synthetic configuration entries - for (var _b = 0, _c = this.projectService.globalPlugins; _b < _c.length; _b++) { - var globalPluginName = _c[_b]; - _loop_12(globalPluginName); - } - } - }; - ConfiguredProject.prototype.enablePlugin = function (pluginConfigEntry, searchPaths) { - var _this = this; - this.projectService.logger.info("Enabling plugin " + pluginConfigEntry.name + " from candidate paths: " + searchPaths.join(",")); - var log = function (message) { - _this.projectService.logger.info(message); - }; - for (var _i = 0, searchPaths_1 = searchPaths; _i < searchPaths_1.length; _i++) { - var searchPath = searchPaths_1[_i]; - var resolvedModule = Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log); - if (resolvedModule) { - this.enableProxy(resolvedModule, pluginConfigEntry); - return; - } - } - this.projectService.logger.info("Couldn't find " + pluginConfigEntry.name); - }; - ConfiguredProject.prototype.enableProxy = function (pluginModuleFactory, configEntry) { - try { - if (typeof pluginModuleFactory !== "function") { - this.projectService.logger.info("Skipped loading plugin " + configEntry.name + " because it did expose a proper factory function"); - return; - } - var info = { - config: configEntry, - project: this, - languageService: this.languageService, - languageServiceHost: this, - serverHost: this.projectService.host - }; - var pluginModule = pluginModuleFactory({ typescript: ts }); - var newLS = pluginModule.create(info); - for (var _i = 0, _a = Object.keys(this.languageService); _i < _a.length; _i++) { - var k = _a[_i]; - if (!(k in newLS)) { - this.projectService.logger.info("Plugin activation warning: Missing proxied method " + k + " in created LS. Patching."); - newLS[k] = this.languageService[k]; - } - } - this.projectService.logger.info("Plugin validation succeded"); - this.languageService = newLS; - this.plugins.push(pluginModule); - } - catch (e) { - this.projectService.logger.info("Plugin activation failed: " + e); - } + this.enableGlobalPlugins(); }; /** * Get the errors that dont have any file name associated @@ -103909,27 +107119,11 @@ var ts; this.projectErrors = projectErrors; }; ConfiguredProject.prototype.setTypeAcquisition = function (newTypeAcquisition) { - this.typeAcquisition = newTypeAcquisition; + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); }; ConfiguredProject.prototype.getTypeAcquisition = function () { return this.typeAcquisition; }; - ConfiguredProject.prototype.getExternalFiles = function () { - var _this = this; - return server.toSortedArray(ts.flatMap(this.plugins, function (plugin) { - if (typeof plugin.getExternalFiles !== "function") - return; - try { - return plugin.getExternalFiles(_this); - } - catch (e) { - _this.projectService.logger.info("A plugin threw an exception in getExternalFiles: " + e); - if (e.stack) { - _this.projectService.logger.info(e.stack); - } - } - })); - }; /*@internal*/ ConfiguredProject.prototype.watchWildcards = function (wildcardDirectories) { var _this = this; @@ -104007,9 +107201,9 @@ var ts; var ExternalProject = /** @class */ (function (_super) { __extends(ExternalProject, _super); /*@internal*/ - function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, languageServiceEnabled, compileOnSaveEnabled, projectFilePath) { + function ExternalProject(externalProjectName, projectService, documentRegistry, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, projectFilePath) { var _this = _super.call(this, externalProjectName, ProjectKind.External, projectService, documentRegistry, - /*hasExplicitListOfFiles*/ true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled, projectService.host, ts.getDirectoryPath(projectFilePath || ts.normalizeSlashes(externalProjectName))) || this; + /*hasExplicitListOfFiles*/ true, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, projectService.host, ts.getDirectoryPath(projectFilePath || ts.normalizeSlashes(externalProjectName))) || this; _this.externalProjectName = externalProjectName; _this.compileOnSaveEnabled = compileOnSaveEnabled; _this.excludedFiles = []; @@ -104026,7 +107220,7 @@ var ts; ts.Debug.assert(!!newTypeAcquisition.include, "newTypeAcquisition.include may not be null/undefined"); ts.Debug.assert(!!newTypeAcquisition.exclude, "newTypeAcquisition.exclude may not be null/undefined"); ts.Debug.assert(typeof newTypeAcquisition.enable === "boolean", "newTypeAcquisition.enable may not be null/undefined"); - this.typeAcquisition = newTypeAcquisition; + this.typeAcquisition = this.removeLocalTypingsFromTypeAcquisition(newTypeAcquisition); }; return ExternalProject; }(Project)); @@ -104155,16 +107349,6 @@ var ts; } } server.convertScriptKindName = convertScriptKindName; - /** - * This helper function processes a list of projects and return the concatenated, sortd and deduplicated output of processing each project. - */ - function combineProjectOutput(projects, action, comparer, areEqual) { - var outputs = ts.flatMap(projects, action); - return comparer - ? ts.sortAndDeduplicate(outputs, comparer, areEqual) - : ts.deduplicate(outputs, areEqual); - } - server.combineProjectOutput = combineProjectOutput; var fileNamePropertyReader = { getFileName: function (x) { return x; }, getScriptKind: function (fileName, extraFileExtensions) { @@ -104281,6 +107465,9 @@ var ts; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; this.typesMapLocation = (opts.typesMapLocation === undefined) ? ts.combinePaths(this.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); + if (this.host.realpath) { + this.realpathToScriptInfos = ts.createMultiMap(); + } this.currentDirectory = this.host.getCurrentDirectory(); this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames); this.throttledOperations = new server.ThrottledOperations(this.host, this.logger); @@ -104331,10 +107518,6 @@ var ts; return ts.getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory()); }; /* @internal */ - ProjectService.prototype.getChangedFiles_TestOnly = function () { - return this.changedFiles; - }; - /* @internal */ ProjectService.prototype.ensureInferredProjectsUpToDate_TestOnly = function () { this.ensureProjectStructuresUptoDate(); }; @@ -104387,25 +107570,26 @@ var ts; } switch (response.kind) { case server.ActionSet: + project.resolutionCache.clear(); this.typingsCache.updateTypingsForProject(response.projectName, response.compilerOptions, response.typeAcquisition, response.unresolvedImports, response.typings); break; case server.ActionInvalidate: + project.resolutionCache.clear(); this.typingsCache.deleteTypingsForProject(response.projectName); break; } - this.delayUpdateProjectGraphAndInferredProjectsRefresh(project); + this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); }; - ProjectService.prototype.delayInferredProjectsRefresh = function () { + ProjectService.prototype.delayEnsureProjectForOpenFiles = function () { var _this = this; - this.pendingInferredProjectUpdate = true; - this.throttledOperations.schedule("*refreshInferredProjects*", /*delay*/ 250, function () { + this.pendingEnsureProjectForOpenFiles = true; + this.throttledOperations.schedule("*ensureProjectForOpenFiles*", /*delay*/ 250, function () { if (_this.pendingProjectUpdates.size !== 0) { - _this.delayInferredProjectsRefresh(); + _this.delayEnsureProjectForOpenFiles(); } else { - if (_this.pendingInferredProjectUpdate) { - _this.pendingInferredProjectUpdate = false; - _this.refreshInferredProjects(); + if (_this.pendingEnsureProjectForOpenFiles) { + _this.ensureProjectForOpenFiles(); } // Send the event to notify that there were background project updates // send current list of open files @@ -104415,6 +107599,7 @@ var ts; }; ProjectService.prototype.delayUpdateProjectGraph = function (project) { var _this = this; + project.markAsDirty(); var projectName = project.getProjectName(); this.pendingProjectUpdates.set(projectName, project); this.throttledOperations.schedule(projectName, /*delay*/ 250, function () { @@ -104441,17 +107626,16 @@ var ts; this.eventHandler(event); }; /* @internal */ - ProjectService.prototype.delayUpdateProjectGraphAndInferredProjectsRefresh = function (project) { - project.markAsDirty(); + ProjectService.prototype.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles = function (project) { this.delayUpdateProjectGraph(project); - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); }; ProjectService.prototype.delayUpdateProjectGraphs = function (projects) { for (var _i = 0, projects_3 = projects; _i < projects_3.length; _i++) { var project = projects_3[_i]; this.delayUpdateProjectGraph(project); } - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); }; ProjectService.prototype.setCompilerOptionsForInferredProjects = function (projectCompilerOptions, projectRootPath) { ts.Debug.assert(projectRootPath === undefined || this.useInferredProjectPerProjectRoot, "Setting compiler options per project root path is only supported when useInferredProjectPerProjectRoot is enabled"); @@ -104466,7 +107650,6 @@ var ts; else { this.compilerOptionsForInferredProjects = compilerOptions; } - var projectsToUpdate = []; for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { var project = _a[_i]; // Only update compiler options in the following cases: @@ -104483,10 +107666,10 @@ var ts; project.setCompilerOptions(compilerOptions); project.compileOnSaveEnabled = compilerOptions.compileOnSave; project.markAsDirty(); - projectsToUpdate.push(project); + this.delayUpdateProjectGraph(project); } } - this.delayUpdateProjectGraphs(projectsToUpdate); + this.delayEnsureProjectForOpenFiles(); }; ProjectService.prototype.findProject = function (projectName) { if (projectName === undefined) { @@ -104500,7 +107683,7 @@ var ts; }; ProjectService.prototype.getDefaultProjectForFile = function (fileName, ensureProject) { var scriptInfo = this.getScriptInfoForNormalizedPath(fileName); - if (ensureProject && !scriptInfo || scriptInfo.isOrphan()) { + if (ensureProject && (!scriptInfo || scriptInfo.isOrphan())) { this.ensureProjectStructuresUptoDate(); scriptInfo = this.getScriptInfoForNormalizedPath(fileName); if (!scriptInfo) { @@ -104517,49 +107700,26 @@ var ts; /** * Ensures the project structures are upto date * This means, - * - if there are changedFiles (the files were updated but their containing project graph was not upto date), - * their project graph is updated - * - If there are pendingProjectUpdates (scheduled to be updated with delay so they can batch update the graph if there are several changes in short time span) - * their project graph is updated - * - If there were project graph updates and/or there was pending inferred project update and/or called forced the inferred project structure refresh - * Inferred projects are created/updated/deleted based on open files states - * @param forceInferredProjectsRefresh when true updates the inferred projects even if there is no pending work to update the files/project structures + * - we go through all the projects and update them if they are dirty + * - if updates reflect some change in structure or there was pending request to ensure projects for open files + * ensure that each open script info has project */ - ProjectService.prototype.ensureProjectStructuresUptoDate = function (forceInferredProjectsRefresh) { - if (this.changedFiles) { - var projectsToUpdate = void 0; - if (this.changedFiles.length === 1) { - // simpliest case - no allocations - projectsToUpdate = this.changedFiles[0].containingProjects; - } - else { - projectsToUpdate = []; - for (var _i = 0, _a = this.changedFiles; _i < _a.length; _i++) { - var f = _a[_i]; - ts.addRange(projectsToUpdate, f.containingProjects); - } - } - this.changedFiles = undefined; - this.updateProjectGraphs(projectsToUpdate); - } - if (this.pendingProjectUpdates.size !== 0) { - var projectsToUpdate = ts.arrayFrom(this.pendingProjectUpdates.values()); - this.pendingProjectUpdates.clear(); - this.updateProjectGraphs(projectsToUpdate); - } - if (this.pendingInferredProjectUpdate || forceInferredProjectsRefresh) { - this.pendingInferredProjectUpdate = false; - this.refreshInferredProjects(); + ProjectService.prototype.ensureProjectStructuresUptoDate = function () { + var _this = this; + var hasChanges = this.pendingEnsureProjectForOpenFiles; + this.pendingProjectUpdates.clear(); + var updateGraph = function (project) { + hasChanges = _this.updateProjectIfDirty(project) || hasChanges; + }; + this.externalProjects.forEach(updateGraph); + this.configuredProjects.forEach(updateGraph); + this.inferredProjects.forEach(updateGraph); + if (hasChanges) { + this.ensureProjectForOpenFiles(); } }; - ProjectService.prototype.findContainingExternalProject = function (fileName) { - for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { - var proj = _a[_i]; - if (proj.containsFile(fileName)) { - return proj; - } - } - return undefined; + ProjectService.prototype.updateProjectIfDirty = function (project) { + return project.dirty && project.updateGraph(); }; ProjectService.prototype.getFormatCodeOptions = function (file) { var formatCodeSettings; @@ -104571,14 +107731,6 @@ var ts; } return formatCodeSettings || this.hostConfiguration.formatCodeOptions; }; - ProjectService.prototype.updateProjectGraphs = function (projects) { - for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { - var p = projects_4[_i]; - if (!p.updateGraph()) { - this.pendingInferredProjectUpdate = true; - } - } - }; ProjectService.prototype.onSourceFileChanged = function (fileName, eventKind) { var info = this.getScriptInfoForNormalizedPath(fileName); if (!info) { @@ -104592,7 +107744,7 @@ var ts; if (info.containingProjects.length === 0) { // Orphan script info, remove it as we can always reload it on next open file request this.stopWatchingScriptInfo(info); - this.filenameToScriptInfo.delete(info.path); + this.deleteScriptInfo(info); } else { // file has been changed which might affect the set of referenced files in projects that include @@ -104604,9 +107756,8 @@ var ts; }; ProjectService.prototype.handleDeletedFile = function (info) { this.stopWatchingScriptInfo(info); - // TODO: handle isOpen = true case if (!info.isScriptOpen()) { - this.filenameToScriptInfo.delete(info.path); + this.deleteScriptInfo(info); // capture list of projects since detachAllProjects will wipe out original list var containingProjects = info.containingProjects.slice(); info.detachAllProjects(); @@ -104633,7 +107784,7 @@ var ts; // Reload is pending, do the reload if (project.pendingReload !== ts.ConfigFileProgramReloadLevel.Full) { project.pendingReload = ts.ConfigFileProgramReloadLevel.Partial; - _this.delayUpdateProjectGraphAndInferredProjectsRefresh(project); + _this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project); } }, flags, "Wild card directory" /* WildcardDirectories */, project); }; @@ -104709,7 +107860,7 @@ var ts; ts.Debug.assert(info.isOrphan()); var project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath) || this.getOrCreateSingleInferredProjectIfEnabled() || - this.createInferredProject(ts.getDirectoryPath(info.path)); + this.createInferredProject(info.isDynamic ? this.currentDirectory : ts.getDirectoryPath(info.path)); project.addRoot(info); project.updateGraph(); if (!this.useSingleInferredProject && !project.projectRootPath) { @@ -104811,10 +107962,17 @@ var ts; if (!info.isScriptOpen() && info.isOrphan()) { // if there are not projects that include this script info - delete it _this.stopWatchingScriptInfo(info); - _this.filenameToScriptInfo.delete(info.path); + _this.deleteScriptInfo(info); } }); }; + ProjectService.prototype.deleteScriptInfo = function (info) { + this.filenameToScriptInfo.delete(info.path); + var realpath = info.getRealpathIfDifferent(); + if (realpath) { + this.realpathToScriptInfos.remove(realpath, info); + } + }; ProjectService.prototype.configFileExists = function (configFileName, canonicalConfigFilePath, info) { var configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath); if (configFileExistenceInfo) { @@ -105064,8 +108222,8 @@ var ts; this.logger.startGroup(); var counter = 0; var printProjects = function (projects, counter) { - for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { - var project = projects_5[_i]; + for (var _i = 0, projects_4 = projects; _i < projects_4.length; _i++) { + var project = projects_4[_i]; _this.logger.info("Project '" + project.getProjectName() + "' (" + server.ProjectKind[project.projectKind] + ") " + counter); _this.logger.info(project.filesToString(writeProjectFileNames)); _this.logger.info("-----------------------------------------------"); @@ -105078,7 +108236,11 @@ var ts; printProjects(this.inferredProjects, counter); this.logger.info("Open files: "); this.openFiles.forEach(function (projectRootPath, path) { - _this.logger.info("\tFileName: " + _this.getScriptInfoForPath(path).fileName + " ProjectRootPath: " + projectRootPath); + var info = _this.getScriptInfoForPath(path); + _this.logger.info("\tFileName: " + info.fileName + " ProjectRootPath: " + projectRootPath); + if (writeProjectFileNames) { + _this.logger.info("\t\tProjects: " + info.containingProjects.map(function (p) { return p.getProjectName(); })); + } }); this.logger.endGroup(); }; @@ -105121,9 +108283,10 @@ var ts; }; return { projectOptions: projectOptions, configFileErrors: errors, configFileSpecs: parsedCommandLine.configFileSpecs }; }; - ProjectService.prototype.exceededTotalSizeLimitForNonTsFiles = function (name, options, fileNames, propertyReader) { + /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */ + ProjectService.prototype.getFilenameForExceededTotalSizeLimitForNonTsFiles = function (name, options, fileNames, propertyReader) { if (options && options.disableSizeLimit || !this.host.getFileSize) { - return false; + return; } var availableSpace = server.maxProgramSizeForNonTsFiles; this.projectToSizeMap.set(name, 0); @@ -105136,18 +108299,14 @@ var ts; continue; } totalNonTsFileSize += this.host.getFileSize(fileName); - if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles) { + if (totalNonTsFileSize > server.maxProgramSizeForNonTsFiles || totalNonTsFileSize > availableSpace) { this.logger.info(getExceedLimitMessage({ propertyReader: propertyReader, hasTypeScriptFileExtension: ts.hasTypeScriptFileExtension, host: this.host }, totalNonTsFileSize)); // Keep the size as zero since it's disabled - return true; + return fileName; } } - if (totalNonTsFileSize > availableSpace) { - this.logger.info(getExceedLimitMessage({ propertyReader: propertyReader, hasTypeScriptFileExtension: ts.hasTypeScriptFileExtension, host: this.host }, totalNonTsFileSize)); - return true; - } this.projectToSizeMap.set(name, totalNonTsFileSize); - return false; + return; function getExceedLimitMessage(context, totalNonTsFileSize) { var files = getTop5LargestFiles(context); return "Non TS file size exceeded limit (" + totalNonTsFileSize + "). Largest files: " + files.map(function (file) { return file.name + ":" + file.size; }).join(", "); @@ -105164,7 +108323,7 @@ var ts; ProjectService.prototype.createExternalProject = function (projectFileName, files, options, typeAcquisition, excludedFiles) { var compilerOptions = convertCompilerOptions(options); var project = new server.ExternalProject(projectFileName, this, this.documentRegistry, compilerOptions, - /*languageServiceEnabled*/ !this.exceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); + /*lastFileExceededProgramSize*/ this.getFilenameForExceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader), options.compileOnSave === undefined ? true : options.compileOnSave); project.excludedFiles = excludedFiles; this.addFilesToNonInferredProjectAndUpdateGraph(project, files, externalFilePropertyReader, typeAcquisition); this.externalProjects.push(project); @@ -105219,15 +108378,15 @@ var ts; }; ProjectService.prototype.createConfiguredProject = function (configFileName) { var _this = this; - var cachedDirectoryStructureHost = ts.createCachedDirectoryStructureHost(this.host); + var cachedDirectoryStructureHost = ts.createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames); var _a = this.convertConfigFileContentToProjectOptions(configFileName, cachedDirectoryStructureHost), projectOptions = _a.projectOptions, configFileErrors = _a.configFileErrors, configFileSpecs = _a.configFileSpecs; this.logger.info("Opened configuration file " + configFileName); - var languageServiceEnabled = !this.exceededTotalSizeLimitForNonTsFiles(configFileName, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); - var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, languageServiceEnabled, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave, cachedDirectoryStructureHost); + var lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(configFileName, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); + var project = new server.ConfiguredProject(configFileName, this, this.documentRegistry, projectOptions.configHasFilesProperty, projectOptions.compilerOptions, lastFileExceededProgramSize, projectOptions.compileOnSave === undefined ? false : projectOptions.compileOnSave, cachedDirectoryStructureHost); project.configFileSpecs = configFileSpecs; // TODO: We probably should also watch the configFiles that are extended project.configFileWatcher = this.watchFile(this.host, configFileName, function (_fileName, eventKind) { return _this.onConfigChangedForConfiguredProject(project, eventKind); }, "Config file for the program" /* ConfigFilePath */, project); - if (languageServiceEnabled) { + if (!lastFileExceededProgramSize) { project.watchWildcards(projectOptions.wildcardDirectories); } project.setProjectErrors(configFileErrors); @@ -105330,8 +108489,9 @@ var ts; // Update the project project.configFileSpecs = configFileSpecs; project.setProjectErrors(configFileErrors); - if (this.exceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader)) { - project.disableLanguageService(); + var lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(project.canonicalConfigFilePath, projectOptions.compilerOptions, projectOptions.files, fileNamePropertyReader); + if (lastFileExceededProgramSize) { + project.disableLanguageService(lastFileExceededProgramSize); project.stopWatchingWildCards(); } else { @@ -105351,7 +108511,7 @@ var ts; }); }; ProjectService.prototype.getOrCreateInferredProjectForProjectRootPathIfEnabled = function (info, projectRootPath) { - if (!this.useInferredProjectPerProjectRoot) { + if (info.isDynamic || !this.useInferredProjectPerProjectRoot) { return undefined; } if (projectRootPath) { @@ -105421,6 +108581,44 @@ var ts; ProjectService.prototype.getScriptInfo = function (uncheckedFileName) { return this.getScriptInfoForNormalizedPath(server.toNormalizedPath(uncheckedFileName)); }; + /** + * Returns the projects that contain script info through SymLink + * Note that this does not return projects in info.containingProjects + */ + /*@internal*/ + ProjectService.prototype.getSymlinkedProjects = function (info) { + var projects; + if (this.realpathToScriptInfos) { + var realpath = info.getRealpathIfDifferent(); + if (realpath) { + ts.forEach(this.realpathToScriptInfos.get(realpath), combineProjects); + } + ts.forEach(this.realpathToScriptInfos.get(info.path), combineProjects); + } + return projects; + function combineProjects(toAddInfo) { + if (toAddInfo !== info) { + var _loop_12 = function (project) { + // Add the projects only if they can use symLink targets and not already in the list + if (project.languageServiceEnabled && + !project.getCompilerOptions().preserveSymlinks && + !ts.contains(info.containingProjects, project)) { + if (!projects) { + projects = ts.createMultiMap(); + projects.add(toAddInfo.path, project); + } + else if (!ts.forEachEntry(projects, function (projs, path) { return path === toAddInfo.path ? false : ts.contains(projs, project); })) { + projects.add(toAddInfo.path, project); + } + } + }; + for (var _i = 0, _a = toAddInfo.containingProjects; _i < _a.length; _i++) { + var project = _a[_i]; + _loop_12(project); + } + } + } + }; ProjectService.prototype.watchClosedScriptInfo = function (info) { var _this = this; ts.Debug.assert(!info.fileWatcher); @@ -105448,13 +108646,15 @@ var ts; return this.getOrCreateScriptInfoWorker(fileName, this.currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn); }; ProjectService.prototype.getOrCreateScriptInfoWorker = function (fileName, currentDirectory, openedByClient, fileContent, scriptKind, hasMixedContent, hostToQueryFileExistsOn) { + var _this = this; ts.Debug.assert(fileContent === undefined || openedByClient, "ScriptInfo needs to be opened by client to be able to set its user defined content"); var path = server.normalizedPathToPath(fileName, currentDirectory, this.toCanonicalFileName); var info = this.getScriptInfoForPath(path); if (!info) { - ts.Debug.assert(ts.isRootedDiskPath(fileName) || openedByClient, "Script info with relative file name can only be open script info"); - ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "Open script files with non rooted disk path opened with current directory context cannot have same canonical names"); var isDynamic = server.isDynamicFileName(fileName); + ts.Debug.assert(ts.isRootedDiskPath(fileName) || isDynamic || openedByClient, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nScript info with non-dynamic relative file name can only be open script info"; }); + ts.Debug.assert(!ts.isRootedDiskPath(fileName) || this.currentDirectory === currentDirectory || !this.openFilesWithNonRootedDiskPath.has(this.toCanonicalFileName(fileName)), "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nOpen script files with non rooted disk path opened with current directory context cannot have same canonical names"; }); + ts.Debug.assert(!isDynamic || this.currentDirectory === currentDirectory, "", function () { return JSON.stringify({ fileName: fileName, currentDirectory: currentDirectory, hostCurrentDirectory: _this.currentDirectory, openKeys: ts.arrayFrom(_this.openFilesWithNonRootedDiskPath.keys()) }) + "\nDynamic files must always have current directory context since containing external project name will always match the script info name."; }); // If the file is not opened by client and the file doesnot exist on the disk, return if (!openedByClient && !isDynamic && !(hostToQueryFileExistsOn || this.host).fileExists(fileName)) { return; @@ -105534,7 +108734,7 @@ var ts; // as there is no need to load contents of the files from the disk // Reload Projects this.reloadConfiguredProjectForFiles(this.openFiles, /*delayReload*/ false, ts.returnTrue); - this.refreshInferredProjects(); + this.ensureProjectForOpenFiles(); }; ProjectService.prototype.delayReloadConfiguredProjectForFiles = function (configFileExistenceInfo, ignoreIfNotRootOfInferredProject) { // Get open files to reload projects for @@ -105543,7 +108743,7 @@ var ts; function (isRootOfInferredProject) { return isRootOfInferredProject; } : // Reload open files if they are root of inferred project ts.returnTrue // Reload all the open files impacted by config file ); - this.delayInferredProjectsRefresh(); + this.delayEnsureProjectForOpenFiles(); }; /** * This function goes through all the openFiles and tries to file the config file for them. @@ -105623,9 +108823,9 @@ var ts; * This will go through open files and assign them to inferred project if open file is not part of any other project * After that all the inferred project graphs are updated */ - ProjectService.prototype.refreshInferredProjects = function () { + ProjectService.prototype.ensureProjectForOpenFiles = function () { var _this = this; - this.logger.info("refreshInferredProjects: updating project structure from ..."); + this.logger.info("Structure before ensureProjectForOpenFiles:"); this.printProjects(); this.openFiles.forEach(function (projectRootPath, path) { var info = _this.getScriptInfoForPath(path); @@ -105638,11 +108838,9 @@ var ts; _this.removeRootOfInferredProjectIfNowPartOfOtherProject(info); } }); - for (var _i = 0, _a = this.inferredProjects; _i < _a.length; _i++) { - var p = _a[_i]; - p.updateGraph(); - } - this.logger.info("refreshInferredProjects: updated project structure ..."); + this.pendingEnsureProjectForOpenFiles = false; + this.inferredProjects.forEach(function (p) { return _this.updateProjectIfDirty(p); }); + this.logger.info("Structure after ensureProjectForOpenFiles:"); this.printProjects(); }; /** @@ -105653,44 +108851,55 @@ var ts; ProjectService.prototype.openClientFile = function (fileName, fileContent, scriptKind, projectRootPath) { return this.openClientFileWithNormalizedPath(server.toNormalizedPath(fileName), fileContent, scriptKind, /*hasMixedContent*/ false, projectRootPath ? server.toNormalizedPath(projectRootPath) : undefined); }; + ProjectService.prototype.findExternalProjetContainingOpenScriptInfo = function (info) { + for (var _i = 0, _a = this.externalProjects; _i < _a.length; _i++) { + var proj = _a[_i]; + // Ensure project structure is uptodate to check if info is present in external project + proj.updateGraph(); + if (proj.containsScriptInfo(info)) { + return proj; + } + } + return undefined; + }; ProjectService.prototype.openClientFileWithNormalizedPath = function (fileName, fileContent, scriptKind, hasMixedContent, projectRootPath) { var _this = this; var configFileName; - var sendConfigFileDiagEvent = false; var configFileErrors; var info = this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, projectRootPath ? this.getNormalizedAbsolutePath(projectRootPath) : this.currentDirectory, fileContent, scriptKind, hasMixedContent); - var project = this.findContainingExternalProject(fileName); + var project = this.findExternalProjetContainingOpenScriptInfo(info); if (!project) { configFileName = this.getConfigFileNameForFile(info, projectRootPath); if (configFileName) { project = this.findConfiguredProjectByProjectName(configFileName); if (!project) { project = this.createConfiguredProject(configFileName); - // Send the event only if the project got created as part of this open request - sendConfigFileDiagEvent = true; + // Send the event only if the project got created as part of this open request and info is part of the project + if (info.isOrphan()) { + // Since the file isnt part of configured project, do not send config file info + configFileName = undefined; + } + else { + configFileErrors = project.getAllProjectErrors(); + this.sendConfigFileDiagEvent(project, fileName); + } + } + else { + // Ensure project is ready to check if it contains opened script info + project.updateGraph(); } } } - if (project && !project.languageServiceEnabled) { - // if project language service is disabled then we create a program only for open files. - // this means that project should be marked as dirty to force rebuilding of the program - // on the next request - project.markAsDirty(); - } + // Project we have at this point is going to be updated since its either found through + // - external project search, which updates the project before checking if info is present in it + // - configured project - either created or updated to ensure we know correct status of info // At this point if file is part of any any configured or external project, then it would be present in the containing projects // So if it still doesnt have any containing projects, it needs to be part of inferred project if (info.isOrphan()) { - // Since the file isnt part of configured project, do not send config file event - configFileName = undefined; - sendConfigFileDiagEvent = false; this.assignOrphanScriptInfoToInferredProject(info, projectRootPath); } ts.Debug.assert(!info.isOrphan()); this.openFiles.set(info.path, projectRootPath); - if (sendConfigFileDiagEvent) { - configFileErrors = project.getAllProjectErrors(); - this.sendConfigFileDiagEvent(project, fileName); - } // Remove the configured projects that have zero references from open files. // This was postponed from closeOpenFile to after opening next file, // so that we can reuse the project if we need to right away @@ -105761,11 +108970,6 @@ var ts; this.closeClientFile(file); } } - // if files were open or closed then explicitly refresh list of inferred projects - // otherwise if there were only changes in files - record changed files in `changedFiles` and defer the update - if (openFiles || closedFiles) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } }; /* @internal */ ProjectService.prototype.applyChangesToFile = function (scriptInfo, changes) { @@ -105774,12 +108978,6 @@ var ts; var change = changes[i]; scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText); } - if (!this.changedFiles) { - this.changedFiles = [scriptInfo]; - } - else if (!ts.contains(this.changedFiles, scriptInfo)) { - this.changedFiles.push(scriptInfo); - } }; ProjectService.prototype.closeConfiguredProjectReferencedFromExternalProject = function (configFile) { var configuredProject = this.findConfiguredProjectByProjectName(configFile); @@ -105787,36 +108985,25 @@ var ts; configuredProject.deleteExternalProjectReference(); if (!configuredProject.hasOpenRef()) { this.removeProject(configuredProject); - return true; + return; } } - return false; }; - ProjectService.prototype.closeExternalProject = function (uncheckedFileName, suppressRefresh) { - if (suppressRefresh === void 0) { suppressRefresh = false; } + ProjectService.prototype.closeExternalProject = function (uncheckedFileName) { var fileName = server.toNormalizedPath(uncheckedFileName); var configFiles = this.externalProjectToConfiguredProjectMap.get(fileName); if (configFiles) { - var shouldRefreshInferredProjects = false; for (var _i = 0, configFiles_1 = configFiles; _i < configFiles_1.length; _i++) { var configFile = configFiles_1[_i]; - if (this.closeConfiguredProjectReferencedFromExternalProject(configFile)) { - shouldRefreshInferredProjects = true; - } + this.closeConfiguredProjectReferencedFromExternalProject(configFile); } this.externalProjectToConfiguredProjectMap.delete(fileName); - if (shouldRefreshInferredProjects && !suppressRefresh) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } } else { // close external project var externalProject = this.findExternalProjectByProjectName(uncheckedFileName); if (externalProject) { this.removeProject(externalProject); - if (!suppressRefresh) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } } } }; @@ -105827,17 +109014,16 @@ var ts; ts.forEachKey(this.externalProjectToConfiguredProjectMap, function (externalProjectName) { projectsToClose.set(externalProjectName, true); }); - for (var _i = 0, projects_6 = projects; _i < projects_6.length; _i++) { - var externalProject = projects_6[_i]; - this.openExternalProject(externalProject, /*suppressRefreshOfInferredProjects*/ true); + for (var _i = 0, projects_5 = projects; _i < projects_5.length; _i++) { + var externalProject = projects_5[_i]; + this.openExternalProject(externalProject); // delete project that is present in input list projectsToClose.delete(externalProject.projectFileName); } // close projects that were missing in the input list ts.forEachKey(projectsToClose, function (externalProjectName) { - _this.closeExternalProject(externalProjectName, /*suppressRefresh*/ true); + _this.closeExternalProject(externalProjectName); }); - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); }; ProjectService.escapeFilenameForRegex = function (filename) { return filename.replace(this.filenameEscapeRegexp, "\\$&"); @@ -105858,11 +109044,11 @@ var ts; var normalizedNames = rootFiles.map(function (f) { return ts.normalizeSlashes(f.fileName); }); var excludedFiles = []; var _loop_14 = function (name) { - var rule = this_3.safelist[name]; + var rule = this_2.safelist[name]; for (var _i = 0, normalizedNames_1 = normalizedNames; _i < normalizedNames_1.length; _i++) { var root = normalizedNames_1[_i]; if (rule.match.test(root)) { - this_3.logger.info("Excluding files based on rule " + name + " matching file '" + root + "'"); + this_2.logger.info("Excluding files based on rule " + name + " matching file '" + root + "'"); // If the file matches, collect its types packages and exclude rules if (rule.types) { for (var _a = 0, _b = rule.types; _a < _b.length; _a++) { @@ -105915,7 +109101,7 @@ var ts; } } }; - var this_3 = this; + var this_2 = this; for (var _i = 0, _a = Object.keys(this.safelist); _i < _a.length; _i++) { var name = _a[_i]; _loop_14(name); @@ -105933,13 +109119,13 @@ var ts; if (ts.fileExtensionIs(baseName, "js")) { var inferredTypingName = ts.removeFileExtension(baseName); var cleanedTypingName = ts.removeMinAndVersionNumbers(inferredTypingName); - if (this_4.legacySafelist[cleanedTypingName]) { - this_4.logger.info("Excluded '" + normalizedNames[i] + "' because it matched " + cleanedTypingName + " from the legacy safelist"); + if (this_3.legacySafelist[cleanedTypingName]) { + this_3.logger.info("Excluded '" + normalizedNames[i] + "' because it matched " + cleanedTypingName + " from the legacy safelist"); excludedFiles.push(normalizedNames[i]); // *exclude* it from the project... exclude = true; // ... but *include* it in the list of types to acquire - var typeName = this_4.legacySafelist[cleanedTypingName]; + var typeName = this_3.legacySafelist[cleanedTypingName]; // Same best-effort dedupe as above if (typeAcqInclude.indexOf(typeName) < 0) { typeAcqInclude.push(typeName); @@ -105958,15 +109144,14 @@ var ts; } } }; - var this_4 = this; + var this_3 = this; for (var i = 0; i < proj.rootFiles.length; i++) { _loop_16(i); } proj.rootFiles = filesToKeep; return excludedFiles; }; - ProjectService.prototype.openExternalProject = function (proj, suppressRefreshOfInferredProjects) { - if (suppressRefreshOfInferredProjects === void 0) { suppressRefreshOfInferredProjects = false; } + ProjectService.prototype.openExternalProject = function (proj) { // typingOptions has been deprecated and is only supported for backward compatibility // purposes. It should be removed in future releases - use typeAcquisition instead. if (proj.typingOptions && !proj.typeAcquisition) { @@ -106004,8 +109189,9 @@ var ts; externalProject.excludedFiles = excludedFiles; if (!tsConfigFiles) { var compilerOptions = convertCompilerOptions(proj.options); - if (this.exceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader)) { - externalProject.disableLanguageService(); + var lastFileExceededProgramSize = this.getFilenameForExceededTotalSizeLimitForNonTsFiles(proj.projectFileName, compilerOptions, proj.rootFiles, externalFilePropertyReader); + if (lastFileExceededProgramSize) { + externalProject.disableLanguageService(lastFileExceededProgramSize); } else { externalProject.enableLanguageService(); @@ -106016,13 +109202,13 @@ var ts; } // some config files were added to external project (that previously were not there) // close existing project and later we'll open a set of configured projects for these files - this.closeExternalProject(proj.projectFileName, /*suppressRefresh*/ true); + this.closeExternalProject(proj.projectFileName); } else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) { // this project used to include config files if (!tsConfigFiles) { // config files were removed from the project - close existing external project which in turn will close configured projects - this.closeExternalProject(proj.projectFileName, /*suppressRefresh*/ true); + this.closeExternalProject(proj.projectFileName); } else { // project previously had some config files - compare them with new set of files and close all configured projects that correspond to unused files @@ -106073,9 +109259,6 @@ var ts; this.externalProjectToConfiguredProjectMap.delete(proj.projectFileName); this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles); } - if (!suppressRefreshOfInferredProjects) { - this.ensureProjectStructuresUptoDate(/*refreshInferredProjects*/ true); - } }; /** Makes a filename safe to insert in a RegExp */ ProjectService.filenameEscapeRegexp = /[-\/\\^$*+?.()|[\]{}]/g; @@ -106572,10 +109755,10 @@ var ts; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + options + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, options); }); }; /** Get a string based representation of a completion list entry details */ - LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, options /*Services.FormatCodeOptions*/, source) { + LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, options, source) { var _this = this; return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { - var localOptions = JSON.parse(options); + var localOptions = options === undefined ? undefined : JSON.parse(options); return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source); }); }; @@ -106711,7 +109894,7 @@ var ts; var _this = this; return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { // for now treat files as JavaScript - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); + var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true); return { referencedFiles: _this.convertFileReferences(result.referencedFiles), importedFiles: _this.convertFileReferences(result.importedFiles), @@ -106746,8 +109929,7 @@ var ts; CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) { var _this = this; return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () { - var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); - var result = ts.parseJsonText(fileName, text); + var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot)); var normalizedFileName = ts.normalizeSlashes(fileName); var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName); return { @@ -106770,7 +109952,7 @@ var ts; if (_this.safeList === undefined) { _this.safeList = ts.JsTyping.loadSafeList(_this.host, ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName)); } - return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports); + return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports, info.typesRegistry); }); }; return CoreServicesShimObject; diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts index 9573a51760f..21ea143e8c5 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts @@ -59,6 +59,7 @@ declare namespace ts { pos: number; end: number; } + type JsDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.Unknown; enum SyntaxKind { Unknown = 0, EndOfFileToken = 1, @@ -186,177 +187,180 @@ declare namespace ts { ConstructorKeyword = 123, DeclareKeyword = 124, GetKeyword = 125, - IsKeyword = 126, - KeyOfKeyword = 127, - ModuleKeyword = 128, - NamespaceKeyword = 129, - NeverKeyword = 130, - ReadonlyKeyword = 131, - RequireKeyword = 132, - NumberKeyword = 133, - ObjectKeyword = 134, - SetKeyword = 135, - StringKeyword = 136, - SymbolKeyword = 137, - TypeKeyword = 138, - UndefinedKeyword = 139, - UniqueKeyword = 140, - FromKeyword = 141, - GlobalKeyword = 142, - OfKeyword = 143, - QualifiedName = 144, - ComputedPropertyName = 145, - TypeParameter = 146, - Parameter = 147, - Decorator = 148, - PropertySignature = 149, - PropertyDeclaration = 150, - MethodSignature = 151, - MethodDeclaration = 152, - Constructor = 153, - GetAccessor = 154, - SetAccessor = 155, - CallSignature = 156, - ConstructSignature = 157, - IndexSignature = 158, - TypePredicate = 159, - TypeReference = 160, - FunctionType = 161, - ConstructorType = 162, - TypeQuery = 163, - TypeLiteral = 164, - ArrayType = 165, - TupleType = 166, - UnionType = 167, - IntersectionType = 168, - ParenthesizedType = 169, - ThisType = 170, - TypeOperator = 171, - IndexedAccessType = 172, - MappedType = 173, - LiteralType = 174, - ObjectBindingPattern = 175, - ArrayBindingPattern = 176, - BindingElement = 177, - ArrayLiteralExpression = 178, - ObjectLiteralExpression = 179, - PropertyAccessExpression = 180, - ElementAccessExpression = 181, - CallExpression = 182, - NewExpression = 183, - TaggedTemplateExpression = 184, - TypeAssertionExpression = 185, - ParenthesizedExpression = 186, - FunctionExpression = 187, - ArrowFunction = 188, - DeleteExpression = 189, - TypeOfExpression = 190, - VoidExpression = 191, - AwaitExpression = 192, - PrefixUnaryExpression = 193, - PostfixUnaryExpression = 194, - BinaryExpression = 195, - ConditionalExpression = 196, - TemplateExpression = 197, - YieldExpression = 198, - SpreadElement = 199, - ClassExpression = 200, - OmittedExpression = 201, - ExpressionWithTypeArguments = 202, - AsExpression = 203, - NonNullExpression = 204, - MetaProperty = 205, - TemplateSpan = 206, - SemicolonClassElement = 207, - Block = 208, - VariableStatement = 209, - EmptyStatement = 210, - ExpressionStatement = 211, - IfStatement = 212, - DoStatement = 213, - WhileStatement = 214, - ForStatement = 215, - ForInStatement = 216, - ForOfStatement = 217, - ContinueStatement = 218, - BreakStatement = 219, - ReturnStatement = 220, - WithStatement = 221, - SwitchStatement = 222, - LabeledStatement = 223, - ThrowStatement = 224, - TryStatement = 225, - DebuggerStatement = 226, - VariableDeclaration = 227, - VariableDeclarationList = 228, - FunctionDeclaration = 229, - ClassDeclaration = 230, - InterfaceDeclaration = 231, - TypeAliasDeclaration = 232, - EnumDeclaration = 233, - ModuleDeclaration = 234, - ModuleBlock = 235, - CaseBlock = 236, - NamespaceExportDeclaration = 237, - ImportEqualsDeclaration = 238, - ImportDeclaration = 239, - ImportClause = 240, - NamespaceImport = 241, - NamedImports = 242, - ImportSpecifier = 243, - ExportAssignment = 244, - ExportDeclaration = 245, - NamedExports = 246, - ExportSpecifier = 247, - MissingDeclaration = 248, - ExternalModuleReference = 249, - JsxElement = 250, - JsxSelfClosingElement = 251, - JsxOpeningElement = 252, - JsxClosingElement = 253, - JsxFragment = 254, - JsxOpeningFragment = 255, - JsxClosingFragment = 256, - JsxAttribute = 257, - JsxAttributes = 258, - JsxSpreadAttribute = 259, - JsxExpression = 260, - CaseClause = 261, - DefaultClause = 262, - HeritageClause = 263, - CatchClause = 264, - PropertyAssignment = 265, - ShorthandPropertyAssignment = 266, - SpreadAssignment = 267, - EnumMember = 268, - SourceFile = 269, - Bundle = 270, - JSDocTypeExpression = 271, - JSDocAllType = 272, - JSDocUnknownType = 273, - JSDocNullableType = 274, - JSDocNonNullableType = 275, - JSDocOptionalType = 276, - JSDocFunctionType = 277, - JSDocVariadicType = 278, - JSDocComment = 279, - JSDocTypeLiteral = 280, - JSDocTag = 281, - JSDocAugmentsTag = 282, - JSDocClassTag = 283, - JSDocParameterTag = 284, - JSDocReturnTag = 285, - JSDocTypeTag = 286, - JSDocTemplateTag = 287, - JSDocTypedefTag = 288, - JSDocPropertyTag = 289, - SyntaxList = 290, - NotEmittedStatement = 291, - PartiallyEmittedExpression = 292, - CommaListExpression = 293, - MergeDeclarationMarker = 294, - EndOfDeclarationMarker = 295, - Count = 296, + InferKeyword = 126, + IsKeyword = 127, + KeyOfKeyword = 128, + ModuleKeyword = 129, + NamespaceKeyword = 130, + NeverKeyword = 131, + ReadonlyKeyword = 132, + RequireKeyword = 133, + NumberKeyword = 134, + ObjectKeyword = 135, + SetKeyword = 136, + StringKeyword = 137, + SymbolKeyword = 138, + TypeKeyword = 139, + UndefinedKeyword = 140, + UniqueKeyword = 141, + FromKeyword = 142, + GlobalKeyword = 143, + OfKeyword = 144, + QualifiedName = 145, + ComputedPropertyName = 146, + TypeParameter = 147, + Parameter = 148, + Decorator = 149, + PropertySignature = 150, + PropertyDeclaration = 151, + MethodSignature = 152, + MethodDeclaration = 153, + Constructor = 154, + GetAccessor = 155, + SetAccessor = 156, + CallSignature = 157, + ConstructSignature = 158, + IndexSignature = 159, + TypePredicate = 160, + TypeReference = 161, + FunctionType = 162, + ConstructorType = 163, + TypeQuery = 164, + TypeLiteral = 165, + ArrayType = 166, + TupleType = 167, + UnionType = 168, + IntersectionType = 169, + ConditionalType = 170, + InferType = 171, + ParenthesizedType = 172, + ThisType = 173, + TypeOperator = 174, + IndexedAccessType = 175, + MappedType = 176, + LiteralType = 177, + ObjectBindingPattern = 178, + ArrayBindingPattern = 179, + BindingElement = 180, + ArrayLiteralExpression = 181, + ObjectLiteralExpression = 182, + PropertyAccessExpression = 183, + ElementAccessExpression = 184, + CallExpression = 185, + NewExpression = 186, + TaggedTemplateExpression = 187, + TypeAssertionExpression = 188, + ParenthesizedExpression = 189, + FunctionExpression = 190, + ArrowFunction = 191, + DeleteExpression = 192, + TypeOfExpression = 193, + VoidExpression = 194, + AwaitExpression = 195, + PrefixUnaryExpression = 196, + PostfixUnaryExpression = 197, + BinaryExpression = 198, + ConditionalExpression = 199, + TemplateExpression = 200, + YieldExpression = 201, + SpreadElement = 202, + ClassExpression = 203, + OmittedExpression = 204, + ExpressionWithTypeArguments = 205, + AsExpression = 206, + NonNullExpression = 207, + MetaProperty = 208, + TemplateSpan = 209, + SemicolonClassElement = 210, + Block = 211, + VariableStatement = 212, + EmptyStatement = 213, + ExpressionStatement = 214, + IfStatement = 215, + DoStatement = 216, + WhileStatement = 217, + ForStatement = 218, + ForInStatement = 219, + ForOfStatement = 220, + ContinueStatement = 221, + BreakStatement = 222, + ReturnStatement = 223, + WithStatement = 224, + SwitchStatement = 225, + LabeledStatement = 226, + ThrowStatement = 227, + TryStatement = 228, + DebuggerStatement = 229, + VariableDeclaration = 230, + VariableDeclarationList = 231, + FunctionDeclaration = 232, + ClassDeclaration = 233, + InterfaceDeclaration = 234, + TypeAliasDeclaration = 235, + EnumDeclaration = 236, + ModuleDeclaration = 237, + ModuleBlock = 238, + CaseBlock = 239, + NamespaceExportDeclaration = 240, + ImportEqualsDeclaration = 241, + ImportDeclaration = 242, + ImportClause = 243, + NamespaceImport = 244, + NamedImports = 245, + ImportSpecifier = 246, + ExportAssignment = 247, + ExportDeclaration = 248, + NamedExports = 249, + ExportSpecifier = 250, + MissingDeclaration = 251, + ExternalModuleReference = 252, + JsxElement = 253, + JsxSelfClosingElement = 254, + JsxOpeningElement = 255, + JsxClosingElement = 256, + JsxFragment = 257, + JsxOpeningFragment = 258, + JsxClosingFragment = 259, + JsxAttribute = 260, + JsxAttributes = 261, + JsxSpreadAttribute = 262, + JsxExpression = 263, + CaseClause = 264, + DefaultClause = 265, + HeritageClause = 266, + CatchClause = 267, + PropertyAssignment = 268, + ShorthandPropertyAssignment = 269, + SpreadAssignment = 270, + EnumMember = 271, + SourceFile = 272, + Bundle = 273, + JSDocTypeExpression = 274, + JSDocAllType = 275, + JSDocUnknownType = 276, + JSDocNullableType = 277, + JSDocNonNullableType = 278, + JSDocOptionalType = 279, + JSDocFunctionType = 280, + JSDocVariadicType = 281, + JSDocComment = 282, + JSDocTypeLiteral = 283, + JSDocTag = 284, + JSDocAugmentsTag = 285, + JSDocClassTag = 286, + JSDocParameterTag = 287, + JSDocReturnTag = 288, + JSDocTypeTag = 289, + JSDocTemplateTag = 290, + JSDocTypedefTag = 291, + JSDocPropertyTag = 292, + SyntaxList = 293, + NotEmittedStatement = 294, + PartiallyEmittedExpression = 295, + CommaListExpression = 296, + MergeDeclarationMarker = 297, + EndOfDeclarationMarker = 298, + Count = 299, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -364,15 +368,15 @@ declare namespace ts { FirstReservedWord = 72, LastReservedWord = 107, FirstKeyword = 72, - LastKeyword = 143, + LastKeyword = 144, FirstFutureReservedWord = 108, LastFutureReservedWord = 116, - FirstTypeNode = 159, - LastTypeNode = 174, + FirstTypeNode = 160, + LastTypeNode = 177, FirstPunctuation = 17, LastPunctuation = 70, FirstToken = 0, - LastToken = 143, + LastToken = 144, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -381,11 +385,11 @@ declare namespace ts { LastTemplateToken = 16, FirstBinaryOperator = 27, LastBinaryOperator = 70, - FirstNode = 144, - FirstJSDocNode = 271, - LastJSDocNode = 289, - FirstJSDocTagNode = 281, - LastJSDocTagNode = 289, + FirstNode = 145, + FirstJSDocNode = 274, + LastJSDocNode = 292, + FirstJSDocTagNode = 284, + LastJSDocTagNode = 292, } enum NodeFlags { None = 0, @@ -453,6 +457,9 @@ declare namespace ts { interface JSDocContainer { } type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | EndOfFileToken; + type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; + type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; + type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; interface NodeArray extends ReadonlyArray, TextRange { hasTrailingComma?: boolean; } @@ -470,6 +477,8 @@ declare namespace ts { type AtToken = Token; type ReadonlyToken = Token; type AwaitKeywordToken = Token; + type PlusToken = Token; + type MinusToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression, Declaration { @@ -513,7 +522,7 @@ declare namespace ts { } interface TypeParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.TypeParameter; - parent?: DeclarationWithTypeParameters; + parent?: DeclarationWithTypeParameters | InferTypeNode; name: Identifier; constraint?: TypeNode; default?: TypeNode; @@ -604,15 +613,7 @@ declare namespace ts { kind: SyntaxKind.SpreadAssignment; expression: Expression; } - interface VariableLikeDeclaration extends NamedDeclaration { - propertyName?: PropertyName; - dotDotDotToken?: DotDotDotToken; - name: DeclarationName; - questionToken?: QuestionToken; - exclamationToken?: ExclamationToken; - type?: TypeNode; - initializer?: Expression; - } + type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag; interface PropertyLikeDeclaration extends NamedDeclaration { name: PropertyName; } @@ -643,7 +644,7 @@ declare namespace ts { body?: Block | Expression; } type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction; - type FunctionLike = FunctionLikeDeclaration | FunctionTypeNode | ConstructorTypeNode | IndexSignatureDeclaration | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration; + type FunctionLike = FunctionLikeDeclaration | FunctionTypeNode | ConstructorTypeNode | IndexSignatureDeclaration | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration | JSDocFunctionType; interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.FunctionDeclaration; name?: Identifier; @@ -651,39 +652,41 @@ declare namespace ts { } interface MethodSignature extends SignatureDeclarationBase, TypeElement { kind: SyntaxKind.MethodSignature; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.MethodDeclaration; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer { kind: SyntaxKind.Constructor; - parent?: ClassDeclaration | ClassExpression; + parent?: ClassLikeDeclaration; body?: FunctionBody; } /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ interface SemicolonClassElement extends ClassElement { kind: SyntaxKind.SemicolonClassElement; - parent?: ClassDeclaration | ClassExpression; + parent?: ClassLikeDeclaration; } interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.GetAccessor; - parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.SetAccessor; - parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; - parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; } interface TypeNode extends Node { _typeNodeBrand: any; @@ -738,6 +741,17 @@ declare namespace ts { kind: SyntaxKind.IntersectionType; types: NodeArray; } + interface ConditionalTypeNode extends TypeNode { + kind: SyntaxKind.ConditionalType; + checkType: TypeNode; + extendsType: TypeNode; + trueType: TypeNode; + falseType: TypeNode; + } + interface InferTypeNode extends TypeNode { + kind: SyntaxKind.InferType; + typeParameter: TypeParameterDeclaration; + } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; type: TypeNode; @@ -754,9 +768,9 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; - readonlyToken?: ReadonlyToken; + readonlyToken?: ReadonlyToken | PlusToken | MinusToken; typeParameter: TypeParameterDeclaration; - questionToken?: QuestionToken; + questionToken?: QuestionToken | PlusToken | MinusToken; type?: TypeNode; } interface LiteralTypeNode extends TypeNode { @@ -766,6 +780,7 @@ declare namespace ts { interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; } + type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; interface Expression extends Node { _expressionBrand: any; } @@ -881,7 +896,7 @@ declare namespace ts { type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment; type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression | Identifier | PropertyAccessExpression | ElementAccessExpression; type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment; - type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Expression; + type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression; type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression; type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression; type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression; @@ -905,6 +920,7 @@ declare namespace ts { kind: SyntaxKind.ArrowFunction; equalsGreaterThanToken: EqualsGreaterThanToken; body: ConciseBody; + name: never; } interface LiteralLikeNode extends Node { text: string; @@ -972,7 +988,7 @@ declare namespace ts { interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; @@ -1255,6 +1271,7 @@ declare namespace ts { } interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.ClassDeclaration; + /** May be undefined in `export default class { ... }`. */ name?: Identifier; } interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression { @@ -1279,7 +1296,7 @@ declare namespace ts { } interface HeritageClause extends Node { kind: SyntaxKind.HeritageClause; - parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; + parent?: InterfaceDeclaration | ClassLikeDeclaration; token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; types: NodeArray; } @@ -1366,6 +1383,7 @@ declare namespace ts { interface ExportDeclaration extends DeclarationStatement { kind: SyntaxKind.ExportDeclaration; parent?: SourceFile | ModuleBlock; + /** Will not be assigned in the case of `export * from "foo";` */ exportClause?: NamedExports; /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier?: Expression; @@ -1394,6 +1412,10 @@ declare namespace ts { name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + /** + * This is either an `export =` or an `export default` declaration. + * Unless `isExportEquals` is set, this node was parsed as an `export default`. + */ interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; parent?: SourceFile; @@ -1620,7 +1642,7 @@ declare namespace ts { } interface ParseConfigHost { useCaseSensitiveFileNames: boolean; - readDirectory(rootDir: string, extensions: ReadonlyArray, excludes: ReadonlyArray, includes: ReadonlyArray, depth: number): string[]; + readDirectory(rootDir: string, extensions: ReadonlyArray, excludes: ReadonlyArray | undefined, includes: ReadonlyArray, depth?: number): string[]; /** * Gets a value indicating whether the specified path exists and is a file. * @param path The path to test. @@ -1728,9 +1750,21 @@ declare namespace ts { /** Note that the resulting nodes cannot be checked. */ typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode; /** Note that the resulting nodes cannot be checked. */ - signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; + signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration & { + typeArguments?: NodeArray; + } | undefined; /** Note that the resulting nodes cannot be checked. */ - indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): EntityName | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Expression | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): NodeArray | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): ParameterDeclaration | undefined; + /** Note that the resulting nodes cannot be checked. */ + typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeParameterDeclaration | undefined; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol | undefined; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -1750,7 +1784,8 @@ declare namespace ts { getTypeFromTypeNode(node: TypeNode): Type; signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; + symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string; + typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; /** * @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead * This will be removed in a future version. @@ -1790,33 +1825,80 @@ declare namespace ts { None = 0, NoTruncation = 1, WriteArrayAsGenericType = 2, + UseStructuralFallback = 8, + WriteTypeArgumentsOfSignature = 32, + UseFullyQualifiedType = 64, + UseOnlyExternalAliasing = 128, + SuppressAnyReturnType = 256, + WriteTypeParametersInQualifiedName = 512, + MultilineObjectLiterals = 1024, + WriteClassExpressionAsTypeLiteral = 2048, + UseTypeOfFunction = 4096, + OmitParameterModifiers = 8192, + UseAliasDefinedOutsideCurrentScope = 16384, + AllowThisInObjectLiteral = 32768, + AllowQualifedNameInPlaceOfIdentifier = 65536, + AllowAnonymousIdentifier = 131072, + AllowEmptyUnionOrIntersection = 262144, + AllowEmptyTuple = 524288, + AllowUniqueESSymbolType = 1048576, + AllowEmptyIndexInfoType = 2097152, + IgnoreErrors = 3112960, + InObjectTypeLiteral = 4194304, + InTypeAlias = 8388608, + InInitialEntityName = 16777216, + InReverseMappedType = 33554432, + } + enum TypeFormatFlags { + None = 0, + NoTruncation = 1, + WriteArrayAsGenericType = 2, + UseStructuralFallback = 8, WriteTypeArgumentsOfSignature = 32, UseFullyQualifiedType = 64, SuppressAnyReturnType = 256, - WriteTypeParametersInQualifiedName = 512, - AllowThisInObjectLiteral = 1024, - AllowQualifedNameInPlaceOfIdentifier = 2048, - AllowAnonymousIdentifier = 8192, - AllowEmptyUnionOrIntersection = 16384, - AllowEmptyTuple = 32768, - IgnoreErrors = 60416, - InObjectTypeLiteral = 1048576, + MultilineObjectLiterals = 1024, + WriteClassExpressionAsTypeLiteral = 2048, + UseTypeOfFunction = 4096, + OmitParameterModifiers = 8192, + UseAliasDefinedOutsideCurrentScope = 16384, + AllowUniqueESSymbolType = 1048576, + AddUndefined = 131072, + WriteArrowStyleSignature = 262144, + InArrayType = 524288, + InElementType = 2097152, + InFirstTypeArgument = 4194304, InTypeAlias = 8388608, + /** @deprecated */ WriteOwnNameForAnyLike = 0, + NodeBuilderFlagsMask = 9469291, } + enum SymbolFormatFlags { + None = 0, + WriteTypeParametersOrArguments = 1, + UseOnlyExternalAliasing = 2, + AllowAnyNodeKind = 4, + UseAliasDefinedOutsideCurrentScope = 8, + } + /** + * @deprecated + */ interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; - buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; + /** @deprecated */ buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + /** @deprecated */ buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; + /** @deprecated */ buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; } - interface SymbolWriter { + /** + * @deprecated Migrate to other methods of generating symbol names, ex symbolToEntityName + a printer or symbolToString + */ + interface SymbolWriter extends SymbolTracker { writeKeyword(text: string): void; writeOperator(text: string): void; writePunctuation(text: string): void; @@ -1829,34 +1911,6 @@ declare namespace ts { increaseIndent(): void; decreaseIndent(): void; clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - reportInaccessibleThisError(): void; - reportPrivateInBaseOfClassExpression(propertyName: string): void; - reportInaccessibleUniqueSymbolError(): void; - } - enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 4, - NoTruncation = 8, - WriteArrowStyleSignature = 16, - WriteOwnNameForAnyLike = 32, - WriteTypeArgumentsOfSignature = 64, - InElementType = 128, - UseFullyQualifiedType = 256, - InFirstTypeArgument = 512, - InTypeAlias = 1024, - SuppressAnyReturnType = 4096, - AddUndefined = 8192, - WriteClassExpressionAsTypeLiteral = 16384, - InArrayType = 32768, - UseAliasDefinedOutsideCurrentScope = 65536, - AllowUniqueESSymbolType = 131072, - } - enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, } enum TypePredicateKind { This = 0, @@ -2017,8 +2071,9 @@ declare namespace ts { Intersection = 262144, Index = 524288, IndexedAccess = 1048576, - NonPrimitive = 33554432, - MarkerType = 134217728, + Conditional = 2097152, + Substitution = 4194304, + NonPrimitive = 134217728, Literal = 224, Unit = 13536, StringOrNumberLiteral = 96, @@ -2030,10 +2085,13 @@ declare namespace ts { ESSymbolLike = 1536, UnionOrIntersection = 393216, StructuredType = 458752, - StructuredOrTypeVariable = 2064384, TypeVariable = 1081344, - Narrowable = 35620607, - NotUnionOrUnit = 33620481, + InstantiableNonPrimitive = 7372800, + InstantiablePrimitive = 524288, + Instantiable = 7897088, + StructuredOrInstantiable = 8355840, + Narrowable = 142575359, + NotUnionOrUnit = 134283777, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { @@ -2071,6 +2129,9 @@ declare namespace ts { EvolvingArray = 256, ObjectLiteralPatternWithComputedProperties = 512, ContainsSpread = 1024, + ReverseMapped = 2048, + JsxAttributes = 4096, + MarkerType = 8192, ClassOrInterface = 3, } interface ObjectType extends Type { @@ -2119,17 +2180,27 @@ declare namespace ts { elementType: Type; finalArrayType?: Type; } - interface TypeVariable extends Type { + interface InstantiableType extends Type { } - interface TypeParameter extends TypeVariable { + interface TypeParameter extends InstantiableType { } - interface IndexedAccessType extends TypeVariable { + interface IndexedAccessType extends InstantiableType { objectType: Type; indexType: Type; constraint?: Type; } - interface IndexType extends Type { - type: TypeVariable | UnionOrIntersectionType; + interface IndexType extends InstantiableType { + type: InstantiableType | UnionOrIntersectionType; + } + interface ConditionalType extends InstantiableType { + checkType: Type; + extendsType: Type; + trueType: Type; + falseType: Type; + } + interface SubstitutionType extends InstantiableType { + typeParameter: TypeParameter; + substitute: Type; } enum SignatureKind { Call = 0, @@ -2150,21 +2221,23 @@ declare namespace ts { declaration?: SignatureDeclaration; } enum InferencePriority { - Contravariant = 1, - NakedTypeVariable = 2, - MappedType = 4, - ReturnType = 8, - NeverType = 16, + NakedTypeVariable = 1, + MappedType = 2, + ReturnType = 4, + NoConstraints = 8, + AlwaysStrict = 16, } interface InferenceInfo { typeParameter: TypeParameter; candidates: Type[]; + contraCandidates: Type[]; inferredType: Type; priority: InferencePriority; topLevel: boolean; isFixed: boolean; } enum InferenceFlags { + None = 0, InferUnionTypes = 1, NoDefault = 2, AnyDefault = 4, @@ -2239,6 +2312,7 @@ declare namespace ts { charset?: string; checkJs?: boolean; declaration?: boolean; + emitDeclarationOnly?: boolean; declarationDir?: string; disableSizeLimit?: boolean; downlevelIteration?: boolean; @@ -2299,6 +2373,7 @@ declare namespace ts { types?: string[]; /** Paths used to compute primary types search locations */ typeRoots?: string[]; + esModuleInterop?: boolean; [option: string]: CompilerOptionsValue | JsonSourceFile | undefined; } interface TypeAcquisition { @@ -2308,15 +2383,6 @@ declare namespace ts { exclude?: string[]; [option: string]: string[] | boolean | undefined; } - interface DiscoverTypingsInfo { - fileNames: string[]; - projectRootPath: string; - safeListPath: string; - packageNameToTypingLocation: Map; - typeAcquisition: TypeAcquisition; - compilerOptions: CompilerOptions; - unresolvedImports: ReadonlyArray; - } enum ModuleKind { None = 0, CommonJS = 1, @@ -2472,12 +2538,13 @@ declare namespace ts { getCanonicalFileName(fileName: string): string; useCaseSensitiveFileNames(): boolean; getNewLine(): string; - resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; + resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): (ResolvedModule | undefined)[]; /** * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files */ - resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; + resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): (ResolvedTypeReferenceDirective | undefined)[]; getEnvironmentVariable?(name: string): string; + createHash?(data: string): string; } interface SourceMapRange extends TextRange { source?: SourceMapSource; @@ -2634,6 +2701,10 @@ declare namespace ts { * collisions. */ printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; + /** + * Prints a list of nodes using the given format flags + */ + printList(format: ListFormat, list: NodeArray, sourceFile: SourceFile): string; /** * Prints a source file as-is, without any emit transformations. */ @@ -2689,6 +2760,13 @@ declare namespace ts { interface PrinterOptions { removeComments?: boolean; newLine?: NewLineKind; + omitTrailingSemicolon?: boolean; + } + interface SymbolTracker { + trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; + reportInaccessibleThisError?(): void; + reportPrivateInBaseOfClassExpression?(propertyName: string): void; + reportInaccessibleUniqueSymbolError?(): void; } interface TextSpan { start: number; @@ -2698,17 +2776,86 @@ declare namespace ts { span: TextSpan; newLength: number; } + interface SortedArray extends Array { + " __sortedArrayBrand": any; + } interface SyntaxList extends Node { _children: Node[]; } + enum ListFormat { + None = 0, + SingleLine = 0, + MultiLine = 1, + PreserveLines = 2, + LinesMask = 3, + NotDelimited = 0, + BarDelimited = 4, + AmpersandDelimited = 8, + CommaDelimited = 16, + DelimitersMask = 28, + AllowTrailingComma = 32, + Indented = 64, + SpaceBetweenBraces = 128, + SpaceBetweenSiblings = 256, + Braces = 512, + Parenthesis = 1024, + AngleBrackets = 2048, + SquareBrackets = 4096, + BracketsMask = 7680, + OptionalIfUndefined = 8192, + OptionalIfEmpty = 16384, + Optional = 24576, + PreferNewLine = 32768, + NoTrailingNewLine = 65536, + NoInterveningComments = 131072, + NoSpaceIfEmpty = 262144, + SingleElement = 524288, + Modifiers = 131328, + HeritageClauses = 256, + SingleLineTypeLiteralMembers = 448, + MultiLineTypeLiteralMembers = 65, + TupleTypeElements = 336, + UnionTypeConstituents = 260, + IntersectionTypeConstituents = 264, + ObjectBindingPatternElements = 262576, + ArrayBindingPatternElements = 262448, + ObjectLiteralExpressionProperties = 263122, + ArrayLiteralExpressionElements = 4466, + CommaListElements = 272, + CallExpressionArguments = 1296, + NewExpressionArguments = 9488, + TemplateExpressionSpans = 131072, + SingleLineBlockStatements = 384, + MultiLineBlockStatements = 65, + VariableDeclarationList = 272, + SingleLineFunctionBodyStatements = 384, + MultiLineFunctionBodyStatements = 1, + ClassHeritageClauses = 256, + ClassMembers = 65, + InterfaceMembers = 65, + EnumMembers = 81, + CaseBlockClauses = 65, + NamedImportsOrExportsElements = 432, + JsxElementOrFragmentChildren = 131072, + JsxElementAttributes = 131328, + CaseOrDefaultClauseStatements = 81985, + HeritageClauseTypes = 272, + SourceFileStatements = 65537, + Decorators = 24577, + TypeArguments = 26896, + TypeParameters = 26896, + Parameters = 1296, + IndexSignatureParameters = 4432, + } } declare namespace ts { - const versionMajorMinor = "2.7"; + const versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ const version: string; } declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; + function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): Diagnostic[]; } declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; declare function clearTimeout(handle: any): void; @@ -2725,26 +2872,14 @@ declare namespace ts { callback: FileWatcherCallback; mtime?: Date; } - /** - * Partial interface of the System thats needed to support the caching of directory structure - */ - interface DirectoryStructureHost { + interface System { + args: string[]; newLine: string; useCaseSensitiveFileNames: boolean; write(s: string): void; readFile(path: string, encoding?: string): string | undefined; - writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; - fileExists(path: string): boolean; - directoryExists(path: string): boolean; - createDirectory(path: string): void; - getCurrentDirectory(): string; - getDirectories(path: string): string[]; - readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; - exit(exitCode?: number): void; - } - interface System extends DirectoryStructureHost { - args: string[]; getFileSize?(path: string): number; + writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; /** * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that * use native OS file watching @@ -2752,7 +2887,13 @@ declare namespace ts { watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; resolvePath(path: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + createDirectory(path: string): void; getExecutingFilePath(): string; + getCurrentDirectory(): string; + getDirectories(path: string): string[]; + readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; getModifiedTime?(path: string): Date; /** * This should be cryptographically secure. @@ -2760,9 +2901,11 @@ declare namespace ts { */ createHash?(data: string): string; getMemoryUsage?(): number; + exit(exitCode?: number): void; realpath?(path: string): string; setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; clearTimeout?(timeoutId: any): void; + clearScreen?(): void; } interface FileWatcher { close(): void; @@ -2791,7 +2934,7 @@ declare namespace ts { scanJsxAttributeValue(): SyntaxKind; reScanJsxToken(): SyntaxKind; scanJsxToken(): SyntaxKind; - scanJSDocToken(): SyntaxKind; + scanJSDocToken(): JsDocSyntaxKind; scan(): SyntaxKind; getText(): string; setText(text: string, start?: number, length?: number): void; @@ -2811,8 +2954,10 @@ declare namespace ts { function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; - function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; @@ -2968,7 +3113,7 @@ declare namespace ts { function isStringLiteral(node: Node): node is StringLiteral; function isJsxText(node: Node): node is JsxText; function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral; - function isNoSubstitutionTemplateLiteral(node: Node): node is LiteralExpression; + function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral; function isTemplateHead(node: Node): node is TemplateHead; function isTemplateMiddle(node: Node): node is TemplateMiddle; function isTemplateTail(node: Node): node is TemplateTail; @@ -2998,6 +3143,8 @@ declare namespace ts { function isTupleTypeNode(node: Node): node is TupleTypeNode; function isUnionTypeNode(node: Node): node is UnionTypeNode; function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode; + function isConditionalTypeNode(node: Node): node is ConditionalTypeNode; + function isInferTypeNode(node: Node): node is InferTypeNode; function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode; function isThisTypeNode(node: Node): node is ThisTypeNode; function isTypeOperatorNode(node: Node): node is TypeOperatorNode; @@ -3126,6 +3273,7 @@ declare namespace ts { /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n: Node): boolean; function isLiteralExpression(node: Node): node is LiteralExpression; @@ -3160,6 +3308,8 @@ declare namespace ts { function isJSDocCommentContainingNode(node: Node): boolean; function isSetAccessor(node: Node): node is SetAccessorDeclaration; function isGetAccessor(node: Node): node is GetAccessorDeclaration; + function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; + function isStringLiteralLike(node: Node): node is StringLiteralLike; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -3235,13 +3385,13 @@ declare namespace ts { declare namespace ts { function createNodeArray(elements?: ReadonlyArray, hasTrailingComma?: boolean): NodeArray; /** If a node is passed, creates a string literal whose source text is read from a source node during emit. */ - function createLiteral(value: string | StringLiteral | NumericLiteral | Identifier): StringLiteral; + function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; function createLiteral(value: number): NumericLiteral; function createLiteral(value: boolean): BooleanLiteral; function createLiteral(value: string | number | boolean): PrimaryExpression; function createNumericLiteral(value: string): NumericLiteral; function createIdentifier(text: string): Identifier; - function updateIdentifier(node: Identifier, typeArguments: NodeArray | undefined): Identifier; + function updateIdentifier(node: Identifier): Identifier; /** Create a unique temporary variable. */ function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; /** Create a unique temporary variable for use in a loop. */ @@ -3268,8 +3418,8 @@ declare namespace ts { function updateDecorator(node: Decorator, expression: Expression): Decorator; function createPropertySignature(modifiers: ReadonlyArray | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; function updatePropertySignature(node: PropertySignature, modifiers: ReadonlyArray | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; - function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; function createMethodSignature(typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function createMethod(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; @@ -3308,6 +3458,10 @@ declare namespace ts { function createIntersectionTypeNode(types: TypeNode[]): IntersectionTypeNode; function updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray): IntersectionTypeNode; function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray): UnionOrIntersectionTypeNode; + function createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; + function updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; function createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; @@ -3316,8 +3470,8 @@ declare namespace ts { function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; @@ -3710,18 +3864,7 @@ declare namespace ts { function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; } declare namespace ts { - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } -} -declare namespace ts { - function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; + function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined; function resolveTripleslashReference(moduleName: string, containingFile: string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -3749,6 +3892,258 @@ declare namespace ts { */ function createProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program; } +declare namespace ts { + interface EmitOutput { + outputFiles: OutputFile[]; + emitSkipped: boolean; + } + interface OutputFile { + name: string; + writeByteOrderMark: boolean; + text: string; + } +} +declare namespace ts { + type AffectedFileResult = { + result: T; + affected: SourceFile | Program; + } | undefined; + interface BuilderProgramHost { + /** + * return true if file names are treated with case sensitivity + */ + useCaseSensitiveFileNames(): boolean; + /** + * If provided this would be used this hash instead of actual file shape text for detecting changes + */ + createHash?: (data: string) => string; + /** + * When emit or emitNextAffectedFile are called without writeFile, + * this callback if present would be used to write files + */ + writeFile?: WriteFileCallback; + } + /** + * Builder to manage the program state changes + */ + interface BuilderProgram { + /** + * Returns current program + */ + getProgram(): Program; + /** + * Get compiler options of the program + */ + getCompilerOptions(): CompilerOptions; + /** + * Get the source file in the program with file name + */ + getSourceFile(fileName: string): SourceFile | undefined; + /** + * Get a list of files in the program + */ + getSourceFiles(): ReadonlyArray; + /** + * Get the diagnostics for compiler options + */ + getOptionsDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Get the diagnostics that dont belong to any file + */ + getGlobalDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Get the syntax diagnostics, for all source files if source file is not supplied + */ + getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Get all the dependencies of the file + */ + getAllDependencies(sourceFile: SourceFile): ReadonlyArray; + /** + * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program + * The semantic diagnostics are cached and managed here + * Note that it is assumed that when asked about semantic diagnostics through this API, + * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics + * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, + * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics + */ + getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Emits the JavaScript and declaration files. + * When targetSource file is specified, emits the files corresponding to that source file, + * otherwise for the whole program. + * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, + * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, + * it will only emit all the affected files instead of whole program + * + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; + /** + * Get the current directory of the program + */ + getCurrentDirectory(): string; + } + /** + * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files + */ + interface SemanticDiagnosticsBuilderProgram extends BuilderProgram { + /** + * Gets the semantic diagnostics from the program for the next affected file and caches it + * Returns undefined if the iteration is complete + */ + getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult>; + } + /** + * The builder that can handle the changes in program and iterate through changed file to emit the files + * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files + */ + interface EmitAndSemanticDiagnosticsBuilderProgram extends BuilderProgram { + /** + * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult; + } + /** + * Create the builder to manage semantic diagnostics and cache them + */ + function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram): SemanticDiagnosticsBuilderProgram; + function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram): SemanticDiagnosticsBuilderProgram; + /** + * Create the builder that can handle the changes in program and iterate through changed files + * to emit the those files and manage semantic diagnostics cache as well + */ + function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram): EmitAndSemanticDiagnosticsBuilderProgram; + function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram): EmitAndSemanticDiagnosticsBuilderProgram; + /** + * Creates a builder thats just abstraction over program and can be used with watch + */ + function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram): BuilderProgram; + function createAbstractBuilder(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: BuilderProgram): BuilderProgram; +} +declare namespace ts { + type DiagnosticReporter = (diagnostic: Diagnostic) => void; + type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions) => void; + type CreateProgram = (rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: T) => T; + interface WatchCompilerHost { + /** + * Used to create the program when need for program creation or recreation detected + */ + createProgram: CreateProgram; + /** If provided, callback to invoke after every new program creation */ + afterProgramCreate?(program: T): void; + /** If provided, called with Diagnostic message that informs about change in watch status */ + onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions): void; + useCaseSensitiveFileNames(): boolean; + getNewLine(): string; + getCurrentDirectory(): string; + getDefaultLibFileName(options: CompilerOptions): string; + getDefaultLibLocation?(): string; + createHash?(data: string): string; + /** + * Use to check file presence for source files and + * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well + */ + fileExists(path: string): boolean; + /** + * Use to read file text for source files and + * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well + */ + readFile(path: string, encoding?: string): string | undefined; + /** If provided, used for module resolution as well as to handle directory structure */ + directoryExists?(path: string): boolean; + /** If provided, used in resolutions as well as handling directory structure */ + getDirectories?(path: string): string[]; + /** If provided, used to cache and handle directory structure modifications */ + readDirectory?(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; + /** Symbol links resolution */ + realpath?(path: string): string; + /** If provided would be used to write log about compilation */ + trace?(s: string): void; + /** If provided is used to get the environment variable */ + getEnvironmentVariable?(name: string): string; + /** If provided, used to resolve the module names, otherwise typescript's default module resolution */ + resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; + /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */ + resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): (ResolvedTypeReferenceDirective | undefined)[]; + /** Used to watch changes in source files, missing files needed to update the program or config file */ + watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; + /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */ + watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; + /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */ + setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; + /** If provided, will be used to reset existing delayed compilation */ + clearTimeout?(timeoutId: any): void; + } + /** + * Host to create watch with root files and options + */ + interface WatchCompilerHostOfFilesAndCompilerOptions extends WatchCompilerHost { + /** root files to use to generate program */ + rootFiles: string[]; + /** Compiler options */ + options: CompilerOptions; + } + /** + * Reports config file diagnostics + */ + interface ConfigFileDiagnosticsReporter { + /** + * Reports the diagnostics in reading/writing or parsing of the config file + */ + onConfigFileDiagnostic: DiagnosticReporter; + /** + * Reports unrecoverable error when parsing config file + */ + onUnRecoverableConfigFileDiagnostic: DiagnosticReporter; + } + /** + * Host to create watch with config file + */ + interface WatchCompilerHostOfConfigFile extends WatchCompilerHost, ConfigFileDiagnosticsReporter { + /** Name of the config file to compile */ + configFileName: string; + /** Options to extend */ + optionsToExtend?: CompilerOptions; + /** + * Used to generate source file names from the config file and its include, exclude, files rules + * and also to cache the directory stucture + */ + readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; + } + interface Watch { + /** Synchronize with host and get updated program */ + getProgram(): T; + } + /** + * Creates the watch what generates program using the config file + */ + interface WatchOfConfigFile extends Watch { + } + /** + * Creates the watch that generates program using the root files and compiler options + */ + interface WatchOfFilesAndCompilerOptions extends Watch { + /** Updates the root files in the program, only if this is not config file compilation */ + updateRootFileNames(fileNames: string[]): void; + } + /** + * Create the watch compiler host for either configFile or fileNames and its options + */ + function createWatchCompilerHost(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): WatchCompilerHostOfFilesAndCompilerOptions; + function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): WatchCompilerHostOfConfigFile; + /** + * Creates the watch from the host for root files and compiler options + */ + function createWatchProgram(host: WatchCompilerHostOfFilesAndCompilerOptions): WatchOfFilesAndCompilerOptions; + /** + * Creates the watch from the host for config file + */ + function createWatchProgram(host: WatchCompilerHostOfConfigFile): WatchOfConfigFile; +} declare namespace ts { function parseCommandLine(commandLine: ReadonlyArray, readFile?: (path: string) => string | undefined): ParsedCommandLine; /** @@ -3924,6 +4319,7 @@ declare namespace ts { useCaseSensitiveFileNames?(): boolean; readDirectory?(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; readFile?(path: string, encoding?: string): string | undefined; + realpath?(path: string): string; fileExists?(path: string): boolean; getTypeRootsVersion?(): number; resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; @@ -3982,7 +4378,8 @@ declare namespace ts { getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan; - getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray, formatOptions: FormatCodeSettings): ReadonlyArray; + getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings): CombinedCodeActions; applyCodeActionCommand(action: CodeActionCommand): Promise; applyCodeActionCommand(action: CodeActionCommand[]): Promise; applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[]): Promise; @@ -3994,12 +4391,19 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; + organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; } + interface CombinedCodeFixScope { + type: "file"; + fileName: string; + } + type OrganizeImportsScope = CombinedCodeFixScope; interface GetCompletionsAtPositionOptions { includeExternalModuleExports: boolean; + includeInsertTextCompletions: boolean; } interface ApplyCodeActionCommandResult { successMessage: string; @@ -4074,6 +4478,17 @@ declare namespace ts { */ commands?: CodeActionCommand[]; } + interface CodeFixAction extends CodeAction { + /** + * If present, one may call 'getCombinedCodeFix' with this fixId. + * This may be omitted to indicate that the code fix can't be applied in a group. + */ + fixId?: {}; + } + interface CombinedCodeActions { + changes: ReadonlyArray; + commands: ReadonlyArray | undefined; + } type CodeActionCommand = InstallPackageAction; interface InstallPackageAction { } @@ -4210,6 +4625,7 @@ declare namespace ts { InsertSpaceBeforeFunctionParenthesis?: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface FormatCodeSettings extends EditorSettings { insertSpaceAfterCommaDelimiter?: boolean; @@ -4227,6 +4643,7 @@ declare namespace ts { insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface DefinitionInfo { fileName: string; @@ -4329,6 +4746,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** @@ -4342,6 +4760,7 @@ declare namespace ts { kind: ScriptElementKind; kindModifiers: string; sortText: string; + insertText?: string; /** * An optional span that indicates the text to be replaced by this completion item. * If present, this span should be used instead of the default one. @@ -4508,6 +4927,7 @@ declare namespace ts { ambientModifier = "declare", staticModifier = "static", abstractModifier = "abstract", + optionalModifier = "optional", } enum ClassificationTypeNames { comment = "comment", @@ -4653,9 +5073,6 @@ declare namespace ts { declare namespace ts { /** The version of the language service API */ const servicesVersion = "0.7"; - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings; function displayPartsToString(displayParts: SymbolDisplayPart[]): string; function getDefaultCompilerOptions(): CompilerOptions; diff --git a/lib/typescript.js b/lib/typescript.js index 1fbae487f80..71de0f4e0b6 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -182,198 +182,201 @@ var ts; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 140] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 141] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 142] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 143] = "OfKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 126] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 127] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 128] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 129] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 130] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 131] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 132] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 133] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 134] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 135] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 136] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 137] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 138] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 142] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 143] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 144] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 144] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 145] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 145] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 146] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 146] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 147] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 148] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 147] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 148] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 149] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 149] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 150] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 151] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 152] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 153] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 154] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 155] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 156] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 157] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 158] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 150] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 151] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 152] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 153] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 154] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 155] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 156] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 157] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 158] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 159] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 159] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 160] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 161] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 162] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 163] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 164] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 165] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 166] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 167] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 168] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 169] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 170] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 171] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 172] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 173] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 174] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 160] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 161] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 162] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 163] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 164] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 165] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 166] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 167] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 168] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 169] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 170] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 171] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 172] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 173] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 174] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 175] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 176] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 177] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 175] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 176] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 177] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 178] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 179] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 180] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 180] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 181] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 182] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 183] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 184] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 185] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 186] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 187] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 188] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 189] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 190] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 191] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 192] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 193] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 194] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 195] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 196] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 197] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 198] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 199] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 200] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 201] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 202] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 203] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 204] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 205] = "MetaProperty"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 181] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 182] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 183] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 184] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 185] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 186] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 187] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 188] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 189] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 190] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 191] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 192] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 193] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 194] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 195] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 196] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 197] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 198] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 199] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 200] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 201] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 202] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 203] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 204] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 205] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 206] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 207] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 208] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 206] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 207] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 209] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 210] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 208] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 209] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 210] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 211] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 212] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 213] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 214] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 215] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 216] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 217] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 218] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 219] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 220] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 221] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 222] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 223] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 224] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 225] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 226] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 227] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 228] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 229] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 230] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 231] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 232] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 233] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 234] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 235] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 236] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 237] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 238] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 239] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 240] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 241] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 242] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 243] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 244] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 245] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 246] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 247] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 248] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 211] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 212] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 213] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 214] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 215] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 216] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 217] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 218] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 219] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 220] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 221] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 222] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 223] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 224] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 225] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 226] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 227] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 228] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 229] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 230] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 231] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 232] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 233] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 234] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 235] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 236] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 237] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 238] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 239] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 240] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 241] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 242] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 243] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 244] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 245] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 246] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 247] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 248] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 249] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 250] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 251] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 249] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 252] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 250] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 251] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 252] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 253] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 254] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 255] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 256] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 257] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 258] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 259] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 260] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 253] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 254] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 255] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 256] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 257] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 258] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 259] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 260] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 261] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 262] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 263] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 261] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 262] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 263] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 264] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 264] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 265] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 266] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 267] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 265] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 266] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 267] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 268] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 269] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 270] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 268] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 271] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 269] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 270] = "Bundle"; + SyntaxKind[SyntaxKind["SourceFile"] = 272] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 273] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 271] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 274] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 272] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 275] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 273] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 274] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 275] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 276] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 277] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 278] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 279] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 280] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocTag"] = 281] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 282] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 283] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 284] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 285] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 286] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 287] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 288] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 289] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 276] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 277] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 278] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 279] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 280] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 281] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 283] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocTag"] = 284] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 285] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 286] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 287] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 288] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 289] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 290] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 291] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 292] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 290] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 291] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 292] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 293] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 294] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 295] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 296] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 297] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 298] = "EndOfDeclarationMarker"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 296] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 299] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; @@ -382,15 +385,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 143] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 144] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 159] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 174] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 160] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 177] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 143] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 144] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -399,13 +402,13 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 144] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 271] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 289] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 281] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 289] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 145] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 274] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 284] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 143] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 144] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -489,14 +492,19 @@ var ts; RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); /*@internal*/ - var GeneratedIdentifierKind; - (function (GeneratedIdentifierKind) { - GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; - })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var GeneratedIdentifierFlags; + (function (GeneratedIdentifierFlags) { + // Kinds + GeneratedIdentifierFlags[GeneratedIdentifierFlags["None"] = 0] = "None"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Auto"] = 1] = "Auto"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Loop"] = 2] = "Loop"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Unique"] = 3] = "Unique"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Node"] = 4] = "Node"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["KindMask"] = 7] = "KindMask"; + // Flags + GeneratedIdentifierFlags[GeneratedIdentifierFlags["SkipNameGenerationScope"] = 8] = "SkipNameGenerationScope"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 16] = "ReservedInNestedScopes"; + })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); /* @internal */ var TokenFlags; (function (TokenFlags) { @@ -510,8 +518,9 @@ var ts; TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; - TokenFlags[TokenFlags["NumericLiteralFlags"] = 496] = "NumericLiteralFlags"; + TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; })(TokenFlags = ts.TokenFlags || (ts.TokenFlags = {})); var FlowFlags; (function (FlowFlags) { @@ -556,47 +565,79 @@ var ts; // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + /* @internal */ + var UnionReduction; + (function (UnionReduction) { + UnionReduction[UnionReduction["None"] = 0] = "None"; + UnionReduction[UnionReduction["Literal"] = 1] = "Literal"; + UnionReduction[UnionReduction["Subtype"] = 2] = "Subtype"; + })(UnionReduction = ts.UnionReduction || (ts.UnionReduction = {})); var NodeBuilderFlags; (function (NodeBuilderFlags) { NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; // Options NodeBuilderFlags[NodeBuilderFlags["NoTruncation"] = 1] = "NoTruncation"; NodeBuilderFlags[NodeBuilderFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + // empty space + NodeBuilderFlags[NodeBuilderFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + // empty space NodeBuilderFlags[NodeBuilderFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; NodeBuilderFlags[NodeBuilderFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + NodeBuilderFlags[NodeBuilderFlags["UseOnlyExternalAliasing"] = 128] = "UseOnlyExternalAliasing"; NodeBuilderFlags[NodeBuilderFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; NodeBuilderFlags[NodeBuilderFlags["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + NodeBuilderFlags[NodeBuilderFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + NodeBuilderFlags[NodeBuilderFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + NodeBuilderFlags[NodeBuilderFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; // Error handling - NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 1024] = "AllowThisInObjectLiteral"; - NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 2048] = "AllowQualifedNameInPlaceOfIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 8192] = "AllowAnonymousIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 16384] = "AllowEmptyUnionOrIntersection"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 32768] = "AllowEmptyTuple"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 60416] = "IgnoreErrors"; + NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; + NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; // State - NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); + // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 8] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 16] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 32] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 64] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 128] = "InElementType"; - TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; - TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; - TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; - TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; - TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; - TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; - TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 1] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + // hole because there's a hole in node builder flags + TypeFormatFlags[TypeFormatFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + // hole because there's a hole in node builder flags + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + // hole because `UseOnlyExternalAliasing` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` instead + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + // hole because `WriteTypeParametersInQualifiedName` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` for this instead + TypeFormatFlags[TypeFormatFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; // even though `T` can't be accessed in the current scope. - TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 131072] = "AllowUniqueESSymbolType"; + // Error Handling + TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + // TypeFormatFlags exclusive + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 131072] = "AddUndefined"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 262144] = "WriteArrowStyleSignature"; + // State + TypeFormatFlags[TypeFormatFlags["InArrayType"] = 524288] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 2097152] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + /** @deprecated */ TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["NodeBuilderFlagsMask"] = 9469291] = "NodeBuilderFlagsMask"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -604,12 +645,16 @@ var ts; // Write symbols's type argument if it is instantiated symbol // eg. class C { p: T } <-- Show p as C.p here // var a: C; - // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p + // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; // Use only external alias information to get the symbol name in the given context // eg. module m { export class c { } } import x = m.c; // When this flag is specified m.c will be used to refer to the class instead of alias symbol x SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + // Build symbol name using any nodes needed, instead of just components of an entity name + SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind"; + // Prefer aliases which are not directly visible + SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope"; })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); /* @internal */ var SymbolAccessibility; @@ -745,6 +790,7 @@ var ts; CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; CheckFlags[CheckFlags["Late"] = 1024] = "Late"; + CheckFlags[CheckFlags["ReverseMapped"] = 2048] = "ReverseMapped"; CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); var InternalSymbolName; @@ -814,18 +860,19 @@ var ts; TypeFlags[TypeFlags["Intersection"] = 262144] = "Intersection"; TypeFlags[TypeFlags["Index"] = 524288] = "Index"; TypeFlags[TypeFlags["IndexedAccess"] = 1048576] = "IndexedAccess"; + TypeFlags[TypeFlags["Conditional"] = 2097152] = "Conditional"; + TypeFlags[TypeFlags["Substitution"] = 4194304] = "Substitution"; /* @internal */ - TypeFlags[TypeFlags["FreshLiteral"] = 2097152] = "FreshLiteral"; + TypeFlags[TypeFlags["FreshLiteral"] = 8388608] = "FreshLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsWideningType"] = 4194304] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsWideningType"] = 16777216] = "ContainsWideningType"; /* @internal */ - TypeFlags[TypeFlags["ContainsObjectLiteral"] = 8388608] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 33554432] = "ContainsObjectLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 16777216] = "ContainsAnyFunctionType"; - TypeFlags[TypeFlags["NonPrimitive"] = 33554432] = "NonPrimitive"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 67108864] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 134217728] = "NonPrimitive"; /* @internal */ - TypeFlags[TypeFlags["JsxAttributes"] = 67108864] = "JsxAttributes"; - TypeFlags[TypeFlags["MarkerType"] = 134217728] = "MarkerType"; + TypeFlags[TypeFlags["GenericMappedType"] = 536870912] = "GenericMappedType"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 12288] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; @@ -837,7 +884,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 14560] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 14574] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 33585807] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 134249103] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 16382] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 524322] = "StringLike"; @@ -847,16 +894,20 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 1536] = "ESSymbolLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 393216] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 458752] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 2064384] = "StructuredOrTypeVariable"; TypeFlags[TypeFlags["TypeVariable"] = 1081344] = "TypeVariable"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 7372800] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 524288] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 7897088] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 8355840] = "StructuredOrInstantiable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 35620607] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33620481] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 142575359] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 134283777] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 12582912] = "RequiresWidening"; + TypeFlags[TypeFlags["RequiresWidening"] = 50331648] = "RequiresWidening"; + /* @internal */ + TypeFlags[TypeFlags["PropagatingFlags"] = 117440512] = "PropagatingFlags"; /* @internal */ - TypeFlags[TypeFlags["PropagatingFlags"] = 29360128] = "PropagatingFlags"; })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); var ObjectFlags; (function (ObjectFlags) { @@ -871,6 +922,9 @@ var ts; ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; ObjectFlags[ObjectFlags["ContainsSpread"] = 1024] = "ContainsSpread"; + ObjectFlags[ObjectFlags["ReverseMapped"] = 2048] = "ReverseMapped"; + ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes"; + ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ @@ -894,14 +948,15 @@ var ts; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); var InferencePriority; (function (InferencePriority) { - InferencePriority[InferencePriority["Contravariant"] = 1] = "Contravariant"; - InferencePriority[InferencePriority["NakedTypeVariable"] = 2] = "NakedTypeVariable"; - InferencePriority[InferencePriority["MappedType"] = 4] = "MappedType"; - InferencePriority[InferencePriority["ReturnType"] = 8] = "ReturnType"; - InferencePriority[InferencePriority["NeverType"] = 16] = "NeverType"; + InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; + InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + InferencePriority[InferencePriority["NoConstraints"] = 8] = "NoConstraints"; + InferencePriority[InferencePriority["AlwaysStrict"] = 16] = "AlwaysStrict"; })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); var InferenceFlags; (function (InferenceFlags) { + InferenceFlags[InferenceFlags["None"] = 0] = "None"; InferenceFlags[InferenceFlags["InferUnionTypes"] = 1] = "InferUnionTypes"; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; @@ -1181,6 +1236,8 @@ var ts; TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; TransformFlags[TransformFlags["ContainsDynamicImport"] = 67108864] = "ContainsDynamicImport"; + TransformFlags[TransformFlags["Super"] = 134217728] = "Super"; + TransformFlags[TransformFlags["ContainsSuper"] = 268435456] = "ContainsSuper"; // Please leave this as 1 << 29. // It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system. // It is a good reminder of how much room we have left @@ -1198,20 +1255,22 @@ var ts; // Scope Exclusions // - Bitmasks that exclude flags from propagating out of a specific context // into the subtree flags of their container. - TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; - TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; - TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; - TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; - TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; - TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; - TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["OuterExpressionExcludes"] = 536872257] = "OuterExpressionExcludes"; + TransformFlags[TransformFlags["PropertyAccessExcludes"] = 671089985] = "PropertyAccessExcludes"; + TransformFlags[TransformFlags["NodeExcludes"] = 939525441] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 1003902273] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 1003935041] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 1003668801] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 1003668801] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 942011713] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 977327425] = "ModuleExcludes"; TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; - TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; - TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; - TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; - TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; - TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; - TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 942740801] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 940049729] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 948962625] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 939525441] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 940574017] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 940049729] = "BindingPatternExcludes"; // Masks // - Additional bitmasks TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; @@ -1248,6 +1307,7 @@ var ts; EmitFlags[EmitFlags["Iterator"] = 8388608] = "Iterator"; EmitFlags[EmitFlags["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; /*@internal*/ EmitFlags[EmitFlags["TypeScriptClassWrapper"] = 33554432] = "TypeScriptClassWrapper"; + /*@internal*/ EmitFlags[EmitFlags["NeverApplyImportHelper"] = 67108864] = "NeverApplyImportHelper"; })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); /** * Used by the checker, this enum keeps track of external emit helpers that should be type @@ -1294,6 +1354,78 @@ var ts; EmitHint[EmitHint["MappedTypeParameter"] = 3] = "MappedTypeParameter"; EmitHint[EmitHint["Unspecified"] = 4] = "Unspecified"; })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); + var ListFormat; + (function (ListFormat) { + ListFormat[ListFormat["None"] = 0] = "None"; + // Line separators + ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; + ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; + ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; + ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; + // Delimiters + ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; + ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; + ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; + ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; + // Whitespace + ListFormat[ListFormat["Indented"] = 64] = "Indented"; + ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; + ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; + // Brackets/Braces + ListFormat[ListFormat["Braces"] = 512] = "Braces"; + ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; + ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; + ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; + ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; + ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; + ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; + ListFormat[ListFormat["Optional"] = 24576] = "Optional"; + // Other + ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; + ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; + ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; + ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; + ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; + // Precomputed Formats + ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; + ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; + ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; + ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; + ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; + ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; + ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; + ListFormat[ListFormat["ObjectBindingPatternElements"] = 262576] = "ObjectBindingPatternElements"; + ListFormat[ListFormat["ArrayBindingPatternElements"] = 262448] = "ArrayBindingPatternElements"; + ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; + ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; + ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; + ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; + ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; + ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; + ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; + ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; + ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; + ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; + ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; + ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; + ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; + ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; + ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; + ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; + ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; + ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; + ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; + ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; + ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; + ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; + ListFormat[ListFormat["TypeArguments"] = 26896] = "TypeArguments"; + ListFormat[ListFormat["TypeParameters"] = 26896] = "TypeParameters"; + ListFormat[ListFormat["Parameters"] = 1296] = "Parameters"; + ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; + })(ListFormat = ts.ListFormat || (ts.ListFormat = {})); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1394,9 +1526,9 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "2.7"; + ts.versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".0"; + ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -1406,9 +1538,14 @@ var ts; return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); /* @internal */ (function (ts) { + ts.emptyArray = []; /** Create a MapLike with good performance. */ function createDictionaryObject() { var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword @@ -1552,6 +1689,9 @@ var ts; ts.forEach = forEach; /** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */ function firstDefined(array, callback) { + if (array === undefined) { + return undefined; + } for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result !== undefined) { @@ -1561,6 +1701,19 @@ var ts; return undefined; } ts.firstDefined = firstDefined; + function firstDefinedIterator(iter, callback) { + while (true) { + var _a = iter.next(), value = _a.value, done = _a.done; + if (done) { + return undefined; + } + var result = callback(value); + if (result !== undefined) { + return result; + } + } + } + ts.firstDefinedIterator = firstDefinedIterator; function findAncestor(node, callback) { while (node) { var result = callback(node); @@ -1577,13 +1730,27 @@ var ts; ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { var result = []; - Debug.assert(arrayA.length === arrayB.length); + Debug.assertEqual(arrayA.length, arrayB.length); for (var i = 0; i < arrayA.length; i++) { result.push(callback(arrayA[i], arrayB[i], i)); } return result; } ts.zipWith = zipWith; + function zipToIterator(arrayA, arrayB) { + Debug.assertEqual(arrayA.length, arrayB.length); + var i = 0; + return { + next: function () { + if (i === arrayA.length) { + return { value: undefined, done: true }; + } + i++; + return { value: [arrayA[i - 1], arrayB[i - 1]], done: false }; + } + }; + } + ts.zipToIterator = zipToIterator; function zipToMap(keys, values) { Debug.assert(keys.length === values.length); var map = createMap(); @@ -1666,17 +1833,11 @@ var ts; return false; } ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); } - ts.indexOf = indexOf; + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -1748,31 +1909,30 @@ var ts; } ts.map = map; function mapIterator(iter, mapFn) { - return { next: next }; - function next() { - var iterRes = iter.next(); - return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; - } + return { + next: function () { + var iterRes = iter.next(); + return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + } + }; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; /** @@ -1824,25 +1984,33 @@ var ts; return result; } ts.flatMap = flatMap; - function flatMapIter(iter, mapfn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapfn(value); - if (res) { - if (isArray(res)) { - result.push.apply(result, res); + function flatMapIterator(iter, mapfn) { + var first = iter.next(); + if (first.done) { + return ts.emptyIterator; + } + var currentIter = getIterator(first.value); + return { + next: function () { + while (true) { + var currentRes = currentIter.next(); + if (!currentRes.done) { + return currentRes; + } + var iterRes = iter.next(); + if (iterRes.done) { + return iterRes; + } + currentIter = getIterator(iterRes.value); } - else { - result.push(res); - } - } + }, + }; + function getIterator(x) { + var res = mapfn(x); + return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res; } - return result; } - ts.flatMapIter = flatMapIter; + ts.flatMapIterator = flatMapIterator; function sameFlatMap(array, mapfn) { var result; if (array) { @@ -1865,12 +2033,23 @@ var ts; return result || array; } ts.sameFlatMap = sameFlatMap; + function mapAllOrFail(array, mapFn) { + var result = []; + for (var i = 0; i < array.length; i++) { + var mapped = mapFn(array[i], i); + if (mapped === undefined) { + return undefined; + } + result.push(mapped); + } + return result; + } + ts.mapAllOrFail = mapAllOrFail; function mapDefined(array, mapFn) { var result = []; if (array) { for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); + var mapped = mapFn(array[i], i); if (mapped !== undefined) { result.push(mapped); } @@ -1879,20 +2058,35 @@ var ts; return result; } ts.mapDefined = mapDefined; - function mapDefinedIter(iter, mapFn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapFn(value); - if (res !== undefined) { - result.push(res); + function mapDefinedIterator(iter, mapFn) { + return { + next: function () { + while (true) { + var res = iter.next(); + if (res.done) { + return res; + } + var value = mapFn(res.value); + if (value !== undefined) { + return { value: value, done: false }; + } + } } - } - return result; + }; } - ts.mapDefinedIter = mapDefinedIter; + ts.mapDefinedIterator = mapDefinedIterator; + ts.emptyIterator = { next: function () { return ({ value: undefined, done: true }); } }; + function singleIterator(value) { + var done = false; + return { + next: function () { + var wasDone = done; + done = true; + return wasDone ? { value: undefined, done: true } : { value: value, done: false }; + } + }; + } + ts.singleIterator = singleIterator; /** * Computes the first matching span of elements and returns a tuple of the first span * and the remaining elements. @@ -2055,6 +2249,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -2158,7 +2363,7 @@ var ts; var result = 0; for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { var v = array_5[_i]; - // Note: we need the following type assertion because of GH #17069 + // TODO: Remove the following type assertion once the fix for #17069 is merged result += v[prop]; } return result; @@ -2625,6 +2830,15 @@ var ts; } } } + function group(values, getGroupId) { + var groupIdToGroup = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + groupIdToGroup.add(getGroupId(value), value); + } + return arrayFrom(groupIdToGroup.values()); + } + ts.group = group; /** * Tests whether a value is an array. */ @@ -2650,7 +2864,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; /** Does nothing. */ @@ -2665,6 +2884,9 @@ var ts; /** Returns its argument. */ function identity(x) { return x; } ts.identity = identity; + /** Returns lower case string */ + function toLowerCase(x) { return x.toLowerCase(); } + ts.toLowerCase = toLowerCase; /** Throws an error because a function is not implemented. */ function notImplemented() { throw new Error("Not implemented"); @@ -3026,6 +3248,11 @@ var ts; 0 /* EqualTo */; } ts.compareDiagnostics = compareDiagnostics; + /** True is greater than false. */ + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { // We still have both chains. @@ -3045,10 +3272,6 @@ var ts; // We still have one chain remaining. The shorter chain should come first. return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -3069,7 +3292,7 @@ var ts; return p2 + 1; } if (path.charCodeAt(1) === 58 /* colon */) { - if (path.charCodeAt(2) === 47 /* slash */) + if (path.charCodeAt(2) === 47 /* slash */ || path.charCodeAt(2) === 92 /* backslash */) return 3; } // Per RFC 1738 'file' URI schema has the shape file:/// @@ -3149,11 +3372,6 @@ var ts; return /^\.\.?($|[\\/])/.test(path); } ts.pathIsRelative = pathIsRelative; - /** @deprecated Use `!isExternalModuleNameRelative(moduleName)` instead. */ - function moduleHasNonRelativeName(moduleName) { - return !ts.isExternalModuleNameRelative(moduleName); - } - ts.moduleHasNonRelativeName = moduleHasNonRelativeName; function getEmitScriptTarget(compilerOptions) { return compilerOptions.target || 0 /* ES3 */; } @@ -3176,7 +3394,9 @@ var ts; var moduleKind = getEmitModuleKind(compilerOptions); return compilerOptions.allowSyntheticDefaultImports !== undefined ? compilerOptions.allowSyntheticDefaultImports - : moduleKind === ts.ModuleKind.System; + : compilerOptions.esModuleInterop + ? moduleKind !== ts.ModuleKind.None && moduleKind < ts.ModuleKind.ES2015 + : moduleKind === ts.ModuleKind.System; } ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports; function getStrictOptionValue(compilerOptions, flag) { @@ -3236,7 +3456,7 @@ var ts; ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { // Get root length of http://www.website.com/folder1/folder2/ - // In this example the root is: http://www.website.com/ + // In this example the root is: http://www.website.com/ // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; // Initial root length is http:// part @@ -3266,7 +3486,7 @@ var ts; } else { // Can't find the host assume the rest of the string as component - // but make sure we append "/" to it as root is not joined using "/" + // but make sure we append "/" to it as root is not joined using "/" // eg. if url passed in was http://website.com we want to use root as [http://website.com/] // so that other path manipulations will be correct and it can be merged with relative paths correctly return [url + ts.directorySeparator]; @@ -3285,7 +3505,7 @@ var ts; var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name - // that is ["test", "cases", ""] needs to be actually ["test", "cases"] + // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.pop(); } // Find the component that differs @@ -3507,7 +3727,6 @@ var ts; function getSubPatternFromSpec(spec, basePath, usage, _a) { var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; - var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; var components = getNormalizedPathComponents(spec, basePath); var lastComponent = lastOrUndefined(components); @@ -3524,11 +3743,7 @@ var ts; for (var _i = 0, components_1 = components; _i < components_1.length; _i++) { var component = components_1[_i]; if (component === "**") { - if (hasRecursiveDirectoryWildcard) { - return undefined; - } subpattern += doubleAsteriskRegexFragment; - hasRecursiveDirectoryWildcard = true; } else { if (usage === "directories") { @@ -3845,6 +4060,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -3854,10 +4073,10 @@ var ts; } function Signature() { } // tslint:disable-line no-empty function Node(kind, pos, end) { - this.id = 0; - this.kind = kind; this.pos = pos; this.end = end; + this.kind = kind; + this.id = 0; this.flags = 0 /* None */; this.modifierFlagsCache = 0 /* None */; this.transformFlags = 0 /* None */; @@ -3937,6 +4156,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -3955,6 +4187,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); /** Remove an item from an array, moving everything to its right one space left. */ function orderedRemoveItem(array, item) { @@ -3997,9 +4249,7 @@ var ts; } } function createGetCanonicalFileName(useCaseSensitiveFileNames) { - return useCaseSensitiveFileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); + return useCaseSensitiveFileNames ? identity : toLowerCase; } ts.createGetCanonicalFileName = createGetCanonicalFileName; /** @@ -4034,7 +4284,7 @@ var ts; */ function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; /** Return the object corresponding to the best pattern to match `candidate`. */ @@ -4042,8 +4292,8 @@ var ts; var matchedValue = undefined; // use length of prefix as betterness criteria var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -4118,182 +4368,20 @@ var ts; return function (arg) { return f(arg) && g(arg); }; } ts.and = and; + function or(f, g) { + return function (arg) { return f(arg) || g(arg); }; + } + ts.or = or; function assertTypeIsNever(_) { } // tslint:disable-line no-empty ts.assertTypeIsNever = assertTypeIsNever; - function createCachedDirectoryStructureHost(host) { - var cachedReadDirectoryResult = createMap(); - var getCurrentDirectory = memoize(function () { return host.getCurrentDirectory(); }); - var getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - return { - useCaseSensitiveFileNames: host.useCaseSensitiveFileNames, - newLine: host.newLine, - readFile: function (path, encoding) { return host.readFile(path, encoding); }, - write: function (s) { return host.write(s); }, - writeFile: writeFile, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: createDirectory, - getCurrentDirectory: getCurrentDirectory, - getDirectories: getDirectories, - readDirectory: readDirectory, - addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, - addOrDeleteFile: addOrDeleteFile, - clearCache: clearCache, - exit: function (code) { return host.exit(code); } - }; - function toPath(fileName) { - return ts.toPath(fileName, getCurrentDirectory(), getCanonicalFileName); - } - function getCachedFileSystemEntries(rootDirPath) { - return cachedReadDirectoryResult.get(rootDirPath); - } - function getCachedFileSystemEntriesForBaseDir(path) { - return getCachedFileSystemEntries(getDirectoryPath(path)); - } - function getBaseNameOfFileName(fileName) { - return getBaseFileName(normalizePath(fileName)); - } - function createCachedFileSystemEntries(rootDir, rootDirPath) { - var resultFromHost = { - files: map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [], - directories: host.getDirectories(rootDir) || [] - }; - cachedReadDirectoryResult.set(rootDirPath, resultFromHost); - return resultFromHost; - } - /** - * If the readDirectory result was already cached, it returns that - * Otherwise gets result from host and caches it. - * The host request is done under try catch block to avoid caching incorrect result - */ - function tryReadDirectory(rootDir, rootDirPath) { - var cachedResult = getCachedFileSystemEntries(rootDirPath); - if (cachedResult) { - return cachedResult; - } - try { - return createCachedFileSystemEntries(rootDir, rootDirPath); - } - catch (_e) { - // If there is exception to read directories, dont cache the result and direct the calls to host - Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); - return undefined; - } - } - function fileNameEqual(name1, name2) { - return getCanonicalFileName(name1) === getCanonicalFileName(name2); - } - function hasEntry(entries, name) { - return some(entries, function (file) { return fileNameEqual(file, name); }); - } - function updateFileSystemEntry(entries, baseName, isValid) { - if (hasEntry(entries, baseName)) { - if (!isValid) { - return filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); - } - } - else if (isValid) { - return entries.push(baseName); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), /*fileExists*/ true); - } - return host.writeFile(fileName, data, writeByteOrderMark); - } - function fileExists(fileName) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || - host.fileExists(fileName); - } - function directoryExists(dirPath) { - var path = toPath(dirPath); - return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); - } - function createDirectory(dirPath) { - var path = toPath(dirPath); - var result = getCachedFileSystemEntriesForBaseDir(path); - var baseFileName = getBaseNameOfFileName(dirPath); - if (result) { - updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true); - } - host.createDirectory(dirPath); - } - function getDirectories(rootDir) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return result.directories.slice(); - } - return host.getDirectories(rootDir); - } - function readDirectory(rootDir, extensions, excludes, includes, depth) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return matchFiles(rootDir, extensions, excludes, includes, host.useCaseSensitiveFileNames, getCurrentDirectory(), depth, getFileSystemEntries); - } - return host.readDirectory(rootDir, extensions, excludes, includes, depth); - function getFileSystemEntries(dir) { - var path = toPath(dir); - if (path === rootDirPath) { - return result; - } - return getCachedFileSystemEntries(path) || createCachedFileSystemEntries(dir, path); - } - } - function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { - var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); - if (existingResult) { - // Just clear the cache for now - // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated - clearCache(); - } - else { - // This was earlier a file (hence not in cached directory contents) - // or we never cached the directory containing it - var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); - if (parentResult) { - var baseName = getBaseNameOfFileName(fileOrDirectory); - if (parentResult) { - var fsQueryResult = { - fileExists: host.fileExists(fileOrDirectoryPath), - directoryExists: host.directoryExists(fileOrDirectoryPath) - }; - if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { - // Folder added or removed, clear the cache instead of updating the folder and its structure - clearCache(); - } - else { - // No need to update the directory structure, just files - updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); - } - return fsQueryResult; - } - } - } - } - function addOrDeleteFile(fileName, filePath, eventKind) { - if (eventKind === ts.FileWatcherEventKind.Changed) { - return; - } - var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); - if (parentResult) { - updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); - } - } - function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { - updateFileSystemEntry(parentResult.files, baseName, fileExists); - } - function clearCache() { - cachedReadDirectoryResult.clear(); - } + ts.emptyFileSystemEntries = { + files: ts.emptyArray, + directories: ts.emptyArray + }; + function singleElementArray(t) { + return t === undefined ? undefined : [t]; } - ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + ts.singleElementArray = singleElementArray; })(ts || (ts = {})); /// var ts; @@ -4332,13 +4420,36 @@ var ts; } ts.getNodeMajorVersion = getNodeMajorVersion; ts.sys = (function () { - var utf8ByteOrderMark = "\u00EF\u00BB\u00BF"; + // NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual + // byte order mark from the specified encoding. Using any other byte order mark does + // not actually work. + var byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); + // crypto can be absent on reduced node installations + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; + } var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + /** + * djb2 hashing algorithm + * http://www.cse.yorku.ca/~oz/hash.html + */ + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } function createWatchedFileSet() { var dirWatchers = ts.createMap(); // One file can have multiple watchers @@ -4525,7 +4636,7 @@ var ts; function writeFile(fileName, data, writeByteOrderMark) { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } var fd; try { @@ -4568,7 +4679,7 @@ var ts; return { files: files, directories: directories }; } catch (e) { - return { files: [], directories: [] }; + return ts.emptyFileSystemEntries; } } function readDirectory(path, extensions, excludes, includes, depth) { @@ -4601,6 +4712,9 @@ var ts; return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1 /* Directory */); }); } var nodeSystem = { + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, args: process.argv.slice(2), newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, @@ -4660,11 +4774,7 @@ var ts; return undefined; } }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, getMemoryUsage: function () { if (global.gc) { global.gc(); @@ -4685,7 +4795,12 @@ var ts; process.exit(exitCode); }, realpath: function (path) { - return _fs.realpathSync(path); + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } }, debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), tryEnableSourceMapsForHost: function () { @@ -4715,7 +4830,7 @@ var ts; writeFile: function (path, data, writeByteOrderMark) { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } ChakraHost.writeFile(path, data); }, @@ -5022,6 +5137,9 @@ var ts; unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts.DiagnosticCategory.Error, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), + An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -5136,6 +5254,7 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", "Numeric index type '{0}' is not assignable to string index type '{1}'."), Class_name_cannot_be_0: diag(2414, ts.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), @@ -5190,7 +5309,7 @@ var ts; Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), @@ -5278,6 +5397,8 @@ var ts; The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts.DiagnosticCategory.Error, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5356,6 +5477,10 @@ var ts; Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5442,7 +5567,6 @@ var ts; The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), - File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: diag(5011, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'."), Cannot_read_file_0_Colon_1: diag(5012, ts.DiagnosticCategory.Error, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), Failed_to_parse_file_0_Colon_1: diag(5014, ts.DiagnosticCategory.Error, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), Unknown_compiler_option_0: diag(5023, ts.DiagnosticCategory.Error, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), @@ -5481,6 +5605,7 @@ var ts; Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -5493,6 +5618,7 @@ var ts; Options_Colon: diag(6027, ts.DiagnosticCategory.Message, "Options_Colon_6027", "Options:"), Version_0: diag(6029, ts.DiagnosticCategory.Message, "Version_0_6029", "Version {0}"), Insert_command_line_options_and_files_from_a_file: diag(6030, ts.DiagnosticCategory.Message, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, ts.DiagnosticCategory.Message, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), File_change_detected_Starting_incremental_compilation: diag(6032, ts.DiagnosticCategory.Message, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), KIND: diag(6034, ts.DiagnosticCategory.Message, "KIND_6034", "KIND"), FILE: diag(6035, ts.DiagnosticCategory.Message, "FILE_6035", "FILE"), @@ -5533,7 +5659,7 @@ var ts; Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts.DiagnosticCategory.Message, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), - Specify_library_files_to_be_included_in_the_compilation_Colon: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", "Specify library files to be included in the compilation: "), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), Specify_JSX_code_generation_Colon_preserve_react_native_or_react: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", "Specify JSX code generation: 'preserve', 'react-native', or 'react'."), File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), @@ -5640,6 +5766,9 @@ var ts; Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6185", "Disable strict checking of generic signatures in function types."), Enable_strict_checking_of_function_types: diag(6186, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -5668,6 +5797,9 @@ var ts; Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{0}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime: diag(7038, ts.DiagnosticCategory.Error, "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038", "A namespace-style import cannot be called or constructed, and will cause a failure at runtime."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -5743,9 +5875,9 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), Declare_static_property_0: diag(90027, ts.DiagnosticCategory.Message, "Declare_static_property_0_90027", "Declare static property '{0}'"), Call_decorator_expression: diag(90028, ts.DiagnosticCategory.Message, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Extract_symbol: diag(95003, ts.DiagnosticCategory.Message, "Extract_symbol_95003", "Extract symbol"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -5757,6 +5889,9 @@ var ts; Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"), Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), }; })(ts || (ts = {})); /// @@ -5797,47 +5932,48 @@ var ts; "false": 86 /* FalseKeyword */, "finally": 87 /* FinallyKeyword */, "for": 88 /* ForKeyword */, - "from": 141 /* FromKeyword */, + "from": 142 /* FromKeyword */, "function": 89 /* FunctionKeyword */, "get": 125 /* GetKeyword */, "if": 90 /* IfKeyword */, "implements": 108 /* ImplementsKeyword */, "import": 91 /* ImportKeyword */, "in": 92 /* InKeyword */, + "infer": 126 /* InferKeyword */, "instanceof": 93 /* InstanceOfKeyword */, "interface": 109 /* InterfaceKeyword */, - "is": 126 /* IsKeyword */, - "keyof": 127 /* KeyOfKeyword */, + "is": 127 /* IsKeyword */, + "keyof": 128 /* KeyOfKeyword */, "let": 110 /* LetKeyword */, - "module": 128 /* ModuleKeyword */, - "namespace": 129 /* NamespaceKeyword */, - "never": 130 /* NeverKeyword */, + "module": 129 /* ModuleKeyword */, + "namespace": 130 /* NamespaceKeyword */, + "never": 131 /* NeverKeyword */, "new": 94 /* NewKeyword */, "null": 95 /* NullKeyword */, - "number": 133 /* NumberKeyword */, - "object": 134 /* ObjectKeyword */, + "number": 134 /* NumberKeyword */, + "object": 135 /* ObjectKeyword */, "package": 111 /* PackageKeyword */, "private": 112 /* PrivateKeyword */, "protected": 113 /* ProtectedKeyword */, "public": 114 /* PublicKeyword */, - "readonly": 131 /* ReadonlyKeyword */, - "require": 132 /* RequireKeyword */, - "global": 142 /* GlobalKeyword */, + "readonly": 132 /* ReadonlyKeyword */, + "require": 133 /* RequireKeyword */, + "global": 143 /* GlobalKeyword */, "return": 96 /* ReturnKeyword */, - "set": 135 /* SetKeyword */, + "set": 136 /* SetKeyword */, "static": 115 /* StaticKeyword */, - "string": 136 /* StringKeyword */, + "string": 137 /* StringKeyword */, "super": 97 /* SuperKeyword */, "switch": 98 /* SwitchKeyword */, - "symbol": 137 /* SymbolKeyword */, + "symbol": 138 /* SymbolKeyword */, "this": 99 /* ThisKeyword */, "throw": 100 /* ThrowKeyword */, "true": 101 /* TrueKeyword */, "try": 102 /* TryKeyword */, - "type": 138 /* TypeKeyword */, + "type": 139 /* TypeKeyword */, "typeof": 103 /* TypeOfKeyword */, - "undefined": 139 /* UndefinedKeyword */, - "unique": 140 /* UniqueKeyword */, + "undefined": 140 /* UndefinedKeyword */, + "unique": 141 /* UniqueKeyword */, "var": 104 /* VarKeyword */, "void": 105 /* VoidKeyword */, "while": 106 /* WhileKeyword */, @@ -5845,7 +5981,7 @@ var ts; "yield": 116 /* YieldKeyword */, "async": 120 /* AsyncKeyword */, "await": 121 /* AwaitKeyword */, - "of": 143 /* OfKeyword */, + "of": 144 /* OfKeyword */, "{": 17 /* OpenBraceToken */, "}": 18 /* CloseBraceToken */, "(": 19 /* OpenParenToken */, @@ -5904,7 +6040,7 @@ var ts; /* As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers IdentifierStart :: - Can contain Unicode 3.0.0 categories: + Can contain Unicode 3.0.0 categories: Uppercase letter (Lu), Lowercase letter (Ll), Titlecase letter (Lt), @@ -5912,7 +6048,7 @@ var ts; Other letter (Lo), or Letter number (Nl). IdentifierPart :: = - Can contain IdentifierStart + Unicode 3.0.0 categories: + Can contain IdentifierStart + Unicode 3.0.0 categories: Non-spacing mark (Mn), Combining spacing mark (Mc), Decimal number (Nd), or @@ -5926,7 +6062,7 @@ var ts; /* As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers IdentifierStart :: - Can contain Unicode 6.2 categories: + Can contain Unicode 6.2 categories: Uppercase letter (Lu), Lowercase letter (Ll), Titlecase letter (Lt), @@ -5934,7 +6070,7 @@ var ts; Other letter (Lo), or Letter number (Nl). IdentifierPart :: - Can contain IdentifierStart + Unicode 6.2 categories: + Can contain IdentifierStart + Unicode 6.2 categories: Non-spacing mark (Mn), Combining spacing mark (Mc), Decimal number (Nd), @@ -6036,7 +6172,9 @@ var ts; ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -6253,7 +6391,7 @@ var ts; } function scanConflictMarkerTrivia(text, pos, error) { if (error) { - error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength); + error(ts.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); } var ch = text.charCodeAt(pos); var len = text.length; @@ -6509,19 +6647,60 @@ var ts; lookAhead: lookAhead, scanRange: scanRange, }; - function error(message, length) { + function error(message, errPos, length) { + if (errPos === void 0) { errPos = pos; } if (onError) { + var oldPos = pos; + pos = errPos; onError(message, length || 0); + pos = oldPos; } } + function scanNumberFragment() { + var start = pos; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + var result = ""; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result += text.substring(start, pos); + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + start = pos; + continue; + } + if (isDigit(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result + text.substring(start, pos); + } function scanNumber() { var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; + var mainFragment = scanNumberFragment(); + var decimalFragment; + var scientificFragment; if (text.charCodeAt(pos) === 46 /* dot */) { pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; + decimalFragment = scanNumberFragment(); } var end = pos; if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { @@ -6529,17 +6708,29 @@ var ts; tokenFlags |= 16 /* Scientific */; if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { + var preNumericPart = pos; + var finalFragment = scanNumberFragment(); + if (!finalFragment) { error(ts.Diagnostics.Digit_expected); } + else { + scientificFragment = text.substring(end, preNumericPart) + finalFragment; + end = pos; + } + } + if (tokenFlags & 512 /* ContainsSeparator */) { + var result = mainFragment; + if (decimalFragment) { + result += "." + decimalFragment; + } + if (scientificFragment) { + result += scientificFragment; + } + return "" + +result; + } + else { + return "" + +(text.substring(start, end)); // No need to use all the fragments; no _ removal needed } - return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -6552,21 +6743,39 @@ var ts; * Scans the given number of hexadecimal digits in the text, * returning -1 if the given number is unavailable. */ - function scanExactNumberOfHexDigits(count) { - return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false); + function scanExactNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false, canHaveSeparators); } /** * Scans as many hexadecimal digits as are available in the text, * returning -1 if the given number of digits was unavailable. */ - function scanMinimumNumberOfHexDigits(count) { - return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true); + function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true, canHaveSeparators); } - function scanHexDigits(minCount, scanAsManyAsPossible) { + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { var digits = 0; var value = 0; + var allowSeparator = false; + var isPreviousTokenSeparator = false; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; } @@ -6581,10 +6790,14 @@ var ts; } pos++; digits++; + isPreviousTokenSeparator = false; } if (digits < minCount) { value = -1; } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } return value; } function scanString(jsxAttributeString) { @@ -6735,7 +6948,7 @@ var ts; } } function scanHexadecimalEscape(numDigits) { - var escapedValue = scanExactNumberOfHexDigits(numDigits); + var escapedValue = scanExactNumberOfHexDigits(numDigits, /*canHaveSeparators*/ false); if (escapedValue >= 0) { return String.fromCharCode(escapedValue); } @@ -6745,7 +6958,7 @@ var ts; } } function scanExtendedUnicodeEscape() { - var escapedValue = scanMinimumNumberOfHexDigits(1); + var escapedValue = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false); var isInvalidExtendedEscape = false; // Validate the value of the digit if (escapedValue < 0) { @@ -6789,7 +7002,7 @@ var ts; if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) { var start_1 = pos; pos += 2; - var value = scanExactNumberOfHexDigits(4); + var value = scanExactNumberOfHexDigits(4, /*canHaveSeparators*/ false); pos = start_1; return value; } @@ -6841,8 +7054,27 @@ var ts; // For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b. // Similarly valid octalIntegerLiteral must have at least one octal digit following o or O. var numberOfDigits = 0; + var separatorAllowed = false; + var isPreviousTokenSeparator = false; while (true) { var ch = text.charCodeAt(pos); + // Numeric seperators are allowed anywhere within a numeric literal, except not at the beginning, or following another separator + if (ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; var valueOfCh = ch - 48 /* _0 */; if (!isDigit(ch) || valueOfCh >= base) { break; @@ -6850,11 +7082,17 @@ var ts; value = value * base + valueOfCh; pos++; numberOfDigits++; + isPreviousTokenSeparator = false; } // Invalid binaryIntegerLiteral or octalIntegerLiteral if (numberOfDigits === 0) { return -1; } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + // Literal ends with underscore - not allowed + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + return value; + } return value; } function scan() { @@ -7044,7 +7282,7 @@ var ts; case 48 /* _0 */: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; - var value = scanMinimumNumberOfHexDigits(1); + var value = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ true); if (value < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); value = 0; @@ -7390,7 +7628,7 @@ var ts; break; } } - tokenValue += text.substr(firstCharPosition, pos - firstCharPosition); + tokenValue += text.substring(firstCharPosition, pos); } return token; } @@ -7413,6 +7651,7 @@ var ts; startPos = pos; tokenPos = pos; var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 9 /* tab */: case 11 /* verticalTab */: @@ -7423,55 +7662,30 @@ var ts; } return token = 5 /* WhitespaceTrivia */; case 64 /* at */: - pos++; return token = 57 /* AtToken */; case 10 /* lineFeed */: case 13 /* carriageReturn */: - pos++; return token = 4 /* NewLineTrivia */; case 42 /* asterisk */: - pos++; return token = 39 /* AsteriskToken */; case 123 /* openBrace */: - pos++; return token = 17 /* OpenBraceToken */; case 125 /* closeBrace */: - pos++; return token = 18 /* CloseBraceToken */; case 91 /* openBracket */: - pos++; return token = 21 /* OpenBracketToken */; case 93 /* closeBracket */: - pos++; return token = 22 /* CloseBracketToken */; case 60 /* lessThan */: - pos++; return token = 27 /* LessThanToken */; - case 62 /* greaterThan */: - pos++; - return token = 29 /* GreaterThanToken */; case 61 /* equals */: - pos++; return token = 58 /* EqualsToken */; case 44 /* comma */: - pos++; return token = 26 /* CommaToken */; case 46 /* dot */: - pos++; - if (text.substr(tokenPos, pos + 2) === "...") { - pos += 2; - return token = 24 /* DotDotDotToken */; - } return token = 23 /* DotToken */; - case 33 /* exclamation */: - pos++; - return token = 51 /* ExclamationToken */; - case 63 /* question */: - pos++; - return token = 55 /* QuestionToken */; } if (isIdentifierStart(ch, 6 /* Latest */)) { - pos++; while (isIdentifierPart(text.charCodeAt(pos), 6 /* Latest */) && pos < end) { pos++; } @@ -7479,7 +7693,7 @@ var ts; return token = 71 /* Identifier */; } else { - return pos += 1, token = 0 /* Unknown */; + return token = 0 /* Unknown */; } } function speculationHelper(callback, isLookahead) { @@ -7560,8 +7774,9 @@ var ts; /* @internal */ var ts; (function (ts) { - ts.emptyArray = []; + ts.resolvingEmptyArray = []; ts.emptyMap = ts.createMap(); + ts.emptyUnderscoreEscapedMap = ts.emptyMap; ts.externalHelpersModuleNameText = "tslib"; function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; @@ -7581,15 +7796,24 @@ var ts; var str = ""; var writeText = function (text) { return str += text; }; return { - string: function () { return str; }, + getText: function () { return str; }, + write: writeText, + rawWrite: writeText, + writeTextOfNode: writeText, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, writeSpace: writeText, writeStringLiteral: writeText, + writeLiteral: writeText, writeParameter: writeText, writeProperty: writeText, writeSymbol: writeText, + getTextPos: function () { return str.length; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, // Completely ignore indentation for string writers. And map newlines to // a single space. writeLine: function () { return str += " "; }, @@ -7603,10 +7827,10 @@ var ts; }; } function usingSingleLineStringWriter(action) { - var oldString = stringWriter.string(); + var oldString = stringWriter.getText(); try { action(stringWriter); - return stringWriter.string(); + return stringWriter.getText(); } finally { stringWriter.clear(); @@ -7640,12 +7864,19 @@ var ts; return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && + oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; function packageIdIsEqual(a, b) { return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version; } + function packageIdToString(_a) { + var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; + var fullName = subModuleName ? name + "/" + subModuleName : name; + return fullName + "@" + version; + } + ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -7689,7 +7920,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269 /* SourceFile */) { + while (node && node.kind !== 272 /* SourceFile */) { node = node.parent; } return node; @@ -7697,11 +7928,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return true; } return false; @@ -7810,7 +8041,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 290 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 293 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -7866,7 +8097,7 @@ var ts; function getLiteralText(node, sourceFile) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent) { + if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } var escapeText = getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; @@ -7927,11 +8158,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 /* VariableDeclaration */ && node.parent.kind === 264 /* CatchClause */; + return node.kind === 230 /* VariableDeclaration */ && node.parent.kind === 267 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 /* ModuleDeclaration */ && + return node && node.kind === 237 /* ModuleDeclaration */ && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -7950,11 +8181,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 234 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 237 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 /* SourceFile */ || - node.kind === 234 /* ModuleDeclaration */ || + return node.kind === 272 /* SourceFile */ || + node.kind === 237 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -7970,9 +8201,9 @@ var ts; return false; } switch (node.parent.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node.parent); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -7984,22 +8215,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 264 /* CatchClause */: - case 234 /* ModuleDeclaration */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 267 /* CatchClause */: + case 237 /* ModuleDeclaration */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; - case 208 /* Block */: + case 211 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !ts.isFunctionLike(parentNode); @@ -8009,25 +8240,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: ts.assertTypeIsNever(node); @@ -8037,8 +8268,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: return true; default: return false; @@ -8075,21 +8306,20 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return escapeLeadingUnderscores(name.text); - case 145 /* ComputedPropertyName */: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146 /* ComputedPropertyName */: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -8099,6 +8329,11 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -8126,7 +8361,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208 /* Block */) { + if (node.body && node.body.kind === 211 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -8140,7 +8375,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -8149,23 +8384,23 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 232 /* TypeAliasDeclaration */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -8173,9 +8408,19 @@ var ts; // construct. return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + // These asserts should all be satisfied for a properly constructed `errorNode`. + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -8184,7 +8429,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */ && isConst(node); + return node.kind === 236 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -8197,15 +8442,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 /* ExpressionStatement */ + return node.kind === 214 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -8214,11 +8459,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 /* Parameter */ || - node.kind === 146 /* TypeParameter */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 188 /* ArrowFunction */ || - node.kind === 186 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 148 /* Parameter */ || + node.kind === 147 /* TypeParameter */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 191 /* ArrowFunction */ || + node.kind === 189 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -8234,40 +8479,42 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 /* FirstTypeNode */ <= node.kind && node.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= node.kind && node.kind <= 177 /* LastTypeNode */) { return true; } switch (node.kind) { case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: + case 138 /* SymbolKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: return true; case 105 /* VoidKeyword */: - return node.parent.kind !== 191 /* VoidExpression */; - case 202 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 194 /* VoidExpression */; + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147 /* TypeParameter */: + return node.parent.kind === 176 /* MappedType */ || node.parent.kind === 171 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 71 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */ || node.kind === 180 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */ || node.kind === 183 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 144 /* QualifiedName */: - case 180 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: var parent = node.parent; - if (parent.kind === 163 /* TypeQuery */) { + if (parent.kind === 164 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -8276,38 +8523,38 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (159 /* FirstTypeNode */ <= parent.kind && parent.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= parent.kind && parent.kind <= 177 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return node === parent.constraint; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: return node === parent.type; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node === parent.type; - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return node === parent.type; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return node === parent.type; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; - case 184 /* TaggedTemplateExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + return ts.contains(parent.typeArguments, node); + case 187 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -8331,23 +8578,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitor(node); - case 236 /* CaseBlock */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 223 /* LabeledStatement */: - case 225 /* TryStatement */: - case 264 /* CatchClause */: + case 239 /* CaseBlock */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -8357,30 +8604,29 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(name.expression); + traverse(node.name.expression); return; } } @@ -8400,10 +8646,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 165 /* ArrayType */) { + if (node && node.kind === 166 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 160 /* TypeReference */) { + else if (node && node.kind === 161 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -8413,12 +8659,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 164 /* TypeLiteral */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 165 /* TypeLiteral */: return node.members; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.properties; } } @@ -8426,14 +8672,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177 /* BindingElement */: - case 268 /* EnumMember */: - case 147 /* Parameter */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 266 /* ShorthandPropertyAssignment */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 271 /* EnumMember */: + case 148 /* Parameter */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 269 /* ShorthandPropertyAssignment */: + case 230 /* VariableDeclaration */: return true; } } @@ -8441,8 +8687,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 /* VariableDeclarationList */ - && node.parent.parent.kind === 209 /* VariableStatement */; + return node.parent.kind === 231 /* VariableDeclarationList */ + && node.parent.parent.kind === 212 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -8453,13 +8699,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return true; } return false; @@ -8470,7 +8716,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223 /* LabeledStatement */) { + if (node.statement.kind !== 226 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -8478,17 +8724,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 211 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 /* MethodDeclaration */ && node.parent.kind === 179 /* ObjectLiteralExpression */; + return node && node.kind === 153 /* MethodDeclaration */ && node.parent.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 /* MethodDeclaration */ && - (node.parent.kind === 179 /* ObjectLiteralExpression */ || - node.parent.kind === 200 /* ClassExpression */); + return node.kind === 153 /* MethodDeclaration */ && + (node.parent.kind === 182 /* ObjectLiteralExpression */ || + node.parent.kind === 203 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -8501,7 +8747,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265 /* PropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -8523,7 +8769,7 @@ var ts; return undefined; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -8538,9 +8784,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8551,26 +8797,26 @@ var ts; node = node.parent; } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 234 /* ModuleDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 233 /* EnumDeclaration */: - case 269 /* SourceFile */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 237 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 236 /* EnumDeclaration */: + case 272 /* SourceFile */: return node; } } @@ -8580,9 +8826,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return container; } } @@ -8604,27 +8850,27 @@ var ts; return node; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: node = node.parent; break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8640,14 +8886,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */) { + if (func.kind === 190 /* FunctionExpression */ || func.kind === 191 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 186 /* ParenthesizedExpression */) { + while (parent.kind === 189 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 185 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -8658,7 +8904,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 97 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -8667,57 +8913,58 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 99 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { - return node.tag; + switch (node.kind) { + case 187 /* TaggedTemplateExpression */: + return node.tag; + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - // Will either be a CallExpression, NewExpression, or Decorator. - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // classes are valid targets return true; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 230 /* ClassDeclaration */; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + return parent.kind === 233 /* ClassDeclaration */; + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 230 /* ClassDeclaration */; - case 147 /* Parameter */: + && parent.kind === 233 /* ClassDeclaration */; + case 148 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 153 /* Constructor */ - || parent.kind === 152 /* MethodDeclaration */ - || parent.kind === 155 /* SetAccessor */) - && grandparent.kind === 230 /* ClassDeclaration */; + && (parent.kind === 154 /* Constructor */ + || parent.kind === 153 /* MethodDeclaration */ + || parent.kind === 156 /* SetAccessor */) + && grandparent.kind === 233 /* ClassDeclaration */; } return false; } @@ -8733,19 +8980,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152 /* MethodDeclaration */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 156 /* SetAccessor */: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 /* JsxOpeningElement */ || - parent.kind === 251 /* JsxSelfClosingElement */ || - parent.kind === 253 /* JsxClosingElement */) { + if (parent.kind === 255 /* JsxOpeningElement */ || + parent.kind === 254 /* JsxSelfClosingElement */ || + parent.kind === 256 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -8758,45 +9005,45 @@ var ts; case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 12 /* RegularExpressionLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 203 /* AsExpression */: - case 185 /* TypeAssertionExpression */: - case 204 /* NonNullExpression */: - case 186 /* ParenthesizedExpression */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 199 /* SpreadElement */: - case 197 /* TemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 206 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 207 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 202 /* SpreadElement */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: - case 201 /* OmittedExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 198 /* YieldExpression */: - case 192 /* AwaitExpression */: - case 205 /* MetaProperty */: + case 204 /* OmittedExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 201 /* YieldExpression */: + case 195 /* AwaitExpression */: + case 208 /* MetaProperty */: return true; - case 144 /* QualifiedName */: - while (node.parent.kind === 144 /* QualifiedName */) { + case 145 /* QualifiedName */: + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node); case 71 /* Identifier */: - if (node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -8812,47 +9059,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 180 /* BindingElement */: return parent.initializer === node; - case 211 /* ExpressionStatement */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 220 /* ReturnStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 224 /* ThrowStatement */: + case 214 /* ExpressionStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 223 /* ReturnStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 227 /* ThrowStatement */: return parent.expression === node; - case 215 /* ForStatement */: + case 218 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forInStatement.expression === node; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return node === parent.expression; - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return node === parent.expression; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return node === parent.expression; - case 148 /* Decorator */: - case 260 /* JsxExpression */: - case 259 /* JsxSpreadAttribute */: - case 267 /* SpreadAssignment */: + case 149 /* Decorator */: + case 263 /* JsxExpression */: + case 262 /* JsxSpreadAttribute */: + case 270 /* SpreadAssignment */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -8860,7 +9107,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -8869,7 +9116,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 252 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -8889,16 +9136,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 /* StringKeyword */ || node.typeArguments[0].kind === 133 /* NumberKeyword */); + (node.typeArguments[0].kind === 137 /* StringKeyword */ || node.typeArguments[0].kind === 134 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; - /** - * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one argument (of the form 'require("name")'). - * This function does not test if the node is in a JavaScript file or not. - */ function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182 /* CallExpression */) { + if (callExpression.kind !== 185 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -8925,9 +9167,9 @@ var ts; * This function does not test if the node is in a JavaScript file or not. */ function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227 /* VariableDeclaration */) { + if (s.valueDeclaration && s.valueDeclaration.kind === 230 /* VariableDeclaration */) { var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 /* FunctionExpression */ || declaration.initializer.kind === 200 /* ClassExpression */); + return declaration.initializer && (declaration.initializer.kind === 190 /* FunctionExpression */ || declaration.initializer.kind === 203 /* ClassExpression */); } return false; } @@ -8953,7 +9195,7 @@ var ts; if (!isInJavaScriptFile(expr)) { return 0 /* None */; } - if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 180 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 183 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; @@ -8975,7 +9217,7 @@ var ts; else if (lhs.expression.kind === 99 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 180 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 183 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 71 /* Identifier */) { @@ -8994,21 +9236,21 @@ var ts; ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 214 /* ExpressionStatement */ && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 238 /* ImportEqualsDeclaration */) { + if (node.kind === 241 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 249 /* ExternalModuleReference */) { + if (reference.kind === 252 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 245 /* ExportDeclaration */) { + if (node.kind === 248 /* ExportDeclaration */) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -9017,31 +9259,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238 /* ImportEqualsDeclaration */) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241 /* NamespaceImport */) { - return importClause.namedBindings; + switch (node.kind) { + case 242 /* ImportDeclaration */: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241 /* ImportEqualsDeclaration */: + return node; + case 248 /* ExportDeclaration */: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 /* ImportDeclaration */ - && node.importClause - && !!node.importClause.name; + return node.kind === 242 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147 /* Parameter */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 266 /* ShorthandPropertyAssignment */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 269 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -9049,54 +9292,45 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 /* JSDocFunctionType */ && + return node.kind === 280 /* JSDocFunctionType */ && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; } ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getAllJSDocs(node) { - if (ts.isJSDocTypedefTag(node)) { - return [node.parent]; - } - return getJSDocCommentsAndTags(node); - } - ts.getAllJSDocs = getAllJSDocs; function getSourceOfAssignment(node) { return ts.isExpressionStatement(node) && node.expression && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 58 /* EqualsToken */ && node.expression.right; } - ts.getSourceOfAssignment = getSourceOfAssignment; - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212 /* VariableStatement */: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151 /* PropertyDeclaration */: + return node.initializer; + } } - ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement; - function getSingleVariableOfVariableStatement(node, child) { + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } - ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement; function getNestedModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && + return node.kind === 237 /* ModuleDeclaration */ && node.body && - node.body.kind === 234 /* ModuleDeclaration */ && + node.body.kind === 237 /* ModuleDeclaration */ && node.body; } - ts.getNestedModuleDeclaration = getNestedModuleDeclaration; function getJSDocCommentsAndTags(node) { var result; getJSDocCommentsAndTagsWorker(node); return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 /* PropertyAssignment */ || parent.kind === 151 /* PropertyDeclaration */ || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. @@ -9106,21 +9340,21 @@ var ts; // */ // var x = function(name) { return name.length; } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 /* None */ || - node.kind === 180 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 211 /* ExpressionStatement */) { + node.kind === 183 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 214 /* ExpressionStatement */) { getJSDocCommentsAndTagsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } - if (isVariableLike(node) && node.initializer && ts.hasJSDocNodes(node.initializer)) { + if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { result = ts.addRange(result, node.initializer.jsDoc); } if (ts.hasJSDocNodes(node)) { @@ -9149,7 +9383,7 @@ var ts; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -9157,7 +9391,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 282 /* JSDocComment */); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -9186,30 +9420,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 43 /* PlusPlusToken */ || unaryOperator === 44 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 186 /* ParenthesizedExpression */: - case 178 /* ArrayLiteralExpression */: - case 199 /* SpreadElement */: + case 189 /* ParenthesizedExpression */: + case 181 /* ArrayLiteralExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: node = parent; break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -9230,6 +9465,33 @@ var ts; return getAssignmentTargetKind(node) !== 0 /* None */; } ts.isAssignmentTarget = isAssignmentTarget; + /** + * Indicates whether a node could contain a `var` VariableDeclarationList that contributes to + * the same `var` declaration scope as the node's parent. + */ + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 211 /* Block */: + case 212 /* VariableStatement */: + case 224 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: + return true; + } + return false; + } + ts.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration; function walkUp(node, kind) { while (node && node.kind === kind) { node = node.parent; @@ -9237,20 +9499,20 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169 /* ParenthesizedType */); + return walkUp(node, 172 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186 /* ParenthesizedExpression */); + return walkUp(node, 189 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189 /* DeleteExpression */; + return node && node.kind === 192 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -9292,7 +9554,7 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 145 /* ComputedPropertyName */ && + node.parent.kind === 146 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -9300,32 +9562,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 180 /* PropertyAccessExpression */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 183 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 144 /* QualifiedName */) { + while (parent.kind === 145 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 163 /* TypeQuery */; + return parent.kind === 164 /* TypeQuery */; } return false; - case 177 /* BindingElement */: - case 243 /* ImportSpecifier */: + case 180 /* BindingElement */: + case 246 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 247 /* ExportSpecifier */: - case 257 /* JsxAttribute */: + case 250 /* ExportSpecifier */: + case 260 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -9341,13 +9603,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 237 /* NamespaceExportDeclaration */ || - node.kind === 240 /* ImportClause */ && !!node.name || - node.kind === 241 /* NamespaceImport */ || - node.kind === 243 /* ImportSpecifier */ || - node.kind === 247 /* ExportSpecifier */ || - node.kind === 244 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 240 /* NamespaceExportDeclaration */ || + node.kind === 243 /* ImportClause */ && !!node.name || + node.kind === 244 /* NamespaceImport */ || + node.kind === 246 /* ImportSpecifier */ || + node.kind === 250 /* ExportSpecifier */ || + node.kind === 247 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -9431,11 +9693,11 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 72 /* FirstKeyword */ <= token && token <= 143 /* LastKeyword */; + return 72 /* FirstKeyword */ <= token && token <= 144 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 117 /* FirstContextualKeyword */ <= token && token <= 143 /* LastContextualKeyword */; + return 117 /* FirstContextualKeyword */ <= token && token <= 144 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -9465,14 +9727,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -9486,10 +9748,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -9516,7 +9778,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 145 /* ComputedPropertyName */ && + return name.kind === 146 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -9537,7 +9799,7 @@ var ts; if (name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */) { return escapeLeadingUnderscores(name.text); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -9579,6 +9841,10 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + function isKnownSymbol(symbol) { + return ts.startsWith(symbol.escapedName, "__@"); + } + ts.isKnownSymbol = isKnownSymbol; /** * Includes the word "Symbol" with unicode escapes */ @@ -9592,11 +9858,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 147 /* Parameter */; + return root.kind === 148 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 177 /* BindingElement */) { + while (node.kind === 180 /* BindingElement */) { node = node.parent.parent; } return node; @@ -9604,15 +9870,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 187 /* FunctionExpression */ - || kind === 229 /* FunctionDeclaration */ - || kind === 188 /* ArrowFunction */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 234 /* ModuleDeclaration */ - || kind === 269 /* SourceFile */; + return kind === 154 /* Constructor */ + || kind === 190 /* FunctionExpression */ + || kind === 232 /* FunctionDeclaration */ + || kind === 191 /* ArrowFunction */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 237 /* ModuleDeclaration */ + || kind === 272 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -9631,23 +9897,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 183 /* NewExpression */: + case 186 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 193 /* PrefixUnaryExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 192 /* AwaitExpression */: - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: + case 196 /* PrefixUnaryExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 195 /* AwaitExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: return 1 /* Right */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (operator) { case 40 /* AsteriskAsteriskToken */: case 58 /* EqualsToken */: @@ -9671,15 +9937,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 195 /* BinaryExpression */) { + if (expression.kind === 198 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 193 /* PrefixUnaryExpression */ || expression.kind === 194 /* PostfixUnaryExpression */) { + else if (expression.kind === 196 /* PrefixUnaryExpression */ || expression.kind === 197 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -9697,37 +9963,37 @@ var ts; case 86 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: case 12 /* RegularExpressionLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: - case 186 /* ParenthesizedExpression */: - case 201 /* OmittedExpression */: + case 200 /* TemplateExpression */: + case 189 /* ParenthesizedExpression */: + case 204 /* OmittedExpression */: return 19; - case 184 /* TaggedTemplateExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 187 /* TaggedTemplateExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return 18; - case 183 /* NewExpression */: + case 186 /* NewExpression */: return hasArguments ? 18 : 17; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return 17; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return 16; - case 193 /* PrefixUnaryExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 192 /* AwaitExpression */: + case 196 /* PrefixUnaryExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 195 /* AwaitExpression */: return 15; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (operatorKind) { case 51 /* ExclamationToken */: case 52 /* TildeToken */: @@ -9785,13 +10051,13 @@ var ts; default: return -1; } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return 4; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return 2; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return 1; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return 0; default: return -1; @@ -9800,9 +10066,9 @@ var ts; ts.getOperatorPrecedence = getOperatorPrecedence; function createDiagnosticCollection() { var nonFileDiagnostics = []; + var filesWithDiagnostics = []; var fileDiagnostics = ts.createMap(); var hasReadNonFileDiagnostics = false; - var diagnosticsModified = false; var modificationCount = 0; return { add: add, @@ -9824,6 +10090,7 @@ var ts; if (!diagnostics) { diagnostics = []; fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive); } } else { @@ -9834,39 +10101,23 @@ var ts; } diagnostics = nonFileDiagnostics; } - diagnostics.push(diagnostic); - diagnosticsModified = true; + ts.insertSorted(diagnostics, diagnostic, ts.compareDiagnostics); modificationCount++; } function getGlobalDiagnostics() { - sortAndDeduplicate(); hasReadNonFileDiagnostics = true; return nonFileDiagnostics; } function getDiagnostics(fileName) { - sortAndDeduplicate(); if (fileName) { return fileDiagnostics.get(fileName) || []; } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); + var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); }); + if (!nonFileDiagnostics.length) { + return fileDiags; } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - fileDiagnostics.forEach(function (diagnostics) { - ts.forEach(diagnostics, pushDiagnostic); - }); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - fileDiagnostics.forEach(function (diagnostics, key) { - fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); - }); + fileDiags.unshift.apply(fileDiags, nonFileDiagnostics); + return fileDiags; } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -10011,7 +10262,19 @@ var ts; getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, getText: function () { return output; }, isAtStartOfLine: function () { return lineStart; }, - reset: reset + clear: reset, + reportInaccessibleThisError: ts.noop, + reportPrivateInBaseOfClassExpression: ts.noop, + reportInaccessibleUniqueSymbolError: ts.noop, + trackSymbol: ts.noop, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: write }; } ts.createTextWriter = createTextWriter; @@ -10114,7 +10377,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -10160,10 +10423,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 155 /* SetAccessor */) { + else if (accessor.kind === 156 /* SetAccessor */) { setAccessor = accessor; } else { @@ -10172,7 +10435,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 /* GetAccessor */ || member.kind === 155 /* SetAccessor */) + if ((member.kind === 155 /* GetAccessor */ || member.kind === 156 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -10183,10 +10446,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 /* GetAccessor */ && !getAccessor) { + if (member.kind === 155 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 155 /* SetAccessor */ && !setAccessor) { + if (member.kind === 156 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -10206,7 +10469,7 @@ var ts; * parsed in a JavaScript file, gets the type annotation from JSDoc. */ function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (node.type) { + if (ts.hasType(node)) { return node.type; } if (checkJSDoc || isInJavaScriptFile(node)) { @@ -10497,7 +10760,7 @@ var ts; case 76 /* ConstKeyword */: return 2048 /* Const */; case 79 /* DefaultKeyword */: return 512 /* Default */; case 120 /* AsyncKeyword */: return 256 /* Async */; - case 131 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 132 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -10514,7 +10777,7 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ && + if (node.kind === 205 /* ExpressionWithTypeArguments */ && node.parent.token === 85 /* ExtendsKeyword */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -10532,8 +10795,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 179 /* ObjectLiteralExpression */ - || kind === 178 /* ArrayLiteralExpression */; + return kind === 182 /* ObjectLiteralExpression */ + || kind === 181 /* ArrayLiteralExpression */; } return false; } @@ -10543,7 +10806,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */ + return node.kind === 205 /* ExpressionWithTypeArguments */ && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 /* ImplementsKeyword */ @@ -10553,21 +10816,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + node.kind === 183 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 /* ObjectLiteralExpression */ && + return expression.kind === 182 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 /* ArrayLiteralExpression */ && + return expression.kind === 181 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -10651,14 +10914,14 @@ var ts; ts.convertToBase64 = convertToBase64; var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; - function getNewLineCharacter(options, system) { + function getNewLineCharacter(options, getNewLine) { switch (options.newLine) { case 0 /* CarriageReturnLineFeed */: return carriageReturnLineFeed; case 1 /* LineFeed */: return lineFeed; } - return system ? system.newLine : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; + return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; /** @@ -10836,8 +11099,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -10910,21 +11173,21 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 43 /* PlusPlusToken */ || operator === 44 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0 /* Read */; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && parent.parent.kind === 211 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && parent.parent.kind === 214 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function compareDataObjects(dst, src) { @@ -11021,6 +11284,14 @@ var ts; return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0; } ts.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures; + function forSomeAncestorDirectory(directory, callback) { + return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); + } + ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -11227,8 +11498,8 @@ var ts; // // { // oldStart3: Min(oldStart1, oldStart2), - // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), - // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // oldEnd3: Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3: Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) // } var oldStart1 = oldStartN; var oldEnd1 = oldEndN; @@ -11244,9 +11515,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146 /* TypeParameter */) { + if (d && d.kind === 147 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234 /* InterfaceDeclaration */) { return current; } } @@ -11254,7 +11525,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 153 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 154 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11272,7 +11543,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -11280,14 +11551,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -11303,14 +11574,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -11446,18 +11717,17 @@ var ts; } // Covers remaining cases switch (hostNode.kind) { - case 209 /* VariableStatement */: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212 /* VariableStatement */: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: var expr = hostNode.expression; switch (expr.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return expr.name; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -11466,10 +11736,10 @@ var ts; return undefined; case 1 /* EndOfFileToken */: return undefined; - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 223 /* LabeledStatement */: { + case 226 /* LabeledStatement */: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11494,15 +11764,15 @@ var ts; switch (declaration.kind) { case 71 /* Identifier */: return declaration; - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: { + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { return name.right; } break; } - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1 /* ExportsProperty */: @@ -11514,9 +11784,9 @@ var ts; return undefined; } } - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 244 /* ExportAssignment */: { + case 247 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -11553,33 +11823,33 @@ var ts; * for example on a variable declaration whose initializer is a function expression. */ function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284 /* JSDocParameterTag */); + return !!getFirstJSDocTag(node, 287 /* JSDocParameterTag */); } ts.hasJSDocParameterTags = hasJSDocParameterTags; /** Gets the JSDoc augments tag for the node if present */ function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 285 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; /** Gets the JSDoc class tag for the node if present */ function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283 /* JSDocClassTag */); + return getFirstJSDocTag(node, 286 /* JSDocClassTag */); } ts.getJSDocClassTag = getJSDocClassTag; /** Gets the JSDoc return tag for the node if present */ function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 288 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; /** Gets the JSDoc template tag for the node if present */ function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 290 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; /** Gets the JSDoc type tag for the node if present and valid */ function getJSDocTypeTag(node) { // We should have already issued an error if there were multiple type jsdocs, so just use the first one. - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -11598,8 +11868,8 @@ var ts; * tag directly on the node would be returned. */ function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); - if (!tag && node.kind === 147 /* Parameter */) { + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); + if (!tag && node.kind === 148 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -11683,608 +11953,616 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 144 /* QualifiedName */; + return node.kind === 145 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145 /* ComputedPropertyName */; + return node.kind === 146 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 146 /* TypeParameter */; + return node.kind === 147 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147 /* Parameter */; + return node.kind === 148 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 149 /* PropertySignature */; + return node.kind === 150 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150 /* PropertyDeclaration */; + return node.kind === 151 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151 /* MethodSignature */; + return node.kind === 152 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153 /* Constructor */; + return node.kind === 154 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156 /* CallSignature */; + return node.kind === 157 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157 /* ConstructSignature */; + return node.kind === 158 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158 /* IndexSignature */; + return node.kind === 159 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 159 /* TypePredicate */; + return node.kind === 160 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160 /* TypeReference */; + return node.kind === 161 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161 /* FunctionType */; + return node.kind === 162 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162 /* ConstructorType */; + return node.kind === 163 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163 /* TypeQuery */; + return node.kind === 164 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164 /* TypeLiteral */; + return node.kind === 165 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165 /* ArrayType */; + return node.kind === 166 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166 /* TupleType */; + return node.kind === 167 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167 /* UnionType */; + return node.kind === 168 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168 /* IntersectionType */; + return node.kind === 169 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170 /* ConditionalType */; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171 /* InferType */; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169 /* ParenthesizedType */; + return node.kind === 172 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170 /* ThisType */; + return node.kind === 173 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171 /* TypeOperator */; + return node.kind === 174 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172 /* IndexedAccessType */; + return node.kind === 175 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173 /* MappedType */; + return node.kind === 176 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174 /* LiteralType */; + return node.kind === 177 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 175 /* ObjectBindingPattern */; + return node.kind === 178 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176 /* ArrayBindingPattern */; + return node.kind === 179 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177 /* BindingElement */; + return node.kind === 180 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 178 /* ArrayLiteralExpression */; + return node.kind === 181 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179 /* ObjectLiteralExpression */; + return node.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180 /* PropertyAccessExpression */; + return node.kind === 183 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181 /* ElementAccessExpression */; + return node.kind === 184 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182 /* CallExpression */; + return node.kind === 185 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183 /* NewExpression */; + return node.kind === 186 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184 /* TaggedTemplateExpression */; + return node.kind === 187 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185 /* TypeAssertionExpression */; + return node.kind === 188 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186 /* ParenthesizedExpression */; + return node.kind === 189 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292 /* PartiallyEmittedExpression */) { + while (node.kind === 295 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187 /* FunctionExpression */; + return node.kind === 190 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188 /* ArrowFunction */; + return node.kind === 191 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189 /* DeleteExpression */; + return node.kind === 192 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 193 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191 /* VoidExpression */; + return node.kind === 194 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 195 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193 /* PrefixUnaryExpression */; + return node.kind === 196 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194 /* PostfixUnaryExpression */; + return node.kind === 197 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195 /* BinaryExpression */; + return node.kind === 198 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196 /* ConditionalExpression */; + return node.kind === 199 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197 /* TemplateExpression */; + return node.kind === 200 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198 /* YieldExpression */; + return node.kind === 201 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199 /* SpreadElement */; + return node.kind === 202 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200 /* ClassExpression */; + return node.kind === 203 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201 /* OmittedExpression */; + return node.kind === 204 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */; + return node.kind === 205 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203 /* AsExpression */; + return node.kind === 206 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204 /* NonNullExpression */; + return node.kind === 207 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205 /* MetaProperty */; + return node.kind === 208 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 206 /* TemplateSpan */; + return node.kind === 209 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207 /* SemicolonClassElement */; + return node.kind === 210 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 208 /* Block */; + return node.kind === 211 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209 /* VariableStatement */; + return node.kind === 212 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210 /* EmptyStatement */; + return node.kind === 213 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211 /* ExpressionStatement */; + return node.kind === 214 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212 /* IfStatement */; + return node.kind === 215 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213 /* DoStatement */; + return node.kind === 216 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214 /* WhileStatement */; + return node.kind === 217 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215 /* ForStatement */; + return node.kind === 218 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216 /* ForInStatement */; + return node.kind === 219 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217 /* ForOfStatement */; + return node.kind === 220 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218 /* ContinueStatement */; + return node.kind === 221 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219 /* BreakStatement */; + return node.kind === 222 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */; + return node.kind === 222 /* BreakStatement */ || node.kind === 221 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220 /* ReturnStatement */; + return node.kind === 223 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221 /* WithStatement */; + return node.kind === 224 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222 /* SwitchStatement */; + return node.kind === 225 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223 /* LabeledStatement */; + return node.kind === 226 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224 /* ThrowStatement */; + return node.kind === 227 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225 /* TryStatement */; + return node.kind === 228 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226 /* DebuggerStatement */; + return node.kind === 229 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227 /* VariableDeclaration */; + return node.kind === 230 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228 /* VariableDeclarationList */; + return node.kind === 231 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229 /* FunctionDeclaration */; + return node.kind === 232 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230 /* ClassDeclaration */; + return node.kind === 233 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231 /* InterfaceDeclaration */; + return node.kind === 234 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232 /* TypeAliasDeclaration */; + return node.kind === 235 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */; + return node.kind === 236 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */; + return node.kind === 237 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235 /* ModuleBlock */; + return node.kind === 238 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236 /* CaseBlock */; + return node.kind === 239 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237 /* NamespaceExportDeclaration */; + return node.kind === 240 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */; + return node.kind === 241 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239 /* ImportDeclaration */; + return node.kind === 242 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240 /* ImportClause */; + return node.kind === 243 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241 /* NamespaceImport */; + return node.kind === 244 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242 /* NamedImports */; + return node.kind === 245 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243 /* ImportSpecifier */; + return node.kind === 246 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244 /* ExportAssignment */; + return node.kind === 247 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245 /* ExportDeclaration */; + return node.kind === 248 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246 /* NamedExports */; + return node.kind === 249 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247 /* ExportSpecifier */; + return node.kind === 250 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248 /* MissingDeclaration */; + return node.kind === 251 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 249 /* ExternalModuleReference */; + return node.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 250 /* JsxElement */; + return node.kind === 253 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251 /* JsxSelfClosingElement */; + return node.kind === 254 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252 /* JsxOpeningElement */; + return node.kind === 255 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253 /* JsxClosingElement */; + return node.kind === 256 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254 /* JsxFragment */; + return node.kind === 257 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255 /* JsxOpeningFragment */; + return node.kind === 258 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256 /* JsxClosingFragment */; + return node.kind === 259 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257 /* JsxAttribute */; + return node.kind === 260 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258 /* JsxAttributes */; + return node.kind === 261 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259 /* JsxSpreadAttribute */; + return node.kind === 262 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260 /* JsxExpression */; + return node.kind === 263 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 261 /* CaseClause */; + return node.kind === 264 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262 /* DefaultClause */; + return node.kind === 265 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263 /* HeritageClause */; + return node.kind === 266 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264 /* CatchClause */; + return node.kind === 267 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 265 /* PropertyAssignment */; + return node.kind === 268 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266 /* ShorthandPropertyAssignment */; + return node.kind === 269 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267 /* SpreadAssignment */; + return node.kind === 270 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 269 /* SourceFile */; + return node.kind === 272 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270 /* Bundle */; + return node.kind === 273 /* Bundle */; } ts.isBundle = isBundle; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 271 /* JSDocTypeExpression */; + return node.kind === 274 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272 /* JSDocAllType */; + return node.kind === 275 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273 /* JSDocUnknownType */; + return node.kind === 276 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274 /* JSDocNullableType */; + return node.kind === 277 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275 /* JSDocNonNullableType */; + return node.kind === 278 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276 /* JSDocOptionalType */; + return node.kind === 279 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277 /* JSDocFunctionType */; + return node.kind === 280 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278 /* JSDocVariadicType */; + return node.kind === 281 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279 /* JSDocComment */; + return node.kind === 282 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282 /* JSDocAugmentsTag */; + return node.kind === 285 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284 /* JSDocParameterTag */; + return node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285 /* JSDocReturnTag */; + return node.kind === 288 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286 /* JSDocTypeTag */; + return node.kind === 289 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287 /* JSDocTemplateTag */; + return node.kind === 290 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288 /* JSDocTypedefTag */; + return node.kind === 291 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289 /* JSDocPropertyTag */; + return node.kind === 292 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 /* JSDocPropertyTag */ || node.kind === 284 /* JSDocParameterTag */; + return node.kind === 292 /* JSDocPropertyTag */ || node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280 /* JSDocTypeLiteral */; + return node.kind === 283 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); @@ -12295,7 +12573,7 @@ var ts; (function (ts) { /* @internal */ function isSyntaxList(n) { - return n.kind === 290 /* SyntaxList */; + return n.kind === 293 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -12305,15 +12583,16 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 144 /* FirstNode */; + return kind >= 145 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 143 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 144 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12352,7 +12631,7 @@ var ts; /* @internal */ function isGeneratedIdentifier(node) { // Using `>` here catches both `GeneratedIdentifierKind.None` and `undefined`. - return ts.isIdentifier(node) && node.autoGenerateKind > 0 /* None */; + return ts.isIdentifier(node) && (node.autoGenerateFlags & 7 /* KindMask */) > 0 /* None */; } ts.isGeneratedIdentifier = isGeneratedIdentifier; // Keywords @@ -12368,7 +12647,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 115 /* StaticKeyword */: return true; } @@ -12381,7 +12660,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 /* QualifiedName */ + return kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12390,14 +12669,14 @@ var ts; return kind === 71 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 145 /* ComputedPropertyName */; + || kind === 146 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 175 /* ObjectBindingPattern */ - || kind === 176 /* ArrayBindingPattern */; + || kind === 178 /* ObjectBindingPattern */ + || kind === 179 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12412,13 +12691,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: return false; @@ -12427,13 +12706,13 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12448,68 +12727,80 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 150 /* PropertyDeclaration */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 158 /* IndexSignature */ - || kind === 207 /* SemicolonClassElement */ - || kind === 248 /* MissingDeclaration */; + return kind === 154 /* Constructor */ + || kind === 151 /* PropertyDeclaration */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 159 /* IndexSignature */ + || kind === 210 /* SemicolonClassElement */ + || kind === 251 /* MissingDeclaration */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */); + return node && (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */); + return node && (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */); } ts.isAccessor = isAccessor; + /* @internal */ + function isMethodOrAccessor(node) { + switch (node.kind) { + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return true; + default: + return false; + } + } + ts.isMethodOrAccessor = isMethodOrAccessor; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 157 /* ConstructSignature */ - || kind === 156 /* CallSignature */ - || kind === 149 /* PropertySignature */ - || kind === 151 /* MethodSignature */ - || kind === 158 /* IndexSignature */ - || kind === 248 /* MissingDeclaration */; + return kind === 158 /* ConstructSignature */ + || kind === 157 /* CallSignature */ + || kind === 150 /* PropertySignature */ + || kind === 152 /* MethodSignature */ + || kind === 159 /* IndexSignature */ + || kind === 251 /* MissingDeclaration */; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 /* PropertyAssignment */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 267 /* SpreadAssignment */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 248 /* MissingDeclaration */; + return kind === 268 /* PropertyAssignment */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 270 /* SpreadAssignment */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 251 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) + return (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) || kind === 119 /* AnyKeyword */ - || kind === 133 /* NumberKeyword */ - || kind === 134 /* ObjectKeyword */ + || kind === 134 /* NumberKeyword */ + || kind === 135 /* ObjectKeyword */ || kind === 122 /* BooleanKeyword */ - || kind === 136 /* StringKeyword */ - || kind === 137 /* SymbolKeyword */ + || kind === 137 /* StringKeyword */ + || kind === 138 /* SymbolKeyword */ || kind === 99 /* ThisKeyword */ || kind === 105 /* VoidKeyword */ - || kind === 139 /* UndefinedKeyword */ + || kind === 140 /* UndefinedKeyword */ || kind === 95 /* NullKeyword */ - || kind === 130 /* NeverKeyword */ - || kind === 202 /* ExpressionWithTypeArguments */ - || kind === 272 /* JSDocAllType */ - || kind === 273 /* JSDocUnknownType */ - || kind === 274 /* JSDocNullableType */ - || kind === 275 /* JSDocNonNullableType */ - || kind === 276 /* JSDocOptionalType */ - || kind === 277 /* JSDocFunctionType */ - || kind === 278 /* JSDocVariadicType */; + || kind === 131 /* NeverKeyword */ + || kind === 205 /* ExpressionWithTypeArguments */ + || kind === 275 /* JSDocAllType */ + || kind === 276 /* JSDocUnknownType */ + || kind === 277 /* JSDocNullableType */ + || kind === 278 /* JSDocNonNullableType */ + || kind === 279 /* JSDocOptionalType */ + || kind === 280 /* JSDocFunctionType */ + || kind === 281 /* JSDocVariadicType */; } /** * Node test that determines whether a node is a valid type node. @@ -12522,8 +12813,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return true; } return false; @@ -12534,8 +12825,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 /* ArrayBindingPattern */ - || kind === 175 /* ObjectBindingPattern */; + return kind === 179 /* ArrayBindingPattern */ + || kind === 178 /* ObjectBindingPattern */; } return false; } @@ -12543,15 +12834,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 /* ArrayLiteralExpression */ - || kind === 179 /* ObjectLiteralExpression */; + return kind === 181 /* ArrayLiteralExpression */ + || kind === 182 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 /* BindingElement */ - || kind === 201 /* OmittedExpression */; + return kind === 180 /* BindingElement */ + || kind === 204 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12560,9 +12851,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 180 /* BindingElement */: return true; } return false; @@ -12583,8 +12874,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return true; } return false; @@ -12596,8 +12887,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return true; } return false; @@ -12606,18 +12897,18 @@ var ts; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 /* PropertyAccessExpression */ - || kind === 144 /* QualifiedName */; + return kind === 183 /* PropertyAccessExpression */ + || kind === 145 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 148 /* Decorator */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 149 /* Decorator */: return true; default: return false; @@ -12625,12 +12916,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 /* CallExpression */ || node.kind === 183 /* NewExpression */; + return node.kind === 185 /* CallExpression */ || node.kind === 186 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 /* TemplateExpression */ + return kind === 200 /* TemplateExpression */ || kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12641,32 +12932,32 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 183 /* NewExpression */: - case 182 /* CallExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 184 /* TaggedTemplateExpression */: - case 178 /* ArrayLiteralExpression */: - case 186 /* ParenthesizedExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 187 /* FunctionExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 186 /* NewExpression */: + case 185 /* CallExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 187 /* TaggedTemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 189 /* ParenthesizedExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 190 /* FunctionExpression */: case 71 /* Identifier */: case 12 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 101 /* TrueKeyword */: case 97 /* SuperKeyword */: - case 204 /* NonNullExpression */: - case 205 /* MetaProperty */: + case 207 /* NonNullExpression */: + case 208 /* MetaProperty */: case 91 /* ImportKeyword */:// technically this is only an Expression if it's in a CallExpression return true; default: @@ -12680,13 +12971,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 185 /* TypeAssertionExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 188 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12695,9 +12986,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; default: @@ -12716,15 +13007,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: - case 188 /* ArrowFunction */: - case 195 /* BinaryExpression */: - case 199 /* SpreadElement */: - case 203 /* AsExpression */: - case 201 /* OmittedExpression */: - case 293 /* CommaListExpression */: - case 292 /* PartiallyEmittedExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: + case 191 /* ArrowFunction */: + case 198 /* BinaryExpression */: + case 202 /* SpreadElement */: + case 206 /* AsExpression */: + case 204 /* OmittedExpression */: + case 296 /* CommaListExpression */: + case 295 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12732,18 +13023,18 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 /* TypeAssertionExpression */ - || kind === 203 /* AsExpression */; + return kind === 188 /* TypeAssertionExpression */ + || kind === 206 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 292 /* PartiallyEmittedExpression */; + return node.kind === 295 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 291 /* NotEmittedStatement */; + return node.kind === 294 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ @@ -12755,13 +13046,13 @@ var ts; // Statement function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return true; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12769,7 +13060,7 @@ var ts; ts.isIterationStatement = isIterationStatement; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 216 /* ForInStatement */ || node.kind === 217 /* ForOfStatement */; + return node.kind === 219 /* ForInStatement */ || node.kind === 220 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12793,111 +13084,111 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */ + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */ || kind === 71 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */; + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 234 /* ModuleDeclaration */; + || kind === 237 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 /* NamedImports */ - || kind === 241 /* NamespaceImport */; + return kind === 245 /* NamedImports */ + || kind === 244 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ || node.kind === 233 /* EnumDeclaration */; + return node.kind === 237 /* ModuleDeclaration */ || node.kind === 236 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 /* ArrowFunction */ - || kind === 177 /* BindingElement */ - || kind === 230 /* ClassDeclaration */ - || kind === 200 /* ClassExpression */ - || kind === 153 /* Constructor */ - || kind === 233 /* EnumDeclaration */ - || kind === 268 /* EnumMember */ - || kind === 247 /* ExportSpecifier */ - || kind === 229 /* FunctionDeclaration */ - || kind === 187 /* FunctionExpression */ - || kind === 154 /* GetAccessor */ - || kind === 240 /* ImportClause */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 243 /* ImportSpecifier */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 257 /* JsxAttribute */ - || kind === 152 /* MethodDeclaration */ - || kind === 151 /* MethodSignature */ - || kind === 234 /* ModuleDeclaration */ - || kind === 237 /* NamespaceExportDeclaration */ - || kind === 241 /* NamespaceImport */ - || kind === 147 /* Parameter */ - || kind === 265 /* PropertyAssignment */ - || kind === 150 /* PropertyDeclaration */ - || kind === 149 /* PropertySignature */ - || kind === 155 /* SetAccessor */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 146 /* TypeParameter */ - || kind === 227 /* VariableDeclaration */ - || kind === 288 /* JSDocTypedefTag */; + return kind === 191 /* ArrowFunction */ + || kind === 180 /* BindingElement */ + || kind === 233 /* ClassDeclaration */ + || kind === 203 /* ClassExpression */ + || kind === 154 /* Constructor */ + || kind === 236 /* EnumDeclaration */ + || kind === 271 /* EnumMember */ + || kind === 250 /* ExportSpecifier */ + || kind === 232 /* FunctionDeclaration */ + || kind === 190 /* FunctionExpression */ + || kind === 155 /* GetAccessor */ + || kind === 243 /* ImportClause */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 246 /* ImportSpecifier */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 260 /* JsxAttribute */ + || kind === 153 /* MethodDeclaration */ + || kind === 152 /* MethodSignature */ + || kind === 237 /* ModuleDeclaration */ + || kind === 240 /* NamespaceExportDeclaration */ + || kind === 244 /* NamespaceImport */ + || kind === 148 /* Parameter */ + || kind === 268 /* PropertyAssignment */ + || kind === 151 /* PropertyDeclaration */ + || kind === 150 /* PropertySignature */ + || kind === 156 /* SetAccessor */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 147 /* TypeParameter */ + || kind === 230 /* VariableDeclaration */ + || kind === 291 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 229 /* FunctionDeclaration */ - || kind === 248 /* MissingDeclaration */ - || kind === 230 /* ClassDeclaration */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 233 /* EnumDeclaration */ - || kind === 234 /* ModuleDeclaration */ - || kind === 239 /* ImportDeclaration */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 245 /* ExportDeclaration */ - || kind === 244 /* ExportAssignment */ - || kind === 237 /* NamespaceExportDeclaration */; + return kind === 232 /* FunctionDeclaration */ + || kind === 251 /* MissingDeclaration */ + || kind === 233 /* ClassDeclaration */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 236 /* EnumDeclaration */ + || kind === 237 /* ModuleDeclaration */ + || kind === 242 /* ImportDeclaration */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 248 /* ExportDeclaration */ + || kind === 247 /* ExportAssignment */ + || kind === 240 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 /* BreakStatement */ - || kind === 218 /* ContinueStatement */ - || kind === 226 /* DebuggerStatement */ - || kind === 213 /* DoStatement */ - || kind === 211 /* ExpressionStatement */ - || kind === 210 /* EmptyStatement */ - || kind === 216 /* ForInStatement */ - || kind === 217 /* ForOfStatement */ - || kind === 215 /* ForStatement */ - || kind === 212 /* IfStatement */ - || kind === 223 /* LabeledStatement */ - || kind === 220 /* ReturnStatement */ - || kind === 222 /* SwitchStatement */ - || kind === 224 /* ThrowStatement */ - || kind === 225 /* TryStatement */ - || kind === 209 /* VariableStatement */ - || kind === 214 /* WhileStatement */ - || kind === 221 /* WithStatement */ - || kind === 291 /* NotEmittedStatement */ - || kind === 295 /* EndOfDeclarationMarker */ - || kind === 294 /* MergeDeclarationMarker */; + return kind === 222 /* BreakStatement */ + || kind === 221 /* ContinueStatement */ + || kind === 229 /* DebuggerStatement */ + || kind === 216 /* DoStatement */ + || kind === 214 /* ExpressionStatement */ + || kind === 213 /* EmptyStatement */ + || kind === 219 /* ForInStatement */ + || kind === 220 /* ForOfStatement */ + || kind === 218 /* ForStatement */ + || kind === 215 /* IfStatement */ + || kind === 226 /* LabeledStatement */ + || kind === 223 /* ReturnStatement */ + || kind === 225 /* SwitchStatement */ + || kind === 227 /* ThrowStatement */ + || kind === 228 /* TryStatement */ + || kind === 212 /* VariableStatement */ + || kind === 217 /* WhileStatement */ + || kind === 224 /* WithStatement */ + || kind === 294 /* NotEmittedStatement */ + || kind === 298 /* EndOfDeclarationMarker */ + || kind === 297 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 146 /* TypeParameter */) { - return node.parent.kind !== 287 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); + if (node.kind === 147 /* TypeParameter */) { + return node.parent.kind !== 290 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -12924,10 +13215,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208 /* Block */) + if (node.kind !== 211 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 /* TryStatement */ || node.parent.kind === 264 /* CatchClause */) { + if (node.parent.kind === 228 /* TryStatement */ || node.parent.kind === 267 /* CatchClause */) { return false; } } @@ -12937,8 +13228,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 249 /* ExternalModuleReference */ - || kind === 144 /* QualifiedName */ + return kind === 252 /* ExternalModuleReference */ + || kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12948,70 +13239,70 @@ var ts; var kind = node.kind; return kind === 99 /* ThisKeyword */ || kind === 71 /* Identifier */ - || kind === 180 /* PropertyAccessExpression */; + || kind === 183 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 250 /* JsxElement */ - || kind === 260 /* JsxExpression */ - || kind === 251 /* JsxSelfClosingElement */ + return kind === 253 /* JsxElement */ + || kind === 263 /* JsxExpression */ + || kind === 254 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */ - || kind === 254 /* JsxFragment */; + || kind === 257 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 /* JsxAttribute */ - || kind === 259 /* JsxSpreadAttribute */; + return kind === 260 /* JsxAttribute */ + || kind === 262 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 260 /* JsxExpression */; + || kind === 263 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 /* JsxOpeningElement */ - || kind === 251 /* JsxSelfClosingElement */; + return kind === 255 /* JsxOpeningElement */ + || kind === 254 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 /* CaseClause */ - || kind === 262 /* DefaultClause */; + return kind === 264 /* CaseClause */ + || kind === 265 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 271 /* FirstJSDocNode */ && node.kind <= 289 /* LastJSDocNode */; + return node.kind >= 274 /* FirstJSDocNode */ && node.kind <= 292 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 279 /* JSDocComment */ || isJSDocTag(node); + return node.kind === 282 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 281 /* FirstJSDocTagNode */ && node.kind <= 289 /* LastJSDocTagNode */; + return node.kind >= 284 /* FirstJSDocTagNode */ && node.kind <= 292 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13020,6 +13311,48 @@ var ts; return !!node.jsDoc && node.jsDoc.length > 0; } ts.hasJSDocNodes = hasJSDocNodes; + /** True if has type node attached to it. */ + /* @internal */ + function hasType(node) { + return !!node.type; + } + ts.hasType = hasType; + /** True if has initializer node attached to it. */ + /* @internal */ + function hasInitializer(node) { + return !!node.initializer; + } + ts.hasInitializer = hasInitializer; + /** True if has initializer node attached to it. */ + /* @internal */ + function hasOnlyExpressionInitializer(node) { + return hasInitializer(node) && !ts.isForStatement(node) && !ts.isForInStatement(node) && !ts.isForOfStatement(node) && !ts.isJsxAttribute(node); + } + ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; + function isObjectLiteralElement(node) { + switch (node.kind) { + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return true; + default: + return false; + } + } + ts.isObjectLiteralElement = isObjectLiteralElement; + /* @internal */ + function isTypeReferenceType(node) { + return node.kind === 161 /* TypeReference */ || node.kind === 205 /* ExpressionWithTypeArguments */; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); /// /// @@ -13042,7 +13375,7 @@ var ts; var SourceFileConstructor; // tslint:enable variable-name function createNode(kind, pos, end) { - if (kind === 269 /* SourceFile */) { + if (kind === 272 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71 /* Identifier */) { @@ -13087,60 +13420,88 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143 /* LastToken */) { + if (!node || node.kind <= 144 /* LastToken */) { return; } switch (node.kind) { - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: + case 148 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 151 /* PropertyDeclaration */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 150 /* PropertySignature */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 268 /* PropertyAssignment */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.initializer); + case 230 /* VariableDeclaration */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.exclamationToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 180 /* BindingElement */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13151,291 +13512,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 166 /* TupleType */: + case 167 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 169 /* ParenthesizedType */: - case 171 /* TypeOperator */: + case 170 /* ConditionalType */: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); + case 171 /* InferType */: + return visitNode(cbNode, node.typeParameter); + case 172 /* ParenthesizedType */: + case 174 /* TypeOperator */: return visitNode(cbNode, node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173 /* MappedType */: + case 176 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return visitNode(cbNode, node.literal); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitNode(cbNode, node.name); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return visitNode(cbNode, node.label); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148 /* Decorator */: + case 149 /* Decorator */: return visitNode(cbNode, node.expression); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -13444,17 +13812,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return visitNode(cbNode, node.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return visitNodes(cbNode, cbNodes, node.typeParameters); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: if (node.typeExpression && - node.typeExpression.kind === 271 /* JSDocTypeExpression */) { + node.typeExpression.kind === 274 /* JSDocTypeExpression */) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -13462,7 +13830,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280 /* JSDocTypeLiteral */: + case 283 /* JSDocTypeLiteral */: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -13470,7 +13838,7 @@ var ts; } } return; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -13572,7 +13940,7 @@ var ts; // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost // all nodes would need extra state on them to store this info. // - // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 // grammar specification. // // An important thing about these context concepts. By default they are effectively inherited @@ -13668,7 +14036,7 @@ var ts; else if (token() === 17 /* OpenBraceToken */ || lookAhead(function () { return token() === 9 /* StringLiteral */; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token); } else { parseExpected(17 /* OpenBraceToken */); @@ -13750,15 +14118,7 @@ var ts; if (comments) { for (var _i = 0, comments_2 = comments; _i < comments_2.length; _i++) { var comment = comments_2[_i]; - var jsDoc = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDoc) { - if (!node.jsDoc) { - node.jsDoc = [jsDoc]; - } - else { - node.jsDoc.push(jsDoc); - } - } + node.jsDoc = ts.append(node.jsDoc, JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); } } return node; @@ -13796,7 +14156,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(269 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(272 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14042,9 +14402,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -14180,7 +14540,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(145 /* ComputedPropertyName */); + var node = createNode(146 /* ComputedPropertyName */); parseExpected(21 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -14295,9 +14655,13 @@ var ts; return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isIdentifierOrPattern(); case 18 /* TypeParameters */: return isIdentifier(); - case 11 /* ArgumentExpressions */: case 15 /* ArrayLiteralMembers */: - return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isStartOfExpression(); + if (token() === 26 /* CommaToken */) { + return true; + } + // falls through + case 11 /* ArgumentExpressions */: + return token() === 24 /* DotDotDotToken */ || isStartOfExpression(); case 16 /* Parameters */: return isStartOfParameter(); case 19 /* TypeArguments */: @@ -14317,7 +14681,7 @@ var ts; function isValidHeritageClauseObjectLiteral() { ts.Debug.assert(token() === 17 /* OpenBraceToken */); if (nextToken() === 18 /* CloseBraceToken */) { - // if we see "extends {}" then only treat the {} as what we're extending (and not + // if we see "extends {}" then only treat the {} as what we're extending (and not // the class body) if we have: // // extends {} { @@ -14352,6 +14716,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } // True if positioned at a list terminator function isListTerminator(kind) { if (token() === 1 /* EndOfFileToken */) { @@ -14401,7 +14769,7 @@ var ts; } function isVariableDeclaratorListTerminator() { // If we can consume a semicolon (either explicitly, or with ASI), then consider us done - // with parsing the list of variable declarators. + // with parsing the list of variable declarators. if (canParseSemicolon()) { return true; } @@ -14506,6 +14874,10 @@ var ts; if (!canReuseNode(node, parsingContext)) { return undefined; } + if (node.jsDocCache) { + // jsDocCache may include tags from parent nodes, which might have been modified. + node.jsDocCache = undefined; + } return node; } function consumeNode(node) { @@ -14579,14 +14951,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153 /* Constructor */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 150 /* PropertyDeclaration */: - case 207 /* SemicolonClassElement */: + case 154 /* Constructor */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 210 /* SemicolonClassElement */: return true; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -14601,8 +14973,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: return true; } } @@ -14611,58 +14983,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 209 /* VariableStatement */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 211 /* ExpressionStatement */: - case 224 /* ThrowStatement */: - case 220 /* ReturnStatement */: - case 222 /* SwitchStatement */: - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 210 /* EmptyStatement */: - case 225 /* TryStatement */: - case 223 /* LabeledStatement */: - case 213 /* DoStatement */: - case 226 /* DebuggerStatement */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 212 /* VariableStatement */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 214 /* ExpressionStatement */: + case 227 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 225 /* SwitchStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 213 /* EmptyStatement */: + case 228 /* TryStatement */: + case 226 /* LabeledStatement */: + case 216 /* DoStatement */: + case 229 /* DebuggerStatement */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 149 /* PropertySignature */: - case 156 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 150 /* PropertySignature */: + case 157 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227 /* VariableDeclaration */) { + if (node.kind !== 230 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -14683,7 +15055,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147 /* Parameter */) { + if (node.kind !== 148 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -14812,7 +15184,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144 /* QualifiedName */, entity.pos); + var node = createNode(145 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -14849,7 +15221,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197 /* TemplateExpression */); + var template = createNode(200 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -14861,7 +15233,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206 /* TemplateSpan */); + var span = createNode(209 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18 /* CloseBraceToken */) { @@ -14869,7 +15241,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); + literal = parseExpectedToken(16 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -14904,7 +15276,7 @@ var ts; // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. if (node.kind === 8 /* NumericLiteral */) { - node.numericLiteralFlags = scanner.getTokenFlags() & 496 /* NumericLiteralFlags */; + node.numericLiteralFlags = scanner.getTokenFlags() & 1008 /* NumericLiteralFlags */; } nextToken(); finishNode(node); @@ -14912,7 +15284,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */); @@ -14921,18 +15293,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159 /* TypePredicate */, lhs.pos); + var node = createNode(160 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170 /* ThisType */); + var node = createNode(173 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272 /* JSDocAllType */); + var result = createNode(275 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -14955,28 +15327,28 @@ var ts; token() === 29 /* GreaterThanToken */ || token() === 58 /* EqualsToken */ || token() === 49 /* BarToken */) { - var result = createNode(273 /* JSDocUnknownType */, pos); + var result = createNode(276 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(274 /* JSDocNullableType */, pos); + var result = createNode(277 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(280 /* JSDocFunctionType */); nextToken(); fillSignature(56 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147 /* Parameter */); + var parameter = createNode(148 /* Parameter */); if (token() === 99 /* ThisKeyword */ || token() === 94 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(56 /* ColonToken */); @@ -14991,13 +15363,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163 /* TypeQuery */); + var node = createNode(164 /* TypeQuery */); parseExpected(103 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(85 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -15014,7 +15386,7 @@ var ts; // // // - // We do *not* want to consume the > as we're consuming the expression for "". + // We do *not* want to consume the `>` as we're consuming the expression for "". node.expression = parseUnaryExpressionOrHigher(); } } @@ -15042,7 +15414,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ true); } function parseParameter() { - var node = createNodeWithJSDoc(147 /* Parameter */); + var node = createNodeWithJSDoc(148 /* Parameter */); if (token() === 99 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -15141,7 +15513,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157 /* ConstructSignature */) { + if (kind === 158 /* ConstructSignature */) { parseExpected(94 /* NewKeyword */); } fillSignature(56 /* ColonToken */, 4 /* Type */, node); @@ -15202,7 +15574,7 @@ var ts; return token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 22 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 158 /* IndexSignature */; + node.kind = 159 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -15212,13 +15584,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55 /* QuestionToken */); if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - node.kind = 151 /* MethodSignature */; + node.kind = 152 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(56 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 149 /* PropertySignature */; + node.kind = 150 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 58 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -15264,10 +15636,10 @@ var ts; } function parseTypeMember() { if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - return parseSignatureMember(156 /* CallSignature */); + return parseSignatureMember(157 /* CallSignature */); } if (token() === 94 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157 /* ConstructSignature */); + return parseSignatureMember(158 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -15281,7 +15653,7 @@ var ts; return token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(164 /* TypeLiteral */); + var node = createNode(165 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -15298,38 +15670,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131 /* ReadonlyKeyword */) { + if (token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + return nextToken() === 132 /* ReadonlyKeyword */; + } + if (token() === 132 /* ReadonlyKeyword */) { nextToken(); } return token() === 21 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 92 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(92 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173 /* MappedType */); + var node = createNode(176 /* MappedType */); parseExpected(17 /* OpenBraceToken */); - node.readonlyToken = parseOptionalToken(131 /* ReadonlyKeyword */); + if (token() === 132 /* ReadonlyKeyword */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + parseExpectedToken(132 /* ReadonlyKeyword */); + } + } parseExpected(21 /* OpenBracketToken */); node.typeParameter = parseMappedTypeParameter(); parseExpected(22 /* CloseBracketToken */); - node.questionToken = parseOptionalToken(55 /* QuestionToken */); + if (token() === 55 /* QuestionToken */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + parseExpectedToken(55 /* QuestionToken */); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseTupleType() { - var node = createNode(166 /* TupleType */); + var node = createNode(167 /* TupleType */); node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169 /* ParenthesizedType */); + var node = createNode(172 /* ParenthesizedType */); parseExpected(19 /* OpenParenToken */); node.type = parseType(); parseExpected(20 /* CloseParenToken */); @@ -15337,7 +15722,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162 /* ConstructorType */) { + if (kind === 163 /* ConstructorType */) { parseExpected(94 /* NewKeyword */); } fillSignature(36 /* EqualsGreaterThanToken */, 4 /* Type */, node); @@ -15348,10 +15733,10 @@ var ts; return token() === 23 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174 /* LiteralType */); + var node = createNode(177 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(196 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 38 /* MinusToken */; nextToken(); } @@ -15372,13 +15757,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 137 /* SymbolKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 138 /* SymbolKeyword */: case 122 /* BooleanKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39 /* AsteriskToken */: @@ -15388,7 +15773,7 @@ var ts; case 89 /* FunctionKeyword */: return parseJSDocFunctionType(); case 51 /* ExclamationToken */: - return parseJSDocNodeWithType(275 /* JSDocNonNullableType */); + return parseJSDocNodeWithType(278 /* JSDocNonNullableType */); case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -15402,7 +15787,7 @@ var ts; return parseTokenNode(); case 99 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -15424,17 +15809,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 140 /* UniqueKeyword */: + case 138 /* SymbolKeyword */: + case 141 /* UniqueKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 103 /* TypeOfKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: case 17 /* OpenBraceToken */: case 21 /* OpenBracketToken */: case 27 /* LessThanToken */: @@ -15445,11 +15830,12 @@ var ts; case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: case 39 /* AsteriskToken */: case 55 /* QuestionToken */: case 51 /* ExclamationToken */: case 24 /* DotDotDotToken */: + case 126 /* InferKeyword */: return true; case 38 /* MinusToken */: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -15474,25 +15860,29 @@ var ts; if (!(contextFlags & 1048576 /* JSDoc */)) { return type; } - type = createJSDocPostfixType(276 /* JSDocOptionalType */, type); + type = createJSDocPostfixType(279 /* JSDocOptionalType */, type); break; case 51 /* ExclamationToken */: - type = createJSDocPostfixType(275 /* JSDocNonNullableType */, type); + type = createJSDocPostfixType(278 /* JSDocNonNullableType */, type); break; case 55 /* QuestionToken */: - type = createJSDocPostfixType(274 /* JSDocNullableType */, type); + // If not in JSDoc and next token is start of a type we have a conditional type + if (!(contextFlags & 1048576 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277 /* JSDocNullableType */, type); break; case 21 /* OpenBracketToken */: parseExpected(21 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(172 /* IndexedAccessType */, type.pos); + var node = createNode(175 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(165 /* ArrayType */, type.pos); + var node = createNode(166 /* ArrayType */, type.pos); node.elementType = type; parseExpected(22 /* CloseBracketToken */); type = finishNode(node); @@ -15511,20 +15901,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171 /* TypeOperator */); + var node = createNode(174 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171 /* InferType */); + parseExpected(126 /* InferKeyword */); + var typeParameter = createNode(147 /* TypeParameter */); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127 /* KeyOfKeyword */: - case 140 /* UniqueKeyword */: + case 128 /* KeyOfKeyword */: + case 141 /* UniqueKeyword */: return parseTypeOperator(operator); + case 126 /* InferKeyword */: + return parseInferType(); case 24 /* DotDotDotToken */: { - var result = createNode(278 /* JSDocVariadicType */); + var result = createNode(281 /* JSDocVariadicType */); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -15547,10 +15947,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); + return parseUnionOrIntersectionType(169 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); + return parseUnionOrIntersectionType(168 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); } function isStartOfFunctionType() { if (token() === 27 /* LessThanToken */) { @@ -15607,7 +16007,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(160 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -15618,7 +16018,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -15628,14 +16028,26 @@ var ts; // apply to 'type' contexts. So we disable these parameters here before moving on. return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161 /* FunctionType */); + return parseFunctionOrConstructorType(162 /* FunctionType */); } if (token() === 94 /* NewKeyword */) { - return parseFunctionOrConstructorType(162 /* ConstructorType */); + return parseFunctionOrConstructorType(163 /* ConstructorType */); } - return parseUnionTypeOrHigher(); + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85 /* ExtendsKeyword */)) { + var node = createNode(170 /* ConditionalType */, type.pos); + node.checkType = type; + // The type following 'extends' is not permitted to be another conditional type + node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); + parseExpected(55 /* QuestionToken */); + node.trueType = parseTypeWorker(); + parseExpected(56 /* ColonToken */); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56 /* ColonToken */) ? parseType() : undefined; @@ -15754,7 +16166,7 @@ var ts; // And production (2) is parsed in "tryParseParenthesizedArrowFunctionExpression". // // If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is - // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done + // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression(); if (arrowExpression) { @@ -15781,7 +16193,7 @@ var ts; // we're in '2' or '3'. Consume the assignment and return. // // Note: we call reScanGreaterToken so that we get an appropriately merged token - // for cases like > > = becoming >>= + // for cases like `> > =` becoming `>>=` if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } @@ -15818,7 +16230,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198 /* YieldExpression */); + var node = createNode(201 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -15840,17 +16252,17 @@ var ts; ts.Debug.assert(token() === 36 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188 /* ArrowFunction */, asyncModifier.pos); + node = createNode(191 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188 /* ArrowFunction */, identifier.pos); + node = createNode(191 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(147 /* Parameter */, identifier.pos); + var parameter = createNode(148 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -15875,7 +16287,7 @@ var ts; // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); arrowFunction.body = (lastToken === 36 /* EqualsGreaterThanToken */ || lastToken === 17 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -15912,7 +16324,7 @@ var ts; var second = nextToken(); if (first === 19 /* OpenParenToken */) { if (second === 20 /* CloseParenToken */) { - // Simple cases: "() =>", "(): ", and "() {". + // Simple cases: "() =>", "(): ", and "() {". // This is an arrow function with no parameters. // The last one is not actually an arrow function, // but this is probably what the user intended. @@ -16042,7 +16454,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188 /* ArrowFunction */); + var node = createNodeWithJSDoc(191 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -16108,12 +16520,14 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(196 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(199 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); - node.whenFalse = parseAssignmentExpressionOrHigher(); + node.colonToken = parseExpectedToken(56 /* ColonToken */); + node.whenFalse = ts.nodeIsPresent(node.colonToken) + ? parseAssignmentExpressionOrHigher() + : createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); return finishNode(node); } function parseBinaryExpressionOrHigher(precedence) { @@ -16121,7 +16535,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 /* InKeyword */ || t === 143 /* OfKeyword */; + return t === 92 /* InKeyword */ || t === 144 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16229,39 +16643,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195 /* BinaryExpression */, left.pos); + var node = createNode(198 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203 /* AsExpression */, left.pos); + var node = createNode(206 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189 /* DeleteExpression */); + var node = createNode(192 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190 /* TypeOfExpression */); + var node = createNode(193 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191 /* VoidExpression */); + var node = createNode(194 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16277,7 +16691,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192 /* AwaitExpression */); + var node = createNode(195 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16320,7 +16734,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 188 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -16417,7 +16831,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -16430,7 +16844,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(197 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -16475,7 +16889,8 @@ var ts; // We don't want to eagerly consume all import keyword as import call expression so we look a head to find "(" // For example: // var foo3 = require("subfolder - // import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression + // import * as foo1 from "module-from-node + // We want this import to be a statement rather than import call expression sourceFile.flags |= 524288 /* PossiblyContainsDynamicImport */; expression = parseTokenNode(); } @@ -16523,7 +16938,7 @@ var ts; // treated as the invocation of "new Foo". We disambiguate that in code (to match // the original grammar) by making sure that if we see an ObjectCreationExpression // we always consume arguments if they are there. So we treat "new Foo()" as an - // object creation only, and not at all as an invocation) Another way to think + // object creation only, and not at all as an invocation. Another way to think // about this is that for every "new" that we see, we will consume an argument list if // it is there as part of the *associated* object creation node. Any additional // argument lists we see, will become invocation expressions. @@ -16544,9 +16959,9 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(180 /* PropertyAccessExpression */, expression.pos); + var node = createNode(183 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - parseExpectedToken(23 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } @@ -16569,8 +16984,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252 /* JsxOpeningElement */) { - var node = createNode(250 /* JsxElement */, opening.pos); + if (opening.kind === 255 /* JsxOpeningElement */) { + var node = createNode(253 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -16579,15 +16994,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255 /* JsxOpeningFragment */) { - var node = createNode(254 /* JsxFragment */, opening.pos); + else if (opening.kind === 258 /* JsxOpeningFragment */) { + var node = createNode(257 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 254 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -16602,7 +17017,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195 /* BinaryExpression */, result.pos); + var badNode = createNode(198 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -16666,7 +17081,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258 /* JsxAttributes */); + var jsxAttributes = createNode(261 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -16675,7 +17090,7 @@ var ts; parseExpected(27 /* LessThanToken */); if (token() === 29 /* GreaterThanToken */) { parseExpected(29 /* GreaterThanToken */); - var node_1 = createNode(255 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(258 /* JsxOpeningFragment */, fullStart); return finishNode(node_1); } var tagName = parseJsxElementName(); @@ -16685,7 +17100,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(252 /* JsxOpeningElement */, fullStart); + node = createNode(255 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -16697,7 +17112,7 @@ var ts; parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(251 /* JsxSelfClosingElement */, fullStart); + node = createNode(254 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -16713,7 +17128,7 @@ var ts; var expression = token() === 99 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23 /* DotToken */)) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16721,7 +17136,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260 /* JsxExpression */); + var node = createNode(263 /* JsxExpression */); parseExpected(17 /* OpenBraceToken */); if (token() !== 18 /* CloseBraceToken */) { node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); @@ -16741,7 +17156,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257 /* JsxAttribute */); + var node = createNode(260 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 58 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -16756,7 +17171,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259 /* JsxSpreadAttribute */); + var node = createNode(262 /* JsxSpreadAttribute */); parseExpected(17 /* OpenBraceToken */); parseExpected(24 /* DotDotDotToken */); node.expression = parseExpression(); @@ -16764,7 +17179,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253 /* JsxClosingElement */); + var node = createNode(256 /* JsxClosingElement */); parseExpected(28 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -16777,7 +17192,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256 /* JsxClosingFragment */); + var node = createNode(259 /* JsxClosingFragment */); parseExpected(28 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -16793,7 +17208,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185 /* TypeAssertionExpression */); + var node = createNode(188 /* TypeAssertionExpression */); parseExpected(27 /* LessThanToken */); node.type = parseType(); parseExpected(29 /* GreaterThanToken */); @@ -16804,7 +17219,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16812,14 +17227,14 @@ var ts; } if (token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(207 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(21 /* OpenBracketToken */)) { - var indexedAccess = createNode(181 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(184 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -16835,7 +17250,7 @@ var ts; continue; } if (token() === 13 /* NoSubstitutionTemplateLiteral */ || token() === 14 /* TemplateHead */) { - var tagExpression = createNode(184 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(187 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -16858,7 +17273,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -16866,7 +17281,7 @@ var ts; continue; } else if (token() === 19 /* OpenParenToken */) { - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -16887,7 +17302,7 @@ var ts; } var typeArguments = parseDelimitedList(19 /* TypeArguments */, parseType); if (!parseExpected(29 /* GreaterThanToken */)) { - // If it doesn't have the closing > then it's definitely not an type argument list. + // If it doesn't have the closing `>` then it's definitely not an type argument list. return undefined; } // If we have a '<', then only parse this as a argument list if the type arguments @@ -16976,28 +17391,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(189 /* ParenthesizedExpression */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199 /* SpreadElement */); + var node = createNode(202 /* SpreadElement */); parseExpected(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 26 /* CommaToken */ ? createNode(201 /* OmittedExpression */) : + token() === 26 /* CommaToken */ ? createNode(204 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178 /* ArrayLiteralExpression */); + var node = createNode(181 /* ArrayLiteralExpression */); parseExpected(21 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17009,17 +17424,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(24 /* DotDotDotToken */)) { - node.kind = 267 /* SpreadAssignment */; + node.kind = 270 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } var asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -17036,7 +17451,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 /* CommaToken */ || token() === 18 /* CloseBraceToken */ || token() === 58 /* EqualsToken */); if (isShorthandPropertyAssignment) { - node.kind = 266 /* ShorthandPropertyAssignment */; + node.kind = 269 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(58 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -17044,14 +17459,14 @@ var ts; } } else { - node.kind = 265 /* PropertyAssignment */; + node.kind = 268 /* PropertyAssignment */; parseExpected(56 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179 /* ObjectLiteralExpression */); + var node = createNode(182 /* ObjectLiteralExpression */); parseExpected(17 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17070,7 +17485,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(187 /* FunctionExpression */); + var node = createNodeWithJSDoc(190 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); @@ -17095,12 +17510,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94 /* NewKeyword */); if (parseOptional(23 /* DotToken */)) { - var node_2 = createNode(205 /* MetaProperty */, fullStart); + var node_2 = createNode(208 /* MetaProperty */, fullStart); node_2.keywordToken = 94 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183 /* NewExpression */, fullStart); + var node = createNode(186 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19 /* OpenParenToken */) { @@ -17110,7 +17525,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208 /* Block */); + var node = createNode(211 /* Block */); if (parseExpected(17 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17143,12 +17558,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210 /* EmptyStatement */); + var node = createNode(213 /* EmptyStatement */); parseExpected(25 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(212 /* IfStatement */); + var node = createNode(215 /* IfStatement */); parseExpected(90 /* IfKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17158,7 +17573,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213 /* DoStatement */); + var node = createNode(216 /* DoStatement */); parseExpected(81 /* DoKeyword */); node.statement = parseStatement(); parseExpected(106 /* WhileKeyword */); @@ -17173,7 +17588,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214 /* WhileStatement */); + var node = createNode(217 /* WhileStatement */); parseExpected(106 /* WhileKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17196,8 +17611,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143 /* OfKeyword */) : parseOptional(143 /* OfKeyword */)) { - var forOfStatement = createNode(217 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(144 /* OfKeyword */) : parseOptional(144 /* OfKeyword */)) { + var forOfStatement = createNode(220 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -17205,14 +17620,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92 /* InKeyword */)) { - var forInStatement = createNode(216 /* ForInStatement */, pos); + var forInStatement = createNode(219 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215 /* ForStatement */, pos); + var forStatement = createNode(218 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(25 /* SemicolonToken */); if (token() !== 25 /* SemicolonToken */ && token() !== 20 /* CloseParenToken */) { @@ -17230,7 +17645,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); + parseExpected(kind === 222 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17238,7 +17653,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220 /* ReturnStatement */); + var node = createNode(223 /* ReturnStatement */); parseExpected(96 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -17247,7 +17662,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221 /* WithStatement */); + var node = createNode(224 /* WithStatement */); parseExpected(107 /* WithKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17256,7 +17671,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261 /* CaseClause */); + var node = createNode(264 /* CaseClause */); parseExpected(73 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(56 /* ColonToken */); @@ -17264,7 +17679,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262 /* DefaultClause */); + var node = createNode(265 /* DefaultClause */); parseExpected(79 /* DefaultKeyword */); parseExpected(56 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -17274,12 +17689,12 @@ var ts; return token() === 73 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222 /* SwitchStatement */); + var node = createNode(225 /* SwitchStatement */); parseExpected(98 /* SwitchKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); - var caseBlock = createNode(236 /* CaseBlock */); + var caseBlock = createNode(239 /* CaseBlock */); parseExpected(17 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(18 /* CloseBraceToken */); @@ -17294,7 +17709,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(224 /* ThrowStatement */); + var node = createNode(227 /* ThrowStatement */); parseExpected(100 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -17302,7 +17717,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(225 /* TryStatement */); + var node = createNode(228 /* TryStatement */); parseExpected(102 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -17315,7 +17730,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264 /* CatchClause */); + var result = createNode(267 /* CatchClause */); parseExpected(74 /* CatchKeyword */); if (parseOptional(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -17329,7 +17744,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226 /* DebuggerStatement */); + var node = createNode(229 /* DebuggerStatement */); parseExpected(78 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -17341,12 +17756,12 @@ var ts; var node = createNodeWithJSDoc(0 /* Unknown */); var expression = allowInAnd(parseExpression); if (expression.kind === 71 /* Identifier */ && parseOptional(56 /* ColonToken */)) { - node.kind = 223 /* LabeledStatement */; + node.kind = 226 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211 /* ExpressionStatement */; + node.kind = 214 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -17400,10 +17815,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117 /* AbstractKeyword */: case 120 /* AsyncKeyword */: @@ -17411,14 +17826,14 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 114 /* PublicKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142 /* GlobalKeyword */: + case 143 /* GlobalKeyword */: nextToken(); return token() === 17 /* OpenBraceToken */ || token() === 71 /* Identifier */ || token() === 84 /* ExportKeyword */; case 91 /* ImportKeyword */: @@ -17479,17 +17894,17 @@ var ts; case 120 /* AsyncKeyword */: case 124 /* DeclareKeyword */: case 109 /* InterfaceKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: - case 138 /* TypeKeyword */: - case 142 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 143 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -17513,16 +17928,16 @@ var ts; case 17 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 104 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); case 110 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); } break; case 89 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(229 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(232 /* FunctionDeclaration */)); case 75 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(230 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(233 /* ClassDeclaration */)); case 90 /* IfKeyword */: return parseIfStatement(); case 81 /* DoKeyword */: @@ -17532,9 +17947,9 @@ var ts; case 88 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 77 /* ContinueKeyword */: - return parseBreakOrContinueStatement(218 /* ContinueStatement */); + return parseBreakOrContinueStatement(221 /* ContinueStatement */); case 72 /* BreakKeyword */: - return parseBreakOrContinueStatement(219 /* BreakStatement */); + return parseBreakOrContinueStatement(222 /* BreakStatement */); case 96 /* ReturnKeyword */: return parseReturnStatement(); case 107 /* WithKeyword */: @@ -17554,9 +17969,9 @@ var ts; return parseDeclaration(); case 120 /* AsyncKeyword */: case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: case 83 /* EnumKeyword */: @@ -17567,8 +17982,8 @@ var ts; case 114 /* PublicKeyword */: case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: - case 142 /* GlobalKeyword */: + case 132 /* ReadonlyKeyword */: + case 143 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -17606,13 +18021,13 @@ var ts; return parseClassDeclaration(node); case 109 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 83 /* EnumKeyword */: return parseEnumDeclaration(node); - case 142 /* GlobalKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 143 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 91 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -17631,7 +18046,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(248 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -17653,16 +18068,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 26 /* CommaToken */) { - return createNode(201 /* OmittedExpression */); + return createNode(204 /* OmittedExpression */); } - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -17678,14 +18093,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175 /* ObjectBindingPattern */); + var node = createNode(178 /* ObjectBindingPattern */); parseExpected(17 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176 /* ArrayBindingPattern */); + var node = createNode(179 /* ArrayBindingPattern */); parseExpected(21 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(22 /* CloseBracketToken */); @@ -17707,7 +18122,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227 /* VariableDeclaration */); + var node = createNode(230 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 /* Identifier */ && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -17720,7 +18135,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228 /* VariableDeclarationList */); + var node = createNode(231 /* VariableDeclarationList */); switch (token()) { case 104 /* VarKeyword */: break; @@ -17743,7 +18158,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 143 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -17758,13 +18173,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 209 /* VariableStatement */; + node.kind = 212 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229 /* FunctionDeclaration */; + node.kind = 232 /* FunctionDeclaration */; parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); node.name = ts.hasModifier(node, 512 /* Default */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -17775,14 +18190,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153 /* Constructor */; + node.kind = 154 /* Constructor */; parseExpected(123 /* ConstructorKeyword */); fillSignature(56 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152 /* MethodDeclaration */; + node.kind = 153 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; @@ -17791,7 +18206,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150 /* PropertyDeclaration */; + node.kind = 151 /* PropertyDeclaration */; if (!node.questionToken && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -17801,8 +18216,8 @@ var ts; // off. The grammar would look something like this: // // MemberVariableDeclaration[Yield]: - // AccessibilityModifier_opt PropertyName TypeAnnotation_opt Initializer_opt[In]; - // AccessibilityModifier_opt static_opt PropertyName TypeAnnotation_opt Initializer_opt[In, ?Yield]; + // AccessibilityModifier_opt PropertyName TypeAnnotation_opt Initializer_opt[In]; + // AccessibilityModifier_opt static_opt PropertyName TypeAnnotation_opt Initializer_opt[In, ?Yield]; // // The checker may still error in the static case to explicitly disallow the yield expression. node.initializer = ts.hasModifier(node, 32 /* Static */) @@ -17835,7 +18250,7 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; default: return false; @@ -17876,7 +18291,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 135 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 136 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -17884,6 +18299,7 @@ var ts; switch (token()) { case 19 /* OpenParenToken */: // Method declaration case 27 /* LessThanToken */: // Generic Method declaration + case 51 /* ExclamationToken */: // Non-null assertion on property name case 56 /* ColonToken */: // Type Annotation for declaration case 58 /* EqualsToken */: // Initializer for declaration case 55 /* QuestionToken */:// Not valid, but permitted so that it gets caught later on. @@ -17907,7 +18323,7 @@ var ts; if (!parseOptional(57 /* AtToken */)) { break; } - var decorator = createNode(148 /* Decorator */, decoratorStart); + var decorator = createNode(149 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -17957,7 +18373,7 @@ var ts; } function parseClassElement() { if (token() === 25 /* SemicolonToken */) { - var result = createNode(207 /* SemicolonClassElement */); + var result = createNode(210 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -17965,10 +18381,10 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } if (token() === 123 /* ConstructorKeyword */) { return parseConstructorDeclaration(node); @@ -17994,10 +18410,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 200 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 203 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 233 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -18040,7 +18456,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 /* ExtendsKeyword */ || tok === 108 /* ImplementsKeyword */) { - var node = createNode(263 /* HeritageClause */); + var node = createNode(266 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -18049,7 +18465,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -18066,7 +18482,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231 /* InterfaceDeclaration */; + node.kind = 234 /* InterfaceDeclaration */; parseExpected(109 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -18075,8 +18491,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232 /* TypeAliasDeclaration */; - parseExpected(138 /* TypeKeyword */); + node.kind = 235 /* TypeAliasDeclaration */; + parseExpected(139 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58 /* EqualsToken */); @@ -18089,13 +18505,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(268 /* EnumMember */); + var node = createNodeWithJSDoc(271 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233 /* EnumDeclaration */; + node.kind = 236 /* EnumDeclaration */; parseExpected(83 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(17 /* OpenBraceToken */)) { @@ -18108,7 +18524,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235 /* ModuleBlock */); + var node = createNode(238 /* ModuleBlock */); if (parseExpected(17 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(18 /* CloseBraceToken */); @@ -18119,7 +18535,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234 /* ModuleDeclaration */; + node.kind = 237 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -18131,8 +18547,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234 /* ModuleDeclaration */; - if (token() === 142 /* GlobalKeyword */) { + node.kind = 237 /* ModuleDeclaration */; + if (token() === 143 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18151,15 +18567,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142 /* GlobalKeyword */) { + if (token() === 143 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129 /* NamespaceKeyword */)) { + else if (parseOptional(130 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(128 /* ModuleKeyword */); + parseExpected(129 /* ModuleKeyword */); if (token() === 9 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -18167,7 +18583,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 /* RequireKeyword */ && + return token() === 133 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -18177,9 +18593,9 @@ var ts; return nextToken() === 41 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 237 /* NamespaceExportDeclaration */; + node.kind = 240 /* NamespaceExportDeclaration */; parseExpected(118 /* AsKeyword */); - parseExpected(129 /* NamespaceKeyword */); + parseExpected(130 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -18190,12 +18606,12 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 /* CommaToken */ && token() !== 141 /* FromKeyword */) { + if (token() !== 26 /* CommaToken */ && token() !== 142 /* FromKeyword */) { return parseImportEqualsDeclaration(node, identifier); } } // Import statement - node.kind = 239 /* ImportDeclaration */; + node.kind = 242 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -18203,14 +18619,14 @@ var ts; token() === 39 /* AsteriskToken */ || // import * token() === 17 /* OpenBraceToken */) { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238 /* ImportEqualsDeclaration */; + node.kind = 241 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(58 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -18224,7 +18640,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(240 /* ImportClause */, fullStart); + var importClause = createNode(243 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18234,7 +18650,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(26 /* CommaToken */)) { - importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(242 /* NamedImports */); + importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(245 /* NamedImports */); } return finishNode(importClause); } @@ -18244,8 +18660,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(249 /* ExternalModuleReference */); - parseExpected(132 /* RequireKeyword */); + var node = createNode(252 /* ExternalModuleReference */); + parseExpected(133 /* RequireKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(20 /* CloseParenToken */); @@ -18267,7 +18683,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(241 /* NamespaceImport */); + var namespaceImport = createNode(244 /* NamespaceImport */); parseExpected(39 /* AsteriskToken */); parseExpected(118 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -18282,14 +18698,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 242 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 245 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247 /* ExportSpecifier */); + return parseImportOrExportSpecifier(250 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243 /* ImportSpecifier */); + return parseImportOrExportSpecifier(246 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18314,25 +18730,25 @@ var ts; else { node.name = identifierName; } - if (kind === 243 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 246 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245 /* ExportDeclaration */; + node.kind = 248 /* ExportDeclaration */; if (parseOptional(39 /* AsteriskToken */)) { - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(249 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 141 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(141 /* FromKeyword */); + if (token() === 142 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18340,7 +18756,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244 /* ExportAssignment */; + node.kind = 247 /* ExportAssignment */; if (parseOptional(58 /* EqualsToken */)) { node.isExportEquals = true; } @@ -18435,10 +18851,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1 /* Export */) - || node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */ - || node.kind === 239 /* ImportDeclaration */ - || node.kind === 244 /* ExportAssignment */ - || node.kind === 245 /* ExportDeclaration */ + || node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */ + || node.kind === 242 /* ImportDeclaration */ + || node.kind === 247 /* ExportAssignment */ + || node.kind === 248 /* ExportDeclaration */ ? node : undefined; }); @@ -18491,7 +18907,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(271 /* JSDocTypeExpression */, scanner.getTokenPos()); + var result = createNode(274 /* JSDocTypeExpression */, scanner.getTokenPos()); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17 /* OpenBraceToken */); result.type = doInsideOfContext(1048576 /* JSDoc */, parseType); if (!mayOmitBraces || hasBrace) { @@ -18563,7 +18979,6 @@ var ts; scanner.scanRange(start + 3, length - 5, function () { // Initially we can parse out a tag. We also have seen a starting asterisk. // This is so that /** * @type */ doesn't parse. - var advanceToken = true; var state = 1 /* SawAsterisk */; var margin = undefined; // + 4 for leading '/** ' @@ -18575,17 +18990,17 @@ var ts; comments.push(text); indent += text.length; } - nextJSDocToken(); - while (token() === 5 /* WhitespaceTrivia */) { - nextJSDocToken(); + var t = nextJSDocToken(); + while (t === 5 /* WhitespaceTrivia */) { + t = nextJSDocToken(); } - if (token() === 4 /* NewLineTrivia */) { + if (t === 4 /* NewLineTrivia */) { state = 0 /* BeginningOfLine */; indent = 0; - nextJSDocToken(); + t = nextJSDocToken(); } - while (token() !== 1 /* EndOfFileToken */) { - switch (token()) { + loop: while (true) { + switch (t) { case 57 /* AtToken */: if (state === 0 /* BeginningOfLine */ || state === 1 /* SawAsterisk */) { removeTrailingNewlines(comments); @@ -18594,7 +19009,6 @@ var ts; // Real-world comments may break this rule, so "BeginningOfLine" will not be a real line beginning // for malformed examples like `/** @param {string} x @returns {number} the length */` state = 0 /* BeginningOfLine */; - advanceToken = false; margin = undefined; indent++; } @@ -18639,19 +19053,14 @@ var ts; indent += whitespace.length; break; case 1 /* EndOfFileToken */: - break; + break loop; default: // anything other than whitespace or asterisk at the beginning of the line starts the comment text state = 2 /* SavingComments */; pushComment(scanner.getTokenText()); break; } - if (advanceToken) { - nextJSDocToken(); - } - else { - advanceToken = true; - } + t = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); @@ -18675,7 +19084,7 @@ var ts; content.charCodeAt(start + 3) !== 42 /* asterisk */; } function createJSDocComment() { - var result = createNode(279 /* JSDocComment */, start); + var result = createNode(282 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -18736,7 +19145,8 @@ var ts; // a badly malformed tag should not be added to the list of tags return; } - addTag(tag, parseTagComments(indent + tag.end - tag.pos)); + tag.comment = parseTagComments(indent + tag.end - tag.pos); + addTag(tag); } function parseTagComments(indent) { var comments = []; @@ -18749,8 +19159,9 @@ var ts; comments.push(text); indent += text.length; } - while (token() !== 57 /* AtToken */ && token() !== 1 /* EndOfFileToken */) { - switch (token()) { + var tok = token(); + loop: while (true) { + switch (tok) { case 4 /* NewLineTrivia */: if (state >= 1 /* SawAsterisk */) { state = 0 /* BeginningOfLine */; @@ -18759,8 +19170,11 @@ var ts; indent = 0; break; case 57 /* AtToken */: + scanner.setTextPos(scanner.getTextPos() - 1); + // falls through + case 1 /* EndOfFileToken */: // Done - break; + break loop; case 5 /* WhitespaceTrivia */: if (state === 2 /* SavingComments */) { pushComment(scanner.getTokenText()); @@ -18778,7 +19192,7 @@ var ts; if (state === 0 /* BeginningOfLine */) { // leading asterisks start recording on the *next* (non-whitespace) token state = 1 /* SawAsterisk */; - indent += scanner.getTokenText().length; + indent += 1; break; } // record the * as a comment @@ -18788,24 +19202,19 @@ var ts; pushComment(scanner.getTokenText()); break; } - if (token() === 57 /* AtToken */) { - // Done - break; - } - nextJSDocToken(); + tok = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); - return comments; + return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(atToken, tagName) { - var result = createNode(281 /* JSDocTag */, atToken.pos); + var result = createNode(284 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); } - function addTag(tag, comments) { - tag.comment = comments.join(""); + function addTag(tag) { if (!tags) { tags = [tag]; tagsPos = tag.pos; @@ -18835,9 +19244,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object"; @@ -18853,8 +19262,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Parameter */ ? - createNode(284 /* JSDocParameterTag */, atToken.pos) : - createNode(289 /* JSDocPropertyTag */, atToken.pos); + createNode(287 /* JSDocParameterTag */, atToken.pos) : + createNode(292 /* JSDocPropertyTag */, atToken.pos); var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name); if (nestedTypeLiteral) { typeExpression = nestedTypeLiteral; @@ -18870,21 +19279,18 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(271 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(274 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_2 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(1 /* Parameter */, name); })) { - if (!children) { - children = []; - } - children.push(child); + children = ts.append(children, child); } if (children) { - jsdocTypeLiteral = createNode(280 /* JSDocTypeLiteral */, start_2); + jsdocTypeLiteral = createNode(283 /* JSDocTypeLiteral */, start_2); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 165 /* ArrayType */) { + if (typeExpression.type.kind === 166 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -18893,27 +19299,27 @@ var ts; } } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 285 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(285 /* JSDocReturnTag */, atToken.pos); + var result = createNode(288 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 286 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 289 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(286 /* JSDocTypeTag */, atToken.pos); + var result = createNode(289 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAugmentsTag(atToken, tagName) { - var result = createNode(282 /* JSDocAugmentsTag */, atToken.pos); + var result = createNode(285 /* JSDocAugmentsTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); @@ -18921,7 +19327,7 @@ var ts; } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(17 /* OpenBraceToken */); - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -18933,7 +19339,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(/*createIfMissing*/ true); while (parseOptional(23 /* DotToken */)) { - var prop = createNode(180 /* PropertyAccessExpression */, node.pos); + var prop = createNode(183 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -18941,7 +19347,7 @@ var ts; return node; } function parseClassTag(atToken, tagName) { - var tag = createNode(283 /* JSDocClassTag */, atToken.pos); + var tag = createNode(286 /* JSDocClassTag */, atToken.pos); tag.atToken = atToken; tag.tagName = tagName; return finishNode(tag); @@ -18949,7 +19355,7 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(288 /* JSDocTypedefTag */, atToken.pos); + var typedefTag = createNode(291 /* JSDocTypedefTag */, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(/*flags*/ 0); @@ -18974,9 +19380,9 @@ var ts; var start_3 = scanner.getStartPos(); while (child = tryParse(function () { return parseChildParameterOrPropertyTag(0 /* Property */); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(280 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(283 /* JSDocTypeLiteral */, start_3); } - if (child.kind === 286 /* JSDocTypeTag */) { + if (child.kind === 289 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -18985,14 +19391,11 @@ var ts; } } else { - if (!jsdocTypeLiteral.jsDocPropertyTags) { - jsdocTypeLiteral.jsDocPropertyTags = []; - } - jsdocTypeLiteral.jsDocPropertyTags.push(child); + jsdocTypeLiteral.jsDocPropertyTags = ts.append(jsdocTypeLiteral.jsDocPropertyTags, child); } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 165 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 166 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -19005,7 +19408,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(23 /* DotToken */)) { - var jsDocNamespaceNode = createNode(234 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(237 /* ModuleDeclaration */, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4 /* NestedNamespace */); @@ -19033,12 +19436,11 @@ var ts; var canParseTag = true; var seenAsterisk = false; while (true) { - nextJSDocToken(); - switch (token()) { + switch (nextJSDocToken()) { case 57 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target); - if (child && child.kind === 284 /* JSDocParameterTag */ && + if (child && child.kind === 287 /* JSDocParameterTag */ && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } @@ -19074,34 +19476,44 @@ var ts; if (!tagName) { return false; } + var t; switch (tagName.escapedText) { case "type": return target === 0 /* Property */ && parseTypeTag(atToken, tagName); case "prop": case "property": - return target === 0 /* Property */ && parseParameterOrPropertyTag(atToken, tagName, target); + t = 0 /* Property */; + break; case "arg": case "argument": case "param": - return target === 1 /* Parameter */ && parseParameterOrPropertyTag(atToken, tagName, target); + t = 1 /* Parameter */; + break; + default: + return false; } - return false; + if (target !== t) { + return false; + } + var tag = parseParameterOrPropertyTag(atToken, tagName, target); + tag.comment = parseTagComments(tag.end - tag.pos); + return tag; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 287 /* JSDocTemplateTag */; })) { + if (ts.some(tags, ts.isJSDocTemplateTag)) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } // Type parameter list looks like '@template T,U,V' var typeParameters = []; var typeParametersPos = getNodePos(); while (true) { - var name = parseJSDocIdentifierName(); + var typeParameter = createNode(147 /* TypeParameter */); + var name = parseJSDocIdentifierNameWithOptionalBraces(); skipWhitespace(); if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(146 /* TypeParameter */, name.pos); typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); @@ -19113,13 +19525,21 @@ var ts; break; } } - var result = createNode(287 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(290 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); finishNode(result); return result; } + function parseJSDocIdentifierNameWithOptionalBraces() { + var parsedBrace = parseOptional(17 /* OpenBraceToken */); + var res = parseJSDocIdentifierName(); + if (parsedBrace) { + parseExpected(18 /* CloseBraceToken */); + } + return res; + } function nextJSDocToken() { return currentToken = scanner.scanJSDocToken(); } @@ -19298,7 +19718,7 @@ var ts; // We may need to update both the 'pos' and the 'end' of the element. // If the 'pos' is before the start of the change, then we don't need to touch it. // If it isn't, then the 'pos' must be inside the change. How we update it will - // depend if delta is positive or negative. If delta is positive then we have + // depend if delta is positive or negative. If delta is positive then we have // something like: // // -------------------AAA----------------- @@ -19322,7 +19742,7 @@ var ts; element.pos = Math.min(element.pos, changeRangeNewEnd); // If the 'end' is after the change range, then we always adjust it by the delta // amount. However, if the end is in the change range, then how we adjust it - // will depend on if delta is positive or negative. If delta is positive then we + // will depend on if delta is positive or negative. If delta is positive then we // have something like: // // -------------------AAA----------------- @@ -19660,24 +20080,24 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (ts.isConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. other uninstantiated module declarations. - case 235 /* ModuleBlock */: { + case 238 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -19699,7 +20119,7 @@ var ts; }); return state_1; } - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return getModuleInstanceState(node); case 71 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -19733,6 +20153,7 @@ var ts; ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals"; ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; + ContainerFlags[ContainerFlags["IsInferenceContainer"] = 256] = "IsInferenceContainer"; })(ContainerFlags || (ContainerFlags = {})); var binder = createBinder(); function bindSourceFile(file, options) { @@ -19749,6 +20170,7 @@ var ts; var parent; var container; var blockScopeContainer; + var inferenceContainer; var lastContainer; var seenThisKeyword; // state used by control flow analysis @@ -19804,6 +20226,7 @@ var ts; parent = undefined; container = undefined; blockScopeContainer = undefined; + inferenceContainer = undefined; lastContainer = undefined; seenThisKeyword = false; currentFlow = undefined; @@ -19849,7 +20272,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 234 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 237 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -19858,7 +20281,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -19867,7 +20290,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -19879,38 +20302,38 @@ var ts; return ts.getEscapedTextOfIdentifierOrLiteral(name); } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "__constructor" /* Constructor */; - case 161 /* FunctionType */: - case 156 /* CallSignature */: + case 162 /* FunctionType */: + case 157 /* CallSignature */: return "__call" /* Call */; - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: return "__new" /* New */; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "__index" /* Index */; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: return (ts.hasModifier(node, 512 /* Default */) ? "default" /* Default */ : undefined); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 147 /* Parameter */: + case 148 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 277 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 280 /* JSDocFunctionType */); var functionType = node.parent; - var index = ts.indexOf(functionType.parameters, node); + var index = functionType.parameters.indexOf(node); return "arg" + index; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: var name_2 = ts.getNameOfJSDocTypedef(node); return typeof name_2 !== "undefined" ? name_2.escapedText : undefined; } @@ -19987,6 +20410,9 @@ var ts; var message_1 = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) { + message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } if (symbol.declarations && symbol.declarations.length) { // If the current node is a default export of some sort, then check if // there are any other default exports that we need to error on. @@ -20000,7 +20426,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 244 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 247 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -20020,7 +20446,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 247 /* ExportSpecifier */ || (node.kind === 238 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 250 /* ExportSpecifier */ || (node.kind === 241 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -20042,12 +20468,9 @@ var ts; // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - if (node.kind === 288 /* JSDocTypedefTag */) + if (node.kind === 291 /* JSDocTypedefTag */) ts.Debug.assert(ts.isInJavaScriptFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - var isJSDocTypedefInJSDocNamespace = node.kind === 288 /* JSDocTypedefTag */ && - node.name && - node.name.kind === 71 /* Identifier */ && - node.name.isInJSDocNamespace; + var isJSDocTypedefInJSDocNamespace = ts.isJSDocTypedefTag(node) && node.name && node.name.kind === 71 /* Identifier */ && node.name.isInJSDocNamespace; if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 32 /* ExportContext */)) || isJSDocTypedefInJSDocNamespace) { var exportKind = symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0; var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); @@ -20115,7 +20538,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property intialization checks. - currentReturnTarget = isIIFE || node.kind === 153 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 154 /* Constructor */ ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -20128,13 +20551,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -20152,6 +20575,13 @@ var ts; bindChildren(node); node.flags = seenThisKeyword ? node.flags | 64 /* ContainsThis */ : node.flags & ~64 /* ContainsThis */; } + else if (containerFlags & 256 /* IsInferenceContainer */) { + var saveInferenceContainer = inferenceContainer; + inferenceContainer = node; + node.locals = undefined; + bindChildren(node); + inferenceContainer = saveInferenceContainer; + } else { bindChildren(node); } @@ -20221,70 +20651,70 @@ var ts; return; } switch (node.kind) { - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: bindWhileStatement(node); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: bindDoStatement(node); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: bindForStatement(node); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: bindIfStatement(node); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: bindTryStatement(node); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: bindSwitchStatement(node); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: bindCaseBlock(node); break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: bindCaseClause(node); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: bindLabeledStatement(node); break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: bindCallExpressionFlow(node); break; - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: bindJSDocComment(node); break; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: bindJSDocTypedefTag(node); break; default: @@ -20296,15 +20726,15 @@ var ts; switch (expr.kind) { case 71 /* Identifier */: case 99 /* ThisKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return hasNarrowableArgument(expr); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 51 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; @@ -20313,7 +20743,7 @@ var ts; return expr.kind === 71 /* Identifier */ || expr.kind === 99 /* ThisKeyword */ || expr.kind === 97 /* SuperKeyword */ || - expr.kind === 180 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + expr.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -20324,14 +20754,17 @@ var ts; } } } - if (expr.expression.kind === 180 /* PropertyAccessExpression */ && + if (expr.expression.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 190 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; + return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2); + } + function isNarrowableInOperands(left, right) { + return ts.isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -20345,6 +20778,8 @@ var ts; isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); case 93 /* InstanceOfKeyword */: return isNarrowableOperand(expr.left); + case 92 /* InKeyword */: + return isNarrowableInOperands(expr.left, expr.right); case 26 /* CommaToken */: return isNarrowingExpression(expr.right); } @@ -20352,9 +20787,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -20432,33 +20867,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: return parent.expression === node; - case 215 /* ForStatement */: - case 196 /* ConditionalExpression */: + case 218 /* ForStatement */: + case 199 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 186 /* ParenthesizedExpression */) { + if (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 193 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { + else if (node.kind === 196 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 195 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || + return node.kind === 198 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 54 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 186 /* ParenthesizedExpression */ || - node.parent.kind === 193 /* PrefixUnaryExpression */ && + while (node.parent.kind === 189 /* ParenthesizedExpression */ || + node.parent.kind === 196 /* PrefixUnaryExpression */ && node.parent.operator === 51 /* ExclamationToken */) { node = node.parent; } @@ -20500,7 +20935,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 223 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 226 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -20534,13 +20969,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 228 /* VariableDeclarationList */) { + if (node.initializer.kind !== 231 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -20562,7 +20997,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 220 /* ReturnStatement */) { + if (node.kind === 223 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -20582,7 +21017,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 219 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 222 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -20678,7 +21113,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 262 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 265 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -20745,14 +21180,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 213 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 216 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -20763,10 +21198,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 178 /* ArrayLiteralExpression */) { + else if (node.kind === 181 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 199 /* SpreadElement */) { + if (e.kind === 202 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -20774,16 +21209,16 @@ var ts; } } } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 265 /* PropertyAssignment */) { + if (p.kind === 268 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 266 /* ShorthandPropertyAssignment */) { + else if (p.kind === 269 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 267 /* SpreadAssignment */) { + else if (p.kind === 270 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -20839,7 +21274,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 58 /* EqualsToken */ && node.left.kind === 181 /* ElementAccessExpression */) { + if (operator === 58 /* EqualsToken */ && node.left.kind === 184 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -20850,7 +21285,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -20889,7 +21324,7 @@ var ts; } function bindJSDocComment(node) { ts.forEachChild(node, function (n) { - if (n.kind !== 288 /* JSDocTypedefTag */) { + if (n.kind !== 291 /* JSDocTypedefTag */) { bind(n); } }); @@ -20910,10 +21345,10 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = node.expression; - while (expr.kind === 186 /* ParenthesizedExpression */) { + while (expr.kind === 189 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 187 /* FunctionExpression */ || expr.kind === 188 /* ArrowFunction */) { + if (expr.kind === 190 /* FunctionExpression */ || expr.kind === 191 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -20921,7 +21356,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -20930,53 +21365,55 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 258 /* JsxAttributes */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 261 /* JsxAttributes */: return 1 /* IsContainer */; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 269 /* SourceFile */: + case 170 /* ConditionalType */: + return 256 /* IsInferenceContainer */; + case 272 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 277 /* JSDocFunctionType */: - case 161 /* FunctionType */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 162 /* ConstructorType */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 280 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 163 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 264 /* CatchClause */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 236 /* CaseBlock */: + case 267 /* CatchClause */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 239 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 208 /* Block */: + case 211 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -21009,42 +21446,42 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 179 /* ObjectLiteralExpression */: - case 231 /* InterfaceDeclaration */: - case 258 /* JsxAttributes */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 182 /* ObjectLiteralExpression */: + case 234 /* InterfaceDeclaration */: + case 261 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -21065,11 +21502,11 @@ var ts; : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 269 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 269 /* SourceFile */ || body.kind === 235 /* ModuleBlock */)) { + var body = node.kind === 272 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 272 /* SourceFile */ || body.kind === 238 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 245 /* ExportDeclaration */ || stat.kind === 244 /* ExportAssignment */) { + if (stat.kind === 248 /* ExportDeclaration */ || stat.kind === 247 /* ExportAssignment */) { return true; } } @@ -21136,7 +21573,7 @@ var ts; // to the one we would get for: { <...>(...): T } // // We do that by making an anonymous type literal symbol, and then setting the function - // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable // from an actual type literal symbol you would have gotten had you used the long form. var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); addDeclarationToSymbol(symbol, node, 131072 /* Signature */); @@ -21155,7 +21592,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { + if (prop.kind === 270 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { continue; } var identifier = prop.name; @@ -21167,7 +21604,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 265 /* PropertyAssignment */ || prop.kind === 266 /* ShorthandPropertyAssignment */ || prop.kind === 152 /* MethodDeclaration */ + var currentKind = prop.kind === 268 /* PropertyAssignment */ || prop.kind === 269 /* ShorthandPropertyAssignment */ || prop.kind === 153 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -21198,10 +21635,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -21311,8 +21748,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 269 /* SourceFile */ && - blockScopeContainer.kind !== 234 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 272 /* SourceFile */ && + blockScopeContainer.kind !== 237 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -21386,7 +21823,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 143 /* LastToken */) { + if (node.kind > 144 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -21414,7 +21851,7 @@ var ts; } for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { var tag = _c[_b]; - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { var savedParent = parent; parent = jsDoc; bind(tag); @@ -21453,7 +21890,7 @@ var ts; // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 288 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 291 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); @@ -21461,11 +21898,11 @@ var ts; } // falls through case 99 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 266 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 269 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -21473,7 +21910,7 @@ var ts; bindSpecialPropertyDeclaration(node); } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -21498,132 +21935,132 @@ var ts; ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return checkStrictModeCatchClause(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkStrictModeWithStatement(node); - case 170 /* ThisType */: + case 173 /* ThisType */: seenThisKeyword = true; return; - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 146 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 147 /* Parameter */: + case 147 /* TypeParameter */: + return bindTypeParameter(node); + case 148 /* Parameter */: return bindParameter(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return bindPropertyWorker(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 173 /* MappedType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 176 /* MappedType */: return bindAnonymousTypeWorker(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return bindFunctionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return bindJsxAttributes(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return bindImportClause(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return bindExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return bindExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 208 /* Block */: + case 211 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 284 /* JSDocParameterTag */: - if (node.parent.kind !== 280 /* JSDocTypeLiteral */) { + case 287 /* JSDocParameterTag */: + if (node.parent.kind !== 283 /* JSDocTypeLiteral */) { break; } // falls through - case 289 /* JSDocPropertyTag */: + case 292 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 276 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 279 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 288 /* JSDocTypedefTag */: { + case 291 /* JSDocTypedefTag */: { var fullName = node.fullName; if (!fullName || fullName.kind === 71 /* Identifier */) { return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); @@ -21643,7 +22080,7 @@ var ts; if (parameterName && parameterName.kind === 71 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 170 /* ThisType */) { + if (parameterName && parameterName.kind === 173 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -21663,7 +22100,7 @@ var ts; bindAnonymousDeclaration(node, 2097152 /* Alias */, getDeclarationName(node)); } else { - var flags = node.kind === 244 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 247 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) // An export default clause with an EntityNameExpression exports all meanings of that identifier ? 2097152 /* Alias */ // An export default clause with any other expression exports a value @@ -21677,7 +22114,7 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 269 /* SourceFile */) { + if (node.parent.kind !== 272 /* SourceFile */) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } @@ -21724,27 +22161,13 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); } - function isExportsOrModuleExportsOrAlias(node) { - return ts.isExportsIdentifier(node) || - ts.isModuleExportsPropertyAccessExpression(node) || - ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(node); - } - function isNameOfExportsOrModuleExportsAliasDeclaration(node) { - var symbol = lookupSymbolForName(node.escapedText); - return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && - symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer); - } - function isExportsOrModuleExportsOrAliasOrAssignment(node) { - return isExportsOrModuleExportsOrAlias(node) || - (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(node.left) || isExportsOrModuleExportsOrAliasOrAssignment(node.right))); - } function bindModuleExportsAssignment(node) { // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' // is still pointing to 'module.exports'. // We do not want to consider this as 'export=' since a module can have only one of these. // Similarly we do not want to treat 'module.exports = exports' as an 'export='. var assignedExpression = ts.getRightMostAssignedExpression(node.right); - if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { // Mark it as a module in case there are no other exports in the file setCommonJsModuleIndicator(node); return; @@ -21757,18 +22180,18 @@ var ts; ts.Debug.assert(ts.isInJavaScriptFile(node)); var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (container.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Declare a 'member' if the container is an ES5 class or ES6 constructor container.symbol.members = container.symbol.members || ts.createSymbolTable(); // It's acceptable for multiple 'this' assignments of the same identifier to occur declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); break; - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = container.parent; @@ -21782,8 +22205,8 @@ var ts; if (node.expression.kind === 99 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */) && - node.parent.parent.kind === 269 /* SourceFile */) { + else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */) && + node.parent.parent.kind === 272 /* SourceFile */) { bindStaticPropertyAssignment(node); } } @@ -21807,15 +22230,15 @@ var ts; function bindStaticPropertyAssignment(node) { // Look up the function in the local scope, since static assignments should // follow the function declaration - var leftSideOfAssignment = node.kind === 180 /* PropertyAccessExpression */ ? node : node.left; + var leftSideOfAssignment = node.kind === 183 /* PropertyAccessExpression */ ? node : node.left; var target = leftSideOfAssignment.expression; if (ts.isIdentifier(target)) { // Fix up parent pointers since we're going to use these nodes before we bind into them target.parent = leftSideOfAssignment; - if (node.kind === 195 /* BinaryExpression */) { + if (node.kind === 198 /* BinaryExpression */) { leftSideOfAssignment.parent = node; } - if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + if (container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, target)) { // This can be an alias for the 'exports' or 'module.exports' names, e.g. // var util = module.exports; // util.property = function ... @@ -21827,26 +22250,22 @@ var ts; } } function lookupSymbolForName(name) { - var local = container.locals && container.locals.get(name); - if (local) { - return local.exportSymbol || local; - } - return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + return lookupSymbolForNameWorker(container, name); } function bindPropertyAssignment(functionName, propertyAccess, isPrototypeProperty) { var symbol = lookupSymbolForName(functionName); var targetSymbol = symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol) ? symbol.valueDeclaration.initializer.symbol : symbol; - ts.Debug.assert(propertyAccess.parent.kind === 195 /* BinaryExpression */ || propertyAccess.parent.kind === 211 /* ExpressionStatement */); + ts.Debug.assert(propertyAccess.parent.kind === 198 /* BinaryExpression */ || propertyAccess.parent.kind === 214 /* ExpressionStatement */); var isLegalPosition; - if (propertyAccess.parent.kind === 195 /* BinaryExpression */) { + if (propertyAccess.parent.kind === 198 /* BinaryExpression */) { var initializerKind = propertyAccess.parent.right.kind; - isLegalPosition = (initializerKind === 200 /* ClassExpression */ || initializerKind === 187 /* FunctionExpression */) && - propertyAccess.parent.parent.parent.kind === 269 /* SourceFile */; + isLegalPosition = (initializerKind === 203 /* ClassExpression */ || initializerKind === 190 /* FunctionExpression */) && + propertyAccess.parent.parent.parent.kind === 272 /* SourceFile */; } else { - isLegalPosition = propertyAccess.parent.parent.kind === 269 /* SourceFile */; + isLegalPosition = propertyAccess.parent.parent.kind === 272 /* SourceFile */; } if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & 1920 /* Namespace */)) && isLegalPosition) { ts.Debug.assert(ts.isIdentifier(propertyAccess.expression)); @@ -21878,7 +22297,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -21947,7 +22366,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + ts.indexOf(node.parent.parameters, node)); + bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + node.parent.parameters.indexOf(node)); } else { declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); @@ -21998,6 +22417,22 @@ var ts; ? bindAnonymousDeclaration(node, symbolFlags, "__computed" /* Computed */) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + function bindTypeParameter(node) { + if (node.parent.kind === 171 /* InferType */) { + if (inferenceContainer) { + if (!inferenceContainer.locals) { + inferenceContainer.locals = ts.createSymbolTable(); + } + declareSymbol(inferenceContainer.locals, /*parent*/ undefined, node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); + } + else { + bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); + } + } + else { + declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); + } + } // reachability checks function shouldReportErrorOnModuleDeclaration(node) { var instanceState = getModuleInstanceState(node); @@ -22010,13 +22445,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 210 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 213 /* EmptyStatement */) || // report error on class declarations - node.kind === 230 /* ClassDeclaration */ || + node.kind === 233 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 234 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 237 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 233 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 236 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -22030,7 +22465,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !(node.flags & 2097152 /* Ambient */) && - (node.kind !== 209 /* VariableStatement */ || + (node.kind !== 212 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -22041,6 +22476,29 @@ var ts; return true; } } + /* @internal */ + function isExportsOrModuleExportsOrAlias(sourceFile, node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node); + } + ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; + function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) { + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); + return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && + symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer); + } + function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { + return isExportsOrModuleExportsOrAlias(sourceFile, node) || + (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); + } + function lookupSymbolForNameWorker(container, name) { + var local = container.locals && container.locals.get(name); + if (local) { + return local.exportSymbol || local; + } + return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + } /** * Computes the transform flags for a node, given the transform flags of its subtree * @@ -22050,57 +22508,59 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 147 /* Parameter */: + case 148 /* Parameter */: return computeParameter(node, subtreeFlags); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 153 /* Constructor */: + case 154 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); + case 184 /* ElementAccessExpression */: + return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); } @@ -22109,15 +22569,19 @@ var ts; function computeCallExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var expression = node.expression; - var expressionKind = expression.kind; if (node.typeArguments) { transformFlags |= 3 /* AssertTypeScript */; } if (subtreeFlags & 524288 /* ContainsSpread */ - || isSuperOrSuperProperty(expression, expressionKind)) { + || (expression.transformFlags & (134217728 /* Super */ | 268435456 /* ContainsSuper */))) { // If the this node contains a SpreadExpression, or is a super call, then it is an ES6 // node. transformFlags |= 192 /* AssertES2015 */; + // super property or element accesses could be inside lambdas, etc, and need a captured `this`, + // while super keyword for super calls (indicated by TransformFlags.Super) does not (since it can only be top-level in a constructor) + if (expression.transformFlags & 268435456 /* ContainsSuper */) { + transformFlags |= 16384 /* ContainsLexicalThis */; + } } if (expression.kind === 91 /* ImportKeyword */) { transformFlags |= 67108864 /* ContainsDynamicImport */; @@ -22128,19 +22592,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537396545 /* ArrayLiteralOrCallOrNewExcludes */; - } - function isSuperOrSuperProperty(node, kind) { - switch (kind) { - case 97 /* SuperKeyword */: - return true; - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - var expression = node.expression; - var expressionKind = expression.kind; - return expressionKind === 97 /* SuperKeyword */; - } - return false; + return transformFlags & ~940049729 /* ArrayLiteralOrCallOrNewExcludes */; } function computeNewExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22153,18 +22605,18 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537396545 /* ArrayLiteralOrCallOrNewExcludes */; + return transformFlags & ~940049729 /* ArrayLiteralOrCallOrNewExcludes */; } function computeBinaryExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 179 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 182 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ESNext if they contain rest transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 178 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 181 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } @@ -22174,7 +22626,7 @@ var ts; transformFlags |= 32 /* AssertES2016 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22203,7 +22655,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */ | 131072 /* ContainsDefaultValueAssignments */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* ParameterExcludes */; + return transformFlags & ~939525441 /* ParameterExcludes */; } function computeParenthesizedExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22213,8 +22665,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 203 /* AsExpression */ - || expressionKind === 185 /* TypeAssertionExpression */) { + if (expressionKind === 206 /* AsExpression */ + || expressionKind === 188 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -22223,7 +22675,7 @@ var ts; transformFlags |= 1024 /* DestructuringAssignment */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~536872257 /* OuterExpressionExcludes */; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; @@ -22249,7 +22701,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~539358529 /* ClassExcludes */; + return transformFlags & ~942011713 /* ClassExcludes */; } function computeClassExpression(node, subtreeFlags) { // A ClassExpression is ES6 syntax. @@ -22266,7 +22718,7 @@ var ts; transformFlags |= 16384 /* ContainsLexicalThis */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~539358529 /* ClassExcludes */; + return transformFlags & ~942011713 /* ClassExcludes */; } function computeHeritageClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22284,7 +22736,7 @@ var ts; break; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22295,7 +22747,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537920833 /* CatchClauseExcludes */; + return transformFlags & ~940574017 /* CatchClauseExcludes */; } function computeExpressionWithTypeArguments(node, subtreeFlags) { // An ExpressionWithTypeArguments is ES6 syntax, as it is used in the @@ -22307,7 +22759,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeConstructor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22321,7 +22773,7 @@ var ts; transformFlags |= 8 /* AssertESNext */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* ConstructorExcludes */; + return transformFlags & ~1003668801 /* ConstructorExcludes */; } function computeMethod(node, subtreeFlags) { // A MethodDeclaration is ES6 syntax. @@ -22348,7 +22800,7 @@ var ts; transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* MethodOrAccessorExcludes */; + return transformFlags & ~1003668801 /* MethodOrAccessorExcludes */; } function computeAccessor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22366,7 +22818,7 @@ var ts; transformFlags |= 8 /* AssertESNext */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* MethodOrAccessorExcludes */; + return transformFlags & ~1003668801 /* MethodOrAccessorExcludes */; } function computePropertyDeclaration(node, subtreeFlags) { // A PropertyDeclaration is TypeScript syntax. @@ -22377,7 +22829,7 @@ var ts; transformFlags |= 8192 /* ContainsPropertyInitializer */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeFunctionDeclaration(node, subtreeFlags) { var transformFlags; @@ -22421,7 +22873,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601281857 /* FunctionExcludes */; + return transformFlags & ~1003935041 /* FunctionExcludes */; } function computeFunctionExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22453,7 +22905,7 @@ var ts; transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601281857 /* FunctionExcludes */; + return transformFlags & ~1003935041 /* FunctionExcludes */; } function computeArrowFunction(node, subtreeFlags) { // An ArrowFunction is ES6 syntax, and excludes markers that should not escape the scope of an ArrowFunction. @@ -22478,19 +22930,31 @@ var ts; transformFlags |= 32768 /* ContainsCapturedLexicalThis */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601249089 /* ArrowFunctionExcludes */; + return transformFlags & ~1003902273 /* ArrowFunctionExcludes */; } function computePropertyAccess(node, subtreeFlags) { var transformFlags = subtreeFlags; - var expression = node.expression; - var expressionKind = expression.kind; // If a PropertyAccessExpression starts with a super keyword, then it is // ES6 syntax, and requires a lexical `this` binding. - if (expressionKind === 97 /* SuperKeyword */) { - transformFlags |= 16384 /* ContainsLexicalThis */; + if (transformFlags & 134217728 /* Super */) { + transformFlags ^= 134217728 /* Super */; + transformFlags |= 268435456 /* ContainsSuper */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~671089985 /* PropertyAccessExcludes */; + } + function computeElementAccess(node, subtreeFlags) { + var transformFlags = subtreeFlags; + var expression = node.expression; + var expressionFlags = expression.transformFlags; // We do not want to aggregate flags from the argument expression for super/this capturing + // If an ElementAccessExpression starts with a super keyword, then it is + // ES6 syntax, and requires a lexical `this` binding. + if (expressionFlags & 134217728 /* Super */) { + transformFlags &= ~134217728 /* Super */; + transformFlags |= 268435456 /* ContainsSuper */; + } + node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; + return transformFlags & ~671089985 /* PropertyAccessExcludes */; } function computeVariableDeclaration(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22504,7 +22968,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; @@ -22520,7 +22984,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeLabeledStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22530,7 +22994,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeImportEquals(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22539,7 +23003,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeExpressionStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22550,7 +23014,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeModuleDeclaration(node, subtreeFlags) { var transformFlags = 3 /* AssertTypeScript */; @@ -22559,7 +23023,7 @@ var ts; transformFlags |= subtreeFlags; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~574674241 /* ModuleExcludes */; + return transformFlags & ~977327425 /* ModuleExcludes */; } function computeVariableDeclarationList(node, subtreeFlags) { var transformFlags = subtreeFlags | 33554432 /* ContainsHoistedDeclarationOrCompletion */; @@ -22571,45 +23035,50 @@ var ts; transformFlags |= 192 /* AssertES2015 */ | 4194304 /* ContainsBlockScopedBinding */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~546309441 /* VariableDeclarationListExcludes */; + return transformFlags & ~948962625 /* VariableDeclarationListExcludes */; } function computeOther(node, kind, subtreeFlags) { // Mark transformations needed for each node var transformFlags = subtreeFlags; - var excludeFlags = 536872257 /* NodeExcludes */; + var excludeFlags = 939525441 /* NodeExcludes */; switch (kind) { case 120 /* AsyncKeyword */: - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + // These nodes are TypeScript syntax. + transformFlags |= 3 /* AssertTypeScript */; + excludeFlags = 536872257 /* OuterExpressionExcludes */; + break; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 117 /* AbstractKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: - case 131 /* ReadonlyKeyword */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 207 /* NonNullExpression */: + case 132 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: case 10 /* JsxText */: - case 253 /* JsxClosingElement */: - case 254 /* JsxFragment */: - case 255 /* JsxOpeningFragment */: - case 256 /* JsxClosingFragment */: - case 257 /* JsxAttribute */: - case 258 /* JsxAttributes */: - case 259 /* JsxSpreadAttribute */: - case 260 /* JsxExpression */: + case 256 /* JsxClosingElement */: + case 257 /* JsxFragment */: + case 258 /* JsxOpeningFragment */: + case 259 /* JsxClosingFragment */: + case 260 /* JsxAttribute */: + case 261 /* JsxAttributes */: + case 262 /* JsxSpreadAttribute */: + case 263 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; @@ -22617,11 +23086,11 @@ var ts; case 14 /* TemplateHead */: case 15 /* TemplateMiddle */: case 16 /* TemplateTail */: - case 197 /* TemplateExpression */: - case 184 /* TaggedTemplateExpression */: - case 266 /* ShorthandPropertyAssignment */: + case 200 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 269 /* ShorthandPropertyAssignment */: case 115 /* StaticKeyword */: - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; @@ -22635,56 +23104,58 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 8 /* AssertESNext */; } transformFlags |= 192 /* AssertES2015 */; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; break; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 159 /* TypePredicate */: - case 160 /* TypeReference */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 163 /* TypeQuery */: - case 164 /* TypeLiteral */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: - case 237 /* NamespaceExportDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 160 /* TypePredicate */: + case 161 /* TypeReference */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 164 /* TypeQuery */: + case 165 /* TypeLiteral */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 171 /* InferType */: + case 172 /* ParenthesizedType */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: + case 240 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. @@ -22701,43 +23172,44 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; case 97 /* SuperKeyword */: // This node is ES6 syntax. - transformFlags |= 192 /* AssertES2015 */; + transformFlags |= 192 /* AssertES2015 */ | 134217728 /* Super */; + excludeFlags = 536872257 /* OuterExpressionExcludes */; // must be set to persist `Super` break; case 99 /* ThisKeyword */: // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } - excludeFlags = 537396545 /* BindingPatternExcludes */; + excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; - excludeFlags = 537396545 /* BindingPatternExcludes */; + excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 179 /* ObjectLiteralExpression */: - excludeFlags = 540087617 /* ObjectLiteralExcludes */; + case 182 /* ObjectLiteralExpression */: + excludeFlags = 942740801 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it // is an ES6 node. @@ -22754,32 +23226,32 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 178 /* ArrayLiteralExpression */: - case 183 /* NewExpression */: - excludeFlags = 537396545 /* ArrayLiteralOrCallOrNewExcludes */; + case 181 /* ArrayLiteralExpression */: + case 186 /* NewExpression */: + excludeFlags = 940049729 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 // node. transformFlags |= 192 /* AssertES2015 */; } break; - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 220 /* ReturnStatement */: - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 223 /* ReturnStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -22795,60 +23267,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) { + if (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 178 /* ArrayLiteralExpression */: - return 537396545 /* ArrayLiteralOrCallOrNewExcludes */; - case 234 /* ModuleDeclaration */: - return 574674241 /* ModuleExcludes */; - case 147 /* Parameter */: - return 536872257 /* ParameterExcludes */; - case 188 /* ArrowFunction */: - return 601249089 /* ArrowFunctionExcludes */; - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - return 601281857 /* FunctionExcludes */; - case 228 /* VariableDeclarationList */: - return 546309441 /* VariableDeclarationListExcludes */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return 539358529 /* ClassExcludes */; - case 153 /* Constructor */: - return 601015617 /* ConstructorExcludes */; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return 601015617 /* MethodOrAccessorExcludes */; + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 181 /* ArrayLiteralExpression */: + return 940049729 /* ArrayLiteralOrCallOrNewExcludes */; + case 237 /* ModuleDeclaration */: + return 977327425 /* ModuleExcludes */; + case 148 /* Parameter */: + return 939525441 /* ParameterExcludes */; + case 191 /* ArrowFunction */: + return 1003902273 /* ArrowFunctionExcludes */; + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + return 1003935041 /* FunctionExcludes */; + case 231 /* VariableDeclarationList */: + return 948962625 /* VariableDeclarationListExcludes */; + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + return 942011713 /* ClassExcludes */; + case 154 /* Constructor */: + return 1003668801 /* ConstructorExcludes */; + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return 1003668801 /* MethodOrAccessorExcludes */; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 136 /* StringKeyword */: - case 134 /* ObjectKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 135 /* ObjectKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 179 /* ObjectLiteralExpression */: - return 540087617 /* ObjectLiteralExcludes */; - case 264 /* CatchClause */: - return 537920833 /* CatchClauseExcludes */; - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - return 537396545 /* BindingPatternExcludes */; + case 182 /* ObjectLiteralExpression */: + return 942740801 /* ObjectLiteralExcludes */; + case 267 /* CatchClause */: + return 940574017 /* CatchClauseExcludes */; + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + return 940049729 /* BindingPatternExcludes */; + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + case 189 /* ParenthesizedExpression */: + case 97 /* SuperKeyword */: + return 536872257 /* OuterExpressionExcludes */; + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + return 671089985 /* PropertyAccessExcludes */; default: - return 536872257 /* NodeExcludes */; + return 939525441 /* NodeExcludes */; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; @@ -22864,7 +23345,7 @@ var ts; /** @internal */ var ts; (function (ts) { - function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { return getSymbolWalker; function getSymbolWalker(accept) { if (accept === void 0) { accept = function () { return true; }; } @@ -22960,8 +23441,9 @@ var ts; visitType(type.modifiersType); } function visitSignature(signature) { - if (signature.typePredicate) { - visitType(signature.typePredicate.type); + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + visitType(typePredicate.type); } ts.forEach(signature.typeParameters, visitType); for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { @@ -23019,7 +23501,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 163 /* TypeQuery */) { + if (d.type && d.type.kind === 164 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -23067,9 +23549,9 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, + resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } @@ -23623,8 +24105,8 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); + var _a = result.value, resolved = _a.resolved, originalPath = _a.originalPath, isExternalLibraryImport = _a.isExternalLibraryImport; + return createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { @@ -23641,11 +24123,17 @@ var ts; if (!resolved_1) return undefined; var resolvedValue = resolved_1.value; - if (!compilerOptions.preserveSymlinks) { - resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + var originalPath = void 0; + if (!compilerOptions.preserveSymlinks && resolvedValue) { + originalPath = resolvedValue.path; + var path = realPath(resolved_1.value.path, host, traceEnabled); + if (path === originalPath) { + originalPath = undefined; + } + resolvedValue = __assign({}, resolvedValue, { path: path }); } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, originalPath: originalPath, isExternalLibraryImport: true } }; } else { var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; @@ -23681,7 +24169,9 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return noPackageId(resolvedFromFile); + var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; + var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, /*onlyRecordFailures*/ false, state).packageId; + return withPackageId(packageId, resolvedFromFile); } } if (!onlyRecordFailures) { @@ -23695,6 +24185,49 @@ var ts; } return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } + var nodeModulesPathPart = "/node_modules/"; + /** + * This will be called on the successfully resolved path from `loadModuleFromFile`. + * (Not neeeded for `loadModuleFromNodeModules` as that looks up the `package.json` as part of resolution.) + * + * packageDirectory is the directory of the package itself. + * subModuleName is the path within the package. + * For `blah/node_modules/foo/index.d.ts` this is { packageDirectory: "foo", subModuleName: "index.d.ts" }. (Part before "/node_modules/" is ignored.) + * For `/node_modules/foo/bar.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. + * For `/node_modules/@types/foo/bar/index.d.ts` this is { packageDirectory: "@types/foo", subModuleName: "bar/index.d.ts" }. + * For `/node_modules/foo/bar/index.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. + */ + function parseNodeModuleFromPath(resolved) { + var path = ts.normalizePath(resolved.path); + var idx = path.lastIndexOf(nodeModulesPathPart); + if (idx === -1) { + return undefined; + } + var indexAfterNodeModules = idx + nodeModulesPathPart.length; + var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules); + if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName); + } + var packageDirectory = path.slice(0, indexAfterPackageName); + var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts" /* Dts */; + return { packageDirectory: packageDirectory, subModuleName: subModuleName }; + } + function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) { + var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; + } + function addExtensionAndIndex(path) { + if (path === "") { + return "index.d.ts"; + } + if (ts.endsWith(path, ".d.ts")) { + return path; + } + if (ts.endsWith(path, "/index")) { + return path + ".d.ts"; + } + return path + "/index.d.ts"; + } /* @internal */ function directoryProbablyExists(directoryName, host) { // if host does not support 'directoryExists' assume that directory will exist @@ -23780,18 +24313,41 @@ var ts; var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } - function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) { - var host = _a.host, traceEnabled = _a.traceEnabled; + function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) { + var host = state.host, traceEnabled = state.traceEnabled; var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host); var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } var packageJsonContent = readJson(packageJsonPath, host); + if (subModuleName === "") { + var path = tryReadPackageJsonFields(/*readTypes*/ true, packageJsonContent, nodeModuleDirectory, state); + if (typeof path === "string") { + subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); + } + else { + var jsPath = tryReadPackageJsonFields(/*readTypes*/ false, packageJsonContent, nodeModuleDirectory, state); + if (typeof jsPath === "string") { + subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js" /* Js */), ".jsx" /* Jsx */) + ".d.ts" /* Dts */; + } + else { + subModuleName = "index.d.ts"; + } + } + } + if (!ts.endsWith(subModuleName, ".d.ts" /* Dts */)) { + subModuleName = addExtensionAndIndex(subModuleName); + } var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string" ? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version } : undefined; + if (traceEnabled) { + if (packageId) { + trace(host, ts.Diagnostics.Found_package_json_at_0_Package_ID_is_1, packageJsonPath, ts.packageIdToString(packageId)); + } + else { + trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + } return { found: true, packageJsonContent: packageJsonContent, packageId: packageId }; } else { @@ -23949,13 +24505,18 @@ var ts; function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); if (withoutAtTypePrefix !== mangledName) { - return ts.stringContains(withoutAtTypePrefix, mangledScopedPackageSeparator) ? - "@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) : - withoutAtTypePrefix; + return getUnmangledNameForScopedPackage(withoutAtTypePrefix); } return mangledName; } ts.getPackageNameFromAtTypesDirectory = getPackageNameFromAtTypesDirectory; + /* @internal */ + function getUnmangledNameForScopedPackage(typesPackageName) { + return ts.stringContains(typesPackageName, mangledScopedPackageSeparator) ? + "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) : + typesPackageName; + } + ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { var result = cache && cache.get(containingDirectory); if (result) { @@ -23971,7 +24532,8 @@ var ts; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + // No originalPath because classic resolution doesn't resolve realPath + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*originalPath*/ undefined, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { @@ -24016,7 +24578,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*originalPath*/ undefined, /*isExternalLibraryImport*/ true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -24146,6 +24708,11 @@ var ts; typeToTypeNode: nodeBuilder.typeToTypeNode, indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + symbolToEntityName: nodeBuilder.symbolToEntityName, + symbolToExpression: nodeBuilder.symbolToExpression, + symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, + symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, + typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, getSymbolsInScope: function (location, meaning) { location = ts.getParseTreeNode(location); return location ? getSymbolsInScope(location, meaning) : []; @@ -24179,16 +24746,40 @@ var ts; typeToString: function (type, enclosingDeclaration, flags) { return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); }, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: function (symbol, enclosingDeclaration, meaning) { - return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + symbolToString: function (symbol, enclosingDeclaration, meaning, flags) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags); }, + typePredicateToString: function (predicate, enclosingDeclaration, flags) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags); + }, + writeSignature: function (signature, enclosingDeclaration, flags, kind, writer) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind, writer); + }, + writeType: function (type, enclosingDeclaration, flags, writer) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + writeSymbol: function (symbol, enclosingDeclaration, meaning, flags, writer) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags, writer); + }, + writeTypePredicate: function (predicate, enclosingDeclaration, flags, writer) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + getSymbolDisplayBuilder: getSymbolDisplayBuilder, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, getContextualType: function (node) { node = ts.getParseTreeNode(node, ts.isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: function (node, argIndex) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, + isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) { node = ts.getParseTreeNode(node, ts.isCallLikeExpression); @@ -24203,7 +24794,11 @@ var ts; }, isValidPropertyAccess: function (node, propertyName) { node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); - return node ? isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)) : false; + return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)); + }, + isValidPropertyAccessForCompletions: function (node, type, property) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessExpression); + return !!node && isValidPropertyAccessForCompletions(node, type, property); }, getSignatureFromDeclaration: function (declaration) { declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); @@ -24227,7 +24822,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, - getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -24269,28 +24864,40 @@ var ts; getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); }, getBaseConstraintOfType: getBaseConstraintOfType, getDefaultFromTypeParameter: function (type) { return type && type.flags & 32768 /* TypeParameter */ ? getDefaultFromTypeParameter(type) : undefined; }, - resolveName: function (name, location, meaning) { - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); + resolveName: function (name, location, meaning, excludeGlobals) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals); }, getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, getAccessibleSymbolChain: getAccessibleSymbolChain, + getTypePredicateOfSignature: getTypePredicateOfSignature, + resolveExternalModuleSymbol: resolveExternalModuleSymbol, + tryGetThisTypeAt: function (node) { + node = ts.getParseTreeNode(node); + return node && tryGetThisTypeAt(node); + }, + getTypeArgumentConstraint: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, }; var tupleTypes = []; var unionTypes = ts.createMap(); var intersectionTypes = ts.createMap(); var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); + var conditionalTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); var undefinedType = createIntrinsicType(4096 /* Undefined */, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 4194304 /* ContainsWideningType */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 16777216 /* ContainsWideningType */, "undefined"); var nullType = createIntrinsicType(8192 /* Null */, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 4194304 /* ContainsWideningType */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 16777216 /* ContainsWideningType */, "null"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); var trueType = createIntrinsicType(128 /* BooleanLiteral */, "true"); @@ -24301,7 +24908,7 @@ var ts; var neverType = createIntrinsicType(16384 /* Never */, "never"); var silentNeverType = createIntrinsicType(16384 /* Never */, "never"); var implicitNeverType = createIntrinsicType(16384 /* Never */, "never"); - var nonPrimitiveType = createIntrinsicType(33554432 /* NonPrimitive */, "object"); + var nonPrimitiveType = createIntrinsicType(134217728 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = ts.createSymbolTable(); @@ -24311,7 +24918,7 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. - anyFunctionType.flags |= 16777216 /* ContainsAnyFunctionType */; + anyFunctionType.flags |= 67108864 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -24319,13 +24926,15 @@ var ts; var markerSubType = createType(32768 /* TypeParameter */); markerSubType.constraint = markerSuperType; var markerOtherType = createType(32768 /* TypeParameter */); - var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType); + var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); var jsObjectLiteralIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); var globals = ts.createSymbolTable(); + var reverseMappedCache = ts.createMap(); var ambientModulesCache; /** * List of every ambient module with a "*" wildcard. @@ -24489,23 +25098,24 @@ var ts; var jsxTypes = ts.createUnderscoreEscapedMap(); var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); + var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); - // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. - var _displayBuilder; var TypeSystemPropertyName; (function (TypeSystemPropertyName) { TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstraint"] = 4] = "ResolvedBaseConstraint"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); var CheckMode; (function (CheckMode) { CheckMode[CheckMode["Normal"] = 0] = "Normal"; CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + CheckMode[CheckMode["Contextual"] = 3] = "Contextual"; })(CheckMode || (CheckMode = {})); var CallbackCheck; (function (CallbackCheck) { @@ -24515,8 +25125,10 @@ var ts; })(CallbackCheck || (CallbackCheck = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { - MappedTypeModifiers[MappedTypeModifiers["Readonly"] = 1] = "Readonly"; - MappedTypeModifiers[MappedTypeModifiers["Optional"] = 2] = "Optional"; + MappedTypeModifiers[MappedTypeModifiers["IncludeReadonly"] = 1] = "IncludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeReadonly"] = 2] = "ExcludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["IncludeOptional"] = 4] = "IncludeOptional"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeOptional"] = 8] = "ExcludeOptional"; })(MappedTypeModifiers || (MappedTypeModifiers = {})); var ExpandingFlags; (function (ExpandingFlags) { @@ -24525,6 +25137,21 @@ var ts; ExpandingFlags[ExpandingFlags["Target"] = 2] = "Target"; ExpandingFlags[ExpandingFlags["Both"] = 3] = "Both"; })(ExpandingFlags || (ExpandingFlags = {})); + var TypeIncludes; + (function (TypeIncludes) { + TypeIncludes[TypeIncludes["Any"] = 1] = "Any"; + TypeIncludes[TypeIncludes["Undefined"] = 2] = "Undefined"; + TypeIncludes[TypeIncludes["Null"] = 4] = "Null"; + TypeIncludes[TypeIncludes["Never"] = 8] = "Never"; + TypeIncludes[TypeIncludes["NonWideningType"] = 16] = "NonWideningType"; + TypeIncludes[TypeIncludes["String"] = 32] = "String"; + TypeIncludes[TypeIncludes["Number"] = 64] = "Number"; + TypeIncludes[TypeIncludes["ESSymbol"] = 128] = "ESSymbol"; + TypeIncludes[TypeIncludes["LiteralOrUniqueESSymbol"] = 256] = "LiteralOrUniqueESSymbol"; + TypeIncludes[TypeIncludes["ObjectType"] = 512] = "ObjectType"; + TypeIncludes[TypeIncludes["EmptyObject"] = 1024] = "EmptyObject"; + TypeIncludes[TypeIncludes["Union"] = 2048] = "Union"; + })(TypeIncludes || (TypeIncludes = {})); var MembersOrExportsResolutionKind; (function (MembersOrExportsResolutionKind) { MembersOrExportsResolutionKind["resolvedExports"] = "resolvedExports"; @@ -24535,6 +25162,142 @@ var ts; var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor); initializeTypeChecker(); return checker; + /** + * @deprecated + */ + function getSymbolDisplayBuilder() { + return { + buildTypeDisplay: function (type, writer, enclosingDeclaration, flags) { + typeToString(type, enclosingDeclaration, flags, emitTextWriterWrapper(writer)); + }, + buildSymbolDisplay: function (symbol, writer, enclosingDeclaration, meaning, flags) { + symbolToString(symbol, enclosingDeclaration, meaning, flags | 4 /* AllowAnyNodeKind */, emitTextWriterWrapper(writer)); + }, + buildSignatureDisplay: function (signature, writer, enclosing, flags, kind) { + signatureToString(signature, enclosing, flags, kind, emitTextWriterWrapper(writer)); + }, + buildIndexSignatureDisplay: function (info, writer, kind, enclosing, flags) { + var sig = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, kind, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, sig, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildParameterDisplay: function (symbol, writer, enclosing, flags) { + var node = nodeBuilder.symbolToParameterDeclaration(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplay: function (tp, writer, enclosing, flags) { + var node = nodeBuilder.typeParameterToDeclaration(tp, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 8192 /* OmitParameterModifiers */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypePredicateDisplay: function (predicate, writer, enclosing, flags) { + typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplayFromSymbol: function (symbol, writer, enclosing, flags) { + var nodes = nodeBuilder.symbolToTypeParameterDeclarations(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeList(26896 /* TypeParameters */, nodes, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForParametersAndDelimiters: function (thisParameter, parameters, writer, enclosing, originalFlags) { + var printer = ts.createPrinter({ removeComments: true }); + var flags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */ | toNodeBuilderFlags(originalFlags); + var thisParameterArray = thisParameter ? [nodeBuilder.symbolToParameterDeclaration(thisParameter, enclosing, flags)] : []; + var params = ts.createNodeArray(thisParameterArray.concat(ts.map(parameters, function (param) { return nodeBuilder.symbolToParameterDeclaration(param, enclosing, flags); }))); + printer.writeList(1296 /* CallExpressionArguments */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForTypeParametersAndDelimiters: function (typeParameters, writer, enclosing, flags) { + var printer = ts.createPrinter({ removeComments: true }); + var args = ts.createNodeArray(ts.map(typeParameters, function (p) { return nodeBuilder.typeParameterToDeclaration(p, enclosing, toNodeBuilderFlags(flags)); })); + printer.writeList(26896 /* TypeParameters */, args, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildReturnTypeDisplay: function (signature, writer, enclosing, flags) { + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = getTypePredicateOfSignature(signature); + if (predicate) { + return typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + } + var node = nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + } + }; + function emitTextWriterWrapper(underlying) { + return { + write: ts.noop, + writeTextOfNode: ts.noop, + writeLine: ts.noop, + increaseIndent: function () { + return underlying.increaseIndent(); + }, + decreaseIndent: function () { + return underlying.decreaseIndent(); + }, + getText: function () { + return ""; + }, + rawWrite: ts.noop, + writeLiteral: function (s) { + return underlying.writeStringLiteral(s); + }, + getTextPos: function () { + return 0; + }, + getLine: function () { + return 0; + }, + getColumn: function () { + return 0; + }, + getIndent: function () { + return 0; + }, + isAtStartOfLine: function () { + return false; + }, + clear: function () { + return underlying.clear(); + }, + writeKeyword: function (text) { + return underlying.writeKeyword(text); + }, + writeOperator: function (text) { + return underlying.writeOperator(text); + }, + writePunctuation: function (text) { + return underlying.writePunctuation(text); + }, + writeSpace: function (text) { + return underlying.writeSpace(text); + }, + writeStringLiteral: function (text) { + return underlying.writeStringLiteral(text); + }, + writeParameter: function (text) { + return underlying.writeParameter(text); + }, + writeProperty: function (text) { + return underlying.writeProperty(text); + }, + writeSymbol: function (text, symbol) { + return underlying.writeSymbol(text, symbol); + }, + trackSymbol: function (symbol, enclosing, meaning) { + return underlying.trackSymbol && underlying.trackSymbol(symbol, enclosing, meaning); + }, + reportInaccessibleThisError: function () { + return underlying.reportInaccessibleThisError && underlying.reportInaccessibleThisError(); + }, + reportPrivateInBaseOfClassExpression: function (name) { + return underlying.reportPrivateInBaseOfClassExpression && underlying.reportPrivateInBaseOfClassExpression(name); + }, + reportInaccessibleUniqueSymbolError: function () { + return underlying.reportInaccessibleUniqueSymbolError && underlying.reportInaccessibleUniqueSymbolError(); + } + }; + } + } function getJsxNamespace() { if (!_jsxNamespace) { _jsxNamespace = "React"; @@ -24640,7 +25403,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 234 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 234 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 237 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 237 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -24661,8 +25424,11 @@ var ts; error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - var message_2 = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message_2 = target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */ + ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); }); @@ -24758,7 +25524,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -24812,21 +25578,21 @@ var ts; return true; } var sourceFiles = host.getSourceFiles(); - return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); + return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 177 /* BindingElement */) { + if (declaration.kind === 180 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 177 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 180 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 227 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 230 /* VariableDeclaration */), usage); } - else if (declaration.kind === 227 /* VariableDeclaration */) { + else if (declaration.kind === 230 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -24840,12 +25606,12 @@ var ts; // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === 247 /* ExportSpecifier */ || (usage.parent.kind === 244 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 250 /* ExportSpecifier */ || (usage.parent.kind === 247 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 244 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 247 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -24853,9 +25619,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 209 /* VariableStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 212 /* VariableStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -24875,16 +25641,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 150 /* PropertyDeclaration */ && + current.parent.kind === 151 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 152 /* MethodDeclaration */) { + if (declaration.kind === 153 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 150 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -24900,14 +25666,15 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, suggestedNameNotFoundMessage) { - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, getSymbol, suggestedNameNotFoundMessage); + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, suggestedNameNotFoundMessage) { + if (excludeGlobals === void 0) { excludeGlobals = false; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, suggestedNameNotFoundMessage); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, lookup, suggestedNameNotFoundMessage) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, suggestedNameNotFoundMessage) { var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; var lastLocation; - var lastNonBlockLocation; + var lastSelfReferenceLocation; var propertyWithInvalidInitializer; var errorLocation = location; var grandparent; @@ -24924,12 +25691,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 279 /* JSDocComment */) { + if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 282 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 147 /* Parameter */ || - lastLocation.kind === 146 /* TypeParameter */ + lastLocation.kind === 148 /* Parameter */ || + lastLocation.kind === 147 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -24939,11 +25706,16 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 147 /* Parameter */ || + lastLocation.kind === 148 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 147 /* Parameter */); + result.valueDeclaration.kind === 148 /* Parameter */); } } + else if (location.kind === 170 /* ConditionalType */) { + // A type parameter declared using 'infer T' in a conditional type is visible only in + // the true branch of the conditional type. + useResult = lastLocation === location.trueType; + } if (useResult) { break loop; } @@ -24953,17 +25725,17 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 269 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. - if (result = moduleExports.get("default")) { + if (result = moduleExports.get("default" /* Default */)) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { break loop; @@ -24984,7 +25756,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - ts.getDeclarationOfKind(moduleExport, 247 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExport, 250 /* ExportSpecifier */)) { break; } } @@ -24992,13 +25764,13 @@ var ts; break loop; } break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -25015,9 +25787,9 @@ var ts; } } break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 793064 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { // ignore type parameters not declared in this container @@ -25033,7 +25805,7 @@ var ts; } break loop; } - if (location.kind === 200 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 203 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -25041,7 +25813,7 @@ var ts; } } break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 85 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -25061,9 +25833,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 231 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 234 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -25071,19 +25843,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -25096,7 +25868,7 @@ var ts; } } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -25105,7 +25877,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 147 /* Parameter */) { + if (location.parent && location.parent.kind === 148 /* Parameter */) { location = location.parent; } // @@ -25119,26 +25891,28 @@ var ts; } break; } - if (location.kind !== 208 /* Block */) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. - // If `result === lastLocation.symbol`, that means that we are somewhere inside `lastLocation` looking up a name, and resolving to `lastLocation` itself. + // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { - result.isReferenced = true; + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + result.isReferenced |= meaning; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 269 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 272 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports") { return lastLocation.symbol; } } - result = lookup(globals, name, meaning); + if (!excludeGlobals) { + result = lookup(globals, name, meaning); + } } if (!result) { if (nameNotFoundMessage) { @@ -25194,27 +25968,40 @@ var ts; // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 237 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 240 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); } } } return result; } + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 237 /* ModuleDeclaration */:// For `namespace N { N; }` + return true; + default: + return false; + } + } function diagnosticName(nameArg) { return ts.isString(nameArg) ? ts.unescapeLeadingUnderscores(nameArg) : ts.declarationNameToString(nameArg); } function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 146 /* TypeParameter */ && decl.parent === container) { + if (decl.kind === 147 /* TypeParameter */ && decl.parent === container) { return true; } } return false; } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 71 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); @@ -25260,9 +26047,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -25325,7 +26112,7 @@ var ts; function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 233 /* EnumDeclaration */) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 236 /* EnumDeclaration */) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { if (result.flags & 2 /* BlockScopedVariable */) { @@ -25348,13 +26135,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return node; - case 240 /* ImportClause */: + case 243 /* ImportClause */: return node.parent; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return node.parent.parent; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -25364,11 +26151,46 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } + function resolveExportByName(moduleSymbol, name, dontResolveAlias) { + var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); + return exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), name) + : resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias); + } + function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) { + if (!allowSyntheticDefaultImports) { + return false; + } + // Declaration files (and ambient modules) + if (!file || file.isDeclarationFile) { + // Definitely cannot have a synthetic default if they have a default member specified + if (resolveExportByName(moduleSymbol, "default" /* Default */, dontResolveAlias)) { + return false; + } + // It _might_ still be incorrect to assume there is no __esModule marker on the import at runtime, even if there is no `default` member + // So we check a bit more, + if (resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias)) { + // If there is an `__esModule` specified in the declaration (meaning someone explicitly added it or wrote it in their code), + // it definitely is a module and does not have a synthetic default + return false; + } + // There are _many_ declaration files not written with esmodules in mind that still get compiled into a format with __esModule set + // Meaning there may be no default at runtime - however to be on the permissive side, we allow access to a synthetic default member + // as there is no marker to indicate if the accompanying JS has `__esModule` or not, or is even native esm + return true; + } + // TypeScript files never have a synthetic default (as they are always emitted with an __esModule marker) _unless_ they contain an export= statement + if (!ts.isSourceFileJavaScript(file)) { + return hasExportAssignmentSymbol(moduleSymbol); + } + // JS files have a synthetic default if they do not contain ES2015+ module syntax (export = is not valid in js) _and_ do not have an __esModule marker + return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias); + } function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { @@ -25377,15 +26199,15 @@ var ts; exportDefaultSymbol = moduleSymbol; } else { - var exportValue = moduleSymbol.exports.get("export="); - exportDefaultSymbol = exportValue - ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") - : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, dontResolveAlias); } - if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { + var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias); + if (!exportDefaultSymbol && !hasSyntheticDefault) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } - else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + else if (!exportDefaultSymbol && hasSyntheticDefault) { + // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; @@ -25465,7 +26287,7 @@ var ts; symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); var symbolFromModule = getExportOfModule(targetSymbol, name.escapedText, dontResolveAlias); // If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default - if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default") { + if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default" /* Default */) { symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? @@ -25494,19 +26316,19 @@ var ts; } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } @@ -25561,11 +26383,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 247 /* ExportSpecifier */) { + else if (node.kind === 250 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -25587,13 +26409,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 144 /* QualifiedName */) { + if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 145 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 238 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 241 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -25615,13 +26437,12 @@ var ts; return undefined; } } - else if (name.kind === 144 /* QualifiedName */ || name.kind === 180 /* PropertyAccessExpression */) { + else if (name.kind === 145 /* QualifiedName */ || name.kind === 183 /* PropertyAccessExpression */) { var left = void 0; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { left = name.left; } - else if (name.kind === 180 /* PropertyAccessExpression */ && - (name.expression.kind === 186 /* ParenthesizedExpression */ || ts.isEntityNameExpression(name.expression))) { + else if (name.kind === 183 /* PropertyAccessExpression */) { left = name.expression; } else { @@ -25631,7 +26452,7 @@ var ts; // i.e class C extends foo()./*do language service operation here*/B {} return undefined; } - var right = name.kind === 144 /* QualifiedName */ ? name.right : name.name; + var right = name.kind === 145 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -25650,15 +26471,6 @@ var ts; return undefined; } } - else if (name.kind === 186 /* ParenthesizedExpression */) { - // If the expression in parenthesizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. - // This is the case when we are trying to do any language service operation in heritage clauses. - // By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression will attempt to checkPropertyAccessExpression to resolve symbol. - // i.e class C extends foo()./*do language service operation here*/B {} - return ts.isEntityNameExpression(name.expression) ? - resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : - undefined; - } else { ts.Debug.assertNever(name, "Unknown entity name kind."); } @@ -25670,11 +26482,9 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 13 /* NoSubstitutionTemplateLiteral */) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return ts.isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -25717,7 +26527,7 @@ var ts; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } else if (noImplicitAny && moduleNotFoundError) { - var errorInfo = !resolvedModule.isExternalLibraryImport ? undefined : ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference); + var errorInfo = resolvedModule.packageId && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, resolvedModule.packageId.name); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } @@ -25752,8 +26562,42 @@ var ts; // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); - if (!dontResolveAlias && symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { - error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + if (!dontResolveAlias && symbol) { + if (!(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + return symbol; + } + if (compilerOptions.esModuleInterop) { + var referenceParent = moduleReferenceExpression.parent; + if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) || + ts.isImportCall(referenceParent)) { + var type = getTypeOfSymbol(symbol); + var sigs = getSignaturesOfStructuredType(type, 0 /* Call */); + if (!sigs || !sigs.length) { + sigs = getSignaturesOfStructuredType(type, 1 /* Construct */); + } + if (sigs && sigs.length) { + var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol); + // Create a new symbol which has the module's type less the call and construct signatures + var result = createSymbol(symbol.flags, symbol.escapedName); + result.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result.parent = symbol.parent; + result.target = symbol; + result.originatingImport = referenceParent; + if (symbol.valueDeclaration) + result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; + if (symbol.members) + result.members = ts.cloneMap(symbol.members); + if (symbol.exports) + result.exports = ts.cloneMap(symbol.exports); + var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above + result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.stringIndexInfo, resolvedModuleType.numberIndexInfo); + return result; + } + } + } } return symbol; } @@ -25806,7 +26650,7 @@ var ts; if (!source) return; source.forEach(function (sourceSymbol, id) { - if (id === "default") + if (id === "default" /* Default */) return; var targetSymbol = target.get(id); if (!targetSymbol) { @@ -25889,7 +26733,7 @@ var ts; var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 153 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -25967,12 +26811,12 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -25991,11 +26835,14 @@ var ts; } var visitedSymbolTables = []; return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - function getAccessibleSymbolChainFromSymbolTable(symbols) { + /** + * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already) + */ + function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification) { if (!ts.pushIfUnique(visitedSymbolTables, symbols)) { return undefined; } - var result = trySymbolTable(symbols); + var result = trySymbolTable(symbols, ignoreQualification); visitedSymbolTables.pop(); return result; } @@ -26005,36 +26852,34 @@ var ts; // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { + function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) && // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) // and if symbolFromSymbolTable or alias resolution matches the symbol, // check the symbol can be qualified, it is only then this symbol is accessible !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning)); } - function isUMDExportSymbol(symbol) { - return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); - } - function trySymbolTable(symbols) { + function trySymbolTable(symbols, ignoreQualification) { // If symbol is directly available by its name in the symbol table - if (isAccessible(symbols.get(symbol.escapedName))) { + if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification)) { return [symbol]; } // Check if symbol is any of the alias return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" - && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) + && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) { + if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { return [symbolFromSymbolTable]; } // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain // but only if the symbolFromSymbolTable can be qualified - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + var candidateTable = getExportsOfSymbol(resolvedImportedSymbol); + var accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable, /*ignoreQualification*/ true); if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); } @@ -26057,7 +26902,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 247 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 250 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -26072,10 +26917,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: continue; default: return false; @@ -26089,6 +26934,10 @@ var ts; var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); return access.accessibility === 0 /* Accessible */; } + function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 107455 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false); + return access.accessibility === 0 /* Accessible */; + } /** * Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested * @@ -26157,7 +27006,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -26191,14 +27040,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 163 /* TypeQuery */ || + if (entityName.parent.kind === 164 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 145 /* ComputedPropertyName */) { + entityName.parent.kind === 146 /* ComputedPropertyName */) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 144 /* QualifiedName */ || entityName.kind === 180 /* PropertyAccessExpression */ || - entityName.parent.kind === 238 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 145 /* QualifiedName */ || entityName.kind === 183 /* PropertyAccessExpression */ || + entityName.parent.kind === 241 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -26216,97 +27065,134 @@ var ts; errorNode: firstIdentifier }; } - function writeKeyword(writer, kind) { - writer.writeKeyword(ts.tokenToString(kind)); + function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { + if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } + var nodeFlags = 3112960 /* IgnoreErrors */; + if (flags & 2 /* UseOnlyExternalAliasing */) { + nodeFlags |= 128 /* UseOnlyExternalAliasing */; + } + if (flags & 1 /* WriteTypeParametersOrArguments */) { + nodeFlags |= 512 /* WriteTypeParametersInQualifiedName */; + } + if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) { + nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; + } + var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; + return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); + function symbolToStringWorker(writer) { + var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); + return writer; + } } - function writePunctuation(writer, kind) { - writer.writePunctuation(ts.tokenToString(kind)); + function signatureToString(signature, enclosingDeclaration, flags, kind, writer) { + return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker); + function signatureToStringWorker(writer) { + var sigOutput; + if (flags & 262144 /* WriteArrowStyleSignature */) { + sigOutput = kind === 1 /* Construct */ ? 163 /* ConstructorType */ : 162 /* FunctionType */; + } + else { + sigOutput = kind === 1 /* Construct */ ? 158 /* ConstructSignature */ : 157 /* CallSignature */; + } + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, writer); + return writer; + } } - function writeSpace(writer) { - writer.writeSpace(" "); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); - }); - } - function signatureToString(signature, enclosingDeclaration, flags, kind) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); - }); - } - function typeToString(type, enclosingDeclaration, flags) { - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | ts.NodeBuilderFlags.IgnoreErrors | ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName); + function typeToString(type, enclosingDeclaration, flags, writer) { + if (writer === void 0) { writer = ts.createTextWriter(""); } + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); ts.Debug.assert(typeNode !== undefined, "should always get typenode"); var options = { removeComments: true }; - var writer = ts.createTextWriter(""); var printer = ts.createPrinter(options); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ sourceFile, writer); var result = writer.getText(); - var maxLength = compilerOptions.noErrorTruncation || flags & 8 /* NoTruncation */ ? undefined : 100; - if (maxLength && result.length >= maxLength) { + var maxLength = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */ ? undefined : 100; + if (maxLength && result && result.length >= maxLength) { return result.substr(0, maxLength - "...".length) + "..."; } return result; - function toNodeBuilderFlags(flags) { - var result = ts.NodeBuilderFlags.None; - if (!flags) { - return result; - } - if (flags & 8 /* NoTruncation */) { - result |= ts.NodeBuilderFlags.NoTruncation; - } - if (flags & 256 /* UseFullyQualifiedType */) { - result |= ts.NodeBuilderFlags.UseFullyQualifiedType; - } - if (flags & 4096 /* SuppressAnyReturnType */) { - result |= ts.NodeBuilderFlags.SuppressAnyReturnType; - } - if (flags & 1 /* WriteArrayAsGenericType */) { - result |= ts.NodeBuilderFlags.WriteArrayAsGenericType; - } - if (flags & 64 /* WriteTypeArgumentsOfSignature */) { - result |= ts.NodeBuilderFlags.WriteTypeArgumentsOfSignature; - } - return result; - } + } + function toNodeBuilderFlags(flags) { + return flags & 9469291 /* NodeBuilderFlagsMask */; } function createNodeBuilder() { return { - typeToTypeNode: function (type, enclosingDeclaration, flags) { + typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = typeToTypeNodeHelper(type, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = signatureToSignatureDeclarationHelper(signature, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; - } + }, + symbolToEntityName: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToName(symbol, context, meaning, /*expectsIdentifier*/ false); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToExpression: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToExpression(symbol, context, meaning); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToTypeParameterDeclarations: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParametersToTypeParameterDeclarations(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToParameterDeclaration: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToParameterDeclaration(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + typeParameterToDeclaration: function (parameter, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParameterToDeclaration(parameter, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, }; - function createNodeBuilderContext(enclosingDeclaration, flags) { + function createNodeBuilderContext(enclosingDeclaration, flags, tracker) { return { enclosingDeclaration: enclosingDeclaration, flags: flags, + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop }, encounteredError: false, symbolStack: undefined }; } function typeToTypeNodeHelper(type, context) { - var inTypeAlias = context.flags & ts.NodeBuilderFlags.InTypeAlias; - context.flags &= ~ts.NodeBuilderFlags.InTypeAlias; + var inTypeAlias = context.flags & 8388608 /* InTypeAlias */; + context.flags &= ~8388608 /* InTypeAlias */; if (!type) { context.encounteredError = true; return undefined; @@ -26315,10 +27201,10 @@ var ts; return ts.createKeywordTypeNode(119 /* AnyKeyword */); } if (type.flags & 2 /* String */) { - return ts.createKeywordTypeNode(136 /* StringKeyword */); + return ts.createKeywordTypeNode(137 /* StringKeyword */); } if (type.flags & 4 /* Number */) { - return ts.createKeywordTypeNode(133 /* NumberKeyword */); + return ts.createKeywordTypeNode(134 /* NumberKeyword */); } if (type.flags & 8 /* Boolean */) { return ts.createKeywordTypeNode(122 /* BooleanKeyword */); @@ -26343,31 +27229,39 @@ var ts; return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); } if (type.flags & 1024 /* UniqueESSymbol */) { - return ts.createTypeOperatorNode(140 /* UniqueKeyword */, ts.createKeywordTypeNode(137 /* SymbolKeyword */)); + if (!(context.flags & 1048576 /* AllowUniqueESSymbolType */)) { + if (context.tracker.reportInaccessibleUniqueSymbolError) { + context.tracker.reportInaccessibleUniqueSymbolError(); + } + } + return ts.createTypeOperatorNode(141 /* UniqueKeyword */, ts.createKeywordTypeNode(138 /* SymbolKeyword */)); } if (type.flags & 2048 /* Void */) { return ts.createKeywordTypeNode(105 /* VoidKeyword */); } if (type.flags & 4096 /* Undefined */) { - return ts.createKeywordTypeNode(139 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(140 /* UndefinedKeyword */); } if (type.flags & 8192 /* Null */) { return ts.createKeywordTypeNode(95 /* NullKeyword */); } if (type.flags & 16384 /* Never */) { - return ts.createKeywordTypeNode(130 /* NeverKeyword */); + return ts.createKeywordTypeNode(131 /* NeverKeyword */); } if (type.flags & 512 /* ESSymbol */) { - return ts.createKeywordTypeNode(137 /* SymbolKeyword */); + return ts.createKeywordTypeNode(138 /* SymbolKeyword */); } - if (type.flags & 33554432 /* NonPrimitive */) { - return ts.createKeywordTypeNode(134 /* ObjectKeyword */); + if (type.flags & 134217728 /* NonPrimitive */) { + return ts.createKeywordTypeNode(135 /* ObjectKeyword */); } if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { - if (context.flags & ts.NodeBuilderFlags.InObjectTypeLiteral) { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowThisInObjectLiteral)) { + if (context.flags & 4194304 /* InObjectTypeLiteral */) { + if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) { context.encounteredError = true; } + if (context.tracker.reportInaccessibleThisError) { + context.tracker.reportInaccessibleThisError(); + } } return ts.createThis(); } @@ -26381,7 +27275,7 @@ var ts; // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } - if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { + if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -26390,11 +27284,11 @@ var ts; var types = type.flags & 131072 /* Union */ ? formatUnionTypes(type.types) : type.types; var typeNodes = mapToTypeNodes(types, context); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 167 /* UnionType */ : 168 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 168 /* UnionType */ : 169 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowEmptyUnionOrIntersection)) { + if (!context.encounteredError && !(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) { context.encounteredError = true; } return undefined; @@ -26415,12 +27309,22 @@ var ts; var indexTypeNode = typeToTypeNodeHelper(type.indexType, context); return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 2097152 /* Conditional */) { + var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); + var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); + var trueTypeNode = typeToTypeNodeHelper(type.trueType, context); + var falseTypeNode = typeToTypeNodeHelper(type.falseType, context); + return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + if (type.flags & 4194304 /* Substitution */) { + return typeToTypeNodeHelper(type.typeParameter, context); + } ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { ts.Debug.assert(!!(type.flags & 65536 /* Object */)); - var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131 /* ReadonlyKeyword */) : undefined; - var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55 /* QuestionToken */) : undefined; - var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context); + var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined; + var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined; + var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); var mappedTypeNode = ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); @@ -26429,7 +27333,7 @@ var ts; var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 203 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return createTypeQueryNodeFromSymbol(symbol, 107455 /* Value */); @@ -26452,10 +27356,16 @@ var ts; if (!context.symbolStack) { context.symbolStack = []; } - context.symbolStack.push(symbol); - var result = createTypeNodeFromObjectType(type); - context.symbolStack.pop(); - return result; + var isConstructorObject = ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; + if (isConstructorObject) { + return createTypeNodeFromObjectType(type); + } + else { + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } } } else { @@ -26468,11 +27378,12 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; + return declaration.parent.kind === 272 /* SourceFile */ || declaration.parent.kind === 238 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions - return ts.contains(context.symbolStack, symbol); // it is type of the symbol uses itself recursively + return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ts.contains(context.symbolStack, symbol)) && // it is type of the symbol uses itself recursively + (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); // And the build is going to succeed without visibility error or there is no structural fallback allowed } } } @@ -26487,21 +27398,21 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 161 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 163 /* ConstructorType */, context); return signatureNode; } } var savedFlags = context.flags; - context.flags |= ts.NodeBuilderFlags.InObjectTypeLiteral; + context.flags |= 4194304 /* InObjectTypeLiteral */; var members = createTypeNodesFromResolvedType(resolved); context.flags = savedFlags; var typeLiteralNode = ts.createTypeLiteralNode(members); - return ts.setEmitFlags(typeLiteralNode, 1 /* SingleLine */); + return ts.setEmitFlags(typeLiteralNode, (context.flags & 1024 /* MultilineObjectLiterals */) ? 0 : 1 /* SingleLine */); } function createTypeQueryNodeFromSymbol(symbol, symbolFlags) { var entityName = symbolToName(symbol, context, symbolFlags, /*expectsIdentifier*/ false); @@ -26515,7 +27426,7 @@ var ts; function typeReferenceToTypeNode(type) { var typeArguments = type.typeArguments || ts.emptyArray; if (type.target === globalArrayType) { - if (context.flags & ts.NodeBuilderFlags.WriteArrayAsGenericType) { + if (context.flags & 2 /* WriteArrayAsGenericType */) { var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context); return ts.createTypeReferenceNode("Array", [typeArgumentNode]); } @@ -26529,12 +27440,17 @@ var ts; return ts.createTupleTypeNode(tupleConstituentNodes); } } - if (context.encounteredError || (context.flags & ts.NodeBuilderFlags.AllowEmptyTuple)) { + if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { return ts.createTupleTypeNode([]); } context.encounteredError = true; return undefined; } + else if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && + type.symbol.valueDeclaration && + type.symbol.valueDeclaration.kind === 203 /* ClassExpression */) { + return createAnonymousTypeNode(type); + } else { var outerTypeParameters = type.target.outerTypeParameters; var i = 0; @@ -26606,14 +27522,17 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 156 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 158 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context)); + var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? + createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : + resolvedType.stringIndexInfo; + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -26624,9 +27543,25 @@ var ts; } for (var _d = 0, properties_1 = properties; _d < properties_1.length; _d++) { var propertySymbol = properties_1[_d]; - var propertyType = getTypeOfSymbol(propertySymbol); + if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) { + if (propertySymbol.flags & 4194304 /* Prototype */) { + continue; + } + if (ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 /* Private */ | 16 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) { + context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName)); + } + } + var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; + if (ts.getCheckFlags(propertySymbol) & 1024 /* Late */) { + var decl = ts.firstOrUndefined(propertySymbol.declarations); + var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); + if (name && context.tracker.trackSymbol) { + context.tracker.trackSymbol(name, saveEnclosingDeclaration, 107455 /* Value */); + } + } var propertyName = symbolToName(propertySymbol, context, 107455 /* Value */, /*expectsIdentifier*/ true); context.enclosingDeclaration = saveEnclosingDeclaration; var optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? ts.createToken(55 /* QuestionToken */) : undefined; @@ -26634,15 +27569,18 @@ var ts; var signatures = getSignaturesOfType(propertyType, 0 /* Call */); for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { var signature = signatures_1[_e]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 151 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(methodDeclaration); } } else { + var savedFlags = context.flags; + context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119 /* AnyKeyword */); - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined; + context.flags = savedFlags; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined; var propertySignature = ts.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode, /*initializer*/ undefined); typeElements.push(propertySignature); @@ -26666,27 +27604,37 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 136 /* StringKeyword */ : 133 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 137 /* StringKeyword */ : 134 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name, /*questionToken*/ undefined, indexerTypeNode, /*initializer*/ undefined); - var typeNode = typeToTypeNodeHelper(indexInfo.type, context); + var typeNode = indexInfo.type ? typeToTypeNodeHelper(indexInfo.type, context) : typeToTypeNodeHelper(anyType, context); + if (!indexInfo.type && !(context.flags & 2097152 /* AllowEmptyIndexInfoType */)) { + context.encounteredError = true; + } return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { - var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + var typeParameters; + var typeArguments; + if (context.flags & 32 /* WriteTypeArgumentsOfSignature */ && signature.target && signature.mapper && signature.target.typeParameters) { + typeArguments = signature.target.typeParameters.map(function (parameter) { return typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context); }); + } + else { + typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + } var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); } var returnTypeNode; - if (signature.typePredicate) { - var typePredicate = signature.typePredicate; + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { var parameterName = typePredicate.kind === 1 /* Identifier */ ? ts.setEmitFlags(ts.createIdentifier(typePredicate.parameterName), 16777216 /* NoAsciiEscaping */) : ts.createThisTypeNode(); @@ -26697,7 +27645,7 @@ var ts; var returnType = getReturnTypeOfSignature(signature); returnTypeNode = returnType && typeToTypeNodeHelper(returnType, context); } - if (context.flags & ts.NodeBuilderFlags.SuppressAnyReturnType) { + if (context.flags & 256 /* SuppressAnyReturnType */) { if (returnTypeNode && returnTypeNode.kind === 119 /* AnyKeyword */) { returnTypeNode = undefined; } @@ -26705,25 +27653,28 @@ var ts; else if (!returnTypeNode) { returnTypeNode = ts.createKeywordTypeNode(119 /* AnyKeyword */); } - return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode); + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments); } - function typeParameterToDeclaration(type, context) { + function typeParameterToDeclaration(type, context, constraint) { + if (constraint === void 0) { constraint = getConstraintFromTypeParameter(type); } + var savedContextFlags = context.flags; + context.flags &= ~512 /* WriteTypeParametersInQualifiedName */; // Avoids potential infinite loop when building for a claimspace with a generic var name = symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ true); - var constraint = getConstraintFromTypeParameter(type); var constraintNode = constraint && typeToTypeNodeHelper(constraint, context); var defaultParameter = getDefaultFromTypeParameter(type); var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); + context.flags = savedContextFlags; return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); } function symbolToParameterDeclaration(parameterSymbol, context) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 147 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148 /* Parameter */); ts.Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter); var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { parameterType = getOptionalType(parameterType); } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); - var modifiers = parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); + var modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); var dotDotDotToken = !parameterDeclaration || ts.isRestParameter(parameterDeclaration) ? ts.createToken(24 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? @@ -26742,54 +27693,29 @@ var ts; function elideInitializerAndSetEmitFlags(node) { var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 177 /* BindingElement */) { + if (clone.kind === 180 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); } } } - function symbolToName(symbol, context, meaning, expectsIdentifier) { + function lookupSymbolChain(symbol, context, meaning) { + context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & ts.NodeBuilderFlags.UseFullyQualifiedType)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */)) { chain = getSymbolChain(symbol, meaning, /*endOfChain*/ true); ts.Debug.assert(chain && chain.length > 0); } else { chain = [symbol]; } - if (expectsIdentifier && chain.length !== 1 - && !context.encounteredError - && !(context.flags & ts.NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { - context.encounteredError = true; - } - return createEntityNameFromSymbolChain(chain, chain.length - 1); - function createEntityNameFromSymbolChain(chain, index) { - ts.Debug.assert(chain && 0 <= index && index < chain.length); - var symbol = chain[index]; - var typeParameterNodes; - if (context.flags & ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName && index > 0) { - var parentSymbol = chain[index - 1]; - var typeParameters = void 0; - if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); - } - else { - var targetSymbol = getTargetSymbol(parentSymbol); - if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { - typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - } - } - typeParameterNodes = mapToTypeNodes(typeParameters, context); - } - var identifier = ts.setEmitFlags(ts.createIdentifier(getNameOfSymbolAsWritten(symbol, context), typeParameterNodes), 16777216 /* NoAsciiEscaping */); - return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; - } + return chain; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); var parentSymbol; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { @@ -26817,11 +27743,105 @@ var ts; } } } + function typeParametersToTypeParameterDeclarations(symbol, context) { + var typeParameterNodes; + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { + typeParameterNodes = ts.createNodeArray(ts.map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), function (tp) { return typeParameterToDeclaration(tp, context); })); + } + return typeParameterNodes; + } + function lookupTypeParameterNodes(chain, index, context) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterNodes; + if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { + var parentSymbol = symbol; + var nextSymbol = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); + typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + } + else { + typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); + } + } + return typeParameterNodes; + } + function symbolToName(symbol, context, meaning, expectsIdentifier) { + var chain = lookupSymbolChain(symbol, context, meaning); + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & 65536 /* AllowQualifedNameInPlaceOfIdentifier */)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216 /* InInitialEntityName */; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216 /* InInitialEntityName */; + } + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + identifier.symbol = symbol; + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + } + function symbolToExpression(symbol, context, meaning) { + var chain = lookupSymbolChain(symbol, context, meaning); + return createExpressionFromSymbolChain(chain, chain.length - 1); + function createExpressionFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216 /* InInitialEntityName */; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216 /* InInitialEntityName */; + } + var firstChar = symbolName.charCodeAt(0); + var canUsePropertyAccess = ts.isIdentifierStart(firstChar, languageVersion); + if (index === 0 || canUsePropertyAccess) { + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + identifier.symbol = symbol; + return index > 0 ? ts.createPropertyAccess(createExpressionFromSymbolChain(chain, index - 1), identifier) : identifier; + } + else { + if (firstChar === 91 /* openBracket */) { + symbolName = symbolName.substring(1, symbolName.length - 1); + firstChar = symbolName.charCodeAt(0); + } + var expression = void 0; + if (ts.isSingleOrDoubleQuote(firstChar)) { + expression = ts.createLiteral(symbolName.substring(1, symbolName.length - 1).replace(/\\./g, function (s) { return s.substring(1); })); + expression.singleQuote = firstChar === 39 /* singleQuote */; + } + else if (("" + +symbolName) === symbolName) { + expression = ts.createLiteral(+symbolName); + } + if (!expression) { + expression = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + expression.symbol = symbol; + } + return ts.createElementAccess(createExpressionFromSymbolChain(chain, index - 1), expression); + } + } + } } - function typePredicateToString(typePredicate, enclosingDeclaration, flags) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); - }); + function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) { + return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); + function typePredicateToStringWorker(writer) { + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); + return writer; + } } function formatUnionTypes(types) { var result = []; @@ -26861,8 +27881,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 169 /* ParenthesizedType */; }); - if (node.kind === 232 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 172 /* ParenthesizedType */; }); + if (node.kind === 235 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -26870,12 +27890,15 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 235 /* ModuleBlock */ && + node.parent.kind === 238 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? '"' + ts.escapeString(type.value) + '"' : "" + type.value; } + function isDefaultBindingContext(location) { + return location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location); + } /** * Gets a human-readable name for a symbol. * Should *not* be used for the right-hand side of a `.` -- use `symbolName(symbol)` for that instead. @@ -26884,23 +27907,32 @@ var ts; * It will also use a representation of a number as written instead of a decimal form, e.g. `0o11` instead of `9`. */ function getNameOfSymbolAsWritten(symbol, context) { + if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && + // If it's not the first part of an entity name, it must print as `default` + (!(context.flags & 16777216 /* InInitialEntityName */) || + // if the symbol is synthesized, it will only be referenced externally it must print as `default` + !symbol.declarations || + // if not in the same binding context (source file, module declaration), it must print as `default` + (context.enclosingDeclaration && ts.findAncestor(symbol.declarations[0], isDefaultBindingContext) !== ts.findAncestor(context.enclosingDeclaration, isDefaultBindingContext)))) { + return "default"; + } if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; var name = ts.getNameOfDeclaration(declaration); if (name) { return ts.declarationNameToString(name); } - if (declaration.parent && declaration.parent.kind === 227 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } - if (context && !context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowAnonymousIdentifier)) { + if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } switch (declaration.kind) { - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return "(Anonymous class)"; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return "(Anonymous function)"; } } @@ -26912,727 +27944,6 @@ var ts; } return ts.symbolName(symbol); } - function getSymbolDisplayBuilder() { - /** - * Writes only the name of the symbol out to the writer. Uses the original source text - * for the name of the symbol if it is available to match how the user wrote the name. - */ - function appendSymbolNameOnly(symbol, writer) { - writer.writeSymbol(getNameOfSymbolAsWritten(symbol), symbol); - } - /** - * Writes a property access or element access with the name of the symbol out to the writer. - * Uses the original source text for the name of the symbol if it is available to match how the user wrote the name, - * ensuring that any names written with literals use element accesses. - */ - function appendPropertyOrElementAccessForSymbol(symbol, writer) { - var symbolName = symbol.escapedName === "default" ? "default" : getNameOfSymbolAsWritten(symbol); - var firstChar = symbolName.charCodeAt(0); - var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); - if (needsElementAccess) { - if (firstChar !== 91 /* openBracket */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - } - if (ts.isSingleOrDoubleQuote(firstChar)) { - writer.writeStringLiteral(symbolName); - } - else { - writer.writeSymbol(symbolName, symbol); - } - if (firstChar !== 91 /* openBracket */) { - writePunctuation(writer, 22 /* CloseBracketToken */); - } - } - else { - writePunctuation(writer, 23 /* DotToken */); - writer.writeSymbol(symbolName, symbol); - } - } - /** - * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope - * Meaning needs to be specified if the enclosing declaration is given - */ - function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { - var parentSymbol; - function appendParentTypeArgumentsAndSymbolName(symbol) { - if (parentSymbol) { - // Write type arguments of instantiated class/interface here - if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - buildDisplayForTypeArgumentsAndDelimiters(params, symbol.mapper, writer, enclosingDeclaration); - } - else { - buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - appendPropertyOrElementAccessForSymbol(symbol, writer); - } - else { - appendSymbolNameOnly(symbol, writer); - } - parentSymbol = symbol; - } - // Let the writer know we just wrote out a symbol. The declaration emitter writer uses - // this to determine if an import it has previously seen (and not written out) needs - // to be written to the file once the walk of the tree is complete. - // - // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree - // up front (for example, during checking) could determine if we need to emit the imports - // and we could then access that data during declaration emit. - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ - function walkSymbol(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - // Go up and add our parent. - var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent) { - walkSymbol(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); - } - } - if (accessibleSymbolChain) { - for (var _i = 0, accessibleSymbolChain_1 = accessibleSymbolChain; _i < accessibleSymbolChain_1.length; _i++) { - var accessibleSymbol = accessibleSymbolChain_1[_i]; - appendParentTypeArgumentsAndSymbolName(accessibleSymbol); - } - } - else if ( - // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. - endOfChain || - // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) - !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && - // If a parent symbol is an anonymous type, don't write it. - !(symbol.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - // Get qualified name if the symbol is not a type parameter - // and there is an enclosing declaration or we specifically - // asked for it - var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - var typeFormatFlag = 256 /* UseFullyQualifiedType */ & typeFlags; - if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { - walkSymbol(symbol, meaning, /*endOfChain*/ true); - } - else { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, symbolStack) { - var globalFlagsToPass = globalFlags & (32 /* WriteOwnNameForAnyLike */ | 16384 /* WriteClassExpressionAsTypeLiteral */); - var inObjectTypeLiteral = false; - return writeType(type, globalFlags); - function writeType(type, flags) { - var nextFlags = flags & ~1024 /* InTypeAlias */; - // Write undefined/null type as any - if (type.flags & 33585807 /* Intrinsic */) { - // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving - writer.writeKeyword(!(globalFlags & 32 /* WriteOwnNameForAnyLike */) && isTypeAny(type) - ? "any" - : type.intrinsicName); - } - else if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { - if (inObjectTypeLiteral) { - writer.reportInaccessibleThisError(); - } - writer.writeKeyword("this"); - } - else if (ts.getObjectFlags(type) & 4 /* Reference */) { - writeTypeReference(type, nextFlags); - } - else if (type.flags & 256 /* EnumLiteral */ && !(type.flags & 131072 /* Union */)) { - var parent = getParentOfSymbol(type.symbol); - buildSymbolDisplay(parent, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); - // In a literal enum type with a single member E { A }, E and E.A denote the - // same type. We always display this type simply as E. - if (getDeclaredTypeOfSymbol(parent) !== type) { - writePunctuation(writer, 23 /* DotToken */); - appendSymbolNameOnly(type.symbol, writer); - } - } - else if (ts.getObjectFlags(type) & 3 /* ClassOrInterface */ || type.flags & (272 /* EnumLike */ | 32768 /* TypeParameter */)) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); - } - else if (!(flags & 1024 /* InTypeAlias */) && type.aliasSymbol && - ((flags & 65536 /* UseAliasDefinedOutsideCurrentScope */) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); - } - else if (type.flags & 393216 /* UnionOrIntersection */) { - writeUnionOrIntersectionType(type, nextFlags); - } - else if (ts.getObjectFlags(type) & (16 /* Anonymous */ | 32 /* Mapped */)) { - writeAnonymousType(type, nextFlags); - } - else if (type.flags & 1024 /* UniqueESSymbol */) { - if (flags & 131072 /* AllowUniqueESSymbolType */) { - writeKeyword(writer, 140 /* UniqueKeyword */); - writeSpace(writer); - } - else { - writer.reportInaccessibleUniqueSymbolError(); - } - writeKeyword(writer, 137 /* SymbolKeyword */); - } - else if (type.flags & 96 /* StringOrNumberLiteral */) { - writer.writeStringLiteral(literalTypeToString(type)); - } - else if (type.flags & 524288 /* Index */) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writer.writeKeyword("keyof"); - writeSpace(writer); - writeType(type.type, 128 /* InElementType */); - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - else if (type.flags & 1048576 /* IndexedAccess */) { - writeType(type.objectType, 128 /* InElementType */); - writePunctuation(writer, 21 /* OpenBracketToken */); - writeType(type.indexType, 0 /* None */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else { - // Should never get here - // { ... } - writePunctuation(writer, 17 /* OpenBraceToken */); - writeSpace(writer); - writePunctuation(writer, 24 /* DotDotDotToken */); - writeSpace(writer); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - } - function writeTypeList(types, delimiter) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - if (delimiter !== 26 /* CommaToken */) { - writeSpace(writer); - } - writePunctuation(writer, delimiter); - writeSpace(writer); - } - writeType(types[i], delimiter === 26 /* CommaToken */ ? 0 /* None */ : 128 /* InElementType */); - } - } - function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) { - // Unnamed function expressions and arrow functions have reserved names that we don't want to display - if (symbol.flags & 32 /* Class */ || !isReservedMemberName(symbol.escapedName)) { - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, flags); - } - if (pos < end) { - writePunctuation(writer, 27 /* LessThanToken */); - writeType(typeArguments[pos], 512 /* InFirstTypeArgument */); - pos++; - while (pos < end) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - writeType(typeArguments[pos], 0 /* None */); - pos++; - } - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function writeTypeReference(type, flags) { - var typeArguments = type.typeArguments || ts.emptyArray; - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(typeArguments[0], 128 /* InElementType */ | 32768 /* InArrayType */); - writePunctuation(writer, 21 /* OpenBracketToken */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else if (type.target.objectFlags & 8 /* Tuple */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 26 /* CommaToken */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else if (flags & 16384 /* WriteClassExpressionAsTypeLiteral */ && - type.symbol.valueDeclaration && - type.symbol.valueDeclaration.kind === 200 /* ClassExpression */) { - writeAnonymousType(type, flags); - } - else { - // Write the type reference in the format f.g.C where A and B are type arguments - // for outer type parameters, and f and g are the respective declaring containers of those - // type parameters. - var outerTypeParameters = type.target.outerTypeParameters; - var i = 0; - if (outerTypeParameters) { - var length_2 = outerTypeParameters.length; - while (i < length_2) { - // Find group of type arguments for type parameters with the same declaring container. - var start = i; - var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); - do { - i++; - } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); - // When type parameters are their own type arguments for the whole group (i.e. we have - // the default outer type arguments), we don't show the group. - if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent, typeArguments, start, i, flags); - writePunctuation(writer, 23 /* DotToken */); - } - } - } - var typeParameterCount = (type.target.typeParameters || ts.emptyArray).length; - writeSymbolTypeReference(type.symbol, typeArguments, i, typeParameterCount, flags); - } - } - function writeUnionOrIntersectionType(type, flags) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - if (type.flags & 131072 /* Union */) { - writeTypeList(formatUnionTypes(type.types), 49 /* BarToken */); - } - else { - writeTypeList(type.types, 48 /* AmpersandToken */); - } - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - function writeAnonymousType(type, flags) { - var symbol = type.symbol; - if (symbol) { - // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && - !getBaseTypeVariableOfClass(symbol) && - !(symbol.valueDeclaration.kind === 200 /* ClassExpression */ && flags & 16384 /* WriteClassExpressionAsTypeLiteral */) || - symbol.flags & (384 /* Enum */ | 512 /* ValueModule */)) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (ts.contains(symbolStack, symbol)) { - // If type is an anonymous type literal in a type alias declaration, use type alias name - var typeAlias = getTypeAliasForTypeLiteral(type); - if (typeAlias) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, flags); - } - else { - // Recursive usage, use any - writeKeyword(writer, 119 /* AnyKeyword */); - } - } - else { - // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead - // of types allows us to catch circular references to instantiations of the same anonymous type - // However, in case of class expressions, we want to write both the static side and the instance side. - // We skip adding the static side so that the instance side has a chance to be written - // before checking for circular references. - if (!symbolStack) { - symbolStack = []; - } - var isConstructorObject = type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; - if (isConstructorObject) { - writeLiteralType(type, flags); - } - else { - symbolStack.push(symbol); - writeLiteralType(type, flags); - symbolStack.pop(); - } - } - } - else { - // Anonymous types with no symbol are never circular - writeLiteralType(type, flags); - } - function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method - ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32 /* Static */); }); - var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || // is exported function symbol - ts.some(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; - })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - // typeof is allowed only for static/non local functions - return !!(flags & 4 /* UseTypeOfFunction */) || // use typeof if format flags specify it - ts.contains(symbolStack, symbol); // it is type of the symbol uses itself recursively - } - } - } - function writeTypeOfSymbol(symbol, typeFormatFlags) { - if (typeFormatFlags & 32768 /* InArrayType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writeKeyword(writer, 103 /* TypeOfKeyword */); - writeSpace(writer); - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); - if (typeFormatFlags & 32768 /* InArrayType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - function writePropertyWithModifiers(prop) { - if (isReadonlySymbol(prop)) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - if (ts.getCheckFlags(prop) & 1024 /* Late */) { - var decl = ts.firstOrUndefined(prop.declarations); - var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); - if (name) { - writer.trackSymbol(name, enclosingDeclaration, 107455 /* Value */); - } - } - buildSymbolDisplay(prop, writer); - if (prop.flags & 16777216 /* Optional */) { - writePunctuation(writer, 55 /* QuestionToken */); - } - } - function shouldAddParenthesisAroundFunctionType(callSignature, flags) { - if (flags & 128 /* InElementType */) { - return true; - } - else if (flags & 512 /* InFirstTypeArgument */) { - // Add parenthesis around function type for the first type argument to avoid ambiguity - var typeParameters = callSignature.target && (flags & 64 /* WriteTypeArgumentsOfSignature */) ? - callSignature.target.typeParameters : callSignature.typeParameters; - return typeParameters && typeParameters.length !== 0; - } - return false; - } - function writeLiteralType(type, flags) { - if (isGenericMappedType(type)) { - writeMappedType(type); - return; - } - var resolved = resolveStructuredTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 17 /* OpenBraceToken */); - writePunctuation(writer, 18 /* CloseBraceToken */); - return; - } - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags); - if (parenthesizeSignature) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); - if (parenthesizeSignature) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writeKeyword(writer, 94 /* NewKeyword */); - writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - return; - } - } - var saveInObjectTypeLiteral = inObjectTypeLiteral; - inObjectTypeLiteral = true; - writePunctuation(writer, 17 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - writeObjectLiteralType(resolved); - writer.decreaseIndent(); - writePunctuation(writer, 18 /* CloseBraceToken */); - inObjectTypeLiteral = saveInObjectTypeLiteral; - } - function writeObjectLiteralType(resolved) { - for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { - var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { - var signature = _c[_b]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1 /* Construct */, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0 /* String */, enclosingDeclaration, globalFlags, symbolStack); - buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1 /* Number */, enclosingDeclaration, globalFlags, symbolStack); - for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { - var p = _e[_d]; - if (globalFlags & 16384 /* WriteClassExpressionAsTypeLiteral */) { - if (p.flags & 4194304 /* Prototype */) { - continue; - } - if (ts.getDeclarationModifierFlagsFromSymbol(p) & (8 /* Private */ | 16 /* Protected */)) { - writer.reportPrivateInBaseOfClassExpression(ts.symbolName(p)); - } - } - var t = getTypeOfSymbol(p); - if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { - var signature = signatures_2[_f]; - writePropertyWithModifiers(p); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - else { - writePropertyWithModifiers(p); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - writeType(t, globalFlags & 16384 /* WriteClassExpressionAsTypeLiteral */); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - } - function writeMappedType(type) { - writePunctuation(writer, 17 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - if (type.declaration.readonlyToken) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 21 /* OpenBracketToken */); - appendSymbolNameOnly(getTypeParameterFromMappedType(type).symbol, writer); - writeSpace(writer); - writeKeyword(writer, 92 /* InKeyword */); - writeSpace(writer); - writeType(getConstraintTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 22 /* CloseBracketToken */); - if (type.declaration.questionToken) { - writePunctuation(writer, 55 /* QuestionToken */); - } - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - writeType(getTemplateTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - writer.decreaseIndent(); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - } - function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration, flags) { - var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */ || targetSymbol.flags & 524288 /* TypeAlias */) { - buildDisplayForTypeParametersAndDelimiters(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), writer, enclosingDeclaration, flags); - } - } - function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, symbolStack) { - appendSymbolNameOnly(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 85 /* ExtendsKeyword */); - writeSpace(writer); - buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); - } - var defaultType = getDefaultFromTypeParameter(tp); - if (defaultType) { - writeSpace(writer); - writePunctuation(writer, 58 /* EqualsToken */); - writeSpace(writer); - buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { - var parameterNode = p.valueDeclaration; - if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { - writePunctuation(writer, 24 /* DotDotDotToken */); - } - if (parameterNode && ts.isBindingPattern(parameterNode.name)) { - buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - appendSymbolNameOnly(p, writer); - } - if (parameterNode && isOptionalParameter(parameterNode)) { - writePunctuation(writer, 55 /* QuestionToken */); - } - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - var type = getTypeOfSymbol(p); - if (parameterNode && isRequiredInitializedParameter(parameterNode)) { - type = getOptionalType(type); - } - buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - // We have to explicitly emit square bracket and bracket because these tokens are not stored inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { - writePunctuation(writer, 17 /* OpenBraceToken */); - buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - var elements = bindingPattern.elements; - buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - if (elements && elements.hasTrailingComma) { - writePunctuation(writer, 26 /* CommaToken */); - } - writePunctuation(writer, 22 /* CloseBracketToken */); - } - } - function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isOmittedExpression(bindingElement)) { - return; - } - ts.Debug.assert(bindingElement.kind === 177 /* BindingElement */); - if (bindingElement.propertyName) { - writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - } - if (ts.isBindingPattern(bindingElement.name)) { - buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - if (bindingElement.dotDotDotToken) { - writePunctuation(writer, 24 /* DotDotDotToken */); - } - appendSymbolNameOnly(bindingElement.symbol, writer); - } - } - function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27 /* LessThanToken */); - buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function buildDisplayForCommaSeparatedList(list, writer, action) { - for (var i = 0; i < list.length; i++) { - if (i > 0) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - } - action(list[i]); - } - } - function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27 /* LessThanToken */); - var flags = 512 /* InFirstTypeArgument */; - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - flags = 0 /* None */; - } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags); - } - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) { - writePunctuation(writer, 19 /* OpenParenToken */); - if (thisParameter) { - buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack); - } - for (var i = 0; i < parameters.length; i++) { - if (i > 0 || thisParameter) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - } - buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack); - } - writePunctuation(writer, 20 /* CloseParenToken */); - } - function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isIdentifierTypePredicate(predicate)) { - writer.writeParameter(predicate.parameterName); - } - else { - writeKeyword(writer, 99 /* ThisKeyword */); - } - writeSpace(writer); - writeKeyword(writer, 126 /* IsKeyword */); - writeSpace(writer); - buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { - var returnType = getReturnTypeOfSignature(signature); - if (flags & 4096 /* SuppressAnyReturnType */ && isTypeAny(returnType)) { - return; - } - if (flags & 16 /* WriteArrowStyleSignature */) { - writeSpace(writer); - writePunctuation(writer, 36 /* EqualsGreaterThanToken */); - } - else { - writePunctuation(writer, 56 /* ColonToken */); - } - writeSpace(writer); - if (signature.typePredicate) { - buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); - } - else { - buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { - if (kind === 1 /* Construct */) { - writeKeyword(writer, 94 /* NewKeyword */); - writeSpace(writer); - } - if (signature.target && (flags & 64 /* WriteTypeArgumentsOfSignature */)) { - // Instantiated signature, write type arguments instead - // This is achieved by passing in the mapper separately - buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, symbolStack); - } - buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); - buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); - } - function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 21 /* OpenBracketToken */); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - switch (kind) { - case 1 /* Number */: - writeKeyword(writer, 133 /* NumberKeyword */); - break; - case 0 /* String */: - writeKeyword(writer, 136 /* StringKeyword */); - break; - } - writePunctuation(writer, 22 /* CloseBracketToken */); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - return _displayBuilder || (_displayBuilder = { - buildSymbolDisplay: buildSymbolDisplay, - buildTypeDisplay: buildTypeDisplay, - buildTypeParameterDisplay: buildTypeParameterDisplay, - buildTypePredicateDisplay: buildTypePredicateDisplay, - buildParameterDisplay: buildParameterDisplay, - buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, - buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, - buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, - buildSignatureDisplay: buildSignatureDisplay, - buildIndexSignatureDisplay: buildIndexSignatureDisplay, - buildReturnTypeDisplay: buildReturnTypeDisplay - }); - } function isDeclarationVisible(node) { if (node) { var links = getNodeLinks(node); @@ -27644,22 +27955,22 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 229 /* FunctionDeclaration */: - case 233 /* EnumDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 236 /* EnumDeclaration */: + case 241 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -27667,53 +27978,53 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 238 /* ImportEqualsDeclaration */ && parent.kind !== 269 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { + !(node.kind !== 241 /* ImportEqualsDeclaration */ && parent.kind !== 272 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 153 /* Constructor */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: - case 147 /* Parameter */: - case 235 /* ModuleBlock */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 160 /* TypeReference */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: + case 148 /* Parameter */: + case 238 /* ModuleBlock */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 161 /* TypeReference */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 172 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: return false; // Type parameters are always visible - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: // Source file and namespace export are always visible - case 269 /* SourceFile */: - case 237 /* NamespaceExportDeclaration */: + case 272 /* SourceFile */: + case 240 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return false; default: return false; @@ -27722,10 +28033,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 244 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 247 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 247 /* ExportSpecifier */) { + else if (node.parent.kind === 250 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -27770,8 +28081,8 @@ var ts; var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found - var length_3 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_3; i++) { + var length_2 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_2; i++) { resolutionResults[i] = false; } return false; @@ -27805,6 +28116,10 @@ var ts; if (propertyName === 3 /* ResolvedReturnType */) { return target.resolvedReturnType; } + if (propertyName === 4 /* ResolvedBaseConstraint */) { + var bc = target.resolvedBaseConstraint; + return bc && bc !== circularConstraintType; + } ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName); } // Pop an entry from the type resolution stack and return its associated result value. The result value will @@ -27817,12 +28132,12 @@ var ts; function getDeclarationContainer(node) { node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 227 /* VariableDeclaration */: - case 228 /* VariableDeclarationList */: - case 243 /* ImportSpecifier */: - case 242 /* NamedImports */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 230 /* VariableDeclaration */: + case 231 /* VariableDeclarationList */: + case 246 /* ImportSpecifier */: + case 245 /* NamedImports */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: return false; default: return true; @@ -27853,7 +28168,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 145 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 146 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 12288 /* Nullable */); }); @@ -27900,7 +28215,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 175 /* ObjectBindingPattern */) { + if (pattern.kind === 178 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -27929,7 +28244,8 @@ var ts; if (strictNullChecks && declaration.flags & 2097152 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } - var declaredType = getTypeOfPropertyOfType(parentType, text); + var propType = getTypeOfPropertyOfType(parentType, text); + var declaredType = propType && getApparentTypeForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); @@ -27950,7 +28266,7 @@ var ts; } else { // Use specific property type when parent is a tuple or numeric index type when parent is an array - var propName = "" + ts.indexOf(pattern.elements, declaration); + var propName = "" + pattern.elements.indexOf(declaration); type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : elementType; @@ -27971,7 +28287,7 @@ var ts; type = getTypeWithFacts(type, 131072 /* NEUndefined */); } return declaration.initializer ? - getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : + getUnionType([type, checkExpressionCached(declaration.initializer)], 2 /* Subtype */) : type; } function getTypeForDeclarationFromJSDocComment(declaration) { @@ -27987,7 +28303,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 178 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 181 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -27997,11 +28313,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (declaration.parent.parent.kind === 216 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 219 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (32768 /* TypeParameter */ | 524288 /* Index */) ? indexType : stringType; } - if (declaration.parent.parent.kind === 217 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 220 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -28012,14 +28328,14 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } + var isOptional = !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken && includeOptionality; // Use type from type annotation if one is present - var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - var declaredType = getTypeFromTypeNode(typeNode); - return addOptionality(declaredType, /*optional*/ !!declaration.questionToken && includeOptionality); + var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (declaredType) { + return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) && - declaration.kind === 227 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 230 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 2097152 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -28033,11 +28349,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 155 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 154 /* GetAccessor */); + if (func.kind === 156 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -28058,23 +28374,19 @@ var ts; type = getContextuallyTypedParameterType(declaration); } if (type) { - return addOptionality(type, /*optional*/ !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } } // Use the type of the initializer expression if one is present if (declaration.initializer) { var type = checkDeclarationInitializer(declaration); - return addOptionality(type, /*optional*/ !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } if (ts.isJsxAttribute(declaration)) { // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true. // I.e is sugar for return trueType; } - // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 266 /* ShorthandPropertyAssignment */) { - return checkIdentifier(declaration.name); - } // If the declaration specifies a binding pattern, use the type implied by the binding pattern if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true); @@ -28089,14 +28401,14 @@ var ts; var jsDocType; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - var expression = declaration.kind === 195 /* BinaryExpression */ ? declaration : - declaration.kind === 180 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 195 /* BinaryExpression */) : + var expression = declaration.kind === 198 /* BinaryExpression */ ? declaration : + declaration.kind === 183 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 198 /* BinaryExpression */) : undefined; if (!expression) { return unknownType; } if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99 /* ThisKeyword */) { - if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 153 /* Constructor */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 154 /* Constructor */) { definedInConstructor = true; } else { @@ -28121,7 +28433,7 @@ var ts; types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); } } - var type = jsDocType || getUnionType(types, /*subtypeReduction*/ true); + var type = jsDocType || getUnionType(types, 2 /* Subtype */); return getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor)); } // Return the type implied by a binding pattern element. This is the type of the initializer of the element if @@ -28195,7 +28507,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 175 /* ObjectBindingPattern */ + return pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -28215,19 +28527,13 @@ var ts; reportErrorsFromWidening(declaration, type); } // always widen a 'unique symbol' type if the type was created for a different declaration. - if (type.flags & 1024 /* UniqueESSymbol */ && !declaration.type && type.symbol !== getSymbolOfNode(declaration)) { + if (type.flags & 1024 /* UniqueESSymbol */ && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) { type = esSymbolType; } - // During a normal type check we'll never get to here with a property assignment (the check of the containing - // object literal uses a different path). We exclude widening only so that language services and type verification - // tools see the actual type. - if (declaration.kind === 265 /* PropertyAssignment */) { - return type; - } return getWidenedType(type); } // Rest parameters default to type any[], other parameters default to type any - type = declaration.dotDotDotToken ? anyArrayType : anyType; + type = ts.isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType; // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { @@ -28238,9 +28544,15 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 147 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 148 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } + function tryGetTypeFromEffectiveTypeNode(declaration) { + var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -28254,7 +28566,7 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 244 /* ExportAssignment */) { + if (declaration.kind === 247 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) { @@ -28270,13 +28582,43 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 195 /* BinaryExpression */ || - declaration.kind === 180 /* PropertyAccessExpression */ && declaration.parent.kind === 195 /* BinaryExpression */) { + if (declaration.kind === 198 /* BinaryExpression */ || + declaration.kind === 183 /* PropertyAccessExpression */ && declaration.parent.kind === 198 /* BinaryExpression */) { type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } - else { + else if (ts.isJSDocPropertyTag(declaration) + || ts.isPropertyAccessExpression(declaration) + || ts.isIdentifier(declaration) + || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration)) + || ts.isMethodSignature(declaration)) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType; + } + else if (ts.isPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } + else if (ts.isJsxAttribute(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } + else if (ts.isShorthandPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */); + } + else if (ts.isObjectLiteralMethod(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */); + } + else if (ts.isParameter(declaration) + || ts.isPropertyDeclaration(declaration) + || ts.isPropertySignature(declaration) + || ts.isVariableDeclaration(declaration) + || ts.isBindingElement(declaration)) { type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } + else { + ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration)); + } if (!popTypeResolution()) { type = reportCircularityError(symbol); } @@ -28286,7 +28628,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); } @@ -28307,8 +28649,8 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 155 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 156 /* SetAccessor */); if (getter && ts.isInJavaScriptFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -28352,7 +28694,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -28443,6 +28785,9 @@ var ts; if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } + if (ts.getCheckFlags(symbol) & 2048 /* ReverseMapped */) { + return getTypeOfReverseMappedSymbol(symbol); + } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } @@ -28500,29 +28845,33 @@ var ts; return undefined; } switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 173 /* MappedType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 176 /* MappedType */: + case 170 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 173 /* MappedType */) { + if (node.kind === 176 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } + else if (node.kind === 170 /* ConditionalType */) { + return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node) || ts.emptyArray); var thisType = includeThisTypes && - (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */ || node.kind === 231 /* InterfaceDeclaration */) && + (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */ || node.kind === 234 /* InterfaceDeclaration */) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -28530,7 +28879,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); return getOuterTypeParameters(declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -28539,8 +28888,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 231 /* InterfaceDeclaration */ || node.kind === 230 /* ClassDeclaration */ || - node.kind === 200 /* ClassExpression */ || node.kind === 232 /* TypeAliasDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */ || node.kind === 233 /* ClassDeclaration */ || + node.kind === 203 /* ClassExpression */ || node.kind === 235 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -28656,10 +29005,10 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = ts.emptyArray; + type.resolvedBaseTypes = ts.resolvingEmptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (65536 /* Object */ | 262144 /* Intersection */ | 1 /* Any */))) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } var baseTypeNode = getBaseTypeNodeOfClass(type); var typeArgs = typeArgumentsFromTypeReferenceNode(baseTypeNode); @@ -28682,22 +29031,29 @@ var ts; var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); - return; + return type.resolvedBaseTypes = ts.emptyArray; } baseType = getReturnTypeOfSignature(constructors[0]); } if (baseType === unknownType) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { - error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); - return; + error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */)); + return type.resolvedBaseTypes = ts.emptyArray; } - type.resolvedBaseTypes = [baseType]; + if (type.resolvedBaseTypes === ts.resolvingEmptyArray) { + // Circular reference, likely through instantiation of default parameters + // (otherwise there'd be an error from hasBaseType) - this is fine, but `.members` should be reset + // as `getIndexedAccessType` via `instantiateType` via `getTypeFromClassOrInterfaceReference` forces a + // partial instantiation of the members without the base types fully resolved + type.members = undefined; + } + return type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { // An unapplied type parameter has its symbol still the same as the matching argument symbol. @@ -28713,14 +29069,14 @@ var ts; // A valid base type is `any`, any non-generic object type or intersection of non-generic // object types. function isValidBaseType(type) { - return type.flags & (65536 /* Object */ | 33554432 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + return type.flags & (65536 /* Object */ | 134217728 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || type.flags & 262144 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 234 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -28735,7 +29091,7 @@ var ts; } } else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */)); } } else { @@ -28756,7 +29112,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */) { + if (declaration.kind === 234 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -28814,9 +29170,9 @@ var ts; return unknownType; } var declaration = ts.find(symbol.declarations, function (d) { - return d.kind === 288 /* JSDocTypedefTag */ || d.kind === 232 /* TypeAliasDeclaration */; + return d.kind === 291 /* JSDocTypedefTag */ || d.kind === 235 /* TypeAliasDeclaration */; }); - var typeNode = declaration.kind === 288 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; + var typeNode = declaration.kind === 291 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; // If typeNode is missing, we will error in checkJSDocTypedefTag. var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType; if (popTypeResolution()) { @@ -28846,7 +29202,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 71 /* Identifier */: @@ -28863,7 +29219,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 9 /* StringLiteral */) { @@ -28890,7 +29246,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)); @@ -28900,7 +29256,7 @@ var ts; } } if (memberTypeList.length) { - var enumType_1 = getUnionType(memberTypeList, /*subtypeReduction*/ false, symbol, /*aliasTypeArguments*/ undefined); + var enumType_1 = getUnionType(memberTypeList, 1 /* Literal */, symbol, /*aliasTypeArguments*/ undefined); if (enumType_1.flags & 131072 /* Union */) { enumType_1.flags |= 256 /* EnumLiteral */; enumType_1.symbol = symbol; @@ -28970,20 +29326,20 @@ var ts; function isThislessType(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 134 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 177 /* LiteralType */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isThislessType(node.elementType); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -28998,7 +29354,7 @@ var ts; */ function isThislessVariableLikeDeclaration(node) { var typeNode = ts.getEffectiveTypeAnnotationNode(node); - return typeNode ? isThislessType(typeNode) : !node.initializer; + return typeNode ? isThislessType(typeNode) : !ts.hasInitializer(node); } /** * A function-like declaration is considered free of `this` references if it has a return type @@ -29007,7 +29363,7 @@ var ts; */ function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); - return (node.kind === 153 /* Constructor */ || (returnType && isThislessType(returnType))) && + return (node.kind === 154 /* Constructor */ || (returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter)); } @@ -29023,12 +29379,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -29260,18 +29616,19 @@ var ts; } return symbol; } - function getTypeWithThisArgument(type, thisArgument) { + function getTypeWithThisArgument(type, thisArgument, needApparentType) { if (ts.getObjectFlags(type) & 4 /* Reference */) { var target = type.target; var typeArguments = type.typeArguments; if (ts.length(target.typeParameters) === ts.length(typeArguments)) { - return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + var ref = createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + return needApparentType ? getApparentType(ref) : ref; } } else if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); })); } - return type; + return needApparentType ? getApparentType(type) : type; } function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) { var mapper; @@ -29301,6 +29658,7 @@ var ts; if (source.symbol && members === getMembersOfSymbol(source.symbol)) { members = ts.createSymbolTable(source.declaredProperties); } + setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); var thisArgument = ts.lastOrUndefined(typeArguments); for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; @@ -29328,27 +29686,30 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { + function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.thisParameter = thisParameter; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; + sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasLiteralTypes = hasLiteralTypes; + sig.target = undefined; + sig.mapper = undefined; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); + return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); } function getDefaultConstructSignatures(classType) { var baseConstructorType = getBaseConstructorTypeOfClass(classType); var baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); if (baseSignatures.length === 0) { - return [createSignature(undefined, classType.localTypeParameters, undefined, ts.emptyArray, classType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; + return [createSignature(undefined, classType.localTypeParameters, undefined, ts.emptyArray, classType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); @@ -29359,7 +29720,7 @@ var ts; var baseSig = baseSignatures_1[_i]; var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); var typeParamCount = ts.length(baseSig.typeParameters); - if (isJavaScript || (typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount)) { + if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; @@ -29418,13 +29779,13 @@ var ts; var s = signature; // Union the result types when more than one signature matches if (unionSignatures.length > 1) { - s = cloneSignature(signature); + var thisParameter = signature.thisParameter; if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { - var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), /*subtypeReduction*/ true); - s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); + var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType; }), 2 /* Subtype */); + thisParameter = createSymbolWithType(signature.thisParameter, thisType); } - // Clear resolved return type we possibly got from cloneSignature - s.resolvedReturnType = undefined; + s = cloneSignature(signature); + s.thisParameter = thisParameter; s.unionSignatures = unionSignatures; } (result || (result = [])).push(s); @@ -29446,7 +29807,7 @@ var ts; indexTypes.push(indexInfo.type); isAnyReadonly = isAnyReadonly || indexInfo.isReadonly; } - return createIndexInfo(getUnionType(indexTypes, /*subtypeReduction*/ true), isAnyReadonly); + return createIndexInfo(getUnionType(indexTypes, 2 /* Subtype */), isAnyReadonly); } function resolveUnionTypeMembers(type) { // The members and properties collections are empty for union types. To get all properties of a union @@ -29542,6 +29903,7 @@ var ts; if (symbol.exports) { members = getExportsOfSymbol(symbol); } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined); if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); var baseConstructorType = getBaseConstructorTypeOfClass(classType); @@ -29573,6 +29935,24 @@ var ts; } } } + function resolveReverseMappedTypeMembers(type) { + var indexInfo = getIndexInfoOfType(type.source, 0 /* String */); + var modifiers = getMappedTypeModifiers(type.mappedType); + var readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true; + var optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */; + var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); + var members = ts.createSymbolTable(); + for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { + var prop = _a[_i]; + var checkFlags = 2048 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); + var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); + inferredProp.declarations = prop.declarations; + inferredProp.propertyType = getTypeOfSymbol(prop); + inferredProp.mappedType = type.mappedType; + members.set(prop.escapedName, inferredProp); + } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); + } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); @@ -29583,13 +29963,12 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var templateType = getTemplateTypeFromMappedType(type); + var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' - var templateReadonly = !!type.declaration.readonlyToken; - var templateOptional = !!type.declaration.questionToken; + var templateModifiers = getMappedTypeModifiers(type); var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // We have a { [P in keyof T]: X } for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { var propertySymbol = _a[_i]; @@ -29603,7 +29982,7 @@ var ts; // First, if the constraint type is a type parameter, obtain the base constraint. Then, // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. // Finally, iterate over the constituents of the resulting iteration type. - var keyType = constraintType.flags & 1081344 /* TypeVariable */ ? getApparentType(constraintType) : constraintType; + var keyType = constraintType.flags & 7372800 /* InstantiableNonPrimitive */ ? getApparentType(constraintType) : constraintType; var iterationType = keyType.flags & 524288 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; forEachType(iterationType, addMemberForKeyType); } @@ -29627,10 +30006,17 @@ var ts; if (t.flags & 32 /* StringLiteral */) { var propName = ts.escapeLeadingUnderscores(t.value); var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 16777216 /* Optional */); - var checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; - var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, checkFlags); - prop.type = propType; + var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || + !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); + var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || + !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp)); + var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, isReadonly ? 8 /* Readonly */ : 0); + // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the + // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks + // mode, if the underlying property is optional we remove 'undefined' from the type. + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */ ? getTypeWithFacts(propType, 131072 /* NEUndefined */) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; @@ -29639,7 +30025,7 @@ var ts; members.set(propName, prop); } else if (t.flags & (1 /* Any */ | 2 /* String */)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } } } @@ -29654,14 +30040,14 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : unknownType); } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. @@ -29680,16 +30066,21 @@ var ts; return type.modifiersType; } function getMappedTypeModifiers(type) { - return (type.declaration.readonlyToken ? 1 /* Readonly */ : 0) | - (type.declaration.questionToken ? 2 /* Optional */ : 0); + var declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 /* MinusToken */ ? 2 /* ExcludeReadonly */ : 1 /* IncludeReadonly */ : 0) | + (declaration.questionToken ? declaration.questionToken.kind === 38 /* MinusToken */ ? 8 /* ExcludeOptional */ : 4 /* IncludeOptional */ : 0); } - function getCombinedMappedTypeModifiers(type) { + function getMappedTypeOptionality(type) { + var modifiers = getMappedTypeModifiers(type); + return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type) { + var optionality = getMappedTypeOptionality(type); var modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type) { - return ts.getObjectFlags(type) & 32 /* Mapped */ && !!type.declaration.questionToken; + return !!(ts.getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */); } function isGenericMappedType(type) { return ts.getObjectFlags(type) & 32 /* Mapped */ && isGenericIndexType(getConstraintTypeFromMappedType(type)); @@ -29703,6 +30094,9 @@ var ts; else if (type.objectFlags & 3 /* ClassOrInterface */) { resolveClassOrInterfaceMembers(type); } + else if (type.objectFlags & 2048 /* ReverseMapped */) { + resolveReverseMappedTypeMembers(type); + } else if (type.objectFlags & 16 /* Anonymous */) { resolveAnonymousTypeMembers(type); } @@ -29779,7 +30173,10 @@ var ts; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { - props.set(escapedName, createUnionOrIntersectionProperty(unionType, escapedName)); + var prop = createUnionOrIntersectionProperty(unionType, escapedName); + // May be undefined if the property is private + if (prop) + props.set(escapedName, prop); } } } @@ -29788,22 +30185,51 @@ var ts; function getConstraintOfType(type) { return type.flags & 32768 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : type.flags & 1048576 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : - getBaseConstraintOfType(type); + type.flags & 2097152 /* Conditional */ ? getConstraintOfConditionalType(type) : + getBaseConstraintOfType(type); } function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { - var transformed = getTransformedIndexedAccessType(type); + var transformed = getSimplifiedIndexedAccessType(type); if (transformed) { return transformed; } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); + if (baseIndexType === stringType && !getIndexInfoOfType(baseObjectType || type.objectType, 0 /* String */)) { + // getIndexedAccessType returns `any` for X[string] where X doesn't have an index signature. + // to avoid this, return `undefined`. + return undefined; + } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } + function getDefaultConstraintOfConditionalType(type) { + return getUnionType([type.trueType, type.falseType]); + } + function getConstraintOfDistributiveConditionalType(type) { + // Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained + // type parameter. If so, create an instantiation of the conditional type where T is replaced + // with its constraint. We do this because if the constraint is a union type it will be distributed + // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' + // removes 'undefined' from T. + if (isDistributiveConditionalType(type)) { + var constraint = getConstraintOfType(type.checkType); + if (constraint) { + var target = type.target || type; + var mapper = createTypeMapper([target.checkType], [constraint]); + var combinedMapper = type.mapper ? combineTypeMappers(mapper, type.mapper) : mapper; + return instantiateType(target, combinedMapper); + } + } + return undefined; + } + function getConstraintOfConditionalType(type) { + return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); + } function getBaseConstraintOfType(type) { - if (type.flags & (1081344 /* TypeVariable */ | 393216 /* UnionOrIntersection */)) { + if (type.flags & (7372800 /* InstantiableNonPrimitive */ | 393216 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; @@ -29823,29 +30249,30 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - var typeStack; var circular; if (!type.resolvedBaseConstraint) { - typeStack = []; var constraint = getBaseConstraint(type); type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); } return type.resolvedBaseConstraint; function getBaseConstraint(t) { - if (ts.contains(typeStack, t)) { + if (!pushTypeResolution(t, 4 /* ResolvedBaseConstraint */)) { circular = true; return undefined; } - typeStack.push(t); var result = computeBaseConstraint(t); - typeStack.pop(); + if (!popTypeResolution()) { + circular = true; + return undefined; + } return result; } function computeBaseConstraint(t) { if (t.flags & 32768 /* TypeParameter */) { var constraint = getConstraintFromTypeParameter(t); - return t.isThisType ? constraint : - constraint ? getBaseConstraint(constraint) : undefined; + return t.isThisType || !constraint ? + constraint : + getBaseConstraint(constraint); } if (t.flags & 393216 /* UnionOrIntersection */) { var types = t.types; @@ -29865,7 +30292,7 @@ var ts; return stringType; } if (t.flags & 1048576 /* IndexedAccess */) { - var transformed = getTransformedIndexedAccessType(t); + var transformed = getSimplifiedIndexedAccessType(t); if (transformed) { return getBaseConstraint(transformed); } @@ -29874,6 +30301,12 @@ var ts; var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (t.flags & 2097152 /* Conditional */) { + return getBaseConstraint(getConstraintOfConditionalType(t)); + } + if (t.flags & 4194304 /* Substitution */) { + return getBaseConstraint(t.substitute); + } if (isGenericMappedType(t)) { return emptyObjectType; } @@ -29881,7 +30314,7 @@ var ts; } } function getApparentTypeOfIntersectionType(type) { - return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type, /*apparentType*/ true)); } function getResolvedTypeParameterDefault(typeParameter) { if (!typeParameter.default) { @@ -29932,26 +30365,25 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 1081344 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + var t = type.flags & 7897088 /* Instantiable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; return t.flags & 262144 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 524322 /* StringLike */ ? globalStringType : t.flags & 84 /* NumberLike */ ? globalNumberType : t.flags & 136 /* BooleanLike */ ? globalBooleanType : t.flags & 1536 /* ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : - t.flags & 33554432 /* NonPrimitive */ ? emptyObjectType : + t.flags & 134217728 /* NonPrimitive */ ? emptyObjectType : t; } function createUnionOrIntersectionProperty(containingType, name) { var props; - var types = containingType.types; var isUnion = containingType.flags & 131072 /* Union */; var excludeModifiers = isUnion ? 24 /* NonPublicAccessibilityModifier */ : 0; // Flags we want to propagate to the result if they exist in all source symbols var commonFlags = isUnion ? 0 /* None */ : 16777216 /* Optional */; var syntheticFlag = 4 /* SyntheticMethod */; var checkFlags = 0; - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var current = types_5[_i]; + for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) { + var current = _a[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); @@ -29982,8 +30414,8 @@ var ts; var propTypes = []; var declarations = []; var commonType = undefined; - for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { - var prop = props_1[_a]; + for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { + var prop = props_1[_b]; if (prop.declarations) { ts.addRange(declarations, prop.declarations); } @@ -30096,7 +30528,7 @@ var ts; } } if (propTypes.length) { - return getUnionType(propTypes, /*subtypeReduction*/ true); + return getUnionType(propTypes, 2 /* Subtype */); } } return undefined; @@ -30122,7 +30554,7 @@ var ts; } function isJSDocOptionalParameter(node) { if (ts.isInJavaScriptFile(node)) { - if (node.type && node.type.kind === 276 /* JSDocOptionalType */) { + if (node.type && node.type.kind === 279 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -30133,7 +30565,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 276 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 279 /* JSDocOptionalType */; } } } @@ -30152,9 +30584,8 @@ var ts; return true; } if (node.initializer) { - var signatureDeclaration = node.parent; - var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -30162,27 +30593,27 @@ var ts; if (iife) { return !node.type && !node.dotDotDotToken && - ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + node.parent.parameters.indexOf(node) >= iife.arguments.length; } return false; } function createTypePredicateFromTypePredicateNode(node) { var parameterName = node.parameterName; + var type = getTypeFromTypeNode(node.type); if (parameterName.kind === 71 /* Identifier */) { - return { - kind: 1 /* Identifier */, - parameterName: parameterName ? parameterName.escapedText : undefined, - parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, - type: getTypeFromTypeNode(node.type) - }; + return createIdentifierTypePredicate(parameterName && parameterName.escapedText, // TODO: GH#18217 + parameterName && getTypePredicateParameterIndex(node.parent.parameters, parameterName), type); } else { - return { - kind: 0 /* This */, - type: getTypeFromTypeNode(node.type) - }; + return createThisTypePredicate(type); } } + function createIdentifierTypePredicate(parameterName, parameterIndex, type) { + return { kind: 1 /* Identifier */, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; + } + function createThisTypePredicate(type) { + return { kind: 0 /* This */, type: type }; + } /** * Gets the minimum number of type arguments needed to satisfy all non-optional type * parameters. @@ -30262,7 +30693,7 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 174 /* LiteralType */) { + if (param.type && param.type.kind === 177 /* LiteralType */) { hasLiteralTypes = true; } // Record a new minimum argument count if this is not an optional parameter @@ -30275,25 +30706,22 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 154 /* GetAccessor */ || declaration.kind === 155 /* SetAccessor */) && + if ((declaration.kind === 155 /* GetAccessor */ || declaration.kind === 156 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = declaration.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 153 /* Constructor */ ? + var classType = declaration.kind === 154 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 159 /* TypePredicate */ ? - createTypePredicateFromTypePredicateNode(declaration.type) : - undefined; var hasRestLikeParameter = ts.hasRestParameter(declaration) || ts.isInJavaScriptFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters); - links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); + links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, /*resolvedTypePredicate*/ undefined, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); } return links.resolvedSignature; } @@ -30303,7 +30731,7 @@ var ts; // b) It references `arguments` somewhere var lastParam = ts.lastOrUndefined(declaration.parameters); var lastParamTags = lastParam && ts.getJSDocParameterTags(lastParam); - var lastParamVariadicType = lastParamTags && ts.firstDefined(lastParamTags, function (p) { + var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); if (!lastParamVariadicType && !containsArgumentsReference(declaration)) { @@ -30332,8 +30760,8 @@ var ts; } // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 154 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 155 /* SetAccessor */); + if (declaration.kind === 155 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { @@ -30357,11 +30785,11 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return node.name.kind === 145 /* ComputedPropertyName */ + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return node.name.kind === 146 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); @@ -30375,20 +30803,20 @@ var ts; for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -30418,6 +30846,28 @@ var ts; return getTypeOfSymbol(signature.thisParameter); } } + function signatureHasTypePredicate(signature) { + return getTypePredicateOfSignature(signature) !== undefined; + } + function getTypePredicateOfSignature(signature) { + if (!signature.resolvedTypePredicate) { + if (signature.target) { + var targetTypePredicate = getTypePredicateOfSignature(signature.target); + signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; + } + else if (signature.unionSignatures) { + signature.resolvedTypePredicate = getUnionTypePredicate(signature.unionSignatures) || noTypePredicate; + } + else { + var declaration = signature.declaration; + signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 /* TypePredicate */ ? + createTypePredicateFromTypePredicateNode(declaration.type) : + noTypePredicate; + } + ts.Debug.assert(!!signature.resolvedTypePredicate); + } + return signature.resolvedTypePredicate === noTypePredicate ? undefined : signature.resolvedTypePredicate; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) { @@ -30428,7 +30878,7 @@ var ts; type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } else { type = getReturnTypeFromBody(signature.declaration); @@ -30513,7 +30963,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 153 /* Constructor */ || signature.declaration.kind === 157 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 154 /* Constructor */ || signature.declaration.kind === 158 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -30527,7 +30977,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 133 /* NumberKeyword */ : 136 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 134 /* NumberKeyword */ : 137 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -30554,7 +31004,43 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return type.symbol && ts.getDeclarationOfKind(type.symbol, 146 /* TypeParameter */).constraint; + return type.symbol && ts.getDeclarationOfKind(type.symbol, 147 /* TypeParameter */).constraint; + } + function getInferredTypeParameterConstraint(typeParameter) { + var inferences; + if (typeParameter.symbol) { + for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + // When an 'infer T' declaration is immediately contained in a type reference node + // (such as 'Foo'), T's constraint is inferred from the constraint of the + // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are + // present, we form an intersection of the inferred constraint types. + if (declaration.parent.kind === 171 /* InferType */ && declaration.parent.parent.kind === 161 /* TypeReference */) { + var typeReference = declaration.parent.parent; + var typeParameters = getTypeParametersForTypeReference(typeReference); + if (typeParameters) { + var index = typeReference.typeArguments.indexOf(declaration.parent); + if (index < typeParameters.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); + if (declaredConstraint) { + // Type parameter constraints can reference other type parameters so + // constraints need to be instantiated. If instantiation produces the + // type parameter itself, we discard that inference. For example, in + // type Foo = [T, U]; + // type Bar = T extends Foo ? Foo : T; + // the instantiated constraint for U is X, so we discard that inference. + var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters)); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts.append(inferences, constraint); + } + } + } + } + } + } + } + return inferences && getIntersectionType(inferences); } function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { @@ -30564,23 +31050,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : + getInferredTypeParameterConstraint(typeParameter) || noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 146 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_4 = types.length; + var length_3 = types.length; var i = 0; - while (i < length_4) { + while (i < length_3) { var startId = types[i].id; var count = 1; - while (i + count < length_4 && types[i + count].id === startId + count) { + while (i + count < length_3 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -30601,13 +31088,13 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } } - return result & 29360128 /* PropagatingFlags */; + return result & 117440512 /* PropagatingFlags */; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); @@ -30644,7 +31131,7 @@ var ts; var isJs = ts.isInJavaScriptFile(node); var isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - var missingAugmentsTag = isJs && node.parent.kind !== 282 /* JSDocAugmentsTag */; + var missingAugmentsTag = isJs && node.parent.kind !== 285 /* JSDocAugmentsTag */; var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag @@ -30652,7 +31139,7 @@ var ts; : missingAugmentsTag ? ts.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; - var typeStr = typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */); + var typeStr = typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */); error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length); if (!isJs) { // TODO: Adopt same permissive behavior in TS as in JS to reduce follow-on editing experience failures (requires editing fillMissingTypeArguments) @@ -30665,11 +31152,7 @@ var ts; var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs)); return createTypeReference(type, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); @@ -30701,17 +31184,13 @@ var ts; } return getTypeAliasInstantiation(symbol, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeReferenceName(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -30738,12 +31217,10 @@ var ts; } // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); - if (res !== undefined) { - if (typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return res; + if (res) { + return checkNoTypeArguments(node, symbol) ? + res.flags & 32768 /* TypeParameter */ ? getConstrainedTypeParameter(res, node) : res : + unknownType; } if (!(symbol.flags & 107455 /* Value */ && isJSDocTypeReference(node))) { return unknownType; @@ -30775,42 +31252,79 @@ var ts; return getInferredClassType(symbol); } } + function getSubstitutionType(typeParameter, substitute) { + var result = createType(4194304 /* Substitution */); + result.typeParameter = typeParameter; + result.substitute = substitute; + return result; + } + function getConstrainedTypeParameter(typeParameter, node) { + var constraints; + while (ts.isPartOfTypeNode(node)) { + var parent = node.parent; + if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) { + if (getTypeFromTypeNode(parent.checkType) === typeParameter) { + constraints = ts.append(constraints, getTypeFromTypeNode(parent.extendsType)); + } + } + node = parent; + } + return constraints ? getSubstitutionType(typeParameter, getIntersectionType(ts.append(constraints, typeParameter))) : typeParameter; + } function isJSDocTypeReference(node) { - return node.flags & 1048576 /* JSDoc */ && node.kind === 160 /* TypeReference */; + return node.flags & 1048576 /* JSDoc */ && node.kind === 161 /* TypeReference */; + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : ts.declarationNameToString(node.typeName)); + return false; + } + return true; } function getIntendedTypeFromJSDocTypeReference(node) { if (ts.isIdentifier(node.typeName)) { - if (node.typeName.escapedText === "Object") { - if (ts.isJSDocIndexSignature(node)) { - var indexed = getTypeFromTypeNode(node.typeArguments[0]); - var target = getTypeFromTypeNode(node.typeArguments[1]); - var index = createIndexInfo(target, /*isReadonly*/ false); - return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); - } - return anyType; - } + var typeArgs = node.typeArguments; switch (node.typeName.escapedText) { case "String": + checkNoTypeArguments(node); return stringType; case "Number": + checkNoTypeArguments(node); return numberType; case "Boolean": + checkNoTypeArguments(node); return booleanType; case "Void": + checkNoTypeArguments(node); return voidType; case "Undefined": + checkNoTypeArguments(node); return undefinedType; case "Null": + checkNoTypeArguments(node); return nullType; case "Function": case "function": + checkNoTypeArguments(node); return globalFunctionType; case "Array": case "array": - return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined; + return !typeArgs || !typeArgs.length ? anyArrayType : undefined; case "Promise": case "promise": - return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + return !typeArgs || !typeArgs.length ? createPromiseType(anyType) : undefined; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var index = createIndexInfo(target, /*isReadonly*/ false); + return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); + } + return anyType; + } + checkNoTypeArguments(node); + return anyType; } } } @@ -30833,7 +31347,7 @@ var ts; type = getTypeReferenceType(node, symbol); } // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the - // type reference in checkTypeReferenceOrExpressionWithTypeArguments. + // type reference in checkTypeReferenceNode. links.resolvedSymbol = symbol; links.resolvedType = type; } @@ -30859,9 +31373,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: return declaration; } } @@ -31045,27 +31559,27 @@ var ts; return true; } combined |= t.flags; - if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 33554432 /* NonPrimitive */)) { + if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 134217728 /* NonPrimitive */)) { return true; } } return false; } - function addTypeToUnion(typeSet, type) { + function addTypeToUnion(typeSet, includes, type) { var flags = type.flags; if (flags & 131072 /* Union */) { - addTypesToUnion(typeSet, type.types); + includes = addTypesToUnion(typeSet, includes, type.types); } else if (flags & 1 /* Any */) { - typeSet.containsAny = true; + includes |= 1 /* Any */; } else if (!strictNullChecks && flags & 12288 /* Nullable */) { if (flags & 4096 /* Undefined */) - typeSet.containsUndefined = true; + includes |= 2 /* Undefined */; if (flags & 8192 /* Null */) - typeSet.containsNull = true; - if (!(flags & 4194304 /* ContainsWideningType */)) - typeSet.containsNonWideningType = true; + includes |= 4 /* Null */; + if (!(flags & 16777216 /* ContainsWideningType */)) + includes |= 16 /* NonWideningType */; } else if (!(flags & 16384 /* Never */ || flags & 262144 /* Intersection */ && isEmptyIntersectionType(type))) { // We ignore 'never' types in unions. Likewise, we ignore intersections of unit types as they are @@ -31073,13 +31587,13 @@ var ts; // intersections of unit types into 'never' upon construction, but deferring the reduction makes it // easier to reason about their origin. if (flags & 2 /* String */) - typeSet.containsString = true; + includes |= 32 /* String */; if (flags & 4 /* Number */) - typeSet.containsNumber = true; + includes |= 64 /* Number */; if (flags & 512 /* ESSymbol */) - typeSet.containsESSymbol = true; + includes |= 128 /* ESSymbol */; if (flags & 1120 /* StringOrNumberLiteralOrUnique */) - typeSet.containsLiteralOrUniqueESSymbol = true; + includes |= 256 /* LiteralOrUniqueESSymbol */; var len = typeSet.length; var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues); if (index < 0) { @@ -31089,18 +31603,20 @@ var ts; } } } + return includes; } // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. - function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var type = types_7[_i]; - addTypeToUnion(typeSet, type); + function addTypesToUnion(typeSet, includes, types) { + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; + includes = addTypeToUnion(typeSet, includes, type); } + return includes; } function containsIdenticalType(types, type) { - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -31144,15 +31660,15 @@ var ts; } } } - function removeRedundantLiteralTypes(types) { + function removeRedundantLiteralTypes(types, includes) { var i = types.length; while (i > 0) { i--; var t = types[i]; - var remove = t.flags & 32 /* StringLiteral */ && types.containsString || - t.flags & 64 /* NumberLiteral */ && types.containsNumber || - t.flags & 1024 /* UniqueESSymbol */ && types.containsESSymbol || - t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 2097152 /* FreshLiteral */ && containsType(types, t.regularType); + var remove = t.flags & 32 /* StringLiteral */ && includes & 32 /* String */ || + t.flags & 64 /* NumberLiteral */ && includes & 64 /* Number */ || + t.flags & 1024 /* UniqueESSymbol */ && includes & 128 /* ESSymbol */ || + t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 8388608 /* FreshLiteral */ && containsType(types, t.regularType); if (remove) { ts.orderedRemoveItemAt(types, i); } @@ -31165,7 +31681,8 @@ var ts; // expression constructs such as array literals and the || and ?: operators). Named types can // circularly reference themselves and therefore cannot be subtype reduced during their declaration. // For example, "type Item = string | (() => Item" is a named type that circularly references itself. - function getUnionType(types, subtypeReduction, aliasSymbol, aliasTypeArguments) { + function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments) { + if (unionReduction === void 0) { unionReduction = 1 /* Literal */; } if (types.length === 0) { return neverType; } @@ -31173,23 +31690,61 @@ var ts; return types[0]; } var typeSet = []; - addTypesToUnion(typeSet, types); - if (typeSet.containsAny) { + var includes = addTypesToUnion(typeSet, 0, types); + if (includes & 1 /* Any */) { return anyType; } - if (subtypeReduction) { - removeSubtypes(typeSet); - } - else if (typeSet.containsLiteralOrUniqueESSymbol) { - removeRedundantLiteralTypes(typeSet); + switch (unionReduction) { + case 1 /* Literal */: + if (includes & 256 /* LiteralOrUniqueESSymbol */) { + removeRedundantLiteralTypes(typeSet, includes); + } + break; + case 2 /* Subtype */: + removeSubtypes(typeSet); + break; } if (typeSet.length === 0) { - return typeSet.containsNull ? typeSet.containsNonWideningType ? nullType : nullWideningType : - typeSet.containsUndefined ? typeSet.containsNonWideningType ? undefinedType : undefinedWideningType : + return includes & 4 /* Null */ ? includes & 16 /* NonWideningType */ ? nullType : nullWideningType : + includes & 2 /* Undefined */ ? includes & 16 /* NonWideningType */ ? undefinedType : undefinedWideningType : neverType; } return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments); } + function getUnionTypePredicate(signatures) { + var first; + var types = []; + for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { + var sig = signatures_2[_i]; + var pred = getTypePredicateOfSignature(sig); + if (!pred) { + continue; + } + if (first) { + if (!typePredicateKindsMatch(first, pred)) { + // No common type predicate. + return undefined; + } + } + else { + first = pred; + } + types.push(pred.type); + } + if (!first) { + // No union signatures had a type predicate. + return undefined; + } + var unionType = getUnionType(types); + return ts.isIdentifierTypePredicate(first) + ? createIdentifierTypePredicate(first.parameterName, first.parameterIndex, unionType) + : createThisTypePredicate(unionType); + } + function typePredicateKindsMatch(a, b) { + return ts.isIdentifierTypePredicate(a) + ? ts.isIdentifierTypePredicate(b) && a.parameterIndex === b.parameterIndex + : !ts.isIdentifierTypePredicate(b); + } // This function assumes the constituent type list is sorted and deduplicated. function getUnionTypeFromSortedList(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { @@ -31219,43 +31774,46 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), /*subtypeReduction*/ false, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1 /* Literal */, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); } return links.resolvedType; } - function addTypeToIntersection(typeSet, type) { - if (type.flags & 262144 /* Intersection */) { - addTypesToIntersection(typeSet, type.types); + function addTypeToIntersection(typeSet, includes, type) { + var flags = type.flags; + if (flags & 262144 /* Intersection */) { + includes = addTypesToIntersection(typeSet, includes, type.types); } - else if (type.flags & 1 /* Any */) { - typeSet.containsAny = true; + else if (flags & 1 /* Any */) { + includes |= 1 /* Any */; } - else if (type.flags & 16384 /* Never */) { - typeSet.containsNever = true; + else if (flags & 16384 /* Never */) { + includes |= 8 /* Never */; } else if (ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { - typeSet.containsEmptyObject = true; + includes |= 1024 /* EmptyObject */; } - else if ((strictNullChecks || !(type.flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { - if (type.flags & 65536 /* Object */) { - typeSet.containsObjectType = true; + else if ((strictNullChecks || !(flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { + if (flags & 65536 /* Object */) { + includes |= 512 /* ObjectType */; } - if (type.flags & 131072 /* Union */ && typeSet.unionIndex === undefined) { - typeSet.unionIndex = typeSet.length; + if (flags & 131072 /* Union */) { + includes |= 2048 /* Union */; } - if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + if (!(flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { typeSet.push(type); } } + return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. - function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; - addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type)); + function addTypesToIntersection(typeSet, includes, types) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } + return includes; } // We normalize combinations of intersection and union types based on the distributive property of the '&' // operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection @@ -31272,26 +31830,25 @@ var ts; return emptyObjectType; } var typeSet = []; - addTypesToIntersection(typeSet, types); - if (typeSet.containsNever) { + var includes = addTypesToIntersection(typeSet, 0, types); + if (includes & 8 /* Never */) { return neverType; } - if (typeSet.containsAny) { + if (includes & 1 /* Any */) { return anyType; } - if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + if (includes & 1024 /* EmptyObject */ && !(includes & 512 /* ObjectType */)) { typeSet.push(emptyObjectType); } if (typeSet.length === 1) { return typeSet[0]; } - var unionIndex = typeSet.unionIndex; - if (unionIndex !== undefined) { + if (includes & 2048 /* Union */) { // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. - var unionType = typeSet[unionIndex]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), - /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments); + var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072 /* Union */) !== 0; }); + var unionType = typeSet[unionIndex_1]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); var type = intersectionTypes.get(id); @@ -31320,7 +31877,7 @@ var ts; return type.resolvedIndexType; } function getLiteralTypeFromPropertyName(prop) { - return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.startsWith(prop.escapedName, "__@") ? + return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.isKnownSymbol(prop) ? neverType : getLiteralType(ts.symbolName(prop)); } @@ -31328,10 +31885,11 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return maybeTypeOfKind(type, 1081344 /* TypeVariable */) ? getIndexTypeForGenericType(type) : + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) : ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : - type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : - getLiteralTypeFromPropertyNames(type); + type === wildcardType ? wildcardType : + type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : + getLiteralTypeFromPropertyNames(type); } function getIndexTypeOrString(type) { var indexType = getIndexType(type); @@ -31341,11 +31899,11 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 127 /* KeyOfKeyword */: + case 128 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 140 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 137 /* SymbolKeyword */ + case 141 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 138 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : unknownType; break; @@ -31360,7 +31918,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode : undefined; var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : @@ -31369,6 +31927,7 @@ var ts; var prop = getPropertyOfType(objectType, propName); if (prop) { if (accessExpression) { + markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 99 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); return unknownType; @@ -31382,7 +31941,7 @@ var ts; } if (!(indexType.flags & 12288 /* Nullable */) && isTypeAssignableToKind(indexType, 524322 /* StringLike */ | 84 /* NumberLike */ | 1536 /* ESSymbolLike */)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } var indexInfo = isTypeAssignableToKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || getIndexInfoOfType(objectType, 0 /* String */) || @@ -31406,7 +31965,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } @@ -31421,15 +31980,10 @@ var ts; return anyType; } function isGenericObjectType(type) { - return type.flags & 1081344 /* TypeVariable */ ? true : - ts.getObjectFlags(type) & 32 /* Mapped */ ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericObjectType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 536870912 /* GenericMappedType */); } function isGenericIndexType(type) { - return type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) ? true : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericIndexType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 524288 /* Index */); } // Return true if the given type is a non-generic object type with a string index signature and no // other members. @@ -31442,49 +31996,70 @@ var ts; } return false; } + function isMappedTypeToNever(type) { + return ts.getObjectFlags(type) & 32 /* Mapped */ && getTemplateTypeFromMappedType(type) === neverType; + } // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return // undefined if no transformation is possible. - function getTransformedIndexedAccessType(type) { + function getSimplifiedIndexedAccessType(type) { var objectType = type.objectType; - // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or - // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a - // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed - // access types with default property values as expressed by D. - if (objectType.flags & 262144 /* Intersection */ && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { - var regularTypes = []; - var stringIndexTypes = []; - for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { - var t = _a[_i]; - if (isStringIndexOnlyType(t)) { - stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); - } - else { - regularTypes.push(t); + if (objectType.flags & 262144 /* Intersection */ && isGenericObjectType(objectType)) { + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a + // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed + // access types with default property values as expressed by D. + if (ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); + } + else { + regularTypes.push(t); + } } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more mapped types with a template type `never`, '(U & V & { [P in T]: never })[K]', return a + // transformed type that removes the never-mapped type: '(U & V)[K]'. This mirrors what would happen + // eventually anyway, but it easier to reason about. + if (ts.some(objectType.types, isMappedTypeToNever)) { + var nonNeverTypes = ts.filter(objectType.types, function (t) { return !isMappedTypeToNever(t); }); + return getIndexedAccessType(getIntersectionType(nonNeverTypes), type.indexType); } - return getUnionType([ - getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), - getIntersectionType(stringIndexTypes) - ]); } // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we // construct the type Box. if (isGenericMappedType(objectType)) { - var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var objectTypeMapper = objectType.mapper; - var templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + return substituteIndexedMappedType(objectType, type); + } + if (objectType.flags & 32768 /* TypeParameter */) { + var constraint = getConstraintFromTypeParameter(objectType); + if (constraint && isGenericMappedType(constraint)) { + return substituteIndexedMappedType(constraint, type); + } } return undefined; } + function substituteIndexedMappedType(objectType, type) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + var templateMapper = objectType.mapper ? combineTypeMappers(objectType.mapper, mapper) : mapper; + return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + } function getIndexedAccessType(objectType, indexType, accessNode) { // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 181 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 184 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } @@ -31535,6 +32110,102 @@ var ts; } return links.resolvedType; } + function getActualTypeParameter(type) { + return type.flags & 4194304 /* Substitution */ ? type.typeParameter : type; + } + function createConditionalType(checkType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, aliasTypeArguments) { + var type = createType(2097152 /* Conditional */); + type.checkType = checkType; + type.extendsType = extendsType; + type.trueType = trueType; + type.falseType = falseType; + type.inferTypeParameters = inferTypeParameters; + type.target = target; + type.mapper = mapper; + type.aliasSymbol = aliasSymbol; + type.aliasTypeArguments = aliasTypeArguments; + return type; + } + function getConditionalType(checkType, baseExtendsType, baseTrueType, baseFalseType, inferTypeParameters, target, mapper, aliasSymbol, baseAliasTypeArguments) { + // Instantiate extends type without instantiating any 'infer T' type parameters + var extendsType = instantiateType(baseExtendsType, mapper); + // Return falseType for a definitely false extends check. We check an instantations of the two + // types with type parameters mapped to the wildcard type, the most permissive instantiations + // possible (the wildcard type is assignable to and from all types). If those are not related, + // then no instatiations will be and we can just return the false branch type. + if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { + return instantiateType(baseFalseType, mapper); + } + // The check could be true for some instantiation + var combinedMapper; + if (inferTypeParameters) { + var inferences = ts.map(inferTypeParameters, createInferenceInfo); + // We don't want inferences from constraints as they may cause us to eagerly resolve the + // conditional type instead of deferring resolution. Also, we always want strict function + // types rules (i.e. proper contravariance) for inferences. + inferTypes(inferences, checkType, extendsType, 8 /* NoConstraints */ | 16 /* AlwaysStrict */); + // We infer 'never' when there are no candidates for a type parameter + var inferredTypes = ts.map(inferences, function (inference) { return getTypeFromInference(inference) || neverType; }); + var inferenceMapper = createTypeMapper(inferTypeParameters, inferredTypes); + combinedMapper = mapper ? combineTypeMappers(mapper, inferenceMapper) : inferenceMapper; + } + // Return union of trueType and falseType for any and never since they match anything + if (checkType.flags & 1 /* Any */ || (checkType.flags & 16384 /* Never */ && !(extendsType.flags & 16384 /* Never */))) { + return getUnionType([instantiateType(baseTrueType, combinedMapper || mapper), instantiateType(baseFalseType, mapper)]); + } + // Instantiate the extends type including inferences for 'infer T' type parameters + var inferredExtendsType = combinedMapper ? instantiateType(baseExtendsType, combinedMapper) : extendsType; + // Return trueType for a definitely true extends check. The definitely assignable relation excludes + // type variable constraints from consideration. Without the definitely assignable relation, the type + // type Foo = T extends { x: string } ? string : number + // would immediately resolve to 'string' instead of being deferred. + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + return instantiateType(baseTrueType, combinedMapper || mapper); + } + // Return a deferred type for a check that is neither definitely true nor definitely false + var erasedCheckType = getActualTypeParameter(checkType); + var trueType = instantiateType(baseTrueType, mapper); + var falseType = instantiateType(baseFalseType, mapper); + // We compute the cache key from the ids of the four constituent types, plus an indicator of whether the + // type is distributive (i.e. whether the original declaration has a type parameter as the check type). + var isDistributive = (target ? target.checkType : erasedCheckType).flags & 32768 /* TypeParameter */ ? 1 : 0; + var id = erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id + "," + isDistributive; + var cached = conditionalTypes.get(id); + if (cached) { + return cached; + } + var result = createConditionalType(erasedCheckType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, instantiateTypes(baseAliasTypeArguments, mapper)); + conditionalTypes.set(id, result); + return result; + } + function isDistributiveConditionalType(type) { + return !!((type.target || type).checkType.flags & 32768 /* TypeParameter */); + } + function getInferTypeParameters(node) { + var result; + if (node.locals) { + node.locals.forEach(function (symbol) { + if (symbol.flags & 262144 /* TypeParameter */) { + result = ts.append(result, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result; + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getConditionalType(getTypeFromTypeNode(node.checkType), getTypeFromTypeNode(node.extendsType), getTypeFromTypeNode(node.trueType), getTypeFromTypeNode(node.falseType), getInferTypeParameters(node), /*target*/ undefined, /*mapper*/ undefined, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -31556,7 +32227,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 232 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 235 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -31567,7 +32238,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, propagatedFlags) { + function getSpreadType(left, right, symbol, typeFlags, objectFlags) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -31578,15 +32249,12 @@ var ts; return left; } if (left.flags & 131072 /* Union */) { - return mapType(left, function (t) { return getSpreadType(t, right, symbol, propagatedFlags); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); }); } if (right.flags & 131072 /* Union */) { - return mapType(right, function (t) { return getSpreadType(left, t, symbol, propagatedFlags); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); }); } - if (right.flags & 33554432 /* NonPrimitive */) { - return nonPrimitiveType; - } - if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */)) { + if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */ | 134217728 /* NonPrimitive */)) { return left; } var members = ts.createSymbolTable(); @@ -31639,9 +32307,8 @@ var ts; } } var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo)); - spread.flags |= propagatedFlags; - spread.flags |= 2097152 /* FreshLiteral */ | 8388608 /* ContainsObjectLiteral */; - spread.objectFlags |= (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); + spread.flags |= typeFlags | 33554432 /* ContainsObjectLiteral */; + spread.objectFlags |= objectFlags | (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); return spread; } function getNonReadonlySymbol(prop) { @@ -31671,9 +32338,9 @@ var ts; return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 2097152 /* FreshLiteral */)) { + if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 8388608 /* FreshLiteral */)) { if (!type.freshType) { - var freshType = createLiteralType(type.flags | 2097152 /* FreshLiteral */, type.value, type.symbol); + var freshType = createLiteralType(type.flags | 8388608 /* FreshLiteral */, type.value, type.symbol); freshType.regularType = type; type.freshType = freshType; } @@ -31682,7 +32349,7 @@ var ts; return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? type.regularType : type; + return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? type.regularType : type; } function getLiteralType(value, enumId, symbol) { // We store all literal types in a single map with keys of the form '#NNN' and '@SSS', @@ -31714,16 +32381,16 @@ var ts; if (ts.isValidESSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); var links = getSymbolLinks(symbol); - return links.type || (links.type = createUniqueESSymbolType(symbol)); + return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); } return esSymbolType; } function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 231 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 234 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && - (container.kind !== 153 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 154 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -31740,73 +32407,77 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return anyType; - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return stringType; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return numberType; case 122 /* BooleanKeyword */: return booleanType; - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return esSymbolType; case 105 /* VoidKeyword */: return voidType; - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: return undefinedType; case 95 /* NullKeyword */: return nullType; - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return neverType; - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return node.flags & 65536 /* JavaScriptFile */ ? anyType : nonPrimitiveType; - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getTypeFromTypeReference(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return booleanType; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 169 /* ParenthesizedType */: - case 275 /* JSDocNonNullableType */: - case 276 /* JSDocOptionalType */: - case 271 /* JSDocTypeExpression */: + case 172 /* ParenthesizedType */: + case 278 /* JSDocNonNullableType */: + case 279 /* JSDocOptionalType */: + case 274 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 280 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return getTypeFromMappedTypeNode(node); + case 170 /* ConditionalType */: + return getTypeFromConditionalTypeNode(node); + case 171 /* InferType */: + return getTypeFromInferTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -31815,12 +32486,18 @@ var ts; } function instantiateList(items, mapper, instantiator) { if (items && items.length) { - var result = []; - for (var _i = 0, items_1 = items; _i < items_1.length; _i++) { - var v = items_1[_i]; - result.push(instantiator(v, mapper)); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result = i === 0 ? [] : items.slice(0, i); + result.push(mapped); + for (i++; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } } - return result; } return items; } @@ -31860,7 +32537,7 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(typeParameters, index) { - return function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; }; } function isInferenceContext(mapper) { return !!mapper.signature; @@ -31876,13 +32553,16 @@ var ts; function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } + function wildcardMapper(type) { + return type.flags & 32768 /* TypeParameter */ ? wildcardType : type; + } function cloneTypeParameter(typeParameter) { var result = createType(32768 /* TypeParameter */); result.symbol = typeParameter.symbol; result.target = typeParameter; return result; } - function cloneTypePredicate(predicate, mapper) { + function instantiateTypePredicate(predicate, mapper) { if (ts.isIdentifierTypePredicate(predicate)) { return { kind: 1 /* Identifier */, @@ -31900,7 +32580,6 @@ var ts; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { // First create a fresh set of type parameters, then include a mapping from the old to the // new type parameters in the mapper function. Finally store this mapper in the new type @@ -31912,18 +32591,24 @@ var ts; tp.mapper = mapper; } } - if (signature.typePredicate) { - freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper); - } + // Don't compute resolvedReturnType and resolvedTypePredicate now, + // because using `mapper` now could trigger inferences to become fixed. (See `createInferenceContext`.) + // See GH#17600. var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), - /*resolvedReturnType*/ undefined, freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); + /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); result.target = signature; result.mapper = mapper; return result; } function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !maybeTypeOfKind(links.type, 65536 /* Object */ | 7897088 /* Instantiable */)) { + // If the type of the symbol is already resolved, and if that type could not possibly + // be affected by instantiation, simply return the symbol itself. + return symbol; + } if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var links = getSymbolLinks(symbol); // If symbol being instantiated is itself a instantiation, fetch the original target and combine the // type mappers. This ensures that original type identities are properly preserved and that aliases // always reference a non-aliases. @@ -31949,7 +32634,7 @@ var ts; var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var symbol = target.symbol; var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; + var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type // parameters that are in scope (and therefore potentially referenced). For type literals that @@ -31960,7 +32645,7 @@ var ts; typeParameters = symbol.flags & 2048 /* TypeLiteral */ && !target.aliasTypeArguments ? ts.filter(outerTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration_1); }) : outerTypeParameters; - links.typeParameters = typeParameters; + links.outerTypeParameters = typeParameters; if (typeParameters.length) { links.instantiations = ts.createMap(); links.instantiations.set(getTypeListId(typeParameters), target); @@ -31989,18 +32674,18 @@ var ts; // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced. if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container_1 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 208 /* Block */ ? "quit" : n === container_1; })) { + if (ts.findAncestor(node, function (n) { return n.kind === 211 /* Block */ ? "quit" : n === container_1; })) { return ts.forEachChild(node, containsReference); } } return true; function containsReference(node) { switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: return tp.isThisType; case 71 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return true; } return ts.forEachChild(node, containsReference); @@ -32030,7 +32715,7 @@ var ts; return instantiateAnonymousType(type, mapper); } function isMappableType(type) { - return type.flags & (1 /* Any */ | 32768 /* TypeParameter */ | 65536 /* Object */ | 262144 /* Intersection */ | 1048576 /* IndexedAccess */); + return type.flags & (1 /* Any */ | 7372800 /* InstantiableNonPrimitive */ | 65536 /* Object */ | 262144 /* Intersection */); } function instantiateAnonymousType(type, mapper) { var result = createObjectType(type.objectFlags | 64 /* Instantiated */, type.symbol); @@ -32043,8 +32728,26 @@ var ts; result.aliasTypeArguments = instantiateTypes(type.aliasTypeArguments, mapper); return result; } + function getConditionalTypeInstantiation(type, mapper) { + var target = type.target || type; + var combinedMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; + // Check if we have a conditional type where the check type is a naked type parameter. If so, + // the conditional type is distributive over union types and when T is instantiated to a union + // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). + if (isDistributiveConditionalType(target)) { + var checkType_1 = target.checkType; + var instantiatedType = combinedMapper(checkType_1); + if (checkType_1 !== instantiatedType && instantiatedType.flags & 131072 /* Union */) { + return mapType(instantiatedType, function (t) { return instantiateConditionalType(target, createReplacementMapper(checkType_1, t, combinedMapper)); }); + } + } + return instantiateConditionalType(target, combinedMapper); + } + function instantiateConditionalType(type, mapper) { + return getConditionalType(instantiateType(type.checkType, mapper), type.extendsType, type.trueType, type.falseType, type.inferTypeParameters, type, mapper, type.aliasSymbol, type.aliasTypeArguments); + } function instantiateType(type, mapper) { - if (type && mapper !== identityMapper) { + if (type && mapper && mapper !== identityMapper) { if (type.flags & 32768 /* TypeParameter */) { return mapper(type); } @@ -32060,14 +32763,20 @@ var ts; return getAnonymousTypeInstantiation(type, mapper); } if (type.objectFlags & 4 /* Reference */) { - return createTypeReference(type.target, instantiateTypes(type.typeArguments, mapper)); + var typeArguments = type.typeArguments; + var newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type; } } if (type.flags & 131072 /* Union */ && !(type.flags & 16382 /* Primitive */)) { - return getUnionType(instantiateTypes(type.types, mapper), /*subtypeReduction*/ false, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, 1 /* Literal */, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(instantiateTypes(type.types, mapper), type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 524288 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); @@ -32075,41 +32784,51 @@ var ts; if (type.flags & 1048576 /* IndexedAccess */) { return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper)); } + if (type.flags & 2097152 /* Conditional */) { + return getConditionalTypeInstantiation(type, mapper); + } + if (type.flags & 4194304 /* Substitution */) { + return mapper(type.typeParameter); + } } return type; } + function getWildcardInstantiation(type) { + return type.flags & (16382 /* Primitive */ | 1 /* Any */ | 16384 /* Never */) ? type : + type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return node.operatorToken.kind === 54 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.forEach(node.properties, isContextSensitive); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. return node.initializer && isContextSensitive(node.initializer); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: // It is possible to that node.expression is undefined (e.g
) return node.expression && isContextSensitive(node.expression); } @@ -32124,7 +32843,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 188 /* ArrowFunction */) { + if (node.kind !== 191 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -32133,7 +32852,7 @@ var ts; } } // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return node.body.kind === 208 /* Block */ ? false : isContextSensitive(node.body); + return node.body.kind === 211 /* Block */ ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -32182,7 +32901,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 131072 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 131072 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 1081344 /* TypeVariable */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & 7372800 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); } @@ -32232,8 +32951,8 @@ var ts; source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes); } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 152 /* MethodDeclaration */ && - kind !== 151 /* MethodSignature */ && kind !== 153 /* Constructor */; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 /* MethodDeclaration */ && + kind !== 152 /* MethodSignature */ && kind !== 154 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -32269,7 +32988,7 @@ var ts; // with respect to T. var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) && (getFalsyFlags(sourceType) & 12288 /* Nullable */) === (getFalsyFlags(targetType) & 12288 /* Nullable */); var related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 /* Strict */ : 1 /* Bivariant */, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : @@ -32289,11 +33008,13 @@ var ts; } var sourceReturnType = getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions - if (target.typePredicate) { - if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (targetTypePredicate) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + if (sourceTypePredicate) { + result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } - else if (ts.isIdentifierTypePredicate(target.typePredicate)) { + else if (ts.isIdentifierTypePredicate(targetTypePredicate)) { if (reportErrors) { errorReporter(ts.Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); } @@ -32319,13 +33040,12 @@ var ts; return 0 /* False */; } if (source.kind === 1 /* Identifier */) { - var sourcePredicate = source; var targetPredicate = target; - var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0 /* False */; @@ -32383,7 +33103,7 @@ var ts; } function isEmptyObjectType(type) { return type.flags & 65536 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : - type.flags & 33554432 /* NonPrimitive */ ? true : + type.flags & 134217728 /* NonPrimitive */ ? true : type.flags & 131072 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : type.flags & 262144 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : false; @@ -32408,7 +33128,7 @@ var ts; var targetProperty = getPropertyOfType(targetEnumType, property.escapedName); if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) { if (errorReporter) { - errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */)); + errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */)); } enumRelation.set(id, false); return false; @@ -32421,7 +33141,7 @@ var ts; function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { var s = source.flags; var t = target.flags; - if (t & 1 /* Any */ || s & 16384 /* Never */) + if (t & 1 /* Any */ || s & 16384 /* Never */ || source === wildcardType) return true; if (t & 16384 /* Never */) return false; @@ -32455,11 +33175,11 @@ var ts; return true; if (s & 8192 /* Null */ && (!strictNullChecks || t & 8192 /* Null */)) return true; - if (s & 65536 /* Object */ && t & 33554432 /* NonPrimitive */) + if (s & 65536 /* Object */ && t & 134217728 /* NonPrimitive */) return true; if (s & 1024 /* UniqueESSymbol */ || t & 1024 /* UniqueESSymbol */) return false; - if (relation === assignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { if (s & 1 /* Any */) return true; // Type number or any numeric literal type is assignable to any numeric enum type or any @@ -32471,10 +33191,10 @@ var ts; return false; } function isTypeRelatedTo(source, target, relation) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } if (source === target || @@ -32488,11 +33208,14 @@ var ts; return related === 1 /* Succeeded */; } } - if (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */) { + if (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } + function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { + return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -32520,10 +33243,24 @@ var ts; } else if (errorInfo) { if (containingMessageChain) { - errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + var chain_1 = containingMessageChain(); + if (chain_1) { + errorInfo = ts.concatenateDiagnosticMessageChains(chain_1, errorInfo); + } } diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } + // Check if we should issue an extra diagnostic to produce a quickfix for a slightly incorrect import statement + if (headMessage && errorNode && !result && source.symbol) { + var links = getSymbolLinks(source.symbol); + if (links.originatingImport && !ts.isImportCall(links.originatingImport)) { + var helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target), target, relation, /*errorNode*/ undefined); + if (helpfulRetry) { + // Likely an incorrect import. Issue a helpful diagnostic to produce a quickfix to change the import + diagnostics.add(ts.createDiagnosticForNode(links.originatingImport, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime)); + } + } + } return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { ts.Debug.assert(!!errorNode); @@ -32533,8 +33270,8 @@ var ts; var sourceType = typeToString(source); var targetType = typeToString(target); if (sourceType === targetType) { - sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */); - targetType = typeToString(target, /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */); + sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); + targetType = typeToString(target, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); } if (!message) { if (relation === comparableRelation) { @@ -32585,12 +33322,18 @@ var ts; * * Ternary.False if they are not related. */ function isRelatedTo(source, target, reportErrors, headMessage) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } + if (source.flags & 4194304 /* Substitution */) { + source = relation === definitelyAssignableRelation ? source.typeParameter : source.substitute; + } + if (target.flags & 4194304 /* Substitution */) { + target = target.typeParameter; + } // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return -1 /* True */; @@ -32600,8 +33343,9 @@ var ts; if (relation === comparableRelation && !(target.flags & 16384 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1 /* True */; - if (isObjectLiteralType(source) && source.flags & 2097152 /* FreshLiteral */) { - if (hasExcessProperties(source, target, reportErrors)) { + if (isObjectLiteralType(source) && source.flags & 8388608 /* FreshLiteral */) { + var discriminantType = target.flags & 131072 /* Union */ ? findMatchingDiscriminantType(source, target) : undefined; + if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { reportRelationError(headMessage, source, target); } @@ -32611,7 +33355,7 @@ var ts; // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { source = getRegularTypeOfObjectLiteral(source); } } @@ -32672,7 +33416,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false); } - if (!result && (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */)) { + if (!result && (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; } @@ -32692,32 +33436,55 @@ var ts; } function isIdenticalTo(source, target) { var result; - if (source.flags & 65536 /* Object */ && target.flags & 65536 /* Object */) { + var flags = source.flags & target.flags; + if (flags & 65536 /* Object */) { return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } - if (source.flags & 131072 /* Union */ && target.flags & 131072 /* Union */ || - source.flags & 262144 /* Intersection */ && target.flags & 262144 /* Intersection */) { + if (flags & (131072 /* Union */ | 262144 /* Intersection */)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & 524288 /* Index */) { + return isRelatedTo(source.type, target.type, /*reportErrors*/ false); + } + if (flags & 1048576 /* IndexedAccess */) { + if (result = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { + return result; + } + } + } + if (flags & 2097152 /* Conditional */) { + if (result = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.trueType, target.trueType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.falseType, target.falseType, /*reportErrors*/ false)) { + if (isDistributiveConditionalType(source) === isDistributiveConditionalType(target)) { + return result; + } + } + } + } + } + } + if (flags & 4194304 /* Substitution */) { + return isRelatedTo(source.substitute, target.substitute, /*reportErrors*/ false); + } return 0 /* False */; } - function hasExcessProperties(source, target, reportErrors) { + function hasExcessProperties(source, target, discriminant, reportErrors) { if (maybeTypeOfKind(target, 65536 /* Object */) && !(ts.getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); - if ((relation === assignableRelation || relation === comparableRelation) && + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); + if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } - if (target.flags & 131072 /* Union */) { - var discriminantType = findMatchingDiscriminantType(source, target); - if (discriminantType) { - // check excess properties against discriminant type only, not the entire union - return hasExcessProperties(source, discriminantType, reportErrors); - } + if (discriminant) { + // check excess properties against discriminant type only, not the entire union + return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } var _loop_4 = function (prop) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -32981,6 +33748,9 @@ var ts; } return result; } + function getConstraintForRelation(type) { + return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); + } function structuredTypeRelatedTo(source, target, reportErrors) { var result; var originalErrorInfo; @@ -32988,7 +33758,7 @@ var ts; if (target.flags & 32768 /* TypeParameter */) { // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. if (ts.getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -33006,7 +33776,7 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // constraint of T. - var constraint = getConstraintOfType(target.type); + var constraint = getConstraintForRelation(target.type); if (constraint) { if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { return result; @@ -33015,8 +33785,8 @@ var ts; } else if (target.flags & 1048576 /* IndexedAccess */) { // A type S is related to a type T[K] if S is related to A[K], where K is string-like and - // A is the apparent type of S. - var constraint = getConstraintOfIndexedAccess(target); + // A is the apparent type of T. + var constraint = getConstraintForRelation(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { errorInfo = saveErrorInfo; @@ -33024,19 +33794,30 @@ var ts; } } } - else if (isGenericMappedType(target) && !isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (isGenericMappedType(target)) { + // A source type T is related to a target type { [P in X]: T[P] } + var template = getTemplateTypeFromMappedType(target); + var modifiers = getMappedTypeModifiers(target); + if (!(modifiers & 8 /* ExcludeOptional */)) { + if (template.flags & 1048576 /* IndexedAccess */ && template.objectType === source && + template.indexType === getTypeParameterFromMappedType(target)) { + return -1 /* True */; + } + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } if (source.flags & 32768 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(source); + var constraint = getConstraintForRelation(source); // A type parameter with no constraint is not related to the non-primitive object type. - if (constraint || !(target.flags & 33554432 /* NonPrimitive */)) { + if (constraint || !(target.flags & 134217728 /* NonPrimitive */)) { if (!constraint || constraint.flags & 1 /* Any */) { constraint = emptyObjectType; } @@ -33051,25 +33832,53 @@ var ts; else if (source.flags & 1048576 /* IndexedAccess */) { // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and // A is the apparent type of S. - var constraint = getConstraintOfIndexedAccess(source); + var constraint = getConstraintForRelation(source); if (constraint) { if (result = isRelatedTo(constraint, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } } - else if (target.flags & 1048576 /* IndexedAccess */ && source.indexType === target.indexType) { - // if we have indexed access types with identical index types, see if relationship holds for - // the two object types. + else if (target.flags & 1048576 /* IndexedAccess */) { if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + result &= isRelatedTo(source.indexType, target.indexType, reportErrors); + } + if (result) { errorInfo = saveErrorInfo; return result; } } } + else if (source.flags & 2097152 /* Conditional */) { + if (relation !== definitelyAssignableRelation) { + var constraint = getConstraintOfDistributiveConditionalType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (target.flags & 2097152 /* Conditional */) { + if (isTypeIdenticalTo(source.checkType, target.checkType) && + isTypeIdenticalTo(source.extendsType, target.extendsType)) { + if (result = isRelatedTo(source.trueType, target.trueType, reportErrors)) { + result &= isRelatedTo(source.falseType, target.falseType, reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } else { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && - !(source.flags & 134217728 /* MarkerType */ || target.flags & 134217728 /* MarkerType */)) { + !(ts.getObjectFlags(source) & 8192 /* MarkerType */ || ts.getObjectFlags(target) & 8192 /* MarkerType */)) { // We have type references to the same generic type, and the type references are not marker // type references (which are intended by be compared structurally). Obtain the variance // information for the type parameters and relate the type arguments accordingly. @@ -33151,8 +33960,7 @@ var ts; // that S and T are contra-variant whereas X and Y are co-variant. function mappedTypeRelatedTo(source, target, reportErrors) { var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & 2 /* Optional */) || - getCombinedMappedTypeModifiers(target) & 2 /* Optional */); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { var result_1; if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -33195,6 +34003,9 @@ var ts; if (!(targetProp.flags & 4194304 /* Prototype */)) { var sourceProp = getPropertyOfType(source, targetProp.escapedName); if (sourceProp && sourceProp !== targetProp) { + if (isIgnoredJsxProperty(source, sourceProp, getTypeOfSymbol(targetProp))) { + continue; + } var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { @@ -33275,7 +34086,7 @@ var ts; return false; } function hasCommonProperties(source, target) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -33405,6 +34216,9 @@ var ts; var result = -1 /* True */; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; + if (isIgnoredJsxProperty(source, prop, /*targetMemberType*/ undefined)) { + continue; + } if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) { var related = isRelatedTo(getTypeOfSymbol(prop), target, reportErrors); if (!related) { @@ -33501,7 +34315,7 @@ var ts; // type, and flag the result as a marker type reference. function getMarkerTypeReference(type, source, target) { var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; })); - result.flags |= 134217728 /* MarkerType */; + result.objectFlags |= 8192 /* MarkerType */; return result; } // Return an array containing the variance of each type parameter. The variance is effectively @@ -33574,7 +34388,7 @@ var ts; for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { var t = _a[_i]; if (isUnconstrainedTypeParameter(t)) { - var index = ts.indexOf(typeParameters, t); + var index = typeParameters.indexOf(t); if (index < 0) { index = typeParameters.length; typeParameters.push(t); @@ -33765,17 +34579,25 @@ var ts; result &= related; } if (!ignoreReturnTypes) { - result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + result &= sourceTypePredicate !== undefined || targetTypePredicate !== undefined + ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) + // If they're both type predicates their return types will both be `boolean`, so no need to compare those. + : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } return result; } + function compareTypePredicatesIdentical(source, target, compareTypes) { + return source === undefined || target === undefined || !typePredicateKindsMatch(source, target) ? 0 /* False */ : compareTypes(source.type, target.type); + } function isRestParameterIndex(signature, parameterIndex) { return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var t = types_9[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -33801,7 +34623,7 @@ var ts; var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 12288 /* Nullable */); }); return primaryTypes.length ? getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 12288 /* Nullable */) : - getUnionType(types, /*subtypeReduction*/ true); + getUnionType(types, 2 /* Subtype */); } // Return the leftmost type for which no type to the right is a subtype. function getCommonSubtype(types) { @@ -33841,8 +34663,8 @@ var ts; } function getWidenedLiteralType(type) { return type.flags & 256 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : - type.flags & 32 /* StringLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? stringType : - type.flags & 64 /* NumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? numberType : + type.flags & 32 /* StringLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? stringType : + type.flags & 64 /* NumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? numberType : type.flags & 128 /* BooleanLiteral */ ? booleanType : type.flags & 131072 /* Union */ ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) : type; @@ -33867,8 +34689,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; result |= getFalsyFlags(t); } return result; @@ -33954,7 +34776,7 @@ var ts; * Leave signatures alone since they are not subject to the check. */ function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType(type) && type.flags & 2097152 /* FreshLiteral */)) { + if (!(isObjectLiteralType(type) && type.flags & 8388608 /* FreshLiteral */)) { return type; } var regularType = type.regularType; @@ -33964,7 +34786,7 @@ var ts; var resolved = type; var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo); - regularNew.flags = resolved.flags & ~2097152 /* FreshLiteral */; + regularNew.flags = resolved.flags & ~8388608 /* FreshLiteral */; regularNew.objectFlags |= 128 /* ObjectLiteral */; type.regularType = regularNew; return regularNew; @@ -34046,7 +34868,7 @@ var ts; return getWidenedTypeWithContext(type, /*context*/ undefined); } function getWidenedTypeWithContext(type, context) { - if (type.flags & 12582912 /* RequiresWidening */) { + if (type.flags & 50331648 /* RequiresWidening */) { if (type.flags & 12288 /* Nullable */) { return anyType; } @@ -34059,7 +34881,7 @@ var ts; // Widening an empty object literal transitions from a highly restrictive type to // a highly inclusive one. For that reason we perform subtype reduction here if the // union includes empty object types (e.g. reducing {} | string to just {}). - return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType)); + return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); } if (isArrayType(type) || isTupleType(type)) { return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); @@ -34080,7 +34902,7 @@ var ts; */ function reportWideningErrorsInType(type) { var errorReported = false; - if (type.flags & 4194304 /* ContainsWideningType */) { + if (type.flags & 16777216 /* ContainsWideningType */) { if (type.flags & 131072 /* Union */) { if (ts.some(type.types, isEmptyObjectType)) { errorReported = true; @@ -34106,9 +34928,9 @@ var ts; for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); - if (t.flags & 4194304 /* ContainsWideningType */) { + if (t.flags & 16777216 /* ContainsWideningType */) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, ts.symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -34121,38 +34943,41 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 147 /* Parameter */: + case 148 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; + case 176 /* MappedType */: + error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + return; default: diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && noImplicitAny && type.flags & 4194304 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 16777216 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -34201,6 +35026,7 @@ var ts; return { typeParameter: typeParameter, candidates: undefined, + contraCandidates: undefined, inferredType: undefined, priority: undefined, topLevel: true, @@ -34211,6 +35037,7 @@ var ts; return { typeParameter: inference.typeParameter, candidates: inference.candidates && inference.candidates.slice(), + contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), inferredType: inference.inferredType, priority: inference.priority, topLevel: inference.topLevel, @@ -34222,7 +35049,7 @@ var ts; // results for union and intersection types for performance reasons. function couldContainTypeVariables(type) { var objectFlags = ts.getObjectFlags(type); - return !!(type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) || + return !!(type.flags & 7897088 /* Instantiable */ || objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || objectFlags & 32 /* Mapped */ || @@ -34237,7 +35064,7 @@ var ts; function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 393216 /* UnionOrIntersection */ && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - /** Create an object with properties named in the string literal type. Every property has type `{}` */ + /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { var members = ts.createSymbolTable(); forEachType(type, function (t) { @@ -34246,7 +35073,7 @@ var ts; } var name = ts.escapeLeadingUnderscores(t.value); var literalProp = createSymbol(4 /* Property */, name); - literalProp.type = emptyObjectType; + literalProp.type = anyType; if (t.symbol) { literalProp.declarations = t.symbol.declarations; literalProp.valueDeclaration = t.symbol.valueDeclaration; @@ -34262,42 +35089,43 @@ var ts; * property is computed by inferring from the source property type to X for the type * variable T[P] (i.e. we treat the type T[P] as the type variable we're inferring for). */ - function inferTypeForHomomorphicMappedType(source, target, mappedTypeStack) { + function inferTypeForHomomorphicMappedType(source, target) { + var key = source.id + "," + target.id; + if (reverseMappedCache.has(key)) { + return reverseMappedCache.get(key); + } + reverseMappedCache.set(key, undefined); + var type = createReverseMappedType(source, target); + reverseMappedCache.set(key, type); + return type; + } + function createReverseMappedType(source, target) { var properties = getPropertiesOfType(source); - var indexInfo = getIndexInfoOfType(source, 0 /* String */); - if (properties.length === 0 && !indexInfo) { + if (properties.length === 0 && !getIndexInfoOfType(source, 0 /* String */)) { return undefined; } - var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); - var inference = createInferenceInfo(typeParameter); - var inferences = [inference]; - var templateType = getTemplateTypeFromMappedType(target); - var readonlyMask = target.declaration.readonlyToken ? false : true; - var optionalMask = target.declaration.questionToken ? 0 : 16777216 /* Optional */; - var members = ts.createSymbolTable(); + // If any property contains context sensitive functions that have been skipped, the source type + // is incomplete and we can't infer a meaningful input type. for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { var prop = properties_4[_i]; - var propType = getTypeOfSymbol(prop); - // If any property contains context sensitive functions that have been skipped, the source type - // is incomplete and we can't infer a meaningful input type. - if (propType.flags & 16777216 /* ContainsAnyFunctionType */) { + if (getTypeOfSymbol(prop).flags & 67108864 /* ContainsAnyFunctionType */) { return undefined; } - var checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0; - var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); - inferredProp.declarations = prop.declarations; - inferredProp.type = inferTargetType(propType); - members.set(prop.escapedName, inferredProp); - } - if (indexInfo) { - indexInfo = createIndexInfo(inferTargetType(indexInfo.type), readonlyMask && indexInfo.isReadonly); - } - return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined); - function inferTargetType(sourceType) { - inference.candidates = undefined; - inferTypes(inferences, sourceType, templateType, 0, mappedTypeStack); - return inference.candidates ? getUnionType(inference.candidates, /*subtypeReduction*/ true) : emptyObjectType; } + var reversed = createObjectType(2048 /* ReverseMapped */ | 16 /* Anonymous */, /*symbol*/ undefined); + reversed.source = source; + reversed.mappedType = target; + return reversed; + } + function getTypeOfReverseMappedSymbol(symbol) { + return inferReverseMappedType(symbol.propertyType, symbol.mappedType); + } + function inferReverseMappedType(sourceType, target) { + var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + var inference = createInferenceInfo(typeParameter); + inferTypes([inference], sourceType, templateType); + return getTypeFromInference(inference) || emptyObjectType; } function getUnmatchedProperty(source, target, requireOptionalProperties) { var properties = target.flags & 262144 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); @@ -34312,10 +35140,16 @@ var ts; } return undefined; } - function inferTypes(inferences, originalSource, originalTarget, priority, mappedTypeStack) { + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : + inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : + undefined; + } + function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; var visited; + var contravariant = false; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -34378,31 +35212,33 @@ var ts; // not contain anyFunctionType when we come back to this argument for its second round // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard // when constructing types from type parameters that had no inference candidates). - if (source.flags & 16777216 /* ContainsAnyFunctionType */ || source === silentNeverType) { + if (source.flags & 67108864 /* ContainsAnyFunctionType */ || source === silentNeverType) { return; } var inference = getInferenceInfoForType(target); if (inference) { if (!inference.isFixed) { - // We give lowest priority to inferences of implicitNeverType (which is used as the - // element type for empty array literals). Thus, inferences from empty array literals - // only matter when no other inferences are made. - var p = priority | (source === implicitNeverType ? 16 /* NeverType */ : 0); - if (!inference.candidates || p < inference.priority) { - inference.candidates = [source]; - inference.priority = p; + if (inference.priority === undefined || priority < inference.priority) { + inference.candidates = undefined; + inference.contraCandidates = undefined; + inference.priority = priority; } - else if (p === inference.priority) { - inference.candidates.push(source); + if (priority === inference.priority) { + if (contravariant) { + inference.contraCandidates = ts.append(inference.contraCandidates, source); + } + else { + inference.candidates = ts.append(inference.candidates, source); + } } - if (!(p & 8 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 4 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; } } return; } } - else if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { + if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { // If source and target are references to the same generic type, infer from type arguments var sourceTypes = source.typeArguments || ts.emptyArray; var targetTypes = target.typeArguments || ts.emptyArray; @@ -34418,20 +35254,26 @@ var ts; } } else if (source.flags & 524288 /* Index */ && target.flags & 524288 /* Index */) { - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; inferFromTypes(source.type, target.type); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else if ((isLiteralType(source) || source.flags & 2 /* String */) && target.flags & 524288 /* Index */) { var empty = createEmptyObjectTypeFromStringLiteral(source); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; inferFromTypes(empty, target.type); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else if (source.flags & 1048576 /* IndexedAccess */ && target.flags & 1048576 /* IndexedAccess */) { inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } + else if (source.flags & 2097152 /* Conditional */ && target.flags & 2097152 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(source.trueType, target.trueType); + inferFromTypes(source.falseType, target.falseType); + } else if (target.flags & 393216 /* UnionOrIntersection */) { var targetTypes = target.types; var typeVariableCount = 0; @@ -34452,7 +35294,7 @@ var ts; // types in contra-variant positions (such as callback parameters). if (typeVariableCount === 1) { var savePriority = priority; - priority |= 2 /* NakedTypeVariable */; + priority |= 1 /* NakedTypeVariable */; inferFromTypes(source, typeVariable); priority = savePriority; } @@ -34466,7 +35308,9 @@ var ts; } } else { - source = getApparentType(source); + if (!(priority && 8 /* NoConstraints */ && source.flags & (262144 /* Intersection */ | 7897088 /* Instantiable */))) { + source = getApparentType(source); + } if (source.flags & (65536 /* Object */ | 262144 /* Intersection */)) { var key = source.id + "," + target.id; if (visited && visited.get(key)) { @@ -34495,10 +35339,10 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes) { - priority ^= 1 /* Contravariant */; + if (strictFunctionTypes || priority & 16 /* AlwaysStrict */) { + contravariant = !contravariant; inferFromTypes(source, target); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else { inferFromTypes(source, target); @@ -34531,16 +35375,10 @@ var ts; // such that direct inferences to T get priority over inferences to Partial, for example. var inference = getInferenceInfoForType(constraintType.type); if (inference && !inference.isFixed) { - var key = (source.symbol ? getSymbolId(source.symbol) + "," : "") + getSymbolId(target.symbol); - if (ts.contains(mappedTypeStack, key)) { - return; - } - (mappedTypeStack || (mappedTypeStack = [])).push(key); - var inferredType = inferTypeForHomomorphicMappedType(source, target, mappedTypeStack); - mappedTypeStack.pop(); + var inferredType = inferTypeForHomomorphicMappedType(source, target); if (inferredType) { var savePriority = priority; - priority |= 4 /* MappedType */; + priority |= 2 /* MappedType */; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -34586,8 +35424,10 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromContravariantTypes); - if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) { - inferFromTypes(source.typePredicate.type, target.typePredicate.type); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (sourceTypePredicate && targetTypePredicate && sourceTypePredicate.kind === targetTypePredicate.kind) { + inferFromTypes(sourceTypePredicate.type, targetTypePredicate.type); } else { inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -34614,8 +35454,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -34647,7 +35487,7 @@ var ts; if (candidates.length > 1) { var objectLiterals = ts.filter(candidates, isObjectLiteralType); if (objectLiterals.length) { - var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, /*subtypeReduction*/ true)); + var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, 2 /* Subtype */)); return ts.concatenate(ts.filter(candidates, function (t) { return !isObjectLiteralType(t); }), [objectLiteralsType]); } } @@ -34672,10 +35512,19 @@ var ts; // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if // union types were requested or if all inferences were made from the return type position, infer a // union type. Otherwise, infer a common supertype. - var unwidenedType = inference.priority & 1 /* Contravariant */ ? getCommonSubtype(baseCandidates) : - context.flags & 1 /* InferUnionTypes */ || inference.priority & 8 /* ReturnType */ ? getUnionType(baseCandidates, /*subtypeReduction*/ true) : - getCommonSupertype(baseCandidates); + var unwidenedType = context.flags & 1 /* InferUnionTypes */ || inference.priority & 4 /* ReturnType */ ? + getUnionType(baseCandidates, 2 /* Subtype */) : + getCommonSupertype(baseCandidates); inferredType = getWidenedType(unwidenedType); + // If we have inferred 'never' but have contravariant candidates. To get a more specific type we + // infer from the contravariant candidates instead. + if (inferredType.flags & 16384 /* Never */ && inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); + } + } + else if (inference.contraCandidates) { + // We only have contravariant inferences, infer the best common subtype of those + inferredType = getCommonSubtype(inference.contraCandidates); } else if (context.flags & 2 /* NoDefault */) { // We use silentNeverType as the wildcard that signals no inferences. @@ -34724,7 +35573,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; + resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), + /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; } @@ -34732,7 +35582,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 163 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 144 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 164 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 145 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -34748,13 +35598,13 @@ var ts; if (node.kind === 99 /* ThisKeyword */) { return "0"; } - if (node.kind === 180 /* PropertyAccessExpression */) { + if (node.kind === 183 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + ts.idText(node.name); } - if (node.kind === 177 /* BindingElement */) { + if (node.kind === 180 /* BindingElement */) { var container = node.parent.parent; - var key = container.kind === 177 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); + var key = container.kind === 180 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); var text = getBindingElementNameText(node); var result = key && text && (key + "." + text); return result; @@ -34762,12 +35612,12 @@ var ts; return undefined; } function getBindingElementNameText(element) { - if (element.parent.kind === 175 /* ObjectBindingPattern */) { + if (element.parent.kind === 178 /* ObjectBindingPattern */) { var name = element.propertyName || element.name; switch (name.kind) { case 71 /* Identifier */: return ts.idText(name); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -34785,26 +35635,26 @@ var ts; switch (source.kind) { case 71 /* Identifier */: return target.kind === 71 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 227 /* VariableDeclaration */ || target.kind === 177 /* BindingElement */) && + (target.kind === 230 /* VariableDeclaration */ || target.kind === 180 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 99 /* ThisKeyword */: return target.kind === 99 /* ThisKeyword */; case 97 /* SuperKeyword */: return target.kind === 97 /* SuperKeyword */; - case 180 /* PropertyAccessExpression */: - return target.kind === 180 /* PropertyAccessExpression */ && + case 183 /* PropertyAccessExpression */: + return target.kind === 183 /* PropertyAccessExpression */ && source.name.escapedText === target.name.escapedText && isMatchingReference(source.expression, target.expression); - case 177 /* BindingElement */: - if (target.kind !== 180 /* PropertyAccessExpression */) + case 180 /* BindingElement */: + if (target.kind !== 183 /* PropertyAccessExpression */) return false; var t = target; if (t.name.escapedText !== getBindingElementNameText(source)) return false; - if (source.parent.parent.kind === 177 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { + if (source.parent.parent.kind === 180 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { return true; } - if (source.parent.parent.kind === 227 /* VariableDeclaration */) { + if (source.parent.parent.kind === 230 /* VariableDeclaration */) { var maybeId = source.parent.parent.initializer; return maybeId && isMatchingReference(maybeId, t.expression); } @@ -34812,7 +35662,7 @@ var ts; return false; } function containsMatchingReference(source, target) { - while (source.kind === 180 /* PropertyAccessExpression */) { + while (source.kind === 183 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -34825,7 +35675,7 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 180 /* PropertyAccessExpression */ && + return target.kind === 183 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); } @@ -34833,7 +35683,7 @@ var ts; if (expr.kind === 71 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.escapedText); } @@ -34877,7 +35727,7 @@ var ts; } } } - if (callExpression.expression.kind === 180 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 183 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -34919,8 +35769,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getTypeFacts(t); } return result; @@ -34974,10 +35824,10 @@ var ts; if (flags & 1536 /* ESSymbolLike */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 33554432 /* NonPrimitive */) { + if (flags & 134217728 /* NonPrimitive */) { return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; } - if (flags & 1081344 /* TypeVariable */) { + if (flags & 7897088 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 393216 /* UnionOrIntersection */) { @@ -34986,16 +35836,6 @@ var ts; return 8388607 /* All */; } function getTypeWithFacts(type, include) { - if (type.flags & 1048576 /* IndexedAccess */) { - // TODO (weswig): This is a substitute for a lazy negated type to remove the types indicated by the TypeFacts from the (potential) union the IndexedAccess refers to - // - See discussion in https://github.com/Microsoft/TypeScript/pull/19275 for details, and test `strictNullNotNullIndexTypeShouldWork` for current behavior - var baseConstraint = getBaseConstraintOfType(type) || emptyObjectType; - var result = filterType(baseConstraint, function (t) { return (getTypeFacts(t) & include) !== 0; }); - if (result !== baseConstraint) { - return result; - } - return type; - } return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; }); } function getTypeWithDefault(type, defaultExpression) { @@ -35021,18 +35861,18 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 178 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 181 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 268 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 195 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 217 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 220 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { - return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); + return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); } function getAssignedTypeOfSpreadExpression(node) { return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); @@ -35046,21 +35886,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return stringType; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return undefinedType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -35068,10 +35908,10 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 175 /* ObjectBindingPattern */ ? + var type = pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? - getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : + getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } @@ -35086,35 +35926,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 216 /* ForInStatement */) { + if (node.parent.parent.kind === 219 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.parent.kind === 220 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 227 /* VariableDeclaration */ ? + return node.kind === 230 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */ ? + return node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 227 /* VariableDeclaration */ && node.initializer && + return node.kind === 230 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 177 /* BindingElement */ && node.parent.kind === 195 /* BinaryExpression */ && + node.kind !== 180 /* BindingElement */ && node.parent.kind === 198 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (node.operatorToken.kind) { case 58 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -35126,13 +35966,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 186 /* ParenthesizedExpression */ || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? + return parent.kind === 189 /* ParenthesizedExpression */ || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 261 /* CaseClause */) { + if (clause.kind === 264 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -35190,15 +36030,15 @@ var ts; // Apply a mapping function to a type and return the resulting type. If the source type // is a union type, the mapping function is applied to each constituent type and a union // of the resulting types is returned. - function mapType(type, mapper) { + function mapType(type, mapper, noReductions) { if (!(type.flags & 131072 /* Union */)) { return mapper(type); } var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var current = types_13[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -35212,7 +36052,7 @@ var ts; } } } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; + return mappedTypes ? getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -35263,7 +36103,7 @@ var ts; return elementType.flags & 16384 /* Never */ ? autoArrayType : createArrayType(elementType.flags & 131072 /* Union */ ? - getUnionType(elementType.types, /*subtypeReduction*/ true) : + getUnionType(elementType.types, 2 /* Subtype */) : elementType); } // We perform subtype reduction upon obtaining the final array type from an evolving array type. @@ -35278,8 +36118,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; if (!(t.flags & 16384 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -35302,11 +36142,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 180 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || - parent.parent.kind === 182 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 181 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 183 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || + parent.parent.kind === 185 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 184 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 195 /* BinaryExpression */ && + parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -35325,10 +36165,7 @@ var ts; var funcType = checkNonNullExpression(node.expression); if (funcType !== silentNeverType) { var apparentType = getApparentType(funcType); - if (apparentType !== unknownType) { - var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - return !!ts.forEach(callSignatures, function (sig) { return sig.typePredicate; }); - } + return apparentType !== unknownType && ts.some(getSignaturesOfType(apparentType, 0 /* Call */), signatureHasTypePredicate); } } return false; @@ -35346,7 +36183,7 @@ var ts; if (flowAnalysisDisabled) { return unknownType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 35620607 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359 /* Narrowable */)) { return declaredType; } var sharedFlowStart = sharedFlowCount; @@ -35357,7 +36194,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent && reference.parent.kind === 204 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { + if (reference.parent && reference.parent.kind === 207 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { return declaredType; } return resultType; @@ -35428,7 +36265,7 @@ var ts; else if (flags & 2 /* Start */) { // Check if we should continue with the control flow of the containing function. var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 180 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { + if (container && container !== flowContainer && reference.kind !== 183 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -35484,7 +36321,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 182 /* CallExpression */ ? + var expr = node.kind === 185 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -35492,7 +36329,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -35578,7 +36415,7 @@ var ts; seenIncomplete = true; } } - return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete); + return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */), seenIncomplete); } function getTypeAtFlowLoopLabel(flow) { // If we have previously computed the control flow type for the reference at @@ -35606,7 +36443,7 @@ var ts; // path that leads to the top. for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { - return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], /*subtypeReduction*/ false), /*incomplete*/ true); + return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], 1 /* Literal */), /*incomplete*/ true); } } // Add the flow loop junction and reference to the in-process stack and analyze @@ -35626,7 +36463,7 @@ var ts; firstAntecedentType = flowType; } var type = getTypeFromFlowType(flowType); - // If we see a value appear in the cache it is a sign that control flow analysis + // If we see a value appear in the cache it is a sign that control flow analysis // was restarted and completed by checkExpressionCached. We can simply pick up // the resulting type and bail out. var cached_1 = cache.get(key); @@ -35649,7 +36486,7 @@ var ts; } // The result is incomplete if the first antecedent (the non-looping control flow path) // is incomplete. - var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction); + var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */); if (isIncomplete(firstAntecedentType)) { return createFlowType(result, /*incomplete*/ true); } @@ -35657,7 +36494,7 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - return expr.kind === 180 /* PropertyAccessExpression */ && + return expr.kind === 183 /* PropertyAccessExpression */ && computedType.flags & 131072 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, expr.name.escapedText); @@ -35680,6 +36517,23 @@ var ts; } return type; } + function isTypePresencePossible(type, propName, assumeTrue) { + if (getIndexInfoOfType(type, 0 /* String */)) { + return true; + } + var prop = getPropertyOfType(type, propName); + if (prop) { + return prop.flags & 16777216 /* Optional */ ? true : assumeTrue; + } + return !assumeTrue; + } + function narrowByInKeyword(type, literal, assumeTrue) { + if ((type.flags & (131072 /* Union */ | 65536 /* Object */)) || (type.flags & 32768 /* TypeParameter */ && type.isThisType)) { + var propName_1 = ts.escapeLeadingUnderscores(literal.text); + return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); }); + } + return type; + } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: @@ -35691,10 +36545,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 190 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { + if (left_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 190 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { + if (right_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -35715,6 +36569,12 @@ var ts; break; case 93 /* InstanceOfKeyword */: return narrowTypeByInstanceof(type, expr, assumeTrue); + case 92 /* InKeyword */: + var target = getReferenceCandidate(expr.right); + if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { + return narrowByInKeyword(type, expr.left, assumeTrue); + } + break; case 26 /* CommaToken */: return narrowType(type, expr.right, assumeTrue); } @@ -35740,7 +36600,7 @@ var ts; assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33620481 /* NotUnionOrUnit */) { + if (type.flags & 134283777 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -35776,7 +36636,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 1081344 /* TypeVariable */) { + if (type.flags & 7897088 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -35799,7 +36659,7 @@ var ts; var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType); var discriminantType = getUnionType(clauseTypes); var caseType = discriminantType.flags & 16384 /* Never */ ? neverType : - replacePrimitivesWithLiterals(filterType(type, function (t) { return isTypeComparableTo(discriminantType, t); }), discriminantType); + replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType); if (!hasDefaultClause) { return caseType; } @@ -35879,7 +36739,7 @@ var ts; return type; } var signature = getResolvedSignature(callExpression); - var predicate = signature.typePredicate; + var predicate = getTypePredicateOfSignature(signature); if (!predicate) { return type; } @@ -35900,7 +36760,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 181 /* ElementAccessExpression */ || invokedExpression.kind === 180 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 184 /* ElementAccessExpression */ || invokedExpression.kind === 183 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -35920,15 +36780,15 @@ var ts; case 71 /* Identifier */: case 99 /* ThisKeyword */: case 97 /* SuperKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (expr.operator === 51 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -35964,9 +36824,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 235 /* ModuleBlock */ || - node.kind === 269 /* SourceFile */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 238 /* ModuleBlock */ || + node.kind === 272 /* SourceFile */ || + node.kind === 151 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -35988,7 +36848,7 @@ var ts; if (node.kind === 71 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 147 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148 /* Parameter */) { symbol.isAssigned = true; } } @@ -36003,7 +36863,7 @@ var ts; /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 147 /* Parameter */ && + declaration.kind === 148 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 4096 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096 /* Undefined */); @@ -36011,24 +36871,30 @@ var ts; } function isApparentTypePosition(node) { var parent = node.parent; - return parent.kind === 180 /* PropertyAccessExpression */ || - parent.kind === 182 /* CallExpression */ && parent.expression === node || - parent.kind === 181 /* ElementAccessExpression */ && parent.expression === node; + return parent.kind === 183 /* PropertyAccessExpression */ || + parent.kind === 185 /* CallExpression */ && parent.expression === node || + parent.kind === 184 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 207 /* NonNullExpression */ || + parent.kind === 180 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 1081344 /* TypeVariable */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); + return type.flags & 7372800 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); } - function getDeclaredOrApparentType(symbol, node) { + function getApparentTypeForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, // and the type of the node includes type variables with constraints that are nullable, we fetch the // apparent type of the node *before* performing control flow analysis such that narrowings apply to // the constraint type. - var type = getTypeOfSymbol(symbol); if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { return mapType(getWidenedType(type), getApparentType); } return type; } + function markAliasReferenced(symbol, location) { + if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + markAliasSymbolAsReferenced(symbol); + } + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -36043,7 +36909,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -36054,9 +36920,9 @@ var ts; return getTypeOfSymbol(symbol); } // We should only mark aliases as referenced if there isn't a local value declaration - // for the symbol. - if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { - markAliasSymbolAsReferenced(symbol); + // for the symbol. Also, don't mark any property access expression LHS - checkPropertyAccessExpression will handle that + if (!(node.parent && ts.isPropertyAccessExpression(node.parent) && node.parent.expression === node)) { + markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -36064,7 +36930,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 230 /* ClassDeclaration */ + if (declaration.kind === 233 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -36076,14 +36942,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 200 /* ClassExpression */) { + else if (declaration.kind === 203 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); while (container !== undefined) { if (container.parent === declaration) { - if (container.kind === 150 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 151 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -36097,7 +36963,7 @@ var ts; checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - var type = getDeclaredOrApparentType(localOrExportSymbol, node); + var type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { if (!(localOrExportSymbol.flags & 3 /* Variable */)) { @@ -36129,28 +36995,29 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 147 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 148 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; + var isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 187 /* FunctionExpression */ || - flowContainer.kind === 188 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 190 /* FunctionExpression */ || + flowContainer.kind === 191 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } // We only look for uninitialized variables in strict null checking mode, and only when we can analyze // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). - var assumeInitialized = isParameter || isAlias || isOuterVariable || + var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || - isInTypeQuery(node) || node.parent.kind === 247 /* ExportSpecifier */) || - node.parent.kind === 204 /* NonNullExpression */ || - declaration.kind === 227 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 250 /* ExportSpecifier */) || + node.parent.kind === 207 /* NonNullExpression */ || + declaration.kind === 230 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 2097152 /* Ambient */; - var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); @@ -36179,7 +37046,7 @@ var ts; function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 264 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 267 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -36204,8 +37071,8 @@ var ts; } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. - if (container.kind === 215 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 228 /* VariableDeclarationList */).parent === container && + if (container.kind === 218 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 231 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -36219,7 +37086,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 186 /* ParenthesizedExpression */) { + while (current.parent.kind === 189 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -36227,7 +37094,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 193 /* PrefixUnaryExpression */ || current.parent.kind === 194 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 196 /* PrefixUnaryExpression */ || current.parent.kind === 197 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; } @@ -36240,7 +37107,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 150 /* PropertyDeclaration */ || container.kind === 153 /* Constructor */) { + if (container.kind === 151 /* PropertyDeclaration */ || container.kind === 154 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -36308,51 +37175,60 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 153 /* Constructor */) { + if (container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES2015 */); } switch (container.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 153 /* Constructor */: + case 154 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } + var type = tryGetThisTypeAt(node, container); + if (!type && noImplicitThis) { + // With noImplicitThis, functions may not reference 'this' if it has type 'any' + error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + } + return type || anyType; + } + function tryGetThisTypeAt(node, container) { + if (container === void 0) { container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (container.kind === 187 /* FunctionExpression */ && - container.parent.kind === 195 /* BinaryExpression */ && + if (container.kind === 190 /* FunctionExpression */ && + container.parent.kind === 198 /* BinaryExpression */ && ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.prototype.y = f @@ -36361,12 +37237,12 @@ var ts; .expression; // x var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { - return getInferredClassType(classSymbol); + return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { - return thisType; + return getFlowTypeOfReference(node, thisType); } } if (ts.isClassLike(container.parent)) { @@ -36377,18 +37253,13 @@ var ts; if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); if (type && type !== unknownType) { - return type; + return getFlowTypeOfReference(node, type); } } - if (noImplicitThis) { - // With noImplicitThis, functions may not reference 'this' if it has type 'any' - error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); - } - return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 277 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 280 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -36398,15 +37269,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 147 /* Parameter */; }); + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 182 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 185 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 188 /* ArrowFunction */) { + while (container && container.kind === 191 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -36419,14 +37290,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 145 /* ComputedPropertyName */; }); - if (current && current.kind === 145 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146 /* ComputedPropertyName */; }); + if (current && current.kind === 146 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -36434,7 +37305,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 153 /* Constructor */) { + if (!isCallExpression && container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -36500,7 +37371,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 152 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 153 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -36514,7 +37385,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (container.parent.kind === 182 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -36535,7 +37406,7 @@ var ts; if (!baseClassType) { return unknownType; } - if (container.kind === 153 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 154 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -36550,7 +37421,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 153 /* Constructor */; + return container.kind === 154 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -36558,21 +37429,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */; } else { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */ || - container.kind === 150 /* PropertyDeclaration */ || - container.kind === 149 /* PropertySignature */ || - container.kind === 153 /* Constructor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */ || + container.kind === 151 /* PropertyDeclaration */ || + container.kind === 150 /* PropertySignature */ || + container.kind === 154 /* Constructor */; } } } @@ -36580,10 +37451,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 152 /* MethodDeclaration */ || - func.kind === 154 /* GetAccessor */ || - func.kind === 155 /* SetAccessor */) && func.parent.kind === 179 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 187 /* FunctionExpression */ && func.parent.kind === 265 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 153 /* MethodDeclaration */ || + func.kind === 155 /* GetAccessor */ || + func.kind === 156 /* SetAccessor */) && func.parent.kind === 182 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 190 /* FunctionExpression */ && func.parent.kind === 268 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -36595,7 +37466,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 188 /* ArrowFunction */) { + if (func.kind === 191 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -36622,7 +37493,7 @@ var ts; if (thisType) { return instantiateType(thisType, getContextualMapper(containingLiteral)); } - if (literal.parent.kind !== 265 /* PropertyAssignment */) { + if (literal.parent.kind !== 268 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -36636,9 +37507,9 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = func.parent; - if (parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { + if (parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { var target = parent.left; - if (target.kind === 180 /* PropertyAccessExpression */ || target.kind === 181 /* ElementAccessExpression */) { + if (target.kind === 183 /* PropertyAccessExpression */ || target.kind === 184 /* ElementAccessExpression */) { var expression = target.expression; // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }` if (inJs && ts.isIdentifier(expression)) { @@ -36659,7 +37530,7 @@ var ts; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); if (iife && iife.arguments) { - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (parameter.dotDotDotToken) { var restTypes = []; for (var i = indexOfParameter; i < iife.arguments.length; i++) { @@ -36680,7 +37551,7 @@ var ts; if (contextualSignature) { var funcHasRestParameters = ts.hasRestParameter(func); var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (ts.getThisParameter(func) !== undefined && !contextualSignature.thisParameter) { ts.Debug.assert(indexOfParameter !== 0); // Otherwise we should not have called `getContextuallyTypedParameterType`. indexOfParameter -= 1; @@ -36708,12 +37579,12 @@ var ts; // the contextual type of an initializer expression is the type annotation of the containing declaration, if present. function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; - if (node === declaration.initializer || node.kind === 58 /* EqualsToken */) { + if (ts.hasInitializer(declaration) && node === declaration.initializer) { var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -36725,7 +37596,7 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 177 /* BindingElement */) { + if (parentDeclaration.kind !== 180 /* BindingElement */) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !ts.isBindingPattern(name)) { var text = ts.getTextOfPropertyName(name); @@ -36781,7 +37652,7 @@ var ts; function getContextualReturnType(functionDecl) { // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed - if (functionDecl.kind === 153 /* Constructor */ || + if (functionDecl.kind === 154 /* Constructor */ || ts.getEffectiveReturnTypeNode(functionDecl) || isGetAccessorWithAnnotatedSetAccessor(functionDecl)) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); @@ -36797,17 +37668,17 @@ var ts; // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); - var argIndex = ts.indexOf(args, arg); - if (argIndex >= 0) { - // If we're already in the process of resolving the given signature, don't resolve again as - // that could cause infinite recursion. Instead, return anySignature. - var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + // If we're already in the process of resolving the given signature, don't resolve again as + // that could cause infinite recursion. Instead, return anySignature. + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 184 /* TaggedTemplateExpression */) { + if (template.parent.kind === 187 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -36826,12 +37697,6 @@ var ts; case 53 /* AmpersandAmpersandToken */: case 26 /* CommaToken */: return node === right ? getContextualType(binaryExpression) : undefined; - case 34 /* EqualsEqualsEqualsToken */: - case 32 /* EqualsEqualsToken */: - case 35 /* ExclamationEqualsEqualsToken */: - case 33 /* ExclamationEqualsToken */: - // For completions after `x === ` - return node === operatorToken ? getTypeOfExpression(binaryExpression.left) : undefined; default: return undefined; } @@ -36860,10 +37725,10 @@ var ts; return mapType(type, function (t) { var prop = t.flags & 458752 /* StructuredType */ ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; - }); + }, /*noReductions*/ true); } function getIndexTypeOfContextualType(type, kind) { - return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, /*noReductions*/ true); } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { @@ -36913,50 +37778,33 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + function getContextualTypeForChildJsxExpression(node) { + var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); + // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; + } function getContextualTypeForJsxExpression(node) { - // JSX expression can appear in two position : JSX Element's children or JSX attribute - var jsxAttributes = ts.isJsxAttributeLike(node.parent) ? - node.parent.parent : - ts.isJsxElement(node.parent) ? - node.parent.openingElement.attributes : - undefined; // node.parent is JsxFragment with no attributes - if (!jsxAttributes) { - return undefined; // don't check children of a fragment - } - // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type - // which is a type of the parameter of the signature we are trying out. - // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName - var attributesType = getContextualType(jsxAttributes); - if (!attributesType || isTypeAny(attributesType)) { - return undefined; - } - if (ts.isJsxAttribute(node.parent)) { - // JSX expression is in JSX attribute - return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); - } - else if (node.parent.kind === 250 /* JsxElement */) { - // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; - } - else { - // JSX expression is in JSX spread attribute - return attributesType; - } + var exprParent = node.parent; + return ts.isJsxAttributeLike(exprParent) + ? getContextualType(node) + : ts.isJsxElement(exprParent) + ? getContextualTypeForChildJsxExpression(exprParent) + : undefined; } function getContextualTypeForJsxAttribute(attribute) { // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type // which is a type of the parameter of the signature we are trying out. // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName - var attributesType = getContextualType(attribute.parent); if (ts.isJsxAttribute(attribute)) { + var attributesType = getApparentTypeOfContextualType(attribute.parent); if (!attributesType || isTypeAny(attributesType)) { return undefined; } return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { - return attributesType; + return getContextualType(attribute.parent); } } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily @@ -36973,7 +37821,7 @@ var ts; var prop = _a[_i]; if (!prop.symbol) continue; - if (prop.kind !== 265 /* PropertyAssignment */) + if (prop.kind !== 268 /* PropertyAssignment */) continue; if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) { var discriminatingType = getTypeOfNode(prop.initializer); @@ -37021,63 +37869,53 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 180 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 188 /* ArrowFunction */: - case 220 /* ReturnStatement */: + case 191 /* ArrowFunction */: + case 223 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 183 /* NewExpression */: - if (node.kind === 94 /* NewKeyword */) { - return getContextualType(parent); - } - // falls through - case 182 /* CallExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent); - case 178 /* ArrayLiteralExpression */: { + case 181 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 206 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 197 /* TemplateExpression */); + case 209 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 200 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent); } - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - return getAttributesTypeFromJsxOpeningLikeElement(parent); - case 261 /* CaseClause */: { - if (node.kind === 73 /* CaseKeyword */) { - var switchStatement = parent.parent.parent; - return getTypeOfExpression(switchStatement.expression); - } - } + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return getContextualJsxElementAttributesType(parent); } return undefined; } @@ -37085,10 +37923,128 @@ var ts; node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); return node ? node.contextualMapper : identityMapper; } + function getContextualJsxElementAttributesType(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + var valueType = checkExpression(node.tagName); + if (isTypeAny(valueType)) { + // Short-circuit if the class tag is using an element type 'any' + return anyType; + } + var isJs = ts.isInJavaScriptFile(node); + return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + } + function getJsxSignaturesParameterTypes(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ false); + } + function getJsxSignaturesParameterTypesJs(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ true); + } + function getJsxSignaturesParameterTypesInternal(valueType, isJs) { + // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type + if (valueType.flags & 2 /* String */) { + return anyType; + } + else if (valueType.flags & 32 /* StringLiteral */) { + // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type + // For example: + // var CustomTag: "h1" = "h1"; + // Hello World + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + if (intrinsicElementsType !== unknownType) { + var stringLiteralTypeName = valueType.value; + var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); + if (intrinsicProp) { + return getTypeOfSymbol(intrinsicProp); + } + var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */); + if (indexSignatureType) { + return indexSignatureType; + } + } + return anyType; + } + // Resolve the signatures, preferring constructor + var signatures = getSignaturesOfType(valueType, 1 /* Construct */); + var ctor = true; + if (signatures.length === 0) { + // No construct signatures, try call signatures + signatures = getSignaturesOfType(valueType, 0 /* Call */); + ctor = false; + if (signatures.length === 0) { + // We found no signatures at all, which is an error + return unknownType; + } + } + return getUnionType(ts.map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), 0 /* None */); + } + function getJsxPropsTypeFromCallSignature(sig) { + var propsType = getTypeOfFirstParameterOfSignature(sig); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + propsType = intersectTypes(intrinsicAttribs, propsType); + } + return propsType; + } + function getJsxPropsTypeFromClassType(hostClassType, isJs) { + if (isTypeAny(hostClassType)) { + return hostClassType; + } + var propsName = getJsxElementPropertiesName(); + if (propsName === undefined) { + // There is no type ElementAttributesProperty, return 'any' + return anyType; + } + else if (propsName === "") { + // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead + return hostClassType; + } + else { + var attributesType = getTypeOfPropertyOfType(hostClassType, propsName); + if (!attributesType) { + // There is no property named 'props' on this instance type + return emptyObjectType; + } + else if (isTypeAny(attributesType)) { + // Props is of type 'any' or unknown + return attributesType; + } + else { + // Normal case -- add in IntrinsicClassElements and IntrinsicElements + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + apparentAttributesType = intersectTypes(typeParams + ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs)) + : intrinsicClassAttribs, apparentAttributesType); + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return apparentAttributesType; + } + } + } + function getJsxPropsTypeFromConstructSignatureJs(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ true); + } + function getJsxPropsTypeFromConstructSignature(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ false); + } + function getJsxPropsTypeFromConstructSignatureInternal(sig, isJs) { + var hostClassType = getReturnTypeOfSignature(sig); + if (hostClassType) { + return getJsxPropsTypeFromClassType(hostClassType, isJs); + } + return getJsxPropsTypeFromCallSignature(sig); + } // If the given type is an object or union type with a single signature, and if that signature has at // least as many parameters as the given function, return the signature. Otherwise return undefined. function getContextualCallSignature(type, node) { - var signatures = getSignaturesOfStructuredType(type, 0 /* Call */); + var signatures = getSignaturesOfType(type, 0 /* Call */); if (signatures.length === 1) { var signature = signatures[0]; if (!isAritySmaller(signature, node)) { @@ -37112,7 +38068,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 187 /* FunctionExpression */ || node.kind === 188 /* ArrowFunction */; + return node.kind === 190 /* FunctionExpression */ || node.kind === 191 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -37131,7 +38087,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -37141,8 +38097,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var current = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -37163,8 +38119,6 @@ var ts; var result; if (signatureList) { result = cloneSignature(signatureList[0]); - // Clear resolved return type we possibly got from cloneSignature - result.resolvedReturnType = undefined; result.unionSignatures = signatureList; } return result; @@ -37177,8 +38131,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); } function hasDefaultValue(node) { - return (node.kind === 177 /* BindingElement */ && !!node.initializer) || - (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); + return (node.kind === 180 /* BindingElement */ && !!node.initializer) || + (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); } function checkArrayLiteral(node, checkMode) { var elements = node.elements; @@ -37188,7 +38142,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); for (var index = 0; index < elements.length; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 199 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 202 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -37213,7 +38167,7 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 199 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 202 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -37227,7 +38181,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 176 /* ArrayBindingPattern */ || pattern.kind === 178 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 179 /* ArrayBindingPattern */ || pattern.kind === 181 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -37235,10 +38189,10 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 201 /* OmittedExpression */) { + if (patternElement.kind !== 204 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - elementTypes.push(unknownType); + elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); } } } @@ -37248,12 +38202,12 @@ var ts; } } return createArrayType(elementTypes.length ? - getUnionType(elementTypes, /*subtypeReduction*/ true) : + getUnionType(elementTypes, 2 /* Subtype */) : strictNullChecks ? implicitNeverType : undefinedWideningType); } function isNumericName(name) { switch (name.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return isNumericComputedName(name); case 71 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -37320,7 +38274,7 @@ var ts; propTypes.push(getTypeOfSymbol(properties[i])); } } - var unionType = propTypes.length ? getUnionType(propTypes, /*subtypeReduction*/ true) : undefinedType; + var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } function checkObjectLiteral(node, checkMode) { @@ -37330,10 +38284,10 @@ var ts; var propertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; - var propagatedFlags = 0; + var propagatedFlags = 8388608 /* FreshLiteral */; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 175 /* ObjectBindingPattern */ || contextualType.pattern.kind === 179 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 178 /* ObjectBindingPattern */ || contextualType.pattern.kind === 182 /* ObjectLiteralExpression */); var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; @@ -37345,16 +38299,16 @@ var ts; var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); var literalName = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */ || - memberDecl.kind === 266 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 268 /* PropertyAssignment */ || + memberDecl.kind === 269 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var jsdocType = void 0; if (isInJSFile) { jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl); } var type = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */) { - if (memberDecl.name.kind === 145 /* ComputedPropertyName */) { + if (memberDecl.kind === 268 /* PropertyAssignment */) { + if (memberDecl.name.kind === 146 /* ComputedPropertyName */) { var t = checkComputedPropertyName(memberDecl.name); if (t.flags & 224 /* Literal */) { literalName = ts.escapeLeadingUnderscores("" + t.value); @@ -37362,11 +38316,11 @@ var ts; } type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 152 /* MethodDeclaration */) { + else if (memberDecl.kind === 153 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 266 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 269 /* ShorthandPropertyAssignment */); type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -37381,8 +38335,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 265 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 266 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 268 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 269 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -37410,12 +38364,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 267 /* SpreadAssignment */) { + else if (memberDecl.kind === 270 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); propertiesArray = []; propertiesTable = ts.createSymbolTable(); hasComputedStringProperty = false; @@ -37427,7 +38381,7 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, node.symbol, propagatedFlags); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags, /*objectFlags*/ 0); offset = i + 1; continue; } @@ -37437,7 +38391,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 154 /* GetAccessor */ || memberDecl.kind === 155 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 155 /* GetAccessor */ || memberDecl.kind === 156 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (!literalName && hasNonBindableDynamicName(memberDecl)) { @@ -37469,7 +38423,7 @@ var ts; } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); } return spread; } @@ -37478,8 +38432,8 @@ var ts; var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 2097152 /* FreshLiteral */; - result.flags |= 8388608 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 29360128 /* PropagatingFlags */); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608 /* FreshLiteral */; + result.flags |= 33554432 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 117440512 /* PropagatingFlags */); result.objectFlags |= 128 /* ObjectLiteral */; if (patternWithComputedProperties) { result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; @@ -37488,24 +38442,24 @@ var ts; result.pattern = node; } if (!(result.flags & 12288 /* Nullable */)) { - propagatedFlags |= (result.flags & 29360128 /* PropagatingFlags */); + propagatedFlags |= (result.flags & 117440512 /* PropagatingFlags */); } return result; } } function isValidSpreadType(type) { - return !!(type.flags & (1 /* Any */ | 33554432 /* NonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 134217728 /* NonPrimitive */) || getFalsyFlags(type) & 14560 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 65536 /* Object */ && !isGenericMappedType(type) || type.flags & 393216 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } - function checkJsxSelfClosingElement(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node); + function checkJsxSelfClosingElement(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); return getJsxGlobalElementType() || anyType; } - function checkJsxElement(node) { + function checkJsxElement(node, checkMode) { // Check attributes - checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); + checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement, checkMode); // Perform resolution on the closing tag so that rename/go to definition/etc work if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) { getIntrinsicTagSymbol(node.closingElement); @@ -37515,8 +38469,8 @@ var ts; } return getJsxGlobalElementType() || anyType; } - function checkJsxFragment(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); + function checkJsxFragment(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); if (compilerOptions.jsx === 2 /* React */ && compilerOptions.jsxFactory) { error(node, ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); } @@ -37535,7 +38489,7 @@ var ts; function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment switch (tagName.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: return false; case 71 /* Identifier */: @@ -37544,6 +38498,11 @@ var ts; ts.Debug.fail(); } } + function checkJsxAttribute(node, checkMode) { + return node.initializer + ? checkExpressionForMutableLocation(node.initializer, checkMode) + : trueType; // is sugar for + } /** * Get attributes type of the JSX opening-like element. The result is from resolving "attributes" property of the opening-like element. * @@ -37553,22 +38512,19 @@ var ts; * @remarks Because this function calls getSpreadType, it needs to use the same checks as checkObjectLiteral, * which also calls getSpreadType. */ - function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) { var attributes = openingLikeElement.attributes; var attributesTable = ts.createSymbolTable(); var spread = emptyObjectType; - var attributesArray = []; var hasSpreadAnyType = false; var typeToIntersect; var explicitlySpecifyChildrenAttribute = false; - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { var attributeDecl = _a[_i]; var member = attributeDecl.symbol; if (ts.isJsxAttribute(attributeDecl)) { - var exprType = attributeDecl.initializer ? - checkExpression(attributeDecl.initializer, checkMode) : - trueType; // is sugar for + var exprType = checkJsxAttribute(attributeDecl, checkMode); var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; @@ -37578,24 +38534,22 @@ var ts; attributeSymbol.type = exprType; attributeSymbol.target = member; attributesTable.set(attributeSymbol.escapedName, attributeSymbol); - attributesArray.push(attributeSymbol); if (attributeDecl.name.escapedText === jsxChildrenPropertyName) { explicitlySpecifyChildrenAttribute = true; } } else { - ts.Debug.assert(attributeDecl.kind === 259 /* JsxSpreadAttribute */); - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); - attributesArray = []; + ts.Debug.assert(attributeDecl.kind === 262 /* JsxSpreadAttribute */); + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); attributesTable = ts.createSymbolTable(); } - var exprType = checkExpression(attributeDecl.expression); + var exprType = checkExpressionCached(attributeDecl.expression, checkMode); if (isTypeAny(exprType)) { hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*propagatedFlags*/ 0); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -37603,22 +38557,12 @@ var ts; } } if (!hasSpreadAnyType) { - if (spread !== emptyObjectType) { - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); - } - attributesArray = getPropertiesOfType(spread); - } - attributesTable = ts.createSymbolTable(); - for (var _b = 0, attributesArray_1 = attributesArray; _b < attributesArray_1.length; _b++) { - var attr = attributesArray_1[_b]; - if (!filter || filter(attr)) { - attributesTable.set(attr.escapedName, attr); - } + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 250 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 253 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -37629,29 +38573,29 @@ var ts; if (explicitlySpecifyChildrenAttribute) { error(attributes, ts.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName)); } - // If there are children in the body of JSX element, create dummy attribute "children" with anyType so that it will pass the attribute checking process + // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : - createArrayType(getUnionType(childrenTypes, /*subtypeReduction*/ false)); - attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol); + createArrayType(getUnionType(childrenTypes)); + var childPropMap = ts.createSymbolTable(); + childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); + spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } if (hasSpreadAnyType) { return anyType; } - var attributeType = createJsxAttributesType(attributes.symbol, attributesTable); - return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) : - typeToIntersect ? typeToIntersect : attributeType; + return typeToIntersect && spread !== emptyObjectType ? getIntersectionType([typeToIntersect, spread]) : (typeToIntersect || spread); /** * Create anonymous type from given attributes symbol table. * @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable * @param attributesTable a symbol table of attributes property */ - function createJsxAttributesType(symbol, attributesTable) { - var result = createAnonymousType(symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); - result.flags |= 67108864 /* JsxAttributes */ | 8388608 /* ContainsObjectLiteral */; - result.objectFlags |= 128 /* ObjectLiteral */; + function createJsxAttributesType() { + var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + result.flags |= 33554432 /* ContainsObjectLiteral */; + result.objectFlags |= 128 /* ObjectLiteral */ | 4096 /* JsxAttributes */; return result; } } @@ -37667,7 +38611,7 @@ var ts; } } else { - childrenTypes.push(checkExpression(child, checkMode)); + childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } } return childrenTypes; @@ -37678,7 +38622,7 @@ var ts; * @param node a JSXAttributes to be resolved of its type */ function checkJsxAttributes(node, checkMode) { - return createJsxAttributesTypeFromAttributesProperty(node.parent, /*filter*/ undefined, checkMode); + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } function getJsxType(name) { var jsxType = jsxTypes.get(name); @@ -37747,19 +38691,21 @@ var ts; return unknownType; } } + // Instantiate in context of source type var instantiatedSignatures = []; for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { var signature = signatures_3[_i]; if (signature.typeParameters) { var isJavascript = ts.isInJavaScriptFile(node); - var typeArguments = fillMissingTypeArguments(/*typeArguments*/ undefined, signature.typeParameters, /*minTypeArgumentCount*/ 0, isJavascript); + var inferenceContext = createInferenceContext(signature, /*flags*/ isJavascript ? 4 /* AnyDefault */ : 0 /* None */); + var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } else { instantiatedSignatures.push(signature); } } - return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -37804,7 +38750,7 @@ var ts; } return _jsxElementPropertiesName; } - function getJsxElementChildrenPropertyname() { + function getJsxElementChildrenPropertyName() { if (!_hasComputedJsxElementChildrenPropertyName) { _hasComputedJsxElementChildrenPropertyName = true; _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); @@ -37927,6 +38873,7 @@ var ts; * * @param openingLikeElement a non-intrinsic JSXOPeningLikeElement * @param shouldIncludeAllStatelessAttributesType a boolean indicating whether to include all attributes types from all stateless function signature + * @param sourceAttributesType Is the attributes type the user passed, and is used to create inferences in the target type if present * @param elementType an instance type of the given opening-like element. If undefined, the function will check type openinglikeElement's tagname. * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global (imported from react.d.ts) * @return attributes type if able to resolve the type of node @@ -37934,12 +38881,11 @@ var ts; * emptyObjectType if there is no "prop" in the element instance type */ function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 131072 /* Union */) { var types = elementType.types; return getUnionType(types.map(function (type) { return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); - }), /*subtypeReduction*/ true); + }), 2 /* Subtype */); } // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type if (elementType.flags & 2 /* String */) { @@ -37980,50 +38926,7 @@ var ts; if (elementClassType) { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - if (isTypeAny(elemInstanceType)) { - return elemInstanceType; - } - var propsName = getJsxElementPropertiesName(); - if (propsName === undefined) { - // There is no type ElementAttributesProperty, return 'any' - return anyType; - } - else if (propsName === "") { - // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead - return elemInstanceType; - } - else { - var attributesType = getTypeOfPropertyOfType(elemInstanceType, propsName); - if (!attributesType) { - // There is no property named 'props' on this instance type - return emptyObjectType; - } - else if (isTypeAny(attributesType) || (attributesType === unknownType)) { - // Props is of type 'any' or unknown - return attributesType; - } - else { - // Normal case -- add in IntrinsicClassElements and IntrinsicElements - var apparentAttributesType = attributesType; - var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); - if (intrinsicClassAttribs !== unknownType) { - var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); - if (typeParams) { - if (typeParams.length === 1) { - apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); - } - } - else { - apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); - } - } - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttribs !== unknownType) { - apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); - } - return apparentAttributesType; - } - } + return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement)); } /** * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. @@ -38054,13 +38957,7 @@ var ts; * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component */ function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { - var links = getNodeLinks(node); - var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; - if (!links[linkLocation]) { - var elemClassType = getJsxGlobalElementClassType(); - return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); - } - return links[linkLocation]; + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); } /** * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. @@ -38139,7 +39036,7 @@ var ts; } } } - function checkJsxOpeningLikeElementOrOpeningFragment(node) { + function checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode) { var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(node); if (isNodeOpeningLikeElement) { checkGrammarJsxElement(node); @@ -38154,14 +39051,14 @@ var ts; if (reactSym) { // Mark local symbol as referenced here because it might not have been marked // if jsx emit was not react as there wont be error being emitted - reactSym.isReferenced = true; + reactSym.isReferenced = 67108863 /* All */; // If react symbol is alias, mark it as refereced if (reactSym.flags & 2097152 /* Alias */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { markAliasSymbolAsReferenced(reactSym); } } if (isNodeOpeningLikeElement) { - checkJsxAttributesAssignableToTagNameAttributes(node); + checkJsxAttributesAssignableToTagNameAttributes(node, checkMode); } else { checkJsxChildren(node.parent); @@ -38207,37 +39104,40 @@ var ts; * Check assignablity between given attributes property, "source attributes", and the "target attributes" * @param openingLikeElement an opening-like JSX element to check its JSXAttributes */ - function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement, checkMode) { // The function involves following steps: // 1. Figure out expected attributes type by resolving tagName of the JSX opening-like element, targetAttributesType. // During these steps, we will try to resolve the tagName as intrinsic name, stateless function, stateful component (in the order) // 2. Solved JSX attributes type given by users, sourceAttributesType, which is by resolving "attributes" property of the JSX opening-like element. // 3. Check if the two are assignable to each other - // targetAttributesType is a type of an attributes from resolving tagName of an opening-like JSX element. + // targetAttributesType is a type of an attribute from resolving tagName of an opening-like JSX element. var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : getCustomJsxElementAttributesType(openingLikeElement, /*shouldIncludeAllStatelessAttributesType*/ false); // sourceAttributesType is a type of an attributes properties. // i.e
// attr1 and attr2 are treated as JSXAttributes attached in the JsxOpeningLikeElement as "attributes". - var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { - return isUnhyphenatedJsxName(attribute.escapedName) || !!(getPropertyOfType(targetAttributesType, attribute.escapedName)); - }); + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode); // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. - if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName())); } else { // Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties var isSourceAttributeTypeAssignableToTarget = checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); // After we check for assignability, we will do another pass to check that all explicitly specified attributes have correct name corresponding in targetAttributeType. - // This will allow excess properties in spread type as it is very common pattern to spread outter attributes into React component in its render method. + // This will allow excess properties in spread type as it is very common pattern to spread outer attributes into React component in its render method. if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) { for (var _i = 0, _a = openingLikeElement.attributes.properties; _i < _a.length; _i++) { var attribute = _a[_i]; - if (ts.isJsxAttribute(attribute) && !isKnownProperty(targetAttributesType, attribute.name.escapedText, /*isComparingJsxAttributes*/ true)) { - error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attribute.name), typeToString(targetAttributesType)); + if (!ts.isJsxAttribute(attribute)) { + continue; + } + var attrName = attribute.name; + var isNotIgnoredJsxProperty = (isUnhyphenatedJsxName(ts.idText(attrName)) || !!(getPropertyOfType(targetAttributesType, attrName.escapedText))); + if (isNotIgnoredJsxProperty && !isKnownProperty(targetAttributesType, attrName.escapedText, /*isComparingJsxAttributes*/ true)) { + error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attrName), typeToString(targetAttributesType)); // We break here so that errors won't be cascading break; } @@ -38260,7 +39160,7 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 150 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 151 /* PropertyDeclaration */; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; @@ -38278,7 +39178,7 @@ var ts; */ function checkPropertyAccessibility(node, left, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 180 /* PropertyAccessExpression */ || node.kind === 227 /* VariableDeclaration */ ? + var errorNode = node.kind === 183 /* PropertyAccessExpression */ || node.kind === 230 /* VariableDeclaration */ ? node.name : node.right; if (ts.getCheckFlags(prop) & 256 /* ContainsPrivate */) { @@ -38364,19 +39264,19 @@ var ts; function symbolHasNonMethodDeclaration(symbol) { return forEachProperty(symbol, function (prop) { var propKind = getDeclarationKindFromSymbol(prop); - return propKind !== 152 /* MethodDeclaration */ && propKind !== 151 /* MethodSignature */; + return propKind !== 153 /* MethodDeclaration */ && propKind !== 152 /* MethodSignature */; }); } - function checkNonNullExpression(node) { - return checkNonNullType(checkExpression(node), node); + function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { + return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic); } - function checkNonNullType(type, errorNode) { + function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 12288 /* Nullable */; if (kind) { - error(errorNode, kind & 4096 /* Undefined */ ? kind & 8192 /* Null */ ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); + error(node, kind & 4096 /* Undefined */ ? kind & 8192 /* Null */ ? + (nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) : + (undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) : + (nullDiagnostic || ts.Diagnostics.Object_is_possibly_null)); var t = getNonNullableType(type); return t.flags & (12288 /* Nullable */ | 16384 /* Never */) ? unknownType : t; } @@ -38390,15 +39290,20 @@ var ts; } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var propType; - var leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - var leftWasReferenced = leftSymbol && getSymbolLinks(leftSymbol).referenced; var leftType = checkNonNullExpression(left); + var parentSymbol = getNodeLinks(left).resolvedSymbol; var apparentType = getApparentType(getWidenedType(leftType)); if (isTypeAny(apparentType) || apparentType === silentNeverType) { + if (ts.isIdentifier(left) && parentSymbol) { + markAliasReferenced(parentSymbol, node); + } return apparentType; } var assignmentKind = ts.getAssignmentTargetKind(node); var prop = getPropertyOfType(apparentType, right.escapedText); + if (ts.isIdentifier(left) && parentSymbol && !(prop && isConstEnumOrConstEnumOnlyModule(prop))) { + markAliasReferenced(parentSymbol, node); + } if (!prop) { var indexInfo = getIndexInfoOfType(apparentType, 0 /* String */); if (!(indexInfo && indexInfo.type)) { @@ -38415,12 +39320,6 @@ var ts; else { checkPropertyNotUsedBeforeDeclaration(prop, node, right); markPropertyAsReferenced(prop, node, left.kind === 99 /* ThisKeyword */); - // Reset the referenced-ness of the LHS expression if this access refers to a const enum or const enum only module - leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - if (leftSymbol && !leftWasReferenced && getSymbolLinks(leftSymbol).referenced && - !(isNonLocalAlias(leftSymbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(prop))) { - getSymbolLinks(leftSymbol).referenced = undefined; - } getNodeLinks(node).resolvedSymbol = prop; checkPropertyAccessibility(node, left, apparentType, prop); if (assignmentKind) { @@ -38429,12 +39328,12 @@ var ts; return unknownType; } } - propType = getDeclaredOrApparentType(prop, node); + propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); } // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 180 /* PropertyAccessExpression */ || + if (node.kind !== 183 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 131072 /* Union */)) { return propType; @@ -38448,7 +39347,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 153 /* Constructor */ && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 154 /* Constructor */ && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -38471,8 +39370,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right)); } - else if (valueDeclaration.kind === 230 /* ClassDeclaration */ && - node.parent.kind !== 160 /* TypeReference */ && + else if (valueDeclaration.kind === 233 /* ClassDeclaration */ && + node.parent.kind !== 161 /* TypeReference */ && !(valueDeclaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right)); @@ -38481,9 +39380,9 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return true; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // We might be in `a = { b: this.b }`, so keep looking. See `tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts`. return false; default: @@ -38496,6 +39395,9 @@ var ts; * In that case we won't consider it used before its declaration, because it gets its value from the superclass' declaration. */ function isPropertyDeclaredInAncestorClass(prop) { + if (!(prop.parent.flags & 32 /* Class */)) { + return false; + } var classType = getTypeOfSymbol(prop.parent); while (true) { classType = getSuperClass(classType); @@ -38542,7 +39444,7 @@ var ts; } function getSuggestionForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -38647,57 +39549,53 @@ var ts; return res > max ? undefined : res; } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (prop && - noUnusedIdentifiers && - (prop.flags & 106500 /* ClassMember */) && - prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8 /* Private */) - && !(nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly))) { - if (isThisAccess) { - // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters). - var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); - if (containingMethod && containingMethod.symbol === prop) { - return; - } - } - if (ts.getCheckFlags(prop) & 1 /* Instantiated */) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; + if (!prop || !noUnusedIdentifiers || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + return; + } + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + return; + } + if (isThisAccess) { + // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters). + var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); + if (containingMethod && containingMethod.symbol === prop) { + return; } } + (ts.getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 180 /* PropertyAccessExpression */ - ? node.expression - : node.left; + var left = node.kind === 183 /* PropertyAccessExpression */ ? node.expression : node.left; return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left))); } + function isValidPropertyAccessForCompletions(node, type, property) { + return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) + && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); + } + function isValidMethodAccess(method, type) { + var propType = getTypeOfFuncClassEnumModule(method); + var signatures = getSignaturesOfType(getNonNullableType(propType), 0 /* Call */); + ts.Debug.assert(signatures.length !== 0); + return signatures.some(function (sig) { + var thisType = getThisTypeOfSignature(sig); + return !thisType || isTypeAssignableTo(type, thisType); + }); + } function isValidPropertyAccessWithType(node, left, propertyName, type) { - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(type, propertyName); - if (prop) { - return checkPropertyAccessibility(node, left, type, prop); - } - // In js files properties of unions are allowed in completion - if (ts.isInJavaScriptFile(left) && (type.flags & 131072 /* Union */)) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var elementType = _a[_i]; - if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) { - return true; - } - } - } - return false; + if (type === unknownType || isTypeAny(type)) { + return true; } - return true; + var prop = getPropertyOfType(type, propertyName); + return prop ? checkPropertyAccessibility(node, left, type, prop) + // In js files properties of unions are allowed in completion + : ts.isInJavaScriptFile(node) && (type.flags & 131072 /* Union */) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); }); } /** * Return the symbol of the for-in variable declared or referenced by the given for-in statement. */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer.kind === 231 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -38726,7 +39624,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 216 /* ForInStatement */ && + if (node.kind === 219 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -38744,7 +39642,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 183 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 186 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -38811,10 +39709,10 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 148 /* Decorator */) { + else if (node.kind !== 149 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -38880,7 +39778,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 199 /* SpreadElement */) { + if (arg && arg.kind === 202 /* SpreadElement */) { return i; } } @@ -38896,17 +39794,15 @@ var ts; // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". return true; } - if (node.kind === 184 /* TaggedTemplateExpression */) { - var tagExpression = node; + if (node.kind === 187 /* TaggedTemplateExpression */) { // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 197 /* TemplateExpression */) { + if (node.template.kind === 200 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + var lastSpan = ts.lastOrUndefined(node.template.templateSpans); ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -38914,26 +39810,25 @@ var ts; // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, // then this might actually turn out to be a TemplateHead in the future; // so we consider the call to be incomplete. - var templateLiteral = tagExpression.template; + var templateLiteral = node.template; ts.Debug.assert(templateLiteral.kind === 13 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); } else { - var callExpression = node; - if (!callExpression.arguments) { + if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 183 /* NewExpression */); + ts.Debug.assert(node.kind === 186 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; // If we are missing the close parenthesis, the call is incomplete. - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; + callIsIncomplete = node.arguments.end === node.end; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match @@ -38977,10 +39872,21 @@ var ts; inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); if (!contextualMapper) { - inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8 /* ReturnType */); + inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 4 /* ReturnType */); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJavaScriptFile(contextualSignature.declaration)); } + function inferJsxTypeArguments(signature, node, context) { + // Skip context sensitive pass + var skipContextParamType = getTypeAtPosition(signature, 0); + var checkAttrTypeSkipContextSensitive = checkExpressionWithContextualType(node.attributes, skipContextParamType, identityMapper); + inferTypes(context.inferences, checkAttrTypeSkipContextSensitive, skipContextParamType); + // Standard pass + var paramType = getTypeAtPosition(signature, 0); + var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context); + inferTypes(context.inferences, checkAttrType, paramType); + return getInferredTypes(context); + } function inferTypeArguments(node, signature, args, excludeArgument, context) { // Clear out all the inference results from the last time inferTypeArguments was called on this context for (var _i = 0, _a = context.inferences; _i < _a.length; _i++) { @@ -38997,7 +39903,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 148 /* Decorator */) { + if (node.kind !== 149 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the contextual mapper to avoid disturbing a resolution in progress for an @@ -39017,7 +39923,7 @@ var ts; instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); // Inferences made from return types have lower priority than all other inferences. - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8 /* ReturnType */); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 4 /* ReturnType */); } } var thisType = getThisTypeOfSignature(signature); @@ -39032,7 +39938,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -39073,7 +39979,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (!constraint) continue; - var errorInfo = reportErrors && headMessage && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + var errorInfo = reportErrors && headMessage && (function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }); var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1; if (!mapper) { mapper = createTypeMapper(typeParameters, typeArgumentTypes); @@ -39122,7 +40028,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 183 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 186 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -39139,7 +40045,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); // If the effective argument type is undefined, there is no synthetic type for the argument. @@ -39163,12 +40069,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 180 /* PropertyAccessExpression */) { + if (callee.kind === 183 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 181 /* ElementAccessExpression */) { + else if (callee.kind === 184 /* ElementAccessExpression */) { return callee.expression; } } @@ -39183,17 +40089,17 @@ var ts; * will be supplied from calls to `getEffectiveArgumentCount` and `getEffectiveArgumentType`. */ function getEffectiveCallArguments(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { var template = node.template; var args_4 = [undefined]; - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_4.push(span.expression); }); } return args_4; } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. @@ -39220,19 +40126,19 @@ var ts; * Otherwise, the argument count is the length of the 'args' array. */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -39242,7 +40148,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 147 /* Parameter */: + case 148 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -39266,25 +40172,25 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -39311,23 +40217,23 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } // For a non-constructor parameter decorator, the `propertyKey` will be either // a string or a symbol, based on the name of the parameter's containing method. } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -39339,7 +40245,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralType(element.name.text); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeAssignableToKind(nameType, 1536 /* ESSymbolLike */)) { return nameType; @@ -39365,21 +40271,21 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a parameter decorator - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 150 /* PropertyDeclaration */) { + if (node.kind === 151 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -39411,10 +40317,10 @@ var ts; // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -39426,8 +40332,8 @@ var ts; */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 148 /* Decorator */ || - (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */)) { + if (node.kind === 149 /* Decorator */ || + (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -39436,11 +40342,11 @@ var ts; * Gets the error node to use when reporting errors for an effective argument. */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -39449,8 +40355,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, fallbackError) { - var isTaggedTemplate = node.kind === 184 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 148 /* Decorator */; + var isTaggedTemplate = node.kind === 187 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 149 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { @@ -39524,7 +40430,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 182 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 185 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -39572,7 +40478,7 @@ var ts; max = Math.max(max, ts.length(sig.typeParameters)); } var paramCount = min < max ? min + "-" + max : min; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); + diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); } else if (args) { var min = Number.POSITIVE_INFINITY; @@ -39650,7 +40556,7 @@ var ts; } var candidate = void 0; var inferenceContext = originalCandidate.typeParameters ? - createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0) : + createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0 /* None */) : undefined; while (true) { candidate = originalCandidate; @@ -39682,7 +40588,7 @@ var ts; } excludeCount--; if (excludeCount > 0) { - excludeArgument[ts.indexOf(excludeArgument, /*value*/ true)] = false; + excludeArgument[excludeArgument.indexOf(/*value*/ true)] = false; } else { excludeArgument = undefined; @@ -39721,7 +40627,7 @@ var ts; } return resolveUntypedCall(node); } - var funcType = checkNonNullExpression(node.expression); + var funcType = checkNonNullExpression(node.expression, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined); if (funcType === silentNeverType) { return silentNeverSignature; } @@ -39755,7 +40661,7 @@ var ts; error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); } else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0 /* Call */); } return resolveErrorCall(node); } @@ -39836,7 +40742,7 @@ var ts; } return signature; } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + invocationError(node, expressionType, 1 /* Construct */); return resolveErrorCall(node); } function isConstructorAccessible(node, signature) { @@ -39876,6 +40782,26 @@ var ts; } return true; } + function invocationError(node, apparentType, kind) { + error(node, kind === 0 /* Call */ + ? ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures + : ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature, typeToString(apparentType)); + invocationErrorRecovery(apparentType, kind); + } + function invocationErrorRecovery(apparentType, kind) { + if (!apparentType.symbol) { + return; + } + var importNode = getSymbolLinks(apparentType.symbol).originatingImport; + // Create a diagnostic on the originating import if possible onto which we can attach a quickfix + // An import call expression cannot be rewritten into another form to correct the error - the only solution is to use `.default` at the use-site + if (importNode && !ts.isImportCall(importNode)) { + var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); + if (!sigs || !sigs.length) + return; + error(importNode, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime); + } + } function resolveTaggedTemplateExpression(node, candidatesOutArray) { var tagType = checkExpression(node.tag); var apparentType = getApparentType(tagType); @@ -39889,7 +40815,7 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0 /* Call */); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray); @@ -39899,16 +40825,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -39937,6 +40863,7 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); errorInfo = ts.chainDiagnosticMessages(errorInfo, headMessage); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, errorInfo)); + invocationErrorRecovery(apparentType, 0 /* Call */); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); @@ -39981,8 +40908,8 @@ var ts; if (elementType.flags & 131072 /* Union */) { var types = elementType.types; var result = void 0; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var type = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var type = types_16[_i]; result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); } return result; @@ -39995,16 +40922,16 @@ var ts; } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 148 /* Decorator */: + case 149 /* Decorator */: return resolveDecorator(node, candidatesOutArray); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: // This code-path is called by language service return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } @@ -40090,12 +41017,12 @@ var ts; if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; } - if (node.kind === 183 /* NewExpression */) { + if (node.kind === 186 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 153 /* Constructor */ && - declaration.kind !== 157 /* ConstructSignature */ && - declaration.kind !== 162 /* ConstructorType */ && + declaration.kind !== 154 /* Constructor */ && + declaration.kind !== 158 /* ConstructSignature */ && + declaration.kind !== 163 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -40166,16 +41093,18 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol)); } } return createPromiseReturnType(node, anyType); } - function getTypeWithSyntheticDefaultImportType(type, symbol) { + function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) { if (allowSyntheticDefaultImports && type && type !== unknownType) { var synthType = type; if (!synthType.syntheticType) { - if (!getPropertyOfType(type, "default" /* Default */)) { + var file = ts.find(originalSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, /*dontResolveAlias*/ false); + if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); newSymbol.target = resolveSymbol(symbol); @@ -40183,7 +41112,7 @@ var ts; var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); anonymousSymbol.type = defaultContainingObject; - synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*typeFLags*/ 0, /*objectFlags*/ 0) : defaultContainingObject; } else { synthType.syntheticType = type; @@ -40210,9 +41139,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 229 /* FunctionDeclaration */ + ? 232 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 227 /* VariableDeclaration */ + ? 230 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -40252,7 +41181,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return unknownType; } - else if (container.kind === 153 /* Constructor */) { + else if (container.kind === 154 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -40265,7 +41194,7 @@ var ts; var type = getTypeOfSymbol(symbol); if (strictNullChecks) { var declaration = symbol.valueDeclaration; - if (declaration && declaration.initializer) { + if (declaration && ts.hasInitializer(declaration)) { return getOptionalType(type); } } @@ -40374,13 +41303,12 @@ var ts; return promiseType; } function getReturnTypeFromBody(func, checkMode) { - var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 208 /* Block */) { + if (func.body.kind !== 211 /* Block */) { type = checkExpressionCached(func.body, checkMode); if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any @@ -40391,9 +41319,9 @@ var ts; } } else { - var types = void 0; + var types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (functionFlags & 1 /* Generator */) { - types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); if (!types || types.length === 0) { var iterableIteratorAny = functionFlags & 2 /* Async */ ? createAsyncIterableIteratorType(anyType) // AsyncGenerator function @@ -40405,7 +41333,6 @@ var ts; } } else { - types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { // For an async function, the return type will not be never, but rather a Promise for never. return functionFlags & 2 /* Async */ @@ -40420,8 +41347,9 @@ var ts; } } // Return a union of the return expression types. - type = getUnionType(types, /*subtypeReduction*/ true); + type = getUnionType(types, 2 /* Subtype */); } + var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!contextualSignature) { reportErrorsFromWidening(func, type); } @@ -40498,11 +41426,12 @@ var ts; if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 222 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 225 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { return false; } return true; } + /** NOTE: Return value of `[]` means a different thing than `undefined`. `[]` means return `void`, `undefined` means return `never`. */ function checkAndAggregateReturnExpressionTypes(func, checkMode) { var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; @@ -40528,8 +41457,7 @@ var ts; hasReturnWithNoExpression = true; } }); - if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */)) { + if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -40537,6 +41465,17 @@ var ts; } return aggregatedTypes; } + function mayReturnNever(func) { + switch (func.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + return true; + case 153 /* MethodDeclaration */: + return func.parent.kind === 182 /* ObjectLiteralExpression */; + default: + return false; + } + } /** * TypeScript Specification 1.0 (6.3) - July 2014 * An explicitly typed function whose return type isn't the Void type, @@ -40556,7 +41495,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 208 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 152 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 211 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -40589,7 +41528,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); @@ -40597,7 +41536,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 187 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 190 /* FunctionExpression */) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -40632,7 +41571,7 @@ var ts; checkNodeDeferred(node); } } - if (produceDiagnostics && node.kind !== 152 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 153 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithCapturedNewTargetVariable(node, node.name); @@ -40640,7 +41579,7 @@ var ts; return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); var returnOrPromisedType = returnTypeNode && @@ -40660,7 +41599,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 208 /* Block */) { + if (node.body.kind === 211 /* Block */) { checkSourceElement(node.body); } else { @@ -40707,11 +41646,11 @@ var ts; if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) && + (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) && expr.expression.kind === 99 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 153 /* Constructor */)) { + if (!(func && func.kind === 154 /* Constructor */)) { return true; } // If func.parent is a class and symbol is a (readonly) property of that class, or @@ -40724,13 +41663,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); if (node.kind === 71 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 241 /* NamespaceImport */; + return declaration && declaration.kind === 244 /* NamespaceImport */; } } } @@ -40739,7 +41678,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); - if (node.kind !== 71 /* Identifier */ && node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 71 /* Identifier */ && node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -40748,7 +41687,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 180 /* PropertyAccessExpression */ && expr.kind !== 181 /* ElementAccessExpression */) { + if (expr.kind !== 183 /* PropertyAccessExpression */ && expr.kind !== 184 /* ElementAccessExpression */) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -40833,13 +41772,13 @@ var ts; // Return true if type might be of the given kind. A union or intersection type might be of a given // kind if at least one constituent type is of the given kind. function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { + if (type.flags & kind || kind & 536870912 /* GenericMappedType */ && isGenericMappedType(type)) { return true; } if (type.flags & 393216 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var t = types_17[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -40862,7 +41801,7 @@ var ts; (kind & 8192 /* Null */ && isTypeAssignableTo(source, nullType)) || (kind & 4096 /* Undefined */ && isTypeAssignableTo(source, undefinedType)) || (kind & 512 /* ESSymbol */ && isTypeAssignableTo(source, esSymbolType)) || - (kind & 33554432 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); + (kind & 134217728 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); } function allTypesAssignableToKind(source, kind, strict) { return source.flags & 131072 /* Union */ ? @@ -40907,13 +41846,16 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 /* NumberLike */ | 1536 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; + if (strictNullChecks && properties.length === 0) { + return checkNonNullType(sourceType, node); + } for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); @@ -40922,9 +41864,9 @@ var ts; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 265 /* PropertyAssignment */ || property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */ || property.kind === 269 /* ShorthandPropertyAssignment */) { var name = property.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { @@ -40937,7 +41879,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 269 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -40949,7 +41891,7 @@ var ts; error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 267 /* SpreadAssignment */) { + else if (property.kind === 270 /* SpreadAssignment */) { if (languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(property, 4 /* Rest */); } @@ -40983,8 +41925,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 201 /* OmittedExpression */) { - if (element.kind !== 199 /* SpreadElement */) { + if (element.kind !== 204 /* OmittedExpression */) { + if (element.kind !== 202 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -41012,7 +41954,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 195 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { + if (restExpression.kind === 198 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -41025,7 +41967,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 266 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 269 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -41041,21 +41983,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 195 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { + if (target.kind === 198 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 179 /* ObjectLiteralExpression */) { + if (target.kind === 182 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 178 /* ArrayLiteralExpression */) { + if (target.kind === 181 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 267 /* SpreadAssignment */ ? + var error = target.parent.kind === 270 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -41077,35 +42019,35 @@ var ts; case 71 /* Identifier */: case 9 /* StringLiteral */: case 12 /* RegularExpressionLiteral */: - case 184 /* TaggedTemplateExpression */: - case 197 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: - case 139 /* UndefinedKeyword */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 190 /* TypeOfExpression */: - case 204 /* NonNullExpression */: - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: + case 140 /* UndefinedKeyword */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 193 /* TypeOfExpression */: + case 207 /* NonNullExpression */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: return true; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -41117,9 +42059,9 @@ var ts; } return false; // Some forms listed here for clarity - case 191 /* VoidExpression */: // Explicit opt-out - case 185 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 203 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 194 /* VoidExpression */: // Explicit opt-out + case 188 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 206 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -41132,7 +42074,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 58 /* EqualsToken */ && (left.kind === 179 /* ObjectLiteralExpression */ || left.kind === 178 /* ArrayLiteralExpression */)) { + if (operator === 58 /* EqualsToken */ && (left.kind === 182 /* ObjectLiteralExpression */ || left.kind === 181 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } var leftType = checkExpression(left, checkMode); @@ -41254,7 +42196,7 @@ var ts; leftType; case 54 /* BarBarToken */: return getTypeFacts(leftType) & 2097152 /* Falsy */ ? - getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], /*subtypeReduction*/ true) : + getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) : leftType; case 58 /* EqualsToken */: checkAssignmentOperator(rightType); @@ -41390,7 +42332,7 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, checkMode); var type2 = checkExpression(node.whenFalse, checkMode); - return getUnionType([type1, type2], /*subtypeReduction*/ true); + return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { // We just want to check each expressions, but we are unconcerned with @@ -41403,21 +42345,31 @@ var ts; }); return stringType; } + function getContextNode(node) { + if (node.kind === 261 /* JsxAttributes */) { + return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) + } + return node; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - var saveContextualMapper = node.contextualMapper; - node.contextualType = contextualType; - node.contextualMapper = contextualMapper; + var context = getContextNode(node); + var saveContextualType = context.contextualType; + var saveContextualMapper = context.contextualMapper; + context.contextualType = contextualType; + context.contextualMapper = contextualMapper; var checkMode = contextualMapper === identityMapper ? 1 /* SkipContextSensitive */ : - contextualMapper ? 2 /* Inferential */ : 0 /* Normal */; + contextualMapper ? 2 /* Inferential */ : 3 /* Contextual */; var result = checkExpression(node, checkMode); - node.contextualType = saveContextualType; - node.contextualMapper = saveContextualMapper; + context.contextualType = saveContextualType; + context.contextualMapper = saveContextualMapper; return result; } function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { + if (checkMode) { + return checkExpression(node, checkMode); + } // When computing a type that we're going to cache, we need to ignore any ongoing control flow // analysis because variables may have transient types in indeterminable states. Moving flowLoopStart // to the top of the stack ensures all transient types are computed from a known point. @@ -41430,7 +42382,7 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 185 /* TypeAssertionExpression */ || node.kind === 203 /* AsExpression */; + return node.kind === 188 /* TypeAssertionExpression */ || node.kind === 206 /* AsExpression */; } function checkDeclarationInitializer(declaration) { var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); @@ -41440,16 +42392,11 @@ var ts; } function isLiteralOfContextualType(candidateType, contextualType) { if (contextualType) { - if (contextualType.flags & 131072 /* Union */ && !(contextualType.flags & 8 /* Boolean */)) { - // If the contextual type is a union containing both of the 'true' and 'false' types we - // don't consider it a literal context for boolean literals. - var types_19 = contextualType.types; - return ts.some(types_19, function (t) { - return !(t.flags & 128 /* BooleanLiteral */ && containsType(types_19, trueType) && containsType(types_19, falseType)) && - isLiteralOfContextualType(candidateType, t); - }); + if (contextualType.flags & 393216 /* UnionOrIntersection */) { + var types = contextualType.types; + return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 1081344 /* TypeVariable */) { + if (contextualType.flags & 7372800 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -41481,7 +42428,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -41492,7 +42439,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -41522,7 +42469,7 @@ var ts; function getTypeOfExpression(node, cache) { // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (node.kind === 182 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { + if (node.kind === 185 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -41557,7 +42504,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpression(node, checkMode) { var type; - if (node.kind === 144 /* QualifiedName */) { + if (node.kind === 145 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -41569,11 +42516,12 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 181 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 164 /* TypeQuery */ && node.parent.exprName === node)); if (!ok) { - error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } } return type; @@ -41605,74 +42553,74 @@ var ts; return trueType; case 86 /* FalseKeyword */: return falseType; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return checkTemplateExpression(node); case 12 /* RegularExpressionLiteral */: return globalRegExpType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (node.expression.kind === 91 /* ImportKeyword */) { return checkImportCallExpression(node); } /* falls through */ - case 183 /* NewExpression */: + case 186 /* NewExpression */: return checkCallExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return checkClassExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return checkAssertion(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return checkNonNullAssertion(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return checkMetaProperty(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkDeleteExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return checkVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return checkAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return undefinedWideningType; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return checkYieldExpression(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 250 /* JsxElement */: - return checkJsxElement(node); - case 251 /* JsxSelfClosingElement */: - return checkJsxSelfClosingElement(node); - case 254 /* JsxFragment */: - return checkJsxFragment(node); - case 258 /* JsxAttributes */: + case 253 /* JsxElement */: + return checkJsxElement(node, checkMode); + case 254 /* JsxSelfClosingElement */: + return checkJsxSelfClosingElement(node, checkMode); + case 257 /* JsxFragment */: + return checkJsxFragment(node, checkMode); + case 261 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -41710,7 +42658,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 153 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 154 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -41718,10 +42666,10 @@ var ts; error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && ts.isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { - if (ts.indexOf(func.parameters, node) !== 0) { + if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 153 /* Constructor */ || func.kind === 157 /* ConstructSignature */ || func.kind === 162 /* ConstructorType */) { + if (func.kind === 154 /* Constructor */ || func.kind === 158 /* ConstructSignature */ || func.kind === 163 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -41749,7 +42697,7 @@ var ts; error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); return; } - var typePredicate = getSignatureFromDeclaration(parent).typePredicate; + var typePredicate = getTypePredicateOfSignature(getSignatureFromDeclaration(parent)); if (!typePredicate) { return; } @@ -41764,7 +42712,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); }; checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, /*headMessage*/ undefined, leadingError); } @@ -41787,13 +42735,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 188 /* ArrowFunction */: - case 156 /* CallSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 161 /* FunctionType */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 191 /* ArrowFunction */: + case 157 /* CallSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 162 /* FunctionType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -41811,7 +42759,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 176 /* ArrayBindingPattern */ || name.kind === 175 /* ObjectBindingPattern */) { + else if (name.kind === 179 /* ArrayBindingPattern */ || name.kind === 178 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -41820,12 +42768,12 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 161 /* FunctionType */ || node.kind === 229 /* FunctionDeclaration */ || node.kind === 162 /* ConstructorType */ || - node.kind === 156 /* CallSignature */ || node.kind === 153 /* Constructor */ || - node.kind === 157 /* ConstructSignature */) { + else if (node.kind === 162 /* FunctionType */ || node.kind === 232 /* FunctionDeclaration */ || node.kind === 163 /* ConstructorType */ || + node.kind === 157 /* CallSignature */ || node.kind === 154 /* Constructor */ || + node.kind === 158 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -41855,10 +42803,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -41905,7 +42853,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -41919,16 +42867,16 @@ var ts; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: addName(names, member.name, memberName, 4 /* Method */); break; } @@ -41991,7 +42939,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* PropertySignature */) { + if (member.kind === 150 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: @@ -42015,7 +42963,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 231 /* InterfaceDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -42035,7 +42983,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -42043,7 +42991,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -42070,7 +43018,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 153 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -42095,24 +43043,8 @@ var ts; if (!produceDiagnostics) { return; } - function containsSuperCallAsComputedPropertyName(n) { - var name = ts.getNameOfDeclaration(n); - return name && containsSuperCall(name); - } - function containsSuperCall(n) { - if (ts.isSuperCall(n)) { - return true; - } - else if (ts.isFunctionLike(n)) { - return false; - } - else if (ts.isClassLike(n)) { - return ts.forEach(n.members, containsSuperCallAsComputedPropertyName); - } - return ts.forEachChild(n, containsSuperCall); - } function isInstancePropertyWithInitializer(n) { - return n.kind === 150 /* PropertyDeclaration */ && + return n.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -42142,7 +43074,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -42167,7 +43099,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { if (!(node.flags & 2097152 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -42177,13 +43109,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = node.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -42201,7 +43133,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -42218,8 +43150,10 @@ var ts; function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { - var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJavaScriptFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { var typeArguments; var mapper; var result = true; @@ -42227,18 +43161,28 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, ts.isInJavaScriptFile(typeArgumentNodes[i])); + typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(typeArgument, instantiateType(constraint, mapper), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; } + function getTypeParametersForTypeReference(node) { + var type = getTypeFromTypeReference(node); + if (type !== unknownType) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || + (ts.getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : undefined); + } + } + return undefined; + } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 160 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 161 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); @@ -42247,22 +43191,10 @@ var ts; // Do type argument local checks only if referenced type is successfully resolved ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (!symbol) { - // There is no resolved symbol cached if the type resolved to a builtin - // via JSDoc type reference resolution (eg, Boolean became boolean), none - // of which are generic when they have no associated symbol - // (additionally, JSDoc's index signature syntax, Object actually uses generic syntax without being generic) - if (!ts.isJSDocIndexSignature(node)) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - } - return; + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); } - var typeParameters = symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters; - if (!typeParameters && ts.getObjectFlags(type) & 4 /* Reference */) { - typeParameters = type.target.localTypeParameters; - } - checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } if (type.flags & 16 /* Enum */ && getNodeLinks(node).resolvedSymbol.flags & 8 /* EnumMember */) { @@ -42270,6 +43202,14 @@ var ts; } } } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType); + if (!typeReferenceNode) + return undefined; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } function checkTypeQuery(node) { getTypeFromTypeQueryNode(node); } @@ -42304,8 +43244,8 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { - if (accessNode.kind === 181 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && - ts.getObjectFlags(objectType) & 32 /* Mapped */ && objectType.declaration.readonlyToken) { + if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -42326,6 +43266,9 @@ var ts; function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); + if (noImplicitAny && !node.type) { + reportImplicitAnyError(node, anyType); + } var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); @@ -42334,6 +43277,15 @@ var ts; checkGrammarTypeOperatorNode(node); checkSourceElement(node.type); } + function checkConditionalType(node) { + ts.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 /* ConditionalType */ && n.parent.extendsType === n; })) { + grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + } function isPrivateWithinAmbient(node) { return ts.hasModifier(node, 8 /* Private */) && !!(node.flags & 2097152 /* Ambient */); } @@ -42341,9 +43293,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 231 /* InterfaceDeclaration */ && - n.parent.kind !== 230 /* ClassDeclaration */ && - n.parent.kind !== 200 /* ClassExpression */ && + if (n.parent.kind !== 234 /* InterfaceDeclaration */ && + n.parent.kind !== 233 /* ClassDeclaration */ && + n.parent.kind !== 203 /* ClassExpression */ && n.flags & 2097152 /* Ambient */) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -42434,7 +43386,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */) && + var reportError = (node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -42473,7 +43425,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 2097152 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 231 /* InterfaceDeclaration */ || node.parent.kind === 164 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 234 /* InterfaceDeclaration */ || node.parent.kind === 165 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -42484,7 +43436,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 229 /* FunctionDeclaration */ || node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */ || node.kind === 153 /* Constructor */) { + if (node.kind === 232 /* FunctionDeclaration */ || node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */ || node.kind === 154 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -42612,33 +43564,35 @@ var ts; })(DeclarationSpaces || (DeclarationSpaces = {})); function getDeclarationSpaces(d) { switch (d.kind) { - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: // A jsdoc typedef is, by definition, a type alias - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return 2 /* ExportType */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: return 2 /* ExportType */ | 1 /* ExportValue */; + case 272 /* SourceFile */: + return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; // The below options all declare an Alias, which is allowed to merge with other values within the importing module - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: var result_2 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); }); return result_2; - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 229 /* FunctionDeclaration */: - case 243 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 232 /* FunctionDeclaration */: + case 246 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 return 1 /* ExportValue */; default: - ts.Debug.fail(ts.SyntaxKind[d.kind]); + ts.Debug.fail(ts.Debug.showSyntaxKind(d)); } } } @@ -42693,7 +43647,7 @@ var ts; } return undefined; } - return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2 /* Subtype */); } /** * Gets the "awaited type" of a type. @@ -42726,7 +43680,7 @@ var ts; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -42905,28 +43859,28 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 147 /* Parameter */: + case 148 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); break; } - checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo); + checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; }); } /** * If a TypeNode can be resolved to a value symbol imported from an external module, it is @@ -42964,18 +43918,18 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: var commonEntityName = void 0; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -43001,9 +43955,9 @@ var ts; } } return commonEntityName; - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; } } @@ -43027,14 +43981,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -43043,19 +43997,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 147 /* Parameter */: + case 148 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -43087,7 +44041,7 @@ var ts; function checkJSDocParameterTag(node) { checkSourceElement(node.typeExpression); if (!ts.getParameterSymbolFromJSDoc(node)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 144 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 /* QualifiedName */ ? node.name.right : node.name)); } } function checkJSDocAugmentsTag(node) { @@ -43096,7 +44050,7 @@ var ts; error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName)); return; } - var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 282 /* JSDocAugmentsTag */); + var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 285 /* JSDocAugmentsTag */); ts.Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); @@ -43114,7 +44068,7 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -43127,7 +44081,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -43156,7 +44110,8 @@ var ts; } } } - checkSourceElement(node.body); + var body = node.kind === 152 /* MethodSignature */ ? undefined : node.body; + checkSourceElement(body); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if ((functionFlags & 1 /* Generator */) === 0) { var returnOrPromisedType = returnTypeNode && (functionFlags & 2 /* Async */ @@ -43167,10 +44122,10 @@ var ts; if (produceDiagnostics && !returnTypeNode) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -43189,43 +44144,43 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 269 /* SourceFile */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 237 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 232 /* TypeAliasDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 235 /* TypeAliasDeclaration */: checkUnusedTypeParameters(node); break; default: @@ -43237,8 +44192,10 @@ var ts; function checkUnusedLocalsAndParameters(node) { if (noUnusedIdentifiers && !(node.flags & 2097152 /* Ambient */)) { node.locals.forEach(function (local) { - if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 147 /* Parameter */) { + // If it's purely a type parameter, ignore, will be checked in `checkUnusedTypeParameters`. + // If it's a type parameter merged with a parameter, check if the parameter-side is used. + if (local.flags & 262144 /* TypeParameter */ ? (local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : !local.isReferenced) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 148 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && @@ -43266,8 +44223,8 @@ var ts; var node = ts.getNameOfDeclaration(declaration) || declaration; if (isIdentifierThatStartsWithUnderScore(node)) { var declaration_2 = ts.getRootDeclaration(node.parent); - if ((declaration_2.kind === 227 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || - declaration_2.kind === 146 /* TypeParameter */) { + if ((declaration_2.kind === 230 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || + declaration_2.kind === 147 /* TypeParameter */) { return; } } @@ -43283,28 +44240,42 @@ var ts; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { - if (node.members) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - if (member.kind === 152 /* MethodDeclaration */ || member.kind === 150 /* PropertyDeclaration */) { - if (!member.symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(member.symbol)); + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 153 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + if (member.kind === 156 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. + break; } - } - else if (member.kind === 153 /* Constructor */) { + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)); + } + break; + case 154 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol)); } } - } + break; + case 159 /* IndexSignature */: + case 210 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } } function checkUnusedTypeParameters(node) { - if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { + if (compilerOptions.noUnusedParameters && !(node.flags & 2097152 /* Ambient */)) { if (node.typeParameters) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. @@ -43315,7 +44286,7 @@ var ts; } for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) { var typeParameter = _a[_i]; - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & 262144 /* TypeParameter */) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(typeParameter.symbol)); } } @@ -43338,7 +44309,7 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 208 /* Block */) { + if (node.kind === 211 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -43368,12 +44339,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 151 /* MethodSignature */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 152 /* MethodSignature */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -43382,7 +44353,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 147 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 148 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -43461,7 +44432,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43476,7 +44447,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43511,7 +44482,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 227 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 230 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -43523,17 +44494,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 228 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 209 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 231 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 212 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 208 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 235 /* ModuleBlock */ || - container.kind === 234 /* ModuleDeclaration */ || - container.kind === 269 /* SourceFile */); + (container.kind === 211 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 238 /* ModuleBlock */ || + container.kind === 237 /* ModuleDeclaration */ || + container.kind === 272 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -43548,7 +44519,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 147 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 148 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -43559,7 +44530,7 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 180 /* PropertyAccessExpression */) { + if (n.kind === 183 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } @@ -43578,8 +44549,8 @@ var ts; // so we need to do a bit of extra work to check if reference is legal var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 147 /* Parameter */ || - symbol.valueDeclaration.kind === 177 /* BindingElement */) { + if (symbol.valueDeclaration.kind === 148 /* Parameter */ || + symbol.valueDeclaration.kind === 180 /* BindingElement */) { // it is ok to reference parameter in initializer if either // - parameter is located strictly on the left of current parameter declaration if (symbol.valueDeclaration.pos < node.pos) { @@ -43593,7 +44564,7 @@ var ts; return ts.isFunctionLike(current.parent) || // computed property names/initializers in instance property declaration of class like entities // are executed in constructor and thus deferred - (current.parent.kind === 150 /* PropertyDeclaration */ && + (current.parent.kind === 151 /* PropertyDeclaration */ && !(ts.hasModifier(current.parent, 32 /* Static */)) && ts.isClassLike(current.parent.parent)); })) { @@ -43615,7 +44586,9 @@ var ts; // Check variable, parameter, or property declaration function checkVariableLikeDeclaration(node) { checkDecorators(node); - checkSourceElement(node.type); + if (!ts.isBindingElement(node)) { + checkSourceElement(node.type); + } // JSDoc `function(string, string): string` syntax results in parameters with no name if (!node.name) { return; @@ -43624,57 +44597,65 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 177 /* BindingElement */) { - if (node.parent.kind === 175 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { + if (node.kind === 180 /* BindingElement */) { + if (node.parent.kind === 178 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 145 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (!ts.isBindingPattern(name)) { + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 176 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 179 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 147 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 148 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { + var initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && node.name.elements.length === 0) { + checkNonNullType(initializerType, node); + } + else { + checkTypeAssignableTo(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); + } checkParameterInitializer(node); } return; } var symbol = getSymbolOfNode(node); - var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); + var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -43696,10 +44677,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */) { + if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */) { + if (node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -43711,14 +44692,14 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 150 /* PropertyDeclaration */ || nextDeclaration.kind === 149 /* PropertySignature */ + var message = nextDeclaration.kind === 151 /* PropertyDeclaration */ || nextDeclaration.kind === 150 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 147 /* Parameter */ && right.kind === 227 /* VariableDeclaration */) || - (left.kind === 227 /* VariableDeclaration */ && right.kind === 147 /* Parameter */)) { + if ((left.kind === 148 /* Parameter */ && right.kind === 230 /* VariableDeclaration */) || + (left.kind === 230 /* VariableDeclaration */ && right.kind === 148 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -43747,19 +44728,6 @@ var ts; checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (ts.getFunctionFlags(node) & 2 /* Async */) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } function checkExpressionStatement(node) { // Grammar checking checkGrammarStatementInAmbientContext(node); @@ -43770,7 +44738,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 210 /* EmptyStatement */) { + if (node.thenStatement.kind === 213 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -43790,12 +44758,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 231 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -43813,7 +44781,7 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 6 /* ESNext */) { @@ -43831,14 +44799,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -43865,12 +44833,12 @@ var ts; // Grammar checking checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - // TypeScript 1.0 spec (April 2014): 5.4 + // TypeScript 1.0 spec (April 2014): 5.4 // In a 'for-in' statement of the form // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -43884,7 +44852,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -43897,7 +44865,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -43954,7 +44922,7 @@ var ts; var arrayTypes = inputType.types; var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 524322 /* StringLike */); }); if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); + arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } else if (arrayType.flags & 524322 /* StringLike */) { @@ -43999,7 +44967,7 @@ var ts; if (arrayElementType.flags & 524322 /* StringLike */) { return stringType; } - return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } return arrayElementType; } @@ -44086,7 +45054,7 @@ var ts; } return undefined; } - var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), 2 /* Subtype */); var iteratedType = getIteratedTypeOfIterator(returnType, errorNode, /*isAsyncIterator*/ !!asyncMethodType); if (checkAssignability && errorNode && iteratedType) { // If `checkAssignability` was specified, we were called from @@ -44154,7 +45122,7 @@ var ts; } return undefined; } - var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), 2 /* Subtype */); if (isTypeAny(nextResult)) { return undefined; } @@ -44198,8 +45166,8 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return node.kind === 154 /* GetAccessor */ - && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 155 /* SetAccessor */)) !== undefined; + return node.kind === 155 /* GetAccessor */ + && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156 /* SetAccessor */)) !== undefined; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncGenerator */) === 2 /* Async */ @@ -44209,56 +45177,56 @@ var ts; } function checkReturnStatement(node) { // Grammar checking - if (!checkGrammarStatementInAmbientContext(node)) { - var functionBlock = ts.getContainingFunction(node); - if (!functionBlock) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } + if (checkGrammarStatementInAmbientContext(node)) { + return; } var func = ts.getContainingFunction(node); - if (func) { - var signature = getSignatureFromDeclaration(func); - var returnType = getReturnTypeOfSignature(signature); - var functionFlags = ts.getFunctionFlags(func); - if (functionFlags & 1 /* Generator */) { + if (!func) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + return; + } + var signature = getSignatureFromDeclaration(func); + var returnType = getReturnTypeOfSignature(signature); + var functionFlags = ts.getFunctionFlags(func); + var isGenerator = functionFlags & 1 /* Generator */; + if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { + var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; + if (isGenerator) { // A generator does not need its return expressions checked against its return type. // Instead, the yield expressions are checked against the element type. - // TODO: Check return expressions of generators when return type tracking is added + // TODO: Check return types of generators when return type tracking is added // for generators. return; } - if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { - var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 155 /* SetAccessor */) { - if (node.expression) { - error(node, ts.Diagnostics.Setters_cannot_return_a_value); - } - } - else if (func.kind === 153 /* Constructor */) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { - error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (functionFlags & 2 /* Async */) { - var promisedType = getPromisedTypeOfPromise(returnType); - var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - if (promisedType) { - // If the function has a return type, but promisedType is - // undefined, an error will be reported in checkAsyncFunctionReturnType - // so we don't need to report one here. - checkTypeAssignableTo(awaitedType, promisedType, node); - } - } - else { - checkTypeAssignableTo(exprType, returnType, node); - } + else if (func.kind === 156 /* SetAccessor */) { + if (node.expression) { + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind !== 153 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { - // The function has a return type, but the return statement doesn't have an expression. - error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); + else if (func.kind === 154 /* Constructor */) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } } + else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { + if (functionFlags & 2 /* Async */) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + if (promisedType) { + // If the function has a return type, but promisedType is + // undefined, an error will be reported in checkAsyncFunctionReturnType + // so we don't need to report one here. + checkTypeAssignableTo(awaitedType, promisedType, node); + } + } + else { + checkTypeAssignableTo(exprType, returnType, node); + } + } + } + else if (func.kind !== 154 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + // The function has a return type, but the return statement doesn't have an expression. + error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } function checkWithStatement(node) { @@ -44285,7 +45253,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 262 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 265 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -44297,12 +45265,11 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 261 /* CaseClause */) { - var caseClause = clause; + if (produceDiagnostics && clause.kind === 264 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. - var caseType = checkExpression(caseClause.expression); + var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -44311,7 +45278,7 @@ var ts; } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { // expressionType is not comparable to caseType, try the reversed check and report errors if it fails - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, /*headMessage*/ undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, /*headMessage*/ undefined); } } ts.forEach(clause.statements, checkSourceElement); @@ -44327,7 +45294,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 223 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 226 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); return true; @@ -44420,7 +45387,8 @@ var ts; error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); } function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) { - if (!indexType) { + // ESSymbol properties apply to neither string nor numeric indexers. + if (!indexType || ts.isKnownSymbol(prop)) { return; } var propDeclaration = prop.valueDeclaration; @@ -44432,8 +45400,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && - (propDeclaration.kind === 195 /* BinaryExpression */ || - ts.getNameOfDeclaration(propDeclaration).kind === 145 /* ComputedPropertyName */ || + (propDeclaration.kind === 198 /* BinaryExpression */ || + ts.getNameOfDeclaration(propDeclaration).kind === 146 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -44539,9 +45507,11 @@ var ts; // type parameter at this position, we report an error. var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); var targetConstraint = getConstraintFromTypeParameter(target); - if ((sourceConstraint || targetConstraint) && - (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { - return false; + if (sourceConstraint) { + // relax check if later interface augmentation has no constraint + if (!targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } } // If the type parameter node has a default and it is not identical to the default // for the type parameter at this position, we report an error. @@ -44609,12 +45579,15 @@ var ts; ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; - if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { break; } } } - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var baseWithThis = getTypeWithThisArgument(baseType_1, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + } checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseConstructorType.flags & 1081344 /* TypeVariable */ && !isMixinConstructorType(staticType)) { error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); @@ -44644,7 +45617,13 @@ var ts; var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { if (isValidBaseType(t)) { - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + var genericDiag = t.symbol && t.symbol.flags & 32 /* Class */ ? + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : + ts.Diagnostics.Class_0_incorrectly_implements_interface_1; + var baseWithThis = getTypeWithThisArgument(t, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); + } } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -44659,6 +45638,35 @@ var ts; checkPropertyInitialization(node); } } + function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { + // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible + var issuedMemberError = false; + var _loop_5 = function (member) { + if (ts.hasStaticModifier(member)) { + return "continue"; + } + var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (declaredProp) { + var prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); + var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); + if (prop && baseProp) { + var rootChain = function () { return ts.chainDiagnosticMessages( + /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, ts.unescapeLeadingUnderscores(declaredProp.escapedName), typeToString(typeWithThis), typeToString(baseWithThis)); }; + if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, /*message*/ undefined, rootChain)) { + issuedMemberError = true; + } + } + } + }; + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + _loop_5(member); + } + if (!issuedMemberError) { + // check again with diagnostics to generate a less-specific error + checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); + } + } function checkBaseTypeAccessibility(type, node) { var signatures = getSignaturesOfType(type, 1 /* Construct */); if (signatures.length) { @@ -44678,7 +45686,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 230 /* ClassDeclaration */ || d.kind === 231 /* InterfaceDeclaration */; + return d.kind === 233 /* ClassDeclaration */ || d.kind === 234 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -44717,7 +45725,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { - if (derivedClassDecl.kind === 200 /* ClassExpression */) { + if (derivedClassDecl.kind === 203 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -44809,7 +45817,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 150 /* PropertyDeclaration */ && + return node.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -44831,7 +45839,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -44936,17 +45944,17 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 193 /* PrefixUnaryExpression */: - var value_1 = evaluate(expr.operand); - if (typeof value_1 === "number") { + case 196 /* PrefixUnaryExpression */: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { switch (expr.operator) { - case 37 /* PlusToken */: return value_1; - case 38 /* MinusToken */: return -value_1; - case 52 /* TildeToken */: return ~value_1; + case 37 /* PlusToken */: return value_2; + case 38 /* MinusToken */: return -value_2; + case 52 /* TildeToken */: return ~value_2; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -44962,6 +45970,7 @@ var ts; case 37 /* PlusToken */: return left + right; case 38 /* MinusToken */: return left - right; case 42 /* PercentToken */: return left % right; + case 40 /* AsteriskAsteriskToken */: return Math.pow(left, right); } } break; @@ -44970,18 +45979,18 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return evaluate(expr.expression); case 71 /* Identifier */: return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText); - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 180 /* PropertyAccessExpression */) { + if (ex.kind === 183 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -45013,8 +46022,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 181 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 183 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 184 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 9 /* StringLiteral */; } function checkEnumDeclaration(node) { @@ -45054,7 +46063,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 233 /* EnumDeclaration */) { + if (declaration.kind !== 236 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -45077,8 +46086,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { var declaration = declarations_7[_i]; - if ((declaration.kind === 230 /* ClassDeclaration */ || - (declaration.kind === 229 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 233 /* ClassDeclaration */ || + (declaration.kind === 232 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 2097152 /* Ambient */)) { return declaration; } @@ -45142,7 +46151,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 230 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 233 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -45193,23 +46202,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -45220,12 +46229,12 @@ var ts; break; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 229 /* FunctionDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -45248,12 +46257,12 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: do { node = node.left; } while (node.kind !== 71 /* Identifier */); return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 71 /* Identifier */); @@ -45266,9 +46275,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 245 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 248 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -45301,14 +46310,14 @@ var ts; (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 247 /* ExportSpecifier */ ? + var message = node.kind === 250 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 247 /* ExportSpecifier */ + && node.kind === 250 /* ExportSpecifier */ && !(target.flags & 107455 /* Value */) && !(node.flags & 2097152 /* Ambient */)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); @@ -45336,7 +46345,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -45357,7 +46366,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 252 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 107455 /* Value */) { @@ -45393,10 +46402,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 235 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 238 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 2097152 /* Ambient */; - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -45413,7 +46422,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 269 /* SourceFile */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 234 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 272 /* SourceFile */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 237 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -45442,8 +46451,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -45531,7 +46540,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 229 /* FunctionDeclaration */ && declaration.kind !== 152 /* MethodDeclaration */) || + return (declaration.kind !== 232 /* FunctionDeclaration */ && declaration.kind !== 153 /* MethodDeclaration */) || !!declaration.body; } function checkSourceElement(node) { @@ -45549,145 +46558,149 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return checkTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return checkParameter(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return checkPropertyDeclaration(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return checkSignatureDeclaration(node); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return checkMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return checkConstructorDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return checkAccessorDeclaration(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return checkTypeReferenceNode(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return checkTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return checkTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return checkArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return checkTupleType(node); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return checkSourceElement(node.type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return checkTypeOperator(node); - case 282 /* JSDocAugmentsTag */: + case 170 /* ConditionalType */: + return checkConditionalType(node); + case 171 /* InferType */: + return checkInferType(node); + case 285 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return checkJSDocTypedefTag(node); - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: checkSignatureDeclaration(node); // falls through - case 275 /* JSDocNonNullableType */: - case 274 /* JSDocNullableType */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 278 /* JSDocNonNullableType */: + case 277 /* JSDocNullableType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return checkMappedType(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return checkBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return checkVariableStatement(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return checkExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return checkIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return checkDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return checkWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return checkForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return checkForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkForOfStatement(node); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return checkReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return checkSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return checkLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return checkThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return checkTryStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return checkBindingElement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return checkClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return checkImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return checkExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return checkExportAssignment(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -45761,17 +46774,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -45890,13 +46903,13 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -45904,8 +46917,8 @@ var ts; // falls through // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -45914,7 +46927,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 793064 /* Type */); } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -45962,28 +46975,28 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 146 /* TypeParameter */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 147 /* TypeParameter */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 144 /* QualifiedName */) { + while (node.parent && node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 160 /* TypeReference */; + return node.parent && node.parent.kind === 161 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 180 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 183 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 202 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 205 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -46011,13 +47024,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 144 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 145 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 238 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 241 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 244 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 247 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -46042,7 +47055,7 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJavaScriptFile(entityName) && - entityName.parent.kind === 180 /* PropertyAccessExpression */ && + entityName.parent.kind === 183 /* PropertyAccessExpression */ && entityName.parent === entityName.parent.parent.left) { // Check if this is a special property assignment var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); @@ -46050,13 +47063,13 @@ var ts; return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 244 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 247 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } - if (entityName.kind !== 180 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 183 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 238 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 241 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -46066,7 +47079,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 202 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 205 /* ExpressionWithTypeArguments */) { meaning = 793064 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -46077,15 +47090,15 @@ var ts; meaning = 1920 /* Namespace */; } meaning |= 2097152 /* Alias */; - var entityNameSymbol = resolveEntityName(entityName, meaning); + var entityNameSymbol = ts.isEntityNameExpression(entityName) ? resolveEntityName(entityName, meaning) : undefined; if (entityNameSymbol) { return entityNameSymbol; } } - if (entityName.parent.kind === 284 /* JSDocParameterTag */) { + if (entityName.parent.kind === 287 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 146 /* TypeParameter */ && entityName.parent.parent.kind === 287 /* JSDocTemplateTag */) { + if (entityName.parent.kind === 147 /* TypeParameter */ && entityName.parent.parent.kind === 290 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJavaScriptFile(entityName)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -46097,16 +47110,17 @@ var ts; } if (entityName.kind === 71 /* Identifier */) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { - return getIntrinsicTagSymbol(entityName.parent); + var symbol = getIntrinsicTagSymbol(entityName.parent); + return symbol === unknownSymbol ? undefined : symbol; } return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 180 /* PropertyAccessExpression */ || entityName.kind === 144 /* QualifiedName */) { + else if (entityName.kind === 183 /* PropertyAccessExpression */ || entityName.kind === 145 /* QualifiedName */) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 180 /* PropertyAccessExpression */) { + if (entityName.kind === 183 /* PropertyAccessExpression */) { checkPropertyAccessExpression(entityName); } else { @@ -46116,20 +47130,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 160 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = entityName.parent.kind === 161 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 257 /* JsxAttribute */) { + else if (entityName.parent.kind === 260 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 159 /* TypePredicate */) { + if (entityName.parent.kind === 160 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (node.flags & 4194304 /* InWithStatement */) { @@ -46147,8 +47161,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 177 /* BindingElement */ && - node.parent.parent.kind === 175 /* ObjectBindingPattern */ && + else if (node.parent.kind === 180 /* BindingElement */ && + node.parent.parent.kind === 178 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText); @@ -46159,8 +47173,8 @@ var ts; } switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 99 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -46174,23 +47188,24 @@ var ts; return checkExpression(node).symbol; } // falls through - case 170 /* ThisType */: + case 173 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 97 /* SuperKeyword */: return checkExpression(node).symbol; case 123 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 153 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 154 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 9 /* StringLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: // 1). import x = require("./mo/*gotToDefinitionHere*/d") // 2). External module name in an import declaration // 3). Dynamic import call or require in javascript if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 242 /* ImportDeclaration */ || node.parent.kind === 248 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || ts.isImportCall(node.parent))) { return resolveExternalModuleName(node, node); } @@ -46215,7 +47230,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 266 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 269 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -46274,8 +47289,10 @@ var ts; } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolAtLocation(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + } } return unknownType; } @@ -46286,32 +47303,32 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 179 /* ObjectLiteralExpression */ || expr.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 182 /* ObjectLiteralExpression */ || expr.kind === 181 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 217 /* ForOfStatement */) { + if (expr.parent.kind === 220 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 195 /* BinaryExpression */) { + if (expr.parent.kind === 198 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 265 /* PropertyAssignment */) { + if (expr.parent.kind === 268 /* PropertyAssignment */) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 181 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType; - return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); + return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || unknownType); } // Gets the property symbol corresponding to the property in destructuring assignment // 'property1' from @@ -46358,42 +47375,35 @@ var ts; return ts.typeHasCallOrConstructSignatures(type, checker); } function getRootSymbols(symbol) { + var roots = getImmediateRootSymbols(symbol); + return roots ? ts.flatMap(roots, getRootSymbols) : [symbol]; + } + function getImmediateRootSymbols(symbol) { if (ts.getCheckFlags(symbol) & 6 /* Synthetic */) { - var symbols_4 = []; - var name_4 = symbol.escapedName; - ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_4); - if (symbol) { - symbols_4.push(symbol); - } - }); - return symbols_4; + return ts.mapDefined(getSymbolLinks(symbol).containingType.types, function (type) { return getPropertyOfType(type, symbol.escapedName); }); } else if (symbol.flags & 33554432 /* Transient */) { - var transient = symbol; - if (transient.leftSpread) { - return getRootSymbols(transient.leftSpread).concat(getRootSymbols(transient.rightSpread)); - } - if (transient.syntheticOrigin) { - return getRootSymbols(transient.syntheticOrigin); - } - var target = void 0; - var next = symbol; - while (next = getSymbolLinks(next).target) { - target = next; - } - if (target) { - return [target]; - } + var _a = symbol, leftSpread = _a.leftSpread, rightSpread = _a.rightSpread, syntheticOrigin = _a.syntheticOrigin; + return leftSpread ? [leftSpread, rightSpread] + : syntheticOrigin ? [syntheticOrigin] + : ts.singleElementArray(tryGetAliasTarget(symbol)); } - return [symbol]; + return undefined; + } + function tryGetAliasTarget(symbol) { + var target; + var next = symbol; + while (next = getSymbolLinks(next).target) { + target = next; + } + return target; } // Emitter support function isArgumentsLocalBinding(node) { if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -46443,14 +47453,14 @@ var ts; // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the // kinds that we do NOT prefix. var exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */) { + if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */ && !(exportSymbol.flags & 3 /* Variable */)) { return undefined; } symbol = exportSymbol; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 269 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 272 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -46494,7 +47504,7 @@ var ts; // AND // - binding is not declared in loop, should be renamed to avoid name reuse across siblings // let a, b - // { let x = 1; a = () => x; } + // { let x = 1; a = () => x; } // { let x = 100; b = () => x; } // console.log(a()); // should print '1' // console.log(b()); // should print '100' @@ -46505,7 +47515,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 262144 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 208 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 211 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -46546,16 +47556,16 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return node.expression && node.expression.kind === 71 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -46565,7 +47575,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 269 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 272 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -46643,15 +47653,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 268 /* EnumMember */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 271 /* EnumMember */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 268 /* EnumMember */) { + if (node.kind === 271 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -46737,20 +47747,20 @@ var ts; : unknownType; if (type.flags & 1024 /* UniqueESSymbol */ && type.symbol === symbol) { - flags |= 131072 /* AllowUniqueESSymbolType */; + flags |= 1048576 /* AllowUniqueESSymbolType */; } - if (flags & 8192 /* AddUndefined */) { + if (flags & 131072 /* AddUndefined */) { type = getOptionalType(type); } - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); - getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); + typeToString(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { var type = getWidenedType(getRegularTypeOfExpression(expr)); - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function hasGlobalName(name) { return globals.has(ts.escapeLeadingUnderscores(name)); @@ -46786,7 +47796,7 @@ var ts; function isLiteralConstDeclaration(node) { if (ts.isConst(node)) { var type = getTypeOfSymbol(getSymbolOfNode(node)); - return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */); + return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */); } return false; } @@ -46871,7 +47881,7 @@ var ts; // property access can only be used as values // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries - var meaning = (node.kind === 180 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) + var meaning = (node.kind === 183 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) ? 107455 /* Value */ | 1048576 /* ExportValue */ : 793064 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -46922,7 +47932,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 269 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 272 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -46942,7 +47952,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 269 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 272 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -46973,13 +47983,21 @@ var ts; }); } } + // We do global augmentations seperately from module augmentations (and before creating global types) because they + // 1. Affect global types. We won't have the correct global types until global augmentations are merged. Also, + // 2. Module augmentation instantiation requires creating the type of a module, which, in turn, can require + // checking for an export or property on the module (if export=) which, in turn, can fall back to the + // apparent type of the module - either globalObjectType or globalFunctionType - which wouldn't exist if we + // did module augmentations prior to finalizing the global types. if (augmentations) { - // merge module augmentations. + // merge _global_ module augmentations. // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed for (var _d = 0, augmentations_1 = augmentations; _d < augmentations_1.length; _d++) { var list = augmentations_1[_d]; for (var _e = 0, list_1 = list; _e < list_1.length; _e++) { var augmentation = list_1[_e]; + if (!ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; mergeModuleAugmentation(augmentation); } } @@ -47006,6 +48024,19 @@ var ts; globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; globalThisType = getGlobalTypeOrUndefined("ThisType", /*arity*/ 1); + if (augmentations) { + // merge _nonglobal_ module augmentations. + // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed + for (var _f = 0, augmentations_2 = augmentations; _f < augmentations_2.length; _f++) { + var list = augmentations_2[_f]; + for (var _g = 0, list_2 = list; _g < list_2.length; _g++) { + var augmentation = list_2[_g]; + if (ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } } function checkExternalEmitHelpers(location, helpers) { if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { @@ -47065,14 +48096,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 152 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 153 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */) { + else if (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -47089,17 +48120,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 131 /* ReadonlyKeyword */) { - if (node.kind === 149 /* PropertySignature */ || node.kind === 151 /* MethodSignature */) { + if (modifier.kind !== 132 /* ReadonlyKeyword */) { + if (node.kind === 150 /* PropertySignature */ || node.kind === 152 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 76 /* ConstKeyword */: - if (node.kind !== 233 /* EnumDeclaration */ && node.parent.kind === 230 /* ClassDeclaration */) { + if (node.kind !== 236 /* EnumDeclaration */ && node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76 /* ConstKeyword */)); } break; @@ -47119,7 +48150,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -47142,10 +48173,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -47154,11 +48185,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */ && node.kind !== 158 /* IndexSignature */ && node.kind !== 147 /* Parameter */) { + else if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */ && node.kind !== 159 /* IndexSignature */ && node.kind !== 148 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -47178,17 +48209,17 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 79 /* DefaultKeyword */: - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -47200,13 +48231,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 235 /* ModuleBlock */) { + else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 238 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -47216,14 +48247,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 230 /* ClassDeclaration */) { - if (node.kind !== 152 /* MethodDeclaration */ && - node.kind !== 150 /* PropertyDeclaration */ && - node.kind !== 154 /* GetAccessor */ && - node.kind !== 155 /* SetAccessor */) { + if (node.kind !== 233 /* ClassDeclaration */) { + if (node.kind !== 153 /* MethodDeclaration */ && + node.kind !== 151 /* PropertyDeclaration */ && + node.kind !== 155 /* GetAccessor */ && + node.kind !== 156 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 230 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 233 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -47242,7 +48273,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -47250,7 +48281,7 @@ var ts; break; } } - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -47265,13 +48296,13 @@ var ts; } return; } - else if ((node.kind === 239 /* ImportDeclaration */ || node.kind === 238 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 242 /* ImportDeclaration */ || node.kind === 241 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -47291,37 +48322,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 234 /* ModuleDeclaration */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 147 /* Parameter */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 237 /* ModuleDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 148 /* Parameter */: return false; default: - if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return false; } switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 120 /* AsyncKeyword */); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 117 /* AbstractKeyword */); - case 231 /* InterfaceDeclaration */: - case 209 /* VariableStatement */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 212 /* VariableStatement */: + case 235 /* TypeAliasDeclaration */: return true; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 76 /* ConstKeyword */); default: ts.Debug.fail(); @@ -47334,10 +48365,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -47350,9 +48381,6 @@ var ts; } } function checkGrammarTypeParameterList(typeParameters, file) { - if (checkGrammarForDisallowedTrailingComma(typeParameters)) { - return true; - } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; @@ -47400,15 +48428,13 @@ var ts; return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 188 /* ArrowFunction */) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } + if (!ts.isArrowFunction(node)) { + return false; } - return false; + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -47435,7 +48461,14 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 136 /* StringKeyword */ && parameter.type.kind !== 133 /* NumberKeyword */) { + if (parameter.type.kind !== 137 /* StringKeyword */ && parameter.type.kind !== 134 /* NumberKeyword */) { + var type = getTypeFromTypeNode(parameter.type); + if (type.flags & 2 /* String */ || type.flags & 4 /* Number */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type))); + } + if (allTypesAssignableToKind(type, 32 /* StringLiteral */, /*strict*/ true)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead); + } return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -47462,7 +48495,7 @@ var ts; if (args) { for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; - if (arg.kind === 201 /* OmittedExpression */) { + if (arg.kind === 204 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -47538,19 +48571,19 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 145 /* ComputedPropertyName */) { + if (node.kind !== 146 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 195 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { + if (computedPropertyName.expression.kind === 198 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 229 /* FunctionDeclaration */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 152 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 232 /* FunctionDeclaration */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 153 /* MethodDeclaration */); if (node.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -47575,15 +48608,15 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */) { + if (prop.kind === 270 /* SpreadAssignment */) { continue; } var name = prop.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 266 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 269 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -47592,7 +48625,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 152 /* MethodDeclaration */) { + if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 153 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -47607,21 +48640,21 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { checkGrammarNumericLiteral(name); } // falls through - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: currentKind = 1 /* Property */; break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: currentKind = 2 /* GetAccessor */; break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: currentKind = 4 /* SetAccessor */; break; default: @@ -47657,20 +48690,18 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 259 /* JsxSpreadAttribute */) { + if (attr.kind === 262 /* JsxSpreadAttribute */) { continue; } - var jsxAttr = attr; - var name = jsxAttr.name; + var name = attr.name, initializer = attr.initializer; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 260 /* JsxExpression */ && !initializer.expression) { - return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === 263 /* JsxExpression */ && !initializer.expression) { + return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -47678,12 +48709,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 217 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 220 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); } } - if (forInOrOfStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 231 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -47698,20 +48729,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -47738,11 +48769,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 154 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 155 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 155 /* SetAccessor */) { + else if (kind === 156 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -47765,21 +48796,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 140 /* UniqueKeyword */) { - if (node.type.kind !== 137 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(137 /* SymbolKeyword */)); + if (node.operator === 141 /* UniqueKeyword */) { + if (node.type.kind !== 138 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 71 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -47791,13 +48822,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -47813,17 +48844,24 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === 153 /* MethodDeclaration */) { + if (node.parent.kind === 182 /* ObjectLiteralExpression */) { + // We only disallow modifier on a method declaration if it is a property of object-literal-expression + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120 /* AsyncKeyword */)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } if (ts.isClassLike(node.parent)) { @@ -47835,14 +48873,14 @@ var ts; if (node.flags & 2097152 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === 153 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -47853,11 +48891,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 218 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 221 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -47865,8 +48903,8 @@ var ts; return false; } break; - case 222 /* SwitchStatement */: - if (node.kind === 219 /* BreakStatement */ && !node.label) { + case 225 /* SwitchStatement */: + if (node.kind === 222 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -47881,13 +48919,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -47896,12 +48934,15 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== ts.lastOrUndefined(elements)) { + if (node !== ts.last(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 176 /* ArrayBindingPattern */ || node.name.kind === 175 /* ObjectBindingPattern */) { + if (node.name.kind === 179 /* ArrayBindingPattern */ || node.name.kind === 178 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } + if (node.propertyName) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name); + } if (node.initializer) { // Error on equals token which immediately precedes the initializer return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); @@ -47910,11 +48951,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 193 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && + expr.kind === 196 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 216 /* ForInStatement */ && node.parent.parent.kind !== 217 /* ForOfStatement */) { + if (node.parent.parent.kind !== 219 /* ForInStatement */ && node.parent.parent.kind !== 220 /* ForOfStatement */) { if (node.flags & 2097152 /* Ambient */) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -47943,7 +48984,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 209 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 212 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && @@ -48002,15 +49043,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return false; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -48076,7 +49117,7 @@ var ts; return true; } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48084,7 +49125,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48095,7 +49136,7 @@ var ts; if (node.flags & 2097152 /* Ambient */ && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } - if (node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || + if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 2097152 /* Ambient */ || ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */))) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } @@ -48113,13 +49154,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 231 /* InterfaceDeclaration */ || - node.kind === 232 /* TypeAliasDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 245 /* ExportDeclaration */ || - node.kind === 244 /* ExportAssignment */ || - node.kind === 237 /* NamespaceExportDeclaration */ || + if (node.kind === 234 /* InterfaceDeclaration */ || + node.kind === 235 /* TypeAliasDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 248 /* ExportDeclaration */ || + node.kind === 247 /* ExportAssignment */ || + node.kind === 240 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -48128,7 +49169,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 209 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 212 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -48154,7 +49195,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 208 /* Block */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 211 /* Block */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -48175,10 +49216,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 174 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 177 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 268 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 271 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -48230,23 +49271,23 @@ var ts; /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: - return true; + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: + return ts.isIdentifier(name); default: return ts.isDeclarationName(name); } } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 240 /* ImportClause */: // For default import - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */:// For rename import `x as y` + case 243 /* ImportClause */: // For default import + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */:// For rename import `x as y` return true; case 71 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 243 /* ImportSpecifier */; + return decl.parent.kind === 246 /* ImportSpecifier */; default: return false; } @@ -48360,7 +49401,7 @@ var ts; var node = createSynthesizedNode(71 /* Identifier */); node.escapedText = ts.escapeLeadingUnderscores(text); node.originalKeywordKind = text ? ts.stringToToken(text) : 0 /* Unknown */; - node.autoGenerateKind = 0 /* None */; + node.autoGenerateFlags = 0 /* None */; node.autoGenerateId = 0; if (typeArguments) { node.typeArguments = createNodeArray(typeArguments); @@ -48375,22 +49416,24 @@ var ts; } ts.updateIdentifier = updateIdentifier; var nextAutoGenerateId = 0; - /** Create a unique temporary variable. */ - function createTempVariable(recordTempVariable) { + function createTempVariable(recordTempVariable, reservedInNestedScopes) { var name = createIdentifier(""); - name.autoGenerateKind = 1 /* Auto */; + name.autoGenerateFlags = 1 /* Auto */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; if (recordTempVariable) { recordTempVariable(name); } + if (reservedInNestedScopes) { + name.autoGenerateFlags |= 16 /* ReservedInNestedScopes */; + } return name; } ts.createTempVariable = createTempVariable; /** Create a unique temporary variable for use in a loop. */ function createLoopVariable() { var name = createIdentifier(""); - name.autoGenerateKind = 2 /* Loop */; + name.autoGenerateFlags = 2 /* Loop */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -48399,7 +49442,7 @@ var ts; /** Create a unique name based on the supplied text. */ function createUniqueName(text) { var name = createIdentifier(text); - name.autoGenerateKind = 3 /* Unique */; + name.autoGenerateFlags = 3 /* Unique */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -48407,10 +49450,12 @@ var ts; ts.createUniqueName = createUniqueName; function getGeneratedNameForNode(node, shouldSkipNameGenerationScope) { var name = createIdentifier(""); - name.autoGenerateKind = 4 /* Node */; + name.autoGenerateFlags = 4 /* Node */; name.autoGenerateId = nextAutoGenerateId; name.original = node; - name.skipNameGenerationScope = !!shouldSkipNameGenerationScope; + if (shouldSkipNameGenerationScope) { + name.autoGenerateFlags |= 8 /* SkipNameGenerationScope */; + } nextAutoGenerateId++; return name; } @@ -48443,7 +49488,7 @@ var ts; ts.createFalse = createFalse; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(144 /* QualifiedName */); + var node = createSynthesizedNode(145 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -48457,7 +49502,7 @@ var ts; } ts.updateQualifiedName = updateQualifiedName; function createComputedPropertyName(expression) { - var node = createSynthesizedNode(145 /* ComputedPropertyName */); + var node = createSynthesizedNode(146 /* ComputedPropertyName */); node.expression = expression; return node; } @@ -48470,7 +49515,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(146 /* TypeParameter */); + var node = createSynthesizedNode(147 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -48486,7 +49531,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(147 /* Parameter */); + var node = createSynthesizedNode(148 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -48510,7 +49555,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(148 /* Decorator */); + var node = createSynthesizedNode(149 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -48523,7 +49568,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(149 /* PropertySignature */); + var node = createSynthesizedNode(150 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -48542,30 +49587,32 @@ var ts; : node; } ts.updatePropertySignature = updatePropertySignature; - function createProperty(decorators, modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(150 /* PropertyDeclaration */); + function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { + var node = createSynthesizedNode(151 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.questionToken = questionToken; + node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined; + node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined; node.type = type; node.initializer = initializer; return node; } ts.createProperty = createProperty; - function updateProperty(node, decorators, modifiers, name, questionToken, type, initializer) { + function updateProperty(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { return node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name - || node.questionToken !== questionToken + || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined) + || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined) || node.type !== type || node.initializer !== initializer - ? updateNode(createProperty(decorators, modifiers, name, questionToken, type, initializer), node) + ? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(151 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(152 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -48582,7 +49629,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(152 /* MethodDeclaration */); + var node = createSynthesizedNode(153 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -48610,7 +49657,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(153 /* Constructor */); + var node = createSynthesizedNode(154 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -48630,7 +49677,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(154 /* GetAccessor */); + var node = createSynthesizedNode(155 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -48653,7 +49700,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(155 /* SetAccessor */); + var node = createSynthesizedNode(156 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -48674,7 +49721,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(156 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(157 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -48682,7 +49729,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(157 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(158 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -48690,7 +49737,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(158 /* IndexSignature */); + var node = createSynthesizedNode(159 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -48708,11 +49755,12 @@ var ts; } ts.updateIndexSignature = updateIndexSignature; /* @internal */ - function createSignatureDeclaration(kind, typeParameters, parameters, type) { + function createSignatureDeclaration(kind, typeParameters, parameters, type, typeArguments) { var node = createSynthesizedNode(kind); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createSignatureDeclaration = createSignatureDeclaration; @@ -48729,7 +49777,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(159 /* TypePredicate */); + var node = createSynthesizedNode(160 /* TypePredicate */); node.parameterName = asName(parameterName); node.type = type; return node; @@ -48743,7 +49791,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(160 /* TypeReference */); + var node = createSynthesizedNode(161 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -48757,7 +49805,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(161 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(162 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -48765,7 +49813,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(162 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(163 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -48773,7 +49821,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(163 /* TypeQuery */); + var node = createSynthesizedNode(164 /* TypeQuery */); node.exprName = exprName; return node; } @@ -48785,7 +49833,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(164 /* TypeLiteral */); + var node = createSynthesizedNode(165 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -48797,7 +49845,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(165 /* ArrayType */); + var node = createSynthesizedNode(166 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -48809,7 +49857,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(166 /* TupleType */); + var node = createSynthesizedNode(167 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -48821,7 +49869,7 @@ var ts; } ts.updateTypleTypeNode = updateTypleTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(167 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(168 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -48829,7 +49877,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(168 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(169 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -48847,8 +49895,38 @@ var ts; ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) : node; } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createSynthesizedNode(170 /* ConditionalType */); + node.checkType = ts.parenthesizeConditionalTypeMember(checkType); + node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); + node.trueType = trueType; + node.falseType = falseType; + return node; + } + ts.createConditionalTypeNode = createConditionalTypeNode; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType + || node.extendsType !== extendsType + || node.trueType !== trueType + || node.falseType !== falseType + ? updateNode(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) + : node; + } + ts.updateConditionalTypeNode = updateConditionalTypeNode; + function createInferTypeNode(typeParameter) { + var node = createSynthesizedNode(171 /* InferType */); + node.typeParameter = typeParameter; + return node; + } + ts.createInferTypeNode = createInferTypeNode; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter + ? updateNode(createInferTypeNode(typeParameter), node) + : node; + } + ts.updateInferTypeNode = updateInferTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(169 /* ParenthesizedType */); + var node = createSynthesizedNode(172 /* ParenthesizedType */); node.type = type; return node; } @@ -48860,12 +49938,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(170 /* ThisType */); + return createSynthesizedNode(173 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(171 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 127 /* KeyOfKeyword */; + var node = createSynthesizedNode(174 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 128 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -48875,7 +49953,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(172 /* IndexedAccessType */); + var node = createSynthesizedNode(175 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -48889,7 +49967,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(173 /* MappedType */); + var node = createSynthesizedNode(176 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -48907,7 +49985,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(174 /* LiteralType */); + var node = createSynthesizedNode(177 /* LiteralType */); node.literal = literal; return node; } @@ -48920,7 +49998,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(175 /* ObjectBindingPattern */); + var node = createSynthesizedNode(178 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -48932,7 +50010,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(176 /* ArrayBindingPattern */); + var node = createSynthesizedNode(179 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -48944,7 +50022,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(177 /* BindingElement */); + var node = createSynthesizedNode(180 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -48963,7 +50041,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(178 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(181 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -48977,7 +50055,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(179 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(182 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -48991,7 +50069,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(180 /* PropertyAccessExpression */); + var node = createSynthesizedNode(183 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -49008,7 +50086,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(181 /* ElementAccessExpression */); + var node = createSynthesizedNode(184 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -49022,7 +50100,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(182 /* CallExpression */); + var node = createSynthesizedNode(185 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -49038,7 +50116,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(183 /* NewExpression */); + var node = createSynthesizedNode(186 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -49054,7 +50132,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, template) { - var node = createSynthesizedNode(184 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(187 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; @@ -49068,7 +50146,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(185 /* TypeAssertionExpression */); + var node = createSynthesizedNode(188 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -49082,7 +50160,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(186 /* ParenthesizedExpression */); + var node = createSynthesizedNode(189 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -49094,7 +50172,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(187 /* FunctionExpression */); + var node = createSynthesizedNode(190 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -49118,7 +50196,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(188 /* ArrowFunction */); + var node = createSynthesizedNode(191 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -49152,7 +50230,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(189 /* DeleteExpression */); + var node = createSynthesizedNode(192 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49164,7 +50242,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(190 /* TypeOfExpression */); + var node = createSynthesizedNode(193 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49176,7 +50254,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(191 /* VoidExpression */); + var node = createSynthesizedNode(194 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49188,7 +50266,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(192 /* AwaitExpression */); + var node = createSynthesizedNode(195 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49200,7 +50278,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(193 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(196 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -49213,7 +50291,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(194 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(197 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -49226,7 +50304,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(195 /* BinaryExpression */); + var node = createSynthesizedNode(198 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -49243,7 +50321,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(196 /* ConditionalExpression */); + var node = createSynthesizedNode(199 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -49273,7 +50351,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(197 /* TemplateExpression */); + var node = createSynthesizedNode(200 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -49311,7 +50389,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(198 /* YieldExpression */); + var node = createSynthesizedNode(201 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -49325,7 +50403,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(199 /* SpreadElement */); + var node = createSynthesizedNode(202 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -49337,7 +50415,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(200 /* ClassExpression */); + var node = createSynthesizedNode(203 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49358,11 +50436,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(201 /* OmittedExpression */); + return createSynthesizedNode(204 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(202 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(205 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -49376,7 +50454,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(203 /* AsExpression */); + var node = createSynthesizedNode(206 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -49390,7 +50468,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(204 /* NonNullExpression */); + var node = createSynthesizedNode(207 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -49402,7 +50480,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(205 /* MetaProperty */); + var node = createSynthesizedNode(208 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -49416,7 +50494,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(206 /* TemplateSpan */); + var node = createSynthesizedNode(209 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -49430,12 +50508,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(207 /* SemicolonClassElement */); + return createSynthesizedNode(210 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(208 /* Block */); + var block = createSynthesizedNode(211 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -49449,7 +50527,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(209 /* VariableStatement */); + var node = createSynthesizedNode(212 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -49464,11 +50542,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(210 /* EmptyStatement */); + return createSynthesizedNode(213 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createStatement(expression) { - var node = createSynthesizedNode(211 /* ExpressionStatement */); + var node = createSynthesizedNode(214 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -49480,7 +50558,7 @@ var ts; } ts.updateStatement = updateStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(212 /* IfStatement */); + var node = createSynthesizedNode(215 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -49496,7 +50574,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(213 /* DoStatement */); + var node = createSynthesizedNode(216 /* DoStatement */); node.statement = statement; node.expression = expression; return node; @@ -49510,7 +50588,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(214 /* WhileStatement */); + var node = createSynthesizedNode(217 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; @@ -49524,7 +50602,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(215 /* ForStatement */); + var node = createSynthesizedNode(218 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -49542,7 +50620,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(216 /* ForInStatement */); + var node = createSynthesizedNode(219 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -49558,7 +50636,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(217 /* ForOfStatement */); + var node = createSynthesizedNode(220 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -49576,7 +50654,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(218 /* ContinueStatement */); + var node = createSynthesizedNode(221 /* ContinueStatement */); node.label = asName(label); return node; } @@ -49588,7 +50666,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(219 /* BreakStatement */); + var node = createSynthesizedNode(222 /* BreakStatement */); node.label = asName(label); return node; } @@ -49600,7 +50678,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(220 /* ReturnStatement */); + var node = createSynthesizedNode(223 /* ReturnStatement */); node.expression = expression; return node; } @@ -49612,7 +50690,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(221 /* WithStatement */); + var node = createSynthesizedNode(224 /* WithStatement */); node.expression = expression; node.statement = statement; return node; @@ -49626,7 +50704,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(222 /* SwitchStatement */); + var node = createSynthesizedNode(225 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -49640,7 +50718,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(223 /* LabeledStatement */); + var node = createSynthesizedNode(226 /* LabeledStatement */); node.label = asName(label); node.statement = statement; return node; @@ -49654,7 +50732,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(224 /* ThrowStatement */); + var node = createSynthesizedNode(227 /* ThrowStatement */); node.expression = expression; return node; } @@ -49666,7 +50744,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(225 /* TryStatement */); + var node = createSynthesizedNode(228 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -49682,11 +50760,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(226 /* DebuggerStatement */); + return createSynthesizedNode(229 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(227 /* VariableDeclaration */); + var node = createSynthesizedNode(230 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -49702,7 +50780,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { - var node = createSynthesizedNode(228 /* VariableDeclarationList */); + var node = createSynthesizedNode(231 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -49715,7 +50793,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(229 /* FunctionDeclaration */); + var node = createSynthesizedNode(232 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -49741,7 +50819,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(230 /* ClassDeclaration */); + var node = createSynthesizedNode(233 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49763,7 +50841,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(231 /* InterfaceDeclaration */); + var node = createSynthesizedNode(234 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49785,7 +50863,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(232 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(235 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49805,7 +50883,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(233 /* EnumDeclaration */); + var node = createSynthesizedNode(236 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49823,7 +50901,7 @@ var ts; } ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { - var node = createSynthesizedNode(234 /* ModuleDeclaration */); + var node = createSynthesizedNode(237 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 512 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -49842,7 +50920,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(235 /* ModuleBlock */); + var node = createSynthesizedNode(238 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -49854,7 +50932,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(236 /* CaseBlock */); + var node = createSynthesizedNode(239 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -49866,7 +50944,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(237 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(240 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -49878,7 +50956,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(238 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(241 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49896,7 +50974,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(239 /* ImportDeclaration */); + var node = createSynthesizedNode(242 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -49914,7 +50992,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(240 /* ImportClause */); + var node = createSynthesizedNode(243 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; @@ -49928,7 +51006,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(241 /* NamespaceImport */); + var node = createSynthesizedNode(244 /* NamespaceImport */); node.name = name; return node; } @@ -49940,7 +51018,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(242 /* NamedImports */); + var node = createSynthesizedNode(245 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -49952,7 +51030,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(243 /* ImportSpecifier */); + var node = createSynthesizedNode(246 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -49966,7 +51044,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(244 /* ExportAssignment */); + var node = createSynthesizedNode(247 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -49983,7 +51061,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(245 /* ExportDeclaration */); + var node = createSynthesizedNode(248 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -50001,7 +51079,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(246 /* NamedExports */); + var node = createSynthesizedNode(249 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -50013,7 +51091,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(247 /* ExportSpecifier */); + var node = createSynthesizedNode(250 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -50028,7 +51106,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(249 /* ExternalModuleReference */); + var node = createSynthesizedNode(252 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -50041,7 +51119,7 @@ var ts; ts.updateExternalModuleReference = updateExternalModuleReference; // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(250 /* JsxElement */); + var node = createSynthesizedNode(253 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -50057,7 +51135,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, attributes) { - var node = createSynthesizedNode(251 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(254 /* JsxSelfClosingElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50071,7 +51149,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, attributes) { - var node = createSynthesizedNode(252 /* JsxOpeningElement */); + var node = createSynthesizedNode(255 /* JsxOpeningElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50085,7 +51163,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(253 /* JsxClosingElement */); + var node = createSynthesizedNode(256 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -50097,7 +51175,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(254 /* JsxFragment */); + var node = createSynthesizedNode(257 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -50113,7 +51191,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(257 /* JsxAttribute */); + var node = createSynthesizedNode(260 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -50127,7 +51205,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(258 /* JsxAttributes */); + var node = createSynthesizedNode(261 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -50139,7 +51217,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(259 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(262 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -50151,7 +51229,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(260 /* JsxExpression */); + var node = createSynthesizedNode(263 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -50165,7 +51243,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(261 /* CaseClause */); + var node = createSynthesizedNode(264 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -50179,7 +51257,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(262 /* DefaultClause */); + var node = createSynthesizedNode(265 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -50191,7 +51269,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(263 /* HeritageClause */); + var node = createSynthesizedNode(266 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -50204,7 +51282,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(264 /* CatchClause */); + var node = createSynthesizedNode(267 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -50219,7 +51297,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(265 /* PropertyAssignment */); + var node = createSynthesizedNode(268 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -50234,7 +51312,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(266 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(269 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -50248,7 +51326,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(267 /* SpreadAssignment */); + var node = createSynthesizedNode(270 /* SpreadAssignment */); node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; return node; } @@ -50261,7 +51339,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(268 /* EnumMember */); + var node = createSynthesizedNode(271 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -50277,7 +51355,7 @@ var ts; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createSynthesizedNode(269 /* SourceFile */); + var updated = createSynthesizedNode(272 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -50356,7 +51434,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(291 /* NotEmittedStatement */); + var node = createSynthesizedNode(294 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -50368,7 +51446,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(295 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(298 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50380,7 +51458,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(294 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(297 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50395,7 +51473,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(292 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(295 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -50411,7 +51489,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 293 /* CommaListExpression */) { + if (node.kind === 296 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26 /* CommaToken */) { @@ -50421,7 +51499,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(293 /* CommaListExpression */); + var node = createSynthesizedNode(296 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -50433,7 +51511,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createBundle(sourceFiles) { - var node = ts.createNode(270 /* Bundle */); + var node = ts.createNode(273 /* Bundle */); node.sourceFiles = sourceFiles; return node; } @@ -50569,7 +51647,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -51070,7 +52148,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 223 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 226 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -51088,13 +52166,13 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return false; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -51120,7 +52198,7 @@ var ts; } else { switch (callee.kind) { - case 180 /* PropertyAccessExpression */: { + case 183 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51133,7 +52211,7 @@ var ts; } break; } - case 181 /* ElementAccessExpression */: { + case 184 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51190,14 +52268,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -51521,7 +52599,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 186 /* ParenthesizedExpression */) { + if (skipped.kind === 189 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -51555,8 +52633,8 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(195 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(198 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { @@ -51565,7 +52643,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 198 /* YieldExpression */) { + && operand.kind === 201 /* YieldExpression */) { return false; } return true; @@ -51575,13 +52653,13 @@ var ts; if (isLeftSideOfBinary) { // No need to parenthesize the left operand when the binary operator is // left associative: - // (a*b)/x -> a*b/x - // (a**b)/x -> a**b/x + // (a*b)/x -> a*b/x + // (a**b)/x -> a**b/x // // Parentheses are needed for the left operand when the binary operator is // right associative: - // (a/b)**x -> (a/b)**x - // (a**b)**x -> (a**b)**x + // (a/b)**x -> (a/b)**x + // (a**b)**x -> (a**b)**x return binaryOperatorAssociativity === 1 /* Right */; } else { @@ -51653,7 +52731,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -51668,7 +52746,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(196 /* ConditionalExpression */, 55 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(199 /* ConditionalExpression */, 55 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { @@ -51681,7 +52759,9 @@ var ts; // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions // so in case when comma expression is introduced as a part of previous transformations // if should be wrapped in parens since comma operator has the lowest precedence - return e.kind === 195 /* BinaryExpression */ && e.operatorToken.kind === 26 /* CommaToken */ + var emittedExpression = ts.skipPartiallyEmittedExpressions(e); + return emittedExpression.kind === 198 /* BinaryExpression */ && emittedExpression.operatorToken.kind === 26 /* CommaToken */ || + emittedExpression.kind === 296 /* CommaListExpression */ ? ts.createParen(e) : e; } @@ -51699,9 +52779,9 @@ var ts; */ function parenthesizeDefaultExpression(e) { var check = ts.skipPartiallyEmittedExpressions(e); - return (check.kind === 200 /* ClassExpression */ || - check.kind === 187 /* FunctionExpression */ || - check.kind === 293 /* CommaListExpression */ || + return (check.kind === 203 /* ClassExpression */ || + check.kind === 190 /* FunctionExpression */ || + check.kind === 296 /* CommaListExpression */ || ts.isBinaryExpression(check) && check.operatorToken.kind === 26 /* CommaToken */) ? ts.createParen(e) : e; @@ -51716,9 +52796,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.createParen(expression); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -51741,7 +52821,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 183 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 186 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -51779,7 +52859,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, 26 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, 26 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -51790,34 +52870,38 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 187 /* FunctionExpression */ || kind === 188 /* ArrowFunction */) { + if (kind === 190 /* FunctionExpression */ || kind === 191 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 179 /* ObjectLiteralExpression */ || leftmostExpressionKind === 187 /* FunctionExpression */) { + if (leftmostExpressionKind === 182 /* ObjectLiteralExpression */ || leftmostExpressionKind === 190 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function parenthesizeConditionalTypeMember(member) { + return member.kind === 170 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + } + ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createParenthesizedType(member); } - return member; + return parenthesizeConditionalTypeMember(member); } ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -51843,25 +52927,25 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: node = node.operand; continue; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: node = node.left; continue; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: node = node.condition; continue; - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: node = node.expression; continue; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -51869,7 +52953,7 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 179 /* ObjectLiteralExpression */) { + if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 182 /* ObjectLiteralExpression */) { return ts.setTextRange(ts.createParen(body), body); } return body; @@ -51885,13 +52969,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 207 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -51916,14 +53000,14 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */) { + while (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 204 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 207 /* NonNullExpression */) { node = node.expression; } return node; @@ -51931,11 +53015,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 186 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 185 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 203 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 204 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 292 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 189 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 206 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -51953,7 +53037,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 186 /* ParenthesizedExpression */ + return node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -51978,14 +53062,14 @@ var ts; return emitNode && emitNode.externalHelpersModuleName; } ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues) { + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) { if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(node, compilerOptions)) { var externalHelpersModuleName = getExternalHelpersModuleName(node); if (externalHelpersModuleName) { return externalHelpersModuleName; } var moduleKind = ts.getEmitModuleKind(compilerOptions); - var create = hasExportStarsToExportValues + var create = (hasExportStarsToExportValues || (compilerOptions.esModuleInterop && hasImportStarOrImportDefault)) && moduleKind !== ts.ModuleKind.System && moduleKind !== ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.ESNext; @@ -52018,10 +53102,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 239 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 242 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 245 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 248 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -52139,7 +53223,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -52151,11 +53235,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -52187,12 +53271,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 148 /* Parameter */: + case 180 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 199 /* SpreadElement */: - case 267 /* SpreadAssignment */: + case 202 /* SpreadElement */: + case 270 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -52204,7 +53288,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -52216,7 +53300,7 @@ var ts; : propertyName; } break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -52228,7 +53312,7 @@ var ts; : propertyName; } break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -52246,13 +53330,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -52292,11 +53376,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -52331,6 +53415,7 @@ var ts; /// var ts; (function (ts) { + var isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration); function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; @@ -52459,266 +53544,270 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */) || kind === 170 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */) || kind === 173 /* ThisType */) { return node; } switch (kind) { // Names case 71 /* Identifier */: - return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 144 /* QualifiedName */: + return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); + case 145 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 148 /* Decorator */: + case 149 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 166 /* TupleType */: + case 167 /* TupleType */: return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 167 /* UnionType */: + case 168 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); + case 171 /* InferType */: + return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); + case 172 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 173 /* MappedType */: + case 176 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 208 /* Block */: + case 211 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 217 /* ForOfStatement */: - return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 218 /* ContinueStatement */: + case 220 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 221 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -52760,58 +53849,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 159 /* TypePredicate */ && kind <= 174 /* LiteralType */)) { + if ((kind >= 160 /* TypePredicate */ && kind <= 177 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 207 /* SemicolonClassElement */: - case 210 /* EmptyStatement */: - case 201 /* OmittedExpression */: - case 226 /* DebuggerStatement */: - case 291 /* NotEmittedStatement */: + case 210 /* SemicolonClassElement */: + case 213 /* EmptyStatement */: + case 204 /* OmittedExpression */: + case 229 /* DebuggerStatement */: + case 294 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 147 /* Parameter */: + case 148 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 148 /* Decorator */: + case 149 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -52820,12 +53909,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 153 /* Constructor */: + case 154 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -52833,7 +53922,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -52841,49 +53930,49 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 183 /* NewExpression */: + case 186 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -52891,123 +53980,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 186 /* ParenthesizedExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: - case 204 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 203 /* AsExpression */: + case 206 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 208 /* Block */: + case 211 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 214 /* WhileStatement */: - case 221 /* WithStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53016,7 +54105,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53024,139 +54113,139 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 264 /* CatchClause */: + case 267 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -53229,7 +54318,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 202 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 205 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -53320,6 +54409,34 @@ var ts; return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; + function getNamedImportCount(node) { + if (!(node.importClause && node.importClause.namedBindings)) + return 0; + var names = node.importClause.namedBindings; + if (!names) + return 0; + if (!ts.isNamedImports(names)) + return 0; + return names.elements.length; + } + function containsDefaultReference(node) { + if (!node) + return false; + if (!ts.isNamedImports(node)) + return false; + return ts.some(node.elements, isNamedDefaultReference); + } + function isNamedDefaultReference(e) { + return e.propertyName && e.propertyName.escapedText === "default" /* Default */; + } + function getImportNeedsImportStarHelper(node) { + return !!ts.getNamespaceDeclarationNode(node) || (getNamedImportCount(node) > 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper; + function getImportNeedsImportDefaultHelper(node) { + return ts.isDefaultImport(node) || (getNamedImportCount(node) === 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; var exportSpecifiers = ts.createMultiMap(); @@ -53329,23 +54446,25 @@ var ts; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; + var hasImportStarOrImportDefault = false; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" // import { x, y } from "mod" externalImports.push(node); + hasImportStarOrImportDefault = getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 238 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + case 241 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -53375,13 +54494,13 @@ var ts; } } break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -53389,7 +54508,7 @@ var ts; } } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -53409,7 +54528,7 @@ var ts; } } break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -53431,11 +54550,12 @@ var ts; break; } } - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues); + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault); var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { + ts.addEmitFlags(externalHelpersImportDeclaration, 67108864 /* NeverApplyImportHelper */); externalImports.unshift(externalHelpersImportDeclaration); } return { externalImports: externalImports, exportSpecifiers: exportSpecifiers, exportEquals: exportEquals, hasExportStarsToExportValues: hasExportStarsToExportValues, exportedBindings: exportedBindings, exportedNames: exportedNames, externalHelpersImportDeclaration: externalHelpersImportDeclaration }; @@ -53476,9 +54596,8 @@ var ts; * - this is mostly subjective beyond the requirement that the expression not be sideeffecting */ function isSimpleCopiableExpression(expression) { - return expression.kind === 9 /* StringLiteral */ || + return ts.isStringLiteralLike(expression) || expression.kind === 8 /* NumericLiteral */ || - expression.kind === 13 /* NoSubstitutionTemplateLiteral */ || ts.isKeyword(expression.kind) || ts.isIdentifier(expression); } @@ -53535,7 +54654,12 @@ var ts; }; if (value) { value = ts.visitNode(value, visitor, ts.isExpression); - if (needsValue) { + if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText)) { + // If the right-hand value of the assignment is also an assignment target then + // we need to cache the right-hand value. + value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ false, location); + } + else if (needsValue) { // If the right-hand value of the destructuring assignment needs to be preserved (as // is the case when the destructuring assignment is part of a larger expression), // then we need to cache the right-hand value. @@ -53579,6 +54703,26 @@ var ts; } } ts.flattenDestructuringAssignment = flattenDestructuringAssignment; + function bindingOrAssignmentElementAssignsToName(element, escapedName) { + var target = ts.getTargetOfBindingOrAssignmentElement(element); + if (ts.isBindingOrAssignmentPattern(target)) { + return bindingOrAssignmentPatternAssignsToName(target, escapedName); + } + else if (ts.isIdentifier(target)) { + return target.escapedText === escapedName; + } + return false; + } + function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) { + var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; + if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { + return true; + } + } + return false; + } /** * Flattens a VariableDeclaration or ParameterDeclaration to one or more variable declarations. * @@ -53606,6 +54750,15 @@ var ts; createArrayBindingOrAssignmentElement: makeBindingElement, visitor: visitor }; + if (ts.isVariableDeclaration(node)) { + var initializer = ts.getInitializerOfBindingOrAssignmentElement(node); + if (initializer && ts.isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText)) { + // If the right-hand value of the assignment is also an assignment target then + // we need to cache the right-hand value. + initializer = ensureIdentifier(flattenContext, initializer, /*reuseIdentifierExpressions*/ false, initializer); + node = ts.updateVariableDeclaration(node, node.name, node.type, initializer); + } + } flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); if (pendingExpressions) { var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); @@ -53975,8 +55128,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -53994,7 +55147,7 @@ var ts; */ var classAliases; /** - * Keeps track of whether we are within any containing namespaces when performing + * Keeps track of whether we are within any containing namespaces when performing * just-in-time substitution while printing an expression identifier. */ var applicableSubstitutions; @@ -54045,15 +55198,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 235 /* ModuleBlock */: - case 208 /* Block */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 238 /* ModuleBlock */: + case 211 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 230 /* ClassDeclaration */: - case 229 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -54065,7 +55218,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 230 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 233 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } break; } @@ -54109,10 +55262,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -54133,13 +55286,13 @@ var ts; return node; } switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -54159,11 +55312,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 245 /* ExportDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 240 /* ImportClause */ || - (node.kind === 238 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 249 /* ExternalModuleReference */)) { + if (node.kind === 248 /* ExportDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 243 /* ImportClause */ || + (node.kind === 241 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 252 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -54193,19 +55346,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 150 /* PropertyDeclaration */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -54243,53 +55396,54 @@ var ts; case 117 /* AbstractKeyword */: case 76 /* ConstKeyword */: case 124 /* DeclareKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 164 /* TypeLiteral */: - case 159 /* TypePredicate */: - case 146 /* TypeParameter */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 165 /* TypeLiteral */: + case 160 /* TypePredicate */: + case 147 /* TypeParameter */: case 119 /* AnyKeyword */: case 122 /* BooleanKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: case 105 /* VoidKeyword */: - case 137 /* SymbolKeyword */: - case 162 /* ConstructorType */: - case 161 /* FunctionType */: - case 163 /* TypeQuery */: - case 160 /* TypeReference */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: + case 138 /* SymbolKeyword */: + case 163 /* ConstructorType */: + case 162 /* FunctionType */: + case 164 /* TypeQuery */: + case 161 /* TypeReference */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 172 /* ParenthesizedType */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: // TypeScript type nodes are elided. - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // TypeScript index signatures are elided. - case 148 /* Decorator */: + case 149 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructor(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54300,7 +55454,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54311,35 +55465,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -54349,33 +55503,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -54691,11 +55845,14 @@ var ts; ts.setTextRange(classExpression, node); if (ts.some(staticProperties) || ts.some(pendingExpressions)) { var expressions = []; - var temp = ts.createTempVariable(hoistVariableDeclaration); - if (resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */) { + var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */; + var temp = ts.createTempVariable(hoistVariableDeclaration, !!isClassWithConstructorReference); + if (isClassWithConstructorReference) { // record an alias as the class name is not in scope for statics. enableSubstitutionForClassAliases(); - classAliases[ts.getOriginalNodeId(node)] = ts.getSynthesizedClone(temp); + var alias = ts.getSynthesizedClone(temp); + alias.autoGenerateFlags &= ~16 /* ReservedInNestedScopes */; + classAliases[ts.getOriginalNodeId(node)] = alias; } // To preserve the behavior of the old emitter, we explicitly indent // the body of a class with static initializers. @@ -54854,7 +56011,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -54925,7 +56082,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 150 /* PropertyDeclaration */ + return member.kind === 151 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -55063,12 +56220,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -55221,7 +56378,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 150 /* PropertyDeclaration */ + ? member.kind === 151 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -55344,10 +56501,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 150 /* PropertyDeclaration */; + return kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 151 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -55357,7 +56514,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -55368,12 +56525,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; } return false; @@ -55385,15 +56542,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: - case 154 /* GetAccessor */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 155 /* GetAccessor */: return serializeTypeNode(node.type); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 153 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -55430,7 +56587,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 154 /* GetAccessor */) { + if (container && node.kind === 155 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -55476,26 +56633,26 @@ var ts; } switch (node.kind) { case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return ts.createVoidZero(); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createIdentifier("Function"); - case 165 /* ArrayType */: - case 166 /* TupleType */: + case 166 /* ArrayType */: + case 167 /* TupleType */: return ts.createIdentifier("Array"); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: case 122 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return ts.createIdentifier("String"); - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 174 /* LiteralType */: + case 177 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); @@ -55509,24 +56666,24 @@ var ts; break; } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return serializeTypeReferenceNode(node); - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: return serializeUnionOrIntersectionType(node); - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 164 /* TypeLiteral */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 165 /* TypeLiteral */: case 119 /* AnyKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -55540,13 +56697,13 @@ var ts; var serializedUnion; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -55627,7 +56784,7 @@ var ts; return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } return name; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -56202,12 +57359,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentScope.kind === 269 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentScope.kind === 272 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 233 /* EnumDeclaration */) { + if (node.kind === 236 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -56326,7 +57483,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 235 /* ModuleBlock */) { + if (body.kind === 238 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -56372,13 +57529,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 235 /* ModuleBlock */) { + if (body.kind !== 238 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -56419,7 +57576,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 241 /* NamespaceImport */) { + if (node.kind === 244 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -56651,16 +57808,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(71 /* Identifier */); - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(234 /* ModuleDeclaration */); + context.enableEmitNotification(237 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 234 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 237 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 233 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 236 /* EnumDeclaration */; } /** * Hook for node emit. @@ -56721,9 +57878,9 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -56761,9 +57918,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 269 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 234 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 233 /* EnumDeclaration */); + if (container && container.kind !== 272 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 237 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 236 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -56798,9 +57955,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } ts.transformTypeScript = transformTypeScript; @@ -56864,7 +58019,7 @@ var ts; ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); var compilerOptions = context.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -56878,6 +58033,7 @@ var ts; * just-in-time substitution for `super` expressions inside of async methods. */ var enclosingSuperContainerFlags = 0; + var enclosingFunctionParameterNames; // Save the previous transformation hooks. var previousOnEmitNode = context.onEmitNode; var previousOnSubstituteNode = context.onSubstituteNode; @@ -56901,20 +58057,97 @@ var ts; case 120 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); default: return ts.visitEachChild(node, visitor, context); } } + function asyncBodyVisitor(node) { + if (ts.isNodeWithPossibleHoistedDeclaration(node)) { + switch (node.kind) { + case 212 /* VariableStatement */: + return visitVariableStatementInAsyncBody(node); + case 218 /* ForStatement */: + return visitForStatementInAsyncBody(node); + case 219 /* ForInStatement */: + return visitForInStatementInAsyncBody(node); + case 220 /* ForOfStatement */: + return visitForOfStatementInAsyncBody(node); + case 267 /* CatchClause */: + return visitCatchClauseInAsyncBody(node); + case 211 /* Block */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 224 /* WithStatement */: + case 226 /* LabeledStatement */: + return ts.visitEachChild(node, asyncBodyVisitor, context); + default: + return ts.Debug.assertNever(node, "Unhandled node."); + } + } + return visitor(node); + } + function visitCatchClauseInAsyncBody(node) { + var catchClauseNames = ts.createUnderscoreEscapedMap(); + recordDeclarationName(node.variableDeclaration, catchClauseNames); + // names declared in a catch variable are block scoped + var catchClauseUnshadowedNames; + catchClauseNames.forEach(function (_, escapedName) { + if (enclosingFunctionParameterNames.has(escapedName)) { + if (!catchClauseUnshadowedNames) { + catchClauseUnshadowedNames = ts.cloneMap(enclosingFunctionParameterNames); + } + catchClauseUnshadowedNames.delete(escapedName); + } + }); + if (catchClauseUnshadowedNames) { + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = catchClauseUnshadowedNames; + var result = ts.visitEachChild(node, asyncBodyVisitor, context); + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; + } + else { + return ts.visitEachChild(node, asyncBodyVisitor, context); + } + } + function visitVariableStatementInAsyncBody(node) { + if (isVariableDeclarationListWithCollidingName(node.declarationList)) { + var expression = visitVariableDeclarationListWithCollidingNames(node.declarationList, /*hasReceiver*/ false); + return expression ? ts.createStatement(expression) : undefined; + } + return ts.visitEachChild(node, visitor, context); + } + function visitForInStatementInAsyncBody(node) { + return ts.updateForIn(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForOfStatementInAsyncBody(node) { + return ts.updateForOf(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForStatementInAsyncBody(node) { + return ts.updateFor(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ false) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } /** * Visits an AwaitExpression node. * @@ -56989,22 +58222,96 @@ var ts; ? transformAsyncFunctionBody(node) : ts.visitFunctionBody(node.body, visitor, context)); } + function recordDeclarationName(_a, names) { + var name = _a.name; + if (ts.isIdentifier(name)) { + names.set(name.escapedText, true); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + recordDeclarationName(element, names); + } + } + } + } + function isVariableDeclarationListWithCollidingName(node) { + return node + && ts.isVariableDeclarationList(node) + && !(node.flags & 3 /* BlockScoped */) + && ts.forEach(node.declarations, collidesWithParameterName); + } + function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { + hoistVariableDeclarationList(node); + var variables = ts.getInitializedVariables(node); + if (variables.length === 0) { + if (hasReceiver) { + return ts.visitNode(ts.convertToAssignmentElementTarget(node.declarations[0].name), visitor, ts.isExpression); + } + return undefined; + } + return ts.inlineExpressions(ts.map(variables, transformInitializedVariable)); + } + function hoistVariableDeclarationList(node) { + ts.forEach(node.declarations, hoistVariable); + } + function hoistVariable(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + hoistVariableDeclaration(name); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + hoistVariable(element); + } + } + } + } + function transformInitializedVariable(node) { + var converted = ts.setSourceMapRange(ts.createAssignment(ts.convertToAssignmentElementTarget(node.name), node.initializer), node); + return ts.visitNode(converted, visitor, ts.isExpression); + } + function collidesWithParameterName(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + return enclosingFunctionParameterNames.has(name.escapedText); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element) && collidesWithParameterName(element)) { + return true; + } + } + } + return false; + } function transformAsyncFunctionBody(node) { resumeLexicalEnvironment(); var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 188 /* ArrowFunction */; + var isArrowFunction = node.kind === 191 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current // `this` and `arguments` objects to `__awaiter`. The generator function // passed to `__awaiter` is executed inside of the callback to the // promise constructor. + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap(); + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + recordDeclarationName(parameter, enclosingFunctionParameterNames); + } + var result; if (!isArrowFunction) { var statements = []; var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset)))); ts.addRange(statements, endLexicalEnvironment()); var block = ts.createBlock(statements, /*multiLine*/ true); ts.setTextRange(block, node.body); @@ -57020,27 +58327,28 @@ var ts; ts.addEmitHelper(block, ts.asyncSuperHelper); } } - return block; + result = block; } else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body)); var declarations = endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + result = ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + else { + result = expression; } - return expression; } + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; } - function transformFunctionBodyWorker(body, start) { + function transformAsyncFunctionBodyWorker(body, start) { if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + return ts.updateBlock(body, ts.visitNodes(body.statements, asyncBodyVisitor, ts.isStatement, start)); } else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + return ts.convertToFunctionBody(ts.visitNode(body, asyncBodyVisitor, ts.isConciseBody)); } } function getPromiseConstructor(type) { @@ -57059,15 +58367,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -57107,11 +58415,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -57143,11 +58451,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -57245,45 +58553,45 @@ var ts; return node; } switch (node.kind) { - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitVoidExpression(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructorDeclaration(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -57304,21 +58612,21 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitLabeledStatement(node) { - if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 217 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 220 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } - return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); } return ts.visitEachChild(node, visitor, context); } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 267 /* SpreadAssignment */) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 270 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -57327,16 +58635,9 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === 265 /* PropertyAssignment */) { - var p = e; - chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); - } - else { - chunkObject.push(ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); - } + chunkObject = ts.append(chunkObject, e.kind === 268 /* PropertyAssignment */ + ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) + : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } } if (chunkObject) { @@ -57352,7 +58653,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 179 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 182 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -57660,15 +58961,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -57708,11 +59009,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -57744,11 +59045,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -57818,7 +59119,7 @@ var ts; var asyncValues = { name: "typescript:asyncValues", scoped: false, - text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + text: "\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " }; function createAsyncValuesHelper(context, expression, location) { context.requestEmitHelper(asyncValues); @@ -57860,13 +59161,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -57876,13 +59177,13 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -57956,7 +59257,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 260 /* JsxExpression */) { + else if (node.kind === 263 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -58050,7 +59351,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 250 /* JsxElement */) { + if (node.kind === 253 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -58358,7 +59659,7 @@ var ts; return node; } switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -58594,13 +59895,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ - && node.kind === 220 /* ReturnStatement */ + && node.kind === 223 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 208 /* Block */))) + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 211 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -58628,63 +59929,63 @@ var ts; switch (node.kind) { case 115 /* StaticKeyword */: return undefined; // elide static keyword - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return visitClassExpression(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); case 71 /* Identifier */: return visitIdentifier(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 13 /* NoSubstitutionTemplateLiteral */: case 14 /* TemplateHead */: @@ -58695,28 +59996,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitSpreadElement(node); case 97 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 99 /* ThisKeyword */: return visitThisKeyword(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitMetaProperty(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -58803,13 +60104,13 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 219 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 222 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -58820,7 +60121,7 @@ var ts; } } else { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { labelMarker = "break-" + node.label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(node.label), labelMarker); } @@ -59001,7 +60302,7 @@ var ts; */ function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getInternalName(node))), /*location*/ extendsClauseElement)); } } @@ -59120,17 +60421,17 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 220 /* ReturnStatement */) { + if (statement.kind === 223 /* ReturnStatement */) { return true; } - else if (statement.kind === 212 /* IfStatement */) { + else if (statement.kind === 215 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 208 /* Block */) { + else if (statement.kind === 211 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -59188,7 +60489,7 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + if (firstStatement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } @@ -59198,8 +60499,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 195 /* BinaryExpression */ - || superCallExpression.left.kind !== 182 /* CallExpression */) { + if (superCallExpression.kind !== 198 /* BinaryExpression */ + || superCallExpression.left.kind !== 185 /* CallExpression */) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } // Shift comments from the original super call to the return statement. @@ -59396,7 +60697,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 188 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 191 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -59416,22 +60717,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return statements; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 93 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -59463,20 +60764,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -59668,7 +60969,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 229 /* FunctionDeclaration */ || node.kind === 187 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 232 /* FunctionDeclaration */ || node.kind === 190 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); @@ -59716,7 +61017,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 188 /* ArrowFunction */); + ts.Debug.assert(node.kind === 191 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -59783,9 +61084,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -59804,9 +61105,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -60008,14 +61309,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -60185,7 +61486,7 @@ var ts; ])); } /** - * Visits an ObjectLiteralExpression with computed propety names. + * Visits an ObjectLiteralExpression with computed property names. * * @param node An ObjectLiteralExpression node. */ @@ -60203,7 +61504,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 145 /* ComputedPropertyName */) { + if (property.name.kind === 146 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -60275,11 +61576,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 231 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -60559,20 +61860,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -60682,7 +61983,7 @@ var ts; if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */) { var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -60860,49 +62161,54 @@ var ts; function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { // We are here either because SuperKeyword was used somewhere in the expression, or // because we contain a SpreadElementExpression. - var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - if (node.expression.kind === 97 /* SuperKeyword */) { - ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); + if (node.transformFlags & 524288 /* ContainsSpread */ || + node.expression.kind === 97 /* SuperKeyword */ || + ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) { + var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + if (node.expression.kind === 97 /* SuperKeyword */) { + ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); + } + var resultingCall = void 0; + if (node.transformFlags & 524288 /* ContainsSpread */) { + // [source] + // f(...a, b) + // x.m(...a, b) + // super(...a, b) + // super.m(...a, b) // in static + // super.m(...a, b) // in instance + // + // [output] + // f.apply(void 0, a.concat([b])) + // (_a = x).m.apply(_a, a.concat([b])) + // _super.apply(this, a.concat([b])) + // _super.m.apply(this, a.concat([b])) + // _super.prototype.m.apply(this, a.concat([b])) + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); + } + else { + // [source] + // super(a) + // super.m(a) // in static + // super.m(a) // in instance + // + // [output] + // _super.call(this, a) + // _super.m.call(this, a) + // _super.prototype.m.call(this, a) + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), + /*location*/ node); + } + if (node.expression.kind === 97 /* SuperKeyword */) { + var actualThis = ts.createThis(); + ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); + var initializer = ts.createLogicalOr(resultingCall, actualThis); + resultingCall = assignToCapturedThis + ? ts.createAssignment(ts.createIdentifier("_this"), initializer) + : initializer; + } + return ts.setOriginalNode(resultingCall, node); } - var resultingCall; - if (node.transformFlags & 524288 /* ContainsSpread */) { - // [source] - // f(...a, b) - // x.m(...a, b) - // super(...a, b) - // super.m(...a, b) // in static - // super.m(...a, b) // in instance - // - // [output] - // f.apply(void 0, a.concat([b])) - // (_a = x).m.apply(_a, a.concat([b])) - // _super.apply(this, a.concat([b])) - // _super.m.apply(this, a.concat([b])) - // _super.prototype.m.apply(this, a.concat([b])) - resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); - } - else { - // [source] - // super(a) - // super.m(a) // in static - // super.m(a) // in instance - // - // [output] - // _super.call(this, a) - // _super.m.call(this, a) - // _super.prototype.m.call(this, a) - resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), - /*location*/ node); - } - if (node.expression.kind === 97 /* SuperKeyword */) { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); - var initializer = ts.createLogicalOr(resultingCall, actualThis); - resultingCall = assignToCapturedThis - ? ts.createAssignment(ts.createIdentifier("_this"), initializer) - : initializer; - } - return ts.setOriginalNode(resultingCall, node); + return ts.visitEachChild(node, visitor, context); } /** * Visits a NewExpression that contains a spread element. @@ -60957,7 +62263,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 178 /* ArrayLiteralExpression */ + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 181 /* ArrayLiteralExpression */ ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -61220,13 +62526,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(99 /* ThisKeyword */); - context.enableEmitNotification(153 /* Constructor */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(188 /* ArrowFunction */); - context.enableEmitNotification(187 /* FunctionExpression */); - context.enableEmitNotification(229 /* FunctionDeclaration */); + context.enableEmitNotification(154 /* Constructor */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(191 /* ArrowFunction */); + context.enableEmitNotification(190 /* FunctionExpression */); + context.enableEmitNotification(232 /* FunctionDeclaration */); } } /** @@ -61268,10 +62574,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 230 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -61353,11 +62659,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 211 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 214 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 182 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 185 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -61365,7 +62671,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 199 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 202 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -61420,15 +62726,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(252 /* JsxOpeningElement */); - context.enableEmitNotification(253 /* JsxClosingElement */); - context.enableEmitNotification(251 /* JsxSelfClosingElement */); + context.enableEmitNotification(255 /* JsxOpeningElement */); + context.enableEmitNotification(256 /* JsxClosingElement */); + context.enableEmitNotification(254 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(265 /* PropertyAssignment */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(268 /* PropertyAssignment */); return transformSourceFile; /** * Transforms an ES5 source file to ES3. @@ -61447,9 +62753,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -61782,13 +63088,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -61801,24 +63107,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return visitBreakStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return visitContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -61839,21 +63145,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitConditionalExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -61866,9 +63172,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -62096,7 +63402,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -62108,7 +63414,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -62484,35 +63790,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 208 /* Block */: + case 211 /* Block */: return transformAndEmitBlock(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return transformAndEmitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return transformAndEmitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return transformAndEmitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return transformAndEmitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -62942,7 +64248,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 262 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 265 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -62955,13 +64261,12 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 261 /* CaseClause */) { - var caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (clause.kind === 264 /* CaseClause */) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } - pendingClauses.push(ts.createCaseClause(ts.visitNode(caseClause.expression, visitor, ts.isExpression), [ - createInlineBreak(clauseLabels[i], /*location*/ caseClause.expression) + pendingClauses.push(ts.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [ + createInlineBreak(clauseLabels[i], /*location*/ clause.expression) ])); } else { @@ -64101,8 +65406,8 @@ var ts; // `throw` methods that step through the generator when invoked. // // parameters: - // thisArg The value to use as the `this` binding for the transformed generator body. - // body A function that acts as the transformed generator body. + // @param thisArg The value to use as the `this` binding for the transformed generator body. + // @param body A function that acts as the transformed generator body. // // variables: // _ Persistent state for the generator that is shared between the helper and the @@ -64186,11 +65491,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -64282,7 +65587,7 @@ var ts; // Create an updated SourceFile: // // define(moduleName?, ["module1", "module2"], function ... - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(define, /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ // Add the dependency array argument: @@ -64307,6 +65612,8 @@ var ts; ]))) ]), /*location*/ node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } /** * Transforms a SourceFile into a UMD module. @@ -64357,7 +65664,7 @@ var ts; // define(["require", "exports"], factory); // } // })(function ...) - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(umdHeader, /*typeArguments*/ undefined, [ // Add the module body function argument: @@ -64375,6 +65682,8 @@ var ts; ])) ]), /*location*/ node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } /** * Collect the additional asynchronous dependencies for the module. @@ -64426,6 +65735,17 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } + function getAMDImportExpressionForImport(node) { + if (ts.isImportEqualsDeclaration(node) || ts.isExportDeclaration(node) || !ts.getExternalModuleNameLiteral(node, currentSourceFile, host, resolver, compilerOptions)) { + return undefined; + } + var name = ts.getLocalNameForExternalImport(node, currentSourceFile); + var expr = getHelperExpressionForImport(node, name); + if (expr === name) { + return undefined; + } + return ts.createStatement(ts.createAssignment(name, expr)); + } /** * Transforms a SourceFile into an AMD or UMD module body. * @@ -64440,6 +65760,9 @@ var ts; } // Visit each statement of the module body. ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + if (moduleKind === ts.ModuleKind.AMD) { + ts.addRange(statements, ts.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); + } ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); // Append the 'export =' statement if provided. addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); @@ -64494,23 +65817,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, importCallExpressionVisitor, context); @@ -64611,7 +65934,12 @@ var ts; ts.setEmitFlags(func, 8 /* CapturesThis */); } } - return ts.createNew(ts.createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); + var promise = ts.createNew(ts.createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.createPropertyAccess(promise, ts.createIdentifier("then")), /*typeArguments*/ undefined, [ts.getHelperName("__importStar")]); + } + return promise; } function createImportCallExpressionCommonJS(arg, containsLexicalThis) { // import("./blah") @@ -64621,6 +65949,10 @@ var ts; // if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately var promiseResolveCall = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []); var requireCall = ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, arg ? [arg] : []); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + requireCall = ts.createCall(ts.getHelperName("__importStar"), /*typeArguments*/ undefined, [requireCall]); + } var func; if (languageVersion >= 2 /* ES2015 */) { func = ts.createArrowFunction( @@ -64647,6 +65979,20 @@ var ts; } return ts.createCall(ts.createPropertyAccess(promiseResolveCall, "then"), /*typeArguments*/ undefined, [func]); } + function getHelperExpressionForImport(node, innerExpr) { + if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) { + return innerExpr; + } + if (ts.getImportNeedsImportStarHelper(node)) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.getHelperName("__importStar"), /*typeArguments*/ undefined, [innerExpr]); + } + if (ts.getImportNeedsImportDefaultHelper(node)) { + context.requestEmitHelper(importDefaultHelper); + return ts.createCall(ts.getHelperName("__importDefault"), /*typeArguments*/ undefined, [innerExpr]); + } + return innerExpr; + } /** * Visits an ImportDeclaration node. * @@ -64665,7 +66011,7 @@ var ts; if (namespaceDeclaration && !ts.isDefaultImport(node)) { // import * as n from "mod"; variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, createRequireCall(node))); + /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node)))); } else { // import d from "mod"; @@ -64673,7 +66019,7 @@ var ts; // import d, { x, y } from "mod"; // import d, * as n from "mod"; variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), - /*type*/ undefined, createRequireCall(node))); + /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node)))); if (namespaceDeclaration && ts.isDefaultImport(node)) { variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), /*type*/ undefined, ts.getGeneratedNameForNode(node))); @@ -64936,7 +66282,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -64991,10 +66337,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -65193,7 +66539,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -65257,10 +66603,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -65281,7 +66627,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -65356,7 +66702,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 /* PlusPlusToken */ ? 59 /* PlusEqualsToken */ : 60 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -65406,6 +66752,18 @@ var ts; scoped: true, text: "\n var __syncRequire = typeof module === \"object\" && typeof module.exports === \"object\";" }; + // emit helper for `import * as Name from "foo"` + var importStarHelper = { + name: "typescript:commonjsimportstar", + scoped: false, + text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n}" + }; + // emit helper for `import Name from "foo"` + var importDefaultHelper = { + name: "typescript:commonjsimportdefault", + scoped: false, + text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n}" + }; })(ts || (ts = {})); /// /// @@ -65423,10 +66781,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -65647,7 +67006,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 245 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 248 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -65672,15 +67031,14 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 245 /* ExportDeclaration */) { + if (externalImport.kind !== 248 /* ExportDeclaration */) { continue; } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { // export * from ... continue; } - for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { + for (var _f = 0, _g = externalImport.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; // write name of indirectly exported entry, i.e. 'export {x} from ...' exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(ts.idText(element.name || element.propertyName)), ts.createTrue())); @@ -65742,28 +67100,28 @@ var ts; function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { - var group = dependencyGroups_1[_i]; + var group_1 = dependencyGroups_1[_i]; // derive a unique name for parameter from the first named entry in the group - var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); + var localName = ts.forEach(group_1.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName(""); var statements = []; - for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) { + for (var _a = 0, _b = group_1.externalImports; _a < _b.length; _a++) { var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -65813,15 +67171,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -65997,7 +67355,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 269 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 272 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -66061,7 +67419,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -66117,10 +67475,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -66300,43 +67658,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitDefaultClause(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitTryStatement(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -66522,7 +67880,7 @@ var ts; */ function destructuringAndImportCallVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 195 /* BinaryExpression */) { + && node.kind === 198 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (ts.isImportCall(node)) { @@ -66587,7 +67945,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 269 /* SourceFile */; + return container !== undefined && container.kind === 272 /* SourceFile */; } else { return false; @@ -66620,7 +67978,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -66656,6 +68014,43 @@ var ts; if (hint === 1 /* Expression */) { return substituteExpression(node); } + else if (hint === 4 /* Unspecified */) { + return substituteUnspecified(node); + } + return node; + } + /** + * Substitute the node, if necessary. + * + * @param node The node to substitute. + */ + function substituteUnspecified(node) { + switch (node.kind) { + case 269 /* ShorthandPropertyAssignment */: + return substituteShorthandPropertyAssignment(node); + } + return node; + } + /** + * Substitution for a ShorthandPropertyAssignment whose name that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + if (!ts.isGeneratedIdentifier(name) && !ts.isLocalName(name)) { + var importDeclaration = resolver.getReferencedImportDeclaration(name); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"))), + /*location*/ node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name))), + /*location*/ node); + } + } + } return node; } /** @@ -66667,10 +68062,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -66763,14 +68158,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 194 /* PostfixUnaryExpression */) { + if (node.kind === 197 /* PostfixUnaryExpression */) { expression = node.operator === 43 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -66792,7 +68187,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -66833,7 +68228,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(269 /* SourceFile */); + context.enableEmitNotification(272 /* SourceFile */); context.enableSubstitution(71 /* Identifier */); var currentSourceFile; return transformSourceFile; @@ -66846,9 +68241,11 @@ var ts; if (externalHelpersModuleName) { var statements = []; var statementOffset = ts.addPrologue(statements, node.statements); - ts.append(statements, ts.createImportDeclaration( + var tslibImport = ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); + ts.addEmitFlags(tslibImport, 67108864 /* NeverApplyImportHelper */); + ts.append(statements, tslibImport); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } @@ -66860,10 +68257,10 @@ var ts; } function visitor(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); } return node; @@ -67003,7 +68400,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(296 /* Count */); + var enabledSyntaxKindFeatures = new Array(299 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -67343,7 +68740,7 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (sourceFileOrBundle.kind === 269 /* SourceFile */) { + if (sourceFileOrBundle.kind === 272 /* SourceFile */) { // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); @@ -67488,7 +68885,7 @@ var ts; source = undefined; if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(skipSourceTrivia(pos)); @@ -67505,7 +68902,7 @@ var ts; } if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -67522,9 +68919,9 @@ var ts; * @param tokenStartPos The start pos of the token. * @param emitCallback The callback used to emit the token. */ - function emitTokenWithSourceMap(node, token, tokenPos, emitCallback) { + function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) { if (disabled) { - return emitCallback(token, tokenPos); + return emitCallback(token, writer, tokenPos); } var emitNode = node && node.emitNode; var emitFlags = emitNode && emitNode.flags; @@ -67533,7 +68930,7 @@ var ts; if ((emitFlags & 128 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) { emitPos(tokenPos); } - tokenPos = emitCallback(token, tokenPos); + tokenPos = emitCallback(token, writer, tokenPos); if (range) tokenPos = range.end; if ((emitFlags & 256 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) { @@ -67558,7 +68955,7 @@ var ts; var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, /*isAbsolutePathAnUrl*/ true); - sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source); if (sourceMapSourceIndex === -1) { sourceMapSourceIndex = sourceMapData.sourceMapSources.length; sourceMapData.sourceMapSources.push(source); @@ -67682,7 +69079,7 @@ var ts; if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 291 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 294 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 10 /* JsxText */; @@ -67703,7 +69100,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -68007,8 +69404,8 @@ var ts; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -68082,7 +69479,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 239 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 242 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -68099,8 +69496,8 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } - if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { - // if file was external module with augmentations - this fact should be preserved in .d.ts as well. + if (!isBundledEmit && ts.isExternalModule(sourceFile) && !resultHasExternalModuleIndicator) { + // if file was external module this fact should be preserved in .d.ts as well. // in case if we didn't write any external module specifiers in .d.ts we need to emit something // that will force compiler to think that this file is an external module - 'export {}' is a reasonable choice here. write("export {};"); @@ -68159,10 +69556,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 227 /* VariableDeclaration */) { + if (declaration.kind === 230 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 242 /* NamedImports */ || declaration.kind === 243 /* ImportSpecifier */ || declaration.kind === 240 /* ImportClause */) { + else if (declaration.kind === 245 /* NamedImports */ || declaration.kind === 246 /* ImportSpecifier */ || declaration.kind === 243 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -68180,7 +69577,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 239 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 242 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -68190,12 +69587,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -68269,7 +69666,7 @@ var ts; // for optional parameter properties // and also for non-optional initialized parameters that aren't a parameter property // these types may need to add `undefined`. - var shouldUseResolverType = declaration.kind === 147 /* Parameter */ && + var shouldUseResolverType = declaration.kind === 148 /* Parameter */ && (resolver.isRequiredInitializedParameter(declaration) || resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { @@ -68278,9 +69675,9 @@ var ts; } else { errorNameNode = declaration.name; - var format = 4 /* UseTypeOfFunction */ | - 16384 /* WriteClassExpressionAsTypeLiteral */ | - (shouldUseResolverType ? 8192 /* AddUndefined */ : 0); + var format = 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | + 2048 /* WriteClassExpressionAsTypeLiteral */ | + (shouldUseResolverType ? 131072 /* AddUndefined */ : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } @@ -68294,7 +69691,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 2048 /* WriteClassExpressionAsTypeLiteral */, writer); errorNameNode = undefined; } } @@ -68335,50 +69732,54 @@ var ts; function emitType(type) { switch (type.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 134 /* ObjectKeyword */: - case 137 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 170 /* ThisType */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 173 /* ThisType */: + case 177 /* LiteralType */: return writeTextOfNode(currentText, type); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(type); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(type); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(type); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(type); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(type); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(type); + case 171 /* InferType */: + return emitInferType(type); + case 172 /* ParenthesizedType */: return emitParenType(type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(type); case 71 /* Identifier */: return emitEntityName(type); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitEntityName(type); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -68386,8 +69787,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 144 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 144 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 145 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 145 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -68396,14 +69797,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 238 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 241 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -68444,6 +69845,22 @@ var ts; function emitIntersectionType(type) { emitSeparatedList(type.types, " & ", emitType); } + function emitConditionalType(node) { + emitType(node.checkType); + write(" extends "); + emitType(node.extendsType); + write(" ? "); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node.trueType; + emitType(node.trueType); + enclosingDeclaration = prevEnclosingDeclaration; + write(" : "); + emitType(node.falseType); + } + function emitInferType(node) { + write("infer "); + writeTextOfNode(currentText, node.typeParameter.name); + } function emitParenType(type) { write("("); emitType(type.type); @@ -68467,7 +69884,9 @@ var ts; writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === 37 /* PlusToken */ ? "+readonly " : + node.readonlyToken.kind === 38 /* MinusToken */ ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -68475,7 +69894,9 @@ var ts; emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === 37 /* PlusToken */ ? "+?" : + node.questionToken.kind === 38 /* MinusToken */ ? "-?" : + "?"); } write(": "); emitType(node.type); @@ -68532,12 +69953,15 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 2048 /* WriteClassExpressionAsTypeLiteral */, writer); write(";"); writeLine(); return tempVarName; } function emitExportAssignment(node) { + if (ts.isSourceFile(node.parent)) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators + } if (node.expression.kind === 71 /* Identifier */) { write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentText, node.expression); @@ -68566,10 +69990,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 238 /* ImportEqualsDeclaration */ || - (node.parent.kind === 269 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 241 /* ImportEqualsDeclaration */ || + (node.parent.kind === 272 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 269 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 272 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -68579,7 +70003,7 @@ var ts; }); } else { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -68597,23 +70021,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return writeVariableStatement(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return writeClassDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -68621,16 +70045,17 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 272 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators write("export "); } if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 231 /* InterfaceDeclaration */ && needsDeclare) { + else if (node.kind !== 234 /* InterfaceDeclaration */ && needsDeclare) { write("declare "); } } @@ -68682,11 +70107,11 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); + return namedBindings.elements.some(function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } } } @@ -68706,7 +70131,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 244 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -68727,19 +70152,9 @@ var ts; // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 234 /* ModuleDeclaration */; - var moduleSpecifier; - if (parent.kind === 238 /* ImportEqualsDeclaration */) { - var node = parent; - moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === 234 /* ModuleDeclaration */) { - moduleSpecifier = parent.name; - } - else { - var node = parent; - moduleSpecifier = node.moduleSpecifier; - } + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 237 /* ModuleDeclaration */; + var moduleSpecifier = parent.kind === 241 /* ImportEqualsDeclaration */ ? ts.getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === 237 /* ModuleDeclaration */ ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === 9 /* StringLiteral */ && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -68766,6 +70181,7 @@ var ts; writeAsynchronousModuleElements(nodes); } function emitExportDeclaration(node) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators emitJsDocComments(node); write("export "); if (node.exportClause) { @@ -68803,7 +70219,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 235 /* ModuleBlock */) { + while (node.body && node.body.kind !== 238 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -68873,7 +70289,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 152 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 153 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -68884,15 +70300,15 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.constraint); } else { @@ -68901,15 +70317,15 @@ var ts; } if (node.default && !isPrivateMethodTypeParameter(node)) { write(" = "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.default); } else { @@ -68920,34 +70336,34 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -68981,7 +70397,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + if (node.parent.parent.kind === 233 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -69020,7 +70436,7 @@ var ts; diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: baseTypeNode, typeName: node.name - }, !ts.findAncestor(node, function (n) { return n.kind === 234 /* ModuleDeclaration */; })); + }, !ts.findAncestor(node, function (n) { return n.kind === 237 /* ModuleDeclaration */; })); } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -69095,7 +70511,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 227 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { + if (node.kind !== 230 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -69103,11 +70519,11 @@ var ts; writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */) && node.parent.kind === 164 /* TypeLiteral */) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */) && node.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -69120,15 +70536,15 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -69137,7 +70553,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */ || node.kind === 147 /* Parameter */) { + else if (node.parent.kind === 233 /* ClassDeclaration */ || node.kind === 148 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69169,7 +70585,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 201 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { + if (element.kind !== 204 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { elements.push(element); } } @@ -69199,7 +70615,7 @@ var ts; // if this is property of type literal, // or is parameter of method/call/construct/index signature of type literal // emit only if type is specified - if (node.type) { + if (ts.hasType(node)) { write(": "); emitType(node.type); } @@ -69243,7 +70659,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 154 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 155 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -69256,7 +70672,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 154 /* GetAccessor */ + return accessor.kind === 155 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -69279,7 +70695,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69294,7 +70710,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 155 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 156 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(accessorWithTypeAnnotation, 32 /* Static */)) { @@ -69339,17 +70755,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 152 /* MethodDeclaration */ || node.kind === 153 /* Constructor */) { + else if (node.kind === 153 /* MethodDeclaration */ || node.kind === 154 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 153 /* Constructor */) { + else if (node.kind === 154 /* Constructor */) { write("constructor"); } else { @@ -69376,7 +70792,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69420,22 +70836,22 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 153 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { + if (node.kind === 154 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { write("();"); writeLine(); return; } // Construct signature or constructor type write new Signature - if (node.kind === 157 /* ConstructSignature */ || node.kind === 162 /* ConstructorType */) { + if (node.kind === 158 /* ConstructSignature */ || node.kind === 163 /* ConstructorType */) { write("new "); } - else if (node.kind === 161 /* FunctionType */) { + else if (node.kind === 162 /* FunctionType */) { var currentOutput = writer.getText(); // Do not generate incorrect type when function type with type parameters is type argument // This could happen if user used space between two '<' making it error free @@ -69450,22 +70866,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 161 /* FunctionType */ || node.kind === 162 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 164 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 162 /* FunctionType */ || node.kind === 163 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 165 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 153 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 154 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -69479,26 +70895,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -69506,7 +70922,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -69520,7 +70936,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -69555,9 +70971,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.parent.kind === 164 /* TypeLiteral */) { + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -69573,29 +70989,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -69603,7 +71019,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69616,7 +71032,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69628,12 +71044,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 178 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 179 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -69644,16 +71060,17 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 201 /* OmittedExpression */) { + if (bindingElement.kind === 204 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) // Example: // original: function foo([, x, ,]) {} + // tslint:disable-next-line no-double-space // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 177 /* BindingElement */) { + else if (bindingElement.kind === 180 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -69692,40 +71109,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return writeFunctionDeclaration(node); - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return emitPropertyDeclaration(node); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return emitSourceFile(node); } } @@ -69753,7 +71170,7 @@ var ts; return addedBundledEmitReference; function getDeclFileName(emitFileNames, sourceFileOrBundle) { // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -69767,8 +71184,8 @@ var ts; function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; - if (!emitSkipped) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + if (!emitSkipped || emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -69798,7 +71215,6 @@ var ts; /// var ts; (function (ts) { - var delimiters = createDelimiterMap(); var brackets = createBracketsMap(); /*@internal*/ /** @@ -69818,7 +71234,10 @@ var ts; var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" /* Dts */ : ""; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + if (result) { + return result; + } } } else { @@ -69827,7 +71246,10 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = !ts.isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + if (result) { + return result; + } } } } @@ -69853,7 +71275,7 @@ var ts; return ".js" /* Js */; } function getOriginalSourceFileOrBundle(sourceFileOrBundle) { - if (sourceFileOrBundle.kind === 270 /* Bundle */) { + if (sourceFileOrBundle.kind === 273 /* Bundle */) { return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, ts.getOriginalSourceFile)); } return ts.getOriginalSourceFile(sourceFileOrBundle); @@ -69906,7 +71328,7 @@ var ts; function emitSourceFileOrBundle(_a, sourceFileOrBundle) { var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; // Make sure not to write js file and source map file if any of them cannot be written - if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit && !compilerOptions.emitDeclarationOnly) { if (!emitOnlyDtsFiles) { printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } @@ -69930,8 +71352,8 @@ var ts; } } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { - var bundle = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 269 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 272 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); if (bundle) { @@ -69960,7 +71382,7 @@ var ts; ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); // Reset state sourceMap.reset(); - writer.reset(); + writer.clear(); currentSourceFile = undefined; bundledHelpers = undefined; isOwnFileEmit = false; @@ -69971,7 +71393,7 @@ var ts; } function emitHelpers(node, writeLines) { var helpersEmitted = false; - var bundle = node.kind === 270 /* Bundle */ ? node : undefined; + var bundle = node.kind === 273 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -70026,16 +71448,29 @@ var ts; var generatedNames; // Set of names generated by the NameGenerator. var tempFlagsStack; // Stack of enclosing name generation scopes. var tempFlags; // TempFlags for the current name generation scope. + var reservedNamesStack; // Stack of TempFlags reserved in enclosing name generation scopes. + var reservedNames; // TempFlags to reserve in nested name generation scopes. var writer; var ownWriter; + var write = writeBase; + var commitPendingSemicolon = ts.noop; + var writeSemicolon = writeSemicolonInternal; + var pendingSemicolon = false; + if (printerOptions.omitTrailingSemicolon) { + commitPendingSemicolon = commitPendingSemicolonInternal; + writeSemicolon = deferWriteSemicolon; + } + var syntheticParent = { pos: -1, end: -1 }; reset(); return { // public API printNode: printNode, + printList: printList, printFile: printFile, printBundle: printBundle, // internal API writeNode: writeNode, + writeList: writeList, writeFile: writeFile, writeBundle: writeBundle }; @@ -70052,12 +71487,16 @@ var ts; break; } switch (node.kind) { - case 269 /* SourceFile */: return printFile(node); - case 270 /* Bundle */: return printBundle(node); + case 272 /* SourceFile */: return printFile(node); + case 273 /* Bundle */: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); } + function printList(format, nodes, sourceFile) { + writeList(format, nodes, sourceFile, beginPrint()); + return endPrint(); + } function printBundle(bundle) { writeBundle(bundle, beginPrint()); return endPrint(); @@ -70073,6 +71512,16 @@ var ts; reset(); writer = previousWriter; } + function writeList(format, nodes, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList(syntheticParent, nodes, format); + reset(); + writer = previousWriter; + } function writeBundle(bundle, output) { var previousWriter = writer; setWriter(output); @@ -70100,7 +71549,7 @@ var ts; } function endPrint() { var text = ownWriter.getText(); - ownWriter.reset(); + ownWriter.clear(); return text; } function print(hint, node, sourceFile) { @@ -70126,6 +71575,7 @@ var ts; generatedNames = ts.createMap(); tempFlagsStack = []; tempFlags = 0 /* Auto */; + reservedNamesStack = []; comments.reset(); setWriter(/*output*/ undefined); } @@ -70189,7 +71639,9 @@ var ts; } function emitMappedTypeParameter(node) { emit(node.name); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emit(node.constraint); } function pipelineEmitUnspecified(node) { @@ -70198,7 +71650,7 @@ var ts; // Strict mode reserved words // Contextual keywords if (ts.isKeyword(kind)) { - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; } switch (kind) { @@ -70212,222 +71664,226 @@ var ts; return emitIdentifier(node); // Parse tree nodes // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitQualifiedName(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return emitTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return emitParameter(node); - case 148 /* Decorator */: + case 149 /* Decorator */: return emitDecorator(node); // Type members - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return emitPropertySignature(node); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return emitMethodSignature(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return emitConstructor(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return emitCallSignature(node); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return emitConstructSignature(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return emitIndexSignature(node); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(node); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return emitFunctionType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return emitConstructorType(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(node); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(node); + case 171 /* InferType */: + return emitInferType(node); + case 172 /* ParenthesizedType */: return emitParenthesizedType(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return emitThisType(); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return emitLiteralType(node); - case 272 /* JSDocAllType */: + case 275 /* JSDocAllType */: write("*"); return; - case 273 /* JSDocUnknownType */: + case 276 /* JSDocUnknownType */: write("?"); return; - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return emitJSDocVariadicType(node); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return emitBindingElement(node); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return emitTemplateSpan(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 208 /* Block */: + case 211 /* Block */: return emitBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitVariableStatement(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: return emitEmptyStatement(); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return emitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return emitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return emitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return emitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return emitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return emitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return emitForOfStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return emitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return emitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return emitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return emitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return emitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return emitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return emitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return emitTryStatement(node); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return emitClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return emitModuleBlock(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return emitCaseBlock(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return emitImportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return emitImportClause(node); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return emitNamespaceImport(node); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return emitNamedImports(node); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return emitImportSpecifier(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return emitNamedExports(node); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return emitExportSpecifier(node); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 252 /* JsxOpeningElement */: - case 255 /* JsxOpeningFragment */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 253 /* JsxClosingElement */: - case 256 /* JsxClosingFragment */: + case 256 /* JsxClosingElement */: + case 259 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return emitJsxAttribute(node); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return emitJsxAttributes(node); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return emitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return emitDefaultClause(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return emitHeritageClause(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMember(node); } // If the node is an expression, try to emit it as an expression with @@ -70436,7 +71892,7 @@ var ts; return pipelineEmitExpression(trySubstituteNode(1 /* Expression */, node)); } if (ts.isToken(node)) { - writeTokenNode(node); + writeTokenNode(node, writePunctuation); return; } } @@ -70460,74 +71916,74 @@ var ts; case 101 /* TrueKeyword */: case 99 /* ThisKeyword */: case 91 /* ImportKeyword */: - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; // Expressions - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return emitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return emitNewExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return emitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return emitArrowFunction(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return emitDeleteExpression(node); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return emitVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return emitAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return emitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return emitConditionalExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return emitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return emitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return emitSpreadExpression(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return emitClassExpression(node); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: return emitAsExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return emitNonNullExpression(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return emitJsxElement(node); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return emitCommaList(node); } } @@ -70556,25 +72012,27 @@ var ts; var text = getLiteralTextOfNode(node); if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { - writer.writeLiteral(text); + writeLiteral(text); } else { - write(text); + // Quick info expects all literals to be called with writeStringLiteral, as there's no specific type for numberLiterals + writeStringLiteral(text); } } // // Identifiers // function emitIdentifier(node) { - write(getTextOfNode(node, /*includeTrivia*/ false)); - emitTypeArguments(node, node.typeArguments); + var writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode(node, /*includeTrivia*/ false), node.symbol); + emitList(node, node.typeArguments, 26896 /* TypeParameters */); // Call emitList directly since it could be an array of TypeParameterDeclarations _or_ type arguments } // // Names // function emitQualifiedName(node) { emitEntityName(node.left); - write("."); + writePunctuation("."); emit(node.right); } function emitEntityName(node) { @@ -70586,36 +72044,46 @@ var ts; } } function emitComputedPropertyName(node) { - write("["); + writePunctuation("["); emitExpression(node.expression); - write("]"); + writePunctuation("]"); } // // Signature elements // function emitTypeParameter(node) { emit(node.name); - emitWithPrefix(" extends ", node.constraint); - emitWithPrefix(" = ", node.default); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit(node.default); + } } function emitParameter(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitIfPresent(node.dotDotDotToken); if (node.name) { - emit(node.name); + emitNodeWithWriter(node.name, writeParameter); } emitIfPresent(node.questionToken); - if (node.parent && node.parent.kind === 277 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 280 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitDecorator(decorator) { - write("@"); + writePunctuation("@"); emitExpression(decorator.expression); } // @@ -70624,19 +72092,19 @@ var ts; function emitPropertySignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - emit(node.name); + emitNodeWithWriter(node.name, writeProperty); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitPropertyDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); - write(";"); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); + writeSemicolon(); } function emitMethodSignature(node) { emitDecorators(node, node.decorators); @@ -70645,8 +72113,8 @@ var ts; emitIfPresent(node.questionToken); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitMethodDeclaration(node) { emitDecorators(node, node.decorators); @@ -70658,13 +72126,14 @@ var ts; } function emitConstructor(node) { emitModifiers(node, node.modifiers); - write("constructor"); + writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 154 /* GetAccessor */ ? "get " : "set "); + writeKeyword(node.kind === 155 /* GetAccessor */ ? "get" : "set"); + writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -70673,34 +72142,37 @@ var ts; emitModifiers(node, node.modifiers); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitConstructSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitIndexSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitParametersForIndexSignature(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitSemicolonClassElement() { - write(";"); + writeSemicolon(); } // // Types // function emitTypePredicate(node) { emit(node.parameterName); - write(" is "); + writeSpace(); + writeKeyword("is"); + writeSpace(); emit(node.type); } function emitTypeReference(node) { @@ -70710,7 +72182,9 @@ var ts; function emitFunctionType(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitJSDocFunctionType(node) { @@ -70732,34 +72206,39 @@ var ts; write("="); } function emitConstructorType(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitTypeQuery(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emit(node.exprName); } function emitTypeLiteral(node) { - write("{"); + writePunctuation("{"); var flags = ts.getEmitFlags(node) & 1 /* SingleLine */ ? 448 /* SingleLineTypeLiteralMembers */ : 65 /* MultiLineTypeLiteralMembers */; emitList(node, node.members, flags | 262144 /* NoSpaceIfEmpty */); - write("}"); + writePunctuation("}"); } function emitArrayType(node) { emit(node.elementType); - write("[]"); + writePunctuation("["); + writePunctuation("]"); } function emitJSDocVariadicType(node) { write("..."); emit(node.type); } function emitTupleType(node) { - write("["); + writePunctuation("["); emitList(node, node.elementTypes, 336 /* TupleTypeElements */); - write("]"); + writePunctuation("]"); } function emitUnionType(node) { emitList(node, node.types, 260 /* UnionTypeConstituents */); @@ -70767,30 +72246,50 @@ var ts; function emitIntersectionType(node) { emitList(node, node.types, 264 /* IntersectionTypeConstituents */); } + function emitConditionalType(node) { + emit(node.checkType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } function emitParenthesizedType(node) { - write("("); + writePunctuation("("); emit(node.type); - write(")"); + writePunctuation(")"); } function emitThisType() { - write("this"); + writeKeyword("this"); } function emitTypeOperator(node) { - writeTokenText(node.operator); - write(" "); + writeTokenText(node.operator, writeKeyword); + writeSpace(); emit(node.type); } function emitIndexedAccessType(node) { emit(node.objectType); - write("["); + writePunctuation("["); emit(node.indexType); - write("]"); + writePunctuation("]"); } function emitMappedType(node) { var emitFlags = ts.getEmitFlags(node); - write("{"); + writePunctuation("{"); if (emitFlags & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); @@ -70798,23 +72297,32 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - write(" "); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + writeKeyword("readonly"); + } + writeSpace(); } - write("["); + writePunctuation("["); pipelineEmitWithNotification(3 /* MappedTypeParameter */, node.typeParameter); - write("]"); - emitIfPresent(node.questionToken); - write(": "); + writePunctuation("]"); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); if (emitFlags & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); decreaseIndent(); } - write("}"); + writePunctuation("}"); } function emitLiteralType(node) { emitExpression(node.literal); @@ -70823,32 +72331,24 @@ var ts; // Binding patterns // function emitObjectBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("{}"); - } - else { - write("{"); - emitList(node, elements, 432 /* ObjectBindingPatternElements */); - write("}"); - } + writePunctuation("{"); + emitList(node, node.elements, 262576 /* ObjectBindingPatternElements */); + writePunctuation("}"); } function emitArrayBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("[]"); - } - else { - write("["); - emitList(node, node.elements, 304 /* ArrayBindingPatternElements */); - write("]"); - } + writePunctuation("["); + emitList(node, node.elements, 262448 /* ArrayBindingPatternElements */); + writePunctuation("]"); } function emitBindingElement(node) { - emitWithSuffix(node.propertyName, ": "); emitIfPresent(node.dotDotDotToken); + if (node.propertyName) { + emit(node.propertyName); + writePunctuation(":"); + writeSpace(); + } emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } // // Expressions @@ -70885,7 +72385,7 @@ var ts; emitExpression(node.expression); increaseIndentIf(indentBeforeDot); var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - write(shouldEmitDotDot ? ".." : "."); + writePunctuation(shouldEmitDotDot ? ".." : "."); increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -70911,9 +72411,9 @@ var ts; } function emitElementAccessExpression(node) { emitExpression(node.expression); - write("["); + writePunctuation("["); emitExpression(node.argumentExpression); - write("]"); + writePunctuation("]"); } function emitCallExpression(node) { emitExpression(node.expression); @@ -70921,26 +72421,27 @@ var ts; emitExpressionList(node, node.arguments, 1296 /* CallExpressionArguments */); } function emitNewExpression(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); emitExpressionList(node, node.arguments, 9488 /* NewExpressionArguments */); } function emitTaggedTemplateExpression(node) { emitExpression(node.tag); - write(" "); + writeSpace(); emitExpression(node.template); } function emitTypeAssertionExpression(node) { - write("<"); + writePunctuation("<"); emit(node.type); - write(">"); + writePunctuation(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { - write("("); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } function emitFunctionExpression(node) { emitFunctionDeclarationOrExpression(node); @@ -70953,30 +72454,34 @@ var ts; function emitArrowFunctionHead(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - emitWithPrefix(": ", node.type); - write(" "); + emitTypeAnnotation(node.type); + writeSpace(); emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - write("delete "); + writeKeyword("delete"); + writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - write("void "); + writeKeyword("void"); + writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - write("await "); + writeKeyword("await"); + writeSpace(); emitExpression(node.expression); } function emitPrefixUnaryExpression(node) { - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); if (shouldEmitWhitespaceBeforeOperand(node)) { - write(" "); + writeSpace(); } emitExpression(node.operand); } @@ -70994,13 +72499,13 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 193 /* PrefixUnaryExpression */ + return operand.kind === 196 /* PrefixUnaryExpression */ && ((node.operator === 37 /* PlusToken */ && (operand.operator === 37 /* PlusToken */ || operand.operator === 43 /* PlusPlusToken */)) || (node.operator === 38 /* MinusToken */ && (operand.operator === 38 /* MinusToken */ || operand.operator === 44 /* MinusMinusToken */))); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand); - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); } function emitBinaryExpression(node) { var isCommaOperator = node.operatorToken.kind !== 26 /* CommaToken */; @@ -71009,7 +72514,7 @@ var ts; emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); emitLeadingCommentsOfPosition(node.operatorToken.pos); - writeTokenNode(node.operatorToken); + writeTokenNode(node.operatorToken, writeOperator); emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); @@ -71037,12 +72542,12 @@ var ts; emitList(node, node.templateSpans, 131072 /* TemplateExpressionSpans */); } function emitYieldExpression(node) { - write("yield"); + writeKeyword("yield"); emit(node.asteriskToken); - emitExpressionWithPrefix(" ", node.expression); + emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } function emitClassExpression(node) { @@ -71055,17 +72560,19 @@ var ts; function emitAsExpression(node) { emitExpression(node.expression); if (node.type) { - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.type); } } function emitNonNullExpression(node) { emitExpression(node.expression); - write("!"); + writeOperator("!"); } function emitMetaProperty(node) { - writeToken(node.keywordToken, node.pos); - write("."); + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); emit(node.name); } // @@ -71079,13 +72586,13 @@ var ts; // Statements // function emitBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos, /*contextNode*/ node); + writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node); emitBlockStatements(node, /*forceSingleLine*/ !node.multiLine && isEmptyBlock(node)); // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted increaseIndent(); emitLeadingCommentsOfPosition(node.statements.end); decreaseIndent(); - writeToken(18 /* CloseBraceToken */, node.statements.end, /*contextNode*/ node); + writeToken(18 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node); } function emitBlockStatements(node, forceSingleLine) { var format = forceSingleLine || ts.getEmitFlags(node) & 1 /* SingleLine */ ? 384 /* SingleLineBlockStatements */ : 65 /* MultiLineBlockStatements */; @@ -71094,27 +72601,27 @@ var ts; function emitVariableStatement(node) { emitModifiers(node, node.modifiers); emit(node.declarationList); - write(";"); + writeSemicolon(); } function emitEmptyStatement() { - write(";"); + writeSemicolon(); } function emitExpressionStatement(node) { emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitIfStatement(node) { - var openParenPos = writeToken(90 /* IfKeyword */, node.pos, node); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos, node); + var openParenPos = writeToken(90 /* IfKeyword */, node.pos, writeKeyword, node); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, node); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(82 /* ElseKeyword */, node.thenStatement.end, node); - if (node.elseStatement.kind === 212 /* IfStatement */) { - write(" "); + writeToken(82 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 215 /* IfStatement */) { + writeSpace(); emit(node.elseStatement); } else { @@ -71123,60 +72630,68 @@ var ts; } } function emitDoStatement(node) { - write("do"); + writeKeyword("do"); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { - write(" "); + writeSpace(); } else { writeLineOrSpace(node); } - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(");"); + writePunctuation(");"); } function emitWhileStatement(node) { - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos, /*contextNode*/ node); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); emitForBinding(node.initializer); - write(";"); - emitExpressionWithPrefix(" ", node.condition); - write(";"); - emitExpressionWithPrefix(" ", node.incrementor); - write(")"); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.condition); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.incrementor); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - emitWithSuffix(node.awaitModifier, " "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" of "); + writeSpace(); + writeKeyword("of"); + writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { emit(node); } else { @@ -71185,58 +72700,62 @@ var ts; } } function emitContinueStatement(node) { - writeToken(77 /* ContinueKeyword */, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(77 /* ContinueKeyword */, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } function emitBreakStatement(node) { - writeToken(72 /* BreakKeyword */, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(72 /* BreakKeyword */, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } - function emitTokenWithComment(token, pos, contextNode) { + function emitTokenWithComment(token, pos, writer, contextNode) { var node = contextNode && ts.getParseTreeNode(contextNode); if (node && node.kind === contextNode.kind) { pos = ts.skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, /*contextNode*/ contextNode); + pos = writeToken(token, pos, writer, /*contextNode*/ contextNode); if (node && node.kind === contextNode.kind) { emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); } return pos; } function emitReturnStatement(node) { - emitTokenWithComment(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + emitTokenWithComment(96 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitWithStatement(node) { - write("with ("); + writeKeyword("with"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); - write(" "); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node) { emit(node.label); - write(": "); + writePunctuation(":"); + writeSpace(); emit(node.statement); } function emitThrowStatement(node) { - write("throw"); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + writeKeyword("throw"); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitTryStatement(node) { - write("try "); + writeKeyword("try"); + writeSpace(); emit(node.tryBlock); if (node.catchClause) { writeLineOrSpace(node); @@ -71244,24 +72763,26 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - write("finally "); + writeKeyword("finally"); + writeSpace(); emit(node.finallyBlock); } } function emitDebuggerStatement(node) { - writeToken(78 /* DebuggerKeyword */, node.pos); - write(";"); + writeToken(78 /* DebuggerKeyword */, node.pos, writeKeyword); + writeSemicolon(); } // // Declarations // function emitVariableDeclaration(node) { emit(node.name); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); } function emitVariableDeclarationList(node) { - write(ts.isLet(node) ? "let " : ts.isConst(node) ? "const " : "var "); + writeKeyword(ts.isLet(node) ? "let" : ts.isConst(node) ? "const" : "var"); + writeSpace(); emitList(node, node.declarations, 272 /* VariableDeclarationList */); } function emitFunctionDeclaration(node) { @@ -71270,9 +72791,9 @@ var ts; function emitFunctionDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("function"); + writeKeyword("function"); emitIfPresent(node.asteriskToken); - write(" "); + writeSpace(); emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -71302,19 +72823,19 @@ var ts; } else { emitSignatureHead(node); - write(" "); + writeSpace(); emitExpression(body); } } else { emitSignatureHead(node); - write(";"); + writeSemicolon(); } } function emitSignatureHead(node) { emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } function shouldEmitBlockFunctionBodyOnSingleLine(body) { // We must emit a function body as a single-line body in the following case: @@ -71347,7 +72868,8 @@ var ts; return true; } function emitBlockFunctionBody(body) { - write(" {"); + writeSpace(); + writePunctuation("{"); increaseIndent(); var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine @@ -71359,7 +72881,7 @@ var ts; emitBlockFunctionBody(body); } decreaseIndent(); - writeToken(18 /* CloseBraceToken */, body.statements.end, body); + writeToken(18 /* CloseBraceToken */, body.statements.end, writePunctuation, body); } function emitBlockFunctionBodyOnSingleLine(body) { emitBlockFunctionBodyWorker(body, /*emitBlockFunctionBodyOnSingleLine*/ true); @@ -71384,17 +72906,21 @@ var ts; function emitClassDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("class"); - emitNodeWithPrefix(" ", node.name, emitIdentifierName); + writeKeyword("class"); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */; if (indentedFlag) { increaseIndent(); } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* ClassHeritageClauses */); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65 /* ClassMembers */); - write("}"); + writePunctuation("}"); if (indentedFlag) { decreaseIndent(); } @@ -71402,66 +72928,77 @@ var ts; function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("interface "); + writeKeyword("interface"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* HeritageClauses */); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65 /* InterfaceMembers */); - write("}"); + writePunctuation("}"); } function emitTypeAliasDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("type "); + writeKeyword("type"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); } function emitEnumDeclaration(node) { emitModifiers(node, node.modifiers); - write("enum "); + writeKeyword("enum"); + writeSpace(); emit(node.name); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 81 /* EnumMembers */); - write("}"); + writePunctuation("}"); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); if (~node.flags & 512 /* GlobalAugmentation */) { - write(node.flags & 16 /* Namespace */ ? "namespace " : "module "); + writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); + writeSpace(); } emit(node.name); var body = node.body; - while (body.kind === 234 /* ModuleDeclaration */) { - write("."); + while (body.kind === 237 /* ModuleDeclaration */) { + writePunctuation("."); emit(body.name); body = body.body; } - write(" "); + writeSpace(); emit(body); } function emitModuleBlock(node) { pushNameGenerationScope(node); - write("{"); + writePunctuation("{"); emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node)); - write("}"); + writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos); + writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation); emitList(node, node.clauses, 65 /* CaseBlockClauses */); - writeToken(18 /* CloseBraceToken */, node.clauses.end); + writeToken(18 /* CloseBraceToken */, node.clauses.end, writePunctuation); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); emit(node.name); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitModuleReference(node.moduleReference); - write(";"); + writeSemicolon(); } function emitModuleReference(node) { if (node.kind === 71 /* Identifier */) { @@ -71473,23 +73010,30 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); if (node.importClause) { emit(node.importClause); - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); } emitExpression(node.moduleSpecifier); - write(";"); + writeSemicolon(); } function emitImportClause(node) { emit(node.name); if (node.name && node.namedBindings) { - write(", "); + writePunctuation(","); + writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node) { - write("* as "); + writePunctuation("*"); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.name); } function emitNamedImports(node) { @@ -71499,28 +73043,44 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); + writeKeyword("export"); + writeSpace(); + if (node.isExportEquals) { + writeOperator("="); + } + else { + writeKeyword("default"); + } + writeSpace(); emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitExportDeclaration(node) { - write("export "); + writeKeyword("export"); + writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - write("*"); + writePunctuation("*"); } if (node.moduleSpecifier) { - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); emitExpression(node.moduleSpecifier); } - write(";"); + writeSemicolon(); } function emitNamespaceExportDeclaration(node) { - write("export as namespace "); + writeKeyword("export"); + writeSpace(); + writeKeyword("as"); + writeSpace(); + writeKeyword("namespace"); + writeSpace(); emit(node.name); - write(";"); + writeSemicolon(); } function emitNamedExports(node) { emitNamedImportsOrExports(node); @@ -71529,14 +73089,16 @@ var ts; emitImportOrExportSpecifier(node); } function emitNamedImportsOrExports(node) { - write("{"); + writePunctuation("{"); emitList(node, node.elements, 432 /* NamedImportsOrExportsElements */); - write("}"); + writePunctuation("}"); } function emitImportOrExportSpecifier(node) { if (node.propertyName) { emit(node.propertyName); - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); } emit(node.name); } @@ -71544,9 +73106,10 @@ var ts; // Module references // function emitExternalModuleReference(node) { - write("require("); + writeKeyword("require"); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } // // JSX @@ -71557,14 +73120,14 @@ var ts; emit(node.closingElement); } function emitJsxSelfClosingElement(node) { - write("<"); + writePunctuation("<"); emitJsxTagName(node.tagName); - write(" "); + writeSpace(); // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap if (node.attributes.properties && node.attributes.properties.length > 0) { emit(node.attributes); } - write("/>"); + writePunctuation("/>"); } function emitJsxFragment(node) { emit(node.openingFragment); @@ -71572,45 +73135,46 @@ var ts; emit(node.closingFragment); } function emitJsxOpeningElementOrFragment(node) { - write("<"); + writePunctuation("<"); if (ts.isJsxOpeningElement(node)) { emitJsxTagName(node.tagName); // We are checking here so we won't re-enter the emitting pipeline and emit extra sourcemap if (node.attributes.properties && node.attributes.properties.length > 0) { - write(" "); + writeSpace(); emit(node.attributes); } } - write(">"); + writePunctuation(">"); } function emitJsxText(node) { + commitPendingSemicolon(); writer.writeLiteral(getTextOfNode(node, /*includeTrivia*/ true)); } function emitJsxClosingElementOrFragment(node) { - write(""); + writePunctuation(">"); } function emitJsxAttributes(node) { emitList(node, node.properties, 131328 /* JsxElementAttributes */); } function emitJsxAttribute(node) { emit(node.name); - emitWithPrefix("=", node.initializer); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emit); } function emitJsxSpreadAttribute(node) { - write("{..."); + writePunctuation("{..."); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } function emitJsxExpression(node) { if (node.expression) { - write("{"); + writePunctuation("{"); emitIfPresent(node.dotDotDotToken); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } } function emitJsxTagName(node) { @@ -71625,13 +73189,15 @@ var ts; // Clauses // function emitCaseClause(node) { - write("case "); + writeKeyword("case"); + writeSpace(); emitExpression(node.expression); - write(":"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitDefaultClause(node) { - write("default:"); + writeKeyword("default"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitCaseOrDefaultClauseStatements(parentNode, statements) { @@ -71658,25 +73224,25 @@ var ts; } var format = 81985 /* CaseOrDefaultClauseStatements */; if (emitAsSingleStatement) { - write(" "); + writeSpace(); format &= ~(1 /* MultiLine */ | 64 /* Indented */); } emitList(parentNode, statements, format); } function emitHeritageClause(node) { - write(" "); - writeTokenText(node.token); - write(" "); + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - var openParenPos = writeToken(74 /* CatchKeyword */, node.pos); - write(" "); + var openParenPos = writeToken(74 /* CatchKeyword */, node.pos, writeKeyword); + writeSpace(); if (node.variableDeclaration) { - writeToken(19 /* OpenParenToken */, openParenPos); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emit(node.variableDeclaration); - writeToken(20 /* CloseParenToken */, node.variableDeclaration.end); - write(" "); + writeToken(20 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation); + writeSpace(); } emit(node.block); } @@ -71685,7 +73251,8 @@ var ts; // function emitPropertyAssignment(node) { emit(node.name); - write(": "); + writePunctuation(":"); + writeSpace(); // This is to ensure that we emit comment in the following case: // For example: // obj = { @@ -71703,13 +73270,15 @@ var ts; function emitShorthandPropertyAssignment(node) { emit(node.name); if (node.objectAssignmentInitializer) { - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitExpression(node.objectAssignmentInitializer); } } function emitSpreadAssignment(node) { if (node.expression) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } } @@ -71718,7 +73287,7 @@ var ts; // function emitEnumMember(node) { emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } // // Top-level nodes @@ -71816,33 +73385,60 @@ var ts; // // Helpers // + function emitNodeWithWriter(node, writer) { + var savedWrite = write; + write = writer; + emit(node); + write = savedWrite; + } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 131328 /* Modifiers */); - write(" "); + writeSpace(); } } - function emitWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emit); - } - function emitExpressionWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emitExpression); - } - function emitNodeWithPrefix(prefix, node, emit) { + function emitTypeAnnotation(node) { if (node) { - write(prefix); + writePunctuation(":"); + writeSpace(); emit(node); } } - function emitWithSuffix(node, suffix) { + function emitInitializer(node) { + if (node) { + writeSpace(); + writeOperator("="); + writeSpace(); + emitExpression(node); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit) { + if (node) { + prefixWriter(prefix); + emit(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit(node); + } + } + function emitExpressionWithLeadingSpace(node) { + if (node) { + writeSpace(); + emitExpression(node); + } + } + function emitWithTrailingSpace(node) { if (node) { emit(node); - write(suffix); + writeSpace(); } } function emitEmbeddedStatement(parent, node) { if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1 /* SingleLine */) { - write(" "); + writeSpace(); emit(node); } else { @@ -71856,13 +73452,16 @@ var ts; emitList(parentNode, decorators, 24577 /* Decorators */); } function emitTypeArguments(parentNode, typeArguments) { - emitList(parentNode, typeArguments, 26960 /* TypeArguments */); + emitList(parentNode, typeArguments, 26896 /* TypeArguments */); } function emitTypeParameters(parentNode, typeParameters) { - emitList(parentNode, typeParameters, 26960 /* TypeParameters */); + if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList(parentNode, typeParameters, 26896 /* TypeParameters */); } function emitParameters(parentNode, parameters) { - emitList(parentNode, parameters, 1360 /* Parameters */); + emitList(parentNode, parameters, 1296 /* Parameters */); } function canEmitSimpleArrowHead(parentNode, parameters) { var parameter = ts.singleOrUndefined(parameters); @@ -71882,7 +73481,7 @@ var ts; } function emitParametersForArrow(parentNode, parameters) { if (canEmitSimpleArrowHead(parentNode, parameters)) { - emitList(parentNode, parameters, 1360 /* Parameters */ & ~1024 /* Parenthesis */); + emitList(parentNode, parameters, 1296 /* Parameters */ & ~1024 /* Parenthesis */); } else { emitParameters(parentNode, parameters); @@ -71897,6 +73496,23 @@ var ts; function emitExpressionList(parentNode, children, format, start, count) { emitNodeList(emitExpression, parentNode, children, format, start, count); } + function writeDelimiter(format) { + switch (format & 28 /* DelimitersMask */) { + case 0 /* None */: + break; + case 16 /* CommaDelimited */: + writePunctuation(","); + break; + case 4 /* BarDelimited */: + writeSpace(); + writePunctuation("|"); + break; + case 8 /* AmpersandDelimited */: + writeSpace(); + writePunctuation("&"); + break; + } + } function emitNodeList(emit, parentNode, children, format, start, count) { if (start === void 0) { start = 0; } if (count === void 0) { count = children ? children.length - start : 0; } @@ -71915,7 +73531,7 @@ var ts; return; } if (format & 7680 /* BracketsMask */) { - write(getOpeningBracket(format)); + writePunctuation(getOpeningBracket(format)); } if (onBeforeEmitNodeArray) { onBeforeEmitNodeArray(children); @@ -71926,7 +73542,7 @@ var ts; writeLine(); } else if (format & 128 /* SpaceBetweenBraces */ && !(format & 262144 /* NoSpaceIfEmpty */)) { - write(" "); + writeSpace(); } } else { @@ -71938,7 +73554,7 @@ var ts; shouldEmitInterveningComments = false; } else if (format & 128 /* SpaceBetweenBraces */) { - write(" "); + writeSpace(); } // Increase the indent, if requested. if (format & 64 /* Indented */) { @@ -71947,7 +73563,6 @@ var ts; // Emit each child. var previousSibling = void 0; var shouldDecreaseIndentAfterEmit = void 0; - var delimiter = getDelimiter(format); for (var i = 0; i < count; i++) { var child = children[start + i]; // Write the delimiter if this is not the first node. @@ -71958,10 +73573,10 @@ var ts; // a // /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline // , - if (delimiter && previousSibling.end !== parentNode.end) { + if (format & 28 /* DelimitersMask */ && previousSibling.end !== parentNode.end) { emitLeadingCommentsOfPosition(previousSibling.end); } - write(delimiter); + writeDelimiter(format); // Write either a line terminator or whitespace to separate the elements. if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { // If a synthesized node in a single-line list starts on a new @@ -71974,7 +73589,7 @@ var ts; shouldEmitInterveningComments = false; } else if (previousSibling && format & 256 /* SpaceBetweenSiblings */) { - write(" "); + writeSpace(); } } // Emit this child. @@ -71997,7 +73612,7 @@ var ts; // Write a trailing comma, if requested. var hasTrailingComma = (format & 32 /* AllowTrailingComma */) && children.hasTrailingComma; if (format & 16 /* CommaDelimited */ && hasTrailingComma) { - write(","); + writePunctuation(","); } // Emit any trailing comment of the last element in the list // i.e @@ -72005,7 +73620,7 @@ var ts; // 2 // /* end of element 2 */ // ]; - if (previousSibling && delimiter && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024 /* NoTrailingComments */)) { + if (previousSibling && format & 28 /* DelimitersMask */ && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024 /* NoTrailingComments */)) { emitLeadingCommentsOfPosition(previousSibling.end); } // Decrease the indent, if requested. @@ -72017,50 +73632,102 @@ var ts; writeLine(); } else if (format & 128 /* SpaceBetweenBraces */) { - write(" "); + writeSpace(); } } if (onAfterEmitNodeArray) { onAfterEmitNodeArray(children); } if (format & 7680 /* BracketsMask */) { - write(getClosingBracket(format)); + writePunctuation(getClosingBracket(format)); } } - function write(s) { + function commitPendingSemicolonInternal() { + if (pendingSemicolon) { + writeSemicolonInternal(); + pendingSemicolon = false; + } + } + function writeLiteral(s) { + commitPendingSemicolon(); + writer.writeLiteral(s); + } + function writeStringLiteral(s) { + commitPendingSemicolon(); + writer.writeStringLiteral(s); + } + function writeBase(s) { + commitPendingSemicolon(); writer.write(s); } + function writeSymbol(s, sym) { + commitPendingSemicolon(); + writer.writeSymbol(s, sym); + } + function writePunctuation(s) { + commitPendingSemicolon(); + writer.writePunctuation(s); + } + function deferWriteSemicolon() { + pendingSemicolon = true; + } + function writeSemicolonInternal() { + writer.writePunctuation(";"); + } + function writeKeyword(s) { + commitPendingSemicolon(); + writer.writeKeyword(s); + } + function writeOperator(s) { + commitPendingSemicolon(); + writer.writeOperator(s); + } + function writeParameter(s) { + commitPendingSemicolon(); + writer.writeParameter(s); + } + function writeSpace() { + commitPendingSemicolon(); + writer.writeSpace(" "); + } + function writeProperty(s) { + commitPendingSemicolon(); + writer.writeProperty(s); + } function writeLine() { + commitPendingSemicolon(); writer.writeLine(); } function increaseIndent() { + commitPendingSemicolon(); writer.increaseIndent(); } function decreaseIndent() { + commitPendingSemicolon(); writer.decreaseIndent(); } - function writeToken(token, pos, contextNode) { + function writeToken(token, pos, writer, contextNode) { return onEmitSourceMapOfToken - ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) - : writeTokenText(token, pos); + ? onEmitSourceMapOfToken(contextNode, token, writer, pos, writeTokenText) + : writeTokenText(token, writer, pos); } - function writeTokenNode(node) { + function writeTokenNode(node, writer) { if (onBeforeEmitToken) { onBeforeEmitToken(node); } - write(ts.tokenToString(node.kind)); + writer(ts.tokenToString(node.kind)); if (onAfterEmitToken) { onAfterEmitToken(node); } } - function writeTokenText(token, pos) { + function writeTokenText(token, writer, pos) { var tokenString = ts.tokenToString(token); - write(tokenString); + writer(tokenString); return pos < 0 ? pos : pos + tokenString.length; } function writeLineOrSpace(node) { if (ts.getEmitFlags(node) & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); @@ -72208,7 +73875,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -72251,6 +73918,7 @@ var ts; } tempFlagsStack.push(tempFlags); tempFlags = 0; + reservedNamesStack.push(reservedNames); } /** * Pop the current name generation scope. @@ -72260,15 +73928,22 @@ var ts; return; } tempFlags = tempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name) { + if (!reservedNames || reservedNames === ts.lastOrUndefined(reservedNamesStack)) { + reservedNames = ts.createMap(); + } + reservedNames.set(name, true); } /** * Generate the text for a generated identifier. */ function generateName(name) { - if (name.autoGenerateKind === 4 /* Node */) { + if ((name.autoGenerateFlags & 7 /* KindMask */) === 4 /* Node */) { // Node names generate unique names based on their original node // and are cached based on that node's id. - if (name.skipNameGenerationScope) { + if (name.autoGenerateFlags & 8 /* SkipNameGenerationScope */) { var savedTempFlags = tempFlags; popNameGenerationScope(/*node*/ undefined); var result = generateNameCached(getNodeForGeneratedName(name)); @@ -72298,7 +73973,8 @@ var ts; function isUniqueName(name) { return !(hasGlobalName && hasGlobalName(name)) && !currentSourceFile.identifiers.has(name) - && !generatedNames.has(name); + && !generatedNames.has(name) + && !(reservedNames && reservedNames.has(name)); } /** * Returns a value indicating whether a name is unique within a container. @@ -72320,11 +73996,14 @@ var ts; * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. */ - function makeTempVariableName(flags) { + function makeTempVariableName(flags, reservedInNestedScopes) { if (flags && !(tempFlags & flags)) { var name = flags === 268435456 /* _i */ ? "_i" : "_n"; if (isUniqueName(name)) { tempFlags |= flags; + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -72337,6 +74016,9 @@ var ts; ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); if (isUniqueName(name)) { + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -72405,21 +74087,21 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - case 244 /* ExportAssignment */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 247 /* ExportAssignment */: return generateNameForExportDefault(); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return generateNameForClassExpression(); - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); @@ -72429,11 +74111,11 @@ var ts; * Generates a unique identifier for a node. */ function makeName(name) { - switch (name.autoGenerateKind) { + switch (name.autoGenerateFlags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(0 /* Auto */); + return makeTempVariableName(0 /* Auto */, !!(name.autoGenerateFlags & 16 /* ReservedInNestedScopes */)); case 2 /* Loop */: - return makeTempVariableName(268435456 /* _i */); + return makeTempVariableName(268435456 /* _i */, !!(name.autoGenerateFlags & 16 /* ReservedInNestedScopes */)); case 3 /* Unique */: return makeUniqueName(ts.idText(name)); } @@ -72451,7 +74133,7 @@ var ts; // if "node" is a different generated name (having a different // "autoGenerateId"), use it and stop traversing. if (ts.isIdentifier(node) - && node.autoGenerateKind === 4 /* Node */ + && node.autoGenerateFlags === 4 /* Node */ && node.autoGenerateId !== autoGenerateId) { break; } @@ -72462,17 +74144,6 @@ var ts; } } ts.createPrinter = createPrinter; - function createDelimiterMap() { - var delimiters = []; - delimiters[0 /* None */] = ""; - delimiters[16 /* CommaDelimited */] = ","; - delimiters[4 /* BarDelimited */] = " |"; - delimiters[8 /* AmpersandDelimited */] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28 /* DelimitersMask */]; - } function createBracketsMap() { var brackets = []; brackets[512 /* Braces */] = ["{", "}"]; @@ -72494,474 +74165,10 @@ var ts; TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; TempFlags[TempFlags["_i"] = 268435456] = "_i"; })(TempFlags || (TempFlags = {})); - var ListFormat; - (function (ListFormat) { - ListFormat[ListFormat["None"] = 0] = "None"; - // Line separators - ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; - ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; - ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; - ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; - // Delimiters - ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; - ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; - ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; - ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; - ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; - ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; - // Whitespace - ListFormat[ListFormat["Indented"] = 64] = "Indented"; - ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; - ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; - // Brackets/Braces - ListFormat[ListFormat["Braces"] = 512] = "Braces"; - ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; - ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; - ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; - ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; - ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; - ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; - ListFormat[ListFormat["Optional"] = 24576] = "Optional"; - // Other - ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; - ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; - ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; - ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; - ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; - // Precomputed Formats - ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; - ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; - ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; - ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; - ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; - ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; - ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; - ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements"; - ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements"; - ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; - ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; - ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; - ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; - ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; - ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; - ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; - ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; - ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; - ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; - ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; - ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; - ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; - ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; - ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; - ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; - ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; - ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; - ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; - ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; - ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; - ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; - ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; - ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments"; - ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters"; - ListFormat[ListFormat["Parameters"] = 1360] = "Parameters"; - ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; - })(ListFormat || (ListFormat = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { - var outputFiles = []; - var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); - return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; - function writeFile(fileName, text, writeByteOrderMark) { - outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); - } - } - ts.getFileEmitOutput = getFileEmitOutput; - function createBuilder(options) { - var isModuleEmit; - var fileInfos = ts.createMap(); - var semanticDiagnosticsPerFile = ts.createMap(); - /** The map has key by source file's path that has been changed */ - var changedFilesSet = ts.createMap(); - var hasShapeChanged = ts.createMap(); - var allFilesExcludingDefaultLibraryFile; - var emitHandler; - return { - updateProgram: updateProgram, - getFilesAffectedBy: getFilesAffectedBy, - emitChangedFiles: emitChangedFiles, - getSemanticDiagnostics: getSemanticDiagnostics, - clear: clear - }; - function createProgramGraph(program) { - var currentIsModuleEmit = program.getCompilerOptions().module !== ts.ModuleKind.None; - if (isModuleEmit !== currentIsModuleEmit) { - isModuleEmit = currentIsModuleEmit; - emitHandler = isModuleEmit ? getModuleEmitHandler() : getNonModuleEmitHandler(); - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - } - hasShapeChanged.clear(); - allFilesExcludingDefaultLibraryFile = undefined; - ts.mutateMap(fileInfos, ts.arrayToMap(program.getSourceFiles(), function (sourceFile) { return sourceFile.path; }), { - // Add new file info - createNewValue: function (_path, sourceFile) { return addNewFileInfo(program, sourceFile); }, - // Remove existing file info - onDeleteValue: removeExistingFileInfo, - // We will update in place instead of deleting existing value and adding new one - onExistingValue: function (existingInfo, sourceFile) { return updateExistingFileInfo(program, existingInfo, sourceFile); } - }); - } - function registerChangedFile(path) { - changedFilesSet.set(path, true); - // All changed files need to re-evaluate its semantic diagnostics - semanticDiagnosticsPerFile.delete(path); - } - function addNewFileInfo(program, sourceFile) { - registerChangedFile(sourceFile.path); - emitHandler.onAddSourceFile(program, sourceFile); - return { version: sourceFile.version, signature: undefined }; - } - function removeExistingFileInfo(_existingFileInfo, path) { - // Since we dont need to track removed file as changed file - // We can just remove its diagnostics - changedFilesSet.delete(path); - semanticDiagnosticsPerFile.delete(path); - emitHandler.onRemoveSourceFile(path); - } - function updateExistingFileInfo(program, existingInfo, sourceFile) { - if (existingInfo.version !== sourceFile.version) { - registerChangedFile(sourceFile.path); - existingInfo.version = sourceFile.version; - emitHandler.onUpdateSourceFile(program, sourceFile); - } - else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) { - registerChangedFile(sourceFile.path); - } - } - function ensureProgramGraph(program) { - if (!emitHandler) { - createProgramGraph(program); - } - } - function updateProgram(newProgram) { - if (emitHandler) { - createProgramGraph(newProgram); - } - } - function getFilesAffectedBy(program, path) { - ensureProgramGraph(program); - var sourceFile = program.getSourceFileByPath(path); - if (!sourceFile) { - return ts.emptyArray; - } - if (!updateShapeSignature(program, sourceFile)) { - return [sourceFile]; - } - return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile); - } - function emitChangedFiles(program, writeFileCallback) { - ensureProgramGraph(program); - var compilerOptions = program.getCompilerOptions(); - if (!changedFilesSet.size) { - return ts.emptyArray; - } - // With --out or --outFile all outputs go into single file, do it only once - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - changedFilesSet.clear(); - return [program.emit(/*targetSourceFile*/ undefined, writeFileCallback)]; - } - var seenFiles = ts.createMap(); - var result; - changedFilesSet.forEach(function (_true, path) { - // Get the affected Files by this program - var affectedFiles = getFilesAffectedBy(program, path); - affectedFiles.forEach(function (affectedFile) { - // Affected files shouldnt have cached diagnostics - semanticDiagnosticsPerFile.delete(affectedFile.path); - if (!seenFiles.has(affectedFile.path)) { - seenFiles.set(affectedFile.path, true); - // Emit the affected file - (result || (result = [])).push(program.emit(affectedFile, writeFileCallback)); - } - }); - }); - changedFilesSet.clear(); - return result || ts.emptyArray; - } - function getSemanticDiagnostics(program, cancellationToken) { - ensureProgramGraph(program); - ts.Debug.assert(changedFilesSet.size === 0); - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - // We dont need to cache the diagnostics just return them from program - return program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken); - } - var diagnostics; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken)); - } - return diagnostics || ts.emptyArray; - } - function getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken) { - var path = sourceFile.path; - var cachedDiagnostics = semanticDiagnosticsPerFile.get(path); - // Report the semantic diagnostics from the cache if we already have those diagnostics present - if (cachedDiagnostics) { - return cachedDiagnostics; - } - // Diagnostics werent cached, get them from program, and cache the result - var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); - semanticDiagnosticsPerFile.set(path, diagnostics); - return diagnostics; - } - function clear() { - isModuleEmit = undefined; - emitHandler = undefined; - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - changedFilesSet.clear(); - hasShapeChanged.clear(); - } - /** - * For script files that contains only ambient external modules, although they are not actually external module files, - * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore, - * there are no point to rebuild all script files if these special files have changed. However, if any statement - * in the file is not ambient external module, we treat it as a regular script file. - */ - function containsOnlyAmbientModules(sourceFile) { - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - if (!ts.isModuleWithStringLiteralName(statement)) { - return false; - } - } - return true; - } - /** - * @return {boolean} indicates if the shape signature has changed since last update. - */ - function updateShapeSignature(program, sourceFile) { - ts.Debug.assert(!!sourceFile); - // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate - if (hasShapeChanged.has(sourceFile.path)) { - return false; - } - hasShapeChanged.set(sourceFile.path, true); - var info = fileInfos.get(sourceFile.path); - ts.Debug.assert(!!info); - var prevSignature = info.signature; - var latestSignature; - if (sourceFile.isDeclarationFile) { - latestSignature = sourceFile.version; - info.signature = latestSignature; - } - else { - var emitOutput = getFileEmitOutput(program, sourceFile, /*emitOnlyDtsFiles*/ true); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - latestSignature = options.computeHash(emitOutput.outputFiles[0].text); - info.signature = latestSignature; - } - else { - latestSignature = prevSignature; - } - } - return !prevSignature || latestSignature !== prevSignature; - } - /** - * Gets the referenced files for a file from the program with values for the keys as referenced file's path to be true - */ - function getReferencedFiles(program, sourceFile) { - var referencedFiles; - // We need to use a set here since the code can contain the same import twice, - // but that will only be one dependency. - // To avoid invernal conversion, the key of the referencedFiles map must be of type Path - if (sourceFile.imports && sourceFile.imports.length > 0) { - var checker = program.getTypeChecker(); - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var importName = _a[_i]; - var symbol = checker.getSymbolAtLocation(importName); - if (symbol && symbol.declarations && symbol.declarations[0]) { - var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); - if (declarationSourceFile) { - addReferencedFile(declarationSourceFile.path); - } - } - } - } - var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); - // Handle triple slash references - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { - var referencedFile = _c[_b]; - var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(referencedPath); - } - } - // Handle type reference directives - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { - if (!resolvedTypeReferenceDirective) { - return; - } - var fileName = resolvedTypeReferenceDirective.resolvedFileName; - var typeFilePath = ts.toPath(fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(typeFilePath); - }); - } - return referencedFiles; - function addReferencedFile(referencedPath) { - if (!referencedFiles) { - referencedFiles = ts.createMap(); - } - referencedFiles.set(referencedPath, true); - } - } - /** - * Gets all files of the program excluding the default library file - */ - function getAllFilesExcludingDefaultLibraryFile(program, firstSourceFile) { - // Use cached result - if (allFilesExcludingDefaultLibraryFile) { - return allFilesExcludingDefaultLibraryFile; - } - var result; - addSourceFile(firstSourceFile); - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - if (sourceFile !== firstSourceFile) { - addSourceFile(sourceFile); - } - } - allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; - return allFilesExcludingDefaultLibraryFile; - function addSourceFile(sourceFile) { - if (!program.isSourceFileDefaultLibrary(sourceFile)) { - (result || (result = [])).push(sourceFile); - } - } - } - function getNonModuleEmitHandler() { - return { - onAddSourceFile: ts.noop, - onRemoveSourceFile: ts.noop, - onUpdateSourceFile: ts.noop, - onUpdateSourceFileWithSameVersion: ts.returnFalse, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function getFilesAffectedByUpdatedShape(program, sourceFile) { - var options = program.getCompilerOptions(); - // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, - // so returning the file itself is good enough. - if (options && (options.out || options.outFile)) { - return [sourceFile]; - } - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - } - function getModuleEmitHandler() { - var references = ts.createMap(); - return { - onAddSourceFile: setReferences, - onRemoveSourceFile: onRemoveSourceFile, - onUpdateSourceFile: updateReferences, - onUpdateSourceFileWithSameVersion: updateReferencesTrackingChangedReferences, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function setReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - } - function updateReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - else { - references.delete(sourceFile.path); - } - } - function updateReferencesTrackingChangedReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (!newReferences) { - // Changed if we had references - return references.delete(sourceFile.path); - } - var oldReferences = references.get(sourceFile.path); - references.set(sourceFile.path, newReferences); - if (!oldReferences || oldReferences.size !== newReferences.size) { - return true; - } - // If there are any new references that werent present previously there is change - return ts.forEachEntry(newReferences, function (_true, referencedPath) { return !oldReferences.delete(referencedPath); }) || - // Otherwise its changed if there are more references previously than now - !!oldReferences.size; - } - function onRemoveSourceFile(removedFilePath) { - // Remove existing references - references.forEach(function (referencesInFile, filePath) { - if (referencesInFile.has(removedFilePath)) { - // add files referencing the removedFilePath, as changed files too - var referencedByInfo = fileInfos.get(filePath); - if (referencedByInfo) { - registerChangedFile(filePath); - } - } - }); - // Delete the entry for the removed file path - references.delete(removedFilePath); - } - function getReferencedByPaths(referencedFilePath) { - return ts.mapDefinedIter(references.entries(), function (_a) { - var filePath = _a[0], referencesInFile = _a[1]; - return referencesInFile.has(referencedFilePath) ? filePath : undefined; - }); - } - function getFilesAffectedByUpdatedShape(program, sourceFile) { - if (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile)) { - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { - return [sourceFile]; - } - // Now we need to if each file in the referencedBy list has a shape change as well. - // Because if so, its own referencedBy files need to be saved as well to make the - // emitting result consistent with files on disk. - var seenFileNamesMap = ts.createMap(); - // Start with the paths this file was referenced by - var path = sourceFile.path; - seenFileNamesMap.set(path, sourceFile); - var queue = getReferencedByPaths(path); - while (queue.length > 0) { - var currentPath = queue.pop(); - if (!seenFileNamesMap.has(currentPath)) { - var currentSourceFile = program.getSourceFileByPath(currentPath); - seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(program, currentSourceFile)) { - queue.push.apply(queue, getReferencedByPaths(currentPath)); - } - } - } - // Return array of values that needs emit - return ts.flatMapIter(seenFileNamesMap.values(), function (value) { return value; }); - } - } - } - ts.createBuilder = createBuilder; })(ts || (ts = {})); /// /// /// -/// var ts; (function (ts) { var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; @@ -73155,23 +74362,31 @@ var ts; return errorMessage; } ts.formatDiagnostic = formatDiagnostic; - var redForegroundEscapeSequence = "\u001b[91m"; - var yellowForegroundEscapeSequence = "\u001b[93m"; - var blueForegroundEscapeSequence = "\u001b[93m"; + /** @internal */ + var ForegroundColorEscapeSequences; + (function (ForegroundColorEscapeSequences) { + ForegroundColorEscapeSequences["Grey"] = "\u001B[90m"; + ForegroundColorEscapeSequences["Red"] = "\u001B[91m"; + ForegroundColorEscapeSequences["Yellow"] = "\u001B[93m"; + ForegroundColorEscapeSequences["Blue"] = "\u001B[94m"; + ForegroundColorEscapeSequences["Cyan"] = "\u001B[96m"; + })(ForegroundColorEscapeSequences = ts.ForegroundColorEscapeSequences || (ts.ForegroundColorEscapeSequences = {})); var gutterStyleSequence = "\u001b[30;47m"; var gutterSeparator = " "; var resetEscapeSequence = "\u001b[0m"; var ellipsis = "..."; function getCategoryFormat(category) { switch (category) { - case ts.DiagnosticCategory.Warning: return yellowForegroundEscapeSequence; - case ts.DiagnosticCategory.Error: return redForegroundEscapeSequence; - case ts.DiagnosticCategory.Message: return blueForegroundEscapeSequence; + case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } - function formatAndReset(text, formatStyle) { + /** @internal */ + function formatColorAndReset(text, formatStyle) { return formatStyle + text + resetEscapeSequence; } + ts.formatColorAndReset = formatColorAndReset; function padLeft(s, length) { while (s.length < length) { s = " " + s; @@ -73184,9 +74399,9 @@ var ts; var diagnostic = diagnostics_2[_i]; var context = ""; if (diagnostic.file) { - var start = diagnostic.start, length_5 = diagnostic.length, file = diagnostic.file; + var start = diagnostic.start, length_4 = diagnostic.length, file = diagnostic.file; var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; - var _b = ts.getLineAndCharacterOfPosition(file, start + length_5), lastLine = _b.line, lastLineChar = _b.character; + var _b = ts.getLineAndCharacterOfPosition(file, start + length_4), lastLine = _b.line, lastLineChar = _b.character; var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line; var relativeFileName = host ? ts.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : file.fileName; var hasMoreThanFiveLines = (lastLine - firstLine) >= 4; @@ -73199,7 +74414,7 @@ var ts; // If the error spans over 5 lines, we'll only show the first 2 and last 2 lines, // so we'll skip ahead to the second-to-last line. if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { - context += formatAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + context += formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); i = lastLine - 1; } var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0); @@ -73208,11 +74423,11 @@ var ts; lineContent = lineContent.replace(/\s+$/g, ""); // trim from end lineContent = lineContent.replace("\t", " "); // convert tabs to single spaces // Output the gutter and the actual contents of the line. - context += formatAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; context += lineContent + host.getNewLine(); // Output the gutter and the error span for the line using tildes. - context += formatAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; - context += redForegroundEscapeSequence; + context += formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += ForegroundColorEscapeSequences.Red; if (i === firstLine) { // If we're on the last line, then limit it to the last character of the last line. // Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position. @@ -73229,19 +74444,25 @@ var ts; } context += resetEscapeSequence; } - output += host.getNewLine(); - output += relativeFileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; + output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan); + output += ":"; + output += formatColorAndReset("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow); + output += ":"; + output += formatColorAndReset("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); + output += " - "; } var categoryColor = getCategoryFormat(diagnostic.category); var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatAndReset(category, categoryColor) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); + output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey); + output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); if (diagnostic.file) { output += host.getNewLine(); output += context; } output += host.getNewLine(); } - return output; + return output + host.getNewLine(); } ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext; function flattenDiagnosticMessageText(messageText, newLine) { @@ -73291,7 +74512,7 @@ var ts; */ /* @internal */ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames) { - // If we haven't create a program yet or has changed automatic type directives, then it is not up-to-date + // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date if (!program || hasChangedAutomaticTypeDirectiveNames) { return false; } @@ -73325,10 +74546,10 @@ var ts; } ts.isProgramUptoDate = isProgramUptoDate; /** - * Determined if source file needs to be re-created even if its text hasnt changed + * Determined if source file needs to be re-created even if its text hasn't changed */ function shouldProgramCreateNewSourceFiles(program, newOptions) { - // If any of these options change, we cant reuse old source file even if version match + // If any of these options change, we can't reuse old source file even if version match // The change in options like these could result in change in syntax tree change var oldOptions = program && program.getCompilerOptions(); return oldOptions && (oldOptions.target !== newOptions.target || @@ -73509,7 +74730,8 @@ var ts; dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, sourceFileToPackageName: sourceFileToPackageName, - redirectTargetsSet: redirectTargetsSet + redirectTargetsSet: redirectTargetsSet, + isEmittedFile: isEmittedFile }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -73656,9 +74878,13 @@ var ts; // If we change our policy of rechecking failed lookups on each program create, // we should adjust the value returned here. function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, oldProgramState) { - var resolutionToFile = ts.getResolvedModule(oldProgramState.file, moduleName); - if (resolutionToFile) { - // module used to be resolved to file - ignore it + var resolutionToFile = ts.getResolvedModule(oldProgramState.oldSourceFile, moduleName); + var resolvedFile = resolutionToFile && oldProgramState.program && oldProgramState.program.getSourceFile(resolutionToFile.resolvedFileName); + if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) { + // In the old program, we resolved to an ambient module that was in the same + // place as we expected to find an actual module file. + // We actually need to return 'false' here even though this seems like a 'true' case + // because the normal module resolution algorithm will find this anyway. return false; } var ambientModule = oldProgramState.program && oldProgramState.program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(moduleName); @@ -73811,7 +75037,7 @@ var ts; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = getModuleNames(newSourceFile); - var oldProgramState = { program: oldProgram, file: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, oldProgramState); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); @@ -73915,24 +75141,26 @@ var ts; } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; - if (options.noEmit) { - return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; - } - // If the noEmitOnError flag is set, then check if we have any errors so far. If so, - // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we - // get any preEmit diagnostics, not just the ones - if (options.noEmitOnError) { - var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); - if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { - declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); + if (!emitOnlyDtsFiles) { + if (options.noEmit) { + return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; } - if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { - return { - diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), - sourceMaps: undefined, - emittedFiles: undefined, - emitSkipped: true - }; + // If the noEmitOnError flag is set, then check if we have any errors so far. If so, + // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we + // get any preEmit diagnostics, not just the ones + if (options.noEmitOnError) { + var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); + if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { + declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); + } + if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { + return { + diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), + sourceMaps: undefined, + emittedFiles: undefined, + emitSkipped: true + }; + } } } // Create the emit resolver outside of the "emitTime" tracking code below. That way @@ -73943,7 +75171,7 @@ var ts; // This is because in the -out scenario all files need to be emitted, and therefore all // files need to be type checked. And the way to specify that all files need to be type // checked is to not pass the file to getEmitResolver. - var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); + var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); ts.performance.mark("beforeEmit"); var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); @@ -74078,22 +75306,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } // falls through - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 227 /* VariableDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 230 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -74101,41 +75329,41 @@ var ts; } } switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 108 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } var prevParent = parent; @@ -74148,28 +75376,28 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 233 /* ClassDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } // falls through - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 209 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 212 /* VariableStatement */); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -74181,16 +75409,16 @@ var ts; return; } break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -74216,7 +75444,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 124 /* DeclareKeyword */: case 117 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); @@ -74306,6 +75534,7 @@ var ts; // synthesize 'import "tslib"' declaration var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); externalHelpersModuleReference.parent = importDecl; importDecl.parent = file; imports = [externalHelpersModuleReference]; @@ -74323,9 +75552,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || !ts.isStringLiteral(moduleNameExpr)) { break; @@ -74340,7 +75569,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) { var moduleName = node.name; var nameText = ts.getTextOfIdentifierOrLiteral(moduleName); @@ -74495,7 +75724,7 @@ var ts; } }, shouldCreateNewSourceFile); if (packageId) { - var packageIdKey = packageId.name + "/" + packageId.subModuleName + "@" + packageId.version; + var packageIdKey = ts.packageIdToString(packageId); var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); if (fileFromPackageId) { // Some other SourceFile already exists with this package name and version. @@ -74622,7 +75851,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var oldProgramState = { program: oldProgram, file: file, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory), file, oldProgramState); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { @@ -74829,6 +76058,14 @@ var ts; if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } + if (options.emitDeclarationOnly) { + if (!options.declaration) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations"); + } + if (options.noEmit) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); + } + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); @@ -74849,7 +76086,9 @@ var ts; var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createMap(); ts.forEachEmittedFile(emitHost, function (emitFileNames) { - verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + if (!options.emitDeclarationOnly) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + } verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); } @@ -74859,13 +76098,13 @@ var ts; var emitFilePath = toPath(emitFileName); // Report error if the output overwrites input file if (filesByName.has(emitFilePath)) { - var chain_1; + var chain_2; if (!options.configFilePath) { // The program is from either an inferred project or an external project - chain_1 = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + chain_2 = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } - chain_1 = ts.chainDiagnosticMessages(chain_1, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); - blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_1)); + chain_2 = ts.chainDiagnosticMessages(chain_2, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_2)); } var emitFileKey = !host.useCaseSensitiveFileNames() ? emitFilePath.toLocaleLowerCase() : emitFilePath; // Report error if multiple files write into same file @@ -74961,6 +76200,35 @@ var ts; hasEmitBlockingDiagnostics.set(toPath(emitFileName), true); programDiagnostics.add(diag); } + function isEmittedFile(file) { + if (options.noEmit) { + return false; + } + // If this is source file, its not emitted file + var filePath = toPath(file); + if (getSourceFileByPath(filePath)) { + return false; + } + // If options have --outFile or --out just check that + var out = options.outFile || options.out; + if (out) { + return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts" /* Dts */); + } + // If --outDir, check if file is in that directory + if (options.outDir) { + return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); + } + if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts" /* Dts */)) { + // Otherwise just check if sourceFile with the name exists + var filePathWithoutExtension = ts.removeFileExtension(filePath); + return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts" /* Ts */)) || + !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx" /* Tsx */)); + } + return false; + } + function isSameFile(file1, file2) { + return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */; + } } ts.createProgram = createProgram; /* @internal */ @@ -75008,6 +76276,2161 @@ var ts; return res; } })(ts || (ts = {})); +/// +/*@internal*/ +var ts; +(function (ts) { + function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { + var outputFiles = []; + var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; + function writeFile(fileName, text, writeByteOrderMark) { + outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); + } + } + ts.getFileEmitOutput = getFileEmitOutput; +})(ts || (ts = {})); +/*@internal*/ +(function (ts) { + var BuilderState; + (function (BuilderState) { + /** + * Gets the referenced files for a file from the program with values for the keys as referenced file's path to be true + */ + function getReferencedFiles(program, sourceFile, getCanonicalFileName) { + var referencedFiles; + // We need to use a set here since the code can contain the same import twice, + // but that will only be one dependency. + // To avoid invernal conversion, the key of the referencedFiles map must be of type Path + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = program.getTypeChecker(); + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importName = _a[_i]; + var symbol = checker.getSymbolAtLocation(importName); + if (symbol && symbol.declarations && symbol.declarations[0]) { + var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); + if (declarationSourceFile) { + addReferencedFile(declarationSourceFile.path); + } + } + } + } + var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); + // Handle triple slash references + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(referencedPath); + } + } + // Handle type reference directives + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = ts.toPath(fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }); + } + return referencedFiles; + function addReferencedFile(referencedPath) { + if (!referencedFiles) { + referencedFiles = ts.createMap(); + } + referencedFiles.set(referencedPath, true); + } + } + /** + * Returns true if oldState is reusable, that is the emitKind = module/non module has not changed + */ + function canReuseOldState(newReferencedMap, oldState) { + return oldState && !oldState.referencedMap === !newReferencedMap; + } + BuilderState.canReuseOldState = canReuseOldState; + /** + * Creates the state of file references and signature for the new program from oldState if it is safe + */ + function create(newProgram, getCanonicalFileName, oldState) { + var fileInfos = ts.createMap(); + var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? ts.createMap() : undefined; + var hasCalledUpdateShapeSignature = ts.createMap(); + var useOldState = canReuseOldState(referencedMap, oldState); + // Create the reference map, and set the file infos + for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var version_1 = sourceFile.version; + var oldInfo = useOldState && oldState.fileInfos.get(sourceFile.path); + if (referencedMap) { + var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); + if (newReferences) { + referencedMap.set(sourceFile.path, newReferences); + } + } + fileInfos.set(sourceFile.path, { version: version_1, signature: oldInfo && oldInfo.signature }); + } + return { + fileInfos: fileInfos, + referencedMap: referencedMap, + hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature, + allFilesExcludingDefaultLibraryFile: undefined, + allFileNames: undefined + }; + } + BuilderState.create = create; + /** + * Gets the files affected by the path from the program + */ + function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature) { + // Since the operation could be cancelled, the signatures are always stored in the cache + // They will be commited once it is safe to use them + // eg when calling this api from tsserver, if there is no cancellation of the operation + // In the other cases the affected files signatures are commited only after the iteration through the result is complete + var signatureCache = cacheToUpdateSignature || ts.createMap(); + var sourceFile = programOfThisState.getSourceFileByPath(path); + if (!sourceFile) { + return ts.emptyArray; + } + if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash)) { + return [sourceFile]; + } + var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash); + if (!cacheToUpdateSignature) { + // Commit all the signatures in the signature cache + updateSignaturesFromCache(state, signatureCache); + } + return result; + } + BuilderState.getFilesAffectedBy = getFilesAffectedBy; + /** + * Updates the signatures from the cache into state's fileinfo signatures + * This should be called whenever it is safe to commit the state of the builder + */ + function updateSignaturesFromCache(state, signatureCache) { + signatureCache.forEach(function (signature, path) { + state.fileInfos.get(path).signature = signature; + state.hasCalledUpdateShapeSignature.set(path, true); + }); + } + BuilderState.updateSignaturesFromCache = updateSignaturesFromCache; + /** + * Returns if the shape of the signature has changed since last emit + */ + function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash) { + ts.Debug.assert(!!sourceFile); + // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate + if (state.hasCalledUpdateShapeSignature.has(sourceFile.path) || cacheToUpdateSignature.has(sourceFile.path)) { + return false; + } + var info = state.fileInfos.get(sourceFile.path); + ts.Debug.assert(!!info); + var prevSignature = info.signature; + var latestSignature; + if (sourceFile.isDeclarationFile) { + latestSignature = sourceFile.version; + } + else { + var emitOutput = ts.getFileEmitOutput(programOfThisState, sourceFile, /*emitOnlyDtsFiles*/ true, cancellationToken); + if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { + latestSignature = computeHash(emitOutput.outputFiles[0].text); + } + else { + latestSignature = prevSignature; + } + } + cacheToUpdateSignature.set(sourceFile.path, latestSignature); + return !prevSignature || latestSignature !== prevSignature; + } + /** + * Get all the dependencies of the sourceFile + */ + function getAllDependencies(state, programOfThisState, sourceFile) { + var compilerOptions = programOfThisState.getCompilerOptions(); + // With --out or --outFile all outputs go into single file, all files depend on each other + if (compilerOptions.outFile || compilerOptions.out) { + return getAllFileNames(state, programOfThisState); + } + // If this is non module emit, or its a global file, it depends on all the source files + if (!state.referencedMap || (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile))) { + return getAllFileNames(state, programOfThisState); + } + // Get the references, traversing deep from the referenceMap + var seenMap = ts.createMap(); + var queue = [sourceFile.path]; + while (queue.length) { + var path = queue.pop(); + if (!seenMap.has(path)) { + seenMap.set(path, true); + var references = state.referencedMap.get(path); + if (references) { + var iterator = references.keys(); + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + queue.push(value); + } + } + } + } + return ts.arrayFrom(ts.mapDefinedIterator(seenMap.keys(), function (path) { + var file = programOfThisState.getSourceFileByPath(path); + return file ? file.fileName : path; + })); + var _b; + } + BuilderState.getAllDependencies = getAllDependencies; + /** + * Gets the names of all files from the program + */ + function getAllFileNames(state, programOfThisState) { + if (!state.allFileNames) { + var sourceFiles = programOfThisState.getSourceFiles(); + state.allFileNames = sourceFiles === ts.emptyArray ? ts.emptyArray : sourceFiles.map(function (file) { return file.fileName; }); + } + return state.allFileNames; + } + /** + * Gets the files referenced by the the file path + */ + function getReferencedByPaths(state, referencedFilePath) { + return ts.arrayFrom(ts.mapDefinedIterator(state.referencedMap.entries(), function (_a) { + var filePath = _a[0], referencesInFile = _a[1]; + return referencesInFile.has(referencedFilePath) ? filePath : undefined; + })); + } + /** + * For script files that contains only ambient external modules, although they are not actually external module files, + * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore, + * there are no point to rebuild all script files if these special files have changed. However, if any statement + * in the file is not ambient external module, we treat it as a regular script file. + */ + function containsOnlyAmbientModules(sourceFile) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (!ts.isModuleWithStringLiteralName(statement)) { + return false; + } + } + return true; + } + /** + * Gets all files of the program excluding the default library file + */ + function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { + // Use cached result + if (state.allFilesExcludingDefaultLibraryFile) { + return state.allFilesExcludingDefaultLibraryFile; + } + var result; + addSourceFile(firstSourceFile); + for (var _i = 0, _a = programOfThisState.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + if (sourceFile !== firstSourceFile) { + addSourceFile(sourceFile); + } + } + state.allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; + return state.allFilesExcludingDefaultLibraryFile; + function addSourceFile(sourceFile) { + if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { + (result || (result = [])).push(sourceFile); + } + } + } + /** + * When program emits non modular code, gets the files affected by the sourceFile whose shape has changed + */ + function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { + var compilerOptions = programOfThisState.getCompilerOptions(); + // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, + // so returning the file itself is good enough. + if (compilerOptions && (compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + /** + * When program emits modular code, gets the files affected by the sourceFile whose shape has changed + */ + function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash) { + if (!ts.isExternalModule(sourceFileWithUpdatedShape) && !containsOnlyAmbientModules(sourceFileWithUpdatedShape)) { + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + // Now we need to if each file in the referencedBy list has a shape change as well. + // Because if so, its own referencedBy files need to be saved as well to make the + // emitting result consistent with files on disk. + var seenFileNamesMap = ts.createMap(); + // Start with the paths this file was referenced by + seenFileNamesMap.set(sourceFileWithUpdatedShape.path, sourceFileWithUpdatedShape); + var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.path); + while (queue.length > 0) { + var currentPath = queue.pop(); + if (!seenFileNamesMap.has(currentPath)) { + var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); + seenFileNamesMap.set(currentPath, currentSourceFile); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash)) { + queue.push.apply(queue, getReferencedByPaths(state, currentPath)); + } + } + } + // Return array of values that needs emit + // Return array of values that needs emit + return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); + } + })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); +})(ts || (ts = {})); +/// +/*@internal*/ +var ts; +(function (ts) { + function hasSameKeys(map1, map2) { + // Has same size and every key is present in both maps + return map1 === map2 || map1 && map2 && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); }); + } + /** + * Create the state so that we can iterate on changedFiles/affected files + */ + function createBuilderProgramState(newProgram, getCanonicalFileName, oldState) { + var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState); + state.program = newProgram; + var compilerOptions = newProgram.getCompilerOptions(); + if (!compilerOptions.outFile && !compilerOptions.out) { + state.semanticDiagnosticsPerFile = ts.createMap(); + } + state.changedFilesSet = ts.createMap(); + var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState); + var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile; + if (useOldState) { + // Verify the sanity of old state + if (!oldState.currentChangedFilePath) { + ts.Debug.assert(!oldState.affectedFiles && (!oldState.currentAffectedFilesSignatures || !oldState.currentAffectedFilesSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated"); + } + if (canCopySemanticDiagnostics) { + ts.Debug.assert(!ts.forEachKey(oldState.changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files"); + } + // Copy old state's changed files set + ts.copyEntries(oldState.changedFilesSet, state.changedFilesSet); + } + // Update changed files and copy semantic diagnostics if we can + var referencedMap = state.referencedMap; + var oldReferencedMap = useOldState && oldState.referencedMap; + state.fileInfos.forEach(function (info, sourceFilePath) { + var oldInfo; + var newReferences; + // if not using old state, every file is changed + if (!useOldState || + // File wasnt present in old state + !(oldInfo = oldState.fileInfos.get(sourceFilePath)) || + // versions dont match + oldInfo.version !== info.version || + // Referenced files changed + !hasSameKeys(newReferences = referencedMap && referencedMap.get(sourceFilePath), oldReferencedMap && oldReferencedMap.get(sourceFilePath)) || + // Referenced file was deleted in the new program + newReferences && ts.forEachKey(newReferences, function (path) { return !state.fileInfos.has(path) && oldState.fileInfos.has(path); })) { + // Register file as changed file and do not copy semantic diagnostics, since all changed files need to be re-evaluated + state.changedFilesSet.set(sourceFilePath, true); + } + else if (canCopySemanticDiagnostics) { + // Unchanged file copy diagnostics + var diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath); + if (diagnostics) { + state.semanticDiagnosticsPerFile.set(sourceFilePath, diagnostics); + } + } + }); + return state; + } + /** + * Verifies that source file is ok to be used in calls that arent handled by next + */ + function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) { + ts.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.path)); + } + /** + * This function returns the next affected file to be processed. + * Note that until doneAffected is called it would keep reporting same result + * This is to allow the callers to be able to actually remove affected file only when the operation is complete + * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained + */ + function getNextAffectedFile(state, cancellationToken, computeHash) { + while (true) { + var affectedFiles = state.affectedFiles; + if (affectedFiles) { + var seenAffectedFiles = state.seenAffectedFiles, semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile; + var affectedFilesIndex = state.affectedFilesIndex; + while (affectedFilesIndex < affectedFiles.length) { + var affectedFile = affectedFiles[affectedFilesIndex]; + if (!seenAffectedFiles.has(affectedFile.path)) { + // Set the next affected file as seen and remove the cached semantic diagnostics + state.affectedFilesIndex = affectedFilesIndex; + semanticDiagnosticsPerFile.delete(affectedFile.path); + return affectedFile; + } + seenAffectedFiles.set(affectedFile.path, true); + affectedFilesIndex++; + } + // Remove the changed file from the change set + state.changedFilesSet.delete(state.currentChangedFilePath); + state.currentChangedFilePath = undefined; + // Commit the changes in file signature + ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures); + state.currentAffectedFilesSignatures.clear(); + state.affectedFiles = undefined; + } + // Get next changed file + var nextKey = state.changedFilesSet.keys().next(); + if (nextKey.done) { + // Done + return undefined; + } + // With --out or --outFile all outputs go into single file + // so operations are performed directly on program, return program + var compilerOptions = state.program.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + ts.Debug.assert(!state.semanticDiagnosticsPerFile); + return state.program; + } + // Get next batch of affected files + state.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures || ts.createMap(); + state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, state.program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures); + state.currentChangedFilePath = nextKey.value; + state.semanticDiagnosticsPerFile.delete(nextKey.value); + state.affectedFilesIndex = 0; + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); + } + } + /** + * This is called after completing operation on the next affected file. + * The operations here are postponed to ensure that cancellation during the iteration is handled correctly + */ + function doneWithAffectedFile(state, affected) { + if (affected === state.program) { + state.changedFilesSet.clear(); + } + else { + state.seenAffectedFiles.set(affected.path, true); + state.affectedFilesIndex++; + } + } + /** + * Returns the result with affected file + */ + function toAffectedFileResult(state, result, affected) { + doneWithAffectedFile(state, affected); + return { result: result, affected: affected }; + } + /** + * Gets the semantic diagnostics either from cache if present, or otherwise from program and caches it + * Note that it is assumed that the when asked about semantic diagnostics, the file has been taken out of affected files/changed file set + */ + function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) { + var path = sourceFile.path; + var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); + // Report the semantic diagnostics from the cache if we already have those diagnostics present + if (cachedDiagnostics) { + return cachedDiagnostics; + } + // Diagnostics werent cached, get them from program, and cache the result + var diagnostics = state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + state.semanticDiagnosticsPerFile.set(path, diagnostics); + return diagnostics; + } + var BuilderProgramKind; + (function (BuilderProgramKind) { + BuilderProgramKind[BuilderProgramKind["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram"; + BuilderProgramKind[BuilderProgramKind["EmitAndSemanticDiagnosticsBuilderProgram"] = 1] = "EmitAndSemanticDiagnosticsBuilderProgram"; + })(BuilderProgramKind = ts.BuilderProgramKind || (ts.BuilderProgramKind = {})); + function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + var host; + var newProgram; + if (ts.isArray(newProgramOrRootNames)) { + newProgram = ts.createProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram && oldProgram.getProgram()); + host = oldProgramOrHost; + } + else { + newProgram = newProgramOrRootNames; + host = hostOrOptions; + oldProgram = oldProgramOrHost; + } + return { host: host, newProgram: newProgram, oldProgram: oldProgram }; + } + ts.getBuilderCreationParameters = getBuilderCreationParameters; + function createBuilderProgram(kind, _a) { + var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram; + // Return same program if underlying program doesnt change + var oldState = oldProgram && oldProgram.getState(); + if (oldState && newProgram === oldState.program) { + newProgram = undefined; + oldState = undefined; + return oldProgram; + } + /** + * Create the canonical file name for identity + */ + var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + /** + * Computing hash to for signature verification + */ + var computeHash = host.createHash || ts.identity; + var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); + // To ensure that we arent storing any references to old program or new program without state + newProgram = undefined; + oldProgram = undefined; + oldState = undefined; + var result = { + getState: function () { return state; }, + getProgram: function () { return state.program; }, + getCompilerOptions: function () { return state.program.getCompilerOptions(); }, + getSourceFile: function (fileName) { return state.program.getSourceFile(fileName); }, + getSourceFiles: function () { return state.program.getSourceFiles(); }, + getOptionsDiagnostics: function (cancellationToken) { return state.program.getOptionsDiagnostics(cancellationToken); }, + getGlobalDiagnostics: function (cancellationToken) { return state.program.getGlobalDiagnostics(cancellationToken); }, + getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return state.program.getSyntacticDiagnostics(sourceFile, cancellationToken); }, + getSemanticDiagnostics: getSemanticDiagnostics, + emit: emit, + getAllDependencies: function (sourceFile) { return ts.BuilderState.getAllDependencies(state, state.program, sourceFile); }, + getCurrentDirectory: function () { return state.program.getCurrentDirectory(); } + }; + if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { + result.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; + } + else if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + result.emitNextAffectedFile = emitNextAffectedFile; + } + else { + ts.notImplemented(); + } + return result; + /** + * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash); + if (!affected) { + // Done + return undefined; + } + return toAffectedFileResult(state, + // When whole program is affected, do emit only once (eg when --out or --outFile is specified) + // Otherwise just affected file + state.program.emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected); + } + /** + * Emits the JavaScript and declaration files. + * When targetSource file is specified, emits the files corresponding to that source file, + * otherwise for the whole program. + * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, + * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, + * it will only emit all the affected files instead of whole program + * + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); + if (!targetSourceFile) { + // Emit and report any errors we ran into. + var sourceMaps = []; + var emitSkipped = void 0; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; + } + } + return state.program.emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + } + /** + * Return the semantic diagnostics for the next affected file or undefined if iteration is complete + * If provided ignoreSourceFile would be called before getting the diagnostics and would ignore the sourceFile if the returned value was true + */ + function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) { + while (true) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash); + if (!affected) { + // Done + return undefined; + } + else if (affected === state.program) { + // When whole program is affected, get all semantic diagnostics (eg when --out or --outFile is specified) + return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected); + } + // Get diagnostics for the affected file if its not ignored + if (ignoreSourceFile && ignoreSourceFile(affected)) { + // Get next affected file + doneWithAffectedFile(state, affected); + continue; + } + return toAffectedFileResult(state, getSemanticDiagnosticsOfFile(state, affected, cancellationToken), affected); + } + } + /** + * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program + * The semantic diagnostics are cached and managed here + * Note that it is assumed that when asked about semantic diagnostics through this API, + * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics + * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, + * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics + */ + function getSemanticDiagnostics(sourceFile, cancellationToken) { + assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); + var compilerOptions = state.program.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + ts.Debug.assert(!state.semanticDiagnosticsPerFile); + // We dont need to cache the diagnostics just return them from program + return state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + } + if (sourceFile) { + return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); + } + if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { + // When semantic builder asks for diagnostics of the whole program, + // ensure that all the affected files are handled + var affected = void 0; + while (affected = getNextAffectedFile(state, cancellationToken, computeHash)) { + doneWithAffectedFile(state, affected); + } + } + var diagnostics; + for (var _i = 0, _a = state.program.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile_1 = _a[_i]; + diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile_1, cancellationToken)); + } + return diagnostics || ts.emptyArray; + } + } + ts.createBuilderProgram = createBuilderProgram; +})(ts || (ts = {})); +(function (ts) { + function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + return ts.createBuilderProgram(ts.BuilderProgramKind.SemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram)); + } + ts.createSemanticDiagnosticsBuilderProgram = createSemanticDiagnosticsBuilderProgram; + function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + return ts.createBuilderProgram(ts.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram)); + } + ts.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram; + function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + var program = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram).newProgram; + return { + // Only return program, all other methods are not implemented + getProgram: function () { return program; }, + getState: ts.notImplemented, + getCompilerOptions: ts.notImplemented, + getSourceFile: ts.notImplemented, + getSourceFiles: ts.notImplemented, + getOptionsDiagnostics: ts.notImplemented, + getGlobalDiagnostics: ts.notImplemented, + getSyntacticDiagnostics: ts.notImplemented, + getSemanticDiagnostics: ts.notImplemented, + emit: ts.notImplemented, + getAllDependencies: ts.notImplemented, + getCurrentDirectory: ts.notImplemented + }; + } + ts.createAbstractBuilder = createAbstractBuilder; +})(ts || (ts = {})); +/// +/* @internal */ +var ts; +(function (ts) { + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) { + if (!host.getDirectories || !host.readDirectory) { + return undefined; + } + var cachedReadDirectoryResult = ts.createMap(); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + fileExists: fileExists, + readFile: function (path, encoding) { return host.readFile(path, encoding); }, + directoryExists: host.directoryExists && directoryExists, + getDirectories: getDirectories, + readDirectory: readDirectory, + createDirectory: host.createDirectory && createDirectory, + writeFile: host.writeFile && writeFile, + addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, + addOrDeleteFile: addOrDeleteFile, + clearCache: clearCache + }; + function toPath(fileName) { + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getCachedFileSystemEntries(rootDirPath) { + return cachedReadDirectoryResult.get(rootDirPath); + } + function getCachedFileSystemEntriesForBaseDir(path) { + return getCachedFileSystemEntries(ts.getDirectoryPath(path)); + } + function getBaseNameOfFileName(fileName) { + return ts.getBaseFileName(ts.normalizePath(fileName)); + } + function createCachedFileSystemEntries(rootDir, rootDirPath) { + var resultFromHost = { + files: ts.map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [], + directories: host.getDirectories(rootDir) || [] + }; + cachedReadDirectoryResult.set(rootDirPath, resultFromHost); + return resultFromHost; + } + /** + * If the readDirectory result was already cached, it returns that + * Otherwise gets result from host and caches it. + * The host request is done under try catch block to avoid caching incorrect result + */ + function tryReadDirectory(rootDir, rootDirPath) { + var cachedResult = getCachedFileSystemEntries(rootDirPath); + if (cachedResult) { + return cachedResult; + } + try { + return createCachedFileSystemEntries(rootDir, rootDirPath); + } + catch (_e) { + // If there is exception to read directories, dont cache the result and direct the calls to host + ts.Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); + return undefined; + } + } + function fileNameEqual(name1, name2) { + return getCanonicalFileName(name1) === getCanonicalFileName(name2); + } + function hasEntry(entries, name) { + return ts.some(entries, function (file) { return fileNameEqual(file, name); }); + } + function updateFileSystemEntry(entries, baseName, isValid) { + if (hasEntry(entries, baseName)) { + if (!isValid) { + return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); + } + } + else if (isValid) { + return entries.push(baseName); + } + } + function writeFile(fileName, data, writeByteOrderMark) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + if (result) { + updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), /*fileExists*/ true); + } + return host.writeFile(fileName, data, writeByteOrderMark); + } + function fileExists(fileName) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || + host.fileExists(fileName); + } + function directoryExists(dirPath) { + var path = toPath(dirPath); + return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); + } + function createDirectory(dirPath) { + var path = toPath(dirPath); + var result = getCachedFileSystemEntriesForBaseDir(path); + var baseFileName = getBaseNameOfFileName(dirPath); + if (result) { + updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true); + } + host.createDirectory(dirPath); + } + function getDirectories(rootDir) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return result.directories.slice(); + } + return host.getDirectories(rootDir); + } + function readDirectory(rootDir, extensions, excludes, includes, depth) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries); + } + return host.readDirectory(rootDir, extensions, excludes, includes, depth); + function getFileSystemEntries(dir) { + var path = toPath(dir); + if (path === rootDirPath) { + return result; + } + return tryReadDirectory(dir, path) || ts.emptyFileSystemEntries; + } + } + function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { + var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); + if (existingResult) { + // Just clear the cache for now + // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated + clearCache(); + return undefined; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); + if (!parentResult) { + return undefined; + } + // This was earlier a file (hence not in cached directory contents) + // or we never cached the directory containing it + if (!host.directoryExists) { + // Since host doesnt support directory exists, clear the cache as otherwise it might not be same + clearCache(); + return undefined; + } + var baseName = getBaseNameOfFileName(fileOrDirectory); + var fsQueryResult = { + fileExists: host.fileExists(fileOrDirectoryPath), + directoryExists: host.directoryExists(fileOrDirectoryPath) + }; + if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { + // Folder added or removed, clear the cache instead of updating the folder and its structure + clearCache(); + } + else { + // No need to update the directory structure, just files + updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); + } + return fsQueryResult; + } + function addOrDeleteFile(fileName, filePath, eventKind) { + if (eventKind === ts.FileWatcherEventKind.Changed) { + return; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); + if (parentResult) { + updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); + } + } + function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { + updateFileSystemEntry(parentResult.files, baseName, fileExists); + } + function clearCache() { + cachedReadDirectoryResult.clear(); + } + } + ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + var ConfigFileProgramReloadLevel; + (function (ConfigFileProgramReloadLevel) { + ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["None"] = 0] = "None"; + /** Update the file name list from the disk */ + ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["Partial"] = 1] = "Partial"; + /** Reload completely by re-reading contents of config file from disk and updating program */ + ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["Full"] = 2] = "Full"; + })(ConfigFileProgramReloadLevel = ts.ConfigFileProgramReloadLevel || (ts.ConfigFileProgramReloadLevel = {})); + /** + * Updates the existing missing file watches with the new set of missing files after new program is created + */ + function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) { + var missingFilePaths = program.getMissingFilePaths(); + var newMissingFilePathMap = ts.arrayToSet(missingFilePaths); + // Update the missing file paths watcher + ts.mutateMap(missingFileWatches, newMissingFilePathMap, { + // Watch the missing files + createNewValue: createMissingFileWatch, + // Files that are no longer missing (e.g. because they are no longer required) + // should no longer be watched. + onDeleteValue: closeFileWatcher + }); + } + ts.updateMissingFilePathsWatch = updateMissingFilePathsWatch; + /** + * Updates the existing wild card directory watches with the new set of wild card directories from the config file + * after new program is created because the config file was reloaded or program was created first time from the config file + * Note that there is no need to call this function when the program is updated with additional files without reloading config files, + * as wildcard directories wont change unless reloading config file + */ + function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) { + ts.mutateMap(existingWatchedForWildcards, wildcardDirectories, { + // Create new watch and recursive info + createNewValue: createWildcardDirectoryWatcher, + // Close existing watch thats not needed any more + onDeleteValue: closeFileWatcherOf, + // Close existing watch that doesnt match in the flags + onExistingValue: updateWildcardDirectoryWatcher + }); + function createWildcardDirectoryWatcher(directory, flags) { + // Create new watch and recursive info + return { + watcher: watchDirectory(directory, flags), + flags: flags + }; + } + function updateWildcardDirectoryWatcher(existingWatcher, flags, directory) { + // Watcher needs to be updated if the recursive flags dont match + if (existingWatcher.flags === flags) { + return; + } + existingWatcher.watcher.close(); + existingWatchedForWildcards.set(directory, createWildcardDirectoryWatcher(directory, flags)); + } + } + ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories; + function isEmittedFileOfProgram(program, file) { + if (!program) { + return false; + } + return program.isEmittedFile(file); + } + ts.isEmittedFileOfProgram = isEmittedFileOfProgram; + function addFileWatcher(host, file, cb) { + return host.watchFile(file, cb); + } + ts.addFileWatcher = addFileWatcher; + function addFileWatcherWithLogging(host, file, cb, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb); + } + ts.addFileWatcherWithLogging = addFileWatcherWithLogging; + function addFileWatcherWithOnlyTriggerLogging(host, file, cb, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb); + } + ts.addFileWatcherWithOnlyTriggerLogging = addFileWatcherWithOnlyTriggerLogging; + function addFilePathWatcher(host, file, cb, path) { + return host.watchFile(file, function (fileName, eventKind) { return cb(fileName, eventKind, path); }); + } + ts.addFilePathWatcher = addFilePathWatcher; + function addFilePathWatcherWithLogging(host, file, cb, path, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb, path); + } + ts.addFilePathWatcherWithLogging = addFilePathWatcherWithLogging; + function addFilePathWatcherWithOnlyTriggerLogging(host, file, cb, path, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb, path); + } + ts.addFilePathWatcherWithOnlyTriggerLogging = addFilePathWatcherWithOnlyTriggerLogging; + function addDirectoryWatcher(host, directory, cb, flags) { + var recursive = (flags & 1 /* Recursive */) !== 0; + return host.watchDirectory(directory, cb, recursive); + } + ts.addDirectoryWatcher = addDirectoryWatcher; + function addDirectoryWatcherWithLogging(host, directory, cb, flags, log) { + var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; + return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, directory, cb, flags); + } + ts.addDirectoryWatcherWithLogging = addDirectoryWatcherWithLogging; + function addDirectoryWatcherWithOnlyTriggerLogging(host, directory, cb, flags, log) { + var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; + return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, directory, cb, flags); + } + ts.addDirectoryWatcherWithOnlyTriggerLogging = addDirectoryWatcherWithOnlyTriggerLogging; + function createWatcherWithLogging(addWatch, watcherCaption, log, logOnlyTrigger, host, file, cb, optional) { + var info = "PathInfo: " + file; + if (!logOnlyTrigger) { + log(watcherCaption + "Added: " + info); + } + var watcher = addWatch(host, file, function (fileName, cbOptional1) { + var optionalInfo = cbOptional1 !== undefined ? " " + cbOptional1 : ""; + log(watcherCaption + "Trigger: " + fileName + optionalInfo + " " + info); + var start = ts.timestamp(); + cb(fileName, cbOptional1, optional); + var elapsed = ts.timestamp() - start; + log(watcherCaption + "Elapsed: " + elapsed + "ms Trigger: " + fileName + optionalInfo + " " + info); + }, optional); + return { + close: function () { + if (!logOnlyTrigger) { + log(watcherCaption + "Close: " + info); + } + watcher.close(); + } + }; + } + function closeFileWatcher(watcher) { + watcher.close(); + } + ts.closeFileWatcher = closeFileWatcher; + function closeFileWatcherOf(objWithWatcher) { + objWithWatcher.watcher.close(); + } + ts.closeFileWatcherOf = closeFileWatcherOf; +})(ts || (ts = {})); +/// +/// +/// +/*@internal*/ +var ts; +(function (ts) { + ts.maxNumberOfFilesToIterateForInvalidation = 256; + function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { + var filesWithChangedSetOfUnresolvedImports; + var filesWithInvalidatedResolutions; + var allFilesHaveInvalidatedResolution = false; + // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. + // The key in the map is source file's path. + // The values are Map of resolutions with key being name lookedup. + var resolvedModuleNames = ts.createMap(); + var perDirectoryResolvedModuleNames = ts.createMap(); + var resolvedTypeReferenceDirectives = ts.createMap(); + var perDirectoryResolvedTypeReferenceDirectives = ts.createMap(); + var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); + /** + * These are the extensions that failed lookup files will have by default, + * any other extension of failed lookup will be store that path in custom failed lookup path + * This helps in not having to comb through all resolutions when files are added/removed + * Note that .d.ts file also has .d.ts extension hence will be part of default extensions + */ + var failedLookupDefaultExtensions = [".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */]; + var customFailedLookupPaths = ts.createMap(); + var directoryWatchesOfFailedLookups = ts.createMap(); + var rootDir = rootDirForResolution && ts.removeTrailingDirectorySeparator(ts.getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory())); + var rootPath = rootDir && resolutionHost.toPath(rootDir); + // TypeRoot watches for the types that get added as part of getAutomaticTypeDirectiveNames + var typeRootsWatches = ts.createMap(); + return { + startRecordingFilesWithChangedResolutions: startRecordingFilesWithChangedResolutions, + finishRecordingFilesWithChangedResolutions: finishRecordingFilesWithChangedResolutions, + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + startCachingPerDirectoryResolution: clearPerDirectoryResolutions, + finishCachingPerDirectoryResolution: finishCachingPerDirectoryResolution, + resolveModuleNames: resolveModuleNames, + resolveTypeReferenceDirectives: resolveTypeReferenceDirectives, + removeResolutionsOfFile: removeResolutionsOfFile, + invalidateResolutionOfFile: invalidateResolutionOfFile, + createHasInvalidatedResolution: createHasInvalidatedResolution, + updateTypeRootsWatch: updateTypeRootsWatch, + closeTypeRootsWatch: closeTypeRootsWatch, + clear: clear + }; + function getResolvedModule(resolution) { + return resolution.resolvedModule; + } + function getResolvedTypeReferenceDirective(resolution) { + return resolution.resolvedTypeReferenceDirective; + } + function isInDirectoryPath(dir, file) { + if (dir === undefined || file.length <= dir.length) { + return false; + } + return ts.startsWith(file, dir) && file[dir.length] === ts.directorySeparator; + } + function clear() { + ts.clearMap(directoryWatchesOfFailedLookups, ts.closeFileWatcherOf); + customFailedLookupPaths.clear(); + closeTypeRootsWatch(); + resolvedModuleNames.clear(); + resolvedTypeReferenceDirectives.clear(); + allFilesHaveInvalidatedResolution = false; + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + clearPerDirectoryResolutions(); + } + function startRecordingFilesWithChangedResolutions() { + filesWithChangedSetOfUnresolvedImports = []; + } + function finishRecordingFilesWithChangedResolutions() { + var collected = filesWithChangedSetOfUnresolvedImports; + filesWithChangedSetOfUnresolvedImports = undefined; + return collected; + } + function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { + if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + // Any file asked would have invalidated resolution + filesWithInvalidatedResolutions = undefined; + return ts.returnTrue; + } + var collected = filesWithInvalidatedResolutions; + filesWithInvalidatedResolutions = undefined; + return function (path) { return collected && collected.has(path); }; + } + function clearPerDirectoryResolutions() { + perDirectoryResolvedModuleNames.clear(); + perDirectoryResolvedTypeReferenceDirectives.clear(); + } + function finishCachingPerDirectoryResolution() { + allFilesHaveInvalidatedResolution = false; + directoryWatchesOfFailedLookups.forEach(function (watcher, path) { + if (watcher.refCount === 0) { + directoryWatchesOfFailedLookups.delete(path); + watcher.watcher.close(); + } + }); + clearPerDirectoryResolutions(); + } + function resolveModuleName(moduleName, containingFile, compilerOptions, host) { + var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); + // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts + if (!resolutionHost.getGlobalCache) { + return primaryResult; + } + // otherwise try to load typings from @types + var globalCache = resolutionHost.getGlobalCache(); + if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTypeScript(primaryResult.resolvedModule.extension))) { + // create different collection of failed lookup locations for second pass + // if it will fail and we've already found something during the first pass - we don't want to pollute its results + var _a = ts.loadModuleFromGlobalCache(moduleName, resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + if (resolvedModule) { + return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + } + } + // Default return the result from the first pass + return primaryResult; + } + function resolveNamesWithLocalCache(names, containingFile, cache, perDirectoryCache, loader, getResolutionWithResolvedFileName, reusedNames, logChanges) { + var path = resolutionHost.toPath(containingFile); + var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); + var dirPath = ts.getDirectoryPath(path); + var perDirectoryResolution = perDirectoryCache.get(dirPath); + if (!perDirectoryResolution) { + perDirectoryResolution = ts.createMap(); + perDirectoryCache.set(dirPath, perDirectoryResolution); + } + var resolvedModules = []; + var compilerOptions = resolutionHost.getCompilationSettings(); + var seenNamesInFile = ts.createMap(); + for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { + var name = names_2[_i]; + var resolution = resolutionsInFile.get(name); + // Resolution is valid if it is present and not invalidated + if (!seenNamesInFile.has(name) && + allFilesHaveInvalidatedResolution || !resolution || resolution.isInvalidated) { + var existingResolution = resolution; + var resolutionInDirectory = perDirectoryResolution.get(name); + if (resolutionInDirectory) { + resolution = resolutionInDirectory; + } + else { + resolution = loader(name, containingFile, compilerOptions, resolutionHost); + perDirectoryResolution.set(name, resolution); + } + resolutionsInFile.set(name, resolution); + if (resolution.failedLookupLocations) { + if (existingResolution && existingResolution.failedLookupLocations) { + watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution); + } + else { + watchFailedLookupLocationOfResolution(resolution, 0); + } + } + else if (existingResolution) { + stopWatchFailedLookupLocationOfResolution(existingResolution); + } + if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { + filesWithChangedSetOfUnresolvedImports.push(path); + // reset log changes to avoid recording the same file multiple times + logChanges = false; + } + } + ts.Debug.assert(resolution !== undefined && !resolution.isInvalidated); + seenNamesInFile.set(name, true); + resolvedModules.push(getResolutionWithResolvedFileName(resolution)); + } + // Stop watching and remove the unused name + resolutionsInFile.forEach(function (resolution, name) { + if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { + stopWatchFailedLookupLocationOfResolution(resolution); + resolutionsInFile.delete(name); + } + }); + return resolvedModules; + function resolutionIsEqualTo(oldResolution, newResolution) { + if (oldResolution === newResolution) { + return true; + } + if (!oldResolution || !newResolution || oldResolution.isInvalidated) { + return false; + } + var oldResult = getResolutionWithResolvedFileName(oldResolution); + var newResult = getResolutionWithResolvedFileName(newResolution); + if (oldResult === newResult) { + return true; + } + if (!oldResult || !newResult) { + return false; + } + return oldResult.resolvedFileName === newResult.resolvedFileName; + } + } + function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile) { + return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, + /*reusedNames*/ undefined, /*logChanges*/ false); + } + function resolveModuleNames(moduleNames, containingFile, reusedNames) { + return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChangesWhenResolvingModule); + } + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + function isNodeModulesAtTypesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules/@types"); + } + function isDirectoryAtleastAtLevelFromFSRoot(dirPath, minLevels) { + for (var searchIndex = ts.getRootLength(dirPath); minLevels > 0; minLevels--) { + searchIndex = dirPath.indexOf(ts.directorySeparator, searchIndex) + 1; + if (searchIndex === 0) { + // Folder isnt at expected minimun levels + return false; + } + } + return true; + } + function canWatchDirectory(dirPath) { + return isDirectoryAtleastAtLevelFromFSRoot(dirPath, + // When root is "/" do not watch directories like: + // "/", "/user", "/user/username", "/user/username/folderAtRoot" + // When root is "c:/" do not watch directories like: + // "c:/", "c:/folderAtRoot" + dirPath.charCodeAt(0) === 47 /* slash */ ? 3 : 1); + } + function filterFSRootDirectoriesToWatch(watchPath, dirPath) { + if (!canWatchDirectory(dirPath)) { + watchPath.ignore = true; + } + return watchPath; + } + function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) { + if (isInDirectoryPath(rootPath, failedLookupLocationPath)) { + return { dir: rootDir, dirPath: rootPath }; + } + var dir = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())); + var dirPath = ts.getDirectoryPath(failedLookupLocationPath); + // If directory path contains node module, get the most parent node_modules directory for watching + while (ts.stringContains(dirPath, "/node_modules/")) { + dir = ts.getDirectoryPath(dir); + dirPath = ts.getDirectoryPath(dirPath); + } + // If the directory is node_modules use it to watch + if (isNodeModulesDirectory(dirPath)) { + return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, ts.getDirectoryPath(dirPath)); + } + // Use some ancestor of the root directory + if (rootPath !== undefined) { + while (!isInDirectoryPath(dirPath, rootPath)) { + var parentPath = ts.getDirectoryPath(dirPath); + if (parentPath === dirPath) { + break; + } + dirPath = parentPath; + dir = ts.getDirectoryPath(dir); + } + } + return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, dirPath); + } + function isPathWithDefaultFailedLookupExtension(path) { + return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); + } + function watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution) { + var failedLookupLocations = resolution.failedLookupLocations; + var existingFailedLookupLocations = existingResolution.failedLookupLocations; + for (var index = 0; index < failedLookupLocations.length; index++) { + if (index === existingFailedLookupLocations.length) { + // Additional failed lookup locations, watch from this index + watchFailedLookupLocationOfResolution(resolution, index); + return; + } + else if (failedLookupLocations[index] !== existingFailedLookupLocations[index]) { + // Different failed lookup locations, + // Watch new resolution failed lookup locations from this index and + // stop watching existing resolutions from this index + watchFailedLookupLocationOfResolution(resolution, index); + stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, index); + return; + } + } + // All new failed lookup locations are already watched (and are same), + // Stop watching failed lookup locations of existing resolution after failed lookup locations length + stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, failedLookupLocations.length); + } + function watchFailedLookupLocationOfResolution(_a, startIndex) { + var failedLookupLocations = _a.failedLookupLocations; + for (var i = startIndex; i < failedLookupLocations.length; i++) { + var failedLookupLocation = failedLookupLocations[i]; + var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + // If the failed lookup location path is not one of the supported extensions, + // store it in the custom path + if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { + var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; + customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); + } + var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _b.dir, dirPath = _b.dirPath, ignore = _b.ignore; + if (!ignore) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + if (dirWatcher) { + dirWatcher.refCount++; + } + else { + directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); + } + } + } + } + function stopWatchFailedLookupLocationOfResolution(resolution) { + if (resolution.failedLookupLocations) { + stopWatchFailedLookupLocationOfResolutionFrom(resolution, 0); + } + } + function stopWatchFailedLookupLocationOfResolutionFrom(_a, startIndex) { + var failedLookupLocations = _a.failedLookupLocations; + for (var i = startIndex; i < failedLookupLocations.length; i++) { + var failedLookupLocation = failedLookupLocations[i]; + var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + var refCount = customFailedLookupPaths.get(failedLookupLocationPath); + if (refCount) { + if (refCount === 1) { + customFailedLookupPaths.delete(failedLookupLocationPath); + } + else { + ts.Debug.assert(refCount > 1); + customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + } + } + var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _b.dirPath, ignore = _b.ignore; + if (!ignore) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + // Do not close the watcher yet since it might be needed by other failed lookup locations. + dirWatcher.refCount--; + } + } + } + function createDirectoryWatcher(directory, dirPath) { + return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) { + var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + // Since the file existance changed, update the sourceFiles cache + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + // If the files are added to project root or node_modules directory, always run through the invalidation process + // Otherwise run through invalidation only if adding to the immediate directory + if (!allFilesHaveInvalidatedResolution && + dirPath === rootPath || isNodeModulesDirectory(dirPath) || ts.getDirectoryPath(fileOrDirectoryPath) === dirPath) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + resolutionHost.onInvalidatedResolution(); + } + } + }, 1 /* Recursive */); + } + function removeResolutionsOfFileFromCache(cache, filePath) { + // Deleted file, stop watching failed lookups for all the resolutions in the file + var resolutions = cache.get(filePath); + if (resolutions) { + resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + cache.delete(filePath); + } + } + function removeResolutionsOfFile(filePath) { + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); + } + function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { + var seen = ts.createMap(); + cache.forEach(function (resolutions, containingFilePath) { + var dirPath = ts.getDirectoryPath(containingFilePath); + var seenInDir = seen.get(dirPath); + if (!seenInDir) { + seenInDir = ts.createMap(); + seen.set(dirPath, seenInDir); + } + resolutions.forEach(function (resolution, name) { + if (seenInDir.has(name)) { + return; + } + seenInDir.set(name, true); + if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { + // Mark the file as needing re-evaluation of module resolution instead of using it blindly. + resolution.isInvalidated = true; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + } + }); + }); + } + function hasReachedResolutionIterationLimit() { + var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; + return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; + } + function invalidateResolutions(isInvalidatedResolution) { + // If more than maxNumberOfFilesToIterateForInvalidation present, + // just invalidated all files and recalculate the resolutions for files instead + if (hasReachedResolutionIterationLimit()) { + allFilesHaveInvalidatedResolution = true; + return; + } + invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); + invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); + } + function invalidateResolutionOfFile(filePath) { + removeResolutionsOfFile(filePath); + invalidateResolutions( + // Resolution is invalidated if the resulting file name is same as the deleted file path + function (resolution, getResolutionWithResolvedFileName) { + var result = getResolutionWithResolvedFileName(resolution); + return result && resolutionHost.toPath(result.resolvedFileName) === filePath; + }); + } + function invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, isCreatingWatchedDirectory) { + var isChangedFailedLookupLocation; + if (isCreatingWatchedDirectory) { + // Watching directory is created + // Invalidate any resolution has failed lookup in this directory + isChangedFailedLookupLocation = function (location) { return isInDirectoryPath(fileOrDirectoryPath, resolutionHost.toPath(location)); }; + } + else { + // Some file or directory in the watching directory is created + // Return early if it does not have any of the watching extension or not the custom failed lookup path + var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); + if (isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + // Invalidate any resolution from this directory + isChangedFailedLookupLocation = function (location) { + var locationPath = resolutionHost.toPath(location); + return locationPath === fileOrDirectoryPath || ts.startsWith(resolutionHost.toPath(location), fileOrDirectoryPath); + }; + } + else { + if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) { + return false; + } + // Ignore emits from the program + if (ts.isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { + return false; + } + // Resolution need to be invalidated if failed lookup location is same as the file or directory getting created + isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; + } + } + var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; + var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; + invalidateResolutions( + // Resolution is invalidated if the resulting file name is same as the deleted file path + hasChangedFailedLookupLocation); + return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + } + function closeTypeRootsWatch() { + ts.clearMap(typeRootsWatches, ts.closeFileWatcher); + } + function createTypeRootsWatch(_typeRootPath, typeRoot) { + // Create new watch and recursive info + return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) { + var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + // Since the file existance changed, update the sourceFiles cache + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + // For now just recompile + // We could potentially store more data here about whether it was/would be really be used or not + // and with that determine to trigger compilation but for now this is enough + resolutionHost.onChangedAutomaticTypeDirectiveNames(); + }, 1 /* Recursive */); + } + /** + * Watches the types that would get added as part of getAutomaticTypeDirectiveNames + * To be called when compiler options change + */ + function updateTypeRootsWatch() { + var options = resolutionHost.getCompilationSettings(); + if (options.types) { + // No need to do any watch since resolution cache is going to handle the failed lookups + // for the types added by this + closeTypeRootsWatch(); + return; + } + // we need to assume the directories exist to ensure that we can get all the type root directories that get included + // But filter directories that are at root level to say directory doesnt exist, so that we arent watching them + var typeRoots = ts.getEffectiveTypeRoots(options, { directoryExists: directoryExistsForTypeRootWatch, getCurrentDirectory: getCurrentDirectory }); + if (typeRoots) { + ts.mutateMap(typeRootsWatches, ts.arrayToMap(typeRoots, function (tr) { return resolutionHost.toPath(tr); }), { + createNewValue: createTypeRootsWatch, + onDeleteValue: ts.closeFileWatcher + }); + } + else { + closeTypeRootsWatch(); + } + } + /** + * Use this function to return if directory exists to get type roots to watch + * If we return directory exists then only the paths will be added to type roots + * Hence return true for all directories except root directories which are filtered from watching + */ + function directoryExistsForTypeRootWatch(nodeTypesDirectory) { + var dir = ts.getDirectoryPath(ts.getDirectoryPath(nodeTypesDirectory)); + var dirPath = resolutionHost.toPath(dir); + return dirPath === rootPath || canWatchDirectory(dirPath); + } + } + ts.createResolutionCache = createResolutionCache; +})(ts || (ts = {})); +/// +/// +/// +/*@internal*/ +var ts; +(function (ts) { + var sysFormatDiagnosticsHost = ts.sys ? { + getCurrentDirectory: function () { return ts.sys.getCurrentDirectory(); }, + getNewLine: function () { return ts.sys.newLine; }, + getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames) + } : undefined; + /** + * Create a function that reports error by writing to the system and handles the formating of the diagnostic + */ + function createDiagnosticReporter(system, pretty) { + var host = system === ts.sys ? sysFormatDiagnosticsHost : { + getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getNewLine: function () { return system.newLine; }, + getCanonicalFileName: ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames), + }; + if (!pretty) { + return function (diagnostic) { return system.write(ts.formatDiagnostic(diagnostic, host)); }; + } + var diagnostics = new Array(1); + return function (diagnostic) { + diagnostics[0] = diagnostic; + system.write(ts.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine()); + diagnostics[0] = undefined; + }; + } + ts.createDiagnosticReporter = createDiagnosticReporter; + function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { + if (system.clearScreen && + diagnostic.code !== ts.Diagnostics.Compilation_complete_Watching_for_file_changes.code && + !options.extendedDiagnostics && + !options.diagnostics) { + system.clearScreen(); + } + } + /** + * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic + */ + function createWatchStatusReporter(system, pretty) { + return pretty ? + function (diagnostic, newLine, options) { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + var output = "[" + ts.formatColorAndReset(new Date().toLocaleTimeString(), ts.ForegroundColorEscapeSequences.Grey) + "] "; + output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine + newLine); + system.write(output); + } : + function (diagnostic, newLine, options) { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + var output = new Date().toLocaleTimeString() + " - "; + output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine + newLine); + system.write(output); + }; + } + ts.createWatchStatusReporter = createWatchStatusReporter; + /** Parses config file using System interface */ + function parseConfigFileWithSystem(configFileName, optionsToExtend, system, reportDiagnostic) { + var host = system; + host.onConfigFileDiagnostic = reportDiagnostic; + host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(ts.sys, reportDiagnostic, diagnostic); }; + var result = getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host); + host.onConfigFileDiagnostic = undefined; + host.onUnRecoverableConfigFileDiagnostic = undefined; + return result; + } + ts.parseConfigFileWithSystem = parseConfigFileWithSystem; + /** + * Reads the config file, reports errors if any and exits if the config file cannot be found + */ + function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) { + var configFileText; + try { + configFileText = host.readFile(configFileName); + } + catch (e) { + var error = ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, configFileName, e.message); + host.onUnRecoverableConfigFileDiagnostic(error); + return undefined; + } + if (!configFileText) { + var error = ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, configFileName); + host.onUnRecoverableConfigFileDiagnostic(error); + return undefined; + } + var result = ts.parseJsonText(configFileName, configFileText); + result.parseDiagnostics.forEach(function (diagnostic) { return host.onConfigFileDiagnostic(diagnostic); }); + var cwd = host.getCurrentDirectory(); + var configParseResult = ts.parseJsonSourceFileConfigFileContent(result, host, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd)); + configParseResult.errors.forEach(function (diagnostic) { return host.onConfigFileDiagnostic(diagnostic); }); + return configParseResult; + } + ts.getParsedCommandLineOfConfigFile = getParsedCommandLineOfConfigFile; + /** + * Helper that emit files, report diagnostics and lists emitted and/or source files depending on compiler options + */ + function emitFilesAndReportErrors(program, reportDiagnostic, writeFileName) { + // First get and report any syntactic errors. + var diagnostics = program.getSyntacticDiagnostics().slice(); + var reportSemanticDiagnostics = false; + // If we didn't have any syntactic errors, then also try getting the global and + // semantic errors. + if (diagnostics.length === 0) { + ts.addRange(diagnostics, program.getOptionsDiagnostics()); + ts.addRange(diagnostics, program.getGlobalDiagnostics()); + if (diagnostics.length === 0) { + reportSemanticDiagnostics = true; + } + } + // Emit and report any errors we ran into. + var _a = program.emit(), emittedFiles = _a.emittedFiles, emitSkipped = _a.emitSkipped, emitDiagnostics = _a.diagnostics; + ts.addRange(diagnostics, emitDiagnostics); + if (reportSemanticDiagnostics) { + ts.addRange(diagnostics, program.getSemanticDiagnostics()); + } + ts.sortAndDeduplicateDiagnostics(diagnostics).forEach(reportDiagnostic); + if (writeFileName) { + var currentDir_1 = program.getCurrentDirectory(); + ts.forEach(emittedFiles, function (file) { + var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1); + writeFileName("TSFILE: " + filepath); + }); + if (program.getCompilerOptions().listFiles) { + ts.forEach(program.getSourceFiles(), function (file) { + writeFileName(file.fileName); + }); + } + } + if (emitSkipped && diagnostics.length > 0) { + // If the emitter didn't emit anything, then pass that value along. + return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped; + } + else if (diagnostics.length > 0) { + // The emitter emitted something, inform the caller if that happened in the presence + // of diagnostics or not. + return ts.ExitStatus.DiagnosticsPresent_OutputsGenerated; + } + return ts.ExitStatus.Success; + } + ts.emitFilesAndReportErrors = emitFilesAndReportErrors; + var noopFileWatcher = { close: ts.noop }; + /** + * Creates the watch compiler host that can be extended with config file or root file names and options host + */ + function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { + if (system === void 0) { system = ts.sys; } + if (!createProgram) { + createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram; + } + var host = system; + var useCaseSensitiveFileNames = function () { return system.useCaseSensitiveFileNames; }; + var writeFileName = function (s) { return system.write(s + system.newLine); }; + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + getNewLine: function () { return system.newLine; }, + getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getDefaultLibLocation: getDefaultLibLocation, + getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); }, + fileExists: function (path) { return system.fileExists(path); }, + readFile: function (path, encoding) { return system.readFile(path, encoding); }, + directoryExists: function (path) { return system.directoryExists(path); }, + getDirectories: function (path) { return system.getDirectories(path); }, + readDirectory: function (path, extensions, exclude, include, depth) { return system.readDirectory(path, extensions, exclude, include, depth); }, + realpath: system.realpath && (function (path) { return system.realpath(path); }), + getEnvironmentVariable: system.getEnvironmentVariable && (function (name) { return system.getEnvironmentVariable(name); }), + watchFile: system.watchFile ? (function (path, callback, pollingInterval) { return system.watchFile(path, callback, pollingInterval); }) : function () { return noopFileWatcher; }, + watchDirectory: system.watchDirectory ? (function (path, callback, recursive) { return system.watchDirectory(path, callback, recursive); }) : function () { return noopFileWatcher; }, + setTimeout: system.setTimeout ? (function (callback, ms) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return (_a = system.setTimeout).call.apply(_a, [system, callback, ms].concat(args)); + var _a; + }) : ts.noop, + clearTimeout: system.clearTimeout ? (function (timeoutId) { return system.clearTimeout(timeoutId); }) : ts.noop, + trace: function (s) { return system.write(s); }, + onWatchStatusChange: reportWatchStatus || createWatchStatusReporter(system), + createDirectory: function (path) { return system.createDirectory(path); }, + writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, + onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, + createHash: system.createHash && (function (s) { return system.createHash(s); }), + createProgram: createProgram, + afterProgramCreate: emitFilesAndReportErrorUsingBuilder + }; + function getDefaultLibLocation() { + return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); + } + function emitFilesAndReportErrorUsingBuilder(builderProgram) { + emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName); + } + } + /** + * Report error and exit + */ + function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) { + reportDiagnostic(diagnostic); + system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); + } + /** + * Creates the watch compiler host from system for config file in watch mode + */ + function createWatchCompilerHostOfConfigFile(configFileName, optionsToExtend, system, createProgram, reportDiagnostic, reportWatchStatus) { + reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system); + var host = createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus); + host.onConfigFileDiagnostic = reportDiagnostic; + host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); }; + host.configFileName = configFileName; + host.optionsToExtend = optionsToExtend; + return host; + } + ts.createWatchCompilerHostOfConfigFile = createWatchCompilerHostOfConfigFile; + /** + * Creates the watch compiler host from system for compiling root files and options in watch mode + */ + function createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, system, createProgram, reportDiagnostic, reportWatchStatus) { + var host = createWatchCompilerHost(system, createProgram, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus); + host.rootFiles = rootFiles; + host.options = options; + return host; + } + ts.createWatchCompilerHostOfFilesAndCompilerOptions = createWatchCompilerHostOfFilesAndCompilerOptions; +})(ts || (ts = {})); +(function (ts) { + function createWatchCompilerHost(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus) { + if (ts.isArray(rootFilesOrConfigFileName)) { + return ts.createWatchCompilerHostOfFilesAndCompilerOptions(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus); + } + else { + return ts.createWatchCompilerHostOfConfigFile(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus); + } + } + ts.createWatchCompilerHost = createWatchCompilerHost; + var initialVersion = 1; + function createWatchProgram(host) { + var builderProgram; + var reloadLevel; // level to indicate if the program needs to be reloaded from config file/just filenames etc + var missingFilesMap; // Map of file watchers for the missing files + var watchedWildcardDirectories; // map of watchers for the wild card directories in the config file + var timerToUpdateProgram; // timer callback to recompile the program + var sourceFilesCache = ts.createMap(); // Cache that stores the source file and version info + var missingFilePathsRequestedForRelease; // These paths are held temparirly so that we can remove the entry from source file cache if the file is not tracked by missing files + var hasChangedCompilerOptions = false; // True if the compiler options have changed between compilations + var hasChangedAutomaticTypeDirectiveNames = false; // True if the automatic type directives have changed + var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + var currentDirectory = host.getCurrentDirectory(); + var getCurrentDirectory = function () { return currentDirectory; }; + var readFile = function (path, encoding) { return host.readFile(path, encoding); }; + var configFileName = host.configFileName, _a = host.optionsToExtend, optionsToExtendForConfigFile = _a === void 0 ? {} : _a, createProgram = host.createProgram; + var rootFileNames = host.rootFiles, compilerOptions = host.options, configFileSpecs = host.configFileSpecs, configFileWildCardDirectories = host.configFileWildCardDirectories; + var cachedDirectoryStructureHost = configFileName && ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); + if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { + host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); + } + var directoryStructureHost = cachedDirectoryStructureHost || host; + var parseConfigFileHost = { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + readDirectory: function (path, extensions, exclude, include, depth) { return directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }, + fileExists: function (path) { return host.fileExists(path); }, + readFile: readFile, + getCurrentDirectory: getCurrentDirectory, + onConfigFileDiagnostic: host.onConfigFileDiagnostic, + onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic + }; + // From tsc we want to get already parsed result and hence check for rootFileNames + if (configFileName && !rootFileNames) { + parseConfigFile(); + } + var trace = host.trace && (function (s) { host.trace(s + newLine); }); + var loggingEnabled = trace && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); + var writeLog = loggingEnabled ? trace : ts.noop; + var watchFile = compilerOptions.extendedDiagnostics ? ts.addFileWatcherWithLogging : loggingEnabled ? ts.addFileWatcherWithOnlyTriggerLogging : ts.addFileWatcher; + var watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; + var watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + var newLine = updateNewLine(); + writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames); + if (configFileName) { + watchFile(host, configFileName, scheduleProgramReload, writeLog); + } + var compilerHost = { + // Members for CompilerHost + getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { return getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile); }, + getSourceFileByPath: getVersionedSourceFileByPath, + getDefaultLibLocation: host.getDefaultLibLocation && (function () { return host.getDefaultLibLocation(); }), + getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, + writeFile: writeFile, + getCurrentDirectory: getCurrentDirectory, + useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, + getCanonicalFileName: getCanonicalFileName, + getNewLine: function () { return newLine; }, + fileExists: fileExists, + readFile: readFile, + trace: trace, + directoryExists: directoryStructureHost.directoryExists && (function (path) { return directoryStructureHost.directoryExists(path); }), + getDirectories: directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); }), + realpath: host.realpath && (function (s) { return host.realpath(s); }), + getEnvironmentVariable: host.getEnvironmentVariable ? (function (name) { return host.getEnvironmentVariable(name); }) : (function () { return ""; }), + onReleaseOldSourceFile: onReleaseOldSourceFile, + createHash: host.createHash && (function (data) { return host.createHash(data); }), + // Members for ResolutionCacheHost + toPath: toPath, + getCompilationSettings: function () { return compilerOptions; }, + watchDirectoryOfFailedLookupLocation: watchDirectory, + watchTypeRootsDirectory: watchDirectory, + getCachedDirectoryStructureHost: function () { return cachedDirectoryStructureHost; }, + onInvalidatedResolution: scheduleProgramUpdate, + onChangedAutomaticTypeDirectiveNames: function () { + hasChangedAutomaticTypeDirectiveNames = true; + scheduleProgramUpdate(); + }, + maxNumberOfFilesToIterateForInvalidation: host.maxNumberOfFilesToIterateForInvalidation, + getCurrentProgram: getCurrentProgram, + writeLog: writeLog + }; + // Cache for the module resolution + var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ? + ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) : + currentDirectory, + /*logChangesWhenResolvingModule*/ false); + // Resolve module using host module resolution strategy if provided otherwise use resolution cache to resolve module names + compilerHost.resolveModuleNames = host.resolveModuleNames ? + (function (moduleNames, containingFile, reusedNames) { return host.resolveModuleNames(moduleNames, containingFile, reusedNames); }) : + (function (moduleNames, containingFile, reusedNames) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames); }); + compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ? + (function (typeDirectiveNames, containingFile) { return host.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }) : + (function (typeDirectiveNames, containingFile) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }); + var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives; + reportWatchDiagnostic(ts.Diagnostics.Starting_compilation_in_watch_mode); + synchronizeProgram(); + // Update the wild card directory watch + watchConfigFileWildCardDirectories(); + return configFileName ? + { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames }; + function getCurrentBuilderProgram() { + return builderProgram; + } + function getCurrentProgram() { + return builderProgram && builderProgram.getProgram(); + } + function synchronizeProgram() { + writeLog("Synchronizing program"); + var program = getCurrentProgram(); + if (hasChangedCompilerOptions) { + newLine = updateNewLine(); + if (program && ts.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { + resolutionCache.clear(); + } + } + // All resolutions are invalid if user provided resolutions + var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution); + if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames)) { + return builderProgram; + } + // Compile the program + if (loggingEnabled) { + writeLog("CreatingProgramWith::"); + writeLog(" roots: " + JSON.stringify(rootFileNames)); + writeLog(" options: " + JSON.stringify(compilerOptions)); + } + var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; + hasChangedCompilerOptions = false; + resolutionCache.startCachingPerDirectoryResolution(); + compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; + compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram); + resolutionCache.finishCachingPerDirectoryResolution(); + // Update watches + ts.updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = ts.createMap()), watchMissingFilePath); + if (needsUpdateInTypeRootWatch) { + resolutionCache.updateTypeRootsWatch(); + } + if (missingFilePathsRequestedForRelease) { + // These are the paths that program creater told us as not in use any more but were missing on the disk. + // We didnt remove the entry for them from sourceFiles cache so that we dont have to do File IO, + // if there is already watcher for it (for missing files) + // At this point our watches were updated, hence now we know that these paths are not tracked and need to be removed + // so that at later time we have correct result of their presence + for (var _i = 0, missingFilePathsRequestedForRelease_1 = missingFilePathsRequestedForRelease; _i < missingFilePathsRequestedForRelease_1.length; _i++) { + var missingFilePath = missingFilePathsRequestedForRelease_1[_i]; + if (!missingFilesMap.has(missingFilePath)) { + sourceFilesCache.delete(missingFilePath); + } + } + missingFilePathsRequestedForRelease = undefined; + } + if (host.afterProgramCreate) { + host.afterProgramCreate(builderProgram); + } + reportWatchDiagnostic(ts.Diagnostics.Compilation_complete_Watching_for_file_changes); + return builderProgram; + } + function updateRootFileNames(files) { + ts.Debug.assert(!configFileName, "Cannot update root file names with config file watch mode"); + rootFileNames = files; + scheduleProgramUpdate(); + } + function updateNewLine() { + return ts.getNewLineCharacter(compilerOptions, function () { return host.getNewLine(); }); + } + function toPath(fileName) { + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function isFileMissingOnHost(hostSourceFile) { + return typeof hostSourceFile === "number"; + } + function isFilePresentOnHost(hostSourceFile) { + return !!hostSourceFile.sourceFile; + } + function fileExists(fileName) { + var path = toPath(fileName); + // If file is missing on host from cache, we can definitely say file doesnt exist + // otherwise we need to ensure from the disk + if (isFileMissingOnHost(sourceFilesCache.get(path))) { + return true; + } + return directoryStructureHost.fileExists(fileName); + } + function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) { + var hostSourceFile = sourceFilesCache.get(path); + // No source file on the host + if (isFileMissingOnHost(hostSourceFile)) { + return undefined; + } + // Create new source file if requested or the versions dont match + if (!hostSourceFile || shouldCreateNewSourceFile || !isFilePresentOnHost(hostSourceFile) || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { + var sourceFile = getNewSourceFile(); + if (hostSourceFile) { + if (shouldCreateNewSourceFile) { + hostSourceFile.version++; + } + if (sourceFile) { + // Set the source file and create file watcher now that file was present on the disk + hostSourceFile.sourceFile = sourceFile; + sourceFile.version = hostSourceFile.version.toString(); + if (!hostSourceFile.fileWatcher) { + hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); + } + } + else { + // There is no source file on host any more, close the watch, missing file paths will track it + if (isFilePresentOnHost(hostSourceFile)) { + hostSourceFile.fileWatcher.close(); + } + sourceFilesCache.set(path, hostSourceFile.version); + } + } + else { + if (sourceFile) { + sourceFile.version = initialVersion.toString(); + var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); + sourceFilesCache.set(path, { sourceFile: sourceFile, version: initialVersion, fileWatcher: fileWatcher }); + } + else { + sourceFilesCache.set(path, initialVersion); + } + } + return sourceFile; + } + return hostSourceFile.sourceFile; + function getNewSourceFile() { + var text; + try { + ts.performance.mark("beforeIORead"); + text = host.readFile(fileName, compilerOptions.charset); + ts.performance.mark("afterIORead"); + ts.performance.measure("I/O Read", "beforeIORead", "afterIORead"); + } + catch (e) { + if (onError) { + onError(e.message); + } + } + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + } + } + function nextSourceFileVersion(path) { + var hostSourceFile = sourceFilesCache.get(path); + if (hostSourceFile !== undefined) { + if (isFileMissingOnHost(hostSourceFile)) { + // The next version, lets set it as presence unknown file + sourceFilesCache.set(path, { version: Number(hostSourceFile) + 1 }); + } + else { + hostSourceFile.version++; + } + } + } + function getSourceVersion(path) { + var hostSourceFile = sourceFilesCache.get(path); + return !hostSourceFile || isFileMissingOnHost(hostSourceFile) ? undefined : hostSourceFile.version.toString(); + } + function onReleaseOldSourceFile(oldSourceFile, _oldOptions) { + var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.path); + // If this is the source file thats in the cache and new program doesnt need it, + // remove the cached entry. + // Note we arent deleting entry if file became missing in new program or + // there was version update and new source file was created. + if (hostSourceFileInfo) { + // record the missing file paths so they can be removed later if watchers arent tracking them + if (isFileMissingOnHost(hostSourceFileInfo)) { + (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); + } + else if (hostSourceFileInfo.sourceFile === oldSourceFile) { + sourceFilesCache.delete(oldSourceFile.path); + resolutionCache.removeResolutionsOfFile(oldSourceFile.path); + } + } + } + function reportWatchDiagnostic(message) { + if (host.onWatchStatusChange) { + host.onWatchStatusChange(ts.createCompilerDiagnostic(message), newLine, compilerOptions); + } + } + // Upon detecting a file change, wait for 250ms and then perform a recompilation. This gives batch + // operations (such as saving all modified files in an editor) a chance to complete before we kick + // off a new compilation. + function scheduleProgramUpdate() { + if (!host.setTimeout || !host.clearTimeout) { + return; + } + if (timerToUpdateProgram) { + host.clearTimeout(timerToUpdateProgram); + } + timerToUpdateProgram = host.setTimeout(updateProgram, 250); + } + function scheduleProgramReload() { + ts.Debug.assert(!!configFileName); + reloadLevel = ts.ConfigFileProgramReloadLevel.Full; + scheduleProgramUpdate(); + } + function updateProgram() { + timerToUpdateProgram = undefined; + reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + switch (reloadLevel) { + case ts.ConfigFileProgramReloadLevel.Partial: + return reloadFileNamesFromConfigFile(); + case ts.ConfigFileProgramReloadLevel.Full: + return reloadConfigFile(); + default: + synchronizeProgram(); + return; + } + } + function reloadFileNamesFromConfigFile() { + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getDirectoryPath(configFileName), compilerOptions, parseConfigFileHost); + if (!configFileSpecs.filesSpecs && result.fileNames.length === 0) { + host.onConfigFileDiagnostic(ts.getErrorForNoInputFiles(configFileSpecs, configFileName)); + } + rootFileNames = result.fileNames; + // Update the program + synchronizeProgram(); + } + function reloadConfigFile() { + writeLog("Reloading config file: " + configFileName); + reloadLevel = ts.ConfigFileProgramReloadLevel.None; + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.clearCache(); + } + parseConfigFile(); + hasChangedCompilerOptions = true; + synchronizeProgram(); + // Update the wild card directory watch + watchConfigFileWildCardDirectories(); + } + function parseConfigFile() { + var configParseResult = ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost); + rootFileNames = configParseResult.fileNames; + compilerOptions = configParseResult.options; + configFileSpecs = configParseResult.configFileSpecs; + configFileWildCardDirectories = configParseResult.wildcardDirectories; + } + function onSourceFileChange(fileName, eventKind, path) { + updateCachedSystemWithFile(fileName, path, eventKind); + // Update the source file cache + if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.get(path)) { + resolutionCache.invalidateResolutionOfFile(path); + } + nextSourceFileVersion(path); + // Update the program + scheduleProgramUpdate(); + } + function updateCachedSystemWithFile(fileName, path, eventKind) { + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind); + } + } + function watchDirectory(directory, cb, flags) { + return watchDirectoryWorker(host, directory, cb, flags, writeLog); + } + function watchMissingFilePath(missingFilePath) { + return watchFilePath(host, missingFilePath, onMissingFileChange, missingFilePath, writeLog); + } + function onMissingFileChange(fileName, eventKind, missingFilePath) { + updateCachedSystemWithFile(fileName, missingFilePath, eventKind); + if (eventKind === ts.FileWatcherEventKind.Created && missingFilesMap.has(missingFilePath)) { + missingFilesMap.get(missingFilePath).close(); + missingFilesMap.delete(missingFilePath); + // Delete the entry in the source files cache so that new source file is created + nextSourceFileVersion(missingFilePath); + // When a missing file is created, we should update the graph. + scheduleProgramUpdate(); + } + } + function watchConfigFileWildCardDirectories() { + if (configFileWildCardDirectories) { + ts.updateWatchingWildcardDirectories(watchedWildcardDirectories || (watchedWildcardDirectories = ts.createMap()), ts.createMapFromTemplate(configFileWildCardDirectories), watchWildcardDirectory); + } + else if (watchedWildcardDirectories) { + ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf); + } + } + function watchWildcardDirectory(directory, flags) { + return watchDirectory(directory, function (fileOrDirectory) { + ts.Debug.assert(!!configFileName); + var fileOrDirectoryPath = toPath(fileOrDirectory); + // Since the file existance changed, update the sourceFiles cache + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + nextSourceFileVersion(fileOrDirectoryPath); + // If the the added or created file or directory is not supported file name, ignore the file + // But when watched directory is added/removed, we need to reload the file list + if (fileOrDirectoryPath !== directory && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, compilerOptions)) { + writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory); + return; + } + // Reload is pending, do the reload + if (reloadLevel !== ts.ConfigFileProgramReloadLevel.Full) { + reloadLevel = ts.ConfigFileProgramReloadLevel.Partial; + // Schedule Update the program + scheduleProgramUpdate(); + } + }, flags); + } + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + host.createDirectory(directoryPath); + } + } + function writeFile(fileName, text, writeByteOrderMark, onError) { + try { + ts.performance.mark("beforeIOWrite"); + ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); + host.writeFile(fileName, text, writeByteOrderMark); + ts.performance.mark("afterIOWrite"); + ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } + catch (e) { + if (onError) { + onError(e.message); + } + } + } + } + ts.createWatchProgram = createWatchProgram; +})(ts || (ts = {})); /// /// /// @@ -75153,12 +78576,14 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", + "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, - description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation }, { name: "allowJs", @@ -75193,6 +78618,12 @@ var ts; category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_d_ts_file, }, + { + name: "emitDeclarationOnly", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Only_emit_d_ts_declaration_files, + }, { name: "sourceMap", type: "boolean", @@ -75406,6 +78837,13 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "esModuleInterop", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports + }, { name: "preserveSymlinks", type: "boolean", @@ -75696,19 +79134,19 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1 /* ES5 */, - strict: true + strict: true, + esModuleInterop: true }; var optionNameMapCache; /* @internal */ function convertEnableAutoDiscoveryToEnable(typeAcquisition) { // Convert deprecated typingOptions.enableAutoDiscovery to typeAcquisition.enable if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { - var result = { + return { enable: typeAcquisition.enableAutoDiscovery, include: typeAcquisition.include || [], exclude: typeAcquisition.exclude || [] }; - return result; } return typeAcquisition; } @@ -76002,7 +79440,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265 /* PropertyAssignment */) { + if (element.kind !== 268 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -76077,13 +79515,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (valueExpression.operator !== 38 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -76100,7 +79538,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -76171,7 +79609,7 @@ var ts; function serializeCompilerOptions(options) { var result = ts.createMap(); var optionsNameMap = getOptionNameMap().optionNameMap; - var _loop_5 = function (name) { + var _loop_6 = function (name) { if (ts.hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean @@ -76200,7 +79638,7 @@ var ts; } }; for (var name in options) { - _loop_5(name); + _loop_6(name); } return result; } @@ -76320,9 +79758,9 @@ var ts; return x === undefined || x === null; } function directoryOfCombinedPath(fileName, basePath) { - // Use the `identity` function to avoid canonicalizing the path, as it must remain noncanonical + // Use the `getNormalizedAbsolutePath` function to avoid canonicalizing the path, as it must remain noncanonical // until consistient casing errors are reported - return ts.getDirectoryPath(ts.toPath(fileName, basePath, ts.identity)); + return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath)); } /** * Parse the contents of a config file from json or json source file (tsconfig.json). @@ -76339,8 +79777,7 @@ var ts; if (extraFileExtensions === void 0) { extraFileExtensions = []; } ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); var errors = []; - var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors); + var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); var raw = parsedConfig.raw; var options = ts.extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName; @@ -76426,20 +79863,20 @@ var ts; * This *just* extracts options/include/exclude/files out of a config file. * It does *not* resolve the included files. */ - function parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors) { + function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors) { basePath = ts.normalizeSlashes(basePath); - var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); + var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))); return { raw: json || convertToObject(sourceFile, errors) }; } var ownConfig = json ? - parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) : - parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors); + parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : + parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); - var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { var baseRaw_1 = extendedConfig.raw; var raw_1 = ownConfig.raw; @@ -76461,7 +79898,7 @@ var ts; } return ownConfig; } - function parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { if (ts.hasProperty(json, "excludes")) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } @@ -76477,12 +79914,12 @@ var ts; } else { var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, getCanonicalFileName, errors, ts.createCompilerDiagnostic); + extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, ts.createCompilerDiagnostic); } } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { var options = getDefaultCompilerOptions(configFileName); var typeAcquisition, typingOptionstypeAcquisition; var extendedConfigPath; @@ -76500,7 +79937,7 @@ var ts; switch (key) { case "extends": var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(value, host, newBase, getCanonicalFileName, errors, function (message, arg0) { + extendedConfigPath = getExtendsConfigPath(value, host, newBase, errors, function (message, arg0) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0); }); return; @@ -76534,14 +79971,14 @@ var ts; } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function getExtendsConfigPath(extendedConfig, host, basePath, getCanonicalFileName, errors, createDiagnostic) { + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { extendedConfig = ts.normalizeSlashes(extendedConfig); // If the path isn't a rooted or relative path, don't try to resolve it (we reserve the right to special case module-id like paths in the future) if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../"))) { errors.push(createDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); return undefined; } - var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); + var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath); if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) { extendedConfigPath = extendedConfigPath + ".json"; if (!host.fileExists(extendedConfigPath)) { @@ -76551,7 +79988,7 @@ var ts; } return extendedConfigPath; } - function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors) { + function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) { var extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); if (sourceFile) { (sourceFile.extendedSourceFiles || (sourceFile.extendedSourceFiles = [])).push(extendedResult.fileName); @@ -76561,13 +79998,13 @@ var ts; return undefined; } var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), getCanonicalFileName, resolutionStack, errors); + var extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors); if (sourceFile) { (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); } if (isSuccessfulParsedTsconfig(extendedConfig)) { // Update the paths to reflect base path - var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; var mapPropertiesInRawIfNotUndefined = function (propertyName) { if (raw_2[propertyName]) { @@ -76606,7 +80043,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -76616,8 +80053,7 @@ var ts; return options; } function getDefaultTypeAcquisition(configFileName) { - var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; - return options; + return { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { var options = getDefaultTypeAcquisition(configFileName); @@ -76709,20 +80145,6 @@ var ts; * \/?$ # matches an optional trailing directory separator at the end of the string. */ var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; - /** - * Tests for a path with multiple recursive directory wildcards. - * Matches **\** and **\a\**, but not **\a**b. - * - * NOTE: used \ in place of / above to avoid issues with multiline comments. - * - * Breakdown: - * (^|\/) # matches either the beginning of the string or a directory separator. - * \*\*\/ # matches a recursive directory wildcard "**" followed by a directory separator. - * (.*\/)? # optionally matches any number of characters followed by a directory separator. - * \*\* # matches a recursive directory wildcard "**" - * ($|\/) # matches either the end of the string or a directory separator. - */ - var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; /** * Tests for a path where .. appears after a recursive directory wildcard. * Matches **\..\*, **\a\..\*, and **\.., but not ..\**\* @@ -76891,9 +80313,6 @@ var ts; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } - else if (invalidMultipleRecursionPatterns.test(spec)) { - return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; - } else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } @@ -77235,6 +80654,7 @@ var ts; ScriptElementKindModifier["ambientModifier"] = "declare"; ScriptElementKindModifier["staticModifier"] = "static"; ScriptElementKindModifier["abstractModifier"] = "abstract"; + ScriptElementKindModifier["optionalModifier"] = "optional"; })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); var ClassificationTypeNames; (function (ClassificationTypeNames) { @@ -77305,36 +80725,36 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 264 /* CatchClause */: - case 257 /* JsxAttribute */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 267 /* CatchClause */: + case 260 /* JsxAttribute */: return 1 /* Value */; - case 146 /* TypeParameter */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 164 /* TypeLiteral */: + case 147 /* TypeParameter */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 165 /* TypeLiteral */: return 2 /* Type */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 268 /* EnumMember */: - case 230 /* ClassDeclaration */: + case 271 /* EnumMember */: + case 233 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -77344,26 +80764,26 @@ var ts; else { return 4 /* Namespace */; } - case 233 /* EnumDeclaration */: - case 242 /* NamedImports */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 236 /* EnumDeclaration */: + case 245 /* NamedImports */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 269 /* SourceFile */: + case 272 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 244 /* ExportAssignment */) { + else if (node.parent.kind === 247 /* ExportAssignment */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -77388,19 +80808,14 @@ var ts; } ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 71 /* Identifier */); // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 144 /* QualifiedName */ && - node.parent.right === node && - node.parent.parent.kind === 238 /* ImportEqualsDeclaration */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - return 4 /* Namespace */; + var name = node.kind === 145 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 241 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 144 /* QualifiedName */) { + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -77412,27 +80827,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 144 /* QualifiedName */) { - while (root.parent && root.parent.kind === 144 /* QualifiedName */) { + if (root.parent.kind === 145 /* QualifiedName */) { + while (root.parent && root.parent.kind === 145 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 160 /* TypeReference */ && !isLastClause; + return root.parent.kind === 161 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 180 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 180 /* PropertyAccessExpression */) { + if (root.parent.kind === 183 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 183 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 202 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 263 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 205 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 266 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 230 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || - (decl.kind === 231 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); + return (decl.kind === 233 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || + (decl.kind === 234 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); } return false; } @@ -77443,23 +80858,23 @@ var ts; switch (node.kind) { case 99 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return true; } switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 182 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 185 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 183 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 186 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -77472,7 +80887,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 223 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 226 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -77482,13 +80897,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 71 /* Identifier */ && - (node.parent.kind === 219 /* BreakStatement */ || node.parent.kind === 218 /* ContinueStatement */) && + (node.parent.kind === 222 /* BreakStatement */ || node.parent.kind === 221 /* ContinueStatement */) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 71 /* Identifier */ && - node.parent.kind === 223 /* LabeledStatement */ && + node.parent.kind === 226 /* LabeledStatement */ && node.parent.label === node; } function isLabelName(node) { @@ -77496,15 +80911,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 234 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 237 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -77514,22 +80929,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 268 /* EnumMember */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 234 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 271 /* EnumMember */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 237 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return true; - case 174 /* LiteralType */: - return node.parent.parent.kind === 172 /* IndexedAccessType */; + case 177 /* LiteralType */: + return node.parent.parent.kind === 175 /* IndexedAccessType */; } } ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess; @@ -77539,7 +80954,7 @@ var ts; } ts.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration; function getContainerNode(node) { - if (node.kind === 288 /* JSDocTypedefTag */) { + if (node.kind === 291 /* JSDocTypedefTag */) { // This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope. // node.parent = the JSDoc comment, node.parent.parent = the node having the comment. // Then we get parent again in the loop. @@ -77551,17 +80966,17 @@ var ts; return undefined; } switch (node.kind) { - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return node; } } @@ -77569,48 +80984,48 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return "class" /* classElement */; - case 231 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 232 /* TypeAliasDeclaration */: return "type" /* typeElement */; - case 233 /* EnumDeclaration */: return "enum" /* enumElement */; - case 227 /* VariableDeclaration */: + case 234 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 235 /* TypeAliasDeclaration */: return "type" /* typeElement */; + case 236 /* EnumDeclaration */: return "enum" /* enumElement */; + case 230 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return "function" /* functionElement */; - case 154 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 155 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 155 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 156 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return "property" /* memberVariableElement */; - case 158 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 157 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 156 /* CallSignature */: return "call" /* callSignatureElement */; - case 153 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 146 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 268 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 147 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 238 /* ImportEqualsDeclaration */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 247 /* ExportSpecifier */: - case 241 /* NamespaceImport */: + case 159 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 158 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 157 /* CallSignature */: return "call" /* callSignatureElement */; + case 154 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 147 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 271 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 148 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 241 /* ImportEqualsDeclaration */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 250 /* ExportSpecifier */: + case 244 /* NamespaceImport */: return "alias" /* alias */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var kind = ts.getSpecialPropertyAssignmentKind(node); var right = node.right; switch (kind) { @@ -77651,7 +81066,7 @@ var ts; return true; case 71 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 147 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 148 /* Parameter */; default: return false; } @@ -77700,42 +81115,42 @@ var ts; return false; } switch (n.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 175 /* ObjectBindingPattern */: - case 164 /* TypeLiteral */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 236 /* CaseBlock */: - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 165 /* TypeLiteral */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 239 /* CaseBlock */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return nodeEndsWith(n, 18 /* CloseBraceToken */, sourceFile); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 183 /* NewExpression */: + case 186 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 182 /* CallExpression */: - case 186 /* ParenthesizedExpression */: - case 169 /* ParenthesizedType */: + case 185 /* CallExpression */: + case 189 /* ParenthesizedExpression */: + case 172 /* ParenthesizedType */: return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 191 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -77745,73 +81160,70 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 20 /* CloseParenToken */, sourceFile); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 212 /* IfStatement */: + case 215 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || - hasChildOfKind(n, 25 /* SemicolonToken */); - case 178 /* ArrayLiteralExpression */: - case 176 /* ArrayBindingPattern */: - case 181 /* ElementAccessExpression */: - case 145 /* ComputedPropertyName */: - case 166 /* TupleType */: + hasChildOfKind(n, 25 /* SemicolonToken */, sourceFile); + case 181 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 184 /* ElementAccessExpression */: + case 146 /* ComputedPropertyName */: + case 167 /* TupleType */: return nodeEndsWith(n, 22 /* CloseBracketToken */, sourceFile); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; - var hasWhileKeyword = findChildOfKind(n, 106 /* WhileKeyword */, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - case 163 /* TypeQuery */: + return hasChildOfKind(n, 106 /* WhileKeyword */, sourceFile) + ? nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile) + : isCompletedNode(n.statement, sourceFile); + case 164 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 190 /* TypeOfExpression */: - case 189 /* DeleteExpression */: - case 191 /* VoidExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: + case 193 /* TypeOfExpression */: + case 192 /* DeleteExpression */: + case 194 /* VoidExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; } } - ts.isCompletedNode = isCompletedNode; /* * Checks if node ends with 'expectedLastToken'. * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. @@ -77851,7 +81263,7 @@ var ts; } ts.hasChildOfKind = hasChildOfKind; function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + return ts.find(n.getChildren(sourceFile), function (c) { return c.kind === kind; }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { @@ -77980,19 +81392,11 @@ var ts; var result = find(startNode || sourceFile); ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); return result; - function findRightmostToken(n) { - if (ts.isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } function find(n) { - if (ts.isToken(n)) { + if (isNonWhitespaceToken(n)) { return n; } - var children = n.getChildren(); + var children = n.getChildren(sourceFile); for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). @@ -78008,7 +81412,7 @@ var ts; if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } else { // candidate should be in this node @@ -78016,34 +81420,45 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 269 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 272 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. // Namely we are skipping the check: 'position < node.end' if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } - } - /** - * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. - */ - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - var child = children[i]; - if (isWhiteSpaceOnlyJsxText(child)) { - ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - else if (nodeHasTokens(children[i])) { - return children[i]; - } + return candidate && findRightmostToken(candidate, sourceFile); } } } ts.findPrecedingToken = findPrecedingToken; - function isInString(sourceFile, position) { - var previousToken = findPrecedingToken(position, sourceFile); + function isNonWhitespaceToken(n) { + return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n); + } + function findRightmostToken(n, sourceFile) { + if (isNonWhitespaceToken(n)) { + return n; + } + var children = n.getChildren(sourceFile); + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate, sourceFile); + } + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { + for (var i = exclusiveStartPosition - 1; i >= 0; i--) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } + function isInString(sourceFile, position, previousToken) { + if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); } if (previousToken && ts.isStringTextContainingNode(previousToken)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); @@ -78077,17 +81492,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
|
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 253 /* JsxClosingElement */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 256 /* JsxClosingElement */) { return true; } return false; @@ -78096,7 +81511,6 @@ var ts; function isWhiteSpaceOnlyJsxText(node) { return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; } - ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); @@ -78149,10 +81563,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 160 /* TypeReference */ || node.kind === 182 /* CallExpression */) { + if (node.kind === 161 /* TypeReference */ || node.kind === 185 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 230 /* ClassDeclaration */ || node.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 233 /* ClassDeclaration */ || node.kind === 234 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -78204,18 +81618,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 178 /* ArrayLiteralExpression */ || - node.kind === 179 /* ObjectLiteralExpression */) { + if (node.kind === 181 /* ArrayLiteralExpression */ || + node.kind === 182 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 195 /* BinaryExpression */ && + if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 217 /* ForOfStatement */ && + if (node.parent.kind === 220 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -78223,7 +81637,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 265 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 268 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -78257,15 +81671,27 @@ var ts; return ts.createTextSpanFromBounds(range.pos, range.end); } ts.createTextSpanFromRange = createTextSpanFromRange; + function createTextChangeFromStartLength(start, length, newText) { + return createTextChange(ts.createTextSpan(start, length), newText); + } + ts.createTextChangeFromStartLength = createTextChangeFromStartLength; + function createTextChange(span, newText) { + return { span: span, newText: newText }; + } + ts.createTextChange = createTextChange; ts.typeKeywords = [ 119 /* AnyKeyword */, 122 /* BooleanKeyword */, - 130 /* NeverKeyword */, - 133 /* NumberKeyword */, - 134 /* ObjectKeyword */, - 136 /* StringKeyword */, - 137 /* SymbolKeyword */, + 128 /* KeyOfKeyword */, + 131 /* NeverKeyword */, + 95 /* NullKeyword */, + 134 /* NumberKeyword */, + 135 /* ObjectKeyword */, + 137 /* StringKeyword */, + 138 /* SymbolKeyword */, 105 /* VoidKeyword */, + 140 /* UndefinedKeyword */, + 141 /* UniqueKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); @@ -78286,12 +81712,34 @@ var ts; }; } ts.nodeSeenTracker = nodeSeenTracker; + /** Add a value to a set, and return true if it wasn't already present. */ + function addToSeen(seen, key) { + key = String(key); + if (seen.has(key)) { + return false; + } + seen.set(key, true); + return true; + } + ts.addToSeen = addToSeen; + function getSnapshotText(snap) { + return snap.getText(0, snap.getLength()); + } + ts.getSnapshotText = getSnapshotText; + function repeatString(str, count) { + var result = ""; + for (var i = 0; i < count; i++) { + result += str; + } + return result; + } + ts.repeatString = repeatString; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 147 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 148 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -78300,6 +81748,7 @@ var ts; var lineStart; var indent; resetWriter(); + var unknownWrite = function (text) { return writeKind(text, ts.SymbolDisplayPartKind.text); }; return { displayParts: function () { return displayParts; }, writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, @@ -78309,8 +81758,18 @@ var ts; writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, + writeLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeSymbol: writeSymbol, writeLine: writeLine, + write: unknownWrite, + writeTextOfNode: unknownWrite, + getText: function () { return ""; }, + getTextPos: function () { return 0; }, + getColumn: function () { return 0; }, + getLine: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + rawWrite: ts.notImplemented, + getIndent: function () { return indent; }, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, @@ -78431,14 +81890,17 @@ var ts; /** * The default is CRLF. */ - function getNewLineOrDefaultFromHost(host) { - return host.getNewLine ? host.getNewLine() : carriageReturnLineFeed; + function getNewLineOrDefaultFromHost(host, formatSettings) { + return (formatSettings && formatSettings.newLineCharacter) || + (host.getNewLine && host.getNewLine()) || + carriageReturnLineFeed; } ts.getNewLineOrDefaultFromHost = getNewLineOrDefaultFromHost; function lineBreakPart() { return displayPart("\n", ts.SymbolDisplayPartKind.lineBreak); } ts.lineBreakPart = lineBreakPart; + /* @internal */ function mapToDisplayParts(writeDisplayParts) { try { writeDisplayParts(displayPartWriter); @@ -78451,38 +81913,26 @@ var ts; ts.mapToDisplayParts = mapToDisplayParts; function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) { return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); }); } ts.typeToDisplayParts = typeToDisplayParts; function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { return mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags); + typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8 /* UseAliasDefinedOutsideCurrentScope */, writer); }); } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { - flags |= 65536 /* UseAliasDefinedOutsideCurrentScope */; + flags |= 16384 /* UseAliasDefinedOutsideCurrentScope */ | 1024 /* MultilineObjectLiterals */ | 32 /* WriteTypeArgumentsOfSignature */ | 8192 /* OmitParameterModifiers */; return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + typechecker.writeSignature(signature, enclosingDeclaration, flags, /*signatureKind*/ undefined, writer); }); } ts.signatureToDisplayParts = signatureToDisplayParts; - function getDeclaredName(typeChecker, symbol, location) { - // If this is an export or import specifier it could have been renamed using the 'as' syntax. - // If so we want to search for whatever is under the cursor. - if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 145 /* ComputedPropertyName */) { - return ts.getTextOfIdentifierOrLiteral(location); - } - // Try to get the local symbol if we're dealing with an 'export default' - // since that symbol has the "true" name. - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - return typeChecker.symbolToString(localExportDefaultSymbol || symbol); - } - ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 243 /* ImportSpecifier */ || location.parent.kind === 247 /* ExportSpecifier */) && + (location.parent.kind === 246 /* ImportSpecifier */ || location.parent.kind === 250 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -78493,12 +81943,16 @@ var ts; */ function stripQuotes(name) { var length = name.length; - if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && ts.isSingleOrDoubleQuote(name.charCodeAt(0))) { + if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { return name.substring(1, length - 1); } return name; } ts.stripQuotes = stripQuotes; + function startsWithQuote(name) { + return ts.isSingleOrDoubleQuote(name.charCodeAt(0)); + } + ts.startsWithQuote = startsWithQuote; function scriptKindIs(fileName, host) { var scriptKinds = []; for (var _i = 2; _i < arguments.length; _i++) { @@ -78525,57 +81979,6 @@ var ts; return position; } ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; - function getOpenBrace(constructor, sourceFile) { - // First token is the open curly, this is where we want to put the 'super' call. - return constructor.body.getFirstToken(sourceFile); - } - ts.getOpenBrace = getOpenBrace; - function getOpenBraceOfClassLike(declaration, sourceFile) { - return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1, /*includeJsDocComment*/ false); - } - ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; - function getSourceFileImportLocation(_a) { - var text = _a.text; - var shebang = ts.getShebang(text); - var position = 0; - if (shebang !== undefined) { - position = shebang.length; - advancePastLineBreak(); - } - // For a source file, it is possible there are detached comments we should not skip - var ranges = ts.getLeadingCommentRanges(text, position); - if (!ranges) - return position; - // However we should still skip a pinned comment at the top - if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { - position = ranges[0].end; - advancePastLineBreak(); - ranges = ranges.slice(1); - } - // As well as any triple slash references - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { - position = range.end; - advancePastLineBreak(); - continue; - } - break; - } - return position; - function advancePastLineBreak() { - if (position < text.length) { - var charCode = text.charCodeAt(position); - if (ts.isLineBreak(charCode)) { - position++; - if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) { - position++; - } - } - } - } - } - ts.getSourceFileImportLocation = getSourceFileImportLocation; /** * Creates a deep, memberwise clone of a node with no source map location. * @@ -78607,6 +82010,10 @@ var ts; return visited; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(getSynthesizedDeepClone), nodes.hasTrailingComma); + } + ts.getSynthesizedDeepClones = getSynthesizedDeepClones; /** * Sets EmitFlags to suppress leading and trailing trivia on the node. */ @@ -78739,10 +82146,10 @@ var ts; } break; case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -78880,7 +82287,7 @@ var ts; var lastEnd = 0; for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_6 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; // Make a whitespace entry between the last item and this one. if (lastEnd >= 0) { @@ -78889,8 +82296,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_6, classification: convertClassification(type) }); - lastEnd = start + length_6; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -78928,7 +82335,7 @@ var ts; } switch (keyword2) { case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 123 /* ConstructorKeyword */: case 115 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -79067,10 +82474,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -79213,32 +82620,39 @@ var ts; if (!ts.isTrivia(kind)) { return start; } - // Don't bother with newlines/whitespace. - if (kind === 4 /* NewLineTrivia */ || kind === 5 /* WhitespaceTrivia */) { - continue; - } - // Only bother with the trivia if it at least intersects the span of interest. - if (ts.isComment(kind)) { - classifyComment(token, kind, start, width); - // Classifying a comment might cause us to reuse the trivia scanner - // (because of jsdoc comments). So after we classify the comment make - // sure we set the scanner position back to where it needs to be. - triviaScanner.setTextPos(end); - continue; - } - if (kind === 7 /* ConflictMarkerTrivia */) { - var text = sourceFile.text; - var ch = text.charCodeAt(start); - // for the <<<<<<< and >>>>>>> markers, we just add them in as comments - // in the classification stream. - if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - pushClassification(start, width, 1 /* comment */); + switch (kind) { + case 4 /* NewLineTrivia */: + case 5 /* WhitespaceTrivia */: + // Don't bother with newlines/whitespace. continue; - } - // for the ||||||| and ======== markers, add a comment for the first line, - // and then lex all subsequent lines up until the end of the conflict marker. - ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); - classifyDisabledMergeCode(text, start, end); + case 2 /* SingleLineCommentTrivia */: + case 3 /* MultiLineCommentTrivia */: + // Only bother with the trivia if it at least intersects the span of interest. + classifyComment(token, kind, start, width); + // Classifying a comment might cause us to reuse the trivia scanner + // (because of jsdoc comments). So after we classify the comment make + // sure we set the scanner position back to where it needs to be. + triviaScanner.setTextPos(end); + continue; + case 7 /* ConflictMarkerTrivia */: + var text = sourceFile.text; + var ch = text.charCodeAt(start); + // for the <<<<<<< and >>>>>>> markers, we just add them in as comments + // in the classification stream. + if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { + pushClassification(start, width, 1 /* comment */); + continue; + } + // for the ||||||| and ======== markers, add a comment for the first line, + // and then lex all subsequent lines up until the end of the conflict marker. + ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); + classifyDisabledMergeCode(text, start, end); + break; + case 6 /* ShebangTrivia */: + // TODO: Maybe we should classify these. + break; + default: + ts.Debug.assertNever(kind); } } } @@ -79274,16 +82688,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -79370,22 +82784,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -79400,7 +82814,7 @@ var ts; if (ts.isKeyword(tokenKind)) { return 3 /* keyword */; } - // Special case < and > If they appear in a generic context they are punctuation, + // Special case `<` and `>`: If they appear in a generic context they are punctuation, // not operators. if (tokenKind === 27 /* LessThanToken */ || tokenKind === 29 /* GreaterThanToken */) { // If the node owning the token has a type argument list or type parameter list, then @@ -79413,17 +82827,17 @@ var ts; if (token) { if (tokenKind === 58 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 227 /* VariableDeclaration */ || - token.parent.kind === 150 /* PropertyDeclaration */ || - token.parent.kind === 147 /* Parameter */ || - token.parent.kind === 257 /* JsxAttribute */) { + if (token.parent.kind === 230 /* VariableDeclaration */ || + token.parent.kind === 151 /* PropertyDeclaration */ || + token.parent.kind === 148 /* Parameter */ || + token.parent.kind === 260 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 195 /* BinaryExpression */ || - token.parent.kind === 193 /* PrefixUnaryExpression */ || - token.parent.kind === 194 /* PostfixUnaryExpression */ || - token.parent.kind === 196 /* ConditionalExpression */) { + if (token.parent.kind === 198 /* BinaryExpression */ || + token.parent.kind === 196 /* PrefixUnaryExpression */ || + token.parent.kind === 197 /* PostfixUnaryExpression */ || + token.parent.kind === 199 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -79433,7 +82847,7 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 257 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 260 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 12 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -79449,32 +82863,32 @@ var ts; else if (tokenKind === 71 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 147 /* Parameter */: + case 148 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -79510,11 +82924,14 @@ var ts; (function (Completions) { var PathCompletions; (function (PathCompletions) { - function getStringLiteralCompletionsFromModuleNames(node, compilerOptions, host, typeChecker) { + function createPathCompletion(name, kind, span) { + return { name: name, kind: kind, span: span }; + } + function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); - var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); + var span = getDirectoryFragmentTextSpan(node.text, node.getStart(sourceFile) + 1); if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { @@ -79594,12 +83011,12 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles.get(foundFileName)) { + if (!foundFiles.has(foundFileName)) { foundFiles.set(foundFileName, true); } } ts.forEachKey(foundFiles, function (foundFile) { - result.push(createCompletionEntryForModule(foundFile, "script" /* scriptElement */, span)); + result.push(createPathCompletion(foundFile, "script" /* scriptElement */, span)); }); } // If possible, get folder completion as well @@ -79608,7 +83025,7 @@ var ts; for (var _a = 0, directories_1 = directories; _a < directories_1.length; _a++) { var directory = directories_1[_a]; var directoryName = ts.getBaseFileName(ts.normalizePath(directory)); - result.push(createCompletionEntryForModule(directoryName, "directory" /* directory */, span)); + result.push(createPathCompletion(directoryName, "directory" /* directory */, span)); } } } @@ -79629,37 +83046,20 @@ var ts; var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host, /*exclude*/ undefined, result); - var _loop_6 = function (path) { - if (!paths.hasOwnProperty(path)) - return "continue"; - var patterns = paths[path]; - if (!patterns) - return "continue"; - if (path === "*") { - for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) { - var pattern = patterns_1[_i]; - var _loop_7 = function (match) { - // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. - if (result.some(function (entry) { return entry.name === match; })) - return "continue"; - result.push(createCompletionEntryForModule(match, "external module name" /* externalModuleName */, span)); - }; - for (var _a = 0, _b = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _a < _b.length; _a++) { - var match = _b[_a]; - _loop_7(match); - } - } - } - else if (ts.startsWith(path, fragment)) { - if (patterns.length === 1) { - if (result.some(function (entry) { return entry.name === path; })) - return "continue"; - result.push(createCompletionEntryForModule(path, "external module name" /* externalModuleName */, span)); - } - } - }; for (var path in paths) { - _loop_6(path); + var patterns = paths[path]; + if (paths.hasOwnProperty(path) && patterns) { + var _loop_7 = function (name, kind) { + // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. + if (!result.some(function (entry) { return entry.name === name; })) { + result.push(createPathCompletion(name, kind, span)); + } + }; + for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host); _i < _a.length; _i++) { + var _b = _a[_i], name = _b.name, kind = _b.kind; + _loop_7(name, kind); + } + } } } if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) { @@ -79671,50 +83071,63 @@ var ts; }); } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _i = 0, _a = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + for (var _c = 0, _d = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _c < _d.length; _c++) { + var moduleName = _d[_c]; + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { - if (host.readDirectory) { - var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; - if (parsed) { - // The prefix has two effective parts: the directory path and the base component after the filepath that is not a - // full directory component. For example: directory/path/of/prefix/base* - var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); - var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); - var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); - var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); - // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call - var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; - var normalizedSuffix = ts.normalizePath(parsed.suffix); - var baseDirectory = ts.combinePaths(baseUrl, expandedPrefixDirectory); - var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; - // If we have a suffix, then we need to read the directory all the way down. We could create a glob - // that encodes the suffix, but we would have to escape the character "?" which readDirectory - // doesn't support. For now, this is safer but slower - var includeGlob = normalizedSuffix ? "**/*" : "./*"; - var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]); - if (matches) { - var result = []; - // Trim away prefix and suffix - for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { - var match = matches_1[_i]; - var normalizedMatch = ts.normalizePath(match); - if (!ts.endsWith(normalizedMatch, normalizedSuffix) || !ts.startsWith(normalizedMatch, completePrefix)) { - continue; - } - var start = completePrefix.length; - var length_7 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_7))); - } - return result; - } - } + function getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host) { + if (!ts.endsWith(path, "*")) { + // For a path mapping "foo": ["/x/y/z.ts"], add "foo" itself as a completion. + return !ts.stringContains(path, "*") && ts.startsWith(path, fragment) ? [{ name: path, kind: "directory" /* directory */ }] : ts.emptyArray; } - return undefined; + var pathPrefix = path.slice(0, path.length - 1); + if (!ts.startsWith(fragment, pathPrefix)) { + return [{ name: pathPrefix, kind: "directory" /* directory */ }]; + } + var remainingFragment = fragment.slice(pathPrefix.length); + return ts.flatMap(patterns, function (pattern) { return getModulesForPathsPattern(remainingFragment, baseUrl, pattern, fileExtensions, host); }); + } + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { + if (!host.readDirectory) { + return undefined; + } + var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; + if (!parsed) { + return undefined; + } + // The prefix has two effective parts: the directory path and the base component after the filepath that is not a + // full directory component. For example: directory/path/of/prefix/base* + var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); + var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); + var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); + var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); + // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call + var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; + var normalizedSuffix = ts.normalizePath(parsed.suffix); + // Need to normalize after combining: If we combinePaths("a", "../b"), we want "b" and not "a/../b". + var baseDirectory = ts.normalizePath(ts.combinePaths(baseUrl, expandedPrefixDirectory)); + var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + // If we have a suffix, then we need to read the directory all the way down. We could create a glob + // that encodes the suffix, but we would have to escape the character "?" which readDirectory + // doesn't support. For now, this is safer but slower + var includeGlob = normalizedSuffix ? "**/*" : "./*"; + var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]).map(function (name) { return ({ name: name, kind: "script" /* scriptElement */ }); }); + var directories = tryGetDirectories(host, baseDirectory).map(function (d) { return ts.combinePaths(baseDirectory, d); }).map(function (name) { return ({ name: name, kind: "directory" /* directory */ }); }); + // Trim away prefix and suffix + return ts.mapDefined(ts.concatenate(matches, directories), function (_a) { + var name = _a.name, kind = _a.kind; + var normalizedMatch = ts.normalizePath(name); + var inner = withoutStartAndEnd(normalizedMatch, completePrefix, normalizedSuffix); + return inner !== undefined ? { name: removeLeadingDirectorySeparator(ts.removeFileExtension(inner)), kind: kind } : undefined; + }); + } + function withoutStartAndEnd(s, start, end) { + return ts.startsWith(s, start) && ts.endsWith(s, end) ? s.slice(start.length, s.length - end.length) : undefined; + } + function removeLeadingDirectorySeparator(path) { + return path[0] === ts.directorySeparator ? path.slice(1) : path; } function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { // Check If this is a nested module @@ -79786,10 +83199,12 @@ var ts; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } // Check for typings specified in compiler options + var seen = ts.createMap(); if (options.types) { for (var _i = 0, _a = options.types; _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + var typesName = _a[_i]; + var moduleName = ts.getUnmangledNameForScopedPackage(typesName); + pushResult(moduleName); } } else if (host.getDirectories) { @@ -79801,31 +83216,38 @@ var ts; if (typeRoots) { for (var _c = 0, typeRoots_2 = typeRoots; _c < typeRoots_2.length; _c++) { var root = typeRoots_2[_c]; - getCompletionEntriesFromDirectories(host, root, span, result); + getCompletionEntriesFromDirectories(root); } } - } - if (host.getDirectories) { // Also get all @types typings installed in visible node_modules directories for (var _d = 0, _e = findPackageJsons(scriptPath, host); _d < _e.length; _d++) { var packageJson = _e[_d]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); - getCompletionEntriesFromDirectories(host, typesDir, span, result); + getCompletionEntriesFromDirectories(typesDir); } } return result; - } - function getCompletionEntriesFromDirectories(host, directory, span, result) { - if (host.getDirectories && tryDirectoryExists(host, directory)) { - var directories = tryGetDirectories(host, directory); - if (directories) { - for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { - var typeDirectory = directories_2[_i]; - typeDirectory = ts.normalizePath(typeDirectory); - result.push(createCompletionEntryForModule(ts.getBaseFileName(typeDirectory), "external module name" /* externalModuleName */, span)); + function getCompletionEntriesFromDirectories(directory) { + ts.Debug.assert(!!host.getDirectories); + if (tryDirectoryExists(host, directory)) { + var directories = tryGetDirectories(host, directory); + if (directories) { + for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { + var typeDirectory = directories_2[_i]; + typeDirectory = ts.normalizePath(typeDirectory); + var directoryName = ts.getBaseFileName(typeDirectory); + var moduleName = ts.getUnmangledNameForScopedPackage(directoryName); + pushResult(moduleName); + } } } } + function pushResult(moduleName) { + if (!seen.has(moduleName)) { + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); + seen.set(moduleName, true); + } + } } function findPackageJsons(directory, host) { var paths = []; @@ -79884,9 +83306,6 @@ var ts; } } } - function createCompletionEntryForModule(name, kind, replacementSpan) { - return { name: name, kind: kind, kindModifiers: "" /* none */, sortText: name, replacementSpan: replacementSpan }; - } // Replace everything after the last directory seperator that appears function getDirectoryFragmentTextSpan(text, textStart) { var index = text.lastIndexOf(ts.directorySeparator); @@ -79903,7 +83322,13 @@ var ts; return false; } function normalizeAndPreserveTrailingSlash(path) { - return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); + if (ts.normalizeSlashes(path) === "./") { + // normalizePath turns "./" into "". "" + "/" would then be a rooted path instead of a relative one, so avoid this particular case. + // There is no problem for adding "/" to a non-empty string -- it's only a problem at the beginning. + return ""; + } + var norm = ts.normalizePath(path); + return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(norm) : norm; } /** * Matches a triple slash reference directive with an incomplete string literal for its path. Used @@ -79920,10 +83345,10 @@ var ts; var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* completion list at "1" will contain "div" with type any + // var x =
+ // The completion list at "1" will contain "div" with type any var tagName = location.parent.parent.openingElement.tagName; return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [{ @@ -79992,37 +83475,37 @@ var ts; sortText: "0", }] }; } - if (request) { - var entries_3 = request.kind === "JsDocTagName" - // If the current position is a jsDoc tag name, only tag names should be provided for completion - ? ts.JsDoc.getJSDocTagNameCompletions() - : request.kind === "JsDocTag" - // If the current position is a jsDoc tag, only tags should be provided for completion - ? ts.JsDoc.getJSDocTagCompletions() - : ts.JsDoc.getJSDocParameterNameCompletions(request.tag); - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_3 }; - } var entries = []; if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap); + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries); } else { if ((!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { return undefined; } - getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap); + getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); } // TODO add filter for keyword based on type/value/namespace and also location // Add all keywords if // - this is not a member completion list (all the keywords) // - other filters are enabled in required scenario so add those keywords + var isMemberCompletion = isMemberCompletionKind(completionKind); if (keywordFilters !== 0 /* None */ || !isMemberCompletion) { ts.addRange(entries, getKeywordCompletions(keywordFilters)); } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + return { isGlobalCompletion: completionKind === 1 /* Global */, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + } + function isMemberCompletionKind(kind) { + switch (kind) { + case 0 /* ObjectPropertyDeclaration */: + case 3 /* MemberLike */: + case 2 /* PropertyAccess */: + return true; + default: + return false; + } } - Completions.getCompletionsAtPosition = getCompletionsAtPosition; function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames, target, entries) { ts.getNameTable(sourceFile).forEach(function (pos, name) { // Skip identifiers produced only from the current location @@ -80030,14 +83513,9 @@ var ts; return; } var realName = ts.unescapeLeadingUnderscores(name); - if (uniqueNames.has(realName) || ts.isStringANonContextualKeyword(realName)) { - return; - } - uniqueNames.set(realName, true); - var displayName = getCompletionEntryDisplayName(realName, target, /*performCharacterChecks*/ true, /*allowStringLiteral*/ false); - if (displayName) { + if (ts.addToSeen(uniqueNames, realName) && ts.isIdentifierText(realName, target) && !ts.isStringANonContextualKeyword(realName)) { entries.push({ - name: displayName, + name: realName, kind: "warning" /* warning */, kindModifiers: "", sortText: "1" @@ -80045,12 +83523,35 @@ var ts; } }); } - function createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target, allowStringLiteral, origin, recommendedCompletion) { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, allowStringLiteral, origin); - if (!displayName) { + function createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, includeInsertTextCompletions) { + var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind); + if (!info) { + return undefined; + } + var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess; + var insertText; + var replacementSpan; + if (includeInsertTextCompletions) { + if (origin && origin.type === "this-type") { + insertText = needsConvertPropertyAccess ? "this[" + quote(name) + "]" : "this." + name; + } + else if (needsConvertPropertyAccess) { + insertText = "[" + quote(name) + "]"; + var dot = ts.findChildOfKind(propertyAccessToConvert, 23 /* DotToken */, sourceFile); + // If the text after the '.' starts with this name, write over it. Else, add new text. + var end = ts.startsWith(name, propertyAccessToConvert.name.text) ? propertyAccessToConvert.name.end : dot.end; + replacementSpan = ts.createTextSpanFromBounds(dot.getStart(sourceFile), end); + } + if (isJsxInitializer) { + if (insertText === undefined) + insertText = name; + insertText = "{" + insertText + "}"; + if (typeof isJsxInitializer !== "boolean") { + replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile); + } + } + } + if (insertText !== undefined && !includeInsertTextCompletions) { return undefined; } // TODO(drosen): Right now we just permit *all* semantic meanings when calling @@ -80061,15 +83562,21 @@ var ts; // Use a 'sortText' of 0' so that all symbol completion entries come before any other // entries (like JavaScript identifier entries). return { - name: displayName, + name: name, kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), sortText: "0", source: getSourceFromOrigin(origin), - hasAction: trueOrUndefined(origin !== undefined), + hasAction: trueOrUndefined(!!origin && origin.type === "export"), isRecommended: trueOrUndefined(isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker)), + insertText: insertText, + replacementSpan: replacementSpan, }; } + function quote(text) { + // TODO: GH#20619 Use configured quote style + return JSON.stringify(text); + } function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { return localSymbol === recommendedCompletion || !!(localSymbol.flags & 1048576 /* ExportValue */) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion; @@ -80078,213 +83585,194 @@ var ts; return b ? true : undefined; } function getSourceFromOrigin(origin) { - return origin && ts.stripQuotes(origin.moduleSymbol.name); + return origin && origin.type === "export" ? ts.stripQuotes(origin.moduleSymbol.name) : undefined; } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks, typeChecker, target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap) { + function getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, target, log, kind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap) { var start = ts.timestamp(); // Tracks unique names. // We don't set this for global variables or completions from external module exports, because we can have multiple of those. // Based on the order we add things we will always see locals first, then globals, then module exports. // So adding a completion for a local will prevent us from adding completions for external module exports sharing the same name. var uniques = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_5 = symbols; _i < symbols_5.length; _i++) { - var symbol = symbols_5[_i]; - var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined; - var entry = createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target, allowStringLiteral, origin, recommendedCompletion); - if (!entry) { - continue; - } - var name = entry.name; - if (uniques.has(name)) { - continue; - } - // Latter case tests whether this is a global variable. - if (!origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }))) { - uniques.set(name, true); - } - entries.push(entry); + for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { + var symbol = symbols_4[_i]; + var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined; + var entry = createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, includeInsertTextCompletions); + if (!entry) { + continue; } + var name = entry.name; + if (uniques.has(name)) { + continue; + } + // Latter case tests whether this is a global variable. + if (!origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }))) { + uniques.set(name, true); + } + entries.push(entry); } log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); return uniques; } - function getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9 /* StringLiteral */) { - return undefined; - } - if (node.parent.kind === 265 /* PropertyAssignment */ && - node.parent.parent.kind === 179 /* ObjectLiteralExpression */ && - node.parent.name === node) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent, typeChecker, compilerOptions.target, log); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - return getStringLiteralCompletionEntriesFromElementAccess(node.parent, typeChecker, compilerOptions.target, log); - } - else if (node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */ - || ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent) - || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node)) { - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // var y = import("/*completion position*/"); - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - // export * from "/*completion position*/"; - var entries = Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(node, compilerOptions, host, typeChecker); - return pathCompletionsInfo(entries); - } - else if (isEqualityExpression(node.parent)) { - // Get completions from the type of the other operand - // i.e. switch (a) { - // case '/*completion position*/' - // } - return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.left === node ? node.parent.right : node.parent.left), typeChecker); - } - else if (ts.isCaseOrDefaultClause(node.parent)) { - // Get completions from the type of the switch expression - // i.e. x === '/*completion position' - return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.parent.parent.expression), typeChecker); - } - else { - var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker); - } - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(node), typeChecker); + function getLabelCompletionAtPosition(node) { + var entries = getLabelStatementCompletions(node); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } } - function pathCompletionsInfo(entries) { - return { - // We don't want the editor to offer any other completions, such as snippets, inside a comment. - isGlobalCompletion: false, - isMemberCompletion: false, - // The user may type in a path that doesn't yet exist, creating a "new identifier" - // with respect to the collection of identifiers the server is aware of. - isNewIdentifierLocation: true, - entries: entries, - }; - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element, typeChecker, target, log) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false, typeChecker, target, log, /*allowStringLiteral*/ true); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { - var candidates = []; + function getLabelStatementCompletions(node) { var entries = []; var uniques = ts.createMap(); - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates, argumentInfo.argumentCount); - for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { - var candidate = candidates_1[_i]; - addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker, uniques); - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node, typeChecker, target, log) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false, typeChecker, target, log, /*allowStringLiteral*/ true); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + var current = node; + while (current) { + if (ts.isFunctionLike(current)) { + break; } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromType(type, typeChecker) { - if (type) { - var entries = []; - addStringLiteralCompletionsFromType(type, entries, typeChecker); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; + if (ts.isLabeledStatement(current)) { + var name = current.label.text; + if (!uniques.has(name)) { + uniques.set(name, true); + entries.push({ + name: name, + kindModifiers: "" /* none */, + kind: "label" /* label */, + sortText: "0" + }); + } } + current = current.parent; } - return undefined; + return entries; } - function addStringLiteralCompletionsFromType(type, result, typeChecker, uniques) { + var StringLiteralCompletionKind; + (function (StringLiteralCompletionKind) { + StringLiteralCompletionKind[StringLiteralCompletionKind["Paths"] = 0] = "Paths"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Properties"] = 1] = "Properties"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; + })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); + function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { + switch (node.parent.kind) { + case 177 /* LiteralType */: + switch (node.parent.parent.kind) { + case 161 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(node.parent), typeChecker) }; + case 175 /* IndexedAccessType */: + // Get all apparent property names + // i.e. interface Foo { + // foo: string; + // bar: string; + // } + // let x: Foo["/*completion position*/"] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeFromTypeNode(node.parent.parent.objectType).getApparentProperties() }; + default: + return undefined; + } + case 268 /* PropertyAssignment */: + if (ts.isObjectLiteralExpression(node.parent.parent) && node.parent.name === node) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + var type = typeChecker.getContextualType(node.parent.parent); + return { kind: 1 /* Properties */, symbols: type && type.getApparentProperties() }; + } + return fromContextualType(); + case 184 /* ElementAccessExpression */: { + var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeAtLocation(expression).getApparentProperties() }; + } + return undefined; + } + case 185 /* CallExpression */: + case 186 /* NewExpression */: + if (!ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) && !ts.isImportCall(node.parent)) { + var argumentInfo_1 = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + if (argumentInfo_1) { + var candidates = []; + typeChecker.getResolvedSignature(argumentInfo_1.invocation, candidates, argumentInfo_1.argumentCount); + var uniques_1 = ts.createMap(); + return { kind: 2 /* Types */, types: ts.flatMap(candidates, function (candidate) { return getStringLiteralTypes(typeChecker.getParameterType(candidate, argumentInfo_1.argumentIndex), typeChecker, uniques_1); }) }; + } + return fromContextualType(); + } + // falls through (is `require("")` or `import("")`) + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 252 /* ExternalModuleReference */: + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // var y = import("/*completion position*/"); + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + // export * from "/*completion position*/"; + return { kind: 0 /* Paths */, paths: Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; + default: + return fromContextualType(); + } + function fromContextualType() { + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker), typeChecker) }; + } + } + function getStringLiteralTypes(type, typeChecker, uniques) { if (uniques === void 0) { uniques = ts.createMap(); } if (type && type.flags & 32768 /* TypeParameter */) { - type = typeChecker.getBaseConstraintOfType(type); - } - if (!type) { - return; - } - if (type.flags & 131072 /* Union */) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - addStringLiteralCompletionsFromType(t, result, typeChecker, uniques); - } - } - else if (type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */)) { - var name = type.value; - if (!uniques.has(name)) { - uniques.set(name, true); - result.push({ - name: name, - kindModifiers: "" /* none */, - kind: "var" /* variableElement */, - sortText: "0" - }); - } + type = type.getConstraint(); } + return type && type.flags & 131072 /* Union */ + ? ts.flatMap(type.types, function (t) { return getStringLiteralTypes(t, typeChecker, uniques); }) + : type && type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */) && ts.addToSeen(uniques, type.value) + ? [type] + : ts.emptyArray; } function getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, _a, allSourceFiles) { var name = _a.name, source = _a.source; - var completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, { includeExternalModuleExports: true }, compilerOptions.target); + var completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, { includeExternalModuleExports: true, includeInsertTextCompletions: true }, compilerOptions.target); if (!completionData) { return { type: "none" }; } - var symbols = completionData.symbols, location = completionData.location, allowStringLiteral = completionData.allowStringLiteral, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, request = completionData.request; - if (request) { - return { type: "request", request: request }; + if (completionData.kind !== 0 /* Data */) { + return { type: "request", request: completionData }; } + var symbols = completionData.symbols, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.find(symbols, function (s) { - var origin = symbolToOriginInfoMap[ts.getSymbolId(s)]; - return getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral, origin) === name - && getSourceFromOrigin(origin) === source; - }); - return symbol ? { type: "symbol", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap } : { type: "none" }; + return ts.firstDefined(symbols, function (symbol) { + var origin = symbolToOriginInfoMap[ts.getSymbolId(symbol)]; + var info = getCompletionEntryDisplayNameForSymbol(symbol, compilerOptions.target, origin, completionKind); + return info && info.name === name && getSourceFromOrigin(origin) === source ? { type: "symbol", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap, previousToken: previousToken, isJsxInitializer: isJsxInitializer } : undefined; + }) || { type: "none" }; } function getSymbolName(symbol, origin, target) { - return origin && origin.isDefaultExport && symbol.name === "default" ? ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) : symbol.name; + return origin && origin.type === "export" && origin.isDefaultExport && symbol.escapedName === "default" /* Default */ + // Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase. + ? ts.firstDefined(symbol.declarations, function (d) { return ts.isExportAssignment(d) && ts.isIdentifier(d.expression) ? d.expression.text : undefined; }) + || ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) + : symbol.name; } - function getCompletionEntryDetails(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles, host, formatContext, getCanonicalFileName) { + function getCompletionEntryDetails(program, log, compilerOptions, sourceFile, position, entryId, allSourceFiles, host, formatContext, getCanonicalFileName) { + var typeChecker = program.getTypeChecker(); var name = entryId.name; // Compute all the completion symbols again. var symbolCompletion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); @@ -80292,26 +83780,26 @@ var ts; case "request": { var request = symbolCompletion.request; switch (request.kind) { - case "JsDocTagName": + case 1 /* JsDocTagName */: return ts.JsDoc.getJSDocTagNameCompletionDetails(name); - case "JsDocTag": + case 2 /* JsDocTag */: return ts.JsDoc.getJSDocTagCompletionDetails(name); - case "JsDocParameterName": + case 3 /* JsDocParameterName */: return ts.JsDoc.getJSDocParameterNameCompletionDetails(name); default: return ts.Debug.assertNever(request); } } case "symbol": { - var symbol = symbolCompletion.symbol, location = symbolCompletion.location, symbolToOriginInfoMap = symbolCompletion.symbolToOriginInfoMap; - var _a = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, typeChecker, host, compilerOptions, sourceFile, formatContext, getCanonicalFileName, allSourceFiles), codeActions = _a.codeActions, sourceDisplay = _a.sourceDisplay; + var symbol = symbolCompletion.symbol, location = symbolCompletion.location, symbolToOriginInfoMap = symbolCompletion.symbolToOriginInfoMap, previousToken = symbolCompletion.previousToken; + var _a = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, typeChecker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles), codeActions = _a.codeActions, sourceDisplay = _a.sourceDisplay; var kindModifiers = ts.SymbolDisplay.getSymbolModifiers(symbol); var _b = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location, location, 7 /* All */), displayParts = _b.displayParts, documentation = _b.documentation, symbolKind = _b.symbolKind, tags = _b.tags; return { name: name, kindModifiers: kindModifiers, kind: symbolKind, displayParts: displayParts, documentation: documentation, tags: tags, codeActions: codeActions, source: sourceDisplay }; } case "none": { // Didn't find a symbol with this name. See if we can find a keyword instead. - if (ts.some(getKeywordCompletions(0 /* None */), function (c) { return c.name === name; })) { + if (allKeywordsCompletions().some(function (c) { return c.name === name; })) { return { name: name, kind: "keyword" /* keyword */, @@ -80328,66 +83816,111 @@ var ts; } } Completions.getCompletionEntryDetails = getCompletionEntryDetails; - function getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, checker, host, compilerOptions, sourceFile, formatContext, getCanonicalFileName, allSourceFiles) { + function getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { var symbolOriginInfo = symbolToOriginInfoMap[ts.getSymbolId(symbol)]; - if (!symbolOriginInfo) { - return { codeActions: undefined, sourceDisplay: undefined }; - } - var moduleSymbol = symbolOriginInfo.moduleSymbol, isDefaultExport = symbolOriginInfo.isDefaultExport; - var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); - var moduleSymbols = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); - ts.Debug.assert(ts.contains(moduleSymbols, moduleSymbol)); - var sourceDisplay = [ts.textPart(ts.first(ts.codefix.getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, compilerOptions, getCanonicalFileName, host)))]; - var codeActions = ts.codefix.getCodeActionForImport(moduleSymbols, { - host: host, - checker: checker, - newLineCharacter: host.getNewLine(), - compilerOptions: compilerOptions, - sourceFile: sourceFile, - formatContext: formatContext, - symbolName: getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), - getCanonicalFileName: getCanonicalFileName, - symbolToken: undefined, - kind: isDefaultExport ? 1 /* Default */ : 0 /* Named */, - }); - return { sourceDisplay: sourceDisplay, codeActions: codeActions }; + return symbolOriginInfo && symbolOriginInfo.type === "export" + ? getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) + : { codeActions: undefined, sourceDisplay: undefined }; } - function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { - var result = []; - ts.codefix.forEachExternalModule(checker, allSourceFiles, function (module) { - for (var _i = 0, _a = checker.getExportsOfModule(module); _i < _a.length; _i++) { - var exported = _a[_i]; - if (ts.skipAlias(exported, checker) === exportedSymbol) { - result.push(module); - } - } - }); - return result; + function getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { + var moduleSymbol = symbolOriginInfo.moduleSymbol; + var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); + var _a = ts.codefix.getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, previousToken), moduleSpecifier = _a.moduleSpecifier, codeAction = _a.codeAction; + return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] }; } function getCompletionEntrySymbol(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles) { var completion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); return completion.type === "symbol" ? completion.symbol : undefined; } Completions.getCompletionEntrySymbol = getCompletionEntrySymbol; - function getRecommendedCompletion(currentToken, checker /*, symbolToOriginInfoMap: SymbolOriginInfoMap*/) { - var ty = checker.getContextualType(currentToken); + var CompletionDataKind; + (function (CompletionDataKind) { + CompletionDataKind[CompletionDataKind["Data"] = 0] = "Data"; + CompletionDataKind[CompletionDataKind["JsDocTagName"] = 1] = "JsDocTagName"; + CompletionDataKind[CompletionDataKind["JsDocTag"] = 2] = "JsDocTag"; + CompletionDataKind[CompletionDataKind["JsDocParameterName"] = 3] = "JsDocParameterName"; + })(CompletionDataKind || (CompletionDataKind = {})); + var CompletionKind; + (function (CompletionKind) { + CompletionKind[CompletionKind["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; + /** Note that sometimes we access completions from global scope, but use "None" instead of this. See isGlobalCompletionScope. */ + CompletionKind[CompletionKind["Global"] = 1] = "Global"; + CompletionKind[CompletionKind["PropertyAccess"] = 2] = "PropertyAccess"; + CompletionKind[CompletionKind["MemberLike"] = 3] = "MemberLike"; + CompletionKind[CompletionKind["String"] = 4] = "String"; + CompletionKind[CompletionKind["None"] = 5] = "None"; + })(CompletionKind || (CompletionKind = {})); + function getRecommendedCompletion(currentToken, position, sourceFile, checker) { + var ty = getContextualType(currentToken, position, sourceFile, checker); var symbol = ty && ty.symbol; // Don't include make a recommended completion for an abstract class return symbol && (symbol.flags & 384 /* Enum */ || symbol.flags & 32 /* Class */ && !ts.isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, currentToken, checker) : undefined; } + function getContextualType(currentToken, position, sourceFile, checker) { + var parent = currentToken.parent; + switch (currentToken.kind) { + case 71 /* Identifier */: + return getContextualTypeFromParent(currentToken, checker); + case 58 /* EqualsToken */: + switch (parent.kind) { + case 230 /* VariableDeclaration */: + return checker.getContextualType(parent.initializer); + case 198 /* BinaryExpression */: + return checker.getTypeAtLocation(parent.left); + case 260 /* JsxAttribute */: + return checker.getContextualTypeForJsxAttribute(parent); + default: + return undefined; + } + case 94 /* NewKeyword */: + return checker.getContextualType(parent); + case 73 /* CaseKeyword */: + return getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); + case 17 /* OpenBraceToken */: + return ts.isJsxExpression(parent) && parent.parent.kind !== 253 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + default: + var argInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(currentToken, position, sourceFile); + return argInfo + // At `,`, treat this as the next argument after the comma. + ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (currentToken.kind === 26 /* CommaToken */ ? 1 : 0)) + : isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) + // completion at `x ===/**/` should be for the right side + ? checker.getTypeAtLocation(parent.left) + : checker.getContextualType(currentToken); + } + } + function getContextualTypeFromParent(node, checker) { + var parent = node.parent; + switch (parent.kind) { + case 186 /* NewExpression */: + return checker.getContextualType(parent); + case 198 /* BinaryExpression */: { + var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return isEqualityOperatorKind(operatorToken.kind) + ? checker.getTypeAtLocation(node === right ? left : right) + : checker.getContextualType(node); + } + case 264 /* CaseClause */: + return parent.expression === node ? getSwitchedType(parent, checker) : undefined; + default: + return checker.getContextualType(node); + } + } + function getSwitchedType(caseClause, checker) { + return checker.getTypeAtLocation(caseClause.parent.parent.expression); + } function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { var chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ 67108863 /* All */, /*useOnlyExternalAliasing*/ false); if (chain) return ts.first(chain); - return isModuleSymbol(symbol.parent) ? symbol : symbol.parent && getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 269 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 272 /* SourceFile */; }); } function getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, options, target) { - var request; var start = ts.timestamp(); var currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); // TODO: GH#15853 // We will check for jsdoc comments with insideComment and getJsDocTagAtPosition. (TODO: that seems rather inefficient to check the same thing so many times.) @@ -80402,7 +83935,7 @@ var ts; if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { // The current position is next to the '@' sign, when no tag name being provided yet. // Provide a full list of tag names - request = { kind: "JsDocTagName" }; + return { kind: 1 /* JsDocTagName */ }; } else { // When completion is requested without "@", we will have check to make sure that @@ -80423,7 +83956,7 @@ var ts; // */ var lineStart = ts.getLineStartPositionForPosition(position, sourceFile); if (!(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/))) { - request = { kind: "JsDocTag" }; + return { kind: 2 /* JsDocTag */ }; } } } @@ -80433,37 +83966,22 @@ var ts; var tag = getJsDocTagAtPosition(currentToken, position); if (tag) { if (tag.tagName.pos <= position && position <= tag.tagName.end) { - request = { kind: "JsDocTagName" }; + return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 271 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 274 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ true); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 289 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 292 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); } } if (ts.isJSDocParameterTag(tag) && (ts.nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) { - request = { kind: "JsDocParameterName", tag: tag }; + return { kind: 3 /* JsDocParameterName */, tag: tag }; } } - if (request) { - return { - symbols: ts.emptyArray, - isGlobalCompletion: false, - isMemberCompletion: false, - allowStringLiteral: false, - isNewIdentifierLocation: false, - location: undefined, - isRightOfDot: false, - request: request, - keywordFilters: 0 /* None */, - symbolToOriginInfoMap: undefined, - recommendedCompletion: undefined, - }; - } if (!insideJsDocTagTypeExpression) { // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal // comment or the plain text part of a jsDoc comment, so no completion should be available @@ -80488,9 +84006,11 @@ var ts; // Also determine whether we are trying to complete with members of that node // or attributes of a JSX tag. var node = currentToken; + var propertyAccessToConvert; var isRightOfDot = false; var isRightOfOpenTag = false; var isStartingCloseTag = false; + var isJsxInitializer = false; var location = ts.getTouchingPropertyName(sourceFile, position, insideJsDocTagTypeExpression); // TODO: GH#15853 if (contextToken) { // Bail out if this is a known invalid completion location @@ -80500,57 +84020,82 @@ var ts; } var parent = contextToken.parent; if (contextToken.kind === 23 /* DotToken */) { - if (parent.kind === 180 /* PropertyAccessExpression */) { - node = contextToken.parent.expression; - isRightOfDot = true; - } - else if (parent.kind === 144 /* QualifiedName */) { - node = contextToken.parent.left; - isRightOfDot = true; - } - else { - // There is nothing that precedes the dot, so this likely just a stray character - // or leading into a '...' token. Just bail out instead. - return undefined; + isRightOfDot = true; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + propertyAccessToConvert = parent; + node = propertyAccessToConvert.expression; + break; + case 145 /* QualifiedName */: + node = parent.left; + break; + default: + // There is nothing that precedes the dot, so this likely just a stray character + // or leading into a '...' token. Just bail out instead. + return undefined; } } else if (sourceFile.languageVariant === 1 /* JSX */) { // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 180 /* PropertyAccessExpression */) { + if (parent && parent.kind === 183 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } + // Fix location + if (currentToken.parent === location) { + switch (currentToken.kind) { + case 29 /* GreaterThanToken */: + if (currentToken.parent.kind === 253 /* JsxElement */ || currentToken.parent.kind === 255 /* JsxOpeningElement */) { + location = currentToken; + } + break; + case 41 /* SlashToken */: + if (currentToken.parent.kind === 254 /* JsxSelfClosingElement */) { + location = currentToken; + } + break; + } + } switch (parent.kind) { - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (contextToken.kind === 41 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (!(parent.left.flags & 32768 /* ThisNodeHasError */)) { // It has a left-hand side, so we're not in an opening JSX tag. break; } // falls through - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: + case 255 /* JsxOpeningElement */: if (contextToken.kind === 27 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; + case 260 /* JsxAttribute */: + switch (previousToken.kind) { + case 58 /* EqualsToken */: + isJsxInitializer = true; + break; + case 71 /* Identifier */: + if (previousToken !== parent.name) { + isJsxInitializer = previousToken; + } + } + break; } } } var semanticStart = ts.timestamp(); - var isGlobalCompletion = false; - var isMemberCompletion; - var allowStringLiteral = false; - var isNewIdentifierLocation; + var completionKind = 5 /* None */; + var isNewIdentifierLocation = false; var keywordFilters = 0 /* None */; var symbols = []; var symbolToOriginInfoMap = []; @@ -80558,24 +84103,22 @@ var ts; getTypeScriptMemberSymbols(); } else if (isRightOfOpenTag) { - var tagSymbols = typeChecker.getJsxIntrinsicTagNames(); + var tagSymbols = ts.Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNames(), "getJsxIntrinsicTagNames() should all be defined"); if (tryGetGlobalSymbols()) { symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & (107455 /* Value */ | 2097152 /* Alias */)); })); } else { symbols = tagSymbols; } - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 3 /* MemberLike */; } else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; var tagSymbol = typeChecker.getSymbolAtLocation(tagName); - if (!typeChecker.isUnknownSymbol(tagSymbol)) { + if (tagSymbol) { symbols = [tagSymbol]; } - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 3 /* MemberLike */; } else { // For JavaScript or TypeScript, if we're not after a dot, then just try to get the @@ -80586,23 +84129,21 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - var recommendedCompletion = getRecommendedCompletion(previousToken, typeChecker); - return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, allowStringLiteral: allowStringLiteral, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request: request, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion }; + var recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, position, sourceFile, typeChecker); + return { kind: 0 /* Data */, symbols: symbols, completionKind: completionKind, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: - case 285 /* JSDocReturnTag */: - case 286 /* JSDocTypeTag */: - case 288 /* JSDocTypedefTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: + case 288 /* JSDocReturnTag */: + case 289 /* JSDocTypeTag */: + case 291 /* JSDocTypedefTag */: return true; } } function getTypeScriptMemberSymbols() { // Right of dot member completion list - isGlobalCompletion = false; - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 2 /* PropertyAccess */; // Since this is qualified name check its a type node location var isTypeLocation = insideJsDocTagTypeExpression || ts.isPartOfTypeNode(node.parent); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); @@ -80612,7 +84153,7 @@ var ts; symbol = ts.skipAlias(symbol, typeChecker); if (symbol.flags & (1536 /* Module */ | 384 /* Enum */)) { // Extract module or enum members - var exportedSymbols = typeChecker.getExportsOfModule(symbol); + var exportedSymbols = ts.Debug.assertEachDefined(typeChecker.getExportsOfModule(symbol), "getExportsOfModule() should all be defined"); var isValidValueAccess_1 = function (symbol) { return typeChecker.isValidPropertyAccess((node.parent), symbol.name); }; var isValidTypeAccess_1 = function (symbol) { return symbolCanBeReferencedAtTypeLocation(symbol); }; var isValidAccess = isRhsOfImportDeclaration ? @@ -80626,7 +84167,7 @@ var ts; } } // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). - if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 269 /* SourceFile */ && d.kind !== 234 /* ModuleDeclaration */ && d.kind !== 233 /* EnumDeclaration */; })) { + if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 272 /* SourceFile */ && d.kind !== 237 /* ModuleDeclaration */ && d.kind !== 236 /* EnumDeclaration */; })) { addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node)); } return; @@ -80647,10 +84188,9 @@ var ts; symbols.push.apply(symbols, getPropertiesForCompletion(type, typeChecker, /*isForAccess*/ true)); } else { - // Filter private properties for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccessForCompletions((node.parent), type, symbol)) { symbols.push(symbol); } } @@ -80671,7 +84211,7 @@ var ts; } if (tryGetConstructorLikeCompletionContainer(contextToken)) { // no members, only keywords - isMemberCompletion = false; + completionKind = 5 /* None */; // Declaring new property/method/accessor isNewIdentifierLocation = true; // Has keywords for constructor parameter @@ -80685,19 +84225,22 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 251 /* JsxSelfClosingElement */) || (jsxContainer.kind === 252 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 254 /* JsxSelfClosingElement */) || (jsxContainer.kind === 255 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes.properties); - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; isNewIdentifierLocation = false; return true; } } } + if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { + keywordFilters = 3 /* FunctionLikeBodyKeywords */; + } // Get all entities in the current scope. - isMemberCompletion = false; + completionKind = 5 /* None */; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); @@ -80731,40 +84274,55 @@ var ts; previousToken.getStart() : position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - if (scopeNode) { - isGlobalCompletion = - scopeNode.kind === 269 /* SourceFile */ || - scopeNode.kind === 197 /* TemplateExpression */ || - scopeNode.kind === 260 /* JsxExpression */ || - scopeNode.kind === 208 /* Block */ || // Some blocks aren't statements, but all get global completions - ts.isStatement(scopeNode); + if (isGlobalCompletionScope(scopeNode)) { + completionKind = 1 /* Global */; } var symbolMeanings = 793064 /* Type */ | 107455 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); + symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); + // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` + if (options.includeInsertTextCompletions && scopeNode.kind !== 272 /* SourceFile */) { + var thisType = typeChecker.tryGetThisTypeAt(scopeNode); + if (thisType) { + for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker, /*isForAccess*/ true); _i < _a.length; _i++) { + var symbol = _a[_i]; + symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { type: "this-type" }; + symbols.push(symbol); + } + } + } if (options.includeExternalModuleExports) { getSymbolsFromOtherSourceFileExports(symbols, previousToken && ts.isIdentifier(previousToken) ? previousToken.text : "", target); } filterGlobalCompletion(symbols); return true; } + function isGlobalCompletionScope(scopeNode) { + switch (scopeNode.kind) { + case 272 /* SourceFile */: + case 200 /* TemplateExpression */: + case 263 /* JsxExpression */: + case 211 /* Block */: + return true; + default: + return ts.isStatement(scopeNode); + } + } function filterGlobalCompletion(symbols) { + var isTypeCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + if (isTypeCompletion) + keywordFilters = 4 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { // export = /**/ here we want to get all meanings, so any symbol is ok if (ts.isExportAssignment(location.parent)) { return true; } - // This is an alias, follow what it aliases - if (symbol && symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } + symbol = ts.skipAlias(symbol, typeChecker); // import m = /**/ <-- It can only access namespace (if typing import = x. this would get member symbols and not namespace) if (ts.isInRightSideOfInternalImportEqualsDeclaration(location)) { return !!(symbol.flags & 1920 /* Namespace */); } - if (insideJsDocTagTypeExpression || - (!isContextTokenValueLocation(contextToken) && - (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)))) { + if (isTypeCompletion) { // Its a type, but you can reach it by namespace.type as well return symbolCanBeReferencedAtTypeLocation(symbol); } @@ -80776,24 +84334,25 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 103 /* TypeOfKeyword */ && - contextToken.parent.kind === 163 /* TypeQuery */; + contextToken.parent.kind === 164 /* TypeQuery */; } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 56 /* ColonToken */: - return parentKind === 150 /* PropertyDeclaration */ || - parentKind === 149 /* PropertySignature */ || - parentKind === 147 /* Parameter */ || - parentKind === 227 /* VariableDeclaration */ || + return parentKind === 151 /* PropertyDeclaration */ || + parentKind === 150 /* PropertySignature */ || + parentKind === 148 /* Parameter */ || + parentKind === 230 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 58 /* EqualsToken */: - return parentKind === 232 /* TypeAliasDeclaration */; + return parentKind === 235 /* TypeAliasDeclaration */; case 118 /* AsKeyword */: - return parentKind === 203 /* AsExpression */; + return parentKind === 206 /* AsExpression */; } } + return false; } function symbolCanBeReferencedAtTypeLocation(symbol) { symbol = symbol.exportSymbol || symbol; @@ -80814,27 +84373,24 @@ var ts; ts.codefix.forEachExternalModuleToImportFrom(typeChecker, sourceFile, allSourceFiles, function (moduleSymbol) { for (var _i = 0, _a = typeChecker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { var symbol = _a[_i]; - var name = symbol.name; // Don't add a completion for a re-export, only for the original. - // If `symbol.parent !== moduleSymbol`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. + // The actual import fix might end up coming from a re-export -- we don't compute that until getting completion details. + // This is just to avoid adding duplicate completion entries. + // + // If `symbol.parent !== ...`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. // If `some(...)`, this comes from an `export { foo } from "foo"` re-export, which creates a new symbol (thus isn't caught by the first check). - if (symbol.parent !== moduleSymbol || ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier; })) { + if (typeChecker.getMergedSymbol(symbol.parent) !== typeChecker.resolveExternalModuleSymbol(moduleSymbol) + || ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier; })) { continue; } - var isDefaultExport = name === "default"; + var isDefaultExport = symbol.name === "default" /* Default */; if (isDefaultExport) { - var localSymbol = ts.getLocalSymbolForExportDefault(symbol); - if (localSymbol) { - symbol = localSymbol; - name = localSymbol.name; - } - else { - name = ts.codefix.moduleSymbolToValidIdentifier(moduleSymbol, target); - } + symbol = ts.getLocalSymbolForExportDefault(symbol) || symbol; } - if (stringContainsCharactersInOrder(name.toLowerCase(), tokenTextLowerCase)) { + var origin = { type: "export", moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport }; + if (stringContainsCharactersInOrder(getSymbolName(symbol, origin, target).toLowerCase(), tokenTextLowerCase)) { symbols.push(symbol); - symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport }; + symbolToOriginInfoMap[ts.getSymbolId(symbol)] = origin; } } }); @@ -80885,11 +84441,11 @@ var ts; return true; } if (contextToken.kind === 29 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 252 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 255 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 253 /* JsxClosingElement */ || contextToken.parent.kind === 251 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 250 /* JsxElement */; + if (contextToken.parent.kind === 256 /* JsxClosingElement */ || contextToken.parent.kind === 254 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 253 /* JsxElement */; } } return false; @@ -80899,40 +84455,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 182 /* CallExpression */ // func( a, | - || containingNodeKind === 153 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 183 /* NewExpression */ // new C(a, | - || containingNodeKind === 178 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 195 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 161 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 185 /* CallExpression */ // func( a, | + || containingNodeKind === 154 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 186 /* NewExpression */ // new C(a, | + || containingNodeKind === 181 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 198 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 162 /* FunctionType */; // var x: (s: string, list| case 19 /* OpenParenToken */: - return containingNodeKind === 182 /* CallExpression */ // func( | - || containingNodeKind === 153 /* Constructor */ // constructor( | - || containingNodeKind === 183 /* NewExpression */ // new C(a| - || containingNodeKind === 186 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 169 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 185 /* CallExpression */ // func( | + || containingNodeKind === 154 /* Constructor */ // constructor( | + || containingNodeKind === 186 /* NewExpression */ // new C(a| + || containingNodeKind === 189 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 172 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 21 /* OpenBracketToken */: - return containingNodeKind === 178 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 158 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 145 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 128 /* ModuleKeyword */: // module | - case 129 /* NamespaceKeyword */:// namespace | + return containingNodeKind === 181 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 159 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 146 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 129 /* ModuleKeyword */: // module | + case 130 /* NamespaceKeyword */:// namespace | return true; case 23 /* DotToken */: - return containingNodeKind === 234 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 237 /* ModuleDeclaration */; // module A.| case 17 /* OpenBraceToken */: - return containingNodeKind === 230 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 233 /* ClassDeclaration */; // class A{ | case 58 /* EqualsToken */: - return containingNodeKind === 227 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 195 /* BinaryExpression */; // x = a| + return containingNodeKind === 230 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 198 /* BinaryExpression */; // x = a| case 14 /* TemplateHead */: - return containingNodeKind === 197 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 200 /* TemplateExpression */; // `aa ${| case 15 /* TemplateMiddle */: - return containingNodeKind === 206 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 209 /* TemplateSpan */; // `aa ${10} dd ${| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 151 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -80972,11 +84528,10 @@ var ts; */ function tryGetObjectLikeCompletionSymbols(objectLikeContainer) { // We're looking up possible property names from contextual/inferred/declared type. - isMemberCompletion = true; - allowStringLiteral = true; + completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 179 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 182 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -80987,7 +84542,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 175 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 178 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -80998,12 +84553,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = rootDeclaration.initializer || rootDeclaration.type || rootDeclaration.parent.parent.kind === 217 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 147 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 220 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 148 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 152 /* MethodDeclaration */ || rootDeclaration.parent.kind === 155 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 153 /* MethodDeclaration */ || rootDeclaration.parent.kind === 156 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -81018,7 +84573,7 @@ var ts; } if (typeMembers && typeMembers.length > 0) { // Add filtered items to the completion list - symbols = filterObjectMembersList(typeMembers, existingMembers); + symbols = filterObjectMembersList(typeMembers, ts.Debug.assertDefined(existingMembers)); } return true; } @@ -81038,15 +84593,15 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 242 /* NamedImports */ ? - 239 /* ImportDeclaration */ : - 245 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 245 /* NamedImports */ ? + 242 /* ImportDeclaration */ : + 248 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { return false; } - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; isNewIdentifierLocation = false; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) { @@ -81063,7 +84618,7 @@ var ts; */ function getGetClassLikeCompletionSymbols(classLikeDeclaration) { // We're looking up possible property names from parent type. - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; // Declaring new property/method/accessor isNewIdentifierLocation = true; // Has keywords for class elements @@ -81132,8 +84687,8 @@ var ts; case 17 /* OpenBraceToken */: // import { | case 26 /* CommaToken */:// import { a as 0, | switch (contextToken.parent.kind) { - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return contextToken.parent; } } @@ -81191,7 +84746,7 @@ var ts; } } // class c { method() { } | method2() { } } - if (location && location.kind === 290 /* SyntaxList */ && ts.isClassLike(location.parent)) { + if (location && location.kind === 293 /* SyntaxList */ && ts.isClassLike(location.parent)) { return location.parent; } return undefined; @@ -81214,6 +84769,21 @@ var ts; } return undefined; } + function tryGetFunctionLikeBodyCompletionContainer(contextToken) { + if (contextToken) { + var prev_1; + var container = ts.findAncestor(contextToken.parent, function (node) { + if (ts.isClassLike(node)) { + return "quit"; + } + if (ts.isFunctionLikeDeclaration(node) && prev_1 === node.body) { + return true; + } + prev_1 = node; + }); + return container && container; + } + } function tryGetContainingJsxElement(contextToken) { if (contextToken) { var parent = contextToken.parent; @@ -81221,14 +84791,14 @@ var ts; case 28 /* LessThanSlashToken */: case 41 /* SlashToken */: case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 258 /* JsxAttributes */: - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 251 /* JsxSelfClosingElement */ || parent.kind === 252 /* JsxOpeningElement */)) { + case 183 /* PropertyAccessExpression */: + case 261 /* JsxAttributes */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 254 /* JsxSelfClosingElement */ || parent.kind === 255 /* JsxOpeningElement */)) { return parent; } - else if (parent.kind === 257 /* JsxAttribute */) { + else if (parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81240,7 +84810,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent && ((parent.kind === 257 /* JsxAttribute */) || (parent.kind === 259 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 260 /* JsxAttribute */) || (parent.kind === 262 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81250,8 +84820,8 @@ var ts; break; case 18 /* CloseBraceToken */: if (parent && - parent.kind === 260 /* JsxExpression */ && - parent.parent && parent.parent.kind === 257 /* JsxAttribute */) { + parent.kind === 263 /* JsxExpression */ && + parent.parent && parent.parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81259,7 +84829,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 259 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 262 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81278,59 +84848,59 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 227 /* VariableDeclaration */ || - containingNodeKind === 228 /* VariableDeclarationList */ || - containingNodeKind === 209 /* VariableStatement */ || - containingNodeKind === 233 /* EnumDeclaration */ || // enum a { foo, | + return containingNodeKind === 230 /* VariableDeclaration */ || + containingNodeKind === 231 /* VariableDeclarationList */ || + containingNodeKind === 212 /* VariableStatement */ || + containingNodeKind === 236 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 23 /* DotToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [.| case 56 /* ColonToken */: - return containingNodeKind === 177 /* BindingElement */; // var {x :html| + return containingNodeKind === 180 /* BindingElement */; // var {x :html| case 21 /* OpenBracketToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [x| case 19 /* OpenParenToken */: - return containingNodeKind === 264 /* CatchClause */ || + return containingNodeKind === 267 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 17 /* OpenBraceToken */: - return containingNodeKind === 233 /* EnumDeclaration */ || // enum a { | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface a { | - containingNodeKind === 164 /* TypeLiteral */; // const x : { | + return containingNodeKind === 236 /* EnumDeclaration */ || // enum a { | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface a { | + containingNodeKind === 165 /* TypeLiteral */; // const x : { | case 25 /* SemicolonToken */: - return containingNodeKind === 149 /* PropertySignature */ && + return containingNodeKind === 150 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 231 /* InterfaceDeclaration */ || // interface a { f; | - contextToken.parent.parent.kind === 164 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 234 /* InterfaceDeclaration */ || // interface a { f; | + contextToken.parent.parent.kind === 165 /* TypeLiteral */); // const x : { a; | case 27 /* LessThanToken */: - return containingNodeKind === 230 /* ClassDeclaration */ || // class A< | - containingNodeKind === 200 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 232 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 233 /* ClassDeclaration */ || // class A< | + containingNodeKind === 203 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 235 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 115 /* StaticKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); + return containingNodeKind === 151 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); case 24 /* DotDotDotToken */: - return containingNodeKind === 147 /* Parameter */ || + return containingNodeKind === 148 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 176 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 179 /* ArrayBindingPattern */); // var [...z| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 147 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); + return containingNodeKind === 148 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); case 118 /* AsKeyword */: - return containingNodeKind === 243 /* ImportSpecifier */ || - containingNodeKind === 247 /* ExportSpecifier */ || - containingNodeKind === 241 /* NamespaceImport */; + return containingNodeKind === 246 /* ImportSpecifier */ || + containingNodeKind === 250 /* ExportSpecifier */ || + containingNodeKind === 244 /* NamespaceImport */; case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: if (isFromClassElementDeclaration(contextToken)) { return false; } @@ -81344,7 +84914,7 @@ var ts; case 110 /* LetKeyword */: case 76 /* ConstKeyword */: case 116 /* YieldKeyword */: - case 138 /* TypeKeyword */:// type htm| + case 139 /* TypeKeyword */:// type htm| return true; } // If the previous token is keyword correspoding to class member completion keyword @@ -81383,10 +84953,14 @@ var ts; case "yield": return true; } - return ts.isDeclarationName(contextToken) && !ts.isJsxAttribute(contextToken.parent); + return ts.isDeclarationName(contextToken) + && !ts.isJsxAttribute(contextToken.parent) + // Don't block completions if we're in `class C /**/`, because we're *past* the end of the identifier and might want to complete `extends`. + // If `contextToken !== previousToken`, this is `class C ex/**/`. + && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 153 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 154 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -81415,10 +84989,7 @@ var ts; var name = element.propertyName || element.name; existingImportsOrExports.set(name.escapedText, true); } - if (existingImportsOrExports.size === 0) { - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default"; }); - } - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" && !existingImportsOrExports.get(e.escapedName); }); + return exportsOfModule.filter(function (e) { return e.escapedName !== "default" /* Default */ && !existingImportsOrExports.get(e.escapedName); }); } /** * Filters out completion suggestions for named imports or exports. @@ -81427,19 +84998,19 @@ var ts; * do not occur at the current position and have not otherwise been typed. */ function filterObjectMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { + if (existingMembers.length === 0) { return contextualMemberSymbols; } var existingMemberNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 265 /* PropertyAssignment */ && - m.kind !== 266 /* ShorthandPropertyAssignment */ && - m.kind !== 177 /* BindingElement */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 268 /* PropertyAssignment */ && + m.kind !== 269 /* ShorthandPropertyAssignment */ && + m.kind !== 180 /* BindingElement */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -81447,7 +85018,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 177 /* BindingElement */ && m.propertyName) { + if (m.kind === 180 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 71 /* Identifier */) { existingName = m.propertyName.escapedText; @@ -81462,7 +85033,7 @@ var ts; } existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.escapedName); }); + return contextualMemberSymbols.filter(function (m) { return !existingMemberNames.get(m.escapedName); }); } /** * Filters out completion suggestions for class elements. @@ -81474,10 +85045,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 150 /* PropertyDeclaration */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 151 /* PropertyDeclaration */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -81532,98 +85103,79 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 257 /* JsxAttribute */) { + if (attr.kind === 260 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } } - return ts.filter(symbols, function (a) { return !seenNames.get(a.escapedName); }); + return symbols.filter(function (a) { return !seenNames.get(a.escapedName); }); } function isCurrentlyEditingNode(node) { return node.getStart() <= position && position <= node.getEnd(); } } - /** - * Get the name to be display in completion from a given symbol. - * - * @return undefined if the name is of external module - */ - function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, allowStringLiteral, origin) { + function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind) { var name = getSymbolName(symbol, origin, target); - if (!name) + if (name === undefined + // If the symbol is external module, don't show it in the completion list + // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) + || symbol.flags & 1536 /* Module */ && ts.startsWithQuote(name) + // If the symbol is the internal name of an ES symbol, it is not a valid entry. Internal names for ES symbols start with "__@" + || ts.isKnownSymbol(symbol)) { return undefined; - // First check of the displayName is not external module; if it is an external module, it is not valid entry - if (symbol.flags & 1920 /* Namespace */) { - var firstCharCode = name.charCodeAt(0); - if (ts.isSingleOrDoubleQuote(firstCharCode)) { - // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) + } + var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + if (ts.isIdentifierText(name, target)) + return validIdentiferResult; + switch (kind) { + case 3 /* MemberLike */: return undefined; - } + case 0 /* ObjectPropertyDeclaration */: + // TODO: GH#18169 + return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; + case 2 /* PropertyAccess */: + case 5 /* None */: + case 1 /* Global */: + // Don't add a completion for a name starting with a space. See https://github.com/Microsoft/TypeScript/pull/20547 + return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; + case 4 /* String */: + return validIdentiferResult; + default: + ts.Debug.assertNever(kind); } - // If the symbol is for a member of an object type and is the internal name of an ES - // symbol, it is not a valid entry. Internal names for ES symbols start with "__@" - if (symbol.flags & 106500 /* ClassMember */) { - var escapedName = symbol.escapedName; - if (escapedName.length >= 3 && - escapedName.charCodeAt(0) === 95 /* _ */ && - escapedName.charCodeAt(1) === 95 /* _ */ && - escapedName.charCodeAt(2) === 64 /* at */) { - return undefined; - } - } - return getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral); - } - /** - * Get a displayName from a given for completion list, performing any necessary quotes stripping - * and checking whether the name is valid identifier name. - */ - function getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral) { - // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an - // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. - // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. - // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. - if (performCharacterChecks && !ts.isIdentifierText(name, target)) { - // TODO: GH#18169 - return allowStringLiteral ? JSON.stringify(name) : undefined; - } - return name; } // A cache of completion entries for keywords, these do not change between sessions var _keywordCompletions = []; - function getKeywordCompletions(keywordFilter) { - var completions = _keywordCompletions[keywordFilter]; - if (completions) { - return completions; + var allKeywordsCompletions = ts.memoize(function () { + var res = []; + for (var i = 72 /* FirstKeyword */; i <= 144 /* LastKeyword */; i++) { + res.push({ + name: ts.tokenToString(i), + kind: "keyword" /* keyword */, + kindModifiers: "" /* none */, + sortText: "0" + }); } - return _keywordCompletions[keywordFilter] = generateKeywordCompletions(keywordFilter); - function generateKeywordCompletions(keywordFilter) { + return res; + }); + function getKeywordCompletions(keywordFilter) { + return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter(function (entry) { + var kind = ts.stringToToken(entry.name); switch (keywordFilter) { case 0 /* None */: - return getAllKeywordCompletions(); + // "undefined" is a global variable, so don't need a keyword completion for it. + return kind !== 140 /* UndefinedKeyword */; case 1 /* ClassElementKeywords */: - return getFilteredKeywordCompletions(isClassMemberCompletionKeywordText); + return isClassMemberCompletionKeyword(kind); case 2 /* ConstructorParameterKeywords */: - return getFilteredKeywordCompletions(isConstructorParameterCompletionKeywordText); + return isConstructorParameterCompletionKeyword(kind); + case 3 /* FunctionLikeBodyKeywords */: + return isFunctionLikeBodyCompletionKeyword(kind); + case 4 /* TypeKeywords */: + return ts.isTypeKeyword(kind); + default: + return ts.Debug.assertNever(keywordFilter); } - } - function getAllKeywordCompletions() { - var allKeywordsCompletions = []; - for (var i = 72 /* FirstKeyword */; i <= 143 /* LastKeyword */; i++) { - // "undefined" is a global variable, so don't need a keyword completion for it. - if (i === 139 /* UndefinedKeyword */) - continue; - allKeywordsCompletions.push({ - name: ts.tokenToString(i), - kind: "keyword" /* keyword */, - kindModifiers: "" /* none */, - sortText: "0" - }); - } - return allKeywordsCompletions; - } - function getFilteredKeywordCompletions(filterFn) { - return ts.filter(getKeywordCompletions(0 /* None */), function (entry) { return filterFn(entry.name); }); - } + })); } function isClassMemberCompletionKeyword(kind) { switch (kind) { @@ -81633,9 +85185,9 @@ var ts; case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: case 123 /* ConstructorKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 120 /* AsyncKeyword */: return true; } @@ -81648,21 +85200,39 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; } } function isConstructorParameterCompletionKeywordText(text) { return isConstructorParameterCompletionKeyword(ts.stringToToken(text)); } - function isEqualityExpression(node) { - return ts.isBinaryExpression(node) && isEqualityOperatorKind(node.operatorToken.kind); + function isFunctionLikeBodyCompletionKeyword(kind) { + switch (kind) { + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 132 /* ReadonlyKeyword */: + case 123 /* ConstructorKeyword */: + case 115 /* StaticKeyword */: + case 117 /* AbstractKeyword */: + case 125 /* GetKeyword */: + case 136 /* SetKeyword */: + case 140 /* UndefinedKeyword */: + return false; + } + return true; } function isEqualityOperatorKind(kind) { - return kind === 32 /* EqualsEqualsToken */ || - kind === 33 /* ExclamationEqualsToken */ || - kind === 34 /* EqualsEqualsEqualsToken */ || - kind === 35 /* ExclamationEqualsEqualsToken */; + switch (kind) { + case 34 /* EqualsEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + return true; + default: + return false; + } } /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */ function getJsDocTagAtPosition(node, position) { @@ -81696,19 +85266,18 @@ var ts; } /** * Gets all properties on a type, but if that type is a union of several types, - * tries to only include those types which declare properties, not methods. - * This ensures that we don't try providing completions for all the methods on e.g. Array. + * excludes array-like types or callable/constructable types. */ function getPropertiesForCompletion(type, checker, isForAccess) { if (!(type.flags & 131072 /* Union */)) { - return type.getApparentProperties(); + return ts.Debug.assertEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } var types = type.types; // If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals. var filteredTypes = isForAccess ? types : types.filter(function (memberType) { return !(memberType.flags & 16382 /* Primitive */ || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker)); }); - return checker.getAllPossiblePropertiesOfTypes(filteredTypes); + return ts.Debug.assertEachDefined(checker.getAllPossiblePropertiesOfTypes(filteredTypes), "getAllPossiblePropertiesOfTypes() should all be defined"); } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); @@ -81719,11 +85288,7 @@ var ts; (function (DocumentHighlights) { function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) { var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); - // Note that getTouchingWord indicates failure by returning the sourceFile node. - if (node === sourceFile) - return undefined; - ts.Debug.assert(node.parent !== undefined); - if (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent)) { + if (node.parent && (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent))) { // For a JSX element, just highlight the matching tag, not all references. var _a = node.parent.parent, openingElement = _a.openingElement, closingElement = _a.closingElement; var highlightSpans = [openingElement, closingElement].map(function (_a) { @@ -81732,7 +85297,7 @@ var ts; }); return [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; } - return getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); + return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); } DocumentHighlights.getDocumentHighlights = getDocumentHighlights; function getHighlightSpanForNode(node, sourceFile) { @@ -81742,8 +85307,8 @@ var ts; kind: "none" /* none */ }; } - function getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) { - var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(node, program, sourceFilesToSearch, cancellationToken); + function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { + var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken); return referenceEntries && convertReferencedSymbols(referenceEntries); } function convertReferencedSymbols(referenceEntries) { @@ -81796,15 +85361,20 @@ var ts; case 81 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); case 123 /* ConstructorKeyword */: - return useParent(node.parent, ts.isConstructorDeclaration, getConstructorOccurrences); + return getFromAllDeclarations(ts.isConstructorDeclaration, [123 /* ConstructorKeyword */]); case 125 /* GetKeyword */: - case 135 /* SetKeyword */: - return useParent(node.parent, ts.isAccessor, getGetAndSetOccurrences); + case 136 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [125 /* GetKeyword */, 136 /* SetKeyword */]); default: return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : undefined; } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, function (decl) { return ts.mapDefined(decl.symbol.declarations, function (d) { + return nodeTest(d) ? ts.find(d.getChildren(sourceFile), function (c) { return ts.contains(keywords, c.kind); }) : undefined; + }); }); + } function useParent(node, nodeTest, getNodes) { return nodeTest(node) ? highlightSpans(getNodes(node, sourceFile)) : undefined; } @@ -81817,30 +85387,15 @@ var ts; * into function boundaries and try-blocks with catch-clauses. */ function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (ts.isThrowStatement(node)) { - statementAccumulator.push(node); - } - else if (ts.isTryStatement(node)) { - if (node.catchClause) { - aggregate(node.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(node.tryBlock); - } - if (node.finallyBlock) { - aggregate(node.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } + if (ts.isThrowStatement(node)) { + return [node]; } + else if (ts.isTryStatement(node)) { + // Exceptions thrown within a try block lacking a catch clause are "owned" in the current context. + return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), aggregateOwnedThrowStatements(node.finallyBlock)); + } + // Do not cross function boundaries. + return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements); } /** * For lack of a better name, this function takes a throw statement and returns the @@ -81851,33 +85406,30 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 269 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 272 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === 225 /* TryStatement */) { - var tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } + if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) { + return child; } child = parent; } return undefined; } function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */) { - statementAccumulator.push(node); + return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + var result = []; + node.forEachChild(function (child) { + var value = cb(child); + if (value !== undefined) { + result.push.apply(result, ts.toArray(value)); } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } + }); + return result; } function ownsBreakOrContinueStatement(owner, statement) { var actualOwner = getBreakOrContinueOwner(statement); @@ -81886,17 +85438,17 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 222 /* SwitchStatement */: - if (statement.kind === 218 /* ContinueStatement */) { + case 225 /* SwitchStatement */: + if (statement.kind === 221 /* ContinueStatement */) { return false; } // falls through - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - return !statement.label || isLabeledBy(node, statement.label.text); + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. // TODO: GH#20090 @@ -81905,10 +85457,6 @@ var ts; }); } function getModifierOccurrences(modifier, declaration) { - // Make sure we only highlight the keyword when it makes sense to do so. - if (!isLegalModifier(modifier, declaration)) { - return undefined; - } var modifierFlag = ts.modifierToFlag(modifier); return ts.mapDefined(getNodesToSearchForModifier(declaration, modifierFlag), function (node) { if (ts.getModifierFlags(node) & modifierFlag) { @@ -81919,24 +85467,28 @@ var ts; }); } function getNodesToSearchForModifier(declaration, modifierFlag) { + // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 208 /* Block */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 211 /* Block */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration - if (modifierFlag & 128 /* Abstract */) { + if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return declaration.members.concat([declaration]); } else { return container.statements; } - case 153 /* Constructor */: - return container.parameters.concat(container.parent.members); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: { + return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : [])); + } + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -81951,33 +85503,7 @@ var ts; } return nodes; default: - ts.Debug.fail("Invalid container kind."); - } - } - function isLegalModifier(modifier, declaration) { - var container = declaration.parent; - switch (modifier) { - case 112 /* PrivateKeyword */: - case 113 /* ProtectedKeyword */: - case 114 /* PublicKeyword */: - switch (container.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return true; - case 153 /* Constructor */: - return declaration.kind === 147 /* Parameter */; - default: - return false; - } - case 115 /* StaticKeyword */: - return container.kind === 230 /* ClassDeclaration */ || container.kind === 200 /* ClassExpression */; - case 84 /* ExportKeyword */: - case 124 /* DeclareKeyword */: - return container.kind === 235 /* ModuleBlock */ || container.kind === 269 /* SourceFile */; - case 117 /* AbstractKeyword */: - return container.kind === 230 /* ClassDeclaration */ || declaration.kind === 230 /* ClassDeclaration */; - default: - return false; + ts.Debug.assertNever(container, "Invalid container kind."); } } function pushKeywordIf(keywordList, token) { @@ -81991,33 +85517,11 @@ var ts; } return false; } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 154 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 155 /* SetAccessor */); - return keywords; - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 125 /* GetKeyword */, 135 /* SetKeyword */); }); - } - } - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 123 /* ConstructorKeyword */); - }); - }); - return keywords; - } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 88 /* ForKeyword */, 106 /* WhileKeyword */, 81 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 213 /* DoStatement */) { + if (loopNode.kind === 216 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 106 /* WhileKeyword */)) { @@ -82026,8 +85530,7 @@ var ts; } } } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */, 77 /* ContinueKeyword */); } @@ -82038,13 +85541,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -82056,8 +85559,7 @@ var ts; // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 73 /* CaseKeyword */, 79 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */); } @@ -82077,36 +85579,36 @@ var ts; } return keywords; } - function getThrowOccurrences(throwStatement) { + function getThrowOccurrences(throwStatement, sourceFile) { var owner = getThrowStatementOwner(throwStatement); if (!owner) { return undefined; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); // If the "owner" is a function, then we equate 'return' and 'throw' statements in their // ability to "jump out" of the function, and include occurrences for both. if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); } return keywords; } - function getReturnOccurrences(returnStatement) { + function getReturnOccurrences(returnStatement, sourceFile) { var func = ts.getContainingFunction(returnStatement); if (!func) { return undefined; } var keywords = []; ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); // Include 'throw' statements that do not occur within a try block. ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); return keywords; } @@ -82170,12 +85672,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 223 /* LabeledStatement */; owner = owner.parent) { - if (owner.label.escapedText === labelName) { - return true; - } - } - return false; + return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName; }); } })(DocumentHighlights = ts.DocumentHighlights || (ts.DocumentHighlights = {})); })(ts || (ts = {})); @@ -82352,10 +85849,10 @@ var ts; } cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 227 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 230 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 71 /* Identifier */) { directImports.push(name); @@ -82366,19 +85863,24 @@ var ts; addIndirectUser(direct.getSourceFile()); } break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name); } + else if (ts.isDefaultImport(direct)) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(direct); + addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + directImports.push(direct); + } else { directImports.push(direct); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -82399,7 +85901,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 269 /* SourceFile */ || sourceFileLike.kind === 234 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 272 /* SourceFile */ || sourceFileLike.kind === 237 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -82454,7 +85956,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 238 /* ImportEqualsDeclaration */) { + if (decl.kind === 241 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -82468,7 +85970,7 @@ var ts; if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { return; } - if (decl.kind === 245 /* ExportDeclaration */) { + if (decl.kind === 248 /* ExportDeclaration */) { searchForNamedImport(decl.exportClause); return; } @@ -82477,7 +85979,7 @@ var ts; return; } var namedBindings = importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImportLike(namedBindings.name); return; } @@ -82529,7 +86031,7 @@ var ts; } } else { - var localSymbol = element.kind === 247 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 250 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -82538,14 +86040,14 @@ var ts; } function isNameMatch(name) { // Use name of "default" even in `export =` case because we may have allowSyntheticDefaultImports - return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === "default"; + return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === "default" /* Default */; } } /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */ function findNamespaceReExports(sourceFileLike, name, checker) { var namespaceImportSymbol = checker.getSymbolAtLocation(name); return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { - if (statement.kind !== 245 /* ExportDeclaration */) + if (statement.kind !== 248 /* ExportDeclaration */) return; var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; if (moduleSpecifier || !exportClause) @@ -82564,7 +86066,7 @@ var ts; for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { var referencingFile = sourceFiles_4[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 269 /* SourceFile */) { + if (searchSourceFile.kind === 272 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -82611,7 +86113,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 269 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 272 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -82626,18 +86128,18 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: { + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { action(decl, decl.moduleSpecifier); } break; } - case 238 /* ImportEqualsDeclaration */: { + case 241 /* ImportEqualsDeclaration */: { var decl = statement; var moduleReference = decl.moduleReference; - if (moduleReference.kind === 249 /* ExternalModuleReference */ && + if (moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */) { action(decl, moduleReference.expression); } @@ -82650,11 +86152,11 @@ var ts; function importerFromModuleSpecifier(moduleSpecifier) { var decl = moduleSpecifier.parent; switch (decl.kind) { - case 182 /* CallExpression */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 185 /* CallExpression */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return decl; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return decl.parent; default: ts.Debug.fail("Unexpected module specifier parent: " + decl.kind); @@ -82672,7 +86174,7 @@ var ts; function getExport() { var parent = node.parent; if (symbol.exportSymbol) { - if (parent.kind === 180 /* PropertyAccessExpression */) { + if (parent.kind === 183 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(parent.parent) @@ -82713,8 +86215,7 @@ var ts; } function getExportAssignmentExport(ex) { // Get the symbol for the `export =` node; its parent is the module it's the export of. - var exportingModuleSymbol = ex.symbol.parent; - ts.Debug.assert(!!exportingModuleSymbol); + var exportingModuleSymbol = ts.Debug.assertDefined(ex.symbol.parent, "Expected export symbol to have a parent"); var exportKind = ex.isExportEquals ? 2 /* ExportEquals */ : 1 /* Default */; return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } }; } @@ -82730,7 +86231,11 @@ var ts; default: return undefined; } - var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.cast(node.left, ts.isPropertyAccessExpression).name) : symbol; + // Better detection for GH#20803 + if (sym && !(checker.getMergedSymbol(sym.parent).flags & 1536 /* Module */)) { + ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.showSymbol(sym) + ", parent is " + ts.Debug.showSymbol(sym.parent)); + } return sym && exportInfo(sym, kind); } } @@ -82752,7 +86257,7 @@ var ts; // If `importedName` is undefined, do continue searching as the export is anonymous. // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.) var importedName = symbolName(importedSymbol); - if (importedName === undefined || importedName === "default" || importedName === symbol.escapedName) { + if (importedName === undefined || importedName === "default" /* Default */ || importedName === symbol.escapedName) { return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); } } @@ -82768,24 +86273,24 @@ var ts; FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; function getExportEqualsLocalSymbol(importedSymbol, checker) { if (importedSymbol.flags & 2097152 /* Alias */) { - return checker.getImmediateAliasedSymbol(importedSymbol); + return ts.Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol)); } var decl = importedSymbol.valueDeclaration; if (ts.isExportAssignment(decl)) { - return decl.expression.symbol; + return ts.Debug.assertDefined(decl.expression.symbol); } else if (ts.isBinaryExpression(decl)) { - return decl.right.symbol; + return ts.Debug.assertDefined(decl.right.symbol); } - ts.Debug.fail(); + return ts.Debug.fail(); } // If a reference is a class expression, the exported node would be its parent. // If a reference is a variable declaration, the exported node would be the variable statement. function getExportNode(parent, node) { - if (parent.kind === 227 /* VariableDeclaration */) { + if (parent.kind === 230 /* VariableDeclaration */) { var p = parent; return p.name !== node ? undefined : - p.parent.kind === 264 /* CatchClause */ ? undefined : p.parent.parent.kind === 209 /* VariableStatement */ ? p.parent.parent : undefined; + p.parent.kind === 267 /* CatchClause */ ? undefined : p.parent.parent.kind === 212 /* VariableStatement */ ? p.parent.parent : undefined; } else { return parent; @@ -82794,15 +86299,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent) ? { isNamedImport: false } : undefined; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return parent.propertyName ? undefined : { isNamedImport: true }; - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return { isNamedImport: false }; default: @@ -82810,13 +86315,16 @@ var ts; } } function getExportInfo(exportSymbol, exportKind, checker) { - var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + var moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return undefined; // This can happen if an `export` is not at the top-level (which is a compile error). + var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation. // `export` may appear in a namespace. In that case, just rely on global search. return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; } FindAllReferences.getExportInfo = getExportInfo; function symbolName(symbol) { - if (symbol.escapedName !== "default") { + if (symbol.escapedName !== "default" /* Default */) { return symbol.escapedName; } return ts.forEach(symbol.declarations, function (decl) { @@ -82826,7 +86334,7 @@ var ts; } /** If at an export specifier, go to the symbol it refers to. */ function skipExportSpecifierSymbol(symbol, checker) { - // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. + // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. if (symbol.declarations) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; @@ -82841,22 +86349,22 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 269 /* SourceFile */) { + if (parent.kind === 272 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 235 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); + ts.Debug.assert(parent.kind === 238 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); return parent.parent; } function isAmbientModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + return node.kind === 237 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; } function isExternalModuleImportEquals(_a) { var moduleReference = _a.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + return moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -82872,37 +86380,30 @@ var ts; FindAllReferences.nodeEntry = nodeEntry; function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { var referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); - if (!referencedSymbols || !referencedSymbols.length) { - return undefined; - } - var out = []; var checker = program.getTypeChecker(); - for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { - var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + return !referencedSymbols || !referencedSymbols.length ? undefined : ts.mapDefined(referencedSymbols, function (_a) { + var definition = _a.definition, references = _a.references; // Only include referenced symbols that have a valid definition. - if (definition) { - out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); - } - } - return out; + return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }; + }); } FindAllReferences.findReferencedSymbols = findReferencedSymbols; function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) { // A node in a JSDoc comment can't have an implementation anyway. var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ false); - var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node); + var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); var checker = program.getTypeChecker(); return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; - function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node) { - if (node.kind === 269 /* SourceFile */) { + function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { + if (node.kind === 272 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var result_4 = []; FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_4.push(nodeEntry(node)); }); return result_4; @@ -82915,7 +86416,7 @@ var ts; } else { // Perform "Find all References" and retrieve only those that are implementations - return getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, { implementations: true }); + return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { implementations: true }); } } function findReferencedEntries(program, cancellationToken, sourceFiles, sourceFile, position, options) { @@ -82923,14 +86424,14 @@ var ts; return ts.map(x, toReferenceEntry); } FindAllReferences.findReferencedEntries = findReferencedEntries; - function getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options)); + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)); } FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; function findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options) { var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - return FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options); + return FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); } function flattenEntries(referenceSymbols) { return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); @@ -82941,8 +86442,8 @@ var ts; case "symbol": { var symbol = def.symbol, node_3 = def.node; var _a = getDefinitionKindAndDisplayParts(symbol, node_3, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; - var name_5 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: node_3, name: name_5, kind: kind_1, displayParts: displayParts_1 }; + var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_3, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case "label": { var node_4 = def.node; @@ -82950,8 +86451,8 @@ var ts; } case "keyword": { var node_5 = def.node; - var name_6 = ts.tokenToString(node_5.kind); - return { node: node_5, name: name_6, kind: "keyword" /* keyword */, displayParts: [{ text: name_6, kind: "keyword" /* keyword */ }] }; + var name_5 = ts.tokenToString(node_5.kind); + return { node: node_5, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; } case "this": { var node_6 = def.node; @@ -83014,13 +86515,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, node, checker); } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(20 /* CloseParenToken */)] }; } - else if (node.kind === 200 /* ClassExpression */) { + else if (node.kind === 203 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(20 /* CloseParenToken */)] @@ -83069,10 +86570,11 @@ var ts; var Core; (function (Core) { /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ - function getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - if (node.kind === 269 /* SourceFile */) { - return undefined; + if (ts.isSourceFile(node)) { + var reference = ts.GoToDefinition.getReferenceAtPosition(node, position, program); + return reference && getReferencedSymbolsForModule(program, program.getTypeChecker().getMergedSymbol(reference.file.symbol), sourceFiles); } if (!options.implementations) { var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); @@ -83085,11 +86587,7 @@ var ts; // Could not find a symbol e.g. unknown identifier if (!symbol) { // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial. - if (!options.implementations && node.kind === 9 /* StringLiteral */) { - return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); - } - // Can't have references to something that we have no symbol for. - return undefined; + return !options.implementations && ts.isStringLiteral(node) ? getReferencesForStringLiteral(node, sourceFiles, cancellationToken) : undefined; } if (symbol.flags & 1536 /* Module */ && isModuleReferenceLocation(node)) { return getReferencedSymbolsForModule(program, symbol, sourceFiles); @@ -83098,16 +86596,16 @@ var ts; } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; function isModuleReferenceLocation(node) { - if (node.kind !== 9 /* StringLiteral */) { + if (!ts.isStringLiteralLike(node)) { return false; } switch (node.parent.kind) { - case 234 /* ModuleDeclaration */: - case 249 /* ExternalModuleReference */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 237 /* ModuleDeclaration */: + case 252 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return true; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent); default: return false; @@ -83130,10 +86628,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: references.push({ type: "node", node: decl.name }); break; default: @@ -83173,14 +86671,14 @@ var ts; } /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { - symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; // Compute the meaning from the location and the symbol it references var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); var result = []; - var state = new State(sourceFiles, /*isForConstructor*/ node.kind === 123 /* ConstructorKeyword */, checker, cancellationToken, searchMeaning, options, result); + var state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result); if (node.kind === 79 /* DefaultKeyword */) { addReference(node, symbol, node, state); - searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: 1 /* Default */ }, state); + searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } else { var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); @@ -83201,8 +86699,22 @@ var ts; } return result; } + function getSpecialSearchKind(node) { + switch (node.kind) { + case 123 /* ConstructorKeyword */: + return 1 /* Constructor */; + case 71 /* Identifier */: + if (ts.isClassLike(node.parent)) { + ts.Debug.assert(node.parent.name === node); + return 2 /* Class */; + } + // falls through + default: + return 0 /* None */; + } + } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifier(symbol, node, checker) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { var parent = node.parent; if (ts.isExportSpecifier(parent)) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); @@ -83211,18 +86723,34 @@ var ts; // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. return checker.getImmediateAliasedSymbol(symbol); } - return symbol; + // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. + return ts.firstDefined(symbol.declarations, function (decl) { + if (!decl.parent) { + // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. + ts.Debug.assert(decl.kind === 272 /* SourceFile */); + ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); + } + return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent) + ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) + : undefined; + }); } + var SpecialSearchKind; + (function (SpecialSearchKind) { + SpecialSearchKind[SpecialSearchKind["None"] = 0] = "None"; + SpecialSearchKind[SpecialSearchKind["Constructor"] = 1] = "Constructor"; + SpecialSearchKind[SpecialSearchKind["Class"] = 2] = "Class"; + })(SpecialSearchKind || (SpecialSearchKind = {})); /** * Holds all state needed for the finding references. * Unlike `Search`, there is only one `State`. */ var State = /** @class */ (function () { function State(sourceFiles, - /** True if we're searching for constructor references. */ - isForConstructor, checker, cancellationToken, searchMeaning, options, result) { + /** True if we're searching for constructor references. */ + specialSearchKind, checker, cancellationToken, searchMeaning, options, result) { this.sourceFiles = sourceFiles; - this.isForConstructor = isForConstructor; + this.specialSearchKind = specialSearchKind; this.checker = checker; this.cancellationToken = cancellationToken; this.searchMeaning = searchMeaning; @@ -83264,6 +86792,9 @@ var ts; State.prototype.createSearch = function (location, symbol, comingFrom, searchOptions) { if (searchOptions === void 0) { searchOptions = {}; } // Note: if this is an external module symbol, the name doesn't include quotes. + // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`. + // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form + // here appears to be intentional). var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; var escapedText = ts.escapeLeadingUnderscores(text); var parents = this.options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, this.checker); @@ -83356,9 +86887,9 @@ var ts; checker.getPropertySymbolOfDestructuringAssignment(location); } function getObjectBindingElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 177 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 180 /* BindingElement */); if (bindingElement && - bindingElement.parent.kind === 175 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 178 /* ObjectBindingPattern */ && !bindingElement.propertyName) { return bindingElement; } @@ -83388,7 +86919,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 187 /* FunctionExpression */ || valueDeclaration.kind === 200 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 190 /* FunctionExpression */ || valueDeclaration.kind === 203 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -83398,7 +86929,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 230 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 233 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -83427,7 +86958,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -83576,11 +87107,18 @@ var ts; getReferenceForShorthandProperty(referenceSymbol, search, state); return; } - if (state.isForConstructor) { - findConstructorReferences(referenceLocation, sourceFile, search, state); - } - else { - addReference(referenceLocation, relatedSymbol, search.location, state); + switch (state.specialSearchKind) { + case 0 /* None */: + addReference(referenceLocation, relatedSymbol, search.location, state); + break; + case 1 /* Constructor */: + addConstructorReferences(referenceLocation, sourceFile, search, state); + break; + case 2 /* Class */: + addClassStaticThisReferences(referenceLocation, search, state); + break; + default: + ts.Debug.assertNever(state.specialSearchKind); } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } @@ -83618,14 +87156,16 @@ var ts; } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { - searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); } function addRef() { addReference(referenceLocation, localSymbol, search.location, state); } } function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; } function isExportSpecifierAlias(referenceLocation, exportSpecifier) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; @@ -83679,24 +87219,48 @@ var ts; } } /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ - function findConstructorReferences(referenceLocation, sourceFile, search, state) { + function addConstructorReferences(referenceLocation, sourceFile, search, state) { if (ts.isNewExpressionTarget(referenceLocation)) { addReference(referenceLocation, search.symbol, search.location, state); } - var pusher = state.referenceAdder(search.symbol, search.location); + var pusher = function () { return state.referenceAdder(search.symbol, search.location); }; if (ts.isClassLike(referenceLocation.parent)) { - ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + ts.Debug.assert(referenceLocation.kind === 79 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); // This is the class declaration containing the constructor. - findOwnConstructorReferences(search.symbol, sourceFile, pusher); + findOwnConstructorReferences(search.symbol, sourceFile, pusher()); } else { // If this class appears in `extends C`, then the extending class' "super" calls are references. var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending)) { - findSuperConstructorAccesses(classExtending, pusher); + if (classExtending) { + findSuperConstructorAccesses(classExtending, pusher()); } } } + function addClassStaticThisReferences(referenceLocation, search, state) { + addReference(referenceLocation, search.symbol, search.location, state); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + // This is the class declaration. + addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location)); + } + } + function addStaticThisReferences(classLike, pusher) { + for (var _i = 0, _a = classLike.members; _i < _a.length; _i++) { + var member = _a[_i]; + if (!(ts.isMethodOrAccessor(member) && ts.hasModifier(member, 32 /* Static */))) { + continue; + } + member.body.forEachChild(function cb(node) { + if (node.kind === 99 /* ThisKeyword */) { + pusher(node); + } + else if (!ts.isFunctionLike(node)) { + node.forEachChild(cb); + } + }); + } + } function getPropertyAccessExpressionFromRightHandSide(node) { return ts.isRightSideOfPropertyAccess(node) && node.parent; } @@ -83708,12 +87272,12 @@ var ts; for (var _i = 0, _a = classSymbol.members.get("__constructor" /* Constructor */).declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 123 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 153 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 154 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 152 /* MethodDeclaration */) { + if (decl && decl.kind === 153 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 99 /* ThisKeyword */, function (thisKeyword) { @@ -83734,7 +87298,7 @@ var ts; } for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 153 /* Constructor */); + ts.Debug.assert(decl.kind === 154 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 97 /* SuperKeyword */, function (node) { @@ -83754,7 +87318,7 @@ var ts; if (refNode.kind !== 71 /* Identifier */) { return; } - if (refNode.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 269 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -83768,12 +87332,12 @@ var ts; var containingTypeReference = getContainingTypeReference(refNode); if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { var parent = containingTypeReference.parent; - if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + if (ts.hasType(parent) && parent.type === containingTypeReference && ts.hasInitializer(parent) && isImplementationExpression(parent.initializer)) { addReference(parent.initializer); } else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { var body = parent.body; - if (body.kind === 208 /* Block */) { + if (body.kind === 211 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { addReference(returnStatement.expression); @@ -83814,12 +87378,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ - && node.parent.kind === 263 /* HeritageClause */ + if (node.kind === 205 /* ExpressionWithTypeArguments */ + && node.parent.kind === 266 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 71 /* Identifier */ || node.kind === 180 /* PropertyAccessExpression */) { + else if (node.kind === 71 /* Identifier */ || node.kind === 183 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -83830,13 +87394,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 178 /* ArrayLiteralExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 181 /* ArrayLiteralExpression */: return true; default: return false; @@ -83890,7 +87454,7 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } @@ -83918,13 +87482,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -83955,27 +87519,27 @@ var ts; // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -83984,58 +87548,58 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 269 /* SourceFile */) { + if (searchSpaceNode.kind === 272 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this"); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, staticFlag, references); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, references); } return [{ definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (!node || !ts.isThis(node)) { - return; - } - var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); - switch (searchSpaceNode.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - if (searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - // Make sure the container belongs to the same class - // and has the appropriate static modifier from the original container. - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 269 /* SourceFile */: - if (container.kind === 269 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - } - }); - } + } + function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, result) { + ts.forEach(possiblePositions, function (position) { + var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); + if (!node || !ts.isThis(node)) { + return; + } + var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); + switch (searchSpaceNode.kind) { + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + if (searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 272 /* SourceFile */: + if (container.kind === 272 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + } + }); } function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; @@ -84063,13 +87627,13 @@ var ts; // This is not needed when searching for re-exports. function populateSearchSymbolSet(symbol, location, checker, implementations) { // The search set contains at least the current symbol - var result = [symbol]; + var result = []; var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { // If the location is name of property symbol from object literal destructuring pattern // Search the property symbol // for ( { property: p2 } of elems) { } - if (containingObjectLiteralElement.kind !== 266 /* ShorthandPropertyAssignment */) { + if (containingObjectLiteralElement.kind !== 269 /* ShorthandPropertyAssignment */) { var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); if (propertySymbol) { result.push(propertySymbol); @@ -84078,9 +87642,10 @@ var ts; // If the location is in a context sensitive location (i.e. in an object literal) try // to get a contextual type for it, and add the property symbol from the contextual // type to the search set - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - ts.addRange(result, checker.getRootSymbols(contextualSymbol)); - }); + for (var _i = 0, _a = getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker); _i < _a.length; _i++) { + var contextualSymbol = _a[_i]; + addRootSymbols(contextualSymbol); + } /* Because in short-hand property assignment, location has two meaning : property name and as value of the property * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of * property name and variable declaration of the identifier. @@ -84116,9 +87681,7 @@ var ts; // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list for (var _i = 0, _a = checker.getRootSymbols(sym); _i < _a.length; _i++) { var rootSymbol = _a[_i]; - if (rootSymbol !== sym) { - result.push(rootSymbol); - } + result.push(rootSymbol); // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), checker); @@ -84163,7 +87726,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -84201,9 +87764,7 @@ var ts; // compare to our searchSymbol var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - return ts.find(checker.getRootSymbols(contextualSymbol), search.includes); - }); + var contextualSymbol = ts.firstDefined(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), findRootSymbol); if (contextualSymbol) { return contextualSymbol; } @@ -84229,7 +87790,7 @@ var ts; function findRootSymbol(sym) { // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) // Or a union property, use its underlying unioned symbols - return ts.forEach(state.checker.getRootSymbols(sym), function (rootSymbol) { + return ts.firstDefined(checker.getRootSymbols(sym), function (rootSymbol) { // if it is in the list, then we are done if (search.includes(rootSymbol)) { return rootSymbol; @@ -84239,11 +87800,11 @@ var ts; // parent symbol if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { // Parents will only be defined if implementations is true - if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, checker); })) { return undefined; } var result = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), state.checker); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), checker); return ts.find(result, search.includes); } return undefined; @@ -84251,7 +87812,7 @@ var ts; } } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -84263,26 +87824,11 @@ var ts; } /** Gets all symbols for one property. Does not get symbols for every property. */ function getPropertySymbolsFromContextualType(node, checker) { - var objectLiteral = node.parent; - var contextualType = checker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(node.parent); var name = getNameFromObjectLiteralElement(node); - if (name && contextualType) { - var result_5 = []; - var symbol = contextualType.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - if (contextualType.flags & 131072 /* Union */) { - ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - }); - } - return result_5; - } - return undefined; + var symbol = contextualType && name && contextualType.getProperty(name); + return symbol ? [symbol] : + contextualType && contextualType.flags & 131072 /* Union */ ? ts.mapDefined(contextualType.types, function (t) { return t.getProperty(name); }) : ts.emptyArray; } /** * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations @@ -84317,32 +87863,30 @@ var ts; if (!node) { return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 227 /* VariableDeclaration */) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); - } + else if (ts.isVariableLike(node) && ts.hasInitializer(node)) { + return true; + } + else if (node.kind === 230 /* VariableDeclaration */) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); } else if (ts.isFunctionLike(node)) { return !!node.body || ts.hasModifier(node, 2 /* Ambient */); } else { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return true; } } return false; } function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 209 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 228 /* VariableDeclarationList */); + if (node.parent && node.parent.parent && node.parent.parent.kind === 212 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 231 /* VariableDeclarationList */); return node.parent.parent; } } @@ -84408,21 +87952,9 @@ var ts; var GoToDefinition; (function (GoToDefinition) { function getDefinitionAtPosition(program, sourceFile, position) { - /// Triple slash reference comments - var comment = findReferenceInPosition(sourceFile.referencedFiles, position); - if (comment) { - var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); - if (referenceFile) { - return [getDefinitionInfoForFileReference(comment.fileName, referenceFile.fileName)]; - } - // Might still be on jsdoc, so keep looking. - } - // Type reference directives - var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); - if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); - return referenceFile && referenceFile.resolvedFileName && - [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; + var reference = getReferenceAtPosition(sourceFile, position, program); + if (reference) { + return [getDefinitionInfoForFileReference(reference.fileName, reference.file.fileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); if (node === sourceFile) { @@ -84460,7 +87992,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -84510,6 +88042,21 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; + function getReferenceAtPosition(sourceFile, position, program) { + var referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); + if (referencePath) { + var file = ts.tryResolveScriptReference(program, sourceFile, referencePath); + return file && { fileName: referencePath.fileName, file: file }; + } + var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); + if (typeReferenceDirective) { + var reference = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + var file = reference && program.getSourceFile(reference.resolvedFileName); + return file && { fileName: typeReferenceDirective.fileName, file: file }; + } + return undefined; + } + GoToDefinition.getReferenceAtPosition = getReferenceAtPosition; /// Goto type function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) { var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); @@ -84517,26 +88064,14 @@ var ts; return undefined; } var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - return undefined; - } - var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + var type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node); if (!type) { return undefined; } if (type.flags & 131072 /* Union */ && !(type.flags & 16 /* Enum */)) { - var result_6 = []; - ts.forEach(type.types, function (t) { - if (t.symbol) { - ts.addRange(/*to*/ result_6, /*from*/ getDefinitionFromSymbol(typeChecker, t.symbol, node)); - } - }); - return result_6; + return ts.flatMap(type.types, function (t) { return t.symbol && getDefinitionFromSymbol(typeChecker, t.symbol, node); }); } - if (!type.symbol) { - return undefined; - } - return getDefinitionFromSymbol(typeChecker, type.symbol, node); + return type.symbol && getDefinitionFromSymbol(typeChecker, type.symbol, node); } GoToDefinition.getTypeDefinitionAtPosition = getTypeDefinitionAtPosition; function getDefinitionAndBoundSpan(program, sourceFile, position) { @@ -84547,10 +88082,7 @@ var ts; // Check if position is on triple slash reference. var comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (comment) { - return { - definitions: definitions, - textSpan: ts.createTextSpanFromBounds(comment.pos, comment.end) - }; + return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) }; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); var textSpan = ts.createTextSpan(node.getStart(), node.getWidth()); @@ -84570,77 +88102,48 @@ var ts; return true; } switch (declaration.kind) { - case 240 /* ImportClause */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: return true; - case 243 /* ImportSpecifier */: - return declaration.parent.kind === 242 /* NamedImports */; + case 246 /* ImportSpecifier */: + return declaration.parent.kind === 245 /* NamedImports */; default: return false; } } function getDefinitionFromSymbol(typeChecker, symbol, node) { - var result = []; - var declarations = symbol.getDeclarations(); var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); - } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { + return getConstructSignatureDefinition() || getCallSignatureDefinition() || ts.map(symbol.declarations, function (declaration) { return createDefinitionInfo(declaration, symbolKind, symbolName, containerName); }); + function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (ts.isNewExpressionTarget(location) || location.kind === 123 /* ConstructorKeyword */) { - if (symbol.flags & 32 /* Class */) { - // Find the first class-like declaration and try to get the construct signature. - for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.isClassLike(declaration)) { - return tryAddSignature(declaration.members, /*selectConstructors*/ true, symbolKind, symbolName, containerName, result); - } - } - ts.Debug.fail("Expected declaration to have at least one class-like declaration"); - } + if (symbol.flags & 32 /* Class */ && (ts.isNewExpressionTarget(node) || node.kind === 123 /* ConstructorKeyword */)) { + var cls = ts.find(symbol.declarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); + return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } - return false; } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location) || ts.isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result); - } - return false; + function getCallSignatureDefinition() { + return ts.isCallExpressionTarget(node) || ts.isNewExpressionTarget(node) || ts.isNameOfFunctionDeclaration(node) + ? getSignatureDefinition(symbol.declarations, /*selectConstructors*/ false) + : undefined; } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + function getSignatureDefinition(signatureDeclarations, selectConstructors) { if (!signatureDeclarations) { - return false; + return undefined; } - var declarations = []; - var definition; - for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { - var d = signatureDeclarations_1[_i]; - if (selectConstructors ? d.kind === 153 /* Constructor */ : isSignatureDeclaration(d)) { - declarations.push(d); - if (d.body) - definition = d; - } - } - if (declarations.length) { - result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); - return true; - } - return false; + var declarations = signatureDeclarations.filter(selectConstructors ? ts.isConstructorDeclaration : isSignatureDeclaration); + return declarations.length + ? [createDefinitionInfo(ts.find(declarations, function (d) { return !!d.body; }) || ts.last(declarations), symbolKind, symbolName, containerName)] + : undefined; } } function isSignatureDeclaration(node) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return true; default: return false; @@ -84682,6 +88185,7 @@ var ts; } return undefined; } + GoToDefinition.findReferenceInPosition = findReferenceInPosition; function getDefinitionInfoForFileReference(name, targetFileName) { return { fileName: targetFileName, @@ -84720,7 +88224,6 @@ var ts; (function (ts) { var JsDoc; (function (JsDoc) { - var singleLineTemplate = { newText: "/** */", caretOffset: 3 }; var jsDocTagNames = [ "augments", "author", @@ -84758,6 +88261,7 @@ var ts; "see", "since", "static", + "template", "throws", "type", "typedef", @@ -84774,18 +88278,29 @@ var ts; // from Array - Array and Array var documentationComment = []; forEachUnique(declarations, function (declaration) { - ts.forEach(ts.getAllJSDocs(declaration), function (doc) { - if (doc.comment) { - if (documentationComment.length) { - documentationComment.push(ts.lineBreakPart()); - } - documentationComment.push(ts.textPart(doc.comment)); + for (var _i = 0, _a = getCommentHavingNodes(declaration); _i < _a.length; _i++) { + var comment = _a[_i].comment; + if (comment === undefined) + continue; + if (documentationComment.length) { + documentationComment.push(ts.lineBreakPart()); } - }); + documentationComment.push(ts.textPart(comment)); + } }); return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getCommentHavingNodes(declaration) { + switch (declaration.kind) { + case 292 /* JSDocPropertyTag */: + return [declaration]; + case 291 /* JSDocTypedefTag */: + return [declaration.parent]; + default: + return ts.getJSDocCommentsAndTags(declaration); + } + } function getJsDocTagsFromDeclarations(declarations) { // Only collect doc comments from duplicate declarations once. var tags = []; @@ -84801,25 +88316,28 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return withNode(tag.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 288 /* JSDocTypedefTag */: - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: + case 291 /* JSDocTypedefTag */: + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: return comment; } function withNode(node) { - return node.getText() + " " + comment; + return addComment(node.getText()); } function withList(list) { - return list.map(function (x) { return x.getText(); }) + " " + comment; + return addComment(list.map(function (x) { return x.getText(); }).join(", ")); + } + function addComment(s) { + return comment === undefined ? s : s + " " + comment; } } /** @@ -84830,7 +88348,7 @@ var ts; function forEachUnique(array, callback) { if (array) { for (var i = 0; i < array.length; i++) { - if (ts.indexOf(array, array[i]) === i) { + if (array.indexOf(array[i]) === i) { var result = callback(array[i], i); if (result) { return result; @@ -84911,9 +88429,16 @@ var ts; /** * Checks if position points to a valid position to add JSDoc comments, and if so, * returns the appropriate template. Otherwise returns an empty string. - * Invalid positions are - * - within comments, strings (including template literals and regex), and JSXText - * - within a token + * Valid positions are + * - outside of comments, statements, and expressions, and + * - preceding a: + * - function/constructor/method declaration + * - class declarations + * - variable statements + * - namespace declarations + * - interface declarations + * - method signatures + * - type alias declarations * * Hosts should ideally check that: * - The line is all whitespace up to 'position' before performing the insertion. @@ -84936,29 +88461,33 @@ var ts; } var commentOwnerInfo = getCommentOwnerInfo(tokenAtPos); if (!commentOwnerInfo) { - // if climbing the tree did not find a declaration with parameters, complete to a single line comment - return singleLineTemplate; - } - var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; - if (commentOwner.kind === 10 /* JsxText */) { return undefined; } - if (commentOwner.getStart() < position || parameters.length === 0) { - // if climbing the tree found a declaration with parameters but the request was made inside it - // or if there are no parameters, complete to a single line comment - return singleLineTemplate; + var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; + if (commentOwner.getStart() < position) { + return undefined; + } + if (!parameters || parameters.length === 0) { + // if there are no parameters, just complete to a single line JSDoc comment + var singleLineResult = "/** */"; + return { newText: singleLineResult, caretOffset: 3 }; } var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; // replace non-whitespace characters in prefix with spaces. var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); - var docParams = parameters.map(function (_a, i) { - var name = _a.name; - var nameText = ts.isIdentifier(name) ? name.text : "param" + i; - var type = isJavaScriptFile ? "{any} " : ""; - return indentationStr + " * @param " + type + nameText + newLine; - }).join(""); + var docParams = ""; + for (var i = 0; i < parameters.length; i++) { + var currentName = parameters[i].name; + var paramName = currentName.kind === 71 /* Identifier */ ? currentName.escapedText : "param" + i; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } + } // A doc comment consists of the following // * The opening comment line // * the first line (without a param) for the object's untagged info (this is also where the caret ends up) @@ -84978,23 +88507,35 @@ var ts; function getCommentOwnerInfo(tokenAtPos) { for (var commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 152 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 209 /* VariableStatement */: { + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 150 /* PropertySignature */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 235 /* TypeAliasDeclaration */: + return { commentOwner: commentOwner }; + case 212 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer) : undefined; - return parameters_1 ? { commentOwner: commentOwner, parameters: parameters_1 } : undefined; + return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 269 /* SourceFile */: + case 272 /* SourceFile */: return undefined; - case 195 /* BinaryExpression */: { + case 237 /* ModuleDeclaration */: + // If in walking up the tree, we hit a a nested namespace declaration, + // then we must be somewhere within a dotted namespace name; however we don't + // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. + return commentOwner.parent.kind === 237 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 198 /* BinaryExpression */: { var be = commentOwner; if (ts.getSpecialPropertyAssignmentKind(be) === 0 /* None */) { return undefined; @@ -85002,10 +88543,6 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 10 /* JsxText */: { - var parameters_3 = ts.emptyArray; - return { commentOwner: commentOwner, parameters: parameters_3 }; - } } } } @@ -85018,17 +88555,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 186 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 189 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return rightHandSide.parameters; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { return member.parameters; } } @@ -85038,16 +88575,88 @@ var ts; } })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + function stringToInt(str) { + var n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error("Error in parseInt(" + JSON.stringify(str) + ")"); + } + return n; + } + var isPrereleaseRegex = /^(.*)-next.\d+/; + var prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + var semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + var Semver = /** @class */ (function () { + function Semver(major, minor, patch, + /** + * If true, this is `major.minor.0-next.patch`. + * If false, this is `major.minor.patch`. + */ + isPrerelease) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.isPrerelease = isPrerelease; + } + Semver.parse = function (semver) { + var isPrerelease = isPrereleaseRegex.test(semver); + var result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error("Unexpected semver: " + semver + " (isPrerelease: " + isPrerelease + ")"); + } + return result; + }; + Semver.fromRaw = function (_a) { + var major = _a.major, minor = _a.minor, patch = _a.patch, isPrerelease = _a.isPrerelease; + return new Semver(major, minor, patch, isPrerelease); + }; + // This must parse the output of `versionString`. + Semver.tryParse = function (semver, isPrerelease) { + // Per the semver spec : + // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." + var rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; + var match = rgx.exec(semver); + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; + }; + Object.defineProperty(Semver.prototype, "versionString", { + get: function () { + return this.isPrerelease ? this.major + "." + this.minor + ".0-next." + this.patch : this.major + "." + this.minor + "." + this.patch; + }, + enumerable: true, + configurable: true + }); + Semver.prototype.equals = function (sem) { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + }; + Semver.prototype.greaterThan = function (sem) { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); + }; + return Semver; + }()); + ts.Semver = Semver; +})(ts || (ts = {})); // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// /// /// +/// /* @internal */ var ts; (function (ts) { var JsTyping; (function (JsTyping) { + /* @internal */ + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = ts.Semver.parse(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest")); + return !availableVersion.greaterThan(cachedTyping.version); + } + JsTyping.isTypingUpToDate = isTypingUpToDate; /* @internal */ JsTyping.nodeCoreModuleList = [ "buffer", "querystring", "events", "http", "cluster", @@ -85076,11 +88685,11 @@ var ts; * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ - function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; } @@ -85117,9 +88726,9 @@ var ts; addInferredTypings(module, "Inferred typings from unresolved imports"); } // Add the cached typing locations for inferred typings that are already installed - packageNameToTypingLocation.forEach(function (typingLocation, name) { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); + packageNameToTypingLocation.forEach(function (typing, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { + inferredTypings.set(name, typing.typingLocation); } }); // Remove typings that the user has added to the exclude list @@ -85211,8 +88820,8 @@ var ts; if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } - var result_7 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - var packageJson = result_7.config; + var result_5 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + var packageJson = result_5.config; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. @@ -85343,7 +88952,7 @@ var ts; if (!shouldKeepItem(declaration, checker)) { continue; } - // It was a match! If the pattern has dots in it, then also see if the + // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. var containerMatches = matches; if (patternMatcher.patternContainsDots) { @@ -85359,9 +88968,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 240 /* ImportClause */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -85372,8 +88981,8 @@ var ts; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); // This is a case sensitive match, only if all the submatches were case sensitive. - for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { - var match = matches_2[_i]; + for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { + var match = matches_1[_i]; if (!match.isCaseSensitive) { return false; } @@ -85388,7 +88997,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (name.kind === 145 /* ComputedPropertyName */) { + else if (name.kind === 146 /* ComputedPropertyName */) { return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); } else { @@ -85410,7 +89019,7 @@ var ts; } return true; } - if (expression.kind === 180 /* PropertyAccessExpression */) { + if (expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -85424,7 +89033,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -85442,8 +89051,8 @@ var ts; function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); var bestMatchKind = ts.PatternMatchKind.camelCase; - for (var _i = 0, matches_3 = matches; _i < matches_3.length; _i++) { - var match = matches_3[_i]; + for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { + var match = matches_2[_i]; var kind = match.kind; if (kind < bestMatchKind) { bestMatchKind = kind; @@ -85605,7 +89214,7 @@ var ts; return; } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -85617,21 +89226,21 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 152 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -85643,7 +89252,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -85654,8 +89263,8 @@ var ts; } } break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var _d = node, name = _d.name, initializer = _d.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -85676,12 +89285,12 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: startNode(node); for (var _e = 0, _f = node.members; _e < _f.length; _e++) { var member = _f[_e]; @@ -85691,9 +89300,9 @@ var ts; } endNode(); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: startNode(node); for (var _g = 0, _h = node.members; _g < _h.length; _g++) { var member = _h[_g]; @@ -85701,18 +89310,18 @@ var ts; } endNode(); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 247 /* ExportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 158 /* IndexSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 232 /* TypeAliasDeclaration */: + case 250 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 159 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 235 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var special = ts.getSpecialPropertyAssignmentKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -85733,7 +89342,7 @@ var ts; if (ts.hasJSDocNodes(node)) { ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -85790,12 +89399,12 @@ var ts; return false; } switch (a.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -85804,7 +89413,7 @@ var ts; // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { - return a.body.kind === b.body.kind && (a.body.kind !== 234 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 237 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -85834,7 +89443,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -85842,18 +89451,18 @@ var ts; return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName)); } switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: return getFunctionOrClassName(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var name = ts.getNameOfDeclaration(node); @@ -85864,16 +89473,16 @@ var ts; } } switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -85881,15 +89490,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return "new()"; - case 156 /* CallSignature */: + case 157 /* CallSignature */: return "()"; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "[]"; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -85901,7 +89510,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 209 /* VariableStatement */) { + if (parentNode && parentNode.kind === 212 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 71 /* Identifier */) { @@ -85930,24 +89539,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 269 /* SourceFile */: - case 232 /* TypeAliasDeclaration */: - case 288 /* JSDocTypedefTag */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 235 /* TypeAliasDeclaration */: + case 291 /* JSDocTypedefTag */: return true; - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 227 /* VariableDeclaration */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 230 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -85957,10 +89566,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -85969,7 +89578,7 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 227 /* VariableDeclaration */ && childKind !== 177 /* BindingElement */; + return childKind !== 230 /* VariableDeclaration */ && childKind !== 180 /* BindingElement */; }); } } @@ -86025,7 +89634,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -86036,18 +89645,16 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 234 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 237 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 145 /* ComputedPropertyName */; + return !member.name || member.name.kind === 146 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 269 /* SourceFile */ - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 272 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 227 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 230 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -86056,14 +89663,14 @@ var ts; if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 227 /* VariableDeclaration */) { + else if (node.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 195 /* BinaryExpression */ && + else if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 265 /* PropertyAssignment */ && node.parent.name) { + else if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512 /* Default */) { @@ -86075,9 +89682,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: return true; default: return false; @@ -86087,6 +89694,164 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var OrganizeImports; + (function (OrganizeImports) { + function organizeImports(sourceFile, formatContext, host) { + // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) + // All of the old ImportDeclarations in the file, in syntactic order. + var oldImportDecls = sourceFile.statements.filter(ts.isImportDeclaration); + if (oldImportDecls.length === 0) { + return []; + } + var oldImportGroups = ts.group(oldImportDecls, function (importDecl) { return getExternalModuleName(importDecl.moduleSpecifier); }); + var sortedImportGroups = ts.stableSort(oldImportGroups, function (group1, group2) { + return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); + }); + var newImportDecls = ts.flatMap(sortedImportGroups, function (importGroup) { + return getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup)) + : importGroup; + }); + var changeTracker = ts.textChanges.ChangeTracker.fromContext({ host: host, formatContext: formatContext }); + // Delete or replace the first import. + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: ts.getNewLineOrDefaultFromHost(host, formatContext.options), + }); + } + // Delete any subsequent imports. + for (var i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + return changeTracker.getChanges(); + } + OrganizeImports.organizeImports = organizeImports; + function removeUnusedImports(oldImports) { + return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) + } + function getExternalModuleName(specifier) { + return ts.isStringLiteral(specifier) || ts.isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + /* @internal */ // Internal for testing + /** + * @param importGroup a list of ImportDeclarations, all with the same module name. + */ + function coalesceImports(importGroup) { + if (importGroup.length === 0) { + return importGroup; + } + var _a = getImportParts(importGroup), importWithoutClause = _a.importWithoutClause, defaultImports = _a.defaultImports, namespaceImports = _a.namespaceImports, namedImports = _a.namedImports; + var coalescedImports = []; + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + var defaultImportClause = defaultImports[0].parent; + coalescedImports.push(updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + return coalescedImports; + } + var sortedNamespaceImports = ts.stableSort(namespaceImports, function (n1, n2) { return compareIdentifiers(n1.name, n2.name); }); + for (var _i = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _i < sortedNamespaceImports_1.length; _i++) { + var namespaceImport = sortedNamespaceImports_1[_i]; + // Drop the name, if any + coalescedImports.push(updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + } + if (defaultImports.length === 0 && namedImports.length === 0) { + return coalescedImports; + } + var newDefaultImport; + var newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (var _b = 0, defaultImports_1 = defaultImports; _b < defaultImports_1.length; _b++) { + var defaultImport = defaultImports_1[_b]; + newImportSpecifiers.push(ts.createImportSpecifier(ts.createIdentifier("default"), defaultImport)); + } + } + newImportSpecifiers.push.apply(newImportSpecifiers, ts.flatMap(namedImports, function (n) { return n.elements; })); + var sortedImportSpecifiers = ts.stableSort(newImportSpecifiers, function (s1, s2) { + return compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name); + }); + var importClause = defaultImports.length > 0 + ? defaultImports[0].parent + : namedImports[0].parent; + var newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? ts.createNamedImports(sortedImportSpecifiers) + : ts.updateNamedImports(namedImports[0], sortedImportSpecifiers); + coalescedImports.push(updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + return coalescedImports; + function getImportParts(importGroup) { + var importWithoutClause; + var defaultImports = []; + var namespaceImports = []; + var namedImports = []; + for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) { + var importDeclaration = importGroup_1[_i]; + if (importDeclaration.importClause === undefined) { + // Only the first such import is interesting - the others are redundant. + // Note: Unfortunately, we will lose trivia that was on this node. + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + var _a = importDeclaration.importClause, name = _a.name, namedBindings = _a.namedBindings; + if (name) { + defaultImports.push(name); + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + namespaceImports.push(namedBindings); + } + else { + namedImports.push(namedBindings); + } + } + } + return { + importWithoutClause: importWithoutClause, + defaultImports: defaultImports, + namespaceImports: namespaceImports, + namedImports: namedImports, + }; + } + function compareIdentifiers(s1, s2) { + return ts.compareStringsCaseSensitive(s1.text, s2.text); + } + function updateImportDeclarationAndClause(importClause, name, namedBindings) { + var importDeclaration = importClause.parent; + return ts.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.updateImportClause(importClause, name, namedBindings), importDeclaration.moduleSpecifier); + } + } + OrganizeImports.coalesceImports = coalesceImports; + /* internal */ // Exported for testing + function compareModuleSpecifiers(m1, m2) { + var name1 = getExternalModuleName(m1); + var name2 = getExternalModuleName(m2); + return ts.compareBooleans(name1 === undefined, name2 === undefined) || + ts.compareBooleans(ts.isExternalModuleNameRelative(name1), ts.isExternalModuleNameRelative(name2)) || + ts.compareStringsCaseSensitive(name1, name2); + } + OrganizeImports.compareModuleSpecifiers = compareModuleSpecifiers; + })(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { @@ -86181,24 +89946,24 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(n)) { - return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 188 /* ArrowFunction */); + return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 191 /* ArrowFunction */); } // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 213 /* DoStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 264 /* CatchClause */: + case 216 /* DoStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 267 /* CatchClause */: return spanForNode(n.parent); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -86213,16 +89978,16 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile)); } - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanForNode(n.parent); - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 236 /* CaseBlock */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 239 /* CaseBlock */: return spanForNode(n); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 21 /* OpenBracketToken */); } function spanForObjectOrArrayLiteral(node, open) { @@ -86884,7 +90649,7 @@ var ts; if (token === 124 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 128 /* ModuleKeyword */) { + if (token === 129 /* ModuleKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { recordAmbientExternalModule(); @@ -86917,7 +90682,7 @@ var ts; else { if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -86948,7 +90713,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -86964,7 +90729,7 @@ var ts; token = nextToken(); if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -86994,7 +90759,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -87006,7 +90771,7 @@ var ts; } else if (token === 39 /* AsteriskToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -87031,7 +90796,7 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 132 /* RequireKeyword */) { + if (token === 133 /* RequireKeyword */) { token = nextToken(); if (token === 19 /* OpenParenToken */) { token = nextToken(); @@ -87088,7 +90853,7 @@ var ts; // import "mod"; // import d from "mod" // import {a as A } from "mod"; - // import * as NS from "mod" + // import * as NS from "mod" // import d, {a, b as B} from "mod" // import i = require("mod"); // import("mod"); @@ -87188,9 +90953,16 @@ var ts; symbol.parent.flags & 1536 /* Module */) { return undefined; } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + if (!kind) { + return undefined; + } + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 146 /* ComputedPropertyName */) + ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) + : undefined; + var displayName = specifierName || typeChecker.symbolToString(symbol); + var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); + return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile); } } else if (node.kind === 9 /* StringLiteral */) { @@ -87289,17 +91061,13 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 182 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 185 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. var callExpression = argumentInfo.invocation; var expression = callExpression.expression; - var name = expression.kind === 71 /* Identifier */ - ? expression - : expression.kind === 180 /* PropertyAccessExpression */ - ? expression.name - : undefined; + var name = ts.isIdentifier(expression) ? expression : ts.isPropertyAccessExpression(expression) ? expression.name : undefined; if (!name || !name.escapedText) { return undefined; } @@ -87375,25 +91143,25 @@ var ts; var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } - else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 187 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0, sourceFile); } } - else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 206 /* TemplateSpan */ && node.parent.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 209 /* TemplateSpan */ && node.parent.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 16 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -87424,7 +91192,7 @@ var ts; function getArgumentIndex(argumentsList, node) { // The list we got back can include commas. In the presence of errors it may // also just have nodes without commas. For example "Foo(a b c)" will have 3 - // args without commas. We want to find what index we're at. So we count + // args without commas. We want to find what index we're at. So we count // forward until we hit ourselves, only incrementing the index if it isn't a // comma. // @@ -87434,9 +91202,8 @@ var ts; // that trailing comma in the list, and we'll have generated the appropriate // arg index. var argumentIndex = 0; - var listChildren = argumentsList.getChildren(); - for (var _i = 0, listChildren_1 = listChildren; _i < listChildren_1.length; _i++) { - var child = listChildren_1[_i]; + for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; if (child === node) { break; } @@ -87450,12 +91217,12 @@ var ts; // The argument count for a list is normally the number of non-comma children it has. // For example, if you have "Foo(a,b)" then there will be three children of the arg // list 'a' '' 'b'. So, in this case the arg count will be 2. However, there - // is a small subtlety. If you have "Foo(a,)", then the child list will just have + // is a small subtlety. If you have "Foo(a,)", then the child list will just have // 'a' ''. So, in the case where the last child is a comma, we increase the // arg count by one to compensate. // - // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then - // we'll have: 'a' '' '' + // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then + // we'll have: 'a' '' '' // That will give us 2 non-commas. We then add one for the last comma, giving us an // arg count of 3. var listChildren = argumentsList.getChildren(); @@ -87476,9 +91243,11 @@ var ts; // not enough to put us in the substitution expression; we should consider ourselves part of // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). // + // tslint:disable no-double-space // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` // ^ ^ ^ ^ ^ ^ ^ ^ ^ // Case: 1 1 3 2 1 3 2 2 1 + // tslint:enable no-double-space ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); if (ts.isTemplateLiteralKind(node.kind)) { if (ts.isInsideTemplateLiteral(node, position)) { @@ -87490,9 +91259,7 @@ var ts; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. - var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = ts.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; if (argumentIndex !== 0) { ts.Debug.assertLessThan(argumentIndex, argumentCount); } @@ -87525,12 +91292,11 @@ var ts; // Otherwise, we will not show signature help past the expression. // For example, // - // ` ${ 1 + 1 foo(10) - // | | - // + // ` ${ 1 + 1 foo(10) + // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -87539,7 +91305,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 269 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 272 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -87563,12 +91329,14 @@ var ts; ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); return children[indexOfOpenerToken + 1]; } + var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */; function createSignatureHelpItems(candidates, resolvedSignature, argumentListInfo, typeChecker) { var argumentCount = argumentListInfo.argumentCount, applicableSpan = argumentListInfo.argumentsSpan, invocation = argumentListInfo.invocation, argumentIndex = argumentListInfo.argumentIndex; var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */; var callTarget = ts.getInvokedExpression(invocation); var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); + var printer = ts.createPrinter({ removeComments: true }); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; var prefixDisplayParts = []; @@ -87584,14 +91352,19 @@ var ts; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : ts.emptyArray; suffixDisplayParts.push(ts.punctuationPart(29 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.thisParameter, candidateSignature.parameters, writer, invocation); + var thisParameter = candidateSignature.thisParameter ? [typeChecker.symbolToParameterDeclaration(candidateSignature.thisParameter, invocation, signatureHelpNodeBuilderFlags)] : []; + var params = ts.createNodeArray(thisParameter.concat(ts.map(candidateSignature.parameters, function (param) { return typeChecker.symbolToParameterDeclaration(param, invocation, signatureHelpNodeBuilderFlags); }))); + printer.writeList(1296 /* CallExpressionArguments */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); ts.addRange(suffixDisplayParts, parameterParts); } else { isVariadic = candidateSignature.hasRestParameter; var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); + if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { + var args = ts.createNodeArray(ts.map(candidateSignature.typeParameters, function (p) { return typeChecker.typeParameterToDeclaration(p, invocation); })); + printer.writeList(26896 /* TypeParameters */, args, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); + } }); ts.addRange(prefixDisplayParts, typeParameterParts); prefixDisplayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); @@ -87599,7 +91372,15 @@ var ts; suffixDisplayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = typeChecker.getTypePredicateOfSignature(candidateSignature); + if (predicate) { + typeChecker.writeTypePredicate(predicate, invocation, /*flags*/ undefined, writer); + } + else { + typeChecker.writeType(typeChecker.getReturnTypeOfSignature(candidateSignature), invocation, /*flags*/ undefined, writer); + } }); ts.addRange(suffixDisplayParts, returnTypeParts); return { @@ -87620,7 +91401,8 @@ var ts; return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; function createSignatureHelpParameterForParameter(parameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); + var param = typeChecker.symbolToParameterDeclaration(parameter, invocation, signatureHelpNodeBuilderFlags); + printer.writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: parameter.name, @@ -87631,7 +91413,8 @@ var ts; } function createSignatureHelpParameterForTypeParameter(typeParameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); + var param = typeChecker.typeParameterToDeclaration(typeParameter, invocation); + printer.writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: typeParameter.symbol.name, @@ -87652,7 +91435,7 @@ var ts; function getSymbolKind(typeChecker, symbol, location) { var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -87735,9 +91518,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: return location.kind === 71 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -87746,13 +91531,17 @@ var ts; return "" /* unknown */; } function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 + var nodeModifiers = symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) : "" /* none */; + var symbolModifiers = symbol && symbol.flags & 16777216 /* Optional */ ? + "optional" /* optionalModifier */ + : "" /* none */; + return nodeModifiers && symbolModifiers ? nodeModifiers + "," + symbolModifiers : nodeModifiers || symbolModifiers; } SymbolDisplay.getSymbolModifiers = getSymbolModifiers; // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location - function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { + function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning, alias) { if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; @@ -87762,6 +91551,8 @@ var ts; var hasAddedSymbolInfo; var isThisExpression = location.kind === 99 /* ThisKeyword */ && ts.isExpression(location); var type; + var printer; + var documentationFromAlias; // Class at constructor site need to be shown as constructor apart from property,method, vars if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) { // If it is accessor they are allowed only if location is at name of the accessor @@ -87770,7 +91561,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 180 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 183 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -87791,7 +91582,7 @@ var ts; if (callExpressionLike) { var candidateSignatures = []; signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - var useConstructSignatures = callExpressionLike.kind === 183 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 186 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -87829,14 +91620,14 @@ var ts; displayParts.push(ts.punctuationPart(56 /* ColonToken */)); displayParts.push(ts.spacePart()); if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 4 /* AllowAnyNodeKind */ | 1 /* WriteTypeParametersOrArguments */)); displayParts.push(ts.lineBreakPart()); } if (useConstructSignatures) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - addSignatureDisplayParts(signature, allSignatures, 16 /* WriteArrowStyleSignature */); + addSignatureDisplayParts(signature, allSignatures, 262144 /* WriteArrowStyleSignature */); break; default: // Just signature @@ -87846,7 +91637,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 153 /* Constructor */)) { + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 154 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -87854,21 +91645,21 @@ var ts; return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 153 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 154 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 153 /* Constructor */) { + if (functionDeclaration_1.kind === 154 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 156 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 157 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -87877,7 +91668,8 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */)) { + addAliasPrefixIfNecessary(); + if (ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -87892,25 +91684,25 @@ var ts; writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(109 /* InterfaceKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288 /* TypeAlias */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + prefixNextMeaning(); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 1024 /* InTypeAlias */)); + ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */)); } if (symbolFlags & 384 /* Enum */) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { displayParts.push(ts.keywordPart(76 /* ConstKeyword */)); displayParts.push(ts.spacePart()); @@ -87920,15 +91712,15 @@ var ts; addFullSymbolName(symbol); } if (symbolFlags & 1536 /* Module */) { - addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 234 /* ModuleDeclaration */); + prefixNextMeaning(); + var declaration = ts.getDeclarationOfKind(symbol, 237 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 71 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 129 /* NamespaceKeyword */ : 128 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 130 /* NamespaceKeyword */ : 129 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.textPart("type parameter")); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -87942,28 +91734,28 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 146 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 147 /* TypeParameter */); ts.Debug.assert(decl !== undefined); var declaration = decl.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 157 /* ConstructSignature */) { + if (declaration.kind === 158 /* ConstructSignature */) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 156 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 157 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 64 /* WriteTypeArgumentsOfSignature */)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 232 /* TypeAliasDeclaration */) { + else if (declaration.kind === 235 /* TypeAliasDeclaration */) { // Type alias type parameter // For example - // type list = T[]; // Both T will go through same code path + // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -87975,7 +91767,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 268 /* EnumMember */) { + if (declaration.kind === 271 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -87986,14 +91778,30 @@ var ts; } } if (symbolFlags & 2097152 /* Alias */) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); + if (!hasAddedSymbolInfo) { + var resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { + var resolvedNode = resolvedSymbol.declarations[0]; + var declarationName = ts.getNameOfDeclaration(resolvedNode); + if (declarationName) { + var isExternalModuleDeclaration = ts.isModuleWithStringLiteralName(resolvedNode) && + ts.hasModifier(resolvedNode, 2 /* Ambient */); + var shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; + var resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, resolvedSymbol, ts.getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, semanticMeaning, shouldUseAliasName ? symbol : resolvedSymbol); + displayParts.push.apply(displayParts, resolvedInfo.displayParts); + displayParts.push(ts.lineBreakPart()); + documentationFromAlias = resolvedInfo.documentation; + } + } + } switch (symbol.declarations[0].kind) { - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(129 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(130 /* NamespaceKeyword */)); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 58 /* EqualsToken */ : 79 /* DefaultKeyword */)); @@ -88004,13 +91812,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 238 /* ImportEqualsDeclaration */) { + if (declaration.kind === 241 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(132 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(133 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -88032,7 +91840,7 @@ var ts; if (symbolKind !== "" /* unknown */) { if (type) { if (isThisExpression) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(99 /* ThisKeyword */)); } else { @@ -88049,7 +91857,8 @@ var ts; // If the type is type parameter, format it specially if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + var param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration); + getPrinter().writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -88081,10 +91890,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 269 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 272 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 195 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 198 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -88100,26 +91909,45 @@ var ts; } } } + if (documentation.length === 0 && documentationFromAlias) { + documentation = documentationFromAlias; + } return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; - function addNewLineIfDisplayPartsExist() { + function getPrinter() { + if (!printer) { + printer = ts.createPrinter({ removeComments: true }); + } + return printer; + } + function prefixNextMeaning() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); } + addAliasPrefixIfNecessary(); + } + function addAliasPrefixIfNecessary() { + if (alias) { + pushTypePart("alias" /* alias */); + displayParts.push(ts.spacePart()); + } } function addInPrefix() { displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(92 /* InKeyword */)); displayParts.push(ts.spacePart()); } - function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); + function addFullSymbolName(symbolToDisplay, enclosingDeclaration) { + if (alias && symbolToDisplay === symbol) { + symbolToDisplay = alias; + } + var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbolToDisplay, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */ | 4 /* AllowAnyNodeKind */); ts.addRange(displayParts, fullSymbolDisplayParts); } function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (symbolKind) { pushTypePart(symbolKind); - if (!ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { + if (symbol && !ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -88142,7 +91970,7 @@ var ts; } } function addSignatureDisplayParts(signature, allSignatures, flags) { - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 64 /* WriteTypeArgumentsOfSignature */)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); @@ -88157,7 +91985,8 @@ var ts; } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + var params = typeChecker.symbolToTypeParameterDeclarations(symbol, enclosingDeclaration); + getPrinter().writeList(26896 /* TypeParameters */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -88169,16 +91998,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 187 /* FunctionExpression */) { + if (declaration.kind === 190 /* FunctionExpression */) { return true; } - if (declaration.kind !== 227 /* VariableDeclaration */ && declaration.kind !== 229 /* FunctionDeclaration */) { + if (declaration.kind !== 230 /* VariableDeclaration */ && declaration.kind !== 232 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 269 /* SourceFile */ || parent.kind === 235 /* ModuleBlock */) { + if (parent.kind === 272 /* SourceFile */ || parent.kind === 238 /* ModuleBlock */) { return false; } } @@ -88488,10 +92317,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 257 /* JsxAttribute */: - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 260 /* JsxAttribute */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 71 /* Identifier */; } @@ -88668,17 +92497,21 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 143 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 144 /* LastToken */; token++) { allTokens.push(token); } - function anyTokenExcept(token) { - return { tokens: allTokens.filter(function (t) { return t !== token; }), isSpecific: false }; + function anyTokenExcept() { + var tokens = []; + for (var _i = 0; _i < arguments.length; _i++) { + tokens[_i] = arguments[_i]; + } + return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false }; } var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */])); - var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 143 /* LastKeyword */); + var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 144 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(27 /* FirstBinaryOperator */, 70 /* LastBinaryOperator */); - var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 143 /* OfKeyword */, 118 /* AsKeyword */, 126 /* IsKeyword */]; + var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 144 /* OfKeyword */, 118 /* AsKeyword */, 127 /* IsKeyword */]; var unaryPrefixOperators = [43 /* PlusPlusToken */, 44 /* MinusMinusToken */, 52 /* TildeToken */, 51 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 71 /* Identifier */, 19 /* OpenParenToken */, 21 /* OpenBracketToken */, @@ -88702,7 +92535,7 @@ var ts; // Leave comments alone rule("IgnoreBeforeComment", anyToken, comments, formatting.anyContext, 1 /* Ignore */), rule("IgnoreAfterLineComment", 2 /* SingleLineCommentTrivia */, anyToken, formatting.anyContext, 1 /* Ignore */), - rule("NoSpaceBeforeColon", anyToken, 56 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8 /* Delete */), + rule("NotSpaceBeforeColon", anyToken, 56 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 8 /* Delete */), rule("SpaceAfterColon", 56 /* ColonToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 2 /* Space */), rule("NoSpaceBeforeQuestionMark", anyToken, 55 /* QuestionToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8 /* Delete */), // insert space after '?' only when it is used in conditional operator @@ -88720,17 +92553,17 @@ var ts; rule("NoSpaceBeforeUnaryPostincrementOperator", unaryPostincrementExpressions, 43 /* PlusPlusToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceBeforeUnaryPostdecrementOperator", unaryPostdecrementExpressions, 44 /* MinusMinusToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // More unary operator special-casing. - // DevDiv 181814: Be careful when removing leading whitespace + // DevDiv 181814: Be careful when removing leading whitespace // around unary operators. Examples: - // 1 - -2 --X--> 1--2 - // a + ++b --X--> a+++b + // 1 - -2 --X--> 1--2 + // a + ++b --X--> a+++b rule("SpaceAfterPostincrementWhenFollowedByAdd", 43 /* PlusPlusToken */, 37 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterAddWhenFollowedByUnaryPlus", 37 /* PlusToken */, 37 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterAddWhenFollowedByPreincrement", 37 /* PlusToken */, 43 /* PlusPlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterPostdecrementWhenFollowedBySubtract", 44 /* MinusMinusToken */, 38 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterSubtractWhenFollowedByUnaryMinus", 38 /* MinusToken */, 38 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterSubtractWhenFollowedByPredecrement", 38 /* MinusToken */, 44 /* MinusMinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), - rule("NoSpaceAfterCloseBrace", 18 /* CloseBraceToken */, [22 /* CloseBracketToken */, 26 /* CommaToken */, 25 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterCloseBrace", 18 /* CloseBraceToken */, [26 /* CommaToken */, 25 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 8 /* Delete */), // For functions and control block place } on a new line [multi-line rule] rule("NewLineBeforeCloseBraceInBlockContext", anyTokenIncludingMultilineComments, 18 /* CloseBraceToken */, [isMultilineBlockContext], 4 /* NewLine */), // Space/new line after }. @@ -88740,6 +92573,8 @@ var ts; rule("SpaceBetweenCloseBraceAndElse", 18 /* CloseBraceToken */, 82 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("SpaceBetweenCloseBraceAndWhile", 18 /* CloseBraceToken */, 106 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceBetweenEmptyBraceBrackets", 17 /* OpenBraceToken */, 18 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 8 /* Delete */), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule("SpaceAfterConditionalClosingParen", 20 /* CloseParenToken */, 21 /* OpenBracketToken */, [isControlDeclContext], 2 /* Space */), rule("NoSpaceBetweenFunctionKeywordAndStar", 89 /* FunctionKeyword */, 39 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 8 /* Delete */), rule("SpaceAfterStarInGeneratorDeclaration", 39 /* AsteriskToken */, [71 /* Identifier */, 19 /* OpenParenToken */], [isFunctionDeclarationOrFunctionExpressionContext], 2 /* Space */), rule("SpaceAfterFunctionInFuncDecl", 89 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 2 /* Space */), @@ -88749,7 +92584,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 135 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), + rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 136 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), rule("NoSpaceBetweenYieldKeywordAndStar", 116 /* YieldKeyword */, 39 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8 /* Delete */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [116 /* YieldKeyword */, 39 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2 /* Space */), rule("NoSpaceBetweenReturnAndSemicolon", 96 /* ReturnKeyword */, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -88773,7 +92608,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 58 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [128 /* ModuleKeyword */, 132 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterModuleImport", [129 /* ModuleKeyword */, 133 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 117 /* AbstractKeyword */, @@ -88787,19 +92622,20 @@ var ts; 108 /* ImplementsKeyword */, 91 /* ImportKeyword */, 109 /* InterfaceKeyword */, - 128 /* ModuleKeyword */, - 129 /* NamespaceKeyword */, + 129 /* ModuleKeyword */, + 130 /* NamespaceKeyword */, 112 /* PrivateKeyword */, 114 /* PublicKeyword */, 113 /* ProtectedKeyword */, - 131 /* ReadonlyKeyword */, - 135 /* SetKeyword */, + 132 /* ReadonlyKeyword */, + 136 /* SetKeyword */, 115 /* StaticKeyword */, - 138 /* TypeKeyword */, - 141 /* FromKeyword */, - 127 /* KeyOfKeyword */, + 139 /* TypeKeyword */, + 142 /* FromKeyword */, + 128 /* KeyOfKeyword */, + 126 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 141 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 142 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 9 /* StringLiteral */, 17 /* OpenBraceToken */, [isModuleDeclContext], 2 /* Space */), // Lambda expressions @@ -88817,7 +92653,7 @@ var ts; rule("NoSpaceBeforeCloseAngularBracket", anyToken, 29 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8 /* Delete */), rule("NoSpaceAfterCloseAngularBracket", 29 /* GreaterThanToken */, [19 /* OpenParenToken */, 21 /* OpenBracketToken */, 29 /* GreaterThanToken */, 26 /* CommaToken */], [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8 /* Delete */), // decorators - rule("SpaceBeforeAt", anyToken, 57 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeAt", [20 /* CloseParenToken */, 71 /* Identifier */], 57 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceAfterAt", 57 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Insert space after @ in decorator rule("SpaceAfterDecorator", anyToken, [ @@ -88831,7 +92667,7 @@ var ts; 112 /* PrivateKeyword */, 113 /* ProtectedKeyword */, 125 /* GetKeyword */, - 135 /* SetKeyword */, + 136 /* SetKeyword */, 21 /* OpenBracketToken */, 39 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 2 /* Space */), @@ -88843,8 +92679,8 @@ var ts; // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses rule("SpaceAfterConstructor", 123 /* ConstructorKeyword */, 19 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceAfterConstructor", 123 /* ConstructorKeyword */, 19 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 8 /* Delete */), - rule("SpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext, isNextTokenNotCloseBracket], 2 /* Space */), - rule("NoSpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext], 8 /* Delete */), + rule("SpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket], 2 /* Space */), + rule("NoSpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 8 /* Delete */), // Insert space after function keyword for anonymous functions rule("SpaceAfterAnonymousFunctionKeyword", 89 /* FunctionKeyword */, 19 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 2 /* Space */), rule("NoSpaceAfterAnonymousFunctionKeyword", 89 /* FunctionKeyword */, 19 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 8 /* Delete */), @@ -88899,8 +92735,10 @@ var ts; rule("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], 4 /* NewLine */, 1 /* CanDeleteNewLines */), rule("SpaceAfterTypeAssertion", 29 /* GreaterThanToken */, anyToken, [isOptionEnabled("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 2 /* Space */), rule("NoSpaceAfterTypeAssertion", 29 /* GreaterThanToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 8 /* Delete */), + rule("SpaceBeforeTypeAnnotation", anyToken, 56 /* ColonToken */, [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 2 /* Space */), + rule("NoSpaceBeforeTypeAnnotation", anyToken, 56 /* ColonToken */, [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 8 /* Delete */), ]; - // These rules are lower in priority than user-configurable + // These rules are lower in priority than user-configurable. Rules earlier in this list have priority over rules later in the list. var lowPriorityCommonRules = [ // Space after keyword but not before ; or : or ? rule("NoSpaceBeforeSemicolon", anyToken, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -88908,13 +92746,15 @@ var ts; rule("SpaceBeforeOpenBraceInFunction", functionOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2 /* Space */, 1 /* CanDeleteNewLines */), rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2 /* Space */, 1 /* CanDeleteNewLines */), rule("NoSpaceBeforeComma", anyToken, 26 /* CommaToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), - // No space before and after indexer - rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + // No space before and after indexer `x[]` + rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */, 73 /* CaseKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterCloseBracket", 22 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 8 /* Delete */), rule("SpaceAfterSemicolon", 25 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), + // Remove extra space between for and await + rule("SpaceBetweenForAndAwaitKeyword", 88 /* ForKeyword */, 121 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] - rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementContext, isNotForContext], 2 /* Space */), + rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2 /* Space */), // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. rule("SpaceAfterTryFinally", [102 /* TryKeyword */, 87 /* FinallyKeyword */], 17 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), ]; @@ -88960,58 +92800,73 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 215 /* ForStatement */; + return context.contextNode.kind === 218 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 203 /* AsExpression */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 159 /* TypePredicate */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 170 /* ConditionalType */: + case 206 /* AsExpression */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 160 /* TypePredicate */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 177 /* BindingElement */: + case 180 /* BindingElement */: // equals in type X = ... - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: // equal in p = 0; - case 147 /* Parameter */: - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return context.currentTokenSpan.kind === 58 /* EqualsToken */ || context.nextTokenSpan.kind === 58 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return context.currentTokenSpan.kind === 92 /* InKeyword */ || context.nextTokenSpan.kind === 92 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 217 /* ForOfStatement */: - return context.currentTokenSpan.kind === 143 /* OfKeyword */ || context.nextTokenSpan.kind === 143 /* OfKeyword */; + case 220 /* ForOfStatement */: + return context.currentTokenSpan.kind === 144 /* OfKeyword */ || context.nextTokenSpan.kind === 144 /* OfKeyword */; } return false; } function isNotBinaryOpContext(context) { return !isBinaryOpContext(context); } + function isNotTypeAnnotationContext(context) { + return !isTypeAnnotationContext(context); + } + function isTypeAnnotationContext(context) { + var contextKind = context.contextNode.kind; + return contextKind === 151 /* PropertyDeclaration */ || + contextKind === 150 /* PropertySignature */ || + contextKind === 148 /* Parameter */ || + contextKind === 230 /* VariableDeclaration */ || + ts.isFunctionLikeKind(contextKind); + } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 196 /* ConditionalExpression */; + return context.contextNode.kind === 199 /* ConditionalExpression */ || + context.contextNode.kind === 170 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 175 /* ObjectBindingPattern */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 178 /* ObjectBindingPattern */ || + context.contextNode.kind === 176 /* MappedType */ || + isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration function isBeforeMultilineBlockContext(context) { @@ -89036,70 +92891,70 @@ var ts; return true; } switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 179 /* ObjectLiteralExpression */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 182 /* ObjectLiteralExpression */: + case 238 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 156 /* CallSignature */: - case 187 /* FunctionExpression */: - case 153 /* Constructor */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 190 /* FunctionExpression */: + case 154 /* Constructor */: + case 191 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 231 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one + case 234 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 229 /* FunctionDeclaration */ || context.contextNode.kind === 187 /* FunctionExpression */; + return context.contextNode.kind === 232 /* FunctionDeclaration */ || context.contextNode.kind === 190 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 164 /* TypeLiteral */: - case 234 /* ModuleDeclaration */: - case 245 /* ExportDeclaration */: - case 246 /* NamedExports */: - case 239 /* ImportDeclaration */: - case 242 /* NamedImports */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 165 /* TypeLiteral */: + case 237 /* ModuleDeclaration */: + case 248 /* ExportDeclaration */: + case 249 /* NamedExports */: + case 242 /* ImportDeclaration */: + case 245 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 230 /* ClassDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 264 /* CatchClause */: - case 235 /* ModuleBlock */: - case 222 /* SwitchStatement */: + case 233 /* ClassDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 267 /* CatchClause */: + case 238 /* ModuleBlock */: + case 225 /* SwitchStatement */: return true; - case 208 /* Block */: { + case 211 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 188 /* ArrowFunction */ && blockParent.kind !== 187 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 191 /* ArrowFunction */ && blockParent.kind !== 190 /* FunctionExpression */) { return true; } } @@ -89108,31 +92963,31 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 212 /* IfStatement */: - case 222 /* SwitchStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 225 /* TryStatement */: - case 213 /* DoStatement */: - case 221 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 224 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 264 /* CatchClause */: + case 267 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 179 /* ObjectLiteralExpression */; + return context.contextNode.kind === 182 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 182 /* CallExpression */; + return context.contextNode.kind === 185 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 183 /* NewExpression */; + return context.contextNode.kind === 186 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -89144,25 +92999,25 @@ var ts; return context.nextTokenSpan.kind !== 22 /* CloseBracketToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 188 /* ArrowFunction */; + return context.contextNode.kind === 191 /* ArrowFunction */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; } - function isNonJsxElementContext(context) { - return context.contextNode.kind !== 250 /* JsxElement */; + function isNonJsxElementOrFragmentContext(context) { + return context.contextNode.kind !== 253 /* JsxElement */ && context.contextNode.kind !== 257 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 260 /* JsxExpression */; + return context.contextNode.kind === 263 /* JsxExpression */ || context.contextNode.kind === 262 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 257 /* JsxAttribute */; + return context.nextTokenParent.kind === 260 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 257 /* JsxAttribute */; + return context.contextNode.kind === 260 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 251 /* JsxSelfClosingElement */; + return context.contextNode.kind === 254 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -89177,45 +93032,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 228 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 231 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 234 /* ModuleDeclaration */; + return context.contextNode.kind === 237 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 164 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 165 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 157 /* ConstructSignature */; + return context.contextNode.kind === 158 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 27 /* LessThanToken */ && token.kind !== 29 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 160 /* TypeReference */: - case 185 /* TypeAssertionExpression */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 161 /* TypeReference */: + case 188 /* TypeAssertionExpression */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -89226,16 +93081,16 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 185 /* TypeAssertionExpression */; + return context.contextNode.kind === 188 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 191 /* VoidExpression */; + return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 194 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 198 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 201 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 204 /* NonNullExpression */; + return context.contextNode.kind === 207 /* NonNullExpression */; } })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -89287,12 +93142,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 143 /* LastKeyword */ && column <= 143 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 144 /* LastKeyword */ && column <= 144 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 143 /* LastToken */ + 1; + var mapRowLength = 144 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; @@ -89474,17 +93329,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 235 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 269 /* SourceFile */: - case 208 /* Block */: - case 235 /* ModuleBlock */: + return body && body.kind === 238 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 272 /* SourceFile */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -89675,48 +93530,51 @@ var ts; return -1 /* Unknown */; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { - var indentation = inheritedIndentation; var delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; if (effectiveParentStartLine === startLine) { // if node is located on the same line with the parent // - inherit indentation from the parent // - push children if either parent of node itself has non-zero delta - indentation = startLine === lastIndentedLine - ? indentationOnLastIndentedLine - : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta); + return { + indentation: startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(), + delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta) + }; } - else if (indentation === -1 /* Unknown */) { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); + else if (inheritedIndentation === -1 /* Unknown */) { + if (node.kind === 19 /* OpenParenToken */ && startLine === lastIndentedLine) { + // the is used for chaining methods formatting + // - we need to get the indentation on last line and the delta of parent + return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) }; + } + else if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + return { indentation: parentDynamicIndentation.getIndentation(), delta: delta }; } else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node); + return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta }; } } - return { - indentation: indentation, - delta: delta - }; + else { + return { indentation: inheritedIndentation, delta: delta }; + } } function getFirstNonDecoratorTokenOfNode(node) { if (node.modifiers && node.modifiers.length) { return node.modifiers[0].kind; } switch (node.kind) { - case 230 /* ClassDeclaration */: return 75 /* ClassKeyword */; - case 231 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; - case 229 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; - case 233 /* EnumDeclaration */: return 233 /* EnumDeclaration */; - case 154 /* GetAccessor */: return 125 /* GetKeyword */; - case 155 /* SetAccessor */: return 135 /* SetKeyword */; - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: return 75 /* ClassKeyword */; + case 234 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; + case 232 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; + case 236 /* EnumDeclaration */: return 236 /* EnumDeclaration */; + case 155 /* GetAccessor */: return 125 /* GetKeyword */; + case 156 /* SetAccessor */: return 136 /* SetKeyword */; + case 153 /* MethodDeclaration */: if (node.asteriskToken) { return 39 /* AsteriskToken */; } // falls through - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: return ts.getNameOfDeclaration(node).kind; } } @@ -89731,67 +93589,55 @@ var ts; case 18 /* CloseBraceToken */: case 22 /* CloseBracketToken */: case 20 /* CloseParenToken */: - return indentation + getEffectiveDelta(delta, container); + return indentation + getDelta(container); } return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation; }, getIndentationForToken: function (line, kind, container) { - if (nodeStartLine !== line && node.decorators) { - if (kind === getFirstNonDecoratorTokenOfNode(node)) { - // if this token is the first token following the list of decorators, we do not need to indent - return indentation; - } - } - switch (kind) { - // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent - case 17 /* OpenBraceToken */: - case 18 /* CloseBraceToken */: - case 19 /* OpenParenToken */: - case 20 /* CloseParenToken */: - case 82 /* ElseKeyword */: - case 106 /* WhileKeyword */: - case 57 /* AtToken */: - return indentation; - case 41 /* SlashToken */: - case 29 /* GreaterThanToken */: { - if (container.kind === 252 /* JsxOpeningElement */ || - container.kind === 253 /* JsxClosingElement */ || - container.kind === 251 /* JsxSelfClosingElement */) { - return indentation; - } - break; - } - case 21 /* OpenBracketToken */: - case 22 /* CloseBracketToken */: { - if (container.kind !== 173 /* MappedType */) { - return indentation; - } - break; - } - } - // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + return shouldAddDelta(line, kind, container) ? indentation + getDelta(container) : indentation; }, getIndentation: function () { return indentation; }, - getDelta: function (child) { return getEffectiveDelta(delta, child); }, + getDelta: getDelta, recomputeIndentation: function (lineAdded) { if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent, node)) { - if (lineAdded) { - indentation += options.indentSize; - } - else { - indentation -= options.indentSize; - } - if (formatting.SmartIndenter.shouldIndentChildNode(node)) { - delta = options.indentSize; - } - else { - delta = 0; - } + indentation += lineAdded ? options.indentSize : -options.indentSize; + delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; } } }; - function getEffectiveDelta(delta, child) { + function shouldAddDelta(line, kind, container) { + switch (kind) { + // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent + case 17 /* OpenBraceToken */: + case 18 /* CloseBraceToken */: + case 19 /* OpenParenToken */: + case 20 /* CloseParenToken */: + case 82 /* ElseKeyword */: + case 106 /* WhileKeyword */: + case 57 /* AtToken */: + return false; + case 41 /* SlashToken */: + case 29 /* GreaterThanToken */: + switch (container.kind) { + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: + return false; + } + break; + case 21 /* OpenBracketToken */: + case 22 /* CloseBracketToken */: + if (container.kind !== 176 /* MappedType */) { + return false; + } + break; + } + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation + return nodeStartLine !== line + // if this token is the first token following the list of decorators, we do not need to indent + && !(node.decorators && kind === getFirstNonDecoratorTokenOfNode(node)); + } + function getDelta(child) { // Delta value should be zero when the node explicitly prevents indentation of the child node return formatting.SmartIndenter.nodeWillIndentChild(node, child, /*indentByDefault*/ true) ? delta : 0; } @@ -89814,7 +93660,7 @@ var ts; // context node is set to parent of the token after processing every token var childContextNode = contextNode; // if there are any tokens that logically belong to node and interleave child nodes - // such tokens will be consumed in processChildNode for for the child that follows them + // such tokens will be consumed in processChildNode for the child that follows them ts.forEachChild(node, function (child) { processChildNode(child, /*inheritedIndentation*/ -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, /*isListItem*/ false); }, function (nodes) { @@ -89873,7 +93719,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 148 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 149 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 10 /* JsxText */) { @@ -89881,7 +93727,7 @@ var ts; indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false); } childContextNode = node; - if (isFirstListItem && parent.kind === 178 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 181 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -90036,23 +93882,25 @@ var ts; var trimTrailingWhitespaces; var lineAction = 0 /* None */; if (rule) { - applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); - if (rule.action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { - lineAction = 2 /* LineRemoved */; - // Handle the case where the next line is moved to be the end of this line. - // In this case we don't indent the next line in the next pass. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false); - } - } - else if (rule.action & 4 /* NewLine */ && currentStartLine === previousStartLine) { - lineAction = 1 /* LineAdded */; - // Handle the case where token2 is moved to the new line. - // In this case we indent token2 in the next pass but we set - // sameLineIndent flag to notify the indenter that the indentation is within the line. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true); - } + lineAction = applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + switch (lineAction) { + case 2 /* LineRemoved */: + // Handle the case where the next line is moved to be the end of this line. + // In this case we don't indent the next line in the next pass. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false); + } + break; + case 1 /* LineAdded */: + // Handle the case where token2 is moved to the new line. + // In this case we indent token2 in the next pass but we set + // sameLineIndent flag to notify the indenter that the indentation is within the line. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true); + } + break; + default: + ts.Debug.assert(lineAction === 0 /* None */); } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line trimTrailingWhitespaces = !(rule.action & 8 /* Delete */) && rule.flags !== 1 /* CanDeleteNewLines */; @@ -90186,28 +94034,27 @@ var ts; var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); } - function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; - } function recordDelete(start, len) { if (len) { - edits.push(newTextChange(start, len, "")); + edits.push(ts.createTextChangeFromStartLength(start, len, "")); } } function recordReplace(start, len, newText) { if (len || newText) { - edits.push(newTextChange(start, len, newText)); + edits.push(ts.createTextChangeFromStartLength(start, len, newText)); } } function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { + var onLaterLine = currentStartLine !== previousStartLine; switch (rule.action) { case 1 /* Ignore */: // no action required - return; + return 0 /* None */; case 8 /* Delete */: if (previousRange.end !== currentRange.pos) { // delete characters starting from t1.end up to t2.pos exclusive recordDelete(previousRange.end, currentRange.pos - previousRange.end); + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 4 /* NewLine */: @@ -90215,25 +94062,27 @@ var ts; // if line1 and line2 are on subsequent lines then no edits are required - ok to exit // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; + return 0 /* None */; } // edit should not be applied if we have one line feed between elements var lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.newLineCharacter); + return onLaterLine ? 0 /* None */ : 1 /* LineAdded */; } break; case 2 /* Space */: // exit early if we on different lines and rule cannot change number of newlines if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; + return 0 /* None */; } var posDelta = currentRange.pos - previousRange.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } - break; } + return 0 /* None */; } } var LineAction; @@ -90246,7 +94095,7 @@ var ts; * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. */ function getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine, precedingToken, // tslint:disable-line:no-null-keyword - tokenAtPosition, predicate) { + tokenAtPosition, predicate) { if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); } var tokenStart = tokenAtPosition.getStart(sourceFile); if (tokenStart <= position && position < tokenAtPosition.getEnd()) { @@ -90289,12 +94138,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 191 /* ArrowFunction */: if (node.typeParameters === list) { return 27 /* LessThanToken */; } @@ -90302,8 +94151,8 @@ var ts; return 19 /* OpenParenToken */; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -90311,7 +94160,7 @@ var ts; return 19 /* OpenParenToken */; } break; - case 160 /* TypeReference */: + case 161 /* TypeReference */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -90345,12 +94194,12 @@ var ts; internedTabsIndentation = []; } if (internedTabsIndentation[tabs] === undefined) { - internedTabsIndentation[tabs] = tabString = repeat("\t", tabs); + internedTabsIndentation[tabs] = tabString = ts.repeatString("\t", tabs); } else { tabString = internedTabsIndentation[tabs]; } - return spaces ? tabString + repeat(" ", spaces) : tabString; + return spaces ? tabString + ts.repeatString(" ", spaces) : tabString; } else { var spacesString = void 0; @@ -90360,20 +94209,13 @@ var ts; internedSpacesIndentation = []; } if (internedSpacesIndentation[quotient] === undefined) { - spacesString = repeat(" ", options.indentSize * quotient); + spacesString = ts.repeatString(" ", options.indentSize * quotient); internedSpacesIndentation[quotient] = spacesString; } else { spacesString = internedSpacesIndentation[quotient]; } - return remainder ? spacesString + repeat(" ", remainder) : spacesString; - } - function repeat(value, count) { - var s = ""; - for (var i = 0; i < count; i++) { - s += value; - } - return s; + return remainder ? spacesString + ts.repeatString(" ", remainder) : spacesString; } } formatting.getIndentationString = getIndentationString; @@ -90435,7 +94277,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 195 /* BinaryExpression */) { + if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 198 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -90591,7 +94433,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 269 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 272 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -90639,7 +94481,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 212 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 215 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 82 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -90654,37 +94496,37 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.parent.properties; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return node.parent.elements; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 153 /* Constructor */: - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: { + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 154 /* Constructor */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); - case 183 /* NewExpression */: - case 182 /* CallExpression */: { + case 186 /* NewExpression */: + case 185 /* CallExpression */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } @@ -90693,11 +94535,13 @@ var ts; SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); - return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; - function getActualIndentationFromList(list) { - var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1 /* Unknown */; + if (containingList) { + var index = containingList.indexOf(node); + if (index !== -1) { + return deriveActualIndentationFromList(containingList, index, sourceFile, options); + } } + return -1 /* Unknown */; } function getLineIndentationWhenExpressionIsInMultiLine(node, sourceFile, options) { // actual indentation should not be used when: @@ -90722,10 +94566,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: node = node.expression; break; default: @@ -90789,51 +94633,52 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 211 /* ExpressionStatement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 178 /* ArrayLiteralExpression */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 173 /* MappedType */: - case 166 /* TupleType */: - case 236 /* CaseBlock */: - case 262 /* DefaultClause */: - case 261 /* CaseClause */: - case 186 /* ParenthesizedExpression */: - case 180 /* PropertyAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 209 /* VariableStatement */: - case 227 /* VariableDeclaration */: - case 244 /* ExportAssignment */: - case 220 /* ReturnStatement */: - case 196 /* ConditionalExpression */: - case 176 /* ArrayBindingPattern */: - case 175 /* ObjectBindingPattern */: - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 260 /* JsxExpression */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 147 /* Parameter */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 169 /* ParenthesizedType */: - case 184 /* TaggedTemplateExpression */: - case 192 /* AwaitExpression */: - case 246 /* NamedExports */: - case 242 /* NamedImports */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: + case 214 /* ExpressionStatement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 181 /* ArrayLiteralExpression */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 176 /* MappedType */: + case 167 /* TupleType */: + case 239 /* CaseBlock */: + case 265 /* DefaultClause */: + case 264 /* CaseClause */: + case 189 /* ParenthesizedExpression */: + case 183 /* PropertyAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 212 /* VariableStatement */: + case 230 /* VariableDeclaration */: + case 247 /* ExportAssignment */: + case 223 /* ReturnStatement */: + case 199 /* ConditionalExpression */: + case 179 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: + case 254 /* JsxSelfClosingElement */: + case 263 /* JsxExpression */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 148 /* Parameter */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 172 /* ParenthesizedType */: + case 187 /* TaggedTemplateExpression */: + case 195 /* AwaitExpression */: + case 249 /* NamedExports */: + case 245 /* NamedImports */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: return true; } return false; @@ -90841,27 +94686,29 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return childKind !== 208 /* Block */; - case 245 /* ExportDeclaration */: - return childKind !== 246 /* NamedExports */; - case 239 /* ImportDeclaration */: - return childKind !== 240 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 242 /* NamedImports */); - case 250 /* JsxElement */: - return childKind !== 253 /* JsxClosingElement */; + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return childKind !== 211 /* Block */; + case 248 /* ExportDeclaration */: + return childKind !== 249 /* NamedExports */; + case 242 /* ImportDeclaration */: + return childKind !== 243 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 245 /* NamedImports */); + case 253 /* JsxElement */: + return childKind !== 256 /* JsxClosingElement */; + case 257 /* JsxFragment */: + return childKind !== 259 /* JsxClosingFragment */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -90869,29 +94716,29 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: switch (parent.kind) { - case 208 /* Block */: + case 211 /* Block */: var grandParent = parent.parent; switch (grandParent && grandParent.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // We may want to write inner functions after this. return false; default: return true; } - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: return true; default: throw ts.Debug.fail(); } - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return true; default: return false; @@ -90914,7 +94761,7 @@ var ts; var ts; (function (ts) { var textChanges; - (function (textChanges) { + (function (textChanges_1) { /** * Currently for simplicity we store recovered positions on the node itself. * It can be changed to side-table later if we decide that current design is too invasive. @@ -90941,7 +94788,7 @@ var ts; (function (Position) { Position[Position["FullStart"] = 0] = "FullStart"; Position[Position["Start"] = 1] = "Start"; - })(Position = textChanges.Position || (textChanges.Position = {})); + })(Position = textChanges_1.Position || (textChanges_1.Position = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); } @@ -90957,6 +94804,10 @@ var ts; } return false; } + textChanges_1.useNonAdjustedPositions = { + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; var ChangeKind; (function (ChangeKind) { ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; @@ -90966,10 +94817,10 @@ var ts; function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } - textChanges.getSeparatorCharacter = getSeparatorCharacter; + textChanges_1.getSeparatorCharacter = getSeparatorCharacter; function getAdjustedStartPosition(sourceFile, node, options, position) { if (options.useNonAdjustedStartPosition) { - return node.getFullStart(); + return node.getStart(); } var fullStart = node.getFullStart(); var start = node.getStart(sourceFile); @@ -90996,7 +94847,7 @@ var ts; adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } - textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + textChanges_1.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); @@ -91007,12 +94858,12 @@ var ts; ? newEnd : end; } - textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + textChanges_1.getAdjustedEndPosition = getAdjustedEndPosition; /** * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 179 /* ObjectLiteralExpression */)); + return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 182 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -91022,15 +94873,18 @@ var ts; return s; } var ChangeTracker = /** @class */ (function () { - function ChangeTracker(newLine, formatContext, validator) { - this.newLine = newLine; + /** Public for tests only. Other callers should use `ChangeTracker.with`. */ + function ChangeTracker(newLineCharacter, formatContext, validator) { + this.newLineCharacter = newLineCharacter; this.formatContext = formatContext; this.validator = validator; this.changes = []; - this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + this.deletedNodesInLists = []; // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. + // Map from class id to nodes to insert at the start + this.nodesInsertedAtClassStarts = ts.createMap(); } ChangeTracker.fromContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.formatContext); + return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); }; ChangeTracker.with = function (context, cb) { var tracker = ChangeTracker.fromContext(context); @@ -91045,14 +94899,14 @@ var ts; if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -91069,6 +94923,9 @@ var ts; this.deleteNode(sourceFile, node); return this; } + var id = ts.getNodeId(node); + ts.Debug.assert(!this.deletedNodesInLists[id], "Deleting a node twice"); + this.deletedNodesInLists[id] = true; if (index !== containingList.length - 1) { var nextToken = ts.getTokenAtPosition(sourceFile, node.end, /*includeJsDocComment*/ false); if (nextToken && isSeparator(node, nextToken)) { @@ -91082,84 +94939,138 @@ var ts; } } else { - var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false); - if (previousToken && isSeparator(node, previousToken)) { - this.deleteNodeRange(sourceFile, previousToken, node); + var prev = containingList[index - 1]; + if (this.deletedNodesInLists[ts.getNodeId(prev)]) { + var pos = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + var end = getAdjustedEndPosition(sourceFile, node, {}); + this.deleteRange(sourceFile, { pos: pos, end: end }); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } } } return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; - ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithSingleNode, - sourceFile: sourceFile, - options: options, - node: newNode, - range: { pos: startPosition, end: endPosition } - }); - return this; - }; - ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithMultipleNodes, - sourceFile: sourceFile, - options: options, - nodes: newNodes, - range: { pos: startPosition, end: endPosition } - }); + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { - return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { - if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); + ChangeTracker.prototype.insertNodeAtTopOfFile = function (sourceFile, newNode, blankLineBetween) { + var pos = getInsertionPositionAtSourceFileTop(sourceFile); + this.insertNodeAt(sourceFile, pos, newNode, { + prefix: pos === 0 ? undefined : this.newLineCharacter, + suffix: (ts.isLineBreak(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : ""), + }); }; - ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { - if (options === void 0) { options = {}; } - if ((ts.isStatementButNotDeclaration(after)) || - after.kind === 150 /* PropertyDeclaration */ || - after.kind === 149 /* PropertySignature */ || - after.kind === 151 /* MethodSignature */) { + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { + if (blankLineBetween === void 0) { blankLineBetween = false; } + var pos = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); + return this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); + }; + ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { + var pos = before.getStart(sourceFile); + this.replaceRange(sourceFile, { pos: pos, end: pos }, ts.createToken(modifier), { suffix: " " }); + }; + ChangeTracker.prototype.getOptionsForInsertNodeBefore = function (before, doubleNewlines) { + if (ts.isStatement(before) || ts.isClassElement(before)) { + return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(before)) { + return { suffix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it + }; + ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) { + var firstStatement = ts.firstOrUndefined(ctr.body.statements); + if (!firstStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements)); + } + else { + this.insertNodeBefore(sourceFile, firstStatement, newStatement); + } + }; + ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) { + var lastStatement = ts.lastOrUndefined(ctr.body.statements); + if (!lastStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement])); + } + else { + this.insertNodeAfter(sourceFile, lastStatement, newStatement); + } + }; + ChangeTracker.prototype.replaceConstructorBody = function (sourceFile, ctr, statements) { + this.replaceNode(sourceFile, ctr.body, ts.createBlock(statements, /*multiLine*/ true), { useNonAdjustedEndPosition: true }); + }; + ChangeTracker.prototype.insertNodeAtEndOfScope = function (sourceFile, scope, newNode) { + var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); + this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, { + prefix: ts.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, + suffix: this.newLineCharacter + }); + }; + ChangeTracker.prototype.insertNodeAtClassStart = function (sourceFile, cls, newElement) { + var firstMember = ts.firstOrUndefined(cls.members); + if (!firstMember) { + var id = ts.getNodeId(cls).toString(); + var newMembers = this.nodesInsertedAtClassStarts.get(id); + if (newMembers) { + ts.Debug.assert(newMembers.sourceFile === sourceFile && newMembers.cls === cls); + newMembers.members.push(newElement); + } + else { + this.nodesInsertedAtClassStarts.set(id, { sourceFile: sourceFile, cls: cls, members: [newElement] }); + } + } + else { + this.insertNodeBefore(sourceFile, firstMember, newElement); + } + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) { + if (ts.isStatementButNotDeclaration(after) || + after.kind === 151 /* PropertyDeclaration */ || + after.kind === 150 /* PropertySignature */ || + after.kind === 152 /* MethodSignature */) { // check if previous statement ends with semicolon // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { @@ -91172,8 +95083,20 @@ var ts; }); } } - var endPosition = getAdjustedEndPosition(sourceFile, after, options); - return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); + var endPosition = getAdjustedEndPosition(sourceFile, after, {}); + return this.replaceRange(sourceFile, { pos: endPosition, end: endPosition }, newNode, this.getInsertNodeAfterOptions(after)); + }; + ChangeTracker.prototype.getInsertNodeAfterOptions = function (node) { + if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) { + return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; + } + else if (ts.isStatement(node) || ts.isClassElement(node) || ts.isTypeElement(node)) { + return { suffix: this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(node)) { + return { prefix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it }; /** * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, @@ -91314,36 +95237,26 @@ var ts; } return this; }; + ChangeTracker.prototype.finishInsertNodeAtClassStart = function () { + var _this = this; + this.nodesInsertedAtClassStarts.forEach(function (_a) { + var sourceFile = _a.sourceFile, cls = _a.cls, members = _a.members; + var newCls = cls.kind === 233 /* ClassDeclaration */ + ? ts.updateClassDeclaration(cls, cls.decorators, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members) + : ts.updateClassExpression(cls, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members); + _this.replaceNode(sourceFile, cls, newCls, { useNonAdjustedEndPosition: true }); + }); + }; ChangeTracker.prototype.getChanges = function () { var _this = this; - var changesPerFile = ts.createMap(); - // group changes per file - for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { - var c = _a[_i]; - var changesInFile = changesPerFile.get(c.sourceFile.path); - if (!changesInFile) { - changesPerFile.set(c.sourceFile.path, changesInFile = []); - } - changesInFile.push(c); - } - // convert changes - var fileChangesList = []; - changesPerFile.forEach(function (changesInFile) { + this.finishInsertNodeAtClassStart(); + return ts.group(this.changes, function (c) { return c.sourceFile.path; }).map(function (changesInFile) { var sourceFile = changesInFile[0].sourceFile; - var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; - for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { - var c = _a[_i]; - fileTextChanges.textChanges.push({ - span: _this.computeSpan(c, sourceFile), - newText: _this.computeNewText(c, sourceFile) - }); - } - fileChangesList.push(fileTextChanges); + var textChanges = ChangeTracker.normalize(changesInFile).map(function (c) { + return ts.createTextChange(ts.createTextSpanFromRange(c.range), _this.computeNewText(c, sourceFile)); + }); + return { fileName: sourceFile.fileName, textChanges: textChanges }; }); - return fileChangesList; - }; - ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { - return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { var _this = this; @@ -91356,8 +95269,14 @@ var ts; var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); - text = parts.join(change.options.nodeSeparator); + var lastIndex_1 = change.nodes.length - 1; + var parts = change.nodes.map(function (n, index) { + var formatted = _this.getFormattedTextOfNode(n, sourceFile, pos, options); + return index === lastIndex_1 || ts.endsWith(formatted, _this.newLineCharacter) + ? formatted + : (formatted + _this.newLineCharacter); + }); + text = parts.join(""); } else { ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); @@ -91368,7 +95287,7 @@ var ts; return (options.prefix || "") + text + (options.suffix || ""); }; ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { - var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); + var nonformattedText = getNonformattedText(node, sourceFile, this.newLineCharacter); if (this.validator) { this.validator(nonformattedText); } @@ -91397,11 +95316,10 @@ var ts; }; return ChangeTracker; }()); - textChanges.ChangeTracker = ChangeTracker; + textChanges_1.ChangeTracker = ChangeTracker; function getNonformattedText(node, sourceFile, newLine) { - var options = { newLine: newLine, target: sourceFile && sourceFile.languageVersion }; - var writer = new Writer(ts.getNewLineCharacter(options)); - var printer = ts.createPrinter(options, writer); + var writer = new Writer(newLine); + var printer = ts.createPrinter({ newLine: newLine === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */ }, writer); printer.writeNode(4 /* Unspecified */, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } @@ -91422,7 +95340,7 @@ var ts; } return text; } - textChanges.applyChanges = applyChanges; + textChanges_1.applyChanges = applyChanges; function isTrivia(s) { return ts.skipTrivia(s, 0) === s.length; } @@ -91495,6 +95413,38 @@ var ts; this.writer.write(s); this.setLastNonTriviaPosition(s, /*force*/ false); }; + Writer.prototype.writeKeyword = function (s) { + this.writer.writeKeyword(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeOperator = function (s) { + this.writer.writeOperator(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writePunctuation = function (s) { + this.writer.writePunctuation(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeParameter = function (s) { + this.writer.writeParameter(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeProperty = function (s) { + this.writer.writeProperty(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeSpace = function (s) { + this.writer.writeSpace(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeStringLiteral = function (s) { + this.writer.writeStringLiteral(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeSymbol = function (s, sym) { + this.writer.writeSymbol(s, sym); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; Writer.prototype.writeTextOfNode = function (text, node) { this.writer.writeTextOfNode(text, node); }; @@ -91533,12 +95483,53 @@ var ts; Writer.prototype.isAtStartOfLine = function () { return this.writer.isAtStartOfLine(); }; - Writer.prototype.reset = function () { - this.writer.reset(); + Writer.prototype.clear = function () { + this.writer.clear(); this.lastNonTriviaPosition = 0; }; return Writer; }()); + function getInsertionPositionAtSourceFileTop(_a) { + var text = _a.text; + var shebang = ts.getShebang(text); + var position = 0; + if (shebang !== undefined) { + position = shebang.length; + advancePastLineBreak(); + } + // For a source file, it is possible there are detached comments we should not skip + var ranges = ts.getLeadingCommentRanges(text, position); + if (!ranges) + return position; + // However we should still skip a pinned comment at the top + if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end; + advancePastLineBreak(); + ranges = ranges.slice(1); + } + // As well as any triple slash references + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { + position = range.end; + advancePastLineBreak(); + continue; + } + break; + } + return position; + function advancePastLineBreak() { + if (position < text.length) { + var charCode = text.charCodeAt(position); + if (ts.isLineBreak(charCode)) { + position++; + if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) { + position++; + } + } + } + } + } })(textChanges = ts.textChanges || (ts.textChanges = {})); })(ts || (ts = {})); /* @internal */ @@ -91546,24 +95537,33 @@ var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = []; - function registerCodeFix(codeFix) { - ts.forEach(codeFix.errorCodes, function (error) { - var fixes = codeFixes[error]; - if (!fixes) { - fixes = []; - codeFixes[error] = fixes; + var codeFixRegistrations = []; + var fixIdToRegistration = ts.createMap(); + function registerCodeFix(reg) { + for (var _i = 0, _a = reg.errorCodes; _i < _a.length; _i++) { + var error = _a[_i]; + var registrations = codeFixRegistrations[error]; + if (!registrations) { + registrations = []; + codeFixRegistrations[error] = registrations; } - fixes.push(codeFix); - }); + registrations.push(reg); + } + if (reg.fixIds) { + for (var _b = 0, _c = reg.fixIds; _b < _c.length; _b++) { + var fixId = _c[_b]; + ts.Debug.assert(!fixIdToRegistration.has(fixId)); + fixIdToRegistration.set(fixId, reg); + } + } } codefix.registerCodeFix = registerCodeFix; function getSupportedErrorCodes() { - return Object.keys(codeFixes); + return Object.keys(codeFixRegistrations); } codefix.getSupportedErrorCodes = getSupportedErrorCodes; function getFixes(context) { - var fixes = codeFixes[context.errorCode]; + var fixes = codeFixRegistrations[context.errorCode]; var allActions = []; ts.forEach(fixes, function (f) { var actions = f.getCodeActions(context); @@ -91582,6 +95582,42 @@ var ts; return allActions; } codefix.getFixes = getFixes; + function getAllFixes(context) { + // Currently fixId is always a string. + return fixIdToRegistration.get(ts.cast(context.fixId, ts.isString)).getAllCodeActions(context); + } + codefix.getAllFixes = getAllFixes; + function createCombinedCodeActions(changes, commands) { + return { changes: changes, commands: commands }; + } + function createFileTextChanges(fileName, textChanges) { + return { fileName: fileName, textChanges: textChanges }; + } + codefix.createFileTextChanges = createFileTextChanges; + function codeFixAll(context, errorCodes, use) { + var commands = []; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return eachDiagnostic(context, errorCodes, function (diag) { return use(t, diag, commands); }); + }); + return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands); + } + codefix.codeFixAll = codeFixAll; + function codeFixAllWithTextChanges(context, errorCodes, use) { + var changes = []; + eachDiagnostic(context, errorCodes, function (diag) { return use(changes, diag); }); + changes.sort(function (a, b) { return b.span.start - a.span.start; }); + return createCombinedCodeActions([createFileTextChanges(context.sourceFile.fileName, changes)]); + } + codefix.codeFixAllWithTextChanges = codeFixAllWithTextChanges; + function eachDiagnostic(_a, errorCodes, cb) { + var program = _a.program, sourceFile = _a.sourceFile; + for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile); _i < _b.length; _i++) { + var diag = _b[_i]; + if (ts.contains(errorCodes, diag.code)) { + cb(diag); + } + } + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -91592,14 +95628,15 @@ var ts; // A map with the refactor code as key, the refactor itself as value // e.g. nonSuggestableRefactors[refactorCode] -> the refactor you want var refactors = ts.createMap(); - function registerRefactor(refactor) { - refactors.set(refactor.name, refactor); + /** @param name An unique code associated with each refactor. Does not have to be human-readable. */ + function registerRefactor(name, refactor) { + refactors.set(name, refactor); } refactor_1.registerRefactor = registerRefactor; function getApplicableRefactors(context) { - return ts.flatMapIter(refactors.values(), function (refactor) { + return ts.arrayFrom(ts.flatMapIterator(refactors.values(), function (refactor) { return context.cancellationToken && context.cancellationToken.isCancellationRequested() ? undefined : refactor.getAvailableActions(context); - }); + })); } refactor_1.getApplicableRefactors = getApplicableRefactors; function getEditsForRefactor(context, refactorName, actionName) { @@ -91618,22 +95655,24 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "addMissingInvocationForDecorator"; + var errorCodes = [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - var decorator = ts.getAncestor(token, 148 /* Decorator */); - ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); - var replacement = ts.createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, decorator.expression, replacement); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), - changes: changeTracker.getChanges() - }]; - } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); }, }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var decorator = ts.findAncestor(token, ts.isDecorator); + ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); + var replacement = ts.createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined); + changeTracker.replaceNode(sourceFile, decorator.expression, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -91641,27 +95680,36 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "correctQualifiedNameToIndexedAccessType"; + var errorCodes = [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - var qualifiedName = ts.getAncestor(token, 144 /* QualifiedName */); - ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); - if (!ts.isIdentifier(qualifiedName.left)) { + var qualifiedName = getQualifiedName(context.sourceFile, context.span.start); + if (!qualifiedName) return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]"]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var q = getQualifiedName(diag.file, diag.start); + if (q) { + doChange(changes, diag.file, q); } - var leftText = qualifiedName.left.getText(sourceFile); - var rightText = qualifiedName.right.getText(sourceFile); - var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, qualifiedName, replacement); - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [leftText + "[\"" + rightText + "\"]"]), - changes: changeTracker.getChanges() - }]; - } + }); }, }); + function getQualifiedName(sourceFile, pos) { + var qualifiedName = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ true), ts.isQualifiedName); + ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); + return ts.isIdentifier(qualifiedName.left) ? qualifiedName : undefined; + } + function doChange(changeTracker, sourceFile, qualifiedName) { + var rightText = qualifiedName.right.text; + var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); + changeTracker.replaceNode(sourceFile, qualifiedName, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -91669,55 +95717,61 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code, + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code]; + var fixId = "fixClassIncorrectlyImplementsInterface"; // TODO: share a group with fixClassDoesntImplementInheritedAbstractMember? codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], - getCodeActions: getActionForClassLikeIncorrectImplementsInterface + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var classDeclaration = getClass(sourceFile, span.start); + var checker = program.getTypeChecker(); + return ts.mapDefined(ts.getClassImplementsHeritageClauseElements(classDeclaration), function (implementedTypeNode) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t); }); + if (changes.length === 0) + return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + return { description: description, changes: changes, fixId: fixId }; + }); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenClassDeclarations = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { + for (var _i = 0, _a = ts.getClassImplementsHeritageClauseElements(classDeclaration); _i < _a.length; _i++) { + var implementedTypeNode = _a[_i]; + addMissingDeclarations(context.program.getTypeChecker(), implementedTypeNode, diag.file, classDeclaration, changes); + } + } + }); + }, }); - function getActionForClassLikeIncorrectImplementsInterface(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - var classDeclaration = ts.getContainingClass(token); - if (!classDeclaration) { - return undefined; - } - var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + function getClass(sourceFile, pos) { + var classDeclaration = ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false)); + ts.Debug.assert(!!classDeclaration); + return classDeclaration; + } + function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker) { + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); var classType = checker.getTypeAtLocation(classDeclaration); - var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); - var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1 /* Number */); - var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0 /* String */); - var result = []; - for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { - var implementedTypeNode = implementedTypeNodes_2[_i]; - // Note that this is ultimately derived from a map indexed by symbol names, - // so duplicates cannot occur. - var implementedType = checker.getTypeAtLocation(implementedTypeNode); - var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); - var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); - var newNodes = []; - createAndAddMissingIndexSignatureDeclaration(implementedType, 1 /* Number */, hasNumericIndexSignature, newNodes); - createAndAddMissingIndexSignatureDeclaration(implementedType, 0 /* String */, hasStringIndexSignature, newNodes); - newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); - var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); - if (newNodes.length > 0) { - pushAction(result, newNodes, message); - } + if (!checker.getIndexTypeOfType(classType, 1 /* Number */)) { + createMissingIndexSignatureDeclaration(implementedType, 1 /* Number */); } - return result; - function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { - if (hasIndexSigOfKind) { - return; - } + if (!checker.getIndexTypeOfType(classType, 0 /* String */)) { + createMissingIndexSignatureDeclaration(implementedType, 0 /* String */); + } + codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + function createMissingIndexSignatureDeclaration(type, kind) { var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); - if (!indexInfoOfKind) { - return; + if (indexInfoOfKind) { + changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration)); } - var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); - newNodes.push(newIndexSignatureDeclaration); - } - function pushAction(result, newNodes, description) { - result.push({ description: description, changes: codefix.newNodesToChanges(newNodes, openBrace, context) }); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -91727,157 +95781,175 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ]; + var fixId = "addMissingMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, - ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code], - getCodeActions: getActionsForAddMissingMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var info = getInfo(context.sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + var methodCodeAction = call && getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + var addMember = inJs ? + ts.singleElementArray(getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, token.text, makeStatic)) : + getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic); + return ts.concatenate(ts.singleElementArray(methodCodeAction), addMember); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenNames = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var program = context.program; + var info = getInfo(diag.file, diag.start, program.getTypeChecker()); + if (!info) + return; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + if (!ts.addToSeen(seenNames, token.text)) { + return; + } + // Always prefer to add a method declaration if possible. + if (call) { + addMethodDeclaration(changes, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + } + else { + if (inJs) { + addMissingMemberInJs(changes, classDeclarationSourceFile, classDeclaration, token.text, makeStatic); + } + else { + var typeNode = getTypeNode(program.getTypeChecker(), classDeclaration, token); + addPropertyDeclaration(changes, classDeclarationSourceFile, classDeclaration, token.text, typeNode, makeStatic); + } + } + }); + }, }); - function getActionsForAddMissingMember(context) { - var tokenSourceFile = context.sourceFile; - var start = context.span.start; + function getInfo(tokenSourceFile, tokenPos, checker) { // The identifier of the missing property. eg: // this.missing = 1; // ^^^^^^^ - var token = ts.getTokenAtPosition(tokenSourceFile, start, /*includeJsDocComment*/ false); - if (token.kind !== 71 /* Identifier */) { + var token = ts.getTokenAtPosition(tokenSourceFile, tokenPos, /*includeJsDocComment*/ false); + if (!ts.isIdentifier(token)) { return undefined; } - if (!ts.isPropertyAccessExpression(token.parent)) { + var classAndMakeStatic = getClassAndMakeStatic(token, checker); + if (!classAndMakeStatic) { return undefined; } - var tokenName = token.getText(tokenSourceFile); - var makeStatic = false; - var classDeclaration; - if (token.parent.expression.kind === 99 /* ThisKeyword */) { + var classDeclaration = classAndMakeStatic.classDeclaration, makeStatic = classAndMakeStatic.makeStatic; + var classDeclarationSourceFile = classDeclaration.getSourceFile(); + var inJs = ts.isInJavaScriptFile(classDeclarationSourceFile); + var call = ts.tryCast(token.parent.parent, ts.isCallExpression); + return { token: token, classDeclaration: classDeclaration, makeStatic: makeStatic, classDeclarationSourceFile: classDeclarationSourceFile, inJs: inJs, call: call }; + } + function getClassAndMakeStatic(token, checker) { + var parent = token.parent; + if (!ts.isPropertyAccessExpression(parent)) { + return undefined; + } + if (parent.expression.kind === 99 /* ThisKeyword */) { var containingClassMemberDeclaration = ts.getThisContainer(token, /*includeArrowFunctions*/ false); if (!ts.isClassElement(containingClassMemberDeclaration)) { return undefined; } - classDeclaration = containingClassMemberDeclaration.parent; + var classDeclaration = containingClassMemberDeclaration.parent; // Property accesses on `this` in a static method are accesses of a static member. - makeStatic = classDeclaration && ts.hasModifier(containingClassMemberDeclaration, 32 /* Static */); + return ts.isClassLike(classDeclaration) ? { classDeclaration: classDeclaration, makeStatic: ts.hasModifier(containingClassMemberDeclaration, 32 /* Static */) } : undefined; } else { - var checker = context.program.getTypeChecker(); - var leftExpression = token.parent.expression; - var leftExpressionType = checker.getTypeAtLocation(leftExpression); - if (leftExpressionType.flags & 65536 /* Object */) { - var symbol = leftExpressionType.symbol; - if (symbol.flags & 32 /* Class */) { - classDeclaration = symbol.declarations && symbol.declarations[0]; - if (leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol)) { - // The expression is a class symbol but the type is not the instance-side. - makeStatic = true; - } - } + var leftExpressionType = checker.getTypeAtLocation(parent.expression); + var symbol = leftExpressionType.symbol; + if (!(symbol && leftExpressionType.flags & 65536 /* Object */ && symbol.flags & 32 /* Class */)) { + return undefined; } + var classDeclaration = ts.cast(ts.first(symbol.declarations), ts.isClassLike); + // The expression is a class symbol but the type is not the instance-side. + return { classDeclaration: classDeclaration, makeStatic: leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol) }; } - if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + } + function getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingMemberInJs(t, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic); }); + if (changes.length === 0) return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Initialize_static_property_0 : ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]); + return { description: description, changes: changes, fixId: fixId }; + } + function addMissingMemberInJs(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + if (makeStatic) { + if (classDeclaration.kind === 203 /* ClassExpression */) { + return; + } + var className = classDeclaration.name.getText(); + var staticInitialization = initializePropertyToUndefined(ts.createIdentifier(className), tokenName); + changeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization); } - var classDeclarationSourceFile = ts.getSourceFileOfNode(classDeclaration); - var classOpenBrace = ts.getOpenBraceOfClassLike(classDeclaration, classDeclarationSourceFile); - return ts.isInJavaScriptFile(classDeclarationSourceFile) ? - getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) : - getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic); - function getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ false); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - if (makeStatic) { - if (classDeclaration.kind === 200 /* ClassExpression */) { - return actions; - } - var className = classDeclaration.name.getText(); - var staticInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier(className), tokenName), ts.createIdentifier("undefined"))); - var staticInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - staticInitializationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); - var initializeStaticAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [tokenName]), - changes: staticInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeStaticAction); - return actions; - } - else { - var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); - if (!classConstructor) { - return actions; - } - var propertyInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), tokenName), ts.createIdentifier("undefined"))); - var propertyInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyInitializationChangeTracker.insertNodeBefore(classDeclarationSourceFile, classConstructor.body.getLastToken(), propertyInitialization, { suffix: context.newLineCharacter }); - var initializeAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]), - changes: propertyInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeAction); - return actions; + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return; } + var propertyInitialization = initializePropertyToUndefined(ts.createThis(), tokenName); + changeTracker.insertNodeAtConstructorEnd(classDeclarationSourceFile, classConstructor, propertyInitialization); } - function getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ true); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - var typeNode; - if (token.parent.parent.kind === 195 /* BinaryExpression */) { - var binaryExpression = token.parent.parent; - var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; - var checker = context.program.getTypeChecker(); - var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); - typeNode = checker.typeToTypeNode(widenedType, classDeclaration); - } - typeNode = typeNode || ts.createKeywordTypeNode(119 /* AnyKeyword */); - var property = ts.createProperty( - /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, tokenName, - /*questionToken*/ undefined, typeNode, - /*initializer*/ undefined); - var propertyChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, property, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0; - actions = ts.append(actions, { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: propertyChangeTracker.getChanges() - }); - if (!makeStatic) { - // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(136 /* StringKeyword */); - var indexingParameter = ts.createParameter( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, "x", - /*questionToken*/ undefined, stringTypeNode, - /*initializer*/ undefined); - var indexSignature = ts.createIndexSignature( - /*decorators*/ undefined, - /*modifiers*/ undefined, [indexingParameter], typeNode); - var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - indexSignatureChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, indexSignature, { suffix: context.newLineCharacter }); - actions.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), - changes: indexSignatureChangeTracker.getChanges() - }); - } - return actions; - } - function getActionForMethodDeclaration(includeTypeScriptSyntax) { - if (token.parent.parent.kind === 182 /* CallExpression */) { - var callExpression = token.parent.parent; - var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, tokenName, includeTypeScriptSyntax, makeStatic); - var methodDeclarationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - methodDeclarationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, methodDeclaration, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0; - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: methodDeclarationChangeTracker.getChanges() - }; - } + } + function initializePropertyToUndefined(obj, propertyName) { + return ts.createStatement(ts.createAssignment(ts.createPropertyAccess(obj, propertyName), ts.createIdentifier("undefined"))); + } + function getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic) { + var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); + var addProp = createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, token.text, typeNode); + return makeStatic ? [addProp] : [addProp, createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, token.text, typeNode)]; + } + function getTypeNode(checker, classDeclaration, token) { + var typeNode; + if (token.parent.parent.kind === 198 /* BinaryExpression */) { + var binaryExpression = token.parent.parent; + var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); } + return typeNode || ts.createKeywordTypeNode(119 /* AnyKeyword */); + } + function createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0), [tokenName]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addPropertyDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + var property = ts.createProperty( + /*decorators*/ undefined, + /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, tokenName, + /*questionToken*/ undefined, typeNode, + /*initializer*/ undefined); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, property); + } + function createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, tokenName, typeNode) { + // Index signatures cannot have the static modifier. + var stringTypeNode = ts.createKeywordTypeNode(137 /* StringKeyword */); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, "x", + /*questionToken*/ undefined, stringTypeNode, + /*initializer*/ undefined); + var indexSignature = ts.createIndexSignature( + /*decorators*/ undefined, + /*modifiers*/ undefined, [indexingParameter], typeNode); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, indexSignature); }); + // No fixId here because code-fix-all currently only works on adding individual named properties. + return { description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), changes: changes, fixId: undefined }; + } + function getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0), [token.text]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addMethodDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, token.text, inJs, makeStatic); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, methodDeclaration); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -91886,18 +95958,35 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixSpelling"; + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + ]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, - ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code], - getCodeActions: getActionsForCorrectSpelling + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var node = info.node, suggestion = info.suggestion; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, node, suggestion); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, context.program.getTypeChecker()); + if (info) + doChange(changes, context.sourceFile, info.node, info.suggestion); + }); }, }); - function getActionsForCorrectSpelling(context) { - var sourceFile = context.sourceFile; + function getInfo(sourceFile, pos, checker) { // This is the identifier of the misspelled word. eg: // this.speling = 1; // ^^^^^^^ - var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); // TODO: GH#15852 - var checker = context.program.getTypeChecker(); + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); // TODO: GH#15852 var suggestion; if (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) { ts.Debug.assert(node.kind === 71 /* Identifier */); @@ -91910,18 +95999,10 @@ var ts; ts.Debug.assert(name !== undefined, "name should be defined"); suggestion = checker.getSuggestionForNonexistentSymbol(node, name, convertSemanticMeaningToSymbolFlags(meaning)); } - if (suggestion) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: node.getStart(), length: node.getWidth() }, - newText: suggestion - }], - }], - }]; - } + return suggestion === undefined ? undefined : { node: node, suggestion: suggestion }; + } + function doChange(changes, sourceFile, node, suggestion) { + changes.replaceNode(sourceFile, node, ts.createIdentifier(suggestion)); } function convertSemanticMeaningToSymbolFlags(meaning) { var flags = 0; @@ -91943,31 +96024,39 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixCannotFindModule"; + var errorCodes = [ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code]; codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, - ], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile, start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - if (!ts.isStringLiteral(token)) { - throw ts.Debug.fail(); // These errors should only happen on the module name. - } - var action = tryGetCodeActionForInstallPackageTypes(context.host, sourceFile.fileName, token.text); - return action && [action]; + var codeAction = tryGetCodeActionForInstallPackageTypes(context.host, context.sourceFile.fileName, getModuleName(context.sourceFile, context.span.start)); + return codeAction && [__assign({ fixId: fixId }, codeAction)]; }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (_, diag, commands) { + var pkg = getTypesPackageNameToInstall(context.host, getModuleName(diag.file, diag.start)); + if (pkg) { + commands.push(getCommand(diag.file.fileName, pkg)); + } + }); }, }); - function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + function getModuleName(sourceFile, pos) { + return ts.cast(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), ts.isStringLiteral).text; + } + function getCommand(fileName, packageName) { + return { type: "install package", file: fileName, packageName: packageName }; + } + function getTypesPackageNameToInstall(host, moduleName) { var packageName = ts.getPackageName(moduleName).packageName; - if (!host.isKnownTypesPackageName(packageName)) { - // If !registry, registry not available yet, can't do anything. - return undefined; - } - var typesPackageName = ts.getTypesPackageName(packageName); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [typesPackageName]), + // If !registry, registry not available yet, can't do anything. + return host.isKnownTypesPackageName(packageName) ? ts.getTypesPackageName(packageName) : undefined; + } + function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + var packageName = getTypesPackageNameToInstall(host, moduleName); + return packageName === undefined ? undefined : { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [packageName]), changes: [], - commands: [{ type: "install package", file: fileName, packageName: typesPackageName }], + commands: [getCommand(fileName, packageName)], }; } codefix.tryGetCodeActionForInstallPackageTypes = tryGetCodeActionForInstallPackageTypes; @@ -91978,44 +96067,45 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code, + ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code, + ]; + var fixId = "fixClassDoesntImplementInheritedAbstractMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], - getCodeActions: getActionForClassLikeMissingAbstractMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t); + }); + return changes.length === 0 ? undefined : [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + addMissingMembers(getClass(diag.file, diag.start), context.sourceFile, context.program.getTypeChecker(), changes); + }); }, }); - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], - getCodeActions: getActionForClassLikeMissingAbstractMember - }); - function getActionForClassLikeMissingAbstractMember(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; + function getClass(sourceFile, pos) { // This is the identifier in the case of a class declaration // or the class keyword token in the case of a class expression. - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - if (ts.isClassLike(token.parent)) { - var classDeclaration = token.parent; - var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); - var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); - // Note that this is ultimately derived from a map indexed by symbol names, - // so duplicates cannot occur. - var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); - var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); - var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); - var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); - if (changes && changes.length > 0) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), - changes: changes - }]; - } - } - return undefined; + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var classDeclaration = token.parent; + ts.Debug.assert(ts.isClassLike(classDeclaration)); + return classDeclaration; + } + function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker) { + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); + codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); } function symbolPointsToNonPrivateAndAbstractMember(symbol) { - var decls = symbol.getDeclarations(); - ts.Debug.assert(!!(decls && decls.length > 0)); - var flags = ts.getModifierFlags(decls[0]); + // See `codeFixClassExtendAbstractProtectedProperty.ts` in https://github.com/Microsoft/TypeScript/pull/11547/files + // (now named `codeFixClassExtendAbstractPrivateProperty.ts`) + var flags = ts.getModifierFlags(ts.first(symbol.getDeclarations())); return !(flags & 8 /* Private */) && !!(flags & 128 /* Abstract */); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -92025,48 +96115,55 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "classSuperMustPrecedeThisAccess"; + var errorCodes = [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], + errorCodes: errorCodes, getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var constructor = nodes.constructor, superCall = nodes.superCall; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, constructor, superCall); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 99 /* ThisKeyword */) { - return undefined; - } - var constructor = ts.getContainingFunction(token); - var superCall = findSuperCall(constructor.body); - if (!superCall) { - return undefined; - } - // figure out if the `this` access is actually inside the supercall - // i.e. super(this.a), since in that case we won't suggest a fix - if (superCall.expression && superCall.expression.kind === 182 /* CallExpression */) { - var expressionArguments = superCall.expression.arguments; - for (var _i = 0, expressionArguments_1 = expressionArguments; _i < expressionArguments_1.length; _i++) { - var arg = expressionArguments_1[_i]; - if (arg.expression === token) { - return undefined; - } + var seenClasses = ts.createMap(); // Ensure we only do this once per class. + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + var constructor = nodes.constructor, superCall = nodes.superCall; + if (ts.addToSeen(seenClasses, ts.getNodeId(constructor.parent))) { + doChange(changes, sourceFile, constructor, superCall); } - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); - changeTracker.deleteNode(sourceFile, superCall); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changeTracker.getChanges() - }]; - function findSuperCall(n) { - if (n.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { - return n; - } - if (ts.isFunctionLike(n)) { - return undefined; - } - return ts.forEachChild(n, findSuperCall); - } - } + }); + }, }); + function doChange(changes, sourceFile, constructor, superCall) { + changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); + changes.deleteNode(sourceFile, superCall); + } + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + if (token.kind !== 99 /* ThisKeyword */) + return undefined; + var constructor = ts.getContainingFunction(token); + var superCall = findSuperCall(constructor.body); + // figure out if the `this` access is actually inside the supercall + // i.e. super(this.a), since in that case we won't suggest a fix + return superCall && !superCall.expression.arguments.some(function (arg) { return ts.isPropertyAccessExpression(arg) && arg.expression === token; }) ? { constructor: constructor, superCall: superCall } : undefined; + } + function findSuperCall(n) { + return ts.isExpressionStatement(n) && ts.isSuperCall(n.expression) + ? n + : ts.isFunctionLike(n) + ? undefined + : ts.forEachChild(n, findSuperCall); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92074,23 +96171,30 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "constructorForDerivedNeedSuperCall"; + var errorCodes = [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 123 /* ConstructorKeyword */) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: changeTracker.getChanges() - }]; - } + var sourceFile = context.sourceFile, span = context.span; + var ctr = getNode(sourceFile, span.start); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, ctr); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + return doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, }); + function getNode(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + ts.Debug.assert(token.kind === 123 /* ConstructorKeyword */); + return token.parent; + } + function doChange(changes, sourceFile, ctr) { + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); + changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92098,247 +96202,314 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "extendsInterfaceBecomesImplements"; + var errorCodes = [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + errorCodes: errorCodes, getCodeActions: function (context) { var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var classDeclNode = ts.getContainingClass(token); - if (!(token.kind === 71 /* Identifier */ && ts.isClassLike(classDeclNode))) { + var nodes = getNodes(sourceFile, context.span.start); + if (!nodes) + return undefined; + var extendsToken = nodes.extendsToken, heritageClauses = nodes.heritageClauses; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChanges(t, sourceFile, extendsToken, heritageClauses); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (nodes) + doChanges(changes, diag.file, nodes.extendsToken, nodes.heritageClauses); + }); }, + }); + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var heritageClauses = ts.getContainingClass(token).heritageClauses; + var extendsToken = heritageClauses[0].getFirstToken(); + return extendsToken.kind === 85 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; + } + function doChanges(changes, sourceFile, extendsToken, heritageClauses) { + changes.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */), ts.textChanges.useNonAdjustedPositions); + // If there is already an implements clause, replace the implements keyword with a comma. + if (heritageClauses.length === 2 && + heritageClauses[0].token === 85 /* ExtendsKeyword */ && + heritageClauses[1].token === 108 /* ImplementsKeyword */) { + var implementsToken = heritageClauses[1].getFirstToken(); + var implementsFullStart = implementsToken.getFullStart(); + changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, ts.createToken(26 /* CommaToken */)); + // Rough heuristic: delete trailing whitespace after keyword so that it's not excessive. + // (Trailing because leading might be indentation, which is more sensitive.) + var text = sourceFile.text; + var end = implementsToken.end; + while (end < text.length && ts.isWhiteSpaceSingleLine(text.charCodeAt(end))) { + end++; + } + changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end: end }); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "forgottenThisPropertyAccess"; + var errorCodes = [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getNode(sourceFile, context.span.start); + if (!token) { return undefined; } - var heritageClauses = classDeclNode.heritageClauses; - if (!(heritageClauses && heritageClauses.length > 0)) { - return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, token); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, + }); + function getNode(sourceFile, pos) { + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return ts.isIdentifier(node) ? node : undefined; + } + function doChange(changes, sourceFile, token) { + if (!token) { + return; + } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper + ts.suppressLeadingAndTrailingTrivia(token); + changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token), ts.textChanges.useNonAdjustedPositions); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixIdPrefix = "unusedIdentifier_prefix"; + var fixIdDelete = "unusedIdentifier_delete"; + var errorCodes = [ + ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, + ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getToken(sourceFile, context.span.start); + var result = []; + var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token); }); + if (deletion.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), [token.getText()]); + result.push({ description: description, changes: deletion, fixId: fixIdDelete }); } - var extendsToken = heritageClauses[0].getFirstToken(); - if (!(extendsToken && extendsToken.kind === 85 /* ExtendsKeyword */)) { - return undefined; + var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, context.errorCode, sourceFile, token); }); + if (prefix.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), [token.getText()]); + result.push({ description: description, changes: prefix, fixId: fixIdPrefix }); } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */)); - // We replace existing keywords with commas. - for (var i = 1; i < heritageClauses.length; i++) { - var keywordToken = heritageClauses[i].getFirstToken(); - if (keywordToken) { - changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(26 /* CommaToken */)); - } - } - var result = [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), - changes: changeTracker.getChanges() - }]; return result; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], - getCodeActions: function (context) { + }, + fixIds: [fixIdPrefix, fixIdDelete], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 71 /* Identifier */) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), - changes: changeTracker.getChanges() - }]; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, - ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - // this handles var ["computed"] = 12; - if (token.kind === 21 /* OpenBracketToken */) { - token = ts.getTokenAtPosition(sourceFile, start + 1, /*includeJsDocComment*/ false); - } - switch (token.kind) { - case 71 /* Identifier */: - return deleteIdentifierOrPrefixWithUnderscore(token, context.errorCode); - case 150 /* PropertyDeclaration */: - case 241 /* NamespaceImport */: - return [deleteNode(token.parent)]; - default: - return deleteDefault(); - } - function deleteDefault() { - if (ts.isDeclarationName(token)) { - return [deleteNode(token.parent)]; - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return [deleteNode(token.parent.parent)]; - } - else { - return undefined; - } - } - function prefixIdentifierWithUnderscore(identifier) { - var startPosition = identifier.getStart(sourceFile, /*includeJsDocComment*/ false); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), { 0: token.getText() }), - changes: [{ - fileName: sourceFile.path, - textChanges: [{ - span: { start: startPosition, length: 0 }, - newText: "_" - }] - }] - }; - } - function deleteIdentifierOrPrefixWithUnderscore(identifier, errorCode) { - var parent = identifier.parent; - switch (parent.kind) { - case 227 /* VariableDeclaration */: - return deleteVariableDeclarationOrPrefixWithUnderscore(identifier, parent); - case 146 /* TypeParameter */: - var typeParameters = parent.parent.typeParameters; - if (typeParameters.length === 1) { - var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); - var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false); - ts.Debug.assert(previousToken.kind === 27 /* LessThanToken */); - ts.Debug.assert(nextToken.kind === 29 /* GreaterThanToken */); - return [deleteNodeRange(previousToken, nextToken)]; - } - else { - return [deleteNodeInList(parent)]; - } - case 147 /* Parameter */: - var functionDeclaration = parent.parent; - var deleteAction = functionDeclaration.parameters.length === 1 ? deleteNode(parent) : deleteNodeInList(parent); - return errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ? [deleteAction] - : [deleteAction, prefixIdentifierWithUnderscore(identifier)]; - // handle case where 'import a = A;' - case 238 /* ImportEqualsDeclaration */: - var importEquals = ts.getAncestor(identifier, 238 /* ImportEqualsDeclaration */); - return [deleteNode(importEquals)]; - case 243 /* ImportSpecifier */: - var namedImports = parent.parent; - if (namedImports.elements.length === 1) { - return deleteNamedImportBinding(namedImports); - } - else { - // delete import specifier - return [deleteNodeInList(parent)]; - } - case 240 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' - var importClause = parent; - if (!importClause.namedBindings) { - var importDecl = ts.getAncestor(importClause, 239 /* ImportDeclaration */); - return [deleteNode(importDecl)]; - } - else { - // import |d,| * as ns from './file' - var start_6 = importClause.name.getStart(sourceFile); - var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false); - if (nextToken && nextToken.kind === 26 /* CommaToken */) { - // shift first non-whitespace position after comma to the start position of the node - return [deleteRange({ pos: start_6, end: ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true) })]; - } - else { - return [deleteNode(importClause.name)]; - } - } - case 241 /* NamespaceImport */: - return deleteNamedImportBinding(parent); - default: - return deleteDefault(); - } - } - function deleteNamedImportBinding(namedBindings) { - if (namedBindings.parent.name) { - // Delete named imports while preserving the default import - // import d|, * as ns| from './file' - // import d|, { a }| from './file' - var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false); - if (previousToken && previousToken.kind === 26 /* CommaToken */) { - return [deleteRange({ pos: previousToken.getStart(), end: namedBindings.end })]; + var token = getToken(diag.file, diag.start); + switch (context.fixId) { + case fixIdPrefix: + if (ts.isIdentifier(token) && canPrefix(token)) { + tryPrefixDeclaration(changes, diag.code, sourceFile, token); } - return undefined; - } - else { - // Delete the entire import declaration - // |import * as ns from './file'| - // |import { a } from './file'| - var importDecl = ts.getAncestor(namedBindings, 239 /* ImportDeclaration */); - return [deleteNode(importDecl)]; - } + break; + case fixIdDelete: + tryDeleteDeclaration(changes, sourceFile, token); + break; + default: + ts.Debug.fail(JSON.stringify(context.fixId)); } - // token.parent is a variableDeclaration - function deleteVariableDeclarationOrPrefixWithUnderscore(identifier, varDecl) { + }); }, + }); + function getToken(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + // this handles var ["computed"] = 12; + return token.kind === 21 /* OpenBracketToken */ ? ts.getTokenAtPosition(sourceFile, pos + 1, /*includeJsDocComment*/ false) : token; + } + function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { + // Don't offer to prefix a property. + if (errorCode !== ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code && ts.isIdentifier(token) && canPrefix(token)) { + changes.replaceNode(sourceFile, token, ts.createIdentifier("_" + token.text)); + } + } + function canPrefix(token) { + switch (token.parent.kind) { + case 148 /* Parameter */: + return true; + case 230 /* VariableDeclaration */: { + var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 215 /* ForStatement */: - var forStatement = varDecl.parent.parent; - var forInitializer = forStatement.initializer; - return [forInitializer.declarations.length === 1 ? deleteNode(forInitializer) : deleteNodeInList(varDecl)]; - case 217 /* ForOfStatement */: - var forOfStatement = varDecl.parent.parent; - ts.Debug.assert(forOfStatement.initializer.kind === 228 /* VariableDeclarationList */); - var forOfInitializer = forOfStatement.initializer; - return [ - replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()), - prefixIdentifierWithUnderscore(identifier) - ]; - case 216 /* ForInStatement */: - // There is no valid fix in the case of: - // for .. in - return [prefixIdentifierWithUnderscore(identifier)]; - default: - var variableStatement = varDecl.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return [deleteNode(variableStatement)]; - } - else { - return [deleteNodeInList(varDecl)]; - } + case 220 /* ForOfStatement */: + case 219 /* ForInStatement */: + return true; } } - function deleteNode(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNode(sourceFile, n)); - } - function deleteRange(range) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteRange(sourceFile, range)); - } - function deleteNodeInList(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeInList(sourceFile, n)); - } - function deleteNodeRange(start, end) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeRange(sourceFile, start, end)); - } - function replaceNode(n, newNode) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).replaceNode(sourceFile, n, newNode)); - } - function makeChange(changeTracker) { - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), - changes: changeTracker.getChanges() - }; - } } - }); + return false; + } + function tryDeleteDeclaration(changes, sourceFile, token) { + switch (token.kind) { + case 71 /* Identifier */: + tryDeleteIdentifier(changes, sourceFile, token); + break; + case 151 /* PropertyDeclaration */: + case 244 /* NamespaceImport */: + changes.deleteNode(sourceFile, token.parent); + break; + default: + tryDeleteDefault(changes, sourceFile, token); + } + } + function tryDeleteDefault(changes, sourceFile, token) { + if (ts.isDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent.parent); + } + } + function tryDeleteIdentifier(changes, sourceFile, identifier) { + var parent = identifier.parent; + switch (parent.kind) { + case 230 /* VariableDeclaration */: + tryDeleteVariableDeclaration(changes, sourceFile, parent); + break; + case 147 /* TypeParameter */: + var typeParameters = parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false); + ts.Debug.assert(previousToken.kind === 27 /* LessThanToken */); + ts.Debug.assert(nextToken.kind === 29 /* GreaterThanToken */); + changes.deleteNodeRange(sourceFile, previousToken, nextToken); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 148 /* Parameter */: + var oldFunction = parent.parent; + if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) { + // Lambdas with exactly one parameter are special because, after removal, there + // must be an empty parameter list (i.e. `()`) and this won't necessarily be the + // case if the parameter is simply removed (e.g. in `x => 1`). + var newFunction = ts.updateArrowFunction(oldFunction, oldFunction.modifiers, oldFunction.typeParameters, + /*parameters*/ undefined, oldFunction.type, oldFunction.equalsGreaterThanToken, oldFunction.body); + // Drop leading and trailing trivia of the new function because we're only going + // to replace the span (vs the full span) of the old function - the old leading + // and trailing trivia will remain. + ts.suppressLeadingAndTrailingTrivia(newFunction); + changes.replaceNode(sourceFile, oldFunction, newFunction, ts.textChanges.useNonAdjustedPositions); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + // handle case where 'import a = A;' + case 241 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(identifier, 241 /* ImportEqualsDeclaration */); + changes.deleteNode(sourceFile, importEquals); + break; + case 246 /* ImportSpecifier */: + var namedImports = parent.parent; + if (namedImports.elements.length === 1) { + tryDeleteNamedImportBinding(changes, sourceFile, namedImports); + } + else { + // delete import specifier + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 243 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' + var importClause = parent; + if (!importClause.namedBindings) { + changes.deleteNode(sourceFile, ts.getAncestor(importClause, 242 /* ImportDeclaration */)); + } + else { + // import |d,| * as ns from './file' + var start = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false); + if (nextToken && nextToken.kind === 26 /* CommaToken */) { + // shift first non-whitespace position after comma to the start position of the node + var end = ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true); + changes.deleteRange(sourceFile, { pos: start, end: end }); + } + else { + changes.deleteNode(sourceFile, importClause.name); + } + } + break; + case 244 /* NamespaceImport */: + tryDeleteNamedImportBinding(changes, sourceFile, parent); + break; + default: + tryDeleteDefault(changes, sourceFile, identifier); + break; + } + } + function tryDeleteNamedImportBinding(changes, sourceFile, namedBindings) { + if (namedBindings.parent.name) { + // Delete named imports while preserving the default import + // import d|, * as ns| from './file' + // import d|, { a }| from './file' + var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false); + if (previousToken && previousToken.kind === 26 /* CommaToken */) { + changes.deleteRange(sourceFile, { pos: previousToken.getStart(), end: namedBindings.end }); + } + } + else { + // Delete the entire import declaration + // |import * as ns from './file'| + // |import { a } from './file'| + var importDecl = ts.getAncestor(namedBindings, 242 /* ImportDeclaration */); + changes.deleteNode(sourceFile, importDecl); + } + } + // token.parent is a variableDeclaration + function tryDeleteVariableDeclaration(changes, sourceFile, varDecl) { + switch (varDecl.parent.parent.kind) { + case 218 /* ForStatement */: { + var forStatement = varDecl.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + changes.deleteNode(sourceFile, forInitializer); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + break; + } + case 220 /* ForOfStatement */: + var forOfStatement = varDecl.parent.parent; + ts.Debug.assert(forOfStatement.initializer.kind === 231 /* VariableDeclarationList */); + var forOfInitializer = forOfStatement.initializer; + changes.replaceNode(sourceFile, forOfInitializer.declarations[0], ts.createObjectLiteral()); + break; + case 219 /* ForInStatement */: + case 228 /* TryStatement */: + break; + default: + var variableStatement = varDecl.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + changes.deleteNode(sourceFile, variableStatement); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + } + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92346,62 +96517,158 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixIdPlain = "fixJSDocTypes_plain"; + var fixIdNullable = "fixJSDocTypes_nullable"; + var errorCodes = [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code], - getCodeActions: getActionsForJSDocTypes + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var checker = context.program.getTypeChecker(); + var info = getInfo(sourceFile, context.span.start, checker); + if (!info) + return undefined; + var typeNode = info.typeNode, type = info.type; + var original = typeNode.getText(sourceFile); + var actions = [fix(type, fixIdPlain)]; + if (typeNode.kind === 277 /* JSDocNullableType */) { + // for nullable types, suggest the flow-compatible `T | null | undefined` + // in addition to the jsdoc/closure-compatible `T | null` + actions.push(fix(checker.getNullableType(type, 4096 /* Undefined */), fixIdNullable)); + } + return actions; + function fix(type, fixId) { + var newText = typeString(type, checker); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [createChange(typeNode, sourceFile, newText)])], + fixId: fixId, + }; + } + }, + fixIds: [fixIdPlain, fixIdNullable], + getAllCodeActions: function (context) { + var fixId = context.fixId, program = context.program, sourceFile = context.sourceFile; + var checker = program.getTypeChecker(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var info = getInfo(err.file, err.start, checker); + if (!info) + return; + var typeNode = info.typeNode, type = info.type; + var fixedType = typeNode.kind === 277 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 4096 /* Undefined */) : type; + changes.push(createChange(typeNode, sourceFile, typeString(fixedType, checker))); + }); + } }); - function getActionsForJSDocTypes(context) { - var sourceFile = context.sourceFile; - var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); + function getInfo(sourceFile, pos, checker) { + var decl = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isTypeContainer); + var typeNode = decl && decl.type; + return typeNode && { typeNode: typeNode, type: checker.getTypeFromTypeNode(typeNode) }; + } + function createChange(declaration, sourceFile, newText) { + return ts.createTextChange(ts.createTextSpanFromNode(declaration, sourceFile), newText); + } + function typeString(type, checker) { + return checker.typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* NoTruncation */); + } + function isTypeContainer(node) { // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments - var decl = ts.findAncestor(node, function (n) { - return n.kind === 203 /* AsExpression */ || - n.kind === 156 /* CallSignature */ || - n.kind === 157 /* ConstructSignature */ || - n.kind === 229 /* FunctionDeclaration */ || - n.kind === 154 /* GetAccessor */ || - n.kind === 158 /* IndexSignature */ || - n.kind === 173 /* MappedType */ || - n.kind === 152 /* MethodDeclaration */ || - n.kind === 151 /* MethodSignature */ || - n.kind === 147 /* Parameter */ || - n.kind === 150 /* PropertyDeclaration */ || - n.kind === 149 /* PropertySignature */ || - n.kind === 155 /* SetAccessor */ || - n.kind === 232 /* TypeAliasDeclaration */ || - n.kind === 185 /* TypeAssertionExpression */ || - n.kind === 227 /* VariableDeclaration */; - }); - if (!decl) - return; - var checker = context.program.getTypeChecker(); - var jsdocType = decl.type; - if (!jsdocType) - return; - var original = ts.getTextOfNode(jsdocType); - var type = checker.getTypeFromTypeNode(jsdocType); - var actions = [createAction(jsdocType, sourceFile.fileName, original, checker.typeToString(type, /*enclosingDeclaration*/ undefined, 8 /* NoTruncation */))]; - if (jsdocType.kind === 274 /* JSDocNullableType */) { - // for nullable types, suggest the flow-compatible `T | null | undefined` - // in addition to the jsdoc/closure-compatible `T | null` - var replacementWithUndefined = checker.typeToString(checker.getNullableType(type, 4096 /* Undefined */), /*enclosingDeclaration*/ undefined, 8 /* NoTruncation */); - actions.push(createAction(jsdocType, sourceFile.fileName, original, replacementWithUndefined)); + switch (node.kind) { + case 206 /* AsExpression */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 155 /* GetAccessor */: + case 159 /* IndexSignature */: + case 176 /* MappedType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: + case 188 /* TypeAssertionExpression */: + case 230 /* VariableDeclaration */: + return true; + default: + return false; } - return actions; } - function createAction(declaration, fileName, original, replacement) { + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixAwaitInSyncFunction"; + var errorCodes = [ + ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function.code, + ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, nodes); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_async_modifier_to_containing_function), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + doChange(changes, context.sourceFile, nodes); + }); }, + }); + function getReturnType(expr) { + if (expr.type) { + return expr.type; + } + if (ts.isVariableDeclaration(expr.parent) && + expr.parent.type && + ts.isFunctionTypeNode(expr.parent.type)) { + return expr.parent.type.type; + } + } + function getNodes(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var containingFunction = ts.getContainingFunction(token); + var insertBefore; + switch (containingFunction.kind) { + case 153 /* MethodDeclaration */: + insertBefore = containingFunction.name; + break; + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + insertBefore = ts.findChildOfKind(containingFunction, 89 /* FunctionKeyword */, sourceFile); + break; + case 191 /* ArrowFunction */: + insertBefore = ts.findChildOfKind(containingFunction, 19 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); + break; + default: + return; + } return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, replacement]), - changes: [{ - fileName: fileName, - textChanges: [{ - span: { start: declaration.getStart(), length: declaration.getWidth() }, - newText: replacement - }] - }], + insertBefore: insertBefore, + returnType: getReturnType(containingFunction) }; } + function doChange(changes, sourceFile, _a) { + var insertBefore = _a.insertBefore, returnType = _a.returnType; + if (returnType) { + var entityName = ts.getEntityNameFromTypeNode(returnType); + if (!entityName || entityName.kind !== 71 /* Identifier */ || entityName.text !== "Promise") { + changes.replaceNode(sourceFile, returnType, ts.createTypeReferenceNode("Promise", ts.createNodeArray([returnType]))); + } + } + changes.insertModifierBefore(sourceFile, 120 /* AsyncKeyword */, insertBefore); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92417,125 +96684,31 @@ var ts; ts.Diagnostics.Cannot_find_namespace_0.code, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code ], - getCodeActions: getImportCodeActions + getCodeActions: getImportCodeActions, + // TODO: GH#20315 + fixIds: [], + getAllCodeActions: ts.notImplemented, }); - var ModuleSpecifierComparison; - (function (ModuleSpecifierComparison) { - ModuleSpecifierComparison[ModuleSpecifierComparison["Better"] = 0] = "Better"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; - })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = /** @class */ (function () { - function ImportCodeActionMap() { - this.symbolIdToActionMap = []; - } - ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { - var actions = this.symbolIdToActionMap[symbolId]; - if (!actions) { - this.symbolIdToActionMap[symbolId] = [newAction]; - return; - } - if (newAction.kind === "CodeChange") { - actions.push(newAction); - return; - } - var updatedNewImports = []; - for (var _i = 0, _a = this.symbolIdToActionMap[symbolId]; _i < _a.length; _i++) { - var existingAction = _a[_i]; - if (existingAction.kind === "CodeChange") { - // only import actions should compare - updatedNewImports.push(existingAction); - continue; - } - switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { - case 0 /* Better */: - // the new one is not worth considering if it is a new import. - // However if it is instead a insertion into existing import, the user might want to use - // the module specifier even it is worse by our standards. So keep it. - if (newAction.kind === "NewImport") { - return; - } - // falls through - case 1 /* Equal */: - // the current one is safe. But it is still possible that the new one is worse - // than another existing one. For example, you may have new imports from "./foo/bar" - // and "bar", when the new one is "bar/bar2" and the current one is "./foo/bar". The new - // one and the current one are not comparable (one relative path and one absolute path), - // but the new one is worse than the other one, so should not add to the list. - updatedNewImports.push(existingAction); - break; - case 2 /* Worse */: - // the existing one is worse, remove from the list. - continue; - } - } - // if we reach here, it means the new one is better or equal to all of the existing ones. - updatedNewImports.push(newAction); - this.symbolIdToActionMap[symbolId] = updatedNewImports; - }; - ImportCodeActionMap.prototype.addActions = function (symbolId, newActions) { - for (var _i = 0, newActions_1 = newActions; _i < newActions_1.length; _i++) { - var newAction = newActions_1[_i]; - this.addAction(symbolId, newAction); - } - }; - ImportCodeActionMap.prototype.getAllActions = function () { - var result = []; - for (var key in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[key]); - } - return result; - }; - ImportCodeActionMap.prototype.compareModuleSpecifiers = function (moduleSpecifier1, moduleSpecifier2) { - if (moduleSpecifier1 === moduleSpecifier2) { - return 1 /* Equal */; - } - // if moduleSpecifier1 (ms1) is a substring of ms2, then it is better - if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { - return 0 /* Better */; - } - if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { - return 2 /* Worse */; - } - // if both are relative paths, and ms1 has fewer levels, then it is better - if (ts.isExternalModuleNameRelative(moduleSpecifier1) && ts.isExternalModuleNameRelative(moduleSpecifier2)) { - var regex = new RegExp(ts.directorySeparator, "g"); - var moduleSpecifier1LevelCount = (moduleSpecifier1.match(regex) || []).length; - var moduleSpecifier2LevelCount = (moduleSpecifier2.match(regex) || []).length; - return moduleSpecifier1LevelCount < moduleSpecifier2LevelCount - ? 0 /* Better */ - : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount - ? 1 /* Equal */ - : 2 /* Worse */; - } - // the equal cases include when the two specifiers are not comparable. - return 1 /* Equal */; - }; - return ImportCodeActionMap; - }()); - function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { - return { - description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: changes, - kind: kind, - moduleSpecifier: moduleSpecifier - }; + function createCodeAction(descriptionDiagnostic, diagnosticArgs, changes) { + var description = ts.formatMessage.apply(undefined, [undefined, descriptionDiagnostic].concat(diagnosticArgs)); + // TODO: GH#20315 + return { description: description, changes: changes, fixId: undefined }; } - function convertToImportCodeFixContext(context) { + function convertToImportCodeFixContext(context, symbolToken, symbolName) { var useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; - var checker = context.program.getTypeChecker(); - var symbolToken = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var program = context.program; + var checker = program.getTypeChecker(); return { host: context.host, - newLineCharacter: context.newLineCharacter, formatContext: context.formatContext, sourceFile: context.sourceFile, + program: program, checker: checker, - compilerOptions: context.program.getCompilerOptions(), + compilerOptions: program.getCompilerOptions(), cachedImportDeclarations: [], getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), - symbolName: symbolToken.getText(), - symbolToken: symbolToken, + symbolName: symbolName, + symbolToken: symbolToken }; } var ImportKind; @@ -92544,55 +96717,77 @@ var ts; ImportKind[ImportKind["Default"] = 1] = "Default"; ImportKind[ImportKind["Namespace"] = 2] = "Namespace"; ImportKind[ImportKind["Equals"] = 3] = "Equals"; - })(ImportKind = codefix.ImportKind || (codefix.ImportKind = {})); - function getCodeActionForImport(moduleSymbols, context) { - moduleSymbols = ts.toArray(moduleSymbols); - var declarations = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getImportDeclarations(moduleSymbol, context.checker, context.sourceFile, context.cachedImportDeclarations); - }); - var actions = []; - if (context.symbolToken) { - // It is possible that multiple import statements with the same specifier exist in the file. - // e.g. - // - // import * as ns from "foo"; - // import { member1, member2 } from "foo"; - // - // member3/**/ <-- cusor here - // - // in this case we should provie 2 actions: - // 1. change "member3" to "ns.member3" - // 2. add "member3" to the second import statement's import list - // and it is up to the user to decide which one fits best. - for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { - var declaration = declarations_13[_i]; - var namespace = getNamespaceImportName(declaration); - if (namespace) { - actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken)); + })(ImportKind || (ImportKind = {})); + function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, symbolToken) { + var exportInfos = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); + ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol; })); + // We sort the best codefixes first, so taking `first` is best for completions. + var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, exportInfos, compilerOptions, getCanonicalFileName, host)).moduleSpecifier; + var ctx = { host: host, program: program, checker: checker, compilerOptions: compilerOptions, sourceFile: sourceFile, formatContext: formatContext, symbolName: symbolName, getCanonicalFileName: getCanonicalFileName, symbolToken: symbolToken }; + return { moduleSpecifier: moduleSpecifier, codeAction: ts.first(getCodeActionsForImport(exportInfos, ctx)) }; + } + codefix.getImportCompletionAction = getImportCompletionAction; + function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { + var result = []; + forEachExternalModule(checker, allSourceFiles, function (moduleSymbol) { + for (var _i = 0, _a = checker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { + var exported = _a[_i]; + if (ts.skipAlias(exported, checker) === exportedSymbol) { + var isDefaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol) === exported; + result.push({ moduleSymbol: moduleSymbol, importKind: isDefaultExport ? 1 /* Default */ : 0 /* Named */ }); } } - } - return actions.concat(getCodeActionsForAddImport(moduleSymbols, context, declarations)); + }); + return result; + } + function getCodeActionsForImport(exportInfos, context) { + var existingImports = ts.flatMap(exportInfos, function (info) { + return getImportDeclarations(info, context.checker, context.sourceFile, context.cachedImportDeclarations); + }); + // It is possible that multiple import statements with the same specifier exist in the file. + // e.g. + // + // import * as ns from "foo"; + // import { member1, member2 } from "foo"; + // + // member3/**/ <-- cusor here + // + // in this case we should provie 2 actions: + // 1. change "member3" to "ns.member3" + // 2. add "member3" to the second import statement's import list + // and it is up to the user to decide which one fits best. + var useExistingImportActions = !context.symbolToken || !ts.isIdentifier(context.symbolToken) ? ts.emptyArray : ts.mapDefined(existingImports, function (_a) { + var declaration = _a.declaration; + var namespace = getNamespaceImportName(declaration); + if (namespace) { + var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); + if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { + return getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken); + } + } + }); + return useExistingImportActions.concat(getCodeActionsForAddImport(exportInfos, context, existingImports)); } - codefix.getCodeActionForImport = getCodeActionForImport; function getNamespaceImportName(declaration) { - if (declaration.kind === 239 /* ImportDeclaration */) { + if (declaration.kind === 242 /* ImportDeclaration */) { var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings; - return namedBindings && namedBindings.kind === 241 /* NamespaceImport */ ? namedBindings.name : undefined; + return namedBindings && namedBindings.kind === 244 /* NamespaceImport */ ? namedBindings.name : undefined; } else { return declaration.name; } } // TODO(anhans): This doesn't seem important to cache... just use an iterator instead of creating a new array? - function getImportDeclarations(moduleSymbol, checker, _a, cachedImportDeclarations) { - var imports = _a.imports; + function getImportDeclarations(_a, checker, _b, cachedImportDeclarations) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var imports = _b.imports; if (cachedImportDeclarations === void 0) { cachedImportDeclarations = []; } var moduleSymbolId = ts.getUniqueSymbolId(moduleSymbol, checker); var cached = cachedImportDeclarations[moduleSymbolId]; if (!cached) { cached = cachedImportDeclarations[moduleSymbolId] = ts.mapDefined(imports, function (importModuleSpecifier) { - return checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + var declaration = checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + return declaration && { declaration: declaration, importKind: importKind }; }); } return cached; @@ -92600,42 +96795,43 @@ var ts; function getImportDeclaration(_a) { var parent = _a.parent; switch (parent.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return parent; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return parent.parent; - case 245 /* ExportDeclaration */: - case 182 /* CallExpression */:// For "require()" calls + case 248 /* ExportDeclaration */: + case 185 /* CallExpression */:// For "require()" calls // Ignore these, can't add imports to them. return undefined; default: ts.Debug.fail(); } } - function getCodeActionForNewImport(context, moduleSpecifier) { - var kind = context.kind, sourceFile = context.sourceFile, newLineCharacter = context.newLineCharacter, symbolName = context.symbolName; + function getCodeActionForNewImport(context, _a) { + var moduleSpecifier = _a.moduleSpecifier, importKind = _a.importKind; + var sourceFile = context.sourceFile, symbolName = context.symbolName; var lastImportDeclaration = ts.findLast(sourceFile.statements, ts.isAnyImportSyntax); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier); var quotedModuleSpecifier = createStringLiteralWithQuoteStyle(sourceFile, moduleSpecifierWithoutQuotes); - var importDecl = kind !== 3 /* Equals */ + var importDecl = importKind !== 3 /* Equals */ ? ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClauseOfKind(kind, symbolName), quotedModuleSpecifier) + /*modifiers*/ undefined, createImportClauseOfKind(importKind, symbolName), quotedModuleSpecifier) : ts.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createIdentifier(symbolName), ts.createExternalModuleReference(quotedModuleSpecifier)); var changes = ChangeTracker.with(context, function (changeTracker) { if (lastImportDeclaration) { - changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: newLineCharacter }); + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); } else { - changeTracker.insertNodeAt(sourceFile, ts.getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + newLineCharacter + newLineCharacter }); + changeTracker.insertNodeAtTopOfFile(sourceFile, importDecl, /*blankLineBetween*/ true); } }); // if this file doesn't have any import statements, insert an import statement and then insert a new line // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. - return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes); } function createStringLiteralWithQuoteStyle(sourceFile, text) { var literal = ts.createLiteral(text); @@ -92643,6 +96839,12 @@ var ts; literal.singleQuote = !!firstModuleSpecifier && !ts.isStringDoubleQuoted(firstModuleSpecifier, sourceFile); return literal; } + function usesJsExtensionOnImports(sourceFile) { + return ts.firstDefined(sourceFile.imports, function (_a) { + var text = _a.text; + return ts.pathIsRelative(text) ? ts.fileExtensionIs(text, ".js" /* Js */) : undefined; + }) || false; + } function createImportClauseOfKind(kind, symbolName) { var id = ts.createIdentifier(symbolName); switch (kind) { @@ -92656,68 +96858,87 @@ var ts; ts.Debug.assertNever(kind); } } - function getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, options, getCanonicalFileName, host) { + function getNewImportInfos(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { var baseUrl = options.baseUrl, paths = options.paths, rootDirs = options.rootDirs; - var choicesForEachExportingModule = ts.mapIterator(ts.arrayIterator(moduleSymbols), function (moduleSymbol) { - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; - var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); - var global = tryGetModuleNameFromAmbientModule(moduleSymbol) - || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) - || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) - || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); - if (global) { - return [global]; - } - var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options); - if (!baseUrl) { - return [relativePath]; - } - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); - if (!relativeToBaseUrl) { - return [relativePath]; - } - var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options); - if (paths) { - var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - if (fromPaths) { - return [fromPaths]; + var addJsExtension = usesJsExtensionOnImports(sourceFile); + var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (_a) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var modulePathsGroups = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { + var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); + var global = tryGetModuleNameFromAmbientModule(moduleSymbol) + || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) + || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) + || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); + if (global) { + return [global]; } - } - /* - Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl. + var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options, addJsExtension); + if (!baseUrl) { + return [relativePath]; + } + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); + if (!relativeToBaseUrl) { + return [relativePath]; + } + var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options, addJsExtension); + if (paths) { + var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); + if (fromPaths) { + return [fromPaths]; + } + } + if (isPathRelativeToParent(relativeToBaseUrl)) { + return [relativePath]; + } + /* + Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl. - Suppose we have: - baseUrl = /base - sourceDirectory = /base/a/b - moduleFileName = /base/foo/bar - Then: - relativePath = ../../foo/bar - getRelativePathNParents(relativePath) = 2 - pathFromSourceToBaseUrl = ../../ - getRelativePathNParents(pathFromSourceToBaseUrl) = 2 - 2 < 2 = false - In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar". + Suppose we have: + baseUrl = /base + sourceDirectory = /base/a/b + moduleFileName = /base/foo/bar + Then: + relativePath = ../../foo/bar + getRelativePathNParents(relativePath) = 2 + pathFromSourceToBaseUrl = ../../ + getRelativePathNParents(pathFromSourceToBaseUrl) = 2 + 2 < 2 = false + In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar". - Suppose we have: - baseUrl = /base - sourceDirectory = /base/foo/a - moduleFileName = /base/foo/bar - Then: - relativePath = ../a - getRelativePathNParents(relativePath) = 1 - pathFromSourceToBaseUrl = ../../ - getRelativePathNParents(pathFromSourceToBaseUrl) = 2 - 1 < 2 = true - In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a". - */ - var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); - var relativeFirst = getRelativePathNParents(pathFromSourceToBaseUrl) < getRelativePathNParents(relativePath); - return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + Suppose we have: + baseUrl = /base + sourceDirectory = /base/foo/a + moduleFileName = /base/foo/bar + Then: + relativePath = ../a + getRelativePathNParents(relativePath) = 1 + pathFromSourceToBaseUrl = ../../ + getRelativePathNParents(pathFromSourceToBaseUrl) = 2 + 1 < 2 = true + In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a". + */ + var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); + var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl); + return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + }); + return modulePathsGroups.map(function (group) { return group.map(function (moduleSpecifier) { return ({ moduleSpecifier: moduleSpecifier, importKind: importKind }); }); }); }); - // Only return results for the re-export with the shortest possible path (and also give the other path even if that's long.) - return ts.best(choicesForEachExportingModule, function (a, b) { return a[0].length < b[0].length; }); + // Sort to keep the shortest paths first, but keep [relativePath, importRelativeToBaseUrl] groups together + return ts.flatten(choicesForEachExportingModule.sort(function (a, b) { return ts.first(a).moduleSpecifier.length - ts.first(b).moduleSpecifier.length; })); + } + /** + * Looks for a existing imports that use symlinks to this module. + * Only if no symlink is available, the real path will be used. + */ + function getAllModulePaths(program, _a) { + var fileName = _a.fileName; + var symlinks = ts.mapDefined(program.getSourceFiles(), function (sf) { + return sf.resolvedModules && ts.firstDefinedIterator(sf.resolvedModules.values(), function (res) { + return res && res.resolvedFileName === fileName ? res.originalPath : undefined; + }); + }); + return symlinks.length === 0 ? [fileName] : symlinks; } - codefix.getModuleSpecifiersForNewImport = getModuleSpecifiersForNewImport; function getRelativePathNParents(relativePath) { var count = 0; for (var i = 0; i + 3 <= relativePath.length && relativePath.slice(i, i + 3) === "../"; i += 3) { @@ -92731,10 +96952,11 @@ var ts; return decl.name.text; } } - function tryGetModuleNameFromPaths(relativeNameWithIndex, relativeName, paths) { + function tryGetModuleNameFromPaths(relativeToBaseUrlWithIndex, relativeToBaseUrl, paths) { for (var key in paths) { for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) { - var pattern = _a[_i]; + var patternText_1 = _a[_i]; + var pattern = ts.removeFileExtension(ts.normalizePath(patternText_1)); var indexOfStar = pattern.indexOf("*"); if (indexOfStar === 0 && pattern.length === 1) { continue; @@ -92742,14 +96964,14 @@ var ts; else if (indexOfStar !== -1) { var prefix = pattern.substr(0, indexOfStar); var suffix = pattern.substr(indexOfStar + 1); - if (relativeName.length >= prefix.length + suffix.length && - ts.startsWith(relativeName, prefix) && - ts.endsWith(relativeName, suffix)) { - var matchedStar = relativeName.substr(prefix.length, relativeName.length - suffix.length); - return key.replace("\*", matchedStar); + if (relativeToBaseUrl.length >= prefix.length + suffix.length && + ts.startsWith(relativeToBaseUrl, prefix) && + ts.endsWith(relativeToBaseUrl, suffix)) { + var matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length); + return key.replace("*", matchedStar); } } - else if (pattern === relativeName || pattern === relativeNameWithIndex) { + else if (pattern === relativeToBaseUrl || pattern === relativeToBaseUrlWithIndex) { return key; } } @@ -92764,12 +96986,12 @@ var ts; var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath, getCanonicalFileName) : normalizedTargetPath; return ts.removeFileExtension(relativePath); } - function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) { + function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) { var roots = ts.getEffectiveTypeRoots(options, host); - return roots && ts.firstDefined(roots, function (unNormalizedTypeRoot) { + return ts.firstDefined(roots, function (unNormalizedTypeRoot) { var typeRoot = ts.toPath(unNormalizedTypeRoot, /*basePath*/ undefined, getCanonicalFileName); if (ts.startsWith(moduleFileName, typeRoot)) { - return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options); + return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options, addJsExtension); } }); } @@ -92877,61 +97099,75 @@ var ts; return state > 1 /* NodeModules */ ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined; } function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) { - return ts.firstDefined(rootDirs, function (rootDir) { return getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); }); + return ts.firstDefined(rootDirs, function (rootDir) { + var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); + return isPathRelativeToParent(relativePath) ? undefined : relativePath; + }); } - function removeExtensionAndIndexPostFix(fileName, options) { + function removeExtensionAndIndexPostFix(fileName, options, addJsExtension) { var noExtension = ts.removeFileExtension(fileName); - return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs ? ts.removeSuffix(noExtension, "/index") : noExtension; + return addJsExtension + ? noExtension + ".js" + : ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs + ? ts.removeSuffix(noExtension, "/index") + : noExtension; } function getRelativePathIfInDirectory(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; + return ts.isRootedDiskPath(relativePath) ? undefined : relativePath; + } + function isPathRelativeToParent(path) { + return ts.startsWith(path, ".."); } function getRelativePath(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); return !ts.pathIsRelative(relativePath) ? "./" + relativePath : relativePath; } - function getCodeActionsForAddImport(moduleSymbols, ctx, declarations) { - var fromExistingImport = ts.firstDefined(declarations, function (declaration) { - if (declaration.kind === 239 /* ImportDeclaration */ && declaration.importClause) { - var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined); + function getCodeActionsForAddImport(exportInfos, ctx, existingImports) { + var fromExistingImport = ts.firstDefined(existingImports, function (_a) { + var declaration = _a.declaration, importKind = _a.importKind; + if (declaration.kind === 242 /* ImportDeclaration */ && declaration.importClause) { + var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined, importKind); if (changes) { var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText()); - return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes); } } }); if (fromExistingImport) { return [fromExistingImport]; } - var existingDeclaration = ts.firstDefined(declarations, moduleSpecifierFromAnyImport); - var moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); - return moduleSpecifiers.map(function (spec) { return getCodeActionForNewImport(ctx, spec); }); + var existingDeclaration = ts.firstDefined(existingImports, newImportInfoFromExistingSpecifier); + var newImportInfos = existingDeclaration + ? [existingDeclaration] + : getNewImportInfos(ctx.program, ctx.sourceFile, exportInfos, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); + return newImportInfos.map(function (info) { return getCodeActionForNewImport(ctx, info); }); } - function moduleSpecifierFromAnyImport(node) { - var expression = node.kind === 239 /* ImportDeclaration */ - ? node.moduleSpecifier - : node.moduleReference.kind === 249 /* ExternalModuleReference */ - ? node.moduleReference.expression + function newImportInfoFromExistingSpecifier(_a) { + var declaration = _a.declaration, importKind = _a.importKind; + var expression = declaration.kind === 242 /* ImportDeclaration */ + ? declaration.moduleSpecifier + : declaration.moduleReference.kind === 252 /* ExternalModuleReference */ + ? declaration.moduleReference.expression : undefined; - return expression && ts.isStringLiteral(expression) ? expression.text : undefined; + return expression && ts.isStringLiteral(expression) ? { moduleSpecifier: expression.text, importKind: importKind } : undefined; } - function tryUpdateExistingImport(context, importClause) { - var symbolName = context.symbolName, sourceFile = context.sourceFile, kind = context.kind; + function tryUpdateExistingImport(context, importClause, importKind) { + var symbolName = context.symbolName, sourceFile = context.sourceFile; var name = importClause.name; - var namedBindings = (importClause.kind !== 238 /* ImportEqualsDeclaration */ && importClause).namedBindings; - switch (kind) { + var namedBindings = (importClause.kind !== 241 /* ImportEqualsDeclaration */ && importClause).namedBindings; + switch (importKind) { case 1 /* Default */: return name ? undefined : ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(ts.createIdentifier(symbolName), namedBindings)); }); case 0 /* Named */: { var newImportSpecifier_1 = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(symbolName)); - if (namedBindings && namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length !== 0) { + if (namedBindings && namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length !== 0) { // There are already named imports; add another. return ChangeTracker.with(context, function (t) { return t.insertNodeInListAfter(sourceFile, namedBindings.elements[namedBindings.elements.length - 1], newImportSpecifier_1); }); } - if (!namedBindings || namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length === 0) { + if (!namedBindings || namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length === 0) { return ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(name, ts.createNamedImports([newImportSpecifier_1]))); }); @@ -92945,7 +97181,7 @@ var ts; case 3 /* Equals */: return undefined; default: - ts.Debug.assertNever(kind); + ts.Debug.assertNever(importKind); } } function getCodeActionForUseExistingNamespaceImport(namespacePrefix, context, symbolToken) { @@ -92960,35 +97196,39 @@ var ts; * namespace instead of altering the import declaration. For example, "foo" would * become "ns.foo" */ - return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], ChangeTracker.with(context, function (tracker) { - return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolName)); - }), "CodeChange", - /*moduleSpecifier*/ undefined); + var changes = ChangeTracker.with(context, function (tracker) { + return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolToken)); + }); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes); } function getImportCodeActions(context) { - var importFixContext = convertToImportCodeFixContext(context); return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code - ? getActionsForUMDImport(importFixContext) - : getActionsForNonUMDImport(importFixContext, context.program.getSourceFiles(), context.cancellationToken); + ? getActionsForUMDImport(context) + : getActionsForNonUMDImport(context); } function getActionsForUMDImport(context) { - var checker = context.checker, symbolToken = context.symbolToken, compilerOptions = context.compilerOptions; - var umdSymbol = checker.getSymbolAtLocation(symbolToken); - var symbol; - var symbolName; - if (umdSymbol.flags & 2097152 /* Alias */) { - symbol = checker.getAliasedSymbol(umdSymbol); - symbolName = context.symbolName; + var token = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var checker = context.program.getTypeChecker(); + var umdSymbol; + if (ts.isIdentifier(token)) { + // try the identifier to see if it is the umd symbol + umdSymbol = checker.getSymbolAtLocation(token); } - else if (ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken) { + if (!ts.isUMDExportSymbol(umdSymbol)) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), symbolToken.parent.tagName, 107455 /* Value */)); - symbolName = symbol.name; + var parent = token.parent; + var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(parent); + if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 258 /* JsxOpeningFragment */) { + umdSymbol = checker.resolveName(checker.getJsxNamespace(), isNodeOpeningLikeElement ? parent.tagName : parent, 107455 /* Value */, /*excludeGlobals*/ false); + } } - else { - throw ts.Debug.fail("Either the symbol or the JSX namespace should be a UMD global if we got here"); + if (ts.isUMDExportSymbol(umdSymbol)) { + var symbol = checker.getAliasedSymbol(umdSymbol); + if (symbol) { + return getCodeActionsForImport([{ moduleSymbol: symbol, importKind: getUmdImportKind(context.program.getCompilerOptions()) }], convertToImportCodeFixContext(context, token, umdSymbol.name)); + } } - return getCodeActionForImport(symbol, __assign({}, context, { symbolName: symbolName, kind: getUmdImportKind(compilerOptions) })); + return undefined; } function getUmdImportKind(compilerOptions) { // Import a synthetic `default` if enabled. @@ -93012,33 +97252,61 @@ var ts; throw ts.Debug.assertNever(moduleKind); } } - function getActionsForNonUMDImport(context, allSourceFiles, cancellationToken) { - var sourceFile = context.sourceFile, checker = context.checker, symbolName = context.symbolName, symbolToken = context.symbolToken; + function getActionsForNonUMDImport(context) { + // This will always be an Identifier, since the diagnostics we fix only fail on identifiers. + var sourceFile = context.sourceFile, span = context.span, program = context.program, cancellationToken = context.cancellationToken; + var checker = program.getTypeChecker(); + var symbolToken = ts.getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false); + var isJsxNamespace = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken; + if (!isJsxNamespace && !ts.isIdentifier(symbolToken)) { + return undefined; + } + var symbolName = isJsxNamespace ? checker.getJsxNamespace() : symbolToken.text; + var allSourceFiles = program.getSourceFiles(); + var compilerOptions = program.getCompilerOptions(); // "default" is a keyword and not a legal identifier for the import, so we don't expect it here ts.Debug.assert(symbolName !== "default"); - var symbolIdActionMap = new ImportCodeActionMap(); var currentTokenMeaning = ts.getMeaningFromLocation(symbolToken); + // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. + // Maps symbol id to info for modules providing that symbol (original export + re-exports). + var originalSymbolToExportInfos = ts.createMultiMap(); + function addSymbol(moduleSymbol, exportedSymbol, importKind) { + originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind }); + } forEachExternalModuleToImportFrom(checker, sourceFile, allSourceFiles, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); // check the default export - var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); + var defaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol); if (defaultExport) { var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport); - if ((localSymbol && localSymbol.escapedName === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, context.compilerOptions.target) === symbolName) - && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { - // check if this symbol is already used - var symbolId = ts.getUniqueSymbolId(localSymbol || defaultExport, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 1 /* Default */ }))); + if ((localSymbol && localSymbol.escapedName === symbolName || + getEscapedNameForExportDefault(defaultExport) === symbolName || + moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { + addSymbol(moduleSymbol, localSymbol || defaultExport, 1 /* Default */); } } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - var symbolId = ts.getUniqueSymbolId(exportSymbolWithIdenticalName, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 0 /* Named */ }))); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); + } + function getEscapedNameForExportDefault(symbol) { + return ts.firstDefined(symbol.declarations, function (declaration) { + if (ts.isExportAssignment(declaration)) { + if (ts.isIdentifier(declaration.expression)) { + return declaration.expression.escapedText; + } + } + else if (ts.isExportSpecifier(declaration)) { + ts.Debug.assert(declaration.name.escapedText === "default" /* Default */); + if (declaration.propertyName) { + return declaration.propertyName.escapedText; + } + } + }); } }); - return symbolIdActionMap.getAllActions(); + return ts.arrayFrom(ts.flatMapIterator(originalSymbolToExportInfos.values(), function (exportInfos) { return getCodeActionsForImport(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName)); })); } function checkSymbolHasMeaning(_a, meaning) { var declarations = _a.declarations; @@ -93064,7 +97332,6 @@ var ts; } } } - codefix.forEachExternalModule = forEachExternalModule; /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -93103,6 +97370,7 @@ var ts; // Need `|| "_"` to ensure result isn't empty. return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } + codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -93110,19 +97378,49 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "disableJsDiagnostics"; + var errorCodes = ts.mapDefined(Object.keys(ts.Diagnostics), function (key) { + var diag = ts.Diagnostics[key]; + return diag.category === ts.DiagnosticCategory.Error ? diag.code : undefined; + }); codefix.registerCodeFix({ - errorCodes: getApplicableDiagnosticCodes(), - getCodeActions: getDisableJsDiagnosticsCodeActions + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter).change])], + fixId: fixId, + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [ + ts.createTextChange(sourceFile.checkJsDirective ? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter), + ])], + // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. + fixId: undefined, + }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenLines = ts.createMap(); // Only need to add `// @ts-ignore` for a line once. + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + if (err.start !== undefined) { + var _a = getIgnoreCommentLocationForLocation(err.file, err.start, ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options)), lineNumber = _a.lineNumber, change = _a.change; + if (ts.addToSeen(seenLines, lineNumber)) { + changes.push(change); + } + } + }); + }, }); - function getApplicableDiagnosticCodes() { - var allDiagnostcs = ts.Diagnostics; - return Object.keys(allDiagnostcs) - .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) - .map(function (d) { return allDiagnostcs[d].code; }); - } function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { - var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; - var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var lineNumber = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(lineNumber, sourceFile); var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); // First try to see if we can put the '// @ts-ignore' on the previous line. // We need to make sure that we are not in the middle of a string literal or a comment. @@ -93130,45 +97428,13 @@ var ts; // if so, we do not want to separate the node from its comment if we can. if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { var token = ts.getTouchingToken(sourceFile, startPosition, /*includeJsDocComment*/ false); - var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); - if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { - return { - span: { start: startPosition, length: 0 }, - newText: "// @ts-ignore" + newLineCharacter - }; + var tokenLeadingComments = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingComments || !tokenLeadingComments.length || tokenLeadingComments[0].pos >= startPosition) { + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(startPosition, 0, "// @ts-ignore" + newLineCharacter) }; } } // If all fails, add an extra new line immediately before the error span. - return { - span: { start: position, length: 0 }, - newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter - }; - } - function getDisableJsDiagnosticsCodeActions(context) { - var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; - if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { - return undefined; - } - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] - }] - }, - { - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { - start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, - length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 - }, - newText: "// @ts-nocheck" + newLineCharacter - }] - }] - }]; + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(position, 0, (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter) }; } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -93177,80 +97443,49 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function newNodesToChanges(newNodes, insertAfter, context) { - var sourceFile = context.sourceFile; - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { - var newNode = newNodes_1[_i]; - changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); - } - var changes = changeTracker.getChanges(); - if (!ts.some(changes)) { - return changes; - } - ts.Debug.assert(changes.length === 1); - var consolidatedChanges = [{ - fileName: changes[0].fileName, - textChanges: [{ - span: changes[0].textChanges[0].span, - newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") - }] - }]; - return consolidatedChanges; - } - codefix.newNodesToChanges = newNodesToChanges; /** * Finds members of the resolved type that are missing in the class pointed to by class decl * and generates source code for the missing members. * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. * @returns Empty string iff there are no member insertions. */ - function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker, out) { var classMembers = classDeclaration.symbol.members; - var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.escapedName); }); - var newNodes = []; - for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { - var symbol = missingMembers_1[_i]; - var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); - if (newNode) { - if (Array.isArray(newNode)) { - newNodes = newNodes.concat(newNode); - } - else { - newNodes.push(newNode); - } + for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) { + var symbol = possiblyMissingSymbols_1[_i]; + if (!classMembers.has(symbol.escapedName)) { + addNewNodeForMemberSymbol(symbol, classDeclaration, checker, out); } } - return newNodes; } codefix.createMissingMemberNodes = createMissingMemberNodes; /** * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. */ - function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker, out) { var declarations = symbol.getDeclarations(); if (!(declarations && declarations.length)) { return undefined; } var declaration = declarations[0]; // Clone name to remove leading trivia. - var name = ts.getSynthesizedClone(ts.getNameOfDeclaration(declaration)); + var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration)); var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); var optional = !!(symbol.flags & 16777216 /* Optional */); switch (declaration.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 149 /* PropertySignature */: - case 150 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 150 /* PropertySignature */: + case 151 /* PropertyDeclaration */: var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); - var property = ts.createProperty( + out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeNode, - /*initializer*/ undefined); - return property; - case 151 /* MethodSignature */: - case 152 /* MethodDeclaration */: + /*initializer*/ undefined)); + break; + case 152 /* MethodSignature */: + case 153 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -93260,70 +97495,65 @@ var ts; // correspondence of declarations and signatures. var signatures = checker.getSignaturesOfType(type, 0 /* Call */); if (!ts.some(signatures)) { - return undefined; + break; } if (declarations.length === 1) { ts.Debug.assert(signatures.length === 1); var signature = signatures[0]; - return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + outputMethod(signature, modifiers, name, createStubbedMethodBody()); + break; } - var signatureDeclarations = []; for (var _i = 0, signatures_8 = signatures; _i < signatures_8.length; _i++) { var signature = signatures_8[_i]; - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + // Need to ensure nodes are fresh each time so they can have different positions. + outputMethod(signature, getSynthesizedDeepClones(modifiers), ts.getSynthesizedDeepClone(name)); } if (declarations.length > signatures.length) { var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + outputMethod(signature, modifiers, name, createStubbedMethodBody()); } else { ts.Debug.assert(declarations.length === signatures.length); - var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); - signatureDeclarations.push(methodImplementingSignatures); + out(createMethodImplementingSignatures(signatures, name, optional, modifiers)); } - return signatureDeclarations; - default: - return undefined; + break; } - function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 152 /* MethodDeclaration */, enclosingDeclaration, ts.NodeBuilderFlags.SuppressAnyReturnType); - if (signatureDeclaration) { - signatureDeclaration.decorators = undefined; - signatureDeclaration.modifiers = modifiers; - signatureDeclaration.name = name; - signatureDeclaration.questionToken = optional ? ts.createToken(55 /* QuestionToken */) : undefined; - signatureDeclaration.body = body; - } - return signatureDeclaration; + function outputMethod(signature, modifiers, name, body) { + var method = signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body); + if (method) + out(method); } } - function createMethodFromCallExpression(callExpression, methodName, includeTypeScriptSyntax, makeStatic) { - var parameters = createDummyParameters(callExpression.arguments.length, /*names*/ undefined, /*minArgumentCount*/ undefined, includeTypeScriptSyntax); - var typeParameters; - if (includeTypeScriptSyntax) { - var typeArgCount = ts.length(callExpression.typeArguments); - for (var i = 0; i < typeArgCount; i++) { - var name = typeArgCount < 8 ? String.fromCharCode(84 /* T */ + i) : "T" + i; - var typeParameter = ts.createTypeParameterDeclaration(name, /*constraint*/ undefined, /*defaultType*/ undefined); - (typeParameters ? typeParameters : typeParameters = []).push(typeParameter); - } + function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 153 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); + if (!signatureDeclaration) { + return undefined; } - var newMethod = ts.createMethod( + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(55 /* QuestionToken */) : undefined; + signatureDeclaration.body = body; + return signatureDeclaration; + } + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(ts.getSynthesizedDeepClone)); + } + function createMethodFromCallExpression(_a, methodName, inJs, makeStatic) { + var typeArguments = _a.typeArguments, args = _a.arguments; + return ts.createMethod( /*decorators*/ undefined, /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, /*asteriskToken*/ undefined, methodName, - /*questionToken*/ undefined, typeParameters, parameters, - /*type*/ includeTypeScriptSyntax ? ts.createKeywordTypeNode(119 /* AnyKeyword */) : undefined, createStubbedMethodBody()); - return newMethod; + /*questionToken*/ undefined, + /*typeParameters*/ inJs ? undefined : ts.map(typeArguments, function (_, i) { + return ts.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i); + }), + /*parameters*/ createDummyParameters(args.length, /*names*/ undefined, /*minArgumentCount*/ undefined, inJs), + /*type*/ inJs ? undefined : ts.createKeywordTypeNode(119 /* AnyKeyword */), createStubbedMethodBody()); } codefix.createMethodFromCallExpression = createMethodFromCallExpression; - function createDummyParameters(argCount, names, minArgumentCount, addAnyType) { + function createDummyParameters(argCount, names, minArgumentCount, inJs) { var parameters = []; for (var i = 0; i < argCount; i++) { var newParameter = ts.createParameter( @@ -93332,7 +97562,7 @@ var ts; /*dotDotDotToken*/ undefined, /*name*/ names && names[i] || "arg" + i, /*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.createToken(55 /* QuestionToken */) : undefined, - /*type*/ addAnyType ? ts.createKeywordTypeNode(119 /* AnyKeyword */) : undefined, + /*type*/ inJs ? undefined : ts.createKeywordTypeNode(119 /* AnyKeyword */), /*initializer*/ undefined); parameters.push(newParameter); } @@ -93358,7 +97588,7 @@ var ts; } var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.name; }); - var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*addAnyType*/ true); + var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*inJs*/ false); if (someSigHasRestParameter) { var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(119 /* AnyKeyword */)); var restParameter = ts.createParameter( @@ -93377,7 +97607,6 @@ var ts; /*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); } - codefix.createStubbedMethod = createStubbedMethod; function createStubbedMethodBody() { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.")]))], @@ -93399,228 +97628,237 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "inferFromUsage"; + var errorCodes = [ + // Variable declarations + ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, + // Variable uses + ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, + // Parameter declarations + ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, + ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, + // Get Accessor declarations + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, + ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, + // Set Accessor declarations + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, + // Property declarations + ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, + ]; codefix.registerCodeFix({ - errorCodes: [ - // Variable declarations - ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, - // Variable uses - ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, - // Parameter declarations - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, - // Get Accessor declarations - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, - ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, - // Set Accessor declarations - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, - // Property declarations - ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, - ], - getCodeActions: getActionsForAddExplicitTypeAnnotation + errorCodes: errorCodes, + getCodeActions: function (_a) { + var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; + if (ts.isSourceFileJavaScript(sourceFile)) { + return undefined; // TODO: GH#20113 + } + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var fix = getFix(sourceFile, token, errorCode, program, cancellationToken); + if (!fix) + return undefined; + var declaration = fix.declaration, textChanges = fix.textChanges; + var name = ts.getNameOfDeclaration(declaration); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name.getText()]); + return [{ description: description, changes: [{ fileName: sourceFile.fileName, textChanges: textChanges }], fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken; + var seenFunctions = ts.createMap(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var fix = getFix(sourceFile, ts.getTokenAtPosition(err.file, err.start, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions); + if (fix) + changes.push.apply(changes, fix.textChanges); + }); + }, }); - function getActionsForAddExplicitTypeAnnotation(_a) { - var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var writer; - if (ts.isInJavaScriptFile(token)) { + function getDiagnostic(errorCode, token) { + switch (errorCode) { + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + return ts.isSetAccessor(ts.getContainingFunction(token)) ? ts.Diagnostics.Infer_type_of_0_from_usage : ts.Diagnostics.Infer_parameter_types_from_usage; + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return ts.Diagnostics.Infer_parameter_types_from_usage; + default: + return ts.Diagnostics.Infer_type_of_0_from_usage; + } + } + function getFix(sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { + if (!isAllowedTokenKind(token.kind)) { return undefined; } - switch (token.kind) { + switch (errorCode) { + // Variable and Property declarations + case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: + case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: + return getCodeActionForVariableDeclaration(token.parent, program, cancellationToken); + case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: { + var symbol = program.getTypeChecker().getSymbolAtLocation(token); + return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration, program, cancellationToken); + } + } + var containingFunction = ts.getContainingFunction(token); + if (containingFunction === undefined) { + return undefined; + } + switch (errorCode) { + // Parameter declarations + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + if (ts.isSetAccessor(containingFunction)) { + return getCodeActionForSetAccessor(containingFunction, program, cancellationToken); + } + // falls through + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return !seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction)) + ? getCodeActionForParameters(ts.cast(token.parent, ts.isParameter), containingFunction, sourceFile, program, cancellationToken) + : undefined; + // Get Accessor declarations + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: + case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: + return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + // Set Accessor declarations + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: + return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, program, cancellationToken) : undefined; + default: + throw ts.Debug.fail(String(errorCode)); + } + } + function isAllowedTokenKind(kind) { + switch (kind) { case 71 /* Identifier */: case 24 /* DotDotDotToken */: case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: - // Allowed - break; + case 132 /* ReadonlyKeyword */: + return true; default: - return undefined; + return false; } - var containingFunction = ts.getContainingFunction(token); - var checker = program.getTypeChecker(); - switch (errorCode) { - // Variable and Property declarations - case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: - case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: - return getCodeActionForVariableDeclaration(token.parent); - case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: - return getCodeActionForVariableUsage(token); - // Parameter declarations - case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: - if (ts.isSetAccessor(containingFunction)) { - return getCodeActionForSetAccessor(containingFunction); - } - // falls through - case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - return getCodeActionForParameters(token.parent); - // Get Accessor declarations - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: - case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: - return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction) : undefined; - // Set Accessor declarations - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: - return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction) : undefined; + } + function getCodeActionForVariableDeclaration(declaration, program, cancellationToken) { + if (!ts.isIdentifier(declaration.name)) + return undefined; + var type = inferTypeForVariableFromUsage(declaration.name, program, cancellationToken); + return makeFix(declaration, declaration.name.getEnd(), type, program); + } + function isApplicableFunctionForInference(declaration) { + switch (declaration.kind) { + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + return true; + case 190 /* FunctionExpression */: + return !!declaration.name; } - return undefined; - function getCodeActionForVariableDeclaration(declaration) { - if (!ts.isIdentifier(declaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(declaration.name); - var typeString = type && typeToString(type, declaration); - if (!typeString) { - return undefined; - } - return createCodeActions(declaration.name.getText(), declaration.name.getEnd(), ": " + typeString); - } - function getCodeActionForVariableUsage(token) { - var symbol = checker.getSymbolAtLocation(token); - return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration); - } - function isApplicableFunctionForInference(declaration) { - switch (declaration.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - return true; - case 187 /* FunctionExpression */: - return !!declaration.name; - } - return false; - } - function getCodeActionForParameters(parameterDeclaration) { - if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { - return undefined; - } - var types = inferTypeForParametersFromUsage(containingFunction) || - ts.map(containingFunction.parameters, function (p) { return ts.isIdentifier(p.name) && inferTypeForVariableFromUsage(p.name); }); - if (!types) { - return undefined; - } - var textChanges = ts.zipWith(containingFunction.parameters, types, function (parameter, type) { - if (type && !parameter.type && !parameter.initializer) { - var typeString = typeToString(type, containingFunction); - return typeString ? { - span: { start: parameter.end, length: 0 }, - newText: ": " + typeString - } : undefined; - } - }).filter(function (c) { return !!c; }); - return textChanges.length ? [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_parameter_types_from_usage), [parameterDeclaration.name.getText()]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: textChanges - }] - }] : undefined; - } - function getCodeActionForSetAccessor(setAccessorDeclaration) { - var setAccessorParameter = setAccessorDeclaration.parameters[0]; - if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name) || - inferTypeForVariableFromUsage(setAccessorParameter.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - return createCodeActions(setAccessorDeclaration.name.getText(), setAccessorParameter.name.getEnd(), ": " + typeString); - } - function getCodeActionForGetAccessor(getAccessorDeclaration) { - if (!ts.isIdentifier(getAccessorDeclaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - var closeParenToken = getFirstChildOfKind(getAccessorDeclaration, sourceFile, 20 /* CloseParenToken */); - return createCodeActions(getAccessorDeclaration.name.getText(), closeParenToken.getEnd(), ": " + typeString); - } - function createCodeActions(name, start, typeString) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_type_of_0_from_usage), [name]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: start, length: 0 }, - newText: typeString - }] - }] - }]; - } - function getReferences(token) { - var references = ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), token.getSourceFile(), token.getStart()); - ts.Debug.assert(!!references, "Found no references!"); - ts.Debug.assert(references.length === 1, "Found more references than expected"); - return ts.map(references[0].references, function (r) { return ts.getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false); }); - } - function inferTypeForVariableFromUsage(token) { - return InferFromReference.inferTypeFromReferences(getReferences(token), checker, cancellationToken); - } - function inferTypeForParametersFromUsage(containingFunction) { - switch (containingFunction.kind) { - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - var isConstructor = containingFunction.kind === 153 /* Constructor */; - var searchToken = isConstructor ? - getFirstChildOfKind(containingFunction, sourceFile, 123 /* ConstructorKeyword */) : - containingFunction.name; - if (searchToken) { - return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken), containingFunction, checker, cancellationToken); - } - } - } - function getTypeAccessiblityWriter() { - if (!writer) { - var str_1 = ""; - var typeIsAccessible_1 = true; - var writeText = function (text) { return str_1 += text; }; - writer = { - string: function () { return typeIsAccessible_1 ? str_1 : undefined; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeProperty: writeText, - writeSymbol: writeText, - writeLine: function () { return str_1 += " "; }, - increaseIndent: ts.noop, - decreaseIndent: ts.noop, - clear: function () { str_1 = ""; typeIsAccessible_1 = true; }, - trackSymbol: function (symbol, declaration, meaning) { - if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { - typeIsAccessible_1 = false; - } - }, - reportInaccessibleThisError: function () { typeIsAccessible_1 = false; }, - reportPrivateInBaseOfClassExpression: function () { typeIsAccessible_1 = false; }, - reportInaccessibleUniqueSymbolError: function () { typeIsAccessible_1 = false; } - }; - } - writer.clear(); - return writer; - } - function typeToString(type, enclosingDeclaration) { - var writer = getTypeAccessiblityWriter(); - checker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration); - return writer.string(); - } - function getFirstChildOfKind(node, sourcefile, kind) { - for (var _i = 0, _a = node.getChildren(sourcefile); _i < _a.length; _i++) { - var child = _a[_i]; - if (child.kind === kind) - return child; - } + return false; + } + function getCodeActionForParameters(parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { return undefined; } + var types = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) || + containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : undefined; }); + if (!types) + return undefined; + // We didn't actually find a set of type inference positions matching each parameter position + if (containingFunction.parameters.length !== types.length) { + return undefined; + } + var textChanges = ts.arrayFrom(ts.mapDefinedIterator(ts.zipToIterator(containingFunction.parameters, types), function (_a) { + var parameter = _a[0], type = _a[1]; + return type && !parameter.type && !parameter.initializer ? makeChange(containingFunction, parameter.end, type, program) : undefined; + })); + return textChanges.length ? { declaration: parameterDeclaration, textChanges: textChanges } : undefined; + } + function getCodeActionForSetAccessor(setAccessorDeclaration, program, cancellationToken) { + var setAccessorParameter = setAccessorDeclaration.parameters[0]; + if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken) || + inferTypeForVariableFromUsage(setAccessorParameter.name, program, cancellationToken); + return makeFix(setAccessorParameter, setAccessorParameter.name.getEnd(), type, program); + } + function getCodeActionForGetAccessor(getAccessorDeclaration, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(getAccessorDeclaration.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name, program, cancellationToken); + var closeParenToken = ts.findChildOfKind(getAccessorDeclaration, 20 /* CloseParenToken */, sourceFile); + return makeFix(getAccessorDeclaration, closeParenToken.getEnd(), type, program); + } + function makeFix(declaration, start, type, program) { + return type && { declaration: declaration, textChanges: [makeChange(declaration, start, type, program)] }; + } + function makeChange(declaration, start, type, program) { + var typeString = type && typeToString(type, declaration, program.getTypeChecker()); + return typeString === undefined ? undefined : ts.createTextChangeFromStartLength(start, 0, ": " + typeString); + } + function getReferences(token, program, cancellationToken) { + // Position shouldn't matter since token is not a SourceFile. + return ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function (entry) { + return entry.type === "node" ? ts.tryCast(entry.node, ts.isIdentifier) : undefined; + }); + } + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + return InferFromReference.inferTypeFromReferences(getReferences(token, program, cancellationToken), program.getTypeChecker(), cancellationToken); + } + function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) { + switch (containingFunction.kind) { + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + var isConstructor = containingFunction.kind === 154 /* Constructor */; + var searchToken = isConstructor ? + ts.findChildOfKind(containingFunction, 123 /* ConstructorKeyword */, sourceFile) : + containingFunction.name; + if (searchToken) { + return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); + } + } + } + function getTypeAccessiblityWriter(checker) { + var str = ""; + var typeIsAccessible = true; + var writeText = function (text) { return str += text; }; + return { + getText: function () { return typeIsAccessible ? str : undefined; }, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: writeText, + write: writeText, + writeTextOfNode: writeText, + rawWrite: writeText, + writeLiteral: writeText, + getTextPos: function () { return 0; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + writeLine: function () { return writeText(" "); }, + increaseIndent: ts.noop, + decreaseIndent: ts.noop, + clear: function () { str = ""; typeIsAccessible = true; }, + trackSymbol: function (symbol, declaration, meaning) { + if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { + typeIsAccessible = false; + } + }, + reportInaccessibleThisError: function () { typeIsAccessible = false; }, + reportPrivateInBaseOfClassExpression: function () { typeIsAccessible = false; }, + reportInaccessibleUniqueSymbolError: function () { typeIsAccessible = false; } + }; + } + function typeToString(type, enclosingDeclaration, checker) { + var writer = getTypeAccessiblityWriter(checker); + checker.writeType(type, enclosingDeclaration, /*flags*/ undefined, writer); + return writer.getText(); } var InferFromReference; (function (InferFromReference) { @@ -93635,40 +97873,43 @@ var ts; } InferFromReference.inferTypeFromReferences = inferTypeFromReferences; function inferTypeForParametersFromReferences(references, declaration, checker, cancellationToken) { - if (declaration.parameters) { - var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; - cancellationToken.throwIfCancellationRequested(); - inferTypeFromContext(reference, checker, usageContext); - } - var isConstructor = declaration.kind === 153 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - if (callContexts) { - var paramTypes = []; - for (var parameterIndex = 0; parameterIndex < declaration.parameters.length; parameterIndex++) { - var types = []; - var isRestParameter_1 = ts.isRestParameter(declaration.parameters[parameterIndex]); - for (var _a = 0, callContexts_1 = callContexts; _a < callContexts_1.length; _a++) { - var callContext = callContexts_1[_a]; - if (callContext.argumentTypes.length > parameterIndex) { - if (isRestParameter_1) { - types = ts.concatenate(types, ts.map(callContext.argumentTypes.slice(parameterIndex), function (a) { return checker.getBaseTypeOfLiteralType(a); })); - } - else { - types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); - } - } - } - if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); - paramTypes[parameterIndex] = isRestParameter_1 ? checker.createArrayType(type) : type; + if (references.length === 0) { + return undefined; + } + if (!declaration.parameters) { + return undefined; + } + var usageContext = {}; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + var isConstructor = declaration.kind === 154 /* Constructor */; + var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; + return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var types = []; + var isRestParameter = ts.isRestParameter(parameter); + for (var _i = 0, callContexts_1 = callContexts; _i < callContexts_1.length; _i++) { + var callContext = callContexts_1[_i]; + if (callContext.argumentTypes.length <= parameterIndex) { + continue; + } + if (isRestParameter) { + for (var i = parameterIndex; i < callContext.argumentTypes.length; i++) { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); } } - return paramTypes; + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } } - } - return undefined; + if (!types.length) { + return undefined; + } + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); + return isRestParameter ? checker.createArrayType(type) : type; + }); } InferFromReference.inferTypeForParametersFromReferences = inferTypeForParametersFromReferences; function inferTypeFromContext(node, checker, usageContext) { @@ -93676,21 +97917,21 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: usageContext.isNumber = true; break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); break; - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpressionContext(node.parent, checker, usageContext); } @@ -93698,10 +97939,10 @@ var ts; inferTypeFromContextualType(node, checker, usageContext); } break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); break; default: @@ -93801,7 +98042,7 @@ var ts; // LogicalOperator case 54 /* BarBarToken */: if (node === parent.left && - (node.parent.parent.kind === 227 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 230 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); @@ -93829,7 +98070,7 @@ var ts; } } inferTypeFromContext(parent, checker, callContext.returnType); - if (parent.kind === 182 /* CallExpression */) { + if (parent.kind === 185 /* CallExpression */) { (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); } else { @@ -93873,12 +98114,12 @@ var ts; return checker.getStringType(); } else if (usageContext.candidateTypes) { - return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), /*subtypeReduction*/ true)); + return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), 2 /* Subtype */)); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, /*isRestParameter*/ false, checker); var types = paramType.getCallSignatures().map(function (c) { return c.getReturnType(); }); - return checker.createPromiseType(types.length ? checker.getUnionType(types, /*subtypeReduction*/ true) : checker.getAnyType()); + return checker.createPromiseType(types.length ? checker.getUnionType(types, 2 /* Subtype */) : checker.getAnyType()); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("push"))) { return checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, /*isRestParameter*/ false, checker)); @@ -93936,7 +98177,7 @@ var ts; } } if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); return isRestParameter ? checker.createArrayType(type) : type; } return undefined; @@ -93962,6 +98203,84 @@ var ts; })(InferFromReference || (InferFromReference = {})); })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime.code], + getCodeActions: getActionsForInvalidImport + }); + function getActionsForInvalidImport(context) { + var sourceFile = context.sourceFile; + // This is the whole import statement, eg: + // import * as Bluebird from 'bluebird'; + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false).parent; + if (!ts.isImportDeclaration(node)) { + // No import quick fix for import calls + return []; + } + return getCodeFixesForImportDeclaration(context, node); + } + function getCodeFixesForImportDeclaration(context, node) { + var sourceFile = ts.getSourceFileOfNode(node); + var namespace = ts.getNamespaceDeclarationNode(node); + var opts = context.program.getCompilerOptions(); + var variations = []; + // import Bluebird from "bluebird"; + variations.push(createAction(context, sourceFile, node, ts.createImportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createImportClause(namespace.name, /*namedBindings*/ undefined), node.moduleSpecifier))); + if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) { + // import Bluebird = require("bluebird"); + variations.push(createAction(context, sourceFile, node, ts.createImportEqualsDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)))); + } + return variations; + } + function createAction(context, sourceFile, node, replacement) { + // TODO: GH#21246 Should be able to use `replaceNode`, but be sure to preserve comments (see `codeFixCalledES2015Import11.ts`) + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceRange(sourceFile, { pos: node.getStart(), end: node.end }, replacement); }); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), + changes: changes, + }; + } + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code, + ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature.code, + ], + getCodeActions: getActionsForUsageOfInvalidImport + }); + function getActionsForUsageOfInvalidImport(context) { + var sourceFile = context.sourceFile; + var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 185 /* CallExpression */ : 186 /* NewExpression */; + var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); }); + if (!node) { + return []; + } + var expr = node.expression; + var type = context.program.getTypeChecker().getTypeAtLocation(expr); + if (!(type.symbol && type.symbol.originatingImport)) { + return []; + } + var fixes = []; + var relatedImport = type.symbol.originatingImport; + if (!ts.isImportCall(relatedImport)) { + ts.addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport)); + } + fixes.push({ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Use_synthetic_default_member), + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, expr, ts.createPropertyAccess(expr, "default"), {}); }), + }); + return fixes; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); /// /// /// @@ -93975,10 +98294,12 @@ var ts; /// /// /// +/// /// /// /// /// +/// /* @internal */ var ts; (function (ts) { @@ -93986,14 +98307,10 @@ var ts; (function (refactor) { var annotateWithTypeFromJSDoc; (function (annotateWithTypeFromJSDoc) { + var refactorName = "Annotate with type from JSDoc"; var actionName = "annotate"; - var annotateTypeFromJSDoc = { - name: "Annotate with type from JSDoc", - description: ts.Diagnostics.Annotate_with_type_from_JSDoc.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(annotateTypeFromJSDoc); + var description = ts.Diagnostics.Annotate_with_type_from_JSDoc.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.isInJavaScriptFile(context.file)) { return undefined; @@ -94001,11 +98318,11 @@ var ts; var node = ts.getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false); if (hasUsableJSDoc(ts.findAncestor(node, isDeclarationWithType))) { return [{ - name: annotateTypeFromJSDoc.name, - description: annotateTypeFromJSDoc.description, + name: refactorName, + description: description, actions: [ { - description: annotateTypeFromJSDoc.description, + description: description, name: actionName } ] @@ -94032,7 +98349,7 @@ var ts; } var jsdocType = ts.getJSDocType(decl); var isFunctionWithJSDoc = ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); })); - if (isFunctionWithJSDoc || jsdocType && decl.kind === 147 /* Parameter */) { + if (isFunctionWithJSDoc || jsdocType && decl.kind === 148 /* Parameter */) { return getEditsForFunctionAnnotation(context); } else if (jsdocType) { @@ -94053,7 +98370,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var declarationWithType = addType(decl, transformJSDocType(jsdocType)); ts.suppressLeadingAndTrailingTrivia(declarationWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, declarationWithType); + changeTracker.replaceNode(sourceFile, decl, declarationWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -94067,7 +98384,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var functionWithType = addTypesToFunctionLike(decl); ts.suppressLeadingAndTrailingTrivia(functionWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, functionWithType); + changeTracker.replaceNode(sourceFile, decl, functionWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -94076,29 +98393,29 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 227 /* VariableDeclaration */ || - node.kind === 147 /* Parameter */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 230 /* VariableDeclaration */ || + node.kind === 148 /* Parameter */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 151 /* PropertyDeclaration */; } function addTypesToFunctionLike(decl) { var typeParameters = ts.getEffectiveTypeParameterDeclarations(decl, /*checkJSDoc*/ true); var parameters = decl.parameters.map(function (p) { return ts.createParameter(p.decorators, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, transformJSDocType(ts.getEffectiveTypeAnnotationNode(p, /*checkJSDoc*/ true)), p.initializer); }); var returnType = transformJSDocType(ts.getEffectiveReturnTypeNode(decl, /*checkJSDoc*/ true)); switch (decl.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.createFunctionDeclaration(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.createMethod(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, decl.questionToken, typeParameters, parameters, returnType, decl.body); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.createGetAccessor(decl.decorators, decl.modifiers, decl.name, decl.parameters, returnType, decl.body); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.createSetAccessor(decl.decorators, decl.modifiers, decl.name, parameters, decl.body); default: return ts.Debug.assertNever(decl, "Unexpected SyntaxKind: " + decl.kind); @@ -94106,11 +98423,11 @@ var ts; } function addType(decl, jsdocType) { switch (decl.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.createVariableDeclaration(decl.name, jsdocType, decl.initializer); - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.createPropertySignature(decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); default: return ts.Debug.fail("Unexpected SyntaxKind: " + decl.kind); @@ -94121,22 +98438,22 @@ var ts; return undefined; } switch (node.kind) { - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return transformJSDocParameter(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); @@ -94159,7 +98476,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 278 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + var isRest = node.type.kind === 281 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(24 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -94199,8 +98516,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -94215,15 +98532,11 @@ var ts; var refactor; (function (refactor) { var convertFunctionToES6Class; - (function (convertFunctionToES6Class_1) { + (function (convertFunctionToES6Class) { + var refactorName = "Convert to ES2015 class"; var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); + var description = ts.Diagnostics.Convert_function_to_an_ES2015_class.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (!ts.isInJavaScriptFile(context.file)) { return undefined; @@ -94238,11 +98551,11 @@ var ts; if ((symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { return [ { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, + name: refactorName, + description: description, actions: [ { - description: convertFunctionToES6Class.description, + description: description, name: actionName } ] @@ -94257,7 +98570,6 @@ var ts; } var sourceFile = context.file; var ctorSymbol = getConstructorSymbol(context); - var newLine = context.formatContext.options.newLineCharacter; var deletedNodes = []; var deletes = []; if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { @@ -94268,12 +98580,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: precedingNode = ctorDeclaration; deleteNode(ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; if (ctorDeclaration.parent.declarations.length === 1) { deleteNode(precedingNode); @@ -94288,7 +98600,7 @@ var ts; return undefined; } // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { var deleteCallback = deletes_1[_i]; deleteCallback(); @@ -94349,7 +98661,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 211 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 214 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; deleteNode(nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -94357,7 +98669,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 187 /* FunctionExpression */: { + case 190 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -94365,17 +98677,16 @@ var ts; copyComments(assignmentBinaryExpression, method); return method; } - case 188 /* ArrowFunction */: { + case 191 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 208 /* Block */) { + if (arrowFunctionBody.kind === 211 /* Block */) { bodyBlock = arrowFunctionBody; } else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + bodyBlock = ts.createBlock([ts.createReturn(arrowFunctionBody)]); } var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -94413,7 +98724,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 187 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 190 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 71 /* Identifier */) { @@ -94453,6 +98764,496 @@ var ts; })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var refactor; + (function (refactor) { + var actionName = "Convert to ES6 module"; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); + function getAvailableActions(context) { + var file = context.file, startPosition = context.startPosition; + if (!ts.isSourceFileJavaScript(file) || !file.commonJsModuleIndicator) { + return undefined; + } + var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); + return !isAtTriggerLocation(file, node) ? undefined : [ + { + name: actionName, + description: description, + actions: [ + { + description: description, + name: actionName, + }, + ], + }, + ]; + } + function isAtTriggerLocation(sourceFile, node, onSecondTry) { + if (onSecondTry === void 0) { onSecondTry = false; } + switch (node.kind) { + case 185 /* CallExpression */: + return isAtTopLevelRequire(node); + case 183 /* PropertyAccessExpression */: + return ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression); + case 231 /* VariableDeclarationList */: + return isVariableDeclarationTriggerLocation(ts.firstOrUndefined(node.declarations)); + case 230 /* VariableDeclaration */: + return isVariableDeclarationTriggerLocation(node); + default: + return ts.isExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, /*onSecondTry*/ true); + } + function isVariableDeclarationTriggerLocation(decl) { + return !!decl && !!decl.initializer && ts.isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); + } + } + function isAtTopLevelRequire(call) { + if (!ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ true)) { + return false; + } + var propAccess = call.parent; + var varDecl = ts.isPropertyAccessExpression(propAccess) ? propAccess.parent : propAccess; + if (ts.isExpressionStatement(varDecl) && ts.isSourceFile(varDecl.parent)) { + return true; + } + if (!ts.isVariableDeclaration(varDecl)) { + return false; + } + var varDeclList = varDecl.parent; + if (varDeclList.kind !== 231 /* VariableDeclarationList */) { + return false; + } + var varStatement = varDeclList.parent; + return varStatement.kind === 212 /* VariableStatement */ && varStatement.parent.kind === 272 /* SourceFile */; + } + function getEditsForAction(context, _actionName) { + ts.Debug.assertEqual(actionName, _actionName); + var file = context.file, program = context.program; + ts.Debug.assert(ts.isSourceFileJavaScript(file)); + var edits = ts.textChanges.ChangeTracker.with(context, function (changes) { + var moduleExportsChangedToDefault = convertFileToEs6Module(file, program.getTypeChecker(), changes, program.getCompilerOptions().target); + if (moduleExportsChangedToDefault) { + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var importingFile = _a[_i]; + fixImportOfModuleExports(importingFile, file, changes); + } + } + }); + return { edits: edits, renameFilename: undefined, renameLocation: undefined }; + } + function fixImportOfModuleExports(importingFile, exportingFile, changes) { + for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + var parent = moduleSpecifier.parent; + switch (parent.kind) { + case 252 /* ExternalModuleReference */: { + var importEq = parent.parent; + changes.replaceNode(importingFile, importEq, makeImport(importEq.name, /*namedImports*/ undefined, moduleSpecifier.text)); + break; + } + case 185 /* CallExpression */: { + var call = parent; + if (ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ false)) { + changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); + } + break; + } + } + } + } + /** @returns Whether we converted a `module.exports =` to a default export. */ + function convertFileToEs6Module(sourceFile, checker, changes, target) { + var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; + var exports = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports, changes); + var moduleExportsChangedToDefault = false; + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + var res = ts.createMap(); + forEachExportReference(sourceFile, function (node) { + var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; + if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) + || checker.resolveName(node.name.text, node, 107455 /* Value */, /*excludeGlobals*/ true))) { + // Unconditionally add an underscore in case `text` is a keyword. + res.set(text, makeUniqueName("_" + text, identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports, changes) { + forEachExportReference(sourceFile, function (node, isAssignmentLhs) { + if (isAssignmentLhs) { + return; + } + var text = node.name.text; + changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { + var parent = node.parent; + cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58 /* EqualsToken */); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { + switch (statement.kind) { + case 212 /* VariableStatement */: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); + return false; + case 214 /* ExpressionStatement */: { + var expression = statement.expression; + switch (expression.kind) { + case 185 /* CallExpression */: { + if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteral*/ true)) { + // For side-effecting require() call, just make a side-effecting import. + changes.replaceNode(sourceFile, statement, makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0].text)); + } + return false; + } + case 198 /* BinaryExpression */: { + var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return operatorToken.kind === 58 /* EqualsToken */ && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); + } + } + } + // falls through + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { + var declarationList = statement.declarationList; + var foundImport = false; + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { + var name = decl.name, initializer = decl.initializer; + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + // `const alias = module.exports;` can be removed. + foundImport = true; + return []; + } + if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); + } + else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); + } + else { + // Move it out to its own variable statement. + return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); + } + }); + if (foundImport) { + // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + } + /** Converts `const name = require("moduleSpecifier").propertyName` */ + function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: { + // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` + var tmp = makeUniqueName(propertyName, identifiers); + return [ + makeSingleImport(tmp, propertyName, moduleSpecifier), + makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + // `const a = require("b").c` --> `import { c as a } from "./b"; + return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; + default: + ts.Debug.assertNever(name); + } + } + function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { + if (!ts.isPropertyAccessExpression(left)) { + return false; + } + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { + // `const alias = module.exports;` or `module.exports = alias;` can be removed. + changes.deleteNode(sourceFile, statement); + } + else { + var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; + var changedToDefaultExport = false; + if (!newNodes) { + (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); + } + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + return changedToDefaultExport; + } + } + else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, statement, left.name, right, changes, exports); + } + return false; + var _a; + } + /** + * Convert `module.exports = { ... }` to individual exports.. + * We can't always do this if the module has interesting members -- then it will be a default export instead. + */ + function tryChangeModuleExportsObject(object) { + return ts.mapAllOrFail(object.properties, function (prop) { + switch (prop.kind) { + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. + case 269 /* ShorthandPropertyAssignment */: + case 270 /* SpreadAssignment */: + return undefined; + case 268 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals(prop.name.text, prop.initializer); + case 153 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(84 /* ExportKeyword */)], prop); + default: + ts.Debug.assertNever(prop); + } + }); + } + function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { + // If "originalKeywordKind" was set, this is e.g. `exports. + var text = propertyName.text; + var rename = exports.get(text); + if (rename !== undefined) { + /* + const _class = 0; + export { _class as class }; + */ + var newNodes = [ + makeConst(/*modifiers*/ undefined, rename, right), + makeExportDeclaration([ts.createExportSpecifier(rename, text)]), + ]; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + else { + changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); + } + } + function convertModuleExportsToExportDefault(exported, checker) { + var modifiers = [ts.createToken(84 /* ExportKeyword */), ts.createToken(79 /* DefaultKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: { + // `module.exports = function f() {}` --> `export default function f() {}` + var fn = exported; + return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; + } + case 203 /* ClassExpression */: { + // `module.exports = class C {}` --> `export default class C {}` + var cls = exported; + return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; + } + case 185 /* CallExpression */: + if (ts.isRequireCall(exported, /*checkArgumentIsStringLiteral*/ true)) { + return convertReExportAll(exported.arguments[0], checker); + } + // falls through + default: + // `module.exports = 0;` --> `export default 0;` + return [[ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, exported)], true]; + } + } + function convertReExportAll(reExported, checker) { + // `module.exports = require("x");` ==> `export * from "x"; export { default } from "x";` + var moduleSpecifier = reExported.text; + var moduleSymbol = checker.getSymbolAtLocation(reExported); + var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; + return exports.has("export=") + ? [[reExportDefault(moduleSpecifier)], true] + : !exports.has("default") + ? [[reExportStar(moduleSpecifier)], false] + // If there's some non-default export, must include both `export *` and `export default`. + : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([ts.createExportSpecifier(/*propertyName*/ undefined, "default")], moduleSpecifier); + } + function convertExportsDotXEquals(name, exported) { + var modifiers = [ts.createToken(84 /* ExportKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: { + var expressionName = exported.name; + if (expressionName && expressionName.text !== name) { + // `exports.f = function g() {}` -> `export const f = function g() {}` + return exportConst(); + } + } + // falls through + case 191 /* ArrowFunction */: + // `exports.f = function() {}` --> `export function f() {}` + return functionExpressionToDeclaration(name, modifiers, exported); + case 203 /* ClassExpression */: + // `exports.C = class {}` --> `export class C {}` + return classExpressionToDeclaration(name, modifiers, exported); + default: + return exportConst(); + } + function exportConst() { + // `exports.x = 0;` --> `export const x = 0;` + return makeConst(modifiers, ts.createIdentifier(name), exported); + } + } + /** + * Converts `const <> = require("x");`. + * Returns nodes that will replace the variable declaration for the commonjs import. + * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. + */ + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: { + var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { + return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) + ? undefined + : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); + }); + if (importSpecifiers) { + return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier)]; + } + } + // falls through -- object destructuring has an interesting pattern and must be a variable declaration + case 179 /* ArrayBindingPattern */: { + /* + import x from "x"; + const [a, b, c] = x; + */ + var tmp = makeUniqueName(ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); + return [ + makeImport(ts.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), + makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); + default: + ts.Debug.assertNever(name); + } + } + /** + * Convert `import x = require("x").` + * Also converts uses like `x.y()` to `y()` and uses a named import. + */ + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { + var nameSymbol = checker.getSymbolAtLocation(name); + // Maps from module property name to name actually used. (The same if there isn't shadowing.) + var namedBindingsNames = ts.createMap(); + // True if there is some non-property use like `x()` or `f(x)`. + var needDefaultImport = false; + for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { + var use = _a[_i]; + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { + // This was a use of a different symbol with the same name, due to shadowing. Ignore. + continue; + } + var parent = use.parent; + if (ts.isPropertyAccessExpression(parent)) { + var expression = parent.expression, propertyName = parent.name.text; + ts.Debug.assert(expression === use); // Else shouldn't have been in `collectIdentifiers` + var idName = namedBindingsNames.get(propertyName); + if (idName === undefined) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + changes.replaceNode(file, parent, ts.createIdentifier(idName)); + } + else { + needDefaultImport = true; + } + } + var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { + var propertyName = _a[0], idName = _a[1]; + return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); + })); + if (!namedBindings) { + // If it was unused, ensure that we at least import *something*. + needDefaultImport = true; + } + return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; + } + // Identifiers helpers + function makeUniqueName(name, identifiers) { + while (identifiers.original.has(name) || identifiers.additional.has(name)) { + name = "_" + name; + } + identifiers.additional.set(name, true); + return name; + } + function collectFreeIdentifiers(file) { + var map = ts.createMultiMap(); + file.forEachChild(function recur(node) { + if (ts.isIdentifier(node) && isFreeIdentifier(node)) { + map.add(node.text, node); + } + node.forEachChild(recur); + }); + return map; + } + function isFreeIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + return parent.name !== node; + case 180 /* BindingElement */: + return parent.propertyName !== node; + default: + return true; + } + } + // Node helpers + function functionExpressionToDeclaration(name, additionalModifiers, fn) { + return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); + } + function classExpressionToDeclaration(name, additionalModifiers, cls) { + return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); + } + function makeSingleImport(localName, propertyName, moduleSpecifier) { + return propertyName === "default" + ? makeImport(ts.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier) + : makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); + } + function makeImport(name, namedImports, moduleSpecifier) { + var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); + return ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifier)); + } + function makeImportSpecifier(propertyName, name) { + return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); + } + function makeConst(modifiers, name, init) { + return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, /*type*/ undefined, init)], 2 /* Const */)); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return ts.createExportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); + } + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); /// /// /* @internal */ @@ -94461,14 +99262,9 @@ var ts; var refactor; (function (refactor) { var extractSymbol; - (function (extractSymbol_1) { - var extractSymbol = { - name: "Extract Symbol", - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_symbol), - getAvailableActions: getAvailableActions, - getEditsForAction: getEditsForAction, - }; - refactor.registerRefactor(extractSymbol); + (function (extractSymbol) { + var refactorName = "Extract Symbol"; + refactor.registerRefactor(refactorName, { getAvailableActions: getAvailableActions, getEditsForAction: getEditsForAction }); /** * Compute the associated code actions * Exported for tests. @@ -94526,21 +99322,21 @@ var ts; var infos = []; if (functionActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_function), actions: functionActions }); } if (constantActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_constant), actions: constantActions }); } return infos.length ? infos : undefined; } - extractSymbol_1.getAvailableActions = getAvailableActions; + extractSymbol.getAvailableActions = getAvailableActions; /* Exported for tests */ function getEditsForAction(context, actionName) { var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: ts.getRefactorContextLength(context) }); @@ -94559,7 +99355,7 @@ var ts; } ts.Debug.fail("Unrecognized action name"); } - extractSymbol_1.getEditsForAction = getEditsForAction; + extractSymbol.getEditsForAction = getEditsForAction; // Move these into diagnostic messages if they become user-facing var Messages; (function (Messages) { @@ -94588,7 +99384,7 @@ var ts; Messages.cannotExtractToOtherFunctionLike = createMessage("Cannot extract method to a function-like scope that is not a function"); Messages.cannotExtractToJSClass = createMessage("Cannot extract constant to a class scope in JS"); Messages.cannotExtractToExpressionArrowFunction = createMessage("Cannot extract constant to an arrow function without a block"); - })(Messages = extractSymbol_1.Messages || (extractSymbol_1.Messages = {})); + })(Messages = extractSymbol.Messages || (extractSymbol.Messages = {})); var RangeFacts; (function (RangeFacts) { RangeFacts[RangeFacts["None"] = 0] = "None"; @@ -94649,6 +99445,14 @@ var ts; break; } } + if (!statements.length) { + // https://github.com/Microsoft/TypeScript/issues/20559 + // Ranges like [|case 1: break;|] will fail to populate `statements` because + // they will never find `start` in `start.parent.statements`. + // Consider: We could support ranges like [|case 1:|] by refining them to just + // the expression. + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] }; + } return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; } if (ts.isReturnStatement(start) && !start.expression) { @@ -94703,20 +99507,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 150 /* PropertyDeclaration */) { + if (current.kind === 151 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 147 /* Parameter */) { + else if (current.kind === 148 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 153 /* Constructor */) { + if (ctorOrMethod.kind === 154 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 152 /* MethodDeclaration */) { + else if (current.kind === 153 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -94733,6 +99537,10 @@ var ts; PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; })(PermittedJumps || (PermittedJumps = {})); + // We believe it's true because the node is from the (unmodified) tree. + ts.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + // For understanding how skipTrivia functioned: + ts.Debug.assert(!ts.positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); if (!ts.isStatement(nodeToCheck) && !(ts.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) { return [ts.createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; } @@ -94755,7 +99563,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 227 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 230 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); return true; @@ -94764,13 +99572,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 97 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 182 /* CallExpression */) { + if (node.parent.kind === 185 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -94785,9 +99593,9 @@ var ts; } if (!node || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - if (node.parent.kind === 269 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + if (node.parent.kind === 272 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } @@ -94798,20 +99606,20 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 212 /* IfStatement */: + case 215 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 208 /* Block */: - if (node.parent && node.parent.kind === 225 /* TryStatement */ && node.parent.finallyBlock === node) { + case 211 /* Block */: + if (node.parent && node.parent.kind === 228 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -94823,11 +99631,11 @@ var ts; break; } switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); @@ -94835,8 +99643,8 @@ var ts; seenLabels.pop(); break; } - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: { var label = node.label; if (label) { @@ -94846,20 +99654,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 219 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 222 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -94875,7 +99683,7 @@ var ts; } } } - extractSymbol_1.getRangeToExtract = getRangeToExtract; + extractSymbol.getRangeToExtract = getRangeToExtract; function getStatementOrExpressionRange(node) { if (ts.isStatement(node)) { return [node]; @@ -94913,7 +99721,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 147 /* Parameter */) { + if (current.kind === 148 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -94924,7 +99732,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 269 /* SourceFile */) { + if (current.kind === 272 /* SourceFile */) { return scopes; } } @@ -95014,33 +99822,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: return scope.name - ? "function expression '" + scope.name.text + "'" - : "anonymous function expression"; - case 229 /* FunctionDeclaration */: - return "function '" + scope.name.text + "'"; - case 188 /* ArrowFunction */: + ? "function '" + scope.name.text + "'" + : "anonymous function"; + case 191 /* ArrowFunction */: return "arrow function"; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return "method '" + scope.name.getText(); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: ts.Debug.assertNever(scope); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 230 /* ClassDeclaration */ - ? "class '" + scope.name.text + "'" + return scope.kind === 233 /* ClassDeclaration */ + ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 235 /* ModuleBlock */ + return scope.kind === 238 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -95078,7 +99885,7 @@ var ts; var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" type = checker.getBaseTypeOfLiteralType(type); - typeNode = checker.typeToTypeNode(type, scope, ts.NodeBuilderFlags.NoTruncation); + typeNode = checker.typeToTypeNode(type, scope, 1 /* NoTruncation */); } var paramDecl = ts.createParameter( /*decorators*/ undefined, @@ -95106,7 +99913,7 @@ var ts; // to avoid problems when there are literal types present if (ts.isExpression(node) && !isJS) { var contextualType = checker.getContextualType(node); - returnType = checker.typeToTypeNode(contextualType, scope, ts.NodeBuilderFlags.NoTruncation); + returnType = checker.typeToTypeNode(contextualType, scope, 1 /* NoTruncation */); } var _b = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)), body = _b.body, returnValueProperty = _b.returnValueProperty; ts.suppressLeadingAndTrailingTrivia(body); @@ -95132,13 +99939,10 @@ var ts; var minInsertionPos = (isReadonlyArray(range.range) ? ts.last(range.range) : range.range).end; var nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope); if (nodeToInsertBefore) { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, /*blankLineBetween*/ true); } else { - changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { - prefix: ts.isLineBreak(file.text.charCodeAt(scope.getLastToken().pos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter, - suffix: context.newLineCharacter - }); + changeTracker.insertNodeAtEndOfScope(context.file, scope, newFunction); } var newNodes = []; // replace range with function call @@ -95177,7 +99981,7 @@ var ts; /*propertyName*/ undefined, /*name*/ ts.getSynthesizedDeepClone(variableDeclaration.name))); // Being returned through an object literal will have widened the type. - var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, ts.NodeBuilderFlags.NoTruncation); + var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, 1 /* NoTruncation */); typeElements.push(ts.createPropertySignature( /*modifiers*/ undefined, /*name*/ variableDeclaration.symbol.name, @@ -95250,10 +100054,12 @@ var ts; newNodes.push(call); } } - var replacementRange = isReadonlyArray(range.range) - ? { pos: ts.first(range.range).getStart(), end: ts.last(range.range).end } - : { pos: range.range.getStart(), end: range.range.end }; - changeTracker.replaceRangeWithNodes(context.file, replacementRange, newNodes, { nodeSeparator: context.newLineCharacter }); + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodeRangeWithNodes(context.file, ts.first(range.range), ts.last(range.range), newNodes); + } + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); + } var edits = changeTracker.getChanges(); var renameRange = isReadonlyArray(range.range) ? ts.first(range.range) : range.range; var renameFilename = renameRange.getSourceFile().fileName; @@ -95268,9 +100074,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 139 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 140 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(139 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(140 /* UndefinedKeyword */)]); } } /** @@ -95284,9 +100090,9 @@ var ts; var file = scope.getSourceFile(); var localNameText = getUniqueName(ts.isClassLike(scope) ? "newProperty" : "newLocal", file.text); var isJS = ts.isInJavaScriptFile(scope); - var variableType = isJS + var variableType = isJS || !checker.isContextSensitive(node) ? undefined - : checker.typeToTypeNode(checker.getContextualType(node), scope, ts.NodeBuilderFlags.NoTruncation); + : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */); var initializer = transformConstantInitializer(node, substitutions); ts.suppressLeadingAndTrailingTrivia(initializer); var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -95297,7 +100103,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(115 /* StaticKeyword */)); } - modifiers.push(ts.createToken(131 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(132 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -95307,9 +100113,9 @@ var ts; // Declare var maxInsertionPos = node.pos; var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true); // Consume - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } else { var newVariableDeclaration = ts.createVariableDeclaration(localNameText, variableType, initializer); @@ -95320,18 +100126,18 @@ var ts; var oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope); if (oldVariableDeclaration) { // Declare - // CONSIDER: could detect that each is on a separate line - changeTracker.insertNodeAt(context.file, oldVariableDeclaration.getStart(), newVariableDeclaration, { suffix: ", " }); + // CONSIDER: could detect that each is on a separate line (See `extractConstant_VariableList_MultipleLines` in `extractConstants.ts`) + changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); // Consume var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } - else if (node.parent.kind === 211 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 214 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)); - changeTracker.replaceRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }, newVariableStatement); + changeTracker.replaceNode(context.file, node.parent, newVariableStatement, ts.textChanges.useNonAdjustedPositions); } else { var newVariableStatement = ts.createVariableStatement( @@ -95339,26 +100145,19 @@ var ts; // Declare var nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope); if (nodeToInsertBefore.pos === 0) { - // If we're at the beginning of the file, we need to take care not to insert before header comments - // (e.g. copyright, triple-slash references). Fortunately, this problem has already been solved - // for imports. - var insertionPos = ts.getSourceFileImportLocation(file); - changeTracker.insertNodeAt(context.file, insertionPos, newVariableStatement, { - prefix: insertionPos === 0 ? undefined : context.newLineCharacter, - suffix: ts.isLineBreak(file.text.charCodeAt(insertionPos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter - }); + changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement, /*blankLineBetween*/ false); } else { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 211 /* ExpressionStatement */) { + if (node.parent.kind === 214 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. - changeTracker.deleteRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }); + changeTracker.deleteNode(context.file, node.parent, ts.textChanges.useNonAdjustedPositions); } else { var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } } } @@ -95389,10 +100188,10 @@ var ts; var delta = 0; var lastPos = -1; for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], fileName = _a.fileName, textChanges_1 = _a.textChanges; + var _a = edits_1[_i], fileName = _a.fileName, textChanges_2 = _a.textChanges; ts.Debug.assert(fileName === renameFilename); - for (var _b = 0, textChanges_2 = textChanges_1; _b < textChanges_2.length; _b++) { - var change = textChanges_2[_b]; + for (var _b = 0, textChanges_3 = textChanges_2; _b < textChanges_3.length; _b++) { + var change = textChanges_3[_b]; var span_15 = change.span, newText = change.newText; var index = newText.indexOf(functionNameText); if (index !== -1) { @@ -95469,7 +100268,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 220 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 223 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -95571,6 +100370,11 @@ var ts; } prevStatement = statement; } + if (!prevStatement && ts.isCaseClause(curr)) { + // We must have been in the expression of the case clause. + ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent)); + return curr.parent.parent; + } // There must be at least one statement since we started in one. ts.Debug.assert(prevStatement !== undefined); return prevStatement; @@ -95644,7 +100448,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 229 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 232 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -95856,7 +100660,8 @@ var ts; return symbolId; } // find first declaration in this file - var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + var decls = symbol.getDeclarations(); + var declInFile = decls && ts.find(decls, function (d) { return d.getSourceFile() === sourceFile; }); if (!declInFile) { return undefined; } @@ -95879,7 +100684,7 @@ var ts; } for (var i = 0; i < scopes.length; i++) { var scope = scopes[i]; - var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags, /*excludeGlobals*/ false); if (resolvedSymbol === symbol) { continue; } @@ -95946,7 +100751,8 @@ var ts; if (!symbol) { return undefined; } - if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + var decls = symbol.getDeclarations(); + if (decls && decls.some(function (d) { return d.parent === scopeDecl; })) { return ts.createIdentifier(symbol.name); } var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); @@ -95981,30 +100787,30 @@ var ts; */ function isExtractableExpression(node) { switch (node.parent.kind) { - case 268 /* EnumMember */: + case 271 /* EnumMember */: return false; } switch (node.kind) { case 9 /* StringLiteral */: - return node.parent.kind !== 239 /* ImportDeclaration */ && - node.parent.kind !== 243 /* ImportSpecifier */; - case 199 /* SpreadElement */: - case 175 /* ObjectBindingPattern */: - case 177 /* BindingElement */: + return node.parent.kind !== 242 /* ImportDeclaration */ && + node.parent.kind !== 246 /* ImportSpecifier */; + case 202 /* SpreadElement */: + case 178 /* ObjectBindingPattern */: + case 180 /* BindingElement */: return false; case 71 /* Identifier */: - return node.parent.kind !== 177 /* BindingElement */ && - node.parent.kind !== 243 /* ImportSpecifier */ && - node.parent.kind !== 247 /* ExportSpecifier */; + return node.parent.kind !== 180 /* BindingElement */ && + node.parent.kind !== 246 /* ImportSpecifier */ && + node.parent.kind !== 250 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 208 /* Block */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: - case 261 /* CaseClause */: + case 211 /* Block */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: + case 264 /* CaseClause */: return true; default: return false; @@ -96019,15 +100825,11 @@ var ts; var refactor; (function (refactor) { var installTypesForPackage; - (function (installTypesForPackage_1) { + (function (installTypesForPackage) { + var refactorName = "Install missing types package"; var actionName = "install"; - var installTypesForPackage = { - name: "Install missing types package", - description: "Install missing types package", - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(installTypesForPackage); + var description = "Install missing types package"; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.getStrictOptionValue(context.program.getCompilerOptions(), "noImplicitAny")) { // Then it will be available via `fixCannotFindModule`. @@ -96036,8 +100838,8 @@ var ts; var action = getAction(context); return action && [ { - name: installTypesForPackage.name, - description: installTypesForPackage.description, + name: refactorName, + description: description, actions: [ { description: action.description, @@ -96074,8 +100876,8 @@ var ts; } function isModuleIdentifier(node) { switch (node.parent.kind) { - case 239 /* ImportDeclaration */: - case 249 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 252 /* ExternalModuleReference */: return true; default: return false; @@ -96092,16 +100894,11 @@ var ts; var installTypesForPackage; (function (installTypesForPackage) { var actionName = "Convert to default import"; - var useDefaultImport = { - name: actionName, - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import), - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(useDefaultImport); + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { var file = context.file, startPosition = context.startPosition, program = context.program; - if (!program.getCompilerOptions().allowSyntheticDefaultImports) { + if (!ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { return undefined; } var importInfo = getConvertibleImportAtPosition(file, startPosition); @@ -96109,17 +100906,17 @@ var ts; return undefined; } var module = ts.getResolvedModule(file, importInfo.moduleSpecifier.text); - var resolvedFile = program.getSourceFile(module.resolvedFileName); - if (!(resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { + var resolvedFile = module && program.getSourceFile(module.resolvedFileName); + if (!(resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { return undefined; } return [ { - name: useDefaultImport.name, - description: useDefaultImport.description, + name: actionName, + description: description, actions: [ { - description: useDefaultImport.description, + description: description, name: actionName, }, ], @@ -96146,21 +100943,21 @@ var ts; var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); while (true) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: var eq = node; var moduleReference = eq.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) + return moduleReference.kind === 252 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) ? { importStatement: eq, name: eq.name, moduleSpecifier: moduleReference.expression } : undefined; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var d = node; var importClause = d.importClause; - return !importClause.name && importClause.namedBindings.kind === 241 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings.kind === 244 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) ? { importStatement: d, name: importClause.namedBindings.name, moduleSpecifier: d.moduleSpecifier } : undefined; // For known child node kinds of convertible imports, try again with parent node. - case 241 /* NamespaceImport */: - case 249 /* ExternalModuleReference */: + case 244 /* NamespaceImport */: + case 252 /* ExternalModuleReference */: case 91 /* ImportKeyword */: case 71 /* Identifier */: case 9 /* StringLiteral */: @@ -96177,6 +100974,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /// /// /// @@ -96195,6 +100993,7 @@ var ts; /// /// /// +/// /// /// /// @@ -96278,6 +101077,9 @@ var ts; var token = ts.scanner.scan(); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { + if (token === 71 /* Identifier */) { + ts.Debug.fail("Did not expect " + ts.Debug.showSyntaxKind(this) + " to have an Identifier in its trivia"); + } nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; @@ -96288,7 +101090,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(290 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(293 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { @@ -96374,8 +101176,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 271 /* FirstJSDocNode */ || kid.kind > 289 /* LastJSDocNode */; }); - return child.kind < 144 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 274 /* FirstJSDocNode */ || kid.kind > 292 /* LastJSDocNode */; }); + return child.kind < 145 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -96386,7 +101188,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 144 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 145 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -96729,13 +101531,13 @@ var ts; function getDeclarationName(declaration) { var name = ts.getNameOfDeclaration(declaration); if (name) { - var result_8 = ts.getTextOfIdentifierOrLiteral(name); - if (result_8 !== undefined) { - return result_8; + var result_6 = ts.getTextOfIdentifierOrLiteral(name); + if (result_6 !== undefined) { + return result_6; } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var expr = name.expression; - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { return expr.name.text; } return ts.getTextOfIdentifierOrLiteral(expr); @@ -96745,10 +101547,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -96768,31 +101570,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 164 /* TypeLiteral */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 165 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: { + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -96803,19 +101605,19 @@ var ts; } } // falls through - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: addDeclaration(node); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -96827,7 +101629,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -96836,7 +101638,7 @@ var ts; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -97016,8 +101818,7 @@ var ts; sourceFile.scriptSnapshot = scriptSnapshot; } function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents, scriptKind) { - var text = scriptSnapshot.getText(0, scriptSnapshot.getLength()); - var sourceFile = ts.createSourceFile(fileName, text, scriptTarget, setNodeParents, scriptKind); + var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTarget, setNodeParents, scriptKind); setSourceFileFields(sourceFile, scriptSnapshot, version); return sourceFile; } @@ -97181,7 +101982,7 @@ var ts; getCancellationToken: function () { return cancellationToken; }, getCanonicalFileName: getCanonicalFileName, useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return ts.getNewLineCharacter(newSettings, { newLine: ts.getNewLineOrDefaultFromHost(host) }); }, + getNewLine: function () { return ts.getNewLineCharacter(newSettings, function () { return ts.getNewLineOrDefaultFromHost(host); }); }, getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, writeFile: ts.noop, getCurrentDirectory: function () { return currentDirectory; }, @@ -97191,10 +101992,11 @@ var ts; var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); var entry = hostCache.getEntryByPath(path); if (entry) { - return ts.isString(entry) ? undefined : entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); } return host.readFile && host.readFile(fileName); }, + realpath: host.realpath && (function (path) { return host.realpath(path); }), directoryExists: function (directoryName) { return ts.directoryProbablyExists(directoryName, host); }, @@ -97333,13 +102135,13 @@ var ts; return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); } function getCompletionsAtPosition(fileName, position, options) { - if (options === void 0) { options = { includeExternalModuleExports: false }; } + if (options === void 0) { options = { includeExternalModuleExports: false, includeInsertTextCompletions: false }; } synchronizeHostData(); return ts.Completions.getCompletionsAtPosition(host, program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, program.getSourceFiles(), options); } function getCompletionEntryDetails(fileName, position, name, formattingOptions, source) { synchronizeHostData(); - return ts.Completions.getCompletionEntryDetails(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); + return ts.Completions.getCompletionEntryDetails(program, log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); } function getCompletionEntrySymbol(fileName, position, name, source) { synchronizeHostData(); @@ -97361,10 +102163,10 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 97 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -97425,44 +102227,24 @@ var ts; } /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { - var results = getOccurrencesAtPositionCore(fileName, position); - if (results) { - var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - // Get occurrences only supports reporting occurrences for the file queried. So - // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); - } - return results; + var canonicalFileName = getCanonicalFileName(ts.normalizeSlashes(fileName)); + return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { + ts.Debug.assert(getCanonicalFileName(ts.normalizeSlashes(entry.fileName)) === canonicalFileName); // Get occurrences only supports reporting occurrences for the file queried. + return { + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, + isDefinition: false, + isInString: highlightSpan.isInString, + }; + }); }); } function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); - var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); }); + var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return ts.Debug.assertDefined(program.getSourceFile(f)); }); var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function getOccurrencesAtPositionCore(fileName, position) { - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - function convertDocumentHighlights(documentHighlights) { - if (!documentHighlights) { - return undefined; - } - var result = []; - for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) { - var entry = documentHighlights_1[_i]; - for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { - var highlightSpan = _b[_a]; - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, - isDefinition: false, - isInString: highlightSpan.isInString, - }); - } - } - return result; - } - } function findRenameLocations(fileName, position, findInStrings, findInComments) { return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } @@ -97526,15 +102308,15 @@ var ts; return; } switch (node.kind) { - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 9 /* StringLiteral */: case 86 /* FalseKeyword */: case 101 /* TrueKeyword */: case 95 /* NullKeyword */: case 97 /* SuperKeyword */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 71 /* Identifier */: break; // Cant create the text span @@ -97551,7 +102333,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 234 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 237 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -97612,47 +102394,20 @@ var ts; var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } + var braceMatching = ts.createMapFromTemplate((_a = {}, + _a[17 /* OpenBraceToken */] = 18 /* CloseBraceToken */, + _a[19 /* OpenParenToken */] = 20 /* CloseParenToken */, + _a[21 /* OpenBracketToken */] = 22 /* CloseBracketToken */, + _a[29 /* GreaterThanToken */] = 27 /* LessThanToken */, + _a)); + braceMatching.forEach(function (value, key) { return braceMatching.set(value.toString(), Number(key)); }); function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var result = []; var token = ts.getTouchingToken(sourceFile, position, /*includeJsDocComment*/ false); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - // Ensure that there is a corresponding token to match ours. - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) { - var current = childNodes_1[_i]; - if (current.kind === matchKind) { - var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - // We want to order the braces when we return the result. - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 17 /* OpenBraceToken */: return 18 /* CloseBraceToken */; - case 19 /* OpenParenToken */: return 20 /* CloseParenToken */; - case 21 /* OpenBracketToken */: return 22 /* CloseBracketToken */; - case 27 /* LessThanToken */: return 29 /* GreaterThanToken */; - case 18 /* CloseBraceToken */: return 17 /* OpenBraceToken */; - case 20 /* CloseParenToken */: return 19 /* OpenParenToken */; - case 22 /* CloseBracketToken */: return 21 /* OpenBracketToken */; - case 29 /* GreaterThanToken */: return 27 /* LessThanToken */; - } - return undefined; - } + var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined; + var match = matchKind && ts.findChildOfKind(token.parent, matchKind, sourceFile); + // We want to order the braces when we return the result. + return match ? [ts.createTextSpanFromNode(token, sourceFile), ts.createTextSpanFromNode(match, sourceFile)].sort(function (a, b) { return a.start - b.start; }) : ts.emptyArray; } function getIndentationAtPosition(fileName, position, editorOptions) { var start = ts.timestamp(); @@ -97692,13 +102447,26 @@ var ts; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = ts.createTextSpanFromBounds(start, end); - var newLineCharacter = ts.getNewLineOrDefaultFromHost(host); var formatContext = ts.formatting.getFormatContext(formatOptions); return ts.flatMap(ts.deduplicate(errorCodes, ts.equateValues, ts.compareValues), function (errorCode) { cancellationToken.throwIfCancellationRequested(); - return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, newLineCharacter: newLineCharacter, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); }); } + function getCombinedCodeFix(scope, fixId, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.codefix.getAllFixes({ fixId: fixId, sourceFile: sourceFile, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + } + function organizeImports(scope, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host); + } function applyCodeActionCommand(fileName, actionOrUndefined) { var action = typeof fileName === "string" ? actionOrUndefined : fileName; return ts.isArray(action) ? Promise.all(action.map(applySingleCodeActionCommand)) : applySingleCodeActionCommand(action); @@ -97815,7 +102583,7 @@ var ts; return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } function getTodoCommentsRegExp() { - // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to + // NOTE: `?:` means 'non-capture group'. It allows us to have groups without having to // filter them out later in the final result array. // TODO comments can appear in one of the following forms: // @@ -97885,7 +102653,6 @@ var ts; startPosition: startPosition, endPosition: endPosition, program: getProgram(), - newLineCharacter: formatOptions ? formatOptions.newLineCharacter : host.getNewLine(), host: host, formatContext: ts.formatting.getFormatContext(formatOptions), cancellationToken: cancellationToken, @@ -97942,7 +102709,9 @@ var ts; isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, + getCombinedCodeFix: getCombinedCodeFix, applyCodeActionCommand: applyCodeActionCommand, + organizeImports: organizeImports, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, getSourceFile: getSourceFile, @@ -97950,6 +102719,7 @@ var ts; getApplicableRefactors: getApplicableRefactors, getEditsForRefactor: getEditsForRefactor, }; + var _a; } ts.createLanguageService = createLanguageService; /* @internal */ @@ -97985,23 +102755,10 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 249 /* ExternalModuleReference */ || + node.parent.kind === 252 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } - function isObjectLiteralElement(node) { - switch (node.kind) { - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return true; - } - return false; - } /** * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } */ @@ -98010,13 +102767,13 @@ var ts; switch (node.kind) { case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 145 /* ComputedPropertyName */) { - return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + if (node.parent.kind === 146 /* ComputedPropertyName */) { + return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 71 /* Identifier */: - return isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 179 /* ObjectLiteralExpression */ || node.parent.parent.kind === 258 /* JsxAttributes */) && + return ts.isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 182 /* ObjectLiteralExpression */ || node.parent.parent.kind === 261 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -98033,20 +102790,20 @@ var ts; function getPropertySymbolsFromType(type, propName) { var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); if (name && type) { - var result_9 = []; + var result_7 = []; var symbol = type.getProperty(name); if (type.flags & 131072 /* Union */) { ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { - result_9.push(symbol); + result_7.push(symbol); } }); - return result_9; + return result_7; } if (symbol) { - result_9.push(symbol); - return result_9; + result_7.push(symbol); + return result_7; } } return undefined; @@ -98055,7 +102812,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 181 /* ElementAccessExpression */ && + node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -98136,114 +102893,114 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 227 /* VariableDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 230 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return spanInVariableDeclaration(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return spanInParameterDeclaration(node); - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanInBlock(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInBlock(node.block); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return spanInForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 177 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 180 /* BindingElement */: // span on complete node return textSpan(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 148 /* Decorator */: + case 149 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return undefined; // Tokens: case 25 /* SemicolonToken */: @@ -98273,7 +103030,7 @@ var ts; case 74 /* CatchKeyword */: case 87 /* FinallyKeyword */: return spanInNextNode(node); - case 143 /* OfKeyword */: + case 144 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -98283,16 +103040,16 @@ var ts; return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } // Set breakpoint on identifier element of destructuring pattern - // a or ...c or d: x from - // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern + // `a` or `...c` or `d: x` from + // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 71 /* Identifier */ || - node.kind === 199 /* SpreadElement */ || - node.kind === 265 /* PropertyAssignment */ || - node.kind === 266 /* ShorthandPropertyAssignment */) && + node.kind === 202 /* SpreadElement */ || + node.kind === 268 /* PropertyAssignment */ || + node.kind === 269 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 195 /* BinaryExpression */) { + if (node.kind === 198 /* BinaryExpression */) { var binaryExpression = node; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -98315,22 +103072,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (node.parent.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 148 /* Decorator */: + case 149 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return textSpan(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (node.parent.operatorToken.kind === 26 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -98339,13 +103096,13 @@ var ts; } } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 265 /* PropertyAssignment */ && + if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 185 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 188 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNextNode(node.parent.type); } // return type of function go to previous token @@ -98353,8 +103110,8 @@ var ts; return spanInPreviousNode(node); } // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 227 /* VariableDeclaration */ || - node.parent.kind === 147 /* Parameter */)) { + if ((node.parent.kind === 230 /* VariableDeclaration */ || + node.parent.kind === 148 /* Parameter */)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -98362,7 +103119,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 195 /* BinaryExpression */) { + if (node.parent.kind === 198 /* BinaryExpression */) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -98376,7 +103133,7 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (variableDeclaration.parent.kind === 231 /* VariableDeclarationList */ && variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); @@ -98388,7 +103145,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 216 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 219 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -98399,10 +103156,10 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 217 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 220 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (variableDeclaration.parent.kind === 231 /* VariableDeclarationList */ && variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and @@ -98426,8 +103183,9 @@ var ts; } else { var functionDeclaration = parameter.parent; - var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); - if (indexOfParameter) { + var indexOfParameter = functionDeclaration.parameters.indexOf(parameter); + ts.Debug.assert(indexOfParameter !== -1); + if (indexOfParameter !== 0) { // Not a first parameter, go to previous parameter return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); } @@ -98439,7 +103197,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 230 /* ClassDeclaration */ && functionDeclaration.kind !== 153 /* Constructor */); + (functionDeclaration.parent.kind === 233 /* ClassDeclaration */ && functionDeclaration.kind !== 154 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -98462,26 +103220,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // falls through // Set on parent if on same line otherwise on first statement - case 214 /* WhileStatement */: - case 212 /* IfStatement */: - case 216 /* ForInStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 219 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 231 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -98506,23 +103264,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 177 /* BindingElement */) { + if (bindingPattern.parent.kind === 180 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 176 /* ArrayBindingPattern */ && node.kind !== 175 /* ObjectBindingPattern */); - var elements = node.kind === 178 /* ArrayLiteralExpression */ ? - node.elements : - node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 179 /* ArrayBindingPattern */ && node.kind !== 178 /* ObjectBindingPattern */); + var elements = node.kind === 181 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -98530,18 +103286,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 195 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 198 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -98549,25 +103305,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 233 /* EnumDeclaration */: - case 230 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -98575,7 +103331,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -98591,7 +103347,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -98606,12 +103362,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 213 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 182 /* CallExpression */ || - node.parent.kind === 183 /* NewExpression */) { + if (node.parent.kind === 216 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 185 /* CallExpression */ || + node.parent.kind === 186 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 186 /* ParenthesizedExpression */) { + if (node.parent.kind === 189 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -98620,21 +103376,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 186 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 189 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -98644,20 +103400,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ || - node.parent.kind === 147 /* Parameter */) { + node.parent.kind === 268 /* PropertyAssignment */ || + node.parent.kind === 148 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 185 /* TypeAssertionExpression */) { + if (node.parent.kind === 188 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 213 /* DoStatement */) { + if (node.parent.kind === 216 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -98665,7 +103421,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.kind === 220 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -99185,10 +103941,10 @@ var ts; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + options + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, options); }); }; /** Get a string based representation of a completion list entry details */ - LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, options /*Services.FormatCodeOptions*/, source) { + LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, options, source) { var _this = this; return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { - var localOptions = JSON.parse(options); + var localOptions = options === undefined ? undefined : JSON.parse(options); return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source); }); }; @@ -99324,7 +104080,7 @@ var ts; var _this = this; return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { // for now treat files as JavaScript - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); + var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true); return { referencedFiles: _this.convertFileReferences(result.referencedFiles), importedFiles: _this.convertFileReferences(result.importedFiles), @@ -99359,8 +104115,7 @@ var ts; CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) { var _this = this; return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () { - var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); - var result = ts.parseJsonText(fileName, text); + var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot)); var normalizedFileName = ts.normalizeSlashes(fileName); var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName); return { @@ -99383,7 +104138,7 @@ var ts; if (_this.safeList === undefined) { _this.safeList = ts.JsTyping.loadSafeList(_this.host, ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName)); } - return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports); + return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports, info.typesRegistry); }); }; return CoreServicesShimObject; diff --git a/lib/typescriptServices.d.ts b/lib/typescriptServices.d.ts index 7b78c4237d6..ca9bf106e1e 100644 --- a/lib/typescriptServices.d.ts +++ b/lib/typescriptServices.d.ts @@ -59,6 +59,7 @@ declare namespace ts { pos: number; end: number; } + type JsDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.Unknown; enum SyntaxKind { Unknown = 0, EndOfFileToken = 1, @@ -186,177 +187,180 @@ declare namespace ts { ConstructorKeyword = 123, DeclareKeyword = 124, GetKeyword = 125, - IsKeyword = 126, - KeyOfKeyword = 127, - ModuleKeyword = 128, - NamespaceKeyword = 129, - NeverKeyword = 130, - ReadonlyKeyword = 131, - RequireKeyword = 132, - NumberKeyword = 133, - ObjectKeyword = 134, - SetKeyword = 135, - StringKeyword = 136, - SymbolKeyword = 137, - TypeKeyword = 138, - UndefinedKeyword = 139, - UniqueKeyword = 140, - FromKeyword = 141, - GlobalKeyword = 142, - OfKeyword = 143, - QualifiedName = 144, - ComputedPropertyName = 145, - TypeParameter = 146, - Parameter = 147, - Decorator = 148, - PropertySignature = 149, - PropertyDeclaration = 150, - MethodSignature = 151, - MethodDeclaration = 152, - Constructor = 153, - GetAccessor = 154, - SetAccessor = 155, - CallSignature = 156, - ConstructSignature = 157, - IndexSignature = 158, - TypePredicate = 159, - TypeReference = 160, - FunctionType = 161, - ConstructorType = 162, - TypeQuery = 163, - TypeLiteral = 164, - ArrayType = 165, - TupleType = 166, - UnionType = 167, - IntersectionType = 168, - ParenthesizedType = 169, - ThisType = 170, - TypeOperator = 171, - IndexedAccessType = 172, - MappedType = 173, - LiteralType = 174, - ObjectBindingPattern = 175, - ArrayBindingPattern = 176, - BindingElement = 177, - ArrayLiteralExpression = 178, - ObjectLiteralExpression = 179, - PropertyAccessExpression = 180, - ElementAccessExpression = 181, - CallExpression = 182, - NewExpression = 183, - TaggedTemplateExpression = 184, - TypeAssertionExpression = 185, - ParenthesizedExpression = 186, - FunctionExpression = 187, - ArrowFunction = 188, - DeleteExpression = 189, - TypeOfExpression = 190, - VoidExpression = 191, - AwaitExpression = 192, - PrefixUnaryExpression = 193, - PostfixUnaryExpression = 194, - BinaryExpression = 195, - ConditionalExpression = 196, - TemplateExpression = 197, - YieldExpression = 198, - SpreadElement = 199, - ClassExpression = 200, - OmittedExpression = 201, - ExpressionWithTypeArguments = 202, - AsExpression = 203, - NonNullExpression = 204, - MetaProperty = 205, - TemplateSpan = 206, - SemicolonClassElement = 207, - Block = 208, - VariableStatement = 209, - EmptyStatement = 210, - ExpressionStatement = 211, - IfStatement = 212, - DoStatement = 213, - WhileStatement = 214, - ForStatement = 215, - ForInStatement = 216, - ForOfStatement = 217, - ContinueStatement = 218, - BreakStatement = 219, - ReturnStatement = 220, - WithStatement = 221, - SwitchStatement = 222, - LabeledStatement = 223, - ThrowStatement = 224, - TryStatement = 225, - DebuggerStatement = 226, - VariableDeclaration = 227, - VariableDeclarationList = 228, - FunctionDeclaration = 229, - ClassDeclaration = 230, - InterfaceDeclaration = 231, - TypeAliasDeclaration = 232, - EnumDeclaration = 233, - ModuleDeclaration = 234, - ModuleBlock = 235, - CaseBlock = 236, - NamespaceExportDeclaration = 237, - ImportEqualsDeclaration = 238, - ImportDeclaration = 239, - ImportClause = 240, - NamespaceImport = 241, - NamedImports = 242, - ImportSpecifier = 243, - ExportAssignment = 244, - ExportDeclaration = 245, - NamedExports = 246, - ExportSpecifier = 247, - MissingDeclaration = 248, - ExternalModuleReference = 249, - JsxElement = 250, - JsxSelfClosingElement = 251, - JsxOpeningElement = 252, - JsxClosingElement = 253, - JsxFragment = 254, - JsxOpeningFragment = 255, - JsxClosingFragment = 256, - JsxAttribute = 257, - JsxAttributes = 258, - JsxSpreadAttribute = 259, - JsxExpression = 260, - CaseClause = 261, - DefaultClause = 262, - HeritageClause = 263, - CatchClause = 264, - PropertyAssignment = 265, - ShorthandPropertyAssignment = 266, - SpreadAssignment = 267, - EnumMember = 268, - SourceFile = 269, - Bundle = 270, - JSDocTypeExpression = 271, - JSDocAllType = 272, - JSDocUnknownType = 273, - JSDocNullableType = 274, - JSDocNonNullableType = 275, - JSDocOptionalType = 276, - JSDocFunctionType = 277, - JSDocVariadicType = 278, - JSDocComment = 279, - JSDocTypeLiteral = 280, - JSDocTag = 281, - JSDocAugmentsTag = 282, - JSDocClassTag = 283, - JSDocParameterTag = 284, - JSDocReturnTag = 285, - JSDocTypeTag = 286, - JSDocTemplateTag = 287, - JSDocTypedefTag = 288, - JSDocPropertyTag = 289, - SyntaxList = 290, - NotEmittedStatement = 291, - PartiallyEmittedExpression = 292, - CommaListExpression = 293, - MergeDeclarationMarker = 294, - EndOfDeclarationMarker = 295, - Count = 296, + InferKeyword = 126, + IsKeyword = 127, + KeyOfKeyword = 128, + ModuleKeyword = 129, + NamespaceKeyword = 130, + NeverKeyword = 131, + ReadonlyKeyword = 132, + RequireKeyword = 133, + NumberKeyword = 134, + ObjectKeyword = 135, + SetKeyword = 136, + StringKeyword = 137, + SymbolKeyword = 138, + TypeKeyword = 139, + UndefinedKeyword = 140, + UniqueKeyword = 141, + FromKeyword = 142, + GlobalKeyword = 143, + OfKeyword = 144, + QualifiedName = 145, + ComputedPropertyName = 146, + TypeParameter = 147, + Parameter = 148, + Decorator = 149, + PropertySignature = 150, + PropertyDeclaration = 151, + MethodSignature = 152, + MethodDeclaration = 153, + Constructor = 154, + GetAccessor = 155, + SetAccessor = 156, + CallSignature = 157, + ConstructSignature = 158, + IndexSignature = 159, + TypePredicate = 160, + TypeReference = 161, + FunctionType = 162, + ConstructorType = 163, + TypeQuery = 164, + TypeLiteral = 165, + ArrayType = 166, + TupleType = 167, + UnionType = 168, + IntersectionType = 169, + ConditionalType = 170, + InferType = 171, + ParenthesizedType = 172, + ThisType = 173, + TypeOperator = 174, + IndexedAccessType = 175, + MappedType = 176, + LiteralType = 177, + ObjectBindingPattern = 178, + ArrayBindingPattern = 179, + BindingElement = 180, + ArrayLiteralExpression = 181, + ObjectLiteralExpression = 182, + PropertyAccessExpression = 183, + ElementAccessExpression = 184, + CallExpression = 185, + NewExpression = 186, + TaggedTemplateExpression = 187, + TypeAssertionExpression = 188, + ParenthesizedExpression = 189, + FunctionExpression = 190, + ArrowFunction = 191, + DeleteExpression = 192, + TypeOfExpression = 193, + VoidExpression = 194, + AwaitExpression = 195, + PrefixUnaryExpression = 196, + PostfixUnaryExpression = 197, + BinaryExpression = 198, + ConditionalExpression = 199, + TemplateExpression = 200, + YieldExpression = 201, + SpreadElement = 202, + ClassExpression = 203, + OmittedExpression = 204, + ExpressionWithTypeArguments = 205, + AsExpression = 206, + NonNullExpression = 207, + MetaProperty = 208, + TemplateSpan = 209, + SemicolonClassElement = 210, + Block = 211, + VariableStatement = 212, + EmptyStatement = 213, + ExpressionStatement = 214, + IfStatement = 215, + DoStatement = 216, + WhileStatement = 217, + ForStatement = 218, + ForInStatement = 219, + ForOfStatement = 220, + ContinueStatement = 221, + BreakStatement = 222, + ReturnStatement = 223, + WithStatement = 224, + SwitchStatement = 225, + LabeledStatement = 226, + ThrowStatement = 227, + TryStatement = 228, + DebuggerStatement = 229, + VariableDeclaration = 230, + VariableDeclarationList = 231, + FunctionDeclaration = 232, + ClassDeclaration = 233, + InterfaceDeclaration = 234, + TypeAliasDeclaration = 235, + EnumDeclaration = 236, + ModuleDeclaration = 237, + ModuleBlock = 238, + CaseBlock = 239, + NamespaceExportDeclaration = 240, + ImportEqualsDeclaration = 241, + ImportDeclaration = 242, + ImportClause = 243, + NamespaceImport = 244, + NamedImports = 245, + ImportSpecifier = 246, + ExportAssignment = 247, + ExportDeclaration = 248, + NamedExports = 249, + ExportSpecifier = 250, + MissingDeclaration = 251, + ExternalModuleReference = 252, + JsxElement = 253, + JsxSelfClosingElement = 254, + JsxOpeningElement = 255, + JsxClosingElement = 256, + JsxFragment = 257, + JsxOpeningFragment = 258, + JsxClosingFragment = 259, + JsxAttribute = 260, + JsxAttributes = 261, + JsxSpreadAttribute = 262, + JsxExpression = 263, + CaseClause = 264, + DefaultClause = 265, + HeritageClause = 266, + CatchClause = 267, + PropertyAssignment = 268, + ShorthandPropertyAssignment = 269, + SpreadAssignment = 270, + EnumMember = 271, + SourceFile = 272, + Bundle = 273, + JSDocTypeExpression = 274, + JSDocAllType = 275, + JSDocUnknownType = 276, + JSDocNullableType = 277, + JSDocNonNullableType = 278, + JSDocOptionalType = 279, + JSDocFunctionType = 280, + JSDocVariadicType = 281, + JSDocComment = 282, + JSDocTypeLiteral = 283, + JSDocTag = 284, + JSDocAugmentsTag = 285, + JSDocClassTag = 286, + JSDocParameterTag = 287, + JSDocReturnTag = 288, + JSDocTypeTag = 289, + JSDocTemplateTag = 290, + JSDocTypedefTag = 291, + JSDocPropertyTag = 292, + SyntaxList = 293, + NotEmittedStatement = 294, + PartiallyEmittedExpression = 295, + CommaListExpression = 296, + MergeDeclarationMarker = 297, + EndOfDeclarationMarker = 298, + Count = 299, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -364,15 +368,15 @@ declare namespace ts { FirstReservedWord = 72, LastReservedWord = 107, FirstKeyword = 72, - LastKeyword = 143, + LastKeyword = 144, FirstFutureReservedWord = 108, LastFutureReservedWord = 116, - FirstTypeNode = 159, - LastTypeNode = 174, + FirstTypeNode = 160, + LastTypeNode = 177, FirstPunctuation = 17, LastPunctuation = 70, FirstToken = 0, - LastToken = 143, + LastToken = 144, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -381,11 +385,11 @@ declare namespace ts { LastTemplateToken = 16, FirstBinaryOperator = 27, LastBinaryOperator = 70, - FirstNode = 144, - FirstJSDocNode = 271, - LastJSDocNode = 289, - FirstJSDocTagNode = 281, - LastJSDocTagNode = 289, + FirstNode = 145, + FirstJSDocNode = 274, + LastJSDocNode = 292, + FirstJSDocTagNode = 284, + LastJSDocTagNode = 292, } enum NodeFlags { None = 0, @@ -453,6 +457,9 @@ declare namespace ts { interface JSDocContainer { } type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | EndOfFileToken; + type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; + type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; + type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; interface NodeArray extends ReadonlyArray, TextRange { hasTrailingComma?: boolean; } @@ -470,6 +477,8 @@ declare namespace ts { type AtToken = Token; type ReadonlyToken = Token; type AwaitKeywordToken = Token; + type PlusToken = Token; + type MinusToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression, Declaration { @@ -513,7 +522,7 @@ declare namespace ts { } interface TypeParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.TypeParameter; - parent?: DeclarationWithTypeParameters; + parent?: DeclarationWithTypeParameters | InferTypeNode; name: Identifier; constraint?: TypeNode; default?: TypeNode; @@ -604,15 +613,7 @@ declare namespace ts { kind: SyntaxKind.SpreadAssignment; expression: Expression; } - interface VariableLikeDeclaration extends NamedDeclaration { - propertyName?: PropertyName; - dotDotDotToken?: DotDotDotToken; - name: DeclarationName; - questionToken?: QuestionToken; - exclamationToken?: ExclamationToken; - type?: TypeNode; - initializer?: Expression; - } + type VariableLikeDeclaration = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag; interface PropertyLikeDeclaration extends NamedDeclaration { name: PropertyName; } @@ -643,7 +644,7 @@ declare namespace ts { body?: Block | Expression; } type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction; - type FunctionLike = FunctionLikeDeclaration | FunctionTypeNode | ConstructorTypeNode | IndexSignatureDeclaration | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration; + type FunctionLike = FunctionLikeDeclaration | FunctionTypeNode | ConstructorTypeNode | IndexSignatureDeclaration | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration | JSDocFunctionType; interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.FunctionDeclaration; name?: Identifier; @@ -651,39 +652,41 @@ declare namespace ts { } interface MethodSignature extends SignatureDeclarationBase, TypeElement { kind: SyntaxKind.MethodSignature; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.MethodDeclaration; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } interface ConstructorDeclaration extends FunctionLikeDeclarationBase, ClassElement, JSDocContainer { kind: SyntaxKind.Constructor; - parent?: ClassDeclaration | ClassExpression; + parent?: ClassLikeDeclaration; body?: FunctionBody; } /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ interface SemicolonClassElement extends ClassElement { kind: SyntaxKind.SemicolonClassElement; - parent?: ClassDeclaration | ClassExpression; + parent?: ClassLikeDeclaration; } interface GetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.GetAccessor; - parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } interface SetAccessorDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.SetAccessor; - parent?: ClassDeclaration | ClassExpression | ObjectLiteralExpression; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } type AccessorDeclaration = GetAccessorDeclaration | SetAccessorDeclaration; interface IndexSignatureDeclaration extends SignatureDeclarationBase, ClassElement, TypeElement { kind: SyntaxKind.IndexSignature; - parent?: ClassDeclaration | ClassExpression | InterfaceDeclaration | TypeLiteralNode; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; } interface TypeNode extends Node { _typeNodeBrand: any; @@ -738,6 +741,17 @@ declare namespace ts { kind: SyntaxKind.IntersectionType; types: NodeArray; } + interface ConditionalTypeNode extends TypeNode { + kind: SyntaxKind.ConditionalType; + checkType: TypeNode; + extendsType: TypeNode; + trueType: TypeNode; + falseType: TypeNode; + } + interface InferTypeNode extends TypeNode { + kind: SyntaxKind.InferType; + typeParameter: TypeParameterDeclaration; + } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; type: TypeNode; @@ -754,9 +768,9 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; - readonlyToken?: ReadonlyToken; + readonlyToken?: ReadonlyToken | PlusToken | MinusToken; typeParameter: TypeParameterDeclaration; - questionToken?: QuestionToken; + questionToken?: QuestionToken | PlusToken | MinusToken; type?: TypeNode; } interface LiteralTypeNode extends TypeNode { @@ -766,6 +780,7 @@ declare namespace ts { interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; } + type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; interface Expression extends Node { _expressionBrand: any; } @@ -881,7 +896,7 @@ declare namespace ts { type DestructuringAssignment = ObjectDestructuringAssignment | ArrayDestructuringAssignment; type BindingOrAssignmentElement = VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression | Identifier | PropertyAccessExpression | ElementAccessExpression; type BindingOrAssignmentElementRestIndicator = DotDotDotToken | SpreadElement | SpreadAssignment; - type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Expression; + type BindingOrAssignmentElementTarget = BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression; type ObjectBindingOrAssignmentPattern = ObjectBindingPattern | ObjectLiteralExpression; type ArrayBindingOrAssignmentPattern = ArrayBindingPattern | ArrayLiteralExpression; type AssignmentPattern = ObjectLiteralExpression | ArrayLiteralExpression; @@ -905,6 +920,7 @@ declare namespace ts { kind: SyntaxKind.ArrowFunction; equalsGreaterThanToken: EqualsGreaterThanToken; body: ConciseBody; + name: never; } interface LiteralLikeNode extends Node { text: string; @@ -972,7 +988,7 @@ declare namespace ts { interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; @@ -1255,6 +1271,7 @@ declare namespace ts { } interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.ClassDeclaration; + /** May be undefined in `export default class { ... }`. */ name?: Identifier; } interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression { @@ -1279,7 +1296,7 @@ declare namespace ts { } interface HeritageClause extends Node { kind: SyntaxKind.HeritageClause; - parent?: InterfaceDeclaration | ClassDeclaration | ClassExpression; + parent?: InterfaceDeclaration | ClassLikeDeclaration; token: SyntaxKind.ExtendsKeyword | SyntaxKind.ImplementsKeyword; types: NodeArray; } @@ -1366,6 +1383,7 @@ declare namespace ts { interface ExportDeclaration extends DeclarationStatement { kind: SyntaxKind.ExportDeclaration; parent?: SourceFile | ModuleBlock; + /** Will not be assigned in the case of `export * from "foo";` */ exportClause?: NamedExports; /** If this is not a StringLiteral it will be a grammar error. */ moduleSpecifier?: Expression; @@ -1394,6 +1412,10 @@ declare namespace ts { name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + /** + * This is either an `export =` or an `export default` declaration. + * Unless `isExportEquals` is set, this node was parsed as an `export default`. + */ interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; parent?: SourceFile; @@ -1620,7 +1642,7 @@ declare namespace ts { } interface ParseConfigHost { useCaseSensitiveFileNames: boolean; - readDirectory(rootDir: string, extensions: ReadonlyArray, excludes: ReadonlyArray, includes: ReadonlyArray, depth: number): string[]; + readDirectory(rootDir: string, extensions: ReadonlyArray, excludes: ReadonlyArray | undefined, includes: ReadonlyArray, depth?: number): string[]; /** * Gets a value indicating whether the specified path exists and is a file. * @param path The path to test. @@ -1728,9 +1750,21 @@ declare namespace ts { /** Note that the resulting nodes cannot be checked. */ typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode; /** Note that the resulting nodes cannot be checked. */ - signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; + signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration & { + typeArguments?: NodeArray; + } | undefined; /** Note that the resulting nodes cannot be checked. */ - indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): EntityName | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Expression | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): NodeArray | undefined; + /** Note that the resulting nodes cannot be checked. */ + symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): ParameterDeclaration | undefined; + /** Note that the resulting nodes cannot be checked. */ + typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeParameterDeclaration | undefined; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol | undefined; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -1750,7 +1784,8 @@ declare namespace ts { getTypeFromTypeNode(node: TypeNode): Type; signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; + symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string; + typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; /** * @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead * This will be removed in a future version. @@ -1790,33 +1825,80 @@ declare namespace ts { None = 0, NoTruncation = 1, WriteArrayAsGenericType = 2, + UseStructuralFallback = 8, + WriteTypeArgumentsOfSignature = 32, + UseFullyQualifiedType = 64, + UseOnlyExternalAliasing = 128, + SuppressAnyReturnType = 256, + WriteTypeParametersInQualifiedName = 512, + MultilineObjectLiterals = 1024, + WriteClassExpressionAsTypeLiteral = 2048, + UseTypeOfFunction = 4096, + OmitParameterModifiers = 8192, + UseAliasDefinedOutsideCurrentScope = 16384, + AllowThisInObjectLiteral = 32768, + AllowQualifedNameInPlaceOfIdentifier = 65536, + AllowAnonymousIdentifier = 131072, + AllowEmptyUnionOrIntersection = 262144, + AllowEmptyTuple = 524288, + AllowUniqueESSymbolType = 1048576, + AllowEmptyIndexInfoType = 2097152, + IgnoreErrors = 3112960, + InObjectTypeLiteral = 4194304, + InTypeAlias = 8388608, + InInitialEntityName = 16777216, + InReverseMappedType = 33554432, + } + enum TypeFormatFlags { + None = 0, + NoTruncation = 1, + WriteArrayAsGenericType = 2, + UseStructuralFallback = 8, WriteTypeArgumentsOfSignature = 32, UseFullyQualifiedType = 64, SuppressAnyReturnType = 256, - WriteTypeParametersInQualifiedName = 512, - AllowThisInObjectLiteral = 1024, - AllowQualifedNameInPlaceOfIdentifier = 2048, - AllowAnonymousIdentifier = 8192, - AllowEmptyUnionOrIntersection = 16384, - AllowEmptyTuple = 32768, - IgnoreErrors = 60416, - InObjectTypeLiteral = 1048576, + MultilineObjectLiterals = 1024, + WriteClassExpressionAsTypeLiteral = 2048, + UseTypeOfFunction = 4096, + OmitParameterModifiers = 8192, + UseAliasDefinedOutsideCurrentScope = 16384, + AllowUniqueESSymbolType = 1048576, + AddUndefined = 131072, + WriteArrowStyleSignature = 262144, + InArrayType = 524288, + InElementType = 2097152, + InFirstTypeArgument = 4194304, InTypeAlias = 8388608, + /** @deprecated */ WriteOwnNameForAnyLike = 0, + NodeBuilderFlagsMask = 9469291, } + enum SymbolFormatFlags { + None = 0, + WriteTypeParametersOrArguments = 1, + UseOnlyExternalAliasing = 2, + AllowAnyNodeKind = 4, + UseAliasDefinedOutsideCurrentScope = 8, + } + /** + * @deprecated + */ interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; - buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; + /** @deprecated */ buildSignatureDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): void; + /** @deprecated */ buildIndexSignatureDisplay(info: IndexInfo, writer: SymbolWriter, kind: IndexKind, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]): void; + /** @deprecated */ buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypePredicateDisplay(predicate: TypePredicate, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildDisplayForParametersAndDelimiters(thisParameter: Symbol, parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; + /** @deprecated */ buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; } - interface SymbolWriter { + /** + * @deprecated Migrate to other methods of generating symbol names, ex symbolToEntityName + a printer or symbolToString + */ + interface SymbolWriter extends SymbolTracker { writeKeyword(text: string): void; writeOperator(text: string): void; writePunctuation(text: string): void; @@ -1829,34 +1911,6 @@ declare namespace ts { increaseIndent(): void; decreaseIndent(): void; clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - reportInaccessibleThisError(): void; - reportPrivateInBaseOfClassExpression(propertyName: string): void; - reportInaccessibleUniqueSymbolError(): void; - } - enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 4, - NoTruncation = 8, - WriteArrowStyleSignature = 16, - WriteOwnNameForAnyLike = 32, - WriteTypeArgumentsOfSignature = 64, - InElementType = 128, - UseFullyQualifiedType = 256, - InFirstTypeArgument = 512, - InTypeAlias = 1024, - SuppressAnyReturnType = 4096, - AddUndefined = 8192, - WriteClassExpressionAsTypeLiteral = 16384, - InArrayType = 32768, - UseAliasDefinedOutsideCurrentScope = 65536, - AllowUniqueESSymbolType = 131072, - } - enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, } enum TypePredicateKind { This = 0, @@ -2017,8 +2071,9 @@ declare namespace ts { Intersection = 262144, Index = 524288, IndexedAccess = 1048576, - NonPrimitive = 33554432, - MarkerType = 134217728, + Conditional = 2097152, + Substitution = 4194304, + NonPrimitive = 134217728, Literal = 224, Unit = 13536, StringOrNumberLiteral = 96, @@ -2030,10 +2085,13 @@ declare namespace ts { ESSymbolLike = 1536, UnionOrIntersection = 393216, StructuredType = 458752, - StructuredOrTypeVariable = 2064384, TypeVariable = 1081344, - Narrowable = 35620607, - NotUnionOrUnit = 33620481, + InstantiableNonPrimitive = 7372800, + InstantiablePrimitive = 524288, + Instantiable = 7897088, + StructuredOrInstantiable = 8355840, + Narrowable = 142575359, + NotUnionOrUnit = 134283777, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { @@ -2071,6 +2129,9 @@ declare namespace ts { EvolvingArray = 256, ObjectLiteralPatternWithComputedProperties = 512, ContainsSpread = 1024, + ReverseMapped = 2048, + JsxAttributes = 4096, + MarkerType = 8192, ClassOrInterface = 3, } interface ObjectType extends Type { @@ -2119,17 +2180,27 @@ declare namespace ts { elementType: Type; finalArrayType?: Type; } - interface TypeVariable extends Type { + interface InstantiableType extends Type { } - interface TypeParameter extends TypeVariable { + interface TypeParameter extends InstantiableType { } - interface IndexedAccessType extends TypeVariable { + interface IndexedAccessType extends InstantiableType { objectType: Type; indexType: Type; constraint?: Type; } - interface IndexType extends Type { - type: TypeVariable | UnionOrIntersectionType; + interface IndexType extends InstantiableType { + type: InstantiableType | UnionOrIntersectionType; + } + interface ConditionalType extends InstantiableType { + checkType: Type; + extendsType: Type; + trueType: Type; + falseType: Type; + } + interface SubstitutionType extends InstantiableType { + typeParameter: TypeParameter; + substitute: Type; } enum SignatureKind { Call = 0, @@ -2150,21 +2221,23 @@ declare namespace ts { declaration?: SignatureDeclaration; } enum InferencePriority { - Contravariant = 1, - NakedTypeVariable = 2, - MappedType = 4, - ReturnType = 8, - NeverType = 16, + NakedTypeVariable = 1, + MappedType = 2, + ReturnType = 4, + NoConstraints = 8, + AlwaysStrict = 16, } interface InferenceInfo { typeParameter: TypeParameter; candidates: Type[]; + contraCandidates: Type[]; inferredType: Type; priority: InferencePriority; topLevel: boolean; isFixed: boolean; } enum InferenceFlags { + None = 0, InferUnionTypes = 1, NoDefault = 2, AnyDefault = 4, @@ -2239,6 +2312,7 @@ declare namespace ts { charset?: string; checkJs?: boolean; declaration?: boolean; + emitDeclarationOnly?: boolean; declarationDir?: string; disableSizeLimit?: boolean; downlevelIteration?: boolean; @@ -2299,6 +2373,7 @@ declare namespace ts { types?: string[]; /** Paths used to compute primary types search locations */ typeRoots?: string[]; + esModuleInterop?: boolean; [option: string]: CompilerOptionsValue | JsonSourceFile | undefined; } interface TypeAcquisition { @@ -2308,15 +2383,6 @@ declare namespace ts { exclude?: string[]; [option: string]: string[] | boolean | undefined; } - interface DiscoverTypingsInfo { - fileNames: string[]; - projectRootPath: string; - safeListPath: string; - packageNameToTypingLocation: Map; - typeAcquisition: TypeAcquisition; - compilerOptions: CompilerOptions; - unresolvedImports: ReadonlyArray; - } enum ModuleKind { None = 0, CommonJS = 1, @@ -2472,12 +2538,13 @@ declare namespace ts { getCanonicalFileName(fileName: string): string; useCaseSensitiveFileNames(): boolean; getNewLine(): string; - resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; + resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): (ResolvedModule | undefined)[]; /** * This method is a companion for 'resolveModuleNames' and is used to resolve 'types' references to actual type declaration files */ - resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; + resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): (ResolvedTypeReferenceDirective | undefined)[]; getEnvironmentVariable?(name: string): string; + createHash?(data: string): string; } interface SourceMapRange extends TextRange { source?: SourceMapSource; @@ -2634,6 +2701,10 @@ declare namespace ts { * collisions. */ printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): string; + /** + * Prints a list of nodes using the given format flags + */ + printList(format: ListFormat, list: NodeArray, sourceFile: SourceFile): string; /** * Prints a source file as-is, without any emit transformations. */ @@ -2689,6 +2760,13 @@ declare namespace ts { interface PrinterOptions { removeComments?: boolean; newLine?: NewLineKind; + omitTrailingSemicolon?: boolean; + } + interface SymbolTracker { + trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; + reportInaccessibleThisError?(): void; + reportPrivateInBaseOfClassExpression?(propertyName: string): void; + reportInaccessibleUniqueSymbolError?(): void; } interface TextSpan { start: number; @@ -2698,17 +2776,86 @@ declare namespace ts { span: TextSpan; newLength: number; } + interface SortedArray extends Array { + " __sortedArrayBrand": any; + } interface SyntaxList extends Node { _children: Node[]; } + enum ListFormat { + None = 0, + SingleLine = 0, + MultiLine = 1, + PreserveLines = 2, + LinesMask = 3, + NotDelimited = 0, + BarDelimited = 4, + AmpersandDelimited = 8, + CommaDelimited = 16, + DelimitersMask = 28, + AllowTrailingComma = 32, + Indented = 64, + SpaceBetweenBraces = 128, + SpaceBetweenSiblings = 256, + Braces = 512, + Parenthesis = 1024, + AngleBrackets = 2048, + SquareBrackets = 4096, + BracketsMask = 7680, + OptionalIfUndefined = 8192, + OptionalIfEmpty = 16384, + Optional = 24576, + PreferNewLine = 32768, + NoTrailingNewLine = 65536, + NoInterveningComments = 131072, + NoSpaceIfEmpty = 262144, + SingleElement = 524288, + Modifiers = 131328, + HeritageClauses = 256, + SingleLineTypeLiteralMembers = 448, + MultiLineTypeLiteralMembers = 65, + TupleTypeElements = 336, + UnionTypeConstituents = 260, + IntersectionTypeConstituents = 264, + ObjectBindingPatternElements = 262576, + ArrayBindingPatternElements = 262448, + ObjectLiteralExpressionProperties = 263122, + ArrayLiteralExpressionElements = 4466, + CommaListElements = 272, + CallExpressionArguments = 1296, + NewExpressionArguments = 9488, + TemplateExpressionSpans = 131072, + SingleLineBlockStatements = 384, + MultiLineBlockStatements = 65, + VariableDeclarationList = 272, + SingleLineFunctionBodyStatements = 384, + MultiLineFunctionBodyStatements = 1, + ClassHeritageClauses = 256, + ClassMembers = 65, + InterfaceMembers = 65, + EnumMembers = 81, + CaseBlockClauses = 65, + NamedImportsOrExportsElements = 432, + JsxElementOrFragmentChildren = 131072, + JsxElementAttributes = 131328, + CaseOrDefaultClauseStatements = 81985, + HeritageClauseTypes = 272, + SourceFileStatements = 65537, + Decorators = 24577, + TypeArguments = 26896, + TypeParameters = 26896, + Parameters = 1296, + IndexSignatureParameters = 4432, + } } declare namespace ts { - const versionMajorMinor = "2.7"; + const versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ const version: string; } declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; + function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): Diagnostic[]; } declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; declare function clearTimeout(handle: any): void; @@ -2725,26 +2872,14 @@ declare namespace ts { callback: FileWatcherCallback; mtime?: Date; } - /** - * Partial interface of the System thats needed to support the caching of directory structure - */ - interface DirectoryStructureHost { + interface System { + args: string[]; newLine: string; useCaseSensitiveFileNames: boolean; write(s: string): void; readFile(path: string, encoding?: string): string | undefined; - writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; - fileExists(path: string): boolean; - directoryExists(path: string): boolean; - createDirectory(path: string): void; - getCurrentDirectory(): string; - getDirectories(path: string): string[]; - readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; - exit(exitCode?: number): void; - } - interface System extends DirectoryStructureHost { - args: string[]; getFileSize?(path: string): number; + writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; /** * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that * use native OS file watching @@ -2752,7 +2887,13 @@ declare namespace ts { watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; resolvePath(path: string): string; + fileExists(path: string): boolean; + directoryExists(path: string): boolean; + createDirectory(path: string): void; getExecutingFilePath(): string; + getCurrentDirectory(): string; + getDirectories(path: string): string[]; + readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; getModifiedTime?(path: string): Date; /** * This should be cryptographically secure. @@ -2760,9 +2901,11 @@ declare namespace ts { */ createHash?(data: string): string; getMemoryUsage?(): number; + exit(exitCode?: number): void; realpath?(path: string): string; setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; clearTimeout?(timeoutId: any): void; + clearScreen?(): void; } interface FileWatcher { close(): void; @@ -2791,7 +2934,7 @@ declare namespace ts { scanJsxAttributeValue(): SyntaxKind; reScanJsxToken(): SyntaxKind; scanJsxToken(): SyntaxKind; - scanJSDocToken(): SyntaxKind; + scanJSDocToken(): JsDocSyntaxKind; scan(): SyntaxKind; getText(): string; setText(text: string, start?: number, length?: number): void; @@ -2811,8 +2954,10 @@ declare namespace ts { function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; - function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state?: T): U | undefined; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; + function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; + function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; function reduceEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function reduceEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U) => U, state: T, initial: U): U; function getLeadingCommentRanges(text: string, pos: number): CommentRange[] | undefined; @@ -2968,7 +3113,7 @@ declare namespace ts { function isStringLiteral(node: Node): node is StringLiteral; function isJsxText(node: Node): node is JsxText; function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral; - function isNoSubstitutionTemplateLiteral(node: Node): node is LiteralExpression; + function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral; function isTemplateHead(node: Node): node is TemplateHead; function isTemplateMiddle(node: Node): node is TemplateMiddle; function isTemplateTail(node: Node): node is TemplateTail; @@ -2998,6 +3143,8 @@ declare namespace ts { function isTupleTypeNode(node: Node): node is TupleTypeNode; function isUnionTypeNode(node: Node): node is UnionTypeNode; function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode; + function isConditionalTypeNode(node: Node): node is ConditionalTypeNode; + function isInferTypeNode(node: Node): node is InferTypeNode; function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode; function isThisTypeNode(node: Node): node is ThisTypeNode; function isTypeOperatorNode(node: Node): node is TypeOperatorNode; @@ -3126,6 +3273,7 @@ declare namespace ts { /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n: Node): boolean; function isLiteralExpression(node: Node): node is LiteralExpression; @@ -3160,6 +3308,8 @@ declare namespace ts { function isJSDocCommentContainingNode(node: Node): boolean; function isSetAccessor(node: Node): node is SetAccessorDeclaration; function isGetAccessor(node: Node): node is GetAccessorDeclaration; + function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; + function isStringLiteralLike(node: Node): node is StringLiteralLike; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -3235,13 +3385,13 @@ declare namespace ts { declare namespace ts { function createNodeArray(elements?: ReadonlyArray, hasTrailingComma?: boolean): NodeArray; /** If a node is passed, creates a string literal whose source text is read from a source node during emit. */ - function createLiteral(value: string | StringLiteral | NumericLiteral | Identifier): StringLiteral; + function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; function createLiteral(value: number): NumericLiteral; function createLiteral(value: boolean): BooleanLiteral; function createLiteral(value: string | number | boolean): PrimaryExpression; function createNumericLiteral(value: string): NumericLiteral; function createIdentifier(text: string): Identifier; - function updateIdentifier(node: Identifier, typeArguments: NodeArray | undefined): Identifier; + function updateIdentifier(node: Identifier): Identifier; /** Create a unique temporary variable. */ function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; /** Create a unique temporary variable for use in a loop. */ @@ -3268,8 +3418,8 @@ declare namespace ts { function updateDecorator(node: Decorator, expression: Expression): Decorator; function createPropertySignature(modifiers: ReadonlyArray | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; function updatePropertySignature(node: PropertySignature, modifiers: ReadonlyArray | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; - function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; function createMethodSignature(typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function createMethod(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; @@ -3308,6 +3458,10 @@ declare namespace ts { function createIntersectionTypeNode(types: TypeNode[]): IntersectionTypeNode; function updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray): IntersectionTypeNode; function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray): UnionOrIntersectionTypeNode; + function createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; + function updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; function createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; @@ -3316,8 +3470,8 @@ declare namespace ts { function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; @@ -3710,18 +3864,7 @@ declare namespace ts { function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; } declare namespace ts { - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } -} -declare namespace ts { - function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string; + function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined; function resolveTripleslashReference(moduleName: string, containingFile: string): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; @@ -3749,6 +3892,258 @@ declare namespace ts { */ function createProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program): Program; } +declare namespace ts { + interface EmitOutput { + outputFiles: OutputFile[]; + emitSkipped: boolean; + } + interface OutputFile { + name: string; + writeByteOrderMark: boolean; + text: string; + } +} +declare namespace ts { + type AffectedFileResult = { + result: T; + affected: SourceFile | Program; + } | undefined; + interface BuilderProgramHost { + /** + * return true if file names are treated with case sensitivity + */ + useCaseSensitiveFileNames(): boolean; + /** + * If provided this would be used this hash instead of actual file shape text for detecting changes + */ + createHash?: (data: string) => string; + /** + * When emit or emitNextAffectedFile are called without writeFile, + * this callback if present would be used to write files + */ + writeFile?: WriteFileCallback; + } + /** + * Builder to manage the program state changes + */ + interface BuilderProgram { + /** + * Returns current program + */ + getProgram(): Program; + /** + * Get compiler options of the program + */ + getCompilerOptions(): CompilerOptions; + /** + * Get the source file in the program with file name + */ + getSourceFile(fileName: string): SourceFile | undefined; + /** + * Get a list of files in the program + */ + getSourceFiles(): ReadonlyArray; + /** + * Get the diagnostics for compiler options + */ + getOptionsDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Get the diagnostics that dont belong to any file + */ + getGlobalDiagnostics(cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Get the syntax diagnostics, for all source files if source file is not supplied + */ + getSyntacticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Get all the dependencies of the file + */ + getAllDependencies(sourceFile: SourceFile): ReadonlyArray; + /** + * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program + * The semantic diagnostics are cached and managed here + * Note that it is assumed that when asked about semantic diagnostics through this API, + * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics + * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, + * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics + */ + getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; + /** + * Emits the JavaScript and declaration files. + * When targetSource file is specified, emits the files corresponding to that source file, + * otherwise for the whole program. + * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, + * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, + * it will only emit all the affected files instead of whole program + * + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; + /** + * Get the current directory of the program + */ + getCurrentDirectory(): string; + } + /** + * The builder that caches the semantic diagnostics for the program and handles the changed files and affected files + */ + interface SemanticDiagnosticsBuilderProgram extends BuilderProgram { + /** + * Gets the semantic diagnostics from the program for the next affected file and caches it + * Returns undefined if the iteration is complete + */ + getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult>; + } + /** + * The builder that can handle the changes in program and iterate through changed file to emit the files + * The semantic diagnostics are cached per file and managed by clearing for the changed/affected files + */ + interface EmitAndSemanticDiagnosticsBuilderProgram extends BuilderProgram { + /** + * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): AffectedFileResult; + } + /** + * Create the builder to manage semantic diagnostics and cache them + */ + function createSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram): SemanticDiagnosticsBuilderProgram; + function createSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram): SemanticDiagnosticsBuilderProgram; + /** + * Create the builder that can handle the changes in program and iterate through changed files + * to emit the those files and manage semantic diagnostics cache as well + */ + function createEmitAndSemanticDiagnosticsBuilderProgram(newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram): EmitAndSemanticDiagnosticsBuilderProgram; + function createEmitAndSemanticDiagnosticsBuilderProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram): EmitAndSemanticDiagnosticsBuilderProgram; + /** + * Creates a builder thats just abstraction over program and can be used with watch + */ + function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram): BuilderProgram; + function createAbstractBuilder(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: BuilderProgram): BuilderProgram; +} +declare namespace ts { + type DiagnosticReporter = (diagnostic: Diagnostic) => void; + type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions) => void; + type CreateProgram = (rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: T) => T; + interface WatchCompilerHost { + /** + * Used to create the program when need for program creation or recreation detected + */ + createProgram: CreateProgram; + /** If provided, callback to invoke after every new program creation */ + afterProgramCreate?(program: T): void; + /** If provided, called with Diagnostic message that informs about change in watch status */ + onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions): void; + useCaseSensitiveFileNames(): boolean; + getNewLine(): string; + getCurrentDirectory(): string; + getDefaultLibFileName(options: CompilerOptions): string; + getDefaultLibLocation?(): string; + createHash?(data: string): string; + /** + * Use to check file presence for source files and + * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well + */ + fileExists(path: string): boolean; + /** + * Use to read file text for source files and + * if resolveModuleNames is not provided (complier is in charge of module resolution) then module files as well + */ + readFile(path: string, encoding?: string): string | undefined; + /** If provided, used for module resolution as well as to handle directory structure */ + directoryExists?(path: string): boolean; + /** If provided, used in resolutions as well as handling directory structure */ + getDirectories?(path: string): string[]; + /** If provided, used to cache and handle directory structure modifications */ + readDirectory?(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; + /** Symbol links resolution */ + realpath?(path: string): string; + /** If provided would be used to write log about compilation */ + trace?(s: string): void; + /** If provided is used to get the environment variable */ + getEnvironmentVariable?(name: string): string; + /** If provided, used to resolve the module names, otherwise typescript's default module resolution */ + resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; + /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */ + resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): (ResolvedTypeReferenceDirective | undefined)[]; + /** Used to watch changes in source files, missing files needed to update the program or config file */ + watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; + /** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */ + watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; + /** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */ + setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; + /** If provided, will be used to reset existing delayed compilation */ + clearTimeout?(timeoutId: any): void; + } + /** + * Host to create watch with root files and options + */ + interface WatchCompilerHostOfFilesAndCompilerOptions extends WatchCompilerHost { + /** root files to use to generate program */ + rootFiles: string[]; + /** Compiler options */ + options: CompilerOptions; + } + /** + * Reports config file diagnostics + */ + interface ConfigFileDiagnosticsReporter { + /** + * Reports the diagnostics in reading/writing or parsing of the config file + */ + onConfigFileDiagnostic: DiagnosticReporter; + /** + * Reports unrecoverable error when parsing config file + */ + onUnRecoverableConfigFileDiagnostic: DiagnosticReporter; + } + /** + * Host to create watch with config file + */ + interface WatchCompilerHostOfConfigFile extends WatchCompilerHost, ConfigFileDiagnosticsReporter { + /** Name of the config file to compile */ + configFileName: string; + /** Options to extend */ + optionsToExtend?: CompilerOptions; + /** + * Used to generate source file names from the config file and its include, exclude, files rules + * and also to cache the directory stucture + */ + readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; + } + interface Watch { + /** Synchronize with host and get updated program */ + getProgram(): T; + } + /** + * Creates the watch what generates program using the config file + */ + interface WatchOfConfigFile extends Watch { + } + /** + * Creates the watch that generates program using the root files and compiler options + */ + interface WatchOfFilesAndCompilerOptions extends Watch { + /** Updates the root files in the program, only if this is not config file compilation */ + updateRootFileNames(fileNames: string[]): void; + } + /** + * Create the watch compiler host for either configFile or fileNames and its options + */ + function createWatchCompilerHost(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): WatchCompilerHostOfFilesAndCompilerOptions; + function createWatchCompilerHost(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): WatchCompilerHostOfConfigFile; + /** + * Creates the watch from the host for root files and compiler options + */ + function createWatchProgram(host: WatchCompilerHostOfFilesAndCompilerOptions): WatchOfFilesAndCompilerOptions; + /** + * Creates the watch from the host for config file + */ + function createWatchProgram(host: WatchCompilerHostOfConfigFile): WatchOfConfigFile; +} declare namespace ts { function parseCommandLine(commandLine: ReadonlyArray, readFile?: (path: string) => string | undefined): ParsedCommandLine; /** @@ -3924,6 +4319,7 @@ declare namespace ts { useCaseSensitiveFileNames?(): boolean; readDirectory?(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; readFile?(path: string, encoding?: string): string | undefined; + realpath?(path: string): string; fileExists?(path: string): boolean; getTypeRootsVersion?(): number; resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; @@ -3982,7 +4378,8 @@ declare namespace ts { getDocCommentTemplateAtPosition(fileName: string, position: number): TextInsertion; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan; - getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[]; + getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray, formatOptions: FormatCodeSettings): ReadonlyArray; + getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings): CombinedCodeActions; applyCodeActionCommand(action: CodeActionCommand): Promise; applyCodeActionCommand(action: CodeActionCommand[]): Promise; applyCodeActionCommand(action: CodeActionCommand | CodeActionCommand[]): Promise; @@ -3994,12 +4391,19 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; + organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; } + interface CombinedCodeFixScope { + type: "file"; + fileName: string; + } + type OrganizeImportsScope = CombinedCodeFixScope; interface GetCompletionsAtPositionOptions { includeExternalModuleExports: boolean; + includeInsertTextCompletions: boolean; } interface ApplyCodeActionCommandResult { successMessage: string; @@ -4074,6 +4478,17 @@ declare namespace ts { */ commands?: CodeActionCommand[]; } + interface CodeFixAction extends CodeAction { + /** + * If present, one may call 'getCombinedCodeFix' with this fixId. + * This may be omitted to indicate that the code fix can't be applied in a group. + */ + fixId?: {}; + } + interface CombinedCodeActions { + changes: ReadonlyArray; + commands: ReadonlyArray | undefined; + } type CodeActionCommand = InstallPackageAction; interface InstallPackageAction { } @@ -4210,6 +4625,7 @@ declare namespace ts { InsertSpaceBeforeFunctionParenthesis?: boolean; PlaceOpenBraceOnNewLineForFunctions: boolean; PlaceOpenBraceOnNewLineForControlBlocks: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface FormatCodeSettings extends EditorSettings { insertSpaceAfterCommaDelimiter?: boolean; @@ -4227,6 +4643,7 @@ declare namespace ts { insertSpaceBeforeFunctionParenthesis?: boolean; placeOpenBraceOnNewLineForFunctions?: boolean; placeOpenBraceOnNewLineForControlBlocks?: boolean; + insertSpaceBeforeTypeAnnotation?: boolean; } interface DefinitionInfo { fileName: string; @@ -4329,6 +4746,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** @@ -4342,6 +4760,7 @@ declare namespace ts { kind: ScriptElementKind; kindModifiers: string; sortText: string; + insertText?: string; /** * An optional span that indicates the text to be replaced by this completion item. * If present, this span should be used instead of the default one. @@ -4508,6 +4927,7 @@ declare namespace ts { ambientModifier = "declare", staticModifier = "static", abstractModifier = "abstract", + optionalModifier = "optional", } enum ClassificationTypeNames { comment = "comment", @@ -4653,9 +5073,6 @@ declare namespace ts { declare namespace ts { /** The version of the language service API */ const servicesVersion = "0.7"; - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings; function displayPartsToString(displayParts: SymbolDisplayPart[]): string; function getDefaultCompilerOptions(): CompilerOptions; diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 1fbae487f80..71de0f4e0b6 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -182,198 +182,201 @@ var ts; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 140] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 141] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 142] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 143] = "OfKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 126] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 127] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 128] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 129] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 130] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 131] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 132] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 133] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 134] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 135] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 136] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 137] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 138] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 142] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 143] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 144] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 144] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 145] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 145] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 146] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 146] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 147] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 148] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 147] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 148] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 149] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 149] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 150] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 151] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 152] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 153] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 154] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 155] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 156] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 157] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 158] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 150] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 151] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 152] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 153] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 154] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 155] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 156] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 157] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 158] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 159] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 159] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 160] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 161] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 162] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 163] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 164] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 165] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 166] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 167] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 168] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 169] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 170] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 171] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 172] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 173] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 174] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 160] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 161] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 162] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 163] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 164] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 165] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 166] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 167] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 168] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 169] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 170] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 171] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 172] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 173] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 174] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 175] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 176] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 177] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 175] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 176] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 177] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 178] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 179] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 180] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 180] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 181] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 182] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 183] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 184] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 185] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 186] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 187] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 188] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 189] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 190] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 191] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 192] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 193] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 194] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 195] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 196] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 197] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 198] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 199] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 200] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 201] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 202] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 203] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 204] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 205] = "MetaProperty"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 181] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 182] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 183] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 184] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 185] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 186] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 187] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 188] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 189] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 190] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 191] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 192] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 193] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 194] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 195] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 196] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 197] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 198] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 199] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 200] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 201] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 202] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 203] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 204] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 205] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 206] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 207] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 208] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 206] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 207] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 209] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 210] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 208] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 209] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 210] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 211] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 212] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 213] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 214] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 215] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 216] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 217] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 218] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 219] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 220] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 221] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 222] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 223] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 224] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 225] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 226] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 227] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 228] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 229] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 230] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 231] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 232] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 233] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 234] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 235] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 236] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 237] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 238] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 239] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 240] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 241] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 242] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 243] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 244] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 245] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 246] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 247] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 248] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 211] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 212] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 213] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 214] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 215] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 216] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 217] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 218] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 219] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 220] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 221] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 222] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 223] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 224] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 225] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 226] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 227] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 228] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 229] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 230] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 231] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 232] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 233] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 234] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 235] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 236] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 237] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 238] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 239] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 240] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 241] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 242] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 243] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 244] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 245] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 246] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 247] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 248] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 249] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 250] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 251] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 249] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 252] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 250] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 251] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 252] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 253] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 254] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 255] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 256] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 257] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 258] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 259] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 260] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 253] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 254] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 255] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 256] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 257] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 258] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 259] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 260] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 261] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 262] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 263] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 261] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 262] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 263] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 264] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 264] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 265] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 266] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 267] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 265] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 266] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 267] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 268] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 269] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 270] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 268] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 271] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 269] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 270] = "Bundle"; + SyntaxKind[SyntaxKind["SourceFile"] = 272] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 273] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 271] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 274] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 272] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 275] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 273] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 274] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 275] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 276] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 277] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 278] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 279] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 280] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocTag"] = 281] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 282] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 283] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 284] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 285] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 286] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 287] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 288] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 289] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 276] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 277] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 278] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 279] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 280] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 281] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 283] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocTag"] = 284] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 285] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 286] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 287] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 288] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 289] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 290] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 291] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 292] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 290] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 291] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 292] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 293] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 294] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 295] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 296] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 297] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 298] = "EndOfDeclarationMarker"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 296] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 299] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; @@ -382,15 +385,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 143] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 144] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 159] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 174] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 160] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 177] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 143] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 144] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -399,13 +402,13 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 144] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 271] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 289] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 281] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 289] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 145] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 274] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 284] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 143] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 144] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -489,14 +492,19 @@ var ts; RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; })(RelationComparisonResult = ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); /*@internal*/ - var GeneratedIdentifierKind; - (function (GeneratedIdentifierKind) { - GeneratedIdentifierKind[GeneratedIdentifierKind["None"] = 0] = "None"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Auto"] = 1] = "Auto"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Loop"] = 2] = "Loop"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Unique"] = 3] = "Unique"; - GeneratedIdentifierKind[GeneratedIdentifierKind["Node"] = 4] = "Node"; - })(GeneratedIdentifierKind = ts.GeneratedIdentifierKind || (ts.GeneratedIdentifierKind = {})); + var GeneratedIdentifierFlags; + (function (GeneratedIdentifierFlags) { + // Kinds + GeneratedIdentifierFlags[GeneratedIdentifierFlags["None"] = 0] = "None"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Auto"] = 1] = "Auto"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Loop"] = 2] = "Loop"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Unique"] = 3] = "Unique"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["Node"] = 4] = "Node"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["KindMask"] = 7] = "KindMask"; + // Flags + GeneratedIdentifierFlags[GeneratedIdentifierFlags["SkipNameGenerationScope"] = 8] = "SkipNameGenerationScope"; + GeneratedIdentifierFlags[GeneratedIdentifierFlags["ReservedInNestedScopes"] = 16] = "ReservedInNestedScopes"; + })(GeneratedIdentifierFlags = ts.GeneratedIdentifierFlags || (ts.GeneratedIdentifierFlags = {})); /* @internal */ var TokenFlags; (function (TokenFlags) { @@ -510,8 +518,9 @@ var ts; TokenFlags[TokenFlags["HexSpecifier"] = 64] = "HexSpecifier"; TokenFlags[TokenFlags["BinarySpecifier"] = 128] = "BinarySpecifier"; TokenFlags[TokenFlags["OctalSpecifier"] = 256] = "OctalSpecifier"; + TokenFlags[TokenFlags["ContainsSeparator"] = 512] = "ContainsSeparator"; TokenFlags[TokenFlags["BinaryOrOctalSpecifier"] = 384] = "BinaryOrOctalSpecifier"; - TokenFlags[TokenFlags["NumericLiteralFlags"] = 496] = "NumericLiteralFlags"; + TokenFlags[TokenFlags["NumericLiteralFlags"] = 1008] = "NumericLiteralFlags"; })(TokenFlags = ts.TokenFlags || (ts.TokenFlags = {})); var FlowFlags; (function (FlowFlags) { @@ -556,47 +565,79 @@ var ts; // Diagnostics were produced and outputs were generated in spite of them. ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); + /* @internal */ + var UnionReduction; + (function (UnionReduction) { + UnionReduction[UnionReduction["None"] = 0] = "None"; + UnionReduction[UnionReduction["Literal"] = 1] = "Literal"; + UnionReduction[UnionReduction["Subtype"] = 2] = "Subtype"; + })(UnionReduction = ts.UnionReduction || (ts.UnionReduction = {})); var NodeBuilderFlags; (function (NodeBuilderFlags) { NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; // Options NodeBuilderFlags[NodeBuilderFlags["NoTruncation"] = 1] = "NoTruncation"; NodeBuilderFlags[NodeBuilderFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + // empty space + NodeBuilderFlags[NodeBuilderFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + // empty space NodeBuilderFlags[NodeBuilderFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; NodeBuilderFlags[NodeBuilderFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + NodeBuilderFlags[NodeBuilderFlags["UseOnlyExternalAliasing"] = 128] = "UseOnlyExternalAliasing"; NodeBuilderFlags[NodeBuilderFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; NodeBuilderFlags[NodeBuilderFlags["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; + NodeBuilderFlags[NodeBuilderFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + NodeBuilderFlags[NodeBuilderFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + NodeBuilderFlags[NodeBuilderFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + NodeBuilderFlags[NodeBuilderFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; // Error handling - NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 1024] = "AllowThisInObjectLiteral"; - NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 2048] = "AllowQualifedNameInPlaceOfIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 8192] = "AllowAnonymousIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 16384] = "AllowEmptyUnionOrIntersection"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 32768] = "AllowEmptyTuple"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 60416] = "IgnoreErrors"; + NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 32768] = "AllowThisInObjectLiteral"; + NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 65536] = "AllowQualifedNameInPlaceOfIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 131072] = "AllowAnonymousIdentifier"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 262144] = "AllowEmptyUnionOrIntersection"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 524288] = "AllowEmptyTuple"; + NodeBuilderFlags[NodeBuilderFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + NodeBuilderFlags[NodeBuilderFlags["AllowEmptyIndexInfoType"] = 2097152] = "AllowEmptyIndexInfoType"; + NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 3112960] = "IgnoreErrors"; // State - NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; + NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); + // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; (function (TypeFormatFlags) { TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 8] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 16] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 32] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 64] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 128] = "InElementType"; - TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 256] = "UseFullyQualifiedType"; - TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 512] = "InFirstTypeArgument"; - TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 1024] = "InTypeAlias"; - TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 4096] = "SuppressAnyReturnType"; - TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 8192] = "AddUndefined"; - TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 16384] = "WriteClassExpressionAsTypeLiteral"; - TypeFormatFlags[TypeFormatFlags["InArrayType"] = 32768] = "InArrayType"; - TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 65536] = "UseAliasDefinedOutsideCurrentScope"; + TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 1] = "NoTruncation"; + TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; + // hole because there's a hole in node builder flags + TypeFormatFlags[TypeFormatFlags["UseStructuralFallback"] = 8] = "UseStructuralFallback"; + // hole because there's a hole in node builder flags + TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; + TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; + // hole because `UseOnlyExternalAliasing` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` instead + TypeFormatFlags[TypeFormatFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; + // hole because `WriteTypeParametersInQualifiedName` is here in node builder flags, but functions which take old flags use `SymbolFormatFlags` for this instead + TypeFormatFlags[TypeFormatFlags["MultilineObjectLiterals"] = 1024] = "MultilineObjectLiterals"; + TypeFormatFlags[TypeFormatFlags["WriteClassExpressionAsTypeLiteral"] = 2048] = "WriteClassExpressionAsTypeLiteral"; + TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 4096] = "UseTypeOfFunction"; + TypeFormatFlags[TypeFormatFlags["OmitParameterModifiers"] = 8192] = "OmitParameterModifiers"; + TypeFormatFlags[TypeFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 16384] = "UseAliasDefinedOutsideCurrentScope"; // even though `T` can't be accessed in the current scope. - TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 131072] = "AllowUniqueESSymbolType"; + // Error Handling + TypeFormatFlags[TypeFormatFlags["AllowUniqueESSymbolType"] = 1048576] = "AllowUniqueESSymbolType"; + // TypeFormatFlags exclusive + TypeFormatFlags[TypeFormatFlags["AddUndefined"] = 131072] = "AddUndefined"; + TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 262144] = "WriteArrowStyleSignature"; + // State + TypeFormatFlags[TypeFormatFlags["InArrayType"] = 524288] = "InArrayType"; + TypeFormatFlags[TypeFormatFlags["InElementType"] = 2097152] = "InElementType"; + TypeFormatFlags[TypeFormatFlags["InFirstTypeArgument"] = 4194304] = "InFirstTypeArgument"; + TypeFormatFlags[TypeFormatFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; + /** @deprecated */ TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0] = "WriteOwnNameForAnyLike"; + TypeFormatFlags[TypeFormatFlags["NodeBuilderFlagsMask"] = 9469291] = "NodeBuilderFlagsMask"; })(TypeFormatFlags = ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); var SymbolFormatFlags; (function (SymbolFormatFlags) { @@ -604,12 +645,16 @@ var ts; // Write symbols's type argument if it is instantiated symbol // eg. class C { p: T } <-- Show p as C.p here // var a: C; - // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p + // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; // Use only external alias information to get the symbol name in the given context // eg. module m { export class c { } } import x = m.c; // When this flag is specified m.c will be used to refer to the class instead of alias symbol x SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; + // Build symbol name using any nodes needed, instead of just components of an entity name + SymbolFormatFlags[SymbolFormatFlags["AllowAnyNodeKind"] = 4] = "AllowAnyNodeKind"; + // Prefer aliases which are not directly visible + SymbolFormatFlags[SymbolFormatFlags["UseAliasDefinedOutsideCurrentScope"] = 8] = "UseAliasDefinedOutsideCurrentScope"; })(SymbolFormatFlags = ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); /* @internal */ var SymbolAccessibility; @@ -745,6 +790,7 @@ var ts; CheckFlags[CheckFlags["ContainsPrivate"] = 256] = "ContainsPrivate"; CheckFlags[CheckFlags["ContainsStatic"] = 512] = "ContainsStatic"; CheckFlags[CheckFlags["Late"] = 1024] = "Late"; + CheckFlags[CheckFlags["ReverseMapped"] = 2048] = "ReverseMapped"; CheckFlags[CheckFlags["Synthetic"] = 6] = "Synthetic"; })(CheckFlags = ts.CheckFlags || (ts.CheckFlags = {})); var InternalSymbolName; @@ -814,18 +860,19 @@ var ts; TypeFlags[TypeFlags["Intersection"] = 262144] = "Intersection"; TypeFlags[TypeFlags["Index"] = 524288] = "Index"; TypeFlags[TypeFlags["IndexedAccess"] = 1048576] = "IndexedAccess"; + TypeFlags[TypeFlags["Conditional"] = 2097152] = "Conditional"; + TypeFlags[TypeFlags["Substitution"] = 4194304] = "Substitution"; /* @internal */ - TypeFlags[TypeFlags["FreshLiteral"] = 2097152] = "FreshLiteral"; + TypeFlags[TypeFlags["FreshLiteral"] = 8388608] = "FreshLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsWideningType"] = 4194304] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsWideningType"] = 16777216] = "ContainsWideningType"; /* @internal */ - TypeFlags[TypeFlags["ContainsObjectLiteral"] = 8388608] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 33554432] = "ContainsObjectLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 16777216] = "ContainsAnyFunctionType"; - TypeFlags[TypeFlags["NonPrimitive"] = 33554432] = "NonPrimitive"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 67108864] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 134217728] = "NonPrimitive"; /* @internal */ - TypeFlags[TypeFlags["JsxAttributes"] = 67108864] = "JsxAttributes"; - TypeFlags[TypeFlags["MarkerType"] = 134217728] = "MarkerType"; + TypeFlags[TypeFlags["GenericMappedType"] = 536870912] = "GenericMappedType"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 12288] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; @@ -837,7 +884,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 14560] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 14574] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 33585807] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 134249103] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 16382] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 524322] = "StringLike"; @@ -847,16 +894,20 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 1536] = "ESSymbolLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 393216] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 458752] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 2064384] = "StructuredOrTypeVariable"; TypeFlags[TypeFlags["TypeVariable"] = 1081344] = "TypeVariable"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 7372800] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 524288] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 7897088] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 8355840] = "StructuredOrInstantiable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 35620607] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33620481] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 142575359] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 134283777] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 12582912] = "RequiresWidening"; + TypeFlags[TypeFlags["RequiresWidening"] = 50331648] = "RequiresWidening"; + /* @internal */ + TypeFlags[TypeFlags["PropagatingFlags"] = 117440512] = "PropagatingFlags"; /* @internal */ - TypeFlags[TypeFlags["PropagatingFlags"] = 29360128] = "PropagatingFlags"; })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); var ObjectFlags; (function (ObjectFlags) { @@ -871,6 +922,9 @@ var ts; ObjectFlags[ObjectFlags["EvolvingArray"] = 256] = "EvolvingArray"; ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; ObjectFlags[ObjectFlags["ContainsSpread"] = 1024] = "ContainsSpread"; + ObjectFlags[ObjectFlags["ReverseMapped"] = 2048] = "ReverseMapped"; + ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes"; + ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ @@ -894,14 +948,15 @@ var ts; })(IndexKind = ts.IndexKind || (ts.IndexKind = {})); var InferencePriority; (function (InferencePriority) { - InferencePriority[InferencePriority["Contravariant"] = 1] = "Contravariant"; - InferencePriority[InferencePriority["NakedTypeVariable"] = 2] = "NakedTypeVariable"; - InferencePriority[InferencePriority["MappedType"] = 4] = "MappedType"; - InferencePriority[InferencePriority["ReturnType"] = 8] = "ReturnType"; - InferencePriority[InferencePriority["NeverType"] = 16] = "NeverType"; + InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; + InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; + InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + InferencePriority[InferencePriority["NoConstraints"] = 8] = "NoConstraints"; + InferencePriority[InferencePriority["AlwaysStrict"] = 16] = "AlwaysStrict"; })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); var InferenceFlags; (function (InferenceFlags) { + InferenceFlags[InferenceFlags["None"] = 0] = "None"; InferenceFlags[InferenceFlags["InferUnionTypes"] = 1] = "InferUnionTypes"; InferenceFlags[InferenceFlags["NoDefault"] = 2] = "NoDefault"; InferenceFlags[InferenceFlags["AnyDefault"] = 4] = "AnyDefault"; @@ -1181,6 +1236,8 @@ var ts; TransformFlags[TransformFlags["ContainsYield"] = 16777216] = "ContainsYield"; TransformFlags[TransformFlags["ContainsHoistedDeclarationOrCompletion"] = 33554432] = "ContainsHoistedDeclarationOrCompletion"; TransformFlags[TransformFlags["ContainsDynamicImport"] = 67108864] = "ContainsDynamicImport"; + TransformFlags[TransformFlags["Super"] = 134217728] = "Super"; + TransformFlags[TransformFlags["ContainsSuper"] = 268435456] = "ContainsSuper"; // Please leave this as 1 << 29. // It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system. // It is a good reminder of how much room we have left @@ -1198,20 +1255,22 @@ var ts; // Scope Exclusions // - Bitmasks that exclude flags from propagating out of a specific context // into the subtree flags of their container. - TransformFlags[TransformFlags["NodeExcludes"] = 536872257] = "NodeExcludes"; - TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 601249089] = "ArrowFunctionExcludes"; - TransformFlags[TransformFlags["FunctionExcludes"] = 601281857] = "FunctionExcludes"; - TransformFlags[TransformFlags["ConstructorExcludes"] = 601015617] = "ConstructorExcludes"; - TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 601015617] = "MethodOrAccessorExcludes"; - TransformFlags[TransformFlags["ClassExcludes"] = 539358529] = "ClassExcludes"; - TransformFlags[TransformFlags["ModuleExcludes"] = 574674241] = "ModuleExcludes"; + TransformFlags[TransformFlags["OuterExpressionExcludes"] = 536872257] = "OuterExpressionExcludes"; + TransformFlags[TransformFlags["PropertyAccessExcludes"] = 671089985] = "PropertyAccessExcludes"; + TransformFlags[TransformFlags["NodeExcludes"] = 939525441] = "NodeExcludes"; + TransformFlags[TransformFlags["ArrowFunctionExcludes"] = 1003902273] = "ArrowFunctionExcludes"; + TransformFlags[TransformFlags["FunctionExcludes"] = 1003935041] = "FunctionExcludes"; + TransformFlags[TransformFlags["ConstructorExcludes"] = 1003668801] = "ConstructorExcludes"; + TransformFlags[TransformFlags["MethodOrAccessorExcludes"] = 1003668801] = "MethodOrAccessorExcludes"; + TransformFlags[TransformFlags["ClassExcludes"] = 942011713] = "ClassExcludes"; + TransformFlags[TransformFlags["ModuleExcludes"] = 977327425] = "ModuleExcludes"; TransformFlags[TransformFlags["TypeExcludes"] = -3] = "TypeExcludes"; - TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 540087617] = "ObjectLiteralExcludes"; - TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 537396545] = "ArrayLiteralOrCallOrNewExcludes"; - TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 546309441] = "VariableDeclarationListExcludes"; - TransformFlags[TransformFlags["ParameterExcludes"] = 536872257] = "ParameterExcludes"; - TransformFlags[TransformFlags["CatchClauseExcludes"] = 537920833] = "CatchClauseExcludes"; - TransformFlags[TransformFlags["BindingPatternExcludes"] = 537396545] = "BindingPatternExcludes"; + TransformFlags[TransformFlags["ObjectLiteralExcludes"] = 942740801] = "ObjectLiteralExcludes"; + TransformFlags[TransformFlags["ArrayLiteralOrCallOrNewExcludes"] = 940049729] = "ArrayLiteralOrCallOrNewExcludes"; + TransformFlags[TransformFlags["VariableDeclarationListExcludes"] = 948962625] = "VariableDeclarationListExcludes"; + TransformFlags[TransformFlags["ParameterExcludes"] = 939525441] = "ParameterExcludes"; + TransformFlags[TransformFlags["CatchClauseExcludes"] = 940574017] = "CatchClauseExcludes"; + TransformFlags[TransformFlags["BindingPatternExcludes"] = 940049729] = "BindingPatternExcludes"; // Masks // - Additional bitmasks TransformFlags[TransformFlags["TypeScriptClassSyntaxMask"] = 274432] = "TypeScriptClassSyntaxMask"; @@ -1248,6 +1307,7 @@ var ts; EmitFlags[EmitFlags["Iterator"] = 8388608] = "Iterator"; EmitFlags[EmitFlags["NoAsciiEscaping"] = 16777216] = "NoAsciiEscaping"; /*@internal*/ EmitFlags[EmitFlags["TypeScriptClassWrapper"] = 33554432] = "TypeScriptClassWrapper"; + /*@internal*/ EmitFlags[EmitFlags["NeverApplyImportHelper"] = 67108864] = "NeverApplyImportHelper"; })(EmitFlags = ts.EmitFlags || (ts.EmitFlags = {})); /** * Used by the checker, this enum keeps track of external emit helpers that should be type @@ -1294,6 +1354,78 @@ var ts; EmitHint[EmitHint["MappedTypeParameter"] = 3] = "MappedTypeParameter"; EmitHint[EmitHint["Unspecified"] = 4] = "Unspecified"; })(EmitHint = ts.EmitHint || (ts.EmitHint = {})); + var ListFormat; + (function (ListFormat) { + ListFormat[ListFormat["None"] = 0] = "None"; + // Line separators + ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; + ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; + ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; + ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; + // Delimiters + ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; + ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; + ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; + ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; + ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; + ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; + // Whitespace + ListFormat[ListFormat["Indented"] = 64] = "Indented"; + ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; + ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; + // Brackets/Braces + ListFormat[ListFormat["Braces"] = 512] = "Braces"; + ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; + ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; + ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; + ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; + ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; + ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; + ListFormat[ListFormat["Optional"] = 24576] = "Optional"; + // Other + ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; + ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; + ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; + ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; + ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; + // Precomputed Formats + ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; + ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; + ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; + ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; + ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; + ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; + ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; + ListFormat[ListFormat["ObjectBindingPatternElements"] = 262576] = "ObjectBindingPatternElements"; + ListFormat[ListFormat["ArrayBindingPatternElements"] = 262448] = "ArrayBindingPatternElements"; + ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; + ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; + ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; + ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; + ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; + ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; + ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; + ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; + ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; + ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; + ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; + ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; + ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; + ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; + ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; + ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; + ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; + ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; + ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; + ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; + ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; + ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; + ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; + ListFormat[ListFormat["TypeArguments"] = 26896] = "TypeArguments"; + ListFormat[ListFormat["TypeParameters"] = 26896] = "TypeParameters"; + ListFormat[ListFormat["Parameters"] = 1296] = "Parameters"; + ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; + })(ListFormat = ts.ListFormat || (ts.ListFormat = {})); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1394,9 +1526,9 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "2.7"; + ts.versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".0"; + ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -1406,9 +1538,14 @@ var ts; return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); /* @internal */ (function (ts) { + ts.emptyArray = []; /** Create a MapLike with good performance. */ function createDictionaryObject() { var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword @@ -1552,6 +1689,9 @@ var ts; ts.forEach = forEach; /** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */ function firstDefined(array, callback) { + if (array === undefined) { + return undefined; + } for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result !== undefined) { @@ -1561,6 +1701,19 @@ var ts; return undefined; } ts.firstDefined = firstDefined; + function firstDefinedIterator(iter, callback) { + while (true) { + var _a = iter.next(), value = _a.value, done = _a.done; + if (done) { + return undefined; + } + var result = callback(value); + if (result !== undefined) { + return result; + } + } + } + ts.firstDefinedIterator = firstDefinedIterator; function findAncestor(node, callback) { while (node) { var result = callback(node); @@ -1577,13 +1730,27 @@ var ts; ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { var result = []; - Debug.assert(arrayA.length === arrayB.length); + Debug.assertEqual(arrayA.length, arrayB.length); for (var i = 0; i < arrayA.length; i++) { result.push(callback(arrayA[i], arrayB[i], i)); } return result; } ts.zipWith = zipWith; + function zipToIterator(arrayA, arrayB) { + Debug.assertEqual(arrayA.length, arrayB.length); + var i = 0; + return { + next: function () { + if (i === arrayA.length) { + return { value: undefined, done: true }; + } + i++; + return { value: [arrayA[i - 1], arrayB[i - 1]], done: false }; + } + }; + } + ts.zipToIterator = zipToIterator; function zipToMap(keys, values) { Debug.assert(keys.length === values.length); var map = createMap(); @@ -1666,17 +1833,11 @@ var ts; return false; } ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); } - ts.indexOf = indexOf; + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -1748,31 +1909,30 @@ var ts; } ts.map = map; function mapIterator(iter, mapFn) { - return { next: next }; - function next() { - var iterRes = iter.next(); - return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; - } + return { + next: function () { + var iterRes = iter.next(); + return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + } + }; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; /** @@ -1824,25 +1984,33 @@ var ts; return result; } ts.flatMap = flatMap; - function flatMapIter(iter, mapfn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapfn(value); - if (res) { - if (isArray(res)) { - result.push.apply(result, res); + function flatMapIterator(iter, mapfn) { + var first = iter.next(); + if (first.done) { + return ts.emptyIterator; + } + var currentIter = getIterator(first.value); + return { + next: function () { + while (true) { + var currentRes = currentIter.next(); + if (!currentRes.done) { + return currentRes; + } + var iterRes = iter.next(); + if (iterRes.done) { + return iterRes; + } + currentIter = getIterator(iterRes.value); } - else { - result.push(res); - } - } + }, + }; + function getIterator(x) { + var res = mapfn(x); + return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res; } - return result; } - ts.flatMapIter = flatMapIter; + ts.flatMapIterator = flatMapIterator; function sameFlatMap(array, mapfn) { var result; if (array) { @@ -1865,12 +2033,23 @@ var ts; return result || array; } ts.sameFlatMap = sameFlatMap; + function mapAllOrFail(array, mapFn) { + var result = []; + for (var i = 0; i < array.length; i++) { + var mapped = mapFn(array[i], i); + if (mapped === undefined) { + return undefined; + } + result.push(mapped); + } + return result; + } + ts.mapAllOrFail = mapAllOrFail; function mapDefined(array, mapFn) { var result = []; if (array) { for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); + var mapped = mapFn(array[i], i); if (mapped !== undefined) { result.push(mapped); } @@ -1879,20 +2058,35 @@ var ts; return result; } ts.mapDefined = mapDefined; - function mapDefinedIter(iter, mapFn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapFn(value); - if (res !== undefined) { - result.push(res); + function mapDefinedIterator(iter, mapFn) { + return { + next: function () { + while (true) { + var res = iter.next(); + if (res.done) { + return res; + } + var value = mapFn(res.value); + if (value !== undefined) { + return { value: value, done: false }; + } + } } - } - return result; + }; } - ts.mapDefinedIter = mapDefinedIter; + ts.mapDefinedIterator = mapDefinedIterator; + ts.emptyIterator = { next: function () { return ({ value: undefined, done: true }); } }; + function singleIterator(value) { + var done = false; + return { + next: function () { + var wasDone = done; + done = true; + return wasDone ? { value: undefined, done: true } : { value: value, done: false }; + } + }; + } + ts.singleIterator = singleIterator; /** * Computes the first matching span of elements and returns a tuple of the first span * and the remaining elements. @@ -2055,6 +2249,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -2158,7 +2363,7 @@ var ts; var result = 0; for (var _i = 0, array_5 = array; _i < array_5.length; _i++) { var v = array_5[_i]; - // Note: we need the following type assertion because of GH #17069 + // TODO: Remove the following type assertion once the fix for #17069 is merged result += v[prop]; } return result; @@ -2625,6 +2830,15 @@ var ts; } } } + function group(values, getGroupId) { + var groupIdToGroup = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + groupIdToGroup.add(getGroupId(value), value); + } + return arrayFrom(groupIdToGroup.values()); + } + ts.group = group; /** * Tests whether a value is an array. */ @@ -2650,7 +2864,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; /** Does nothing. */ @@ -2665,6 +2884,9 @@ var ts; /** Returns its argument. */ function identity(x) { return x; } ts.identity = identity; + /** Returns lower case string */ + function toLowerCase(x) { return x.toLowerCase(); } + ts.toLowerCase = toLowerCase; /** Throws an error because a function is not implemented. */ function notImplemented() { throw new Error("Not implemented"); @@ -3026,6 +3248,11 @@ var ts; 0 /* EqualTo */; } ts.compareDiagnostics = compareDiagnostics; + /** True is greater than false. */ + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { // We still have both chains. @@ -3045,10 +3272,6 @@ var ts; // We still have one chain remaining. The shorter chain should come first. return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -3069,7 +3292,7 @@ var ts; return p2 + 1; } if (path.charCodeAt(1) === 58 /* colon */) { - if (path.charCodeAt(2) === 47 /* slash */) + if (path.charCodeAt(2) === 47 /* slash */ || path.charCodeAt(2) === 92 /* backslash */) return 3; } // Per RFC 1738 'file' URI schema has the shape file:/// @@ -3149,11 +3372,6 @@ var ts; return /^\.\.?($|[\\/])/.test(path); } ts.pathIsRelative = pathIsRelative; - /** @deprecated Use `!isExternalModuleNameRelative(moduleName)` instead. */ - function moduleHasNonRelativeName(moduleName) { - return !ts.isExternalModuleNameRelative(moduleName); - } - ts.moduleHasNonRelativeName = moduleHasNonRelativeName; function getEmitScriptTarget(compilerOptions) { return compilerOptions.target || 0 /* ES3 */; } @@ -3176,7 +3394,9 @@ var ts; var moduleKind = getEmitModuleKind(compilerOptions); return compilerOptions.allowSyntheticDefaultImports !== undefined ? compilerOptions.allowSyntheticDefaultImports - : moduleKind === ts.ModuleKind.System; + : compilerOptions.esModuleInterop + ? moduleKind !== ts.ModuleKind.None && moduleKind < ts.ModuleKind.ES2015 + : moduleKind === ts.ModuleKind.System; } ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports; function getStrictOptionValue(compilerOptions, flag) { @@ -3236,7 +3456,7 @@ var ts; ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; function getNormalizedPathComponentsOfUrl(url) { // Get root length of http://www.website.com/folder1/folder2/ - // In this example the root is: http://www.website.com/ + // In this example the root is: http://www.website.com/ // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] var urlLength = url.length; // Initial root length is http:// part @@ -3266,7 +3486,7 @@ var ts; } else { // Can't find the host assume the rest of the string as component - // but make sure we append "/" to it as root is not joined using "/" + // but make sure we append "/" to it as root is not joined using "/" // eg. if url passed in was http://website.com we want to use root as [http://website.com/] // so that other path manipulations will be correct and it can be merged with relative paths correctly return [url + ts.directorySeparator]; @@ -3285,7 +3505,7 @@ var ts; var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name - // that is ["test", "cases", ""] needs to be actually ["test", "cases"] + // that is ["test", "cases", ""] needs to be actually ["test", "cases"] directoryComponents.pop(); } // Find the component that differs @@ -3507,7 +3727,6 @@ var ts; function getSubPatternFromSpec(spec, basePath, usage, _a) { var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; - var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; var components = getNormalizedPathComponents(spec, basePath); var lastComponent = lastOrUndefined(components); @@ -3524,11 +3743,7 @@ var ts; for (var _i = 0, components_1 = components; _i < components_1.length; _i++) { var component = components_1[_i]; if (component === "**") { - if (hasRecursiveDirectoryWildcard) { - return undefined; - } subpattern += doubleAsteriskRegexFragment; - hasRecursiveDirectoryWildcard = true; } else { if (usage === "directories") { @@ -3845,6 +4060,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -3854,10 +4073,10 @@ var ts; } function Signature() { } // tslint:disable-line no-empty function Node(kind, pos, end) { - this.id = 0; - this.kind = kind; this.pos = pos; this.end = end; + this.kind = kind; + this.id = 0; this.flags = 0 /* None */; this.modifierFlagsCache = 0 /* None */; this.transformFlags = 0 /* None */; @@ -3937,6 +4156,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -3955,6 +4187,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); /** Remove an item from an array, moving everything to its right one space left. */ function orderedRemoveItem(array, item) { @@ -3997,9 +4249,7 @@ var ts; } } function createGetCanonicalFileName(useCaseSensitiveFileNames) { - return useCaseSensitiveFileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); + return useCaseSensitiveFileNames ? identity : toLowerCase; } ts.createGetCanonicalFileName = createGetCanonicalFileName; /** @@ -4034,7 +4284,7 @@ var ts; */ function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; /** Return the object corresponding to the best pattern to match `candidate`. */ @@ -4042,8 +4292,8 @@ var ts; var matchedValue = undefined; // use length of prefix as betterness criteria var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -4118,182 +4368,20 @@ var ts; return function (arg) { return f(arg) && g(arg); }; } ts.and = and; + function or(f, g) { + return function (arg) { return f(arg) || g(arg); }; + } + ts.or = or; function assertTypeIsNever(_) { } // tslint:disable-line no-empty ts.assertTypeIsNever = assertTypeIsNever; - function createCachedDirectoryStructureHost(host) { - var cachedReadDirectoryResult = createMap(); - var getCurrentDirectory = memoize(function () { return host.getCurrentDirectory(); }); - var getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - return { - useCaseSensitiveFileNames: host.useCaseSensitiveFileNames, - newLine: host.newLine, - readFile: function (path, encoding) { return host.readFile(path, encoding); }, - write: function (s) { return host.write(s); }, - writeFile: writeFile, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: createDirectory, - getCurrentDirectory: getCurrentDirectory, - getDirectories: getDirectories, - readDirectory: readDirectory, - addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, - addOrDeleteFile: addOrDeleteFile, - clearCache: clearCache, - exit: function (code) { return host.exit(code); } - }; - function toPath(fileName) { - return ts.toPath(fileName, getCurrentDirectory(), getCanonicalFileName); - } - function getCachedFileSystemEntries(rootDirPath) { - return cachedReadDirectoryResult.get(rootDirPath); - } - function getCachedFileSystemEntriesForBaseDir(path) { - return getCachedFileSystemEntries(getDirectoryPath(path)); - } - function getBaseNameOfFileName(fileName) { - return getBaseFileName(normalizePath(fileName)); - } - function createCachedFileSystemEntries(rootDir, rootDirPath) { - var resultFromHost = { - files: map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [], - directories: host.getDirectories(rootDir) || [] - }; - cachedReadDirectoryResult.set(rootDirPath, resultFromHost); - return resultFromHost; - } - /** - * If the readDirectory result was already cached, it returns that - * Otherwise gets result from host and caches it. - * The host request is done under try catch block to avoid caching incorrect result - */ - function tryReadDirectory(rootDir, rootDirPath) { - var cachedResult = getCachedFileSystemEntries(rootDirPath); - if (cachedResult) { - return cachedResult; - } - try { - return createCachedFileSystemEntries(rootDir, rootDirPath); - } - catch (_e) { - // If there is exception to read directories, dont cache the result and direct the calls to host - Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); - return undefined; - } - } - function fileNameEqual(name1, name2) { - return getCanonicalFileName(name1) === getCanonicalFileName(name2); - } - function hasEntry(entries, name) { - return some(entries, function (file) { return fileNameEqual(file, name); }); - } - function updateFileSystemEntry(entries, baseName, isValid) { - if (hasEntry(entries, baseName)) { - if (!isValid) { - return filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); - } - } - else if (isValid) { - return entries.push(baseName); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), /*fileExists*/ true); - } - return host.writeFile(fileName, data, writeByteOrderMark); - } - function fileExists(fileName) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || - host.fileExists(fileName); - } - function directoryExists(dirPath) { - var path = toPath(dirPath); - return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); - } - function createDirectory(dirPath) { - var path = toPath(dirPath); - var result = getCachedFileSystemEntriesForBaseDir(path); - var baseFileName = getBaseNameOfFileName(dirPath); - if (result) { - updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true); - } - host.createDirectory(dirPath); - } - function getDirectories(rootDir) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return result.directories.slice(); - } - return host.getDirectories(rootDir); - } - function readDirectory(rootDir, extensions, excludes, includes, depth) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return matchFiles(rootDir, extensions, excludes, includes, host.useCaseSensitiveFileNames, getCurrentDirectory(), depth, getFileSystemEntries); - } - return host.readDirectory(rootDir, extensions, excludes, includes, depth); - function getFileSystemEntries(dir) { - var path = toPath(dir); - if (path === rootDirPath) { - return result; - } - return getCachedFileSystemEntries(path) || createCachedFileSystemEntries(dir, path); - } - } - function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { - var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); - if (existingResult) { - // Just clear the cache for now - // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated - clearCache(); - } - else { - // This was earlier a file (hence not in cached directory contents) - // or we never cached the directory containing it - var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); - if (parentResult) { - var baseName = getBaseNameOfFileName(fileOrDirectory); - if (parentResult) { - var fsQueryResult = { - fileExists: host.fileExists(fileOrDirectoryPath), - directoryExists: host.directoryExists(fileOrDirectoryPath) - }; - if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { - // Folder added or removed, clear the cache instead of updating the folder and its structure - clearCache(); - } - else { - // No need to update the directory structure, just files - updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); - } - return fsQueryResult; - } - } - } - } - function addOrDeleteFile(fileName, filePath, eventKind) { - if (eventKind === ts.FileWatcherEventKind.Changed) { - return; - } - var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); - if (parentResult) { - updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); - } - } - function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { - updateFileSystemEntry(parentResult.files, baseName, fileExists); - } - function clearCache() { - cachedReadDirectoryResult.clear(); - } + ts.emptyFileSystemEntries = { + files: ts.emptyArray, + directories: ts.emptyArray + }; + function singleElementArray(t) { + return t === undefined ? undefined : [t]; } - ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + ts.singleElementArray = singleElementArray; })(ts || (ts = {})); /// var ts; @@ -4332,13 +4420,36 @@ var ts; } ts.getNodeMajorVersion = getNodeMajorVersion; ts.sys = (function () { - var utf8ByteOrderMark = "\u00EF\u00BB\u00BF"; + // NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual + // byte order mark from the specified encoding. Using any other byte order mark does + // not actually work. + var byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); + // crypto can be absent on reduced node installations + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; + } var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + /** + * djb2 hashing algorithm + * http://www.cse.yorku.ca/~oz/hash.html + */ + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } function createWatchedFileSet() { var dirWatchers = ts.createMap(); // One file can have multiple watchers @@ -4525,7 +4636,7 @@ var ts; function writeFile(fileName, data, writeByteOrderMark) { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } var fd; try { @@ -4568,7 +4679,7 @@ var ts; return { files: files, directories: directories }; } catch (e) { - return { files: [], directories: [] }; + return ts.emptyFileSystemEntries; } } function readDirectory(path, extensions, excludes, includes, depth) { @@ -4601,6 +4712,9 @@ var ts; return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1 /* Directory */); }); } var nodeSystem = { + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, args: process.argv.slice(2), newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, @@ -4660,11 +4774,7 @@ var ts; return undefined; } }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, getMemoryUsage: function () { if (global.gc) { global.gc(); @@ -4685,7 +4795,12 @@ var ts; process.exit(exitCode); }, realpath: function (path) { - return _fs.realpathSync(path); + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } }, debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), tryEnableSourceMapsForHost: function () { @@ -4715,7 +4830,7 @@ var ts; writeFile: function (path, data, writeByteOrderMark) { // If a BOM is required, emit one if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } ChakraHost.writeFile(path, data); }, @@ -5022,6 +5137,9 @@ var ts; unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts.DiagnosticCategory.Error, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), + An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -5136,6 +5254,7 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", "Numeric index type '{0}' is not assignable to string index type '{1}'."), Class_name_cannot_be_0: diag(2414, ts.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), @@ -5190,7 +5309,7 @@ var ts; Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), @@ -5278,6 +5397,8 @@ var ts; The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts.DiagnosticCategory.Error, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5356,6 +5477,10 @@ var ts; Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5442,7 +5567,6 @@ var ts; The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), - File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: diag(5011, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'."), Cannot_read_file_0_Colon_1: diag(5012, ts.DiagnosticCategory.Error, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), Failed_to_parse_file_0_Colon_1: diag(5014, ts.DiagnosticCategory.Error, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), Unknown_compiler_option_0: diag(5023, ts.DiagnosticCategory.Error, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), @@ -5481,6 +5605,7 @@ var ts; Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -5493,6 +5618,7 @@ var ts; Options_Colon: diag(6027, ts.DiagnosticCategory.Message, "Options_Colon_6027", "Options:"), Version_0: diag(6029, ts.DiagnosticCategory.Message, "Version_0_6029", "Version {0}"), Insert_command_line_options_and_files_from_a_file: diag(6030, ts.DiagnosticCategory.Message, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, ts.DiagnosticCategory.Message, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), File_change_detected_Starting_incremental_compilation: diag(6032, ts.DiagnosticCategory.Message, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), KIND: diag(6034, ts.DiagnosticCategory.Message, "KIND_6034", "KIND"), FILE: diag(6035, ts.DiagnosticCategory.Message, "FILE_6035", "FILE"), @@ -5533,7 +5659,7 @@ var ts; Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts.DiagnosticCategory.Message, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), - Specify_library_files_to_be_included_in_the_compilation_Colon: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", "Specify library files to be included in the compilation: "), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), Specify_JSX_code_generation_Colon_preserve_react_native_or_react: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", "Specify JSX code generation: 'preserve', 'react-native', or 'react'."), File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), @@ -5640,6 +5766,9 @@ var ts; Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6185", "Disable strict checking of generic signatures in function types."), Enable_strict_checking_of_function_types: diag(6186, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -5668,6 +5797,9 @@ var ts; Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{0}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime: diag(7038, ts.DiagnosticCategory.Error, "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038", "A namespace-style import cannot be called or constructed, and will cause a failure at runtime."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -5743,9 +5875,9 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), Declare_static_property_0: diag(90027, ts.DiagnosticCategory.Message, "Declare_static_property_0_90027", "Declare static property '{0}'"), Call_decorator_expression: diag(90028, ts.DiagnosticCategory.Message, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Extract_symbol: diag(95003, ts.DiagnosticCategory.Message, "Extract_symbol_95003", "Extract symbol"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -5757,6 +5889,9 @@ var ts; Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"), Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), }; })(ts || (ts = {})); /// @@ -5797,47 +5932,48 @@ var ts; "false": 86 /* FalseKeyword */, "finally": 87 /* FinallyKeyword */, "for": 88 /* ForKeyword */, - "from": 141 /* FromKeyword */, + "from": 142 /* FromKeyword */, "function": 89 /* FunctionKeyword */, "get": 125 /* GetKeyword */, "if": 90 /* IfKeyword */, "implements": 108 /* ImplementsKeyword */, "import": 91 /* ImportKeyword */, "in": 92 /* InKeyword */, + "infer": 126 /* InferKeyword */, "instanceof": 93 /* InstanceOfKeyword */, "interface": 109 /* InterfaceKeyword */, - "is": 126 /* IsKeyword */, - "keyof": 127 /* KeyOfKeyword */, + "is": 127 /* IsKeyword */, + "keyof": 128 /* KeyOfKeyword */, "let": 110 /* LetKeyword */, - "module": 128 /* ModuleKeyword */, - "namespace": 129 /* NamespaceKeyword */, - "never": 130 /* NeverKeyword */, + "module": 129 /* ModuleKeyword */, + "namespace": 130 /* NamespaceKeyword */, + "never": 131 /* NeverKeyword */, "new": 94 /* NewKeyword */, "null": 95 /* NullKeyword */, - "number": 133 /* NumberKeyword */, - "object": 134 /* ObjectKeyword */, + "number": 134 /* NumberKeyword */, + "object": 135 /* ObjectKeyword */, "package": 111 /* PackageKeyword */, "private": 112 /* PrivateKeyword */, "protected": 113 /* ProtectedKeyword */, "public": 114 /* PublicKeyword */, - "readonly": 131 /* ReadonlyKeyword */, - "require": 132 /* RequireKeyword */, - "global": 142 /* GlobalKeyword */, + "readonly": 132 /* ReadonlyKeyword */, + "require": 133 /* RequireKeyword */, + "global": 143 /* GlobalKeyword */, "return": 96 /* ReturnKeyword */, - "set": 135 /* SetKeyword */, + "set": 136 /* SetKeyword */, "static": 115 /* StaticKeyword */, - "string": 136 /* StringKeyword */, + "string": 137 /* StringKeyword */, "super": 97 /* SuperKeyword */, "switch": 98 /* SwitchKeyword */, - "symbol": 137 /* SymbolKeyword */, + "symbol": 138 /* SymbolKeyword */, "this": 99 /* ThisKeyword */, "throw": 100 /* ThrowKeyword */, "true": 101 /* TrueKeyword */, "try": 102 /* TryKeyword */, - "type": 138 /* TypeKeyword */, + "type": 139 /* TypeKeyword */, "typeof": 103 /* TypeOfKeyword */, - "undefined": 139 /* UndefinedKeyword */, - "unique": 140 /* UniqueKeyword */, + "undefined": 140 /* UndefinedKeyword */, + "unique": 141 /* UniqueKeyword */, "var": 104 /* VarKeyword */, "void": 105 /* VoidKeyword */, "while": 106 /* WhileKeyword */, @@ -5845,7 +5981,7 @@ var ts; "yield": 116 /* YieldKeyword */, "async": 120 /* AsyncKeyword */, "await": 121 /* AwaitKeyword */, - "of": 143 /* OfKeyword */, + "of": 144 /* OfKeyword */, "{": 17 /* OpenBraceToken */, "}": 18 /* CloseBraceToken */, "(": 19 /* OpenParenToken */, @@ -5904,7 +6040,7 @@ var ts; /* As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers IdentifierStart :: - Can contain Unicode 3.0.0 categories: + Can contain Unicode 3.0.0 categories: Uppercase letter (Lu), Lowercase letter (Ll), Titlecase letter (Lt), @@ -5912,7 +6048,7 @@ var ts; Other letter (Lo), or Letter number (Nl). IdentifierPart :: = - Can contain IdentifierStart + Unicode 3.0.0 categories: + Can contain IdentifierStart + Unicode 3.0.0 categories: Non-spacing mark (Mn), Combining spacing mark (Mc), Decimal number (Nd), or @@ -5926,7 +6062,7 @@ var ts; /* As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers IdentifierStart :: - Can contain Unicode 6.2 categories: + Can contain Unicode 6.2 categories: Uppercase letter (Lu), Lowercase letter (Ll), Titlecase letter (Lt), @@ -5934,7 +6070,7 @@ var ts; Other letter (Lo), or Letter number (Nl). IdentifierPart :: - Can contain IdentifierStart + Unicode 6.2 categories: + Can contain IdentifierStart + Unicode 6.2 categories: Non-spacing mark (Mn), Combining spacing mark (Mc), Decimal number (Nd), @@ -6036,7 +6172,9 @@ var ts; ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -6253,7 +6391,7 @@ var ts; } function scanConflictMarkerTrivia(text, pos, error) { if (error) { - error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength); + error(ts.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); } var ch = text.charCodeAt(pos); var len = text.length; @@ -6509,19 +6647,60 @@ var ts; lookAhead: lookAhead, scanRange: scanRange, }; - function error(message, length) { + function error(message, errPos, length) { + if (errPos === void 0) { errPos = pos; } if (onError) { + var oldPos = pos; + pos = errPos; onError(message, length || 0); + pos = oldPos; } } + function scanNumberFragment() { + var start = pos; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + var result = ""; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result += text.substring(start, pos); + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + start = pos; + continue; + } + if (isDigit(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result + text.substring(start, pos); + } function scanNumber() { var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; + var mainFragment = scanNumberFragment(); + var decimalFragment; + var scientificFragment; if (text.charCodeAt(pos) === 46 /* dot */) { pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; + decimalFragment = scanNumberFragment(); } var end = pos; if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { @@ -6529,17 +6708,29 @@ var ts; tokenFlags |= 16 /* Scientific */; if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { + var preNumericPart = pos; + var finalFragment = scanNumberFragment(); + if (!finalFragment) { error(ts.Diagnostics.Digit_expected); } + else { + scientificFragment = text.substring(end, preNumericPart) + finalFragment; + end = pos; + } + } + if (tokenFlags & 512 /* ContainsSeparator */) { + var result = mainFragment; + if (decimalFragment) { + result += "." + decimalFragment; + } + if (scientificFragment) { + result += scientificFragment; + } + return "" + +result; + } + else { + return "" + +(text.substring(start, end)); // No need to use all the fragments; no _ removal needed } - return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -6552,21 +6743,39 @@ var ts; * Scans the given number of hexadecimal digits in the text, * returning -1 if the given number is unavailable. */ - function scanExactNumberOfHexDigits(count) { - return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false); + function scanExactNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ false, canHaveSeparators); } /** * Scans as many hexadecimal digits as are available in the text, * returning -1 if the given number of digits was unavailable. */ - function scanMinimumNumberOfHexDigits(count) { - return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true); + function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(/*minCount*/ count, /*scanAsManyAsPossible*/ true, canHaveSeparators); } - function scanHexDigits(minCount, scanAsManyAsPossible) { + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { var digits = 0; var value = 0; + var allowSeparator = false; + var isPreviousTokenSeparator = false; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { value = value * 16 + ch - 48 /* _0 */; } @@ -6581,10 +6790,14 @@ var ts; } pos++; digits++; + isPreviousTokenSeparator = false; } if (digits < minCount) { value = -1; } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } return value; } function scanString(jsxAttributeString) { @@ -6735,7 +6948,7 @@ var ts; } } function scanHexadecimalEscape(numDigits) { - var escapedValue = scanExactNumberOfHexDigits(numDigits); + var escapedValue = scanExactNumberOfHexDigits(numDigits, /*canHaveSeparators*/ false); if (escapedValue >= 0) { return String.fromCharCode(escapedValue); } @@ -6745,7 +6958,7 @@ var ts; } } function scanExtendedUnicodeEscape() { - var escapedValue = scanMinimumNumberOfHexDigits(1); + var escapedValue = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ false); var isInvalidExtendedEscape = false; // Validate the value of the digit if (escapedValue < 0) { @@ -6789,7 +7002,7 @@ var ts; if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) { var start_1 = pos; pos += 2; - var value = scanExactNumberOfHexDigits(4); + var value = scanExactNumberOfHexDigits(4, /*canHaveSeparators*/ false); pos = start_1; return value; } @@ -6841,8 +7054,27 @@ var ts; // For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b. // Similarly valid octalIntegerLiteral must have at least one octal digit following o or O. var numberOfDigits = 0; + var separatorAllowed = false; + var isPreviousTokenSeparator = false; while (true) { var ch = text.charCodeAt(pos); + // Numeric seperators are allowed anywhere within a numeric literal, except not at the beginning, or following another separator + if (ch === 95 /* _ */) { + tokenFlags |= 512 /* ContainsSeparator */; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; var valueOfCh = ch - 48 /* _0 */; if (!isDigit(ch) || valueOfCh >= base) { break; @@ -6850,11 +7082,17 @@ var ts; value = value * base + valueOfCh; pos++; numberOfDigits++; + isPreviousTokenSeparator = false; } // Invalid binaryIntegerLiteral or octalIntegerLiteral if (numberOfDigits === 0) { return -1; } + if (text.charCodeAt(pos - 1) === 95 /* _ */) { + // Literal ends with underscore - not allowed + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + return value; + } return value; } function scan() { @@ -7044,7 +7282,7 @@ var ts; case 48 /* _0 */: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { pos += 2; - var value = scanMinimumNumberOfHexDigits(1); + var value = scanMinimumNumberOfHexDigits(1, /*canHaveSeparators*/ true); if (value < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); value = 0; @@ -7390,7 +7628,7 @@ var ts; break; } } - tokenValue += text.substr(firstCharPosition, pos - firstCharPosition); + tokenValue += text.substring(firstCharPosition, pos); } return token; } @@ -7413,6 +7651,7 @@ var ts; startPos = pos; tokenPos = pos; var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 9 /* tab */: case 11 /* verticalTab */: @@ -7423,55 +7662,30 @@ var ts; } return token = 5 /* WhitespaceTrivia */; case 64 /* at */: - pos++; return token = 57 /* AtToken */; case 10 /* lineFeed */: case 13 /* carriageReturn */: - pos++; return token = 4 /* NewLineTrivia */; case 42 /* asterisk */: - pos++; return token = 39 /* AsteriskToken */; case 123 /* openBrace */: - pos++; return token = 17 /* OpenBraceToken */; case 125 /* closeBrace */: - pos++; return token = 18 /* CloseBraceToken */; case 91 /* openBracket */: - pos++; return token = 21 /* OpenBracketToken */; case 93 /* closeBracket */: - pos++; return token = 22 /* CloseBracketToken */; case 60 /* lessThan */: - pos++; return token = 27 /* LessThanToken */; - case 62 /* greaterThan */: - pos++; - return token = 29 /* GreaterThanToken */; case 61 /* equals */: - pos++; return token = 58 /* EqualsToken */; case 44 /* comma */: - pos++; return token = 26 /* CommaToken */; case 46 /* dot */: - pos++; - if (text.substr(tokenPos, pos + 2) === "...") { - pos += 2; - return token = 24 /* DotDotDotToken */; - } return token = 23 /* DotToken */; - case 33 /* exclamation */: - pos++; - return token = 51 /* ExclamationToken */; - case 63 /* question */: - pos++; - return token = 55 /* QuestionToken */; } if (isIdentifierStart(ch, 6 /* Latest */)) { - pos++; while (isIdentifierPart(text.charCodeAt(pos), 6 /* Latest */) && pos < end) { pos++; } @@ -7479,7 +7693,7 @@ var ts; return token = 71 /* Identifier */; } else { - return pos += 1, token = 0 /* Unknown */; + return token = 0 /* Unknown */; } } function speculationHelper(callback, isLookahead) { @@ -7560,8 +7774,9 @@ var ts; /* @internal */ var ts; (function (ts) { - ts.emptyArray = []; + ts.resolvingEmptyArray = []; ts.emptyMap = ts.createMap(); + ts.emptyUnderscoreEscapedMap = ts.emptyMap; ts.externalHelpersModuleNameText = "tslib"; function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; @@ -7581,15 +7796,24 @@ var ts; var str = ""; var writeText = function (text) { return str += text; }; return { - string: function () { return str; }, + getText: function () { return str; }, + write: writeText, + rawWrite: writeText, + writeTextOfNode: writeText, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, writeSpace: writeText, writeStringLiteral: writeText, + writeLiteral: writeText, writeParameter: writeText, writeProperty: writeText, writeSymbol: writeText, + getTextPos: function () { return str.length; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, // Completely ignore indentation for string writers. And map newlines to // a single space. writeLine: function () { return str += " "; }, @@ -7603,10 +7827,10 @@ var ts; }; } function usingSingleLineStringWriter(action) { - var oldString = stringWriter.string(); + var oldString = stringWriter.getText(); try { action(stringWriter); - return stringWriter.string(); + return stringWriter.getText(); } finally { stringWriter.clear(); @@ -7640,12 +7864,19 @@ var ts; return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && + oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; function packageIdIsEqual(a, b) { return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version; } + function packageIdToString(_a) { + var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; + var fullName = subModuleName ? name + "/" + subModuleName : name; + return fullName + "@" + version; + } + ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -7689,7 +7920,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269 /* SourceFile */) { + while (node && node.kind !== 272 /* SourceFile */) { node = node.parent; } return node; @@ -7697,11 +7928,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return true; } return false; @@ -7810,7 +8041,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 290 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 293 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -7866,7 +8097,7 @@ var ts; function getLiteralText(node, sourceFile) { // If we don't need to downlevel and we can reach the original source text using // the node's parent reference, then simply get the text as it was originally written. - if (!nodeIsSynthesized(node) && node.parent) { + if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512 /* ContainsSeparator */)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } var escapeText = getEmitFlags(node) & 16777216 /* NoAsciiEscaping */ ? escapeString : escapeNonAsciiString; @@ -7927,11 +8158,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 /* VariableDeclaration */ && node.parent.kind === 264 /* CatchClause */; + return node.kind === 230 /* VariableDeclaration */ && node.parent.kind === 267 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 /* ModuleDeclaration */ && + return node && node.kind === 237 /* ModuleDeclaration */ && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -7950,11 +8181,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 234 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 237 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 /* SourceFile */ || - node.kind === 234 /* ModuleDeclaration */ || + return node.kind === 272 /* SourceFile */ || + node.kind === 237 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -7970,9 +8201,9 @@ var ts; return false; } switch (node.parent.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node.parent); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -7984,22 +8215,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 264 /* CatchClause */: - case 234 /* ModuleDeclaration */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 267 /* CatchClause */: + case 237 /* ModuleDeclaration */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; - case 208 /* Block */: + case 211 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !ts.isFunctionLike(parentNode); @@ -8009,25 +8240,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: ts.assertTypeIsNever(node); @@ -8037,8 +8268,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: return true; default: return false; @@ -8075,21 +8306,20 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return escapeLeadingUnderscores(name.text); - case 145 /* ComputedPropertyName */: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146 /* ComputedPropertyName */: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -8099,6 +8329,11 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -8126,7 +8361,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208 /* Block */) { + if (node.body && node.body.kind === 211 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -8140,7 +8375,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -8149,23 +8384,23 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 232 /* TypeAliasDeclaration */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -8173,9 +8408,19 @@ var ts; // construct. return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + // These asserts should all be satisfied for a properly constructed `errorNode`. + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -8184,7 +8429,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */ && isConst(node); + return node.kind === 236 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -8197,15 +8442,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 /* ExpressionStatement */ + return node.kind === 214 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -8214,11 +8459,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 /* Parameter */ || - node.kind === 146 /* TypeParameter */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 188 /* ArrowFunction */ || - node.kind === 186 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 148 /* Parameter */ || + node.kind === 147 /* TypeParameter */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 191 /* ArrowFunction */ || + node.kind === 189 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -8234,40 +8479,42 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 /* FirstTypeNode */ <= node.kind && node.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= node.kind && node.kind <= 177 /* LastTypeNode */) { return true; } switch (node.kind) { case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: + case 138 /* SymbolKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: return true; case 105 /* VoidKeyword */: - return node.parent.kind !== 191 /* VoidExpression */; - case 202 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 194 /* VoidExpression */; + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147 /* TypeParameter */: + return node.parent.kind === 176 /* MappedType */ || node.parent.kind === 171 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 71 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */ || node.kind === 180 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */ || node.kind === 183 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 144 /* QualifiedName */: - case 180 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: var parent = node.parent; - if (parent.kind === 163 /* TypeQuery */) { + if (parent.kind === 164 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -8276,38 +8523,38 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (159 /* FirstTypeNode */ <= parent.kind && parent.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= parent.kind && parent.kind <= 177 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return node === parent.constraint; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: return node === parent.type; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node === parent.type; - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return node === parent.type; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return node === parent.type; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; - case 184 /* TaggedTemplateExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + return ts.contains(parent.typeArguments, node); + case 187 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -8331,23 +8578,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitor(node); - case 236 /* CaseBlock */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 223 /* LabeledStatement */: - case 225 /* TryStatement */: - case 264 /* CatchClause */: + case 239 /* CaseBlock */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -8357,30 +8604,29 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(name.expression); + traverse(node.name.expression); return; } } @@ -8400,10 +8646,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 165 /* ArrayType */) { + if (node && node.kind === 166 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 160 /* TypeReference */) { + else if (node && node.kind === 161 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -8413,12 +8659,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 164 /* TypeLiteral */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 165 /* TypeLiteral */: return node.members; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.properties; } } @@ -8426,14 +8672,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177 /* BindingElement */: - case 268 /* EnumMember */: - case 147 /* Parameter */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 266 /* ShorthandPropertyAssignment */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 271 /* EnumMember */: + case 148 /* Parameter */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 269 /* ShorthandPropertyAssignment */: + case 230 /* VariableDeclaration */: return true; } } @@ -8441,8 +8687,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 /* VariableDeclarationList */ - && node.parent.parent.kind === 209 /* VariableStatement */; + return node.parent.kind === 231 /* VariableDeclarationList */ + && node.parent.parent.kind === 212 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -8453,13 +8699,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return true; } return false; @@ -8470,7 +8716,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223 /* LabeledStatement */) { + if (node.statement.kind !== 226 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -8478,17 +8724,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 211 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 /* MethodDeclaration */ && node.parent.kind === 179 /* ObjectLiteralExpression */; + return node && node.kind === 153 /* MethodDeclaration */ && node.parent.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 /* MethodDeclaration */ && - (node.parent.kind === 179 /* ObjectLiteralExpression */ || - node.parent.kind === 200 /* ClassExpression */); + return node.kind === 153 /* MethodDeclaration */ && + (node.parent.kind === 182 /* ObjectLiteralExpression */ || + node.parent.kind === 203 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -8501,7 +8747,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265 /* PropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -8523,7 +8769,7 @@ var ts; return undefined; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -8538,9 +8784,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8551,26 +8797,26 @@ var ts; node = node.parent; } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 234 /* ModuleDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 233 /* EnumDeclaration */: - case 269 /* SourceFile */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 237 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 236 /* EnumDeclaration */: + case 272 /* SourceFile */: return node; } } @@ -8580,9 +8826,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return container; } } @@ -8604,27 +8850,27 @@ var ts; return node; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: node = node.parent; break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8640,14 +8886,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */) { + if (func.kind === 190 /* FunctionExpression */ || func.kind === 191 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 186 /* ParenthesizedExpression */) { + while (parent.kind === 189 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 185 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -8658,7 +8904,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 97 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -8667,57 +8913,58 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 99 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { - return node.tag; + switch (node.kind) { + case 187 /* TaggedTemplateExpression */: + return node.tag; + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - // Will either be a CallExpression, NewExpression, or Decorator. - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // classes are valid targets return true; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 230 /* ClassDeclaration */; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + return parent.kind === 233 /* ClassDeclaration */; + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 230 /* ClassDeclaration */; - case 147 /* Parameter */: + && parent.kind === 233 /* ClassDeclaration */; + case 148 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 153 /* Constructor */ - || parent.kind === 152 /* MethodDeclaration */ - || parent.kind === 155 /* SetAccessor */) - && grandparent.kind === 230 /* ClassDeclaration */; + && (parent.kind === 154 /* Constructor */ + || parent.kind === 153 /* MethodDeclaration */ + || parent.kind === 156 /* SetAccessor */) + && grandparent.kind === 233 /* ClassDeclaration */; } return false; } @@ -8733,19 +8980,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152 /* MethodDeclaration */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 156 /* SetAccessor */: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 /* JsxOpeningElement */ || - parent.kind === 251 /* JsxSelfClosingElement */ || - parent.kind === 253 /* JsxClosingElement */) { + if (parent.kind === 255 /* JsxOpeningElement */ || + parent.kind === 254 /* JsxSelfClosingElement */ || + parent.kind === 256 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -8758,45 +9005,45 @@ var ts; case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 12 /* RegularExpressionLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 203 /* AsExpression */: - case 185 /* TypeAssertionExpression */: - case 204 /* NonNullExpression */: - case 186 /* ParenthesizedExpression */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 199 /* SpreadElement */: - case 197 /* TemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 206 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 207 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 202 /* SpreadElement */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: - case 201 /* OmittedExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 198 /* YieldExpression */: - case 192 /* AwaitExpression */: - case 205 /* MetaProperty */: + case 204 /* OmittedExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 201 /* YieldExpression */: + case 195 /* AwaitExpression */: + case 208 /* MetaProperty */: return true; - case 144 /* QualifiedName */: - while (node.parent.kind === 144 /* QualifiedName */) { + case 145 /* QualifiedName */: + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node); case 71 /* Identifier */: - if (node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -8812,47 +9059,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 180 /* BindingElement */: return parent.initializer === node; - case 211 /* ExpressionStatement */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 220 /* ReturnStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 224 /* ThrowStatement */: + case 214 /* ExpressionStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 223 /* ReturnStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 227 /* ThrowStatement */: return parent.expression === node; - case 215 /* ForStatement */: + case 218 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forInStatement.expression === node; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return node === parent.expression; - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return node === parent.expression; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return node === parent.expression; - case 148 /* Decorator */: - case 260 /* JsxExpression */: - case 259 /* JsxSpreadAttribute */: - case 267 /* SpreadAssignment */: + case 149 /* Decorator */: + case 263 /* JsxExpression */: + case 262 /* JsxSpreadAttribute */: + case 270 /* SpreadAssignment */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -8860,7 +9107,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -8869,7 +9116,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 252 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -8889,16 +9136,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 /* StringKeyword */ || node.typeArguments[0].kind === 133 /* NumberKeyword */); + (node.typeArguments[0].kind === 137 /* StringKeyword */ || node.typeArguments[0].kind === 134 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; - /** - * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one argument (of the form 'require("name")'). - * This function does not test if the node is in a JavaScript file or not. - */ function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182 /* CallExpression */) { + if (callExpression.kind !== 185 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -8925,9 +9167,9 @@ var ts; * This function does not test if the node is in a JavaScript file or not. */ function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227 /* VariableDeclaration */) { + if (s.valueDeclaration && s.valueDeclaration.kind === 230 /* VariableDeclaration */) { var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 /* FunctionExpression */ || declaration.initializer.kind === 200 /* ClassExpression */); + return declaration.initializer && (declaration.initializer.kind === 190 /* FunctionExpression */ || declaration.initializer.kind === 203 /* ClassExpression */); } return false; } @@ -8953,7 +9195,7 @@ var ts; if (!isInJavaScriptFile(expr)) { return 0 /* None */; } - if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 180 /* PropertyAccessExpression */) { + if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 183 /* PropertyAccessExpression */) { return 0 /* None */; } var lhs = expr.left; @@ -8975,7 +9217,7 @@ var ts; else if (lhs.expression.kind === 99 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 180 /* PropertyAccessExpression */) { + else if (lhs.expression.kind === 183 /* PropertyAccessExpression */) { // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 71 /* Identifier */) { @@ -8994,21 +9236,21 @@ var ts; ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 214 /* ExpressionStatement */ && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 238 /* ImportEqualsDeclaration */) { + if (node.kind === 241 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 249 /* ExternalModuleReference */) { + if (reference.kind === 252 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 245 /* ExportDeclaration */) { + if (node.kind === 248 /* ExportDeclaration */) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -9017,31 +9259,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238 /* ImportEqualsDeclaration */) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241 /* NamespaceImport */) { - return importClause.namedBindings; + switch (node.kind) { + case 242 /* ImportDeclaration */: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241 /* ImportEqualsDeclaration */: + return node; + case 248 /* ExportDeclaration */: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 /* ImportDeclaration */ - && node.importClause - && !!node.importClause.name; + return node.kind === 242 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147 /* Parameter */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 266 /* ShorthandPropertyAssignment */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 269 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -9049,54 +9292,45 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 /* JSDocFunctionType */ && + return node.kind === 280 /* JSDocFunctionType */ && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; } ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getAllJSDocs(node) { - if (ts.isJSDocTypedefTag(node)) { - return [node.parent]; - } - return getJSDocCommentsAndTags(node); - } - ts.getAllJSDocs = getAllJSDocs; function getSourceOfAssignment(node) { return ts.isExpressionStatement(node) && node.expression && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 58 /* EqualsToken */ && node.expression.right; } - ts.getSourceOfAssignment = getSourceOfAssignment; - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212 /* VariableStatement */: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151 /* PropertyDeclaration */: + return node.initializer; + } } - ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement; - function getSingleVariableOfVariableStatement(node, child) { + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } - ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement; function getNestedModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && + return node.kind === 237 /* ModuleDeclaration */ && node.body && - node.body.kind === 234 /* ModuleDeclaration */ && + node.body.kind === 237 /* ModuleDeclaration */ && node.body; } - ts.getNestedModuleDeclaration = getNestedModuleDeclaration; function getJSDocCommentsAndTags(node) { var result; getJSDocCommentsAndTagsWorker(node); return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 /* PropertyAssignment */ || parent.kind === 151 /* PropertyDeclaration */ || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. @@ -9106,21 +9340,21 @@ var ts; // */ // var x = function(name) { return name.length; } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 /* None */ || - node.kind === 180 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 211 /* ExpressionStatement */) { + node.kind === 183 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 214 /* ExpressionStatement */) { getJSDocCommentsAndTagsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } - if (isVariableLike(node) && node.initializer && ts.hasJSDocNodes(node.initializer)) { + if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { result = ts.addRange(result, node.initializer.jsDoc); } if (ts.hasJSDocNodes(node)) { @@ -9149,7 +9383,7 @@ var ts; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -9157,7 +9391,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 282 /* JSDocComment */); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -9186,30 +9420,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 43 /* PlusPlusToken */ || unaryOperator === 44 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 186 /* ParenthesizedExpression */: - case 178 /* ArrayLiteralExpression */: - case 199 /* SpreadElement */: + case 189 /* ParenthesizedExpression */: + case 181 /* ArrayLiteralExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: node = parent; break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -9230,6 +9465,33 @@ var ts; return getAssignmentTargetKind(node) !== 0 /* None */; } ts.isAssignmentTarget = isAssignmentTarget; + /** + * Indicates whether a node could contain a `var` VariableDeclarationList that contributes to + * the same `var` declaration scope as the node's parent. + */ + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 211 /* Block */: + case 212 /* VariableStatement */: + case 224 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: + return true; + } + return false; + } + ts.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration; function walkUp(node, kind) { while (node && node.kind === kind) { node = node.parent; @@ -9237,20 +9499,20 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169 /* ParenthesizedType */); + return walkUp(node, 172 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186 /* ParenthesizedExpression */); + return walkUp(node, 189 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189 /* DeleteExpression */; + return node && node.kind === 192 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -9292,7 +9554,7 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 145 /* ComputedPropertyName */ && + node.parent.kind === 146 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -9300,32 +9562,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 180 /* PropertyAccessExpression */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 183 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 144 /* QualifiedName */) { + while (parent.kind === 145 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 163 /* TypeQuery */; + return parent.kind === 164 /* TypeQuery */; } return false; - case 177 /* BindingElement */: - case 243 /* ImportSpecifier */: + case 180 /* BindingElement */: + case 246 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 247 /* ExportSpecifier */: - case 257 /* JsxAttribute */: + case 250 /* ExportSpecifier */: + case 260 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -9341,13 +9603,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 237 /* NamespaceExportDeclaration */ || - node.kind === 240 /* ImportClause */ && !!node.name || - node.kind === 241 /* NamespaceImport */ || - node.kind === 243 /* ImportSpecifier */ || - node.kind === 247 /* ExportSpecifier */ || - node.kind === 244 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 240 /* NamespaceExportDeclaration */ || + node.kind === 243 /* ImportClause */ && !!node.name || + node.kind === 244 /* NamespaceImport */ || + node.kind === 246 /* ImportSpecifier */ || + node.kind === 250 /* ExportSpecifier */ || + node.kind === 247 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -9431,11 +9693,11 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 72 /* FirstKeyword */ <= token && token <= 143 /* LastKeyword */; + return 72 /* FirstKeyword */ <= token && token <= 144 /* LastKeyword */; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 117 /* FirstContextualKeyword */ <= token && token <= 143 /* LastContextualKeyword */; + return 117 /* FirstContextualKeyword */ <= token && token <= 144 /* LastContextualKeyword */; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -9465,14 +9727,14 @@ var ts; } var flags = 0 /* Normal */; switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: if (node.asteriskToken) { flags |= 1 /* Generator */; } // falls through - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (hasModifier(node, 256 /* Async */)) { flags |= 2 /* Async */; } @@ -9486,10 +9748,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256 /* Async */); @@ -9516,7 +9778,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 145 /* ComputedPropertyName */ && + return name.kind === 146 /* ComputedPropertyName */ && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -9537,7 +9799,7 @@ var ts; if (name.kind === 9 /* StringLiteral */ || name.kind === 8 /* NumericLiteral */) { return escapeLeadingUnderscores(name.text); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -9579,6 +9841,10 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + function isKnownSymbol(symbol) { + return ts.startsWith(symbol.escapedName, "__@"); + } + ts.isKnownSymbol = isKnownSymbol; /** * Includes the word "Symbol" with unicode escapes */ @@ -9592,11 +9858,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 147 /* Parameter */; + return root.kind === 148 /* Parameter */; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 177 /* BindingElement */) { + while (node.kind === 180 /* BindingElement */) { node = node.parent.parent; } return node; @@ -9604,15 +9870,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 187 /* FunctionExpression */ - || kind === 229 /* FunctionDeclaration */ - || kind === 188 /* ArrowFunction */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 234 /* ModuleDeclaration */ - || kind === 269 /* SourceFile */; + return kind === 154 /* Constructor */ + || kind === 190 /* FunctionExpression */ + || kind === 232 /* FunctionDeclaration */ + || kind === 191 /* ArrowFunction */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 237 /* ModuleDeclaration */ + || kind === 272 /* SourceFile */; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -9631,23 +9897,23 @@ var ts; })(Associativity = ts.Associativity || (ts.Associativity = {})); function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 /* NewExpression */ && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 183 /* NewExpression */: + case 186 /* NewExpression */: return hasArguments ? 0 /* Left */ : 1 /* Right */; - case 193 /* PrefixUnaryExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 192 /* AwaitExpression */: - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: + case 196 /* PrefixUnaryExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 195 /* AwaitExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: return 1 /* Right */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (operator) { case 40 /* AsteriskAsteriskToken */: case 58 /* EqualsToken */: @@ -9671,15 +9937,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 /* NewExpression */ && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 /* NewExpression */ && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 195 /* BinaryExpression */) { + if (expression.kind === 198 /* BinaryExpression */) { return expression.operatorToken.kind; } - else if (expression.kind === 193 /* PrefixUnaryExpression */ || expression.kind === 194 /* PostfixUnaryExpression */) { + else if (expression.kind === 196 /* PrefixUnaryExpression */ || expression.kind === 197 /* PostfixUnaryExpression */) { return expression.operator; } else { @@ -9697,37 +9963,37 @@ var ts; case 86 /* FalseKeyword */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: case 12 /* RegularExpressionLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: - case 186 /* ParenthesizedExpression */: - case 201 /* OmittedExpression */: + case 200 /* TemplateExpression */: + case 189 /* ParenthesizedExpression */: + case 204 /* OmittedExpression */: return 19; - case 184 /* TaggedTemplateExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 187 /* TaggedTemplateExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return 18; - case 183 /* NewExpression */: + case 186 /* NewExpression */: return hasArguments ? 18 : 17; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return 17; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return 16; - case 193 /* PrefixUnaryExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 192 /* AwaitExpression */: + case 196 /* PrefixUnaryExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 195 /* AwaitExpression */: return 15; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (operatorKind) { case 51 /* ExclamationToken */: case 52 /* TildeToken */: @@ -9785,13 +10051,13 @@ var ts; default: return -1; } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return 4; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return 2; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return 1; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return 0; default: return -1; @@ -9800,9 +10066,9 @@ var ts; ts.getOperatorPrecedence = getOperatorPrecedence; function createDiagnosticCollection() { var nonFileDiagnostics = []; + var filesWithDiagnostics = []; var fileDiagnostics = ts.createMap(); var hasReadNonFileDiagnostics = false; - var diagnosticsModified = false; var modificationCount = 0; return { add: add, @@ -9824,6 +10090,7 @@ var ts; if (!diagnostics) { diagnostics = []; fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive); } } else { @@ -9834,39 +10101,23 @@ var ts; } diagnostics = nonFileDiagnostics; } - diagnostics.push(diagnostic); - diagnosticsModified = true; + ts.insertSorted(diagnostics, diagnostic, ts.compareDiagnostics); modificationCount++; } function getGlobalDiagnostics() { - sortAndDeduplicate(); hasReadNonFileDiagnostics = true; return nonFileDiagnostics; } function getDiagnostics(fileName) { - sortAndDeduplicate(); if (fileName) { return fileDiagnostics.get(fileName) || []; } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); + var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); }); + if (!nonFileDiagnostics.length) { + return fileDiags; } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - fileDiagnostics.forEach(function (diagnostics) { - ts.forEach(diagnostics, pushDiagnostic); - }); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - fileDiagnostics.forEach(function (diagnostics, key) { - fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); - }); + fileDiags.unshift.apply(fileDiags, nonFileDiagnostics); + return fileDiags; } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -10011,7 +10262,19 @@ var ts; getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, getText: function () { return output; }, isAtStartOfLine: function () { return lineStart; }, - reset: reset + clear: reset, + reportInaccessibleThisError: ts.noop, + reportPrivateInBaseOfClassExpression: ts.noop, + reportInaccessibleUniqueSymbolError: ts.noop, + trackSymbol: ts.noop, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: write }; } ts.createTextWriter = createTextWriter; @@ -10114,7 +10377,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -10160,10 +10423,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 155 /* SetAccessor */) { + else if (accessor.kind === 156 /* SetAccessor */) { setAccessor = accessor; } else { @@ -10172,7 +10435,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 /* GetAccessor */ || member.kind === 155 /* SetAccessor */) + if ((member.kind === 155 /* GetAccessor */ || member.kind === 156 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -10183,10 +10446,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 /* GetAccessor */ && !getAccessor) { + if (member.kind === 155 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 155 /* SetAccessor */ && !setAccessor) { + if (member.kind === 156 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -10206,7 +10469,7 @@ var ts; * parsed in a JavaScript file, gets the type annotation from JSDoc. */ function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (node.type) { + if (ts.hasType(node)) { return node.type; } if (checkJSDoc || isInJavaScriptFile(node)) { @@ -10497,7 +10760,7 @@ var ts; case 76 /* ConstKeyword */: return 2048 /* Const */; case 79 /* DefaultKeyword */: return 512 /* Default */; case 120 /* AsyncKeyword */: return 256 /* Async */; - case 131 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 132 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -10514,7 +10777,7 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ && + if (node.kind === 205 /* ExpressionWithTypeArguments */ && node.parent.token === 85 /* ExtendsKeyword */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -10532,8 +10795,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 179 /* ObjectLiteralExpression */ - || kind === 178 /* ArrayLiteralExpression */; + return kind === 182 /* ObjectLiteralExpression */ + || kind === 181 /* ArrayLiteralExpression */; } return false; } @@ -10543,7 +10806,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */ + return node.kind === 205 /* ExpressionWithTypeArguments */ && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 /* ImplementsKeyword */ @@ -10553,21 +10816,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + node.kind === 183 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 /* ObjectLiteralExpression */ && + return expression.kind === 182 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 /* ArrayLiteralExpression */ && + return expression.kind === 181 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -10651,14 +10914,14 @@ var ts; ts.convertToBase64 = convertToBase64; var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; - function getNewLineCharacter(options, system) { + function getNewLineCharacter(options, getNewLine) { switch (options.newLine) { case 0 /* CarriageReturnLineFeed */: return carriageReturnLineFeed; case 1 /* LineFeed */: return lineFeed; } - return system ? system.newLine : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; + return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; /** @@ -10836,8 +11099,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -10910,21 +11173,21 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 43 /* PlusPlusToken */ || operator === 44 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0 /* Read */; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && parent.parent.kind === 211 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && parent.parent.kind === 214 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function compareDataObjects(dst, src) { @@ -11021,6 +11284,14 @@ var ts; return checker.getSignaturesOfType(type, 0 /* Call */).length !== 0 || checker.getSignaturesOfType(type, 1 /* Construct */).length !== 0; } ts.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures; + function forSomeAncestorDirectory(directory, callback) { + return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); + } + ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -11227,8 +11498,8 @@ var ts; // // { // oldStart3: Min(oldStart1, oldStart2), - // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), - // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) + // oldEnd3: Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), + // newEnd3: Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) // } var oldStart1 = oldStartN; var oldEnd1 = oldEndN; @@ -11244,9 +11515,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146 /* TypeParameter */) { + if (d && d.kind === 147 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234 /* InterfaceDeclaration */) { return current; } } @@ -11254,7 +11525,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 153 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 154 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11272,7 +11543,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -11280,14 +11551,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -11303,14 +11574,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -11446,18 +11717,17 @@ var ts; } // Covers remaining cases switch (hostNode.kind) { - case 209 /* VariableStatement */: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212 /* VariableStatement */: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: var expr = hostNode.expression; switch (expr.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return expr.name; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -11466,10 +11736,10 @@ var ts; return undefined; case 1 /* EndOfFileToken */: return undefined; - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 223 /* LabeledStatement */: { + case 226 /* LabeledStatement */: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11494,15 +11764,15 @@ var ts; switch (declaration.kind) { case 71 /* Identifier */: return declaration; - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: { + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { return name.right; } break; } - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1 /* ExportsProperty */: @@ -11514,9 +11784,9 @@ var ts; return undefined; } } - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 244 /* ExportAssignment */: { + case 247 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -11553,33 +11823,33 @@ var ts; * for example on a variable declaration whose initializer is a function expression. */ function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284 /* JSDocParameterTag */); + return !!getFirstJSDocTag(node, 287 /* JSDocParameterTag */); } ts.hasJSDocParameterTags = hasJSDocParameterTags; /** Gets the JSDoc augments tag for the node if present */ function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 285 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; /** Gets the JSDoc class tag for the node if present */ function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283 /* JSDocClassTag */); + return getFirstJSDocTag(node, 286 /* JSDocClassTag */); } ts.getJSDocClassTag = getJSDocClassTag; /** Gets the JSDoc return tag for the node if present */ function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 288 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; /** Gets the JSDoc template tag for the node if present */ function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 290 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; /** Gets the JSDoc type tag for the node if present and valid */ function getJSDocTypeTag(node) { // We should have already issued an error if there were multiple type jsdocs, so just use the first one. - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -11598,8 +11868,8 @@ var ts; * tag directly on the node would be returned. */ function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); - if (!tag && node.kind === 147 /* Parameter */) { + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); + if (!tag && node.kind === 148 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -11683,608 +11953,616 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 144 /* QualifiedName */; + return node.kind === 145 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145 /* ComputedPropertyName */; + return node.kind === 146 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 146 /* TypeParameter */; + return node.kind === 147 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147 /* Parameter */; + return node.kind === 148 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 149 /* PropertySignature */; + return node.kind === 150 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150 /* PropertyDeclaration */; + return node.kind === 151 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151 /* MethodSignature */; + return node.kind === 152 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153 /* Constructor */; + return node.kind === 154 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156 /* CallSignature */; + return node.kind === 157 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157 /* ConstructSignature */; + return node.kind === 158 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158 /* IndexSignature */; + return node.kind === 159 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 159 /* TypePredicate */; + return node.kind === 160 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160 /* TypeReference */; + return node.kind === 161 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161 /* FunctionType */; + return node.kind === 162 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162 /* ConstructorType */; + return node.kind === 163 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163 /* TypeQuery */; + return node.kind === 164 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164 /* TypeLiteral */; + return node.kind === 165 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165 /* ArrayType */; + return node.kind === 166 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166 /* TupleType */; + return node.kind === 167 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167 /* UnionType */; + return node.kind === 168 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168 /* IntersectionType */; + return node.kind === 169 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170 /* ConditionalType */; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171 /* InferType */; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169 /* ParenthesizedType */; + return node.kind === 172 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170 /* ThisType */; + return node.kind === 173 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171 /* TypeOperator */; + return node.kind === 174 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172 /* IndexedAccessType */; + return node.kind === 175 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173 /* MappedType */; + return node.kind === 176 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174 /* LiteralType */; + return node.kind === 177 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 175 /* ObjectBindingPattern */; + return node.kind === 178 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176 /* ArrayBindingPattern */; + return node.kind === 179 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177 /* BindingElement */; + return node.kind === 180 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 178 /* ArrayLiteralExpression */; + return node.kind === 181 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179 /* ObjectLiteralExpression */; + return node.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180 /* PropertyAccessExpression */; + return node.kind === 183 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181 /* ElementAccessExpression */; + return node.kind === 184 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182 /* CallExpression */; + return node.kind === 185 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183 /* NewExpression */; + return node.kind === 186 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184 /* TaggedTemplateExpression */; + return node.kind === 187 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185 /* TypeAssertionExpression */; + return node.kind === 188 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186 /* ParenthesizedExpression */; + return node.kind === 189 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292 /* PartiallyEmittedExpression */) { + while (node.kind === 295 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187 /* FunctionExpression */; + return node.kind === 190 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188 /* ArrowFunction */; + return node.kind === 191 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189 /* DeleteExpression */; + return node.kind === 192 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 193 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191 /* VoidExpression */; + return node.kind === 194 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 195 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193 /* PrefixUnaryExpression */; + return node.kind === 196 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194 /* PostfixUnaryExpression */; + return node.kind === 197 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195 /* BinaryExpression */; + return node.kind === 198 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196 /* ConditionalExpression */; + return node.kind === 199 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197 /* TemplateExpression */; + return node.kind === 200 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198 /* YieldExpression */; + return node.kind === 201 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199 /* SpreadElement */; + return node.kind === 202 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200 /* ClassExpression */; + return node.kind === 203 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201 /* OmittedExpression */; + return node.kind === 204 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */; + return node.kind === 205 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203 /* AsExpression */; + return node.kind === 206 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204 /* NonNullExpression */; + return node.kind === 207 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205 /* MetaProperty */; + return node.kind === 208 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 206 /* TemplateSpan */; + return node.kind === 209 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207 /* SemicolonClassElement */; + return node.kind === 210 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 208 /* Block */; + return node.kind === 211 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209 /* VariableStatement */; + return node.kind === 212 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210 /* EmptyStatement */; + return node.kind === 213 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211 /* ExpressionStatement */; + return node.kind === 214 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212 /* IfStatement */; + return node.kind === 215 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213 /* DoStatement */; + return node.kind === 216 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214 /* WhileStatement */; + return node.kind === 217 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215 /* ForStatement */; + return node.kind === 218 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216 /* ForInStatement */; + return node.kind === 219 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217 /* ForOfStatement */; + return node.kind === 220 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218 /* ContinueStatement */; + return node.kind === 221 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219 /* BreakStatement */; + return node.kind === 222 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */; + return node.kind === 222 /* BreakStatement */ || node.kind === 221 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220 /* ReturnStatement */; + return node.kind === 223 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221 /* WithStatement */; + return node.kind === 224 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222 /* SwitchStatement */; + return node.kind === 225 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223 /* LabeledStatement */; + return node.kind === 226 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224 /* ThrowStatement */; + return node.kind === 227 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225 /* TryStatement */; + return node.kind === 228 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226 /* DebuggerStatement */; + return node.kind === 229 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227 /* VariableDeclaration */; + return node.kind === 230 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228 /* VariableDeclarationList */; + return node.kind === 231 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229 /* FunctionDeclaration */; + return node.kind === 232 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230 /* ClassDeclaration */; + return node.kind === 233 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231 /* InterfaceDeclaration */; + return node.kind === 234 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232 /* TypeAliasDeclaration */; + return node.kind === 235 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */; + return node.kind === 236 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */; + return node.kind === 237 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235 /* ModuleBlock */; + return node.kind === 238 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236 /* CaseBlock */; + return node.kind === 239 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237 /* NamespaceExportDeclaration */; + return node.kind === 240 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */; + return node.kind === 241 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239 /* ImportDeclaration */; + return node.kind === 242 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240 /* ImportClause */; + return node.kind === 243 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241 /* NamespaceImport */; + return node.kind === 244 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242 /* NamedImports */; + return node.kind === 245 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243 /* ImportSpecifier */; + return node.kind === 246 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244 /* ExportAssignment */; + return node.kind === 247 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245 /* ExportDeclaration */; + return node.kind === 248 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246 /* NamedExports */; + return node.kind === 249 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247 /* ExportSpecifier */; + return node.kind === 250 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248 /* MissingDeclaration */; + return node.kind === 251 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 249 /* ExternalModuleReference */; + return node.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 250 /* JsxElement */; + return node.kind === 253 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251 /* JsxSelfClosingElement */; + return node.kind === 254 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252 /* JsxOpeningElement */; + return node.kind === 255 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253 /* JsxClosingElement */; + return node.kind === 256 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254 /* JsxFragment */; + return node.kind === 257 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255 /* JsxOpeningFragment */; + return node.kind === 258 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256 /* JsxClosingFragment */; + return node.kind === 259 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257 /* JsxAttribute */; + return node.kind === 260 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258 /* JsxAttributes */; + return node.kind === 261 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259 /* JsxSpreadAttribute */; + return node.kind === 262 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260 /* JsxExpression */; + return node.kind === 263 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 261 /* CaseClause */; + return node.kind === 264 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262 /* DefaultClause */; + return node.kind === 265 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263 /* HeritageClause */; + return node.kind === 266 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264 /* CatchClause */; + return node.kind === 267 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 265 /* PropertyAssignment */; + return node.kind === 268 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266 /* ShorthandPropertyAssignment */; + return node.kind === 269 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267 /* SpreadAssignment */; + return node.kind === 270 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 269 /* SourceFile */; + return node.kind === 272 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270 /* Bundle */; + return node.kind === 273 /* Bundle */; } ts.isBundle = isBundle; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 271 /* JSDocTypeExpression */; + return node.kind === 274 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272 /* JSDocAllType */; + return node.kind === 275 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273 /* JSDocUnknownType */; + return node.kind === 276 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274 /* JSDocNullableType */; + return node.kind === 277 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275 /* JSDocNonNullableType */; + return node.kind === 278 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276 /* JSDocOptionalType */; + return node.kind === 279 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277 /* JSDocFunctionType */; + return node.kind === 280 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278 /* JSDocVariadicType */; + return node.kind === 281 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279 /* JSDocComment */; + return node.kind === 282 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282 /* JSDocAugmentsTag */; + return node.kind === 285 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284 /* JSDocParameterTag */; + return node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285 /* JSDocReturnTag */; + return node.kind === 288 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286 /* JSDocTypeTag */; + return node.kind === 289 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287 /* JSDocTemplateTag */; + return node.kind === 290 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288 /* JSDocTypedefTag */; + return node.kind === 291 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289 /* JSDocPropertyTag */; + return node.kind === 292 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 /* JSDocPropertyTag */ || node.kind === 284 /* JSDocParameterTag */; + return node.kind === 292 /* JSDocPropertyTag */ || node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280 /* JSDocTypeLiteral */; + return node.kind === 283 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); @@ -12295,7 +12573,7 @@ var ts; (function (ts) { /* @internal */ function isSyntaxList(n) { - return n.kind === 290 /* SyntaxList */; + return n.kind === 293 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -12305,15 +12583,16 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 144 /* FirstNode */; + return kind >= 145 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 143 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 144 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12352,7 +12631,7 @@ var ts; /* @internal */ function isGeneratedIdentifier(node) { // Using `>` here catches both `GeneratedIdentifierKind.None` and `undefined`. - return ts.isIdentifier(node) && node.autoGenerateKind > 0 /* None */; + return ts.isIdentifier(node) && (node.autoGenerateFlags & 7 /* KindMask */) > 0 /* None */; } ts.isGeneratedIdentifier = isGeneratedIdentifier; // Keywords @@ -12368,7 +12647,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 115 /* StaticKeyword */: return true; } @@ -12381,7 +12660,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 /* QualifiedName */ + return kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12390,14 +12669,14 @@ var ts; return kind === 71 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 145 /* ComputedPropertyName */; + || kind === 146 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 175 /* ObjectBindingPattern */ - || kind === 176 /* ArrayBindingPattern */; + || kind === 178 /* ObjectBindingPattern */ + || kind === 179 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12412,13 +12691,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: return false; @@ -12427,13 +12706,13 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12448,68 +12727,80 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 150 /* PropertyDeclaration */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 158 /* IndexSignature */ - || kind === 207 /* SemicolonClassElement */ - || kind === 248 /* MissingDeclaration */; + return kind === 154 /* Constructor */ + || kind === 151 /* PropertyDeclaration */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 159 /* IndexSignature */ + || kind === 210 /* SemicolonClassElement */ + || kind === 251 /* MissingDeclaration */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */); + return node && (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */); + return node && (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */); } ts.isAccessor = isAccessor; + /* @internal */ + function isMethodOrAccessor(node) { + switch (node.kind) { + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return true; + default: + return false; + } + } + ts.isMethodOrAccessor = isMethodOrAccessor; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 157 /* ConstructSignature */ - || kind === 156 /* CallSignature */ - || kind === 149 /* PropertySignature */ - || kind === 151 /* MethodSignature */ - || kind === 158 /* IndexSignature */ - || kind === 248 /* MissingDeclaration */; + return kind === 158 /* ConstructSignature */ + || kind === 157 /* CallSignature */ + || kind === 150 /* PropertySignature */ + || kind === 152 /* MethodSignature */ + || kind === 159 /* IndexSignature */ + || kind === 251 /* MissingDeclaration */; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 /* PropertyAssignment */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 267 /* SpreadAssignment */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 248 /* MissingDeclaration */; + return kind === 268 /* PropertyAssignment */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 270 /* SpreadAssignment */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 251 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) + return (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) || kind === 119 /* AnyKeyword */ - || kind === 133 /* NumberKeyword */ - || kind === 134 /* ObjectKeyword */ + || kind === 134 /* NumberKeyword */ + || kind === 135 /* ObjectKeyword */ || kind === 122 /* BooleanKeyword */ - || kind === 136 /* StringKeyword */ - || kind === 137 /* SymbolKeyword */ + || kind === 137 /* StringKeyword */ + || kind === 138 /* SymbolKeyword */ || kind === 99 /* ThisKeyword */ || kind === 105 /* VoidKeyword */ - || kind === 139 /* UndefinedKeyword */ + || kind === 140 /* UndefinedKeyword */ || kind === 95 /* NullKeyword */ - || kind === 130 /* NeverKeyword */ - || kind === 202 /* ExpressionWithTypeArguments */ - || kind === 272 /* JSDocAllType */ - || kind === 273 /* JSDocUnknownType */ - || kind === 274 /* JSDocNullableType */ - || kind === 275 /* JSDocNonNullableType */ - || kind === 276 /* JSDocOptionalType */ - || kind === 277 /* JSDocFunctionType */ - || kind === 278 /* JSDocVariadicType */; + || kind === 131 /* NeverKeyword */ + || kind === 205 /* ExpressionWithTypeArguments */ + || kind === 275 /* JSDocAllType */ + || kind === 276 /* JSDocUnknownType */ + || kind === 277 /* JSDocNullableType */ + || kind === 278 /* JSDocNonNullableType */ + || kind === 279 /* JSDocOptionalType */ + || kind === 280 /* JSDocFunctionType */ + || kind === 281 /* JSDocVariadicType */; } /** * Node test that determines whether a node is a valid type node. @@ -12522,8 +12813,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return true; } return false; @@ -12534,8 +12825,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 /* ArrayBindingPattern */ - || kind === 175 /* ObjectBindingPattern */; + return kind === 179 /* ArrayBindingPattern */ + || kind === 178 /* ObjectBindingPattern */; } return false; } @@ -12543,15 +12834,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 /* ArrayLiteralExpression */ - || kind === 179 /* ObjectLiteralExpression */; + return kind === 181 /* ArrayLiteralExpression */ + || kind === 182 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 /* BindingElement */ - || kind === 201 /* OmittedExpression */; + return kind === 180 /* BindingElement */ + || kind === 204 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12560,9 +12851,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 180 /* BindingElement */: return true; } return false; @@ -12583,8 +12874,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return true; } return false; @@ -12596,8 +12887,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return true; } return false; @@ -12606,18 +12897,18 @@ var ts; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 /* PropertyAccessExpression */ - || kind === 144 /* QualifiedName */; + return kind === 183 /* PropertyAccessExpression */ + || kind === 145 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 148 /* Decorator */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 149 /* Decorator */: return true; default: return false; @@ -12625,12 +12916,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 /* CallExpression */ || node.kind === 183 /* NewExpression */; + return node.kind === 185 /* CallExpression */ || node.kind === 186 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 /* TemplateExpression */ + return kind === 200 /* TemplateExpression */ || kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12641,32 +12932,32 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 183 /* NewExpression */: - case 182 /* CallExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 184 /* TaggedTemplateExpression */: - case 178 /* ArrayLiteralExpression */: - case 186 /* ParenthesizedExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 187 /* FunctionExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 186 /* NewExpression */: + case 185 /* CallExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 187 /* TaggedTemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 189 /* ParenthesizedExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 190 /* FunctionExpression */: case 71 /* Identifier */: case 12 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 101 /* TrueKeyword */: case 97 /* SuperKeyword */: - case 204 /* NonNullExpression */: - case 205 /* MetaProperty */: + case 207 /* NonNullExpression */: + case 208 /* MetaProperty */: case 91 /* ImportKeyword */:// technically this is only an Expression if it's in a CallExpression return true; default: @@ -12680,13 +12971,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 185 /* TypeAssertionExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 188 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12695,9 +12986,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; default: @@ -12716,15 +13007,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: - case 188 /* ArrowFunction */: - case 195 /* BinaryExpression */: - case 199 /* SpreadElement */: - case 203 /* AsExpression */: - case 201 /* OmittedExpression */: - case 293 /* CommaListExpression */: - case 292 /* PartiallyEmittedExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: + case 191 /* ArrowFunction */: + case 198 /* BinaryExpression */: + case 202 /* SpreadElement */: + case 206 /* AsExpression */: + case 204 /* OmittedExpression */: + case 296 /* CommaListExpression */: + case 295 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12732,18 +13023,18 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 /* TypeAssertionExpression */ - || kind === 203 /* AsExpression */; + return kind === 188 /* TypeAssertionExpression */ + || kind === 206 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 292 /* PartiallyEmittedExpression */; + return node.kind === 295 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 291 /* NotEmittedStatement */; + return node.kind === 294 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ @@ -12755,13 +13046,13 @@ var ts; // Statement function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return true; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12769,7 +13060,7 @@ var ts; ts.isIterationStatement = isIterationStatement; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 216 /* ForInStatement */ || node.kind === 217 /* ForOfStatement */; + return node.kind === 219 /* ForInStatement */ || node.kind === 220 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12793,111 +13084,111 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */ + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */ || kind === 71 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */; + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 234 /* ModuleDeclaration */; + || kind === 237 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 /* NamedImports */ - || kind === 241 /* NamespaceImport */; + return kind === 245 /* NamedImports */ + || kind === 244 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ || node.kind === 233 /* EnumDeclaration */; + return node.kind === 237 /* ModuleDeclaration */ || node.kind === 236 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 /* ArrowFunction */ - || kind === 177 /* BindingElement */ - || kind === 230 /* ClassDeclaration */ - || kind === 200 /* ClassExpression */ - || kind === 153 /* Constructor */ - || kind === 233 /* EnumDeclaration */ - || kind === 268 /* EnumMember */ - || kind === 247 /* ExportSpecifier */ - || kind === 229 /* FunctionDeclaration */ - || kind === 187 /* FunctionExpression */ - || kind === 154 /* GetAccessor */ - || kind === 240 /* ImportClause */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 243 /* ImportSpecifier */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 257 /* JsxAttribute */ - || kind === 152 /* MethodDeclaration */ - || kind === 151 /* MethodSignature */ - || kind === 234 /* ModuleDeclaration */ - || kind === 237 /* NamespaceExportDeclaration */ - || kind === 241 /* NamespaceImport */ - || kind === 147 /* Parameter */ - || kind === 265 /* PropertyAssignment */ - || kind === 150 /* PropertyDeclaration */ - || kind === 149 /* PropertySignature */ - || kind === 155 /* SetAccessor */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 146 /* TypeParameter */ - || kind === 227 /* VariableDeclaration */ - || kind === 288 /* JSDocTypedefTag */; + return kind === 191 /* ArrowFunction */ + || kind === 180 /* BindingElement */ + || kind === 233 /* ClassDeclaration */ + || kind === 203 /* ClassExpression */ + || kind === 154 /* Constructor */ + || kind === 236 /* EnumDeclaration */ + || kind === 271 /* EnumMember */ + || kind === 250 /* ExportSpecifier */ + || kind === 232 /* FunctionDeclaration */ + || kind === 190 /* FunctionExpression */ + || kind === 155 /* GetAccessor */ + || kind === 243 /* ImportClause */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 246 /* ImportSpecifier */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 260 /* JsxAttribute */ + || kind === 153 /* MethodDeclaration */ + || kind === 152 /* MethodSignature */ + || kind === 237 /* ModuleDeclaration */ + || kind === 240 /* NamespaceExportDeclaration */ + || kind === 244 /* NamespaceImport */ + || kind === 148 /* Parameter */ + || kind === 268 /* PropertyAssignment */ + || kind === 151 /* PropertyDeclaration */ + || kind === 150 /* PropertySignature */ + || kind === 156 /* SetAccessor */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 147 /* TypeParameter */ + || kind === 230 /* VariableDeclaration */ + || kind === 291 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 229 /* FunctionDeclaration */ - || kind === 248 /* MissingDeclaration */ - || kind === 230 /* ClassDeclaration */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 233 /* EnumDeclaration */ - || kind === 234 /* ModuleDeclaration */ - || kind === 239 /* ImportDeclaration */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 245 /* ExportDeclaration */ - || kind === 244 /* ExportAssignment */ - || kind === 237 /* NamespaceExportDeclaration */; + return kind === 232 /* FunctionDeclaration */ + || kind === 251 /* MissingDeclaration */ + || kind === 233 /* ClassDeclaration */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 236 /* EnumDeclaration */ + || kind === 237 /* ModuleDeclaration */ + || kind === 242 /* ImportDeclaration */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 248 /* ExportDeclaration */ + || kind === 247 /* ExportAssignment */ + || kind === 240 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 /* BreakStatement */ - || kind === 218 /* ContinueStatement */ - || kind === 226 /* DebuggerStatement */ - || kind === 213 /* DoStatement */ - || kind === 211 /* ExpressionStatement */ - || kind === 210 /* EmptyStatement */ - || kind === 216 /* ForInStatement */ - || kind === 217 /* ForOfStatement */ - || kind === 215 /* ForStatement */ - || kind === 212 /* IfStatement */ - || kind === 223 /* LabeledStatement */ - || kind === 220 /* ReturnStatement */ - || kind === 222 /* SwitchStatement */ - || kind === 224 /* ThrowStatement */ - || kind === 225 /* TryStatement */ - || kind === 209 /* VariableStatement */ - || kind === 214 /* WhileStatement */ - || kind === 221 /* WithStatement */ - || kind === 291 /* NotEmittedStatement */ - || kind === 295 /* EndOfDeclarationMarker */ - || kind === 294 /* MergeDeclarationMarker */; + return kind === 222 /* BreakStatement */ + || kind === 221 /* ContinueStatement */ + || kind === 229 /* DebuggerStatement */ + || kind === 216 /* DoStatement */ + || kind === 214 /* ExpressionStatement */ + || kind === 213 /* EmptyStatement */ + || kind === 219 /* ForInStatement */ + || kind === 220 /* ForOfStatement */ + || kind === 218 /* ForStatement */ + || kind === 215 /* IfStatement */ + || kind === 226 /* LabeledStatement */ + || kind === 223 /* ReturnStatement */ + || kind === 225 /* SwitchStatement */ + || kind === 227 /* ThrowStatement */ + || kind === 228 /* TryStatement */ + || kind === 212 /* VariableStatement */ + || kind === 217 /* WhileStatement */ + || kind === 224 /* WithStatement */ + || kind === 294 /* NotEmittedStatement */ + || kind === 298 /* EndOfDeclarationMarker */ + || kind === 297 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 146 /* TypeParameter */) { - return node.parent.kind !== 287 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); + if (node.kind === 147 /* TypeParameter */) { + return node.parent.kind !== 290 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -12924,10 +13215,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208 /* Block */) + if (node.kind !== 211 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 /* TryStatement */ || node.parent.kind === 264 /* CatchClause */) { + if (node.parent.kind === 228 /* TryStatement */ || node.parent.kind === 267 /* CatchClause */) { return false; } } @@ -12937,8 +13228,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 249 /* ExternalModuleReference */ - || kind === 144 /* QualifiedName */ + return kind === 252 /* ExternalModuleReference */ + || kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -12948,70 +13239,70 @@ var ts; var kind = node.kind; return kind === 99 /* ThisKeyword */ || kind === 71 /* Identifier */ - || kind === 180 /* PropertyAccessExpression */; + || kind === 183 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 250 /* JsxElement */ - || kind === 260 /* JsxExpression */ - || kind === 251 /* JsxSelfClosingElement */ + return kind === 253 /* JsxElement */ + || kind === 263 /* JsxExpression */ + || kind === 254 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */ - || kind === 254 /* JsxFragment */; + || kind === 257 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 /* JsxAttribute */ - || kind === 259 /* JsxSpreadAttribute */; + return kind === 260 /* JsxAttribute */ + || kind === 262 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 260 /* JsxExpression */; + || kind === 263 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 /* JsxOpeningElement */ - || kind === 251 /* JsxSelfClosingElement */; + return kind === 255 /* JsxOpeningElement */ + || kind === 254 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 /* CaseClause */ - || kind === 262 /* DefaultClause */; + return kind === 264 /* CaseClause */ + || kind === 265 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 271 /* FirstJSDocNode */ && node.kind <= 289 /* LastJSDocNode */; + return node.kind >= 274 /* FirstJSDocNode */ && node.kind <= 292 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 279 /* JSDocComment */ || isJSDocTag(node); + return node.kind === 282 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 281 /* FirstJSDocTagNode */ && node.kind <= 289 /* LastJSDocTagNode */; + return node.kind >= 284 /* FirstJSDocTagNode */ && node.kind <= 292 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13020,6 +13311,48 @@ var ts; return !!node.jsDoc && node.jsDoc.length > 0; } ts.hasJSDocNodes = hasJSDocNodes; + /** True if has type node attached to it. */ + /* @internal */ + function hasType(node) { + return !!node.type; + } + ts.hasType = hasType; + /** True if has initializer node attached to it. */ + /* @internal */ + function hasInitializer(node) { + return !!node.initializer; + } + ts.hasInitializer = hasInitializer; + /** True if has initializer node attached to it. */ + /* @internal */ + function hasOnlyExpressionInitializer(node) { + return hasInitializer(node) && !ts.isForStatement(node) && !ts.isForInStatement(node) && !ts.isForOfStatement(node) && !ts.isJsxAttribute(node); + } + ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; + function isObjectLiteralElement(node) { + switch (node.kind) { + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return true; + default: + return false; + } + } + ts.isObjectLiteralElement = isObjectLiteralElement; + /* @internal */ + function isTypeReferenceType(node) { + return node.kind === 161 /* TypeReference */ || node.kind === 205 /* ExpressionWithTypeArguments */; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); /// /// @@ -13042,7 +13375,7 @@ var ts; var SourceFileConstructor; // tslint:enable variable-name function createNode(kind, pos, end) { - if (kind === 269 /* SourceFile */) { + if (kind === 272 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71 /* Identifier */) { @@ -13087,60 +13420,88 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143 /* LastToken */) { + if (!node || node.kind <= 144 /* LastToken */) { return; } switch (node.kind) { - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: + case 148 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 151 /* PropertyDeclaration */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 150 /* PropertySignature */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 268 /* PropertyAssignment */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.initializer); + case 230 /* VariableDeclaration */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.exclamationToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 180 /* BindingElement */: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13151,291 +13512,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 166 /* TupleType */: + case 167 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 169 /* ParenthesizedType */: - case 171 /* TypeOperator */: + case 170 /* ConditionalType */: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); + case 171 /* InferType */: + return visitNode(cbNode, node.typeParameter); + case 172 /* ParenthesizedType */: + case 174 /* TypeOperator */: return visitNode(cbNode, node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173 /* MappedType */: + case 176 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return visitNode(cbNode, node.literal); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitNode(cbNode, node.name); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return visitNode(cbNode, node.label); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148 /* Decorator */: + case 149 /* Decorator */: return visitNode(cbNode, node.expression); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -13444,17 +13812,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return visitNode(cbNode, node.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return visitNodes(cbNode, cbNodes, node.typeParameters); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: if (node.typeExpression && - node.typeExpression.kind === 271 /* JSDocTypeExpression */) { + node.typeExpression.kind === 274 /* JSDocTypeExpression */) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -13462,7 +13830,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280 /* JSDocTypeLiteral */: + case 283 /* JSDocTypeLiteral */: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -13470,7 +13838,7 @@ var ts; } } return; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -13572,7 +13940,7 @@ var ts; // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost // all nodes would need extra state on them to store this info. // - // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 + // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 // grammar specification. // // An important thing about these context concepts. By default they are effectively inherited @@ -13668,7 +14036,7 @@ var ts; else if (token() === 17 /* OpenBraceToken */ || lookAhead(function () { return token() === 9 /* StringLiteral */; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token); } else { parseExpected(17 /* OpenBraceToken */); @@ -13750,15 +14118,7 @@ var ts; if (comments) { for (var _i = 0, comments_2 = comments; _i < comments_2.length; _i++) { var comment = comments_2[_i]; - var jsDoc = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDoc) { - if (!node.jsDoc) { - node.jsDoc = [jsDoc]; - } - else { - node.jsDoc.push(jsDoc); - } - } + node.jsDoc = ts.append(node.jsDoc, JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); } } return node; @@ -13796,7 +14156,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(269 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(272 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14042,9 +14402,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -14180,7 +14540,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(145 /* ComputedPropertyName */); + var node = createNode(146 /* ComputedPropertyName */); parseExpected(21 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -14295,9 +14655,13 @@ var ts; return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isIdentifierOrPattern(); case 18 /* TypeParameters */: return isIdentifier(); - case 11 /* ArgumentExpressions */: case 15 /* ArrayLiteralMembers */: - return token() === 26 /* CommaToken */ || token() === 24 /* DotDotDotToken */ || isStartOfExpression(); + if (token() === 26 /* CommaToken */) { + return true; + } + // falls through + case 11 /* ArgumentExpressions */: + return token() === 24 /* DotDotDotToken */ || isStartOfExpression(); case 16 /* Parameters */: return isStartOfParameter(); case 19 /* TypeArguments */: @@ -14317,7 +14681,7 @@ var ts; function isValidHeritageClauseObjectLiteral() { ts.Debug.assert(token() === 17 /* OpenBraceToken */); if (nextToken() === 18 /* CloseBraceToken */) { - // if we see "extends {}" then only treat the {} as what we're extending (and not + // if we see "extends {}" then only treat the {} as what we're extending (and not // the class body) if we have: // // extends {} { @@ -14352,6 +14716,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } // True if positioned at a list terminator function isListTerminator(kind) { if (token() === 1 /* EndOfFileToken */) { @@ -14401,7 +14769,7 @@ var ts; } function isVariableDeclaratorListTerminator() { // If we can consume a semicolon (either explicitly, or with ASI), then consider us done - // with parsing the list of variable declarators. + // with parsing the list of variable declarators. if (canParseSemicolon()) { return true; } @@ -14506,6 +14874,10 @@ var ts; if (!canReuseNode(node, parsingContext)) { return undefined; } + if (node.jsDocCache) { + // jsDocCache may include tags from parent nodes, which might have been modified. + node.jsDocCache = undefined; + } return node; } function consumeNode(node) { @@ -14579,14 +14951,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153 /* Constructor */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 150 /* PropertyDeclaration */: - case 207 /* SemicolonClassElement */: + case 154 /* Constructor */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 210 /* SemicolonClassElement */: return true; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -14601,8 +14973,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: return true; } } @@ -14611,58 +14983,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 209 /* VariableStatement */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 211 /* ExpressionStatement */: - case 224 /* ThrowStatement */: - case 220 /* ReturnStatement */: - case 222 /* SwitchStatement */: - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 210 /* EmptyStatement */: - case 225 /* TryStatement */: - case 223 /* LabeledStatement */: - case 213 /* DoStatement */: - case 226 /* DebuggerStatement */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 212 /* VariableStatement */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 214 /* ExpressionStatement */: + case 227 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 225 /* SwitchStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 213 /* EmptyStatement */: + case 228 /* TryStatement */: + case 226 /* LabeledStatement */: + case 216 /* DoStatement */: + case 229 /* DebuggerStatement */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 149 /* PropertySignature */: - case 156 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 150 /* PropertySignature */: + case 157 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227 /* VariableDeclaration */) { + if (node.kind !== 230 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -14683,7 +15055,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147 /* Parameter */) { + if (node.kind !== 148 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -14812,7 +15184,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144 /* QualifiedName */, entity.pos); + var node = createNode(145 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -14849,7 +15221,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197 /* TemplateExpression */); + var template = createNode(200 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -14861,7 +15233,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206 /* TemplateSpan */); + var span = createNode(209 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18 /* CloseBraceToken */) { @@ -14869,7 +15241,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); + literal = parseExpectedToken(16 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -14904,7 +15276,7 @@ var ts; // We also do not need to check for negatives because any prefix operator would be part of a // parent unary expression. if (node.kind === 8 /* NumericLiteral */) { - node.numericLiteralFlags = scanner.getTokenFlags() & 496 /* NumericLiteralFlags */; + node.numericLiteralFlags = scanner.getTokenFlags() & 1008 /* NumericLiteralFlags */; } nextToken(); finishNode(node); @@ -14912,7 +15284,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */); @@ -14921,18 +15293,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159 /* TypePredicate */, lhs.pos); + var node = createNode(160 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170 /* ThisType */); + var node = createNode(173 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272 /* JSDocAllType */); + var result = createNode(275 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -14955,28 +15327,28 @@ var ts; token() === 29 /* GreaterThanToken */ || token() === 58 /* EqualsToken */ || token() === 49 /* BarToken */) { - var result = createNode(273 /* JSDocUnknownType */, pos); + var result = createNode(276 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(274 /* JSDocNullableType */, pos); + var result = createNode(277 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(280 /* JSDocFunctionType */); nextToken(); fillSignature(56 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147 /* Parameter */); + var parameter = createNode(148 /* Parameter */); if (token() === 99 /* ThisKeyword */ || token() === 94 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(56 /* ColonToken */); @@ -14991,13 +15363,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163 /* TypeQuery */); + var node = createNode(164 /* TypeQuery */); parseExpected(103 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(85 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -15014,7 +15386,7 @@ var ts; // // // - // We do *not* want to consume the > as we're consuming the expression for "". + // We do *not* want to consume the `>` as we're consuming the expression for "". node.expression = parseUnaryExpressionOrHigher(); } } @@ -15042,7 +15414,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ true); } function parseParameter() { - var node = createNodeWithJSDoc(147 /* Parameter */); + var node = createNodeWithJSDoc(148 /* Parameter */); if (token() === 99 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -15141,7 +15513,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157 /* ConstructSignature */) { + if (kind === 158 /* ConstructSignature */) { parseExpected(94 /* NewKeyword */); } fillSignature(56 /* ColonToken */, 4 /* Type */, node); @@ -15202,7 +15574,7 @@ var ts; return token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 22 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 158 /* IndexSignature */; + node.kind = 159 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -15212,13 +15584,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55 /* QuestionToken */); if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - node.kind = 151 /* MethodSignature */; + node.kind = 152 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(56 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 149 /* PropertySignature */; + node.kind = 150 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 58 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -15264,10 +15636,10 @@ var ts; } function parseTypeMember() { if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - return parseSignatureMember(156 /* CallSignature */); + return parseSignatureMember(157 /* CallSignature */); } if (token() === 94 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157 /* ConstructSignature */); + return parseSignatureMember(158 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -15281,7 +15653,7 @@ var ts; return token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(164 /* TypeLiteral */); + var node = createNode(165 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -15298,38 +15670,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131 /* ReadonlyKeyword */) { + if (token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + return nextToken() === 132 /* ReadonlyKeyword */; + } + if (token() === 132 /* ReadonlyKeyword */) { nextToken(); } return token() === 21 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 92 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(92 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173 /* MappedType */); + var node = createNode(176 /* MappedType */); parseExpected(17 /* OpenBraceToken */); - node.readonlyToken = parseOptionalToken(131 /* ReadonlyKeyword */); + if (token() === 132 /* ReadonlyKeyword */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + parseExpectedToken(132 /* ReadonlyKeyword */); + } + } parseExpected(21 /* OpenBracketToken */); node.typeParameter = parseMappedTypeParameter(); parseExpected(22 /* CloseBracketToken */); - node.questionToken = parseOptionalToken(55 /* QuestionToken */); + if (token() === 55 /* QuestionToken */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + parseExpectedToken(55 /* QuestionToken */); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseTupleType() { - var node = createNode(166 /* TupleType */); + var node = createNode(167 /* TupleType */); node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169 /* ParenthesizedType */); + var node = createNode(172 /* ParenthesizedType */); parseExpected(19 /* OpenParenToken */); node.type = parseType(); parseExpected(20 /* CloseParenToken */); @@ -15337,7 +15722,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162 /* ConstructorType */) { + if (kind === 163 /* ConstructorType */) { parseExpected(94 /* NewKeyword */); } fillSignature(36 /* EqualsGreaterThanToken */, 4 /* Type */, node); @@ -15348,10 +15733,10 @@ var ts; return token() === 23 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174 /* LiteralType */); + var node = createNode(177 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(196 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 38 /* MinusToken */; nextToken(); } @@ -15372,13 +15757,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 137 /* SymbolKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 138 /* SymbolKeyword */: case 122 /* BooleanKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39 /* AsteriskToken */: @@ -15388,7 +15773,7 @@ var ts; case 89 /* FunctionKeyword */: return parseJSDocFunctionType(); case 51 /* ExclamationToken */: - return parseJSDocNodeWithType(275 /* JSDocNonNullableType */); + return parseJSDocNodeWithType(278 /* JSDocNonNullableType */); case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -15402,7 +15787,7 @@ var ts; return parseTokenNode(); case 99 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -15424,17 +15809,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 140 /* UniqueKeyword */: + case 138 /* SymbolKeyword */: + case 141 /* UniqueKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 103 /* TypeOfKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: case 17 /* OpenBraceToken */: case 21 /* OpenBracketToken */: case 27 /* LessThanToken */: @@ -15445,11 +15830,12 @@ var ts; case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: case 39 /* AsteriskToken */: case 55 /* QuestionToken */: case 51 /* ExclamationToken */: case 24 /* DotDotDotToken */: + case 126 /* InferKeyword */: return true; case 38 /* MinusToken */: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -15474,25 +15860,29 @@ var ts; if (!(contextFlags & 1048576 /* JSDoc */)) { return type; } - type = createJSDocPostfixType(276 /* JSDocOptionalType */, type); + type = createJSDocPostfixType(279 /* JSDocOptionalType */, type); break; case 51 /* ExclamationToken */: - type = createJSDocPostfixType(275 /* JSDocNonNullableType */, type); + type = createJSDocPostfixType(278 /* JSDocNonNullableType */, type); break; case 55 /* QuestionToken */: - type = createJSDocPostfixType(274 /* JSDocNullableType */, type); + // If not in JSDoc and next token is start of a type we have a conditional type + if (!(contextFlags & 1048576 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277 /* JSDocNullableType */, type); break; case 21 /* OpenBracketToken */: parseExpected(21 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(172 /* IndexedAccessType */, type.pos); + var node = createNode(175 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(165 /* ArrayType */, type.pos); + var node = createNode(166 /* ArrayType */, type.pos); node.elementType = type; parseExpected(22 /* CloseBracketToken */); type = finishNode(node); @@ -15511,20 +15901,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171 /* TypeOperator */); + var node = createNode(174 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171 /* InferType */); + parseExpected(126 /* InferKeyword */); + var typeParameter = createNode(147 /* TypeParameter */); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127 /* KeyOfKeyword */: - case 140 /* UniqueKeyword */: + case 128 /* KeyOfKeyword */: + case 141 /* UniqueKeyword */: return parseTypeOperator(operator); + case 126 /* InferKeyword */: + return parseInferType(); case 24 /* DotDotDotToken */: { - var result = createNode(278 /* JSDocVariadicType */); + var result = createNode(281 /* JSDocVariadicType */); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -15547,10 +15947,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); + return parseUnionOrIntersectionType(169 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); + return parseUnionOrIntersectionType(168 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); } function isStartOfFunctionType() { if (token() === 27 /* LessThanToken */) { @@ -15607,7 +16007,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(160 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -15618,7 +16018,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -15628,14 +16028,26 @@ var ts; // apply to 'type' contexts. So we disable these parameters here before moving on. return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161 /* FunctionType */); + return parseFunctionOrConstructorType(162 /* FunctionType */); } if (token() === 94 /* NewKeyword */) { - return parseFunctionOrConstructorType(162 /* ConstructorType */); + return parseFunctionOrConstructorType(163 /* ConstructorType */); } - return parseUnionTypeOrHigher(); + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85 /* ExtendsKeyword */)) { + var node = createNode(170 /* ConditionalType */, type.pos); + node.checkType = type; + // The type following 'extends' is not permitted to be another conditional type + node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); + parseExpected(55 /* QuestionToken */); + node.trueType = parseTypeWorker(); + parseExpected(56 /* ColonToken */); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56 /* ColonToken */) ? parseType() : undefined; @@ -15754,7 +16166,7 @@ var ts; // And production (2) is parsed in "tryParseParenthesizedArrowFunctionExpression". // // If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is - // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done + // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done // with AssignmentExpression if we see one. var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression(); if (arrowExpression) { @@ -15781,7 +16193,7 @@ var ts; // we're in '2' or '3'. Consume the assignment and return. // // Note: we call reScanGreaterToken so that we get an appropriately merged token - // for cases like > > = becoming >>= + // for cases like `> > =` becoming `>>=` if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); } @@ -15818,7 +16230,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198 /* YieldExpression */); + var node = createNode(201 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -15840,17 +16252,17 @@ var ts; ts.Debug.assert(token() === 36 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188 /* ArrowFunction */, asyncModifier.pos); + node = createNode(191 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188 /* ArrowFunction */, identifier.pos); + node = createNode(191 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(147 /* Parameter */, identifier.pos); + var parameter = createNode(148 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -15875,7 +16287,7 @@ var ts; // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); arrowFunction.body = (lastToken === 36 /* EqualsGreaterThanToken */ || lastToken === 17 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -15912,7 +16324,7 @@ var ts; var second = nextToken(); if (first === 19 /* OpenParenToken */) { if (second === 20 /* CloseParenToken */) { - // Simple cases: "() =>", "(): ", and "() {". + // Simple cases: "() =>", "(): ", and "() {". // This is an arrow function with no parameters. // The last one is not actually an arrow function, // but this is probably what the user intended. @@ -16042,7 +16454,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188 /* ArrowFunction */); + var node = createNodeWithJSDoc(191 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -16108,12 +16520,14 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(196 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(199 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); - node.whenFalse = parseAssignmentExpressionOrHigher(); + node.colonToken = parseExpectedToken(56 /* ColonToken */); + node.whenFalse = ts.nodeIsPresent(node.colonToken) + ? parseAssignmentExpressionOrHigher() + : createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); return finishNode(node); } function parseBinaryExpressionOrHigher(precedence) { @@ -16121,7 +16535,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 /* InKeyword */ || t === 143 /* OfKeyword */; + return t === 92 /* InKeyword */ || t === 144 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16229,39 +16643,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195 /* BinaryExpression */, left.pos); + var node = createNode(198 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203 /* AsExpression */, left.pos); + var node = createNode(206 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189 /* DeleteExpression */); + var node = createNode(192 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190 /* TypeOfExpression */); + var node = createNode(193 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191 /* VoidExpression */); + var node = createNode(194 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16277,7 +16691,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192 /* AwaitExpression */); + var node = createNode(195 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16320,7 +16734,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 188 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -16417,7 +16831,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -16430,7 +16844,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(197 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -16475,7 +16889,8 @@ var ts; // We don't want to eagerly consume all import keyword as import call expression so we look a head to find "(" // For example: // var foo3 = require("subfolder - // import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression + // import * as foo1 from "module-from-node + // We want this import to be a statement rather than import call expression sourceFile.flags |= 524288 /* PossiblyContainsDynamicImport */; expression = parseTokenNode(); } @@ -16523,7 +16938,7 @@ var ts; // treated as the invocation of "new Foo". We disambiguate that in code (to match // the original grammar) by making sure that if we see an ObjectCreationExpression // we always consume arguments if they are there. So we treat "new Foo()" as an - // object creation only, and not at all as an invocation) Another way to think + // object creation only, and not at all as an invocation. Another way to think // about this is that for every "new" that we see, we will consume an argument list if // it is there as part of the *associated* object creation node. Any additional // argument lists we see, will become invocation expressions. @@ -16544,9 +16959,9 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(180 /* PropertyAccessExpression */, expression.pos); + var node = createNode(183 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - parseExpectedToken(23 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } @@ -16569,8 +16984,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252 /* JsxOpeningElement */) { - var node = createNode(250 /* JsxElement */, opening.pos); + if (opening.kind === 255 /* JsxOpeningElement */) { + var node = createNode(253 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -16579,15 +16994,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255 /* JsxOpeningFragment */) { - var node = createNode(254 /* JsxFragment */, opening.pos); + else if (opening.kind === 258 /* JsxOpeningFragment */) { + var node = createNode(257 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 254 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -16602,7 +17017,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195 /* BinaryExpression */, result.pos); + var badNode = createNode(198 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -16666,7 +17081,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258 /* JsxAttributes */); + var jsxAttributes = createNode(261 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -16675,7 +17090,7 @@ var ts; parseExpected(27 /* LessThanToken */); if (token() === 29 /* GreaterThanToken */) { parseExpected(29 /* GreaterThanToken */); - var node_1 = createNode(255 /* JsxOpeningFragment */, fullStart); + var node_1 = createNode(258 /* JsxOpeningFragment */, fullStart); return finishNode(node_1); } var tagName = parseJsxElementName(); @@ -16685,7 +17100,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(252 /* JsxOpeningElement */, fullStart); + node = createNode(255 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -16697,7 +17112,7 @@ var ts; parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(251 /* JsxSelfClosingElement */, fullStart); + node = createNode(254 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -16713,7 +17128,7 @@ var ts; var expression = token() === 99 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23 /* DotToken */)) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16721,7 +17136,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260 /* JsxExpression */); + var node = createNode(263 /* JsxExpression */); parseExpected(17 /* OpenBraceToken */); if (token() !== 18 /* CloseBraceToken */) { node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); @@ -16741,7 +17156,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257 /* JsxAttribute */); + var node = createNode(260 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 58 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -16756,7 +17171,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259 /* JsxSpreadAttribute */); + var node = createNode(262 /* JsxSpreadAttribute */); parseExpected(17 /* OpenBraceToken */); parseExpected(24 /* DotDotDotToken */); node.expression = parseExpression(); @@ -16764,7 +17179,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253 /* JsxClosingElement */); + var node = createNode(256 /* JsxClosingElement */); parseExpected(28 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -16777,7 +17192,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256 /* JsxClosingFragment */); + var node = createNode(259 /* JsxClosingFragment */); parseExpected(28 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -16793,7 +17208,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185 /* TypeAssertionExpression */); + var node = createNode(188 /* TypeAssertionExpression */); parseExpected(27 /* LessThanToken */); node.type = parseType(); parseExpected(29 /* GreaterThanToken */); @@ -16804,7 +17219,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16812,14 +17227,14 @@ var ts; } if (token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(207 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(21 /* OpenBracketToken */)) { - var indexedAccess = createNode(181 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(184 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -16835,7 +17250,7 @@ var ts; continue; } if (token() === 13 /* NoSubstitutionTemplateLiteral */ || token() === 14 /* TemplateHead */) { - var tagExpression = createNode(184 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(187 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -16858,7 +17273,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -16866,7 +17281,7 @@ var ts; continue; } else if (token() === 19 /* OpenParenToken */) { - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -16887,7 +17302,7 @@ var ts; } var typeArguments = parseDelimitedList(19 /* TypeArguments */, parseType); if (!parseExpected(29 /* GreaterThanToken */)) { - // If it doesn't have the closing > then it's definitely not an type argument list. + // If it doesn't have the closing `>` then it's definitely not an type argument list. return undefined; } // If we have a '<', then only parse this as a argument list if the type arguments @@ -16976,28 +17391,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(189 /* ParenthesizedExpression */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199 /* SpreadElement */); + var node = createNode(202 /* SpreadElement */); parseExpected(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 26 /* CommaToken */ ? createNode(201 /* OmittedExpression */) : + token() === 26 /* CommaToken */ ? createNode(204 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178 /* ArrayLiteralExpression */); + var node = createNode(181 /* ArrayLiteralExpression */); parseExpected(21 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17009,17 +17424,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(24 /* DotDotDotToken */)) { - node.kind = 267 /* SpreadAssignment */; + node.kind = 270 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } var asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -17036,7 +17451,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 /* CommaToken */ || token() === 18 /* CloseBraceToken */ || token() === 58 /* EqualsToken */); if (isShorthandPropertyAssignment) { - node.kind = 266 /* ShorthandPropertyAssignment */; + node.kind = 269 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(58 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -17044,14 +17459,14 @@ var ts; } } else { - node.kind = 265 /* PropertyAssignment */; + node.kind = 268 /* PropertyAssignment */; parseExpected(56 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179 /* ObjectLiteralExpression */); + var node = createNode(182 /* ObjectLiteralExpression */); parseExpected(17 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17070,7 +17485,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(187 /* FunctionExpression */); + var node = createNodeWithJSDoc(190 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); @@ -17095,12 +17510,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94 /* NewKeyword */); if (parseOptional(23 /* DotToken */)) { - var node_2 = createNode(205 /* MetaProperty */, fullStart); + var node_2 = createNode(208 /* MetaProperty */, fullStart); node_2.keywordToken = 94 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183 /* NewExpression */, fullStart); + var node = createNode(186 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19 /* OpenParenToken */) { @@ -17110,7 +17525,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208 /* Block */); + var node = createNode(211 /* Block */); if (parseExpected(17 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17143,12 +17558,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210 /* EmptyStatement */); + var node = createNode(213 /* EmptyStatement */); parseExpected(25 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(212 /* IfStatement */); + var node = createNode(215 /* IfStatement */); parseExpected(90 /* IfKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17158,7 +17573,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213 /* DoStatement */); + var node = createNode(216 /* DoStatement */); parseExpected(81 /* DoKeyword */); node.statement = parseStatement(); parseExpected(106 /* WhileKeyword */); @@ -17173,7 +17588,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214 /* WhileStatement */); + var node = createNode(217 /* WhileStatement */); parseExpected(106 /* WhileKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17196,8 +17611,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143 /* OfKeyword */) : parseOptional(143 /* OfKeyword */)) { - var forOfStatement = createNode(217 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(144 /* OfKeyword */) : parseOptional(144 /* OfKeyword */)) { + var forOfStatement = createNode(220 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -17205,14 +17620,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92 /* InKeyword */)) { - var forInStatement = createNode(216 /* ForInStatement */, pos); + var forInStatement = createNode(219 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215 /* ForStatement */, pos); + var forStatement = createNode(218 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(25 /* SemicolonToken */); if (token() !== 25 /* SemicolonToken */ && token() !== 20 /* CloseParenToken */) { @@ -17230,7 +17645,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); + parseExpected(kind === 222 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17238,7 +17653,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220 /* ReturnStatement */); + var node = createNode(223 /* ReturnStatement */); parseExpected(96 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -17247,7 +17662,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221 /* WithStatement */); + var node = createNode(224 /* WithStatement */); parseExpected(107 /* WithKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17256,7 +17671,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261 /* CaseClause */); + var node = createNode(264 /* CaseClause */); parseExpected(73 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(56 /* ColonToken */); @@ -17264,7 +17679,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262 /* DefaultClause */); + var node = createNode(265 /* DefaultClause */); parseExpected(79 /* DefaultKeyword */); parseExpected(56 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -17274,12 +17689,12 @@ var ts; return token() === 73 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222 /* SwitchStatement */); + var node = createNode(225 /* SwitchStatement */); parseExpected(98 /* SwitchKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); - var caseBlock = createNode(236 /* CaseBlock */); + var caseBlock = createNode(239 /* CaseBlock */); parseExpected(17 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(18 /* CloseBraceToken */); @@ -17294,7 +17709,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(224 /* ThrowStatement */); + var node = createNode(227 /* ThrowStatement */); parseExpected(100 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -17302,7 +17717,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(225 /* TryStatement */); + var node = createNode(228 /* TryStatement */); parseExpected(102 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -17315,7 +17730,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264 /* CatchClause */); + var result = createNode(267 /* CatchClause */); parseExpected(74 /* CatchKeyword */); if (parseOptional(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -17329,7 +17744,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226 /* DebuggerStatement */); + var node = createNode(229 /* DebuggerStatement */); parseExpected(78 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -17341,12 +17756,12 @@ var ts; var node = createNodeWithJSDoc(0 /* Unknown */); var expression = allowInAnd(parseExpression); if (expression.kind === 71 /* Identifier */ && parseOptional(56 /* ColonToken */)) { - node.kind = 223 /* LabeledStatement */; + node.kind = 226 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211 /* ExpressionStatement */; + node.kind = 214 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -17400,10 +17815,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117 /* AbstractKeyword */: case 120 /* AsyncKeyword */: @@ -17411,14 +17826,14 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 114 /* PublicKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142 /* GlobalKeyword */: + case 143 /* GlobalKeyword */: nextToken(); return token() === 17 /* OpenBraceToken */ || token() === 71 /* Identifier */ || token() === 84 /* ExportKeyword */; case 91 /* ImportKeyword */: @@ -17479,17 +17894,17 @@ var ts; case 120 /* AsyncKeyword */: case 124 /* DeclareKeyword */: case 109 /* InterfaceKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: - case 138 /* TypeKeyword */: - case 142 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 143 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -17513,16 +17928,16 @@ var ts; case 17 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 104 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); case 110 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); } break; case 89 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(229 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(232 /* FunctionDeclaration */)); case 75 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(230 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(233 /* ClassDeclaration */)); case 90 /* IfKeyword */: return parseIfStatement(); case 81 /* DoKeyword */: @@ -17532,9 +17947,9 @@ var ts; case 88 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 77 /* ContinueKeyword */: - return parseBreakOrContinueStatement(218 /* ContinueStatement */); + return parseBreakOrContinueStatement(221 /* ContinueStatement */); case 72 /* BreakKeyword */: - return parseBreakOrContinueStatement(219 /* BreakStatement */); + return parseBreakOrContinueStatement(222 /* BreakStatement */); case 96 /* ReturnKeyword */: return parseReturnStatement(); case 107 /* WithKeyword */: @@ -17554,9 +17969,9 @@ var ts; return parseDeclaration(); case 120 /* AsyncKeyword */: case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: case 83 /* EnumKeyword */: @@ -17567,8 +17982,8 @@ var ts; case 114 /* PublicKeyword */: case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: - case 142 /* GlobalKeyword */: + case 132 /* ReadonlyKeyword */: + case 143 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -17606,13 +18021,13 @@ var ts; return parseClassDeclaration(node); case 109 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 83 /* EnumKeyword */: return parseEnumDeclaration(node); - case 142 /* GlobalKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 143 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 91 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -17631,7 +18046,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(248 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -17653,16 +18068,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 26 /* CommaToken */) { - return createNode(201 /* OmittedExpression */); + return createNode(204 /* OmittedExpression */); } - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -17678,14 +18093,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175 /* ObjectBindingPattern */); + var node = createNode(178 /* ObjectBindingPattern */); parseExpected(17 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176 /* ArrayBindingPattern */); + var node = createNode(179 /* ArrayBindingPattern */); parseExpected(21 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(22 /* CloseBracketToken */); @@ -17707,7 +18122,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227 /* VariableDeclaration */); + var node = createNode(230 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 /* Identifier */ && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -17720,7 +18135,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228 /* VariableDeclarationList */); + var node = createNode(231 /* VariableDeclarationList */); switch (token()) { case 104 /* VarKeyword */: break; @@ -17743,7 +18158,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 143 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -17758,13 +18173,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 209 /* VariableStatement */; + node.kind = 212 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229 /* FunctionDeclaration */; + node.kind = 232 /* FunctionDeclaration */; parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); node.name = ts.hasModifier(node, 512 /* Default */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -17775,14 +18190,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153 /* Constructor */; + node.kind = 154 /* Constructor */; parseExpected(123 /* ConstructorKeyword */); fillSignature(56 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152 /* MethodDeclaration */; + node.kind = 153 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; @@ -17791,7 +18206,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150 /* PropertyDeclaration */; + node.kind = 151 /* PropertyDeclaration */; if (!node.questionToken && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -17801,8 +18216,8 @@ var ts; // off. The grammar would look something like this: // // MemberVariableDeclaration[Yield]: - // AccessibilityModifier_opt PropertyName TypeAnnotation_opt Initializer_opt[In]; - // AccessibilityModifier_opt static_opt PropertyName TypeAnnotation_opt Initializer_opt[In, ?Yield]; + // AccessibilityModifier_opt PropertyName TypeAnnotation_opt Initializer_opt[In]; + // AccessibilityModifier_opt static_opt PropertyName TypeAnnotation_opt Initializer_opt[In, ?Yield]; // // The checker may still error in the static case to explicitly disallow the yield expression. node.initializer = ts.hasModifier(node, 32 /* Static */) @@ -17835,7 +18250,7 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; default: return false; @@ -17876,7 +18291,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 135 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 136 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -17884,6 +18299,7 @@ var ts; switch (token()) { case 19 /* OpenParenToken */: // Method declaration case 27 /* LessThanToken */: // Generic Method declaration + case 51 /* ExclamationToken */: // Non-null assertion on property name case 56 /* ColonToken */: // Type Annotation for declaration case 58 /* EqualsToken */: // Initializer for declaration case 55 /* QuestionToken */:// Not valid, but permitted so that it gets caught later on. @@ -17907,7 +18323,7 @@ var ts; if (!parseOptional(57 /* AtToken */)) { break; } - var decorator = createNode(148 /* Decorator */, decoratorStart); + var decorator = createNode(149 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -17957,7 +18373,7 @@ var ts; } function parseClassElement() { if (token() === 25 /* SemicolonToken */) { - var result = createNode(207 /* SemicolonClassElement */); + var result = createNode(210 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -17965,10 +18381,10 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } if (token() === 123 /* ConstructorKeyword */) { return parseConstructorDeclaration(node); @@ -17994,10 +18410,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 200 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 203 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 233 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -18040,7 +18456,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 /* ExtendsKeyword */ || tok === 108 /* ImplementsKeyword */) { - var node = createNode(263 /* HeritageClause */); + var node = createNode(266 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -18049,7 +18465,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -18066,7 +18482,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231 /* InterfaceDeclaration */; + node.kind = 234 /* InterfaceDeclaration */; parseExpected(109 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -18075,8 +18491,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232 /* TypeAliasDeclaration */; - parseExpected(138 /* TypeKeyword */); + node.kind = 235 /* TypeAliasDeclaration */; + parseExpected(139 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58 /* EqualsToken */); @@ -18089,13 +18505,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(268 /* EnumMember */); + var node = createNodeWithJSDoc(271 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233 /* EnumDeclaration */; + node.kind = 236 /* EnumDeclaration */; parseExpected(83 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(17 /* OpenBraceToken */)) { @@ -18108,7 +18524,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235 /* ModuleBlock */); + var node = createNode(238 /* ModuleBlock */); if (parseExpected(17 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(18 /* CloseBraceToken */); @@ -18119,7 +18535,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234 /* ModuleDeclaration */; + node.kind = 237 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -18131,8 +18547,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234 /* ModuleDeclaration */; - if (token() === 142 /* GlobalKeyword */) { + node.kind = 237 /* ModuleDeclaration */; + if (token() === 143 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18151,15 +18567,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142 /* GlobalKeyword */) { + if (token() === 143 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129 /* NamespaceKeyword */)) { + else if (parseOptional(130 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(128 /* ModuleKeyword */); + parseExpected(129 /* ModuleKeyword */); if (token() === 9 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -18167,7 +18583,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 /* RequireKeyword */ && + return token() === 133 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -18177,9 +18593,9 @@ var ts; return nextToken() === 41 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 237 /* NamespaceExportDeclaration */; + node.kind = 240 /* NamespaceExportDeclaration */; parseExpected(118 /* AsKeyword */); - parseExpected(129 /* NamespaceKeyword */); + parseExpected(130 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -18190,12 +18606,12 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 /* CommaToken */ && token() !== 141 /* FromKeyword */) { + if (token() !== 26 /* CommaToken */ && token() !== 142 /* FromKeyword */) { return parseImportEqualsDeclaration(node, identifier); } } // Import statement - node.kind = 239 /* ImportDeclaration */; + node.kind = 242 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; @@ -18203,14 +18619,14 @@ var ts; token() === 39 /* AsteriskToken */ || // import * token() === 17 /* OpenBraceToken */) { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238 /* ImportEqualsDeclaration */; + node.kind = 241 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(58 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -18224,7 +18640,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(240 /* ImportClause */, fullStart); + var importClause = createNode(243 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18234,7 +18650,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(26 /* CommaToken */)) { - importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(242 /* NamedImports */); + importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(245 /* NamedImports */); } return finishNode(importClause); } @@ -18244,8 +18660,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(249 /* ExternalModuleReference */); - parseExpected(132 /* RequireKeyword */); + var node = createNode(252 /* ExternalModuleReference */); + parseExpected(133 /* RequireKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(20 /* CloseParenToken */); @@ -18267,7 +18683,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(241 /* NamespaceImport */); + var namespaceImport = createNode(244 /* NamespaceImport */); parseExpected(39 /* AsteriskToken */); parseExpected(118 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -18282,14 +18698,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 242 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 245 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247 /* ExportSpecifier */); + return parseImportOrExportSpecifier(250 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243 /* ImportSpecifier */); + return parseImportOrExportSpecifier(246 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18314,25 +18730,25 @@ var ts; else { node.name = identifierName; } - if (kind === 243 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 246 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245 /* ExportDeclaration */; + node.kind = 248 /* ExportDeclaration */; if (parseOptional(39 /* AsteriskToken */)) { - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(249 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 141 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(141 /* FromKeyword */); + if (token() === 142 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18340,7 +18756,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244 /* ExportAssignment */; + node.kind = 247 /* ExportAssignment */; if (parseOptional(58 /* EqualsToken */)) { node.isExportEquals = true; } @@ -18435,10 +18851,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1 /* Export */) - || node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */ - || node.kind === 239 /* ImportDeclaration */ - || node.kind === 244 /* ExportAssignment */ - || node.kind === 245 /* ExportDeclaration */ + || node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */ + || node.kind === 242 /* ImportDeclaration */ + || node.kind === 247 /* ExportAssignment */ + || node.kind === 248 /* ExportDeclaration */ ? node : undefined; }); @@ -18491,7 +18907,7 @@ var ts; JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; // Parses out a JSDoc type expression. function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(271 /* JSDocTypeExpression */, scanner.getTokenPos()); + var result = createNode(274 /* JSDocTypeExpression */, scanner.getTokenPos()); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17 /* OpenBraceToken */); result.type = doInsideOfContext(1048576 /* JSDoc */, parseType); if (!mayOmitBraces || hasBrace) { @@ -18563,7 +18979,6 @@ var ts; scanner.scanRange(start + 3, length - 5, function () { // Initially we can parse out a tag. We also have seen a starting asterisk. // This is so that /** * @type */ doesn't parse. - var advanceToken = true; var state = 1 /* SawAsterisk */; var margin = undefined; // + 4 for leading '/** ' @@ -18575,17 +18990,17 @@ var ts; comments.push(text); indent += text.length; } - nextJSDocToken(); - while (token() === 5 /* WhitespaceTrivia */) { - nextJSDocToken(); + var t = nextJSDocToken(); + while (t === 5 /* WhitespaceTrivia */) { + t = nextJSDocToken(); } - if (token() === 4 /* NewLineTrivia */) { + if (t === 4 /* NewLineTrivia */) { state = 0 /* BeginningOfLine */; indent = 0; - nextJSDocToken(); + t = nextJSDocToken(); } - while (token() !== 1 /* EndOfFileToken */) { - switch (token()) { + loop: while (true) { + switch (t) { case 57 /* AtToken */: if (state === 0 /* BeginningOfLine */ || state === 1 /* SawAsterisk */) { removeTrailingNewlines(comments); @@ -18594,7 +19009,6 @@ var ts; // Real-world comments may break this rule, so "BeginningOfLine" will not be a real line beginning // for malformed examples like `/** @param {string} x @returns {number} the length */` state = 0 /* BeginningOfLine */; - advanceToken = false; margin = undefined; indent++; } @@ -18639,19 +19053,14 @@ var ts; indent += whitespace.length; break; case 1 /* EndOfFileToken */: - break; + break loop; default: // anything other than whitespace or asterisk at the beginning of the line starts the comment text state = 2 /* SavingComments */; pushComment(scanner.getTokenText()); break; } - if (advanceToken) { - nextJSDocToken(); - } - else { - advanceToken = true; - } + t = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); @@ -18675,7 +19084,7 @@ var ts; content.charCodeAt(start + 3) !== 42 /* asterisk */; } function createJSDocComment() { - var result = createNode(279 /* JSDocComment */, start); + var result = createNode(282 /* JSDocComment */, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -18736,7 +19145,8 @@ var ts; // a badly malformed tag should not be added to the list of tags return; } - addTag(tag, parseTagComments(indent + tag.end - tag.pos)); + tag.comment = parseTagComments(indent + tag.end - tag.pos); + addTag(tag); } function parseTagComments(indent) { var comments = []; @@ -18749,8 +19159,9 @@ var ts; comments.push(text); indent += text.length; } - while (token() !== 57 /* AtToken */ && token() !== 1 /* EndOfFileToken */) { - switch (token()) { + var tok = token(); + loop: while (true) { + switch (tok) { case 4 /* NewLineTrivia */: if (state >= 1 /* SawAsterisk */) { state = 0 /* BeginningOfLine */; @@ -18759,8 +19170,11 @@ var ts; indent = 0; break; case 57 /* AtToken */: + scanner.setTextPos(scanner.getTextPos() - 1); + // falls through + case 1 /* EndOfFileToken */: // Done - break; + break loop; case 5 /* WhitespaceTrivia */: if (state === 2 /* SavingComments */) { pushComment(scanner.getTokenText()); @@ -18778,7 +19192,7 @@ var ts; if (state === 0 /* BeginningOfLine */) { // leading asterisks start recording on the *next* (non-whitespace) token state = 1 /* SawAsterisk */; - indent += scanner.getTokenText().length; + indent += 1; break; } // record the * as a comment @@ -18788,24 +19202,19 @@ var ts; pushComment(scanner.getTokenText()); break; } - if (token() === 57 /* AtToken */) { - // Done - break; - } - nextJSDocToken(); + tok = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); - return comments; + return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(atToken, tagName) { - var result = createNode(281 /* JSDocTag */, atToken.pos); + var result = createNode(284 /* JSDocTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); } - function addTag(tag, comments) { - tag.comment = comments.join(""); + function addTag(tag) { if (!tags) { tags = [tag]; tagsPos = tag.pos; @@ -18835,9 +19244,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object"; @@ -18853,8 +19262,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 /* Parameter */ ? - createNode(284 /* JSDocParameterTag */, atToken.pos) : - createNode(289 /* JSDocPropertyTag */, atToken.pos); + createNode(287 /* JSDocParameterTag */, atToken.pos) : + createNode(292 /* JSDocPropertyTag */, atToken.pos); var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name); if (nestedTypeLiteral) { typeExpression = nestedTypeLiteral; @@ -18870,21 +19279,18 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(271 /* JSDocTypeExpression */, scanner.getTokenPos()); + var typeLiteralExpression = createNode(274 /* JSDocTypeExpression */, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_2 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(1 /* Parameter */, name); })) { - if (!children) { - children = []; - } - children.push(child); + children = ts.append(children, child); } if (children) { - jsdocTypeLiteral = createNode(280 /* JSDocTypeLiteral */, start_2); + jsdocTypeLiteral = createNode(283 /* JSDocTypeLiteral */, start_2); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 165 /* ArrayType */) { + if (typeExpression.type.kind === 166 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -18893,27 +19299,27 @@ var ts; } } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 285 /* JSDocReturnTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288 /* JSDocReturnTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(285 /* JSDocReturnTag */, atToken.pos); + var result = createNode(288 /* JSDocReturnTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 286 /* JSDocTypeTag */; })) { + if (ts.forEach(tags, function (t) { return t.kind === 289 /* JSDocTypeTag */; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(286 /* JSDocTypeTag */, atToken.pos); + var result = createNode(289 /* JSDocTypeTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(/*mayOmitBraces*/ true); return finishNode(result); } function parseAugmentsTag(atToken, tagName) { - var result = createNode(282 /* JSDocAugmentsTag */, atToken.pos); + var result = createNode(285 /* JSDocAugmentsTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); @@ -18921,7 +19327,7 @@ var ts; } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(17 /* OpenBraceToken */); - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -18933,7 +19339,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(/*createIfMissing*/ true); while (parseOptional(23 /* DotToken */)) { - var prop = createNode(180 /* PropertyAccessExpression */, node.pos); + var prop = createNode(183 /* PropertyAccessExpression */, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -18941,7 +19347,7 @@ var ts; return node; } function parseClassTag(atToken, tagName) { - var tag = createNode(283 /* JSDocClassTag */, atToken.pos); + var tag = createNode(286 /* JSDocClassTag */, atToken.pos); tag.atToken = atToken; tag.tagName = tagName; return finishNode(tag); @@ -18949,7 +19355,7 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(288 /* JSDocTypedefTag */, atToken.pos); + var typedefTag = createNode(291 /* JSDocTypedefTag */, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(/*flags*/ 0); @@ -18974,9 +19380,9 @@ var ts; var start_3 = scanner.getStartPos(); while (child = tryParse(function () { return parseChildParameterOrPropertyTag(0 /* Property */); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(280 /* JSDocTypeLiteral */, start_3); + jsdocTypeLiteral = createNode(283 /* JSDocTypeLiteral */, start_3); } - if (child.kind === 286 /* JSDocTypeTag */) { + if (child.kind === 289 /* JSDocTypeTag */) { if (childTypeTag) { break; } @@ -18985,14 +19391,11 @@ var ts; } } else { - if (!jsdocTypeLiteral.jsDocPropertyTags) { - jsdocTypeLiteral.jsDocPropertyTags = []; - } - jsdocTypeLiteral.jsDocPropertyTags.push(child); + jsdocTypeLiteral.jsDocPropertyTags = ts.append(jsdocTypeLiteral.jsDocPropertyTags, child); } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 165 /* ArrayType */) { + if (typeExpression && typeExpression.type.kind === 166 /* ArrayType */) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -19005,7 +19408,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(23 /* DotToken */)) { - var jsDocNamespaceNode = createNode(234 /* ModuleDeclaration */, pos); + var jsDocNamespaceNode = createNode(237 /* ModuleDeclaration */, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4 /* NestedNamespace */); @@ -19033,12 +19436,11 @@ var ts; var canParseTag = true; var seenAsterisk = false; while (true) { - nextJSDocToken(); - switch (token()) { + switch (nextJSDocToken()) { case 57 /* AtToken */: if (canParseTag) { var child = tryParseChildTag(target); - if (child && child.kind === 284 /* JSDocParameterTag */ && + if (child && child.kind === 287 /* JSDocParameterTag */ && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } @@ -19074,34 +19476,44 @@ var ts; if (!tagName) { return false; } + var t; switch (tagName.escapedText) { case "type": return target === 0 /* Property */ && parseTypeTag(atToken, tagName); case "prop": case "property": - return target === 0 /* Property */ && parseParameterOrPropertyTag(atToken, tagName, target); + t = 0 /* Property */; + break; case "arg": case "argument": case "param": - return target === 1 /* Parameter */ && parseParameterOrPropertyTag(atToken, tagName, target); + t = 1 /* Parameter */; + break; + default: + return false; } - return false; + if (target !== t) { + return false; + } + var tag = parseParameterOrPropertyTag(atToken, tagName, target); + tag.comment = parseTagComments(tag.end - tag.pos); + return tag; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 287 /* JSDocTemplateTag */; })) { + if (ts.some(tags, ts.isJSDocTemplateTag)) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } // Type parameter list looks like '@template T,U,V' var typeParameters = []; var typeParametersPos = getNodePos(); while (true) { - var name = parseJSDocIdentifierName(); + var typeParameter = createNode(147 /* TypeParameter */); + var name = parseJSDocIdentifierNameWithOptionalBraces(); skipWhitespace(); if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(146 /* TypeParameter */, name.pos); typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); @@ -19113,13 +19525,21 @@ var ts; break; } } - var result = createNode(287 /* JSDocTemplateTag */, atToken.pos); + var result = createNode(290 /* JSDocTemplateTag */, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); finishNode(result); return result; } + function parseJSDocIdentifierNameWithOptionalBraces() { + var parsedBrace = parseOptional(17 /* OpenBraceToken */); + var res = parseJSDocIdentifierName(); + if (parsedBrace) { + parseExpected(18 /* CloseBraceToken */); + } + return res; + } function nextJSDocToken() { return currentToken = scanner.scanJSDocToken(); } @@ -19298,7 +19718,7 @@ var ts; // We may need to update both the 'pos' and the 'end' of the element. // If the 'pos' is before the start of the change, then we don't need to touch it. // If it isn't, then the 'pos' must be inside the change. How we update it will - // depend if delta is positive or negative. If delta is positive then we have + // depend if delta is positive or negative. If delta is positive then we have // something like: // // -------------------AAA----------------- @@ -19322,7 +19742,7 @@ var ts; element.pos = Math.min(element.pos, changeRangeNewEnd); // If the 'end' is after the change range, then we always adjust it by the delta // amount. However, if the end is in the change range, then how we adjust it - // will depend on if delta is positive or negative. If delta is positive then we + // will depend on if delta is positive or negative. If delta is positive then we // have something like: // // -------------------AAA----------------- @@ -19660,24 +20080,24 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (ts.isConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. other uninstantiated module declarations. - case 235 /* ModuleBlock */: { + case 238 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -19699,7 +20119,7 @@ var ts; }); return state_1; } - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return getModuleInstanceState(node); case 71 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -19733,6 +20153,7 @@ var ts; ContainerFlags[ContainerFlags["HasLocals"] = 32] = "HasLocals"; ContainerFlags[ContainerFlags["IsInterface"] = 64] = "IsInterface"; ContainerFlags[ContainerFlags["IsObjectLiteralOrClassExpressionMethod"] = 128] = "IsObjectLiteralOrClassExpressionMethod"; + ContainerFlags[ContainerFlags["IsInferenceContainer"] = 256] = "IsInferenceContainer"; })(ContainerFlags || (ContainerFlags = {})); var binder = createBinder(); function bindSourceFile(file, options) { @@ -19749,6 +20170,7 @@ var ts; var parent; var container; var blockScopeContainer; + var inferenceContainer; var lastContainer; var seenThisKeyword; // state used by control flow analysis @@ -19804,6 +20226,7 @@ var ts; parent = undefined; container = undefined; blockScopeContainer = undefined; + inferenceContainer = undefined; lastContainer = undefined; seenThisKeyword = false; currentFlow = undefined; @@ -19849,7 +20272,7 @@ var ts; if (symbolFlags & 107455 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 234 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 237 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -19858,7 +20281,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -19867,7 +20290,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -19879,38 +20302,38 @@ var ts; return ts.getEscapedTextOfIdentifierOrLiteral(name); } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "__constructor" /* Constructor */; - case 161 /* FunctionType */: - case 156 /* CallSignature */: + case 162 /* FunctionType */: + case 157 /* CallSignature */: return "__call" /* Call */; - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: return "__new" /* New */; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "__index" /* Index */; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: return (ts.hasModifier(node, 512 /* Default */) ? "default" /* Default */ : undefined); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 147 /* Parameter */: + case 148 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 277 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 280 /* JSDocFunctionType */); var functionType = node.parent; - var index = ts.indexOf(functionType.parameters, node); + var index = functionType.parameters.indexOf(node); return "arg" + index; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: var name_2 = ts.getNameOfJSDocTypedef(node); return typeof name_2 !== "undefined" ? name_2.escapedText : undefined; } @@ -19987,6 +20410,9 @@ var ts; var message_1 = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) { + message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } if (symbol.declarations && symbol.declarations.length) { // If the current node is a default export of some sort, then check if // there are any other default exports that we need to error on. @@ -20000,7 +20426,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 244 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 247 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -20020,7 +20446,7 @@ var ts; function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 247 /* ExportSpecifier */ || (node.kind === 238 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 250 /* ExportSpecifier */ || (node.kind === 241 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -20042,12 +20468,9 @@ var ts; // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - if (node.kind === 288 /* JSDocTypedefTag */) + if (node.kind === 291 /* JSDocTypedefTag */) ts.Debug.assert(ts.isInJavaScriptFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - var isJSDocTypedefInJSDocNamespace = node.kind === 288 /* JSDocTypedefTag */ && - node.name && - node.name.kind === 71 /* Identifier */ && - node.name.isInJSDocNamespace; + var isJSDocTypedefInJSDocNamespace = ts.isJSDocTypedefTag(node) && node.name && node.name.kind === 71 /* Identifier */ && node.name.isInJSDocNamespace; if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 32 /* ExportContext */)) || isJSDocTypedefInJSDocNamespace) { var exportKind = symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0; var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); @@ -20115,7 +20538,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property intialization checks. - currentReturnTarget = isIIFE || node.kind === 153 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 154 /* Constructor */ ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -20128,13 +20551,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -20152,6 +20575,13 @@ var ts; bindChildren(node); node.flags = seenThisKeyword ? node.flags | 64 /* ContainsThis */ : node.flags & ~64 /* ContainsThis */; } + else if (containerFlags & 256 /* IsInferenceContainer */) { + var saveInferenceContainer = inferenceContainer; + inferenceContainer = node; + node.locals = undefined; + bindChildren(node); + inferenceContainer = saveInferenceContainer; + } else { bindChildren(node); } @@ -20221,70 +20651,70 @@ var ts; return; } switch (node.kind) { - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: bindWhileStatement(node); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: bindDoStatement(node); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: bindForStatement(node); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: bindIfStatement(node); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: bindTryStatement(node); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: bindSwitchStatement(node); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: bindCaseBlock(node); break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: bindCaseClause(node); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: bindLabeledStatement(node); break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: bindCallExpressionFlow(node); break; - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: bindJSDocComment(node); break; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: bindJSDocTypedefTag(node); break; default: @@ -20296,15 +20726,15 @@ var ts; switch (expr.kind) { case 71 /* Identifier */: case 99 /* ThisKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return hasNarrowableArgument(expr); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 51 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; @@ -20313,7 +20743,7 @@ var ts; return expr.kind === 71 /* Identifier */ || expr.kind === 99 /* ThisKeyword */ || expr.kind === 97 /* SuperKeyword */ || - expr.kind === 180 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + expr.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -20324,14 +20754,17 @@ var ts; } } } - if (expr.expression.kind === 180 /* PropertyAccessExpression */ && + if (expr.expression.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 190 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && expr2.kind === 9 /* StringLiteral */; + return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2); + } + function isNarrowableInOperands(left, right) { + return ts.isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -20345,6 +20778,8 @@ var ts; isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right); case 93 /* InstanceOfKeyword */: return isNarrowableOperand(expr.left); + case 92 /* InKeyword */: + return isNarrowableInOperands(expr.left, expr.right); case 26 /* CommaToken */: return isNarrowingExpression(expr.right); } @@ -20352,9 +20787,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -20432,33 +20867,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: return parent.expression === node; - case 215 /* ForStatement */: - case 196 /* ConditionalExpression */: + case 218 /* ForStatement */: + case 199 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 186 /* ParenthesizedExpression */) { + if (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 193 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { + else if (node.kind === 196 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 195 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || + return node.kind === 198 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 54 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 186 /* ParenthesizedExpression */ || - node.parent.kind === 193 /* PrefixUnaryExpression */ && + while (node.parent.kind === 189 /* ParenthesizedExpression */ || + node.parent.kind === 196 /* PrefixUnaryExpression */ && node.parent.operator === 51 /* ExclamationToken */) { node = node.parent; } @@ -20500,7 +20935,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 223 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 226 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -20534,13 +20969,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 228 /* VariableDeclarationList */) { + if (node.initializer.kind !== 231 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -20562,7 +20997,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 220 /* ReturnStatement */) { + if (node.kind === 223 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -20582,7 +21017,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 219 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 222 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -20678,7 +21113,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 262 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 265 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -20745,14 +21180,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 213 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 216 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -20763,10 +21198,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 178 /* ArrayLiteralExpression */) { + else if (node.kind === 181 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 199 /* SpreadElement */) { + if (e.kind === 202 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -20774,16 +21209,16 @@ var ts; } } } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 265 /* PropertyAssignment */) { + if (p.kind === 268 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 266 /* ShorthandPropertyAssignment */) { + else if (p.kind === 269 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 267 /* SpreadAssignment */) { + else if (p.kind === 270 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -20839,7 +21274,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 58 /* EqualsToken */ && node.left.kind === 181 /* ElementAccessExpression */) { + if (operator === 58 /* EqualsToken */ && node.left.kind === 184 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -20850,7 +21285,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -20889,7 +21324,7 @@ var ts; } function bindJSDocComment(node) { ts.forEachChild(node, function (n) { - if (n.kind !== 288 /* JSDocTypedefTag */) { + if (n.kind !== 291 /* JSDocTypedefTag */) { bind(n); } }); @@ -20910,10 +21345,10 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = node.expression; - while (expr.kind === 186 /* ParenthesizedExpression */) { + while (expr.kind === 189 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 187 /* FunctionExpression */ || expr.kind === 188 /* ArrowFunction */) { + if (expr.kind === 190 /* FunctionExpression */ || expr.kind === 191 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -20921,7 +21356,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -20930,53 +21365,55 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 258 /* JsxAttributes */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 261 /* JsxAttributes */: return 1 /* IsContainer */; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 269 /* SourceFile */: + case 170 /* ConditionalType */: + return 256 /* IsInferenceContainer */; + case 272 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 277 /* JSDocFunctionType */: - case 161 /* FunctionType */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 162 /* ConstructorType */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 280 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 163 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 264 /* CatchClause */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 236 /* CaseBlock */: + case 267 /* CatchClause */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 239 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 208 /* Block */: + case 211 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -21009,42 +21446,42 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 179 /* ObjectLiteralExpression */: - case 231 /* InterfaceDeclaration */: - case 258 /* JsxAttributes */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 182 /* ObjectLiteralExpression */: + case 234 /* InterfaceDeclaration */: + case 261 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -21065,11 +21502,11 @@ var ts; : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 269 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 269 /* SourceFile */ || body.kind === 235 /* ModuleBlock */)) { + var body = node.kind === 272 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 272 /* SourceFile */ || body.kind === 238 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 245 /* ExportDeclaration */ || stat.kind === 244 /* ExportAssignment */) { + if (stat.kind === 248 /* ExportDeclaration */ || stat.kind === 247 /* ExportAssignment */) { return true; } } @@ -21136,7 +21573,7 @@ var ts; // to the one we would get for: { <...>(...): T } // // We do that by making an anonymous type literal symbol, and then setting the function - // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable + // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable // from an actual type literal symbol you would have gotten had you used the long form. var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); addDeclarationToSymbol(symbol, node, 131072 /* Signature */); @@ -21155,7 +21592,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { + if (prop.kind === 270 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { continue; } var identifier = prop.name; @@ -21167,7 +21604,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 265 /* PropertyAssignment */ || prop.kind === 266 /* ShorthandPropertyAssignment */ || prop.kind === 152 /* MethodDeclaration */ + var currentKind = prop.kind === 268 /* PropertyAssignment */ || prop.kind === 269 /* ShorthandPropertyAssignment */ || prop.kind === 153 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -21198,10 +21635,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -21311,8 +21748,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 269 /* SourceFile */ && - blockScopeContainer.kind !== 234 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 272 /* SourceFile */ && + blockScopeContainer.kind !== 237 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -21386,7 +21823,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 143 /* LastToken */) { + if (node.kind > 144 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -21414,7 +21851,7 @@ var ts; } for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { var tag = _c[_b]; - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { var savedParent = parent; parent = jsDoc; bind(tag); @@ -21453,7 +21890,7 @@ var ts; // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 288 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 291 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); @@ -21461,11 +21898,11 @@ var ts; } // falls through case 99 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 266 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 269 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -21473,7 +21910,7 @@ var ts; bindSpecialPropertyDeclaration(node); } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -21498,132 +21935,132 @@ var ts; ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return checkStrictModeCatchClause(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkStrictModeWithStatement(node); - case 170 /* ThisType */: + case 173 /* ThisType */: seenThisKeyword = true; return; - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 146 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 147 /* Parameter */: + case 147 /* TypeParameter */: + return bindTypeParameter(node); + case 148 /* Parameter */: return bindParameter(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return bindPropertyWorker(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 173 /* MappedType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 176 /* MappedType */: return bindAnonymousTypeWorker(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return bindFunctionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return bindJsxAttributes(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return bindImportClause(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return bindExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return bindExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 208 /* Block */: + case 211 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 284 /* JSDocParameterTag */: - if (node.parent.kind !== 280 /* JSDocTypeLiteral */) { + case 287 /* JSDocParameterTag */: + if (node.parent.kind !== 283 /* JSDocTypeLiteral */) { break; } // falls through - case 289 /* JSDocPropertyTag */: + case 292 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 276 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 279 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 288 /* JSDocTypedefTag */: { + case 291 /* JSDocTypedefTag */: { var fullName = node.fullName; if (!fullName || fullName.kind === 71 /* Identifier */) { return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); @@ -21643,7 +22080,7 @@ var ts; if (parameterName && parameterName.kind === 71 /* Identifier */) { checkStrictModeIdentifier(parameterName); } - if (parameterName && parameterName.kind === 170 /* ThisType */) { + if (parameterName && parameterName.kind === 173 /* ThisType */) { seenThisKeyword = true; } bind(type); @@ -21663,7 +22100,7 @@ var ts; bindAnonymousDeclaration(node, 2097152 /* Alias */, getDeclarationName(node)); } else { - var flags = node.kind === 244 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 247 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) // An export default clause with an EntityNameExpression exports all meanings of that identifier ? 2097152 /* Alias */ // An export default clause with any other expression exports a value @@ -21677,7 +22114,7 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 269 /* SourceFile */) { + if (node.parent.kind !== 272 /* SourceFile */) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } @@ -21724,27 +22161,13 @@ var ts; setCommonJsModuleIndicator(node); declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); } - function isExportsOrModuleExportsOrAlias(node) { - return ts.isExportsIdentifier(node) || - ts.isModuleExportsPropertyAccessExpression(node) || - ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(node); - } - function isNameOfExportsOrModuleExportsAliasDeclaration(node) { - var symbol = lookupSymbolForName(node.escapedText); - return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && - symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer); - } - function isExportsOrModuleExportsOrAliasOrAssignment(node) { - return isExportsOrModuleExportsOrAlias(node) || - (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(node.left) || isExportsOrModuleExportsOrAliasOrAssignment(node.right))); - } function bindModuleExportsAssignment(node) { // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' // is still pointing to 'module.exports'. // We do not want to consider this as 'export=' since a module can have only one of these. // Similarly we do not want to treat 'module.exports = exports' as an 'export='. var assignedExpression = ts.getRightMostAssignedExpression(node.right); - if (ts.isEmptyObjectLiteral(assignedExpression) || isExportsOrModuleExportsOrAlias(assignedExpression)) { + if (ts.isEmptyObjectLiteral(assignedExpression) || container === file && isExportsOrModuleExportsOrAlias(file, assignedExpression)) { // Mark it as a module in case there are no other exports in the file setCommonJsModuleIndicator(node); return; @@ -21757,18 +22180,18 @@ var ts; ts.Debug.assert(ts.isInJavaScriptFile(node)); var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (container.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Declare a 'member' if the container is an ES5 class or ES6 constructor container.symbol.members = container.symbol.members || ts.createSymbolTable(); // It's acceptable for multiple 'this' assignments of the same identifier to occur declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); break; - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = container.parent; @@ -21782,8 +22205,8 @@ var ts; if (node.expression.kind === 99 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */) && - node.parent.parent.kind === 269 /* SourceFile */) { + else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */) && + node.parent.parent.kind === 272 /* SourceFile */) { bindStaticPropertyAssignment(node); } } @@ -21807,15 +22230,15 @@ var ts; function bindStaticPropertyAssignment(node) { // Look up the function in the local scope, since static assignments should // follow the function declaration - var leftSideOfAssignment = node.kind === 180 /* PropertyAccessExpression */ ? node : node.left; + var leftSideOfAssignment = node.kind === 183 /* PropertyAccessExpression */ ? node : node.left; var target = leftSideOfAssignment.expression; if (ts.isIdentifier(target)) { // Fix up parent pointers since we're going to use these nodes before we bind into them target.parent = leftSideOfAssignment; - if (node.kind === 195 /* BinaryExpression */) { + if (node.kind === 198 /* BinaryExpression */) { leftSideOfAssignment.parent = node; } - if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + if (container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, target)) { // This can be an alias for the 'exports' or 'module.exports' names, e.g. // var util = module.exports; // util.property = function ... @@ -21827,26 +22250,22 @@ var ts; } } function lookupSymbolForName(name) { - var local = container.locals && container.locals.get(name); - if (local) { - return local.exportSymbol || local; - } - return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + return lookupSymbolForNameWorker(container, name); } function bindPropertyAssignment(functionName, propertyAccess, isPrototypeProperty) { var symbol = lookupSymbolForName(functionName); var targetSymbol = symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol) ? symbol.valueDeclaration.initializer.symbol : symbol; - ts.Debug.assert(propertyAccess.parent.kind === 195 /* BinaryExpression */ || propertyAccess.parent.kind === 211 /* ExpressionStatement */); + ts.Debug.assert(propertyAccess.parent.kind === 198 /* BinaryExpression */ || propertyAccess.parent.kind === 214 /* ExpressionStatement */); var isLegalPosition; - if (propertyAccess.parent.kind === 195 /* BinaryExpression */) { + if (propertyAccess.parent.kind === 198 /* BinaryExpression */) { var initializerKind = propertyAccess.parent.right.kind; - isLegalPosition = (initializerKind === 200 /* ClassExpression */ || initializerKind === 187 /* FunctionExpression */) && - propertyAccess.parent.parent.parent.kind === 269 /* SourceFile */; + isLegalPosition = (initializerKind === 203 /* ClassExpression */ || initializerKind === 190 /* FunctionExpression */) && + propertyAccess.parent.parent.parent.kind === 272 /* SourceFile */; } else { - isLegalPosition = propertyAccess.parent.parent.kind === 269 /* SourceFile */; + isLegalPosition = propertyAccess.parent.parent.kind === 272 /* SourceFile */; } if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & 1920 /* Namespace */)) && isLegalPosition) { ts.Debug.assert(ts.isIdentifier(propertyAccess.expression)); @@ -21878,7 +22297,7 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); } else { @@ -21947,7 +22366,7 @@ var ts; checkStrictModeEvalOrArguments(node, node.name); } if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + ts.indexOf(node.parent.parameters, node)); + bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + node.parent.parameters.indexOf(node)); } else { declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); @@ -21998,6 +22417,22 @@ var ts; ? bindAnonymousDeclaration(node, symbolFlags, "__computed" /* Computed */) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + function bindTypeParameter(node) { + if (node.parent.kind === 171 /* InferType */) { + if (inferenceContainer) { + if (!inferenceContainer.locals) { + inferenceContainer.locals = ts.createSymbolTable(); + } + declareSymbol(inferenceContainer.locals, /*parent*/ undefined, node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); + } + else { + bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); + } + } + else { + declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); + } + } // reachability checks function shouldReportErrorOnModuleDeclaration(node) { var instanceState = getModuleInstanceState(node); @@ -22010,13 +22445,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 210 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 213 /* EmptyStatement */) || // report error on class declarations - node.kind === 230 /* ClassDeclaration */ || + node.kind === 233 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 234 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 237 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 233 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 236 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -22030,7 +22465,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !(node.flags & 2097152 /* Ambient */) && - (node.kind !== 209 /* VariableStatement */ || + (node.kind !== 212 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -22041,6 +22476,29 @@ var ts; return true; } } + /* @internal */ + function isExportsOrModuleExportsOrAlias(sourceFile, node) { + return ts.isExportsIdentifier(node) || + ts.isModuleExportsPropertyAccessExpression(node) || + ts.isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node); + } + ts.isExportsOrModuleExportsOrAlias = isExportsOrModuleExportsOrAlias; + function isNameOfExportsOrModuleExportsAliasDeclaration(sourceFile, node) { + var symbol = lookupSymbolForNameWorker(sourceFile, node.escapedText); + return symbol && symbol.valueDeclaration && ts.isVariableDeclaration(symbol.valueDeclaration) && + symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, symbol.valueDeclaration.initializer); + } + function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { + return isExportsOrModuleExportsOrAlias(sourceFile, node) || + (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); + } + function lookupSymbolForNameWorker(container, name) { + var local = container.locals && container.locals.get(name); + if (local) { + return local.exportSymbol || local; + } + return container.symbol && container.symbol.exports && container.symbol.exports.get(name); + } /** * Computes the transform flags for a node, given the transform flags of its subtree * @@ -22050,57 +22508,59 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 147 /* Parameter */: + case 148 /* Parameter */: return computeParameter(node, subtreeFlags); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 153 /* Constructor */: + case 154 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); + case 184 /* ElementAccessExpression */: + return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); } @@ -22109,15 +22569,19 @@ var ts; function computeCallExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var expression = node.expression; - var expressionKind = expression.kind; if (node.typeArguments) { transformFlags |= 3 /* AssertTypeScript */; } if (subtreeFlags & 524288 /* ContainsSpread */ - || isSuperOrSuperProperty(expression, expressionKind)) { + || (expression.transformFlags & (134217728 /* Super */ | 268435456 /* ContainsSuper */))) { // If the this node contains a SpreadExpression, or is a super call, then it is an ES6 // node. transformFlags |= 192 /* AssertES2015 */; + // super property or element accesses could be inside lambdas, etc, and need a captured `this`, + // while super keyword for super calls (indicated by TransformFlags.Super) does not (since it can only be top-level in a constructor) + if (expression.transformFlags & 268435456 /* ContainsSuper */) { + transformFlags |= 16384 /* ContainsLexicalThis */; + } } if (expression.kind === 91 /* ImportKeyword */) { transformFlags |= 67108864 /* ContainsDynamicImport */; @@ -22128,19 +22592,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537396545 /* ArrayLiteralOrCallOrNewExcludes */; - } - function isSuperOrSuperProperty(node, kind) { - switch (kind) { - case 97 /* SuperKeyword */: - return true; - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - var expression = node.expression; - var expressionKind = expression.kind; - return expressionKind === 97 /* SuperKeyword */; - } - return false; + return transformFlags & ~940049729 /* ArrayLiteralOrCallOrNewExcludes */; } function computeNewExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22153,18 +22605,18 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537396545 /* ArrayLiteralOrCallOrNewExcludes */; + return transformFlags & ~940049729 /* ArrayLiteralOrCallOrNewExcludes */; } function computeBinaryExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 179 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 182 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ESNext if they contain rest transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 178 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 181 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } @@ -22174,7 +22626,7 @@ var ts; transformFlags |= 32 /* AssertES2016 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeParameter(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22203,7 +22655,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */ | 131072 /* ContainsDefaultValueAssignments */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* ParameterExcludes */; + return transformFlags & ~939525441 /* ParameterExcludes */; } function computeParenthesizedExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22213,8 +22665,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 203 /* AsExpression */ - || expressionKind === 185 /* TypeAssertionExpression */) { + if (expressionKind === 206 /* AsExpression */ + || expressionKind === 188 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -22223,7 +22675,7 @@ var ts; transformFlags |= 1024 /* DestructuringAssignment */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~536872257 /* OuterExpressionExcludes */; } function computeClassDeclaration(node, subtreeFlags) { var transformFlags; @@ -22249,7 +22701,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~539358529 /* ClassExcludes */; + return transformFlags & ~942011713 /* ClassExcludes */; } function computeClassExpression(node, subtreeFlags) { // A ClassExpression is ES6 syntax. @@ -22266,7 +22718,7 @@ var ts; transformFlags |= 16384 /* ContainsLexicalThis */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~539358529 /* ClassExcludes */; + return transformFlags & ~942011713 /* ClassExcludes */; } function computeHeritageClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22284,7 +22736,7 @@ var ts; break; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeCatchClause(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22295,7 +22747,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~537920833 /* CatchClauseExcludes */; + return transformFlags & ~940574017 /* CatchClauseExcludes */; } function computeExpressionWithTypeArguments(node, subtreeFlags) { // An ExpressionWithTypeArguments is ES6 syntax, as it is used in the @@ -22307,7 +22759,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeConstructor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22321,7 +22773,7 @@ var ts; transformFlags |= 8 /* AssertESNext */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* ConstructorExcludes */; + return transformFlags & ~1003668801 /* ConstructorExcludes */; } function computeMethod(node, subtreeFlags) { // A MethodDeclaration is ES6 syntax. @@ -22348,7 +22800,7 @@ var ts; transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* MethodOrAccessorExcludes */; + return transformFlags & ~1003668801 /* MethodOrAccessorExcludes */; } function computeAccessor(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22366,7 +22818,7 @@ var ts; transformFlags |= 8 /* AssertESNext */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601015617 /* MethodOrAccessorExcludes */; + return transformFlags & ~1003668801 /* MethodOrAccessorExcludes */; } function computePropertyDeclaration(node, subtreeFlags) { // A PropertyDeclaration is TypeScript syntax. @@ -22377,7 +22829,7 @@ var ts; transformFlags |= 8192 /* ContainsPropertyInitializer */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeFunctionDeclaration(node, subtreeFlags) { var transformFlags; @@ -22421,7 +22873,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601281857 /* FunctionExcludes */; + return transformFlags & ~1003935041 /* FunctionExcludes */; } function computeFunctionExpression(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22453,7 +22905,7 @@ var ts; transformFlags |= 768 /* AssertGenerator */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601281857 /* FunctionExcludes */; + return transformFlags & ~1003935041 /* FunctionExcludes */; } function computeArrowFunction(node, subtreeFlags) { // An ArrowFunction is ES6 syntax, and excludes markers that should not escape the scope of an ArrowFunction. @@ -22478,19 +22930,31 @@ var ts; transformFlags |= 32768 /* ContainsCapturedLexicalThis */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~601249089 /* ArrowFunctionExcludes */; + return transformFlags & ~1003902273 /* ArrowFunctionExcludes */; } function computePropertyAccess(node, subtreeFlags) { var transformFlags = subtreeFlags; - var expression = node.expression; - var expressionKind = expression.kind; // If a PropertyAccessExpression starts with a super keyword, then it is // ES6 syntax, and requires a lexical `this` binding. - if (expressionKind === 97 /* SuperKeyword */) { - transformFlags |= 16384 /* ContainsLexicalThis */; + if (transformFlags & 134217728 /* Super */) { + transformFlags ^= 134217728 /* Super */; + transformFlags |= 268435456 /* ContainsSuper */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~671089985 /* PropertyAccessExcludes */; + } + function computeElementAccess(node, subtreeFlags) { + var transformFlags = subtreeFlags; + var expression = node.expression; + var expressionFlags = expression.transformFlags; // We do not want to aggregate flags from the argument expression for super/this capturing + // If an ElementAccessExpression starts with a super keyword, then it is + // ES6 syntax, and requires a lexical `this` binding. + if (expressionFlags & 134217728 /* Super */) { + transformFlags &= ~134217728 /* Super */; + transformFlags |= 268435456 /* ContainsSuper */; + } + node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; + return transformFlags & ~671089985 /* PropertyAccessExcludes */; } function computeVariableDeclaration(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22504,7 +22968,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeVariableStatement(node, subtreeFlags) { var transformFlags; @@ -22520,7 +22984,7 @@ var ts; } } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeLabeledStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22530,7 +22994,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeImportEquals(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22539,7 +23003,7 @@ var ts; transformFlags |= 3 /* AssertTypeScript */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeExpressionStatement(node, subtreeFlags) { var transformFlags = subtreeFlags; @@ -22550,7 +23014,7 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~536872257 /* NodeExcludes */; + return transformFlags & ~939525441 /* NodeExcludes */; } function computeModuleDeclaration(node, subtreeFlags) { var transformFlags = 3 /* AssertTypeScript */; @@ -22559,7 +23023,7 @@ var ts; transformFlags |= subtreeFlags; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~574674241 /* ModuleExcludes */; + return transformFlags & ~977327425 /* ModuleExcludes */; } function computeVariableDeclarationList(node, subtreeFlags) { var transformFlags = subtreeFlags | 33554432 /* ContainsHoistedDeclarationOrCompletion */; @@ -22571,45 +23035,50 @@ var ts; transformFlags |= 192 /* AssertES2015 */ | 4194304 /* ContainsBlockScopedBinding */; } node.transformFlags = transformFlags | 536870912 /* HasComputedFlags */; - return transformFlags & ~546309441 /* VariableDeclarationListExcludes */; + return transformFlags & ~948962625 /* VariableDeclarationListExcludes */; } function computeOther(node, kind, subtreeFlags) { // Mark transformations needed for each node var transformFlags = subtreeFlags; - var excludeFlags = 536872257 /* NodeExcludes */; + var excludeFlags = 939525441 /* NodeExcludes */; switch (kind) { case 120 /* AsyncKeyword */: - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + // These nodes are TypeScript syntax. + transformFlags |= 3 /* AssertTypeScript */; + excludeFlags = 536872257 /* OuterExpressionExcludes */; + break; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 117 /* AbstractKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: - case 131 /* ReadonlyKeyword */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 207 /* NonNullExpression */: + case 132 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: case 10 /* JsxText */: - case 253 /* JsxClosingElement */: - case 254 /* JsxFragment */: - case 255 /* JsxOpeningFragment */: - case 256 /* JsxClosingFragment */: - case 257 /* JsxAttribute */: - case 258 /* JsxAttributes */: - case 259 /* JsxSpreadAttribute */: - case 260 /* JsxExpression */: + case 256 /* JsxClosingElement */: + case 257 /* JsxFragment */: + case 258 /* JsxOpeningFragment */: + case 259 /* JsxClosingFragment */: + case 260 /* JsxAttribute */: + case 261 /* JsxAttributes */: + case 262 /* JsxSpreadAttribute */: + case 263 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; @@ -22617,11 +23086,11 @@ var ts; case 14 /* TemplateHead */: case 15 /* TemplateMiddle */: case 16 /* TemplateTail */: - case 197 /* TemplateExpression */: - case 184 /* TaggedTemplateExpression */: - case 266 /* ShorthandPropertyAssignment */: + case 200 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 269 /* ShorthandPropertyAssignment */: case 115 /* StaticKeyword */: - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; @@ -22635,56 +23104,58 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 8 /* AssertESNext */; } transformFlags |= 192 /* AssertES2015 */; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; break; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 159 /* TypePredicate */: - case 160 /* TypeReference */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 163 /* TypeQuery */: - case 164 /* TypeLiteral */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: - case 237 /* NamespaceExportDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 160 /* TypePredicate */: + case 161 /* TypeReference */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 164 /* TypeQuery */: + case 165 /* TypeLiteral */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 171 /* InferType */: + case 172 /* ParenthesizedType */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: + case 240 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. @@ -22701,43 +23172,44 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; case 97 /* SuperKeyword */: // This node is ES6 syntax. - transformFlags |= 192 /* AssertES2015 */; + transformFlags |= 192 /* AssertES2015 */ | 134217728 /* Super */; + excludeFlags = 536872257 /* OuterExpressionExcludes */; // must be set to persist `Super` break; case 99 /* ThisKeyword */: // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } - excludeFlags = 537396545 /* BindingPatternExcludes */; + excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; - excludeFlags = 537396545 /* BindingPatternExcludes */; + excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 179 /* ObjectLiteralExpression */: - excludeFlags = 540087617 /* ObjectLiteralExcludes */; + case 182 /* ObjectLiteralExpression */: + excludeFlags = 942740801 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it // is an ES6 node. @@ -22754,32 +23226,32 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 178 /* ArrayLiteralExpression */: - case 183 /* NewExpression */: - excludeFlags = 537396545 /* ArrayLiteralOrCallOrNewExcludes */; + case 181 /* ArrayLiteralExpression */: + case 186 /* NewExpression */: + excludeFlags = 940049729 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 // node. transformFlags |= 192 /* AssertES2015 */; } break; - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 220 /* ReturnStatement */: - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 223 /* ReturnStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -22795,60 +23267,69 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) { + if (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 178 /* ArrayLiteralExpression */: - return 537396545 /* ArrayLiteralOrCallOrNewExcludes */; - case 234 /* ModuleDeclaration */: - return 574674241 /* ModuleExcludes */; - case 147 /* Parameter */: - return 536872257 /* ParameterExcludes */; - case 188 /* ArrowFunction */: - return 601249089 /* ArrowFunctionExcludes */; - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - return 601281857 /* FunctionExcludes */; - case 228 /* VariableDeclarationList */: - return 546309441 /* VariableDeclarationListExcludes */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return 539358529 /* ClassExcludes */; - case 153 /* Constructor */: - return 601015617 /* ConstructorExcludes */; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return 601015617 /* MethodOrAccessorExcludes */; + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 181 /* ArrayLiteralExpression */: + return 940049729 /* ArrayLiteralOrCallOrNewExcludes */; + case 237 /* ModuleDeclaration */: + return 977327425 /* ModuleExcludes */; + case 148 /* Parameter */: + return 939525441 /* ParameterExcludes */; + case 191 /* ArrowFunction */: + return 1003902273 /* ArrowFunctionExcludes */; + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + return 1003935041 /* FunctionExcludes */; + case 231 /* VariableDeclarationList */: + return 948962625 /* VariableDeclarationListExcludes */; + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + return 942011713 /* ClassExcludes */; + case 154 /* Constructor */: + return 1003668801 /* ConstructorExcludes */; + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return 1003668801 /* MethodOrAccessorExcludes */; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 136 /* StringKeyword */: - case 134 /* ObjectKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 135 /* ObjectKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 179 /* ObjectLiteralExpression */: - return 540087617 /* ObjectLiteralExcludes */; - case 264 /* CatchClause */: - return 537920833 /* CatchClauseExcludes */; - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - return 537396545 /* BindingPatternExcludes */; + case 182 /* ObjectLiteralExpression */: + return 942740801 /* ObjectLiteralExcludes */; + case 267 /* CatchClause */: + return 940574017 /* CatchClauseExcludes */; + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + return 940049729 /* BindingPatternExcludes */; + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + case 189 /* ParenthesizedExpression */: + case 97 /* SuperKeyword */: + return 536872257 /* OuterExpressionExcludes */; + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + return 671089985 /* PropertyAccessExcludes */; default: - return 536872257 /* NodeExcludes */; + return 939525441 /* NodeExcludes */; } } ts.getTransformFlagsSubtreeExclusions = getTransformFlagsSubtreeExclusions; @@ -22864,7 +23345,7 @@ var ts; /** @internal */ var ts; (function (ts) { - function createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { + function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier) { return getSymbolWalker; function getSymbolWalker(accept) { if (accept === void 0) { accept = function () { return true; }; } @@ -22960,8 +23441,9 @@ var ts; visitType(type.modifiersType); } function visitSignature(signature) { - if (signature.typePredicate) { - visitType(signature.typePredicate.type); + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { + visitType(typePredicate.type); } ts.forEach(signature.typeParameters, visitType); for (var _i = 0, _a = signature.parameters; _i < _a.length; _i++) { @@ -23019,7 +23501,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 163 /* TypeQuery */) { + if (d.type && d.type.kind === 164 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -23067,9 +23549,9 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, + resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } @@ -23623,8 +24105,8 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); + var _a = result.value, resolved = _a.resolved, originalPath = _a.originalPath, isExternalLibraryImport = _a.isExternalLibraryImport; + return createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { @@ -23641,11 +24123,17 @@ var ts; if (!resolved_1) return undefined; var resolvedValue = resolved_1.value; - if (!compilerOptions.preserveSymlinks) { - resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + var originalPath = void 0; + if (!compilerOptions.preserveSymlinks && resolvedValue) { + originalPath = resolvedValue.path; + var path = realPath(resolved_1.value.path, host, traceEnabled); + if (path === originalPath) { + originalPath = undefined; + } + resolvedValue = __assign({}, resolvedValue, { path: path }); } // For node_modules lookups, get the real path so that multiple accesses to an `npm link`-ed module do not create duplicate files. - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, originalPath: originalPath, isExternalLibraryImport: true } }; } else { var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; @@ -23681,7 +24169,9 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return noPackageId(resolvedFromFile); + var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; + var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, /*onlyRecordFailures*/ false, state).packageId; + return withPackageId(packageId, resolvedFromFile); } } if (!onlyRecordFailures) { @@ -23695,6 +24185,49 @@ var ts; } return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } + var nodeModulesPathPart = "/node_modules/"; + /** + * This will be called on the successfully resolved path from `loadModuleFromFile`. + * (Not neeeded for `loadModuleFromNodeModules` as that looks up the `package.json` as part of resolution.) + * + * packageDirectory is the directory of the package itself. + * subModuleName is the path within the package. + * For `blah/node_modules/foo/index.d.ts` this is { packageDirectory: "foo", subModuleName: "index.d.ts" }. (Part before "/node_modules/" is ignored.) + * For `/node_modules/foo/bar.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. + * For `/node_modules/@types/foo/bar/index.d.ts` this is { packageDirectory: "@types/foo", subModuleName: "bar/index.d.ts" }. + * For `/node_modules/foo/bar/index.d.ts` this is { packageDirectory: "foo", subModuleName": "bar/index.d.ts" }. + */ + function parseNodeModuleFromPath(resolved) { + var path = ts.normalizePath(resolved.path); + var idx = path.lastIndexOf(nodeModulesPathPart); + if (idx === -1) { + return undefined; + } + var indexAfterNodeModules = idx + nodeModulesPathPart.length; + var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules); + if (path.charCodeAt(indexAfterNodeModules) === 64 /* at */) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName); + } + var packageDirectory = path.slice(0, indexAfterPackageName); + var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts" /* Dts */; + return { packageDirectory: packageDirectory, subModuleName: subModuleName }; + } + function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) { + var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; + } + function addExtensionAndIndex(path) { + if (path === "") { + return "index.d.ts"; + } + if (ts.endsWith(path, ".d.ts")) { + return path; + } + if (ts.endsWith(path, "/index")) { + return path + ".d.ts"; + } + return path + "/index.d.ts"; + } /* @internal */ function directoryProbablyExists(directoryName, host) { // if host does not support 'directoryExists' assume that directory will exist @@ -23780,18 +24313,41 @@ var ts; var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } - function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) { - var host = _a.host, traceEnabled = _a.traceEnabled; + function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) { + var host = state.host, traceEnabled = state.traceEnabled; var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host); var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } var packageJsonContent = readJson(packageJsonPath, host); + if (subModuleName === "") { + var path = tryReadPackageJsonFields(/*readTypes*/ true, packageJsonContent, nodeModuleDirectory, state); + if (typeof path === "string") { + subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); + } + else { + var jsPath = tryReadPackageJsonFields(/*readTypes*/ false, packageJsonContent, nodeModuleDirectory, state); + if (typeof jsPath === "string") { + subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js" /* Js */), ".jsx" /* Jsx */) + ".d.ts" /* Dts */; + } + else { + subModuleName = "index.d.ts"; + } + } + } + if (!ts.endsWith(subModuleName, ".d.ts" /* Dts */)) { + subModuleName = addExtensionAndIndex(subModuleName); + } var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string" ? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version } : undefined; + if (traceEnabled) { + if (packageId) { + trace(host, ts.Diagnostics.Found_package_json_at_0_Package_ID_is_1, packageJsonPath, ts.packageIdToString(packageId)); + } + else { + trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + } return { found: true, packageJsonContent: packageJsonContent, packageId: packageId }; } else { @@ -23949,13 +24505,18 @@ var ts; function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); if (withoutAtTypePrefix !== mangledName) { - return ts.stringContains(withoutAtTypePrefix, mangledScopedPackageSeparator) ? - "@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) : - withoutAtTypePrefix; + return getUnmangledNameForScopedPackage(withoutAtTypePrefix); } return mangledName; } ts.getPackageNameFromAtTypesDirectory = getPackageNameFromAtTypesDirectory; + /* @internal */ + function getUnmangledNameForScopedPackage(typesPackageName) { + return ts.stringContains(typesPackageName, mangledScopedPackageSeparator) ? + "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) : + typesPackageName; + } + ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { var result = cache && cache.get(containingDirectory); if (result) { @@ -23971,7 +24532,8 @@ var ts; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*isExternalLibraryImport*/ false, failedLookupLocations); + // No originalPath because classic resolution doesn't resolve realPath + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, /*originalPath*/ undefined, /*isExternalLibraryImport*/ false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { @@ -24016,7 +24578,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); - return createResolvedModuleWithFailedLookupLocations(resolved, /*isExternalLibraryImport*/ true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, /*originalPath*/ undefined, /*isExternalLibraryImport*/ true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; /** @@ -24146,6 +24708,11 @@ var ts; typeToTypeNode: nodeBuilder.typeToTypeNode, indexInfoToIndexSignatureDeclaration: nodeBuilder.indexInfoToIndexSignatureDeclaration, signatureToSignatureDeclaration: nodeBuilder.signatureToSignatureDeclaration, + symbolToEntityName: nodeBuilder.symbolToEntityName, + symbolToExpression: nodeBuilder.symbolToExpression, + symbolToTypeParameterDeclarations: nodeBuilder.symbolToTypeParameterDeclarations, + symbolToParameterDeclaration: nodeBuilder.symbolToParameterDeclaration, + typeParameterToDeclaration: nodeBuilder.typeParameterToDeclaration, getSymbolsInScope: function (location, meaning) { location = ts.getParseTreeNode(location); return location ? getSymbolsInScope(location, meaning) : []; @@ -24179,16 +24746,40 @@ var ts; typeToString: function (type, enclosingDeclaration, flags) { return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags); }, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: function (symbol, enclosingDeclaration, meaning) { - return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning); + symbolToString: function (symbol, enclosingDeclaration, meaning, flags) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags); }, + typePredicateToString: function (predicate, enclosingDeclaration, flags) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags); + }, + writeSignature: function (signature, enclosingDeclaration, flags, kind, writer) { + return signatureToString(signature, ts.getParseTreeNode(enclosingDeclaration), flags, kind, writer); + }, + writeType: function (type, enclosingDeclaration, flags, writer) { + return typeToString(type, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + writeSymbol: function (symbol, enclosingDeclaration, meaning, flags, writer) { + return symbolToString(symbol, ts.getParseTreeNode(enclosingDeclaration), meaning, flags, writer); + }, + writeTypePredicate: function (predicate, enclosingDeclaration, flags, writer) { + return typePredicateToString(predicate, ts.getParseTreeNode(enclosingDeclaration), flags, writer); + }, + getSymbolDisplayBuilder: getSymbolDisplayBuilder, getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, getRootSymbols: getRootSymbols, getContextualType: function (node) { node = ts.getParseTreeNode(node, ts.isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: function (node, argIndex) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, + isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) { node = ts.getParseTreeNode(node, ts.isCallLikeExpression); @@ -24203,7 +24794,11 @@ var ts; }, isValidPropertyAccess: function (node, propertyName) { node = ts.getParseTreeNode(node, ts.isPropertyAccessOrQualifiedName); - return node ? isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)) : false; + return !!node && isValidPropertyAccess(node, ts.escapeLeadingUnderscores(propertyName)); + }, + isValidPropertyAccessForCompletions: function (node, type, property) { + node = ts.getParseTreeNode(node, ts.isPropertyAccessExpression); + return !!node && isValidPropertyAccessForCompletions(node, type, property); }, getSignatureFromDeclaration: function (declaration) { declaration = ts.getParseTreeNode(declaration, ts.isFunctionLike); @@ -24227,7 +24822,7 @@ var ts; getEmitResolver: getEmitResolver, getExportsOfModule: getExportsOfModuleAsArray, getExportsAndPropertiesOfModule: getExportsAndPropertiesOfModule, - getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), + getSymbolWalker: ts.createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignature, getReturnTypeOfSignature, getBaseTypes, resolveStructuredTypeMembers, getTypeOfSymbol, getResolvedSymbol, getIndexTypeOfStructuredType, getConstraintFromTypeParameter, getFirstIdentifier), getAmbientModules: getAmbientModules, getAllAttributesTypeFromJsxOpeningLikeElement: function (node) { node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); @@ -24269,28 +24864,40 @@ var ts; getSuggestionForNonexistentSymbol: function (location, name, meaning) { return getSuggestionForNonexistentSymbol(location, ts.escapeLeadingUnderscores(name), meaning); }, getBaseConstraintOfType: getBaseConstraintOfType, getDefaultFromTypeParameter: function (type) { return type && type.flags & 32768 /* TypeParameter */ ? getDefaultFromTypeParameter(type) : undefined; }, - resolveName: function (name, location, meaning) { - return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); + resolveName: function (name, location, meaning, excludeGlobals) { + return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals); }, getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, getAccessibleSymbolChain: getAccessibleSymbolChain, + getTypePredicateOfSignature: getTypePredicateOfSignature, + resolveExternalModuleSymbol: resolveExternalModuleSymbol, + tryGetThisTypeAt: function (node) { + node = ts.getParseTreeNode(node); + return node && tryGetThisTypeAt(node); + }, + getTypeArgumentConstraint: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, }; var tupleTypes = []; var unionTypes = ts.createMap(); var intersectionTypes = ts.createMap(); var literalTypes = ts.createMap(); var indexedAccessTypes = ts.createMap(); + var conditionalTypes = ts.createMap(); var evolvingArrayTypes = []; var undefinedProperties = ts.createMap(); var unknownSymbol = createSymbol(4 /* Property */, "unknown"); var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); var undefinedType = createIntrinsicType(4096 /* Undefined */, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 4194304 /* ContainsWideningType */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 16777216 /* ContainsWideningType */, "undefined"); var nullType = createIntrinsicType(8192 /* Null */, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 4194304 /* ContainsWideningType */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 16777216 /* ContainsWideningType */, "null"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); var trueType = createIntrinsicType(128 /* BooleanLiteral */, "true"); @@ -24301,7 +24908,7 @@ var ts; var neverType = createIntrinsicType(16384 /* Never */, "never"); var silentNeverType = createIntrinsicType(16384 /* Never */, "never"); var implicitNeverType = createIntrinsicType(16384 /* Never */, "never"); - var nonPrimitiveType = createIntrinsicType(33554432 /* NonPrimitive */, "object"); + var nonPrimitiveType = createIntrinsicType(134217728 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = ts.createSymbolTable(); @@ -24311,7 +24918,7 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. - anyFunctionType.flags |= 16777216 /* ContainsAnyFunctionType */; + anyFunctionType.flags |= 67108864 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -24319,13 +24926,15 @@ var ts; var markerSubType = createType(32768 /* TypeParameter */); markerSubType.constraint = markerSuperType; var markerOtherType = createType(32768 /* TypeParameter */); - var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); - var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var noTypePredicate = createIdentifierTypePredicate("<>", 0, anyType); + var anySignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var unknownSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, unknownType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var resolvingSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, anyType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + var silentNeverSignature = createSignature(undefined, undefined, undefined, ts.emptyArray, silentNeverType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); var enumNumberIndexInfo = createIndexInfo(stringType, /*isReadonly*/ true); var jsObjectLiteralIndexInfo = createIndexInfo(anyType, /*isReadonly*/ false); var globals = ts.createSymbolTable(); + var reverseMappedCache = ts.createMap(); var ambientModulesCache; /** * List of every ambient module with a "*" wildcard. @@ -24489,23 +25098,24 @@ var ts; var jsxTypes = ts.createUnderscoreEscapedMap(); var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); + var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); - // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. - var _displayBuilder; var TypeSystemPropertyName; (function (TypeSystemPropertyName) { TypeSystemPropertyName[TypeSystemPropertyName["Type"] = 0] = "Type"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstructorType"] = 1] = "ResolvedBaseConstructorType"; TypeSystemPropertyName[TypeSystemPropertyName["DeclaredType"] = 2] = "DeclaredType"; TypeSystemPropertyName[TypeSystemPropertyName["ResolvedReturnType"] = 3] = "ResolvedReturnType"; + TypeSystemPropertyName[TypeSystemPropertyName["ResolvedBaseConstraint"] = 4] = "ResolvedBaseConstraint"; })(TypeSystemPropertyName || (TypeSystemPropertyName = {})); var CheckMode; (function (CheckMode) { CheckMode[CheckMode["Normal"] = 0] = "Normal"; CheckMode[CheckMode["SkipContextSensitive"] = 1] = "SkipContextSensitive"; CheckMode[CheckMode["Inferential"] = 2] = "Inferential"; + CheckMode[CheckMode["Contextual"] = 3] = "Contextual"; })(CheckMode || (CheckMode = {})); var CallbackCheck; (function (CallbackCheck) { @@ -24515,8 +25125,10 @@ var ts; })(CallbackCheck || (CallbackCheck = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { - MappedTypeModifiers[MappedTypeModifiers["Readonly"] = 1] = "Readonly"; - MappedTypeModifiers[MappedTypeModifiers["Optional"] = 2] = "Optional"; + MappedTypeModifiers[MappedTypeModifiers["IncludeReadonly"] = 1] = "IncludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeReadonly"] = 2] = "ExcludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["IncludeOptional"] = 4] = "IncludeOptional"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeOptional"] = 8] = "ExcludeOptional"; })(MappedTypeModifiers || (MappedTypeModifiers = {})); var ExpandingFlags; (function (ExpandingFlags) { @@ -24525,6 +25137,21 @@ var ts; ExpandingFlags[ExpandingFlags["Target"] = 2] = "Target"; ExpandingFlags[ExpandingFlags["Both"] = 3] = "Both"; })(ExpandingFlags || (ExpandingFlags = {})); + var TypeIncludes; + (function (TypeIncludes) { + TypeIncludes[TypeIncludes["Any"] = 1] = "Any"; + TypeIncludes[TypeIncludes["Undefined"] = 2] = "Undefined"; + TypeIncludes[TypeIncludes["Null"] = 4] = "Null"; + TypeIncludes[TypeIncludes["Never"] = 8] = "Never"; + TypeIncludes[TypeIncludes["NonWideningType"] = 16] = "NonWideningType"; + TypeIncludes[TypeIncludes["String"] = 32] = "String"; + TypeIncludes[TypeIncludes["Number"] = 64] = "Number"; + TypeIncludes[TypeIncludes["ESSymbol"] = 128] = "ESSymbol"; + TypeIncludes[TypeIncludes["LiteralOrUniqueESSymbol"] = 256] = "LiteralOrUniqueESSymbol"; + TypeIncludes[TypeIncludes["ObjectType"] = 512] = "ObjectType"; + TypeIncludes[TypeIncludes["EmptyObject"] = 1024] = "EmptyObject"; + TypeIncludes[TypeIncludes["Union"] = 2048] = "Union"; + })(TypeIncludes || (TypeIncludes = {})); var MembersOrExportsResolutionKind; (function (MembersOrExportsResolutionKind) { MembersOrExportsResolutionKind["resolvedExports"] = "resolvedExports"; @@ -24535,6 +25162,142 @@ var ts; var isNotOverloadAndNotAccessor = ts.and(isNotOverload, isNotAccessor); initializeTypeChecker(); return checker; + /** + * @deprecated + */ + function getSymbolDisplayBuilder() { + return { + buildTypeDisplay: function (type, writer, enclosingDeclaration, flags) { + typeToString(type, enclosingDeclaration, flags, emitTextWriterWrapper(writer)); + }, + buildSymbolDisplay: function (symbol, writer, enclosingDeclaration, meaning, flags) { + symbolToString(symbol, enclosingDeclaration, meaning, flags | 4 /* AllowAnyNodeKind */, emitTextWriterWrapper(writer)); + }, + buildSignatureDisplay: function (signature, writer, enclosing, flags, kind) { + signatureToString(signature, enclosing, flags, kind, emitTextWriterWrapper(writer)); + }, + buildIndexSignatureDisplay: function (info, writer, kind, enclosing, flags) { + var sig = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, kind, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, sig, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildParameterDisplay: function (symbol, writer, enclosing, flags) { + var node = nodeBuilder.symbolToParameterDeclaration(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplay: function (tp, writer, enclosing, flags) { + var node = nodeBuilder.typeParameterToDeclaration(tp, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 8192 /* OmitParameterModifiers */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildTypePredicateDisplay: function (predicate, writer, enclosing, flags) { + typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + }, + buildTypeParameterDisplayFromSymbol: function (symbol, writer, enclosing, flags) { + var nodes = nodeBuilder.symbolToTypeParameterDeclarations(symbol, enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeList(26896 /* TypeParameters */, nodes, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForParametersAndDelimiters: function (thisParameter, parameters, writer, enclosing, originalFlags) { + var printer = ts.createPrinter({ removeComments: true }); + var flags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */ | toNodeBuilderFlags(originalFlags); + var thisParameterArray = thisParameter ? [nodeBuilder.symbolToParameterDeclaration(thisParameter, enclosing, flags)] : []; + var params = ts.createNodeArray(thisParameterArray.concat(ts.map(parameters, function (param) { return nodeBuilder.symbolToParameterDeclaration(param, enclosing, flags); }))); + printer.writeList(1296 /* CallExpressionArguments */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildDisplayForTypeParametersAndDelimiters: function (typeParameters, writer, enclosing, flags) { + var printer = ts.createPrinter({ removeComments: true }); + var args = ts.createNodeArray(ts.map(typeParameters, function (p) { return nodeBuilder.typeParameterToDeclaration(p, enclosing, toNodeBuilderFlags(flags)); })); + printer.writeList(26896 /* TypeParameters */, args, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + }, + buildReturnTypeDisplay: function (signature, writer, enclosing, flags) { + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = getTypePredicateOfSignature(signature); + if (predicate) { + return typePredicateToString(predicate, enclosing, flags, emitTextWriterWrapper(writer)); + } + var node = nodeBuilder.typeToTypeNode(getReturnTypeOfSignature(signature), enclosing, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); + var printer = ts.createPrinter({ removeComments: true }); + printer.writeNode(4 /* Unspecified */, node, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosing)), emitTextWriterWrapper(writer)); + } + }; + function emitTextWriterWrapper(underlying) { + return { + write: ts.noop, + writeTextOfNode: ts.noop, + writeLine: ts.noop, + increaseIndent: function () { + return underlying.increaseIndent(); + }, + decreaseIndent: function () { + return underlying.decreaseIndent(); + }, + getText: function () { + return ""; + }, + rawWrite: ts.noop, + writeLiteral: function (s) { + return underlying.writeStringLiteral(s); + }, + getTextPos: function () { + return 0; + }, + getLine: function () { + return 0; + }, + getColumn: function () { + return 0; + }, + getIndent: function () { + return 0; + }, + isAtStartOfLine: function () { + return false; + }, + clear: function () { + return underlying.clear(); + }, + writeKeyword: function (text) { + return underlying.writeKeyword(text); + }, + writeOperator: function (text) { + return underlying.writeOperator(text); + }, + writePunctuation: function (text) { + return underlying.writePunctuation(text); + }, + writeSpace: function (text) { + return underlying.writeSpace(text); + }, + writeStringLiteral: function (text) { + return underlying.writeStringLiteral(text); + }, + writeParameter: function (text) { + return underlying.writeParameter(text); + }, + writeProperty: function (text) { + return underlying.writeProperty(text); + }, + writeSymbol: function (text, symbol) { + return underlying.writeSymbol(text, symbol); + }, + trackSymbol: function (symbol, enclosing, meaning) { + return underlying.trackSymbol && underlying.trackSymbol(symbol, enclosing, meaning); + }, + reportInaccessibleThisError: function () { + return underlying.reportInaccessibleThisError && underlying.reportInaccessibleThisError(); + }, + reportPrivateInBaseOfClassExpression: function (name) { + return underlying.reportPrivateInBaseOfClassExpression && underlying.reportPrivateInBaseOfClassExpression(name); + }, + reportInaccessibleUniqueSymbolError: function () { + return underlying.reportInaccessibleUniqueSymbolError && underlying.reportInaccessibleUniqueSymbolError(); + } + }; + } + } function getJsxNamespace() { if (!_jsxNamespace) { _jsxNamespace = "React"; @@ -24640,7 +25403,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 234 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 234 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 237 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 237 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -24661,8 +25424,11 @@ var ts; error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - var message_2 = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message_2 = target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */ + ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); }); @@ -24758,7 +25524,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -24812,21 +25578,21 @@ var ts; return true; } var sourceFiles = host.getSourceFiles(); - return ts.indexOf(sourceFiles, declarationFile) <= ts.indexOf(sourceFiles, useFile); + return sourceFiles.indexOf(declarationFile) <= sourceFiles.indexOf(useFile); } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 177 /* BindingElement */) { + if (declaration.kind === 180 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 177 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 180 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 227 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 230 /* VariableDeclaration */), usage); } - else if (declaration.kind === 227 /* VariableDeclaration */) { + else if (declaration.kind === 230 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -24840,12 +25606,12 @@ var ts; // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === 247 /* ExportSpecifier */ || (usage.parent.kind === 244 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 250 /* ExportSpecifier */ || (usage.parent.kind === 247 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 244 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 247 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -24853,9 +25619,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 209 /* VariableStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 212 /* VariableStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -24875,16 +25641,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 150 /* PropertyDeclaration */ && + current.parent.kind === 151 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 152 /* MethodDeclaration */) { + if (declaration.kind === 153 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 150 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -24900,14 +25666,15 @@ var ts; * * @param isUse If true, this will count towards --noUnusedLocals / --noUnusedParameters. */ - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, suggestedNameNotFoundMessage) { - return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, getSymbol, suggestedNameNotFoundMessage); + function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, suggestedNameNotFoundMessage) { + if (excludeGlobals === void 0) { excludeGlobals = false; } + return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSymbol, suggestedNameNotFoundMessage); } - function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, lookup, suggestedNameNotFoundMessage) { + function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, lookup, suggestedNameNotFoundMessage) { var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; var lastLocation; - var lastNonBlockLocation; + var lastSelfReferenceLocation; var propertyWithInvalidInitializer; var errorLocation = location; var grandparent; @@ -24924,12 +25691,12 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 279 /* JSDocComment */) { + if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 282 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 147 /* Parameter */ || - lastLocation.kind === 146 /* TypeParameter */ + lastLocation.kind === 148 /* Parameter */ || + lastLocation.kind === 147 /* TypeParameter */ // local types not visible outside the function body : false; } @@ -24939,11 +25706,16 @@ var ts; // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 147 /* Parameter */ || + lastLocation.kind === 148 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 147 /* Parameter */); + result.valueDeclaration.kind === 148 /* Parameter */); } } + else if (location.kind === 170 /* ConditionalType */) { + // A type parameter declared using 'infer T' in a conditional type is visible only in + // the true branch of the conditional type. + useResult = lastLocation === location.trueType; + } if (useResult) { break loop; } @@ -24953,17 +25725,17 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 269 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. - if (result = moduleExports.get("default")) { + if (result = moduleExports.get("default" /* Default */)) { var localSymbol = ts.getLocalSymbolForExportDefault(result); if (localSymbol && (result.flags & meaning) && localSymbol.escapedName === name) { break loop; @@ -24984,7 +25756,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - ts.getDeclarationOfKind(moduleExport, 247 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExport, 250 /* ExportSpecifier */)) { break; } } @@ -24992,13 +25764,13 @@ var ts; break loop; } break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -25015,9 +25787,9 @@ var ts; } } break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 793064 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { // ignore type parameters not declared in this container @@ -25033,7 +25805,7 @@ var ts; } break loop; } - if (location.kind === 200 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 203 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -25041,7 +25813,7 @@ var ts; } } break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 85 /* ExtendsKeyword */) { var container = location.parent.parent; @@ -25061,9 +25833,9 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 231 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 234 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); @@ -25071,19 +25843,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -25096,7 +25868,7 @@ var ts; } } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -25105,7 +25877,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 147 /* Parameter */) { + if (location.parent && location.parent.kind === 148 /* Parameter */) { location = location.parent; } // @@ -25119,26 +25891,28 @@ var ts; } break; } - if (location.kind !== 208 /* Block */) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. - // If `result === lastLocation.symbol`, that means that we are somewhere inside `lastLocation` looking up a name, and resolving to `lastLocation` itself. + // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { - result.isReferenced = true; + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + result.isReferenced |= meaning; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 269 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 272 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports") { return lastLocation.symbol; } } - result = lookup(globals, name, meaning); + if (!excludeGlobals) { + result = lookup(globals, name, meaning); + } } if (!result) { if (nameNotFoundMessage) { @@ -25194,27 +25968,40 @@ var ts; // If we're in an external module, we can't reference value symbols created from UMD export declarations if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 237 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 240 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); } } } return result; } + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 237 /* ModuleDeclaration */:// For `namespace N { N; }` + return true; + default: + return false; + } + } function diagnosticName(nameArg) { return ts.isString(nameArg) ? ts.unescapeLeadingUnderscores(nameArg) : ts.declarationNameToString(nameArg); } function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 146 /* TypeParameter */ && decl.parent === container) { + if (decl.kind === 147 /* TypeParameter */ && decl.parent === container) { return true; } } return false; } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 71 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); @@ -25260,9 +26047,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -25325,7 +26112,7 @@ var ts; function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 233 /* EnumDeclaration */) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 236 /* EnumDeclaration */) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { if (result.flags & 2 /* BlockScopedVariable */) { @@ -25348,13 +26135,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return node; - case 240 /* ImportClause */: + case 243 /* ImportClause */: return node.parent; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return node.parent.parent; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -25364,11 +26151,46 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); } + function resolveExportByName(moduleSymbol, name, dontResolveAlias) { + var exportValue = moduleSymbol.exports.get("export=" /* ExportEquals */); + return exportValue + ? getPropertyOfType(getTypeOfSymbol(exportValue), name) + : resolveSymbol(moduleSymbol.exports.get(name), dontResolveAlias); + } + function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias) { + if (!allowSyntheticDefaultImports) { + return false; + } + // Declaration files (and ambient modules) + if (!file || file.isDeclarationFile) { + // Definitely cannot have a synthetic default if they have a default member specified + if (resolveExportByName(moduleSymbol, "default" /* Default */, dontResolveAlias)) { + return false; + } + // It _might_ still be incorrect to assume there is no __esModule marker on the import at runtime, even if there is no `default` member + // So we check a bit more, + if (resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias)) { + // If there is an `__esModule` specified in the declaration (meaning someone explicitly added it or wrote it in their code), + // it definitely is a module and does not have a synthetic default + return false; + } + // There are _many_ declaration files not written with esmodules in mind that still get compiled into a format with __esModule set + // Meaning there may be no default at runtime - however to be on the permissive side, we allow access to a synthetic default member + // as there is no marker to indicate if the accompanying JS has `__esModule` or not, or is even native esm + return true; + } + // TypeScript files never have a synthetic default (as they are always emitted with an __esModule marker) _unless_ they contain an export= statement + if (!ts.isSourceFileJavaScript(file)) { + return hasExportAssignmentSymbol(moduleSymbol); + } + // JS files have a synthetic default if they do not contain ES2015+ module syntax (export = is not valid in js) _and_ do not have an __esModule marker + return !file.externalModuleIndicator && !resolveExportByName(moduleSymbol, ts.escapeLeadingUnderscores("__esModule"), dontResolveAlias); + } function getTargetOfImportClause(node, dontResolveAlias) { var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); if (moduleSymbol) { @@ -25377,15 +26199,15 @@ var ts; exportDefaultSymbol = moduleSymbol; } else { - var exportValue = moduleSymbol.exports.get("export="); - exportDefaultSymbol = exportValue - ? getPropertyOfType(getTypeOfSymbol(exportValue), "default") - : resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias); + exportDefaultSymbol = resolveExportByName(moduleSymbol, "default" /* Default */, dontResolveAlias); } - if (!exportDefaultSymbol && !allowSyntheticDefaultImports) { + var file = ts.find(moduleSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias); + if (!exportDefaultSymbol && !hasSyntheticDefault) { error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); } - else if (!exportDefaultSymbol && allowSyntheticDefaultImports) { + else if (!exportDefaultSymbol && hasSyntheticDefault) { + // per emit behavior, a synthetic default overrides a "real" .default member if `__esModule` is not present return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } return exportDefaultSymbol; @@ -25465,7 +26287,7 @@ var ts; symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias); var symbolFromModule = getExportOfModule(targetSymbol, name.escapedText, dontResolveAlias); // If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default - if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default") { + if (!symbolFromModule && allowSyntheticDefaultImports && name.escapedText === "default" /* Default */) { symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias); } var symbol = symbolFromModule && symbolFromVariable ? @@ -25494,19 +26316,19 @@ var ts; } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return getTargetOfExportSpecifier(node, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } @@ -25561,11 +26383,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 247 /* ExportSpecifier */) { + else if (node.kind === 250 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -25587,13 +26409,13 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 144 /* QualifiedName */) { + if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 145 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 238 /* ImportEqualsDeclaration */); + ts.Debug.assert(entityName.parent.kind === 241 /* ImportEqualsDeclaration */); return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } @@ -25615,13 +26437,12 @@ var ts; return undefined; } } - else if (name.kind === 144 /* QualifiedName */ || name.kind === 180 /* PropertyAccessExpression */) { + else if (name.kind === 145 /* QualifiedName */ || name.kind === 183 /* PropertyAccessExpression */) { var left = void 0; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { left = name.left; } - else if (name.kind === 180 /* PropertyAccessExpression */ && - (name.expression.kind === 186 /* ParenthesizedExpression */ || ts.isEntityNameExpression(name.expression))) { + else if (name.kind === 183 /* PropertyAccessExpression */) { left = name.expression; } else { @@ -25631,7 +26452,7 @@ var ts; // i.e class C extends foo()./*do language service operation here*/B {} return undefined; } - var right = name.kind === 144 /* QualifiedName */ ? name.right : name.name; + var right = name.kind === 145 /* QualifiedName */ ? name.right : name.name; var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; @@ -25650,15 +26471,6 @@ var ts; return undefined; } } - else if (name.kind === 186 /* ParenthesizedExpression */) { - // If the expression in parenthesizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. - // This is the case when we are trying to do any language service operation in heritage clauses. - // By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression will attempt to checkPropertyAccessExpression to resolve symbol. - // i.e class C extends foo()./*do language service operation here*/B {} - return ts.isEntityNameExpression(name.expression) ? - resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : - undefined; - } else { ts.Debug.assertNever(name, "Unknown entity name kind."); } @@ -25670,11 +26482,9 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 13 /* NoSubstitutionTemplateLiteral */) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return ts.isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -25717,7 +26527,7 @@ var ts; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } else if (noImplicitAny && moduleNotFoundError) { - var errorInfo = !resolvedModule.isExternalLibraryImport ? undefined : ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, moduleReference); + var errorInfo = resolvedModule.packageId && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, resolvedModule.packageId.name); errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } @@ -25752,8 +26562,42 @@ var ts; // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression, dontResolveAlias) { var symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias); - if (!dontResolveAlias && symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { - error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + if (!dontResolveAlias && symbol) { + if (!(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { + error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); + return symbol; + } + if (compilerOptions.esModuleInterop) { + var referenceParent = moduleReferenceExpression.parent; + if ((ts.isImportDeclaration(referenceParent) && ts.getNamespaceDeclarationNode(referenceParent)) || + ts.isImportCall(referenceParent)) { + var type = getTypeOfSymbol(symbol); + var sigs = getSignaturesOfStructuredType(type, 0 /* Call */); + if (!sigs || !sigs.length) { + sigs = getSignaturesOfStructuredType(type, 1 /* Construct */); + } + if (sigs && sigs.length) { + var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol); + // Create a new symbol which has the module's type less the call and construct signatures + var result = createSymbol(symbol.flags, symbol.escapedName); + result.declarations = symbol.declarations ? symbol.declarations.slice() : []; + result.parent = symbol.parent; + result.target = symbol; + result.originatingImport = referenceParent; + if (symbol.valueDeclaration) + result.valueDeclaration = symbol.valueDeclaration; + if (symbol.constEnumOnlyModule) + result.constEnumOnlyModule = true; + if (symbol.members) + result.members = ts.cloneMap(symbol.members); + if (symbol.exports) + result.exports = ts.cloneMap(symbol.exports); + var resolvedModuleType = resolveStructuredTypeMembers(moduleType); // Should already be resolved from the signature checks above + result.type = createAnonymousType(result, resolvedModuleType.members, ts.emptyArray, ts.emptyArray, resolvedModuleType.stringIndexInfo, resolvedModuleType.numberIndexInfo); + return result; + } + } + } } return symbol; } @@ -25806,7 +26650,7 @@ var ts; if (!source) return; source.forEach(function (sourceSymbol, id) { - if (id === "default") + if (id === "default" /* Default */) return; var targetSymbol = target.get(id); if (!targetSymbol) { @@ -25889,7 +26733,7 @@ var ts; var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 153 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -25967,12 +26811,12 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -25991,11 +26835,14 @@ var ts; } var visitedSymbolTables = []; return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - function getAccessibleSymbolChainFromSymbolTable(symbols) { + /** + * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already) + */ + function getAccessibleSymbolChainFromSymbolTable(symbols, ignoreQualification) { if (!ts.pushIfUnique(visitedSymbolTables, symbols)) { return undefined; } - var result = trySymbolTable(symbols); + var result = trySymbolTable(symbols, ignoreQualification); visitedSymbolTables.pop(); return result; } @@ -26005,36 +26852,34 @@ var ts; // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { + function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) && // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) // and if symbolFromSymbolTable or alias resolution matches the symbol, // check the symbol can be qualified, it is only then this symbol is accessible !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); + (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning)); } - function isUMDExportSymbol(symbol) { - return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); - } - function trySymbolTable(symbols) { + function trySymbolTable(symbols, ignoreQualification) { // If symbol is directly available by its name in the symbol table - if (isAccessible(symbols.get(symbol.escapedName))) { + if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification)) { return [symbol]; } // Check if symbol is any of the alias return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 2097152 /* Alias */ && symbolFromSymbolTable.escapedName !== "export=" - && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) + && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) { + if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol, ignoreQualification)) { return [symbolFromSymbolTable]; } // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain // but only if the symbolFromSymbolTable can be qualified - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; + var candidateTable = getExportsOfSymbol(resolvedImportedSymbol); + var accessibleSymbolsFromExports = candidateTable && getAccessibleSymbolChainFromSymbolTable(candidateTable, /*ignoreQualification*/ true); if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); } @@ -26057,7 +26902,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 247 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 250 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -26072,10 +26917,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: continue; default: return false; @@ -26089,6 +26934,10 @@ var ts; var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); return access.accessibility === 0 /* Accessible */; } + function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 107455 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false); + return access.accessibility === 0 /* Accessible */; + } /** * Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested * @@ -26157,7 +27006,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -26191,14 +27040,14 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 163 /* TypeQuery */ || + if (entityName.parent.kind === 164 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 145 /* ComputedPropertyName */) { + entityName.parent.kind === 146 /* ComputedPropertyName */) { // Typeof value meaning = 107455 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 144 /* QualifiedName */ || entityName.kind === 180 /* PropertyAccessExpression */ || - entityName.parent.kind === 238 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 145 /* QualifiedName */ || entityName.kind === 183 /* PropertyAccessExpression */ || + entityName.parent.kind === 241 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; @@ -26216,97 +27065,134 @@ var ts; errorNode: firstIdentifier }; } - function writeKeyword(writer, kind) { - writer.writeKeyword(ts.tokenToString(kind)); + function symbolToString(symbol, enclosingDeclaration, meaning, flags, writer) { + if (flags === void 0) { flags = 4 /* AllowAnyNodeKind */; } + var nodeFlags = 3112960 /* IgnoreErrors */; + if (flags & 2 /* UseOnlyExternalAliasing */) { + nodeFlags |= 128 /* UseOnlyExternalAliasing */; + } + if (flags & 1 /* WriteTypeParametersOrArguments */) { + nodeFlags |= 512 /* WriteTypeParametersInQualifiedName */; + } + if (flags & 8 /* UseAliasDefinedOutsideCurrentScope */) { + nodeFlags |= 16384 /* UseAliasDefinedOutsideCurrentScope */; + } + var builder = flags & 4 /* AllowAnyNodeKind */ ? nodeBuilder.symbolToExpression : nodeBuilder.symbolToEntityName; + return writer ? symbolToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(symbolToStringWorker); + function symbolToStringWorker(writer) { + var entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, entity, /*sourceFile*/ sourceFile, writer); + return writer; + } } - function writePunctuation(writer, kind) { - writer.writePunctuation(ts.tokenToString(kind)); + function signatureToString(signature, enclosingDeclaration, flags, kind, writer) { + return writer ? signatureToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(signatureToStringWorker); + function signatureToStringWorker(writer) { + var sigOutput; + if (flags & 262144 /* WriteArrowStyleSignature */) { + sigOutput = kind === 1 /* Construct */ ? 163 /* ConstructorType */ : 162 /* FunctionType */; + } + else { + sigOutput = kind === 1 /* Construct */ ? 158 /* ConstructSignature */ : 157 /* CallSignature */; + } + var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); + var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, sig, /*sourceFile*/ sourceFile, writer); + return writer; + } } - function writeSpace(writer) { - writer.writeSpace(" "); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); - }); - } - function signatureToString(signature, enclosingDeclaration, flags, kind) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind); - }); - } - function typeToString(type, enclosingDeclaration, flags) { - var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | ts.NodeBuilderFlags.IgnoreErrors | ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName); + function typeToString(type, enclosingDeclaration, flags, writer) { + if (writer === void 0) { writer = ts.createTextWriter(""); } + var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); ts.Debug.assert(typeNode !== undefined, "should always get typenode"); var options = { removeComments: true }; - var writer = ts.createTextWriter(""); var printer = ts.createPrinter(options); var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); printer.writeNode(4 /* Unspecified */, typeNode, /*sourceFile*/ sourceFile, writer); var result = writer.getText(); - var maxLength = compilerOptions.noErrorTruncation || flags & 8 /* NoTruncation */ ? undefined : 100; - if (maxLength && result.length >= maxLength) { + var maxLength = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */ ? undefined : 100; + if (maxLength && result && result.length >= maxLength) { return result.substr(0, maxLength - "...".length) + "..."; } return result; - function toNodeBuilderFlags(flags) { - var result = ts.NodeBuilderFlags.None; - if (!flags) { - return result; - } - if (flags & 8 /* NoTruncation */) { - result |= ts.NodeBuilderFlags.NoTruncation; - } - if (flags & 256 /* UseFullyQualifiedType */) { - result |= ts.NodeBuilderFlags.UseFullyQualifiedType; - } - if (flags & 4096 /* SuppressAnyReturnType */) { - result |= ts.NodeBuilderFlags.SuppressAnyReturnType; - } - if (flags & 1 /* WriteArrayAsGenericType */) { - result |= ts.NodeBuilderFlags.WriteArrayAsGenericType; - } - if (flags & 64 /* WriteTypeArgumentsOfSignature */) { - result |= ts.NodeBuilderFlags.WriteTypeArgumentsOfSignature; - } - return result; - } + } + function toNodeBuilderFlags(flags) { + return flags & 9469291 /* NodeBuilderFlagsMask */; } function createNodeBuilder() { return { - typeToTypeNode: function (type, enclosingDeclaration, flags) { + typeToTypeNode: function (type, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = typeToTypeNodeHelper(type, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags) { + indexInfoToIndexSignatureDeclaration: function (indexInfo, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; }, - signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags) { + signatureToSignatureDeclaration: function (signature, kind, enclosingDeclaration, flags, tracker) { ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); - var context = createNodeBuilderContext(enclosingDeclaration, flags); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); var resultingNode = signatureToSignatureDeclarationHelper(signature, kind, context); var result = context.encounteredError ? undefined : resultingNode; return result; - } + }, + symbolToEntityName: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToName(symbol, context, meaning, /*expectsIdentifier*/ false); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToExpression: function (symbol, meaning, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToExpression(symbol, context, meaning); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToTypeParameterDeclarations: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParametersToTypeParameterDeclarations(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + symbolToParameterDeclaration: function (symbol, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = symbolToParameterDeclaration(symbol, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, + typeParameterToDeclaration: function (parameter, enclosingDeclaration, flags, tracker) { + ts.Debug.assert(enclosingDeclaration === undefined || (enclosingDeclaration.flags & 8 /* Synthesized */) === 0); + var context = createNodeBuilderContext(enclosingDeclaration, flags, tracker); + var resultingNode = typeParameterToDeclaration(parameter, context); + var result = context.encounteredError ? undefined : resultingNode; + return result; + }, }; - function createNodeBuilderContext(enclosingDeclaration, flags) { + function createNodeBuilderContext(enclosingDeclaration, flags, tracker) { return { enclosingDeclaration: enclosingDeclaration, flags: flags, + tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop }, encounteredError: false, symbolStack: undefined }; } function typeToTypeNodeHelper(type, context) { - var inTypeAlias = context.flags & ts.NodeBuilderFlags.InTypeAlias; - context.flags &= ~ts.NodeBuilderFlags.InTypeAlias; + var inTypeAlias = context.flags & 8388608 /* InTypeAlias */; + context.flags &= ~8388608 /* InTypeAlias */; if (!type) { context.encounteredError = true; return undefined; @@ -26315,10 +27201,10 @@ var ts; return ts.createKeywordTypeNode(119 /* AnyKeyword */); } if (type.flags & 2 /* String */) { - return ts.createKeywordTypeNode(136 /* StringKeyword */); + return ts.createKeywordTypeNode(137 /* StringKeyword */); } if (type.flags & 4 /* Number */) { - return ts.createKeywordTypeNode(133 /* NumberKeyword */); + return ts.createKeywordTypeNode(134 /* NumberKeyword */); } if (type.flags & 8 /* Boolean */) { return ts.createKeywordTypeNode(122 /* BooleanKeyword */); @@ -26343,31 +27229,39 @@ var ts; return type.intrinsicName === "true" ? ts.createTrue() : ts.createFalse(); } if (type.flags & 1024 /* UniqueESSymbol */) { - return ts.createTypeOperatorNode(140 /* UniqueKeyword */, ts.createKeywordTypeNode(137 /* SymbolKeyword */)); + if (!(context.flags & 1048576 /* AllowUniqueESSymbolType */)) { + if (context.tracker.reportInaccessibleUniqueSymbolError) { + context.tracker.reportInaccessibleUniqueSymbolError(); + } + } + return ts.createTypeOperatorNode(141 /* UniqueKeyword */, ts.createKeywordTypeNode(138 /* SymbolKeyword */)); } if (type.flags & 2048 /* Void */) { return ts.createKeywordTypeNode(105 /* VoidKeyword */); } if (type.flags & 4096 /* Undefined */) { - return ts.createKeywordTypeNode(139 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(140 /* UndefinedKeyword */); } if (type.flags & 8192 /* Null */) { return ts.createKeywordTypeNode(95 /* NullKeyword */); } if (type.flags & 16384 /* Never */) { - return ts.createKeywordTypeNode(130 /* NeverKeyword */); + return ts.createKeywordTypeNode(131 /* NeverKeyword */); } if (type.flags & 512 /* ESSymbol */) { - return ts.createKeywordTypeNode(137 /* SymbolKeyword */); + return ts.createKeywordTypeNode(138 /* SymbolKeyword */); } - if (type.flags & 33554432 /* NonPrimitive */) { - return ts.createKeywordTypeNode(134 /* ObjectKeyword */); + if (type.flags & 134217728 /* NonPrimitive */) { + return ts.createKeywordTypeNode(135 /* ObjectKeyword */); } if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { - if (context.flags & ts.NodeBuilderFlags.InObjectTypeLiteral) { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowThisInObjectLiteral)) { + if (context.flags & 4194304 /* InObjectTypeLiteral */) { + if (!context.encounteredError && !(context.flags & 32768 /* AllowThisInObjectLiteral */)) { context.encounteredError = true; } + if (context.tracker.reportInaccessibleThisError) { + context.tracker.reportInaccessibleThisError(); + } } return ts.createThis(); } @@ -26381,7 +27275,7 @@ var ts; // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } - if (!inTypeAlias && type.aliasSymbol && isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration)) { + if (!inTypeAlias && type.aliasSymbol && (context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */ || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { var name = symbolToTypeReferenceName(type.aliasSymbol); var typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context); return ts.createTypeReferenceNode(name, typeArgumentNodes); @@ -26390,11 +27284,11 @@ var ts; var types = type.flags & 131072 /* Union */ ? formatUnionTypes(type.types) : type.types; var typeNodes = mapToTypeNodes(types, context); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 167 /* UnionType */ : 168 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 168 /* UnionType */ : 169 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { - if (!context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowEmptyUnionOrIntersection)) { + if (!context.encounteredError && !(context.flags & 262144 /* AllowEmptyUnionOrIntersection */)) { context.encounteredError = true; } return undefined; @@ -26415,12 +27309,22 @@ var ts; var indexTypeNode = typeToTypeNodeHelper(type.indexType, context); return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 2097152 /* Conditional */) { + var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); + var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); + var trueTypeNode = typeToTypeNodeHelper(type.trueType, context); + var falseTypeNode = typeToTypeNodeHelper(type.falseType, context); + return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + if (type.flags & 4194304 /* Substitution */) { + return typeToTypeNodeHelper(type.typeParameter, context); + } ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { ts.Debug.assert(!!(type.flags & 65536 /* Object */)); - var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131 /* ReadonlyKeyword */) : undefined; - var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55 /* QuestionToken */) : undefined; - var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context); + var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined; + var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined; + var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); var mappedTypeNode = ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); return ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */); @@ -26429,7 +27333,7 @@ var ts; var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) || + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 203 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { return createTypeQueryNodeFromSymbol(symbol, 107455 /* Value */); @@ -26452,10 +27356,16 @@ var ts; if (!context.symbolStack) { context.symbolStack = []; } - context.symbolStack.push(symbol); - var result = createTypeNodeFromObjectType(type); - context.symbolStack.pop(); - return result; + var isConstructorObject = ts.getObjectFlags(type) & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; + if (isConstructorObject) { + return createTypeNodeFromObjectType(type); + } + else { + context.symbolStack.push(symbol); + var result = createTypeNodeFromObjectType(type); + context.symbolStack.pop(); + return result; + } } } else { @@ -26468,11 +27378,12 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; + return declaration.parent.kind === 272 /* SourceFile */ || declaration.parent.kind === 238 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions - return ts.contains(context.symbolStack, symbol); // it is type of the symbol uses itself recursively + return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ts.contains(context.symbolStack, symbol)) && // it is type of the symbol uses itself recursively + (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration)); // And the build is going to succeed without visibility error or there is no structural fallback allowed } } } @@ -26487,21 +27398,21 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 161 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 163 /* ConstructorType */, context); return signatureNode; } } var savedFlags = context.flags; - context.flags |= ts.NodeBuilderFlags.InObjectTypeLiteral; + context.flags |= 4194304 /* InObjectTypeLiteral */; var members = createTypeNodesFromResolvedType(resolved); context.flags = savedFlags; var typeLiteralNode = ts.createTypeLiteralNode(members); - return ts.setEmitFlags(typeLiteralNode, 1 /* SingleLine */); + return ts.setEmitFlags(typeLiteralNode, (context.flags & 1024 /* MultilineObjectLiterals */) ? 0 : 1 /* SingleLine */); } function createTypeQueryNodeFromSymbol(symbol, symbolFlags) { var entityName = symbolToName(symbol, context, symbolFlags, /*expectsIdentifier*/ false); @@ -26515,7 +27426,7 @@ var ts; function typeReferenceToTypeNode(type) { var typeArguments = type.typeArguments || ts.emptyArray; if (type.target === globalArrayType) { - if (context.flags & ts.NodeBuilderFlags.WriteArrayAsGenericType) { + if (context.flags & 2 /* WriteArrayAsGenericType */) { var typeArgumentNode = typeToTypeNodeHelper(typeArguments[0], context); return ts.createTypeReferenceNode("Array", [typeArgumentNode]); } @@ -26529,12 +27440,17 @@ var ts; return ts.createTupleTypeNode(tupleConstituentNodes); } } - if (context.encounteredError || (context.flags & ts.NodeBuilderFlags.AllowEmptyTuple)) { + if (context.encounteredError || (context.flags & 524288 /* AllowEmptyTuple */)) { return ts.createTupleTypeNode([]); } context.encounteredError = true; return undefined; } + else if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && + type.symbol.valueDeclaration && + type.symbol.valueDeclaration.kind === 203 /* ClassExpression */) { + return createAnonymousTypeNode(type); + } else { var outerTypeParameters = type.target.outerTypeParameters; var i = 0; @@ -26606,14 +27522,17 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 156 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 158 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { - typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.stringIndexInfo, 0 /* String */, context)); + var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? + createIndexInfo(anyType, resolvedType.stringIndexInfo.isReadonly, resolvedType.stringIndexInfo.declaration) : + resolvedType.stringIndexInfo; + typeElements.push(indexInfoToIndexSignatureDeclarationHelper(indexInfo, 0 /* String */, context)); } if (resolvedType.numberIndexInfo) { typeElements.push(indexInfoToIndexSignatureDeclarationHelper(resolvedType.numberIndexInfo, 1 /* Number */, context)); @@ -26624,9 +27543,25 @@ var ts; } for (var _d = 0, properties_1 = properties; _d < properties_1.length; _d++) { var propertySymbol = properties_1[_d]; - var propertyType = getTypeOfSymbol(propertySymbol); + if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) { + if (propertySymbol.flags & 4194304 /* Prototype */) { + continue; + } + if (ts.getDeclarationModifierFlagsFromSymbol(propertySymbol) & (8 /* Private */ | 16 /* Protected */) && context.tracker.reportPrivateInBaseOfClassExpression) { + context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName)); + } + } + var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; + if (ts.getCheckFlags(propertySymbol) & 1024 /* Late */) { + var decl = ts.firstOrUndefined(propertySymbol.declarations); + var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); + if (name && context.tracker.trackSymbol) { + context.tracker.trackSymbol(name, saveEnclosingDeclaration, 107455 /* Value */); + } + } var propertyName = symbolToName(propertySymbol, context, 107455 /* Value */, /*expectsIdentifier*/ true); context.enclosingDeclaration = saveEnclosingDeclaration; var optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? ts.createToken(55 /* QuestionToken */) : undefined; @@ -26634,15 +27569,18 @@ var ts; var signatures = getSignaturesOfType(propertyType, 0 /* Call */); for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { var signature = signatures_1[_e]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 151 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(methodDeclaration); } } else { + var savedFlags = context.flags; + context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119 /* AnyKeyword */); - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined; + context.flags = savedFlags; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined; var propertySignature = ts.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode, /*initializer*/ undefined); typeElements.push(propertySignature); @@ -26666,27 +27604,37 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 136 /* StringKeyword */ : 133 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 137 /* StringKeyword */ : 134 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name, /*questionToken*/ undefined, indexerTypeNode, /*initializer*/ undefined); - var typeNode = typeToTypeNodeHelper(indexInfo.type, context); + var typeNode = indexInfo.type ? typeToTypeNodeHelper(indexInfo.type, context) : typeToTypeNodeHelper(anyType, context); + if (!indexInfo.type && !(context.flags & 2097152 /* AllowEmptyIndexInfoType */)) { + context.encounteredError = true; + } return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { - var typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + var typeParameters; + var typeArguments; + if (context.flags & 32 /* WriteTypeArgumentsOfSignature */ && signature.target && signature.mapper && signature.target.typeParameters) { + typeArguments = signature.target.typeParameters.map(function (parameter) { return typeToTypeNodeHelper(instantiateType(parameter, signature.mapper), context); }); + } + else { + typeParameters = signature.typeParameters && signature.typeParameters.map(function (parameter) { return typeParameterToDeclaration(parameter, context); }); + } var parameters = signature.parameters.map(function (parameter) { return symbolToParameterDeclaration(parameter, context); }); if (signature.thisParameter) { var thisParameter = symbolToParameterDeclaration(signature.thisParameter, context); parameters.unshift(thisParameter); } var returnTypeNode; - if (signature.typePredicate) { - var typePredicate = signature.typePredicate; + var typePredicate = getTypePredicateOfSignature(signature); + if (typePredicate) { var parameterName = typePredicate.kind === 1 /* Identifier */ ? ts.setEmitFlags(ts.createIdentifier(typePredicate.parameterName), 16777216 /* NoAsciiEscaping */) : ts.createThisTypeNode(); @@ -26697,7 +27645,7 @@ var ts; var returnType = getReturnTypeOfSignature(signature); returnTypeNode = returnType && typeToTypeNodeHelper(returnType, context); } - if (context.flags & ts.NodeBuilderFlags.SuppressAnyReturnType) { + if (context.flags & 256 /* SuppressAnyReturnType */) { if (returnTypeNode && returnTypeNode.kind === 119 /* AnyKeyword */) { returnTypeNode = undefined; } @@ -26705,25 +27653,28 @@ var ts; else if (!returnTypeNode) { returnTypeNode = ts.createKeywordTypeNode(119 /* AnyKeyword */); } - return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode); + return ts.createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments); } - function typeParameterToDeclaration(type, context) { + function typeParameterToDeclaration(type, context, constraint) { + if (constraint === void 0) { constraint = getConstraintFromTypeParameter(type); } + var savedContextFlags = context.flags; + context.flags &= ~512 /* WriteTypeParametersInQualifiedName */; // Avoids potential infinite loop when building for a claimspace with a generic var name = symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ true); - var constraint = getConstraintFromTypeParameter(type); var constraintNode = constraint && typeToTypeNodeHelper(constraint, context); var defaultParameter = getDefaultFromTypeParameter(type); var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); + context.flags = savedContextFlags; return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); } function symbolToParameterDeclaration(parameterSymbol, context) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 147 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148 /* Parameter */); ts.Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter); var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { parameterType = getOptionalType(parameterType); } var parameterTypeNode = typeToTypeNodeHelper(parameterType, context); - var modifiers = parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); + var modifiers = !(context.flags & 8192 /* OmitParameterModifiers */) && parameterDeclaration && parameterDeclaration.modifiers && parameterDeclaration.modifiers.map(ts.getSynthesizedClone); var dotDotDotToken = !parameterDeclaration || ts.isRestParameter(parameterDeclaration) ? ts.createToken(24 /* DotDotDotToken */) : undefined; var name = parameterDeclaration ? parameterDeclaration.name ? @@ -26742,54 +27693,29 @@ var ts; function elideInitializerAndSetEmitFlags(node) { var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 177 /* BindingElement */) { + if (clone.kind === 180 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); } } } - function symbolToName(symbol, context, meaning, expectsIdentifier) { + function lookupSymbolChain(symbol, context, meaning) { + context.tracker.trackSymbol(symbol, context.enclosingDeclaration, meaning); // Try to get qualified name if the symbol is not a type parameter and there is an enclosing declaration. var chain; var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - if (!isTypeParameter && (context.enclosingDeclaration || context.flags & ts.NodeBuilderFlags.UseFullyQualifiedType)) { + if (!isTypeParameter && (context.enclosingDeclaration || context.flags & 64 /* UseFullyQualifiedType */)) { chain = getSymbolChain(symbol, meaning, /*endOfChain*/ true); ts.Debug.assert(chain && chain.length > 0); } else { chain = [symbol]; } - if (expectsIdentifier && chain.length !== 1 - && !context.encounteredError - && !(context.flags & ts.NodeBuilderFlags.AllowQualifedNameInPlaceOfIdentifier)) { - context.encounteredError = true; - } - return createEntityNameFromSymbolChain(chain, chain.length - 1); - function createEntityNameFromSymbolChain(chain, index) { - ts.Debug.assert(chain && 0 <= index && index < chain.length); - var symbol = chain[index]; - var typeParameterNodes; - if (context.flags & ts.NodeBuilderFlags.WriteTypeParametersInQualifiedName && index > 0) { - var parentSymbol = chain[index - 1]; - var typeParameters = void 0; - if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - typeParameters = getTypeParametersOfClassOrInterface(parentSymbol); - } - else { - var targetSymbol = getTargetSymbol(parentSymbol); - if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { - typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - } - } - typeParameterNodes = mapToTypeNodes(typeParameters, context); - } - var identifier = ts.setEmitFlags(ts.createIdentifier(getNameOfSymbolAsWritten(symbol, context), typeParameterNodes), 16777216 /* NoAsciiEscaping */); - return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; - } + return chain; /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ function getSymbolChain(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, /*useOnlyExternalAliasing*/ false); + var accessibleSymbolChain = getAccessibleSymbolChain(symbol, context.enclosingDeclaration, meaning, !!(context.flags & 128 /* UseOnlyExternalAliasing */)); var parentSymbol; if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], context.enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { @@ -26817,11 +27743,105 @@ var ts; } } } + function typeParametersToTypeParameterDeclarations(symbol, context) { + var typeParameterNodes; + var targetSymbol = getTargetSymbol(symbol); + if (targetSymbol.flags & (32 /* Class */ | 64 /* Interface */ | 524288 /* TypeAlias */)) { + typeParameterNodes = ts.createNodeArray(ts.map(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), function (tp) { return typeParameterToDeclaration(tp, context); })); + } + return typeParameterNodes; + } + function lookupTypeParameterNodes(chain, index, context) { + ts.Debug.assert(chain && 0 <= index && index < chain.length); + var symbol = chain[index]; + var typeParameterNodes; + if (context.flags & 512 /* WriteTypeParametersInQualifiedName */ && index < (chain.length - 1)) { + var parentSymbol = symbol; + var nextSymbol = chain[index + 1]; + if (ts.getCheckFlags(nextSymbol) & 1 /* Instantiated */) { + var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); + typeParameterNodes = mapToTypeNodes(ts.map(params, nextSymbol.mapper), context); + } + else { + typeParameterNodes = typeParametersToTypeParameterDeclarations(symbol, context); + } + } + return typeParameterNodes; + } + function symbolToName(symbol, context, meaning, expectsIdentifier) { + var chain = lookupSymbolChain(symbol, context, meaning); + if (expectsIdentifier && chain.length !== 1 + && !context.encounteredError + && !(context.flags & 65536 /* AllowQualifedNameInPlaceOfIdentifier */)) { + context.encounteredError = true; + } + return createEntityNameFromSymbolChain(chain, chain.length - 1); + function createEntityNameFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216 /* InInitialEntityName */; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216 /* InInitialEntityName */; + } + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + identifier.symbol = symbol; + return index > 0 ? ts.createQualifiedName(createEntityNameFromSymbolChain(chain, index - 1), identifier) : identifier; + } + } + function symbolToExpression(symbol, context, meaning) { + var chain = lookupSymbolChain(symbol, context, meaning); + return createExpressionFromSymbolChain(chain, chain.length - 1); + function createExpressionFromSymbolChain(chain, index) { + var typeParameterNodes = lookupTypeParameterNodes(chain, index, context); + var symbol = chain[index]; + if (index === 0) { + context.flags |= 16777216 /* InInitialEntityName */; + } + var symbolName = getNameOfSymbolAsWritten(symbol, context); + if (index === 0) { + context.flags ^= 16777216 /* InInitialEntityName */; + } + var firstChar = symbolName.charCodeAt(0); + var canUsePropertyAccess = ts.isIdentifierStart(firstChar, languageVersion); + if (index === 0 || canUsePropertyAccess) { + var identifier = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + identifier.symbol = symbol; + return index > 0 ? ts.createPropertyAccess(createExpressionFromSymbolChain(chain, index - 1), identifier) : identifier; + } + else { + if (firstChar === 91 /* openBracket */) { + symbolName = symbolName.substring(1, symbolName.length - 1); + firstChar = symbolName.charCodeAt(0); + } + var expression = void 0; + if (ts.isSingleOrDoubleQuote(firstChar)) { + expression = ts.createLiteral(symbolName.substring(1, symbolName.length - 1).replace(/\\./g, function (s) { return s.substring(1); })); + expression.singleQuote = firstChar === 39 /* singleQuote */; + } + else if (("" + +symbolName) === symbolName) { + expression = ts.createLiteral(+symbolName); + } + if (!expression) { + expression = ts.setEmitFlags(ts.createIdentifier(symbolName, typeParameterNodes), 16777216 /* NoAsciiEscaping */); + expression.symbol = symbol; + } + return ts.createElementAccess(createExpressionFromSymbolChain(chain, index - 1), expression); + } + } + } } - function typePredicateToString(typePredicate, enclosingDeclaration, flags) { - return ts.usingSingleLineStringWriter(function (writer) { - getSymbolDisplayBuilder().buildTypePredicateDisplay(typePredicate, writer, enclosingDeclaration, flags); - }); + function typePredicateToString(typePredicate, enclosingDeclaration, flags, writer) { + return writer ? typePredicateToStringWorker(writer).getText() : ts.usingSingleLineStringWriter(typePredicateToStringWorker); + function typePredicateToStringWorker(writer) { + var predicate = ts.createTypePredicateNode(typePredicate.kind === 1 /* Identifier */ ? ts.createIdentifier(typePredicate.parameterName) : ts.createThisTypeNode(), nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)); + var printer = ts.createPrinter({ removeComments: true }); + var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration); + printer.writeNode(4 /* Unspecified */, predicate, /*sourceFile*/ sourceFile, writer); + return writer; + } } function formatUnionTypes(types) { var result = []; @@ -26861,8 +27881,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 169 /* ParenthesizedType */; }); - if (node.kind === 232 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 172 /* ParenthesizedType */; }); + if (node.kind === 235 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -26870,12 +27890,15 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 235 /* ModuleBlock */ && + node.parent.kind === 238 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? '"' + ts.escapeString(type.value) + '"' : "" + type.value; } + function isDefaultBindingContext(location) { + return location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location); + } /** * Gets a human-readable name for a symbol. * Should *not* be used for the right-hand side of a `.` -- use `symbolName(symbol)` for that instead. @@ -26884,23 +27907,32 @@ var ts; * It will also use a representation of a number as written instead of a decimal form, e.g. `0o11` instead of `9`. */ function getNameOfSymbolAsWritten(symbol, context) { + if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && + // If it's not the first part of an entity name, it must print as `default` + (!(context.flags & 16777216 /* InInitialEntityName */) || + // if the symbol is synthesized, it will only be referenced externally it must print as `default` + !symbol.declarations || + // if not in the same binding context (source file, module declaration), it must print as `default` + (context.enclosingDeclaration && ts.findAncestor(symbol.declarations[0], isDefaultBindingContext) !== ts.findAncestor(context.enclosingDeclaration, isDefaultBindingContext)))) { + return "default"; + } if (symbol.declarations && symbol.declarations.length) { var declaration = symbol.declarations[0]; var name = ts.getNameOfDeclaration(declaration); if (name) { return ts.declarationNameToString(name); } - if (declaration.parent && declaration.parent.kind === 227 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } - if (context && !context.encounteredError && !(context.flags & ts.NodeBuilderFlags.AllowAnonymousIdentifier)) { + if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } switch (declaration.kind) { - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return "(Anonymous class)"; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return "(Anonymous function)"; } } @@ -26912,727 +27944,6 @@ var ts; } return ts.symbolName(symbol); } - function getSymbolDisplayBuilder() { - /** - * Writes only the name of the symbol out to the writer. Uses the original source text - * for the name of the symbol if it is available to match how the user wrote the name. - */ - function appendSymbolNameOnly(symbol, writer) { - writer.writeSymbol(getNameOfSymbolAsWritten(symbol), symbol); - } - /** - * Writes a property access or element access with the name of the symbol out to the writer. - * Uses the original source text for the name of the symbol if it is available to match how the user wrote the name, - * ensuring that any names written with literals use element accesses. - */ - function appendPropertyOrElementAccessForSymbol(symbol, writer) { - var symbolName = symbol.escapedName === "default" ? "default" : getNameOfSymbolAsWritten(symbol); - var firstChar = symbolName.charCodeAt(0); - var needsElementAccess = !ts.isIdentifierStart(firstChar, languageVersion); - if (needsElementAccess) { - if (firstChar !== 91 /* openBracket */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - } - if (ts.isSingleOrDoubleQuote(firstChar)) { - writer.writeStringLiteral(symbolName); - } - else { - writer.writeSymbol(symbolName, symbol); - } - if (firstChar !== 91 /* openBracket */) { - writePunctuation(writer, 22 /* CloseBracketToken */); - } - } - else { - writePunctuation(writer, 23 /* DotToken */); - writer.writeSymbol(symbolName, symbol); - } - } - /** - * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope - * Meaning needs to be specified if the enclosing declaration is given - */ - function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { - var parentSymbol; - function appendParentTypeArgumentsAndSymbolName(symbol) { - if (parentSymbol) { - // Write type arguments of instantiated class/interface here - if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var params = getTypeParametersOfClassOrInterface(parentSymbol.flags & 2097152 /* Alias */ ? resolveAlias(parentSymbol) : parentSymbol); - buildDisplayForTypeArgumentsAndDelimiters(params, symbol.mapper, writer, enclosingDeclaration); - } - else { - buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - appendPropertyOrElementAccessForSymbol(symbol, writer); - } - else { - appendSymbolNameOnly(symbol, writer); - } - parentSymbol = symbol; - } - // Let the writer know we just wrote out a symbol. The declaration emitter writer uses - // this to determine if an import it has previously seen (and not written out) needs - // to be written to the file once the walk of the tree is complete. - // - // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree - // up front (for example, during checking) could determine if we need to emit the imports - // and we could then access that data during declaration emit. - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - /** @param endOfChain Set to false for recursive calls; non-recursive calls should always output something. */ - function walkSymbol(symbol, meaning, endOfChain) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - // Go up and add our parent. - var parent = getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol); - if (parent) { - walkSymbol(parent, getQualifiedLeftMeaning(meaning), /*endOfChain*/ false); - } - } - if (accessibleSymbolChain) { - for (var _i = 0, accessibleSymbolChain_1 = accessibleSymbolChain; _i < accessibleSymbolChain_1.length; _i++) { - var accessibleSymbol = accessibleSymbolChain_1[_i]; - appendParentTypeArgumentsAndSymbolName(accessibleSymbol); - } - } - else if ( - // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. - endOfChain || - // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) - !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && - // If a parent symbol is an anonymous type, don't write it. - !(symbol.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - // Get qualified name if the symbol is not a type parameter - // and there is an enclosing declaration or we specifically - // asked for it - var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - var typeFormatFlag = 256 /* UseFullyQualifiedType */ & typeFlags; - if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { - walkSymbol(symbol, meaning, /*endOfChain*/ true); - } - else { - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, symbolStack) { - var globalFlagsToPass = globalFlags & (32 /* WriteOwnNameForAnyLike */ | 16384 /* WriteClassExpressionAsTypeLiteral */); - var inObjectTypeLiteral = false; - return writeType(type, globalFlags); - function writeType(type, flags) { - var nextFlags = flags & ~1024 /* InTypeAlias */; - // Write undefined/null type as any - if (type.flags & 33585807 /* Intrinsic */) { - // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving - writer.writeKeyword(!(globalFlags & 32 /* WriteOwnNameForAnyLike */) && isTypeAny(type) - ? "any" - : type.intrinsicName); - } - else if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { - if (inObjectTypeLiteral) { - writer.reportInaccessibleThisError(); - } - writer.writeKeyword("this"); - } - else if (ts.getObjectFlags(type) & 4 /* Reference */) { - writeTypeReference(type, nextFlags); - } - else if (type.flags & 256 /* EnumLiteral */ && !(type.flags & 131072 /* Union */)) { - var parent = getParentOfSymbol(type.symbol); - buildSymbolDisplay(parent, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); - // In a literal enum type with a single member E { A }, E and E.A denote the - // same type. We always display this type simply as E. - if (getDeclaredTypeOfSymbol(parent) !== type) { - writePunctuation(writer, 23 /* DotToken */); - appendSymbolNameOnly(type.symbol, writer); - } - } - else if (ts.getObjectFlags(type) & 3 /* ClassOrInterface */ || type.flags & (272 /* EnumLike */ | 32768 /* TypeParameter */)) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, nextFlags); - } - else if (!(flags & 1024 /* InTypeAlias */) && type.aliasSymbol && - ((flags & 65536 /* UseAliasDefinedOutsideCurrentScope */) || isTypeSymbolAccessible(type.aliasSymbol, enclosingDeclaration))) { - var typeArguments = type.aliasTypeArguments; - writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, ts.length(typeArguments), nextFlags); - } - else if (type.flags & 393216 /* UnionOrIntersection */) { - writeUnionOrIntersectionType(type, nextFlags); - } - else if (ts.getObjectFlags(type) & (16 /* Anonymous */ | 32 /* Mapped */)) { - writeAnonymousType(type, nextFlags); - } - else if (type.flags & 1024 /* UniqueESSymbol */) { - if (flags & 131072 /* AllowUniqueESSymbolType */) { - writeKeyword(writer, 140 /* UniqueKeyword */); - writeSpace(writer); - } - else { - writer.reportInaccessibleUniqueSymbolError(); - } - writeKeyword(writer, 137 /* SymbolKeyword */); - } - else if (type.flags & 96 /* StringOrNumberLiteral */) { - writer.writeStringLiteral(literalTypeToString(type)); - } - else if (type.flags & 524288 /* Index */) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writer.writeKeyword("keyof"); - writeSpace(writer); - writeType(type.type, 128 /* InElementType */); - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - else if (type.flags & 1048576 /* IndexedAccess */) { - writeType(type.objectType, 128 /* InElementType */); - writePunctuation(writer, 21 /* OpenBracketToken */); - writeType(type.indexType, 0 /* None */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else { - // Should never get here - // { ... } - writePunctuation(writer, 17 /* OpenBraceToken */); - writeSpace(writer); - writePunctuation(writer, 24 /* DotDotDotToken */); - writeSpace(writer); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - } - function writeTypeList(types, delimiter) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - if (delimiter !== 26 /* CommaToken */) { - writeSpace(writer); - } - writePunctuation(writer, delimiter); - writeSpace(writer); - } - writeType(types[i], delimiter === 26 /* CommaToken */ ? 0 /* None */ : 128 /* InElementType */); - } - } - function writeSymbolTypeReference(symbol, typeArguments, pos, end, flags) { - // Unnamed function expressions and arrow functions have reserved names that we don't want to display - if (symbol.flags & 32 /* Class */ || !isReservedMemberName(symbol.escapedName)) { - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, flags); - } - if (pos < end) { - writePunctuation(writer, 27 /* LessThanToken */); - writeType(typeArguments[pos], 512 /* InFirstTypeArgument */); - pos++; - while (pos < end) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - writeType(typeArguments[pos], 0 /* None */); - pos++; - } - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function writeTypeReference(type, flags) { - var typeArguments = type.typeArguments || ts.emptyArray; - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(typeArguments[0], 128 /* InElementType */ | 32768 /* InArrayType */); - writePunctuation(writer, 21 /* OpenBracketToken */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else if (type.target.objectFlags & 8 /* Tuple */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - writeTypeList(type.typeArguments.slice(0, getTypeReferenceArity(type)), 26 /* CommaToken */); - writePunctuation(writer, 22 /* CloseBracketToken */); - } - else if (flags & 16384 /* WriteClassExpressionAsTypeLiteral */ && - type.symbol.valueDeclaration && - type.symbol.valueDeclaration.kind === 200 /* ClassExpression */) { - writeAnonymousType(type, flags); - } - else { - // Write the type reference in the format f.g.C where A and B are type arguments - // for outer type parameters, and f and g are the respective declaring containers of those - // type parameters. - var outerTypeParameters = type.target.outerTypeParameters; - var i = 0; - if (outerTypeParameters) { - var length_2 = outerTypeParameters.length; - while (i < length_2) { - // Find group of type arguments for type parameters with the same declaring container. - var start = i; - var parent = getParentSymbolOfTypeParameter(outerTypeParameters[i]); - do { - i++; - } while (i < length_2 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent); - // When type parameters are their own type arguments for the whole group (i.e. we have - // the default outer type arguments), we don't show the group. - if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent, typeArguments, start, i, flags); - writePunctuation(writer, 23 /* DotToken */); - } - } - } - var typeParameterCount = (type.target.typeParameters || ts.emptyArray).length; - writeSymbolTypeReference(type.symbol, typeArguments, i, typeParameterCount, flags); - } - } - function writeUnionOrIntersectionType(type, flags) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - if (type.flags & 131072 /* Union */) { - writeTypeList(formatUnionTypes(type.types), 49 /* BarToken */); - } - else { - writeTypeList(type.types, 48 /* AmpersandToken */); - } - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - function writeAnonymousType(type, flags) { - var symbol = type.symbol; - if (symbol) { - // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && - !getBaseTypeVariableOfClass(symbol) && - !(symbol.valueDeclaration.kind === 200 /* ClassExpression */ && flags & 16384 /* WriteClassExpressionAsTypeLiteral */) || - symbol.flags & (384 /* Enum */ | 512 /* ValueModule */)) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeOfSymbol(type.symbol, flags); - } - else if (ts.contains(symbolStack, symbol)) { - // If type is an anonymous type literal in a type alias declaration, use type alias name - var typeAlias = getTypeAliasForTypeLiteral(type); - if (typeAlias) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793064 /* Type */, 0 /* None */, flags); - } - else { - // Recursive usage, use any - writeKeyword(writer, 119 /* AnyKeyword */); - } - } - else { - // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead - // of types allows us to catch circular references to instantiations of the same anonymous type - // However, in case of class expressions, we want to write both the static side and the instance side. - // We skip adding the static side so that the instance side has a chance to be written - // before checking for circular references. - if (!symbolStack) { - symbolStack = []; - } - var isConstructorObject = type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & 32 /* Class */; - if (isConstructorObject) { - writeLiteralType(type, flags); - } - else { - symbolStack.push(symbol); - writeLiteralType(type, flags); - symbolStack.pop(); - } - } - } - else { - // Anonymous types with no symbol are never circular - writeLiteralType(type, flags); - } - function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method - ts.some(symbol.declarations, function (declaration) { return ts.hasModifier(declaration, 32 /* Static */); }); - var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || // is exported function symbol - ts.some(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; - })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - // typeof is allowed only for static/non local functions - return !!(flags & 4 /* UseTypeOfFunction */) || // use typeof if format flags specify it - ts.contains(symbolStack, symbol); // it is type of the symbol uses itself recursively - } - } - } - function writeTypeOfSymbol(symbol, typeFormatFlags) { - if (typeFormatFlags & 32768 /* InArrayType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writeKeyword(writer, 103 /* TypeOfKeyword */); - writeSpace(writer); - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); - if (typeFormatFlags & 32768 /* InArrayType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - } - function writePropertyWithModifiers(prop) { - if (isReadonlySymbol(prop)) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - if (ts.getCheckFlags(prop) & 1024 /* Late */) { - var decl = ts.firstOrUndefined(prop.declarations); - var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); - if (name) { - writer.trackSymbol(name, enclosingDeclaration, 107455 /* Value */); - } - } - buildSymbolDisplay(prop, writer); - if (prop.flags & 16777216 /* Optional */) { - writePunctuation(writer, 55 /* QuestionToken */); - } - } - function shouldAddParenthesisAroundFunctionType(callSignature, flags) { - if (flags & 128 /* InElementType */) { - return true; - } - else if (flags & 512 /* InFirstTypeArgument */) { - // Add parenthesis around function type for the first type argument to avoid ambiguity - var typeParameters = callSignature.target && (flags & 64 /* WriteTypeArgumentsOfSignature */) ? - callSignature.target.typeParameters : callSignature.typeParameters; - return typeParameters && typeParameters.length !== 0; - } - return false; - } - function writeLiteralType(type, flags) { - if (isGenericMappedType(type)) { - writeMappedType(type); - return; - } - var resolved = resolveStructuredTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 17 /* OpenBraceToken */); - writePunctuation(writer, 18 /* CloseBraceToken */); - return; - } - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - var parenthesizeSignature = shouldAddParenthesisAroundFunctionType(resolved.callSignatures[0], flags); - if (parenthesizeSignature) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); - if (parenthesizeSignature) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 19 /* OpenParenToken */); - } - writeKeyword(writer, 94 /* NewKeyword */); - writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 16 /* WriteArrowStyleSignature */, /*kind*/ undefined, symbolStack); - if (flags & 128 /* InElementType */) { - writePunctuation(writer, 20 /* CloseParenToken */); - } - return; - } - } - var saveInObjectTypeLiteral = inObjectTypeLiteral; - inObjectTypeLiteral = true; - writePunctuation(writer, 17 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - writeObjectLiteralType(resolved); - writer.decreaseIndent(); - writePunctuation(writer, 18 /* CloseBraceToken */); - inObjectTypeLiteral = saveInObjectTypeLiteral; - } - function writeObjectLiteralType(resolved) { - for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { - var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { - var signature = _c[_b]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, 1 /* Construct */, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - buildIndexSignatureDisplay(resolved.stringIndexInfo, writer, 0 /* String */, enclosingDeclaration, globalFlags, symbolStack); - buildIndexSignatureDisplay(resolved.numberIndexInfo, writer, 1 /* Number */, enclosingDeclaration, globalFlags, symbolStack); - for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { - var p = _e[_d]; - if (globalFlags & 16384 /* WriteClassExpressionAsTypeLiteral */) { - if (p.flags & 4194304 /* Prototype */) { - continue; - } - if (ts.getDeclarationModifierFlagsFromSymbol(p) & (8 /* Private */ | 16 /* Protected */)) { - writer.reportPrivateInBaseOfClassExpression(ts.symbolName(p)); - } - } - var t = getTypeOfSymbol(p); - if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var _f = 0, signatures_2 = signatures; _f < signatures_2.length; _f++) { - var signature = signatures_2[_f]; - writePropertyWithModifiers(p); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, /*kind*/ undefined, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - else { - writePropertyWithModifiers(p); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - writeType(t, globalFlags & 16384 /* WriteClassExpressionAsTypeLiteral */); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - } - function writeMappedType(type) { - writePunctuation(writer, 17 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - if (type.declaration.readonlyToken) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 21 /* OpenBracketToken */); - appendSymbolNameOnly(getTypeParameterFromMappedType(type).symbol, writer); - writeSpace(writer); - writeKeyword(writer, 92 /* InKeyword */); - writeSpace(writer); - writeType(getConstraintTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 22 /* CloseBracketToken */); - if (type.declaration.questionToken) { - writePunctuation(writer, 55 /* QuestionToken */); - } - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - writeType(getTemplateTypeFromMappedType(type), 0 /* None */); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - writer.decreaseIndent(); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - } - function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration, flags) { - var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */ || targetSymbol.flags & 524288 /* TypeAlias */) { - buildDisplayForTypeParametersAndDelimiters(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), writer, enclosingDeclaration, flags); - } - } - function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, symbolStack) { - appendSymbolNameOnly(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 85 /* ExtendsKeyword */); - writeSpace(writer); - buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); - } - var defaultType = getDefaultFromTypeParameter(tp); - if (defaultType) { - writeSpace(writer); - writePunctuation(writer, 58 /* EqualsToken */); - writeSpace(writer); - buildTypeDisplay(defaultType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { - var parameterNode = p.valueDeclaration; - if (parameterNode ? ts.isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { - writePunctuation(writer, 24 /* DotDotDotToken */); - } - if (parameterNode && ts.isBindingPattern(parameterNode.name)) { - buildBindingPatternDisplay(parameterNode.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - appendSymbolNameOnly(p, writer); - } - if (parameterNode && isOptionalParameter(parameterNode)) { - writePunctuation(writer, 55 /* QuestionToken */); - } - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - var type = getTypeOfSymbol(p); - if (parameterNode && isRequiredInitializedParameter(parameterNode)) { - type = getOptionalType(type); - } - buildTypeDisplay(type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildBindingPatternDisplay(bindingPattern, writer, enclosingDeclaration, flags, symbolStack) { - // We have to explicitly emit square bracket and bracket because these tokens are not stored inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { - writePunctuation(writer, 17 /* OpenBraceToken */); - buildDisplayForCommaSeparatedList(bindingPattern.elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 18 /* CloseBraceToken */); - } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { - writePunctuation(writer, 21 /* OpenBracketToken */); - var elements = bindingPattern.elements; - buildDisplayForCommaSeparatedList(elements, writer, function (e) { return buildBindingElementDisplay(e, writer, enclosingDeclaration, flags, symbolStack); }); - if (elements && elements.hasTrailingComma) { - writePunctuation(writer, 26 /* CommaToken */); - } - writePunctuation(writer, 22 /* CloseBracketToken */); - } - } - function buildBindingElementDisplay(bindingElement, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isOmittedExpression(bindingElement)) { - return; - } - ts.Debug.assert(bindingElement.kind === 177 /* BindingElement */); - if (bindingElement.propertyName) { - writer.writeProperty(ts.getTextOfNode(bindingElement.propertyName)); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - } - if (ts.isBindingPattern(bindingElement.name)) { - buildBindingPatternDisplay(bindingElement.name, writer, enclosingDeclaration, flags, symbolStack); - } - else { - if (bindingElement.dotDotDotToken) { - writePunctuation(writer, 24 /* DotDotDotToken */); - } - appendSymbolNameOnly(bindingElement.symbol, writer); - } - } - function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27 /* LessThanToken */); - buildDisplayForCommaSeparatedList(typeParameters, writer, function (p) { return buildTypeParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack); }); - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function buildDisplayForCommaSeparatedList(list, writer, action) { - for (var i = 0; i < list.length; i++) { - if (i > 0) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - } - action(list[i]); - } - } - function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 27 /* LessThanToken */); - var flags = 512 /* InFirstTypeArgument */; - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - flags = 0 /* None */; - } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, flags); - } - writePunctuation(writer, 29 /* GreaterThanToken */); - } - } - function buildDisplayForParametersAndDelimiters(thisParameter, parameters, writer, enclosingDeclaration, flags, symbolStack) { - writePunctuation(writer, 19 /* OpenParenToken */); - if (thisParameter) { - buildParameterDisplay(thisParameter, writer, enclosingDeclaration, flags, symbolStack); - } - for (var i = 0; i < parameters.length; i++) { - if (i > 0 || thisParameter) { - writePunctuation(writer, 26 /* CommaToken */); - writeSpace(writer); - } - buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack); - } - writePunctuation(writer, 20 /* CloseParenToken */); - } - function buildTypePredicateDisplay(predicate, writer, enclosingDeclaration, flags, symbolStack) { - if (ts.isIdentifierTypePredicate(predicate)) { - writer.writeParameter(predicate.parameterName); - } - else { - writeKeyword(writer, 99 /* ThisKeyword */); - } - writeSpace(writer); - writeKeyword(writer, 126 /* IsKeyword */); - writeSpace(writer); - buildTypeDisplay(predicate.type, writer, enclosingDeclaration, flags, symbolStack); - } - function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { - var returnType = getReturnTypeOfSignature(signature); - if (flags & 4096 /* SuppressAnyReturnType */ && isTypeAny(returnType)) { - return; - } - if (flags & 16 /* WriteArrowStyleSignature */) { - writeSpace(writer); - writePunctuation(writer, 36 /* EqualsGreaterThanToken */); - } - else { - writePunctuation(writer, 56 /* ColonToken */); - } - writeSpace(writer); - if (signature.typePredicate) { - buildTypePredicateDisplay(signature.typePredicate, writer, enclosingDeclaration, flags, symbolStack); - } - else { - buildTypeDisplay(returnType, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, kind, symbolStack) { - if (kind === 1 /* Construct */) { - writeKeyword(writer, 94 /* NewKeyword */); - writeSpace(writer); - } - if (signature.target && (flags & 64 /* WriteTypeArgumentsOfSignature */)) { - // Instantiated signature, write type arguments instead - // This is achieved by passing in the mapper separately - buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, symbolStack); - } - buildDisplayForParametersAndDelimiters(signature.thisParameter, signature.parameters, writer, enclosingDeclaration, flags, symbolStack); - buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); - } - function buildIndexSignatureDisplay(info, writer, kind, enclosingDeclaration, globalFlags, symbolStack) { - if (info) { - if (info.isReadonly) { - writeKeyword(writer, 131 /* ReadonlyKeyword */); - writeSpace(writer); - } - writePunctuation(writer, 21 /* OpenBracketToken */); - writer.writeParameter(info.declaration ? ts.declarationNameToString(info.declaration.parameters[0].name) : "x"); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - switch (kind) { - case 1 /* Number */: - writeKeyword(writer, 133 /* NumberKeyword */); - break; - case 0 /* String */: - writeKeyword(writer, 136 /* StringKeyword */); - break; - } - writePunctuation(writer, 22 /* CloseBracketToken */); - writePunctuation(writer, 56 /* ColonToken */); - writeSpace(writer); - buildTypeDisplay(info.type, writer, enclosingDeclaration, globalFlags, symbolStack); - writePunctuation(writer, 25 /* SemicolonToken */); - writer.writeLine(); - } - } - return _displayBuilder || (_displayBuilder = { - buildSymbolDisplay: buildSymbolDisplay, - buildTypeDisplay: buildTypeDisplay, - buildTypeParameterDisplay: buildTypeParameterDisplay, - buildTypePredicateDisplay: buildTypePredicateDisplay, - buildParameterDisplay: buildParameterDisplay, - buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, - buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, - buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, - buildSignatureDisplay: buildSignatureDisplay, - buildIndexSignatureDisplay: buildIndexSignatureDisplay, - buildReturnTypeDisplay: buildReturnTypeDisplay - }); - } function isDeclarationVisible(node) { if (node) { var links = getNodeLinks(node); @@ -27644,22 +27955,22 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 229 /* FunctionDeclaration */: - case 233 /* EnumDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 236 /* EnumDeclaration */: + case 241 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -27667,53 +27978,53 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 238 /* ImportEqualsDeclaration */ && parent.kind !== 269 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { + !(node.kind !== 241 /* ImportEqualsDeclaration */ && parent.kind !== 272 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 153 /* Constructor */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: - case 147 /* Parameter */: - case 235 /* ModuleBlock */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 160 /* TypeReference */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: + case 148 /* Parameter */: + case 238 /* ModuleBlock */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 161 /* TypeReference */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 172 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: return false; // Type parameters are always visible - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: // Source file and namespace export are always visible - case 269 /* SourceFile */: - case 237 /* NamespaceExportDeclaration */: + case 272 /* SourceFile */: + case 240 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return false; default: return false; @@ -27722,10 +28033,10 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 244 /* ExportAssignment */) { + if (node.parent && node.parent.kind === 247 /* ExportAssignment */) { exportSymbol = resolveName(node, node.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 247 /* ExportSpecifier */) { + else if (node.parent.kind === 250 /* ExportSpecifier */) { exportSymbol = getTargetOfExportSpecifier(node.parent, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; @@ -27770,8 +28081,8 @@ var ts; var resolutionCycleStartIndex = findResolutionCycleStartIndex(target, propertyName); if (resolutionCycleStartIndex >= 0) { // A cycle was found - var length_3 = resolutionTargets.length; - for (var i = resolutionCycleStartIndex; i < length_3; i++) { + var length_2 = resolutionTargets.length; + for (var i = resolutionCycleStartIndex; i < length_2; i++) { resolutionResults[i] = false; } return false; @@ -27805,6 +28116,10 @@ var ts; if (propertyName === 3 /* ResolvedReturnType */) { return target.resolvedReturnType; } + if (propertyName === 4 /* ResolvedBaseConstraint */) { + var bc = target.resolvedBaseConstraint; + return bc && bc !== circularConstraintType; + } ts.Debug.fail("Unhandled TypeSystemPropertyName " + propertyName); } // Pop an entry from the type resolution stack and return its associated result value. The result value will @@ -27817,12 +28132,12 @@ var ts; function getDeclarationContainer(node) { node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 227 /* VariableDeclaration */: - case 228 /* VariableDeclarationList */: - case 243 /* ImportSpecifier */: - case 242 /* NamedImports */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 230 /* VariableDeclaration */: + case 231 /* VariableDeclarationList */: + case 246 /* ImportSpecifier */: + case 245 /* NamedImports */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: return false; default: return true; @@ -27853,7 +28168,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 145 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 146 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 12288 /* Nullable */); }); @@ -27900,7 +28215,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 175 /* ObjectBindingPattern */) { + if (pattern.kind === 178 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -27929,7 +28244,8 @@ var ts; if (strictNullChecks && declaration.flags & 2097152 /* Ambient */ && ts.isParameterDeclaration(declaration)) { parentType = getNonNullableType(parentType); } - var declaredType = getTypeOfPropertyOfType(parentType, text); + var propType = getTypeOfPropertyOfType(parentType, text); + var declaredType = propType && getApparentTypeForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); @@ -27950,7 +28266,7 @@ var ts; } else { // Use specific property type when parent is a tuple or numeric index type when parent is an array - var propName = "" + ts.indexOf(pattern.elements, declaration); + var propName = "" + pattern.elements.indexOf(declaration); type = isTupleLikeType(parentType) ? getTypeOfPropertyOfType(parentType, propName) : elementType; @@ -27971,7 +28287,7 @@ var ts; type = getTypeWithFacts(type, 131072 /* NEUndefined */); } return declaration.initializer ? - getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : + getUnionType([type, checkExpressionCached(declaration.initializer)], 2 /* Subtype */) : type; } function getTypeForDeclarationFromJSDocComment(declaration) { @@ -27987,7 +28303,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 178 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 181 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -27997,11 +28313,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (declaration.parent.parent.kind === 216 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 219 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (32768 /* TypeParameter */ | 524288 /* Index */) ? indexType : stringType; } - if (declaration.parent.parent.kind === 217 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 220 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -28012,14 +28328,14 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } + var isOptional = !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken && includeOptionality; // Use type from type annotation if one is present - var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); - if (typeNode) { - var declaredType = getTypeFromTypeNode(typeNode); - return addOptionality(declaredType, /*optional*/ !!declaration.questionToken && includeOptionality); + var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); + if (declaredType) { + return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) && - declaration.kind === 227 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 230 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 2097152 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -28033,11 +28349,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 155 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 154 /* GetAccessor */); + if (func.kind === 156 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -28058,23 +28374,19 @@ var ts; type = getContextuallyTypedParameterType(declaration); } if (type) { - return addOptionality(type, /*optional*/ !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } } // Use the type of the initializer expression if one is present if (declaration.initializer) { var type = checkDeclarationInitializer(declaration); - return addOptionality(type, /*optional*/ !!declaration.questionToken && includeOptionality); + return addOptionality(type, isOptional); } if (ts.isJsxAttribute(declaration)) { // if JSX attribute doesn't have initializer, by default the attribute will have boolean value of true. // I.e is sugar for return trueType; } - // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 266 /* ShorthandPropertyAssignment */) { - return checkIdentifier(declaration.name); - } // If the declaration specifies a binding pattern, use the type implied by the binding pattern if (ts.isBindingPattern(declaration.name)) { return getTypeFromBindingPattern(declaration.name, /*includePatternInType*/ false, /*reportErrors*/ true); @@ -28089,14 +28401,14 @@ var ts; var jsDocType; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - var expression = declaration.kind === 195 /* BinaryExpression */ ? declaration : - declaration.kind === 180 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 195 /* BinaryExpression */) : + var expression = declaration.kind === 198 /* BinaryExpression */ ? declaration : + declaration.kind === 183 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 198 /* BinaryExpression */) : undefined; if (!expression) { return unknownType; } if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99 /* ThisKeyword */) { - if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 153 /* Constructor */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 154 /* Constructor */) { definedInConstructor = true; } else { @@ -28121,7 +28433,7 @@ var ts; types.push(getWidenedLiteralType(checkExpressionCached(expression.right))); } } - var type = jsDocType || getUnionType(types, /*subtypeReduction*/ true); + var type = jsDocType || getUnionType(types, 2 /* Subtype */); return getWidenedType(addOptionality(type, definedInMethod && !definedInConstructor)); } // Return the type implied by a binding pattern element. This is the type of the initializer of the element if @@ -28195,7 +28507,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 175 /* ObjectBindingPattern */ + return pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -28215,19 +28527,13 @@ var ts; reportErrorsFromWidening(declaration, type); } // always widen a 'unique symbol' type if the type was created for a different declaration. - if (type.flags & 1024 /* UniqueESSymbol */ && !declaration.type && type.symbol !== getSymbolOfNode(declaration)) { + if (type.flags & 1024 /* UniqueESSymbol */ && (ts.isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfNode(declaration)) { type = esSymbolType; } - // During a normal type check we'll never get to here with a property assignment (the check of the containing - // object literal uses a different path). We exclude widening only so that language services and type verification - // tools see the actual type. - if (declaration.kind === 265 /* PropertyAssignment */) { - return type; - } return getWidenedType(type); } // Rest parameters default to type any[], other parameters default to type any - type = declaration.dotDotDotToken ? anyArrayType : anyType; + type = ts.isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType; // Report implicit any errors unless this is a private property within an ambient declaration if (reportErrors && noImplicitAny) { if (!declarationBelongsToPrivateAmbientMember(declaration)) { @@ -28238,9 +28544,15 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 147 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 148 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } + function tryGetTypeFromEffectiveTypeNode(declaration) { + var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); + if (typeNode) { + return getTypeFromTypeNode(typeNode); + } + } function getTypeOfVariableOrParameterOrProperty(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { @@ -28254,7 +28566,7 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 244 /* ExportAssignment */) { + if (declaration.kind === 247 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) { @@ -28270,13 +28582,43 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 195 /* BinaryExpression */ || - declaration.kind === 180 /* PropertyAccessExpression */ && declaration.parent.kind === 195 /* BinaryExpression */) { + if (declaration.kind === 198 /* BinaryExpression */ || + declaration.kind === 183 /* PropertyAccessExpression */ && declaration.parent.kind === 198 /* BinaryExpression */) { type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } - else { + else if (ts.isJSDocPropertyTag(declaration) + || ts.isPropertyAccessExpression(declaration) + || ts.isIdentifier(declaration) + || (ts.isMethodDeclaration(declaration) && !ts.isObjectLiteralMethod(declaration)) + || ts.isMethodSignature(declaration)) { + // Symbol is property of some kind that is merged with something - should use `getTypeOfFuncClassEnumModule` and not `getTypeOfVariableOrParameterOrProperty` + if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { + return getTypeOfFuncClassEnumModule(symbol); + } + type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType; + } + else if (ts.isPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkPropertyAssignment(declaration); + } + else if (ts.isJsxAttribute(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkJsxAttribute(declaration); + } + else if (ts.isShorthandPropertyAssignment(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkExpressionForMutableLocation(declaration.name, 0 /* Normal */); + } + else if (ts.isObjectLiteralMethod(declaration)) { + type = tryGetTypeFromEffectiveTypeNode(declaration) || checkObjectLiteralMethod(declaration, 0 /* Normal */); + } + else if (ts.isParameter(declaration) + || ts.isPropertyDeclaration(declaration) + || ts.isPropertySignature(declaration) + || ts.isVariableDeclaration(declaration) + || ts.isBindingElement(declaration)) { type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } + else { + ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration)); + } if (!popTypeResolution()) { type = reportCircularityError(symbol); } @@ -28286,7 +28628,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); } @@ -28307,8 +28649,8 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 155 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 156 /* SetAccessor */); if (getter && ts.isInJavaScriptFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -28352,7 +28694,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -28443,6 +28785,9 @@ var ts; if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { return getTypeOfInstantiatedSymbol(symbol); } + if (ts.getCheckFlags(symbol) & 2048 /* ReverseMapped */) { + return getTypeOfReverseMappedSymbol(symbol); + } if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { return getTypeOfVariableOrParameterOrProperty(symbol); } @@ -28500,29 +28845,33 @@ var ts; return undefined; } switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 173 /* MappedType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 176 /* MappedType */: + case 170 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 173 /* MappedType */) { + if (node.kind === 176 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } + else if (node.kind === 170 /* ConditionalType */) { + return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node) || ts.emptyArray); var thisType = includeThisTypes && - (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */ || node.kind === 231 /* InterfaceDeclaration */) && + (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */ || node.kind === 234 /* InterfaceDeclaration */) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -28530,7 +28879,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); return getOuterTypeParameters(declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -28539,8 +28888,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 231 /* InterfaceDeclaration */ || node.kind === 230 /* ClassDeclaration */ || - node.kind === 200 /* ClassExpression */ || node.kind === 232 /* TypeAliasDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */ || node.kind === 233 /* ClassDeclaration */ || + node.kind === 203 /* ClassExpression */ || node.kind === 235 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -28656,10 +29005,10 @@ var ts; return type.resolvedBaseTypes; } function resolveBaseTypesOfClass(type) { - type.resolvedBaseTypes = ts.emptyArray; + type.resolvedBaseTypes = ts.resolvingEmptyArray; var baseConstructorType = getApparentType(getBaseConstructorTypeOfClass(type)); if (!(baseConstructorType.flags & (65536 /* Object */ | 262144 /* Intersection */ | 1 /* Any */))) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } var baseTypeNode = getBaseTypeNodeOfClass(type); var typeArgs = typeArgumentsFromTypeReferenceNode(baseTypeNode); @@ -28682,22 +29031,29 @@ var ts; var constructors = getInstantiatedConstructorsForTypeArguments(baseConstructorType, baseTypeNode.typeArguments, baseTypeNode); if (!constructors.length) { error(baseTypeNode.expression, ts.Diagnostics.No_base_constructor_has_the_specified_number_of_type_arguments); - return; + return type.resolvedBaseTypes = ts.emptyArray; } baseType = getReturnTypeOfSignature(constructors[0]); } if (baseType === unknownType) { - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (!isValidBaseType(baseType)) { error(baseTypeNode.expression, ts.Diagnostics.Base_constructor_return_type_0_is_not_a_class_or_interface_type, typeToString(baseType)); - return; + return type.resolvedBaseTypes = ts.emptyArray; } if (type === baseType || hasBaseType(baseType, type)) { - error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); - return; + error(type.symbol.valueDeclaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */)); + return type.resolvedBaseTypes = ts.emptyArray; } - type.resolvedBaseTypes = [baseType]; + if (type.resolvedBaseTypes === ts.resolvingEmptyArray) { + // Circular reference, likely through instantiation of default parameters + // (otherwise there'd be an error from hasBaseType) - this is fine, but `.members` should be reset + // as `getIndexedAccessType` via `instantiateType` via `getTypeFromClassOrInterfaceReference` forces a + // partial instantiation of the members without the base types fully resolved + type.members = undefined; + } + return type.resolvedBaseTypes = [baseType]; } function areAllOuterTypeParametersApplied(type) { // An unapplied type parameter has its symbol still the same as the matching argument symbol. @@ -28713,14 +29069,14 @@ var ts; // A valid base type is `any`, any non-generic object type or intersection of non-generic // object types. function isValidBaseType(type) { - return type.flags & (65536 /* Object */ | 33554432 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + return type.flags & (65536 /* Object */ | 134217728 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || type.flags & 262144 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 234 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -28735,7 +29091,7 @@ var ts; } } else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */)); + error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */)); } } else { @@ -28756,7 +29112,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */) { + if (declaration.kind === 234 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -28814,9 +29170,9 @@ var ts; return unknownType; } var declaration = ts.find(symbol.declarations, function (d) { - return d.kind === 288 /* JSDocTypedefTag */ || d.kind === 232 /* TypeAliasDeclaration */; + return d.kind === 291 /* JSDocTypedefTag */ || d.kind === 235 /* TypeAliasDeclaration */; }); - var typeNode = declaration.kind === 288 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; + var typeNode = declaration.kind === 291 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; // If typeNode is missing, we will error in checkJSDocTypedefTag. var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType; if (popTypeResolution()) { @@ -28846,7 +29202,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 71 /* Identifier */: @@ -28863,7 +29219,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 9 /* StringLiteral */) { @@ -28890,7 +29246,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)); @@ -28900,7 +29256,7 @@ var ts; } } if (memberTypeList.length) { - var enumType_1 = getUnionType(memberTypeList, /*subtypeReduction*/ false, symbol, /*aliasTypeArguments*/ undefined); + var enumType_1 = getUnionType(memberTypeList, 1 /* Literal */, symbol, /*aliasTypeArguments*/ undefined); if (enumType_1.flags & 131072 /* Union */) { enumType_1.flags |= 256 /* EnumLiteral */; enumType_1.symbol = symbol; @@ -28970,20 +29326,20 @@ var ts; function isThislessType(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 134 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 177 /* LiteralType */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isThislessType(node.elementType); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -28998,7 +29354,7 @@ var ts; */ function isThislessVariableLikeDeclaration(node) { var typeNode = ts.getEffectiveTypeAnnotationNode(node); - return typeNode ? isThislessType(typeNode) : !node.initializer; + return typeNode ? isThislessType(typeNode) : !ts.hasInitializer(node); } /** * A function-like declaration is considered free of `this` references if it has a return type @@ -29007,7 +29363,7 @@ var ts; */ function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); - return (node.kind === 153 /* Constructor */ || (returnType && isThislessType(returnType))) && + return (node.kind === 154 /* Constructor */ || (returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter)); } @@ -29023,12 +29379,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -29260,18 +29616,19 @@ var ts; } return symbol; } - function getTypeWithThisArgument(type, thisArgument) { + function getTypeWithThisArgument(type, thisArgument, needApparentType) { if (ts.getObjectFlags(type) & 4 /* Reference */) { var target = type.target; var typeArguments = type.typeArguments; if (ts.length(target.typeParameters) === ts.length(typeArguments)) { - return createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + var ref = createTypeReference(target, ts.concatenate(typeArguments, [thisArgument || target.thisType])); + return needApparentType ? getApparentType(ref) : ref; } } else if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument); })); + return getIntersectionType(ts.map(type.types, function (t) { return getTypeWithThisArgument(t, thisArgument, needApparentType); })); } - return type; + return needApparentType ? getApparentType(type) : type; } function resolveObjectTypeMembers(type, source, typeParameters, typeArguments) { var mapper; @@ -29301,6 +29658,7 @@ var ts; if (source.symbol && members === getMembersOfSymbol(source.symbol)) { members = ts.createSymbolTable(source.declaredProperties); } + setStructuredTypeMembers(type, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); var thisArgument = ts.lastOrUndefined(typeArguments); for (var _i = 0, baseTypes_1 = baseTypes; _i < baseTypes_1.length; _i++) { var baseType = baseTypes_1[_i]; @@ -29328,27 +29686,30 @@ var ts; type.typeArguments : ts.concatenate(type.typeArguments, [type]); resolveObjectTypeMembers(type, source, typeParameters, typeArguments); } - function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { + function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, hasRestParameter, hasLiteralTypes) { var sig = new Signature(checker); sig.declaration = declaration; sig.typeParameters = typeParameters; sig.parameters = parameters; sig.thisParameter = thisParameter; sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; + sig.resolvedTypePredicate = resolvedTypePredicate; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasLiteralTypes = hasLiteralTypes; + sig.target = undefined; + sig.mapper = undefined; return sig; } function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); + return createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, sig.minArgumentCount, sig.hasRestParameter, sig.hasLiteralTypes); } function getDefaultConstructSignatures(classType) { var baseConstructorType = getBaseConstructorTypeOfClass(classType); var baseSignatures = getSignaturesOfType(baseConstructorType, 1 /* Construct */); if (baseSignatures.length === 0) { - return [createSignature(undefined, classType.localTypeParameters, undefined, ts.emptyArray, classType, /*typePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; + return [createSignature(undefined, classType.localTypeParameters, undefined, ts.emptyArray, classType, /*resolvedTypePredicate*/ undefined, 0, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false)]; } var baseTypeNode = getBaseTypeNodeOfClass(classType); var isJavaScript = ts.isInJavaScriptFile(baseTypeNode); @@ -29359,7 +29720,7 @@ var ts; var baseSig = baseSignatures_1[_i]; var minTypeArgumentCount = getMinTypeArgumentCount(baseSig.typeParameters); var typeParamCount = ts.length(baseSig.typeParameters); - if (isJavaScript || (typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount)) { + if (isJavaScript || typeArgCount >= minTypeArgumentCount && typeArgCount <= typeParamCount) { var sig = typeParamCount ? createSignatureInstantiation(baseSig, fillMissingTypeArguments(typeArguments, baseSig.typeParameters, minTypeArgumentCount, isJavaScript)) : cloneSignature(baseSig); sig.typeParameters = classType.localTypeParameters; sig.resolvedReturnType = classType; @@ -29418,13 +29779,13 @@ var ts; var s = signature; // Union the result types when more than one signature matches if (unionSignatures.length > 1) { - s = cloneSignature(signature); + var thisParameter = signature.thisParameter; if (ts.forEach(unionSignatures, function (sig) { return sig.thisParameter; })) { - var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return getTypeOfSymbol(sig.thisParameter) || anyType; }), /*subtypeReduction*/ true); - s.thisParameter = createSymbolWithType(signature.thisParameter, thisType); + var thisType = getUnionType(ts.map(unionSignatures, function (sig) { return sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType; }), 2 /* Subtype */); + thisParameter = createSymbolWithType(signature.thisParameter, thisType); } - // Clear resolved return type we possibly got from cloneSignature - s.resolvedReturnType = undefined; + s = cloneSignature(signature); + s.thisParameter = thisParameter; s.unionSignatures = unionSignatures; } (result || (result = [])).push(s); @@ -29446,7 +29807,7 @@ var ts; indexTypes.push(indexInfo.type); isAnyReadonly = isAnyReadonly || indexInfo.isReadonly; } - return createIndexInfo(getUnionType(indexTypes, /*subtypeReduction*/ true), isAnyReadonly); + return createIndexInfo(getUnionType(indexTypes, 2 /* Subtype */), isAnyReadonly); } function resolveUnionTypeMembers(type) { // The members and properties collections are empty for union types. To get all properties of a union @@ -29542,6 +29903,7 @@ var ts; if (symbol.exports) { members = getExportsOfSymbol(symbol); } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, undefined, undefined); if (symbol.flags & 32 /* Class */) { var classType = getDeclaredTypeOfClassOrInterface(symbol); var baseConstructorType = getBaseConstructorTypeOfClass(classType); @@ -29573,6 +29935,24 @@ var ts; } } } + function resolveReverseMappedTypeMembers(type) { + var indexInfo = getIndexInfoOfType(type.source, 0 /* String */); + var modifiers = getMappedTypeModifiers(type.mappedType); + var readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true; + var optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */; + var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); + var members = ts.createSymbolTable(); + for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { + var prop = _a[_i]; + var checkFlags = 2048 /* ReverseMapped */ | (readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0); + var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); + inferredProp.declarations = prop.declarations; + inferredProp.propertyType = getTypeOfSymbol(prop); + inferredProp.mappedType = type.mappedType; + members.set(prop.escapedName, inferredProp); + } + setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, stringIndexInfo, undefined); + } /** Resolve the members of a mapped type { [P in K]: T } */ function resolveMappedTypeMembers(type) { var members = ts.createSymbolTable(); @@ -29583,13 +29963,12 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var templateType = getTemplateTypeFromMappedType(type); + var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' - var templateReadonly = !!type.declaration.readonlyToken; - var templateOptional = !!type.declaration.questionToken; + var templateModifiers = getMappedTypeModifiers(type); var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // We have a { [P in keyof T]: X } for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { var propertySymbol = _a[_i]; @@ -29603,7 +29982,7 @@ var ts; // First, if the constraint type is a type parameter, obtain the base constraint. Then, // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. // Finally, iterate over the constituents of the resulting iteration type. - var keyType = constraintType.flags & 1081344 /* TypeVariable */ ? getApparentType(constraintType) : constraintType; + var keyType = constraintType.flags & 7372800 /* InstantiableNonPrimitive */ ? getApparentType(constraintType) : constraintType; var iterationType = keyType.flags & 524288 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; forEachType(iterationType, addMemberForKeyType); } @@ -29627,10 +30006,17 @@ var ts; if (t.flags & 32 /* StringLiteral */) { var propName = ts.escapeLeadingUnderscores(t.value); var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 16777216 /* Optional */); - var checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; - var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, checkFlags); - prop.type = propType; + var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || + !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); + var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || + !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp)); + var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, isReadonly ? 8 /* Readonly */ : 0); + // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the + // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks + // mode, if the underlying property is optional we remove 'undefined' from the type. + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */ ? getTypeWithFacts(propType, 131072 /* NEUndefined */) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; @@ -29639,7 +30025,7 @@ var ts; members.set(propName, prop); } else if (t.flags & (1 /* Any */ | 2 /* String */)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } } } @@ -29654,14 +30040,14 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : unknownType); } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. @@ -29680,16 +30066,21 @@ var ts; return type.modifiersType; } function getMappedTypeModifiers(type) { - return (type.declaration.readonlyToken ? 1 /* Readonly */ : 0) | - (type.declaration.questionToken ? 2 /* Optional */ : 0); + var declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 /* MinusToken */ ? 2 /* ExcludeReadonly */ : 1 /* IncludeReadonly */ : 0) | + (declaration.questionToken ? declaration.questionToken.kind === 38 /* MinusToken */ ? 8 /* ExcludeOptional */ : 4 /* IncludeOptional */ : 0); } - function getCombinedMappedTypeModifiers(type) { + function getMappedTypeOptionality(type) { + var modifiers = getMappedTypeModifiers(type); + return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type) { + var optionality = getMappedTypeOptionality(type); var modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type) { - return ts.getObjectFlags(type) & 32 /* Mapped */ && !!type.declaration.questionToken; + return !!(ts.getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */); } function isGenericMappedType(type) { return ts.getObjectFlags(type) & 32 /* Mapped */ && isGenericIndexType(getConstraintTypeFromMappedType(type)); @@ -29703,6 +30094,9 @@ var ts; else if (type.objectFlags & 3 /* ClassOrInterface */) { resolveClassOrInterfaceMembers(type); } + else if (type.objectFlags & 2048 /* ReverseMapped */) { + resolveReverseMappedTypeMembers(type); + } else if (type.objectFlags & 16 /* Anonymous */) { resolveAnonymousTypeMembers(type); } @@ -29779,7 +30173,10 @@ var ts; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { - props.set(escapedName, createUnionOrIntersectionProperty(unionType, escapedName)); + var prop = createUnionOrIntersectionProperty(unionType, escapedName); + // May be undefined if the property is private + if (prop) + props.set(escapedName, prop); } } } @@ -29788,22 +30185,51 @@ var ts; function getConstraintOfType(type) { return type.flags & 32768 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : type.flags & 1048576 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : - getBaseConstraintOfType(type); + type.flags & 2097152 /* Conditional */ ? getConstraintOfConditionalType(type) : + getBaseConstraintOfType(type); } function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; } function getConstraintOfIndexedAccess(type) { - var transformed = getTransformedIndexedAccessType(type); + var transformed = getSimplifiedIndexedAccessType(type); if (transformed) { return transformed; } var baseObjectType = getBaseConstraintOfType(type.objectType); var baseIndexType = getBaseConstraintOfType(type.indexType); + if (baseIndexType === stringType && !getIndexInfoOfType(baseObjectType || type.objectType, 0 /* String */)) { + // getIndexedAccessType returns `any` for X[string] where X doesn't have an index signature. + // to avoid this, return `undefined`. + return undefined; + } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } + function getDefaultConstraintOfConditionalType(type) { + return getUnionType([type.trueType, type.falseType]); + } + function getConstraintOfDistributiveConditionalType(type) { + // Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained + // type parameter. If so, create an instantiation of the conditional type where T is replaced + // with its constraint. We do this because if the constraint is a union type it will be distributed + // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' + // removes 'undefined' from T. + if (isDistributiveConditionalType(type)) { + var constraint = getConstraintOfType(type.checkType); + if (constraint) { + var target = type.target || type; + var mapper = createTypeMapper([target.checkType], [constraint]); + var combinedMapper = type.mapper ? combineTypeMappers(mapper, type.mapper) : mapper; + return instantiateType(target, combinedMapper); + } + } + return undefined; + } + function getConstraintOfConditionalType(type) { + return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); + } function getBaseConstraintOfType(type) { - if (type.flags & (1081344 /* TypeVariable */ | 393216 /* UnionOrIntersection */)) { + if (type.flags & (7372800 /* InstantiableNonPrimitive */ | 393216 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; @@ -29823,29 +30249,30 @@ var ts; * circularly references the type variable. */ function getResolvedBaseConstraint(type) { - var typeStack; var circular; if (!type.resolvedBaseConstraint) { - typeStack = []; var constraint = getBaseConstraint(type); type.resolvedBaseConstraint = circular ? circularConstraintType : getTypeWithThisArgument(constraint || noConstraintType, type); } return type.resolvedBaseConstraint; function getBaseConstraint(t) { - if (ts.contains(typeStack, t)) { + if (!pushTypeResolution(t, 4 /* ResolvedBaseConstraint */)) { circular = true; return undefined; } - typeStack.push(t); var result = computeBaseConstraint(t); - typeStack.pop(); + if (!popTypeResolution()) { + circular = true; + return undefined; + } return result; } function computeBaseConstraint(t) { if (t.flags & 32768 /* TypeParameter */) { var constraint = getConstraintFromTypeParameter(t); - return t.isThisType ? constraint : - constraint ? getBaseConstraint(constraint) : undefined; + return t.isThisType || !constraint ? + constraint : + getBaseConstraint(constraint); } if (t.flags & 393216 /* UnionOrIntersection */) { var types = t.types; @@ -29865,7 +30292,7 @@ var ts; return stringType; } if (t.flags & 1048576 /* IndexedAccess */) { - var transformed = getTransformedIndexedAccessType(t); + var transformed = getSimplifiedIndexedAccessType(t); if (transformed) { return getBaseConstraint(transformed); } @@ -29874,6 +30301,12 @@ var ts; var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (t.flags & 2097152 /* Conditional */) { + return getBaseConstraint(getConstraintOfConditionalType(t)); + } + if (t.flags & 4194304 /* Substitution */) { + return getBaseConstraint(t.substitute); + } if (isGenericMappedType(t)) { return emptyObjectType; } @@ -29881,7 +30314,7 @@ var ts; } } function getApparentTypeOfIntersectionType(type) { - return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); + return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type, /*apparentType*/ true)); } function getResolvedTypeParameterDefault(typeParameter) { if (!typeParameter.default) { @@ -29932,26 +30365,25 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 1081344 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + var t = type.flags & 7897088 /* Instantiable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; return t.flags & 262144 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 524322 /* StringLike */ ? globalStringType : t.flags & 84 /* NumberLike */ ? globalNumberType : t.flags & 136 /* BooleanLike */ ? globalBooleanType : t.flags & 1536 /* ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : - t.flags & 33554432 /* NonPrimitive */ ? emptyObjectType : + t.flags & 134217728 /* NonPrimitive */ ? emptyObjectType : t; } function createUnionOrIntersectionProperty(containingType, name) { var props; - var types = containingType.types; var isUnion = containingType.flags & 131072 /* Union */; var excludeModifiers = isUnion ? 24 /* NonPublicAccessibilityModifier */ : 0; // Flags we want to propagate to the result if they exist in all source symbols var commonFlags = isUnion ? 0 /* None */ : 16777216 /* Optional */; var syntheticFlag = 4 /* SyntheticMethod */; var checkFlags = 0; - for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { - var current = types_5[_i]; + for (var _i = 0, _a = containingType.types; _i < _a.length; _i++) { + var current = _a[_i]; var type = getApparentType(current); if (type !== unknownType) { var prop = getPropertyOfType(type, name); @@ -29982,8 +30414,8 @@ var ts; var propTypes = []; var declarations = []; var commonType = undefined; - for (var _a = 0, props_1 = props; _a < props_1.length; _a++) { - var prop = props_1[_a]; + for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { + var prop = props_1[_b]; if (prop.declarations) { ts.addRange(declarations, prop.declarations); } @@ -30096,7 +30528,7 @@ var ts; } } if (propTypes.length) { - return getUnionType(propTypes, /*subtypeReduction*/ true); + return getUnionType(propTypes, 2 /* Subtype */); } } return undefined; @@ -30122,7 +30554,7 @@ var ts; } function isJSDocOptionalParameter(node) { if (ts.isInJavaScriptFile(node)) { - if (node.type && node.type.kind === 276 /* JSDocOptionalType */) { + if (node.type && node.type.kind === 279 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -30133,7 +30565,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 276 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 279 /* JSDocOptionalType */; } } } @@ -30152,9 +30584,8 @@ var ts; return true; } if (node.initializer) { - var signatureDeclaration = node.parent; - var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = ts.indexOf(signatureDeclaration.parameters, node); + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -30162,27 +30593,27 @@ var ts; if (iife) { return !node.type && !node.dotDotDotToken && - ts.indexOf(node.parent.parameters, node) >= iife.arguments.length; + node.parent.parameters.indexOf(node) >= iife.arguments.length; } return false; } function createTypePredicateFromTypePredicateNode(node) { var parameterName = node.parameterName; + var type = getTypeFromTypeNode(node.type); if (parameterName.kind === 71 /* Identifier */) { - return { - kind: 1 /* Identifier */, - parameterName: parameterName ? parameterName.escapedText : undefined, - parameterIndex: parameterName ? getTypePredicateParameterIndex(node.parent.parameters, parameterName) : undefined, - type: getTypeFromTypeNode(node.type) - }; + return createIdentifierTypePredicate(parameterName && parameterName.escapedText, // TODO: GH#18217 + parameterName && getTypePredicateParameterIndex(node.parent.parameters, parameterName), type); } else { - return { - kind: 0 /* This */, - type: getTypeFromTypeNode(node.type) - }; + return createThisTypePredicate(type); } } + function createIdentifierTypePredicate(parameterName, parameterIndex, type) { + return { kind: 1 /* Identifier */, parameterName: parameterName, parameterIndex: parameterIndex, type: type }; + } + function createThisTypePredicate(type) { + return { kind: 0 /* This */, type: type }; + } /** * Gets the minimum number of type arguments needed to satisfy all non-optional type * parameters. @@ -30262,7 +30693,7 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 174 /* LiteralType */) { + if (param.type && param.type.kind === 177 /* LiteralType */) { hasLiteralTypes = true; } // Record a new minimum argument count if this is not an optional parameter @@ -30275,25 +30706,22 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 154 /* GetAccessor */ || declaration.kind === 155 /* SetAccessor */) && + if ((declaration.kind === 155 /* GetAccessor */ || declaration.kind === 156 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = declaration.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 153 /* Constructor */ ? + var classType = declaration.kind === 154 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); var returnType = getSignatureReturnTypeFromDeclaration(declaration, isJSConstructSignature, classType); - var typePredicate = declaration.type && declaration.type.kind === 159 /* TypePredicate */ ? - createTypePredicateFromTypePredicateNode(declaration.type) : - undefined; var hasRestLikeParameter = ts.hasRestParameter(declaration) || ts.isInJavaScriptFile(declaration) && maybeAddJsSyntheticRestParameter(declaration, parameters); - links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, typePredicate, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); + links.resolvedSignature = createSignature(declaration, typeParameters, thisParameter, parameters, returnType, /*resolvedTypePredicate*/ undefined, minArgumentCount, hasRestLikeParameter, hasLiteralTypes); } return links.resolvedSignature; } @@ -30303,7 +30731,7 @@ var ts; // b) It references `arguments` somewhere var lastParam = ts.lastOrUndefined(declaration.parameters); var lastParamTags = lastParam && ts.getJSDocParameterTags(lastParam); - var lastParamVariadicType = lastParamTags && ts.firstDefined(lastParamTags, function (p) { + var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); if (!lastParamVariadicType && !containsArgumentsReference(declaration)) { @@ -30332,8 +30760,8 @@ var ts; } // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 154 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 155 /* SetAccessor */); + if (declaration.kind === 155 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { @@ -30357,11 +30785,11 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return node.name.kind === 145 /* ComputedPropertyName */ + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return node.name.kind === 146 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); @@ -30375,20 +30803,20 @@ var ts; for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -30418,6 +30846,28 @@ var ts; return getTypeOfSymbol(signature.thisParameter); } } + function signatureHasTypePredicate(signature) { + return getTypePredicateOfSignature(signature) !== undefined; + } + function getTypePredicateOfSignature(signature) { + if (!signature.resolvedTypePredicate) { + if (signature.target) { + var targetTypePredicate = getTypePredicateOfSignature(signature.target); + signature.resolvedTypePredicate = targetTypePredicate ? instantiateTypePredicate(targetTypePredicate, signature.mapper) : noTypePredicate; + } + else if (signature.unionSignatures) { + signature.resolvedTypePredicate = getUnionTypePredicate(signature.unionSignatures) || noTypePredicate; + } + else { + var declaration = signature.declaration; + signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 /* TypePredicate */ ? + createTypePredicateFromTypePredicateNode(declaration.type) : + noTypePredicate; + } + ts.Debug.assert(!!signature.resolvedTypePredicate); + } + return signature.resolvedTypePredicate === noTypePredicate ? undefined : signature.resolvedTypePredicate; + } function getReturnTypeOfSignature(signature) { if (!signature.resolvedReturnType) { if (!pushTypeResolution(signature, 3 /* ResolvedReturnType */)) { @@ -30428,7 +30878,7 @@ var ts; type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); } else if (signature.unionSignatures) { - type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } else { type = getReturnTypeFromBody(signature.declaration); @@ -30513,7 +30963,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 153 /* Constructor */ || signature.declaration.kind === 157 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 154 /* Constructor */ || signature.declaration.kind === 158 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -30527,7 +30977,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 133 /* NumberKeyword */ : 136 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 134 /* NumberKeyword */ : 137 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -30554,7 +31004,43 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return type.symbol && ts.getDeclarationOfKind(type.symbol, 146 /* TypeParameter */).constraint; + return type.symbol && ts.getDeclarationOfKind(type.symbol, 147 /* TypeParameter */).constraint; + } + function getInferredTypeParameterConstraint(typeParameter) { + var inferences; + if (typeParameter.symbol) { + for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + // When an 'infer T' declaration is immediately contained in a type reference node + // (such as 'Foo'), T's constraint is inferred from the constraint of the + // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are + // present, we form an intersection of the inferred constraint types. + if (declaration.parent.kind === 171 /* InferType */ && declaration.parent.parent.kind === 161 /* TypeReference */) { + var typeReference = declaration.parent.parent; + var typeParameters = getTypeParametersForTypeReference(typeReference); + if (typeParameters) { + var index = typeReference.typeArguments.indexOf(declaration.parent); + if (index < typeParameters.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); + if (declaredConstraint) { + // Type parameter constraints can reference other type parameters so + // constraints need to be instantiated. If instantiation produces the + // type parameter itself, we discard that inference. For example, in + // type Foo = [T, U]; + // type Bar = T extends Foo ? Foo : T; + // the instantiated constraint for U is X, so we discard that inference. + var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters)); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts.append(inferences, constraint); + } + } + } + } + } + } + } + return inferences && getIntersectionType(inferences); } function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { @@ -30564,23 +31050,24 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : + getInferredTypeParameterConstraint(typeParameter) || noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 146 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; if (types) { - var length_4 = types.length; + var length_3 = types.length; var i = 0; - while (i < length_4) { + while (i < length_3) { var startId = types[i].id; var count = 1; - while (i + count < length_4 && types[i + count].id === startId + count) { + while (i + count < length_3 && types[i + count].id === startId + count) { count++; } if (result.length) { @@ -30601,13 +31088,13 @@ var ts; // that care about the presence of such types at arbitrary depth in a containing type. function getPropagatingFlagsOfTypes(types, excludeKinds) { var result = 0; - for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { - var type = types_6[_i]; + for (var _i = 0, types_5 = types; _i < types_5.length; _i++) { + var type = types_5[_i]; if (!(type.flags & excludeKinds)) { result |= type.flags; } } - return result & 29360128 /* PropagatingFlags */; + return result & 117440512 /* PropagatingFlags */; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); @@ -30644,7 +31131,7 @@ var ts; var isJs = ts.isInJavaScriptFile(node); var isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - var missingAugmentsTag = isJs && node.parent.kind !== 282 /* JSDocAugmentsTag */; + var missingAugmentsTag = isJs && node.parent.kind !== 285 /* JSDocAugmentsTag */; var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag @@ -30652,7 +31139,7 @@ var ts; : missingAugmentsTag ? ts.Diagnostics.Expected_0_1_type_arguments_provide_these_with_an_extends_tag : ts.Diagnostics.Generic_type_0_requires_between_1_and_2_type_arguments; - var typeStr = typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* WriteArrayAsGenericType */); + var typeStr = typeToString(type, /*enclosingDeclaration*/ undefined, 2 /* WriteArrayAsGenericType */); error(node, diag, typeStr, minTypeArgumentCount, typeParameters.length); if (!isJs) { // TODO: Adopt same permissive behavior in TS as in JS to reduce follow-on editing experience failures (requires editing fillMissingTypeArguments) @@ -30665,11 +31152,7 @@ var ts; var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs)); return createTypeReference(type, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); @@ -30701,17 +31184,13 @@ var ts; } return getTypeAliasInstantiation(symbol, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeReferenceName(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; @@ -30738,12 +31217,10 @@ var ts; } // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); - if (res !== undefined) { - if (typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return res; + if (res) { + return checkNoTypeArguments(node, symbol) ? + res.flags & 32768 /* TypeParameter */ ? getConstrainedTypeParameter(res, node) : res : + unknownType; } if (!(symbol.flags & 107455 /* Value */ && isJSDocTypeReference(node))) { return unknownType; @@ -30775,42 +31252,79 @@ var ts; return getInferredClassType(symbol); } } + function getSubstitutionType(typeParameter, substitute) { + var result = createType(4194304 /* Substitution */); + result.typeParameter = typeParameter; + result.substitute = substitute; + return result; + } + function getConstrainedTypeParameter(typeParameter, node) { + var constraints; + while (ts.isPartOfTypeNode(node)) { + var parent = node.parent; + if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) { + if (getTypeFromTypeNode(parent.checkType) === typeParameter) { + constraints = ts.append(constraints, getTypeFromTypeNode(parent.extendsType)); + } + } + node = parent; + } + return constraints ? getSubstitutionType(typeParameter, getIntersectionType(ts.append(constraints, typeParameter))) : typeParameter; + } function isJSDocTypeReference(node) { - return node.flags & 1048576 /* JSDoc */ && node.kind === 160 /* TypeReference */; + return node.flags & 1048576 /* JSDoc */ && node.kind === 161 /* TypeReference */; + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : ts.declarationNameToString(node.typeName)); + return false; + } + return true; } function getIntendedTypeFromJSDocTypeReference(node) { if (ts.isIdentifier(node.typeName)) { - if (node.typeName.escapedText === "Object") { - if (ts.isJSDocIndexSignature(node)) { - var indexed = getTypeFromTypeNode(node.typeArguments[0]); - var target = getTypeFromTypeNode(node.typeArguments[1]); - var index = createIndexInfo(target, /*isReadonly*/ false); - return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); - } - return anyType; - } + var typeArgs = node.typeArguments; switch (node.typeName.escapedText) { case "String": + checkNoTypeArguments(node); return stringType; case "Number": + checkNoTypeArguments(node); return numberType; case "Boolean": + checkNoTypeArguments(node); return booleanType; case "Void": + checkNoTypeArguments(node); return voidType; case "Undefined": + checkNoTypeArguments(node); return undefinedType; case "Null": + checkNoTypeArguments(node); return nullType; case "Function": case "function": + checkNoTypeArguments(node); return globalFunctionType; case "Array": case "array": - return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined; + return !typeArgs || !typeArgs.length ? anyArrayType : undefined; case "Promise": case "promise": - return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + return !typeArgs || !typeArgs.length ? createPromiseType(anyType) : undefined; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var index = createIndexInfo(target, /*isReadonly*/ false); + return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); + } + return anyType; + } + checkNoTypeArguments(node); + return anyType; } } } @@ -30833,7 +31347,7 @@ var ts; type = getTypeReferenceType(node, symbol); } // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the - // type reference in checkTypeReferenceOrExpressionWithTypeArguments. + // type reference in checkTypeReferenceNode. links.resolvedSymbol = symbol; links.resolvedType = type; } @@ -30859,9 +31373,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: return declaration; } } @@ -31045,27 +31559,27 @@ var ts; return true; } combined |= t.flags; - if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 33554432 /* NonPrimitive */)) { + if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 134217728 /* NonPrimitive */)) { return true; } } return false; } - function addTypeToUnion(typeSet, type) { + function addTypeToUnion(typeSet, includes, type) { var flags = type.flags; if (flags & 131072 /* Union */) { - addTypesToUnion(typeSet, type.types); + includes = addTypesToUnion(typeSet, includes, type.types); } else if (flags & 1 /* Any */) { - typeSet.containsAny = true; + includes |= 1 /* Any */; } else if (!strictNullChecks && flags & 12288 /* Nullable */) { if (flags & 4096 /* Undefined */) - typeSet.containsUndefined = true; + includes |= 2 /* Undefined */; if (flags & 8192 /* Null */) - typeSet.containsNull = true; - if (!(flags & 4194304 /* ContainsWideningType */)) - typeSet.containsNonWideningType = true; + includes |= 4 /* Null */; + if (!(flags & 16777216 /* ContainsWideningType */)) + includes |= 16 /* NonWideningType */; } else if (!(flags & 16384 /* Never */ || flags & 262144 /* Intersection */ && isEmptyIntersectionType(type))) { // We ignore 'never' types in unions. Likewise, we ignore intersections of unit types as they are @@ -31073,13 +31587,13 @@ var ts; // intersections of unit types into 'never' upon construction, but deferring the reduction makes it // easier to reason about their origin. if (flags & 2 /* String */) - typeSet.containsString = true; + includes |= 32 /* String */; if (flags & 4 /* Number */) - typeSet.containsNumber = true; + includes |= 64 /* Number */; if (flags & 512 /* ESSymbol */) - typeSet.containsESSymbol = true; + includes |= 128 /* ESSymbol */; if (flags & 1120 /* StringOrNumberLiteralOrUnique */) - typeSet.containsLiteralOrUniqueESSymbol = true; + includes |= 256 /* LiteralOrUniqueESSymbol */; var len = typeSet.length; var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues); if (index < 0) { @@ -31089,18 +31603,20 @@ var ts; } } } + return includes; } // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. - function addTypesToUnion(typeSet, types) { - for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { - var type = types_7[_i]; - addTypeToUnion(typeSet, type); + function addTypesToUnion(typeSet, includes, types) { + for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { + var type = types_6[_i]; + includes = addTypeToUnion(typeSet, includes, type); } + return includes; } function containsIdenticalType(types, type) { - for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { - var t = types_8[_i]; + for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { + var t = types_7[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -31144,15 +31660,15 @@ var ts; } } } - function removeRedundantLiteralTypes(types) { + function removeRedundantLiteralTypes(types, includes) { var i = types.length; while (i > 0) { i--; var t = types[i]; - var remove = t.flags & 32 /* StringLiteral */ && types.containsString || - t.flags & 64 /* NumberLiteral */ && types.containsNumber || - t.flags & 1024 /* UniqueESSymbol */ && types.containsESSymbol || - t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 2097152 /* FreshLiteral */ && containsType(types, t.regularType); + var remove = t.flags & 32 /* StringLiteral */ && includes & 32 /* String */ || + t.flags & 64 /* NumberLiteral */ && includes & 64 /* Number */ || + t.flags & 1024 /* UniqueESSymbol */ && includes & 128 /* ESSymbol */ || + t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 8388608 /* FreshLiteral */ && containsType(types, t.regularType); if (remove) { ts.orderedRemoveItemAt(types, i); } @@ -31165,7 +31681,8 @@ var ts; // expression constructs such as array literals and the || and ?: operators). Named types can // circularly reference themselves and therefore cannot be subtype reduced during their declaration. // For example, "type Item = string | (() => Item" is a named type that circularly references itself. - function getUnionType(types, subtypeReduction, aliasSymbol, aliasTypeArguments) { + function getUnionType(types, unionReduction, aliasSymbol, aliasTypeArguments) { + if (unionReduction === void 0) { unionReduction = 1 /* Literal */; } if (types.length === 0) { return neverType; } @@ -31173,23 +31690,61 @@ var ts; return types[0]; } var typeSet = []; - addTypesToUnion(typeSet, types); - if (typeSet.containsAny) { + var includes = addTypesToUnion(typeSet, 0, types); + if (includes & 1 /* Any */) { return anyType; } - if (subtypeReduction) { - removeSubtypes(typeSet); - } - else if (typeSet.containsLiteralOrUniqueESSymbol) { - removeRedundantLiteralTypes(typeSet); + switch (unionReduction) { + case 1 /* Literal */: + if (includes & 256 /* LiteralOrUniqueESSymbol */) { + removeRedundantLiteralTypes(typeSet, includes); + } + break; + case 2 /* Subtype */: + removeSubtypes(typeSet); + break; } if (typeSet.length === 0) { - return typeSet.containsNull ? typeSet.containsNonWideningType ? nullType : nullWideningType : - typeSet.containsUndefined ? typeSet.containsNonWideningType ? undefinedType : undefinedWideningType : + return includes & 4 /* Null */ ? includes & 16 /* NonWideningType */ ? nullType : nullWideningType : + includes & 2 /* Undefined */ ? includes & 16 /* NonWideningType */ ? undefinedType : undefinedWideningType : neverType; } return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments); } + function getUnionTypePredicate(signatures) { + var first; + var types = []; + for (var _i = 0, signatures_2 = signatures; _i < signatures_2.length; _i++) { + var sig = signatures_2[_i]; + var pred = getTypePredicateOfSignature(sig); + if (!pred) { + continue; + } + if (first) { + if (!typePredicateKindsMatch(first, pred)) { + // No common type predicate. + return undefined; + } + } + else { + first = pred; + } + types.push(pred.type); + } + if (!first) { + // No union signatures had a type predicate. + return undefined; + } + var unionType = getUnionType(types); + return ts.isIdentifierTypePredicate(first) + ? createIdentifierTypePredicate(first.parameterName, first.parameterIndex, unionType) + : createThisTypePredicate(unionType); + } + function typePredicateKindsMatch(a, b) { + return ts.isIdentifierTypePredicate(a) + ? ts.isIdentifierTypePredicate(b) && a.parameterIndex === b.parameterIndex + : !ts.isIdentifierTypePredicate(b); + } // This function assumes the constituent type list is sorted and deduplicated. function getUnionTypeFromSortedList(types, aliasSymbol, aliasTypeArguments) { if (types.length === 0) { @@ -31219,43 +31774,46 @@ var ts; function getTypeFromUnionTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), /*subtypeReduction*/ false, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), 1 /* Literal */, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); } return links.resolvedType; } - function addTypeToIntersection(typeSet, type) { - if (type.flags & 262144 /* Intersection */) { - addTypesToIntersection(typeSet, type.types); + function addTypeToIntersection(typeSet, includes, type) { + var flags = type.flags; + if (flags & 262144 /* Intersection */) { + includes = addTypesToIntersection(typeSet, includes, type.types); } - else if (type.flags & 1 /* Any */) { - typeSet.containsAny = true; + else if (flags & 1 /* Any */) { + includes |= 1 /* Any */; } - else if (type.flags & 16384 /* Never */) { - typeSet.containsNever = true; + else if (flags & 16384 /* Never */) { + includes |= 8 /* Never */; } else if (ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { - typeSet.containsEmptyObject = true; + includes |= 1024 /* EmptyObject */; } - else if ((strictNullChecks || !(type.flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { - if (type.flags & 65536 /* Object */) { - typeSet.containsObjectType = true; + else if ((strictNullChecks || !(flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { + if (flags & 65536 /* Object */) { + includes |= 512 /* ObjectType */; } - if (type.flags & 131072 /* Union */ && typeSet.unionIndex === undefined) { - typeSet.unionIndex = typeSet.length; + if (flags & 131072 /* Union */) { + includes |= 2048 /* Union */; } - if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + if (!(flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { typeSet.push(type); } } + return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. - function addTypesToIntersection(typeSet, types) { - for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { - var type = types_9[_i]; - addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type)); + function addTypesToIntersection(typeSet, includes, types) { + for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { + var type = types_8[_i]; + includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } + return includes; } // We normalize combinations of intersection and union types based on the distributive property of the '&' // operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection @@ -31272,26 +31830,25 @@ var ts; return emptyObjectType; } var typeSet = []; - addTypesToIntersection(typeSet, types); - if (typeSet.containsNever) { + var includes = addTypesToIntersection(typeSet, 0, types); + if (includes & 8 /* Never */) { return neverType; } - if (typeSet.containsAny) { + if (includes & 1 /* Any */) { return anyType; } - if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + if (includes & 1024 /* EmptyObject */ && !(includes & 512 /* ObjectType */)) { typeSet.push(emptyObjectType); } if (typeSet.length === 1) { return typeSet[0]; } - var unionIndex = typeSet.unionIndex; - if (unionIndex !== undefined) { + if (includes & 2048 /* Union */) { // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. - var unionType = typeSet[unionIndex]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), - /*subtypeReduction*/ false, aliasSymbol, aliasTypeArguments); + var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072 /* Union */) !== 0; }); + var unionType = typeSet[unionIndex_1]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); var type = intersectionTypes.get(id); @@ -31320,7 +31877,7 @@ var ts; return type.resolvedIndexType; } function getLiteralTypeFromPropertyName(prop) { - return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.startsWith(prop.escapedName, "__@") ? + return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.isKnownSymbol(prop) ? neverType : getLiteralType(ts.symbolName(prop)); } @@ -31328,10 +31885,11 @@ var ts; return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return maybeTypeOfKind(type, 1081344 /* TypeVariable */) ? getIndexTypeForGenericType(type) : + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) : ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : - type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : - getLiteralTypeFromPropertyNames(type); + type === wildcardType ? wildcardType : + type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : + getLiteralTypeFromPropertyNames(type); } function getIndexTypeOrString(type) { var indexType = getIndexType(type); @@ -31341,11 +31899,11 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 127 /* KeyOfKeyword */: + case 128 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 140 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 137 /* SymbolKeyword */ + case 141 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 138 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : unknownType; break; @@ -31360,7 +31918,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode : undefined; var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : @@ -31369,6 +31927,7 @@ var ts; var prop = getPropertyOfType(objectType, propName); if (prop) { if (accessExpression) { + markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === 99 /* ThisKeyword */); if (ts.isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { error(accessExpression.argumentExpression, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); return unknownType; @@ -31382,7 +31941,7 @@ var ts; } if (!(indexType.flags & 12288 /* Nullable */) && isTypeAssignableToKind(indexType, 524322 /* StringLike */ | 84 /* NumberLike */ | 1536 /* ESSymbolLike */)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } var indexInfo = isTypeAssignableToKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || getIndexInfoOfType(objectType, 0 /* String */) || @@ -31406,7 +31965,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } @@ -31421,15 +31980,10 @@ var ts; return anyType; } function isGenericObjectType(type) { - return type.flags & 1081344 /* TypeVariable */ ? true : - ts.getObjectFlags(type) & 32 /* Mapped */ ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericObjectType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 536870912 /* GenericMappedType */); } function isGenericIndexType(type) { - return type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) ? true : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericIndexType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 524288 /* Index */); } // Return true if the given type is a non-generic object type with a string index signature and no // other members. @@ -31442,49 +31996,70 @@ var ts; } return false; } + function isMappedTypeToNever(type) { + return ts.getObjectFlags(type) & 32 /* Mapped */ && getTemplateTypeFromMappedType(type) === neverType; + } // Transform an indexed access to a simpler form, if possible. Return the simpler form, or return // undefined if no transformation is possible. - function getTransformedIndexedAccessType(type) { + function getSimplifiedIndexedAccessType(type) { var objectType = type.objectType; - // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or - // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a - // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed - // access types with default property values as expressed by D. - if (objectType.flags & 262144 /* Intersection */ && isGenericObjectType(objectType) && ts.some(objectType.types, isStringIndexOnlyType)) { - var regularTypes = []; - var stringIndexTypes = []; - for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { - var t = _a[_i]; - if (isStringIndexOnlyType(t)) { - stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); - } - else { - regularTypes.push(t); + if (objectType.flags & 262144 /* Intersection */ && isGenericObjectType(objectType)) { + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more object types with only a string index signature, e.g. '(U & V & { [x: string]: D })[K]', return a + // transformed type of the form '(U & V)[K] | D'. This allows us to properly reason about higher order indexed + // access types with default property values as expressed by D. + if (ts.some(objectType.types, isStringIndexOnlyType)) { + var regularTypes = []; + var stringIndexTypes = []; + for (var _i = 0, _a = objectType.types; _i < _a.length; _i++) { + var t = _a[_i]; + if (isStringIndexOnlyType(t)) { + stringIndexTypes.push(getIndexTypeOfType(t, 0 /* String */)); + } + else { + regularTypes.push(t); + } } + return getUnionType([ + getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), + getIntersectionType(stringIndexTypes) + ]); + } + // Given an indexed access type T[K], if T is an intersection containing one or more generic types and one or + // more mapped types with a template type `never`, '(U & V & { [P in T]: never })[K]', return a + // transformed type that removes the never-mapped type: '(U & V)[K]'. This mirrors what would happen + // eventually anyway, but it easier to reason about. + if (ts.some(objectType.types, isMappedTypeToNever)) { + var nonNeverTypes = ts.filter(objectType.types, function (t) { return !isMappedTypeToNever(t); }); + return getIndexedAccessType(getIntersectionType(nonNeverTypes), type.indexType); } - return getUnionType([ - getIndexedAccessType(getIntersectionType(regularTypes), type.indexType), - getIntersectionType(stringIndexTypes) - ]); } // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we // construct the type Box. if (isGenericMappedType(objectType)) { - var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var objectTypeMapper = objectType.mapper; - var templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; - return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + return substituteIndexedMappedType(objectType, type); + } + if (objectType.flags & 32768 /* TypeParameter */) { + var constraint = getConstraintFromTypeParameter(objectType); + if (constraint && isGenericMappedType(constraint)) { + return substituteIndexedMappedType(constraint, type); + } } return undefined; } + function substituteIndexedMappedType(objectType, type) { + var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); + var templateMapper = objectType.mapper ? combineTypeMappers(objectType.mapper, mapper) : mapper; + return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); + } function getIndexedAccessType(objectType, indexType, accessNode) { // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 181 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 184 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } @@ -31535,6 +32110,102 @@ var ts; } return links.resolvedType; } + function getActualTypeParameter(type) { + return type.flags & 4194304 /* Substitution */ ? type.typeParameter : type; + } + function createConditionalType(checkType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, aliasTypeArguments) { + var type = createType(2097152 /* Conditional */); + type.checkType = checkType; + type.extendsType = extendsType; + type.trueType = trueType; + type.falseType = falseType; + type.inferTypeParameters = inferTypeParameters; + type.target = target; + type.mapper = mapper; + type.aliasSymbol = aliasSymbol; + type.aliasTypeArguments = aliasTypeArguments; + return type; + } + function getConditionalType(checkType, baseExtendsType, baseTrueType, baseFalseType, inferTypeParameters, target, mapper, aliasSymbol, baseAliasTypeArguments) { + // Instantiate extends type without instantiating any 'infer T' type parameters + var extendsType = instantiateType(baseExtendsType, mapper); + // Return falseType for a definitely false extends check. We check an instantations of the two + // types with type parameters mapped to the wildcard type, the most permissive instantiations + // possible (the wildcard type is assignable to and from all types). If those are not related, + // then no instatiations will be and we can just return the false branch type. + if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { + return instantiateType(baseFalseType, mapper); + } + // The check could be true for some instantiation + var combinedMapper; + if (inferTypeParameters) { + var inferences = ts.map(inferTypeParameters, createInferenceInfo); + // We don't want inferences from constraints as they may cause us to eagerly resolve the + // conditional type instead of deferring resolution. Also, we always want strict function + // types rules (i.e. proper contravariance) for inferences. + inferTypes(inferences, checkType, extendsType, 8 /* NoConstraints */ | 16 /* AlwaysStrict */); + // We infer 'never' when there are no candidates for a type parameter + var inferredTypes = ts.map(inferences, function (inference) { return getTypeFromInference(inference) || neverType; }); + var inferenceMapper = createTypeMapper(inferTypeParameters, inferredTypes); + combinedMapper = mapper ? combineTypeMappers(mapper, inferenceMapper) : inferenceMapper; + } + // Return union of trueType and falseType for any and never since they match anything + if (checkType.flags & 1 /* Any */ || (checkType.flags & 16384 /* Never */ && !(extendsType.flags & 16384 /* Never */))) { + return getUnionType([instantiateType(baseTrueType, combinedMapper || mapper), instantiateType(baseFalseType, mapper)]); + } + // Instantiate the extends type including inferences for 'infer T' type parameters + var inferredExtendsType = combinedMapper ? instantiateType(baseExtendsType, combinedMapper) : extendsType; + // Return trueType for a definitely true extends check. The definitely assignable relation excludes + // type variable constraints from consideration. Without the definitely assignable relation, the type + // type Foo = T extends { x: string } ? string : number + // would immediately resolve to 'string' instead of being deferred. + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + return instantiateType(baseTrueType, combinedMapper || mapper); + } + // Return a deferred type for a check that is neither definitely true nor definitely false + var erasedCheckType = getActualTypeParameter(checkType); + var trueType = instantiateType(baseTrueType, mapper); + var falseType = instantiateType(baseFalseType, mapper); + // We compute the cache key from the ids of the four constituent types, plus an indicator of whether the + // type is distributive (i.e. whether the original declaration has a type parameter as the check type). + var isDistributive = (target ? target.checkType : erasedCheckType).flags & 32768 /* TypeParameter */ ? 1 : 0; + var id = erasedCheckType.id + "," + extendsType.id + "," + trueType.id + "," + falseType.id + "," + isDistributive; + var cached = conditionalTypes.get(id); + if (cached) { + return cached; + } + var result = createConditionalType(erasedCheckType, extendsType, trueType, falseType, inferTypeParameters, target, mapper, aliasSymbol, instantiateTypes(baseAliasTypeArguments, mapper)); + conditionalTypes.set(id, result); + return result; + } + function isDistributiveConditionalType(type) { + return !!((type.target || type).checkType.flags & 32768 /* TypeParameter */); + } + function getInferTypeParameters(node) { + var result; + if (node.locals) { + node.locals.forEach(function (symbol) { + if (symbol.flags & 262144 /* TypeParameter */) { + result = ts.append(result, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result; + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getConditionalType(getTypeFromTypeNode(node.checkType), getTypeFromTypeNode(node.extendsType), getTypeFromTypeNode(node.trueType), getTypeFromTypeNode(node.falseType), getInferTypeParameters(node), /*target*/ undefined, /*mapper*/ undefined, getAliasSymbolForTypeNode(node), getAliasTypeArgumentsForTypeNode(node)); + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -31556,7 +32227,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 232 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 235 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -31567,7 +32238,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, propagatedFlags) { + function getSpreadType(left, right, symbol, typeFlags, objectFlags) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -31578,15 +32249,12 @@ var ts; return left; } if (left.flags & 131072 /* Union */) { - return mapType(left, function (t) { return getSpreadType(t, right, symbol, propagatedFlags); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); }); } if (right.flags & 131072 /* Union */) { - return mapType(right, function (t) { return getSpreadType(left, t, symbol, propagatedFlags); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); }); } - if (right.flags & 33554432 /* NonPrimitive */) { - return nonPrimitiveType; - } - if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */)) { + if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */ | 134217728 /* NonPrimitive */)) { return left; } var members = ts.createSymbolTable(); @@ -31639,9 +32307,8 @@ var ts; } } var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo)); - spread.flags |= propagatedFlags; - spread.flags |= 2097152 /* FreshLiteral */ | 8388608 /* ContainsObjectLiteral */; - spread.objectFlags |= (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); + spread.flags |= typeFlags | 33554432 /* ContainsObjectLiteral */; + spread.objectFlags |= objectFlags | (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); return spread; } function getNonReadonlySymbol(prop) { @@ -31671,9 +32338,9 @@ var ts; return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 2097152 /* FreshLiteral */)) { + if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 8388608 /* FreshLiteral */)) { if (!type.freshType) { - var freshType = createLiteralType(type.flags | 2097152 /* FreshLiteral */, type.value, type.symbol); + var freshType = createLiteralType(type.flags | 8388608 /* FreshLiteral */, type.value, type.symbol); freshType.regularType = type; type.freshType = freshType; } @@ -31682,7 +32349,7 @@ var ts; return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? type.regularType : type; + return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? type.regularType : type; } function getLiteralType(value, enumId, symbol) { // We store all literal types in a single map with keys of the form '#NNN' and '@SSS', @@ -31714,16 +32381,16 @@ var ts; if (ts.isValidESSymbolDeclaration(node)) { var symbol = getSymbolOfNode(node); var links = getSymbolLinks(symbol); - return links.type || (links.type = createUniqueESSymbolType(symbol)); + return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol)); } return esSymbolType; } function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 231 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 234 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && - (container.kind !== 153 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 154 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -31740,73 +32407,77 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return anyType; - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return stringType; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return numberType; case 122 /* BooleanKeyword */: return booleanType; - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return esSymbolType; case 105 /* VoidKeyword */: return voidType; - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: return undefinedType; case 95 /* NullKeyword */: return nullType; - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return neverType; - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return node.flags & 65536 /* JavaScriptFile */ ? anyType : nonPrimitiveType; - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getTypeFromTypeReference(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return booleanType; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 169 /* ParenthesizedType */: - case 275 /* JSDocNonNullableType */: - case 276 /* JSDocOptionalType */: - case 271 /* JSDocTypeExpression */: + case 172 /* ParenthesizedType */: + case 278 /* JSDocNonNullableType */: + case 279 /* JSDocOptionalType */: + case 274 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 280 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return getTypeFromMappedTypeNode(node); + case 170 /* ConditionalType */: + return getTypeFromConditionalTypeNode(node); + case 171 /* InferType */: + return getTypeFromInferTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -31815,12 +32486,18 @@ var ts; } function instantiateList(items, mapper, instantiator) { if (items && items.length) { - var result = []; - for (var _i = 0, items_1 = items; _i < items_1.length; _i++) { - var v = items_1[_i]; - result.push(instantiator(v, mapper)); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result = i === 0 ? [] : items.slice(0, i); + result.push(mapped); + for (i++; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } } - return result; } return items; } @@ -31860,7 +32537,7 @@ var ts; * This is used during inference when instantiating type parameter defaults. */ function createBackreferenceMapper(typeParameters, index) { - return function (t) { return ts.indexOf(typeParameters, t) >= index ? emptyObjectType : t; }; + return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; }; } function isInferenceContext(mapper) { return !!mapper.signature; @@ -31876,13 +32553,16 @@ var ts; function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } + function wildcardMapper(type) { + return type.flags & 32768 /* TypeParameter */ ? wildcardType : type; + } function cloneTypeParameter(typeParameter) { var result = createType(32768 /* TypeParameter */); result.symbol = typeParameter.symbol; result.target = typeParameter; return result; } - function cloneTypePredicate(predicate, mapper) { + function instantiateTypePredicate(predicate, mapper) { if (ts.isIdentifierTypePredicate(predicate)) { return { kind: 1 /* Identifier */, @@ -31900,7 +32580,6 @@ var ts; } function instantiateSignature(signature, mapper, eraseTypeParameters) { var freshTypeParameters; - var freshTypePredicate; if (signature.typeParameters && !eraseTypeParameters) { // First create a fresh set of type parameters, then include a mapping from the old to the // new type parameters in the mapper function. Finally store this mapper in the new type @@ -31912,18 +32591,24 @@ var ts; tp.mapper = mapper; } } - if (signature.typePredicate) { - freshTypePredicate = cloneTypePredicate(signature.typePredicate, mapper); - } + // Don't compute resolvedReturnType and resolvedTypePredicate now, + // because using `mapper` now could trigger inferences to become fixed. (See `createInferenceContext`.) + // See GH#17600. var result = createSignature(signature.declaration, freshTypeParameters, signature.thisParameter && instantiateSymbol(signature.thisParameter, mapper), instantiateList(signature.parameters, mapper, instantiateSymbol), - /*resolvedReturnType*/ undefined, freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); + /*resolvedReturnType*/ undefined, + /*resolvedTypePredicate*/ undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasLiteralTypes); result.target = signature; result.mapper = mapper; return result; } function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !maybeTypeOfKind(links.type, 65536 /* Object */ | 7897088 /* Instantiable */)) { + // If the type of the symbol is already resolved, and if that type could not possibly + // be affected by instantiation, simply return the symbol itself. + return symbol; + } if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var links = getSymbolLinks(symbol); // If symbol being instantiated is itself a instantiation, fetch the original target and combine the // type mappers. This ensures that original type identities are properly preserved and that aliases // always reference a non-aliases. @@ -31949,7 +32634,7 @@ var ts; var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var symbol = target.symbol; var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; + var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type // parameters that are in scope (and therefore potentially referenced). For type literals that @@ -31960,7 +32645,7 @@ var ts; typeParameters = symbol.flags & 2048 /* TypeLiteral */ && !target.aliasTypeArguments ? ts.filter(outerTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration_1); }) : outerTypeParameters; - links.typeParameters = typeParameters; + links.outerTypeParameters = typeParameters; if (typeParameters.length) { links.instantiations = ts.createMap(); links.instantiations.set(getTypeListId(typeParameters), target); @@ -31989,18 +32674,18 @@ var ts; // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced. if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { var container_1 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 208 /* Block */ ? "quit" : n === container_1; })) { + if (ts.findAncestor(node, function (n) { return n.kind === 211 /* Block */ ? "quit" : n === container_1; })) { return ts.forEachChild(node, containsReference); } } return true; function containsReference(node) { switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: return tp.isThisType; case 71 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return true; } return ts.forEachChild(node, containsReference); @@ -32030,7 +32715,7 @@ var ts; return instantiateAnonymousType(type, mapper); } function isMappableType(type) { - return type.flags & (1 /* Any */ | 32768 /* TypeParameter */ | 65536 /* Object */ | 262144 /* Intersection */ | 1048576 /* IndexedAccess */); + return type.flags & (1 /* Any */ | 7372800 /* InstantiableNonPrimitive */ | 65536 /* Object */ | 262144 /* Intersection */); } function instantiateAnonymousType(type, mapper) { var result = createObjectType(type.objectFlags | 64 /* Instantiated */, type.symbol); @@ -32043,8 +32728,26 @@ var ts; result.aliasTypeArguments = instantiateTypes(type.aliasTypeArguments, mapper); return result; } + function getConditionalTypeInstantiation(type, mapper) { + var target = type.target || type; + var combinedMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper; + // Check if we have a conditional type where the check type is a naked type parameter. If so, + // the conditional type is distributive over union types and when T is instantiated to a union + // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). + if (isDistributiveConditionalType(target)) { + var checkType_1 = target.checkType; + var instantiatedType = combinedMapper(checkType_1); + if (checkType_1 !== instantiatedType && instantiatedType.flags & 131072 /* Union */) { + return mapType(instantiatedType, function (t) { return instantiateConditionalType(target, createReplacementMapper(checkType_1, t, combinedMapper)); }); + } + } + return instantiateConditionalType(target, combinedMapper); + } + function instantiateConditionalType(type, mapper) { + return getConditionalType(instantiateType(type.checkType, mapper), type.extendsType, type.trueType, type.falseType, type.inferTypeParameters, type, mapper, type.aliasSymbol, type.aliasTypeArguments); + } function instantiateType(type, mapper) { - if (type && mapper !== identityMapper) { + if (type && mapper && mapper !== identityMapper) { if (type.flags & 32768 /* TypeParameter */) { return mapper(type); } @@ -32060,14 +32763,20 @@ var ts; return getAnonymousTypeInstantiation(type, mapper); } if (type.objectFlags & 4 /* Reference */) { - return createTypeReference(type.target, instantiateTypes(type.typeArguments, mapper)); + var typeArguments = type.typeArguments; + var newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type; } } if (type.flags & 131072 /* Union */ && !(type.flags & 16382 /* Primitive */)) { - return getUnionType(instantiateTypes(type.types, mapper), /*subtypeReduction*/ false, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, 1 /* Literal */, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(instantiateTypes(type.types, mapper), type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 524288 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); @@ -32075,41 +32784,51 @@ var ts; if (type.flags & 1048576 /* IndexedAccess */) { return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper)); } + if (type.flags & 2097152 /* Conditional */) { + return getConditionalTypeInstantiation(type, mapper); + } + if (type.flags & 4194304 /* Substitution */) { + return mapper(type.typeParameter); + } } return type; } + function getWildcardInstantiation(type) { + return type.flags & (16382 /* Primitive */ | 1 /* Any */ | 16384 /* Never */) ? type : + type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return node.operatorToken.kind === 54 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.forEach(node.properties, isContextSensitive); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. return node.initializer && isContextSensitive(node.initializer); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: // It is possible to that node.expression is undefined (e.g
) return node.expression && isContextSensitive(node.expression); } @@ -32124,7 +32843,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 188 /* ArrowFunction */) { + if (node.kind !== 191 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -32133,7 +32852,7 @@ var ts; } } // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return node.body.kind === 208 /* Block */ ? false : isContextSensitive(node.body); + return node.body.kind === 211 /* Block */ ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -32182,7 +32901,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 131072 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 131072 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 1081344 /* TypeVariable */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & 7372800 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); } @@ -32232,8 +32951,8 @@ var ts; source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes); } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 152 /* MethodDeclaration */ && - kind !== 151 /* MethodSignature */ && kind !== 153 /* Constructor */; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 /* MethodDeclaration */ && + kind !== 152 /* MethodSignature */ && kind !== 154 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -32269,7 +32988,7 @@ var ts; // with respect to T. var sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); var targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType)); - var callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + var callbacks = sourceSig && targetSig && !signatureHasTypePredicate(sourceSig) && !signatureHasTypePredicate(targetSig) && (getFalsyFlags(sourceType) & 12288 /* Nullable */) === (getFalsyFlags(targetType) & 12288 /* Nullable */); var related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, strictVariance ? 2 /* Strict */ : 1 /* Bivariant */, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : @@ -32289,11 +33008,13 @@ var ts; } var sourceReturnType = getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions - if (target.typePredicate) { - if (source.typePredicate) { - result &= compareTypePredicateRelatedTo(source.typePredicate, target.typePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (targetTypePredicate) { + var sourceTypePredicate = getTypePredicateOfSignature(source); + if (sourceTypePredicate) { + result &= compareTypePredicateRelatedTo(sourceTypePredicate, targetTypePredicate, source.declaration, target.declaration, reportErrors, errorReporter, compareTypes); } - else if (ts.isIdentifierTypePredicate(target.typePredicate)) { + else if (ts.isIdentifierTypePredicate(targetTypePredicate)) { if (reportErrors) { errorReporter(ts.Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); } @@ -32319,13 +33040,12 @@ var ts; return 0 /* False */; } if (source.kind === 1 /* Identifier */) { - var sourcePredicate = source; var targetPredicate = target; - var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0 /* False */; @@ -32383,7 +33103,7 @@ var ts; } function isEmptyObjectType(type) { return type.flags & 65536 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : - type.flags & 33554432 /* NonPrimitive */ ? true : + type.flags & 134217728 /* NonPrimitive */ ? true : type.flags & 131072 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : type.flags & 262144 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : false; @@ -32408,7 +33128,7 @@ var ts; var targetProperty = getPropertyOfType(targetEnumType, property.escapedName); if (!targetProperty || !(targetProperty.flags & 8 /* EnumMember */)) { if (errorReporter) { - errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */)); + errorReporter(ts.Diagnostics.Property_0_is_missing_in_type_1, ts.symbolName(property), typeToString(getDeclaredTypeOfSymbol(targetSymbol), /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */)); } enumRelation.set(id, false); return false; @@ -32421,7 +33141,7 @@ var ts; function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { var s = source.flags; var t = target.flags; - if (t & 1 /* Any */ || s & 16384 /* Never */) + if (t & 1 /* Any */ || s & 16384 /* Never */ || source === wildcardType) return true; if (t & 16384 /* Never */) return false; @@ -32455,11 +33175,11 @@ var ts; return true; if (s & 8192 /* Null */ && (!strictNullChecks || t & 8192 /* Null */)) return true; - if (s & 65536 /* Object */ && t & 33554432 /* NonPrimitive */) + if (s & 65536 /* Object */ && t & 134217728 /* NonPrimitive */) return true; if (s & 1024 /* UniqueESSymbol */ || t & 1024 /* UniqueESSymbol */) return false; - if (relation === assignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { if (s & 1 /* Any */) return true; // Type number or any numeric literal type is assignable to any numeric enum type or any @@ -32471,10 +33191,10 @@ var ts; return false; } function isTypeRelatedTo(source, target, relation) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } if (source === target || @@ -32488,11 +33208,14 @@ var ts; return related === 1 /* Succeeded */; } } - if (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */) { + if (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } + function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { + return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). * @param source The left-hand-side of the relation. @@ -32520,10 +33243,24 @@ var ts; } else if (errorInfo) { if (containingMessageChain) { - errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); + var chain_1 = containingMessageChain(); + if (chain_1) { + errorInfo = ts.concatenateDiagnosticMessageChains(chain_1, errorInfo); + } } diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); } + // Check if we should issue an extra diagnostic to produce a quickfix for a slightly incorrect import statement + if (headMessage && errorNode && !result && source.symbol) { + var links = getSymbolLinks(source.symbol); + if (links.originatingImport && !ts.isImportCall(links.originatingImport)) { + var helpfulRetry = checkTypeRelatedTo(getTypeOfSymbol(links.target), target, relation, /*errorNode*/ undefined); + if (helpfulRetry) { + // Likely an incorrect import. Issue a helpful diagnostic to produce a quickfix to change the import + diagnostics.add(ts.createDiagnosticForNode(links.originatingImport, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime)); + } + } + } return result !== 0 /* False */; function reportError(message, arg0, arg1, arg2) { ts.Debug.assert(!!errorNode); @@ -32533,8 +33270,8 @@ var ts; var sourceType = typeToString(source); var targetType = typeToString(target); if (sourceType === targetType) { - sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */); - targetType = typeToString(target, /*enclosingDeclaration*/ undefined, 256 /* UseFullyQualifiedType */); + sourceType = typeToString(source, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); + targetType = typeToString(target, /*enclosingDeclaration*/ undefined, 64 /* UseFullyQualifiedType */); } if (!message) { if (relation === comparableRelation) { @@ -32585,12 +33322,18 @@ var ts; * * Ternary.False if they are not related. */ function isRelatedTo(source, target, reportErrors, headMessage) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } + if (source.flags & 4194304 /* Substitution */) { + source = relation === definitelyAssignableRelation ? source.typeParameter : source.substitute; + } + if (target.flags & 4194304 /* Substitution */) { + target = target.typeParameter; + } // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return -1 /* True */; @@ -32600,8 +33343,9 @@ var ts; if (relation === comparableRelation && !(target.flags & 16384 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1 /* True */; - if (isObjectLiteralType(source) && source.flags & 2097152 /* FreshLiteral */) { - if (hasExcessProperties(source, target, reportErrors)) { + if (isObjectLiteralType(source) && source.flags & 8388608 /* FreshLiteral */) { + var discriminantType = target.flags & 131072 /* Union */ ? findMatchingDiscriminantType(source, target) : undefined; + if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { reportRelationError(headMessage, source, target); } @@ -32611,7 +33355,7 @@ var ts; // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { source = getRegularTypeOfObjectLiteral(source); } } @@ -32672,7 +33416,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false); } - if (!result && (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */)) { + if (!result && (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; } @@ -32692,32 +33436,55 @@ var ts; } function isIdenticalTo(source, target) { var result; - if (source.flags & 65536 /* Object */ && target.flags & 65536 /* Object */) { + var flags = source.flags & target.flags; + if (flags & 65536 /* Object */) { return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } - if (source.flags & 131072 /* Union */ && target.flags & 131072 /* Union */ || - source.flags & 262144 /* Intersection */ && target.flags & 262144 /* Intersection */) { + if (flags & (131072 /* Union */ | 262144 /* Intersection */)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & 524288 /* Index */) { + return isRelatedTo(source.type, target.type, /*reportErrors*/ false); + } + if (flags & 1048576 /* IndexedAccess */) { + if (result = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { + return result; + } + } + } + if (flags & 2097152 /* Conditional */) { + if (result = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.trueType, target.trueType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.falseType, target.falseType, /*reportErrors*/ false)) { + if (isDistributiveConditionalType(source) === isDistributiveConditionalType(target)) { + return result; + } + } + } + } + } + } + if (flags & 4194304 /* Substitution */) { + return isRelatedTo(source.substitute, target.substitute, /*reportErrors*/ false); + } return 0 /* False */; } - function hasExcessProperties(source, target, reportErrors) { + function hasExcessProperties(source, target, discriminant, reportErrors) { if (maybeTypeOfKind(target, 65536 /* Object */) && !(ts.getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); - if ((relation === assignableRelation || relation === comparableRelation) && + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); + if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } - if (target.flags & 131072 /* Union */) { - var discriminantType = findMatchingDiscriminantType(source, target); - if (discriminantType) { - // check excess properties against discriminant type only, not the entire union - return hasExcessProperties(source, discriminantType, reportErrors); - } + if (discriminant) { + // check excess properties against discriminant type only, not the entire union + return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } var _loop_4 = function (prop) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -32981,6 +33748,9 @@ var ts; } return result; } + function getConstraintForRelation(type) { + return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); + } function structuredTypeRelatedTo(source, target, reportErrors) { var result; var originalErrorInfo; @@ -32988,7 +33758,7 @@ var ts; if (target.flags & 32768 /* TypeParameter */) { // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. if (ts.getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -33006,7 +33776,7 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // constraint of T. - var constraint = getConstraintOfType(target.type); + var constraint = getConstraintForRelation(target.type); if (constraint) { if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { return result; @@ -33015,8 +33785,8 @@ var ts; } else if (target.flags & 1048576 /* IndexedAccess */) { // A type S is related to a type T[K] if S is related to A[K], where K is string-like and - // A is the apparent type of S. - var constraint = getConstraintOfIndexedAccess(target); + // A is the apparent type of T. + var constraint = getConstraintForRelation(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { errorInfo = saveErrorInfo; @@ -33024,19 +33794,30 @@ var ts; } } } - else if (isGenericMappedType(target) && !isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (isGenericMappedType(target)) { + // A source type T is related to a target type { [P in X]: T[P] } + var template = getTemplateTypeFromMappedType(target); + var modifiers = getMappedTypeModifiers(target); + if (!(modifiers & 8 /* ExcludeOptional */)) { + if (template.flags & 1048576 /* IndexedAccess */ && template.objectType === source && + template.indexType === getTypeParameterFromMappedType(target)) { + return -1 /* True */; + } + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } if (source.flags & 32768 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(source); + var constraint = getConstraintForRelation(source); // A type parameter with no constraint is not related to the non-primitive object type. - if (constraint || !(target.flags & 33554432 /* NonPrimitive */)) { + if (constraint || !(target.flags & 134217728 /* NonPrimitive */)) { if (!constraint || constraint.flags & 1 /* Any */) { constraint = emptyObjectType; } @@ -33051,25 +33832,53 @@ var ts; else if (source.flags & 1048576 /* IndexedAccess */) { // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and // A is the apparent type of S. - var constraint = getConstraintOfIndexedAccess(source); + var constraint = getConstraintForRelation(source); if (constraint) { if (result = isRelatedTo(constraint, target, reportErrors)) { errorInfo = saveErrorInfo; return result; } } - else if (target.flags & 1048576 /* IndexedAccess */ && source.indexType === target.indexType) { - // if we have indexed access types with identical index types, see if relationship holds for - // the two object types. + else if (target.flags & 1048576 /* IndexedAccess */) { if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) { + result &= isRelatedTo(source.indexType, target.indexType, reportErrors); + } + if (result) { errorInfo = saveErrorInfo; return result; } } } + else if (source.flags & 2097152 /* Conditional */) { + if (relation !== definitelyAssignableRelation) { + var constraint = getConstraintOfDistributiveConditionalType(source); + if (constraint) { + if (result = isRelatedTo(constraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + if (target.flags & 2097152 /* Conditional */) { + if (isTypeIdenticalTo(source.checkType, target.checkType) && + isTypeIdenticalTo(source.extendsType, target.extendsType)) { + if (result = isRelatedTo(source.trueType, target.trueType, reportErrors)) { + result &= isRelatedTo(source.falseType, target.falseType, reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (result = isRelatedTo(getDefaultConstraintOfConditionalType(source), target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } else { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && - !(source.flags & 134217728 /* MarkerType */ || target.flags & 134217728 /* MarkerType */)) { + !(ts.getObjectFlags(source) & 8192 /* MarkerType */ || ts.getObjectFlags(target) & 8192 /* MarkerType */)) { // We have type references to the same generic type, and the type references are not marker // type references (which are intended by be compared structurally). Obtain the variance // information for the type parameters and relate the type arguments accordingly. @@ -33151,8 +33960,7 @@ var ts; // that S and T are contra-variant whereas X and Y are co-variant. function mappedTypeRelatedTo(source, target, reportErrors) { var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & 2 /* Optional */) || - getCombinedMappedTypeModifiers(target) & 2 /* Optional */); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { var result_1; if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -33195,6 +34003,9 @@ var ts; if (!(targetProp.flags & 4194304 /* Prototype */)) { var sourceProp = getPropertyOfType(source, targetProp.escapedName); if (sourceProp && sourceProp !== targetProp) { + if (isIgnoredJsxProperty(source, sourceProp, getTypeOfSymbol(targetProp))) { + continue; + } var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp); var targetPropFlags = ts.getDeclarationModifierFlagsFromSymbol(targetProp); if (sourcePropFlags & 8 /* Private */ || targetPropFlags & 8 /* Private */) { @@ -33275,7 +34086,7 @@ var ts; return false; } function hasCommonProperties(source, target) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -33405,6 +34216,9 @@ var ts; var result = -1 /* True */; for (var _i = 0, _a = getPropertiesOfObjectType(source); _i < _a.length; _i++) { var prop = _a[_i]; + if (isIgnoredJsxProperty(source, prop, /*targetMemberType*/ undefined)) { + continue; + } if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) { var related = isRelatedTo(getTypeOfSymbol(prop), target, reportErrors); if (!related) { @@ -33501,7 +34315,7 @@ var ts; // type, and flag the result as a marker type reference. function getMarkerTypeReference(type, source, target) { var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; })); - result.flags |= 134217728 /* MarkerType */; + result.objectFlags |= 8192 /* MarkerType */; return result; } // Return an array containing the variance of each type parameter. The variance is effectively @@ -33574,7 +34388,7 @@ var ts; for (var _i = 0, _a = type.typeArguments; _i < _a.length; _i++) { var t = _a[_i]; if (isUnconstrainedTypeParameter(t)) { - var index = ts.indexOf(typeParameters, t); + var index = typeParameters.indexOf(t); if (index < 0) { index = typeParameters.length; typeParameters.push(t); @@ -33765,17 +34579,25 @@ var ts; result &= related; } if (!ignoreReturnTypes) { - result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + result &= sourceTypePredicate !== undefined || targetTypePredicate !== undefined + ? compareTypePredicatesIdentical(sourceTypePredicate, targetTypePredicate, compareTypes) + // If they're both type predicates their return types will both be `boolean`, so no need to compare those. + : compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); } return result; } + function compareTypePredicatesIdentical(source, target, compareTypes) { + return source === undefined || target === undefined || !typePredicateKindsMatch(source, target) ? 0 /* False */ : compareTypes(source.type, target.type); + } function isRestParameterIndex(signature, parameterIndex) { return signature.hasRestParameter && parameterIndex >= signature.parameters.length - 1; } function literalTypesWithSameBaseType(types) { var commonBaseType; - for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { - var t = types_10[_i]; + for (var _i = 0, types_9 = types; _i < types_9.length; _i++) { + var t = types_9[_i]; var baseType = getBaseTypeOfLiteralType(t); if (!commonBaseType) { commonBaseType = baseType; @@ -33801,7 +34623,7 @@ var ts; var primaryTypes = ts.filter(types, function (t) { return !(t.flags & 12288 /* Nullable */); }); return primaryTypes.length ? getNullableType(getSupertypeOrUnion(primaryTypes), getFalsyFlagsOfTypes(types) & 12288 /* Nullable */) : - getUnionType(types, /*subtypeReduction*/ true); + getUnionType(types, 2 /* Subtype */); } // Return the leftmost type for which no type to the right is a subtype. function getCommonSubtype(types) { @@ -33841,8 +34663,8 @@ var ts; } function getWidenedLiteralType(type) { return type.flags & 256 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : - type.flags & 32 /* StringLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? stringType : - type.flags & 64 /* NumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? numberType : + type.flags & 32 /* StringLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? stringType : + type.flags & 64 /* NumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? numberType : type.flags & 128 /* BooleanLiteral */ ? booleanType : type.flags & 131072 /* Union */ ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) : type; @@ -33867,8 +34689,8 @@ var ts; } function getFalsyFlagsOfTypes(types) { var result = 0; - for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { - var t = types_11[_i]; + for (var _i = 0, types_10 = types; _i < types_10.length; _i++) { + var t = types_10[_i]; result |= getFalsyFlags(t); } return result; @@ -33954,7 +34776,7 @@ var ts; * Leave signatures alone since they are not subject to the check. */ function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType(type) && type.flags & 2097152 /* FreshLiteral */)) { + if (!(isObjectLiteralType(type) && type.flags & 8388608 /* FreshLiteral */)) { return type; } var regularType = type.regularType; @@ -33964,7 +34786,7 @@ var ts; var resolved = type; var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo); - regularNew.flags = resolved.flags & ~2097152 /* FreshLiteral */; + regularNew.flags = resolved.flags & ~8388608 /* FreshLiteral */; regularNew.objectFlags |= 128 /* ObjectLiteral */; type.regularType = regularNew; return regularNew; @@ -34046,7 +34868,7 @@ var ts; return getWidenedTypeWithContext(type, /*context*/ undefined); } function getWidenedTypeWithContext(type, context) { - if (type.flags & 12582912 /* RequiresWidening */) { + if (type.flags & 50331648 /* RequiresWidening */) { if (type.flags & 12288 /* Nullable */) { return anyType; } @@ -34059,7 +34881,7 @@ var ts; // Widening an empty object literal transitions from a highly restrictive type to // a highly inclusive one. For that reason we perform subtype reduction here if the // union includes empty object types (e.g. reducing {} | string to just {}). - return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType)); + return getUnionType(widenedTypes, ts.some(widenedTypes, isEmptyObjectType) ? 2 /* Subtype */ : 1 /* Literal */); } if (isArrayType(type) || isTupleType(type)) { return createTypeReference(type.target, ts.sameMap(type.typeArguments, getWidenedType)); @@ -34080,7 +34902,7 @@ var ts; */ function reportWideningErrorsInType(type) { var errorReported = false; - if (type.flags & 4194304 /* ContainsWideningType */) { + if (type.flags & 16777216 /* ContainsWideningType */) { if (type.flags & 131072 /* Union */) { if (ts.some(type.types, isEmptyObjectType)) { errorReported = true; @@ -34106,9 +34928,9 @@ var ts; for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); - if (t.flags & 4194304 /* ContainsWideningType */) { + if (t.flags & 16777216 /* ContainsWideningType */) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, ts.symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -34121,38 +34943,41 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 147 /* Parameter */: + case 148 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; + case 176 /* MappedType */: + error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); + return; default: diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; } error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && noImplicitAny && type.flags & 4194304 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 16777216 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -34201,6 +35026,7 @@ var ts; return { typeParameter: typeParameter, candidates: undefined, + contraCandidates: undefined, inferredType: undefined, priority: undefined, topLevel: true, @@ -34211,6 +35037,7 @@ var ts; return { typeParameter: inference.typeParameter, candidates: inference.candidates && inference.candidates.slice(), + contraCandidates: inference.contraCandidates && inference.contraCandidates.slice(), inferredType: inference.inferredType, priority: inference.priority, topLevel: inference.topLevel, @@ -34222,7 +35049,7 @@ var ts; // results for union and intersection types for performance reasons. function couldContainTypeVariables(type) { var objectFlags = ts.getObjectFlags(type); - return !!(type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) || + return !!(type.flags & 7897088 /* Instantiable */ || objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || objectFlags & 32 /* Mapped */ || @@ -34237,7 +35064,7 @@ var ts; function isTypeParameterAtTopLevel(type, typeParameter) { return type === typeParameter || type.flags & 393216 /* UnionOrIntersection */ && ts.forEach(type.types, function (t) { return isTypeParameterAtTopLevel(t, typeParameter); }); } - /** Create an object with properties named in the string literal type. Every property has type `{}` */ + /** Create an object with properties named in the string literal type. Every property has type `any` */ function createEmptyObjectTypeFromStringLiteral(type) { var members = ts.createSymbolTable(); forEachType(type, function (t) { @@ -34246,7 +35073,7 @@ var ts; } var name = ts.escapeLeadingUnderscores(t.value); var literalProp = createSymbol(4 /* Property */, name); - literalProp.type = emptyObjectType; + literalProp.type = anyType; if (t.symbol) { literalProp.declarations = t.symbol.declarations; literalProp.valueDeclaration = t.symbol.valueDeclaration; @@ -34262,42 +35089,43 @@ var ts; * property is computed by inferring from the source property type to X for the type * variable T[P] (i.e. we treat the type T[P] as the type variable we're inferring for). */ - function inferTypeForHomomorphicMappedType(source, target, mappedTypeStack) { + function inferTypeForHomomorphicMappedType(source, target) { + var key = source.id + "," + target.id; + if (reverseMappedCache.has(key)) { + return reverseMappedCache.get(key); + } + reverseMappedCache.set(key, undefined); + var type = createReverseMappedType(source, target); + reverseMappedCache.set(key, type); + return type; + } + function createReverseMappedType(source, target) { var properties = getPropertiesOfType(source); - var indexInfo = getIndexInfoOfType(source, 0 /* String */); - if (properties.length === 0 && !indexInfo) { + if (properties.length === 0 && !getIndexInfoOfType(source, 0 /* String */)) { return undefined; } - var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); - var inference = createInferenceInfo(typeParameter); - var inferences = [inference]; - var templateType = getTemplateTypeFromMappedType(target); - var readonlyMask = target.declaration.readonlyToken ? false : true; - var optionalMask = target.declaration.questionToken ? 0 : 16777216 /* Optional */; - var members = ts.createSymbolTable(); + // If any property contains context sensitive functions that have been skipped, the source type + // is incomplete and we can't infer a meaningful input type. for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { var prop = properties_4[_i]; - var propType = getTypeOfSymbol(prop); - // If any property contains context sensitive functions that have been skipped, the source type - // is incomplete and we can't infer a meaningful input type. - if (propType.flags & 16777216 /* ContainsAnyFunctionType */) { + if (getTypeOfSymbol(prop).flags & 67108864 /* ContainsAnyFunctionType */) { return undefined; } - var checkFlags = readonlyMask && isReadonlySymbol(prop) ? 8 /* Readonly */ : 0; - var inferredProp = createSymbol(4 /* Property */ | prop.flags & optionalMask, prop.escapedName, checkFlags); - inferredProp.declarations = prop.declarations; - inferredProp.type = inferTargetType(propType); - members.set(prop.escapedName, inferredProp); - } - if (indexInfo) { - indexInfo = createIndexInfo(inferTargetType(indexInfo.type), readonlyMask && indexInfo.isReadonly); - } - return createAnonymousType(undefined, members, ts.emptyArray, ts.emptyArray, indexInfo, undefined); - function inferTargetType(sourceType) { - inference.candidates = undefined; - inferTypes(inferences, sourceType, templateType, 0, mappedTypeStack); - return inference.candidates ? getUnionType(inference.candidates, /*subtypeReduction*/ true) : emptyObjectType; } + var reversed = createObjectType(2048 /* ReverseMapped */ | 16 /* Anonymous */, /*symbol*/ undefined); + reversed.source = source; + reversed.mappedType = target; + return reversed; + } + function getTypeOfReverseMappedSymbol(symbol) { + return inferReverseMappedType(symbol.propertyType, symbol.mappedType); + } + function inferReverseMappedType(sourceType, target) { + var typeParameter = getIndexedAccessType(getConstraintTypeFromMappedType(target).type, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + var inference = createInferenceInfo(typeParameter); + inferTypes([inference], sourceType, templateType); + return getTypeFromInference(inference) || emptyObjectType; } function getUnmatchedProperty(source, target, requireOptionalProperties) { var properties = target.flags & 262144 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); @@ -34312,10 +35140,16 @@ var ts; } return undefined; } - function inferTypes(inferences, originalSource, originalTarget, priority, mappedTypeStack) { + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : + inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : + undefined; + } + function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; var visited; + var contravariant = false; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { @@ -34378,31 +35212,33 @@ var ts; // not contain anyFunctionType when we come back to this argument for its second round // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard // when constructing types from type parameters that had no inference candidates). - if (source.flags & 16777216 /* ContainsAnyFunctionType */ || source === silentNeverType) { + if (source.flags & 67108864 /* ContainsAnyFunctionType */ || source === silentNeverType) { return; } var inference = getInferenceInfoForType(target); if (inference) { if (!inference.isFixed) { - // We give lowest priority to inferences of implicitNeverType (which is used as the - // element type for empty array literals). Thus, inferences from empty array literals - // only matter when no other inferences are made. - var p = priority | (source === implicitNeverType ? 16 /* NeverType */ : 0); - if (!inference.candidates || p < inference.priority) { - inference.candidates = [source]; - inference.priority = p; + if (inference.priority === undefined || priority < inference.priority) { + inference.candidates = undefined; + inference.contraCandidates = undefined; + inference.priority = priority; } - else if (p === inference.priority) { - inference.candidates.push(source); + if (priority === inference.priority) { + if (contravariant) { + inference.contraCandidates = ts.append(inference.contraCandidates, source); + } + else { + inference.candidates = ts.append(inference.candidates, source); + } } - if (!(p & 8 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 4 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; } } return; } } - else if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { + if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target) { // If source and target are references to the same generic type, infer from type arguments var sourceTypes = source.typeArguments || ts.emptyArray; var targetTypes = target.typeArguments || ts.emptyArray; @@ -34418,20 +35254,26 @@ var ts; } } else if (source.flags & 524288 /* Index */ && target.flags & 524288 /* Index */) { - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; inferFromTypes(source.type, target.type); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else if ((isLiteralType(source) || source.flags & 2 /* String */) && target.flags & 524288 /* Index */) { var empty = createEmptyObjectTypeFromStringLiteral(source); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; inferFromTypes(empty, target.type); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else if (source.flags & 1048576 /* IndexedAccess */ && target.flags & 1048576 /* IndexedAccess */) { inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } + else if (source.flags & 2097152 /* Conditional */ && target.flags & 2097152 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(source.trueType, target.trueType); + inferFromTypes(source.falseType, target.falseType); + } else if (target.flags & 393216 /* UnionOrIntersection */) { var targetTypes = target.types; var typeVariableCount = 0; @@ -34452,7 +35294,7 @@ var ts; // types in contra-variant positions (such as callback parameters). if (typeVariableCount === 1) { var savePriority = priority; - priority |= 2 /* NakedTypeVariable */; + priority |= 1 /* NakedTypeVariable */; inferFromTypes(source, typeVariable); priority = savePriority; } @@ -34466,7 +35308,9 @@ var ts; } } else { - source = getApparentType(source); + if (!(priority && 8 /* NoConstraints */ && source.flags & (262144 /* Intersection */ | 7897088 /* Instantiable */))) { + source = getApparentType(source); + } if (source.flags & (65536 /* Object */ | 262144 /* Intersection */)) { var key = source.id + "," + target.id; if (visited && visited.get(key)) { @@ -34495,10 +35339,10 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes) { - priority ^= 1 /* Contravariant */; + if (strictFunctionTypes || priority & 16 /* AlwaysStrict */) { + contravariant = !contravariant; inferFromTypes(source, target); - priority ^= 1 /* Contravariant */; + contravariant = !contravariant; } else { inferFromTypes(source, target); @@ -34531,16 +35375,10 @@ var ts; // such that direct inferences to T get priority over inferences to Partial, for example. var inference = getInferenceInfoForType(constraintType.type); if (inference && !inference.isFixed) { - var key = (source.symbol ? getSymbolId(source.symbol) + "," : "") + getSymbolId(target.symbol); - if (ts.contains(mappedTypeStack, key)) { - return; - } - (mappedTypeStack || (mappedTypeStack = [])).push(key); - var inferredType = inferTypeForHomomorphicMappedType(source, target, mappedTypeStack); - mappedTypeStack.pop(); + var inferredType = inferTypeForHomomorphicMappedType(source, target); if (inferredType) { var savePriority = priority; - priority |= 4 /* MappedType */; + priority |= 2 /* MappedType */; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -34586,8 +35424,10 @@ var ts; } function inferFromSignature(source, target) { forEachMatchingParameterType(source, target, inferFromContravariantTypes); - if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) { - inferFromTypes(source.typePredicate.type, target.typePredicate.type); + var sourceTypePredicate = getTypePredicateOfSignature(source); + var targetTypePredicate = getTypePredicateOfSignature(target); + if (sourceTypePredicate && targetTypePredicate && sourceTypePredicate.kind === targetTypePredicate.kind) { + inferFromTypes(sourceTypePredicate.type, targetTypePredicate.type); } else { inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); @@ -34614,8 +35454,8 @@ var ts; } } function typeIdenticalToSomeType(type, types) { - for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { - var t = types_12[_i]; + for (var _i = 0, types_11 = types; _i < types_11.length; _i++) { + var t = types_11[_i]; if (isTypeIdenticalTo(t, type)) { return true; } @@ -34647,7 +35487,7 @@ var ts; if (candidates.length > 1) { var objectLiterals = ts.filter(candidates, isObjectLiteralType); if (objectLiterals.length) { - var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, /*subtypeReduction*/ true)); + var objectLiteralsType = getWidenedType(getUnionType(objectLiterals, 2 /* Subtype */)); return ts.concatenate(ts.filter(candidates, function (t) { return !isObjectLiteralType(t); }), [objectLiteralsType]); } } @@ -34672,10 +35512,19 @@ var ts; // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if // union types were requested or if all inferences were made from the return type position, infer a // union type. Otherwise, infer a common supertype. - var unwidenedType = inference.priority & 1 /* Contravariant */ ? getCommonSubtype(baseCandidates) : - context.flags & 1 /* InferUnionTypes */ || inference.priority & 8 /* ReturnType */ ? getUnionType(baseCandidates, /*subtypeReduction*/ true) : - getCommonSupertype(baseCandidates); + var unwidenedType = context.flags & 1 /* InferUnionTypes */ || inference.priority & 4 /* ReturnType */ ? + getUnionType(baseCandidates, 2 /* Subtype */) : + getCommonSupertype(baseCandidates); inferredType = getWidenedType(unwidenedType); + // If we have inferred 'never' but have contravariant candidates. To get a more specific type we + // infer from the contravariant candidates instead. + if (inferredType.flags & 16384 /* Never */ && inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); + } + } + else if (inference.contraCandidates) { + // We only have contravariant inferences, infer the best common subtype of those + inferredType = getCommonSubtype(inference.contraCandidates); } else if (context.flags & 2 /* NoDefault */) { // We use silentNeverType as the wildcard that signals no inferences. @@ -34724,7 +35573,8 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; + resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), + /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; } @@ -34732,7 +35582,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 163 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 144 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 164 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 145 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -34748,13 +35598,13 @@ var ts; if (node.kind === 99 /* ThisKeyword */) { return "0"; } - if (node.kind === 180 /* PropertyAccessExpression */) { + if (node.kind === 183 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + ts.idText(node.name); } - if (node.kind === 177 /* BindingElement */) { + if (node.kind === 180 /* BindingElement */) { var container = node.parent.parent; - var key = container.kind === 177 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); + var key = container.kind === 180 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); var text = getBindingElementNameText(node); var result = key && text && (key + "." + text); return result; @@ -34762,12 +35612,12 @@ var ts; return undefined; } function getBindingElementNameText(element) { - if (element.parent.kind === 175 /* ObjectBindingPattern */) { + if (element.parent.kind === 178 /* ObjectBindingPattern */) { var name = element.propertyName || element.name; switch (name.kind) { case 71 /* Identifier */: return ts.idText(name); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -34785,26 +35635,26 @@ var ts; switch (source.kind) { case 71 /* Identifier */: return target.kind === 71 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 227 /* VariableDeclaration */ || target.kind === 177 /* BindingElement */) && + (target.kind === 230 /* VariableDeclaration */ || target.kind === 180 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 99 /* ThisKeyword */: return target.kind === 99 /* ThisKeyword */; case 97 /* SuperKeyword */: return target.kind === 97 /* SuperKeyword */; - case 180 /* PropertyAccessExpression */: - return target.kind === 180 /* PropertyAccessExpression */ && + case 183 /* PropertyAccessExpression */: + return target.kind === 183 /* PropertyAccessExpression */ && source.name.escapedText === target.name.escapedText && isMatchingReference(source.expression, target.expression); - case 177 /* BindingElement */: - if (target.kind !== 180 /* PropertyAccessExpression */) + case 180 /* BindingElement */: + if (target.kind !== 183 /* PropertyAccessExpression */) return false; var t = target; if (t.name.escapedText !== getBindingElementNameText(source)) return false; - if (source.parent.parent.kind === 177 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { + if (source.parent.parent.kind === 180 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { return true; } - if (source.parent.parent.kind === 227 /* VariableDeclaration */) { + if (source.parent.parent.kind === 230 /* VariableDeclaration */) { var maybeId = source.parent.parent.initializer; return maybeId && isMatchingReference(maybeId, t.expression); } @@ -34812,7 +35662,7 @@ var ts; return false; } function containsMatchingReference(source, target) { - while (source.kind === 180 /* PropertyAccessExpression */) { + while (source.kind === 183 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -34825,7 +35675,7 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 180 /* PropertyAccessExpression */ && + return target.kind === 183 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); } @@ -34833,7 +35683,7 @@ var ts; if (expr.kind === 71 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.escapedText); } @@ -34877,7 +35727,7 @@ var ts; } } } - if (callExpression.expression.kind === 180 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 183 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -34919,8 +35769,8 @@ var ts; } function getTypeFactsOfTypes(types) { var result = 0 /* None */; - for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { - var t = types_13[_i]; + for (var _i = 0, types_12 = types; _i < types_12.length; _i++) { + var t = types_12[_i]; result |= getTypeFacts(t); } return result; @@ -34974,10 +35824,10 @@ var ts; if (flags & 1536 /* ESSymbolLike */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 33554432 /* NonPrimitive */) { + if (flags & 134217728 /* NonPrimitive */) { return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; } - if (flags & 1081344 /* TypeVariable */) { + if (flags & 7897088 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 393216 /* UnionOrIntersection */) { @@ -34986,16 +35836,6 @@ var ts; return 8388607 /* All */; } function getTypeWithFacts(type, include) { - if (type.flags & 1048576 /* IndexedAccess */) { - // TODO (weswig): This is a substitute for a lazy negated type to remove the types indicated by the TypeFacts from the (potential) union the IndexedAccess refers to - // - See discussion in https://github.com/Microsoft/TypeScript/pull/19275 for details, and test `strictNullNotNullIndexTypeShouldWork` for current behavior - var baseConstraint = getBaseConstraintOfType(type) || emptyObjectType; - var result = filterType(baseConstraint, function (t) { return (getTypeFacts(t) & include) !== 0; }); - if (result !== baseConstraint) { - return result; - } - return type; - } return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; }); } function getTypeWithDefault(type, defaultExpression) { @@ -35021,18 +35861,18 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 178 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 181 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 268 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 195 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 217 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 220 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { - return getTypeOfDestructuredArrayElement(getAssignedType(node), ts.indexOf(node.elements, element)); + return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); } function getAssignedTypeOfSpreadExpression(node) { return getTypeOfDestructuredSpreadExpression(getAssignedType(node.parent)); @@ -35046,21 +35886,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return stringType; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return undefinedType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -35068,10 +35908,10 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 175 /* ObjectBindingPattern */ ? + var type = pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? - getTypeOfDestructuredArrayElement(parentType, ts.indexOf(pattern.elements, node)) : + getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : getTypeOfDestructuredSpreadExpression(parentType); return getTypeWithDefault(type, node.initializer); } @@ -35086,35 +35926,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 216 /* ForInStatement */) { + if (node.parent.parent.kind === 219 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.parent.kind === 220 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 227 /* VariableDeclaration */ ? + return node.kind === 230 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */ ? + return node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 227 /* VariableDeclaration */ && node.initializer && + return node.kind === 230 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 177 /* BindingElement */ && node.parent.kind === 195 /* BinaryExpression */ && + node.kind !== 180 /* BindingElement */ && node.parent.kind === 198 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (node.operatorToken.kind) { case 58 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -35126,13 +35966,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 186 /* ParenthesizedExpression */ || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? + return parent.kind === 189 /* ParenthesizedExpression */ || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 261 /* CaseClause */) { + if (clause.kind === 264 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -35190,15 +36030,15 @@ var ts; // Apply a mapping function to a type and return the resulting type. If the source type // is a union type, the mapping function is applied to each constituent type and a union // of the resulting types is returned. - function mapType(type, mapper) { + function mapType(type, mapper, noReductions) { if (!(type.flags & 131072 /* Union */)) { return mapper(type); } var types = type.types; var mappedType; var mappedTypes; - for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { - var current = types_14[_i]; + for (var _i = 0, types_13 = types; _i < types_13.length; _i++) { + var current = types_13[_i]; var t = mapper(current); if (t) { if (!mappedType) { @@ -35212,7 +36052,7 @@ var ts; } } } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; + return mappedTypes ? getUnionType(mappedTypes, noReductions ? 0 /* None */ : 1 /* Literal */) : mappedType; } function extractTypesOfKind(type, kind) { return filterType(type, function (t) { return (t.flags & kind) !== 0; }); @@ -35263,7 +36103,7 @@ var ts; return elementType.flags & 16384 /* Never */ ? autoArrayType : createArrayType(elementType.flags & 131072 /* Union */ ? - getUnionType(elementType.types, /*subtypeReduction*/ true) : + getUnionType(elementType.types, 2 /* Subtype */) : elementType); } // We perform subtype reduction upon obtaining the final array type from an evolving array type. @@ -35278,8 +36118,8 @@ var ts; } function isEvolvingArrayTypeList(types) { var hasEvolvingArrayType = false; - for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { - var t = types_15[_i]; + for (var _i = 0, types_14 = types; _i < types_14.length; _i++) { + var t = types_14[_i]; if (!(t.flags & 16384 /* Never */)) { if (!(ts.getObjectFlags(t) & 256 /* EvolvingArray */)) { return false; @@ -35302,11 +36142,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 180 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || - parent.parent.kind === 182 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 181 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 183 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || + parent.parent.kind === 185 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 184 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 195 /* BinaryExpression */ && + parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -35325,10 +36165,7 @@ var ts; var funcType = checkNonNullExpression(node.expression); if (funcType !== silentNeverType) { var apparentType = getApparentType(funcType); - if (apparentType !== unknownType) { - var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - return !!ts.forEach(callSignatures, function (sig) { return sig.typePredicate; }); - } + return apparentType !== unknownType && ts.some(getSignaturesOfType(apparentType, 0 /* Call */), signatureHasTypePredicate); } } return false; @@ -35346,7 +36183,7 @@ var ts; if (flowAnalysisDisabled) { return unknownType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 35620607 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359 /* Narrowable */)) { return declaredType; } var sharedFlowStart = sharedFlowCount; @@ -35357,7 +36194,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent && reference.parent.kind === 204 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { + if (reference.parent && reference.parent.kind === 207 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { return declaredType; } return resultType; @@ -35428,7 +36265,7 @@ var ts; else if (flags & 2 /* Start */) { // Check if we should continue with the control flow of the containing function. var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 180 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { + if (container && container !== flowContainer && reference.kind !== 183 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -35484,7 +36321,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 182 /* CallExpression */ ? + var expr = node.kind === 185 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -35492,7 +36329,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -35578,7 +36415,7 @@ var ts; seenIncomplete = true; } } - return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction), seenIncomplete); + return createFlowType(getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */), seenIncomplete); } function getTypeAtFlowLoopLabel(flow) { // If we have previously computed the control flow type for the reference at @@ -35606,7 +36443,7 @@ var ts; // path that leads to the top. for (var i = flowLoopStart; i < flowLoopCount; i++) { if (flowLoopNodes[i] === flow && flowLoopKeys[i] === key && flowLoopTypes[i].length) { - return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], /*subtypeReduction*/ false), /*incomplete*/ true); + return createFlowType(getUnionOrEvolvingArrayType(flowLoopTypes[i], 1 /* Literal */), /*incomplete*/ true); } } // Add the flow loop junction and reference to the in-process stack and analyze @@ -35626,7 +36463,7 @@ var ts; firstAntecedentType = flowType; } var type = getTypeFromFlowType(flowType); - // If we see a value appear in the cache it is a sign that control flow analysis + // If we see a value appear in the cache it is a sign that control flow analysis // was restarted and completed by checkExpressionCached. We can simply pick up // the resulting type and bail out. var cached_1 = cache.get(key); @@ -35649,7 +36486,7 @@ var ts; } // The result is incomplete if the first antecedent (the non-looping control flow path) // is incomplete. - var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction); + var result = getUnionOrEvolvingArrayType(antecedentTypes, subtypeReduction ? 2 /* Subtype */ : 1 /* Literal */); if (isIncomplete(firstAntecedentType)) { return createFlowType(result, /*incomplete*/ true); } @@ -35657,7 +36494,7 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - return expr.kind === 180 /* PropertyAccessExpression */ && + return expr.kind === 183 /* PropertyAccessExpression */ && computedType.flags & 131072 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, expr.name.escapedText); @@ -35680,6 +36517,23 @@ var ts; } return type; } + function isTypePresencePossible(type, propName, assumeTrue) { + if (getIndexInfoOfType(type, 0 /* String */)) { + return true; + } + var prop = getPropertyOfType(type, propName); + if (prop) { + return prop.flags & 16777216 /* Optional */ ? true : assumeTrue; + } + return !assumeTrue; + } + function narrowByInKeyword(type, literal, assumeTrue) { + if ((type.flags & (131072 /* Union */ | 65536 /* Object */)) || (type.flags & 32768 /* TypeParameter */ && type.isThisType)) { + var propName_1 = ts.escapeLeadingUnderscores(literal.text); + return filterType(type, function (t) { return isTypePresencePossible(t, propName_1, assumeTrue); }); + } + return type; + } function narrowTypeByBinaryExpression(type, expr, assumeTrue) { switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: @@ -35691,10 +36545,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 190 /* TypeOfExpression */ && right_1.kind === 9 /* StringLiteral */) { + if (left_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 190 /* TypeOfExpression */ && left_1.kind === 9 /* StringLiteral */) { + if (right_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -35715,6 +36569,12 @@ var ts; break; case 93 /* InstanceOfKeyword */: return narrowTypeByInstanceof(type, expr, assumeTrue); + case 92 /* InKeyword */: + var target = getReferenceCandidate(expr.right); + if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { + return narrowByInKeyword(type, expr.left, assumeTrue); + } + break; case 26 /* CommaToken */: return narrowType(type, expr.right, assumeTrue); } @@ -35740,7 +36600,7 @@ var ts; assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33620481 /* NotUnionOrUnit */) { + if (type.flags & 134283777 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -35776,7 +36636,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 1081344 /* TypeVariable */) { + if (type.flags & 7897088 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -35799,7 +36659,7 @@ var ts; var hasDefaultClause = clauseStart === clauseEnd || ts.contains(clauseTypes, neverType); var discriminantType = getUnionType(clauseTypes); var caseType = discriminantType.flags & 16384 /* Never */ ? neverType : - replacePrimitivesWithLiterals(filterType(type, function (t) { return isTypeComparableTo(discriminantType, t); }), discriminantType); + replacePrimitivesWithLiterals(filterType(type, function (t) { return areTypesComparable(discriminantType, t); }), discriminantType); if (!hasDefaultClause) { return caseType; } @@ -35879,7 +36739,7 @@ var ts; return type; } var signature = getResolvedSignature(callExpression); - var predicate = signature.typePredicate; + var predicate = getTypePredicateOfSignature(signature); if (!predicate) { return type; } @@ -35900,7 +36760,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 181 /* ElementAccessExpression */ || invokedExpression.kind === 180 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 184 /* ElementAccessExpression */ || invokedExpression.kind === 183 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -35920,15 +36780,15 @@ var ts; case 71 /* Identifier */: case 99 /* ThisKeyword */: case 97 /* SuperKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (expr.operator === 51 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -35964,9 +36824,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 235 /* ModuleBlock */ || - node.kind === 269 /* SourceFile */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 238 /* ModuleBlock */ || + node.kind === 272 /* SourceFile */ || + node.kind === 151 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -35988,7 +36848,7 @@ var ts; if (node.kind === 71 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 147 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148 /* Parameter */) { symbol.isAssigned = true; } } @@ -36003,7 +36863,7 @@ var ts; /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 147 /* Parameter */ && + declaration.kind === 148 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 4096 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096 /* Undefined */); @@ -36011,24 +36871,30 @@ var ts; } function isApparentTypePosition(node) { var parent = node.parent; - return parent.kind === 180 /* PropertyAccessExpression */ || - parent.kind === 182 /* CallExpression */ && parent.expression === node || - parent.kind === 181 /* ElementAccessExpression */ && parent.expression === node; + return parent.kind === 183 /* PropertyAccessExpression */ || + parent.kind === 185 /* CallExpression */ && parent.expression === node || + parent.kind === 184 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 207 /* NonNullExpression */ || + parent.kind === 180 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 1081344 /* TypeVariable */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); + return type.flags & 7372800 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); } - function getDeclaredOrApparentType(symbol, node) { + function getApparentTypeForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, // and the type of the node includes type variables with constraints that are nullable, we fetch the // apparent type of the node *before* performing control flow analysis such that narrowings apply to // the constraint type. - var type = getTypeOfSymbol(symbol); if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { return mapType(getWidenedType(type), getApparentType); } return type; } + function markAliasReferenced(symbol, location) { + if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + markAliasSymbolAsReferenced(symbol); + } + } function checkIdentifier(node) { var symbol = getResolvedSymbol(node); if (symbol === unknownSymbol) { @@ -36043,7 +36909,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -36054,9 +36920,9 @@ var ts; return getTypeOfSymbol(symbol); } // We should only mark aliases as referenced if there isn't a local value declaration - // for the symbol. - if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { - markAliasSymbolAsReferenced(symbol); + // for the symbol. Also, don't mark any property access expression LHS - checkPropertyAccessExpression will handle that + if (!(node.parent && ts.isPropertyAccessExpression(node.parent) && node.parent.expression === node)) { + markAliasReferenced(symbol, node); } var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); var declaration = localOrExportSymbol.valueDeclaration; @@ -36064,7 +36930,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 230 /* ClassDeclaration */ + if (declaration.kind === 233 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -36076,14 +36942,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 200 /* ClassExpression */) { + else if (declaration.kind === 203 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); while (container !== undefined) { if (container.parent === declaration) { - if (container.kind === 150 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 151 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -36097,7 +36963,7 @@ var ts; checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - var type = getDeclaredOrApparentType(localOrExportSymbol, node); + var type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { if (!(localOrExportSymbol.flags & 3 /* Variable */)) { @@ -36129,28 +36995,29 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 147 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 148 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; + var isSpreadDestructuringAsignmentTarget = node.parent && node.parent.parent && ts.isSpreadAssignment(node.parent) && isDestructuringAssignmentTarget(node.parent.parent); // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 187 /* FunctionExpression */ || - flowContainer.kind === 188 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 190 /* FunctionExpression */ || + flowContainer.kind === 191 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } // We only look for uninitialized variables in strict null checking mode, and only when we can analyze // the entire control flow graph from the variable's declaration (i.e. when the flow container and // declaration container are the same). - var assumeInitialized = isParameter || isAlias || isOuterVariable || + var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || - isInTypeQuery(node) || node.parent.kind === 247 /* ExportSpecifier */) || - node.parent.kind === 204 /* NonNullExpression */ || - declaration.kind === 227 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 250 /* ExportSpecifier */) || + node.parent.kind === 207 /* NonNullExpression */ || + declaration.kind === 230 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 2097152 /* Ambient */; - var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); @@ -36179,7 +37046,7 @@ var ts; function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 264 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 267 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -36204,8 +37071,8 @@ var ts; } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. - if (container.kind === 215 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 228 /* VariableDeclarationList */).parent === container && + if (container.kind === 218 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 231 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -36219,7 +37086,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 186 /* ParenthesizedExpression */) { + while (current.parent.kind === 189 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -36227,7 +37094,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 193 /* PrefixUnaryExpression */ || current.parent.kind === 194 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 196 /* PrefixUnaryExpression */ || current.parent.kind === 197 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; } @@ -36240,7 +37107,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 150 /* PropertyDeclaration */ || container.kind === 153 /* Constructor */) { + if (container.kind === 151 /* PropertyDeclaration */ || container.kind === 154 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -36308,51 +37175,60 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 153 /* Constructor */) { + if (container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES2015 */); } switch (container.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 153 /* Constructor */: + case 154 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } if (needToCaptureLexicalThis) { captureLexicalThis(node, container); } + var type = tryGetThisTypeAt(node, container); + if (!type && noImplicitThis) { + // With noImplicitThis, functions may not reference 'this' if it has type 'any' + error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); + } + return type || anyType; + } + function tryGetThisTypeAt(node, container) { + if (container === void 0) { container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); } if (ts.isFunctionLike(container) && (!isInParameterInitializerBeforeContainingFunction(node) || ts.getThisParameter(container))) { // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (container.kind === 187 /* FunctionExpression */ && - container.parent.kind === 195 /* BinaryExpression */ && + if (container.kind === 190 /* FunctionExpression */ && + container.parent.kind === 198 /* BinaryExpression */ && ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.prototype.y = f @@ -36361,12 +37237,12 @@ var ts; .expression; // x var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { - return getInferredClassType(classSymbol); + return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { - return thisType; + return getFlowTypeOfReference(node, thisType); } } if (ts.isClassLike(container.parent)) { @@ -36377,18 +37253,13 @@ var ts; if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); if (type && type !== unknownType) { - return type; + return getFlowTypeOfReference(node, type); } } - if (noImplicitThis) { - // With noImplicitThis, functions may not reference 'this' if it has type 'any' - error(node, ts.Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation); - } - return anyType; } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 277 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 280 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -36398,15 +37269,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 147 /* Parameter */; }); + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 182 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 185 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 188 /* ArrowFunction */) { + while (container && container.kind === 191 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -36419,14 +37290,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 145 /* ComputedPropertyName */; }); - if (current && current.kind === 145 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146 /* ComputedPropertyName */; }); + if (current && current.kind === 146 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -36434,7 +37305,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 153 /* Constructor */) { + if (!isCallExpression && container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -36500,7 +37371,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 152 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 153 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -36514,7 +37385,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (container.parent.kind === 182 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -36535,7 +37406,7 @@ var ts; if (!baseClassType) { return unknownType; } - if (container.kind === 153 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 154 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -36550,7 +37421,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 153 /* Constructor */; + return container.kind === 154 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -36558,21 +37429,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */; } else { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */ || - container.kind === 150 /* PropertyDeclaration */ || - container.kind === 149 /* PropertySignature */ || - container.kind === 153 /* Constructor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */ || + container.kind === 151 /* PropertyDeclaration */ || + container.kind === 150 /* PropertySignature */ || + container.kind === 154 /* Constructor */; } } } @@ -36580,10 +37451,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 152 /* MethodDeclaration */ || - func.kind === 154 /* GetAccessor */ || - func.kind === 155 /* SetAccessor */) && func.parent.kind === 179 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 187 /* FunctionExpression */ && func.parent.kind === 265 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 153 /* MethodDeclaration */ || + func.kind === 155 /* GetAccessor */ || + func.kind === 156 /* SetAccessor */) && func.parent.kind === 182 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 190 /* FunctionExpression */ && func.parent.kind === 268 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -36595,7 +37466,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 188 /* ArrowFunction */) { + if (func.kind === 191 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -36622,7 +37493,7 @@ var ts; if (thisType) { return instantiateType(thisType, getContextualMapper(containingLiteral)); } - if (literal.parent.kind !== 265 /* PropertyAssignment */) { + if (literal.parent.kind !== 268 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -36636,9 +37507,9 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = func.parent; - if (parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { + if (parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { var target = parent.left; - if (target.kind === 180 /* PropertyAccessExpression */ || target.kind === 181 /* ElementAccessExpression */) { + if (target.kind === 183 /* PropertyAccessExpression */ || target.kind === 184 /* ElementAccessExpression */) { var expression = target.expression; // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }` if (inJs && ts.isIdentifier(expression)) { @@ -36659,7 +37530,7 @@ var ts; if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { var iife = ts.getImmediatelyInvokedFunctionExpression(func); if (iife && iife.arguments) { - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (parameter.dotDotDotToken) { var restTypes = []; for (var i = indexOfParameter; i < iife.arguments.length; i++) { @@ -36680,7 +37551,7 @@ var ts; if (contextualSignature) { var funcHasRestParameters = ts.hasRestParameter(func); var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); + var indexOfParameter = func.parameters.indexOf(parameter); if (ts.getThisParameter(func) !== undefined && !contextualSignature.thisParameter) { ts.Debug.assert(indexOfParameter !== 0); // Otherwise we should not have called `getContextuallyTypedParameterType`. indexOfParameter -= 1; @@ -36708,12 +37579,12 @@ var ts; // the contextual type of an initializer expression is the type annotation of the containing declaration, if present. function getContextualTypeForInitializerExpression(node) { var declaration = node.parent; - if (node === declaration.initializer || node.kind === 58 /* EqualsToken */) { + if (ts.hasInitializer(declaration) && node === declaration.initializer) { var typeNode = ts.getEffectiveTypeAnnotationNode(declaration); if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -36725,7 +37596,7 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 177 /* BindingElement */) { + if (parentDeclaration.kind !== 180 /* BindingElement */) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !ts.isBindingPattern(name)) { var text = ts.getTextOfPropertyName(name); @@ -36781,7 +37652,7 @@ var ts; function getContextualReturnType(functionDecl) { // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed - if (functionDecl.kind === 153 /* Constructor */ || + if (functionDecl.kind === 154 /* Constructor */ || ts.getEffectiveReturnTypeNode(functionDecl) || isGetAccessorWithAnnotatedSetAccessor(functionDecl)) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); @@ -36797,17 +37668,17 @@ var ts; // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); - var argIndex = ts.indexOf(args, arg); - if (argIndex >= 0) { - // If we're already in the process of resolving the given signature, don't resolve again as - // that could cause infinite recursion. Instead, return anySignature. - var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + // If we're already in the process of resolving the given signature, don't resolve again as + // that could cause infinite recursion. Instead, return anySignature. + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 184 /* TaggedTemplateExpression */) { + if (template.parent.kind === 187 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -36826,12 +37697,6 @@ var ts; case 53 /* AmpersandAmpersandToken */: case 26 /* CommaToken */: return node === right ? getContextualType(binaryExpression) : undefined; - case 34 /* EqualsEqualsEqualsToken */: - case 32 /* EqualsEqualsToken */: - case 35 /* ExclamationEqualsEqualsToken */: - case 33 /* ExclamationEqualsToken */: - // For completions after `x === ` - return node === operatorToken ? getTypeOfExpression(binaryExpression.left) : undefined; default: return undefined; } @@ -36860,10 +37725,10 @@ var ts; return mapType(type, function (t) { var prop = t.flags & 458752 /* StructuredType */ ? getPropertyOfType(t, name) : undefined; return prop ? getTypeOfSymbol(prop) : undefined; - }); + }, /*noReductions*/ true); } function getIndexTypeOfContextualType(type, kind) { - return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }); + return mapType(type, function (t) { return getIndexTypeOfStructuredType(t, kind); }, /*noReductions*/ true); } // Return true if the given contextual type is a tuple-like type function contextualTypeIsTupleLikeType(type) { @@ -36913,50 +37778,33 @@ var ts; var conditional = node.parent; return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; } + function getContextualTypeForChildJsxExpression(node) { + var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); + // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; + } function getContextualTypeForJsxExpression(node) { - // JSX expression can appear in two position : JSX Element's children or JSX attribute - var jsxAttributes = ts.isJsxAttributeLike(node.parent) ? - node.parent.parent : - ts.isJsxElement(node.parent) ? - node.parent.openingElement.attributes : - undefined; // node.parent is JsxFragment with no attributes - if (!jsxAttributes) { - return undefined; // don't check children of a fragment - } - // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type - // which is a type of the parameter of the signature we are trying out. - // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName - var attributesType = getContextualType(jsxAttributes); - if (!attributesType || isTypeAny(attributesType)) { - return undefined; - } - if (ts.isJsxAttribute(node.parent)) { - // JSX expression is in JSX attribute - return getTypeOfPropertyOfContextualType(attributesType, node.parent.name.escapedText); - } - else if (node.parent.kind === 250 /* JsxElement */) { - // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); - return jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : anyType; - } - else { - // JSX expression is in JSX spread attribute - return attributesType; - } + var exprParent = node.parent; + return ts.isJsxAttributeLike(exprParent) + ? getContextualType(node) + : ts.isJsxElement(exprParent) + ? getContextualTypeForChildJsxExpression(exprParent) + : undefined; } function getContextualTypeForJsxAttribute(attribute) { // When we trying to resolve JsxOpeningLikeElement as a stateless function element, we will already give its attributes a contextual type // which is a type of the parameter of the signature we are trying out. // If there is no contextual type (e.g. we are trying to resolve stateful component), get attributes type from resolving element's tagName - var attributesType = getContextualType(attribute.parent); if (ts.isJsxAttribute(attribute)) { + var attributesType = getApparentTypeOfContextualType(attribute.parent); if (!attributesType || isTypeAny(attributesType)) { return undefined; } return getTypeOfPropertyOfContextualType(attributesType, attribute.name.escapedText); } else { - return attributesType; + return getContextualType(attribute.parent); } } // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily @@ -36973,7 +37821,7 @@ var ts; var prop = _a[_i]; if (!prop.symbol) continue; - if (prop.kind !== 265 /* PropertyAssignment */) + if (prop.kind !== 268 /* PropertyAssignment */) continue; if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) { var discriminatingType = getTypeOfNode(prop.initializer); @@ -37021,63 +37869,53 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 180 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 188 /* ArrowFunction */: - case 220 /* ReturnStatement */: + case 191 /* ArrowFunction */: + case 223 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 183 /* NewExpression */: - if (node.kind === 94 /* NewKeyword */) { - return getContextualType(parent); - } - // falls through - case 182 /* CallExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent); - case 178 /* ArrayLiteralExpression */: { + case 181 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 206 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 197 /* TemplateExpression */); + case 209 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 200 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent); } - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - return getAttributesTypeFromJsxOpeningLikeElement(parent); - case 261 /* CaseClause */: { - if (node.kind === 73 /* CaseKeyword */) { - var switchStatement = parent.parent.parent; - return getTypeOfExpression(switchStatement.expression); - } - } + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return getContextualJsxElementAttributesType(parent); } return undefined; } @@ -37085,10 +37923,128 @@ var ts; node = ts.findAncestor(node, function (n) { return !!n.contextualMapper; }); return node ? node.contextualMapper : identityMapper; } + function getContextualJsxElementAttributesType(node) { + if (isJsxIntrinsicIdentifier(node.tagName)) { + return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); + } + var valueType = checkExpression(node.tagName); + if (isTypeAny(valueType)) { + // Short-circuit if the class tag is using an element type 'any' + return anyType; + } + var isJs = ts.isInJavaScriptFile(node); + return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + } + function getJsxSignaturesParameterTypes(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ false); + } + function getJsxSignaturesParameterTypesJs(valueType) { + return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ true); + } + function getJsxSignaturesParameterTypesInternal(valueType, isJs) { + // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type + if (valueType.flags & 2 /* String */) { + return anyType; + } + else if (valueType.flags & 32 /* StringLiteral */) { + // If the elemType is a stringLiteral type, we can then provide a check to make sure that the string literal type is one of the Jsx intrinsic element type + // For example: + // var CustomTag: "h1" = "h1"; + // Hello World + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + if (intrinsicElementsType !== unknownType) { + var stringLiteralTypeName = valueType.value; + var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); + if (intrinsicProp) { + return getTypeOfSymbol(intrinsicProp); + } + var indexSignatureType = getIndexTypeOfType(intrinsicElementsType, 0 /* String */); + if (indexSignatureType) { + return indexSignatureType; + } + } + return anyType; + } + // Resolve the signatures, preferring constructor + var signatures = getSignaturesOfType(valueType, 1 /* Construct */); + var ctor = true; + if (signatures.length === 0) { + // No construct signatures, try call signatures + signatures = getSignaturesOfType(valueType, 0 /* Call */); + ctor = false; + if (signatures.length === 0) { + // We found no signatures at all, which is an error + return unknownType; + } + } + return getUnionType(ts.map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), 0 /* None */); + } + function getJsxPropsTypeFromCallSignature(sig) { + var propsType = getTypeOfFirstParameterOfSignature(sig); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + propsType = intersectTypes(intrinsicAttribs, propsType); + } + return propsType; + } + function getJsxPropsTypeFromClassType(hostClassType, isJs) { + if (isTypeAny(hostClassType)) { + return hostClassType; + } + var propsName = getJsxElementPropertiesName(); + if (propsName === undefined) { + // There is no type ElementAttributesProperty, return 'any' + return anyType; + } + else if (propsName === "") { + // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead + return hostClassType; + } + else { + var attributesType = getTypeOfPropertyOfType(hostClassType, propsName); + if (!attributesType) { + // There is no property named 'props' on this instance type + return emptyObjectType; + } + else if (isTypeAny(attributesType)) { + // Props is of type 'any' or unknown + return attributesType; + } + else { + // Normal case -- add in IntrinsicClassElements and IntrinsicElements + var apparentAttributesType = attributesType; + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + if (intrinsicClassAttribs !== unknownType) { + var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); + apparentAttributesType = intersectTypes(typeParams + ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs)) + : intrinsicClassAttribs, apparentAttributesType); + } + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + if (intrinsicAttribs !== unknownType) { + apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); + } + return apparentAttributesType; + } + } + } + function getJsxPropsTypeFromConstructSignatureJs(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ true); + } + function getJsxPropsTypeFromConstructSignature(sig) { + return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ false); + } + function getJsxPropsTypeFromConstructSignatureInternal(sig, isJs) { + var hostClassType = getReturnTypeOfSignature(sig); + if (hostClassType) { + return getJsxPropsTypeFromClassType(hostClassType, isJs); + } + return getJsxPropsTypeFromCallSignature(sig); + } // If the given type is an object or union type with a single signature, and if that signature has at // least as many parameters as the given function, return the signature. Otherwise return undefined. function getContextualCallSignature(type, node) { - var signatures = getSignaturesOfStructuredType(type, 0 /* Call */); + var signatures = getSignaturesOfType(type, 0 /* Call */); if (signatures.length === 1) { var signature = signatures[0]; if (!isAritySmaller(signature, node)) { @@ -37112,7 +38068,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 187 /* FunctionExpression */ || node.kind === 188 /* ArrowFunction */; + return node.kind === 190 /* FunctionExpression */ || node.kind === 191 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -37131,7 +38087,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -37141,8 +38097,8 @@ var ts; } var signatureList; var types = type.types; - for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { - var current = types_16[_i]; + for (var _i = 0, types_15 = types; _i < types_15.length; _i++) { + var current = types_15[_i]; var signature = getContextualCallSignature(current, node); if (signature) { if (!signatureList) { @@ -37163,8 +38119,6 @@ var ts; var result; if (signatureList) { result = cloneSignature(signatureList[0]); - // Clear resolved return type we possibly got from cloneSignature - result.resolvedReturnType = undefined; result.unionSignatures = signatureList; } return result; @@ -37177,8 +38131,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); } function hasDefaultValue(node) { - return (node.kind === 177 /* BindingElement */ && !!node.initializer) || - (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); + return (node.kind === 180 /* BindingElement */ && !!node.initializer) || + (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); } function checkArrayLiteral(node, checkMode) { var elements = node.elements; @@ -37188,7 +38142,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); for (var index = 0; index < elements.length; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 199 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 202 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -37213,7 +38167,7 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 199 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 202 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -37227,7 +38181,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 176 /* ArrayBindingPattern */ || pattern.kind === 178 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 179 /* ArrayBindingPattern */ || pattern.kind === 181 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -37235,10 +38189,10 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 201 /* OmittedExpression */) { + if (patternElement.kind !== 204 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } - elementTypes.push(unknownType); + elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); } } } @@ -37248,12 +38202,12 @@ var ts; } } return createArrayType(elementTypes.length ? - getUnionType(elementTypes, /*subtypeReduction*/ true) : + getUnionType(elementTypes, 2 /* Subtype */) : strictNullChecks ? implicitNeverType : undefinedWideningType); } function isNumericName(name) { switch (name.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return isNumericComputedName(name); case 71 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -37320,7 +38274,7 @@ var ts; propTypes.push(getTypeOfSymbol(properties[i])); } } - var unionType = propTypes.length ? getUnionType(propTypes, /*subtypeReduction*/ true) : undefinedType; + var unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType; return createIndexInfo(unionType, /*isReadonly*/ false); } function checkObjectLiteral(node, checkMode) { @@ -37330,10 +38284,10 @@ var ts; var propertiesTable = ts.createSymbolTable(); var propertiesArray = []; var spread = emptyObjectType; - var propagatedFlags = 0; + var propagatedFlags = 8388608 /* FreshLiteral */; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 175 /* ObjectBindingPattern */ || contextualType.pattern.kind === 179 /* ObjectLiteralExpression */); + (contextualType.pattern.kind === 178 /* ObjectBindingPattern */ || contextualType.pattern.kind === 182 /* ObjectLiteralExpression */); var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); var typeFlags = 0; var patternWithComputedProperties = false; @@ -37345,16 +38299,16 @@ var ts; var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); var literalName = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */ || - memberDecl.kind === 266 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 268 /* PropertyAssignment */ || + memberDecl.kind === 269 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var jsdocType = void 0; if (isInJSFile) { jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl); } var type = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */) { - if (memberDecl.name.kind === 145 /* ComputedPropertyName */) { + if (memberDecl.kind === 268 /* PropertyAssignment */) { + if (memberDecl.name.kind === 146 /* ComputedPropertyName */) { var t = checkComputedPropertyName(memberDecl.name); if (t.flags & 224 /* Literal */) { literalName = ts.escapeLeadingUnderscores("" + t.value); @@ -37362,11 +38316,11 @@ var ts; } type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 152 /* MethodDeclaration */) { + else if (memberDecl.kind === 153 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 266 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 269 /* ShorthandPropertyAssignment */); type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -37381,8 +38335,8 @@ var ts; if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 265 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 266 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 268 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 269 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -37410,12 +38364,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 267 /* SpreadAssignment */) { + else if (memberDecl.kind === 270 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); propertiesArray = []; propertiesTable = ts.createSymbolTable(); hasComputedStringProperty = false; @@ -37427,7 +38381,7 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, node.symbol, propagatedFlags); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags, /*objectFlags*/ 0); offset = i + 1; continue; } @@ -37437,7 +38391,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 154 /* GetAccessor */ || memberDecl.kind === 155 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 155 /* GetAccessor */ || memberDecl.kind === 156 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (!literalName && hasNonBindableDynamicName(memberDecl)) { @@ -37469,7 +38423,7 @@ var ts; } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); } return spread; } @@ -37478,8 +38432,8 @@ var ts; var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 2097152 /* FreshLiteral */; - result.flags |= 8388608 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 29360128 /* PropagatingFlags */); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608 /* FreshLiteral */; + result.flags |= 33554432 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 117440512 /* PropagatingFlags */); result.objectFlags |= 128 /* ObjectLiteral */; if (patternWithComputedProperties) { result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; @@ -37488,24 +38442,24 @@ var ts; result.pattern = node; } if (!(result.flags & 12288 /* Nullable */)) { - propagatedFlags |= (result.flags & 29360128 /* PropagatingFlags */); + propagatedFlags |= (result.flags & 117440512 /* PropagatingFlags */); } return result; } } function isValidSpreadType(type) { - return !!(type.flags & (1 /* Any */ | 33554432 /* NonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 134217728 /* NonPrimitive */) || getFalsyFlags(type) & 14560 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 65536 /* Object */ && !isGenericMappedType(type) || type.flags & 393216 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } - function checkJsxSelfClosingElement(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node); + function checkJsxSelfClosingElement(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); return getJsxGlobalElementType() || anyType; } - function checkJsxElement(node) { + function checkJsxElement(node, checkMode) { // Check attributes - checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement); + checkJsxOpeningLikeElementOrOpeningFragment(node.openingElement, checkMode); // Perform resolution on the closing tag so that rename/go to definition/etc work if (isJsxIntrinsicIdentifier(node.closingElement.tagName)) { getIntrinsicTagSymbol(node.closingElement); @@ -37515,8 +38469,8 @@ var ts; } return getJsxGlobalElementType() || anyType; } - function checkJsxFragment(node) { - checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment); + function checkJsxFragment(node, checkMode) { + checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); if (compilerOptions.jsx === 2 /* React */ && compilerOptions.jsxFactory) { error(node, ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); } @@ -37535,7 +38489,7 @@ var ts; function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment switch (tagName.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: return false; case 71 /* Identifier */: @@ -37544,6 +38498,11 @@ var ts; ts.Debug.fail(); } } + function checkJsxAttribute(node, checkMode) { + return node.initializer + ? checkExpressionForMutableLocation(node.initializer, checkMode) + : trueType; // is sugar for + } /** * Get attributes type of the JSX opening-like element. The result is from resolving "attributes" property of the opening-like element. * @@ -37553,22 +38512,19 @@ var ts; * @remarks Because this function calls getSpreadType, it needs to use the same checks as checkObjectLiteral, * which also calls getSpreadType. */ - function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, filter, checkMode) { + function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) { var attributes = openingLikeElement.attributes; var attributesTable = ts.createSymbolTable(); var spread = emptyObjectType; - var attributesArray = []; var hasSpreadAnyType = false; var typeToIntersect; var explicitlySpecifyChildrenAttribute = false; - var jsxChildrenPropertyName = getJsxElementChildrenPropertyname(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { var attributeDecl = _a[_i]; var member = attributeDecl.symbol; if (ts.isJsxAttribute(attributeDecl)) { - var exprType = attributeDecl.initializer ? - checkExpression(attributeDecl.initializer, checkMode) : - trueType; // is sugar for + var exprType = checkJsxAttribute(attributeDecl, checkMode); var attributeSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */ | member.flags, member.escapedName); attributeSymbol.declarations = member.declarations; attributeSymbol.parent = member.parent; @@ -37578,24 +38534,22 @@ var ts; attributeSymbol.type = exprType; attributeSymbol.target = member; attributesTable.set(attributeSymbol.escapedName, attributeSymbol); - attributesArray.push(attributeSymbol); if (attributeDecl.name.escapedText === jsxChildrenPropertyName) { explicitlySpecifyChildrenAttribute = true; } } else { - ts.Debug.assert(attributeDecl.kind === 259 /* JsxSpreadAttribute */); - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); - attributesArray = []; + ts.Debug.assert(attributeDecl.kind === 262 /* JsxSpreadAttribute */); + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); attributesTable = ts.createSymbolTable(); } - var exprType = checkExpression(attributeDecl.expression); + var exprType = checkExpressionCached(attributeDecl.expression, checkMode); if (isTypeAny(exprType)) { hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*propagatedFlags*/ 0); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -37603,22 +38557,12 @@ var ts; } } if (!hasSpreadAnyType) { - if (spread !== emptyObjectType) { - if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); - } - attributesArray = getPropertiesOfType(spread); - } - attributesTable = ts.createSymbolTable(); - for (var _b = 0, attributesArray_1 = attributesArray; _b < attributesArray_1.length; _b++) { - var attr = attributesArray_1[_b]; - if (!filter || filter(attr)) { - attributesTable.set(attr.escapedName, attr); - } + if (attributesTable.size > 0) { + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 250 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 253 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -37629,29 +38573,29 @@ var ts; if (explicitlySpecifyChildrenAttribute) { error(attributes, ts.Diagnostics._0_are_specified_twice_The_attribute_named_0_will_be_overwritten, ts.unescapeLeadingUnderscores(jsxChildrenPropertyName)); } - // If there are children in the body of JSX element, create dummy attribute "children" with anyType so that it will pass the attribute checking process + // If there are children in the body of JSX element, create dummy attribute "children" with the union of children types so that it will pass the attribute checking process var childrenPropSymbol = createSymbol(4 /* Property */ | 33554432 /* Transient */, jsxChildrenPropertyName); childrenPropSymbol.type = childrenTypes.length === 1 ? childrenTypes[0] : - createArrayType(getUnionType(childrenTypes, /*subtypeReduction*/ false)); - attributesTable.set(jsxChildrenPropertyName, childrenPropSymbol); + createArrayType(getUnionType(childrenTypes)); + var childPropMap = ts.createSymbolTable(); + childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); + spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } if (hasSpreadAnyType) { return anyType; } - var attributeType = createJsxAttributesType(attributes.symbol, attributesTable); - return typeToIntersect && attributesTable.size ? getIntersectionType([typeToIntersect, attributeType]) : - typeToIntersect ? typeToIntersect : attributeType; + return typeToIntersect && spread !== emptyObjectType ? getIntersectionType([typeToIntersect, spread]) : (typeToIntersect || spread); /** * Create anonymous type from given attributes symbol table. * @param symbol a symbol of JsxAttributes containing attributes corresponding to attributesTable * @param attributesTable a symbol table of attributes property */ - function createJsxAttributesType(symbol, attributesTable) { - var result = createAnonymousType(symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); - result.flags |= 67108864 /* JsxAttributes */ | 8388608 /* ContainsObjectLiteral */; - result.objectFlags |= 128 /* ObjectLiteral */; + function createJsxAttributesType() { + var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); + result.flags |= 33554432 /* ContainsObjectLiteral */; + result.objectFlags |= 128 /* ObjectLiteral */ | 4096 /* JsxAttributes */; return result; } } @@ -37667,7 +38611,7 @@ var ts; } } else { - childrenTypes.push(checkExpression(child, checkMode)); + childrenTypes.push(checkExpressionForMutableLocation(child, checkMode)); } } return childrenTypes; @@ -37678,7 +38622,7 @@ var ts; * @param node a JSXAttributes to be resolved of its type */ function checkJsxAttributes(node, checkMode) { - return createJsxAttributesTypeFromAttributesProperty(node.parent, /*filter*/ undefined, checkMode); + return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } function getJsxType(name) { var jsxType = jsxTypes.get(name); @@ -37747,19 +38691,21 @@ var ts; return unknownType; } } + // Instantiate in context of source type var instantiatedSignatures = []; for (var _i = 0, signatures_3 = signatures; _i < signatures_3.length; _i++) { var signature = signatures_3[_i]; if (signature.typeParameters) { var isJavascript = ts.isInJavaScriptFile(node); - var typeArguments = fillMissingTypeArguments(/*typeArguments*/ undefined, signature.typeParameters, /*minTypeArgumentCount*/ 0, isJavascript); + var inferenceContext = createInferenceContext(signature, /*flags*/ isJavascript ? 4 /* AnyDefault */ : 0 /* None */); + var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } else { instantiatedSignatures.push(signature); } } - return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. @@ -37804,7 +38750,7 @@ var ts; } return _jsxElementPropertiesName; } - function getJsxElementChildrenPropertyname() { + function getJsxElementChildrenPropertyName() { if (!_hasComputedJsxElementChildrenPropertyName) { _hasComputedJsxElementChildrenPropertyName = true; _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); @@ -37927,6 +38873,7 @@ var ts; * * @param openingLikeElement a non-intrinsic JSXOPeningLikeElement * @param shouldIncludeAllStatelessAttributesType a boolean indicating whether to include all attributes types from all stateless function signature + * @param sourceAttributesType Is the attributes type the user passed, and is used to create inferences in the target type if present * @param elementType an instance type of the given opening-like element. If undefined, the function will check type openinglikeElement's tagname. * @param elementClassType a JSX-ElementClass type. This is a result of looking up ElementClass interface in the JSX global (imported from react.d.ts) * @return attributes type if able to resolve the type of node @@ -37934,12 +38881,11 @@ var ts; * emptyObjectType if there is no "prop" in the element instance type */ function resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, elementType, elementClassType) { - if (elementType === void 0) { elementType = checkExpression(openingLikeElement.tagName); } if (elementType.flags & 131072 /* Union */) { var types = elementType.types; return getUnionType(types.map(function (type) { return resolveCustomJsxElementAttributesType(openingLikeElement, shouldIncludeAllStatelessAttributesType, type, elementClassType); - }), /*subtypeReduction*/ true); + }), 2 /* Subtype */); } // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type if (elementType.flags & 2 /* String */) { @@ -37980,50 +38926,7 @@ var ts; if (elementClassType) { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - if (isTypeAny(elemInstanceType)) { - return elemInstanceType; - } - var propsName = getJsxElementPropertiesName(); - if (propsName === undefined) { - // There is no type ElementAttributesProperty, return 'any' - return anyType; - } - else if (propsName === "") { - // If there is no e.g. 'props' member in ElementAttributesProperty, use the element class type instead - return elemInstanceType; - } - else { - var attributesType = getTypeOfPropertyOfType(elemInstanceType, propsName); - if (!attributesType) { - // There is no property named 'props' on this instance type - return emptyObjectType; - } - else if (isTypeAny(attributesType) || (attributesType === unknownType)) { - // Props is of type 'any' or unknown - return attributesType; - } - else { - // Normal case -- add in IntrinsicClassElements and IntrinsicElements - var apparentAttributesType = attributesType; - var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); - if (intrinsicClassAttribs !== unknownType) { - var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); - if (typeParams) { - if (typeParams.length === 1) { - apparentAttributesType = intersectTypes(createTypeReference(intrinsicClassAttribs, [elemInstanceType]), apparentAttributesType); - } - } - else { - apparentAttributesType = intersectTypes(attributesType, intrinsicClassAttribs); - } - } - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); - if (intrinsicAttribs !== unknownType) { - apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); - } - return apparentAttributesType; - } - } + return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement)); } /** * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. @@ -38054,13 +38957,7 @@ var ts; * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component */ function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { - var links = getNodeLinks(node); - var linkLocation = shouldIncludeAllStatelessAttributesType ? "resolvedJsxElementAllAttributesType" : "resolvedJsxElementAttributesType"; - if (!links[linkLocation]) { - var elemClassType = getJsxGlobalElementClassType(); - return links[linkLocation] = resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, /*elementType*/ undefined, elemClassType); - } - return links[linkLocation]; + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); } /** * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. @@ -38139,7 +39036,7 @@ var ts; } } } - function checkJsxOpeningLikeElementOrOpeningFragment(node) { + function checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode) { var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(node); if (isNodeOpeningLikeElement) { checkGrammarJsxElement(node); @@ -38154,14 +39051,14 @@ var ts; if (reactSym) { // Mark local symbol as referenced here because it might not have been marked // if jsx emit was not react as there wont be error being emitted - reactSym.isReferenced = true; + reactSym.isReferenced = 67108863 /* All */; // If react symbol is alias, mark it as refereced if (reactSym.flags & 2097152 /* Alias */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { markAliasSymbolAsReferenced(reactSym); } } if (isNodeOpeningLikeElement) { - checkJsxAttributesAssignableToTagNameAttributes(node); + checkJsxAttributesAssignableToTagNameAttributes(node, checkMode); } else { checkJsxChildren(node.parent); @@ -38207,37 +39104,40 @@ var ts; * Check assignablity between given attributes property, "source attributes", and the "target attributes" * @param openingLikeElement an opening-like JSX element to check its JSXAttributes */ - function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement) { + function checkJsxAttributesAssignableToTagNameAttributes(openingLikeElement, checkMode) { // The function involves following steps: // 1. Figure out expected attributes type by resolving tagName of the JSX opening-like element, targetAttributesType. // During these steps, we will try to resolve the tagName as intrinsic name, stateless function, stateful component (in the order) // 2. Solved JSX attributes type given by users, sourceAttributesType, which is by resolving "attributes" property of the JSX opening-like element. // 3. Check if the two are assignable to each other - // targetAttributesType is a type of an attributes from resolving tagName of an opening-like JSX element. + // targetAttributesType is a type of an attribute from resolving tagName of an opening-like JSX element. var targetAttributesType = isJsxIntrinsicIdentifier(openingLikeElement.tagName) ? getIntrinsicAttributesTypeFromJsxOpeningLikeElement(openingLikeElement) : getCustomJsxElementAttributesType(openingLikeElement, /*shouldIncludeAllStatelessAttributesType*/ false); // sourceAttributesType is a type of an attributes properties. // i.e
// attr1 and attr2 are treated as JSXAttributes attached in the JsxOpeningLikeElement as "attributes". - var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, function (attribute) { - return isUnhyphenatedJsxName(attribute.escapedName) || !!(getPropertyOfType(targetAttributesType, attribute.escapedName)); - }); + var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode); // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. - if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName())); } else { // Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties var isSourceAttributeTypeAssignableToTarget = checkTypeAssignableTo(sourceAttributesType, targetAttributesType, openingLikeElement.attributes.properties.length > 0 ? openingLikeElement.attributes : openingLikeElement); // After we check for assignability, we will do another pass to check that all explicitly specified attributes have correct name corresponding in targetAttributeType. - // This will allow excess properties in spread type as it is very common pattern to spread outter attributes into React component in its render method. + // This will allow excess properties in spread type as it is very common pattern to spread outer attributes into React component in its render method. if (isSourceAttributeTypeAssignableToTarget && !isTypeAny(sourceAttributesType) && !isTypeAny(targetAttributesType)) { for (var _i = 0, _a = openingLikeElement.attributes.properties; _i < _a.length; _i++) { var attribute = _a[_i]; - if (ts.isJsxAttribute(attribute) && !isKnownProperty(targetAttributesType, attribute.name.escapedText, /*isComparingJsxAttributes*/ true)) { - error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attribute.name), typeToString(targetAttributesType)); + if (!ts.isJsxAttribute(attribute)) { + continue; + } + var attrName = attribute.name; + var isNotIgnoredJsxProperty = (isUnhyphenatedJsxName(ts.idText(attrName)) || !!(getPropertyOfType(targetAttributesType, attrName.escapedText))); + if (isNotIgnoredJsxProperty && !isKnownProperty(targetAttributesType, attrName.escapedText, /*isComparingJsxAttributes*/ true)) { + error(attribute, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.idText(attrName), typeToString(targetAttributesType)); // We break here so that errors won't be cascading break; } @@ -38260,7 +39160,7 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 150 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 151 /* PropertyDeclaration */; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; @@ -38278,7 +39178,7 @@ var ts; */ function checkPropertyAccessibility(node, left, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 180 /* PropertyAccessExpression */ || node.kind === 227 /* VariableDeclaration */ ? + var errorNode = node.kind === 183 /* PropertyAccessExpression */ || node.kind === 230 /* VariableDeclaration */ ? node.name : node.right; if (ts.getCheckFlags(prop) & 256 /* ContainsPrivate */) { @@ -38364,19 +39264,19 @@ var ts; function symbolHasNonMethodDeclaration(symbol) { return forEachProperty(symbol, function (prop) { var propKind = getDeclarationKindFromSymbol(prop); - return propKind !== 152 /* MethodDeclaration */ && propKind !== 151 /* MethodSignature */; + return propKind !== 153 /* MethodDeclaration */ && propKind !== 152 /* MethodSignature */; }); } - function checkNonNullExpression(node) { - return checkNonNullType(checkExpression(node), node); + function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { + return checkNonNullType(checkExpression(node), node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic); } - function checkNonNullType(type, errorNode) { + function checkNonNullType(type, node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { var kind = (strictNullChecks ? getFalsyFlags(type) : type.flags) & 12288 /* Nullable */; if (kind) { - error(errorNode, kind & 4096 /* Undefined */ ? kind & 8192 /* Null */ ? - ts.Diagnostics.Object_is_possibly_null_or_undefined : - ts.Diagnostics.Object_is_possibly_undefined : - ts.Diagnostics.Object_is_possibly_null); + error(node, kind & 4096 /* Undefined */ ? kind & 8192 /* Null */ ? + (nullOrUndefinedDiagnostic || ts.Diagnostics.Object_is_possibly_null_or_undefined) : + (undefinedDiagnostic || ts.Diagnostics.Object_is_possibly_undefined) : + (nullDiagnostic || ts.Diagnostics.Object_is_possibly_null)); var t = getNonNullableType(type); return t.flags & (12288 /* Nullable */ | 16384 /* Never */) ? unknownType : t; } @@ -38390,15 +39290,20 @@ var ts; } function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { var propType; - var leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - var leftWasReferenced = leftSymbol && getSymbolLinks(leftSymbol).referenced; var leftType = checkNonNullExpression(left); + var parentSymbol = getNodeLinks(left).resolvedSymbol; var apparentType = getApparentType(getWidenedType(leftType)); if (isTypeAny(apparentType) || apparentType === silentNeverType) { + if (ts.isIdentifier(left) && parentSymbol) { + markAliasReferenced(parentSymbol, node); + } return apparentType; } var assignmentKind = ts.getAssignmentTargetKind(node); var prop = getPropertyOfType(apparentType, right.escapedText); + if (ts.isIdentifier(left) && parentSymbol && !(prop && isConstEnumOrConstEnumOnlyModule(prop))) { + markAliasReferenced(parentSymbol, node); + } if (!prop) { var indexInfo = getIndexInfoOfType(apparentType, 0 /* String */); if (!(indexInfo && indexInfo.type)) { @@ -38415,12 +39320,6 @@ var ts; else { checkPropertyNotUsedBeforeDeclaration(prop, node, right); markPropertyAsReferenced(prop, node, left.kind === 99 /* ThisKeyword */); - // Reset the referenced-ness of the LHS expression if this access refers to a const enum or const enum only module - leftSymbol = getNodeLinks(left) && getNodeLinks(left).resolvedSymbol; - if (leftSymbol && !leftWasReferenced && getSymbolLinks(leftSymbol).referenced && - !(isNonLocalAlias(leftSymbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(prop))) { - getSymbolLinks(leftSymbol).referenced = undefined; - } getNodeLinks(node).resolvedSymbol = prop; checkPropertyAccessibility(node, left, apparentType, prop); if (assignmentKind) { @@ -38429,12 +39328,12 @@ var ts; return unknownType; } } - propType = getDeclaredOrApparentType(prop, node); + propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); } // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 180 /* PropertyAccessExpression */ || + if (node.kind !== 183 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 131072 /* Union */)) { return propType; @@ -38448,7 +39347,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 153 /* Constructor */ && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 154 /* Constructor */ && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -38471,8 +39370,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right)); } - else if (valueDeclaration.kind === 230 /* ClassDeclaration */ && - node.parent.kind !== 160 /* TypeReference */ && + else if (valueDeclaration.kind === 233 /* ClassDeclaration */ && + node.parent.kind !== 161 /* TypeReference */ && !(valueDeclaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right)); @@ -38481,9 +39380,9 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return true; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // We might be in `a = { b: this.b }`, so keep looking. See `tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts`. return false; default: @@ -38496,6 +39395,9 @@ var ts; * In that case we won't consider it used before its declaration, because it gets its value from the superclass' declaration. */ function isPropertyDeclaredInAncestorClass(prop) { + if (!(prop.parent.flags & 32 /* Class */)) { + return false; + } var classType = getTypeOfSymbol(prop.parent); while (true) { classType = getSuperClass(classType); @@ -38542,7 +39444,7 @@ var ts; } function getSuggestionForNonexistentSymbol(location, outerName, meaning) { ts.Debug.assert(outerName !== undefined, "outername should always be defined"); - var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, function (symbols, name, meaning) { + var result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, function (symbols, name, meaning) { ts.Debug.assertEqual(outerName, name, "name should equal outerName"); var symbol = getSymbol(symbols, name, meaning); // Sometimes the symbol is found when location is a return type of a function: `typeof x` and `x` is declared in the body of the function @@ -38647,57 +39549,53 @@ var ts; return res > max ? undefined : res; } function markPropertyAsReferenced(prop, nodeForCheckWriteOnly, isThisAccess) { - if (prop && - noUnusedIdentifiers && - (prop.flags & 106500 /* ClassMember */) && - prop.valueDeclaration && ts.hasModifier(prop.valueDeclaration, 8 /* Private */) - && !(nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly))) { - if (isThisAccess) { - // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters). - var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); - if (containingMethod && containingMethod.symbol === prop) { - return; - } - } - if (ts.getCheckFlags(prop) & 1 /* Instantiated */) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; + if (!prop || !noUnusedIdentifiers || !(prop.flags & 106500 /* ClassMember */) || !prop.valueDeclaration || !ts.hasModifier(prop.valueDeclaration, 8 /* Private */)) { + return; + } + if (nodeForCheckWriteOnly && ts.isWriteOnlyAccess(nodeForCheckWriteOnly) && !(prop.flags & 65536 /* SetAccessor */ && !(prop.flags & 32768 /* GetAccessor */))) { + return; + } + if (isThisAccess) { + // Find any FunctionLikeDeclaration because those create a new 'this' binding. But this should only matter for methods (or getters/setters). + var containingMethod = ts.findAncestor(nodeForCheckWriteOnly, ts.isFunctionLikeDeclaration); + if (containingMethod && containingMethod.symbol === prop) { + return; } } + (ts.getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 180 /* PropertyAccessExpression */ - ? node.expression - : node.left; + var left = node.kind === 183 /* PropertyAccessExpression */ ? node.expression : node.left; return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left))); } + function isValidPropertyAccessForCompletions(node, type, property) { + return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) + && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); + } + function isValidMethodAccess(method, type) { + var propType = getTypeOfFuncClassEnumModule(method); + var signatures = getSignaturesOfType(getNonNullableType(propType), 0 /* Call */); + ts.Debug.assert(signatures.length !== 0); + return signatures.some(function (sig) { + var thisType = getThisTypeOfSignature(sig); + return !thisType || isTypeAssignableTo(type, thisType); + }); + } function isValidPropertyAccessWithType(node, left, propertyName, type) { - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(type, propertyName); - if (prop) { - return checkPropertyAccessibility(node, left, type, prop); - } - // In js files properties of unions are allowed in completion - if (ts.isInJavaScriptFile(left) && (type.flags & 131072 /* Union */)) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var elementType = _a[_i]; - if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) { - return true; - } - } - } - return false; + if (type === unknownType || isTypeAny(type)) { + return true; } - return true; + var prop = getPropertyOfType(type, propertyName); + return prop ? checkPropertyAccessibility(node, left, type, prop) + // In js files properties of unions are allowed in completion + : ts.isInJavaScriptFile(node) && (type.flags & 131072 /* Union */) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); }); } /** * Return the symbol of the for-in variable declared or referenced by the given for-in statement. */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer.kind === 231 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -38726,7 +39624,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 216 /* ForInStatement */ && + if (node.kind === 219 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -38744,7 +39642,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 183 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 186 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -38811,10 +39709,10 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 148 /* Decorator */) { + else if (node.kind !== 149 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -38880,7 +39778,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 199 /* SpreadElement */) { + if (arg && arg.kind === 202 /* SpreadElement */) { return i; } } @@ -38896,17 +39794,15 @@ var ts; // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". return true; } - if (node.kind === 184 /* TaggedTemplateExpression */) { - var tagExpression = node; + if (node.kind === 187 /* TaggedTemplateExpression */) { // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 197 /* TemplateExpression */) { + if (node.template.kind === 200 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + var lastSpan = ts.lastOrUndefined(node.template.templateSpans); ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -38914,26 +39810,25 @@ var ts; // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, // then this might actually turn out to be a TemplateHead in the future; // so we consider the call to be incomplete. - var templateLiteral = tagExpression.template; + var templateLiteral = node.template; ts.Debug.assert(templateLiteral.kind === 13 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); } else { - var callExpression = node; - if (!callExpression.arguments) { + if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 183 /* NewExpression */); + ts.Debug.assert(node.kind === 186 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; // If we are missing the close parenthesis, the call is incomplete. - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; + callIsIncomplete = node.arguments.end === node.end; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match @@ -38977,10 +39872,21 @@ var ts; inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); if (!contextualMapper) { - inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8 /* ReturnType */); + inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 4 /* ReturnType */); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJavaScriptFile(contextualSignature.declaration)); } + function inferJsxTypeArguments(signature, node, context) { + // Skip context sensitive pass + var skipContextParamType = getTypeAtPosition(signature, 0); + var checkAttrTypeSkipContextSensitive = checkExpressionWithContextualType(node.attributes, skipContextParamType, identityMapper); + inferTypes(context.inferences, checkAttrTypeSkipContextSensitive, skipContextParamType); + // Standard pass + var paramType = getTypeAtPosition(signature, 0); + var checkAttrType = checkExpressionWithContextualType(node.attributes, paramType, context); + inferTypes(context.inferences, checkAttrType, paramType); + return getInferredTypes(context); + } function inferTypeArguments(node, signature, args, excludeArgument, context) { // Clear out all the inference results from the last time inferTypeArguments was called on this context for (var _i = 0, _a = context.inferences; _i < _a.length; _i++) { @@ -38997,7 +39903,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 148 /* Decorator */) { + if (node.kind !== 149 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the contextual mapper to avoid disturbing a resolution in progress for an @@ -39017,7 +39923,7 @@ var ts; instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); // Inferences made from return types have lower priority than all other inferences. - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8 /* ReturnType */); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 4 /* ReturnType */); } } var thisType = getThisTypeOfSignature(signature); @@ -39032,7 +39938,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -39073,7 +39979,7 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (!constraint) continue; - var errorInfo = reportErrors && headMessage && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + var errorInfo = reportErrors && headMessage && (function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); }); var typeArgumentHeadMessage = headMessage || ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1; if (!mapper) { mapper = createTypeMapper(typeParameters, typeArgumentTypes); @@ -39122,7 +40028,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 183 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 186 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -39139,7 +40045,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); // If the effective argument type is undefined, there is no synthetic type for the argument. @@ -39163,12 +40069,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 180 /* PropertyAccessExpression */) { + if (callee.kind === 183 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 181 /* ElementAccessExpression */) { + else if (callee.kind === 184 /* ElementAccessExpression */) { return callee.expression; } } @@ -39183,17 +40089,17 @@ var ts; * will be supplied from calls to `getEffectiveArgumentCount` and `getEffectiveArgumentType`. */ function getEffectiveCallArguments(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { var template = node.template; var args_4 = [undefined]; - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_4.push(span.expression); }); } return args_4; } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. @@ -39220,19 +40126,19 @@ var ts; * Otherwise, the argument count is the length of the 'args' array. */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -39242,7 +40148,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 147 /* Parameter */: + case 148 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -39266,25 +40172,25 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -39311,23 +40217,23 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } // For a non-constructor parameter decorator, the `propertyKey` will be either // a string or a symbol, based on the name of the parameter's containing method. } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -39339,7 +40245,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralType(element.name.text); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeAssignableToKind(nameType, 1536 /* ESSymbolLike */)) { return nameType; @@ -39365,21 +40271,21 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a parameter decorator - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 150 /* PropertyDeclaration */) { + if (node.kind === 151 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -39411,10 +40317,10 @@ var ts; // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -39426,8 +40332,8 @@ var ts; */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 148 /* Decorator */ || - (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */)) { + if (node.kind === 149 /* Decorator */ || + (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -39436,11 +40342,11 @@ var ts; * Gets the error node to use when reporting errors for an effective argument. */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -39449,8 +40355,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, fallbackError) { - var isTaggedTemplate = node.kind === 184 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 148 /* Decorator */; + var isTaggedTemplate = node.kind === 187 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 149 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { @@ -39524,7 +40430,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 182 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 185 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -39572,7 +40478,7 @@ var ts; max = Math.max(max, ts.length(sig.typeParameters)); } var paramCount = min < max ? min + "-" + max : min; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); + diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); } else if (args) { var min = Number.POSITIVE_INFINITY; @@ -39650,7 +40556,7 @@ var ts; } var candidate = void 0; var inferenceContext = originalCandidate.typeParameters ? - createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0) : + createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0 /* None */) : undefined; while (true) { candidate = originalCandidate; @@ -39682,7 +40588,7 @@ var ts; } excludeCount--; if (excludeCount > 0) { - excludeArgument[ts.indexOf(excludeArgument, /*value*/ true)] = false; + excludeArgument[excludeArgument.indexOf(/*value*/ true)] = false; } else { excludeArgument = undefined; @@ -39721,7 +40627,7 @@ var ts; } return resolveUntypedCall(node); } - var funcType = checkNonNullExpression(node.expression); + var funcType = checkNonNullExpression(node.expression, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_undefined, ts.Diagnostics.Cannot_invoke_an_object_which_is_possibly_null_or_undefined); if (funcType === silentNeverType) { return silentNeverSignature; } @@ -39755,7 +40661,7 @@ var ts; error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); } else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0 /* Call */); } return resolveErrorCall(node); } @@ -39836,7 +40742,7 @@ var ts; } return signature; } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); + invocationError(node, expressionType, 1 /* Construct */); return resolveErrorCall(node); } function isConstructorAccessible(node, signature) { @@ -39876,6 +40782,26 @@ var ts; } return true; } + function invocationError(node, apparentType, kind) { + error(node, kind === 0 /* Call */ + ? ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures + : ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature, typeToString(apparentType)); + invocationErrorRecovery(apparentType, kind); + } + function invocationErrorRecovery(apparentType, kind) { + if (!apparentType.symbol) { + return; + } + var importNode = getSymbolLinks(apparentType.symbol).originatingImport; + // Create a diagnostic on the originating import if possible onto which we can attach a quickfix + // An import call expression cannot be rewritten into another form to correct the error - the only solution is to use `.default` at the use-site + if (importNode && !ts.isImportCall(importNode)) { + var sigs = getSignaturesOfType(getTypeOfSymbol(getSymbolLinks(apparentType.symbol).target), kind); + if (!sigs || !sigs.length) + return; + error(importNode, ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime); + } + } function resolveTaggedTemplateExpression(node, candidatesOutArray) { var tagType = checkExpression(node.tag); var apparentType = getApparentType(tagType); @@ -39889,7 +40815,7 @@ var ts; return resolveUntypedCall(node); } if (!callSignatures.length) { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); + invocationError(node, apparentType, 0 /* Call */); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray); @@ -39899,16 +40825,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -39937,6 +40863,7 @@ var ts; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType)); errorInfo = ts.chainDiagnosticMessages(errorInfo, headMessage); diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(node, errorInfo)); + invocationErrorRecovery(apparentType, 0 /* Call */); return resolveErrorCall(node); } return resolveCall(node, callSignatures, candidatesOutArray, headMessage); @@ -39981,8 +40908,8 @@ var ts; if (elementType.flags & 131072 /* Union */) { var types = elementType.types; var result = void 0; - for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { - var type = types_17[_i]; + for (var _i = 0, types_16 = types; _i < types_16.length; _i++) { + var type = types_16[_i]; result = result || resolveStatelessJsxOpeningLikeElement(openingLikeElement, type, candidatesOutArray); } return result; @@ -39995,16 +40922,16 @@ var ts; } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 148 /* Decorator */: + case 149 /* Decorator */: return resolveDecorator(node, candidatesOutArray); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: // This code-path is called by language service return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } @@ -40090,12 +41017,12 @@ var ts; if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; } - if (node.kind === 183 /* NewExpression */) { + if (node.kind === 186 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 153 /* Constructor */ && - declaration.kind !== 157 /* ConstructSignature */ && - declaration.kind !== 162 /* ConstructorType */ && + declaration.kind !== 154 /* Constructor */ && + declaration.kind !== 158 /* ConstructSignature */ && + declaration.kind !== 163 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -40166,16 +41093,18 @@ var ts; if (moduleSymbol) { var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true); if (esModuleSymbol) { - return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol)); + return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol)); } } return createPromiseReturnType(node, anyType); } - function getTypeWithSyntheticDefaultImportType(type, symbol) { + function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) { if (allowSyntheticDefaultImports && type && type !== unknownType) { var synthType = type; if (!synthType.syntheticType) { - if (!getPropertyOfType(type, "default" /* Default */)) { + var file = ts.find(originalSymbol.declarations, ts.isSourceFile); + var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, /*dontResolveAlias*/ false); + if (hasSyntheticDefault) { var memberTable = ts.createSymbolTable(); var newSymbol = createSymbol(2097152 /* Alias */, "default" /* Default */); newSymbol.target = resolveSymbol(symbol); @@ -40183,7 +41112,7 @@ var ts; var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); anonymousSymbol.type = defaultContainingObject; - synthType.syntheticType = getIntersectionType([type, defaultContainingObject]); + synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*typeFLags*/ 0, /*objectFlags*/ 0) : defaultContainingObject; } else { synthType.syntheticType = type; @@ -40210,9 +41139,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 229 /* FunctionDeclaration */ + ? 232 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 227 /* VariableDeclaration */ + ? 230 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -40252,7 +41181,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return unknownType; } - else if (container.kind === 153 /* Constructor */) { + else if (container.kind === 154 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -40265,7 +41194,7 @@ var ts; var type = getTypeOfSymbol(symbol); if (strictNullChecks) { var declaration = symbol.valueDeclaration; - if (declaration && declaration.initializer) { + if (declaration && ts.hasInitializer(declaration)) { return getOptionalType(type); } } @@ -40374,13 +41303,12 @@ var ts; return promiseType; } function getReturnTypeFromBody(func, checkMode) { - var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!func.body) { return unknownType; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 208 /* Block */) { + if (func.body.kind !== 211 /* Block */) { type = checkExpressionCached(func.body, checkMode); if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any @@ -40391,9 +41319,9 @@ var ts; } } else { - var types = void 0; + var types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (functionFlags & 1 /* Generator */) { - types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), checkAndAggregateReturnExpressionTypes(func, checkMode)); + types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); if (!types || types.length === 0) { var iterableIteratorAny = functionFlags & 2 /* Async */ ? createAsyncIterableIteratorType(anyType) // AsyncGenerator function @@ -40405,7 +41333,6 @@ var ts; } } else { - types = checkAndAggregateReturnExpressionTypes(func, checkMode); if (!types) { // For an async function, the return type will not be never, but rather a Promise for never. return functionFlags & 2 /* Async */ @@ -40420,8 +41347,9 @@ var ts; } } // Return a union of the return expression types. - type = getUnionType(types, /*subtypeReduction*/ true); + type = getUnionType(types, 2 /* Subtype */); } + var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); if (!contextualSignature) { reportErrorsFromWidening(func, type); } @@ -40498,11 +41426,12 @@ var ts; if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 222 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 225 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { return false; } return true; } + /** NOTE: Return value of `[]` means a different thing than `undefined`. `[]` means return `void`, `undefined` means return `never`. */ function checkAndAggregateReturnExpressionTypes(func, checkMode) { var functionFlags = ts.getFunctionFlags(func); var aggregatedTypes = []; @@ -40528,8 +41457,7 @@ var ts; hasReturnWithNoExpression = true; } }); - if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || - func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */)) { + if (aggregatedTypes.length === 0 && !hasReturnWithNoExpression && (hasReturnOfTypeNever || mayReturnNever(func))) { return undefined; } if (strictNullChecks && aggregatedTypes.length && hasReturnWithNoExpression) { @@ -40537,6 +41465,17 @@ var ts; } return aggregatedTypes; } + function mayReturnNever(func) { + switch (func.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + return true; + case 153 /* MethodDeclaration */: + return func.parent.kind === 182 /* ObjectLiteralExpression */; + default: + return false; + } + } /** * TypeScript Specification 1.0 (6.3) - July 2014 * An explicitly typed function whose return type isn't the Void type, @@ -40556,7 +41495,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 208 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 152 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 211 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -40589,7 +41528,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); @@ -40597,7 +41536,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 187 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 190 /* FunctionExpression */) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -40632,7 +41571,7 @@ var ts; checkNodeDeferred(node); } } - if (produceDiagnostics && node.kind !== 152 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 153 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithCapturedNewTargetVariable(node, node.name); @@ -40640,7 +41579,7 @@ var ts; return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); var returnOrPromisedType = returnTypeNode && @@ -40660,7 +41599,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 208 /* Block */) { + if (node.body.kind === 211 /* Block */) { checkSourceElement(node.body); } else { @@ -40707,11 +41646,11 @@ var ts; if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) && + (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) && expr.expression.kind === 99 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 153 /* Constructor */)) { + if (!(func && func.kind === 154 /* Constructor */)) { return true; } // If func.parent is a class and symbol is a (readonly) property of that class, or @@ -40724,13 +41663,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); if (node.kind === 71 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 241 /* NamespaceImport */; + return declaration && declaration.kind === 244 /* NamespaceImport */; } } } @@ -40739,7 +41678,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); - if (node.kind !== 71 /* Identifier */ && node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 71 /* Identifier */ && node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -40748,7 +41687,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 180 /* PropertyAccessExpression */ && expr.kind !== 181 /* ElementAccessExpression */) { + if (expr.kind !== 183 /* PropertyAccessExpression */ && expr.kind !== 184 /* ElementAccessExpression */) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -40833,13 +41772,13 @@ var ts; // Return true if type might be of the given kind. A union or intersection type might be of a given // kind if at least one constituent type is of the given kind. function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { + if (type.flags & kind || kind & 536870912 /* GenericMappedType */ && isGenericMappedType(type)) { return true; } if (type.flags & 393216 /* UnionOrIntersection */) { var types = type.types; - for (var _i = 0, types_18 = types; _i < types_18.length; _i++) { - var t = types_18[_i]; + for (var _i = 0, types_17 = types; _i < types_17.length; _i++) { + var t = types_17[_i]; if (maybeTypeOfKind(t, kind)) { return true; } @@ -40862,7 +41801,7 @@ var ts; (kind & 8192 /* Null */ && isTypeAssignableTo(source, nullType)) || (kind & 4096 /* Undefined */ && isTypeAssignableTo(source, undefinedType)) || (kind & 512 /* ESSymbol */ && isTypeAssignableTo(source, esSymbolType)) || - (kind & 33554432 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); + (kind & 134217728 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); } function allTypesAssignableToKind(source, kind, strict) { return source.flags & 131072 /* Union */ ? @@ -40907,13 +41846,16 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 /* NumberLike */ | 1536 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; } function checkObjectLiteralAssignment(node, sourceType) { var properties = node.properties; + if (strictNullChecks && properties.length === 0) { + return checkNonNullType(sourceType, node); + } for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) { var p = properties_7[_i]; checkObjectLiteralDestructuringPropertyAssignment(sourceType, p, properties); @@ -40922,9 +41864,9 @@ var ts; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 265 /* PropertyAssignment */ || property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */ || property.kind === 269 /* ShorthandPropertyAssignment */) { var name = property.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { @@ -40937,7 +41879,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 269 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -40949,7 +41891,7 @@ var ts; error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 267 /* SpreadAssignment */) { + else if (property.kind === 270 /* SpreadAssignment */) { if (languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(property, 4 /* Rest */); } @@ -40983,8 +41925,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 201 /* OmittedExpression */) { - if (element.kind !== 199 /* SpreadElement */) { + if (element.kind !== 204 /* OmittedExpression */) { + if (element.kind !== 202 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -41012,7 +41954,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 195 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { + if (restExpression.kind === 198 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -41025,7 +41967,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 266 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 269 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -41041,21 +41983,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 195 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { + if (target.kind === 198 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 179 /* ObjectLiteralExpression */) { + if (target.kind === 182 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 178 /* ArrayLiteralExpression */) { + if (target.kind === 181 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 267 /* SpreadAssignment */ ? + var error = target.parent.kind === 270 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -41077,35 +42019,35 @@ var ts; case 71 /* Identifier */: case 9 /* StringLiteral */: case 12 /* RegularExpressionLiteral */: - case 184 /* TaggedTemplateExpression */: - case 197 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: - case 139 /* UndefinedKeyword */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 190 /* TypeOfExpression */: - case 204 /* NonNullExpression */: - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: + case 140 /* UndefinedKeyword */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 193 /* TypeOfExpression */: + case 207 /* NonNullExpression */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: return true; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -41117,9 +42059,9 @@ var ts; } return false; // Some forms listed here for clarity - case 191 /* VoidExpression */: // Explicit opt-out - case 185 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 203 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 194 /* VoidExpression */: // Explicit opt-out + case 188 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 206 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -41132,7 +42074,7 @@ var ts; } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 58 /* EqualsToken */ && (left.kind === 179 /* ObjectLiteralExpression */ || left.kind === 178 /* ArrayLiteralExpression */)) { + if (operator === 58 /* EqualsToken */ && (left.kind === 182 /* ObjectLiteralExpression */ || left.kind === 181 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } var leftType = checkExpression(left, checkMode); @@ -41254,7 +42196,7 @@ var ts; leftType; case 54 /* BarBarToken */: return getTypeFacts(leftType) & 2097152 /* Falsy */ ? - getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], /*subtypeReduction*/ true) : + getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], 2 /* Subtype */) : leftType; case 58 /* EqualsToken */: checkAssignmentOperator(rightType); @@ -41390,7 +42332,7 @@ var ts; checkExpression(node.condition); var type1 = checkExpression(node.whenTrue, checkMode); var type2 = checkExpression(node.whenFalse, checkMode); - return getUnionType([type1, type2], /*subtypeReduction*/ true); + return getUnionType([type1, type2], 2 /* Subtype */); } function checkTemplateExpression(node) { // We just want to check each expressions, but we are unconcerned with @@ -41403,21 +42345,31 @@ var ts; }); return stringType; } + function getContextNode(node) { + if (node.kind === 261 /* JsxAttributes */) { + return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) + } + return node; + } function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - var saveContextualMapper = node.contextualMapper; - node.contextualType = contextualType; - node.contextualMapper = contextualMapper; + var context = getContextNode(node); + var saveContextualType = context.contextualType; + var saveContextualMapper = context.contextualMapper; + context.contextualType = contextualType; + context.contextualMapper = contextualMapper; var checkMode = contextualMapper === identityMapper ? 1 /* SkipContextSensitive */ : - contextualMapper ? 2 /* Inferential */ : 0 /* Normal */; + contextualMapper ? 2 /* Inferential */ : 3 /* Contextual */; var result = checkExpression(node, checkMode); - node.contextualType = saveContextualType; - node.contextualMapper = saveContextualMapper; + context.contextualType = saveContextualType; + context.contextualMapper = saveContextualMapper; return result; } function checkExpressionCached(node, checkMode) { var links = getNodeLinks(node); if (!links.resolvedType) { + if (checkMode) { + return checkExpression(node, checkMode); + } // When computing a type that we're going to cache, we need to ignore any ongoing control flow // analysis because variables may have transient types in indeterminable states. Moving flowLoopStart // to the top of the stack ensures all transient types are computed from a known point. @@ -41430,7 +42382,7 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 185 /* TypeAssertionExpression */ || node.kind === 203 /* AsExpression */; + return node.kind === 188 /* TypeAssertionExpression */ || node.kind === 206 /* AsExpression */; } function checkDeclarationInitializer(declaration) { var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); @@ -41440,16 +42392,11 @@ var ts; } function isLiteralOfContextualType(candidateType, contextualType) { if (contextualType) { - if (contextualType.flags & 131072 /* Union */ && !(contextualType.flags & 8 /* Boolean */)) { - // If the contextual type is a union containing both of the 'true' and 'false' types we - // don't consider it a literal context for boolean literals. - var types_19 = contextualType.types; - return ts.some(types_19, function (t) { - return !(t.flags & 128 /* BooleanLiteral */ && containsType(types_19, trueType) && containsType(types_19, falseType)) && - isLiteralOfContextualType(candidateType, t); - }); + if (contextualType.flags & 393216 /* UnionOrIntersection */) { + var types = contextualType.types; + return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 1081344 /* TypeVariable */) { + if (contextualType.flags & 7372800 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -41481,7 +42428,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -41492,7 +42439,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -41522,7 +42469,7 @@ var ts; function getTypeOfExpression(node, cache) { // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (node.kind === 182 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { + if (node.kind === 185 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -41557,7 +42504,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpression(node, checkMode) { var type; - if (node.kind === 144 /* QualifiedName */) { + if (node.kind === 145 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -41569,11 +42516,12 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 181 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); + var ok = (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 164 /* TypeQuery */ && node.parent.exprName === node)); if (!ok) { - error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); + error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } } return type; @@ -41605,74 +42553,74 @@ var ts; return trueType; case 86 /* FalseKeyword */: return falseType; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return checkTemplateExpression(node); case 12 /* RegularExpressionLiteral */: return globalRegExpType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (node.expression.kind === 91 /* ImportKeyword */) { return checkImportCallExpression(node); } /* falls through */ - case 183 /* NewExpression */: + case 186 /* NewExpression */: return checkCallExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return checkClassExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return checkAssertion(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return checkNonNullAssertion(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return checkMetaProperty(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkDeleteExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return checkVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return checkAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return undefinedWideningType; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return checkYieldExpression(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 250 /* JsxElement */: - return checkJsxElement(node); - case 251 /* JsxSelfClosingElement */: - return checkJsxSelfClosingElement(node); - case 254 /* JsxFragment */: - return checkJsxFragment(node); - case 258 /* JsxAttributes */: + case 253 /* JsxElement */: + return checkJsxElement(node, checkMode); + case 254 /* JsxSelfClosingElement */: + return checkJsxSelfClosingElement(node, checkMode); + case 257 /* JsxFragment */: + return checkJsxFragment(node, checkMode); + case 261 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -41710,7 +42658,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 153 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 154 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -41718,10 +42666,10 @@ var ts; error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); } if (node.name && ts.isIdentifier(node.name) && (node.name.escapedText === "this" || node.name.escapedText === "new")) { - if (ts.indexOf(func.parameters, node) !== 0) { + if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 153 /* Constructor */ || func.kind === 157 /* ConstructSignature */ || func.kind === 162 /* ConstructorType */) { + if (func.kind === 154 /* Constructor */ || func.kind === 158 /* ConstructSignature */ || func.kind === 163 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -41749,7 +42697,7 @@ var ts; error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); return; } - var typePredicate = getSignatureFromDeclaration(parent).typePredicate; + var typePredicate = getTypePredicateOfSignature(getSignatureFromDeclaration(parent)); if (!typePredicate) { return; } @@ -41764,7 +42712,7 @@ var ts; error(parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); } else { - var leadingError = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); + var leadingError = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type); }; checkTypeAssignableTo(typePredicate.type, getTypeOfNode(parent.parameters[typePredicate.parameterIndex]), node.type, /*headMessage*/ undefined, leadingError); } @@ -41787,13 +42735,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 188 /* ArrowFunction */: - case 156 /* CallSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 161 /* FunctionType */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 191 /* ArrowFunction */: + case 157 /* CallSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 162 /* FunctionType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -41811,7 +42759,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 176 /* ArrayBindingPattern */ || name.kind === 175 /* ObjectBindingPattern */) { + else if (name.kind === 179 /* ArrayBindingPattern */ || name.kind === 178 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -41820,12 +42768,12 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 161 /* FunctionType */ || node.kind === 229 /* FunctionDeclaration */ || node.kind === 162 /* ConstructorType */ || - node.kind === 156 /* CallSignature */ || node.kind === 153 /* Constructor */ || - node.kind === 157 /* ConstructSignature */) { + else if (node.kind === 162 /* FunctionType */ || node.kind === 232 /* FunctionDeclaration */ || node.kind === 163 /* ConstructorType */ || + node.kind === 157 /* CallSignature */ || node.kind === 154 /* Constructor */ || + node.kind === 158 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -41855,10 +42803,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -41905,7 +42853,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -41919,16 +42867,16 @@ var ts; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: addName(names, member.name, memberName, 4 /* Method */); break; } @@ -41991,7 +42939,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* PropertySignature */) { + if (member.kind === 150 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: @@ -42015,7 +42963,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 231 /* InterfaceDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -42035,7 +42983,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -42043,7 +42991,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -42070,7 +43018,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 153 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -42095,24 +43043,8 @@ var ts; if (!produceDiagnostics) { return; } - function containsSuperCallAsComputedPropertyName(n) { - var name = ts.getNameOfDeclaration(n); - return name && containsSuperCall(name); - } - function containsSuperCall(n) { - if (ts.isSuperCall(n)) { - return true; - } - else if (ts.isFunctionLike(n)) { - return false; - } - else if (ts.isClassLike(n)) { - return ts.forEach(n.members, containsSuperCallAsComputedPropertyName); - } - return ts.forEachChild(n, containsSuperCall); - } function isInstancePropertyWithInitializer(n) { - return n.kind === 150 /* PropertyDeclaration */ && + return n.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -42142,7 +43074,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -42167,7 +43099,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { if (!(node.flags & 2097152 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -42177,13 +43109,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = node.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -42201,7 +43133,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -42218,8 +43150,10 @@ var ts; function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { - var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJavaScriptFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { var typeArguments; var mapper; var result = true; @@ -42227,18 +43161,28 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, ts.isInJavaScriptFile(typeArgumentNodes[i])); + typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(typeArgument, instantiateType(constraint, mapper), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; } + function getTypeParametersForTypeReference(node) { + var type = getTypeFromTypeReference(node); + if (type !== unknownType) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || + (ts.getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : undefined); + } + } + return undefined; + } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 160 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 161 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); @@ -42247,22 +43191,10 @@ var ts; // Do type argument local checks only if referenced type is successfully resolved ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (!symbol) { - // There is no resolved symbol cached if the type resolved to a builtin - // via JSDoc type reference resolution (eg, Boolean became boolean), none - // of which are generic when they have no associated symbol - // (additionally, JSDoc's index signature syntax, Object actually uses generic syntax without being generic) - if (!ts.isJSDocIndexSignature(node)) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - } - return; + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); } - var typeParameters = symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters; - if (!typeParameters && ts.getObjectFlags(type) & 4 /* Reference */) { - typeParameters = type.target.localTypeParameters; - } - checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } if (type.flags & 16 /* Enum */ && getNodeLinks(node).resolvedSymbol.flags & 8 /* EnumMember */) { @@ -42270,6 +43202,14 @@ var ts; } } } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType); + if (!typeReferenceNode) + return undefined; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } function checkTypeQuery(node) { getTypeFromTypeQueryNode(node); } @@ -42304,8 +43244,8 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { - if (accessNode.kind === 181 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && - ts.getObjectFlags(objectType) & 32 /* Mapped */ && objectType.declaration.readonlyToken) { + if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -42326,6 +43266,9 @@ var ts; function checkMappedType(node) { checkSourceElement(node.typeParameter); checkSourceElement(node.type); + if (noImplicitAny && !node.type) { + reportImplicitAnyError(node, anyType); + } var type = getTypeFromMappedTypeNode(node); var constraintType = getConstraintTypeFromMappedType(type); checkTypeAssignableTo(constraintType, stringType, node.typeParameter.constraint); @@ -42334,6 +43277,15 @@ var ts; checkGrammarTypeOperatorNode(node); checkSourceElement(node.type); } + function checkConditionalType(node) { + ts.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 /* ConditionalType */ && n.parent.extendsType === n; })) { + grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + } function isPrivateWithinAmbient(node) { return ts.hasModifier(node, 8 /* Private */) && !!(node.flags & 2097152 /* Ambient */); } @@ -42341,9 +43293,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 231 /* InterfaceDeclaration */ && - n.parent.kind !== 230 /* ClassDeclaration */ && - n.parent.kind !== 200 /* ClassExpression */ && + if (n.parent.kind !== 234 /* InterfaceDeclaration */ && + n.parent.kind !== 233 /* ClassDeclaration */ && + n.parent.kind !== 203 /* ClassExpression */ && n.flags & 2097152 /* Ambient */) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -42434,7 +43386,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */) && + var reportError = (node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -42473,7 +43425,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 2097152 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 231 /* InterfaceDeclaration */ || node.parent.kind === 164 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 234 /* InterfaceDeclaration */ || node.parent.kind === 165 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -42484,7 +43436,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 229 /* FunctionDeclaration */ || node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */ || node.kind === 153 /* Constructor */) { + if (node.kind === 232 /* FunctionDeclaration */ || node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */ || node.kind === 154 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -42612,33 +43564,35 @@ var ts; })(DeclarationSpaces || (DeclarationSpaces = {})); function getDeclarationSpaces(d) { switch (d.kind) { - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: // A jsdoc typedef is, by definition, a type alias - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return 2 /* ExportType */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: return 2 /* ExportType */ | 1 /* ExportValue */; + case 272 /* SourceFile */: + return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; // The below options all declare an Alias, which is allowed to merge with other values within the importing module - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: var result_2 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); }); return result_2; - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 229 /* FunctionDeclaration */: - case 243 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 232 /* FunctionDeclaration */: + case 246 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 return 1 /* ExportValue */; default: - ts.Debug.fail(ts.SyntaxKind[d.kind]); + ts.Debug.fail(ts.Debug.showSyntaxKind(d)); } } } @@ -42693,7 +43647,7 @@ var ts; } return undefined; } - return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), /*subtypeReduction*/ true); + return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2 /* Subtype */); } /** * Gets the "awaited type" of a type. @@ -42726,7 +43680,7 @@ var ts; } var promisedType = getPromisedTypeOfPromise(type); if (promisedType) { - if (type.id === promisedType.id || ts.indexOf(awaitedTypeStack, promisedType.id) >= 0) { + if (type.id === promisedType.id || awaitedTypeStack.indexOf(promisedType.id) >= 0) { // Verify that we don't have a bad actor in the form of a promise whose // promised type is the same as the promise type, or a mutually recursive // promise. If so, we return undefined as we cannot guess the shape. If this @@ -42905,28 +43859,28 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 147 /* Parameter */: + case 148 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); break; } - checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, errorInfo); + checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage, function () { return errorInfo; }); } /** * If a TypeNode can be resolved to a value symbol imported from an external module, it is @@ -42964,18 +43918,18 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: var commonEntityName = void 0; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -43001,9 +43955,9 @@ var ts; } } return commonEntityName; - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; } } @@ -43027,14 +43981,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -43043,19 +43997,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 147 /* Parameter */: + case 148 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -43087,7 +44041,7 @@ var ts; function checkJSDocParameterTag(node) { checkSourceElement(node.typeExpression); if (!ts.getParameterSymbolFromJSDoc(node)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 144 /* QualifiedName */ ? node.name.right : node.name)); + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 /* QualifiedName */ ? node.name.right : node.name)); } } function checkJSDocAugmentsTag(node) { @@ -43096,7 +44050,7 @@ var ts; error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName)); return; } - var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 282 /* JSDocAugmentsTag */); + var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 285 /* JSDocAugmentsTag */); ts.Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); @@ -43114,7 +44068,7 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -43127,7 +44081,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -43156,7 +44110,8 @@ var ts; } } } - checkSourceElement(node.body); + var body = node.kind === 152 /* MethodSignature */ ? undefined : node.body; + checkSourceElement(body); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if ((functionFlags & 1 /* Generator */) === 0) { var returnOrPromisedType = returnTypeNode && (functionFlags & 2 /* Async */ @@ -43167,10 +44122,10 @@ var ts; if (produceDiagnostics && !returnTypeNode) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -43189,43 +44144,43 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 269 /* SourceFile */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 237 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 232 /* TypeAliasDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 235 /* TypeAliasDeclaration */: checkUnusedTypeParameters(node); break; default: @@ -43237,8 +44192,10 @@ var ts; function checkUnusedLocalsAndParameters(node) { if (noUnusedIdentifiers && !(node.flags & 2097152 /* Ambient */)) { node.locals.forEach(function (local) { - if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 147 /* Parameter */) { + // If it's purely a type parameter, ignore, will be checked in `checkUnusedTypeParameters`. + // If it's a type parameter merged with a parameter, check if the parameter-side is used. + if (local.flags & 262144 /* TypeParameter */ ? (local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : !local.isReferenced) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 148 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && @@ -43266,8 +44223,8 @@ var ts; var node = ts.getNameOfDeclaration(declaration) || declaration; if (isIdentifierThatStartsWithUnderScore(node)) { var declaration_2 = ts.getRootDeclaration(node.parent); - if ((declaration_2.kind === 227 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || - declaration_2.kind === 146 /* TypeParameter */) { + if ((declaration_2.kind === 230 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || + declaration_2.kind === 147 /* TypeParameter */) { return; } } @@ -43283,28 +44240,42 @@ var ts; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { - if (node.members) { - for (var _i = 0, _a = node.members; _i < _a.length; _i++) { - var member = _a[_i]; - if (member.kind === 152 /* MethodDeclaration */ || member.kind === 150 /* PropertyDeclaration */) { - if (!member.symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { - error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(member.symbol)); + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + switch (member.kind) { + case 153 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + if (member.kind === 156 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + // Already would have reported an error on the getter. + break; } - } - else if (member.kind === 153 /* Constructor */) { + var symbol = getSymbolOfNode(member); + if (!symbol.isReferenced && ts.hasModifier(member, 8 /* Private */)) { + error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)); + } + break; + case 154 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { error(parameter.name, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read, ts.symbolName(parameter.symbol)); } } - } + break; + case 159 /* IndexSignature */: + case 210 /* SemicolonClassElement */: + // Can't be private + break; + default: + ts.Debug.fail(); } } } } function checkUnusedTypeParameters(node) { - if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { + if (compilerOptions.noUnusedParameters && !(node.flags & 2097152 /* Ambient */)) { if (node.typeParameters) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. @@ -43315,7 +44286,7 @@ var ts; } for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) { var typeParameter = _a[_i]; - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & 262144 /* TypeParameter */) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(typeParameter.symbol)); } } @@ -43338,7 +44309,7 @@ var ts; } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 208 /* Block */) { + if (node.kind === 211 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -43368,12 +44339,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 151 /* MethodSignature */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 152 /* MethodSignature */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -43382,7 +44353,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 147 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 148 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -43461,7 +44432,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43476,7 +44447,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43511,7 +44482,7 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 227 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 230 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); @@ -43523,17 +44494,17 @@ var ts; localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 228 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 209 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 231 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 212 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 208 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 235 /* ModuleBlock */ || - container.kind === 234 /* ModuleDeclaration */ || - container.kind === 269 /* SourceFile */); + (container.kind === 211 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 238 /* ModuleBlock */ || + container.kind === 237 /* ModuleDeclaration */ || + container.kind === 272 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -43548,7 +44519,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 147 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 148 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -43559,7 +44530,7 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 180 /* PropertyAccessExpression */) { + if (n.kind === 183 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } @@ -43578,8 +44549,8 @@ var ts; // so we need to do a bit of extra work to check if reference is legal var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 147 /* Parameter */ || - symbol.valueDeclaration.kind === 177 /* BindingElement */) { + if (symbol.valueDeclaration.kind === 148 /* Parameter */ || + symbol.valueDeclaration.kind === 180 /* BindingElement */) { // it is ok to reference parameter in initializer if either // - parameter is located strictly on the left of current parameter declaration if (symbol.valueDeclaration.pos < node.pos) { @@ -43593,7 +44564,7 @@ var ts; return ts.isFunctionLike(current.parent) || // computed property names/initializers in instance property declaration of class like entities // are executed in constructor and thus deferred - (current.parent.kind === 150 /* PropertyDeclaration */ && + (current.parent.kind === 151 /* PropertyDeclaration */ && !(ts.hasModifier(current.parent, 32 /* Static */)) && ts.isClassLike(current.parent.parent)); })) { @@ -43615,7 +44586,9 @@ var ts; // Check variable, parameter, or property declaration function checkVariableLikeDeclaration(node) { checkDecorators(node); - checkSourceElement(node.type); + if (!ts.isBindingElement(node)) { + checkSourceElement(node.type); + } // JSDoc `function(string, string): string` syntax results in parameters with no name if (!node.name) { return; @@ -43624,57 +44597,65 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 177 /* BindingElement */) { - if (node.parent.kind === 175 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { + if (node.kind === 180 /* BindingElement */) { + if (node.parent.kind === 178 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 145 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (!ts.isBindingPattern(name)) { + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 176 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 179 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 147 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 148 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { + var initializerType = checkExpressionCached(node.initializer); + if (strictNullChecks && node.name.elements.length === 0) { + checkNonNullType(initializerType, node); + } + else { + checkTypeAssignableTo(initializerType, getWidenedTypeForVariableLikeDeclaration(node), node, /*headMessage*/ undefined); + } checkParameterInitializer(node); } return; } var symbol = getSymbolOfNode(node); - var type = convertAutoToAny(getTypeOfVariableOrParameterOrProperty(symbol)); + var type = convertAutoToAny(getTypeOfSymbol(symbol)); if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } @@ -43696,10 +44677,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */) { + if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */) { + if (node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -43711,14 +44692,14 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 150 /* PropertyDeclaration */ || nextDeclaration.kind === 149 /* PropertySignature */ + var message = nextDeclaration.kind === 151 /* PropertyDeclaration */ || nextDeclaration.kind === 150 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 147 /* Parameter */ && right.kind === 227 /* VariableDeclaration */) || - (left.kind === 227 /* VariableDeclaration */ && right.kind === 147 /* Parameter */)) { + if ((left.kind === 148 /* Parameter */ && right.kind === 230 /* VariableDeclaration */) || + (left.kind === 230 /* VariableDeclaration */ && right.kind === 148 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -43747,19 +44728,6 @@ var ts; checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (ts.getFunctionFlags(node) & 2 /* Async */) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } function checkExpressionStatement(node) { // Grammar checking checkGrammarStatementInAmbientContext(node); @@ -43770,7 +44738,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 210 /* EmptyStatement */) { + if (node.thenStatement.kind === 213 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -43790,12 +44758,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 231 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -43813,7 +44781,7 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 6 /* ESNext */) { @@ -43831,14 +44799,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -43865,12 +44833,12 @@ var ts; // Grammar checking checkGrammarForInOrForOfStatement(node); var rightType = checkNonNullExpression(node.expression); - // TypeScript 1.0 spec (April 2014): 5.4 + // TypeScript 1.0 spec (April 2014): 5.4 // In a 'for-in' statement of the form // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -43884,7 +44852,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -43897,7 +44865,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -43954,7 +44922,7 @@ var ts; var arrayTypes = inputType.types; var filteredTypes = ts.filter(arrayTypes, function (t) { return !(t.flags & 524322 /* StringLike */); }); if (filteredTypes !== arrayTypes) { - arrayType = getUnionType(filteredTypes, /*subtypeReduction*/ true); + arrayType = getUnionType(filteredTypes, 2 /* Subtype */); } } else if (arrayType.flags & 524322 /* StringLike */) { @@ -43999,7 +44967,7 @@ var ts; if (arrayElementType.flags & 524322 /* StringLike */) { return stringType; } - return getUnionType([arrayElementType, stringType], /*subtypeReduction*/ true); + return getUnionType([arrayElementType, stringType], 2 /* Subtype */); } return arrayElementType; } @@ -44086,7 +45054,7 @@ var ts; } return undefined; } - var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var returnType = getUnionType(ts.map(signatures, getReturnTypeOfSignature), 2 /* Subtype */); var iteratedType = getIteratedTypeOfIterator(returnType, errorNode, /*isAsyncIterator*/ !!asyncMethodType); if (checkAssignability && errorNode && iteratedType) { // If `checkAssignability` was specified, we were called from @@ -44154,7 +45122,7 @@ var ts; } return undefined; } - var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), /*subtypeReduction*/ true); + var nextResult = getUnionType(ts.map(nextMethodSignatures, getReturnTypeOfSignature), 2 /* Subtype */); if (isTypeAny(nextResult)) { return undefined; } @@ -44198,8 +45166,8 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return node.kind === 154 /* GetAccessor */ - && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 155 /* SetAccessor */)) !== undefined; + return node.kind === 155 /* GetAccessor */ + && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156 /* SetAccessor */)) !== undefined; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncGenerator */) === 2 /* Async */ @@ -44209,56 +45177,56 @@ var ts; } function checkReturnStatement(node) { // Grammar checking - if (!checkGrammarStatementInAmbientContext(node)) { - var functionBlock = ts.getContainingFunction(node); - if (!functionBlock) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } + if (checkGrammarStatementInAmbientContext(node)) { + return; } var func = ts.getContainingFunction(node); - if (func) { - var signature = getSignatureFromDeclaration(func); - var returnType = getReturnTypeOfSignature(signature); - var functionFlags = ts.getFunctionFlags(func); - if (functionFlags & 1 /* Generator */) { + if (!func) { + grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); + return; + } + var signature = getSignatureFromDeclaration(func); + var returnType = getReturnTypeOfSignature(signature); + var functionFlags = ts.getFunctionFlags(func); + var isGenerator = functionFlags & 1 /* Generator */; + if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { + var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; + if (isGenerator) { // A generator does not need its return expressions checked against its return type. // Instead, the yield expressions are checked against the element type. - // TODO: Check return expressions of generators when return type tracking is added + // TODO: Check return types of generators when return type tracking is added // for generators. return; } - if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { - var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (func.kind === 155 /* SetAccessor */) { - if (node.expression) { - error(node, ts.Diagnostics.Setters_cannot_return_a_value); - } - } - else if (func.kind === 153 /* Constructor */) { - if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { - error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (functionFlags & 2 /* Async */) { - var promisedType = getPromisedTypeOfPromise(returnType); - var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - if (promisedType) { - // If the function has a return type, but promisedType is - // undefined, an error will be reported in checkAsyncFunctionReturnType - // so we don't need to report one here. - checkTypeAssignableTo(awaitedType, promisedType, node); - } - } - else { - checkTypeAssignableTo(exprType, returnType, node); - } + else if (func.kind === 156 /* SetAccessor */) { + if (node.expression) { + error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind !== 153 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType)) { - // The function has a return type, but the return statement doesn't have an expression. - error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); + else if (func.kind === 154 /* Constructor */) { + if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { + error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); + } } + else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { + if (functionFlags & 2 /* Async */) { + var promisedType = getPromisedTypeOfPromise(returnType); + var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + if (promisedType) { + // If the function has a return type, but promisedType is + // undefined, an error will be reported in checkAsyncFunctionReturnType + // so we don't need to report one here. + checkTypeAssignableTo(awaitedType, promisedType, node); + } + } + else { + checkTypeAssignableTo(exprType, returnType, node); + } + } + } + else if (func.kind !== 154 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + // The function has a return type, but the return statement doesn't have an expression. + error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } } function checkWithStatement(node) { @@ -44285,7 +45253,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 262 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 265 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -44297,12 +45265,11 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 261 /* CaseClause */) { - var caseClause = clause; + if (produceDiagnostics && clause.kind === 264 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. - var caseType = checkExpression(caseClause.expression); + var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -44311,7 +45278,7 @@ var ts; } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { // expressionType is not comparable to caseType, try the reversed check and report errors if it fails - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, /*headMessage*/ undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, /*headMessage*/ undefined); } } ts.forEach(clause.statements, checkSourceElement); @@ -44327,7 +45294,7 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 223 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + if (current.kind === 226 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { var sourceFile = ts.getSourceFileOfNode(node); grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); return true; @@ -44420,7 +45387,8 @@ var ts; error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); } function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) { - if (!indexType) { + // ESSymbol properties apply to neither string nor numeric indexers. + if (!indexType || ts.isKnownSymbol(prop)) { return; } var propDeclaration = prop.valueDeclaration; @@ -44432,8 +45400,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && - (propDeclaration.kind === 195 /* BinaryExpression */ || - ts.getNameOfDeclaration(propDeclaration).kind === 145 /* ComputedPropertyName */ || + (propDeclaration.kind === 198 /* BinaryExpression */ || + ts.getNameOfDeclaration(propDeclaration).kind === 146 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -44539,9 +45507,11 @@ var ts; // type parameter at this position, we report an error. var sourceConstraint = source.constraint && getTypeFromTypeNode(source.constraint); var targetConstraint = getConstraintFromTypeParameter(target); - if ((sourceConstraint || targetConstraint) && - (!sourceConstraint || !targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint))) { - return false; + if (sourceConstraint) { + // relax check if later interface augmentation has no constraint + if (!targetConstraint || !isTypeIdenticalTo(sourceConstraint, targetConstraint)) { + return false; + } } // If the type parameter node has a default and it is not identical to the default // for the type parameter at this position, we report an error. @@ -44609,12 +45579,15 @@ var ts; ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; - if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { break; } } } - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(baseType_1, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + var baseWithThis = getTypeWithThisArgument(baseType_1, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); + } checkTypeAssignableTo(staticType, getTypeWithoutSignatures(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); if (baseConstructorType.flags & 1081344 /* TypeVariable */ && !isMixinConstructorType(staticType)) { error(node.name || node, ts.Diagnostics.A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any); @@ -44644,7 +45617,13 @@ var ts; var t = getTypeFromTypeNode(typeRefNode); if (t !== unknownType) { if (isValidBaseType(t)) { - checkTypeAssignableTo(typeWithThis, getTypeWithThisArgument(t, type.thisType), node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); + var genericDiag = t.symbol && t.symbol.flags & 32 /* Class */ ? + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass : + ts.Diagnostics.Class_0_incorrectly_implements_interface_1; + var baseWithThis = getTypeWithThisArgument(t, type.thisType); + if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) { + issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag); + } } else { error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); @@ -44659,6 +45638,35 @@ var ts; checkPropertyInitialization(node); } } + function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) { + // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible + var issuedMemberError = false; + var _loop_5 = function (member) { + if (ts.hasStaticModifier(member)) { + return "continue"; + } + var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member); + if (declaredProp) { + var prop = getPropertyOfType(typeWithThis, declaredProp.escapedName); + var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); + if (prop && baseProp) { + var rootChain = function () { return ts.chainDiagnosticMessages( + /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, ts.unescapeLeadingUnderscores(declaredProp.escapedName), typeToString(typeWithThis), typeToString(baseWithThis)); }; + if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, /*message*/ undefined, rootChain)) { + issuedMemberError = true; + } + } + } + }; + for (var _i = 0, _a = node.members; _i < _a.length; _i++) { + var member = _a[_i]; + _loop_5(member); + } + if (!issuedMemberError) { + // check again with diagnostics to generate a less-specific error + checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag); + } + } function checkBaseTypeAccessibility(type, node) { var signatures = getSignaturesOfType(type, 1 /* Construct */); if (signatures.length) { @@ -44678,7 +45686,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 230 /* ClassDeclaration */ || d.kind === 231 /* InterfaceDeclaration */; + return d.kind === 233 /* ClassDeclaration */ || d.kind === 234 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -44717,7 +45725,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { - if (derivedClassDecl.kind === 200 /* ClassExpression */) { + if (derivedClassDecl.kind === 203 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -44809,7 +45817,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 150 /* PropertyDeclaration */ && + return node.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -44831,7 +45839,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -44936,17 +45944,17 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 193 /* PrefixUnaryExpression */: - var value_1 = evaluate(expr.operand); - if (typeof value_1 === "number") { + case 196 /* PrefixUnaryExpression */: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { switch (expr.operator) { - case 37 /* PlusToken */: return value_1; - case 38 /* MinusToken */: return -value_1; - case 52 /* TildeToken */: return ~value_1; + case 37 /* PlusToken */: return value_2; + case 38 /* MinusToken */: return -value_2; + case 52 /* TildeToken */: return ~value_2; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -44962,6 +45970,7 @@ var ts; case 37 /* PlusToken */: return left + right; case 38 /* MinusToken */: return left - right; case 42 /* PercentToken */: return left % right; + case 40 /* AsteriskAsteriskToken */: return Math.pow(left, right); } } break; @@ -44970,18 +45979,18 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return evaluate(expr.expression); case 71 /* Identifier */: return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText); - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 180 /* PropertyAccessExpression */) { + if (ex.kind === 183 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -45013,8 +46022,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 181 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 183 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 184 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 9 /* StringLiteral */; } function checkEnumDeclaration(node) { @@ -45054,7 +46063,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 233 /* EnumDeclaration */) { + if (declaration.kind !== 236 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -45077,8 +46086,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { var declaration = declarations_7[_i]; - if ((declaration.kind === 230 /* ClassDeclaration */ || - (declaration.kind === 229 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 233 /* ClassDeclaration */ || + (declaration.kind === 232 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 2097152 /* Ambient */)) { return declaration; } @@ -45142,7 +46151,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 230 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 233 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -45193,23 +46202,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -45220,12 +46229,12 @@ var ts; break; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 229 /* FunctionDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -45248,12 +46257,12 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: do { node = node.left; } while (node.kind !== 71 /* Identifier */); return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 71 /* Identifier */); @@ -45266,9 +46275,9 @@ var ts; error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 245 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 248 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; @@ -45301,14 +46310,14 @@ var ts; (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 247 /* ExportSpecifier */ ? + var message = node.kind === 250 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 247 /* ExportSpecifier */ + && node.kind === 250 /* ExportSpecifier */ && !(target.flags & 107455 /* Value */) && !(node.flags & 2097152 /* Ambient */)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); @@ -45336,7 +46345,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -45357,7 +46366,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 252 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { if (target.flags & 107455 /* Value */) { @@ -45393,10 +46402,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 235 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 238 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 2097152 /* Ambient */; - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -45413,7 +46422,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 269 /* SourceFile */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 234 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 272 /* SourceFile */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 237 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -45442,8 +46451,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -45531,7 +46540,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 229 /* FunctionDeclaration */ && declaration.kind !== 152 /* MethodDeclaration */) || + return (declaration.kind !== 232 /* FunctionDeclaration */ && declaration.kind !== 153 /* MethodDeclaration */) || !!declaration.body; } function checkSourceElement(node) { @@ -45549,145 +46558,149 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return checkTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return checkParameter(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return checkPropertyDeclaration(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return checkSignatureDeclaration(node); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return checkMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return checkConstructorDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return checkAccessorDeclaration(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return checkTypeReferenceNode(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return checkTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return checkTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return checkArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return checkTupleType(node); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return checkSourceElement(node.type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return checkTypeOperator(node); - case 282 /* JSDocAugmentsTag */: + case 170 /* ConditionalType */: + return checkConditionalType(node); + case 171 /* InferType */: + return checkInferType(node); + case 285 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return checkJSDocTypedefTag(node); - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: checkSignatureDeclaration(node); // falls through - case 275 /* JSDocNonNullableType */: - case 274 /* JSDocNullableType */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 278 /* JSDocNonNullableType */: + case 277 /* JSDocNullableType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return checkMappedType(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return checkBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return checkVariableStatement(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return checkExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return checkIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return checkDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return checkWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return checkForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return checkForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkForOfStatement(node); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return checkReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return checkSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return checkLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return checkThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return checkTryStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return checkBindingElement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return checkClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return checkImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return checkExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return checkExportAssignment(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -45761,17 +46774,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -45890,13 +46903,13 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -45904,8 +46917,8 @@ var ts; // falls through // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. @@ -45914,7 +46927,7 @@ var ts; copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 793064 /* Type */); } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -45962,28 +46975,28 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 146 /* TypeParameter */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 147 /* TypeParameter */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 144 /* QualifiedName */) { + while (node.parent && node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 160 /* TypeReference */; + return node.parent && node.parent.kind === 161 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 180 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 183 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 202 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 205 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -46011,13 +47024,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 144 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 145 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 238 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 241 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 244 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 247 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -46042,7 +47055,7 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJavaScriptFile(entityName) && - entityName.parent.kind === 180 /* PropertyAccessExpression */ && + entityName.parent.kind === 183 /* PropertyAccessExpression */ && entityName.parent === entityName.parent.parent.left) { // Check if this is a special property assignment var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); @@ -46050,13 +47063,13 @@ var ts; return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 244 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 247 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } - if (entityName.kind !== 180 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 183 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 238 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 241 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -46066,7 +47079,7 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 202 /* ExpressionWithTypeArguments */) { + if (entityName.parent.kind === 205 /* ExpressionWithTypeArguments */) { meaning = 793064 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { @@ -46077,15 +47090,15 @@ var ts; meaning = 1920 /* Namespace */; } meaning |= 2097152 /* Alias */; - var entityNameSymbol = resolveEntityName(entityName, meaning); + var entityNameSymbol = ts.isEntityNameExpression(entityName) ? resolveEntityName(entityName, meaning) : undefined; if (entityNameSymbol) { return entityNameSymbol; } } - if (entityName.parent.kind === 284 /* JSDocParameterTag */) { + if (entityName.parent.kind === 287 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 146 /* TypeParameter */ && entityName.parent.parent.kind === 287 /* JSDocTemplateTag */) { + if (entityName.parent.kind === 147 /* TypeParameter */ && entityName.parent.parent.kind === 290 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJavaScriptFile(entityName)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -46097,16 +47110,17 @@ var ts; } if (entityName.kind === 71 /* Identifier */) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { - return getIntrinsicTagSymbol(entityName.parent); + var symbol = getIntrinsicTagSymbol(entityName.parent); + return symbol === unknownSymbol ? undefined : symbol; } return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 180 /* PropertyAccessExpression */ || entityName.kind === 144 /* QualifiedName */) { + else if (entityName.kind === 183 /* PropertyAccessExpression */ || entityName.kind === 145 /* QualifiedName */) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 180 /* PropertyAccessExpression */) { + if (entityName.kind === 183 /* PropertyAccessExpression */) { checkPropertyAccessExpression(entityName); } else { @@ -46116,20 +47130,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 160 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = entityName.parent.kind === 161 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 257 /* JsxAttribute */) { + else if (entityName.parent.kind === 260 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 159 /* TypePredicate */) { + if (entityName.parent.kind === 160 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (node.flags & 4194304 /* InWithStatement */) { @@ -46147,8 +47161,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 177 /* BindingElement */ && - node.parent.parent.kind === 175 /* ObjectBindingPattern */ && + else if (node.parent.kind === 180 /* BindingElement */ && + node.parent.parent.kind === 178 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText); @@ -46159,8 +47173,8 @@ var ts; } switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 99 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -46174,23 +47188,24 @@ var ts; return checkExpression(node).symbol; } // falls through - case 170 /* ThisType */: + case 173 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 97 /* SuperKeyword */: return checkExpression(node).symbol; case 123 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 153 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 154 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; case 9 /* StringLiteral */: + case 13 /* NoSubstitutionTemplateLiteral */: // 1). import x = require("./mo/*gotToDefinitionHere*/d") // 2). External module name in an import declaration // 3). Dynamic import call or require in javascript if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 242 /* ImportDeclaration */ || node.parent.kind === 248 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || ts.isImportCall(node.parent))) { return resolveExternalModuleName(node, node); } @@ -46215,7 +47230,7 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 266 /* ShorthandPropertyAssignment */) { + if (location && location.kind === 269 /* ShorthandPropertyAssignment */) { return resolveEntityName(location.name, 107455 /* Value */ | 2097152 /* Alias */); } return undefined; @@ -46274,8 +47289,10 @@ var ts; } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolAtLocation(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + } } return unknownType; } @@ -46286,32 +47303,32 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 179 /* ObjectLiteralExpression */ || expr.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 182 /* ObjectLiteralExpression */ || expr.kind === 181 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 217 /* ForOfStatement */) { + if (expr.parent.kind === 220 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 195 /* BinaryExpression */) { + if (expr.parent.kind === 198 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 265 /* PropertyAssignment */) { + if (expr.parent.kind === 268 /* PropertyAssignment */) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 181 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType; - return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, ts.indexOf(expr.parent.elements, expr), elementType || unknownType); + return checkArrayLiteralDestructuringElementAssignment(expr.parent, typeOfArrayLiteral, expr.parent.elements.indexOf(expr), elementType || unknownType); } // Gets the property symbol corresponding to the property in destructuring assignment // 'property1' from @@ -46358,42 +47375,35 @@ var ts; return ts.typeHasCallOrConstructSignatures(type, checker); } function getRootSymbols(symbol) { + var roots = getImmediateRootSymbols(symbol); + return roots ? ts.flatMap(roots, getRootSymbols) : [symbol]; + } + function getImmediateRootSymbols(symbol) { if (ts.getCheckFlags(symbol) & 6 /* Synthetic */) { - var symbols_4 = []; - var name_4 = symbol.escapedName; - ts.forEach(getSymbolLinks(symbol).containingType.types, function (t) { - var symbol = getPropertyOfType(t, name_4); - if (symbol) { - symbols_4.push(symbol); - } - }); - return symbols_4; + return ts.mapDefined(getSymbolLinks(symbol).containingType.types, function (type) { return getPropertyOfType(type, symbol.escapedName); }); } else if (symbol.flags & 33554432 /* Transient */) { - var transient = symbol; - if (transient.leftSpread) { - return getRootSymbols(transient.leftSpread).concat(getRootSymbols(transient.rightSpread)); - } - if (transient.syntheticOrigin) { - return getRootSymbols(transient.syntheticOrigin); - } - var target = void 0; - var next = symbol; - while (next = getSymbolLinks(next).target) { - target = next; - } - if (target) { - return [target]; - } + var _a = symbol, leftSpread = _a.leftSpread, rightSpread = _a.rightSpread, syntheticOrigin = _a.syntheticOrigin; + return leftSpread ? [leftSpread, rightSpread] + : syntheticOrigin ? [syntheticOrigin] + : ts.singleElementArray(tryGetAliasTarget(symbol)); } - return [symbol]; + return undefined; + } + function tryGetAliasTarget(symbol) { + var target; + var next = symbol; + while (next = getSymbolLinks(next).target) { + target = next; + } + return target; } // Emitter support function isArgumentsLocalBinding(node) { if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -46443,14 +47453,14 @@ var ts; // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the // kinds that we do NOT prefix. var exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */) { + if (!prefixLocals && exportSymbol.flags & 944 /* ExportHasLocal */ && !(exportSymbol.flags & 3 /* Variable */)) { return undefined; } symbol = exportSymbol; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 269 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 272 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -46494,7 +47504,7 @@ var ts; // AND // - binding is not declared in loop, should be renamed to avoid name reuse across siblings // let a, b - // { let x = 1; a = () => x; } + // { let x = 1; a = () => x; } // { let x = 100; b = () => x; } // console.log(a()); // should print '1' // console.log(b()); // should print '100' @@ -46505,7 +47515,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 262144 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 208 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 211 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -46546,16 +47556,16 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return node.expression && node.expression.kind === 71 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -46565,7 +47575,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 269 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 272 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -46643,15 +47653,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 268 /* EnumMember */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 271 /* EnumMember */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 268 /* EnumMember */) { + if (node.kind === 271 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -46737,20 +47747,20 @@ var ts; : unknownType; if (type.flags & 1024 /* UniqueESSymbol */ && type.symbol === symbol) { - flags |= 131072 /* AllowUniqueESSymbolType */; + flags |= 1048576 /* AllowUniqueESSymbolType */; } - if (flags & 8192 /* AddUndefined */) { + if (flags & 131072 /* AddUndefined */) { type = getOptionalType(type); } - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { var signature = getSignatureFromDeclaration(signatureDeclaration); - getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); + typeToString(getReturnTypeOfSignature(signature), enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { var type = getWidenedType(getRegularTypeOfExpression(expr)); - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typeToString(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); } function hasGlobalName(name) { return globals.has(ts.escapeLeadingUnderscores(name)); @@ -46786,7 +47796,7 @@ var ts; function isLiteralConstDeclaration(node) { if (ts.isConst(node)) { var type = getTypeOfSymbol(getSymbolOfNode(node)); - return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */); + return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */); } return false; } @@ -46871,7 +47881,7 @@ var ts; // property access can only be used as values // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries - var meaning = (node.kind === 180 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) + var meaning = (node.kind === 183 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) ? 107455 /* Value */ | 1048576 /* ExportValue */ : 793064 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); @@ -46922,7 +47932,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 269 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 272 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -46942,7 +47952,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 269 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 272 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -46973,13 +47983,21 @@ var ts; }); } } + // We do global augmentations seperately from module augmentations (and before creating global types) because they + // 1. Affect global types. We won't have the correct global types until global augmentations are merged. Also, + // 2. Module augmentation instantiation requires creating the type of a module, which, in turn, can require + // checking for an export or property on the module (if export=) which, in turn, can fall back to the + // apparent type of the module - either globalObjectType or globalFunctionType - which wouldn't exist if we + // did module augmentations prior to finalizing the global types. if (augmentations) { - // merge module augmentations. + // merge _global_ module augmentations. // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed for (var _d = 0, augmentations_1 = augmentations; _d < augmentations_1.length; _d++) { var list = augmentations_1[_d]; for (var _e = 0, list_1 = list; _e < list_1.length; _e++) { var augmentation = list_1[_e]; + if (!ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; mergeModuleAugmentation(augmentation); } } @@ -47006,6 +48024,19 @@ var ts; globalReadonlyArrayType = getGlobalTypeOrUndefined("ReadonlyArray", /*arity*/ 1); anyReadonlyArrayType = globalReadonlyArrayType ? createTypeFromGenericGlobalType(globalReadonlyArrayType, [anyType]) : anyArrayType; globalThisType = getGlobalTypeOrUndefined("ThisType", /*arity*/ 1); + if (augmentations) { + // merge _nonglobal_ module augmentations. + // this needs to be done after global symbol table is initialized to make sure that all ambient modules are indexed + for (var _f = 0, augmentations_2 = augmentations; _f < augmentations_2.length; _f++) { + var list = augmentations_2[_f]; + for (var _g = 0, list_2 = list; _g < list_2.length; _g++) { + var augmentation = list_2[_g]; + if (ts.isGlobalScopeAugmentation(augmentation.parent)) + continue; + mergeModuleAugmentation(augmentation); + } + } + } } function checkExternalEmitHelpers(location, helpers) { if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) { @@ -47065,14 +48096,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 152 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 153 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */) { + else if (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -47089,17 +48120,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 131 /* ReadonlyKeyword */) { - if (node.kind === 149 /* PropertySignature */ || node.kind === 151 /* MethodSignature */) { + if (modifier.kind !== 132 /* ReadonlyKeyword */) { + if (node.kind === 150 /* PropertySignature */ || node.kind === 152 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 76 /* ConstKeyword */: - if (node.kind !== 233 /* EnumDeclaration */ && node.parent.kind === 230 /* ClassDeclaration */) { + if (node.kind !== 236 /* EnumDeclaration */ && node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76 /* ConstKeyword */)); } break; @@ -47119,7 +48150,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -47142,10 +48173,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -47154,11 +48185,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */ && node.kind !== 158 /* IndexSignature */ && node.kind !== 147 /* Parameter */) { + else if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */ && node.kind !== 159 /* IndexSignature */ && node.kind !== 148 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -47178,17 +48209,17 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 79 /* DefaultKeyword */: - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -47200,13 +48231,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 235 /* ModuleBlock */) { + else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 238 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -47216,14 +48247,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 230 /* ClassDeclaration */) { - if (node.kind !== 152 /* MethodDeclaration */ && - node.kind !== 150 /* PropertyDeclaration */ && - node.kind !== 154 /* GetAccessor */ && - node.kind !== 155 /* SetAccessor */) { + if (node.kind !== 233 /* ClassDeclaration */) { + if (node.kind !== 153 /* MethodDeclaration */ && + node.kind !== 151 /* PropertyDeclaration */ && + node.kind !== 155 /* GetAccessor */ && + node.kind !== 156 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 230 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 233 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -47242,7 +48273,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -47250,7 +48281,7 @@ var ts; break; } } - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -47265,13 +48296,13 @@ var ts; } return; } - else if ((node.kind === 239 /* ImportDeclaration */ || node.kind === 238 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 242 /* ImportDeclaration */ || node.kind === 241 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -47291,37 +48322,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 234 /* ModuleDeclaration */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 147 /* Parameter */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 237 /* ModuleDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 148 /* Parameter */: return false; default: - if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return false; } switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 120 /* AsyncKeyword */); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 117 /* AbstractKeyword */); - case 231 /* InterfaceDeclaration */: - case 209 /* VariableStatement */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 212 /* VariableStatement */: + case 235 /* TypeAliasDeclaration */: return true; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 76 /* ConstKeyword */); default: ts.Debug.fail(); @@ -47334,10 +48365,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -47350,9 +48381,6 @@ var ts; } } function checkGrammarTypeParameterList(typeParameters, file) { - if (checkGrammarForDisallowedTrailingComma(typeParameters)) { - return true; - } if (typeParameters && typeParameters.length === 0) { var start = typeParameters.pos - "<".length; var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; @@ -47400,15 +48428,13 @@ var ts; return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 188 /* ArrowFunction */) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } + if (!ts.isArrowFunction(node)) { + return false; } - return false; + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -47435,7 +48461,14 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 136 /* StringKeyword */ && parameter.type.kind !== 133 /* NumberKeyword */) { + if (parameter.type.kind !== 137 /* StringKeyword */ && parameter.type.kind !== 134 /* NumberKeyword */) { + var type = getTypeFromTypeNode(parameter.type); + if (type.flags & 2 /* String */ || type.flags & 4 /* Number */) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type))); + } + if (allTypesAssignableToKind(type, 32 /* StringLiteral */, /*strict*/ true)) { + return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead); + } return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); } if (!node.type) { @@ -47462,7 +48495,7 @@ var ts; if (args) { for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; - if (arg.kind === 201 /* OmittedExpression */) { + if (arg.kind === 204 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -47538,19 +48571,19 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 145 /* ComputedPropertyName */) { + if (node.kind !== 146 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 195 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { + if (computedPropertyName.expression.kind === 198 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 229 /* FunctionDeclaration */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 152 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 232 /* FunctionDeclaration */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 153 /* MethodDeclaration */); if (node.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -47575,15 +48608,15 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */) { + if (prop.kind === 270 /* SpreadAssignment */) { continue; } var name = prop.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 266 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 269 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -47592,7 +48625,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 152 /* MethodDeclaration */) { + if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 153 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -47607,21 +48640,21 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { checkGrammarNumericLiteral(name); } // falls through - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: currentKind = 1 /* Property */; break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: currentKind = 2 /* GetAccessor */; break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: currentKind = 4 /* SetAccessor */; break; default: @@ -47657,20 +48690,18 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 259 /* JsxSpreadAttribute */) { + if (attr.kind === 262 /* JsxSpreadAttribute */) { continue; } - var jsxAttr = attr; - var name = jsxAttr.name; + var name = attr.name, initializer = attr.initializer; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 260 /* JsxExpression */ && !initializer.expression) { - return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === 263 /* JsxExpression */ && !initializer.expression) { + return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -47678,12 +48709,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 217 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 220 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); } } - if (forInOrOfStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 231 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -47698,20 +48729,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -47738,11 +48769,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 154 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 155 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 155 /* SetAccessor */) { + else if (kind === 156 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -47765,21 +48796,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 140 /* UniqueKeyword */) { - if (node.type.kind !== 137 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(137 /* SymbolKeyword */)); + if (node.operator === 141 /* UniqueKeyword */) { + if (node.type.kind !== 138 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 71 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -47791,13 +48822,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -47813,17 +48844,24 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === 153 /* MethodDeclaration */) { + if (node.parent.kind === 182 /* ObjectLiteralExpression */) { + // We only disallow modifier on a method declaration if it is a property of object-literal-expression + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120 /* AsyncKeyword */)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } if (ts.isClassLike(node.parent)) { @@ -47835,14 +48873,14 @@ var ts; if (node.flags & 2097152 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === 153 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -47853,11 +48891,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 218 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 221 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -47865,8 +48903,8 @@ var ts; return false; } break; - case 222 /* SwitchStatement */: - if (node.kind === 219 /* BreakStatement */ && !node.label) { + case 225 /* SwitchStatement */: + if (node.kind === 222 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -47881,13 +48919,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -47896,12 +48934,15 @@ var ts; function checkGrammarBindingElement(node) { if (node.dotDotDotToken) { var elements = node.parent.elements; - if (node !== ts.lastOrUndefined(elements)) { + if (node !== ts.last(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 176 /* ArrayBindingPattern */ || node.name.kind === 175 /* ObjectBindingPattern */) { + if (node.name.kind === 179 /* ArrayBindingPattern */ || node.name.kind === 178 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } + if (node.propertyName) { + return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_have_a_property_name); + } if (node.initializer) { // Error on equals token which immediately precedes the initializer return grammarErrorAtPos(node, node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); @@ -47910,11 +48951,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 193 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && + expr.kind === 196 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 216 /* ForInStatement */ && node.parent.parent.kind !== 217 /* ForOfStatement */) { + if (node.parent.parent.kind !== 219 /* ForInStatement */ && node.parent.parent.kind !== 220 /* ForOfStatement */) { if (node.flags & 2097152 /* Ambient */) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -47943,7 +48984,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 209 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 212 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && @@ -48002,15 +49043,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return false; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -48076,7 +49117,7 @@ var ts; return true; } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48084,7 +49125,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48095,7 +49136,7 @@ var ts; if (node.flags & 2097152 /* Ambient */ && node.initializer) { return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); } - if (node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || + if (ts.isPropertyDeclaration(node) && node.exclamationToken && (!ts.isClassLike(node.parent) || !node.type || node.initializer || node.flags & 2097152 /* Ambient */ || ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */))) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } @@ -48113,13 +49154,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 231 /* InterfaceDeclaration */ || - node.kind === 232 /* TypeAliasDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 245 /* ExportDeclaration */ || - node.kind === 244 /* ExportAssignment */ || - node.kind === 237 /* NamespaceExportDeclaration */ || + if (node.kind === 234 /* InterfaceDeclaration */ || + node.kind === 235 /* TypeAliasDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 248 /* ExportDeclaration */ || + node.kind === 247 /* ExportAssignment */ || + node.kind === 240 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -48128,7 +49169,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 209 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 212 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -48154,7 +49195,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 208 /* Block */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 211 /* Block */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -48175,10 +49216,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 174 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 177 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 268 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 271 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -48230,23 +49271,23 @@ var ts; /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: - return true; + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: + return ts.isIdentifier(name); default: return ts.isDeclarationName(name); } } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 240 /* ImportClause */: // For default import - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */:// For rename import `x as y` + case 243 /* ImportClause */: // For default import + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */:// For rename import `x as y` return true; case 71 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 243 /* ImportSpecifier */; + return decl.parent.kind === 246 /* ImportSpecifier */; default: return false; } @@ -48360,7 +49401,7 @@ var ts; var node = createSynthesizedNode(71 /* Identifier */); node.escapedText = ts.escapeLeadingUnderscores(text); node.originalKeywordKind = text ? ts.stringToToken(text) : 0 /* Unknown */; - node.autoGenerateKind = 0 /* None */; + node.autoGenerateFlags = 0 /* None */; node.autoGenerateId = 0; if (typeArguments) { node.typeArguments = createNodeArray(typeArguments); @@ -48375,22 +49416,24 @@ var ts; } ts.updateIdentifier = updateIdentifier; var nextAutoGenerateId = 0; - /** Create a unique temporary variable. */ - function createTempVariable(recordTempVariable) { + function createTempVariable(recordTempVariable, reservedInNestedScopes) { var name = createIdentifier(""); - name.autoGenerateKind = 1 /* Auto */; + name.autoGenerateFlags = 1 /* Auto */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; if (recordTempVariable) { recordTempVariable(name); } + if (reservedInNestedScopes) { + name.autoGenerateFlags |= 16 /* ReservedInNestedScopes */; + } return name; } ts.createTempVariable = createTempVariable; /** Create a unique temporary variable for use in a loop. */ function createLoopVariable() { var name = createIdentifier(""); - name.autoGenerateKind = 2 /* Loop */; + name.autoGenerateFlags = 2 /* Loop */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -48399,7 +49442,7 @@ var ts; /** Create a unique name based on the supplied text. */ function createUniqueName(text) { var name = createIdentifier(text); - name.autoGenerateKind = 3 /* Unique */; + name.autoGenerateFlags = 3 /* Unique */; name.autoGenerateId = nextAutoGenerateId; nextAutoGenerateId++; return name; @@ -48407,10 +49450,12 @@ var ts; ts.createUniqueName = createUniqueName; function getGeneratedNameForNode(node, shouldSkipNameGenerationScope) { var name = createIdentifier(""); - name.autoGenerateKind = 4 /* Node */; + name.autoGenerateFlags = 4 /* Node */; name.autoGenerateId = nextAutoGenerateId; name.original = node; - name.skipNameGenerationScope = !!shouldSkipNameGenerationScope; + if (shouldSkipNameGenerationScope) { + name.autoGenerateFlags |= 8 /* SkipNameGenerationScope */; + } nextAutoGenerateId++; return name; } @@ -48443,7 +49488,7 @@ var ts; ts.createFalse = createFalse; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(144 /* QualifiedName */); + var node = createSynthesizedNode(145 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -48457,7 +49502,7 @@ var ts; } ts.updateQualifiedName = updateQualifiedName; function createComputedPropertyName(expression) { - var node = createSynthesizedNode(145 /* ComputedPropertyName */); + var node = createSynthesizedNode(146 /* ComputedPropertyName */); node.expression = expression; return node; } @@ -48470,7 +49515,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(146 /* TypeParameter */); + var node = createSynthesizedNode(147 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -48486,7 +49531,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(147 /* Parameter */); + var node = createSynthesizedNode(148 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -48510,7 +49555,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(148 /* Decorator */); + var node = createSynthesizedNode(149 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -48523,7 +49568,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(149 /* PropertySignature */); + var node = createSynthesizedNode(150 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -48542,30 +49587,32 @@ var ts; : node; } ts.updatePropertySignature = updatePropertySignature; - function createProperty(decorators, modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(150 /* PropertyDeclaration */); + function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { + var node = createSynthesizedNode(151 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.questionToken = questionToken; + node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined; + node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined; node.type = type; node.initializer = initializer; return node; } ts.createProperty = createProperty; - function updateProperty(node, decorators, modifiers, name, questionToken, type, initializer) { + function updateProperty(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { return node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name - || node.questionToken !== questionToken + || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined) + || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined) || node.type !== type || node.initializer !== initializer - ? updateNode(createProperty(decorators, modifiers, name, questionToken, type, initializer), node) + ? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(151 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(152 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -48582,7 +49629,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(152 /* MethodDeclaration */); + var node = createSynthesizedNode(153 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -48610,7 +49657,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(153 /* Constructor */); + var node = createSynthesizedNode(154 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -48630,7 +49677,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(154 /* GetAccessor */); + var node = createSynthesizedNode(155 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -48653,7 +49700,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(155 /* SetAccessor */); + var node = createSynthesizedNode(156 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -48674,7 +49721,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(156 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(157 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -48682,7 +49729,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(157 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(158 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -48690,7 +49737,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(158 /* IndexSignature */); + var node = createSynthesizedNode(159 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -48708,11 +49755,12 @@ var ts; } ts.updateIndexSignature = updateIndexSignature; /* @internal */ - function createSignatureDeclaration(kind, typeParameters, parameters, type) { + function createSignatureDeclaration(kind, typeParameters, parameters, type, typeArguments) { var node = createSynthesizedNode(kind); node.typeParameters = asNodeArray(typeParameters); node.parameters = asNodeArray(parameters); node.type = type; + node.typeArguments = asNodeArray(typeArguments); return node; } ts.createSignatureDeclaration = createSignatureDeclaration; @@ -48729,7 +49777,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(159 /* TypePredicate */); + var node = createSynthesizedNode(160 /* TypePredicate */); node.parameterName = asName(parameterName); node.type = type; return node; @@ -48743,7 +49791,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(160 /* TypeReference */); + var node = createSynthesizedNode(161 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -48757,7 +49805,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(161 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(162 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -48765,7 +49813,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(162 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(163 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -48773,7 +49821,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(163 /* TypeQuery */); + var node = createSynthesizedNode(164 /* TypeQuery */); node.exprName = exprName; return node; } @@ -48785,7 +49833,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(164 /* TypeLiteral */); + var node = createSynthesizedNode(165 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -48797,7 +49845,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(165 /* ArrayType */); + var node = createSynthesizedNode(166 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -48809,7 +49857,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(166 /* TupleType */); + var node = createSynthesizedNode(167 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -48821,7 +49869,7 @@ var ts; } ts.updateTypleTypeNode = updateTypleTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(167 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(168 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -48829,7 +49877,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(168 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(169 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -48847,8 +49895,38 @@ var ts; ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) : node; } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createSynthesizedNode(170 /* ConditionalType */); + node.checkType = ts.parenthesizeConditionalTypeMember(checkType); + node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); + node.trueType = trueType; + node.falseType = falseType; + return node; + } + ts.createConditionalTypeNode = createConditionalTypeNode; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType + || node.extendsType !== extendsType + || node.trueType !== trueType + || node.falseType !== falseType + ? updateNode(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) + : node; + } + ts.updateConditionalTypeNode = updateConditionalTypeNode; + function createInferTypeNode(typeParameter) { + var node = createSynthesizedNode(171 /* InferType */); + node.typeParameter = typeParameter; + return node; + } + ts.createInferTypeNode = createInferTypeNode; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter + ? updateNode(createInferTypeNode(typeParameter), node) + : node; + } + ts.updateInferTypeNode = updateInferTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(169 /* ParenthesizedType */); + var node = createSynthesizedNode(172 /* ParenthesizedType */); node.type = type; return node; } @@ -48860,12 +49938,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(170 /* ThisType */); + return createSynthesizedNode(173 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(171 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 127 /* KeyOfKeyword */; + var node = createSynthesizedNode(174 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 128 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -48875,7 +49953,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(172 /* IndexedAccessType */); + var node = createSynthesizedNode(175 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -48889,7 +49967,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(173 /* MappedType */); + var node = createSynthesizedNode(176 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -48907,7 +49985,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(174 /* LiteralType */); + var node = createSynthesizedNode(177 /* LiteralType */); node.literal = literal; return node; } @@ -48920,7 +49998,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(175 /* ObjectBindingPattern */); + var node = createSynthesizedNode(178 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -48932,7 +50010,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(176 /* ArrayBindingPattern */); + var node = createSynthesizedNode(179 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -48944,7 +50022,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(177 /* BindingElement */); + var node = createSynthesizedNode(180 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -48963,7 +50041,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(178 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(181 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -48977,7 +50055,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(179 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(182 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -48991,7 +50069,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(180 /* PropertyAccessExpression */); + var node = createSynthesizedNode(183 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -49008,7 +50086,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(181 /* ElementAccessExpression */); + var node = createSynthesizedNode(184 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -49022,7 +50100,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(182 /* CallExpression */); + var node = createSynthesizedNode(185 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -49038,7 +50116,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(183 /* NewExpression */); + var node = createSynthesizedNode(186 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -49054,7 +50132,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, template) { - var node = createSynthesizedNode(184 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(187 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; @@ -49068,7 +50146,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(185 /* TypeAssertionExpression */); + var node = createSynthesizedNode(188 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -49082,7 +50160,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(186 /* ParenthesizedExpression */); + var node = createSynthesizedNode(189 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -49094,7 +50172,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(187 /* FunctionExpression */); + var node = createSynthesizedNode(190 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -49118,7 +50196,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(188 /* ArrowFunction */); + var node = createSynthesizedNode(191 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -49152,7 +50230,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(189 /* DeleteExpression */); + var node = createSynthesizedNode(192 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49164,7 +50242,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(190 /* TypeOfExpression */); + var node = createSynthesizedNode(193 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49176,7 +50254,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(191 /* VoidExpression */); + var node = createSynthesizedNode(194 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49188,7 +50266,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(192 /* AwaitExpression */); + var node = createSynthesizedNode(195 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49200,7 +50278,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(193 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(196 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -49213,7 +50291,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(194 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(197 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -49226,7 +50304,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(195 /* BinaryExpression */); + var node = createSynthesizedNode(198 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -49243,7 +50321,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(196 /* ConditionalExpression */); + var node = createSynthesizedNode(199 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -49273,7 +50351,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(197 /* TemplateExpression */); + var node = createSynthesizedNode(200 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -49311,7 +50389,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(198 /* YieldExpression */); + var node = createSynthesizedNode(201 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -49325,7 +50403,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(199 /* SpreadElement */); + var node = createSynthesizedNode(202 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -49337,7 +50415,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(200 /* ClassExpression */); + var node = createSynthesizedNode(203 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49358,11 +50436,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(201 /* OmittedExpression */); + return createSynthesizedNode(204 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(202 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(205 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -49376,7 +50454,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(203 /* AsExpression */); + var node = createSynthesizedNode(206 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -49390,7 +50468,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(204 /* NonNullExpression */); + var node = createSynthesizedNode(207 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -49402,7 +50480,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(205 /* MetaProperty */); + var node = createSynthesizedNode(208 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -49416,7 +50494,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(206 /* TemplateSpan */); + var node = createSynthesizedNode(209 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -49430,12 +50508,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(207 /* SemicolonClassElement */); + return createSynthesizedNode(210 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(208 /* Block */); + var block = createSynthesizedNode(211 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -49449,7 +50527,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(209 /* VariableStatement */); + var node = createSynthesizedNode(212 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -49464,11 +50542,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(210 /* EmptyStatement */); + return createSynthesizedNode(213 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createStatement(expression) { - var node = createSynthesizedNode(211 /* ExpressionStatement */); + var node = createSynthesizedNode(214 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -49480,7 +50558,7 @@ var ts; } ts.updateStatement = updateStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(212 /* IfStatement */); + var node = createSynthesizedNode(215 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -49496,7 +50574,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(213 /* DoStatement */); + var node = createSynthesizedNode(216 /* DoStatement */); node.statement = statement; node.expression = expression; return node; @@ -49510,7 +50588,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(214 /* WhileStatement */); + var node = createSynthesizedNode(217 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; @@ -49524,7 +50602,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(215 /* ForStatement */); + var node = createSynthesizedNode(218 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -49542,7 +50620,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(216 /* ForInStatement */); + var node = createSynthesizedNode(219 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -49558,7 +50636,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(217 /* ForOfStatement */); + var node = createSynthesizedNode(220 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -49576,7 +50654,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(218 /* ContinueStatement */); + var node = createSynthesizedNode(221 /* ContinueStatement */); node.label = asName(label); return node; } @@ -49588,7 +50666,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(219 /* BreakStatement */); + var node = createSynthesizedNode(222 /* BreakStatement */); node.label = asName(label); return node; } @@ -49600,7 +50678,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(220 /* ReturnStatement */); + var node = createSynthesizedNode(223 /* ReturnStatement */); node.expression = expression; return node; } @@ -49612,7 +50690,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(221 /* WithStatement */); + var node = createSynthesizedNode(224 /* WithStatement */); node.expression = expression; node.statement = statement; return node; @@ -49626,7 +50704,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(222 /* SwitchStatement */); + var node = createSynthesizedNode(225 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -49640,7 +50718,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(223 /* LabeledStatement */); + var node = createSynthesizedNode(226 /* LabeledStatement */); node.label = asName(label); node.statement = statement; return node; @@ -49654,7 +50732,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(224 /* ThrowStatement */); + var node = createSynthesizedNode(227 /* ThrowStatement */); node.expression = expression; return node; } @@ -49666,7 +50744,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(225 /* TryStatement */); + var node = createSynthesizedNode(228 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -49682,11 +50760,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(226 /* DebuggerStatement */); + return createSynthesizedNode(229 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(227 /* VariableDeclaration */); + var node = createSynthesizedNode(230 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -49702,7 +50780,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { - var node = createSynthesizedNode(228 /* VariableDeclarationList */); + var node = createSynthesizedNode(231 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -49715,7 +50793,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(229 /* FunctionDeclaration */); + var node = createSynthesizedNode(232 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -49741,7 +50819,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(230 /* ClassDeclaration */); + var node = createSynthesizedNode(233 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49763,7 +50841,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(231 /* InterfaceDeclaration */); + var node = createSynthesizedNode(234 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49785,7 +50863,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(232 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(235 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49805,7 +50883,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(233 /* EnumDeclaration */); + var node = createSynthesizedNode(236 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49823,7 +50901,7 @@ var ts; } ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { - var node = createSynthesizedNode(234 /* ModuleDeclaration */); + var node = createSynthesizedNode(237 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 512 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -49842,7 +50920,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(235 /* ModuleBlock */); + var node = createSynthesizedNode(238 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -49854,7 +50932,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(236 /* CaseBlock */); + var node = createSynthesizedNode(239 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -49866,7 +50944,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(237 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(240 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -49878,7 +50956,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(238 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(241 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49896,7 +50974,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(239 /* ImportDeclaration */); + var node = createSynthesizedNode(242 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -49914,7 +50992,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(240 /* ImportClause */); + var node = createSynthesizedNode(243 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; @@ -49928,7 +51006,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(241 /* NamespaceImport */); + var node = createSynthesizedNode(244 /* NamespaceImport */); node.name = name; return node; } @@ -49940,7 +51018,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(242 /* NamedImports */); + var node = createSynthesizedNode(245 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -49952,7 +51030,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(243 /* ImportSpecifier */); + var node = createSynthesizedNode(246 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -49966,7 +51044,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(244 /* ExportAssignment */); + var node = createSynthesizedNode(247 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -49983,7 +51061,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(245 /* ExportDeclaration */); + var node = createSynthesizedNode(248 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -50001,7 +51079,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(246 /* NamedExports */); + var node = createSynthesizedNode(249 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -50013,7 +51091,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(247 /* ExportSpecifier */); + var node = createSynthesizedNode(250 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -50028,7 +51106,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(249 /* ExternalModuleReference */); + var node = createSynthesizedNode(252 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -50041,7 +51119,7 @@ var ts; ts.updateExternalModuleReference = updateExternalModuleReference; // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(250 /* JsxElement */); + var node = createSynthesizedNode(253 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -50057,7 +51135,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, attributes) { - var node = createSynthesizedNode(251 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(254 /* JsxSelfClosingElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50071,7 +51149,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, attributes) { - var node = createSynthesizedNode(252 /* JsxOpeningElement */); + var node = createSynthesizedNode(255 /* JsxOpeningElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50085,7 +51163,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(253 /* JsxClosingElement */); + var node = createSynthesizedNode(256 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -50097,7 +51175,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(254 /* JsxFragment */); + var node = createSynthesizedNode(257 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -50113,7 +51191,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(257 /* JsxAttribute */); + var node = createSynthesizedNode(260 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -50127,7 +51205,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(258 /* JsxAttributes */); + var node = createSynthesizedNode(261 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -50139,7 +51217,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(259 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(262 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -50151,7 +51229,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(260 /* JsxExpression */); + var node = createSynthesizedNode(263 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -50165,7 +51243,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(261 /* CaseClause */); + var node = createSynthesizedNode(264 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -50179,7 +51257,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(262 /* DefaultClause */); + var node = createSynthesizedNode(265 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -50191,7 +51269,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(263 /* HeritageClause */); + var node = createSynthesizedNode(266 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -50204,7 +51282,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(264 /* CatchClause */); + var node = createSynthesizedNode(267 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -50219,7 +51297,7 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(265 /* PropertyAssignment */); + var node = createSynthesizedNode(268 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -50234,7 +51312,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(266 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(269 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -50248,7 +51326,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(267 /* SpreadAssignment */); + var node = createSynthesizedNode(270 /* SpreadAssignment */); node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; return node; } @@ -50261,7 +51339,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(268 /* EnumMember */); + var node = createSynthesizedNode(271 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -50277,7 +51355,7 @@ var ts; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createSynthesizedNode(269 /* SourceFile */); + var updated = createSynthesizedNode(272 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -50356,7 +51434,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(291 /* NotEmittedStatement */); + var node = createSynthesizedNode(294 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -50368,7 +51446,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(295 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(298 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50380,7 +51458,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(294 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(297 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50395,7 +51473,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(292 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(295 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -50411,7 +51489,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 293 /* CommaListExpression */) { + if (node.kind === 296 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26 /* CommaToken */) { @@ -50421,7 +51499,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(293 /* CommaListExpression */); + var node = createSynthesizedNode(296 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -50433,7 +51511,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createBundle(sourceFiles) { - var node = ts.createNode(270 /* Bundle */); + var node = ts.createNode(273 /* Bundle */); node.sourceFiles = sourceFiles; return node; } @@ -50569,7 +51647,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -51070,7 +52148,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 223 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 226 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -51088,13 +52166,13 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return false; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -51120,7 +52198,7 @@ var ts; } else { switch (callee.kind) { - case 180 /* PropertyAccessExpression */: { + case 183 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51133,7 +52211,7 @@ var ts; } break; } - case 181 /* ElementAccessExpression */: { + case 184 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51190,14 +52268,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -51521,7 +52599,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 186 /* ParenthesizedExpression */) { + if (skipped.kind === 189 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -51555,8 +52633,8 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(195 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(198 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { @@ -51565,7 +52643,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 198 /* YieldExpression */) { + && operand.kind === 201 /* YieldExpression */) { return false; } return true; @@ -51575,13 +52653,13 @@ var ts; if (isLeftSideOfBinary) { // No need to parenthesize the left operand when the binary operator is // left associative: - // (a*b)/x -> a*b/x - // (a**b)/x -> a**b/x + // (a*b)/x -> a*b/x + // (a**b)/x -> a**b/x // // Parentheses are needed for the left operand when the binary operator is // right associative: - // (a/b)**x -> (a/b)**x - // (a**b)**x -> (a**b)**x + // (a/b)**x -> (a/b)**x + // (a**b)**x -> (a**b)**x return binaryOperatorAssociativity === 1 /* Right */; } else { @@ -51653,7 +52731,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -51668,7 +52746,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(196 /* ConditionalExpression */, 55 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(199 /* ConditionalExpression */, 55 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { @@ -51681,7 +52759,9 @@ var ts; // per ES grammar both 'whenTrue' and 'whenFalse' parts of conditional expression are assignment expressions // so in case when comma expression is introduced as a part of previous transformations // if should be wrapped in parens since comma operator has the lowest precedence - return e.kind === 195 /* BinaryExpression */ && e.operatorToken.kind === 26 /* CommaToken */ + var emittedExpression = ts.skipPartiallyEmittedExpressions(e); + return emittedExpression.kind === 198 /* BinaryExpression */ && emittedExpression.operatorToken.kind === 26 /* CommaToken */ || + emittedExpression.kind === 296 /* CommaListExpression */ ? ts.createParen(e) : e; } @@ -51699,9 +52779,9 @@ var ts; */ function parenthesizeDefaultExpression(e) { var check = ts.skipPartiallyEmittedExpressions(e); - return (check.kind === 200 /* ClassExpression */ || - check.kind === 187 /* FunctionExpression */ || - check.kind === 293 /* CommaListExpression */ || + return (check.kind === 203 /* ClassExpression */ || + check.kind === 190 /* FunctionExpression */ || + check.kind === 296 /* CommaListExpression */ || ts.isBinaryExpression(check) && check.operatorToken.kind === 26 /* CommaToken */) ? ts.createParen(e) : e; @@ -51716,9 +52796,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.createParen(expression); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -51741,7 +52821,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 183 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 186 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -51779,7 +52859,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, 26 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, 26 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -51790,34 +52870,38 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 187 /* FunctionExpression */ || kind === 188 /* ArrowFunction */) { + if (kind === 190 /* FunctionExpression */ || kind === 191 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 179 /* ObjectLiteralExpression */ || leftmostExpressionKind === 187 /* FunctionExpression */) { + if (leftmostExpressionKind === 182 /* ObjectLiteralExpression */ || leftmostExpressionKind === 190 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function parenthesizeConditionalTypeMember(member) { + return member.kind === 170 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + } + ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createParenthesizedType(member); } - return member; + return parenthesizeConditionalTypeMember(member); } ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -51843,25 +52927,25 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: node = node.operand; continue; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: node = node.left; continue; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: node = node.condition; continue; - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: node = node.expression; continue; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -51869,7 +52953,7 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 179 /* ObjectLiteralExpression */) { + if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 182 /* ObjectLiteralExpression */) { return ts.setTextRange(ts.createParen(body), body); } return body; @@ -51885,13 +52969,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 207 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -51916,14 +53000,14 @@ var ts; } ts.skipOuterExpressions = skipOuterExpressions; function skipParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */) { + while (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } return node; } ts.skipParentheses = skipParentheses; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 204 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 207 /* NonNullExpression */) { node = node.expression; } return node; @@ -51931,11 +53015,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 186 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 185 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 203 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 204 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 292 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 189 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 206 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -51953,7 +53037,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 186 /* ParenthesizedExpression */ + return node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -51978,14 +53062,14 @@ var ts; return emitNode && emitNode.externalHelpersModuleName; } ts.getExternalHelpersModuleName = getExternalHelpersModuleName; - function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues) { + function getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) { if (compilerOptions.importHelpers && ts.isEffectiveExternalModule(node, compilerOptions)) { var externalHelpersModuleName = getExternalHelpersModuleName(node); if (externalHelpersModuleName) { return externalHelpersModuleName; } var moduleKind = ts.getEmitModuleKind(compilerOptions); - var create = hasExportStarsToExportValues + var create = (hasExportStarsToExportValues || (compilerOptions.esModuleInterop && hasImportStarOrImportDefault)) && moduleKind !== ts.ModuleKind.System && moduleKind !== ts.ModuleKind.ES2015 && moduleKind !== ts.ModuleKind.ESNext; @@ -52018,10 +53102,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 239 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 242 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 245 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 248 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -52139,7 +53223,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -52151,11 +53235,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -52187,12 +53271,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 148 /* Parameter */: + case 180 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 199 /* SpreadElement */: - case 267 /* SpreadAssignment */: + case 202 /* SpreadElement */: + case 270 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -52204,7 +53288,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -52216,7 +53300,7 @@ var ts; : propertyName; } break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -52228,7 +53312,7 @@ var ts; : propertyName; } break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -52246,13 +53330,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -52292,11 +53376,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -52331,6 +53415,7 @@ var ts; /// var ts; (function (ts) { + var isTypeNodeOrTypeParameterDeclaration = ts.or(ts.isTypeNode, ts.isTypeParameterDeclaration); function visitNode(node, visitor, test, lift) { if (node === undefined || visitor === undefined) { return node; @@ -52459,266 +53544,270 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */) || kind === 170 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */) || kind === 173 /* ThisType */) { return node; } switch (kind) { // Names case 71 /* Identifier */: - return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 144 /* QualifiedName */: + return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); + case 145 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 148 /* Decorator */: + case 149 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 166 /* TupleType */: + case 167 /* TupleType */: return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 167 /* UnionType */: + case 168 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); + case 171 /* InferType */: + return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); + case 172 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 173 /* MappedType */: + case 176 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 208 /* Block */: + case 211 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 217 /* ForOfStatement */: - return ts.updateForOf(node, node.awaitModifier, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 218 /* ContinueStatement */: + case 220 /* ForOfStatement */: + return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); + case 221 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -52760,58 +53849,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 159 /* TypePredicate */ && kind <= 174 /* LiteralType */)) { + if ((kind >= 160 /* TypePredicate */ && kind <= 177 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 207 /* SemicolonClassElement */: - case 210 /* EmptyStatement */: - case 201 /* OmittedExpression */: - case 226 /* DebuggerStatement */: - case 291 /* NotEmittedStatement */: + case 210 /* SemicolonClassElement */: + case 213 /* EmptyStatement */: + case 204 /* OmittedExpression */: + case 229 /* DebuggerStatement */: + case 294 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 147 /* Parameter */: + case 148 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 148 /* Decorator */: + case 149 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -52820,12 +53909,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 153 /* Constructor */: + case 154 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -52833,7 +53922,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -52841,49 +53930,49 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 183 /* NewExpression */: + case 186 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -52891,123 +53980,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 186 /* ParenthesizedExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: - case 204 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 203 /* AsExpression */: + case 206 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 208 /* Block */: + case 211 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 214 /* WhileStatement */: - case 221 /* WithStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53016,7 +54105,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53024,139 +54113,139 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 264 /* CatchClause */: + case 267 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -53229,7 +54318,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 202 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 205 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -53320,6 +54409,34 @@ var ts; return node ? ts.getNodeId(node) : 0; } ts.getOriginalNodeId = getOriginalNodeId; + function getNamedImportCount(node) { + if (!(node.importClause && node.importClause.namedBindings)) + return 0; + var names = node.importClause.namedBindings; + if (!names) + return 0; + if (!ts.isNamedImports(names)) + return 0; + return names.elements.length; + } + function containsDefaultReference(node) { + if (!node) + return false; + if (!ts.isNamedImports(node)) + return false; + return ts.some(node.elements, isNamedDefaultReference); + } + function isNamedDefaultReference(e) { + return e.propertyName && e.propertyName.escapedText === "default" /* Default */; + } + function getImportNeedsImportStarHelper(node) { + return !!ts.getNamespaceDeclarationNode(node) || (getNamedImportCount(node) > 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportStarHelper = getImportNeedsImportStarHelper; + function getImportNeedsImportDefaultHelper(node) { + return ts.isDefaultImport(node) || (getNamedImportCount(node) === 1 && containsDefaultReference(node.importClause.namedBindings)); + } + ts.getImportNeedsImportDefaultHelper = getImportNeedsImportDefaultHelper; function collectExternalModuleInfo(sourceFile, resolver, compilerOptions) { var externalImports = []; var exportSpecifiers = ts.createMultiMap(); @@ -53329,23 +54446,25 @@ var ts; var hasExportDefault = false; var exportEquals = undefined; var hasExportStarsToExportValues = false; + var hasImportStarOrImportDefault = false; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" // import { x, y } from "mod" externalImports.push(node); + hasImportStarOrImportDefault = getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 238 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + case 241 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -53375,13 +54494,13 @@ var ts; } } break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -53389,7 +54508,7 @@ var ts; } } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -53409,7 +54528,7 @@ var ts; } } break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -53431,11 +54550,12 @@ var ts; break; } } - var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues); + var externalHelpersModuleName = ts.getOrCreateExternalHelpersModuleNameIfNeeded(sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault); var externalHelpersImportDeclaration = externalHelpersModuleName && ts.createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); if (externalHelpersImportDeclaration) { + ts.addEmitFlags(externalHelpersImportDeclaration, 67108864 /* NeverApplyImportHelper */); externalImports.unshift(externalHelpersImportDeclaration); } return { externalImports: externalImports, exportSpecifiers: exportSpecifiers, exportEquals: exportEquals, hasExportStarsToExportValues: hasExportStarsToExportValues, exportedBindings: exportedBindings, exportedNames: exportedNames, externalHelpersImportDeclaration: externalHelpersImportDeclaration }; @@ -53476,9 +54596,8 @@ var ts; * - this is mostly subjective beyond the requirement that the expression not be sideeffecting */ function isSimpleCopiableExpression(expression) { - return expression.kind === 9 /* StringLiteral */ || + return ts.isStringLiteralLike(expression) || expression.kind === 8 /* NumericLiteral */ || - expression.kind === 13 /* NoSubstitutionTemplateLiteral */ || ts.isKeyword(expression.kind) || ts.isIdentifier(expression); } @@ -53535,7 +54654,12 @@ var ts; }; if (value) { value = ts.visitNode(value, visitor, ts.isExpression); - if (needsValue) { + if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText)) { + // If the right-hand value of the assignment is also an assignment target then + // we need to cache the right-hand value. + value = ensureIdentifier(flattenContext, value, /*reuseIdentifierExpressions*/ false, location); + } + else if (needsValue) { // If the right-hand value of the destructuring assignment needs to be preserved (as // is the case when the destructuring assignment is part of a larger expression), // then we need to cache the right-hand value. @@ -53579,6 +54703,26 @@ var ts; } } ts.flattenDestructuringAssignment = flattenDestructuringAssignment; + function bindingOrAssignmentElementAssignsToName(element, escapedName) { + var target = ts.getTargetOfBindingOrAssignmentElement(element); + if (ts.isBindingOrAssignmentPattern(target)) { + return bindingOrAssignmentPatternAssignsToName(target, escapedName); + } + else if (ts.isIdentifier(target)) { + return target.escapedText === escapedName; + } + return false; + } + function bindingOrAssignmentPatternAssignsToName(pattern, escapedName) { + var elements = ts.getElementsOfBindingOrAssignmentPattern(pattern); + for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { + var element = elements_3[_i]; + if (bindingOrAssignmentElementAssignsToName(element, escapedName)) { + return true; + } + } + return false; + } /** * Flattens a VariableDeclaration or ParameterDeclaration to one or more variable declarations. * @@ -53606,6 +54750,15 @@ var ts; createArrayBindingOrAssignmentElement: makeBindingElement, visitor: visitor }; + if (ts.isVariableDeclaration(node)) { + var initializer = ts.getInitializerOfBindingOrAssignmentElement(node); + if (initializer && ts.isIdentifier(initializer) && bindingOrAssignmentElementAssignsToName(node, initializer.escapedText)) { + // If the right-hand value of the assignment is also an assignment target then + // we need to cache the right-hand value. + initializer = ensureIdentifier(flattenContext, initializer, /*reuseIdentifierExpressions*/ false, initializer); + node = ts.updateVariableDeclaration(node, node.name, node.type, initializer); + } + } flattenBindingOrAssignmentElement(flattenContext, node, rval, node, skipInitializer); if (pendingExpressions) { var temp = ts.createTempVariable(/*recordTempVariable*/ undefined); @@ -53975,8 +55128,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -53994,7 +55147,7 @@ var ts; */ var classAliases; /** - * Keeps track of whether we are within any containing namespaces when performing + * Keeps track of whether we are within any containing namespaces when performing * just-in-time substitution while printing an expression identifier. */ var applicableSubstitutions; @@ -54045,15 +55198,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 235 /* ModuleBlock */: - case 208 /* Block */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 238 /* ModuleBlock */: + case 211 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 230 /* ClassDeclaration */: - case 229 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -54065,7 +55218,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 230 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 233 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } break; } @@ -54109,10 +55262,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -54133,13 +55286,13 @@ var ts; return node; } switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -54159,11 +55312,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 245 /* ExportDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 240 /* ImportClause */ || - (node.kind === 238 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 249 /* ExternalModuleReference */)) { + if (node.kind === 248 /* ExportDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 243 /* ImportClause */ || + (node.kind === 241 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 252 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -54193,19 +55346,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 150 /* PropertyDeclaration */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -54243,53 +55396,54 @@ var ts; case 117 /* AbstractKeyword */: case 76 /* ConstKeyword */: case 124 /* DeclareKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 164 /* TypeLiteral */: - case 159 /* TypePredicate */: - case 146 /* TypeParameter */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 165 /* TypeLiteral */: + case 160 /* TypePredicate */: + case 147 /* TypeParameter */: case 119 /* AnyKeyword */: case 122 /* BooleanKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: case 105 /* VoidKeyword */: - case 137 /* SymbolKeyword */: - case 162 /* ConstructorType */: - case 161 /* FunctionType */: - case 163 /* TypeQuery */: - case 160 /* TypeReference */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: + case 138 /* SymbolKeyword */: + case 163 /* ConstructorType */: + case 162 /* FunctionType */: + case 164 /* TypeQuery */: + case 161 /* TypeReference */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 172 /* ParenthesizedType */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: // TypeScript type nodes are elided. - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // TypeScript index signatures are elided. - case 148 /* Decorator */: + case 149 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructor(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54300,7 +55454,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54311,35 +55465,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -54349,33 +55503,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -54691,11 +55845,14 @@ var ts; ts.setTextRange(classExpression, node); if (ts.some(staticProperties) || ts.some(pendingExpressions)) { var expressions = []; - var temp = ts.createTempVariable(hoistVariableDeclaration); - if (resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */) { + var isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 8388608 /* ClassWithConstructorReference */; + var temp = ts.createTempVariable(hoistVariableDeclaration, !!isClassWithConstructorReference); + if (isClassWithConstructorReference) { // record an alias as the class name is not in scope for statics. enableSubstitutionForClassAliases(); - classAliases[ts.getOriginalNodeId(node)] = ts.getSynthesizedClone(temp); + var alias = ts.getSynthesizedClone(temp); + alias.autoGenerateFlags &= ~16 /* ReservedInNestedScopes */; + classAliases[ts.getOriginalNodeId(node)] = alias; } // To preserve the behavior of the old emitter, we explicitly indent // the body of a class with static initializers. @@ -54854,7 +56011,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -54925,7 +56082,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 150 /* PropertyDeclaration */ + return member.kind === 151 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -55063,12 +56220,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -55221,7 +56378,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 150 /* PropertyDeclaration */ + ? member.kind === 151 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -55344,10 +56501,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 150 /* PropertyDeclaration */; + return kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 151 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -55357,7 +56514,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -55368,12 +56525,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; } return false; @@ -55385,15 +56542,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: - case 154 /* GetAccessor */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 155 /* GetAccessor */: return serializeTypeNode(node.type); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 153 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -55430,7 +56587,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 154 /* GetAccessor */) { + if (container && node.kind === 155 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -55476,26 +56633,26 @@ var ts; } switch (node.kind) { case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return ts.createVoidZero(); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createIdentifier("Function"); - case 165 /* ArrayType */: - case 166 /* TupleType */: + case 166 /* ArrayType */: + case 167 /* TupleType */: return ts.createIdentifier("Array"); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: case 122 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return ts.createIdentifier("String"); - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 174 /* LiteralType */: + case 177 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); @@ -55509,24 +56666,24 @@ var ts; break; } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return serializeTypeReferenceNode(node); - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: return serializeUnionOrIntersectionType(node); - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 164 /* TypeLiteral */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 165 /* TypeLiteral */: case 119 /* AnyKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -55540,13 +56697,13 @@ var ts; var serializedUnion; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -55627,7 +56784,7 @@ var ts; return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } return name; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -56202,12 +57359,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentScope.kind === 269 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentScope.kind === 272 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 233 /* EnumDeclaration */) { + if (node.kind === 236 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -56326,7 +57483,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 235 /* ModuleBlock */) { + if (body.kind === 238 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -56372,13 +57529,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 235 /* ModuleBlock */) { + if (body.kind !== 238 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -56419,7 +57576,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 241 /* NamespaceImport */) { + if (node.kind === 244 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -56651,16 +57808,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(71 /* Identifier */); - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(234 /* ModuleDeclaration */); + context.enableEmitNotification(237 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 234 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 237 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 233 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 236 /* EnumDeclaration */; } /** * Hook for node emit. @@ -56721,9 +57878,9 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -56761,9 +57918,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 269 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 234 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 233 /* EnumDeclaration */); + if (container && container.kind !== 272 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 237 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 236 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -56798,9 +57955,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } ts.transformTypeScript = transformTypeScript; @@ -56864,7 +58019,7 @@ var ts; ES2017SubstitutionFlags[ES2017SubstitutionFlags["AsyncMethodsWithSuper"] = 1] = "AsyncMethodsWithSuper"; })(ES2017SubstitutionFlags || (ES2017SubstitutionFlags = {})); function transformES2017(context) { - var startLexicalEnvironment = context.startLexicalEnvironment, resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment; + var resumeLexicalEnvironment = context.resumeLexicalEnvironment, endLexicalEnvironment = context.endLexicalEnvironment, hoistVariableDeclaration = context.hoistVariableDeclaration; var resolver = context.getEmitResolver(); var compilerOptions = context.getCompilerOptions(); var languageVersion = ts.getEmitScriptTarget(compilerOptions); @@ -56878,6 +58033,7 @@ var ts; * just-in-time substitution for `super` expressions inside of async methods. */ var enclosingSuperContainerFlags = 0; + var enclosingFunctionParameterNames; // Save the previous transformation hooks. var previousOnEmitNode = context.onEmitNode; var previousOnSubstituteNode = context.onSubstituteNode; @@ -56901,20 +58057,97 @@ var ts; case 120 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); default: return ts.visitEachChild(node, visitor, context); } } + function asyncBodyVisitor(node) { + if (ts.isNodeWithPossibleHoistedDeclaration(node)) { + switch (node.kind) { + case 212 /* VariableStatement */: + return visitVariableStatementInAsyncBody(node); + case 218 /* ForStatement */: + return visitForStatementInAsyncBody(node); + case 219 /* ForInStatement */: + return visitForInStatementInAsyncBody(node); + case 220 /* ForOfStatement */: + return visitForOfStatementInAsyncBody(node); + case 267 /* CatchClause */: + return visitCatchClauseInAsyncBody(node); + case 211 /* Block */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 224 /* WithStatement */: + case 226 /* LabeledStatement */: + return ts.visitEachChild(node, asyncBodyVisitor, context); + default: + return ts.Debug.assertNever(node, "Unhandled node."); + } + } + return visitor(node); + } + function visitCatchClauseInAsyncBody(node) { + var catchClauseNames = ts.createUnderscoreEscapedMap(); + recordDeclarationName(node.variableDeclaration, catchClauseNames); + // names declared in a catch variable are block scoped + var catchClauseUnshadowedNames; + catchClauseNames.forEach(function (_, escapedName) { + if (enclosingFunctionParameterNames.has(escapedName)) { + if (!catchClauseUnshadowedNames) { + catchClauseUnshadowedNames = ts.cloneMap(enclosingFunctionParameterNames); + } + catchClauseUnshadowedNames.delete(escapedName); + } + }); + if (catchClauseUnshadowedNames) { + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = catchClauseUnshadowedNames; + var result = ts.visitEachChild(node, asyncBodyVisitor, context); + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; + } + else { + return ts.visitEachChild(node, asyncBodyVisitor, context); + } + } + function visitVariableStatementInAsyncBody(node) { + if (isVariableDeclarationListWithCollidingName(node.declarationList)) { + var expression = visitVariableDeclarationListWithCollidingNames(node.declarationList, /*hasReceiver*/ false); + return expression ? ts.createStatement(expression) : undefined; + } + return ts.visitEachChild(node, visitor, context); + } + function visitForInStatementInAsyncBody(node) { + return ts.updateForIn(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForOfStatementInAsyncBody(node) { + return ts.updateForOf(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } + function visitForStatementInAsyncBody(node) { + return ts.updateFor(node, isVariableDeclarationListWithCollidingName(node.initializer) + ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ false) + : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.condition, visitor, ts.isExpression), ts.visitNode(node.incrementor, visitor, ts.isExpression), ts.visitNode(node.statement, asyncBodyVisitor, ts.isStatement, ts.liftToBlock)); + } /** * Visits an AwaitExpression node. * @@ -56989,22 +58222,96 @@ var ts; ? transformAsyncFunctionBody(node) : ts.visitFunctionBody(node.body, visitor, context)); } + function recordDeclarationName(_a, names) { + var name = _a.name; + if (ts.isIdentifier(name)) { + names.set(name.escapedText, true); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + recordDeclarationName(element, names); + } + } + } + } + function isVariableDeclarationListWithCollidingName(node) { + return node + && ts.isVariableDeclarationList(node) + && !(node.flags & 3 /* BlockScoped */) + && ts.forEach(node.declarations, collidesWithParameterName); + } + function visitVariableDeclarationListWithCollidingNames(node, hasReceiver) { + hoistVariableDeclarationList(node); + var variables = ts.getInitializedVariables(node); + if (variables.length === 0) { + if (hasReceiver) { + return ts.visitNode(ts.convertToAssignmentElementTarget(node.declarations[0].name), visitor, ts.isExpression); + } + return undefined; + } + return ts.inlineExpressions(ts.map(variables, transformInitializedVariable)); + } + function hoistVariableDeclarationList(node) { + ts.forEach(node.declarations, hoistVariable); + } + function hoistVariable(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + hoistVariableDeclaration(name); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element)) { + hoistVariable(element); + } + } + } + } + function transformInitializedVariable(node) { + var converted = ts.setSourceMapRange(ts.createAssignment(ts.convertToAssignmentElementTarget(node.name), node.initializer), node); + return ts.visitNode(converted, visitor, ts.isExpression); + } + function collidesWithParameterName(_a) { + var name = _a.name; + if (ts.isIdentifier(name)) { + return enclosingFunctionParameterNames.has(name.escapedText); + } + else { + for (var _i = 0, _b = name.elements; _i < _b.length; _i++) { + var element = _b[_i]; + if (!ts.isOmittedExpression(element) && collidesWithParameterName(element)) { + return true; + } + } + } + return false; + } function transformAsyncFunctionBody(node) { resumeLexicalEnvironment(); var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 188 /* ArrowFunction */; + var isArrowFunction = node.kind === 191 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current // `this` and `arguments` objects to `__awaiter`. The generator function // passed to `__awaiter` is executed inside of the callback to the // promise constructor. + var savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames; + enclosingFunctionParameterNames = ts.createUnderscoreEscapedMap(); + for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { + var parameter = _a[_i]; + recordDeclarationName(parameter, enclosingFunctionParameterNames); + } + var result; if (!isArrowFunction) { var statements = []; var statementOffset = ts.addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor); - statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body, statementOffset)))); + statements.push(ts.createReturn(createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body, statementOffset)))); ts.addRange(statements, endLexicalEnvironment()); var block = ts.createBlock(statements, /*multiLine*/ true); ts.setTextRange(block, node.body); @@ -57020,27 +58327,28 @@ var ts; ts.addEmitHelper(block, ts.asyncSuperHelper); } } - return block; + result = block; } else { - var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformFunctionBodyWorker(node.body)); + var expression = createAwaiterHelper(context, hasLexicalArguments, promiseConstructor, transformAsyncFunctionBodyWorker(node.body)); var declarations = endLexicalEnvironment(); if (ts.some(declarations)) { var block = ts.convertToFunctionBody(expression); - return ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + result = ts.updateBlock(block, ts.setTextRange(ts.createNodeArray(ts.concatenate(block.statements, declarations)), block.statements)); + } + else { + result = expression; } - return expression; } + enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames; + return result; } - function transformFunctionBodyWorker(body, start) { + function transformAsyncFunctionBodyWorker(body, start) { if (ts.isBlock(body)) { - return ts.updateBlock(body, ts.visitLexicalEnvironment(body.statements, visitor, context, start)); + return ts.updateBlock(body, ts.visitNodes(body.statements, asyncBodyVisitor, ts.isStatement, start)); } else { - startLexicalEnvironment(); - var visited = ts.convertToFunctionBody(ts.visitNode(body, visitor, ts.isConciseBody)); - var declarations = endLexicalEnvironment(); - return ts.updateBlock(visited, ts.setTextRange(ts.createNodeArray(ts.concatenate(visited.statements, declarations)), visited.statements)); + return ts.convertToFunctionBody(ts.visitNode(body, asyncBodyVisitor, ts.isConciseBody)); } } function getPromiseConstructor(type) { @@ -57059,15 +58367,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -57107,11 +58415,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -57143,11 +58451,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -57245,45 +58553,45 @@ var ts; return node; } switch (node.kind) { - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitVoidExpression(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructorDeclaration(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -57304,21 +58612,21 @@ var ts; return ts.visitEachChild(node, visitor, context); } function visitLabeledStatement(node) { - if (enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */) { + if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 217 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 220 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } - return ts.restoreEnclosingLabel(ts.visitEachChild(node, visitor, context), node); + return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); } return ts.visitEachChild(node, visitor, context); } function chunkObjectLiteralElements(elements) { var chunkObject; var objects = []; - for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) { - var e = elements_3[_i]; - if (e.kind === 267 /* SpreadAssignment */) { + for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { + var e = elements_4[_i]; + if (e.kind === 270 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -57327,16 +58635,9 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === 265 /* PropertyAssignment */) { - var p = e; - chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); - } - else { - chunkObject.push(ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); - } + chunkObject = ts.append(chunkObject, e.kind === 268 /* PropertyAssignment */ + ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) + : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } } if (chunkObject) { @@ -57352,7 +58653,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 179 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 182 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -57660,15 +58961,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -57708,11 +59009,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -57744,11 +59045,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -57818,7 +59119,7 @@ var ts; var asyncValues = { name: "typescript:asyncValues", scoped: false, - text: "\n var __asyncValues = (this && this.__asyncIterator) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " + text: "\n var __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator];\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\n };\n " }; function createAsyncValuesHelper(context, expression, location) { context.requestEmitHelper(asyncValues); @@ -57860,13 +59161,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -57876,13 +59177,13 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -57956,7 +59257,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 260 /* JsxExpression */) { + else if (node.kind === 263 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -58050,7 +59351,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 250 /* JsxElement */) { + if (node.kind === 253 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -58358,7 +59659,7 @@ var ts; return node; } switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -58594,13 +59895,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ - && node.kind === 220 /* ReturnStatement */ + && node.kind === 223 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 208 /* Block */))) + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 211 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -58628,63 +59929,63 @@ var ts; switch (node.kind) { case 115 /* StaticKeyword */: return undefined; // elide static keyword - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return visitClassExpression(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); case 71 /* Identifier */: return visitIdentifier(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 13 /* NoSubstitutionTemplateLiteral */: case 14 /* TemplateHead */: @@ -58695,28 +59996,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitSpreadElement(node); case 97 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 99 /* ThisKeyword */: return visitThisKeyword(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitMetaProperty(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -58803,13 +60104,13 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 219 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 222 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -58820,7 +60121,7 @@ var ts; } } else { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { labelMarker = "break-" + node.label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(node.label), labelMarker); } @@ -59001,7 +60302,7 @@ var ts; */ function addExtendsHelperIfNeeded(statements, node, extendsClauseElement) { if (extendsClauseElement) { - statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getLocalName(node))), + statements.push(ts.setTextRange(ts.createStatement(createExtendsHelper(context, ts.getInternalName(node))), /*location*/ extendsClauseElement)); } } @@ -59120,17 +60421,17 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 220 /* ReturnStatement */) { + if (statement.kind === 223 /* ReturnStatement */) { return true; } - else if (statement.kind === 212 /* IfStatement */) { + else if (statement.kind === 215 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 208 /* Block */) { + else if (statement.kind === 211 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -59188,7 +60489,7 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + if (firstStatement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } @@ -59198,8 +60499,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 195 /* BinaryExpression */ - || superCallExpression.left.kind !== 182 /* CallExpression */) { + if (superCallExpression.kind !== 198 /* BinaryExpression */ + || superCallExpression.left.kind !== 185 /* CallExpression */) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } // Shift comments from the original super call to the return statement. @@ -59396,7 +60697,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 188 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 191 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -59416,22 +60717,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return statements; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 93 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -59463,20 +60764,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -59668,7 +60969,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 229 /* FunctionDeclaration */ || node.kind === 187 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 232 /* FunctionDeclaration */ || node.kind === 190 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); @@ -59716,7 +61017,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 188 /* ArrowFunction */); + ts.Debug.assert(node.kind === 191 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -59783,9 +61084,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -59804,9 +61105,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -60008,14 +61309,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -60185,7 +61486,7 @@ var ts; ])); } /** - * Visits an ObjectLiteralExpression with computed propety names. + * Visits an ObjectLiteralExpression with computed property names. * * @param node An ObjectLiteralExpression node. */ @@ -60203,7 +61504,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 145 /* ComputedPropertyName */) { + if (property.name.kind === 146 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -60275,11 +61576,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 231 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -60559,20 +61860,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -60682,7 +61983,7 @@ var ts; if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */) { var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -60860,49 +62161,54 @@ var ts; function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) { // We are here either because SuperKeyword was used somewhere in the expression, or // because we contain a SpreadElementExpression. - var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; - if (node.expression.kind === 97 /* SuperKeyword */) { - ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); + if (node.transformFlags & 524288 /* ContainsSpread */ || + node.expression.kind === 97 /* SuperKeyword */ || + ts.isSuperProperty(ts.skipOuterExpressions(node.expression))) { + var _a = ts.createCallBinding(node.expression, hoistVariableDeclaration), target = _a.target, thisArg = _a.thisArg; + if (node.expression.kind === 97 /* SuperKeyword */) { + ts.setEmitFlags(thisArg, 4 /* NoSubstitution */); + } + var resultingCall = void 0; + if (node.transformFlags & 524288 /* ContainsSpread */) { + // [source] + // f(...a, b) + // x.m(...a, b) + // super(...a, b) + // super.m(...a, b) // in static + // super.m(...a, b) // in instance + // + // [output] + // f.apply(void 0, a.concat([b])) + // (_a = x).m.apply(_a, a.concat([b])) + // _super.apply(this, a.concat([b])) + // _super.m.apply(this, a.concat([b])) + // _super.prototype.m.apply(this, a.concat([b])) + resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); + } + else { + // [source] + // super(a) + // super.m(a) // in static + // super.m(a) // in instance + // + // [output] + // _super.call(this, a) + // _super.m.call(this, a) + // _super.prototype.m.call(this, a) + resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), + /*location*/ node); + } + if (node.expression.kind === 97 /* SuperKeyword */) { + var actualThis = ts.createThis(); + ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); + var initializer = ts.createLogicalOr(resultingCall, actualThis); + resultingCall = assignToCapturedThis + ? ts.createAssignment(ts.createIdentifier("_this"), initializer) + : initializer; + } + return ts.setOriginalNode(resultingCall, node); } - var resultingCall; - if (node.transformFlags & 524288 /* ContainsSpread */) { - // [source] - // f(...a, b) - // x.m(...a, b) - // super(...a, b) - // super.m(...a, b) // in static - // super.m(...a, b) // in instance - // - // [output] - // f.apply(void 0, a.concat([b])) - // (_a = x).m.apply(_a, a.concat([b])) - // _super.apply(this, a.concat([b])) - // _super.m.apply(this, a.concat([b])) - // _super.prototype.m.apply(this, a.concat([b])) - resultingCall = ts.createFunctionApply(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), transformAndSpreadElements(node.arguments, /*needsUniqueCopy*/ false, /*multiLine*/ false, /*hasTrailingComma*/ false)); - } - else { - // [source] - // super(a) - // super.m(a) // in static - // super.m(a) // in instance - // - // [output] - // _super.call(this, a) - // _super.m.call(this, a) - // _super.prototype.m.call(this, a) - resultingCall = ts.createFunctionCall(ts.visitNode(target, callExpressionVisitor, ts.isExpression), ts.visitNode(thisArg, visitor, ts.isExpression), ts.visitNodes(node.arguments, visitor, ts.isExpression), - /*location*/ node); - } - if (node.expression.kind === 97 /* SuperKeyword */) { - var actualThis = ts.createThis(); - ts.setEmitFlags(actualThis, 4 /* NoSubstitution */); - var initializer = ts.createLogicalOr(resultingCall, actualThis); - resultingCall = assignToCapturedThis - ? ts.createAssignment(ts.createIdentifier("_this"), initializer) - : initializer; - } - return ts.setOriginalNode(resultingCall, node); + return ts.visitEachChild(node, visitor, context); } /** * Visits a NewExpression that contains a spread element. @@ -60957,7 +62263,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 178 /* ArrayLiteralExpression */ + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 181 /* ArrayLiteralExpression */ ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -61220,13 +62526,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(99 /* ThisKeyword */); - context.enableEmitNotification(153 /* Constructor */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(188 /* ArrowFunction */); - context.enableEmitNotification(187 /* FunctionExpression */); - context.enableEmitNotification(229 /* FunctionDeclaration */); + context.enableEmitNotification(154 /* Constructor */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(191 /* ArrowFunction */); + context.enableEmitNotification(190 /* FunctionExpression */); + context.enableEmitNotification(232 /* FunctionDeclaration */); } } /** @@ -61268,10 +62574,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 230 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -61353,11 +62659,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 211 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 214 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 182 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 185 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -61365,7 +62671,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 199 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 202 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -61420,15 +62726,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(252 /* JsxOpeningElement */); - context.enableEmitNotification(253 /* JsxClosingElement */); - context.enableEmitNotification(251 /* JsxSelfClosingElement */); + context.enableEmitNotification(255 /* JsxOpeningElement */); + context.enableEmitNotification(256 /* JsxClosingElement */); + context.enableEmitNotification(254 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(265 /* PropertyAssignment */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(268 /* PropertyAssignment */); return transformSourceFile; /** * Transforms an ES5 source file to ES3. @@ -61447,9 +62753,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -61782,13 +63088,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -61801,24 +63107,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return visitBreakStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return visitContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -61839,21 +63145,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitConditionalExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -61866,9 +63172,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -62096,7 +63402,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -62108,7 +63414,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -62484,35 +63790,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 208 /* Block */: + case 211 /* Block */: return transformAndEmitBlock(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return transformAndEmitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return transformAndEmitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return transformAndEmitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return transformAndEmitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -62942,7 +64248,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 262 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 265 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -62955,13 +64261,12 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 261 /* CaseClause */) { - var caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (clause.kind === 264 /* CaseClause */) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } - pendingClauses.push(ts.createCaseClause(ts.visitNode(caseClause.expression, visitor, ts.isExpression), [ - createInlineBreak(clauseLabels[i], /*location*/ caseClause.expression) + pendingClauses.push(ts.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [ + createInlineBreak(clauseLabels[i], /*location*/ clause.expression) ])); } else { @@ -64101,8 +65406,8 @@ var ts; // `throw` methods that step through the generator when invoked. // // parameters: - // thisArg The value to use as the `this` binding for the transformed generator body. - // body A function that acts as the transformed generator body. + // @param thisArg The value to use as the `this` binding for the transformed generator body. + // @param body A function that acts as the transformed generator body. // // variables: // _ Persistent state for the generator that is shared between the helper and the @@ -64186,11 +65491,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -64282,7 +65587,7 @@ var ts; // Create an updated SourceFile: // // define(moduleName?, ["module1", "module2"], function ... - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(define, /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([ // Add the dependency array argument: @@ -64307,6 +65612,8 @@ var ts; ]))) ]), /*location*/ node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } /** * Transforms a SourceFile into a UMD module. @@ -64357,7 +65664,7 @@ var ts; // define(["require", "exports"], factory); // } // })(function ...) - return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ + var updated = ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([ ts.createStatement(ts.createCall(umdHeader, /*typeArguments*/ undefined, [ // Add the module body function argument: @@ -64375,6 +65682,8 @@ var ts; ])) ]), /*location*/ node.statements)); + ts.addEmitHelpers(updated, context.readEmitHelpers()); + return updated; } /** * Collect the additional asynchronous dependencies for the module. @@ -64426,6 +65735,17 @@ var ts; } return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames }; } + function getAMDImportExpressionForImport(node) { + if (ts.isImportEqualsDeclaration(node) || ts.isExportDeclaration(node) || !ts.getExternalModuleNameLiteral(node, currentSourceFile, host, resolver, compilerOptions)) { + return undefined; + } + var name = ts.getLocalNameForExternalImport(node, currentSourceFile); + var expr = getHelperExpressionForImport(node, name); + if (expr === name) { + return undefined; + } + return ts.createStatement(ts.createAssignment(name, expr)); + } /** * Transforms a SourceFile into an AMD or UMD module body. * @@ -64440,6 +65760,9 @@ var ts; } // Visit each statement of the module body. ts.append(statements, ts.visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, ts.isStatement)); + if (moduleKind === ts.ModuleKind.AMD) { + ts.addRange(statements, ts.mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport)); + } ts.addRange(statements, ts.visitNodes(node.statements, sourceElementVisitor, ts.isStatement, statementOffset)); // Append the 'export =' statement if provided. addExportEqualsIfNeeded(statements, /*emitAsReturn*/ true); @@ -64494,23 +65817,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, importCallExpressionVisitor, context); @@ -64611,7 +65934,12 @@ var ts; ts.setEmitFlags(func, 8 /* CapturesThis */); } } - return ts.createNew(ts.createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); + var promise = ts.createNew(ts.createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.createPropertyAccess(promise, ts.createIdentifier("then")), /*typeArguments*/ undefined, [ts.getHelperName("__importStar")]); + } + return promise; } function createImportCallExpressionCommonJS(arg, containsLexicalThis) { // import("./blah") @@ -64621,6 +65949,10 @@ var ts; // if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately var promiseResolveCall = ts.createCall(ts.createPropertyAccess(ts.createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []); var requireCall = ts.createCall(ts.createIdentifier("require"), /*typeArguments*/ undefined, arg ? [arg] : []); + if (compilerOptions.esModuleInterop) { + context.requestEmitHelper(importStarHelper); + requireCall = ts.createCall(ts.getHelperName("__importStar"), /*typeArguments*/ undefined, [requireCall]); + } var func; if (languageVersion >= 2 /* ES2015 */) { func = ts.createArrowFunction( @@ -64647,6 +65979,20 @@ var ts; } return ts.createCall(ts.createPropertyAccess(promiseResolveCall, "then"), /*typeArguments*/ undefined, [func]); } + function getHelperExpressionForImport(node, innerExpr) { + if (!compilerOptions.esModuleInterop || ts.getEmitFlags(node) & 67108864 /* NeverApplyImportHelper */) { + return innerExpr; + } + if (ts.getImportNeedsImportStarHelper(node)) { + context.requestEmitHelper(importStarHelper); + return ts.createCall(ts.getHelperName("__importStar"), /*typeArguments*/ undefined, [innerExpr]); + } + if (ts.getImportNeedsImportDefaultHelper(node)) { + context.requestEmitHelper(importDefaultHelper); + return ts.createCall(ts.getHelperName("__importDefault"), /*typeArguments*/ undefined, [innerExpr]); + } + return innerExpr; + } /** * Visits an ImportDeclaration node. * @@ -64665,7 +66011,7 @@ var ts; if (namespaceDeclaration && !ts.isDefaultImport(node)) { // import * as n from "mod"; variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), - /*type*/ undefined, createRequireCall(node))); + /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node)))); } else { // import d from "mod"; @@ -64673,7 +66019,7 @@ var ts; // import d, { x, y } from "mod"; // import d, * as n from "mod"; variables.push(ts.createVariableDeclaration(ts.getGeneratedNameForNode(node), - /*type*/ undefined, createRequireCall(node))); + /*type*/ undefined, getHelperExpressionForImport(node, createRequireCall(node)))); if (namespaceDeclaration && ts.isDefaultImport(node)) { variables.push(ts.createVariableDeclaration(ts.getSynthesizedClone(namespaceDeclaration.name), /*type*/ undefined, ts.getGeneratedNameForNode(node))); @@ -64936,7 +66282,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -64991,10 +66337,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -65193,7 +66539,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -65257,10 +66603,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -65281,7 +66627,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -65356,7 +66702,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 /* PlusPlusToken */ ? 59 /* PlusEqualsToken */ : 60 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -65406,6 +66752,18 @@ var ts; scoped: true, text: "\n var __syncRequire = typeof module === \"object\" && typeof module.exports === \"object\";" }; + // emit helper for `import * as Name from "foo"` + var importStarHelper = { + name: "typescript:commonjsimportstar", + scoped: false, + text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n}" + }; + // emit helper for `import Name from "foo"` + var importDefaultHelper = { + name: "typescript:commonjsimportdefault", + scoped: false, + text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n}" + }; })(ts || (ts = {})); /// /// @@ -65423,10 +66781,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -65647,7 +67006,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 245 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 248 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -65672,15 +67031,14 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 245 /* ExportDeclaration */) { + if (externalImport.kind !== 248 /* ExportDeclaration */) { continue; } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { // export * from ... continue; } - for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { + for (var _f = 0, _g = externalImport.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; // write name of indirectly exported entry, i.e. 'export {x} from ...' exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(ts.idText(element.name || element.propertyName)), ts.createTrue())); @@ -65742,28 +67100,28 @@ var ts; function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { - var group = dependencyGroups_1[_i]; + var group_1 = dependencyGroups_1[_i]; // derive a unique name for parameter from the first named entry in the group - var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); + var localName = ts.forEach(group_1.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName(""); var statements = []; - for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) { + for (var _a = 0, _b = group_1.externalImports; _a < _b.length; _a++) { var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -65813,15 +67171,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -65997,7 +67355,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 269 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 272 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -66061,7 +67419,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -66117,10 +67475,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -66300,43 +67658,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitDefaultClause(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitTryStatement(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -66522,7 +67880,7 @@ var ts; */ function destructuringAndImportCallVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 195 /* BinaryExpression */) { + && node.kind === 198 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (ts.isImportCall(node)) { @@ -66587,7 +67945,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 269 /* SourceFile */; + return container !== undefined && container.kind === 272 /* SourceFile */; } else { return false; @@ -66620,7 +67978,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -66656,6 +68014,43 @@ var ts; if (hint === 1 /* Expression */) { return substituteExpression(node); } + else if (hint === 4 /* Unspecified */) { + return substituteUnspecified(node); + } + return node; + } + /** + * Substitute the node, if necessary. + * + * @param node The node to substitute. + */ + function substituteUnspecified(node) { + switch (node.kind) { + case 269 /* ShorthandPropertyAssignment */: + return substituteShorthandPropertyAssignment(node); + } + return node; + } + /** + * Substitution for a ShorthandPropertyAssignment whose name that may contain an imported or exported symbol. + * + * @param node The node to substitute. + */ + function substituteShorthandPropertyAssignment(node) { + var name = node.name; + if (!ts.isGeneratedIdentifier(name) && !ts.isLocalName(name)) { + var importDeclaration = resolver.getReferencedImportDeclaration(name); + if (importDeclaration) { + if (ts.isImportClause(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent), ts.createIdentifier("default"))), + /*location*/ node); + } + else if (ts.isImportSpecifier(importDeclaration)) { + return ts.setTextRange(ts.createPropertyAssignment(ts.getSynthesizedClone(name), ts.createPropertyAccess(ts.getGeneratedNameForNode(importDeclaration.parent.parent.parent), ts.getSynthesizedClone(importDeclaration.propertyName || importDeclaration.name))), + /*location*/ node); + } + } + } return node; } /** @@ -66667,10 +68062,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -66763,14 +68158,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 194 /* PostfixUnaryExpression */) { + if (node.kind === 197 /* PostfixUnaryExpression */) { expression = node.operator === 43 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -66792,7 +68187,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -66833,7 +68228,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(269 /* SourceFile */); + context.enableEmitNotification(272 /* SourceFile */); context.enableSubstitution(71 /* Identifier */); var currentSourceFile; return transformSourceFile; @@ -66846,9 +68241,11 @@ var ts; if (externalHelpersModuleName) { var statements = []; var statementOffset = ts.addPrologue(statements, node.statements); - ts.append(statements, ts.createImportDeclaration( + var tslibImport = ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText))); + /*modifiers*/ undefined, ts.createImportClause(/*name*/ undefined, ts.createNamespaceImport(externalHelpersModuleName)), ts.createLiteral(ts.externalHelpersModuleNameText)); + ts.addEmitFlags(tslibImport, 67108864 /* NeverApplyImportHelper */); + ts.append(statements, tslibImport); ts.addRange(statements, ts.visitNodes(node.statements, visitor, ts.isStatement, statementOffset)); return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray(statements), node.statements)); } @@ -66860,10 +68257,10 @@ var ts; } function visitor(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); } return node; @@ -67003,7 +68400,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(296 /* Count */); + var enabledSyntaxKindFeatures = new Array(299 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -67343,7 +68740,7 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (sourceFileOrBundle.kind === 269 /* SourceFile */) { + if (sourceFileOrBundle.kind === 272 /* SourceFile */) { // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); @@ -67488,7 +68885,7 @@ var ts; source = undefined; if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(skipSourceTrivia(pos)); @@ -67505,7 +68902,7 @@ var ts; } if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -67522,9 +68919,9 @@ var ts; * @param tokenStartPos The start pos of the token. * @param emitCallback The callback used to emit the token. */ - function emitTokenWithSourceMap(node, token, tokenPos, emitCallback) { + function emitTokenWithSourceMap(node, token, writer, tokenPos, emitCallback) { if (disabled) { - return emitCallback(token, tokenPos); + return emitCallback(token, writer, tokenPos); } var emitNode = node && node.emitNode; var emitFlags = emitNode && emitNode.flags; @@ -67533,7 +68930,7 @@ var ts; if ((emitFlags & 128 /* NoTokenLeadingSourceMaps */) === 0 && tokenPos >= 0) { emitPos(tokenPos); } - tokenPos = emitCallback(token, tokenPos); + tokenPos = emitCallback(token, writer, tokenPos); if (range) tokenPos = range.end; if ((emitFlags & 256 /* NoTokenTrailingSourceMaps */) === 0 && tokenPos >= 0) { @@ -67558,7 +68955,7 @@ var ts; var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; var source = ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, currentSource.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, /*isAbsolutePathAnUrl*/ true); - sourceMapSourceIndex = ts.indexOf(sourceMapData.sourceMapSources, source); + sourceMapSourceIndex = sourceMapData.sourceMapSources.indexOf(source); if (sourceMapSourceIndex === -1) { sourceMapSourceIndex = sourceMapData.sourceMapSources.length; sourceMapData.sourceMapSources.push(source); @@ -67682,7 +69079,7 @@ var ts; if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 291 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 294 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 10 /* JsxText */; @@ -67703,7 +69100,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -68007,8 +69404,8 @@ var ts; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -68082,7 +69479,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 239 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 242 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -68099,8 +69496,8 @@ var ts; allSourcesModuleElementDeclarationEmitInfo = allSourcesModuleElementDeclarationEmitInfo.concat(moduleElementDeclarationEmitInfo); moduleElementDeclarationEmitInfo = []; } - if (!isBundledEmit && ts.isExternalModule(sourceFile) && sourceFile.moduleAugmentations.length && !resultHasExternalModuleIndicator) { - // if file was external module with augmentations - this fact should be preserved in .d.ts as well. + if (!isBundledEmit && ts.isExternalModule(sourceFile) && !resultHasExternalModuleIndicator) { + // if file was external module this fact should be preserved in .d.ts as well. // in case if we didn't write any external module specifiers in .d.ts we need to emit something // that will force compiler to think that this file is an external module - 'export {}' is a reasonable choice here. write("export {};"); @@ -68159,10 +69556,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 227 /* VariableDeclaration */) { + if (declaration.kind === 230 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 242 /* NamedImports */ || declaration.kind === 243 /* ImportSpecifier */ || declaration.kind === 240 /* ImportClause */) { + else if (declaration.kind === 245 /* NamedImports */ || declaration.kind === 246 /* ImportSpecifier */ || declaration.kind === 243 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -68180,7 +69577,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 239 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 242 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -68190,12 +69587,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -68269,7 +69666,7 @@ var ts; // for optional parameter properties // and also for non-optional initialized parameters that aren't a parameter property // these types may need to add `undefined`. - var shouldUseResolverType = declaration.kind === 147 /* Parameter */ && + var shouldUseResolverType = declaration.kind === 148 /* Parameter */ && (resolver.isRequiredInitializedParameter(declaration) || resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { @@ -68278,9 +69675,9 @@ var ts; } else { errorNameNode = declaration.name; - var format = 4 /* UseTypeOfFunction */ | - 16384 /* WriteClassExpressionAsTypeLiteral */ | - (shouldUseResolverType ? 8192 /* AddUndefined */ : 0); + var format = 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | + 2048 /* WriteClassExpressionAsTypeLiteral */ | + (shouldUseResolverType ? 131072 /* AddUndefined */ : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; } @@ -68294,7 +69691,7 @@ var ts; } else { errorNameNode = signature.name; - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 2048 /* WriteClassExpressionAsTypeLiteral */, writer); errorNameNode = undefined; } } @@ -68335,50 +69732,54 @@ var ts; function emitType(type) { switch (type.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 134 /* ObjectKeyword */: - case 137 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 170 /* ThisType */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 173 /* ThisType */: + case 177 /* LiteralType */: return writeTextOfNode(currentText, type); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(type); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(type); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(type); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(type); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(type); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(type); + case 171 /* InferType */: + return emitInferType(type); + case 172 /* ParenthesizedType */: return emitParenType(type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(type); case 71 /* Identifier */: return emitEntityName(type); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitEntityName(type); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -68386,8 +69787,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 144 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 144 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 145 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 145 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -68396,14 +69797,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 238 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 241 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -68444,6 +69845,22 @@ var ts; function emitIntersectionType(type) { emitSeparatedList(type.types, " & ", emitType); } + function emitConditionalType(node) { + emitType(node.checkType); + write(" extends "); + emitType(node.extendsType); + write(" ? "); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node.trueType; + emitType(node.trueType); + enclosingDeclaration = prevEnclosingDeclaration; + write(" : "); + emitType(node.falseType); + } + function emitInferType(node) { + write("infer "); + writeTextOfNode(currentText, node.typeParameter.name); + } function emitParenType(type) { write("("); emitType(type.type); @@ -68467,7 +69884,9 @@ var ts; writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === 37 /* PlusToken */ ? "+readonly " : + node.readonlyToken.kind === 38 /* MinusToken */ ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -68475,7 +69894,9 @@ var ts; emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === 37 /* PlusToken */ ? "+?" : + node.questionToken.kind === 38 /* MinusToken */ ? "-?" : + "?"); } write(": "); emitType(node.type); @@ -68532,12 +69953,15 @@ var ts; write(tempVarName); write(": "); writer.getSymbolAccessibilityDiagnostic = function () { return diagnostic; }; - resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4 /* UseTypeOfFunction */ | 16384 /* WriteClassExpressionAsTypeLiteral */, writer); + resolver.writeTypeOfExpression(expr, enclosingDeclaration, 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 2048 /* WriteClassExpressionAsTypeLiteral */, writer); write(";"); writeLine(); return tempVarName; } function emitExportAssignment(node) { + if (ts.isSourceFile(node.parent)) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators + } if (node.expression.kind === 71 /* Identifier */) { write(node.isExportEquals ? "export = " : "export default "); writeTextOfNode(currentText, node.expression); @@ -68566,10 +69990,10 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 238 /* ImportEqualsDeclaration */ || - (node.parent.kind === 269 /* SourceFile */ && isCurrentFileExternalModule)) { + else if (node.kind === 241 /* ImportEqualsDeclaration */ || + (node.parent.kind === 272 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 269 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 272 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -68579,7 +70003,7 @@ var ts; }); } else { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -68597,23 +70021,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return writeVariableStatement(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return writeClassDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -68621,16 +70045,17 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 272 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators write("export "); } if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 231 /* InterfaceDeclaration */ && needsDeclare) { + else if (node.kind !== 234 /* InterfaceDeclaration */ && needsDeclare) { write("declare "); } } @@ -68682,11 +70107,11 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); + return namedBindings.elements.some(function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } } } @@ -68706,7 +70131,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 244 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -68727,19 +70152,9 @@ var ts; // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 234 /* ModuleDeclaration */; - var moduleSpecifier; - if (parent.kind === 238 /* ImportEqualsDeclaration */) { - var node = parent; - moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === 234 /* ModuleDeclaration */) { - moduleSpecifier = parent.name; - } - else { - var node = parent; - moduleSpecifier = node.moduleSpecifier; - } + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 237 /* ModuleDeclaration */; + var moduleSpecifier = parent.kind === 241 /* ImportEqualsDeclaration */ ? ts.getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === 237 /* ModuleDeclaration */ ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === 9 /* StringLiteral */ && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -68766,6 +70181,7 @@ var ts; writeAsynchronousModuleElements(nodes); } function emitExportDeclaration(node) { + resultHasExternalModuleIndicator = true; // Top-level exports are external module indicators emitJsDocComments(node); write("export "); if (node.exportClause) { @@ -68803,7 +70219,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 235 /* ModuleBlock */) { + while (node.body && node.body.kind !== 238 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -68873,7 +70289,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 152 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 153 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -68884,15 +70300,15 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.constraint); } else { @@ -68901,15 +70317,15 @@ var ts; } if (node.default && !isPrivateMethodTypeParameter(node)) { write(" = "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.default); } else { @@ -68920,34 +70336,34 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -68981,7 +70397,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + if (node.parent.parent.kind === 233 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -69020,7 +70436,7 @@ var ts; diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: baseTypeNode, typeName: node.name - }, !ts.findAncestor(node, function (n) { return n.kind === 234 /* ModuleDeclaration */; })); + }, !ts.findAncestor(node, function (n) { return n.kind === 237 /* ModuleDeclaration */; })); } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -69095,7 +70511,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 227 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { + if (node.kind !== 230 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -69103,11 +70519,11 @@ var ts; writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */) && node.parent.kind === 164 /* TypeLiteral */) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */) && node.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -69120,15 +70536,15 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + else if (node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -69137,7 +70553,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */ || node.kind === 147 /* Parameter */) { + else if (node.parent.kind === 233 /* ClassDeclaration */ || node.kind === 148 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69169,7 +70585,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 201 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { + if (element.kind !== 204 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { elements.push(element); } } @@ -69199,7 +70615,7 @@ var ts; // if this is property of type literal, // or is parameter of method/call/construct/index signature of type literal // emit only if type is specified - if (node.type) { + if (ts.hasType(node)) { write(": "); emitType(node.type); } @@ -69243,7 +70659,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 154 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 155 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -69256,7 +70672,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 154 /* GetAccessor */ + return accessor.kind === 155 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -69279,7 +70695,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69294,7 +70710,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 155 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 156 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(accessorWithTypeAnnotation, 32 /* Static */)) { @@ -69339,17 +70755,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 152 /* MethodDeclaration */ || node.kind === 153 /* Constructor */) { + else if (node.kind === 153 /* MethodDeclaration */ || node.kind === 154 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 153 /* Constructor */) { + else if (node.kind === 154 /* Constructor */) { write("constructor"); } else { @@ -69376,7 +70792,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69420,22 +70836,22 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 153 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { + if (node.kind === 154 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { write("();"); writeLine(); return; } // Construct signature or constructor type write new Signature - if (node.kind === 157 /* ConstructSignature */ || node.kind === 162 /* ConstructorType */) { + if (node.kind === 158 /* ConstructSignature */ || node.kind === 163 /* ConstructorType */) { write("new "); } - else if (node.kind === 161 /* FunctionType */) { + else if (node.kind === 162 /* FunctionType */) { var currentOutput = writer.getText(); // Do not generate incorrect type when function type with type parameters is type argument // This could happen if user used space between two '<' making it error free @@ -69450,22 +70866,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 161 /* FunctionType */ || node.kind === 162 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 164 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 162 /* FunctionType */ || node.kind === 163 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 165 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 153 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 154 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -69479,26 +70895,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -69506,7 +70922,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -69520,7 +70936,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -69555,9 +70971,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.parent.kind === 164 /* TypeLiteral */) { + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -69573,29 +70989,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -69603,7 +71019,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69616,7 +71032,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69628,12 +71044,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 178 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 179 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -69644,16 +71060,17 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 201 /* OmittedExpression */) { + if (bindingElement.kind === 204 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) // Example: // original: function foo([, x, ,]) {} + // tslint:disable-next-line no-double-space // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 177 /* BindingElement */) { + else if (bindingElement.kind === 180 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -69692,40 +71109,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return writeFunctionDeclaration(node); - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return emitPropertyDeclaration(node); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return emitSourceFile(node); } } @@ -69753,7 +71170,7 @@ var ts; return addedBundledEmitReference; function getDeclFileName(emitFileNames, sourceFileOrBundle) { // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -69767,8 +71184,8 @@ var ts; function writeDeclarationFile(declarationFilePath, sourceFileOrBundle, host, resolver, emitterDiagnostics, emitOnlyDtsFiles) { var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; - if (!emitSkipped) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + if (!emitSkipped || emitOnlyDtsFiles) { + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -69798,7 +71215,6 @@ var ts; /// var ts; (function (ts) { - var delimiters = createDelimiterMap(); var brackets = createBracketsMap(); /*@internal*/ /** @@ -69818,7 +71234,10 @@ var ts; var jsFilePath = options.outFile || options.out; var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = options.declaration ? ts.removeFileExtension(jsFilePath) + ".d.ts" /* Dts */ : ""; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, ts.createBundle(sourceFiles), emitOnlyDtsFiles); + if (result) { + return result; + } } } else { @@ -69827,7 +71246,10 @@ var ts; var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, getOutputExtension(sourceFile, options)); var sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); var declarationFilePath = !ts.isSourceFileJavaScript(sourceFile) && (emitOnlyDtsFiles || options.declaration) ? ts.getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; - action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + var result = action({ jsFilePath: jsFilePath, sourceMapFilePath: sourceMapFilePath, declarationFilePath: declarationFilePath }, sourceFile, emitOnlyDtsFiles); + if (result) { + return result; + } } } } @@ -69853,7 +71275,7 @@ var ts; return ".js" /* Js */; } function getOriginalSourceFileOrBundle(sourceFileOrBundle) { - if (sourceFileOrBundle.kind === 270 /* Bundle */) { + if (sourceFileOrBundle.kind === 273 /* Bundle */) { return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, ts.getOriginalSourceFile)); } return ts.getOriginalSourceFile(sourceFileOrBundle); @@ -69906,7 +71328,7 @@ var ts; function emitSourceFileOrBundle(_a, sourceFileOrBundle) { var jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath; // Make sure not to write js file and source map file if any of them cannot be written - if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit) { + if (!host.isEmitBlocked(jsFilePath) && !compilerOptions.noEmit && !compilerOptions.emitDeclarationOnly) { if (!emitOnlyDtsFiles) { printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle); } @@ -69930,8 +71352,8 @@ var ts; } } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { - var bundle = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 269 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 272 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); if (bundle) { @@ -69960,7 +71382,7 @@ var ts; ts.writeFile(host, emitterDiagnostics, jsFilePath, writer.getText(), compilerOptions.emitBOM, sourceFiles); // Reset state sourceMap.reset(); - writer.reset(); + writer.clear(); currentSourceFile = undefined; bundledHelpers = undefined; isOwnFileEmit = false; @@ -69971,7 +71393,7 @@ var ts; } function emitHelpers(node, writeLines) { var helpersEmitted = false; - var bundle = node.kind === 270 /* Bundle */ ? node : undefined; + var bundle = node.kind === 273 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -70026,16 +71448,29 @@ var ts; var generatedNames; // Set of names generated by the NameGenerator. var tempFlagsStack; // Stack of enclosing name generation scopes. var tempFlags; // TempFlags for the current name generation scope. + var reservedNamesStack; // Stack of TempFlags reserved in enclosing name generation scopes. + var reservedNames; // TempFlags to reserve in nested name generation scopes. var writer; var ownWriter; + var write = writeBase; + var commitPendingSemicolon = ts.noop; + var writeSemicolon = writeSemicolonInternal; + var pendingSemicolon = false; + if (printerOptions.omitTrailingSemicolon) { + commitPendingSemicolon = commitPendingSemicolonInternal; + writeSemicolon = deferWriteSemicolon; + } + var syntheticParent = { pos: -1, end: -1 }; reset(); return { // public API printNode: printNode, + printList: printList, printFile: printFile, printBundle: printBundle, // internal API writeNode: writeNode, + writeList: writeList, writeFile: writeFile, writeBundle: writeBundle }; @@ -70052,12 +71487,16 @@ var ts; break; } switch (node.kind) { - case 269 /* SourceFile */: return printFile(node); - case 270 /* Bundle */: return printBundle(node); + case 272 /* SourceFile */: return printFile(node); + case 273 /* Bundle */: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); } + function printList(format, nodes, sourceFile) { + writeList(format, nodes, sourceFile, beginPrint()); + return endPrint(); + } function printBundle(bundle) { writeBundle(bundle, beginPrint()); return endPrint(); @@ -70073,6 +71512,16 @@ var ts; reset(); writer = previousWriter; } + function writeList(format, nodes, sourceFile, output) { + var previousWriter = writer; + setWriter(output); + if (sourceFile) { + setSourceFile(sourceFile); + } + emitList(syntheticParent, nodes, format); + reset(); + writer = previousWriter; + } function writeBundle(bundle, output) { var previousWriter = writer; setWriter(output); @@ -70100,7 +71549,7 @@ var ts; } function endPrint() { var text = ownWriter.getText(); - ownWriter.reset(); + ownWriter.clear(); return text; } function print(hint, node, sourceFile) { @@ -70126,6 +71575,7 @@ var ts; generatedNames = ts.createMap(); tempFlagsStack = []; tempFlags = 0 /* Auto */; + reservedNamesStack = []; comments.reset(); setWriter(/*output*/ undefined); } @@ -70189,7 +71639,9 @@ var ts; } function emitMappedTypeParameter(node) { emit(node.name); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emit(node.constraint); } function pipelineEmitUnspecified(node) { @@ -70198,7 +71650,7 @@ var ts; // Strict mode reserved words // Contextual keywords if (ts.isKeyword(kind)) { - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; } switch (kind) { @@ -70212,222 +71664,226 @@ var ts; return emitIdentifier(node); // Parse tree nodes // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitQualifiedName(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return emitTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return emitParameter(node); - case 148 /* Decorator */: + case 149 /* Decorator */: return emitDecorator(node); // Type members - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return emitPropertySignature(node); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return emitMethodSignature(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return emitConstructor(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return emitCallSignature(node); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return emitConstructSignature(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return emitIndexSignature(node); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(node); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return emitFunctionType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return emitConstructorType(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(node); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(node); + case 171 /* InferType */: + return emitInferType(node); + case 172 /* ParenthesizedType */: return emitParenthesizedType(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return emitThisType(); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return emitLiteralType(node); - case 272 /* JSDocAllType */: + case 275 /* JSDocAllType */: write("*"); return; - case 273 /* JSDocUnknownType */: + case 276 /* JSDocUnknownType */: write("?"); return; - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return emitJSDocVariadicType(node); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return emitBindingElement(node); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return emitTemplateSpan(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 208 /* Block */: + case 211 /* Block */: return emitBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitVariableStatement(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: return emitEmptyStatement(); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return emitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return emitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return emitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return emitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return emitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return emitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return emitForOfStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return emitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return emitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return emitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return emitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return emitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return emitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return emitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return emitTryStatement(node); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return emitClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return emitModuleBlock(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return emitCaseBlock(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return emitImportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return emitImportClause(node); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return emitNamespaceImport(node); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return emitNamedImports(node); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return emitImportSpecifier(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return emitNamedExports(node); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return emitExportSpecifier(node); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 252 /* JsxOpeningElement */: - case 255 /* JsxOpeningFragment */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 253 /* JsxClosingElement */: - case 256 /* JsxClosingFragment */: + case 256 /* JsxClosingElement */: + case 259 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return emitJsxAttribute(node); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return emitJsxAttributes(node); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return emitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return emitDefaultClause(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return emitHeritageClause(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMember(node); } // If the node is an expression, try to emit it as an expression with @@ -70436,7 +71892,7 @@ var ts; return pipelineEmitExpression(trySubstituteNode(1 /* Expression */, node)); } if (ts.isToken(node)) { - writeTokenNode(node); + writeTokenNode(node, writePunctuation); return; } } @@ -70460,74 +71916,74 @@ var ts; case 101 /* TrueKeyword */: case 99 /* ThisKeyword */: case 91 /* ImportKeyword */: - writeTokenNode(node); + writeTokenNode(node, writeKeyword); return; // Expressions - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return emitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return emitNewExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return emitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return emitArrowFunction(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return emitDeleteExpression(node); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return emitVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return emitAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return emitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return emitConditionalExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return emitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return emitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return emitSpreadExpression(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return emitClassExpression(node); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: return emitAsExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return emitNonNullExpression(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return emitJsxElement(node); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return emitCommaList(node); } } @@ -70556,25 +72012,27 @@ var ts; var text = getLiteralTextOfNode(node); if ((printerOptions.sourceMap || printerOptions.inlineSourceMap) && (node.kind === 9 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { - writer.writeLiteral(text); + writeLiteral(text); } else { - write(text); + // Quick info expects all literals to be called with writeStringLiteral, as there's no specific type for numberLiterals + writeStringLiteral(text); } } // // Identifiers // function emitIdentifier(node) { - write(getTextOfNode(node, /*includeTrivia*/ false)); - emitTypeArguments(node, node.typeArguments); + var writeText = node.symbol ? writeSymbol : write; + writeText(getTextOfNode(node, /*includeTrivia*/ false), node.symbol); + emitList(node, node.typeArguments, 26896 /* TypeParameters */); // Call emitList directly since it could be an array of TypeParameterDeclarations _or_ type arguments } // // Names // function emitQualifiedName(node) { emitEntityName(node.left); - write("."); + writePunctuation("."); emit(node.right); } function emitEntityName(node) { @@ -70586,36 +72044,46 @@ var ts; } } function emitComputedPropertyName(node) { - write("["); + writePunctuation("["); emitExpression(node.expression); - write("]"); + writePunctuation("]"); } // // Signature elements // function emitTypeParameter(node) { emit(node.name); - emitWithPrefix(" extends ", node.constraint); - emitWithPrefix(" = ", node.default); + if (node.constraint) { + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.constraint); + } + if (node.default) { + writeSpace(); + writeOperator("="); + writeSpace(); + emit(node.default); + } } function emitParameter(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitIfPresent(node.dotDotDotToken); if (node.name) { - emit(node.name); + emitNodeWithWriter(node.name, writeParameter); } emitIfPresent(node.questionToken); - if (node.parent && node.parent.kind === 277 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 280 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } function emitDecorator(decorator) { - write("@"); + writePunctuation("@"); emitExpression(decorator.expression); } // @@ -70624,19 +72092,19 @@ var ts; function emitPropertySignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - emit(node.name); + emitNodeWithWriter(node.name, writeProperty); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitPropertyDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); - write(";"); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); + writeSemicolon(); } function emitMethodSignature(node) { emitDecorators(node, node.decorators); @@ -70645,8 +72113,8 @@ var ts; emitIfPresent(node.questionToken); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitMethodDeclaration(node) { emitDecorators(node, node.decorators); @@ -70658,13 +72126,14 @@ var ts; } function emitConstructor(node) { emitModifiers(node, node.modifiers); - write("constructor"); + writeKeyword("constructor"); emitSignatureAndBody(node, emitSignatureHead); } function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write(node.kind === 154 /* GetAccessor */ ? "get " : "set "); + writeKeyword(node.kind === 155 /* GetAccessor */ ? "get" : "set"); + writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -70673,34 +72142,37 @@ var ts; emitModifiers(node, node.modifiers); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitConstructSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitIndexSignature(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); emitParametersForIndexSignature(node, node.parameters); - emitWithPrefix(": ", node.type); - write(";"); + emitTypeAnnotation(node.type); + writeSemicolon(); } function emitSemicolonClassElement() { - write(";"); + writeSemicolon(); } // // Types // function emitTypePredicate(node) { emit(node.parameterName); - write(" is "); + writeSpace(); + writeKeyword("is"); + writeSpace(); emit(node.type); } function emitTypeReference(node) { @@ -70710,7 +72182,9 @@ var ts; function emitFunctionType(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitJSDocFunctionType(node) { @@ -70732,34 +72206,39 @@ var ts; write("="); } function emitConstructorType(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - write(" => "); + writeSpace(); + writePunctuation("=>"); + writeSpace(); emit(node.type); } function emitTypeQuery(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emit(node.exprName); } function emitTypeLiteral(node) { - write("{"); + writePunctuation("{"); var flags = ts.getEmitFlags(node) & 1 /* SingleLine */ ? 448 /* SingleLineTypeLiteralMembers */ : 65 /* MultiLineTypeLiteralMembers */; emitList(node, node.members, flags | 262144 /* NoSpaceIfEmpty */); - write("}"); + writePunctuation("}"); } function emitArrayType(node) { emit(node.elementType); - write("[]"); + writePunctuation("["); + writePunctuation("]"); } function emitJSDocVariadicType(node) { write("..."); emit(node.type); } function emitTupleType(node) { - write("["); + writePunctuation("["); emitList(node, node.elementTypes, 336 /* TupleTypeElements */); - write("]"); + writePunctuation("]"); } function emitUnionType(node) { emitList(node, node.types, 260 /* UnionTypeConstituents */); @@ -70767,30 +72246,50 @@ var ts; function emitIntersectionType(node) { emitList(node, node.types, 264 /* IntersectionTypeConstituents */); } + function emitConditionalType(node) { + emit(node.checkType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } function emitParenthesizedType(node) { - write("("); + writePunctuation("("); emit(node.type); - write(")"); + writePunctuation(")"); } function emitThisType() { - write("this"); + writeKeyword("this"); } function emitTypeOperator(node) { - writeTokenText(node.operator); - write(" "); + writeTokenText(node.operator, writeKeyword); + writeSpace(); emit(node.type); } function emitIndexedAccessType(node) { emit(node.objectType); - write("["); + writePunctuation("["); emit(node.indexType); - write("]"); + writePunctuation("]"); } function emitMappedType(node) { var emitFlags = ts.getEmitFlags(node); - write("{"); + writePunctuation("{"); if (emitFlags & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); @@ -70798,23 +72297,32 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); - write(" "); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + writeKeyword("readonly"); + } + writeSpace(); } - write("["); + writePunctuation("["); pipelineEmitWithNotification(3 /* MappedTypeParameter */, node.typeParameter); - write("]"); - emitIfPresent(node.questionToken); - write(": "); + writePunctuation("]"); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + writePunctuation("?"); + } + } + writePunctuation(":"); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); if (emitFlags & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); decreaseIndent(); } - write("}"); + writePunctuation("}"); } function emitLiteralType(node) { emitExpression(node.literal); @@ -70823,32 +72331,24 @@ var ts; // Binding patterns // function emitObjectBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("{}"); - } - else { - write("{"); - emitList(node, elements, 432 /* ObjectBindingPatternElements */); - write("}"); - } + writePunctuation("{"); + emitList(node, node.elements, 262576 /* ObjectBindingPatternElements */); + writePunctuation("}"); } function emitArrayBindingPattern(node) { - var elements = node.elements; - if (elements.length === 0) { - write("[]"); - } - else { - write("["); - emitList(node, node.elements, 304 /* ArrayBindingPatternElements */); - write("]"); - } + writePunctuation("["); + emitList(node, node.elements, 262448 /* ArrayBindingPatternElements */); + writePunctuation("]"); } function emitBindingElement(node) { - emitWithSuffix(node.propertyName, ": "); emitIfPresent(node.dotDotDotToken); + if (node.propertyName) { + emit(node.propertyName); + writePunctuation(":"); + writeSpace(); + } emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } // // Expressions @@ -70885,7 +72385,7 @@ var ts; emitExpression(node.expression); increaseIndentIf(indentBeforeDot); var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - write(shouldEmitDotDot ? ".." : "."); + writePunctuation(shouldEmitDotDot ? ".." : "."); increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -70911,9 +72411,9 @@ var ts; } function emitElementAccessExpression(node) { emitExpression(node.expression); - write("["); + writePunctuation("["); emitExpression(node.argumentExpression); - write("]"); + writePunctuation("]"); } function emitCallExpression(node) { emitExpression(node.expression); @@ -70921,26 +72421,27 @@ var ts; emitExpressionList(node, node.arguments, 1296 /* CallExpressionArguments */); } function emitNewExpression(node) { - write("new "); + writeKeyword("new"); + writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); emitExpressionList(node, node.arguments, 9488 /* NewExpressionArguments */); } function emitTaggedTemplateExpression(node) { emitExpression(node.tag); - write(" "); + writeSpace(); emitExpression(node.template); } function emitTypeAssertionExpression(node) { - write("<"); + writePunctuation("<"); emit(node.type); - write(">"); + writePunctuation(">"); emitExpression(node.expression); } function emitParenthesizedExpression(node) { - write("("); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } function emitFunctionExpression(node) { emitFunctionDeclarationOrExpression(node); @@ -70953,30 +72454,34 @@ var ts; function emitArrowFunctionHead(node) { emitTypeParameters(node, node.typeParameters); emitParametersForArrow(node, node.parameters); - emitWithPrefix(": ", node.type); - write(" "); + emitTypeAnnotation(node.type); + writeSpace(); emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - write("delete "); + writeKeyword("delete"); + writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - write("typeof "); + writeKeyword("typeof"); + writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - write("void "); + writeKeyword("void"); + writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - write("await "); + writeKeyword("await"); + writeSpace(); emitExpression(node.expression); } function emitPrefixUnaryExpression(node) { - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); if (shouldEmitWhitespaceBeforeOperand(node)) { - write(" "); + writeSpace(); } emitExpression(node.operand); } @@ -70994,13 +72499,13 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 193 /* PrefixUnaryExpression */ + return operand.kind === 196 /* PrefixUnaryExpression */ && ((node.operator === 37 /* PlusToken */ && (operand.operator === 37 /* PlusToken */ || operand.operator === 43 /* PlusPlusToken */)) || (node.operator === 38 /* MinusToken */ && (operand.operator === 38 /* MinusToken */ || operand.operator === 44 /* MinusMinusToken */))); } function emitPostfixUnaryExpression(node) { emitExpression(node.operand); - writeTokenText(node.operator); + writeTokenText(node.operator, writeOperator); } function emitBinaryExpression(node) { var isCommaOperator = node.operatorToken.kind !== 26 /* CommaToken */; @@ -71009,7 +72514,7 @@ var ts; emitExpression(node.left); increaseIndentIf(indentBeforeOperator, isCommaOperator ? " " : undefined); emitLeadingCommentsOfPosition(node.operatorToken.pos); - writeTokenNode(node.operatorToken); + writeTokenNode(node.operatorToken, writeOperator); emitTrailingCommentsOfPosition(node.operatorToken.end, /*prefixSpace*/ true); // Binary operators should have a space before the comment starts increaseIndentIf(indentAfterOperator, " "); emitExpression(node.right); @@ -71037,12 +72542,12 @@ var ts; emitList(node, node.templateSpans, 131072 /* TemplateExpressionSpans */); } function emitYieldExpression(node) { - write("yield"); + writeKeyword("yield"); emit(node.asteriskToken); - emitExpressionWithPrefix(" ", node.expression); + emitExpressionWithLeadingSpace(node.expression); } function emitSpreadExpression(node) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } function emitClassExpression(node) { @@ -71055,17 +72560,19 @@ var ts; function emitAsExpression(node) { emitExpression(node.expression); if (node.type) { - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.type); } } function emitNonNullExpression(node) { emitExpression(node.expression); - write("!"); + writeOperator("!"); } function emitMetaProperty(node) { - writeToken(node.keywordToken, node.pos); - write("."); + writeToken(node.keywordToken, node.pos, writePunctuation); + writePunctuation("."); emit(node.name); } // @@ -71079,13 +72586,13 @@ var ts; // Statements // function emitBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos, /*contextNode*/ node); + writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node); emitBlockStatements(node, /*forceSingleLine*/ !node.multiLine && isEmptyBlock(node)); // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted increaseIndent(); emitLeadingCommentsOfPosition(node.statements.end); decreaseIndent(); - writeToken(18 /* CloseBraceToken */, node.statements.end, /*contextNode*/ node); + writeToken(18 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node); } function emitBlockStatements(node, forceSingleLine) { var format = forceSingleLine || ts.getEmitFlags(node) & 1 /* SingleLine */ ? 384 /* SingleLineBlockStatements */ : 65 /* MultiLineBlockStatements */; @@ -71094,27 +72601,27 @@ var ts; function emitVariableStatement(node) { emitModifiers(node, node.modifiers); emit(node.declarationList); - write(";"); + writeSemicolon(); } function emitEmptyStatement() { - write(";"); + writeSemicolon(); } function emitExpressionStatement(node) { emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitIfStatement(node) { - var openParenPos = writeToken(90 /* IfKeyword */, node.pos, node); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos, node); + var openParenPos = writeToken(90 /* IfKeyword */, node.pos, writeKeyword, node); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, node); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(82 /* ElseKeyword */, node.thenStatement.end, node); - if (node.elseStatement.kind === 212 /* IfStatement */) { - write(" "); + writeToken(82 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 215 /* IfStatement */) { + writeSpace(); emit(node.elseStatement); } else { @@ -71123,60 +72630,68 @@ var ts; } } function emitDoStatement(node) { - write("do"); + writeKeyword("do"); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { - write(" "); + writeSpace(); } else { writeLineOrSpace(node); } - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(");"); + writePunctuation(");"); } function emitWhileStatement(node) { - write("while ("); + writeKeyword("while"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos, /*contextNode*/ node); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); emitForBinding(node.initializer); - write(";"); - emitExpressionWithPrefix(" ", node.condition); - write(";"); - emitExpressionWithPrefix(" ", node.incrementor); - write(")"); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.condition); + writeSemicolon(); + emitExpressionWithLeadingSpace(node.incrementor); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" in "); + writeSpace(); + writeKeyword("in"); + writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos); - write(" "); - emitWithSuffix(node.awaitModifier, " "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + writeSpace(); + emitWithTrailingSpace(node.awaitModifier); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitForBinding(node.initializer); - write(" of "); + writeSpace(); + writeKeyword("of"); + writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { emit(node); } else { @@ -71185,58 +72700,62 @@ var ts; } } function emitContinueStatement(node) { - writeToken(77 /* ContinueKeyword */, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(77 /* ContinueKeyword */, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } function emitBreakStatement(node) { - writeToken(72 /* BreakKeyword */, node.pos); - emitWithPrefix(" ", node.label); - write(";"); + writeToken(72 /* BreakKeyword */, node.pos, writeKeyword); + emitWithLeadingSpace(node.label); + writeSemicolon(); } - function emitTokenWithComment(token, pos, contextNode) { + function emitTokenWithComment(token, pos, writer, contextNode) { var node = contextNode && ts.getParseTreeNode(contextNode); if (node && node.kind === contextNode.kind) { pos = ts.skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, /*contextNode*/ contextNode); + pos = writeToken(token, pos, writer, /*contextNode*/ contextNode); if (node && node.kind === contextNode.kind) { emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); } return pos; } function emitReturnStatement(node) { - emitTokenWithComment(96 /* ReturnKeyword */, node.pos, /*contextNode*/ node); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + emitTokenWithComment(96 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitWithStatement(node) { - write("with ("); + writeKeyword("with"); + writeSpace(); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos); - write(" "); - writeToken(19 /* OpenParenToken */, openParenPos); + var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos, writeKeyword); + writeSpace(); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end); - write(" "); + writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node) { emit(node.label); - write(": "); + writePunctuation(":"); + writeSpace(); emit(node.statement); } function emitThrowStatement(node) { - write("throw"); - emitExpressionWithPrefix(" ", node.expression); - write(";"); + writeKeyword("throw"); + emitExpressionWithLeadingSpace(node.expression); + writeSemicolon(); } function emitTryStatement(node) { - write("try "); + writeKeyword("try"); + writeSpace(); emit(node.tryBlock); if (node.catchClause) { writeLineOrSpace(node); @@ -71244,24 +72763,26 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - write("finally "); + writeKeyword("finally"); + writeSpace(); emit(node.finallyBlock); } } function emitDebuggerStatement(node) { - writeToken(78 /* DebuggerKeyword */, node.pos); - write(";"); + writeToken(78 /* DebuggerKeyword */, node.pos, writeKeyword); + writeSemicolon(); } // // Declarations // function emitVariableDeclaration(node) { emit(node.name); - emitWithPrefix(": ", node.type); - emitExpressionWithPrefix(" = ", node.initializer); + emitTypeAnnotation(node.type); + emitInitializer(node.initializer); } function emitVariableDeclarationList(node) { - write(ts.isLet(node) ? "let " : ts.isConst(node) ? "const " : "var "); + writeKeyword(ts.isLet(node) ? "let" : ts.isConst(node) ? "const" : "var"); + writeSpace(); emitList(node, node.declarations, 272 /* VariableDeclarationList */); } function emitFunctionDeclaration(node) { @@ -71270,9 +72791,9 @@ var ts; function emitFunctionDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("function"); + writeKeyword("function"); emitIfPresent(node.asteriskToken); - write(" "); + writeSpace(); emitIdentifierName(node.name); emitSignatureAndBody(node, emitSignatureHead); } @@ -71302,19 +72823,19 @@ var ts; } else { emitSignatureHead(node); - write(" "); + writeSpace(); emitExpression(body); } } else { emitSignatureHead(node); - write(";"); + writeSemicolon(); } } function emitSignatureHead(node) { emitTypeParameters(node, node.typeParameters); emitParameters(node, node.parameters); - emitWithPrefix(": ", node.type); + emitTypeAnnotation(node.type); } function shouldEmitBlockFunctionBodyOnSingleLine(body) { // We must emit a function body as a single-line body in the following case: @@ -71347,7 +72868,8 @@ var ts; return true; } function emitBlockFunctionBody(body) { - write(" {"); + writeSpace(); + writePunctuation("{"); increaseIndent(); var emitBlockFunctionBody = shouldEmitBlockFunctionBodyOnSingleLine(body) ? emitBlockFunctionBodyOnSingleLine @@ -71359,7 +72881,7 @@ var ts; emitBlockFunctionBody(body); } decreaseIndent(); - writeToken(18 /* CloseBraceToken */, body.statements.end, body); + writeToken(18 /* CloseBraceToken */, body.statements.end, writePunctuation, body); } function emitBlockFunctionBodyOnSingleLine(body) { emitBlockFunctionBodyWorker(body, /*emitBlockFunctionBodyOnSingleLine*/ true); @@ -71384,17 +72906,21 @@ var ts; function emitClassDeclarationOrExpression(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("class"); - emitNodeWithPrefix(" ", node.name, emitIdentifierName); + writeKeyword("class"); + if (node.name) { + writeSpace(); + emitIdentifierName(node.name); + } var indentedFlag = ts.getEmitFlags(node) & 65536 /* Indented */; if (indentedFlag) { increaseIndent(); } emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* ClassHeritageClauses */); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65 /* ClassMembers */); - write("}"); + writePunctuation("}"); if (indentedFlag) { decreaseIndent(); } @@ -71402,66 +72928,77 @@ var ts; function emitInterfaceDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("interface "); + writeKeyword("interface"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); emitList(node, node.heritageClauses, 256 /* HeritageClauses */); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 65 /* InterfaceMembers */); - write("}"); + writePunctuation("}"); } function emitTypeAliasDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - write("type "); + writeKeyword("type"); + writeSpace(); emit(node.name); emitTypeParameters(node, node.typeParameters); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emit(node.type); - write(";"); + writeSemicolon(); } function emitEnumDeclaration(node) { emitModifiers(node, node.modifiers); - write("enum "); + writeKeyword("enum"); + writeSpace(); emit(node.name); - write(" {"); + writeSpace(); + writePunctuation("{"); emitList(node, node.members, 81 /* EnumMembers */); - write("}"); + writePunctuation("}"); } function emitModuleDeclaration(node) { emitModifiers(node, node.modifiers); if (~node.flags & 512 /* GlobalAugmentation */) { - write(node.flags & 16 /* Namespace */ ? "namespace " : "module "); + writeKeyword(node.flags & 16 /* Namespace */ ? "namespace" : "module"); + writeSpace(); } emit(node.name); var body = node.body; - while (body.kind === 234 /* ModuleDeclaration */) { - write("."); + while (body.kind === 237 /* ModuleDeclaration */) { + writePunctuation("."); emit(body.name); body = body.body; } - write(" "); + writeSpace(); emit(body); } function emitModuleBlock(node) { pushNameGenerationScope(node); - write("{"); + writePunctuation("{"); emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node)); - write("}"); + writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos); + writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation); emitList(node, node.clauses, 65 /* CaseBlockClauses */); - writeToken(18 /* CloseBraceToken */, node.clauses.end); + writeToken(18 /* CloseBraceToken */, node.clauses.end, writePunctuation); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); emit(node.name); - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitModuleReference(node.moduleReference); - write(";"); + writeSemicolon(); } function emitModuleReference(node) { if (node.kind === 71 /* Identifier */) { @@ -71473,23 +73010,30 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - write("import "); + writeKeyword("import"); + writeSpace(); if (node.importClause) { emit(node.importClause); - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); } emitExpression(node.moduleSpecifier); - write(";"); + writeSemicolon(); } function emitImportClause(node) { emit(node.name); if (node.name && node.namedBindings) { - write(", "); + writePunctuation(","); + writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node) { - write("* as "); + writePunctuation("*"); + writeSpace(); + writeKeyword("as"); + writeSpace(); emit(node.name); } function emitNamedImports(node) { @@ -71499,28 +73043,44 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - write(node.isExportEquals ? "export = " : "export default "); + writeKeyword("export"); + writeSpace(); + if (node.isExportEquals) { + writeOperator("="); + } + else { + writeKeyword("default"); + } + writeSpace(); emitExpression(node.expression); - write(";"); + writeSemicolon(); } function emitExportDeclaration(node) { - write("export "); + writeKeyword("export"); + writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - write("*"); + writePunctuation("*"); } if (node.moduleSpecifier) { - write(" from "); + writeSpace(); + writeKeyword("from"); + writeSpace(); emitExpression(node.moduleSpecifier); } - write(";"); + writeSemicolon(); } function emitNamespaceExportDeclaration(node) { - write("export as namespace "); + writeKeyword("export"); + writeSpace(); + writeKeyword("as"); + writeSpace(); + writeKeyword("namespace"); + writeSpace(); emit(node.name); - write(";"); + writeSemicolon(); } function emitNamedExports(node) { emitNamedImportsOrExports(node); @@ -71529,14 +73089,16 @@ var ts; emitImportOrExportSpecifier(node); } function emitNamedImportsOrExports(node) { - write("{"); + writePunctuation("{"); emitList(node, node.elements, 432 /* NamedImportsOrExportsElements */); - write("}"); + writePunctuation("}"); } function emitImportOrExportSpecifier(node) { if (node.propertyName) { emit(node.propertyName); - write(" as "); + writeSpace(); + writeKeyword("as"); + writeSpace(); } emit(node.name); } @@ -71544,9 +73106,10 @@ var ts; // Module references // function emitExternalModuleReference(node) { - write("require("); + writeKeyword("require"); + writePunctuation("("); emitExpression(node.expression); - write(")"); + writePunctuation(")"); } // // JSX @@ -71557,14 +73120,14 @@ var ts; emit(node.closingElement); } function emitJsxSelfClosingElement(node) { - write("<"); + writePunctuation("<"); emitJsxTagName(node.tagName); - write(" "); + writeSpace(); // We are checking here so we won't re-enter the emiting pipeline and emit extra sourcemap if (node.attributes.properties && node.attributes.properties.length > 0) { emit(node.attributes); } - write("/>"); + writePunctuation("/>"); } function emitJsxFragment(node) { emit(node.openingFragment); @@ -71572,45 +73135,46 @@ var ts; emit(node.closingFragment); } function emitJsxOpeningElementOrFragment(node) { - write("<"); + writePunctuation("<"); if (ts.isJsxOpeningElement(node)) { emitJsxTagName(node.tagName); // We are checking here so we won't re-enter the emitting pipeline and emit extra sourcemap if (node.attributes.properties && node.attributes.properties.length > 0) { - write(" "); + writeSpace(); emit(node.attributes); } } - write(">"); + writePunctuation(">"); } function emitJsxText(node) { + commitPendingSemicolon(); writer.writeLiteral(getTextOfNode(node, /*includeTrivia*/ true)); } function emitJsxClosingElementOrFragment(node) { - write(""); + writePunctuation(">"); } function emitJsxAttributes(node) { emitList(node, node.properties, 131328 /* JsxElementAttributes */); } function emitJsxAttribute(node) { emit(node.name); - emitWithPrefix("=", node.initializer); + emitNodeWithPrefix("=", writePunctuation, node.initializer, emit); } function emitJsxSpreadAttribute(node) { - write("{..."); + writePunctuation("{..."); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } function emitJsxExpression(node) { if (node.expression) { - write("{"); + writePunctuation("{"); emitIfPresent(node.dotDotDotToken); emitExpression(node.expression); - write("}"); + writePunctuation("}"); } } function emitJsxTagName(node) { @@ -71625,13 +73189,15 @@ var ts; // Clauses // function emitCaseClause(node) { - write("case "); + writeKeyword("case"); + writeSpace(); emitExpression(node.expression); - write(":"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitDefaultClause(node) { - write("default:"); + writeKeyword("default"); + writePunctuation(":"); emitCaseOrDefaultClauseStatements(node, node.statements); } function emitCaseOrDefaultClauseStatements(parentNode, statements) { @@ -71658,25 +73224,25 @@ var ts; } var format = 81985 /* CaseOrDefaultClauseStatements */; if (emitAsSingleStatement) { - write(" "); + writeSpace(); format &= ~(1 /* MultiLine */ | 64 /* Indented */); } emitList(parentNode, statements, format); } function emitHeritageClause(node) { - write(" "); - writeTokenText(node.token); - write(" "); + writeSpace(); + writeTokenText(node.token, writeKeyword); + writeSpace(); emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - var openParenPos = writeToken(74 /* CatchKeyword */, node.pos); - write(" "); + var openParenPos = writeToken(74 /* CatchKeyword */, node.pos, writeKeyword); + writeSpace(); if (node.variableDeclaration) { - writeToken(19 /* OpenParenToken */, openParenPos); + writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); emit(node.variableDeclaration); - writeToken(20 /* CloseParenToken */, node.variableDeclaration.end); - write(" "); + writeToken(20 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation); + writeSpace(); } emit(node.block); } @@ -71685,7 +73251,8 @@ var ts; // function emitPropertyAssignment(node) { emit(node.name); - write(": "); + writePunctuation(":"); + writeSpace(); // This is to ensure that we emit comment in the following case: // For example: // obj = { @@ -71703,13 +73270,15 @@ var ts; function emitShorthandPropertyAssignment(node) { emit(node.name); if (node.objectAssignmentInitializer) { - write(" = "); + writeSpace(); + writePunctuation("="); + writeSpace(); emitExpression(node.objectAssignmentInitializer); } } function emitSpreadAssignment(node) { if (node.expression) { - write("..."); + writePunctuation("..."); emitExpression(node.expression); } } @@ -71718,7 +73287,7 @@ var ts; // function emitEnumMember(node) { emit(node.name); - emitExpressionWithPrefix(" = ", node.initializer); + emitInitializer(node.initializer); } // // Top-level nodes @@ -71816,33 +73385,60 @@ var ts; // // Helpers // + function emitNodeWithWriter(node, writer) { + var savedWrite = write; + write = writer; + emit(node); + write = savedWrite; + } function emitModifiers(node, modifiers) { if (modifiers && modifiers.length) { emitList(node, modifiers, 131328 /* Modifiers */); - write(" "); + writeSpace(); } } - function emitWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emit); - } - function emitExpressionWithPrefix(prefix, node) { - emitNodeWithPrefix(prefix, node, emitExpression); - } - function emitNodeWithPrefix(prefix, node, emit) { + function emitTypeAnnotation(node) { if (node) { - write(prefix); + writePunctuation(":"); + writeSpace(); emit(node); } } - function emitWithSuffix(node, suffix) { + function emitInitializer(node) { + if (node) { + writeSpace(); + writeOperator("="); + writeSpace(); + emitExpression(node); + } + } + function emitNodeWithPrefix(prefix, prefixWriter, node, emit) { + if (node) { + prefixWriter(prefix); + emit(node); + } + } + function emitWithLeadingSpace(node) { + if (node) { + writeSpace(); + emit(node); + } + } + function emitExpressionWithLeadingSpace(node) { + if (node) { + writeSpace(); + emitExpression(node); + } + } + function emitWithTrailingSpace(node) { if (node) { emit(node); - write(suffix); + writeSpace(); } } function emitEmbeddedStatement(parent, node) { if (ts.isBlock(node) || ts.getEmitFlags(parent) & 1 /* SingleLine */) { - write(" "); + writeSpace(); emit(node); } else { @@ -71856,13 +73452,16 @@ var ts; emitList(parentNode, decorators, 24577 /* Decorators */); } function emitTypeArguments(parentNode, typeArguments) { - emitList(parentNode, typeArguments, 26960 /* TypeArguments */); + emitList(parentNode, typeArguments, 26896 /* TypeArguments */); } function emitTypeParameters(parentNode, typeParameters) { - emitList(parentNode, typeParameters, 26960 /* TypeParameters */); + if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { + return emitTypeArguments(parentNode, parentNode.typeArguments); + } + emitList(parentNode, typeParameters, 26896 /* TypeParameters */); } function emitParameters(parentNode, parameters) { - emitList(parentNode, parameters, 1360 /* Parameters */); + emitList(parentNode, parameters, 1296 /* Parameters */); } function canEmitSimpleArrowHead(parentNode, parameters) { var parameter = ts.singleOrUndefined(parameters); @@ -71882,7 +73481,7 @@ var ts; } function emitParametersForArrow(parentNode, parameters) { if (canEmitSimpleArrowHead(parentNode, parameters)) { - emitList(parentNode, parameters, 1360 /* Parameters */ & ~1024 /* Parenthesis */); + emitList(parentNode, parameters, 1296 /* Parameters */ & ~1024 /* Parenthesis */); } else { emitParameters(parentNode, parameters); @@ -71897,6 +73496,23 @@ var ts; function emitExpressionList(parentNode, children, format, start, count) { emitNodeList(emitExpression, parentNode, children, format, start, count); } + function writeDelimiter(format) { + switch (format & 28 /* DelimitersMask */) { + case 0 /* None */: + break; + case 16 /* CommaDelimited */: + writePunctuation(","); + break; + case 4 /* BarDelimited */: + writeSpace(); + writePunctuation("|"); + break; + case 8 /* AmpersandDelimited */: + writeSpace(); + writePunctuation("&"); + break; + } + } function emitNodeList(emit, parentNode, children, format, start, count) { if (start === void 0) { start = 0; } if (count === void 0) { count = children ? children.length - start : 0; } @@ -71915,7 +73531,7 @@ var ts; return; } if (format & 7680 /* BracketsMask */) { - write(getOpeningBracket(format)); + writePunctuation(getOpeningBracket(format)); } if (onBeforeEmitNodeArray) { onBeforeEmitNodeArray(children); @@ -71926,7 +73542,7 @@ var ts; writeLine(); } else if (format & 128 /* SpaceBetweenBraces */ && !(format & 262144 /* NoSpaceIfEmpty */)) { - write(" "); + writeSpace(); } } else { @@ -71938,7 +73554,7 @@ var ts; shouldEmitInterveningComments = false; } else if (format & 128 /* SpaceBetweenBraces */) { - write(" "); + writeSpace(); } // Increase the indent, if requested. if (format & 64 /* Indented */) { @@ -71947,7 +73563,6 @@ var ts; // Emit each child. var previousSibling = void 0; var shouldDecreaseIndentAfterEmit = void 0; - var delimiter = getDelimiter(format); for (var i = 0; i < count; i++) { var child = children[start + i]; // Write the delimiter if this is not the first node. @@ -71958,10 +73573,10 @@ var ts; // a // /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline // , - if (delimiter && previousSibling.end !== parentNode.end) { + if (format & 28 /* DelimitersMask */ && previousSibling.end !== parentNode.end) { emitLeadingCommentsOfPosition(previousSibling.end); } - write(delimiter); + writeDelimiter(format); // Write either a line terminator or whitespace to separate the elements. if (shouldWriteSeparatingLineTerminator(previousSibling, child, format)) { // If a synthesized node in a single-line list starts on a new @@ -71974,7 +73589,7 @@ var ts; shouldEmitInterveningComments = false; } else if (previousSibling && format & 256 /* SpaceBetweenSiblings */) { - write(" "); + writeSpace(); } } // Emit this child. @@ -71997,7 +73612,7 @@ var ts; // Write a trailing comma, if requested. var hasTrailingComma = (format & 32 /* AllowTrailingComma */) && children.hasTrailingComma; if (format & 16 /* CommaDelimited */ && hasTrailingComma) { - write(","); + writePunctuation(","); } // Emit any trailing comment of the last element in the list // i.e @@ -72005,7 +73620,7 @@ var ts; // 2 // /* end of element 2 */ // ]; - if (previousSibling && delimiter && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024 /* NoTrailingComments */)) { + if (previousSibling && format & 28 /* DelimitersMask */ && previousSibling.end !== parentNode.end && !(ts.getEmitFlags(previousSibling) & 1024 /* NoTrailingComments */)) { emitLeadingCommentsOfPosition(previousSibling.end); } // Decrease the indent, if requested. @@ -72017,50 +73632,102 @@ var ts; writeLine(); } else if (format & 128 /* SpaceBetweenBraces */) { - write(" "); + writeSpace(); } } if (onAfterEmitNodeArray) { onAfterEmitNodeArray(children); } if (format & 7680 /* BracketsMask */) { - write(getClosingBracket(format)); + writePunctuation(getClosingBracket(format)); } } - function write(s) { + function commitPendingSemicolonInternal() { + if (pendingSemicolon) { + writeSemicolonInternal(); + pendingSemicolon = false; + } + } + function writeLiteral(s) { + commitPendingSemicolon(); + writer.writeLiteral(s); + } + function writeStringLiteral(s) { + commitPendingSemicolon(); + writer.writeStringLiteral(s); + } + function writeBase(s) { + commitPendingSemicolon(); writer.write(s); } + function writeSymbol(s, sym) { + commitPendingSemicolon(); + writer.writeSymbol(s, sym); + } + function writePunctuation(s) { + commitPendingSemicolon(); + writer.writePunctuation(s); + } + function deferWriteSemicolon() { + pendingSemicolon = true; + } + function writeSemicolonInternal() { + writer.writePunctuation(";"); + } + function writeKeyword(s) { + commitPendingSemicolon(); + writer.writeKeyword(s); + } + function writeOperator(s) { + commitPendingSemicolon(); + writer.writeOperator(s); + } + function writeParameter(s) { + commitPendingSemicolon(); + writer.writeParameter(s); + } + function writeSpace() { + commitPendingSemicolon(); + writer.writeSpace(" "); + } + function writeProperty(s) { + commitPendingSemicolon(); + writer.writeProperty(s); + } function writeLine() { + commitPendingSemicolon(); writer.writeLine(); } function increaseIndent() { + commitPendingSemicolon(); writer.increaseIndent(); } function decreaseIndent() { + commitPendingSemicolon(); writer.decreaseIndent(); } - function writeToken(token, pos, contextNode) { + function writeToken(token, pos, writer, contextNode) { return onEmitSourceMapOfToken - ? onEmitSourceMapOfToken(contextNode, token, pos, writeTokenText) - : writeTokenText(token, pos); + ? onEmitSourceMapOfToken(contextNode, token, writer, pos, writeTokenText) + : writeTokenText(token, writer, pos); } - function writeTokenNode(node) { + function writeTokenNode(node, writer) { if (onBeforeEmitToken) { onBeforeEmitToken(node); } - write(ts.tokenToString(node.kind)); + writer(ts.tokenToString(node.kind)); if (onAfterEmitToken) { onAfterEmitToken(node); } } - function writeTokenText(token, pos) { + function writeTokenText(token, writer, pos) { var tokenString = ts.tokenToString(token); - write(tokenString); + writer(tokenString); return pos < 0 ? pos : pos + tokenString.length; } function writeLineOrSpace(node) { if (ts.getEmitFlags(node) & 1 /* SingleLine */) { - write(" "); + writeSpace(); } else { writeLine(); @@ -72208,7 +73875,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -72251,6 +73918,7 @@ var ts; } tempFlagsStack.push(tempFlags); tempFlags = 0; + reservedNamesStack.push(reservedNames); } /** * Pop the current name generation scope. @@ -72260,15 +73928,22 @@ var ts; return; } tempFlags = tempFlagsStack.pop(); + reservedNames = reservedNamesStack.pop(); + } + function reserveNameInNestedScopes(name) { + if (!reservedNames || reservedNames === ts.lastOrUndefined(reservedNamesStack)) { + reservedNames = ts.createMap(); + } + reservedNames.set(name, true); } /** * Generate the text for a generated identifier. */ function generateName(name) { - if (name.autoGenerateKind === 4 /* Node */) { + if ((name.autoGenerateFlags & 7 /* KindMask */) === 4 /* Node */) { // Node names generate unique names based on their original node // and are cached based on that node's id. - if (name.skipNameGenerationScope) { + if (name.autoGenerateFlags & 8 /* SkipNameGenerationScope */) { var savedTempFlags = tempFlags; popNameGenerationScope(/*node*/ undefined); var result = generateNameCached(getNodeForGeneratedName(name)); @@ -72298,7 +73973,8 @@ var ts; function isUniqueName(name) { return !(hasGlobalName && hasGlobalName(name)) && !currentSourceFile.identifiers.has(name) - && !generatedNames.has(name); + && !generatedNames.has(name) + && !(reservedNames && reservedNames.has(name)); } /** * Returns a value indicating whether a name is unique within a container. @@ -72320,11 +73996,14 @@ var ts; * TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. * Note that names generated by makeTempVariableName and makeUniqueName will never conflict. */ - function makeTempVariableName(flags) { + function makeTempVariableName(flags, reservedInNestedScopes) { if (flags && !(tempFlags & flags)) { var name = flags === 268435456 /* _i */ ? "_i" : "_n"; if (isUniqueName(name)) { tempFlags |= flags; + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -72337,6 +74016,9 @@ var ts; ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); if (isUniqueName(name)) { + if (reservedInNestedScopes) { + reserveNameInNestedScopes(name); + } return name; } } @@ -72405,21 +74087,21 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - case 244 /* ExportAssignment */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 247 /* ExportAssignment */: return generateNameForExportDefault(); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return generateNameForClassExpression(); - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); @@ -72429,11 +74111,11 @@ var ts; * Generates a unique identifier for a node. */ function makeName(name) { - switch (name.autoGenerateKind) { + switch (name.autoGenerateFlags & 7 /* KindMask */) { case 1 /* Auto */: - return makeTempVariableName(0 /* Auto */); + return makeTempVariableName(0 /* Auto */, !!(name.autoGenerateFlags & 16 /* ReservedInNestedScopes */)); case 2 /* Loop */: - return makeTempVariableName(268435456 /* _i */); + return makeTempVariableName(268435456 /* _i */, !!(name.autoGenerateFlags & 16 /* ReservedInNestedScopes */)); case 3 /* Unique */: return makeUniqueName(ts.idText(name)); } @@ -72451,7 +74133,7 @@ var ts; // if "node" is a different generated name (having a different // "autoGenerateId"), use it and stop traversing. if (ts.isIdentifier(node) - && node.autoGenerateKind === 4 /* Node */ + && node.autoGenerateFlags === 4 /* Node */ && node.autoGenerateId !== autoGenerateId) { break; } @@ -72462,17 +74144,6 @@ var ts; } } ts.createPrinter = createPrinter; - function createDelimiterMap() { - var delimiters = []; - delimiters[0 /* None */] = ""; - delimiters[16 /* CommaDelimited */] = ","; - delimiters[4 /* BarDelimited */] = " |"; - delimiters[8 /* AmpersandDelimited */] = " &"; - return delimiters; - } - function getDelimiter(format) { - return delimiters[format & 28 /* DelimitersMask */]; - } function createBracketsMap() { var brackets = []; brackets[512 /* Braces */] = ["{", "}"]; @@ -72494,474 +74165,10 @@ var ts; TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; TempFlags[TempFlags["_i"] = 268435456] = "_i"; })(TempFlags || (TempFlags = {})); - var ListFormat; - (function (ListFormat) { - ListFormat[ListFormat["None"] = 0] = "None"; - // Line separators - ListFormat[ListFormat["SingleLine"] = 0] = "SingleLine"; - ListFormat[ListFormat["MultiLine"] = 1] = "MultiLine"; - ListFormat[ListFormat["PreserveLines"] = 2] = "PreserveLines"; - ListFormat[ListFormat["LinesMask"] = 3] = "LinesMask"; - // Delimiters - ListFormat[ListFormat["NotDelimited"] = 0] = "NotDelimited"; - ListFormat[ListFormat["BarDelimited"] = 4] = "BarDelimited"; - ListFormat[ListFormat["AmpersandDelimited"] = 8] = "AmpersandDelimited"; - ListFormat[ListFormat["CommaDelimited"] = 16] = "CommaDelimited"; - ListFormat[ListFormat["DelimitersMask"] = 28] = "DelimitersMask"; - ListFormat[ListFormat["AllowTrailingComma"] = 32] = "AllowTrailingComma"; - // Whitespace - ListFormat[ListFormat["Indented"] = 64] = "Indented"; - ListFormat[ListFormat["SpaceBetweenBraces"] = 128] = "SpaceBetweenBraces"; - ListFormat[ListFormat["SpaceBetweenSiblings"] = 256] = "SpaceBetweenSiblings"; - // Brackets/Braces - ListFormat[ListFormat["Braces"] = 512] = "Braces"; - ListFormat[ListFormat["Parenthesis"] = 1024] = "Parenthesis"; - ListFormat[ListFormat["AngleBrackets"] = 2048] = "AngleBrackets"; - ListFormat[ListFormat["SquareBrackets"] = 4096] = "SquareBrackets"; - ListFormat[ListFormat["BracketsMask"] = 7680] = "BracketsMask"; - ListFormat[ListFormat["OptionalIfUndefined"] = 8192] = "OptionalIfUndefined"; - ListFormat[ListFormat["OptionalIfEmpty"] = 16384] = "OptionalIfEmpty"; - ListFormat[ListFormat["Optional"] = 24576] = "Optional"; - // Other - ListFormat[ListFormat["PreferNewLine"] = 32768] = "PreferNewLine"; - ListFormat[ListFormat["NoTrailingNewLine"] = 65536] = "NoTrailingNewLine"; - ListFormat[ListFormat["NoInterveningComments"] = 131072] = "NoInterveningComments"; - ListFormat[ListFormat["NoSpaceIfEmpty"] = 262144] = "NoSpaceIfEmpty"; - ListFormat[ListFormat["SingleElement"] = 524288] = "SingleElement"; - // Precomputed Formats - ListFormat[ListFormat["Modifiers"] = 131328] = "Modifiers"; - ListFormat[ListFormat["HeritageClauses"] = 256] = "HeritageClauses"; - ListFormat[ListFormat["SingleLineTypeLiteralMembers"] = 448] = "SingleLineTypeLiteralMembers"; - ListFormat[ListFormat["MultiLineTypeLiteralMembers"] = 65] = "MultiLineTypeLiteralMembers"; - ListFormat[ListFormat["TupleTypeElements"] = 336] = "TupleTypeElements"; - ListFormat[ListFormat["UnionTypeConstituents"] = 260] = "UnionTypeConstituents"; - ListFormat[ListFormat["IntersectionTypeConstituents"] = 264] = "IntersectionTypeConstituents"; - ListFormat[ListFormat["ObjectBindingPatternElements"] = 432] = "ObjectBindingPatternElements"; - ListFormat[ListFormat["ArrayBindingPatternElements"] = 304] = "ArrayBindingPatternElements"; - ListFormat[ListFormat["ObjectLiteralExpressionProperties"] = 263122] = "ObjectLiteralExpressionProperties"; - ListFormat[ListFormat["ArrayLiteralExpressionElements"] = 4466] = "ArrayLiteralExpressionElements"; - ListFormat[ListFormat["CommaListElements"] = 272] = "CommaListElements"; - ListFormat[ListFormat["CallExpressionArguments"] = 1296] = "CallExpressionArguments"; - ListFormat[ListFormat["NewExpressionArguments"] = 9488] = "NewExpressionArguments"; - ListFormat[ListFormat["TemplateExpressionSpans"] = 131072] = "TemplateExpressionSpans"; - ListFormat[ListFormat["SingleLineBlockStatements"] = 384] = "SingleLineBlockStatements"; - ListFormat[ListFormat["MultiLineBlockStatements"] = 65] = "MultiLineBlockStatements"; - ListFormat[ListFormat["VariableDeclarationList"] = 272] = "VariableDeclarationList"; - ListFormat[ListFormat["SingleLineFunctionBodyStatements"] = 384] = "SingleLineFunctionBodyStatements"; - ListFormat[ListFormat["MultiLineFunctionBodyStatements"] = 1] = "MultiLineFunctionBodyStatements"; - ListFormat[ListFormat["ClassHeritageClauses"] = 256] = "ClassHeritageClauses"; - ListFormat[ListFormat["ClassMembers"] = 65] = "ClassMembers"; - ListFormat[ListFormat["InterfaceMembers"] = 65] = "InterfaceMembers"; - ListFormat[ListFormat["EnumMembers"] = 81] = "EnumMembers"; - ListFormat[ListFormat["CaseBlockClauses"] = 65] = "CaseBlockClauses"; - ListFormat[ListFormat["NamedImportsOrExportsElements"] = 432] = "NamedImportsOrExportsElements"; - ListFormat[ListFormat["JsxElementOrFragmentChildren"] = 131072] = "JsxElementOrFragmentChildren"; - ListFormat[ListFormat["JsxElementAttributes"] = 131328] = "JsxElementAttributes"; - ListFormat[ListFormat["CaseOrDefaultClauseStatements"] = 81985] = "CaseOrDefaultClauseStatements"; - ListFormat[ListFormat["HeritageClauseTypes"] = 272] = "HeritageClauseTypes"; - ListFormat[ListFormat["SourceFileStatements"] = 65537] = "SourceFileStatements"; - ListFormat[ListFormat["Decorators"] = 24577] = "Decorators"; - ListFormat[ListFormat["TypeArguments"] = 26960] = "TypeArguments"; - ListFormat[ListFormat["TypeParameters"] = 26960] = "TypeParameters"; - ListFormat[ListFormat["Parameters"] = 1360] = "Parameters"; - ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; - })(ListFormat || (ListFormat = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { - var outputFiles = []; - var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); - return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; - function writeFile(fileName, text, writeByteOrderMark) { - outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); - } - } - ts.getFileEmitOutput = getFileEmitOutput; - function createBuilder(options) { - var isModuleEmit; - var fileInfos = ts.createMap(); - var semanticDiagnosticsPerFile = ts.createMap(); - /** The map has key by source file's path that has been changed */ - var changedFilesSet = ts.createMap(); - var hasShapeChanged = ts.createMap(); - var allFilesExcludingDefaultLibraryFile; - var emitHandler; - return { - updateProgram: updateProgram, - getFilesAffectedBy: getFilesAffectedBy, - emitChangedFiles: emitChangedFiles, - getSemanticDiagnostics: getSemanticDiagnostics, - clear: clear - }; - function createProgramGraph(program) { - var currentIsModuleEmit = program.getCompilerOptions().module !== ts.ModuleKind.None; - if (isModuleEmit !== currentIsModuleEmit) { - isModuleEmit = currentIsModuleEmit; - emitHandler = isModuleEmit ? getModuleEmitHandler() : getNonModuleEmitHandler(); - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - } - hasShapeChanged.clear(); - allFilesExcludingDefaultLibraryFile = undefined; - ts.mutateMap(fileInfos, ts.arrayToMap(program.getSourceFiles(), function (sourceFile) { return sourceFile.path; }), { - // Add new file info - createNewValue: function (_path, sourceFile) { return addNewFileInfo(program, sourceFile); }, - // Remove existing file info - onDeleteValue: removeExistingFileInfo, - // We will update in place instead of deleting existing value and adding new one - onExistingValue: function (existingInfo, sourceFile) { return updateExistingFileInfo(program, existingInfo, sourceFile); } - }); - } - function registerChangedFile(path) { - changedFilesSet.set(path, true); - // All changed files need to re-evaluate its semantic diagnostics - semanticDiagnosticsPerFile.delete(path); - } - function addNewFileInfo(program, sourceFile) { - registerChangedFile(sourceFile.path); - emitHandler.onAddSourceFile(program, sourceFile); - return { version: sourceFile.version, signature: undefined }; - } - function removeExistingFileInfo(_existingFileInfo, path) { - // Since we dont need to track removed file as changed file - // We can just remove its diagnostics - changedFilesSet.delete(path); - semanticDiagnosticsPerFile.delete(path); - emitHandler.onRemoveSourceFile(path); - } - function updateExistingFileInfo(program, existingInfo, sourceFile) { - if (existingInfo.version !== sourceFile.version) { - registerChangedFile(sourceFile.path); - existingInfo.version = sourceFile.version; - emitHandler.onUpdateSourceFile(program, sourceFile); - } - else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) { - registerChangedFile(sourceFile.path); - } - } - function ensureProgramGraph(program) { - if (!emitHandler) { - createProgramGraph(program); - } - } - function updateProgram(newProgram) { - if (emitHandler) { - createProgramGraph(newProgram); - } - } - function getFilesAffectedBy(program, path) { - ensureProgramGraph(program); - var sourceFile = program.getSourceFileByPath(path); - if (!sourceFile) { - return ts.emptyArray; - } - if (!updateShapeSignature(program, sourceFile)) { - return [sourceFile]; - } - return emitHandler.getFilesAffectedByUpdatedShape(program, sourceFile); - } - function emitChangedFiles(program, writeFileCallback) { - ensureProgramGraph(program); - var compilerOptions = program.getCompilerOptions(); - if (!changedFilesSet.size) { - return ts.emptyArray; - } - // With --out or --outFile all outputs go into single file, do it only once - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - changedFilesSet.clear(); - return [program.emit(/*targetSourceFile*/ undefined, writeFileCallback)]; - } - var seenFiles = ts.createMap(); - var result; - changedFilesSet.forEach(function (_true, path) { - // Get the affected Files by this program - var affectedFiles = getFilesAffectedBy(program, path); - affectedFiles.forEach(function (affectedFile) { - // Affected files shouldnt have cached diagnostics - semanticDiagnosticsPerFile.delete(affectedFile.path); - if (!seenFiles.has(affectedFile.path)) { - seenFiles.set(affectedFile.path, true); - // Emit the affected file - (result || (result = [])).push(program.emit(affectedFile, writeFileCallback)); - } - }); - }); - changedFilesSet.clear(); - return result || ts.emptyArray; - } - function getSemanticDiagnostics(program, cancellationToken) { - ensureProgramGraph(program); - ts.Debug.assert(changedFilesSet.size === 0); - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outFile || compilerOptions.out) { - ts.Debug.assert(semanticDiagnosticsPerFile.size === 0); - // We dont need to cache the diagnostics just return them from program - return program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken); - } - var diagnostics; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken)); - } - return diagnostics || ts.emptyArray; - } - function getSemanticDiagnosticsOfFile(program, sourceFile, cancellationToken) { - var path = sourceFile.path; - var cachedDiagnostics = semanticDiagnosticsPerFile.get(path); - // Report the semantic diagnostics from the cache if we already have those diagnostics present - if (cachedDiagnostics) { - return cachedDiagnostics; - } - // Diagnostics werent cached, get them from program, and cache the result - var diagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken); - semanticDiagnosticsPerFile.set(path, diagnostics); - return diagnostics; - } - function clear() { - isModuleEmit = undefined; - emitHandler = undefined; - fileInfos.clear(); - semanticDiagnosticsPerFile.clear(); - changedFilesSet.clear(); - hasShapeChanged.clear(); - } - /** - * For script files that contains only ambient external modules, although they are not actually external module files, - * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore, - * there are no point to rebuild all script files if these special files have changed. However, if any statement - * in the file is not ambient external module, we treat it as a regular script file. - */ - function containsOnlyAmbientModules(sourceFile) { - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - if (!ts.isModuleWithStringLiteralName(statement)) { - return false; - } - } - return true; - } - /** - * @return {boolean} indicates if the shape signature has changed since last update. - */ - function updateShapeSignature(program, sourceFile) { - ts.Debug.assert(!!sourceFile); - // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate - if (hasShapeChanged.has(sourceFile.path)) { - return false; - } - hasShapeChanged.set(sourceFile.path, true); - var info = fileInfos.get(sourceFile.path); - ts.Debug.assert(!!info); - var prevSignature = info.signature; - var latestSignature; - if (sourceFile.isDeclarationFile) { - latestSignature = sourceFile.version; - info.signature = latestSignature; - } - else { - var emitOutput = getFileEmitOutput(program, sourceFile, /*emitOnlyDtsFiles*/ true); - if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { - latestSignature = options.computeHash(emitOutput.outputFiles[0].text); - info.signature = latestSignature; - } - else { - latestSignature = prevSignature; - } - } - return !prevSignature || latestSignature !== prevSignature; - } - /** - * Gets the referenced files for a file from the program with values for the keys as referenced file's path to be true - */ - function getReferencedFiles(program, sourceFile) { - var referencedFiles; - // We need to use a set here since the code can contain the same import twice, - // but that will only be one dependency. - // To avoid invernal conversion, the key of the referencedFiles map must be of type Path - if (sourceFile.imports && sourceFile.imports.length > 0) { - var checker = program.getTypeChecker(); - for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { - var importName = _a[_i]; - var symbol = checker.getSymbolAtLocation(importName); - if (symbol && symbol.declarations && symbol.declarations[0]) { - var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); - if (declarationSourceFile) { - addReferencedFile(declarationSourceFile.path); - } - } - } - } - var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); - // Handle triple slash references - if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { - for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { - var referencedFile = _c[_b]; - var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(referencedPath); - } - } - // Handle type reference directives - if (sourceFile.resolvedTypeReferenceDirectiveNames) { - sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { - if (!resolvedTypeReferenceDirective) { - return; - } - var fileName = resolvedTypeReferenceDirective.resolvedFileName; - var typeFilePath = ts.toPath(fileName, sourceFileDirectory, options.getCanonicalFileName); - addReferencedFile(typeFilePath); - }); - } - return referencedFiles; - function addReferencedFile(referencedPath) { - if (!referencedFiles) { - referencedFiles = ts.createMap(); - } - referencedFiles.set(referencedPath, true); - } - } - /** - * Gets all files of the program excluding the default library file - */ - function getAllFilesExcludingDefaultLibraryFile(program, firstSourceFile) { - // Use cached result - if (allFilesExcludingDefaultLibraryFile) { - return allFilesExcludingDefaultLibraryFile; - } - var result; - addSourceFile(firstSourceFile); - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - if (sourceFile !== firstSourceFile) { - addSourceFile(sourceFile); - } - } - allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; - return allFilesExcludingDefaultLibraryFile; - function addSourceFile(sourceFile) { - if (!program.isSourceFileDefaultLibrary(sourceFile)) { - (result || (result = [])).push(sourceFile); - } - } - } - function getNonModuleEmitHandler() { - return { - onAddSourceFile: ts.noop, - onRemoveSourceFile: ts.noop, - onUpdateSourceFile: ts.noop, - onUpdateSourceFileWithSameVersion: ts.returnFalse, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function getFilesAffectedByUpdatedShape(program, sourceFile) { - var options = program.getCompilerOptions(); - // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, - // so returning the file itself is good enough. - if (options && (options.out || options.outFile)) { - return [sourceFile]; - } - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - } - function getModuleEmitHandler() { - var references = ts.createMap(); - return { - onAddSourceFile: setReferences, - onRemoveSourceFile: onRemoveSourceFile, - onUpdateSourceFile: updateReferences, - onUpdateSourceFileWithSameVersion: updateReferencesTrackingChangedReferences, - getFilesAffectedByUpdatedShape: getFilesAffectedByUpdatedShape - }; - function setReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - } - function updateReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (newReferences) { - references.set(sourceFile.path, newReferences); - } - else { - references.delete(sourceFile.path); - } - } - function updateReferencesTrackingChangedReferences(program, sourceFile) { - var newReferences = getReferencedFiles(program, sourceFile); - if (!newReferences) { - // Changed if we had references - return references.delete(sourceFile.path); - } - var oldReferences = references.get(sourceFile.path); - references.set(sourceFile.path, newReferences); - if (!oldReferences || oldReferences.size !== newReferences.size) { - return true; - } - // If there are any new references that werent present previously there is change - return ts.forEachEntry(newReferences, function (_true, referencedPath) { return !oldReferences.delete(referencedPath); }) || - // Otherwise its changed if there are more references previously than now - !!oldReferences.size; - } - function onRemoveSourceFile(removedFilePath) { - // Remove existing references - references.forEach(function (referencesInFile, filePath) { - if (referencesInFile.has(removedFilePath)) { - // add files referencing the removedFilePath, as changed files too - var referencedByInfo = fileInfos.get(filePath); - if (referencedByInfo) { - registerChangedFile(filePath); - } - } - }); - // Delete the entry for the removed file path - references.delete(removedFilePath); - } - function getReferencedByPaths(referencedFilePath) { - return ts.mapDefinedIter(references.entries(), function (_a) { - var filePath = _a[0], referencesInFile = _a[1]; - return referencesInFile.has(referencedFilePath) ? filePath : undefined; - }); - } - function getFilesAffectedByUpdatedShape(program, sourceFile) { - if (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile)) { - return getAllFilesExcludingDefaultLibraryFile(program, sourceFile); - } - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { - return [sourceFile]; - } - // Now we need to if each file in the referencedBy list has a shape change as well. - // Because if so, its own referencedBy files need to be saved as well to make the - // emitting result consistent with files on disk. - var seenFileNamesMap = ts.createMap(); - // Start with the paths this file was referenced by - var path = sourceFile.path; - seenFileNamesMap.set(path, sourceFile); - var queue = getReferencedByPaths(path); - while (queue.length > 0) { - var currentPath = queue.pop(); - if (!seenFileNamesMap.has(currentPath)) { - var currentSourceFile = program.getSourceFileByPath(currentPath); - seenFileNamesMap.set(currentPath, currentSourceFile); - if (currentSourceFile && updateShapeSignature(program, currentSourceFile)) { - queue.push.apply(queue, getReferencedByPaths(currentPath)); - } - } - } - // Return array of values that needs emit - return ts.flatMapIter(seenFileNamesMap.values(), function (value) { return value; }); - } - } - } - ts.createBuilder = createBuilder; })(ts || (ts = {})); /// /// /// -/// var ts; (function (ts) { var ignoreDiagnosticCommentRegEx = /(^\s*$)|(^\s*\/\/\/?\s*(@ts-ignore)?)/; @@ -73155,23 +74362,31 @@ var ts; return errorMessage; } ts.formatDiagnostic = formatDiagnostic; - var redForegroundEscapeSequence = "\u001b[91m"; - var yellowForegroundEscapeSequence = "\u001b[93m"; - var blueForegroundEscapeSequence = "\u001b[93m"; + /** @internal */ + var ForegroundColorEscapeSequences; + (function (ForegroundColorEscapeSequences) { + ForegroundColorEscapeSequences["Grey"] = "\u001B[90m"; + ForegroundColorEscapeSequences["Red"] = "\u001B[91m"; + ForegroundColorEscapeSequences["Yellow"] = "\u001B[93m"; + ForegroundColorEscapeSequences["Blue"] = "\u001B[94m"; + ForegroundColorEscapeSequences["Cyan"] = "\u001B[96m"; + })(ForegroundColorEscapeSequences = ts.ForegroundColorEscapeSequences || (ts.ForegroundColorEscapeSequences = {})); var gutterStyleSequence = "\u001b[30;47m"; var gutterSeparator = " "; var resetEscapeSequence = "\u001b[0m"; var ellipsis = "..."; function getCategoryFormat(category) { switch (category) { - case ts.DiagnosticCategory.Warning: return yellowForegroundEscapeSequence; - case ts.DiagnosticCategory.Error: return redForegroundEscapeSequence; - case ts.DiagnosticCategory.Message: return blueForegroundEscapeSequence; + case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } - function formatAndReset(text, formatStyle) { + /** @internal */ + function formatColorAndReset(text, formatStyle) { return formatStyle + text + resetEscapeSequence; } + ts.formatColorAndReset = formatColorAndReset; function padLeft(s, length) { while (s.length < length) { s = " " + s; @@ -73184,9 +74399,9 @@ var ts; var diagnostic = diagnostics_2[_i]; var context = ""; if (diagnostic.file) { - var start = diagnostic.start, length_5 = diagnostic.length, file = diagnostic.file; + var start = diagnostic.start, length_4 = diagnostic.length, file = diagnostic.file; var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character; - var _b = ts.getLineAndCharacterOfPosition(file, start + length_5), lastLine = _b.line, lastLineChar = _b.character; + var _b = ts.getLineAndCharacterOfPosition(file, start + length_4), lastLine = _b.line, lastLineChar = _b.character; var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line; var relativeFileName = host ? ts.convertToRelativePath(file.fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); }) : file.fileName; var hasMoreThanFiveLines = (lastLine - firstLine) >= 4; @@ -73199,7 +74414,7 @@ var ts; // If the error spans over 5 lines, we'll only show the first 2 and last 2 lines, // so we'll skip ahead to the second-to-last line. if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { - context += formatAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); + context += formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine(); i = lastLine - 1; } var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0); @@ -73208,11 +74423,11 @@ var ts; lineContent = lineContent.replace(/\s+$/g, ""); // trim from end lineContent = lineContent.replace("\t", " "); // convert tabs to single spaces // Output the gutter and the actual contents of the line. - context += formatAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator; context += lineContent + host.getNewLine(); // Output the gutter and the error span for the line using tildes. - context += formatAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; - context += redForegroundEscapeSequence; + context += formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator; + context += ForegroundColorEscapeSequences.Red; if (i === firstLine) { // If we're on the last line, then limit it to the last character of the last line. // Otherwise, we'll just squiggle the rest of the line, giving 'slice' no end position. @@ -73229,19 +74444,25 @@ var ts; } context += resetEscapeSequence; } - output += host.getNewLine(); - output += relativeFileName + "(" + (firstLine + 1) + "," + (firstLineChar + 1) + "): "; + output += formatColorAndReset(relativeFileName, ForegroundColorEscapeSequences.Cyan); + output += ":"; + output += formatColorAndReset("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow); + output += ":"; + output += formatColorAndReset("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); + output += " - "; } var categoryColor = getCategoryFormat(diagnostic.category); var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatAndReset(category, categoryColor) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); + output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey); + output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); if (diagnostic.file) { output += host.getNewLine(); output += context; } output += host.getNewLine(); } - return output; + return output + host.getNewLine(); } ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext; function flattenDiagnosticMessageText(messageText, newLine) { @@ -73291,7 +74512,7 @@ var ts; */ /* @internal */ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames) { - // If we haven't create a program yet or has changed automatic type directives, then it is not up-to-date + // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date if (!program || hasChangedAutomaticTypeDirectiveNames) { return false; } @@ -73325,10 +74546,10 @@ var ts; } ts.isProgramUptoDate = isProgramUptoDate; /** - * Determined if source file needs to be re-created even if its text hasnt changed + * Determined if source file needs to be re-created even if its text hasn't changed */ function shouldProgramCreateNewSourceFiles(program, newOptions) { - // If any of these options change, we cant reuse old source file even if version match + // If any of these options change, we can't reuse old source file even if version match // The change in options like these could result in change in syntax tree change var oldOptions = program && program.getCompilerOptions(); return oldOptions && (oldOptions.target !== newOptions.target || @@ -73509,7 +74730,8 @@ var ts; dropDiagnosticsProducingTypeChecker: dropDiagnosticsProducingTypeChecker, getSourceFileFromReference: getSourceFileFromReference, sourceFileToPackageName: sourceFileToPackageName, - redirectTargetsSet: redirectTargetsSet + redirectTargetsSet: redirectTargetsSet, + isEmittedFile: isEmittedFile }; verifyCompilerOptions(); ts.performance.mark("afterProgram"); @@ -73656,9 +74878,13 @@ var ts; // If we change our policy of rechecking failed lookups on each program create, // we should adjust the value returned here. function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName, oldProgramState) { - var resolutionToFile = ts.getResolvedModule(oldProgramState.file, moduleName); - if (resolutionToFile) { - // module used to be resolved to file - ignore it + var resolutionToFile = ts.getResolvedModule(oldProgramState.oldSourceFile, moduleName); + var resolvedFile = resolutionToFile && oldProgramState.program && oldProgramState.program.getSourceFile(resolutionToFile.resolvedFileName); + if (resolutionToFile && resolvedFile && !resolvedFile.externalModuleIndicator) { + // In the old program, we resolved to an ambient module that was in the same + // place as we expected to find an actual module file. + // We actually need to return 'false' here even though this seems like a 'true' case + // because the normal module resolution algorithm will find this anyway. return false; } var ambientModule = oldProgramState.program && oldProgramState.program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(moduleName); @@ -73811,7 +75037,7 @@ var ts; var newSourceFilePath = ts.getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); if (resolveModuleNamesWorker) { var moduleNames = getModuleNames(newSourceFile); - var oldProgramState = { program: oldProgram, file: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldSourceFile, modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFilePath, newSourceFile, oldProgramState); // ensure that module resolution results are still correct var resolutionsChanged = ts.hasChangesInResolutions(moduleNames, resolutions, oldSourceFile.resolvedModules, ts.moduleResolutionIsEqualTo); @@ -73915,24 +75141,26 @@ var ts; } function emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, customTransformers) { var declarationDiagnostics = []; - if (options.noEmit) { - return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; - } - // If the noEmitOnError flag is set, then check if we have any errors so far. If so, - // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we - // get any preEmit diagnostics, not just the ones - if (options.noEmitOnError) { - var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); - if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { - declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); + if (!emitOnlyDtsFiles) { + if (options.noEmit) { + return { diagnostics: declarationDiagnostics, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; } - if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { - return { - diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), - sourceMaps: undefined, - emittedFiles: undefined, - emitSkipped: true - }; + // If the noEmitOnError flag is set, then check if we have any errors so far. If so, + // immediately bail out. Note that we pass 'undefined' for 'sourceFile' so that we + // get any preEmit diagnostics, not just the ones + if (options.noEmitOnError) { + var diagnostics = program.getOptionsDiagnostics(cancellationToken).concat(program.getSyntacticDiagnostics(sourceFile, cancellationToken), program.getGlobalDiagnostics(cancellationToken), program.getSemanticDiagnostics(sourceFile, cancellationToken)); + if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { + declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); + } + if (diagnostics.length > 0 || declarationDiagnostics.length > 0) { + return { + diagnostics: ts.concatenate(diagnostics, declarationDiagnostics), + sourceMaps: undefined, + emittedFiles: undefined, + emitSkipped: true + }; + } } } // Create the emit resolver outside of the "emitTime" tracking code below. That way @@ -73943,7 +75171,7 @@ var ts; // This is because in the -out scenario all files need to be emitted, and therefore all // files need to be type checked. And the way to specify that all files need to be type // checked is to not pass the file to getEmitResolver. - var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile); + var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver((options.outFile || options.out) ? undefined : sourceFile, cancellationToken); ts.performance.mark("beforeEmit"); var transformers = emitOnlyDtsFiles ? [] : ts.getTransformers(options, customTransformers); var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); @@ -74078,22 +75306,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } // falls through - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 227 /* VariableDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 230 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -74101,41 +75329,41 @@ var ts; } } switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 108 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } var prevParent = parent; @@ -74148,28 +75376,28 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 233 /* ClassDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } // falls through - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 209 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 212 /* VariableStatement */); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -74181,16 +75409,16 @@ var ts; return; } break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -74216,7 +75444,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 124 /* DeclareKeyword */: case 117 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); @@ -74306,6 +75534,7 @@ var ts; // synthesize 'import "tslib"' declaration var externalHelpersModuleReference = ts.createLiteral(ts.externalHelpersModuleNameText); var importDecl = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, /*importClause*/ undefined); + ts.addEmitFlags(importDecl, 67108864 /* NeverApplyImportHelper */); externalHelpersModuleReference.parent = importDecl; importDecl.parent = file; imports = [externalHelpersModuleReference]; @@ -74323,9 +75552,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || !ts.isStringLiteral(moduleNameExpr)) { break; @@ -74340,7 +75569,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) { var moduleName = node.name; var nameText = ts.getTextOfIdentifierOrLiteral(moduleName); @@ -74495,7 +75724,7 @@ var ts; } }, shouldCreateNewSourceFile); if (packageId) { - var packageIdKey = packageId.name + "/" + packageId.subModuleName + "@" + packageId.version; + var packageIdKey = ts.packageIdToString(packageId); var fileFromPackageId = packageIdToSourceFile.get(packageIdKey); if (fileFromPackageId) { // Some other SourceFile already exists with this package name and version. @@ -74622,7 +75851,7 @@ var ts; if (file.imports.length || file.moduleAugmentations.length) { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. var moduleNames = getModuleNames(file); - var oldProgramState = { program: oldProgram, file: file, modifiedFilePaths: modifiedFilePaths }; + var oldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths: modifiedFilePaths }; var resolutions = resolveModuleNamesReusingOldState(moduleNames, ts.getNormalizedAbsolutePath(file.fileName, currentDirectory), file, oldProgramState); ts.Debug.assert(resolutions.length === moduleNames.length); for (var i = 0; i < moduleNames.length; i++) { @@ -74829,6 +76058,14 @@ var ts; if (options.checkJs && !options.allowJs) { programDiagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs")); } + if (options.emitDeclarationOnly) { + if (!options.declaration) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations"); + } + if (options.noEmit) { + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); + } + } if (options.emitDecoratorMetadata && !options.experimentalDecorators) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"); @@ -74849,7 +76086,9 @@ var ts; var emitHost = getEmitHost(); var emitFilesSeen_1 = ts.createMap(); ts.forEachEmittedFile(emitHost, function (emitFileNames) { - verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + if (!options.emitDeclarationOnly) { + verifyEmitFilePath(emitFileNames.jsFilePath, emitFilesSeen_1); + } verifyEmitFilePath(emitFileNames.declarationFilePath, emitFilesSeen_1); }); } @@ -74859,13 +76098,13 @@ var ts; var emitFilePath = toPath(emitFileName); // Report error if the output overwrites input file if (filesByName.has(emitFilePath)) { - var chain_1; + var chain_2; if (!options.configFilePath) { // The program is from either an inferred project or an external project - chain_1 = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + chain_2 = ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } - chain_1 = ts.chainDiagnosticMessages(chain_1, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); - blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_1)); + chain_2 = ts.chainDiagnosticMessages(chain_2, ts.Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + blockEmittingOfFile(emitFileName, ts.createCompilerDiagnosticFromMessageChain(chain_2)); } var emitFileKey = !host.useCaseSensitiveFileNames() ? emitFilePath.toLocaleLowerCase() : emitFilePath; // Report error if multiple files write into same file @@ -74961,6 +76200,35 @@ var ts; hasEmitBlockingDiagnostics.set(toPath(emitFileName), true); programDiagnostics.add(diag); } + function isEmittedFile(file) { + if (options.noEmit) { + return false; + } + // If this is source file, its not emitted file + var filePath = toPath(file); + if (getSourceFileByPath(filePath)) { + return false; + } + // If options have --outFile or --out just check that + var out = options.outFile || options.out; + if (out) { + return isSameFile(filePath, out) || isSameFile(filePath, ts.removeFileExtension(out) + ".d.ts" /* Dts */); + } + // If --outDir, check if file is in that directory + if (options.outDir) { + return ts.containsPath(options.outDir, filePath, currentDirectory, !host.useCaseSensitiveFileNames()); + } + if (ts.fileExtensionIsOneOf(filePath, ts.supportedJavascriptExtensions) || ts.fileExtensionIs(filePath, ".d.ts" /* Dts */)) { + // Otherwise just check if sourceFile with the name exists + var filePathWithoutExtension = ts.removeFileExtension(filePath); + return !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".ts" /* Ts */)) || + !!getSourceFileByPath(ts.combinePaths(filePathWithoutExtension, ".tsx" /* Tsx */)); + } + return false; + } + function isSameFile(file1, file2) { + return ts.comparePaths(file1, file2, currentDirectory, !host.useCaseSensitiveFileNames()) === 0 /* EqualTo */; + } } ts.createProgram = createProgram; /* @internal */ @@ -75008,6 +76276,2161 @@ var ts; return res; } })(ts || (ts = {})); +/// +/*@internal*/ +var ts; +(function (ts) { + function getFileEmitOutput(program, sourceFile, emitOnlyDtsFiles, cancellationToken, customTransformers) { + var outputFiles = []; + var emitResult = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + return { outputFiles: outputFiles, emitSkipped: emitResult.emitSkipped }; + function writeFile(fileName, text, writeByteOrderMark) { + outputFiles.push({ name: fileName, writeByteOrderMark: writeByteOrderMark, text: text }); + } + } + ts.getFileEmitOutput = getFileEmitOutput; +})(ts || (ts = {})); +/*@internal*/ +(function (ts) { + var BuilderState; + (function (BuilderState) { + /** + * Gets the referenced files for a file from the program with values for the keys as referenced file's path to be true + */ + function getReferencedFiles(program, sourceFile, getCanonicalFileName) { + var referencedFiles; + // We need to use a set here since the code can contain the same import twice, + // but that will only be one dependency. + // To avoid invernal conversion, the key of the referencedFiles map must be of type Path + if (sourceFile.imports && sourceFile.imports.length > 0) { + var checker = program.getTypeChecker(); + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importName = _a[_i]; + var symbol = checker.getSymbolAtLocation(importName); + if (symbol && symbol.declarations && symbol.declarations[0]) { + var declarationSourceFile = ts.getSourceFileOfNode(symbol.declarations[0]); + if (declarationSourceFile) { + addReferencedFile(declarationSourceFile.path); + } + } + } + } + var sourceFileDirectory = ts.getDirectoryPath(sourceFile.path); + // Handle triple slash references + if (sourceFile.referencedFiles && sourceFile.referencedFiles.length > 0) { + for (var _b = 0, _c = sourceFile.referencedFiles; _b < _c.length; _b++) { + var referencedFile = _c[_b]; + var referencedPath = ts.toPath(referencedFile.fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(referencedPath); + } + } + // Handle type reference directives + if (sourceFile.resolvedTypeReferenceDirectiveNames) { + sourceFile.resolvedTypeReferenceDirectiveNames.forEach(function (resolvedTypeReferenceDirective) { + if (!resolvedTypeReferenceDirective) { + return; + } + var fileName = resolvedTypeReferenceDirective.resolvedFileName; + var typeFilePath = ts.toPath(fileName, sourceFileDirectory, getCanonicalFileName); + addReferencedFile(typeFilePath); + }); + } + return referencedFiles; + function addReferencedFile(referencedPath) { + if (!referencedFiles) { + referencedFiles = ts.createMap(); + } + referencedFiles.set(referencedPath, true); + } + } + /** + * Returns true if oldState is reusable, that is the emitKind = module/non module has not changed + */ + function canReuseOldState(newReferencedMap, oldState) { + return oldState && !oldState.referencedMap === !newReferencedMap; + } + BuilderState.canReuseOldState = canReuseOldState; + /** + * Creates the state of file references and signature for the new program from oldState if it is safe + */ + function create(newProgram, getCanonicalFileName, oldState) { + var fileInfos = ts.createMap(); + var referencedMap = newProgram.getCompilerOptions().module !== ts.ModuleKind.None ? ts.createMap() : undefined; + var hasCalledUpdateShapeSignature = ts.createMap(); + var useOldState = canReuseOldState(referencedMap, oldState); + // Create the reference map, and set the file infos + for (var _i = 0, _a = newProgram.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + var version_1 = sourceFile.version; + var oldInfo = useOldState && oldState.fileInfos.get(sourceFile.path); + if (referencedMap) { + var newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName); + if (newReferences) { + referencedMap.set(sourceFile.path, newReferences); + } + } + fileInfos.set(sourceFile.path, { version: version_1, signature: oldInfo && oldInfo.signature }); + } + return { + fileInfos: fileInfos, + referencedMap: referencedMap, + hasCalledUpdateShapeSignature: hasCalledUpdateShapeSignature, + allFilesExcludingDefaultLibraryFile: undefined, + allFileNames: undefined + }; + } + BuilderState.create = create; + /** + * Gets the files affected by the path from the program + */ + function getFilesAffectedBy(state, programOfThisState, path, cancellationToken, computeHash, cacheToUpdateSignature) { + // Since the operation could be cancelled, the signatures are always stored in the cache + // They will be commited once it is safe to use them + // eg when calling this api from tsserver, if there is no cancellation of the operation + // In the other cases the affected files signatures are commited only after the iteration through the result is complete + var signatureCache = cacheToUpdateSignature || ts.createMap(); + var sourceFile = programOfThisState.getSourceFileByPath(path); + if (!sourceFile) { + return ts.emptyArray; + } + if (!updateShapeSignature(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash)) { + return [sourceFile]; + } + var result = (state.referencedMap ? getFilesAffectedByUpdatedShapeWhenModuleEmit : getFilesAffectedByUpdatedShapeWhenNonModuleEmit)(state, programOfThisState, sourceFile, signatureCache, cancellationToken, computeHash); + if (!cacheToUpdateSignature) { + // Commit all the signatures in the signature cache + updateSignaturesFromCache(state, signatureCache); + } + return result; + } + BuilderState.getFilesAffectedBy = getFilesAffectedBy; + /** + * Updates the signatures from the cache into state's fileinfo signatures + * This should be called whenever it is safe to commit the state of the builder + */ + function updateSignaturesFromCache(state, signatureCache) { + signatureCache.forEach(function (signature, path) { + state.fileInfos.get(path).signature = signature; + state.hasCalledUpdateShapeSignature.set(path, true); + }); + } + BuilderState.updateSignaturesFromCache = updateSignaturesFromCache; + /** + * Returns if the shape of the signature has changed since last emit + */ + function updateShapeSignature(state, programOfThisState, sourceFile, cacheToUpdateSignature, cancellationToken, computeHash) { + ts.Debug.assert(!!sourceFile); + // If we have cached the result for this file, that means hence forth we should assume file shape is uptodate + if (state.hasCalledUpdateShapeSignature.has(sourceFile.path) || cacheToUpdateSignature.has(sourceFile.path)) { + return false; + } + var info = state.fileInfos.get(sourceFile.path); + ts.Debug.assert(!!info); + var prevSignature = info.signature; + var latestSignature; + if (sourceFile.isDeclarationFile) { + latestSignature = sourceFile.version; + } + else { + var emitOutput = ts.getFileEmitOutput(programOfThisState, sourceFile, /*emitOnlyDtsFiles*/ true, cancellationToken); + if (emitOutput.outputFiles && emitOutput.outputFiles.length > 0) { + latestSignature = computeHash(emitOutput.outputFiles[0].text); + } + else { + latestSignature = prevSignature; + } + } + cacheToUpdateSignature.set(sourceFile.path, latestSignature); + return !prevSignature || latestSignature !== prevSignature; + } + /** + * Get all the dependencies of the sourceFile + */ + function getAllDependencies(state, programOfThisState, sourceFile) { + var compilerOptions = programOfThisState.getCompilerOptions(); + // With --out or --outFile all outputs go into single file, all files depend on each other + if (compilerOptions.outFile || compilerOptions.out) { + return getAllFileNames(state, programOfThisState); + } + // If this is non module emit, or its a global file, it depends on all the source files + if (!state.referencedMap || (!ts.isExternalModule(sourceFile) && !containsOnlyAmbientModules(sourceFile))) { + return getAllFileNames(state, programOfThisState); + } + // Get the references, traversing deep from the referenceMap + var seenMap = ts.createMap(); + var queue = [sourceFile.path]; + while (queue.length) { + var path = queue.pop(); + if (!seenMap.has(path)) { + seenMap.set(path, true); + var references = state.referencedMap.get(path); + if (references) { + var iterator = references.keys(); + for (var _a = iterator.next(), value = _a.value, done = _a.done; !done; _b = iterator.next(), value = _b.value, done = _b.done, _b) { + queue.push(value); + } + } + } + } + return ts.arrayFrom(ts.mapDefinedIterator(seenMap.keys(), function (path) { + var file = programOfThisState.getSourceFileByPath(path); + return file ? file.fileName : path; + })); + var _b; + } + BuilderState.getAllDependencies = getAllDependencies; + /** + * Gets the names of all files from the program + */ + function getAllFileNames(state, programOfThisState) { + if (!state.allFileNames) { + var sourceFiles = programOfThisState.getSourceFiles(); + state.allFileNames = sourceFiles === ts.emptyArray ? ts.emptyArray : sourceFiles.map(function (file) { return file.fileName; }); + } + return state.allFileNames; + } + /** + * Gets the files referenced by the the file path + */ + function getReferencedByPaths(state, referencedFilePath) { + return ts.arrayFrom(ts.mapDefinedIterator(state.referencedMap.entries(), function (_a) { + var filePath = _a[0], referencesInFile = _a[1]; + return referencesInFile.has(referencedFilePath) ? filePath : undefined; + })); + } + /** + * For script files that contains only ambient external modules, although they are not actually external module files, + * they can only be consumed via importing elements from them. Regular script files cannot consume them. Therefore, + * there are no point to rebuild all script files if these special files have changed. However, if any statement + * in the file is not ambient external module, we treat it as a regular script file. + */ + function containsOnlyAmbientModules(sourceFile) { + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + if (!ts.isModuleWithStringLiteralName(statement)) { + return false; + } + } + return true; + } + /** + * Gets all files of the program excluding the default library file + */ + function getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, firstSourceFile) { + // Use cached result + if (state.allFilesExcludingDefaultLibraryFile) { + return state.allFilesExcludingDefaultLibraryFile; + } + var result; + addSourceFile(firstSourceFile); + for (var _i = 0, _a = programOfThisState.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile = _a[_i]; + if (sourceFile !== firstSourceFile) { + addSourceFile(sourceFile); + } + } + state.allFilesExcludingDefaultLibraryFile = result || ts.emptyArray; + return state.allFilesExcludingDefaultLibraryFile; + function addSourceFile(sourceFile) { + if (!programOfThisState.isSourceFileDefaultLibrary(sourceFile)) { + (result || (result = [])).push(sourceFile); + } + } + } + /** + * When program emits non modular code, gets the files affected by the sourceFile whose shape has changed + */ + function getFilesAffectedByUpdatedShapeWhenNonModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape) { + var compilerOptions = programOfThisState.getCompilerOptions(); + // If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project, + // so returning the file itself is good enough. + if (compilerOptions && (compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + /** + * When program emits modular code, gets the files affected by the sourceFile whose shape has changed + */ + function getFilesAffectedByUpdatedShapeWhenModuleEmit(state, programOfThisState, sourceFileWithUpdatedShape, cacheToUpdateSignature, cancellationToken, computeHash) { + if (!ts.isExternalModule(sourceFileWithUpdatedShape) && !containsOnlyAmbientModules(sourceFileWithUpdatedShape)) { + return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape); + } + var compilerOptions = programOfThisState.getCompilerOptions(); + if (compilerOptions && (compilerOptions.isolatedModules || compilerOptions.out || compilerOptions.outFile)) { + return [sourceFileWithUpdatedShape]; + } + // Now we need to if each file in the referencedBy list has a shape change as well. + // Because if so, its own referencedBy files need to be saved as well to make the + // emitting result consistent with files on disk. + var seenFileNamesMap = ts.createMap(); + // Start with the paths this file was referenced by + seenFileNamesMap.set(sourceFileWithUpdatedShape.path, sourceFileWithUpdatedShape); + var queue = getReferencedByPaths(state, sourceFileWithUpdatedShape.path); + while (queue.length > 0) { + var currentPath = queue.pop(); + if (!seenFileNamesMap.has(currentPath)) { + var currentSourceFile = programOfThisState.getSourceFileByPath(currentPath); + seenFileNamesMap.set(currentPath, currentSourceFile); + if (currentSourceFile && updateShapeSignature(state, programOfThisState, currentSourceFile, cacheToUpdateSignature, cancellationToken, computeHash)) { + queue.push.apply(queue, getReferencedByPaths(state, currentPath)); + } + } + } + // Return array of values that needs emit + // Return array of values that needs emit + return ts.arrayFrom(ts.mapDefinedIterator(seenFileNamesMap.values(), function (value) { return value; })); + } + })(BuilderState = ts.BuilderState || (ts.BuilderState = {})); +})(ts || (ts = {})); +/// +/*@internal*/ +var ts; +(function (ts) { + function hasSameKeys(map1, map2) { + // Has same size and every key is present in both maps + return map1 === map2 || map1 && map2 && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); }); + } + /** + * Create the state so that we can iterate on changedFiles/affected files + */ + function createBuilderProgramState(newProgram, getCanonicalFileName, oldState) { + var state = ts.BuilderState.create(newProgram, getCanonicalFileName, oldState); + state.program = newProgram; + var compilerOptions = newProgram.getCompilerOptions(); + if (!compilerOptions.outFile && !compilerOptions.out) { + state.semanticDiagnosticsPerFile = ts.createMap(); + } + state.changedFilesSet = ts.createMap(); + var useOldState = ts.BuilderState.canReuseOldState(state.referencedMap, oldState); + var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile; + if (useOldState) { + // Verify the sanity of old state + if (!oldState.currentChangedFilePath) { + ts.Debug.assert(!oldState.affectedFiles && (!oldState.currentAffectedFilesSignatures || !oldState.currentAffectedFilesSignatures.size), "Cannot reuse if only few affected files of currentChangedFile were iterated"); + } + if (canCopySemanticDiagnostics) { + ts.Debug.assert(!ts.forEachKey(oldState.changedFilesSet, function (path) { return oldState.semanticDiagnosticsPerFile.has(path); }), "Semantic diagnostics shouldnt be available for changed files"); + } + // Copy old state's changed files set + ts.copyEntries(oldState.changedFilesSet, state.changedFilesSet); + } + // Update changed files and copy semantic diagnostics if we can + var referencedMap = state.referencedMap; + var oldReferencedMap = useOldState && oldState.referencedMap; + state.fileInfos.forEach(function (info, sourceFilePath) { + var oldInfo; + var newReferences; + // if not using old state, every file is changed + if (!useOldState || + // File wasnt present in old state + !(oldInfo = oldState.fileInfos.get(sourceFilePath)) || + // versions dont match + oldInfo.version !== info.version || + // Referenced files changed + !hasSameKeys(newReferences = referencedMap && referencedMap.get(sourceFilePath), oldReferencedMap && oldReferencedMap.get(sourceFilePath)) || + // Referenced file was deleted in the new program + newReferences && ts.forEachKey(newReferences, function (path) { return !state.fileInfos.has(path) && oldState.fileInfos.has(path); })) { + // Register file as changed file and do not copy semantic diagnostics, since all changed files need to be re-evaluated + state.changedFilesSet.set(sourceFilePath, true); + } + else if (canCopySemanticDiagnostics) { + // Unchanged file copy diagnostics + var diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath); + if (diagnostics) { + state.semanticDiagnosticsPerFile.set(sourceFilePath, diagnostics); + } + } + }); + return state; + } + /** + * Verifies that source file is ok to be used in calls that arent handled by next + */ + function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) { + ts.Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.path)); + } + /** + * This function returns the next affected file to be processed. + * Note that until doneAffected is called it would keep reporting same result + * This is to allow the callers to be able to actually remove affected file only when the operation is complete + * eg. if during diagnostics check cancellation token ends up cancelling the request, the affected file should be retained + */ + function getNextAffectedFile(state, cancellationToken, computeHash) { + while (true) { + var affectedFiles = state.affectedFiles; + if (affectedFiles) { + var seenAffectedFiles = state.seenAffectedFiles, semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile; + var affectedFilesIndex = state.affectedFilesIndex; + while (affectedFilesIndex < affectedFiles.length) { + var affectedFile = affectedFiles[affectedFilesIndex]; + if (!seenAffectedFiles.has(affectedFile.path)) { + // Set the next affected file as seen and remove the cached semantic diagnostics + state.affectedFilesIndex = affectedFilesIndex; + semanticDiagnosticsPerFile.delete(affectedFile.path); + return affectedFile; + } + seenAffectedFiles.set(affectedFile.path, true); + affectedFilesIndex++; + } + // Remove the changed file from the change set + state.changedFilesSet.delete(state.currentChangedFilePath); + state.currentChangedFilePath = undefined; + // Commit the changes in file signature + ts.BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures); + state.currentAffectedFilesSignatures.clear(); + state.affectedFiles = undefined; + } + // Get next changed file + var nextKey = state.changedFilesSet.keys().next(); + if (nextKey.done) { + // Done + return undefined; + } + // With --out or --outFile all outputs go into single file + // so operations are performed directly on program, return program + var compilerOptions = state.program.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + ts.Debug.assert(!state.semanticDiagnosticsPerFile); + return state.program; + } + // Get next batch of affected files + state.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures || ts.createMap(); + state.affectedFiles = ts.BuilderState.getFilesAffectedBy(state, state.program, nextKey.value, cancellationToken, computeHash, state.currentAffectedFilesSignatures); + state.currentChangedFilePath = nextKey.value; + state.semanticDiagnosticsPerFile.delete(nextKey.value); + state.affectedFilesIndex = 0; + state.seenAffectedFiles = state.seenAffectedFiles || ts.createMap(); + } + } + /** + * This is called after completing operation on the next affected file. + * The operations here are postponed to ensure that cancellation during the iteration is handled correctly + */ + function doneWithAffectedFile(state, affected) { + if (affected === state.program) { + state.changedFilesSet.clear(); + } + else { + state.seenAffectedFiles.set(affected.path, true); + state.affectedFilesIndex++; + } + } + /** + * Returns the result with affected file + */ + function toAffectedFileResult(state, result, affected) { + doneWithAffectedFile(state, affected); + return { result: result, affected: affected }; + } + /** + * Gets the semantic diagnostics either from cache if present, or otherwise from program and caches it + * Note that it is assumed that the when asked about semantic diagnostics, the file has been taken out of affected files/changed file set + */ + function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken) { + var path = sourceFile.path; + var cachedDiagnostics = state.semanticDiagnosticsPerFile.get(path); + // Report the semantic diagnostics from the cache if we already have those diagnostics present + if (cachedDiagnostics) { + return cachedDiagnostics; + } + // Diagnostics werent cached, get them from program, and cache the result + var diagnostics = state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + state.semanticDiagnosticsPerFile.set(path, diagnostics); + return diagnostics; + } + var BuilderProgramKind; + (function (BuilderProgramKind) { + BuilderProgramKind[BuilderProgramKind["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram"; + BuilderProgramKind[BuilderProgramKind["EmitAndSemanticDiagnosticsBuilderProgram"] = 1] = "EmitAndSemanticDiagnosticsBuilderProgram"; + })(BuilderProgramKind = ts.BuilderProgramKind || (ts.BuilderProgramKind = {})); + function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + var host; + var newProgram; + if (ts.isArray(newProgramOrRootNames)) { + newProgram = ts.createProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram && oldProgram.getProgram()); + host = oldProgramOrHost; + } + else { + newProgram = newProgramOrRootNames; + host = hostOrOptions; + oldProgram = oldProgramOrHost; + } + return { host: host, newProgram: newProgram, oldProgram: oldProgram }; + } + ts.getBuilderCreationParameters = getBuilderCreationParameters; + function createBuilderProgram(kind, _a) { + var newProgram = _a.newProgram, host = _a.host, oldProgram = _a.oldProgram; + // Return same program if underlying program doesnt change + var oldState = oldProgram && oldProgram.getState(); + if (oldState && newProgram === oldState.program) { + newProgram = undefined; + oldState = undefined; + return oldProgram; + } + /** + * Create the canonical file name for identity + */ + var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames()); + /** + * Computing hash to for signature verification + */ + var computeHash = host.createHash || ts.identity; + var state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState); + // To ensure that we arent storing any references to old program or new program without state + newProgram = undefined; + oldProgram = undefined; + oldState = undefined; + var result = { + getState: function () { return state; }, + getProgram: function () { return state.program; }, + getCompilerOptions: function () { return state.program.getCompilerOptions(); }, + getSourceFile: function (fileName) { return state.program.getSourceFile(fileName); }, + getSourceFiles: function () { return state.program.getSourceFiles(); }, + getOptionsDiagnostics: function (cancellationToken) { return state.program.getOptionsDiagnostics(cancellationToken); }, + getGlobalDiagnostics: function (cancellationToken) { return state.program.getGlobalDiagnostics(cancellationToken); }, + getSyntacticDiagnostics: function (sourceFile, cancellationToken) { return state.program.getSyntacticDiagnostics(sourceFile, cancellationToken); }, + getSemanticDiagnostics: getSemanticDiagnostics, + emit: emit, + getAllDependencies: function (sourceFile) { return ts.BuilderState.getAllDependencies(state, state.program, sourceFile); }, + getCurrentDirectory: function () { return state.program.getCurrentDirectory(); } + }; + if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { + result.getSemanticDiagnosticsOfNextAffectedFile = getSemanticDiagnosticsOfNextAffectedFile; + } + else if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + result.emitNextAffectedFile = emitNextAffectedFile; + } + else { + ts.notImplemented(); + } + return result; + /** + * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + function emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash); + if (!affected) { + // Done + return undefined; + } + return toAffectedFileResult(state, + // When whole program is affected, do emit only once (eg when --out or --outFile is specified) + // Otherwise just affected file + state.program.emit(affected === state.program ? undefined : affected, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers), affected); + } + /** + * Emits the JavaScript and declaration files. + * When targetSource file is specified, emits the files corresponding to that source file, + * otherwise for the whole program. + * In case of EmitAndSemanticDiagnosticsBuilderProgram, when targetSourceFile is specified, + * it is assumed that that file is handled from affected file list. If targetSourceFile is not specified, + * it will only emit all the affected files instead of whole program + * + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + function emit(targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) { + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile); + if (!targetSourceFile) { + // Emit and report any errors we ran into. + var sourceMaps = []; + var emitSkipped = void 0; + var diagnostics = void 0; + var emittedFiles = []; + var affectedEmitResult = void 0; + while (affectedEmitResult = emitNextAffectedFile(writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers)) { + emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped; + diagnostics = ts.addRange(diagnostics, affectedEmitResult.result.diagnostics); + emittedFiles = ts.addRange(emittedFiles, affectedEmitResult.result.emittedFiles); + sourceMaps = ts.addRange(sourceMaps, affectedEmitResult.result.sourceMaps); + } + return { + emitSkipped: emitSkipped, + diagnostics: diagnostics || ts.emptyArray, + emittedFiles: emittedFiles, + sourceMaps: sourceMaps + }; + } + } + return state.program.emit(targetSourceFile, writeFile || host.writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + } + /** + * Return the semantic diagnostics for the next affected file or undefined if iteration is complete + * If provided ignoreSourceFile would be called before getting the diagnostics and would ignore the sourceFile if the returned value was true + */ + function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) { + while (true) { + var affected = getNextAffectedFile(state, cancellationToken, computeHash); + if (!affected) { + // Done + return undefined; + } + else if (affected === state.program) { + // When whole program is affected, get all semantic diagnostics (eg when --out or --outFile is specified) + return toAffectedFileResult(state, state.program.getSemanticDiagnostics(/*targetSourceFile*/ undefined, cancellationToken), affected); + } + // Get diagnostics for the affected file if its not ignored + if (ignoreSourceFile && ignoreSourceFile(affected)) { + // Get next affected file + doneWithAffectedFile(state, affected); + continue; + } + return toAffectedFileResult(state, getSemanticDiagnosticsOfFile(state, affected, cancellationToken), affected); + } + } + /** + * Gets the semantic diagnostics from the program corresponding to this state of file (if provided) or whole program + * The semantic diagnostics are cached and managed here + * Note that it is assumed that when asked about semantic diagnostics through this API, + * the file has been taken out of affected files so it is safe to use cache or get from program and cache the diagnostics + * In case of SemanticDiagnosticsBuilderProgram if the source file is not provided, + * it will iterate through all the affected files, to ensure that cache stays valid and yet provide a way to get all semantic diagnostics + */ + function getSemanticDiagnostics(sourceFile, cancellationToken) { + assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); + var compilerOptions = state.program.getCompilerOptions(); + if (compilerOptions.outFile || compilerOptions.out) { + ts.Debug.assert(!state.semanticDiagnosticsPerFile); + // We dont need to cache the diagnostics just return them from program + return state.program.getSemanticDiagnostics(sourceFile, cancellationToken); + } + if (sourceFile) { + return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken); + } + if (kind === BuilderProgramKind.SemanticDiagnosticsBuilderProgram) { + // When semantic builder asks for diagnostics of the whole program, + // ensure that all the affected files are handled + var affected = void 0; + while (affected = getNextAffectedFile(state, cancellationToken, computeHash)) { + doneWithAffectedFile(state, affected); + } + } + var diagnostics; + for (var _i = 0, _a = state.program.getSourceFiles(); _i < _a.length; _i++) { + var sourceFile_1 = _a[_i]; + diagnostics = ts.addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile_1, cancellationToken)); + } + return diagnostics || ts.emptyArray; + } + } + ts.createBuilderProgram = createBuilderProgram; +})(ts || (ts = {})); +(function (ts) { + function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + return ts.createBuilderProgram(ts.BuilderProgramKind.SemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram)); + } + ts.createSemanticDiagnosticsBuilderProgram = createSemanticDiagnosticsBuilderProgram; + function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + return ts.createBuilderProgram(ts.BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram, ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram)); + } + ts.createEmitAndSemanticDiagnosticsBuilderProgram = createEmitAndSemanticDiagnosticsBuilderProgram; + function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram) { + var program = ts.getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, oldProgram).newProgram; + return { + // Only return program, all other methods are not implemented + getProgram: function () { return program; }, + getState: ts.notImplemented, + getCompilerOptions: ts.notImplemented, + getSourceFile: ts.notImplemented, + getSourceFiles: ts.notImplemented, + getOptionsDiagnostics: ts.notImplemented, + getGlobalDiagnostics: ts.notImplemented, + getSyntacticDiagnostics: ts.notImplemented, + getSemanticDiagnostics: ts.notImplemented, + emit: ts.notImplemented, + getAllDependencies: ts.notImplemented, + getCurrentDirectory: ts.notImplemented + }; + } + ts.createAbstractBuilder = createAbstractBuilder; +})(ts || (ts = {})); +/// +/* @internal */ +var ts; +(function (ts) { + function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames) { + if (!host.getDirectories || !host.readDirectory) { + return undefined; + } + var cachedReadDirectoryResult = ts.createMap(); + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + fileExists: fileExists, + readFile: function (path, encoding) { return host.readFile(path, encoding); }, + directoryExists: host.directoryExists && directoryExists, + getDirectories: getDirectories, + readDirectory: readDirectory, + createDirectory: host.createDirectory && createDirectory, + writeFile: host.writeFile && writeFile, + addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, + addOrDeleteFile: addOrDeleteFile, + clearCache: clearCache + }; + function toPath(fileName) { + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function getCachedFileSystemEntries(rootDirPath) { + return cachedReadDirectoryResult.get(rootDirPath); + } + function getCachedFileSystemEntriesForBaseDir(path) { + return getCachedFileSystemEntries(ts.getDirectoryPath(path)); + } + function getBaseNameOfFileName(fileName) { + return ts.getBaseFileName(ts.normalizePath(fileName)); + } + function createCachedFileSystemEntries(rootDir, rootDirPath) { + var resultFromHost = { + files: ts.map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [], + directories: host.getDirectories(rootDir) || [] + }; + cachedReadDirectoryResult.set(rootDirPath, resultFromHost); + return resultFromHost; + } + /** + * If the readDirectory result was already cached, it returns that + * Otherwise gets result from host and caches it. + * The host request is done under try catch block to avoid caching incorrect result + */ + function tryReadDirectory(rootDir, rootDirPath) { + var cachedResult = getCachedFileSystemEntries(rootDirPath); + if (cachedResult) { + return cachedResult; + } + try { + return createCachedFileSystemEntries(rootDir, rootDirPath); + } + catch (_e) { + // If there is exception to read directories, dont cache the result and direct the calls to host + ts.Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); + return undefined; + } + } + function fileNameEqual(name1, name2) { + return getCanonicalFileName(name1) === getCanonicalFileName(name2); + } + function hasEntry(entries, name) { + return ts.some(entries, function (file) { return fileNameEqual(file, name); }); + } + function updateFileSystemEntry(entries, baseName, isValid) { + if (hasEntry(entries, baseName)) { + if (!isValid) { + return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); + } + } + else if (isValid) { + return entries.push(baseName); + } + } + function writeFile(fileName, data, writeByteOrderMark) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + if (result) { + updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), /*fileExists*/ true); + } + return host.writeFile(fileName, data, writeByteOrderMark); + } + function fileExists(fileName) { + var path = toPath(fileName); + var result = getCachedFileSystemEntriesForBaseDir(path); + return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || + host.fileExists(fileName); + } + function directoryExists(dirPath) { + var path = toPath(dirPath); + return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); + } + function createDirectory(dirPath) { + var path = toPath(dirPath); + var result = getCachedFileSystemEntriesForBaseDir(path); + var baseFileName = getBaseNameOfFileName(dirPath); + if (result) { + updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true); + } + host.createDirectory(dirPath); + } + function getDirectories(rootDir) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return result.directories.slice(); + } + return host.getDirectories(rootDir); + } + function readDirectory(rootDir, extensions, excludes, includes, depth) { + var rootDirPath = toPath(rootDir); + var result = tryReadDirectory(rootDir, rootDirPath); + if (result) { + return ts.matchFiles(rootDir, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries); + } + return host.readDirectory(rootDir, extensions, excludes, includes, depth); + function getFileSystemEntries(dir) { + var path = toPath(dir); + if (path === rootDirPath) { + return result; + } + return tryReadDirectory(dir, path) || ts.emptyFileSystemEntries; + } + } + function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { + var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); + if (existingResult) { + // Just clear the cache for now + // For now just clear the cache, since this could mean that multiple level entries might need to be re-evaluated + clearCache(); + return undefined; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); + if (!parentResult) { + return undefined; + } + // This was earlier a file (hence not in cached directory contents) + // or we never cached the directory containing it + if (!host.directoryExists) { + // Since host doesnt support directory exists, clear the cache as otherwise it might not be same + clearCache(); + return undefined; + } + var baseName = getBaseNameOfFileName(fileOrDirectory); + var fsQueryResult = { + fileExists: host.fileExists(fileOrDirectoryPath), + directoryExists: host.directoryExists(fileOrDirectoryPath) + }; + if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { + // Folder added or removed, clear the cache instead of updating the folder and its structure + clearCache(); + } + else { + // No need to update the directory structure, just files + updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); + } + return fsQueryResult; + } + function addOrDeleteFile(fileName, filePath, eventKind) { + if (eventKind === ts.FileWatcherEventKind.Changed) { + return; + } + var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); + if (parentResult) { + updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); + } + } + function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { + updateFileSystemEntry(parentResult.files, baseName, fileExists); + } + function clearCache() { + cachedReadDirectoryResult.clear(); + } + } + ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + var ConfigFileProgramReloadLevel; + (function (ConfigFileProgramReloadLevel) { + ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["None"] = 0] = "None"; + /** Update the file name list from the disk */ + ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["Partial"] = 1] = "Partial"; + /** Reload completely by re-reading contents of config file from disk and updating program */ + ConfigFileProgramReloadLevel[ConfigFileProgramReloadLevel["Full"] = 2] = "Full"; + })(ConfigFileProgramReloadLevel = ts.ConfigFileProgramReloadLevel || (ts.ConfigFileProgramReloadLevel = {})); + /** + * Updates the existing missing file watches with the new set of missing files after new program is created + */ + function updateMissingFilePathsWatch(program, missingFileWatches, createMissingFileWatch) { + var missingFilePaths = program.getMissingFilePaths(); + var newMissingFilePathMap = ts.arrayToSet(missingFilePaths); + // Update the missing file paths watcher + ts.mutateMap(missingFileWatches, newMissingFilePathMap, { + // Watch the missing files + createNewValue: createMissingFileWatch, + // Files that are no longer missing (e.g. because they are no longer required) + // should no longer be watched. + onDeleteValue: closeFileWatcher + }); + } + ts.updateMissingFilePathsWatch = updateMissingFilePathsWatch; + /** + * Updates the existing wild card directory watches with the new set of wild card directories from the config file + * after new program is created because the config file was reloaded or program was created first time from the config file + * Note that there is no need to call this function when the program is updated with additional files without reloading config files, + * as wildcard directories wont change unless reloading config file + */ + function updateWatchingWildcardDirectories(existingWatchedForWildcards, wildcardDirectories, watchDirectory) { + ts.mutateMap(existingWatchedForWildcards, wildcardDirectories, { + // Create new watch and recursive info + createNewValue: createWildcardDirectoryWatcher, + // Close existing watch thats not needed any more + onDeleteValue: closeFileWatcherOf, + // Close existing watch that doesnt match in the flags + onExistingValue: updateWildcardDirectoryWatcher + }); + function createWildcardDirectoryWatcher(directory, flags) { + // Create new watch and recursive info + return { + watcher: watchDirectory(directory, flags), + flags: flags + }; + } + function updateWildcardDirectoryWatcher(existingWatcher, flags, directory) { + // Watcher needs to be updated if the recursive flags dont match + if (existingWatcher.flags === flags) { + return; + } + existingWatcher.watcher.close(); + existingWatchedForWildcards.set(directory, createWildcardDirectoryWatcher(directory, flags)); + } + } + ts.updateWatchingWildcardDirectories = updateWatchingWildcardDirectories; + function isEmittedFileOfProgram(program, file) { + if (!program) { + return false; + } + return program.isEmittedFile(file); + } + ts.isEmittedFileOfProgram = isEmittedFileOfProgram; + function addFileWatcher(host, file, cb) { + return host.watchFile(file, cb); + } + ts.addFileWatcher = addFileWatcher; + function addFileWatcherWithLogging(host, file, cb, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb); + } + ts.addFileWatcherWithLogging = addFileWatcherWithLogging; + function addFileWatcherWithOnlyTriggerLogging(host, file, cb, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb); + } + ts.addFileWatcherWithOnlyTriggerLogging = addFileWatcherWithOnlyTriggerLogging; + function addFilePathWatcher(host, file, cb, path) { + return host.watchFile(file, function (fileName, eventKind) { return cb(fileName, eventKind, path); }); + } + ts.addFilePathWatcher = addFilePathWatcher; + function addFilePathWatcherWithLogging(host, file, cb, path, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb, path); + } + ts.addFilePathWatcherWithLogging = addFilePathWatcherWithLogging; + function addFilePathWatcherWithOnlyTriggerLogging(host, file, cb, path, log) { + var watcherCaption = "FileWatcher:: "; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb, path); + } + ts.addFilePathWatcherWithOnlyTriggerLogging = addFilePathWatcherWithOnlyTriggerLogging; + function addDirectoryWatcher(host, directory, cb, flags) { + var recursive = (flags & 1 /* Recursive */) !== 0; + return host.watchDirectory(directory, cb, recursive); + } + ts.addDirectoryWatcher = addDirectoryWatcher; + function addDirectoryWatcherWithLogging(host, directory, cb, flags, log) { + var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; + return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, directory, cb, flags); + } + ts.addDirectoryWatcherWithLogging = addDirectoryWatcherWithLogging; + function addDirectoryWatcherWithOnlyTriggerLogging(host, directory, cb, flags, log) { + var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; + return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, directory, cb, flags); + } + ts.addDirectoryWatcherWithOnlyTriggerLogging = addDirectoryWatcherWithOnlyTriggerLogging; + function createWatcherWithLogging(addWatch, watcherCaption, log, logOnlyTrigger, host, file, cb, optional) { + var info = "PathInfo: " + file; + if (!logOnlyTrigger) { + log(watcherCaption + "Added: " + info); + } + var watcher = addWatch(host, file, function (fileName, cbOptional1) { + var optionalInfo = cbOptional1 !== undefined ? " " + cbOptional1 : ""; + log(watcherCaption + "Trigger: " + fileName + optionalInfo + " " + info); + var start = ts.timestamp(); + cb(fileName, cbOptional1, optional); + var elapsed = ts.timestamp() - start; + log(watcherCaption + "Elapsed: " + elapsed + "ms Trigger: " + fileName + optionalInfo + " " + info); + }, optional); + return { + close: function () { + if (!logOnlyTrigger) { + log(watcherCaption + "Close: " + info); + } + watcher.close(); + } + }; + } + function closeFileWatcher(watcher) { + watcher.close(); + } + ts.closeFileWatcher = closeFileWatcher; + function closeFileWatcherOf(objWithWatcher) { + objWithWatcher.watcher.close(); + } + ts.closeFileWatcherOf = closeFileWatcherOf; +})(ts || (ts = {})); +/// +/// +/// +/*@internal*/ +var ts; +(function (ts) { + ts.maxNumberOfFilesToIterateForInvalidation = 256; + function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) { + var filesWithChangedSetOfUnresolvedImports; + var filesWithInvalidatedResolutions; + var allFilesHaveInvalidatedResolution = false; + // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. + // The key in the map is source file's path. + // The values are Map of resolutions with key being name lookedup. + var resolvedModuleNames = ts.createMap(); + var perDirectoryResolvedModuleNames = ts.createMap(); + var resolvedTypeReferenceDirectives = ts.createMap(); + var perDirectoryResolvedTypeReferenceDirectives = ts.createMap(); + var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); + /** + * These are the extensions that failed lookup files will have by default, + * any other extension of failed lookup will be store that path in custom failed lookup path + * This helps in not having to comb through all resolutions when files are added/removed + * Note that .d.ts file also has .d.ts extension hence will be part of default extensions + */ + var failedLookupDefaultExtensions = [".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */]; + var customFailedLookupPaths = ts.createMap(); + var directoryWatchesOfFailedLookups = ts.createMap(); + var rootDir = rootDirForResolution && ts.removeTrailingDirectorySeparator(ts.getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory())); + var rootPath = rootDir && resolutionHost.toPath(rootDir); + // TypeRoot watches for the types that get added as part of getAutomaticTypeDirectiveNames + var typeRootsWatches = ts.createMap(); + return { + startRecordingFilesWithChangedResolutions: startRecordingFilesWithChangedResolutions, + finishRecordingFilesWithChangedResolutions: finishRecordingFilesWithChangedResolutions, + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + startCachingPerDirectoryResolution: clearPerDirectoryResolutions, + finishCachingPerDirectoryResolution: finishCachingPerDirectoryResolution, + resolveModuleNames: resolveModuleNames, + resolveTypeReferenceDirectives: resolveTypeReferenceDirectives, + removeResolutionsOfFile: removeResolutionsOfFile, + invalidateResolutionOfFile: invalidateResolutionOfFile, + createHasInvalidatedResolution: createHasInvalidatedResolution, + updateTypeRootsWatch: updateTypeRootsWatch, + closeTypeRootsWatch: closeTypeRootsWatch, + clear: clear + }; + function getResolvedModule(resolution) { + return resolution.resolvedModule; + } + function getResolvedTypeReferenceDirective(resolution) { + return resolution.resolvedTypeReferenceDirective; + } + function isInDirectoryPath(dir, file) { + if (dir === undefined || file.length <= dir.length) { + return false; + } + return ts.startsWith(file, dir) && file[dir.length] === ts.directorySeparator; + } + function clear() { + ts.clearMap(directoryWatchesOfFailedLookups, ts.closeFileWatcherOf); + customFailedLookupPaths.clear(); + closeTypeRootsWatch(); + resolvedModuleNames.clear(); + resolvedTypeReferenceDirectives.clear(); + allFilesHaveInvalidatedResolution = false; + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + clearPerDirectoryResolutions(); + } + function startRecordingFilesWithChangedResolutions() { + filesWithChangedSetOfUnresolvedImports = []; + } + function finishRecordingFilesWithChangedResolutions() { + var collected = filesWithChangedSetOfUnresolvedImports; + filesWithChangedSetOfUnresolvedImports = undefined; + return collected; + } + function createHasInvalidatedResolution(forceAllFilesAsInvalidated) { + if (allFilesHaveInvalidatedResolution || forceAllFilesAsInvalidated) { + // Any file asked would have invalidated resolution + filesWithInvalidatedResolutions = undefined; + return ts.returnTrue; + } + var collected = filesWithInvalidatedResolutions; + filesWithInvalidatedResolutions = undefined; + return function (path) { return collected && collected.has(path); }; + } + function clearPerDirectoryResolutions() { + perDirectoryResolvedModuleNames.clear(); + perDirectoryResolvedTypeReferenceDirectives.clear(); + } + function finishCachingPerDirectoryResolution() { + allFilesHaveInvalidatedResolution = false; + directoryWatchesOfFailedLookups.forEach(function (watcher, path) { + if (watcher.refCount === 0) { + directoryWatchesOfFailedLookups.delete(path); + watcher.watcher.close(); + } + }); + clearPerDirectoryResolutions(); + } + function resolveModuleName(moduleName, containingFile, compilerOptions, host) { + var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); + // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts + if (!resolutionHost.getGlobalCache) { + return primaryResult; + } + // otherwise try to load typings from @types + var globalCache = resolutionHost.getGlobalCache(); + if (globalCache !== undefined && !ts.isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && ts.extensionIsTypeScript(primaryResult.resolvedModule.extension))) { + // create different collection of failed lookup locations for second pass + // if it will fail and we've already found something during the first pass - we don't want to pollute its results + var _a = ts.loadModuleFromGlobalCache(moduleName, resolutionHost.projectName, compilerOptions, host, globalCache), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations; + if (resolvedModule) { + return { resolvedModule: resolvedModule, failedLookupLocations: ts.addRange(primaryResult.failedLookupLocations, failedLookupLocations) }; + } + } + // Default return the result from the first pass + return primaryResult; + } + function resolveNamesWithLocalCache(names, containingFile, cache, perDirectoryCache, loader, getResolutionWithResolvedFileName, reusedNames, logChanges) { + var path = resolutionHost.toPath(containingFile); + var resolutionsInFile = cache.get(path) || cache.set(path, ts.createMap()).get(path); + var dirPath = ts.getDirectoryPath(path); + var perDirectoryResolution = perDirectoryCache.get(dirPath); + if (!perDirectoryResolution) { + perDirectoryResolution = ts.createMap(); + perDirectoryCache.set(dirPath, perDirectoryResolution); + } + var resolvedModules = []; + var compilerOptions = resolutionHost.getCompilationSettings(); + var seenNamesInFile = ts.createMap(); + for (var _i = 0, names_2 = names; _i < names_2.length; _i++) { + var name = names_2[_i]; + var resolution = resolutionsInFile.get(name); + // Resolution is valid if it is present and not invalidated + if (!seenNamesInFile.has(name) && + allFilesHaveInvalidatedResolution || !resolution || resolution.isInvalidated) { + var existingResolution = resolution; + var resolutionInDirectory = perDirectoryResolution.get(name); + if (resolutionInDirectory) { + resolution = resolutionInDirectory; + } + else { + resolution = loader(name, containingFile, compilerOptions, resolutionHost); + perDirectoryResolution.set(name, resolution); + } + resolutionsInFile.set(name, resolution); + if (resolution.failedLookupLocations) { + if (existingResolution && existingResolution.failedLookupLocations) { + watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution); + } + else { + watchFailedLookupLocationOfResolution(resolution, 0); + } + } + else if (existingResolution) { + stopWatchFailedLookupLocationOfResolution(existingResolution); + } + if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { + filesWithChangedSetOfUnresolvedImports.push(path); + // reset log changes to avoid recording the same file multiple times + logChanges = false; + } + } + ts.Debug.assert(resolution !== undefined && !resolution.isInvalidated); + seenNamesInFile.set(name, true); + resolvedModules.push(getResolutionWithResolvedFileName(resolution)); + } + // Stop watching and remove the unused name + resolutionsInFile.forEach(function (resolution, name) { + if (!seenNamesInFile.has(name) && !ts.contains(reusedNames, name)) { + stopWatchFailedLookupLocationOfResolution(resolution); + resolutionsInFile.delete(name); + } + }); + return resolvedModules; + function resolutionIsEqualTo(oldResolution, newResolution) { + if (oldResolution === newResolution) { + return true; + } + if (!oldResolution || !newResolution || oldResolution.isInvalidated) { + return false; + } + var oldResult = getResolutionWithResolvedFileName(oldResolution); + var newResult = getResolutionWithResolvedFileName(newResolution); + if (oldResult === newResult) { + return true; + } + if (!oldResult || !newResult) { + return false; + } + return oldResult.resolvedFileName === newResult.resolvedFileName; + } + } + function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile) { + return resolveNamesWithLocalCache(typeDirectiveNames, containingFile, resolvedTypeReferenceDirectives, perDirectoryResolvedTypeReferenceDirectives, ts.resolveTypeReferenceDirective, getResolvedTypeReferenceDirective, + /*reusedNames*/ undefined, /*logChanges*/ false); + } + function resolveModuleNames(moduleNames, containingFile, reusedNames) { + return resolveNamesWithLocalCache(moduleNames, containingFile, resolvedModuleNames, perDirectoryResolvedModuleNames, resolveModuleName, getResolvedModule, reusedNames, logChangesWhenResolvingModule); + } + function isNodeModulesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules"); + } + function isNodeModulesAtTypesDirectory(dirPath) { + return ts.endsWith(dirPath, "/node_modules/@types"); + } + function isDirectoryAtleastAtLevelFromFSRoot(dirPath, minLevels) { + for (var searchIndex = ts.getRootLength(dirPath); minLevels > 0; minLevels--) { + searchIndex = dirPath.indexOf(ts.directorySeparator, searchIndex) + 1; + if (searchIndex === 0) { + // Folder isnt at expected minimun levels + return false; + } + } + return true; + } + function canWatchDirectory(dirPath) { + return isDirectoryAtleastAtLevelFromFSRoot(dirPath, + // When root is "/" do not watch directories like: + // "/", "/user", "/user/username", "/user/username/folderAtRoot" + // When root is "c:/" do not watch directories like: + // "c:/", "c:/folderAtRoot" + dirPath.charCodeAt(0) === 47 /* slash */ ? 3 : 1); + } + function filterFSRootDirectoriesToWatch(watchPath, dirPath) { + if (!canWatchDirectory(dirPath)) { + watchPath.ignore = true; + } + return watchPath; + } + function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath) { + if (isInDirectoryPath(rootPath, failedLookupLocationPath)) { + return { dir: rootDir, dirPath: rootPath }; + } + var dir = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())); + var dirPath = ts.getDirectoryPath(failedLookupLocationPath); + // If directory path contains node module, get the most parent node_modules directory for watching + while (ts.stringContains(dirPath, "/node_modules/")) { + dir = ts.getDirectoryPath(dir); + dirPath = ts.getDirectoryPath(dirPath); + } + // If the directory is node_modules use it to watch + if (isNodeModulesDirectory(dirPath)) { + return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, ts.getDirectoryPath(dirPath)); + } + // Use some ancestor of the root directory + if (rootPath !== undefined) { + while (!isInDirectoryPath(dirPath, rootPath)) { + var parentPath = ts.getDirectoryPath(dirPath); + if (parentPath === dirPath) { + break; + } + dirPath = parentPath; + dir = ts.getDirectoryPath(dir); + } + } + return filterFSRootDirectoriesToWatch({ dir: dir, dirPath: dirPath }, dirPath); + } + function isPathWithDefaultFailedLookupExtension(path) { + return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); + } + function watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution) { + var failedLookupLocations = resolution.failedLookupLocations; + var existingFailedLookupLocations = existingResolution.failedLookupLocations; + for (var index = 0; index < failedLookupLocations.length; index++) { + if (index === existingFailedLookupLocations.length) { + // Additional failed lookup locations, watch from this index + watchFailedLookupLocationOfResolution(resolution, index); + return; + } + else if (failedLookupLocations[index] !== existingFailedLookupLocations[index]) { + // Different failed lookup locations, + // Watch new resolution failed lookup locations from this index and + // stop watching existing resolutions from this index + watchFailedLookupLocationOfResolution(resolution, index); + stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, index); + return; + } + } + // All new failed lookup locations are already watched (and are same), + // Stop watching failed lookup locations of existing resolution after failed lookup locations length + stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, failedLookupLocations.length); + } + function watchFailedLookupLocationOfResolution(_a, startIndex) { + var failedLookupLocations = _a.failedLookupLocations; + for (var i = startIndex; i < failedLookupLocations.length; i++) { + var failedLookupLocation = failedLookupLocations[i]; + var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + // If the failed lookup location path is not one of the supported extensions, + // store it in the custom path + if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { + var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; + customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); + } + var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _b.dir, dirPath = _b.dirPath, ignore = _b.ignore; + if (!ignore) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + if (dirWatcher) { + dirWatcher.refCount++; + } + else { + directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); + } + } + } + } + function stopWatchFailedLookupLocationOfResolution(resolution) { + if (resolution.failedLookupLocations) { + stopWatchFailedLookupLocationOfResolutionFrom(resolution, 0); + } + } + function stopWatchFailedLookupLocationOfResolutionFrom(_a, startIndex) { + var failedLookupLocations = _a.failedLookupLocations; + for (var i = startIndex; i < failedLookupLocations.length; i++) { + var failedLookupLocation = failedLookupLocations[i]; + var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + var refCount = customFailedLookupPaths.get(failedLookupLocationPath); + if (refCount) { + if (refCount === 1) { + customFailedLookupPaths.delete(failedLookupLocationPath); + } + else { + ts.Debug.assert(refCount > 1); + customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + } + } + var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _b.dirPath, ignore = _b.ignore; + if (!ignore) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + // Do not close the watcher yet since it might be needed by other failed lookup locations. + dirWatcher.refCount--; + } + } + } + function createDirectoryWatcher(directory, dirPath) { + return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) { + var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + // Since the file existance changed, update the sourceFiles cache + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + // If the files are added to project root or node_modules directory, always run through the invalidation process + // Otherwise run through invalidation only if adding to the immediate directory + if (!allFilesHaveInvalidatedResolution && + dirPath === rootPath || isNodeModulesDirectory(dirPath) || ts.getDirectoryPath(fileOrDirectoryPath) === dirPath) { + if (invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + resolutionHost.onInvalidatedResolution(); + } + } + }, 1 /* Recursive */); + } + function removeResolutionsOfFileFromCache(cache, filePath) { + // Deleted file, stop watching failed lookups for all the resolutions in the file + var resolutions = cache.get(filePath); + if (resolutions) { + resolutions.forEach(stopWatchFailedLookupLocationOfResolution); + cache.delete(filePath); + } + } + function removeResolutionsOfFile(filePath) { + removeResolutionsOfFileFromCache(resolvedModuleNames, filePath); + removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath); + } + function invalidateResolutionCache(cache, isInvalidatedResolution, getResolutionWithResolvedFileName) { + var seen = ts.createMap(); + cache.forEach(function (resolutions, containingFilePath) { + var dirPath = ts.getDirectoryPath(containingFilePath); + var seenInDir = seen.get(dirPath); + if (!seenInDir) { + seenInDir = ts.createMap(); + seen.set(dirPath, seenInDir); + } + resolutions.forEach(function (resolution, name) { + if (seenInDir.has(name)) { + return; + } + seenInDir.set(name, true); + if (!resolution.isInvalidated && isInvalidatedResolution(resolution, getResolutionWithResolvedFileName)) { + // Mark the file as needing re-evaluation of module resolution instead of using it blindly. + resolution.isInvalidated = true; + (filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = ts.createMap())).set(containingFilePath, true); + } + }); + }); + } + function hasReachedResolutionIterationLimit() { + var maxSize = resolutionHost.maxNumberOfFilesToIterateForInvalidation || ts.maxNumberOfFilesToIterateForInvalidation; + return resolvedModuleNames.size > maxSize || resolvedTypeReferenceDirectives.size > maxSize; + } + function invalidateResolutions(isInvalidatedResolution) { + // If more than maxNumberOfFilesToIterateForInvalidation present, + // just invalidated all files and recalculate the resolutions for files instead + if (hasReachedResolutionIterationLimit()) { + allFilesHaveInvalidatedResolution = true; + return; + } + invalidateResolutionCache(resolvedModuleNames, isInvalidatedResolution, getResolvedModule); + invalidateResolutionCache(resolvedTypeReferenceDirectives, isInvalidatedResolution, getResolvedTypeReferenceDirective); + } + function invalidateResolutionOfFile(filePath) { + removeResolutionsOfFile(filePath); + invalidateResolutions( + // Resolution is invalidated if the resulting file name is same as the deleted file path + function (resolution, getResolutionWithResolvedFileName) { + var result = getResolutionWithResolvedFileName(resolution); + return result && resolutionHost.toPath(result.resolvedFileName) === filePath; + }); + } + function invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, isCreatingWatchedDirectory) { + var isChangedFailedLookupLocation; + if (isCreatingWatchedDirectory) { + // Watching directory is created + // Invalidate any resolution has failed lookup in this directory + isChangedFailedLookupLocation = function (location) { return isInDirectoryPath(fileOrDirectoryPath, resolutionHost.toPath(location)); }; + } + else { + // Some file or directory in the watching directory is created + // Return early if it does not have any of the watching extension or not the custom failed lookup path + var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); + if (isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + // Invalidate any resolution from this directory + isChangedFailedLookupLocation = function (location) { + var locationPath = resolutionHost.toPath(location); + return locationPath === fileOrDirectoryPath || ts.startsWith(resolutionHost.toPath(location), fileOrDirectoryPath); + }; + } + else { + if (!isPathWithDefaultFailedLookupExtension(fileOrDirectoryPath) && !customFailedLookupPaths.has(fileOrDirectoryPath)) { + return false; + } + // Ignore emits from the program + if (ts.isEmittedFileOfProgram(resolutionHost.getCurrentProgram(), fileOrDirectoryPath)) { + return false; + } + // Resolution need to be invalidated if failed lookup location is same as the file or directory getting created + isChangedFailedLookupLocation = function (location) { return resolutionHost.toPath(location) === fileOrDirectoryPath; }; + } + } + var hasChangedFailedLookupLocation = function (resolution) { return ts.some(resolution.failedLookupLocations, isChangedFailedLookupLocation); }; + var invalidatedFilesCount = filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size; + invalidateResolutions( + // Resolution is invalidated if the resulting file name is same as the deleted file path + hasChangedFailedLookupLocation); + return allFilesHaveInvalidatedResolution || filesWithInvalidatedResolutions && filesWithInvalidatedResolutions.size !== invalidatedFilesCount; + } + function closeTypeRootsWatch() { + ts.clearMap(typeRootsWatches, ts.closeFileWatcher); + } + function createTypeRootsWatch(_typeRootPath, typeRoot) { + // Create new watch and recursive info + return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) { + var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); + if (cachedDirectoryStructureHost) { + // Since the file existance changed, update the sourceFiles cache + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + // For now just recompile + // We could potentially store more data here about whether it was/would be really be used or not + // and with that determine to trigger compilation but for now this is enough + resolutionHost.onChangedAutomaticTypeDirectiveNames(); + }, 1 /* Recursive */); + } + /** + * Watches the types that would get added as part of getAutomaticTypeDirectiveNames + * To be called when compiler options change + */ + function updateTypeRootsWatch() { + var options = resolutionHost.getCompilationSettings(); + if (options.types) { + // No need to do any watch since resolution cache is going to handle the failed lookups + // for the types added by this + closeTypeRootsWatch(); + return; + } + // we need to assume the directories exist to ensure that we can get all the type root directories that get included + // But filter directories that are at root level to say directory doesnt exist, so that we arent watching them + var typeRoots = ts.getEffectiveTypeRoots(options, { directoryExists: directoryExistsForTypeRootWatch, getCurrentDirectory: getCurrentDirectory }); + if (typeRoots) { + ts.mutateMap(typeRootsWatches, ts.arrayToMap(typeRoots, function (tr) { return resolutionHost.toPath(tr); }), { + createNewValue: createTypeRootsWatch, + onDeleteValue: ts.closeFileWatcher + }); + } + else { + closeTypeRootsWatch(); + } + } + /** + * Use this function to return if directory exists to get type roots to watch + * If we return directory exists then only the paths will be added to type roots + * Hence return true for all directories except root directories which are filtered from watching + */ + function directoryExistsForTypeRootWatch(nodeTypesDirectory) { + var dir = ts.getDirectoryPath(ts.getDirectoryPath(nodeTypesDirectory)); + var dirPath = resolutionHost.toPath(dir); + return dirPath === rootPath || canWatchDirectory(dirPath); + } + } + ts.createResolutionCache = createResolutionCache; +})(ts || (ts = {})); +/// +/// +/// +/*@internal*/ +var ts; +(function (ts) { + var sysFormatDiagnosticsHost = ts.sys ? { + getCurrentDirectory: function () { return ts.sys.getCurrentDirectory(); }, + getNewLine: function () { return ts.sys.newLine; }, + getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames) + } : undefined; + /** + * Create a function that reports error by writing to the system and handles the formating of the diagnostic + */ + function createDiagnosticReporter(system, pretty) { + var host = system === ts.sys ? sysFormatDiagnosticsHost : { + getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getNewLine: function () { return system.newLine; }, + getCanonicalFileName: ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames), + }; + if (!pretty) { + return function (diagnostic) { return system.write(ts.formatDiagnostic(diagnostic, host)); }; + } + var diagnostics = new Array(1); + return function (diagnostic) { + diagnostics[0] = diagnostic; + system.write(ts.formatDiagnosticsWithColorAndContext(diagnostics, host) + host.getNewLine()); + diagnostics[0] = undefined; + }; + } + ts.createDiagnosticReporter = createDiagnosticReporter; + function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { + if (system.clearScreen && + diagnostic.code !== ts.Diagnostics.Compilation_complete_Watching_for_file_changes.code && + !options.extendedDiagnostics && + !options.diagnostics) { + system.clearScreen(); + } + } + /** + * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic + */ + function createWatchStatusReporter(system, pretty) { + return pretty ? + function (diagnostic, newLine, options) { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + var output = "[" + ts.formatColorAndReset(new Date().toLocaleTimeString(), ts.ForegroundColorEscapeSequences.Grey) + "] "; + output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine + newLine); + system.write(output); + } : + function (diagnostic, newLine, options) { + clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); + var output = new Date().toLocaleTimeString() + " - "; + output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine + newLine); + system.write(output); + }; + } + ts.createWatchStatusReporter = createWatchStatusReporter; + /** Parses config file using System interface */ + function parseConfigFileWithSystem(configFileName, optionsToExtend, system, reportDiagnostic) { + var host = system; + host.onConfigFileDiagnostic = reportDiagnostic; + host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(ts.sys, reportDiagnostic, diagnostic); }; + var result = getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host); + host.onConfigFileDiagnostic = undefined; + host.onUnRecoverableConfigFileDiagnostic = undefined; + return result; + } + ts.parseConfigFileWithSystem = parseConfigFileWithSystem; + /** + * Reads the config file, reports errors if any and exits if the config file cannot be found + */ + function getParsedCommandLineOfConfigFile(configFileName, optionsToExtend, host) { + var configFileText; + try { + configFileText = host.readFile(configFileName); + } + catch (e) { + var error = ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, configFileName, e.message); + host.onUnRecoverableConfigFileDiagnostic(error); + return undefined; + } + if (!configFileText) { + var error = ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, configFileName); + host.onUnRecoverableConfigFileDiagnostic(error); + return undefined; + } + var result = ts.parseJsonText(configFileName, configFileText); + result.parseDiagnostics.forEach(function (diagnostic) { return host.onConfigFileDiagnostic(diagnostic); }); + var cwd = host.getCurrentDirectory(); + var configParseResult = ts.parseJsonSourceFileConfigFileContent(result, host, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), cwd), optionsToExtend, ts.getNormalizedAbsolutePath(configFileName, cwd)); + configParseResult.errors.forEach(function (diagnostic) { return host.onConfigFileDiagnostic(diagnostic); }); + return configParseResult; + } + ts.getParsedCommandLineOfConfigFile = getParsedCommandLineOfConfigFile; + /** + * Helper that emit files, report diagnostics and lists emitted and/or source files depending on compiler options + */ + function emitFilesAndReportErrors(program, reportDiagnostic, writeFileName) { + // First get and report any syntactic errors. + var diagnostics = program.getSyntacticDiagnostics().slice(); + var reportSemanticDiagnostics = false; + // If we didn't have any syntactic errors, then also try getting the global and + // semantic errors. + if (diagnostics.length === 0) { + ts.addRange(diagnostics, program.getOptionsDiagnostics()); + ts.addRange(diagnostics, program.getGlobalDiagnostics()); + if (diagnostics.length === 0) { + reportSemanticDiagnostics = true; + } + } + // Emit and report any errors we ran into. + var _a = program.emit(), emittedFiles = _a.emittedFiles, emitSkipped = _a.emitSkipped, emitDiagnostics = _a.diagnostics; + ts.addRange(diagnostics, emitDiagnostics); + if (reportSemanticDiagnostics) { + ts.addRange(diagnostics, program.getSemanticDiagnostics()); + } + ts.sortAndDeduplicateDiagnostics(diagnostics).forEach(reportDiagnostic); + if (writeFileName) { + var currentDir_1 = program.getCurrentDirectory(); + ts.forEach(emittedFiles, function (file) { + var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1); + writeFileName("TSFILE: " + filepath); + }); + if (program.getCompilerOptions().listFiles) { + ts.forEach(program.getSourceFiles(), function (file) { + writeFileName(file.fileName); + }); + } + } + if (emitSkipped && diagnostics.length > 0) { + // If the emitter didn't emit anything, then pass that value along. + return ts.ExitStatus.DiagnosticsPresent_OutputsSkipped; + } + else if (diagnostics.length > 0) { + // The emitter emitted something, inform the caller if that happened in the presence + // of diagnostics or not. + return ts.ExitStatus.DiagnosticsPresent_OutputsGenerated; + } + return ts.ExitStatus.Success; + } + ts.emitFilesAndReportErrors = emitFilesAndReportErrors; + var noopFileWatcher = { close: ts.noop }; + /** + * Creates the watch compiler host that can be extended with config file or root file names and options host + */ + function createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus) { + if (system === void 0) { system = ts.sys; } + if (!createProgram) { + createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram; + } + var host = system; + var useCaseSensitiveFileNames = function () { return system.useCaseSensitiveFileNames; }; + var writeFileName = function (s) { return system.write(s + system.newLine); }; + return { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + getNewLine: function () { return system.newLine; }, + getCurrentDirectory: function () { return system.getCurrentDirectory(); }, + getDefaultLibLocation: getDefaultLibLocation, + getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); }, + fileExists: function (path) { return system.fileExists(path); }, + readFile: function (path, encoding) { return system.readFile(path, encoding); }, + directoryExists: function (path) { return system.directoryExists(path); }, + getDirectories: function (path) { return system.getDirectories(path); }, + readDirectory: function (path, extensions, exclude, include, depth) { return system.readDirectory(path, extensions, exclude, include, depth); }, + realpath: system.realpath && (function (path) { return system.realpath(path); }), + getEnvironmentVariable: system.getEnvironmentVariable && (function (name) { return system.getEnvironmentVariable(name); }), + watchFile: system.watchFile ? (function (path, callback, pollingInterval) { return system.watchFile(path, callback, pollingInterval); }) : function () { return noopFileWatcher; }, + watchDirectory: system.watchDirectory ? (function (path, callback, recursive) { return system.watchDirectory(path, callback, recursive); }) : function () { return noopFileWatcher; }, + setTimeout: system.setTimeout ? (function (callback, ms) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return (_a = system.setTimeout).call.apply(_a, [system, callback, ms].concat(args)); + var _a; + }) : ts.noop, + clearTimeout: system.clearTimeout ? (function (timeoutId) { return system.clearTimeout(timeoutId); }) : ts.noop, + trace: function (s) { return system.write(s); }, + onWatchStatusChange: reportWatchStatus || createWatchStatusReporter(system), + createDirectory: function (path) { return system.createDirectory(path); }, + writeFile: function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, + onCachedDirectoryStructureHostCreate: function (cacheHost) { return host = cacheHost || system; }, + createHash: system.createHash && (function (s) { return system.createHash(s); }), + createProgram: createProgram, + afterProgramCreate: emitFilesAndReportErrorUsingBuilder + }; + function getDefaultLibLocation() { + return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath())); + } + function emitFilesAndReportErrorUsingBuilder(builderProgram) { + emitFilesAndReportErrors(builderProgram, reportDiagnostic, writeFileName); + } + } + /** + * Report error and exit + */ + function reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic) { + reportDiagnostic(diagnostic); + system.exit(ts.ExitStatus.DiagnosticsPresent_OutputsSkipped); + } + /** + * Creates the watch compiler host from system for config file in watch mode + */ + function createWatchCompilerHostOfConfigFile(configFileName, optionsToExtend, system, createProgram, reportDiagnostic, reportWatchStatus) { + reportDiagnostic = reportDiagnostic || createDiagnosticReporter(system); + var host = createWatchCompilerHost(system, createProgram, reportDiagnostic, reportWatchStatus); + host.onConfigFileDiagnostic = reportDiagnostic; + host.onUnRecoverableConfigFileDiagnostic = function (diagnostic) { return reportUnrecoverableDiagnostic(system, reportDiagnostic, diagnostic); }; + host.configFileName = configFileName; + host.optionsToExtend = optionsToExtend; + return host; + } + ts.createWatchCompilerHostOfConfigFile = createWatchCompilerHostOfConfigFile; + /** + * Creates the watch compiler host from system for compiling root files and options in watch mode + */ + function createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, system, createProgram, reportDiagnostic, reportWatchStatus) { + var host = createWatchCompilerHost(system, createProgram, reportDiagnostic || createDiagnosticReporter(system), reportWatchStatus); + host.rootFiles = rootFiles; + host.options = options; + return host; + } + ts.createWatchCompilerHostOfFilesAndCompilerOptions = createWatchCompilerHostOfFilesAndCompilerOptions; +})(ts || (ts = {})); +(function (ts) { + function createWatchCompilerHost(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus) { + if (ts.isArray(rootFilesOrConfigFileName)) { + return ts.createWatchCompilerHostOfFilesAndCompilerOptions(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus); + } + else { + return ts.createWatchCompilerHostOfConfigFile(rootFilesOrConfigFileName, options, system, createProgram, reportDiagnostic, reportWatchStatus); + } + } + ts.createWatchCompilerHost = createWatchCompilerHost; + var initialVersion = 1; + function createWatchProgram(host) { + var builderProgram; + var reloadLevel; // level to indicate if the program needs to be reloaded from config file/just filenames etc + var missingFilesMap; // Map of file watchers for the missing files + var watchedWildcardDirectories; // map of watchers for the wild card directories in the config file + var timerToUpdateProgram; // timer callback to recompile the program + var sourceFilesCache = ts.createMap(); // Cache that stores the source file and version info + var missingFilePathsRequestedForRelease; // These paths are held temparirly so that we can remove the entry from source file cache if the file is not tracked by missing files + var hasChangedCompilerOptions = false; // True if the compiler options have changed between compilations + var hasChangedAutomaticTypeDirectiveNames = false; // True if the automatic type directives have changed + var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames(); + var currentDirectory = host.getCurrentDirectory(); + var getCurrentDirectory = function () { return currentDirectory; }; + var readFile = function (path, encoding) { return host.readFile(path, encoding); }; + var configFileName = host.configFileName, _a = host.optionsToExtend, optionsToExtendForConfigFile = _a === void 0 ? {} : _a, createProgram = host.createProgram; + var rootFileNames = host.rootFiles, compilerOptions = host.options, configFileSpecs = host.configFileSpecs, configFileWildCardDirectories = host.configFileWildCardDirectories; + var cachedDirectoryStructureHost = configFileName && ts.createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensitiveFileNames); + if (cachedDirectoryStructureHost && host.onCachedDirectoryStructureHostCreate) { + host.onCachedDirectoryStructureHostCreate(cachedDirectoryStructureHost); + } + var directoryStructureHost = cachedDirectoryStructureHost || host; + var parseConfigFileHost = { + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + readDirectory: function (path, extensions, exclude, include, depth) { return directoryStructureHost.readDirectory(path, extensions, exclude, include, depth); }, + fileExists: function (path) { return host.fileExists(path); }, + readFile: readFile, + getCurrentDirectory: getCurrentDirectory, + onConfigFileDiagnostic: host.onConfigFileDiagnostic, + onUnRecoverableConfigFileDiagnostic: host.onUnRecoverableConfigFileDiagnostic + }; + // From tsc we want to get already parsed result and hence check for rootFileNames + if (configFileName && !rootFileNames) { + parseConfigFile(); + } + var trace = host.trace && (function (s) { host.trace(s + newLine); }); + var loggingEnabled = trace && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); + var writeLog = loggingEnabled ? trace : ts.noop; + var watchFile = compilerOptions.extendedDiagnostics ? ts.addFileWatcherWithLogging : loggingEnabled ? ts.addFileWatcherWithOnlyTriggerLogging : ts.addFileWatcher; + var watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; + var watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; + var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + var newLine = updateNewLine(); + writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames); + if (configFileName) { + watchFile(host, configFileName, scheduleProgramReload, writeLog); + } + var compilerHost = { + // Members for CompilerHost + getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { return getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile); }, + getSourceFileByPath: getVersionedSourceFileByPath, + getDefaultLibLocation: host.getDefaultLibLocation && (function () { return host.getDefaultLibLocation(); }), + getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, + writeFile: writeFile, + getCurrentDirectory: getCurrentDirectory, + useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; }, + getCanonicalFileName: getCanonicalFileName, + getNewLine: function () { return newLine; }, + fileExists: fileExists, + readFile: readFile, + trace: trace, + directoryExists: directoryStructureHost.directoryExists && (function (path) { return directoryStructureHost.directoryExists(path); }), + getDirectories: directoryStructureHost.getDirectories && (function (path) { return directoryStructureHost.getDirectories(path); }), + realpath: host.realpath && (function (s) { return host.realpath(s); }), + getEnvironmentVariable: host.getEnvironmentVariable ? (function (name) { return host.getEnvironmentVariable(name); }) : (function () { return ""; }), + onReleaseOldSourceFile: onReleaseOldSourceFile, + createHash: host.createHash && (function (data) { return host.createHash(data); }), + // Members for ResolutionCacheHost + toPath: toPath, + getCompilationSettings: function () { return compilerOptions; }, + watchDirectoryOfFailedLookupLocation: watchDirectory, + watchTypeRootsDirectory: watchDirectory, + getCachedDirectoryStructureHost: function () { return cachedDirectoryStructureHost; }, + onInvalidatedResolution: scheduleProgramUpdate, + onChangedAutomaticTypeDirectiveNames: function () { + hasChangedAutomaticTypeDirectiveNames = true; + scheduleProgramUpdate(); + }, + maxNumberOfFilesToIterateForInvalidation: host.maxNumberOfFilesToIterateForInvalidation, + getCurrentProgram: getCurrentProgram, + writeLog: writeLog + }; + // Cache for the module resolution + var resolutionCache = ts.createResolutionCache(compilerHost, configFileName ? + ts.getDirectoryPath(ts.getNormalizedAbsolutePath(configFileName, currentDirectory)) : + currentDirectory, + /*logChangesWhenResolvingModule*/ false); + // Resolve module using host module resolution strategy if provided otherwise use resolution cache to resolve module names + compilerHost.resolveModuleNames = host.resolveModuleNames ? + (function (moduleNames, containingFile, reusedNames) { return host.resolveModuleNames(moduleNames, containingFile, reusedNames); }) : + (function (moduleNames, containingFile, reusedNames) { return resolutionCache.resolveModuleNames(moduleNames, containingFile, reusedNames); }); + compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ? + (function (typeDirectiveNames, containingFile) { return host.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }) : + (function (typeDirectiveNames, containingFile) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile); }); + var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives; + reportWatchDiagnostic(ts.Diagnostics.Starting_compilation_in_watch_mode); + synchronizeProgram(); + // Update the wild card directory watch + watchConfigFileWildCardDirectories(); + return configFileName ? + { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram } : + { getCurrentProgram: getCurrentBuilderProgram, getProgram: synchronizeProgram, updateRootFileNames: updateRootFileNames }; + function getCurrentBuilderProgram() { + return builderProgram; + } + function getCurrentProgram() { + return builderProgram && builderProgram.getProgram(); + } + function synchronizeProgram() { + writeLog("Synchronizing program"); + var program = getCurrentProgram(); + if (hasChangedCompilerOptions) { + newLine = updateNewLine(); + if (program && ts.changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { + resolutionCache.clear(); + } + } + // All resolutions are invalid if user provided resolutions + var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution); + if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames)) { + return builderProgram; + } + // Compile the program + if (loggingEnabled) { + writeLog("CreatingProgramWith::"); + writeLog(" roots: " + JSON.stringify(rootFileNames)); + writeLog(" options: " + JSON.stringify(compilerOptions)); + } + var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; + hasChangedCompilerOptions = false; + resolutionCache.startCachingPerDirectoryResolution(); + compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; + compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; + builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram); + resolutionCache.finishCachingPerDirectoryResolution(); + // Update watches + ts.updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = ts.createMap()), watchMissingFilePath); + if (needsUpdateInTypeRootWatch) { + resolutionCache.updateTypeRootsWatch(); + } + if (missingFilePathsRequestedForRelease) { + // These are the paths that program creater told us as not in use any more but were missing on the disk. + // We didnt remove the entry for them from sourceFiles cache so that we dont have to do File IO, + // if there is already watcher for it (for missing files) + // At this point our watches were updated, hence now we know that these paths are not tracked and need to be removed + // so that at later time we have correct result of their presence + for (var _i = 0, missingFilePathsRequestedForRelease_1 = missingFilePathsRequestedForRelease; _i < missingFilePathsRequestedForRelease_1.length; _i++) { + var missingFilePath = missingFilePathsRequestedForRelease_1[_i]; + if (!missingFilesMap.has(missingFilePath)) { + sourceFilesCache.delete(missingFilePath); + } + } + missingFilePathsRequestedForRelease = undefined; + } + if (host.afterProgramCreate) { + host.afterProgramCreate(builderProgram); + } + reportWatchDiagnostic(ts.Diagnostics.Compilation_complete_Watching_for_file_changes); + return builderProgram; + } + function updateRootFileNames(files) { + ts.Debug.assert(!configFileName, "Cannot update root file names with config file watch mode"); + rootFileNames = files; + scheduleProgramUpdate(); + } + function updateNewLine() { + return ts.getNewLineCharacter(compilerOptions, function () { return host.getNewLine(); }); + } + function toPath(fileName) { + return ts.toPath(fileName, currentDirectory, getCanonicalFileName); + } + function isFileMissingOnHost(hostSourceFile) { + return typeof hostSourceFile === "number"; + } + function isFilePresentOnHost(hostSourceFile) { + return !!hostSourceFile.sourceFile; + } + function fileExists(fileName) { + var path = toPath(fileName); + // If file is missing on host from cache, we can definitely say file doesnt exist + // otherwise we need to ensure from the disk + if (isFileMissingOnHost(sourceFilesCache.get(path))) { + return true; + } + return directoryStructureHost.fileExists(fileName); + } + function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) { + var hostSourceFile = sourceFilesCache.get(path); + // No source file on the host + if (isFileMissingOnHost(hostSourceFile)) { + return undefined; + } + // Create new source file if requested or the versions dont match + if (!hostSourceFile || shouldCreateNewSourceFile || !isFilePresentOnHost(hostSourceFile) || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { + var sourceFile = getNewSourceFile(); + if (hostSourceFile) { + if (shouldCreateNewSourceFile) { + hostSourceFile.version++; + } + if (sourceFile) { + // Set the source file and create file watcher now that file was present on the disk + hostSourceFile.sourceFile = sourceFile; + sourceFile.version = hostSourceFile.version.toString(); + if (!hostSourceFile.fileWatcher) { + hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); + } + } + else { + // There is no source file on host any more, close the watch, missing file paths will track it + if (isFilePresentOnHost(hostSourceFile)) { + hostSourceFile.fileWatcher.close(); + } + sourceFilesCache.set(path, hostSourceFile.version); + } + } + else { + if (sourceFile) { + sourceFile.version = initialVersion.toString(); + var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); + sourceFilesCache.set(path, { sourceFile: sourceFile, version: initialVersion, fileWatcher: fileWatcher }); + } + else { + sourceFilesCache.set(path, initialVersion); + } + } + return sourceFile; + } + return hostSourceFile.sourceFile; + function getNewSourceFile() { + var text; + try { + ts.performance.mark("beforeIORead"); + text = host.readFile(fileName, compilerOptions.charset); + ts.performance.mark("afterIORead"); + ts.performance.measure("I/O Read", "beforeIORead", "afterIORead"); + } + catch (e) { + if (onError) { + onError(e.message); + } + } + return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; + } + } + function nextSourceFileVersion(path) { + var hostSourceFile = sourceFilesCache.get(path); + if (hostSourceFile !== undefined) { + if (isFileMissingOnHost(hostSourceFile)) { + // The next version, lets set it as presence unknown file + sourceFilesCache.set(path, { version: Number(hostSourceFile) + 1 }); + } + else { + hostSourceFile.version++; + } + } + } + function getSourceVersion(path) { + var hostSourceFile = sourceFilesCache.get(path); + return !hostSourceFile || isFileMissingOnHost(hostSourceFile) ? undefined : hostSourceFile.version.toString(); + } + function onReleaseOldSourceFile(oldSourceFile, _oldOptions) { + var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.path); + // If this is the source file thats in the cache and new program doesnt need it, + // remove the cached entry. + // Note we arent deleting entry if file became missing in new program or + // there was version update and new source file was created. + if (hostSourceFileInfo) { + // record the missing file paths so they can be removed later if watchers arent tracking them + if (isFileMissingOnHost(hostSourceFileInfo)) { + (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); + } + else if (hostSourceFileInfo.sourceFile === oldSourceFile) { + sourceFilesCache.delete(oldSourceFile.path); + resolutionCache.removeResolutionsOfFile(oldSourceFile.path); + } + } + } + function reportWatchDiagnostic(message) { + if (host.onWatchStatusChange) { + host.onWatchStatusChange(ts.createCompilerDiagnostic(message), newLine, compilerOptions); + } + } + // Upon detecting a file change, wait for 250ms and then perform a recompilation. This gives batch + // operations (such as saving all modified files in an editor) a chance to complete before we kick + // off a new compilation. + function scheduleProgramUpdate() { + if (!host.setTimeout || !host.clearTimeout) { + return; + } + if (timerToUpdateProgram) { + host.clearTimeout(timerToUpdateProgram); + } + timerToUpdateProgram = host.setTimeout(updateProgram, 250); + } + function scheduleProgramReload() { + ts.Debug.assert(!!configFileName); + reloadLevel = ts.ConfigFileProgramReloadLevel.Full; + scheduleProgramUpdate(); + } + function updateProgram() { + timerToUpdateProgram = undefined; + reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation); + switch (reloadLevel) { + case ts.ConfigFileProgramReloadLevel.Partial: + return reloadFileNamesFromConfigFile(); + case ts.ConfigFileProgramReloadLevel.Full: + return reloadConfigFile(); + default: + synchronizeProgram(); + return; + } + } + function reloadFileNamesFromConfigFile() { + var result = ts.getFileNamesFromConfigSpecs(configFileSpecs, ts.getDirectoryPath(configFileName), compilerOptions, parseConfigFileHost); + if (!configFileSpecs.filesSpecs && result.fileNames.length === 0) { + host.onConfigFileDiagnostic(ts.getErrorForNoInputFiles(configFileSpecs, configFileName)); + } + rootFileNames = result.fileNames; + // Update the program + synchronizeProgram(); + } + function reloadConfigFile() { + writeLog("Reloading config file: " + configFileName); + reloadLevel = ts.ConfigFileProgramReloadLevel.None; + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.clearCache(); + } + parseConfigFile(); + hasChangedCompilerOptions = true; + synchronizeProgram(); + // Update the wild card directory watch + watchConfigFileWildCardDirectories(); + } + function parseConfigFile() { + var configParseResult = ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost); + rootFileNames = configParseResult.fileNames; + compilerOptions = configParseResult.options; + configFileSpecs = configParseResult.configFileSpecs; + configFileWildCardDirectories = configParseResult.wildcardDirectories; + } + function onSourceFileChange(fileName, eventKind, path) { + updateCachedSystemWithFile(fileName, path, eventKind); + // Update the source file cache + if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.get(path)) { + resolutionCache.invalidateResolutionOfFile(path); + } + nextSourceFileVersion(path); + // Update the program + scheduleProgramUpdate(); + } + function updateCachedSystemWithFile(fileName, path, eventKind) { + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFile(fileName, path, eventKind); + } + } + function watchDirectory(directory, cb, flags) { + return watchDirectoryWorker(host, directory, cb, flags, writeLog); + } + function watchMissingFilePath(missingFilePath) { + return watchFilePath(host, missingFilePath, onMissingFileChange, missingFilePath, writeLog); + } + function onMissingFileChange(fileName, eventKind, missingFilePath) { + updateCachedSystemWithFile(fileName, missingFilePath, eventKind); + if (eventKind === ts.FileWatcherEventKind.Created && missingFilesMap.has(missingFilePath)) { + missingFilesMap.get(missingFilePath).close(); + missingFilesMap.delete(missingFilePath); + // Delete the entry in the source files cache so that new source file is created + nextSourceFileVersion(missingFilePath); + // When a missing file is created, we should update the graph. + scheduleProgramUpdate(); + } + } + function watchConfigFileWildCardDirectories() { + if (configFileWildCardDirectories) { + ts.updateWatchingWildcardDirectories(watchedWildcardDirectories || (watchedWildcardDirectories = ts.createMap()), ts.createMapFromTemplate(configFileWildCardDirectories), watchWildcardDirectory); + } + else if (watchedWildcardDirectories) { + ts.clearMap(watchedWildcardDirectories, ts.closeFileWatcherOf); + } + } + function watchWildcardDirectory(directory, flags) { + return watchDirectory(directory, function (fileOrDirectory) { + ts.Debug.assert(!!configFileName); + var fileOrDirectoryPath = toPath(fileOrDirectory); + // Since the file existance changed, update the sourceFiles cache + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); + } + nextSourceFileVersion(fileOrDirectoryPath); + // If the the added or created file or directory is not supported file name, ignore the file + // But when watched directory is added/removed, we need to reload the file list + if (fileOrDirectoryPath !== directory && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, compilerOptions)) { + writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory); + return; + } + // Reload is pending, do the reload + if (reloadLevel !== ts.ConfigFileProgramReloadLevel.Full) { + reloadLevel = ts.ConfigFileProgramReloadLevel.Partial; + // Schedule Update the program + scheduleProgramUpdate(); + } + }, flags); + } + function ensureDirectoriesExist(directoryPath) { + if (directoryPath.length > ts.getRootLength(directoryPath) && !host.directoryExists(directoryPath)) { + var parentDirectory = ts.getDirectoryPath(directoryPath); + ensureDirectoriesExist(parentDirectory); + host.createDirectory(directoryPath); + } + } + function writeFile(fileName, text, writeByteOrderMark, onError) { + try { + ts.performance.mark("beforeIOWrite"); + ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); + host.writeFile(fileName, text, writeByteOrderMark); + ts.performance.mark("afterIOWrite"); + ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite"); + } + catch (e) { + if (onError) { + onError(e.message); + } + } + } + } + ts.createWatchProgram = createWatchProgram; +})(ts || (ts = {})); /// /// /// @@ -75153,12 +78576,14 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", + "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, - description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation }, { name: "allowJs", @@ -75193,6 +78618,12 @@ var ts; category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_d_ts_file, }, + { + name: "emitDeclarationOnly", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Only_emit_d_ts_declaration_files, + }, { name: "sourceMap", type: "boolean", @@ -75406,6 +78837,13 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "esModuleInterop", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports + }, { name: "preserveSymlinks", type: "boolean", @@ -75696,19 +79134,19 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1 /* ES5 */, - strict: true + strict: true, + esModuleInterop: true }; var optionNameMapCache; /* @internal */ function convertEnableAutoDiscoveryToEnable(typeAcquisition) { // Convert deprecated typingOptions.enableAutoDiscovery to typeAcquisition.enable if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { - var result = { + return { enable: typeAcquisition.enableAutoDiscovery, include: typeAcquisition.include || [], exclude: typeAcquisition.exclude || [] }; - return result; } return typeAcquisition; } @@ -76002,7 +79440,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265 /* PropertyAssignment */) { + if (element.kind !== 268 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -76077,13 +79515,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (valueExpression.operator !== 38 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -76100,7 +79538,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -76171,7 +79609,7 @@ var ts; function serializeCompilerOptions(options) { var result = ts.createMap(); var optionsNameMap = getOptionNameMap().optionNameMap; - var _loop_5 = function (name) { + var _loop_6 = function (name) { if (ts.hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean @@ -76200,7 +79638,7 @@ var ts; } }; for (var name in options) { - _loop_5(name); + _loop_6(name); } return result; } @@ -76320,9 +79758,9 @@ var ts; return x === undefined || x === null; } function directoryOfCombinedPath(fileName, basePath) { - // Use the `identity` function to avoid canonicalizing the path, as it must remain noncanonical + // Use the `getNormalizedAbsolutePath` function to avoid canonicalizing the path, as it must remain noncanonical // until consistient casing errors are reported - return ts.getDirectoryPath(ts.toPath(fileName, basePath, ts.identity)); + return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath)); } /** * Parse the contents of a config file from json or json source file (tsconfig.json). @@ -76339,8 +79777,7 @@ var ts; if (extraFileExtensions === void 0) { extraFileExtensions = []; } ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); var errors = []; - var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors); + var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); var raw = parsedConfig.raw; var options = ts.extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName; @@ -76426,20 +79863,20 @@ var ts; * This *just* extracts options/include/exclude/files out of a config file. * It does *not* resolve the included files. */ - function parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors) { + function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors) { basePath = ts.normalizeSlashes(basePath); - var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); + var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))); return { raw: json || convertToObject(sourceFile, errors) }; } var ownConfig = json ? - parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) : - parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors); + parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : + parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); - var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { var baseRaw_1 = extendedConfig.raw; var raw_1 = ownConfig.raw; @@ -76461,7 +79898,7 @@ var ts; } return ownConfig; } - function parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { if (ts.hasProperty(json, "excludes")) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } @@ -76477,12 +79914,12 @@ var ts; } else { var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, getCanonicalFileName, errors, ts.createCompilerDiagnostic); + extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, ts.createCompilerDiagnostic); } } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { var options = getDefaultCompilerOptions(configFileName); var typeAcquisition, typingOptionstypeAcquisition; var extendedConfigPath; @@ -76500,7 +79937,7 @@ var ts; switch (key) { case "extends": var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(value, host, newBase, getCanonicalFileName, errors, function (message, arg0) { + extendedConfigPath = getExtendsConfigPath(value, host, newBase, errors, function (message, arg0) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0); }); return; @@ -76534,14 +79971,14 @@ var ts; } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function getExtendsConfigPath(extendedConfig, host, basePath, getCanonicalFileName, errors, createDiagnostic) { + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { extendedConfig = ts.normalizeSlashes(extendedConfig); // If the path isn't a rooted or relative path, don't try to resolve it (we reserve the right to special case module-id like paths in the future) if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../"))) { errors.push(createDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); return undefined; } - var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); + var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath); if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) { extendedConfigPath = extendedConfigPath + ".json"; if (!host.fileExists(extendedConfigPath)) { @@ -76551,7 +79988,7 @@ var ts; } return extendedConfigPath; } - function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors) { + function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) { var extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); if (sourceFile) { (sourceFile.extendedSourceFiles || (sourceFile.extendedSourceFiles = [])).push(extendedResult.fileName); @@ -76561,13 +79998,13 @@ var ts; return undefined; } var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), getCanonicalFileName, resolutionStack, errors); + var extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors); if (sourceFile) { (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); } if (isSuccessfulParsedTsconfig(extendedConfig)) { // Update the paths to reflect base path - var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; var mapPropertiesInRawIfNotUndefined = function (propertyName) { if (raw_2[propertyName]) { @@ -76606,7 +80043,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -76616,8 +80053,7 @@ var ts; return options; } function getDefaultTypeAcquisition(configFileName) { - var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; - return options; + return { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { var options = getDefaultTypeAcquisition(configFileName); @@ -76709,20 +80145,6 @@ var ts; * \/?$ # matches an optional trailing directory separator at the end of the string. */ var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; - /** - * Tests for a path with multiple recursive directory wildcards. - * Matches **\** and **\a\**, but not **\a**b. - * - * NOTE: used \ in place of / above to avoid issues with multiline comments. - * - * Breakdown: - * (^|\/) # matches either the beginning of the string or a directory separator. - * \*\*\/ # matches a recursive directory wildcard "**" followed by a directory separator. - * (.*\/)? # optionally matches any number of characters followed by a directory separator. - * \*\* # matches a recursive directory wildcard "**" - * ($|\/) # matches either the end of the string or a directory separator. - */ - var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; /** * Tests for a path where .. appears after a recursive directory wildcard. * Matches **\..\*, **\a\..\*, and **\.., but not ..\**\* @@ -76891,9 +80313,6 @@ var ts; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } - else if (invalidMultipleRecursionPatterns.test(spec)) { - return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; - } else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } @@ -77235,6 +80654,7 @@ var ts; ScriptElementKindModifier["ambientModifier"] = "declare"; ScriptElementKindModifier["staticModifier"] = "static"; ScriptElementKindModifier["abstractModifier"] = "abstract"; + ScriptElementKindModifier["optionalModifier"] = "optional"; })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); var ClassificationTypeNames; (function (ClassificationTypeNames) { @@ -77305,36 +80725,36 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 264 /* CatchClause */: - case 257 /* JsxAttribute */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 267 /* CatchClause */: + case 260 /* JsxAttribute */: return 1 /* Value */; - case 146 /* TypeParameter */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 164 /* TypeLiteral */: + case 147 /* TypeParameter */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 165 /* TypeLiteral */: return 2 /* Type */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 268 /* EnumMember */: - case 230 /* ClassDeclaration */: + case 271 /* EnumMember */: + case 233 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -77344,26 +80764,26 @@ var ts; else { return 4 /* Namespace */; } - case 233 /* EnumDeclaration */: - case 242 /* NamedImports */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 236 /* EnumDeclaration */: + case 245 /* NamedImports */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 269 /* SourceFile */: + case 272 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 244 /* ExportAssignment */) { + else if (node.parent.kind === 247 /* ExportAssignment */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -77388,19 +80808,14 @@ var ts; } ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 71 /* Identifier */); // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 144 /* QualifiedName */ && - node.parent.right === node && - node.parent.parent.kind === 238 /* ImportEqualsDeclaration */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - return 4 /* Namespace */; + var name = node.kind === 145 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 241 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 144 /* QualifiedName */) { + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -77412,27 +80827,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 144 /* QualifiedName */) { - while (root.parent && root.parent.kind === 144 /* QualifiedName */) { + if (root.parent.kind === 145 /* QualifiedName */) { + while (root.parent && root.parent.kind === 145 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 160 /* TypeReference */ && !isLastClause; + return root.parent.kind === 161 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 180 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 180 /* PropertyAccessExpression */) { + if (root.parent.kind === 183 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 183 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 202 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 263 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 205 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 266 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 230 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || - (decl.kind === 231 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); + return (decl.kind === 233 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || + (decl.kind === 234 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); } return false; } @@ -77443,23 +80858,23 @@ var ts; switch (node.kind) { case 99 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return true; } switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 182 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 185 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 183 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 186 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -77472,7 +80887,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 223 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 226 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -77482,13 +80897,13 @@ var ts; ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { return node.kind === 71 /* Identifier */ && - (node.parent.kind === 219 /* BreakStatement */ || node.parent.kind === 218 /* ContinueStatement */) && + (node.parent.kind === 222 /* BreakStatement */ || node.parent.kind === 221 /* ContinueStatement */) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { return node.kind === 71 /* Identifier */ && - node.parent.kind === 223 /* LabeledStatement */ && + node.parent.kind === 226 /* LabeledStatement */ && node.parent.label === node; } function isLabelName(node) { @@ -77496,15 +80911,15 @@ var ts; } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 234 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 237 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -77514,22 +80929,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 268 /* EnumMember */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 234 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 271 /* EnumMember */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 237 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return true; - case 174 /* LiteralType */: - return node.parent.parent.kind === 172 /* IndexedAccessType */; + case 177 /* LiteralType */: + return node.parent.parent.kind === 175 /* IndexedAccessType */; } } ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess; @@ -77539,7 +80954,7 @@ var ts; } ts.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration; function getContainerNode(node) { - if (node.kind === 288 /* JSDocTypedefTag */) { + if (node.kind === 291 /* JSDocTypedefTag */) { // This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope. // node.parent = the JSDoc comment, node.parent.parent = the node having the comment. // Then we get parent again in the loop. @@ -77551,17 +80966,17 @@ var ts; return undefined; } switch (node.kind) { - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return node; } } @@ -77569,48 +80984,48 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return "class" /* classElement */; - case 231 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 232 /* TypeAliasDeclaration */: return "type" /* typeElement */; - case 233 /* EnumDeclaration */: return "enum" /* enumElement */; - case 227 /* VariableDeclaration */: + case 234 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 235 /* TypeAliasDeclaration */: return "type" /* typeElement */; + case 236 /* EnumDeclaration */: return "enum" /* enumElement */; + case 230 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return "function" /* functionElement */; - case 154 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 155 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 155 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 156 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return "property" /* memberVariableElement */; - case 158 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 157 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 156 /* CallSignature */: return "call" /* callSignatureElement */; - case 153 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 146 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 268 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 147 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 238 /* ImportEqualsDeclaration */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 247 /* ExportSpecifier */: - case 241 /* NamespaceImport */: + case 159 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 158 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 157 /* CallSignature */: return "call" /* callSignatureElement */; + case 154 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 147 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 271 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 148 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 241 /* ImportEqualsDeclaration */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 250 /* ExportSpecifier */: + case 244 /* NamespaceImport */: return "alias" /* alias */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var kind = ts.getSpecialPropertyAssignmentKind(node); var right = node.right; switch (kind) { @@ -77651,7 +81066,7 @@ var ts; return true; case 71 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 147 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 148 /* Parameter */; default: return false; } @@ -77700,42 +81115,42 @@ var ts; return false; } switch (n.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 175 /* ObjectBindingPattern */: - case 164 /* TypeLiteral */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 236 /* CaseBlock */: - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 165 /* TypeLiteral */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 239 /* CaseBlock */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return nodeEndsWith(n, 18 /* CloseBraceToken */, sourceFile); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 183 /* NewExpression */: + case 186 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 182 /* CallExpression */: - case 186 /* ParenthesizedExpression */: - case 169 /* ParenthesizedType */: + case 185 /* CallExpression */: + case 189 /* ParenthesizedExpression */: + case 172 /* ParenthesizedType */: return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 191 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -77745,73 +81160,70 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 20 /* CloseParenToken */, sourceFile); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 212 /* IfStatement */: + case 215 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || - hasChildOfKind(n, 25 /* SemicolonToken */); - case 178 /* ArrayLiteralExpression */: - case 176 /* ArrayBindingPattern */: - case 181 /* ElementAccessExpression */: - case 145 /* ComputedPropertyName */: - case 166 /* TupleType */: + hasChildOfKind(n, 25 /* SemicolonToken */, sourceFile); + case 181 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 184 /* ElementAccessExpression */: + case 146 /* ComputedPropertyName */: + case 167 /* TupleType */: return nodeEndsWith(n, 22 /* CloseBracketToken */, sourceFile); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; - var hasWhileKeyword = findChildOfKind(n, 106 /* WhileKeyword */, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - case 163 /* TypeQuery */: + return hasChildOfKind(n, 106 /* WhileKeyword */, sourceFile) + ? nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile) + : isCompletedNode(n.statement, sourceFile); + case 164 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 190 /* TypeOfExpression */: - case 189 /* DeleteExpression */: - case 191 /* VoidExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: + case 193 /* TypeOfExpression */: + case 192 /* DeleteExpression */: + case 194 /* VoidExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; } } - ts.isCompletedNode = isCompletedNode; /* * Checks if node ends with 'expectedLastToken'. * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. @@ -77851,7 +81263,7 @@ var ts; } ts.hasChildOfKind = hasChildOfKind; function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); + return ts.find(n.getChildren(sourceFile), function (c) { return c.kind === kind; }); } ts.findChildOfKind = findChildOfKind; function findContainingList(node) { @@ -77980,19 +81392,11 @@ var ts; var result = find(startNode || sourceFile); ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); return result; - function findRightmostToken(n) { - if (ts.isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } function find(n) { - if (ts.isToken(n)) { + if (isNonWhitespaceToken(n)) { return n; } - var children = n.getChildren(); + var children = n.getChildren(sourceFile); for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). @@ -78008,7 +81412,7 @@ var ts; if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } else { // candidate should be in this node @@ -78016,34 +81420,45 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 269 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 272 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. // Namely we are skipping the check: 'position < node.end' if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } - } - /** - * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. - */ - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - var child = children[i]; - if (isWhiteSpaceOnlyJsxText(child)) { - ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - else if (nodeHasTokens(children[i])) { - return children[i]; - } + return candidate && findRightmostToken(candidate, sourceFile); } } } ts.findPrecedingToken = findPrecedingToken; - function isInString(sourceFile, position) { - var previousToken = findPrecedingToken(position, sourceFile); + function isNonWhitespaceToken(n) { + return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n); + } + function findRightmostToken(n, sourceFile) { + if (isNonWhitespaceToken(n)) { + return n; + } + var children = n.getChildren(sourceFile); + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate, sourceFile); + } + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { + for (var i = exclusiveStartPosition - 1; i >= 0; i--) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } + function isInString(sourceFile, position, previousToken) { + if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); } if (previousToken && ts.isStringTextContainingNode(previousToken)) { var start = previousToken.getStart(); var end = previousToken.getEnd(); @@ -78077,17 +81492,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
|
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 253 /* JsxClosingElement */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 256 /* JsxClosingElement */) { return true; } return false; @@ -78096,7 +81511,6 @@ var ts; function isWhiteSpaceOnlyJsxText(node) { return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; } - ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); @@ -78149,10 +81563,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 160 /* TypeReference */ || node.kind === 182 /* CallExpression */) { + if (node.kind === 161 /* TypeReference */ || node.kind === 185 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 230 /* ClassDeclaration */ || node.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 233 /* ClassDeclaration */ || node.kind === 234 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -78204,18 +81618,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 178 /* ArrayLiteralExpression */ || - node.kind === 179 /* ObjectLiteralExpression */) { + if (node.kind === 181 /* ArrayLiteralExpression */ || + node.kind === 182 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 195 /* BinaryExpression */ && + if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 217 /* ForOfStatement */ && + if (node.parent.kind === 220 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -78223,7 +81637,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 265 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 268 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -78257,15 +81671,27 @@ var ts; return ts.createTextSpanFromBounds(range.pos, range.end); } ts.createTextSpanFromRange = createTextSpanFromRange; + function createTextChangeFromStartLength(start, length, newText) { + return createTextChange(ts.createTextSpan(start, length), newText); + } + ts.createTextChangeFromStartLength = createTextChangeFromStartLength; + function createTextChange(span, newText) { + return { span: span, newText: newText }; + } + ts.createTextChange = createTextChange; ts.typeKeywords = [ 119 /* AnyKeyword */, 122 /* BooleanKeyword */, - 130 /* NeverKeyword */, - 133 /* NumberKeyword */, - 134 /* ObjectKeyword */, - 136 /* StringKeyword */, - 137 /* SymbolKeyword */, + 128 /* KeyOfKeyword */, + 131 /* NeverKeyword */, + 95 /* NullKeyword */, + 134 /* NumberKeyword */, + 135 /* ObjectKeyword */, + 137 /* StringKeyword */, + 138 /* SymbolKeyword */, 105 /* VoidKeyword */, + 140 /* UndefinedKeyword */, + 141 /* UniqueKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); @@ -78286,12 +81712,34 @@ var ts; }; } ts.nodeSeenTracker = nodeSeenTracker; + /** Add a value to a set, and return true if it wasn't already present. */ + function addToSeen(seen, key) { + key = String(key); + if (seen.has(key)) { + return false; + } + seen.set(key, true); + return true; + } + ts.addToSeen = addToSeen; + function getSnapshotText(snap) { + return snap.getText(0, snap.getLength()); + } + ts.getSnapshotText = getSnapshotText; + function repeatString(str, count) { + var result = ""; + for (var i = 0; i < count; i++) { + result += str; + } + return result; + } + ts.repeatString = repeatString; })(ts || (ts = {})); // Display-part writer helpers /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 147 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 148 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -78300,6 +81748,7 @@ var ts; var lineStart; var indent; resetWriter(); + var unknownWrite = function (text) { return writeKind(text, ts.SymbolDisplayPartKind.text); }; return { displayParts: function () { return displayParts; }, writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, @@ -78309,8 +81758,18 @@ var ts; writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, writeProperty: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.propertyName); }, + writeLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, writeSymbol: writeSymbol, writeLine: writeLine, + write: unknownWrite, + writeTextOfNode: unknownWrite, + getText: function () { return ""; }, + getTextPos: function () { return 0; }, + getColumn: function () { return 0; }, + getLine: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + rawWrite: ts.notImplemented, + getIndent: function () { return indent; }, increaseIndent: function () { indent++; }, decreaseIndent: function () { indent--; }, clear: resetWriter, @@ -78431,14 +81890,17 @@ var ts; /** * The default is CRLF. */ - function getNewLineOrDefaultFromHost(host) { - return host.getNewLine ? host.getNewLine() : carriageReturnLineFeed; + function getNewLineOrDefaultFromHost(host, formatSettings) { + return (formatSettings && formatSettings.newLineCharacter) || + (host.getNewLine && host.getNewLine()) || + carriageReturnLineFeed; } ts.getNewLineOrDefaultFromHost = getNewLineOrDefaultFromHost; function lineBreakPart() { return displayPart("\n", ts.SymbolDisplayPartKind.lineBreak); } ts.lineBreakPart = lineBreakPart; + /* @internal */ function mapToDisplayParts(writeDisplayParts) { try { writeDisplayParts(displayPartWriter); @@ -78451,38 +81913,26 @@ var ts; ts.mapToDisplayParts = mapToDisplayParts; function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) { return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); + typechecker.writeType(type, enclosingDeclaration, flags | 1024 /* MultilineObjectLiterals */, writer); }); } ts.typeToDisplayParts = typeToDisplayParts; function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { return mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags); + typeChecker.writeSymbol(symbol, enclosingDeclaration, meaning, flags | 8 /* UseAliasDefinedOutsideCurrentScope */, writer); }); } ts.symbolToDisplayParts = symbolToDisplayParts; function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { - flags |= 65536 /* UseAliasDefinedOutsideCurrentScope */; + flags |= 16384 /* UseAliasDefinedOutsideCurrentScope */ | 1024 /* MultilineObjectLiterals */ | 32 /* WriteTypeArgumentsOfSignature */ | 8192 /* OmitParameterModifiers */; return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); + typechecker.writeSignature(signature, enclosingDeclaration, flags, /*signatureKind*/ undefined, writer); }); } ts.signatureToDisplayParts = signatureToDisplayParts; - function getDeclaredName(typeChecker, symbol, location) { - // If this is an export or import specifier it could have been renamed using the 'as' syntax. - // If so we want to search for whatever is under the cursor. - if (isImportOrExportSpecifierName(location) || ts.isStringOrNumericLiteral(location) && location.parent.kind === 145 /* ComputedPropertyName */) { - return ts.getTextOfIdentifierOrLiteral(location); - } - // Try to get the local symbol if we're dealing with an 'export default' - // since that symbol has the "true" name. - var localExportDefaultSymbol = ts.getLocalSymbolForExportDefault(symbol); - return typeChecker.symbolToString(localExportDefaultSymbol || symbol); - } - ts.getDeclaredName = getDeclaredName; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 243 /* ImportSpecifier */ || location.parent.kind === 247 /* ExportSpecifier */) && + (location.parent.kind === 246 /* ImportSpecifier */ || location.parent.kind === 250 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -78493,12 +81943,16 @@ var ts; */ function stripQuotes(name) { var length = name.length; - if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && ts.isSingleOrDoubleQuote(name.charCodeAt(0))) { + if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) { return name.substring(1, length - 1); } return name; } ts.stripQuotes = stripQuotes; + function startsWithQuote(name) { + return ts.isSingleOrDoubleQuote(name.charCodeAt(0)); + } + ts.startsWithQuote = startsWithQuote; function scriptKindIs(fileName, host) { var scriptKinds = []; for (var _i = 2; _i < arguments.length; _i++) { @@ -78525,57 +81979,6 @@ var ts; return position; } ts.getFirstNonSpaceCharacterPosition = getFirstNonSpaceCharacterPosition; - function getOpenBrace(constructor, sourceFile) { - // First token is the open curly, this is where we want to put the 'super' call. - return constructor.body.getFirstToken(sourceFile); - } - ts.getOpenBrace = getOpenBrace; - function getOpenBraceOfClassLike(declaration, sourceFile) { - return ts.getTokenAtPosition(sourceFile, declaration.members.pos - 1, /*includeJsDocComment*/ false); - } - ts.getOpenBraceOfClassLike = getOpenBraceOfClassLike; - function getSourceFileImportLocation(_a) { - var text = _a.text; - var shebang = ts.getShebang(text); - var position = 0; - if (shebang !== undefined) { - position = shebang.length; - advancePastLineBreak(); - } - // For a source file, it is possible there are detached comments we should not skip - var ranges = ts.getLeadingCommentRanges(text, position); - if (!ranges) - return position; - // However we should still skip a pinned comment at the top - if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { - position = ranges[0].end; - advancePastLineBreak(); - ranges = ranges.slice(1); - } - // As well as any triple slash references - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { - position = range.end; - advancePastLineBreak(); - continue; - } - break; - } - return position; - function advancePastLineBreak() { - if (position < text.length) { - var charCode = text.charCodeAt(position); - if (ts.isLineBreak(charCode)) { - position++; - if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) { - position++; - } - } - } - } - } - ts.getSourceFileImportLocation = getSourceFileImportLocation; /** * Creates a deep, memberwise clone of a node with no source map location. * @@ -78607,6 +82010,10 @@ var ts; return visited; } ts.getSynthesizedDeepClone = getSynthesizedDeepClone; + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(getSynthesizedDeepClone), nodes.hasTrailingComma); + } + ts.getSynthesizedDeepClones = getSynthesizedDeepClones; /** * Sets EmitFlags to suppress leading and trailing trivia on the node. */ @@ -78739,10 +82146,10 @@ var ts; } break; case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -78880,7 +82287,7 @@ var ts; var lastEnd = 0; for (var i = 0; i < dense.length; i += 3) { var start = dense[i]; - var length_6 = dense[i + 1]; + var length_5 = dense[i + 1]; var type = dense[i + 2]; // Make a whitespace entry between the last item and this one. if (lastEnd >= 0) { @@ -78889,8 +82296,8 @@ var ts; entries.push({ length: whitespaceLength_1, classification: ts.TokenClass.Whitespace }); } } - entries.push({ length: length_6, classification: convertClassification(type) }); - lastEnd = start + length_6; + entries.push({ length: length_5, classification: convertClassification(type) }); + lastEnd = start + length_5; } var whitespaceLength = text.length - lastEnd; if (whitespaceLength > 0) { @@ -78928,7 +82335,7 @@ var ts; } switch (keyword2) { case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 123 /* ConstructorKeyword */: case 115 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -79067,10 +82474,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -79213,32 +82620,39 @@ var ts; if (!ts.isTrivia(kind)) { return start; } - // Don't bother with newlines/whitespace. - if (kind === 4 /* NewLineTrivia */ || kind === 5 /* WhitespaceTrivia */) { - continue; - } - // Only bother with the trivia if it at least intersects the span of interest. - if (ts.isComment(kind)) { - classifyComment(token, kind, start, width); - // Classifying a comment might cause us to reuse the trivia scanner - // (because of jsdoc comments). So after we classify the comment make - // sure we set the scanner position back to where it needs to be. - triviaScanner.setTextPos(end); - continue; - } - if (kind === 7 /* ConflictMarkerTrivia */) { - var text = sourceFile.text; - var ch = text.charCodeAt(start); - // for the <<<<<<< and >>>>>>> markers, we just add them in as comments - // in the classification stream. - if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - pushClassification(start, width, 1 /* comment */); + switch (kind) { + case 4 /* NewLineTrivia */: + case 5 /* WhitespaceTrivia */: + // Don't bother with newlines/whitespace. continue; - } - // for the ||||||| and ======== markers, add a comment for the first line, - // and then lex all subsequent lines up until the end of the conflict marker. - ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); - classifyDisabledMergeCode(text, start, end); + case 2 /* SingleLineCommentTrivia */: + case 3 /* MultiLineCommentTrivia */: + // Only bother with the trivia if it at least intersects the span of interest. + classifyComment(token, kind, start, width); + // Classifying a comment might cause us to reuse the trivia scanner + // (because of jsdoc comments). So after we classify the comment make + // sure we set the scanner position back to where it needs to be. + triviaScanner.setTextPos(end); + continue; + case 7 /* ConflictMarkerTrivia */: + var text = sourceFile.text; + var ch = text.charCodeAt(start); + // for the <<<<<<< and >>>>>>> markers, we just add them in as comments + // in the classification stream. + if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { + pushClassification(start, width, 1 /* comment */); + continue; + } + // for the ||||||| and ======== markers, add a comment for the first line, + // and then lex all subsequent lines up until the end of the conflict marker. + ts.Debug.assert(ch === 124 /* bar */ || ch === 61 /* equals */); + classifyDisabledMergeCode(text, start, end); + break; + case 6 /* ShebangTrivia */: + // TODO: Maybe we should classify these. + break; + default: + ts.Debug.assertNever(kind); } } } @@ -79274,16 +82688,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -79370,22 +82784,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -79400,7 +82814,7 @@ var ts; if (ts.isKeyword(tokenKind)) { return 3 /* keyword */; } - // Special case < and > If they appear in a generic context they are punctuation, + // Special case `<` and `>`: If they appear in a generic context they are punctuation, // not operators. if (tokenKind === 27 /* LessThanToken */ || tokenKind === 29 /* GreaterThanToken */) { // If the node owning the token has a type argument list or type parameter list, then @@ -79413,17 +82827,17 @@ var ts; if (token) { if (tokenKind === 58 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 227 /* VariableDeclaration */ || - token.parent.kind === 150 /* PropertyDeclaration */ || - token.parent.kind === 147 /* Parameter */ || - token.parent.kind === 257 /* JsxAttribute */) { + if (token.parent.kind === 230 /* VariableDeclaration */ || + token.parent.kind === 151 /* PropertyDeclaration */ || + token.parent.kind === 148 /* Parameter */ || + token.parent.kind === 260 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 195 /* BinaryExpression */ || - token.parent.kind === 193 /* PrefixUnaryExpression */ || - token.parent.kind === 194 /* PostfixUnaryExpression */ || - token.parent.kind === 196 /* ConditionalExpression */) { + if (token.parent.kind === 198 /* BinaryExpression */ || + token.parent.kind === 196 /* PrefixUnaryExpression */ || + token.parent.kind === 197 /* PostfixUnaryExpression */ || + token.parent.kind === 199 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -79433,7 +82847,7 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 257 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 260 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 12 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -79449,32 +82863,32 @@ var ts; else if (tokenKind === 71 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 147 /* Parameter */: + case 148 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -79510,11 +82924,14 @@ var ts; (function (Completions) { var PathCompletions; (function (PathCompletions) { - function getStringLiteralCompletionsFromModuleNames(node, compilerOptions, host, typeChecker) { + function createPathCompletion(name, kind, span) { + return { name: name, kind: kind, span: span }; + } + function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; var scriptDirectory = ts.getDirectoryPath(scriptPath); - var span = getDirectoryFragmentTextSpan(node.text, node.getStart() + 1); + var span = getDirectoryFragmentTextSpan(node.text, node.getStart(sourceFile) + 1); if (isPathRelativeToScript(literalValue) || ts.isRootedDiskPath(literalValue)) { var extensions = ts.getSupportedExtensions(compilerOptions); if (compilerOptions.rootDirs) { @@ -79594,12 +83011,12 @@ var ts; continue; } var foundFileName = includeExtensions ? ts.getBaseFileName(filePath) : ts.removeFileExtension(ts.getBaseFileName(filePath)); - if (!foundFiles.get(foundFileName)) { + if (!foundFiles.has(foundFileName)) { foundFiles.set(foundFileName, true); } } ts.forEachKey(foundFiles, function (foundFile) { - result.push(createCompletionEntryForModule(foundFile, "script" /* scriptElement */, span)); + result.push(createPathCompletion(foundFile, "script" /* scriptElement */, span)); }); } // If possible, get folder completion as well @@ -79608,7 +83025,7 @@ var ts; for (var _a = 0, directories_1 = directories; _a < directories_1.length; _a++) { var directory = directories_1[_a]; var directoryName = ts.getBaseFileName(ts.normalizePath(directory)); - result.push(createCompletionEntryForModule(directoryName, "directory" /* directory */, span)); + result.push(createPathCompletion(directoryName, "directory" /* directory */, span)); } } } @@ -79629,37 +83046,20 @@ var ts; var projectDir = compilerOptions.project || host.getCurrentDirectory(); var absolute = ts.isRootedDiskPath(baseUrl) ? baseUrl : ts.combinePaths(projectDir, baseUrl); getCompletionEntriesForDirectoryFragment(fragment, ts.normalizePath(absolute), fileExtensions, /*includeExtensions*/ false, span, host, /*exclude*/ undefined, result); - var _loop_6 = function (path) { - if (!paths.hasOwnProperty(path)) - return "continue"; - var patterns = paths[path]; - if (!patterns) - return "continue"; - if (path === "*") { - for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) { - var pattern = patterns_1[_i]; - var _loop_7 = function (match) { - // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. - if (result.some(function (entry) { return entry.name === match; })) - return "continue"; - result.push(createCompletionEntryForModule(match, "external module name" /* externalModuleName */, span)); - }; - for (var _a = 0, _b = getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host); _a < _b.length; _a++) { - var match = _b[_a]; - _loop_7(match); - } - } - } - else if (ts.startsWith(path, fragment)) { - if (patterns.length === 1) { - if (result.some(function (entry) { return entry.name === path; })) - return "continue"; - result.push(createCompletionEntryForModule(path, "external module name" /* externalModuleName */, span)); - } - } - }; for (var path in paths) { - _loop_6(path); + var patterns = paths[path]; + if (paths.hasOwnProperty(path) && patterns) { + var _loop_7 = function (name, kind) { + // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. + if (!result.some(function (entry) { return entry.name === name; })) { + result.push(createPathCompletion(name, kind, span)); + } + }; + for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host); _i < _a.length; _i++) { + var _b = _a[_i], name = _b.name, kind = _b.kind; + _loop_7(name, kind); + } + } } } if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) { @@ -79671,50 +83071,63 @@ var ts; }); } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); - for (var _i = 0, _a = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + for (var _c = 0, _d = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _c < _d.length; _c++) { + var moduleName = _d[_c]; + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); } return result; } - function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { - if (host.readDirectory) { - var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; - if (parsed) { - // The prefix has two effective parts: the directory path and the base component after the filepath that is not a - // full directory component. For example: directory/path/of/prefix/base* - var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); - var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); - var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); - var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); - // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call - var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; - var normalizedSuffix = ts.normalizePath(parsed.suffix); - var baseDirectory = ts.combinePaths(baseUrl, expandedPrefixDirectory); - var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; - // If we have a suffix, then we need to read the directory all the way down. We could create a glob - // that encodes the suffix, but we would have to escape the character "?" which readDirectory - // doesn't support. For now, this is safer but slower - var includeGlob = normalizedSuffix ? "**/*" : "./*"; - var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]); - if (matches) { - var result = []; - // Trim away prefix and suffix - for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { - var match = matches_1[_i]; - var normalizedMatch = ts.normalizePath(match); - if (!ts.endsWith(normalizedMatch, normalizedSuffix) || !ts.startsWith(normalizedMatch, completePrefix)) { - continue; - } - var start = completePrefix.length; - var length_7 = normalizedMatch.length - start - normalizedSuffix.length; - result.push(ts.removeFileExtension(normalizedMatch.substr(start, length_7))); - } - return result; - } - } + function getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host) { + if (!ts.endsWith(path, "*")) { + // For a path mapping "foo": ["/x/y/z.ts"], add "foo" itself as a completion. + return !ts.stringContains(path, "*") && ts.startsWith(path, fragment) ? [{ name: path, kind: "directory" /* directory */ }] : ts.emptyArray; } - return undefined; + var pathPrefix = path.slice(0, path.length - 1); + if (!ts.startsWith(fragment, pathPrefix)) { + return [{ name: pathPrefix, kind: "directory" /* directory */ }]; + } + var remainingFragment = fragment.slice(pathPrefix.length); + return ts.flatMap(patterns, function (pattern) { return getModulesForPathsPattern(remainingFragment, baseUrl, pattern, fileExtensions, host); }); + } + function getModulesForPathsPattern(fragment, baseUrl, pattern, fileExtensions, host) { + if (!host.readDirectory) { + return undefined; + } + var parsed = ts.hasZeroOrOneAsteriskCharacter(pattern) ? ts.tryParsePattern(pattern) : undefined; + if (!parsed) { + return undefined; + } + // The prefix has two effective parts: the directory path and the base component after the filepath that is not a + // full directory component. For example: directory/path/of/prefix/base* + var normalizedPrefix = normalizeAndPreserveTrailingSlash(parsed.prefix); + var normalizedPrefixDirectory = ts.getDirectoryPath(normalizedPrefix); + var normalizedPrefixBase = ts.getBaseFileName(normalizedPrefix); + var fragmentHasPath = ts.stringContains(fragment, ts.directorySeparator); + // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call + var expandedPrefixDirectory = fragmentHasPath ? ts.combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + ts.getDirectoryPath(fragment)) : normalizedPrefixDirectory; + var normalizedSuffix = ts.normalizePath(parsed.suffix); + // Need to normalize after combining: If we combinePaths("a", "../b"), we want "b" and not "a/../b". + var baseDirectory = ts.normalizePath(ts.combinePaths(baseUrl, expandedPrefixDirectory)); + var completePrefix = fragmentHasPath ? baseDirectory : ts.ensureTrailingDirectorySeparator(baseDirectory) + normalizedPrefixBase; + // If we have a suffix, then we need to read the directory all the way down. We could create a glob + // that encodes the suffix, but we would have to escape the character "?" which readDirectory + // doesn't support. For now, this is safer but slower + var includeGlob = normalizedSuffix ? "**/*" : "./*"; + var matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]).map(function (name) { return ({ name: name, kind: "script" /* scriptElement */ }); }); + var directories = tryGetDirectories(host, baseDirectory).map(function (d) { return ts.combinePaths(baseDirectory, d); }).map(function (name) { return ({ name: name, kind: "directory" /* directory */ }); }); + // Trim away prefix and suffix + return ts.mapDefined(ts.concatenate(matches, directories), function (_a) { + var name = _a.name, kind = _a.kind; + var normalizedMatch = ts.normalizePath(name); + var inner = withoutStartAndEnd(normalizedMatch, completePrefix, normalizedSuffix); + return inner !== undefined ? { name: removeLeadingDirectorySeparator(ts.removeFileExtension(inner)), kind: kind } : undefined; + }); + } + function withoutStartAndEnd(s, start, end) { + return ts.startsWith(s, start) && ts.endsWith(s, end) ? s.slice(start.length, s.length - end.length) : undefined; + } + function removeLeadingDirectorySeparator(path) { + return path[0] === ts.directorySeparator ? path.slice(1) : path; } function enumeratePotentialNonRelativeModules(fragment, scriptPath, options, typeChecker, host) { // Check If this is a nested module @@ -79786,10 +83199,12 @@ var ts; function getCompletionEntriesFromTypings(host, options, scriptPath, span, result) { if (result === void 0) { result = []; } // Check for typings specified in compiler options + var seen = ts.createMap(); if (options.types) { for (var _i = 0, _a = options.types; _i < _a.length; _i++) { - var moduleName = _a[_i]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + var typesName = _a[_i]; + var moduleName = ts.getUnmangledNameForScopedPackage(typesName); + pushResult(moduleName); } } else if (host.getDirectories) { @@ -79801,31 +83216,38 @@ var ts; if (typeRoots) { for (var _c = 0, typeRoots_2 = typeRoots; _c < typeRoots_2.length; _c++) { var root = typeRoots_2[_c]; - getCompletionEntriesFromDirectories(host, root, span, result); + getCompletionEntriesFromDirectories(root); } } - } - if (host.getDirectories) { // Also get all @types typings installed in visible node_modules directories for (var _d = 0, _e = findPackageJsons(scriptPath, host); _d < _e.length; _d++) { var packageJson = _e[_d]; var typesDir = ts.combinePaths(ts.getDirectoryPath(packageJson), "node_modules/@types"); - getCompletionEntriesFromDirectories(host, typesDir, span, result); + getCompletionEntriesFromDirectories(typesDir); } } return result; - } - function getCompletionEntriesFromDirectories(host, directory, span, result) { - if (host.getDirectories && tryDirectoryExists(host, directory)) { - var directories = tryGetDirectories(host, directory); - if (directories) { - for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { - var typeDirectory = directories_2[_i]; - typeDirectory = ts.normalizePath(typeDirectory); - result.push(createCompletionEntryForModule(ts.getBaseFileName(typeDirectory), "external module name" /* externalModuleName */, span)); + function getCompletionEntriesFromDirectories(directory) { + ts.Debug.assert(!!host.getDirectories); + if (tryDirectoryExists(host, directory)) { + var directories = tryGetDirectories(host, directory); + if (directories) { + for (var _i = 0, directories_2 = directories; _i < directories_2.length; _i++) { + var typeDirectory = directories_2[_i]; + typeDirectory = ts.normalizePath(typeDirectory); + var directoryName = ts.getBaseFileName(typeDirectory); + var moduleName = ts.getUnmangledNameForScopedPackage(directoryName); + pushResult(moduleName); + } } } } + function pushResult(moduleName) { + if (!seen.has(moduleName)) { + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); + seen.set(moduleName, true); + } + } } function findPackageJsons(directory, host) { var paths = []; @@ -79884,9 +83306,6 @@ var ts; } } } - function createCompletionEntryForModule(name, kind, replacementSpan) { - return { name: name, kind: kind, kindModifiers: "" /* none */, sortText: name, replacementSpan: replacementSpan }; - } // Replace everything after the last directory seperator that appears function getDirectoryFragmentTextSpan(text, textStart) { var index = text.lastIndexOf(ts.directorySeparator); @@ -79903,7 +83322,13 @@ var ts; return false; } function normalizeAndPreserveTrailingSlash(path) { - return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(path)) : ts.normalizePath(path); + if (ts.normalizeSlashes(path) === "./") { + // normalizePath turns "./" into "". "" + "/" would then be a rooted path instead of a relative one, so avoid this particular case. + // There is no problem for adding "/" to a non-empty string -- it's only a problem at the beginning. + return ""; + } + var norm = ts.normalizePath(path); + return ts.hasTrailingDirectorySeparator(path) ? ts.ensureTrailingDirectorySeparator(norm) : norm; } /** * Matches a triple slash reference directive with an incomplete string literal for its path. Used @@ -79920,10 +83345,10 @@ var ts; var tripleSlashDirectiveFragmentRegex = /^(\/\/\/\s* completion list at "1" will contain "div" with type any + // var x =
+ // The completion list at "1" will contain "div" with type any var tagName = location.parent.parent.openingElement.tagName; return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [{ @@ -79992,37 +83475,37 @@ var ts; sortText: "0", }] }; } - if (request) { - var entries_3 = request.kind === "JsDocTagName" - // If the current position is a jsDoc tag name, only tag names should be provided for completion - ? ts.JsDoc.getJSDocTagNameCompletions() - : request.kind === "JsDocTag" - // If the current position is a jsDoc tag, only tags should be provided for completion - ? ts.JsDoc.getJSDocTagCompletions() - : ts.JsDoc.getJSDocParameterNameCompletions(request.tag); - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries_3 }; - } var entries = []; if (ts.isSourceFileJavaScript(sourceFile)) { - var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap); + var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames, compilerOptions.target, entries); } else { if ((!symbols || symbols.length === 0) && keywordFilters === 0 /* None */) { return undefined; } - getCompletionEntriesFromSymbols(symbols, entries, location, /*performCharacterChecks*/ true, typeChecker, compilerOptions.target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap); + getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, compilerOptions.target, log, completionKind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap); } // TODO add filter for keyword based on type/value/namespace and also location // Add all keywords if // - this is not a member completion list (all the keywords) // - other filters are enabled in required scenario so add those keywords + var isMemberCompletion = isMemberCompletionKind(completionKind); if (keywordFilters !== 0 /* None */ || !isMemberCompletion) { ts.addRange(entries, getKeywordCompletions(keywordFilters)); } - return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + return { isGlobalCompletion: completionKind === 1 /* Global */, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + } + function isMemberCompletionKind(kind) { + switch (kind) { + case 0 /* ObjectPropertyDeclaration */: + case 3 /* MemberLike */: + case 2 /* PropertyAccess */: + return true; + default: + return false; + } } - Completions.getCompletionsAtPosition = getCompletionsAtPosition; function getJavaScriptCompletionEntries(sourceFile, position, uniqueNames, target, entries) { ts.getNameTable(sourceFile).forEach(function (pos, name) { // Skip identifiers produced only from the current location @@ -80030,14 +83513,9 @@ var ts; return; } var realName = ts.unescapeLeadingUnderscores(name); - if (uniqueNames.has(realName) || ts.isStringANonContextualKeyword(realName)) { - return; - } - uniqueNames.set(realName, true); - var displayName = getCompletionEntryDisplayName(realName, target, /*performCharacterChecks*/ true, /*allowStringLiteral*/ false); - if (displayName) { + if (ts.addToSeen(uniqueNames, realName) && ts.isIdentifierText(realName, target) && !ts.isStringANonContextualKeyword(realName)) { entries.push({ - name: displayName, + name: realName, kind: "warning" /* warning */, kindModifiers: "", sortText: "1" @@ -80045,12 +83523,35 @@ var ts; } }); } - function createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target, allowStringLiteral, origin, recommendedCompletion) { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, allowStringLiteral, origin); - if (!displayName) { + function createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, includeInsertTextCompletions) { + var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind); + if (!info) { + return undefined; + } + var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess; + var insertText; + var replacementSpan; + if (includeInsertTextCompletions) { + if (origin && origin.type === "this-type") { + insertText = needsConvertPropertyAccess ? "this[" + quote(name) + "]" : "this." + name; + } + else if (needsConvertPropertyAccess) { + insertText = "[" + quote(name) + "]"; + var dot = ts.findChildOfKind(propertyAccessToConvert, 23 /* DotToken */, sourceFile); + // If the text after the '.' starts with this name, write over it. Else, add new text. + var end = ts.startsWith(name, propertyAccessToConvert.name.text) ? propertyAccessToConvert.name.end : dot.end; + replacementSpan = ts.createTextSpanFromBounds(dot.getStart(sourceFile), end); + } + if (isJsxInitializer) { + if (insertText === undefined) + insertText = name; + insertText = "{" + insertText + "}"; + if (typeof isJsxInitializer !== "boolean") { + replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile); + } + } + } + if (insertText !== undefined && !includeInsertTextCompletions) { return undefined; } // TODO(drosen): Right now we just permit *all* semantic meanings when calling @@ -80061,15 +83562,21 @@ var ts; // Use a 'sortText' of 0' so that all symbol completion entries come before any other // entries (like JavaScript identifier entries). return { - name: displayName, + name: name, kind: ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, location), kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), sortText: "0", source: getSourceFromOrigin(origin), - hasAction: trueOrUndefined(origin !== undefined), + hasAction: trueOrUndefined(!!origin && origin.type === "export"), isRecommended: trueOrUndefined(isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker)), + insertText: insertText, + replacementSpan: replacementSpan, }; } + function quote(text) { + // TODO: GH#20619 Use configured quote style + return JSON.stringify(text); + } function isRecommendedCompletionMatch(localSymbol, recommendedCompletion, checker) { return localSymbol === recommendedCompletion || !!(localSymbol.flags & 1048576 /* ExportValue */) && checker.getExportSymbolOfSymbol(localSymbol) === recommendedCompletion; @@ -80078,213 +83585,194 @@ var ts; return b ? true : undefined; } function getSourceFromOrigin(origin) { - return origin && ts.stripQuotes(origin.moduleSymbol.name); + return origin && origin.type === "export" ? ts.stripQuotes(origin.moduleSymbol.name) : undefined; } - function getCompletionEntriesFromSymbols(symbols, entries, location, performCharacterChecks, typeChecker, target, log, allowStringLiteral, recommendedCompletion, symbolToOriginInfoMap) { + function getCompletionEntriesFromSymbols(symbols, entries, location, sourceFile, typeChecker, target, log, kind, includeInsertTextCompletions, propertyAccessToConvert, isJsxInitializer, recommendedCompletion, symbolToOriginInfoMap) { var start = ts.timestamp(); // Tracks unique names. // We don't set this for global variables or completions from external module exports, because we can have multiple of those. // Based on the order we add things we will always see locals first, then globals, then module exports. // So adding a completion for a local will prevent us from adding completions for external module exports sharing the same name. var uniques = ts.createMap(); - if (symbols) { - for (var _i = 0, symbols_5 = symbols; _i < symbols_5.length; _i++) { - var symbol = symbols_5[_i]; - var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined; - var entry = createCompletionEntry(symbol, location, performCharacterChecks, typeChecker, target, allowStringLiteral, origin, recommendedCompletion); - if (!entry) { - continue; - } - var name = entry.name; - if (uniques.has(name)) { - continue; - } - // Latter case tests whether this is a global variable. - if (!origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }))) { - uniques.set(name, true); - } - entries.push(entry); + for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) { + var symbol = symbols_4[_i]; + var origin = symbolToOriginInfoMap ? symbolToOriginInfoMap[ts.getSymbolId(symbol)] : undefined; + var entry = createCompletionEntry(symbol, location, sourceFile, typeChecker, target, kind, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, includeInsertTextCompletions); + if (!entry) { + continue; } + var name = entry.name; + if (uniques.has(name)) { + continue; + } + // Latter case tests whether this is a global variable. + if (!origin && !(symbol.parent === undefined && !ts.some(symbol.declarations, function (d) { return d.getSourceFile() === location.getSourceFile(); }))) { + uniques.set(name, true); + } + entries.push(entry); } log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (ts.timestamp() - start)); return uniques; } - function getStringLiteralCompletionEntries(sourceFile, position, typeChecker, compilerOptions, host, log) { - var node = ts.findPrecedingToken(position, sourceFile); - if (!node || node.kind !== 9 /* StringLiteral */) { - return undefined; - } - if (node.parent.kind === 265 /* PropertyAssignment */ && - node.parent.parent.kind === 179 /* ObjectLiteralExpression */ && - node.parent.name === node) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent, typeChecker, compilerOptions.target, log); - } - else if (ts.isElementAccessExpression(node.parent) && node.parent.argumentExpression === node) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - return getStringLiteralCompletionEntriesFromElementAccess(node.parent, typeChecker, compilerOptions.target, log); - } - else if (node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */ - || ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent) - || ts.isExpressionOfExternalModuleImportEqualsDeclaration(node)) { - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // var y = import("/*completion position*/"); - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - // export * from "/*completion position*/"; - var entries = Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(node, compilerOptions, host, typeChecker); - return pathCompletionsInfo(entries); - } - else if (isEqualityExpression(node.parent)) { - // Get completions from the type of the other operand - // i.e. switch (a) { - // case '/*completion position*/' - // } - return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.left === node ? node.parent.right : node.parent.left), typeChecker); - } - else if (ts.isCaseOrDefaultClause(node.parent)) { - // Get completions from the type of the switch expression - // i.e. x === '/*completion position' - return getStringLiteralCompletionEntriesFromType(typeChecker.getTypeAtLocation(node.parent.parent.parent.expression), typeChecker); - } - else { - var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); - if (argumentInfo) { - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker); - } - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromType(typeChecker.getContextualType(node), typeChecker); + function getLabelCompletionAtPosition(node) { + var entries = getLabelStatementCompletions(node); + if (entries.length) { + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } } - function pathCompletionsInfo(entries) { - return { - // We don't want the editor to offer any other completions, such as snippets, inside a comment. - isGlobalCompletion: false, - isMemberCompletion: false, - // The user may type in a path that doesn't yet exist, creating a "new identifier" - // with respect to the collection of identifiers the server is aware of. - isNewIdentifierLocation: true, - entries: entries, - }; - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element, typeChecker, target, log) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, /*performCharacterChecks*/ false, typeChecker, target, log, /*allowStringLiteral*/ true); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { - var candidates = []; + function getLabelStatementCompletions(node) { var entries = []; var uniques = ts.createMap(); - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates, argumentInfo.argumentCount); - for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { - var candidate = candidates_1[_i]; - addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker, uniques); - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccess(node, typeChecker, target, log) { - var type = typeChecker.getTypeAtLocation(node.expression); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, node, /*performCharacterChecks*/ false, typeChecker, target, log, /*allowStringLiteral*/ true); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + var current = node; + while (current) { + if (ts.isFunctionLike(current)) { + break; } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromType(type, typeChecker) { - if (type) { - var entries = []; - addStringLiteralCompletionsFromType(type, entries, typeChecker); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; + if (ts.isLabeledStatement(current)) { + var name = current.label.text; + if (!uniques.has(name)) { + uniques.set(name, true); + entries.push({ + name: name, + kindModifiers: "" /* none */, + kind: "label" /* label */, + sortText: "0" + }); + } } + current = current.parent; } - return undefined; + return entries; } - function addStringLiteralCompletionsFromType(type, result, typeChecker, uniques) { + var StringLiteralCompletionKind; + (function (StringLiteralCompletionKind) { + StringLiteralCompletionKind[StringLiteralCompletionKind["Paths"] = 0] = "Paths"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Properties"] = 1] = "Properties"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; + })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); + function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { + switch (node.parent.kind) { + case 177 /* LiteralType */: + switch (node.parent.parent.kind) { + case 161 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(node.parent), typeChecker) }; + case 175 /* IndexedAccessType */: + // Get all apparent property names + // i.e. interface Foo { + // foo: string; + // bar: string; + // } + // let x: Foo["/*completion position*/"] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeFromTypeNode(node.parent.parent.objectType).getApparentProperties() }; + default: + return undefined; + } + case 268 /* PropertyAssignment */: + if (ts.isObjectLiteralExpression(node.parent.parent) && node.parent.name === node) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + var type = typeChecker.getContextualType(node.parent.parent); + return { kind: 1 /* Properties */, symbols: type && type.getApparentProperties() }; + } + return fromContextualType(); + case 184 /* ElementAccessExpression */: { + var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeAtLocation(expression).getApparentProperties() }; + } + return undefined; + } + case 185 /* CallExpression */: + case 186 /* NewExpression */: + if (!ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) && !ts.isImportCall(node.parent)) { + var argumentInfo_1 = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + if (argumentInfo_1) { + var candidates = []; + typeChecker.getResolvedSignature(argumentInfo_1.invocation, candidates, argumentInfo_1.argumentCount); + var uniques_1 = ts.createMap(); + return { kind: 2 /* Types */, types: ts.flatMap(candidates, function (candidate) { return getStringLiteralTypes(typeChecker.getParameterType(candidate, argumentInfo_1.argumentIndex), typeChecker, uniques_1); }) }; + } + return fromContextualType(); + } + // falls through (is `require("")` or `import("")`) + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 252 /* ExternalModuleReference */: + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // var y = import("/*completion position*/"); + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + // export * from "/*completion position*/"; + return { kind: 0 /* Paths */, paths: Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; + default: + return fromContextualType(); + } + function fromContextualType() { + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker), typeChecker) }; + } + } + function getStringLiteralTypes(type, typeChecker, uniques) { if (uniques === void 0) { uniques = ts.createMap(); } if (type && type.flags & 32768 /* TypeParameter */) { - type = typeChecker.getBaseConstraintOfType(type); - } - if (!type) { - return; - } - if (type.flags & 131072 /* Union */) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - addStringLiteralCompletionsFromType(t, result, typeChecker, uniques); - } - } - else if (type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */)) { - var name = type.value; - if (!uniques.has(name)) { - uniques.set(name, true); - result.push({ - name: name, - kindModifiers: "" /* none */, - kind: "var" /* variableElement */, - sortText: "0" - }); - } + type = type.getConstraint(); } + return type && type.flags & 131072 /* Union */ + ? ts.flatMap(type.types, function (t) { return getStringLiteralTypes(t, typeChecker, uniques); }) + : type && type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */) && ts.addToSeen(uniques, type.value) + ? [type] + : ts.emptyArray; } function getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, _a, allSourceFiles) { var name = _a.name, source = _a.source; - var completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, { includeExternalModuleExports: true }, compilerOptions.target); + var completionData = getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, { includeExternalModuleExports: true, includeInsertTextCompletions: true }, compilerOptions.target); if (!completionData) { return { type: "none" }; } - var symbols = completionData.symbols, location = completionData.location, allowStringLiteral = completionData.allowStringLiteral, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, request = completionData.request; - if (request) { - return { type: "request", request: request }; + if (completionData.kind !== 0 /* Data */) { + return { type: "request", request: completionData }; } + var symbols = completionData.symbols, location = completionData.location, completionKind = completionData.completionKind, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, previousToken = completionData.previousToken, isJsxInitializer = completionData.isJsxInitializer; // Find the symbol with the matching entry name. // We don't need to perform character checks here because we're only comparing the // name against 'entryName' (which is known to be good), not building a new // completion entry. - var symbol = ts.find(symbols, function (s) { - var origin = symbolToOriginInfoMap[ts.getSymbolId(s)]; - return getCompletionEntryDisplayNameForSymbol(s, compilerOptions.target, /*performCharacterChecks*/ false, allowStringLiteral, origin) === name - && getSourceFromOrigin(origin) === source; - }); - return symbol ? { type: "symbol", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap } : { type: "none" }; + return ts.firstDefined(symbols, function (symbol) { + var origin = symbolToOriginInfoMap[ts.getSymbolId(symbol)]; + var info = getCompletionEntryDisplayNameForSymbol(symbol, compilerOptions.target, origin, completionKind); + return info && info.name === name && getSourceFromOrigin(origin) === source ? { type: "symbol", symbol: symbol, location: location, symbolToOriginInfoMap: symbolToOriginInfoMap, previousToken: previousToken, isJsxInitializer: isJsxInitializer } : undefined; + }) || { type: "none" }; } function getSymbolName(symbol, origin, target) { - return origin && origin.isDefaultExport && symbol.name === "default" ? ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) : symbol.name; + return origin && origin.type === "export" && origin.isDefaultExport && symbol.escapedName === "default" /* Default */ + // Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase. + ? ts.firstDefined(symbol.declarations, function (d) { return ts.isExportAssignment(d) && ts.isIdentifier(d.expression) ? d.expression.text : undefined; }) + || ts.codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) + : symbol.name; } - function getCompletionEntryDetails(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles, host, formatContext, getCanonicalFileName) { + function getCompletionEntryDetails(program, log, compilerOptions, sourceFile, position, entryId, allSourceFiles, host, formatContext, getCanonicalFileName) { + var typeChecker = program.getTypeChecker(); var name = entryId.name; // Compute all the completion symbols again. var symbolCompletion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); @@ -80292,26 +83780,26 @@ var ts; case "request": { var request = symbolCompletion.request; switch (request.kind) { - case "JsDocTagName": + case 1 /* JsDocTagName */: return ts.JsDoc.getJSDocTagNameCompletionDetails(name); - case "JsDocTag": + case 2 /* JsDocTag */: return ts.JsDoc.getJSDocTagCompletionDetails(name); - case "JsDocParameterName": + case 3 /* JsDocParameterName */: return ts.JsDoc.getJSDocParameterNameCompletionDetails(name); default: return ts.Debug.assertNever(request); } } case "symbol": { - var symbol = symbolCompletion.symbol, location = symbolCompletion.location, symbolToOriginInfoMap = symbolCompletion.symbolToOriginInfoMap; - var _a = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, typeChecker, host, compilerOptions, sourceFile, formatContext, getCanonicalFileName, allSourceFiles), codeActions = _a.codeActions, sourceDisplay = _a.sourceDisplay; + var symbol = symbolCompletion.symbol, location = symbolCompletion.location, symbolToOriginInfoMap = symbolCompletion.symbolToOriginInfoMap, previousToken = symbolCompletion.previousToken; + var _a = getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, typeChecker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles), codeActions = _a.codeActions, sourceDisplay = _a.sourceDisplay; var kindModifiers = ts.SymbolDisplay.getSymbolModifiers(symbol); var _b = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, location, location, 7 /* All */), displayParts = _b.displayParts, documentation = _b.documentation, symbolKind = _b.symbolKind, tags = _b.tags; return { name: name, kindModifiers: kindModifiers, kind: symbolKind, displayParts: displayParts, documentation: documentation, tags: tags, codeActions: codeActions, source: sourceDisplay }; } case "none": { // Didn't find a symbol with this name. See if we can find a keyword instead. - if (ts.some(getKeywordCompletions(0 /* None */), function (c) { return c.name === name; })) { + if (allKeywordsCompletions().some(function (c) { return c.name === name; })) { return { name: name, kind: "keyword" /* keyword */, @@ -80328,66 +83816,111 @@ var ts; } } Completions.getCompletionEntryDetails = getCompletionEntryDetails; - function getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, checker, host, compilerOptions, sourceFile, formatContext, getCanonicalFileName, allSourceFiles) { + function getCompletionEntryCodeActionsAndSourceDisplay(symbolToOriginInfoMap, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { var symbolOriginInfo = symbolToOriginInfoMap[ts.getSymbolId(symbol)]; - if (!symbolOriginInfo) { - return { codeActions: undefined, sourceDisplay: undefined }; - } - var moduleSymbol = symbolOriginInfo.moduleSymbol, isDefaultExport = symbolOriginInfo.isDefaultExport; - var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); - var moduleSymbols = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); - ts.Debug.assert(ts.contains(moduleSymbols, moduleSymbol)); - var sourceDisplay = [ts.textPart(ts.first(ts.codefix.getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, compilerOptions, getCanonicalFileName, host)))]; - var codeActions = ts.codefix.getCodeActionForImport(moduleSymbols, { - host: host, - checker: checker, - newLineCharacter: host.getNewLine(), - compilerOptions: compilerOptions, - sourceFile: sourceFile, - formatContext: formatContext, - symbolName: getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), - getCanonicalFileName: getCanonicalFileName, - symbolToken: undefined, - kind: isDefaultExport ? 1 /* Default */ : 0 /* Named */, - }); - return { sourceDisplay: sourceDisplay, codeActions: codeActions }; + return symbolOriginInfo && symbolOriginInfo.type === "export" + ? getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) + : { codeActions: undefined, sourceDisplay: undefined }; } - function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { - var result = []; - ts.codefix.forEachExternalModule(checker, allSourceFiles, function (module) { - for (var _i = 0, _a = checker.getExportsOfModule(module); _i < _a.length; _i++) { - var exported = _a[_i]; - if (ts.skipAlias(exported, checker) === exportedSymbol) { - result.push(module); - } - } - }); - return result; + function getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { + var moduleSymbol = symbolOriginInfo.moduleSymbol; + var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); + var _a = ts.codefix.getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, previousToken), moduleSpecifier = _a.moduleSpecifier, codeAction = _a.codeAction; + return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] }; } function getCompletionEntrySymbol(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles) { var completion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); return completion.type === "symbol" ? completion.symbol : undefined; } Completions.getCompletionEntrySymbol = getCompletionEntrySymbol; - function getRecommendedCompletion(currentToken, checker /*, symbolToOriginInfoMap: SymbolOriginInfoMap*/) { - var ty = checker.getContextualType(currentToken); + var CompletionDataKind; + (function (CompletionDataKind) { + CompletionDataKind[CompletionDataKind["Data"] = 0] = "Data"; + CompletionDataKind[CompletionDataKind["JsDocTagName"] = 1] = "JsDocTagName"; + CompletionDataKind[CompletionDataKind["JsDocTag"] = 2] = "JsDocTag"; + CompletionDataKind[CompletionDataKind["JsDocParameterName"] = 3] = "JsDocParameterName"; + })(CompletionDataKind || (CompletionDataKind = {})); + var CompletionKind; + (function (CompletionKind) { + CompletionKind[CompletionKind["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; + /** Note that sometimes we access completions from global scope, but use "None" instead of this. See isGlobalCompletionScope. */ + CompletionKind[CompletionKind["Global"] = 1] = "Global"; + CompletionKind[CompletionKind["PropertyAccess"] = 2] = "PropertyAccess"; + CompletionKind[CompletionKind["MemberLike"] = 3] = "MemberLike"; + CompletionKind[CompletionKind["String"] = 4] = "String"; + CompletionKind[CompletionKind["None"] = 5] = "None"; + })(CompletionKind || (CompletionKind = {})); + function getRecommendedCompletion(currentToken, position, sourceFile, checker) { + var ty = getContextualType(currentToken, position, sourceFile, checker); var symbol = ty && ty.symbol; // Don't include make a recommended completion for an abstract class return symbol && (symbol.flags & 384 /* Enum */ || symbol.flags & 32 /* Class */ && !ts.isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, currentToken, checker) : undefined; } + function getContextualType(currentToken, position, sourceFile, checker) { + var parent = currentToken.parent; + switch (currentToken.kind) { + case 71 /* Identifier */: + return getContextualTypeFromParent(currentToken, checker); + case 58 /* EqualsToken */: + switch (parent.kind) { + case 230 /* VariableDeclaration */: + return checker.getContextualType(parent.initializer); + case 198 /* BinaryExpression */: + return checker.getTypeAtLocation(parent.left); + case 260 /* JsxAttribute */: + return checker.getContextualTypeForJsxAttribute(parent); + default: + return undefined; + } + case 94 /* NewKeyword */: + return checker.getContextualType(parent); + case 73 /* CaseKeyword */: + return getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); + case 17 /* OpenBraceToken */: + return ts.isJsxExpression(parent) && parent.parent.kind !== 253 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; + default: + var argInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(currentToken, position, sourceFile); + return argInfo + // At `,`, treat this as the next argument after the comma. + ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (currentToken.kind === 26 /* CommaToken */ ? 1 : 0)) + : isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) + // completion at `x ===/**/` should be for the right side + ? checker.getTypeAtLocation(parent.left) + : checker.getContextualType(currentToken); + } + } + function getContextualTypeFromParent(node, checker) { + var parent = node.parent; + switch (parent.kind) { + case 186 /* NewExpression */: + return checker.getContextualType(parent); + case 198 /* BinaryExpression */: { + var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return isEqualityOperatorKind(operatorToken.kind) + ? checker.getTypeAtLocation(node === right ? left : right) + : checker.getContextualType(node); + } + case 264 /* CaseClause */: + return parent.expression === node ? getSwitchedType(parent, checker) : undefined; + default: + return checker.getContextualType(node); + } + } + function getSwitchedType(caseClause, checker) { + return checker.getTypeAtLocation(caseClause.parent.parent.expression); + } function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) { var chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ 67108863 /* All */, /*useOnlyExternalAliasing*/ false); if (chain) return ts.first(chain); - return isModuleSymbol(symbol.parent) ? symbol : symbol.parent && getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 269 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 272 /* SourceFile */; }); } function getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, options, target) { - var request; var start = ts.timestamp(); var currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); // TODO: GH#15853 // We will check for jsdoc comments with insideComment and getJsDocTagAtPosition. (TODO: that seems rather inefficient to check the same thing so many times.) @@ -80402,7 +83935,7 @@ var ts; if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { // The current position is next to the '@' sign, when no tag name being provided yet. // Provide a full list of tag names - request = { kind: "JsDocTagName" }; + return { kind: 1 /* JsDocTagName */ }; } else { // When completion is requested without "@", we will have check to make sure that @@ -80423,7 +83956,7 @@ var ts; // */ var lineStart = ts.getLineStartPositionForPosition(position, sourceFile); if (!(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/))) { - request = { kind: "JsDocTag" }; + return { kind: 2 /* JsDocTag */ }; } } } @@ -80433,37 +83966,22 @@ var ts; var tag = getJsDocTagAtPosition(currentToken, position); if (tag) { if (tag.tagName.pos <= position && position <= tag.tagName.end) { - request = { kind: "JsDocTagName" }; + return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 271 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 274 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ true); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 289 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 292 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); } } if (ts.isJSDocParameterTag(tag) && (ts.nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) { - request = { kind: "JsDocParameterName", tag: tag }; + return { kind: 3 /* JsDocParameterName */, tag: tag }; } } - if (request) { - return { - symbols: ts.emptyArray, - isGlobalCompletion: false, - isMemberCompletion: false, - allowStringLiteral: false, - isNewIdentifierLocation: false, - location: undefined, - isRightOfDot: false, - request: request, - keywordFilters: 0 /* None */, - symbolToOriginInfoMap: undefined, - recommendedCompletion: undefined, - }; - } if (!insideJsDocTagTypeExpression) { // Proceed if the current position is in jsDoc tag expression; otherwise it is a normal // comment or the plain text part of a jsDoc comment, so no completion should be available @@ -80488,9 +84006,11 @@ var ts; // Also determine whether we are trying to complete with members of that node // or attributes of a JSX tag. var node = currentToken; + var propertyAccessToConvert; var isRightOfDot = false; var isRightOfOpenTag = false; var isStartingCloseTag = false; + var isJsxInitializer = false; var location = ts.getTouchingPropertyName(sourceFile, position, insideJsDocTagTypeExpression); // TODO: GH#15853 if (contextToken) { // Bail out if this is a known invalid completion location @@ -80500,57 +84020,82 @@ var ts; } var parent = contextToken.parent; if (contextToken.kind === 23 /* DotToken */) { - if (parent.kind === 180 /* PropertyAccessExpression */) { - node = contextToken.parent.expression; - isRightOfDot = true; - } - else if (parent.kind === 144 /* QualifiedName */) { - node = contextToken.parent.left; - isRightOfDot = true; - } - else { - // There is nothing that precedes the dot, so this likely just a stray character - // or leading into a '...' token. Just bail out instead. - return undefined; + isRightOfDot = true; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + propertyAccessToConvert = parent; + node = propertyAccessToConvert.expression; + break; + case 145 /* QualifiedName */: + node = parent.left; + break; + default: + // There is nothing that precedes the dot, so this likely just a stray character + // or leading into a '...' token. Just bail out instead. + return undefined; } } else if (sourceFile.languageVariant === 1 /* JSX */) { // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 180 /* PropertyAccessExpression */) { + if (parent && parent.kind === 183 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } + // Fix location + if (currentToken.parent === location) { + switch (currentToken.kind) { + case 29 /* GreaterThanToken */: + if (currentToken.parent.kind === 253 /* JsxElement */ || currentToken.parent.kind === 255 /* JsxOpeningElement */) { + location = currentToken; + } + break; + case 41 /* SlashToken */: + if (currentToken.parent.kind === 254 /* JsxSelfClosingElement */) { + location = currentToken; + } + break; + } + } switch (parent.kind) { - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (contextToken.kind === 41 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (!(parent.left.flags & 32768 /* ThisNodeHasError */)) { // It has a left-hand side, so we're not in an opening JSX tag. break; } // falls through - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: + case 255 /* JsxOpeningElement */: if (contextToken.kind === 27 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; + case 260 /* JsxAttribute */: + switch (previousToken.kind) { + case 58 /* EqualsToken */: + isJsxInitializer = true; + break; + case 71 /* Identifier */: + if (previousToken !== parent.name) { + isJsxInitializer = previousToken; + } + } + break; } } } var semanticStart = ts.timestamp(); - var isGlobalCompletion = false; - var isMemberCompletion; - var allowStringLiteral = false; - var isNewIdentifierLocation; + var completionKind = 5 /* None */; + var isNewIdentifierLocation = false; var keywordFilters = 0 /* None */; var symbols = []; var symbolToOriginInfoMap = []; @@ -80558,24 +84103,22 @@ var ts; getTypeScriptMemberSymbols(); } else if (isRightOfOpenTag) { - var tagSymbols = typeChecker.getJsxIntrinsicTagNames(); + var tagSymbols = ts.Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNames(), "getJsxIntrinsicTagNames() should all be defined"); if (tryGetGlobalSymbols()) { symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & (107455 /* Value */ | 2097152 /* Alias */)); })); } else { symbols = tagSymbols; } - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 3 /* MemberLike */; } else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; var tagSymbol = typeChecker.getSymbolAtLocation(tagName); - if (!typeChecker.isUnknownSymbol(tagSymbol)) { + if (tagSymbol) { symbols = [tagSymbol]; } - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 3 /* MemberLike */; } else { // For JavaScript or TypeScript, if we're not after a dot, then just try to get the @@ -80586,23 +84129,21 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - var recommendedCompletion = getRecommendedCompletion(previousToken, typeChecker); - return { symbols: symbols, isGlobalCompletion: isGlobalCompletion, isMemberCompletion: isMemberCompletion, allowStringLiteral: allowStringLiteral, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request: request, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion }; + var recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, position, sourceFile, typeChecker); + return { kind: 0 /* Data */, symbols: symbols, completionKind: completionKind, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: - case 285 /* JSDocReturnTag */: - case 286 /* JSDocTypeTag */: - case 288 /* JSDocTypedefTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: + case 288 /* JSDocReturnTag */: + case 289 /* JSDocTypeTag */: + case 291 /* JSDocTypedefTag */: return true; } } function getTypeScriptMemberSymbols() { // Right of dot member completion list - isGlobalCompletion = false; - isMemberCompletion = true; - isNewIdentifierLocation = false; + completionKind = 2 /* PropertyAccess */; // Since this is qualified name check its a type node location var isTypeLocation = insideJsDocTagTypeExpression || ts.isPartOfTypeNode(node.parent); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); @@ -80612,7 +84153,7 @@ var ts; symbol = ts.skipAlias(symbol, typeChecker); if (symbol.flags & (1536 /* Module */ | 384 /* Enum */)) { // Extract module or enum members - var exportedSymbols = typeChecker.getExportsOfModule(symbol); + var exportedSymbols = ts.Debug.assertEachDefined(typeChecker.getExportsOfModule(symbol), "getExportsOfModule() should all be defined"); var isValidValueAccess_1 = function (symbol) { return typeChecker.isValidPropertyAccess((node.parent), symbol.name); }; var isValidTypeAccess_1 = function (symbol) { return symbolCanBeReferencedAtTypeLocation(symbol); }; var isValidAccess = isRhsOfImportDeclaration ? @@ -80626,7 +84167,7 @@ var ts; } } // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). - if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 269 /* SourceFile */ && d.kind !== 234 /* ModuleDeclaration */ && d.kind !== 233 /* EnumDeclaration */; })) { + if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 272 /* SourceFile */ && d.kind !== 237 /* ModuleDeclaration */ && d.kind !== 236 /* EnumDeclaration */; })) { addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node)); } return; @@ -80647,10 +84188,9 @@ var ts; symbols.push.apply(symbols, getPropertiesForCompletion(type, typeChecker, /*isForAccess*/ true)); } else { - // Filter private properties for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { var symbol = _a[_i]; - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { + if (typeChecker.isValidPropertyAccessForCompletions((node.parent), type, symbol)) { symbols.push(symbol); } } @@ -80671,7 +84211,7 @@ var ts; } if (tryGetConstructorLikeCompletionContainer(contextToken)) { // no members, only keywords - isMemberCompletion = false; + completionKind = 5 /* None */; // Declaring new property/method/accessor isNewIdentifierLocation = true; // Has keywords for constructor parameter @@ -80685,19 +84225,22 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 251 /* JsxSelfClosingElement */) || (jsxContainer.kind === 252 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 254 /* JsxSelfClosingElement */) || (jsxContainer.kind === 255 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { symbols = filterJsxAttributes(typeChecker.getPropertiesOfType(attrsType), jsxContainer.attributes.properties); - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; isNewIdentifierLocation = false; return true; } } } + if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { + keywordFilters = 3 /* FunctionLikeBodyKeywords */; + } // Get all entities in the current scope. - isMemberCompletion = false; + completionKind = 5 /* None */; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); @@ -80731,40 +84274,55 @@ var ts; previousToken.getStart() : position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - if (scopeNode) { - isGlobalCompletion = - scopeNode.kind === 269 /* SourceFile */ || - scopeNode.kind === 197 /* TemplateExpression */ || - scopeNode.kind === 260 /* JsxExpression */ || - scopeNode.kind === 208 /* Block */ || // Some blocks aren't statements, but all get global completions - ts.isStatement(scopeNode); + if (isGlobalCompletionScope(scopeNode)) { + completionKind = 1 /* Global */; } var symbolMeanings = 793064 /* Type */ | 107455 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); + symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); + // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` + if (options.includeInsertTextCompletions && scopeNode.kind !== 272 /* SourceFile */) { + var thisType = typeChecker.tryGetThisTypeAt(scopeNode); + if (thisType) { + for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker, /*isForAccess*/ true); _i < _a.length; _i++) { + var symbol = _a[_i]; + symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { type: "this-type" }; + symbols.push(symbol); + } + } + } if (options.includeExternalModuleExports) { getSymbolsFromOtherSourceFileExports(symbols, previousToken && ts.isIdentifier(previousToken) ? previousToken.text : "", target); } filterGlobalCompletion(symbols); return true; } + function isGlobalCompletionScope(scopeNode) { + switch (scopeNode.kind) { + case 272 /* SourceFile */: + case 200 /* TemplateExpression */: + case 263 /* JsxExpression */: + case 211 /* Block */: + return true; + default: + return ts.isStatement(scopeNode); + } + } function filterGlobalCompletion(symbols) { + var isTypeCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + if (isTypeCompletion) + keywordFilters = 4 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { // export = /**/ here we want to get all meanings, so any symbol is ok if (ts.isExportAssignment(location.parent)) { return true; } - // This is an alias, follow what it aliases - if (symbol && symbol.flags & 2097152 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } + symbol = ts.skipAlias(symbol, typeChecker); // import m = /**/ <-- It can only access namespace (if typing import = x. this would get member symbols and not namespace) if (ts.isInRightSideOfInternalImportEqualsDeclaration(location)) { return !!(symbol.flags & 1920 /* Namespace */); } - if (insideJsDocTagTypeExpression || - (!isContextTokenValueLocation(contextToken) && - (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)))) { + if (isTypeCompletion) { // Its a type, but you can reach it by namespace.type as well return symbolCanBeReferencedAtTypeLocation(symbol); } @@ -80776,24 +84334,25 @@ var ts; function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 103 /* TypeOfKeyword */ && - contextToken.parent.kind === 163 /* TypeQuery */; + contextToken.parent.kind === 164 /* TypeQuery */; } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 56 /* ColonToken */: - return parentKind === 150 /* PropertyDeclaration */ || - parentKind === 149 /* PropertySignature */ || - parentKind === 147 /* Parameter */ || - parentKind === 227 /* VariableDeclaration */ || + return parentKind === 151 /* PropertyDeclaration */ || + parentKind === 150 /* PropertySignature */ || + parentKind === 148 /* Parameter */ || + parentKind === 230 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 58 /* EqualsToken */: - return parentKind === 232 /* TypeAliasDeclaration */; + return parentKind === 235 /* TypeAliasDeclaration */; case 118 /* AsKeyword */: - return parentKind === 203 /* AsExpression */; + return parentKind === 206 /* AsExpression */; } } + return false; } function symbolCanBeReferencedAtTypeLocation(symbol) { symbol = symbol.exportSymbol || symbol; @@ -80814,27 +84373,24 @@ var ts; ts.codefix.forEachExternalModuleToImportFrom(typeChecker, sourceFile, allSourceFiles, function (moduleSymbol) { for (var _i = 0, _a = typeChecker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { var symbol = _a[_i]; - var name = symbol.name; // Don't add a completion for a re-export, only for the original. - // If `symbol.parent !== moduleSymbol`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. + // The actual import fix might end up coming from a re-export -- we don't compute that until getting completion details. + // This is just to avoid adding duplicate completion entries. + // + // If `symbol.parent !== ...`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. // If `some(...)`, this comes from an `export { foo } from "foo"` re-export, which creates a new symbol (thus isn't caught by the first check). - if (symbol.parent !== moduleSymbol || ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier; })) { + if (typeChecker.getMergedSymbol(symbol.parent) !== typeChecker.resolveExternalModuleSymbol(moduleSymbol) + || ts.some(symbol.declarations, function (d) { return ts.isExportSpecifier(d) && !!d.parent.parent.moduleSpecifier; })) { continue; } - var isDefaultExport = name === "default"; + var isDefaultExport = symbol.name === "default" /* Default */; if (isDefaultExport) { - var localSymbol = ts.getLocalSymbolForExportDefault(symbol); - if (localSymbol) { - symbol = localSymbol; - name = localSymbol.name; - } - else { - name = ts.codefix.moduleSymbolToValidIdentifier(moduleSymbol, target); - } + symbol = ts.getLocalSymbolForExportDefault(symbol) || symbol; } - if (stringContainsCharactersInOrder(name.toLowerCase(), tokenTextLowerCase)) { + var origin = { type: "export", moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport }; + if (stringContainsCharactersInOrder(getSymbolName(symbol, origin, target).toLowerCase(), tokenTextLowerCase)) { symbols.push(symbol); - symbolToOriginInfoMap[ts.getSymbolId(symbol)] = { moduleSymbol: moduleSymbol, isDefaultExport: isDefaultExport }; + symbolToOriginInfoMap[ts.getSymbolId(symbol)] = origin; } } }); @@ -80885,11 +84441,11 @@ var ts; return true; } if (contextToken.kind === 29 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 252 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 255 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 253 /* JsxClosingElement */ || contextToken.parent.kind === 251 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 250 /* JsxElement */; + if (contextToken.parent.kind === 256 /* JsxClosingElement */ || contextToken.parent.kind === 254 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 253 /* JsxElement */; } } return false; @@ -80899,40 +84455,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 182 /* CallExpression */ // func( a, | - || containingNodeKind === 153 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 183 /* NewExpression */ // new C(a, | - || containingNodeKind === 178 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 195 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 161 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 185 /* CallExpression */ // func( a, | + || containingNodeKind === 154 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 186 /* NewExpression */ // new C(a, | + || containingNodeKind === 181 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 198 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 162 /* FunctionType */; // var x: (s: string, list| case 19 /* OpenParenToken */: - return containingNodeKind === 182 /* CallExpression */ // func( | - || containingNodeKind === 153 /* Constructor */ // constructor( | - || containingNodeKind === 183 /* NewExpression */ // new C(a| - || containingNodeKind === 186 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 169 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 185 /* CallExpression */ // func( | + || containingNodeKind === 154 /* Constructor */ // constructor( | + || containingNodeKind === 186 /* NewExpression */ // new C(a| + || containingNodeKind === 189 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 172 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 21 /* OpenBracketToken */: - return containingNodeKind === 178 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 158 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 145 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 128 /* ModuleKeyword */: // module | - case 129 /* NamespaceKeyword */:// namespace | + return containingNodeKind === 181 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 159 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 146 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 129 /* ModuleKeyword */: // module | + case 130 /* NamespaceKeyword */:// namespace | return true; case 23 /* DotToken */: - return containingNodeKind === 234 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 237 /* ModuleDeclaration */; // module A.| case 17 /* OpenBraceToken */: - return containingNodeKind === 230 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 233 /* ClassDeclaration */; // class A{ | case 58 /* EqualsToken */: - return containingNodeKind === 227 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 195 /* BinaryExpression */; // x = a| + return containingNodeKind === 230 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 198 /* BinaryExpression */; // x = a| case 14 /* TemplateHead */: - return containingNodeKind === 197 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 200 /* TemplateExpression */; // `aa ${| case 15 /* TemplateMiddle */: - return containingNodeKind === 206 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 209 /* TemplateSpan */; // `aa ${10} dd ${| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 151 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -80972,11 +84528,10 @@ var ts; */ function tryGetObjectLikeCompletionSymbols(objectLikeContainer) { // We're looking up possible property names from contextual/inferred/declared type. - isMemberCompletion = true; - allowStringLiteral = true; + completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 179 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 182 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -80987,7 +84542,7 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 175 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 178 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); @@ -80998,12 +84553,12 @@ var ts; // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = rootDeclaration.initializer || rootDeclaration.type || rootDeclaration.parent.parent.kind === 217 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 147 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 220 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 148 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 152 /* MethodDeclaration */ || rootDeclaration.parent.kind === 155 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 153 /* MethodDeclaration */ || rootDeclaration.parent.kind === 156 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -81018,7 +84573,7 @@ var ts; } if (typeMembers && typeMembers.length > 0) { // Add filtered items to the completion list - symbols = filterObjectMembersList(typeMembers, existingMembers); + symbols = filterObjectMembersList(typeMembers, ts.Debug.assertDefined(existingMembers)); } return true; } @@ -81038,15 +84593,15 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 242 /* NamedImports */ ? - 239 /* ImportDeclaration */ : - 245 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 245 /* NamedImports */ ? + 242 /* ImportDeclaration */ : + 248 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { return false; } - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; isNewIdentifierLocation = false; var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier); if (!moduleSpecifierSymbol) { @@ -81063,7 +84618,7 @@ var ts; */ function getGetClassLikeCompletionSymbols(classLikeDeclaration) { // We're looking up possible property names from parent type. - isMemberCompletion = true; + completionKind = 3 /* MemberLike */; // Declaring new property/method/accessor isNewIdentifierLocation = true; // Has keywords for class elements @@ -81132,8 +84687,8 @@ var ts; case 17 /* OpenBraceToken */: // import { | case 26 /* CommaToken */:// import { a as 0, | switch (contextToken.parent.kind) { - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return contextToken.parent; } } @@ -81191,7 +84746,7 @@ var ts; } } // class c { method() { } | method2() { } } - if (location && location.kind === 290 /* SyntaxList */ && ts.isClassLike(location.parent)) { + if (location && location.kind === 293 /* SyntaxList */ && ts.isClassLike(location.parent)) { return location.parent; } return undefined; @@ -81214,6 +84769,21 @@ var ts; } return undefined; } + function tryGetFunctionLikeBodyCompletionContainer(contextToken) { + if (contextToken) { + var prev_1; + var container = ts.findAncestor(contextToken.parent, function (node) { + if (ts.isClassLike(node)) { + return "quit"; + } + if (ts.isFunctionLikeDeclaration(node) && prev_1 === node.body) { + return true; + } + prev_1 = node; + }); + return container && container; + } + } function tryGetContainingJsxElement(contextToken) { if (contextToken) { var parent = contextToken.parent; @@ -81221,14 +84791,14 @@ var ts; case 28 /* LessThanSlashToken */: case 41 /* SlashToken */: case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 258 /* JsxAttributes */: - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 251 /* JsxSelfClosingElement */ || parent.kind === 252 /* JsxOpeningElement */)) { + case 183 /* PropertyAccessExpression */: + case 261 /* JsxAttributes */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 254 /* JsxSelfClosingElement */ || parent.kind === 255 /* JsxOpeningElement */)) { return parent; } - else if (parent.kind === 257 /* JsxAttribute */) { + else if (parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81240,7 +84810,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent && ((parent.kind === 257 /* JsxAttribute */) || (parent.kind === 259 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 260 /* JsxAttribute */) || (parent.kind === 262 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81250,8 +84820,8 @@ var ts; break; case 18 /* CloseBraceToken */: if (parent && - parent.kind === 260 /* JsxExpression */ && - parent.parent && parent.parent.kind === 257 /* JsxAttribute */) { + parent.kind === 263 /* JsxExpression */ && + parent.parent && parent.parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81259,7 +84829,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 259 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 262 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -81278,59 +84848,59 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 227 /* VariableDeclaration */ || - containingNodeKind === 228 /* VariableDeclarationList */ || - containingNodeKind === 209 /* VariableStatement */ || - containingNodeKind === 233 /* EnumDeclaration */ || // enum a { foo, | + return containingNodeKind === 230 /* VariableDeclaration */ || + containingNodeKind === 231 /* VariableDeclarationList */ || + containingNodeKind === 212 /* VariableStatement */ || + containingNodeKind === 236 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 23 /* DotToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [.| case 56 /* ColonToken */: - return containingNodeKind === 177 /* BindingElement */; // var {x :html| + return containingNodeKind === 180 /* BindingElement */; // var {x :html| case 21 /* OpenBracketToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [x| case 19 /* OpenParenToken */: - return containingNodeKind === 264 /* CatchClause */ || + return containingNodeKind === 267 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 17 /* OpenBraceToken */: - return containingNodeKind === 233 /* EnumDeclaration */ || // enum a { | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface a { | - containingNodeKind === 164 /* TypeLiteral */; // const x : { | + return containingNodeKind === 236 /* EnumDeclaration */ || // enum a { | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface a { | + containingNodeKind === 165 /* TypeLiteral */; // const x : { | case 25 /* SemicolonToken */: - return containingNodeKind === 149 /* PropertySignature */ && + return containingNodeKind === 150 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 231 /* InterfaceDeclaration */ || // interface a { f; | - contextToken.parent.parent.kind === 164 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 234 /* InterfaceDeclaration */ || // interface a { f; | + contextToken.parent.parent.kind === 165 /* TypeLiteral */); // const x : { a; | case 27 /* LessThanToken */: - return containingNodeKind === 230 /* ClassDeclaration */ || // class A< | - containingNodeKind === 200 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 232 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 233 /* ClassDeclaration */ || // class A< | + containingNodeKind === 203 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 235 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 115 /* StaticKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); + return containingNodeKind === 151 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); case 24 /* DotDotDotToken */: - return containingNodeKind === 147 /* Parameter */ || + return containingNodeKind === 148 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 176 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 179 /* ArrayBindingPattern */); // var [...z| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 147 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); + return containingNodeKind === 148 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); case 118 /* AsKeyword */: - return containingNodeKind === 243 /* ImportSpecifier */ || - containingNodeKind === 247 /* ExportSpecifier */ || - containingNodeKind === 241 /* NamespaceImport */; + return containingNodeKind === 246 /* ImportSpecifier */ || + containingNodeKind === 250 /* ExportSpecifier */ || + containingNodeKind === 244 /* NamespaceImport */; case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: if (isFromClassElementDeclaration(contextToken)) { return false; } @@ -81344,7 +84914,7 @@ var ts; case 110 /* LetKeyword */: case 76 /* ConstKeyword */: case 116 /* YieldKeyword */: - case 138 /* TypeKeyword */:// type htm| + case 139 /* TypeKeyword */:// type htm| return true; } // If the previous token is keyword correspoding to class member completion keyword @@ -81383,10 +84953,14 @@ var ts; case "yield": return true; } - return ts.isDeclarationName(contextToken) && !ts.isJsxAttribute(contextToken.parent); + return ts.isDeclarationName(contextToken) + && !ts.isJsxAttribute(contextToken.parent) + // Don't block completions if we're in `class C /**/`, because we're *past* the end of the identifier and might want to complete `extends`. + // If `contextToken !== previousToken`, this is `class C ex/**/`. + && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 153 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 154 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -81415,10 +84989,7 @@ var ts; var name = element.propertyName || element.name; existingImportsOrExports.set(name.escapedText, true); } - if (existingImportsOrExports.size === 0) { - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default"; }); - } - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" && !existingImportsOrExports.get(e.escapedName); }); + return exportsOfModule.filter(function (e) { return e.escapedName !== "default" /* Default */ && !existingImportsOrExports.get(e.escapedName); }); } /** * Filters out completion suggestions for named imports or exports. @@ -81427,19 +84998,19 @@ var ts; * do not occur at the current position and have not otherwise been typed. */ function filterObjectMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { + if (existingMembers.length === 0) { return contextualMemberSymbols; } var existingMemberNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 265 /* PropertyAssignment */ && - m.kind !== 266 /* ShorthandPropertyAssignment */ && - m.kind !== 177 /* BindingElement */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 268 /* PropertyAssignment */ && + m.kind !== 269 /* ShorthandPropertyAssignment */ && + m.kind !== 180 /* BindingElement */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -81447,7 +85018,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 177 /* BindingElement */ && m.propertyName) { + if (m.kind === 180 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 71 /* Identifier */) { existingName = m.propertyName.escapedText; @@ -81462,7 +85033,7 @@ var ts; } existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.escapedName); }); + return contextualMemberSymbols.filter(function (m) { return !existingMemberNames.get(m.escapedName); }); } /** * Filters out completion suggestions for class elements. @@ -81474,10 +85045,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 150 /* PropertyDeclaration */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 151 /* PropertyDeclaration */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -81532,98 +85103,79 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 257 /* JsxAttribute */) { + if (attr.kind === 260 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } } - return ts.filter(symbols, function (a) { return !seenNames.get(a.escapedName); }); + return symbols.filter(function (a) { return !seenNames.get(a.escapedName); }); } function isCurrentlyEditingNode(node) { return node.getStart() <= position && position <= node.getEnd(); } } - /** - * Get the name to be display in completion from a given symbol. - * - * @return undefined if the name is of external module - */ - function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks, allowStringLiteral, origin) { + function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind) { var name = getSymbolName(symbol, origin, target); - if (!name) + if (name === undefined + // If the symbol is external module, don't show it in the completion list + // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) + || symbol.flags & 1536 /* Module */ && ts.startsWithQuote(name) + // If the symbol is the internal name of an ES symbol, it is not a valid entry. Internal names for ES symbols start with "__@" + || ts.isKnownSymbol(symbol)) { return undefined; - // First check of the displayName is not external module; if it is an external module, it is not valid entry - if (symbol.flags & 1920 /* Namespace */) { - var firstCharCode = name.charCodeAt(0); - if (ts.isSingleOrDoubleQuote(firstCharCode)) { - // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { const x; } | // <= request completion here, "http" should not be there) + } + var validIdentiferResult = { name: name, needsConvertPropertyAccess: false }; + if (ts.isIdentifierText(name, target)) + return validIdentiferResult; + switch (kind) { + case 3 /* MemberLike */: return undefined; - } + case 0 /* ObjectPropertyDeclaration */: + // TODO: GH#18169 + return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; + case 2 /* PropertyAccess */: + case 5 /* None */: + case 1 /* Global */: + // Don't add a completion for a name starting with a space. See https://github.com/Microsoft/TypeScript/pull/20547 + return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; + case 4 /* String */: + return validIdentiferResult; + default: + ts.Debug.assertNever(kind); } - // If the symbol is for a member of an object type and is the internal name of an ES - // symbol, it is not a valid entry. Internal names for ES symbols start with "__@" - if (symbol.flags & 106500 /* ClassMember */) { - var escapedName = symbol.escapedName; - if (escapedName.length >= 3 && - escapedName.charCodeAt(0) === 95 /* _ */ && - escapedName.charCodeAt(1) === 95 /* _ */ && - escapedName.charCodeAt(2) === 64 /* at */) { - return undefined; - } - } - return getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral); - } - /** - * Get a displayName from a given for completion list, performing any necessary quotes stripping - * and checking whether the name is valid identifier name. - */ - function getCompletionEntryDisplayName(name, target, performCharacterChecks, allowStringLiteral) { - // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an - // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. - // e.g "b a" is valid quoted name but when we strip off the quotes, it is invalid. - // We, thus, need to check if whatever was inside the quotes is actually a valid identifier name. - if (performCharacterChecks && !ts.isIdentifierText(name, target)) { - // TODO: GH#18169 - return allowStringLiteral ? JSON.stringify(name) : undefined; - } - return name; } // A cache of completion entries for keywords, these do not change between sessions var _keywordCompletions = []; - function getKeywordCompletions(keywordFilter) { - var completions = _keywordCompletions[keywordFilter]; - if (completions) { - return completions; + var allKeywordsCompletions = ts.memoize(function () { + var res = []; + for (var i = 72 /* FirstKeyword */; i <= 144 /* LastKeyword */; i++) { + res.push({ + name: ts.tokenToString(i), + kind: "keyword" /* keyword */, + kindModifiers: "" /* none */, + sortText: "0" + }); } - return _keywordCompletions[keywordFilter] = generateKeywordCompletions(keywordFilter); - function generateKeywordCompletions(keywordFilter) { + return res; + }); + function getKeywordCompletions(keywordFilter) { + return _keywordCompletions[keywordFilter] || (_keywordCompletions[keywordFilter] = allKeywordsCompletions().filter(function (entry) { + var kind = ts.stringToToken(entry.name); switch (keywordFilter) { case 0 /* None */: - return getAllKeywordCompletions(); + // "undefined" is a global variable, so don't need a keyword completion for it. + return kind !== 140 /* UndefinedKeyword */; case 1 /* ClassElementKeywords */: - return getFilteredKeywordCompletions(isClassMemberCompletionKeywordText); + return isClassMemberCompletionKeyword(kind); case 2 /* ConstructorParameterKeywords */: - return getFilteredKeywordCompletions(isConstructorParameterCompletionKeywordText); + return isConstructorParameterCompletionKeyword(kind); + case 3 /* FunctionLikeBodyKeywords */: + return isFunctionLikeBodyCompletionKeyword(kind); + case 4 /* TypeKeywords */: + return ts.isTypeKeyword(kind); + default: + return ts.Debug.assertNever(keywordFilter); } - } - function getAllKeywordCompletions() { - var allKeywordsCompletions = []; - for (var i = 72 /* FirstKeyword */; i <= 143 /* LastKeyword */; i++) { - // "undefined" is a global variable, so don't need a keyword completion for it. - if (i === 139 /* UndefinedKeyword */) - continue; - allKeywordsCompletions.push({ - name: ts.tokenToString(i), - kind: "keyword" /* keyword */, - kindModifiers: "" /* none */, - sortText: "0" - }); - } - return allKeywordsCompletions; - } - function getFilteredKeywordCompletions(filterFn) { - return ts.filter(getKeywordCompletions(0 /* None */), function (entry) { return filterFn(entry.name); }); - } + })); } function isClassMemberCompletionKeyword(kind) { switch (kind) { @@ -81633,9 +85185,9 @@ var ts; case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: case 123 /* ConstructorKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 120 /* AsyncKeyword */: return true; } @@ -81648,21 +85200,39 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; } } function isConstructorParameterCompletionKeywordText(text) { return isConstructorParameterCompletionKeyword(ts.stringToToken(text)); } - function isEqualityExpression(node) { - return ts.isBinaryExpression(node) && isEqualityOperatorKind(node.operatorToken.kind); + function isFunctionLikeBodyCompletionKeyword(kind) { + switch (kind) { + case 114 /* PublicKeyword */: + case 112 /* PrivateKeyword */: + case 113 /* ProtectedKeyword */: + case 132 /* ReadonlyKeyword */: + case 123 /* ConstructorKeyword */: + case 115 /* StaticKeyword */: + case 117 /* AbstractKeyword */: + case 125 /* GetKeyword */: + case 136 /* SetKeyword */: + case 140 /* UndefinedKeyword */: + return false; + } + return true; } function isEqualityOperatorKind(kind) { - return kind === 32 /* EqualsEqualsToken */ || - kind === 33 /* ExclamationEqualsToken */ || - kind === 34 /* EqualsEqualsEqualsToken */ || - kind === 35 /* ExclamationEqualsEqualsToken */; + switch (kind) { + case 34 /* EqualsEqualsEqualsToken */: + case 32 /* EqualsEqualsToken */: + case 35 /* ExclamationEqualsEqualsToken */: + case 33 /* ExclamationEqualsToken */: + return true; + default: + return false; + } } /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */ function getJsDocTagAtPosition(node, position) { @@ -81696,19 +85266,18 @@ var ts; } /** * Gets all properties on a type, but if that type is a union of several types, - * tries to only include those types which declare properties, not methods. - * This ensures that we don't try providing completions for all the methods on e.g. Array. + * excludes array-like types or callable/constructable types. */ function getPropertiesForCompletion(type, checker, isForAccess) { if (!(type.flags & 131072 /* Union */)) { - return type.getApparentProperties(); + return ts.Debug.assertEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } var types = type.types; // If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals. var filteredTypes = isForAccess ? types : types.filter(function (memberType) { return !(memberType.flags & 16382 /* Primitive */ || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker)); }); - return checker.getAllPossiblePropertiesOfTypes(filteredTypes); + return ts.Debug.assertEachDefined(checker.getAllPossiblePropertiesOfTypes(filteredTypes), "getAllPossiblePropertiesOfTypes() should all be defined"); } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); @@ -81719,11 +85288,7 @@ var ts; (function (DocumentHighlights) { function getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch) { var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); - // Note that getTouchingWord indicates failure by returning the sourceFile node. - if (node === sourceFile) - return undefined; - ts.Debug.assert(node.parent !== undefined); - if (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent)) { + if (node.parent && (ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node || ts.isJsxClosingElement(node.parent))) { // For a JSX element, just highlight the matching tag, not all references. var _a = node.parent.parent, openingElement = _a.openingElement, closingElement = _a.closingElement; var highlightSpans = [openingElement, closingElement].map(function (_a) { @@ -81732,7 +85297,7 @@ var ts; }); return [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; } - return getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); + return getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) || getSyntacticDocumentHighlights(node, sourceFile); } DocumentHighlights.getDocumentHighlights = getDocumentHighlights; function getHighlightSpanForNode(node, sourceFile) { @@ -81742,8 +85307,8 @@ var ts; kind: "none" /* none */ }; } - function getSemanticDocumentHighlights(node, program, cancellationToken, sourceFilesToSearch) { - var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(node, program, sourceFilesToSearch, cancellationToken); + function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { + var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken); return referenceEntries && convertReferencedSymbols(referenceEntries); } function convertReferencedSymbols(referenceEntries) { @@ -81796,15 +85361,20 @@ var ts; case 81 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); case 123 /* ConstructorKeyword */: - return useParent(node.parent, ts.isConstructorDeclaration, getConstructorOccurrences); + return getFromAllDeclarations(ts.isConstructorDeclaration, [123 /* ConstructorKeyword */]); case 125 /* GetKeyword */: - case 135 /* SetKeyword */: - return useParent(node.parent, ts.isAccessor, getGetAndSetOccurrences); + case 136 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [125 /* GetKeyword */, 136 /* SetKeyword */]); default: return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : undefined; } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, function (decl) { return ts.mapDefined(decl.symbol.declarations, function (d) { + return nodeTest(d) ? ts.find(d.getChildren(sourceFile), function (c) { return ts.contains(keywords, c.kind); }) : undefined; + }); }); + } function useParent(node, nodeTest, getNodes) { return nodeTest(node) ? highlightSpans(getNodes(node, sourceFile)) : undefined; } @@ -81817,30 +85387,15 @@ var ts; * into function boundaries and try-blocks with catch-clauses. */ function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (ts.isThrowStatement(node)) { - statementAccumulator.push(node); - } - else if (ts.isTryStatement(node)) { - if (node.catchClause) { - aggregate(node.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(node.tryBlock); - } - if (node.finallyBlock) { - aggregate(node.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } + if (ts.isThrowStatement(node)) { + return [node]; } + else if (ts.isTryStatement(node)) { + // Exceptions thrown within a try block lacking a catch clause are "owned" in the current context. + return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), aggregateOwnedThrowStatements(node.finallyBlock)); + } + // Do not cross function boundaries. + return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements); } /** * For lack of a better name, this function takes a throw statement and returns the @@ -81851,33 +85406,30 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 269 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 272 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === 225 /* TryStatement */) { - var tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } + if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) { + return child; } child = parent; } return undefined; } function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */) { - statementAccumulator.push(node); + return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + var result = []; + node.forEachChild(function (child) { + var value = cb(child); + if (value !== undefined) { + result.push.apply(result, ts.toArray(value)); } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } + }); + return result; } function ownsBreakOrContinueStatement(owner, statement) { var actualOwner = getBreakOrContinueOwner(statement); @@ -81886,17 +85438,17 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 222 /* SwitchStatement */: - if (statement.kind === 218 /* ContinueStatement */) { + case 225 /* SwitchStatement */: + if (statement.kind === 221 /* ContinueStatement */) { return false; } // falls through - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - return !statement.label || isLabeledBy(node, statement.label.text); + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. // TODO: GH#20090 @@ -81905,10 +85457,6 @@ var ts; }); } function getModifierOccurrences(modifier, declaration) { - // Make sure we only highlight the keyword when it makes sense to do so. - if (!isLegalModifier(modifier, declaration)) { - return undefined; - } var modifierFlag = ts.modifierToFlag(modifier); return ts.mapDefined(getNodesToSearchForModifier(declaration, modifierFlag), function (node) { if (ts.getModifierFlags(node) & modifierFlag) { @@ -81919,24 +85467,28 @@ var ts; }); } function getNodesToSearchForModifier(declaration, modifierFlag) { + // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 208 /* Block */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 211 /* Block */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration - if (modifierFlag & 128 /* Abstract */) { + if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return declaration.members.concat([declaration]); } else { return container.statements; } - case 153 /* Constructor */: - return container.parameters.concat(container.parent.members); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: { + return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : [])); + } + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -81951,33 +85503,7 @@ var ts; } return nodes; default: - ts.Debug.fail("Invalid container kind."); - } - } - function isLegalModifier(modifier, declaration) { - var container = declaration.parent; - switch (modifier) { - case 112 /* PrivateKeyword */: - case 113 /* ProtectedKeyword */: - case 114 /* PublicKeyword */: - switch (container.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return true; - case 153 /* Constructor */: - return declaration.kind === 147 /* Parameter */; - default: - return false; - } - case 115 /* StaticKeyword */: - return container.kind === 230 /* ClassDeclaration */ || container.kind === 200 /* ClassExpression */; - case 84 /* ExportKeyword */: - case 124 /* DeclareKeyword */: - return container.kind === 235 /* ModuleBlock */ || container.kind === 269 /* SourceFile */; - case 117 /* AbstractKeyword */: - return container.kind === 230 /* ClassDeclaration */ || declaration.kind === 230 /* ClassDeclaration */; - default: - return false; + ts.Debug.assertNever(container, "Invalid container kind."); } } function pushKeywordIf(keywordList, token) { @@ -81991,33 +85517,11 @@ var ts; } return false; } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 154 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 155 /* SetAccessor */); - return keywords; - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 125 /* GetKeyword */, 135 /* SetKeyword */); }); - } - } - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 123 /* ConstructorKeyword */); - }); - }); - return keywords; - } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 88 /* ForKeyword */, 106 /* WhileKeyword */, 81 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 213 /* DoStatement */) { + if (loopNode.kind === 216 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 106 /* WhileKeyword */)) { @@ -82026,8 +85530,7 @@ var ts; } } } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */, 77 /* ContinueKeyword */); } @@ -82038,13 +85541,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -82056,8 +85559,7 @@ var ts; // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 73 /* CaseKeyword */, 79 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */); } @@ -82077,36 +85579,36 @@ var ts; } return keywords; } - function getThrowOccurrences(throwStatement) { + function getThrowOccurrences(throwStatement, sourceFile) { var owner = getThrowStatementOwner(throwStatement); if (!owner) { return undefined; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); // If the "owner" is a function, then we equate 'return' and 'throw' statements in their // ability to "jump out" of the function, and include occurrences for both. if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); } return keywords; } - function getReturnOccurrences(returnStatement) { + function getReturnOccurrences(returnStatement, sourceFile) { var func = ts.getContainingFunction(returnStatement); if (!func) { return undefined; } var keywords = []; ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); // Include 'throw' statements that do not occur within a try block. ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); return keywords; } @@ -82170,12 +85672,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 223 /* LabeledStatement */; owner = owner.parent) { - if (owner.label.escapedText === labelName) { - return true; - } - } - return false; + return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName; }); } })(DocumentHighlights = ts.DocumentHighlights || (ts.DocumentHighlights = {})); })(ts || (ts = {})); @@ -82352,10 +85849,10 @@ var ts; } cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 227 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 230 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 71 /* Identifier */) { directImports.push(name); @@ -82366,19 +85863,24 @@ var ts; addIndirectUser(direct.getSourceFile()); } break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name); } + else if (ts.isDefaultImport(direct)) { + var sourceFileLike = getSourceFileLikeForImportDeclaration(direct); + addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + directImports.push(direct); + } else { directImports.push(direct); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -82399,7 +85901,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 269 /* SourceFile */ || sourceFileLike.kind === 234 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 272 /* SourceFile */ || sourceFileLike.kind === 237 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -82454,7 +85956,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 238 /* ImportEqualsDeclaration */) { + if (decl.kind === 241 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -82468,7 +85970,7 @@ var ts; if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { return; } - if (decl.kind === 245 /* ExportDeclaration */) { + if (decl.kind === 248 /* ExportDeclaration */) { searchForNamedImport(decl.exportClause); return; } @@ -82477,7 +85979,7 @@ var ts; return; } var namedBindings = importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImportLike(namedBindings.name); return; } @@ -82529,7 +86031,7 @@ var ts; } } else { - var localSymbol = element.kind === 247 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 250 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -82538,14 +86040,14 @@ var ts; } function isNameMatch(name) { // Use name of "default" even in `export =` case because we may have allowSyntheticDefaultImports - return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === "default"; + return name === exportSymbol.escapedName || exportKind !== 0 /* Named */ && name === "default" /* Default */; } } /** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */ function findNamespaceReExports(sourceFileLike, name, checker) { var namespaceImportSymbol = checker.getSymbolAtLocation(name); return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { - if (statement.kind !== 245 /* ExportDeclaration */) + if (statement.kind !== 248 /* ExportDeclaration */) return; var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; if (moduleSpecifier || !exportClause) @@ -82564,7 +86066,7 @@ var ts; for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { var referencingFile = sourceFiles_4[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 269 /* SourceFile */) { + if (searchSourceFile.kind === 272 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -82611,7 +86113,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 269 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 272 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -82626,18 +86128,18 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: { + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { action(decl, decl.moduleSpecifier); } break; } - case 238 /* ImportEqualsDeclaration */: { + case 241 /* ImportEqualsDeclaration */: { var decl = statement; var moduleReference = decl.moduleReference; - if (moduleReference.kind === 249 /* ExternalModuleReference */ && + if (moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */) { action(decl, moduleReference.expression); } @@ -82650,11 +86152,11 @@ var ts; function importerFromModuleSpecifier(moduleSpecifier) { var decl = moduleSpecifier.parent; switch (decl.kind) { - case 182 /* CallExpression */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 185 /* CallExpression */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return decl; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return decl.parent; default: ts.Debug.fail("Unexpected module specifier parent: " + decl.kind); @@ -82672,7 +86174,7 @@ var ts; function getExport() { var parent = node.parent; if (symbol.exportSymbol) { - if (parent.kind === 180 /* PropertyAccessExpression */) { + if (parent.kind === 183 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(parent.parent) @@ -82713,8 +86215,7 @@ var ts; } function getExportAssignmentExport(ex) { // Get the symbol for the `export =` node; its parent is the module it's the export of. - var exportingModuleSymbol = ex.symbol.parent; - ts.Debug.assert(!!exportingModuleSymbol); + var exportingModuleSymbol = ts.Debug.assertDefined(ex.symbol.parent, "Expected export symbol to have a parent"); var exportKind = ex.isExportEquals ? 2 /* ExportEquals */ : 1 /* Default */; return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } }; } @@ -82730,7 +86231,11 @@ var ts; default: return undefined; } - var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.cast(node.left, ts.isPropertyAccessExpression).name) : symbol; + // Better detection for GH#20803 + if (sym && !(checker.getMergedSymbol(sym.parent).flags & 1536 /* Module */)) { + ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.showSymbol(sym) + ", parent is " + ts.Debug.showSymbol(sym.parent)); + } return sym && exportInfo(sym, kind); } } @@ -82752,7 +86257,7 @@ var ts; // If `importedName` is undefined, do continue searching as the export is anonymous. // (All imports returned from this function will be ignored anyway if we are in rename and this is a not a named export.) var importedName = symbolName(importedSymbol); - if (importedName === undefined || importedName === "default" || importedName === symbol.escapedName) { + if (importedName === undefined || importedName === "default" /* Default */ || importedName === symbol.escapedName) { return __assign({ kind: 0 /* Import */, symbol: importedSymbol }, isImport); } } @@ -82768,24 +86273,24 @@ var ts; FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; function getExportEqualsLocalSymbol(importedSymbol, checker) { if (importedSymbol.flags & 2097152 /* Alias */) { - return checker.getImmediateAliasedSymbol(importedSymbol); + return ts.Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol)); } var decl = importedSymbol.valueDeclaration; if (ts.isExportAssignment(decl)) { - return decl.expression.symbol; + return ts.Debug.assertDefined(decl.expression.symbol); } else if (ts.isBinaryExpression(decl)) { - return decl.right.symbol; + return ts.Debug.assertDefined(decl.right.symbol); } - ts.Debug.fail(); + return ts.Debug.fail(); } // If a reference is a class expression, the exported node would be its parent. // If a reference is a variable declaration, the exported node would be the variable statement. function getExportNode(parent, node) { - if (parent.kind === 227 /* VariableDeclaration */) { + if (parent.kind === 230 /* VariableDeclaration */) { var p = parent; return p.name !== node ? undefined : - p.parent.kind === 264 /* CatchClause */ ? undefined : p.parent.parent.kind === 209 /* VariableStatement */ ? p.parent.parent : undefined; + p.parent.kind === 267 /* CatchClause */ ? undefined : p.parent.parent.kind === 212 /* VariableStatement */ ? p.parent.parent : undefined; } else { return parent; @@ -82794,15 +86299,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent) ? { isNamedImport: false } : undefined; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return parent.propertyName ? undefined : { isNamedImport: true }; - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return { isNamedImport: false }; default: @@ -82810,13 +86315,16 @@ var ts; } } function getExportInfo(exportSymbol, exportKind, checker) { - var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + var moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return undefined; // This can happen if an `export` is not at the top-level (which is a compile error). + var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation. // `export` may appear in a namespace. In that case, just rely on global search. return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; } FindAllReferences.getExportInfo = getExportInfo; function symbolName(symbol) { - if (symbol.escapedName !== "default") { + if (symbol.escapedName !== "default" /* Default */) { return symbol.escapedName; } return ts.forEach(symbol.declarations, function (decl) { @@ -82826,7 +86334,7 @@ var ts; } /** If at an export specifier, go to the symbol it refers to. */ function skipExportSpecifierSymbol(symbol, checker) { - // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. + // For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does. if (symbol.declarations) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; @@ -82841,22 +86349,22 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 269 /* SourceFile */) { + if (parent.kind === 272 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 235 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); + ts.Debug.assert(parent.kind === 238 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); return parent.parent; } function isAmbientModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + return node.kind === 237 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; } function isExternalModuleImportEquals(_a) { var moduleReference = _a.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + return moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -82872,37 +86380,30 @@ var ts; FindAllReferences.nodeEntry = nodeEntry; function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { var referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); - if (!referencedSymbols || !referencedSymbols.length) { - return undefined; - } - var out = []; var checker = program.getTypeChecker(); - for (var _i = 0, referencedSymbols_1 = referencedSymbols; _i < referencedSymbols_1.length; _i++) { - var _a = referencedSymbols_1[_i], definition = _a.definition, references = _a.references; + return !referencedSymbols || !referencedSymbols.length ? undefined : ts.mapDefined(referencedSymbols, function (_a) { + var definition = _a.definition, references = _a.references; // Only include referenced symbols that have a valid definition. - if (definition) { - out.push({ definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); - } - } - return out; + return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }; + }); } FindAllReferences.findReferencedSymbols = findReferencedSymbols; function getImplementationsAtPosition(program, cancellationToken, sourceFiles, sourceFile, position) { // A node in a JSDoc comment can't have an implementation anyway. var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ false); - var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node); + var referenceEntries = getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position); var checker = program.getTypeChecker(); return ts.map(referenceEntries, function (entry) { return toImplementationLocation(entry, checker); }); } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; - function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node) { - if (node.kind === 269 /* SourceFile */) { + function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { + if (node.kind === 272 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var result_4 = []; FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_4.push(nodeEntry(node)); }); return result_4; @@ -82915,7 +86416,7 @@ var ts; } else { // Perform "Find all References" and retrieve only those that are implementations - return getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, { implementations: true }); + return getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, { implementations: true }); } } function findReferencedEntries(program, cancellationToken, sourceFiles, sourceFile, position, options) { @@ -82923,14 +86424,14 @@ var ts; return ts.map(x, toReferenceEntry); } FindAllReferences.findReferencedEntries = findReferencedEntries; - function getReferenceEntriesForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options)); + return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)); } FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; function findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options) { var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - return FindAllReferences.Core.getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options); + return FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); } function flattenEntries(referenceSymbols) { return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); @@ -82941,8 +86442,8 @@ var ts; case "symbol": { var symbol = def.symbol, node_3 = def.node; var _a = getDefinitionKindAndDisplayParts(symbol, node_3, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; - var name_5 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: node_3, name: name_5, kind: kind_1, displayParts: displayParts_1 }; + var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); + return { node: node_3, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case "label": { var node_4 = def.node; @@ -82950,8 +86451,8 @@ var ts; } case "keyword": { var node_5 = def.node; - var name_6 = ts.tokenToString(node_5.kind); - return { node: node_5, name: name_6, kind: "keyword" /* keyword */, displayParts: [{ text: name_6, kind: "keyword" /* keyword */ }] }; + var name_5 = ts.tokenToString(node_5.kind); + return { node: node_5, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; } case "this": { var node_6 = def.node; @@ -83014,13 +86515,13 @@ var ts; if (symbol) { return getDefinitionKindAndDisplayParts(symbol, node, checker); } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(20 /* CloseParenToken */)] }; } - else if (node.kind === 200 /* ClassExpression */) { + else if (node.kind === 203 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(20 /* CloseParenToken */)] @@ -83069,10 +86570,11 @@ var ts; var Core; (function (Core) { /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ - function getReferencedSymbolsForNode(node, program, sourceFiles, cancellationToken, options) { + function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options) { if (options === void 0) { options = {}; } - if (node.kind === 269 /* SourceFile */) { - return undefined; + if (ts.isSourceFile(node)) { + var reference = ts.GoToDefinition.getReferenceAtPosition(node, position, program); + return reference && getReferencedSymbolsForModule(program, program.getTypeChecker().getMergedSymbol(reference.file.symbol), sourceFiles); } if (!options.implementations) { var special = getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken); @@ -83085,11 +86587,7 @@ var ts; // Could not find a symbol e.g. unknown identifier if (!symbol) { // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial. - if (!options.implementations && node.kind === 9 /* StringLiteral */) { - return getReferencesForStringLiteral(node, sourceFiles, cancellationToken); - } - // Can't have references to something that we have no symbol for. - return undefined; + return !options.implementations && ts.isStringLiteral(node) ? getReferencesForStringLiteral(node, sourceFiles, cancellationToken) : undefined; } if (symbol.flags & 1536 /* Module */ && isModuleReferenceLocation(node)) { return getReferencedSymbolsForModule(program, symbol, sourceFiles); @@ -83098,16 +86596,16 @@ var ts; } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; function isModuleReferenceLocation(node) { - if (node.kind !== 9 /* StringLiteral */) { + if (!ts.isStringLiteralLike(node)) { return false; } switch (node.parent.kind) { - case 234 /* ModuleDeclaration */: - case 249 /* ExternalModuleReference */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 237 /* ModuleDeclaration */: + case 252 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return true; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent); default: return false; @@ -83130,10 +86628,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: references.push({ type: "node", node: decl.name }); break; default: @@ -83173,14 +86671,14 @@ var ts; } /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { - symbol = skipPastExportOrImportSpecifier(symbol, node, checker); + symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; // Compute the meaning from the location and the symbol it references var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); var result = []; - var state = new State(sourceFiles, /*isForConstructor*/ node.kind === 123 /* ConstructorKeyword */, checker, cancellationToken, searchMeaning, options, result); + var state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result); if (node.kind === 79 /* DefaultKeyword */) { addReference(node, symbol, node, state); - searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: 1 /* Default */ }, state); + searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } else { var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); @@ -83201,8 +86699,22 @@ var ts; } return result; } + function getSpecialSearchKind(node) { + switch (node.kind) { + case 123 /* ConstructorKeyword */: + return 1 /* Constructor */; + case 71 /* Identifier */: + if (ts.isClassLike(node.parent)) { + ts.Debug.assert(node.parent.name === node); + return 2 /* Class */; + } + // falls through + default: + return 0 /* None */; + } + } /** Handle a few special cases relating to export/import specifiers. */ - function skipPastExportOrImportSpecifier(symbol, node, checker) { + function skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) { var parent = node.parent; if (ts.isExportSpecifier(parent)) { return getLocalSymbolForExportSpecifier(node, symbol, parent, checker); @@ -83211,18 +86723,34 @@ var ts; // We're at `foo` in `import { foo as bar }`. Probably intended to find all refs on the original, not just on the import. return checker.getImmediateAliasedSymbol(symbol); } - return symbol; + // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. + return ts.firstDefined(symbol.declarations, function (decl) { + if (!decl.parent) { + // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. + ts.Debug.assert(decl.kind === 272 /* SourceFile */); + ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); + } + return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent) + ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) + : undefined; + }); } + var SpecialSearchKind; + (function (SpecialSearchKind) { + SpecialSearchKind[SpecialSearchKind["None"] = 0] = "None"; + SpecialSearchKind[SpecialSearchKind["Constructor"] = 1] = "Constructor"; + SpecialSearchKind[SpecialSearchKind["Class"] = 2] = "Class"; + })(SpecialSearchKind || (SpecialSearchKind = {})); /** * Holds all state needed for the finding references. * Unlike `Search`, there is only one `State`. */ var State = /** @class */ (function () { function State(sourceFiles, - /** True if we're searching for constructor references. */ - isForConstructor, checker, cancellationToken, searchMeaning, options, result) { + /** True if we're searching for constructor references. */ + specialSearchKind, checker, cancellationToken, searchMeaning, options, result) { this.sourceFiles = sourceFiles; - this.isForConstructor = isForConstructor; + this.specialSearchKind = specialSearchKind; this.checker = checker; this.cancellationToken = cancellationToken; this.searchMeaning = searchMeaning; @@ -83264,6 +86792,9 @@ var ts; State.prototype.createSearch = function (location, symbol, comingFrom, searchOptions) { if (searchOptions === void 0) { searchOptions = {}; } // Note: if this is an external module symbol, the name doesn't include quotes. + // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`. + // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form + // here appears to be intentional). var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; var escapedText = ts.escapeLeadingUnderscores(text); var parents = this.options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, this.checker); @@ -83356,9 +86887,9 @@ var ts; checker.getPropertySymbolOfDestructuringAssignment(location); } function getObjectBindingElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 177 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 180 /* BindingElement */); if (bindingElement && - bindingElement.parent.kind === 175 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 178 /* ObjectBindingPattern */ && !bindingElement.propertyName) { return bindingElement; } @@ -83388,7 +86919,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 187 /* FunctionExpression */ || valueDeclaration.kind === 200 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 190 /* FunctionExpression */ || valueDeclaration.kind === 203 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -83398,7 +86929,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 230 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 233 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -83427,7 +86958,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -83576,11 +87107,18 @@ var ts; getReferenceForShorthandProperty(referenceSymbol, search, state); return; } - if (state.isForConstructor) { - findConstructorReferences(referenceLocation, sourceFile, search, state); - } - else { - addReference(referenceLocation, relatedSymbol, search.location, state); + switch (state.specialSearchKind) { + case 0 /* None */: + addReference(referenceLocation, relatedSymbol, search.location, state); + break; + case 1 /* Constructor */: + addConstructorReferences(referenceLocation, sourceFile, search, state); + break; + case 2 /* Class */: + addClassStaticThisReferences(referenceLocation, search, state); + break; + default: + ts.Debug.assertNever(state.specialSearchKind); } getImportOrExportReferences(referenceLocation, referenceSymbol, search, state); } @@ -83618,14 +87156,16 @@ var ts; } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { - searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); } function addRef() { addReference(referenceLocation, localSymbol, search.location, state); } } function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; } function isExportSpecifierAlias(referenceLocation, exportSpecifier) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; @@ -83679,24 +87219,48 @@ var ts; } } /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ - function findConstructorReferences(referenceLocation, sourceFile, search, state) { + function addConstructorReferences(referenceLocation, sourceFile, search, state) { if (ts.isNewExpressionTarget(referenceLocation)) { addReference(referenceLocation, search.symbol, search.location, state); } - var pusher = state.referenceAdder(search.symbol, search.location); + var pusher = function () { return state.referenceAdder(search.symbol, search.location); }; if (ts.isClassLike(referenceLocation.parent)) { - ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + ts.Debug.assert(referenceLocation.kind === 79 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); // This is the class declaration containing the constructor. - findOwnConstructorReferences(search.symbol, sourceFile, pusher); + findOwnConstructorReferences(search.symbol, sourceFile, pusher()); } else { // If this class appears in `extends C`, then the extending class' "super" calls are references. var classExtending = tryGetClassByExtendingIdentifier(referenceLocation); - if (classExtending && ts.isClassLike(classExtending)) { - findSuperConstructorAccesses(classExtending, pusher); + if (classExtending) { + findSuperConstructorAccesses(classExtending, pusher()); } } } + function addClassStaticThisReferences(referenceLocation, search, state) { + addReference(referenceLocation, search.symbol, search.location, state); + if (ts.isClassLike(referenceLocation.parent)) { + ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + // This is the class declaration. + addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location)); + } + } + function addStaticThisReferences(classLike, pusher) { + for (var _i = 0, _a = classLike.members; _i < _a.length; _i++) { + var member = _a[_i]; + if (!(ts.isMethodOrAccessor(member) && ts.hasModifier(member, 32 /* Static */))) { + continue; + } + member.body.forEachChild(function cb(node) { + if (node.kind === 99 /* ThisKeyword */) { + pusher(node); + } + else if (!ts.isFunctionLike(node)) { + node.forEachChild(cb); + } + }); + } + } function getPropertyAccessExpressionFromRightHandSide(node) { return ts.isRightSideOfPropertyAccess(node) && node.parent; } @@ -83708,12 +87272,12 @@ var ts; for (var _i = 0, _a = classSymbol.members.get("__constructor" /* Constructor */).declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 123 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 153 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 154 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 152 /* MethodDeclaration */) { + if (decl && decl.kind === 153 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 99 /* ThisKeyword */, function (thisKeyword) { @@ -83734,7 +87298,7 @@ var ts; } for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 153 /* Constructor */); + ts.Debug.assert(decl.kind === 154 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 97 /* SuperKeyword */, function (node) { @@ -83754,7 +87318,7 @@ var ts; if (refNode.kind !== 71 /* Identifier */) { return; } - if (refNode.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 269 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -83768,12 +87332,12 @@ var ts; var containingTypeReference = getContainingTypeReference(refNode); if (containingTypeReference && state.markSeenContainingTypeReference(containingTypeReference)) { var parent = containingTypeReference.parent; - if (ts.isVariableLike(parent) && parent.type === containingTypeReference && parent.initializer && isImplementationExpression(parent.initializer)) { + if (ts.hasType(parent) && parent.type === containingTypeReference && ts.hasInitializer(parent) && isImplementationExpression(parent.initializer)) { addReference(parent.initializer); } else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { var body = parent.body; - if (body.kind === 208 /* Block */) { + if (body.kind === 211 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { addReference(returnStatement.expression); @@ -83814,12 +87378,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ - && node.parent.kind === 263 /* HeritageClause */ + if (node.kind === 205 /* ExpressionWithTypeArguments */ + && node.parent.kind === 266 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 71 /* Identifier */ || node.kind === 180 /* PropertyAccessExpression */) { + else if (node.kind === 71 /* Identifier */ || node.kind === 183 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -83830,13 +87394,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 178 /* ArrayLiteralExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 181 /* ArrayLiteralExpression */: return true; default: return false; @@ -83890,7 +87454,7 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } @@ -83918,13 +87482,13 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; @@ -83955,27 +87519,27 @@ var ts; // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -83984,58 +87548,58 @@ var ts; } var references = []; var possiblePositions; - if (searchSpaceNode.kind === 269 /* SourceFile */) { + if (searchSpaceNode.kind === 272 /* SourceFile */) { ts.forEach(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this"); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); + getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, staticFlag, references); }); } else { var sourceFile = searchSpaceNode.getSourceFile(); possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); + getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, references); } return [{ definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (!node || !ts.isThis(node)) { - return; - } - var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); - switch (searchSpaceNode.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - if (searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - // Make sure the container belongs to the same class - // and has the appropriate static modifier from the original container. - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 269 /* SourceFile */: - if (container.kind === 269 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - } - }); - } + } + function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, result) { + ts.forEach(possiblePositions, function (position) { + var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); + if (!node || !ts.isThis(node)) { + return; + } + var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); + switch (searchSpaceNode.kind) { + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + if (searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 272 /* SourceFile */: + if (container.kind === 272 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + } + }); } function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { var references = []; @@ -84063,13 +87627,13 @@ var ts; // This is not needed when searching for re-exports. function populateSearchSymbolSet(symbol, location, checker, implementations) { // The search set contains at least the current symbol - var result = [symbol]; + var result = []; var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { // If the location is name of property symbol from object literal destructuring pattern // Search the property symbol // for ( { property: p2 } of elems) { } - if (containingObjectLiteralElement.kind !== 266 /* ShorthandPropertyAssignment */) { + if (containingObjectLiteralElement.kind !== 269 /* ShorthandPropertyAssignment */) { var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); if (propertySymbol) { result.push(propertySymbol); @@ -84078,9 +87642,10 @@ var ts; // If the location is in a context sensitive location (i.e. in an object literal) try // to get a contextual type for it, and add the property symbol from the contextual // type to the search set - ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - ts.addRange(result, checker.getRootSymbols(contextualSymbol)); - }); + for (var _i = 0, _a = getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker); _i < _a.length; _i++) { + var contextualSymbol = _a[_i]; + addRootSymbols(contextualSymbol); + } /* Because in short-hand property assignment, location has two meaning : property name and as value of the property * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of * property name and variable declaration of the identifier. @@ -84116,9 +87681,7 @@ var ts; // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list for (var _i = 0, _a = checker.getRootSymbols(sym); _i < _a.length; _i++) { var rootSymbol = _a[_i]; - if (rootSymbol !== sym) { - result.push(rootSymbol); - } + result.push(rootSymbol); // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions if (!implementations && rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), checker); @@ -84163,7 +87726,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -84201,9 +87764,7 @@ var ts; // compare to our searchSymbol var containingObjectLiteralElement = ts.getContainingObjectLiteralElement(referenceLocation); if (containingObjectLiteralElement) { - var contextualSymbol = ts.forEach(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), function (contextualSymbol) { - return ts.find(checker.getRootSymbols(contextualSymbol), search.includes); - }); + var contextualSymbol = ts.firstDefined(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker), findRootSymbol); if (contextualSymbol) { return contextualSymbol; } @@ -84229,7 +87790,7 @@ var ts; function findRootSymbol(sym) { // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) // Or a union property, use its underlying unioned symbols - return ts.forEach(state.checker.getRootSymbols(sym), function (rootSymbol) { + return ts.firstDefined(checker.getRootSymbols(sym), function (rootSymbol) { // if it is in the list, then we are done if (search.includes(rootSymbol)) { return rootSymbol; @@ -84239,11 +87800,11 @@ var ts; // parent symbol if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { // Parents will only be defined if implementations is true - if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, state.checker); })) { + if (search.parents && !ts.some(search.parents, function (parent) { return explicitlyInheritsFrom(rootSymbol.parent, parent, state.inheritsFromCache, checker); })) { return undefined; } var result = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), state.checker); + getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, result, /*previousIterationSymbolsCache*/ ts.createSymbolTable(), checker); return ts.find(result, search.includes); } return undefined; @@ -84251,7 +87812,7 @@ var ts; } } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -84263,26 +87824,11 @@ var ts; } /** Gets all symbols for one property. Does not get symbols for every property. */ function getPropertySymbolsFromContextualType(node, checker) { - var objectLiteral = node.parent; - var contextualType = checker.getContextualType(objectLiteral); + var contextualType = checker.getContextualType(node.parent); var name = getNameFromObjectLiteralElement(node); - if (name && contextualType) { - var result_5 = []; - var symbol = contextualType.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - if (contextualType.flags & 131072 /* Union */) { - ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name); - if (symbol) { - result_5.push(symbol); - } - }); - } - return result_5; - } - return undefined; + var symbol = contextualType && name && contextualType.getProperty(name); + return symbol ? [symbol] : + contextualType && contextualType.flags & 131072 /* Union */ ? ts.mapDefined(contextualType.types, function (t) { return t.getProperty(name); }) : ts.emptyArray; } /** * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations @@ -84317,32 +87863,30 @@ var ts; if (!node) { return false; } - else if (ts.isVariableLike(node)) { - if (node.initializer) { - return true; - } - else if (node.kind === 227 /* VariableDeclaration */) { - var parentStatement = getParentStatementOfVariableDeclaration(node); - return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); - } + else if (ts.isVariableLike(node) && ts.hasInitializer(node)) { + return true; + } + else if (node.kind === 230 /* VariableDeclaration */) { + var parentStatement = getParentStatementOfVariableDeclaration(node); + return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); } else if (ts.isFunctionLike(node)) { return !!node.body || ts.hasModifier(node, 2 /* Ambient */); } else { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return true; } } return false; } function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 209 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 228 /* VariableDeclarationList */); + if (node.parent && node.parent.parent && node.parent.parent.kind === 212 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 231 /* VariableDeclarationList */); return node.parent.parent; } } @@ -84408,21 +87952,9 @@ var ts; var GoToDefinition; (function (GoToDefinition) { function getDefinitionAtPosition(program, sourceFile, position) { - /// Triple slash reference comments - var comment = findReferenceInPosition(sourceFile.referencedFiles, position); - if (comment) { - var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); - if (referenceFile) { - return [getDefinitionInfoForFileReference(comment.fileName, referenceFile.fileName)]; - } - // Might still be on jsdoc, so keep looking. - } - // Type reference directives - var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); - if (typeReferenceDirective) { - var referenceFile = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); - return referenceFile && referenceFile.resolvedFileName && - [getDefinitionInfoForFileReference(typeReferenceDirective.fileName, referenceFile.resolvedFileName)]; + var reference = getReferenceAtPosition(sourceFile, position, program); + if (reference) { + return [getDefinitionInfoForFileReference(reference.fileName, reference.file.fileName)]; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); if (node === sourceFile) { @@ -84460,7 +87992,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -84510,6 +88042,21 @@ var ts; return getDefinitionFromSymbol(typeChecker, symbol, node); } GoToDefinition.getDefinitionAtPosition = getDefinitionAtPosition; + function getReferenceAtPosition(sourceFile, position, program) { + var referencePath = findReferenceInPosition(sourceFile.referencedFiles, position); + if (referencePath) { + var file = ts.tryResolveScriptReference(program, sourceFile, referencePath); + return file && { fileName: referencePath.fileName, file: file }; + } + var typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position); + if (typeReferenceDirective) { + var reference = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName); + var file = reference && program.getSourceFile(reference.resolvedFileName); + return file && { fileName: typeReferenceDirective.fileName, file: file }; + } + return undefined; + } + GoToDefinition.getReferenceAtPosition = getReferenceAtPosition; /// Goto type function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) { var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); @@ -84517,26 +88064,14 @@ var ts; return undefined; } var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - return undefined; - } - var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); + var type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, node); if (!type) { return undefined; } if (type.flags & 131072 /* Union */ && !(type.flags & 16 /* Enum */)) { - var result_6 = []; - ts.forEach(type.types, function (t) { - if (t.symbol) { - ts.addRange(/*to*/ result_6, /*from*/ getDefinitionFromSymbol(typeChecker, t.symbol, node)); - } - }); - return result_6; + return ts.flatMap(type.types, function (t) { return t.symbol && getDefinitionFromSymbol(typeChecker, t.symbol, node); }); } - if (!type.symbol) { - return undefined; - } - return getDefinitionFromSymbol(typeChecker, type.symbol, node); + return type.symbol && getDefinitionFromSymbol(typeChecker, type.symbol, node); } GoToDefinition.getTypeDefinitionAtPosition = getTypeDefinitionAtPosition; function getDefinitionAndBoundSpan(program, sourceFile, position) { @@ -84547,10 +88082,7 @@ var ts; // Check if position is on triple slash reference. var comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (comment) { - return { - definitions: definitions, - textSpan: ts.createTextSpanFromBounds(comment.pos, comment.end) - }; + return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) }; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); var textSpan = ts.createTextSpan(node.getStart(), node.getWidth()); @@ -84570,77 +88102,48 @@ var ts; return true; } switch (declaration.kind) { - case 240 /* ImportClause */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: return true; - case 243 /* ImportSpecifier */: - return declaration.parent.kind === 242 /* NamedImports */; + case 246 /* ImportSpecifier */: + return declaration.parent.kind === 245 /* NamedImports */; default: return false; } } function getDefinitionFromSymbol(typeChecker, symbol, node) { - var result = []; - var declarations = symbol.getDeclarations(); var _a = getSymbolInfo(typeChecker, symbol, node), symbolName = _a.symbolName, symbolKind = _a.symbolKind, containerName = _a.containerName; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); - } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { + return getConstructSignatureDefinition() || getCallSignatureDefinition() || ts.map(symbol.declarations, function (declaration) { return createDefinitionInfo(declaration, symbolKind, symbolName, containerName); }); + function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (ts.isNewExpressionTarget(location) || location.kind === 123 /* ConstructorKeyword */) { - if (symbol.flags & 32 /* Class */) { - // Find the first class-like declaration and try to get the construct signature. - for (var _i = 0, _a = symbol.getDeclarations(); _i < _a.length; _i++) { - var declaration = _a[_i]; - if (ts.isClassLike(declaration)) { - return tryAddSignature(declaration.members, /*selectConstructors*/ true, symbolKind, symbolName, containerName, result); - } - } - ts.Debug.fail("Expected declaration to have at least one class-like declaration"); - } + if (symbol.flags & 32 /* Class */ && (ts.isNewExpressionTarget(node) || node.kind === 123 /* ConstructorKeyword */)) { + var cls = ts.find(symbol.declarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); + return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } - return false; } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (ts.isCallExpressionTarget(location) || ts.isNewExpressionTarget(location) || ts.isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, /*selectConstructors*/ false, symbolKind, symbolName, containerName, result); - } - return false; + function getCallSignatureDefinition() { + return ts.isCallExpressionTarget(node) || ts.isNewExpressionTarget(node) || ts.isNameOfFunctionDeclaration(node) + ? getSignatureDefinition(symbol.declarations, /*selectConstructors*/ false) + : undefined; } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { + function getSignatureDefinition(signatureDeclarations, selectConstructors) { if (!signatureDeclarations) { - return false; + return undefined; } - var declarations = []; - var definition; - for (var _i = 0, signatureDeclarations_1 = signatureDeclarations; _i < signatureDeclarations_1.length; _i++) { - var d = signatureDeclarations_1[_i]; - if (selectConstructors ? d.kind === 153 /* Constructor */ : isSignatureDeclaration(d)) { - declarations.push(d); - if (d.body) - definition = d; - } - } - if (declarations.length) { - result.push(createDefinitionInfo(definition || ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); - return true; - } - return false; + var declarations = signatureDeclarations.filter(selectConstructors ? ts.isConstructorDeclaration : isSignatureDeclaration); + return declarations.length + ? [createDefinitionInfo(ts.find(declarations, function (d) { return !!d.body; }) || ts.last(declarations), symbolKind, symbolName, containerName)] + : undefined; } } function isSignatureDeclaration(node) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return true; default: return false; @@ -84682,6 +88185,7 @@ var ts; } return undefined; } + GoToDefinition.findReferenceInPosition = findReferenceInPosition; function getDefinitionInfoForFileReference(name, targetFileName) { return { fileName: targetFileName, @@ -84720,7 +88224,6 @@ var ts; (function (ts) { var JsDoc; (function (JsDoc) { - var singleLineTemplate = { newText: "/** */", caretOffset: 3 }; var jsDocTagNames = [ "augments", "author", @@ -84758,6 +88261,7 @@ var ts; "see", "since", "static", + "template", "throws", "type", "typedef", @@ -84774,18 +88278,29 @@ var ts; // from Array - Array and Array var documentationComment = []; forEachUnique(declarations, function (declaration) { - ts.forEach(ts.getAllJSDocs(declaration), function (doc) { - if (doc.comment) { - if (documentationComment.length) { - documentationComment.push(ts.lineBreakPart()); - } - documentationComment.push(ts.textPart(doc.comment)); + for (var _i = 0, _a = getCommentHavingNodes(declaration); _i < _a.length; _i++) { + var comment = _a[_i].comment; + if (comment === undefined) + continue; + if (documentationComment.length) { + documentationComment.push(ts.lineBreakPart()); } - }); + documentationComment.push(ts.textPart(comment)); + } }); return documentationComment; } JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; + function getCommentHavingNodes(declaration) { + switch (declaration.kind) { + case 292 /* JSDocPropertyTag */: + return [declaration]; + case 291 /* JSDocTypedefTag */: + return [declaration.parent]; + default: + return ts.getJSDocCommentsAndTags(declaration); + } + } function getJsDocTagsFromDeclarations(declarations) { // Only collect doc comments from duplicate declarations once. var tags = []; @@ -84801,25 +88316,28 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return withNode(tag.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 288 /* JSDocTypedefTag */: - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: + case 291 /* JSDocTypedefTag */: + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: return comment; } function withNode(node) { - return node.getText() + " " + comment; + return addComment(node.getText()); } function withList(list) { - return list.map(function (x) { return x.getText(); }) + " " + comment; + return addComment(list.map(function (x) { return x.getText(); }).join(", ")); + } + function addComment(s) { + return comment === undefined ? s : s + " " + comment; } } /** @@ -84830,7 +88348,7 @@ var ts; function forEachUnique(array, callback) { if (array) { for (var i = 0; i < array.length; i++) { - if (ts.indexOf(array, array[i]) === i) { + if (array.indexOf(array[i]) === i) { var result = callback(array[i], i); if (result) { return result; @@ -84911,9 +88429,16 @@ var ts; /** * Checks if position points to a valid position to add JSDoc comments, and if so, * returns the appropriate template. Otherwise returns an empty string. - * Invalid positions are - * - within comments, strings (including template literals and regex), and JSXText - * - within a token + * Valid positions are + * - outside of comments, statements, and expressions, and + * - preceding a: + * - function/constructor/method declaration + * - class declarations + * - variable statements + * - namespace declarations + * - interface declarations + * - method signatures + * - type alias declarations * * Hosts should ideally check that: * - The line is all whitespace up to 'position' before performing the insertion. @@ -84936,29 +88461,33 @@ var ts; } var commentOwnerInfo = getCommentOwnerInfo(tokenAtPos); if (!commentOwnerInfo) { - // if climbing the tree did not find a declaration with parameters, complete to a single line comment - return singleLineTemplate; - } - var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; - if (commentOwner.kind === 10 /* JsxText */) { return undefined; } - if (commentOwner.getStart() < position || parameters.length === 0) { - // if climbing the tree found a declaration with parameters but the request was made inside it - // or if there are no parameters, complete to a single line comment - return singleLineTemplate; + var commentOwner = commentOwnerInfo.commentOwner, parameters = commentOwnerInfo.parameters; + if (commentOwner.getStart() < position) { + return undefined; + } + if (!parameters || parameters.length === 0) { + // if there are no parameters, just complete to a single line JSDoc comment + var singleLineResult = "/** */"; + return { newText: singleLineResult, caretOffset: 3 }; } var posLineAndChar = sourceFile.getLineAndCharacterOfPosition(position); var lineStart = sourceFile.getLineStarts()[posLineAndChar.line]; // replace non-whitespace characters in prefix with spaces. var indentationStr = sourceFile.text.substr(lineStart, posLineAndChar.character).replace(/\S/i, function () { return " "; }); var isJavaScriptFile = ts.hasJavaScriptFileExtension(sourceFile.fileName); - var docParams = parameters.map(function (_a, i) { - var name = _a.name; - var nameText = ts.isIdentifier(name) ? name.text : "param" + i; - var type = isJavaScriptFile ? "{any} " : ""; - return indentationStr + " * @param " + type + nameText + newLine; - }).join(""); + var docParams = ""; + for (var i = 0; i < parameters.length; i++) { + var currentName = parameters[i].name; + var paramName = currentName.kind === 71 /* Identifier */ ? currentName.escapedText : "param" + i; + if (isJavaScriptFile) { + docParams += indentationStr + " * @param {any} " + paramName + newLine; + } + else { + docParams += indentationStr + " * @param " + paramName + newLine; + } + } // A doc comment consists of the following // * The opening comment line // * the first line (without a param) for the object's untagged info (this is also where the caret ends up) @@ -84978,23 +88507,35 @@ var ts; function getCommentOwnerInfo(tokenAtPos) { for (var commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 152 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 209 /* VariableStatement */: { + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 150 /* PropertySignature */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 235 /* TypeAliasDeclaration */: + return { commentOwner: commentOwner }; + case 212 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer ? getParametersFromRightHandSideOfAssignment(varDeclarations[0].initializer) : undefined; - return parameters_1 ? { commentOwner: commentOwner, parameters: parameters_1 } : undefined; + return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 269 /* SourceFile */: + case 272 /* SourceFile */: return undefined; - case 195 /* BinaryExpression */: { + case 237 /* ModuleDeclaration */: + // If in walking up the tree, we hit a a nested namespace declaration, + // then we must be somewhere within a dotted namespace name; however we don't + // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. + return commentOwner.parent.kind === 237 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 198 /* BinaryExpression */: { var be = commentOwner; if (ts.getSpecialPropertyAssignmentKind(be) === 0 /* None */) { return undefined; @@ -85002,10 +88543,6 @@ var ts; var parameters_2 = ts.isFunctionLike(be.right) ? be.right.parameters : ts.emptyArray; return { commentOwner: commentOwner, parameters: parameters_2 }; } - case 10 /* JsxText */: { - var parameters_3 = ts.emptyArray; - return { commentOwner: commentOwner, parameters: parameters_3 }; - } } } } @@ -85018,17 +88555,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 186 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 189 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return rightHandSide.parameters; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { return member.parameters; } } @@ -85038,16 +88575,88 @@ var ts; } })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + function stringToInt(str) { + var n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error("Error in parseInt(" + JSON.stringify(str) + ")"); + } + return n; + } + var isPrereleaseRegex = /^(.*)-next.\d+/; + var prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + var semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + var Semver = /** @class */ (function () { + function Semver(major, minor, patch, + /** + * If true, this is `major.minor.0-next.patch`. + * If false, this is `major.minor.patch`. + */ + isPrerelease) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.isPrerelease = isPrerelease; + } + Semver.parse = function (semver) { + var isPrerelease = isPrereleaseRegex.test(semver); + var result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error("Unexpected semver: " + semver + " (isPrerelease: " + isPrerelease + ")"); + } + return result; + }; + Semver.fromRaw = function (_a) { + var major = _a.major, minor = _a.minor, patch = _a.patch, isPrerelease = _a.isPrerelease; + return new Semver(major, minor, patch, isPrerelease); + }; + // This must parse the output of `versionString`. + Semver.tryParse = function (semver, isPrerelease) { + // Per the semver spec : + // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." + var rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; + var match = rgx.exec(semver); + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; + }; + Object.defineProperty(Semver.prototype, "versionString", { + get: function () { + return this.isPrerelease ? this.major + "." + this.minor + ".0-next." + this.patch : this.major + "." + this.minor + "." + this.patch; + }, + enumerable: true, + configurable: true + }); + Semver.prototype.equals = function (sem) { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + }; + Semver.prototype.greaterThan = function (sem) { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); + }; + return Semver; + }()); + ts.Semver = Semver; +})(ts || (ts = {})); // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// /// /// +/// /* @internal */ var ts; (function (ts) { var JsTyping; (function (JsTyping) { + /* @internal */ + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = ts.Semver.parse(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest")); + return !availableVersion.greaterThan(cachedTyping.version); + } + JsTyping.isTypingUpToDate = isTypingUpToDate; /* @internal */ JsTyping.nodeCoreModuleList = [ "buffer", "querystring", "events", "http", "cluster", @@ -85076,11 +88685,11 @@ var ts; * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ - function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; } @@ -85117,9 +88726,9 @@ var ts; addInferredTypings(module, "Inferred typings from unresolved imports"); } // Add the cached typing locations for inferred typings that are already installed - packageNameToTypingLocation.forEach(function (typingLocation, name) { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); + packageNameToTypingLocation.forEach(function (typing, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { + inferredTypings.set(name, typing.typingLocation); } }); // Remove typings that the user has added to the exclude list @@ -85211,8 +88820,8 @@ var ts; if (baseFileName !== "package.json" && baseFileName !== "bower.json") { continue; } - var result_7 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - var packageJson = result_7.config; + var result_5 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + var packageJson = result_5.config; // npm 3's package.json contains a "_requiredBy" field // we should include all the top level module names for npm 2, and only module names whose // "_requiredBy" field starts with "#" or equals "/" for npm 3. @@ -85343,7 +88952,7 @@ var ts; if (!shouldKeepItem(declaration, checker)) { continue; } - // It was a match! If the pattern has dots in it, then also see if the + // It was a match! If the pattern has dots in it, then also see if the // declaration container matches as well. var containerMatches = matches; if (patternMatcher.patternContainsDots) { @@ -85359,9 +88968,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 240 /* ImportClause */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -85372,8 +88981,8 @@ var ts; function allMatchesAreCaseSensitive(matches) { ts.Debug.assert(matches.length > 0); // This is a case sensitive match, only if all the submatches were case sensitive. - for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { - var match = matches_2[_i]; + for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) { + var match = matches_1[_i]; if (!match.isCaseSensitive) { return false; } @@ -85388,7 +88997,7 @@ var ts; if (text !== undefined) { containers.unshift(text); } - else if (name.kind === 145 /* ComputedPropertyName */) { + else if (name.kind === 146 /* ComputedPropertyName */) { return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); } else { @@ -85410,7 +89019,7 @@ var ts; } return true; } - if (expression.kind === 180 /* PropertyAccessExpression */) { + if (expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = expression; if (includeLastPortion) { containers.unshift(propertyAccess.name.text); @@ -85424,7 +89033,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -85442,8 +89051,8 @@ var ts; function bestMatchKind(matches) { ts.Debug.assert(matches.length > 0); var bestMatchKind = ts.PatternMatchKind.camelCase; - for (var _i = 0, matches_3 = matches; _i < matches_3.length; _i++) { - var match = matches_3[_i]; + for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) { + var match = matches_2[_i]; var kind = match.kind; if (kind < bestMatchKind) { bestMatchKind = kind; @@ -85605,7 +89214,7 @@ var ts; return; } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -85617,21 +89226,21 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 152 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -85643,7 +89252,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -85654,8 +89263,8 @@ var ts; } } break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var _d = node, name = _d.name, initializer = _d.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -85676,12 +89285,12 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: startNode(node); for (var _e = 0, _f = node.members; _e < _f.length; _e++) { var member = _f[_e]; @@ -85691,9 +89300,9 @@ var ts; } endNode(); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: startNode(node); for (var _g = 0, _h = node.members; _g < _h.length; _g++) { var member = _h[_g]; @@ -85701,18 +89310,18 @@ var ts; } endNode(); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 247 /* ExportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 158 /* IndexSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 232 /* TypeAliasDeclaration */: + case 250 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 159 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 235 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var special = ts.getSpecialPropertyAssignmentKind(node); switch (special) { case 1 /* ExportsProperty */: @@ -85733,7 +89342,7 @@ var ts; if (ts.hasJSDocNodes(node)) { ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -85790,12 +89399,12 @@ var ts; return false; } switch (a.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -85804,7 +89413,7 @@ var ts; // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { - return a.body.kind === b.body.kind && (a.body.kind !== 234 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 237 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -85834,7 +89443,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -85842,18 +89451,18 @@ var ts; return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName)); } switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: return getFunctionOrClassName(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var name = ts.getNameOfDeclaration(node); @@ -85864,16 +89473,16 @@ var ts; } } switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -85881,15 +89490,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return "new()"; - case 156 /* CallSignature */: + case 157 /* CallSignature */: return "()"; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "[]"; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -85901,7 +89510,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 209 /* VariableStatement */) { + if (parentNode && parentNode.kind === 212 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 71 /* Identifier */) { @@ -85930,24 +89539,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 269 /* SourceFile */: - case 232 /* TypeAliasDeclaration */: - case 288 /* JSDocTypedefTag */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 235 /* TypeAliasDeclaration */: + case 291 /* JSDocTypedefTag */: return true; - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 227 /* VariableDeclaration */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 230 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -85957,10 +89566,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -85969,7 +89578,7 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 227 /* VariableDeclaration */ && childKind !== 177 /* BindingElement */; + return childKind !== 230 /* VariableDeclaration */ && childKind !== 180 /* BindingElement */; }); } } @@ -86025,7 +89634,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -86036,18 +89645,16 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 234 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 237 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 145 /* ComputedPropertyName */; + return !member.name || member.name.kind === 146 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 269 /* SourceFile */ - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 272 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 227 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 230 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -86056,14 +89663,14 @@ var ts; if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 227 /* VariableDeclaration */) { + else if (node.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 195 /* BinaryExpression */ && + else if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 265 /* PropertyAssignment */ && node.parent.name) { + else if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } else if (ts.getModifierFlags(node) & 512 /* Default */) { @@ -86075,9 +89682,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: return true; default: return false; @@ -86087,6 +89694,164 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var OrganizeImports; + (function (OrganizeImports) { + function organizeImports(sourceFile, formatContext, host) { + // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) + // All of the old ImportDeclarations in the file, in syntactic order. + var oldImportDecls = sourceFile.statements.filter(ts.isImportDeclaration); + if (oldImportDecls.length === 0) { + return []; + } + var oldImportGroups = ts.group(oldImportDecls, function (importDecl) { return getExternalModuleName(importDecl.moduleSpecifier); }); + var sortedImportGroups = ts.stableSort(oldImportGroups, function (group1, group2) { + return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); + }); + var newImportDecls = ts.flatMap(sortedImportGroups, function (importGroup) { + return getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup)) + : importGroup; + }); + var changeTracker = ts.textChanges.ChangeTracker.fromContext({ host: host, formatContext: formatContext }); + // Delete or replace the first import. + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: ts.getNewLineOrDefaultFromHost(host, formatContext.options), + }); + } + // Delete any subsequent imports. + for (var i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + return changeTracker.getChanges(); + } + OrganizeImports.organizeImports = organizeImports; + function removeUnusedImports(oldImports) { + return oldImports; // TODO (https://github.com/Microsoft/TypeScript/issues/10020) + } + function getExternalModuleName(specifier) { + return ts.isStringLiteral(specifier) || ts.isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + /* @internal */ // Internal for testing + /** + * @param importGroup a list of ImportDeclarations, all with the same module name. + */ + function coalesceImports(importGroup) { + if (importGroup.length === 0) { + return importGroup; + } + var _a = getImportParts(importGroup), importWithoutClause = _a.importWithoutClause, defaultImports = _a.defaultImports, namespaceImports = _a.namespaceImports, namedImports = _a.namedImports; + var coalescedImports = []; + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + var defaultImportClause = defaultImports[0].parent; + coalescedImports.push(updateImportDeclarationAndClause(defaultImportClause, defaultImportClause.name, namespaceImports[0])); + return coalescedImports; + } + var sortedNamespaceImports = ts.stableSort(namespaceImports, function (n1, n2) { return compareIdentifiers(n1.name, n2.name); }); + for (var _i = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _i < sortedNamespaceImports_1.length; _i++) { + var namespaceImport = sortedNamespaceImports_1[_i]; + // Drop the name, if any + coalescedImports.push(updateImportDeclarationAndClause(namespaceImport.parent, /*name*/ undefined, namespaceImport)); + } + if (defaultImports.length === 0 && namedImports.length === 0) { + return coalescedImports; + } + var newDefaultImport; + var newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0]; + } + else { + for (var _b = 0, defaultImports_1 = defaultImports; _b < defaultImports_1.length; _b++) { + var defaultImport = defaultImports_1[_b]; + newImportSpecifiers.push(ts.createImportSpecifier(ts.createIdentifier("default"), defaultImport)); + } + } + newImportSpecifiers.push.apply(newImportSpecifiers, ts.flatMap(namedImports, function (n) { return n.elements; })); + var sortedImportSpecifiers = ts.stableSort(newImportSpecifiers, function (s1, s2) { + return compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name); + }); + var importClause = defaultImports.length > 0 + ? defaultImports[0].parent + : namedImports[0].parent; + var newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? ts.createNamedImports(sortedImportSpecifiers) + : ts.updateNamedImports(namedImports[0], sortedImportSpecifiers); + coalescedImports.push(updateImportDeclarationAndClause(importClause, newDefaultImport, newNamedImports)); + return coalescedImports; + function getImportParts(importGroup) { + var importWithoutClause; + var defaultImports = []; + var namespaceImports = []; + var namedImports = []; + for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) { + var importDeclaration = importGroup_1[_i]; + if (importDeclaration.importClause === undefined) { + // Only the first such import is interesting - the others are redundant. + // Note: Unfortunately, we will lose trivia that was on this node. + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + var _a = importDeclaration.importClause, name = _a.name, namedBindings = _a.namedBindings; + if (name) { + defaultImports.push(name); + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + namespaceImports.push(namedBindings); + } + else { + namedImports.push(namedBindings); + } + } + } + return { + importWithoutClause: importWithoutClause, + defaultImports: defaultImports, + namespaceImports: namespaceImports, + namedImports: namedImports, + }; + } + function compareIdentifiers(s1, s2) { + return ts.compareStringsCaseSensitive(s1.text, s2.text); + } + function updateImportDeclarationAndClause(importClause, name, namedBindings) { + var importDeclaration = importClause.parent; + return ts.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.updateImportClause(importClause, name, namedBindings), importDeclaration.moduleSpecifier); + } + } + OrganizeImports.coalesceImports = coalesceImports; + /* internal */ // Exported for testing + function compareModuleSpecifiers(m1, m2) { + var name1 = getExternalModuleName(m1); + var name2 = getExternalModuleName(m2); + return ts.compareBooleans(name1 === undefined, name2 === undefined) || + ts.compareBooleans(ts.isExternalModuleNameRelative(name1), ts.isExternalModuleNameRelative(name2)) || + ts.compareStringsCaseSensitive(name1, name2); + } + OrganizeImports.compareModuleSpecifiers = compareModuleSpecifiers; + })(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { @@ -86181,24 +89946,24 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(n)) { - return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 188 /* ArrowFunction */); + return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 191 /* ArrowFunction */); } // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 213 /* DoStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 264 /* CatchClause */: + case 216 /* DoStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 267 /* CatchClause */: return spanForNode(n.parent); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -86213,16 +89978,16 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile)); } - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanForNode(n.parent); - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 236 /* CaseBlock */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 239 /* CaseBlock */: return spanForNode(n); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 21 /* OpenBracketToken */); } function spanForObjectOrArrayLiteral(node, open) { @@ -86884,7 +90649,7 @@ var ts; if (token === 124 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 128 /* ModuleKeyword */) { + if (token === 129 /* ModuleKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { recordAmbientExternalModule(); @@ -86917,7 +90682,7 @@ var ts; else { if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -86948,7 +90713,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -86964,7 +90729,7 @@ var ts; token = nextToken(); if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -86994,7 +90759,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -87006,7 +90771,7 @@ var ts; } else if (token === 39 /* AsteriskToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -87031,7 +90796,7 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 132 /* RequireKeyword */) { + if (token === 133 /* RequireKeyword */) { token = nextToken(); if (token === 19 /* OpenParenToken */) { token = nextToken(); @@ -87088,7 +90853,7 @@ var ts; // import "mod"; // import d from "mod" // import {a as A } from "mod"; - // import * as NS from "mod" + // import * as NS from "mod" // import d, {a, b as B} from "mod" // import i = require("mod"); // import("mod"); @@ -87188,9 +90953,16 @@ var ts; symbol.parent.flags & 1536 /* Module */) { return undefined; } - var displayName = ts.stripQuotes(ts.getDeclaredName(typeChecker, symbol, node)); var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined; + if (!kind) { + return undefined; + } + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 146 /* ComputedPropertyName */) + ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) + : undefined; + var displayName = specifierName || typeChecker.symbolToString(symbol); + var fullDisplayName = specifierName || typeChecker.getFullyQualifiedName(symbol); + return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile); } } else if (node.kind === 9 /* StringLiteral */) { @@ -87289,17 +91061,13 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 182 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 185 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. var callExpression = argumentInfo.invocation; var expression = callExpression.expression; - var name = expression.kind === 71 /* Identifier */ - ? expression - : expression.kind === 180 /* PropertyAccessExpression */ - ? expression.name - : undefined; + var name = ts.isIdentifier(expression) ? expression : ts.isPropertyAccessExpression(expression) ? expression.name : undefined; if (!name || !name.escapedText) { return undefined; } @@ -87375,25 +91143,25 @@ var ts; var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } - else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 187 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0, sourceFile); } } - else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 206 /* TemplateSpan */ && node.parent.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 209 /* TemplateSpan */ && node.parent.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 16 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -87424,7 +91192,7 @@ var ts; function getArgumentIndex(argumentsList, node) { // The list we got back can include commas. In the presence of errors it may // also just have nodes without commas. For example "Foo(a b c)" will have 3 - // args without commas. We want to find what index we're at. So we count + // args without commas. We want to find what index we're at. So we count // forward until we hit ourselves, only incrementing the index if it isn't a // comma. // @@ -87434,9 +91202,8 @@ var ts; // that trailing comma in the list, and we'll have generated the appropriate // arg index. var argumentIndex = 0; - var listChildren = argumentsList.getChildren(); - for (var _i = 0, listChildren_1 = listChildren; _i < listChildren_1.length; _i++) { - var child = listChildren_1[_i]; + for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; if (child === node) { break; } @@ -87450,12 +91217,12 @@ var ts; // The argument count for a list is normally the number of non-comma children it has. // For example, if you have "Foo(a,b)" then there will be three children of the arg // list 'a' '' 'b'. So, in this case the arg count will be 2. However, there - // is a small subtlety. If you have "Foo(a,)", then the child list will just have + // is a small subtlety. If you have "Foo(a,)", then the child list will just have // 'a' ''. So, in the case where the last child is a comma, we increase the // arg count by one to compensate. // - // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then - // we'll have: 'a' '' '' + // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then + // we'll have: 'a' '' '' // That will give us 2 non-commas. We then add one for the last comma, giving us an // arg count of 3. var listChildren = argumentsList.getChildren(); @@ -87476,9 +91243,11 @@ var ts; // not enough to put us in the substitution expression; we should consider ourselves part of // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). // + // tslint:disable no-double-space // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` // ^ ^ ^ ^ ^ ^ ^ ^ ^ // Case: 1 1 3 2 1 3 2 2 1 + // tslint:enable no-double-space ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); if (ts.isTemplateLiteralKind(node.kind)) { if (ts.isInsideTemplateLiteral(node, position)) { @@ -87490,9 +91259,7 @@ var ts; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. - var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = ts.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; if (argumentIndex !== 0) { ts.Debug.assertLessThan(argumentIndex, argumentCount); } @@ -87525,12 +91292,11 @@ var ts; // Otherwise, we will not show signature help past the expression. // For example, // - // ` ${ 1 + 1 foo(10) - // | | - // + // ` ${ 1 + 1 foo(10) + // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -87539,7 +91305,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 269 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 272 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -87563,12 +91329,14 @@ var ts; ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); return children[indexOfOpenerToken + 1]; } + var signatureHelpNodeBuilderFlags = 8192 /* OmitParameterModifiers */ | 3112960 /* IgnoreErrors */; function createSignatureHelpItems(candidates, resolvedSignature, argumentListInfo, typeChecker) { var argumentCount = argumentListInfo.argumentCount, applicableSpan = argumentListInfo.argumentsSpan, invocation = argumentListInfo.invocation, argumentIndex = argumentListInfo.argumentIndex; var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */; var callTarget = ts.getInvokedExpression(invocation); var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, /*enclosingDeclaration*/ undefined, /*meaning*/ undefined); + var printer = ts.createPrinter({ removeComments: true }); var items = ts.map(candidates, function (candidateSignature) { var signatureHelpParameters; var prefixDisplayParts = []; @@ -87584,14 +91352,19 @@ var ts; signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : ts.emptyArray; suffixDisplayParts.push(ts.punctuationPart(29 /* GreaterThanToken */)); var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.thisParameter, candidateSignature.parameters, writer, invocation); + var thisParameter = candidateSignature.thisParameter ? [typeChecker.symbolToParameterDeclaration(candidateSignature.thisParameter, invocation, signatureHelpNodeBuilderFlags)] : []; + var params = ts.createNodeArray(thisParameter.concat(ts.map(candidateSignature.parameters, function (param) { return typeChecker.symbolToParameterDeclaration(param, invocation, signatureHelpNodeBuilderFlags); }))); + printer.writeList(1296 /* CallExpressionArguments */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); ts.addRange(suffixDisplayParts, parameterParts); } else { isVariadic = candidateSignature.hasRestParameter; var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); + if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { + var args = ts.createNodeArray(ts.map(candidateSignature.typeParameters, function (p) { return typeChecker.typeParameterToDeclaration(p, invocation); })); + printer.writeList(26896 /* TypeParameters */, args, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); + } }); ts.addRange(prefixDisplayParts, typeParameterParts); prefixDisplayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); @@ -87599,7 +91372,15 @@ var ts; suffixDisplayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); } var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); + writer.writePunctuation(":"); + writer.writeSpace(" "); + var predicate = typeChecker.getTypePredicateOfSignature(candidateSignature); + if (predicate) { + typeChecker.writeTypePredicate(predicate, invocation, /*flags*/ undefined, writer); + } + else { + typeChecker.writeType(typeChecker.getReturnTypeOfSignature(candidateSignature), invocation, /*flags*/ undefined, writer); + } }); ts.addRange(suffixDisplayParts, returnTypeParts); return { @@ -87620,7 +91401,8 @@ var ts; return { items: items, applicableSpan: applicableSpan, selectedItemIndex: selectedItemIndex, argumentIndex: argumentIndex, argumentCount: argumentCount }; function createSignatureHelpParameterForParameter(parameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); + var param = typeChecker.symbolToParameterDeclaration(parameter, invocation, signatureHelpNodeBuilderFlags); + printer.writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: parameter.name, @@ -87631,7 +91413,8 @@ var ts; } function createSignatureHelpParameterForTypeParameter(typeParameter) { var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); + var param = typeChecker.typeParameterToDeclaration(typeParameter, invocation); + printer.writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(invocation)), writer); }); return { name: typeParameter.symbol.name, @@ -87652,7 +91435,7 @@ var ts; function getSymbolKind(typeChecker, symbol, location) { var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -87735,9 +91518,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: return location.kind === 71 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -87746,13 +91531,17 @@ var ts; return "" /* unknown */; } function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 + var nodeModifiers = symbol && symbol.declarations && symbol.declarations.length > 0 ? ts.getNodeModifiers(symbol.declarations[0]) : "" /* none */; + var symbolModifiers = symbol && symbol.flags & 16777216 /* Optional */ ? + "optional" /* optionalModifier */ + : "" /* none */; + return nodeModifiers && symbolModifiers ? nodeModifiers + "," + symbolModifiers : nodeModifiers || symbolModifiers; } SymbolDisplay.getSymbolModifiers = getSymbolModifiers; // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location - function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { + function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, enclosingDeclaration, location, semanticMeaning, alias) { if (semanticMeaning === void 0) { semanticMeaning = ts.getMeaningFromLocation(location); } var displayParts = []; var documentation; @@ -87762,6 +91551,8 @@ var ts; var hasAddedSymbolInfo; var isThisExpression = location.kind === 99 /* ThisKeyword */ && ts.isExpression(location); var type; + var printer; + var documentationFromAlias; // Class at constructor site need to be shown as constructor apart from property,method, vars if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) { // If it is accessor they are allowed only if location is at name of the accessor @@ -87770,7 +91561,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 180 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 183 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -87791,7 +91582,7 @@ var ts; if (callExpressionLike) { var candidateSignatures = []; signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - var useConstructSignatures = callExpressionLike.kind === 183 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 186 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -87829,14 +91620,14 @@ var ts; displayParts.push(ts.punctuationPart(56 /* ColonToken */)); displayParts.push(ts.spacePart()); if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */) && type.symbol) { - ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */)); + ts.addRange(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, 4 /* AllowAnyNodeKind */ | 1 /* WriteTypeParametersOrArguments */)); displayParts.push(ts.lineBreakPart()); } if (useConstructSignatures) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - addSignatureDisplayParts(signature, allSignatures, 16 /* WriteArrowStyleSignature */); + addSignatureDisplayParts(signature, allSignatures, 262144 /* WriteArrowStyleSignature */); break; default: // Just signature @@ -87846,7 +91637,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 153 /* Constructor */)) { + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 154 /* Constructor */)) { // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -87854,21 +91645,21 @@ var ts; return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 153 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 154 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 153 /* Constructor */) { + if (functionDeclaration_1.kind === 154 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 156 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 157 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -87877,7 +91668,8 @@ var ts; } } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { - if (ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */)) { + addAliasPrefixIfNecessary(); + if (ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -87892,25 +91684,25 @@ var ts; writeTypeParametersOfSymbol(symbol, sourceFile); } if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(109 /* InterfaceKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); } if (symbolFlags & 524288 /* TypeAlias */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + prefixNextMeaning(); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 1024 /* InTypeAlias */)); + ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */)); } if (symbolFlags & 384 /* Enum */) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { displayParts.push(ts.keywordPart(76 /* ConstKeyword */)); displayParts.push(ts.spacePart()); @@ -87920,15 +91712,15 @@ var ts; addFullSymbolName(symbol); } if (symbolFlags & 1536 /* Module */) { - addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 234 /* ModuleDeclaration */); + prefixNextMeaning(); + var declaration = ts.getDeclarationOfKind(symbol, 237 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 71 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 129 /* NamespaceKeyword */ : 128 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 130 /* NamespaceKeyword */ : 129 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.textPart("type parameter")); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -87942,28 +91734,28 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 146 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 147 /* TypeParameter */); ts.Debug.assert(decl !== undefined); var declaration = decl.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 157 /* ConstructSignature */) { + if (declaration.kind === 158 /* ConstructSignature */) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 156 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 157 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 64 /* WriteTypeArgumentsOfSignature */)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 232 /* TypeAliasDeclaration */) { + else if (declaration.kind === 235 /* TypeAliasDeclaration */) { // Type alias type parameter // For example - // type list = T[]; // Both T will go through same code path + // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -87975,7 +91767,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 268 /* EnumMember */) { + if (declaration.kind === 271 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -87986,14 +91778,30 @@ var ts; } } if (symbolFlags & 2097152 /* Alias */) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); + if (!hasAddedSymbolInfo) { + var resolvedSymbol = typeChecker.getAliasedSymbol(symbol); + if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { + var resolvedNode = resolvedSymbol.declarations[0]; + var declarationName = ts.getNameOfDeclaration(resolvedNode); + if (declarationName) { + var isExternalModuleDeclaration = ts.isModuleWithStringLiteralName(resolvedNode) && + ts.hasModifier(resolvedNode, 2 /* Ambient */); + var shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; + var resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, resolvedSymbol, ts.getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, semanticMeaning, shouldUseAliasName ? symbol : resolvedSymbol); + displayParts.push.apply(displayParts, resolvedInfo.displayParts); + displayParts.push(ts.lineBreakPart()); + documentationFromAlias = resolvedInfo.documentation; + } + } + } switch (symbol.declarations[0].kind) { - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(129 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(130 /* NamespaceKeyword */)); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 58 /* EqualsToken */ : 79 /* DefaultKeyword */)); @@ -88004,13 +91812,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 238 /* ImportEqualsDeclaration */) { + if (declaration.kind === 241 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(132 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(133 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -88032,7 +91840,7 @@ var ts; if (symbolKind !== "" /* unknown */) { if (type) { if (isThisExpression) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); displayParts.push(ts.keywordPart(99 /* ThisKeyword */)); } else { @@ -88049,7 +91857,8 @@ var ts; // If the type is type parameter, format it specially if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); + var param = typeChecker.typeParameterToDeclaration(type, enclosingDeclaration); + getPrinter().writeNode(4 /* Unspecified */, param, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -88081,10 +91890,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 269 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 272 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 195 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 198 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -88100,26 +91909,45 @@ var ts; } } } + if (documentation.length === 0 && documentationFromAlias) { + documentation = documentationFromAlias; + } return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind, tags: tags }; - function addNewLineIfDisplayPartsExist() { + function getPrinter() { + if (!printer) { + printer = ts.createPrinter({ removeComments: true }); + } + return printer; + } + function prefixNextMeaning() { if (displayParts.length) { displayParts.push(ts.lineBreakPart()); } + addAliasPrefixIfNecessary(); + } + function addAliasPrefixIfNecessary() { + if (alias) { + pushTypePart("alias" /* alias */); + displayParts.push(ts.spacePart()); + } } function addInPrefix() { displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(92 /* InKeyword */)); displayParts.push(ts.spacePart()); } - function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); + function addFullSymbolName(symbolToDisplay, enclosingDeclaration) { + if (alias && symbolToDisplay === symbol) { + symbolToDisplay = alias; + } + var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbolToDisplay, enclosingDeclaration || sourceFile, /*meaning*/ undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */ | 4 /* AllowAnyNodeKind */); ts.addRange(displayParts, fullSymbolDisplayParts); } function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { - addNewLineIfDisplayPartsExist(); + prefixNextMeaning(); if (symbolKind) { pushTypePart(symbolKind); - if (!ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { + if (symbol && !ts.some(symbol.declarations, function (d) { return ts.isArrowFunction(d) || (ts.isFunctionExpression(d) || ts.isClassExpression(d)) && !d.name; })) { displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -88142,7 +91970,7 @@ var ts; } } function addSignatureDisplayParts(signature, allSignatures, flags) { - ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 64 /* WriteTypeArgumentsOfSignature */)); + ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); if (allSignatures.length > 1) { displayParts.push(ts.spacePart()); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); @@ -88157,7 +91985,8 @@ var ts; } function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); + var params = typeChecker.symbolToTypeParameterDeclarations(symbol, enclosingDeclaration); + getPrinter().writeList(26896 /* TypeParameters */, params, ts.getSourceFileOfNode(ts.getParseTreeNode(enclosingDeclaration)), writer); }); ts.addRange(displayParts, typeParameterParts); } @@ -88169,16 +91998,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 187 /* FunctionExpression */) { + if (declaration.kind === 190 /* FunctionExpression */) { return true; } - if (declaration.kind !== 227 /* VariableDeclaration */ && declaration.kind !== 229 /* FunctionDeclaration */) { + if (declaration.kind !== 230 /* VariableDeclaration */ && declaration.kind !== 232 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 269 /* SourceFile */ || parent.kind === 235 /* ModuleBlock */) { + if (parent.kind === 272 /* SourceFile */ || parent.kind === 238 /* ModuleBlock */) { return false; } } @@ -88488,10 +92317,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 257 /* JsxAttribute */: - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 260 /* JsxAttribute */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 71 /* Identifier */; } @@ -88668,17 +92497,21 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 143 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 144 /* LastToken */; token++) { allTokens.push(token); } - function anyTokenExcept(token) { - return { tokens: allTokens.filter(function (t) { return t !== token; }), isSpecific: false }; + function anyTokenExcept() { + var tokens = []; + for (var _i = 0; _i < arguments.length; _i++) { + tokens[_i] = arguments[_i]; + } + return { tokens: allTokens.filter(function (t) { return !tokens.some(function (t2) { return t2 === t; }); }), isSpecific: false }; } var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */])); - var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 143 /* LastKeyword */); + var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 144 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(27 /* FirstBinaryOperator */, 70 /* LastBinaryOperator */); - var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 143 /* OfKeyword */, 118 /* AsKeyword */, 126 /* IsKeyword */]; + var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 144 /* OfKeyword */, 118 /* AsKeyword */, 127 /* IsKeyword */]; var unaryPrefixOperators = [43 /* PlusPlusToken */, 44 /* MinusMinusToken */, 52 /* TildeToken */, 51 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 71 /* Identifier */, 19 /* OpenParenToken */, 21 /* OpenBracketToken */, @@ -88702,7 +92535,7 @@ var ts; // Leave comments alone rule("IgnoreBeforeComment", anyToken, comments, formatting.anyContext, 1 /* Ignore */), rule("IgnoreAfterLineComment", 2 /* SingleLineCommentTrivia */, anyToken, formatting.anyContext, 1 /* Ignore */), - rule("NoSpaceBeforeColon", anyToken, 56 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8 /* Delete */), + rule("NotSpaceBeforeColon", anyToken, 56 /* ColonToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext, isNotTypeAnnotationContext], 8 /* Delete */), rule("SpaceAfterColon", 56 /* ColonToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 2 /* Space */), rule("NoSpaceBeforeQuestionMark", anyToken, 55 /* QuestionToken */, [isNonJsxSameLineTokenContext, isNotBinaryOpContext], 8 /* Delete */), // insert space after '?' only when it is used in conditional operator @@ -88720,17 +92553,17 @@ var ts; rule("NoSpaceBeforeUnaryPostincrementOperator", unaryPostincrementExpressions, 43 /* PlusPlusToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceBeforeUnaryPostdecrementOperator", unaryPostdecrementExpressions, 44 /* MinusMinusToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // More unary operator special-casing. - // DevDiv 181814: Be careful when removing leading whitespace + // DevDiv 181814: Be careful when removing leading whitespace // around unary operators. Examples: - // 1 - -2 --X--> 1--2 - // a + ++b --X--> a+++b + // 1 - -2 --X--> 1--2 + // a + ++b --X--> a+++b rule("SpaceAfterPostincrementWhenFollowedByAdd", 43 /* PlusPlusToken */, 37 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterAddWhenFollowedByUnaryPlus", 37 /* PlusToken */, 37 /* PlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterAddWhenFollowedByPreincrement", 37 /* PlusToken */, 43 /* PlusPlusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterPostdecrementWhenFollowedBySubtract", 44 /* MinusMinusToken */, 38 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterSubtractWhenFollowedByUnaryMinus", 38 /* MinusToken */, 38 /* MinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), rule("SpaceAfterSubtractWhenFollowedByPredecrement", 38 /* MinusToken */, 44 /* MinusMinusToken */, [isNonJsxSameLineTokenContext, isBinaryOpContext], 2 /* Space */), - rule("NoSpaceAfterCloseBrace", 18 /* CloseBraceToken */, [22 /* CloseBracketToken */, 26 /* CommaToken */, 25 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterCloseBrace", 18 /* CloseBraceToken */, [26 /* CommaToken */, 25 /* SemicolonToken */], [isNonJsxSameLineTokenContext], 8 /* Delete */), // For functions and control block place } on a new line [multi-line rule] rule("NewLineBeforeCloseBraceInBlockContext", anyTokenIncludingMultilineComments, 18 /* CloseBraceToken */, [isMultilineBlockContext], 4 /* NewLine */), // Space/new line after }. @@ -88740,6 +92573,8 @@ var ts; rule("SpaceBetweenCloseBraceAndElse", 18 /* CloseBraceToken */, 82 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("SpaceBetweenCloseBraceAndWhile", 18 /* CloseBraceToken */, 106 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceBetweenEmptyBraceBrackets", 17 /* OpenBraceToken */, 18 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 8 /* Delete */), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule("SpaceAfterConditionalClosingParen", 20 /* CloseParenToken */, 21 /* OpenBracketToken */, [isControlDeclContext], 2 /* Space */), rule("NoSpaceBetweenFunctionKeywordAndStar", 89 /* FunctionKeyword */, 39 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 8 /* Delete */), rule("SpaceAfterStarInGeneratorDeclaration", 39 /* AsteriskToken */, [71 /* Identifier */, 19 /* OpenParenToken */], [isFunctionDeclarationOrFunctionExpressionContext], 2 /* Space */), rule("SpaceAfterFunctionInFuncDecl", 89 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 2 /* Space */), @@ -88749,7 +92584,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 135 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), + rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 136 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), rule("NoSpaceBetweenYieldKeywordAndStar", 116 /* YieldKeyword */, 39 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8 /* Delete */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [116 /* YieldKeyword */, 39 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2 /* Space */), rule("NoSpaceBetweenReturnAndSemicolon", 96 /* ReturnKeyword */, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -88773,7 +92608,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 58 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [128 /* ModuleKeyword */, 132 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterModuleImport", [129 /* ModuleKeyword */, 133 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 117 /* AbstractKeyword */, @@ -88787,19 +92622,20 @@ var ts; 108 /* ImplementsKeyword */, 91 /* ImportKeyword */, 109 /* InterfaceKeyword */, - 128 /* ModuleKeyword */, - 129 /* NamespaceKeyword */, + 129 /* ModuleKeyword */, + 130 /* NamespaceKeyword */, 112 /* PrivateKeyword */, 114 /* PublicKeyword */, 113 /* ProtectedKeyword */, - 131 /* ReadonlyKeyword */, - 135 /* SetKeyword */, + 132 /* ReadonlyKeyword */, + 136 /* SetKeyword */, 115 /* StaticKeyword */, - 138 /* TypeKeyword */, - 141 /* FromKeyword */, - 127 /* KeyOfKeyword */, + 139 /* TypeKeyword */, + 142 /* FromKeyword */, + 128 /* KeyOfKeyword */, + 126 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 141 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 142 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 9 /* StringLiteral */, 17 /* OpenBraceToken */, [isModuleDeclContext], 2 /* Space */), // Lambda expressions @@ -88817,7 +92653,7 @@ var ts; rule("NoSpaceBeforeCloseAngularBracket", anyToken, 29 /* GreaterThanToken */, [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8 /* Delete */), rule("NoSpaceAfterCloseAngularBracket", 29 /* GreaterThanToken */, [19 /* OpenParenToken */, 21 /* OpenBracketToken */, 29 /* GreaterThanToken */, 26 /* CommaToken */], [isNonJsxSameLineTokenContext, isTypeArgumentOrParameterOrAssertionContext], 8 /* Delete */), // decorators - rule("SpaceBeforeAt", anyToken, 57 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeAt", [20 /* CloseParenToken */, 71 /* Identifier */], 57 /* AtToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceAfterAt", 57 /* AtToken */, anyToken, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Insert space after @ in decorator rule("SpaceAfterDecorator", anyToken, [ @@ -88831,7 +92667,7 @@ var ts; 112 /* PrivateKeyword */, 113 /* ProtectedKeyword */, 125 /* GetKeyword */, - 135 /* SetKeyword */, + 136 /* SetKeyword */, 21 /* OpenBracketToken */, 39 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 2 /* Space */), @@ -88843,8 +92679,8 @@ var ts; // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses rule("SpaceAfterConstructor", 123 /* ConstructorKeyword */, 19 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceAfterConstructor", 123 /* ConstructorKeyword */, 19 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterConstructor"), isNonJsxSameLineTokenContext], 8 /* Delete */), - rule("SpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext, isNextTokenNotCloseBracket], 2 /* Space */), - rule("NoSpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementContext], 8 /* Delete */), + rule("SpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionEnabled("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNextTokenNotCloseBracket], 2 /* Space */), + rule("NoSpaceAfterComma", 26 /* CommaToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterCommaDelimiter"), isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext], 8 /* Delete */), // Insert space after function keyword for anonymous functions rule("SpaceAfterAnonymousFunctionKeyword", 89 /* FunctionKeyword */, 19 /* OpenParenToken */, [isOptionEnabled("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 2 /* Space */), rule("NoSpaceAfterAnonymousFunctionKeyword", 89 /* FunctionKeyword */, 19 /* OpenParenToken */, [isOptionDisabledOrUndefined("insertSpaceAfterFunctionKeywordForAnonymousFunctions"), isFunctionDeclContext], 8 /* Delete */), @@ -88899,8 +92735,10 @@ var ts; rule("NewLineBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionEnabled("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isBeforeMultilineBlockContext], 4 /* NewLine */, 1 /* CanDeleteNewLines */), rule("SpaceAfterTypeAssertion", 29 /* GreaterThanToken */, anyToken, [isOptionEnabled("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 2 /* Space */), rule("NoSpaceAfterTypeAssertion", 29 /* GreaterThanToken */, anyToken, [isOptionDisabledOrUndefined("insertSpaceAfterTypeAssertion"), isNonJsxSameLineTokenContext, isTypeAssertionContext], 8 /* Delete */), + rule("SpaceBeforeTypeAnnotation", anyToken, 56 /* ColonToken */, [isOptionEnabled("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 2 /* Space */), + rule("NoSpaceBeforeTypeAnnotation", anyToken, 56 /* ColonToken */, [isOptionDisabledOrUndefined("insertSpaceBeforeTypeAnnotation"), isNonJsxSameLineTokenContext, isTypeAnnotationContext], 8 /* Delete */), ]; - // These rules are lower in priority than user-configurable + // These rules are lower in priority than user-configurable. Rules earlier in this list have priority over rules later in the list. var lowPriorityCommonRules = [ // Space after keyword but not before ; or : or ? rule("NoSpaceBeforeSemicolon", anyToken, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -88908,13 +92746,15 @@ var ts; rule("SpaceBeforeOpenBraceInFunction", functionOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isFunctionDeclContext, isBeforeBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2 /* Space */, 1 /* CanDeleteNewLines */), rule("SpaceBeforeOpenBraceInTypeScriptDeclWithBlock", typeScriptOpenBraceLeftTokenRange, 17 /* OpenBraceToken */, [isOptionDisabledOrUndefinedOrTokensOnSameLine("placeOpenBraceOnNewLineForFunctions"), isTypeScriptDeclWithBlockContext, isNotFormatOnEnter, isSameLineTokenOrBeforeBlockContext], 2 /* Space */, 1 /* CanDeleteNewLines */), rule("NoSpaceBeforeComma", anyToken, 26 /* CommaToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), - // No space before and after indexer - rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + // No space before and after indexer `x[]` + rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */, 73 /* CaseKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterCloseBracket", 22 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 8 /* Delete */), rule("SpaceAfterSemicolon", 25 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), + // Remove extra space between for and await + rule("SpaceBetweenForAndAwaitKeyword", 88 /* ForKeyword */, 121 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] - rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementContext, isNotForContext], 2 /* Space */), + rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2 /* Space */), // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. rule("SpaceAfterTryFinally", [102 /* TryKeyword */, 87 /* FinallyKeyword */], 17 /* OpenBraceToken */, [isNonJsxSameLineTokenContext], 2 /* Space */), ]; @@ -88960,58 +92800,73 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 215 /* ForStatement */; + return context.contextNode.kind === 218 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 203 /* AsExpression */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 159 /* TypePredicate */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 170 /* ConditionalType */: + case 206 /* AsExpression */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 160 /* TypePredicate */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 177 /* BindingElement */: + case 180 /* BindingElement */: // equals in type X = ... - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: // equal in p = 0; - case 147 /* Parameter */: - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return context.currentTokenSpan.kind === 58 /* EqualsToken */ || context.nextTokenSpan.kind === 58 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return context.currentTokenSpan.kind === 92 /* InKeyword */ || context.nextTokenSpan.kind === 92 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 217 /* ForOfStatement */: - return context.currentTokenSpan.kind === 143 /* OfKeyword */ || context.nextTokenSpan.kind === 143 /* OfKeyword */; + case 220 /* ForOfStatement */: + return context.currentTokenSpan.kind === 144 /* OfKeyword */ || context.nextTokenSpan.kind === 144 /* OfKeyword */; } return false; } function isNotBinaryOpContext(context) { return !isBinaryOpContext(context); } + function isNotTypeAnnotationContext(context) { + return !isTypeAnnotationContext(context); + } + function isTypeAnnotationContext(context) { + var contextKind = context.contextNode.kind; + return contextKind === 151 /* PropertyDeclaration */ || + contextKind === 150 /* PropertySignature */ || + contextKind === 148 /* Parameter */ || + contextKind === 230 /* VariableDeclaration */ || + ts.isFunctionLikeKind(contextKind); + } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 196 /* ConditionalExpression */; + return context.contextNode.kind === 199 /* ConditionalExpression */ || + context.contextNode.kind === 170 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 175 /* ObjectBindingPattern */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 178 /* ObjectBindingPattern */ || + context.contextNode.kind === 176 /* MappedType */ || + isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration function isBeforeMultilineBlockContext(context) { @@ -89036,70 +92891,70 @@ var ts; return true; } switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 179 /* ObjectLiteralExpression */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 182 /* ObjectLiteralExpression */: + case 238 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 156 /* CallSignature */: - case 187 /* FunctionExpression */: - case 153 /* Constructor */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 190 /* FunctionExpression */: + case 154 /* Constructor */: + case 191 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 231 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one + case 234 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 229 /* FunctionDeclaration */ || context.contextNode.kind === 187 /* FunctionExpression */; + return context.contextNode.kind === 232 /* FunctionDeclaration */ || context.contextNode.kind === 190 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 164 /* TypeLiteral */: - case 234 /* ModuleDeclaration */: - case 245 /* ExportDeclaration */: - case 246 /* NamedExports */: - case 239 /* ImportDeclaration */: - case 242 /* NamedImports */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 165 /* TypeLiteral */: + case 237 /* ModuleDeclaration */: + case 248 /* ExportDeclaration */: + case 249 /* NamedExports */: + case 242 /* ImportDeclaration */: + case 245 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 230 /* ClassDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 264 /* CatchClause */: - case 235 /* ModuleBlock */: - case 222 /* SwitchStatement */: + case 233 /* ClassDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 267 /* CatchClause */: + case 238 /* ModuleBlock */: + case 225 /* SwitchStatement */: return true; - case 208 /* Block */: { + case 211 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 188 /* ArrowFunction */ && blockParent.kind !== 187 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 191 /* ArrowFunction */ && blockParent.kind !== 190 /* FunctionExpression */) { return true; } } @@ -89108,31 +92963,31 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 212 /* IfStatement */: - case 222 /* SwitchStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 225 /* TryStatement */: - case 213 /* DoStatement */: - case 221 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 224 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 264 /* CatchClause */: + case 267 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 179 /* ObjectLiteralExpression */; + return context.contextNode.kind === 182 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 182 /* CallExpression */; + return context.contextNode.kind === 185 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 183 /* NewExpression */; + return context.contextNode.kind === 186 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -89144,25 +92999,25 @@ var ts; return context.nextTokenSpan.kind !== 22 /* CloseBracketToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 188 /* ArrowFunction */; + return context.contextNode.kind === 191 /* ArrowFunction */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; } - function isNonJsxElementContext(context) { - return context.contextNode.kind !== 250 /* JsxElement */; + function isNonJsxElementOrFragmentContext(context) { + return context.contextNode.kind !== 253 /* JsxElement */ && context.contextNode.kind !== 257 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 260 /* JsxExpression */; + return context.contextNode.kind === 263 /* JsxExpression */ || context.contextNode.kind === 262 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 257 /* JsxAttribute */; + return context.nextTokenParent.kind === 260 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 257 /* JsxAttribute */; + return context.contextNode.kind === 260 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 251 /* JsxSelfClosingElement */; + return context.contextNode.kind === 254 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -89177,45 +93032,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 228 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 231 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 234 /* ModuleDeclaration */; + return context.contextNode.kind === 237 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 164 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 165 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 157 /* ConstructSignature */; + return context.contextNode.kind === 158 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 27 /* LessThanToken */ && token.kind !== 29 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 160 /* TypeReference */: - case 185 /* TypeAssertionExpression */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 161 /* TypeReference */: + case 188 /* TypeAssertionExpression */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -89226,16 +93081,16 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 185 /* TypeAssertionExpression */; + return context.contextNode.kind === 188 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 191 /* VoidExpression */; + return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 194 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 198 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 201 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 204 /* NonNullExpression */; + return context.contextNode.kind === 207 /* NonNullExpression */; } })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -89287,12 +93142,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 143 /* LastKeyword */ && column <= 143 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 144 /* LastKeyword */ && column <= 144 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 143 /* LastToken */ + 1; + var mapRowLength = 144 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; @@ -89474,17 +93329,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 235 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 269 /* SourceFile */: - case 208 /* Block */: - case 235 /* ModuleBlock */: + return body && body.kind === 238 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 272 /* SourceFile */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -89675,48 +93530,51 @@ var ts; return -1 /* Unknown */; } function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { - var indentation = inheritedIndentation; var delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; if (effectiveParentStartLine === startLine) { // if node is located on the same line with the parent // - inherit indentation from the parent // - push children if either parent of node itself has non-zero delta - indentation = startLine === lastIndentedLine - ? indentationOnLastIndentedLine - : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta); + return { + indentation: startLine === lastIndentedLine ? indentationOnLastIndentedLine : parentDynamicIndentation.getIndentation(), + delta: Math.min(options.indentSize, parentDynamicIndentation.getDelta(node) + delta) + }; } - else if (indentation === -1 /* Unknown */) { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); + else if (inheritedIndentation === -1 /* Unknown */) { + if (node.kind === 19 /* OpenParenToken */ && startLine === lastIndentedLine) { + // the is used for chaining methods formatting + // - we need to get the indentation on last line and the delta of parent + return { indentation: indentationOnLastIndentedLine, delta: parentDynamicIndentation.getDelta(node) }; + } + else if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { + return { indentation: parentDynamicIndentation.getIndentation(), delta: delta }; } else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node); + return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta: delta }; } } - return { - indentation: indentation, - delta: delta - }; + else { + return { indentation: inheritedIndentation, delta: delta }; + } } function getFirstNonDecoratorTokenOfNode(node) { if (node.modifiers && node.modifiers.length) { return node.modifiers[0].kind; } switch (node.kind) { - case 230 /* ClassDeclaration */: return 75 /* ClassKeyword */; - case 231 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; - case 229 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; - case 233 /* EnumDeclaration */: return 233 /* EnumDeclaration */; - case 154 /* GetAccessor */: return 125 /* GetKeyword */; - case 155 /* SetAccessor */: return 135 /* SetKeyword */; - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: return 75 /* ClassKeyword */; + case 234 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; + case 232 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; + case 236 /* EnumDeclaration */: return 236 /* EnumDeclaration */; + case 155 /* GetAccessor */: return 125 /* GetKeyword */; + case 156 /* SetAccessor */: return 136 /* SetKeyword */; + case 153 /* MethodDeclaration */: if (node.asteriskToken) { return 39 /* AsteriskToken */; } // falls through - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: return ts.getNameOfDeclaration(node).kind; } } @@ -89731,67 +93589,55 @@ var ts; case 18 /* CloseBraceToken */: case 22 /* CloseBracketToken */: case 20 /* CloseParenToken */: - return indentation + getEffectiveDelta(delta, container); + return indentation + getDelta(container); } return tokenIndentation !== -1 /* Unknown */ ? tokenIndentation : indentation; }, getIndentationForToken: function (line, kind, container) { - if (nodeStartLine !== line && node.decorators) { - if (kind === getFirstNonDecoratorTokenOfNode(node)) { - // if this token is the first token following the list of decorators, we do not need to indent - return indentation; - } - } - switch (kind) { - // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent - case 17 /* OpenBraceToken */: - case 18 /* CloseBraceToken */: - case 19 /* OpenParenToken */: - case 20 /* CloseParenToken */: - case 82 /* ElseKeyword */: - case 106 /* WhileKeyword */: - case 57 /* AtToken */: - return indentation; - case 41 /* SlashToken */: - case 29 /* GreaterThanToken */: { - if (container.kind === 252 /* JsxOpeningElement */ || - container.kind === 253 /* JsxClosingElement */ || - container.kind === 251 /* JsxSelfClosingElement */) { - return indentation; - } - break; - } - case 21 /* OpenBracketToken */: - case 22 /* CloseBracketToken */: { - if (container.kind !== 173 /* MappedType */) { - return indentation; - } - break; - } - } - // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + getEffectiveDelta(delta, container) : indentation; + return shouldAddDelta(line, kind, container) ? indentation + getDelta(container) : indentation; }, getIndentation: function () { return indentation; }, - getDelta: function (child) { return getEffectiveDelta(delta, child); }, + getDelta: getDelta, recomputeIndentation: function (lineAdded) { if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent, node)) { - if (lineAdded) { - indentation += options.indentSize; - } - else { - indentation -= options.indentSize; - } - if (formatting.SmartIndenter.shouldIndentChildNode(node)) { - delta = options.indentSize; - } - else { - delta = 0; - } + indentation += lineAdded ? options.indentSize : -options.indentSize; + delta = formatting.SmartIndenter.shouldIndentChildNode(node) ? options.indentSize : 0; } } }; - function getEffectiveDelta(delta, child) { + function shouldAddDelta(line, kind, container) { + switch (kind) { + // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent + case 17 /* OpenBraceToken */: + case 18 /* CloseBraceToken */: + case 19 /* OpenParenToken */: + case 20 /* CloseParenToken */: + case 82 /* ElseKeyword */: + case 106 /* WhileKeyword */: + case 57 /* AtToken */: + return false; + case 41 /* SlashToken */: + case 29 /* GreaterThanToken */: + switch (container.kind) { + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: + return false; + } + break; + case 21 /* OpenBracketToken */: + case 22 /* CloseBracketToken */: + if (container.kind !== 176 /* MappedType */) { + return false; + } + break; + } + // if token line equals to the line of containing node (this is a first token in the node) - use node indentation + return nodeStartLine !== line + // if this token is the first token following the list of decorators, we do not need to indent + && !(node.decorators && kind === getFirstNonDecoratorTokenOfNode(node)); + } + function getDelta(child) { // Delta value should be zero when the node explicitly prevents indentation of the child node return formatting.SmartIndenter.nodeWillIndentChild(node, child, /*indentByDefault*/ true) ? delta : 0; } @@ -89814,7 +93660,7 @@ var ts; // context node is set to parent of the token after processing every token var childContextNode = contextNode; // if there are any tokens that logically belong to node and interleave child nodes - // such tokens will be consumed in processChildNode for for the child that follows them + // such tokens will be consumed in processChildNode for the child that follows them ts.forEachChild(node, function (child) { processChildNode(child, /*inheritedIndentation*/ -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, /*isListItem*/ false); }, function (nodes) { @@ -89873,7 +93719,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 148 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 149 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 10 /* JsxText */) { @@ -89881,7 +93727,7 @@ var ts; indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false); } childContextNode = node; - if (isFirstListItem && parent.kind === 178 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 181 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -90036,23 +93882,25 @@ var ts; var trimTrailingWhitespaces; var lineAction = 0 /* None */; if (rule) { - applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); - if (rule.action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { - lineAction = 2 /* LineRemoved */; - // Handle the case where the next line is moved to be the end of this line. - // In this case we don't indent the next line in the next pass. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false); - } - } - else if (rule.action & 4 /* NewLine */ && currentStartLine === previousStartLine) { - lineAction = 1 /* LineAdded */; - // Handle the case where token2 is moved to the new line. - // In this case we indent token2 in the next pass but we set - // sameLineIndent flag to notify the indenter that the indentation is within the line. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true); - } + lineAction = applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); + switch (lineAction) { + case 2 /* LineRemoved */: + // Handle the case where the next line is moved to be the end of this line. + // In this case we don't indent the next line in the next pass. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false); + } + break; + case 1 /* LineAdded */: + // Handle the case where token2 is moved to the new line. + // In this case we indent token2 in the next pass but we set + // sameLineIndent flag to notify the indenter that the indentation is within the line. + if (currentParent.getStart(sourceFile) === currentItem.pos) { + dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true); + } + break; + default: + ts.Debug.assert(lineAction === 0 /* None */); } // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line trimTrailingWhitespaces = !(rule.action & 8 /* Delete */) && rule.flags !== 1 /* CanDeleteNewLines */; @@ -90186,28 +94034,27 @@ var ts; var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); } - function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; - } function recordDelete(start, len) { if (len) { - edits.push(newTextChange(start, len, "")); + edits.push(ts.createTextChangeFromStartLength(start, len, "")); } } function recordReplace(start, len, newText) { if (len || newText) { - edits.push(newTextChange(start, len, newText)); + edits.push(ts.createTextChangeFromStartLength(start, len, newText)); } } function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { + var onLaterLine = currentStartLine !== previousStartLine; switch (rule.action) { case 1 /* Ignore */: // no action required - return; + return 0 /* None */; case 8 /* Delete */: if (previousRange.end !== currentRange.pos) { // delete characters starting from t1.end up to t2.pos exclusive recordDelete(previousRange.end, currentRange.pos - previousRange.end); + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } break; case 4 /* NewLine */: @@ -90215,25 +94062,27 @@ var ts; // if line1 and line2 are on subsequent lines then no edits are required - ok to exit // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; + return 0 /* None */; } // edit should not be applied if we have one line feed between elements var lineDelta = currentStartLine - previousStartLine; if (lineDelta !== 1) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.newLineCharacter); + return onLaterLine ? 0 /* None */ : 1 /* LineAdded */; } break; case 2 /* Space */: // exit early if we on different lines and rule cannot change number of newlines if (rule.flags !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; + return 0 /* None */; } var posDelta = currentRange.pos - previousRange.end; if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); + return onLaterLine ? 2 /* LineRemoved */ : 0 /* None */; } - break; } + return 0 /* None */; } } var LineAction; @@ -90246,7 +94095,7 @@ var ts; * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. */ function getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine, precedingToken, // tslint:disable-line:no-null-keyword - tokenAtPosition, predicate) { + tokenAtPosition, predicate) { if (tokenAtPosition === void 0) { tokenAtPosition = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); } var tokenStart = tokenAtPosition.getStart(sourceFile); if (tokenStart <= position && position < tokenAtPosition.getEnd()) { @@ -90289,12 +94138,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 191 /* ArrowFunction */: if (node.typeParameters === list) { return 27 /* LessThanToken */; } @@ -90302,8 +94151,8 @@ var ts; return 19 /* OpenParenToken */; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -90311,7 +94160,7 @@ var ts; return 19 /* OpenParenToken */; } break; - case 160 /* TypeReference */: + case 161 /* TypeReference */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -90345,12 +94194,12 @@ var ts; internedTabsIndentation = []; } if (internedTabsIndentation[tabs] === undefined) { - internedTabsIndentation[tabs] = tabString = repeat("\t", tabs); + internedTabsIndentation[tabs] = tabString = ts.repeatString("\t", tabs); } else { tabString = internedTabsIndentation[tabs]; } - return spaces ? tabString + repeat(" ", spaces) : tabString; + return spaces ? tabString + ts.repeatString(" ", spaces) : tabString; } else { var spacesString = void 0; @@ -90360,20 +94209,13 @@ var ts; internedSpacesIndentation = []; } if (internedSpacesIndentation[quotient] === undefined) { - spacesString = repeat(" ", options.indentSize * quotient); + spacesString = ts.repeatString(" ", options.indentSize * quotient); internedSpacesIndentation[quotient] = spacesString; } else { spacesString = internedSpacesIndentation[quotient]; } - return remainder ? spacesString + repeat(" ", remainder) : spacesString; - } - function repeat(value, count) { - var s = ""; - for (var i = 0; i < count; i++) { - s += value; - } - return s; + return remainder ? spacesString + ts.repeatString(" ", remainder) : spacesString; } } formatting.getIndentationString = getIndentationString; @@ -90435,7 +94277,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 195 /* BinaryExpression */) { + if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 198 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -90591,7 +94433,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 269 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 272 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -90639,7 +94481,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 212 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 215 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 82 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -90654,37 +94496,37 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.parent.properties; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return node.parent.elements; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 153 /* Constructor */: - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: { + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 154 /* Constructor */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); - case 183 /* NewExpression */: - case 182 /* CallExpression */: { + case 186 /* NewExpression */: + case 185 /* CallExpression */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } @@ -90693,11 +94535,13 @@ var ts; SmartIndenter.getContainingList = getContainingList; function getActualIndentationForListItem(node, sourceFile, options) { var containingList = getContainingList(node, sourceFile); - return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; - function getActualIndentationFromList(list) { - var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1 /* Unknown */; + if (containingList) { + var index = containingList.indexOf(node); + if (index !== -1) { + return deriveActualIndentationFromList(containingList, index, sourceFile, options); + } } + return -1 /* Unknown */; } function getLineIndentationWhenExpressionIsInMultiLine(node, sourceFile, options) { // actual indentation should not be used when: @@ -90722,10 +94566,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: node = node.expression; break; default: @@ -90789,51 +94633,52 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 211 /* ExpressionStatement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 178 /* ArrayLiteralExpression */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 173 /* MappedType */: - case 166 /* TupleType */: - case 236 /* CaseBlock */: - case 262 /* DefaultClause */: - case 261 /* CaseClause */: - case 186 /* ParenthesizedExpression */: - case 180 /* PropertyAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 209 /* VariableStatement */: - case 227 /* VariableDeclaration */: - case 244 /* ExportAssignment */: - case 220 /* ReturnStatement */: - case 196 /* ConditionalExpression */: - case 176 /* ArrayBindingPattern */: - case 175 /* ObjectBindingPattern */: - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 260 /* JsxExpression */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 147 /* Parameter */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 169 /* ParenthesizedType */: - case 184 /* TaggedTemplateExpression */: - case 192 /* AwaitExpression */: - case 246 /* NamedExports */: - case 242 /* NamedImports */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: + case 214 /* ExpressionStatement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 181 /* ArrayLiteralExpression */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 176 /* MappedType */: + case 167 /* TupleType */: + case 239 /* CaseBlock */: + case 265 /* DefaultClause */: + case 264 /* CaseClause */: + case 189 /* ParenthesizedExpression */: + case 183 /* PropertyAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 212 /* VariableStatement */: + case 230 /* VariableDeclaration */: + case 247 /* ExportAssignment */: + case 223 /* ReturnStatement */: + case 199 /* ConditionalExpression */: + case 179 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: + case 254 /* JsxSelfClosingElement */: + case 263 /* JsxExpression */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 148 /* Parameter */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 172 /* ParenthesizedType */: + case 187 /* TaggedTemplateExpression */: + case 195 /* AwaitExpression */: + case 249 /* NamedExports */: + case 245 /* NamedImports */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: return true; } return false; @@ -90841,27 +94686,29 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return childKind !== 208 /* Block */; - case 245 /* ExportDeclaration */: - return childKind !== 246 /* NamedExports */; - case 239 /* ImportDeclaration */: - return childKind !== 240 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 242 /* NamedImports */); - case 250 /* JsxElement */: - return childKind !== 253 /* JsxClosingElement */; + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return childKind !== 211 /* Block */; + case 248 /* ExportDeclaration */: + return childKind !== 249 /* NamedExports */; + case 242 /* ImportDeclaration */: + return childKind !== 243 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 245 /* NamedImports */); + case 253 /* JsxElement */: + return childKind !== 256 /* JsxClosingElement */; + case 257 /* JsxFragment */: + return childKind !== 259 /* JsxClosingFragment */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -90869,29 +94716,29 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: switch (parent.kind) { - case 208 /* Block */: + case 211 /* Block */: var grandParent = parent.parent; switch (grandParent && grandParent.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // We may want to write inner functions after this. return false; default: return true; } - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: return true; default: throw ts.Debug.fail(); } - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return true; default: return false; @@ -90914,7 +94761,7 @@ var ts; var ts; (function (ts) { var textChanges; - (function (textChanges) { + (function (textChanges_1) { /** * Currently for simplicity we store recovered positions on the node itself. * It can be changed to side-table later if we decide that current design is too invasive. @@ -90941,7 +94788,7 @@ var ts; (function (Position) { Position[Position["FullStart"] = 0] = "FullStart"; Position[Position["Start"] = 1] = "Start"; - })(Position = textChanges.Position || (textChanges.Position = {})); + })(Position = textChanges_1.Position || (textChanges_1.Position = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); } @@ -90957,6 +94804,10 @@ var ts; } return false; } + textChanges_1.useNonAdjustedPositions = { + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; var ChangeKind; (function (ChangeKind) { ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; @@ -90966,10 +94817,10 @@ var ts; function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } - textChanges.getSeparatorCharacter = getSeparatorCharacter; + textChanges_1.getSeparatorCharacter = getSeparatorCharacter; function getAdjustedStartPosition(sourceFile, node, options, position) { if (options.useNonAdjustedStartPosition) { - return node.getFullStart(); + return node.getStart(); } var fullStart = node.getFullStart(); var start = node.getStart(sourceFile); @@ -90996,7 +94847,7 @@ var ts; adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } - textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + textChanges_1.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); @@ -91007,12 +94858,12 @@ var ts; ? newEnd : end; } - textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + textChanges_1.getAdjustedEndPosition = getAdjustedEndPosition; /** * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 179 /* ObjectLiteralExpression */)); + return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 182 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -91022,15 +94873,18 @@ var ts; return s; } var ChangeTracker = /** @class */ (function () { - function ChangeTracker(newLine, formatContext, validator) { - this.newLine = newLine; + /** Public for tests only. Other callers should use `ChangeTracker.with`. */ + function ChangeTracker(newLineCharacter, formatContext, validator) { + this.newLineCharacter = newLineCharacter; this.formatContext = formatContext; this.validator = validator; this.changes = []; - this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); + this.deletedNodesInLists = []; // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. + // Map from class id to nodes to insert at the start + this.nodesInsertedAtClassStarts = ts.createMap(); } ChangeTracker.fromContext = function (context) { - return new ChangeTracker(context.newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.formatContext); + return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); }; ChangeTracker.with = function (context, cb) { var tracker = ChangeTracker.fromContext(context); @@ -91045,14 +94899,14 @@ var ts; if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, node, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeRange = function (sourceFile, startNode, endNode, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.FullStart); var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: { pos: startPosition, end: endPosition } }); + this.deleteRange(sourceFile, { pos: startPosition, end: endPosition }); return this; }; ChangeTracker.prototype.deleteNodeInList = function (sourceFile, node) { @@ -91069,6 +94923,9 @@ var ts; this.deleteNode(sourceFile, node); return this; } + var id = ts.getNodeId(node); + ts.Debug.assert(!this.deletedNodesInLists[id], "Deleting a node twice"); + this.deletedNodesInLists[id] = true; if (index !== containingList.length - 1) { var nextToken = ts.getTokenAtPosition(sourceFile, node.end, /*includeJsDocComment*/ false); if (nextToken && isSeparator(node, nextToken)) { @@ -91082,84 +94939,138 @@ var ts; } } else { - var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false); - if (previousToken && isSeparator(node, previousToken)) { - this.deleteNodeRange(sourceFile, previousToken, node); + var prev = containingList[index - 1]; + if (this.deletedNodesInLists[ts.getNodeId(prev)]) { + var pos = ts.skipTrivia(sourceFile.text, getAdjustedStartPosition(sourceFile, node, {}, Position.FullStart), /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); + var end = getAdjustedEndPosition(sourceFile, node, {}); + this.deleteRange(sourceFile, { pos: pos, end: end }); + } + else { + var previousToken = ts.getTokenAtPosition(sourceFile, containingList[index - 1].end, /*includeJsDocComment*/ false); + if (previousToken && isSeparator(node, previousToken)) { + this.deleteNodeRange(sourceFile, previousToken, node); + } } } return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; - ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithSingleNode, - sourceFile: sourceFile, - options: options, - node: newNode, - range: { pos: startPosition, end: endPosition } - }); - return this; - }; - ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithMultipleNodes, - sourceFile: sourceFile, - options: options, - nodes: newNodes, - range: { pos: startPosition, end: endPosition } - }); + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); return this; }; ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, oldNodes[0], options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, ts.lastOrUndefined(oldNodes), options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); - }; - ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { - return this.replaceWithMultiple(sourceFile, range.pos, range.end, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithMultiple(sourceFile, startPosition, endPosition, newNodes, options); + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; - ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, options) { - if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, before, options, Position.Start); - return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, options); + ChangeTracker.prototype.insertNodeAtTopOfFile = function (sourceFile, newNode, blankLineBetween) { + var pos = getInsertionPositionAtSourceFileTop(sourceFile); + this.insertNodeAt(sourceFile, pos, newNode, { + prefix: pos === 0 ? undefined : this.newLineCharacter, + suffix: (ts.isLineBreak(sourceFile.text.charCodeAt(pos)) ? "" : this.newLineCharacter) + (blankLineBetween ? this.newLineCharacter : ""), + }); }; - ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode, options) { - if (options === void 0) { options = {}; } - if ((ts.isStatementButNotDeclaration(after)) || - after.kind === 150 /* PropertyDeclaration */ || - after.kind === 149 /* PropertySignature */ || - after.kind === 151 /* MethodSignature */) { + ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { + if (blankLineBetween === void 0) { blankLineBetween = false; } + var pos = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); + return this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); + }; + ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { + var pos = before.getStart(sourceFile); + this.replaceRange(sourceFile, { pos: pos, end: pos }, ts.createToken(modifier), { suffix: " " }); + }; + ChangeTracker.prototype.getOptionsForInsertNodeBefore = function (before, doubleNewlines) { + if (ts.isStatement(before) || ts.isClassElement(before)) { + return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(before)) { + return { suffix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it + }; + ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) { + var firstStatement = ts.firstOrUndefined(ctr.body.statements); + if (!firstStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, [newStatement].concat(ctr.body.statements)); + } + else { + this.insertNodeBefore(sourceFile, firstStatement, newStatement); + } + }; + ChangeTracker.prototype.insertNodeAtConstructorEnd = function (sourceFile, ctr, newStatement) { + var lastStatement = ts.lastOrUndefined(ctr.body.statements); + if (!lastStatement || !ctr.body.multiLine) { + this.replaceConstructorBody(sourceFile, ctr, ctr.body.statements.concat([newStatement])); + } + else { + this.insertNodeAfter(sourceFile, lastStatement, newStatement); + } + }; + ChangeTracker.prototype.replaceConstructorBody = function (sourceFile, ctr, statements) { + this.replaceNode(sourceFile, ctr.body, ts.createBlock(statements, /*multiLine*/ true), { useNonAdjustedEndPosition: true }); + }; + ChangeTracker.prototype.insertNodeAtEndOfScope = function (sourceFile, scope, newNode) { + var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); + this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, { + prefix: ts.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, + suffix: this.newLineCharacter + }); + }; + ChangeTracker.prototype.insertNodeAtClassStart = function (sourceFile, cls, newElement) { + var firstMember = ts.firstOrUndefined(cls.members); + if (!firstMember) { + var id = ts.getNodeId(cls).toString(); + var newMembers = this.nodesInsertedAtClassStarts.get(id); + if (newMembers) { + ts.Debug.assert(newMembers.sourceFile === sourceFile && newMembers.cls === cls); + newMembers.members.push(newElement); + } + else { + this.nodesInsertedAtClassStarts.set(id, { sourceFile: sourceFile, cls: cls, members: [newElement] }); + } + } + else { + this.insertNodeBefore(sourceFile, firstMember, newElement); + } + }; + ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) { + if (ts.isStatementButNotDeclaration(after) || + after.kind === 151 /* PropertyDeclaration */ || + after.kind === 150 /* PropertySignature */ || + after.kind === 152 /* MethodSignature */) { // check if previous statement ends with semicolon // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { @@ -91172,8 +95083,20 @@ var ts; }); } } - var endPosition = getAdjustedEndPosition(sourceFile, after, options); - return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, options); + var endPosition = getAdjustedEndPosition(sourceFile, after, {}); + return this.replaceRange(sourceFile, { pos: endPosition, end: endPosition }, newNode, this.getInsertNodeAfterOptions(after)); + }; + ChangeTracker.prototype.getInsertNodeAfterOptions = function (node) { + if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) { + return { prefix: this.newLineCharacter, suffix: this.newLineCharacter }; + } + else if (ts.isStatement(node) || ts.isClassElement(node) || ts.isTypeElement(node)) { + return { suffix: this.newLineCharacter }; + } + else if (ts.isVariableDeclaration(node)) { + return { prefix: ", " }; + } + throw ts.Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it }; /** * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, @@ -91314,36 +95237,26 @@ var ts; } return this; }; + ChangeTracker.prototype.finishInsertNodeAtClassStart = function () { + var _this = this; + this.nodesInsertedAtClassStarts.forEach(function (_a) { + var sourceFile = _a.sourceFile, cls = _a.cls, members = _a.members; + var newCls = cls.kind === 233 /* ClassDeclaration */ + ? ts.updateClassDeclaration(cls, cls.decorators, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members) + : ts.updateClassExpression(cls, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members); + _this.replaceNode(sourceFile, cls, newCls, { useNonAdjustedEndPosition: true }); + }); + }; ChangeTracker.prototype.getChanges = function () { var _this = this; - var changesPerFile = ts.createMap(); - // group changes per file - for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { - var c = _a[_i]; - var changesInFile = changesPerFile.get(c.sourceFile.path); - if (!changesInFile) { - changesPerFile.set(c.sourceFile.path, changesInFile = []); - } - changesInFile.push(c); - } - // convert changes - var fileChangesList = []; - changesPerFile.forEach(function (changesInFile) { + this.finishInsertNodeAtClassStart(); + return ts.group(this.changes, function (c) { return c.sourceFile.path; }).map(function (changesInFile) { var sourceFile = changesInFile[0].sourceFile; - var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; - for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { - var c = _a[_i]; - fileTextChanges.textChanges.push({ - span: _this.computeSpan(c, sourceFile), - newText: _this.computeNewText(c, sourceFile) - }); - } - fileChangesList.push(fileTextChanges); + var textChanges = ChangeTracker.normalize(changesInFile).map(function (c) { + return ts.createTextChange(ts.createTextSpanFromRange(c.range), _this.computeNewText(c, sourceFile)); + }); + return { fileName: sourceFile.fileName, textChanges: textChanges }; }); - return fileChangesList; - }; - ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { - return ts.createTextSpanFromBounds(change.range.pos, change.range.end); }; ChangeTracker.prototype.computeNewText = function (change, sourceFile) { var _this = this; @@ -91356,8 +95269,14 @@ var ts; var pos = change.range.pos; var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); - text = parts.join(change.options.nodeSeparator); + var lastIndex_1 = change.nodes.length - 1; + var parts = change.nodes.map(function (n, index) { + var formatted = _this.getFormattedTextOfNode(n, sourceFile, pos, options); + return index === lastIndex_1 || ts.endsWith(formatted, _this.newLineCharacter) + ? formatted + : (formatted + _this.newLineCharacter); + }); + text = parts.join(""); } else { ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); @@ -91368,7 +95287,7 @@ var ts; return (options.prefix || "") + text + (options.suffix || ""); }; ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { - var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); + var nonformattedText = getNonformattedText(node, sourceFile, this.newLineCharacter); if (this.validator) { this.validator(nonformattedText); } @@ -91397,11 +95316,10 @@ var ts; }; return ChangeTracker; }()); - textChanges.ChangeTracker = ChangeTracker; + textChanges_1.ChangeTracker = ChangeTracker; function getNonformattedText(node, sourceFile, newLine) { - var options = { newLine: newLine, target: sourceFile && sourceFile.languageVersion }; - var writer = new Writer(ts.getNewLineCharacter(options)); - var printer = ts.createPrinter(options, writer); + var writer = new Writer(newLine); + var printer = ts.createPrinter({ newLine: newLine === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */ }, writer); printer.writeNode(4 /* Unspecified */, node, sourceFile, writer); return { text: writer.getText(), node: assignPositionsToNode(node) }; } @@ -91422,7 +95340,7 @@ var ts; } return text; } - textChanges.applyChanges = applyChanges; + textChanges_1.applyChanges = applyChanges; function isTrivia(s) { return ts.skipTrivia(s, 0) === s.length; } @@ -91495,6 +95413,38 @@ var ts; this.writer.write(s); this.setLastNonTriviaPosition(s, /*force*/ false); }; + Writer.prototype.writeKeyword = function (s) { + this.writer.writeKeyword(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeOperator = function (s) { + this.writer.writeOperator(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writePunctuation = function (s) { + this.writer.writePunctuation(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeParameter = function (s) { + this.writer.writeParameter(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeProperty = function (s) { + this.writer.writeProperty(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeSpace = function (s) { + this.writer.writeSpace(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeStringLiteral = function (s) { + this.writer.writeStringLiteral(s); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; + Writer.prototype.writeSymbol = function (s, sym) { + this.writer.writeSymbol(s, sym); + this.setLastNonTriviaPosition(s, /*force*/ false); + }; Writer.prototype.writeTextOfNode = function (text, node) { this.writer.writeTextOfNode(text, node); }; @@ -91533,12 +95483,53 @@ var ts; Writer.prototype.isAtStartOfLine = function () { return this.writer.isAtStartOfLine(); }; - Writer.prototype.reset = function () { - this.writer.reset(); + Writer.prototype.clear = function () { + this.writer.clear(); this.lastNonTriviaPosition = 0; }; return Writer; }()); + function getInsertionPositionAtSourceFileTop(_a) { + var text = _a.text; + var shebang = ts.getShebang(text); + var position = 0; + if (shebang !== undefined) { + position = shebang.length; + advancePastLineBreak(); + } + // For a source file, it is possible there are detached comments we should not skip + var ranges = ts.getLeadingCommentRanges(text, position); + if (!ranges) + return position; + // However we should still skip a pinned comment at the top + if (ranges.length && ranges[0].kind === 3 /* MultiLineCommentTrivia */ && ts.isPinnedComment(text, ranges[0])) { + position = ranges[0].end; + advancePastLineBreak(); + ranges = ranges.slice(1); + } + // As well as any triple slash references + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + if (range.kind === 2 /* SingleLineCommentTrivia */ && ts.isRecognizedTripleSlashComment(text, range.pos, range.end)) { + position = range.end; + advancePastLineBreak(); + continue; + } + break; + } + return position; + function advancePastLineBreak() { + if (position < text.length) { + var charCode = text.charCodeAt(position); + if (ts.isLineBreak(charCode)) { + position++; + if (position < text.length && charCode === 13 /* carriageReturn */ && text.charCodeAt(position) === 10 /* lineFeed */) { + position++; + } + } + } + } + } })(textChanges = ts.textChanges || (ts.textChanges = {})); })(ts || (ts = {})); /* @internal */ @@ -91546,24 +95537,33 @@ var ts; (function (ts) { var codefix; (function (codefix) { - var codeFixes = []; - function registerCodeFix(codeFix) { - ts.forEach(codeFix.errorCodes, function (error) { - var fixes = codeFixes[error]; - if (!fixes) { - fixes = []; - codeFixes[error] = fixes; + var codeFixRegistrations = []; + var fixIdToRegistration = ts.createMap(); + function registerCodeFix(reg) { + for (var _i = 0, _a = reg.errorCodes; _i < _a.length; _i++) { + var error = _a[_i]; + var registrations = codeFixRegistrations[error]; + if (!registrations) { + registrations = []; + codeFixRegistrations[error] = registrations; } - fixes.push(codeFix); - }); + registrations.push(reg); + } + if (reg.fixIds) { + for (var _b = 0, _c = reg.fixIds; _b < _c.length; _b++) { + var fixId = _c[_b]; + ts.Debug.assert(!fixIdToRegistration.has(fixId)); + fixIdToRegistration.set(fixId, reg); + } + } } codefix.registerCodeFix = registerCodeFix; function getSupportedErrorCodes() { - return Object.keys(codeFixes); + return Object.keys(codeFixRegistrations); } codefix.getSupportedErrorCodes = getSupportedErrorCodes; function getFixes(context) { - var fixes = codeFixes[context.errorCode]; + var fixes = codeFixRegistrations[context.errorCode]; var allActions = []; ts.forEach(fixes, function (f) { var actions = f.getCodeActions(context); @@ -91582,6 +95582,42 @@ var ts; return allActions; } codefix.getFixes = getFixes; + function getAllFixes(context) { + // Currently fixId is always a string. + return fixIdToRegistration.get(ts.cast(context.fixId, ts.isString)).getAllCodeActions(context); + } + codefix.getAllFixes = getAllFixes; + function createCombinedCodeActions(changes, commands) { + return { changes: changes, commands: commands }; + } + function createFileTextChanges(fileName, textChanges) { + return { fileName: fileName, textChanges: textChanges }; + } + codefix.createFileTextChanges = createFileTextChanges; + function codeFixAll(context, errorCodes, use) { + var commands = []; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return eachDiagnostic(context, errorCodes, function (diag) { return use(t, diag, commands); }); + }); + return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands); + } + codefix.codeFixAll = codeFixAll; + function codeFixAllWithTextChanges(context, errorCodes, use) { + var changes = []; + eachDiagnostic(context, errorCodes, function (diag) { return use(changes, diag); }); + changes.sort(function (a, b) { return b.span.start - a.span.start; }); + return createCombinedCodeActions([createFileTextChanges(context.sourceFile.fileName, changes)]); + } + codefix.codeFixAllWithTextChanges = codeFixAllWithTextChanges; + function eachDiagnostic(_a, errorCodes, cb) { + var program = _a.program, sourceFile = _a.sourceFile; + for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile); _i < _b.length; _i++) { + var diag = _b[_i]; + if (ts.contains(errorCodes, diag.code)) { + cb(diag); + } + } + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -91592,14 +95628,15 @@ var ts; // A map with the refactor code as key, the refactor itself as value // e.g. nonSuggestableRefactors[refactorCode] -> the refactor you want var refactors = ts.createMap(); - function registerRefactor(refactor) { - refactors.set(refactor.name, refactor); + /** @param name An unique code associated with each refactor. Does not have to be human-readable. */ + function registerRefactor(name, refactor) { + refactors.set(name, refactor); } refactor_1.registerRefactor = registerRefactor; function getApplicableRefactors(context) { - return ts.flatMapIter(refactors.values(), function (refactor) { + return ts.arrayFrom(ts.flatMapIterator(refactors.values(), function (refactor) { return context.cancellationToken && context.cancellationToken.isCancellationRequested() ? undefined : refactor.getAvailableActions(context); - }); + })); } refactor_1.getApplicableRefactors = getApplicableRefactors; function getEditsForRefactor(context, refactorName, actionName) { @@ -91618,22 +95655,24 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "addMissingInvocationForDecorator"; + var errorCodes = [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - var decorator = ts.getAncestor(token, 148 /* Decorator */); - ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); - var replacement = ts.createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, decorator.expression, replacement); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), - changes: changeTracker.getChanges() - }]; - } + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Call_decorator_expression), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { return makeChange(changes, diag.file, diag.start); }); }, }); + function makeChange(changeTracker, sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var decorator = ts.findAncestor(token, ts.isDecorator); + ts.Debug.assert(!!decorator, "Expected position to be owned by a decorator."); + var replacement = ts.createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined); + changeTracker.replaceNode(sourceFile, decorator.expression, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -91641,27 +95680,36 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "correctQualifiedNameToIndexedAccessType"; + var errorCodes = [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - var qualifiedName = ts.getAncestor(token, 144 /* QualifiedName */); - ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); - if (!ts.isIdentifier(qualifiedName.left)) { + var qualifiedName = getQualifiedName(context.sourceFile, context.span.start); + if (!qualifiedName) return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]"]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var q = getQualifiedName(diag.file, diag.start); + if (q) { + doChange(changes, diag.file, q); } - var leftText = qualifiedName.left.getText(sourceFile); - var rightText = qualifiedName.right.getText(sourceFile); - var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, qualifiedName, replacement); - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Rewrite_as_the_indexed_access_type_0), [leftText + "[\"" + rightText + "\"]"]), - changes: changeTracker.getChanges() - }]; - } + }); }, }); + function getQualifiedName(sourceFile, pos) { + var qualifiedName = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ true), ts.isQualifiedName); + ts.Debug.assert(!!qualifiedName, "Expected position to be owned by a qualified name."); + return ts.isIdentifier(qualifiedName.left) ? qualifiedName : undefined; + } + function doChange(changeTracker, sourceFile, qualifiedName) { + var rightText = qualifiedName.right.text; + var replacement = ts.createIndexedAccessTypeNode(ts.createTypeReferenceNode(qualifiedName.left, /*typeArguments*/ undefined), ts.createLiteralTypeNode(ts.createLiteral(rightText))); + changeTracker.replaceNode(sourceFile, qualifiedName, replacement); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -91669,55 +95717,61 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code, + ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code]; + var fixId = "fixClassIncorrectlyImplementsInterface"; // TODO: share a group with fixClassDoesntImplementInheritedAbstractMember? codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Class_0_incorrectly_implements_interface_1.code], - getCodeActions: getActionForClassLikeIncorrectImplementsInterface + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var classDeclaration = getClass(sourceFile, span.start); + var checker = program.getTypeChecker(); + return ts.mapDefined(ts.getClassImplementsHeritageClauseElements(classDeclaration), function (implementedTypeNode) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, t); }); + if (changes.length === 0) + return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); + return { description: description, changes: changes, fixId: fixId }; + }); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenClassDeclarations = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { + for (var _i = 0, _a = ts.getClassImplementsHeritageClauseElements(classDeclaration); _i < _a.length; _i++) { + var implementedTypeNode = _a[_i]; + addMissingDeclarations(context.program.getTypeChecker(), implementedTypeNode, diag.file, classDeclaration, changes); + } + } + }); + }, }); - function getActionForClassLikeIncorrectImplementsInterface(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - var classDeclaration = ts.getContainingClass(token); - if (!classDeclaration) { - return undefined; - } - var openBrace = ts.getOpenBraceOfClassLike(classDeclaration, sourceFile); + function getClass(sourceFile, pos) { + var classDeclaration = ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false)); + ts.Debug.assert(!!classDeclaration); + return classDeclaration; + } + function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker) { + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var implementedType = checker.getTypeAtLocation(implementedTypeNode); + var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); + var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); var classType = checker.getTypeAtLocation(classDeclaration); - var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(classDeclaration); - var hasNumericIndexSignature = !!checker.getIndexTypeOfType(classType, 1 /* Number */); - var hasStringIndexSignature = !!checker.getIndexTypeOfType(classType, 0 /* String */); - var result = []; - for (var _i = 0, implementedTypeNodes_2 = implementedTypeNodes; _i < implementedTypeNodes_2.length; _i++) { - var implementedTypeNode = implementedTypeNodes_2[_i]; - // Note that this is ultimately derived from a map indexed by symbol names, - // so duplicates cannot occur. - var implementedType = checker.getTypeAtLocation(implementedTypeNode); - var implementedTypeSymbols = checker.getPropertiesOfType(implementedType); - var nonPrivateMembers = implementedTypeSymbols.filter(function (symbol) { return !(ts.getModifierFlags(symbol.valueDeclaration) & 8 /* Private */); }); - var newNodes = []; - createAndAddMissingIndexSignatureDeclaration(implementedType, 1 /* Number */, hasNumericIndexSignature, newNodes); - createAndAddMissingIndexSignatureDeclaration(implementedType, 0 /* String */, hasStringIndexSignature, newNodes); - newNodes = newNodes.concat(codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker)); - var message = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_interface_0), [implementedTypeNode.getText()]); - if (newNodes.length > 0) { - pushAction(result, newNodes, message); - } + if (!checker.getIndexTypeOfType(classType, 1 /* Number */)) { + createMissingIndexSignatureDeclaration(implementedType, 1 /* Number */); } - return result; - function createAndAddMissingIndexSignatureDeclaration(type, kind, hasIndexSigOfKind, newNodes) { - if (hasIndexSigOfKind) { - return; - } + if (!checker.getIndexTypeOfType(classType, 0 /* String */)) { + createMissingIndexSignatureDeclaration(implementedType, 0 /* String */); + } + codefix.createMissingMemberNodes(classDeclaration, nonPrivateMembers, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); + function createMissingIndexSignatureDeclaration(type, kind) { var indexInfoOfKind = checker.getIndexInfoOfType(type, kind); - if (!indexInfoOfKind) { - return; + if (indexInfoOfKind) { + changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration)); } - var newIndexSignatureDeclaration = checker.indexInfoToIndexSignatureDeclaration(indexInfoOfKind, kind, classDeclaration); - newNodes.push(newIndexSignatureDeclaration); - } - function pushAction(result, newNodes, description) { - result.push({ description: description, changes: codefix.newNodesToChanges(newNodes, openBrace, context) }); } } })(codefix = ts.codefix || (ts.codefix = {})); @@ -91727,157 +95781,175 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ]; + var fixId = "addMissingMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1.code, - ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code], - getCodeActions: getActionsForAddMissingMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var info = getInfo(context.sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + var methodCodeAction = call && getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + var addMember = inJs ? + ts.singleElementArray(getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, token.text, makeStatic)) : + getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic); + return ts.concatenate(ts.singleElementArray(methodCodeAction), addMember); + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenNames = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var program = context.program; + var info = getInfo(diag.file, diag.start, program.getTypeChecker()); + if (!info) + return; + var classDeclaration = info.classDeclaration, classDeclarationSourceFile = info.classDeclarationSourceFile, inJs = info.inJs, makeStatic = info.makeStatic, token = info.token, call = info.call; + if (!ts.addToSeen(seenNames, token.text)) { + return; + } + // Always prefer to add a method declaration if possible. + if (call) { + addMethodDeclaration(changes, classDeclarationSourceFile, classDeclaration, token, call, makeStatic, inJs); + } + else { + if (inJs) { + addMissingMemberInJs(changes, classDeclarationSourceFile, classDeclaration, token.text, makeStatic); + } + else { + var typeNode = getTypeNode(program.getTypeChecker(), classDeclaration, token); + addPropertyDeclaration(changes, classDeclarationSourceFile, classDeclaration, token.text, typeNode, makeStatic); + } + } + }); + }, }); - function getActionsForAddMissingMember(context) { - var tokenSourceFile = context.sourceFile; - var start = context.span.start; + function getInfo(tokenSourceFile, tokenPos, checker) { // The identifier of the missing property. eg: // this.missing = 1; // ^^^^^^^ - var token = ts.getTokenAtPosition(tokenSourceFile, start, /*includeJsDocComment*/ false); - if (token.kind !== 71 /* Identifier */) { + var token = ts.getTokenAtPosition(tokenSourceFile, tokenPos, /*includeJsDocComment*/ false); + if (!ts.isIdentifier(token)) { return undefined; } - if (!ts.isPropertyAccessExpression(token.parent)) { + var classAndMakeStatic = getClassAndMakeStatic(token, checker); + if (!classAndMakeStatic) { return undefined; } - var tokenName = token.getText(tokenSourceFile); - var makeStatic = false; - var classDeclaration; - if (token.parent.expression.kind === 99 /* ThisKeyword */) { + var classDeclaration = classAndMakeStatic.classDeclaration, makeStatic = classAndMakeStatic.makeStatic; + var classDeclarationSourceFile = classDeclaration.getSourceFile(); + var inJs = ts.isInJavaScriptFile(classDeclarationSourceFile); + var call = ts.tryCast(token.parent.parent, ts.isCallExpression); + return { token: token, classDeclaration: classDeclaration, makeStatic: makeStatic, classDeclarationSourceFile: classDeclarationSourceFile, inJs: inJs, call: call }; + } + function getClassAndMakeStatic(token, checker) { + var parent = token.parent; + if (!ts.isPropertyAccessExpression(parent)) { + return undefined; + } + if (parent.expression.kind === 99 /* ThisKeyword */) { var containingClassMemberDeclaration = ts.getThisContainer(token, /*includeArrowFunctions*/ false); if (!ts.isClassElement(containingClassMemberDeclaration)) { return undefined; } - classDeclaration = containingClassMemberDeclaration.parent; + var classDeclaration = containingClassMemberDeclaration.parent; // Property accesses on `this` in a static method are accesses of a static member. - makeStatic = classDeclaration && ts.hasModifier(containingClassMemberDeclaration, 32 /* Static */); + return ts.isClassLike(classDeclaration) ? { classDeclaration: classDeclaration, makeStatic: ts.hasModifier(containingClassMemberDeclaration, 32 /* Static */) } : undefined; } else { - var checker = context.program.getTypeChecker(); - var leftExpression = token.parent.expression; - var leftExpressionType = checker.getTypeAtLocation(leftExpression); - if (leftExpressionType.flags & 65536 /* Object */) { - var symbol = leftExpressionType.symbol; - if (symbol.flags & 32 /* Class */) { - classDeclaration = symbol.declarations && symbol.declarations[0]; - if (leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol)) { - // The expression is a class symbol but the type is not the instance-side. - makeStatic = true; - } - } + var leftExpressionType = checker.getTypeAtLocation(parent.expression); + var symbol = leftExpressionType.symbol; + if (!(symbol && leftExpressionType.flags & 65536 /* Object */ && symbol.flags & 32 /* Class */)) { + return undefined; } + var classDeclaration = ts.cast(ts.first(symbol.declarations), ts.isClassLike); + // The expression is a class symbol but the type is not the instance-side. + return { classDeclaration: classDeclaration, makeStatic: leftExpressionType !== checker.getDeclaredTypeOfSymbol(symbol) }; } - if (!classDeclaration || !ts.isClassLike(classDeclaration)) { + } + function getActionsForAddMissingMemberInJavaScriptFile(context, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMissingMemberInJs(t, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic); }); + if (changes.length === 0) return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Initialize_static_property_0 : ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]); + return { description: description, changes: changes, fixId: fixId }; + } + function addMissingMemberInJs(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { + if (makeStatic) { + if (classDeclaration.kind === 203 /* ClassExpression */) { + return; + } + var className = classDeclaration.name.getText(); + var staticInitialization = initializePropertyToUndefined(ts.createIdentifier(className), tokenName); + changeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization); } - var classDeclarationSourceFile = ts.getSourceFileOfNode(classDeclaration); - var classOpenBrace = ts.getOpenBraceOfClassLike(classDeclaration, classDeclarationSourceFile); - return ts.isInJavaScriptFile(classDeclarationSourceFile) ? - getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) : - getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic); - function getActionsForAddMissingMemberInJavaScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ false); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - if (makeStatic) { - if (classDeclaration.kind === 200 /* ClassExpression */) { - return actions; - } - var className = classDeclaration.name.getText(); - var staticInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier(className), tokenName), ts.createIdentifier("undefined"))); - var staticInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - staticInitializationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classDeclaration, staticInitialization, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); - var initializeStaticAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_static_property_0), [tokenName]), - changes: staticInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeStaticAction); - return actions; - } - else { - var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); - if (!classConstructor) { - return actions; - } - var propertyInitialization = ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createThis(), tokenName), ts.createIdentifier("undefined"))); - var propertyInitializationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyInitializationChangeTracker.insertNodeBefore(classDeclarationSourceFile, classConstructor.body.getLastToken(), propertyInitialization, { suffix: context.newLineCharacter }); - var initializeAction = { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]), - changes: propertyInitializationChangeTracker.getChanges() - }; - (actions || (actions = [])).push(initializeAction); - return actions; + else { + var classConstructor = ts.getFirstConstructorWithBody(classDeclaration); + if (!classConstructor) { + return; } + var propertyInitialization = initializePropertyToUndefined(ts.createThis(), tokenName); + changeTracker.insertNodeAtConstructorEnd(classDeclarationSourceFile, classConstructor, propertyInitialization); } - function getActionsForAddMissingMemberInTypeScriptFile(classDeclaration, makeStatic) { - var actions; - var methodCodeAction = getActionForMethodDeclaration(/*includeTypeScriptSyntax*/ true); - if (methodCodeAction) { - actions = [methodCodeAction]; - } - var typeNode; - if (token.parent.parent.kind === 195 /* BinaryExpression */) { - var binaryExpression = token.parent.parent; - var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; - var checker = context.program.getTypeChecker(); - var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); - typeNode = checker.typeToTypeNode(widenedType, classDeclaration); - } - typeNode = typeNode || ts.createKeywordTypeNode(119 /* AnyKeyword */); - var property = ts.createProperty( - /*decorators*/ undefined, - /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, tokenName, - /*questionToken*/ undefined, typeNode, - /*initializer*/ undefined); - var propertyChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - propertyChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, property, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0; - actions = ts.append(actions, { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: propertyChangeTracker.getChanges() - }); - if (!makeStatic) { - // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(136 /* StringKeyword */); - var indexingParameter = ts.createParameter( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, "x", - /*questionToken*/ undefined, stringTypeNode, - /*initializer*/ undefined); - var indexSignature = ts.createIndexSignature( - /*decorators*/ undefined, - /*modifiers*/ undefined, [indexingParameter], typeNode); - var indexSignatureChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - indexSignatureChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, indexSignature, { suffix: context.newLineCharacter }); - actions.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), - changes: indexSignatureChangeTracker.getChanges() - }); - } - return actions; - } - function getActionForMethodDeclaration(includeTypeScriptSyntax) { - if (token.parent.parent.kind === 182 /* CallExpression */) { - var callExpression = token.parent.parent; - var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, tokenName, includeTypeScriptSyntax, makeStatic); - var methodDeclarationChangeTracker = ts.textChanges.ChangeTracker.fromContext(context); - methodDeclarationChangeTracker.insertNodeAfter(classDeclarationSourceFile, classOpenBrace, methodDeclaration, { suffix: context.newLineCharacter }); - var diag = makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0; - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(diag), [tokenName]), - changes: methodDeclarationChangeTracker.getChanges() - }; - } + } + function initializePropertyToUndefined(obj, propertyName) { + return ts.createStatement(ts.createAssignment(ts.createPropertyAccess(obj, propertyName), ts.createIdentifier("undefined"))); + } + function getActionsForAddMissingMemberInTypeScriptFile(context, classDeclarationSourceFile, classDeclaration, token, makeStatic) { + var typeNode = getTypeNode(context.program.getTypeChecker(), classDeclaration, token); + var addProp = createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, token.text, typeNode); + return makeStatic ? [addProp] : [addProp, createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, token.text, typeNode)]; + } + function getTypeNode(checker, classDeclaration, token) { + var typeNode; + if (token.parent.parent.kind === 198 /* BinaryExpression */) { + var binaryExpression = token.parent.parent; + var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; + var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); + typeNode = checker.typeToTypeNode(widenedType, classDeclaration); } + return typeNode || ts.createKeywordTypeNode(119 /* AnyKeyword */); + } + function createAddPropertyDeclarationAction(context, classDeclarationSourceFile, classDeclaration, makeStatic, tokenName, typeNode) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_property_0 : ts.Diagnostics.Declare_property_0), [tokenName]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addPropertyDeclaration(t, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addPropertyDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, typeNode, makeStatic) { + var property = ts.createProperty( + /*decorators*/ undefined, + /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, tokenName, + /*questionToken*/ undefined, typeNode, + /*initializer*/ undefined); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, property); + } + function createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, tokenName, typeNode) { + // Index signatures cannot have the static modifier. + var stringTypeNode = ts.createKeywordTypeNode(137 /* StringKeyword */); + var indexingParameter = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, "x", + /*questionToken*/ undefined, stringTypeNode, + /*initializer*/ undefined); + var indexSignature = ts.createIndexSignature( + /*decorators*/ undefined, + /*modifiers*/ undefined, [indexingParameter], typeNode); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, indexSignature); }); + // No fixId here because code-fix-all currently only works on adding individual named properties. + return { description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_index_signature_for_property_0), [tokenName]), changes: changes, fixId: undefined }; + } + function getActionForMethodDeclaration(context, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(makeStatic ? ts.Diagnostics.Declare_static_method_0 : ts.Diagnostics.Declare_method_0), [token.text]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addMethodDeclaration(t, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs); }); + return { description: description, changes: changes, fixId: fixId }; + } + function addMethodDeclaration(changeTracker, classDeclarationSourceFile, classDeclaration, token, callExpression, makeStatic, inJs) { + var methodDeclaration = codefix.createMethodFromCallExpression(callExpression, token.text, inJs, makeStatic); + changeTracker.insertNodeAtClassStart(classDeclarationSourceFile, classDeclaration, methodDeclaration); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -91886,18 +95958,35 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixSpelling"; + var errorCodes = [ + ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code, + ]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, - ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1.code], - getCodeActions: getActionsForCorrectSpelling + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var info = getInfo(sourceFile, context.span.start, context.program.getTypeChecker()); + if (!info) + return undefined; + var node = info.node, suggestion = info.suggestion; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, node, suggestion); }); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start, context.program.getTypeChecker()); + if (info) + doChange(changes, context.sourceFile, info.node, info.suggestion); + }); }, }); - function getActionsForCorrectSpelling(context) { - var sourceFile = context.sourceFile; + function getInfo(sourceFile, pos, checker) { // This is the identifier of the misspelled word. eg: // this.speling = 1; // ^^^^^^^ - var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); // TODO: GH#15852 - var checker = context.program.getTypeChecker(); + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); // TODO: GH#15852 var suggestion; if (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) { ts.Debug.assert(node.kind === 71 /* Identifier */); @@ -91910,18 +95999,10 @@ var ts; ts.Debug.assert(name !== undefined, "name should be defined"); suggestion = checker.getSuggestionForNonexistentSymbol(node, name, convertSemanticMeaningToSymbolFlags(meaning)); } - if (suggestion) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_spelling_to_0), [suggestion]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: node.getStart(), length: node.getWidth() }, - newText: suggestion - }], - }], - }]; - } + return suggestion === undefined ? undefined : { node: node, suggestion: suggestion }; + } + function doChange(changes, sourceFile, node, suggestion) { + changes.replaceNode(sourceFile, node, ts.createIdentifier(suggestion)); } function convertSemanticMeaningToSymbolFlags(meaning) { var flags = 0; @@ -91943,31 +96024,39 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "fixCannotFindModule"; + var errorCodes = [ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code]; codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code, - ], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile, start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - if (!ts.isStringLiteral(token)) { - throw ts.Debug.fail(); // These errors should only happen on the module name. - } - var action = tryGetCodeActionForInstallPackageTypes(context.host, sourceFile.fileName, token.text); - return action && [action]; + var codeAction = tryGetCodeActionForInstallPackageTypes(context.host, context.sourceFile.fileName, getModuleName(context.sourceFile, context.span.start)); + return codeAction && [__assign({ fixId: fixId }, codeAction)]; }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (_, diag, commands) { + var pkg = getTypesPackageNameToInstall(context.host, getModuleName(diag.file, diag.start)); + if (pkg) { + commands.push(getCommand(diag.file.fileName, pkg)); + } + }); }, }); - function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + function getModuleName(sourceFile, pos) { + return ts.cast(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), ts.isStringLiteral).text; + } + function getCommand(fileName, packageName) { + return { type: "install package", file: fileName, packageName: packageName }; + } + function getTypesPackageNameToInstall(host, moduleName) { var packageName = ts.getPackageName(moduleName).packageName; - if (!host.isKnownTypesPackageName(packageName)) { - // If !registry, registry not available yet, can't do anything. - return undefined; - } - var typesPackageName = ts.getTypesPackageName(packageName); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [typesPackageName]), + // If !registry, registry not available yet, can't do anything. + return host.isKnownTypesPackageName(packageName) ? ts.getTypesPackageName(packageName) : undefined; + } + function tryGetCodeActionForInstallPackageTypes(host, fileName, moduleName) { + var packageName = getTypesPackageNameToInstall(host, moduleName); + return packageName === undefined ? undefined : { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Install_0), [packageName]), changes: [], - commands: [{ type: "install package", file: fileName, packageName: typesPackageName }], + commands: [getCommand(fileName, packageName)], }; } codefix.tryGetCodeActionForInstallPackageTypes = tryGetCodeActionForInstallPackageTypes; @@ -91978,44 +96067,45 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var errorCodes = [ + ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code, + ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code, + ]; + var fixId = "fixClassDoesntImplementInheritedAbstractMember"; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code], - getCodeActions: getActionForClassLikeMissingAbstractMember + errorCodes: errorCodes, + getCodeActions: function (context) { + var program = context.program, sourceFile = context.sourceFile, span = context.span; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { + return addMissingMembers(getClass(sourceFile, span.start), sourceFile, program.getTypeChecker(), t); + }); + return changes.length === 0 ? undefined : [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + addMissingMembers(getClass(diag.file, diag.start), context.sourceFile, context.program.getTypeChecker(), changes); + }); }, }); - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code], - getCodeActions: getActionForClassLikeMissingAbstractMember - }); - function getActionForClassLikeMissingAbstractMember(context) { - var sourceFile = context.sourceFile; - var start = context.span.start; + function getClass(sourceFile, pos) { // This is the identifier in the case of a class declaration // or the class keyword token in the case of a class expression. - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var checker = context.program.getTypeChecker(); - if (ts.isClassLike(token.parent)) { - var classDeclaration = token.parent; - var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); - var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); - // Note that this is ultimately derived from a map indexed by symbol names, - // so duplicates cannot occur. - var extendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType); - var abstractAndNonPrivateExtendsSymbols = extendsSymbols.filter(symbolPointsToNonPrivateAndAbstractMember); - var newNodes = codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker); - var changes = codefix.newNodesToChanges(newNodes, ts.getOpenBraceOfClassLike(classDeclaration, sourceFile), context); - if (changes && changes.length > 0) { - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), - changes: changes - }]; - } - } - return undefined; + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var classDeclaration = token.parent; + ts.Debug.assert(ts.isClassLike(classDeclaration)); + return classDeclaration; + } + function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker) { + var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); + var instantiatedExtendsType = checker.getTypeAtLocation(extendsNode); + // Note that this is ultimately derived from a map indexed by symbol names, + // so duplicates cannot occur. + var abstractAndNonPrivateExtendsSymbols = checker.getPropertiesOfType(instantiatedExtendsType).filter(symbolPointsToNonPrivateAndAbstractMember); + codefix.createMissingMemberNodes(classDeclaration, abstractAndNonPrivateExtendsSymbols, checker, function (member) { return changeTracker.insertNodeAtClassStart(sourceFile, classDeclaration, member); }); } function symbolPointsToNonPrivateAndAbstractMember(symbol) { - var decls = symbol.getDeclarations(); - ts.Debug.assert(!!(decls && decls.length > 0)); - var flags = ts.getModifierFlags(decls[0]); + // See `codeFixClassExtendAbstractProtectedProperty.ts` in https://github.com/Microsoft/TypeScript/pull/11547/files + // (now named `codeFixClassExtendAbstractPrivateProperty.ts`) + var flags = ts.getModifierFlags(ts.first(symbol.getDeclarations())); return !(flags & 8 /* Private */) && !!(flags & 128 /* Abstract */); } })(codefix = ts.codefix || (ts.codefix = {})); @@ -92025,48 +96115,55 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "classSuperMustPrecedeThisAccess"; + var errorCodes = [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code], + errorCodes: errorCodes, getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var constructor = nodes.constructor, superCall = nodes.superCall; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, constructor, superCall); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 99 /* ThisKeyword */) { - return undefined; - } - var constructor = ts.getContainingFunction(token); - var superCall = findSuperCall(constructor.body); - if (!superCall) { - return undefined; - } - // figure out if the `this` access is actually inside the supercall - // i.e. super(this.a), since in that case we won't suggest a fix - if (superCall.expression && superCall.expression.kind === 182 /* CallExpression */) { - var expressionArguments = superCall.expression.arguments; - for (var _i = 0, expressionArguments_1 = expressionArguments; _i < expressionArguments_1.length; _i++) { - var arg = expressionArguments_1[_i]; - if (arg.expression === token) { - return undefined; - } + var seenClasses = ts.createMap(); // Ensure we only do this once per class. + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + var constructor = nodes.constructor, superCall = nodes.superCall; + if (ts.addToSeen(seenClasses, ts.getNodeId(constructor.parent))) { + doChange(changes, sourceFile, constructor, superCall); } - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(constructor, sourceFile), superCall, { suffix: context.newLineCharacter }); - changeTracker.deleteNode(sourceFile, superCall); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Make_super_call_the_first_statement_in_the_constructor), - changes: changeTracker.getChanges() - }]; - function findSuperCall(n) { - if (n.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(n.expression)) { - return n; - } - if (ts.isFunctionLike(n)) { - return undefined; - } - return ts.forEachChild(n, findSuperCall); - } - } + }); + }, }); + function doChange(changes, sourceFile, constructor, superCall) { + changes.insertNodeAtConstructorStart(sourceFile, constructor, superCall); + changes.deleteNode(sourceFile, superCall); + } + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + if (token.kind !== 99 /* ThisKeyword */) + return undefined; + var constructor = ts.getContainingFunction(token); + var superCall = findSuperCall(constructor.body); + // figure out if the `this` access is actually inside the supercall + // i.e. super(this.a), since in that case we won't suggest a fix + return superCall && !superCall.expression.arguments.some(function (arg) { return ts.isPropertyAccessExpression(arg) && arg.expression === token; }) ? { constructor: constructor, superCall: superCall } : undefined; + } + function findSuperCall(n) { + return ts.isExpressionStatement(n) && ts.isSuperCall(n.expression) + ? n + : ts.isFunctionLike(n) + ? undefined + : ts.forEachChild(n, findSuperCall); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92074,23 +96171,30 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "constructorForDerivedNeedSuperCall"; + var errorCodes = [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call.code], + errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 123 /* ConstructorKeyword */) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); - changeTracker.insertNodeAfter(sourceFile, ts.getOpenBrace(token.parent, sourceFile), superCall, { suffix: context.newLineCharacter }); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), - changes: changeTracker.getChanges() - }]; - } + var sourceFile = context.sourceFile, span = context.span; + var ctr = getNode(sourceFile, span.start); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, ctr); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_missing_super_call), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + return doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, }); + function getNode(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + ts.Debug.assert(token.kind === 123 /* ConstructorKeyword */); + return token.parent; + } + function doChange(changes, sourceFile, ctr) { + var superCall = ts.createStatement(ts.createCall(ts.createSuper(), /*typeArguments*/ undefined, /*argumentsArray*/ ts.emptyArray)); + changes.insertNodeAtConstructorStart(sourceFile, ctr, superCall); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92098,247 +96202,314 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "extendsInterfaceBecomesImplements"; + var errorCodes = [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_extend_an_interface_0_Did_you_mean_implements.code], + errorCodes: errorCodes, getCodeActions: function (context) { var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var classDeclNode = ts.getContainingClass(token); - if (!(token.kind === 71 /* Identifier */ && ts.isClassLike(classDeclNode))) { + var nodes = getNodes(sourceFile, context.span.start); + if (!nodes) + return undefined; + var extendsToken = nodes.extendsToken, heritageClauses = nodes.heritageClauses; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChanges(t, sourceFile, extendsToken, heritageClauses); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (nodes) + doChanges(changes, diag.file, nodes.extendsToken, nodes.heritageClauses); + }); }, + }); + function getNodes(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var heritageClauses = ts.getContainingClass(token).heritageClauses; + var extendsToken = heritageClauses[0].getFirstToken(); + return extendsToken.kind === 85 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; + } + function doChanges(changes, sourceFile, extendsToken, heritageClauses) { + changes.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */), ts.textChanges.useNonAdjustedPositions); + // If there is already an implements clause, replace the implements keyword with a comma. + if (heritageClauses.length === 2 && + heritageClauses[0].token === 85 /* ExtendsKeyword */ && + heritageClauses[1].token === 108 /* ImplementsKeyword */) { + var implementsToken = heritageClauses[1].getFirstToken(); + var implementsFullStart = implementsToken.getFullStart(); + changes.replaceRange(sourceFile, { pos: implementsFullStart, end: implementsFullStart }, ts.createToken(26 /* CommaToken */)); + // Rough heuristic: delete trailing whitespace after keyword so that it's not excessive. + // (Trailing because leading might be indentation, which is more sensitive.) + var text = sourceFile.text; + var end = implementsToken.end; + while (end < text.length && ts.isWhiteSpaceSingleLine(text.charCodeAt(end))) { + end++; + } + changes.deleteRange(sourceFile, { pos: implementsToken.getStart(), end: end }); + } + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "forgottenThisPropertyAccess"; + var errorCodes = [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getNode(sourceFile, context.span.start); + if (!token) { return undefined; } - var heritageClauses = classDeclNode.heritageClauses; - if (!(heritageClauses && heritageClauses.length > 0)) { - return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, token); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + doChange(changes, context.sourceFile, getNode(diag.file, diag.start)); + }); }, + }); + function getNode(sourceFile, pos) { + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return ts.isIdentifier(node) ? node : undefined; + } + function doChange(changes, sourceFile, token) { + if (!token) { + return; + } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper + ts.suppressLeadingAndTrailingTrivia(token); + changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token), ts.textChanges.useNonAdjustedPositions); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixIdPrefix = "unusedIdentifier_prefix"; + var fixIdDelete = "unusedIdentifier_delete"; + var errorCodes = [ + ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, + ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var token = getToken(sourceFile, context.span.start); + var result = []; + var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token); }); + if (deletion.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), [token.getText()]); + result.push({ description: description, changes: deletion, fixId: fixIdDelete }); } - var extendsToken = heritageClauses[0].getFirstToken(); - if (!(extendsToken && extendsToken.kind === 85 /* ExtendsKeyword */)) { - return undefined; + var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, context.errorCode, sourceFile, token); }); + if (prefix.length) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), [token.getText()]); + result.push({ description: description, changes: prefix, fixId: fixIdPrefix }); } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */)); - // We replace existing keywords with commas. - for (var i = 1; i < heritageClauses.length; i++) { - var keywordToken = heritageClauses[i].getFirstToken(); - if (keywordToken) { - changeTracker.replaceNode(sourceFile, keywordToken, ts.createToken(26 /* CommaToken */)); - } - } - var result = [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Change_extends_to_implements), - changes: changeTracker.getChanges() - }]; return result; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code], - getCodeActions: function (context) { + }, + fixIds: [fixIdPrefix, fixIdDelete], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var sourceFile = context.sourceFile; - var token = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); - if (token.kind !== 71 /* Identifier */) { - return undefined; - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), - changes: changeTracker.getChanges() - }]; - } - }); - })(codefix = ts.codefix || (ts.codefix = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var codefix; - (function (codefix) { - codefix.registerCodeFix({ - errorCodes: [ - ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, - ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ], - getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var start = context.span.start; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - // this handles var ["computed"] = 12; - if (token.kind === 21 /* OpenBracketToken */) { - token = ts.getTokenAtPosition(sourceFile, start + 1, /*includeJsDocComment*/ false); - } - switch (token.kind) { - case 71 /* Identifier */: - return deleteIdentifierOrPrefixWithUnderscore(token, context.errorCode); - case 150 /* PropertyDeclaration */: - case 241 /* NamespaceImport */: - return [deleteNode(token.parent)]; - default: - return deleteDefault(); - } - function deleteDefault() { - if (ts.isDeclarationName(token)) { - return [deleteNode(token.parent)]; - } - else if (ts.isLiteralComputedPropertyDeclarationName(token)) { - return [deleteNode(token.parent.parent)]; - } - else { - return undefined; - } - } - function prefixIdentifierWithUnderscore(identifier) { - var startPosition = identifier.getStart(sourceFile, /*includeJsDocComment*/ false); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), { 0: token.getText() }), - changes: [{ - fileName: sourceFile.path, - textChanges: [{ - span: { start: startPosition, length: 0 }, - newText: "_" - }] - }] - }; - } - function deleteIdentifierOrPrefixWithUnderscore(identifier, errorCode) { - var parent = identifier.parent; - switch (parent.kind) { - case 227 /* VariableDeclaration */: - return deleteVariableDeclarationOrPrefixWithUnderscore(identifier, parent); - case 146 /* TypeParameter */: - var typeParameters = parent.parent.typeParameters; - if (typeParameters.length === 1) { - var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); - var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false); - ts.Debug.assert(previousToken.kind === 27 /* LessThanToken */); - ts.Debug.assert(nextToken.kind === 29 /* GreaterThanToken */); - return [deleteNodeRange(previousToken, nextToken)]; - } - else { - return [deleteNodeInList(parent)]; - } - case 147 /* Parameter */: - var functionDeclaration = parent.parent; - var deleteAction = functionDeclaration.parameters.length === 1 ? deleteNode(parent) : deleteNodeInList(parent); - return errorCode === ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code - ? [deleteAction] - : [deleteAction, prefixIdentifierWithUnderscore(identifier)]; - // handle case where 'import a = A;' - case 238 /* ImportEqualsDeclaration */: - var importEquals = ts.getAncestor(identifier, 238 /* ImportEqualsDeclaration */); - return [deleteNode(importEquals)]; - case 243 /* ImportSpecifier */: - var namedImports = parent.parent; - if (namedImports.elements.length === 1) { - return deleteNamedImportBinding(namedImports); - } - else { - // delete import specifier - return [deleteNodeInList(parent)]; - } - case 240 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' - var importClause = parent; - if (!importClause.namedBindings) { - var importDecl = ts.getAncestor(importClause, 239 /* ImportDeclaration */); - return [deleteNode(importDecl)]; - } - else { - // import |d,| * as ns from './file' - var start_6 = importClause.name.getStart(sourceFile); - var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false); - if (nextToken && nextToken.kind === 26 /* CommaToken */) { - // shift first non-whitespace position after comma to the start position of the node - return [deleteRange({ pos: start_6, end: ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true) })]; - } - else { - return [deleteNode(importClause.name)]; - } - } - case 241 /* NamespaceImport */: - return deleteNamedImportBinding(parent); - default: - return deleteDefault(); - } - } - function deleteNamedImportBinding(namedBindings) { - if (namedBindings.parent.name) { - // Delete named imports while preserving the default import - // import d|, * as ns| from './file' - // import d|, { a }| from './file' - var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false); - if (previousToken && previousToken.kind === 26 /* CommaToken */) { - return [deleteRange({ pos: previousToken.getStart(), end: namedBindings.end })]; + var token = getToken(diag.file, diag.start); + switch (context.fixId) { + case fixIdPrefix: + if (ts.isIdentifier(token) && canPrefix(token)) { + tryPrefixDeclaration(changes, diag.code, sourceFile, token); } - return undefined; - } - else { - // Delete the entire import declaration - // |import * as ns from './file'| - // |import { a } from './file'| - var importDecl = ts.getAncestor(namedBindings, 239 /* ImportDeclaration */); - return [deleteNode(importDecl)]; - } + break; + case fixIdDelete: + tryDeleteDeclaration(changes, sourceFile, token); + break; + default: + ts.Debug.fail(JSON.stringify(context.fixId)); } - // token.parent is a variableDeclaration - function deleteVariableDeclarationOrPrefixWithUnderscore(identifier, varDecl) { + }); }, + }); + function getToken(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + // this handles var ["computed"] = 12; + return token.kind === 21 /* OpenBracketToken */ ? ts.getTokenAtPosition(sourceFile, pos + 1, /*includeJsDocComment*/ false) : token; + } + function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { + // Don't offer to prefix a property. + if (errorCode !== ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code && ts.isIdentifier(token) && canPrefix(token)) { + changes.replaceNode(sourceFile, token, ts.createIdentifier("_" + token.text)); + } + } + function canPrefix(token) { + switch (token.parent.kind) { + case 148 /* Parameter */: + return true; + case 230 /* VariableDeclaration */: { + var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 215 /* ForStatement */: - var forStatement = varDecl.parent.parent; - var forInitializer = forStatement.initializer; - return [forInitializer.declarations.length === 1 ? deleteNode(forInitializer) : deleteNodeInList(varDecl)]; - case 217 /* ForOfStatement */: - var forOfStatement = varDecl.parent.parent; - ts.Debug.assert(forOfStatement.initializer.kind === 228 /* VariableDeclarationList */); - var forOfInitializer = forOfStatement.initializer; - return [ - replaceNode(forOfInitializer.declarations[0], ts.createObjectLiteral()), - prefixIdentifierWithUnderscore(identifier) - ]; - case 216 /* ForInStatement */: - // There is no valid fix in the case of: - // for .. in - return [prefixIdentifierWithUnderscore(identifier)]; - default: - var variableStatement = varDecl.parent.parent; - if (variableStatement.declarationList.declarations.length === 1) { - return [deleteNode(variableStatement)]; - } - else { - return [deleteNodeInList(varDecl)]; - } + case 220 /* ForOfStatement */: + case 219 /* ForInStatement */: + return true; } } - function deleteNode(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNode(sourceFile, n)); - } - function deleteRange(range) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteRange(sourceFile, range)); - } - function deleteNodeInList(n) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeInList(sourceFile, n)); - } - function deleteNodeRange(start, end) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).deleteNodeRange(sourceFile, start, end)); - } - function replaceNode(n, newNode) { - return makeChange(ts.textChanges.ChangeTracker.fromContext(context).replaceNode(sourceFile, n, newNode)); - } - function makeChange(changeTracker) { - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), { 0: token.getText() }), - changes: changeTracker.getChanges() - }; - } } - }); + return false; + } + function tryDeleteDeclaration(changes, sourceFile, token) { + switch (token.kind) { + case 71 /* Identifier */: + tryDeleteIdentifier(changes, sourceFile, token); + break; + case 151 /* PropertyDeclaration */: + case 244 /* NamespaceImport */: + changes.deleteNode(sourceFile, token.parent); + break; + default: + tryDeleteDefault(changes, sourceFile, token); + } + } + function tryDeleteDefault(changes, sourceFile, token) { + if (ts.isDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent); + } + else if (ts.isLiteralComputedPropertyDeclarationName(token)) { + changes.deleteNode(sourceFile, token.parent.parent); + } + } + function tryDeleteIdentifier(changes, sourceFile, identifier) { + var parent = identifier.parent; + switch (parent.kind) { + case 230 /* VariableDeclaration */: + tryDeleteVariableDeclaration(changes, sourceFile, parent); + break; + case 147 /* TypeParameter */: + var typeParameters = parent.parent.typeParameters; + if (typeParameters.length === 1) { + var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); + var nextToken = ts.getTokenAtPosition(sourceFile, typeParameters.end, /*includeJsDocComment*/ false); + ts.Debug.assert(previousToken.kind === 27 /* LessThanToken */); + ts.Debug.assert(nextToken.kind === 29 /* GreaterThanToken */); + changes.deleteNodeRange(sourceFile, previousToken, nextToken); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 148 /* Parameter */: + var oldFunction = parent.parent; + if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) { + // Lambdas with exactly one parameter are special because, after removal, there + // must be an empty parameter list (i.e. `()`) and this won't necessarily be the + // case if the parameter is simply removed (e.g. in `x => 1`). + var newFunction = ts.updateArrowFunction(oldFunction, oldFunction.modifiers, oldFunction.typeParameters, + /*parameters*/ undefined, oldFunction.type, oldFunction.equalsGreaterThanToken, oldFunction.body); + // Drop leading and trailing trivia of the new function because we're only going + // to replace the span (vs the full span) of the old function - the old leading + // and trailing trivia will remain. + ts.suppressLeadingAndTrailingTrivia(newFunction); + changes.replaceNode(sourceFile, oldFunction, newFunction, ts.textChanges.useNonAdjustedPositions); + } + else { + changes.deleteNodeInList(sourceFile, parent); + } + break; + // handle case where 'import a = A;' + case 241 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(identifier, 241 /* ImportEqualsDeclaration */); + changes.deleteNode(sourceFile, importEquals); + break; + case 246 /* ImportSpecifier */: + var namedImports = parent.parent; + if (namedImports.elements.length === 1) { + tryDeleteNamedImportBinding(changes, sourceFile, namedImports); + } + else { + // delete import specifier + changes.deleteNodeInList(sourceFile, parent); + } + break; + case 243 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' + var importClause = parent; + if (!importClause.namedBindings) { + changes.deleteNode(sourceFile, ts.getAncestor(importClause, 242 /* ImportDeclaration */)); + } + else { + // import |d,| * as ns from './file' + var start = importClause.name.getStart(sourceFile); + var nextToken = ts.getTokenAtPosition(sourceFile, importClause.name.end, /*includeJsDocComment*/ false); + if (nextToken && nextToken.kind === 26 /* CommaToken */) { + // shift first non-whitespace position after comma to the start position of the node + var end = ts.skipTrivia(sourceFile.text, nextToken.end, /*stopAfterLineBreaks*/ false, /*stopAtComments*/ true); + changes.deleteRange(sourceFile, { pos: start, end: end }); + } + else { + changes.deleteNode(sourceFile, importClause.name); + } + } + break; + case 244 /* NamespaceImport */: + tryDeleteNamedImportBinding(changes, sourceFile, parent); + break; + default: + tryDeleteDefault(changes, sourceFile, identifier); + break; + } + } + function tryDeleteNamedImportBinding(changes, sourceFile, namedBindings) { + if (namedBindings.parent.name) { + // Delete named imports while preserving the default import + // import d|, * as ns| from './file' + // import d|, { a }| from './file' + var previousToken = ts.getTokenAtPosition(sourceFile, namedBindings.pos - 1, /*includeJsDocComment*/ false); + if (previousToken && previousToken.kind === 26 /* CommaToken */) { + changes.deleteRange(sourceFile, { pos: previousToken.getStart(), end: namedBindings.end }); + } + } + else { + // Delete the entire import declaration + // |import * as ns from './file'| + // |import { a } from './file'| + var importDecl = ts.getAncestor(namedBindings, 242 /* ImportDeclaration */); + changes.deleteNode(sourceFile, importDecl); + } + } + // token.parent is a variableDeclaration + function tryDeleteVariableDeclaration(changes, sourceFile, varDecl) { + switch (varDecl.parent.parent.kind) { + case 218 /* ForStatement */: { + var forStatement = varDecl.parent.parent; + var forInitializer = forStatement.initializer; + if (forInitializer.declarations.length === 1) { + changes.deleteNode(sourceFile, forInitializer); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + break; + } + case 220 /* ForOfStatement */: + var forOfStatement = varDecl.parent.parent; + ts.Debug.assert(forOfStatement.initializer.kind === 231 /* VariableDeclarationList */); + var forOfInitializer = forOfStatement.initializer; + changes.replaceNode(sourceFile, forOfInitializer.declarations[0], ts.createObjectLiteral()); + break; + case 219 /* ForInStatement */: + case 228 /* TryStatement */: + break; + default: + var variableStatement = varDecl.parent.parent; + if (variableStatement.declarationList.declarations.length === 1) { + changes.deleteNode(sourceFile, variableStatement); + } + else { + changes.deleteNodeInList(sourceFile, varDecl); + } + } + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92346,62 +96517,158 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixIdPlain = "fixJSDocTypes_plain"; + var fixIdNullable = "fixJSDocTypes_nullable"; + var errorCodes = [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code]; codefix.registerCodeFix({ - errorCodes: [ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments.code], - getCodeActions: getActionsForJSDocTypes + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile; + var checker = context.program.getTypeChecker(); + var info = getInfo(sourceFile, context.span.start, checker); + if (!info) + return undefined; + var typeNode = info.typeNode, type = info.type; + var original = typeNode.getText(sourceFile); + var actions = [fix(type, fixIdPlain)]; + if (typeNode.kind === 277 /* JSDocNullableType */) { + // for nullable types, suggest the flow-compatible `T | null | undefined` + // in addition to the jsdoc/closure-compatible `T | null` + actions.push(fix(checker.getNullableType(type, 4096 /* Undefined */), fixIdNullable)); + } + return actions; + function fix(type, fixId) { + var newText = typeString(type, checker); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [createChange(typeNode, sourceFile, newText)])], + fixId: fixId, + }; + } + }, + fixIds: [fixIdPlain, fixIdNullable], + getAllCodeActions: function (context) { + var fixId = context.fixId, program = context.program, sourceFile = context.sourceFile; + var checker = program.getTypeChecker(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var info = getInfo(err.file, err.start, checker); + if (!info) + return; + var typeNode = info.typeNode, type = info.type; + var fixedType = typeNode.kind === 277 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 4096 /* Undefined */) : type; + changes.push(createChange(typeNode, sourceFile, typeString(fixedType, checker))); + }); + } }); - function getActionsForJSDocTypes(context) { - var sourceFile = context.sourceFile; - var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); + function getInfo(sourceFile, pos, checker) { + var decl = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isTypeContainer); + var typeNode = decl && decl.type; + return typeNode && { typeNode: typeNode, type: checker.getTypeFromTypeNode(typeNode) }; + } + function createChange(declaration, sourceFile, newText) { + return ts.createTextChange(ts.createTextSpanFromNode(declaration, sourceFile), newText); + } + function typeString(type, checker) { + return checker.typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* NoTruncation */); + } + function isTypeContainer(node) { // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments - var decl = ts.findAncestor(node, function (n) { - return n.kind === 203 /* AsExpression */ || - n.kind === 156 /* CallSignature */ || - n.kind === 157 /* ConstructSignature */ || - n.kind === 229 /* FunctionDeclaration */ || - n.kind === 154 /* GetAccessor */ || - n.kind === 158 /* IndexSignature */ || - n.kind === 173 /* MappedType */ || - n.kind === 152 /* MethodDeclaration */ || - n.kind === 151 /* MethodSignature */ || - n.kind === 147 /* Parameter */ || - n.kind === 150 /* PropertyDeclaration */ || - n.kind === 149 /* PropertySignature */ || - n.kind === 155 /* SetAccessor */ || - n.kind === 232 /* TypeAliasDeclaration */ || - n.kind === 185 /* TypeAssertionExpression */ || - n.kind === 227 /* VariableDeclaration */; - }); - if (!decl) - return; - var checker = context.program.getTypeChecker(); - var jsdocType = decl.type; - if (!jsdocType) - return; - var original = ts.getTextOfNode(jsdocType); - var type = checker.getTypeFromTypeNode(jsdocType); - var actions = [createAction(jsdocType, sourceFile.fileName, original, checker.typeToString(type, /*enclosingDeclaration*/ undefined, 8 /* NoTruncation */))]; - if (jsdocType.kind === 274 /* JSDocNullableType */) { - // for nullable types, suggest the flow-compatible `T | null | undefined` - // in addition to the jsdoc/closure-compatible `T | null` - var replacementWithUndefined = checker.typeToString(checker.getNullableType(type, 4096 /* Undefined */), /*enclosingDeclaration*/ undefined, 8 /* NoTruncation */); - actions.push(createAction(jsdocType, sourceFile.fileName, original, replacementWithUndefined)); + switch (node.kind) { + case 206 /* AsExpression */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 155 /* GetAccessor */: + case 159 /* IndexSignature */: + case 176 /* MappedType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: + case 188 /* TypeAssertionExpression */: + case 230 /* VariableDeclaration */: + return true; + default: + return false; } - return actions; } - function createAction(declaration, fileName, original, replacement) { + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "fixAwaitInSyncFunction"; + var errorCodes = [ + ts.Diagnostics.await_expression_is_only_allowed_within_an_async_function.code, + ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator.code, + ]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, span = context.span; + var nodes = getNodes(sourceFile, span.start); + if (!nodes) + return undefined; + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, nodes); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_async_modifier_to_containing_function), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var nodes = getNodes(diag.file, diag.start); + if (!nodes) + return; + doChange(changes, context.sourceFile, nodes); + }); }, + }); + function getReturnType(expr) { + if (expr.type) { + return expr.type; + } + if (ts.isVariableDeclaration(expr.parent) && + expr.parent.type && + ts.isFunctionTypeNode(expr.parent.type)) { + return expr.parent.type.type; + } + } + function getNodes(sourceFile, start) { + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var containingFunction = ts.getContainingFunction(token); + var insertBefore; + switch (containingFunction.kind) { + case 153 /* MethodDeclaration */: + insertBefore = containingFunction.name; + break; + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + insertBefore = ts.findChildOfKind(containingFunction, 89 /* FunctionKeyword */, sourceFile); + break; + case 191 /* ArrowFunction */: + insertBefore = ts.findChildOfKind(containingFunction, 19 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); + break; + default: + return; + } return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, replacement]), - changes: [{ - fileName: fileName, - textChanges: [{ - span: { start: declaration.getStart(), length: declaration.getWidth() }, - newText: replacement - }] - }], + insertBefore: insertBefore, + returnType: getReturnType(containingFunction) }; } + function doChange(changes, sourceFile, _a) { + var insertBefore = _a.insertBefore, returnType = _a.returnType; + if (returnType) { + var entityName = ts.getEntityNameFromTypeNode(returnType); + if (!entityName || entityName.kind !== 71 /* Identifier */ || entityName.text !== "Promise") { + changes.replaceNode(sourceFile, returnType, ts.createTypeReferenceNode("Promise", ts.createNodeArray([returnType]))); + } + } + changes.insertModifierBefore(sourceFile, 120 /* AsyncKeyword */, insertBefore); + } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -92417,125 +96684,31 @@ var ts; ts.Diagnostics.Cannot_find_namespace_0.code, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code ], - getCodeActions: getImportCodeActions + getCodeActions: getImportCodeActions, + // TODO: GH#20315 + fixIds: [], + getAllCodeActions: ts.notImplemented, }); - var ModuleSpecifierComparison; - (function (ModuleSpecifierComparison) { - ModuleSpecifierComparison[ModuleSpecifierComparison["Better"] = 0] = "Better"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; - })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = /** @class */ (function () { - function ImportCodeActionMap() { - this.symbolIdToActionMap = []; - } - ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { - var actions = this.symbolIdToActionMap[symbolId]; - if (!actions) { - this.symbolIdToActionMap[symbolId] = [newAction]; - return; - } - if (newAction.kind === "CodeChange") { - actions.push(newAction); - return; - } - var updatedNewImports = []; - for (var _i = 0, _a = this.symbolIdToActionMap[symbolId]; _i < _a.length; _i++) { - var existingAction = _a[_i]; - if (existingAction.kind === "CodeChange") { - // only import actions should compare - updatedNewImports.push(existingAction); - continue; - } - switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { - case 0 /* Better */: - // the new one is not worth considering if it is a new import. - // However if it is instead a insertion into existing import, the user might want to use - // the module specifier even it is worse by our standards. So keep it. - if (newAction.kind === "NewImport") { - return; - } - // falls through - case 1 /* Equal */: - // the current one is safe. But it is still possible that the new one is worse - // than another existing one. For example, you may have new imports from "./foo/bar" - // and "bar", when the new one is "bar/bar2" and the current one is "./foo/bar". The new - // one and the current one are not comparable (one relative path and one absolute path), - // but the new one is worse than the other one, so should not add to the list. - updatedNewImports.push(existingAction); - break; - case 2 /* Worse */: - // the existing one is worse, remove from the list. - continue; - } - } - // if we reach here, it means the new one is better or equal to all of the existing ones. - updatedNewImports.push(newAction); - this.symbolIdToActionMap[symbolId] = updatedNewImports; - }; - ImportCodeActionMap.prototype.addActions = function (symbolId, newActions) { - for (var _i = 0, newActions_1 = newActions; _i < newActions_1.length; _i++) { - var newAction = newActions_1[_i]; - this.addAction(symbolId, newAction); - } - }; - ImportCodeActionMap.prototype.getAllActions = function () { - var result = []; - for (var key in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[key]); - } - return result; - }; - ImportCodeActionMap.prototype.compareModuleSpecifiers = function (moduleSpecifier1, moduleSpecifier2) { - if (moduleSpecifier1 === moduleSpecifier2) { - return 1 /* Equal */; - } - // if moduleSpecifier1 (ms1) is a substring of ms2, then it is better - if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { - return 0 /* Better */; - } - if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { - return 2 /* Worse */; - } - // if both are relative paths, and ms1 has fewer levels, then it is better - if (ts.isExternalModuleNameRelative(moduleSpecifier1) && ts.isExternalModuleNameRelative(moduleSpecifier2)) { - var regex = new RegExp(ts.directorySeparator, "g"); - var moduleSpecifier1LevelCount = (moduleSpecifier1.match(regex) || []).length; - var moduleSpecifier2LevelCount = (moduleSpecifier2.match(regex) || []).length; - return moduleSpecifier1LevelCount < moduleSpecifier2LevelCount - ? 0 /* Better */ - : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount - ? 1 /* Equal */ - : 2 /* Worse */; - } - // the equal cases include when the two specifiers are not comparable. - return 1 /* Equal */; - }; - return ImportCodeActionMap; - }()); - function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { - return { - description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: changes, - kind: kind, - moduleSpecifier: moduleSpecifier - }; + function createCodeAction(descriptionDiagnostic, diagnosticArgs, changes) { + var description = ts.formatMessage.apply(undefined, [undefined, descriptionDiagnostic].concat(diagnosticArgs)); + // TODO: GH#20315 + return { description: description, changes: changes, fixId: undefined }; } - function convertToImportCodeFixContext(context) { + function convertToImportCodeFixContext(context, symbolToken, symbolName) { var useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; - var checker = context.program.getTypeChecker(); - var symbolToken = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var program = context.program; + var checker = program.getTypeChecker(); return { host: context.host, - newLineCharacter: context.newLineCharacter, formatContext: context.formatContext, sourceFile: context.sourceFile, + program: program, checker: checker, - compilerOptions: context.program.getCompilerOptions(), + compilerOptions: program.getCompilerOptions(), cachedImportDeclarations: [], getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), - symbolName: symbolToken.getText(), - symbolToken: symbolToken, + symbolName: symbolName, + symbolToken: symbolToken }; } var ImportKind; @@ -92544,55 +96717,77 @@ var ts; ImportKind[ImportKind["Default"] = 1] = "Default"; ImportKind[ImportKind["Namespace"] = 2] = "Namespace"; ImportKind[ImportKind["Equals"] = 3] = "Equals"; - })(ImportKind = codefix.ImportKind || (codefix.ImportKind = {})); - function getCodeActionForImport(moduleSymbols, context) { - moduleSymbols = ts.toArray(moduleSymbols); - var declarations = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getImportDeclarations(moduleSymbol, context.checker, context.sourceFile, context.cachedImportDeclarations); - }); - var actions = []; - if (context.symbolToken) { - // It is possible that multiple import statements with the same specifier exist in the file. - // e.g. - // - // import * as ns from "foo"; - // import { member1, member2 } from "foo"; - // - // member3/**/ <-- cusor here - // - // in this case we should provie 2 actions: - // 1. change "member3" to "ns.member3" - // 2. add "member3" to the second import statement's import list - // and it is up to the user to decide which one fits best. - for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { - var declaration = declarations_13[_i]; - var namespace = getNamespaceImportName(declaration); - if (namespace) { - actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken)); + })(ImportKind || (ImportKind = {})); + function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, symbolToken) { + var exportInfos = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); + ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol; })); + // We sort the best codefixes first, so taking `first` is best for completions. + var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, exportInfos, compilerOptions, getCanonicalFileName, host)).moduleSpecifier; + var ctx = { host: host, program: program, checker: checker, compilerOptions: compilerOptions, sourceFile: sourceFile, formatContext: formatContext, symbolName: symbolName, getCanonicalFileName: getCanonicalFileName, symbolToken: symbolToken }; + return { moduleSpecifier: moduleSpecifier, codeAction: ts.first(getCodeActionsForImport(exportInfos, ctx)) }; + } + codefix.getImportCompletionAction = getImportCompletionAction; + function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { + var result = []; + forEachExternalModule(checker, allSourceFiles, function (moduleSymbol) { + for (var _i = 0, _a = checker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { + var exported = _a[_i]; + if (ts.skipAlias(exported, checker) === exportedSymbol) { + var isDefaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol) === exported; + result.push({ moduleSymbol: moduleSymbol, importKind: isDefaultExport ? 1 /* Default */ : 0 /* Named */ }); } } - } - return actions.concat(getCodeActionsForAddImport(moduleSymbols, context, declarations)); + }); + return result; + } + function getCodeActionsForImport(exportInfos, context) { + var existingImports = ts.flatMap(exportInfos, function (info) { + return getImportDeclarations(info, context.checker, context.sourceFile, context.cachedImportDeclarations); + }); + // It is possible that multiple import statements with the same specifier exist in the file. + // e.g. + // + // import * as ns from "foo"; + // import { member1, member2 } from "foo"; + // + // member3/**/ <-- cusor here + // + // in this case we should provie 2 actions: + // 1. change "member3" to "ns.member3" + // 2. add "member3" to the second import statement's import list + // and it is up to the user to decide which one fits best. + var useExistingImportActions = !context.symbolToken || !ts.isIdentifier(context.symbolToken) ? ts.emptyArray : ts.mapDefined(existingImports, function (_a) { + var declaration = _a.declaration; + var namespace = getNamespaceImportName(declaration); + if (namespace) { + var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); + if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { + return getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken); + } + } + }); + return useExistingImportActions.concat(getCodeActionsForAddImport(exportInfos, context, existingImports)); } - codefix.getCodeActionForImport = getCodeActionForImport; function getNamespaceImportName(declaration) { - if (declaration.kind === 239 /* ImportDeclaration */) { + if (declaration.kind === 242 /* ImportDeclaration */) { var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings; - return namedBindings && namedBindings.kind === 241 /* NamespaceImport */ ? namedBindings.name : undefined; + return namedBindings && namedBindings.kind === 244 /* NamespaceImport */ ? namedBindings.name : undefined; } else { return declaration.name; } } // TODO(anhans): This doesn't seem important to cache... just use an iterator instead of creating a new array? - function getImportDeclarations(moduleSymbol, checker, _a, cachedImportDeclarations) { - var imports = _a.imports; + function getImportDeclarations(_a, checker, _b, cachedImportDeclarations) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var imports = _b.imports; if (cachedImportDeclarations === void 0) { cachedImportDeclarations = []; } var moduleSymbolId = ts.getUniqueSymbolId(moduleSymbol, checker); var cached = cachedImportDeclarations[moduleSymbolId]; if (!cached) { cached = cachedImportDeclarations[moduleSymbolId] = ts.mapDefined(imports, function (importModuleSpecifier) { - return checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + var declaration = checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + return declaration && { declaration: declaration, importKind: importKind }; }); } return cached; @@ -92600,42 +96795,43 @@ var ts; function getImportDeclaration(_a) { var parent = _a.parent; switch (parent.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return parent; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return parent.parent; - case 245 /* ExportDeclaration */: - case 182 /* CallExpression */:// For "require()" calls + case 248 /* ExportDeclaration */: + case 185 /* CallExpression */:// For "require()" calls // Ignore these, can't add imports to them. return undefined; default: ts.Debug.fail(); } } - function getCodeActionForNewImport(context, moduleSpecifier) { - var kind = context.kind, sourceFile = context.sourceFile, newLineCharacter = context.newLineCharacter, symbolName = context.symbolName; + function getCodeActionForNewImport(context, _a) { + var moduleSpecifier = _a.moduleSpecifier, importKind = _a.importKind; + var sourceFile = context.sourceFile, symbolName = context.symbolName; var lastImportDeclaration = ts.findLast(sourceFile.statements, ts.isAnyImportSyntax); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier); var quotedModuleSpecifier = createStringLiteralWithQuoteStyle(sourceFile, moduleSpecifierWithoutQuotes); - var importDecl = kind !== 3 /* Equals */ + var importDecl = importKind !== 3 /* Equals */ ? ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClauseOfKind(kind, symbolName), quotedModuleSpecifier) + /*modifiers*/ undefined, createImportClauseOfKind(importKind, symbolName), quotedModuleSpecifier) : ts.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createIdentifier(symbolName), ts.createExternalModuleReference(quotedModuleSpecifier)); var changes = ChangeTracker.with(context, function (changeTracker) { if (lastImportDeclaration) { - changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: newLineCharacter }); + changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl); } else { - changeTracker.insertNodeAt(sourceFile, ts.getSourceFileImportLocation(sourceFile), importDecl, { suffix: "" + newLineCharacter + newLineCharacter }); + changeTracker.insertNodeAtTopOfFile(sourceFile, importDecl, /*blankLineBetween*/ true); } }); // if this file doesn't have any import statements, insert an import statement and then insert a new line // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. - return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes); } function createStringLiteralWithQuoteStyle(sourceFile, text) { var literal = ts.createLiteral(text); @@ -92643,6 +96839,12 @@ var ts; literal.singleQuote = !!firstModuleSpecifier && !ts.isStringDoubleQuoted(firstModuleSpecifier, sourceFile); return literal; } + function usesJsExtensionOnImports(sourceFile) { + return ts.firstDefined(sourceFile.imports, function (_a) { + var text = _a.text; + return ts.pathIsRelative(text) ? ts.fileExtensionIs(text, ".js" /* Js */) : undefined; + }) || false; + } function createImportClauseOfKind(kind, symbolName) { var id = ts.createIdentifier(symbolName); switch (kind) { @@ -92656,68 +96858,87 @@ var ts; ts.Debug.assertNever(kind); } } - function getModuleSpecifiersForNewImport(sourceFile, moduleSymbols, options, getCanonicalFileName, host) { + function getNewImportInfos(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { var baseUrl = options.baseUrl, paths = options.paths, rootDirs = options.rootDirs; - var choicesForEachExportingModule = ts.mapIterator(ts.arrayIterator(moduleSymbols), function (moduleSymbol) { - var moduleFileName = moduleSymbol.valueDeclaration.getSourceFile().fileName; - var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); - var global = tryGetModuleNameFromAmbientModule(moduleSymbol) - || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) - || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) - || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); - if (global) { - return [global]; - } - var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options); - if (!baseUrl) { - return [relativePath]; - } - var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); - if (!relativeToBaseUrl) { - return [relativePath]; - } - var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options); - if (paths) { - var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); - if (fromPaths) { - return [fromPaths]; + var addJsExtension = usesJsExtensionOnImports(sourceFile); + var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (_a) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var modulePathsGroups = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { + var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); + var global = tryGetModuleNameFromAmbientModule(moduleSymbol) + || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) + || tryGetModuleNameAsNodeModule(options, moduleFileName, host, getCanonicalFileName, sourceDirectory) + || rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName); + if (global) { + return [global]; } - } - /* - Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl. + var relativePath = removeExtensionAndIndexPostFix(getRelativePath(moduleFileName, sourceDirectory, getCanonicalFileName), options, addJsExtension); + if (!baseUrl) { + return [relativePath]; + } + var relativeToBaseUrl = getRelativePathIfInDirectory(moduleFileName, baseUrl, getCanonicalFileName); + if (!relativeToBaseUrl) { + return [relativePath]; + } + var importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, options, addJsExtension); + if (paths) { + var fromPaths = tryGetModuleNameFromPaths(ts.removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths); + if (fromPaths) { + return [fromPaths]; + } + } + if (isPathRelativeToParent(relativeToBaseUrl)) { + return [relativePath]; + } + /* + Prefer a relative import over a baseUrl import if it doesn't traverse up to baseUrl. - Suppose we have: - baseUrl = /base - sourceDirectory = /base/a/b - moduleFileName = /base/foo/bar - Then: - relativePath = ../../foo/bar - getRelativePathNParents(relativePath) = 2 - pathFromSourceToBaseUrl = ../../ - getRelativePathNParents(pathFromSourceToBaseUrl) = 2 - 2 < 2 = false - In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar". + Suppose we have: + baseUrl = /base + sourceDirectory = /base/a/b + moduleFileName = /base/foo/bar + Then: + relativePath = ../../foo/bar + getRelativePathNParents(relativePath) = 2 + pathFromSourceToBaseUrl = ../../ + getRelativePathNParents(pathFromSourceToBaseUrl) = 2 + 2 < 2 = false + In this case we should prefer using the baseUrl path "/a/b" instead of the relative path "../../foo/bar". - Suppose we have: - baseUrl = /base - sourceDirectory = /base/foo/a - moduleFileName = /base/foo/bar - Then: - relativePath = ../a - getRelativePathNParents(relativePath) = 1 - pathFromSourceToBaseUrl = ../../ - getRelativePathNParents(pathFromSourceToBaseUrl) = 2 - 1 < 2 = true - In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a". - */ - var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); - var relativeFirst = getRelativePathNParents(pathFromSourceToBaseUrl) < getRelativePathNParents(relativePath); - return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + Suppose we have: + baseUrl = /base + sourceDirectory = /base/foo/a + moduleFileName = /base/foo/bar + Then: + relativePath = ../a + getRelativePathNParents(relativePath) = 1 + pathFromSourceToBaseUrl = ../../ + getRelativePathNParents(pathFromSourceToBaseUrl) = 2 + 1 < 2 = true + In this case we should prefer using the relative path "../a" instead of the baseUrl path "foo/a". + */ + var pathFromSourceToBaseUrl = getRelativePath(baseUrl, sourceDirectory, getCanonicalFileName); + var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl); + return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; + }); + return modulePathsGroups.map(function (group) { return group.map(function (moduleSpecifier) { return ({ moduleSpecifier: moduleSpecifier, importKind: importKind }); }); }); }); - // Only return results for the re-export with the shortest possible path (and also give the other path even if that's long.) - return ts.best(choicesForEachExportingModule, function (a, b) { return a[0].length < b[0].length; }); + // Sort to keep the shortest paths first, but keep [relativePath, importRelativeToBaseUrl] groups together + return ts.flatten(choicesForEachExportingModule.sort(function (a, b) { return ts.first(a).moduleSpecifier.length - ts.first(b).moduleSpecifier.length; })); + } + /** + * Looks for a existing imports that use symlinks to this module. + * Only if no symlink is available, the real path will be used. + */ + function getAllModulePaths(program, _a) { + var fileName = _a.fileName; + var symlinks = ts.mapDefined(program.getSourceFiles(), function (sf) { + return sf.resolvedModules && ts.firstDefinedIterator(sf.resolvedModules.values(), function (res) { + return res && res.resolvedFileName === fileName ? res.originalPath : undefined; + }); + }); + return symlinks.length === 0 ? [fileName] : symlinks; } - codefix.getModuleSpecifiersForNewImport = getModuleSpecifiersForNewImport; function getRelativePathNParents(relativePath) { var count = 0; for (var i = 0; i + 3 <= relativePath.length && relativePath.slice(i, i + 3) === "../"; i += 3) { @@ -92731,10 +96952,11 @@ var ts; return decl.name.text; } } - function tryGetModuleNameFromPaths(relativeNameWithIndex, relativeName, paths) { + function tryGetModuleNameFromPaths(relativeToBaseUrlWithIndex, relativeToBaseUrl, paths) { for (var key in paths) { for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) { - var pattern = _a[_i]; + var patternText_1 = _a[_i]; + var pattern = ts.removeFileExtension(ts.normalizePath(patternText_1)); var indexOfStar = pattern.indexOf("*"); if (indexOfStar === 0 && pattern.length === 1) { continue; @@ -92742,14 +96964,14 @@ var ts; else if (indexOfStar !== -1) { var prefix = pattern.substr(0, indexOfStar); var suffix = pattern.substr(indexOfStar + 1); - if (relativeName.length >= prefix.length + suffix.length && - ts.startsWith(relativeName, prefix) && - ts.endsWith(relativeName, suffix)) { - var matchedStar = relativeName.substr(prefix.length, relativeName.length - suffix.length); - return key.replace("\*", matchedStar); + if (relativeToBaseUrl.length >= prefix.length + suffix.length && + ts.startsWith(relativeToBaseUrl, prefix) && + ts.endsWith(relativeToBaseUrl, suffix)) { + var matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length); + return key.replace("*", matchedStar); } } - else if (pattern === relativeName || pattern === relativeNameWithIndex) { + else if (pattern === relativeToBaseUrl || pattern === relativeToBaseUrlWithIndex) { return key; } } @@ -92764,12 +96986,12 @@ var ts; var relativePath = normalizedSourcePath !== undefined ? getRelativePath(normalizedTargetPath, normalizedSourcePath, getCanonicalFileName) : normalizedTargetPath; return ts.removeFileExtension(relativePath); } - function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName) { + function tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) { var roots = ts.getEffectiveTypeRoots(options, host); - return roots && ts.firstDefined(roots, function (unNormalizedTypeRoot) { + return ts.firstDefined(roots, function (unNormalizedTypeRoot) { var typeRoot = ts.toPath(unNormalizedTypeRoot, /*basePath*/ undefined, getCanonicalFileName); if (ts.startsWith(moduleFileName, typeRoot)) { - return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options); + return removeExtensionAndIndexPostFix(moduleFileName.substring(typeRoot.length + 1), options, addJsExtension); } }); } @@ -92877,61 +97099,75 @@ var ts; return state > 1 /* NodeModules */ ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined; } function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) { - return ts.firstDefined(rootDirs, function (rootDir) { return getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); }); + return ts.firstDefined(rootDirs, function (rootDir) { + var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName); + return isPathRelativeToParent(relativePath) ? undefined : relativePath; + }); } - function removeExtensionAndIndexPostFix(fileName, options) { + function removeExtensionAndIndexPostFix(fileName, options, addJsExtension) { var noExtension = ts.removeFileExtension(fileName); - return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs ? ts.removeSuffix(noExtension, "/index") : noExtension; + return addJsExtension + ? noExtension + ".js" + : ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeJs + ? ts.removeSuffix(noExtension, "/index") + : noExtension; } function getRelativePathIfInDirectory(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); - return ts.isRootedDiskPath(relativePath) || ts.startsWith(relativePath, "..") ? undefined : relativePath; + return ts.isRootedDiskPath(relativePath) ? undefined : relativePath; + } + function isPathRelativeToParent(path) { + return ts.startsWith(path, ".."); } function getRelativePath(path, directoryPath, getCanonicalFileName) { var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); return !ts.pathIsRelative(relativePath) ? "./" + relativePath : relativePath; } - function getCodeActionsForAddImport(moduleSymbols, ctx, declarations) { - var fromExistingImport = ts.firstDefined(declarations, function (declaration) { - if (declaration.kind === 239 /* ImportDeclaration */ && declaration.importClause) { - var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined); + function getCodeActionsForAddImport(exportInfos, ctx, existingImports) { + var fromExistingImport = ts.firstDefined(existingImports, function (_a) { + var declaration = _a.declaration, importKind = _a.importKind; + if (declaration.kind === 242 /* ImportDeclaration */ && declaration.importClause) { + var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined, importKind); if (changes) { var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText()); - return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes); } } }); if (fromExistingImport) { return [fromExistingImport]; } - var existingDeclaration = ts.firstDefined(declarations, moduleSpecifierFromAnyImport); - var moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); - return moduleSpecifiers.map(function (spec) { return getCodeActionForNewImport(ctx, spec); }); + var existingDeclaration = ts.firstDefined(existingImports, newImportInfoFromExistingSpecifier); + var newImportInfos = existingDeclaration + ? [existingDeclaration] + : getNewImportInfos(ctx.program, ctx.sourceFile, exportInfos, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); + return newImportInfos.map(function (info) { return getCodeActionForNewImport(ctx, info); }); } - function moduleSpecifierFromAnyImport(node) { - var expression = node.kind === 239 /* ImportDeclaration */ - ? node.moduleSpecifier - : node.moduleReference.kind === 249 /* ExternalModuleReference */ - ? node.moduleReference.expression + function newImportInfoFromExistingSpecifier(_a) { + var declaration = _a.declaration, importKind = _a.importKind; + var expression = declaration.kind === 242 /* ImportDeclaration */ + ? declaration.moduleSpecifier + : declaration.moduleReference.kind === 252 /* ExternalModuleReference */ + ? declaration.moduleReference.expression : undefined; - return expression && ts.isStringLiteral(expression) ? expression.text : undefined; + return expression && ts.isStringLiteral(expression) ? { moduleSpecifier: expression.text, importKind: importKind } : undefined; } - function tryUpdateExistingImport(context, importClause) { - var symbolName = context.symbolName, sourceFile = context.sourceFile, kind = context.kind; + function tryUpdateExistingImport(context, importClause, importKind) { + var symbolName = context.symbolName, sourceFile = context.sourceFile; var name = importClause.name; - var namedBindings = (importClause.kind !== 238 /* ImportEqualsDeclaration */ && importClause).namedBindings; - switch (kind) { + var namedBindings = (importClause.kind !== 241 /* ImportEqualsDeclaration */ && importClause).namedBindings; + switch (importKind) { case 1 /* Default */: return name ? undefined : ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(ts.createIdentifier(symbolName), namedBindings)); }); case 0 /* Named */: { var newImportSpecifier_1 = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(symbolName)); - if (namedBindings && namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length !== 0) { + if (namedBindings && namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length !== 0) { // There are already named imports; add another. return ChangeTracker.with(context, function (t) { return t.insertNodeInListAfter(sourceFile, namedBindings.elements[namedBindings.elements.length - 1], newImportSpecifier_1); }); } - if (!namedBindings || namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length === 0) { + if (!namedBindings || namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length === 0) { return ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(name, ts.createNamedImports([newImportSpecifier_1]))); }); @@ -92945,7 +97181,7 @@ var ts; case 3 /* Equals */: return undefined; default: - ts.Debug.assertNever(kind); + ts.Debug.assertNever(importKind); } } function getCodeActionForUseExistingNamespaceImport(namespacePrefix, context, symbolToken) { @@ -92960,35 +97196,39 @@ var ts; * namespace instead of altering the import declaration. For example, "foo" would * become "ns.foo" */ - return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], ChangeTracker.with(context, function (tracker) { - return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolName)); - }), "CodeChange", - /*moduleSpecifier*/ undefined); + var changes = ChangeTracker.with(context, function (tracker) { + return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolToken)); + }); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes); } function getImportCodeActions(context) { - var importFixContext = convertToImportCodeFixContext(context); return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code - ? getActionsForUMDImport(importFixContext) - : getActionsForNonUMDImport(importFixContext, context.program.getSourceFiles(), context.cancellationToken); + ? getActionsForUMDImport(context) + : getActionsForNonUMDImport(context); } function getActionsForUMDImport(context) { - var checker = context.checker, symbolToken = context.symbolToken, compilerOptions = context.compilerOptions; - var umdSymbol = checker.getSymbolAtLocation(symbolToken); - var symbol; - var symbolName; - if (umdSymbol.flags & 2097152 /* Alias */) { - symbol = checker.getAliasedSymbol(umdSymbol); - symbolName = context.symbolName; + var token = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var checker = context.program.getTypeChecker(); + var umdSymbol; + if (ts.isIdentifier(token)) { + // try the identifier to see if it is the umd symbol + umdSymbol = checker.getSymbolAtLocation(token); } - else if (ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken) { + if (!ts.isUMDExportSymbol(umdSymbol)) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), symbolToken.parent.tagName, 107455 /* Value */)); - symbolName = symbol.name; + var parent = token.parent; + var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(parent); + if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 258 /* JsxOpeningFragment */) { + umdSymbol = checker.resolveName(checker.getJsxNamespace(), isNodeOpeningLikeElement ? parent.tagName : parent, 107455 /* Value */, /*excludeGlobals*/ false); + } } - else { - throw ts.Debug.fail("Either the symbol or the JSX namespace should be a UMD global if we got here"); + if (ts.isUMDExportSymbol(umdSymbol)) { + var symbol = checker.getAliasedSymbol(umdSymbol); + if (symbol) { + return getCodeActionsForImport([{ moduleSymbol: symbol, importKind: getUmdImportKind(context.program.getCompilerOptions()) }], convertToImportCodeFixContext(context, token, umdSymbol.name)); + } } - return getCodeActionForImport(symbol, __assign({}, context, { symbolName: symbolName, kind: getUmdImportKind(compilerOptions) })); + return undefined; } function getUmdImportKind(compilerOptions) { // Import a synthetic `default` if enabled. @@ -93012,33 +97252,61 @@ var ts; throw ts.Debug.assertNever(moduleKind); } } - function getActionsForNonUMDImport(context, allSourceFiles, cancellationToken) { - var sourceFile = context.sourceFile, checker = context.checker, symbolName = context.symbolName, symbolToken = context.symbolToken; + function getActionsForNonUMDImport(context) { + // This will always be an Identifier, since the diagnostics we fix only fail on identifiers. + var sourceFile = context.sourceFile, span = context.span, program = context.program, cancellationToken = context.cancellationToken; + var checker = program.getTypeChecker(); + var symbolToken = ts.getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false); + var isJsxNamespace = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken; + if (!isJsxNamespace && !ts.isIdentifier(symbolToken)) { + return undefined; + } + var symbolName = isJsxNamespace ? checker.getJsxNamespace() : symbolToken.text; + var allSourceFiles = program.getSourceFiles(); + var compilerOptions = program.getCompilerOptions(); // "default" is a keyword and not a legal identifier for the import, so we don't expect it here ts.Debug.assert(symbolName !== "default"); - var symbolIdActionMap = new ImportCodeActionMap(); var currentTokenMeaning = ts.getMeaningFromLocation(symbolToken); + // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. + // Maps symbol id to info for modules providing that symbol (original export + re-exports). + var originalSymbolToExportInfos = ts.createMultiMap(); + function addSymbol(moduleSymbol, exportedSymbol, importKind) { + originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind }); + } forEachExternalModuleToImportFrom(checker, sourceFile, allSourceFiles, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); // check the default export - var defaultExport = checker.tryGetMemberInModuleExports("default", moduleSymbol); + var defaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol); if (defaultExport) { var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport); - if ((localSymbol && localSymbol.escapedName === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, context.compilerOptions.target) === symbolName) - && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { - // check if this symbol is already used - var symbolId = ts.getUniqueSymbolId(localSymbol || defaultExport, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 1 /* Default */ }))); + if ((localSymbol && localSymbol.escapedName === symbolName || + getEscapedNameForExportDefault(defaultExport) === symbolName || + moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { + addSymbol(moduleSymbol, localSymbol || defaultExport, 1 /* Default */); } } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - var symbolId = ts.getUniqueSymbolId(exportSymbolWithIdenticalName, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 0 /* Named */ }))); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); + } + function getEscapedNameForExportDefault(symbol) { + return ts.firstDefined(symbol.declarations, function (declaration) { + if (ts.isExportAssignment(declaration)) { + if (ts.isIdentifier(declaration.expression)) { + return declaration.expression.escapedText; + } + } + else if (ts.isExportSpecifier(declaration)) { + ts.Debug.assert(declaration.name.escapedText === "default" /* Default */); + if (declaration.propertyName) { + return declaration.propertyName.escapedText; + } + } + }); } }); - return symbolIdActionMap.getAllActions(); + return ts.arrayFrom(ts.flatMapIterator(originalSymbolToExportInfos.values(), function (exportInfos) { return getCodeActionsForImport(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName)); })); } function checkSymbolHasMeaning(_a, meaning) { var declarations = _a.declarations; @@ -93064,7 +97332,6 @@ var ts; } } } - codefix.forEachExternalModule = forEachExternalModule; /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -93103,6 +97370,7 @@ var ts; // Need `|| "_"` to ensure result isn't empty. return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res; } + codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -93110,19 +97378,49 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "disableJsDiagnostics"; + var errorCodes = ts.mapDefined(Object.keys(ts.Diagnostics), function (key) { + var diag = ts.Diagnostics[key]; + return diag.category === ts.DiagnosticCategory.Error ? diag.code : undefined; + }); codefix.registerCodeFix({ - errorCodes: getApplicableDiagnosticCodes(), - getCodeActions: getDisableJsDiagnosticsCodeActions + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, span = context.span; + if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { + return undefined; + } + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + return [{ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter).change])], + fixId: fixId, + }, + { + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), + changes: [codefix.createFileTextChanges(sourceFile.fileName, [ + ts.createTextChange(sourceFile.checkJsDirective ? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) : ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter), + ])], + // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. + fixId: undefined, + }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var seenLines = ts.createMap(); // Only need to add `// @ts-ignore` for a line once. + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + if (err.start !== undefined) { + var _a = getIgnoreCommentLocationForLocation(err.file, err.start, ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options)), lineNumber = _a.lineNumber, change = _a.change; + if (ts.addToSeen(seenLines, lineNumber)) { + changes.push(change); + } + } + }); + }, }); - function getApplicableDiagnosticCodes() { - var allDiagnostcs = ts.Diagnostics; - return Object.keys(allDiagnostcs) - .filter(function (d) { return allDiagnostcs[d] && allDiagnostcs[d].category === ts.DiagnosticCategory.Error; }) - .map(function (d) { return allDiagnostcs[d].code; }); - } function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { - var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; - var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + var lineNumber = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + var lineStartPosition = ts.getStartPositionOfLine(lineNumber, sourceFile); var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); // First try to see if we can put the '// @ts-ignore' on the previous line. // We need to make sure that we are not in the middle of a string literal or a comment. @@ -93130,45 +97428,13 @@ var ts; // if so, we do not want to separate the node from its comment if we can. if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { var token = ts.getTouchingToken(sourceFile, startPosition, /*includeJsDocComment*/ false); - var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); - if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { - return { - span: { start: startPosition, length: 0 }, - newText: "// @ts-ignore" + newLineCharacter - }; + var tokenLeadingComments = ts.getLeadingCommentRangesOfNode(token, sourceFile); + if (!tokenLeadingComments || !tokenLeadingComments.length || tokenLeadingComments[0].pos >= startPosition) { + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(startPosition, 0, "// @ts-ignore" + newLineCharacter) }; } } // If all fails, add an extra new line immediately before the error span. - return { - span: { start: position, length: 0 }, - newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter - }; - } - function getDisableJsDiagnosticsCodeActions(context) { - var sourceFile = context.sourceFile, program = context.program, newLineCharacter = context.newLineCharacter, span = context.span; - if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { - return undefined; - } - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)] - }] - }, - { - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { - start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, - length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 - }, - newText: "// @ts-nocheck" + newLineCharacter - }] - }] - }]; + return { lineNumber: lineNumber, change: ts.createTextChangeFromStartLength(position, 0, (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter) }; } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -93177,80 +97443,49 @@ var ts; (function (ts) { var codefix; (function (codefix) { - function newNodesToChanges(newNodes, insertAfter, context) { - var sourceFile = context.sourceFile; - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - for (var _i = 0, newNodes_1 = newNodes; _i < newNodes_1.length; _i++) { - var newNode = newNodes_1[_i]; - changeTracker.insertNodeAfter(sourceFile, insertAfter, newNode, { suffix: context.newLineCharacter }); - } - var changes = changeTracker.getChanges(); - if (!ts.some(changes)) { - return changes; - } - ts.Debug.assert(changes.length === 1); - var consolidatedChanges = [{ - fileName: changes[0].fileName, - textChanges: [{ - span: changes[0].textChanges[0].span, - newText: changes[0].textChanges.reduce(function (prev, cur) { return prev + cur.newText; }, "") - }] - }]; - return consolidatedChanges; - } - codefix.newNodesToChanges = newNodesToChanges; /** * Finds members of the resolved type that are missing in the class pointed to by class decl * and generates source code for the missing members. * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. * @returns Empty string iff there are no member insertions. */ - function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker) { + function createMissingMemberNodes(classDeclaration, possiblyMissingSymbols, checker, out) { var classMembers = classDeclaration.symbol.members; - var missingMembers = possiblyMissingSymbols.filter(function (symbol) { return !classMembers.has(symbol.escapedName); }); - var newNodes = []; - for (var _i = 0, missingMembers_1 = missingMembers; _i < missingMembers_1.length; _i++) { - var symbol = missingMembers_1[_i]; - var newNode = createNewNodeForMemberSymbol(symbol, classDeclaration, checker); - if (newNode) { - if (Array.isArray(newNode)) { - newNodes = newNodes.concat(newNode); - } - else { - newNodes.push(newNode); - } + for (var _i = 0, possiblyMissingSymbols_1 = possiblyMissingSymbols; _i < possiblyMissingSymbols_1.length; _i++) { + var symbol = possiblyMissingSymbols_1[_i]; + if (!classMembers.has(symbol.escapedName)) { + addNewNodeForMemberSymbol(symbol, classDeclaration, checker, out); } } - return newNodes; } codefix.createMissingMemberNodes = createMissingMemberNodes; /** * @returns Empty string iff there we can't figure out a representation for `symbol` in `enclosingDeclaration`. */ - function createNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker) { + function addNewNodeForMemberSymbol(symbol, enclosingDeclaration, checker, out) { var declarations = symbol.getDeclarations(); if (!(declarations && declarations.length)) { return undefined; } var declaration = declarations[0]; // Clone name to remove leading trivia. - var name = ts.getSynthesizedClone(ts.getNameOfDeclaration(declaration)); + var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration)); var visibilityModifier = createVisibilityModifier(ts.getModifierFlags(declaration)); var modifiers = visibilityModifier ? ts.createNodeArray([visibilityModifier]) : undefined; var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); var optional = !!(symbol.flags & 16777216 /* Optional */); switch (declaration.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 149 /* PropertySignature */: - case 150 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 150 /* PropertySignature */: + case 151 /* PropertyDeclaration */: var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); - var property = ts.createProperty( + out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeNode, - /*initializer*/ undefined); - return property; - case 151 /* MethodSignature */: - case 152 /* MethodDeclaration */: + /*initializer*/ undefined)); + break; + case 152 /* MethodSignature */: + case 153 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -93260,70 +97495,65 @@ var ts; // correspondence of declarations and signatures. var signatures = checker.getSignaturesOfType(type, 0 /* Call */); if (!ts.some(signatures)) { - return undefined; + break; } if (declarations.length === 1) { ts.Debug.assert(signatures.length === 1); var signature = signatures[0]; - return signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); + outputMethod(signature, modifiers, name, createStubbedMethodBody()); + break; } - var signatureDeclarations = []; for (var _i = 0, signatures_8 = signatures; _i < signatures_8.length; _i++) { var signature = signatures_8[_i]; - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + // Need to ensure nodes are fresh each time so they can have different positions. + outputMethod(signature, getSynthesizedDeepClones(modifiers), ts.getSynthesizedDeepClone(name)); } if (declarations.length > signatures.length) { var signature = checker.getSignatureFromDeclaration(declarations[declarations.length - 1]); - var methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration, createStubbedMethodBody()); - if (methodDeclaration) { - signatureDeclarations.push(methodDeclaration); - } + outputMethod(signature, modifiers, name, createStubbedMethodBody()); } else { ts.Debug.assert(declarations.length === signatures.length); - var methodImplementingSignatures = createMethodImplementingSignatures(signatures, name, optional, modifiers); - signatureDeclarations.push(methodImplementingSignatures); + out(createMethodImplementingSignatures(signatures, name, optional, modifiers)); } - return signatureDeclarations; - default: - return undefined; + break; } - function signatureToMethodDeclaration(signature, enclosingDeclaration, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 152 /* MethodDeclaration */, enclosingDeclaration, ts.NodeBuilderFlags.SuppressAnyReturnType); - if (signatureDeclaration) { - signatureDeclaration.decorators = undefined; - signatureDeclaration.modifiers = modifiers; - signatureDeclaration.name = name; - signatureDeclaration.questionToken = optional ? ts.createToken(55 /* QuestionToken */) : undefined; - signatureDeclaration.body = body; - } - return signatureDeclaration; + function outputMethod(signature, modifiers, name, body) { + var method = signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body); + if (method) + out(method); } } - function createMethodFromCallExpression(callExpression, methodName, includeTypeScriptSyntax, makeStatic) { - var parameters = createDummyParameters(callExpression.arguments.length, /*names*/ undefined, /*minArgumentCount*/ undefined, includeTypeScriptSyntax); - var typeParameters; - if (includeTypeScriptSyntax) { - var typeArgCount = ts.length(callExpression.typeArguments); - for (var i = 0; i < typeArgCount; i++) { - var name = typeArgCount < 8 ? String.fromCharCode(84 /* T */ + i) : "T" + i; - var typeParameter = ts.createTypeParameterDeclaration(name, /*constraint*/ undefined, /*defaultType*/ undefined); - (typeParameters ? typeParameters : typeParameters = []).push(typeParameter); - } + function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 153 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); + if (!signatureDeclaration) { + return undefined; } - var newMethod = ts.createMethod( + signatureDeclaration.decorators = undefined; + signatureDeclaration.modifiers = modifiers; + signatureDeclaration.name = name; + signatureDeclaration.questionToken = optional ? ts.createToken(55 /* QuestionToken */) : undefined; + signatureDeclaration.body = body; + return signatureDeclaration; + } + function getSynthesizedDeepClones(nodes) { + return nodes && ts.createNodeArray(nodes.map(ts.getSynthesizedDeepClone)); + } + function createMethodFromCallExpression(_a, methodName, inJs, makeStatic) { + var typeArguments = _a.typeArguments, args = _a.arguments; + return ts.createMethod( /*decorators*/ undefined, /*modifiers*/ makeStatic ? [ts.createToken(115 /* StaticKeyword */)] : undefined, /*asteriskToken*/ undefined, methodName, - /*questionToken*/ undefined, typeParameters, parameters, - /*type*/ includeTypeScriptSyntax ? ts.createKeywordTypeNode(119 /* AnyKeyword */) : undefined, createStubbedMethodBody()); - return newMethod; + /*questionToken*/ undefined, + /*typeParameters*/ inJs ? undefined : ts.map(typeArguments, function (_, i) { + return ts.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i); + }), + /*parameters*/ createDummyParameters(args.length, /*names*/ undefined, /*minArgumentCount*/ undefined, inJs), + /*type*/ inJs ? undefined : ts.createKeywordTypeNode(119 /* AnyKeyword */), createStubbedMethodBody()); } codefix.createMethodFromCallExpression = createMethodFromCallExpression; - function createDummyParameters(argCount, names, minArgumentCount, addAnyType) { + function createDummyParameters(argCount, names, minArgumentCount, inJs) { var parameters = []; for (var i = 0; i < argCount; i++) { var newParameter = ts.createParameter( @@ -93332,7 +97562,7 @@ var ts; /*dotDotDotToken*/ undefined, /*name*/ names && names[i] || "arg" + i, /*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.createToken(55 /* QuestionToken */) : undefined, - /*type*/ addAnyType ? ts.createKeywordTypeNode(119 /* AnyKeyword */) : undefined, + /*type*/ inJs ? undefined : ts.createKeywordTypeNode(119 /* AnyKeyword */), /*initializer*/ undefined); parameters.push(newParameter); } @@ -93358,7 +97588,7 @@ var ts; } var maxNonRestArgs = maxArgsSignature.parameters.length - (maxArgsSignature.hasRestParameter ? 1 : 0); var maxArgsParameterSymbolNames = maxArgsSignature.parameters.map(function (symbol) { return symbol.name; }); - var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*addAnyType*/ true); + var parameters = createDummyParameters(maxNonRestArgs, maxArgsParameterSymbolNames, minArgumentCount, /*inJs*/ false); if (someSigHasRestParameter) { var anyArrayType = ts.createArrayTypeNode(ts.createKeywordTypeNode(119 /* AnyKeyword */)); var restParameter = ts.createParameter( @@ -93377,7 +97607,6 @@ var ts; /*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeParameters, parameters, returnType, createStubbedMethodBody()); } - codefix.createStubbedMethod = createStubbedMethod; function createStubbedMethodBody() { return ts.createBlock([ts.createThrow(ts.createNew(ts.createIdentifier("Error"), /*typeArguments*/ undefined, [ts.createLiteral("Method not implemented.")]))], @@ -93399,228 +97628,237 @@ var ts; (function (ts) { var codefix; (function (codefix) { + var fixId = "inferFromUsage"; + var errorCodes = [ + // Variable declarations + ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, + // Variable uses + ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, + // Parameter declarations + ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, + ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, + // Get Accessor declarations + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, + ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, + // Set Accessor declarations + ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, + // Property declarations + ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, + ]; codefix.registerCodeFix({ - errorCodes: [ - // Variable declarations - ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, - // Variable uses - ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code, - // Parameter declarations - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code, - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, - // Get Accessor declarations - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, - ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, - // Set Accessor declarations - ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, - // Property declarations - ts.Diagnostics.Member_0_implicitly_has_an_1_type.code, - ], - getCodeActions: getActionsForAddExplicitTypeAnnotation + errorCodes: errorCodes, + getCodeActions: function (_a) { + var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; + if (ts.isSourceFileJavaScript(sourceFile)) { + return undefined; // TODO: GH#20113 + } + var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + var fix = getFix(sourceFile, token, errorCode, program, cancellationToken); + if (!fix) + return undefined; + var declaration = fix.declaration, textChanges = fix.textChanges; + var name = ts.getNameOfDeclaration(declaration); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name.getText()]); + return [{ description: description, changes: [{ fileName: sourceFile.fileName, textChanges: textChanges }], fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken; + var seenFunctions = ts.createMap(); + return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + var fix = getFix(sourceFile, ts.getTokenAtPosition(err.file, err.start, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions); + if (fix) + changes.push.apply(changes, fix.textChanges); + }); + }, }); - function getActionsForAddExplicitTypeAnnotation(_a) { - var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; - var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var writer; - if (ts.isInJavaScriptFile(token)) { + function getDiagnostic(errorCode, token) { + switch (errorCode) { + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + return ts.isSetAccessor(ts.getContainingFunction(token)) ? ts.Diagnostics.Infer_type_of_0_from_usage : ts.Diagnostics.Infer_parameter_types_from_usage; + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return ts.Diagnostics.Infer_parameter_types_from_usage; + default: + return ts.Diagnostics.Infer_type_of_0_from_usage; + } + } + function getFix(sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { + if (!isAllowedTokenKind(token.kind)) { return undefined; } - switch (token.kind) { + switch (errorCode) { + // Variable and Property declarations + case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: + case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: + return getCodeActionForVariableDeclaration(token.parent, program, cancellationToken); + case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: { + var symbol = program.getTypeChecker().getSymbolAtLocation(token); + return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration, program, cancellationToken); + } + } + var containingFunction = ts.getContainingFunction(token); + if (containingFunction === undefined) { + return undefined; + } + switch (errorCode) { + // Parameter declarations + case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + if (ts.isSetAccessor(containingFunction)) { + return getCodeActionForSetAccessor(containingFunction, program, cancellationToken); + } + // falls through + case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return !seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction)) + ? getCodeActionForParameters(ts.cast(token.parent, ts.isParameter), containingFunction, sourceFile, program, cancellationToken) + : undefined; + // Get Accessor declarations + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: + case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: + return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + // Set Accessor declarations + case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: + return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, program, cancellationToken) : undefined; + default: + throw ts.Debug.fail(String(errorCode)); + } + } + function isAllowedTokenKind(kind) { + switch (kind) { case 71 /* Identifier */: case 24 /* DotDotDotToken */: case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: - // Allowed - break; + case 132 /* ReadonlyKeyword */: + return true; default: - return undefined; + return false; } - var containingFunction = ts.getContainingFunction(token); - var checker = program.getTypeChecker(); - switch (errorCode) { - // Variable and Property declarations - case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: - case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: - return getCodeActionForVariableDeclaration(token.parent); - case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: - return getCodeActionForVariableUsage(token); - // Parameter declarations - case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: - if (ts.isSetAccessor(containingFunction)) { - return getCodeActionForSetAccessor(containingFunction); - } - // falls through - case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - return getCodeActionForParameters(token.parent); - // Get Accessor declarations - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: - case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: - return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction) : undefined; - // Set Accessor declarations - case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: - return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction) : undefined; + } + function getCodeActionForVariableDeclaration(declaration, program, cancellationToken) { + if (!ts.isIdentifier(declaration.name)) + return undefined; + var type = inferTypeForVariableFromUsage(declaration.name, program, cancellationToken); + return makeFix(declaration, declaration.name.getEnd(), type, program); + } + function isApplicableFunctionForInference(declaration) { + switch (declaration.kind) { + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + return true; + case 190 /* FunctionExpression */: + return !!declaration.name; } - return undefined; - function getCodeActionForVariableDeclaration(declaration) { - if (!ts.isIdentifier(declaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(declaration.name); - var typeString = type && typeToString(type, declaration); - if (!typeString) { - return undefined; - } - return createCodeActions(declaration.name.getText(), declaration.name.getEnd(), ": " + typeString); - } - function getCodeActionForVariableUsage(token) { - var symbol = checker.getSymbolAtLocation(token); - return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration); - } - function isApplicableFunctionForInference(declaration) { - switch (declaration.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - return true; - case 187 /* FunctionExpression */: - return !!declaration.name; - } - return false; - } - function getCodeActionForParameters(parameterDeclaration) { - if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { - return undefined; - } - var types = inferTypeForParametersFromUsage(containingFunction) || - ts.map(containingFunction.parameters, function (p) { return ts.isIdentifier(p.name) && inferTypeForVariableFromUsage(p.name); }); - if (!types) { - return undefined; - } - var textChanges = ts.zipWith(containingFunction.parameters, types, function (parameter, type) { - if (type && !parameter.type && !parameter.initializer) { - var typeString = typeToString(type, containingFunction); - return typeString ? { - span: { start: parameter.end, length: 0 }, - newText: ": " + typeString - } : undefined; - } - }).filter(function (c) { return !!c; }); - return textChanges.length ? [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_parameter_types_from_usage), [parameterDeclaration.name.getText()]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: textChanges - }] - }] : undefined; - } - function getCodeActionForSetAccessor(setAccessorDeclaration) { - var setAccessorParameter = setAccessorDeclaration.parameters[0]; - if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name) || - inferTypeForVariableFromUsage(setAccessorParameter.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - return createCodeActions(setAccessorDeclaration.name.getText(), setAccessorParameter.name.getEnd(), ": " + typeString); - } - function getCodeActionForGetAccessor(getAccessorDeclaration) { - if (!ts.isIdentifier(getAccessorDeclaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name); - var typeString = type && typeToString(type, containingFunction); - if (!typeString) { - return undefined; - } - var closeParenToken = getFirstChildOfKind(getAccessorDeclaration, sourceFile, 20 /* CloseParenToken */); - return createCodeActions(getAccessorDeclaration.name.getText(), closeParenToken.getEnd(), ": " + typeString); - } - function createCodeActions(name, start, typeString) { - return [{ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Infer_type_of_0_from_usage), [name]), - changes: [{ - fileName: sourceFile.fileName, - textChanges: [{ - span: { start: start, length: 0 }, - newText: typeString - }] - }] - }]; - } - function getReferences(token) { - var references = ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), token.getSourceFile(), token.getStart()); - ts.Debug.assert(!!references, "Found no references!"); - ts.Debug.assert(references.length === 1, "Found more references than expected"); - return ts.map(references[0].references, function (r) { return ts.getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false); }); - } - function inferTypeForVariableFromUsage(token) { - return InferFromReference.inferTypeFromReferences(getReferences(token), checker, cancellationToken); - } - function inferTypeForParametersFromUsage(containingFunction) { - switch (containingFunction.kind) { - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - var isConstructor = containingFunction.kind === 153 /* Constructor */; - var searchToken = isConstructor ? - getFirstChildOfKind(containingFunction, sourceFile, 123 /* ConstructorKeyword */) : - containingFunction.name; - if (searchToken) { - return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken), containingFunction, checker, cancellationToken); - } - } - } - function getTypeAccessiblityWriter() { - if (!writer) { - var str_1 = ""; - var typeIsAccessible_1 = true; - var writeText = function (text) { return str_1 += text; }; - writer = { - string: function () { return typeIsAccessible_1 ? str_1 : undefined; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeProperty: writeText, - writeSymbol: writeText, - writeLine: function () { return str_1 += " "; }, - increaseIndent: ts.noop, - decreaseIndent: ts.noop, - clear: function () { str_1 = ""; typeIsAccessible_1 = true; }, - trackSymbol: function (symbol, declaration, meaning) { - if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { - typeIsAccessible_1 = false; - } - }, - reportInaccessibleThisError: function () { typeIsAccessible_1 = false; }, - reportPrivateInBaseOfClassExpression: function () { typeIsAccessible_1 = false; }, - reportInaccessibleUniqueSymbolError: function () { typeIsAccessible_1 = false; } - }; - } - writer.clear(); - return writer; - } - function typeToString(type, enclosingDeclaration) { - var writer = getTypeAccessiblityWriter(); - checker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration); - return writer.string(); - } - function getFirstChildOfKind(node, sourcefile, kind) { - for (var _i = 0, _a = node.getChildren(sourcefile); _i < _a.length; _i++) { - var child = _a[_i]; - if (child.kind === kind) - return child; - } + return false; + } + function getCodeActionForParameters(parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { return undefined; } + var types = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) || + containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : undefined; }); + if (!types) + return undefined; + // We didn't actually find a set of type inference positions matching each parameter position + if (containingFunction.parameters.length !== types.length) { + return undefined; + } + var textChanges = ts.arrayFrom(ts.mapDefinedIterator(ts.zipToIterator(containingFunction.parameters, types), function (_a) { + var parameter = _a[0], type = _a[1]; + return type && !parameter.type && !parameter.initializer ? makeChange(containingFunction, parameter.end, type, program) : undefined; + })); + return textChanges.length ? { declaration: parameterDeclaration, textChanges: textChanges } : undefined; + } + function getCodeActionForSetAccessor(setAccessorDeclaration, program, cancellationToken) { + var setAccessorParameter = setAccessorDeclaration.parameters[0]; + if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken) || + inferTypeForVariableFromUsage(setAccessorParameter.name, program, cancellationToken); + return makeFix(setAccessorParameter, setAccessorParameter.name.getEnd(), type, program); + } + function getCodeActionForGetAccessor(getAccessorDeclaration, sourceFile, program, cancellationToken) { + if (!ts.isIdentifier(getAccessorDeclaration.name)) { + return undefined; + } + var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name, program, cancellationToken); + var closeParenToken = ts.findChildOfKind(getAccessorDeclaration, 20 /* CloseParenToken */, sourceFile); + return makeFix(getAccessorDeclaration, closeParenToken.getEnd(), type, program); + } + function makeFix(declaration, start, type, program) { + return type && { declaration: declaration, textChanges: [makeChange(declaration, start, type, program)] }; + } + function makeChange(declaration, start, type, program) { + var typeString = type && typeToString(type, declaration, program.getTypeChecker()); + return typeString === undefined ? undefined : ts.createTextChangeFromStartLength(start, 0, ": " + typeString); + } + function getReferences(token, program, cancellationToken) { + // Position shouldn't matter since token is not a SourceFile. + return ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function (entry) { + return entry.type === "node" ? ts.tryCast(entry.node, ts.isIdentifier) : undefined; + }); + } + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + return InferFromReference.inferTypeFromReferences(getReferences(token, program, cancellationToken), program.getTypeChecker(), cancellationToken); + } + function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) { + switch (containingFunction.kind) { + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + var isConstructor = containingFunction.kind === 154 /* Constructor */; + var searchToken = isConstructor ? + ts.findChildOfKind(containingFunction, 123 /* ConstructorKeyword */, sourceFile) : + containingFunction.name; + if (searchToken) { + return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); + } + } + } + function getTypeAccessiblityWriter(checker) { + var str = ""; + var typeIsAccessible = true; + var writeText = function (text) { return str += text; }; + return { + getText: function () { return typeIsAccessible ? str : undefined; }, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: writeText, + write: writeText, + writeTextOfNode: writeText, + rawWrite: writeText, + writeLiteral: writeText, + getTextPos: function () { return 0; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, + writeLine: function () { return writeText(" "); }, + increaseIndent: ts.noop, + decreaseIndent: ts.noop, + clear: function () { str = ""; typeIsAccessible = true; }, + trackSymbol: function (symbol, declaration, meaning) { + if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { + typeIsAccessible = false; + } + }, + reportInaccessibleThisError: function () { typeIsAccessible = false; }, + reportPrivateInBaseOfClassExpression: function () { typeIsAccessible = false; }, + reportInaccessibleUniqueSymbolError: function () { typeIsAccessible = false; } + }; + } + function typeToString(type, enclosingDeclaration, checker) { + var writer = getTypeAccessiblityWriter(checker); + checker.writeType(type, enclosingDeclaration, /*flags*/ undefined, writer); + return writer.getText(); } var InferFromReference; (function (InferFromReference) { @@ -93635,40 +97873,43 @@ var ts; } InferFromReference.inferTypeFromReferences = inferTypeFromReferences; function inferTypeForParametersFromReferences(references, declaration, checker, cancellationToken) { - if (declaration.parameters) { - var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; - cancellationToken.throwIfCancellationRequested(); - inferTypeFromContext(reference, checker, usageContext); - } - var isConstructor = declaration.kind === 153 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - if (callContexts) { - var paramTypes = []; - for (var parameterIndex = 0; parameterIndex < declaration.parameters.length; parameterIndex++) { - var types = []; - var isRestParameter_1 = ts.isRestParameter(declaration.parameters[parameterIndex]); - for (var _a = 0, callContexts_1 = callContexts; _a < callContexts_1.length; _a++) { - var callContext = callContexts_1[_a]; - if (callContext.argumentTypes.length > parameterIndex) { - if (isRestParameter_1) { - types = ts.concatenate(types, ts.map(callContext.argumentTypes.slice(parameterIndex), function (a) { return checker.getBaseTypeOfLiteralType(a); })); - } - else { - types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); - } - } - } - if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); - paramTypes[parameterIndex] = isRestParameter_1 ? checker.createArrayType(type) : type; + if (references.length === 0) { + return undefined; + } + if (!declaration.parameters) { + return undefined; + } + var usageContext = {}; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + var isConstructor = declaration.kind === 154 /* Constructor */; + var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; + return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var types = []; + var isRestParameter = ts.isRestParameter(parameter); + for (var _i = 0, callContexts_1 = callContexts; _i < callContexts_1.length; _i++) { + var callContext = callContexts_1[_i]; + if (callContext.argumentTypes.length <= parameterIndex) { + continue; + } + if (isRestParameter) { + for (var i = parameterIndex; i < callContext.argumentTypes.length; i++) { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); } } - return paramTypes; + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } } - } - return undefined; + if (!types.length) { + return undefined; + } + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); + return isRestParameter ? checker.createArrayType(type) : type; + }); } InferFromReference.inferTypeForParametersFromReferences = inferTypeForParametersFromReferences; function inferTypeFromContext(node, checker, usageContext) { @@ -93676,21 +97917,21 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: usageContext.isNumber = true; break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); break; - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpressionContext(node.parent, checker, usageContext); } @@ -93698,10 +97939,10 @@ var ts; inferTypeFromContextualType(node, checker, usageContext); } break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); break; default: @@ -93801,7 +98042,7 @@ var ts; // LogicalOperator case 54 /* BarBarToken */: if (node === parent.left && - (node.parent.parent.kind === 227 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 230 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); @@ -93829,7 +98070,7 @@ var ts; } } inferTypeFromContext(parent, checker, callContext.returnType); - if (parent.kind === 182 /* CallExpression */) { + if (parent.kind === 185 /* CallExpression */) { (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); } else { @@ -93873,12 +98114,12 @@ var ts; return checker.getStringType(); } else if (usageContext.candidateTypes) { - return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), /*subtypeReduction*/ true)); + return checker.getWidenedType(checker.getUnionType(ts.map(usageContext.candidateTypes, function (t) { return checker.getBaseTypeOfLiteralType(t); }), 2 /* Subtype */)); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("then"))) { var paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then").callContexts, /*isRestParameter*/ false, checker); var types = paramType.getCallSignatures().map(function (c) { return c.getReturnType(); }); - return checker.createPromiseType(types.length ? checker.getUnionType(types, /*subtypeReduction*/ true) : checker.getAnyType()); + return checker.createPromiseType(types.length ? checker.getUnionType(types, 2 /* Subtype */) : checker.getAnyType()); } else if (usageContext.properties && hasCallContext(usageContext.properties.get("push"))) { return checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push").callContexts, /*isRestParameter*/ false, checker)); @@ -93936,7 +98177,7 @@ var ts; } } if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); return isRestParameter ? checker.createArrayType(type) : type; } return undefined; @@ -93962,6 +98203,84 @@ var ts; })(InferFromReference || (InferFromReference = {})); })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime.code], + getCodeActions: getActionsForInvalidImport + }); + function getActionsForInvalidImport(context) { + var sourceFile = context.sourceFile; + // This is the whole import statement, eg: + // import * as Bluebird from 'bluebird'; + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + var node = ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false).parent; + if (!ts.isImportDeclaration(node)) { + // No import quick fix for import calls + return []; + } + return getCodeFixesForImportDeclaration(context, node); + } + function getCodeFixesForImportDeclaration(context, node) { + var sourceFile = ts.getSourceFileOfNode(node); + var namespace = ts.getNamespaceDeclarationNode(node); + var opts = context.program.getCompilerOptions(); + var variations = []; + // import Bluebird from "bluebird"; + variations.push(createAction(context, sourceFile, node, ts.createImportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, ts.createImportClause(namespace.name, /*namedBindings*/ undefined), node.moduleSpecifier))); + if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) { + // import Bluebird = require("bluebird"); + variations.push(createAction(context, sourceFile, node, ts.createImportEqualsDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)))); + } + return variations; + } + function createAction(context, sourceFile, node, replacement) { + // TODO: GH#21246 Should be able to use `replaceNode`, but be sure to preserve comments (see `codeFixCalledES2015Import11.ts`) + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceRange(sourceFile, { pos: node.getStart(), end: node.end }, replacement); }); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), + changes: changes, + }; + } + codefix.registerCodeFix({ + errorCodes: [ + ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code, + ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature.code, + ], + getCodeActions: getActionsForUsageOfInvalidImport + }); + function getActionsForUsageOfInvalidImport(context) { + var sourceFile = context.sourceFile; + var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 185 /* CallExpression */ : 186 /* NewExpression */; + var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); }); + if (!node) { + return []; + } + var expr = node.expression; + var type = context.program.getTypeChecker().getTypeAtLocation(expr); + if (!(type.symbol && type.symbol.originatingImport)) { + return []; + } + var fixes = []; + var relatedImport = type.symbol.originatingImport; + if (!ts.isImportCall(relatedImport)) { + ts.addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport)); + } + fixes.push({ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Use_synthetic_default_member), + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, expr, ts.createPropertyAccess(expr, "default"), {}); }), + }); + return fixes; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); /// /// /// @@ -93975,10 +98294,12 @@ var ts; /// /// /// +/// /// /// /// /// +/// /* @internal */ var ts; (function (ts) { @@ -93986,14 +98307,10 @@ var ts; (function (refactor) { var annotateWithTypeFromJSDoc; (function (annotateWithTypeFromJSDoc) { + var refactorName = "Annotate with type from JSDoc"; var actionName = "annotate"; - var annotateTypeFromJSDoc = { - name: "Annotate with type from JSDoc", - description: ts.Diagnostics.Annotate_with_type_from_JSDoc.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(annotateTypeFromJSDoc); + var description = ts.Diagnostics.Annotate_with_type_from_JSDoc.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.isInJavaScriptFile(context.file)) { return undefined; @@ -94001,11 +98318,11 @@ var ts; var node = ts.getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false); if (hasUsableJSDoc(ts.findAncestor(node, isDeclarationWithType))) { return [{ - name: annotateTypeFromJSDoc.name, - description: annotateTypeFromJSDoc.description, + name: refactorName, + description: description, actions: [ { - description: annotateTypeFromJSDoc.description, + description: description, name: actionName } ] @@ -94032,7 +98349,7 @@ var ts; } var jsdocType = ts.getJSDocType(decl); var isFunctionWithJSDoc = ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); })); - if (isFunctionWithJSDoc || jsdocType && decl.kind === 147 /* Parameter */) { + if (isFunctionWithJSDoc || jsdocType && decl.kind === 148 /* Parameter */) { return getEditsForFunctionAnnotation(context); } else if (jsdocType) { @@ -94053,7 +98370,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var declarationWithType = addType(decl, transformJSDocType(jsdocType)); ts.suppressLeadingAndTrailingTrivia(declarationWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, declarationWithType); + changeTracker.replaceNode(sourceFile, decl, declarationWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -94067,7 +98384,7 @@ var ts; var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); var functionWithType = addTypesToFunctionLike(decl); ts.suppressLeadingAndTrailingTrivia(functionWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, functionWithType); + changeTracker.replaceNode(sourceFile, decl, functionWithType, ts.textChanges.useNonAdjustedPositions); return { edits: changeTracker.getChanges(), renameFilename: undefined, @@ -94076,29 +98393,29 @@ var ts; } function isDeclarationWithType(node) { return ts.isFunctionLikeDeclaration(node) || - node.kind === 227 /* VariableDeclaration */ || - node.kind === 147 /* Parameter */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 230 /* VariableDeclaration */ || + node.kind === 148 /* Parameter */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 151 /* PropertyDeclaration */; } function addTypesToFunctionLike(decl) { var typeParameters = ts.getEffectiveTypeParameterDeclarations(decl, /*checkJSDoc*/ true); var parameters = decl.parameters.map(function (p) { return ts.createParameter(p.decorators, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, transformJSDocType(ts.getEffectiveTypeAnnotationNode(p, /*checkJSDoc*/ true)), p.initializer); }); var returnType = transformJSDocType(ts.getEffectiveReturnTypeNode(decl, /*checkJSDoc*/ true)); switch (decl.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.createFunctionDeclaration(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.createMethod(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, decl.questionToken, typeParameters, parameters, returnType, decl.body); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.createGetAccessor(decl.decorators, decl.modifiers, decl.name, decl.parameters, returnType, decl.body); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.createSetAccessor(decl.decorators, decl.modifiers, decl.name, parameters, decl.body); default: return ts.Debug.assertNever(decl, "Unexpected SyntaxKind: " + decl.kind); @@ -94106,11 +98423,11 @@ var ts; } function addType(decl, jsdocType) { switch (decl.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.createVariableDeclaration(decl.name, jsdocType, decl.initializer); - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.createPropertySignature(decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); default: return ts.Debug.fail("Unexpected SyntaxKind: " + decl.kind); @@ -94121,22 +98438,22 @@ var ts; return undefined; } switch (node.kind) { - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return ts.createTypeReferenceNode("any", ts.emptyArray); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return transformJSDocOptionalType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return transformJSDocType(node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return transformJSDocNullableType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return transformJSDocVariadicType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return transformJSDocFunctionType(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return transformJSDocParameter(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return transformJSDocTypeReference(node); default: var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); @@ -94159,7 +98476,7 @@ var ts; } function transformJSDocParameter(node) { var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 278 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + var isRest = node.type.kind === 281 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; var name = node.name || (isRest ? "rest" : "arg" + index); var dotdotdot = isRest ? ts.createToken(24 /* DotDotDotToken */) : node.dotDotDotToken; return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); @@ -94199,8 +98516,8 @@ var ts; var index = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "number" : "string", []), + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "number" : "string", []), /*initializer*/ undefined); var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); ts.setEmitFlags(indexSignature, 1 /* SingleLine */); @@ -94215,15 +98532,11 @@ var ts; var refactor; (function (refactor) { var convertFunctionToES6Class; - (function (convertFunctionToES6Class_1) { + (function (convertFunctionToES6Class) { + var refactorName = "Convert to ES2015 class"; var actionName = "convert"; - var convertFunctionToES6Class = { - name: "Convert to ES2015 class", - description: ts.Diagnostics.Convert_function_to_an_ES2015_class.message, - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions - }; - refactor.registerRefactor(convertFunctionToES6Class); + var description = ts.Diagnostics.Convert_function_to_an_ES2015_class.message; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (!ts.isInJavaScriptFile(context.file)) { return undefined; @@ -94238,11 +98551,11 @@ var ts; if ((symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { return [ { - name: convertFunctionToES6Class.name, - description: convertFunctionToES6Class.description, + name: refactorName, + description: description, actions: [ { - description: convertFunctionToES6Class.description, + description: description, name: actionName } ] @@ -94257,7 +98570,6 @@ var ts; } var sourceFile = context.file; var ctorSymbol = getConstructorSymbol(context); - var newLine = context.formatContext.options.newLineCharacter; var deletedNodes = []; var deletes = []; if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { @@ -94268,12 +98580,12 @@ var ts; var precedingNode; var newClassDeclaration; switch (ctorDeclaration.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: precedingNode = ctorDeclaration; deleteNode(ctorDeclaration); newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: precedingNode = ctorDeclaration.parent.parent; if (ctorDeclaration.parent.declarations.length === 1) { deleteNode(precedingNode); @@ -94288,7 +98600,7 @@ var ts; return undefined; } // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration, { suffix: newLine }); + changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { var deleteCallback = deletes_1[_i]; deleteCallback(); @@ -94349,7 +98661,7 @@ var ts; return; } // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 211 /* ExpressionStatement */ + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 214 /* ExpressionStatement */ ? assignmentBinaryExpression.parent : assignmentBinaryExpression; deleteNode(nodeToDelete); if (!assignmentBinaryExpression.right) { @@ -94357,7 +98669,7 @@ var ts; /*type*/ undefined, /*initializer*/ undefined); } switch (assignmentBinaryExpression.right.kind) { - case 187 /* FunctionExpression */: { + case 190 /* FunctionExpression */: { var functionExpression = assignmentBinaryExpression.right; var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -94365,17 +98677,16 @@ var ts; copyComments(assignmentBinaryExpression, method); return method; } - case 188 /* ArrowFunction */: { + case 191 /* ArrowFunction */: { var arrowFunction = assignmentBinaryExpression.right; var arrowFunctionBody = arrowFunction.body; var bodyBlock = void 0; // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 208 /* Block */) { + if (arrowFunctionBody.kind === 211 /* Block */) { bodyBlock = arrowFunctionBody; } else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); + bodyBlock = ts.createBlock([ts.createReturn(arrowFunctionBody)]); } var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120 /* AsyncKeyword */)); var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, @@ -94413,7 +98724,7 @@ var ts; } function createClassFromVariableDeclaration(node) { var initializer = node.initializer; - if (!initializer || initializer.kind !== 187 /* FunctionExpression */) { + if (!initializer || initializer.kind !== 190 /* FunctionExpression */) { return undefined; } if (node.name.kind !== 71 /* Identifier */) { @@ -94453,6 +98764,496 @@ var ts; })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var refactor; + (function (refactor) { + var actionName = "Convert to ES6 module"; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); + function getAvailableActions(context) { + var file = context.file, startPosition = context.startPosition; + if (!ts.isSourceFileJavaScript(file) || !file.commonJsModuleIndicator) { + return undefined; + } + var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); + return !isAtTriggerLocation(file, node) ? undefined : [ + { + name: actionName, + description: description, + actions: [ + { + description: description, + name: actionName, + }, + ], + }, + ]; + } + function isAtTriggerLocation(sourceFile, node, onSecondTry) { + if (onSecondTry === void 0) { onSecondTry = false; } + switch (node.kind) { + case 185 /* CallExpression */: + return isAtTopLevelRequire(node); + case 183 /* PropertyAccessExpression */: + return ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression); + case 231 /* VariableDeclarationList */: + return isVariableDeclarationTriggerLocation(ts.firstOrUndefined(node.declarations)); + case 230 /* VariableDeclaration */: + return isVariableDeclarationTriggerLocation(node); + default: + return ts.isExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node) + || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, /*onSecondTry*/ true); + } + function isVariableDeclarationTriggerLocation(decl) { + return !!decl && !!decl.initializer && ts.isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); + } + } + function isAtTopLevelRequire(call) { + if (!ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ true)) { + return false; + } + var propAccess = call.parent; + var varDecl = ts.isPropertyAccessExpression(propAccess) ? propAccess.parent : propAccess; + if (ts.isExpressionStatement(varDecl) && ts.isSourceFile(varDecl.parent)) { + return true; + } + if (!ts.isVariableDeclaration(varDecl)) { + return false; + } + var varDeclList = varDecl.parent; + if (varDeclList.kind !== 231 /* VariableDeclarationList */) { + return false; + } + var varStatement = varDeclList.parent; + return varStatement.kind === 212 /* VariableStatement */ && varStatement.parent.kind === 272 /* SourceFile */; + } + function getEditsForAction(context, _actionName) { + ts.Debug.assertEqual(actionName, _actionName); + var file = context.file, program = context.program; + ts.Debug.assert(ts.isSourceFileJavaScript(file)); + var edits = ts.textChanges.ChangeTracker.with(context, function (changes) { + var moduleExportsChangedToDefault = convertFileToEs6Module(file, program.getTypeChecker(), changes, program.getCompilerOptions().target); + if (moduleExportsChangedToDefault) { + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var importingFile = _a[_i]; + fixImportOfModuleExports(importingFile, file, changes); + } + } + }); + return { edits: edits, renameFilename: undefined, renameLocation: undefined }; + } + function fixImportOfModuleExports(importingFile, exportingFile, changes) { + for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + var parent = moduleSpecifier.parent; + switch (parent.kind) { + case 252 /* ExternalModuleReference */: { + var importEq = parent.parent; + changes.replaceNode(importingFile, importEq, makeImport(importEq.name, /*namedImports*/ undefined, moduleSpecifier.text)); + break; + } + case 185 /* CallExpression */: { + var call = parent; + if (ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ false)) { + changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); + } + break; + } + } + } + } + /** @returns Whether we converted a `module.exports =` to a default export. */ + function convertFileToEs6Module(sourceFile, checker, changes, target) { + var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; + var exports = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports, changes); + var moduleExportsChangedToDefault = false; + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + var res = ts.createMap(); + forEachExportReference(sourceFile, function (node) { + var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; + if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) + || checker.resolveName(node.name.text, node, 107455 /* Value */, /*excludeGlobals*/ true))) { + // Unconditionally add an underscore in case `text` is a keyword. + res.set(text, makeUniqueName("_" + text, identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports, changes) { + forEachExportReference(sourceFile, function (node, isAssignmentLhs) { + if (isAssignmentLhs) { + return; + } + var text = node.name.text; + changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { + var parent = node.parent; + cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58 /* EqualsToken */); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { + switch (statement.kind) { + case 212 /* VariableStatement */: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); + return false; + case 214 /* ExpressionStatement */: { + var expression = statement.expression; + switch (expression.kind) { + case 185 /* CallExpression */: { + if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteral*/ true)) { + // For side-effecting require() call, just make a side-effecting import. + changes.replaceNode(sourceFile, statement, makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0].text)); + } + return false; + } + case 198 /* BinaryExpression */: { + var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return operatorToken.kind === 58 /* EqualsToken */ && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); + } + } + } + // falls through + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { + var declarationList = statement.declarationList; + var foundImport = false; + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { + var name = decl.name, initializer = decl.initializer; + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + // `const alias = module.exports;` can be removed. + foundImport = true; + return []; + } + if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); + } + else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); + } + else { + // Move it out to its own variable statement. + return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); + } + }); + if (foundImport) { + // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + } + /** Converts `const name = require("moduleSpecifier").propertyName` */ + function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: { + // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` + var tmp = makeUniqueName(propertyName, identifiers); + return [ + makeSingleImport(tmp, propertyName, moduleSpecifier), + makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + // `const a = require("b").c` --> `import { c as a } from "./b"; + return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; + default: + ts.Debug.assertNever(name); + } + } + function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { + if (!ts.isPropertyAccessExpression(left)) { + return false; + } + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { + // `const alias = module.exports;` or `module.exports = alias;` can be removed. + changes.deleteNode(sourceFile, statement); + } + else { + var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; + var changedToDefaultExport = false; + if (!newNodes) { + (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); + } + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + return changedToDefaultExport; + } + } + else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, statement, left.name, right, changes, exports); + } + return false; + var _a; + } + /** + * Convert `module.exports = { ... }` to individual exports.. + * We can't always do this if the module has interesting members -- then it will be a default export instead. + */ + function tryChangeModuleExportsObject(object) { + return ts.mapAllOrFail(object.properties, function (prop) { + switch (prop.kind) { + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. + case 269 /* ShorthandPropertyAssignment */: + case 270 /* SpreadAssignment */: + return undefined; + case 268 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals(prop.name.text, prop.initializer); + case 153 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(84 /* ExportKeyword */)], prop); + default: + ts.Debug.assertNever(prop); + } + }); + } + function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { + // If "originalKeywordKind" was set, this is e.g. `exports. + var text = propertyName.text; + var rename = exports.get(text); + if (rename !== undefined) { + /* + const _class = 0; + export { _class as class }; + */ + var newNodes = [ + makeConst(/*modifiers*/ undefined, rename, right), + makeExportDeclaration([ts.createExportSpecifier(rename, text)]), + ]; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + else { + changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); + } + } + function convertModuleExportsToExportDefault(exported, checker) { + var modifiers = [ts.createToken(84 /* ExportKeyword */), ts.createToken(79 /* DefaultKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: { + // `module.exports = function f() {}` --> `export default function f() {}` + var fn = exported; + return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; + } + case 203 /* ClassExpression */: { + // `module.exports = class C {}` --> `export default class C {}` + var cls = exported; + return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; + } + case 185 /* CallExpression */: + if (ts.isRequireCall(exported, /*checkArgumentIsStringLiteral*/ true)) { + return convertReExportAll(exported.arguments[0], checker); + } + // falls through + default: + // `module.exports = 0;` --> `export default 0;` + return [[ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, exported)], true]; + } + } + function convertReExportAll(reExported, checker) { + // `module.exports = require("x");` ==> `export * from "x"; export { default } from "x";` + var moduleSpecifier = reExported.text; + var moduleSymbol = checker.getSymbolAtLocation(reExported); + var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; + return exports.has("export=") + ? [[reExportDefault(moduleSpecifier)], true] + : !exports.has("default") + ? [[reExportStar(moduleSpecifier)], false] + // If there's some non-default export, must include both `export *` and `export default`. + : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([ts.createExportSpecifier(/*propertyName*/ undefined, "default")], moduleSpecifier); + } + function convertExportsDotXEquals(name, exported) { + var modifiers = [ts.createToken(84 /* ExportKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: { + var expressionName = exported.name; + if (expressionName && expressionName.text !== name) { + // `exports.f = function g() {}` -> `export const f = function g() {}` + return exportConst(); + } + } + // falls through + case 191 /* ArrowFunction */: + // `exports.f = function() {}` --> `export function f() {}` + return functionExpressionToDeclaration(name, modifiers, exported); + case 203 /* ClassExpression */: + // `exports.C = class {}` --> `export class C {}` + return classExpressionToDeclaration(name, modifiers, exported); + default: + return exportConst(); + } + function exportConst() { + // `exports.x = 0;` --> `export const x = 0;` + return makeConst(modifiers, ts.createIdentifier(name), exported); + } + } + /** + * Converts `const <> = require("x");`. + * Returns nodes that will replace the variable declaration for the commonjs import. + * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. + */ + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: { + var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { + return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) + ? undefined + : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); + }); + if (importSpecifiers) { + return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier)]; + } + } + // falls through -- object destructuring has an interesting pattern and must be a variable declaration + case 179 /* ArrayBindingPattern */: { + /* + import x from "x"; + const [a, b, c] = x; + */ + var tmp = makeUniqueName(ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); + return [ + makeImport(ts.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), + makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); + default: + ts.Debug.assertNever(name); + } + } + /** + * Convert `import x = require("x").` + * Also converts uses like `x.y()` to `y()` and uses a named import. + */ + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { + var nameSymbol = checker.getSymbolAtLocation(name); + // Maps from module property name to name actually used. (The same if there isn't shadowing.) + var namedBindingsNames = ts.createMap(); + // True if there is some non-property use like `x()` or `f(x)`. + var needDefaultImport = false; + for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { + var use = _a[_i]; + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { + // This was a use of a different symbol with the same name, due to shadowing. Ignore. + continue; + } + var parent = use.parent; + if (ts.isPropertyAccessExpression(parent)) { + var expression = parent.expression, propertyName = parent.name.text; + ts.Debug.assert(expression === use); // Else shouldn't have been in `collectIdentifiers` + var idName = namedBindingsNames.get(propertyName); + if (idName === undefined) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + changes.replaceNode(file, parent, ts.createIdentifier(idName)); + } + else { + needDefaultImport = true; + } + } + var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { + var propertyName = _a[0], idName = _a[1]; + return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); + })); + if (!namedBindings) { + // If it was unused, ensure that we at least import *something*. + needDefaultImport = true; + } + return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; + } + // Identifiers helpers + function makeUniqueName(name, identifiers) { + while (identifiers.original.has(name) || identifiers.additional.has(name)) { + name = "_" + name; + } + identifiers.additional.set(name, true); + return name; + } + function collectFreeIdentifiers(file) { + var map = ts.createMultiMap(); + file.forEachChild(function recur(node) { + if (ts.isIdentifier(node) && isFreeIdentifier(node)) { + map.add(node.text, node); + } + node.forEachChild(recur); + }); + return map; + } + function isFreeIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + return parent.name !== node; + case 180 /* BindingElement */: + return parent.propertyName !== node; + default: + return true; + } + } + // Node helpers + function functionExpressionToDeclaration(name, additionalModifiers, fn) { + return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); + } + function classExpressionToDeclaration(name, additionalModifiers, cls) { + return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); + } + function makeSingleImport(localName, propertyName, moduleSpecifier) { + return propertyName === "default" + ? makeImport(ts.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier) + : makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); + } + function makeImport(name, namedImports, moduleSpecifier) { + var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); + return ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifier)); + } + function makeImportSpecifier(propertyName, name) { + return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); + } + function makeConst(modifiers, name, init) { + return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, /*type*/ undefined, init)], 2 /* Const */)); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return ts.createExportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); + } + })(refactor = ts.refactor || (ts.refactor = {})); +})(ts || (ts = {})); /// /// /* @internal */ @@ -94461,14 +99262,9 @@ var ts; var refactor; (function (refactor) { var extractSymbol; - (function (extractSymbol_1) { - var extractSymbol = { - name: "Extract Symbol", - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_symbol), - getAvailableActions: getAvailableActions, - getEditsForAction: getEditsForAction, - }; - refactor.registerRefactor(extractSymbol); + (function (extractSymbol) { + var refactorName = "Extract Symbol"; + refactor.registerRefactor(refactorName, { getAvailableActions: getAvailableActions, getEditsForAction: getEditsForAction }); /** * Compute the associated code actions * Exported for tests. @@ -94526,21 +99322,21 @@ var ts; var infos = []; if (functionActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_function), actions: functionActions }); } if (constantActions.length) { infos.push({ - name: extractSymbol.name, + name: refactorName, description: ts.getLocaleSpecificMessage(ts.Diagnostics.Extract_constant), actions: constantActions }); } return infos.length ? infos : undefined; } - extractSymbol_1.getAvailableActions = getAvailableActions; + extractSymbol.getAvailableActions = getAvailableActions; /* Exported for tests */ function getEditsForAction(context, actionName) { var rangeToExtract = getRangeToExtract(context.file, { start: context.startPosition, length: ts.getRefactorContextLength(context) }); @@ -94559,7 +99355,7 @@ var ts; } ts.Debug.fail("Unrecognized action name"); } - extractSymbol_1.getEditsForAction = getEditsForAction; + extractSymbol.getEditsForAction = getEditsForAction; // Move these into diagnostic messages if they become user-facing var Messages; (function (Messages) { @@ -94588,7 +99384,7 @@ var ts; Messages.cannotExtractToOtherFunctionLike = createMessage("Cannot extract method to a function-like scope that is not a function"); Messages.cannotExtractToJSClass = createMessage("Cannot extract constant to a class scope in JS"); Messages.cannotExtractToExpressionArrowFunction = createMessage("Cannot extract constant to an arrow function without a block"); - })(Messages = extractSymbol_1.Messages || (extractSymbol_1.Messages = {})); + })(Messages = extractSymbol.Messages || (extractSymbol.Messages = {})); var RangeFacts; (function (RangeFacts) { RangeFacts[RangeFacts["None"] = 0] = "None"; @@ -94649,6 +99445,14 @@ var ts; break; } } + if (!statements.length) { + // https://github.com/Microsoft/TypeScript/issues/20559 + // Ranges like [|case 1: break;|] will fail to populate `statements` because + // they will never find `start` in `start.parent.statements`. + // Consider: We could support ranges like [|case 1:|] by refining them to just + // the expression. + return { errors: [ts.createFileDiagnostic(sourceFile, span.start, length, Messages.cannotExtractRange)] }; + } return { targetRange: { range: statements, facts: rangeFacts, declarations: declarations } }; } if (ts.isReturnStatement(start) && !start.expression) { @@ -94703,20 +99507,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 150 /* PropertyDeclaration */) { + if (current.kind === 151 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 147 /* Parameter */) { + else if (current.kind === 148 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 153 /* Constructor */) { + if (ctorOrMethod.kind === 154 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 152 /* MethodDeclaration */) { + else if (current.kind === 153 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -94733,6 +99537,10 @@ var ts; PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; })(PermittedJumps || (PermittedJumps = {})); + // We believe it's true because the node is from the (unmodified) tree. + ts.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + // For understanding how skipTrivia functioned: + ts.Debug.assert(!ts.positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); if (!ts.isStatement(nodeToCheck) && !(ts.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) { return [ts.createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; } @@ -94755,7 +99563,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 227 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 230 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); return true; @@ -94764,13 +99572,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 97 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 182 /* CallExpression */) { + if (node.parent.kind === 185 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -94785,9 +99593,9 @@ var ts; } if (!node || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - if (node.parent.kind === 269 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + if (node.parent.kind === 272 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } @@ -94798,20 +99606,20 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 212 /* IfStatement */: + case 215 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 208 /* Block */: - if (node.parent && node.parent.kind === 225 /* TryStatement */ && node.parent.finallyBlock === node) { + case 211 /* Block */: + if (node.parent && node.parent.kind === 228 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -94823,11 +99631,11 @@ var ts; break; } switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); @@ -94835,8 +99643,8 @@ var ts; seenLabels.pop(); break; } - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: { var label = node.label; if (label) { @@ -94846,20 +99654,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 219 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 222 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -94875,7 +99683,7 @@ var ts; } } } - extractSymbol_1.getRangeToExtract = getRangeToExtract; + extractSymbol.getRangeToExtract = getRangeToExtract; function getStatementOrExpressionRange(node) { if (ts.isStatement(node)) { return [node]; @@ -94913,7 +99721,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 147 /* Parameter */) { + if (current.kind === 148 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -94924,7 +99732,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 269 /* SourceFile */) { + if (current.kind === 272 /* SourceFile */) { return scopes; } } @@ -95014,33 +99822,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: return scope.name - ? "function expression '" + scope.name.text + "'" - : "anonymous function expression"; - case 229 /* FunctionDeclaration */: - return "function '" + scope.name.text + "'"; - case 188 /* ArrowFunction */: + ? "function '" + scope.name.text + "'" + : "anonymous function"; + case 191 /* ArrowFunction */: return "arrow function"; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return "method '" + scope.name.getText(); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: ts.Debug.assertNever(scope); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 230 /* ClassDeclaration */ - ? "class '" + scope.name.text + "'" + return scope.kind === 233 /* ClassDeclaration */ + ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 235 /* ModuleBlock */ + return scope.kind === 238 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -95078,7 +99885,7 @@ var ts; var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" type = checker.getBaseTypeOfLiteralType(type); - typeNode = checker.typeToTypeNode(type, scope, ts.NodeBuilderFlags.NoTruncation); + typeNode = checker.typeToTypeNode(type, scope, 1 /* NoTruncation */); } var paramDecl = ts.createParameter( /*decorators*/ undefined, @@ -95106,7 +99913,7 @@ var ts; // to avoid problems when there are literal types present if (ts.isExpression(node) && !isJS) { var contextualType = checker.getContextualType(node); - returnType = checker.typeToTypeNode(contextualType, scope, ts.NodeBuilderFlags.NoTruncation); + returnType = checker.typeToTypeNode(contextualType, scope, 1 /* NoTruncation */); } var _b = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)), body = _b.body, returnValueProperty = _b.returnValueProperty; ts.suppressLeadingAndTrailingTrivia(body); @@ -95132,13 +99939,10 @@ var ts; var minInsertionPos = (isReadonlyArray(range.range) ? ts.last(range.range) : range.range).end; var nodeToInsertBefore = getNodeToInsertFunctionBefore(minInsertionPos, scope); if (nodeToInsertBefore) { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, /*blankLineBetween*/ true); } else { - changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { - prefix: ts.isLineBreak(file.text.charCodeAt(scope.getLastToken().pos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter, - suffix: context.newLineCharacter - }); + changeTracker.insertNodeAtEndOfScope(context.file, scope, newFunction); } var newNodes = []; // replace range with function call @@ -95177,7 +99981,7 @@ var ts; /*propertyName*/ undefined, /*name*/ ts.getSynthesizedDeepClone(variableDeclaration.name))); // Being returned through an object literal will have widened the type. - var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, ts.NodeBuilderFlags.NoTruncation); + var variableType = checker.typeToTypeNode(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), scope, 1 /* NoTruncation */); typeElements.push(ts.createPropertySignature( /*modifiers*/ undefined, /*name*/ variableDeclaration.symbol.name, @@ -95250,10 +100054,12 @@ var ts; newNodes.push(call); } } - var replacementRange = isReadonlyArray(range.range) - ? { pos: ts.first(range.range).getStart(), end: ts.last(range.range).end } - : { pos: range.range.getStart(), end: range.range.end }; - changeTracker.replaceRangeWithNodes(context.file, replacementRange, newNodes, { nodeSeparator: context.newLineCharacter }); + if (isReadonlyArray(range.range)) { + changeTracker.replaceNodeRangeWithNodes(context.file, ts.first(range.range), ts.last(range.range), newNodes); + } + else { + changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); + } var edits = changeTracker.getChanges(); var renameRange = isReadonlyArray(range.range) ? ts.first(range.range) : range.range; var renameFilename = renameRange.getSourceFile().fileName; @@ -95268,9 +100074,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 139 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 140 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(139 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(140 /* UndefinedKeyword */)]); } } /** @@ -95284,9 +100090,9 @@ var ts; var file = scope.getSourceFile(); var localNameText = getUniqueName(ts.isClassLike(scope) ? "newProperty" : "newLocal", file.text); var isJS = ts.isInJavaScriptFile(scope); - var variableType = isJS + var variableType = isJS || !checker.isContextSensitive(node) ? undefined - : checker.typeToTypeNode(checker.getContextualType(node), scope, ts.NodeBuilderFlags.NoTruncation); + : checker.typeToTypeNode(checker.getContextualType(node), scope, 1 /* NoTruncation */); var initializer = transformConstantInitializer(node, substitutions); ts.suppressLeadingAndTrailingTrivia(initializer); var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); @@ -95297,7 +100103,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(115 /* StaticKeyword */)); } - modifiers.push(ts.createToken(131 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(132 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -95307,9 +100113,9 @@ var ts; // Declare var maxInsertionPos = node.pos; var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true); // Consume - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } else { var newVariableDeclaration = ts.createVariableDeclaration(localNameText, variableType, initializer); @@ -95320,18 +100126,18 @@ var ts; var oldVariableDeclaration = getContainingVariableDeclarationIfInList(node, scope); if (oldVariableDeclaration) { // Declare - // CONSIDER: could detect that each is on a separate line - changeTracker.insertNodeAt(context.file, oldVariableDeclaration.getStart(), newVariableDeclaration, { suffix: ", " }); + // CONSIDER: could detect that each is on a separate line (See `extractConstant_VariableList_MultipleLines` in `extractConstants.ts`) + changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); // Consume var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } - else if (node.parent.kind === 211 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 214 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)); - changeTracker.replaceRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }, newVariableStatement); + changeTracker.replaceNode(context.file, node.parent, newVariableStatement, ts.textChanges.useNonAdjustedPositions); } else { var newVariableStatement = ts.createVariableStatement( @@ -95339,26 +100145,19 @@ var ts; // Declare var nodeToInsertBefore = getNodeToInsertConstantBefore(node, scope); if (nodeToInsertBefore.pos === 0) { - // If we're at the beginning of the file, we need to take care not to insert before header comments - // (e.g. copyright, triple-slash references). Fortunately, this problem has already been solved - // for imports. - var insertionPos = ts.getSourceFileImportLocation(file); - changeTracker.insertNodeAt(context.file, insertionPos, newVariableStatement, { - prefix: insertionPos === 0 ? undefined : context.newLineCharacter, - suffix: ts.isLineBreak(file.text.charCodeAt(insertionPos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter - }); + changeTracker.insertNodeAtTopOfFile(context.file, newVariableStatement, /*blankLineBetween*/ false); } else { - changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, { suffix: context.newLineCharacter + context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 211 /* ExpressionStatement */) { + if (node.parent.kind === 214 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. - changeTracker.deleteRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }); + changeTracker.deleteNode(context.file, node.parent, ts.textChanges.useNonAdjustedPositions); } else { var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } } } @@ -95389,10 +100188,10 @@ var ts; var delta = 0; var lastPos = -1; for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], fileName = _a.fileName, textChanges_1 = _a.textChanges; + var _a = edits_1[_i], fileName = _a.fileName, textChanges_2 = _a.textChanges; ts.Debug.assert(fileName === renameFilename); - for (var _b = 0, textChanges_2 = textChanges_1; _b < textChanges_2.length; _b++) { - var change = textChanges_2[_b]; + for (var _b = 0, textChanges_3 = textChanges_2; _b < textChanges_3.length; _b++) { + var change = textChanges_3[_b]; var span_15 = change.span, newText = change.newText; var index = newText.indexOf(functionNameText); if (index !== -1) { @@ -95469,7 +100268,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 220 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 223 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -95571,6 +100370,11 @@ var ts; } prevStatement = statement; } + if (!prevStatement && ts.isCaseClause(curr)) { + // We must have been in the expression of the case clause. + ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent)); + return curr.parent.parent; + } // There must be at least one statement since we started in one. ts.Debug.assert(prevStatement !== undefined); return prevStatement; @@ -95644,7 +100448,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 229 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 232 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -95856,7 +100660,8 @@ var ts; return symbolId; } // find first declaration in this file - var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + var decls = symbol.getDeclarations(); + var declInFile = decls && ts.find(decls, function (d) { return d.getSourceFile() === sourceFile; }); if (!declInFile) { return undefined; } @@ -95879,7 +100684,7 @@ var ts; } for (var i = 0; i < scopes.length; i++) { var scope = scopes[i]; - var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags); + var resolvedSymbol = checker.resolveName(symbol.name, scope, symbol.flags, /*excludeGlobals*/ false); if (resolvedSymbol === symbol) { continue; } @@ -95946,7 +100751,8 @@ var ts; if (!symbol) { return undefined; } - if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + var decls = symbol.getDeclarations(); + if (decls && decls.some(function (d) { return d.parent === scopeDecl; })) { return ts.createIdentifier(symbol.name); } var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); @@ -95981,30 +100787,30 @@ var ts; */ function isExtractableExpression(node) { switch (node.parent.kind) { - case 268 /* EnumMember */: + case 271 /* EnumMember */: return false; } switch (node.kind) { case 9 /* StringLiteral */: - return node.parent.kind !== 239 /* ImportDeclaration */ && - node.parent.kind !== 243 /* ImportSpecifier */; - case 199 /* SpreadElement */: - case 175 /* ObjectBindingPattern */: - case 177 /* BindingElement */: + return node.parent.kind !== 242 /* ImportDeclaration */ && + node.parent.kind !== 246 /* ImportSpecifier */; + case 202 /* SpreadElement */: + case 178 /* ObjectBindingPattern */: + case 180 /* BindingElement */: return false; case 71 /* Identifier */: - return node.parent.kind !== 177 /* BindingElement */ && - node.parent.kind !== 243 /* ImportSpecifier */ && - node.parent.kind !== 247 /* ExportSpecifier */; + return node.parent.kind !== 180 /* BindingElement */ && + node.parent.kind !== 246 /* ImportSpecifier */ && + node.parent.kind !== 250 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 208 /* Block */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: - case 261 /* CaseClause */: + case 211 /* Block */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: + case 264 /* CaseClause */: return true; default: return false; @@ -96019,15 +100825,11 @@ var ts; var refactor; (function (refactor) { var installTypesForPackage; - (function (installTypesForPackage_1) { + (function (installTypesForPackage) { + var refactorName = "Install missing types package"; var actionName = "install"; - var installTypesForPackage = { - name: "Install missing types package", - description: "Install missing types package", - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(installTypesForPackage); + var description = "Install missing types package"; + refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { if (ts.getStrictOptionValue(context.program.getCompilerOptions(), "noImplicitAny")) { // Then it will be available via `fixCannotFindModule`. @@ -96036,8 +100838,8 @@ var ts; var action = getAction(context); return action && [ { - name: installTypesForPackage.name, - description: installTypesForPackage.description, + name: refactorName, + description: description, actions: [ { description: action.description, @@ -96074,8 +100876,8 @@ var ts; } function isModuleIdentifier(node) { switch (node.parent.kind) { - case 239 /* ImportDeclaration */: - case 249 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 252 /* ExternalModuleReference */: return true; default: return false; @@ -96092,16 +100894,11 @@ var ts; var installTypesForPackage; (function (installTypesForPackage) { var actionName = "Convert to default import"; - var useDefaultImport = { - name: actionName, - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import), - getEditsForAction: getEditsForAction, - getAvailableActions: getAvailableActions, - }; - refactor.registerRefactor(useDefaultImport); + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); + refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); function getAvailableActions(context) { var file = context.file, startPosition = context.startPosition, program = context.program; - if (!program.getCompilerOptions().allowSyntheticDefaultImports) { + if (!ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { return undefined; } var importInfo = getConvertibleImportAtPosition(file, startPosition); @@ -96109,17 +100906,17 @@ var ts; return undefined; } var module = ts.getResolvedModule(file, importInfo.moduleSpecifier.text); - var resolvedFile = program.getSourceFile(module.resolvedFileName); - if (!(resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { + var resolvedFile = module && program.getSourceFile(module.resolvedFileName); + if (!(resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { return undefined; } return [ { - name: useDefaultImport.name, - description: useDefaultImport.description, + name: actionName, + description: description, actions: [ { - description: useDefaultImport.description, + description: description, name: actionName, }, ], @@ -96146,21 +100943,21 @@ var ts; var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); while (true) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: var eq = node; var moduleReference = eq.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) + return moduleReference.kind === 252 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) ? { importStatement: eq, name: eq.name, moduleSpecifier: moduleReference.expression } : undefined; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var d = node; var importClause = d.importClause; - return !importClause.name && importClause.namedBindings.kind === 241 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) + return importClause && !importClause.name && importClause.namedBindings.kind === 244 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) ? { importStatement: d, name: importClause.namedBindings.name, moduleSpecifier: d.moduleSpecifier } : undefined; // For known child node kinds of convertible imports, try again with parent node. - case 241 /* NamespaceImport */: - case 249 /* ExternalModuleReference */: + case 244 /* NamespaceImport */: + case 252 /* ExternalModuleReference */: case 91 /* ImportKeyword */: case 71 /* Identifier */: case 9 /* StringLiteral */: @@ -96177,6 +100974,7 @@ var ts; })(ts || (ts = {})); /// /// +/// /// /// /// @@ -96195,6 +100993,7 @@ var ts; /// /// /// +/// /// /// /// @@ -96278,6 +101077,9 @@ var ts; var token = ts.scanner.scan(); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { + if (token === 71 /* Identifier */) { + ts.Debug.fail("Did not expect " + ts.Debug.showSyntaxKind(this) + " to have an Identifier in its trivia"); + } nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; @@ -96288,7 +101090,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(290 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(293 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { @@ -96374,8 +101176,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 271 /* FirstJSDocNode */ || kid.kind > 289 /* LastJSDocNode */; }); - return child.kind < 144 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 274 /* FirstJSDocNode */ || kid.kind > 292 /* LastJSDocNode */; }); + return child.kind < 145 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -96386,7 +101188,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 144 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 145 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -96729,13 +101531,13 @@ var ts; function getDeclarationName(declaration) { var name = ts.getNameOfDeclaration(declaration); if (name) { - var result_8 = ts.getTextOfIdentifierOrLiteral(name); - if (result_8 !== undefined) { - return result_8; + var result_6 = ts.getTextOfIdentifierOrLiteral(name); + if (result_6 !== undefined) { + return result_6; } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var expr = name.expression; - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { return expr.name.text; } return ts.getTextOfIdentifierOrLiteral(expr); @@ -96745,10 +101547,10 @@ var ts; } function visit(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -96768,31 +101570,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 164 /* TypeLiteral */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 165 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: { + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -96803,19 +101605,19 @@ var ts; } } // falls through - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: addDeclaration(node); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -96827,7 +101629,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -96836,7 +101638,7 @@ var ts; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -97016,8 +101818,7 @@ var ts; sourceFile.scriptSnapshot = scriptSnapshot; } function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents, scriptKind) { - var text = scriptSnapshot.getText(0, scriptSnapshot.getLength()); - var sourceFile = ts.createSourceFile(fileName, text, scriptTarget, setNodeParents, scriptKind); + var sourceFile = ts.createSourceFile(fileName, ts.getSnapshotText(scriptSnapshot), scriptTarget, setNodeParents, scriptKind); setSourceFileFields(sourceFile, scriptSnapshot, version); return sourceFile; } @@ -97181,7 +101982,7 @@ var ts; getCancellationToken: function () { return cancellationToken; }, getCanonicalFileName: getCanonicalFileName, useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return ts.getNewLineCharacter(newSettings, { newLine: ts.getNewLineOrDefaultFromHost(host) }); }, + getNewLine: function () { return ts.getNewLineCharacter(newSettings, function () { return ts.getNewLineOrDefaultFromHost(host); }); }, getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, writeFile: ts.noop, getCurrentDirectory: function () { return currentDirectory; }, @@ -97191,10 +101992,11 @@ var ts; var path = ts.toPath(fileName, currentDirectory, getCanonicalFileName); var entry = hostCache.getEntryByPath(path); if (entry) { - return ts.isString(entry) ? undefined : entry.scriptSnapshot.getText(0, entry.scriptSnapshot.getLength()); + return ts.isString(entry) ? undefined : ts.getSnapshotText(entry.scriptSnapshot); } return host.readFile && host.readFile(fileName); }, + realpath: host.realpath && (function (path) { return host.realpath(path); }), directoryExists: function (directoryName) { return ts.directoryProbablyExists(directoryName, host); }, @@ -97333,13 +102135,13 @@ var ts; return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); } function getCompletionsAtPosition(fileName, position, options) { - if (options === void 0) { options = { includeExternalModuleExports: false }; } + if (options === void 0) { options = { includeExternalModuleExports: false, includeInsertTextCompletions: false }; } synchronizeHostData(); return ts.Completions.getCompletionsAtPosition(host, program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, program.getSourceFiles(), options); } function getCompletionEntryDetails(fileName, position, name, formattingOptions, source) { synchronizeHostData(); - return ts.Completions.getCompletionEntryDetails(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); + return ts.Completions.getCompletionEntryDetails(program, log, program.getCompilerOptions(), getValidSourceFile(fileName), position, { name: name, source: source }, program.getSourceFiles(), host, formattingOptions && ts.formatting.getFormatContext(formattingOptions), getCanonicalFileName); } function getCompletionEntrySymbol(fileName, position, name, source) { synchronizeHostData(); @@ -97361,10 +102163,10 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 97 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); @@ -97425,44 +102227,24 @@ var ts; } /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { - var results = getOccurrencesAtPositionCore(fileName, position); - if (results) { - var sourceFile_1 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - // Get occurrences only supports reporting occurrences for the file queried. So - // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_1; }); - } - return results; + var canonicalFileName = getCanonicalFileName(ts.normalizeSlashes(fileName)); + return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { + ts.Debug.assert(getCanonicalFileName(ts.normalizeSlashes(entry.fileName)) === canonicalFileName); // Get occurrences only supports reporting occurrences for the file queried. + return { + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, + isDefinition: false, + isInString: highlightSpan.isInString, + }; + }); }); } function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); - var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); }); + var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return ts.Debug.assertDefined(program.getSourceFile(f)); }); var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function getOccurrencesAtPositionCore(fileName, position) { - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - function convertDocumentHighlights(documentHighlights) { - if (!documentHighlights) { - return undefined; - } - var result = []; - for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) { - var entry = documentHighlights_1[_i]; - for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { - var highlightSpan = _b[_a]; - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, - isDefinition: false, - isInString: highlightSpan.isInString, - }); - } - } - return result; - } - } function findRenameLocations(fileName, position, findInStrings, findInComments) { return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } @@ -97526,15 +102308,15 @@ var ts; return; } switch (node.kind) { - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 9 /* StringLiteral */: case 86 /* FalseKeyword */: case 101 /* TrueKeyword */: case 95 /* NullKeyword */: case 97 /* SuperKeyword */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 71 /* Identifier */: break; // Cant create the text span @@ -97551,7 +102333,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 234 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 237 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -97612,47 +102394,20 @@ var ts; var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } + var braceMatching = ts.createMapFromTemplate((_a = {}, + _a[17 /* OpenBraceToken */] = 18 /* CloseBraceToken */, + _a[19 /* OpenParenToken */] = 20 /* CloseParenToken */, + _a[21 /* OpenBracketToken */] = 22 /* CloseBracketToken */, + _a[29 /* GreaterThanToken */] = 27 /* LessThanToken */, + _a)); + braceMatching.forEach(function (value, key) { return braceMatching.set(value.toString(), Number(key)); }); function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var result = []; var token = ts.getTouchingToken(sourceFile, position, /*includeJsDocComment*/ false); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - // Ensure that there is a corresponding token to match ours. - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) { - var current = childNodes_1[_i]; - if (current.kind === matchKind) { - var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - // We want to order the braces when we return the result. - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 17 /* OpenBraceToken */: return 18 /* CloseBraceToken */; - case 19 /* OpenParenToken */: return 20 /* CloseParenToken */; - case 21 /* OpenBracketToken */: return 22 /* CloseBracketToken */; - case 27 /* LessThanToken */: return 29 /* GreaterThanToken */; - case 18 /* CloseBraceToken */: return 17 /* OpenBraceToken */; - case 20 /* CloseParenToken */: return 19 /* OpenParenToken */; - case 22 /* CloseBracketToken */: return 21 /* OpenBracketToken */; - case 29 /* GreaterThanToken */: return 27 /* LessThanToken */; - } - return undefined; - } + var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined; + var match = matchKind && ts.findChildOfKind(token.parent, matchKind, sourceFile); + // We want to order the braces when we return the result. + return match ? [ts.createTextSpanFromNode(token, sourceFile), ts.createTextSpanFromNode(match, sourceFile)].sort(function (a, b) { return a.start - b.start; }) : ts.emptyArray; } function getIndentationAtPosition(fileName, position, editorOptions) { var start = ts.timestamp(); @@ -97692,13 +102447,26 @@ var ts; synchronizeHostData(); var sourceFile = getValidSourceFile(fileName); var span = ts.createTextSpanFromBounds(start, end); - var newLineCharacter = ts.getNewLineOrDefaultFromHost(host); var formatContext = ts.formatting.getFormatContext(formatOptions); return ts.flatMap(ts.deduplicate(errorCodes, ts.equateValues, ts.compareValues), function (errorCode) { cancellationToken.throwIfCancellationRequested(); - return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, newLineCharacter: newLineCharacter, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + return ts.codefix.getFixes({ errorCode: errorCode, sourceFile: sourceFile, span: span, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); }); } + function getCombinedCodeFix(scope, fixId, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.codefix.getAllFixes({ fixId: fixId, sourceFile: sourceFile, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); + } + function organizeImports(scope, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host); + } function applyCodeActionCommand(fileName, actionOrUndefined) { var action = typeof fileName === "string" ? actionOrUndefined : fileName; return ts.isArray(action) ? Promise.all(action.map(applySingleCodeActionCommand)) : applySingleCodeActionCommand(action); @@ -97815,7 +102583,7 @@ var ts; return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); } function getTodoCommentsRegExp() { - // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to + // NOTE: `?:` means 'non-capture group'. It allows us to have groups without having to // filter them out later in the final result array. // TODO comments can appear in one of the following forms: // @@ -97885,7 +102653,6 @@ var ts; startPosition: startPosition, endPosition: endPosition, program: getProgram(), - newLineCharacter: formatOptions ? formatOptions.newLineCharacter : host.getNewLine(), host: host, formatContext: ts.formatting.getFormatContext(formatOptions), cancellationToken: cancellationToken, @@ -97942,7 +102709,9 @@ var ts; isValidBraceCompletionAtPosition: isValidBraceCompletionAtPosition, getSpanOfEnclosingComment: getSpanOfEnclosingComment, getCodeFixesAtPosition: getCodeFixesAtPosition, + getCombinedCodeFix: getCombinedCodeFix, applyCodeActionCommand: applyCodeActionCommand, + organizeImports: organizeImports, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, getSourceFile: getSourceFile, @@ -97950,6 +102719,7 @@ var ts; getApplicableRefactors: getApplicableRefactors, getEditsForRefactor: getEditsForRefactor, }; + var _a; } ts.createLanguageService = createLanguageService; /* @internal */ @@ -97985,23 +102755,10 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 249 /* ExternalModuleReference */ || + node.parent.kind === 252 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } - function isObjectLiteralElement(node) { - switch (node.kind) { - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return true; - } - return false; - } /** * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } */ @@ -98010,13 +102767,13 @@ var ts; switch (node.kind) { case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 145 /* ComputedPropertyName */) { - return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + if (node.parent.kind === 146 /* ComputedPropertyName */) { + return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 71 /* Identifier */: - return isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 179 /* ObjectLiteralExpression */ || node.parent.parent.kind === 258 /* JsxAttributes */) && + return ts.isObjectLiteralElement(node.parent) && + (node.parent.parent.kind === 182 /* ObjectLiteralExpression */ || node.parent.parent.kind === 261 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -98033,20 +102790,20 @@ var ts; function getPropertySymbolsFromType(type, propName) { var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); if (name && type) { - var result_9 = []; + var result_7 = []; var symbol = type.getProperty(name); if (type.flags & 131072 /* Union */) { ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { - result_9.push(symbol); + result_7.push(symbol); } }); - return result_9; + return result_7; } if (symbol) { - result_9.push(symbol); - return result_9; + result_7.push(symbol); + return result_7; } } return undefined; @@ -98055,7 +102812,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 181 /* ElementAccessExpression */ && + node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -98136,114 +102893,114 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 227 /* VariableDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 230 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return spanInVariableDeclaration(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return spanInParameterDeclaration(node); - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanInBlock(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInBlock(node.block); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return spanInForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 177 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 180 /* BindingElement */: // span on complete node return textSpan(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 148 /* Decorator */: + case 149 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return undefined; // Tokens: case 25 /* SemicolonToken */: @@ -98273,7 +103030,7 @@ var ts; case 74 /* CatchKeyword */: case 87 /* FinallyKeyword */: return spanInNextNode(node); - case 143 /* OfKeyword */: + case 144 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -98283,16 +103040,16 @@ var ts; return spanInArrayLiteralOrObjectLiteralDestructuringPattern(node); } // Set breakpoint on identifier element of destructuring pattern - // a or ...c or d: x from - // [a, b, ...c] or { a, b } or { d: x } from destructuring pattern + // `a` or `...c` or `d: x` from + // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 71 /* Identifier */ || - node.kind === 199 /* SpreadElement */ || - node.kind === 265 /* PropertyAssignment */ || - node.kind === 266 /* ShorthandPropertyAssignment */) && + node.kind === 202 /* SpreadElement */ || + node.kind === 268 /* PropertyAssignment */ || + node.kind === 269 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 195 /* BinaryExpression */) { + if (node.kind === 198 /* BinaryExpression */) { var binaryExpression = node; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of @@ -98315,22 +103072,22 @@ var ts; } if (ts.isExpressionNode(node)) { switch (node.parent.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 148 /* Decorator */: + case 149 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return textSpan(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (node.parent.operatorToken.kind === 26 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -98339,13 +103096,13 @@ var ts; } } // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 265 /* PropertyAssignment */ && + if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name === node && !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { return spanInNode(node.parent.initializer); } // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 185 /* TypeAssertionExpression */ && node.parent.type === node) { + if (node.parent.kind === 188 /* TypeAssertionExpression */ && node.parent.type === node) { return spanInNextNode(node.parent.type); } // return type of function go to previous token @@ -98353,8 +103110,8 @@ var ts; return spanInPreviousNode(node); } // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 227 /* VariableDeclaration */ || - node.parent.kind === 147 /* Parameter */)) { + if ((node.parent.kind === 230 /* VariableDeclaration */ || + node.parent.kind === 148 /* Parameter */)) { var paramOrVarDecl = node.parent; if (paramOrVarDecl.initializer === node || paramOrVarDecl.type === node || @@ -98362,7 +103119,7 @@ var ts; return spanInPreviousNode(node); } } - if (node.parent.kind === 195 /* BinaryExpression */) { + if (node.parent.kind === 198 /* BinaryExpression */) { var binaryExpression = node.parent; if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && (binaryExpression.right === node || @@ -98376,7 +103133,7 @@ var ts; } } function textSpanFromVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (variableDeclaration.parent.kind === 231 /* VariableDeclarationList */ && variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); @@ -98388,7 +103145,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 216 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 219 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -98399,10 +103156,10 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 217 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 220 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (variableDeclaration.parent.kind === 231 /* VariableDeclarationList */ && variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and @@ -98426,8 +103183,9 @@ var ts; } else { var functionDeclaration = parameter.parent; - var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); - if (indexOfParameter) { + var indexOfParameter = functionDeclaration.parameters.indexOf(parameter); + ts.Debug.assert(indexOfParameter !== -1); + if (indexOfParameter !== 0) { // Not a first parameter, go to previous parameter return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); } @@ -98439,7 +103197,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 230 /* ClassDeclaration */ && functionDeclaration.kind !== 153 /* Constructor */); + (functionDeclaration.parent.kind === 233 /* ClassDeclaration */ && functionDeclaration.kind !== 154 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -98462,26 +103220,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // falls through // Set on parent if on same line otherwise on first statement - case 214 /* WhileStatement */: - case 212 /* IfStatement */: - case 216 /* ForInStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 219 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 231 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -98506,23 +103264,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 177 /* BindingElement */) { + if (bindingPattern.parent.kind === 180 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 176 /* ArrayBindingPattern */ && node.kind !== 175 /* ObjectBindingPattern */); - var elements = node.kind === 178 /* ArrayLiteralExpression */ ? - node.elements : - node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 179 /* ArrayBindingPattern */ && node.kind !== 178 /* ObjectBindingPattern */); + var elements = node.kind === 181 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -98530,18 +103286,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 195 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 198 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -98549,25 +103305,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 233 /* EnumDeclaration */: - case 230 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -98575,7 +103331,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -98591,7 +103347,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -98606,12 +103362,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 213 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 182 /* CallExpression */ || - node.parent.kind === 183 /* NewExpression */) { + if (node.parent.kind === 216 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 185 /* CallExpression */ || + node.parent.kind === 186 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 186 /* ParenthesizedExpression */) { + if (node.parent.kind === 189 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -98620,21 +103376,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 186 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 189 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -98644,20 +103400,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ || - node.parent.kind === 147 /* Parameter */) { + node.parent.kind === 268 /* PropertyAssignment */ || + node.parent.kind === 148 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 185 /* TypeAssertionExpression */) { + if (node.parent.kind === 188 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 213 /* DoStatement */) { + if (node.parent.kind === 216 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -98665,7 +103421,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.kind === 220 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -99185,10 +103941,10 @@ var ts; return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + options + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, options); }); }; /** Get a string based representation of a completion list entry details */ - LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, options /*Services.FormatCodeOptions*/, source) { + LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, options, source) { var _this = this; return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () { - var localOptions = JSON.parse(options); + var localOptions = options === undefined ? undefined : JSON.parse(options); return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source); }); }; @@ -99324,7 +104080,7 @@ var ts; var _this = this; return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { // for now treat files as JavaScript - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()), /* readImportFiles */ true, /* detectJavaScriptImports */ true); + var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true); return { referencedFiles: _this.convertFileReferences(result.referencedFiles), importedFiles: _this.convertFileReferences(result.importedFiles), @@ -99359,8 +104115,7 @@ var ts; CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) { var _this = this; return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () { - var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); - var result = ts.parseJsonText(fileName, text); + var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot)); var normalizedFileName = ts.normalizeSlashes(fileName); var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName); return { @@ -99383,7 +104138,7 @@ var ts; if (_this.safeList === undefined) { _this.safeList = ts.JsTyping.loadSafeList(_this.host, ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName)); } - return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports); + return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports, info.typesRegistry); }); }; return CoreServicesShimObject; diff --git a/lib/typingsInstaller.js b/lib/typingsInstaller.js index 40c31cebe50..74ec9b4a722 100644 --- a/lib/typingsInstaller.js +++ b/lib/typingsInstaller.js @@ -46,24 +46,6 @@ var ts; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; })(ExitStatus = ts.ExitStatus || (ts.ExitStatus = {})); - var NodeBuilderFlags; - (function (NodeBuilderFlags) { - NodeBuilderFlags[NodeBuilderFlags["None"] = 0] = "None"; - NodeBuilderFlags[NodeBuilderFlags["NoTruncation"] = 1] = "NoTruncation"; - NodeBuilderFlags[NodeBuilderFlags["WriteArrayAsGenericType"] = 2] = "WriteArrayAsGenericType"; - NodeBuilderFlags[NodeBuilderFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; - NodeBuilderFlags[NodeBuilderFlags["UseFullyQualifiedType"] = 64] = "UseFullyQualifiedType"; - NodeBuilderFlags[NodeBuilderFlags["SuppressAnyReturnType"] = 256] = "SuppressAnyReturnType"; - NodeBuilderFlags[NodeBuilderFlags["WriteTypeParametersInQualifiedName"] = 512] = "WriteTypeParametersInQualifiedName"; - NodeBuilderFlags[NodeBuilderFlags["AllowThisInObjectLiteral"] = 1024] = "AllowThisInObjectLiteral"; - NodeBuilderFlags[NodeBuilderFlags["AllowQualifedNameInPlaceOfIdentifier"] = 2048] = "AllowQualifedNameInPlaceOfIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowAnonymousIdentifier"] = 8192] = "AllowAnonymousIdentifier"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyUnionOrIntersection"] = 16384] = "AllowEmptyUnionOrIntersection"; - NodeBuilderFlags[NodeBuilderFlags["AllowEmptyTuple"] = 32768] = "AllowEmptyTuple"; - NodeBuilderFlags[NodeBuilderFlags["IgnoreErrors"] = 60416] = "IgnoreErrors"; - NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 1048576] = "InObjectTypeLiteral"; - NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; - })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); var TypeReferenceSerializationKind; (function (TypeReferenceSerializationKind) { TypeReferenceSerializationKind[TypeReferenceSerializationKind["Unknown"] = 0] = "Unknown"; @@ -159,16 +141,21 @@ var ts; })(ts || (ts = {})); var ts; (function (ts) { - ts.versionMajorMinor = "2.7"; - ts.version = ts.versionMajorMinor + ".0"; + ts.versionMajorMinor = "2.8"; + ts.version = ts.versionMajorMinor + ".0-dev"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); (function (ts) { + ts.emptyArray = []; function createDictionaryObject() { var map = Object.create(null); map.__ = undefined; @@ -294,6 +281,9 @@ var ts; } ts.forEach = forEach; function firstDefined(array, callback) { + if (array === undefined) { + return undefined; + } for (var i = 0; i < array.length; i++) { var result = callback(array[i], i); if (result !== undefined) { @@ -303,6 +293,19 @@ var ts; return undefined; } ts.firstDefined = firstDefined; + function firstDefinedIterator(iter, callback) { + while (true) { + var _a = iter.next(), value = _a.value, done = _a.done; + if (done) { + return undefined; + } + var result = callback(value); + if (result !== undefined) { + return result; + } + } + } + ts.firstDefinedIterator = firstDefinedIterator; function findAncestor(node, callback) { while (node) { var result = callback(node); @@ -319,13 +322,27 @@ var ts; ts.findAncestor = findAncestor; function zipWith(arrayA, arrayB, callback) { var result = []; - Debug.assert(arrayA.length === arrayB.length); + Debug.assertEqual(arrayA.length, arrayB.length); for (var i = 0; i < arrayA.length; i++) { result.push(callback(arrayA[i], arrayB[i], i)); } return result; } ts.zipWith = zipWith; + function zipToIterator(arrayA, arrayB) { + Debug.assertEqual(arrayA.length, arrayB.length); + var i = 0; + return { + next: function () { + if (i === arrayA.length) { + return { value: undefined, done: true }; + } + i++; + return { value: [arrayA[i - 1], arrayB[i - 1]], done: false }; + } + }; + } + ts.zipToIterator = zipToIterator; function zipToMap(keys, values) { Debug.assert(keys.length === values.length); var map = createMap(); @@ -398,17 +415,11 @@ var ts; return false; } ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); } - ts.indexOf = indexOf; + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -480,31 +491,30 @@ var ts; } ts.map = map; function mapIterator(iter, mapFn) { - return { next: next }; - function next() { - var iterRes = iter.next(); - return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; - } + return { + next: function () { + var iterRes = iter.next(); + return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false }; + } + }; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; function flatten(array) { @@ -545,25 +555,33 @@ var ts; return result; } ts.flatMap = flatMap; - function flatMapIter(iter, mapfn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapfn(value); - if (res) { - if (isArray(res)) { - result.push.apply(result, res); + function flatMapIterator(iter, mapfn) { + var first = iter.next(); + if (first.done) { + return ts.emptyIterator; + } + var currentIter = getIterator(first.value); + return { + next: function () { + while (true) { + var currentRes = currentIter.next(); + if (!currentRes.done) { + return currentRes; + } + var iterRes = iter.next(); + if (iterRes.done) { + return iterRes; + } + currentIter = getIterator(iterRes.value); } - else { - result.push(res); - } - } + }, + }; + function getIterator(x) { + var res = mapfn(x); + return res === undefined ? ts.emptyIterator : isArray(res) ? arrayIterator(res) : res; } - return result; } - ts.flatMapIter = flatMapIter; + ts.flatMapIterator = flatMapIterator; function sameFlatMap(array, mapfn) { var result; if (array) { @@ -586,12 +604,23 @@ var ts; return result || array; } ts.sameFlatMap = sameFlatMap; + function mapAllOrFail(array, mapFn) { + var result = []; + for (var i = 0; i < array.length; i++) { + var mapped = mapFn(array[i], i); + if (mapped === undefined) { + return undefined; + } + result.push(mapped); + } + return result; + } + ts.mapAllOrFail = mapAllOrFail; function mapDefined(array, mapFn) { var result = []; if (array) { for (var i = 0; i < array.length; i++) { - var item = array[i]; - var mapped = mapFn(item, i); + var mapped = mapFn(array[i], i); if (mapped !== undefined) { result.push(mapped); } @@ -600,20 +629,35 @@ var ts; return result; } ts.mapDefined = mapDefined; - function mapDefinedIter(iter, mapFn) { - var result = []; - while (true) { - var _a = iter.next(), value = _a.value, done = _a.done; - if (done) - break; - var res = mapFn(value); - if (res !== undefined) { - result.push(res); + function mapDefinedIterator(iter, mapFn) { + return { + next: function () { + while (true) { + var res = iter.next(); + if (res.done) { + return res; + } + var value = mapFn(res.value); + if (value !== undefined) { + return { value: value, done: false }; + } + } } - } - return result; + }; } - ts.mapDefinedIter = mapDefinedIter; + ts.mapDefinedIterator = mapDefinedIterator; + ts.emptyIterator = { next: function () { return ({ value: undefined, done: true }); } }; + function singleIterator(value) { + var done = false; + return { + next: function () { + var wasDone = done; + done = true; + return wasDone ? { value: undefined, done: true } : { value: value, done: false }; + } + }; + } + ts.singleIterator = singleIterator; function span(array, f) { if (array) { for (var i = 0; i < array.length; i++) { @@ -750,6 +794,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -1223,6 +1278,15 @@ var ts; } } } + function group(values, getGroupId) { + var groupIdToGroup = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + groupIdToGroup.add(getGroupId(value), value); + } + return arrayFrom(groupIdToGroup.values()); + } + ts.group = group; function isArray(value) { return Array.isArray ? Array.isArray(value) : value instanceof Array; } @@ -1242,7 +1306,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; function noop(_) { } @@ -1253,6 +1322,8 @@ var ts; ts.returnTrue = returnTrue; function identity(x) { return x; } ts.identity = identity; + function toLowerCase(x) { return x.toLowerCase(); } + ts.toLowerCase = toLowerCase; function notImplemented() { throw new Error("Not implemented"); } @@ -1543,6 +1614,10 @@ var ts; 0; } ts.compareDiagnostics = compareDiagnostics; + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { var string1 = isString(text1) ? text1 : text1.messageText; @@ -1559,10 +1634,6 @@ var ts; } return text1 ? 1 : -1; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -1580,7 +1651,7 @@ var ts; return p2 + 1; } if (path.charCodeAt(1) === 58) { - if (path.charCodeAt(2) === 47) + if (path.charCodeAt(2) === 47 || path.charCodeAt(2) === 92) return 3; } if (path.lastIndexOf("file:///", 0) === 0) { @@ -1647,10 +1718,6 @@ var ts; return /^\.\.?($|[\\/])/.test(path); } ts.pathIsRelative = pathIsRelative; - function moduleHasNonRelativeName(moduleName) { - return !ts.isExternalModuleNameRelative(moduleName); - } - ts.moduleHasNonRelativeName = moduleHasNonRelativeName; function getEmitScriptTarget(compilerOptions) { return compilerOptions.target || 0; } @@ -1673,7 +1740,9 @@ var ts; var moduleKind = getEmitModuleKind(compilerOptions); return compilerOptions.allowSyntheticDefaultImports !== undefined ? compilerOptions.allowSyntheticDefaultImports - : moduleKind === ts.ModuleKind.System; + : compilerOptions.esModuleInterop + ? moduleKind !== ts.ModuleKind.None && moduleKind < ts.ModuleKind.ES2015 + : moduleKind === ts.ModuleKind.System; } ts.getAllowSyntheticDefaultImports = getAllowSyntheticDefaultImports; function getStrictOptionValue(compilerOptions, flag) { @@ -1956,7 +2025,6 @@ var ts; function getSubPatternFromSpec(spec, basePath, usage, _a) { var singleAsteriskRegexFragment = _a.singleAsteriskRegexFragment, doubleAsteriskRegexFragment = _a.doubleAsteriskRegexFragment, replaceWildcardCharacter = _a.replaceWildcardCharacter; var subpattern = ""; - var hasRecursiveDirectoryWildcard = false; var hasWrittenComponent = false; var components = getNormalizedPathComponents(spec, basePath); var lastComponent = lastOrUndefined(components); @@ -1971,11 +2039,7 @@ var ts; for (var _i = 0, components_1 = components; _i < components_1.length; _i++) { var component = components_1[_i]; if (component === "**") { - if (hasRecursiveDirectoryWildcard) { - return undefined; - } subpattern += doubleAsteriskRegexFragment; - hasRecursiveDirectoryWildcard = true; } else { if (usage === "directories") { @@ -2234,6 +2298,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -2243,10 +2311,10 @@ var ts; } function Signature() { } function Node(kind, pos, end) { - this.id = 0; - this.kind = kind; this.pos = pos; this.end = end; + this.kind = kind; + this.id = 0; this.flags = 0; this.modifierFlagsCache = 0; this.transformFlags = 0; @@ -2319,6 +2387,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -2337,6 +2418,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); function orderedRemoveItem(array, item) { for (var i = 0; i < array.length; i++) { @@ -2373,9 +2474,7 @@ var ts; } } function createGetCanonicalFileName(useCaseSensitiveFileNames) { - return useCaseSensitiveFileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); + return useCaseSensitiveFileNames ? identity : toLowerCase; } ts.createGetCanonicalFileName = createGetCanonicalFileName; function matchPatternOrExact(patternStrings, candidate) { @@ -2400,14 +2499,14 @@ var ts; ts.patternText = patternText; function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; function findBestPatternMatch(values, getPattern, candidate) { var matchedValue = undefined; var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -2472,170 +2571,20 @@ var ts; return function (arg) { return f(arg) && g(arg); }; } ts.and = and; + function or(f, g) { + return function (arg) { return f(arg) || g(arg); }; + } + ts.or = or; function assertTypeIsNever(_) { } ts.assertTypeIsNever = assertTypeIsNever; - function createCachedDirectoryStructureHost(host) { - var cachedReadDirectoryResult = createMap(); - var getCurrentDirectory = memoize(function () { return host.getCurrentDirectory(); }); - var getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames); - return { - useCaseSensitiveFileNames: host.useCaseSensitiveFileNames, - newLine: host.newLine, - readFile: function (path, encoding) { return host.readFile(path, encoding); }, - write: function (s) { return host.write(s); }, - writeFile: writeFile, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: createDirectory, - getCurrentDirectory: getCurrentDirectory, - getDirectories: getDirectories, - readDirectory: readDirectory, - addOrDeleteFileOrDirectory: addOrDeleteFileOrDirectory, - addOrDeleteFile: addOrDeleteFile, - clearCache: clearCache, - exit: function (code) { return host.exit(code); } - }; - function toPath(fileName) { - return ts.toPath(fileName, getCurrentDirectory(), getCanonicalFileName); - } - function getCachedFileSystemEntries(rootDirPath) { - return cachedReadDirectoryResult.get(rootDirPath); - } - function getCachedFileSystemEntriesForBaseDir(path) { - return getCachedFileSystemEntries(getDirectoryPath(path)); - } - function getBaseNameOfFileName(fileName) { - return getBaseFileName(normalizePath(fileName)); - } - function createCachedFileSystemEntries(rootDir, rootDirPath) { - var resultFromHost = { - files: map(host.readDirectory(rootDir, undefined, undefined, ["*.*"]), getBaseNameOfFileName) || [], - directories: host.getDirectories(rootDir) || [] - }; - cachedReadDirectoryResult.set(rootDirPath, resultFromHost); - return resultFromHost; - } - function tryReadDirectory(rootDir, rootDirPath) { - var cachedResult = getCachedFileSystemEntries(rootDirPath); - if (cachedResult) { - return cachedResult; - } - try { - return createCachedFileSystemEntries(rootDir, rootDirPath); - } - catch (_e) { - Debug.assert(!cachedReadDirectoryResult.has(rootDirPath)); - return undefined; - } - } - function fileNameEqual(name1, name2) { - return getCanonicalFileName(name1) === getCanonicalFileName(name2); - } - function hasEntry(entries, name) { - return some(entries, function (file) { return fileNameEqual(file, name); }); - } - function updateFileSystemEntry(entries, baseName, isValid) { - if (hasEntry(entries, baseName)) { - if (!isValid) { - return filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); }); - } - } - else if (isValid) { - return entries.push(baseName); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - if (result) { - updateFilesOfFileSystemEntry(result, getBaseNameOfFileName(fileName), true); - } - return host.writeFile(fileName, data, writeByteOrderMark); - } - function fileExists(fileName) { - var path = toPath(fileName); - var result = getCachedFileSystemEntriesForBaseDir(path); - return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) || - host.fileExists(fileName); - } - function directoryExists(dirPath) { - var path = toPath(dirPath); - return cachedReadDirectoryResult.has(path) || host.directoryExists(dirPath); - } - function createDirectory(dirPath) { - var path = toPath(dirPath); - var result = getCachedFileSystemEntriesForBaseDir(path); - var baseFileName = getBaseNameOfFileName(dirPath); - if (result) { - updateFileSystemEntry(result.directories, baseFileName, true); - } - host.createDirectory(dirPath); - } - function getDirectories(rootDir) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return result.directories.slice(); - } - return host.getDirectories(rootDir); - } - function readDirectory(rootDir, extensions, excludes, includes, depth) { - var rootDirPath = toPath(rootDir); - var result = tryReadDirectory(rootDir, rootDirPath); - if (result) { - return matchFiles(rootDir, extensions, excludes, includes, host.useCaseSensitiveFileNames, getCurrentDirectory(), depth, getFileSystemEntries); - } - return host.readDirectory(rootDir, extensions, excludes, includes, depth); - function getFileSystemEntries(dir) { - var path = toPath(dir); - if (path === rootDirPath) { - return result; - } - return getCachedFileSystemEntries(path) || createCachedFileSystemEntries(dir, path); - } - } - function addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath) { - var existingResult = getCachedFileSystemEntries(fileOrDirectoryPath); - if (existingResult) { - clearCache(); - } - else { - var parentResult = getCachedFileSystemEntriesForBaseDir(fileOrDirectoryPath); - if (parentResult) { - var baseName = getBaseNameOfFileName(fileOrDirectory); - if (parentResult) { - var fsQueryResult = { - fileExists: host.fileExists(fileOrDirectoryPath), - directoryExists: host.directoryExists(fileOrDirectoryPath) - }; - if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) { - clearCache(); - } - else { - updateFilesOfFileSystemEntry(parentResult, baseName, fsQueryResult.fileExists); - } - return fsQueryResult; - } - } - } - } - function addOrDeleteFile(fileName, filePath, eventKind) { - if (eventKind === ts.FileWatcherEventKind.Changed) { - return; - } - var parentResult = getCachedFileSystemEntriesForBaseDir(filePath); - if (parentResult) { - updateFilesOfFileSystemEntry(parentResult, getBaseNameOfFileName(fileName), eventKind === ts.FileWatcherEventKind.Created); - } - } - function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) { - updateFileSystemEntry(parentResult.files, baseName, fileExists); - } - function clearCache() { - cachedReadDirectoryResult.clear(); - } + ts.emptyFileSystemEntries = { + files: ts.emptyArray, + directories: ts.emptyArray + }; + function singleElementArray(t) { + return t === undefined ? undefined : [t]; } - ts.createCachedDirectoryStructureHost = createCachedDirectoryStructureHost; + ts.singleElementArray = singleElementArray; })(ts || (ts = {})); var ts; (function (ts) { @@ -2667,13 +2616,28 @@ var ts; } ts.getNodeMajorVersion = getNodeMajorVersion; ts.sys = (function () { - var utf8ByteOrderMark = "\u00EF\u00BB\u00BF"; + var byteOrderMarkIndicator = "\uFEFF"; function getNodeSystem() { var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; + } var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } function createWatchedFileSet() { var dirWatchers = ts.createMap(); var fileWatcherCallbacks = ts.createMultiMap(); @@ -2831,7 +2795,7 @@ var ts; } function writeFile(fileName, data, writeByteOrderMark) { if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } var fd; try { @@ -2872,7 +2836,7 @@ var ts; return { files: files, directories: directories }; } catch (e) { - return { files: [], directories: [] }; + return ts.emptyFileSystemEntries; } } function readDirectory(path, extensions, excludes, includes, depth) { @@ -2900,6 +2864,9 @@ var ts; return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1); }); } var nodeSystem = { + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, args: process.argv.slice(2), newLine: _os.EOL, useCaseSensitiveFileNames: useCaseSensitiveFileNames, @@ -2953,11 +2920,7 @@ var ts; return undefined; } }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, getMemoryUsage: function () { if (global.gc) { global.gc(); @@ -2978,7 +2941,12 @@ var ts; process.exit(exitCode); }, realpath: function (path) { - return _fs.realpathSync(path); + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } }, debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), tryEnableSourceMapsForHost: function () { @@ -3005,7 +2973,7 @@ var ts; }, writeFile: function (path, data, writeByteOrderMark) { if (writeByteOrderMark) { - data = utf8ByteOrderMark + data; + data = byteOrderMarkIndicator + data; } ChakraHost.writeFile(path, data); }, @@ -3304,6 +3272,9 @@ var ts; unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: diag(1333, ts.DiagnosticCategory.Error, "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333", "'unique symbol' types may not be used on a variable declaration with a binding name."), unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: diag(1334, ts.DiagnosticCategory.Error, "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334", "'unique symbol' types are only allowed on variables in a variable statement."), unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), + An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), + An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -3418,6 +3389,7 @@ var ts; Numeric_index_type_0_is_not_assignable_to_string_index_type_1: diag(2413, ts.DiagnosticCategory.Error, "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413", "Numeric index type '{0}' is not assignable to string index type '{1}'."), Class_name_cannot_be_0: diag(2414, ts.DiagnosticCategory.Error, "Class_name_cannot_be_0_2414", "Class name cannot be '{0}'."), Class_0_incorrectly_extends_base_class_1: diag(2415, ts.DiagnosticCategory.Error, "Class_0_incorrectly_extends_base_class_1_2415", "Class '{0}' incorrectly extends base class '{1}'."), + Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: diag(2416, ts.DiagnosticCategory.Error, "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416", "Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'."), Class_static_side_0_incorrectly_extends_base_class_static_side_1: diag(2417, ts.DiagnosticCategory.Error, "Class_static_side_0_incorrectly_extends_base_class_static_side_1_2417", "Class static side '{0}' incorrectly extends base class static side '{1}'."), Class_0_incorrectly_implements_interface_1: diag(2420, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_interface_1_2420", "Class '{0}' incorrectly implements interface '{1}'."), A_class_may_only_implement_another_class_or_interface: diag(2422, ts.DiagnosticCategory.Error, "A_class_may_only_implement_another_class_or_interface_2422", "A class may only implement another class or interface."), @@ -3472,7 +3444,7 @@ var ts; Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: diag(2472, ts.DiagnosticCategory.Error, "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472", "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher."), Enum_declarations_must_all_be_const_or_non_const: diag(2473, ts.DiagnosticCategory.Error, "Enum_declarations_must_all_be_const_or_non_const_2473", "Enum declarations must all be const or non-const."), In_const_enum_declarations_member_initializer_must_be_constant_expression: diag(2474, ts.DiagnosticCategory.Error, "In_const_enum_declarations_member_initializer_must_be_constant_expression_2474", "In 'const' enum declarations member initializer must be constant expression."), - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment."), + const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: diag(2475, ts.DiagnosticCategory.Error, "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475", "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query."), A_const_enum_member_can_only_be_accessed_using_a_string_literal: diag(2476, ts.DiagnosticCategory.Error, "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476", "A const enum member can only be accessed using a string literal."), const_enum_member_initializer_was_evaluated_to_a_non_finite_value: diag(2477, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477", "'const' enum member initializer was evaluated to a non-finite value."), const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: diag(2478, ts.DiagnosticCategory.Error, "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478", "'const' enum member initializer was evaluated to disallowed value 'NaN'."), @@ -3560,6 +3532,8 @@ var ts; The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: diag(2563, ts.DiagnosticCategory.Error, "The_containing_function_or_module_body_is_too_large_for_control_flow_analysis_2563", "The containing function or module body is too large for control flow analysis."), Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), + A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -3638,6 +3612,10 @@ var ts; Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: diag(2717, ts.DiagnosticCategory.Error, "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717", "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'."), Duplicate_declaration_0: diag(2718, ts.DiagnosticCategory.Error, "Duplicate_declaration_0_2718", "Duplicate declaration '{0}'."), Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: diag(2719, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719", "Type '{0}' is not assignable to type '{1}'. Two different types with this name exist, but they are unrelated."), + Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: diag(2720, ts.DiagnosticCategory.Error, "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720", "Class '{0}' incorrectly implements class '{1}'. Did you mean to extend '{1}' and inherit its members as a subclass?"), + Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), + Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), + Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -3724,7 +3702,6 @@ var ts; The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."), Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."), File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."), - File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0: diag(5011, ts.DiagnosticCategory.Error, "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011", "File specification cannot contain multiple recursive directory wildcards ('**'): '{0}'."), Cannot_read_file_0_Colon_1: diag(5012, ts.DiagnosticCategory.Error, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."), Failed_to_parse_file_0_Colon_1: diag(5014, ts.DiagnosticCategory.Error, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."), Unknown_compiler_option_0: diag(5023, ts.DiagnosticCategory.Error, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."), @@ -3763,6 +3740,7 @@ var ts; Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: diag(6011, ts.DiagnosticCategory.Message, "Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typech_6011", "Allow default imports from modules with no default export. This does not affect code emit, just typechecking."), Skip_type_checking_of_declaration_files: diag(6012, ts.DiagnosticCategory.Message, "Skip_type_checking_of_declaration_files_6012", "Skip type checking of declaration files."), Do_not_resolve_the_real_path_of_symlinks: diag(6013, ts.DiagnosticCategory.Message, "Do_not_resolve_the_real_path_of_symlinks_6013", "Do not resolve the real path of symlinks."), + Only_emit_d_ts_declaration_files: diag(6014, ts.DiagnosticCategory.Message, "Only_emit_d_ts_declaration_files_6014", "Only emit '.d.ts' declaration files."), Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: diag(6015, ts.DiagnosticCategory.Message, "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015", "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'."), Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: diag(6016, ts.DiagnosticCategory.Message, "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016", "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'."), Print_this_message: diag(6017, ts.DiagnosticCategory.Message, "Print_this_message_6017", "Print this message."), @@ -3775,6 +3753,7 @@ var ts; Options_Colon: diag(6027, ts.DiagnosticCategory.Message, "Options_Colon_6027", "Options:"), Version_0: diag(6029, ts.DiagnosticCategory.Message, "Version_0_6029", "Version {0}"), Insert_command_line_options_and_files_from_a_file: diag(6030, ts.DiagnosticCategory.Message, "Insert_command_line_options_and_files_from_a_file_6030", "Insert command line options and files from a file."), + Starting_compilation_in_watch_mode: diag(6031, ts.DiagnosticCategory.Message, "Starting_compilation_in_watch_mode_6031", "Starting compilation in watch mode..."), File_change_detected_Starting_incremental_compilation: diag(6032, ts.DiagnosticCategory.Message, "File_change_detected_Starting_incremental_compilation_6032", "File change detected. Starting incremental compilation..."), KIND: diag(6034, ts.DiagnosticCategory.Message, "KIND_6034", "KIND"), FILE: diag(6035, ts.DiagnosticCategory.Message, "FILE_6035", "FILE"), @@ -3815,7 +3794,7 @@ var ts; Report_errors_for_fallthrough_cases_in_switch_statement: diag(6076, ts.DiagnosticCategory.Message, "Report_errors_for_fallthrough_cases_in_switch_statement_6076", "Report errors for fallthrough cases in switch statement."), Do_not_report_errors_on_unreachable_code: diag(6077, ts.DiagnosticCategory.Message, "Do_not_report_errors_on_unreachable_code_6077", "Do not report errors on unreachable code."), Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, ts.DiagnosticCategory.Message, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."), - Specify_library_files_to_be_included_in_the_compilation_Colon: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_Colon_6079", "Specify library files to be included in the compilation: "), + Specify_library_files_to_be_included_in_the_compilation: diag(6079, ts.DiagnosticCategory.Message, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."), Specify_JSX_code_generation_Colon_preserve_react_native_or_react: diag(6080, ts.DiagnosticCategory.Message, "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080", "Specify JSX code generation: 'preserve', 'react-native', or 'react'."), File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, ts.DiagnosticCategory.Message, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."), Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, ts.DiagnosticCategory.Error, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."), @@ -3922,6 +3901,9 @@ var ts; Disable_strict_checking_of_generic_signatures_in_function_types: diag(6185, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6185", "Disable strict checking of generic signatures in function types."), Enable_strict_checking_of_function_types: diag(6186, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_function_types_6186", "Enable strict checking of function types."), Enable_strict_checking_of_property_initialization_in_classes: diag(6187, ts.DiagnosticCategory.Message, "Enable_strict_checking_of_property_initialization_in_classes_6187", "Enable strict checking of property initialization in classes."), + Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), + Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), + Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -3950,6 +3932,9 @@ var ts; Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: diag(7034, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined_7034", "Variable '{0}' implicitly has type '{1}' in some locations where its type cannot be determined."), Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: diag(7035, ts.DiagnosticCategory.Error, "Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_mod_7035", "Try `npm install @types/{0}` if it exists or add a new declaration (.d.ts) file containing `declare module '{0}';`"), Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: diag(7036, ts.DiagnosticCategory.Error, "Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0_7036", "Dynamic import's specifier must be of type 'string', but here has type '{0}'."), + Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: diag(7037, ts.DiagnosticCategory.Message, "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037", "Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'."), + A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime: diag(7038, ts.DiagnosticCategory.Error, "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038", "A namespace-style import cannot be called or constructed, and will cause a failure at runtime."), + Mapped_object_type_implicitly_has_an_any_template_type: diag(7039, ts.DiagnosticCategory.Error, "Mapped_object_type_implicitly_has_an_any_template_type_7039", "Mapped object type implicitly has an 'any' template type."), You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."), You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."), import_can_only_be_used_in_a_ts_file: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_a_ts_file_8002", "'import ... =' can only be used in a .ts file."), @@ -4025,9 +4010,9 @@ var ts; Rewrite_as_the_indexed_access_type_0: diag(90026, ts.DiagnosticCategory.Message, "Rewrite_as_the_indexed_access_type_0_90026", "Rewrite as the indexed access type '{0}'"), Declare_static_property_0: diag(90027, ts.DiagnosticCategory.Message, "Declare_static_property_0_90027", "Declare static property '{0}'"), Call_decorator_expression: diag(90028, ts.DiagnosticCategory.Message, "Call_decorator_expression_90028", "Call decorator expression"), + Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"), Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"), Convert_function_0_to_class: diag(95002, ts.DiagnosticCategory.Message, "Convert_function_0_to_class_95002", "Convert function '{0}' to class"), - Extract_symbol: diag(95003, ts.DiagnosticCategory.Message, "Extract_symbol_95003", "Extract symbol"), Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"), Extract_function: diag(95005, ts.DiagnosticCategory.Message, "Extract_function_95005", "Extract function"), Extract_constant: diag(95006, ts.DiagnosticCategory.Message, "Extract_constant_95006", "Extract constant"), @@ -4039,12 +4024,16 @@ var ts; Infer_parameter_types_from_usage: diag(95012, ts.DiagnosticCategory.Message, "Infer_parameter_types_from_usage_95012", "Infer parameter types from usage"), Convert_to_default_import: diag(95013, ts.DiagnosticCategory.Message, "Convert_to_default_import_95013", "Convert to default import"), Install_0: diag(95014, ts.DiagnosticCategory.Message, "Install_0_95014", "Install '{0}'"), + Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), + Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), + Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), }; })(ts || (ts = {})); var ts; (function (ts) { - ts.emptyArray = []; + ts.resolvingEmptyArray = []; ts.emptyMap = ts.createMap(); + ts.emptyUnderscoreEscapedMap = ts.emptyMap; ts.externalHelpersModuleNameText = "tslib"; function getDeclarationOfKind(symbol, kind) { var declarations = symbol.declarations; @@ -4064,15 +4053,24 @@ var ts; var str = ""; var writeText = function (text) { return str += text; }; return { - string: function () { return str; }, + getText: function () { return str; }, + write: writeText, + rawWrite: writeText, + writeTextOfNode: writeText, writeKeyword: writeText, writeOperator: writeText, writePunctuation: writeText, writeSpace: writeText, writeStringLiteral: writeText, + writeLiteral: writeText, writeParameter: writeText, writeProperty: writeText, writeSymbol: writeText, + getTextPos: function () { return str.length; }, + getLine: function () { return 0; }, + getColumn: function () { return 0; }, + getIndent: function () { return 0; }, + isAtStartOfLine: function () { return false; }, writeLine: function () { return str += " "; }, increaseIndent: ts.noop, decreaseIndent: ts.noop, @@ -4084,10 +4082,10 @@ var ts; }; } function usingSingleLineStringWriter(action) { - var oldString = stringWriter.string(); + var oldString = stringWriter.getText(); try { action(stringWriter); - return stringWriter.string(); + return stringWriter.getText(); } finally { stringWriter.clear(); @@ -4121,12 +4119,19 @@ var ts; return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && + oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId); } ts.moduleResolutionIsEqualTo = moduleResolutionIsEqualTo; function packageIdIsEqual(a, b) { return a === b || a && b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version; } + function packageIdToString(_a) { + var name = _a.name, subModuleName = _a.subModuleName, version = _a.version; + var fullName = subModuleName ? name + "/" + subModuleName : name; + return fullName + "@" + version; + } + ts.packageIdToString = packageIdToString; function typeDirectiveIsEqualTo(oldResolution, newResolution) { return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary; } @@ -4162,7 +4167,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269) { + while (node && node.kind !== 272) { node = node.parent; } return node; @@ -4170,11 +4175,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208: - case 236: - case 215: - case 216: - case 217: + case 211: + case 239: + case 218: + case 219: + case 220: return true; } return false; @@ -4250,7 +4255,7 @@ var ts; if (includeJsDoc && ts.hasJSDocNodes(node)) { return getTokenPosOfNode(node.jsDoc[0]); } - if (node.kind === 290 && node._children.length > 0) { + if (node.kind === 293 && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -4297,7 +4302,7 @@ var ts; } ts.getEmitFlags = getEmitFlags; function getLiteralText(node, sourceFile) { - if (!nodeIsSynthesized(node) && node.parent) { + if (!nodeIsSynthesized(node) && node.parent && !(ts.isNumericLiteral(node) && node.numericLiteralFlags & 512)) { return getSourceTextOfNodeFromSourceFile(sourceFile, node); } var escapeText = getEmitFlags(node) & 16777216 ? escapeString : escapeNonAsciiString; @@ -4347,11 +4352,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 && node.parent.kind === 264; + return node.kind === 230 && node.parent.kind === 267; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 && + return node && node.kind === 237 && (node.name.kind === 9 || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; @@ -4368,11 +4373,11 @@ var ts; } ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { - return node && node.kind === 234 && (!node.body); + return node && node.kind === 237 && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 || - node.kind === 234 || + return node.kind === 272 || + node.kind === 237 || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -4385,9 +4390,9 @@ var ts; return false; } switch (node.parent.kind) { - case 269: + case 272: return ts.isExternalModule(node.parent); - case 235: + case 238: return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; @@ -4399,22 +4404,22 @@ var ts; ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269: - case 236: - case 264: - case 234: - case 215: - case 216: - case 217: - case 153: - case 152: + case 272: + case 239: + case 267: + case 237: + case 218: + case 219: + case 220: case 154: + case 153: case 155: - case 229: - case 187: - case 188: + case 156: + case 232: + case 190: + case 191: return true; - case 208: + case 211: return parentNode && !ts.isFunctionLike(parentNode); } return false; @@ -4422,25 +4427,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156: case 157: - case 151: case 158: - case 161: - case 162: - case 277: - case 230: - case 200: - case 231: - case 232: - case 287: - case 229: case 152: + case 159: + case 162: + case 163: + case 280: + case 233: + case 203: + case 234: + case 235: + case 290: + case 232: case 153: case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: return true; default: ts.assertTypeIsNever(node); @@ -4450,8 +4455,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239: - case 238: + case 242: + case 241: return true; default: return false; @@ -4483,21 +4488,20 @@ var ts; case 9: case 8: return escapeLeadingUnderscores(name.text); - case 145: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144: + case 145: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180: + case 183: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -4507,6 +4511,11 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); @@ -4534,7 +4543,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208) { + if (node.body && node.body.kind === 211) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -4546,37 +4555,46 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269: + case 272: var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); if (pos_1 === sourceFile.text.length) { return ts.createTextSpan(0, 0); } return getSpanOfTokenAtPosition(sourceFile, pos_1); - case 227: - case 177: case 230: - case 200: - case 231: - case 234: + case 180: case 233: - case 268: - case 229: - case 187: - case 152: - case 154: - case 155: + case 203: + case 234: + case 237: + case 236: + case 271: case 232: + case 190: + case 153: + case 155: + case 156: + case 235: errorNode = node.name; break; - case 188: + case 191: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -4585,7 +4603,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 && isConst(node); + return node.kind === 236 && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -4598,15 +4616,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 && n.expression.kind === 97; + return n.kind === 185 && n.expression.kind === 97; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 && n.expression.kind === 91; + return n.kind === 185 && n.expression.kind === 91; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 + return node.kind === 214 && node.expression.kind === 9; } ts.isPrologueDirective = isPrologueDirective; @@ -4615,11 +4633,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 || - node.kind === 146 || - node.kind === 187 || - node.kind === 188 || - node.kind === 186) ? + var commentRanges = (node.kind === 148 || + node.kind === 147 || + node.kind === 190 || + node.kind === 191 || + node.kind === 189) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); return ts.filter(commentRanges, function (comment) { @@ -4634,69 +4652,71 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 <= node.kind && node.kind <= 174) { + if (160 <= node.kind && node.kind <= 177) { return true; } switch (node.kind) { case 119: - case 133: - case 136: - case 122: + case 134: case 137: - case 139: - case 130: + case 122: + case 138: + case 140: + case 131: return true; case 105: - return node.parent.kind !== 191; - case 202: + return node.parent.kind !== 194; + case 205: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147: + return node.parent.kind === 176 || node.parent.kind === 171; case 71: - if (node.parent.kind === 144 && node.parent.right === node) { + if (node.parent.kind === 145 && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 && node.parent.name === node) { + else if (node.parent.kind === 183 && node.parent.name === node) { node = node.parent; } - ts.Debug.assert(node.kind === 71 || node.kind === 144 || node.kind === 180, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); - case 144: - case 180: + ts.Debug.assert(node.kind === 71 || node.kind === 145 || node.kind === 183, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + case 145: + case 183: case 99: var parent = node.parent; - if (parent.kind === 163) { + if (parent.kind === 164) { return false; } - if (159 <= parent.kind && parent.kind <= 174) { + if (160 <= parent.kind && parent.kind <= 177) { return true; } switch (parent.kind) { - case 202: + case 205: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146: - return node === parent.constraint; - case 150: - case 149: case 147: - case 227: + return node === parent.constraint; + case 151: + case 150: + case 148: + case 230: return node === parent.type; - case 229: - case 187: - case 188: + case 232: + case 190: + case 191: + case 154: case 153: case 152: - case 151: - case 154: case 155: - return node === parent.type; case 156: + return node === parent.type; case 157: case 158: + case 159: + return node === parent.type; + case 188: return node === parent.type; case 185: - return node === parent.type; - case 182: - case 183: - return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0; - case 184: + case 186: + return ts.contains(parent.typeArguments, node); + case 187: return false; } } @@ -4717,23 +4737,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220: + case 223: return visitor(node); - case 236: - case 208: - case 212: - case 213: - case 214: + case 239: + case 211: case 215: case 216: case 217: - case 221: - case 222: - case 261: - case 262: - case 223: + case 218: + case 219: + case 220: + case 224: case 225: case 264: + case 265: + case 226: + case 228: + case 267: return ts.forEachChild(node, traverse); } } @@ -4743,25 +4763,24 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198: + case 201: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233: - case 231: + case 236: case 234: - case 232: - case 230: - case 200: + case 237: + case 235: + case 233: + case 203: return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145) { - traverse(name.expression); + if (node.name && node.name.kind === 146) { + traverse(node.name.expression); return; } } @@ -4773,10 +4792,10 @@ var ts; } ts.forEachYieldExpression = forEachYieldExpression; function getRestParameterElementType(node) { - if (node && node.kind === 165) { + if (node && node.kind === 166) { return node.elementType; } - else if (node && node.kind === 160) { + else if (node && node.kind === 161) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -4786,12 +4805,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231: - case 230: - case 200: - case 164: + case 234: + case 233: + case 203: + case 165: return node.members; - case 179: + case 182: return node.properties; } } @@ -4799,14 +4818,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177: + case 180: + case 271: + case 148: case 268: - case 147: - case 265: + case 151: case 150: - case 149: - case 266: - case 227: + case 269: + case 230: return true; } } @@ -4814,8 +4833,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 - && node.parent.parent.kind === 209; + return node.parent.kind === 231 + && node.parent.parent.kind === 212; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -4826,13 +4845,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 229: - case 187: + case 156: + case 232: + case 190: return true; } return false; @@ -4843,7 +4862,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223) { + if (node.statement.kind !== 226) { return node.statement; } node = node.statement; @@ -4851,17 +4870,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 && ts.isFunctionLike(node.parent); + return node && node.kind === 211 && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 && node.parent.kind === 179; + return node && node.kind === 153 && node.parent.kind === 182; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 && - (node.parent.kind === 179 || - node.parent.kind === 200); + return node.kind === 153 && + (node.parent.kind === 182 || + node.parent.kind === 203); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -4874,7 +4893,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265) { + if (property.kind === 268) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -4896,39 +4915,39 @@ var ts; return undefined; } switch (node.kind) { - case 145: + case 146: if (ts.isClassLike(node.parent.parent)) { return node; } node = node.parent; break; - case 148: - if (node.parent.kind === 147 && ts.isClassElement(node.parent.parent)) { + case 149: + if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { node = node.parent; } break; - case 188: + case 191: if (!includeArrowFunctions) { continue; } - case 229: - case 187: - case 234: - case 150: - case 149: - case 152: + case 232: + case 190: + case 237: case 151: + case 150: case 153: + case 152: case 154: case 155: case 156: case 157: case 158: - case 233: - case 269: + case 159: + case 236: + case 272: return node; } } @@ -4938,9 +4957,9 @@ var ts; var container = getThisContainer(node, false); if (container) { switch (container.kind) { - case 153: - case 229: - case 187: + case 154: + case 232: + case 190: return container; } } @@ -4954,25 +4973,25 @@ var ts; return node; } switch (node.kind) { - case 145: + case 146: node = node.parent; break; - case 229: - case 187: - case 188: + case 232: + case 190: + case 191: if (!stopOnFunctions) { continue; } - case 150: - case 149: - case 152: case 151: + case 150: case 153: + case 152: case 154: case 155: + case 156: return node; - case 148: - if (node.parent.kind === 147 && ts.isClassElement(node.parent.parent)) { + case 149: + if (node.parent.kind === 148 && ts.isClassElement(node.parent.parent)) { node = node.parent.parent; } else if (ts.isClassElement(node.parent)) { @@ -4984,14 +5003,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 || func.kind === 188) { + if (func.kind === 190 || func.kind === 191) { var prev = func; var parent = func.parent; - while (parent.kind === 186) { + while (parent.kind === 189) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 && parent.expression === prev) { + if (parent.kind === 185 && parent.expression === prev) { return parent; } } @@ -4999,58 +5018,60 @@ var ts; ts.getImmediatelyInvokedFunctionExpression = getImmediatelyInvokedFunctionExpression; function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 || kind === 181) + return (kind === 183 || kind === 184) && node.expression.kind === 97; } ts.isSuperProperty = isSuperProperty; function isThisProperty(node) { var kind = node.kind; - return (kind === 180 || kind === 181) + return (kind === 183 || kind === 184) && node.expression.kind === 99; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160: + case 161: return node.typeName; - case 202: + case 205: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71: - case 144: + case 145: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184) { - return node.tag; + switch (node.kind) { + case 187: + return node.tag; + case 255: + case 254: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230: + case 233: return true; - case 150: - return parent.kind === 230; - case 154: + case 151: + return parent.kind === 233; case 155: - case 152: + case 156: + case 153: return node.body !== undefined - && parent.kind === 230; - case 147: + && parent.kind === 233; + case 148: return parent.body !== undefined - && (parent.kind === 153 - || parent.kind === 152 - || parent.kind === 155) - && grandparent.kind === 230; + && (parent.kind === 154 + || parent.kind === 153 + || parent.kind === 156) + && grandparent.kind === 233; } return false; } @@ -5066,19 +5087,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230: + case 233: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152: - case 155: + case 153: + case 156: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 || - parent.kind === 251 || - parent.kind === 253) { + if (parent.kind === 255 || + parent.kind === 254 || + parent.kind === 256) { return parent.tagName === node; } return false; @@ -5091,45 +5112,45 @@ var ts; case 101: case 86: case 12: - case 178: - case 179: - case 180: case 181: case 182: case 183: case 184: - case 203: case 185: - case 204: case 186: case 187: - case 200: + case 206: case 188: - case 191: + case 207: case 189: case 190: - case 193: + case 203: + case 191: case 194: - case 195: - case 196: - case 199: - case 197: - case 13: - case 201: - case 250: - case 251: - case 254: - case 198: case 192: - case 205: + case 193: + case 196: + case 197: + case 198: + case 199: + case 202: + case 200: + case 13: + case 204: + case 253: + case 254: + case 257: + case 201: + case 195: + case 208: return true; - case 144: - while (node.parent.kind === 144) { + case 145: + while (node.parent.kind === 145) { node = node.parent; } - return node.parent.kind === 163 || isJSXTagName(node); + return node.parent.kind === 164 || isJSXTagName(node); case 71: - if (node.parent.kind === 163 || isJSXTagName(node)) { + if (node.parent.kind === 164 || isJSXTagName(node)) { return true; } case 8: @@ -5144,47 +5165,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227: - case 147: + case 230: + case 148: + case 151: case 150: - case 149: + case 271: case 268: - case 265: - case 177: + case 180: return parent.initializer === node; - case 211: - case 212: - case 213: case 214: - case 220: - case 221: - case 222: - case 261: - case 224: - return parent.expression === node; case 215: - var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228) || - forStatement.condition === node || - forStatement.incrementor === node; case 216: case 217: + case 223: + case 224: + case 225: + case 264: + case 227: + return parent.expression === node; + case 218: + var forStatement = parent; + return (forStatement.initializer === node && forStatement.initializer.kind !== 231) || + forStatement.condition === node || + forStatement.incrementor === node; + case 219: + case 220: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231) || forInStatement.expression === node; - case 185: - case 203: - return node === parent.expression; + case 188: case 206: return node === parent.expression; - case 145: + case 209: return node === parent.expression; - case 148: - case 260: - case 259: - case 267: + case 146: + return node === parent.expression; + case 149: + case 263: + case 262: + case 270: return true; - case 202: + case 205: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -5192,7 +5213,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 && node.moduleReference.kind === 249; + return node.kind === 241 && node.moduleReference.kind === 252; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -5201,7 +5222,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 && node.moduleReference.kind !== 249; + return node.kind === 241 && node.moduleReference.kind !== 252; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -5221,11 +5242,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 || node.typeArguments[0].kind === 133); + (node.typeArguments[0].kind === 137 || node.typeArguments[0].kind === 134); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182) { + if (callExpression.kind !== 185) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -5248,9 +5269,9 @@ var ts; } ts.isStringDoubleQuoted = isStringDoubleQuoted; function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227) { + if (s.valueDeclaration && s.valueDeclaration.kind === 230) { var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 || declaration.initializer.kind === 200); + return declaration.initializer && (declaration.initializer.kind === 190 || declaration.initializer.kind === 203); } return false; } @@ -5274,7 +5295,7 @@ var ts; if (!isInJavaScriptFile(expr)) { return 0; } - if (expr.operatorToken.kind !== 58 || expr.left.kind !== 180) { + if (expr.operatorToken.kind !== 58 || expr.left.kind !== 183) { return 0; } var lhs = expr.left; @@ -5293,7 +5314,7 @@ var ts; else if (lhs.expression.kind === 99) { return 4; } - else if (lhs.expression.kind === 180) { + else if (lhs.expression.kind === 183) { var innerPropertyAccess = lhs.expression; if (innerPropertyAccess.expression.kind === 71) { var innerPropertyAccessIdentifier = innerPropertyAccess.expression; @@ -5310,21 +5331,21 @@ var ts; ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 && + expr.parent && expr.parent.kind === 214 && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239) { + if (node.kind === 242) { return node.moduleSpecifier; } - if (node.kind === 238) { + if (node.kind === 241) { var reference = node.moduleReference; - if (reference.kind === 249) { + if (reference.kind === 252) { return reference.expression; } } - if (node.kind === 245) { + if (node.kind === 248) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -5333,31 +5354,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241) { - return importClause.namedBindings; + switch (node.kind) { + case 242: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241: + return node; + case 248: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 - && node.importClause - && !!node.importClause.name; + return node.kind === 242 && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147: + case 148: + case 153: case 152: + case 269: + case 268: case 151: - case 266: - case 265: case 150: - case 149: return node.questionToken !== undefined; } } @@ -5365,71 +5387,62 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 && + return node.kind === 280 && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; } ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getAllJSDocs(node) { - if (ts.isJSDocTypedefTag(node)) { - return [node.parent]; - } - return getJSDocCommentsAndTags(node); - } - ts.getAllJSDocs = getAllJSDocs; function getSourceOfAssignment(node) { return ts.isExpressionStatement(node) && node.expression && ts.isBinaryExpression(node.expression) && node.expression.operatorToken.kind === 58 && node.expression.right; } - ts.getSourceOfAssignment = getSourceOfAssignment; - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151: + return node.initializer; + } } - ts.getSingleInitializerOfVariableStatement = getSingleInitializerOfVariableStatement; - function getSingleVariableOfVariableStatement(node, child) { + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } - ts.getSingleVariableOfVariableStatement = getSingleVariableOfVariableStatement; function getNestedModuleDeclaration(node) { - return node.kind === 234 && + return node.kind === 237 && node.body && - node.body.kind === 234 && + node.body.kind === 237 && node.body; } - ts.getNestedModuleDeclaration = getNestedModuleDeclaration; function getJSDocCommentsAndTags(node) { var result; getJSDocCommentsAndTagsWorker(node); return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 || parent.kind === 151 || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 || - node.kind === 180 && node.parent && node.parent.kind === 211) { + node.kind === 183 && node.parent && node.parent.kind === 214) { getJSDocCommentsAndTagsWorker(parent); } - if (node.kind === 147) { + if (node.kind === 148) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } - if (isVariableLike(node) && node.initializer && ts.hasJSDocNodes(node.initializer)) { + if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { result = ts.addRange(result, node.initializer.jsDoc); } if (ts.hasJSDocNodes(node)) { @@ -5457,7 +5470,7 @@ var ts; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -5465,7 +5478,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279); + ts.Debug.assert(node.parent.kind === 282); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -5488,30 +5501,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195: + case 198: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 ? 1 : 2 : 0; - case 193: - case 194: + case 196: + case 197: var unaryOperator = parent.operator; return unaryOperator === 43 || unaryOperator === 44 ? 2 : 0; - case 216: - case 217: + case 219: + case 220: return parent.initializer === node ? 1 : 0; - case 186: - case 178: - case 199: + case 189: + case 181: + case 202: + case 207: node = parent; break; - case 266: + case 269: if (parent.name !== node) { return 0; } node = parent.parent; break; - case 265: + case 268: if (parent.name === node) { return 0; } @@ -5528,6 +5542,29 @@ var ts; return getAssignmentTargetKind(node) !== 0; } ts.isAssignmentTarget = isAssignmentTarget; + function isNodeWithPossibleHoistedDeclaration(node) { + switch (node.kind) { + case 211: + case 212: + case 224: + case 215: + case 225: + case 239: + case 264: + case 265: + case 226: + case 218: + case 219: + case 220: + case 216: + case 217: + case 228: + case 267: + return true; + } + return false; + } + ts.isNodeWithPossibleHoistedDeclaration = isNodeWithPossibleHoistedDeclaration; function walkUp(node, kind) { while (node && node.kind === kind) { node = node.parent; @@ -5535,19 +5572,19 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169); + return walkUp(node, 172); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186); + return walkUp(node, 189); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; function isDeleteTarget(node) { - if (node.kind !== 180 && node.kind !== 181) { + if (node.kind !== 183 && node.kind !== 184) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189; + return node && node.kind === 192; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -5587,49 +5624,49 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 || node.kind === 8) && - node.parent.kind === 145 && + node.parent.kind === 146 && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150: - case 149: - case 152: case 151: - case 154: + case 150: + case 153: + case 152: case 155: + case 156: + case 271: case 268: - case 265: - case 180: + case 183: return parent.name === node; - case 144: + case 145: if (parent.right === node) { - while (parent.kind === 144) { + while (parent.kind === 145) { parent = parent.parent; } - return parent.kind === 163; + return parent.kind === 164; } return false; - case 177: - case 243: + case 180: + case 246: return parent.propertyName === node; - case 247: - case 257: + case 250: + case 260: return true; } return false; } ts.isIdentifierName = isIdentifierName; function isAliasSymbolDeclaration(node) { - return node.kind === 238 || - node.kind === 237 || - node.kind === 240 && !!node.name || - node.kind === 241 || - node.kind === 243 || - node.kind === 247 || - node.kind === 244 && exportAssignmentIsAlias(node); + return node.kind === 241 || + node.kind === 240 || + node.kind === 243 && !!node.name || + node.kind === 244 || + node.kind === 246 || + node.kind === 250 || + node.kind === 247 && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -5713,11 +5750,11 @@ var ts; } ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; function isKeyword(token) { - return 72 <= token && token <= 143; + return 72 <= token && token <= 144; } ts.isKeyword = isKeyword; function isContextualKeyword(token) { - return 117 <= token && token <= 143; + return 117 <= token && token <= 144; } ts.isContextualKeyword = isContextualKeyword; function isNonContextualKeyword(token) { @@ -5739,13 +5776,13 @@ var ts; } var flags = 0; switch (node.kind) { - case 229: - case 187: - case 152: + case 232: + case 190: + case 153: if (node.asteriskToken) { flags |= 1; } - case 188: + case 191: if (hasModifier(node, 256)) { flags |= 2; } @@ -5759,10 +5796,10 @@ var ts; ts.getFunctionFlags = getFunctionFlags; function isAsyncFunction(node) { switch (node.kind) { - case 229: - case 187: - case 188: - case 152: + case 232: + case 190: + case 191: + case 153: return node.body !== undefined && node.asteriskToken === undefined && hasModifier(node, 256); @@ -5782,7 +5819,7 @@ var ts; } ts.hasDynamicName = hasDynamicName; function isDynamicName(name) { - return name.kind === 145 && + return name.kind === 146 && !isStringOrNumericLiteral(name.expression) && !isWellKnownSymbolSyntactically(name.expression); } @@ -5798,7 +5835,7 @@ var ts; if (name.kind === 9 || name.kind === 8) { return escapeLeadingUnderscores(name.text); } - if (name.kind === 145) { + if (name.kind === 146) { var nameExpression = name.expression; if (isWellKnownSymbolSyntactically(nameExpression)) { return getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); @@ -5840,6 +5877,10 @@ var ts; return "__@" + symbolName; } ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; + function isKnownSymbol(symbol) { + return ts.startsWith(symbol.escapedName, "__@"); + } + ts.isKnownSymbol = isKnownSymbol; function isESSymbolIdentifier(node) { return node.kind === 71 && node.escapedText === "Symbol"; } @@ -5850,11 +5891,11 @@ var ts; ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier; function isParameterDeclaration(node) { var root = getRootDeclaration(node); - return root.kind === 147; + return root.kind === 148; } ts.isParameterDeclaration = isParameterDeclaration; function getRootDeclaration(node) { - while (node.kind === 177) { + while (node.kind === 180) { node = node.parent.parent; } return node; @@ -5862,15 +5903,15 @@ var ts; ts.getRootDeclaration = getRootDeclaration; function nodeStartsNewLexicalEnvironment(node) { var kind = node.kind; - return kind === 153 - || kind === 187 - || kind === 229 - || kind === 188 - || kind === 152 - || kind === 154 + return kind === 154 + || kind === 190 + || kind === 232 + || kind === 191 + || kind === 153 || kind === 155 - || kind === 234 - || kind === 269; + || kind === 156 + || kind === 237 + || kind === 272; } ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; function nodeIsSynthesized(range) { @@ -5884,23 +5925,23 @@ var ts; ts.getOriginalSourceFile = getOriginalSourceFile; function getExpressionAssociativity(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 && expression.arguments !== undefined; return getOperatorAssociativity(expression.kind, operator, hasArguments); } ts.getExpressionAssociativity = getExpressionAssociativity; function getOperatorAssociativity(kind, operator, hasArguments) { switch (kind) { - case 183: + case 186: return hasArguments ? 0 : 1; - case 193: - case 190: - case 191: - case 189: - case 192: case 196: - case 198: - return 1; + case 193: + case 194: + case 192: case 195: + case 199: + case 201: + return 1; + case 198: switch (operator) { case 40: case 58: @@ -5924,15 +5965,15 @@ var ts; ts.getOperatorAssociativity = getOperatorAssociativity; function getExpressionPrecedence(expression) { var operator = getOperator(expression); - var hasArguments = expression.kind === 183 && expression.arguments !== undefined; + var hasArguments = expression.kind === 186 && expression.arguments !== undefined; return getOperatorPrecedence(expression.kind, operator, hasArguments); } ts.getExpressionPrecedence = getExpressionPrecedence; function getOperator(expression) { - if (expression.kind === 195) { + if (expression.kind === 198) { return expression.operatorToken.kind; } - else if (expression.kind === 193 || expression.kind === 194) { + else if (expression.kind === 196 || expression.kind === 197) { return expression.operator; } else { @@ -5950,37 +5991,37 @@ var ts; case 86: case 8: case 9: - case 178: - case 179: - case 187: - case 188: - case 200: - case 250: - case 251: - case 254: - case 12: - case 13: - case 197: - case 186: - case 201: - return 19; - case 184: - case 180: case 181: - return 18; - case 183: - return hasArguments ? 18 : 17; case 182: - return 17; - case 194: - return 16; - case 193: case 190: case 191: + case 203: + case 253: + case 254: + case 257: + case 12: + case 13: + case 200: case 189: + case 204: + return 19; + case 187: + case 183: + case 184: + return 18; + case 186: + return hasArguments ? 18 : 17; + case 185: + return 17; + case 197: + return 16; + case 196: + case 193: + case 194: case 192: - return 15; case 195: + return 15; + case 198: switch (operatorKind) { case 51: case 52: @@ -6038,13 +6079,13 @@ var ts; default: return -1; } - case 196: - return 4; - case 198: - return 2; case 199: + return 4; + case 201: + return 2; + case 202: return 1; - case 293: + case 296: return 0; default: return -1; @@ -6053,9 +6094,9 @@ var ts; ts.getOperatorPrecedence = getOperatorPrecedence; function createDiagnosticCollection() { var nonFileDiagnostics = []; + var filesWithDiagnostics = []; var fileDiagnostics = ts.createMap(); var hasReadNonFileDiagnostics = false; - var diagnosticsModified = false; var modificationCount = 0; return { add: add, @@ -6077,6 +6118,7 @@ var ts; if (!diagnostics) { diagnostics = []; fileDiagnostics.set(diagnostic.file.fileName, diagnostics); + ts.insertSorted(filesWithDiagnostics, diagnostic.file.fileName, ts.compareStringsCaseSensitive); } } else { @@ -6086,39 +6128,23 @@ var ts; } diagnostics = nonFileDiagnostics; } - diagnostics.push(diagnostic); - diagnosticsModified = true; + ts.insertSorted(diagnostics, diagnostic, ts.compareDiagnostics); modificationCount++; } function getGlobalDiagnostics() { - sortAndDeduplicate(); hasReadNonFileDiagnostics = true; return nonFileDiagnostics; } function getDiagnostics(fileName) { - sortAndDeduplicate(); if (fileName) { return fileDiagnostics.get(fileName) || []; } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); + var fileDiags = ts.flatMap(filesWithDiagnostics, function (f) { return fileDiagnostics.get(f); }); + if (!nonFileDiagnostics.length) { + return fileDiags; } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - fileDiagnostics.forEach(function (diagnostics) { - ts.forEach(diagnostics, pushDiagnostic); - }); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - fileDiagnostics.forEach(function (diagnostics, key) { - fileDiagnostics.set(key, ts.sortAndDeduplicateDiagnostics(diagnostics)); - }); + fileDiags.unshift.apply(fileDiags, nonFileDiagnostics); + return fileDiags; } } ts.createDiagnosticCollection = createDiagnosticCollection; @@ -6251,7 +6277,19 @@ var ts; getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, getText: function () { return output; }, isAtStartOfLine: function () { return lineStart; }, - reset: reset + clear: reset, + reportInaccessibleThisError: ts.noop, + reportPrivateInBaseOfClassExpression: ts.noop, + reportInaccessibleUniqueSymbolError: ts.noop, + trackSymbol: ts.noop, + writeKeyword: write, + writeOperator: write, + writeParameter: write, + writeProperty: write, + writePunctuation: write, + writeSpace: write, + writeStringLiteral: write, + writeSymbol: write }; } ts.createTextWriter = createTextWriter; @@ -6340,7 +6378,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 && nodeIsPresent(member.body)) { + if (member.kind === 154 && nodeIsPresent(member.body)) { return member; } }); @@ -6385,10 +6423,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154) { + if (accessor.kind === 155) { getAccessor = accessor; } - else if (accessor.kind === 155) { + else if (accessor.kind === 156) { setAccessor = accessor; } else { @@ -6397,7 +6435,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 || member.kind === 155) + if ((member.kind === 155 || member.kind === 156) && hasModifier(member, 32) === hasModifier(accessor, 32)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -6408,10 +6446,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 && !getAccessor) { + if (member.kind === 155 && !getAccessor) { getAccessor = member; } - if (member.kind === 155 && !setAccessor) { + if (member.kind === 156 && !setAccessor) { setAccessor = member; } } @@ -6427,7 +6465,7 @@ var ts; } ts.getAllAccessorDeclarations = getAllAccessorDeclarations; function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (node.type) { + if (ts.hasType(node)) { return node.type; } if (checkJSDoc || isInJavaScriptFile(node)) { @@ -6662,7 +6700,7 @@ var ts; case 76: return 2048; case 79: return 512; case 120: return 256; - case 131: return 64; + case 132: return 64; } return 0; } @@ -6678,7 +6716,7 @@ var ts; } ts.isAssignmentOperator = isAssignmentOperator; function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 && + if (node.kind === 205 && node.parent.token === 85 && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -6696,8 +6734,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, true)) { var kind = node.left.kind; - return kind === 179 - || kind === 178; + return kind === 182 + || kind === 181; } return false; } @@ -6707,7 +6745,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 + return node.kind === 205 && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 @@ -6717,21 +6755,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 || - node.kind === 180 && isEntityNameExpression(node.expression); + node.kind === 183 && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 && node.parent.right === node) || - (node.parent.kind === 180 && node.parent.name === node); + return (node.parent.kind === 145 && node.parent.right === node) || + (node.parent.kind === 183 && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 && + return expression.kind === 182 && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 && + return expression.kind === 181 && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -6801,14 +6839,14 @@ var ts; ts.convertToBase64 = convertToBase64; var carriageReturnLineFeed = "\r\n"; var lineFeed = "\n"; - function getNewLineCharacter(options, system) { + function getNewLineCharacter(options, getNewLine) { switch (options.newLine) { case 0: return carriageReturnLineFeed; case 1: return lineFeed; } - return system ? system.newLine : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; + return getNewLine ? getNewLine() : ts.sys ? ts.sys.newLine : carriageReturnLineFeed; } ts.getNewLineCharacter = getNewLineCharacter; function formatEnum(value, enumObject, isFlags) { @@ -6944,8 +6982,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233: - case 234: + case 236: + case 237: return parseNode === parseNode.parent.name; } } @@ -7007,20 +7045,20 @@ var ts; if (!parent) return 0; switch (parent.kind) { - case 194: - case 193: + case 197: + case 196: var operator = parent.operator; return operator === 43 || operator === 44 ? writeOrReadWrite() : 0; - case 195: + case 198: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0; - case 180: + case 183: return parent.name !== node ? 0 : accessKind(parent); default: return 0; } function writeOrReadWrite() { - return parent.parent && parent.parent.kind === 211 ? 1 : 2; + return parent.parent && parent.parent.kind === 214 ? 1 : 2; } } function compareDataObjects(dst, src) { @@ -7104,6 +7142,14 @@ var ts; return checker.getSignaturesOfType(type, 0).length !== 0 || checker.getSignaturesOfType(type, 1).length !== 0; } ts.typeHasCallOrConstructSignatures = typeHasCallOrConstructSignatures; + function forSomeAncestorDirectory(directory, callback) { + return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); + } + ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -7237,9 +7283,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146) { + if (d && d.kind === 147) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234) { return current; } } @@ -7247,7 +7293,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92) && node.parent.kind === 153 && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92) && node.parent.kind === 154 && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -7265,7 +7311,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -7273,14 +7319,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227) { + if (node.kind === 230) { node = node.parent; } - if (node && node.kind === 228) { + if (node && node.kind === 231) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209) { + if (node && node.kind === 212) { flags |= ts.getModifierFlags(node); } return flags; @@ -7289,14 +7335,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227) { + if (node.kind === 230) { node = node.parent; } - if (node && node.kind === 228) { + if (node && node.kind === 231) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209) { + if (node && node.kind === 212) { flags |= node.flags; } return flags; @@ -7400,18 +7446,17 @@ var ts; return getDeclarationIdentifier(hostNode); } switch (hostNode.kind) { - case 209: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211: + case 214: var expr = hostNode.expression; switch (expr.kind) { - case 180: + case 183: return expr.name; - case 181: + case 184: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -7420,10 +7465,10 @@ var ts; return undefined; case 1: return undefined; - case 186: { + case 189: { return getDeclarationIdentifier(hostNode.expression); } - case 223: { + case 226: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -7448,15 +7493,15 @@ var ts; switch (declaration.kind) { case 71: return declaration; - case 289: - case 284: { + case 292: + case 287: { var name = declaration.name; - if (name.kind === 144) { + if (name.kind === 145) { return name.right; } break; } - case 195: { + case 198: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1: @@ -7468,9 +7513,9 @@ var ts; return undefined; } } - case 288: + case 291: return getNameOfJSDocTypedef(declaration); - case 244: { + case 247: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -7487,27 +7532,27 @@ var ts; } ts.getJSDocParameterTags = getJSDocParameterTags; function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284); + return !!getFirstJSDocTag(node, 287); } ts.hasJSDocParameterTags = hasJSDocParameterTags; function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282); + return getFirstJSDocTag(node, 285); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283); + return getFirstJSDocTag(node, 286); } ts.getJSDocClassTag = getJSDocClassTag; function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285); + return getFirstJSDocTag(node, 288); } ts.getJSDocReturnTag = getJSDocReturnTag; function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287); + return getFirstJSDocTag(node, 290); } ts.getJSDocTemplateTag = getJSDocTemplateTag; function getJSDocTypeTag(node) { - var tag = getFirstJSDocTag(node, 286); + var tag = getFirstJSDocTag(node, 289); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -7515,8 +7560,8 @@ var ts; } ts.getJSDocTypeTag = getJSDocTypeTag; function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286); - if (!tag && node.kind === 147) { + var tag = getFirstJSDocTag(node, 289); + if (!tag && node.kind === 148) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -7586,600 +7631,608 @@ var ts; } ts.isIdentifier = isIdentifier; function isQualifiedName(node) { - return node.kind === 144; + return node.kind === 145; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145; + return node.kind === 146; } ts.isComputedPropertyName = isComputedPropertyName; function isTypeParameterDeclaration(node) { - return node.kind === 146; + return node.kind === 147; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147; + return node.kind === 148; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148; + return node.kind === 149; } ts.isDecorator = isDecorator; function isPropertySignature(node) { - return node.kind === 149; + return node.kind === 150; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150; + return node.kind === 151; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151; + return node.kind === 152; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152; + return node.kind === 153; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153; + return node.kind === 154; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154; + return node.kind === 155; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155; + return node.kind === 156; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156; + return node.kind === 157; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157; + return node.kind === 158; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158; + return node.kind === 159; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; function isTypePredicateNode(node) { - return node.kind === 159; + return node.kind === 160; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160; + return node.kind === 161; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161; + return node.kind === 162; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162; + return node.kind === 163; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163; + return node.kind === 164; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164; + return node.kind === 165; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165; + return node.kind === 166; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166; + return node.kind === 167; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167; + return node.kind === 168; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168; + return node.kind === 169; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169; + return node.kind === 172; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170; + return node.kind === 173; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171; + return node.kind === 174; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172; + return node.kind === 175; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173; + return node.kind === 176; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174; + return node.kind === 177; } ts.isLiteralTypeNode = isLiteralTypeNode; function isObjectBindingPattern(node) { - return node.kind === 175; + return node.kind === 178; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176; + return node.kind === 179; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177; + return node.kind === 180; } ts.isBindingElement = isBindingElement; function isArrayLiteralExpression(node) { - return node.kind === 178; + return node.kind === 181; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179; + return node.kind === 182; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180; + return node.kind === 183; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181; + return node.kind === 184; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182; + return node.kind === 185; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183; + return node.kind === 186; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184; + return node.kind === 187; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185; + return node.kind === 188; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186; + return node.kind === 189; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292) { + while (node.kind === 295) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187; + return node.kind === 190; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188; + return node.kind === 191; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189; + return node.kind === 192; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 192; + return node.kind === 193; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191; + return node.kind === 194; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192; + return node.kind === 195; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193; + return node.kind === 196; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194; + return node.kind === 197; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195; + return node.kind === 198; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196; + return node.kind === 199; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197; + return node.kind === 200; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198; + return node.kind === 201; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199; + return node.kind === 202; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200; + return node.kind === 203; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201; + return node.kind === 204; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202; + return node.kind === 205; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203; + return node.kind === 206; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204; + return node.kind === 207; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205; + return node.kind === 208; } ts.isMetaProperty = isMetaProperty; function isTemplateSpan(node) { - return node.kind === 206; + return node.kind === 209; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207; + return node.kind === 210; } ts.isSemicolonClassElement = isSemicolonClassElement; function isBlock(node) { - return node.kind === 208; + return node.kind === 211; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209; + return node.kind === 212; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210; + return node.kind === 213; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211; + return node.kind === 214; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212; + return node.kind === 215; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213; + return node.kind === 216; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214; + return node.kind === 217; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215; + return node.kind === 218; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216; + return node.kind === 219; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217; + return node.kind === 220; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218; + return node.kind === 221; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219; + return node.kind === 222; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 || node.kind === 218; + return node.kind === 222 || node.kind === 221; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220; + return node.kind === 223; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221; + return node.kind === 224; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222; + return node.kind === 225; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223; + return node.kind === 226; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224; + return node.kind === 227; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225; + return node.kind === 228; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226; + return node.kind === 229; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227; + return node.kind === 230; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228; + return node.kind === 231; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229; + return node.kind === 232; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230; + return node.kind === 233; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231; + return node.kind === 234; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232; + return node.kind === 235; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233; + return node.kind === 236; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234; + return node.kind === 237; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235; + return node.kind === 238; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236; + return node.kind === 239; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237; + return node.kind === 240; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238; + return node.kind === 241; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239; + return node.kind === 242; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240; + return node.kind === 243; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241; + return node.kind === 244; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242; + return node.kind === 245; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243; + return node.kind === 246; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244; + return node.kind === 247; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245; + return node.kind === 248; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246; + return node.kind === 249; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247; + return node.kind === 250; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248; + return node.kind === 251; } ts.isMissingDeclaration = isMissingDeclaration; function isExternalModuleReference(node) { - return node.kind === 249; + return node.kind === 252; } ts.isExternalModuleReference = isExternalModuleReference; function isJsxElement(node) { - return node.kind === 250; + return node.kind === 253; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251; + return node.kind === 254; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252; + return node.kind === 255; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253; + return node.kind === 256; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254; + return node.kind === 257; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255; + return node.kind === 258; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256; + return node.kind === 259; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257; + return node.kind === 260; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258; + return node.kind === 261; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259; + return node.kind === 262; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260; + return node.kind === 263; } ts.isJsxExpression = isJsxExpression; function isCaseClause(node) { - return node.kind === 261; + return node.kind === 264; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262; + return node.kind === 265; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263; + return node.kind === 266; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264; + return node.kind === 267; } ts.isCatchClause = isCatchClause; function isPropertyAssignment(node) { - return node.kind === 265; + return node.kind === 268; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266; + return node.kind === 269; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267; + return node.kind === 270; } ts.isSpreadAssignment = isSpreadAssignment; function isEnumMember(node) { - return node.kind === 268; + return node.kind === 271; } ts.isEnumMember = isEnumMember; function isSourceFile(node) { - return node.kind === 269; + return node.kind === 272; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270; + return node.kind === 273; } ts.isBundle = isBundle; function isJSDocTypeExpression(node) { - return node.kind === 271; + return node.kind === 274; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272; + return node.kind === 275; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273; + return node.kind === 276; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274; + return node.kind === 277; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275; + return node.kind === 278; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276; + return node.kind === 279; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277; + return node.kind === 280; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278; + return node.kind === 281; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279; + return node.kind === 282; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282; + return node.kind === 285; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284; + return node.kind === 287; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285; + return node.kind === 288; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286; + return node.kind === 289; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287; + return node.kind === 290; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288; + return node.kind === 291; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289; + return node.kind === 292; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 || node.kind === 284; + return node.kind === 292 || node.kind === 287; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280; + return node.kind === 283; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); (function (ts) { function isSyntaxList(n) { - return n.kind === 290; + return n.kind === 293; } ts.isSyntaxList = isSyntaxList; function isNode(node) { @@ -8187,11 +8240,11 @@ var ts; } ts.isNode = isNode; function isNodeKind(kind) { - return kind >= 144; + return kind >= 145; } ts.isNodeKind = isNodeKind; function isToken(n) { - return n.kind >= 0 && n.kind <= 143; + return n.kind >= 0 && n.kind <= 144; } ts.isToken = isToken; function isNodeArray(array) { @@ -8221,7 +8274,7 @@ var ts; } ts.isStringTextContainingNode = isStringTextContainingNode; function isGeneratedIdentifier(node) { - return ts.isIdentifier(node) && node.autoGenerateKind > 0; + return ts.isIdentifier(node) && (node.autoGenerateFlags & 7) > 0; } ts.isGeneratedIdentifier = isGeneratedIdentifier; function isModifierKind(token) { @@ -8235,7 +8288,7 @@ var ts; case 114: case 112: case 113: - case 131: + case 132: case 115: return true; } @@ -8248,7 +8301,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 + return kind === 145 || kind === 71; } ts.isEntityName = isEntityName; @@ -8257,14 +8310,14 @@ var ts; return kind === 71 || kind === 9 || kind === 8 - || kind === 145; + || kind === 146; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 - || kind === 175 - || kind === 176; + || kind === 178 + || kind === 179; } ts.isBindingName = isBindingName; function isFunctionLike(node) { @@ -8277,13 +8330,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229: - case 152: + case 232: case 153: case 154: case 155: - case 187: - case 188: + case 156: + case 190: + case 191: return true; default: return false; @@ -8291,13 +8344,13 @@ var ts; } function isFunctionLikeKind(kind) { switch (kind) { - case 151: - case 156: + case 152: case 157: case 158: - case 161: - case 277: + case 159: case 162: + case 280: + case 163: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -8310,66 +8363,77 @@ var ts; ts.isFunctionOrModuleBlock = isFunctionOrModuleBlock; function isClassElement(node) { var kind = node.kind; - return kind === 153 - || kind === 150 - || kind === 152 - || kind === 154 + return kind === 154 + || kind === 151 + || kind === 153 || kind === 155 - || kind === 158 - || kind === 207 - || kind === 248; + || kind === 156 + || kind === 159 + || kind === 210 + || kind === 251; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 || node.kind === 200); + return node && (node.kind === 233 || node.kind === 203); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 || node.kind === 155); + return node && (node.kind === 155 || node.kind === 156); } ts.isAccessor = isAccessor; + function isMethodOrAccessor(node) { + switch (node.kind) { + case 153: + case 155: + case 156: + return true; + default: + return false; + } + } + ts.isMethodOrAccessor = isMethodOrAccessor; function isTypeElement(node) { var kind = node.kind; - return kind === 157 - || kind === 156 - || kind === 149 - || kind === 151 - || kind === 158 - || kind === 248; + return kind === 158 + || kind === 157 + || kind === 150 + || kind === 152 + || kind === 159 + || kind === 251; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 - || kind === 266 - || kind === 267 - || kind === 152 - || kind === 154 + return kind === 268 + || kind === 269 + || kind === 270 + || kind === 153 || kind === 155 - || kind === 248; + || kind === 156 + || kind === 251; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; function isTypeNodeKind(kind) { - return (kind >= 159 && kind <= 174) + return (kind >= 160 && kind <= 177) || kind === 119 - || kind === 133 || kind === 134 + || kind === 135 || kind === 122 - || kind === 136 || kind === 137 + || kind === 138 || kind === 99 || kind === 105 - || kind === 139 + || kind === 140 || kind === 95 - || kind === 130 - || kind === 202 - || kind === 272 - || kind === 273 - || kind === 274 + || kind === 131 + || kind === 205 || kind === 275 || kind === 276 || kind === 277 - || kind === 278; + || kind === 278 + || kind === 279 + || kind === 280 + || kind === 281; } function isTypeNode(node) { return isTypeNodeKind(node.kind); @@ -8377,8 +8441,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161: case 162: + case 163: return true; } return false; @@ -8387,29 +8451,29 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 - || kind === 175; + return kind === 179 + || kind === 178; } return false; } ts.isBindingPattern = isBindingPattern; function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 - || kind === 179; + return kind === 181 + || kind === 182; } ts.isAssignmentPattern = isAssignmentPattern; function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 - || kind === 201; + return kind === 180 + || kind === 204; } ts.isArrayBindingElement = isArrayBindingElement; function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227: - case 147: - case 177: + case 230: + case 148: + case 180: return true; } return false; @@ -8422,8 +8486,8 @@ var ts; ts.isBindingOrAssignmentPattern = isBindingOrAssignmentPattern; function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175: - case 179: + case 178: + case 182: return true; } return false; @@ -8431,8 +8495,8 @@ var ts; ts.isObjectBindingOrAssignmentPattern = isObjectBindingOrAssignmentPattern; function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176: - case 178: + case 179: + case 181: return true; } return false; @@ -8440,18 +8504,18 @@ var ts; ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern; function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 - || kind === 144; + return kind === 183 + || kind === 145; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252: - case 251: - case 182: - case 183: - case 184: - case 148: + case 255: + case 254: + case 185: + case 186: + case 187: + case 149: return true; default: return false; @@ -8459,12 +8523,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 || node.kind === 183; + return node.kind === 185 || node.kind === 186; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 + return kind === 200 || kind === 13; } ts.isTemplateLiteral = isTemplateLiteral; @@ -8474,32 +8538,32 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180: - case 181: case 183: - case 182: - case 250: - case 251: - case 254: case 184: - case 178: case 186: - case 179: - case 200: + case 185: + case 253: + case 254: + case 257: case 187: + case 181: + case 189: + case 182: + case 203: + case 190: case 71: case 12: case 8: case 9: case 13: - case 197: + case 200: case 86: case 95: case 99: case 101: case 97: - case 204: - case 205: + case 207: + case 208: case 91: return true; default: @@ -8512,13 +8576,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { + case 196: + case 197: + case 192: case 193: case 194: - case 189: - case 190: - case 191: - case 192: - case 185: + case 195: + case 188: return true; default: return isLeftHandSideExpressionKind(kind); @@ -8526,9 +8590,9 @@ var ts; } function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194: + case 197: return true; - case 193: + case 196: return expr.operator === 43 || expr.operator === 44; default: @@ -8542,15 +8606,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196: - case 198: - case 188: - case 195: case 199: - case 203: case 201: - case 293: - case 292: + case 191: + case 198: + case 202: + case 206: + case 204: + case 296: + case 295: return true; default: return isUnaryExpressionKind(kind); @@ -8558,16 +8622,16 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 - || kind === 203; + return kind === 188 + || kind === 206; } ts.isAssertionExpression = isAssertionExpression; function isPartiallyEmittedExpression(node) { - return node.kind === 292; + return node.kind === 295; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; function isNotEmittedStatement(node) { - return node.kind === 291; + return node.kind === 294; } ts.isNotEmittedStatement = isNotEmittedStatement; function isNotEmittedOrPartiallyEmittedNode(node) { @@ -8577,20 +8641,20 @@ var ts; ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215: + case 218: + case 219: + case 220: case 216: case 217: - case 213: - case 214: return true; - case 223: + case 226: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; } ts.isIterationStatement = isIterationStatement; function isForInOrOfStatement(node) { - return node.kind === 216 || node.kind === 217; + return node.kind === 219 || node.kind === 220; } ts.isForInOrOfStatement = isForInOrOfStatement; function isConciseBody(node) { @@ -8609,106 +8673,106 @@ var ts; ts.isForInitializer = isForInitializer; function isModuleBody(node) { var kind = node.kind; - return kind === 235 - || kind === 234 + return kind === 238 + || kind === 237 || kind === 71; } ts.isModuleBody = isModuleBody; function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 - || kind === 234; + return kind === 238 + || kind === 237; } ts.isNamespaceBody = isNamespaceBody; function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 - || kind === 234; + || kind === 237; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 - || kind === 241; + return kind === 245 + || kind === 244; } ts.isNamedImportBindings = isNamedImportBindings; function isModuleOrEnumDeclaration(node) { - return node.kind === 234 || node.kind === 233; + return node.kind === 237 || node.kind === 236; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 - || kind === 177 - || kind === 230 - || kind === 200 - || kind === 153 + return kind === 191 + || kind === 180 || kind === 233 - || kind === 268 - || kind === 247 - || kind === 229 - || kind === 187 + || kind === 203 || kind === 154 - || kind === 240 - || kind === 238 - || kind === 243 - || kind === 231 - || kind === 257 - || kind === 152 - || kind === 151 - || kind === 234 - || kind === 237 - || kind === 241 - || kind === 147 - || kind === 265 - || kind === 150 - || kind === 149 - || kind === 155 - || kind === 266 + || kind === 236 + || kind === 271 + || kind === 250 || kind === 232 - || kind === 146 - || kind === 227 - || kind === 288; + || kind === 190 + || kind === 155 + || kind === 243 + || kind === 241 + || kind === 246 + || kind === 234 + || kind === 260 + || kind === 153 + || kind === 152 + || kind === 237 + || kind === 240 + || kind === 244 + || kind === 148 + || kind === 268 + || kind === 151 + || kind === 150 + || kind === 156 + || kind === 269 + || kind === 235 + || kind === 147 + || kind === 230 + || kind === 291; } function isDeclarationStatementKind(kind) { - return kind === 229 - || kind === 248 - || kind === 230 - || kind === 231 - || kind === 232 + return kind === 232 + || kind === 251 || kind === 233 || kind === 234 - || kind === 239 - || kind === 238 - || kind === 245 - || kind === 244 - || kind === 237; + || kind === 235 + || kind === 236 + || kind === 237 + || kind === 242 + || kind === 241 + || kind === 248 + || kind === 247 + || kind === 240; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 - || kind === 218 - || kind === 226 - || kind === 213 - || kind === 211 - || kind === 210 - || kind === 216 - || kind === 217 - || kind === 215 - || kind === 212 - || kind === 223 - || kind === 220 - || kind === 222 - || kind === 224 - || kind === 225 - || kind === 209 - || kind === 214 + return kind === 222 || kind === 221 - || kind === 291 - || kind === 295 - || kind === 294; + || kind === 229 + || kind === 216 + || kind === 214 + || kind === 213 + || kind === 219 + || kind === 220 + || kind === 218 + || kind === 215 + || kind === 226 + || kind === 223 + || kind === 225 + || kind === 227 + || kind === 228 + || kind === 212 + || kind === 217 + || kind === 224 + || kind === 294 + || kind === 298 + || kind === 297; } function isDeclaration(node) { - if (node.kind === 146) { - return node.parent.kind !== 287 || ts.isInJavaScriptFile(node); + if (node.kind === 147) { + return node.parent.kind !== 290 || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -8729,10 +8793,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208) + if (node.kind !== 211) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 || node.parent.kind === 264) { + if (node.parent.kind === 228 || node.parent.kind === 267) { return false; } } @@ -8740,8 +8804,8 @@ var ts; } function isModuleReference(node) { var kind = node.kind; - return kind === 249 - || kind === 144 + return kind === 252 + || kind === 145 || kind === 71; } ts.isModuleReference = isModuleReference; @@ -8749,66 +8813,101 @@ var ts; var kind = node.kind; return kind === 99 || kind === 71 - || kind === 180; + || kind === 183; } ts.isJsxTagNameExpression = isJsxTagNameExpression; function isJsxChild(node) { var kind = node.kind; - return kind === 250 - || kind === 260 - || kind === 251 + return kind === 253 + || kind === 263 + || kind === 254 || kind === 10 - || kind === 254; + || kind === 257; } ts.isJsxChild = isJsxChild; function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 - || kind === 259; + return kind === 260 + || kind === 262; } ts.isJsxAttributeLike = isJsxAttributeLike; function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 - || kind === 260; + || kind === 263; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 - || kind === 251; + return kind === 255 + || kind === 254; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 - || kind === 262; + return kind === 264 + || kind === 265; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; function isJSDocNode(node) { - return node.kind >= 271 && node.kind <= 289; + return node.kind >= 274 && node.kind <= 292; } ts.isJSDocNode = isJSDocNode; function isJSDocCommentContainingNode(node) { - return node.kind === 279 || isJSDocTag(node); + return node.kind === 282 || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; function isJSDocTag(node) { - return node.kind >= 281 && node.kind <= 289; + return node.kind >= 284 && node.kind <= 292; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155; + return node.kind === 156; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154; + return node.kind === 155; } ts.isGetAccessor = isGetAccessor; function hasJSDocNodes(node) { return !!node.jsDoc && node.jsDoc.length > 0; } ts.hasJSDocNodes = hasJSDocNodes; + function hasType(node) { + return !!node.type; + } + ts.hasType = hasType; + function hasInitializer(node) { + return !!node.initializer; + } + ts.hasInitializer = hasInitializer; + function hasOnlyExpressionInitializer(node) { + return hasInitializer(node) && !ts.isForStatement(node) && !ts.isForInStatement(node) && !ts.isForOfStatement(node) && !ts.isJsxAttribute(node); + } + ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; + function isObjectLiteralElement(node) { + switch (node.kind) { + case 260: + case 262: + case 268: + case 269: + case 153: + case 155: + case 156: + return true; + default: + return false; + } + } + ts.isObjectLiteralElement = isObjectLiteralElement; + function isTypeReferenceType(node) { + return node.kind === 161 || node.kind === 205; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 || node.kind === 13; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); var ts; (function (ts) { @@ -8844,47 +8943,48 @@ var ts; "false": 86, "finally": 87, "for": 88, - "from": 141, + "from": 142, "function": 89, "get": 125, "if": 90, "implements": 108, "import": 91, "in": 92, + "infer": 126, "instanceof": 93, "interface": 109, - "is": 126, - "keyof": 127, + "is": 127, + "keyof": 128, "let": 110, - "module": 128, - "namespace": 129, - "never": 130, + "module": 129, + "namespace": 130, + "never": 131, "new": 94, "null": 95, - "number": 133, - "object": 134, + "number": 134, + "object": 135, "package": 111, "private": 112, "protected": 113, "public": 114, - "readonly": 131, - "require": 132, - "global": 142, + "readonly": 132, + "require": 133, + "global": 143, "return": 96, - "set": 135, + "set": 136, "static": 115, - "string": 136, + "string": 137, "super": 97, "switch": 98, - "symbol": 137, + "symbol": 138, "this": 99, "throw": 100, "true": 101, "try": 102, - "type": 138, + "type": 139, "typeof": 103, - "undefined": 139, - "unique": 140, + "undefined": 140, + "unique": 141, "var": 104, "void": 105, "while": 106, @@ -8892,7 +8992,7 @@ var ts; "yield": 116, "async": 120, "await": 121, - "of": 143, + "of": 144, "{": 17, "}": 18, "(": 19, @@ -9034,7 +9134,9 @@ var ts; } ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -9215,7 +9317,7 @@ var ts; } function scanConflictMarkerTrivia(text, pos, error) { if (error) { - error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength); + error(ts.Diagnostics.Merge_conflict_marker_encountered, pos, mergeConflictMarkerLength); } var ch = text.charCodeAt(pos); var len = text.length; @@ -9439,19 +9541,60 @@ var ts; lookAhead: lookAhead, scanRange: scanRange, }; - function error(message, length) { + function error(message, errPos, length) { + if (errPos === void 0) { errPos = pos; } if (onError) { + var oldPos = pos; + pos = errPos; onError(message, length || 0); + pos = oldPos; } } + function scanNumberFragment() { + var start = pos; + var allowSeparator = false; + var isPreviousTokenSeparator = false; + var result = ""; + while (true) { + var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + result += text.substring(start, pos); + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + start = pos; + continue; + } + if (isDigit(ch)) { + allowSeparator = true; + isPreviousTokenSeparator = false; + pos++; + continue; + } + break; + } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } + return result + text.substring(start, pos); + } function scanNumber() { var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; + var mainFragment = scanNumberFragment(); + var decimalFragment; + var scientificFragment; if (text.charCodeAt(pos) === 46) { pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; + decimalFragment = scanNumberFragment(); } var end = pos; if (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101) { @@ -9459,17 +9602,29 @@ var ts; tokenFlags |= 16; if (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { + var preNumericPart = pos; + var finalFragment = scanNumberFragment(); + if (!finalFragment) { error(ts.Diagnostics.Digit_expected); } + else { + scientificFragment = text.substring(end, preNumericPart) + finalFragment; + end = pos; + } + } + if (tokenFlags & 512) { + var result = mainFragment; + if (decimalFragment) { + result += "." + decimalFragment; + } + if (scientificFragment) { + result += scientificFragment; + } + return "" + +result; + } + else { + return "" + +(text.substring(start, end)); } - return "" + +(text.substring(start, end)); } function scanOctalDigits() { var start = pos; @@ -9478,17 +9633,35 @@ var ts; } return +(text.substring(start, pos)); } - function scanExactNumberOfHexDigits(count) { - return scanHexDigits(count, false); + function scanExactNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(count, false, canHaveSeparators); } - function scanMinimumNumberOfHexDigits(count) { - return scanHexDigits(count, true); + function scanMinimumNumberOfHexDigits(count, canHaveSeparators) { + return scanHexDigits(count, true, canHaveSeparators); } - function scanHexDigits(minCount, scanAsManyAsPossible) { + function scanHexDigits(minCount, scanAsManyAsPossible, canHaveSeparators) { var digits = 0; var value = 0; + var allowSeparator = false; + var isPreviousTokenSeparator = false; while (digits < minCount || scanAsManyAsPossible) { var ch = text.charCodeAt(pos); + if (canHaveSeparators && ch === 95) { + tokenFlags |= 512; + if (allowSeparator) { + allowSeparator = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + allowSeparator = canHaveSeparators; if (ch >= 48 && ch <= 57) { value = value * 16 + ch - 48; } @@ -9503,10 +9676,14 @@ var ts; } pos++; digits++; + isPreviousTokenSeparator = false; } if (digits < minCount) { value = -1; } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + } return value; } function scanString(jsxAttributeString) { @@ -9642,7 +9819,7 @@ var ts; } } function scanHexadecimalEscape(numDigits) { - var escapedValue = scanExactNumberOfHexDigits(numDigits); + var escapedValue = scanExactNumberOfHexDigits(numDigits, false); if (escapedValue >= 0) { return String.fromCharCode(escapedValue); } @@ -9652,7 +9829,7 @@ var ts; } } function scanExtendedUnicodeEscape() { - var escapedValue = scanMinimumNumberOfHexDigits(1); + var escapedValue = scanMinimumNumberOfHexDigits(1, false); var isInvalidExtendedEscape = false; if (escapedValue < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); @@ -9691,7 +9868,7 @@ var ts; if (pos + 5 < end && text.charCodeAt(pos + 1) === 117) { var start_1 = pos; pos += 2; - var value = scanExactNumberOfHexDigits(4); + var value = scanExactNumberOfHexDigits(4, false); pos = start_1; return value; } @@ -9739,8 +9916,26 @@ var ts; ts.Debug.assert(base === 2 || base === 8, "Expected either base 2 or base 8"); var value = 0; var numberOfDigits = 0; + var separatorAllowed = false; + var isPreviousTokenSeparator = false; while (true) { var ch = text.charCodeAt(pos); + if (ch === 95) { + tokenFlags |= 512; + if (separatorAllowed) { + separatorAllowed = false; + isPreviousTokenSeparator = true; + } + else if (isPreviousTokenSeparator) { + error(ts.Diagnostics.Multiple_consecutive_numeric_separators_are_not_permitted, pos, 1); + } + else { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos, 1); + } + pos++; + continue; + } + separatorAllowed = true; var valueOfCh = ch - 48; if (!isDigit(ch) || valueOfCh >= base) { break; @@ -9748,10 +9943,15 @@ var ts; value = value * base + valueOfCh; pos++; numberOfDigits++; + isPreviousTokenSeparator = false; } if (numberOfDigits === 0) { return -1; } + if (text.charCodeAt(pos - 1) === 95) { + error(ts.Diagnostics.Numeric_separators_are_not_allowed_here, pos - 1, 1); + return value; + } return value; } function scan() { @@ -9937,7 +10137,7 @@ var ts; case 48: if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 || text.charCodeAt(pos + 1) === 120)) { pos += 2; - var value = scanMinimumNumberOfHexDigits(1); + var value = scanMinimumNumberOfHexDigits(1, true); if (value < 0) { error(ts.Diagnostics.Hexadecimal_digit_expected); value = 0; @@ -10258,7 +10458,7 @@ var ts; break; } } - tokenValue += text.substr(firstCharPosition, pos - firstCharPosition); + tokenValue += text.substring(firstCharPosition, pos); } return token; } @@ -10280,6 +10480,7 @@ var ts; startPos = pos; tokenPos = pos; var ch = text.charCodeAt(pos); + pos++; switch (ch) { case 9: case 11: @@ -10290,55 +10491,30 @@ var ts; } return token = 5; case 64: - pos++; return token = 57; case 10: case 13: - pos++; return token = 4; case 42: - pos++; return token = 39; case 123: - pos++; return token = 17; case 125: - pos++; return token = 18; case 91: - pos++; return token = 21; case 93: - pos++; return token = 22; case 60: - pos++; return token = 27; - case 62: - pos++; - return token = 29; case 61: - pos++; return token = 58; case 44: - pos++; return token = 26; case 46: - pos++; - if (text.substr(tokenPos, pos + 2) === "...") { - pos += 2; - return token = 24; - } return token = 23; - case 33: - pos++; - return token = 51; - case 63: - pos++; - return token = 55; } if (isIdentifierStart(ch, 6)) { - pos++; while (isIdentifierPart(text.charCodeAt(pos), 6) && pos < end) { pos++; } @@ -10346,7 +10522,7 @@ var ts; return token = 71; } else { - return pos += 1, token = 0; + return token = 0; } } function speculationHelper(callback, isLookahead) { @@ -10428,7 +10604,7 @@ var ts; var IdentifierConstructor; var SourceFileConstructor; function createNode(kind, pos, end) { - if (kind === 269) { + if (kind === 272) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71) { @@ -10460,60 +10636,88 @@ var ts; } } function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143) { + if (!node || node.kind <= 144) { return; } switch (node.kind) { - case 144: + case 145: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146: + case 147: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266: + case 269: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267: + case 270: return visitNode(cbNode, node.expression); - case 147: - case 150: - case 149: - case 265: - case 227: - case 177: + case 148: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 151: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 161: + case 150: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 268: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.questionToken) || + visitNode(cbNode, node.initializer); + case 230: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.exclamationToken) || + visitNode(cbNode, node.type) || + visitNode(cbNode, node.initializer); + case 180: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.dotDotDotToken) || + visitNode(cbNode, node.propertyName) || + visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); case 162: - case 156: + case 163: case 157: case 158: + case 159: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152: - case 151: case 153: + case 152: case 154: case 155: - case 187: - case 229: - case 188: + case 156: + case 190: + case 232: + case 191: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -10524,291 +10728,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160: + case 161: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159: + case 160: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163: - return visitNode(cbNode, node.exprName); case 164: - return visitNodes(cbNode, cbNodes, node.members); + return visitNode(cbNode, node.exprName); case 165: - return visitNode(cbNode, node.elementType); + return visitNodes(cbNode, cbNodes, node.members); case 166: - return visitNodes(cbNode, cbNodes, node.elementTypes); + return visitNode(cbNode, node.elementType); case 167: + return visitNodes(cbNode, cbNodes, node.elementTypes); case 168: - return visitNodes(cbNode, cbNodes, node.types); case 169: + return visitNodes(cbNode, cbNodes, node.types); + case 170: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); case 171: - return visitNode(cbNode, node.type); + return visitNode(cbNode, node.typeParameter); case 172: + case 174: + return visitNode(cbNode, node.type); + case 175: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173: + case 176: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174: + case 177: return visitNode(cbNode, node.literal); - case 175: - case 176: - return visitNodes(cbNode, cbNodes, node.elements); case 178: - return visitNodes(cbNode, cbNodes, node.elements); case 179: + return visitNodes(cbNode, cbNodes, node.elements); + case 181: + return visitNodes(cbNode, cbNodes, node.elements); + case 182: return visitNodes(cbNode, cbNodes, node.properties); - case 180: + case 183: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181: + case 184: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182: - case 183: + case 185: + case 186: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184: + case 187: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185: + case 188: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186: - return visitNode(cbNode, node.expression); case 189: return visitNode(cbNode, node.expression); - case 190: - return visitNode(cbNode, node.expression); - case 191: - return visitNode(cbNode, node.expression); - case 193: - return visitNode(cbNode, node.operand); - case 198: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); case 192: return visitNode(cbNode, node.expression); + case 193: + return visitNode(cbNode, node.expression); case 194: + return visitNode(cbNode, node.expression); + case 196: return visitNode(cbNode, node.operand); + case 201: + return visitNode(cbNode, node.asteriskToken) || + visitNode(cbNode, node.expression); case 195: + return visitNode(cbNode, node.expression); + case 197: + return visitNode(cbNode, node.operand); + case 198: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203: + case 206: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204: + case 207: return visitNode(cbNode, node.expression); - case 205: + case 208: return visitNode(cbNode, node.name); - case 196: + case 199: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199: + case 202: return visitNode(cbNode, node.expression); - case 208: - case 235: + case 211: + case 238: return visitNodes(cbNode, cbNodes, node.statements); - case 269: + case 272: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209: + case 212: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228: + case 231: return visitNodes(cbNode, cbNodes, node.declarations); - case 211: + case 214: return visitNode(cbNode, node.expression); - case 212: + case 215: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213: + case 216: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214: + case 217: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215: + case 218: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216: + case 219: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217: + case 220: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218: - case 219: - return visitNode(cbNode, node.label); - case 220: - return visitNode(cbNode, node.expression); case 221: + case 222: + return visitNode(cbNode, node.label); + case 223: + return visitNode(cbNode, node.expression); + case 224: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222: + case 225: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236: + case 239: return visitNodes(cbNode, cbNodes, node.clauses); - case 261: + case 264: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262: + case 265: return visitNodes(cbNode, cbNodes, node.statements); - case 223: + case 226: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224: + case 227: return visitNode(cbNode, node.expression); - case 225: + case 228: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264: + case 267: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148: + case 149: return visitNode(cbNode, node.expression); - case 230: - case 200: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); - case 231: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNodes(cbNode, cbNodes, node.heritageClauses) || - visitNodes(cbNode, cbNodes, node.members); - case 232: - return visitNodes(cbNode, cbNodes, node.decorators) || - visitNodes(cbNode, cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNode, cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); case 233: + case 203: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 268: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); case 234: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNodes(cbNode, cbNodes, node.heritageClauses) || + visitNodes(cbNode, cbNodes, node.members); + case 235: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.typeParameters) || + visitNode(cbNode, node.type); + case 236: + return visitNodes(cbNode, cbNodes, node.decorators) || + visitNodes(cbNode, cbNodes, node.modifiers) || + visitNode(cbNode, node.name) || + visitNodes(cbNode, cbNodes, node.members); + case 271: + return visitNode(cbNode, node.name) || + visitNode(cbNode, node.initializer); + case 237: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238: + case 241: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239: + case 242: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240: + case 243: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237: + case 240: return visitNode(cbNode, node.name); - case 241: + case 244: return visitNode(cbNode, node.name); - case 242: - case 246: - return visitNodes(cbNode, cbNodes, node.elements); case 245: + case 249: + return visitNodes(cbNode, cbNodes, node.elements); + case 248: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243: - case 247: + case 246: + case 250: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244: + case 247: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197: + case 200: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206: + case 209: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145: + case 146: return visitNode(cbNode, node.expression); - case 263: + case 266: return visitNodes(cbNode, cbNodes, node.types); - case 202: + case 205: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249: + case 252: return visitNode(cbNode, node.expression); - case 248: + case 251: return visitNodes(cbNode, cbNodes, node.decorators); - case 293: + case 296: return visitNodes(cbNode, cbNodes, node.elements); - case 250: + case 253: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254: + case 257: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251: - case 252: + case 254: + case 255: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258: + case 261: return visitNodes(cbNode, cbNodes, node.properties); - case 257: + case 260: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259: + case 262: return visitNode(cbNode, node.expression); - case 260: + case 263: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253: + case 256: return visitNode(cbNode, node.tagName); - case 271: - return visitNode(cbNode, node.type); - case 275: - return visitNode(cbNode, node.type); case 274: return visitNode(cbNode, node.type); - case 276: - return visitNode(cbNode, node.type); - case 277: - return visitNodes(cbNode, cbNodes, node.parameters) || - visitNode(cbNode, node.type); case 278: return visitNode(cbNode, node.type); + case 277: + return visitNode(cbNode, node.type); case 279: + return visitNode(cbNode, node.type); + case 280: + return visitNodes(cbNode, cbNodes, node.parameters) || + visitNode(cbNode, node.type); + case 281: + return visitNode(cbNode, node.type); + case 282: return visitNodes(cbNode, cbNodes, node.tags); - case 284: - case 289: + case 287: + case 292: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -10817,17 +11028,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285: - return visitNode(cbNode, node.typeExpression); - case 286: - return visitNode(cbNode, node.typeExpression); - case 282: - return visitNode(cbNode, node.class); - case 287: - return visitNodes(cbNode, cbNodes, node.typeParameters); case 288: + return visitNode(cbNode, node.typeExpression); + case 289: + return visitNode(cbNode, node.typeExpression); + case 285: + return visitNode(cbNode, node.class); + case 290: + return visitNodes(cbNode, cbNodes, node.typeParameters); + case 291: if (node.typeExpression && - node.typeExpression.kind === 271) { + node.typeExpression.kind === 274) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -10835,7 +11046,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280: + case 283: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -10843,7 +11054,7 @@ var ts; } } return; - case 292: + case 295: return visitNode(cbNode, node.expression); } } @@ -10934,7 +11145,7 @@ var ts; else if (token() === 17 || lookAhead(function () { return token() === 9; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1, false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1, ts.Diagnostics.Unexpected_token); } else { parseExpected(17); @@ -11011,15 +11222,7 @@ var ts; if (comments) { for (var _i = 0, comments_2 = comments; _i < comments_2.length; _i++) { var comment = comments_2[_i]; - var jsDoc = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDoc) { - if (!node.jsDoc) { - node.jsDoc = [jsDoc]; - } - else { - node.jsDoc.push(jsDoc); - } - } + node.jsDoc = ts.append(node.jsDoc, JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos)); } } return node; @@ -11048,7 +11251,7 @@ var ts; } Parser.fixupParentReferences = fixupParentReferences; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { - var sourceFile = new SourceFileConstructor(269, 0, sourceText.length); + var sourceFile = new SourceFileConstructor(272, 0, sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -11241,9 +11444,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -11362,7 +11565,7 @@ var ts; return parsePropertyNameWorker(true); } function parseComputedPropertyName() { - var node = createNode(145); + var node = createNode(146); parseExpected(21); node.expression = allowInAnd(parseExpression); parseExpected(22); @@ -11455,9 +11658,12 @@ var ts; return token() === 26 || token() === 24 || isIdentifierOrPattern(); case 18: return isIdentifier(); - case 11: case 15: - return token() === 26 || token() === 24 || isStartOfExpression(); + if (token() === 26) { + return true; + } + case 11: + return token() === 24 || isStartOfExpression(); case 16: return isStartOfParameter(); case 19: @@ -11505,6 +11711,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } function isListTerminator(kind) { if (token() === 1) { return true; @@ -11617,6 +11827,9 @@ var ts; if (!canReuseNode(node, parsingContext)) { return undefined; } + if (node.jsDocCache) { + node.jsDocCache = undefined; + } return node; } function consumeNode(node) { @@ -11659,14 +11872,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153: - case 158: case 154: + case 159: case 155: - case 150: - case 207: + case 156: + case 151: + case 210: return true; - case 152: + case 153: var methodDeclaration = node; var nameIsConstructor = methodDeclaration.name.kind === 71 && methodDeclaration.name.originalKeywordKind === 123; @@ -11678,8 +11891,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261: - case 262: + case 264: + case 265: return true; } } @@ -11688,65 +11901,65 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229: - case 209: - case 208: + case 232: case 212: case 211: - case 224: - case 220: - case 222: - case 219: - case 218: - case 216: - case 217: case 215: case 214: - case 221: - case 210: - case 225: + case 227: case 223: + case 225: + case 222: + case 221: + case 219: + case 220: + case 218: + case 217: + case 224: case 213: + case 228: case 226: - case 239: - case 238: - case 245: - case 244: - case 234: - case 230: - case 231: + case 216: + case 229: + case 242: + case 241: + case 248: + case 247: + case 237: case 233: - case 232: + case 234: + case 236: + case 235: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268; + return node.kind === 271; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157: - case 151: case 158: - case 149: - case 156: + case 152: + case 159: + case 150: + case 157: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227) { + if (node.kind !== 230) { return false; } var variableDeclarator = node; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147) { + if (node.kind !== 148) { return false; } var parameter = node; @@ -11853,7 +12066,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144, entity.pos); + var node = createNode(145, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -11868,7 +12081,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197); + var template = createNode(200); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14, "Template head has wrong token kind"); var list = []; @@ -11880,7 +12093,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206); + var span = createNode(209); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18) { @@ -11888,7 +12101,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16, false, ts.Diagnostics._0_expected, ts.tokenToString(18)); + literal = parseExpectedToken(16, ts.Diagnostics._0_expected, ts.tokenToString(18)); } span.literal = literal; return finishNode(span); @@ -11917,14 +12130,14 @@ var ts; node.isUnterminated = true; } if (node.kind === 8) { - node.numericLiteralFlags = scanner.getTokenFlags() & 496; + node.numericLiteralFlags = scanner.getTokenFlags() & 1008; } nextToken(); finishNode(node); return node; } function parseTypeReference() { - var node = createNode(160); + var node = createNode(161); node.typeName = parseEntityName(true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27) { node.typeArguments = parseBracketedList(19, parseType, 27, 29); @@ -11933,18 +12146,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159, lhs.pos); + var node = createNode(160, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170); + var node = createNode(173); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272); + var result = createNode(275); nextToken(); return finishNode(result); } @@ -11957,28 +12170,28 @@ var ts; token() === 29 || token() === 58 || token() === 49) { - var result = createNode(273, pos); + var result = createNode(276, pos); return finishNode(result); } else { - var result = createNode(274, pos); + var result = createNode(277, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277); + var result = createNodeWithJSDoc(280); nextToken(); fillSignature(56, 4 | 32, result); return finishNode(result); } - var node = createNode(160); + var node = createNode(161); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147); + var parameter = createNode(148); if (token() === 99 || token() === 94) { parameter.name = parseIdentifierName(); parseExpected(56); @@ -11993,13 +12206,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163); + var node = createNode(164); parseExpected(103); node.exprName = parseEntityName(true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146); + var node = createNode(147); node.name = parseIdentifier(); if (parseOptional(85)) { if (isStartOfType() || !isStartOfExpression()) { @@ -12033,7 +12246,7 @@ var ts; isStartOfType(true); } function parseParameter() { - var node = createNodeWithJSDoc(147); + var node = createNodeWithJSDoc(148); if (token() === 99) { node.name = createIdentifier(true); node.type = parseParameterType(); @@ -12100,7 +12313,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157) { + if (kind === 158) { parseExpected(94); } fillSignature(56, 4, node); @@ -12137,7 +12350,7 @@ var ts; return token() === 56 || token() === 26 || token() === 22; } function parseIndexSignatureDeclaration(node) { - node.kind = 158; + node.kind = 159; node.parameters = parseBracketedList(16, parseParameter, 21, 22); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -12147,11 +12360,11 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55); if (token() === 19 || token() === 27) { - node.kind = 151; + node.kind = 152; fillSignature(56, 4, node); } else { - node.kind = 149; + node.kind = 150; node.type = parseTypeAnnotation(); if (token() === 58) { node.initializer = parseInitializer(); @@ -12188,10 +12401,10 @@ var ts; } function parseTypeMember() { if (token() === 19 || token() === 27) { - return parseSignatureMember(156); + return parseSignatureMember(157); } if (token() === 94 && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157); + return parseSignatureMember(158); } var node = createNodeWithJSDoc(0); node.modifiers = parseModifiers(); @@ -12205,7 +12418,7 @@ var ts; return token() === 19 || token() === 27; } function parseTypeLiteral() { - var node = createNode(164); + var node = createNode(165); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -12222,38 +12435,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131) { + if (token() === 37 || token() === 38) { + return nextToken() === 132; + } + if (token() === 132) { nextToken(); } return token() === 21 && nextTokenIsIdentifier() && nextToken() === 92; } function parseMappedTypeParameter() { - var node = createNode(146); + var node = createNode(147); node.name = parseIdentifier(); parseExpected(92); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173); + var node = createNode(176); parseExpected(17); - node.readonlyToken = parseOptionalToken(131); + if (token() === 132 || token() === 37 || token() === 38) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132) { + parseExpectedToken(132); + } + } parseExpected(21); node.typeParameter = parseMappedTypeParameter(); parseExpected(22); - node.questionToken = parseOptionalToken(55); + if (token() === 55 || token() === 37 || token() === 38) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55) { + parseExpectedToken(55); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18); return finishNode(node); } function parseTupleType() { - var node = createNode(166); + var node = createNode(167); node.elementTypes = parseBracketedList(20, parseType, 21, 22); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169); + var node = createNode(172); parseExpected(19); node.type = parseType(); parseExpected(20); @@ -12261,7 +12487,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162) { + if (kind === 163) { parseExpected(94); } fillSignature(36, 4, node); @@ -12272,10 +12498,10 @@ var ts; return token() === 23 ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174); + var node = createNode(177); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193); + unaryMinusExpression = createNode(196); unaryMinusExpression.operator = 38; nextToken(); } @@ -12296,13 +12522,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119: - case 136: - case 133: case 137: - case 122: - case 139: - case 130: case 134: + case 138: + case 122: + case 140: + case 131: + case 135: return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39: return parseJSDocAllType(); @@ -12311,7 +12537,7 @@ var ts; case 89: return parseJSDocFunctionType(); case 51: - return parseJSDocNodeWithType(275); + return parseJSDocNodeWithType(278); case 13: case 9: case 8: @@ -12325,7 +12551,7 @@ var ts; return parseTokenNode(); case 99: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -12347,17 +12573,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119: - case 136: - case 133: - case 122: case 137: - case 140: + case 134: + case 122: + case 138: + case 141: case 105: - case 139: + case 140: case 95: case 99: case 103: - case 130: + case 131: case 17: case 21: case 27: @@ -12368,11 +12594,12 @@ var ts; case 8: case 101: case 86: - case 134: + case 135: case 39: case 55: case 51: case 24: + case 126: return true; case 38: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -12394,25 +12621,28 @@ var ts; if (!(contextFlags & 1048576)) { return type; } - type = createJSDocPostfixType(276, type); + type = createJSDocPostfixType(279, type); break; case 51: - type = createJSDocPostfixType(275, type); + type = createJSDocPostfixType(278, type); break; case 55: - type = createJSDocPostfixType(274, type); + if (!(contextFlags & 1048576) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277, type); break; case 21: parseExpected(21); if (isStartOfType()) { - var node = createNode(172, type.pos); + var node = createNode(175, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22); type = finishNode(node); } else { - var node = createNode(165, type.pos); + var node = createNode(166, type.pos); node.elementType = type; parseExpected(22); type = finishNode(node); @@ -12431,20 +12661,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171); + var node = createNode(174); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171); + parseExpected(126); + var typeParameter = createNode(147); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127: - case 140: + case 128: + case 141: return parseTypeOperator(operator); + case 126: + return parseInferType(); case 24: { - var result = createNode(278); + var result = createNode(281); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -12467,10 +12707,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168, parseTypeOperatorOrHigher, 48); + return parseUnionOrIntersectionType(169, parseTypeOperatorOrHigher, 48); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167, parseIntersectionTypeOrHigher, 49); + return parseUnionOrIntersectionType(168, parseIntersectionTypeOrHigher, 49); } function isStartOfFunctionType() { if (token() === 27) { @@ -12516,7 +12756,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159, typePredicateVariable.pos); + var node = createNode(160, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -12527,7 +12767,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -12535,14 +12775,25 @@ var ts; function parseType() { return doOutsideOfContext(20480, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161); - } - if (token() === 94) { return parseFunctionOrConstructorType(162); } - return parseUnionTypeOrHigher(); + if (token() === 94) { + return parseFunctionOrConstructorType(163); + } + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85)) { + var node = createNode(170, type.pos); + node.checkType = type; + node.extendsType = parseTypeWorker(true); + parseExpected(55); + node.trueType = parseTypeWorker(); + parseExpected(56); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56) ? parseType() : undefined; @@ -12655,7 +12906,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198); + var node = createNode(201); nextToken(); if (!scanner.hasPrecedingLineBreak() && (token() === 39 || isStartOfExpression())) { @@ -12671,17 +12922,17 @@ var ts; ts.Debug.assert(token() === 36, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188, asyncModifier.pos); + node = createNode(191, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188, identifier.pos); + node = createNode(191, identifier.pos); } - var parameter = createNode(147, identifier.pos); + var parameter = createNode(148, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36); node.body = parseArrowFunctionExpressionBody(!!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -12698,7 +12949,7 @@ var ts; } var isAsync = ts.hasModifier(arrowFunction, 256); var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36, false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36); arrowFunction.body = (lastToken === 36 || lastToken === 17) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -12823,7 +13074,7 @@ var ts; return 0; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188); + var node = createNodeWithJSDoc(191); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256) ? 2 : 0; fillSignature(56, isAsync | (allowAmbiguity ? 0 : 8), node); @@ -12855,12 +13106,14 @@ var ts; if (!questionToken) { return leftOperand; } - var node = createNode(196, leftOperand.pos); + var node = createNode(199, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56, false, ts.Diagnostics._0_expected, ts.tokenToString(56)); - node.whenFalse = parseAssignmentExpressionOrHigher(); + node.colonToken = parseExpectedToken(56); + node.whenFalse = ts.nodeIsPresent(node.colonToken) + ? parseAssignmentExpressionOrHigher() + : createMissingNode(71, false, ts.Diagnostics._0_expected, ts.tokenToString(56)); return finishNode(node); } function parseBinaryExpressionOrHigher(precedence) { @@ -12868,7 +13121,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 || t === 143; + return t === 92 || t === 144; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -12946,39 +13199,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195, left.pos); + var node = createNode(198, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203, left.pos); + var node = createNode(206, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193); + var node = createNode(196); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189); + var node = createNode(192); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190); + var node = createNode(193); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191); + var node = createNode(194); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -12993,7 +13246,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192); + var node = createNode(195); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -13009,7 +13262,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185) { + if (simpleUnaryExpression.kind === 188) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -13062,7 +13315,7 @@ var ts; } function parseUpdateExpression() { if (token() === 43 || token() === 44) { - var node = createNode(193); + var node = createNode(196); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -13074,7 +13327,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 || token() === 44) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194, expression.pos); + var node = createNode(197, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -13102,9 +13355,9 @@ var ts; if (token() === 19 || token() === 23 || token() === 21) { return expression; } - var node = createNode(180, expression.pos); + var node = createNode(183, expression.pos); node.expression = expression; - parseExpectedToken(23, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(true); return finishNode(node); } @@ -13124,8 +13377,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252) { - var node = createNode(250, opening.pos); + if (opening.kind === 255) { + var node = createNode(253, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -13134,22 +13387,22 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255) { - var node = createNode(254, opening.pos); + else if (opening.kind === 258) { + var node = createNode(257, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251); + ts.Debug.assert(opening.kind === 254); result = opening; } if (inExpressionContext && token() === 27) { var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195, result.pos); + var badNode = createNode(198, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -13210,7 +13463,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258); + var jsxAttributes = createNode(261); jsxAttributes.properties = parseList(13, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -13219,14 +13472,14 @@ var ts; parseExpected(27); if (token() === 29) { parseExpected(29); - var node_1 = createNode(255, fullStart); + var node_1 = createNode(258, fullStart); return finishNode(node_1); } var tagName = parseJsxElementName(); var attributes = parseJsxAttributes(); var node; if (token() === 29) { - node = createNode(252, fullStart); + node = createNode(255, fullStart); scanJsxText(); } else { @@ -13238,7 +13491,7 @@ var ts; parseExpected(29, undefined, false); scanJsxText(); } - node = createNode(251, fullStart); + node = createNode(254, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -13249,7 +13502,7 @@ var ts; var expression = token() === 99 ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23)) { - var propertyAccess = createNode(180, expression.pos); + var propertyAccess = createNode(183, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -13257,7 +13510,7 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260); + var node = createNode(263); parseExpected(17); if (token() !== 18) { node.dotDotDotToken = parseOptionalToken(24); @@ -13277,7 +13530,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257); + var node = createNode(260); node.name = parseIdentifierName(); if (token() === 58) { switch (scanJsxAttributeValue()) { @@ -13292,7 +13545,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259); + var node = createNode(262); parseExpected(17); parseExpected(24); node.expression = parseExpression(); @@ -13300,7 +13553,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253); + var node = createNode(256); parseExpected(28); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -13313,7 +13566,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256); + var node = createNode(259); parseExpected(28); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -13329,7 +13582,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185); + var node = createNode(188); parseExpected(27); node.type = parseType(); parseExpected(29); @@ -13340,7 +13593,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23); if (dotToken) { - var propertyAccess = createNode(180, expression.pos); + var propertyAccess = createNode(183, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(true); expression = finishNode(propertyAccess); @@ -13348,13 +13601,13 @@ var ts; } if (token() === 51 && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204, expression.pos); + var nonNullExpression = createNode(207, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } if (!inDecoratorContext() && parseOptional(21)) { - var indexedAccess = createNode(181, expression.pos); + var indexedAccess = createNode(184, expression.pos); indexedAccess.expression = expression; if (token() !== 22) { indexedAccess.argumentExpression = allowInAnd(parseExpression); @@ -13368,7 +13621,7 @@ var ts; continue; } if (token() === 13 || token() === 14) { - var tagExpression = createNode(184, expression.pos); + var tagExpression = createNode(187, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 ? parseLiteralNode() @@ -13387,7 +13640,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182, expression.pos); + var callExpr = createNode(185, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -13395,7 +13648,7 @@ var ts; continue; } else if (token() === 19) { - var callExpr = createNode(182, expression.pos); + var callExpr = createNode(185, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -13490,28 +13743,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186); + var node = createNodeWithJSDoc(189); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199); + var node = createNode(202); parseExpected(24); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 ? parseSpreadElement() : - token() === 26 ? createNode(201) : + token() === 26 ? createNode(204) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178); + var node = createNode(181); parseExpected(21); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -13523,18 +13776,18 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0); if (parseOptionalToken(24)) { - node.kind = 267; + node.kind = 270; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125)) { - return parseAccessorDeclaration(node, 154); - } - if (parseContextualModifier(135)) { return parseAccessorDeclaration(node, 155); } + if (parseContextualModifier(136)) { + return parseAccessorDeclaration(node, 156); + } var asteriskToken = parseOptionalToken(39); var tokenIsIdentifier = isIdentifier(); node.name = parsePropertyName(); @@ -13544,7 +13797,7 @@ var ts; } var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 || token() === 18 || token() === 58); if (isShorthandPropertyAssignment) { - node.kind = 266; + node.kind = 269; var equalsToken = parseOptionalToken(58); if (equalsToken) { node.equalsToken = equalsToken; @@ -13552,14 +13805,14 @@ var ts; } } else { - node.kind = 265; + node.kind = 268; parseExpected(56); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179); + var node = createNode(182); parseExpected(17); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -13573,7 +13826,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(false); } - var node = createNodeWithJSDoc(187); + var node = createNodeWithJSDoc(190); node.modifiers = parseModifiers(); parseExpected(89); node.asteriskToken = parseOptionalToken(39); @@ -13598,12 +13851,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94); if (parseOptional(23)) { - var node_2 = createNode(205, fullStart); + var node_2 = createNode(208, fullStart); node_2.keywordToken = 94; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183, fullStart); + var node = createNode(186, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19) { @@ -13612,7 +13865,7 @@ var ts; return finishNode(node); } function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208); + var node = createNode(211); if (parseExpected(17, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -13643,12 +13896,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210); + var node = createNode(213); parseExpected(25); return finishNode(node); } function parseIfStatement() { - var node = createNode(212); + var node = createNode(215); parseExpected(90); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -13658,7 +13911,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213); + var node = createNode(216); parseExpected(81); node.statement = parseStatement(); parseExpected(106); @@ -13669,7 +13922,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214); + var node = createNode(217); parseExpected(106); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -13692,8 +13945,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143) : parseOptional(143)) { - var forOfStatement = createNode(217, pos); + if (awaitToken ? parseExpected(144) : parseOptional(144)) { + var forOfStatement = createNode(220, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -13701,14 +13954,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92)) { - var forInStatement = createNode(216, pos); + var forInStatement = createNode(219, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215, pos); + var forStatement = createNode(218, pos); forStatement.initializer = initializer; parseExpected(25); if (token() !== 25 && token() !== 20) { @@ -13726,7 +13979,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 ? 72 : 77); + parseExpected(kind === 222 ? 72 : 77); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -13734,7 +13987,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220); + var node = createNode(223); parseExpected(96); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -13743,7 +13996,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221); + var node = createNode(224); parseExpected(107); parseExpected(19); node.expression = allowInAnd(parseExpression); @@ -13752,7 +14005,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261); + var node = createNode(264); parseExpected(73); node.expression = allowInAnd(parseExpression); parseExpected(56); @@ -13760,7 +14013,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262); + var node = createNode(265); parseExpected(79); parseExpected(56); node.statements = parseList(3, parseStatement); @@ -13770,12 +14023,12 @@ var ts; return token() === 73 ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222); + var node = createNode(225); parseExpected(98); parseExpected(19); node.expression = allowInAnd(parseExpression); parseExpected(20); - var caseBlock = createNode(236); + var caseBlock = createNode(239); parseExpected(17); caseBlock.clauses = parseList(2, parseCaseOrDefaultClause); parseExpected(18); @@ -13783,14 +14036,14 @@ var ts; return finishNode(node); } function parseThrowStatement() { - var node = createNode(224); + var node = createNode(227); parseExpected(100); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); return finishNode(node); } function parseTryStatement() { - var node = createNode(225); + var node = createNode(228); parseExpected(102); node.tryBlock = parseBlock(false); node.catchClause = token() === 74 ? parseCatchClause() : undefined; @@ -13801,7 +14054,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264); + var result = createNode(267); parseExpected(74); if (parseOptional(19)) { result.variableDeclaration = parseVariableDeclaration(); @@ -13814,7 +14067,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226); + var node = createNode(229); parseExpected(78); parseSemicolon(); return finishNode(node); @@ -13823,12 +14076,12 @@ var ts; var node = createNodeWithJSDoc(0); var expression = allowInAnd(parseExpression); if (expression.kind === 71 && parseOptional(56)) { - node.kind = 223; + node.kind = 226; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211; + node.kind = 214; node.expression = expression; parseSemicolon(); } @@ -13861,10 +14114,10 @@ var ts; case 83: return true; case 109: - case 138: + case 139: return nextTokenIsIdentifierOnSameLine(); - case 128: case 129: + case 130: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117: case 120: @@ -13872,13 +14125,13 @@ var ts; case 112: case 113: case 114: - case 131: + case 132: nextToken(); if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142: + case 143: nextToken(); return token() === 17 || token() === 71 || token() === 84; case 91: @@ -13937,16 +14190,16 @@ var ts; case 120: case 124: case 109: - case 128: case 129: - case 138: - case 142: + case 130: + case 139: + case 143: return true; case 114: case 112: case 113: case 115: - case 131: + case 132: return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); default: return isStartOfExpression(); @@ -13966,16 +14219,16 @@ var ts; case 17: return parseBlock(false); case 104: - return parseVariableStatement(createNodeWithJSDoc(227)); + return parseVariableStatement(createNodeWithJSDoc(230)); case 110: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227)); + return parseVariableStatement(createNodeWithJSDoc(230)); } break; case 89: - return parseFunctionDeclaration(createNodeWithJSDoc(229)); + return parseFunctionDeclaration(createNodeWithJSDoc(232)); case 75: - return parseClassDeclaration(createNodeWithJSDoc(230)); + return parseClassDeclaration(createNodeWithJSDoc(233)); case 90: return parseIfStatement(); case 81: @@ -13985,9 +14238,9 @@ var ts; case 88: return parseForOrForInOrForOfStatement(); case 77: - return parseBreakOrContinueStatement(218); + return parseBreakOrContinueStatement(221); case 72: - return parseBreakOrContinueStatement(219); + return parseBreakOrContinueStatement(222); case 96: return parseReturnStatement(); case 107: @@ -14006,9 +14259,9 @@ var ts; return parseDeclaration(); case 120: case 109: - case 138: - case 128: + case 139: case 129: + case 130: case 124: case 76: case 83: @@ -14019,8 +14272,8 @@ var ts; case 114: case 117: case 115: - case 131: - case 142: + case 132: + case 143: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -14058,13 +14311,13 @@ var ts; return parseClassDeclaration(node); case 109: return parseInterfaceDeclaration(node); - case 138: + case 139: return parseTypeAliasDeclaration(node); case 83: return parseEnumDeclaration(node); - case 142: - case 128: + case 143: case 129: + case 130: return parseModuleDeclaration(node); case 91: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -14081,7 +14334,7 @@ var ts; } default: if (node.decorators || node.modifiers) { - var missing = createMissingNode(248, true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251, true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -14102,16 +14355,16 @@ var ts; } function parseArrayBindingElement() { if (token() === 26) { - return createNode(201); + return createNode(204); } - var node = createNode(177); + var node = createNode(180); node.dotDotDotToken = parseOptionalToken(24); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177); + var node = createNode(180); node.dotDotDotToken = parseOptionalToken(24); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -14127,14 +14380,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175); + var node = createNode(178); parseExpected(17); node.elements = parseDelimitedList(9, parseObjectBindingElement); parseExpected(18); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176); + var node = createNode(179); parseExpected(21); node.elements = parseDelimitedList(10, parseArrayBindingElement); parseExpected(22); @@ -14156,7 +14409,7 @@ var ts; return parseVariableDeclaration(true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227); + var node = createNode(230); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 && token() === 51 && !scanner.hasPrecedingLineBreak()) { @@ -14169,7 +14422,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228); + var node = createNode(231); switch (token()) { case 104: break; @@ -14183,7 +14436,7 @@ var ts; ts.Debug.fail(); } nextToken(); - if (token() === 143 && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -14198,13 +14451,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20; } function parseVariableStatement(node) { - node.kind = 209; + node.kind = 212; node.declarationList = parseVariableDeclarationList(false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229; + node.kind = 232; parseExpected(89); node.asteriskToken = parseOptionalToken(39); node.name = ts.hasModifier(node, 512) ? parseOptionalIdentifier() : parseIdentifier(); @@ -14215,14 +14468,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153; + node.kind = 154; parseExpected(123); fillSignature(56, 0, node); node.body = parseFunctionBlockOrSemicolon(0, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152; + node.kind = 153; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 : 0; var isAsync = ts.hasModifier(node, 256) ? 2 : 0; @@ -14231,7 +14484,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150; + node.kind = 151; if (!node.questionToken && token() === 51 && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -14264,7 +14517,7 @@ var ts; case 112: case 113: case 115: - case 131: + case 132: return true; default: return false; @@ -14293,12 +14546,13 @@ var ts; return true; } if (idToken !== undefined) { - if (!ts.isKeyword(idToken) || idToken === 135 || idToken === 125) { + if (!ts.isKeyword(idToken) || idToken === 136 || idToken === 125) { return true; } switch (token()) { case 19: case 27: + case 51: case 56: case 58: case 55: @@ -14317,7 +14571,7 @@ var ts; if (!parseOptional(57)) { break; } - var decorator = createNode(148, decoratorStart); + var decorator = createNode(149, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -14358,7 +14612,7 @@ var ts; } function parseClassElement() { if (token() === 25) { - var result = createNode(207); + var result = createNode(210); nextToken(); return finishNode(result); } @@ -14366,11 +14620,11 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(true); if (parseContextualModifier(125)) { - return parseAccessorDeclaration(node, 154); - } - if (parseContextualModifier(135)) { return parseAccessorDeclaration(node, 155); } + if (parseContextualModifier(136)) { + return parseAccessorDeclaration(node, 156); + } if (token() === 123) { return parseConstructorDeclaration(node); } @@ -14391,10 +14645,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 200); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0), 203); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230); + return parseClassDeclarationOrExpression(node, 233); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -14428,7 +14682,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 || tok === 108) { - var node = createNode(263); + var node = createNode(266); node.token = tok; nextToken(); node.types = parseDelimitedList(7, parseExpressionWithTypeArguments); @@ -14437,7 +14691,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202); + var node = createNode(205); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -14454,7 +14708,7 @@ var ts; return parseList(5, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231; + node.kind = 234; parseExpected(109); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -14463,8 +14717,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232; - parseExpected(138); + node.kind = 235; + parseExpected(139); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58); @@ -14473,13 +14727,13 @@ var ts; return finishNode(node); } function parseEnumMember() { - var node = createNodeWithJSDoc(268); + var node = createNodeWithJSDoc(271); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233; + node.kind = 236; parseExpected(83); node.name = parseIdentifier(); if (parseExpected(17)) { @@ -14492,7 +14746,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235); + var node = createNode(238); if (parseExpected(17)) { node.statements = parseList(1, parseStatement); parseExpected(18); @@ -14503,7 +14757,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234; + node.kind = 237; var namespaceFlag = flags & 16; node.flags |= flags; node.name = parseIdentifier(); @@ -14513,8 +14767,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234; - if (token() === 142) { + node.kind = 237; + if (token() === 143) { node.name = parseIdentifier(); node.flags |= 512; } @@ -14532,14 +14786,14 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142) { + if (token() === 143) { return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129)) { + else if (parseOptional(130)) { flags |= 16; } else { - parseExpected(128); + parseExpected(129); if (token() === 9) { return parseAmbientExternalModuleDeclaration(node); } @@ -14547,7 +14801,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 && + return token() === 133 && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -14557,9 +14811,9 @@ var ts; return nextToken() === 41; } function parseNamespaceExportDeclaration(node) { - node.kind = 237; + node.kind = 240; parseExpected(118); - parseExpected(129); + parseExpected(130); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -14570,23 +14824,23 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 && token() !== 141) { + if (token() !== 26 && token() !== 142) { return parseImportEqualsDeclaration(node, identifier); } } - node.kind = 239; + node.kind = 242; if (identifier || token() === 39 || token() === 17) { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141); + parseExpected(142); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238; + node.kind = 241; node.name = identifier; parseExpected(58); node.moduleReference = parseModuleReference(); @@ -14594,13 +14848,13 @@ var ts; return finishNode(node); } function parseImportClause(identifier, fullStart) { - var importClause = createNode(240, fullStart); + var importClause = createNode(243, fullStart); if (identifier) { importClause.name = identifier; } if (!importClause.name || parseOptional(26)) { - importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(242); + importClause.namedBindings = token() === 39 ? parseNamespaceImport() : parseNamedImportsOrExports(245); } return finishNode(importClause); } @@ -14610,8 +14864,8 @@ var ts; : parseEntityName(false); } function parseExternalModuleReference() { - var node = createNode(249); - parseExpected(132); + var node = createNode(252); + parseExpected(133); parseExpected(19); node.expression = parseModuleSpecifier(); parseExpected(20); @@ -14628,7 +14882,7 @@ var ts; } } function parseNamespaceImport() { - var namespaceImport = createNode(241); + var namespaceImport = createNode(244); parseExpected(39); parseExpected(118); namespaceImport.name = parseIdentifier(); @@ -14636,14 +14890,14 @@ var ts; } function parseNamedImportsOrExports(kind) { var node = createNode(kind); - node.elements = parseBracketedList(22, kind === 242 ? parseImportSpecifier : parseExportSpecifier, 17, 18); + node.elements = parseBracketedList(22, kind === 245 ? parseImportSpecifier : parseExportSpecifier, 17, 18); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247); + return parseImportOrExportSpecifier(250); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243); + return parseImportOrExportSpecifier(246); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -14662,21 +14916,21 @@ var ts; else { node.name = identifierName; } - if (kind === 243 && checkIdentifierIsKeyword) { + if (kind === 246 && checkIdentifierIsKeyword) { parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245; + node.kind = 248; if (parseOptional(39)) { - parseExpected(141); + parseExpected(142); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246); - if (token() === 141 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { - parseExpected(141); + node.exportClause = parseNamedImportsOrExports(249); + if (token() === 142 || (token() === 9 && !scanner.hasPrecedingLineBreak())) { + parseExpected(142); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -14684,7 +14938,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244; + node.kind = 247; if (parseOptional(58)) { node.isExportEquals = true; } @@ -14776,10 +15030,10 @@ var ts; function setExternalModuleIndicator(sourceFile) { sourceFile.externalModuleIndicator = ts.forEach(sourceFile.statements, function (node) { return ts.hasModifier(node, 1) - || node.kind === 238 && node.moduleReference.kind === 249 - || node.kind === 239 - || node.kind === 244 - || node.kind === 245 + || node.kind === 241 && node.moduleReference.kind === 252 + || node.kind === 242 + || node.kind === 247 + || node.kind === 248 ? node : undefined; }); @@ -14798,7 +15052,7 @@ var ts; } JSDocParser.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; function parseJSDocTypeExpression(mayOmitBraces) { - var result = createNode(271, scanner.getTokenPos()); + var result = createNode(274, scanner.getTokenPos()); var hasBrace = (mayOmitBraces ? parseOptional : parseExpected)(17); result.type = doInsideOfContext(1048576, parseType); if (!mayOmitBraces || hasBrace) { @@ -14855,7 +15109,6 @@ var ts; return result; } scanner.scanRange(start + 3, length - 5, function () { - var advanceToken = true; var state = 1; var margin = undefined; var indent = start - Math.max(content.lastIndexOf("\n", start), 0) + 4; @@ -14866,23 +15119,22 @@ var ts; comments.push(text); indent += text.length; } - nextJSDocToken(); - while (token() === 5) { - nextJSDocToken(); + var t = nextJSDocToken(); + while (t === 5) { + t = nextJSDocToken(); } - if (token() === 4) { + if (t === 4) { state = 0; indent = 0; - nextJSDocToken(); + t = nextJSDocToken(); } - while (token() !== 1) { - switch (token()) { + loop: while (true) { + switch (t) { case 57: if (state === 0 || state === 1) { removeTrailingNewlines(comments); parseTag(indent); state = 0; - advanceToken = false; margin = undefined; indent++; } @@ -14921,18 +15173,13 @@ var ts; indent += whitespace.length; break; case 1: - break; + break loop; default: state = 2; pushComment(scanner.getTokenText()); break; } - if (advanceToken) { - nextJSDocToken(); - } - else { - advanceToken = true; - } + t = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); @@ -14956,7 +15203,7 @@ var ts; content.charCodeAt(start + 3) !== 42; } function createJSDocComment() { - var result = createNode(279, start); + var result = createNode(282, start); result.tags = tags && createNodeArray(tags, tagsPos, tagsEnd); result.comment = comments.length ? comments.join("") : undefined; return finishNode(result, end); @@ -15016,7 +15263,8 @@ var ts; if (!tag) { return; } - addTag(tag, parseTagComments(indent + tag.end - tag.pos)); + tag.comment = parseTagComments(indent + tag.end - tag.pos); + addTag(tag); } function parseTagComments(indent) { var comments = []; @@ -15029,8 +15277,9 @@ var ts; comments.push(text); indent += text.length; } - while (token() !== 57 && token() !== 1) { - switch (token()) { + var tok = token(); + loop: while (true) { + switch (tok) { case 4: if (state >= 1) { state = 0; @@ -15039,7 +15288,9 @@ var ts; indent = 0; break; case 57: - break; + scanner.setTextPos(scanner.getTextPos() - 1); + case 1: + break loop; case 5: if (state === 2) { pushComment(scanner.getTokenText()); @@ -15055,7 +15306,7 @@ var ts; case 39: if (state === 0) { state = 1; - indent += scanner.getTokenText().length; + indent += 1; break; } default: @@ -15063,23 +15314,19 @@ var ts; pushComment(scanner.getTokenText()); break; } - if (token() === 57) { - break; - } - nextJSDocToken(); + tok = nextJSDocToken(); } removeLeadingNewlines(comments); removeTrailingNewlines(comments); - return comments; + return comments.length === 0 ? undefined : comments.join(""); } function parseUnknownTag(atToken, tagName) { - var result = createNode(281, atToken.pos); + var result = createNode(284, atToken.pos); result.atToken = atToken; result.tagName = tagName; return finishNode(result); } - function addTag(tag, comments) { - tag.comment = comments.join(""); + function addTag(tag) { if (!tags) { tags = [tag]; tagsPos = tag.pos; @@ -15107,9 +15354,9 @@ var ts; } function isObjectOrObjectArrayTypeReference(node) { switch (node.kind) { - case 134: + case 135: return true; - case 165: + case 166: return isObjectOrObjectArrayTypeReference(node.elementType); default: return ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object"; @@ -15125,8 +15372,8 @@ var ts; typeExpression = tryParseTypeExpression(); } var result = target === 1 ? - createNode(284, atToken.pos) : - createNode(289, atToken.pos); + createNode(287, atToken.pos) : + createNode(292, atToken.pos); var nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name); if (nestedTypeLiteral) { typeExpression = nestedTypeLiteral; @@ -15142,21 +15389,18 @@ var ts; } function parseNestedTypeLiteral(typeExpression, name) { if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) { - var typeLiteralExpression = createNode(271, scanner.getTokenPos()); + var typeLiteralExpression = createNode(274, scanner.getTokenPos()); var child = void 0; var jsdocTypeLiteral = void 0; var start_2 = scanner.getStartPos(); var children = void 0; while (child = tryParse(function () { return parseChildParameterOrPropertyTag(1, name); })) { - if (!children) { - children = []; - } - children.push(child); + children = ts.append(children, child); } if (children) { - jsdocTypeLiteral = createNode(280, start_2); + jsdocTypeLiteral = createNode(283, start_2); jsdocTypeLiteral.jsDocPropertyTags = children; - if (typeExpression.type.kind === 165) { + if (typeExpression.type.kind === 166) { jsdocTypeLiteral.isArrayType = true; } typeLiteralExpression.type = finishNode(jsdocTypeLiteral); @@ -15165,27 +15409,27 @@ var ts; } } function parseReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 285; })) { + if (ts.forEach(tags, function (t) { return t.kind === 288; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(285, atToken.pos); + var result = createNode(288, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = tryParseTypeExpression(); return finishNode(result); } function parseTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 286; })) { + if (ts.forEach(tags, function (t) { return t.kind === 289; })) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } - var result = createNode(286, atToken.pos); + var result = createNode(289, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = parseJSDocTypeExpression(true); return finishNode(result); } function parseAugmentsTag(atToken, tagName) { - var result = createNode(282, atToken.pos); + var result = createNode(285, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.class = parseExpressionWithTypeArgumentsForAugments(); @@ -15193,7 +15437,7 @@ var ts; } function parseExpressionWithTypeArgumentsForAugments() { var usedBrace = parseOptional(17); - var node = createNode(202); + var node = createNode(205); node.expression = parsePropertyAccessEntityNameExpression(); node.typeArguments = tryParseTypeArguments(); var res = finishNode(node); @@ -15205,7 +15449,7 @@ var ts; function parsePropertyAccessEntityNameExpression() { var node = parseJSDocIdentifierName(true); while (parseOptional(23)) { - var prop = createNode(180, node.pos); + var prop = createNode(183, node.pos); prop.expression = node; prop.name = parseJSDocIdentifierName(); node = finishNode(prop); @@ -15213,7 +15457,7 @@ var ts; return node; } function parseClassTag(atToken, tagName) { - var tag = createNode(283, atToken.pos); + var tag = createNode(286, atToken.pos); tag.atToken = atToken; tag.tagName = tagName; return finishNode(tag); @@ -15221,7 +15465,7 @@ var ts; function parseTypedefTag(atToken, tagName) { var typeExpression = tryParseTypeExpression(); skipWhitespace(); - var typedefTag = createNode(288, atToken.pos); + var typedefTag = createNode(291, atToken.pos); typedefTag.atToken = atToken; typedefTag.tagName = tagName; typedefTag.fullName = parseJSDocTypeNameWithNamespace(0); @@ -15244,9 +15488,9 @@ var ts; var start_3 = scanner.getStartPos(); while (child = tryParse(function () { return parseChildParameterOrPropertyTag(0); })) { if (!jsdocTypeLiteral) { - jsdocTypeLiteral = createNode(280, start_3); + jsdocTypeLiteral = createNode(283, start_3); } - if (child.kind === 286) { + if (child.kind === 289) { if (childTypeTag) { break; } @@ -15255,14 +15499,11 @@ var ts; } } else { - if (!jsdocTypeLiteral.jsDocPropertyTags) { - jsdocTypeLiteral.jsDocPropertyTags = []; - } - jsdocTypeLiteral.jsDocPropertyTags.push(child); + jsdocTypeLiteral.jsDocPropertyTags = ts.append(jsdocTypeLiteral.jsDocPropertyTags, child); } } if (jsdocTypeLiteral) { - if (typeExpression && typeExpression.type.kind === 165) { + if (typeExpression && typeExpression.type.kind === 166) { jsdocTypeLiteral.isArrayType = true; } typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? @@ -15275,7 +15516,7 @@ var ts; var pos = scanner.getTokenPos(); var typeNameOrNamespaceName = parseJSDocIdentifierName(); if (typeNameOrNamespaceName && parseOptional(23)) { - var jsDocNamespaceNode = createNode(234, pos); + var jsDocNamespaceNode = createNode(237, pos); jsDocNamespaceNode.flags |= flags; jsDocNamespaceNode.name = typeNameOrNamespaceName; jsDocNamespaceNode.body = parseJSDocTypeNameWithNamespace(4); @@ -15303,12 +15544,11 @@ var ts; var canParseTag = true; var seenAsterisk = false; while (true) { - nextJSDocToken(); - switch (token()) { + switch (nextJSDocToken()) { case 57: if (canParseTag) { var child = tryParseChildTag(target); - if (child && child.kind === 284 && + if (child && child.kind === 287 && (ts.isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) { return false; } @@ -15344,33 +15584,43 @@ var ts; if (!tagName) { return false; } + var t; switch (tagName.escapedText) { case "type": return target === 0 && parseTypeTag(atToken, tagName); case "prop": case "property": - return target === 0 && parseParameterOrPropertyTag(atToken, tagName, target); + t = 0; + break; case "arg": case "argument": case "param": - return target === 1 && parseParameterOrPropertyTag(atToken, tagName, target); + t = 1; + break; + default: + return false; } - return false; + if (target !== t) { + return false; + } + var tag = parseParameterOrPropertyTag(atToken, tagName, target); + tag.comment = parseTagComments(tag.end - tag.pos); + return tag; } function parseTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 287; })) { + if (ts.some(tags, ts.isJSDocTemplateTag)) { parseErrorAtPosition(tagName.pos, scanner.getTokenPos() - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.escapedText); } var typeParameters = []; var typeParametersPos = getNodePos(); while (true) { - var name = parseJSDocIdentifierName(); + var typeParameter = createNode(147); + var name = parseJSDocIdentifierNameWithOptionalBraces(); skipWhitespace(); if (!name) { parseErrorAtPosition(scanner.getStartPos(), 0, ts.Diagnostics.Identifier_expected); return undefined; } - var typeParameter = createNode(146, name.pos); typeParameter.name = name; finishNode(typeParameter); typeParameters.push(typeParameter); @@ -15382,13 +15632,21 @@ var ts; break; } } - var result = createNode(287, atToken.pos); + var result = createNode(290, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeParameters = createNodeArray(typeParameters, typeParametersPos); finishNode(result); return result; } + function parseJSDocIdentifierNameWithOptionalBraces() { + var parsedBrace = parseOptional(17); + var res = parseJSDocIdentifierName(); + if (parsedBrace) { + parseExpected(18); + } + return res; + } function nextJSDocToken() { return currentToken = scanner.scanJSDocToken(); } @@ -15850,12 +16108,14 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", + "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, category: ts.Diagnostics.Basic_Options, - description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation_Colon + description: ts.Diagnostics.Specify_library_files_to_be_included_in_the_compilation }, { name: "allowJs", @@ -15890,6 +16150,12 @@ var ts; category: ts.Diagnostics.Basic_Options, description: ts.Diagnostics.Generates_corresponding_d_ts_file, }, + { + name: "emitDeclarationOnly", + type: "boolean", + category: ts.Diagnostics.Advanced_Options, + description: ts.Diagnostics.Only_emit_d_ts_declaration_files, + }, { name: "sourceMap", type: "boolean", @@ -16096,6 +16362,13 @@ var ts; category: ts.Diagnostics.Module_Resolution_Options, description: ts.Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, + { + name: "esModuleInterop", + type: "boolean", + showInSimplifiedHelpView: true, + category: ts.Diagnostics.Module_Resolution_Options, + description: ts.Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports + }, { name: "preserveSymlinks", type: "boolean", @@ -16376,17 +16649,17 @@ var ts; ts.defaultInitCompilerOptions = { module: ts.ModuleKind.CommonJS, target: 1, - strict: true + strict: true, + esModuleInterop: true }; var optionNameMapCache; function convertEnableAutoDiscoveryToEnable(typeAcquisition) { if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { - var result = { + return { enable: typeAcquisition.enableAutoDiscovery, include: typeAcquisition.include || [], exclude: typeAcquisition.exclude || [] }; - return result; } return typeAcquisition; } @@ -16652,7 +16925,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265) { + if (element.kind !== 268) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -16721,13 +16994,13 @@ var ts; case 8: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193: + case 196: if (valueExpression.operator !== 38 || valueExpression.operand.kind !== 8) { break; } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179: + case 182: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; if (option) { @@ -16737,7 +17010,7 @@ var ts; else { return convertObjectLiteralExpressionToJson(objectLiteralExpression, undefined, undefined, undefined); } - case 178: + case 181: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -16923,7 +17196,7 @@ var ts; return x === undefined || x === null; } function directoryOfCombinedPath(fileName, basePath) { - return ts.getDirectoryPath(ts.toPath(fileName, basePath, ts.identity)); + return ts.getDirectoryPath(ts.getNormalizedAbsolutePath(fileName, basePath)); } function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions) { if (existingOptions === void 0) { existingOptions = {}; } @@ -16931,8 +17204,7 @@ var ts; if (extraFileExtensions === void 0) { extraFileExtensions = []; } ts.Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); var errors = []; - var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames); - var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors); + var parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); var raw = parsedConfig.raw; var options = ts.extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName; @@ -17012,19 +17284,19 @@ var ts; function isSuccessfulParsedTsconfig(value) { return !!value.options; } - function parseConfig(json, sourceFile, host, basePath, configFileName, getCanonicalFileName, resolutionStack, errors) { + function parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors) { basePath = ts.normalizeSlashes(basePath); - var resolvedPath = ts.toPath(configFileName || "", basePath, getCanonicalFileName); + var resolvedPath = ts.getNormalizedAbsolutePath(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, resolutionStack.concat([resolvedPath]).join(" -> "))); return { raw: json || convertToObject(sourceFile, errors) }; } var ownConfig = json ? - parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) : - parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors); + parseOwnConfigOfJson(json, host, basePath, configFileName, errors) : + parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors); if (ownConfig.extendedConfigPath) { resolutionStack = resolutionStack.concat([resolvedPath]); - var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors); + var extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) { var baseRaw_1 = extendedConfig.raw; var raw_1 = ownConfig.raw; @@ -17045,7 +17317,7 @@ var ts; } return ownConfig; } - function parseOwnConfigOfJson(json, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) { if (ts.hasProperty(json, "excludes")) { errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude)); } @@ -17059,12 +17331,12 @@ var ts; } else { var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, getCanonicalFileName, errors, ts.createCompilerDiagnostic); + extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, ts.createCompilerDiagnostic); } } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, getCanonicalFileName, configFileName, errors) { + function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileName, errors) { var options = getDefaultCompilerOptions(configFileName); var typeAcquisition, typingOptionstypeAcquisition; var extendedConfigPath; @@ -17082,7 +17354,7 @@ var ts; switch (key) { case "extends": var newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath; - extendedConfigPath = getExtendsConfigPath(value, host, newBase, getCanonicalFileName, errors, function (message, arg0) { + extendedConfigPath = getExtendsConfigPath(value, host, newBase, errors, function (message, arg0) { return ts.createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0); }); return; @@ -17116,13 +17388,13 @@ var ts; } return { raw: json, options: options, typeAcquisition: typeAcquisition, extendedConfigPath: extendedConfigPath }; } - function getExtendsConfigPath(extendedConfig, host, basePath, getCanonicalFileName, errors, createDiagnostic) { + function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiagnostic) { extendedConfig = ts.normalizeSlashes(extendedConfig); if (!(ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../"))) { errors.push(createDiagnostic(ts.Diagnostics.A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not, extendedConfig)); return undefined; } - var extendedConfigPath = ts.toPath(extendedConfig, basePath, getCanonicalFileName); + var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath); if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json")) { extendedConfigPath = extendedConfigPath + ".json"; if (!host.fileExists(extendedConfigPath)) { @@ -17132,7 +17404,7 @@ var ts; } return extendedConfigPath; } - function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, getCanonicalFileName, resolutionStack, errors) { + function getExtendedConfig(sourceFile, extendedConfigPath, host, basePath, resolutionStack, errors) { var extendedResult = readJsonConfigFile(extendedConfigPath, function (path) { return host.readFile(path); }); if (sourceFile) { (sourceFile.extendedSourceFiles || (sourceFile.extendedSourceFiles = [])).push(extendedResult.fileName); @@ -17142,12 +17414,12 @@ var ts; return undefined; } var extendedDirname = ts.getDirectoryPath(extendedConfigPath); - var extendedConfig = parseConfig(undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), getCanonicalFileName, resolutionStack, errors); + var extendedConfig = parseConfig(undefined, extendedResult, host, extendedDirname, ts.getBaseFileName(extendedConfigPath), resolutionStack, errors); if (sourceFile) { (_a = sourceFile.extendedSourceFiles).push.apply(_a, extendedResult.extendedSourceFiles); } if (isSuccessfulParsedTsconfig(extendedConfig)) { - var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, getCanonicalFileName); + var relativeDifference_1 = ts.convertToRelativePath(extendedDirname, basePath, ts.identity); var updatePath_1 = function (path) { return ts.isRootedDiskPath(path) ? path : ts.combinePaths(relativeDifference_1, path); }; var mapPropertiesInRawIfNotUndefined = function (propertyName) { if (raw_2[propertyName]) { @@ -17186,7 +17458,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -17196,8 +17468,7 @@ var ts; return options; } function getDefaultTypeAcquisition(configFileName) { - var options = { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; - return options; + return { enable: ts.getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; } function convertTypeAcquisitionFromJsonWorker(jsonOptions, basePath, errors, configFileName) { var options = getDefaultTypeAcquisition(configFileName); @@ -17278,7 +17549,6 @@ var ts; return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, ""); } var invalidTrailingRecursionPattern = /(^|\/)\*\*\/?$/; - var invalidMultipleRecursionPatterns = /(^|\/)\*\*\/(.*\/)?\*\*($|\/)/; var invalidDotDotAfterRecursiveWildcardPattern = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; var watchRecursivePattern = /\/[^/]*?[*?][^/]*\//; var wildcardDirectoryPattern = /^[^*?]*(?=\/[^/]*[*?])/; @@ -17361,9 +17631,6 @@ var ts; if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } - else if (invalidMultipleRecursionPatterns.test(spec)) { - return ts.Diagnostics.File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0; - } else if (invalidDotDotAfterRecursiveWildcardPattern.test(spec)) { return ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } @@ -17481,245 +17748,6 @@ var ts; } })(ts || (ts = {})); var ts; -(function (ts) { - var JsTyping; - (function (JsTyping) { - JsTyping.nodeCoreModuleList = [ - "buffer", "querystring", "events", "http", "cluster", - "zlib", "os", "https", "punycode", "repl", "readline", - "vm", "child_process", "url", "dns", "net", - "dgram", "fs", "path", "string_decoder", "tls", - "crypto", "stream", "util", "assert", "tty", "domain", - "constants", "process", "v8", "timers", "console" - ]; - var nodeCoreModules = ts.arrayToSet(JsTyping.nodeCoreModuleList); - function loadSafeList(host, safeListPath) { - var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); - return ts.createMapFromTemplate(result.config); - } - JsTyping.loadSafeList = loadSafeList; - function loadTypesMap(host, typesMapPath) { - var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); }); - if (result.config) { - return ts.createMapFromTemplate(result.config.simpleMap); - } - return undefined; - } - JsTyping.loadTypesMap = loadTypesMap; - function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { - if (!typeAcquisition || !typeAcquisition.enable) { - return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; - } - var inferredTypings = ts.createMap(); - fileNames = ts.mapDefined(fileNames, function (fileName) { - var path = ts.normalizePath(fileName); - if (ts.hasJavaScriptFileExtension(path)) { - return path; - } - }); - var filesToWatch = []; - if (typeAcquisition.include) - addInferredTypings(typeAcquisition.include, "Explicitly included types"); - var exclude = typeAcquisition.exclude || []; - var possibleSearchDirs = ts.arrayToSet(fileNames, ts.getDirectoryPath); - possibleSearchDirs.set(projectRootPath, true); - possibleSearchDirs.forEach(function (_true, searchDir) { - var packageJsonPath = ts.combinePaths(searchDir, "package.json"); - getTypingNamesFromJson(packageJsonPath, filesToWatch); - var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); - getTypingNamesFromJson(bowerJsonPath, filesToWatch); - var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); - getTypingNamesFromPackagesFolder(bowerComponentsPath, filesToWatch); - var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); - getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch); - }); - getTypingNamesFromSourceFileNames(fileNames); - if (unresolvedImports) { - var module_1 = ts.deduplicate(unresolvedImports.map(function (moduleId) { return nodeCoreModules.has(moduleId) ? "node" : moduleId; }), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); - addInferredTypings(module_1, "Inferred typings from unresolved imports"); - } - packageNameToTypingLocation.forEach(function (typingLocation, name) { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); - } - }); - for (var _i = 0, exclude_1 = exclude; _i < exclude_1.length; _i++) { - var excludeTypingName = exclude_1[_i]; - var didDelete = inferredTypings.delete(excludeTypingName); - if (didDelete && log) - log("Typing for " + excludeTypingName + " is in exclude list, will be ignored."); - } - var newTypingNames = []; - var cachedTypingPaths = []; - inferredTypings.forEach(function (inferred, typing) { - if (inferred !== undefined) { - cachedTypingPaths.push(inferred); - } - else { - newTypingNames.push(typing); - } - }); - var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; - if (log) - log("Result: " + JSON.stringify(result)); - return result; - function addInferredTyping(typingName) { - if (!inferredTypings.has(typingName)) { - inferredTypings.set(typingName, undefined); - } - } - function addInferredTypings(typingNames, message) { - if (log) - log(message + ": " + JSON.stringify(typingNames)); - ts.forEach(typingNames, addInferredTyping); - } - function getTypingNamesFromJson(jsonPath, filesToWatch) { - if (!host.fileExists(jsonPath)) { - return; - } - filesToWatch.push(jsonPath); - var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config; - var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys); - addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies"); - } - function getTypingNamesFromSourceFileNames(fileNames) { - var fromFileNames = ts.mapDefined(fileNames, function (j) { - if (!ts.hasJavaScriptFileExtension(j)) - return undefined; - var inferredTypingName = ts.removeFileExtension(ts.getBaseFileName(j.toLowerCase())); - var cleanedTypingName = ts.removeMinAndVersionNumbers(inferredTypingName); - return safeList.get(cleanedTypingName); - }); - if (fromFileNames.length) { - addInferredTypings(fromFileNames, "Inferred typings from file names"); - } - var hasJsxFile = ts.some(fileNames, function (f) { return ts.fileExtensionIs(f, ".jsx"); }); - if (hasJsxFile) { - if (log) - log("Inferred 'react' typings due to presence of '.jsx' extension"); - addInferredTyping("react"); - } - } - function getTypingNamesFromPackagesFolder(packagesFolderPath, filesToWatch) { - filesToWatch.push(packagesFolderPath); - if (!host.directoryExists(packagesFolderPath)) { - return; - } - var fileNames = host.readDirectory(packagesFolderPath, [".json"], undefined, undefined, 2); - if (log) - log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames)); - var packageNames = []; - for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { - var fileName = fileNames_1[_i]; - var normalizedFileName = ts.normalizePath(fileName); - var baseFileName = ts.getBaseFileName(normalizedFileName); - if (baseFileName !== "package.json" && baseFileName !== "bower.json") { - continue; - } - var result_1 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); - var packageJson = result_1.config; - if (baseFileName === "package.json" && packageJson._requiredBy && - ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { - continue; - } - if (!packageJson.name) { - continue; - } - var ownTypes = packageJson.types || packageJson.typings; - if (ownTypes) { - var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName)); - if (log) - log(" Package '" + packageJson.name + "' provides its own types."); - inferredTypings.set(packageJson.name, absolutePath); - } - else { - packageNames.push(packageJson.name); - } - } - addInferredTypings(packageNames, " Found package names"); - } - } - JsTyping.discoverTypings = discoverTypings; - var maxPackageNameLength = 214; - function validatePackageName(packageName) { - if (!packageName) { - return 2; - } - if (packageName.length > maxPackageNameLength) { - return 3; - } - if (packageName.charCodeAt(0) === 46) { - return 4; - } - if (packageName.charCodeAt(0) === 95) { - return 5; - } - if (/^@[^/]+\/[^/]+$/.test(packageName)) { - return 1; - } - if (encodeURIComponent(packageName) !== packageName) { - return 6; - } - return 0; - } - JsTyping.validatePackageName = validatePackageName; - function renderPackageNameValidationFailure(result, typing) { - switch (result) { - case 2: - return "Package name '" + typing + "' cannot be empty"; - case 3: - return "Package name '" + typing + "' should be less than " + maxPackageNameLength + " characters"; - case 4: - return "Package name '" + typing + "' cannot start with '.'"; - case 5: - return "Package name '" + typing + "' cannot start with '_'"; - case 1: - return "Package '" + typing + "' is scoped and currently is not supported"; - case 6: - return "Package name '" + typing + "' contains non URI safe characters"; - case 0: - throw ts.Debug.fail(); - default: - ts.Debug.assertNever(result); - } - } - JsTyping.renderPackageNameValidationFailure = renderPackageNameValidationFailure; - })(JsTyping = ts.JsTyping || (ts.JsTyping = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var server; - (function (server) { - server.ActionSet = "action::set"; - server.ActionInvalidate = "action::invalidate"; - server.ActionPackageInstalled = "action::packageInstalled"; - server.EventTypesRegistry = "event::typesRegistry"; - server.EventBeginInstallTypes = "event::beginInstallTypes"; - server.EventEndInstallTypes = "event::endInstallTypes"; - server.EventInitializationFailed = "event::initializationFailed"; - var Arguments; - (function (Arguments) { - Arguments.GlobalCacheLocation = "--globalTypingsCacheLocation"; - Arguments.LogFile = "--logFile"; - Arguments.EnableTelemetry = "--enableTelemetry"; - Arguments.TypingSafeListLocation = "--typingSafeListLocation"; - Arguments.TypesMapLocation = "--typesMapLocation"; - Arguments.NpmLocation = "--npmLocation"; - })(Arguments = server.Arguments || (server.Arguments = {})); - function hasArgument(argumentName) { - return ts.sys.args.indexOf(argumentName) >= 0; - } - server.hasArgument = hasArgument; - function findArgument(argumentName) { - var index = ts.sys.args.indexOf(argumentName); - return index >= 0 && index < ts.sys.args.length - 1 - ? ts.sys.args[index + 1] - : undefined; - } - server.findArgument = findArgument; - })(server = ts.server || (ts.server = {})); -})(ts || (ts = {})); -var ts; (function (ts) { function trace(host) { host.trace(ts.formatMessage.apply(undefined, arguments)); @@ -17748,9 +17776,9 @@ var ts; ts.Debug.assert(ts.extensionIsTypeScript(resolved.extension)); return { fileName: resolved.path, packageId: resolved.packageId }; } - function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations) { + function createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations) { return { - resolvedModule: resolved && { resolvedFileName: resolved.path, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, + resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: originalPath, extension: resolved.extension, isExternalLibraryImport: isExternalLibraryImport, packageId: resolved.packageId }, failedLookupLocations: failedLookupLocations }; } @@ -18183,8 +18211,8 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var result = jsOnly ? tryResolve(Extensions.JavaScript) : (tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript)); if (result && result.value) { - var _a = result.value, resolved = _a.resolved, isExternalLibraryImport = _a.isExternalLibraryImport; - return createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations); + var _a = result.value, resolved = _a.resolved, originalPath = _a.originalPath, isExternalLibraryImport = _a.isExternalLibraryImport; + return createResolvedModuleWithFailedLookupLocations(resolved, originalPath, isExternalLibraryImport, failedLookupLocations); } return { resolvedModule: undefined, failedLookupLocations: failedLookupLocations }; function tryResolve(extensions) { @@ -18201,10 +18229,16 @@ var ts; if (!resolved_1) return undefined; var resolvedValue = resolved_1.value; - if (!compilerOptions.preserveSymlinks) { - resolvedValue = resolvedValue && __assign({}, resolved_1.value, { path: realPath(resolved_1.value.path, host, traceEnabled), extension: resolved_1.value.extension }); + var originalPath = void 0; + if (!compilerOptions.preserveSymlinks && resolvedValue) { + originalPath = resolvedValue.path; + var path = realPath(resolved_1.value.path, host, traceEnabled); + if (path === originalPath) { + originalPath = undefined; + } + resolvedValue = __assign({}, resolvedValue, { path: path }); } - return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } }; + return { value: resolvedValue && { resolved: resolvedValue, originalPath: originalPath, isExternalLibraryImport: true } }; } else { var _a = ts.normalizePathAndParts(ts.combinePaths(containingDirectory, moduleName)), candidate = _a.path, parts = _a.parts; @@ -18239,7 +18273,9 @@ var ts; } var resolvedFromFile = loadModuleFromFile(extensions, candidate, failedLookupLocations, onlyRecordFailures, state); if (resolvedFromFile) { - return noPackageId(resolvedFromFile); + var nm = considerPackageJson ? parseNodeModuleFromPath(resolvedFromFile) : undefined; + var packageId = nm && getPackageJsonInfo(nm.packageDirectory, nm.subModuleName, failedLookupLocations, false, state).packageId; + return withPackageId(packageId, resolvedFromFile); } } if (!onlyRecordFailures) { @@ -18253,6 +18289,38 @@ var ts; } return loadNodeModuleFromDirectory(extensions, candidate, failedLookupLocations, onlyRecordFailures, state, considerPackageJson); } + var nodeModulesPathPart = "/node_modules/"; + function parseNodeModuleFromPath(resolved) { + var path = ts.normalizePath(resolved.path); + var idx = path.lastIndexOf(nodeModulesPathPart); + if (idx === -1) { + return undefined; + } + var indexAfterNodeModules = idx + nodeModulesPathPart.length; + var indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterNodeModules); + if (path.charCodeAt(indexAfterNodeModules) === 64) { + indexAfterPackageName = moveToNextDirectorySeparatorIfAvailable(path, indexAfterPackageName); + } + var packageDirectory = path.slice(0, indexAfterPackageName); + var subModuleName = ts.removeExtension(path.slice(indexAfterPackageName + 1), resolved.ext) + ".d.ts"; + return { packageDirectory: packageDirectory, subModuleName: subModuleName }; + } + function moveToNextDirectorySeparatorIfAvailable(path, prevSeparatorIndex) { + var nextSeparatorIndex = path.indexOf(ts.directorySeparator, prevSeparatorIndex + 1); + return nextSeparatorIndex === -1 ? prevSeparatorIndex : nextSeparatorIndex; + } + function addExtensionAndIndex(path) { + if (path === "") { + return "index.d.ts"; + } + if (ts.endsWith(path, ".d.ts")) { + return path; + } + if (ts.endsWith(path, "/index")) { + return path + ".d.ts"; + } + return path + "/index.d.ts"; + } function directoryProbablyExists(directoryName, host) { return !host.directoryExists || host.directoryExists(directoryName); } @@ -18326,18 +18394,41 @@ var ts; var directoryExists = !onlyRecordFailures && directoryProbablyExists(candidate, state.host); return loadModuleFromFile(extensions, ts.combinePaths(candidate, "index"), failedLookupLocations, !directoryExists, state); } - function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, _a) { - var host = _a.host, traceEnabled = _a.traceEnabled; + function getPackageJsonInfo(nodeModuleDirectory, subModuleName, failedLookupLocations, onlyRecordFailures, state) { + var host = state.host, traceEnabled = state.traceEnabled; var directoryExists = !onlyRecordFailures && directoryProbablyExists(nodeModuleDirectory, host); var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { - if (traceEnabled) { - trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); - } var packageJsonContent = readJson(packageJsonPath, host); + if (subModuleName === "") { + var path = tryReadPackageJsonFields(true, packageJsonContent, nodeModuleDirectory, state); + if (typeof path === "string") { + subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); + } + else { + var jsPath = tryReadPackageJsonFields(false, packageJsonContent, nodeModuleDirectory, state); + if (typeof jsPath === "string") { + subModuleName = ts.removeExtension(ts.removeExtension(jsPath.substring(nodeModuleDirectory.length + 1), ".js"), ".jsx") + ".d.ts"; + } + else { + subModuleName = "index.d.ts"; + } + } + } + if (!ts.endsWith(subModuleName, ".d.ts")) { + subModuleName = addExtensionAndIndex(subModuleName); + } var packageId = typeof packageJsonContent.name === "string" && typeof packageJsonContent.version === "string" ? { name: packageJsonContent.name, subModuleName: subModuleName, version: packageJsonContent.version } : undefined; + if (traceEnabled) { + if (packageId) { + trace(host, ts.Diagnostics.Found_package_json_at_0_Package_ID_is_1, packageJsonPath, ts.packageIdToString(packageId)); + } + else { + trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath); + } + } return { found: true, packageJsonContent: packageJsonContent, packageId: packageId }; } else { @@ -18480,13 +18571,17 @@ var ts; function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); if (withoutAtTypePrefix !== mangledName) { - return ts.stringContains(withoutAtTypePrefix, mangledScopedPackageSeparator) ? - "@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) : - withoutAtTypePrefix; + return getUnmangledNameForScopedPackage(withoutAtTypePrefix); } return mangledName; } ts.getPackageNameFromAtTypesDirectory = getPackageNameFromAtTypesDirectory; + function getUnmangledNameForScopedPackage(typesPackageName) { + return ts.stringContains(typesPackageName, mangledScopedPackageSeparator) ? + "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) : + typesPackageName; + } + ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { var result = cache && cache.get(containingDirectory); if (result) { @@ -18502,7 +18597,7 @@ var ts; var failedLookupLocations = []; var containingDirectory = ts.getDirectoryPath(containingFile); var resolved = tryResolve(Extensions.TypeScript) || tryResolve(Extensions.JavaScript); - return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, false, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved && resolved.value, undefined, false, failedLookupLocations); function tryResolve(extensions) { var resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, failedLookupLocations, state); if (resolvedUsingSettings) { @@ -18540,7 +18635,7 @@ var ts; var state = { compilerOptions: compilerOptions, host: host, traceEnabled: traceEnabled }; var failedLookupLocations = []; var resolved = loadModuleFromNodeModulesOneLevel(Extensions.DtsOnly, moduleName, globalCache, failedLookupLocations, state); - return createResolvedModuleWithFailedLookupLocations(resolved, true, failedLookupLocations); + return createResolvedModuleWithFailedLookupLocations(resolved, undefined, true, failedLookupLocations); } ts.loadModuleFromGlobalCache = loadModuleFromGlobalCache; function toSearchResult(value) { @@ -18548,6 +18643,306 @@ var ts; } })(ts || (ts = {})); var ts; +(function (ts) { + function stringToInt(str) { + var n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error("Error in parseInt(" + JSON.stringify(str) + ")"); + } + return n; + } + var isPrereleaseRegex = /^(.*)-next.\d+/; + var prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + var semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + var Semver = (function () { + function Semver(major, minor, patch, isPrerelease) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.isPrerelease = isPrerelease; + } + Semver.parse = function (semver) { + var isPrerelease = isPrereleaseRegex.test(semver); + var result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error("Unexpected semver: " + semver + " (isPrerelease: " + isPrerelease + ")"); + } + return result; + }; + Semver.fromRaw = function (_a) { + var major = _a.major, minor = _a.minor, patch = _a.patch, isPrerelease = _a.isPrerelease; + return new Semver(major, minor, patch, isPrerelease); + }; + Semver.tryParse = function (semver, isPrerelease) { + var rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; + var match = rgx.exec(semver); + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; + }; + Object.defineProperty(Semver.prototype, "versionString", { + get: function () { + return this.isPrerelease ? this.major + "." + this.minor + ".0-next." + this.patch : this.major + "." + this.minor + "." + this.patch; + }, + enumerable: true, + configurable: true + }); + Semver.prototype.equals = function (sem) { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + }; + Semver.prototype.greaterThan = function (sem) { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); + }; + return Semver; + }()); + ts.Semver = Semver; +})(ts || (ts = {})); +var ts; +(function (ts) { + var JsTyping; + (function (JsTyping) { + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = ts.Semver.parse(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest")); + return !availableVersion.greaterThan(cachedTyping.version); + } + JsTyping.isTypingUpToDate = isTypingUpToDate; + JsTyping.nodeCoreModuleList = [ + "buffer", "querystring", "events", "http", "cluster", + "zlib", "os", "https", "punycode", "repl", "readline", + "vm", "child_process", "url", "dns", "net", + "dgram", "fs", "path", "string_decoder", "tls", + "crypto", "stream", "util", "assert", "tty", "domain", + "constants", "process", "v8", "timers", "console" + ]; + var nodeCoreModules = ts.arrayToSet(JsTyping.nodeCoreModuleList); + function loadSafeList(host, safeListPath) { + var result = ts.readConfigFile(safeListPath, function (path) { return host.readFile(path); }); + return ts.createMapFromTemplate(result.config); + } + JsTyping.loadSafeList = loadSafeList; + function loadTypesMap(host, typesMapPath) { + var result = ts.readConfigFile(typesMapPath, function (path) { return host.readFile(path); }); + if (result.config) { + return ts.createMapFromTemplate(result.config.simpleMap); + } + return undefined; + } + JsTyping.loadTypesMap = loadTypesMap; + function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) { + if (!typeAcquisition || !typeAcquisition.enable) { + return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; + } + var inferredTypings = ts.createMap(); + fileNames = ts.mapDefined(fileNames, function (fileName) { + var path = ts.normalizePath(fileName); + if (ts.hasJavaScriptFileExtension(path)) { + return path; + } + }); + var filesToWatch = []; + if (typeAcquisition.include) + addInferredTypings(typeAcquisition.include, "Explicitly included types"); + var exclude = typeAcquisition.exclude || []; + var possibleSearchDirs = ts.arrayToSet(fileNames, ts.getDirectoryPath); + possibleSearchDirs.set(projectRootPath, true); + possibleSearchDirs.forEach(function (_true, searchDir) { + var packageJsonPath = ts.combinePaths(searchDir, "package.json"); + getTypingNamesFromJson(packageJsonPath, filesToWatch); + var bowerJsonPath = ts.combinePaths(searchDir, "bower.json"); + getTypingNamesFromJson(bowerJsonPath, filesToWatch); + var bowerComponentsPath = ts.combinePaths(searchDir, "bower_components"); + getTypingNamesFromPackagesFolder(bowerComponentsPath, filesToWatch); + var nodeModulesPath = ts.combinePaths(searchDir, "node_modules"); + getTypingNamesFromPackagesFolder(nodeModulesPath, filesToWatch); + }); + getTypingNamesFromSourceFileNames(fileNames); + if (unresolvedImports) { + var module_1 = ts.deduplicate(unresolvedImports.map(function (moduleId) { return nodeCoreModules.has(moduleId) ? "node" : moduleId; }), ts.equateStringsCaseSensitive, ts.compareStringsCaseSensitive); + addInferredTypings(module_1, "Inferred typings from unresolved imports"); + } + packageNameToTypingLocation.forEach(function (typing, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { + inferredTypings.set(name, typing.typingLocation); + } + }); + for (var _i = 0, exclude_1 = exclude; _i < exclude_1.length; _i++) { + var excludeTypingName = exclude_1[_i]; + var didDelete = inferredTypings.delete(excludeTypingName); + if (didDelete && log) + log("Typing for " + excludeTypingName + " is in exclude list, will be ignored."); + } + var newTypingNames = []; + var cachedTypingPaths = []; + inferredTypings.forEach(function (inferred, typing) { + if (inferred !== undefined) { + cachedTypingPaths.push(inferred); + } + else { + newTypingNames.push(typing); + } + }); + var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch }; + if (log) + log("Result: " + JSON.stringify(result)); + return result; + function addInferredTyping(typingName) { + if (!inferredTypings.has(typingName)) { + inferredTypings.set(typingName, undefined); + } + } + function addInferredTypings(typingNames, message) { + if (log) + log(message + ": " + JSON.stringify(typingNames)); + ts.forEach(typingNames, addInferredTyping); + } + function getTypingNamesFromJson(jsonPath, filesToWatch) { + if (!host.fileExists(jsonPath)) { + return; + } + filesToWatch.push(jsonPath); + var jsonConfig = ts.readConfigFile(jsonPath, function (path) { return host.readFile(path); }).config; + var jsonTypingNames = ts.flatMap([jsonConfig.dependencies, jsonConfig.devDependencies, jsonConfig.optionalDependencies, jsonConfig.peerDependencies], ts.getOwnKeys); + addInferredTypings(jsonTypingNames, "Typing names in '" + jsonPath + "' dependencies"); + } + function getTypingNamesFromSourceFileNames(fileNames) { + var fromFileNames = ts.mapDefined(fileNames, function (j) { + if (!ts.hasJavaScriptFileExtension(j)) + return undefined; + var inferredTypingName = ts.removeFileExtension(ts.getBaseFileName(j.toLowerCase())); + var cleanedTypingName = ts.removeMinAndVersionNumbers(inferredTypingName); + return safeList.get(cleanedTypingName); + }); + if (fromFileNames.length) { + addInferredTypings(fromFileNames, "Inferred typings from file names"); + } + var hasJsxFile = ts.some(fileNames, function (f) { return ts.fileExtensionIs(f, ".jsx"); }); + if (hasJsxFile) { + if (log) + log("Inferred 'react' typings due to presence of '.jsx' extension"); + addInferredTyping("react"); + } + } + function getTypingNamesFromPackagesFolder(packagesFolderPath, filesToWatch) { + filesToWatch.push(packagesFolderPath); + if (!host.directoryExists(packagesFolderPath)) { + return; + } + var fileNames = host.readDirectory(packagesFolderPath, [".json"], undefined, undefined, 2); + if (log) + log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(fileNames)); + var packageNames = []; + for (var _i = 0, fileNames_1 = fileNames; _i < fileNames_1.length; _i++) { + var fileName = fileNames_1[_i]; + var normalizedFileName = ts.normalizePath(fileName); + var baseFileName = ts.getBaseFileName(normalizedFileName); + if (baseFileName !== "package.json" && baseFileName !== "bower.json") { + continue; + } + var result_1 = ts.readConfigFile(normalizedFileName, function (path) { return host.readFile(path); }); + var packageJson = result_1.config; + if (baseFileName === "package.json" && packageJson._requiredBy && + ts.filter(packageJson._requiredBy, function (r) { return r[0] === "#" || r === "/"; }).length === 0) { + continue; + } + if (!packageJson.name) { + continue; + } + var ownTypes = packageJson.types || packageJson.typings; + if (ownTypes) { + var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName)); + if (log) + log(" Package '" + packageJson.name + "' provides its own types."); + inferredTypings.set(packageJson.name, absolutePath); + } + else { + packageNames.push(packageJson.name); + } + } + addInferredTypings(packageNames, " Found package names"); + } + } + JsTyping.discoverTypings = discoverTypings; + var maxPackageNameLength = 214; + function validatePackageName(packageName) { + if (!packageName) { + return 2; + } + if (packageName.length > maxPackageNameLength) { + return 3; + } + if (packageName.charCodeAt(0) === 46) { + return 4; + } + if (packageName.charCodeAt(0) === 95) { + return 5; + } + if (/^@[^/]+\/[^/]+$/.test(packageName)) { + return 1; + } + if (encodeURIComponent(packageName) !== packageName) { + return 6; + } + return 0; + } + JsTyping.validatePackageName = validatePackageName; + function renderPackageNameValidationFailure(result, typing) { + switch (result) { + case 2: + return "Package name '" + typing + "' cannot be empty"; + case 3: + return "Package name '" + typing + "' should be less than " + maxPackageNameLength + " characters"; + case 4: + return "Package name '" + typing + "' cannot start with '.'"; + case 5: + return "Package name '" + typing + "' cannot start with '_'"; + case 1: + return "Package '" + typing + "' is scoped and currently is not supported"; + case 6: + return "Package name '" + typing + "' contains non URI safe characters"; + case 0: + throw ts.Debug.fail(); + default: + ts.Debug.assertNever(result); + } + } + JsTyping.renderPackageNameValidationFailure = renderPackageNameValidationFailure; + })(JsTyping = ts.JsTyping || (ts.JsTyping = {})); +})(ts || (ts = {})); +var ts; +(function (ts) { + var server; + (function (server) { + server.ActionSet = "action::set"; + server.ActionInvalidate = "action::invalidate"; + server.ActionPackageInstalled = "action::packageInstalled"; + server.EventTypesRegistry = "event::typesRegistry"; + server.EventBeginInstallTypes = "event::beginInstallTypes"; + server.EventEndInstallTypes = "event::endInstallTypes"; + server.EventInitializationFailed = "event::initializationFailed"; + var Arguments; + (function (Arguments) { + Arguments.GlobalCacheLocation = "--globalTypingsCacheLocation"; + Arguments.LogFile = "--logFile"; + Arguments.EnableTelemetry = "--enableTelemetry"; + Arguments.TypingSafeListLocation = "--typingSafeListLocation"; + Arguments.TypesMapLocation = "--typesMapLocation"; + Arguments.NpmLocation = "--npmLocation"; + })(Arguments = server.Arguments || (server.Arguments = {})); + function hasArgument(argumentName) { + return ts.sys.args.indexOf(argumentName) >= 0; + } + server.hasArgument = hasArgument; + function findArgument(argumentName) { + var index = ts.sys.args.indexOf(argumentName); + return index >= 0 && index < ts.sys.args.length - 1 + ? ts.sys.args[index + 1] + : undefined; + } + server.findArgument = findArgument; + })(server = ts.server || (ts.server = {})); +})(ts || (ts = {})); +var ts; (function (ts) { var server; (function (server) { @@ -18627,7 +19022,7 @@ var ts; if (this.safeList === undefined) { this.initializeSafeList(); } - var discoverTypingsResult = ts.JsTyping.discoverTypings(this.installTypingHost, this.log.isEnabled() ? (function (s) { return _this.log.writeLine(s); }) : undefined, req.fileNames, req.projectRootPath, this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, req.unresolvedImports); + var discoverTypingsResult = ts.JsTyping.discoverTypings(this.installTypingHost, this.log.isEnabled() ? (function (s) { return _this.log.writeLine(s); }) : undefined, req.fileNames, req.projectRootPath, this.safeList, this.packageNameToTypingLocation, req.typeAcquisition, req.unresolvedImports, this.typesRegistry); if (this.log.isEnabled()) { this.log.writeLine("Finished typings discovery: " + JSON.stringify(discoverTypingsResult)); } @@ -18658,23 +19053,29 @@ var ts; if (this.log.isEnabled()) { this.log.writeLine("Processing cache location '" + cacheLocation + "'"); } - if (this.knownCachesSet.get(cacheLocation)) { + if (this.knownCachesSet.has(cacheLocation)) { if (this.log.isEnabled()) { this.log.writeLine("Cache location was already processed..."); } return; } var packageJson = ts.combinePaths(cacheLocation, "package.json"); + var packageLockJson = ts.combinePaths(cacheLocation, "package-lock.json"); if (this.log.isEnabled()) { this.log.writeLine("Trying to find '" + packageJson + "'..."); } - if (this.installTypingHost.fileExists(packageJson)) { + if (this.installTypingHost.fileExists(packageJson) && this.installTypingHost.fileExists(packageLockJson)) { var npmConfig = JSON.parse(this.installTypingHost.readFile(packageJson)); + var npmLock = JSON.parse(this.installTypingHost.readFile(packageLockJson)); if (this.log.isEnabled()) { this.log.writeLine("Loaded content of '" + packageJson + "': " + JSON.stringify(npmConfig)); + this.log.writeLine("Loaded content of '" + packageLockJson + "'"); } - if (npmConfig.devDependencies) { + if (npmConfig.devDependencies && npmLock.dependencies) { for (var key in npmConfig.devDependencies) { + if (!ts.hasProperty(npmLock.dependencies, key)) { + continue; + } var packageName = ts.getBaseFileName(key); if (!packageName) { continue; @@ -18685,10 +19086,10 @@ var ts; continue; } var existingTypingFile = this.packageNameToTypingLocation.get(packageName); - if (existingTypingFile === typingFile) { - continue; - } if (existingTypingFile) { + if (existingTypingFile.typingLocation === typingFile) { + continue; + } if (this.log.isEnabled()) { this.log.writeLine("New typing for package " + packageName + " from '" + typingFile + "' conflicts with existing typing file '" + existingTypingFile + "'"); } @@ -18696,7 +19097,11 @@ var ts; if (this.log.isEnabled()) { this.log.writeLine("Adding entry into typings cache: '" + packageName + "' => '" + typingFile + "'"); } - this.packageNameToTypingLocation.set(packageName, typingFile); + var info = ts.getProperty(npmLock.dependencies, key); + var version_1 = info && info.version; + var semver = ts.Semver.parse(version_1); + var newTyping = { typingLocation: typingFile, version: semver }; + this.packageNameToTypingLocation.set(packageName, newTyping); } } } @@ -18706,34 +19111,32 @@ var ts; this.knownCachesSet.set(cacheLocation, true); }; TypingsInstaller.prototype.filterTypings = function (typingsToInstall) { - if (typingsToInstall.length === 0) { - return typingsToInstall; - } - var result = []; - for (var _i = 0, typingsToInstall_1 = typingsToInstall; _i < typingsToInstall_1.length; _i++) { - var typing = typingsToInstall_1[_i]; - if (this.missingTypingsSet.get(typing) || this.packageNameToTypingLocation.get(typing)) { - continue; + var _this = this; + return typingsToInstall.filter(function (typing) { + if (_this.missingTypingsSet.get(typing)) { + if (_this.log.isEnabled()) + _this.log.writeLine("'" + typing + "' is in missingTypingsSet - skipping..."); + return false; } var validationResult = ts.JsTyping.validatePackageName(typing); - if (validationResult === 0) { - if (this.typesRegistry.has(typing)) { - result.push(typing); - } - else { - if (this.log.isEnabled()) { - this.log.writeLine("Entry for package '" + typing + "' does not exist in local types registry - skipping..."); - } - } + if (validationResult !== 0) { + _this.missingTypingsSet.set(typing, true); + if (_this.log.isEnabled()) + _this.log.writeLine(ts.JsTyping.renderPackageNameValidationFailure(validationResult, typing)); + return false; } - else { - this.missingTypingsSet.set(typing, true); - if (this.log.isEnabled()) { - this.log.writeLine(ts.JsTyping.renderPackageNameValidationFailure(validationResult, typing)); - } + if (!_this.typesRegistry.has(typing)) { + if (_this.log.isEnabled()) + _this.log.writeLine("Entry for package '" + typing + "' does not exist in local types registry - skipping..."); + return false; } - } - return result; + if (_this.packageNameToTypingLocation.get(typing) && ts.JsTyping.isTypingUpToDate(_this.packageNameToTypingLocation.get(typing), _this.typesRegistry.get(typing))) { + if (_this.log.isEnabled()) + _this.log.writeLine("'" + typing + "' already has an up-to-date typing - skipping..."); + return false; + } + return true; + }); }; TypingsInstaller.prototype.ensurePackageDirectoryExists = function (directory) { var npmConfigPath = ts.combinePaths(directory, "package.json"); @@ -18794,9 +19197,10 @@ var ts; _this.missingTypingsSet.set(packageName, true); continue; } - if (!_this.packageNameToTypingLocation.has(packageName)) { - _this.packageNameToTypingLocation.set(packageName, typingFile); - } + var distTags = _this.typesRegistry.get(packageName); + var newVersion = ts.Semver.parse(distTags["ts" + ts.versionMajorMinor] || distTags[latestDistTag]); + var newTyping = { typingLocation: typingFile, version: newVersion }; + _this.packageNameToTypingLocation.set(packageName, newTyping); installedTypingFiles.push(typingFile); } if (_this.log.isEnabled()) { @@ -18886,6 +19290,7 @@ var ts; return "@types/" + packageName + "@ts" + ts.versionMajorMinor; } typingsInstaller.typingsName = typingsName; + var latestDistTag = "latest"; })(typingsInstaller = server.typingsInstaller || (server.typingsInstaller = {})); })(server = ts.server || (ts.server = {})); })(ts || (ts = {})); diff --git a/lib/zh-CN/diagnosticMessages.generated.json b/lib/zh-CN/diagnosticMessages.generated.json index e7713b2cbd3..ac797aec838 100644 --- a/lib/zh-CN/diagnosticMessages.generated.json +++ b/lib/zh-CN/diagnosticMessages.generated.json @@ -12,11 +12,11 @@ "A_class_member_cannot_have_the_0_keyword_1248": "类成员不可具有“{0}”关键字。", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "计算属性名中不允许逗号表达式。", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "计算属性名无法从其包含的类型引用类型参数。", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "类属性声明中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。", - "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "方法重载中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "类型文本中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。", - "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "环境上下文中的计算属性名称必须引用类型为文本类型或“唯一符号”类型的表达式。", - "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "接口中的计算属性名称必须引用必须引用类型为文本类型或“唯一符号”的表达式。", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "类属性声明中的计算属性名称必须引用类型为文本类型或 \"unique symbol\" 类型的表达式。", + "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "方法重载中的计算属性名称必须引用文本类型或 \"unique symbol\" 类型的表达式。", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "类型文本中的计算属性名称必须引用类型为文本类型或 \"unique symbol\" 类型的表达式。", + "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "环境上下文中的计算属性名称必须引用类型为文本类型或 \"unique symbol\" 类型的表达式。", + "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "接口中的计算属性名称必须引用必须引用类型为文本类型或 \"unique symbol\" 的表达式。", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "计算属性名的类型必须为 \"string\"、\"number\"、\"symbol\" 或 \"any\"。", "A_computed_property_name_of_the_form_0_must_be_of_type_symbol_2471": "窗体“{0}”的计算属性名必须是 \"symbol\" 类型。", "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "只有使用字符串文本才能访问常数枚举成员。", @@ -48,16 +48,18 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "命名空间声明必须位于与之合并的类或函数所在的相同文件内。", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "命名空间声明不能位于与之合并的类或函数前", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "只允许在命名空间或模块中使用命名空间声明。", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "命名空间样式导入不能调用或构造,并将在运行时导致失败。", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "只允许在函数或构造函数实现中使用参数初始化表达式。", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "不能使用 rest 参数声明参数属性。", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "只允许在构造函数实现中使用参数属性。", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "不能使用绑定模式声明参数属性。", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "“扩展”选项中的路径必须为相对路径或根路径,但“{0}”不是。", "A_promise_must_have_a_then_method_1059": "承诺必须具有 \"then\" 方法。", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "类型为“唯一符号”的类的属性必须同时为“静态”和“只读”。", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "类型为“唯一符号”的接口或类型文本的属性必须是“只读”", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "类型为 \"unique symbol\" 的类的属性必须同时为 \"static\" 和 \"readonly\"。", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "类型为 \"unique symbol\" 的接口或类型文本的属性必须为 \"readonly\"。", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "必选参数不能位于可选参数后。", "A_rest_element_cannot_contain_a_binding_pattern_2501": "rest 元素不能包含绑定模式。", + "A_rest_element_cannot_have_a_property_name_2566": "其余元素不能具有属性名。", "A_rest_element_cannot_have_an_initializer_1186": "rest 元素不能具有初始化表达式。", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "rest 元素必须在析构模式中位于最末。", "A_rest_parameter_cannot_be_optional_1047": "rest 参数不能为可选参数。", @@ -83,7 +85,7 @@ "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230": "类型谓词无法在绑定模式中引用元素“{0}”。", "A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods_1228": "只允许在函数和方法的返回类型位置使用类型谓词。", "A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type_2677": "类型谓词的类型不可赋给其参数的类型。", - "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "类型为“唯一符号”的变量必须是“常量”。", + "A_variable_whose_type_is_a_unique_symbol_type_must_be_const_1332": "类型为 \"unique symbol\" 的变量必须为 \"const\"。", "A_yield_expression_is_only_allowed_in_a_generator_body_1163": "只允许在生成器正文中使用 \"yield\" 表达式。", "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513": "无法通过 super 表达式访问“{1}”类中的“{0}”抽象方法。", "Abstract_methods_can_only_appear_within_an_abstract_class_1244": "抽象方法只能出现在抽象类中。", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "已看到可访问性修饰符。", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "访问器仅在面向 ECMAScript 5 和更高版本时可用。", "Accessors_must_both_be_abstract_or_non_abstract_2676": "两个取值函数必须都是抽象的或都是非抽象的。", - "Add_0_to_existing_import_declaration_from_1_90015": "将 {0} 从 {1} 添加到现有导入声明。", - "Add_index_signature_for_property_0_90017": "为属性“{0}”添加索引签名。", - "Add_missing_super_call_90001": "添加缺失的 \"super()\" 调用。", - "Add_this_to_unresolved_variable_90008": "向未解析的变量添加 \"this.\"。", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "添加 tsconfig.json 文件有助于组织包含 TypeScript 和 JavaScript 文件的项目。有关详细信息,请访问 https://aka.ms/tsconfig。", + "Add_0_to_existing_import_declaration_from_1_90015": "将“{0}”从“{1}”添加到现有导入声明", + "Add_async_modifier_to_containing_function_90029": "将异步修饰符添加到包含函数", + "Add_index_signature_for_property_0_90017": "为属性“{0}”添加索引签名", + "Add_missing_super_call_90001": "添加缺失的 \"super()\" 调用", + "Add_this_to_unresolved_variable_90008": "向未解析的变量添加 \"this.\"", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "添加 tsconfig.json 文件有助于组织包含 TypeScript 和 JavaScript 文件的项目。有关详细信息,请访问 https://aka.ms/tsconfig。", "Additional_Checks_6176": "其他检查", "Advanced_Options_6178": "高级选项", "All_declarations_of_0_must_have_identical_modifiers_2687": "“{0}”的所有声明必须具有相同的修饰符。", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "索引签名参数不能具有可访问性修饰符。", "An_index_signature_parameter_cannot_have_an_initializer_1020": "索引签名参数不能具有初始化表达式。", "An_index_signature_parameter_must_have_a_type_annotation_1022": "索引签名参数必须具有类型批注。", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "索引签名参数类型不能为类型别名。请考虑改而编写“[{0}: {1}]:{2}”。", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "索引签名参数类型不能为联合类型。请考虑改用映射的对象类型。", "An_index_signature_parameter_type_must_be_string_or_number_1023": "索引签名参数类型必须为 \"string\" 或 \"number\"。", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "接口只能扩展具有可选类型参数的标识符/限定名称。", "An_interface_may_only_extend_a_class_or_another_interface_2312": "接口只能扩展类或其他接口。", @@ -147,7 +152,7 @@ "An_object_member_cannot_be_declared_optional_1162": "对象成员无法声明为可选。", "An_overload_signature_cannot_be_declared_as_a_generator_1222": "重载签名无法声明为生成器。", "An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_ex_17006": "乘方表达式的左侧不允许存在具有“{0}”运算符的一元表达式。请考虑用括号将表达式括起。", - "Annotate_with_type_from_JSDoc_95009": "使用 JSDoc 中的类型批注", + "Annotate_with_type_from_JSDoc_95009": "通过 JSDoc 类型批注", "Annotate_with_types_from_JSDoc_95010": "使用 JSDoc 中的类型批注", "Argument_expression_expected_1135": "应为参数表达式。", "Argument_for_0_option_must_be_Colon_1_6046": "“{0}”选项的参数必须为 {1}。", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "需要二进制数字。", "Binding_element_0_implicitly_has_an_1_type_7031": "绑定元素“{0}”隐式具有“{1}”类型。", "Block_scoped_variable_0_used_before_its_declaration_2448": "声明之前已使用的块范围变量“{0}”。", - "Call_decorator_expression_90028": "调用修饰器表达式。", + "Call_decorator_expression_90028": "调用修饰器表达式", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "缺少返回类型批注的调用签名隐式具有返回类型 \"any\"。", "Call_target_does_not_contain_any_signatures_2346": "调用目标不包含任何签名。", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "无法访问“{0}.{1}”,因为“{0}”是类型,不是命名空间。是否要使用“{0}[\"{1}\"]”检索“{0}”中“{1}”属性的类型?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "无法导入类型声明文件。请考虑导入“{0}”,而不是“{1}”。", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "无法在块范围声明“{1}”所在的范围内初始化外部范围变量“{0}”。", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "无法调用类型缺少调用签名的表达式。类型“{0}”没有兼容的调用签名。", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "不能调用可能是 \"null\" 的对象。", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "不能调用可能是 \"null\" 或“未定义”的对象。", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "不能调用可能是“未定义”的对象。", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "提供 \"--isolatedModules\" 标记时无法重新导出类型。", "Cannot_read_file_0_Colon_1_5012": "无法读取文件“{0}”: {1}。", "Cannot_redeclare_block_scoped_variable_0_2451": "无法重新声明块范围变量“{0}”。", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "无法写入文件“{0}”,因为它会覆盖输入文件。", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Catch 子句变量不能有类型批注。", "Catch_clause_variable_cannot_have_an_initializer_1197": "Catch 子句变量不能有初始化表达式。", - "Change_0_to_1_90014": "将“{0}”更改为“{1}”。", - "Change_extends_to_implements_90003": "将 \"extends\" 更改为 \"implements\"。", - "Change_spelling_to_0_90022": "将拼写更改为“{0}”。", + "Change_0_to_1_90014": "将“{0}”更改为“{1}”", + "Change_extends_to_implements_90003": "将 \"extends\" 改为 \"implements\"", + "Change_spelling_to_0_90022": "将拼写更改为“{0}”", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "检查“{0}”是否是“{1}”-“{2}”的最长匹配前缀。", "Circular_definition_of_import_alias_0_2303": "导入别名“{0}”的循环定义。", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "解析配置时检测到循环: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "类“{0}”将“{1}”定义为实例成员函数,但扩展类“{2}”将其定义为实例成员属性。", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "类“{0}”将“{1}”定义为实例成员属性,但扩展类“{2}”将其定义为实例成员函数。", "Class_0_incorrectly_extends_base_class_1_2415": "类“{0}”错误扩展基类“{1}”。", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "类“{0}”错误实现类“{1}”。你是想扩展“{1}”并将其成员作为子类继承吗?", "Class_0_incorrectly_implements_interface_1_2420": "类“{0}”错误实现接口“{1}”。", "Class_0_used_before_its_declaration_2449": "类“{0}”用于其声明前。", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "类声明不能有多个 \"@augments\" 或 \"@extends\" 标记。", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "未指定包含文件,并且无法确定根目录,正在跳过在 \"node_modules\" 文件夹中查找。", "Convert_function_0_to_class_95002": "将函数“{0}”转换为类", "Convert_function_to_an_ES2015_class_95001": "将函数转换为 ES2015 类", + "Convert_to_ES6_module_95017": "转换为 ES6 模块", "Convert_to_default_import_95013": "转换为默认导入", "Corrupted_locale_file_0_6051": "区域设置文件 {0} 已损坏。", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "无法找到模块“{0}”的声明文件。“{1}”隐式拥有 \"any\" 类型。", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "应为声明。", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "声明名称与内置全局标识符“{0}”冲突。", "Declaration_or_statement_expected_1128": "应为声明或语句。", - "Declare_method_0_90023": "声明方法“{0}”。", - "Declare_property_0_90016": "声明属性“{0}”。", - "Declare_static_method_0_90024": "声明静态方法“{0}”。", - "Declare_static_property_0_90027": "声明静态属性 \"{0}\"。", + "Declare_method_0_90023": "声明方法“{0}”", + "Declare_property_0_90016": "声明属性“{0}”", + "Declare_static_method_0_90024": "声明静态方法“{0}”", + "Declare_static_property_0_90027": "声明静态属性“{0}”", "Decorators_are_not_valid_here_1206": "修饰器在此处无效。", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "不能向多个同名的 get/set 访问器应用修饰器。", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "模块的默认导出具有或正在使用专用名称“{0}”。", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[已弃用] 请改用 \"--skipLibCheck\"。请跳过默认库声明文件的类型检查。", "Digit_expected_1124": "应为数字。", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "目录“{0}”不存在,正在跳过该目录中的所有查找。", - "Disable_checking_for_this_file_90018": "禁用检查此文件。", + "Disable_checking_for_this_file_90018": "禁用检查此文件", "Disable_size_limitations_on_JavaScript_projects_6162": "禁用对 JavaScript 项目的大小限制。", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "禁止严格检查函数类型中的通用签名。", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "不允许对同一文件采用大小不一致的引用。", @@ -309,6 +319,7 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "启用类中属性初始化的严格检查。", "Enable_strict_null_checks_6113": "启用严格的 NULL 检查。", "Enable_tracing_of_the_name_resolution_process_6085": "启用名称解析过程的跟踪。", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "通过为所有导入创建命名空间对象来启用 CommonJS 和 ES 模块之间的发出互操作性。表示 \"allowSyntheticDefaultImports\"。", "Enables_experimental_support_for_ES7_async_functions_6068": "对 ES7 异步函数启用实验支持。", "Enables_experimental_support_for_ES7_decorators_6065": "对 ES7 修饰器启用实验支持。", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "对发出修饰器的类型元数据启用实验支持。", @@ -352,7 +363,6 @@ "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "表达式解析为编译器用于捕获 \"this\" 引用的变量声明 \"_this\"。", "Extract_constant_95006": "提取常数", "Extract_function_95005": "提取函数", - "Extract_symbol_95003": "提取符号", "Extract_to_0_in_1_95004": "提取到 {1} 中的 {0}", "Extract_to_0_in_1_scope_95008": "提取到 {1} 范围中的 {0}", "Extract_to_0_in_enclosing_scope_95007": "提取到封闭范围中的 {0}", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "文件名“{0}”仅在大小写方面与包含的文件名“{1}”不同。", "File_name_0_has_a_1_extension_stripping_it_6132": "文件名“{0}”的扩展名为“{1}”,请去除它。", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "文件规范不能包含出现在递归目录通配符(\"*\"): “{0}”后的父目录(\"..\")。", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "文件规范不能包含多个递归目录通配符(\"**\"):“{0}”。", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "文件规范不能以递归目录通配符结尾(\"**\"):“{0}”。", "Found_package_json_at_0_6099": "在“{0}”处找到了 \"package.json\"。", + "Found_package_json_at_0_Package_ID_is_1_6190": "在“{0}”找到了 \"package.json\"。包 ID 为“{1}”。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "面向 \"ES3\" 或 \"ES5\" 时,在严格模式下,块内不允许函数声明。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "面向 \"ES3\" 或 \"ES5\" 时,在严格模式下,块内不允许函数声明。类定义自动处于严格模式。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "面向 \"ES3\" 或 \"ES5\" 时,在严格模式下,块内不允许函数声明。模块自动处于严格模式。", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "应为标识符。“{0}”是严格模式下的保留字。模块自动处于严格模式。", "Identifier_expected_1003": "应为标识符。", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "应为标识符。转换 ECMAScript 模块时,\"__esModule\" 保留为导出标记。", - "Ignore_this_error_message_90019": "忽略此错误信息。", - "Implement_inherited_abstract_class_90007": "实现继承的抽象类。", - "Implement_interface_0_90006": "实现接口“{0}”。", + "Ignore_this_error_message_90019": "忽略此错误信息", + "Implement_inherited_abstract_class_90007": "实现已继承的抽象类", + "Implement_interface_0_90006": "实现接口“{0}”", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "导出的类“{0}”的 Implements 子句具有或正在使用专用名称“{1}”。", - "Import_0_from_module_1_90013": "从模块“{1}”导入“{0}”。", + "Import_0_from_module_1_90013": "从模块“{1}”导入“{0}”", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "面向 ECMAScript 模块时,不能使用导入分配。请考虑改用 \"import * as ns from \"mod\"\"、\"import {a} from \"mod\"\"、\"import d from \"mod\"\" 或另一种模块格式。", "Import_declaration_0_is_using_private_name_1_4000": "导入声明“{0}”使用的是专用名称“{1}”。", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "导入声明与“{0}”的局部声明冲突。", @@ -424,10 +434,10 @@ "Index_signature_is_missing_in_type_0_2329": "类型“{0}”中缺少索引签名。", "Index_signatures_are_incompatible_2330": "索引签名不兼容。", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "合并声明“{0}”中的单独声明必须全为导出或全为局部声明。", - "Infer_parameter_types_from_usage_95012": "从用法中推断出参数类型。", - "Infer_type_of_0_from_usage_95011": "从用法中推断出“{0}”的类型。", - "Initialize_property_0_in_the_constructor_90020": "初始化构造函数中的属性“{0}”。", - "Initialize_static_property_0_90021": "初始化静态属性“{0}”。", + "Infer_parameter_types_from_usage_95012": "根据使用情况推断参数类型", + "Infer_type_of_0_from_usage_95011": "根据使用情况推断“{0}”的类型", + "Initialize_property_0_in_the_constructor_90020": "初始化构造函数中的属性“{0}”", + "Initialize_static_property_0_90021": "初始化静态属性“{0}”", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "实例成员变量“{0}”的初始化表达式不能引用构造函数中声明的标识符“{1}”。", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "参数“{0}”的初始化表达式不能引用在它之后声明的标识符“{1}”。", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "初始化表达式没有为此绑定元素提供此任何值,且该绑定元素没有默认值。", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "区域设置必须采用 <语言> 或 <语言>-<区域> 形式。例如“{0}”或“{1}”。", "Longest_matching_prefix_for_0_is_1_6108": "“{0}”的最长匹配前缀为“{1}”。", "Looking_up_in_node_modules_folder_initial_location_0_6125": "正在在 \"node_modules\" 文件夹中查找,初始位置“{0}”。", - "Make_super_call_the_first_statement_in_the_constructor_90002": "在构造函数中,使 \"super()\" 调用第一个语句。", + "Make_super_call_the_first_statement_in_the_constructor_90002": "在构造函数中,使 \"super()\" 调用第一个语句", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "映射的对象类型隐式地含有 \"any\" 模板类型。", "Member_0_implicitly_has_an_1_type_7008": "成员“{0}”隐式包含类型“{1}”。", "Merge_conflict_marker_encountered_1185": "遇到合并冲突标记。", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "合并声明“{0}”不能包含默认导出声明。请考虑改为添加一个独立的“导出默认 {0}”声明。", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== 模块名“{0}”已成功解析为“{1}”。========", "Module_resolution_kind_is_not_specified_using_0_6088": "未指定模块解析类型,正在使用“{0}”。", "Module_resolution_using_rootDirs_has_failed_6111": "使用 \"rootDirs\" 的模块解析失败。", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "不允许使用多个连续的数字分隔符。", "Multiple_constructor_implementations_are_not_allowed_2392": "不允许存在多个构造函数实现。", "NEWLINE_6061": "换行符", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "“{1}”和“{2}”类型的命名属性“{0}”不完全相同。", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "非抽象类表达式不会实现继承自“{1}”类的抽象成员“{0}”。", "Not_all_code_paths_return_a_value_7030": "并非所有代码路径都返回值。", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "数字索引类型“{0}”不能赋给字符串索引类型“{1}”。", + "Numeric_separators_are_not_allowed_here_6188": "此处不允许使用数字分隔符。", "Object_is_possibly_null_2531": "对象可能为 \"null\"。", "Object_is_possibly_null_or_undefined_2533": "对象可能为 \"null\" 或“未定义”。", "Object_is_possibly_undefined_2532": "对象可能为“未定义”。", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "使用 \"new\" 关键字只能调用 void 函数。", "Only_ambient_modules_can_use_quoted_names_1035": "仅环境模块可使用带引号的名称。", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "--{0} 旁仅支持 \"amd\" 和 \"system\" 模块。", + "Only_emit_d_ts_declaration_files_6014": "仅发出 \".d.ts\" 声明文件。 ", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "类 \"extends\" 子句当前仅支持具有可选类型参数的标识符/限定名称。", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "通过 \"super\" 关键字只能访问基类的公共方法和受保护方法。", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "运算符“{0}”不能应用于类型“{1}”和“{2}”。", @@ -584,7 +598,7 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "导出类中的公共静态 setter“{0}”的参数类型具有或正在使用专用名称“{1}”。", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "以严格模式进行分析,并为每个源文件发出 \"use strict\" 指令。", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "模式“{0}”最多只可具有一个 \"*\" 字符。", - "Prefix_0_with_an_underscore_90025": "带下划线的前缀“{0}”。", + "Prefix_0_with_an_underscore_90025": "带下划线的前缀“{0}”", "Print_names_of_files_part_of_the_compilation_6155": "属于编译一部分的文件的打印名称。", "Print_names_of_generated_files_part_of_the_compilation_6154": "属于编译一部分的已生成文件的打印名称。", "Print_the_compiler_s_version_6019": "打印编译器的版本。", @@ -596,6 +610,7 @@ "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "属性“{0}”没有初始化表达式,且未在构造函数中明确赋值。", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "属性“{0}”隐式具有类型 \"any\",因为其 get 访问器缺少返回类型批注。", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "属性“{0}”隐式具有类型 \"any\",因为其 set 访问器缺少参数类型批注。", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "类型“{1}”中的属性“{0}”不可分配给基类型“{2}”中的同一属性。", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "类型“{1}”中的属性“{0}”不可分配给类型“{2}”。", "Property_0_is_declared_but_its_value_is_never_read_6138": "已声明属性“{0}”,但从未读取其值。", "Property_0_is_incompatible_with_index_signature_2530": "属性“{0}”与索引签名不兼容。", @@ -634,7 +649,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "对具有隐式 \"any\" 类型的表达式和声明引发错误。", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "在带隐式“any\" 类型的 \"this\" 表达式上引发错误。", "Redirect_output_structure_to_the_directory_6006": "将输出结构重定向到目录。", - "Remove_declaration_for_Colon_0_90004": "删除“{0}”的声明。", + "Remove_declaration_for_Colon_0_90004": "删除“{0}”的声明", + "Replace_import_with_0_95015": "用“{0}”替换导入。", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "在函数中的所有代码路径并非都返回值时报告错误。", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "报告 switch 语句中遇到 fallthrough 情况的错误。", "Report_errors_in_js_files_8019": ".js 文件中的报表出错。", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "导出类中的公共静态方法的返回类型具有或正在使用专用名称“{0}”。", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "重用源自“{0}”的模块解析,因为解析在旧程序中未更改。", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "对文件“{1}”重用旧程序中模块 “{0}”的解析。", - "Rewrite_as_the_indexed_access_type_0_90026": "重写为索引访问类型“{0}”。", + "Rewrite_as_the_indexed_access_type_0_90026": "重写为索引访问类型“{0}”", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "无法确定根目录,正在跳过主搜索路径。", "STRATEGY_6039": "策略", "Scoped_package_detected_looking_in_0_6182": "检测到范围包,请在“{0}”中查看", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "源映射选项", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "指定的重载签名不可分配给任何非专用化签名。", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "动态导入的说明符不能是扩散元素。", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "指定 ECMAScript 目标版本: \"ES3\"(默认)、\"ES5\"、\"ES2015\"、\"ES2016\"、\"ES2017\" 或 \"ESNEXT\"。", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "指定 ECMAScript 目标版本: \"ES3\" (默认)、\"ES5\"、\"ES2015\"、\"ES2016\"、\"ES2017\"、\"ES2018\" 或 \"ESNEXT\"。", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "指定 JSX 代码生成: \"preserve\"、\"react-native\" 或 \"react\"。", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "指定要在编译中包括的库文件: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "指定要在编译中包括的库文件。", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "指定模块代码生成: \"none\"、\"commonjs\"、\"amd\"、\"system\"、\"umd\"、\"es2015\"或 \"ESNext\"。", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "指定模块解析策略: \"node\" (Node.js)或 \"classic\" (TypeScript pre-1.6)。", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "指定在设定 \"react\" JSX 发出目标时要使用的 JSX 工厂函数,例如 \"react.createElement\" 或 \"h\"。", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "指定输入文件的根目录。与 --outDir 一起用于控制输出目录结构。", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "仅当面向 ECMAScript 5 和更高版本时,\"new\" 表达式中的展开运算符才可用。", "Spread_types_may_only_be_created_from_object_types_2698": "spread 类型只能从对象类型创建。", + "Starting_compilation_in_watch_mode_6031": "在监视模式下开始编译...", "Statement_expected_1129": "应为语句。", "Statements_are_not_allowed_in_ambient_contexts_1036": "不允许在环境上下文中使用语句。", "Static_members_cannot_reference_class_type_parameters_2302": "静态成员不能引用类类型参数。", @@ -713,7 +730,7 @@ "String_literal_expected_1141": "应为字符串文本。", "String_literal_with_double_quotes_expected_1327": "应为带双引号的字符串文字。", "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "使用颜色和上下文风格化错误和消息(实验)。", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "后续属性声明必须属于同一类型。属性“{0}”的类型必须为“{1}”,但此处却为类型“{2}”。", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "后续变量声明必须属于同一类型。变量“{0}”必须属于类型“{1}”,但此处却为类型“{2}”。", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "模式“{1}”的替换“{0}”类型不正确,应为 \"string\",实际为“{2}”。", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "模式“{1}”中的替换“{0}”最多只可具有一个 \"*\" 字符。", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "类型“{0}”不是数组类型或字符串类型,或者没有返回迭代器的 \"[Symbol.iterator]()\" 方法。", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "类型“{0}”不是数组类型,或者没有返回迭代器的 \"[Symbol.iterator]()\" 方法。", "Type_0_is_not_assignable_to_type_1_2322": "不能将类型“{0}”分配给类型“{1}”。", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "类型“{0}”无法分配给类型“{1}”。存在具有此名称的两种不同类型,但它们是不相关的。", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "类型“{0}”无法分配给类型“{1}”。存在具有此名称的两种不同类型,但它们是不相关的。", "Type_0_is_not_comparable_to_type_1_2678": "类型“{0}”不可与类型“{1}”进行比较。", "Type_0_is_not_generic_2315": "类型“{0}”不是泛型类型。", "Type_0_provides_no_match_for_the_signature_1_2658": "类型“{0}”提供的内容与签名“{1}”不匹配。", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "未终止的模板文本。", "Untyped_function_calls_may_not_accept_type_arguments_2347": "非类型化函数调用不能接受类型参数。", "Unused_label_7028": "未使用的标签。", + "Use_synthetic_default_member_95016": "使用综合的“默认”成员。", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "仅 ECMAScript 5 和更高版本支持在 \"for...of\" 语句中使用字符串。", "VERSION_6036": "版本", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "类型“{0}”的值没有与类型“{1}”相同的属性。你是想调用它吗?", @@ -913,7 +931,7 @@ "const_declarations_must_be_initialized_1155": "必须初始化 \"const\" 声明。", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "\"const\" 枚举成员初始化表达式的求值结果为非有限值。", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "\"const\" 枚举成员初始化表达式的求值结果为不允许使用的值 \"NaN\"。", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "\"const\" 枚举仅可在属性、索引访问表达式、导入声明的右侧或导出分配中使用。", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "\"const\" 枚举仅可在属性、索引访问表达式、导入声明的右侧、导出分配或类型查询中使用。", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "在严格模式下,无法对标识符调用 \"delete\"。", "enum_declarations_can_only_be_used_in_a_ts_file_8015": "\"enum declarations\" 只能在 .ts 文件中使用。", "export_can_only_be_used_in_a_ts_file_8003": "\"export=\" 只能在 .ts 文件中使用。", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "已看到 \"implements\" 子句。", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "\"implements clauses\" 只能在 .ts 文件中使用。", "import_can_only_be_used_in_a_ts_file_8002": "\"import ... =\" 只能在 .ts 文件中使用。", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "仅条件类型的 \"extends\" 子句中才允许 \"infer\" 声明。", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "\"interface declarations\" 只能在 .ts 文件中使用。", "let_declarations_can_only_be_declared_inside_a_block_1157": "\"let\" 声明只能在块的内部声明。", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "\"let\" 不能用作 \"let\" 或 \"const\" 声明中的名称。", @@ -941,7 +960,7 @@ "package_json_has_0_field_1_that_references_2_6101": "\"package.json\" 具有引用“{2}”的“{0}”字段“{1}”。", "parameter_modifiers_can_only_be_used_in_a_ts_file_8012": "\"parameter modifiers\" 只能在 .ts 文件中使用。", "paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0_6091": "指定了 \"paths“ 选项,正在查找模式以匹配模块名“{0}”。", - "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024": "\"readonly\" 仅可出现在属性声明或索引签名中。", + "readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024": "\"readonly\" 修饰符仅可出现在属性声明或索引签名中。", "rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107": "设置了 \"rootDirs\" 选项,可将其用于解析相对模块名称“{0}”。", "super_can_only_be_referenced_in_a_derived_class_2335": "只能在派生类中引用 \"super\"。", "super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660": "仅可在派生类或对象文字表达式的成员中引用 \"super\"。", @@ -963,9 +982,9 @@ "type_assertion_expressions_can_only_be_used_in_a_ts_file_8016": "\"type assertion expressions\" 只能在 .ts 文件中使用。", "type_parameter_declarations_can_only_be_used_in_a_ts_file_8004": "\"type parameter declarations\" 只能在 .ts 文件中使用。", "types_can_only_be_used_in_a_ts_file_8010": "\"types\" 只能在 .ts 文件中使用。", - "unique_symbol_types_are_not_allowed_here_1335": "此处不允许“唯一符号”类型。", - "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "“唯一符号”类型仅可在变量语句中的变量上使用。", - "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "不可在具有绑定名称的变量声明中使用“唯一符号”类型。", + "unique_symbol_types_are_not_allowed_here_1335": "此处不允许使用 \"unique symbol\" 类型。", + "unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement_1334": "\"unique symbol\" 类型仅可用于变量语句中的变量。", + "unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name_1333": "不可在具有绑定名称的变量声明中使用 \"unique symbol\" 类型。", "with_statements_are_not_allowed_in_an_async_function_block_1300": "不允许在异步函数块中使用 \"with\" 语句。", "with_statements_are_not_allowed_in_strict_mode_1101": "严格模式下不允许使用 \"with\" 语句。", "yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "不能在参数初始化表达式中使用 \"yield\" 表达式。" diff --git a/lib/zh-TW/diagnosticMessages.generated.json b/lib/zh-TW/diagnosticMessages.generated.json index 39a6a077fbf..c44acb2bd94 100644 --- a/lib/zh-TW/diagnosticMessages.generated.json +++ b/lib/zh-TW/diagnosticMessages.generated.json @@ -12,9 +12,9 @@ "A_class_member_cannot_have_the_0_keyword_1248": "類別成員不能含有 '{0}' 關鍵字。", "A_comma_expression_is_not_allowed_in_a_computed_property_name_1171": "計算的屬性名稱中不可有逗點運算式。", "A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type_2467": "計算的屬性名稱不得參考其包含類型中的型別參數。", - "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "類別屬性宣告中的計算屬性名稱必須參考型別為常值型別或 'unique symbol' 型別的運算式。", + "A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_1166": "類別屬性宣告中的計算屬性名稱,必須參考類型為常值型別或 'unique symbol' 類型的運算式。", "A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_ty_1168": "方法多載中的計算屬性名稱必須參考型別為常值型別或 'unique symbol' 型別的運算式。", - "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "型別常值中的計算屬性名稱必須參考型別為常值型別或 'unique symbol' 型別的運算式。", + "A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type__1170": "常值型別中的計算屬性名稱,必須參考類型為常值型別或 'unique symbol' 類型的運算式。", "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "環境內容中的計算屬性名稱必須參考型別為常值型別或 'unique symbol' 型別的運算式。", "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "介面中的計算屬性名稱必須參考型別為常值型別或 'unique symbol' 型別的運算式。", "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "計算的屬性名稱必須是 'string'、'number'、'symbol' 或 'any' 類型。", @@ -48,16 +48,18 @@ "A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "命名空間宣告的所在檔案位置,不得與其要合併的類別或函式不同。", "A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "命名空間宣告的位置不得先於其要合併的類別或函式。", "A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235": "只有命名空間或模組才允許命名空間宣告。", + "A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_7038": "命名空間樣式的匯入無法加以呼叫或建構,而且會導致執行階段失敗。", "A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation_2371": "只有函式或建構函式實作才可使用參數初始設定式。", "A_parameter_property_cannot_be_declared_using_a_rest_parameter_1317": "無法使用剩餘參數宣告參數屬性。", "A_parameter_property_is_only_allowed_in_a_constructor_implementation_2369": "建構函式實作中只可有一個參數屬性。", "A_parameter_property_may_not_be_declared_using_a_binding_pattern_1187": "無法使用繫結模式宣告參數屬性。", "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001": "[擴充] 選項中的路徑必須為相對或根路徑,但 '{0}' 並不是。", "A_promise_must_have_a_then_method_1059": "Promise 必須有 'then' 方法。", - "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "型別為 'unique symbol' 型別的類別屬性必須同時為 'static' 與 'readonly'。", - "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "型別為 'unique symbol' 型別的介面或型別常值屬性必須是 'readonly'。", + "A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly_1331": "類型為 'unique symbol' 類型的類別屬性,必須為 'static' 和 'readonly'。", + "A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly_1330": "類型為 'unique symbol' 類型之介面或常值型別的屬性,必須是 'readonly'。", "A_required_parameter_cannot_follow_an_optional_parameter_1016": "必要參數不得接在選擇性參數之後。", "A_rest_element_cannot_contain_a_binding_pattern_2501": "剩餘項目不得包含繫結模式。", + "A_rest_element_cannot_have_a_property_name_2566": "REST 元素不得有屬性名稱。", "A_rest_element_cannot_have_an_initializer_1186": "剩餘項目不得有初始設定式。", "A_rest_element_must_be_last_in_a_destructuring_pattern_2462": "Rest 項目必須保持在解構模式。", "A_rest_parameter_cannot_be_optional_1047": "剩餘參數不得為選擇性參數。", @@ -91,11 +93,12 @@ "Accessibility_modifier_already_seen_1028": "已有存取範圍修飾詞。", "Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher_1056": "只有當目標為 ECMAScript 5 及更高版本時,才可使用存取子。", "Accessors_must_both_be_abstract_or_non_abstract_2676": "存取子必須兩者均為抽象或非抽象。", - "Add_0_to_existing_import_declaration_from_1_90015": "從 \"{1}\" 將 '{0}' 新增至現有的匯入宣告。", - "Add_index_signature_for_property_0_90017": "為屬性 '{0}' 新增索引簽章。", - "Add_missing_super_call_90001": "新增遺漏的 'super()' 呼叫。", - "Add_this_to_unresolved_variable_90008": "將 'this.' 新增到未經解析的變數。", - "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__90009": "新增 tsconfig.json 檔案有助於組織同時包含 TypeScript 及 JavaScript 檔案的專案。如需深入了解,請參閱 https://aka.ms/tsconfig。", + "Add_0_to_existing_import_declaration_from_1_90015": "從 \"{1}\" 將 '{0}' 新增至現有的匯入宣告", + "Add_async_modifier_to_containing_function_90029": "將 async 修飾詞新增至包含的函式", + "Add_index_signature_for_property_0_90017": "為屬性 '{0}' 新增索引簽章", + "Add_missing_super_call_90001": "新增遺漏的 'super()' 呼叫", + "Add_this_to_unresolved_variable_90008": "將 'this' 新增至未解析的變數", + "Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript__5068": "新增 tsconfig.json 檔案有助於組織同時包含 TypeScript 及 JavaScript 檔案的專案。若要深入了解,請前往 https://aka.ms/tsconfig。", "Additional_Checks_6176": "其他檢查", "Advanced_Options_6178": "進階選項", "All_declarations_of_0_must_have_identical_modifiers_2687": "'{0}' 的所有宣告都必須有相同修飾詞。", @@ -136,6 +139,8 @@ "An_index_signature_parameter_cannot_have_an_accessibility_modifier_1018": "索引簽章參數不得有存取範圍修飾詞。", "An_index_signature_parameter_cannot_have_an_initializer_1020": "索引簽章參數不得有初始設定式。", "An_index_signature_parameter_must_have_a_type_annotation_1022": "索引簽章參數必須有類型註釋。", + "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336": "索引簽章參數類型不能是類型別名。請考慮改為撰寫 '[{0}: {1}]: {2}'。", + "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337": "索引簽章參數類型不能是等位型別。請考慮改用對應的物件類型。", "An_index_signature_parameter_type_must_be_string_or_number_1023": "索引簽章參數類型必須是 'string' 或 'number'。", "An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499": "介面只能擴充具有選擇性型別引數的識別碼/限定名稱。", "An_interface_may_only_extend_a_class_or_another_interface_2312": "每個介面只可擴充一個類別或另一個介面。", @@ -165,7 +170,7 @@ "Binary_digit_expected_1177": "必須是二進位數字。", "Binding_element_0_implicitly_has_an_1_type_7031": "繫結元素 '{0}' 隱含擁有 '{1}' 類型。", "Block_scoped_variable_0_used_before_its_declaration_2448": "已在其宣告之前使用區塊範圍變數 '{0}'。", - "Call_decorator_expression_90028": "呼叫裝飾項目運算式。", + "Call_decorator_expression_90028": "呼叫裝飾項目運算式", "Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type_7020": "缺少傳回型別註解的呼叫簽章隱含了 'any' 傳回型別。", "Call_target_does_not_contain_any_signatures_2346": "呼叫目標未包含任何特徵標記。", "Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_p_2713": "因為 '{0}' 是類型而非命名空間,所以無法存取 '{0}.{1}'。您要在 '{0}' 中使用 '{0}[\"{1}\"]' 擷取屬性 '{1}' 的類型嗎?", @@ -196,6 +201,9 @@ "Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1_6137": "無法匯入型別宣告檔案。請考慮匯入 '{0}' 而不是 '{1}'。", "Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1_2481": "無法初始化區塊範圍宣告 '{1}' 之同一範圍中的外部範圍變數 '{0}'。", "Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatur_2349": "無法叫用類型缺少呼叫簽章的運算式。類型 '{0}' 不含相容的呼叫簽章。", + "Cannot_invoke_an_object_which_is_possibly_null_2721": "無法叫用可能為 'null' 的物件。", + "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723": "無法叫用可能為 'null' 或 'undefined' 的物件。", + "Cannot_invoke_an_object_which_is_possibly_undefined_2722": "無法叫用可能為 'undefined' 的物件。", "Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided_1205": "如有提供 '--isolatedModules' 旗標,即無法重新匯出類型。", "Cannot_read_file_0_Colon_1_5012": "無法讀取檔案 '{0}': {1}。", "Cannot_redeclare_block_scoped_variable_0_2451": "無法重新宣告區塊範圍變數 '{0}'。", @@ -210,9 +218,9 @@ "Cannot_write_file_0_because_it_would_overwrite_input_file_5055": "無法寫入檔案 '{0}',原因是其會覆寫輸入檔。", "Catch_clause_variable_cannot_have_a_type_annotation_1196": "Catch 子句變數不得有類型註釋。", "Catch_clause_variable_cannot_have_an_initializer_1197": "Catch 子句變數不得有初始設定式。", - "Change_0_to_1_90014": "將 '{0}' 變更為 '{1}'。", - "Change_extends_to_implements_90003": "將 'extends' 變更為 'implements'。", - "Change_spelling_to_0_90022": "將拼字變更為 '{0}'。", + "Change_0_to_1_90014": "將 '{0}' 變更為 '{1}'", + "Change_extends_to_implements_90003": "將 [延伸] 變更至 [實作]5D;", + "Change_spelling_to_0_90022": "將拼字變更為 '{0}'", "Checking_if_0_is_the_longest_matching_prefix_for_1_2_6104": "檢查 '{0}' 是否為 '{1}' - '{2}' 的最長相符前置詞。", "Circular_definition_of_import_alias_0_2303": "匯入別名 '{0}' 的循環定義。", "Circularity_detected_while_resolving_configuration_Colon_0_18000": "解析組態時偵測到循環性: {0}", @@ -221,6 +229,7 @@ "Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_proper_2424": "類別 '{0}' 已定義執行個體成員函式 '{1}',但是擴充類別 '{2}' 卻將其定義為執行個體成員屬性。", "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_functi_2425": "類別 '{0}' 已定義執行個體成員屬性 '{1}',但是擴充類別 '{2}' 卻將其定義為執行個體成員函式。", "Class_0_incorrectly_extends_base_class_1_2415": "類別 '{0}' 不正確地擴充基底類別 '{1}'。", + "Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclas_2720": "類別 '{0}' 不當實作類別 '{1}'。您是否要擴充 '{1}',並繼承其成員以成為子類別?", "Class_0_incorrectly_implements_interface_1_2420": "類別 '{0}' 不正確地實作介面 '{1}'。", "Class_0_used_before_its_declaration_2449": "類別 '{0}' 的位置在其宣告之前。", "Class_declarations_cannot_have_more_than_one_augments_or_extends_tag_8025": "類別宣告只可有一個 '@augments' 或 '@extends' 標記。", @@ -245,6 +254,7 @@ "Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_mod_6126": "未指定包含檔案,因此無法決定根目錄,而將略過 'node_modules' 中的查閱。", "Convert_function_0_to_class_95002": "將函式 '{0}' 轉換為類別", "Convert_function_to_an_ES2015_class_95001": "將函式轉換為 ES2015 類別", + "Convert_to_ES6_module_95017": "轉換為 ES6 模組", "Convert_to_default_import_95013": "轉換為預設匯入", "Corrupted_locale_file_0_6051": "地區設定檔 {0} 已損毀。", "Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type_7016": "找不到模組 '{0}' 的宣告檔案。'{1}' 隱含具有 'any' 類型。", @@ -253,10 +263,10 @@ "Declaration_expected_1146": "必須是宣告。", "Declaration_name_conflicts_with_built_in_global_identifier_0_2397": "宣告名稱與內建全域識別碼 '{0}' 衝突。", "Declaration_or_statement_expected_1128": "必須是宣告或陳述式。", - "Declare_method_0_90023": "宣告方法 '{0}'。", - "Declare_property_0_90016": "宣告屬性 '{0}'。", - "Declare_static_method_0_90024": "宣告靜態方法 '{0}'。", - "Declare_static_property_0_90027": "宣告靜態屬性 '{0}'。", + "Declare_method_0_90023": "宣告方法 '{0}'", + "Declare_property_0_90016": "宣告屬性 '{0}'", + "Declare_static_method_0_90024": "宣告靜態方法 '{0}'", + "Declare_static_property_0_90027": "宣告靜態屬性 '{0}'", "Decorators_are_not_valid_here_1206": "裝飾項目在此處無效。", "Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "無法將裝飾項目套用至多個同名的 get/set 存取子。", "Default_export_of_the_module_has_or_is_using_private_name_0_4082": "模組的預設匯出具有或正在使用私用名稱 '{0}'。", @@ -265,7 +275,7 @@ "Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files_6160": "[即將淘汰] 請改用 '--skipLibCheck'。跳過預設程式庫宣告檔案的類型檢查。", "Digit_expected_1124": "必須是數字。", "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148": "目錄 '{0}' 不存在,將會跳過其中所有查閱。", - "Disable_checking_for_this_file_90018": "停用此檔案的檢查。", + "Disable_checking_for_this_file_90018": "停用此檔案的檢查", "Disable_size_limitations_on_JavaScript_projects_6162": "停用 JavaScript 專案的大小限制。", "Disable_strict_checking_of_generic_signatures_in_function_types_6185": "停用函式類型中一般簽章的 Strict 檢查。", "Disallow_inconsistently_cased_references_to_the_same_file_6078": "不允許相同檔案大小寫不一致的參考。", @@ -309,6 +319,7 @@ "Enable_strict_checking_of_property_initialization_in_classes_6187": "啟用類別中屬性初始化的 strict 檢查。", "Enable_strict_null_checks_6113": "啟用嚴格 null 檢查。", "Enable_tracing_of_the_name_resolution_process_6085": "啟用名稱解析流程的追蹤。", + "Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for__7037": "透過為所有匯入建立命名空間物件,讓 CommonJS 和 ES 模組之間的產出有互通性。意指 'allowSyntheticDefaultImports'。", "Enables_experimental_support_for_ES7_async_functions_6068": "啟用 ES7 非同步函式的實驗支援。", "Enables_experimental_support_for_ES7_decorators_6065": "啟用 ES7 裝飾項目的實驗支援。", "Enables_experimental_support_for_emitting_type_metadata_for_decorators_6066": "啟用實驗支援以發出裝飾項目類型的中繼資料。", @@ -348,11 +359,10 @@ "Expression_or_comma_expected_1137": "必須是運算式或逗號。", "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402": "運算式會解析成 '_super',而編譯器會使用其來擷取基底類別參考。", "Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions_2521": "運算式會解析成變數宣告 '{0}',而編譯器會使用此宣告支援非同步函式。", - "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544": "運算式解析成編譯器用來擷取 'new.target' 中繼屬性參考的變數宣告 '_newTarget'。", + "Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta__2544": "運算式將解析成變數宣告 '_newTarget',而供編譯器用來擷取 'new.target' 中繼屬性參考。", "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400": "運算式會解析成變數宣告 '_this',而編譯器會使用此宣告來擷取 'this' 參考 。", "Extract_constant_95006": "解壓縮常數", "Extract_function_95005": "解壓縮函式", - "Extract_symbol_95003": "解壓縮符號", "Extract_to_0_in_1_95004": "解壓縮至 {1} 中的 {0}", "Extract_to_0_in_1_scope_95008": "解壓縮至 {1} 範圍中的 {0}", "Extract_to_0_in_enclosing_scope_95007": "解壓縮至封閉式範圍中的 {0}", @@ -371,9 +381,9 @@ "File_name_0_differs_from_already_included_file_name_1_only_in_casing_1149": "檔案名稱 '{0}' 與包含的檔案名稱 '{1}' 只差在大小寫。", "File_name_0_has_a_1_extension_stripping_it_6132": "檔案名稱 '{0}' 的副檔名為 '{1}'。正予以移除。", "File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildca_5065": "檔案規格不得包含出現在遞迴目錄萬用字元 ('**') 之後的父目錄 ('..'): '{0}'。", - "File_specification_cannot_contain_multiple_recursive_directory_wildcards_Asterisk_Asterisk_Colon_0_5011": "檔案規格不能包含多個遞迴目錄萬用字元 ('**'): '{0}'。", "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010": "檔案規格不能以遞迴目錄萬用字元 ('**') 結尾: '{0}'。", "Found_package_json_at_0_6099": "在 '{0}' 找到 'package.json'。", + "Found_package_json_at_0_Package_ID_is_1_6190": "於 '{0}' 找到 'package.json'。套件識別碼為 '{1}'。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250": "以 'ES3' 或 'ES5' 為目標時,strict 模式下的區塊中不允許函式宣告。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251": "以 'ES3' 或 'ES5' 為目標時,strict 模式下的區塊中不允許函式宣告。類別定義會自動進入 strict 模式。", "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252": "以 'ES3' 或 'ES5' 為目標時,strict 模式下的區塊中不允許函式宣告。模組會自動進入 strict 模式。", @@ -404,11 +414,11 @@ "Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode_1214": "需要識別碼。'{0}' 是 strict 模式中的保留字。模組會自動採用 strict 模式。", "Identifier_expected_1003": "必須是識別碼。", "Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules_1216": "必須有識別碼。'__esModule' 已保留為轉換 ECMAScript 模組時匯出的標記。", - "Ignore_this_error_message_90019": "忽略此錯誤訊息。", - "Implement_inherited_abstract_class_90007": "實作已繼承的抽象類別。", - "Implement_interface_0_90006": "實作介面 '{0}'。", + "Ignore_this_error_message_90019": "略過此錯誤訊息", + "Implement_inherited_abstract_class_90007": "實作已繼承的抽象類別", + "Implement_interface_0_90006": "實作介面 '{0}'", "Implements_clause_of_exported_class_0_has_or_is_using_private_name_1_4019": "匯出類別 '{0}' 的 Implements 子句具有或使用私用名稱 '{1}'。", - "Import_0_from_module_1_90013": "從模組 \"{1}\" 匯入 '{0}'。", + "Import_0_from_module_1_90013": "從模組 \"{1}\" 匯入 '{0}'", "Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_1202": "當目標為 ECMAScript 模組時,無法使用匯入指派。請考慮改用 'import * as ns from \"mod\"'、'import {a} from \"mod\"'、'import d from \"mod\"' 或其他模組格式。", "Import_declaration_0_is_using_private_name_1_4000": "匯入宣告 '{0}' 使用私用名稱 '{1}'。", "Import_declaration_conflicts_with_local_declaration_of_0_2440": "匯入宣告與 '{0}' 的區域宣告衝突。", @@ -424,10 +434,10 @@ "Index_signature_is_missing_in_type_0_2329": "類型 '{0}' 中遺漏索引簽章。", "Index_signatures_are_incompatible_2330": "索引簽章不相容。", "Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local_2395": "合併宣告 '{0}' 中的個別宣告必須全部匯出或全在本機上。", - "Infer_parameter_types_from_usage_95012": "從用法推斷參數類型。", - "Infer_type_of_0_from_usage_95011": "從用法推斷 '{0}' 的類型。", - "Initialize_property_0_in_the_constructor_90020": "初始化建構函式中的屬性 '{0}'。", - "Initialize_static_property_0_90021": "初始化靜態屬性 '{0}'。", + "Infer_parameter_types_from_usage_95012": "從使用方式推斷參數類型", + "Infer_type_of_0_from_usage_95011": "從使用方式推斷 '{0}' 的類型", + "Initialize_property_0_in_the_constructor_90020": "將建構函式中的屬性 '{0}' 初始化", + "Initialize_static_property_0_90021": "將靜態屬性 '{0}' 初始化", "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301": "執行個體成員變數 '{0}' 的初始設定式不得參考建構函式中所宣告的識別碼 '{1}'。", "Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it_2373": "參數 '{0}' 的初始設定式不得參考在其之後宣告的識別碼 '{1}'。", "Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value_2525": "初始設定式未提供任何值給這個繫結項目,且該繫結項目沒有預設值。", @@ -484,7 +494,8 @@ "Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1_6048": "地區設定的格式必須是 <語言> 或 <語言>-<國家/地區>。例如 '{0}' 或 '{1}'。", "Longest_matching_prefix_for_0_is_1_6108": "符合 '{0}' 的前置詞最長為 '{1}'。", "Looking_up_in_node_modules_folder_initial_location_0_6125": "目前正在 'node_modules' 資料夾中查詢,初始位置為 '{0}'。", - "Make_super_call_the_first_statement_in_the_constructor_90002": "使 'super()' 呼叫成為建構函式中的第一個陳述式。", + "Make_super_call_the_first_statement_in_the_constructor_90002": "使 'super()' 呼叫成為建構函式中的第一個陳述式", + "Mapped_object_type_implicitly_has_an_any_template_type_7039": "對應的物件類型隱含具有 'any' 範本類型。", "Member_0_implicitly_has_an_1_type_7008": "成員 '{0}' 隱含了 '{1}' 類型。", "Merge_conflict_marker_encountered_1185": "偵測到合併衝突標記。", "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652": "合併宣告 '{0}' 不得包含預設匯出宣告。請考慮改為加入獨立型 'export default {0}' 宣告。", @@ -508,6 +519,7 @@ "Module_name_0_was_successfully_resolved_to_1_6089": "======== 模組名稱 '{0}' 已成功解析為 '{1}'。========", "Module_resolution_kind_is_not_specified_using_0_6088": "未指定模組解析種類,將使用 '{0}'。", "Module_resolution_using_rootDirs_has_failed_6111": "使用 'rootDirs' 解析模組失敗。", + "Multiple_consecutive_numeric_separators_are_not_permitted_6189": "不允許多個連續的數字分隔符號。", "Multiple_constructor_implementations_are_not_allowed_2392": "不允許多個建構函式實作。", "NEWLINE_6061": "新行", "Named_property_0_of_types_1_and_2_are_not_identical_2319": "類型 '{1}' 及 '{2}' 的具名屬性 '{0}' 不一致。", @@ -518,6 +530,7 @@ "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653": "非抽象類別運算式未實作從類別 '{1}' 繼承而來的抽象成員 '{0}'。", "Not_all_code_paths_return_a_value_7030": "部分程式碼路徑並未傳回值。", "Numeric_index_type_0_is_not_assignable_to_string_index_type_1_2413": "數值索引類型 '{0}' 不可指派給字串索引類型 '{1}'。", + "Numeric_separators_are_not_allowed_here_6188": "這裡不允許數字分隔符號。", "Object_is_possibly_null_2531": "物件可能為「null」。", "Object_is_possibly_null_or_undefined_2533": "物件可能為「null」或「未定義」。", "Object_is_possibly_undefined_2532": "物件可能為「未定義」。", @@ -534,6 +547,7 @@ "Only_a_void_function_can_be_called_with_the_new_keyword_2350": "只有 void 函式可以使用 'new' 關鍵字進行呼叫。", "Only_ambient_modules_can_use_quoted_names_1035": "只有環境模組可以使用括以引號的名稱。", "Only_amd_and_system_modules_are_supported_alongside_0_6082": "只有 'amd' 與 'system' 模組連同受支援 --{0}。", + "Only_emit_d_ts_declaration_files_6014": "只發出 '.d.ts' 宣告檔案。", "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002": "類別 'extends' 子句中,目前只支援具有選擇性型別引數的識別碼/限定名稱。", "Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword_2340": "只有基底類別之公開且受保護的方法,才可透過 'super' 關鍵字存取。", "Operator_0_cannot_be_applied_to_types_1_and_2_2365": "無法將運算子 '{0}' 套用至類型 '{1}' 和 '{2}'。", @@ -584,18 +598,19 @@ "Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1_4035": "匯出類別中公用靜態 setter '{0}' 的參數類型具有或正在使用私用名稱 '{1}'。", "Parse_in_strict_mode_and_emit_use_strict_for_each_source_file_6141": "在 strict 模式中進行剖析,並為每個來源檔案發出 \"use strict\"。", "Pattern_0_can_have_at_most_one_Asterisk_character_5061": "模式 '{0}' 最多只可有一個 '*' 字元。", - "Prefix_0_with_an_underscore_90025": "有底線的前置詞 '{0}'。", + "Prefix_0_with_an_underscore_90025": "具有底線的前置詞 '{0}'", "Print_names_of_files_part_of_the_compilation_6155": "列印編譯時檔案部分的名稱。", "Print_names_of_generated_files_part_of_the_compilation_6154": "列印編譯時所產生之檔案部分的名稱。", "Print_the_compiler_s_version_6019": "列印編譯器的版本。", "Print_this_message_6017": "列印這則訊息。", - "Property_0_does_not_exist_on_const_enum_1_2479": "'const' 列舉 '{1}' 沒有屬性 '{0}'。", + "Property_0_does_not_exist_on_const_enum_1_2479": "'const' 列舉 '{1}' 上並沒有屬性 '{0}'。", "Property_0_does_not_exist_on_type_1_2339": "類型 '{1}' 沒有屬性 '{0}'。", "Property_0_does_not_exist_on_type_1_Did_you_mean_2_2551": "類型 '{1}' 沒有屬性 '{0}'。您指的是 '{2}' 嗎?", "Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1_2546": "屬性 '{0}' 有衝突的宣告,在類型 '{1}' 中無法存取。", "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564": "屬性 '{0}' 沒有初始設定式,且未在建構函式中明確指派。", "Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation_7033": "因為屬性 '{0}' 的 get 存取子沒有傳回類型註釋,致使該屬性意味著類型 'any'。", "Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation_7032": "因為屬性 '{0}' 的 set 存取子沒有參數類型註釋,致使該屬性意味著類型 'any'。", + "Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2_2416": "類型 '{1}' 中的屬性 '{0}' 無法指派給基底類型 '{2}' 中的相同屬性。", "Property_0_in_type_1_is_not_assignable_to_type_2_2603": "不得將類型 '{1}' 的屬性 '{0}' 指派給類型 '{2}'。", "Property_0_is_declared_but_its_value_is_never_read_6138": "屬性 '{0}' 已宣告但從未讀取其值。", "Property_0_is_incompatible_with_index_signature_2530": "屬性 '{0}' 和索引簽章不相容。", @@ -634,7 +649,8 @@ "Raise_error_on_expressions_and_declarations_with_an_implied_any_type_6052": "當運算式及宣告包含隱含的 'any' 類型時顯示錯誤。", "Raise_error_on_this_expressions_with_an_implied_any_type_6115": "對具有隱含 'any' 類型的 'this' 運算式引發錯誤。", "Redirect_output_structure_to_the_directory_6006": "將輸出結構重新導向至目錄。", - "Remove_declaration_for_Colon_0_90004": "移除 {0} 的宣告。", + "Remove_declaration_for_Colon_0_90004": "移除 '{0}' 的宣告", + "Replace_import_with_0_95015": "以 '{0}' 取代匯入。", "Report_error_when_not_all_code_paths_in_function_return_a_value_6075": "當函式中的部分程式碼路徑並未傳回值時回報錯誤。", "Report_errors_for_fallthrough_cases_in_switch_statement_6076": "回報 switch 陳述式內 fallthrough 案例的錯誤。", "Report_errors_in_js_files_8019": "報告 .js 檔案中的錯誤。", @@ -680,7 +696,7 @@ "Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0_4052": "匯出類別中公用靜態方法的傳回型別具有或使用私用名稱 '{0}'。", "Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program_6184": "因為舊程式中的解決方案並無任何變更,所以會重複使用 '{0}' 中的模組解決方案。", "Reusing_resolution_of_module_0_to_file_1_from_old_program_6183": "對檔案 '{1}' 重複用舊程式中模組 '{0}' 的解決方案。", - "Rewrite_as_the_indexed_access_type_0_90026": "重寫為索引存取類型 '{0}'。", + "Rewrite_as_the_indexed_access_type_0_90026": "重寫為索引存取類型 '{0}'", "Root_directory_cannot_be_determined_skipping_primary_search_paths_6122": "無法判斷根目錄,將略過主要搜尋路徑。", "STRATEGY_6039": "策略", "Scoped_package_detected_looking_in_0_6182": "偵測到範圍套件,正於 '{0}' 尋找", @@ -693,9 +709,9 @@ "Source_Map_Options_6175": "來源對應選項", "Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature_2382": "特製化的多載簽章不可指派給任何非特製化的簽章。", "Specifier_of_dynamic_import_cannot_be_spread_element_1325": "動態匯入的指定名稱不能是展開元素。", - "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_or_ESNEXT_6015": "指定 ECMAScript 目標版本: 'ES3' (預設)、'ES5'、'ES2015'、'ES2016'、'ES2017' 或 'ESNEXT'。", + "Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT_6015": "指定 ECMAScript 目標版本: 'ES3' (預設)、'ES5'、'ES2015'、'ES2016'、'ES2017'、'ES2018' 或 'ESNEXT'。", "Specify_JSX_code_generation_Colon_preserve_react_native_or_react_6080": "指定 JSX 程式碼產生: 'preserve'、'react-native' 或 'react'。", - "Specify_library_files_to_be_included_in_the_compilation_Colon_6079": "指定編譯內要包含的程式庫檔: ", + "Specify_library_files_to_be_included_in_the_compilation_6079": "請指定要併入編譯中的程式庫檔案。", "Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext_6016": "指定模組程式碼產生: 'none'、'commonjs'、'amd'、'system'、'umd'、'es2015' 或 'ESNext'。", "Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6_6069": "指定模組解決方案策略: 'node' (Node.js) 或 'classic' (TypeScript 1.6 前)。", "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146": "請指定要在以 'react' JSX 發出為目標時使用的 JSX factory 函式。例如 'React.createElement' 或 'h'。", @@ -705,6 +721,7 @@ "Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir_6058": "指定輸入檔案的根目錄。用以控制具有 --outDir 的輸出目錄結構。", "Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher_2472": "只有當目標為 ECMAScript 5 及更高版本時,才可使用 'new' 運算式中的擴張運算子。", "Spread_types_may_only_be_created_from_object_types_2698": "Spread 類型只能從物件類型建立。", + "Starting_compilation_in_watch_mode_6031": "在監看模式中開始編譯...", "Statement_expected_1129": "必須是陳述式。", "Statements_are_not_allowed_in_ambient_contexts_1036": "環境內容中不得有陳述式。", "Static_members_cannot_reference_class_type_parameters_2302": "靜態成員不得參考類別類型參數。", @@ -712,8 +729,8 @@ "Strict_Type_Checking_Options_6173": "Strict 類型檢查選項", "String_literal_expected_1141": "必須是字串常值。", "String_literal_with_double_quotes_expected_1327": "應有具雙引號的字串常值。", - "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "使用色彩及內容設計錯誤與訊息的風格 (實驗)。", - "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "Subsequent property declarations must have the same type. Property '{0}' must be of type '{1}', but here has type '{2}'.", + "Stylize_errors_and_messages_using_color_and_context_experimental_6073": "使用色彩及內容來設計錯誤與訊息的風格 (實驗)。", + "Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_t_2717": "後續的屬性宣告必須具有相同的類型。屬性 '{0}' 的類型必須是 '{1}',但此處卻是類型 '{2}'。", "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403": "後續的變數宣告必須具有相同的類型。變數 '{0}' 的類型必須是 '{1}' 但卻是 '{2}'。", "Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2_5064": "模式 '{1}' 的替代 '{0}' 類型不正確,必須為 'string',但得到 '{2}'。", "Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character_5062": "模式 '{1}' 中的替代 '{0}' 最多只可有一個 '*' 字元。", @@ -797,7 +814,7 @@ "Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns__2549": "類型 '{0}' 不是陣列類型或字串類型,或沒有會傳回迭代器的 '[Symbol.iterator]()' 方法。", "Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator_2548": "類型 '{0}' 不是陣列類型,或沒有會傳回迭代器的 '[Symbol.iterator]()' 方法。", "Type_0_is_not_assignable_to_type_1_2322": "類型 '{0}' 不可指派給類型 '{1}'。", - "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_90010": "無法將類型 '{0}' 指派給類型 '{1}'。有兩種使用此名稱的不同類型存在,但彼此並不相關。", + "Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated_2719": "無法將類型 '{0}' 指派給類型 '{1}'。有兩種使用此名稱的不同類型存在,但彼此並不相關。", "Type_0_is_not_comparable_to_type_1_2678": "類型 '{0}' 無法和類型 '{1}' 比較。", "Type_0_is_not_generic_2315": "'{0}' 不是泛型類型。", "Type_0_provides_no_match_for_the_signature_1_2658": "類型 '{0}' 沒有符合特徵標記 '{1}' 的項目。", @@ -858,6 +875,7 @@ "Unterminated_template_literal_1160": "未結束的樣板常值。", "Untyped_function_calls_may_not_accept_type_arguments_2347": "不具類型的函式呼叫無法接受類型引數。", "Unused_label_7028": "未使用的標籤。", + "Use_synthetic_default_member_95016": "使用綜合 'default' 成員。", "Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher_2494": "只有在 ECMAScript 5 及更高版本中,才可在 'for...of' 陳述式中使用字串。", "VERSION_6036": "版本", "Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it_2560": "類型為 '{0}' 的值與類型 '{1}' 沒有任何共通的屬性。確定要呼叫嗎?", @@ -909,13 +927,13 @@ "can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment_1312": "'=' 僅能在解構指派內的物件常值屬性中使用。", "case_or_default_expected_1130": "必須是 'case' 或 'default'。", "class_expressions_are_not_currently_supported_9003": "目前不支援 'class' 運算式。", - "const_declarations_can_only_be_declared_inside_a_block_1156": "只可在區塊內宣告 'const' 宣告。", - "const_declarations_must_be_initialized_1155": "'const' 宣告必須初始化 。", + "const_declarations_can_only_be_declared_inside_a_block_1156": "只能在區塊內宣告 'const' 宣告。", + "const_declarations_must_be_initialized_1155": "'const' 宣告必須初始化。", "const_enum_member_initializer_was_evaluated_to_a_non_finite_value_2477": "'const' 列舉成員初始設定式已評估為非有限值。", "const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN_2478": "'const' 列舉成員初始設定式已評估為不允許的值 'NaN'。", - "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 列舉只可用於屬性或索引存取運算式中,或者用於匯入宣告或匯出指派的右側 。", + "const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_im_2475": "'const' 列舉只可用於屬性或索引存取運算式中,或用於匯入宣告、匯出指派或類型查詢的右側。", "delete_cannot_be_called_on_an_identifier_in_strict_mode_1102": "不得在 strict 模式中對識別碼呼叫 'delete'。", - "enum_declarations_can_only_be_used_in_a_ts_file_8015": "'enum declarations' 只可用於 .ts 檔案中。", + "enum_declarations_can_only_be_used_in_a_ts_file_8015": "「列舉宣告」只可用於 .ts 檔案中。", "export_can_only_be_used_in_a_ts_file_8003": "'export=' 只可用於 .ts 檔案中。", "export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always__2668": "'export' 修飾詞無法套用至環境模組或模組增強指定,原因是這二者永遠會顯示。", "extends_clause_already_seen_1172": "已經有 'extends' 子句。", @@ -928,6 +946,7 @@ "implements_clause_already_seen_1175": "已經有 'implements' 子句。", "implements_clauses_can_only_be_used_in_a_ts_file_8005": "'implements clauses' 只可用於 .ts 檔案中。", "import_can_only_be_used_in_a_ts_file_8002": "'import ... =' 只可用於 .ts 檔案中。", + "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "只允許在條件式類型的 'extends' 子句中使用 'infer' 宣告。", "interface_declarations_can_only_be_used_in_a_ts_file_8006": "'interface declarations' 只可用於 .ts 檔案中。", "let_declarations_can_only_be_declared_inside_a_block_1157": "只能在區塊內宣告 'let' 宣告。", "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "'let' 或 'const' 宣告中不得使用 'let' 作為名稱。", From dd47f2492bdcf001d62243766778c79357a5ce22 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 21 Feb 2018 10:02:34 -0800 Subject: [PATCH 190/298] getSemanticDocumentHighlights: Use `toMultiMap` helper (#22059) * getSemanticDocumentHighlights: Use `toMultiMap` helper * Rename to arrayToMultiMap and follow pattern of arrayToMap and arrayToNumericMap --- src/compiler/core.ts | 34 ++++++++++++++++++------------ src/services/documentHighlights.ts | 20 ++++-------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 698824fa9b0..ecf667237c5 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1333,20 +1333,20 @@ namespace ts { */ export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string): Map; export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string, makeValue: (value: T) => U): Map; - export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string, makeValue?: (value: T) => U): Map { + export function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string, makeValue: (value: T) => T | U = identity): Map { const result = createMap(); for (const value of array) { - result.set(makeKey(value), makeValue ? makeValue(value) : value); + result.set(makeKey(value), makeValue(value)); } return result; } export function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number): T[]; - export function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number, makeValue: (value: T) => V): V[]; - export function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number, makeValue?: (value: T) => V): V[] { - const result: V[] = []; + export function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number, makeValue: (value: T) => U): U[]; + export function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number, makeValue: (value: T) => T | U = identity): (T | U)[] { + const result: (T | U)[] = []; for (const value of array) { - result[makeKey(value)] = makeValue ? makeValue(value) : value as any as V; + result[makeKey(value)] = makeValue(value); } return result; } @@ -1362,6 +1362,20 @@ namespace ts { return arrayToMap(array, makeKey || (s => s), () => true); } + export function arrayToMultiMap(values: ReadonlyArray, makeKey: (value: T) => string): MultiMap; + export function arrayToMultiMap(values: ReadonlyArray, makeKey: (value: T) => string, makeValue: (value: T) => U): MultiMap; + export function arrayToMultiMap(values: ReadonlyArray, makeKey: (value: T) => string, makeValue: (value: T) => T | U = identity): MultiMap { + const result = createMultiMap(); + for (const value of values) { + result.add(makeKey(value), makeValue(value)); + } + return result; + } + + export function group(values: ReadonlyArray, getGroupId: (value: T) => string): ReadonlyArray> { + return arrayFrom(arrayToMultiMap(values, getGroupId).values()); + } + export function cloneMap(map: SymbolTable): SymbolTable; export function cloneMap(map: ReadonlyMap): Map; export function cloneMap(map: ReadonlyUnderscoreEscapedMap): UnderscoreEscapedMap; @@ -1438,14 +1452,6 @@ namespace ts { } } - export function group(values: ReadonlyArray, getGroupId: (value: T) => string): ReadonlyArray> { - const groupIdToGroup = createMultiMap(); - for (const value of values) { - groupIdToGroup.add(getGroupId(value), value); - } - return arrayFrom(groupIdToGroup.values()); - } - /** * Tests whether a value is an array. */ diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts index dd5281f15bc..6d3094fc190 100644 --- a/src/services/documentHighlights.ts +++ b/src/services/documentHighlights.ts @@ -21,23 +21,11 @@ namespace ts.DocumentHighlights { }; } - function getSemanticDocumentHighlights(position: number, node: Node, program: Program, cancellationToken: CancellationToken, sourceFilesToSearch: ReadonlyArray): DocumentHighlights[] { + function getSemanticDocumentHighlights(position: number, node: Node, program: Program, cancellationToken: CancellationToken, sourceFilesToSearch: ReadonlyArray): DocumentHighlights[] | undefined { const referenceEntries = FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken); - return referenceEntries && convertReferencedSymbols(referenceEntries); - } - - function convertReferencedSymbols(referenceEntries: ReadonlyArray): DocumentHighlights[] { - const fileNameToDocumentHighlights = createMap(); - for (const entry of referenceEntries) { - const { fileName, span } = FindAllReferences.toHighlightSpan(entry); - let highlightSpans = fileNameToDocumentHighlights.get(fileName); - if (!highlightSpans) { - fileNameToDocumentHighlights.set(fileName, highlightSpans = []); - } - highlightSpans.push(span); - } - - return arrayFrom(fileNameToDocumentHighlights.entries(), ([fileName, highlightSpans ]) => ({ fileName, highlightSpans })); + if (!referenceEntries) return undefined; + const map = arrayToMultiMap(referenceEntries.map(FindAllReferences.toHighlightSpan), e => e.fileName, e => e.span); + return arrayFrom(map.entries(), ([fileName, highlightSpans]) => ({ fileName, highlightSpans })); } function getSyntacticDocumentHighlights(node: Node, sourceFile: SourceFile): DocumentHighlights[] { From dda4bd0d0b47bac0edf2c2626c0ccffb67e22b30 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 21 Feb 2018 10:03:02 -0800 Subject: [PATCH 191/298] fixClassDoesnotImplementInheritedAbstractMember: Don't perform fix for same class twice (#22073) --- ...ssDoesntImplementInheritedAbstractMember.ts | 18 +++++++++++------- .../fixClassIncorrectlyImplementsInterface.ts | 4 +--- .../codeFixClassExtendAbstractMethod_all.ts | 8 ++++++++ .../codeFixClassImplementInterface_all.ts | 1 - 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts b/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts index da3685339ab..786d61d798d 100644 --- a/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts +++ b/src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts @@ -14,18 +14,22 @@ namespace ts.codefix { return changes.length === 0 ? undefined : [{ description: getLocaleSpecificMessage(Diagnostics.Implement_inherited_abstract_class), changes, fixId }]; }, fixIds: [fixId], - getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => { - addMissingMembers(getClass(diag.file!, diag.start!), context.sourceFile, context.program.getTypeChecker(), changes); - }), + getAllCodeActions: context => { + const seenClassDeclarations = createMap(); + return codeFixAll(context, errorCodes, (changes, diag) => { + const classDeclaration = getClass(diag.file!, diag.start!); + if (addToSeen(seenClassDeclarations, getNodeId(classDeclaration))) { + addMissingMembers(classDeclaration, context.sourceFile, context.program.getTypeChecker(), changes); + } + }); + }, }); function getClass(sourceFile: SourceFile, pos: number): ClassLikeDeclaration { - // This is the identifier in the case of a class declaration + // Token is the identifier in the case of a class declaration // or the class keyword token in the case of a class expression. const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); - const classDeclaration = token.parent; - Debug.assert(isClassLike(classDeclaration)); - return classDeclaration as ClassLikeDeclaration; + return cast(token.parent, isClassLike); } function addMissingMembers(classDeclaration: ClassLikeDeclaration, sourceFile: SourceFile, checker: TypeChecker, changeTracker: textChanges.ChangeTracker): void { diff --git a/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts b/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts index 0236b0c79b7..c295d4fb3c7 100644 --- a/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts +++ b/src/services/codefixes/fixClassIncorrectlyImplementsInterface.ts @@ -31,9 +31,7 @@ namespace ts.codefix { }); function getClass(sourceFile: SourceFile, pos: number): ClassLikeDeclaration { - const classDeclaration = getContainingClass(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false)); - Debug.assert(!!classDeclaration); - return classDeclaration!; + return Debug.assertDefined(getContainingClass(getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false))); } function addMissingDeclarations( diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts index 9521173ad89..b158a215ca1 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethod_all.ts @@ -2,6 +2,7 @@ ////abstract class A { //// abstract m(): void; +//// abstract n(): void; ////} ////class B extends A {} ////class C extends A {} @@ -11,15 +12,22 @@ verify.codeFixAll({ newFileContent: `abstract class A { abstract m(): void; + abstract n(): void; } class B extends A { m(): void { throw new Error("Method not implemented."); } + n(): void { + throw new Error("Method not implemented."); + } } class C extends A { m(): void { throw new Error("Method not implemented."); } + n(): void { + throw new Error("Method not implemented."); + } }`, }); diff --git a/tests/cases/fourslash/codeFixClassImplementInterface_all.ts b/tests/cases/fourslash/codeFixClassImplementInterface_all.ts index cc27e395ed7..ae70d6fb422 100644 --- a/tests/cases/fourslash/codeFixClassImplementInterface_all.ts +++ b/tests/cases/fourslash/codeFixClassImplementInterface_all.ts @@ -7,7 +7,6 @@ verify.codeFixAll({ fixId: "fixClassIncorrectlyImplementsInterface", - // TODO: GH#20073 newFileContent: `interface I { i(): void; } interface J { j(): void; } From 05fcc225a44b0669e73bf5f15a7c12880c16f7cd Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 21 Feb 2018 10:57:04 -0800 Subject: [PATCH 192/298] Add test case when the deleted file's watch is not closed --- src/harness/unittests/tscWatchMode.ts | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index b7a477b04bf..17431d17da6 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -1113,6 +1113,34 @@ namespace ts.tscWatch { checkProgramActualFiles(watch(), files.map(file => file.path)); checkOutputErrors(host, [], ExpectedOutputErrorsPosition.AfterFileChangeDetected); }); + + it("watched files when file is deleted and new file is added as part of change", () => { + const projectLocation = "/home/username/project"; + const file: FileOrFolder = { + path: `${projectLocation}/src/file1.ts`, + content: "var a = 10;" + }; + const configFile: FileOrFolder = { + path: `${projectLocation}/tsconfig.json`, + content: "{}" + }; + const files = [file, libFile, configFile]; + const host = createWatchedSystem(files); + const watch = createWatchOfConfigFile(configFile.path, host); + verifyProgram(); + + file.path = file.path.replace("file1", "file2"); + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyProgram(); + + function verifyProgram() { + checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path)); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, [projectLocation, `${projectLocation}/node_modules/@types`], /*recursive*/ true); + checkWatchedFiles(host, files.map(f => f.path)); + } + }); }); describe("tsc-watch emit with outFile or out setting", () => { From 2777c3a8905decb87d1d5ff2e1db22aeeaa63a81 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 21 Feb 2018 11:01:58 -0800 Subject: [PATCH 193/298] Close the file watcher if present for the source file --- src/compiler/watch.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 7a98c43dd04..ff21c750089 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -749,6 +749,9 @@ namespace ts { (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); } else if ((hostSourceFileInfo as FilePresentOnHost).sourceFile === oldSourceFile) { + if ((hostSourceFileInfo as FilePresentOnHost).fileWatcher) { + (hostSourceFileInfo as FilePresentOnHost).fileWatcher.close(); + } sourceFilesCache.delete(oldSourceFile.path); resolutionCache.removeResolutionsOfFile(oldSourceFile.path); } From 8a52eade2ec705962c355655ecc43d734d475c05 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 21 Feb 2018 11:05:43 -0800 Subject: [PATCH 194/298] Make getTextOfIdentifierOrLiteral and getEscapedTextOfIdentifierOrLiteral only accept Identifier | StringLiteralLike | NumericLiteral (#22002) --- src/compiler/binder.ts | 4 ++-- src/compiler/checker.ts | 8 ++++++-- src/compiler/factory.ts | 2 +- src/compiler/utilities.ts | 40 ++++++++++++++----------------------- src/services/completions.ts | 2 +- src/services/navigateTo.ts | 40 +++++++++++++++---------------------- src/services/services.ts | 19 ++---------------- 7 files changed, 43 insertions(+), 72 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 06b15c7718d..782363dd6df 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -260,7 +260,7 @@ namespace ts { const name = getNameOfDeclaration(node); if (name) { if (isAmbientModule(node)) { - const moduleName = getTextOfIdentifierOrLiteral(name); + const moduleName = getTextOfIdentifierOrLiteral(name as Identifier | StringLiteral); return (isGlobalScopeAugmentation(node) ? "__global" : `"${moduleName}"`) as __String; } if (name.kind === SyntaxKind.ComputedPropertyName) { @@ -273,7 +273,7 @@ namespace ts { Debug.assert(isWellKnownSymbolSyntactically(nameExpression)); return getPropertyNameForKnownSymbolName(idText((nameExpression).name)); } - return getEscapedTextOfIdentifierOrLiteral(name); + return isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { case SyntaxKind.Constructor: diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2768c142f5a..00353c1c391 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23753,7 +23753,11 @@ namespace ts { function checkExternalImportOrExportDeclaration(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): boolean { const moduleName = getExternalModuleName(node); - if (!nodeIsMissing(moduleName) && moduleName.kind !== SyntaxKind.StringLiteral) { + if (nodeIsMissing(moduleName)) { + // Should be a parse error. + return false; + } + if (!isStringLiteral(moduleName)) { error(moduleName, Diagnostics.String_literal_expected); return false; } @@ -23764,7 +23768,7 @@ namespace ts { Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } - if (inAmbientExternalModule && isExternalModuleNameRelative(getTextOfIdentifierOrLiteral(moduleName))) { + if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { // we have already reported errors on top level imports\exports in external module augmentations in checkModuleDeclaration // no need to do this again. if (!isTopLevelInExternalModuleAugmentation(node)) { diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 647ae6983fa..92d353aeb0e 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -101,7 +101,7 @@ namespace ts { return node; } - function createLiteralFromNode(sourceNode: StringLiteralLike | NumericLiteral | Identifier): StringLiteral { + function createLiteralFromNode(sourceNode: PropertyNameLiteral): StringLiteral { const node = createStringLiteral(getTextOfIdentifierOrLiteral(sourceNode)); node.textSourceNode = sourceNode; return node; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 63214d68e5d..c6861380d8d 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2159,34 +2159,24 @@ namespace ts { return undefined; } - export function getTextOfIdentifierOrLiteral(node: Identifier | LiteralLikeNode) { - if (node) { - if (node.kind === SyntaxKind.Identifier) { - return idText(node as Identifier); - } - if (node.kind === SyntaxKind.StringLiteral || - node.kind === SyntaxKind.NumericLiteral) { - - return node.text; - } + export type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral; + export function isPropertyNameLiteral(node: Node): node is PropertyNameLiteral { + switch (node.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.NumericLiteral: + return true; + default: + return false; } - - return undefined; + } + export function getTextOfIdentifierOrLiteral(node: PropertyNameLiteral): string { + return node.kind === SyntaxKind.Identifier ? idText(node) : node.text; } - export function getEscapedTextOfIdentifierOrLiteral(node: Identifier | LiteralLikeNode) { - if (node) { - if (node.kind === SyntaxKind.Identifier) { - return (node as Identifier).escapedText; - } - if (node.kind === SyntaxKind.StringLiteral || - node.kind === SyntaxKind.NumericLiteral) { - - return escapeLeadingUnderscores(node.text); - } - } - - return undefined; + export function getEscapedTextOfIdentifierOrLiteral(node: PropertyNameLiteral): __String { + return node.kind === SyntaxKind.Identifier ? node.escapedText : escapeLeadingUnderscores(node.text); } export function getPropertyNameForKnownSymbolName(symbolName: string): __String { diff --git a/src/services/completions.ts b/src/services/completions.ts index a77185ab94e..c49f758392a 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1999,7 +1999,7 @@ namespace ts.Completions { // NOTE: if one only performs this step when m.name is an identifier, // things like '__proto__' are not filtered out. const name = getNameOfDeclaration(m); - existingName = getEscapedTextOfIdentifierOrLiteral(name as (Identifier | LiteralExpression)); + existingName = isPropertyNameLiteral(name) ? getEscapedTextOfIdentifierOrLiteral(name) : undefined; } existingMemberNames.set(existingName, true); diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index 3b5e5ee59ba..21d8a792759 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -89,45 +89,37 @@ namespace ts.NavigateTo { } function tryAddSingleDeclarationName(declaration: Declaration, containers: string[]): boolean { - if (declaration) { - const name = getNameOfDeclaration(declaration); - if (name) { - const text = getTextOfIdentifierOrLiteral(name as (Identifier | LiteralExpression)); - if (text !== undefined) { - containers.unshift(text); - } - else if (name.kind === SyntaxKind.ComputedPropertyName) { - return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); - } - else { - // Don't know how to add this. - return false; - } - } + const name = getNameOfDeclaration(declaration); + if (name && isPropertyNameLiteral(name)) { + containers.unshift(getTextOfIdentifierOrLiteral(name)); + return true; + } + else if (name && name.kind === SyntaxKind.ComputedPropertyName) { + return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); + } + else { + // Don't know how to add this. + return false; } - - return true; } // Only added the names of computed properties if they're simple dotted expressions, like: // // [X.Y.Z]() { } function tryAddComputedPropertyName(expression: Expression, containers: string[], includeLastPortion: boolean): boolean { - const text = getTextOfIdentifierOrLiteral(expression as LiteralExpression); - if (text !== undefined) { + if (isPropertyNameLiteral(expression)) { + const text = getTextOfIdentifierOrLiteral(expression); if (includeLastPortion) { containers.unshift(text); } return true; } - - if (expression.kind === SyntaxKind.PropertyAccessExpression) { - const propertyAccess = expression; + if (isPropertyAccessExpression(expression)) { if (includeLastPortion) { - containers.unshift(propertyAccess.name.text); + containers.unshift(expression.name.text); } - return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion*/ true); + return tryAddComputedPropertyName(expression.expression, containers, /*includeLastPortion*/ true); } return false; diff --git a/src/services/services.ts b/src/services/services.ts index 991b6c10606..fe7606fd8ad 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -721,23 +721,8 @@ namespace ts { function getDeclarationName(declaration: Declaration) { const name = getNameOfDeclaration(declaration); - if (name) { - const result = getTextOfIdentifierOrLiteral(name as (Identifier | LiteralExpression)); - if (result !== undefined) { - return result; - } - - if (name.kind === SyntaxKind.ComputedPropertyName) { - const expr = name.expression; - if (expr.kind === SyntaxKind.PropertyAccessExpression) { - return (expr).name.text; - } - - return getTextOfIdentifierOrLiteral(expr as (Identifier | LiteralExpression)); - } - } - - return undefined; + return name && (isPropertyNameLiteral(name) ? getTextOfIdentifierOrLiteral(name) : + name.kind === SyntaxKind.ComputedPropertyName && isPropertyAccessExpression(name.expression) ? name.expression.name.text : undefined); } function visit(node: Node): void { From 66fa9f6cd793f7df210799b7d665d05bdfa9ade1 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 21 Feb 2018 12:51:26 -0800 Subject: [PATCH 195/298] Just map type variables to constraints at certain positions for narrowing so that we do not map primitives (#21384) * Use a limited version of getApparentType that doesnt map primitives * Reuse [most of] getBaseConstraintOfType, since it does the needed behaviors * Move new function next to the very similar function --- src/compiler/checker.ts | 34 +++++++++++----- ...ameterExtendingStringAssignableToString.js | 18 +++++++++ ...rExtendingStringAssignableToString.symbols | 32 +++++++++++++++ ...terExtendingStringAssignableToString.types | 40 +++++++++++++++++++ ...ameterExtendingStringAssignableToString.ts | 9 +++++ 5 files changed, 122 insertions(+), 11 deletions(-) create mode 100644 tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.js create mode 100644 tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.symbols create mode 100644 tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.types create mode 100644 tests/cases/compiler/nonNullParameterExtendingStringAssignableToString.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 00353c1c391..b177c0c9e04 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4015,7 +4015,7 @@ namespace ts { parentType = getNonNullableType(parentType); } const propType = getTypeOfPropertyOfType(parentType, text); - const declaredType = propType && getApparentTypeForLocation(propType, declaration.name); + const declaredType = propType && getConstraintForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, IndexKind.Number) || getIndexTypeOfType(parentType, IndexKind.String); @@ -6138,17 +6138,29 @@ namespace ts { return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); } - function getBaseConstraintOfType(type: Type): Type { + function getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type: Type) { if (type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.UnionOrIntersection)) { const constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; } } - else if (type.flags & TypeFlags.Index) { + } + + function getBaseConstraintOfType(type: Type): Type { + const constraint = getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type); + if (!constraint && type.flags & TypeFlags.Index) { return stringType; } - return undefined; + return constraint; + } + + /** + * This is similar to `getBaseConstraintOfType` except it returns the input type if there's no base constraint, instead of `undefined` + * It also doesn't map indexes to `string`, as where this is used this would be unneeded (and likely undesirable) + */ + function getBaseConstraintOrType(type: Type) { + return getBaseConstraintOfType(type) || type; } function hasNonCircularBaseConstraint(type: InstantiableType): boolean { @@ -11935,7 +11947,7 @@ namespace ts { function getFlowCacheKey(node: Node): string | undefined { if (node.kind === SyntaxKind.Identifier) { const symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? (isApparentTypePosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; + return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; } if (node.kind === SyntaxKind.ThisKeyword) { return "0"; @@ -13297,7 +13309,7 @@ namespace ts { return annotationIncludesUndefined ? getTypeWithFacts(declaredType, TypeFacts.NEUndefined) : declaredType; } - function isApparentTypePosition(node: Node) { + function isConstraintPosition(node: Node) { const parent = node.parent; return parent.kind === SyntaxKind.PropertyAccessExpression || parent.kind === SyntaxKind.CallExpression && (parent).expression === node || @@ -13310,13 +13322,13 @@ namespace ts { return type.flags & TypeFlags.InstantiableNonPrimitive && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, TypeFlags.Nullable); } - function getApparentTypeForLocation(type: Type, node: Node) { + function getConstraintForLocation(type: Type, node: Node) { // When a node is the left hand expression of a property access, element access, or call expression, // and the type of the node includes type variables with constraints that are nullable, we fetch the // apparent type of the node *before* performing control flow analysis such that narrowings apply to // the constraint type. - if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { - return mapType(getWidenedType(type), getApparentType); + if (isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) { + return mapType(getWidenedType(type), getBaseConstraintOrType); } return type; } @@ -13404,7 +13416,7 @@ namespace ts { checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - const type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); + const type = getConstraintForLocation(getTypeOfSymbol(localOrExportSymbol), node); const assignmentKind = getAssignmentTargetKind(node); if (assignmentKind) { @@ -16024,7 +16036,7 @@ namespace ts { return unknownType; } } - propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); + propType = getConstraintForLocation(getTypeOfSymbol(prop), node); } // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, diff --git a/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.js b/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.js new file mode 100644 index 00000000000..c28a33c1a61 --- /dev/null +++ b/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.js @@ -0,0 +1,18 @@ +//// [nonNullParameterExtendingStringAssignableToString.ts] +declare function foo(p: string): void; + +function fn(one: T, two: U) { + let three = Boolean() ? one : two; + foo(one!); + foo(two!); + foo(three!); // this line is the important one +} + +//// [nonNullParameterExtendingStringAssignableToString.js] +"use strict"; +function fn(one, two) { + var three = Boolean() ? one : two; + foo(one); + foo(two); + foo(three); // this line is the important one +} diff --git a/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.symbols b/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.symbols new file mode 100644 index 00000000000..e351d25ac31 --- /dev/null +++ b/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.symbols @@ -0,0 +1,32 @@ +=== tests/cases/compiler/nonNullParameterExtendingStringAssignableToString.ts === +declare function foo(p: string): void; +>foo : Symbol(foo, Decl(nonNullParameterExtendingStringAssignableToString.ts, 0, 0)) +>p : Symbol(p, Decl(nonNullParameterExtendingStringAssignableToString.ts, 0, 21)) + +function fn(one: T, two: U) { +>fn : Symbol(fn, Decl(nonNullParameterExtendingStringAssignableToString.ts, 0, 38)) +>T : Symbol(T, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 12)) +>U : Symbol(U, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 41)) +>one : Symbol(one, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 60)) +>T : Symbol(T, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 12)) +>two : Symbol(two, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 67)) +>U : Symbol(U, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 41)) + + let three = Boolean() ? one : two; +>three : Symbol(three, Decl(nonNullParameterExtendingStringAssignableToString.ts, 3, 7)) +>Boolean : Symbol(Boolean, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>one : Symbol(one, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 60)) +>two : Symbol(two, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 67)) + + foo(one!); +>foo : Symbol(foo, Decl(nonNullParameterExtendingStringAssignableToString.ts, 0, 0)) +>one : Symbol(one, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 60)) + + foo(two!); +>foo : Symbol(foo, Decl(nonNullParameterExtendingStringAssignableToString.ts, 0, 0)) +>two : Symbol(two, Decl(nonNullParameterExtendingStringAssignableToString.ts, 2, 67)) + + foo(three!); // this line is the important one +>foo : Symbol(foo, Decl(nonNullParameterExtendingStringAssignableToString.ts, 0, 0)) +>three : Symbol(three, Decl(nonNullParameterExtendingStringAssignableToString.ts, 3, 7)) +} diff --git a/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.types b/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.types new file mode 100644 index 00000000000..9ab1ef1f9ac --- /dev/null +++ b/tests/baselines/reference/nonNullParameterExtendingStringAssignableToString.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/nonNullParameterExtendingStringAssignableToString.ts === +declare function foo(p: string): void; +>foo : (p: string) => void +>p : string + +function fn(one: T, two: U) { +>fn : (one: T, two: U) => void +>T : T +>U : U +>one : T +>T : T +>two : U +>U : U + + let three = Boolean() ? one : two; +>three : T | U +>Boolean() ? one : two : T | U +>Boolean() : boolean +>Boolean : BooleanConstructor +>one : T +>two : U + + foo(one!); +>foo(one!) : void +>foo : (p: string) => void +>one! : string +>one : string | undefined + + foo(two!); +>foo(two!) : void +>foo : (p: string) => void +>two! : U +>two : U + + foo(three!); // this line is the important one +>foo(three!) : void +>foo : (p: string) => void +>three! : string +>three : string +} diff --git a/tests/cases/compiler/nonNullParameterExtendingStringAssignableToString.ts b/tests/cases/compiler/nonNullParameterExtendingStringAssignableToString.ts new file mode 100644 index 00000000000..e16bf7c13ca --- /dev/null +++ b/tests/cases/compiler/nonNullParameterExtendingStringAssignableToString.ts @@ -0,0 +1,9 @@ +// @strict: true +declare function foo(p: string): void; + +function fn(one: T, two: U) { + let three = Boolean() ? one : two; + foo(one!); + foo(two!); + foo(three!); // this line is the important one +} \ No newline at end of file From 4f309702c155921009e439429143687f089c88f7 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 21 Feb 2018 13:12:13 -0800 Subject: [PATCH 196/298] Separate isGlobalCompletion from CompletionKind (#22074) * Separate isGlobalCompletion from CompletionKind * Fix comments --- src/services/completions.ts | 19 +++++++++---------- src/services/types.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index c49f758392a..d07c2f494da 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -106,7 +106,7 @@ namespace ts.Completions { } function completionInfoFromData(sourceFile: SourceFile, typeChecker: TypeChecker, compilerOptions: CompilerOptions, log: Log, completionData: CompletionData, includeInsertTextCompletions: boolean): CompletionInfo { - const { symbols, completionKind, isNewIdentifierLocation, location, propertyAccessToConvert, keywordFilters, symbolToOriginInfoMap, recommendedCompletion, isJsxInitializer } = completionData; + const { symbols, completionKind, isInSnippetScope, isNewIdentifierLocation, location, propertyAccessToConvert, keywordFilters, symbolToOriginInfoMap, recommendedCompletion, isJsxInitializer } = completionData; if (sourceFile.languageVariant === LanguageVariant.JSX && location && location.parent && isJsxClosingElement(location.parent)) { // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, @@ -148,7 +148,7 @@ namespace ts.Completions { addRange(entries, getKeywordCompletions(keywordFilters)); } - return { isGlobalCompletion: completionKind === CompletionKind.Global, isMemberCompletion, isNewIdentifierLocation, entries }; + return { isGlobalCompletion: isInSnippetScope, isMemberCompletion, isNewIdentifierLocation, entries }; } function isMemberCompletionKind(kind: CompletionKind): boolean { @@ -635,6 +635,7 @@ namespace ts.Completions { readonly kind: CompletionDataKind.Data; readonly symbols: ReadonlyArray; readonly completionKind: CompletionKind; + readonly isInSnippetScope: boolean; /** Note that the presence of this alone doesn't mean that we need a conversion. Only do that if the completion is not an ordinary identifier. */ readonly propertyAccessToConvert: PropertyAccessExpression | undefined; readonly isNewIdentifierLocation: boolean; @@ -649,7 +650,6 @@ namespace ts.Completions { const enum CompletionKind { ObjectPropertyDeclaration, - /** Note that sometimes we access completions from global scope, but use "None" instead of this. See isGlobalCompletionScope. */ Global, PropertyAccess, MemberLike, @@ -753,6 +753,7 @@ namespace ts.Completions { log("getCompletionData: Is inside comment: " + (timestamp() - start)); let insideJsDocTagTypeExpression = false; + let isInSnippetScope = false; if (insideComment) { if (hasDocComment(sourceFile, position)) { if (sourceFile.text.charCodeAt(position - 1) === CharacterCodes.at) { @@ -971,7 +972,7 @@ namespace ts.Completions { log("getCompletionData: Semantic work: " + (timestamp() - semanticStart)); const recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, position, sourceFile, typeChecker); - return { kind: CompletionDataKind.Data, symbols, completionKind, propertyAccessToConvert, isNewIdentifierLocation, location, keywordFilters, symbolToOriginInfoMap, recommendedCompletion, previousToken, isJsxInitializer }; + return { kind: CompletionDataKind.Data, symbols, completionKind, isInSnippetScope, propertyAccessToConvert, isNewIdentifierLocation, location, keywordFilters, symbolToOriginInfoMap, recommendedCompletion, previousToken, isJsxInitializer }; type JSDocTagWithTypeExpression = JSDocParameterTag | JSDocPropertyTag | JSDocReturnTag | JSDocTypeTag | JSDocTypedefTag; @@ -1098,7 +1099,7 @@ namespace ts.Completions { } // Get all entities in the current scope. - completionKind = CompletionKind.None; + completionKind = CompletionKind.Global; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { @@ -1134,9 +1135,7 @@ namespace ts.Completions { position; const scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - if (isGlobalCompletionScope(scopeNode)) { - completionKind = CompletionKind.Global; - } + isInSnippetScope = isSnippetScope(scopeNode); const symbolMeanings = SymbolFlags.Type | SymbolFlags.Value | SymbolFlags.Namespace | SymbolFlags.Alias; @@ -1161,7 +1160,7 @@ namespace ts.Completions { return true; } - function isGlobalCompletionScope(scopeNode: Node): boolean { + function isSnippetScope(scopeNode: Node): boolean { switch (scopeNode.kind) { case SyntaxKind.SourceFile: case SyntaxKind.TemplateExpression: @@ -2128,10 +2127,10 @@ namespace ts.Completions { // TODO: GH#18169 return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; case CompletionKind.PropertyAccess: - case CompletionKind.None: case CompletionKind.Global: // Don't add a completion for a name starting with a space. See https://github.com/Microsoft/TypeScript/pull/20547 return name.charCodeAt(0) === CharacterCodes.space ? undefined : { name, needsConvertPropertyAccess: true }; + case CompletionKind.None: case CompletionKind.String: return validIdentiferResult; default: diff --git a/src/services/types.ts b/src/services/types.ts index 60e33c200ad..b67c2569f27 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -727,7 +727,7 @@ namespace ts { } export interface CompletionInfo { - /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 8739616ce14..249569a8d22 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4494,7 +4494,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { - /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 21ea143e8c5..0075da06668 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4746,7 +4746,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { - /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isGlobalCompletionScope`. */ + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** From 4db45338f46fd4dc54a990b39208c9347e977744 Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 21 Feb 2018 23:10:43 +0000 Subject: [PATCH 197/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 8de5fe09f4e..332e2933d2a 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3030,6 +3030,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index b060083b814..a1515e25bc4 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3021,6 +3021,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index 6b10e196a00..f65f2418896 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3011,6 +3011,15 @@ + + + + + + + + + From a0b15e2b9a224a27fb34b63bc8220c62cf1fc852 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 22 Feb 2018 05:10:13 +0000 Subject: [PATCH 198/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 0245b3da775..15c5e26b54f 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3020,6 +3020,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 541710c9ffb..14a0aa42355 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3014,6 +3014,15 @@ + + + + + + + + + From ce4bd134aa206c66a3fceecbfbc2d5bd75b0c5af Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 22 Feb 2018 11:10:14 +0000 Subject: [PATCH 199/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl index d718a152291..edc97138c7c 100644 --- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3018,6 +3018,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index e372fce34aa..be0db6f399c 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3030,6 +3030,15 @@ + + + + + + + + + From 13d57fdd4741f40ed60d9d05ba647cca46c9b257 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 22 Feb 2018 17:10:13 +0000 Subject: [PATCH 200/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index 4df7051b1a1..d08460314f5 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3021,6 +3021,15 @@ + + + + + + + + + From 8463b1e0283814b0164f8e180e19180e4e8124c5 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 09:20:59 -0800 Subject: [PATCH 201/298] Fix bug: don't call `addIndirectUser` if we're not tracking indirect users (#22121) --- src/services/importTracker.ts | 8 +++++--- .../fourslash/esModuleInteropFindAllReferences.ts | 4 +++- .../esModuleInteropFindAllReferences2.ts | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/esModuleInteropFindAllReferences2.ts diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index a9e2f202726..beecafe0e81 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -109,7 +109,9 @@ namespace ts.FindAllReferences { } else if (isDefaultImport(direct)) { const sourceFileLike = getSourceFileLikeForImportDeclaration(direct); - addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + if (!isAvailableThroughGlobal) { + addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + } directImports.push(direct); } else { @@ -651,8 +653,8 @@ namespace ts.FindAllReferences { if (parent.kind === SyntaxKind.SourceFile) { return parent as SourceFile; } - Debug.assert(parent.kind === SyntaxKind.ModuleBlock && isAmbientModuleDeclaration(parent.parent)); - return parent.parent as AmbientModuleDeclaration; + Debug.assert(parent.kind === SyntaxKind.ModuleBlock); + return cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node: Node): node is AmbientModuleDeclaration { diff --git a/tests/cases/fourslash/esModuleInteropFindAllReferences.ts b/tests/cases/fourslash/esModuleInteropFindAllReferences.ts index 9ead793a867..5ec348bb120 100644 --- a/tests/cases/fourslash/esModuleInteropFindAllReferences.ts +++ b/tests/cases/fourslash/esModuleInteropFindAllReferences.ts @@ -1,3 +1,5 @@ +/// + // @esModuleInterop: true // @Filename: /abc.d.ts @@ -6,7 +8,7 @@ ////} // @Filename: /b.ts -////import * as a from "a"; +////import a from "a"; ////a.[|x|]; verify.rangesReferenceEachOther(); \ No newline at end of file diff --git a/tests/cases/fourslash/esModuleInteropFindAllReferences2.ts b/tests/cases/fourslash/esModuleInteropFindAllReferences2.ts new file mode 100644 index 00000000000..55fc6cc89e4 --- /dev/null +++ b/tests/cases/fourslash/esModuleInteropFindAllReferences2.ts @@ -0,0 +1,15 @@ +/// + +// Tests that we don't always add an indirect user, which causes problems if the module is already available globally. + +// @esModuleInterop: true + +// @Filename: /a.d.ts +////export as namespace abc; +////export const [|x|]: number; + +// @Filename: /b.ts +////import a from "./a"; +////a.[|x|]; + +verify.rangesReferenceEachOther(); From 0b248d5e298db53c6cc9c47a2994bc382e79a0ce Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 21 Feb 2018 12:40:36 -0800 Subject: [PATCH 202/298] Trace should write messages to the logger --- src/server/project.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/project.ts b/src/server/project.ts index dc949b4b221..743b4e4bfb7 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -238,7 +238,10 @@ namespace ts.server { this.setInternalCompilerOptionsForEmittingJsFiles(); const host = this.projectService.host; - if (host.trace) { + if (this.projectService.logger.loggingEnabled()) { + this.trace = s => this.writeLog(s); + } + else if (host.trace) { this.trace = s => host.trace(s); } From b90a56dc7a2d526488bec0cae0a86a171ce1b405 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 13:21:40 -0800 Subject: [PATCH 203/298] Mark getOccurrences as deprecated in protocol.ts like it is in services/types.ts (#22067) --- src/server/protocol.ts | 4 ++++ tests/baselines/reference/api/tsserverlibrary.d.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index fbff4501133..76d954ebe23 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -50,6 +50,7 @@ namespace ts.server.protocol { NavtoFull = "navto-full", NavTree = "navtree", NavTreeFull = "navtree-full", + /** @deprecated */ Occurrences = "occurrences", DocumentHighlights = "documentHighlights", /* @internal */ @@ -829,6 +830,7 @@ namespace ts.server.protocol { } /** + * @deprecated * Get occurrences request; value of command field is * "occurrences". Return response giving spans that are relevant * in the file at a given line and column. @@ -837,6 +839,7 @@ namespace ts.server.protocol { command: CommandTypes.Occurrences; } + /** @deprecated */ export interface OccurrencesResponseItem extends FileSpan { /** * True if the occurrence is a write location, false otherwise. @@ -849,6 +852,7 @@ namespace ts.server.protocol { isInString?: true; } + /** @deprecated */ export interface OccurrencesResponse extends Response { body?: OccurrencesResponseItem[]; } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 249569a8d22..ee3bd07d280 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5058,6 +5058,7 @@ declare namespace ts.server.protocol { Navto = "navto", NavTree = "navtree", NavTreeFull = "navtree-full", + /** @deprecated */ Occurrences = "occurrences", DocumentHighlights = "documentHighlights", Open = "open", @@ -5658,6 +5659,7 @@ declare namespace ts.server.protocol { openingBrace: string; } /** + * @deprecated * Get occurrences request; value of command field is * "occurrences". Return response giving spans that are relevant * in the file at a given line and column. @@ -5665,6 +5667,7 @@ declare namespace ts.server.protocol { interface OccurrencesRequest extends FileLocationRequest { command: CommandTypes.Occurrences; } + /** @deprecated */ interface OccurrencesResponseItem extends FileSpan { /** * True if the occurrence is a write location, false otherwise. @@ -5675,6 +5678,7 @@ declare namespace ts.server.protocol { */ isInString?: true; } + /** @deprecated */ interface OccurrencesResponse extends Response { body?: OccurrencesResponseItem[]; } From 790f65d15b0a9775ce2e3a6bcf44984bbb238bcf Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 13:22:34 -0800 Subject: [PATCH 204/298] Simplify isJumpStatementTarget and isLabelOfLabeledStatement users using type predicates (#22100) --- src/services/findAllReferences.ts | 20 ++++++------- src/services/goToDefinition.ts | 5 ++-- src/services/services.ts | 48 +++++++++++++++---------------- src/services/utilities.ts | 14 ++++----- 4 files changed, 39 insertions(+), 48 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 8100a021fb8..46a17707e79 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -330,17 +330,15 @@ namespace ts.FindAllReferences.Core { } // Labels - if (isLabelName(node)) { - if (isJumpStatementTarget(node)) { - const labelDefinition = getTargetLabel((node.parent), (node).text); - // if we have a label definition, look within its statement for references, if not, then - // the label is undefined and we have no results.. - return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); - } - else { - // it is a label definition and not a target, search within the parent labeledStatement - return getLabelReferencesInNode(node.parent, node); - } + if (isJumpStatementTarget(node)) { + const labelDefinition = getTargetLabel(node.parent, node.text); + // if we have a label definition, look within its statement for references, if not, then + // the label is undefined and we have no results.. + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); + } + else if (isLabelOfLabeledStatement(node)) { + // it is a label definition and not a target, search within the parent labeledStatement + return getLabelReferencesInNode(node.parent, node); } if (isThis(node)) { diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index 6be00efd53f..cf51e8f93cd 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -13,9 +13,8 @@ namespace ts.GoToDefinition { // Labels if (isJumpStatementTarget(node)) { - const labelName = (node).text; - const label = getTargetLabel((node.parent), labelName); - return label ? [createDefinitionInfoFromName(label, ScriptElementKind.label, labelName, /*containerName*/ undefined)] : undefined; + const label = getTargetLabel(node.parent, node.text); + return label ? [createDefinitionInfoFromName(label, ScriptElementKind.label, node.text, /*containerName*/ undefined)] : undefined; } const typeChecker = program.getTypeChecker(); diff --git a/src/services/services.ts b/src/services/services.ts index caa927cf80d..624ca8c42bb 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1467,10 +1467,7 @@ namespace ts { const sourceFile = getValidSourceFile(fileName); const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); if (node === sourceFile) { - return undefined; - } - - if (isLabelName(node)) { + // Avoid giving quickInfo for the sourceFile as a whole. return undefined; } @@ -1481,6 +1478,11 @@ namespace ts { // Try getting just type at this position and show switch (node.kind) { case SyntaxKind.Identifier: + if (isLabelName(node)) { + // Type here will be 'any', avoid displaying this. + return undefined; + } + // falls through case SyntaxKind.PropertyAccessExpression: case SyntaxKind.QualifiedName: case SyntaxKind.ThisKeyword: @@ -1488,29 +1490,27 @@ namespace ts { case SyntaxKind.SuperKeyword: // For the identifiers/this/super etc get the type at position const type = typeChecker.getTypeAtLocation(node); - if (type) { - return { - kind: ScriptElementKind.unknown, - kindModifiers: ScriptElementKindModifier.none, - textSpan: createTextSpan(node.getStart(), node.getWidth()), - displayParts: typeToDisplayParts(typeChecker, type, getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined, - tags: type.symbol ? type.symbol.getJsDocTags() : undefined - }; - } + return type && { + kind: ScriptElementKind.unknown, + kindModifiers: ScriptElementKindModifier.none, + textSpan: createTextSpanFromNode(node, sourceFile), + displayParts: typeToDisplayParts(typeChecker, type, getContainerNode(node)), + documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined, + tags: type.symbol ? type.symbol.getJsDocTags() : undefined + }; } return undefined; } - const displayPartsDocumentationsAndKind = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, getContainerNode(node), node); + const { symbolKind, displayParts, documentation, tags } = SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, getContainerNode(node), node); return { - kind: displayPartsDocumentationsAndKind.symbolKind, + kind: symbolKind, kindModifiers: SymbolDisplay.getSymbolModifiers(symbol), - textSpan: createTextSpan(node.getStart(), node.getWidth()), - displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation, - tags: displayPartsDocumentationsAndKind.tags + textSpan: createTextSpanFromNode(node, sourceFile), + displayParts, + documentation, + tags, }; } @@ -1519,11 +1519,9 @@ namespace ts { && isPropertyAssignment(node.parent) && node.parent.name === node) { const type = checker.getContextualType(node.parent.parent); - if (type) { - const property = checker.getPropertyOfType(type, getTextOfIdentifierOrLiteral(node)); - if (property) { - return property; - } + const property = type && checker.getPropertyOfType(type, getTextOfIdentifierOrLiteral(node)); + if (property) { + return property; } } return checker.getSymbolAtLocation(node); diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 6ece5e018b3..5c79774073f 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -214,16 +214,12 @@ namespace ts { return undefined; } - export function isJumpStatementTarget(node: Node): boolean { - return node.kind === SyntaxKind.Identifier && - (node.parent.kind === SyntaxKind.BreakStatement || node.parent.kind === SyntaxKind.ContinueStatement) && - (node.parent).label === node; - } + export function isJumpStatementTarget(node: Node): node is Identifier & { parent: BreakOrContinueStatement } { + return node.kind === SyntaxKind.Identifier && isBreakOrContinueStatement(node.parent) && node.parent.label === node; + } - function isLabelOfLabeledStatement(node: Node): boolean { - return node.kind === SyntaxKind.Identifier && - node.parent.kind === SyntaxKind.LabeledStatement && - (node.parent).label === node; + export function isLabelOfLabeledStatement(node: Node): node is Identifier { + return node.kind === SyntaxKind.Identifier && isLabeledStatement(node.parent) && node.parent.label === node; } export function isLabelName(node: Node): boolean { From bb2c58b9775e250cb934894ee7d56af57feccdb7 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 13:22:52 -0800 Subject: [PATCH 205/298] Simplify uses of getPossibleSymbolReferencePositions (#22099) --- src/services/findAllReferences.ts | 83 +++++++++---------------------- 1 file changed, 23 insertions(+), 60 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 46a17707e79..41bc5685f80 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -743,18 +743,13 @@ namespace ts.FindAllReferences.Core { } function getLabelReferencesInNode(container: Node, targetLabel: Identifier): SymbolAndEntries[] { - const references: Entry[] = []; const sourceFile = container.getSourceFile(); const labelName = targetLabel.text; - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container); - for (const position of possiblePositions) { + const references = mapDefined(getPossibleSymbolReferencePositions(sourceFile, labelName, container), position => { const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); // Only pick labels that are either the target label, or have a target that is the target label - if (node && (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel))) { - references.push(nodeEntry(node)); - } - } - + return node && (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) ? nodeEntry(node) : undefined; + }); return [{ definition: { type: "label", node: targetLabel }, references }]; } @@ -780,24 +775,16 @@ namespace ts.FindAllReferences.Core { } function getAllReferencesForKeyword(sourceFiles: ReadonlyArray, keywordKind: ts.SyntaxKind, cancellationToken: CancellationToken): SymbolAndEntries[] { - const references: NodeEntry[] = []; - for (const sourceFile of sourceFiles) { + const references = flatMap(sourceFiles, sourceFile => { cancellationToken.throwIfCancellationRequested(); - addReferencesForKeywordInFile(sourceFile, keywordKind, tokenToString(keywordKind), references); - } + return mapDefined(getPossibleSymbolReferencePositions(sourceFile, tokenToString(keywordKind), sourceFile), position => { + const referenceLocation = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return referenceLocation.kind === keywordKind ? nodeEntry(referenceLocation) : undefined; + }); + }); return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references }] : undefined; } - function addReferencesForKeywordInFile(sourceFile: SourceFile, kind: SyntaxKind, searchText: string, references: Push): void { - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile); - for (const position of possiblePositions) { - const referenceLocation = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (referenceLocation.kind === kind) { - references.push(nodeEntry(referenceLocation)); - } - } - } - function getReferencesInSourceFile(sourceFile: ts.SourceFile, search: Search, state: State): void { state.cancellationToken.throwIfCancellationRequested(); return getReferencesInContainer(sourceFile, sourceFile, search, state); @@ -1288,15 +1275,11 @@ namespace ts.FindAllReferences.Core { return undefined; } - const references: Entry[] = []; - const sourceFile = searchSpaceNode.getSourceFile(); - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode); - for (const position of possiblePositions) { + const references = mapDefined(getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode), position => { const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (!node || node.kind !== SyntaxKind.SuperKeyword) { - continue; + return; } const container = getSuperContainer(node, /*stopOnFunctions*/ false); @@ -1304,10 +1287,8 @@ namespace ts.FindAllReferences.Core { // If we have a 'super' container, we must have an enclosing class. // Now make sure the owning class is the same as the search-space // and has the same static qualifier as the original 'super's owner. - if (container && (ModifierFlags.Static & getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(nodeEntry(node)); - } - } + return container && (ModifierFlags.Static & getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : undefined; + }); return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references }]; } @@ -1348,19 +1329,10 @@ namespace ts.FindAllReferences.Core { } const references: Entry[] = []; - - let possiblePositions: ReadonlyArray; - if (searchSpaceNode.kind === SyntaxKind.SourceFile) { - forEach(sourceFiles, sourceFile => { - cancellationToken.throwIfCancellationRequested(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this"); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, staticFlag, references); - }); - } - else { - const sourceFile = searchSpaceNode.getSourceFile(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, references); + for (const sourceFile of searchSpaceNode.kind === SyntaxKind.SourceFile ? sourceFiles : [searchSpaceNode.getSourceFile()]) { + cancellationToken.throwIfCancellationRequested(); + const positions = getPossibleSymbolReferencePositions(sourceFile, "this", isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode); + getThisReferencesInFile(sourceFile, searchSpaceNode.kind === SyntaxKind.SourceFile ? sourceFile : searchSpaceNode, positions, staticFlag, references); } return [{ @@ -1409,27 +1381,18 @@ namespace ts.FindAllReferences.Core { } function getReferencesForStringLiteral(node: StringLiteral, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken): SymbolAndEntries[] { - const references: NodeEntry[] = []; - - for (const sourceFile of sourceFiles) { + const references = flatMap(sourceFiles, sourceFile => { cancellationToken.throwIfCancellationRequested(); - const possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text); - getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); - } + return mapDefined(getPossibleSymbolReferencePositions(sourceFile, node.text), position => { + const ref = tryCast(getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false), isStringLiteral); + return ref && ref.text === node.text ? nodeEntry(ref, /*isInString*/ true) : undefined; + }); + }); return [{ definition: { type: "string", node }, references }]; - - function getReferencesForStringLiteralInFile(sourceFile: SourceFile, searchText: string, possiblePositions: ReadonlyArray, references: Push): void { - for (const position of possiblePositions) { - const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (node && node.kind === SyntaxKind.StringLiteral && (node as StringLiteral).text === searchText) { - references.push(nodeEntry(node, /*isInString*/ true)); - } - } - } } // For certain symbol kinds, we need to include other symbols in the search set. From 403b7d8604087173e82946fff65dc32ea94443bd Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 22 Feb 2018 09:17:00 -0800 Subject: [PATCH 206/298] Add tests for module resolution order and reuse --- .../unittests/tsserverProjectSystem.ts | 343 +++++++++++++++++- 1 file changed, 341 insertions(+), 2 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index e09dff2a6d5..02776b4de07 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -145,6 +145,12 @@ namespace ts.projectSystem { return map; } + function createHostModuleResolutionTrace(host: TestServerHost & ModuleResolutionHost) { + const resolutionTrace: string[] = []; + host.trace = resolutionTrace.push.bind(resolutionTrace); + return resolutionTrace; + } + export function toExternalFile(fileName: string): protocol.ExternalFile { return { fileName }; } @@ -3201,8 +3207,7 @@ namespace ts.projectSystem { content: "export let x = 1" }; const host: TestServerHost & ModuleResolutionHost = createServerHost([file1, lib]); - const resolutionTrace: string[] = []; - host.trace = resolutionTrace.push.bind(resolutionTrace); + const resolutionTrace = createHostModuleResolutionTrace(host); const projectService = createProjectService(host, { typingsInstaller: new TestTypingsInstaller("/a/cache", /*throttleLimit*/5, host) }); projectService.setCompilerOptionsForInferredProjects({ traceResolution: true, allowJs: true }); @@ -6971,4 +6976,338 @@ namespace ts.projectSystem { assert.deepEqual(diagnostics, []); }); }); + + describe("tsserverProjectSystem module resolution caching", () => { + const projectLocation = "/user/username/projects/myproject"; + const configFile: FileOrFolder = { + path: `${projectLocation}/tsconfig.json`, + content: JSON.stringify({ compilerOptions: { traceResolution: true } }) + }; + + function getModules(module1Path: string, module2Path: string) { + const module1: FileOrFolder = { + path: module1Path, + content: `export function module1() {}` + }; + const module2: FileOrFolder = { + path: module2Path, + content: `export function module2() {}` + }; + return { module1, module2 }; + } + + function verifyTrace(resolutionTrace: string[], expected: string[]) { + assert.deepEqual(resolutionTrace, expected); + resolutionTrace.length = 0; + } + + function getExpectedFileDoesNotExistResolutionTrace(host: TestServerHost, expectedTrace: string[], foundModule: boolean, module: FileOrFolder, directory: string, file: string, ignoreIfParentMissing?: boolean) { + if (!foundModule) { + const path = combinePaths(directory, file); + if (!ignoreIfParentMissing || host.directoryExists(getDirectoryPath(path))) { + if (module.path === path) { + foundModule = true; + } + else { + expectedTrace.push(`File '${path}' does not exist.`); + } + } + } + return foundModule; + } + + function getExpectedMissedLocationResolutionTrace(host: TestServerHost, expectedTrace: string[], dirPath: string, module: FileOrFolder, moduleName: string, useNodeModules: boolean) { + let foundModule = false; + forEachAncestorDirectory(dirPath, dirPath => { + const directory = useNodeModules ? combinePaths(dirPath, nodeModules) : dirPath; + if (useNodeModules && !foundModule && !host.directoryExists(directory)) { + expectedTrace.push(`Directory '${directory}' does not exist, skipping all lookups in it.`); + return undefined; + } + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}/package.json`, /*ignoreIfParentMissing*/ true); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.ts`); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.tsx`); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}.d.ts`); + foundModule = getExpectedFileDoesNotExistResolutionTrace(host, expectedTrace, foundModule, module, directory, `${moduleName}/index.ts`, /*ignoreIfParentMissing*/ true); + if (useNodeModules && !foundModule) { + expectedTrace.push(`Directory '${directory}/@types' does not exist, skipping all lookups in it.`); + } + return foundModule ? true : undefined; + }); + } + + function getExpectedResolutionTraceHeader(expectedTrace: string[], file: FileOrFolder, moduleName: string) { + expectedTrace.push( + `======== Resolving module '${moduleName}' from '${file.path}'. ========`, + `Module resolution kind is not specified, using 'NodeJs'.` + ); + } + + function getExpectedResolutionTraceFooter(expectedTrace: string[], module: FileOrFolder, moduleName: string, addRealPathTrace: boolean) { + expectedTrace.push(`File '${module.path}' exist - use it as a name resolution result.`); + if (addRealPathTrace) { + expectedTrace.push(`Resolving real path for '${module.path}', result '${module.path}'.`); + } + expectedTrace.push(`======== Module name '${moduleName}' was successfully resolved to '${module.path}'. ========`); + } + + function getExpectedRelativeModuleResolutionTrace(host: TestServerHost, file: FileOrFolder, module: FileOrFolder, moduleName: string, expectedTrace: string[] = []) { + getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); + expectedTrace.push(`Loading module as file / folder, candidate module location '${removeFileExtension(module.path)}', target file type 'TypeScript'.`); + getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(normalizePath(combinePaths(getDirectoryPath(file.path), moduleName))), module, moduleName.substring(moduleName.lastIndexOf("/") + 1), /*useNodeModules*/ false); + getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ false); + return expectedTrace; + } + + function getExpectedNonRelativeModuleResolutionTrace(host: TestServerHost, file: FileOrFolder, module: FileOrFolder, moduleName: string, expectedTrace: string[] = []) { + getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); + expectedTrace.push(`Loading module '${moduleName}' from 'node_modules' folder, target file type 'TypeScript'.`); + getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(file.path), module, moduleName, /*useNodeModules*/ true); + getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ true); + return expectedTrace; + } + + function getExpectedReusingResolutionFromOldProgram(file: FileOrFolder, moduleName: string) { + return `Reusing resolution of module '${moduleName}' to file '${file.path}' from old program.`; + } + + function verifyWatchesWithConfigFile(host: TestServerHost, files: FileOrFolder[], openFile: FileOrFolder) { + checkWatchedFiles(host, mapDefined(files, f => f === openFile ? undefined : f.path)); + checkWatchedDirectories(host, [], /*recursive*/ false); + const configDirectory = getDirectoryPath(configFile.path); + checkWatchedDirectories(host, [configDirectory, `${configDirectory}/${nodeModulesAtTypes}`], /*recursive*/ true); + } + + describe("from files in same folder", () => { + function getFiles(fileContent: string) { + const file1: FileOrFolder = { + path: `${projectLocation}/src/file1.ts`, + content: fileContent + }; + const file2: FileOrFolder = { + path: `${projectLocation}/src/file2.ts`, + content: fileContent + }; + return { file1, file2 }; + } + + it("relative module name", () => { + const module1Name = "./module1"; + const module2Name = "../module2"; + const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2 } = getFiles(fileContent); + const { module1, module2 } = getModules(`${projectLocation}/src/module1.ts`, `${projectLocation}/module2.ts`); + const files = [module1, module2, file1, file2, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1); + + file1.content += fileContent; + file2.content += fileContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1); + }); + + it("non relative module name", () => { + const module1Name = "module1"; + const module2Name = "module2"; + const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2 } = getFiles(fileContent); + const { module1, module2 } = getModules(`${projectLocation}/src/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); + const files = [module1, module2, file1, file2, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1); + + file1.content += fileContent; + file2.content += fileContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1); + }); + }); + + describe("from files in different folders", () => { + function getFiles(fileContent1: string, fileContent2 = fileContent1, fileContent3 = fileContent1, fileContent4 = fileContent1) { + const file1: FileOrFolder = { + path: `${projectLocation}/product/src/file1.ts`, + content: fileContent1 + }; + const file2: FileOrFolder = { + path: `${projectLocation}/product/src/feature/file2.ts`, + content: fileContent2 + }; + const file3: FileOrFolder = { + path: `${projectLocation}/product/test/src/file3.ts`, + content: fileContent3 + }; + const file4: FileOrFolder = { + path: `${projectLocation}/product/test/file4.ts`, + content: fileContent4 + }; + return { file1, file2, file3, file4 }; + } + + it("relative module name", () => { + const module1Name = "./module1"; + const module2Name = "../module2"; + const module3Name = "../module1"; + const module4Name = "../../module2"; + const module5Name = "../../src/module1"; + const module6Name = "../src/module1"; + const fileContent1 = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const fileContent2 = `import { module1 } from "${module3Name}";import { module2 } from "${module4Name}";`; + const fileContent3 = `import { module1 } from "${module5Name}";import { module2 } from "${module4Name}";`; + const fileContent4 = `import { module1 } from "${module6Name}";import { module2 } from "${module2Name}";`; + const { file1, file2, file3, file4 } = getFiles(fileContent1, fileContent2, fileContent3, fileContent4); + const { module1, module2 } = getModules(`${projectLocation}/product/src/module1.ts`, `${projectLocation}/product/module2.ts`); + const files = [module1, module2, file1, file2, file3, file4, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file2, module1, module3Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file2, module2, module4Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file4, module1, module6Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file4, module2, module2Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file3, module1, module5Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file3, module2, module4Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1); + + file1.content += fileContent1; + file2.content += fileContent2; + file3.content += fileContent3; + file4.content += fileContent4; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1); + }); + + it("non relative module name", () => { + const module1Name = "module1"; + const module2Name = "module2"; + const fileContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2, file3, file4 } = getFiles(fileContent); + const { module1, module2 } = getModules(`${projectLocation}/product/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); + const files = [module1, module2, file1, file2, file3, file4, configFile, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.openClientFile(file1.path); + const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file2, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file2, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file4, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file4, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file3, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file3, module2, module2Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + verifyWatchesWithConfigFile(host, files, file1); + + file1.content += fileContent; + file2.content += fileContent; + file3.content += fileContent; + file4.content += fileContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + verifyWatchesWithConfigFile(host, files, file1); + }); + + it("non relative module name from inferred project", () => { + const module1Name = "module1"; + const module2Name = "module2"; + const file2Name = "./feature/file2"; + const file3Name = "../test/src/file3"; + const file4Name = "../test/file4"; + const importModuleContent = `import { module1 } from "${module1Name}";import { module2 } from "${module2Name}";`; + const { file1, file2, file3, file4 } = getFiles(`import "${file2Name}"; import "${file4Name}"; import "${file3Name}"; ${importModuleContent}`, importModuleContent, importModuleContent, importModuleContent); + const { module1, module2 } = getModules(`${projectLocation}/product/node_modules/module1/index.ts`, `${projectLocation}/node_modules/module2/index.ts`); + const files = [module1, module2, file1, file2, file3, file4, libFile]; + const host = createServerHost(files); + const resolutionTrace = createHostModuleResolutionTrace(host); + const service = createProjectService(host); + service.setCompilerOptionsForInferredProjects({ traceResolution: true }); + service.openClientFile(file1.path); + const expectedTrace = getExpectedRelativeModuleResolutionTrace(host, file1, file2, file2Name); + getExpectedRelativeModuleResolutionTrace(host, file1, file4, file4Name, expectedTrace); + getExpectedRelativeModuleResolutionTrace(host, file1, file3, file3Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file2, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file2, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file4, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file4, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file3, module1, module1Name, expectedTrace); + getExpectedNonRelativeModuleResolutionTrace(host, file3, module2, module2Name, expectedTrace); + verifyTrace(resolutionTrace, expectedTrace); + + const currentDirectory = getDirectoryPath(file1.path); + const watchedFiles = mapDefined(files, f => f === file1 ? undefined : f.path); + forEachAncestorDirectory(currentDirectory, d => { + watchedFiles.push(combinePaths(d, "tsconfig.json"), combinePaths(d, "jsconfig.json")); + }); + const watchedRecursiveDirectories = getTypeRootsFromLocation(currentDirectory).concat([ + currentDirectory, `${projectLocation}/product/${nodeModules}`, + `${projectLocation}/${nodeModules}`, `${projectLocation}/product/test/${nodeModules}`, + `${projectLocation}/product/test/src/${nodeModules}` + ]); + checkWatches(); + + file1.content += importModuleContent; + file2.content += importModuleContent; + file3.content += importModuleContent; + file4.content += importModuleContent; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + + verifyTrace(resolutionTrace, [ + getExpectedReusingResolutionFromOldProgram(file1, file2Name), + getExpectedReusingResolutionFromOldProgram(file1, file4Name), + getExpectedReusingResolutionFromOldProgram(file1, file3Name), + getExpectedReusingResolutionFromOldProgram(file1, module1Name), + getExpectedReusingResolutionFromOldProgram(file1, module2Name) + ]); + checkWatches(); + + function checkWatches() { + checkWatchedFiles(host, watchedFiles); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + } + }); + }); + }); } From fdb5e95f0a868e2dfdb1a373119f61884fc6c57e Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 22 Feb 2018 11:09:23 -0800 Subject: [PATCH 207/298] Use the module cache to resolve non relative module name as well --- src/compiler/diagnosticMessages.json | 2 +- src/compiler/moduleNameResolver.ts | 20 +++++++-- src/compiler/resolutionCache.ts | 17 +++++-- .../unittests/tsserverProjectSystem.ts | 45 ++++++++++++------- src/server/project.ts | 4 ++ .../reference/cacheResolutions.trace.json | 4 +- .../cachedModuleResolution1.trace.json | 2 +- .../cachedModuleResolution2.trace.json | 2 +- .../cachedModuleResolution3.trace.json | 2 +- .../cachedModuleResolution4.trace.json | 2 +- .../cachedModuleResolution5.trace.json | 2 +- .../cachedModuleResolution6.trace.json | 2 +- .../cachedModuleResolution7.trace.json | 2 +- .../cachedModuleResolution8.trace.json | 2 +- .../cachedModuleResolution9.trace.json | 2 +- .../typeReferenceDirectives12.trace.json | 2 +- .../typeReferenceDirectives9.trace.json | 2 +- 17 files changed, 77 insertions(+), 37 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f120e81283a..2fc24ca7a84 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3296,7 +3296,7 @@ "category": "Message", "code": 6146 }, - "Resolution for module '{0}' was found in cache.": { + "Resolution for module '{0}' was found in cache from location '{1}'.": { "category": "Message", "code": 6147 }, diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 50181bb98e4..798fd169585 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -335,8 +335,20 @@ namespace ts { } export function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache { - const directoryToModuleNameMap = createMap>(); - const moduleNameToDirectoryMap = createMap(); + return createModuleResolutionCacheWithMaps( + createMap>(), + createMap(), + currentDirectory, + getCanonicalFileName + ); + } + + /*@internal*/ + export function createModuleResolutionCacheWithMaps( + directoryToModuleNameMap: Map>, + moduleNameToDirectoryMap: Map, + currentDirectory: string, + getCanonicalFileName: GetCanonicalFileName): ModuleResolutionCache { return { getOrCreateCacheForDirectory, getOrCreateCacheForModuleName }; @@ -445,7 +457,7 @@ namespace ts { if (result) { if (traceEnabled) { - trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } } else { @@ -1187,7 +1199,7 @@ namespace ts { const result = cache && cache.get(containingDirectory); if (result) { if (traceEnabled) { - trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index e907d2d62b7..e6bab4f6860 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -42,6 +42,7 @@ namespace ts { export interface ResolutionCacheHost extends ModuleResolutionHost { toPath(fileName: string): Path; + getCanonicalFileName: GetCanonicalFileName; getCompilationSettings(): CompilerOptions; watchDirectoryOfFailedLookupLocation(directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags): FileWatcher; onInvalidatedResolution(): void; @@ -78,18 +79,25 @@ namespace ts { let filesWithInvalidatedResolutions: Map | undefined; let allFilesHaveInvalidatedResolution = false; + const getCurrentDirectory = memoize(() => resolutionHost.getCurrentDirectory()); + const cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); + // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. // The key in the map is source file's path. // The values are Map of resolutions with key being name lookedup. const resolvedModuleNames = createMap>(); const perDirectoryResolvedModuleNames = createMap>(); + const nonRelaticeModuleNameCache = createMap(); + const moduleResolutionCache = createModuleResolutionCacheWithMaps( + perDirectoryResolvedModuleNames, + nonRelaticeModuleNameCache, + getCurrentDirectory(), + resolutionHost.getCanonicalFileName + ); const resolvedTypeReferenceDirectives = createMap>(); const perDirectoryResolvedTypeReferenceDirectives = createMap>(); - const getCurrentDirectory = memoize(() => resolutionHost.getCurrentDirectory()); - const cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); - /** * These are the extensions that failed lookup files will have by default, * any other extension of failed lookup will be store that path in custom failed lookup path @@ -173,6 +181,7 @@ namespace ts { function clearPerDirectoryResolutions() { perDirectoryResolvedModuleNames.clear(); + nonRelaticeModuleNameCache.clear(); perDirectoryResolvedTypeReferenceDirectives.clear(); } @@ -189,7 +198,7 @@ namespace ts { } function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { - const primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); + const primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { return primaryResult; diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 02776b4de07..801d5876485 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -7016,9 +7016,13 @@ namespace ts.projectSystem { return foundModule; } - function getExpectedMissedLocationResolutionTrace(host: TestServerHost, expectedTrace: string[], dirPath: string, module: FileOrFolder, moduleName: string, useNodeModules: boolean) { + function getExpectedMissedLocationResolutionTrace(host: TestServerHost, expectedTrace: string[], dirPath: string, module: FileOrFolder, moduleName: string, useNodeModules: boolean, cacheLocation?: string) { let foundModule = false; forEachAncestorDirectory(dirPath, dirPath => { + if (dirPath === cacheLocation) { + return foundModule; + } + const directory = useNodeModules ? combinePaths(dirPath, nodeModules) : dirPath; if (useNodeModules && !foundModule && !host.directoryExists(directory)) { expectedTrace.push(`Directory '${directory}' does not exist, skipping all lookups in it.`); @@ -7043,8 +7047,10 @@ namespace ts.projectSystem { ); } - function getExpectedResolutionTraceFooter(expectedTrace: string[], module: FileOrFolder, moduleName: string, addRealPathTrace: boolean) { - expectedTrace.push(`File '${module.path}' exist - use it as a name resolution result.`); + function getExpectedResolutionTraceFooter(expectedTrace: string[], module: FileOrFolder, moduleName: string, addRealPathTrace: boolean, ignoreModuleFileFound?: boolean) { + if (!ignoreModuleFileFound) { + expectedTrace.push(`File '${module.path}' exist - use it as a name resolution result.`); + } if (addRealPathTrace) { expectedTrace.push(`Resolving real path for '${module.path}', result '${module.path}'.`); } @@ -7067,6 +7073,15 @@ namespace ts.projectSystem { return expectedTrace; } + function getExpectedNonRelativeModuleResolutionFromCacheTrace(host: TestServerHost, file: FileOrFolder, module: FileOrFolder, moduleName: string, cacheLocation: string, expectedTrace: string[] = []) { + getExpectedResolutionTraceHeader(expectedTrace, file, moduleName); + expectedTrace.push(`Loading module '${moduleName}' from 'node_modules' folder, target file type 'TypeScript'.`); + getExpectedMissedLocationResolutionTrace(host, expectedTrace, getDirectoryPath(file.path), module, moduleName, /*useNodeModules*/ true, cacheLocation); + expectedTrace.push(`Resolution for module '${moduleName}' was found in cache from location '${cacheLocation}'.`); + getExpectedResolutionTraceFooter(expectedTrace, module, moduleName, /*addRealPathTrace*/ true, /*ignoreModuleFileFound*/ true); + return expectedTrace; + } + function getExpectedReusingResolutionFromOldProgram(file: FileOrFolder, moduleName: string) { return `Reusing resolution of module '${moduleName}' to file '${file.path}' from old program.`; } @@ -7223,12 +7238,12 @@ namespace ts.projectSystem { service.openClientFile(file1.path); const expectedTrace = getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name); getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file2, module1, module1Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file2, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file4, module1, module1Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file4, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file3, module1, module1Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file3, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module1, module1Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module2, module2Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module1, module1Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module2, module2Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module1, module1Name, getDirectoryPath(file4.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module2, module2Name, getDirectoryPath(file4.path), expectedTrace); verifyTrace(resolutionTrace, expectedTrace); verifyWatchesWithConfigFile(host, files, file1); @@ -7266,12 +7281,12 @@ namespace ts.projectSystem { getExpectedRelativeModuleResolutionTrace(host, file1, file3, file3Name, expectedTrace); getExpectedNonRelativeModuleResolutionTrace(host, file1, module1, module1Name, expectedTrace); getExpectedNonRelativeModuleResolutionTrace(host, file1, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file2, module1, module1Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file2, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file4, module1, module1Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file4, module2, module2Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file3, module1, module1Name, expectedTrace); - getExpectedNonRelativeModuleResolutionTrace(host, file3, module2, module2Name, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module1, module1Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file2, module2, module2Name, getDirectoryPath(file1.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module1, module1Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file4, module2, module2Name, `${projectLocation}/product`, expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module1, module1Name, getDirectoryPath(file4.path), expectedTrace); + getExpectedNonRelativeModuleResolutionFromCacheTrace(host, file3, module2, module2Name, getDirectoryPath(file4.path), expectedTrace); verifyTrace(resolutionTrace, expectedTrace); const currentDirectory = getDirectoryPath(file1.path); diff --git a/src/server/project.ts b/src/server/project.ts index 743b4e4bfb7..bfd039f26fb 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -210,6 +210,9 @@ namespace ts.server { /*@internal*/ public directoryStructureHost: DirectoryStructureHost; + /*@internal*/ + public readonly getCanonicalFileName: GetCanonicalFileName; + /*@internal*/ constructor( /*@internal*/readonly projectName: string, @@ -224,6 +227,7 @@ namespace ts.server { currentDirectory: string | undefined) { this.directoryStructureHost = directoryStructureHost; this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory || ""); + this.getCanonicalFileName = this.projectService.toCanonicalFileName; this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds); if (!this.compilerOptions) { diff --git a/tests/baselines/reference/cacheResolutions.trace.json b/tests/baselines/reference/cacheResolutions.trace.json index bf3653b489a..e23322299e6 100644 --- a/tests/baselines/reference/cacheResolutions.trace.json +++ b/tests/baselines/reference/cacheResolutions.trace.json @@ -27,9 +27,9 @@ "File '/tslib.jsx' does not exist.", "======== Module name 'tslib' was not resolved. ========", "======== Resolving module 'tslib' from '/a/b/c/lib1.ts'. ========", - "Resolution for module 'tslib' was found in cache.", + "Resolution for module 'tslib' was found in cache from location '/a/b/c'.", "======== Module name 'tslib' was not resolved. ========", "======== Resolving module 'tslib' from '/a/b/c/lib2.ts'. ========", - "Resolution for module 'tslib' was found in cache.", + "Resolution for module 'tslib' was found in cache from location '/a/b/c'.", "======== Module name 'tslib' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution1.trace.json b/tests/baselines/reference/cachedModuleResolution1.trace.json index c9f40c56796..48997f9784d 100644 --- a/tests/baselines/reference/cachedModuleResolution1.trace.json +++ b/tests/baselines/reference/cachedModuleResolution1.trace.json @@ -13,7 +13,7 @@ "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'.", "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution2.trace.json b/tests/baselines/reference/cachedModuleResolution2.trace.json index a7fc2414f03..197d3a708e3 100644 --- a/tests/baselines/reference/cachedModuleResolution2.trace.json +++ b/tests/baselines/reference/cachedModuleResolution2.trace.json @@ -13,7 +13,7 @@ "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'.", "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution3.trace.json b/tests/baselines/reference/cachedModuleResolution3.trace.json index 6cbab2e0796..2f401df9ef5 100644 --- a/tests/baselines/reference/cachedModuleResolution3.trace.json +++ b/tests/baselines/reference/cachedModuleResolution3.trace.json @@ -16,6 +16,6 @@ "======== Module name 'foo' was successfully resolved to '/a/b/foo.d.ts'. ========", "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'Classic'.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was successfully resolved to '/a/b/foo.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution4.trace.json b/tests/baselines/reference/cachedModuleResolution4.trace.json index c100c0c3814..7771f99ca9f 100644 --- a/tests/baselines/reference/cachedModuleResolution4.trace.json +++ b/tests/baselines/reference/cachedModuleResolution4.trace.json @@ -16,6 +16,6 @@ "File '/a/b/c/d/foo.ts' does not exist.", "File '/a/b/c/d/foo.tsx' does not exist.", "File '/a/b/c/d/foo.d.ts' does not exist.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was successfully resolved to '/a/b/foo.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution5.trace.json b/tests/baselines/reference/cachedModuleResolution5.trace.json index b09cc7a35be..4438192b155 100644 --- a/tests/baselines/reference/cachedModuleResolution5.trace.json +++ b/tests/baselines/reference/cachedModuleResolution5.trace.json @@ -13,7 +13,7 @@ "======== Resolving module 'foo' from '/a/b/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b'.", "Resolving real path for '/a/b/node_modules/foo.d.ts', result '/a/b/node_modules/foo.d.ts'.", "======== Module name 'foo' was successfully resolved to '/a/b/node_modules/foo.d.ts'. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution6.trace.json b/tests/baselines/reference/cachedModuleResolution6.trace.json index 50c1c15b3e1..5d43bb94dd2 100644 --- a/tests/baselines/reference/cachedModuleResolution6.trace.json +++ b/tests/baselines/reference/cachedModuleResolution6.trace.json @@ -19,6 +19,6 @@ "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'NodeJs'.", "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution7.trace.json b/tests/baselines/reference/cachedModuleResolution7.trace.json index fa1db9d115e..49fc1e75b0c 100644 --- a/tests/baselines/reference/cachedModuleResolution7.trace.json +++ b/tests/baselines/reference/cachedModuleResolution7.trace.json @@ -17,6 +17,6 @@ "Loading module 'foo' from 'node_modules' folder, target file type 'TypeScript'.", "Directory '/a/b/c/d/e/node_modules' does not exist, skipping all lookups in it.", "Directory '/a/b/c/d/node_modules' does not exist, skipping all lookups in it.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution8.trace.json b/tests/baselines/reference/cachedModuleResolution8.trace.json index e5241278349..9b7c37c8568 100644 --- a/tests/baselines/reference/cachedModuleResolution8.trace.json +++ b/tests/baselines/reference/cachedModuleResolution8.trace.json @@ -40,6 +40,6 @@ "======== Module name 'foo' was not resolved. ========", "======== Resolving module 'foo' from '/a/b/c/lib.ts'. ========", "Explicitly specified module resolution kind: 'Classic'.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/cachedModuleResolution9.trace.json b/tests/baselines/reference/cachedModuleResolution9.trace.json index bd148cc7ee2..b07e32abf5e 100644 --- a/tests/baselines/reference/cachedModuleResolution9.trace.json +++ b/tests/baselines/reference/cachedModuleResolution9.trace.json @@ -34,6 +34,6 @@ "File '/a/b/c/d/foo.ts' does not exist.", "File '/a/b/c/d/foo.tsx' does not exist.", "File '/a/b/c/d/foo.d.ts' does not exist.", - "Resolution for module 'foo' was found in cache.", + "Resolution for module 'foo' was found in cache from location '/a/b/c'.", "======== Module name 'foo' was not resolved. ========" ] \ No newline at end of file diff --git a/tests/baselines/reference/typeReferenceDirectives12.trace.json b/tests/baselines/reference/typeReferenceDirectives12.trace.json index 62a3b31fa1c..12f8d938c1d 100644 --- a/tests/baselines/reference/typeReferenceDirectives12.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives12.trace.json @@ -16,7 +16,7 @@ "Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.", "======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========", "======== Resolving module './main' from '/mod1.ts'. ========", - "Resolution for module './main' was found in cache.", + "Resolution for module './main' was found in cache from location '/'.", "======== Module name './main' was successfully resolved to '/main.ts'. ========", "======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========", "Resolving with primary search path '/types'.", diff --git a/tests/baselines/reference/typeReferenceDirectives9.trace.json b/tests/baselines/reference/typeReferenceDirectives9.trace.json index 62a3b31fa1c..12f8d938c1d 100644 --- a/tests/baselines/reference/typeReferenceDirectives9.trace.json +++ b/tests/baselines/reference/typeReferenceDirectives9.trace.json @@ -16,7 +16,7 @@ "Resolving real path for '/types/lib/index.d.ts', result '/types/lib/index.d.ts'.", "======== Type reference directive 'lib' was successfully resolved to '/types/lib/index.d.ts', primary: true. ========", "======== Resolving module './main' from '/mod1.ts'. ========", - "Resolution for module './main' was found in cache.", + "Resolution for module './main' was found in cache from location '/'.", "======== Module name './main' was successfully resolved to '/main.ts'. ========", "======== Resolving type reference directive 'lib', containing file '/__inferred type names__.ts', root directory '/types'. ========", "Resolving with primary search path '/types'.", From 73947b6ca727366a76ea3a1cd0311886aee75ed4 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 15:52:10 -0800 Subject: [PATCH 208/298] Minor cleanup in getRenameInfoForNode (#22130) --- src/services/rename.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/services/rename.ts b/src/services/rename.ts index ca46a93f3c9..eed2d120519 100644 --- a/src/services/rename.ts +++ b/src/services/rename.ts @@ -24,25 +24,19 @@ namespace ts.Rename { // Only allow a symbol to be renamed if it actually has at least one declaration. if (symbol) { - const declarations = symbol.getDeclarations(); + const { declarations } = symbol; if (declarations && declarations.length > 0) { // Disallow rename for elements that are defined in the standard TypeScript library. - if (some(declarations, isDefinedInLibraryFile)) { + if (declarations.some(isDefinedInLibraryFile)) { return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (node.kind === SyntaxKind.Identifier && - (node as Identifier).originalKeywordKind === SyntaxKind.DefaultKeyword && - symbol.parent.flags & ts.SymbolFlags.Module) { + if (isIdentifier(node) && node.originalKeywordKind === SyntaxKind.DefaultKeyword && symbol.parent.flags & SymbolFlags.Module) { return undefined; } const kind = SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (!kind) { - return undefined; - } - const specifierName = (isImportOrExportSpecifierName(node) || isStringOrNumericLiteral(node) && node.parent.kind === SyntaxKind.ComputedPropertyName) ? stripQuotes(getTextOfIdentifierOrLiteral(node)) : undefined; @@ -51,13 +45,11 @@ namespace ts.Rename { return getRenameInfoSuccess(displayName, fullDisplayName, kind, SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile); } } - else if (node.kind === SyntaxKind.StringLiteral) { + else if (isStringLiteral(node)) { if (isDefinedInLibraryFile(node)) { return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } - - const displayName = stripQuotes((node as StringLiteral).text); - return getRenameInfoSuccess(displayName, displayName, ScriptElementKind.variableElement, ScriptElementKindModifier.none, node, sourceFile); + return getRenameInfoSuccess(node.text, node.text, ScriptElementKind.variableElement, ScriptElementKindModifier.none, node, sourceFile); } } From 75fa945f007fe60b621b7ec6cbeb69f4d0b09f77 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 15:52:43 -0800 Subject: [PATCH 209/298] Simplify findContainingList (#22128) --- src/services/utilities.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 5c79774073f..589b030d686 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -619,13 +619,7 @@ namespace ts { // be parented by the container of the SyntaxList, not the SyntaxList itself. // In order to find the list item index, we first need to locate SyntaxList itself and then search // for the position of the relevant node (or comma). - const syntaxList = forEach(node.parent.getChildren(), c => { - // find syntax list that covers the span of the node - if (isSyntaxList(c) && c.pos <= node.pos && c.end >= node.end) { - return c; - } - }); - + const syntaxList = find(node.parent.getChildren(), (c): c is SyntaxList => isSyntaxList(c) && rangeContainsRange(c, node)); // Either we didn't find an appropriate list, or the list must contain us. Debug.assert(!syntaxList || contains(syntaxList.getChildren(), node)); return syntaxList; From a299d2dd1c383532d3ea1fe77dfe6fa540365939 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 15:53:49 -0800 Subject: [PATCH 210/298] isDeclarationName: support ComputedPropertyName (#22123) * isDeclarationName: support ComputedPropertyName * update additional baseline --- src/compiler/checker.ts | 2 +- src/compiler/utilities.ts | 11 +- src/harness/harness.ts | 2 +- .../reference/ES5For-ofTypeCheck10.symbols | 2 + .../reference/ES5For-ofTypeCheck10.types | 1 + .../reference/ES5SymbolProperty1.symbols | 1 + .../reference/ES5SymbolProperty1.types | 1 + .../reference/ES5SymbolProperty2.symbols | 1 + .../reference/ES5SymbolProperty2.types | 1 + .../reference/ES5SymbolProperty3.symbols | 1 + .../reference/ES5SymbolProperty3.types | 1 + .../reference/ES5SymbolProperty4.symbols | 1 + .../reference/ES5SymbolProperty4.types | 1 + .../reference/ES5SymbolProperty5.symbols | 1 + .../reference/ES5SymbolProperty5.types | 1 + .../reference/ES5SymbolProperty6.symbols | 1 + .../reference/ES5SymbolProperty6.types | 1 + .../reference/ES5SymbolProperty7.symbols | 1 + .../reference/ES5SymbolProperty7.types | 1 + .../FunctionDeclaration8_es6.symbols | 1 + .../reference/FunctionDeclaration8_es6.types | 1 + .../FunctionDeclaration9_es6.symbols | 1 + .../reference/FunctionDeclaration9_es6.types | 1 + .../FunctionPropertyAssignments5_es6.symbols | 1 + .../FunctionPropertyAssignments5_es6.types | 1 + .../MemberFunctionDeclaration3_es6.symbols | 1 + .../MemberFunctionDeclaration3_es6.types | 1 + .../asyncArrowFunction8_es2017.symbols | 1 + .../asyncArrowFunction8_es2017.types | 1 + .../reference/asyncArrowFunction8_es5.symbols | 1 + .../reference/asyncArrowFunction8_es5.types | 1 + .../reference/asyncArrowFunction8_es6.symbols | 1 + .../reference/asyncArrowFunction8_es6.types | 1 + .../asyncFunctionDeclaration8_es2017.symbols | 1 + .../asyncFunctionDeclaration8_es2017.types | 1 + .../asyncFunctionDeclaration8_es5.symbols | 1 + .../asyncFunctionDeclaration8_es5.types | 1 + .../asyncFunctionDeclaration8_es6.symbols | 1 + .../asyncFunctionDeclaration8_es6.types | 1 + .../asyncFunctionDeclaration9_es2017.symbols | 1 + .../asyncFunctionDeclaration9_es2017.types | 1 + .../asyncFunctionDeclaration9_es5.symbols | 1 + .../asyncFunctionDeclaration9_es5.types | 1 + .../asyncFunctionDeclaration9_es6.symbols | 1 + .../asyncFunctionDeclaration9_es6.types | 1 + .../capturedLetConstInLoop13.symbols | 1 + .../reference/capturedLetConstInLoop13.types | 1 + .../capturedParametersInInitializers2.symbols | 1 + .../capturedParametersInInitializers2.types | 1 + ...checkJsdocTypeTagOnObjectProperty1.symbols | 2 + .../checkJsdocTypeTagOnObjectProperty1.types | 1 + ...mmaOperatorInConditionalExpression.symbols | 2 + ...commaOperatorInConditionalExpression.types | 2 + .../complexRecursiveCollections.symbols | 4 + .../complexRecursiveCollections.types | 4 + .../reference/complicatedPrivacy.symbols | 1 + .../reference/complicatedPrivacy.types | 1 + ...computedPropertiesInDestructuring1.symbols | 7 + .../computedPropertiesInDestructuring1.types | 7 + ...utedPropertiesInDestructuring1_ES6.symbols | 7 + ...mputedPropertiesInDestructuring1_ES6.types | 7 + .../computedPropertyNames10_ES5.symbols | 13 ++ .../computedPropertyNames10_ES5.types | 11 ++ .../computedPropertyNames10_ES6.symbols | 13 ++ .../computedPropertyNames10_ES6.types | 11 ++ .../computedPropertyNames11_ES5.symbols | 12 ++ .../computedPropertyNames11_ES5.types | 11 ++ .../computedPropertyNames11_ES6.symbols | 12 ++ .../computedPropertyNames11_ES6.types | 11 ++ .../computedPropertyNames12_ES5.symbols | 13 ++ .../computedPropertyNames12_ES5.types | 11 ++ .../computedPropertyNames12_ES6.symbols | 13 ++ .../computedPropertyNames12_ES6.types | 11 ++ .../computedPropertyNames13_ES5.symbols | 13 ++ .../computedPropertyNames13_ES5.types | 11 ++ .../computedPropertyNames13_ES6.symbols | 13 ++ .../computedPropertyNames13_ES6.types | 11 ++ .../computedPropertyNames14_ES5.symbols | 9 + .../computedPropertyNames14_ES5.types | 6 + .../computedPropertyNames14_ES6.symbols | 9 + .../computedPropertyNames14_ES6.types | 6 + .../computedPropertyNames15_ES5.symbols | 3 + .../computedPropertyNames15_ES5.types | 3 + .../computedPropertyNames15_ES6.symbols | 3 + .../computedPropertyNames15_ES6.types | 3 + .../computedPropertyNames16_ES5.symbols | 12 ++ .../computedPropertyNames16_ES5.types | 11 ++ .../computedPropertyNames16_ES6.symbols | 12 ++ .../computedPropertyNames16_ES6.types | 11 ++ .../computedPropertyNames17_ES5.symbols | 7 + .../computedPropertyNames17_ES5.types | 6 + .../computedPropertyNames17_ES6.symbols | 7 + .../computedPropertyNames17_ES6.types | 6 + .../computedPropertyNames18_ES5.symbols | 1 + .../computedPropertyNames18_ES5.types | 1 + .../computedPropertyNames18_ES6.symbols | 1 + .../computedPropertyNames18_ES6.types | 1 + .../computedPropertyNames19_ES5.symbols | 1 + .../computedPropertyNames19_ES5.types | 1 + .../computedPropertyNames19_ES6.symbols | 1 + .../computedPropertyNames19_ES6.types | 1 + .../computedPropertyNames1_ES5.symbols | 3 + .../computedPropertyNames1_ES5.types | 2 + .../computedPropertyNames1_ES6.symbols | 3 + .../computedPropertyNames1_ES6.types | 2 + .../computedPropertyNames20_ES5.symbols | 1 + .../computedPropertyNames20_ES5.types | 1 + .../computedPropertyNames20_ES6.symbols | 1 + .../computedPropertyNames20_ES6.types | 1 + .../computedPropertyNames21_ES5.symbols | 1 + .../computedPropertyNames21_ES5.types | 1 + .../computedPropertyNames21_ES6.symbols | 1 + .../computedPropertyNames21_ES6.types | 1 + .../computedPropertyNames22_ES5.symbols | 1 + .../computedPropertyNames22_ES5.types | 1 + .../computedPropertyNames22_ES6.symbols | 1 + .../computedPropertyNames22_ES6.types | 1 + .../computedPropertyNames23_ES5.symbols | 6 + .../computedPropertyNames23_ES5.types | 3 + .../computedPropertyNames23_ES6.symbols | 6 + .../computedPropertyNames23_ES6.types | 3 + .../computedPropertyNames24_ES5.symbols | 1 + .../computedPropertyNames24_ES5.types | 1 + .../computedPropertyNames24_ES6.symbols | 1 + .../computedPropertyNames24_ES6.types | 1 + .../computedPropertyNames25_ES5.symbols | 1 + .../computedPropertyNames25_ES5.types | 1 + .../computedPropertyNames25_ES6.symbols | 1 + .../computedPropertyNames25_ES6.types | 1 + .../computedPropertyNames26_ES5.symbols | 6 + .../computedPropertyNames26_ES5.types | 3 + .../computedPropertyNames26_ES6.symbols | 6 + .../computedPropertyNames26_ES6.types | 3 + .../computedPropertyNames27_ES5.symbols | 1 + .../computedPropertyNames27_ES5.types | 1 + .../computedPropertyNames27_ES6.symbols | 1 + .../computedPropertyNames27_ES6.types | 1 + .../computedPropertyNames28_ES5.symbols | 1 + .../computedPropertyNames28_ES5.types | 1 + .../computedPropertyNames28_ES6.symbols | 1 + .../computedPropertyNames28_ES6.types | 1 + .../computedPropertyNames29_ES5.symbols | 1 + .../computedPropertyNames29_ES5.types | 1 + .../computedPropertyNames29_ES6.symbols | 1 + .../computedPropertyNames29_ES6.types | 1 + .../computedPropertyNames2_ES5.symbols | 6 + .../computedPropertyNames2_ES5.types | 6 + .../computedPropertyNames2_ES6.symbols | 6 + .../computedPropertyNames2_ES6.types | 6 + .../computedPropertyNames30_ES5.symbols | 2 + .../computedPropertyNames30_ES5.types | 1 + .../computedPropertyNames30_ES6.symbols | 2 + .../computedPropertyNames30_ES6.types | 1 + .../computedPropertyNames31_ES5.symbols | 1 + .../computedPropertyNames31_ES5.types | 1 + .../computedPropertyNames31_ES6.symbols | 1 + .../computedPropertyNames31_ES6.types | 1 + .../computedPropertyNames32_ES5.symbols | 1 + .../computedPropertyNames32_ES5.types | 1 + .../computedPropertyNames32_ES6.symbols | 1 + .../computedPropertyNames32_ES6.types | 1 + .../computedPropertyNames33_ES5.symbols | 1 + .../computedPropertyNames33_ES5.types | 1 + .../computedPropertyNames33_ES6.symbols | 1 + .../computedPropertyNames33_ES6.types | 1 + .../computedPropertyNames34_ES5.symbols | 1 + .../computedPropertyNames34_ES5.types | 1 + .../computedPropertyNames34_ES6.symbols | 1 + .../computedPropertyNames34_ES6.types | 1 + .../computedPropertyNames35_ES5.symbols | 1 + .../computedPropertyNames35_ES5.types | 1 + .../computedPropertyNames35_ES6.symbols | 1 + .../computedPropertyNames35_ES6.types | 1 + .../computedPropertyNames36_ES5.symbols | 2 + .../computedPropertyNames36_ES5.types | 2 + .../computedPropertyNames36_ES6.symbols | 2 + .../computedPropertyNames36_ES6.types | 2 + .../computedPropertyNames37_ES5.symbols | 2 + .../computedPropertyNames37_ES5.types | 2 + .../computedPropertyNames37_ES6.symbols | 2 + .../computedPropertyNames37_ES6.types | 2 + .../computedPropertyNames38_ES5.symbols | 2 + .../computedPropertyNames38_ES5.types | 2 + .../computedPropertyNames38_ES6.symbols | 2 + .../computedPropertyNames38_ES6.types | 2 + .../computedPropertyNames39_ES5.symbols | 2 + .../computedPropertyNames39_ES5.types | 2 + .../computedPropertyNames39_ES6.symbols | 2 + .../computedPropertyNames39_ES6.types | 2 + .../computedPropertyNames3_ES5.symbols | 8 + .../computedPropertyNames3_ES5.types | 6 + .../computedPropertyNames3_ES6.symbols | 8 + .../computedPropertyNames3_ES6.types | 6 + .../computedPropertyNames40_ES5.symbols | 2 + .../computedPropertyNames40_ES5.types | 2 + .../computedPropertyNames40_ES6.symbols | 2 + .../computedPropertyNames40_ES6.types | 2 + .../computedPropertyNames41_ES5.symbols | 1 + .../computedPropertyNames41_ES5.types | 1 + .../computedPropertyNames41_ES6.symbols | 1 + .../computedPropertyNames41_ES6.types | 1 + .../computedPropertyNames42_ES5.symbols | 1 + .../computedPropertyNames42_ES5.types | 1 + .../computedPropertyNames42_ES6.symbols | 1 + .../computedPropertyNames42_ES6.types | 1 + .../computedPropertyNames43_ES5.symbols | 2 + .../computedPropertyNames43_ES5.types | 2 + .../computedPropertyNames43_ES6.symbols | 2 + .../computedPropertyNames43_ES6.types | 2 + .../computedPropertyNames44_ES5.symbols | 2 + .../computedPropertyNames44_ES5.types | 2 + .../computedPropertyNames44_ES6.symbols | 2 + .../computedPropertyNames44_ES6.types | 2 + .../computedPropertyNames45_ES5.symbols | 2 + .../computedPropertyNames45_ES5.types | 2 + .../computedPropertyNames45_ES6.symbols | 2 + .../computedPropertyNames45_ES6.types | 2 + .../computedPropertyNames46_ES5.symbols | 2 + .../computedPropertyNames46_ES5.types | 1 + .../computedPropertyNames46_ES6.symbols | 2 + .../computedPropertyNames46_ES6.types | 1 + .../computedPropertyNames47_ES5.symbols | 1 + .../computedPropertyNames47_ES5.types | 1 + .../computedPropertyNames47_ES6.symbols | 1 + .../computedPropertyNames47_ES6.types | 1 + .../computedPropertyNames48_ES5.symbols | 4 + .../computedPropertyNames48_ES5.types | 3 + .../computedPropertyNames48_ES6.symbols | 4 + .../computedPropertyNames48_ES6.types | 3 + .../computedPropertyNames49_ES5.symbols | 6 + .../computedPropertyNames49_ES5.types | 3 + .../computedPropertyNames49_ES6.symbols | 6 + .../computedPropertyNames49_ES6.types | 3 + .../computedPropertyNames4_ES5.symbols | 13 ++ .../computedPropertyNames4_ES5.types | 11 ++ .../computedPropertyNames4_ES6.symbols | 13 ++ .../computedPropertyNames4_ES6.types | 11 ++ .../computedPropertyNames50_ES5.symbols | 6 + .../computedPropertyNames50_ES5.types | 3 + .../computedPropertyNames50_ES6.symbols | 6 + .../computedPropertyNames50_ES6.types | 3 + .../computedPropertyNames51_ES5.symbols | 2 + .../computedPropertyNames51_ES5.types | 2 + .../computedPropertyNames51_ES6.symbols | 2 + .../computedPropertyNames51_ES6.types | 2 + .../computedPropertyNames5_ES5.symbols | 9 + .../computedPropertyNames5_ES5.types | 6 + .../computedPropertyNames5_ES6.symbols | 9 + .../computedPropertyNames5_ES6.types | 6 + .../computedPropertyNames6_ES5.symbols | 3 + .../computedPropertyNames6_ES5.types | 3 + .../computedPropertyNames6_ES6.symbols | 3 + .../computedPropertyNames6_ES6.types | 3 + .../computedPropertyNames7_ES5.symbols | 1 + .../computedPropertyNames7_ES5.types | 1 + .../computedPropertyNames7_ES6.symbols | 1 + .../computedPropertyNames7_ES6.types | 1 + .../computedPropertyNames8_ES5.symbols | 2 + .../computedPropertyNames8_ES5.types | 2 + .../computedPropertyNames8_ES6.symbols | 2 + .../computedPropertyNames8_ES6.types | 2 + .../computedPropertyNames9_ES5.symbols | 3 + .../computedPropertyNames9_ES5.types | 3 + .../computedPropertyNames9_ES6.symbols | 3 + .../computedPropertyNames9_ES6.types | 3 + ...dPropertyNamesContextualType10_ES5.symbols | 3 + ...tedPropertyNamesContextualType10_ES5.types | 2 + ...dPropertyNamesContextualType10_ES6.symbols | 3 + ...tedPropertyNamesContextualType10_ES6.types | 2 + ...edPropertyNamesContextualType1_ES5.symbols | 2 + ...utedPropertyNamesContextualType1_ES5.types | 2 + ...edPropertyNamesContextualType1_ES6.symbols | 2 + ...utedPropertyNamesContextualType1_ES6.types | 2 + ...edPropertyNamesContextualType2_ES5.symbols | 2 + ...utedPropertyNamesContextualType2_ES5.types | 2 + ...edPropertyNamesContextualType2_ES6.symbols | 2 + ...utedPropertyNamesContextualType2_ES6.types | 2 + ...edPropertyNamesContextualType3_ES5.symbols | 2 + ...utedPropertyNamesContextualType3_ES5.types | 2 + ...edPropertyNamesContextualType3_ES6.symbols | 2 + ...utedPropertyNamesContextualType3_ES6.types | 2 + ...edPropertyNamesContextualType4_ES5.symbols | 3 + ...utedPropertyNamesContextualType4_ES5.types | 2 + ...edPropertyNamesContextualType4_ES6.symbols | 3 + ...utedPropertyNamesContextualType4_ES6.types | 2 + ...edPropertyNamesContextualType5_ES5.symbols | 3 + ...utedPropertyNamesContextualType5_ES5.types | 2 + ...edPropertyNamesContextualType5_ES6.symbols | 3 + ...utedPropertyNamesContextualType5_ES6.types | 2 + ...edPropertyNamesContextualType6_ES5.symbols | 6 + ...utedPropertyNamesContextualType6_ES5.types | 3 + ...edPropertyNamesContextualType6_ES6.symbols | 6 + ...utedPropertyNamesContextualType6_ES6.types | 3 + ...edPropertyNamesContextualType7_ES5.symbols | 6 + ...utedPropertyNamesContextualType7_ES5.types | 3 + ...edPropertyNamesContextualType7_ES6.symbols | 6 + ...utedPropertyNamesContextualType7_ES6.types | 3 + ...edPropertyNamesContextualType8_ES5.symbols | 3 + ...utedPropertyNamesContextualType8_ES5.types | 2 + ...edPropertyNamesContextualType8_ES6.symbols | 3 + ...utedPropertyNamesContextualType8_ES6.types | 2 + ...edPropertyNamesContextualType9_ES5.symbols | 3 + ...utedPropertyNamesContextualType9_ES5.types | 2 + ...edPropertyNamesContextualType9_ES6.symbols | 3 + ...utedPropertyNamesContextualType9_ES6.types | 2 + ...dPropertyNamesDeclarationEmit1_ES5.symbols | 5 + ...tedPropertyNamesDeclarationEmit1_ES5.types | 3 + ...dPropertyNamesDeclarationEmit1_ES6.symbols | 5 + ...tedPropertyNamesDeclarationEmit1_ES6.types | 3 + ...dPropertyNamesDeclarationEmit2_ES5.symbols | 5 + ...tedPropertyNamesDeclarationEmit2_ES5.types | 3 + ...dPropertyNamesDeclarationEmit2_ES6.symbols | 5 + ...tedPropertyNamesDeclarationEmit2_ES6.types | 3 + ...dPropertyNamesDeclarationEmit3_ES5.symbols | 1 + ...tedPropertyNamesDeclarationEmit3_ES5.types | 1 + ...dPropertyNamesDeclarationEmit3_ES6.symbols | 1 + ...tedPropertyNamesDeclarationEmit3_ES6.types | 1 + ...dPropertyNamesDeclarationEmit4_ES5.symbols | 1 + ...tedPropertyNamesDeclarationEmit4_ES5.types | 1 + ...dPropertyNamesDeclarationEmit4_ES6.symbols | 1 + ...tedPropertyNamesDeclarationEmit4_ES6.types | 1 + ...dPropertyNamesDeclarationEmit5_ES5.symbols | 7 + ...tedPropertyNamesDeclarationEmit5_ES5.types | 4 + ...dPropertyNamesDeclarationEmit5_ES6.symbols | 7 + ...tedPropertyNamesDeclarationEmit5_ES6.types | 4 + ...mputedPropertyNamesOnOverloads_ES5.symbols | 3 + ...computedPropertyNamesOnOverloads_ES5.types | 3 + ...mputedPropertyNamesOnOverloads_ES6.symbols | 3 + ...computedPropertyNamesOnOverloads_ES6.types | 3 + ...omputedPropertyNamesSourceMap1_ES5.symbols | 2 + .../computedPropertyNamesSourceMap1_ES5.types | 2 + ...omputedPropertyNamesSourceMap1_ES6.symbols | 2 + .../computedPropertyNamesSourceMap1_ES6.types | 2 + ...omputedPropertyNamesSourceMap2_ES5.symbols | 2 + .../computedPropertyNamesSourceMap2_ES5.types | 2 + ...omputedPropertyNamesSourceMap2_ES6.symbols | 2 + .../computedPropertyNamesSourceMap2_ES6.types | 2 + ...tedPropertyNamesWithStaticProperty.symbols | 3 + ...putedPropertyNamesWithStaticProperty.types | 3 + .../constEnumPropertyAccess1.symbols | 3 + .../reference/constEnumPropertyAccess1.types | 3 + .../decoratorOnClassMethod13.symbols | 2 + .../reference/decoratorOnClassMethod13.types | 2 + .../reference/decoratorOnClassMethod4.symbols | 1 + .../reference/decoratorOnClassMethod4.types | 1 + .../reference/decoratorOnClassMethod5.symbols | 1 + .../reference/decoratorOnClassMethod5.types | 1 + .../reference/decoratorOnClassMethod6.symbols | 1 + .../reference/decoratorOnClassMethod6.types | 1 + .../reference/decoratorOnClassMethod7.symbols | 1 + .../reference/decoratorOnClassMethod7.types | 1 + .../decoratorsOnComputedProperties.symbols | 161 ++++++++++++++++++ .../decoratorsOnComputedProperties.types | 152 +++++++++++++++++ .../duplicateIdentifierComputedName.symbols | 2 + .../duplicateIdentifierComputedName.types | 2 + .../baselines/reference/dynamicNames.symbols | 36 ++++ tests/baselines/reference/dynamicNames.types | 36 ++++ .../reference/dynamicNamesErrors.symbols | 21 +++ .../reference/dynamicNamesErrors.types | 21 +++ ...ssDeclarationWithGetterSetterInES6.symbols | 6 + ...lassDeclarationWithGetterSetterInES6.types | 6 + ...mitClassDeclarationWithMethodInES6.symbols | 6 + .../emitClassDeclarationWithMethodInES6.types | 6 + .../es5-asyncFunctionObjectLiterals.symbols | 5 + .../es5-asyncFunctionObjectLiterals.types | 5 + .../exportDefaultParenthesize.symbols | 99 ++++++++--- .../reference/exportDefaultParenthesize.types | 24 +++ .../reference/exportEqualsAmd.symbols | 1 + .../baselines/reference/exportEqualsAmd.types | 1 + .../reference/exportEqualsCommonJs.symbols | 1 + .../reference/exportEqualsCommonJs.types | 1 + .../reference/exportEqualsUmd.symbols | 1 + .../baselines/reference/exportEqualsUmd.types | 1 + tests/baselines/reference/for-of15.symbols | 1 + tests/baselines/reference/for-of15.types | 1 + tests/baselines/reference/for-of16.symbols | 1 + tests/baselines/reference/for-of16.types | 1 + tests/baselines/reference/for-of17.symbols | 1 + tests/baselines/reference/for-of17.types | 1 + tests/baselines/reference/for-of18.symbols | 1 + tests/baselines/reference/for-of18.types | 1 + tests/baselines/reference/for-of19.symbols | 1 + tests/baselines/reference/for-of19.types | 1 + tests/baselines/reference/for-of20.symbols | 1 + tests/baselines/reference/for-of20.types | 1 + tests/baselines/reference/for-of21.symbols | 1 + tests/baselines/reference/for-of21.types | 1 + tests/baselines/reference/for-of22.symbols | 1 + tests/baselines/reference/for-of22.types | 1 + tests/baselines/reference/for-of23.symbols | 1 + tests/baselines/reference/for-of23.types | 1 + tests/baselines/reference/for-of25.symbols | 1 + tests/baselines/reference/for-of25.types | 1 + tests/baselines/reference/for-of26.symbols | 1 + tests/baselines/reference/for-of26.types | 1 + tests/baselines/reference/for-of27.symbols | 1 + tests/baselines/reference/for-of27.types | 1 + tests/baselines/reference/for-of28.symbols | 1 + tests/baselines/reference/for-of28.types | 1 + tests/baselines/reference/for-of29.symbols | 1 + tests/baselines/reference/for-of29.types | 1 + tests/baselines/reference/for-of30.symbols | 1 + tests/baselines/reference/for-of30.types | 1 + tests/baselines/reference/for-of31.symbols | 1 + tests/baselines/reference/for-of31.types | 1 + tests/baselines/reference/for-of33.symbols | 1 + tests/baselines/reference/for-of33.types | 1 + tests/baselines/reference/for-of34.symbols | 1 + tests/baselines/reference/for-of34.types | 1 + tests/baselines/reference/for-of35.symbols | 1 + tests/baselines/reference/for-of35.types | 1 + .../reference/generatorES6_6.symbols | 1 + .../baselines/reference/generatorES6_6.types | 1 + .../reference/generatorTypeCheck28.symbols | 1 + .../reference/generatorTypeCheck28.types | 1 + .../reference/generatorTypeCheck41.symbols | 1 + .../reference/generatorTypeCheck41.types | 1 + .../reference/generatorTypeCheck42.symbols | 1 + .../reference/generatorTypeCheck42.types | 1 + .../reference/generatorTypeCheck43.symbols | 1 + .../reference/generatorTypeCheck43.types | 1 + .../reference/generatorTypeCheck44.symbols | 2 + .../reference/generatorTypeCheck44.types | 1 + .../reference/generatorTypeCheck46.symbols | 1 + .../reference/generatorTypeCheck46.types | 1 + .../reference/generatorTypeCheck56.symbols | 2 + .../reference/generatorTypeCheck56.types | 1 + tests/baselines/reference/giant.symbols | 16 ++ tests/baselines/reference/giant.types | 8 + ...dexSignatureMustHaveTypeAnnotation.symbols | 3 + ...indexSignatureMustHaveTypeAnnotation.types | 2 + .../indexSignatureWithInitializer.symbols | 2 + .../indexSignatureWithInitializer.types | 2 + .../reference/indexWithoutParamType2.symbols | 1 + .../reference/indexWithoutParamType2.types | 1 + .../baselines/reference/intTypeCheck.symbols | 4 + tests/baselines/reference/intTypeCheck.types | 2 + .../intersectionTypeInference3.symbols | 1 + .../intersectionTypeInference3.types | 1 + .../reference/invalidNewTarget.es5.symbols | 5 + .../reference/invalidNewTarget.es5.types | 3 + .../reference/invalidNewTarget.es6.symbols | 5 + .../reference/invalidNewTarget.es6.types | 3 + .../reference/iterableArrayPattern1.symbols | 1 + .../reference/iterableArrayPattern1.types | 1 + .../reference/iterableArrayPattern10.symbols | 1 + .../reference/iterableArrayPattern10.types | 1 + .../reference/iterableArrayPattern11.symbols | 1 + .../reference/iterableArrayPattern11.types | 1 + .../reference/iterableArrayPattern12.symbols | 1 + .../reference/iterableArrayPattern12.types | 1 + .../reference/iterableArrayPattern13.symbols | 1 + .../reference/iterableArrayPattern13.types | 1 + .../reference/iterableArrayPattern14.symbols | 1 + .../reference/iterableArrayPattern14.types | 1 + .../reference/iterableArrayPattern15.symbols | 1 + .../reference/iterableArrayPattern15.types | 1 + .../reference/iterableArrayPattern16.symbols | 2 + .../reference/iterableArrayPattern16.types | 2 + .../reference/iterableArrayPattern17.symbols | 1 + .../reference/iterableArrayPattern17.types | 1 + .../reference/iterableArrayPattern18.symbols | 1 + .../reference/iterableArrayPattern18.types | 1 + .../reference/iterableArrayPattern19.symbols | 1 + .../reference/iterableArrayPattern19.types | 1 + .../reference/iterableArrayPattern2.symbols | 1 + .../reference/iterableArrayPattern2.types | 1 + .../reference/iterableArrayPattern20.symbols | 1 + .../reference/iterableArrayPattern20.types | 1 + .../reference/iterableArrayPattern3.symbols | 1 + .../reference/iterableArrayPattern3.types | 1 + .../reference/iterableArrayPattern4.symbols | 1 + .../reference/iterableArrayPattern4.types | 1 + .../reference/iterableArrayPattern5.symbols | 1 + .../reference/iterableArrayPattern5.types | 1 + .../reference/iterableArrayPattern6.symbols | 1 + .../reference/iterableArrayPattern6.types | 1 + .../reference/iterableArrayPattern7.symbols | 1 + .../reference/iterableArrayPattern7.types | 1 + .../reference/iterableArrayPattern8.symbols | 1 + .../reference/iterableArrayPattern8.types | 1 + .../reference/iterableArrayPattern9.symbols | 1 + .../reference/iterableArrayPattern9.types | 1 + .../reference/iteratorSpreadInArray.symbols | 1 + .../reference/iteratorSpreadInArray.types | 1 + .../reference/iteratorSpreadInArray10.symbols | 1 + .../reference/iteratorSpreadInArray10.types | 1 + .../reference/iteratorSpreadInArray2.symbols | 2 + .../reference/iteratorSpreadInArray2.types | 2 + .../reference/iteratorSpreadInArray3.symbols | 1 + .../reference/iteratorSpreadInArray3.types | 1 + .../reference/iteratorSpreadInArray4.symbols | 1 + .../reference/iteratorSpreadInArray4.types | 1 + .../reference/iteratorSpreadInArray5.symbols | 1 + .../reference/iteratorSpreadInArray5.types | 1 + .../reference/iteratorSpreadInArray6.symbols | 1 + .../reference/iteratorSpreadInArray6.types | 1 + .../reference/iteratorSpreadInArray7.symbols | 1 + .../reference/iteratorSpreadInArray7.types | 1 + .../reference/iteratorSpreadInArray9.symbols | 1 + .../reference/iteratorSpreadInArray9.types | 1 + .../reference/iteratorSpreadInCall.symbols | 1 + .../reference/iteratorSpreadInCall.types | 1 + .../reference/iteratorSpreadInCall10.symbols | 1 + .../reference/iteratorSpreadInCall10.types | 1 + .../reference/iteratorSpreadInCall11.symbols | 1 + .../reference/iteratorSpreadInCall11.types | 1 + .../reference/iteratorSpreadInCall12.symbols | 2 + .../reference/iteratorSpreadInCall12.types | 2 + .../reference/iteratorSpreadInCall2.symbols | 1 + .../reference/iteratorSpreadInCall2.types | 1 + .../reference/iteratorSpreadInCall3.symbols | 1 + .../reference/iteratorSpreadInCall3.types | 1 + .../reference/iteratorSpreadInCall4.symbols | 1 + .../reference/iteratorSpreadInCall4.types | 1 + .../reference/iteratorSpreadInCall5.symbols | 2 + .../reference/iteratorSpreadInCall5.types | 2 + .../reference/iteratorSpreadInCall6.symbols | 2 + .../reference/iteratorSpreadInCall6.types | 2 + .../reference/iteratorSpreadInCall7.symbols | 2 + .../reference/iteratorSpreadInCall7.types | 2 + .../reference/iteratorSpreadInCall8.symbols | 2 + .../reference/iteratorSpreadInCall8.types | 2 + .../reference/iteratorSpreadInCall9.symbols | 2 + .../reference/iteratorSpreadInCall9.types | 2 + .../literalsInComputedProperties1.symbols | 9 + .../literalsInComputedProperties1.types | 9 + ...FromUsingES6FeaturesWithOnlyES5Lib.symbols | 2 + ...orFromUsingES6FeaturesWithOnlyES5Lib.types | 2 + ...ibrary_NoErrorDuplicateLibOptions1.symbols | 2 + ...eLibrary_NoErrorDuplicateLibOptions1.types | 2 + ...ibrary_NoErrorDuplicateLibOptions2.symbols | 2 + ...eLibrary_NoErrorDuplicateLibOptions2.types | 2 + ...larizeLibrary_TargetES5UsingES6Lib.symbols | 2 + ...dularizeLibrary_TargetES5UsingES6Lib.types | 2 + ...larizeLibrary_TargetES6UsingES6Lib.symbols | 2 + ...dularizeLibrary_TargetES6UsingES6Lib.types | 2 + ...als_writeOnlyProperty_dynamicNames.symbols | 2 + ...ocals_writeOnlyProperty_dynamicNames.types | 2 + .../objectLiteralEnumPropertyNames.symbols | 18 ++ .../objectLiteralEnumPropertyNames.types | 18 ++ ...objectLiteralPropertyImplicitlyAny.symbols | 1 + .../objectLiteralPropertyImplicitlyAny.types | 1 + tests/baselines/reference/objectRest.symbols | 2 + tests/baselines/reference/objectRest.types | 2 + .../baselines/reference/objectSpread.symbols | 3 + tests/baselines/reference/objectSpread.types | 3 + .../objectSpreadComputedProperty.symbols | 5 + .../objectSpreadComputedProperty.types | 5 + ...syncGenerators.classMethods.esnext.symbols | 2 + ....asyncGenerators.classMethods.esnext.types | 2 + ...rators.functionDeclarations.esnext.symbols | 1 + ...nerators.functionDeclarations.esnext.types | 1 + ...erators.functionExpressions.esnext.symbols | 1 + ...enerators.functionExpressions.esnext.types | 1 + ...rators.objectLiteralMethods.esnext.symbols | 1 + ...nerators.objectLiteralMethods.esnext.types | 1 + .../parserComputedPropertyName1.symbols | 1 + .../parserComputedPropertyName1.types | 1 + .../parserComputedPropertyName10.symbols | 1 + .../parserComputedPropertyName10.types | 1 + .../parserComputedPropertyName11.symbols | 1 + .../parserComputedPropertyName11.types | 1 + .../parserComputedPropertyName12.symbols | 1 + .../parserComputedPropertyName12.types | 1 + .../parserComputedPropertyName13.symbols | 1 + .../parserComputedPropertyName13.types | 1 + .../parserComputedPropertyName14.symbols | 1 + .../parserComputedPropertyName14.types | 1 + .../parserComputedPropertyName15.symbols | 1 + .../parserComputedPropertyName15.types | 1 + .../parserComputedPropertyName16.symbols | 1 + .../parserComputedPropertyName16.types | 1 + .../parserComputedPropertyName17.symbols | 1 + .../parserComputedPropertyName17.types | 1 + .../parserComputedPropertyName18.symbols | 1 + .../parserComputedPropertyName18.types | 1 + .../parserComputedPropertyName19.symbols | 1 + .../parserComputedPropertyName19.types | 1 + .../parserComputedPropertyName2.symbols | 1 + .../parserComputedPropertyName2.types | 1 + .../parserComputedPropertyName20.symbols | 1 + .../parserComputedPropertyName20.types | 1 + .../parserComputedPropertyName21.symbols | 1 + .../parserComputedPropertyName21.types | 1 + .../parserComputedPropertyName22.symbols | 1 + .../parserComputedPropertyName22.types | 1 + .../parserComputedPropertyName23.symbols | 1 + .../parserComputedPropertyName23.types | 1 + .../parserComputedPropertyName24.symbols | 1 + .../parserComputedPropertyName24.types | 1 + .../parserComputedPropertyName25.symbols | 2 + .../parserComputedPropertyName25.types | 1 + .../parserComputedPropertyName26.symbols | 2 + .../parserComputedPropertyName26.types | 1 + .../parserComputedPropertyName27.symbols | 2 + .../parserComputedPropertyName27.types | 1 + .../parserComputedPropertyName28.symbols | 3 + .../parserComputedPropertyName28.types | 2 + .../parserComputedPropertyName29.symbols | 3 + .../parserComputedPropertyName29.types | 2 + .../parserComputedPropertyName3.symbols | 1 + .../parserComputedPropertyName3.types | 1 + .../parserComputedPropertyName30.symbols | 3 + .../parserComputedPropertyName30.types | 2 + .../parserComputedPropertyName31.symbols | 3 + .../parserComputedPropertyName31.types | 2 + .../parserComputedPropertyName32.symbols | 1 + .../parserComputedPropertyName32.types | 1 + .../parserComputedPropertyName33.symbols | 2 + .../parserComputedPropertyName33.types | 1 + .../parserComputedPropertyName34.symbols | 3 + .../parserComputedPropertyName34.types | 2 + .../parserComputedPropertyName35.symbols | 1 + .../parserComputedPropertyName35.types | 1 + .../parserComputedPropertyName36.symbols | 1 + .../parserComputedPropertyName36.types | 1 + .../parserComputedPropertyName37.symbols | 2 + .../parserComputedPropertyName37.types | 1 + .../parserComputedPropertyName38.symbols | 1 + .../parserComputedPropertyName38.types | 1 + .../parserComputedPropertyName39.symbols | 1 + .../parserComputedPropertyName39.types | 1 + .../parserComputedPropertyName4.symbols | 1 + .../parserComputedPropertyName4.types | 1 + .../parserComputedPropertyName40.symbols | 1 + .../parserComputedPropertyName40.types | 1 + .../parserComputedPropertyName41.symbols | 1 + .../parserComputedPropertyName41.types | 1 + .../parserComputedPropertyName5.symbols | 1 + .../parserComputedPropertyName5.types | 1 + .../parserComputedPropertyName6.symbols | 2 + .../parserComputedPropertyName6.types | 2 + .../parserComputedPropertyName7.symbols | 1 + .../parserComputedPropertyName7.types | 1 + .../parserComputedPropertyName8.symbols | 1 + .../parserComputedPropertyName8.types | 1 + .../parserComputedPropertyName9.symbols | 1 + .../parserComputedPropertyName9.types | 1 + .../parserES5ComputedPropertyName1.symbols | 1 + .../parserES5ComputedPropertyName1.types | 1 + .../parserES5ComputedPropertyName10.symbols | 1 + .../parserES5ComputedPropertyName10.types | 1 + .../parserES5ComputedPropertyName11.symbols | 1 + .../parserES5ComputedPropertyName11.types | 1 + .../parserES5ComputedPropertyName2.symbols | 1 + .../parserES5ComputedPropertyName2.types | 1 + .../parserES5ComputedPropertyName3.symbols | 1 + .../parserES5ComputedPropertyName3.types | 1 + .../parserES5ComputedPropertyName4.symbols | 1 + .../parserES5ComputedPropertyName4.types | 1 + .../parserES5ComputedPropertyName5.symbols | 1 + .../parserES5ComputedPropertyName5.types | 1 + .../parserES5ComputedPropertyName6.symbols | 1 + .../parserES5ComputedPropertyName6.types | 1 + .../parserES5ComputedPropertyName7.symbols | 1 + .../parserES5ComputedPropertyName7.types | 1 + .../parserES5ComputedPropertyName8.symbols | 1 + .../parserES5ComputedPropertyName8.types | 1 + .../parserES5ComputedPropertyName9.symbols | 1 + .../parserES5ComputedPropertyName9.types | 1 + .../parserES5SymbolProperty1.symbols | 1 + .../reference/parserES5SymbolProperty1.types | 1 + .../parserES5SymbolProperty2.symbols | 1 + .../reference/parserES5SymbolProperty2.types | 1 + .../parserES5SymbolProperty3.symbols | 1 + .../reference/parserES5SymbolProperty3.types | 1 + .../parserES5SymbolProperty4.symbols | 1 + .../reference/parserES5SymbolProperty4.types | 1 + .../parserES5SymbolProperty5.symbols | 1 + .../reference/parserES5SymbolProperty5.types | 1 + .../parserES5SymbolProperty6.symbols | 1 + .../reference/parserES5SymbolProperty6.types | 1 + .../parserES5SymbolProperty7.symbols | 1 + .../reference/parserES5SymbolProperty7.types | 1 + .../parserES5SymbolProperty8.symbols | 1 + .../reference/parserES5SymbolProperty8.types | 1 + .../parserES5SymbolProperty9.symbols | 1 + .../reference/parserES5SymbolProperty9.types | 1 + .../reference/parserIndexSignature11.symbols | 2 + .../reference/parserIndexSignature11.types | 1 + .../reference/parserIndexSignature4.symbols | 1 + .../reference/parserIndexSignature4.types | 1 + .../reference/parserIndexSignature5.symbols | 1 + .../reference/parserIndexSignature5.types | 1 + .../reference/parserSymbolIndexer5.symbols | 1 + .../reference/parserSymbolIndexer5.types | 1 + .../reference/parserSymbolProperty1.symbols | 1 + .../reference/parserSymbolProperty1.types | 1 + .../reference/parserSymbolProperty2.symbols | 1 + .../reference/parserSymbolProperty2.types | 1 + .../reference/parserSymbolProperty3.symbols | 1 + .../reference/parserSymbolProperty3.types | 1 + .../reference/parserSymbolProperty4.symbols | 1 + .../reference/parserSymbolProperty4.types | 1 + .../reference/parserSymbolProperty5.symbols | 1 + .../reference/parserSymbolProperty5.types | 1 + .../reference/parserSymbolProperty6.symbols | 1 + .../reference/parserSymbolProperty6.types | 1 + .../reference/parserSymbolProperty7.symbols | 1 + .../reference/parserSymbolProperty7.types | 1 + .../reference/parserSymbolProperty8.symbols | 1 + .../reference/parserSymbolProperty8.types | 1 + .../reference/parserSymbolProperty9.symbols | 1 + .../reference/parserSymbolProperty9.types | 1 + .../reference/privateIndexer2.symbols | 1 + .../baselines/reference/privateIndexer2.types | 1 + .../reference/propertyAssignment.symbols | 1 + .../reference/propertyAssignment.types | 1 + .../subtypingWithObjectMembers.errors.txt | 8 +- ...ComputedPropertiesOfNestedType_ES5.symbols | 1 + ...InComputedPropertiesOfNestedType_ES5.types | 1 + ...ComputedPropertiesOfNestedType_ES6.symbols | 1 + ...InComputedPropertiesOfNestedType_ES6.types | 1 + .../superSymbolIndexedAccess1.symbols | 2 + .../reference/superSymbolIndexedAccess1.types | 2 + .../superSymbolIndexedAccess2.symbols | 2 + .../reference/superSymbolIndexedAccess2.types | 2 + .../superSymbolIndexedAccess3.symbols | 2 + .../reference/superSymbolIndexedAccess3.types | 2 + .../superSymbolIndexedAccess4.symbols | 1 + .../reference/superSymbolIndexedAccess4.types | 1 + .../superSymbolIndexedAccess5.symbols | 2 + .../reference/superSymbolIndexedAccess5.types | 2 + .../superSymbolIndexedAccess6.symbols | 2 + .../reference/superSymbolIndexedAccess6.types | 2 + .../reference/symbolDeclarationEmit1.symbols | 1 + .../reference/symbolDeclarationEmit1.types | 1 + .../reference/symbolDeclarationEmit10.symbols | 2 + .../reference/symbolDeclarationEmit10.types | 2 + .../reference/symbolDeclarationEmit11.symbols | 4 + .../reference/symbolDeclarationEmit11.types | 4 + .../reference/symbolDeclarationEmit12.symbols | 5 + .../reference/symbolDeclarationEmit12.types | 5 + .../reference/symbolDeclarationEmit13.symbols | 2 + .../reference/symbolDeclarationEmit13.types | 2 + .../reference/symbolDeclarationEmit14.symbols | 2 + .../reference/symbolDeclarationEmit14.types | 2 + .../reference/symbolDeclarationEmit2.symbols | 1 + .../reference/symbolDeclarationEmit2.types | 1 + .../reference/symbolDeclarationEmit3.symbols | 3 + .../reference/symbolDeclarationEmit3.types | 3 + .../reference/symbolDeclarationEmit4.symbols | 2 + .../reference/symbolDeclarationEmit4.types | 2 + .../reference/symbolDeclarationEmit5.symbols | 1 + .../reference/symbolDeclarationEmit5.types | 1 + .../reference/symbolDeclarationEmit6.symbols | 1 + .../reference/symbolDeclarationEmit6.types | 1 + .../reference/symbolDeclarationEmit7.symbols | 1 + .../reference/symbolDeclarationEmit7.types | 1 + .../reference/symbolDeclarationEmit8.symbols | 1 + .../reference/symbolDeclarationEmit8.types | 1 + .../reference/symbolDeclarationEmit9.symbols | 1 + .../reference/symbolDeclarationEmit9.types | 1 + .../reference/symbolProperty1.symbols | 3 + .../baselines/reference/symbolProperty1.types | 3 + .../reference/symbolProperty10.symbols | 2 + .../reference/symbolProperty10.types | 2 + .../reference/symbolProperty11.symbols | 1 + .../reference/symbolProperty11.types | 1 + .../reference/symbolProperty12.symbols | 2 + .../reference/symbolProperty12.types | 2 + .../reference/symbolProperty13.symbols | 2 + .../reference/symbolProperty13.types | 2 + .../reference/symbolProperty14.symbols | 2 + .../reference/symbolProperty14.types | 2 + .../reference/symbolProperty15.symbols | 1 + .../reference/symbolProperty15.types | 1 + .../reference/symbolProperty16.symbols | 2 + .../reference/symbolProperty16.types | 2 + .../reference/symbolProperty17.symbols | 1 + .../reference/symbolProperty17.types | 1 + .../reference/symbolProperty18.symbols | 3 + .../reference/symbolProperty18.types | 3 + .../reference/symbolProperty19.symbols | 2 + .../reference/symbolProperty19.types | 2 + .../reference/symbolProperty2.symbols | 3 + .../baselines/reference/symbolProperty2.types | 3 + .../reference/symbolProperty20.symbols | 4 + .../reference/symbolProperty20.types | 4 + .../reference/symbolProperty21.symbols | 5 + .../reference/symbolProperty21.types | 5 + .../reference/symbolProperty22.symbols | 2 + .../reference/symbolProperty22.types | 2 + .../reference/symbolProperty23.symbols | 2 + .../reference/symbolProperty23.types | 2 + .../reference/symbolProperty24.errors.txt | 16 +- .../reference/symbolProperty24.symbols | 2 + .../reference/symbolProperty24.types | 2 + .../reference/symbolProperty25.symbols | 2 + .../reference/symbolProperty25.types | 2 + .../reference/symbolProperty26.symbols | 2 + .../reference/symbolProperty26.types | 2 + .../reference/symbolProperty27.symbols | 2 + .../reference/symbolProperty27.types | 2 + .../reference/symbolProperty28.symbols | 1 + .../reference/symbolProperty28.types | 1 + .../reference/symbolProperty29.symbols | 1 + .../reference/symbolProperty29.types | 1 + .../reference/symbolProperty3.symbols | 3 + .../baselines/reference/symbolProperty3.types | 3 + .../reference/symbolProperty30.symbols | 1 + .../reference/symbolProperty30.types | 1 + .../reference/symbolProperty31.symbols | 1 + .../reference/symbolProperty31.types | 1 + .../reference/symbolProperty32.symbols | 1 + .../reference/symbolProperty32.types | 1 + .../reference/symbolProperty33.symbols | 1 + .../reference/symbolProperty33.types | 1 + .../reference/symbolProperty34.symbols | 1 + .../reference/symbolProperty34.types | 1 + .../reference/symbolProperty35.symbols | 2 + .../reference/symbolProperty35.types | 2 + .../reference/symbolProperty36.symbols | 2 + .../reference/symbolProperty36.types | 2 + .../reference/symbolProperty37.symbols | 2 + .../reference/symbolProperty37.types | 2 + .../reference/symbolProperty38.symbols | 2 + .../reference/symbolProperty38.types | 2 + .../reference/symbolProperty39.symbols | 4 + .../reference/symbolProperty39.types | 4 + .../reference/symbolProperty4.symbols | 3 + .../baselines/reference/symbolProperty4.types | 3 + .../reference/symbolProperty40.symbols | 3 + .../reference/symbolProperty40.types | 3 + .../reference/symbolProperty41.symbols | 3 + .../reference/symbolProperty41.types | 3 + .../reference/symbolProperty42.symbols | 3 + .../reference/symbolProperty42.types | 3 + .../reference/symbolProperty43.symbols | 2 + .../reference/symbolProperty43.types | 2 + .../reference/symbolProperty44.symbols | 2 + .../reference/symbolProperty44.types | 2 + .../reference/symbolProperty45.symbols | 2 + .../reference/symbolProperty45.types | 2 + .../reference/symbolProperty46.symbols | 2 + .../reference/symbolProperty46.types | 2 + .../reference/symbolProperty47.symbols | 2 + .../reference/symbolProperty47.types | 2 + .../reference/symbolProperty48.symbols | 1 + .../reference/symbolProperty48.types | 1 + .../reference/symbolProperty49.symbols | 1 + .../reference/symbolProperty49.types | 1 + .../reference/symbolProperty5.symbols | 3 + .../baselines/reference/symbolProperty5.types | 3 + .../reference/symbolProperty50.symbols | 1 + .../reference/symbolProperty50.types | 1 + .../reference/symbolProperty51.symbols | 1 + .../reference/symbolProperty51.types | 1 + .../reference/symbolProperty52.symbols | 1 + .../reference/symbolProperty52.types | 1 + .../reference/symbolProperty53.symbols | 1 + .../reference/symbolProperty53.types | 1 + .../reference/symbolProperty54.symbols | 1 + .../reference/symbolProperty54.types | 1 + .../reference/symbolProperty55.symbols | 1 + .../reference/symbolProperty55.types | 1 + .../reference/symbolProperty56.symbols | 1 + .../reference/symbolProperty56.types | 1 + .../reference/symbolProperty57.symbols | 1 + .../reference/symbolProperty57.types | 1 + .../reference/symbolProperty58.symbols | 1 + .../reference/symbolProperty58.types | 1 + .../reference/symbolProperty59.symbols | 1 + .../reference/symbolProperty59.types | 1 + .../reference/symbolProperty6.symbols | 4 + .../baselines/reference/symbolProperty6.types | 4 + .../reference/symbolProperty60.symbols | 4 + .../reference/symbolProperty60.types | 4 + .../reference/symbolProperty7.symbols | 4 + .../baselines/reference/symbolProperty7.types | 4 + .../reference/symbolProperty8.symbols | 2 + .../baselines/reference/symbolProperty8.types | 2 + .../reference/symbolProperty9.symbols | 2 + .../baselines/reference/symbolProperty9.types | 2 + ...enthesizesConditionalSubexpression.symbols | 2 + ...arenthesizesConditionalSubexpression.types | 2 + .../typeParameterExtendsPrimitive.symbols | 1 + .../typeParameterExtendsPrimitive.types | 1 + ...metersAndParametersInComputedNames.symbols | 1 + ...rametersAndParametersInComputedNames.types | 1 + .../baselines/reference/uniqueSymbols.symbols | 8 + tests/baselines/reference/uniqueSymbols.types | 8 + .../uniqueSymbolsDeclarations.symbols | 8 + .../reference/uniqueSymbolsDeclarations.types | 8 + .../uniqueSymbolsDeclarationsErrors.symbols | 12 ++ .../uniqueSymbolsDeclarationsErrors.types | 12 ++ 887 files changed, 2503 insertions(+), 50 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index b177c0c9e04..3cd33b923f0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23094,7 +23094,7 @@ namespace ts { const rootChain = () => chainDiagnosticMessages( /*details*/ undefined, Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, - unescapeLeadingUnderscores(declaredProp.escapedName), + symbolToString(declaredProp), typeToString(typeWithThis), typeToString(baseWithThis) ); diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index c6861380d8d..863e8107f33 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1860,16 +1860,9 @@ namespace ts { return false; } - // True if the given identifier, string literal, or number literal is the name of a declaration node + // True if `name` is the name of a declaration node export function isDeclarationName(name: Node): boolean { - switch (name.kind) { - case SyntaxKind.Identifier: - case SyntaxKind.StringLiteral: - case SyntaxKind.NumericLiteral: - return isDeclaration(name.parent) && name.parent.name === name; - default: - return false; - } + return !isSourceFile(name) && !isBindingPattern(name) && isDeclaration(name.parent) && name.parent.name === name; } // See GH#16030 diff --git a/src/harness/harness.ts b/src/harness/harness.ts index e35ecba2a04..d3bd537ad4c 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1532,7 +1532,7 @@ namespace Harness { } if (typesError && symbolsError) { - throw new Error(typesError.message + Harness.IO.newLine() + symbolsError.message); + throw new Error(typesError.stack + Harness.IO.newLine() + symbolsError.stack); } if (typesError) { diff --git a/tests/baselines/reference/ES5For-ofTypeCheck10.symbols b/tests/baselines/reference/ES5For-ofTypeCheck10.symbols index f3b30e9dfc1..5267dd2fbc5 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck10.symbols +++ b/tests/baselines/reference/ES5For-ofTypeCheck10.symbols @@ -16,6 +16,8 @@ class StringIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(ES5For-ofTypeCheck10.ts, 7, 5)) + return this; >this : Symbol(StringIterator, Decl(ES5For-ofTypeCheck10.ts, 0, 0)) } diff --git a/tests/baselines/reference/ES5For-ofTypeCheck10.types b/tests/baselines/reference/ES5For-ofTypeCheck10.types index 8cc3dd26a54..a8f8d990506 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck10.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck10.types @@ -20,6 +20,7 @@ class StringIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : any >Symbol : any >iterator : any diff --git a/tests/baselines/reference/ES5SymbolProperty1.symbols b/tests/baselines/reference/ES5SymbolProperty1.symbols index 134b0df8e17..b7bd0d72929 100644 --- a/tests/baselines/reference/ES5SymbolProperty1.symbols +++ b/tests/baselines/reference/ES5SymbolProperty1.symbols @@ -13,6 +13,7 @@ var obj = { >obj : Symbol(obj, Decl(ES5SymbolProperty1.ts, 5, 3)) [Symbol.foo]: 0 +>[Symbol.foo] : Symbol([Symbol.foo], Decl(ES5SymbolProperty1.ts, 5, 11)) >Symbol.foo : Symbol(SymbolConstructor.foo, Decl(ES5SymbolProperty1.ts, 0, 29)) >Symbol : Symbol(Symbol, Decl(ES5SymbolProperty1.ts, 3, 3)) >foo : Symbol(SymbolConstructor.foo, Decl(ES5SymbolProperty1.ts, 0, 29)) diff --git a/tests/baselines/reference/ES5SymbolProperty1.types b/tests/baselines/reference/ES5SymbolProperty1.types index 13cf5ae85b5..7d76614f798 100644 --- a/tests/baselines/reference/ES5SymbolProperty1.types +++ b/tests/baselines/reference/ES5SymbolProperty1.types @@ -14,6 +14,7 @@ var obj = { >{ [Symbol.foo]: 0} : { [Symbol.foo]: number; } [Symbol.foo]: 0 +>[Symbol.foo] : number >Symbol.foo : string >Symbol : SymbolConstructor >foo : string diff --git a/tests/baselines/reference/ES5SymbolProperty2.symbols b/tests/baselines/reference/ES5SymbolProperty2.symbols index 4e784568baa..38b0bc9a19f 100644 --- a/tests/baselines/reference/ES5SymbolProperty2.symbols +++ b/tests/baselines/reference/ES5SymbolProperty2.symbols @@ -9,6 +9,7 @@ module M { >C : Symbol(C, Decl(ES5SymbolProperty2.ts, 1, 20)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(ES5SymbolProperty2.ts, 3, 20)) >Symbol : Symbol(Symbol, Decl(ES5SymbolProperty2.ts, 1, 7)) } (new C)[Symbol.iterator]; diff --git a/tests/baselines/reference/ES5SymbolProperty2.types b/tests/baselines/reference/ES5SymbolProperty2.types index bea1ad72b6e..8ca1614de7f 100644 --- a/tests/baselines/reference/ES5SymbolProperty2.types +++ b/tests/baselines/reference/ES5SymbolProperty2.types @@ -9,6 +9,7 @@ module M { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : any >Symbol : any >iterator : any diff --git a/tests/baselines/reference/ES5SymbolProperty3.symbols b/tests/baselines/reference/ES5SymbolProperty3.symbols index 8d6ee1fb607..24b43c1e261 100644 --- a/tests/baselines/reference/ES5SymbolProperty3.symbols +++ b/tests/baselines/reference/ES5SymbolProperty3.symbols @@ -6,6 +6,7 @@ class C { >C : Symbol(C, Decl(ES5SymbolProperty3.ts, 0, 16)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(ES5SymbolProperty3.ts, 2, 9)) >Symbol : Symbol(Symbol, Decl(ES5SymbolProperty3.ts, 0, 3)) } diff --git a/tests/baselines/reference/ES5SymbolProperty3.types b/tests/baselines/reference/ES5SymbolProperty3.types index 1a339a88c7c..73800893ac5 100644 --- a/tests/baselines/reference/ES5SymbolProperty3.types +++ b/tests/baselines/reference/ES5SymbolProperty3.types @@ -6,6 +6,7 @@ class C { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : any >Symbol : any >iterator : any diff --git a/tests/baselines/reference/ES5SymbolProperty4.symbols b/tests/baselines/reference/ES5SymbolProperty4.symbols index feb3ab8153a..fd95863c3c3 100644 --- a/tests/baselines/reference/ES5SymbolProperty4.symbols +++ b/tests/baselines/reference/ES5SymbolProperty4.symbols @@ -7,6 +7,7 @@ class C { >C : Symbol(C, Decl(ES5SymbolProperty4.ts, 0, 33)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(ES5SymbolProperty4.ts, 2, 9)) >Symbol.iterator : Symbol(iterator, Decl(ES5SymbolProperty4.ts, 0, 13)) >Symbol : Symbol(Symbol, Decl(ES5SymbolProperty4.ts, 0, 3)) >iterator : Symbol(iterator, Decl(ES5SymbolProperty4.ts, 0, 13)) diff --git a/tests/baselines/reference/ES5SymbolProperty4.types b/tests/baselines/reference/ES5SymbolProperty4.types index 98ab97d5888..4727bb93ec3 100644 --- a/tests/baselines/reference/ES5SymbolProperty4.types +++ b/tests/baselines/reference/ES5SymbolProperty4.types @@ -7,6 +7,7 @@ class C { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : string >Symbol : { iterator: string; } >iterator : string diff --git a/tests/baselines/reference/ES5SymbolProperty5.symbols b/tests/baselines/reference/ES5SymbolProperty5.symbols index 30c3f31ca0b..300dd03011d 100644 --- a/tests/baselines/reference/ES5SymbolProperty5.symbols +++ b/tests/baselines/reference/ES5SymbolProperty5.symbols @@ -7,6 +7,7 @@ class C { >C : Symbol(C, Decl(ES5SymbolProperty5.ts, 0, 33)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(ES5SymbolProperty5.ts, 2, 9)) >Symbol.iterator : Symbol(iterator, Decl(ES5SymbolProperty5.ts, 0, 13)) >Symbol : Symbol(Symbol, Decl(ES5SymbolProperty5.ts, 0, 3)) >iterator : Symbol(iterator, Decl(ES5SymbolProperty5.ts, 0, 13)) diff --git a/tests/baselines/reference/ES5SymbolProperty5.types b/tests/baselines/reference/ES5SymbolProperty5.types index 1e15b6b487f..1b9ce238737 100644 --- a/tests/baselines/reference/ES5SymbolProperty5.types +++ b/tests/baselines/reference/ES5SymbolProperty5.types @@ -7,6 +7,7 @@ class C { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : symbol >Symbol : { iterator: symbol; } >iterator : symbol diff --git a/tests/baselines/reference/ES5SymbolProperty6.symbols b/tests/baselines/reference/ES5SymbolProperty6.symbols index bb2d23e0c1e..d494d6ebfe9 100644 --- a/tests/baselines/reference/ES5SymbolProperty6.symbols +++ b/tests/baselines/reference/ES5SymbolProperty6.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(ES5SymbolProperty6.ts, 0, 0)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(ES5SymbolProperty6.ts, 0, 9)) } (new C)[Symbol.iterator] diff --git a/tests/baselines/reference/ES5SymbolProperty6.types b/tests/baselines/reference/ES5SymbolProperty6.types index 45ac7c31c7b..3d1365f374b 100644 --- a/tests/baselines/reference/ES5SymbolProperty6.types +++ b/tests/baselines/reference/ES5SymbolProperty6.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : any >Symbol : any >iterator : any diff --git a/tests/baselines/reference/ES5SymbolProperty7.symbols b/tests/baselines/reference/ES5SymbolProperty7.symbols index 336d79e7356..3e63bae3104 100644 --- a/tests/baselines/reference/ES5SymbolProperty7.symbols +++ b/tests/baselines/reference/ES5SymbolProperty7.symbols @@ -7,6 +7,7 @@ class C { >C : Symbol(C, Decl(ES5SymbolProperty7.ts, 0, 30)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(ES5SymbolProperty7.ts, 2, 9)) >Symbol.iterator : Symbol(iterator, Decl(ES5SymbolProperty7.ts, 0, 13)) >Symbol : Symbol(Symbol, Decl(ES5SymbolProperty7.ts, 0, 3)) >iterator : Symbol(iterator, Decl(ES5SymbolProperty7.ts, 0, 13)) diff --git a/tests/baselines/reference/ES5SymbolProperty7.types b/tests/baselines/reference/ES5SymbolProperty7.types index b0adad6cf13..b03c10f6a0b 100644 --- a/tests/baselines/reference/ES5SymbolProperty7.types +++ b/tests/baselines/reference/ES5SymbolProperty7.types @@ -7,6 +7,7 @@ class C { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : any >Symbol : { iterator: any; } >iterator : any diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.symbols b/tests/baselines/reference/FunctionDeclaration8_es6.symbols index 037983e8a21..c04f2369ba5 100644 --- a/tests/baselines/reference/FunctionDeclaration8_es6.symbols +++ b/tests/baselines/reference/FunctionDeclaration8_es6.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts === var v = { [yield]: foo } >v : Symbol(v, Decl(FunctionDeclaration8_es6.ts, 0, 3)) +>[yield] : Symbol([yield], Decl(FunctionDeclaration8_es6.ts, 0, 9)) diff --git a/tests/baselines/reference/FunctionDeclaration8_es6.types b/tests/baselines/reference/FunctionDeclaration8_es6.types index 0d3056053d2..2588f042add 100644 --- a/tests/baselines/reference/FunctionDeclaration8_es6.types +++ b/tests/baselines/reference/FunctionDeclaration8_es6.types @@ -2,6 +2,7 @@ var v = { [yield]: foo } >v : { [x: number]: any; } >{ [yield]: foo } : { [x: number]: any; } +>[yield] : any >yield : any >foo : any diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.symbols b/tests/baselines/reference/FunctionDeclaration9_es6.symbols index 0797c51331c..0d6b08438d3 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.symbols +++ b/tests/baselines/reference/FunctionDeclaration9_es6.symbols @@ -4,5 +4,6 @@ function * foo() { var v = { [yield]: foo } >v : Symbol(v, Decl(FunctionDeclaration9_es6.ts, 1, 5)) +>[yield] : Symbol([yield], Decl(FunctionDeclaration9_es6.ts, 1, 11)) >foo : Symbol(foo, Decl(FunctionDeclaration9_es6.ts, 0, 0)) } diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.types b/tests/baselines/reference/FunctionDeclaration9_es6.types index 182b90b3f7a..2b915b82a67 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.types +++ b/tests/baselines/reference/FunctionDeclaration9_es6.types @@ -5,6 +5,7 @@ function * foo() { var v = { [yield]: foo } >v : { [x: number]: () => IterableIterator; } >{ [yield]: foo } : { [x: number]: () => IterableIterator; } +>[yield] : () => IterableIterator >yield : any >foo : () => IterableIterator } diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.symbols b/tests/baselines/reference/FunctionPropertyAssignments5_es6.symbols index f5746daa2ec..9fbe817c646 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.symbols +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts === var v = { *[foo()]() { } } >v : Symbol(v, Decl(FunctionPropertyAssignments5_es6.ts, 0, 3)) +>[foo()] : Symbol([foo()], Decl(FunctionPropertyAssignments5_es6.ts, 0, 9)) diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.types b/tests/baselines/reference/FunctionPropertyAssignments5_es6.types index e2ff6419bf9..9430360e9da 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.types +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.types @@ -2,6 +2,7 @@ var v = { *[foo()]() { } } >v : { [x: number]: () => IterableIterator; } >{ *[foo()]() { } } : { [x: number]: () => IterableIterator; } +>[foo()] : () => IterableIterator >foo() : any >foo : any diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.symbols b/tests/baselines/reference/MemberFunctionDeclaration3_es6.symbols index e2b8b39b363..c50ec77e64d 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration3_es6.symbols +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(MemberFunctionDeclaration3_es6.ts, 0, 0)) *[foo]() { } +>[foo] : Symbol(C[foo], Decl(MemberFunctionDeclaration3_es6.ts, 0, 9)) } diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.types b/tests/baselines/reference/MemberFunctionDeclaration3_es6.types index fca123d15e6..e855cfa730d 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration3_es6.types +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.types @@ -3,5 +3,6 @@ class C { >C : C *[foo]() { } +>[foo] : () => IterableIterator >foo : any } diff --git a/tests/baselines/reference/asyncArrowFunction8_es2017.symbols b/tests/baselines/reference/asyncArrowFunction8_es2017.symbols index 568416e148c..86bb7795092 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es2017.symbols +++ b/tests/baselines/reference/asyncArrowFunction8_es2017.symbols @@ -5,5 +5,6 @@ var foo = async (): Promise => { var v = { [await]: foo } >v : Symbol(v, Decl(asyncArrowFunction8_es2017.ts, 1, 5)) +>[await] : Symbol([await], Decl(asyncArrowFunction8_es2017.ts, 1, 11)) >foo : Symbol(foo, Decl(asyncArrowFunction8_es2017.ts, 0, 3)) } diff --git a/tests/baselines/reference/asyncArrowFunction8_es2017.types b/tests/baselines/reference/asyncArrowFunction8_es2017.types index 62064fe9614..9e8ca263df4 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es2017.types +++ b/tests/baselines/reference/asyncArrowFunction8_es2017.types @@ -7,6 +7,7 @@ var foo = async (): Promise => { var v = { [await]: foo } >v : { [x: number]: () => Promise; } >{ [await]: foo } : { [x: number]: () => Promise; } +>[await] : () => Promise >await : any > : any >foo : () => Promise diff --git a/tests/baselines/reference/asyncArrowFunction8_es5.symbols b/tests/baselines/reference/asyncArrowFunction8_es5.symbols index 414f2303fe3..7a2cee48352 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es5.symbols +++ b/tests/baselines/reference/asyncArrowFunction8_es5.symbols @@ -5,5 +5,6 @@ var foo = async (): Promise => { var v = { [await]: foo } >v : Symbol(v, Decl(asyncArrowFunction8_es5.ts, 1, 5)) +>[await] : Symbol([await], Decl(asyncArrowFunction8_es5.ts, 1, 11)) >foo : Symbol(foo, Decl(asyncArrowFunction8_es5.ts, 0, 3)) } diff --git a/tests/baselines/reference/asyncArrowFunction8_es5.types b/tests/baselines/reference/asyncArrowFunction8_es5.types index c89bf47b0c6..8fd40113995 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es5.types +++ b/tests/baselines/reference/asyncArrowFunction8_es5.types @@ -7,6 +7,7 @@ var foo = async (): Promise => { var v = { [await]: foo } >v : { [x: number]: () => Promise; } >{ [await]: foo } : { [x: number]: () => Promise; } +>[await] : () => Promise >await : any > : any >foo : () => Promise diff --git a/tests/baselines/reference/asyncArrowFunction8_es6.symbols b/tests/baselines/reference/asyncArrowFunction8_es6.symbols index 47117f2c61c..5c20d95a6da 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction8_es6.symbols @@ -5,5 +5,6 @@ var foo = async (): Promise => { var v = { [await]: foo } >v : Symbol(v, Decl(asyncArrowFunction8_es6.ts, 1, 5)) +>[await] : Symbol([await], Decl(asyncArrowFunction8_es6.ts, 1, 11)) >foo : Symbol(foo, Decl(asyncArrowFunction8_es6.ts, 0, 3)) } diff --git a/tests/baselines/reference/asyncArrowFunction8_es6.types b/tests/baselines/reference/asyncArrowFunction8_es6.types index aae1a0dcaeb..7c53be7843e 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es6.types +++ b/tests/baselines/reference/asyncArrowFunction8_es6.types @@ -7,6 +7,7 @@ var foo = async (): Promise => { var v = { [await]: foo } >v : { [x: number]: () => Promise; } >{ [await]: foo } : { [x: number]: () => Promise; } +>[await] : () => Promise >await : any > : any >foo : () => Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es2017.symbols b/tests/baselines/reference/asyncFunctionDeclaration8_es2017.symbols index 07e6d321196..51eb4af0320 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es2017.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es2017.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/async/es2017/functionDeclarations/asyncFunctionDeclaration8_es2017.ts === var v = { [await]: foo } >v : Symbol(v, Decl(asyncFunctionDeclaration8_es2017.ts, 0, 3)) +>[await] : Symbol([await], Decl(asyncFunctionDeclaration8_es2017.ts, 0, 9)) diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration8_es2017.types index 9f28312a392..3e46e59409b 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es2017.types @@ -2,6 +2,7 @@ var v = { [await]: foo } >v : { [x: number]: any; } >{ [await]: foo } : { [x: number]: any; } +>[await] : any >await : any >foo : any diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es5.symbols b/tests/baselines/reference/asyncFunctionDeclaration8_es5.symbols index f30fa4f94d0..ea688e1c593 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es5.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es5.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/async/es5/functionDeclarations/asyncFunctionDeclaration8_es5.ts === var v = { [await]: foo } >v : Symbol(v, Decl(asyncFunctionDeclaration8_es5.ts, 0, 3)) +>[await] : Symbol([await], Decl(asyncFunctionDeclaration8_es5.ts, 0, 9)) diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es5.types b/tests/baselines/reference/asyncFunctionDeclaration8_es5.types index d9073611a37..f8647156d11 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es5.types @@ -2,6 +2,7 @@ var v = { [await]: foo } >v : { [x: number]: any; } >{ [await]: foo } : { [x: number]: any; } +>[await] : any >await : any >foo : any diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration8_es6.symbols index 6c5218b27a6..27e641dd537 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es6.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration8_es6.ts === var v = { [await]: foo } >v : Symbol(v, Decl(asyncFunctionDeclaration8_es6.ts, 0, 3)) +>[await] : Symbol([await], Decl(asyncFunctionDeclaration8_es6.ts, 0, 9)) diff --git a/tests/baselines/reference/asyncFunctionDeclaration8_es6.types b/tests/baselines/reference/asyncFunctionDeclaration8_es6.types index cb5929810e0..43a0245c7e0 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration8_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration8_es6.types @@ -2,6 +2,7 @@ var v = { [await]: foo } >v : { [x: number]: any; } >{ [await]: foo } : { [x: number]: any; } +>[await] : any >await : any >foo : any diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.symbols b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.symbols index a11944c1d4c..c06c92bf801 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.symbols @@ -5,5 +5,6 @@ async function foo(): Promise { var v = { [await]: foo } >v : Symbol(v, Decl(asyncFunctionDeclaration9_es2017.ts, 1, 5)) +>[await] : Symbol([await], Decl(asyncFunctionDeclaration9_es2017.ts, 1, 11)) >foo : Symbol(foo, Decl(asyncFunctionDeclaration9_es2017.ts, 0, 0)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types index c54a75b49ff..47bab654da4 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es2017.types @@ -6,6 +6,7 @@ async function foo(): Promise { var v = { [await]: foo } >v : { [x: number]: () => Promise; } >{ [await]: foo } : { [x: number]: () => Promise; } +>[await] : () => Promise >await : any > : any >foo : () => Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es5.symbols b/tests/baselines/reference/asyncFunctionDeclaration9_es5.symbols index 881371f8347..42a1631dadb 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es5.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es5.symbols @@ -5,5 +5,6 @@ async function foo(): Promise { var v = { [await]: foo } >v : Symbol(v, Decl(asyncFunctionDeclaration9_es5.ts, 1, 5)) +>[await] : Symbol([await], Decl(asyncFunctionDeclaration9_es5.ts, 1, 11)) >foo : Symbol(foo, Decl(asyncFunctionDeclaration9_es5.ts, 0, 0)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es5.types b/tests/baselines/reference/asyncFunctionDeclaration9_es5.types index ca8382e57b1..a049fbc9faa 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es5.types +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es5.types @@ -6,6 +6,7 @@ async function foo(): Promise { var v = { [await]: foo } >v : { [x: number]: () => Promise; } >{ [await]: foo } : { [x: number]: () => Promise; } +>[await] : () => Promise >await : any > : any >foo : () => Promise diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols index 9d46d6f6d8f..5510279008d 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols @@ -5,5 +5,6 @@ async function foo(): Promise { var v = { [await]: foo } >v : Symbol(v, Decl(asyncFunctionDeclaration9_es6.ts, 1, 5)) +>[await] : Symbol([await], Decl(asyncFunctionDeclaration9_es6.ts, 1, 11)) >foo : Symbol(foo, Decl(asyncFunctionDeclaration9_es6.ts, 0, 0)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es6.types b/tests/baselines/reference/asyncFunctionDeclaration9_es6.types index 4bdf4582509..ad3ad1e7b0e 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es6.types +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es6.types @@ -6,6 +6,7 @@ async function foo(): Promise { var v = { [await]: foo } >v : { [x: number]: () => Promise; } >{ [await]: foo } : { [x: number]: () => Promise; } +>[await] : () => Promise >await : any > : any >foo : () => Promise diff --git a/tests/baselines/reference/capturedLetConstInLoop13.symbols b/tests/baselines/reference/capturedLetConstInLoop13.symbols index c7a824d26fa..3f94bb855be 100644 --- a/tests/baselines/reference/capturedLetConstInLoop13.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop13.symbols @@ -23,6 +23,7 @@ class Main { >bar : Symbol(Main.bar, Decl(capturedLetConstInLoop13.ts, 13, 5)) [name + ".a"]: () => { this.foo(name); }, +>[name + ".a"] : Symbol([name + ".a"], Decl(capturedLetConstInLoop13.ts, 9, 22)) >name : Symbol(name, Decl(capturedLetConstInLoop13.ts, 7, 16)) >this.foo : Symbol(Main.foo, Decl(capturedLetConstInLoop13.ts, 15, 33)) >this : Symbol(Main, Decl(capturedLetConstInLoop13.ts, 0, 0)) diff --git a/tests/baselines/reference/capturedLetConstInLoop13.types b/tests/baselines/reference/capturedLetConstInLoop13.types index e6f97255d75..68348e469fe 100644 --- a/tests/baselines/reference/capturedLetConstInLoop13.types +++ b/tests/baselines/reference/capturedLetConstInLoop13.types @@ -29,6 +29,7 @@ class Main { >{ [name + ".a"]: () => { this.foo(name); }, } : { [x: string]: () => void; } [name + ".a"]: () => { this.foo(name); }, +>[name + ".a"] : () => void >name + ".a" : string >name : string >".a" : ".a" diff --git a/tests/baselines/reference/capturedParametersInInitializers2.symbols b/tests/baselines/reference/capturedParametersInInitializers2.symbols index eb87347275f..9de6714868d 100644 --- a/tests/baselines/reference/capturedParametersInInitializers2.symbols +++ b/tests/baselines/reference/capturedParametersInInitializers2.symbols @@ -14,6 +14,7 @@ function foo(y = class {static c = x}, x = 1) { function foo2(y = class {[x] = x}, x = 1) { >foo2 : Symbol(foo2, Decl(capturedParametersInInitializers2.ts, 2, 1)) >y : Symbol(y, Decl(capturedParametersInInitializers2.ts, 3, 14)) +>[x] : Symbol((Anonymous class)[x], Decl(capturedParametersInInitializers2.ts, 3, 25)) >x : Symbol(x, Decl(capturedParametersInInitializers2.ts, 3, 34)) >x : Symbol(x, Decl(capturedParametersInInitializers2.ts, 3, 34)) >x : Symbol(x, Decl(capturedParametersInInitializers2.ts, 3, 34)) diff --git a/tests/baselines/reference/capturedParametersInInitializers2.types b/tests/baselines/reference/capturedParametersInInitializers2.types index d10d3f2b215..89ce29f5476 100644 --- a/tests/baselines/reference/capturedParametersInInitializers2.types +++ b/tests/baselines/reference/capturedParametersInInitializers2.types @@ -17,6 +17,7 @@ function foo2(y = class {[x] = x}, x = 1) { >foo2 : (y?: typeof (Anonymous class), x?: number) => void >y : typeof (Anonymous class) >class {[x] = x} : typeof (Anonymous class) +>[x] : number >x : number >x : number >x : number diff --git a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.symbols b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.symbols index 27f70798c71..24d39dce20a 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.symbols +++ b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.symbols @@ -30,6 +30,8 @@ const obj = { /** @type {number} */ ['b' + 'ar1']: 42, +>['b' + 'ar1'] : Symbol(['b' + 'ar1'], Decl(0.js, 12, 6)) + /** @type {function(number): number} */ arrowFunc: (num) => num + 42 >arrowFunc : Symbol(arrowFunc, Decl(0.js, 14, 20)) diff --git a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.types b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.types index 72c5c55228e..41cf9fff739 100644 --- a/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.types +++ b/tests/baselines/reference/checkJsdocTypeTagOnObjectProperty1.types @@ -35,6 +35,7 @@ const obj = { /** @type {number} */ ['b' + 'ar1']: 42, +>['b' + 'ar1'] : number >'b' + 'ar1' : string >'b' : "b" >'ar1' : "ar1" diff --git a/tests/baselines/reference/commaOperatorInConditionalExpression.symbols b/tests/baselines/reference/commaOperatorInConditionalExpression.symbols index c5734cbbc9b..21937f3f64d 100644 --- a/tests/baselines/reference/commaOperatorInConditionalExpression.symbols +++ b/tests/baselines/reference/commaOperatorInConditionalExpression.symbols @@ -9,8 +9,10 @@ function f (m: string) { >i : Symbol(i, Decl(commaOperatorInConditionalExpression.ts, 1, 18)) return true? { [m]: i } : { [m]: i + 1 } +>[m] : Symbol([m], Decl(commaOperatorInConditionalExpression.ts, 2, 22)) >m : Symbol(m, Decl(commaOperatorInConditionalExpression.ts, 0, 12)) >i : Symbol(i, Decl(commaOperatorInConditionalExpression.ts, 1, 18)) +>[m] : Symbol([m], Decl(commaOperatorInConditionalExpression.ts, 2, 35)) >m : Symbol(m, Decl(commaOperatorInConditionalExpression.ts, 0, 12)) >i : Symbol(i, Decl(commaOperatorInConditionalExpression.ts, 1, 18)) diff --git a/tests/baselines/reference/commaOperatorInConditionalExpression.types b/tests/baselines/reference/commaOperatorInConditionalExpression.types index 1d1037c1206..053f8640e69 100644 --- a/tests/baselines/reference/commaOperatorInConditionalExpression.types +++ b/tests/baselines/reference/commaOperatorInConditionalExpression.types @@ -18,9 +18,11 @@ function f (m: string) { >true? { [m]: i } : { [m]: i + 1 } : { [x: string]: number; } >true : true >{ [m]: i } : { [x: string]: number; } +>[m] : number >m : string >i : number >{ [m]: i + 1 } : { [x: string]: number; } +>[m] : number >m : string >i + 1 : number >i : number diff --git a/tests/baselines/reference/complexRecursiveCollections.symbols b/tests/baselines/reference/complexRecursiveCollections.symbols index 6e0bc95a292..1452a3033dc 100644 --- a/tests/baselines/reference/complexRecursiveCollections.symbols +++ b/tests/baselines/reference/complexRecursiveCollections.symbols @@ -1908,6 +1908,7 @@ declare module Immutable { >T : Symbol(T, Decl(immutable.ts, 219, 30)) [Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>; +>[Symbol.iterator] : Symbol(Instance[Symbol.iterator], Decl(immutable.ts, 256, 46)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -2734,6 +2735,7 @@ declare module Immutable { >context : Symbol(context, Decl(immutable.ts, 353, 62)) [Symbol.iterator](): IterableIterator<[K, V]>; +>[Symbol.iterator] : Symbol(Keyed[Symbol.iterator], Decl(immutable.ts, 353, 84)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -2977,6 +2979,7 @@ declare module Immutable { >context : Symbol(context, Decl(immutable.ts, 385, 69)) [Symbol.iterator](): IterableIterator; +>[Symbol.iterator] : Symbol(Indexed[Symbol.iterator], Decl(immutable.ts, 385, 91)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -3086,6 +3089,7 @@ declare module Immutable { >context : Symbol(context, Decl(immutable.ts, 399, 66)) [Symbol.iterator](): IterableIterator; +>[Symbol.iterator] : Symbol(Set[Symbol.iterator], Decl(immutable.ts, 399, 88)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/complexRecursiveCollections.types b/tests/baselines/reference/complexRecursiveCollections.types index 1622d9ce360..80d007f7884 100644 --- a/tests/baselines/reference/complexRecursiveCollections.types +++ b/tests/baselines/reference/complexRecursiveCollections.types @@ -1908,6 +1908,7 @@ declare module Immutable { >T : T [Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>; +>[Symbol.iterator] : () => IterableIterator<[keyof T, T[keyof T]]> >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -2734,6 +2735,7 @@ declare module Immutable { >context : any [Symbol.iterator](): IterableIterator<[K, V]>; +>[Symbol.iterator] : () => IterableIterator<[K, V]> >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -2977,6 +2979,7 @@ declare module Immutable { >context : any [Symbol.iterator](): IterableIterator; +>[Symbol.iterator] : () => IterableIterator >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -3086,6 +3089,7 @@ declare module Immutable { >context : any [Symbol.iterator](): IterableIterator; +>[Symbol.iterator] : () => IterableIterator >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/complicatedPrivacy.symbols b/tests/baselines/reference/complicatedPrivacy.symbols index a6ab5c4120a..878f6b2227b 100644 --- a/tests/baselines/reference/complicatedPrivacy.symbols +++ b/tests/baselines/reference/complicatedPrivacy.symbols @@ -69,6 +69,7 @@ module m1 { >arg1 : Symbol(arg1, Decl(complicatedPrivacy.ts, 32, 23)) { [number]: C1; // Used to be indexer, now it is a computed property +>[number] : Symbol([number], Decl(complicatedPrivacy.ts, 33, 5)) >C1 : Symbol(C1, Decl(complicatedPrivacy.ts, 50, 5)) }) { diff --git a/tests/baselines/reference/complicatedPrivacy.types b/tests/baselines/reference/complicatedPrivacy.types index 9a832435bb6..790a250e479 100644 --- a/tests/baselines/reference/complicatedPrivacy.types +++ b/tests/baselines/reference/complicatedPrivacy.types @@ -72,6 +72,7 @@ module m1 { >arg1 : {} { [number]: C1; // Used to be indexer, now it is a computed property +>[number] : C1 >number : any >C1 : C1 diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.symbols b/tests/baselines/reference/computedPropertiesInDestructuring1.symbols index 38663d820b9..6d5453ddcb1 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.symbols +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.symbols @@ -74,36 +74,43 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; // destructuring assignment ({[foo]: bar} = {bar: "bar"}); +>[foo] : Symbol([foo], Decl(computedPropertiesInDestructuring1.ts, 23, 2)) >foo : Symbol(foo, Decl(computedPropertiesInDestructuring1.ts, 1, 3)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 2, 5)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 23, 17)) ({["bar"]: bar2} = {bar: "bar"}); +>["bar"] : Symbol(["bar"], Decl(computedPropertiesInDestructuring1.ts, 25, 2)) >"bar" : Symbol(["bar"], Decl(computedPropertiesInDestructuring1.ts, 25, 2)) >bar2 : Symbol(bar2, Decl(computedPropertiesInDestructuring1.ts, 4, 5)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 25, 20)) ({[foo2()]: bar3} = {bar: "bar"}); +>[foo2()] : Symbol([foo2()], Decl(computedPropertiesInDestructuring1.ts, 27, 2)) >foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring1.ts, 6, 3)) >bar3 : Symbol(bar3, Decl(computedPropertiesInDestructuring1.ts, 7, 5)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 27, 21)) [{[foo]: bar4}] = [{bar: "bar"}]; +>[foo] : Symbol([foo], Decl(computedPropertiesInDestructuring1.ts, 29, 2)) >foo : Symbol(foo, Decl(computedPropertiesInDestructuring1.ts, 1, 3)) >bar4 : Symbol(bar4, Decl(computedPropertiesInDestructuring1.ts, 9, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 29, 20)) [{[foo2()]: bar5}] = [{bar: "bar"}]; +>[foo2()] : Symbol([foo2()], Decl(computedPropertiesInDestructuring1.ts, 30, 2)) >foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring1.ts, 6, 3)) >bar5 : Symbol(bar5, Decl(computedPropertiesInDestructuring1.ts, 10, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 30, 23)) [{[foo()]: bar4}] = [{bar: "bar"}]; +>[foo()] : Symbol([foo()], Decl(computedPropertiesInDestructuring1.ts, 32, 2)) >foo : Symbol(foo, Decl(computedPropertiesInDestructuring1.ts, 1, 3)) >bar4 : Symbol(bar4, Decl(computedPropertiesInDestructuring1.ts, 9, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 32, 22)) [{[(1 + {})]: bar4}] = [{bar: "bar"}]; +>[(1 + {})] : Symbol([(1 + {})], Decl(computedPropertiesInDestructuring1.ts, 33, 2)) >bar4 : Symbol(bar4, Decl(computedPropertiesInDestructuring1.ts, 9, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1.ts, 33, 25)) diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.types b/tests/baselines/reference/computedPropertiesInDestructuring1.types index efbcf0fb42a..a8605d2a42c 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.types @@ -106,6 +106,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >({[foo]: bar} = {bar: "bar"}) : { bar: string; } >{[foo]: bar} = {bar: "bar"} : { bar: string; } >{[foo]: bar} : { [x: string]: any; } +>[foo] : any >foo : string >bar : any >{bar: "bar"} : { bar: string; } @@ -116,6 +117,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >({["bar"]: bar2} = {bar: "bar"}) : { bar: string; } >{["bar"]: bar2} = {bar: "bar"} : { bar: string; } >{["bar"]: bar2} : { ["bar"]: string; } +>["bar"] : string >"bar" : "bar" >bar2 : string >{bar: "bar"} : { bar: string; } @@ -126,6 +128,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >({[foo2()]: bar3} = {bar: "bar"}) : { bar: string; } >{[foo2()]: bar3} = {bar: "bar"} : { bar: string; } >{[foo2()]: bar3} : { [x: string]: any; } +>[foo2()] : any >foo2() : string >foo2 : () => string >bar3 : any @@ -137,6 +140,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[foo]: bar4}] = [{bar: "bar"}] : [{ bar: string; }] >[{[foo]: bar4}] : [{ [x: string]: any; }] >{[foo]: bar4} : { [x: string]: any; } +>[foo] : any >foo : string >bar4 : any >[{bar: "bar"}] : [{ bar: string; }] @@ -148,6 +152,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[foo2()]: bar5}] = [{bar: "bar"}] : [{ bar: string; }] >[{[foo2()]: bar5}] : [{ [x: string]: any; }] >{[foo2()]: bar5} : { [x: string]: any; } +>[foo2()] : any >foo2() : string >foo2 : () => string >bar5 : any @@ -160,6 +165,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[foo()]: bar4}] = [{bar: "bar"}] : [{ bar: string; }] >[{[foo()]: bar4}] : [{ [x: number]: any; }] >{[foo()]: bar4} : { [x: number]: any; } +>[foo()] : any >foo() : any >foo : string >bar4 : any @@ -172,6 +178,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[(1 + {})]: bar4}] = [{bar: "bar"}] : [{ bar: string; }] >[{[(1 + {})]: bar4}] : [{ [x: number]: any; }] >{[(1 + {})]: bar4} : { [x: number]: any; } +>[(1 + {})] : any >(1 + {}) : any >1 + {} : any >1 : 1 diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols index e3a6c214404..56e65995c03 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.symbols @@ -79,36 +79,43 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; // destructuring assignment ({[foo]: bar} = {bar: "bar"}); +>[foo] : Symbol([foo], Decl(computedPropertiesInDestructuring1_ES6.ts, 24, 2)) >foo : Symbol(foo, Decl(computedPropertiesInDestructuring1_ES6.ts, 1, 3)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 2, 5)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 24, 17)) ({["bar"]: bar2} = {bar: "bar"}); +>["bar"] : Symbol(["bar"], Decl(computedPropertiesInDestructuring1_ES6.ts, 26, 2)) >"bar" : Symbol(["bar"], Decl(computedPropertiesInDestructuring1_ES6.ts, 26, 2)) >bar2 : Symbol(bar2, Decl(computedPropertiesInDestructuring1_ES6.ts, 4, 5)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 26, 20)) ({[foo2()]: bar3} = {bar: "bar"}); +>[foo2()] : Symbol([foo2()], Decl(computedPropertiesInDestructuring1_ES6.ts, 28, 2)) >foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring1_ES6.ts, 7, 3)) >bar3 : Symbol(bar3, Decl(computedPropertiesInDestructuring1_ES6.ts, 8, 5)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 28, 21)) [{[foo]: bar4}] = [{bar: "bar"}]; +>[foo] : Symbol([foo], Decl(computedPropertiesInDestructuring1_ES6.ts, 30, 2)) >foo : Symbol(foo, Decl(computedPropertiesInDestructuring1_ES6.ts, 1, 3)) >bar4 : Symbol(bar4, Decl(computedPropertiesInDestructuring1_ES6.ts, 10, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 30, 20)) [{[foo2()]: bar5}] = [{bar: "bar"}]; +>[foo2()] : Symbol([foo2()], Decl(computedPropertiesInDestructuring1_ES6.ts, 31, 2)) >foo2 : Symbol(foo2, Decl(computedPropertiesInDestructuring1_ES6.ts, 7, 3)) >bar5 : Symbol(bar5, Decl(computedPropertiesInDestructuring1_ES6.ts, 11, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 31, 23)) [{[foo()]: bar4}] = [{bar: "bar"}]; +>[foo()] : Symbol([foo()], Decl(computedPropertiesInDestructuring1_ES6.ts, 33, 2)) >foo : Symbol(foo, Decl(computedPropertiesInDestructuring1_ES6.ts, 1, 3)) >bar4 : Symbol(bar4, Decl(computedPropertiesInDestructuring1_ES6.ts, 10, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 33, 22)) [{[(1 + {})]: bar4}] = [{bar: "bar"}]; +>[(1 + {})] : Symbol([(1 + {})], Decl(computedPropertiesInDestructuring1_ES6.ts, 34, 2)) >bar4 : Symbol(bar4, Decl(computedPropertiesInDestructuring1_ES6.ts, 10, 6)) >bar : Symbol(bar, Decl(computedPropertiesInDestructuring1_ES6.ts, 34, 25)) diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types index 0197c0b4a82..1a88bc0358d 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types @@ -113,6 +113,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >({[foo]: bar} = {bar: "bar"}) : { bar: string; } >{[foo]: bar} = {bar: "bar"} : { bar: string; } >{[foo]: bar} : { [x: string]: any; } +>[foo] : any >foo : string >bar : any >{bar: "bar"} : { bar: string; } @@ -123,6 +124,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >({["bar"]: bar2} = {bar: "bar"}) : { bar: string; } >{["bar"]: bar2} = {bar: "bar"} : { bar: string; } >{["bar"]: bar2} : { ["bar"]: string; } +>["bar"] : string >"bar" : "bar" >bar2 : string >{bar: "bar"} : { bar: string; } @@ -133,6 +135,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >({[foo2()]: bar3} = {bar: "bar"}) : { bar: string; } >{[foo2()]: bar3} = {bar: "bar"} : { bar: string; } >{[foo2()]: bar3} : { [x: string]: any; } +>[foo2()] : any >foo2() : string >foo2 : () => string >bar3 : any @@ -144,6 +147,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[foo]: bar4}] = [{bar: "bar"}] : [{ bar: string; }] >[{[foo]: bar4}] : [{ [x: string]: any; }] >{[foo]: bar4} : { [x: string]: any; } +>[foo] : any >foo : string >bar4 : any >[{bar: "bar"}] : [{ bar: string; }] @@ -155,6 +159,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[foo2()]: bar5}] = [{bar: "bar"}] : [{ bar: string; }] >[{[foo2()]: bar5}] : [{ [x: string]: any; }] >{[foo2()]: bar5} : { [x: string]: any; } +>[foo2()] : any >foo2() : string >foo2 : () => string >bar5 : any @@ -167,6 +172,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[foo()]: bar4}] = [{bar: "bar"}] : [{ bar: string; }] >[{[foo()]: bar4}] : [{ [x: number]: any; }] >{[foo()]: bar4} : { [x: number]: any; } +>[foo()] : any >foo() : any >foo : string >bar4 : any @@ -179,6 +185,7 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >[{[(1 + {})]: bar4}] = [{bar: "bar"}] : [{ bar: string; }] >[{[(1 + {})]: bar4}] : [{ [x: number]: any; }] >{[(1 + {})]: bar4} : { [x: number]: any; } +>[(1 + {})] : any >(1 + {}) : any >1 + {} : any >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.symbols b/tests/baselines/reference/computedPropertyNames10_ES5.symbols index 7f872b2abf0..a63bac47a28 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames10_ES5.symbols @@ -12,33 +12,46 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames10_ES5.ts, 3, 3)) [s]() { }, +>[s] : Symbol([s], Decl(computedPropertyNames10_ES5.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) [n]() { }, +>[n] : Symbol([n], Decl(computedPropertyNames10_ES5.ts, 4, 14)) >n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) [s + s]() { }, +>[s + s] : Symbol([s + s], Decl(computedPropertyNames10_ES5.ts, 5, 14)) >s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) [s + n]() { }, +>[s + n] : Symbol([s + n], Decl(computedPropertyNames10_ES5.ts, 6, 18)) >s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames10_ES5.ts, 1, 3)) [+s]() { }, +>[+s] : Symbol([+s], Decl(computedPropertyNames10_ES5.ts, 7, 18)) >s : Symbol(s, Decl(computedPropertyNames10_ES5.ts, 0, 3)) [""]() { }, +>[""] : Symbol([""], Decl(computedPropertyNames10_ES5.ts, 8, 15)) >"" : Symbol([""], Decl(computedPropertyNames10_ES5.ts, 8, 15)) [0]() { }, +>[0] : Symbol([0], Decl(computedPropertyNames10_ES5.ts, 9, 15)) >0 : Symbol([0], Decl(computedPropertyNames10_ES5.ts, 9, 15)) [a]() { }, +>[a] : Symbol([a], Decl(computedPropertyNames10_ES5.ts, 10, 14)) >a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) [true]() { }, +>[true] : Symbol([true], Decl(computedPropertyNames10_ES5.ts, 11, 14)) + [`hello bye`]() { }, +>[`hello bye`] : Symbol([`hello bye`], Decl(computedPropertyNames10_ES5.ts, 12, 22)) + [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : Symbol([`hello ${a} bye`], Decl(computedPropertyNames10_ES5.ts, 13, 24)) >a : Symbol(a, Decl(computedPropertyNames10_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index 4750d44fde8..717e12f7216 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -13,42 +13,53 @@ var v = { >{ [s]() { }, [n]() { }, [s + s]() { }, [s + n]() { }, [+s]() { }, [""]() { }, [0]() { }, [a]() { }, [true]() { }, [`hello bye`]() { }, [`hello ${a} bye`]() { }} : { [x: string]: () => void; [x: number]: () => void; [""](): void; [0](): void; } [s]() { }, +>[s] : () => void >s : string [n]() { }, +>[n] : () => void >n : number [s + s]() { }, +>[s + s] : () => void >s + s : string >s : string >s : string [s + n]() { }, +>[s + n] : () => void >s + n : string >s : string >n : number [+s]() { }, +>[+s] : () => void >+s : number >s : string [""]() { }, +>[""] : () => void >"" : "" [0]() { }, +>[0] : () => void >0 : 0 [a]() { }, +>[a] : () => void >a : any [true]() { }, +>[true] : () => void >true : any >true : true [`hello bye`]() { }, +>[`hello bye`] : () => void >`hello bye` : "hello bye" [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : () => void >`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.symbols b/tests/baselines/reference/computedPropertyNames10_ES6.symbols index 5912c3f6941..bbfe8d3808d 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames10_ES6.symbols @@ -12,33 +12,46 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames10_ES6.ts, 3, 3)) [s]() { }, +>[s] : Symbol([s], Decl(computedPropertyNames10_ES6.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) [n]() { }, +>[n] : Symbol([n], Decl(computedPropertyNames10_ES6.ts, 4, 14)) >n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) [s + s]() { }, +>[s + s] : Symbol([s + s], Decl(computedPropertyNames10_ES6.ts, 5, 14)) >s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) [s + n]() { }, +>[s + n] : Symbol([s + n], Decl(computedPropertyNames10_ES6.ts, 6, 18)) >s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames10_ES6.ts, 1, 3)) [+s]() { }, +>[+s] : Symbol([+s], Decl(computedPropertyNames10_ES6.ts, 7, 18)) >s : Symbol(s, Decl(computedPropertyNames10_ES6.ts, 0, 3)) [""]() { }, +>[""] : Symbol([""], Decl(computedPropertyNames10_ES6.ts, 8, 15)) >"" : Symbol([""], Decl(computedPropertyNames10_ES6.ts, 8, 15)) [0]() { }, +>[0] : Symbol([0], Decl(computedPropertyNames10_ES6.ts, 9, 15)) >0 : Symbol([0], Decl(computedPropertyNames10_ES6.ts, 9, 15)) [a]() { }, +>[a] : Symbol([a], Decl(computedPropertyNames10_ES6.ts, 10, 14)) >a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) [true]() { }, +>[true] : Symbol([true], Decl(computedPropertyNames10_ES6.ts, 11, 14)) + [`hello bye`]() { }, +>[`hello bye`] : Symbol([`hello bye`], Decl(computedPropertyNames10_ES6.ts, 12, 22)) + [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : Symbol([`hello ${a} bye`], Decl(computedPropertyNames10_ES6.ts, 13, 24)) >a : Symbol(a, Decl(computedPropertyNames10_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index 3a12047f588..b615e9e4739 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -13,42 +13,53 @@ var v = { >{ [s]() { }, [n]() { }, [s + s]() { }, [s + n]() { }, [+s]() { }, [""]() { }, [0]() { }, [a]() { }, [true]() { }, [`hello bye`]() { }, [`hello ${a} bye`]() { }} : { [x: string]: () => void; [x: number]: () => void; [""](): void; [0](): void; } [s]() { }, +>[s] : () => void >s : string [n]() { }, +>[n] : () => void >n : number [s + s]() { }, +>[s + s] : () => void >s + s : string >s : string >s : string [s + n]() { }, +>[s + n] : () => void >s + n : string >s : string >n : number [+s]() { }, +>[+s] : () => void >+s : number >s : string [""]() { }, +>[""] : () => void >"" : "" [0]() { }, +>[0] : () => void >0 : 0 [a]() { }, +>[a] : () => void >a : any [true]() { }, +>[true] : () => void >true : any >true : true [`hello bye`]() { }, +>[`hello bye`] : () => void >`hello bye` : "hello bye" [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : () => void >`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.symbols b/tests/baselines/reference/computedPropertyNames11_ES5.symbols index f508047a864..e1c7d7231f4 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames11_ES5.symbols @@ -12,39 +12,51 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 3, 3)) get [s]() { return 0; }, +>[s] : Symbol([s], Decl(computedPropertyNames11_ES5.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) set [n](v) { }, +>[n] : Symbol([n], Decl(computedPropertyNames11_ES5.ts, 4, 28)) >n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 5, 12)) get [s + s]() { return 0; }, +>[s + s] : Symbol([s + s], Decl(computedPropertyNames11_ES5.ts, 5, 19)) >s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) set [s + n](v) { }, +>[s + n] : Symbol([s + n], Decl(computedPropertyNames11_ES5.ts, 6, 32)) >s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames11_ES5.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 7, 16)) get [+s]() { return 0; }, +>[+s] : Symbol([+s], Decl(computedPropertyNames11_ES5.ts, 7, 23)) >s : Symbol(s, Decl(computedPropertyNames11_ES5.ts, 0, 3)) set [""](v) { }, +>[""] : Symbol([""], Decl(computedPropertyNames11_ES5.ts, 8, 29)) >"" : Symbol([""], Decl(computedPropertyNames11_ES5.ts, 8, 29)) >v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 9, 13)) get [0]() { return 0; }, +>[0] : Symbol([0], Decl(computedPropertyNames11_ES5.ts, 9, 20)) >0 : Symbol([0], Decl(computedPropertyNames11_ES5.ts, 9, 20)) set [a](v) { }, +>[a] : Symbol([a], Decl(computedPropertyNames11_ES5.ts, 10, 28)) >a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) >v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 11, 12)) get [true]() { return 0; }, +>[true] : Symbol([true], Decl(computedPropertyNames11_ES5.ts, 11, 19)) + set [`hello bye`](v) { }, +>[`hello bye`] : Symbol([`hello bye`], Decl(computedPropertyNames11_ES5.ts, 12, 36)) >v : Symbol(v, Decl(computedPropertyNames11_ES5.ts, 13, 22)) get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : Symbol([`hello ${a} bye`], Decl(computedPropertyNames11_ES5.ts, 13, 29)) >a : Symbol(a, Decl(computedPropertyNames11_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index 08aa14aa911..86db4281f45 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -13,52 +13,63 @@ var v = { >{ get [s]() { return 0; }, set [n](v) { }, get [s + s]() { return 0; }, set [s + n](v) { }, get [+s]() { return 0; }, set [""](v) { }, get [0]() { return 0; }, set [a](v) { }, get [true]() { return 0; }, set [`hello bye`](v) { }, get [`hello ${a} bye`]() { return 0; }} : { [x: string]: any; [x: number]: any; [""]: any; readonly [0]: number; } get [s]() { return 0; }, +>[s] : number >s : string >0 : 0 set [n](v) { }, +>[n] : any >n : number >v : any get [s + s]() { return 0; }, +>[s + s] : number >s + s : string >s : string >s : string >0 : 0 set [s + n](v) { }, +>[s + n] : any >s + n : string >s : string >n : number >v : any get [+s]() { return 0; }, +>[+s] : number >+s : number >s : string >0 : 0 set [""](v) { }, +>[""] : any >"" : "" >v : any get [0]() { return 0; }, +>[0] : number >0 : 0 >0 : 0 set [a](v) { }, +>[a] : any >a : any >v : any get [true]() { return 0; }, +>[true] : number >true : any >true : true >0 : 0 set [`hello bye`](v) { }, +>[`hello bye`] : any >`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.symbols b/tests/baselines/reference/computedPropertyNames11_ES6.symbols index 8ffce9989c0..fcd142feac6 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames11_ES6.symbols @@ -12,39 +12,51 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 3, 3)) get [s]() { return 0; }, +>[s] : Symbol([s], Decl(computedPropertyNames11_ES6.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) set [n](v) { }, +>[n] : Symbol([n], Decl(computedPropertyNames11_ES6.ts, 4, 28)) >n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 5, 12)) get [s + s]() { return 0; }, +>[s + s] : Symbol([s + s], Decl(computedPropertyNames11_ES6.ts, 5, 19)) >s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) set [s + n](v) { }, +>[s + n] : Symbol([s + n], Decl(computedPropertyNames11_ES6.ts, 6, 32)) >s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames11_ES6.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 7, 16)) get [+s]() { return 0; }, +>[+s] : Symbol([+s], Decl(computedPropertyNames11_ES6.ts, 7, 23)) >s : Symbol(s, Decl(computedPropertyNames11_ES6.ts, 0, 3)) set [""](v) { }, +>[""] : Symbol([""], Decl(computedPropertyNames11_ES6.ts, 8, 29)) >"" : Symbol([""], Decl(computedPropertyNames11_ES6.ts, 8, 29)) >v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 9, 13)) get [0]() { return 0; }, +>[0] : Symbol([0], Decl(computedPropertyNames11_ES6.ts, 9, 20)) >0 : Symbol([0], Decl(computedPropertyNames11_ES6.ts, 9, 20)) set [a](v) { }, +>[a] : Symbol([a], Decl(computedPropertyNames11_ES6.ts, 10, 28)) >a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) >v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 11, 12)) get [true]() { return 0; }, +>[true] : Symbol([true], Decl(computedPropertyNames11_ES6.ts, 11, 19)) + set [`hello bye`](v) { }, +>[`hello bye`] : Symbol([`hello bye`], Decl(computedPropertyNames11_ES6.ts, 12, 36)) >v : Symbol(v, Decl(computedPropertyNames11_ES6.ts, 13, 22)) get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : Symbol([`hello ${a} bye`], Decl(computedPropertyNames11_ES6.ts, 13, 29)) >a : Symbol(a, Decl(computedPropertyNames11_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index 2f61eb59d61..cc877e9b645 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -13,52 +13,63 @@ var v = { >{ get [s]() { return 0; }, set [n](v) { }, get [s + s]() { return 0; }, set [s + n](v) { }, get [+s]() { return 0; }, set [""](v) { }, get [0]() { return 0; }, set [a](v) { }, get [true]() { return 0; }, set [`hello bye`](v) { }, get [`hello ${a} bye`]() { return 0; }} : { [x: string]: any; [x: number]: any; [""]: any; readonly [0]: number; } get [s]() { return 0; }, +>[s] : number >s : string >0 : 0 set [n](v) { }, +>[n] : any >n : number >v : any get [s + s]() { return 0; }, +>[s + s] : number >s + s : string >s : string >s : string >0 : 0 set [s + n](v) { }, +>[s + n] : any >s + n : string >s : string >n : number >v : any get [+s]() { return 0; }, +>[+s] : number >+s : number >s : string >0 : 0 set [""](v) { }, +>[""] : any >"" : "" >v : any get [0]() { return 0; }, +>[0] : number >0 : 0 >0 : 0 set [a](v) { }, +>[a] : any >a : any >v : any get [true]() { return 0; }, +>[true] : number >true : any >true : true >0 : 0 set [`hello bye`](v) { }, +>[`hello bye`] : any >`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames12_ES5.symbols b/tests/baselines/reference/computedPropertyNames12_ES5.symbols index 619a54c76c9..40f5989b9c0 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames12_ES5.symbols @@ -12,35 +12,48 @@ class C { >C : Symbol(C, Decl(computedPropertyNames12_ES5.ts, 2, 11)) [s]: number; +>[s] : Symbol(C[s], Decl(computedPropertyNames12_ES5.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames12_ES5.ts, 0, 3)) [n] = n; +>[n] : Symbol(C[n], Decl(computedPropertyNames12_ES5.ts, 4, 16)) >n : Symbol(n, Decl(computedPropertyNames12_ES5.ts, 1, 3)) >n : Symbol(n, Decl(computedPropertyNames12_ES5.ts, 1, 3)) static [s + s]: string; +>[s + s] : Symbol(C[s + s], Decl(computedPropertyNames12_ES5.ts, 5, 12)) >s : Symbol(s, Decl(computedPropertyNames12_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames12_ES5.ts, 0, 3)) [s + n] = 2; +>[s + n] : Symbol(C[s + n], Decl(computedPropertyNames12_ES5.ts, 6, 27)) >s : Symbol(s, Decl(computedPropertyNames12_ES5.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames12_ES5.ts, 1, 3)) [+s]: typeof s; +>[+s] : Symbol(C[+s], Decl(computedPropertyNames12_ES5.ts, 7, 16)) >s : Symbol(s, Decl(computedPropertyNames12_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames12_ES5.ts, 0, 3)) static [""]: number; +>[""] : Symbol(C[""], Decl(computedPropertyNames12_ES5.ts, 8, 19)) >"" : Symbol(C[""], Decl(computedPropertyNames12_ES5.ts, 8, 19)) [0]: number; +>[0] : Symbol(C[0], Decl(computedPropertyNames12_ES5.ts, 9, 24)) >0 : Symbol(C[0], Decl(computedPropertyNames12_ES5.ts, 9, 24)) [a]: number; +>[a] : Symbol(C[a], Decl(computedPropertyNames12_ES5.ts, 10, 16)) >a : Symbol(a, Decl(computedPropertyNames12_ES5.ts, 2, 3)) static [true]: number; +>[true] : Symbol(C[true], Decl(computedPropertyNames12_ES5.ts, 11, 16)) + [`hello bye`] = 0; +>[`hello bye`] : Symbol(C[`hello bye`], Decl(computedPropertyNames12_ES5.ts, 12, 31)) + static [`hello ${a} bye`] = 0 +>[`hello ${a} bye`] : Symbol(C[`hello ${a} bye`], Decl(computedPropertyNames12_ES5.ts, 13, 22)) >a : Symbol(a, Decl(computedPropertyNames12_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames12_ES5.types b/tests/baselines/reference/computedPropertyNames12_ES5.types index ee17fc2d048..63afc3bd4da 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5.types +++ b/tests/baselines/reference/computedPropertyNames12_ES5.types @@ -12,46 +12,57 @@ class C { >C : C [s]: number; +>[s] : number >s : string [n] = n; +>[n] : number >n : number >n : number static [s + s]: string; +>[s + s] : string >s + s : string >s : string >s : string [s + n] = 2; +>[s + n] : number >s + n : string >s : string >n : number >2 : 2 [+s]: typeof s; +>[+s] : string >+s : number >s : string >s : string static [""]: number; +>[""] : number >"" : "" [0]: number; +>[0] : number >0 : 0 [a]: number; +>[a] : number >a : any static [true]: number; +>[true] : number >true : any >true : true [`hello bye`] = 0; +>[`hello bye`] : number >`hello bye` : "hello bye" >0 : 0 static [`hello ${a} bye`] = 0 +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.symbols b/tests/baselines/reference/computedPropertyNames12_ES6.symbols index 9cb6fb3fa4b..9ea89571d82 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames12_ES6.symbols @@ -12,35 +12,48 @@ class C { >C : Symbol(C, Decl(computedPropertyNames12_ES6.ts, 2, 11)) [s]: number; +>[s] : Symbol(C[s], Decl(computedPropertyNames12_ES6.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames12_ES6.ts, 0, 3)) [n] = n; +>[n] : Symbol(C[n], Decl(computedPropertyNames12_ES6.ts, 4, 16)) >n : Symbol(n, Decl(computedPropertyNames12_ES6.ts, 1, 3)) >n : Symbol(n, Decl(computedPropertyNames12_ES6.ts, 1, 3)) static [s + s]: string; +>[s + s] : Symbol(C[s + s], Decl(computedPropertyNames12_ES6.ts, 5, 12)) >s : Symbol(s, Decl(computedPropertyNames12_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames12_ES6.ts, 0, 3)) [s + n] = 2; +>[s + n] : Symbol(C[s + n], Decl(computedPropertyNames12_ES6.ts, 6, 27)) >s : Symbol(s, Decl(computedPropertyNames12_ES6.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames12_ES6.ts, 1, 3)) [+s]: typeof s; +>[+s] : Symbol(C[+s], Decl(computedPropertyNames12_ES6.ts, 7, 16)) >s : Symbol(s, Decl(computedPropertyNames12_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames12_ES6.ts, 0, 3)) static [""]: number; +>[""] : Symbol(C[""], Decl(computedPropertyNames12_ES6.ts, 8, 19)) >"" : Symbol(C[""], Decl(computedPropertyNames12_ES6.ts, 8, 19)) [0]: number; +>[0] : Symbol(C[0], Decl(computedPropertyNames12_ES6.ts, 9, 24)) >0 : Symbol(C[0], Decl(computedPropertyNames12_ES6.ts, 9, 24)) [a]: number; +>[a] : Symbol(C[a], Decl(computedPropertyNames12_ES6.ts, 10, 16)) >a : Symbol(a, Decl(computedPropertyNames12_ES6.ts, 2, 3)) static [true]: number; +>[true] : Symbol(C[true], Decl(computedPropertyNames12_ES6.ts, 11, 16)) + [`hello bye`] = 0; +>[`hello bye`] : Symbol(C[`hello bye`], Decl(computedPropertyNames12_ES6.ts, 12, 31)) + static [`hello ${a} bye`] = 0 +>[`hello ${a} bye`] : Symbol(C[`hello ${a} bye`], Decl(computedPropertyNames12_ES6.ts, 13, 22)) >a : Symbol(a, Decl(computedPropertyNames12_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.types b/tests/baselines/reference/computedPropertyNames12_ES6.types index 8940f5f97d6..f846d159eec 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.types +++ b/tests/baselines/reference/computedPropertyNames12_ES6.types @@ -12,46 +12,57 @@ class C { >C : C [s]: number; +>[s] : number >s : string [n] = n; +>[n] : number >n : number >n : number static [s + s]: string; +>[s + s] : string >s + s : string >s : string >s : string [s + n] = 2; +>[s + n] : number >s + n : string >s : string >n : number >2 : 2 [+s]: typeof s; +>[+s] : string >+s : number >s : string >s : string static [""]: number; +>[""] : number >"" : "" [0]: number; +>[0] : number >0 : 0 [a]: number; +>[a] : number >a : any static [true]: number; +>[true] : number >true : any >true : true [`hello bye`] = 0; +>[`hello bye`] : number >`hello bye` : "hello bye" >0 : 0 static [`hello ${a} bye`] = 0 +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.symbols b/tests/baselines/reference/computedPropertyNames13_ES5.symbols index 4fae0886ca2..4d80f861952 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames13_ES5.symbols @@ -12,33 +12,46 @@ class C { >C : Symbol(C, Decl(computedPropertyNames13_ES5.ts, 2, 11)) [s]() {} +>[s] : Symbol(C[s], Decl(computedPropertyNames13_ES5.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) [n]() { } +>[n] : Symbol(C[n], Decl(computedPropertyNames13_ES5.ts, 4, 12)) >n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) static [s + s]() { } +>[s + s] : Symbol(C[s + s], Decl(computedPropertyNames13_ES5.ts, 5, 13)) >s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) [s + n]() { } +>[s + n] : Symbol(C[s + n], Decl(computedPropertyNames13_ES5.ts, 6, 24)) >s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames13_ES5.ts, 1, 3)) [+s]() { } +>[+s] : Symbol(C[+s], Decl(computedPropertyNames13_ES5.ts, 7, 17)) >s : Symbol(s, Decl(computedPropertyNames13_ES5.ts, 0, 3)) static [""]() { } +>[""] : Symbol(C[""], Decl(computedPropertyNames13_ES5.ts, 8, 14)) >"" : Symbol(C[""], Decl(computedPropertyNames13_ES5.ts, 8, 14)) [0]() { } +>[0] : Symbol(C[0], Decl(computedPropertyNames13_ES5.ts, 9, 21)) >0 : Symbol(C[0], Decl(computedPropertyNames13_ES5.ts, 9, 21)) [a]() { } +>[a] : Symbol(C[a], Decl(computedPropertyNames13_ES5.ts, 10, 13)) >a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) static [true]() { } +>[true] : Symbol(C[true], Decl(computedPropertyNames13_ES5.ts, 11, 13)) + [`hello bye`]() { } +>[`hello bye`] : Symbol(C[`hello bye`], Decl(computedPropertyNames13_ES5.ts, 12, 28)) + static [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : Symbol(C[`hello ${a} bye`], Decl(computedPropertyNames13_ES5.ts, 13, 23)) >a : Symbol(a, Decl(computedPropertyNames13_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.types b/tests/baselines/reference/computedPropertyNames13_ES5.types index a4381fdb891..07c5cee22cd 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.types +++ b/tests/baselines/reference/computedPropertyNames13_ES5.types @@ -12,42 +12,53 @@ class C { >C : C [s]() {} +>[s] : () => void >s : string [n]() { } +>[n] : () => void >n : number static [s + s]() { } +>[s + s] : () => void >s + s : string >s : string >s : string [s + n]() { } +>[s + n] : () => void >s + n : string >s : string >n : number [+s]() { } +>[+s] : () => void >+s : number >s : string static [""]() { } +>[""] : () => void >"" : "" [0]() { } +>[0] : () => void >0 : 0 [a]() { } +>[a] : () => void >a : any static [true]() { } +>[true] : () => void >true : any >true : true [`hello bye`]() { } +>[`hello bye`] : () => void >`hello bye` : "hello bye" static [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : () => void >`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.symbols b/tests/baselines/reference/computedPropertyNames13_ES6.symbols index 1f3a1c1460c..088522617a7 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames13_ES6.symbols @@ -12,33 +12,46 @@ class C { >C : Symbol(C, Decl(computedPropertyNames13_ES6.ts, 2, 11)) [s]() {} +>[s] : Symbol(C[s], Decl(computedPropertyNames13_ES6.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) [n]() { } +>[n] : Symbol(C[n], Decl(computedPropertyNames13_ES6.ts, 4, 12)) >n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) static [s + s]() { } +>[s + s] : Symbol(C[s + s], Decl(computedPropertyNames13_ES6.ts, 5, 13)) >s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) [s + n]() { } +>[s + n] : Symbol(C[s + n], Decl(computedPropertyNames13_ES6.ts, 6, 24)) >s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames13_ES6.ts, 1, 3)) [+s]() { } +>[+s] : Symbol(C[+s], Decl(computedPropertyNames13_ES6.ts, 7, 17)) >s : Symbol(s, Decl(computedPropertyNames13_ES6.ts, 0, 3)) static [""]() { } +>[""] : Symbol(C[""], Decl(computedPropertyNames13_ES6.ts, 8, 14)) >"" : Symbol(C[""], Decl(computedPropertyNames13_ES6.ts, 8, 14)) [0]() { } +>[0] : Symbol(C[0], Decl(computedPropertyNames13_ES6.ts, 9, 21)) >0 : Symbol(C[0], Decl(computedPropertyNames13_ES6.ts, 9, 21)) [a]() { } +>[a] : Symbol(C[a], Decl(computedPropertyNames13_ES6.ts, 10, 13)) >a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) static [true]() { } +>[true] : Symbol(C[true], Decl(computedPropertyNames13_ES6.ts, 11, 13)) + [`hello bye`]() { } +>[`hello bye`] : Symbol(C[`hello bye`], Decl(computedPropertyNames13_ES6.ts, 12, 28)) + static [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : Symbol(C[`hello ${a} bye`], Decl(computedPropertyNames13_ES6.ts, 13, 23)) >a : Symbol(a, Decl(computedPropertyNames13_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.types b/tests/baselines/reference/computedPropertyNames13_ES6.types index 48a989f9af1..8e0111d7600 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.types +++ b/tests/baselines/reference/computedPropertyNames13_ES6.types @@ -12,42 +12,53 @@ class C { >C : C [s]() {} +>[s] : () => void >s : string [n]() { } +>[n] : () => void >n : number static [s + s]() { } +>[s + s] : () => void >s + s : string >s : string >s : string [s + n]() { } +>[s + n] : () => void >s + n : string >s : string >n : number [+s]() { } +>[+s] : () => void >+s : number >s : string static [""]() { } +>[""] : () => void >"" : "" [0]() { } +>[0] : () => void >0 : 0 [a]() { } +>[a] : () => void >a : any static [true]() { } +>[true] : () => void >true : any >true : true [`hello bye`]() { } +>[`hello bye`] : () => void >`hello bye` : "hello bye" static [`hello ${a} bye`]() { } +>[`hello ${a} bye`] : () => void >`hello ${a} bye` : string >a : any } diff --git a/tests/baselines/reference/computedPropertyNames14_ES5.symbols b/tests/baselines/reference/computedPropertyNames14_ES5.symbols index 4cec21401c1..bec98673be7 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames14_ES5.symbols @@ -6,13 +6,22 @@ class C { >C : Symbol(C, Decl(computedPropertyNames14_ES5.ts, 0, 15)) [b]() {} +>[b] : Symbol(C[b], Decl(computedPropertyNames14_ES5.ts, 1, 9)) >b : Symbol(b, Decl(computedPropertyNames14_ES5.ts, 0, 3)) static [true]() { } +>[true] : Symbol(C[true], Decl(computedPropertyNames14_ES5.ts, 2, 12)) + [[]]() { } +>[[]] : Symbol(C[[]], Decl(computedPropertyNames14_ES5.ts, 3, 23)) + static [{}]() { } +>[{}] : Symbol(C[{}], Decl(computedPropertyNames14_ES5.ts, 4, 14)) + [undefined]() { } +>[undefined] : Symbol(C[undefined], Decl(computedPropertyNames14_ES5.ts, 5, 21)) >undefined : Symbol(undefined) static [null]() { } +>[null] : Symbol(C[null], Decl(computedPropertyNames14_ES5.ts, 6, 21)) } diff --git a/tests/baselines/reference/computedPropertyNames14_ES5.types b/tests/baselines/reference/computedPropertyNames14_ES5.types index 7a0abebfaa2..c0b5ddcd5a1 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES5.types +++ b/tests/baselines/reference/computedPropertyNames14_ES5.types @@ -6,20 +6,26 @@ class C { >C : C [b]() {} +>[b] : () => void >b : boolean static [true]() { } +>[true] : () => void >true : true [[]]() { } +>[[]] : () => void >[] : undefined[] static [{}]() { } +>[{}] : () => void >{} : {} [undefined]() { } +>[undefined] : () => void >undefined : undefined static [null]() { } +>[null] : () => void >null : null } diff --git a/tests/baselines/reference/computedPropertyNames14_ES6.symbols b/tests/baselines/reference/computedPropertyNames14_ES6.symbols index 09f67044d30..33f698bfe72 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames14_ES6.symbols @@ -6,13 +6,22 @@ class C { >C : Symbol(C, Decl(computedPropertyNames14_ES6.ts, 0, 15)) [b]() {} +>[b] : Symbol(C[b], Decl(computedPropertyNames14_ES6.ts, 1, 9)) >b : Symbol(b, Decl(computedPropertyNames14_ES6.ts, 0, 3)) static [true]() { } +>[true] : Symbol(C[true], Decl(computedPropertyNames14_ES6.ts, 2, 12)) + [[]]() { } +>[[]] : Symbol(C[[]], Decl(computedPropertyNames14_ES6.ts, 3, 23)) + static [{}]() { } +>[{}] : Symbol(C[{}], Decl(computedPropertyNames14_ES6.ts, 4, 14)) + [undefined]() { } +>[undefined] : Symbol(C[undefined], Decl(computedPropertyNames14_ES6.ts, 5, 21)) >undefined : Symbol(undefined) static [null]() { } +>[null] : Symbol(C[null], Decl(computedPropertyNames14_ES6.ts, 6, 21)) } diff --git a/tests/baselines/reference/computedPropertyNames14_ES6.types b/tests/baselines/reference/computedPropertyNames14_ES6.types index bbccb71e3cc..2c3d7dc2ad3 100644 --- a/tests/baselines/reference/computedPropertyNames14_ES6.types +++ b/tests/baselines/reference/computedPropertyNames14_ES6.types @@ -6,20 +6,26 @@ class C { >C : C [b]() {} +>[b] : () => void >b : boolean static [true]() { } +>[true] : () => void >true : true [[]]() { } +>[[]] : () => void >[] : undefined[] static [{}]() { } +>[{}] : () => void >{} : {} [undefined]() { } +>[undefined] : () => void >undefined : undefined static [null]() { } +>[null] : () => void >null : null } diff --git a/tests/baselines/reference/computedPropertyNames15_ES5.symbols b/tests/baselines/reference/computedPropertyNames15_ES5.symbols index 56a2a899aff..69aeffd908a 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames15_ES5.symbols @@ -12,11 +12,14 @@ class C { >C : Symbol(C, Decl(computedPropertyNames15_ES5.ts, 2, 25)) [p1]() { } +>[p1] : Symbol(C[p1], Decl(computedPropertyNames15_ES5.ts, 3, 9)) >p1 : Symbol(p1, Decl(computedPropertyNames15_ES5.ts, 0, 3)) [p2]() { } +>[p2] : Symbol(C[p2], Decl(computedPropertyNames15_ES5.ts, 4, 14)) >p2 : Symbol(p2, Decl(computedPropertyNames15_ES5.ts, 1, 3)) [p3]() { } +>[p3] : Symbol(C[p3], Decl(computedPropertyNames15_ES5.ts, 5, 14)) >p3 : Symbol(p3, Decl(computedPropertyNames15_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames15_ES5.types b/tests/baselines/reference/computedPropertyNames15_ES5.types index 819957b163e..d5a5dda4148 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES5.types +++ b/tests/baselines/reference/computedPropertyNames15_ES5.types @@ -12,11 +12,14 @@ class C { >C : C [p1]() { } +>[p1] : () => void >p1 : string | number [p2]() { } +>[p2] : () => void >p2 : number | number[] [p3]() { } +>[p3] : () => void >p3 : string | boolean } diff --git a/tests/baselines/reference/computedPropertyNames15_ES6.symbols b/tests/baselines/reference/computedPropertyNames15_ES6.symbols index abe46f9a2ac..d375bf52f1a 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames15_ES6.symbols @@ -12,11 +12,14 @@ class C { >C : Symbol(C, Decl(computedPropertyNames15_ES6.ts, 2, 25)) [p1]() { } +>[p1] : Symbol(C[p1], Decl(computedPropertyNames15_ES6.ts, 3, 9)) >p1 : Symbol(p1, Decl(computedPropertyNames15_ES6.ts, 0, 3)) [p2]() { } +>[p2] : Symbol(C[p2], Decl(computedPropertyNames15_ES6.ts, 4, 14)) >p2 : Symbol(p2, Decl(computedPropertyNames15_ES6.ts, 1, 3)) [p3]() { } +>[p3] : Symbol(C[p3], Decl(computedPropertyNames15_ES6.ts, 5, 14)) >p3 : Symbol(p3, Decl(computedPropertyNames15_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames15_ES6.types b/tests/baselines/reference/computedPropertyNames15_ES6.types index da82780f3f1..0d4746e2c16 100644 --- a/tests/baselines/reference/computedPropertyNames15_ES6.types +++ b/tests/baselines/reference/computedPropertyNames15_ES6.types @@ -12,11 +12,14 @@ class C { >C : C [p1]() { } +>[p1] : () => void >p1 : string | number [p2]() { } +>[p2] : () => void >p2 : number | number[] [p3]() { } +>[p3] : () => void >p3 : string | boolean } diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.symbols b/tests/baselines/reference/computedPropertyNames16_ES5.symbols index dff21e3cd97..1099ece1001 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames16_ES5.symbols @@ -12,39 +12,51 @@ class C { >C : Symbol(C, Decl(computedPropertyNames16_ES5.ts, 2, 11)) get [s]() { return 0;} +>[s] : Symbol(C[s], Decl(computedPropertyNames16_ES5.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) set [n](v) { } +>[n] : Symbol(C[n], Decl(computedPropertyNames16_ES5.ts, 4, 26)) >n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 5, 12)) static get [s + s]() { return 0; } +>[s + s] : Symbol(C[s + s], Decl(computedPropertyNames16_ES5.ts, 5, 18)) >s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) set [s + n](v) { } +>[s + n] : Symbol(C[s + n], Decl(computedPropertyNames16_ES5.ts, 6, 38)) >s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames16_ES5.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 7, 16)) get [+s]() { return 0; } +>[+s] : Symbol(C[+s], Decl(computedPropertyNames16_ES5.ts, 7, 22)) >s : Symbol(s, Decl(computedPropertyNames16_ES5.ts, 0, 3)) static set [""](v) { } +>[""] : Symbol(C[""], Decl(computedPropertyNames16_ES5.ts, 8, 28)) >"" : Symbol(C[""], Decl(computedPropertyNames16_ES5.ts, 8, 28)) >v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 9, 20)) get [0]() { return 0; } +>[0] : Symbol(C[0], Decl(computedPropertyNames16_ES5.ts, 9, 26)) >0 : Symbol(C[0], Decl(computedPropertyNames16_ES5.ts, 9, 26)) set [a](v) { } +>[a] : Symbol(C[a], Decl(computedPropertyNames16_ES5.ts, 10, 27)) >a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) >v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 11, 12)) static get [true]() { return 0; } +>[true] : Symbol(C[true], Decl(computedPropertyNames16_ES5.ts, 11, 18)) + set [`hello bye`](v) { } +>[`hello bye`] : Symbol(C[`hello bye`], Decl(computedPropertyNames16_ES5.ts, 12, 42)) >v : Symbol(v, Decl(computedPropertyNames16_ES5.ts, 13, 22)) get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : Symbol(C[`hello ${a} bye`], Decl(computedPropertyNames16_ES5.ts, 13, 28)) >a : Symbol(a, Decl(computedPropertyNames16_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.types b/tests/baselines/reference/computedPropertyNames16_ES5.types index 5f14d4d4c5d..7e6d5054098 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.types +++ b/tests/baselines/reference/computedPropertyNames16_ES5.types @@ -12,52 +12,63 @@ class C { >C : C get [s]() { return 0;} +>[s] : number >s : string >0 : 0 set [n](v) { } +>[n] : any >n : number >v : any static get [s + s]() { return 0; } +>[s + s] : number >s + s : string >s : string >s : string >0 : 0 set [s + n](v) { } +>[s + n] : any >s + n : string >s : string >n : number >v : any get [+s]() { return 0; } +>[+s] : number >+s : number >s : string >0 : 0 static set [""](v) { } +>[""] : any >"" : "" >v : any get [0]() { return 0; } +>[0] : number >0 : 0 >0 : 0 set [a](v) { } +>[a] : any >a : any >v : any static get [true]() { return 0; } +>[true] : number >true : any >true : true >0 : 0 set [`hello bye`](v) { } +>[`hello bye`] : any >`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.symbols b/tests/baselines/reference/computedPropertyNames16_ES6.symbols index 3e1af442b2d..11511eb5774 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames16_ES6.symbols @@ -12,39 +12,51 @@ class C { >C : Symbol(C, Decl(computedPropertyNames16_ES6.ts, 2, 11)) get [s]() { return 0;} +>[s] : Symbol(C[s], Decl(computedPropertyNames16_ES6.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) set [n](v) { } +>[n] : Symbol(C[n], Decl(computedPropertyNames16_ES6.ts, 4, 26)) >n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 5, 12)) static get [s + s]() { return 0; } +>[s + s] : Symbol(C[s + s], Decl(computedPropertyNames16_ES6.ts, 5, 18)) >s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) set [s + n](v) { } +>[s + n] : Symbol(C[s + n], Decl(computedPropertyNames16_ES6.ts, 6, 38)) >s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames16_ES6.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 7, 16)) get [+s]() { return 0; } +>[+s] : Symbol(C[+s], Decl(computedPropertyNames16_ES6.ts, 7, 22)) >s : Symbol(s, Decl(computedPropertyNames16_ES6.ts, 0, 3)) static set [""](v) { } +>[""] : Symbol(C[""], Decl(computedPropertyNames16_ES6.ts, 8, 28)) >"" : Symbol(C[""], Decl(computedPropertyNames16_ES6.ts, 8, 28)) >v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 9, 20)) get [0]() { return 0; } +>[0] : Symbol(C[0], Decl(computedPropertyNames16_ES6.ts, 9, 26)) >0 : Symbol(C[0], Decl(computedPropertyNames16_ES6.ts, 9, 26)) set [a](v) { } +>[a] : Symbol(C[a], Decl(computedPropertyNames16_ES6.ts, 10, 27)) >a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) >v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 11, 12)) static get [true]() { return 0; } +>[true] : Symbol(C[true], Decl(computedPropertyNames16_ES6.ts, 11, 18)) + set [`hello bye`](v) { } +>[`hello bye`] : Symbol(C[`hello bye`], Decl(computedPropertyNames16_ES6.ts, 12, 42)) >v : Symbol(v, Decl(computedPropertyNames16_ES6.ts, 13, 22)) get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : Symbol(C[`hello ${a} bye`], Decl(computedPropertyNames16_ES6.ts, 13, 28)) >a : Symbol(a, Decl(computedPropertyNames16_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.types b/tests/baselines/reference/computedPropertyNames16_ES6.types index d7f00f77d32..9898cbc00d4 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.types +++ b/tests/baselines/reference/computedPropertyNames16_ES6.types @@ -12,52 +12,63 @@ class C { >C : C get [s]() { return 0;} +>[s] : number >s : string >0 : 0 set [n](v) { } +>[n] : any >n : number >v : any static get [s + s]() { return 0; } +>[s + s] : number >s + s : string >s : string >s : string >0 : 0 set [s + n](v) { } +>[s + n] : any >s + n : string >s : string >n : number >v : any get [+s]() { return 0; } +>[+s] : number >+s : number >s : string >0 : 0 static set [""](v) { } +>[""] : any >"" : "" >v : any get [0]() { return 0; } +>[0] : number >0 : 0 >0 : 0 set [a](v) { } +>[a] : any >a : any >v : any static get [true]() { return 0; } +>[true] : number >true : any >true : true >0 : 0 set [`hello bye`](v) { } +>[`hello bye`] : any >`hello bye` : "hello bye" >v : any get [`hello ${a} bye`]() { return 0; } +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames17_ES5.symbols b/tests/baselines/reference/computedPropertyNames17_ES5.symbols index 5f03bb47e38..01b6e52b120 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames17_ES5.symbols @@ -6,18 +6,25 @@ class C { >C : Symbol(C, Decl(computedPropertyNames17_ES5.ts, 0, 15)) get [b]() { return 0;} +>[b] : Symbol(C[b], Decl(computedPropertyNames17_ES5.ts, 1, 9)) >b : Symbol(b, Decl(computedPropertyNames17_ES5.ts, 0, 3)) static set [true](v) { } +>[true] : Symbol(C[true], Decl(computedPropertyNames17_ES5.ts, 2, 26)) >v : Symbol(v, Decl(computedPropertyNames17_ES5.ts, 3, 22)) get [[]]() { return 0; } +>[[]] : Symbol(C[[]], Decl(computedPropertyNames17_ES5.ts, 3, 28)) + set [{}](v) { } +>[{}] : Symbol(C[{}], Decl(computedPropertyNames17_ES5.ts, 4, 28)) >v : Symbol(v, Decl(computedPropertyNames17_ES5.ts, 5, 13)) static get [undefined]() { return 0; } +>[undefined] : Symbol(C[undefined], Decl(computedPropertyNames17_ES5.ts, 5, 19)) >undefined : Symbol(undefined) set [null](v) { } +>[null] : Symbol(C[null], Decl(computedPropertyNames17_ES5.ts, 6, 42)) >v : Symbol(v, Decl(computedPropertyNames17_ES5.ts, 7, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames17_ES5.types b/tests/baselines/reference/computedPropertyNames17_ES5.types index 467f8b3421d..f1a28957713 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES5.types +++ b/tests/baselines/reference/computedPropertyNames17_ES5.types @@ -6,26 +6,32 @@ class C { >C : C get [b]() { return 0;} +>[b] : number >b : boolean >0 : 0 static set [true](v) { } +>[true] : any >true : true >v : any get [[]]() { return 0; } +>[[]] : number >[] : undefined[] >0 : 0 set [{}](v) { } +>[{}] : any >{} : {} >v : any static get [undefined]() { return 0; } +>[undefined] : number >undefined : undefined >0 : 0 set [null](v) { } +>[null] : any >null : null >v : any } diff --git a/tests/baselines/reference/computedPropertyNames17_ES6.symbols b/tests/baselines/reference/computedPropertyNames17_ES6.symbols index 3ddd6b182c4..cff597f6cfd 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames17_ES6.symbols @@ -6,18 +6,25 @@ class C { >C : Symbol(C, Decl(computedPropertyNames17_ES6.ts, 0, 15)) get [b]() { return 0;} +>[b] : Symbol(C[b], Decl(computedPropertyNames17_ES6.ts, 1, 9)) >b : Symbol(b, Decl(computedPropertyNames17_ES6.ts, 0, 3)) static set [true](v) { } +>[true] : Symbol(C[true], Decl(computedPropertyNames17_ES6.ts, 2, 26)) >v : Symbol(v, Decl(computedPropertyNames17_ES6.ts, 3, 22)) get [[]]() { return 0; } +>[[]] : Symbol(C[[]], Decl(computedPropertyNames17_ES6.ts, 3, 28)) + set [{}](v) { } +>[{}] : Symbol(C[{}], Decl(computedPropertyNames17_ES6.ts, 4, 28)) >v : Symbol(v, Decl(computedPropertyNames17_ES6.ts, 5, 13)) static get [undefined]() { return 0; } +>[undefined] : Symbol(C[undefined], Decl(computedPropertyNames17_ES6.ts, 5, 19)) >undefined : Symbol(undefined) set [null](v) { } +>[null] : Symbol(C[null], Decl(computedPropertyNames17_ES6.ts, 6, 42)) >v : Symbol(v, Decl(computedPropertyNames17_ES6.ts, 7, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames17_ES6.types b/tests/baselines/reference/computedPropertyNames17_ES6.types index 52830ab37cb..e8b700ce008 100644 --- a/tests/baselines/reference/computedPropertyNames17_ES6.types +++ b/tests/baselines/reference/computedPropertyNames17_ES6.types @@ -6,26 +6,32 @@ class C { >C : C get [b]() { return 0;} +>[b] : number >b : boolean >0 : 0 static set [true](v) { } +>[true] : any >true : true >v : any get [[]]() { return 0; } +>[[]] : number >[] : undefined[] >0 : 0 set [{}](v) { } +>[{}] : any >{} : {} >v : any static get [undefined]() { return 0; } +>[undefined] : number >undefined : undefined >0 : 0 set [null](v) { } +>[null] : any >null : null >v : any } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.symbols b/tests/baselines/reference/computedPropertyNames18_ES5.symbols index 86d706bc44c..e9597353637 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames18_ES5.symbols @@ -6,5 +6,6 @@ function foo() { >obj : Symbol(obj, Decl(computedPropertyNames18_ES5.ts, 1, 7)) [this.bar]: 0 +>[this.bar] : Symbol([this.bar], Decl(computedPropertyNames18_ES5.ts, 1, 15)) } } diff --git a/tests/baselines/reference/computedPropertyNames18_ES5.types b/tests/baselines/reference/computedPropertyNames18_ES5.types index e9de10f5ace..893de7a3157 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES5.types +++ b/tests/baselines/reference/computedPropertyNames18_ES5.types @@ -7,6 +7,7 @@ function foo() { >{ [this.bar]: 0 } : { [x: number]: number; } [this.bar]: 0 +>[this.bar] : number >this.bar : any >this : any >bar : any diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.symbols b/tests/baselines/reference/computedPropertyNames18_ES6.symbols index c530d1e811f..2af0ed4be6f 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames18_ES6.symbols @@ -6,5 +6,6 @@ function foo() { >obj : Symbol(obj, Decl(computedPropertyNames18_ES6.ts, 1, 7)) [this.bar]: 0 +>[this.bar] : Symbol([this.bar], Decl(computedPropertyNames18_ES6.ts, 1, 15)) } } diff --git a/tests/baselines/reference/computedPropertyNames18_ES6.types b/tests/baselines/reference/computedPropertyNames18_ES6.types index 1b376e9a1e3..37f531a7907 100644 --- a/tests/baselines/reference/computedPropertyNames18_ES6.types +++ b/tests/baselines/reference/computedPropertyNames18_ES6.types @@ -7,6 +7,7 @@ function foo() { >{ [this.bar]: 0 } : { [x: number]: number; } [this.bar]: 0 +>[this.bar] : number >this.bar : any >this : any >bar : any diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.symbols b/tests/baselines/reference/computedPropertyNames19_ES5.symbols index 615e02442a2..d247a21d1b7 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames19_ES5.symbols @@ -6,5 +6,6 @@ module M { >obj : Symbol(obj, Decl(computedPropertyNames19_ES5.ts, 1, 7)) [this.bar]: 0 +>[this.bar] : Symbol([this.bar], Decl(computedPropertyNames19_ES5.ts, 1, 15)) } } diff --git a/tests/baselines/reference/computedPropertyNames19_ES5.types b/tests/baselines/reference/computedPropertyNames19_ES5.types index 89a82a7872e..81bf76e4ac3 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES5.types +++ b/tests/baselines/reference/computedPropertyNames19_ES5.types @@ -7,6 +7,7 @@ module M { >{ [this.bar]: 0 } : { [x: number]: number; } [this.bar]: 0 +>[this.bar] : number >this.bar : any >this : any >bar : any diff --git a/tests/baselines/reference/computedPropertyNames19_ES6.symbols b/tests/baselines/reference/computedPropertyNames19_ES6.symbols index 7ab0a915c5c..f87dd9c9136 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames19_ES6.symbols @@ -6,5 +6,6 @@ module M { >obj : Symbol(obj, Decl(computedPropertyNames19_ES6.ts, 1, 7)) [this.bar]: 0 +>[this.bar] : Symbol([this.bar], Decl(computedPropertyNames19_ES6.ts, 1, 15)) } } diff --git a/tests/baselines/reference/computedPropertyNames19_ES6.types b/tests/baselines/reference/computedPropertyNames19_ES6.types index e580f361fab..5dcc6df206a 100644 --- a/tests/baselines/reference/computedPropertyNames19_ES6.types +++ b/tests/baselines/reference/computedPropertyNames19_ES6.types @@ -7,6 +7,7 @@ module M { >{ [this.bar]: 0 } : { [x: number]: number; } [this.bar]: 0 +>[this.bar] : number >this.bar : any >this : any >bar : any diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.symbols b/tests/baselines/reference/computedPropertyNames1_ES5.symbols index 2bc11580c78..05477fa06f9 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames1_ES5.symbols @@ -3,6 +3,9 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames1_ES5.ts, 0, 3)) get [0 + 1]() { return 0 }, +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNames1_ES5.ts, 0, 9)) + set [0 + 1](v: string) { } //No error +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNames1_ES5.ts, 1, 31)) >v : Symbol(v, Decl(computedPropertyNames1_ES5.ts, 2, 16)) } diff --git a/tests/baselines/reference/computedPropertyNames1_ES5.types b/tests/baselines/reference/computedPropertyNames1_ES5.types index d0c11e448bb..4e809ad5c64 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES5.types +++ b/tests/baselines/reference/computedPropertyNames1_ES5.types @@ -4,12 +4,14 @@ var v = { >{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : { [x: number]: string | number; } get [0 + 1]() { return 0 }, +>[0 + 1] : number >0 + 1 : number >0 : 0 >1 : 1 >0 : 0 set [0 + 1](v: string) { } //No error +>[0 + 1] : string >0 + 1 : number >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.symbols b/tests/baselines/reference/computedPropertyNames1_ES6.symbols index 5a1708b927d..4a8aa29a3ec 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames1_ES6.symbols @@ -3,6 +3,9 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames1_ES6.ts, 0, 3)) get [0 + 1]() { return 0 }, +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNames1_ES6.ts, 0, 9)) + set [0 + 1](v: string) { } //No error +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNames1_ES6.ts, 1, 31)) >v : Symbol(v, Decl(computedPropertyNames1_ES6.ts, 2, 16)) } diff --git a/tests/baselines/reference/computedPropertyNames1_ES6.types b/tests/baselines/reference/computedPropertyNames1_ES6.types index 6fddad0067c..309fa568bff 100644 --- a/tests/baselines/reference/computedPropertyNames1_ES6.types +++ b/tests/baselines/reference/computedPropertyNames1_ES6.types @@ -4,12 +4,14 @@ var v = { >{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : { [x: number]: string | number; } get [0 + 1]() { return 0 }, +>[0 + 1] : number >0 + 1 : number >0 : 0 >1 : 1 >0 : 0 set [0 + 1](v: string) { } //No error +>[0 + 1] : string >0 + 1 : number >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.symbols b/tests/baselines/reference/computedPropertyNames20_ES5.symbols index 2ab61faa707..2b249fd8f95 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames20_ES5.symbols @@ -3,4 +3,5 @@ var obj = { >obj : Symbol(obj, Decl(computedPropertyNames20_ES5.ts, 0, 3)) [this.bar]: 0 +>[this.bar] : Symbol([this.bar], Decl(computedPropertyNames20_ES5.ts, 0, 11)) } diff --git a/tests/baselines/reference/computedPropertyNames20_ES5.types b/tests/baselines/reference/computedPropertyNames20_ES5.types index d685b52ef06..cc0614b3d0b 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES5.types +++ b/tests/baselines/reference/computedPropertyNames20_ES5.types @@ -4,6 +4,7 @@ var obj = { >{ [this.bar]: 0} : { [x: number]: number; } [this.bar]: 0 +>[this.bar] : number >this.bar : any >this : any >bar : any diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.symbols b/tests/baselines/reference/computedPropertyNames20_ES6.symbols index f7ab8c84def..ffd5645ccd6 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames20_ES6.symbols @@ -3,4 +3,5 @@ var obj = { >obj : Symbol(obj, Decl(computedPropertyNames20_ES6.ts, 0, 3)) [this.bar]: 0 +>[this.bar] : Symbol([this.bar], Decl(computedPropertyNames20_ES6.ts, 0, 11)) } diff --git a/tests/baselines/reference/computedPropertyNames20_ES6.types b/tests/baselines/reference/computedPropertyNames20_ES6.types index af475ee66e6..5ffc037860e 100644 --- a/tests/baselines/reference/computedPropertyNames20_ES6.types +++ b/tests/baselines/reference/computedPropertyNames20_ES6.types @@ -4,6 +4,7 @@ var obj = { >{ [this.bar]: 0} : { [x: number]: number; } [this.bar]: 0 +>[this.bar] : number >this.bar : any >this : any >bar : any diff --git a/tests/baselines/reference/computedPropertyNames21_ES5.symbols b/tests/baselines/reference/computedPropertyNames21_ES5.symbols index 65c9d8b1704..16cba36da92 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames21_ES5.symbols @@ -8,4 +8,5 @@ class C { return 0; } [this.bar()]() { } +>[this.bar()] : Symbol(C[this.bar()], Decl(computedPropertyNames21_ES5.ts, 3, 5)) } diff --git a/tests/baselines/reference/computedPropertyNames21_ES5.types b/tests/baselines/reference/computedPropertyNames21_ES5.types index 663e8d11bdd..09a15e0d912 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES5.types +++ b/tests/baselines/reference/computedPropertyNames21_ES5.types @@ -9,6 +9,7 @@ class C { >0 : 0 } [this.bar()]() { } +>[this.bar()] : () => void >this.bar() : any >this.bar : any >this : any diff --git a/tests/baselines/reference/computedPropertyNames21_ES6.symbols b/tests/baselines/reference/computedPropertyNames21_ES6.symbols index 6a215aa47ed..484307748b1 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames21_ES6.symbols @@ -8,4 +8,5 @@ class C { return 0; } [this.bar()]() { } +>[this.bar()] : Symbol(C[this.bar()], Decl(computedPropertyNames21_ES6.ts, 3, 5)) } diff --git a/tests/baselines/reference/computedPropertyNames21_ES6.types b/tests/baselines/reference/computedPropertyNames21_ES6.types index 44360efb5e8..33587d08ae6 100644 --- a/tests/baselines/reference/computedPropertyNames21_ES6.types +++ b/tests/baselines/reference/computedPropertyNames21_ES6.types @@ -9,6 +9,7 @@ class C { >0 : 0 } [this.bar()]() { } +>[this.bar()] : () => void >this.bar() : any >this.bar : any >this : any diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.symbols b/tests/baselines/reference/computedPropertyNames22_ES5.symbols index 2e2b07473dd..6167acd3849 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames22_ES5.symbols @@ -9,6 +9,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames22_ES5.ts, 2, 11)) [this.bar()]() { } +>[this.bar()] : Symbol([this.bar()], Decl(computedPropertyNames22_ES5.ts, 2, 19)) >this.bar : Symbol(C.bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) >this : Symbol(C, Decl(computedPropertyNames22_ES5.ts, 0, 0)) >bar : Symbol(C.bar, Decl(computedPropertyNames22_ES5.ts, 0, 9)) diff --git a/tests/baselines/reference/computedPropertyNames22_ES5.types b/tests/baselines/reference/computedPropertyNames22_ES5.types index e244d4fb554..64b9f6adcac 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES5.types +++ b/tests/baselines/reference/computedPropertyNames22_ES5.types @@ -10,6 +10,7 @@ class C { >{ [this.bar()]() { } } : { [x: number]: () => void; } [this.bar()]() { } +>[this.bar()] : () => void >this.bar() : number >this.bar : () => number >this : this diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.symbols b/tests/baselines/reference/computedPropertyNames22_ES6.symbols index 39e3acb265c..dfe188a1320 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames22_ES6.symbols @@ -9,6 +9,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames22_ES6.ts, 2, 11)) [this.bar()]() { } +>[this.bar()] : Symbol([this.bar()], Decl(computedPropertyNames22_ES6.ts, 2, 19)) >this.bar : Symbol(C.bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) >this : Symbol(C, Decl(computedPropertyNames22_ES6.ts, 0, 0)) >bar : Symbol(C.bar, Decl(computedPropertyNames22_ES6.ts, 0, 9)) diff --git a/tests/baselines/reference/computedPropertyNames22_ES6.types b/tests/baselines/reference/computedPropertyNames22_ES6.types index 06329679bfb..5265ea17cd1 100644 --- a/tests/baselines/reference/computedPropertyNames22_ES6.types +++ b/tests/baselines/reference/computedPropertyNames22_ES6.types @@ -10,6 +10,7 @@ class C { >{ [this.bar()]() { } } : { [x: number]: () => void; } [this.bar()]() { } +>[this.bar()] : () => void >this.bar() : number >this.bar : () => number >this : this diff --git a/tests/baselines/reference/computedPropertyNames23_ES5.symbols b/tests/baselines/reference/computedPropertyNames23_ES5.symbols index d4014689e85..8ba4c63ae90 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames23_ES5.symbols @@ -8,6 +8,12 @@ class C { return 0; } [ +>[ { [this.bar()]: 1 }[0] ] : Symbol(C[ + { [this.bar()]: 1 }[0] + ], Decl(computedPropertyNames23_ES5.ts, 3, 5)) + { [this.bar()]: 1 }[0] +>[this.bar()] : Symbol([this.bar()], Decl(computedPropertyNames23_ES5.ts, 5, 9)) + ]() { } } diff --git a/tests/baselines/reference/computedPropertyNames23_ES5.types b/tests/baselines/reference/computedPropertyNames23_ES5.types index 9e207cdaf42..7090bfa3ba9 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES5.types +++ b/tests/baselines/reference/computedPropertyNames23_ES5.types @@ -9,9 +9,12 @@ class C { >0 : 0 } [ +>[ { [this.bar()]: 1 }[0] ] : () => void + { [this.bar()]: 1 }[0] >{ [this.bar()]: 1 }[0] : number >{ [this.bar()]: 1 } : { [x: number]: number; } +>[this.bar()] : number >this.bar() : any >this.bar : any >this : any diff --git a/tests/baselines/reference/computedPropertyNames23_ES6.symbols b/tests/baselines/reference/computedPropertyNames23_ES6.symbols index 21bd00c8732..d402d8cc7ac 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames23_ES6.symbols @@ -8,6 +8,12 @@ class C { return 0; } [ +>[ { [this.bar()]: 1 }[0] ] : Symbol(C[ + { [this.bar()]: 1 }[0] + ], Decl(computedPropertyNames23_ES6.ts, 3, 5)) + { [this.bar()]: 1 }[0] +>[this.bar()] : Symbol([this.bar()], Decl(computedPropertyNames23_ES6.ts, 5, 9)) + ]() { } } diff --git a/tests/baselines/reference/computedPropertyNames23_ES6.types b/tests/baselines/reference/computedPropertyNames23_ES6.types index 533e3fcf903..39133196ed4 100644 --- a/tests/baselines/reference/computedPropertyNames23_ES6.types +++ b/tests/baselines/reference/computedPropertyNames23_ES6.types @@ -9,9 +9,12 @@ class C { >0 : 0 } [ +>[ { [this.bar()]: 1 }[0] ] : () => void + { [this.bar()]: 1 }[0] >{ [this.bar()]: 1 }[0] : number >{ [this.bar()]: 1 } : { [x: number]: number; } +>[this.bar()] : number >this.bar() : any >this.bar : any >this : any diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.symbols b/tests/baselines/reference/computedPropertyNames24_ES5.symbols index 9d8aa05fd65..f96c530eb04 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames24_ES5.symbols @@ -13,4 +13,5 @@ class C extends Base { >Base : Symbol(Base, Decl(computedPropertyNames24_ES5.ts, 0, 0)) [super.bar()]() { } +>[super.bar()] : Symbol(C[super.bar()], Decl(computedPropertyNames24_ES5.ts, 5, 22)) } diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.types b/tests/baselines/reference/computedPropertyNames24_ES5.types index 7afbd10818f..f0ede8c0398 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.types +++ b/tests/baselines/reference/computedPropertyNames24_ES5.types @@ -14,6 +14,7 @@ class C extends Base { >Base : Base [super.bar()]() { } +>[super.bar()] : () => void >super.bar() : any >super.bar : any >super : any diff --git a/tests/baselines/reference/computedPropertyNames24_ES6.symbols b/tests/baselines/reference/computedPropertyNames24_ES6.symbols index 9df1a2b1181..f84f3013477 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames24_ES6.symbols @@ -15,4 +15,5 @@ class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. [super.bar()]() { } +>[super.bar()] : Symbol(C[super.bar()], Decl(computedPropertyNames24_ES6.ts, 5, 22)) } diff --git a/tests/baselines/reference/computedPropertyNames24_ES6.types b/tests/baselines/reference/computedPropertyNames24_ES6.types index 8a47895282f..2e5c2262b32 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES6.types +++ b/tests/baselines/reference/computedPropertyNames24_ES6.types @@ -16,6 +16,7 @@ class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. [super.bar()]() { } +>[super.bar()] : () => void >super.bar() : any >super.bar : any >super : any diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.symbols b/tests/baselines/reference/computedPropertyNames25_ES5.symbols index 896ba223099..1500967c408 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames25_ES5.symbols @@ -19,6 +19,7 @@ class C extends Base { >obj : Symbol(obj, Decl(computedPropertyNames25_ES5.ts, 7, 11)) [super.bar()]() { } +>[super.bar()] : Symbol([super.bar()], Decl(computedPropertyNames25_ES5.ts, 7, 19)) >super.bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) >super : Symbol(Base, Decl(computedPropertyNames25_ES5.ts, 0, 0)) >bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES5.ts, 0, 12)) diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.types b/tests/baselines/reference/computedPropertyNames25_ES5.types index aed42994255..b17d127d1d4 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.types +++ b/tests/baselines/reference/computedPropertyNames25_ES5.types @@ -21,6 +21,7 @@ class C extends Base { >{ [super.bar()]() { } } : { [x: number]: () => void; } [super.bar()]() { } +>[super.bar()] : () => void >super.bar() : number >super.bar : () => number >super : Base diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.symbols b/tests/baselines/reference/computedPropertyNames25_ES6.symbols index dcb6177b0ea..d16d30dbd3c 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames25_ES6.symbols @@ -19,6 +19,7 @@ class C extends Base { >obj : Symbol(obj, Decl(computedPropertyNames25_ES6.ts, 7, 11)) [super.bar()]() { } +>[super.bar()] : Symbol([super.bar()], Decl(computedPropertyNames25_ES6.ts, 7, 19)) >super.bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) >super : Symbol(Base, Decl(computedPropertyNames25_ES6.ts, 0, 0)) >bar : Symbol(Base.bar, Decl(computedPropertyNames25_ES6.ts, 0, 12)) diff --git a/tests/baselines/reference/computedPropertyNames25_ES6.types b/tests/baselines/reference/computedPropertyNames25_ES6.types index 73a4ca912f9..0dfedcca822 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES6.types +++ b/tests/baselines/reference/computedPropertyNames25_ES6.types @@ -21,6 +21,7 @@ class C extends Base { >{ [super.bar()]() { } } : { [x: number]: () => void; } [super.bar()]() { } +>[super.bar()] : () => void >super.bar() : number >super.bar : () => number >super : Base diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.symbols b/tests/baselines/reference/computedPropertyNames26_ES5.symbols index b2365ebcf8a..54b1142e686 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames26_ES5.symbols @@ -13,6 +13,12 @@ class C extends Base { >Base : Symbol(Base, Decl(computedPropertyNames26_ES5.ts, 0, 0)) [ +>[ { [super.bar()]: 1 }[0] ] : Symbol(C[ + { [super.bar()]: 1 }[0] + ], Decl(computedPropertyNames26_ES5.ts, 5, 22)) + { [super.bar()]: 1 }[0] +>[super.bar()] : Symbol([super.bar()], Decl(computedPropertyNames26_ES5.ts, 7, 9)) + ]() { } } diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.types b/tests/baselines/reference/computedPropertyNames26_ES5.types index 14f94f220c5..c9bebbd010a 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.types +++ b/tests/baselines/reference/computedPropertyNames26_ES5.types @@ -14,9 +14,12 @@ class C extends Base { >Base : Base [ +>[ { [super.bar()]: 1 }[0] ] : () => void + { [super.bar()]: 1 }[0] >{ [super.bar()]: 1 }[0] : number >{ [super.bar()]: 1 } : { [x: number]: number; } +>[super.bar()] : number >super.bar() : any >super.bar : any >super : any diff --git a/tests/baselines/reference/computedPropertyNames26_ES6.symbols b/tests/baselines/reference/computedPropertyNames26_ES6.symbols index b28743e767e..572665318b3 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames26_ES6.symbols @@ -15,6 +15,12 @@ class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. [ +>[ { [super.bar()]: 1 }[0] ] : Symbol(C[ + { [super.bar()]: 1 }[0] + ], Decl(computedPropertyNames26_ES6.ts, 5, 22)) + { [super.bar()]: 1 }[0] +>[super.bar()] : Symbol([super.bar()], Decl(computedPropertyNames26_ES6.ts, 9, 9)) + ]() { } } diff --git a/tests/baselines/reference/computedPropertyNames26_ES6.types b/tests/baselines/reference/computedPropertyNames26_ES6.types index 2238fabbbc9..6a4cf5a15e0 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES6.types +++ b/tests/baselines/reference/computedPropertyNames26_ES6.types @@ -16,9 +16,12 @@ class C extends Base { // Gets emitted as super, not _super, which is consistent with // use of super in static properties initializers. [ +>[ { [super.bar()]: 1 }[0] ] : () => void + { [super.bar()]: 1 }[0] >{ [super.bar()]: 1 }[0] : number >{ [super.bar()]: 1 } : { [x: number]: number; } +>[super.bar()] : number >super.bar() : any >super.bar : any >super : any diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.symbols b/tests/baselines/reference/computedPropertyNames27_ES5.symbols index 79a0b0e69f4..54f1f6a580c 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames27_ES5.symbols @@ -7,4 +7,5 @@ class C extends Base { >Base : Symbol(Base, Decl(computedPropertyNames27_ES5.ts, 0, 0)) [(super(), "prop")]() { } +>[(super(), "prop")] : Symbol(C[(super(), "prop")], Decl(computedPropertyNames27_ES5.ts, 2, 22)) } diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.types b/tests/baselines/reference/computedPropertyNames27_ES5.types index 8f7aa565d57..0575cc63426 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.types +++ b/tests/baselines/reference/computedPropertyNames27_ES5.types @@ -7,6 +7,7 @@ class C extends Base { >Base : Base [(super(), "prop")]() { } +>[(super(), "prop")] : () => void >(super(), "prop") : "prop" >super(), "prop" : "prop" >super() : void diff --git a/tests/baselines/reference/computedPropertyNames27_ES6.symbols b/tests/baselines/reference/computedPropertyNames27_ES6.symbols index e70026ee863..00f174cc389 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames27_ES6.symbols @@ -7,4 +7,5 @@ class C extends Base { >Base : Symbol(Base, Decl(computedPropertyNames27_ES6.ts, 0, 0)) [(super(), "prop")]() { } +>[(super(), "prop")] : Symbol(C[(super(), "prop")], Decl(computedPropertyNames27_ES6.ts, 2, 22)) } diff --git a/tests/baselines/reference/computedPropertyNames27_ES6.types b/tests/baselines/reference/computedPropertyNames27_ES6.types index 9e5736a8ba0..17843fceae2 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES6.types +++ b/tests/baselines/reference/computedPropertyNames27_ES6.types @@ -7,6 +7,7 @@ class C extends Base { >Base : Base [(super(), "prop")]() { } +>[(super(), "prop")] : () => void >(super(), "prop") : "prop" >super(), "prop" : "prop" >super() : void diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.symbols b/tests/baselines/reference/computedPropertyNames28_ES5.symbols index 2934c3d0401..19140c3ed26 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames28_ES5.symbols @@ -14,6 +14,7 @@ class C extends Base { >obj : Symbol(obj, Decl(computedPropertyNames28_ES5.ts, 5, 11)) [(super(), "prop")]() { } +>[(super(), "prop")] : Symbol([(super(), "prop")], Decl(computedPropertyNames28_ES5.ts, 5, 19)) >super : Symbol(Base, Decl(computedPropertyNames28_ES5.ts, 0, 0)) }; diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.types b/tests/baselines/reference/computedPropertyNames28_ES5.types index 0d816d980fe..b440f86c986 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.types +++ b/tests/baselines/reference/computedPropertyNames28_ES5.types @@ -16,6 +16,7 @@ class C extends Base { >{ [(super(), "prop")]() { } } : { [x: string]: () => void; } [(super(), "prop")]() { } +>[(super(), "prop")] : () => void >(super(), "prop") : "prop" >super(), "prop" : "prop" >super() : void diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.symbols b/tests/baselines/reference/computedPropertyNames28_ES6.symbols index 6824f62e2a5..0326fb4ad69 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames28_ES6.symbols @@ -14,6 +14,7 @@ class C extends Base { >obj : Symbol(obj, Decl(computedPropertyNames28_ES6.ts, 5, 11)) [(super(), "prop")]() { } +>[(super(), "prop")] : Symbol([(super(), "prop")], Decl(computedPropertyNames28_ES6.ts, 5, 19)) >super : Symbol(Base, Decl(computedPropertyNames28_ES6.ts, 0, 0)) }; diff --git a/tests/baselines/reference/computedPropertyNames28_ES6.types b/tests/baselines/reference/computedPropertyNames28_ES6.types index 7c803ec43af..a947b6f8a95 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES6.types +++ b/tests/baselines/reference/computedPropertyNames28_ES6.types @@ -16,6 +16,7 @@ class C extends Base { >{ [(super(), "prop")]() { } } : { [x: string]: () => void; } [(super(), "prop")]() { } +>[(super(), "prop")] : () => void >(super(), "prop") : "prop" >super(), "prop" : "prop" >super() : void diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.symbols b/tests/baselines/reference/computedPropertyNames29_ES5.symbols index b78b4d0955c..156da745016 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames29_ES5.symbols @@ -10,6 +10,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames29_ES5.ts, 3, 15)) [this.bar()]() { } // needs capture +>[this.bar()] : Symbol([this.bar()], Decl(computedPropertyNames29_ES5.ts, 3, 23)) >this.bar : Symbol(C.bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) >this : Symbol(C, Decl(computedPropertyNames29_ES5.ts, 0, 0)) >bar : Symbol(C.bar, Decl(computedPropertyNames29_ES5.ts, 0, 9)) diff --git a/tests/baselines/reference/computedPropertyNames29_ES5.types b/tests/baselines/reference/computedPropertyNames29_ES5.types index 3f825c244e0..5d08d3c6ee7 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES5.types +++ b/tests/baselines/reference/computedPropertyNames29_ES5.types @@ -13,6 +13,7 @@ class C { >{ [this.bar()]() { } // needs capture } : { [x: number]: () => void; } [this.bar()]() { } // needs capture +>[this.bar()] : () => void >this.bar() : number >this.bar : () => number >this : this diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.symbols b/tests/baselines/reference/computedPropertyNames29_ES6.symbols index fe54d1a0325..0c9cf8cf1ce 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames29_ES6.symbols @@ -10,6 +10,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames29_ES6.ts, 3, 15)) [this.bar()]() { } // needs capture +>[this.bar()] : Symbol([this.bar()], Decl(computedPropertyNames29_ES6.ts, 3, 23)) >this.bar : Symbol(C.bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) >this : Symbol(C, Decl(computedPropertyNames29_ES6.ts, 0, 0)) >bar : Symbol(C.bar, Decl(computedPropertyNames29_ES6.ts, 0, 9)) diff --git a/tests/baselines/reference/computedPropertyNames29_ES6.types b/tests/baselines/reference/computedPropertyNames29_ES6.types index a1375622271..093c844bb10 100644 --- a/tests/baselines/reference/computedPropertyNames29_ES6.types +++ b/tests/baselines/reference/computedPropertyNames29_ES6.types @@ -13,6 +13,7 @@ class C { >{ [this.bar()]() { } // needs capture } : { [x: number]: () => void; } [this.bar()]() { } // needs capture +>[this.bar()] : () => void >this.bar() : number >this.bar : () => number >this : this diff --git a/tests/baselines/reference/computedPropertyNames2_ES5.symbols b/tests/baselines/reference/computedPropertyNames2_ES5.symbols index dba87481e7c..bd4f18fc795 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames2_ES5.symbols @@ -9,22 +9,28 @@ class C { >C : Symbol(C, Decl(computedPropertyNames2_ES5.ts, 1, 30)) [methodName]() { } +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNames2_ES5.ts, 2, 9)) >methodName : Symbol(methodName, Decl(computedPropertyNames2_ES5.ts, 0, 3)) static [methodName]() { } +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNames2_ES5.ts, 3, 22)) >methodName : Symbol(methodName, Decl(computedPropertyNames2_ES5.ts, 0, 3)) get [accessorName]() { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES5.ts, 4, 29)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES5.ts, 1, 3)) set [accessorName](v) { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES5.ts, 5, 28)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES5.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames2_ES5.ts, 6, 23)) static get [accessorName]() { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES5.ts, 6, 29)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES5.ts, 1, 3)) static set [accessorName](v) { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES5.ts, 7, 35)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES5.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames2_ES5.ts, 8, 30)) } diff --git a/tests/baselines/reference/computedPropertyNames2_ES5.types b/tests/baselines/reference/computedPropertyNames2_ES5.types index 97b15f8005c..e01976dad96 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES5.types +++ b/tests/baselines/reference/computedPropertyNames2_ES5.types @@ -11,22 +11,28 @@ class C { >C : C [methodName]() { } +>[methodName] : () => void >methodName : string static [methodName]() { } +>[methodName] : () => void >methodName : string get [accessorName]() { } +>[accessorName] : void >accessorName : string set [accessorName](v) { } +>[accessorName] : any >accessorName : string >v : any static get [accessorName]() { } +>[accessorName] : void >accessorName : string static set [accessorName](v) { } +>[accessorName] : any >accessorName : string >v : any } diff --git a/tests/baselines/reference/computedPropertyNames2_ES6.symbols b/tests/baselines/reference/computedPropertyNames2_ES6.symbols index 2c93af6bce5..f124ae29ff8 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames2_ES6.symbols @@ -9,22 +9,28 @@ class C { >C : Symbol(C, Decl(computedPropertyNames2_ES6.ts, 1, 30)) [methodName]() { } +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNames2_ES6.ts, 2, 9)) >methodName : Symbol(methodName, Decl(computedPropertyNames2_ES6.ts, 0, 3)) static [methodName]() { } +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNames2_ES6.ts, 3, 22)) >methodName : Symbol(methodName, Decl(computedPropertyNames2_ES6.ts, 0, 3)) get [accessorName]() { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES6.ts, 4, 29)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES6.ts, 1, 3)) set [accessorName](v) { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES6.ts, 5, 28)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES6.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames2_ES6.ts, 6, 23)) static get [accessorName]() { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES6.ts, 6, 29)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES6.ts, 1, 3)) static set [accessorName](v) { } +>[accessorName] : Symbol(C[accessorName], Decl(computedPropertyNames2_ES6.ts, 7, 35)) >accessorName : Symbol(accessorName, Decl(computedPropertyNames2_ES6.ts, 1, 3)) >v : Symbol(v, Decl(computedPropertyNames2_ES6.ts, 8, 30)) } diff --git a/tests/baselines/reference/computedPropertyNames2_ES6.types b/tests/baselines/reference/computedPropertyNames2_ES6.types index d8daa4d5abe..fd72a00457a 100644 --- a/tests/baselines/reference/computedPropertyNames2_ES6.types +++ b/tests/baselines/reference/computedPropertyNames2_ES6.types @@ -11,22 +11,28 @@ class C { >C : C [methodName]() { } +>[methodName] : () => void >methodName : string static [methodName]() { } +>[methodName] : () => void >methodName : string get [accessorName]() { } +>[accessorName] : void >accessorName : string set [accessorName](v) { } +>[accessorName] : any >accessorName : string >v : any static get [accessorName]() { } +>[accessorName] : void >accessorName : string static set [accessorName](v) { } +>[accessorName] : any >accessorName : string >v : any } diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.symbols b/tests/baselines/reference/computedPropertyNames30_ES5.symbols index fa15eaf928d..0d5440d5422 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames30_ES5.symbols @@ -18,6 +18,8 @@ class C extends Base { // illegal, and not capturing this is consistent with //treatment of other similar violations. [(super(), "prop")]() { } +>[(super(), "prop")] : Symbol([(super(), "prop")], Decl(computedPropertyNames30_ES5.ts, 6, 23)) + }; } } diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.types b/tests/baselines/reference/computedPropertyNames30_ES5.types index 10fd9f52a85..1d50a1d19f3 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.types +++ b/tests/baselines/reference/computedPropertyNames30_ES5.types @@ -22,6 +22,7 @@ class C extends Base { // illegal, and not capturing this is consistent with //treatment of other similar violations. [(super(), "prop")]() { } +>[(super(), "prop")] : () => void >(super(), "prop") : "prop" >super(), "prop" : "prop" >super() : void diff --git a/tests/baselines/reference/computedPropertyNames30_ES6.symbols b/tests/baselines/reference/computedPropertyNames30_ES6.symbols index f1172ad6c90..152694cdf20 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames30_ES6.symbols @@ -18,6 +18,8 @@ class C extends Base { // illegal, and not capturing this is consistent with //treatment of other similar violations. [(super(), "prop")]() { } +>[(super(), "prop")] : Symbol([(super(), "prop")], Decl(computedPropertyNames30_ES6.ts, 6, 23)) + }; } } diff --git a/tests/baselines/reference/computedPropertyNames30_ES6.types b/tests/baselines/reference/computedPropertyNames30_ES6.types index 98ad5d7de4d..3d2a39f4fe9 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES6.types +++ b/tests/baselines/reference/computedPropertyNames30_ES6.types @@ -22,6 +22,7 @@ class C extends Base { // illegal, and not capturing this is consistent with //treatment of other similar violations. [(super(), "prop")]() { } +>[(super(), "prop")] : () => void >(super(), "prop") : "prop" >super(), "prop" : "prop" >super() : void diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.symbols b/tests/baselines/reference/computedPropertyNames31_ES5.symbols index 9cb1b0184f7..eb60ab0b6f7 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames31_ES5.symbols @@ -20,6 +20,7 @@ class C extends Base { >obj : Symbol(obj, Decl(computedPropertyNames31_ES5.ts, 8, 15)) [super.bar()]() { } // needs capture +>[super.bar()] : Symbol([super.bar()], Decl(computedPropertyNames31_ES5.ts, 8, 23)) >super.bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) >super : Symbol(Base, Decl(computedPropertyNames31_ES5.ts, 0, 0)) >bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES5.ts, 0, 12)) diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.types b/tests/baselines/reference/computedPropertyNames31_ES5.types index 37661cbec11..dc8805224be 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.types +++ b/tests/baselines/reference/computedPropertyNames31_ES5.types @@ -24,6 +24,7 @@ class C extends Base { >{ [super.bar()]() { } // needs capture } : { [x: number]: () => void; } [super.bar()]() { } // needs capture +>[super.bar()] : () => void >super.bar() : number >super.bar : () => number >super : Base diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.symbols b/tests/baselines/reference/computedPropertyNames31_ES6.symbols index 19cc6cd1bcd..aaaa43484c5 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames31_ES6.symbols @@ -20,6 +20,7 @@ class C extends Base { >obj : Symbol(obj, Decl(computedPropertyNames31_ES6.ts, 8, 15)) [super.bar()]() { } // needs capture +>[super.bar()] : Symbol([super.bar()], Decl(computedPropertyNames31_ES6.ts, 8, 23)) >super.bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) >super : Symbol(Base, Decl(computedPropertyNames31_ES6.ts, 0, 0)) >bar : Symbol(Base.bar, Decl(computedPropertyNames31_ES6.ts, 0, 12)) diff --git a/tests/baselines/reference/computedPropertyNames31_ES6.types b/tests/baselines/reference/computedPropertyNames31_ES6.types index dbb4f47662e..2e867aa2a42 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES6.types +++ b/tests/baselines/reference/computedPropertyNames31_ES6.types @@ -24,6 +24,7 @@ class C extends Base { >{ [super.bar()]() { } // needs capture } : { [x: number]: () => void; } [super.bar()]() { } // needs capture +>[super.bar()] : () => void >super.bar() : number >super.bar : () => number >super : Base diff --git a/tests/baselines/reference/computedPropertyNames32_ES5.symbols b/tests/baselines/reference/computedPropertyNames32_ES5.symbols index 3a90efbca97..300d841daef 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames32_ES5.symbols @@ -13,5 +13,6 @@ class C { return 0; } [foo()]() { } +>[foo()] : Symbol(C[foo()], Decl(computedPropertyNames32_ES5.ts, 4, 5)) >foo : Symbol(foo, Decl(computedPropertyNames32_ES5.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames32_ES5.types b/tests/baselines/reference/computedPropertyNames32_ES5.types index f8506e85861..0761aa24952 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES5.types +++ b/tests/baselines/reference/computedPropertyNames32_ES5.types @@ -15,6 +15,7 @@ class C { >0 : 0 } [foo()]() { } +>[foo()] : () => void >foo() : string >foo : () => string >T : No type information available! diff --git a/tests/baselines/reference/computedPropertyNames32_ES6.symbols b/tests/baselines/reference/computedPropertyNames32_ES6.symbols index 2a2f5857650..da5a482d94e 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames32_ES6.symbols @@ -13,5 +13,6 @@ class C { return 0; } [foo()]() { } +>[foo()] : Symbol(C[foo()], Decl(computedPropertyNames32_ES6.ts, 4, 5)) >foo : Symbol(foo, Decl(computedPropertyNames32_ES6.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames32_ES6.types b/tests/baselines/reference/computedPropertyNames32_ES6.types index b54db707d55..e6f3afa6516 100644 --- a/tests/baselines/reference/computedPropertyNames32_ES6.types +++ b/tests/baselines/reference/computedPropertyNames32_ES6.types @@ -15,6 +15,7 @@ class C { >0 : 0 } [foo()]() { } +>[foo()] : () => void >foo() : string >foo : () => string >T : No type information available! diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.symbols b/tests/baselines/reference/computedPropertyNames33_ES5.symbols index 90734fd07a0..97b3d2a30a5 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames33_ES5.symbols @@ -14,6 +14,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames33_ES5.ts, 3, 11)) [foo()]() { } +>[foo()] : Symbol([foo()], Decl(computedPropertyNames33_ES5.ts, 3, 19)) >foo : Symbol(foo, Decl(computedPropertyNames33_ES5.ts, 0, 0)) >T : Symbol(T, Decl(computedPropertyNames33_ES5.ts, 1, 8)) diff --git a/tests/baselines/reference/computedPropertyNames33_ES5.types b/tests/baselines/reference/computedPropertyNames33_ES5.types index 046d4bf96a9..4a2d33b57c9 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES5.types +++ b/tests/baselines/reference/computedPropertyNames33_ES5.types @@ -16,6 +16,7 @@ class C { >{ [foo()]() { } } : { [x: string]: () => void; } [foo()]() { } +>[foo()] : () => void >foo() : string >foo : () => string >T : T diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.symbols b/tests/baselines/reference/computedPropertyNames33_ES6.symbols index f51764af561..6df4180f0e0 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames33_ES6.symbols @@ -14,6 +14,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames33_ES6.ts, 3, 11)) [foo()]() { } +>[foo()] : Symbol([foo()], Decl(computedPropertyNames33_ES6.ts, 3, 19)) >foo : Symbol(foo, Decl(computedPropertyNames33_ES6.ts, 0, 0)) >T : Symbol(T, Decl(computedPropertyNames33_ES6.ts, 1, 8)) diff --git a/tests/baselines/reference/computedPropertyNames33_ES6.types b/tests/baselines/reference/computedPropertyNames33_ES6.types index 07cf7c1639f..05b034bfc20 100644 --- a/tests/baselines/reference/computedPropertyNames33_ES6.types +++ b/tests/baselines/reference/computedPropertyNames33_ES6.types @@ -16,6 +16,7 @@ class C { >{ [foo()]() { } } : { [x: string]: () => void; } [foo()]() { } +>[foo()] : () => void >foo() : string >foo : () => string >T : T diff --git a/tests/baselines/reference/computedPropertyNames34_ES5.symbols b/tests/baselines/reference/computedPropertyNames34_ES5.symbols index 34948397cf9..2b4ac9a6bc8 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames34_ES5.symbols @@ -14,6 +14,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames34_ES5.ts, 3, 11)) [foo()]() { } +>[foo()] : Symbol([foo()], Decl(computedPropertyNames34_ES5.ts, 3, 19)) >foo : Symbol(foo, Decl(computedPropertyNames34_ES5.ts, 0, 0)) }; diff --git a/tests/baselines/reference/computedPropertyNames34_ES5.types b/tests/baselines/reference/computedPropertyNames34_ES5.types index 1c3c054948e..8ed4ca0a5f3 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES5.types +++ b/tests/baselines/reference/computedPropertyNames34_ES5.types @@ -16,6 +16,7 @@ class C { >{ [foo()]() { } } : { [x: string]: () => void; } [foo()]() { } +>[foo()] : () => void >foo() : string >foo : () => string >T : No type information available! diff --git a/tests/baselines/reference/computedPropertyNames34_ES6.symbols b/tests/baselines/reference/computedPropertyNames34_ES6.symbols index 99d25773d75..1e556bb7932 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames34_ES6.symbols @@ -14,6 +14,7 @@ class C { >obj : Symbol(obj, Decl(computedPropertyNames34_ES6.ts, 3, 11)) [foo()]() { } +>[foo()] : Symbol([foo()], Decl(computedPropertyNames34_ES6.ts, 3, 19)) >foo : Symbol(foo, Decl(computedPropertyNames34_ES6.ts, 0, 0)) }; diff --git a/tests/baselines/reference/computedPropertyNames34_ES6.types b/tests/baselines/reference/computedPropertyNames34_ES6.types index 6e7dce2772a..d6b21467618 100644 --- a/tests/baselines/reference/computedPropertyNames34_ES6.types +++ b/tests/baselines/reference/computedPropertyNames34_ES6.types @@ -16,6 +16,7 @@ class C { >{ [foo()]() { } } : { [x: string]: () => void; } [foo()]() { } +>[foo()] : () => void >foo() : string >foo : () => string >T : No type information available! diff --git a/tests/baselines/reference/computedPropertyNames35_ES5.symbols b/tests/baselines/reference/computedPropertyNames35_ES5.symbols index 9f2547d9141..a6263e3363d 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames35_ES5.symbols @@ -11,5 +11,6 @@ interface I { >bar : Symbol(I.bar, Decl(computedPropertyNames35_ES5.ts, 1, 16)) [foo()](): void; +>[foo()] : Symbol(I[foo()], Decl(computedPropertyNames35_ES5.ts, 2, 18)) >foo : Symbol(foo, Decl(computedPropertyNames35_ES5.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames35_ES5.types b/tests/baselines/reference/computedPropertyNames35_ES5.types index 4b0f3db59b0..331051e00a5 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES5.types +++ b/tests/baselines/reference/computedPropertyNames35_ES5.types @@ -12,6 +12,7 @@ interface I { >bar : () => string [foo()](): void; +>[foo()] : () => void >foo() : string >foo : () => string >T : No type information available! diff --git a/tests/baselines/reference/computedPropertyNames35_ES6.symbols b/tests/baselines/reference/computedPropertyNames35_ES6.symbols index 6f42336186a..e2aa3c6c21f 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames35_ES6.symbols @@ -11,5 +11,6 @@ interface I { >bar : Symbol(I.bar, Decl(computedPropertyNames35_ES6.ts, 1, 16)) [foo()](): void; +>[foo()] : Symbol(I[foo()], Decl(computedPropertyNames35_ES6.ts, 2, 18)) >foo : Symbol(foo, Decl(computedPropertyNames35_ES6.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames35_ES6.types b/tests/baselines/reference/computedPropertyNames35_ES6.types index ddc570de904..41c6389011b 100644 --- a/tests/baselines/reference/computedPropertyNames35_ES6.types +++ b/tests/baselines/reference/computedPropertyNames35_ES6.types @@ -12,6 +12,7 @@ interface I { >bar : () => string [foo()](): void; +>[foo()] : () => void >foo() : string >foo : () => string >T : No type information available! diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.symbols b/tests/baselines/reference/computedPropertyNames36_ES5.symbols index f0c9adbf22f..89452476a19 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames36_ES5.symbols @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames36_ES5.ts, 4, 22)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames36_ES5.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames36_ES5.ts, 0, 0)) set ["set1"](p: Foo2) { } +>["set1"] : Symbol(C["set1"], Decl(computedPropertyNames36_ES5.ts, 7, 37)) >"set1" : Symbol(C["set1"], Decl(computedPropertyNames36_ES5.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames36_ES5.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames36_ES5.ts, 0, 15)) diff --git a/tests/baselines/reference/computedPropertyNames36_ES5.types b/tests/baselines/reference/computedPropertyNames36_ES5.types index de74d691e42..74e8dc51aa4 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES5.types +++ b/tests/baselines/reference/computedPropertyNames36_ES5.types @@ -17,11 +17,13 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>["set1"] : Foo2 >"set1" : "set1" >p : Foo2 >Foo2 : Foo2 diff --git a/tests/baselines/reference/computedPropertyNames36_ES6.symbols b/tests/baselines/reference/computedPropertyNames36_ES6.symbols index ad406fa5266..b85670aeef5 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames36_ES6.symbols @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames36_ES6.ts, 4, 22)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames36_ES6.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames36_ES6.ts, 0, 0)) set ["set1"](p: Foo2) { } +>["set1"] : Symbol(C["set1"], Decl(computedPropertyNames36_ES6.ts, 7, 37)) >"set1" : Symbol(C["set1"], Decl(computedPropertyNames36_ES6.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames36_ES6.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames36_ES6.ts, 0, 15)) diff --git a/tests/baselines/reference/computedPropertyNames36_ES6.types b/tests/baselines/reference/computedPropertyNames36_ES6.types index c4a1d882edf..2fc0b57f40d 100644 --- a/tests/baselines/reference/computedPropertyNames36_ES6.types +++ b/tests/baselines/reference/computedPropertyNames36_ES6.types @@ -17,11 +17,13 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>["set1"] : Foo2 >"set1" : "set1" >p : Foo2 >Foo2 : Foo2 diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.symbols b/tests/baselines/reference/computedPropertyNames37_ES5.symbols index 5d9ea090780..3e8de3ea47b 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames37_ES5.symbols @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames37_ES5.ts, 4, 22)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames37_ES5.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames37_ES5.ts, 0, 0)) set ["set1"](p: Foo2) { } +>["set1"] : Symbol(C["set1"], Decl(computedPropertyNames37_ES5.ts, 7, 37)) >"set1" : Symbol(C["set1"], Decl(computedPropertyNames37_ES5.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames37_ES5.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES5.ts, 0, 15)) diff --git a/tests/baselines/reference/computedPropertyNames37_ES5.types b/tests/baselines/reference/computedPropertyNames37_ES5.types index b1ba3a4315e..a6b87b8ab96 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES5.types +++ b/tests/baselines/reference/computedPropertyNames37_ES5.types @@ -17,11 +17,13 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>["set1"] : Foo2 >"set1" : "set1" >p : Foo2 >Foo2 : Foo2 diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.symbols b/tests/baselines/reference/computedPropertyNames37_ES6.symbols index f30cd6cad37..2a8bb3956c1 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames37_ES6.symbols @@ -17,10 +17,12 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames37_ES6.ts, 4, 22)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames37_ES6.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames37_ES6.ts, 0, 0)) set ["set1"](p: Foo2) { } +>["set1"] : Symbol(C["set1"], Decl(computedPropertyNames37_ES6.ts, 7, 37)) >"set1" : Symbol(C["set1"], Decl(computedPropertyNames37_ES6.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames37_ES6.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames37_ES6.ts, 0, 15)) diff --git a/tests/baselines/reference/computedPropertyNames37_ES6.types b/tests/baselines/reference/computedPropertyNames37_ES6.types index 67c84380e8b..13224b892e6 100644 --- a/tests/baselines/reference/computedPropertyNames37_ES6.types +++ b/tests/baselines/reference/computedPropertyNames37_ES6.types @@ -17,11 +17,13 @@ class C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>["set1"] : Foo2 >"set1" : "set1" >p : Foo2 >Foo2 : Foo2 diff --git a/tests/baselines/reference/computedPropertyNames38_ES5.symbols b/tests/baselines/reference/computedPropertyNames38_ES5.symbols index 661c3e7a973..4bca7f1401c 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames38_ES5.symbols @@ -17,9 +17,11 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames38_ES5.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames38_ES5.ts, 0, 0)) set [1 << 6](p: Foo2) { } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames38_ES5.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames38_ES5.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames38_ES5.ts, 0, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames38_ES5.types b/tests/baselines/reference/computedPropertyNames38_ES5.types index a3648d5c553..44f08c14786 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES5.types +++ b/tests/baselines/reference/computedPropertyNames38_ES5.types @@ -17,6 +17,7 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Foo >1 << 6 : number >1 : 1 >6 : 6 @@ -24,6 +25,7 @@ class C { >Foo : typeof Foo set [1 << 6](p: Foo2) { } +>[1 << 6] : Foo2 >1 << 6 : number >1 : 1 >6 : 6 diff --git a/tests/baselines/reference/computedPropertyNames38_ES6.symbols b/tests/baselines/reference/computedPropertyNames38_ES6.symbols index 9a125f88268..cc47bf8d566 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames38_ES6.symbols @@ -17,9 +17,11 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames38_ES6.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames38_ES6.ts, 0, 0)) set [1 << 6](p: Foo2) { } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames38_ES6.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames38_ES6.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames38_ES6.ts, 0, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames38_ES6.types b/tests/baselines/reference/computedPropertyNames38_ES6.types index 5fbef19cdfc..484193d0db6 100644 --- a/tests/baselines/reference/computedPropertyNames38_ES6.types +++ b/tests/baselines/reference/computedPropertyNames38_ES6.types @@ -17,6 +17,7 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Foo >1 << 6 : number >1 : 1 >6 : 6 @@ -24,6 +25,7 @@ class C { >Foo : typeof Foo set [1 << 6](p: Foo2) { } +>[1 << 6] : Foo2 >1 << 6 : number >1 : 1 >6 : 6 diff --git a/tests/baselines/reference/computedPropertyNames39_ES5.symbols b/tests/baselines/reference/computedPropertyNames39_ES5.symbols index 316fe98f5c2..04a02b92c30 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames39_ES5.symbols @@ -17,9 +17,11 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames39_ES5.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames39_ES5.ts, 0, 0)) set [1 << 6](p: Foo2) { } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames39_ES5.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames39_ES5.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames39_ES5.ts, 0, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames39_ES5.types b/tests/baselines/reference/computedPropertyNames39_ES5.types index e1592c0aab1..a51b2c47d32 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES5.types +++ b/tests/baselines/reference/computedPropertyNames39_ES5.types @@ -17,6 +17,7 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Foo >1 << 6 : number >1 : 1 >6 : 6 @@ -24,6 +25,7 @@ class C { >Foo : typeof Foo set [1 << 6](p: Foo2) { } +>[1 << 6] : Foo2 >1 << 6 : number >1 : 1 >6 : 6 diff --git a/tests/baselines/reference/computedPropertyNames39_ES6.symbols b/tests/baselines/reference/computedPropertyNames39_ES6.symbols index 5727cd695ca..4a65dcf6c43 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames39_ES6.symbols @@ -17,9 +17,11 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames39_ES6.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames39_ES6.ts, 0, 0)) set [1 << 6](p: Foo2) { } +>[1 << 6] : Symbol(C[1 << 6], Decl(computedPropertyNames39_ES6.ts, 7, 37)) >p : Symbol(p, Decl(computedPropertyNames39_ES6.ts, 8, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames39_ES6.ts, 0, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames39_ES6.types b/tests/baselines/reference/computedPropertyNames39_ES6.types index 1c015075f0b..d29d8d6521d 100644 --- a/tests/baselines/reference/computedPropertyNames39_ES6.types +++ b/tests/baselines/reference/computedPropertyNames39_ES6.types @@ -17,6 +17,7 @@ class C { // Computed properties get [1 << 6]() { return new Foo } +>[1 << 6] : Foo >1 << 6 : number >1 : 1 >6 : 6 @@ -24,6 +25,7 @@ class C { >Foo : typeof Foo set [1 << 6](p: Foo2) { } +>[1 << 6] : Foo2 >1 << 6 : number >1 : 1 >6 : 6 diff --git a/tests/baselines/reference/computedPropertyNames3_ES5.symbols b/tests/baselines/reference/computedPropertyNames3_ES5.symbols index 84267f55089..599a287511d 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames3_ES5.symbols @@ -6,17 +6,25 @@ class C { >C : Symbol(C, Decl(computedPropertyNames3_ES5.ts, 0, 7)) [0 + 1]() { } +>[0 + 1] : Symbol(C[0 + 1], Decl(computedPropertyNames3_ES5.ts, 1, 9)) + static [() => { }]() { } +>[() => { }] : Symbol(C[() => { }], Decl(computedPropertyNames3_ES5.ts, 2, 17)) + get [delete id]() { } +>[delete id] : Symbol(C[delete id], Decl(computedPropertyNames3_ES5.ts, 3, 28)) >id : Symbol(id, Decl(computedPropertyNames3_ES5.ts, 0, 3)) set [[0, 1]](v) { } +>[[0, 1]] : Symbol(C[[0, 1]], Decl(computedPropertyNames3_ES5.ts, 4, 25)) >v : Symbol(v, Decl(computedPropertyNames3_ES5.ts, 5, 17)) static get [""]() { } +>[""] : Symbol(C[""], Decl(computedPropertyNames3_ES5.ts, 5, 23)) >String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) static set [id.toString()](v) { } +>[id.toString()] : Symbol(C[id.toString()], Decl(computedPropertyNames3_ES5.ts, 6, 33)) >id : Symbol(id, Decl(computedPropertyNames3_ES5.ts, 0, 3)) >v : Symbol(v, Decl(computedPropertyNames3_ES5.ts, 7, 31)) } diff --git a/tests/baselines/reference/computedPropertyNames3_ES5.types b/tests/baselines/reference/computedPropertyNames3_ES5.types index 4d8612c4ef8..fa086a5fee6 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES5.types +++ b/tests/baselines/reference/computedPropertyNames3_ES5.types @@ -6,29 +6,35 @@ class C { >C : C [0 + 1]() { } +>[0 + 1] : () => void >0 + 1 : number >0 : 0 >1 : 1 static [() => { }]() { } +>[() => { }] : () => void >() => { } : () => void get [delete id]() { } +>[delete id] : void >delete id : boolean >id : any set [[0, 1]](v) { } +>[[0, 1]] : any >[0, 1] : number[] >0 : 0 >1 : 1 >v : any static get [""]() { } +>[""] : void >"" : String >String : String >"" : "" static set [id.toString()](v) { } +>[id.toString()] : any >id.toString() : any >id.toString : any >id : any diff --git a/tests/baselines/reference/computedPropertyNames3_ES6.symbols b/tests/baselines/reference/computedPropertyNames3_ES6.symbols index 7e51c7a2298..55397568b37 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames3_ES6.symbols @@ -6,17 +6,25 @@ class C { >C : Symbol(C, Decl(computedPropertyNames3_ES6.ts, 0, 7)) [0 + 1]() { } +>[0 + 1] : Symbol(C[0 + 1], Decl(computedPropertyNames3_ES6.ts, 1, 9)) + static [() => { }]() { } +>[() => { }] : Symbol(C[() => { }], Decl(computedPropertyNames3_ES6.ts, 2, 17)) + get [delete id]() { } +>[delete id] : Symbol(C[delete id], Decl(computedPropertyNames3_ES6.ts, 3, 28)) >id : Symbol(id, Decl(computedPropertyNames3_ES6.ts, 0, 3)) set [[0, 1]](v) { } +>[[0, 1]] : Symbol(C[[0, 1]], Decl(computedPropertyNames3_ES6.ts, 4, 25)) >v : Symbol(v, Decl(computedPropertyNames3_ES6.ts, 5, 17)) static get [""]() { } +>[""] : Symbol(C[""], Decl(computedPropertyNames3_ES6.ts, 5, 23)) >String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) static set [id.toString()](v) { } +>[id.toString()] : Symbol(C[id.toString()], Decl(computedPropertyNames3_ES6.ts, 6, 33)) >id : Symbol(id, Decl(computedPropertyNames3_ES6.ts, 0, 3)) >v : Symbol(v, Decl(computedPropertyNames3_ES6.ts, 7, 31)) } diff --git a/tests/baselines/reference/computedPropertyNames3_ES6.types b/tests/baselines/reference/computedPropertyNames3_ES6.types index 6342c173574..e5cbc1e7cc1 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES6.types +++ b/tests/baselines/reference/computedPropertyNames3_ES6.types @@ -6,29 +6,35 @@ class C { >C : C [0 + 1]() { } +>[0 + 1] : () => void >0 + 1 : number >0 : 0 >1 : 1 static [() => { }]() { } +>[() => { }] : () => void >() => { } : () => void get [delete id]() { } +>[delete id] : void >delete id : boolean >id : any set [[0, 1]](v) { } +>[[0, 1]] : any >[0, 1] : number[] >0 : 0 >1 : 1 >v : any static get [""]() { } +>[""] : void >"" : String >String : String >"" : "" static set [id.toString()](v) { } +>[id.toString()] : any >id.toString() : any >id.toString : any >id : any diff --git a/tests/baselines/reference/computedPropertyNames40_ES5.symbols b/tests/baselines/reference/computedPropertyNames40_ES5.symbols index d59a516b5e2..adb87d06a43 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames40_ES5.symbols @@ -17,10 +17,12 @@ class C { // Computed properties [""]() { return new Foo } +>[""] : Symbol(C[""], Decl(computedPropertyNames40_ES5.ts, 4, 28), Decl(computedPropertyNames40_ES5.ts, 7, 29)) >"" : Symbol(C[""], Decl(computedPropertyNames40_ES5.ts, 4, 28), Decl(computedPropertyNames40_ES5.ts, 7, 29)) >Foo : Symbol(Foo, Decl(computedPropertyNames40_ES5.ts, 0, 0)) [""]() { return new Foo2 } +>[""] : Symbol(C[""], Decl(computedPropertyNames40_ES5.ts, 4, 28), Decl(computedPropertyNames40_ES5.ts, 7, 29)) >"" : Symbol(C[""], Decl(computedPropertyNames40_ES5.ts, 4, 28), Decl(computedPropertyNames40_ES5.ts, 7, 29)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames40_ES5.ts, 0, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames40_ES5.types b/tests/baselines/reference/computedPropertyNames40_ES5.types index be3e32b710a..3a862267666 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES5.types +++ b/tests/baselines/reference/computedPropertyNames40_ES5.types @@ -17,11 +17,13 @@ class C { // Computed properties [""]() { return new Foo } +>[""] : () => Foo >"" : "" >new Foo : Foo >Foo : typeof Foo [""]() { return new Foo2 } +>[""] : () => Foo >"" : "" >new Foo2 : Foo2 >Foo2 : typeof Foo2 diff --git a/tests/baselines/reference/computedPropertyNames40_ES6.symbols b/tests/baselines/reference/computedPropertyNames40_ES6.symbols index f5881fa6a6b..85f35d0524a 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames40_ES6.symbols @@ -17,10 +17,12 @@ class C { // Computed properties [""]() { return new Foo } +>[""] : Symbol(C[""], Decl(computedPropertyNames40_ES6.ts, 4, 28), Decl(computedPropertyNames40_ES6.ts, 7, 29)) >"" : Symbol(C[""], Decl(computedPropertyNames40_ES6.ts, 4, 28), Decl(computedPropertyNames40_ES6.ts, 7, 29)) >Foo : Symbol(Foo, Decl(computedPropertyNames40_ES6.ts, 0, 0)) [""]() { return new Foo2 } +>[""] : Symbol(C[""], Decl(computedPropertyNames40_ES6.ts, 4, 28), Decl(computedPropertyNames40_ES6.ts, 7, 29)) >"" : Symbol(C[""], Decl(computedPropertyNames40_ES6.ts, 4, 28), Decl(computedPropertyNames40_ES6.ts, 7, 29)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames40_ES6.ts, 0, 15)) } diff --git a/tests/baselines/reference/computedPropertyNames40_ES6.types b/tests/baselines/reference/computedPropertyNames40_ES6.types index ef27fe0b449..a4bbb96f3b7 100644 --- a/tests/baselines/reference/computedPropertyNames40_ES6.types +++ b/tests/baselines/reference/computedPropertyNames40_ES6.types @@ -17,11 +17,13 @@ class C { // Computed properties [""]() { return new Foo } +>[""] : () => Foo >"" : "" >new Foo : Foo >Foo : typeof Foo [""]() { return new Foo2 } +>[""] : () => Foo >"" : "" >new Foo2 : Foo2 >Foo2 : typeof Foo2 diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.symbols b/tests/baselines/reference/computedPropertyNames41_ES5.symbols index c0642d6b0a6..4744939abb5 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames41_ES5.symbols @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>[""] : Symbol(C[""], Decl(computedPropertyNames41_ES5.ts, 4, 28)) >"" : Symbol(C[""], Decl(computedPropertyNames41_ES5.ts, 4, 28)) >Foo : Symbol(Foo, Decl(computedPropertyNames41_ES5.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames41_ES5.types b/tests/baselines/reference/computedPropertyNames41_ES5.types index 0be69bec4a5..ce0b0b08ffc 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES5.types +++ b/tests/baselines/reference/computedPropertyNames41_ES5.types @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>[""] : () => Foo >"" : "" >new Foo : Foo >Foo : typeof Foo diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.symbols b/tests/baselines/reference/computedPropertyNames41_ES6.symbols index 10ef48e4d16..20db81b27e5 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames41_ES6.symbols @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>[""] : Symbol(C[""], Decl(computedPropertyNames41_ES6.ts, 4, 28)) >"" : Symbol(C[""], Decl(computedPropertyNames41_ES6.ts, 4, 28)) >Foo : Symbol(Foo, Decl(computedPropertyNames41_ES6.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames41_ES6.types b/tests/baselines/reference/computedPropertyNames41_ES6.types index 297a41eecec..9445e042ccb 100644 --- a/tests/baselines/reference/computedPropertyNames41_ES6.types +++ b/tests/baselines/reference/computedPropertyNames41_ES6.types @@ -17,6 +17,7 @@ class C { // Computed properties static [""]() { return new Foo } +>[""] : () => Foo >"" : "" >new Foo : Foo >Foo : typeof Foo diff --git a/tests/baselines/reference/computedPropertyNames42_ES5.symbols b/tests/baselines/reference/computedPropertyNames42_ES5.symbols index 7c3fa50362a..47e96a45dc1 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames42_ES5.symbols @@ -17,6 +17,7 @@ class C { // Computed properties [""]: Foo; +>[""] : Symbol(C[""], Decl(computedPropertyNames42_ES5.ts, 4, 22)) >"" : Symbol(C[""], Decl(computedPropertyNames42_ES5.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames42_ES5.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames42_ES5.types b/tests/baselines/reference/computedPropertyNames42_ES5.types index efe88c2425e..565da1bf778 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES5.types +++ b/tests/baselines/reference/computedPropertyNames42_ES5.types @@ -17,6 +17,7 @@ class C { // Computed properties [""]: Foo; +>[""] : Foo >"" : "" >Foo : Foo } diff --git a/tests/baselines/reference/computedPropertyNames42_ES6.symbols b/tests/baselines/reference/computedPropertyNames42_ES6.symbols index 2055a90e074..9622fa7087e 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames42_ES6.symbols @@ -17,6 +17,7 @@ class C { // Computed properties [""]: Foo; +>[""] : Symbol(C[""], Decl(computedPropertyNames42_ES6.ts, 4, 22)) >"" : Symbol(C[""], Decl(computedPropertyNames42_ES6.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames42_ES6.ts, 0, 0)) } diff --git a/tests/baselines/reference/computedPropertyNames42_ES6.types b/tests/baselines/reference/computedPropertyNames42_ES6.types index 0d9d882d367..5fd91b93926 100644 --- a/tests/baselines/reference/computedPropertyNames42_ES6.types +++ b/tests/baselines/reference/computedPropertyNames42_ES6.types @@ -17,6 +17,7 @@ class C { // Computed properties [""]: Foo; +>[""] : Foo >"" : "" >Foo : Foo } diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.symbols b/tests/baselines/reference/computedPropertyNames43_ES5.symbols index 3fe75720280..d71f1743c0f 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames43_ES5.symbols @@ -22,10 +22,12 @@ class D extends C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Symbol(D["get1"], Decl(computedPropertyNames43_ES5.ts, 7, 19)) >"get1" : Symbol(D["get1"], Decl(computedPropertyNames43_ES5.ts, 7, 19)) >Foo : Symbol(Foo, Decl(computedPropertyNames43_ES5.ts, 0, 0)) set ["set1"](p: Foo2) { } +>["set1"] : Symbol(D["set1"], Decl(computedPropertyNames43_ES5.ts, 9, 37)) >"set1" : Symbol(D["set1"], Decl(computedPropertyNames43_ES5.ts, 9, 37)) >p : Symbol(p, Decl(computedPropertyNames43_ES5.ts, 10, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames43_ES5.ts, 0, 15)) diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.types b/tests/baselines/reference/computedPropertyNames43_ES5.types index 98aaa4573f5..358130f1a8e 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.types +++ b/tests/baselines/reference/computedPropertyNames43_ES5.types @@ -22,11 +22,13 @@ class D extends C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>["set1"] : Foo2 >"set1" : "set1" >p : Foo2 >Foo2 : Foo2 diff --git a/tests/baselines/reference/computedPropertyNames43_ES6.symbols b/tests/baselines/reference/computedPropertyNames43_ES6.symbols index 4c2c8082771..fe9a679d0ba 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames43_ES6.symbols @@ -22,10 +22,12 @@ class D extends C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Symbol(D["get1"], Decl(computedPropertyNames43_ES6.ts, 7, 19)) >"get1" : Symbol(D["get1"], Decl(computedPropertyNames43_ES6.ts, 7, 19)) >Foo : Symbol(Foo, Decl(computedPropertyNames43_ES6.ts, 0, 0)) set ["set1"](p: Foo2) { } +>["set1"] : Symbol(D["set1"], Decl(computedPropertyNames43_ES6.ts, 9, 37)) >"set1" : Symbol(D["set1"], Decl(computedPropertyNames43_ES6.ts, 9, 37)) >p : Symbol(p, Decl(computedPropertyNames43_ES6.ts, 10, 17)) >Foo2 : Symbol(Foo2, Decl(computedPropertyNames43_ES6.ts, 0, 15)) diff --git a/tests/baselines/reference/computedPropertyNames43_ES6.types b/tests/baselines/reference/computedPropertyNames43_ES6.types index b1ce6d714f7..0e93b30ef61 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES6.types +++ b/tests/baselines/reference/computedPropertyNames43_ES6.types @@ -22,11 +22,13 @@ class D extends C { // Computed properties get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo set ["set1"](p: Foo2) { } +>["set1"] : Foo2 >"set1" : "set1" >p : Foo2 >Foo2 : Foo2 diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.symbols b/tests/baselines/reference/computedPropertyNames44_ES5.symbols index ca3841411a0..21a0a8fd90e 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames44_ES5.symbols @@ -16,6 +16,7 @@ class C { >Foo2 : Symbol(Foo2, Decl(computedPropertyNames44_ES5.ts, 0, 15)) get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames44_ES5.ts, 4, 22)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames44_ES5.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames44_ES5.ts, 0, 0)) } @@ -25,6 +26,7 @@ class D extends C { >C : Symbol(C, Decl(computedPropertyNames44_ES5.ts, 1, 19)) set ["set1"](p: Foo) { } +>["set1"] : Symbol(D["set1"], Decl(computedPropertyNames44_ES5.ts, 8, 19)) >"set1" : Symbol(D["set1"], Decl(computedPropertyNames44_ES5.ts, 8, 19)) >p : Symbol(p, Decl(computedPropertyNames44_ES5.ts, 9, 17)) >Foo : Symbol(Foo, Decl(computedPropertyNames44_ES5.ts, 0, 0)) diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.types b/tests/baselines/reference/computedPropertyNames44_ES5.types index abf75103f58..02d2b4dbd3f 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.types +++ b/tests/baselines/reference/computedPropertyNames44_ES5.types @@ -16,6 +16,7 @@ class C { >Foo2 : Foo2 get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo @@ -26,6 +27,7 @@ class D extends C { >C : C set ["set1"](p: Foo) { } +>["set1"] : Foo >"set1" : "set1" >p : Foo >Foo : Foo diff --git a/tests/baselines/reference/computedPropertyNames44_ES6.symbols b/tests/baselines/reference/computedPropertyNames44_ES6.symbols index 13abd6f8f24..7ef426a161c 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames44_ES6.symbols @@ -16,6 +16,7 @@ class C { >Foo2 : Symbol(Foo2, Decl(computedPropertyNames44_ES6.ts, 0, 15)) get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames44_ES6.ts, 4, 22)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames44_ES6.ts, 4, 22)) >Foo : Symbol(Foo, Decl(computedPropertyNames44_ES6.ts, 0, 0)) } @@ -25,6 +26,7 @@ class D extends C { >C : Symbol(C, Decl(computedPropertyNames44_ES6.ts, 1, 19)) set ["set1"](p: Foo) { } +>["set1"] : Symbol(D["set1"], Decl(computedPropertyNames44_ES6.ts, 8, 19)) >"set1" : Symbol(D["set1"], Decl(computedPropertyNames44_ES6.ts, 8, 19)) >p : Symbol(p, Decl(computedPropertyNames44_ES6.ts, 9, 17)) >Foo : Symbol(Foo, Decl(computedPropertyNames44_ES6.ts, 0, 0)) diff --git a/tests/baselines/reference/computedPropertyNames44_ES6.types b/tests/baselines/reference/computedPropertyNames44_ES6.types index 8c07b3fd843..ec9ec7d4b70 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES6.types +++ b/tests/baselines/reference/computedPropertyNames44_ES6.types @@ -16,6 +16,7 @@ class C { >Foo2 : Foo2 get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo @@ -26,6 +27,7 @@ class D extends C { >C : C set ["set1"](p: Foo) { } +>["set1"] : Foo >"set1" : "set1" >p : Foo >Foo : Foo diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.symbols b/tests/baselines/reference/computedPropertyNames45_ES5.symbols index 04887f8e9ff..25a73a83682 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames45_ES5.symbols @@ -12,6 +12,7 @@ class C { >C : Symbol(C, Decl(computedPropertyNames45_ES5.ts, 1, 19)) get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames45_ES5.ts, 3, 9)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames45_ES5.ts, 3, 9)) >Foo : Symbol(Foo, Decl(computedPropertyNames45_ES5.ts, 0, 0)) } @@ -26,6 +27,7 @@ class D extends C { >Foo2 : Symbol(Foo2, Decl(computedPropertyNames45_ES5.ts, 0, 15)) set ["set1"](p: Foo) { } +>["set1"] : Symbol(D["set1"], Decl(computedPropertyNames45_ES5.ts, 9, 22)) >"set1" : Symbol(D["set1"], Decl(computedPropertyNames45_ES5.ts, 9, 22)) >p : Symbol(p, Decl(computedPropertyNames45_ES5.ts, 10, 17)) >Foo : Symbol(Foo, Decl(computedPropertyNames45_ES5.ts, 0, 0)) diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.types b/tests/baselines/reference/computedPropertyNames45_ES5.types index 7f641fde9bf..843acbbd9c1 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.types +++ b/tests/baselines/reference/computedPropertyNames45_ES5.types @@ -12,6 +12,7 @@ class C { >C : C get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo @@ -27,6 +28,7 @@ class D extends C { >Foo2 : Foo2 set ["set1"](p: Foo) { } +>["set1"] : Foo >"set1" : "set1" >p : Foo >Foo : Foo diff --git a/tests/baselines/reference/computedPropertyNames45_ES6.symbols b/tests/baselines/reference/computedPropertyNames45_ES6.symbols index 5e01cb0201e..cdc9f4bbe51 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames45_ES6.symbols @@ -12,6 +12,7 @@ class C { >C : Symbol(C, Decl(computedPropertyNames45_ES6.ts, 1, 19)) get ["get1"]() { return new Foo } +>["get1"] : Symbol(C["get1"], Decl(computedPropertyNames45_ES6.ts, 3, 9)) >"get1" : Symbol(C["get1"], Decl(computedPropertyNames45_ES6.ts, 3, 9)) >Foo : Symbol(Foo, Decl(computedPropertyNames45_ES6.ts, 0, 0)) } @@ -26,6 +27,7 @@ class D extends C { >Foo2 : Symbol(Foo2, Decl(computedPropertyNames45_ES6.ts, 0, 15)) set ["set1"](p: Foo) { } +>["set1"] : Symbol(D["set1"], Decl(computedPropertyNames45_ES6.ts, 9, 22)) >"set1" : Symbol(D["set1"], Decl(computedPropertyNames45_ES6.ts, 9, 22)) >p : Symbol(p, Decl(computedPropertyNames45_ES6.ts, 10, 17)) >Foo : Symbol(Foo, Decl(computedPropertyNames45_ES6.ts, 0, 0)) diff --git a/tests/baselines/reference/computedPropertyNames45_ES6.types b/tests/baselines/reference/computedPropertyNames45_ES6.types index 1c1dcc8f696..dd937080ca8 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES6.types +++ b/tests/baselines/reference/computedPropertyNames45_ES6.types @@ -12,6 +12,7 @@ class C { >C : C get ["get1"]() { return new Foo } +>["get1"] : Foo >"get1" : "get1" >new Foo : Foo >Foo : typeof Foo @@ -27,6 +28,7 @@ class D extends C { >Foo2 : Foo2 set ["set1"](p: Foo) { } +>["set1"] : Foo >"set1" : "set1" >p : Foo >Foo : Foo diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.symbols b/tests/baselines/reference/computedPropertyNames46_ES5.symbols index 10a7cf0b528..ce3ede70511 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames46_ES5.symbols @@ -3,4 +3,6 @@ var o = { >o : Symbol(o, Decl(computedPropertyNames46_ES5.ts, 0, 3)) ["" || 0]: 0 +>["" || 0] : Symbol(["" || 0], Decl(computedPropertyNames46_ES5.ts, 0, 9)) + }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES5.types b/tests/baselines/reference/computedPropertyNames46_ES5.types index e90d1a6c498..f1b9b3c459a 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES5.types +++ b/tests/baselines/reference/computedPropertyNames46_ES5.types @@ -4,6 +4,7 @@ var o = { >{ ["" || 0]: 0} : { ["" || 0]: number; } ["" || 0]: 0 +>["" || 0] : number >"" || 0 : 0 >"" : "" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.symbols b/tests/baselines/reference/computedPropertyNames46_ES6.symbols index 3028eb8e225..bfa9d2e2368 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames46_ES6.symbols @@ -3,4 +3,6 @@ var o = { >o : Symbol(o, Decl(computedPropertyNames46_ES6.ts, 0, 3)) ["" || 0]: 0 +>["" || 0] : Symbol(["" || 0], Decl(computedPropertyNames46_ES6.ts, 0, 9)) + }; diff --git a/tests/baselines/reference/computedPropertyNames46_ES6.types b/tests/baselines/reference/computedPropertyNames46_ES6.types index 34aac7489c9..df880ac3166 100644 --- a/tests/baselines/reference/computedPropertyNames46_ES6.types +++ b/tests/baselines/reference/computedPropertyNames46_ES6.types @@ -4,6 +4,7 @@ var o = { >{ ["" || 0]: 0} : { ["" || 0]: number; } ["" || 0]: 0 +>["" || 0] : number >"" || 0 : 0 >"" : "" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.symbols b/tests/baselines/reference/computedPropertyNames47_ES5.symbols index c124850e5a6..8273bc7b9b0 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames47_ES5.symbols @@ -11,6 +11,7 @@ var o = { >o : Symbol(o, Decl(computedPropertyNames47_ES5.ts, 2, 3)) [E1.x || E2.x]: 0 +>[E1.x || E2.x] : Symbol([E1.x || E2.x], Decl(computedPropertyNames47_ES5.ts, 2, 9)) >E1.x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) >E1 : Symbol(E1, Decl(computedPropertyNames47_ES5.ts, 0, 0)) >x : Symbol(E1.x, Decl(computedPropertyNames47_ES5.ts, 0, 9)) diff --git a/tests/baselines/reference/computedPropertyNames47_ES5.types b/tests/baselines/reference/computedPropertyNames47_ES5.types index 9c01db09846..7307210cfbe 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES5.types +++ b/tests/baselines/reference/computedPropertyNames47_ES5.types @@ -12,6 +12,7 @@ var o = { >{ [E1.x || E2.x]: 0} : { [E1.x || E2.x]: number; } [E1.x || E2.x]: 0 +>[E1.x || E2.x] : number >E1.x || E2.x : E2 >E1.x : E1 >E1 : typeof E1 diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.symbols b/tests/baselines/reference/computedPropertyNames47_ES6.symbols index ec0850d5b13..8236655c1bd 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames47_ES6.symbols @@ -11,6 +11,7 @@ var o = { >o : Symbol(o, Decl(computedPropertyNames47_ES6.ts, 2, 3)) [E1.x || E2.x]: 0 +>[E1.x || E2.x] : Symbol([E1.x || E2.x], Decl(computedPropertyNames47_ES6.ts, 2, 9)) >E1.x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) >E1 : Symbol(E1, Decl(computedPropertyNames47_ES6.ts, 0, 0)) >x : Symbol(E1.x, Decl(computedPropertyNames47_ES6.ts, 0, 9)) diff --git a/tests/baselines/reference/computedPropertyNames47_ES6.types b/tests/baselines/reference/computedPropertyNames47_ES6.types index c2e65523e46..d630d5bba93 100644 --- a/tests/baselines/reference/computedPropertyNames47_ES6.types +++ b/tests/baselines/reference/computedPropertyNames47_ES6.types @@ -12,6 +12,7 @@ var o = { >{ [E1.x || E2.x]: 0} : { [E1.x || E2.x]: number; } [E1.x || E2.x]: 0 +>[E1.x || E2.x] : number >E1.x || E2.x : E2 >E1.x : E1 >E1 : typeof E1 diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.symbols b/tests/baselines/reference/computedPropertyNames48_ES5.symbols index 14f7cc6352d..0bed4548ce8 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames48_ES5.symbols @@ -18,6 +18,7 @@ extractIndexer({ >extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) [a]: "" +>[a] : Symbol([a], Decl(computedPropertyNames48_ES5.ts, 6, 16)) >a : Symbol(a, Decl(computedPropertyNames48_ES5.ts, 4, 3)) }); // Should return string @@ -26,6 +27,7 @@ extractIndexer({ >extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) [E.x]: "" +>[E.x] : Symbol([E.x], Decl(computedPropertyNames48_ES5.ts, 10, 16)) >E.x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) >E : Symbol(E, Decl(computedPropertyNames48_ES5.ts, 0, 61)) >x : Symbol(E.x, Decl(computedPropertyNames48_ES5.ts, 2, 8)) @@ -36,4 +38,6 @@ extractIndexer({ >extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES5.ts, 0, 0)) ["" || 0]: "" +>["" || 0] : Symbol(["" || 0], Decl(computedPropertyNames48_ES5.ts, 14, 16)) + }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.types b/tests/baselines/reference/computedPropertyNames48_ES5.types index 25818fff967..9a79d279623 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.types +++ b/tests/baselines/reference/computedPropertyNames48_ES5.types @@ -20,6 +20,7 @@ extractIndexer({ >{ [a]: ""} : { [x: number]: string; } [a]: "" +>[a] : string >a : any >"" : "" @@ -31,6 +32,7 @@ extractIndexer({ >{ [E.x]: ""} : { [E.x]: string; } [E.x]: "" +>[E.x] : string >E.x : E >E : typeof E >x : E @@ -44,6 +46,7 @@ extractIndexer({ >{ ["" || 0]: ""} : { ["" || 0]: string; } ["" || 0]: "" +>["" || 0] : string >"" || 0 : 0 >"" : "" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.symbols b/tests/baselines/reference/computedPropertyNames48_ES6.symbols index 5d63c9f495d..049ab2b0306 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames48_ES6.symbols @@ -18,6 +18,7 @@ extractIndexer({ >extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) [a]: "" +>[a] : Symbol([a], Decl(computedPropertyNames48_ES6.ts, 6, 16)) >a : Symbol(a, Decl(computedPropertyNames48_ES6.ts, 4, 3)) }); // Should return string @@ -26,6 +27,7 @@ extractIndexer({ >extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) [E.x]: "" +>[E.x] : Symbol([E.x], Decl(computedPropertyNames48_ES6.ts, 10, 16)) >E.x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) >E : Symbol(E, Decl(computedPropertyNames48_ES6.ts, 0, 61)) >x : Symbol(E.x, Decl(computedPropertyNames48_ES6.ts, 2, 8)) @@ -36,4 +38,6 @@ extractIndexer({ >extractIndexer : Symbol(extractIndexer, Decl(computedPropertyNames48_ES6.ts, 0, 0)) ["" || 0]: "" +>["" || 0] : Symbol(["" || 0], Decl(computedPropertyNames48_ES6.ts, 14, 16)) + }); // Should return any (widened form of undefined) diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.types b/tests/baselines/reference/computedPropertyNames48_ES6.types index 65f93239f30..5be1ae27e50 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.types +++ b/tests/baselines/reference/computedPropertyNames48_ES6.types @@ -20,6 +20,7 @@ extractIndexer({ >{ [a]: ""} : { [x: number]: string; } [a]: "" +>[a] : string >a : any >"" : "" @@ -31,6 +32,7 @@ extractIndexer({ >{ [E.x]: ""} : { [E.x]: string; } [E.x]: "" +>[E.x] : string >E.x : E >E : typeof E >x : E @@ -44,6 +46,7 @@ extractIndexer({ >{ ["" || 0]: ""} : { ["" || 0]: string; } ["" || 0]: "" +>["" || 0] : string >"" || 0 : 0 >"" : "" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames49_ES5.symbols b/tests/baselines/reference/computedPropertyNames49_ES5.symbols index a9b77aee741..d2da5b9df1a 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames49_ES5.symbols @@ -6,12 +6,18 @@ var x = { >p1 : Symbol(p1, Decl(computedPropertyNames49_ES5.ts, 0, 9)) get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames49_ES5.ts, 1, 11)) + throw 10; }, get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames49_ES5.ts, 4, 6)) + return 10; }, set [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames49_ES5.ts, 7, 6)) + // just throw throw 10; }, diff --git a/tests/baselines/reference/computedPropertyNames49_ES5.types b/tests/baselines/reference/computedPropertyNames49_ES5.types index 4da06585c86..f383dc793a7 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES5.types +++ b/tests/baselines/reference/computedPropertyNames49_ES5.types @@ -8,6 +8,7 @@ var x = { >10 : 10 get [1 + 1]() { +>[1 + 1] : void >1 + 1 : number >1 : 1 >1 : 1 @@ -17,6 +18,7 @@ var x = { }, get [1 + 1]() { +>[1 + 1] : number >1 + 1 : number >1 : 1 >1 : 1 @@ -26,6 +28,7 @@ var x = { }, set [1 + 1]() { +>[1 + 1] : any >1 + 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames49_ES6.symbols b/tests/baselines/reference/computedPropertyNames49_ES6.symbols index ab588220116..9c320ae4f4b 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames49_ES6.symbols @@ -6,12 +6,18 @@ var x = { >p1 : Symbol(p1, Decl(computedPropertyNames49_ES6.ts, 0, 9)) get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames49_ES6.ts, 1, 11)) + throw 10; }, get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames49_ES6.ts, 4, 6)) + return 10; }, set [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames49_ES6.ts, 7, 6)) + // just throw throw 10; }, diff --git a/tests/baselines/reference/computedPropertyNames49_ES6.types b/tests/baselines/reference/computedPropertyNames49_ES6.types index 76d7c57b4da..c185596307f 100644 --- a/tests/baselines/reference/computedPropertyNames49_ES6.types +++ b/tests/baselines/reference/computedPropertyNames49_ES6.types @@ -8,6 +8,7 @@ var x = { >10 : 10 get [1 + 1]() { +>[1 + 1] : void >1 + 1 : number >1 : 1 >1 : 1 @@ -17,6 +18,7 @@ var x = { }, get [1 + 1]() { +>[1 + 1] : number >1 + 1 : number >1 : 1 >1 : 1 @@ -26,6 +28,7 @@ var x = { }, set [1 + 1]() { +>[1 + 1] : any >1 + 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.symbols b/tests/baselines/reference/computedPropertyNames4_ES5.symbols index e49e333d738..ccb94818310 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames4_ES5.symbols @@ -12,35 +12,48 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames4_ES5.ts, 3, 3)) [s]: 0, +>[s] : Symbol([s], Decl(computedPropertyNames4_ES5.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) [n]: n, +>[n] : Symbol([n], Decl(computedPropertyNames4_ES5.ts, 4, 11)) >n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) >n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) [s + s]: 1, +>[s + s] : Symbol([s + s], Decl(computedPropertyNames4_ES5.ts, 5, 11)) >s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) [s + n]: 2, +>[s + n] : Symbol([s + n], Decl(computedPropertyNames4_ES5.ts, 6, 15)) >s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames4_ES5.ts, 1, 3)) [+s]: s, +>[+s] : Symbol([+s], Decl(computedPropertyNames4_ES5.ts, 7, 15)) >s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames4_ES5.ts, 0, 3)) [""]: 0, +>[""] : Symbol([""], Decl(computedPropertyNames4_ES5.ts, 8, 12)) >"" : Symbol([""], Decl(computedPropertyNames4_ES5.ts, 8, 12)) [0]: 0, +>[0] : Symbol([0], Decl(computedPropertyNames4_ES5.ts, 9, 12)) >0 : Symbol([0], Decl(computedPropertyNames4_ES5.ts, 9, 12)) [a]: 1, +>[a] : Symbol([a], Decl(computedPropertyNames4_ES5.ts, 10, 11)) >a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) [true]: 0, +>[true] : Symbol([true], Decl(computedPropertyNames4_ES5.ts, 11, 11)) + [`hello bye`]: 0, +>[`hello bye`] : Symbol([`hello bye`], Decl(computedPropertyNames4_ES5.ts, 12, 19)) + [`hello ${a} bye`]: 0 +>[`hello ${a} bye`] : Symbol([`hello ${a} bye`], Decl(computedPropertyNames4_ES5.ts, 13, 21)) >a : Symbol(a, Decl(computedPropertyNames4_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index f0e105be4a7..e34921dd63a 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -13,52 +13,63 @@ var v = { >{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [x: string]: string | number; [x: number]: string | number; [""]: number; [0]: number; [`hello bye`]: number; } [s]: 0, +>[s] : number >s : string >0 : 0 [n]: n, +>[n] : number >n : number >n : number [s + s]: 1, +>[s + s] : number >s + s : string >s : string >s : string >1 : 1 [s + n]: 2, +>[s + n] : number >s + n : string >s : string >n : number >2 : 2 [+s]: s, +>[+s] : string >+s : number >s : string >s : string [""]: 0, +>[""] : number >"" : "" >0 : 0 [0]: 0, +>[0] : number >0 : 0 >0 : 0 [a]: 1, +>[a] : number >a : any >1 : 1 [true]: 0, +>[true] : number >true : any >true : true >0 : 0 [`hello bye`]: 0, +>[`hello bye`] : number >`hello bye` : "hello bye" >0 : 0 [`hello ${a} bye`]: 0 +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.symbols b/tests/baselines/reference/computedPropertyNames4_ES6.symbols index 345cdb1ad3e..aeb3e597897 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames4_ES6.symbols @@ -12,35 +12,48 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames4_ES6.ts, 3, 3)) [s]: 0, +>[s] : Symbol([s], Decl(computedPropertyNames4_ES6.ts, 3, 9)) >s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) [n]: n, +>[n] : Symbol([n], Decl(computedPropertyNames4_ES6.ts, 4, 11)) >n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) >n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) [s + s]: 1, +>[s + s] : Symbol([s + s], Decl(computedPropertyNames4_ES6.ts, 5, 11)) >s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) [s + n]: 2, +>[s + n] : Symbol([s + n], Decl(computedPropertyNames4_ES6.ts, 6, 15)) >s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) >n : Symbol(n, Decl(computedPropertyNames4_ES6.ts, 1, 3)) [+s]: s, +>[+s] : Symbol([+s], Decl(computedPropertyNames4_ES6.ts, 7, 15)) >s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) >s : Symbol(s, Decl(computedPropertyNames4_ES6.ts, 0, 3)) [""]: 0, +>[""] : Symbol([""], Decl(computedPropertyNames4_ES6.ts, 8, 12)) >"" : Symbol([""], Decl(computedPropertyNames4_ES6.ts, 8, 12)) [0]: 0, +>[0] : Symbol([0], Decl(computedPropertyNames4_ES6.ts, 9, 12)) >0 : Symbol([0], Decl(computedPropertyNames4_ES6.ts, 9, 12)) [a]: 1, +>[a] : Symbol([a], Decl(computedPropertyNames4_ES6.ts, 10, 11)) >a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) [true]: 0, +>[true] : Symbol([true], Decl(computedPropertyNames4_ES6.ts, 11, 11)) + [`hello bye`]: 0, +>[`hello bye`] : Symbol([`hello bye`], Decl(computedPropertyNames4_ES6.ts, 12, 19)) + [`hello ${a} bye`]: 0 +>[`hello ${a} bye`] : Symbol([`hello ${a} bye`], Decl(computedPropertyNames4_ES6.ts, 13, 21)) >a : Symbol(a, Decl(computedPropertyNames4_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index 178eca88a72..85e95a8b1ad 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -13,52 +13,63 @@ var v = { >{ [s]: 0, [n]: n, [s + s]: 1, [s + n]: 2, [+s]: s, [""]: 0, [0]: 0, [a]: 1, [true]: 0, [`hello bye`]: 0, [`hello ${a} bye`]: 0} : { [x: string]: string | number; [x: number]: string | number; [""]: number; [0]: number; [`hello bye`]: number; } [s]: 0, +>[s] : number >s : string >0 : 0 [n]: n, +>[n] : number >n : number >n : number [s + s]: 1, +>[s + s] : number >s + s : string >s : string >s : string >1 : 1 [s + n]: 2, +>[s + n] : number >s + n : string >s : string >n : number >2 : 2 [+s]: s, +>[+s] : string >+s : number >s : string >s : string [""]: 0, +>[""] : number >"" : "" >0 : 0 [0]: 0, +>[0] : number >0 : 0 >0 : 0 [a]: 1, +>[a] : number >a : any >1 : 1 [true]: 0, +>[true] : number >true : any >true : true >0 : 0 [`hello bye`]: 0, +>[`hello bye`] : number >`hello bye` : "hello bye" >0 : 0 [`hello ${a} bye`]: 0 +>[`hello ${a} bye`] : number >`hello ${a} bye` : string >a : any >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames50_ES5.symbols b/tests/baselines/reference/computedPropertyNames50_ES5.symbols index 17e3ea92390..71996786af5 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames50_ES5.symbols @@ -13,13 +13,19 @@ var x = { } }, get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames50_ES5.ts, 6, 6)) + throw 10; }, set [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames50_ES5.ts, 9, 6)) + // just throw throw 10; }, get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames50_ES5.ts, 13, 6)) + return 10; }, get foo() { diff --git a/tests/baselines/reference/computedPropertyNames50_ES5.types b/tests/baselines/reference/computedPropertyNames50_ES5.types index dbe6eeba54b..389bb3b36f6 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES5.types +++ b/tests/baselines/reference/computedPropertyNames50_ES5.types @@ -20,6 +20,7 @@ var x = { } }, get [1 + 1]() { +>[1 + 1] : void >1 + 1 : number >1 : 1 >1 : 1 @@ -29,6 +30,7 @@ var x = { }, set [1 + 1]() { +>[1 + 1] : any >1 + 1 : number >1 : 1 >1 : 1 @@ -39,6 +41,7 @@ var x = { }, get [1 + 1]() { +>[1 + 1] : number >1 + 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames50_ES6.symbols b/tests/baselines/reference/computedPropertyNames50_ES6.symbols index 182362b84b0..d47f6ee9f58 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames50_ES6.symbols @@ -13,13 +13,19 @@ var x = { } }, get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames50_ES6.ts, 6, 6)) + throw 10; }, set [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames50_ES6.ts, 9, 6)) + // just throw throw 10; }, get [1 + 1]() { +>[1 + 1] : Symbol([1 + 1], Decl(computedPropertyNames50_ES6.ts, 13, 6)) + return 10; }, get foo() { diff --git a/tests/baselines/reference/computedPropertyNames50_ES6.types b/tests/baselines/reference/computedPropertyNames50_ES6.types index 9c5c369a646..d826503628c 100644 --- a/tests/baselines/reference/computedPropertyNames50_ES6.types +++ b/tests/baselines/reference/computedPropertyNames50_ES6.types @@ -20,6 +20,7 @@ var x = { } }, get [1 + 1]() { +>[1 + 1] : void >1 + 1 : number >1 : 1 >1 : 1 @@ -29,6 +30,7 @@ var x = { }, set [1 + 1]() { +>[1 + 1] : any >1 + 1 : number >1 : 1 >1 : 1 @@ -39,6 +41,7 @@ var x = { }, get [1 + 1]() { +>[1 + 1] : number >1 + 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames51_ES5.symbols b/tests/baselines/reference/computedPropertyNames51_ES5.symbols index 9fb09df62b3..5045a8c1d49 100644 --- a/tests/baselines/reference/computedPropertyNames51_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames51_ES5.symbols @@ -17,9 +17,11 @@ function f() { >v : Symbol(v, Decl(computedPropertyNames51_ES5.ts, 3, 7)) [t]: 0, +>[t] : Symbol([t], Decl(computedPropertyNames51_ES5.ts, 3, 13)) >t : Symbol(t, Decl(computedPropertyNames51_ES5.ts, 1, 7)) [k]: 1 +>[k] : Symbol([k], Decl(computedPropertyNames51_ES5.ts, 4, 15)) >k : Symbol(k, Decl(computedPropertyNames51_ES5.ts, 2, 7)) }; diff --git a/tests/baselines/reference/computedPropertyNames51_ES5.types b/tests/baselines/reference/computedPropertyNames51_ES5.types index f6fc2479561..be764cb9ab4 100644 --- a/tests/baselines/reference/computedPropertyNames51_ES5.types +++ b/tests/baselines/reference/computedPropertyNames51_ES5.types @@ -18,10 +18,12 @@ function f() { >{ [t]: 0, [k]: 1 } : { [x: string]: number; } [t]: 0, +>[t] : number >t : T >0 : 0 [k]: 1 +>[k] : number >k : K >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames51_ES6.symbols b/tests/baselines/reference/computedPropertyNames51_ES6.symbols index efff3605790..92b2c444532 100644 --- a/tests/baselines/reference/computedPropertyNames51_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames51_ES6.symbols @@ -17,9 +17,11 @@ function f() { >v : Symbol(v, Decl(computedPropertyNames51_ES6.ts, 3, 7)) [t]: 0, +>[t] : Symbol([t], Decl(computedPropertyNames51_ES6.ts, 3, 13)) >t : Symbol(t, Decl(computedPropertyNames51_ES6.ts, 1, 7)) [k]: 1 +>[k] : Symbol([k], Decl(computedPropertyNames51_ES6.ts, 4, 15)) >k : Symbol(k, Decl(computedPropertyNames51_ES6.ts, 2, 7)) }; diff --git a/tests/baselines/reference/computedPropertyNames51_ES6.types b/tests/baselines/reference/computedPropertyNames51_ES6.types index 5618e2c5dd4..6e510aba627 100644 --- a/tests/baselines/reference/computedPropertyNames51_ES6.types +++ b/tests/baselines/reference/computedPropertyNames51_ES6.types @@ -18,10 +18,12 @@ function f() { >{ [t]: 0, [k]: 1 } : { [x: string]: number; } [t]: 0, +>[t] : number >t : T >0 : 0 [k]: 1 +>[k] : number >k : K >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames5_ES5.symbols b/tests/baselines/reference/computedPropertyNames5_ES5.symbols index 1e87e2d4ab0..cf4abc79222 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames5_ES5.symbols @@ -6,14 +6,23 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames5_ES5.ts, 1, 3)) [b]: 0, +>[b] : Symbol([b], Decl(computedPropertyNames5_ES5.ts, 1, 9)) >b : Symbol(b, Decl(computedPropertyNames5_ES5.ts, 0, 3)) [true]: 1, +>[true] : Symbol([true], Decl(computedPropertyNames5_ES5.ts, 2, 11)) + [[]]: 0, +>[[]] : Symbol([[]], Decl(computedPropertyNames5_ES5.ts, 3, 14)) + [{}]: 0, +>[{}] : Symbol([{}], Decl(computedPropertyNames5_ES5.ts, 4, 12)) + [undefined]: undefined, +>[undefined] : Symbol([undefined], Decl(computedPropertyNames5_ES5.ts, 5, 12)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) [null]: null +>[null] : Symbol([null], Decl(computedPropertyNames5_ES5.ts, 6, 27)) } diff --git a/tests/baselines/reference/computedPropertyNames5_ES5.types b/tests/baselines/reference/computedPropertyNames5_ES5.types index 943df914166..b185ee47f4d 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES5.types +++ b/tests/baselines/reference/computedPropertyNames5_ES5.types @@ -7,26 +7,32 @@ var v = { >{ [b]: 0, [true]: 1, [[]]: 0, [{}]: 0, [undefined]: undefined, [null]: null} : { [x: string]: number; [x: number]: null; [true]: number; } [b]: 0, +>[b] : number >b : boolean >0 : 0 [true]: 1, +>[true] : number >true : true >1 : 1 [[]]: 0, +>[[]] : number >[] : undefined[] >0 : 0 [{}]: 0, +>[{}] : number >{} : {} >0 : 0 [undefined]: undefined, +>[undefined] : undefined >undefined : undefined >undefined : undefined [null]: null +>[null] : null >null : null >null : null } diff --git a/tests/baselines/reference/computedPropertyNames5_ES6.symbols b/tests/baselines/reference/computedPropertyNames5_ES6.symbols index cdd773e999e..13f5ad8b1c6 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames5_ES6.symbols @@ -6,14 +6,23 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames5_ES6.ts, 1, 3)) [b]: 0, +>[b] : Symbol([b], Decl(computedPropertyNames5_ES6.ts, 1, 9)) >b : Symbol(b, Decl(computedPropertyNames5_ES6.ts, 0, 3)) [true]: 1, +>[true] : Symbol([true], Decl(computedPropertyNames5_ES6.ts, 2, 11)) + [[]]: 0, +>[[]] : Symbol([[]], Decl(computedPropertyNames5_ES6.ts, 3, 14)) + [{}]: 0, +>[{}] : Symbol([{}], Decl(computedPropertyNames5_ES6.ts, 4, 12)) + [undefined]: undefined, +>[undefined] : Symbol([undefined], Decl(computedPropertyNames5_ES6.ts, 5, 12)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) [null]: null +>[null] : Symbol([null], Decl(computedPropertyNames5_ES6.ts, 6, 27)) } diff --git a/tests/baselines/reference/computedPropertyNames5_ES6.types b/tests/baselines/reference/computedPropertyNames5_ES6.types index 18b522b4f6e..62c798a8b08 100644 --- a/tests/baselines/reference/computedPropertyNames5_ES6.types +++ b/tests/baselines/reference/computedPropertyNames5_ES6.types @@ -7,26 +7,32 @@ var v = { >{ [b]: 0, [true]: 1, [[]]: 0, [{}]: 0, [undefined]: undefined, [null]: null} : { [x: string]: number; [x: number]: null; [true]: number; } [b]: 0, +>[b] : number >b : boolean >0 : 0 [true]: 1, +>[true] : number >true : true >1 : 1 [[]]: 0, +>[[]] : number >[] : undefined[] >0 : 0 [{}]: 0, +>[{}] : number >{} : {} >0 : 0 [undefined]: undefined, +>[undefined] : undefined >undefined : undefined >undefined : undefined [null]: null +>[null] : null >null : null >null : null } diff --git a/tests/baselines/reference/computedPropertyNames6_ES5.symbols b/tests/baselines/reference/computedPropertyNames6_ES5.symbols index 1700aede558..ba6419869af 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames6_ES5.symbols @@ -12,11 +12,14 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames6_ES5.ts, 3, 3)) [p1]: 0, +>[p1] : Symbol([p1], Decl(computedPropertyNames6_ES5.ts, 3, 9)) >p1 : Symbol(p1, Decl(computedPropertyNames6_ES5.ts, 0, 3)) [p2]: 1, +>[p2] : Symbol([p2], Decl(computedPropertyNames6_ES5.ts, 4, 12)) >p2 : Symbol(p2, Decl(computedPropertyNames6_ES5.ts, 1, 3)) [p3]: 2 +>[p3] : Symbol([p3], Decl(computedPropertyNames6_ES5.ts, 5, 12)) >p3 : Symbol(p3, Decl(computedPropertyNames6_ES5.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames6_ES5.types b/tests/baselines/reference/computedPropertyNames6_ES5.types index 8cc0cb272e9..c80455f7344 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES5.types +++ b/tests/baselines/reference/computedPropertyNames6_ES5.types @@ -13,14 +13,17 @@ var v = { >{ [p1]: 0, [p2]: 1, [p3]: 2} : { [x: string]: number; } [p1]: 0, +>[p1] : number >p1 : string | number >0 : 0 [p2]: 1, +>[p2] : number >p2 : number | number[] >1 : 1 [p3]: 2 +>[p3] : number >p3 : string | boolean >2 : 2 } diff --git a/tests/baselines/reference/computedPropertyNames6_ES6.symbols b/tests/baselines/reference/computedPropertyNames6_ES6.symbols index 67938a81f09..81e909ab491 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames6_ES6.symbols @@ -12,11 +12,14 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames6_ES6.ts, 3, 3)) [p1]: 0, +>[p1] : Symbol([p1], Decl(computedPropertyNames6_ES6.ts, 3, 9)) >p1 : Symbol(p1, Decl(computedPropertyNames6_ES6.ts, 0, 3)) [p2]: 1, +>[p2] : Symbol([p2], Decl(computedPropertyNames6_ES6.ts, 4, 12)) >p2 : Symbol(p2, Decl(computedPropertyNames6_ES6.ts, 1, 3)) [p3]: 2 +>[p3] : Symbol([p3], Decl(computedPropertyNames6_ES6.ts, 5, 12)) >p3 : Symbol(p3, Decl(computedPropertyNames6_ES6.ts, 2, 3)) } diff --git a/tests/baselines/reference/computedPropertyNames6_ES6.types b/tests/baselines/reference/computedPropertyNames6_ES6.types index 11b973e7887..38a4a6c49f3 100644 --- a/tests/baselines/reference/computedPropertyNames6_ES6.types +++ b/tests/baselines/reference/computedPropertyNames6_ES6.types @@ -13,14 +13,17 @@ var v = { >{ [p1]: 0, [p2]: 1, [p3]: 2} : { [x: string]: number; } [p1]: 0, +>[p1] : number >p1 : string | number >0 : 0 [p2]: 1, +>[p2] : number >p2 : number | number[] >1 : 1 [p3]: 2 +>[p3] : number >p3 : string | boolean >2 : 2 } diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.symbols b/tests/baselines/reference/computedPropertyNames7_ES5.symbols index 7f5e7c0fd46..cae4b8dc622 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames7_ES5.symbols @@ -9,6 +9,7 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames7_ES5.ts, 3, 3)) [E.member]: 0 +>[E.member] : Symbol([E.member], Decl(computedPropertyNames7_ES5.ts, 3, 9)) >E.member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) >E : Symbol(E, Decl(computedPropertyNames7_ES5.ts, 0, 0)) >member : Symbol(E.member, Decl(computedPropertyNames7_ES5.ts, 0, 8)) diff --git a/tests/baselines/reference/computedPropertyNames7_ES5.types b/tests/baselines/reference/computedPropertyNames7_ES5.types index 01c0117bd02..55f6448127b 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES5.types +++ b/tests/baselines/reference/computedPropertyNames7_ES5.types @@ -10,6 +10,7 @@ var v = { >{ [E.member]: 0} : { [E.member]: number; } [E.member]: 0 +>[E.member] : number >E.member : E >E : typeof E >member : E diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.symbols b/tests/baselines/reference/computedPropertyNames7_ES6.symbols index b008d47a843..1bc17354120 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames7_ES6.symbols @@ -9,6 +9,7 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames7_ES6.ts, 3, 3)) [E.member]: 0 +>[E.member] : Symbol([E.member], Decl(computedPropertyNames7_ES6.ts, 3, 9)) >E.member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) >E : Symbol(E, Decl(computedPropertyNames7_ES6.ts, 0, 0)) >member : Symbol(E.member, Decl(computedPropertyNames7_ES6.ts, 0, 8)) diff --git a/tests/baselines/reference/computedPropertyNames7_ES6.types b/tests/baselines/reference/computedPropertyNames7_ES6.types index 80433c94ab3..0ae55d7c1bb 100644 --- a/tests/baselines/reference/computedPropertyNames7_ES6.types +++ b/tests/baselines/reference/computedPropertyNames7_ES6.types @@ -10,6 +10,7 @@ var v = { >{ [E.member]: 0} : { [E.member]: number; } [E.member]: 0 +>[E.member] : number >E.member : E >E : typeof E >member : E diff --git a/tests/baselines/reference/computedPropertyNames8_ES5.symbols b/tests/baselines/reference/computedPropertyNames8_ES5.symbols index 1361e516c5b..a08fd072010 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames8_ES5.symbols @@ -16,9 +16,11 @@ function f() { >v : Symbol(v, Decl(computedPropertyNames8_ES5.ts, 3, 7)) [t]: 0, +>[t] : Symbol([t], Decl(computedPropertyNames8_ES5.ts, 3, 13)) >t : Symbol(t, Decl(computedPropertyNames8_ES5.ts, 1, 7)) [u]: 1 +>[u] : Symbol([u], Decl(computedPropertyNames8_ES5.ts, 4, 15)) >u : Symbol(u, Decl(computedPropertyNames8_ES5.ts, 2, 7)) }; diff --git a/tests/baselines/reference/computedPropertyNames8_ES5.types b/tests/baselines/reference/computedPropertyNames8_ES5.types index adf2c747792..c6ed3b403d7 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES5.types +++ b/tests/baselines/reference/computedPropertyNames8_ES5.types @@ -17,10 +17,12 @@ function f() { >{ [t]: 0, [u]: 1 } : { [x: string]: number; } [t]: 0, +>[t] : number >t : T >0 : 0 [u]: 1 +>[u] : number >u : U >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames8_ES6.symbols b/tests/baselines/reference/computedPropertyNames8_ES6.symbols index 4b39a0d7589..3f054a7372e 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames8_ES6.symbols @@ -16,9 +16,11 @@ function f() { >v : Symbol(v, Decl(computedPropertyNames8_ES6.ts, 3, 7)) [t]: 0, +>[t] : Symbol([t], Decl(computedPropertyNames8_ES6.ts, 3, 13)) >t : Symbol(t, Decl(computedPropertyNames8_ES6.ts, 1, 7)) [u]: 1 +>[u] : Symbol([u], Decl(computedPropertyNames8_ES6.ts, 4, 15)) >u : Symbol(u, Decl(computedPropertyNames8_ES6.ts, 2, 7)) }; diff --git a/tests/baselines/reference/computedPropertyNames8_ES6.types b/tests/baselines/reference/computedPropertyNames8_ES6.types index 171b01fc10c..72b8ad2ee2d 100644 --- a/tests/baselines/reference/computedPropertyNames8_ES6.types +++ b/tests/baselines/reference/computedPropertyNames8_ES6.types @@ -17,10 +17,12 @@ function f() { >{ [t]: 0, [u]: 1 } : { [x: string]: number; } [t]: 0, +>[t] : number >t : T >0 : 0 [u]: 1 +>[u] : number >u : U >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNames9_ES5.symbols b/tests/baselines/reference/computedPropertyNames9_ES5.symbols index d3b92170307..bd9a3adcd47 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNames9_ES5.symbols @@ -22,11 +22,14 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames9_ES5.ts, 5, 3)) [f("")]: 0, +>[f("")] : Symbol([f("")], Decl(computedPropertyNames9_ES5.ts, 5, 9)) >f : Symbol(f, Decl(computedPropertyNames9_ES5.ts, 0, 0), Decl(computedPropertyNames9_ES5.ts, 0, 30), Decl(computedPropertyNames9_ES5.ts, 1, 30), Decl(computedPropertyNames9_ES5.ts, 2, 23)) [f(0)]: 0, +>[f(0)] : Symbol([f(0)], Decl(computedPropertyNames9_ES5.ts, 6, 15)) >f : Symbol(f, Decl(computedPropertyNames9_ES5.ts, 0, 0), Decl(computedPropertyNames9_ES5.ts, 0, 30), Decl(computedPropertyNames9_ES5.ts, 1, 30), Decl(computedPropertyNames9_ES5.ts, 2, 23)) [f(true)]: 0 +>[f(true)] : Symbol([f(true)], Decl(computedPropertyNames9_ES5.ts, 7, 14)) >f : Symbol(f, Decl(computedPropertyNames9_ES5.ts, 0, 0), Decl(computedPropertyNames9_ES5.ts, 0, 30), Decl(computedPropertyNames9_ES5.ts, 1, 30), Decl(computedPropertyNames9_ES5.ts, 2, 23)) } diff --git a/tests/baselines/reference/computedPropertyNames9_ES5.types b/tests/baselines/reference/computedPropertyNames9_ES5.types index 114aa4ef812..dd37aca47b9 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES5.types +++ b/tests/baselines/reference/computedPropertyNames9_ES5.types @@ -23,18 +23,21 @@ var v = { >{ [f("")]: 0, [f(0)]: 0, [f(true)]: 0} : { [x: string]: number; [x: number]: number; [f(true)]: number; } [f("")]: 0, +>[f("")] : number >f("") : string >f : { (s: string): string; (n: number): number; (x: T): T; } >"" : "" >0 : 0 [f(0)]: 0, +>[f(0)] : number >f(0) : number >f : { (s: string): string; (n: number): number; (x: T): T; } >0 : 0 >0 : 0 [f(true)]: 0 +>[f(true)] : number >f(true) : true >f : { (s: string): string; (n: number): number; (x: T): T; } >true : true diff --git a/tests/baselines/reference/computedPropertyNames9_ES6.symbols b/tests/baselines/reference/computedPropertyNames9_ES6.symbols index 9b489eab80c..66412b50a6d 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames9_ES6.symbols @@ -22,11 +22,14 @@ var v = { >v : Symbol(v, Decl(computedPropertyNames9_ES6.ts, 5, 3)) [f("")]: 0, +>[f("")] : Symbol([f("")], Decl(computedPropertyNames9_ES6.ts, 5, 9)) >f : Symbol(f, Decl(computedPropertyNames9_ES6.ts, 0, 0), Decl(computedPropertyNames9_ES6.ts, 0, 30), Decl(computedPropertyNames9_ES6.ts, 1, 30), Decl(computedPropertyNames9_ES6.ts, 2, 23)) [f(0)]: 0, +>[f(0)] : Symbol([f(0)], Decl(computedPropertyNames9_ES6.ts, 6, 15)) >f : Symbol(f, Decl(computedPropertyNames9_ES6.ts, 0, 0), Decl(computedPropertyNames9_ES6.ts, 0, 30), Decl(computedPropertyNames9_ES6.ts, 1, 30), Decl(computedPropertyNames9_ES6.ts, 2, 23)) [f(true)]: 0 +>[f(true)] : Symbol([f(true)], Decl(computedPropertyNames9_ES6.ts, 7, 14)) >f : Symbol(f, Decl(computedPropertyNames9_ES6.ts, 0, 0), Decl(computedPropertyNames9_ES6.ts, 0, 30), Decl(computedPropertyNames9_ES6.ts, 1, 30), Decl(computedPropertyNames9_ES6.ts, 2, 23)) } diff --git a/tests/baselines/reference/computedPropertyNames9_ES6.types b/tests/baselines/reference/computedPropertyNames9_ES6.types index d37505d8630..02bd0eabb9a 100644 --- a/tests/baselines/reference/computedPropertyNames9_ES6.types +++ b/tests/baselines/reference/computedPropertyNames9_ES6.types @@ -23,18 +23,21 @@ var v = { >{ [f("")]: 0, [f(0)]: 0, [f(true)]: 0} : { [x: string]: number; [x: number]: number; [f(true)]: number; } [f("")]: 0, +>[f("")] : number >f("") : string >f : { (s: string): string; (n: number): number; (x: T): T; } >"" : "" >0 : 0 [f(0)]: 0, +>[f(0)] : number >f(0) : number >f : { (s: string): string; (n: number): number; (x: T): T; } >0 : 0 >0 : 0 [f(true)]: 0 +>[f(true)] : number >f(true) : true >f : { (s: string): string; (n: number): number; (x: T): T; } >true : true diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.symbols index 58f86fa7417..8e2805e321e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.symbols @@ -11,5 +11,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType10_ES5.ts, 0, 0)) [+"foo"]: "", +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType10_ES5.ts, 4, 12)) + [+"bar"]: 0 +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType10_ES5.ts, 5, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types index 15e596084a9..4026a385f5f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types @@ -12,11 +12,13 @@ var o: I = { >{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", +>[+"foo"] : string >+"foo" : number >"foo" : "foo" >"" : "" [+"bar"]: 0 +>[+"bar"] : number >+"bar" : number >"bar" : "bar" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.symbols index b5d9fe7779a..3a829e656f8 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.symbols @@ -11,5 +11,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType10_ES6.ts, 0, 0)) [+"foo"]: "", +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType10_ES6.ts, 4, 12)) + [+"bar"]: 0 +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType10_ES6.ts, 5, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types index 251f5da73c1..2bdbb24d239 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types @@ -12,11 +12,13 @@ var o: I = { >{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", +>[+"foo"] : string >+"foo" : number >"foo" : "foo" >"" : "" [+"bar"]: 0 +>[+"bar"] : number >+"bar" : number >"bar" : "bar" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols index 3fd0843a727..fb6ff275edf 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.symbols @@ -16,12 +16,14 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES5.ts, 0, 0)) ["" + 0](y) { return y.length; }, +>["" + 0] : Symbol(["" + 0], Decl(computedPropertyNamesContextualType1_ES5.ts, 5, 12)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 6, 13)) >y.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 6, 13)) >length : Symbol(String.length, Decl(lib.d.ts, --, --)) ["" + 1]: y => y.length +>["" + 1] : Symbol(["" + 1], Decl(computedPropertyNamesContextualType1_ES5.ts, 6, 37)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 7, 13)) >y.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES5.ts, 7, 13)) diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types index 05ae43cf69b..90e400d0e24 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES5.types @@ -17,6 +17,7 @@ var o: I = { >{ ["" + 0](y) { return y.length; }, ["" + 1]: y => y.length} : { [x: string]: (y: string) => number; } ["" + 0](y) { return y.length; }, +>["" + 0] : (y: string) => number >"" + 0 : string >"" : "" >0 : 0 @@ -26,6 +27,7 @@ var o: I = { >length : number ["" + 1]: y => y.length +>["" + 1] : (y: string) => number >"" + 1 : string >"" : "" >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols index ef5d519c3a0..cf686d0af7f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols @@ -16,12 +16,14 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType1_ES6.ts, 0, 0)) ["" + 0](y) { return y.length; }, +>["" + 0] : Symbol(["" + 0], Decl(computedPropertyNamesContextualType1_ES6.ts, 5, 12)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) >y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) >length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ["" + 1]: y => y.length +>["" + 1] : Symbol(["" + 1], Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 37)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) >y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types index 9caae76eeda..d5273bc74ff 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.types @@ -17,6 +17,7 @@ var o: I = { >{ ["" + 0](y) { return y.length; }, ["" + 1]: y => y.length} : { [x: string]: (y: string) => number; } ["" + 0](y) { return y.length; }, +>["" + 0] : (y: string) => number >"" + 0 : string >"" : "" >0 : 0 @@ -26,6 +27,7 @@ var o: I = { >length : number ["" + 1]: y => y.length +>["" + 1] : (y: string) => number >"" + 1 : string >"" : "" >1 : 1 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols index 20b344adfd6..6d6e5369914 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.symbols @@ -16,12 +16,14 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES5.ts, 0, 0)) [+"foo"](y) { return y.length; }, +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType2_ES5.ts, 5, 12)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13)) >y.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 13)) >length : Symbol(String.length, Decl(lib.d.ts, --, --)) [+"bar"]: y => y.length +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType2_ES5.ts, 6, 37)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13)) >y.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES5.ts, 7, 13)) diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types index a9ca7b5ac6c..e7de1a46fab 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES5.types @@ -17,6 +17,7 @@ var o: I = { >{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: number]: (y: string) => number; } [+"foo"](y) { return y.length; }, +>[+"foo"] : (y: string) => number >+"foo" : number >"foo" : "foo" >y : string @@ -25,6 +26,7 @@ var o: I = { >length : number [+"bar"]: y => y.length +>[+"bar"] : (y: string) => number >+"bar" : number >"bar" : "bar" >y => y.length : (y: string) => number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols index d8cab4c4a52..e44b2ae861e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols @@ -16,12 +16,14 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType2_ES6.ts, 0, 0)) [+"foo"](y) { return y.length; }, +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType2_ES6.ts, 5, 12)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) >y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) >length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) [+"bar"]: y => y.length +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 37)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) >y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types index 990b22b178f..0355dca70be 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.types @@ -17,6 +17,7 @@ var o: I = { >{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: number]: (y: string) => number; } [+"foo"](y) { return y.length; }, +>[+"foo"] : (y: string) => number >+"foo" : number >"foo" : "foo" >y : string @@ -25,6 +26,7 @@ var o: I = { >length : number [+"bar"]: y => y.length +>[+"bar"] : (y: string) => number >+"bar" : number >"bar" : "bar" >y => y.length : (y: string) => number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols index acc3b848ce4..7995c898456 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.symbols @@ -12,12 +12,14 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES5.ts, 0, 0)) [+"foo"](y) { return y.length; }, +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType3_ES5.ts, 4, 12)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 5, 13)) >y.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 5, 13)) >length : Symbol(String.length, Decl(lib.d.ts, --, --)) [+"bar"]: y => y.length +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType3_ES5.ts, 5, 37)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 6, 13)) >y.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES5.ts, 6, 13)) diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types index 58c6c3c58f2..c0b13f8b0d9 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES5.types @@ -13,6 +13,7 @@ var o: I = { >{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: number]: (y: string) => number; } [+"foo"](y) { return y.length; }, +>[+"foo"] : (y: string) => number >+"foo" : number >"foo" : "foo" >y : string @@ -21,6 +22,7 @@ var o: I = { >length : number [+"bar"]: y => y.length +>[+"bar"] : (y: string) => number >+"bar" : number >"bar" : "bar" >y => y.length : (y: string) => number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols index deea9bff3df..df0cd09b05d 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols @@ -12,12 +12,14 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType3_ES6.ts, 0, 0)) [+"foo"](y) { return y.length; }, +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType3_ES6.ts, 4, 12)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) >y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) >length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) [+"bar"]: y => y.length +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 37)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) >y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types index 89f62c9a02d..f4e90d8780a 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.types @@ -13,6 +13,7 @@ var o: I = { >{ [+"foo"](y) { return y.length; }, [+"bar"]: y => y.length} : { [x: number]: (y: string) => number; } [+"foo"](y) { return y.length; }, +>[+"foo"] : (y: string) => number >+"foo" : number >"foo" : "foo" >y : string @@ -21,6 +22,7 @@ var o: I = { >length : number [+"bar"]: y => y.length +>[+"bar"] : (y: string) => number >+"bar" : number >"bar" : "bar" >y => y.length : (y: string) => number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols index f6f19f3fd61..e08fde550c3 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES5.ts, 0, 0)) [""+"foo"]: "", +>[""+"foo"] : Symbol([""+"foo"], Decl(computedPropertyNamesContextualType4_ES5.ts, 5, 12)) + [""+"bar"]: 0 +>[""+"bar"] : Symbol([""+"bar"], Decl(computedPropertyNamesContextualType4_ES5.ts, 6, 19)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types index 1fe66e50ce5..de35da01dab 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES5.types @@ -15,12 +15,14 @@ var o: I = { >{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: string | number; } [""+"foo"]: "", +>[""+"foo"] : string >""+"foo" : string >"" : "" >"foo" : "foo" >"" : "" [""+"bar"]: 0 +>[""+"bar"] : number >""+"bar" : string >"" : "" >"bar" : "bar" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols index 184a561425c..b15401d1e27 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType4_ES6.ts, 0, 0)) [""+"foo"]: "", +>[""+"foo"] : Symbol([""+"foo"], Decl(computedPropertyNamesContextualType4_ES6.ts, 5, 12)) + [""+"bar"]: 0 +>[""+"bar"] : Symbol([""+"bar"], Decl(computedPropertyNamesContextualType4_ES6.ts, 6, 19)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types index 0a74effe990..f31c86f3dbd 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType4_ES6.types @@ -15,12 +15,14 @@ var o: I = { >{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: string | number; } [""+"foo"]: "", +>[""+"foo"] : string >""+"foo" : string >"" : "" >"foo" : "foo" >"" : "" [""+"bar"]: 0 +>[""+"bar"] : number >""+"bar" : string >"" : "" >"bar" : "bar" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols index e93cf3f94a1..ec5a0e2709a 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES5.ts, 0, 0)) [+"foo"]: "", +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType5_ES5.ts, 5, 12)) + [+"bar"]: 0 +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType5_ES5.ts, 6, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types index 5721a1fcc86..2406e2b0b48 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES5.types @@ -15,11 +15,13 @@ var o: I = { >{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", +>[+"foo"] : string >+"foo" : number >"foo" : "foo" >"" : "" [+"bar"]: 0 +>[+"bar"] : number >+"bar" : number >"bar" : "bar" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols index 46212968874..2a5d0211497 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType5_ES6.ts, 0, 0)) [+"foo"]: "", +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType5_ES6.ts, 5, 12)) + [+"bar"]: 0 +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType5_ES6.ts, 6, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types index a63da9b633d..0583e81a2a1 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType5_ES6.types @@ -15,11 +15,13 @@ var o: I = { >{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", +>[+"foo"] : string >+"foo" : number >"foo" : "foo" >"" : "" [+"bar"]: 0 +>[+"bar"] : number >+"bar" : number >"bar" : "bar" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols index 23179820592..6924e5c833f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.symbols @@ -26,6 +26,12 @@ foo({ >0 : Symbol(0, Decl(computedPropertyNamesContextualType6_ES5.ts, 7, 10)) ["hi" + "bye"]: true, +>["hi" + "bye"] : Symbol(["hi" + "bye"], Decl(computedPropertyNamesContextualType6_ES5.ts, 8, 17)) + [0 + 1]: 0, +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNamesContextualType6_ES5.ts, 9, 25)) + [+"hi"]: [0] +>[+"hi"] : Symbol([+"hi"], Decl(computedPropertyNamesContextualType6_ES5.ts, 10, 15)) + }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index 5c46bee4ccf..9a3fec1e4b9 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -30,18 +30,21 @@ foo({ >() => { } : () => void ["hi" + "bye"]: true, +>["hi" + "bye"] : true >"hi" + "bye" : string >"hi" : "hi" >"bye" : "bye" >true : true [0 + 1]: 0, +>[0 + 1] : number >0 + 1 : number >0 : 0 >1 : 1 >0 : 0 [+"hi"]: [0] +>[+"hi"] : number[] >+"hi" : number >"hi" : "hi" >[0] : number[] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols index d441c593fb3..678c4c16f48 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.symbols @@ -26,6 +26,12 @@ foo({ >0 : Symbol(0, Decl(computedPropertyNamesContextualType6_ES6.ts, 7, 10)) ["hi" + "bye"]: true, +>["hi" + "bye"] : Symbol(["hi" + "bye"], Decl(computedPropertyNamesContextualType6_ES6.ts, 8, 17)) + [0 + 1]: 0, +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNamesContextualType6_ES6.ts, 9, 25)) + [+"hi"]: [0] +>[+"hi"] : Symbol([+"hi"], Decl(computedPropertyNamesContextualType6_ES6.ts, 10, 15)) + }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index f0e56a954cb..4e6aaa0976b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -30,18 +30,21 @@ foo({ >() => { } : () => void ["hi" + "bye"]: true, +>["hi" + "bye"] : true >"hi" + "bye" : string >"hi" : "hi" >"bye" : "bye" >true : true [0 + 1]: 0, +>[0 + 1] : number >0 + 1 : number >0 : 0 >1 : 1 >0 : 0 [+"hi"]: [0] +>[+"hi"] : number[] >+"hi" : number >"hi" : "hi" >[0] : number[] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols index 77e87a5bf48..6431bd690d4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.symbols @@ -39,8 +39,14 @@ foo({ >0 : Symbol(0, Decl(computedPropertyNamesContextualType7_ES5.ts, 10, 5)) ["hi" + "bye"]: true, +>["hi" + "bye"] : Symbol(["hi" + "bye"], Decl(computedPropertyNamesContextualType7_ES5.ts, 11, 17)) + [0 + 1]: 0, +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNamesContextualType7_ES5.ts, 12, 25)) + [+"hi"]: [0] +>[+"hi"] : Symbol([+"hi"], Decl(computedPropertyNamesContextualType7_ES5.ts, 13, 15)) + }); g({ p: "" }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types index e838c06bfa1..f65785c4833 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types @@ -42,18 +42,21 @@ foo({ >() => { } : () => void ["hi" + "bye"]: true, +>["hi" + "bye"] : boolean >"hi" + "bye" : string >"hi" : "hi" >"bye" : "bye" >true : true [0 + 1]: 0, +>[0 + 1] : number >0 + 1 : number >0 : 0 >1 : 1 >0 : 0 [+"hi"]: [0] +>[+"hi"] : number[] >+"hi" : number >"hi" : "hi" >[0] : number[] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols index 5f798731dba..df7375c80b7 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.symbols @@ -39,8 +39,14 @@ foo({ >0 : Symbol(0, Decl(computedPropertyNamesContextualType7_ES6.ts, 10, 5)) ["hi" + "bye"]: true, +>["hi" + "bye"] : Symbol(["hi" + "bye"], Decl(computedPropertyNamesContextualType7_ES6.ts, 11, 17)) + [0 + 1]: 0, +>[0 + 1] : Symbol([0 + 1], Decl(computedPropertyNamesContextualType7_ES6.ts, 12, 25)) + [+"hi"]: [0] +>[+"hi"] : Symbol([+"hi"], Decl(computedPropertyNamesContextualType7_ES6.ts, 13, 15)) + }); g({ p: "" }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types index ace52b05bcb..7a0fe990c0f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types @@ -42,18 +42,21 @@ foo({ >() => { } : () => void ["hi" + "bye"]: true, +>["hi" + "bye"] : boolean >"hi" + "bye" : string >"hi" : "hi" >"bye" : "bye" >true : true [0 + 1]: 0, +>[0 + 1] : number >0 + 1 : number >0 : 0 >1 : 1 >0 : 0 [+"hi"]: [0] +>[+"hi"] : number[] >+"hi" : number >"hi" : "hi" >[0] : number[] diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.symbols index 785ae0eb65c..a74f53f47f5 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType8_ES5.ts, 0, 0)) [""+"foo"]: "", +>[""+"foo"] : Symbol([""+"foo"], Decl(computedPropertyNamesContextualType8_ES5.ts, 5, 12)) + [""+"bar"]: 0 +>[""+"bar"] : Symbol([""+"bar"], Decl(computedPropertyNamesContextualType8_ES5.ts, 6, 19)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types index 5bc49c6e86f..8b04ef6cefc 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types @@ -15,12 +15,14 @@ var o: I = { >{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: string | number; } [""+"foo"]: "", +>[""+"foo"] : string >""+"foo" : string >"" : "" >"foo" : "foo" >"" : "" [""+"bar"]: 0 +>[""+"bar"] : number >""+"bar" : string >"" : "" >"bar" : "bar" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.symbols index a581d89b67d..1ea17d83bc4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType8_ES6.ts, 0, 0)) [""+"foo"]: "", +>[""+"foo"] : Symbol([""+"foo"], Decl(computedPropertyNamesContextualType8_ES6.ts, 5, 12)) + [""+"bar"]: 0 +>[""+"bar"] : Symbol([""+"bar"], Decl(computedPropertyNamesContextualType8_ES6.ts, 6, 19)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types index d8108935ac0..f8299c4effd 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types @@ -15,12 +15,14 @@ var o: I = { >{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: string | number; } [""+"foo"]: "", +>[""+"foo"] : string >""+"foo" : string >"" : "" >"foo" : "foo" >"" : "" [""+"bar"]: 0 +>[""+"bar"] : number >""+"bar" : string >"" : "" >"bar" : "bar" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.symbols b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.symbols index 1183aeb979e..6286068e34b 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType9_ES5.ts, 0, 0)) [+"foo"]: "", +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType9_ES5.ts, 5, 12)) + [+"bar"]: 0 +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType9_ES5.ts, 6, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types index acadffbf766..c758576efee 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types @@ -15,11 +15,13 @@ var o: I = { >{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", +>[+"foo"] : string >+"foo" : number >"foo" : "foo" >"" : "" [+"bar"]: 0 +>[+"bar"] : number >+"bar" : number >"bar" : "bar" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.symbols index 0290dab5933..2291324b012 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.symbols @@ -14,5 +14,8 @@ var o: I = { >I : Symbol(I, Decl(computedPropertyNamesContextualType9_ES6.ts, 0, 0)) [+"foo"]: "", +>[+"foo"] : Symbol([+"foo"], Decl(computedPropertyNamesContextualType9_ES6.ts, 5, 12)) + [+"bar"]: 0 +>[+"bar"] : Symbol([+"bar"], Decl(computedPropertyNamesContextualType9_ES6.ts, 6, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types index eef180fbaea..85008a9304e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types @@ -15,11 +15,13 @@ var o: I = { >{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", +>[+"foo"] : string >+"foo" : number >"foo" : "foo" >"" : "" [+"bar"]: 0 +>[+"bar"] : number >+"bar" : number >"bar" : "bar" >0 : 0 diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols index cd10b9c77a1..c720ee6fe24 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.symbols @@ -3,7 +3,12 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 0, 0)) ["" + ""]() { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 0, 9)) + get ["" + ""]() { return 0; } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 1, 19)) + set ["" + ""](x) { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 2, 33)) >x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit1_ES5.ts, 3, 18)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types index dd12b763441..14a68b77c53 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES5.types @@ -3,17 +3,20 @@ class C { >C : C ["" + ""]() { } +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" get ["" + ""]() { return 0; } +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 set ["" + ""](x) { } +>["" + ""] : any >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols index 96c9026d65b..5e8e5dcd5fe 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.symbols @@ -3,7 +3,12 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 0, 0)) ["" + ""]() { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 0, 9)) + get ["" + ""]() { return 0; } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 1, 19)) + set ["" + ""](x) { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 2, 33)) >x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit1_ES6.ts, 3, 18)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types index 2ee96225fb9..8aea22cb85d 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit1_ES6.types @@ -3,17 +3,20 @@ class C { >C : C ["" + ""]() { } +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" get ["" + ""]() { return 0; } +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 set ["" + ""](x) { } +>["" + ""] : any >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols index 5f1fac066c4..99d10c8a15d 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.symbols @@ -3,7 +3,12 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 0, 0)) static ["" + ""]() { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 0, 9)) + static get ["" + ""]() { return 0; } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 1, 26)) + static set ["" + ""](x) { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 2, 40)) >x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit2_ES5.ts, 3, 25)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types index 30fc69390e5..9ab01fe5f11 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES5.types @@ -3,17 +3,20 @@ class C { >C : C static ["" + ""]() { } +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" static get ["" + ""]() { return 0; } +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 static set ["" + ""](x) { } +>["" + ""] : any >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols index 0797b7e6d7f..2958c810f36 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.symbols @@ -3,7 +3,12 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 0, 0)) static ["" + ""]() { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 0, 9)) + static get ["" + ""]() { return 0; } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 1, 26)) + static set ["" + ""](x) { } +>["" + ""] : Symbol(C["\" + \""], Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 2, 40)) >x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit2_ES6.ts, 3, 25)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types index 181b935790c..5219f4cf983 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit2_ES6.types @@ -3,17 +3,20 @@ class C { >C : C static ["" + ""]() { } +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" static get ["" + ""]() { return 0; } +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 static set ["" + ""](x) { } +>["" + ""] : any >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.symbols index 4d9fcebaf62..61b0b8023e1 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(computedPropertyNamesDeclarationEmit3_ES5.ts, 0, 0)) ["" + ""](): void; +>["" + ""] : Symbol(I["\" + \""], Decl(computedPropertyNamesDeclarationEmit3_ES5.ts, 0, 13)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.types index 7e5df09bd1a..81f40d5eef8 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES5.types @@ -3,6 +3,7 @@ interface I { >I : I ["" + ""](): void; +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.symbols index 8505561aceb..e7987a18fe6 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(computedPropertyNamesDeclarationEmit3_ES6.ts, 0, 0)) ["" + ""](): void; +>["" + ""] : Symbol(I["\" + \""], Decl(computedPropertyNamesDeclarationEmit3_ES6.ts, 0, 13)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.types index e406a0a6122..8683d8762a0 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit3_ES6.types @@ -3,6 +3,7 @@ interface I { >I : I ["" + ""](): void; +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.symbols index 6a0e5048d18..41adfe94289 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.symbols @@ -3,4 +3,5 @@ var v: { >v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit4_ES5.ts, 0, 3)) ["" + ""](): void; +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit4_ES5.ts, 0, 8)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.types index 98e825ad05d..1a3c46494a5 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES5.types @@ -3,6 +3,7 @@ var v: { >v : {} ["" + ""](): void; +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.symbols index 102320df07d..cad8a9ce3df 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.symbols @@ -3,4 +3,5 @@ var v: { >v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit4_ES6.ts, 0, 3)) ["" + ""](): void; +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit4_ES6.ts, 0, 8)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.types index 5c32a2beaa4..7852b5ee090 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit4_ES6.types @@ -3,6 +3,7 @@ var v: { >v : {} ["" + ""](): void; +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols index 8d40d4c86c0..32f18b27380 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.symbols @@ -3,8 +3,15 @@ var v = { >v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 0, 3)) ["" + ""]: 0, +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 0, 9)) + ["" + ""]() { }, +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 1, 17)) + get ["" + ""]() { return 0; }, +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 2, 20)) + set ["" + ""](x) { } +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 3, 34)) >x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit5_ES5.ts, 4, 18)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types index fd5971fc849..7de2d3bc256 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES5.types @@ -4,23 +4,27 @@ var v = { >{ ["" + ""]: 0, ["" + ""]() { }, get ["" + ""]() { return 0; }, set ["" + ""](x) { }} : { [x: string]: any; } ["" + ""]: 0, +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 ["" + ""]() { }, +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" get ["" + ""]() { return 0; }, +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 set ["" + ""](x) { } +>["" + ""] : any >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols index e9a7b4b28ab..8bad9a7623b 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.symbols @@ -3,8 +3,15 @@ var v = { >v : Symbol(v, Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 0, 3)) ["" + ""]: 0, +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 0, 9)) + ["" + ""]() { }, +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 1, 17)) + get ["" + ""]() { return 0; }, +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 2, 20)) + set ["" + ""](x) { } +>["" + ""] : Symbol(["" + ""], Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 3, 34)) >x : Symbol(x, Decl(computedPropertyNamesDeclarationEmit5_ES6.ts, 4, 18)) } diff --git a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types index 886d93e061c..c444e6c00dd 100644 --- a/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesDeclarationEmit5_ES6.types @@ -4,23 +4,27 @@ var v = { >{ ["" + ""]: 0, ["" + ""]() { }, get ["" + ""]() { return 0; }, set ["" + ""](x) { }} : { [x: string]: any; } ["" + ""]: 0, +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 ["" + ""]() { }, +>["" + ""] : () => void >"" + "" : string >"" : "" >"" : "" get ["" + ""]() { return 0; }, +>["" + ""] : number >"" + "" : string >"" : "" >"" : "" >0 : 0 set ["" + ""](x) { } +>["" + ""] : any >"" + "" : string >"" : "" >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.symbols b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.symbols index a62d9b28707..632fe667a03 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.symbols @@ -9,13 +9,16 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesOnOverloads_ES5.ts, 1, 30)) [methodName](v: string); +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNamesOnOverloads_ES5.ts, 2, 9)) >methodName : Symbol(methodName, Decl(computedPropertyNamesOnOverloads_ES5.ts, 0, 3)) >v : Symbol(v, Decl(computedPropertyNamesOnOverloads_ES5.ts, 3, 17)) [methodName](); +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNamesOnOverloads_ES5.ts, 3, 28)) >methodName : Symbol(methodName, Decl(computedPropertyNamesOnOverloads_ES5.ts, 0, 3)) [methodName](v?: string) { } +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNamesOnOverloads_ES5.ts, 4, 19)) >methodName : Symbol(methodName, Decl(computedPropertyNamesOnOverloads_ES5.ts, 0, 3)) >v : Symbol(v, Decl(computedPropertyNamesOnOverloads_ES5.ts, 5, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.types b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.types index f75b3891ad6..83cf11336e6 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES5.types @@ -11,13 +11,16 @@ class C { >C : C [methodName](v: string); +>[methodName] : (v: string) => any >methodName : string >v : string [methodName](); +>[methodName] : () => any >methodName : string [methodName](v?: string) { } +>[methodName] : (v?: string) => void >methodName : string >v : string } diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.symbols b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.symbols index bb92ee668d8..88dba546420 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.symbols @@ -9,13 +9,16 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesOnOverloads_ES6.ts, 1, 30)) [methodName](v: string); +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNamesOnOverloads_ES6.ts, 2, 9)) >methodName : Symbol(methodName, Decl(computedPropertyNamesOnOverloads_ES6.ts, 0, 3)) >v : Symbol(v, Decl(computedPropertyNamesOnOverloads_ES6.ts, 3, 17)) [methodName](); +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNamesOnOverloads_ES6.ts, 3, 28)) >methodName : Symbol(methodName, Decl(computedPropertyNamesOnOverloads_ES6.ts, 0, 3)) [methodName](v?: string) { } +>[methodName] : Symbol(C[methodName], Decl(computedPropertyNamesOnOverloads_ES6.ts, 4, 19)) >methodName : Symbol(methodName, Decl(computedPropertyNamesOnOverloads_ES6.ts, 0, 3)) >v : Symbol(v, Decl(computedPropertyNamesOnOverloads_ES6.ts, 5, 17)) } diff --git a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.types b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.types index f7bb8d41156..4f52e8e9d28 100644 --- a/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesOnOverloads_ES6.types @@ -11,13 +11,16 @@ class C { >C : C [methodName](v: string); +>[methodName] : (v: string) => any >methodName : string >v : string [methodName](); +>[methodName] : () => any >methodName : string [methodName](v?: string) { } +>[methodName] : (v?: string) => void >methodName : string >v : string } diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols index cdb193e3bd3..3fd84a17764 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.symbols @@ -3,11 +3,13 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesSourceMap1_ES5.ts, 0, 0)) ["hello"]() { +>["hello"] : Symbol(C["hello"], Decl(computedPropertyNamesSourceMap1_ES5.ts, 0, 9)) >"hello" : Symbol(C["hello"], Decl(computedPropertyNamesSourceMap1_ES5.ts, 0, 9)) debugger; } get ["goodbye"]() { +>["goodbye"] : Symbol(C["goodbye"], Decl(computedPropertyNamesSourceMap1_ES5.ts, 3, 5)) >"goodbye" : Symbol(C["goodbye"], Decl(computedPropertyNamesSourceMap1_ES5.ts, 3, 5)) return 0; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types index 555782bf6cf..c71e63abb34 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.types @@ -3,11 +3,13 @@ class C { >C : C ["hello"]() { +>["hello"] : () => void >"hello" : "hello" debugger; } get ["goodbye"]() { +>["goodbye"] : number >"goodbye" : "goodbye" return 0; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols index e8ebdab2fd8..20bff71d801 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.symbols @@ -3,11 +3,13 @@ class C { >C : Symbol(C, Decl(computedPropertyNamesSourceMap1_ES6.ts, 0, 0)) ["hello"]() { +>["hello"] : Symbol(C["hello"], Decl(computedPropertyNamesSourceMap1_ES6.ts, 0, 9)) >"hello" : Symbol(C["hello"], Decl(computedPropertyNamesSourceMap1_ES6.ts, 0, 9)) debugger; } get ["goodbye"]() { +>["goodbye"] : Symbol(C["goodbye"], Decl(computedPropertyNamesSourceMap1_ES6.ts, 3, 2)) >"goodbye" : Symbol(C["goodbye"], Decl(computedPropertyNamesSourceMap1_ES6.ts, 3, 2)) return 0; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types index 93ce203c0ef..869299088b8 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.types @@ -3,11 +3,13 @@ class C { >C : C ["hello"]() { +>["hello"] : () => void >"hello" : "hello" debugger; } get ["goodbye"]() { +>["goodbye"] : number >"goodbye" : "goodbye" return 0; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols index e01453c1d12..bbdce25eb11 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.symbols @@ -3,11 +3,13 @@ var v = { >v : Symbol(v, Decl(computedPropertyNamesSourceMap2_ES5.ts, 0, 3)) ["hello"]() { +>["hello"] : Symbol(["hello"], Decl(computedPropertyNamesSourceMap2_ES5.ts, 0, 9)) >"hello" : Symbol(["hello"], Decl(computedPropertyNamesSourceMap2_ES5.ts, 0, 9)) debugger; }, get ["goodbye"]() { +>["goodbye"] : Symbol(["goodbye"], Decl(computedPropertyNamesSourceMap2_ES5.ts, 3, 3)) >"goodbye" : Symbol(["goodbye"], Decl(computedPropertyNamesSourceMap2_ES5.ts, 3, 3)) return 0; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types index bf2352f338d..bc5d038606f 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.types @@ -4,11 +4,13 @@ var v = { >{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { +>["hello"] : () => void >"hello" : "hello" debugger; }, get ["goodbye"]() { +>["goodbye"] : number >"goodbye" : "goodbye" return 0; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols index d4b85e28398..299fe66acb9 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.symbols @@ -3,11 +3,13 @@ var v = { >v : Symbol(v, Decl(computedPropertyNamesSourceMap2_ES6.ts, 0, 3)) ["hello"]() { +>["hello"] : Symbol(["hello"], Decl(computedPropertyNamesSourceMap2_ES6.ts, 0, 9)) >"hello" : Symbol(["hello"], Decl(computedPropertyNamesSourceMap2_ES6.ts, 0, 9)) debugger; }, get ["goodbye"]() { +>["goodbye"] : Symbol(["goodbye"], Decl(computedPropertyNamesSourceMap2_ES6.ts, 3, 3)) >"goodbye" : Symbol(["goodbye"], Decl(computedPropertyNamesSourceMap2_ES6.ts, 3, 3)) return 0; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types index ae4429d0437..dbd9ed0f40d 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.types @@ -4,11 +4,13 @@ var v = { >{ ["hello"]() { debugger; }, get ["goodbye"]() { return 0; }} : { ["hello"](): void; readonly ["goodbye"]: number; } ["hello"]() { +>["hello"] : () => void >"hello" : "hello" debugger; }, get ["goodbye"]() { +>["goodbye"] : number >"goodbye" : "goodbye" return 0; diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols index 70edfd89a97..ee371e0ea48 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.symbols @@ -6,6 +6,7 @@ class C { >staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) get [C.staticProp]() { +>[C.staticProp] : Symbol(C[C.staticProp], Decl(computedPropertyNamesWithStaticProperty.ts, 1, 27)) >C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) >C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) >staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) @@ -13,6 +14,7 @@ class C { return "hello"; } set [C.staticProp](x: string) { +>[C.staticProp] : Symbol(C[C.staticProp], Decl(computedPropertyNamesWithStaticProperty.ts, 4, 5)) >C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) >C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) >staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) @@ -23,6 +25,7 @@ class C { >x : Symbol(x, Decl(computedPropertyNamesWithStaticProperty.ts, 5, 23)) } [C.staticProp]() { } +>[C.staticProp] : Symbol(C[C.staticProp], Decl(computedPropertyNamesWithStaticProperty.ts, 7, 5)) >C.staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) >C : Symbol(C, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 0)) >staticProp : Symbol(C.staticProp, Decl(computedPropertyNamesWithStaticProperty.ts, 0, 9)) diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types index 9a99ae7605b..2db0b3b7399 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.types @@ -7,6 +7,7 @@ class C { >10 : 10 get [C.staticProp]() { +>[C.staticProp] : string >C.staticProp : number >C : typeof C >staticProp : number @@ -15,6 +16,7 @@ class C { >"hello" : "hello" } set [C.staticProp](x: string) { +>[C.staticProp] : string >C.staticProp : number >C : typeof C >staticProp : number @@ -25,6 +27,7 @@ class C { >x : string } [C.staticProp]() { } +>[C.staticProp] : () => void >C.staticProp : number >C : typeof C >staticProp : number diff --git a/tests/baselines/reference/constEnumPropertyAccess1.symbols b/tests/baselines/reference/constEnumPropertyAccess1.symbols index a2b4ed6a9a1..b9fe0fbd9a4 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.symbols +++ b/tests/baselines/reference/constEnumPropertyAccess1.symbols @@ -56,11 +56,13 @@ class C { >C : Symbol(C, Decl(constEnumPropertyAccess1.ts, 19, 15)) [G.A]() { } +>[G.A] : Symbol(C[G.A], Decl(constEnumPropertyAccess1.ts, 21, 9)) >G.A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14)) >G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) >A : Symbol(G.A, Decl(constEnumPropertyAccess1.ts, 4, 14)) get [G.B]() { +>[G.B] : Symbol(C[G.B], Decl(constEnumPropertyAccess1.ts, 22, 15)) >G.B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10)) >G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) >B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10)) @@ -68,6 +70,7 @@ class C { return true; } set [G.B](x: number) { } +>[G.B] : Symbol(C[G.B], Decl(constEnumPropertyAccess1.ts, 25, 5)) >G.B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10)) >G : Symbol(G, Decl(constEnumPropertyAccess1.ts, 0, 0)) >B : Symbol(G.B, Decl(constEnumPropertyAccess1.ts, 5, 10)) diff --git a/tests/baselines/reference/constEnumPropertyAccess1.types b/tests/baselines/reference/constEnumPropertyAccess1.types index 9a210c646c7..991c1cc32bb 100644 --- a/tests/baselines/reference/constEnumPropertyAccess1.types +++ b/tests/baselines/reference/constEnumPropertyAccess1.types @@ -66,11 +66,13 @@ class C { >C : C [G.A]() { } +>[G.A] : () => void >G.A : G >G : typeof G >A : G get [G.B]() { +>[G.B] : boolean >G.B : G >G : typeof G >B : G @@ -79,6 +81,7 @@ class C { >true : true } set [G.B](x: number) { } +>[G.B] : number >G.B : G >G : typeof G >B : G diff --git a/tests/baselines/reference/decoratorOnClassMethod13.symbols b/tests/baselines/reference/decoratorOnClassMethod13.symbols index 5700e6a3bf3..0c8aa1bb2aa 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod13.symbols @@ -15,9 +15,11 @@ class C { @dec ["1"]() { } >dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) +>["1"] : Symbol(C["1"], Decl(decoratorOnClassMethod13.ts, 2, 9)) >"1" : Symbol(C["1"], Decl(decoratorOnClassMethod13.ts, 2, 9)) @dec ["b"]() { } >dec : Symbol(dec, Decl(decoratorOnClassMethod13.ts, 0, 0)) +>["b"] : Symbol(C["b"], Decl(decoratorOnClassMethod13.ts, 3, 20)) >"b" : Symbol(C["b"], Decl(decoratorOnClassMethod13.ts, 3, 20)) } diff --git a/tests/baselines/reference/decoratorOnClassMethod13.types b/tests/baselines/reference/decoratorOnClassMethod13.types index eba738d5ef5..7820fd561d3 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.types +++ b/tests/baselines/reference/decoratorOnClassMethod13.types @@ -15,9 +15,11 @@ class C { @dec ["1"]() { } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>["1"] : () => void >"1" : "1" @dec ["b"]() { } >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>["b"] : () => void >"b" : "b" } diff --git a/tests/baselines/reference/decoratorOnClassMethod4.symbols b/tests/baselines/reference/decoratorOnClassMethod4.symbols index 30d300a937a..f945a3e6972 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod4.symbols @@ -15,5 +15,6 @@ class C { @dec ["method"]() {} >dec : Symbol(dec, Decl(decoratorOnClassMethod4.ts, 0, 0)) +>["method"] : Symbol(C["method"], Decl(decoratorOnClassMethod4.ts, 2, 9)) >"method" : Symbol(C["method"], Decl(decoratorOnClassMethod4.ts, 2, 9)) } diff --git a/tests/baselines/reference/decoratorOnClassMethod4.types b/tests/baselines/reference/decoratorOnClassMethod4.types index 5c47dc8a4ca..f4107ef9923 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.types +++ b/tests/baselines/reference/decoratorOnClassMethod4.types @@ -15,5 +15,6 @@ class C { @dec ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>["method"] : () => void >"method" : "method" } diff --git a/tests/baselines/reference/decoratorOnClassMethod5.symbols b/tests/baselines/reference/decoratorOnClassMethod5.symbols index 004af8b9f8e..0617619f798 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod5.symbols @@ -15,5 +15,6 @@ class C { @dec() ["method"]() {} >dec : Symbol(dec, Decl(decoratorOnClassMethod5.ts, 0, 0)) +>["method"] : Symbol(C["method"], Decl(decoratorOnClassMethod5.ts, 2, 9)) >"method" : Symbol(C["method"], Decl(decoratorOnClassMethod5.ts, 2, 9)) } diff --git a/tests/baselines/reference/decoratorOnClassMethod5.types b/tests/baselines/reference/decoratorOnClassMethod5.types index 749eb6b3b9c..181b30538bc 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.types +++ b/tests/baselines/reference/decoratorOnClassMethod5.types @@ -16,5 +16,6 @@ class C { @dec() ["method"]() {} >dec() : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>["method"] : () => void >"method" : "method" } diff --git a/tests/baselines/reference/decoratorOnClassMethod6.symbols b/tests/baselines/reference/decoratorOnClassMethod6.symbols index bc9046aa666..c5172bd9085 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod6.symbols @@ -15,5 +15,6 @@ class C { @dec ["method"]() {} >dec : Symbol(dec, Decl(decoratorOnClassMethod6.ts, 0, 0)) +>["method"] : Symbol(C["method"], Decl(decoratorOnClassMethod6.ts, 2, 9)) >"method" : Symbol(C["method"], Decl(decoratorOnClassMethod6.ts, 2, 9)) } diff --git a/tests/baselines/reference/decoratorOnClassMethod6.types b/tests/baselines/reference/decoratorOnClassMethod6.types index 9e3eda53cf5..6a004322625 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.types +++ b/tests/baselines/reference/decoratorOnClassMethod6.types @@ -15,5 +15,6 @@ class C { @dec ["method"]() {} >dec : () => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>["method"] : () => void >"method" : "method" } diff --git a/tests/baselines/reference/decoratorOnClassMethod7.symbols b/tests/baselines/reference/decoratorOnClassMethod7.symbols index 90e538ebfc4..bef1eadbe6e 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod7.symbols @@ -15,5 +15,6 @@ class C { @dec public ["method"]() {} >dec : Symbol(dec, Decl(decoratorOnClassMethod7.ts, 0, 0)) +>["method"] : Symbol(C["method"], Decl(decoratorOnClassMethod7.ts, 2, 9)) >"method" : Symbol(C["method"], Decl(decoratorOnClassMethod7.ts, 2, 9)) } diff --git a/tests/baselines/reference/decoratorOnClassMethod7.types b/tests/baselines/reference/decoratorOnClassMethod7.types index c8d21157fe9..e6e3308fd48 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.types +++ b/tests/baselines/reference/decoratorOnClassMethod7.types @@ -15,5 +15,6 @@ class C { @dec public ["method"]() {} >dec : (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor +>["method"] : () => void >"method" : "method" } diff --git a/tests/baselines/reference/decoratorsOnComputedProperties.symbols b/tests/baselines/reference/decoratorsOnComputedProperties.symbols index f55f60b3f4e..65652b4524e 100644 --- a/tests/baselines/reference/decoratorsOnComputedProperties.symbols +++ b/tests/baselines/reference/decoratorsOnComputedProperties.symbols @@ -26,60 +26,74 @@ class A { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(A["property"], Decl(decoratorsOnComputedProperties.ts, 8, 9)) >"property" : Symbol(A["property"], Decl(decoratorsOnComputedProperties.ts, 8, 9)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(A[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 9, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(A["property2"], Decl(decoratorsOnComputedProperties.ts, 10, 33)) >"property2" : Symbol(A["property2"], Decl(decoratorsOnComputedProperties.ts, 10, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(A[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 11, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(A["property3"], Decl(decoratorsOnComputedProperties.ts, 12, 37)) >"property3" : Symbol(A["property3"], Decl(decoratorsOnComputedProperties.ts, 12, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(A[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 13, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(A["property4"], Decl(decoratorsOnComputedProperties.ts, 14, 37)) >"property4" : Symbol(A["property4"], Decl(decoratorsOnComputedProperties.ts, 14, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(A[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 15, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(A[foo()], Decl(decoratorsOnComputedProperties.ts, 16, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(A[foo()], Decl(decoratorsOnComputedProperties.ts, 17, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(A[foo()], Decl(decoratorsOnComputedProperties.ts, 18, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) [fieldNameA]: any; +>[fieldNameA] : Symbol(A[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 19, 27)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(A[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 20, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(A[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 21, 25)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) } @@ -88,60 +102,74 @@ void class B { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(B["property"], Decl(decoratorsOnComputedProperties.ts, 25, 14)) >"property" : Symbol(B["property"], Decl(decoratorsOnComputedProperties.ts, 25, 14)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(B[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 26, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(B["property2"], Decl(decoratorsOnComputedProperties.ts, 27, 33)) >"property2" : Symbol(B["property2"], Decl(decoratorsOnComputedProperties.ts, 27, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(B[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 28, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(B["property3"], Decl(decoratorsOnComputedProperties.ts, 29, 37)) >"property3" : Symbol(B["property3"], Decl(decoratorsOnComputedProperties.ts, 29, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(B[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 30, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(B["property4"], Decl(decoratorsOnComputedProperties.ts, 31, 37)) >"property4" : Symbol(B["property4"], Decl(decoratorsOnComputedProperties.ts, 31, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(B[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 32, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(B[foo()], Decl(decoratorsOnComputedProperties.ts, 33, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(B[foo()], Decl(decoratorsOnComputedProperties.ts, 34, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(B[foo()], Decl(decoratorsOnComputedProperties.ts, 35, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) [fieldNameA]: any; +>[fieldNameA] : Symbol(B[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 36, 27)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(B[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 37, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(B[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 38, 25)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) }; @@ -151,63 +179,78 @@ class C { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(C["property"], Decl(decoratorsOnComputedProperties.ts, 42, 9)) >"property" : Symbol(C["property"], Decl(decoratorsOnComputedProperties.ts, 42, 9)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 43, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(C["property2"], Decl(decoratorsOnComputedProperties.ts, 44, 33)) >"property2" : Symbol(C["property2"], Decl(decoratorsOnComputedProperties.ts, 44, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 45, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(C["property3"], Decl(decoratorsOnComputedProperties.ts, 46, 37)) >"property3" : Symbol(C["property3"], Decl(decoratorsOnComputedProperties.ts, 46, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(C[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 47, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(C["property4"], Decl(decoratorsOnComputedProperties.ts, 48, 37)) >"property4" : Symbol(C["property4"], Decl(decoratorsOnComputedProperties.ts, 48, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(C[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 49, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(C[foo()], Decl(decoratorsOnComputedProperties.ts, 50, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(C[foo()], Decl(decoratorsOnComputedProperties.ts, 51, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(C[foo()], Decl(decoratorsOnComputedProperties.ts, 52, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) [fieldNameA]: any; +>[fieldNameA] : Symbol(C[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 53, 27)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(C[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 54, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(C[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 55, 25)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) ["some" + "method"]() {} +>["some" + "method"] : Symbol(C["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 56, 32)) } void class D { @@ -215,63 +258,79 @@ void class D { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(D["property"], Decl(decoratorsOnComputedProperties.ts, 60, 14)) >"property" : Symbol(D["property"], Decl(decoratorsOnComputedProperties.ts, 60, 14)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(D[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 61, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(D["property2"], Decl(decoratorsOnComputedProperties.ts, 62, 33)) >"property2" : Symbol(D["property2"], Decl(decoratorsOnComputedProperties.ts, 62, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(D[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 63, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(D["property3"], Decl(decoratorsOnComputedProperties.ts, 64, 37)) >"property3" : Symbol(D["property3"], Decl(decoratorsOnComputedProperties.ts, 64, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(D[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 65, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(D["property4"], Decl(decoratorsOnComputedProperties.ts, 66, 37)) >"property4" : Symbol(D["property4"], Decl(decoratorsOnComputedProperties.ts, 66, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(D[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 67, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(D[foo()], Decl(decoratorsOnComputedProperties.ts, 68, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(D[foo()], Decl(decoratorsOnComputedProperties.ts, 69, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(D[foo()], Decl(decoratorsOnComputedProperties.ts, 70, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) [fieldNameA]: any; +>[fieldNameA] : Symbol(D[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 71, 27)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(D[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 72, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(D[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 73, 25)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) ["some" + "method"]() {} +>["some" + "method"] : Symbol(D["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 74, 32)) + }; class E { @@ -279,61 +338,77 @@ class E { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(E["property"], Decl(decoratorsOnComputedProperties.ts, 78, 9)) >"property" : Symbol(E["property"], Decl(decoratorsOnComputedProperties.ts, 78, 9)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(E[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 79, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(E["property2"], Decl(decoratorsOnComputedProperties.ts, 80, 33)) >"property2" : Symbol(E["property2"], Decl(decoratorsOnComputedProperties.ts, 80, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(E[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 81, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(E["property3"], Decl(decoratorsOnComputedProperties.ts, 82, 37)) >"property3" : Symbol(E["property3"], Decl(decoratorsOnComputedProperties.ts, 82, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(E[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 83, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(E["property4"], Decl(decoratorsOnComputedProperties.ts, 84, 37)) >"property4" : Symbol(E["property4"], Decl(decoratorsOnComputedProperties.ts, 84, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(E[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 85, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(E[foo()], Decl(decoratorsOnComputedProperties.ts, 86, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(E[foo()], Decl(decoratorsOnComputedProperties.ts, 87, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(E[foo()], Decl(decoratorsOnComputedProperties.ts, 88, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) ["some" + "method"]() {} +>["some" + "method"] : Symbol(E["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 89, 27)) + [fieldNameA]: any; +>[fieldNameA] : Symbol(E[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 90, 28)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(E[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 91, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(E[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 92, 25)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) } @@ -342,61 +417,77 @@ void class F { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(F["property"], Decl(decoratorsOnComputedProperties.ts, 96, 14)) >"property" : Symbol(F["property"], Decl(decoratorsOnComputedProperties.ts, 96, 14)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(F[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 97, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(F["property2"], Decl(decoratorsOnComputedProperties.ts, 98, 33)) >"property2" : Symbol(F["property2"], Decl(decoratorsOnComputedProperties.ts, 98, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(F[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 99, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(F["property3"], Decl(decoratorsOnComputedProperties.ts, 100, 37)) >"property3" : Symbol(F["property3"], Decl(decoratorsOnComputedProperties.ts, 100, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(F[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 101, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(F["property4"], Decl(decoratorsOnComputedProperties.ts, 102, 37)) >"property4" : Symbol(F["property4"], Decl(decoratorsOnComputedProperties.ts, 102, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(F[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 103, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(F[foo()], Decl(decoratorsOnComputedProperties.ts, 104, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(F[foo()], Decl(decoratorsOnComputedProperties.ts, 105, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(F[foo()], Decl(decoratorsOnComputedProperties.ts, 106, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) ["some" + "method"]() {} +>["some" + "method"] : Symbol(F["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 107, 27)) + [fieldNameA]: any; +>[fieldNameA] : Symbol(F[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 108, 28)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(F[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 109, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(F[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 110, 25)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) }; @@ -406,62 +497,80 @@ class G { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(G["property"], Decl(decoratorsOnComputedProperties.ts, 114, 9)) >"property" : Symbol(G["property"], Decl(decoratorsOnComputedProperties.ts, 114, 9)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(G[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 115, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(G["property2"], Decl(decoratorsOnComputedProperties.ts, 116, 33)) >"property2" : Symbol(G["property2"], Decl(decoratorsOnComputedProperties.ts, 116, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(G[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 117, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(G["property3"], Decl(decoratorsOnComputedProperties.ts, 118, 37)) >"property3" : Symbol(G["property3"], Decl(decoratorsOnComputedProperties.ts, 118, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(G[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 119, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(G["property4"], Decl(decoratorsOnComputedProperties.ts, 120, 37)) >"property4" : Symbol(G["property4"], Decl(decoratorsOnComputedProperties.ts, 120, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(G[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 121, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(G[foo()], Decl(decoratorsOnComputedProperties.ts, 122, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(G[foo()], Decl(decoratorsOnComputedProperties.ts, 123, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(G[foo()], Decl(decoratorsOnComputedProperties.ts, 124, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) ["some" + "method"]() {} +>["some" + "method"] : Symbol(G["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 125, 27)) + [fieldNameA]: any; +>[fieldNameA] : Symbol(G[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 126, 28)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(G[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 127, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) ["some" + "method2"]() {} +>["some" + "method2"] : Symbol(G["some\" + \"method2"], Decl(decoratorsOnComputedProperties.ts, 128, 25)) + @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(G[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 129, 29)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) } @@ -470,62 +579,80 @@ void class H { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(H["property"], Decl(decoratorsOnComputedProperties.ts, 133, 14)) >"property" : Symbol(H["property"], Decl(decoratorsOnComputedProperties.ts, 133, 14)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(H[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 134, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(H["property2"], Decl(decoratorsOnComputedProperties.ts, 135, 33)) >"property2" : Symbol(H["property2"], Decl(decoratorsOnComputedProperties.ts, 135, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(H[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 136, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(H["property3"], Decl(decoratorsOnComputedProperties.ts, 137, 37)) >"property3" : Symbol(H["property3"], Decl(decoratorsOnComputedProperties.ts, 137, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(H[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 138, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(H["property4"], Decl(decoratorsOnComputedProperties.ts, 139, 37)) >"property4" : Symbol(H["property4"], Decl(decoratorsOnComputedProperties.ts, 139, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(H[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 140, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(H[foo()], Decl(decoratorsOnComputedProperties.ts, 141, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(H[foo()], Decl(decoratorsOnComputedProperties.ts, 142, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(H[foo()], Decl(decoratorsOnComputedProperties.ts, 143, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) ["some" + "method"]() {} +>["some" + "method"] : Symbol(H["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 144, 27)) + [fieldNameA]: any; +>[fieldNameA] : Symbol(H[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 145, 28)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(H[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 146, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) ["some" + "method2"]() {} +>["some" + "method2"] : Symbol(H["some\" + \"method2"], Decl(decoratorsOnComputedProperties.ts, 147, 25)) + @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(H[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 148, 29)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) }; @@ -535,64 +662,81 @@ class I { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(I["property"], Decl(decoratorsOnComputedProperties.ts, 152, 9)) >"property" : Symbol(I["property"], Decl(decoratorsOnComputedProperties.ts, 152, 9)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(I[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 153, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(I["property2"], Decl(decoratorsOnComputedProperties.ts, 154, 33)) >"property2" : Symbol(I["property2"], Decl(decoratorsOnComputedProperties.ts, 154, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 155, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(I["property3"], Decl(decoratorsOnComputedProperties.ts, 156, 37)) >"property3" : Symbol(I["property3"], Decl(decoratorsOnComputedProperties.ts, 156, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 157, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(I["property4"], Decl(decoratorsOnComputedProperties.ts, 158, 37)) >"property4" : Symbol(I["property4"], Decl(decoratorsOnComputedProperties.ts, 158, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(I[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 159, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(I[foo()], Decl(decoratorsOnComputedProperties.ts, 160, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(I[foo()], Decl(decoratorsOnComputedProperties.ts, 161, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(I[foo()], Decl(decoratorsOnComputedProperties.ts, 162, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x ["some" + "method"]() {} >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["some" + "method"] : Symbol(I["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 163, 27)) [fieldNameA]: any; +>[fieldNameA] : Symbol(I[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 164, 31)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(I[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 165, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) ["some" + "method2"]() {} +>["some" + "method2"] : Symbol(I["some\" + \"method2"], Decl(decoratorsOnComputedProperties.ts, 166, 25)) + @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(I[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 167, 29)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) } @@ -601,64 +745,81 @@ void class J { @x ["property"]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property"] : Symbol(J["property"], Decl(decoratorsOnComputedProperties.ts, 171, 14)) >"property" : Symbol(J["property"], Decl(decoratorsOnComputedProperties.ts, 171, 14)) @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.toStringTag] : Symbol(J[Symbol.toStringTag], Decl(decoratorsOnComputedProperties.ts, 172, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["property2"] : Symbol(J["property2"], Decl(decoratorsOnComputedProperties.ts, 173, 33)) >"property2" : Symbol(J["property2"], Decl(decoratorsOnComputedProperties.ts, 173, 33)) @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[Symbol.iterator] : Symbol(J[Symbol.iterator], Decl(decoratorsOnComputedProperties.ts, 174, 30)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ["property3"]: any; +>["property3"] : Symbol(J["property3"], Decl(decoratorsOnComputedProperties.ts, 175, 37)) >"property3" : Symbol(J["property3"], Decl(decoratorsOnComputedProperties.ts, 175, 37)) [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : Symbol(J[Symbol.isConcatSpreadable], Decl(decoratorsOnComputedProperties.ts, 176, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ["property4"]: any = 2; +>["property4"] : Symbol(J["property4"], Decl(decoratorsOnComputedProperties.ts, 177, 37)) >"property4" : Symbol(J["property4"], Decl(decoratorsOnComputedProperties.ts, 177, 37)) [Symbol.match]: any = null; +>[Symbol.match] : Symbol(J[Symbol.match], Decl(decoratorsOnComputedProperties.ts, 178, 27)) >Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >match : Symbol(SymbolConstructor.match, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [foo()]: any; +>[foo()] : Symbol(J[foo()], Decl(decoratorsOnComputedProperties.ts, 179, 31)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(J[foo()], Decl(decoratorsOnComputedProperties.ts, 180, 17)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x [foo()]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[foo()] : Symbol(J[foo()], Decl(decoratorsOnComputedProperties.ts, 181, 20)) >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @x ["some" + "method"]() {} >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>["some" + "method"] : Symbol(J["some\" + \"method"], Decl(decoratorsOnComputedProperties.ts, 182, 27)) [fieldNameA]: any; +>[fieldNameA] : Symbol(J[fieldNameA], Decl(decoratorsOnComputedProperties.ts, 183, 31)) >fieldNameA : Symbol(fieldNameA, Decl(decoratorsOnComputedProperties.ts, 4, 5)) @x [fieldNameB]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameB] : Symbol(J[fieldNameB], Decl(decoratorsOnComputedProperties.ts, 184, 22)) >fieldNameB : Symbol(fieldNameB, Decl(decoratorsOnComputedProperties.ts, 5, 5)) ["some" + "method2"]() {} +>["some" + "method2"] : Symbol(J["some\" + \"method2"], Decl(decoratorsOnComputedProperties.ts, 185, 25)) + @x [fieldNameC]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) +>[fieldNameC] : Symbol(J[fieldNameC], Decl(decoratorsOnComputedProperties.ts, 186, 29)) >fieldNameC : Symbol(fieldNameC, Decl(decoratorsOnComputedProperties.ts, 6, 5)) }; diff --git a/tests/baselines/reference/decoratorsOnComputedProperties.types b/tests/baselines/reference/decoratorsOnComputedProperties.types index 4976812b8d4..24ed343c298 100644 --- a/tests/baselines/reference/decoratorsOnComputedProperties.types +++ b/tests/baselines/reference/decoratorsOnComputedProperties.types @@ -33,68 +33,82 @@ class A { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null } @@ -106,68 +120,82 @@ void class B { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null @@ -178,72 +206,87 @@ class C { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null ["some" + "method"]() {} +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" @@ -256,72 +299,87 @@ void class D { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null ["some" + "method"]() {} +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" @@ -333,73 +391,88 @@ class E { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null ["some" + "method"]() {} +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null } @@ -411,73 +484,88 @@ void class F { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null ["some" + "method"]() {} +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null @@ -488,78 +576,94 @@ class G { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null ["some" + "method"]() {} +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string ["some" + "method2"]() {} +>["some" + "method2"] : () => void >"some" + "method2" : string >"some" : "some" >"method2" : "method2" @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null } @@ -571,78 +675,94 @@ void class H { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null ["some" + "method"]() {} +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string ["some" + "method2"]() {} +>["some" + "method2"] : () => void >"some" + "method2" : string >"some" : "some" >"method2" : "method2" @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null @@ -653,79 +773,95 @@ class I { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null @x ["some" + "method"]() {} >x : (o: object, k: PropertyKey) => void +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string ["some" + "method2"]() {} +>["some" + "method2"] : () => void >"some" + "method2" : string >"some" : "some" >"method2" : "method2" @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null } @@ -737,79 +873,95 @@ void class J { @x ["property"]: any; >x : (o: object, k: PropertyKey) => void +>["property"] : any >"property" : "property" @x [Symbol.toStringTag]: any; >x : (o: object, k: PropertyKey) => void +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @x ["property2"]: any = 2; >x : (o: object, k: PropertyKey) => void +>["property2"] : any >"property2" : "property2" >2 : 2 @x [Symbol.iterator]: any = null; >x : (o: object, k: PropertyKey) => void +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >null : null ["property3"]: any; +>["property3"] : any >"property3" : "property3" [Symbol.isConcatSpreadable]: any; +>[Symbol.isConcatSpreadable] : any >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol ["property4"]: any = 2; +>["property4"] : any >"property4" : "property4" >2 : 2 [Symbol.match]: any = null; +>[Symbol.match] : any >Symbol.match : symbol >Symbol : SymbolConstructor >match : symbol >null : null [foo()]: any; +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string @x [foo()]: any = null; >x : (o: object, k: PropertyKey) => void +>[foo()] : any >foo() : string >foo : () => string >null : null @x ["some" + "method"]() {} >x : (o: object, k: PropertyKey) => void +>["some" + "method"] : () => void >"some" + "method" : string >"some" : "some" >"method" : "method" [fieldNameA]: any; +>[fieldNameA] : any >fieldNameA : string @x [fieldNameB]: any; >x : (o: object, k: PropertyKey) => void +>[fieldNameB] : any >fieldNameB : string ["some" + "method2"]() {} +>["some" + "method2"] : () => void >"some" + "method2" : string >"some" : "some" >"method2" : "method2" @x [fieldNameC]: any = null; >x : (o: object, k: PropertyKey) => void +>[fieldNameC] : any >fieldNameC : string >null : null diff --git a/tests/baselines/reference/duplicateIdentifierComputedName.symbols b/tests/baselines/reference/duplicateIdentifierComputedName.symbols index efe01b6a349..9706d064f5b 100644 --- a/tests/baselines/reference/duplicateIdentifierComputedName.symbols +++ b/tests/baselines/reference/duplicateIdentifierComputedName.symbols @@ -3,9 +3,11 @@ class C { >C : Symbol(C, Decl(duplicateIdentifierComputedName.ts, 0, 0)) ["a"]: string; +>["a"] : Symbol(C["a"], Decl(duplicateIdentifierComputedName.ts, 0, 9), Decl(duplicateIdentifierComputedName.ts, 1, 18)) >"a" : Symbol(C["a"], Decl(duplicateIdentifierComputedName.ts, 0, 9), Decl(duplicateIdentifierComputedName.ts, 1, 18)) ["a"]: string; +>["a"] : Symbol(C["a"], Decl(duplicateIdentifierComputedName.ts, 0, 9), Decl(duplicateIdentifierComputedName.ts, 1, 18)) >"a" : Symbol(C["a"], Decl(duplicateIdentifierComputedName.ts, 0, 9), Decl(duplicateIdentifierComputedName.ts, 1, 18)) } diff --git a/tests/baselines/reference/duplicateIdentifierComputedName.types b/tests/baselines/reference/duplicateIdentifierComputedName.types index dceb17d54d3..d3aa5428681 100644 --- a/tests/baselines/reference/duplicateIdentifierComputedName.types +++ b/tests/baselines/reference/duplicateIdentifierComputedName.types @@ -3,9 +3,11 @@ class C { >C : C ["a"]: string; +>["a"] : string >"a" : "a" ["a"]: string; +>["a"] : string >"a" : "a" } diff --git a/tests/baselines/reference/dynamicNames.symbols b/tests/baselines/reference/dynamicNames.symbols index f5242a7013d..f5b06ec51f4 100644 --- a/tests/baselines/reference/dynamicNames.symbols +++ b/tests/baselines/reference/dynamicNames.symbols @@ -13,12 +13,15 @@ export interface T0 { >T0 : Symbol(T0, Decl(module.ts, 2, 27)) [c0]: number; +>[c0] : Symbol(T0[c0], Decl(module.ts, 3, 21)) >c0 : Symbol(c0, Decl(module.ts, 0, 12)) [c1]: string; +>[c1] : Symbol(T0[c1], Decl(module.ts, 4, 17)) >c1 : Symbol(c1, Decl(module.ts, 1, 12)) [s0]: boolean; +>[s0] : Symbol(T0[s0], Decl(module.ts, 5, 17)) >s0 : Symbol(s0, Decl(module.ts, 2, 12)) } export declare class T1 implements T2 { @@ -26,12 +29,15 @@ export declare class T1 implements T2 { >T2 : Symbol(T2, Decl(module.ts, 12, 1)) [c0]: number; +>[c0] : Symbol(T1[c0], Decl(module.ts, 8, 39)) >c0 : Symbol(c0, Decl(module.ts, 0, 12)) [c1]: string; +>[c1] : Symbol(T1[c1], Decl(module.ts, 9, 17)) >c1 : Symbol(c1, Decl(module.ts, 1, 12)) [s0]: boolean; +>[s0] : Symbol(T1[s0], Decl(module.ts, 10, 17)) >s0 : Symbol(s0, Decl(module.ts, 2, 12)) } export declare class T2 extends T1 { @@ -42,12 +48,15 @@ export declare type T3 = { >T3 : Symbol(T3, Decl(module.ts, 14, 1)) [c0]: number; +>[c0] : Symbol([c0], Decl(module.ts, 15, 26)) >c0 : Symbol(c0, Decl(module.ts, 0, 12)) [c1]: string; +>[c1] : Symbol([c1], Decl(module.ts, 16, 17)) >c1 : Symbol(c1, Decl(module.ts, 1, 12)) [s0]: boolean; +>[s0] : Symbol([s0], Decl(module.ts, 17, 17)) >s0 : Symbol(s0, Decl(module.ts, 2, 12)) }; @@ -83,16 +92,19 @@ namespace N { >T4 : Symbol(T4, Decl(main.ts, 6, 36)) [N.c2]: number; +>[N.c2] : Symbol(T4[N.c2], Decl(main.ts, 8, 25)) >N.c2 : Symbol(c2, Decl(main.ts, 4, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >c2 : Symbol(c2, Decl(main.ts, 4, 16)) [N.c3]: string; +>[N.c3] : Symbol(T4[N.c3], Decl(main.ts, 9, 23)) >N.c3 : Symbol(c3, Decl(main.ts, 5, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >c3 : Symbol(c3, Decl(main.ts, 5, 16)) [N.s1]: boolean; +>[N.s1] : Symbol(T4[N.s1], Decl(main.ts, 10, 23)) >N.s1 : Symbol(s1, Decl(main.ts, 6, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >s1 : Symbol(s1, Decl(main.ts, 6, 16)) @@ -102,16 +114,19 @@ namespace N { >T4 : Symbol(T4, Decl(main.ts, 6, 36)) [N.c2]: number; +>[N.c2] : Symbol(T5[N.c2], Decl(main.ts, 13, 43)) >N.c2 : Symbol(c2, Decl(main.ts, 4, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >c2 : Symbol(c2, Decl(main.ts, 4, 16)) [N.c3]: string; +>[N.c3] : Symbol(T5[N.c3], Decl(main.ts, 14, 23)) >N.c3 : Symbol(c3, Decl(main.ts, 5, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >c3 : Symbol(c3, Decl(main.ts, 5, 16)) [N.s1]: boolean; +>[N.s1] : Symbol(T5[N.s1], Decl(main.ts, 15, 23)) >N.s1 : Symbol(s1, Decl(main.ts, 6, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >s1 : Symbol(s1, Decl(main.ts, 6, 16)) @@ -124,16 +139,19 @@ namespace N { >T7 : Symbol(T7, Decl(main.ts, 19, 5)) [N.c2]: number; +>[N.c2] : Symbol([N.c2], Decl(main.ts, 20, 30)) >N.c2 : Symbol(c2, Decl(main.ts, 4, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >c2 : Symbol(c2, Decl(main.ts, 4, 16)) [N.c3]: string; +>[N.c3] : Symbol([N.c3], Decl(main.ts, 21, 23)) >N.c3 : Symbol(c3, Decl(main.ts, 5, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >c3 : Symbol(c3, Decl(main.ts, 5, 16)) [N.s1]: boolean; +>[N.s1] : Symbol([N.s1], Decl(main.ts, 22, 23)) >N.s1 : Symbol(s1, Decl(main.ts, 6, 16)) >N : Symbol(N, Decl(main.ts, 1, 30)) >s1 : Symbol(s1, Decl(main.ts, 6, 16)) @@ -156,12 +174,15 @@ interface T8 { >T8 : Symbol(T8, Decl(main.ts, 29, 32)) [c4]: number; +>[c4] : Symbol(T8[c4], Decl(main.ts, 31, 14)) >c4 : Symbol(c4, Decl(main.ts, 27, 12)) [c5]: string; +>[c5] : Symbol(T8[c5], Decl(main.ts, 32, 17)) >c5 : Symbol(c5, Decl(main.ts, 28, 12)) [s2]: boolean; +>[s2] : Symbol(T8[s2], Decl(main.ts, 33, 17)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) } declare class T9 implements T8 { @@ -169,12 +190,15 @@ declare class T9 implements T8 { >T8 : Symbol(T8, Decl(main.ts, 29, 32)) [c4]: number; +>[c4] : Symbol(T9[c4], Decl(main.ts, 36, 32)) >c4 : Symbol(c4, Decl(main.ts, 27, 12)) [c5]: string; +>[c5] : Symbol(T9[c5], Decl(main.ts, 37, 17)) >c5 : Symbol(c5, Decl(main.ts, 28, 12)) [s2]: boolean; +>[s2] : Symbol(T9[s2], Decl(main.ts, 38, 17)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) } declare class T10 extends T9 { @@ -185,12 +209,15 @@ declare type T11 = { >T11 : Symbol(T11, Decl(main.ts, 42, 1)) [c4]: number; +>[c4] : Symbol([c4], Decl(main.ts, 43, 20)) >c4 : Symbol(c4, Decl(main.ts, 27, 12)) [c5]: string; +>[c5] : Symbol([c5], Decl(main.ts, 44, 17)) >c5 : Symbol(c5, Decl(main.ts, 28, 12)) [s2]: boolean; +>[s2] : Symbol([s2], Decl(main.ts, 45, 17)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) }; @@ -205,6 +232,7 @@ interface T12 { >1 : Symbol(T12[1], Decl(main.ts, 50, 14)) [s2]: boolean; +>[s2] : Symbol(T12[s2], Decl(main.ts, 51, 14)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) } declare class T13 implements T2 { @@ -218,6 +246,7 @@ declare class T13 implements T2 { >1 : Symbol(T13[1], Decl(main.ts, 55, 14)) [s2]: boolean; +>[s2] : Symbol(T13[s2], Decl(main.ts, 56, 14)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) } declare class T14 extends T13 { @@ -234,6 +263,7 @@ declare type T15 = { >1 : Symbol(1, Decl(main.ts, 62, 14)) [s2]: boolean; +>[s2] : Symbol([s2], Decl(main.ts, 63, 14)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) }; @@ -248,6 +278,7 @@ declare class C { >1 : Symbol(C[1], Decl(main.ts, 68, 21)) static [s2]: boolean; +>[s2] : Symbol(C[s2], Decl(main.ts, 69, 21)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) } @@ -419,12 +450,15 @@ export const o1 = { >o1 : Symbol(o1, Decl(main.ts, 101, 12)) [c4]: 1, +>[c4] : Symbol([c4], Decl(main.ts, 101, 19)) >c4 : Symbol(c4, Decl(main.ts, 27, 12)) [c5]: "a", +>[c5] : Symbol([c5], Decl(main.ts, 102, 12)) >c5 : Symbol(c5, Decl(main.ts, 28, 12)) [s2]: true +>[s2] : Symbol([s2], Decl(main.ts, 103, 14)) >s2 : Symbol(s2, Decl(main.ts, 29, 12)) }; @@ -470,6 +504,7 @@ interface RI { >T : Symbol(T, Decl(main.ts, 118, 13)) [rI.x]: "b"; +>[rI.x] : Symbol(RI[rI.x], Decl(main.ts, 119, 9)) >rI.x : Symbol(RI.x, Decl(main.ts, 118, 35)) >rI : Symbol(rI, Decl(main.ts, 116, 13)) >x : Symbol(RI.x, Decl(main.ts, 118, 35)) @@ -493,6 +528,7 @@ declare class RC { >T : Symbol(T, Decl(main.ts, 125, 17)) [rC.x]: "b"; +>[rC.x] : Symbol(RC[rC.x], Decl(main.ts, 126, 9)) >rC.x : Symbol(RC.x, Decl(main.ts, 125, 39)) >rC : Symbol(rC, Decl(main.ts, 123, 13)) >x : Symbol(RC.x, Decl(main.ts, 125, 39)) diff --git a/tests/baselines/reference/dynamicNames.types b/tests/baselines/reference/dynamicNames.types index be142c30ed0..8535d7454a1 100644 --- a/tests/baselines/reference/dynamicNames.types +++ b/tests/baselines/reference/dynamicNames.types @@ -16,12 +16,15 @@ export interface T0 { >T0 : T0 [c0]: number; +>[c0] : number >c0 : "a" [c1]: string; +>[c1] : string >c1 : 1 [s0]: boolean; +>[s0] : boolean >s0 : unique symbol } export declare class T1 implements T2 { @@ -29,12 +32,15 @@ export declare class T1 implements T2 { >T2 : T2 [c0]: number; +>[c0] : number >c0 : "a" [c1]: string; +>[c1] : string >c1 : 1 [s0]: boolean; +>[s0] : boolean >s0 : unique symbol } export declare class T2 extends T1 { @@ -45,12 +51,15 @@ export declare type T3 = { >T3 : T3 [c0]: number; +>[c0] : number >c0 : "a" [c1]: string; +>[c1] : string >c1 : 1 [s0]: boolean; +>[s0] : boolean >s0 : unique symbol }; @@ -88,16 +97,19 @@ namespace N { >T4 : T4 [N.c2]: number; +>[N.c2] : number >N.c2 : "a" >N : typeof N >c2 : "a" [N.c3]: string; +>[N.c3] : string >N.c3 : 1 >N : typeof N >c3 : 1 [N.s1]: boolean; +>[N.s1] : boolean >N.s1 : unique symbol >N : typeof N >s1 : unique symbol @@ -107,16 +119,19 @@ namespace N { >T4 : T4 [N.c2]: number; +>[N.c2] : number >N.c2 : "a" >N : typeof N >c2 : "a" [N.c3]: string; +>[N.c3] : string >N.c3 : 1 >N : typeof N >c3 : 1 [N.s1]: boolean; +>[N.s1] : boolean >N.s1 : unique symbol >N : typeof N >s1 : unique symbol @@ -129,16 +144,19 @@ namespace N { >T7 : { [N.c2]: number; [N.c3]: string; [N.s1]: boolean; } [N.c2]: number; +>[N.c2] : number >N.c2 : "a" >N : typeof N >c2 : "a" [N.c3]: string; +>[N.c3] : string >N.c3 : 1 >N : typeof N >c3 : 1 [N.s1]: boolean; +>[N.s1] : boolean >N.s1 : unique symbol >N : typeof N >s1 : unique symbol @@ -163,12 +181,15 @@ interface T8 { >T8 : T8 [c4]: number; +>[c4] : number >c4 : "a" [c5]: string; +>[c5] : string >c5 : 1 [s2]: boolean; +>[s2] : boolean >s2 : unique symbol } declare class T9 implements T8 { @@ -176,12 +197,15 @@ declare class T9 implements T8 { >T8 : T8 [c4]: number; +>[c4] : number >c4 : "a" [c5]: string; +>[c5] : string >c5 : 1 [s2]: boolean; +>[s2] : boolean >s2 : unique symbol } declare class T10 extends T9 { @@ -192,12 +216,15 @@ declare type T11 = { >T11 : { [c4]: number; [c5]: string; [s2]: boolean; } [c4]: number; +>[c4] : number >c4 : "a" [c5]: string; +>[c5] : string >c5 : 1 [s2]: boolean; +>[s2] : boolean >s2 : unique symbol }; @@ -212,6 +239,7 @@ interface T12 { >1 : string [s2]: boolean; +>[s2] : boolean >s2 : unique symbol } declare class T13 implements T2 { @@ -225,6 +253,7 @@ declare class T13 implements T2 { >1 : string [s2]: boolean; +>[s2] : boolean >s2 : unique symbol } declare class T14 extends T13 { @@ -241,6 +270,7 @@ declare type T15 = { >1 : string [s2]: boolean; +>[s2] : boolean >s2 : unique symbol }; @@ -255,6 +285,7 @@ declare class C { >1 : string static [s2]: boolean; +>[s2] : boolean >s2 : unique symbol } @@ -489,14 +520,17 @@ export const o1 = { >{ [c4]: 1, [c5]: "a", [s2]: true} : { [c4]: number; [c5]: string; [s2]: boolean; } [c4]: 1, +>[c4] : number >c4 : "a" >1 : 1 [c5]: "a", +>[c5] : string >c5 : 1 >"a" : "a" [s2]: true +>[s2] : boolean >s2 : unique symbol >true : true @@ -546,6 +580,7 @@ interface RI { >T : T [rI.x]: "b"; +>[rI.x] : "b" >rI.x : "a" >rI : RI<"a"> >x : "a" @@ -569,6 +604,7 @@ declare class RC { >T : T [rC.x]: "b"; +>[rC.x] : "b" >rC.x : "a" >rC : RC<"a"> >x : "a" diff --git a/tests/baselines/reference/dynamicNamesErrors.symbols b/tests/baselines/reference/dynamicNamesErrors.symbols index 9d00d294343..9c409be88c2 100644 --- a/tests/baselines/reference/dynamicNamesErrors.symbols +++ b/tests/baselines/reference/dynamicNamesErrors.symbols @@ -9,6 +9,7 @@ interface T0 { >T0 : Symbol(T0, Decl(dynamicNamesErrors.ts, 1, 13)) [c0]: number; +>[c0] : Symbol(T0[c0], Decl(dynamicNamesErrors.ts, 3, 14)) >c0 : Symbol(c0, Decl(dynamicNamesErrors.ts, 0, 5)) 1: number; @@ -19,6 +20,7 @@ interface T1 { >T1 : Symbol(T1, Decl(dynamicNamesErrors.ts, 6, 1)) [c0]: number; +>[c0] : Symbol(T1[c0], Decl(dynamicNamesErrors.ts, 8, 14)) >c0 : Symbol(c0, Decl(dynamicNamesErrors.ts, 0, 5)) } @@ -26,6 +28,7 @@ interface T2 { >T2 : Symbol(T2, Decl(dynamicNamesErrors.ts, 10, 1)) [c0]: string; +>[c0] : Symbol(T2[c0], Decl(dynamicNamesErrors.ts, 12, 14)) >c0 : Symbol(c0, Decl(dynamicNamesErrors.ts, 0, 5)) } @@ -33,9 +36,11 @@ interface T3 { >T3 : Symbol(T3, Decl(dynamicNamesErrors.ts, 14, 1)) [c0]: number; +>[c0] : Symbol(T3[c0], Decl(dynamicNamesErrors.ts, 16, 14), Decl(dynamicNamesErrors.ts, 17, 17)) >c0 : Symbol(c0, Decl(dynamicNamesErrors.ts, 0, 5)) [c1]: string; +>[c1] : Symbol(T3[c0], Decl(dynamicNamesErrors.ts, 16, 14), Decl(dynamicNamesErrors.ts, 17, 17)) >c1 : Symbol(c1, Decl(dynamicNamesErrors.ts, 1, 5)) } @@ -75,9 +80,11 @@ export interface InterfaceMemberVisibility { >InterfaceMemberVisibility : Symbol(InterfaceMemberVisibility, Decl(dynamicNamesErrors.ts, 29, 19)) [x]: number; +>[x] : Symbol(InterfaceMemberVisibility[x], Decl(dynamicNamesErrors.ts, 31, 44)) >x : Symbol(x, Decl(dynamicNamesErrors.ts, 26, 5)) [y](): number; +>[y] : Symbol(InterfaceMemberVisibility[y], Decl(dynamicNamesErrors.ts, 32, 16)) >y : Symbol(y, Decl(dynamicNamesErrors.ts, 27, 5)) } @@ -85,28 +92,36 @@ export class ClassMemberVisibility { >ClassMemberVisibility : Symbol(ClassMemberVisibility, Decl(dynamicNamesErrors.ts, 34, 1)) static [x]: number; +>[x] : Symbol(ClassMemberVisibility[x], Decl(dynamicNamesErrors.ts, 36, 36)) >x : Symbol(x, Decl(dynamicNamesErrors.ts, 26, 5)) static [y](): number { return 0; } +>[y] : Symbol(ClassMemberVisibility[y], Decl(dynamicNamesErrors.ts, 37, 23)) >y : Symbol(y, Decl(dynamicNamesErrors.ts, 27, 5)) static get [z](): number { return 0; } +>[z] : Symbol(ClassMemberVisibility[z], Decl(dynamicNamesErrors.ts, 38, 38)) >z : Symbol(z, Decl(dynamicNamesErrors.ts, 28, 5)) static set [w](value: number) { } +>[w] : Symbol(ClassMemberVisibility[w], Decl(dynamicNamesErrors.ts, 39, 42)) >w : Symbol(w, Decl(dynamicNamesErrors.ts, 29, 5)) >value : Symbol(value, Decl(dynamicNamesErrors.ts, 40, 19)) [x]: number; +>[x] : Symbol(ClassMemberVisibility[x], Decl(dynamicNamesErrors.ts, 40, 37)) >x : Symbol(x, Decl(dynamicNamesErrors.ts, 26, 5)) [y](): number { return 0; } +>[y] : Symbol(ClassMemberVisibility[y], Decl(dynamicNamesErrors.ts, 42, 16)) >y : Symbol(y, Decl(dynamicNamesErrors.ts, 27, 5)) get [z](): number { return 0; } +>[z] : Symbol(ClassMemberVisibility[z], Decl(dynamicNamesErrors.ts, 43, 31)) >z : Symbol(z, Decl(dynamicNamesErrors.ts, 28, 5)) set [w](value: number) { } +>[w] : Symbol(ClassMemberVisibility[w], Decl(dynamicNamesErrors.ts, 44, 35)) >w : Symbol(w, Decl(dynamicNamesErrors.ts, 29, 5)) >value : Symbol(value, Decl(dynamicNamesErrors.ts, 45, 12)) } @@ -115,9 +130,11 @@ export type ObjectTypeVisibility = { >ObjectTypeVisibility : Symbol(ObjectTypeVisibility, Decl(dynamicNamesErrors.ts, 46, 1)) [x]: number; +>[x] : Symbol([x], Decl(dynamicNamesErrors.ts, 48, 36)) >x : Symbol(x, Decl(dynamicNamesErrors.ts, 26, 5)) [y](): number; +>[y] : Symbol([y], Decl(dynamicNamesErrors.ts, 49, 16)) >y : Symbol(y, Decl(dynamicNamesErrors.ts, 27, 5)) }; @@ -126,15 +143,19 @@ export const ObjectLiteralVisibility = { >ObjectLiteralVisibility : Symbol(ObjectLiteralVisibility, Decl(dynamicNamesErrors.ts, 53, 12)) [x]: 0, +>[x] : Symbol([x], Decl(dynamicNamesErrors.ts, 53, 40)) >x : Symbol(x, Decl(dynamicNamesErrors.ts, 26, 5)) [y](): number { return 0; }, +>[y] : Symbol([y], Decl(dynamicNamesErrors.ts, 54, 11)) >y : Symbol(y, Decl(dynamicNamesErrors.ts, 27, 5)) get [z](): number { return 0; }, +>[z] : Symbol([z], Decl(dynamicNamesErrors.ts, 55, 32)) >z : Symbol(z, Decl(dynamicNamesErrors.ts, 28, 5)) set [w](value: number) { }, +>[w] : Symbol([w], Decl(dynamicNamesErrors.ts, 56, 36)) >w : Symbol(w, Decl(dynamicNamesErrors.ts, 29, 5)) >value : Symbol(value, Decl(dynamicNamesErrors.ts, 57, 12)) diff --git a/tests/baselines/reference/dynamicNamesErrors.types b/tests/baselines/reference/dynamicNamesErrors.types index be2cb4e8906..8f50c4b05c4 100644 --- a/tests/baselines/reference/dynamicNamesErrors.types +++ b/tests/baselines/reference/dynamicNamesErrors.types @@ -11,6 +11,7 @@ interface T0 { >T0 : T0 [c0]: number; +>[c0] : number >c0 : "1" 1: number; @@ -21,6 +22,7 @@ interface T1 { >T1 : T1 [c0]: number; +>[c0] : number >c0 : "1" } @@ -28,6 +30,7 @@ interface T2 { >T2 : T2 [c0]: string; +>[c0] : string >c0 : "1" } @@ -35,9 +38,11 @@ interface T3 { >T3 : T3 [c0]: number; +>[c0] : number >c0 : "1" [c1]: string; +>[c1] : number >c1 : 1 } @@ -83,9 +88,11 @@ export interface InterfaceMemberVisibility { >InterfaceMemberVisibility : InterfaceMemberVisibility [x]: number; +>[x] : number >x : unique symbol [y](): number; +>[y] : () => number >y : unique symbol } @@ -93,32 +100,40 @@ export class ClassMemberVisibility { >ClassMemberVisibility : ClassMemberVisibility static [x]: number; +>[x] : number >x : unique symbol static [y](): number { return 0; } +>[y] : () => number >y : unique symbol >0 : 0 static get [z](): number { return 0; } +>[z] : number >z : unique symbol >0 : 0 static set [w](value: number) { } +>[w] : number >w : unique symbol >value : number [x]: number; +>[x] : number >x : unique symbol [y](): number { return 0; } +>[y] : () => number >y : unique symbol >0 : 0 get [z](): number { return 0; } +>[z] : number >z : unique symbol >0 : 0 set [w](value: number) { } +>[w] : number >w : unique symbol >value : number } @@ -127,9 +142,11 @@ export type ObjectTypeVisibility = { >ObjectTypeVisibility : ObjectTypeVisibility [x]: number; +>[x] : number >x : unique symbol [y](): number; +>[y] : () => number >y : unique symbol }; @@ -139,18 +156,22 @@ export const ObjectLiteralVisibility = { >{ [x]: 0, [y](): number { return 0; }, get [z](): number { return 0; }, set [w](value: number) { },} : { [x]: number; [y](): number; readonly [z]: number; [w]: number; } [x]: 0, +>[x] : number >x : unique symbol >0 : 0 [y](): number { return 0; }, +>[y] : () => number >y : unique symbol >0 : 0 get [z](): number { return 0; }, +>[z] : number >z : unique symbol >0 : 0 set [w](value: number) { }, +>[w] : number >w : unique symbol >value : number diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols index b6a267e596f..9c6b0817f69 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.symbols @@ -19,26 +19,31 @@ class C { return "BYE"; } static get ["computedname"]() { +>["computedname"] : Symbol(C["computedname"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 7, 5), Decl(emitClassDeclarationWithGetterSetterInES6.ts, 24, 33)) >"computedname" : Symbol(C["computedname"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 7, 5), Decl(emitClassDeclarationWithGetterSetterInES6.ts, 24, 33)) return ""; } get ["computedname1"]() { +>["computedname1"] : Symbol(C["computedname1"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 10, 5)) >"computedname1" : Symbol(C["computedname1"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 10, 5)) return ""; } get ["computedname2"]() { +>["computedname2"] : Symbol(C["computedname2"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 13, 5)) >"computedname2" : Symbol(C["computedname2"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 13, 5)) return ""; } set ["computedname3"](x: any) { +>["computedname3"] : Symbol(C["computedname3"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 16, 5)) >"computedname3" : Symbol(C["computedname3"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 16, 5)) >x : Symbol(x, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 18, 26)) } set ["computedname4"](y: string) { +>["computedname4"] : Symbol(C["computedname4"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 19, 5)) >"computedname4" : Symbol(C["computedname4"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 19, 5)) >y : Symbol(y, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 20, 26)) } @@ -52,6 +57,7 @@ class C { >b : Symbol(b, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 24, 19)) static set ["computedname"](b: string) { } +>["computedname"] : Symbol(C["computedname"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 7, 5), Decl(emitClassDeclarationWithGetterSetterInES6.ts, 24, 33)) >"computedname" : Symbol(C["computedname"], Decl(emitClassDeclarationWithGetterSetterInES6.ts, 7, 5), Decl(emitClassDeclarationWithGetterSetterInES6.ts, 24, 33)) >b : Symbol(b, Decl(emitClassDeclarationWithGetterSetterInES6.ts, 25, 32)) } diff --git a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types index f251429937d..90733489fc1 100644 --- a/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithGetterSetterInES6.types @@ -20,18 +20,21 @@ class C { >"BYE" : "BYE" } static get ["computedname"]() { +>["computedname"] : string >"computedname" : "computedname" return ""; >"" : "" } get ["computedname1"]() { +>["computedname1"] : string >"computedname1" : "computedname1" return ""; >"" : "" } get ["computedname2"]() { +>["computedname2"] : string >"computedname2" : "computedname2" return ""; @@ -39,10 +42,12 @@ class C { } set ["computedname3"](x: any) { +>["computedname3"] : any >"computedname3" : "computedname3" >x : any } set ["computedname4"](y: string) { +>["computedname4"] : string >"computedname4" : "computedname4" >y : string } @@ -56,6 +61,7 @@ class C { >b : number static set ["computedname"](b: string) { } +>["computedname"] : string >"computedname" : "computedname" >b : string } diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols index 5328b892ded..a9153050f73 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.symbols @@ -9,13 +9,16 @@ class D { >foo : Symbol(D.foo, Decl(emitClassDeclarationWithMethodInES6.ts, 1, 17)) ["computedName1"]() { } +>["computedName1"] : Symbol(D["computedName1"], Decl(emitClassDeclarationWithMethodInES6.ts, 2, 13)) >"computedName1" : Symbol(D["computedName1"], Decl(emitClassDeclarationWithMethodInES6.ts, 2, 13)) ["computedName2"](a: string) { } +>["computedName2"] : Symbol(D["computedName2"], Decl(emitClassDeclarationWithMethodInES6.ts, 3, 27)) >"computedName2" : Symbol(D["computedName2"], Decl(emitClassDeclarationWithMethodInES6.ts, 3, 27)) >a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 4, 22)) ["computedName3"](a: string): number { return 1; } +>["computedName3"] : Symbol(D["computedName3"], Decl(emitClassDeclarationWithMethodInES6.ts, 4, 36)) >"computedName3" : Symbol(D["computedName3"], Decl(emitClassDeclarationWithMethodInES6.ts, 4, 36)) >a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 5, 22)) @@ -35,13 +38,16 @@ class D { return "HELLO"; } static ["computedname4"]() { } +>["computedname4"] : Symbol(D["computedname4"], Decl(emitClassDeclarationWithMethodInES6.ts, 11, 5)) >"computedname4" : Symbol(D["computedname4"], Decl(emitClassDeclarationWithMethodInES6.ts, 11, 5)) static ["computedname5"](a: string) { } +>["computedname5"] : Symbol(D["computedname5"], Decl(emitClassDeclarationWithMethodInES6.ts, 12, 34)) >"computedname5" : Symbol(D["computedname5"], Decl(emitClassDeclarationWithMethodInES6.ts, 12, 34)) >a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 13, 29)) static ["computedname6"](a: string): boolean { return true; } +>["computedname6"] : Symbol(D["computedname6"], Decl(emitClassDeclarationWithMethodInES6.ts, 13, 43)) >"computedname6" : Symbol(D["computedname6"], Decl(emitClassDeclarationWithMethodInES6.ts, 13, 43)) >a : Symbol(a, Decl(emitClassDeclarationWithMethodInES6.ts, 14, 29)) diff --git a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types index 10f0d4d2eef..1f8b336782a 100644 --- a/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types +++ b/tests/baselines/reference/emitClassDeclarationWithMethodInES6.types @@ -9,13 +9,16 @@ class D { >foo : () => void ["computedName1"]() { } +>["computedName1"] : () => void >"computedName1" : "computedName1" ["computedName2"](a: string) { } +>["computedName2"] : (a: string) => void >"computedName2" : "computedName2" >a : string ["computedName3"](a: string): number { return 1; } +>["computedName3"] : (a: string) => number >"computedName3" : "computedName3" >a : string >1 : 1 @@ -37,13 +40,16 @@ class D { >"HELLO" : "HELLO" } static ["computedname4"]() { } +>["computedname4"] : () => void >"computedname4" : "computedname4" static ["computedname5"](a: string) { } +>["computedname5"] : (a: string) => void >"computedname5" : "computedname5" >a : string static ["computedname6"](a: string): boolean { return true; } +>["computedname6"] : (a: string) => boolean >"computedname6" : "computedname6" >a : string >true : true diff --git a/tests/baselines/reference/es5-asyncFunctionObjectLiterals.symbols b/tests/baselines/reference/es5-asyncFunctionObjectLiterals.symbols index dd84a5c11f4..53d2a4a1e2f 100644 --- a/tests/baselines/reference/es5-asyncFunctionObjectLiterals.symbols +++ b/tests/baselines/reference/es5-asyncFunctionObjectLiterals.symbols @@ -48,6 +48,7 @@ async function objectLiteral2() { >x : Symbol(x, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 11)) [await a]: y, +>[await a] : Symbol([await a], Decl(es5-asyncFunctionObjectLiterals.ts, 17, 9)) >a : Symbol(a, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 20)) >y : Symbol(y, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 14)) @@ -65,6 +66,7 @@ async function objectLiteral3() { >x : Symbol(x, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 11)) [a]: await y, +>[a] : Symbol([a], Decl(es5-asyncFunctionObjectLiterals.ts, 24, 9)) >a : Symbol(a, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 20)) >y : Symbol(y, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 14)) @@ -86,6 +88,7 @@ async function objectLiteral4() { >y : Symbol(y, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 14)) [b]: z +>[b] : Symbol([b], Decl(es5-asyncFunctionObjectLiterals.ts, 32, 19)) >b : Symbol(b, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 23)) >z : Symbol(z, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 17)) @@ -103,6 +106,7 @@ async function objectLiteral5() { >y : Symbol(y, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 14)) [await b]: z +>[await b] : Symbol([await b], Decl(es5-asyncFunctionObjectLiterals.ts, 39, 13)) >b : Symbol(b, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 23)) >z : Symbol(z, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 17)) @@ -120,6 +124,7 @@ async function objectLiteral6() { >y : Symbol(y, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 14)) [b]: await z +>[b] : Symbol([b], Decl(es5-asyncFunctionObjectLiterals.ts, 46, 13)) >b : Symbol(b, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 23)) >z : Symbol(z, Decl(es5-asyncFunctionObjectLiterals.ts, 0, 17)) diff --git a/tests/baselines/reference/es5-asyncFunctionObjectLiterals.types b/tests/baselines/reference/es5-asyncFunctionObjectLiterals.types index d37dd8a6ceb..b594e1ba35a 100644 --- a/tests/baselines/reference/es5-asyncFunctionObjectLiterals.types +++ b/tests/baselines/reference/es5-asyncFunctionObjectLiterals.types @@ -56,6 +56,7 @@ async function objectLiteral2() { >{ [await a]: y, b: z } : { [x: number]: any; b: any; } [await a]: y, +>[await a] : any >await a : any >a : any >y : any @@ -76,6 +77,7 @@ async function objectLiteral3() { >{ [a]: await y, b: z } : { [x: number]: any; b: any; } [a]: await y, +>[a] : any >a : any >await y : any >y : any @@ -101,6 +103,7 @@ async function objectLiteral4() { >y : any [b]: z +>[b] : any >b : any >z : any @@ -120,6 +123,7 @@ async function objectLiteral5() { >y : any [await b]: z +>[await b] : any >await b : any >b : any >z : any @@ -140,6 +144,7 @@ async function objectLiteral6() { >y : any [b]: await z +>[b] : any >b : any >await z : any >z : any diff --git a/tests/baselines/reference/exportDefaultParenthesize.symbols b/tests/baselines/reference/exportDefaultParenthesize.symbols index 684138ebb3b..b2291da3a9b 100644 --- a/tests/baselines/reference/exportDefaultParenthesize.symbols +++ b/tests/baselines/reference/exportDefaultParenthesize.symbols @@ -1,33 +1,80 @@ === tests/cases/compiler/commalist.ts === export default { -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code. ['foo'+'']: 42, -No type information for this code.}; -No type information for this code. -No type information for this code.=== tests/cases/compiler/comma.ts === + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 0, 16)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 1, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 2, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 3, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 4, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 5, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 6, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 7, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 8, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 9, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 10, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 11, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 12, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 13, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 14, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 15, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 16, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 17, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 18, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 19, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 20, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 21, 19)) + + ['foo'+'']: 42, +>['foo'+''] : Symbol(['foo'+''], Decl(commalist.ts, 22, 19)) + +}; + +=== tests/cases/compiler/comma.ts === export default { ['foo']: 42 +>['foo'] : Symbol(['foo'], Decl(comma.ts, 0, 16)) >'foo' : Symbol(['foo'], Decl(comma.ts, 0, 16)) }; diff --git a/tests/baselines/reference/exportDefaultParenthesize.types b/tests/baselines/reference/exportDefaultParenthesize.types index 43e016a9ea0..1ec5da5b35e 100644 --- a/tests/baselines/reference/exportDefaultParenthesize.types +++ b/tests/baselines/reference/exportDefaultParenthesize.types @@ -3,138 +3,161 @@ export default { >{ ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42, ['foo'+'']: 42,} : { [x: string]: number; } ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" >42 : 42 ['foo'+'']: 42, +>['foo'+''] : number >'foo'+'' : string >'foo' : "foo" >'' : "" @@ -147,6 +170,7 @@ export default { >{ ['foo']: 42} : { ['foo']: number; } ['foo']: 42 +>['foo'] : number >'foo' : "foo" >42 : 42 diff --git a/tests/baselines/reference/exportEqualsAmd.symbols b/tests/baselines/reference/exportEqualsAmd.symbols index 0a35efe187f..6e2388b5187 100644 --- a/tests/baselines/reference/exportEqualsAmd.symbols +++ b/tests/baselines/reference/exportEqualsAmd.symbols @@ -1,4 +1,5 @@ === tests/cases/compiler/exportEqualsAmd.ts === export = { ["hi"]: "there" }; +>["hi"] : Symbol(["hi"], Decl(exportEqualsAmd.ts, 0, 10)) >"hi" : Symbol(["hi"], Decl(exportEqualsAmd.ts, 0, 10)) diff --git a/tests/baselines/reference/exportEqualsAmd.types b/tests/baselines/reference/exportEqualsAmd.types index e6f76b411cb..58ba5b051a8 100644 --- a/tests/baselines/reference/exportEqualsAmd.types +++ b/tests/baselines/reference/exportEqualsAmd.types @@ -1,6 +1,7 @@ === tests/cases/compiler/exportEqualsAmd.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } +>["hi"] : string >"hi" : "hi" >"there" : "there" diff --git a/tests/baselines/reference/exportEqualsCommonJs.symbols b/tests/baselines/reference/exportEqualsCommonJs.symbols index ce82666336d..32df108bb1e 100644 --- a/tests/baselines/reference/exportEqualsCommonJs.symbols +++ b/tests/baselines/reference/exportEqualsCommonJs.symbols @@ -1,4 +1,5 @@ === tests/cases/compiler/exportEqualsCommonJs.ts === export = { ["hi"]: "there" }; +>["hi"] : Symbol(["hi"], Decl(exportEqualsCommonJs.ts, 0, 10)) >"hi" : Symbol(["hi"], Decl(exportEqualsCommonJs.ts, 0, 10)) diff --git a/tests/baselines/reference/exportEqualsCommonJs.types b/tests/baselines/reference/exportEqualsCommonJs.types index ea0c082edff..600b139f099 100644 --- a/tests/baselines/reference/exportEqualsCommonJs.types +++ b/tests/baselines/reference/exportEqualsCommonJs.types @@ -1,6 +1,7 @@ === tests/cases/compiler/exportEqualsCommonJs.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } +>["hi"] : string >"hi" : "hi" >"there" : "there" diff --git a/tests/baselines/reference/exportEqualsUmd.symbols b/tests/baselines/reference/exportEqualsUmd.symbols index b6c669e31a3..b97aef41dc8 100644 --- a/tests/baselines/reference/exportEqualsUmd.symbols +++ b/tests/baselines/reference/exportEqualsUmd.symbols @@ -1,4 +1,5 @@ === tests/cases/compiler/exportEqualsUmd.ts === export = { ["hi"]: "there" }; +>["hi"] : Symbol(["hi"], Decl(exportEqualsUmd.ts, 0, 10)) >"hi" : Symbol(["hi"], Decl(exportEqualsUmd.ts, 0, 10)) diff --git a/tests/baselines/reference/exportEqualsUmd.types b/tests/baselines/reference/exportEqualsUmd.types index 6b3110dc2a4..528386010f2 100644 --- a/tests/baselines/reference/exportEqualsUmd.types +++ b/tests/baselines/reference/exportEqualsUmd.types @@ -1,6 +1,7 @@ === tests/cases/compiler/exportEqualsUmd.ts === export = { ["hi"]: "there" }; >{ ["hi"]: "there" } : { ["hi"]: string; } +>["hi"] : string >"hi" : "hi" >"there" : "there" diff --git a/tests/baselines/reference/for-of15.symbols b/tests/baselines/reference/for-of15.symbols index b2ca9c4f091..66b10c758e3 100644 --- a/tests/baselines/reference/for-of15.symbols +++ b/tests/baselines/reference/for-of15.symbols @@ -8,6 +8,7 @@ class StringIterator { return ""; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of15.ts, 3, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of15.types b/tests/baselines/reference/for-of15.types index 05c916df323..3ad50870a11 100644 --- a/tests/baselines/reference/for-of15.types +++ b/tests/baselines/reference/for-of15.types @@ -9,6 +9,7 @@ class StringIterator { >"" : "" } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of16.symbols b/tests/baselines/reference/for-of16.symbols index 9d3d1dee720..2dd49da7650 100644 --- a/tests/baselines/reference/for-of16.symbols +++ b/tests/baselines/reference/for-of16.symbols @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of16.ts, 0, 0)) [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of16.ts, 0, 22)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of16.types b/tests/baselines/reference/for-of16.types index 1ee39af179e..0396cf215d2 100644 --- a/tests/baselines/reference/for-of16.types +++ b/tests/baselines/reference/for-of16.types @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : StringIterator [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of17.symbols b/tests/baselines/reference/for-of17.symbols index 506c9535ed7..d47907a0cde 100644 --- a/tests/baselines/reference/for-of17.symbols +++ b/tests/baselines/reference/for-of17.symbols @@ -15,6 +15,7 @@ class NumberIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(NumberIterator[Symbol.iterator], Decl(for-of17.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of17.types b/tests/baselines/reference/for-of17.types index 2908730dd02..98768f241ba 100644 --- a/tests/baselines/reference/for-of17.types +++ b/tests/baselines/reference/for-of17.types @@ -19,6 +19,7 @@ class NumberIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of18.symbols b/tests/baselines/reference/for-of18.symbols index 8f552c2757c..d603b361b71 100644 --- a/tests/baselines/reference/for-of18.symbols +++ b/tests/baselines/reference/for-of18.symbols @@ -15,6 +15,7 @@ class StringIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of18.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of18.types b/tests/baselines/reference/for-of18.types index 8b70c446254..de784f5ec0d 100644 --- a/tests/baselines/reference/for-of18.types +++ b/tests/baselines/reference/for-of18.types @@ -19,6 +19,7 @@ class StringIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of19.symbols b/tests/baselines/reference/for-of19.symbols index f36dd74f9b9..727e2104582 100644 --- a/tests/baselines/reference/for-of19.symbols +++ b/tests/baselines/reference/for-of19.symbols @@ -19,6 +19,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(for-of19.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of19.types b/tests/baselines/reference/for-of19.types index a62b2d64c8e..2f9620e45aa 100644 --- a/tests/baselines/reference/for-of19.types +++ b/tests/baselines/reference/for-of19.types @@ -23,6 +23,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of20.symbols b/tests/baselines/reference/for-of20.symbols index 5fff9fd7871..f175ee42cdc 100644 --- a/tests/baselines/reference/for-of20.symbols +++ b/tests/baselines/reference/for-of20.symbols @@ -19,6 +19,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(for-of20.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of20.types b/tests/baselines/reference/for-of20.types index e620b603107..d94c0568992 100644 --- a/tests/baselines/reference/for-of20.types +++ b/tests/baselines/reference/for-of20.types @@ -23,6 +23,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of21.symbols b/tests/baselines/reference/for-of21.symbols index 0068c9ef4a8..0c065580972 100644 --- a/tests/baselines/reference/for-of21.symbols +++ b/tests/baselines/reference/for-of21.symbols @@ -19,6 +19,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(for-of21.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of21.types b/tests/baselines/reference/for-of21.types index 59c66b2a41e..fa6a26466d4 100644 --- a/tests/baselines/reference/for-of21.types +++ b/tests/baselines/reference/for-of21.types @@ -23,6 +23,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of22.symbols b/tests/baselines/reference/for-of22.symbols index 929cae4ed77..e2e37287f74 100644 --- a/tests/baselines/reference/for-of22.symbols +++ b/tests/baselines/reference/for-of22.symbols @@ -19,6 +19,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(for-of22.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of22.types b/tests/baselines/reference/for-of22.types index e1449875da5..7a6da8a8f60 100644 --- a/tests/baselines/reference/for-of22.types +++ b/tests/baselines/reference/for-of22.types @@ -23,6 +23,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of23.symbols b/tests/baselines/reference/for-of23.symbols index 7a57e38baf7..73de727cd73 100644 --- a/tests/baselines/reference/for-of23.symbols +++ b/tests/baselines/reference/for-of23.symbols @@ -19,6 +19,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(for-of23.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of23.types b/tests/baselines/reference/for-of23.types index 427eb57f5a1..a88b5162b50 100644 --- a/tests/baselines/reference/for-of23.types +++ b/tests/baselines/reference/for-of23.types @@ -23,6 +23,7 @@ class FooIterator { }; } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of25.symbols b/tests/baselines/reference/for-of25.symbols index e9304e517bd..18ada1e9c26 100644 --- a/tests/baselines/reference/for-of25.symbols +++ b/tests/baselines/reference/for-of25.symbols @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 0, 0)) [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of25.ts, 0, 22)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of25.types b/tests/baselines/reference/for-of25.types index 7a11b7acf67..5cc40748bb0 100644 --- a/tests/baselines/reference/for-of25.types +++ b/tests/baselines/reference/for-of25.types @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : StringIterator [Symbol.iterator]() { +>[Symbol.iterator] : () => any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of26.symbols b/tests/baselines/reference/for-of26.symbols index 20473898253..5bcebcbf22b 100644 --- a/tests/baselines/reference/for-of26.symbols +++ b/tests/baselines/reference/for-of26.symbols @@ -9,6 +9,7 @@ class StringIterator { >x : Symbol(x, Decl(for-of26.ts, 9, 3)) } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of26.ts, 3, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of26.types b/tests/baselines/reference/for-of26.types index b0cfd891741..5209b1856b3 100644 --- a/tests/baselines/reference/for-of26.types +++ b/tests/baselines/reference/for-of26.types @@ -9,6 +9,7 @@ class StringIterator { >x : any } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of27.symbols b/tests/baselines/reference/for-of27.symbols index 4799a138351..a28a0ee1052 100644 --- a/tests/baselines/reference/for-of27.symbols +++ b/tests/baselines/reference/for-of27.symbols @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 0)) [Symbol.iterator]: any; +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of27.ts, 0, 22)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of27.types b/tests/baselines/reference/for-of27.types index f6115ccf8ce..c72d306c187 100644 --- a/tests/baselines/reference/for-of27.types +++ b/tests/baselines/reference/for-of27.types @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : StringIterator [Symbol.iterator]: any; +>[Symbol.iterator] : any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of28.symbols b/tests/baselines/reference/for-of28.symbols index ad5ea53a80e..04c5ebc01fa 100644 --- a/tests/baselines/reference/for-of28.symbols +++ b/tests/baselines/reference/for-of28.symbols @@ -6,6 +6,7 @@ class StringIterator { >next : Symbol(StringIterator.next, Decl(for-of28.ts, 0, 22)) [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of28.ts, 1, 14)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of28.types b/tests/baselines/reference/for-of28.types index a454a0c4485..d1f95753722 100644 --- a/tests/baselines/reference/for-of28.types +++ b/tests/baselines/reference/for-of28.types @@ -6,6 +6,7 @@ class StringIterator { >next : any [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of29.symbols b/tests/baselines/reference/for-of29.symbols index 8327d0ac855..634240f2b57 100644 --- a/tests/baselines/reference/for-of29.symbols +++ b/tests/baselines/reference/for-of29.symbols @@ -3,6 +3,7 @@ var iterableWithOptionalIterator: { >iterableWithOptionalIterator : Symbol(iterableWithOptionalIterator, Decl(for-of29.ts, 0, 3)) [Symbol.iterator]?(): Iterator +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(for-of29.ts, 0, 35)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of29.types b/tests/baselines/reference/for-of29.types index 02c7dfe722a..23d7f986add 100644 --- a/tests/baselines/reference/for-of29.types +++ b/tests/baselines/reference/for-of29.types @@ -3,6 +3,7 @@ var iterableWithOptionalIterator: { >iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator; } [Symbol.iterator]?(): Iterator +>[Symbol.iterator] : () => Iterator >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of30.symbols b/tests/baselines/reference/for-of30.symbols index 87620251110..fe4f49cae4b 100644 --- a/tests/baselines/reference/for-of30.symbols +++ b/tests/baselines/reference/for-of30.symbols @@ -18,6 +18,7 @@ class StringIterator { >return : Symbol(StringIterator.return, Decl(for-of30.ts, 6, 5)) [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of30.ts, 8, 15)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of30.types b/tests/baselines/reference/for-of30.types index df28a0b6041..bd369223d7f 100644 --- a/tests/baselines/reference/for-of30.types +++ b/tests/baselines/reference/for-of30.types @@ -23,6 +23,7 @@ class StringIterator { >0 : 0 [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of31.symbols b/tests/baselines/reference/for-of31.symbols index b5f999db49c..a25cc8880e9 100644 --- a/tests/baselines/reference/for-of31.symbols +++ b/tests/baselines/reference/for-of31.symbols @@ -13,6 +13,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of31.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of31.types b/tests/baselines/reference/for-of31.types index 8a64a9f1ffa..843ce928c44 100644 --- a/tests/baselines/reference/for-of31.types +++ b/tests/baselines/reference/for-of31.types @@ -16,6 +16,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of33.symbols b/tests/baselines/reference/for-of33.symbols index e77d3b31c76..8dfdd516d3f 100644 --- a/tests/baselines/reference/for-of33.symbols +++ b/tests/baselines/reference/for-of33.symbols @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of33.ts, 0, 0)) [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of33.ts, 0, 22)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of33.types b/tests/baselines/reference/for-of33.types index d887169c27a..1410ee06535 100644 --- a/tests/baselines/reference/for-of33.types +++ b/tests/baselines/reference/for-of33.types @@ -3,6 +3,7 @@ class StringIterator { >StringIterator : StringIterator [Symbol.iterator]() { +>[Symbol.iterator] : () => any >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of34.symbols b/tests/baselines/reference/for-of34.symbols index 864e250ad49..58949e02cec 100644 --- a/tests/baselines/reference/for-of34.symbols +++ b/tests/baselines/reference/for-of34.symbols @@ -10,6 +10,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of34.ts, 3, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of34.types b/tests/baselines/reference/for-of34.types index 765d829d942..5a4287e7843 100644 --- a/tests/baselines/reference/for-of34.types +++ b/tests/baselines/reference/for-of34.types @@ -10,6 +10,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/for-of35.symbols b/tests/baselines/reference/for-of35.symbols index b1f48ba3afb..93fe9cfe6b5 100644 --- a/tests/baselines/reference/for-of35.symbols +++ b/tests/baselines/reference/for-of35.symbols @@ -16,6 +16,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of35.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of35.types b/tests/baselines/reference/for-of35.types index ac022f7e02c..0c80a6633b2 100644 --- a/tests/baselines/reference/for-of35.types +++ b/tests/baselines/reference/for-of35.types @@ -19,6 +19,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/generatorES6_6.symbols b/tests/baselines/reference/generatorES6_6.symbols index e277757e98d..79a3c4c056f 100644 --- a/tests/baselines/reference/generatorES6_6.symbols +++ b/tests/baselines/reference/generatorES6_6.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(generatorES6_6.ts, 0, 0)) *[Symbol.iterator]() { +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(generatorES6_6.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/generatorES6_6.types b/tests/baselines/reference/generatorES6_6.types index 6f50181d0ef..7306b6ed99a 100644 --- a/tests/baselines/reference/generatorES6_6.types +++ b/tests/baselines/reference/generatorES6_6.types @@ -3,6 +3,7 @@ class C { >C : C *[Symbol.iterator]() { +>[Symbol.iterator] : () => IterableIterator >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/generatorTypeCheck28.symbols b/tests/baselines/reference/generatorTypeCheck28.symbols index c07d0819244..6992ac8bf0d 100644 --- a/tests/baselines/reference/generatorTypeCheck28.symbols +++ b/tests/baselines/reference/generatorTypeCheck28.symbols @@ -6,6 +6,7 @@ function* g(): IterableIterator<(x: string) => number> { yield * { *[Symbol.iterator]() { +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(generatorTypeCheck28.ts, 1, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/generatorTypeCheck28.types b/tests/baselines/reference/generatorTypeCheck28.types index 1afae072758..fcbae6b76c8 100644 --- a/tests/baselines/reference/generatorTypeCheck28.types +++ b/tests/baselines/reference/generatorTypeCheck28.types @@ -9,6 +9,7 @@ function* g(): IterableIterator<(x: string) => number> { >{ *[Symbol.iterator]() { yield x => x.length; } } : { [Symbol.iterator](): IterableIterator<(x: string) => number>; } *[Symbol.iterator]() { +>[Symbol.iterator] : () => IterableIterator<(x: string) => number> >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/generatorTypeCheck41.symbols b/tests/baselines/reference/generatorTypeCheck41.symbols index 9111affa875..ff57fa24c75 100644 --- a/tests/baselines/reference/generatorTypeCheck41.symbols +++ b/tests/baselines/reference/generatorTypeCheck41.symbols @@ -6,5 +6,6 @@ function* g() { >x : Symbol(x, Decl(generatorTypeCheck41.ts, 1, 7)) [yield 0]: 0 +>[yield 0] : Symbol([yield 0], Decl(generatorTypeCheck41.ts, 1, 13)) } } diff --git a/tests/baselines/reference/generatorTypeCheck41.types b/tests/baselines/reference/generatorTypeCheck41.types index 8e59ce18860..5f20d017655 100644 --- a/tests/baselines/reference/generatorTypeCheck41.types +++ b/tests/baselines/reference/generatorTypeCheck41.types @@ -7,6 +7,7 @@ function* g() { >{ [yield 0]: 0 } : { [x: number]: number; } [yield 0]: 0 +>[yield 0] : number >yield 0 : any >0 : 0 >0 : 0 diff --git a/tests/baselines/reference/generatorTypeCheck42.symbols b/tests/baselines/reference/generatorTypeCheck42.symbols index a49534fd211..84ccc637247 100644 --- a/tests/baselines/reference/generatorTypeCheck42.symbols +++ b/tests/baselines/reference/generatorTypeCheck42.symbols @@ -6,6 +6,7 @@ function* g() { >x : Symbol(x, Decl(generatorTypeCheck42.ts, 1, 7)) [yield 0]() { +>[yield 0] : Symbol([yield 0], Decl(generatorTypeCheck42.ts, 1, 13)) } } diff --git a/tests/baselines/reference/generatorTypeCheck42.types b/tests/baselines/reference/generatorTypeCheck42.types index f7281d60afe..47d948739f1 100644 --- a/tests/baselines/reference/generatorTypeCheck42.types +++ b/tests/baselines/reference/generatorTypeCheck42.types @@ -7,6 +7,7 @@ function* g() { >{ [yield 0]() { } } : { [x: number]: () => void; } [yield 0]() { +>[yield 0] : () => void >yield 0 : any >0 : 0 diff --git a/tests/baselines/reference/generatorTypeCheck43.symbols b/tests/baselines/reference/generatorTypeCheck43.symbols index f5f7b6c359f..93c8cce4a04 100644 --- a/tests/baselines/reference/generatorTypeCheck43.symbols +++ b/tests/baselines/reference/generatorTypeCheck43.symbols @@ -6,6 +6,7 @@ function* g() { >x : Symbol(x, Decl(generatorTypeCheck43.ts, 1, 7)) *[yield 0]() { +>[yield 0] : Symbol([yield 0], Decl(generatorTypeCheck43.ts, 1, 13)) } } diff --git a/tests/baselines/reference/generatorTypeCheck43.types b/tests/baselines/reference/generatorTypeCheck43.types index 3e8ec02672a..298c631728e 100644 --- a/tests/baselines/reference/generatorTypeCheck43.types +++ b/tests/baselines/reference/generatorTypeCheck43.types @@ -7,6 +7,7 @@ function* g() { >{ *[yield 0]() { } } : { [x: number]: () => IterableIterator; } *[yield 0]() { +>[yield 0] : () => IterableIterator >yield 0 : any >0 : 0 diff --git a/tests/baselines/reference/generatorTypeCheck44.symbols b/tests/baselines/reference/generatorTypeCheck44.symbols index b6606064c43..f9ed4bc2130 100644 --- a/tests/baselines/reference/generatorTypeCheck44.symbols +++ b/tests/baselines/reference/generatorTypeCheck44.symbols @@ -6,6 +6,8 @@ function* g() { >x : Symbol(x, Decl(generatorTypeCheck44.ts, 1, 7)) get [yield 0]() { +>[yield 0] : Symbol([yield 0], Decl(generatorTypeCheck44.ts, 1, 13)) + return 0; } } diff --git a/tests/baselines/reference/generatorTypeCheck44.types b/tests/baselines/reference/generatorTypeCheck44.types index 381feb30f3c..38b335f1ab4 100644 --- a/tests/baselines/reference/generatorTypeCheck44.types +++ b/tests/baselines/reference/generatorTypeCheck44.types @@ -7,6 +7,7 @@ function* g() { >{ get [yield 0]() { return 0; } } : { [x: number]: number; } get [yield 0]() { +>[yield 0] : number >yield 0 : any >0 : 0 diff --git a/tests/baselines/reference/generatorTypeCheck46.symbols b/tests/baselines/reference/generatorTypeCheck46.symbols index e2a10557c86..571678bc29d 100644 --- a/tests/baselines/reference/generatorTypeCheck46.symbols +++ b/tests/baselines/reference/generatorTypeCheck46.symbols @@ -21,6 +21,7 @@ foo("", function* () { yield* { *[Symbol.iterator]() { +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(generatorTypeCheck46.ts, 3, 12)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/generatorTypeCheck46.types b/tests/baselines/reference/generatorTypeCheck46.types index c69ae0881da..ea96133000c 100644 --- a/tests/baselines/reference/generatorTypeCheck46.types +++ b/tests/baselines/reference/generatorTypeCheck46.types @@ -27,6 +27,7 @@ foo("", function* () { >{ *[Symbol.iterator]() { yield x => x.length } } : { [Symbol.iterator](): IterableIterator<(x: string) => number>; } *[Symbol.iterator]() { +>[Symbol.iterator] : () => IterableIterator<(x: string) => number> >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/generatorTypeCheck56.symbols b/tests/baselines/reference/generatorTypeCheck56.symbols index c9961f5671e..8a56bdf24cf 100644 --- a/tests/baselines/reference/generatorTypeCheck56.symbols +++ b/tests/baselines/reference/generatorTypeCheck56.symbols @@ -7,6 +7,8 @@ function* g() { >C : Symbol(C, Decl(generatorTypeCheck56.ts, 1, 11)) *[yield 0]() { +>[yield 0] : Symbol(C[yield 0], Decl(generatorTypeCheck56.ts, 1, 21)) + yield 0; } }; diff --git a/tests/baselines/reference/generatorTypeCheck56.types b/tests/baselines/reference/generatorTypeCheck56.types index b05b35ad756..718e5d0d792 100644 --- a/tests/baselines/reference/generatorTypeCheck56.types +++ b/tests/baselines/reference/generatorTypeCheck56.types @@ -8,6 +8,7 @@ function* g() { >C : typeof C *[yield 0]() { +>[yield 0] : () => IterableIterator >yield 0 : any >0 : 0 diff --git a/tests/baselines/reference/giant.symbols b/tests/baselines/reference/giant.symbols index 4914b92a8c2..73341d014dd 100644 --- a/tests/baselines/reference/giant.symbols +++ b/tests/baselines/reference/giant.symbols @@ -133,6 +133,8 @@ interface I { //Index Signature [p]; +>[p] : Symbol(I[p], Decl(giant.ts, 56, 35)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 60, 5)) @@ -298,6 +300,8 @@ module M { //Index Signature [p]; +>[p] : Symbol(I[p], Decl(giant.ts, 120, 39)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 124, 9)) @@ -505,6 +509,8 @@ module M { //Index Signature [p]; +>[p] : Symbol(eI[p], Decl(giant.ts, 199, 39)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 203, 9)) @@ -816,6 +822,8 @@ export interface eI { //Index Signature [p]; +>[p] : Symbol(eI[p], Decl(giant.ts, 314, 35)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 318, 5)) @@ -981,6 +989,8 @@ export module eM { //Index Signature [p]; +>[p] : Symbol(I[p], Decl(giant.ts, 378, 39)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 382, 9)) @@ -1188,6 +1198,8 @@ export module eM { //Index Signature [p]; +>[p] : Symbol(eI[p], Decl(giant.ts, 457, 39)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 461, 9)) @@ -1524,6 +1536,8 @@ export declare module eaM { //Index Signature [p]; +>[p] : Symbol(I[p], Decl(giant.ts, 582, 39)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 586, 9)) @@ -1686,6 +1700,8 @@ export declare module eaM { //Index Signature [p]; +>[p] : Symbol(eI[p], Decl(giant.ts, 648, 39)) + [p1: string]; >p1 : Symbol(p1, Decl(giant.ts, 652, 9)) diff --git a/tests/baselines/reference/giant.types b/tests/baselines/reference/giant.types index 4be80c4b729..b571ea79b81 100644 --- a/tests/baselines/reference/giant.types +++ b/tests/baselines/reference/giant.types @@ -133,6 +133,7 @@ interface I { //Index Signature [p]; +>[p] : any >p : any [p1: string]; @@ -300,6 +301,7 @@ module M { //Index Signature [p]; +>[p] : any >p : any [p1: string]; @@ -509,6 +511,7 @@ module M { //Index Signature [p]; +>[p] : any >p : any [p1: string]; @@ -822,6 +825,7 @@ export interface eI { //Index Signature [p]; +>[p] : any >p : any [p1: string]; @@ -989,6 +993,7 @@ export module eM { //Index Signature [p]; +>[p] : any >p : any [p1: string]; @@ -1198,6 +1203,7 @@ export module eM { //Index Signature [p]; +>[p] : any >p : any [p1: string]; @@ -1536,6 +1542,7 @@ export declare module eaM { //Index Signature [p]; +>[p] : any >p : any [p1: string]; @@ -1700,6 +1707,7 @@ export declare module eaM { //Index Signature [p]; +>[p] : any >p : any [p1: string]; diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.symbols b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.symbols index cbdba17b213..84b3f74479b 100644 --- a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.symbols +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.symbols @@ -4,6 +4,8 @@ interface I { // Used to be indexer, now it is a computed property [x]: string; +>[x] : Symbol(I[x], Decl(indexSignatureMustHaveTypeAnnotation.ts, 0, 13)) + [x: string]; >x : Symbol(x, Decl(indexSignatureMustHaveTypeAnnotation.ts, 3, 5)) } @@ -13,6 +15,7 @@ class C { // Used to be indexer, now it is a computed property [x]: string +>[x] : Symbol(C[x], Decl(indexSignatureMustHaveTypeAnnotation.ts, 6, 9)) } diff --git a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.types b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.types index 663663c2de3..f189db1bb47 100644 --- a/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.types +++ b/tests/baselines/reference/indexSignatureMustHaveTypeAnnotation.types @@ -4,6 +4,7 @@ interface I { // Used to be indexer, now it is a computed property [x]: string; +>[x] : string >x : any [x: string]; @@ -15,6 +16,7 @@ class C { // Used to be indexer, now it is a computed property [x]: string +>[x] : string >x : any } diff --git a/tests/baselines/reference/indexSignatureWithInitializer.symbols b/tests/baselines/reference/indexSignatureWithInitializer.symbols index 12baa461d9a..2d5760457c0 100644 --- a/tests/baselines/reference/indexSignatureWithInitializer.symbols +++ b/tests/baselines/reference/indexSignatureWithInitializer.symbols @@ -4,10 +4,12 @@ interface I { >I : Symbol(I, Decl(indexSignatureWithInitializer.ts, 0, 0)) [x = '']: string; +>[x = ''] : Symbol(I[x = ''], Decl(indexSignatureWithInitializer.ts, 1, 13)) } class C { >C : Symbol(C, Decl(indexSignatureWithInitializer.ts, 3, 1)) [x = 0]: string +>[x = 0] : Symbol(C[x = 0], Decl(indexSignatureWithInitializer.ts, 5, 9)) } diff --git a/tests/baselines/reference/indexSignatureWithInitializer.types b/tests/baselines/reference/indexSignatureWithInitializer.types index 23d4fd4f072..8955838c22e 100644 --- a/tests/baselines/reference/indexSignatureWithInitializer.types +++ b/tests/baselines/reference/indexSignatureWithInitializer.types @@ -4,6 +4,7 @@ interface I { >I : I [x = '']: string; +>[x = ''] : string >x = '' : "" >x : any >'' : "" @@ -13,6 +14,7 @@ class C { >C : C [x = 0]: string +>[x = 0] : string >x = 0 : 0 >x : any >0 : 0 diff --git a/tests/baselines/reference/indexWithoutParamType2.symbols b/tests/baselines/reference/indexWithoutParamType2.symbols index 86adea49af2..eca3351ecd7 100644 --- a/tests/baselines/reference/indexWithoutParamType2.symbols +++ b/tests/baselines/reference/indexWithoutParamType2.symbols @@ -4,4 +4,5 @@ class C { // Used to be indexer, now it is a computed property [x]: string +>[x] : Symbol(C[x], Decl(indexWithoutParamType2.ts, 0, 9)) } diff --git a/tests/baselines/reference/indexWithoutParamType2.types b/tests/baselines/reference/indexWithoutParamType2.types index 14af8c02ae5..ff3d51ddc1e 100644 --- a/tests/baselines/reference/indexWithoutParamType2.types +++ b/tests/baselines/reference/indexWithoutParamType2.types @@ -4,5 +4,6 @@ class C { // Used to be indexer, now it is a computed property [x]: string +>[x] : string >x : any } diff --git a/tests/baselines/reference/intTypeCheck.symbols b/tests/baselines/reference/intTypeCheck.symbols index 899808029a7..181387014b7 100644 --- a/tests/baselines/reference/intTypeCheck.symbols +++ b/tests/baselines/reference/intTypeCheck.symbols @@ -84,6 +84,8 @@ interface i4 { // Used to be indexer, now it is a computed property [p]; +>[p] : Symbol(i4[p], Decl(intTypeCheck.ts, 32, 14)) + //Index Signatures [p1: string]; >p1 : Symbol(p1, Decl(intTypeCheck.ts, 36, 5)) @@ -166,6 +168,8 @@ interface i11 { // Used to be indexer, now it is a computed property [p]; +>[p] : Symbol(i11[p], Decl(intTypeCheck.ts, 67, 35)) + //Index Signatures [p1: string]; >p1 : Symbol(p1, Decl(intTypeCheck.ts, 72, 5)) diff --git a/tests/baselines/reference/intTypeCheck.types b/tests/baselines/reference/intTypeCheck.types index c79a8b7964f..6ea141c1778 100644 --- a/tests/baselines/reference/intTypeCheck.types +++ b/tests/baselines/reference/intTypeCheck.types @@ -84,6 +84,7 @@ interface i4 { // Used to be indexer, now it is a computed property [p]; +>[p] : any >p : any //Index Signatures @@ -168,6 +169,7 @@ interface i11 { // Used to be indexer, now it is a computed property [p]; +>[p] : any >p : any //Index Signatures diff --git a/tests/baselines/reference/intersectionTypeInference3.symbols b/tests/baselines/reference/intersectionTypeInference3.symbols index 3945cf64fb6..c474f16b71a 100644 --- a/tests/baselines/reference/intersectionTypeInference3.symbols +++ b/tests/baselines/reference/intersectionTypeInference3.symbols @@ -8,6 +8,7 @@ type Nominal = Type & { >Type : Symbol(Type, Decl(intersectionTypeInference3.ts, 2, 33)) [Symbol.species]: Kind; +>[Symbol.species] : Symbol([Symbol.species], Decl(intersectionTypeInference3.ts, 2, 50)) >Symbol.species : Symbol(SymbolConstructor.species, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >species : Symbol(SymbolConstructor.species, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/intersectionTypeInference3.types b/tests/baselines/reference/intersectionTypeInference3.types index 6239792f53d..aa9e74b9b3d 100644 --- a/tests/baselines/reference/intersectionTypeInference3.types +++ b/tests/baselines/reference/intersectionTypeInference3.types @@ -8,6 +8,7 @@ type Nominal = Type & { >Type : Type [Symbol.species]: Kind; +>[Symbol.species] : Kind >Symbol.species : symbol >Symbol : SymbolConstructor >species : symbol diff --git a/tests/baselines/reference/invalidNewTarget.es5.symbols b/tests/baselines/reference/invalidNewTarget.es5.symbols index 14723669515..3d2edce0d73 100644 --- a/tests/baselines/reference/invalidNewTarget.es5.symbols +++ b/tests/baselines/reference/invalidNewTarget.es5.symbols @@ -9,6 +9,8 @@ class C { >C : Symbol(C, Decl(invalidNewTarget.es5.ts, 1, 27)) [new.target]() { } +>[new.target] : Symbol(C[new.target], Decl(invalidNewTarget.es5.ts, 3, 9)) + c() { return new.target; } >c : Symbol(C.c, Decl(invalidNewTarget.es5.ts, 4, 22)) @@ -24,6 +26,8 @@ class C { >f : Symbol(C.f, Decl(invalidNewTarget.es5.ts, 7, 32)) static [new.target]() { } +>[new.target] : Symbol(C[new.target], Decl(invalidNewTarget.es5.ts, 8, 25)) + static g() { return new.target; } >g : Symbol(C.g, Decl(invalidNewTarget.es5.ts, 10, 29)) @@ -43,6 +47,7 @@ const O = { >O : Symbol(O, Decl(invalidNewTarget.es5.ts, 17, 5)) [new.target]: undefined, +>[new.target] : Symbol([new.target], Decl(invalidNewTarget.es5.ts, 17, 11)) >undefined : Symbol(undefined) k() { return new.target; }, diff --git a/tests/baselines/reference/invalidNewTarget.es5.types b/tests/baselines/reference/invalidNewTarget.es5.types index 89dd7d9a15e..5a7703b6844 100644 --- a/tests/baselines/reference/invalidNewTarget.es5.types +++ b/tests/baselines/reference/invalidNewTarget.es5.types @@ -14,6 +14,7 @@ class C { >C : C [new.target]() { } +>[new.target] : () => void >new.target : any >target : any @@ -42,6 +43,7 @@ class C { >target : any static [new.target]() { } +>[new.target] : () => void >new.target : any >target : any @@ -75,6 +77,7 @@ const O = { >{ [new.target]: undefined, k() { return new.target; }, get l() { return new.target; }, set m(_) { _ = new.target; }, n: new.target,} : { [x: number]: undefined; k(): any; readonly l: any; m: any; n: any; } [new.target]: undefined, +>[new.target] : undefined >new.target : any >target : any >undefined : undefined diff --git a/tests/baselines/reference/invalidNewTarget.es6.symbols b/tests/baselines/reference/invalidNewTarget.es6.symbols index 4a85357cdb6..c045859f3d3 100644 --- a/tests/baselines/reference/invalidNewTarget.es6.symbols +++ b/tests/baselines/reference/invalidNewTarget.es6.symbols @@ -9,6 +9,8 @@ class C { >C : Symbol(C, Decl(invalidNewTarget.es6.ts, 1, 27)) [new.target]() { } +>[new.target] : Symbol(C[new.target], Decl(invalidNewTarget.es6.ts, 3, 9)) + c() { return new.target; } >c : Symbol(C.c, Decl(invalidNewTarget.es6.ts, 4, 22)) @@ -24,6 +26,8 @@ class C { >f : Symbol(C.f, Decl(invalidNewTarget.es6.ts, 7, 32)) static [new.target]() { } +>[new.target] : Symbol(C[new.target], Decl(invalidNewTarget.es6.ts, 8, 25)) + static g() { return new.target; } >g : Symbol(C.g, Decl(invalidNewTarget.es6.ts, 10, 29)) @@ -43,6 +47,7 @@ const O = { >O : Symbol(O, Decl(invalidNewTarget.es6.ts, 17, 5)) [new.target]: undefined, +>[new.target] : Symbol([new.target], Decl(invalidNewTarget.es6.ts, 17, 11)) >undefined : Symbol(undefined) k() { return new.target; }, diff --git a/tests/baselines/reference/invalidNewTarget.es6.types b/tests/baselines/reference/invalidNewTarget.es6.types index 581adb42884..a7690f4cbbc 100644 --- a/tests/baselines/reference/invalidNewTarget.es6.types +++ b/tests/baselines/reference/invalidNewTarget.es6.types @@ -14,6 +14,7 @@ class C { >C : C [new.target]() { } +>[new.target] : () => void >new.target : any >target : any @@ -42,6 +43,7 @@ class C { >target : any static [new.target]() { } +>[new.target] : () => void >new.target : any >target : any @@ -75,6 +77,7 @@ const O = { >{ [new.target]: undefined, k() { return new.target; }, get l() { return new.target; }, set m(_) { _ = new.target; }, n: new.target,} : { [x: number]: undefined; k(): any; readonly l: any; m: any; n: any; } [new.target]: undefined, +>[new.target] : undefined >new.target : any >target : any >undefined : undefined diff --git a/tests/baselines/reference/iterableArrayPattern1.symbols b/tests/baselines/reference/iterableArrayPattern1.symbols index b901b43b7b9..4fae8949f61 100644 --- a/tests/baselines/reference/iterableArrayPattern1.symbols +++ b/tests/baselines/reference/iterableArrayPattern1.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iterableArrayPattern1.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern1.types b/tests/baselines/reference/iterableArrayPattern1.types index e7d307b2cb9..8bdf0ebc6ed 100644 --- a/tests/baselines/reference/iterableArrayPattern1.types +++ b/tests/baselines/reference/iterableArrayPattern1.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern10.symbols b/tests/baselines/reference/iterableArrayPattern10.symbols index 12f5c1b3cb7..460f0020ffc 100644 --- a/tests/baselines/reference/iterableArrayPattern10.symbols +++ b/tests/baselines/reference/iterableArrayPattern10.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern10.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern10.types b/tests/baselines/reference/iterableArrayPattern10.types index 821f809f966..2ae11652898 100644 --- a/tests/baselines/reference/iterableArrayPattern10.types +++ b/tests/baselines/reference/iterableArrayPattern10.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern11.symbols b/tests/baselines/reference/iterableArrayPattern11.symbols index 36871283fbf..01f4e96760c 100644 --- a/tests/baselines/reference/iterableArrayPattern11.symbols +++ b/tests/baselines/reference/iterableArrayPattern11.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern11.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern11.types b/tests/baselines/reference/iterableArrayPattern11.types index d3fa43d2f1b..6c9f384aa4f 100644 --- a/tests/baselines/reference/iterableArrayPattern11.types +++ b/tests/baselines/reference/iterableArrayPattern11.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern12.symbols b/tests/baselines/reference/iterableArrayPattern12.symbols index cb876370876..fdf8a000d17 100644 --- a/tests/baselines/reference/iterableArrayPattern12.symbols +++ b/tests/baselines/reference/iterableArrayPattern12.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern12.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern12.types b/tests/baselines/reference/iterableArrayPattern12.types index 3c50058b3e0..d55d2f2fecb 100644 --- a/tests/baselines/reference/iterableArrayPattern12.types +++ b/tests/baselines/reference/iterableArrayPattern12.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern13.symbols b/tests/baselines/reference/iterableArrayPattern13.symbols index 25241ab24b8..b3acd8a8ef8 100644 --- a/tests/baselines/reference/iterableArrayPattern13.symbols +++ b/tests/baselines/reference/iterableArrayPattern13.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern13.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern13.types b/tests/baselines/reference/iterableArrayPattern13.types index 724a0795efa..b97e9551372 100644 --- a/tests/baselines/reference/iterableArrayPattern13.types +++ b/tests/baselines/reference/iterableArrayPattern13.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern14.symbols b/tests/baselines/reference/iterableArrayPattern14.symbols index 7479c8f0857..900b4d306fc 100644 --- a/tests/baselines/reference/iterableArrayPattern14.symbols +++ b/tests/baselines/reference/iterableArrayPattern14.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern14.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern14.types b/tests/baselines/reference/iterableArrayPattern14.types index 5863053d757..fcea515d543 100644 --- a/tests/baselines/reference/iterableArrayPattern14.types +++ b/tests/baselines/reference/iterableArrayPattern14.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern15.symbols b/tests/baselines/reference/iterableArrayPattern15.symbols index 98a1c9e5c5d..49cbb49336d 100644 --- a/tests/baselines/reference/iterableArrayPattern15.symbols +++ b/tests/baselines/reference/iterableArrayPattern15.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern15.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern15.types b/tests/baselines/reference/iterableArrayPattern15.types index 351406f7c20..7c553927a91 100644 --- a/tests/baselines/reference/iterableArrayPattern15.types +++ b/tests/baselines/reference/iterableArrayPattern15.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern16.symbols b/tests/baselines/reference/iterableArrayPattern16.symbols index 59b8ee70562..41f495a12a2 100644 --- a/tests/baselines/reference/iterableArrayPattern16.symbols +++ b/tests/baselines/reference/iterableArrayPattern16.symbols @@ -37,6 +37,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern16.ts, 10, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -64,6 +65,7 @@ class FooIteratorIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIteratorIterator[Symbol.iterator], Decl(iterableArrayPattern16.ts, 23, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern16.types b/tests/baselines/reference/iterableArrayPattern16.types index 927b293376e..a2b0c9a0b67 100644 --- a/tests/baselines/reference/iterableArrayPattern16.types +++ b/tests/baselines/reference/iterableArrayPattern16.types @@ -44,6 +44,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -75,6 +76,7 @@ class FooIteratorIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern17.symbols b/tests/baselines/reference/iterableArrayPattern17.symbols index 1312aded6a1..e01041acfb7 100644 --- a/tests/baselines/reference/iterableArrayPattern17.symbols +++ b/tests/baselines/reference/iterableArrayPattern17.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern17.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern17.types b/tests/baselines/reference/iterableArrayPattern17.types index 39ff8497536..3163269bf8b 100644 --- a/tests/baselines/reference/iterableArrayPattern17.types +++ b/tests/baselines/reference/iterableArrayPattern17.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern18.symbols b/tests/baselines/reference/iterableArrayPattern18.symbols index c928f068c65..dd4e8c6fdaf 100644 --- a/tests/baselines/reference/iterableArrayPattern18.symbols +++ b/tests/baselines/reference/iterableArrayPattern18.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern18.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern18.types b/tests/baselines/reference/iterableArrayPattern18.types index 18fb3e6345a..1a84ee4af96 100644 --- a/tests/baselines/reference/iterableArrayPattern18.types +++ b/tests/baselines/reference/iterableArrayPattern18.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern19.symbols b/tests/baselines/reference/iterableArrayPattern19.symbols index 9d5caeb43d5..a2d9c095095 100644 --- a/tests/baselines/reference/iterableArrayPattern19.symbols +++ b/tests/baselines/reference/iterableArrayPattern19.symbols @@ -26,6 +26,7 @@ class FooArrayIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooArrayIterator[Symbol.iterator], Decl(iterableArrayPattern19.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern19.types b/tests/baselines/reference/iterableArrayPattern19.types index 06556344186..dfd45e4a189 100644 --- a/tests/baselines/reference/iterableArrayPattern19.types +++ b/tests/baselines/reference/iterableArrayPattern19.types @@ -31,6 +31,7 @@ class FooArrayIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern2.symbols b/tests/baselines/reference/iterableArrayPattern2.symbols index db700cdd572..43ea2ba8945 100644 --- a/tests/baselines/reference/iterableArrayPattern2.symbols +++ b/tests/baselines/reference/iterableArrayPattern2.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iterableArrayPattern2.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern2.types b/tests/baselines/reference/iterableArrayPattern2.types index 6a1bc9eb6f0..2dfab111579 100644 --- a/tests/baselines/reference/iterableArrayPattern2.types +++ b/tests/baselines/reference/iterableArrayPattern2.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern20.symbols b/tests/baselines/reference/iterableArrayPattern20.symbols index 6649bf547cf..d93a46a1a0f 100644 --- a/tests/baselines/reference/iterableArrayPattern20.symbols +++ b/tests/baselines/reference/iterableArrayPattern20.symbols @@ -26,6 +26,7 @@ class FooArrayIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooArrayIterator[Symbol.iterator], Decl(iterableArrayPattern20.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern20.types b/tests/baselines/reference/iterableArrayPattern20.types index 035f17bbc07..542402f741a 100644 --- a/tests/baselines/reference/iterableArrayPattern20.types +++ b/tests/baselines/reference/iterableArrayPattern20.types @@ -31,6 +31,7 @@ class FooArrayIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern3.symbols b/tests/baselines/reference/iterableArrayPattern3.symbols index a82c5f5e025..977b630bd1d 100644 --- a/tests/baselines/reference/iterableArrayPattern3.symbols +++ b/tests/baselines/reference/iterableArrayPattern3.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern3.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern3.types b/tests/baselines/reference/iterableArrayPattern3.types index b138c8629d4..7d79b7e2046 100644 --- a/tests/baselines/reference/iterableArrayPattern3.types +++ b/tests/baselines/reference/iterableArrayPattern3.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern4.symbols b/tests/baselines/reference/iterableArrayPattern4.symbols index 6a3526a3482..9978f316b91 100644 --- a/tests/baselines/reference/iterableArrayPattern4.symbols +++ b/tests/baselines/reference/iterableArrayPattern4.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern4.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern4.types b/tests/baselines/reference/iterableArrayPattern4.types index 1024f4c9670..92d34c9a7db 100644 --- a/tests/baselines/reference/iterableArrayPattern4.types +++ b/tests/baselines/reference/iterableArrayPattern4.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern5.symbols b/tests/baselines/reference/iterableArrayPattern5.symbols index edfcbce076d..c4858b05041 100644 --- a/tests/baselines/reference/iterableArrayPattern5.symbols +++ b/tests/baselines/reference/iterableArrayPattern5.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern5.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern5.types b/tests/baselines/reference/iterableArrayPattern5.types index f659f648eee..708d6c7631a 100644 --- a/tests/baselines/reference/iterableArrayPattern5.types +++ b/tests/baselines/reference/iterableArrayPattern5.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern6.symbols b/tests/baselines/reference/iterableArrayPattern6.symbols index 797f7770b89..6fbdb01469e 100644 --- a/tests/baselines/reference/iterableArrayPattern6.symbols +++ b/tests/baselines/reference/iterableArrayPattern6.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern6.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern6.types b/tests/baselines/reference/iterableArrayPattern6.types index 4ad3ef7fbc7..6e182385a81 100644 --- a/tests/baselines/reference/iterableArrayPattern6.types +++ b/tests/baselines/reference/iterableArrayPattern6.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern7.symbols b/tests/baselines/reference/iterableArrayPattern7.symbols index 6faf9adcf13..a65f94565c2 100644 --- a/tests/baselines/reference/iterableArrayPattern7.symbols +++ b/tests/baselines/reference/iterableArrayPattern7.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern7.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern7.types b/tests/baselines/reference/iterableArrayPattern7.types index 3f4ece940d9..4d00cb6d610 100644 --- a/tests/baselines/reference/iterableArrayPattern7.types +++ b/tests/baselines/reference/iterableArrayPattern7.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern8.symbols b/tests/baselines/reference/iterableArrayPattern8.symbols index 035b391d38b..712ab83e0e3 100644 --- a/tests/baselines/reference/iterableArrayPattern8.symbols +++ b/tests/baselines/reference/iterableArrayPattern8.symbols @@ -26,6 +26,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern8.ts, 8, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern8.types b/tests/baselines/reference/iterableArrayPattern8.types index 0b1efd76175..7d53628c82f 100644 --- a/tests/baselines/reference/iterableArrayPattern8.types +++ b/tests/baselines/reference/iterableArrayPattern8.types @@ -30,6 +30,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iterableArrayPattern9.symbols b/tests/baselines/reference/iterableArrayPattern9.symbols index d85329c4507..f1dc50aadd3 100644 --- a/tests/baselines/reference/iterableArrayPattern9.symbols +++ b/tests/baselines/reference/iterableArrayPattern9.symbols @@ -32,6 +32,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(FooIterator[Symbol.iterator], Decl(iterableArrayPattern9.ts, 9, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern9.types b/tests/baselines/reference/iterableArrayPattern9.types index b24d057f4a7..ca9ced3e787 100644 --- a/tests/baselines/reference/iterableArrayPattern9.types +++ b/tests/baselines/reference/iterableArrayPattern9.types @@ -37,6 +37,7 @@ class FooIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray.symbols b/tests/baselines/reference/iteratorSpreadInArray.symbols index 6d6656f0f71..d2ded0bac57 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray.types b/tests/baselines/reference/iteratorSpreadInArray.types index 9d43fa57b07..1b0f6954f71 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.types +++ b/tests/baselines/reference/iteratorSpreadInArray.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray10.symbols b/tests/baselines/reference/iteratorSpreadInArray10.symbols index f2aa6fab527..662a1f04690 100644 --- a/tests/baselines/reference/iteratorSpreadInArray10.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray10.symbols @@ -3,6 +3,7 @@ class SymbolIterator { >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray10.ts, 0, 0)) [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray10.ts, 0, 22)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray10.types b/tests/baselines/reference/iteratorSpreadInArray10.types index 6e1e7934a05..dd6bec4bbbd 100644 --- a/tests/baselines/reference/iteratorSpreadInArray10.types +++ b/tests/baselines/reference/iteratorSpreadInArray10.types @@ -3,6 +3,7 @@ class SymbolIterator { >SymbolIterator : SymbolIterator [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray2.symbols b/tests/baselines/reference/iteratorSpreadInArray2.symbols index 6fd22547ee6..e18fee58add 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray2.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray2.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -43,6 +44,7 @@ class NumberIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(NumberIterator[Symbol.iterator], Decl(iteratorSpreadInArray2.ts, 19, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray2.types b/tests/baselines/reference/iteratorSpreadInArray2.types index 440a2bebcf8..12eff588816 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.types +++ b/tests/baselines/reference/iteratorSpreadInArray2.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -51,6 +52,7 @@ class NumberIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray3.symbols b/tests/baselines/reference/iteratorSpreadInArray3.symbols index ff6bc66e9d3..6ffe0da1c46 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray3.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray3.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray3.types b/tests/baselines/reference/iteratorSpreadInArray3.types index b4c8f36f6de..5c32643e302 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.types +++ b/tests/baselines/reference/iteratorSpreadInArray3.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray4.symbols b/tests/baselines/reference/iteratorSpreadInArray4.symbols index 16fa1c62c6c..d187392fce0 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray4.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray4.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray4.types b/tests/baselines/reference/iteratorSpreadInArray4.types index d473416113f..a6c8a53d320 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.types +++ b/tests/baselines/reference/iteratorSpreadInArray4.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray5.symbols b/tests/baselines/reference/iteratorSpreadInArray5.symbols index 36174db94e7..4ee7a050442 100644 --- a/tests/baselines/reference/iteratorSpreadInArray5.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray5.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray5.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray5.types b/tests/baselines/reference/iteratorSpreadInArray5.types index 3c67000dae4..eac7f537f35 100644 --- a/tests/baselines/reference/iteratorSpreadInArray5.types +++ b/tests/baselines/reference/iteratorSpreadInArray5.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray6.symbols b/tests/baselines/reference/iteratorSpreadInArray6.symbols index ab01672156d..bc42b87b31d 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray6.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray6.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray6.types b/tests/baselines/reference/iteratorSpreadInArray6.types index 3fa1720de14..b964fdbca13 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.types +++ b/tests/baselines/reference/iteratorSpreadInArray6.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray7.symbols b/tests/baselines/reference/iteratorSpreadInArray7.symbols index 534741a62a6..3a0a3e2924a 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray7.symbols @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray7.ts, 6, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types index 65c34ae0a6e..9d3cf2cfa7e 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.types +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray9.symbols b/tests/baselines/reference/iteratorSpreadInArray9.symbols index a5564e9773d..c5fd010f1da 100644 --- a/tests/baselines/reference/iteratorSpreadInArray9.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray9.symbols @@ -14,6 +14,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInArray9.ts, 5, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray9.types b/tests/baselines/reference/iteratorSpreadInArray9.types index 0f79b62947c..82e4064526a 100644 --- a/tests/baselines/reference/iteratorSpreadInArray9.types +++ b/tests/baselines/reference/iteratorSpreadInArray9.types @@ -17,6 +17,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall.symbols b/tests/baselines/reference/iteratorSpreadInCall.symbols index 372fc25e8e6..b51df92debc 100644 --- a/tests/baselines/reference/iteratorSpreadInCall.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall.symbols @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall.types b/tests/baselines/reference/iteratorSpreadInCall.types index 620ee50887c..fc971f24f5e 100644 --- a/tests/baselines/reference/iteratorSpreadInCall.types +++ b/tests/baselines/reference/iteratorSpreadInCall.types @@ -25,6 +25,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall10.symbols b/tests/baselines/reference/iteratorSpreadInCall10.symbols index 3ee60f7c58f..35712423c62 100644 --- a/tests/baselines/reference/iteratorSpreadInCall10.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall10.symbols @@ -24,6 +24,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall10.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall10.types b/tests/baselines/reference/iteratorSpreadInCall10.types index 0ccb1f94ff7..373f5c24a0a 100644 --- a/tests/baselines/reference/iteratorSpreadInCall10.types +++ b/tests/baselines/reference/iteratorSpreadInCall10.types @@ -30,6 +30,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall11.symbols b/tests/baselines/reference/iteratorSpreadInCall11.symbols index b6db07942d0..5e00ad35748 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall11.symbols @@ -24,6 +24,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall11.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall11.types b/tests/baselines/reference/iteratorSpreadInCall11.types index 4a3d73d36d0..2407ba1c4a5 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.types +++ b/tests/baselines/reference/iteratorSpreadInCall11.types @@ -30,6 +30,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall12.symbols b/tests/baselines/reference/iteratorSpreadInCall12.symbols index 983ab8fcd90..29ca719f1ff 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall12.symbols @@ -26,6 +26,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall12.ts, 10, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -52,6 +53,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall12.ts, 23, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall12.types b/tests/baselines/reference/iteratorSpreadInCall12.types index 55986b57645..e346ea0f358 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.types +++ b/tests/baselines/reference/iteratorSpreadInCall12.types @@ -30,6 +30,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -60,6 +61,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall2.symbols b/tests/baselines/reference/iteratorSpreadInCall2.symbols index bf0f71c4fd5..11f813114b8 100644 --- a/tests/baselines/reference/iteratorSpreadInCall2.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall2.symbols @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall2.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall2.types b/tests/baselines/reference/iteratorSpreadInCall2.types index d9b67c3e36b..4ffcf0b01de 100644 --- a/tests/baselines/reference/iteratorSpreadInCall2.types +++ b/tests/baselines/reference/iteratorSpreadInCall2.types @@ -25,6 +25,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall3.symbols b/tests/baselines/reference/iteratorSpreadInCall3.symbols index d8f414bcd72..3ed37b9e44b 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall3.symbols @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall3.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall3.types b/tests/baselines/reference/iteratorSpreadInCall3.types index fef9f7dcab7..8c629fc2d76 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.types +++ b/tests/baselines/reference/iteratorSpreadInCall3.types @@ -25,6 +25,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall4.symbols b/tests/baselines/reference/iteratorSpreadInCall4.symbols index b811baa0083..0433c25bd9c 100644 --- a/tests/baselines/reference/iteratorSpreadInCall4.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall4.symbols @@ -22,6 +22,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall4.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall4.types b/tests/baselines/reference/iteratorSpreadInCall4.types index 483bcf5bce5..56968f87094 100644 --- a/tests/baselines/reference/iteratorSpreadInCall4.types +++ b/tests/baselines/reference/iteratorSpreadInCall4.types @@ -26,6 +26,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall5.symbols b/tests/baselines/reference/iteratorSpreadInCall5.symbols index 81143b79f29..2049635efc8 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall5.symbols @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall5.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -47,6 +48,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall5.ts, 20, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall5.types b/tests/baselines/reference/iteratorSpreadInCall5.types index a4f16829d52..5d70581cacb 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.types +++ b/tests/baselines/reference/iteratorSpreadInCall5.types @@ -25,6 +25,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -55,6 +56,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall6.symbols b/tests/baselines/reference/iteratorSpreadInCall6.symbols index d41a3fcea46..b2d84110f1e 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall6.symbols @@ -21,6 +21,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall6.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -47,6 +48,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall6.ts, 20, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall6.types b/tests/baselines/reference/iteratorSpreadInCall6.types index 0f2daf9b176..6a040d25e6d 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.types +++ b/tests/baselines/reference/iteratorSpreadInCall6.types @@ -25,6 +25,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -55,6 +56,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall7.symbols b/tests/baselines/reference/iteratorSpreadInCall7.symbols index a0e62299ae9..55a36c4a17d 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall7.symbols @@ -24,6 +24,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall7.ts, 7, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -50,6 +51,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall7.ts, 20, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall7.types b/tests/baselines/reference/iteratorSpreadInCall7.types index cd3661a691e..953ee50c8d9 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.types +++ b/tests/baselines/reference/iteratorSpreadInCall7.types @@ -30,6 +30,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -60,6 +61,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall8.symbols b/tests/baselines/reference/iteratorSpreadInCall8.symbols index bd84d77686e..d04e31b26a4 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall8.symbols @@ -26,6 +26,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall8.ts, 10, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -52,6 +53,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall8.ts, 23, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall8.types b/tests/baselines/reference/iteratorSpreadInCall8.types index 7dc0b536831..ea404bdde5b 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.types +++ b/tests/baselines/reference/iteratorSpreadInCall8.types @@ -30,6 +30,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -60,6 +61,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInCall9.symbols b/tests/baselines/reference/iteratorSpreadInCall9.symbols index 70486768d4d..d93905c7bf5 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall9.symbols @@ -26,6 +26,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(SymbolIterator[Symbol.iterator], Decl(iteratorSpreadInCall9.ts, 10, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -52,6 +53,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(iteratorSpreadInCall9.ts, 23, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInCall9.types b/tests/baselines/reference/iteratorSpreadInCall9.types index 1827982449b..270db4cd3cf 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.types +++ b/tests/baselines/reference/iteratorSpreadInCall9.types @@ -30,6 +30,7 @@ class SymbolIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -60,6 +61,7 @@ class StringIterator { } [Symbol.iterator]() { +>[Symbol.iterator] : () => this >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/literalsInComputedProperties1.symbols b/tests/baselines/reference/literalsInComputedProperties1.symbols index 6a384b6f70c..81f28b87631 100644 --- a/tests/baselines/reference/literalsInComputedProperties1.symbols +++ b/tests/baselines/reference/literalsInComputedProperties1.symbols @@ -6,12 +6,14 @@ let x = { >1 : Symbol(1, Decl(literalsInComputedProperties1.ts, 0, 9)) [2]:1, +>[2] : Symbol([2], Decl(literalsInComputedProperties1.ts, 1, 8)) >2 : Symbol([2], Decl(literalsInComputedProperties1.ts, 1, 8)) "3":1, >"3" : Symbol("3", Decl(literalsInComputedProperties1.ts, 2, 10)) ["4"]:1 +>["4"] : Symbol(["4"], Decl(literalsInComputedProperties1.ts, 3, 10)) >"4" : Symbol(["4"], Decl(literalsInComputedProperties1.ts, 3, 10)) } x[1].toExponential(); @@ -45,12 +47,14 @@ interface A { >1 : Symbol(A[1], Decl(literalsInComputedProperties1.ts, 11, 13)) [2]:number; +>[2] : Symbol(A[2], Decl(literalsInComputedProperties1.ts, 12, 13)) >2 : Symbol(A[2], Decl(literalsInComputedProperties1.ts, 12, 13)) "3":number; >"3" : Symbol(A["3"], Decl(literalsInComputedProperties1.ts, 13, 15)) ["4"]:number; +>["4"] : Symbol(A["4"], Decl(literalsInComputedProperties1.ts, 14, 15)) >"4" : Symbol(A["4"], Decl(literalsInComputedProperties1.ts, 14, 15)) } @@ -89,12 +93,14 @@ class C { >1 : Symbol(C[1], Decl(literalsInComputedProperties1.ts, 24, 9)) [2]:number; +>[2] : Symbol(C[2], Decl(literalsInComputedProperties1.ts, 25, 13)) >2 : Symbol(C[2], Decl(literalsInComputedProperties1.ts, 25, 13)) "3":number; >"3" : Symbol(C["3"], Decl(literalsInComputedProperties1.ts, 26, 15)) ["4"]:number; +>["4"] : Symbol(C["4"], Decl(literalsInComputedProperties1.ts, 27, 15)) >"4" : Symbol(C["4"], Decl(literalsInComputedProperties1.ts, 27, 15)) } @@ -133,18 +139,21 @@ enum X { >1 : Symbol(X[1], Decl(literalsInComputedProperties1.ts, 37, 8)) [2] = 2, +>[2] : Symbol(X[2], Decl(literalsInComputedProperties1.ts, 38, 10)) >2 : Symbol(X[2], Decl(literalsInComputedProperties1.ts, 38, 10)) "3" = 3, >"3" : Symbol(X["3"], Decl(literalsInComputedProperties1.ts, 39, 12)) ["4"] = 4, +>["4"] : Symbol(X["4"], Decl(literalsInComputedProperties1.ts, 40, 12)) >"4" : Symbol(X["4"], Decl(literalsInComputedProperties1.ts, 40, 12)) "foo" = 5, >"foo" : Symbol(X["foo"], Decl(literalsInComputedProperties1.ts, 41, 14)) ["bar"] = 6 +>["bar"] : Symbol(X["bar"], Decl(literalsInComputedProperties1.ts, 42, 14)) >"bar" : Symbol(X["bar"], Decl(literalsInComputedProperties1.ts, 42, 14)) } diff --git a/tests/baselines/reference/literalsInComputedProperties1.types b/tests/baselines/reference/literalsInComputedProperties1.types index aead4bc35fd..8f21cbb9fa5 100644 --- a/tests/baselines/reference/literalsInComputedProperties1.types +++ b/tests/baselines/reference/literalsInComputedProperties1.types @@ -8,6 +8,7 @@ let x = { >1 : 1 [2]:1, +>[2] : number >2 : 2 >1 : 1 @@ -16,6 +17,7 @@ let x = { >1 : 1 ["4"]:1 +>["4"] : number >"4" : "4" >1 : 1 } @@ -58,12 +60,14 @@ interface A { >1 : number [2]:number; +>[2] : number >2 : 2 "3":number; >"3" : number ["4"]:number; +>["4"] : number >"4" : "4" } @@ -110,12 +114,14 @@ class C { >1 : number [2]:number; +>[2] : number >2 : 2 "3":number; >"3" : number ["4"]:number; +>["4"] : number >"4" : "4" } @@ -163,6 +169,7 @@ enum X { >1 : 1 [2] = 2, +>[2] : X.2 >2 : 2 >2 : 2 @@ -171,6 +178,7 @@ enum X { >3 : 3 ["4"] = 4, +>["4"] : X.4 >"4" : "4" >4 : 4 @@ -179,6 +187,7 @@ enum X { >5 : 5 ["bar"] = 6 +>["bar"] : X.bar >"bar" : "bar" >6 : 6 } diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.symbols b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.symbols index 4a9295598f6..74d9fafa499 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.symbols +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.symbols @@ -45,6 +45,7 @@ var o = { >a : Symbol(a, Decl(modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts, 22, 9)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts, 23, 9)) >value : Symbol(value, Decl(modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts, 24, 25)) return false; @@ -90,6 +91,7 @@ const o1 = { >o1 : Symbol(o1, Decl(modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts, 49, 5)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts, 49, 12)) >value : Symbol(value, Decl(modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.ts, 50, 25)) return false; diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types index b3f6a156a75..834449a5a82 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.types @@ -68,6 +68,7 @@ var o = { >2 : 2 [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : any >Symbol : any >hasInstance : any @@ -143,6 +144,7 @@ const o1 = { >{ [Symbol.hasInstance](value: any) { return false; }} : { [Symbol.hasInstance](value: any): boolean; } [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : any >Symbol : any >hasInstance : any diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols index 1f55a3890ff..d99084339dd 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols @@ -90,6 +90,7 @@ var o = { >a : Symbol(a, Decl(modularizeLibrary_NoErrorDuplicateLibOptions1.ts, 38, 9)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_NoErrorDuplicateLibOptions1.ts, 39, 9)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -173,6 +174,7 @@ const o1 = { >o1 : Symbol(o1, Decl(modularizeLibrary_NoErrorDuplicateLibOptions1.ts, 75, 5)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_NoErrorDuplicateLibOptions1.ts, 75, 12)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 20d0779621c..78e6a6bc3f5 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -112,6 +112,7 @@ var o = { >2 : 2 [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -219,6 +220,7 @@ const o1 = { >{ [Symbol.hasInstance](value: any) { return false; }} : { [Symbol.hasInstance](value: any): boolean; } [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols index d6eb97d3673..5bb813f5c32 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols @@ -90,6 +90,7 @@ var o = { >a : Symbol(a, Decl(modularizeLibrary_NoErrorDuplicateLibOptions2.ts, 38, 9)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_NoErrorDuplicateLibOptions2.ts, 39, 9)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -173,6 +174,7 @@ const o1 = { >o1 : Symbol(o1, Decl(modularizeLibrary_NoErrorDuplicateLibOptions2.ts, 75, 5)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_NoErrorDuplicateLibOptions2.ts, 75, 12)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index 367ac41f246..4aabae824ee 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -112,6 +112,7 @@ var o = { >2 : 2 [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -219,6 +220,7 @@ const o1 = { >{ [Symbol.hasInstance](value: any) { return false; }} : { [Symbol.hasInstance](value: any): boolean; } [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols index 08e90ead0ea..c3c24d4690e 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols @@ -90,6 +90,7 @@ var o = { >a : Symbol(a, Decl(modularizeLibrary_TargetES5UsingES6Lib.ts, 38, 9)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_TargetES5UsingES6Lib.ts, 39, 9)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -173,6 +174,7 @@ const o1 = { >o1 : Symbol(o1, Decl(modularizeLibrary_TargetES5UsingES6Lib.ts, 75, 5)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_TargetES5UsingES6Lib.ts, 75, 12)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index 8dc959b1afe..2782c70ebd9 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -112,6 +112,7 @@ var o = { >2 : 2 [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -219,6 +220,7 @@ const o1 = { >{ [Symbol.hasInstance](value: any) { return false; }} : { [Symbol.hasInstance](value: any): boolean; } [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols index 1d3f903f880..ba9dd82df1e 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols @@ -55,6 +55,7 @@ var o = { >a : Symbol(a, Decl(modularizeLibrary_TargetES6UsingES6Lib.ts, 21, 9)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_TargetES6UsingES6Lib.ts, 22, 9)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -115,6 +116,7 @@ const o1 = { >o1 : Symbol(o1, Decl(modularizeLibrary_TargetES6UsingES6Lib.ts, 48, 5)) [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : Symbol([Symbol.hasInstance], Decl(modularizeLibrary_TargetES6UsingES6Lib.ts, 48, 12)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types index 2f1fab30cf7..9c0f81701dc 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types @@ -67,6 +67,7 @@ var o = { >2 : 2 [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -142,6 +143,7 @@ const o1 = { >{ [Symbol.hasInstance](value: any) { return false; }} : { [Symbol.hasInstance](value: any): boolean; } [Symbol.hasInstance](value: any) { +>[Symbol.hasInstance] : (value: any) => boolean >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.symbols b/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.symbols index 6a30e2a9fa9..a7e627dd867 100644 --- a/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.symbols +++ b/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.symbols @@ -11,9 +11,11 @@ class C { >C : Symbol(C, Decl(noUnusedLocals_writeOnlyProperty_dynamicNames.ts, 1, 22)) private [x]: number; +>[x] : Symbol(C[x], Decl(noUnusedLocals_writeOnlyProperty_dynamicNames.ts, 2, 9)) >x : Symbol(x, Decl(noUnusedLocals_writeOnlyProperty_dynamicNames.ts, 0, 5)) private [y]: number; +>[y] : Symbol(C[y], Decl(noUnusedLocals_writeOnlyProperty_dynamicNames.ts, 3, 24)) >y : Symbol(y, Decl(noUnusedLocals_writeOnlyProperty_dynamicNames.ts, 1, 5)) m() { diff --git a/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.types b/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.types index 7b173395a99..cc3bcd8a80d 100644 --- a/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.types +++ b/tests/baselines/reference/noUnusedLocals_writeOnlyProperty_dynamicNames.types @@ -15,9 +15,11 @@ class C { >C : C private [x]: number; +>[x] : number >x : unique symbol private [y]: number; +>[y] : number >y : unique symbol m() { diff --git a/tests/baselines/reference/objectLiteralEnumPropertyNames.symbols b/tests/baselines/reference/objectLiteralEnumPropertyNames.symbols index 7be36605b8c..2b4d20c146c 100644 --- a/tests/baselines/reference/objectLiteralEnumPropertyNames.symbols +++ b/tests/baselines/reference/objectLiteralEnumPropertyNames.symbols @@ -19,11 +19,13 @@ const x: TestStrs = { >TestStrs : Symbol(TestStrs, Decl(objectLiteralEnumPropertyNames.ts, 4, 1)) [Strs.A]: 'xo', +>[Strs.A] : Symbol([Strs.A], Decl(objectLiteralEnumPropertyNames.ts, 6, 21)) >Strs.A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) >Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) >A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) [Strs.B]: 'xe' +>[Strs.B] : Symbol([Strs.B], Decl(objectLiteralEnumPropertyNames.ts, 7, 19)) >Strs.B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) >Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) >B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) @@ -32,11 +34,13 @@ const ux = { >ux : Symbol(ux, Decl(objectLiteralEnumPropertyNames.ts, 10, 5)) [Strs.A]: 'xo', +>[Strs.A] : Symbol([Strs.A], Decl(objectLiteralEnumPropertyNames.ts, 10, 12)) >Strs.A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) >Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) >A : Symbol(Strs.A, Decl(objectLiteralEnumPropertyNames.ts, 1, 11)) [Strs.B]: 'xe' +>[Strs.B] : Symbol([Strs.B], Decl(objectLiteralEnumPropertyNames.ts, 11, 19)) >Strs.B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) >Strs : Symbol(Strs, Decl(objectLiteralEnumPropertyNames.ts, 0, 0)) >B : Symbol(Strs.B, Decl(objectLiteralEnumPropertyNames.ts, 2, 12)) @@ -46,9 +50,11 @@ const y: TestStrs = { >TestStrs : Symbol(TestStrs, Decl(objectLiteralEnumPropertyNames.ts, 4, 1)) ['a']: 'yo', +>['a'] : Symbol(['a'], Decl(objectLiteralEnumPropertyNames.ts, 14, 21)) >'a' : Symbol(['a'], Decl(objectLiteralEnumPropertyNames.ts, 14, 21)) ['b']: 'ye' +>['b'] : Symbol(['b'], Decl(objectLiteralEnumPropertyNames.ts, 15, 16)) >'b' : Symbol(['b'], Decl(objectLiteralEnumPropertyNames.ts, 15, 16)) } const a = 'a'; @@ -62,18 +68,22 @@ const z: TestStrs = { >TestStrs : Symbol(TestStrs, Decl(objectLiteralEnumPropertyNames.ts, 4, 1)) [a]: 'zo', +>[a] : Symbol([a], Decl(objectLiteralEnumPropertyNames.ts, 20, 21)) >a : Symbol(a, Decl(objectLiteralEnumPropertyNames.ts, 18, 5)) [b]: 'ze' +>[b] : Symbol([b], Decl(objectLiteralEnumPropertyNames.ts, 21, 14)) >b : Symbol(b, Decl(objectLiteralEnumPropertyNames.ts, 19, 5)) } const uz = { >uz : Symbol(uz, Decl(objectLiteralEnumPropertyNames.ts, 24, 5)) [a]: 'zo', +>[a] : Symbol([a], Decl(objectLiteralEnumPropertyNames.ts, 24, 12)) >a : Symbol(a, Decl(objectLiteralEnumPropertyNames.ts, 18, 5)) [b]: 'ze' +>[b] : Symbol([b], Decl(objectLiteralEnumPropertyNames.ts, 25, 14)) >b : Symbol(b, Decl(objectLiteralEnumPropertyNames.ts, 19, 5)) } @@ -96,11 +106,13 @@ const n: TestNums = { >TestNums : Symbol(TestNums, Decl(objectLiteralEnumPropertyNames.ts, 32, 1)) [Nums.A]: 1, +>[Nums.A] : Symbol([Nums.A], Decl(objectLiteralEnumPropertyNames.ts, 34, 21)) >Nums.A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) >Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) >A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) [Nums.B]: 2 +>[Nums.B] : Symbol([Nums.B], Decl(objectLiteralEnumPropertyNames.ts, 35, 16)) >Nums.B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) >Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) >B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) @@ -109,11 +121,13 @@ const un = { >un : Symbol(un, Decl(objectLiteralEnumPropertyNames.ts, 38, 5)) [Nums.A]: 3, +>[Nums.A] : Symbol([Nums.A], Decl(objectLiteralEnumPropertyNames.ts, 38, 12)) >Nums.A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) >Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) >A : Symbol(Nums.A, Decl(objectLiteralEnumPropertyNames.ts, 29, 11)) [Nums.B]: 4 +>[Nums.B] : Symbol([Nums.B], Decl(objectLiteralEnumPropertyNames.ts, 39, 16)) >Nums.B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) >Nums : Symbol(Nums, Decl(objectLiteralEnumPropertyNames.ts, 27, 1)) >B : Symbol(Nums.B, Decl(objectLiteralEnumPropertyNames.ts, 30, 6)) @@ -129,18 +143,22 @@ const m: TestNums = { >TestNums : Symbol(TestNums, Decl(objectLiteralEnumPropertyNames.ts, 32, 1)) [an]: 5, +>[an] : Symbol([an], Decl(objectLiteralEnumPropertyNames.ts, 44, 21)) >an : Symbol(an, Decl(objectLiteralEnumPropertyNames.ts, 42, 5)) [bn]: 6 +>[bn] : Symbol([bn], Decl(objectLiteralEnumPropertyNames.ts, 45, 12)) >bn : Symbol(bn, Decl(objectLiteralEnumPropertyNames.ts, 43, 5)) } const um = { >um : Symbol(um, Decl(objectLiteralEnumPropertyNames.ts, 48, 5)) [an]: 7, +>[an] : Symbol([an], Decl(objectLiteralEnumPropertyNames.ts, 48, 12)) >an : Symbol(an, Decl(objectLiteralEnumPropertyNames.ts, 42, 5)) [bn]: 8 +>[bn] : Symbol([bn], Decl(objectLiteralEnumPropertyNames.ts, 49, 12)) >bn : Symbol(bn, Decl(objectLiteralEnumPropertyNames.ts, 43, 5)) } diff --git a/tests/baselines/reference/objectLiteralEnumPropertyNames.types b/tests/baselines/reference/objectLiteralEnumPropertyNames.types index 6ba33d1286b..0b0ac6a0501 100644 --- a/tests/baselines/reference/objectLiteralEnumPropertyNames.types +++ b/tests/baselines/reference/objectLiteralEnumPropertyNames.types @@ -22,12 +22,14 @@ const x: TestStrs = { >{ [Strs.A]: 'xo', [Strs.B]: 'xe'} : { [Strs.A]: string; [Strs.B]: string; } [Strs.A]: 'xo', +>[Strs.A] : string >Strs.A : Strs.A >Strs : typeof Strs >A : Strs.A >'xo' : "xo" [Strs.B]: 'xe' +>[Strs.B] : string >Strs.B : Strs.B >Strs : typeof Strs >B : Strs.B @@ -38,12 +40,14 @@ const ux = { >{ [Strs.A]: 'xo', [Strs.B]: 'xe'} : { [Strs.A]: string; [Strs.B]: string; } [Strs.A]: 'xo', +>[Strs.A] : string >Strs.A : Strs.A >Strs : typeof Strs >A : Strs.A >'xo' : "xo" [Strs.B]: 'xe' +>[Strs.B] : string >Strs.B : Strs.B >Strs : typeof Strs >B : Strs.B @@ -55,10 +59,12 @@ const y: TestStrs = { >{ ['a']: 'yo', ['b']: 'ye'} : { ['a']: string; ['b']: string; } ['a']: 'yo', +>['a'] : string >'a' : "a" >'yo' : "yo" ['b']: 'ye' +>['b'] : string >'b' : "b" >'ye' : "ye" } @@ -76,10 +82,12 @@ const z: TestStrs = { >{ [a]: 'zo', [b]: 'ze'} : { [a]: string; [b]: string; } [a]: 'zo', +>[a] : string >a : "a" >'zo' : "zo" [b]: 'ze' +>[b] : string >b : "b" >'ze' : "ze" } @@ -88,10 +96,12 @@ const uz = { >{ [a]: 'zo', [b]: 'ze'} : { [a]: string; [b]: string; } [a]: 'zo', +>[a] : string >a : "a" >'zo' : "zo" [b]: 'ze' +>[b] : string >b : "b" >'ze' : "ze" } @@ -116,12 +126,14 @@ const n: TestNums = { >{ [Nums.A]: 1, [Nums.B]: 2} : { [Nums.A]: number; [Nums.B]: number; } [Nums.A]: 1, +>[Nums.A] : number >Nums.A : Nums.A >Nums : typeof Nums >A : Nums.A >1 : 1 [Nums.B]: 2 +>[Nums.B] : number >Nums.B : Nums.B >Nums : typeof Nums >B : Nums.B @@ -132,12 +144,14 @@ const un = { >{ [Nums.A]: 3, [Nums.B]: 4} : { [Nums.A]: number; [Nums.B]: number; } [Nums.A]: 3, +>[Nums.A] : number >Nums.A : Nums.A >Nums : typeof Nums >A : Nums.A >3 : 3 [Nums.B]: 4 +>[Nums.B] : number >Nums.B : Nums.B >Nums : typeof Nums >B : Nums.B @@ -157,10 +171,12 @@ const m: TestNums = { >{ [an]: 5, [bn]: 6} : { [an]: number; [bn]: number; } [an]: 5, +>[an] : number >an : 0 >5 : 5 [bn]: 6 +>[bn] : number >bn : 1 >6 : 6 } @@ -169,10 +185,12 @@ const um = { >{ [an]: 7, [bn]: 8} : { [an]: number; [bn]: number; } [an]: 7, +>[an] : number >an : 0 >7 : 7 [bn]: 8 +>[bn] : number >bn : 1 >8 : 8 } diff --git a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols index 570a6d8212d..9bca7b48ff8 100644 --- a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols +++ b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.symbols @@ -7,6 +7,7 @@ const foo = Symbol.for("foo"); const o = { [foo]: undefined }; >o : Symbol(o, Decl(objectLiteralPropertyImplicitlyAny.ts, 1, 5)) +>[foo] : Symbol([foo], Decl(objectLiteralPropertyImplicitlyAny.ts, 1, 11)) >foo : Symbol(foo, Decl(objectLiteralPropertyImplicitlyAny.ts, 0, 5)) >undefined : Symbol(undefined) diff --git a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types index 36d33fa6841..e9568e7a4f9 100644 --- a/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types +++ b/tests/baselines/reference/objectLiteralPropertyImplicitlyAny.types @@ -10,6 +10,7 @@ const foo = Symbol.for("foo"); const o = { [foo]: undefined }; >o : { [foo]: any; } >{ [foo]: undefined } : { [foo]: undefined; } +>[foo] : undefined >foo : unique symbol >undefined : undefined diff --git a/tests/baselines/reference/objectRest.symbols b/tests/baselines/reference/objectRest.symbols index 41226bd99fc..3f3b54e93df 100644 --- a/tests/baselines/reference/objectRest.symbols +++ b/tests/baselines/reference/objectRest.symbols @@ -184,8 +184,10 @@ var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o; >o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 42, 51)) ({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o); +>[computed] : Symbol([computed], Decl(objectRest.ts, 43, 2)) >computed : Symbol(computed, Decl(objectRest.ts, 40, 3)) >stillNotGreat : Symbol(stillNotGreat, Decl(objectRest.ts, 42, 5)) +>[computed2] : Symbol([computed2], Decl(objectRest.ts, 43, 29)) >computed2 : Symbol(computed2, Decl(objectRest.ts, 41, 3)) >soSo : Symbol(soSo, Decl(objectRest.ts, 42, 32)) >o : Symbol(o, Decl(objectRest.ts, 0, 3), Decl(objectRest.ts, 42, 51)) diff --git a/tests/baselines/reference/objectRest.types b/tests/baselines/reference/objectRest.types index dff8830e818..d4ca3096085 100644 --- a/tests/baselines/reference/objectRest.types +++ b/tests/baselines/reference/objectRest.types @@ -210,8 +210,10 @@ var { [computed]: stillNotGreat, [computed2]: soSo, ...o } = o; >({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o) : { a: number; b: string; } >{ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o : { a: number; b: string; } >{ [computed]: stillNotGreat, [computed2]: soSo, ...o } : { a: number; b: string; } +>[computed] : any >computed : string >stillNotGreat : any +>[computed2] : any >computed2 : string >soSo : any >o : { a: number; b: string; } diff --git a/tests/baselines/reference/objectSpread.symbols b/tests/baselines/reference/objectSpread.symbols index af831153c80..0bbcd4a9f4b 100644 --- a/tests/baselines/reference/objectSpread.symbols +++ b/tests/baselines/reference/objectSpread.symbols @@ -406,6 +406,7 @@ function container( >"before everything" : Symbol("before everything", Decl(objectSpread.ts, 108, 46)) { ['before everything']: 12, ...o, b: 'yes' } +>['before everything'] : Symbol(['before everything'], Decl(objectSpread.ts, 109, 9)) >'before everything' : Symbol(['before everything'], Decl(objectSpread.ts, 109, 9)) >o : Symbol(o, Decl(objectSpread.ts, 0, 3)) >b : Symbol(b, Decl(objectSpread.ts, 109, 42)) @@ -419,6 +420,7 @@ function container( { ...o, ['in the middle']: 13, b: 'maybe?', ...o2 } >o : Symbol(o, Decl(objectSpread.ts, 0, 3)) +>['in the middle'] : Symbol(['in the middle'], Decl(objectSpread.ts, 111, 15)) >'in the middle' : Symbol(['in the middle'], Decl(objectSpread.ts, 111, 15)) >b : Symbol(b, Decl(objectSpread.ts, 111, 38)) >o2 : Symbol(o2, Decl(objectSpread.ts, 1, 3)) @@ -432,6 +434,7 @@ function container( { ...o, b: 'yeah', ['at the end']: 14 } >o : Symbol(o, Decl(objectSpread.ts, 0, 3)) >b : Symbol(b, Decl(objectSpread.ts, 113, 15)) +>['at the end'] : Symbol(['at the end'], Decl(objectSpread.ts, 113, 26)) >'at the end' : Symbol(['at the end'], Decl(objectSpread.ts, 113, 26)) } // shortcut syntax diff --git a/tests/baselines/reference/objectSpread.types b/tests/baselines/reference/objectSpread.types index eb62d6d4e8f..8b7cb97fce3 100644 --- a/tests/baselines/reference/objectSpread.types +++ b/tests/baselines/reference/objectSpread.types @@ -523,6 +523,7 @@ function container( { ['before everything']: 12, ...o, b: 'yes' } >{ ['before everything']: 12, ...o, b: 'yes' } : { b: string; a: number; ['before everything']: number; } +>['before everything'] : number >'before everything' : "before everything" >12 : 12 >o : { a: number; b: string; } @@ -539,6 +540,7 @@ function container( { ...o, ['in the middle']: 13, b: 'maybe?', ...o2 } >{ ...o, ['in the middle']: 13, b: 'maybe?', ...o2 } : { b: string; c: boolean; ['in the middle']: number; a: number; } >o : { a: number; b: string; } +>['in the middle'] : number >'in the middle' : "in the middle" >13 : 13 >b : string @@ -556,6 +558,7 @@ function container( >o : { a: number; b: string; } >b : string >'yeah' : "yeah" +>['at the end'] : number >'at the end' : "at the end" >14 : 14 } diff --git a/tests/baselines/reference/objectSpreadComputedProperty.symbols b/tests/baselines/reference/objectSpreadComputedProperty.symbols index 57a0db0962b..5fa3e356d0b 100644 --- a/tests/baselines/reference/objectSpreadComputedProperty.symbols +++ b/tests/baselines/reference/objectSpreadComputedProperty.symbols @@ -14,20 +14,25 @@ function f() { const o1 = { ...{}, [n]: n }; >o1 : Symbol(o1, Decl(objectSpreadComputedProperty.ts, 5, 9)) +>[n] : Symbol([n], Decl(objectSpreadComputedProperty.ts, 5, 23)) >n : Symbol(n, Decl(objectSpreadComputedProperty.ts, 2, 7)) >n : Symbol(n, Decl(objectSpreadComputedProperty.ts, 2, 7)) const o2 = { ...{}, [a]: n }; >o2 : Symbol(o2, Decl(objectSpreadComputedProperty.ts, 6, 9)) +>[a] : Symbol([a], Decl(objectSpreadComputedProperty.ts, 6, 23)) >a : Symbol(a, Decl(objectSpreadComputedProperty.ts, 4, 7)) >n : Symbol(n, Decl(objectSpreadComputedProperty.ts, 2, 7)) const o3 = { [a]: n, ...{}, [n]: n, ...{}, [m]: m }; >o3 : Symbol(o3, Decl(objectSpreadComputedProperty.ts, 7, 9)) +>[a] : Symbol([a], Decl(objectSpreadComputedProperty.ts, 7, 16)) >a : Symbol(a, Decl(objectSpreadComputedProperty.ts, 4, 7)) >n : Symbol(n, Decl(objectSpreadComputedProperty.ts, 2, 7)) +>[n] : Symbol([n], Decl(objectSpreadComputedProperty.ts, 7, 31)) >n : Symbol(n, Decl(objectSpreadComputedProperty.ts, 2, 7)) >n : Symbol(n, Decl(objectSpreadComputedProperty.ts, 2, 7)) +>[m] : Symbol([m], Decl(objectSpreadComputedProperty.ts, 7, 46)) >m : Symbol(m, Decl(objectSpreadComputedProperty.ts, 3, 7)) >m : Symbol(m, Decl(objectSpreadComputedProperty.ts, 3, 7)) } diff --git a/tests/baselines/reference/objectSpreadComputedProperty.types b/tests/baselines/reference/objectSpreadComputedProperty.types index 287936d4354..d1cb2da117e 100644 --- a/tests/baselines/reference/objectSpreadComputedProperty.types +++ b/tests/baselines/reference/objectSpreadComputedProperty.types @@ -19,6 +19,7 @@ function f() { >o1 : {} >{ ...{}, [n]: n } : {} >{} : {} +>[n] : number >n : number >n : number @@ -26,18 +27,22 @@ function f() { >o2 : {} >{ ...{}, [a]: n } : {} >{} : {} +>[a] : number >a : any >n : number const o3 = { [a]: n, ...{}, [n]: n, ...{}, [m]: m }; >o3 : {} >{ [a]: n, ...{}, [n]: n, ...{}, [m]: m } : {} +>[a] : number >a : any >n : number >{} : {} +>[n] : number >n : number >n : number >{} : {} +>[m] : number >m : number >m : number } diff --git a/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.symbols b/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.symbols index fcbb442c09d..30e2ed3df59 100644 --- a/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.symbols +++ b/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.symbols @@ -213,6 +213,7 @@ class C21 { >C21 : Symbol(C21, Decl(yieldInClassComputedPropertyIsError.ts, 0, 0)) async * [yield]() { +>[yield] : Symbol(C21[yield], Decl(yieldInClassComputedPropertyIsError.ts, 0, 11)) } } === tests/cases/conformance/parser/ecmascriptnext/asyncGenerators/yieldInNestedComputedPropertyIsOk.ts === @@ -224,6 +225,7 @@ class C22 { const x = { [yield]: 1 }; >x : Symbol(x, Decl(yieldInNestedComputedPropertyIsOk.ts, 2, 13)) +>[yield] : Symbol([yield], Decl(yieldInNestedComputedPropertyIsOk.ts, 2, 19)) } } === tests/cases/conformance/parser/ecmascriptnext/asyncGenerators/asyncGeneratorGetAccessorIsError.ts === diff --git a/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.types b/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.types index 599ad78f057..81636f0d9f3 100644 --- a/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.types +++ b/tests/baselines/reference/parser.asyncGenerators.classMethods.esnext.types @@ -241,6 +241,7 @@ class C21 { >C21 : C21 async * [yield]() { +>[yield] : () => AsyncIterableIterator >yield : any } } @@ -254,6 +255,7 @@ class C22 { const x = { [yield]: 1 }; >x : { [x: number]: number; } >{ [yield]: 1 } : { [x: number]: number; } +>[yield] : number >yield : any >1 : 1 } diff --git a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.symbols b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.symbols index 7660719ef19..f8359754d6f 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.symbols +++ b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.symbols @@ -136,4 +136,5 @@ async function * f21() { const x = { [yield]: 1 }; >x : Symbol(x, Decl(yieldInNestedComputedPropertyIsOk.ts, 1, 9)) +>[yield] : Symbol([yield], Decl(yieldInNestedComputedPropertyIsOk.ts, 1, 15)) } diff --git a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.types b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.types index c27e9209611..d1ec77dd6ae 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.types +++ b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.esnext.types @@ -162,6 +162,7 @@ async function * f21() { const x = { [yield]: 1 }; >x : { [x: number]: number; } >{ [yield]: 1 } : { [x: number]: number; } +>[yield] : number >yield : any >1 : 1 } diff --git a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.symbols b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.symbols index 32fcb649f17..a22915b1533 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.symbols +++ b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.symbols @@ -148,6 +148,7 @@ const f21 = async function *() { const x = { [yield]: 1 }; >x : Symbol(x, Decl(yieldInNestedComputedPropertyIsOk.ts, 1, 9)) +>[yield] : Symbol([yield], Decl(yieldInNestedComputedPropertyIsOk.ts, 1, 15)) }; diff --git a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.types b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.types index 7b9ddf152d5..db905db6509 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.types +++ b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.esnext.types @@ -204,6 +204,7 @@ const f21 = async function *() { const x = { [yield]: 1 }; >x : { [x: number]: number; } >{ [yield]: 1 } : { [x: number]: number; } +>[yield] : number >yield : any >1 : 1 diff --git a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.symbols b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.symbols index 429da82d861..df64b125c65 100644 --- a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.symbols +++ b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.symbols @@ -219,6 +219,7 @@ const o21 = { const x = { [yield]: 1 }; >x : Symbol(x, Decl(yieldInNestedComputedPropertyIsOk.ts, 2, 13)) +>[yield] : Symbol([yield], Decl(yieldInNestedComputedPropertyIsOk.ts, 2, 19)) } }; === tests/cases/conformance/parser/ecmascriptnext/asyncGenerators/asyncGeneratorGetAccessorIsError.ts === diff --git a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.types b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.types index 59ed6e16745..4b159f793fe 100644 --- a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.types +++ b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.esnext.types @@ -269,6 +269,7 @@ const o21 = { const x = { [yield]: 1 }; >x : { [x: number]: number; } >{ [yield]: 1 } : { [x: number]: number; } +>[yield] : number >yield : any >1 : 1 } diff --git a/tests/baselines/reference/parserComputedPropertyName1.symbols b/tests/baselines/reference/parserComputedPropertyName1.symbols index bd83de4903b..49364d82528 100644 --- a/tests/baselines/reference/parserComputedPropertyName1.symbols +++ b/tests/baselines/reference/parserComputedPropertyName1.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName1.ts === var v = { [e] }; >v : Symbol(v, Decl(parserComputedPropertyName1.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName1.ts, 0, 9)) diff --git a/tests/baselines/reference/parserComputedPropertyName1.types b/tests/baselines/reference/parserComputedPropertyName1.types index 26d92b153b7..229b345194e 100644 --- a/tests/baselines/reference/parserComputedPropertyName1.types +++ b/tests/baselines/reference/parserComputedPropertyName1.types @@ -2,6 +2,7 @@ var v = { [e] }; >v : { [x: number]: any; } >{ [e] } : { [x: number]: any; } +>[e] : any >e : any > : any diff --git a/tests/baselines/reference/parserComputedPropertyName10.symbols b/tests/baselines/reference/parserComputedPropertyName10.symbols index e745603731d..5781ba2ec51 100644 --- a/tests/baselines/reference/parserComputedPropertyName10.symbols +++ b/tests/baselines/reference/parserComputedPropertyName10.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName10.ts, 0, 0)) [e] = 1 +>[e] : Symbol(C[e], Decl(parserComputedPropertyName10.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName10.types b/tests/baselines/reference/parserComputedPropertyName10.types index 22b7906d9da..e90f2b1422c 100644 --- a/tests/baselines/reference/parserComputedPropertyName10.types +++ b/tests/baselines/reference/parserComputedPropertyName10.types @@ -3,6 +3,7 @@ class C { >C : C [e] = 1 +>[e] : number >e : any >1 : 1 } diff --git a/tests/baselines/reference/parserComputedPropertyName11.symbols b/tests/baselines/reference/parserComputedPropertyName11.symbols index c3c08c53879..8c7878fac2f 100644 --- a/tests/baselines/reference/parserComputedPropertyName11.symbols +++ b/tests/baselines/reference/parserComputedPropertyName11.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName11.ts, 0, 0)) [e](); +>[e] : Symbol(C[e], Decl(parserComputedPropertyName11.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName11.types b/tests/baselines/reference/parserComputedPropertyName11.types index 30d76060d58..320417e3eb7 100644 --- a/tests/baselines/reference/parserComputedPropertyName11.types +++ b/tests/baselines/reference/parserComputedPropertyName11.types @@ -3,5 +3,6 @@ class C { >C : C [e](); +>[e] : () => any >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName12.symbols b/tests/baselines/reference/parserComputedPropertyName12.symbols index ee8c726f43a..bc58be35fba 100644 --- a/tests/baselines/reference/parserComputedPropertyName12.symbols +++ b/tests/baselines/reference/parserComputedPropertyName12.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName12.ts, 0, 0)) [e]() { } +>[e] : Symbol(C[e], Decl(parserComputedPropertyName12.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName12.types b/tests/baselines/reference/parserComputedPropertyName12.types index 73644158a82..8387ff6ce1b 100644 --- a/tests/baselines/reference/parserComputedPropertyName12.types +++ b/tests/baselines/reference/parserComputedPropertyName12.types @@ -3,5 +3,6 @@ class C { >C : C [e]() { } +>[e] : () => void >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName13.symbols b/tests/baselines/reference/parserComputedPropertyName13.symbols index dd3f036a718..1f0a6fb37c2 100644 --- a/tests/baselines/reference/parserComputedPropertyName13.symbols +++ b/tests/baselines/reference/parserComputedPropertyName13.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts === var v: { [e]: number }; >v : Symbol(v, Decl(parserComputedPropertyName13.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName13.ts, 0, 8)) diff --git a/tests/baselines/reference/parserComputedPropertyName13.types b/tests/baselines/reference/parserComputedPropertyName13.types index 89804cc0aab..b50c97290b3 100644 --- a/tests/baselines/reference/parserComputedPropertyName13.types +++ b/tests/baselines/reference/parserComputedPropertyName13.types @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName13.ts === var v: { [e]: number }; >v : {} +>[e] : number >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName14.symbols b/tests/baselines/reference/parserComputedPropertyName14.symbols index 7b1cb5bbe67..d77e0a0b64b 100644 --- a/tests/baselines/reference/parserComputedPropertyName14.symbols +++ b/tests/baselines/reference/parserComputedPropertyName14.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts === var v: { [e](): number }; >v : Symbol(v, Decl(parserComputedPropertyName14.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName14.ts, 0, 8)) diff --git a/tests/baselines/reference/parserComputedPropertyName14.types b/tests/baselines/reference/parserComputedPropertyName14.types index f46461b6f42..c40a2786d74 100644 --- a/tests/baselines/reference/parserComputedPropertyName14.types +++ b/tests/baselines/reference/parserComputedPropertyName14.types @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName14.ts === var v: { [e](): number }; >v : {} +>[e] : () => number >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName15.symbols b/tests/baselines/reference/parserComputedPropertyName15.symbols index 4440cf7e3e0..ec5375958be 100644 --- a/tests/baselines/reference/parserComputedPropertyName15.symbols +++ b/tests/baselines/reference/parserComputedPropertyName15.symbols @@ -2,4 +2,5 @@ var v: { [e: number]: string; [e]: number }; >v : Symbol(v, Decl(parserComputedPropertyName15.ts, 0, 3)) >e : Symbol(e, Decl(parserComputedPropertyName15.ts, 0, 10)) +>[e] : Symbol([e], Decl(parserComputedPropertyName15.ts, 0, 29)) diff --git a/tests/baselines/reference/parserComputedPropertyName15.types b/tests/baselines/reference/parserComputedPropertyName15.types index a4c6e547138..fd9be891e93 100644 --- a/tests/baselines/reference/parserComputedPropertyName15.types +++ b/tests/baselines/reference/parserComputedPropertyName15.types @@ -2,5 +2,6 @@ var v: { [e: number]: string; [e]: number }; >v : { [e: number]: string; } >e : number +>[e] : number >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName16.symbols b/tests/baselines/reference/parserComputedPropertyName16.symbols index c9b4bbc4309..99c91a08422 100644 --- a/tests/baselines/reference/parserComputedPropertyName16.symbols +++ b/tests/baselines/reference/parserComputedPropertyName16.symbols @@ -3,4 +3,5 @@ enum E { >E : Symbol(E, Decl(parserComputedPropertyName16.ts, 0, 0)) [e] = 1 +>[e] : Symbol(E[e], Decl(parserComputedPropertyName16.ts, 0, 8)) } diff --git a/tests/baselines/reference/parserComputedPropertyName16.types b/tests/baselines/reference/parserComputedPropertyName16.types index 18c92aeb604..b6440d89f0f 100644 --- a/tests/baselines/reference/parserComputedPropertyName16.types +++ b/tests/baselines/reference/parserComputedPropertyName16.types @@ -3,6 +3,7 @@ enum E { >E : E [e] = 1 +>[e] : E >e : any >1 : 1 } diff --git a/tests/baselines/reference/parserComputedPropertyName17.symbols b/tests/baselines/reference/parserComputedPropertyName17.symbols index 9db0da6149a..f39383e5448 100644 --- a/tests/baselines/reference/parserComputedPropertyName17.symbols +++ b/tests/baselines/reference/parserComputedPropertyName17.symbols @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName17.ts === var v = { set [e](v) { } } >v : Symbol(v, Decl(parserComputedPropertyName17.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName17.ts, 0, 9)) >v : Symbol(v, Decl(parserComputedPropertyName17.ts, 0, 18)) diff --git a/tests/baselines/reference/parserComputedPropertyName17.types b/tests/baselines/reference/parserComputedPropertyName17.types index ae0d6577857..141f36f9455 100644 --- a/tests/baselines/reference/parserComputedPropertyName17.types +++ b/tests/baselines/reference/parserComputedPropertyName17.types @@ -2,6 +2,7 @@ var v = { set [e](v) { } } >v : { [x: number]: any; } >{ set [e](v) { } } : { [x: number]: any; } +>[e] : any >e : any >v : any diff --git a/tests/baselines/reference/parserComputedPropertyName18.symbols b/tests/baselines/reference/parserComputedPropertyName18.symbols index bc4a3d14d9e..c5833f1c9e0 100644 --- a/tests/baselines/reference/parserComputedPropertyName18.symbols +++ b/tests/baselines/reference/parserComputedPropertyName18.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts === var v: { [e]?(): number }; >v : Symbol(v, Decl(parserComputedPropertyName18.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName18.ts, 0, 8)) diff --git a/tests/baselines/reference/parserComputedPropertyName18.types b/tests/baselines/reference/parserComputedPropertyName18.types index fd486ae3970..b8d42b7aab8 100644 --- a/tests/baselines/reference/parserComputedPropertyName18.types +++ b/tests/baselines/reference/parserComputedPropertyName18.types @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName18.ts === var v: { [e]?(): number }; >v : {} +>[e] : () => number >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName19.symbols b/tests/baselines/reference/parserComputedPropertyName19.symbols index aa7f67f243a..780bd2c5aaa 100644 --- a/tests/baselines/reference/parserComputedPropertyName19.symbols +++ b/tests/baselines/reference/parserComputedPropertyName19.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts === var v: { [e]? }; >v : Symbol(v, Decl(parserComputedPropertyName19.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName19.ts, 0, 8)) diff --git a/tests/baselines/reference/parserComputedPropertyName19.types b/tests/baselines/reference/parserComputedPropertyName19.types index d8ef712713e..6bba6be46c8 100644 --- a/tests/baselines/reference/parserComputedPropertyName19.types +++ b/tests/baselines/reference/parserComputedPropertyName19.types @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName19.ts === var v: { [e]? }; >v : {} +>[e] : any >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName2.symbols b/tests/baselines/reference/parserComputedPropertyName2.symbols index 68337b53bd5..2981697955f 100644 --- a/tests/baselines/reference/parserComputedPropertyName2.symbols +++ b/tests/baselines/reference/parserComputedPropertyName2.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName2.ts === var v = { [e]: 1 }; >v : Symbol(v, Decl(parserComputedPropertyName2.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName2.ts, 0, 9)) diff --git a/tests/baselines/reference/parserComputedPropertyName2.types b/tests/baselines/reference/parserComputedPropertyName2.types index 46c8a512527..fedfb2ea33f 100644 --- a/tests/baselines/reference/parserComputedPropertyName2.types +++ b/tests/baselines/reference/parserComputedPropertyName2.types @@ -2,6 +2,7 @@ var v = { [e]: 1 }; >v : { [x: number]: number; } >{ [e]: 1 } : { [x: number]: number; } +>[e] : number >e : any >1 : 1 diff --git a/tests/baselines/reference/parserComputedPropertyName20.symbols b/tests/baselines/reference/parserComputedPropertyName20.symbols index 6cc4801d7d1..0aaf5443e54 100644 --- a/tests/baselines/reference/parserComputedPropertyName20.symbols +++ b/tests/baselines/reference/parserComputedPropertyName20.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(parserComputedPropertyName20.ts, 0, 0)) [e](): number +>[e] : Symbol(I[e], Decl(parserComputedPropertyName20.ts, 0, 13)) } diff --git a/tests/baselines/reference/parserComputedPropertyName20.types b/tests/baselines/reference/parserComputedPropertyName20.types index badfdcc6400..74eacffcfc6 100644 --- a/tests/baselines/reference/parserComputedPropertyName20.types +++ b/tests/baselines/reference/parserComputedPropertyName20.types @@ -3,5 +3,6 @@ interface I { >I : I [e](): number +>[e] : () => number >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName21.symbols b/tests/baselines/reference/parserComputedPropertyName21.symbols index 9983b1c70d9..bb457f86df1 100644 --- a/tests/baselines/reference/parserComputedPropertyName21.symbols +++ b/tests/baselines/reference/parserComputedPropertyName21.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(parserComputedPropertyName21.ts, 0, 0)) [e]: number +>[e] : Symbol(I[e], Decl(parserComputedPropertyName21.ts, 0, 13)) } diff --git a/tests/baselines/reference/parserComputedPropertyName21.types b/tests/baselines/reference/parserComputedPropertyName21.types index 8fac4ceff2b..dfec1a83d11 100644 --- a/tests/baselines/reference/parserComputedPropertyName21.types +++ b/tests/baselines/reference/parserComputedPropertyName21.types @@ -3,5 +3,6 @@ interface I { >I : I [e]: number +>[e] : number >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName22.symbols b/tests/baselines/reference/parserComputedPropertyName22.symbols index 069a8438c24..3c00c9fa8a3 100644 --- a/tests/baselines/reference/parserComputedPropertyName22.symbols +++ b/tests/baselines/reference/parserComputedPropertyName22.symbols @@ -3,4 +3,5 @@ declare class C { >C : Symbol(C, Decl(parserComputedPropertyName22.ts, 0, 0)) [e]: number +>[e] : Symbol(C[e], Decl(parserComputedPropertyName22.ts, 0, 17)) } diff --git a/tests/baselines/reference/parserComputedPropertyName22.types b/tests/baselines/reference/parserComputedPropertyName22.types index 676589377ed..10a269ec3cb 100644 --- a/tests/baselines/reference/parserComputedPropertyName22.types +++ b/tests/baselines/reference/parserComputedPropertyName22.types @@ -3,5 +3,6 @@ declare class C { >C : C [e]: number +>[e] : number >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName23.symbols b/tests/baselines/reference/parserComputedPropertyName23.symbols index f4399bebec9..aa7ca05830c 100644 --- a/tests/baselines/reference/parserComputedPropertyName23.symbols +++ b/tests/baselines/reference/parserComputedPropertyName23.symbols @@ -3,4 +3,5 @@ declare class C { >C : Symbol(C, Decl(parserComputedPropertyName23.ts, 0, 0)) get [e](): number +>[e] : Symbol(C[e], Decl(parserComputedPropertyName23.ts, 0, 17)) } diff --git a/tests/baselines/reference/parserComputedPropertyName23.types b/tests/baselines/reference/parserComputedPropertyName23.types index 5128a48759c..84aa1a613e2 100644 --- a/tests/baselines/reference/parserComputedPropertyName23.types +++ b/tests/baselines/reference/parserComputedPropertyName23.types @@ -3,5 +3,6 @@ declare class C { >C : C get [e](): number +>[e] : number >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName24.symbols b/tests/baselines/reference/parserComputedPropertyName24.symbols index 42c3cc205bc..8dff60dbf32 100644 --- a/tests/baselines/reference/parserComputedPropertyName24.symbols +++ b/tests/baselines/reference/parserComputedPropertyName24.symbols @@ -3,5 +3,6 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName24.ts, 0, 0)) set [e](v) { } +>[e] : Symbol(C[e], Decl(parserComputedPropertyName24.ts, 0, 9)) >v : Symbol(v, Decl(parserComputedPropertyName24.ts, 1, 12)) } diff --git a/tests/baselines/reference/parserComputedPropertyName24.types b/tests/baselines/reference/parserComputedPropertyName24.types index 6e686091f4d..c91e84f1733 100644 --- a/tests/baselines/reference/parserComputedPropertyName24.types +++ b/tests/baselines/reference/parserComputedPropertyName24.types @@ -3,6 +3,7 @@ class C { >C : C set [e](v) { } +>[e] : any >e : any >v : any } diff --git a/tests/baselines/reference/parserComputedPropertyName25.symbols b/tests/baselines/reference/parserComputedPropertyName25.symbols index 6d0b5192931..1ac1ae11685 100644 --- a/tests/baselines/reference/parserComputedPropertyName25.symbols +++ b/tests/baselines/reference/parserComputedPropertyName25.symbols @@ -4,5 +4,7 @@ class C { // No ASI [e] = 0 +>[e] : Symbol(C[e], Decl(parserComputedPropertyName25.ts, 0, 9)) + [e2] = 1 } diff --git a/tests/baselines/reference/parserComputedPropertyName25.types b/tests/baselines/reference/parserComputedPropertyName25.types index 5c1615bbd1a..f32624d91b0 100644 --- a/tests/baselines/reference/parserComputedPropertyName25.types +++ b/tests/baselines/reference/parserComputedPropertyName25.types @@ -4,6 +4,7 @@ class C { // No ASI [e] = 0 +>[e] : number >e : any >0 [e2] = 1 : 1 >0 [e2] : any diff --git a/tests/baselines/reference/parserComputedPropertyName26.symbols b/tests/baselines/reference/parserComputedPropertyName26.symbols index 030adcb5eea..81c8b56add4 100644 --- a/tests/baselines/reference/parserComputedPropertyName26.symbols +++ b/tests/baselines/reference/parserComputedPropertyName26.symbols @@ -4,5 +4,7 @@ enum E { // No ASI [e] = 0 +>[e] : Symbol(E[e], Decl(parserComputedPropertyName26.ts, 0, 8)) + [e2] = 1 } diff --git a/tests/baselines/reference/parserComputedPropertyName26.types b/tests/baselines/reference/parserComputedPropertyName26.types index bb255adcd67..5de00bc0973 100644 --- a/tests/baselines/reference/parserComputedPropertyName26.types +++ b/tests/baselines/reference/parserComputedPropertyName26.types @@ -4,6 +4,7 @@ enum E { // No ASI [e] = 0 +>[e] : E >e : any >0 [e2] = 1 : 1 >0 [e2] : any diff --git a/tests/baselines/reference/parserComputedPropertyName27.symbols b/tests/baselines/reference/parserComputedPropertyName27.symbols index de9c0719d6b..8a48c9ce085 100644 --- a/tests/baselines/reference/parserComputedPropertyName27.symbols +++ b/tests/baselines/reference/parserComputedPropertyName27.symbols @@ -4,6 +4,8 @@ class C { // No ASI [e]: number = 0 +>[e] : Symbol(C[e], Decl(parserComputedPropertyName27.ts, 0, 9)) + [e2]: number >number : Symbol(C.number, Decl(parserComputedPropertyName27.ts, 3, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName27.types b/tests/baselines/reference/parserComputedPropertyName27.types index 3792b7e533f..7770e23531c 100644 --- a/tests/baselines/reference/parserComputedPropertyName27.types +++ b/tests/baselines/reference/parserComputedPropertyName27.types @@ -4,6 +4,7 @@ class C { // No ASI [e]: number = 0 +>[e] : number >e : any >0 [e2] : any >0 : 0 diff --git a/tests/baselines/reference/parserComputedPropertyName28.symbols b/tests/baselines/reference/parserComputedPropertyName28.symbols index c16e98b67b4..7bd9f172c5c 100644 --- a/tests/baselines/reference/parserComputedPropertyName28.symbols +++ b/tests/baselines/reference/parserComputedPropertyName28.symbols @@ -3,5 +3,8 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName28.ts, 0, 0)) [e]: number = 0; +>[e] : Symbol(C[e], Decl(parserComputedPropertyName28.ts, 0, 9)) + [e2]: number +>[e2] : Symbol(C[e2], Decl(parserComputedPropertyName28.ts, 1, 20)) } diff --git a/tests/baselines/reference/parserComputedPropertyName28.types b/tests/baselines/reference/parserComputedPropertyName28.types index 45ba330c590..ef9d897184a 100644 --- a/tests/baselines/reference/parserComputedPropertyName28.types +++ b/tests/baselines/reference/parserComputedPropertyName28.types @@ -3,9 +3,11 @@ class C { >C : C [e]: number = 0; +>[e] : number >e : any >0 : 0 [e2]: number +>[e2] : number >e2 : any } diff --git a/tests/baselines/reference/parserComputedPropertyName29.symbols b/tests/baselines/reference/parserComputedPropertyName29.symbols index dea434af3fb..7ea1f78bf86 100644 --- a/tests/baselines/reference/parserComputedPropertyName29.symbols +++ b/tests/baselines/reference/parserComputedPropertyName29.symbols @@ -4,5 +4,8 @@ class C { // yes ASI [e] = id++ +>[e] : Symbol(C[e], Decl(parserComputedPropertyName29.ts, 0, 9)) + [e2]: number +>[e2] : Symbol(C[e2], Decl(parserComputedPropertyName29.ts, 2, 14)) } diff --git a/tests/baselines/reference/parserComputedPropertyName29.types b/tests/baselines/reference/parserComputedPropertyName29.types index 9458937213d..86d352ebd27 100644 --- a/tests/baselines/reference/parserComputedPropertyName29.types +++ b/tests/baselines/reference/parserComputedPropertyName29.types @@ -4,10 +4,12 @@ class C { // yes ASI [e] = id++ +>[e] : number >e : any >id++ : number >id : any [e2]: number +>[e2] : number >e2 : any } diff --git a/tests/baselines/reference/parserComputedPropertyName3.symbols b/tests/baselines/reference/parserComputedPropertyName3.symbols index fada0f6ffa1..7e7a7425f52 100644 --- a/tests/baselines/reference/parserComputedPropertyName3.symbols +++ b/tests/baselines/reference/parserComputedPropertyName3.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName3.ts === var v = { [e]() { } }; >v : Symbol(v, Decl(parserComputedPropertyName3.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName3.ts, 0, 9)) diff --git a/tests/baselines/reference/parserComputedPropertyName3.types b/tests/baselines/reference/parserComputedPropertyName3.types index d41fa5f44c4..7a9d4aff232 100644 --- a/tests/baselines/reference/parserComputedPropertyName3.types +++ b/tests/baselines/reference/parserComputedPropertyName3.types @@ -2,5 +2,6 @@ var v = { [e]() { } }; >v : { [x: number]: () => void; } >{ [e]() { } } : { [x: number]: () => void; } +>[e] : () => void >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName30.symbols b/tests/baselines/reference/parserComputedPropertyName30.symbols index 35bfd40c50f..69d6073aaf4 100644 --- a/tests/baselines/reference/parserComputedPropertyName30.symbols +++ b/tests/baselines/reference/parserComputedPropertyName30.symbols @@ -4,5 +4,8 @@ enum E { // no ASI, comma expected [e] = id++ +>[e] : Symbol(E[e], Decl(parserComputedPropertyName30.ts, 0, 8)) + [e2] = 1 +>[e2] : Symbol(E[e2], Decl(parserComputedPropertyName30.ts, 2, 14)) } diff --git a/tests/baselines/reference/parserComputedPropertyName30.types b/tests/baselines/reference/parserComputedPropertyName30.types index 60b957a33b8..3d2120dbdcd 100644 --- a/tests/baselines/reference/parserComputedPropertyName30.types +++ b/tests/baselines/reference/parserComputedPropertyName30.types @@ -4,11 +4,13 @@ enum E { // no ASI, comma expected [e] = id++ +>[e] : E >e : any >id++ : number >id : any [e2] = 1 +>[e2] : E >e2 : any >1 : 1 } diff --git a/tests/baselines/reference/parserComputedPropertyName31.symbols b/tests/baselines/reference/parserComputedPropertyName31.symbols index e29f20dbd2a..51ca7886d84 100644 --- a/tests/baselines/reference/parserComputedPropertyName31.symbols +++ b/tests/baselines/reference/parserComputedPropertyName31.symbols @@ -4,5 +4,8 @@ class C { // yes ASI [e]: number +>[e] : Symbol(C[e], Decl(parserComputedPropertyName31.ts, 0, 9)) + [e2]: number +>[e2] : Symbol(C[e2], Decl(parserComputedPropertyName31.ts, 2, 15)) } diff --git a/tests/baselines/reference/parserComputedPropertyName31.types b/tests/baselines/reference/parserComputedPropertyName31.types index 1536c1ba12a..c780a4e4aec 100644 --- a/tests/baselines/reference/parserComputedPropertyName31.types +++ b/tests/baselines/reference/parserComputedPropertyName31.types @@ -4,8 +4,10 @@ class C { // yes ASI [e]: number +>[e] : number >e : any [e2]: number +>[e2] : number >e2 : any } diff --git a/tests/baselines/reference/parserComputedPropertyName32.symbols b/tests/baselines/reference/parserComputedPropertyName32.symbols index fe6bbc6ce38..b67012d1eb3 100644 --- a/tests/baselines/reference/parserComputedPropertyName32.symbols +++ b/tests/baselines/reference/parserComputedPropertyName32.symbols @@ -3,4 +3,5 @@ declare class C { >C : Symbol(C, Decl(parserComputedPropertyName32.ts, 0, 0)) [e](): number +>[e] : Symbol(C[e], Decl(parserComputedPropertyName32.ts, 0, 17)) } diff --git a/tests/baselines/reference/parserComputedPropertyName32.types b/tests/baselines/reference/parserComputedPropertyName32.types index fe81ec8f1e8..05ae6d5860c 100644 --- a/tests/baselines/reference/parserComputedPropertyName32.types +++ b/tests/baselines/reference/parserComputedPropertyName32.types @@ -3,5 +3,6 @@ declare class C { >C : C [e](): number +>[e] : () => number >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName33.symbols b/tests/baselines/reference/parserComputedPropertyName33.symbols index 63bb0e1f674..a42a868c381 100644 --- a/tests/baselines/reference/parserComputedPropertyName33.symbols +++ b/tests/baselines/reference/parserComputedPropertyName33.symbols @@ -4,5 +4,7 @@ class C { // No ASI [e] = 0 +>[e] : Symbol(C[e], Decl(parserComputedPropertyName33.ts, 0, 9)) + [e2]() { } } diff --git a/tests/baselines/reference/parserComputedPropertyName33.types b/tests/baselines/reference/parserComputedPropertyName33.types index d076f0847dd..f55a72d5b0d 100644 --- a/tests/baselines/reference/parserComputedPropertyName33.types +++ b/tests/baselines/reference/parserComputedPropertyName33.types @@ -4,6 +4,7 @@ class C { // No ASI [e] = 0 +>[e] : any >e : any >0 [e2]() : any >0 [e2] : any diff --git a/tests/baselines/reference/parserComputedPropertyName34.symbols b/tests/baselines/reference/parserComputedPropertyName34.symbols index 16cfad75923..6ada40974a4 100644 --- a/tests/baselines/reference/parserComputedPropertyName34.symbols +++ b/tests/baselines/reference/parserComputedPropertyName34.symbols @@ -4,5 +4,8 @@ enum E { // no ASI, comma expected [e] = id++, +>[e] : Symbol(E[e], Decl(parserComputedPropertyName34.ts, 0, 8)) + [e2] = 1 +>[e2] : Symbol(E[e2], Decl(parserComputedPropertyName34.ts, 2, 15)) } diff --git a/tests/baselines/reference/parserComputedPropertyName34.types b/tests/baselines/reference/parserComputedPropertyName34.types index 10ea2142ff1..196c34f9bce 100644 --- a/tests/baselines/reference/parserComputedPropertyName34.types +++ b/tests/baselines/reference/parserComputedPropertyName34.types @@ -4,11 +4,13 @@ enum E { // no ASI, comma expected [e] = id++, +>[e] : E >e : any >id++ : number >id : any [e2] = 1 +>[e2] : E >e2 : any >1 : 1 } diff --git a/tests/baselines/reference/parserComputedPropertyName35.symbols b/tests/baselines/reference/parserComputedPropertyName35.symbols index cd0f5b375bb..f3e99ada19c 100644 --- a/tests/baselines/reference/parserComputedPropertyName35.symbols +++ b/tests/baselines/reference/parserComputedPropertyName35.symbols @@ -3,4 +3,5 @@ var x = { >x : Symbol(x, Decl(parserComputedPropertyName35.ts, 0, 3)) [0, 1]: { } +>[0, 1] : Symbol([0, 1], Decl(parserComputedPropertyName35.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName35.types b/tests/baselines/reference/parserComputedPropertyName35.types index e1be4b2ba67..bfaaca1f942 100644 --- a/tests/baselines/reference/parserComputedPropertyName35.types +++ b/tests/baselines/reference/parserComputedPropertyName35.types @@ -4,6 +4,7 @@ var x = { >{ [0, 1]: { }} : { [0, 1]: {}; } [0, 1]: { } +>[0, 1] : {} >0, 1 : 1 >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/parserComputedPropertyName36.symbols b/tests/baselines/reference/parserComputedPropertyName36.symbols index 3e71e2db443..5b10f29f967 100644 --- a/tests/baselines/reference/parserComputedPropertyName36.symbols +++ b/tests/baselines/reference/parserComputedPropertyName36.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName36.ts, 0, 0)) [public ]: string; +>[public ] : Symbol(C[public ], Decl(parserComputedPropertyName36.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName36.types b/tests/baselines/reference/parserComputedPropertyName36.types index dd71833a033..a2619895480 100644 --- a/tests/baselines/reference/parserComputedPropertyName36.types +++ b/tests/baselines/reference/parserComputedPropertyName36.types @@ -3,5 +3,6 @@ class C { >C : C [public ]: string; +>[public ] : string >public : any } diff --git a/tests/baselines/reference/parserComputedPropertyName37.symbols b/tests/baselines/reference/parserComputedPropertyName37.symbols index 9ff0eda56d7..a14a5e29fdf 100644 --- a/tests/baselines/reference/parserComputedPropertyName37.symbols +++ b/tests/baselines/reference/parserComputedPropertyName37.symbols @@ -3,4 +3,6 @@ var v = { >v : Symbol(v, Decl(parserComputedPropertyName37.ts, 0, 3)) [public]: 0 +>[public] : Symbol([public], Decl(parserComputedPropertyName37.ts, 0, 9)) + }; diff --git a/tests/baselines/reference/parserComputedPropertyName37.types b/tests/baselines/reference/parserComputedPropertyName37.types index da877f14b40..c0ef9ee0eb3 100644 --- a/tests/baselines/reference/parserComputedPropertyName37.types +++ b/tests/baselines/reference/parserComputedPropertyName37.types @@ -4,6 +4,7 @@ var v = { >{ [public]: 0} : { [x: number]: number; } [public]: 0 +>[public] : number >public : any >0 : 0 diff --git a/tests/baselines/reference/parserComputedPropertyName38.symbols b/tests/baselines/reference/parserComputedPropertyName38.symbols index eaa3a2e42a4..7b6c0cd6320 100644 --- a/tests/baselines/reference/parserComputedPropertyName38.symbols +++ b/tests/baselines/reference/parserComputedPropertyName38.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName38.ts, 0, 0)) [public]() { } +>[public] : Symbol(C[public], Decl(parserComputedPropertyName38.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName38.types b/tests/baselines/reference/parserComputedPropertyName38.types index 91cc577b02a..24bf03b7e2b 100644 --- a/tests/baselines/reference/parserComputedPropertyName38.types +++ b/tests/baselines/reference/parserComputedPropertyName38.types @@ -3,5 +3,6 @@ class C { >C : C [public]() { } +>[public] : () => void >public : any } diff --git a/tests/baselines/reference/parserComputedPropertyName39.symbols b/tests/baselines/reference/parserComputedPropertyName39.symbols index 89c53bafd67..83eb4a90f8f 100644 --- a/tests/baselines/reference/parserComputedPropertyName39.symbols +++ b/tests/baselines/reference/parserComputedPropertyName39.symbols @@ -4,4 +4,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName39.ts, 0, 13)) [public]() { } +>[public] : Symbol(C[public], Decl(parserComputedPropertyName39.ts, 1, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName39.types b/tests/baselines/reference/parserComputedPropertyName39.types index 4098d7f1684..20666b96d70 100644 --- a/tests/baselines/reference/parserComputedPropertyName39.types +++ b/tests/baselines/reference/parserComputedPropertyName39.types @@ -6,5 +6,6 @@ class C { >C : C [public]() { } +>[public] : () => void >public : any } diff --git a/tests/baselines/reference/parserComputedPropertyName4.symbols b/tests/baselines/reference/parserComputedPropertyName4.symbols index eefb4ba2fa8..1227b81804d 100644 --- a/tests/baselines/reference/parserComputedPropertyName4.symbols +++ b/tests/baselines/reference/parserComputedPropertyName4.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName4.ts === var v = { get [e]() { } }; >v : Symbol(v, Decl(parserComputedPropertyName4.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName4.ts, 0, 9)) diff --git a/tests/baselines/reference/parserComputedPropertyName4.types b/tests/baselines/reference/parserComputedPropertyName4.types index 963a1bbbeb8..66ac75b156b 100644 --- a/tests/baselines/reference/parserComputedPropertyName4.types +++ b/tests/baselines/reference/parserComputedPropertyName4.types @@ -2,5 +2,6 @@ var v = { get [e]() { } }; >v : { [x: number]: void; } >{ get [e]() { } } : { [x: number]: void; } +>[e] : void >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName40.symbols b/tests/baselines/reference/parserComputedPropertyName40.symbols index ad91f9d12b3..c064b582a09 100644 --- a/tests/baselines/reference/parserComputedPropertyName40.symbols +++ b/tests/baselines/reference/parserComputedPropertyName40.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName40.ts, 0, 0)) [a ? "" : ""]() {} +>[a ? "" : ""] : Symbol(C[a ? "" : ""], Decl(parserComputedPropertyName40.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName40.types b/tests/baselines/reference/parserComputedPropertyName40.types index 0b7a3262750..75abd4cefaf 100644 --- a/tests/baselines/reference/parserComputedPropertyName40.types +++ b/tests/baselines/reference/parserComputedPropertyName40.types @@ -3,6 +3,7 @@ class C { >C : C [a ? "" : ""]() {} +>[a ? "" : ""] : () => void >a ? "" : "" : "" >a : any >"" : "" diff --git a/tests/baselines/reference/parserComputedPropertyName41.symbols b/tests/baselines/reference/parserComputedPropertyName41.symbols index 1bdd2ef6ae6..57e4c229dcb 100644 --- a/tests/baselines/reference/parserComputedPropertyName41.symbols +++ b/tests/baselines/reference/parserComputedPropertyName41.symbols @@ -3,4 +3,5 @@ var v = { >v : Symbol(v, Decl(parserComputedPropertyName41.ts, 0, 3)) [0 in []]: true +>[0 in []] : Symbol([0 in []], Decl(parserComputedPropertyName41.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName41.types b/tests/baselines/reference/parserComputedPropertyName41.types index 2ef1a813a58..897c4252f26 100644 --- a/tests/baselines/reference/parserComputedPropertyName41.types +++ b/tests/baselines/reference/parserComputedPropertyName41.types @@ -4,6 +4,7 @@ var v = { >{ [0 in []]: true} : { [x: string]: boolean; } [0 in []]: true +>[0 in []] : boolean >0 in [] : boolean >0 : 0 >[] : undefined[] diff --git a/tests/baselines/reference/parserComputedPropertyName5.symbols b/tests/baselines/reference/parserComputedPropertyName5.symbols index e34d2839259..fd254ee1533 100644 --- a/tests/baselines/reference/parserComputedPropertyName5.symbols +++ b/tests/baselines/reference/parserComputedPropertyName5.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName5.ts === var v = { public get [e]() { } }; >v : Symbol(v, Decl(parserComputedPropertyName5.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName5.ts, 0, 9)) diff --git a/tests/baselines/reference/parserComputedPropertyName5.types b/tests/baselines/reference/parserComputedPropertyName5.types index 40d5fb14f5d..383f590909f 100644 --- a/tests/baselines/reference/parserComputedPropertyName5.types +++ b/tests/baselines/reference/parserComputedPropertyName5.types @@ -2,5 +2,6 @@ var v = { public get [e]() { } }; >v : { [x: number]: void; } >{ public get [e]() { } } : { [x: number]: void; } +>[e] : void >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName6.symbols b/tests/baselines/reference/parserComputedPropertyName6.symbols index 24a460cd545..83b468f2136 100644 --- a/tests/baselines/reference/parserComputedPropertyName6.symbols +++ b/tests/baselines/reference/parserComputedPropertyName6.symbols @@ -1,4 +1,6 @@ === tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName6.ts === var v = { [e]: 1, [e + e]: 2 }; >v : Symbol(v, Decl(parserComputedPropertyName6.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserComputedPropertyName6.ts, 0, 9)) +>[e + e] : Symbol([e + e], Decl(parserComputedPropertyName6.ts, 0, 17)) diff --git a/tests/baselines/reference/parserComputedPropertyName6.types b/tests/baselines/reference/parserComputedPropertyName6.types index 125cced2ac4..c292156dce0 100644 --- a/tests/baselines/reference/parserComputedPropertyName6.types +++ b/tests/baselines/reference/parserComputedPropertyName6.types @@ -2,8 +2,10 @@ var v = { [e]: 1, [e + e]: 2 }; >v : { [x: number]: number; } >{ [e]: 1, [e + e]: 2 } : { [x: number]: number; } +>[e] : number >e : any >1 : 1 +>[e + e] : number >e + e : any >e : any >e : any diff --git a/tests/baselines/reference/parserComputedPropertyName7.symbols b/tests/baselines/reference/parserComputedPropertyName7.symbols index 4f48fae944c..e3e7bcc8a9d 100644 --- a/tests/baselines/reference/parserComputedPropertyName7.symbols +++ b/tests/baselines/reference/parserComputedPropertyName7.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName7.ts, 0, 0)) [e] +>[e] : Symbol(C[e], Decl(parserComputedPropertyName7.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName7.types b/tests/baselines/reference/parserComputedPropertyName7.types index b76ea798a54..23399504666 100644 --- a/tests/baselines/reference/parserComputedPropertyName7.types +++ b/tests/baselines/reference/parserComputedPropertyName7.types @@ -3,5 +3,6 @@ class C { >C : C [e] +>[e] : any >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName8.symbols b/tests/baselines/reference/parserComputedPropertyName8.symbols index 8b31dd27d92..8bcddde5db1 100644 --- a/tests/baselines/reference/parserComputedPropertyName8.symbols +++ b/tests/baselines/reference/parserComputedPropertyName8.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName8.ts, 0, 0)) public [e] +>[e] : Symbol(C[e], Decl(parserComputedPropertyName8.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName8.types b/tests/baselines/reference/parserComputedPropertyName8.types index d493950530b..b3b7a447351 100644 --- a/tests/baselines/reference/parserComputedPropertyName8.types +++ b/tests/baselines/reference/parserComputedPropertyName8.types @@ -3,5 +3,6 @@ class C { >C : C public [e] +>[e] : any >e : any } diff --git a/tests/baselines/reference/parserComputedPropertyName9.symbols b/tests/baselines/reference/parserComputedPropertyName9.symbols index ebdd02bf7e9..faab6e90796 100644 --- a/tests/baselines/reference/parserComputedPropertyName9.symbols +++ b/tests/baselines/reference/parserComputedPropertyName9.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserComputedPropertyName9.ts, 0, 0)) [e]: Type +>[e] : Symbol(C[e], Decl(parserComputedPropertyName9.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserComputedPropertyName9.types b/tests/baselines/reference/parserComputedPropertyName9.types index d24d3cddff0..2a34bf7258d 100644 --- a/tests/baselines/reference/parserComputedPropertyName9.types +++ b/tests/baselines/reference/parserComputedPropertyName9.types @@ -3,6 +3,7 @@ class C { >C : C [e]: Type +>[e] : any >e : any >Type : No type information available! } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName1.symbols b/tests/baselines/reference/parserES5ComputedPropertyName1.symbols index af527d21da3..aa71c2fc2d3 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName1.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName1.symbols @@ -3,4 +3,5 @@ declare class C { >C : Symbol(C, Decl(parserES5ComputedPropertyName1.ts, 0, 0)) [e]: number +>[e] : Symbol(C[e], Decl(parserES5ComputedPropertyName1.ts, 0, 17)) } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName1.types b/tests/baselines/reference/parserES5ComputedPropertyName1.types index 62070655b93..09bbae178e0 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName1.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName1.types @@ -3,5 +3,6 @@ declare class C { >C : C [e]: number +>[e] : number >e : any } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName10.symbols b/tests/baselines/reference/parserES5ComputedPropertyName10.symbols index 0a0a2bb2d2a..14c0786728e 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName10.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName10.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserES5ComputedPropertyName10.ts, 0, 0)) [e] = 1 +>[e] : Symbol(C[e], Decl(parserES5ComputedPropertyName10.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName10.types b/tests/baselines/reference/parserES5ComputedPropertyName10.types index 05faa05b5d9..61a68af9254 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName10.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName10.types @@ -3,6 +3,7 @@ class C { >C : C [e] = 1 +>[e] : number >e : any >1 : 1 } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName11.symbols b/tests/baselines/reference/parserES5ComputedPropertyName11.symbols index 1f5c7eb70b9..4873a03295a 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName11.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName11.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserES5ComputedPropertyName11.ts, 0, 0)) [e](); +>[e] : Symbol(C[e], Decl(parserES5ComputedPropertyName11.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName11.types b/tests/baselines/reference/parserES5ComputedPropertyName11.types index 85a2527f79d..a17a37a0b34 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName11.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName11.types @@ -3,5 +3,6 @@ class C { >C : C [e](); +>[e] : () => any >e : any } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName2.symbols b/tests/baselines/reference/parserES5ComputedPropertyName2.symbols index bba6a7800c2..c64d274ea22 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName2.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName2.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName2.ts === var v = { [e]: 1 }; >v : Symbol(v, Decl(parserES5ComputedPropertyName2.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserES5ComputedPropertyName2.ts, 0, 9)) diff --git a/tests/baselines/reference/parserES5ComputedPropertyName2.types b/tests/baselines/reference/parserES5ComputedPropertyName2.types index aa6d4839d75..6d40c5687e9 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName2.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName2.types @@ -2,6 +2,7 @@ var v = { [e]: 1 }; >v : { [x: number]: number; } >{ [e]: 1 } : { [x: number]: number; } +>[e] : number >e : any >1 : 1 diff --git a/tests/baselines/reference/parserES5ComputedPropertyName3.symbols b/tests/baselines/reference/parserES5ComputedPropertyName3.symbols index 00e41b591a1..c577c3dea3b 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName3.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName3.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName3.ts === var v = { [e]() { } }; >v : Symbol(v, Decl(parserES5ComputedPropertyName3.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserES5ComputedPropertyName3.ts, 0, 9)) diff --git a/tests/baselines/reference/parserES5ComputedPropertyName3.types b/tests/baselines/reference/parserES5ComputedPropertyName3.types index 4661effe9eb..012ebae6bbf 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName3.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName3.types @@ -2,5 +2,6 @@ var v = { [e]() { } }; >v : { [x: number]: () => void; } >{ [e]() { } } : { [x: number]: () => void; } +>[e] : () => void >e : any diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.symbols b/tests/baselines/reference/parserES5ComputedPropertyName4.symbols index 79d93250637..4d0400e7a76 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName4.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName4.ts === var v = { get [e]() { } }; >v : Symbol(v, Decl(parserES5ComputedPropertyName4.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserES5ComputedPropertyName4.ts, 0, 9)) diff --git a/tests/baselines/reference/parserES5ComputedPropertyName4.types b/tests/baselines/reference/parserES5ComputedPropertyName4.types index 6efbe826eb9..4e021729a7d 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName4.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName4.types @@ -2,5 +2,6 @@ var v = { get [e]() { } }; >v : { [x: number]: void; } >{ get [e]() { } } : { [x: number]: void; } +>[e] : void >e : any diff --git a/tests/baselines/reference/parserES5ComputedPropertyName5.symbols b/tests/baselines/reference/parserES5ComputedPropertyName5.symbols index 299cb6c23fb..7c5cff30d1e 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName5.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName5.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(parserES5ComputedPropertyName5.ts, 0, 0)) [e]: number +>[e] : Symbol(I[e], Decl(parserES5ComputedPropertyName5.ts, 0, 13)) } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName5.types b/tests/baselines/reference/parserES5ComputedPropertyName5.types index 9df1fab1b4d..19b9897f75d 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName5.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName5.types @@ -3,5 +3,6 @@ interface I { >I : I [e]: number +>[e] : number >e : any } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName6.symbols b/tests/baselines/reference/parserES5ComputedPropertyName6.symbols index d09c685b047..656924faa20 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName6.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName6.symbols @@ -3,4 +3,5 @@ enum E { >E : Symbol(E, Decl(parserES5ComputedPropertyName6.ts, 0, 0)) [e] = 1 +>[e] : Symbol(E[e], Decl(parserES5ComputedPropertyName6.ts, 0, 8)) } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName6.types b/tests/baselines/reference/parserES5ComputedPropertyName6.types index 5f77bd8681b..cbfa5ec1f8d 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName6.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName6.types @@ -3,6 +3,7 @@ enum E { >E : E [e] = 1 +>[e] : E >e : any >1 : 1 } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName7.symbols b/tests/baselines/reference/parserES5ComputedPropertyName7.symbols index c30be37534c..1be6a0dc686 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName7.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName7.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserES5ComputedPropertyName7.ts, 0, 0)) [e] +>[e] : Symbol(C[e], Decl(parserES5ComputedPropertyName7.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName7.types b/tests/baselines/reference/parserES5ComputedPropertyName7.types index 692d66599d6..d48c61aac02 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName7.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName7.types @@ -3,5 +3,6 @@ class C { >C : C [e] +>[e] : any >e : any } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName8.symbols b/tests/baselines/reference/parserES5ComputedPropertyName8.symbols index bd44198fa0e..cf6da89ee7b 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName8.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName8.symbols @@ -1,4 +1,5 @@ === tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts === var v: { [e]: number }; >v : Symbol(v, Decl(parserES5ComputedPropertyName8.ts, 0, 3)) +>[e] : Symbol([e], Decl(parserES5ComputedPropertyName8.ts, 0, 8)) diff --git a/tests/baselines/reference/parserES5ComputedPropertyName8.types b/tests/baselines/reference/parserES5ComputedPropertyName8.types index d9da65c74e4..abfa93a740d 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName8.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName8.types @@ -1,5 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/ComputedPropertyNames/parserES5ComputedPropertyName8.ts === var v: { [e]: number }; >v : {} +>[e] : number >e : any diff --git a/tests/baselines/reference/parserES5ComputedPropertyName9.symbols b/tests/baselines/reference/parserES5ComputedPropertyName9.symbols index ddb8e0dceea..d0729e25c52 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName9.symbols +++ b/tests/baselines/reference/parserES5ComputedPropertyName9.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserES5ComputedPropertyName9.ts, 0, 0)) [e]: Type +>[e] : Symbol(C[e], Decl(parserES5ComputedPropertyName9.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserES5ComputedPropertyName9.types b/tests/baselines/reference/parserES5ComputedPropertyName9.types index cf9ae6555e9..e512cd899d7 100644 --- a/tests/baselines/reference/parserES5ComputedPropertyName9.types +++ b/tests/baselines/reference/parserES5ComputedPropertyName9.types @@ -3,6 +3,7 @@ class C { >C : C [e]: Type +>[e] : any >e : any >Type : No type information available! } diff --git a/tests/baselines/reference/parserES5SymbolProperty1.symbols b/tests/baselines/reference/parserES5SymbolProperty1.symbols index 215a1da6cee..59d4873242b 100644 --- a/tests/baselines/reference/parserES5SymbolProperty1.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty1.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(parserES5SymbolProperty1.ts, 0, 0)) [Symbol.iterator]: string; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(parserES5SymbolProperty1.ts, 0, 13)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty1.types b/tests/baselines/reference/parserES5SymbolProperty1.types index 0c5b8c43edd..0669a6687e4 100644 --- a/tests/baselines/reference/parserES5SymbolProperty1.types +++ b/tests/baselines/reference/parserES5SymbolProperty1.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.iterator]: string; +>[Symbol.iterator] : string >Symbol.iterator : any >Symbol : any >iterator : any diff --git a/tests/baselines/reference/parserES5SymbolProperty2.symbols b/tests/baselines/reference/parserES5SymbolProperty2.symbols index 9a05f6dcb5e..6c5b4826630 100644 --- a/tests/baselines/reference/parserES5SymbolProperty2.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty2.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(parserES5SymbolProperty2.ts, 0, 0)) [Symbol.unscopables](): string; +>[Symbol.unscopables] : Symbol(I[Symbol.unscopables], Decl(parserES5SymbolProperty2.ts, 0, 13)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty2.types b/tests/baselines/reference/parserES5SymbolProperty2.types index 4a877372b1b..9c3b7d36dca 100644 --- a/tests/baselines/reference/parserES5SymbolProperty2.types +++ b/tests/baselines/reference/parserES5SymbolProperty2.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.unscopables](): string; +>[Symbol.unscopables] : () => string >Symbol.unscopables : any >Symbol : any >unscopables : any diff --git a/tests/baselines/reference/parserES5SymbolProperty3.symbols b/tests/baselines/reference/parserES5SymbolProperty3.symbols index 0ffa04e006b..b4c06288524 100644 --- a/tests/baselines/reference/parserES5SymbolProperty3.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty3.symbols @@ -3,4 +3,5 @@ declare class C { >C : Symbol(C, Decl(parserES5SymbolProperty3.ts, 0, 0)) [Symbol.unscopables](): string; +>[Symbol.unscopables] : Symbol(C[Symbol.unscopables], Decl(parserES5SymbolProperty3.ts, 0, 17)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty3.types b/tests/baselines/reference/parserES5SymbolProperty3.types index 8f6c3fe15c0..1ec96ca93c8 100644 --- a/tests/baselines/reference/parserES5SymbolProperty3.types +++ b/tests/baselines/reference/parserES5SymbolProperty3.types @@ -3,6 +3,7 @@ declare class C { >C : C [Symbol.unscopables](): string; +>[Symbol.unscopables] : () => string >Symbol.unscopables : any >Symbol : any >unscopables : any diff --git a/tests/baselines/reference/parserES5SymbolProperty4.symbols b/tests/baselines/reference/parserES5SymbolProperty4.symbols index 3ea1673ef2a..859e695a215 100644 --- a/tests/baselines/reference/parserES5SymbolProperty4.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty4.symbols @@ -3,4 +3,5 @@ declare class C { >C : Symbol(C, Decl(parserES5SymbolProperty4.ts, 0, 0)) [Symbol.isRegExp]: string; +>[Symbol.isRegExp] : Symbol(C[Symbol.isRegExp], Decl(parserES5SymbolProperty4.ts, 0, 17)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty4.types b/tests/baselines/reference/parserES5SymbolProperty4.types index 1dd6171facb..a3dd5e8adde 100644 --- a/tests/baselines/reference/parserES5SymbolProperty4.types +++ b/tests/baselines/reference/parserES5SymbolProperty4.types @@ -3,6 +3,7 @@ declare class C { >C : C [Symbol.isRegExp]: string; +>[Symbol.isRegExp] : string >Symbol.isRegExp : any >Symbol : any >isRegExp : any diff --git a/tests/baselines/reference/parserES5SymbolProperty5.symbols b/tests/baselines/reference/parserES5SymbolProperty5.symbols index 03b5b806dfc..431ecf47f1c 100644 --- a/tests/baselines/reference/parserES5SymbolProperty5.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty5.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserES5SymbolProperty5.ts, 0, 0)) [Symbol.isRegExp]: string; +>[Symbol.isRegExp] : Symbol(C[Symbol.isRegExp], Decl(parserES5SymbolProperty5.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty5.types b/tests/baselines/reference/parserES5SymbolProperty5.types index 19fd3cac1ce..d01fd908658 100644 --- a/tests/baselines/reference/parserES5SymbolProperty5.types +++ b/tests/baselines/reference/parserES5SymbolProperty5.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.isRegExp]: string; +>[Symbol.isRegExp] : string >Symbol.isRegExp : any >Symbol : any >isRegExp : any diff --git a/tests/baselines/reference/parserES5SymbolProperty6.symbols b/tests/baselines/reference/parserES5SymbolProperty6.symbols index 7fb8fd14c91..20c578dbe49 100644 --- a/tests/baselines/reference/parserES5SymbolProperty6.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty6.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserES5SymbolProperty6.ts, 0, 0)) [Symbol.toStringTag]: string = ""; +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(parserES5SymbolProperty6.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty6.types b/tests/baselines/reference/parserES5SymbolProperty6.types index 9b0af99eed0..65ee1cf7e81 100644 --- a/tests/baselines/reference/parserES5SymbolProperty6.types +++ b/tests/baselines/reference/parserES5SymbolProperty6.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.toStringTag]: string = ""; +>[Symbol.toStringTag] : string >Symbol.toStringTag : any >Symbol : any >toStringTag : any diff --git a/tests/baselines/reference/parserES5SymbolProperty7.symbols b/tests/baselines/reference/parserES5SymbolProperty7.symbols index 0f178144f14..b92c7a6233b 100644 --- a/tests/baselines/reference/parserES5SymbolProperty7.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty7.symbols @@ -3,4 +3,5 @@ class C { >C : Symbol(C, Decl(parserES5SymbolProperty7.ts, 0, 0)) [Symbol.toStringTag](): void { } +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(parserES5SymbolProperty7.ts, 0, 9)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty7.types b/tests/baselines/reference/parserES5SymbolProperty7.types index 6dd243ded48..0d526215868 100644 --- a/tests/baselines/reference/parserES5SymbolProperty7.types +++ b/tests/baselines/reference/parserES5SymbolProperty7.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.toStringTag](): void { } +>[Symbol.toStringTag] : () => void >Symbol.toStringTag : any >Symbol : any >toStringTag : any diff --git a/tests/baselines/reference/parserES5SymbolProperty8.symbols b/tests/baselines/reference/parserES5SymbolProperty8.symbols index 11abec9ccf3..c88b01476b8 100644 --- a/tests/baselines/reference/parserES5SymbolProperty8.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty8.symbols @@ -3,4 +3,5 @@ var x: { >x : Symbol(x, Decl(parserES5SymbolProperty8.ts, 0, 3)) [Symbol.toPrimitive](): string +>[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(parserES5SymbolProperty8.ts, 0, 8)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty8.types b/tests/baselines/reference/parserES5SymbolProperty8.types index 8d093a82410..fcafdfd2ae2 100644 --- a/tests/baselines/reference/parserES5SymbolProperty8.types +++ b/tests/baselines/reference/parserES5SymbolProperty8.types @@ -3,6 +3,7 @@ var x: { >x : { [Symbol.toPrimitive](): string; } [Symbol.toPrimitive](): string +>[Symbol.toPrimitive] : () => string >Symbol.toPrimitive : any >Symbol : any >toPrimitive : any diff --git a/tests/baselines/reference/parserES5SymbolProperty9.symbols b/tests/baselines/reference/parserES5SymbolProperty9.symbols index e704745c57f..4ee82c0838e 100644 --- a/tests/baselines/reference/parserES5SymbolProperty9.symbols +++ b/tests/baselines/reference/parserES5SymbolProperty9.symbols @@ -3,4 +3,5 @@ var x: { >x : Symbol(x, Decl(parserES5SymbolProperty9.ts, 0, 3)) [Symbol.toPrimitive]: string +>[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(parserES5SymbolProperty9.ts, 0, 8)) } diff --git a/tests/baselines/reference/parserES5SymbolProperty9.types b/tests/baselines/reference/parserES5SymbolProperty9.types index 42cea2f7d6b..b5568a201a5 100644 --- a/tests/baselines/reference/parserES5SymbolProperty9.types +++ b/tests/baselines/reference/parserES5SymbolProperty9.types @@ -3,6 +3,7 @@ var x: { >x : { [Symbol.toPrimitive]: string; } [Symbol.toPrimitive]: string +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : any >Symbol : any >toPrimitive : any diff --git a/tests/baselines/reference/parserIndexSignature11.symbols b/tests/baselines/reference/parserIndexSignature11.symbols index 3d55137d8da..5eebd513861 100644 --- a/tests/baselines/reference/parserIndexSignature11.symbols +++ b/tests/baselines/reference/parserIndexSignature11.symbols @@ -3,6 +3,8 @@ interface I { >I : Symbol(I, Decl(parserIndexSignature11.ts, 0, 0)) [p]; // Used to be indexer, now it is a computed property +>[p] : Symbol(I[p], Decl(parserIndexSignature11.ts, 0, 13)) + [p1: string]; >p1 : Symbol(p1, Decl(parserIndexSignature11.ts, 2, 9)) diff --git a/tests/baselines/reference/parserIndexSignature11.types b/tests/baselines/reference/parserIndexSignature11.types index 0e416c51c31..8f92ba730dd 100644 --- a/tests/baselines/reference/parserIndexSignature11.types +++ b/tests/baselines/reference/parserIndexSignature11.types @@ -3,6 +3,7 @@ interface I { >I : I [p]; // Used to be indexer, now it is a computed property +>[p] : any >p : any [p1: string]; diff --git a/tests/baselines/reference/parserIndexSignature4.symbols b/tests/baselines/reference/parserIndexSignature4.symbols index 9a7e61faa8f..21f60b0972b 100644 --- a/tests/baselines/reference/parserIndexSignature4.symbols +++ b/tests/baselines/reference/parserIndexSignature4.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(parserIndexSignature4.ts, 0, 0)) [a = 0] // Used to be indexer, now it is a computed property +>[a = 0] : Symbol(I[a = 0], Decl(parserIndexSignature4.ts, 0, 13)) } diff --git a/tests/baselines/reference/parserIndexSignature4.types b/tests/baselines/reference/parserIndexSignature4.types index 1f2d974c34c..78668a036d1 100644 --- a/tests/baselines/reference/parserIndexSignature4.types +++ b/tests/baselines/reference/parserIndexSignature4.types @@ -3,6 +3,7 @@ interface I { >I : I [a = 0] // Used to be indexer, now it is a computed property +>[a = 0] : any >a = 0 : 0 >a : any >0 : 0 diff --git a/tests/baselines/reference/parserIndexSignature5.symbols b/tests/baselines/reference/parserIndexSignature5.symbols index 5193b0f4c88..034be1fe602 100644 --- a/tests/baselines/reference/parserIndexSignature5.symbols +++ b/tests/baselines/reference/parserIndexSignature5.symbols @@ -3,4 +3,5 @@ interface I { >I : Symbol(I, Decl(parserIndexSignature5.ts, 0, 0)) [a] // Used to be indexer, now it is a computed property +>[a] : Symbol(I[a], Decl(parserIndexSignature5.ts, 0, 13)) } diff --git a/tests/baselines/reference/parserIndexSignature5.types b/tests/baselines/reference/parserIndexSignature5.types index 4f80d10ef0c..c8ccf44b177 100644 --- a/tests/baselines/reference/parserIndexSignature5.types +++ b/tests/baselines/reference/parserIndexSignature5.types @@ -3,5 +3,6 @@ interface I { >I : I [a] // Used to be indexer, now it is a computed property +>[a] : any >a : any } diff --git a/tests/baselines/reference/parserSymbolIndexer5.symbols b/tests/baselines/reference/parserSymbolIndexer5.symbols index 7a5a49a8a88..b31df9cdd76 100644 --- a/tests/baselines/reference/parserSymbolIndexer5.symbols +++ b/tests/baselines/reference/parserSymbolIndexer5.symbols @@ -3,5 +3,6 @@ var x = { >x : Symbol(x, Decl(parserSymbolIndexer5.ts, 0, 3)) [s: symbol]: "" +>[s : Symbol([s, Decl(parserSymbolIndexer5.ts, 0, 9)) >"" : Symbol("", Decl(parserSymbolIndexer5.ts, 1, 16)) } diff --git a/tests/baselines/reference/parserSymbolIndexer5.types b/tests/baselines/reference/parserSymbolIndexer5.types index 171ec57d05a..e7a51c52393 100644 --- a/tests/baselines/reference/parserSymbolIndexer5.types +++ b/tests/baselines/reference/parserSymbolIndexer5.types @@ -4,6 +4,7 @@ var x = { >{ [s: symbol]: ""} : { [x: number]: any; "": any; } [s: symbol]: "" +>[s : any >s : any >symbol : any >"" : any diff --git a/tests/baselines/reference/parserSymbolProperty1.symbols b/tests/baselines/reference/parserSymbolProperty1.symbols index 4622f37a0e4..c9948c71f5d 100644 --- a/tests/baselines/reference/parserSymbolProperty1.symbols +++ b/tests/baselines/reference/parserSymbolProperty1.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(parserSymbolProperty1.ts, 0, 0)) [Symbol.iterator]: string; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(parserSymbolProperty1.ts, 0, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty1.types b/tests/baselines/reference/parserSymbolProperty1.types index 6c0cd75cf59..29ea682a2bd 100644 --- a/tests/baselines/reference/parserSymbolProperty1.types +++ b/tests/baselines/reference/parserSymbolProperty1.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.iterator]: string; +>[Symbol.iterator] : string >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/parserSymbolProperty2.symbols b/tests/baselines/reference/parserSymbolProperty2.symbols index f5bb7fa0f53..e1c31fa2940 100644 --- a/tests/baselines/reference/parserSymbolProperty2.symbols +++ b/tests/baselines/reference/parserSymbolProperty2.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(parserSymbolProperty2.ts, 0, 0)) [Symbol.unscopables](): string; +>[Symbol.unscopables] : Symbol(I[Symbol.unscopables], Decl(parserSymbolProperty2.ts, 0, 13)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty2.types b/tests/baselines/reference/parserSymbolProperty2.types index bcf14b83a2a..e6f207ec766 100644 --- a/tests/baselines/reference/parserSymbolProperty2.types +++ b/tests/baselines/reference/parserSymbolProperty2.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.unscopables](): string; +>[Symbol.unscopables] : () => string >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol diff --git a/tests/baselines/reference/parserSymbolProperty3.symbols b/tests/baselines/reference/parserSymbolProperty3.symbols index 9d2266ad4b7..fb57f20fcdc 100644 --- a/tests/baselines/reference/parserSymbolProperty3.symbols +++ b/tests/baselines/reference/parserSymbolProperty3.symbols @@ -3,6 +3,7 @@ declare class C { >C : Symbol(C, Decl(parserSymbolProperty3.ts, 0, 0)) [Symbol.unscopables](): string; +>[Symbol.unscopables] : Symbol(C[Symbol.unscopables], Decl(parserSymbolProperty3.ts, 0, 17)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty3.types b/tests/baselines/reference/parserSymbolProperty3.types index 977375d7393..342b8f979b6 100644 --- a/tests/baselines/reference/parserSymbolProperty3.types +++ b/tests/baselines/reference/parserSymbolProperty3.types @@ -3,6 +3,7 @@ declare class C { >C : C [Symbol.unscopables](): string; +>[Symbol.unscopables] : () => string >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol diff --git a/tests/baselines/reference/parserSymbolProperty4.symbols b/tests/baselines/reference/parserSymbolProperty4.symbols index e37cb6bc011..4ce7bcc16c7 100644 --- a/tests/baselines/reference/parserSymbolProperty4.symbols +++ b/tests/baselines/reference/parserSymbolProperty4.symbols @@ -3,6 +3,7 @@ declare class C { >C : Symbol(C, Decl(parserSymbolProperty4.ts, 0, 0)) [Symbol.toPrimitive]: string; +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(parserSymbolProperty4.ts, 0, 17)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty4.types b/tests/baselines/reference/parserSymbolProperty4.types index dbf65454826..d59c507d1d2 100644 --- a/tests/baselines/reference/parserSymbolProperty4.types +++ b/tests/baselines/reference/parserSymbolProperty4.types @@ -3,6 +3,7 @@ declare class C { >C : C [Symbol.toPrimitive]: string; +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/parserSymbolProperty5.symbols b/tests/baselines/reference/parserSymbolProperty5.symbols index f8fb7d93417..6db6514ce24 100644 --- a/tests/baselines/reference/parserSymbolProperty5.symbols +++ b/tests/baselines/reference/parserSymbolProperty5.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty5.ts, 0, 0)) [Symbol.toPrimitive]: string; +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(parserSymbolProperty5.ts, 0, 9)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty5.types b/tests/baselines/reference/parserSymbolProperty5.types index c854aa6a26d..0c07379a4eb 100644 --- a/tests/baselines/reference/parserSymbolProperty5.types +++ b/tests/baselines/reference/parserSymbolProperty5.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.toPrimitive]: string; +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/parserSymbolProperty6.symbols b/tests/baselines/reference/parserSymbolProperty6.symbols index 7fb83ea9ffa..b880b7a6ebb 100644 --- a/tests/baselines/reference/parserSymbolProperty6.symbols +++ b/tests/baselines/reference/parserSymbolProperty6.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty6.ts, 0, 0)) [Symbol.toStringTag]: string = ""; +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(parserSymbolProperty6.ts, 0, 9)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty6.types b/tests/baselines/reference/parserSymbolProperty6.types index 13553eb27c6..fb2003b9db9 100644 --- a/tests/baselines/reference/parserSymbolProperty6.types +++ b/tests/baselines/reference/parserSymbolProperty6.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.toStringTag]: string = ""; +>[Symbol.toStringTag] : string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/parserSymbolProperty7.symbols b/tests/baselines/reference/parserSymbolProperty7.symbols index 8d71cbb1a0d..6d636a7186e 100644 --- a/tests/baselines/reference/parserSymbolProperty7.symbols +++ b/tests/baselines/reference/parserSymbolProperty7.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty7.ts, 0, 0)) [Symbol.toStringTag](): void { } +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(parserSymbolProperty7.ts, 0, 9)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty7.types b/tests/baselines/reference/parserSymbolProperty7.types index f8dc2523692..9ac1ca2f7d3 100644 --- a/tests/baselines/reference/parserSymbolProperty7.types +++ b/tests/baselines/reference/parserSymbolProperty7.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.toStringTag](): void { } +>[Symbol.toStringTag] : () => void >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/parserSymbolProperty8.symbols b/tests/baselines/reference/parserSymbolProperty8.symbols index e20dd2dbba4..7256a92cb23 100644 --- a/tests/baselines/reference/parserSymbolProperty8.symbols +++ b/tests/baselines/reference/parserSymbolProperty8.symbols @@ -3,6 +3,7 @@ var x: { >x : Symbol(x, Decl(parserSymbolProperty8.ts, 0, 3)) [Symbol.toPrimitive](): string +>[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(parserSymbolProperty8.ts, 0, 8)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty8.types b/tests/baselines/reference/parserSymbolProperty8.types index 06387c9c231..dfac5669435 100644 --- a/tests/baselines/reference/parserSymbolProperty8.types +++ b/tests/baselines/reference/parserSymbolProperty8.types @@ -3,6 +3,7 @@ var x: { >x : { [Symbol.toPrimitive](): string; } [Symbol.toPrimitive](): string +>[Symbol.toPrimitive] : () => string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/parserSymbolProperty9.symbols b/tests/baselines/reference/parserSymbolProperty9.symbols index c70643c254a..466cf163f2c 100644 --- a/tests/baselines/reference/parserSymbolProperty9.symbols +++ b/tests/baselines/reference/parserSymbolProperty9.symbols @@ -3,6 +3,7 @@ var x: { >x : Symbol(x, Decl(parserSymbolProperty9.ts, 0, 3)) [Symbol.toPrimitive]: string +>[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(parserSymbolProperty9.ts, 0, 8)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/parserSymbolProperty9.types b/tests/baselines/reference/parserSymbolProperty9.types index 40fbde2acff..48d3f56a2f3 100644 --- a/tests/baselines/reference/parserSymbolProperty9.types +++ b/tests/baselines/reference/parserSymbolProperty9.types @@ -3,6 +3,7 @@ var x: { >x : { [Symbol.toPrimitive]: string; } [Symbol.toPrimitive]: string +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/privateIndexer2.symbols b/tests/baselines/reference/privateIndexer2.symbols index c680e109b64..26f3c819114 100644 --- a/tests/baselines/reference/privateIndexer2.symbols +++ b/tests/baselines/reference/privateIndexer2.symbols @@ -5,6 +5,7 @@ var x = { >x : Symbol(x, Decl(privateIndexer2.ts, 2, 3)) private [x: string]: string; +>[x : Symbol([x, Decl(privateIndexer2.ts, 2, 9)) >x : Symbol(x, Decl(privateIndexer2.ts, 2, 3)) >string : Symbol(string, Decl(privateIndexer2.ts, 3, 24)) } diff --git a/tests/baselines/reference/privateIndexer2.types b/tests/baselines/reference/privateIndexer2.types index e63a3845101..fcfabc3f799 100644 --- a/tests/baselines/reference/privateIndexer2.types +++ b/tests/baselines/reference/privateIndexer2.types @@ -6,6 +6,7 @@ var x = { >{ private [x: string]: string;} : { [x: number]: any; string: any; } private [x: string]: string; +>[x : any >x : any >string : any >string : any diff --git a/tests/baselines/reference/propertyAssignment.symbols b/tests/baselines/reference/propertyAssignment.symbols index 26a05c884ed..b42b2b2f7fc 100644 --- a/tests/baselines/reference/propertyAssignment.symbols +++ b/tests/baselines/reference/propertyAssignment.symbols @@ -8,6 +8,7 @@ var bar1: { x : number; } var foo2: { [index]; } // should be an error, used to be indexer, now it is a computed property >foo2 : Symbol(foo2, Decl(propertyAssignment.ts, 3, 3)) +>[index] : Symbol([index], Decl(propertyAssignment.ts, 3, 11)) var bar2: { x : number; } >bar2 : Symbol(bar2, Decl(propertyAssignment.ts, 4, 3)) diff --git a/tests/baselines/reference/propertyAssignment.types b/tests/baselines/reference/propertyAssignment.types index 0bf6dee76d6..dd4e22f1243 100644 --- a/tests/baselines/reference/propertyAssignment.types +++ b/tests/baselines/reference/propertyAssignment.types @@ -8,6 +8,7 @@ var bar1: { x : number; } var foo2: { [index]; } // should be an error, used to be indexer, now it is a computed property >foo2 : {} +>[index] : any >index : any var bar2: { x : number; } diff --git a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt index 044e4ee0f2b..1e2f7bc9114 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt @@ -2,13 +2,13 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW Type 'string' is not assignable to type 'Base'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(24,5): error TS2416: Property '2' in type 'B2' is not assignable to the same property in base type 'A2'. Type 'string' is not assignable to type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(34,5): error TS2416: Property '2.0' in type 'B3' is not assignable to the same property in base type 'A3'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(34,5): error TS2416: Property ''2.0'' in type 'B3' is not assignable to the same property in base type 'A3'. Type 'string' is not assignable to type 'Base'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(45,9): error TS2416: Property 'bar' in type 'B' is not assignable to the same property in base type 'A'. Type 'string' is not assignable to type 'Base'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(55,9): error TS2416: Property '2' in type 'B2' is not assignable to the same property in base type 'A2'. Type 'string' is not assignable to type 'Base'. -tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(65,9): error TS2416: Property '2.0' in type 'B3' is not assignable to the same property in base type 'A3'. +tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(65,9): error TS2416: Property ''2.0'' in type 'B3' is not assignable to the same property in base type 'A3'. Type 'string' is not assignable to type 'Base'. @@ -54,7 +54,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW '1': Derived; // ok '2.0': string; // error ~~~~~ -!!! error TS2416: Property '2.0' in type 'B3' is not assignable to the same property in base type 'A3'. +!!! error TS2416: Property ''2.0'' in type 'B3' is not assignable to the same property in base type 'A3'. !!! error TS2416: Type 'string' is not assignable to type 'Base'. } @@ -94,7 +94,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW '1': Derived2; // ok '2.0': string; // error ~~~~~ -!!! error TS2416: Property '2.0' in type 'B3' is not assignable to the same property in base type 'A3'. +!!! error TS2416: Property ''2.0'' in type 'B3' is not assignable to the same property in base type 'A3'. !!! error TS2416: Type 'string' is not assignable to type 'Base'. } } \ No newline at end of file diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.symbols b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.symbols index d29cfed7084..766aa9cd33c 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.symbols +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.symbols @@ -18,6 +18,7 @@ class B extends A { return class { [super.foo()]() { +>[super.foo()] : Symbol((Anonymous class)[super.foo()], Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES5.ts, 7, 22)) >super.foo : Symbol(A.foo, Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES5.ts, 0, 9)) >super : Symbol(A, Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES5.ts, 0, 0)) >foo : Symbol(A.foo, Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES5.ts, 0, 9)) diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types index 78af8fdf0b9..33e9699c044 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.types @@ -22,6 +22,7 @@ class B extends A { >class { [super.foo()]() { return 100; } } : typeof (Anonymous class) [super.foo()]() { +>[super.foo()] : () => number >super.foo() : number >super.foo : () => number >super : A diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.symbols b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.symbols index 2eae0080f4b..fd80f6e430c 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.symbols +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.symbols @@ -18,6 +18,7 @@ class B extends A { return class { [super.foo()]() { +>[super.foo()] : Symbol((Anonymous class)[super.foo()], Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES6.ts, 7, 22)) >super.foo : Symbol(A.foo, Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES6.ts, 0, 9)) >super : Symbol(A, Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES6.ts, 0, 0)) >foo : Symbol(A.foo, Decl(superPropertyAccessInComputedPropertiesOfNestedType_ES6.ts, 0, 9)) diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types index 0e3d295fc88..8948b046957 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES6.types @@ -22,6 +22,7 @@ class B extends A { >class { [super.foo()]() { return 100; } } : typeof (Anonymous class) [super.foo()]() { +>[super.foo()] : () => number >super.foo() : number >super.foo : () => number >super : A diff --git a/tests/baselines/reference/superSymbolIndexedAccess1.symbols b/tests/baselines/reference/superSymbolIndexedAccess1.symbols index 9141771f0c9..6ef96502a88 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess1.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess1.symbols @@ -9,6 +9,7 @@ class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess1.ts, 0, 35)) [symbol]() { +>[symbol] : Symbol(Foo[symbol], Decl(superSymbolIndexedAccess1.ts, 2, 11)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess1.ts, 0, 3)) return 0; @@ -20,6 +21,7 @@ class Bar extends Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess1.ts, 0, 35)) [symbol]() { +>[symbol] : Symbol(Bar[symbol], Decl(superSymbolIndexedAccess1.ts, 8, 23)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess1.ts, 0, 3)) return super[symbol](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess1.types b/tests/baselines/reference/superSymbolIndexedAccess1.types index ab09528b04b..11b67cadfcd 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess1.types +++ b/tests/baselines/reference/superSymbolIndexedAccess1.types @@ -11,6 +11,7 @@ class Foo { >Foo : Foo [symbol]() { +>[symbol] : () => number >symbol : symbol return 0; @@ -23,6 +24,7 @@ class Bar extends Foo { >Foo : Foo [symbol]() { +>[symbol] : () => any >symbol : symbol return super[symbol](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess2.symbols b/tests/baselines/reference/superSymbolIndexedAccess2.symbols index 1e10d3a9f94..dc0a67454af 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess2.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess2.symbols @@ -3,6 +3,7 @@ class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess2.ts, 0, 0)) [Symbol.isConcatSpreadable]() { +>[Symbol.isConcatSpreadable] : Symbol(Foo[Symbol.isConcatSpreadable], Decl(superSymbolIndexedAccess2.ts, 0, 11)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -16,6 +17,7 @@ class Bar extends Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess2.ts, 0, 0)) [Symbol.isConcatSpreadable]() { +>[Symbol.isConcatSpreadable] : Symbol(Bar[Symbol.isConcatSpreadable], Decl(superSymbolIndexedAccess2.ts, 6, 23)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/superSymbolIndexedAccess2.types b/tests/baselines/reference/superSymbolIndexedAccess2.types index 3811c25f2fd..f76c7684440 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess2.types +++ b/tests/baselines/reference/superSymbolIndexedAccess2.types @@ -3,6 +3,7 @@ class Foo { >Foo : Foo [Symbol.isConcatSpreadable]() { +>[Symbol.isConcatSpreadable] : () => number >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol @@ -17,6 +18,7 @@ class Bar extends Foo { >Foo : Foo [Symbol.isConcatSpreadable]() { +>[Symbol.isConcatSpreadable] : () => number >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/superSymbolIndexedAccess3.symbols b/tests/baselines/reference/superSymbolIndexedAccess3.symbols index 6fde2737c91..1cee3a367ad 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess3.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess3.symbols @@ -9,6 +9,7 @@ class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess3.ts, 0, 35)) [symbol]() { +>[symbol] : Symbol(Foo[symbol], Decl(superSymbolIndexedAccess3.ts, 2, 11)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess3.ts, 0, 3)) return 0; @@ -20,6 +21,7 @@ class Bar extends Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess3.ts, 0, 35)) [symbol]() { +>[symbol] : Symbol(Bar[symbol], Decl(superSymbolIndexedAccess3.ts, 8, 23)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess3.ts, 0, 3)) return super[Bar](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess3.types b/tests/baselines/reference/superSymbolIndexedAccess3.types index 576a18c72e1..72cdb9c4204 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess3.types +++ b/tests/baselines/reference/superSymbolIndexedAccess3.types @@ -11,6 +11,7 @@ class Foo { >Foo : Foo [symbol]() { +>[symbol] : () => number >symbol : symbol return 0; @@ -23,6 +24,7 @@ class Bar extends Foo { >Foo : Foo [symbol]() { +>[symbol] : () => any >symbol : symbol return super[Bar](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess4.symbols b/tests/baselines/reference/superSymbolIndexedAccess4.symbols index 8254361ecef..f8fad9b0e87 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess4.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess4.symbols @@ -9,6 +9,7 @@ class Bar { >Bar : Symbol(Bar, Decl(superSymbolIndexedAccess4.ts, 0, 35)) [symbol]() { +>[symbol] : Symbol(Bar[symbol], Decl(superSymbolIndexedAccess4.ts, 2, 11)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess4.ts, 0, 3)) return super[symbol](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess4.types b/tests/baselines/reference/superSymbolIndexedAccess4.types index 73f56ab32c5..a1a4d6ddd30 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess4.types +++ b/tests/baselines/reference/superSymbolIndexedAccess4.types @@ -11,6 +11,7 @@ class Bar { >Bar : Bar [symbol]() { +>[symbol] : () => any >symbol : symbol return super[symbol](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.symbols b/tests/baselines/reference/superSymbolIndexedAccess5.symbols index 98ff04a25cd..e6f3c2b4364 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess5.symbols @@ -6,6 +6,7 @@ class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16)) [symbol]() { +>[symbol] : Symbol(Foo[symbol], Decl(superSymbolIndexedAccess5.ts, 2, 11)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3)) return 0; @@ -17,6 +18,7 @@ class Bar extends Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess5.ts, 0, 16)) [symbol]() { +>[symbol] : Symbol(Bar[symbol], Decl(superSymbolIndexedAccess5.ts, 8, 23)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess5.ts, 0, 3)) return super[symbol](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.types b/tests/baselines/reference/superSymbolIndexedAccess5.types index 745fd81b8f8..cbbd98ee320 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.types +++ b/tests/baselines/reference/superSymbolIndexedAccess5.types @@ -6,6 +6,7 @@ class Foo { >Foo : Foo [symbol]() { +>[symbol] : () => number >symbol : any return 0; @@ -18,6 +19,7 @@ class Bar extends Foo { >Foo : Foo [symbol]() { +>[symbol] : () => any >symbol : any return super[symbol](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.symbols b/tests/baselines/reference/superSymbolIndexedAccess6.symbols index a79a6552674..04ecd8cd809 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess6.symbols @@ -6,6 +6,7 @@ class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16)) static [symbol]() { +>[symbol] : Symbol(Foo[symbol], Decl(superSymbolIndexedAccess6.ts, 2, 11)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3)) return 0; @@ -17,6 +18,7 @@ class Bar extends Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess6.ts, 0, 16)) static [symbol]() { +>[symbol] : Symbol(Bar[symbol], Decl(superSymbolIndexedAccess6.ts, 8, 23)) >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess6.ts, 0, 3)) return super[symbol](); diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.types b/tests/baselines/reference/superSymbolIndexedAccess6.types index 11c4a0e553b..dab66292718 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.types +++ b/tests/baselines/reference/superSymbolIndexedAccess6.types @@ -6,6 +6,7 @@ class Foo { >Foo : Foo static [symbol]() { +>[symbol] : () => number >symbol : any return 0; @@ -18,6 +19,7 @@ class Bar extends Foo { >Foo : Foo static [symbol]() { +>[symbol] : () => any >symbol : any return super[symbol](); diff --git a/tests/baselines/reference/symbolDeclarationEmit1.symbols b/tests/baselines/reference/symbolDeclarationEmit1.symbols index 86f57e7de92..da66458a88a 100644 --- a/tests/baselines/reference/symbolDeclarationEmit1.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit1.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit1.ts, 0, 0)) [Symbol.toPrimitive]: number; +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit1.ts, 0, 9)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit1.types b/tests/baselines/reference/symbolDeclarationEmit1.types index 741f2a74bd7..0493f5b3272 100644 --- a/tests/baselines/reference/symbolDeclarationEmit1.types +++ b/tests/baselines/reference/symbolDeclarationEmit1.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.toPrimitive]: number; +>[Symbol.toPrimitive] : number >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit10.symbols b/tests/baselines/reference/symbolDeclarationEmit10.symbols index bcc562e478e..cbaf7082ce6 100644 --- a/tests/baselines/reference/symbolDeclarationEmit10.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit10.symbols @@ -3,11 +3,13 @@ var obj = { >obj : Symbol(obj, Decl(symbolDeclarationEmit10.ts, 0, 3)) get [Symbol.isConcatSpreadable]() { return '' }, +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit10.ts, 0, 11), Decl(symbolDeclarationEmit10.ts, 1, 52)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) set [Symbol.isConcatSpreadable](x) { } +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit10.ts, 0, 11), Decl(symbolDeclarationEmit10.ts, 1, 52)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit10.types b/tests/baselines/reference/symbolDeclarationEmit10.types index d7f5c861e89..9a47c891739 100644 --- a/tests/baselines/reference/symbolDeclarationEmit10.types +++ b/tests/baselines/reference/symbolDeclarationEmit10.types @@ -4,12 +4,14 @@ var obj = { >{ get [Symbol.isConcatSpreadable]() { return '' }, set [Symbol.isConcatSpreadable](x) { }} : { [Symbol.isConcatSpreadable]: string; } get [Symbol.isConcatSpreadable]() { return '' }, +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol >'' : "" set [Symbol.isConcatSpreadable](x) { } +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit11.symbols b/tests/baselines/reference/symbolDeclarationEmit11.symbols index 8b270daad5e..67e0f464b77 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit11.symbols @@ -3,21 +3,25 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit11.ts, 0, 0)) static [Symbol.iterator] = 0; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolDeclarationEmit11.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) static [Symbol.isConcatSpreadable]() { } +>[Symbol.isConcatSpreadable] : Symbol(C[Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit11.ts, 1, 33)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) static get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit11.ts, 2, 44), Decl(symbolDeclarationEmit11.ts, 3, 52)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) static set [Symbol.toPrimitive](x) { } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit11.ts, 2, 44), Decl(symbolDeclarationEmit11.ts, 3, 52)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit11.types b/tests/baselines/reference/symbolDeclarationEmit11.types index d75c3683e97..2d9c9a95e08 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.types +++ b/tests/baselines/reference/symbolDeclarationEmit11.types @@ -3,23 +3,27 @@ class C { >C : C static [Symbol.iterator] = 0; +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >0 : 0 static [Symbol.isConcatSpreadable]() { } +>[Symbol.isConcatSpreadable] : () => void >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol static get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >"" : "" static set [Symbol.toPrimitive](x) { } +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit12.symbols b/tests/baselines/reference/symbolDeclarationEmit12.symbols index 64d747cfbad..2ee3c9150bf 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit12.symbols @@ -9,12 +9,14 @@ module M { >C : Symbol(C, Decl(symbolDeclarationEmit12.ts, 1, 19)) [Symbol.iterator]: I; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolDeclarationEmit12.ts, 2, 20)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >I : Symbol(I, Decl(symbolDeclarationEmit12.ts, 0, 10)) [Symbol.toPrimitive](x: I) { } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit12.ts, 3, 29)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -22,6 +24,7 @@ module M { >I : Symbol(I, Decl(symbolDeclarationEmit12.ts, 0, 10)) [Symbol.isConcatSpreadable](): I { +>[Symbol.isConcatSpreadable] : Symbol(C[Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit12.ts, 4, 38)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -31,12 +34,14 @@ module M { >undefined : Symbol(undefined) } get [Symbol.toPrimitive]() { return undefined; } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit12.ts, 7, 9)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >undefined : Symbol(undefined) set [Symbol.toPrimitive](x: I) { } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit12.ts, 8, 56)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit12.types b/tests/baselines/reference/symbolDeclarationEmit12.types index 5e60aebcc0d..71a66861f9a 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.types +++ b/tests/baselines/reference/symbolDeclarationEmit12.types @@ -9,12 +9,14 @@ module M { >C : C [Symbol.iterator]: I; +>[Symbol.iterator] : I >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >I : I [Symbol.toPrimitive](x: I) { } +>[Symbol.toPrimitive] : (x: I) => void >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol @@ -22,6 +24,7 @@ module M { >I : I [Symbol.isConcatSpreadable](): I { +>[Symbol.isConcatSpreadable] : () => I >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol @@ -31,12 +34,14 @@ module M { >undefined : undefined } get [Symbol.toPrimitive]() { return undefined; } +>[Symbol.toPrimitive] : any >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >undefined : undefined set [Symbol.toPrimitive](x: I) { } +>[Symbol.toPrimitive] : I >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit13.symbols b/tests/baselines/reference/symbolDeclarationEmit13.symbols index b0884c44cb8..027e27485ae 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit13.symbols @@ -3,11 +3,13 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit13.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit13.ts, 0, 9)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) set [Symbol.toStringTag](x) { } +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(symbolDeclarationEmit13.ts, 1, 45)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit13.types b/tests/baselines/reference/symbolDeclarationEmit13.types index 9fa17acdc10..26e2087c2e9 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.types +++ b/tests/baselines/reference/symbolDeclarationEmit13.types @@ -3,12 +3,14 @@ class C { >C : C get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >"" : "" set [Symbol.toStringTag](x) { } +>[Symbol.toStringTag] : any >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit14.symbols b/tests/baselines/reference/symbolDeclarationEmit14.symbols index e20e3348309..e4226d6578d 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit14.symbols @@ -3,11 +3,13 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit14.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit14.ts, 0, 9)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) get [Symbol.toStringTag]() { return ""; } +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(symbolDeclarationEmit14.ts, 1, 45)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit14.types b/tests/baselines/reference/symbolDeclarationEmit14.types index daf7b6d5731..e8e2490e9fe 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.types +++ b/tests/baselines/reference/symbolDeclarationEmit14.types @@ -3,12 +3,14 @@ class C { >C : C get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >"" : "" get [Symbol.toStringTag]() { return ""; } +>[Symbol.toStringTag] : string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit2.symbols b/tests/baselines/reference/symbolDeclarationEmit2.symbols index 348760f0d7d..1e935bcf03a 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit2.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit2.ts, 0, 0)) [Symbol.toPrimitive] = ""; +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit2.ts, 0, 9)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit2.types b/tests/baselines/reference/symbolDeclarationEmit2.types index 23d2fac2de8..e12781ad742 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.types +++ b/tests/baselines/reference/symbolDeclarationEmit2.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.toPrimitive] = ""; +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit3.symbols b/tests/baselines/reference/symbolDeclarationEmit3.symbols index 5bb8d67984e..ef9bfc65966 100644 --- a/tests/baselines/reference/symbolDeclarationEmit3.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit3.symbols @@ -3,18 +3,21 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit3.ts, 0, 0)) [Symbol.toPrimitive](x: number); +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit3.ts, 0, 9), Decl(symbolDeclarationEmit3.ts, 1, 36), Decl(symbolDeclarationEmit3.ts, 2, 36)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 1, 25)) [Symbol.toPrimitive](x: string); +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit3.ts, 0, 9), Decl(symbolDeclarationEmit3.ts, 1, 36), Decl(symbolDeclarationEmit3.ts, 2, 36)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 2, 25)) [Symbol.toPrimitive](x: any) { } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit3.ts, 0, 9), Decl(symbolDeclarationEmit3.ts, 1, 36), Decl(symbolDeclarationEmit3.ts, 2, 36)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit3.types b/tests/baselines/reference/symbolDeclarationEmit3.types index 699a7f4c864..7166bc3fa93 100644 --- a/tests/baselines/reference/symbolDeclarationEmit3.types +++ b/tests/baselines/reference/symbolDeclarationEmit3.types @@ -3,18 +3,21 @@ class C { >C : C [Symbol.toPrimitive](x: number); +>[Symbol.toPrimitive] : { (x: number): any; (x: string): any; } >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >x : number [Symbol.toPrimitive](x: string); +>[Symbol.toPrimitive] : { (x: number): any; (x: string): any; } >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >x : string [Symbol.toPrimitive](x: any) { } +>[Symbol.toPrimitive] : { (x: number): any; (x: string): any; } >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit4.symbols b/tests/baselines/reference/symbolDeclarationEmit4.symbols index 89a4714f941..c8a580ac4b4 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit4.symbols @@ -3,11 +3,13 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit4.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit4.ts, 0, 9), Decl(symbolDeclarationEmit4.ts, 1, 45)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) set [Symbol.toPrimitive](x) { } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolDeclarationEmit4.ts, 0, 9), Decl(symbolDeclarationEmit4.ts, 1, 45)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit4.types b/tests/baselines/reference/symbolDeclarationEmit4.types index f9fa6dc581c..e73791f6901 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.types +++ b/tests/baselines/reference/symbolDeclarationEmit4.types @@ -3,12 +3,14 @@ class C { >C : C get [Symbol.toPrimitive]() { return ""; } +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >"" : "" set [Symbol.toPrimitive](x) { } +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit5.symbols b/tests/baselines/reference/symbolDeclarationEmit5.symbols index bd1049b4e00..b883652d852 100644 --- a/tests/baselines/reference/symbolDeclarationEmit5.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit5.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolDeclarationEmit5.ts, 0, 0)) [Symbol.isConcatSpreadable](): string; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit5.ts, 0, 13)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit5.types b/tests/baselines/reference/symbolDeclarationEmit5.types index 557483cf636..75fc6dc6a75 100644 --- a/tests/baselines/reference/symbolDeclarationEmit5.types +++ b/tests/baselines/reference/symbolDeclarationEmit5.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.isConcatSpreadable](): string; +>[Symbol.isConcatSpreadable] : () => string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit6.symbols b/tests/baselines/reference/symbolDeclarationEmit6.symbols index 19b86ff2b66..69c6089f9f4 100644 --- a/tests/baselines/reference/symbolDeclarationEmit6.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit6.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolDeclarationEmit6.ts, 0, 0)) [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit6.ts, 0, 13)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit6.types b/tests/baselines/reference/symbolDeclarationEmit6.types index 714467aba12..1a22dd3278b 100644 --- a/tests/baselines/reference/symbolDeclarationEmit6.types +++ b/tests/baselines/reference/symbolDeclarationEmit6.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit7.symbols b/tests/baselines/reference/symbolDeclarationEmit7.symbols index 2cf42a5c5cc..fdda05a0f25 100644 --- a/tests/baselines/reference/symbolDeclarationEmit7.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit7.symbols @@ -3,6 +3,7 @@ var obj: { >obj : Symbol(obj, Decl(symbolDeclarationEmit7.ts, 0, 3)) [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit7.ts, 0, 10)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit7.types b/tests/baselines/reference/symbolDeclarationEmit7.types index dff109e8127..207d3f0bab0 100644 --- a/tests/baselines/reference/symbolDeclarationEmit7.types +++ b/tests/baselines/reference/symbolDeclarationEmit7.types @@ -3,6 +3,7 @@ var obj: { >obj : { [Symbol.isConcatSpreadable]: string; } [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit8.symbols b/tests/baselines/reference/symbolDeclarationEmit8.symbols index bb6c4728a08..6063c4ead35 100644 --- a/tests/baselines/reference/symbolDeclarationEmit8.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit8.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolDeclarationEmit8.ts, 0, 3)) [Symbol.isConcatSpreadable]: 0 +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit8.ts, 0, 11)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit8.types b/tests/baselines/reference/symbolDeclarationEmit8.types index 4e8bfc9a9af..bf8309e4cde 100644 --- a/tests/baselines/reference/symbolDeclarationEmit8.types +++ b/tests/baselines/reference/symbolDeclarationEmit8.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.isConcatSpreadable]: 0} : { [Symbol.isConcatSpreadable]: number; } [Symbol.isConcatSpreadable]: 0 +>[Symbol.isConcatSpreadable] : number >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolDeclarationEmit9.symbols b/tests/baselines/reference/symbolDeclarationEmit9.symbols index 60fdbf63c95..5a1f048ab60 100644 --- a/tests/baselines/reference/symbolDeclarationEmit9.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit9.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolDeclarationEmit9.ts, 0, 3)) [Symbol.isConcatSpreadable]() { } +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolDeclarationEmit9.ts, 0, 11)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit9.types b/tests/baselines/reference/symbolDeclarationEmit9.types index a7a6b459fcc..176009d28c9 100644 --- a/tests/baselines/reference/symbolDeclarationEmit9.types +++ b/tests/baselines/reference/symbolDeclarationEmit9.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.isConcatSpreadable]() { }} : { [Symbol.isConcatSpreadable](): void; } [Symbol.isConcatSpreadable]() { } +>[Symbol.isConcatSpreadable] : () => void >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolProperty1.symbols b/tests/baselines/reference/symbolProperty1.symbols index 9c911623b74..28a4ccb8ea0 100644 --- a/tests/baselines/reference/symbolProperty1.symbols +++ b/tests/baselines/reference/symbolProperty1.symbols @@ -6,12 +6,15 @@ var x = { >x : Symbol(x, Decl(symbolProperty1.ts, 1, 3)) [s]: 0, +>[s] : Symbol([s], Decl(symbolProperty1.ts, 1, 9)) >s : Symbol(s, Decl(symbolProperty1.ts, 0, 3)) [s]() { }, +>[s] : Symbol([s], Decl(symbolProperty1.ts, 2, 11)) >s : Symbol(s, Decl(symbolProperty1.ts, 0, 3)) get [s]() { +>[s] : Symbol([s], Decl(symbolProperty1.ts, 3, 14)) >s : Symbol(s, Decl(symbolProperty1.ts, 0, 3)) return 0; diff --git a/tests/baselines/reference/symbolProperty1.types b/tests/baselines/reference/symbolProperty1.types index 4af154f7b27..8ee046b05da 100644 --- a/tests/baselines/reference/symbolProperty1.types +++ b/tests/baselines/reference/symbolProperty1.types @@ -7,13 +7,16 @@ var x = { >{ [s]: 0, [s]() { }, get [s]() { return 0; }} : { [x: string]: number | (() => void); } [s]: 0, +>[s] : number >s : symbol >0 : 0 [s]() { }, +>[s] : () => void >s : symbol get [s]() { +>[s] : number >s : symbol return 0; diff --git a/tests/baselines/reference/symbolProperty10.symbols b/tests/baselines/reference/symbolProperty10.symbols index 7f873742221..6da936c9c8f 100644 --- a/tests/baselines/reference/symbolProperty10.symbols +++ b/tests/baselines/reference/symbolProperty10.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty10.ts, 0, 0)) [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty10.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -13,6 +14,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty10.ts, 2, 1)) [Symbol.iterator]?: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty10.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty10.types b/tests/baselines/reference/symbolProperty10.types index 05f19d20743..bcc642e936f 100644 --- a/tests/baselines/reference/symbolProperty10.types +++ b/tests/baselines/reference/symbolProperty10.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : { x: any; y: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -13,6 +14,7 @@ interface I { >I : I [Symbol.iterator]?: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty11.symbols b/tests/baselines/reference/symbolProperty11.symbols index bd1b433ed70..5e8fd8443bc 100644 --- a/tests/baselines/reference/symbolProperty11.symbols +++ b/tests/baselines/reference/symbolProperty11.symbols @@ -6,6 +6,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty11.ts, 0, 11)) [Symbol.iterator]?: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty11.ts, 1, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty11.types b/tests/baselines/reference/symbolProperty11.types index 109bd969d55..acf95b8315f 100644 --- a/tests/baselines/reference/symbolProperty11.types +++ b/tests/baselines/reference/symbolProperty11.types @@ -6,6 +6,7 @@ interface I { >I : I [Symbol.iterator]?: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty12.symbols b/tests/baselines/reference/symbolProperty12.symbols index a35f66f3cd1..8129d7d94e9 100644 --- a/tests/baselines/reference/symbolProperty12.symbols +++ b/tests/baselines/reference/symbolProperty12.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty12.ts, 0, 0)) private [Symbol.iterator]: { x }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty12.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -12,6 +13,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty12.ts, 2, 1)) [Symbol.iterator]: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty12.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty12.types b/tests/baselines/reference/symbolProperty12.types index e9820f1c47c..16b0313d0e4 100644 --- a/tests/baselines/reference/symbolProperty12.types +++ b/tests/baselines/reference/symbolProperty12.types @@ -3,6 +3,7 @@ class C { >C : C private [Symbol.iterator]: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -12,6 +13,7 @@ interface I { >I : I [Symbol.iterator]: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty13.symbols b/tests/baselines/reference/symbolProperty13.symbols index e85e75f43d9..6facc3598b8 100644 --- a/tests/baselines/reference/symbolProperty13.symbols +++ b/tests/baselines/reference/symbolProperty13.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty13.ts, 0, 0)) [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty13.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -13,6 +14,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty13.ts, 2, 1)) [Symbol.iterator]: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty13.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty13.types b/tests/baselines/reference/symbolProperty13.types index 1e890a91085..adce2ae7cb0 100644 --- a/tests/baselines/reference/symbolProperty13.types +++ b/tests/baselines/reference/symbolProperty13.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : { x: any; y: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -13,6 +14,7 @@ interface I { >I : I [Symbol.iterator]: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty14.symbols b/tests/baselines/reference/symbolProperty14.symbols index b13fbbc1f41..81cd506214a 100644 --- a/tests/baselines/reference/symbolProperty14.symbols +++ b/tests/baselines/reference/symbolProperty14.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty14.ts, 0, 0)) [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty14.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -13,6 +14,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty14.ts, 2, 1)) [Symbol.iterator]?: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty14.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty14.types b/tests/baselines/reference/symbolProperty14.types index 5e5469ad915..2cc344444ce 100644 --- a/tests/baselines/reference/symbolProperty14.types +++ b/tests/baselines/reference/symbolProperty14.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : { x: any; y: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -13,6 +14,7 @@ interface I { >I : I [Symbol.iterator]?: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty15.symbols b/tests/baselines/reference/symbolProperty15.symbols index c9bea5e5db2..bfb5c0921eb 100644 --- a/tests/baselines/reference/symbolProperty15.symbols +++ b/tests/baselines/reference/symbolProperty15.symbols @@ -6,6 +6,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty15.ts, 0, 11)) [Symbol.iterator]?: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty15.ts, 1, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty15.types b/tests/baselines/reference/symbolProperty15.types index b2baa3fccee..8403aaf6012 100644 --- a/tests/baselines/reference/symbolProperty15.types +++ b/tests/baselines/reference/symbolProperty15.types @@ -6,6 +6,7 @@ interface I { >I : I [Symbol.iterator]?: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty16.symbols b/tests/baselines/reference/symbolProperty16.symbols index 8e13d7babdf..48e74577442 100644 --- a/tests/baselines/reference/symbolProperty16.symbols +++ b/tests/baselines/reference/symbolProperty16.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty16.ts, 0, 0)) private [Symbol.iterator]: { x }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty16.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -12,6 +13,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty16.ts, 2, 1)) [Symbol.iterator]: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty16.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty16.types b/tests/baselines/reference/symbolProperty16.types index 041770aea04..e276fad08e4 100644 --- a/tests/baselines/reference/symbolProperty16.types +++ b/tests/baselines/reference/symbolProperty16.types @@ -3,6 +3,7 @@ class C { >C : C private [Symbol.iterator]: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -12,6 +13,7 @@ interface I { >I : I [Symbol.iterator]: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty17.symbols b/tests/baselines/reference/symbolProperty17.symbols index 120ad852c75..241c65ce9c5 100644 --- a/tests/baselines/reference/symbolProperty17.symbols +++ b/tests/baselines/reference/symbolProperty17.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty17.ts, 0, 0)) [Symbol.iterator]: number; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty17.ts, 0, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty17.types b/tests/baselines/reference/symbolProperty17.types index 12305565b25..d71fe919bec 100644 --- a/tests/baselines/reference/symbolProperty17.types +++ b/tests/baselines/reference/symbolProperty17.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.iterator]: number; +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty18.symbols b/tests/baselines/reference/symbolProperty18.symbols index 54769192d90..62855300311 100644 --- a/tests/baselines/reference/symbolProperty18.symbols +++ b/tests/baselines/reference/symbolProperty18.symbols @@ -3,16 +3,19 @@ var i = { >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) [Symbol.iterator]: 0, +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(symbolProperty18.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) [Symbol.toStringTag]() { return "" }, +>[Symbol.toStringTag] : Symbol([Symbol.toStringTag], Decl(symbolProperty18.ts, 1, 25)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) set [Symbol.toPrimitive](p: boolean) { } +>[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(symbolProperty18.ts, 2, 41)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty18.types b/tests/baselines/reference/symbolProperty18.types index 97b4de9897c..4a4d9e413ae 100644 --- a/tests/baselines/reference/symbolProperty18.types +++ b/tests/baselines/reference/symbolProperty18.types @@ -4,18 +4,21 @@ var i = { >{ [Symbol.iterator]: 0, [Symbol.toStringTag]() { return "" }, set [Symbol.toPrimitive](p: boolean) { }} : { [Symbol.iterator]: number; [Symbol.toStringTag](): string; [Symbol.toPrimitive]: boolean; } [Symbol.iterator]: 0, +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >0 : 0 [Symbol.toStringTag]() { return "" }, +>[Symbol.toStringTag] : () => string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol >"" : "" set [Symbol.toPrimitive](p: boolean) { } +>[Symbol.toPrimitive] : boolean >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolProperty19.symbols b/tests/baselines/reference/symbolProperty19.symbols index 5e8800e07cf..7a26f930d4b 100644 --- a/tests/baselines/reference/symbolProperty19.symbols +++ b/tests/baselines/reference/symbolProperty19.symbols @@ -3,12 +3,14 @@ var i = { >i : Symbol(i, Decl(symbolProperty19.ts, 0, 3)) [Symbol.iterator]: { p: null }, +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(symbolProperty19.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >p : Symbol(p, Decl(symbolProperty19.ts, 1, 24)) [Symbol.toStringTag]() { return { p: undefined }; } +>[Symbol.toStringTag] : Symbol([Symbol.toStringTag], Decl(symbolProperty19.ts, 1, 35)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty19.types b/tests/baselines/reference/symbolProperty19.types index c8746296817..8d369de58c2 100644 --- a/tests/baselines/reference/symbolProperty19.types +++ b/tests/baselines/reference/symbolProperty19.types @@ -4,6 +4,7 @@ var i = { >{ [Symbol.iterator]: { p: null }, [Symbol.toStringTag]() { return { p: undefined }; }} : { [Symbol.iterator]: { p: null; }; [Symbol.toStringTag](): { p: any; }; } [Symbol.iterator]: { p: null }, +>[Symbol.iterator] : { p: null; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -12,6 +13,7 @@ var i = { >null : null [Symbol.toStringTag]() { return { p: undefined }; } +>[Symbol.toStringTag] : () => { p: any; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty2.symbols b/tests/baselines/reference/symbolProperty2.symbols index 90cb47c0011..f0c902e372d 100644 --- a/tests/baselines/reference/symbolProperty2.symbols +++ b/tests/baselines/reference/symbolProperty2.symbols @@ -7,12 +7,15 @@ var x = { >x : Symbol(x, Decl(symbolProperty2.ts, 1, 3)) [s]: 0, +>[s] : Symbol([s], Decl(symbolProperty2.ts, 1, 9)) >s : Symbol(s, Decl(symbolProperty2.ts, 0, 3)) [s]() { }, +>[s] : Symbol([s], Decl(symbolProperty2.ts, 2, 11)) >s : Symbol(s, Decl(symbolProperty2.ts, 0, 3)) get [s]() { +>[s] : Symbol([s], Decl(symbolProperty2.ts, 3, 14)) >s : Symbol(s, Decl(symbolProperty2.ts, 0, 3)) return 0; diff --git a/tests/baselines/reference/symbolProperty2.types b/tests/baselines/reference/symbolProperty2.types index 18aafb5afb5..5b095c47a72 100644 --- a/tests/baselines/reference/symbolProperty2.types +++ b/tests/baselines/reference/symbolProperty2.types @@ -9,13 +9,16 @@ var x = { >{ [s]: 0, [s]() { }, get [s]() { return 0; }} : { [x: string]: number | (() => void); } [s]: 0, +>[s] : number >s : symbol >0 : 0 [s]() { }, +>[s] : () => void >s : symbol get [s]() { +>[s] : number >s : symbol return 0; diff --git a/tests/baselines/reference/symbolProperty20.symbols b/tests/baselines/reference/symbolProperty20.symbols index 60fc435898e..57607058690 100644 --- a/tests/baselines/reference/symbolProperty20.symbols +++ b/tests/baselines/reference/symbolProperty20.symbols @@ -3,12 +3,14 @@ interface I { >I : Symbol(I, Decl(symbolProperty20.ts, 0, 0)) [Symbol.iterator]: (s: string) => string; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty20.ts, 0, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >s : Symbol(s, Decl(symbolProperty20.ts, 1, 24)) [Symbol.toStringTag](s: number): number; +>[Symbol.toStringTag] : Symbol(I[Symbol.toStringTag], Decl(symbolProperty20.ts, 1, 45)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -20,6 +22,7 @@ var i: I = { >I : Symbol(I, Decl(symbolProperty20.ts, 0, 0)) [Symbol.iterator]: s => s, +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(symbolProperty20.ts, 5, 12)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -27,6 +30,7 @@ var i: I = { >s : Symbol(s, Decl(symbolProperty20.ts, 6, 22)) [Symbol.toStringTag](n) { return n; } +>[Symbol.toStringTag] : Symbol([Symbol.toStringTag], Decl(symbolProperty20.ts, 6, 30)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty20.types b/tests/baselines/reference/symbolProperty20.types index 745401142d8..4489197c9f6 100644 --- a/tests/baselines/reference/symbolProperty20.types +++ b/tests/baselines/reference/symbolProperty20.types @@ -3,12 +3,14 @@ interface I { >I : I [Symbol.iterator]: (s: string) => string; +>[Symbol.iterator] : (s: string) => string >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >s : string [Symbol.toStringTag](s: number): number; +>[Symbol.toStringTag] : (s: number) => number >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @@ -21,6 +23,7 @@ var i: I = { >{ [Symbol.iterator]: s => s, [Symbol.toStringTag](n) { return n; }} : { [Symbol.iterator]: (s: string) => string; [Symbol.toStringTag](n: number): number; } [Symbol.iterator]: s => s, +>[Symbol.iterator] : (s: string) => string >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -29,6 +32,7 @@ var i: I = { >s : string [Symbol.toStringTag](n) { return n; } +>[Symbol.toStringTag] : (n: number) => number >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty21.symbols b/tests/baselines/reference/symbolProperty21.symbols index 20310be60f3..ad5f638cce1 100644 --- a/tests/baselines/reference/symbolProperty21.symbols +++ b/tests/baselines/reference/symbolProperty21.symbols @@ -5,12 +5,14 @@ interface I { >U : Symbol(U, Decl(symbolProperty21.ts, 0, 14)) [Symbol.unscopables]: T; +>[Symbol.unscopables] : Symbol(I[Symbol.unscopables], Decl(symbolProperty21.ts, 0, 19)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >T : Symbol(T, Decl(symbolProperty21.ts, 0, 12)) [Symbol.isConcatSpreadable]: U; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(symbolProperty21.ts, 1, 28)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -34,16 +36,19 @@ foo({ >foo : Symbol(foo, Decl(symbolProperty21.ts, 3, 1)) [Symbol.isConcatSpreadable]: "", +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolProperty21.ts, 7, 5)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [Symbol.toPrimitive]: 0, +>[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(symbolProperty21.ts, 8, 36)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [Symbol.unscopables]: true +>[Symbol.unscopables] : Symbol([Symbol.unscopables], Decl(symbolProperty21.ts, 9, 28)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty21.types b/tests/baselines/reference/symbolProperty21.types index d93349773ad..9141cffbb22 100644 --- a/tests/baselines/reference/symbolProperty21.types +++ b/tests/baselines/reference/symbolProperty21.types @@ -5,12 +5,14 @@ interface I { >U : U [Symbol.unscopables]: T; +>[Symbol.unscopables] : T >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol >T : T [Symbol.isConcatSpreadable]: U; +>[Symbol.isConcatSpreadable] : U >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol @@ -36,18 +38,21 @@ foo({ >{ [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, [Symbol.unscopables]: true} : { [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: boolean; } [Symbol.isConcatSpreadable]: "", +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol >"" : "" [Symbol.toPrimitive]: 0, +>[Symbol.toPrimitive] : number >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol >0 : 0 [Symbol.unscopables]: true +>[Symbol.unscopables] : boolean >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol diff --git a/tests/baselines/reference/symbolProperty22.symbols b/tests/baselines/reference/symbolProperty22.symbols index e4e68d81970..603a3040ceb 100644 --- a/tests/baselines/reference/symbolProperty22.symbols +++ b/tests/baselines/reference/symbolProperty22.symbols @@ -5,6 +5,7 @@ interface I { >U : Symbol(U, Decl(symbolProperty22.ts, 0, 14)) [Symbol.unscopables](x: T): U; +>[Symbol.unscopables] : Symbol(I[Symbol.unscopables], Decl(symbolProperty22.ts, 0, 19)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -27,6 +28,7 @@ declare function foo(p1: T, p2: I): U; foo("", { [Symbol.unscopables]: s => s.length }); >foo : Symbol(foo, Decl(symbolProperty22.ts, 2, 1)) +>[Symbol.unscopables] : Symbol([Symbol.unscopables], Decl(symbolProperty22.ts, 6, 9)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty22.types b/tests/baselines/reference/symbolProperty22.types index 628164f3929..478fb6c2c2e 100644 --- a/tests/baselines/reference/symbolProperty22.types +++ b/tests/baselines/reference/symbolProperty22.types @@ -5,6 +5,7 @@ interface I { >U : U [Symbol.unscopables](x: T): U; +>[Symbol.unscopables] : (x: T) => U >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol @@ -30,6 +31,7 @@ foo("", { [Symbol.unscopables]: s => s.length }); >foo : (p1: T, p2: I) => U >"" : "" >{ [Symbol.unscopables]: s => s.length } : { [Symbol.unscopables]: (s: string) => number; } +>[Symbol.unscopables] : (s: string) => number >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol diff --git a/tests/baselines/reference/symbolProperty23.symbols b/tests/baselines/reference/symbolProperty23.symbols index 714b76fa85b..5b82d92a34f 100644 --- a/tests/baselines/reference/symbolProperty23.symbols +++ b/tests/baselines/reference/symbolProperty23.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty23.ts, 0, 0)) [Symbol.toPrimitive]: () => boolean; +>[Symbol.toPrimitive] : Symbol(I[Symbol.toPrimitive], Decl(symbolProperty23.ts, 0, 13)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -13,6 +14,7 @@ class C implements I { >I : Symbol(I, Decl(symbolProperty23.ts, 0, 0)) [Symbol.toPrimitive]() { +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolProperty23.ts, 4, 22)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty23.types b/tests/baselines/reference/symbolProperty23.types index c4a9d6765dd..02df66e6c78 100644 --- a/tests/baselines/reference/symbolProperty23.types +++ b/tests/baselines/reference/symbolProperty23.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.toPrimitive]: () => boolean; +>[Symbol.toPrimitive] : () => boolean >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol @@ -13,6 +14,7 @@ class C implements I { >I : I [Symbol.toPrimitive]() { +>[Symbol.toPrimitive] : () => boolean >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolProperty24.errors.txt b/tests/baselines/reference/symbolProperty24.errors.txt index 25cba184e25..6027cf6468c 100644 --- a/tests/baselines/reference/symbolProperty24.errors.txt +++ b/tests/baselines/reference/symbolProperty24.errors.txt @@ -1,7 +1,6 @@ -tests/cases/conformance/es6/Symbols/symbolProperty24.ts(5,7): error TS2420: Class 'C' incorrectly implements interface 'I'. - Types of property '[Symbol.toPrimitive]' are incompatible. - Type '() => string' is not assignable to type '() => boolean'. - Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/es6/Symbols/symbolProperty24.ts(6,5): error TS2416: Property '[Symbol.toPrimitive]' in type 'C' is not assignable to the same property in base type 'I'. + Type '() => string' is not assignable to type '() => boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/Symbols/symbolProperty24.ts (1 errors) ==== @@ -10,12 +9,11 @@ tests/cases/conformance/es6/Symbols/symbolProperty24.ts(5,7): error TS2420: Clas } class C implements I { - ~ -!!! error TS2420: Class 'C' incorrectly implements interface 'I'. -!!! error TS2420: Types of property '[Symbol.toPrimitive]' are incompatible. -!!! error TS2420: Type '() => string' is not assignable to type '() => boolean'. -!!! error TS2420: Type 'string' is not assignable to type 'boolean'. [Symbol.toPrimitive]() { + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2416: Property '[Symbol.toPrimitive]' in type 'C' is not assignable to the same property in base type 'I'. +!!! error TS2416: Type '() => string' is not assignable to type '() => boolean'. +!!! error TS2416: Type 'string' is not assignable to type 'boolean'. return ""; } } \ No newline at end of file diff --git a/tests/baselines/reference/symbolProperty24.symbols b/tests/baselines/reference/symbolProperty24.symbols index 197263e16b5..8b8366e2d93 100644 --- a/tests/baselines/reference/symbolProperty24.symbols +++ b/tests/baselines/reference/symbolProperty24.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty24.ts, 0, 0)) [Symbol.toPrimitive]: () => boolean; +>[Symbol.toPrimitive] : Symbol(I[Symbol.toPrimitive], Decl(symbolProperty24.ts, 0, 13)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -13,6 +14,7 @@ class C implements I { >I : Symbol(I, Decl(symbolProperty24.ts, 0, 0)) [Symbol.toPrimitive]() { +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolProperty24.ts, 4, 22)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty24.types b/tests/baselines/reference/symbolProperty24.types index 244a76f89b6..f1de8a95632 100644 --- a/tests/baselines/reference/symbolProperty24.types +++ b/tests/baselines/reference/symbolProperty24.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.toPrimitive]: () => boolean; +>[Symbol.toPrimitive] : () => boolean >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol @@ -13,6 +14,7 @@ class C implements I { >I : I [Symbol.toPrimitive]() { +>[Symbol.toPrimitive] : () => string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolProperty25.symbols b/tests/baselines/reference/symbolProperty25.symbols index 06a5c01653c..f89baf08fa2 100644 --- a/tests/baselines/reference/symbolProperty25.symbols +++ b/tests/baselines/reference/symbolProperty25.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty25.ts, 0, 0)) [Symbol.toPrimitive]: () => boolean; +>[Symbol.toPrimitive] : Symbol(I[Symbol.toPrimitive], Decl(symbolProperty25.ts, 0, 13)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -13,6 +14,7 @@ class C implements I { >I : Symbol(I, Decl(symbolProperty25.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(symbolProperty25.ts, 4, 22)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty25.types b/tests/baselines/reference/symbolProperty25.types index a9d82a5db04..41be32c876f 100644 --- a/tests/baselines/reference/symbolProperty25.types +++ b/tests/baselines/reference/symbolProperty25.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.toPrimitive]: () => boolean; +>[Symbol.toPrimitive] : () => boolean >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol @@ -13,6 +14,7 @@ class C implements I { >I : I [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty26.symbols b/tests/baselines/reference/symbolProperty26.symbols index 785a2e395cb..41c0da22943 100644 --- a/tests/baselines/reference/symbolProperty26.symbols +++ b/tests/baselines/reference/symbolProperty26.symbols @@ -3,6 +3,7 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty26.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty26.ts, 0, 10)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -16,6 +17,7 @@ class C2 extends C1 { >C1 : Symbol(C1, Decl(symbolProperty26.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C2[Symbol.toStringTag], Decl(symbolProperty26.ts, 6, 21)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty26.types b/tests/baselines/reference/symbolProperty26.types index cde412000db..abea57bd690 100644 --- a/tests/baselines/reference/symbolProperty26.types +++ b/tests/baselines/reference/symbolProperty26.types @@ -3,6 +3,7 @@ class C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @@ -17,6 +18,7 @@ class C2 extends C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty27.symbols b/tests/baselines/reference/symbolProperty27.symbols index 1b050b617c2..673e4017e55 100644 --- a/tests/baselines/reference/symbolProperty27.symbols +++ b/tests/baselines/reference/symbolProperty27.symbols @@ -3,6 +3,7 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty27.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty27.ts, 0, 10)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -16,6 +17,7 @@ class C2 extends C1 { >C1 : Symbol(C1, Decl(symbolProperty27.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C2[Symbol.toStringTag], Decl(symbolProperty27.ts, 6, 21)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty27.types b/tests/baselines/reference/symbolProperty27.types index 2c138b5a9d0..b27ffdff713 100644 --- a/tests/baselines/reference/symbolProperty27.types +++ b/tests/baselines/reference/symbolProperty27.types @@ -3,6 +3,7 @@ class C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => {} >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @@ -17,6 +18,7 @@ class C2 extends C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty28.symbols b/tests/baselines/reference/symbolProperty28.symbols index c72de5fefb5..e2ee7bfbe28 100644 --- a/tests/baselines/reference/symbolProperty28.symbols +++ b/tests/baselines/reference/symbolProperty28.symbols @@ -3,6 +3,7 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty28.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty28.ts, 0, 10)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty28.types b/tests/baselines/reference/symbolProperty28.types index 2a7b5fabf79..f1224f677cb 100644 --- a/tests/baselines/reference/symbolProperty28.types +++ b/tests/baselines/reference/symbolProperty28.types @@ -3,6 +3,7 @@ class C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty29.symbols b/tests/baselines/reference/symbolProperty29.symbols index 26ecd9a0f70..7ee6c0cc8ed 100644 --- a/tests/baselines/reference/symbolProperty29.symbols +++ b/tests/baselines/reference/symbolProperty29.symbols @@ -3,6 +3,7 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty29.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty29.ts, 0, 10)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty29.types b/tests/baselines/reference/symbolProperty29.types index 7b3887ed795..f4388acb041 100644 --- a/tests/baselines/reference/symbolProperty29.types +++ b/tests/baselines/reference/symbolProperty29.types @@ -3,6 +3,7 @@ class C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty3.symbols b/tests/baselines/reference/symbolProperty3.symbols index ef35240eba1..551152a95d5 100644 --- a/tests/baselines/reference/symbolProperty3.symbols +++ b/tests/baselines/reference/symbolProperty3.symbols @@ -7,12 +7,15 @@ var x = { >x : Symbol(x, Decl(symbolProperty3.ts, 1, 3)) [s]: 0, +>[s] : Symbol([s], Decl(symbolProperty3.ts, 1, 9)) >s : Symbol(s, Decl(symbolProperty3.ts, 0, 3)) [s]() { }, +>[s] : Symbol([s], Decl(symbolProperty3.ts, 2, 11)) >s : Symbol(s, Decl(symbolProperty3.ts, 0, 3)) get [s]() { +>[s] : Symbol([s], Decl(symbolProperty3.ts, 3, 14)) >s : Symbol(s, Decl(symbolProperty3.ts, 0, 3)) return 0; diff --git a/tests/baselines/reference/symbolProperty3.types b/tests/baselines/reference/symbolProperty3.types index 42887b3cae0..df4707a207c 100644 --- a/tests/baselines/reference/symbolProperty3.types +++ b/tests/baselines/reference/symbolProperty3.types @@ -8,13 +8,16 @@ var x = { >{ [s]: 0, [s]() { }, get [s]() { return 0; }} : { [x: string]: number | (() => void); } [s]: 0, +>[s] : number >s : SymbolConstructor >0 : 0 [s]() { }, +>[s] : () => void >s : SymbolConstructor get [s]() { +>[s] : number >s : SymbolConstructor return 0; diff --git a/tests/baselines/reference/symbolProperty30.symbols b/tests/baselines/reference/symbolProperty30.symbols index c4e758c58d8..425f50bd1a9 100644 --- a/tests/baselines/reference/symbolProperty30.symbols +++ b/tests/baselines/reference/symbolProperty30.symbols @@ -3,6 +3,7 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty30.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty30.ts, 0, 10)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty30.types b/tests/baselines/reference/symbolProperty30.types index f19439d1208..6d66de0fc8a 100644 --- a/tests/baselines/reference/symbolProperty30.types +++ b/tests/baselines/reference/symbolProperty30.types @@ -3,6 +3,7 @@ class C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty31.symbols b/tests/baselines/reference/symbolProperty31.symbols index 65fe5a0dd94..76a228b540c 100644 --- a/tests/baselines/reference/symbolProperty31.symbols +++ b/tests/baselines/reference/symbolProperty31.symbols @@ -3,6 +3,7 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty31.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty31.ts, 0, 10)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty31.types b/tests/baselines/reference/symbolProperty31.types index abfb5f810f0..82c4df523c4 100644 --- a/tests/baselines/reference/symbolProperty31.types +++ b/tests/baselines/reference/symbolProperty31.types @@ -3,6 +3,7 @@ class C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty32.symbols b/tests/baselines/reference/symbolProperty32.symbols index 6f069ac9b4e..2b5ac2e92ae 100644 --- a/tests/baselines/reference/symbolProperty32.symbols +++ b/tests/baselines/reference/symbolProperty32.symbols @@ -3,6 +3,7 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty32.ts, 0, 0)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty32.ts, 0, 10)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty32.types b/tests/baselines/reference/symbolProperty32.types index 232bc5a7740..bf899308c0a 100644 --- a/tests/baselines/reference/symbolProperty32.types +++ b/tests/baselines/reference/symbolProperty32.types @@ -3,6 +3,7 @@ class C1 { >C1 : C1 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty33.symbols b/tests/baselines/reference/symbolProperty33.symbols index 1bcf313626e..2cce4d4bfec 100644 --- a/tests/baselines/reference/symbolProperty33.symbols +++ b/tests/baselines/reference/symbolProperty33.symbols @@ -4,6 +4,7 @@ class C1 extends C2 { >C2 : Symbol(C2, Decl(symbolProperty33.ts, 4, 1)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty33.ts, 0, 21)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty33.types b/tests/baselines/reference/symbolProperty33.types index 8321f39ff9f..b8ae732ca17 100644 --- a/tests/baselines/reference/symbolProperty33.types +++ b/tests/baselines/reference/symbolProperty33.types @@ -4,6 +4,7 @@ class C1 extends C2 { >C2 : C2 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty34.symbols b/tests/baselines/reference/symbolProperty34.symbols index ab13908da9d..741deaad238 100644 --- a/tests/baselines/reference/symbolProperty34.symbols +++ b/tests/baselines/reference/symbolProperty34.symbols @@ -4,6 +4,7 @@ class C1 extends C2 { >C2 : Symbol(C2, Decl(symbolProperty34.ts, 4, 1)) [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C1[Symbol.toStringTag], Decl(symbolProperty34.ts, 0, 21)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty34.types b/tests/baselines/reference/symbolProperty34.types index 5c99676aadf..724c676f26c 100644 --- a/tests/baselines/reference/symbolProperty34.types +++ b/tests/baselines/reference/symbolProperty34.types @@ -4,6 +4,7 @@ class C1 extends C2 { >C2 : C2 [Symbol.toStringTag]() { +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty35.symbols b/tests/baselines/reference/symbolProperty35.symbols index 9de473d5983..f3ab90eb819 100644 --- a/tests/baselines/reference/symbolProperty35.symbols +++ b/tests/baselines/reference/symbolProperty35.symbols @@ -3,6 +3,7 @@ interface I1 { >I1 : Symbol(I1, Decl(symbolProperty35.ts, 0, 0)) [Symbol.toStringTag](): { x: string } +>[Symbol.toStringTag] : Symbol(I1[Symbol.toStringTag], Decl(symbolProperty35.ts, 0, 14)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -12,6 +13,7 @@ interface I2 { >I2 : Symbol(I2, Decl(symbolProperty35.ts, 2, 1)) [Symbol.toStringTag](): { x: number } +>[Symbol.toStringTag] : Symbol(I2[Symbol.toStringTag], Decl(symbolProperty35.ts, 3, 14)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty35.types b/tests/baselines/reference/symbolProperty35.types index 7b90c7cf136..22d85c2cb20 100644 --- a/tests/baselines/reference/symbolProperty35.types +++ b/tests/baselines/reference/symbolProperty35.types @@ -3,6 +3,7 @@ interface I1 { >I1 : I1 [Symbol.toStringTag](): { x: string } +>[Symbol.toStringTag] : () => { x: string; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @@ -12,6 +13,7 @@ interface I2 { >I2 : I2 [Symbol.toStringTag](): { x: number } +>[Symbol.toStringTag] : () => { x: number; } >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty36.symbols b/tests/baselines/reference/symbolProperty36.symbols index 9636c1c30f8..6c25d81d78e 100644 --- a/tests/baselines/reference/symbolProperty36.symbols +++ b/tests/baselines/reference/symbolProperty36.symbols @@ -3,11 +3,13 @@ var x = { >x : Symbol(x, Decl(symbolProperty36.ts, 0, 3)) [Symbol.isConcatSpreadable]: 0, +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolProperty36.ts, 0, 9), Decl(symbolProperty36.ts, 1, 35)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [Symbol.isConcatSpreadable]: 1 +>[Symbol.isConcatSpreadable] : Symbol([Symbol.isConcatSpreadable], Decl(symbolProperty36.ts, 0, 9), Decl(symbolProperty36.ts, 1, 35)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty36.types b/tests/baselines/reference/symbolProperty36.types index 3971f5058b4..afd80a19c9f 100644 --- a/tests/baselines/reference/symbolProperty36.types +++ b/tests/baselines/reference/symbolProperty36.types @@ -4,12 +4,14 @@ var x = { >{ [Symbol.isConcatSpreadable]: 0, [Symbol.isConcatSpreadable]: 1} : { [Symbol.isConcatSpreadable]: number; } [Symbol.isConcatSpreadable]: 0, +>[Symbol.isConcatSpreadable] : number >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol >0 : 0 [Symbol.isConcatSpreadable]: 1 +>[Symbol.isConcatSpreadable] : number >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolProperty37.symbols b/tests/baselines/reference/symbolProperty37.symbols index 392bbf52c8c..a15c5f5d422 100644 --- a/tests/baselines/reference/symbolProperty37.symbols +++ b/tests/baselines/reference/symbolProperty37.symbols @@ -3,11 +3,13 @@ interface I { >I : Symbol(I, Decl(symbolProperty37.ts, 0, 0)) [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(symbolProperty37.ts, 0, 13), Decl(symbolProperty37.ts, 1, 40)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(symbolProperty37.ts, 0, 13), Decl(symbolProperty37.ts, 1, 40)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty37.types b/tests/baselines/reference/symbolProperty37.types index 4d8482deff5..85167590ea6 100644 --- a/tests/baselines/reference/symbolProperty37.types +++ b/tests/baselines/reference/symbolProperty37.types @@ -3,11 +3,13 @@ interface I { >I : I [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolProperty38.symbols b/tests/baselines/reference/symbolProperty38.symbols index 9bd7b40d9d0..70786f50d30 100644 --- a/tests/baselines/reference/symbolProperty38.symbols +++ b/tests/baselines/reference/symbolProperty38.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty38.ts, 0, 0), Decl(symbolProperty38.ts, 2, 1)) [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(symbolProperty38.ts, 0, 13), Decl(symbolProperty38.ts, 3, 13)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -11,6 +12,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty38.ts, 0, 0), Decl(symbolProperty38.ts, 2, 1)) [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : Symbol(I[Symbol.isConcatSpreadable], Decl(symbolProperty38.ts, 0, 13), Decl(symbolProperty38.ts, 3, 13)) >Symbol.isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty38.types b/tests/baselines/reference/symbolProperty38.types index 5c3faed61f4..bfcdbfe7bd7 100644 --- a/tests/baselines/reference/symbolProperty38.types +++ b/tests/baselines/reference/symbolProperty38.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol @@ -11,6 +12,7 @@ interface I { >I : I [Symbol.isConcatSpreadable]: string; +>[Symbol.isConcatSpreadable] : string >Symbol.isConcatSpreadable : symbol >Symbol : SymbolConstructor >isConcatSpreadable : symbol diff --git a/tests/baselines/reference/symbolProperty39.symbols b/tests/baselines/reference/symbolProperty39.symbols index 967bb9fd1d0..b0fd47ead59 100644 --- a/tests/baselines/reference/symbolProperty39.symbols +++ b/tests/baselines/reference/symbolProperty39.symbols @@ -3,18 +3,21 @@ class C { >C : Symbol(C, Decl(symbolProperty39.ts, 0, 0)) [Symbol.iterator](x: string): string; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty39.ts, 0, 9), Decl(symbolProperty39.ts, 1, 41), Decl(symbolProperty39.ts, 2, 41), Decl(symbolProperty39.ts, 5, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty39.ts, 1, 22)) [Symbol.iterator](x: number): number; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty39.ts, 0, 9), Decl(symbolProperty39.ts, 1, 41), Decl(symbolProperty39.ts, 2, 41), Decl(symbolProperty39.ts, 5, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty39.ts, 2, 22)) [Symbol.iterator](x: any) { +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty39.ts, 0, 9), Decl(symbolProperty39.ts, 1, 41), Decl(symbolProperty39.ts, 2, 41), Decl(symbolProperty39.ts, 5, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -24,6 +27,7 @@ class C { >undefined : Symbol(undefined) } [Symbol.iterator](x: any) { +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty39.ts, 0, 9), Decl(symbolProperty39.ts, 1, 41), Decl(symbolProperty39.ts, 2, 41), Decl(symbolProperty39.ts, 5, 5)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty39.types b/tests/baselines/reference/symbolProperty39.types index d217147ffe8..90a5fcd375e 100644 --- a/tests/baselines/reference/symbolProperty39.types +++ b/tests/baselines/reference/symbolProperty39.types @@ -3,18 +3,21 @@ class C { >C : C [Symbol.iterator](x: string): string; +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >x : string [Symbol.iterator](x: number): number; +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >x : number [Symbol.iterator](x: any) { +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -24,6 +27,7 @@ class C { >undefined : undefined } [Symbol.iterator](x: any) { +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty4.symbols b/tests/baselines/reference/symbolProperty4.symbols index c1f7c82de7d..5012a7f3b12 100644 --- a/tests/baselines/reference/symbolProperty4.symbols +++ b/tests/baselines/reference/symbolProperty4.symbols @@ -3,12 +3,15 @@ var x = { >x : Symbol(x, Decl(symbolProperty4.ts, 0, 3)) [Symbol()]: 0, +>[Symbol()] : Symbol([Symbol()], Decl(symbolProperty4.ts, 0, 9)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) [Symbol()]() { }, +>[Symbol()] : Symbol([Symbol()], Decl(symbolProperty4.ts, 1, 18)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) get [Symbol()]() { +>[Symbol()] : Symbol([Symbol()], Decl(symbolProperty4.ts, 2, 21)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) return 0; diff --git a/tests/baselines/reference/symbolProperty4.types b/tests/baselines/reference/symbolProperty4.types index abcf4451b03..77f4f105e79 100644 --- a/tests/baselines/reference/symbolProperty4.types +++ b/tests/baselines/reference/symbolProperty4.types @@ -4,15 +4,18 @@ var x = { >{ [Symbol()]: 0, [Symbol()]() { }, get [Symbol()]() { return 0; }} : { [x: string]: number | (() => void); } [Symbol()]: 0, +>[Symbol()] : number >Symbol() : symbol >Symbol : SymbolConstructor >0 : 0 [Symbol()]() { }, +>[Symbol()] : () => void >Symbol() : symbol >Symbol : SymbolConstructor get [Symbol()]() { +>[Symbol()] : number >Symbol() : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/symbolProperty40.symbols b/tests/baselines/reference/symbolProperty40.symbols index 9d546e7d426..9c4f0310f8d 100644 --- a/tests/baselines/reference/symbolProperty40.symbols +++ b/tests/baselines/reference/symbolProperty40.symbols @@ -3,18 +3,21 @@ class C { >C : Symbol(C, Decl(symbolProperty40.ts, 0, 0)) [Symbol.iterator](x: string): string; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty40.ts, 0, 9), Decl(symbolProperty40.ts, 1, 41), Decl(symbolProperty40.ts, 2, 41)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty40.ts, 1, 22)) [Symbol.iterator](x: number): number; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty40.ts, 0, 9), Decl(symbolProperty40.ts, 1, 41), Decl(symbolProperty40.ts, 2, 41)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty40.ts, 2, 22)) [Symbol.iterator](x: any) { +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty40.ts, 0, 9), Decl(symbolProperty40.ts, 1, 41), Decl(symbolProperty40.ts, 2, 41)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty40.types b/tests/baselines/reference/symbolProperty40.types index efe6600d535..ca65adaa0bc 100644 --- a/tests/baselines/reference/symbolProperty40.types +++ b/tests/baselines/reference/symbolProperty40.types @@ -3,18 +3,21 @@ class C { >C : C [Symbol.iterator](x: string): string; +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >x : string [Symbol.iterator](x: number): number; +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >x : number [Symbol.iterator](x: any) { +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty41.symbols b/tests/baselines/reference/symbolProperty41.symbols index f0ef0692253..fee55e3f284 100644 --- a/tests/baselines/reference/symbolProperty41.symbols +++ b/tests/baselines/reference/symbolProperty41.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty41.ts, 0, 0)) [Symbol.iterator](x: string): { x: string }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty41.ts, 0, 9), Decl(symbolProperty41.ts, 1, 48), Decl(symbolProperty41.ts, 2, 64)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -10,6 +11,7 @@ class C { >x : Symbol(x, Decl(symbolProperty41.ts, 1, 35)) [Symbol.iterator](x: "hello"): { x: string; hello: string }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty41.ts, 0, 9), Decl(symbolProperty41.ts, 1, 48), Decl(symbolProperty41.ts, 2, 64)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -18,6 +20,7 @@ class C { >hello : Symbol(hello, Decl(symbolProperty41.ts, 2, 47)) [Symbol.iterator](x: any) { +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty41.ts, 0, 9), Decl(symbolProperty41.ts, 1, 48), Decl(symbolProperty41.ts, 2, 64)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty41.types b/tests/baselines/reference/symbolProperty41.types index 5eebd107659..76d47f90e47 100644 --- a/tests/baselines/reference/symbolProperty41.types +++ b/tests/baselines/reference/symbolProperty41.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.iterator](x: string): { x: string }; +>[Symbol.iterator] : { (x: string): { x: string; }; (x: "hello"): { x: string; hello: string; }; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -10,6 +11,7 @@ class C { >x : string [Symbol.iterator](x: "hello"): { x: string; hello: string }; +>[Symbol.iterator] : { (x: string): { x: string; }; (x: "hello"): { x: string; hello: string; }; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -18,6 +20,7 @@ class C { >hello : string [Symbol.iterator](x: any) { +>[Symbol.iterator] : { (x: string): { x: string; }; (x: "hello"): { x: string; hello: string; }; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty42.symbols b/tests/baselines/reference/symbolProperty42.symbols index eb6c8994f64..66871f055b5 100644 --- a/tests/baselines/reference/symbolProperty42.symbols +++ b/tests/baselines/reference/symbolProperty42.symbols @@ -3,18 +3,21 @@ class C { >C : Symbol(C, Decl(symbolProperty42.ts, 0, 0)) [Symbol.iterator](x: string): string; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty42.ts, 0, 9), Decl(symbolProperty42.ts, 2, 48)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty42.ts, 1, 22)) static [Symbol.iterator](x: number): number; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty42.ts, 1, 41)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty42.ts, 2, 29)) [Symbol.iterator](x: any) { +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty42.ts, 0, 9), Decl(symbolProperty42.ts, 2, 48)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty42.types b/tests/baselines/reference/symbolProperty42.types index 3c5f422431f..72fa0138bab 100644 --- a/tests/baselines/reference/symbolProperty42.types +++ b/tests/baselines/reference/symbolProperty42.types @@ -3,18 +3,21 @@ class C { >C : C [Symbol.iterator](x: string): string; +>[Symbol.iterator] : { (x: string): string; (x: any): any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >x : string static [Symbol.iterator](x: number): number; +>[Symbol.iterator] : (x: number) => number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >x : number [Symbol.iterator](x: any) { +>[Symbol.iterator] : { (x: string): string; (x: any): any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty43.symbols b/tests/baselines/reference/symbolProperty43.symbols index 8ef4496adfb..5bfc9ce4bfd 100644 --- a/tests/baselines/reference/symbolProperty43.symbols +++ b/tests/baselines/reference/symbolProperty43.symbols @@ -3,12 +3,14 @@ class C { >C : Symbol(C, Decl(symbolProperty43.ts, 0, 0)) [Symbol.iterator](x: string): string; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty43.ts, 0, 9), Decl(symbolProperty43.ts, 1, 41)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty43.ts, 1, 22)) [Symbol.iterator](x: number): number; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty43.ts, 0, 9), Decl(symbolProperty43.ts, 1, 41)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty43.types b/tests/baselines/reference/symbolProperty43.types index 1035a54d16c..b4ffaeac9bd 100644 --- a/tests/baselines/reference/symbolProperty43.types +++ b/tests/baselines/reference/symbolProperty43.types @@ -3,12 +3,14 @@ class C { >C : C [Symbol.iterator](x: string): string; +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >x : string [Symbol.iterator](x: number): number; +>[Symbol.iterator] : { (x: string): string; (x: number): number; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty44.symbols b/tests/baselines/reference/symbolProperty44.symbols index 95e6ca38dfb..8bf708ba9b1 100644 --- a/tests/baselines/reference/symbolProperty44.symbols +++ b/tests/baselines/reference/symbolProperty44.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty44.ts, 0, 0)) get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : Symbol(C[Symbol.hasInstance], Decl(symbolProperty44.ts, 0, 9)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -10,6 +11,7 @@ class C { return ""; } get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : Symbol(C[Symbol.hasInstance], Decl(symbolProperty44.ts, 3, 5)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty44.types b/tests/baselines/reference/symbolProperty44.types index 2352207cab9..2900c3eebc0 100644 --- a/tests/baselines/reference/symbolProperty44.types +++ b/tests/baselines/reference/symbolProperty44.types @@ -3,6 +3,7 @@ class C { >C : C get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : string >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -11,6 +12,7 @@ class C { >"" : "" } get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : string >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/symbolProperty45.symbols b/tests/baselines/reference/symbolProperty45.symbols index 0f42e37c5cf..45c629a125b 100644 --- a/tests/baselines/reference/symbolProperty45.symbols +++ b/tests/baselines/reference/symbolProperty45.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty45.ts, 0, 0)) get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : Symbol(C[Symbol.hasInstance], Decl(symbolProperty45.ts, 0, 9)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -10,6 +11,7 @@ class C { return ""; } get [Symbol.toPrimitive]() { +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolProperty45.ts, 3, 5)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty45.types b/tests/baselines/reference/symbolProperty45.types index cb0fbdffc53..674a262fcd6 100644 --- a/tests/baselines/reference/symbolProperty45.types +++ b/tests/baselines/reference/symbolProperty45.types @@ -3,6 +3,7 @@ class C { >C : C get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : string >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -11,6 +12,7 @@ class C { >"" : "" } get [Symbol.toPrimitive]() { +>[Symbol.toPrimitive] : string >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolProperty46.symbols b/tests/baselines/reference/symbolProperty46.symbols index 6441ee99b70..26ea4907dcc 100644 --- a/tests/baselines/reference/symbolProperty46.symbols +++ b/tests/baselines/reference/symbolProperty46.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty46.ts, 0, 0)) get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : Symbol(C[Symbol.hasInstance], Decl(symbolProperty46.ts, 0, 9), Decl(symbolProperty46.ts, 3, 5)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -11,6 +12,7 @@ class C { } // Should take a string set [Symbol.hasInstance](x) { +>[Symbol.hasInstance] : Symbol(C[Symbol.hasInstance], Decl(symbolProperty46.ts, 0, 9), Decl(symbolProperty46.ts, 3, 5)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty46.types b/tests/baselines/reference/symbolProperty46.types index e44c5a9a867..afdda60c510 100644 --- a/tests/baselines/reference/symbolProperty46.types +++ b/tests/baselines/reference/symbolProperty46.types @@ -3,6 +3,7 @@ class C { >C : C get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : string >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -12,6 +13,7 @@ class C { } // Should take a string set [Symbol.hasInstance](x) { +>[Symbol.hasInstance] : string >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/symbolProperty47.symbols b/tests/baselines/reference/symbolProperty47.symbols index fac8d794bbb..a9cf0c987fd 100644 --- a/tests/baselines/reference/symbolProperty47.symbols +++ b/tests/baselines/reference/symbolProperty47.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty47.ts, 0, 0)) get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : Symbol(C[Symbol.hasInstance], Decl(symbolProperty47.ts, 0, 9), Decl(symbolProperty47.ts, 3, 5)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -11,6 +12,7 @@ class C { } // Should take a string set [Symbol.hasInstance](x: number) { +>[Symbol.hasInstance] : Symbol(C[Symbol.hasInstance], Decl(symbolProperty47.ts, 0, 9), Decl(symbolProperty47.ts, 3, 5)) >Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty47.types b/tests/baselines/reference/symbolProperty47.types index 1511b3feeda..af01c5e74a7 100644 --- a/tests/baselines/reference/symbolProperty47.types +++ b/tests/baselines/reference/symbolProperty47.types @@ -3,6 +3,7 @@ class C { >C : C get [Symbol.hasInstance]() { +>[Symbol.hasInstance] : number >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol @@ -12,6 +13,7 @@ class C { } // Should take a string set [Symbol.hasInstance](x: number) { +>[Symbol.hasInstance] : number >Symbol.hasInstance : symbol >Symbol : SymbolConstructor >hasInstance : symbol diff --git a/tests/baselines/reference/symbolProperty48.symbols b/tests/baselines/reference/symbolProperty48.symbols index c0cabd6dd72..e2d169ed8a2 100644 --- a/tests/baselines/reference/symbolProperty48.symbols +++ b/tests/baselines/reference/symbolProperty48.symbols @@ -9,6 +9,7 @@ module M { >C : Symbol(C, Decl(symbolProperty48.ts, 1, 15)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty48.ts, 3, 13)) >Symbol : Symbol(Symbol, Decl(symbolProperty48.ts, 1, 7)) } } diff --git a/tests/baselines/reference/symbolProperty48.types b/tests/baselines/reference/symbolProperty48.types index 8c03cd937ed..7cd843be74f 100644 --- a/tests/baselines/reference/symbolProperty48.types +++ b/tests/baselines/reference/symbolProperty48.types @@ -9,6 +9,7 @@ module M { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : any >Symbol : any >iterator : any diff --git a/tests/baselines/reference/symbolProperty49.symbols b/tests/baselines/reference/symbolProperty49.symbols index 8cf8bce6a29..ffb4ee7a521 100644 --- a/tests/baselines/reference/symbolProperty49.symbols +++ b/tests/baselines/reference/symbolProperty49.symbols @@ -9,6 +9,7 @@ module M { >C : Symbol(C, Decl(symbolProperty49.ts, 1, 22)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty49.ts, 3, 13)) >Symbol : Symbol(Symbol, Decl(symbolProperty49.ts, 1, 14)) } } diff --git a/tests/baselines/reference/symbolProperty49.types b/tests/baselines/reference/symbolProperty49.types index de9f3f76762..6f8a0ac5955 100644 --- a/tests/baselines/reference/symbolProperty49.types +++ b/tests/baselines/reference/symbolProperty49.types @@ -9,6 +9,7 @@ module M { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : any >Symbol : any >iterator : any diff --git a/tests/baselines/reference/symbolProperty5.symbols b/tests/baselines/reference/symbolProperty5.symbols index 1ca9150c347..833b976695c 100644 --- a/tests/baselines/reference/symbolProperty5.symbols +++ b/tests/baselines/reference/symbolProperty5.symbols @@ -3,16 +3,19 @@ var x = { >x : Symbol(x, Decl(symbolProperty5.ts, 0, 3)) [Symbol.iterator]: 0, +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(symbolProperty5.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) [Symbol.toPrimitive]() { }, +>[Symbol.toPrimitive] : Symbol([Symbol.toPrimitive], Decl(symbolProperty5.ts, 1, 25)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) get [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol([Symbol.toStringTag], Decl(symbolProperty5.ts, 2, 31)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty5.types b/tests/baselines/reference/symbolProperty5.types index 833b6aa525d..398253128a7 100644 --- a/tests/baselines/reference/symbolProperty5.types +++ b/tests/baselines/reference/symbolProperty5.types @@ -4,17 +4,20 @@ var x = { >{ [Symbol.iterator]: 0, [Symbol.toPrimitive]() { }, get [Symbol.toStringTag]() { return 0; }} : { [Symbol.iterator]: number; [Symbol.toPrimitive](): void; readonly [Symbol.toStringTag]: number; } [Symbol.iterator]: 0, +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >0 : 0 [Symbol.toPrimitive]() { }, +>[Symbol.toPrimitive] : () => void >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol get [Symbol.toStringTag]() { +>[Symbol.toStringTag] : number >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty50.symbols b/tests/baselines/reference/symbolProperty50.symbols index 6df756a0277..cfe1db1bda1 100644 --- a/tests/baselines/reference/symbolProperty50.symbols +++ b/tests/baselines/reference/symbolProperty50.symbols @@ -9,6 +9,7 @@ module M { >C : Symbol(C, Decl(symbolProperty50.ts, 1, 24)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty50.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty50.types b/tests/baselines/reference/symbolProperty50.types index 8258dfe1b72..659fd1d102f 100644 --- a/tests/baselines/reference/symbolProperty50.types +++ b/tests/baselines/reference/symbolProperty50.types @@ -9,6 +9,7 @@ module M { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty51.symbols b/tests/baselines/reference/symbolProperty51.symbols index 71384602b23..9a2c7a99b71 100644 --- a/tests/baselines/reference/symbolProperty51.symbols +++ b/tests/baselines/reference/symbolProperty51.symbols @@ -9,6 +9,7 @@ module M { >C : Symbol(C, Decl(symbolProperty51.ts, 1, 21)) [Symbol.iterator]() { } +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty51.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty51.types b/tests/baselines/reference/symbolProperty51.types index fb9ac13d6b0..c840469eb43 100644 --- a/tests/baselines/reference/symbolProperty51.types +++ b/tests/baselines/reference/symbolProperty51.types @@ -9,6 +9,7 @@ module M { >C : C [Symbol.iterator]() { } +>[Symbol.iterator] : () => void >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty52.symbols b/tests/baselines/reference/symbolProperty52.symbols index 2366a96e221..d3d85cbc0e9 100644 --- a/tests/baselines/reference/symbolProperty52.symbols +++ b/tests/baselines/reference/symbolProperty52.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty52.ts, 0, 3)) [Symbol.nonsense]: 0 +>[Symbol.nonsense] : Symbol([Symbol.nonsense], Decl(symbolProperty52.ts, 0, 11)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) }; diff --git a/tests/baselines/reference/symbolProperty52.types b/tests/baselines/reference/symbolProperty52.types index e3889426b94..d67595a22b7 100644 --- a/tests/baselines/reference/symbolProperty52.types +++ b/tests/baselines/reference/symbolProperty52.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.nonsense]: 0} : { [Symbol.nonsense]: number; } [Symbol.nonsense]: 0 +>[Symbol.nonsense] : number >Symbol.nonsense : any >Symbol : SymbolConstructor >nonsense : any diff --git a/tests/baselines/reference/symbolProperty53.symbols b/tests/baselines/reference/symbolProperty53.symbols index 15093663560..50075a90c12 100644 --- a/tests/baselines/reference/symbolProperty53.symbols +++ b/tests/baselines/reference/symbolProperty53.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty53.ts, 0, 3)) [Symbol.for]: 0 +>[Symbol.for] : Symbol([Symbol.for], Decl(symbolProperty53.ts, 0, 11)) >Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty53.types b/tests/baselines/reference/symbolProperty53.types index be46ff8eea3..77dc3f16452 100644 --- a/tests/baselines/reference/symbolProperty53.types +++ b/tests/baselines/reference/symbolProperty53.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.for]: 0} : { [Symbol.for]: number; } [Symbol.for]: 0 +>[Symbol.for] : number >Symbol.for : (key: string) => symbol >Symbol : SymbolConstructor >for : (key: string) => symbol diff --git a/tests/baselines/reference/symbolProperty54.symbols b/tests/baselines/reference/symbolProperty54.symbols index f04a679179d..dd67e194904 100644 --- a/tests/baselines/reference/symbolProperty54.symbols +++ b/tests/baselines/reference/symbolProperty54.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty54.ts, 0, 3)) [Symbol.prototype]: 0 +>[Symbol.prototype] : Symbol([Symbol.prototype], Decl(symbolProperty54.ts, 0, 11)) >Symbol.prototype : Symbol(SymbolConstructor.prototype, Decl(lib.es2015.symbol.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >prototype : Symbol(SymbolConstructor.prototype, Decl(lib.es2015.symbol.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty54.types b/tests/baselines/reference/symbolProperty54.types index 34305018a2b..2c6f9cd9e72 100644 --- a/tests/baselines/reference/symbolProperty54.types +++ b/tests/baselines/reference/symbolProperty54.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.prototype]: 0} : { [Symbol.prototype]: number; } [Symbol.prototype]: 0 +>[Symbol.prototype] : number >Symbol.prototype : Symbol >Symbol : SymbolConstructor >prototype : Symbol diff --git a/tests/baselines/reference/symbolProperty55.symbols b/tests/baselines/reference/symbolProperty55.symbols index e87120986ee..3df1acffd70 100644 --- a/tests/baselines/reference/symbolProperty55.symbols +++ b/tests/baselines/reference/symbolProperty55.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty55.ts, 0, 3)) [Symbol.iterator]: 0 +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(symbolProperty55.ts, 0, 11)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty55.types b/tests/baselines/reference/symbolProperty55.types index 3d56c268267..9316e5447e4 100644 --- a/tests/baselines/reference/symbolProperty55.types +++ b/tests/baselines/reference/symbolProperty55.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.iterator]: 0} : { [Symbol.iterator]: number; } [Symbol.iterator]: 0 +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty56.symbols b/tests/baselines/reference/symbolProperty56.symbols index 492f28bd42c..459921a9a84 100644 --- a/tests/baselines/reference/symbolProperty56.symbols +++ b/tests/baselines/reference/symbolProperty56.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty56.ts, 0, 3)) [Symbol.iterator]: 0 +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(symbolProperty56.ts, 0, 11)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty56.types b/tests/baselines/reference/symbolProperty56.types index 63f6317e219..1f061739c41 100644 --- a/tests/baselines/reference/symbolProperty56.types +++ b/tests/baselines/reference/symbolProperty56.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.iterator]: 0} : { [Symbol.iterator]: number; } [Symbol.iterator]: 0 +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty57.symbols b/tests/baselines/reference/symbolProperty57.symbols index 05fa27816c9..075fcd0a992 100644 --- a/tests/baselines/reference/symbolProperty57.symbols +++ b/tests/baselines/reference/symbolProperty57.symbols @@ -3,6 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty57.ts, 0, 3)) [Symbol.iterator]: 0 +>[Symbol.iterator] : Symbol([Symbol.iterator], Decl(symbolProperty57.ts, 0, 11)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty57.types b/tests/baselines/reference/symbolProperty57.types index 6a4920b8e2f..88dca83627f 100644 --- a/tests/baselines/reference/symbolProperty57.types +++ b/tests/baselines/reference/symbolProperty57.types @@ -4,6 +4,7 @@ var obj = { >{ [Symbol.iterator]: 0} : { [Symbol.iterator]: number; } [Symbol.iterator]: 0 +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/symbolProperty58.symbols b/tests/baselines/reference/symbolProperty58.symbols index e4ed7399176..1775e0372ce 100644 --- a/tests/baselines/reference/symbolProperty58.symbols +++ b/tests/baselines/reference/symbolProperty58.symbols @@ -10,6 +10,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty58.ts, 4, 3)) [Symbol.foo]: 0 +>[Symbol.foo] : Symbol([Symbol.foo], Decl(symbolProperty58.ts, 4, 11)) >Symbol.foo : Symbol(SymbolConstructor.foo, Decl(symbolProperty58.ts, 0, 29)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >foo : Symbol(SymbolConstructor.foo, Decl(symbolProperty58.ts, 0, 29)) diff --git a/tests/baselines/reference/symbolProperty58.types b/tests/baselines/reference/symbolProperty58.types index 437359d91f5..77edb8de1e7 100644 --- a/tests/baselines/reference/symbolProperty58.types +++ b/tests/baselines/reference/symbolProperty58.types @@ -11,6 +11,7 @@ var obj = { >{ [Symbol.foo]: 0} : { [Symbol.foo]: number; } [Symbol.foo]: 0 +>[Symbol.foo] : number >Symbol.foo : string >Symbol : SymbolConstructor >foo : string diff --git a/tests/baselines/reference/symbolProperty59.symbols b/tests/baselines/reference/symbolProperty59.symbols index 1afa5596c2f..274b920bc2a 100644 --- a/tests/baselines/reference/symbolProperty59.symbols +++ b/tests/baselines/reference/symbolProperty59.symbols @@ -3,6 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty59.ts, 0, 0)) [Symbol.keyFor]: string; +>[Symbol.keyFor] : Symbol(I[Symbol.keyFor], Decl(symbolProperty59.ts, 0, 13)) >Symbol.keyFor : Symbol(SymbolConstructor.keyFor, Decl(lib.es2015.symbol.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >keyFor : Symbol(SymbolConstructor.keyFor, Decl(lib.es2015.symbol.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty59.types b/tests/baselines/reference/symbolProperty59.types index 6b82a73fa0e..4dfb46c1840 100644 --- a/tests/baselines/reference/symbolProperty59.types +++ b/tests/baselines/reference/symbolProperty59.types @@ -3,6 +3,7 @@ interface I { >I : I [Symbol.keyFor]: string; +>[Symbol.keyFor] : string >Symbol.keyFor : (sym: symbol) => string >Symbol : SymbolConstructor >keyFor : (sym: symbol) => string diff --git a/tests/baselines/reference/symbolProperty6.symbols b/tests/baselines/reference/symbolProperty6.symbols index 4bf20b1de55..0c7b9f317ce 100644 --- a/tests/baselines/reference/symbolProperty6.symbols +++ b/tests/baselines/reference/symbolProperty6.symbols @@ -3,21 +3,25 @@ class C { >C : Symbol(C, Decl(symbolProperty6.ts, 0, 0)) [Symbol.iterator] = 0; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty6.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) [Symbol.unscopables]: number; +>[Symbol.unscopables] : Symbol(C[Symbol.unscopables], Decl(symbolProperty6.ts, 1, 26)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [Symbol.toPrimitive]() { } +>[Symbol.toPrimitive] : Symbol(C[Symbol.toPrimitive], Decl(symbolProperty6.ts, 2, 33)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) get [Symbol.toStringTag]() { +>[Symbol.toStringTag] : Symbol(C[Symbol.toStringTag], Decl(symbolProperty6.ts, 3, 30)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty6.types b/tests/baselines/reference/symbolProperty6.types index a9fe1178e07..8bdd05f0151 100644 --- a/tests/baselines/reference/symbolProperty6.types +++ b/tests/baselines/reference/symbolProperty6.types @@ -3,22 +3,26 @@ class C { >C : C [Symbol.iterator] = 0; +>[Symbol.iterator] : number >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol >0 : 0 [Symbol.unscopables]: number; +>[Symbol.unscopables] : number >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol [Symbol.toPrimitive]() { } +>[Symbol.toPrimitive] : () => void >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol get [Symbol.toStringTag]() { +>[Symbol.toStringTag] : number >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol diff --git a/tests/baselines/reference/symbolProperty60.symbols b/tests/baselines/reference/symbolProperty60.symbols index fca43277e97..de9a8c6674d 100644 --- a/tests/baselines/reference/symbolProperty60.symbols +++ b/tests/baselines/reference/symbolProperty60.symbols @@ -4,6 +4,7 @@ interface I1 { >I1 : Symbol(I1, Decl(symbolProperty60.ts, 0, 0)) [Symbol.toStringTag]: string; +>[Symbol.toStringTag] : Symbol(I1[Symbol.toStringTag], Decl(symbolProperty60.ts, 1, 14)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -16,6 +17,7 @@ interface I2 { >I2 : Symbol(I2, Decl(symbolProperty60.ts, 4, 1)) [Symbol.toStringTag]: string; +>[Symbol.toStringTag] : Symbol(I2[Symbol.toStringTag], Decl(symbolProperty60.ts, 6, 14)) >Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) @@ -31,6 +33,7 @@ interface I3 { >I3 : Symbol(I3, Decl(symbolProperty60.ts, 11, 38)) [mySymbol]: string; +>[mySymbol] : Symbol(I3[mySymbol], Decl(symbolProperty60.ts, 13, 14)) >mySymbol : Symbol(mySymbol, Decl(symbolProperty60.ts, 11, 13)) [key: string]: number; @@ -41,6 +44,7 @@ interface I4 { >I4 : Symbol(I4, Decl(symbolProperty60.ts, 16, 1)) [mySymbol]: string; +>[mySymbol] : Symbol(I4[mySymbol], Decl(symbolProperty60.ts, 18, 14)) >mySymbol : Symbol(mySymbol, Decl(symbolProperty60.ts, 11, 13)) [key: number]: boolean; diff --git a/tests/baselines/reference/symbolProperty60.types b/tests/baselines/reference/symbolProperty60.types index c81c003bd35..cadbfcef1f4 100644 --- a/tests/baselines/reference/symbolProperty60.types +++ b/tests/baselines/reference/symbolProperty60.types @@ -4,6 +4,7 @@ interface I1 { >I1 : I1 [Symbol.toStringTag]: string; +>[Symbol.toStringTag] : string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @@ -16,6 +17,7 @@ interface I2 { >I2 : I2 [Symbol.toStringTag]: string; +>[Symbol.toStringTag] : string >Symbol.toStringTag : symbol >Symbol : SymbolConstructor >toStringTag : symbol @@ -31,6 +33,7 @@ interface I3 { >I3 : I3 [mySymbol]: string; +>[mySymbol] : string >mySymbol : unique symbol [key: string]: number; @@ -41,6 +44,7 @@ interface I4 { >I4 : I4 [mySymbol]: string; +>[mySymbol] : string >mySymbol : unique symbol [key: number]: boolean; diff --git a/tests/baselines/reference/symbolProperty7.symbols b/tests/baselines/reference/symbolProperty7.symbols index c5db5645480..86b150e9eb3 100644 --- a/tests/baselines/reference/symbolProperty7.symbols +++ b/tests/baselines/reference/symbolProperty7.symbols @@ -3,15 +3,19 @@ class C { >C : Symbol(C, Decl(symbolProperty7.ts, 0, 0)) [Symbol()] = 0; +>[Symbol()] : Symbol(C[Symbol()], Decl(symbolProperty7.ts, 0, 9)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) [Symbol()]: number; +>[Symbol()] : Symbol(C[Symbol()], Decl(symbolProperty7.ts, 1, 19)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) [Symbol()]() { } +>[Symbol()] : Symbol(C[Symbol()], Decl(symbolProperty7.ts, 2, 23)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) get [Symbol()]() { +>[Symbol()] : Symbol(C[Symbol()], Decl(symbolProperty7.ts, 3, 20)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) return 0; diff --git a/tests/baselines/reference/symbolProperty7.types b/tests/baselines/reference/symbolProperty7.types index 647fcfcd3cb..31a113f007d 100644 --- a/tests/baselines/reference/symbolProperty7.types +++ b/tests/baselines/reference/symbolProperty7.types @@ -3,19 +3,23 @@ class C { >C : C [Symbol()] = 0; +>[Symbol()] : number >Symbol() : symbol >Symbol : SymbolConstructor >0 : 0 [Symbol()]: number; +>[Symbol()] : number >Symbol() : symbol >Symbol : SymbolConstructor [Symbol()]() { } +>[Symbol()] : () => void >Symbol() : symbol >Symbol : SymbolConstructor get [Symbol()]() { +>[Symbol()] : number >Symbol() : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/symbolProperty8.symbols b/tests/baselines/reference/symbolProperty8.symbols index e46c35b47be..dc4e0531cfe 100644 --- a/tests/baselines/reference/symbolProperty8.symbols +++ b/tests/baselines/reference/symbolProperty8.symbols @@ -3,11 +3,13 @@ interface I { >I : Symbol(I, Decl(symbolProperty8.ts, 0, 0)) [Symbol.unscopables]: number; +>[Symbol.unscopables] : Symbol(I[Symbol.unscopables], Decl(symbolProperty8.ts, 0, 13)) >Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) [Symbol.toPrimitive](); +>[Symbol.toPrimitive] : Symbol(I[Symbol.toPrimitive], Decl(symbolProperty8.ts, 1, 33)) >Symbol.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty8.types b/tests/baselines/reference/symbolProperty8.types index 647cff252ab..936a2b9ec88 100644 --- a/tests/baselines/reference/symbolProperty8.types +++ b/tests/baselines/reference/symbolProperty8.types @@ -3,11 +3,13 @@ interface I { >I : I [Symbol.unscopables]: number; +>[Symbol.unscopables] : number >Symbol.unscopables : symbol >Symbol : SymbolConstructor >unscopables : symbol [Symbol.toPrimitive](); +>[Symbol.toPrimitive] : () => any >Symbol.toPrimitive : symbol >Symbol : SymbolConstructor >toPrimitive : symbol diff --git a/tests/baselines/reference/symbolProperty9.symbols b/tests/baselines/reference/symbolProperty9.symbols index 8239fbb26ef..9e0a3b6dd85 100644 --- a/tests/baselines/reference/symbolProperty9.symbols +++ b/tests/baselines/reference/symbolProperty9.symbols @@ -3,6 +3,7 @@ class C { >C : Symbol(C, Decl(symbolProperty9.ts, 0, 0)) [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : Symbol(C[Symbol.iterator], Decl(symbolProperty9.ts, 0, 9)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -13,6 +14,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty9.ts, 2, 1)) [Symbol.iterator]: { x }; +>[Symbol.iterator] : Symbol(I[Symbol.iterator], Decl(symbolProperty9.ts, 3, 13)) >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty9.types b/tests/baselines/reference/symbolProperty9.types index f68df96b58d..b307677b2fa 100644 --- a/tests/baselines/reference/symbolProperty9.types +++ b/tests/baselines/reference/symbolProperty9.types @@ -3,6 +3,7 @@ class C { >C : C [Symbol.iterator]: { x; y }; +>[Symbol.iterator] : { x: any; y: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol @@ -13,6 +14,7 @@ interface I { >I : I [Symbol.iterator]: { x }; +>[Symbol.iterator] : { x: any; } >Symbol.iterator : symbol >Symbol : SymbolConstructor >iterator : symbol diff --git a/tests/baselines/reference/transformParenthesizesConditionalSubexpression.symbols b/tests/baselines/reference/transformParenthesizesConditionalSubexpression.symbols index d3ae64c40d5..b42c2a6b474 100644 --- a/tests/baselines/reference/transformParenthesizesConditionalSubexpression.symbols +++ b/tests/baselines/reference/transformParenthesizesConditionalSubexpression.symbols @@ -5,10 +5,12 @@ var K = 'k' var a = { p : (true ? { [K] : 'v'} : null) } >a : Symbol(a, Decl(transformParenthesizesConditionalSubexpression.ts, 1, 3)) >p : Symbol(p, Decl(transformParenthesizesConditionalSubexpression.ts, 1, 9)) +>[K] : Symbol([K], Decl(transformParenthesizesConditionalSubexpression.ts, 1, 24)) >K : Symbol(K, Decl(transformParenthesizesConditionalSubexpression.ts, 0, 3)) var b = { p : (true ? { [K] : 'v'} as any : null) } >b : Symbol(b, Decl(transformParenthesizesConditionalSubexpression.ts, 2, 3)) >p : Symbol(p, Decl(transformParenthesizesConditionalSubexpression.ts, 2, 9)) +>[K] : Symbol([K], Decl(transformParenthesizesConditionalSubexpression.ts, 2, 24)) >K : Symbol(K, Decl(transformParenthesizesConditionalSubexpression.ts, 0, 3)) diff --git a/tests/baselines/reference/transformParenthesizesConditionalSubexpression.types b/tests/baselines/reference/transformParenthesizesConditionalSubexpression.types index 0ba4268d80a..3500cd29481 100644 --- a/tests/baselines/reference/transformParenthesizesConditionalSubexpression.types +++ b/tests/baselines/reference/transformParenthesizesConditionalSubexpression.types @@ -11,6 +11,7 @@ var a = { p : (true ? { [K] : 'v'} : null) } >true ? { [K] : 'v'} : null : { [x: string]: string; } >true : true >{ [K] : 'v'} : { [x: string]: string; } +>[K] : string >K : string >'v' : "v" >null : null @@ -24,6 +25,7 @@ var b = { p : (true ? { [K] : 'v'} as any : null) } >true : true >{ [K] : 'v'} as any : any >{ [K] : 'v'} : { [x: string]: string; } +>[K] : string >K : string >'v' : "v" >null : null diff --git a/tests/baselines/reference/typeParameterExtendsPrimitive.symbols b/tests/baselines/reference/typeParameterExtendsPrimitive.symbols index acac75272ac..45e7cbfcad1 100644 --- a/tests/baselines/reference/typeParameterExtendsPrimitive.symbols +++ b/tests/baselines/reference/typeParameterExtendsPrimitive.symbols @@ -12,6 +12,7 @@ function f() { >v : Symbol(v, Decl(typeParameterExtendsPrimitive.ts, 3, 7)) [t]: 0 +>[t] : Symbol([t], Decl(typeParameterExtendsPrimitive.ts, 3, 13)) >t : Symbol(t, Decl(typeParameterExtendsPrimitive.ts, 2, 7)) } return t + t; diff --git a/tests/baselines/reference/typeParameterExtendsPrimitive.types b/tests/baselines/reference/typeParameterExtendsPrimitive.types index 1e8eb7f40e0..e364396855a 100644 --- a/tests/baselines/reference/typeParameterExtendsPrimitive.types +++ b/tests/baselines/reference/typeParameterExtendsPrimitive.types @@ -13,6 +13,7 @@ function f() { >{ [t]: 0 } : { [x: number]: number; } [t]: 0 +>[t] : number >t : T >0 : 0 } diff --git a/tests/baselines/reference/typeParametersAndParametersInComputedNames.symbols b/tests/baselines/reference/typeParametersAndParametersInComputedNames.symbols index c0e4e281aee..426299c5360 100644 --- a/tests/baselines/reference/typeParametersAndParametersInComputedNames.symbols +++ b/tests/baselines/reference/typeParametersAndParametersInComputedNames.symbols @@ -12,6 +12,7 @@ class A { >A : Symbol(A, Decl(typeParametersAndParametersInComputedNames.ts, 2, 1)) [foo(a)](a: T) { +>[foo(a)] : Symbol(A[foo(a)], Decl(typeParametersAndParametersInComputedNames.ts, 4, 9)) >foo : Symbol(foo, Decl(typeParametersAndParametersInComputedNames.ts, 0, 0)) >T : Symbol(T, Decl(typeParametersAndParametersInComputedNames.ts, 5, 16)) >a : Symbol(a, Decl(typeParametersAndParametersInComputedNames.ts, 5, 19)) diff --git a/tests/baselines/reference/typeParametersAndParametersInComputedNames.types b/tests/baselines/reference/typeParametersAndParametersInComputedNames.types index 0694c61e51f..e150afcdf9f 100644 --- a/tests/baselines/reference/typeParametersAndParametersInComputedNames.types +++ b/tests/baselines/reference/typeParametersAndParametersInComputedNames.types @@ -13,6 +13,7 @@ class A { >A : A [foo(a)](a: T) { +>[foo(a)] : (a: T) => void >foo(a) : string >foo : (a: T) => string >T : No type information available! diff --git a/tests/baselines/reference/uniqueSymbols.symbols b/tests/baselines/reference/uniqueSymbols.symbols index 42324fa6e4d..ba651b89a41 100644 --- a/tests/baselines/reference/uniqueSymbols.symbols +++ b/tests/baselines/reference/uniqueSymbols.symbols @@ -406,7 +406,9 @@ declare namespace N { const s: unique symbol; } declare const o: { [s]: "a", [N.s]: "b" }; >o : Symbol(o, Decl(uniqueSymbols.ts, 117, 13)) +>[s] : Symbol([s], Decl(uniqueSymbols.ts, 117, 18)) >s : Symbol(s, Decl(uniqueSymbols.ts, 115, 13)) +>[N.s] : Symbol([N.s], Decl(uniqueSymbols.ts, 117, 28)) >N.s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbols.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) @@ -685,9 +687,11 @@ Math.random() * 2 ? N["s"] : "a"; // computed property names ({ [s]: "a", +>[s] : Symbol([s], Decl(uniqueSymbols.ts, 198, 2)) >s : Symbol(s, Decl(uniqueSymbols.ts, 115, 13)) [N.s]: "b", +>[N.s] : Symbol([N.s], Decl(uniqueSymbols.ts, 199, 13)) >N.s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbols.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) @@ -698,17 +702,21 @@ class C1 { >C1 : Symbol(C1, Decl(uniqueSymbols.ts, 201, 3)) static [s]: "a"; +>[s] : Symbol(C1[s], Decl(uniqueSymbols.ts, 203, 10)) >s : Symbol(s, Decl(uniqueSymbols.ts, 115, 13)) static [N.s]: "b"; +>[N.s] : Symbol(C1[N.s], Decl(uniqueSymbols.ts, 204, 20)) >N.s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbols.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) [s]: "a"; +>[s] : Symbol(C1[s], Decl(uniqueSymbols.ts, 205, 22)) >s : Symbol(s, Decl(uniqueSymbols.ts, 115, 13)) [N.s]: "b"; +>[N.s] : Symbol(C1[N.s], Decl(uniqueSymbols.ts, 207, 13)) >N.s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbols.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbols.ts, 116, 27)) diff --git a/tests/baselines/reference/uniqueSymbols.types b/tests/baselines/reference/uniqueSymbols.types index 6516ee25dd0..621d3df4236 100644 --- a/tests/baselines/reference/uniqueSymbols.types +++ b/tests/baselines/reference/uniqueSymbols.types @@ -424,7 +424,9 @@ declare namespace N { const s: unique symbol; } declare const o: { [s]: "a", [N.s]: "b" }; >o : { [s]: "a"; [N.s]: "b"; } +>[s] : "a" >s : unique symbol +>[N.s] : "b" >N.s : unique symbol >N : typeof N >s : unique symbol @@ -759,10 +761,12 @@ Math.random() * 2 ? N["s"] : "a"; >{ [s]: "a", [N.s]: "b",} : { [s]: string; [N.s]: string; } [s]: "a", +>[s] : string >s : unique symbol >"a" : "a" [N.s]: "b", +>[N.s] : string >N.s : unique symbol >N : typeof N >s : unique symbol @@ -774,17 +778,21 @@ class C1 { >C1 : C1 static [s]: "a"; +>[s] : "a" >s : unique symbol static [N.s]: "b"; +>[N.s] : "b" >N.s : unique symbol >N : typeof N >s : unique symbol [s]: "a"; +>[s] : "a" >s : unique symbol [N.s]: "b"; +>[N.s] : "b" >N.s : unique symbol >N : typeof N >s : unique symbol diff --git a/tests/baselines/reference/uniqueSymbolsDeclarations.symbols b/tests/baselines/reference/uniqueSymbolsDeclarations.symbols index beff6685aa7..c145b32059c 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarations.symbols +++ b/tests/baselines/reference/uniqueSymbolsDeclarations.symbols @@ -406,7 +406,9 @@ declare namespace N { const s: unique symbol; } declare const o: { [s]: "a", [N.s]: "b" }; >o : Symbol(o, Decl(uniqueSymbolsDeclarations.ts, 117, 13)) +>[s] : Symbol([s], Decl(uniqueSymbolsDeclarations.ts, 117, 18)) >s : Symbol(s, Decl(uniqueSymbolsDeclarations.ts, 115, 13)) +>[N.s] : Symbol([N.s], Decl(uniqueSymbolsDeclarations.ts, 117, 28)) >N.s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbolsDeclarations.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) @@ -685,9 +687,11 @@ Math.random() * 2 ? N["s"] : "a"; // computed property names ({ [s]: "a", +>[s] : Symbol([s], Decl(uniqueSymbolsDeclarations.ts, 198, 2)) >s : Symbol(s, Decl(uniqueSymbolsDeclarations.ts, 115, 13)) [N.s]: "b", +>[N.s] : Symbol([N.s], Decl(uniqueSymbolsDeclarations.ts, 199, 13)) >N.s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbolsDeclarations.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) @@ -698,17 +702,21 @@ class C1 { >C1 : Symbol(C1, Decl(uniqueSymbolsDeclarations.ts, 201, 3)) static [s]: "a"; +>[s] : Symbol(C1[s], Decl(uniqueSymbolsDeclarations.ts, 203, 10)) >s : Symbol(s, Decl(uniqueSymbolsDeclarations.ts, 115, 13)) static [N.s]: "b"; +>[N.s] : Symbol(C1[N.s], Decl(uniqueSymbolsDeclarations.ts, 204, 20)) >N.s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbolsDeclarations.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) [s]: "a"; +>[s] : Symbol(C1[s], Decl(uniqueSymbolsDeclarations.ts, 205, 22)) >s : Symbol(s, Decl(uniqueSymbolsDeclarations.ts, 115, 13)) [N.s]: "b"; +>[N.s] : Symbol(C1[N.s], Decl(uniqueSymbolsDeclarations.ts, 207, 13)) >N.s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) >N : Symbol(N, Decl(uniqueSymbolsDeclarations.ts, 115, 31)) >s : Symbol(N.s, Decl(uniqueSymbolsDeclarations.ts, 116, 27)) diff --git a/tests/baselines/reference/uniqueSymbolsDeclarations.types b/tests/baselines/reference/uniqueSymbolsDeclarations.types index c4975d497cc..a841354269f 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarations.types +++ b/tests/baselines/reference/uniqueSymbolsDeclarations.types @@ -424,7 +424,9 @@ declare namespace N { const s: unique symbol; } declare const o: { [s]: "a", [N.s]: "b" }; >o : { [s]: "a"; [N.s]: "b"; } +>[s] : "a" >s : unique symbol +>[N.s] : "b" >N.s : unique symbol >N : typeof N >s : unique symbol @@ -759,10 +761,12 @@ Math.random() * 2 ? N["s"] : "a"; >{ [s]: "a", [N.s]: "b",} : { [s]: string; [N.s]: string; } [s]: "a", +>[s] : string >s : unique symbol >"a" : "a" [N.s]: "b", +>[N.s] : string >N.s : unique symbol >N : typeof N >s : unique symbol @@ -774,17 +778,21 @@ class C1 { >C1 : C1 static [s]: "a"; +>[s] : "a" >s : unique symbol static [N.s]: "b"; +>[N.s] : "b" >N.s : unique symbol >N : typeof N >s : unique symbol [s]: "a"; +>[s] : "a" >s : unique symbol [N.s]: "b"; +>[N.s] : "b" >N.s : unique symbol >N : typeof N >s : unique symbol diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.symbols b/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.symbols index 45275c60a17..9e948fb3420 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.symbols +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.symbols @@ -70,6 +70,7 @@ export interface InterfaceWithPrivateNamedProperties { >InterfaceWithPrivateNamedProperties : Symbol(InterfaceWithPrivateNamedProperties, Decl(uniqueSymbolsDeclarationsErrors.ts, 25, 1)) [s]: any; +>[s] : Symbol(InterfaceWithPrivateNamedProperties[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 27, 54)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) } @@ -77,6 +78,7 @@ export interface InterfaceWithPrivateNamedMethods { >InterfaceWithPrivateNamedMethods : Symbol(InterfaceWithPrivateNamedMethods, Decl(uniqueSymbolsDeclarationsErrors.ts, 29, 1)) [s](): any; +>[s] : Symbol(InterfaceWithPrivateNamedMethods[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 31, 51)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) } @@ -84,6 +86,7 @@ export type TypeLiteralWithPrivateNamedProperties = { >TypeLiteralWithPrivateNamedProperties : Symbol(TypeLiteralWithPrivateNamedProperties, Decl(uniqueSymbolsDeclarationsErrors.ts, 33, 1)) [s]: any; +>[s] : Symbol([s], Decl(uniqueSymbolsDeclarationsErrors.ts, 35, 53)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) } @@ -91,6 +94,7 @@ export type TypeLiteralWithPrivateNamedMethods = { >TypeLiteralWithPrivateNamedMethods : Symbol(TypeLiteralWithPrivateNamedMethods, Decl(uniqueSymbolsDeclarationsErrors.ts, 37, 1)) [s](): any; +>[s] : Symbol([s], Decl(uniqueSymbolsDeclarationsErrors.ts, 39, 50)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) } @@ -98,9 +102,11 @@ export class ClassWithPrivateNamedProperties { >ClassWithPrivateNamedProperties : Symbol(ClassWithPrivateNamedProperties, Decl(uniqueSymbolsDeclarationsErrors.ts, 41, 1)) [s]: any; +>[s] : Symbol(ClassWithPrivateNamedProperties[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 43, 46)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) static [s]: any; +>[s] : Symbol(ClassWithPrivateNamedProperties[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 44, 13)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) } @@ -108,9 +114,11 @@ export class ClassWithPrivateNamedMethods { >ClassWithPrivateNamedMethods : Symbol(ClassWithPrivateNamedMethods, Decl(uniqueSymbolsDeclarationsErrors.ts, 46, 1)) [s]() {} +>[s] : Symbol(ClassWithPrivateNamedMethods[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 48, 43)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) static [s]() {} +>[s] : Symbol(ClassWithPrivateNamedMethods[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 49, 12)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) } @@ -118,18 +126,22 @@ export class ClassWithPrivateNamedAccessors { >ClassWithPrivateNamedAccessors : Symbol(ClassWithPrivateNamedAccessors, Decl(uniqueSymbolsDeclarationsErrors.ts, 51, 1)) get [s](): any { return undefined; } +>[s] : Symbol(ClassWithPrivateNamedAccessors[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 53, 45), Decl(uniqueSymbolsDeclarationsErrors.ts, 54, 40)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) >undefined : Symbol(undefined) set [s](v: any) { } +>[s] : Symbol(ClassWithPrivateNamedAccessors[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 53, 45), Decl(uniqueSymbolsDeclarationsErrors.ts, 54, 40)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) >v : Symbol(v, Decl(uniqueSymbolsDeclarationsErrors.ts, 55, 12)) static get [s](): any { return undefined; } +>[s] : Symbol(ClassWithPrivateNamedAccessors[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 55, 23), Decl(uniqueSymbolsDeclarationsErrors.ts, 56, 47)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) >undefined : Symbol(undefined) static set [s](v: any) { } +>[s] : Symbol(ClassWithPrivateNamedAccessors[s], Decl(uniqueSymbolsDeclarationsErrors.ts, 55, 23), Decl(uniqueSymbolsDeclarationsErrors.ts, 56, 47)) >s : Symbol(s, Decl(uniqueSymbolsDeclarationsErrors.ts, 0, 13)) >v : Symbol(v, Decl(uniqueSymbolsDeclarationsErrors.ts, 57, 19)) } diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.types b/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.types index ff3101193b4..ce3b476d3d7 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.types +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsErrors.types @@ -72,6 +72,7 @@ export interface InterfaceWithPrivateNamedProperties { >InterfaceWithPrivateNamedProperties : InterfaceWithPrivateNamedProperties [s]: any; +>[s] : any >s : unique symbol } @@ -79,6 +80,7 @@ export interface InterfaceWithPrivateNamedMethods { >InterfaceWithPrivateNamedMethods : InterfaceWithPrivateNamedMethods [s](): any; +>[s] : () => any >s : unique symbol } @@ -86,6 +88,7 @@ export type TypeLiteralWithPrivateNamedProperties = { >TypeLiteralWithPrivateNamedProperties : TypeLiteralWithPrivateNamedProperties [s]: any; +>[s] : any >s : unique symbol } @@ -93,6 +96,7 @@ export type TypeLiteralWithPrivateNamedMethods = { >TypeLiteralWithPrivateNamedMethods : TypeLiteralWithPrivateNamedMethods [s](): any; +>[s] : () => any >s : unique symbol } @@ -100,9 +104,11 @@ export class ClassWithPrivateNamedProperties { >ClassWithPrivateNamedProperties : ClassWithPrivateNamedProperties [s]: any; +>[s] : any >s : unique symbol static [s]: any; +>[s] : any >s : unique symbol } @@ -110,9 +116,11 @@ export class ClassWithPrivateNamedMethods { >ClassWithPrivateNamedMethods : ClassWithPrivateNamedMethods [s]() {} +>[s] : () => void >s : unique symbol static [s]() {} +>[s] : () => void >s : unique symbol } @@ -120,18 +128,22 @@ export class ClassWithPrivateNamedAccessors { >ClassWithPrivateNamedAccessors : ClassWithPrivateNamedAccessors get [s](): any { return undefined; } +>[s] : any >s : unique symbol >undefined : undefined set [s](v: any) { } +>[s] : any >s : unique symbol >v : any static get [s](): any { return undefined; } +>[s] : any >s : unique symbol >undefined : undefined static set [s](v: any) { } +>[s] : any >s : unique symbol >v : any } From 71ff6dd91ee0169a02fbd508df4175611d0df502 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 22 Feb 2018 15:56:34 -0800 Subject: [PATCH 211/298] Allow characters in JsxText inside JsxFragment that would not normally scan --- src/compiler/parser.ts | 3 ++- tests/baselines/reference/tsxFragmentPreserveEmit.js | 4 +++- tests/baselines/reference/tsxFragmentPreserveEmit.symbols | 1 + tests/baselines/reference/tsxFragmentPreserveEmit.types | 3 +++ tests/baselines/reference/tsxFragmentReactEmit.js | 4 +++- tests/baselines/reference/tsxFragmentReactEmit.symbols | 1 + tests/baselines/reference/tsxFragmentReactEmit.types | 3 +++ tests/cases/conformance/jsx/tsxFragmentPreserveEmit.tsx | 3 ++- tests/cases/conformance/jsx/tsxFragmentReactEmit.tsx | 3 ++- 9 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 70ddb7b791d..48f6f3dfe90 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -4176,8 +4176,9 @@ namespace ts { parseExpected(SyntaxKind.LessThanToken); if (token() === SyntaxKind.GreaterThanToken) { - parseExpected(SyntaxKind.GreaterThanToken); + // See below for explanation of scanJsxText const node: JsxOpeningFragment = createNode(SyntaxKind.JsxOpeningFragment, fullStart); + scanJsxText(); return finishNode(node); } diff --git a/tests/baselines/reference/tsxFragmentPreserveEmit.js b/tests/baselines/reference/tsxFragmentPreserveEmit.js index 5b3328a842d..436a7f2cc6c 100644 --- a/tests/baselines/reference/tsxFragmentPreserveEmit.js +++ b/tests/baselines/reference/tsxFragmentPreserveEmit.js @@ -12,7 +12,8 @@ declare var React: any; < /*starting wrap*/ >; // comments in the tags <>hi; // text inside <>hi
bye
; // children -<>1<>2.12.23; // nested fragments +<>1<>2.12.23; // nested fragments +<>#; // # would cause scanning error if not in jsxtext //// [file.jsx] <>; // no whitespace @@ -21,3 +22,4 @@ declare var React: any; <>hi; // text inside <>hi
bye
; // children <>1<>2.12.23; // nested fragments +<>#; // # would cause scanning error if not in jsxtext diff --git a/tests/baselines/reference/tsxFragmentPreserveEmit.symbols b/tests/baselines/reference/tsxFragmentPreserveEmit.symbols index c75d812480c..66405f8d081 100644 --- a/tests/baselines/reference/tsxFragmentPreserveEmit.symbols +++ b/tests/baselines/reference/tsxFragmentPreserveEmit.symbols @@ -35,3 +35,4 @@ declare var React: any; >span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +<>#; // # would cause scanning error if not in jsxtext diff --git a/tests/baselines/reference/tsxFragmentPreserveEmit.types b/tests/baselines/reference/tsxFragmentPreserveEmit.types index 4eea3d72cff..9c474fe98a8 100644 --- a/tests/baselines/reference/tsxFragmentPreserveEmit.types +++ b/tests/baselines/reference/tsxFragmentPreserveEmit.types @@ -52,3 +52,6 @@ declare var React: any; >span : any >span : any +<>#; // # would cause scanning error if not in jsxtext +><># : JSX.Element + diff --git a/tests/baselines/reference/tsxFragmentReactEmit.js b/tests/baselines/reference/tsxFragmentReactEmit.js index 137d07db33c..8dc88c7f48d 100644 --- a/tests/baselines/reference/tsxFragmentReactEmit.js +++ b/tests/baselines/reference/tsxFragmentReactEmit.js @@ -12,7 +12,8 @@ declare var React: any; < /*starting wrap*/ >; // comments in the tags <>hi; // text inside <>hi
bye
; // children -<>1<>2.12.23; // nested fragments +<>1<>2.12.23; // nested fragments +<>#; // # would cause scanning error if not in jsxtext //// [file.js] React.createElement(React.Fragment, null); // no whitespace @@ -28,3 +29,4 @@ React.createElement(React.Fragment, null, React.createElement("span", null, "2.1"), React.createElement("span", null, "2.2")), React.createElement("span", null, "3")); // nested fragments +React.createElement(React.Fragment, null, "#"); // # would cause scanning error if not in jsxtext diff --git a/tests/baselines/reference/tsxFragmentReactEmit.symbols b/tests/baselines/reference/tsxFragmentReactEmit.symbols index c75d812480c..66405f8d081 100644 --- a/tests/baselines/reference/tsxFragmentReactEmit.symbols +++ b/tests/baselines/reference/tsxFragmentReactEmit.symbols @@ -35,3 +35,4 @@ declare var React: any; >span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) >span : Symbol(JSX.IntrinsicElements, Decl(file.tsx, 1, 22)) +<>#; // # would cause scanning error if not in jsxtext diff --git a/tests/baselines/reference/tsxFragmentReactEmit.types b/tests/baselines/reference/tsxFragmentReactEmit.types index 4eea3d72cff..9c474fe98a8 100644 --- a/tests/baselines/reference/tsxFragmentReactEmit.types +++ b/tests/baselines/reference/tsxFragmentReactEmit.types @@ -52,3 +52,6 @@ declare var React: any; >span : any >span : any +<>#; // # would cause scanning error if not in jsxtext +><># : JSX.Element + diff --git a/tests/cases/conformance/jsx/tsxFragmentPreserveEmit.tsx b/tests/cases/conformance/jsx/tsxFragmentPreserveEmit.tsx index 5f4da955c36..97818d7fc63 100644 --- a/tests/cases/conformance/jsx/tsxFragmentPreserveEmit.tsx +++ b/tests/cases/conformance/jsx/tsxFragmentPreserveEmit.tsx @@ -14,4 +14,5 @@ declare var React: any; < /*starting wrap*/ >; // comments in the tags <>hi; // text inside <>hi
bye
; // children -<>1<>2.12.23; // nested fragments \ No newline at end of file +<>1<>2.12.23; // nested fragments +<>#; // # would cause scanning error if not in jsxtext \ No newline at end of file diff --git a/tests/cases/conformance/jsx/tsxFragmentReactEmit.tsx b/tests/cases/conformance/jsx/tsxFragmentReactEmit.tsx index 15f4d290cbd..da1d0bfca08 100644 --- a/tests/cases/conformance/jsx/tsxFragmentReactEmit.tsx +++ b/tests/cases/conformance/jsx/tsxFragmentReactEmit.tsx @@ -14,4 +14,5 @@ declare var React: any; < /*starting wrap*/ >; // comments in the tags <>hi; // text inside <>hi
bye
; // children -<>1<>2.12.23; // nested fragments \ No newline at end of file +<>1<>2.12.23; // nested fragments +<>#; // # would cause scanning error if not in jsxtext \ No newline at end of file From 9569b1317421c4073456d31b05b78a098fbb0b7f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 22 Feb 2018 13:13:37 -0800 Subject: [PATCH 212/298] Use refcounts on the resolution so we arent going through failed lookup locations when resolutions are cached. --- src/compiler/resolutionCache.ts | 155 +++++++++++++++++--------------- 1 file changed, 84 insertions(+), 71 deletions(-) diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index e6bab4f6860..01c7bc59fdd 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -28,6 +28,7 @@ namespace ts { interface ResolutionWithFailedLookupLocations { readonly failedLookupLocations: ReadonlyArray; isInvalidated?: boolean; + refCount?: number; } interface ResolutionWithResolvedFileName { @@ -257,17 +258,11 @@ namespace ts { perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - if (resolution.failedLookupLocations) { - if (existingResolution && existingResolution.failedLookupLocations) { - watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution); - } - else { - watchFailedLookupLocationOfResolution(resolution, 0); - } - } - else if (existingResolution) { + watchFailedLookupLocationOfResolution(resolution); + if (existingResolution) { stopWatchFailedLookupLocationOfResolution(existingResolution); } + if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { filesWithChangedSetOfUnresolvedImports.push(path); // reset log changes to avoid recording the same file multiple times @@ -399,80 +394,98 @@ namespace ts { return fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchAndStopWatchDiffFailedLookupLocations(resolution: ResolutionWithFailedLookupLocations, existingResolution: ResolutionWithFailedLookupLocations) { - const failedLookupLocations = resolution.failedLookupLocations; - const existingFailedLookupLocations = existingResolution.failedLookupLocations; - for (let index = 0; index < failedLookupLocations.length; index++) { - if (index === existingFailedLookupLocations.length) { - // Additional failed lookup locations, watch from this index - watchFailedLookupLocationOfResolution(resolution, index); - return; - } - else if (failedLookupLocations[index] !== existingFailedLookupLocations[index]) { - // Different failed lookup locations, - // Watch new resolution failed lookup locations from this index and - // stop watching existing resolutions from this index - watchFailedLookupLocationOfResolution(resolution, index); - stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, index); - return; + function watchFailedLookupLocationOfResolution(resolution: ResolutionWithFailedLookupLocations) { + // No need to set the resolution refCount + if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { + return; + } + + if (resolution.refCount !== undefined) { + resolution.refCount++; + return; + } + + resolution.refCount = 1; + const { failedLookupLocations } = resolution; + let setAtRoot = false; + for (const failedLookupLocation of failedLookupLocations) { + const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + const { dir, dirPath, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath); + if (!ignore) { + // If the failed lookup location path is not one of the supported extensions, + // store it in the custom path + if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { + const refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; + customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); + } + if (dirPath === rootPath) { + setAtRoot = true; + } + else { + setDirectoryWatcher(dir, dirPath); + } } } - // All new failed lookup locations are already watched (and are same), - // Stop watching failed lookup locations of existing resolution after failed lookup locations length - stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, failedLookupLocations.length); + if (setAtRoot) { + setDirectoryWatcher(rootDir, rootPath); + } } - function watchFailedLookupLocationOfResolution({ failedLookupLocations }: ResolutionWithFailedLookupLocations, startIndex: number) { - for (let i = startIndex; i < failedLookupLocations.length; i++) { - const failedLookupLocation = failedLookupLocations[i]; - const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - // If the failed lookup location path is not one of the supported extensions, - // store it in the custom path - if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { - const refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; - customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); - } - const { dir, dirPath, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath); - if (!ignore) { - const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - if (dirWatcher) { - dirWatcher.refCount++; - } - else { - directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); - } - } + function setDirectoryWatcher(dir: string, dirPath: Path) { + const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + if (dirWatcher) { + dirWatcher.refCount++; + } + else { + directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); } } function stopWatchFailedLookupLocationOfResolution(resolution: ResolutionWithFailedLookupLocations) { - if (resolution.failedLookupLocations) { - stopWatchFailedLookupLocationOfResolutionFrom(resolution, 0); + if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { + return; + } + + resolution.refCount!--; + if (resolution.refCount) { + return; + } + + const { failedLookupLocations } = resolution; + let removeAtRoot = false; + for (const failedLookupLocation of failedLookupLocations) { + const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); + const { dirPath, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath); + if (!ignore) { + const refCount = customFailedLookupPaths.get(failedLookupLocationPath); + if (refCount) { + if (refCount === 1) { + customFailedLookupPaths.delete(failedLookupLocationPath); + } + else { + Debug.assert(refCount > 1); + customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + } + } + + if (dirPath === rootPath) { + removeAtRoot = true; + } + else { + removeDirectoryWatcher(dirPath); + } + } + } + if (removeAtRoot) { + removeDirectoryWatcher(rootPath); } } - function stopWatchFailedLookupLocationOfResolutionFrom({ failedLookupLocations }: ResolutionWithFailedLookupLocations, startIndex: number) { - for (let i = startIndex; i < failedLookupLocations.length; i++) { - const failedLookupLocation = failedLookupLocations[i]; - const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - const refCount = customFailedLookupPaths.get(failedLookupLocationPath); - if (refCount) { - if (refCount === 1) { - customFailedLookupPaths.delete(failedLookupLocationPath); - } - else { - Debug.assert(refCount > 1); - customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); - } - } - const { dirPath, ignore } = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath); - if (!ignore) { - const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - // Do not close the watcher yet since it might be needed by other failed lookup locations. - dirWatcher.refCount--; - } - } + function removeDirectoryWatcher(dirPath: string) { + const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + // Do not close the watcher yet since it might be needed by other failed lookup locations. + dirWatcher.refCount--; } function createDirectoryWatcher(directory: string, dirPath: Path) { From e8fb58709716c980326615047d34d7902c64af3e Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 22 Feb 2018 16:26:37 -0800 Subject: [PATCH 213/298] organizeImports: Avoid using full FindAllReferences (#22102) * organizeImports: Avoid using full FindAllReferences * Add parentheses --- src/services/findAllReferences.ts | 10 ++++++++++ src/services/organizeImports.ts | 17 +---------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 41bc5685f80..3b9d465764e 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -707,6 +707,16 @@ namespace ts.FindAllReferences.Core { return exposedByParent ? scope.getSourceFile() : scope; } + /** Used as a quick check for whether a symbol is used at all in a file (besides its definition). */ + export function isSymbolReferencedInFile(definition: Identifier, checker: TypeChecker, sourceFile: SourceFile) { + const symbol = checker.getSymbolAtLocation(definition); + if (!symbol) return true; // Be lenient with invalid code. + return getPossibleSymbolReferencePositions(sourceFile, symbol.name).some(position => { + const token = tryCast(getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true), isIdentifier); + return token && token !== definition && token.escapedText === definition.escapedText && checker.getSymbolAtLocation(token) === symbol; + }); + } + function getPossibleSymbolReferencePositions(sourceFile: SourceFile, symbolName: string, container: Node = sourceFile): ReadonlyArray { const positions: number[] = []; diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index 7f54d80e79d..082dfc4130d 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -104,23 +104,8 @@ namespace ts.OrganizeImports { return usedImports; function isDeclarationUsed(identifier: Identifier) { - const symbol = typeChecker.getSymbolAtLocation(identifier); - - // Be lenient with invalid code. - if (symbol === undefined) { - return true; - } - // The JSX factory symbol is always used. - if (jsxContext && symbol.name === jsxNamespace) { - return true; - } - - const entries = FindAllReferences.getReferenceEntriesForNode(identifier.pos, identifier, program, [sourceFile], { - isCancellationRequested: () => false, - throwIfCancellationRequested: () => { /*noop*/ }, - }).filter(e => e.type === "node" && e.node.getSourceFile() === sourceFile); - return entries.length > 1; + return jsxContext && (identifier.text === jsxNamespace) || FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile); } } From 427e6ed3e6e71154bcb01fa6c89b788751a4abfe Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 20 Feb 2018 16:46:03 -0800 Subject: [PATCH 214/298] Tidy isAmbientModule --- src/compiler/utilities.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 863e8107f33..7fb4f0bfcba 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -425,8 +425,8 @@ namespace ts { } export function isAmbientModule(node: Node): boolean { - return node && node.kind === SyntaxKind.ModuleDeclaration && - ((node).name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(node)); + return node && isModuleDeclaration(node) && + (node.name.kind === SyntaxKind.StringLiteral || isGlobalScopeAugmentation(node)); } export function isModuleWithStringLiteralName(node: Node): node is ModuleDeclaration { From 189eb505b93473f583ef38260cc64ef39678cbb1 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 20 Feb 2018 16:42:15 -0800 Subject: [PATCH 215/298] Factor worker method out of ts.OrganizeImports.organizeImports --- src/services/organizeImports.ts | 67 ++++++++++++++++----------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index 082dfc4130d..45fa6bddfa6 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -16,43 +16,42 @@ namespace ts.OrganizeImports { // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) // All of the old ImportDeclarations in the file, in syntactic order. - const oldImportDecls = sourceFile.statements.filter(isImportDeclaration); - - if (oldImportDecls.length === 0) { - return []; - } - - const oldImportGroups = group(oldImportDecls, importDecl => getExternalModuleName(importDecl.moduleSpecifier)); - - const sortedImportGroups = stableSort(oldImportGroups, (group1, group2) => - compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier)); - - const newImportDecls = flatMap(sortedImportGroups, importGroup => - getExternalModuleName(importGroup[0].moduleSpecifier) - ? coalesceImports(removeUnusedImports(importGroup, sourceFile, program)) - : importGroup); + const topLevelImportDecls = sourceFile.statements.filter(isImportDeclaration); const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); - - // Delete or replace the first import. - if (newImportDecls.length === 0) { - changeTracker.deleteNode(sourceFile, oldImportDecls[0]); - } - else { - // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. - changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { - useNonAdjustedStartPosition: false, - useNonAdjustedEndPosition: false, - suffix: getNewLineOrDefaultFromHost(host, formatContext.options), - }); - } - - // Delete any subsequent imports. - for (let i = 1; i < oldImportDecls.length; i++) { - changeTracker.deleteNode(sourceFile, oldImportDecls[i]); - } - + organizeImportsWorker(topLevelImportDecls); return changeTracker.getChanges(); + + function organizeImportsWorker(oldImportDecls: ReadonlyArray) { + if (length(oldImportDecls) === 0) { + return; + } + + const oldImportGroups = group(oldImportDecls, importDecl => getExternalModuleName(importDecl.moduleSpecifier)); + const sortedImportGroups = stableSort(oldImportGroups, (group1, group2) => compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier)); + const newImportDecls = flatMap(sortedImportGroups, importGroup => + getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup, sourceFile, program)) + : importGroup); + + // Delete or replace the first import. + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: getNewLineOrDefaultFromHost(host, formatContext.options), + }); + } + + // Delete any subsequent imports. + for (let i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + } } function removeUnusedImports(oldImports: ReadonlyArray, sourceFile: SourceFile, program: Program) { From 8ead7ab29c2f7e5dc6b05f7087076b3e9f6657d7 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 20 Feb 2018 17:41:44 -0800 Subject: [PATCH 216/298] Organize imports within ambient module declarations --- src/harness/unittests/organizeImports.ts | 37 +++++++++++++++++++ src/services/organizeImports.ts | 16 ++++++-- .../organizeImports/AmbientModule.ts | 17 +++++++++ .../TopLevelAndAmbientModule.ts | 30 +++++++++++++++ 4 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/organizeImports/AmbientModule.ts create mode 100644 tests/baselines/reference/organizeImports/TopLevelAndAmbientModule.ts diff --git a/src/harness/unittests/organizeImports.ts b/src/harness/unittests/organizeImports.ts index 0b9781462a4..bb5c9cbee18 100644 --- a/src/harness/unittests/organizeImports.ts +++ b/src/harness/unittests/organizeImports.ts @@ -325,6 +325,43 @@ F2(); /*A*/import /*B*/ { /*C*/ F1 /*D*/, /*E*/ F2 /*F*/ } /*G*/ from /*H*/ "lib" /*I*/;/*J*/ //K F1(); +`, + }, + libFile); + + testOrganizeImports("AmbientModule", + { + path: "/test.ts", + content: ` +declare module "mod" { + import { F1 } from "lib"; + import * as NS from "lib"; + import { F2 } from "lib"; + + function F(f1: {} = F1, f2: {} = F2) {} +} +`, + }, + libFile); + + testOrganizeImports("TopLevelAndAmbientModule", + { + path: "/test.ts", + content: ` +import D from "lib"; + +declare module "mod" { + import { F1 } from "lib"; + import * as NS from "lib"; + import { F2 } from "lib"; + + function F(f1: {} = F1, f2: {} = F2) {} +} + +import E from "lib"; +import "lib"; + +D(); `, }, libFile); diff --git a/src/services/organizeImports.ts b/src/services/organizeImports.ts index 45fa6bddfa6..511fa821fd2 100644 --- a/src/services/organizeImports.ts +++ b/src/services/organizeImports.ts @@ -13,13 +13,18 @@ namespace ts.OrganizeImports { host: LanguageServiceHost, program: Program) { - // TODO (https://github.com/Microsoft/TypeScript/issues/10020): sort *within* ambient modules (find using isAmbientModule) + const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); // All of the old ImportDeclarations in the file, in syntactic order. const topLevelImportDecls = sourceFile.statements.filter(isImportDeclaration); - - const changeTracker = textChanges.ChangeTracker.fromContext({ host, formatContext }); organizeImportsWorker(topLevelImportDecls); + + for (const ambientModule of sourceFile.statements.filter(isAmbientModule)) { + const ambientModuleBody = getModuleBlock(ambientModule as ModuleDeclaration); + const ambientModuleImportDecls = ambientModuleBody.statements.filter(isImportDeclaration); + organizeImportsWorker(ambientModuleImportDecls); + } + return changeTracker.getChanges(); function organizeImportsWorker(oldImportDecls: ReadonlyArray) { @@ -54,6 +59,11 @@ namespace ts.OrganizeImports { } } + function getModuleBlock(moduleDecl: ModuleDeclaration): ModuleBlock | undefined { + const body = moduleDecl.body; + return body && !isIdentifier(body) && (isModuleBlock(body) ? body : getModuleBlock(body)); + } + function removeUnusedImports(oldImports: ReadonlyArray, sourceFile: SourceFile, program: Program) { const typeChecker = program.getTypeChecker(); const jsxNamespace = typeChecker.getJsxNamespace(); diff --git a/tests/baselines/reference/organizeImports/AmbientModule.ts b/tests/baselines/reference/organizeImports/AmbientModule.ts new file mode 100644 index 00000000000..4a286610742 --- /dev/null +++ b/tests/baselines/reference/organizeImports/AmbientModule.ts @@ -0,0 +1,17 @@ +// ==ORIGINAL== + +declare module "mod" { + import { F1 } from "lib"; + import * as NS from "lib"; + import { F2 } from "lib"; + + function F(f1: {} = F1, f2: {} = F2) {} +} + +// ==ORGANIZED== + +declare module "mod" { + import { F1, F2 } from "lib"; + + function F(f1: {} = F1, f2: {} = F2) {} +} diff --git a/tests/baselines/reference/organizeImports/TopLevelAndAmbientModule.ts b/tests/baselines/reference/organizeImports/TopLevelAndAmbientModule.ts new file mode 100644 index 00000000000..d6f3158efe8 --- /dev/null +++ b/tests/baselines/reference/organizeImports/TopLevelAndAmbientModule.ts @@ -0,0 +1,30 @@ +// ==ORIGINAL== + +import D from "lib"; + +declare module "mod" { + import { F1 } from "lib"; + import * as NS from "lib"; + import { F2 } from "lib"; + + function F(f1: {} = F1, f2: {} = F2) {} +} + +import E from "lib"; +import "lib"; + +D(); + +// ==ORGANIZED== + +import "lib"; +import D from "lib"; + +declare module "mod" { + import { F1, F2 } from "lib"; + + function F(f1: {} = F1, f2: {} = F2) {} +} + + +D(); From 96441abce6264b7caa6effe3c9d9f2ee016d7635 Mon Sep 17 00:00:00 2001 From: uniqueiniquity Date: Thu, 22 Feb 2018 17:01:31 -0800 Subject: [PATCH 217/298] Update category for TS4090 to Error --- src/compiler/diagnosticMessages.json | 2 +- tests/baselines/reference/library-reference-5.errors.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f120e81283a..1c3230eaf1f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2602,7 +2602,7 @@ "code": 4083 }, "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict.": { - "category": "Message", + "category": "Error", "code": 4090 }, "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'.": { diff --git a/tests/baselines/reference/library-reference-5.errors.txt b/tests/baselines/reference/library-reference-5.errors.txt index 173865ed82d..8aead70ff0b 100644 --- a/tests/baselines/reference/library-reference-5.errors.txt +++ b/tests/baselines/reference/library-reference-5.errors.txt @@ -1,4 +1,4 @@ -/node_modules/bar/index.d.ts(1,23): message TS4090: Conflicting definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Consider installing a specific version of this library to resolve the conflict. +/node_modules/bar/index.d.ts(1,23): error TS4090: Conflicting definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Consider installing a specific version of this library to resolve the conflict. ==== /src/root.ts (0 errors) ==== @@ -17,7 +17,7 @@ ==== /node_modules/bar/index.d.ts (1 errors) ==== /// ~~~~~ -!!! message TS4090: Conflicting definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Consider installing a specific version of this library to resolve the conflict. +!!! error TS4090: Conflicting definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Consider installing a specific version of this library to resolve the conflict. declare var bar: any; ==== /node_modules/bar/node_modules/alpha/index.d.ts (0 errors) ==== From 2e66e74e146b90af37dcc9ee82b2e853497c4f64 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 21 Feb 2018 14:07:58 -0800 Subject: [PATCH 218/298] fix --pretty output when context is multi-line Fixes #22097 --- src/compiler/program.ts | 2 +- ...LineContextDiagnosticWithPretty.errors.txt | 24 +++++++++++++++++++ .../multiLineContextDiagnosticWithPretty.js | 14 +++++++++++ ...ltiLineContextDiagnosticWithPretty.symbols | 13 ++++++++++ ...multiLineContextDiagnosticWithPretty.types | 16 +++++++++++++ .../multiLineContextDiagnosticWithPretty.ts | 6 +++++ 6 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt create mode 100644 tests/baselines/reference/multiLineContextDiagnosticWithPretty.js create mode 100644 tests/baselines/reference/multiLineContextDiagnosticWithPretty.symbols create mode 100644 tests/baselines/reference/multiLineContextDiagnosticWithPretty.types create mode 100644 tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 2cba011131e..1ce672a6a75 100755 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -289,8 +289,8 @@ namespace ts { gutterWidth = Math.max(ellipsis.length, gutterWidth); } - context += host.getNewLine(); for (let i = firstLine; i <= lastLine; i++) { + context += host.getNewLine(); // If the error spans over 5 lines, we'll only show the first 2 and last 2 lines, // so we'll skip ahead to the second-to-last line. if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { diff --git a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt new file mode 100644 index 00000000000..b0cea3122be --- /dev/null +++ b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.errors.txt @@ -0,0 +1,24 @@ +tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts:2:5 - error TS2322: Type '{ a: { b: string; }; }' is not assignable to type '{ c: string; }'. + Object literal may only specify known properties, and 'a' does not exist in type '{ c: string; }'. + +2 a: { +   ~~~~ +3 b: '', +  ~~~~~~~~~~~~~~ +4 } +  ~~~~~ + + + +==== tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts (1 errors) ==== + const x: {c: string} = { + a: { + ~~~~ + b: '', + ~~~~~~~~~~~~~~ + } + ~~~~~ +!!! error TS2322: Type '{ a: { b: string; }; }' is not assignable to type '{ c: string; }'. +!!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ c: string; }'. + }; + \ No newline at end of file diff --git a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.js b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.js new file mode 100644 index 00000000000..e1097709e04 --- /dev/null +++ b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.js @@ -0,0 +1,14 @@ +//// [multiLineContextDiagnosticWithPretty.ts] +const x: {c: string} = { + a: { + b: '', + } +}; + + +//// [multiLineContextDiagnosticWithPretty.js] +var x = { + a: { + b: '' + } +}; diff --git a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.symbols b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.symbols new file mode 100644 index 00000000000..a3460a8e82b --- /dev/null +++ b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts === +const x: {c: string} = { +>x : Symbol(x, Decl(multiLineContextDiagnosticWithPretty.ts, 0, 5)) +>c : Symbol(c, Decl(multiLineContextDiagnosticWithPretty.ts, 0, 10)) + + a: { +>a : Symbol(a, Decl(multiLineContextDiagnosticWithPretty.ts, 0, 24)) + + b: '', +>b : Symbol(b, Decl(multiLineContextDiagnosticWithPretty.ts, 1, 8)) + } +}; + diff --git a/tests/baselines/reference/multiLineContextDiagnosticWithPretty.types b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.types new file mode 100644 index 00000000000..1d8875bfb9e --- /dev/null +++ b/tests/baselines/reference/multiLineContextDiagnosticWithPretty.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts === +const x: {c: string} = { +>x : { c: string; } +>c : string +>{ a: { b: '', }} : { a: { b: string; }; } + + a: { +>a : { b: string; } +>{ b: '', } : { b: string; } + + b: '', +>b : string +>'' : "" + } +}; + diff --git a/tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts b/tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts new file mode 100644 index 00000000000..7f6dea430e7 --- /dev/null +++ b/tests/cases/compiler/multiLineContextDiagnosticWithPretty.ts @@ -0,0 +1,6 @@ +// @pretty: true +const x: {c: string} = { + a: { + b: '', + } +}; From 30a96ba33516b8c300289ff600e29fd4d9a0ae90 Mon Sep 17 00:00:00 2001 From: Wenlu Wang Date: Fri, 23 Feb 2018 23:25:50 +0800 Subject: [PATCH 219/298] add support of codefix for Strict Class Initialization (#21528) * add support of add undefined type to propertyDeclaration * add support of add Definite Assignment Assertions to propertyDeclaration * add support of add Initializer to propertyDeclaration * remove useless parameter * fix PropertyDeclaration emit missing exclamationToken * merge fixes and fix * fix unnecessary type assert --- src/compiler/checker.ts | 8 +- src/compiler/diagnosticMessages.json | 12 ++ src/compiler/emitter.ts | 1 + src/compiler/utilities.ts | 2 +- .../codefixes/fixStrictClassInitialization.ts | 142 ++++++++++++++++++ src/services/codefixes/fixes.ts | 2 +- .../codeFixClassPropertyInitialization.ts | 40 +++++ .../codeFixClassPropertyInitialization1.ts | 15 ++ .../codeFixClassPropertyInitialization10.ts | 15 ++ .../codeFixClassPropertyInitialization11.ts | 19 +++ .../codeFixClassPropertyInitialization12.ts | 23 +++ .../codeFixClassPropertyInitialization13.ts | 19 +++ .../codeFixClassPropertyInitialization2.ts | 15 ++ .../codeFixClassPropertyInitialization3.ts | 15 ++ .../codeFixClassPropertyInitialization4.ts | 15 ++ .../codeFixClassPropertyInitialization5.ts | 15 ++ .../codeFixClassPropertyInitialization6.ts | 15 ++ .../codeFixClassPropertyInitialization7.ts | 15 ++ .../codeFixClassPropertyInitialization8.ts | 15 ++ .../codeFixClassPropertyInitialization9.ts | 15 ++ ...odeFixClassPropertyInitialization_all_1.ts | 76 ++++++++++ ...odeFixClassPropertyInitialization_all_2.ts | 76 ++++++++++ ...odeFixClassPropertyInitialization_all_3.ts | 76 ++++++++++ 23 files changed, 640 insertions(+), 6 deletions(-) create mode 100644 src/services/codefixes/fixStrictClassInitialization.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization1.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization10.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization11.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization12.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization13.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization2.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization3.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization4.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization5.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization6.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization7.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization8.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization9.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization_all_1.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization_all_2.ts create mode 100644 tests/cases/fourslash/codeFixClassPropertyInitialization_all_3.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3cd33b923f0..bb7f8d013fc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15889,7 +15889,7 @@ namespace ts { // Referencing abstract properties within their own constructors is not allowed if ((flags & ModifierFlags.Abstract) && isThisProperty(node) && symbolHasNonMethodDeclaration(prop)) { - const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); + const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (declaringClassDeclaration && isNodeWithinConstructorOfClass(node, declaringClassDeclaration)) { error(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), getTextOfIdentifierOrLiteral(declaringClassDeclaration.name)); return false; @@ -15905,7 +15905,7 @@ namespace ts { // Private property is accessible if the property is within the declaring class if (flags & ModifierFlags.Private) { - const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); + const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); if (!isNodeWithinClass(node, declaringClassDeclaration)) { error(errorNode, Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; @@ -17627,7 +17627,7 @@ namespace ts { return true; } - const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); + const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(declaration.parent.symbol); const declaringClass = getDeclaredTypeOfSymbol(declaration.parent.symbol); // A private or protected constructor can only be instantiated within its own class (or a subclass, for protected) @@ -23115,7 +23115,7 @@ namespace ts { if (signatures.length) { const declaration = signatures[0].declaration; if (declaration && hasModifier(declaration, ModifierFlags.Private)) { - const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); + const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, getFullyQualifiedName(type.symbol)); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f120e81283a..9801da54a5f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3965,5 +3965,17 @@ "Convert to ES6 module": { "category": "Message", "code": 95017 + }, + "Add 'undefined' type to property '{0}'": { + "category": "Message", + "code": 95018 + }, + "Add initializer to property '{0}'": { + "category": "Message", + "code": 95019 + }, + "Add definite assignment assertion to property '{0}'": { + "category": "Message", + "code": 95020 } } diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index df1394efd00..3fa05950b23 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1024,6 +1024,7 @@ namespace ts { emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); + emitIfPresent(node.exclamationToken); emitTypeAnnotation(node.type); emitInitializer(node.initializer); writeSemicolon(); diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 863e8107f33..d8ee9f3dbf0 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3738,7 +3738,7 @@ namespace ts { return false; } - export function getClassLikeDeclarationOfSymbol(symbol: Symbol): Declaration | undefined { + export function getClassLikeDeclarationOfSymbol(symbol: Symbol): ClassLikeDeclaration | undefined { return find(symbol.declarations, isClassLike); } diff --git a/src/services/codefixes/fixStrictClassInitialization.ts b/src/services/codefixes/fixStrictClassInitialization.ts new file mode 100644 index 00000000000..1199e6a059d --- /dev/null +++ b/src/services/codefixes/fixStrictClassInitialization.ts @@ -0,0 +1,142 @@ +/* @internal */ +namespace ts.codefix { + const fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; + const fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; + const fixIdAddInitializer = "addMissingPropertyInitializer"; + const errorCodes = [Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; + registerCodeFix({ + errorCodes, + getCodeActions: (context) => { + const propertyDeclaration = getPropertyDeclaration(context.sourceFile, context.span.start); + if (!propertyDeclaration) return; + + const newLineCharacter = getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + const result = [ + getActionForAddMissingUndefinedType(context, propertyDeclaration), + getActionForAddMissingDefiniteAssignmentAssertion(context, propertyDeclaration, newLineCharacter) + ]; + + append(result, getActionForAddMissingInitializer(context, propertyDeclaration, newLineCharacter)); + + return result; + }, + fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], + getAllCodeActions: context => { + const newLineCharacter = getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + + return codeFixAll(context, errorCodes, (changes, diag) => { + const propertyDeclaration = getPropertyDeclaration(diag.file, diag.start); + if (!propertyDeclaration) return; + + switch (context.fixId) { + case fixIdAddDefiniteAssignmentAssertions: + addDefiniteAssignmentAssertion(changes, diag.file, propertyDeclaration, newLineCharacter); + break; + case fixIdAddUndefinedType: + addUndefinedType(changes, diag.file, propertyDeclaration); + break; + case fixIdAddInitializer: + const checker = context.program.getTypeChecker(); + const initializer = getInitializer(checker, propertyDeclaration); + if (!initializer) return; + + addInitializer(changes, diag.file, propertyDeclaration, initializer, newLineCharacter); + break; + default: + Debug.fail(JSON.stringify(context.fixId)); + } + }); + }, + }); + + function getPropertyDeclaration (sourceFile: SourceFile, pos: number): PropertyDeclaration | undefined { + const token = getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return isIdentifier(token) ? cast(token.parent, isPropertyDeclaration) : undefined; + } + + function getActionForAddMissingDefiniteAssignmentAssertion (context: CodeFixContext, propertyDeclaration: PropertyDeclaration, newLineCharacter: string): CodeFixAction { + const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Add_definite_assignment_assertion_to_property_0), [propertyDeclaration.getText()]); + const changes = textChanges.ChangeTracker.with(context, t => addDefiniteAssignmentAssertion(t, context.sourceFile, propertyDeclaration, newLineCharacter)); + return { description, changes, fixId: fixIdAddDefiniteAssignmentAssertions }; + } + + function addDefiniteAssignmentAssertion(changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration, newLineCharacter: string): void { + const property = updateProperty( + propertyDeclaration, + propertyDeclaration.decorators, + propertyDeclaration.modifiers, + propertyDeclaration.name, + createToken(SyntaxKind.ExclamationToken), + propertyDeclaration.type, + propertyDeclaration.initializer + ); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property, { suffix: newLineCharacter }); + } + + function getActionForAddMissingUndefinedType (context: CodeFixContext, propertyDeclaration: PropertyDeclaration): CodeFixAction { + const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Add_undefined_type_to_property_0), [propertyDeclaration.name.getText()]); + const changes = textChanges.ChangeTracker.with(context, t => addUndefinedType(t, context.sourceFile, propertyDeclaration)); + return { description, changes, fixId: fixIdAddUndefinedType }; + } + + function addUndefinedType(changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration): void { + const undefinedTypeNode = createKeywordTypeNode(SyntaxKind.UndefinedKeyword); + const types = isUnionTypeNode(propertyDeclaration.type) ? propertyDeclaration.type.types.concat(undefinedTypeNode) : [propertyDeclaration.type, undefinedTypeNode]; + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration.type, createUnionTypeNode(types)); + } + + function getActionForAddMissingInitializer (context: CodeFixContext, propertyDeclaration: PropertyDeclaration, newLineCharacter: string): CodeFixAction | undefined { + const checker = context.program.getTypeChecker(); + const initializer = getInitializer(checker, propertyDeclaration); + if (!initializer) return undefined; + + const description = formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Add_initializer_to_property_0), [propertyDeclaration.name.getText()]); + const changes = textChanges.ChangeTracker.with(context, t => addInitializer(t, context.sourceFile, propertyDeclaration, initializer, newLineCharacter)); + return { description, changes, fixId: fixIdAddInitializer }; + } + + function addInitializer (changeTracker: textChanges.ChangeTracker, propertyDeclarationSourceFile: SourceFile, propertyDeclaration: PropertyDeclaration, initializer: Expression, newLineCharacter: string): void { + const property = updateProperty( + propertyDeclaration, + propertyDeclaration.decorators, + propertyDeclaration.modifiers, + propertyDeclaration.name, + propertyDeclaration.questionToken, + propertyDeclaration.type, + initializer + ); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property, { suffix: newLineCharacter }); + } + + function getInitializer(checker: TypeChecker, propertyDeclaration: PropertyDeclaration): Expression | undefined { + return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type)); + } + + function getDefaultValueFromType (checker: TypeChecker, type: Type): Expression | undefined { + if (type.flags & TypeFlags.String) { + return createLiteral(""); + } + else if (type.flags & TypeFlags.Number) { + return createNumericLiteral("0"); + } + else if (type.flags & TypeFlags.Boolean) { + return createFalse(); + } + else if (type.flags & TypeFlags.Literal) { + return createLiteral((type).value); + } + else if (type.flags & TypeFlags.Union) { + return firstDefined((type).types, t => getDefaultValueFromType(checker, t)); + } + else if (getObjectFlags(type) & ObjectFlags.Class) { + const classDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); + if (!classDeclaration || hasModifier(classDeclaration, ModifierFlags.Abstract)) return undefined; + + const constructorDeclaration = find(classDeclaration.members, (m): m is ConstructorDeclaration => isConstructorDeclaration(m) && !!m.body)!; + if (constructorDeclaration && constructorDeclaration.parameters.length) return undefined; + + return createNew(createIdentifier(type.symbol.name), /*typeArguments*/ undefined, /*argumentsArray*/ undefined); + } + return undefined; + } +} diff --git a/src/services/codefixes/fixes.ts b/src/services/codefixes/fixes.ts index 317c65b15ee..671f2251a32 100644 --- a/src/services/codefixes/fixes.ts +++ b/src/services/codefixes/fixes.ts @@ -17,4 +17,4 @@ /// /// /// - +/// diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization.ts new file mode 100644 index 00000000000..224d7dd17b9 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization.ts @@ -0,0 +1,40 @@ +/// + +// @strict: true + +//// abstract class A { abstract a (); } +//// +//// class TT { constructor () {} } +//// +//// class AT extends A { a () {} } +//// +//// class Foo {} +//// +//// class T { +//// +//// a: string; +//// +//// static b: string; +//// +//// private c: string; +//// +//// d: number | undefined; +//// +//// e: string | number; +//// +//// f: 1; +//// +//// g: "123" | "456"; +//// +//// h: boolean; +//// +//// i: TT; +//// +//// j: A; +//// +//// k: AT; +//// +//// l: Foo; +//// } + +verify.codeFixAvailable() \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization1.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization1.ts new file mode 100644 index 00000000000..ed3f4c409f9 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization1.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: string; +//// } + +verify.codeFix({ + description: `Add 'undefined' type to property 'a'`, + newFileContent: `class T { + a: string | undefined; +}`, + index: 0 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization10.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization10.ts new file mode 100644 index 00000000000..52c290d3f02 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization10.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: "a" | 2; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: "a" | 2 = "a"; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization11.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization11.ts new file mode 100644 index 00000000000..d924a03ec01 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization11.ts @@ -0,0 +1,19 @@ +/// + +// @strict: true + +//// class TT { constructor () {} } +//// +//// class T { +//// a: TT; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class TT { constructor () {} } + +class T { + a: TT = new TT; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization12.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization12.ts new file mode 100644 index 00000000000..5463786415c --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization12.ts @@ -0,0 +1,23 @@ +/// + +// @strict: true + +//// abstract class A { abstract a (); } +//// +//// class AT extends A { a () {} } +//// +//// class T { +//// a: AT; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `abstract class A { abstract a (); } + +class AT extends A { a () {} } + +class T { + a: AT = new AT; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization13.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization13.ts new file mode 100644 index 00000000000..e4aec8184ef --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization13.ts @@ -0,0 +1,19 @@ +/// + +// @strict: true + +//// class TT { } +//// +//// class T { +//// a: TT; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class TT { } + +class T { + a: TT = new TT; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization2.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization2.ts new file mode 100644 index 00000000000..93313babd81 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization2.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: string; +//// } + +verify.codeFix({ + description: `Add definite assignment assertion to property 'a: string;'`, + newFileContent: `class T { + a!: string; +}`, + index: 1 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization3.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization3.ts new file mode 100644 index 00000000000..329c6107ac7 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization3.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: string; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: string = ""; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization4.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization4.ts new file mode 100644 index 00000000000..17a363e15b3 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization4.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: number; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: number = 0; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization5.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization5.ts new file mode 100644 index 00000000000..8b76da581fe --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization5.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: boolean; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: boolean = false; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization6.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization6.ts new file mode 100644 index 00000000000..b86bfb11eba --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization6.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: "1"; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: "1" = "1"; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization7.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization7.ts new file mode 100644 index 00000000000..065eb10b301 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization7.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: 2; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: 2 = 2; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization8.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization8.ts new file mode 100644 index 00000000000..5c1f7873c16 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization8.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: string | number; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: string | number = ""; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization9.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization9.ts new file mode 100644 index 00000000000..fb9bfd543eb --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization9.ts @@ -0,0 +1,15 @@ +/// + +// @strict: true + +//// class T { +//// a: 1 | 2; +//// } + +verify.codeFix({ + description: `Add initializer to property 'a'`, + newFileContent: `class T { + a: 1 | 2 = 1; +}`, + index: 2 +}) \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization_all_1.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization_all_1.ts new file mode 100644 index 00000000000..46d50c3c32a --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization_all_1.ts @@ -0,0 +1,76 @@ +/// + +// @strict: true + +//// abstract class A { abstract a (); } +//// +//// class TT { constructor () {} } +//// +//// class AT extends A { a () {} } +//// +//// class Foo {} +//// +//// class T { +//// +//// a: string; +//// +//// static b: string; +//// +//// private c: string; +//// +//// d: number | undefined; +//// +//// e: string | number; +//// +//// f: 1; +//// +//// g: "123" | "456"; +//// +//// h: boolean; +//// +//// i: TT; +//// +//// j: A; +//// +//// k: AT; +//// +//// l: Foo; +//// } + +verify.codeFixAll({ + fixId: 'addMissingPropertyDefiniteAssignmentAssertions', + newFileContent: `abstract class A { abstract a (); } + +class TT { constructor () {} } + +class AT extends A { a () {} } + +class Foo {} + +class T { + + a!: string; + + static b: string; + + private c!: string; + + d: number | undefined; + + e!: string | number; + + f!: 1; + + g!: "123" | "456"; + + h!: boolean; + + i!: TT; + + j!: A; + + k!: AT; + + l!: Foo; +}` +}); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization_all_2.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization_all_2.ts new file mode 100644 index 00000000000..ccf78aa1124 --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization_all_2.ts @@ -0,0 +1,76 @@ +/// + +// @strict: true + +//// abstract class A { abstract a (); } +//// +//// class TT { constructor () {} } +//// +//// class AT extends A { a () {} } +//// +//// class Foo {} +//// +//// class T { +//// +//// a: string; +//// +//// static b: string; +//// +//// private c: string; +//// +//// d: number | undefined; +//// +//// e: string | number; +//// +//// f: 1; +//// +//// g: "123" | "456"; +//// +//// h: boolean; +//// +//// i: TT; +//// +//// j: A; +//// +//// k: AT; +//// +//// l: Foo; +//// } + +verify.codeFixAll({ + fixId: 'addMissingPropertyUndefinedType', + newFileContent: `abstract class A { abstract a (); } + +class TT { constructor () {} } + +class AT extends A { a () {} } + +class Foo {} + +class T { + + a: string | undefined; + + static b: string; + + private c: string | undefined; + + d: number | undefined; + + e: string | number | undefined; + + f: 1 | undefined; + + g: "123" | "456" | undefined; + + h: boolean | undefined; + + i: TT | undefined; + + j: A | undefined; + + k: AT | undefined; + + l: Foo | undefined; +}` +}); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixClassPropertyInitialization_all_3.ts b/tests/cases/fourslash/codeFixClassPropertyInitialization_all_3.ts new file mode 100644 index 00000000000..28518d3d16f --- /dev/null +++ b/tests/cases/fourslash/codeFixClassPropertyInitialization_all_3.ts @@ -0,0 +1,76 @@ +/// + +// @strict: true + +//// abstract class A { abstract a (); } +//// +//// class TT { constructor () {} } +//// +//// class AT extends A { a () {} } +//// +//// class Foo {} +//// +//// class T { +//// +//// a: string; +//// +//// static b: string; +//// +//// private c: string; +//// +//// d: number | undefined; +//// +//// e: string | number; +//// +//// f: 1; +//// +//// g: "123" | "456"; +//// +//// h: boolean; +//// +//// i: TT; +//// +//// j: A; +//// +//// k: AT; +//// +//// l: Foo; +//// } + +verify.codeFixAll({ + fixId: 'addMissingPropertyInitializer', + newFileContent: `abstract class A { abstract a (); } + +class TT { constructor () {} } + +class AT extends A { a () {} } + +class Foo {} + +class T { + + a: string = ""; + + static b: string; + + private c: string = ""; + + d: number | undefined; + + e: string | number = ""; + + f: 1 = 1; + + g: "123" | "456" = "123"; + + h: boolean = false; + + i: TT = new TT; + + j: A; + + k: AT = new AT; + + l: Foo = new Foo; +}` +}); \ No newline at end of file From 3adeef85720c6e2977ce5775fdcf7c161b3734e7 Mon Sep 17 00:00:00 2001 From: csigs Date: Fri, 23 Feb 2018 17:10:14 +0000 Subject: [PATCH 220/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 67f5960a534..476ae69b584 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3021,6 +3021,15 @@
+ + + + + + + + + From 4d6b53bae5979394614342f0ef2ed1ce95746a38 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 23 Feb 2018 12:03:13 -0800 Subject: [PATCH 221/298] Add test for scenario when script info being operated is pending on reload but has svc for the previous version Test for #20806 --- .../unittests/tsserverProjectSystem.ts | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index e09dff2a6d5..b8232fda1c1 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2978,6 +2978,47 @@ namespace ts.projectSystem { checkProjectActualFiles(configuredProject, [file.path, filesFile1.path, libFile.path, config.path]); } }); + + it("requests are done on file on pendingReload but has svc for previous version", () => { + const projectLocation = "/user/username/projects/project"; + const file1: FileOrFolder = { + path: `${projectLocation}/src/file1.ts`, + content: `import { y } from "./file1"; let x = 10;` + }; + const file2: FileOrFolder = { + path: `${projectLocation}/src/file2.ts`, + content: "export let y = 10;" + }; + const config: FileOrFolder = { + path: `${projectLocation}/tsconfig.json`, + content: "{}" + }; + const files = [file1, file2, libFile, config]; + const host = createServerHost(files); + const session = createSession(host); + session.executeCommandSeq({ + command: protocol.CommandTypes.Open, + arguments: { file: file2.path, fileContent: file2.content } + }); + session.executeCommandSeq({ + command: protocol.CommandTypes.Open, + arguments: { file: file1.path } + }); + session.executeCommandSeq({ + command: protocol.CommandTypes.Close, + arguments: { file: file2.path } + }); + + file2.content += "export let z = 10;"; + host.reloadFS(files); + // Do not let the timeout runs, before executing command + const startOffset = file2.content.indexOf("y") + 1; + session.executeCommandSeq({ + command: protocol.CommandTypes.GetApplicableRefactors, + arguments: { file: file2.path, startLine: 1, startOffset, endLine: 1, endOffset: startOffset + 1 } + }); + + }); }); describe("tsserverProjectSystem Proper errors", () => { From 08ab6eb42dddee1f501998445046653de5aa4eab Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 23 Feb 2018 12:10:24 -0800 Subject: [PATCH 222/298] Reload the text from file if there is pending reload of the script info before determining to use SVC Fixes #20806 --- src/server/scriptInfo.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 6fc4f241f65..d368acd5ce3 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -176,8 +176,13 @@ namespace ts.server { return this.switchToScriptVersionCache(); } - // Else if the svc is uptodate with the text, we are good - return !this.pendingReloadFromDisk && this.svc; + // If there is pending reload from the disk then, reload the text + if (this.pendingReloadFromDisk) { + this.reloadWithFileText(); + } + + // At this point if svc is present its valid + return this.svc; } private getOrLoadText() { From e4e4b17669eafe18947585efb5eccec2ec29004d Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 26 Feb 2018 10:38:54 -0800 Subject: [PATCH 223/298] Improve error message for untyped import of scoped package (#22189) --- src/compiler/checker.ts | 2 +- src/compiler/moduleNameResolver.ts | 3 ++- ...dModuleImport_noImplicitAny_scoped.errors.txt | 16 ++++++++++++++++ .../untypedModuleImport_noImplicitAny_scoped.js | 15 +++++++++++++++ ...ypedModuleImport_noImplicitAny_scoped.symbols | 4 ++++ ...ntypedModuleImport_noImplicitAny_scoped.types | 4 ++++ .../untypedModuleImport_noImplicitAny_scoped.ts | 11 +++++++++++ 7 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.errors.txt create mode 100644 tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.js create mode 100644 tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.symbols create mode 100644 tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.types create mode 100644 tests/cases/conformance/moduleResolution/untypedModuleImport_noImplicitAny_scoped.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bb7f8d013fc..2fcc924a7b8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2092,7 +2092,7 @@ namespace ts { else if (noImplicitAny && moduleNotFoundError) { let errorInfo = resolvedModule.packageId && chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, - resolvedModule.packageId.name); + getMangledNameForScopedPackage(resolvedModule.packageId.name)); errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 50181bb98e4..ddb0f5cbb5d 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -1157,7 +1157,8 @@ namespace ts { return `@types/${getMangledNameForScopedPackage(packageName)}`; } - function getMangledNameForScopedPackage(packageName: string): string { + /* @internal */ + export function getMangledNameForScopedPackage(packageName: string): string { if (startsWith(packageName, "@")) { const replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator); if (replaceSlash !== packageName) { diff --git a/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.errors.txt b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.errors.txt new file mode 100644 index 00000000000..0500ac268db --- /dev/null +++ b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.errors.txt @@ -0,0 +1,16 @@ +/a.ts(1,22): error TS7016: Could not find a declaration file for module '@foo/bar'. '/node_modules/@foo/bar/index.js' implicitly has an 'any' type. + Try `npm install @types/foo__bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo__bar';` + + +==== /a.ts (1 errors) ==== + import * as foo from "@foo/bar"; + ~~~~~~~~~~ +!!! error TS7016: Could not find a declaration file for module '@foo/bar'. '/node_modules/@foo/bar/index.js' implicitly has an 'any' type. +!!! error TS7016: Try `npm install @types/foo__bar` if it exists or add a new declaration (.d.ts) file containing `declare module 'foo__bar';` + +==== /node_modules/@foo/bar/package.json (0 errors) ==== + { "name": "@foo/bar", "version": "1.2.3" } + +==== /node_modules/@foo/bar/index.js (0 errors) ==== + This file is not processed. + \ No newline at end of file diff --git a/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.js b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.js new file mode 100644 index 00000000000..fc33d4a2665 --- /dev/null +++ b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.js @@ -0,0 +1,15 @@ +//// [tests/cases/conformance/moduleResolution/untypedModuleImport_noImplicitAny_scoped.ts] //// + +//// [package.json] +{ "name": "@foo/bar", "version": "1.2.3" } + +//// [index.js] +This file is not processed. + +//// [a.ts] +import * as foo from "@foo/bar"; + + +//// [a.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.symbols b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.symbols new file mode 100644 index 00000000000..d0c3ed4be83 --- /dev/null +++ b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.symbols @@ -0,0 +1,4 @@ +=== /a.ts === +import * as foo from "@foo/bar"; +>foo : Symbol(foo, Decl(a.ts, 0, 6)) + diff --git a/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.types b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.types new file mode 100644 index 00000000000..f3f3fcf9152 --- /dev/null +++ b/tests/baselines/reference/untypedModuleImport_noImplicitAny_scoped.types @@ -0,0 +1,4 @@ +=== /a.ts === +import * as foo from "@foo/bar"; +>foo : any + diff --git a/tests/cases/conformance/moduleResolution/untypedModuleImport_noImplicitAny_scoped.ts b/tests/cases/conformance/moduleResolution/untypedModuleImport_noImplicitAny_scoped.ts new file mode 100644 index 00000000000..4899c1b70ad --- /dev/null +++ b/tests/cases/conformance/moduleResolution/untypedModuleImport_noImplicitAny_scoped.ts @@ -0,0 +1,11 @@ +// @noImplicitReferences: true +// @noImplicitAny: true + +// @filename: /node_modules/@foo/bar/package.json +{ "name": "@foo/bar", "version": "1.2.3" } + +// @filename: /node_modules/@foo/bar/index.js +This file is not processed. + +// @filename: /a.ts +import * as foo from "@foo/bar"; From 95dfd271e26d1bc890fa647f78fa8d118d223e31 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 26 Feb 2018 12:37:45 -0800 Subject: [PATCH 224/298] Make some internal types @internal (#22190) --- src/compiler/types.ts | 4 +++ .../reference/api/tsserverlibrary.d.ts | 30 ------------------- tests/baselines/reference/api/typescript.d.ts | 30 ------------------- 3 files changed, 4 insertions(+), 60 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 0e1f08a69d8..6b325bf6abe 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3906,6 +3906,7 @@ namespace ts { AlwaysStrict = 1 << 4, // Always use strict rules for contravariant inferences } + /* @internal */ export interface InferenceInfo { typeParameter: TypeParameter; // Type parameter for which inferences are being made candidates: Type[]; // Candidates in covariant positions (or undefined) @@ -3916,6 +3917,7 @@ namespace ts { isFixed: boolean; // True if inferences are fixed } + /* @internal */ export const enum InferenceFlags { None = 0, // No special inference behaviors InferUnionTypes = 1 << 0, // Infer union types for disjoint candidates (otherwise unknownType) @@ -3932,12 +3934,14 @@ namespace ts { * x | y is Maybe if either x or y is Maybe, but neither x or y is True. * x | y is True if either x or y is True. */ + /* @internal */ export const enum Ternary { False = 0, Maybe = 1, True = -1 } + /* @internal */ export type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; /* @internal */ diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index ee3bd07d280..9f5ceb1f0cb 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2227,36 +2227,6 @@ declare namespace ts { NoConstraints = 8, AlwaysStrict = 16, } - interface InferenceInfo { - typeParameter: TypeParameter; - candidates: Type[]; - contraCandidates: Type[]; - inferredType: Type; - priority: InferencePriority; - topLevel: boolean; - isFixed: boolean; - } - enum InferenceFlags { - None = 0, - InferUnionTypes = 1, - NoDefault = 2, - AnyDefault = 4, - } - /** - * Ternary values are defined such that - * x & y is False if either x or y is False. - * x & y is Maybe if either x or y is Maybe, but neither x or y is False. - * x & y is True if both x and y are True. - * x | y is False if both x and y are False. - * x | y is Maybe if either x or y is Maybe, but neither x or y is True. - * x | y is True if either x or y is True. - */ - enum Ternary { - False = 0, - Maybe = 1, - True = -1, - } - type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; interface JsFileExtensionInfo { extension: string; isMixedContent: boolean; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 0075da06668..e5fb0b1e169 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2227,36 +2227,6 @@ declare namespace ts { NoConstraints = 8, AlwaysStrict = 16, } - interface InferenceInfo { - typeParameter: TypeParameter; - candidates: Type[]; - contraCandidates: Type[]; - inferredType: Type; - priority: InferencePriority; - topLevel: boolean; - isFixed: boolean; - } - enum InferenceFlags { - None = 0, - InferUnionTypes = 1, - NoDefault = 2, - AnyDefault = 4, - } - /** - * Ternary values are defined such that - * x & y is False if either x or y is False. - * x & y is Maybe if either x or y is Maybe, but neither x or y is False. - * x & y is True if both x and y are True. - * x | y is False if both x and y are False. - * x | y is Maybe if either x or y is Maybe, but neither x or y is True. - * x | y is True if either x or y is True. - */ - enum Ternary { - False = 0, - Maybe = 1, - True = -1, - } - type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; interface JsFileExtensionInfo { extension: string; isMixedContent: boolean; From 0dc5f18bdbae6b9cfb79db6d4138668b95c30362 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 26 Feb 2018 12:43:31 -0800 Subject: [PATCH 225/298] Remove excess comment ranges from initialized and property parameter emit (#22152) --- src/compiler/transformers/es2015.ts | 17 +++++++----- src/compiler/transformers/ts.ts | 27 ++++++++++--------- .../defaultParameterTrailingComments.js | 17 ++++++++++++ .../defaultParameterTrailingComments.symbols | 12 +++++++++ .../defaultParameterTrailingComments.types | 14 ++++++++++ .../parameterReferenceInInitializer1.js | 4 +-- .../defaultParameterTrailingComments.ts | 5 ++++ .../TypeScript-Node-Starter | 2 +- 8 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 tests/baselines/reference/defaultParameterTrailingComments.js create mode 100644 tests/baselines/reference/defaultParameterTrailingComments.symbols create mode 100644 tests/baselines/reference/defaultParameterTrailingComments.types create mode 100644 tests/cases/compiler/defaultParameterTrailingComments.ts diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index 7e4769a3e50..2178292f48f 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -1311,24 +1311,27 @@ namespace ts { setTextRange( createBlock([ createStatement( - setTextRange( - createAssignment( - setEmitFlags(getMutableClone(name), EmitFlags.NoSourceMap), - setEmitFlags(initializer, EmitFlags.NoSourceMap | getEmitFlags(initializer)) + setEmitFlags( + setTextRange( + createAssignment( + setEmitFlags(getMutableClone(name), EmitFlags.NoSourceMap), + setEmitFlags(initializer, EmitFlags.NoSourceMap | getEmitFlags(initializer) | EmitFlags.NoComments) + ), + parameter ), - parameter + EmitFlags.NoComments ) ) ]), parameter ), - EmitFlags.SingleLine | EmitFlags.NoTrailingSourceMap | EmitFlags.NoTokenSourceMaps + EmitFlags.SingleLine | EmitFlags.NoTrailingSourceMap | EmitFlags.NoTokenSourceMaps | EmitFlags.NoComments ) ); startOnNewLine(statement); setTextRange(statement, parameter); - setEmitFlags(statement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoTrailingSourceMap | EmitFlags.CustomPrologue); + setEmitFlags(statement, EmitFlags.NoTokenSourceMaps | EmitFlags.NoTrailingSourceMap | EmitFlags.CustomPrologue | EmitFlags.NoComments); statements.push(statement); } diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 059ae73ea2b..9cd0ab93303 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -1147,20 +1147,23 @@ namespace ts { setEmitFlags(localName, EmitFlags.NoComments); return startOnNewLine( - setTextRange( - createStatement( - createAssignment( - setTextRange( - createPropertyAccess( - createThis(), - propertyName + setEmitFlags( + setTextRange( + createStatement( + createAssignment( + setTextRange( + createPropertyAccess( + createThis(), + propertyName + ), + node.name ), - node.name - ), - localName - ) + localName + ) + ), + moveRangePos(node, -1) ), - moveRangePos(node, -1) + EmitFlags.NoComments ) ); } diff --git a/tests/baselines/reference/defaultParameterTrailingComments.js b/tests/baselines/reference/defaultParameterTrailingComments.js new file mode 100644 index 00000000000..9f116e85c1e --- /dev/null +++ b/tests/baselines/reference/defaultParameterTrailingComments.js @@ -0,0 +1,17 @@ +//// [defaultParameterTrailingComments.ts] +class C { + constructor(defaultParam: boolean = false /* Emit only once*/) {} +} + +function foo(defaultParam = 10 /*emit only once*/) {} + +//// [defaultParameterTrailingComments.js] +var C = /** @class */ (function () { + function C(defaultParam /* Emit only once*/) { + if (defaultParam === void 0) { defaultParam = false; } + } + return C; +}()); +function foo(defaultParam /*emit only once*/) { + if (defaultParam === void 0) { defaultParam = 10; } +} diff --git a/tests/baselines/reference/defaultParameterTrailingComments.symbols b/tests/baselines/reference/defaultParameterTrailingComments.symbols new file mode 100644 index 00000000000..e65497b70f7 --- /dev/null +++ b/tests/baselines/reference/defaultParameterTrailingComments.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/defaultParameterTrailingComments.ts === +class C { +>C : Symbol(C, Decl(defaultParameterTrailingComments.ts, 0, 0)) + + constructor(defaultParam: boolean = false /* Emit only once*/) {} +>defaultParam : Symbol(defaultParam, Decl(defaultParameterTrailingComments.ts, 1, 16)) +} + +function foo(defaultParam = 10 /*emit only once*/) {} +>foo : Symbol(foo, Decl(defaultParameterTrailingComments.ts, 2, 1)) +>defaultParam : Symbol(defaultParam, Decl(defaultParameterTrailingComments.ts, 4, 13)) + diff --git a/tests/baselines/reference/defaultParameterTrailingComments.types b/tests/baselines/reference/defaultParameterTrailingComments.types new file mode 100644 index 00000000000..0b8389a4834 --- /dev/null +++ b/tests/baselines/reference/defaultParameterTrailingComments.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/defaultParameterTrailingComments.ts === +class C { +>C : C + + constructor(defaultParam: boolean = false /* Emit only once*/) {} +>defaultParam : boolean +>false : false +} + +function foo(defaultParam = 10 /*emit only once*/) {} +>foo : (defaultParam?: number) => void +>defaultParam : number +>10 : 10 + diff --git a/tests/baselines/reference/parameterReferenceInInitializer1.js b/tests/baselines/reference/parameterReferenceInInitializer1.js index 08f1ae1cebc..01959aca130 100644 --- a/tests/baselines/reference/parameterReferenceInInitializer1.js +++ b/tests/baselines/reference/parameterReferenceInInitializer1.js @@ -19,8 +19,8 @@ function fn(y, set) { var C = /** @class */ (function () { function C(y, x // expected to work, but actually doesn't ) { - if (x === void 0) { x = fn(y, function (y, x) { return y.x = x; }); } // expected to work, but actually doesn't - this.x = x; // expected to work, but actually doesn't + if (x === void 0) { x = fn(y, function (y, x) { return y.x = x; }); } + this.x = x; } return C; }()); diff --git a/tests/cases/compiler/defaultParameterTrailingComments.ts b/tests/cases/compiler/defaultParameterTrailingComments.ts new file mode 100644 index 00000000000..f5e4c8f7dca --- /dev/null +++ b/tests/cases/compiler/defaultParameterTrailingComments.ts @@ -0,0 +1,5 @@ +class C { + constructor(defaultParam: boolean = false /* Emit only once*/) {} +} + +function foo(defaultParam = 10 /*emit only once*/) {} \ No newline at end of file diff --git a/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter b/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter index ed149eb0c78..40bdb4eadab 160000 --- a/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter +++ b/tests/cases/user/TypeScript-Node-Starter/TypeScript-Node-Starter @@ -1 +1 @@ -Subproject commit ed149eb0c787b1195a95b44105822c64bb6eb636 +Subproject commit 40bdb4eadabc9fbed7d83e3f26817a931c0763b6 From d15b098e701991200c5a0f46055b939ff2b3d963 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 26 Feb 2018 12:55:08 -0800 Subject: [PATCH 226/298] Increase rwc js verification timeout (#22191) * Increase js verification timeout * Add seperator --- src/harness/rwcRunner.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index 3631186bb48..54138c2880a 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -55,7 +55,7 @@ namespace RWC { }); it("can compile", function(this: Mocha.ITestCallbackContext) { - this.timeout(800000); // Allow long timeouts for RWC compilations + this.timeout(800_000); // Allow long timeouts for RWC compilations let opts: ts.ParsedCommandLine; const ioLog: IoLog = Playback.newStyleLogIntoOldStyleLog(JSON.parse(Harness.IO.readFile(`internal/cases/rwc/${jsonPath}/test.json`)), Harness.IO, `internal/cases/rwc/${baseName}`); @@ -171,7 +171,7 @@ namespace RWC { it("has the expected emitted code", function(this: Mocha.ITestCallbackContext) { - this.timeout(10000); // Allow long timeouts for RWC js verification + this.timeout(100_000); // Allow longer timeouts for RWC js verification Harness.Baseline.runMultifileBaseline(baseName, "", () => { return Harness.Compiler.iterateOutputs(compilerResult.files); }, baselineOpts, [".js", ".jsx"]); From c2e6f7aacc507a2351a09d36434e103c6b7b620d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 26 Feb 2018 13:48:40 -0800 Subject: [PATCH 227/298] Disallow recursion --- src/compiler/checker.ts | 137 +++++++++------------------ src/compiler/diagnosticMessages.json | 4 - src/compiler/types.ts | 4 +- 3 files changed, 46 insertions(+), 99 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 004fd947edc..84355e32a73 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -58,8 +58,6 @@ namespace ts { let symbolCount = 0; let enumCount = 0; let symbolInstantiationDepth = 0; - let aliasInstantiationDepth = 0; - const aliasInstantiations: Symbol[] = []; const emptySymbols = createSymbolTable(); const identityMapper: (type: Type) => Type = identity; @@ -8189,18 +8187,10 @@ namespace ts { return type.flags & TypeFlags.Substitution ? (type).typeParameter : type; } - function getRootTrueType(root: ConditionalRoot) { - return root.resolvedTrueType || (root.resolvedTrueType = getTypeFromTypeNode(root.node.trueType)); - } - - function getRootFalseType(root: ConditionalRoot) { - return root.resolvedFalseType || (root.resolvedFalseType = getTypeFromTypeNode(root.node.falseType)); - } - function getConditionalType(root: ConditionalRoot, mapper: TypeMapper): Type { let combinedMapper: TypeMapper; - const getTrueType = () => instantiateType(getRootTrueType(root), combinedMapper || mapper); - const getFalseType = () => instantiateType(getRootFalseType(root), mapper); + const getTrueType = () => instantiateType(root.trueType, combinedMapper || mapper); + const getFalseType = () => instantiateType(root.falseType, mapper); const checkType = instantiateType(root.checkType, mapper); const extendsType = instantiateType(root.extendsType, mapper); // Return falseType for a definitely false extends check. We check an instantations of the two @@ -8247,11 +8237,11 @@ namespace ts { } function getTrueTypeFromConditionalType(type: ConditionalType) { - return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(getRootTrueType(type.root), type.mapper)); + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); } function getFalseTypeFromConditionalType(type: ConditionalType) { - return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(getRootFalseType(type.root), type.mapper)); + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); } function getInferTypeParameters(node: ConditionalTypeNode): TypeParameter[] { @@ -8275,14 +8265,14 @@ namespace ts { node, checkType, extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), isDistributive: !!(checkType.flags & TypeFlags.TypeParameter), inferTypeParameters: getInferTypeParameters(node), outerTypeParameters, instantiations: undefined, aliasSymbol: getAliasSymbolForTypeNode(node), - aliasTypeArguments: getAliasTypeArgumentsForTypeNode(node), - resolvedTrueType: undefined, - resolvedFalseType: undefined + aliasTypeArguments: getAliasTypeArgumentsForTypeNode(node) }; links.resolvedType = getConditionalType(root, /*mapper*/ undefined); if (outerTypeParameters) { @@ -8910,89 +8900,50 @@ namespace ts { return getConditionalType(root, mapper); } - function getInstantiationErrorTypeAlias() { - const counted: Symbol[] = []; - let topCount = 0; - let topSymbol: Symbol; - for (let i = 0; i < aliasInstantiationDepth - topCount; i++) { - const symbol = aliasInstantiations[i]; - if (counted.indexOf(symbol) < 0) { - counted.push(symbol); - let count = 0; - for (let j = i; j < aliasInstantiationDepth; j++) { - if (symbol === aliasInstantiations[j]) count++; - } - if (count > topCount) { - topCount = count; - topSymbol = symbol; - } - } - } - return topSymbol && getDeclarationOfKind(topSymbol, SyntaxKind.TypeAliasDeclaration); - } - function instantiateType(type: Type, mapper: TypeMapper): Type { if (type && mapper && mapper !== identityMapper) { - if (aliasInstantiationDepth >= 100) { - const declaration = getInstantiationErrorTypeAlias(); - error(declaration, Diagnostics.Recursive_instantiations_of_type_0_are_excessively_deep_and_possibly_infinite, - declarationNameToString(declaration.name)); - return unknownType; + if (type.flags & TypeFlags.TypeParameter) { + return mapper(type); } - if (type.aliasSymbol) { - aliasInstantiations[aliasInstantiationDepth] = type.aliasSymbol; - aliasInstantiationDepth++; - const result = instantiateTypeWorker(type, mapper); - aliasInstantiationDepth--; - return result; + if (type.flags & TypeFlags.Object) { + if ((type).objectFlags & ObjectFlags.Anonymous) { + // If the anonymous type originates in a declaration of a function, method, class, or + // interface, in an object type literal, or in an object literal expression, we may need + // to instantiate the type because it might reference a type parameter. + return type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral) && type.symbol.declarations ? + getAnonymousTypeInstantiation(type, mapper) : type; + } + if ((type).objectFlags & ObjectFlags.Mapped) { + return getAnonymousTypeInstantiation(type, mapper); + } + if ((type).objectFlags & ObjectFlags.Reference) { + const typeArguments = (type).typeArguments; + const newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference((type).target, newTypeArguments) : type; + } } - return instantiateTypeWorker(type, mapper); - } - return type; - } - - function instantiateTypeWorker(type: Type, mapper: TypeMapper): Type { - if (type.flags & TypeFlags.TypeParameter) { - return mapper(type); - } - if (type.flags & TypeFlags.Object) { - if ((type).objectFlags & ObjectFlags.Anonymous) { - // If the anonymous type originates in a declaration of a function, method, class, or - // interface, in an object type literal, or in an object literal expression, we may need - // to instantiate the type because it might reference a type parameter. - return type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method | SymbolFlags.Class | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral) && type.symbol.declarations ? - getAnonymousTypeInstantiation(type, mapper) : type; + if (type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Primitive)) { + const types = (type).types; + const newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, UnionReduction.Literal, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } - if ((type).objectFlags & ObjectFlags.Mapped) { - return getAnonymousTypeInstantiation(type, mapper); + if (type.flags & TypeFlags.Intersection) { + const types = (type).types; + const newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } - if ((type).objectFlags & ObjectFlags.Reference) { - const typeArguments = (type).typeArguments; - const newTypeArguments = instantiateTypes(typeArguments, mapper); - return newTypeArguments !== typeArguments ? createTypeReference((type).target, newTypeArguments) : type; + if (type.flags & TypeFlags.Index) { + return getIndexType(instantiateType((type).type, mapper)); + } + if (type.flags & TypeFlags.IndexedAccess) { + return getIndexedAccessType(instantiateType((type).objectType, mapper), instantiateType((type).indexType, mapper)); + } + if (type.flags & TypeFlags.Conditional) { + return getConditionalTypeInstantiation(type, combineTypeMappers((type).mapper, mapper)); + } + if (type.flags & TypeFlags.Substitution) { + return mapper((type).typeParameter); } - } - if (type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Primitive)) { - const types = (type).types; - const newTypes = instantiateTypes(types, mapper); - return newTypes !== types ? getUnionType(newTypes, UnionReduction.Literal, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; - } - if (type.flags & TypeFlags.Intersection) { - const types = (type).types; - const newTypes = instantiateTypes(types, mapper); - return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; - } - if (type.flags & TypeFlags.Index) { - return getIndexType(instantiateType((type).type, mapper)); - } - if (type.flags & TypeFlags.IndexedAccess) { - return getIndexedAccessType(instantiateType((type).objectType, mapper), instantiateType((type).indexType, mapper)); - } - if (type.flags & TypeFlags.Conditional) { - return getConditionalTypeInstantiation(type, combineTypeMappers((type).mapper, mapper)); - } - if (type.flags & TypeFlags.Substitution) { - return mapper((type).typeParameter); } return type; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a38fcd4dafa..f120e81283a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1988,10 +1988,6 @@ "category": "Error", "code": 2567 }, - "Recursive instantiations of type '{0}' are excessively deep and possibly infinite.": { - "category": "Error", - "code": 2568 - }, "JSX element attributes type '{0}' may not be a union type.": { "category": "Error", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index cc57d1215f7..758a5e4f1f6 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3815,14 +3815,14 @@ namespace ts { node: ConditionalTypeNode; checkType: Type; extendsType: Type; + trueType: Type; + falseType: Type; isDistributive: boolean; inferTypeParameters: TypeParameter[]; outerTypeParameters?: TypeParameter[]; instantiations?: Map; aliasSymbol: Symbol; aliasTypeArguments: Type[]; - resolvedTrueType?: Type; - resolvedFalseType?: Type; } // T extends U ? X : Y (TypeFlags.Conditional) From 1f434feeb79e153912aa04976f0d87a0f24888d5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 26 Feb 2018 13:49:23 -0800 Subject: [PATCH 228/298] Accept API baseline changes --- tests/baselines/reference/api/tsserverlibrary.d.ts | 4 ++-- tests/baselines/reference/api/typescript.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 7578e6985e3..72b729234c2 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2191,14 +2191,14 @@ declare namespace ts { node: ConditionalTypeNode; checkType: Type; extendsType: Type; + trueType: Type; + falseType: Type; isDistributive: boolean; inferTypeParameters: TypeParameter[]; outerTypeParameters?: TypeParameter[]; instantiations?: Map; aliasSymbol: Symbol; aliasTypeArguments: Type[]; - resolvedTrueType?: Type; - resolvedFalseType?: Type; } interface ConditionalType extends InstantiableType { root: ConditionalRoot; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 380fa24f215..5fe1a940301 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2191,14 +2191,14 @@ declare namespace ts { node: ConditionalTypeNode; checkType: Type; extendsType: Type; + trueType: Type; + falseType: Type; isDistributive: boolean; inferTypeParameters: TypeParameter[]; outerTypeParameters?: TypeParameter[]; instantiations?: Map; aliasSymbol: Symbol; aliasTypeArguments: Type[]; - resolvedTrueType?: Type; - resolvedFalseType?: Type; } interface ConditionalType extends InstantiableType { root: ConditionalRoot; From 6e672b7c9db1fd63dd7be80c4eda649cff24574c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 26 Feb 2018 14:26:15 -0800 Subject: [PATCH 229/298] Use '{}' instead of 'never' for no candidates in conditional inference --- src/compiler/checker.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 84355e32a73..dee42764f36 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8188,9 +8188,6 @@ namespace ts { } function getConditionalType(root: ConditionalRoot, mapper: TypeMapper): Type { - let combinedMapper: TypeMapper; - const getTrueType = () => instantiateType(root.trueType, combinedMapper || mapper); - const getFalseType = () => instantiateType(root.falseType, mapper); const checkType = instantiateType(root.checkType, mapper); const extendsType = instantiateType(root.extendsType, mapper); // Return falseType for a definitely false extends check. We check an instantations of the two @@ -8198,9 +8195,10 @@ namespace ts { // possible (the wildcard type is assignable to and from all types). If those are not related, // then no instatiations will be and we can just return the false branch type. if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { - return getFalseType(); + return instantiateType(root.falseType, mapper); } // The check could be true for some instantiation + let combinedMapper: TypeMapper; if (root.inferTypeParameters) { const inferences = map(root.inferTypeParameters, createInferenceInfo); // We don't want inferences from constraints as they may cause us to eagerly resolve the @@ -8208,12 +8206,12 @@ namespace ts { // types rules (i.e. proper contravariance) for inferences. inferTypes(inferences, checkType, extendsType, InferencePriority.NoConstraints | InferencePriority.AlwaysStrict); // We infer 'never' when there are no candidates for a type parameter - const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || neverType); + const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || emptyObjectType); combinedMapper = combineTypeMappers(mapper, createTypeMapper(root.inferTypeParameters, inferredTypes)); } // Return union of trueType and falseType for any and never since they match anything if (checkType.flags & TypeFlags.Any || (checkType.flags & TypeFlags.Never && !(extendsType.flags & TypeFlags.Never))) { - return getUnionType([getTrueType(), getFalseType()]); + return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); } // Instantiate the extends type including inferences for 'infer T' type parameters const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; @@ -8222,7 +8220,7 @@ namespace ts { // type Foo = T extends { x: string } ? string : number // would immediately resolve to 'string' instead of being deferred. if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { - return getTrueType(); + return instantiateType(root.trueType, combinedMapper || mapper); } // Return a deferred type for a check that is neither definitely true nor definitely false const erasedCheckType = getActualTypeParameter(checkType); From 3ad62ef3d67d37998093bca8d05effa80c40d311 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 26 Feb 2018 14:26:26 -0800 Subject: [PATCH 230/298] Update tests --- tests/cases/conformance/types/conditional/inferTypes1.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cases/conformance/types/conditional/inferTypes1.ts b/tests/cases/conformance/types/conditional/inferTypes1.ts index cb803103bae..13b142e0122 100644 --- a/tests/cases/conformance/types/conditional/inferTypes1.ts +++ b/tests/cases/conformance/types/conditional/inferTypes1.ts @@ -13,7 +13,7 @@ type T02 = Unpacked<() => string>; // string type T03 = Unpacked>; // string type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any -type T06 = Unpacked; // never +type T06 = Unpacked; // {} function f1(s: string) { return { a: 1, b: s }; @@ -42,7 +42,7 @@ type U14 = InstanceType; // Error type ArgumentType any> = T extends (a: infer A) => any ? A : any; -type T20 = ArgumentType<() => void>; // never +type T20 = ArgumentType<() => void>; // {} type T21 = ArgumentType<(x: string) => number>; // string type T22 = ArgumentType<(x?: string) => number>; // string | undefined type T23 = ArgumentType<(...args: string[]) => number>; // string From eaf806fedcaca6fefb40d2f5b0c9f1ffc2376525 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 26 Feb 2018 14:26:35 -0800 Subject: [PATCH 231/298] Accept new baselines --- tests/baselines/reference/inferTypes1.errors.txt | 4 ++-- tests/baselines/reference/inferTypes1.js | 4 ++-- tests/baselines/reference/inferTypes1.symbols | 4 ++-- tests/baselines/reference/inferTypes1.types | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index acc4b9029b1..6b4e4169240 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -33,7 +33,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type T03 = Unpacked>; // string type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any - type T06 = Unpacked; // never + type T06 = Unpacked; // {} function f1(s: string) { return { a: 1, b: s }; @@ -72,7 +72,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type ArgumentType any> = T extends (a: infer A) => any ? A : any; - type T20 = ArgumentType<() => void>; // never + type T20 = ArgumentType<() => void>; // {} type T21 = ArgumentType<(x: string) => number>; // string type T22 = ArgumentType<(x?: string) => number>; // string | undefined type T23 = ArgumentType<(...args: string[]) => number>; // string diff --git a/tests/baselines/reference/inferTypes1.js b/tests/baselines/reference/inferTypes1.js index 146acdc1ce7..a7d68878cde 100644 --- a/tests/baselines/reference/inferTypes1.js +++ b/tests/baselines/reference/inferTypes1.js @@ -11,7 +11,7 @@ type T02 = Unpacked<() => string>; // string type T03 = Unpacked>; // string type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any -type T06 = Unpacked; // never +type T06 = Unpacked; // {} function f1(s: string) { return { a: 1, b: s }; @@ -40,7 +40,7 @@ type U14 = InstanceType; // Error type ArgumentType any> = T extends (a: infer A) => any ? A : any; -type T20 = ArgumentType<() => void>; // never +type T20 = ArgumentType<() => void>; // {} type T21 = ArgumentType<(x: string) => number>; // string type T22 = ArgumentType<(x?: string) => number>; // string | undefined type T23 = ArgumentType<(...args: string[]) => number>; // string diff --git a/tests/baselines/reference/inferTypes1.symbols b/tests/baselines/reference/inferTypes1.symbols index 138f60aaf49..49b6ca2656b 100644 --- a/tests/baselines/reference/inferTypes1.symbols +++ b/tests/baselines/reference/inferTypes1.symbols @@ -50,7 +50,7 @@ type T05 = Unpacked; // any >T05 : Symbol(T05, Decl(inferTypes1.ts, 10, 49)) >Unpacked : Symbol(Unpacked, Decl(inferTypes1.ts, 0, 0)) -type T06 = Unpacked; // never +type T06 = Unpacked; // {} >T06 : Symbol(T06, Decl(inferTypes1.ts, 11, 25)) >Unpacked : Symbol(Unpacked, Decl(inferTypes1.ts, 0, 0)) @@ -150,7 +150,7 @@ type ArgumentType any> = T extends (a: infer A) => any ? A >A : Symbol(A, Decl(inferTypes1.ts, 39, 66)) >A : Symbol(A, Decl(inferTypes1.ts, 39, 66)) -type T20 = ArgumentType<() => void>; // never +type T20 = ArgumentType<() => void>; // {} >T20 : Symbol(T20, Decl(inferTypes1.ts, 39, 87)) >ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index f29c380a0ad..43bb087affc 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -50,8 +50,8 @@ type T05 = Unpacked; // any >T05 : any >Unpacked : Unpacked -type T06 = Unpacked; // never ->T06 : never +type T06 = Unpacked; // {} +>T06 : {} >Unpacked : Unpacked function f1(s: string) { @@ -154,8 +154,8 @@ type ArgumentType any> = T extends (a: infer A) => any ? A >A : A >A : A -type T20 = ArgumentType<() => void>; // never ->T20 : never +type T20 = ArgumentType<() => void>; // {} +>T20 : {} >ArgumentType : ArgumentType type T21 = ArgumentType<(x: string) => number>; // string @@ -312,7 +312,7 @@ type T60 = infer U; // Error >U : U type T61 = infer A extends infer B ? infer C : infer D; // Error ->T61 : never +>T61 : {} >T : T >A : A >B : B From 0b1e21794d627f87c8e8484afdaa225433bc00cf Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 26 Feb 2018 14:55:26 -0800 Subject: [PATCH 232/298] fourslash diagnostics tests: use objects instead of strings (#22193) --- src/harness/fourslash.ts | 14 ++--- src/services/shims.ts | 2 +- tests/cases/fourslash/fourslash.ts | 11 +++- .../getJavaScriptSyntacticDiagnostics1.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics10.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics11.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics12.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics13.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics14.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics15.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics16.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics17.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics18.ts | 28 ++++----- .../getJavaScriptSyntacticDiagnostics19.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics2.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics21.ts | 2 +- .../getJavaScriptSyntacticDiagnostics22.ts | 2 +- .../getJavaScriptSyntacticDiagnostics23.ts | 4 +- .../getJavaScriptSyntacticDiagnostics3.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics4.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics5.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics6.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics7.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics8.ts | 14 ++--- .../getJavaScriptSyntacticDiagnostics9.ts | 14 ++--- .../fourslash/jsDocAugmentsAndExtends.ts | 17 +++--- ...pilationDuplicateFunctionImplementation.ts | 20 +++++-- .../getJavaScriptSyntacticDiagnostics01.ts | 28 ++++----- .../getJavaScriptSyntacticDiagnostics02.ts | 58 +++++++++---------- 29 files changed, 226 insertions(+), 212 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 7fdbbbc9640..88b1c32814e 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1236,20 +1236,18 @@ Actual: ${stringify(fullActual)}`); return this.languageService.findReferences(this.activeFile.fileName, this.currentCaretPosition); } - public getSyntacticDiagnostics(expected: string) { + public getSyntacticDiagnostics(expected: ReadonlyArray) { const diagnostics = this.languageService.getSyntacticDiagnostics(this.activeFile.fileName); this.testDiagnostics(expected, diagnostics); } - public getSemanticDiagnostics(expected: string) { + public getSemanticDiagnostics(expected: ReadonlyArray) { const diagnostics = this.languageService.getSemanticDiagnostics(this.activeFile.fileName); this.testDiagnostics(expected, diagnostics); } - private testDiagnostics(expected: string, diagnostics: ReadonlyArray) { - const realized = ts.realizeDiagnostics(diagnostics, "\r\n"); - const actual = stringify(realized); - assert.equal(actual, expected); + private testDiagnostics(expected: ReadonlyArray, diagnostics: ReadonlyArray) { + assert.deepEqual(ts.realizeDiagnostics(diagnostics, ts.newLineCharacter), expected); } public verifyQuickInfoAt(markerName: string, expectedText: string, expectedDocumentation?: string) { @@ -4321,11 +4319,11 @@ namespace FourSlashInterface { this.state.verifyQuickInfoDisplayParts(kind, kindModifiers, textSpan, displayParts, documentation, tags); } - public getSyntacticDiagnostics(expected: string) { + public getSyntacticDiagnostics(expected: ReadonlyArray) { this.state.getSyntacticDiagnostics(expected); } - public getSemanticDiagnostics(expected: string) { + public getSemanticDiagnostics(expected: ReadonlyArray) { this.state.getSemanticDiagnostics(expected); } diff --git a/src/services/shims.ts b/src/services/shims.ts index 11e397f526a..5abf5da2c07 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -581,7 +581,7 @@ namespace ts { } } - interface RealizedDiagnostic { + export interface RealizedDiagnostic { message: string; start: number; length: number; diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 4d537661a27..9680eb822a7 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -347,8 +347,8 @@ declare namespace FourSlashInterface { start: number; length: number; }, displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[], tags: ts.JSDocTagInfo[]): void; - getSyntacticDiagnostics(expected: string): void; - getSemanticDiagnostics(expected: string): void; + getSyntacticDiagnostics(expected: ReadonlyArray): void; + getSemanticDiagnostics(expected: ReadonlyArray): void; ProjectInfo(expected: string[]): void; allRangesAppearInImplementationList(markerName: string): void; } @@ -520,6 +520,13 @@ declare namespace FourSlashInterface { text: string; range: Range; } + interface RealizedDiagnostic { + message: string; + start: number; + length: number; + category: string; + code: number; + } } declare function verifyOperationIsCancelled(f: any): void; declare var test: FourSlashInterface.test_; diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts index 8c151742b75..20ca5101ba8 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// import a = b; -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'import ... =' can only be used in a .ts file.", - "start": 0, - "length": 13, - "category": "error", - "code": 8002 + message: "'import ... =' can only be used in a .ts file.", + start: 0, + length: 13, + category: "error", + code: 8002 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts index 206c1a6e2cf..fb9d68336e0 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// function F() { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'type parameter declarations' can only be used in a .ts file.", - "start": 11, - "length": 1, - "category": "error", - "code": 8004 + message: "'type parameter declarations' can only be used in a .ts file.", + start: 11, + length: 1, + category: "error", + code: 8004 } -]`); \ No newline at end of file +]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts index d9b1d35b5c6..4a5dafd1042 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// function F(): number { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'types' can only be used in a .ts file.", - "start": 14, - "length": 6, - "category": "error", - "code": 8010 + message: "'types' can only be used in a .ts file.", + start: 14, + length: 6, + category: "error", + code: 8010 } -]`); \ No newline at end of file +]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts index cf244f7cfa2..fc7956d73c9 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// declare var v; -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'declare' can only be used in a .ts file.", - "start": 0, - "length": 7, - "category": "error", - "code": 8009 + message: "'declare' can only be used in a .ts file.", + start: 0, + length: 7, + category: "error", + code: 8009 } -]`); \ No newline at end of file +]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts index aaf3289fcfe..87cc7b37867 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// var v: () => number; -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'types' can only be used in a .ts file.", - "start": 7, - "length": 12, - "category": "error", - "code": 8010 + message: "'types' can only be used in a .ts file.", + start: 7, + length: 12, + category: "error", + code: 8010 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts index a41d88dd675..4659897559c 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// Foo(); -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'type arguments' can only be used in a .ts file.", - "start": 4, - "length": 6, - "category": "error", - "code": 8011 + message: "'type arguments' can only be used in a .ts file.", + start: 4, + length: 6, + category: "error", + code: 8011 } -]`); \ No newline at end of file +]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts index 93430a9a004..31194e37fcb 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// function F(public p) { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'parameter modifiers' can only be used in a .ts file.", - "start": 11, - "length": 6, - "category": "error", - "code": 8012 + message: "'parameter modifiers' can only be used in a .ts file.", + start: 11, + length: 6, + category: "error", + code: 8012 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts index 60e0684b106..4d4e3a56287 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// function F(p?) { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'?' can only be used in a .ts file.", - "start": 12, - "length": 1, - "category": "error", - "code": 8009 + message: "'?' can only be used in a .ts file.", + start: 12, + length: 1, + category: "error", + code: 8009 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts index 3a57917b2ac..f6d4d65a83d 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// function F(a: number) { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'types' can only be used in a .ts file.", - "start": 14, - "length": 6, - "category": "error", - "code": 8010 + message: "'types' can only be used in a .ts file.", + start: 14, + length: 6, + category: "error", + code: 8010 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts index d253cb63611..71e098b0ee2 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts @@ -9,15 +9,15 @@ ////} goTo.file("a.js"); -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "\'public\' can only be used in a .ts file.", - "start": 93, - "length": 6, - "category": "error", - "code": 8009 + message: "\'public\' can only be used in a .ts file.", + start: 93, + length: 6, + category: "error", + code: 8009 } -]`); +]); // @Filename: b.js ////class C { @@ -25,12 +25,12 @@ verify.getSyntacticDiagnostics(`[ ////} goTo.file("b.js"); -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'types' can only be used in a .ts file.", - "start": 17, - "length": 6, - "category": "error", - "code": 8010 + message: "'types' can only be used in a .ts file.", + start: 17, + length: 6, + category: "error", + code: 8010 } -]`); +]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts index 7729a6ea470..fe602056dcb 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// enum E { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'enum declarations' can only be used in a .ts file.", - "start": 5, - "length": 1, - "category": "error", - "code": 8015 + message: "'enum declarations' can only be used in a .ts file.", + start: 5, + length: 1, + category: "error", + code: 8015 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts index 74e6a9ab089..0a14c8b5ddf 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// export = b; -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'export=' can only be used in a .ts file.", - "start": 0, - "length": 11, - "category": "error", - "code": 8003 + message: "'export=' can only be used in a .ts file.", + start: 0, + length: 11, + category: "error", + code: 8003 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics21.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics21.ts index 8a7120acbb3..b6dc7d3df51 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics21.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics21.ts @@ -5,4 +5,4 @@ // @Filename: a.js //// @internal class C {} -verify.getSemanticDiagnostics(`[]`); +verify.getSemanticDiagnostics([]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics22.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics22.ts index d4d830d29e9..dc4779eef07 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics22.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics22.ts @@ -4,4 +4,4 @@ // @Filename: a.js //// function foo(...a) {} -verify.getSemanticDiagnostics(`[]`); +verify.getSemanticDiagnostics([]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics23.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics23.ts index 2524e50e668..a8271dce596 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics23.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics23.ts @@ -10,5 +10,5 @@ //// } //// } -verify.getSyntacticDiagnostics(`[]`); -verify.getSemanticDiagnostics(`[]`); +verify.getSyntacticDiagnostics([]); +verify.getSemanticDiagnostics([]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts index 3528f333329..47837864781 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// class C { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'type parameter declarations' can only be used in a .ts file.", - "start": 8, - "length": 1, - "category": "error", - "code": 8004 + message: "'type parameter declarations' can only be used in a .ts file.", + start: 8, + length: 1, + category: "error", + code: 8004 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts index 3b849b08ae0..efd8fe85964 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// public class C { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'public' can only be used in a .ts file.", - "start": 0, - "length": 6, - "category": "error", - "code": 8009 + message: "'public' can only be used in a .ts file.", + start: 0, + length: 6, + category: "error", + code: 8009 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts index 985e3284025..0fcc7652101 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// class C implements D { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'implements clauses' can only be used in a .ts file.", - "start": 8, - "length": 12, - "category": "error", - "code": 8005 + message: "'implements clauses' can only be used in a .ts file.", + start: 8, + length: 12, + category: "error", + code: 8005 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts index a0042a0529b..6d4c7e7dcca 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// interface I { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'interface declarations' can only be used in a .ts file.", - "start": 10, - "length": 1, - "category": "error", - "code": 8006 + message: "'interface declarations' can only be used in a .ts file.", + start: 10, + length: 1, + category: "error", + code: 8006 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts index 64216d1e364..32ebf6bde0d 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// module M { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'module declarations' can only be used in a .ts file.", - "start": 7, - "length": 1, - "category": "error", - "code": 8007 + message: "'module declarations' can only be used in a .ts file.", + start: 7, + length: 1, + category: "error", + code: 8007 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts index 296f4f7445e..7ab0db792e8 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// type a = b; -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'type aliases' can only be used in a .ts file.", - "start": 5, - "length": 1, - "category": "error", - "code": 8008 + message: "'type aliases' can only be used in a .ts file.", + start: 5, + length: 1, + category: "error", + code: 8008 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts index f2c20a52ee9..c18f32e378e 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts @@ -4,12 +4,12 @@ // @Filename: a.js //// public function F() { } -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "'public' can only be used in a .ts file.", - "start": 0, - "length": 6, - "category": "error", - "code": 8009 + message: "'public' can only be used in a .ts file.", + start: 0, + length: 6, + category: "error", + code: 8009 } -]`); \ No newline at end of file +]); \ No newline at end of file diff --git a/tests/cases/fourslash/jsDocAugmentsAndExtends.ts b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts index 10f33260268..ca703f33025 100644 --- a/tests/cases/fourslash/jsDocAugmentsAndExtends.ts +++ b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts @@ -25,13 +25,10 @@ goTo.marker(); verify.quickInfoIs("(local var) x: number"); -verify.getSemanticDiagnostics( -`[ - { - "message": "Class declarations cannot have more than one \`@augments\` or \`@extends\` tag.", - "start": 36, - "length": 24, - "category": "error", - "code": 8025 - } -]`); \ No newline at end of file +verify.getSemanticDiagnostics([{ + message: "Class declarations cannot have more than one \`@augments\` or \`@extends\` tag.", + start: 36, + length: 24, + category: "error", + code: 8025 +}]); diff --git a/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts b/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts index 00d03b6e60c..115964b40f0 100644 --- a/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts +++ b/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts @@ -12,13 +12,25 @@ ////function foo() { return 30; }/*2*/ goTo.marker("1"); -verify.getSemanticDiagnostics('[]'); +verify.getSemanticDiagnostics([]); goTo.marker("2"); -verify.getSemanticDiagnostics('[\n {\n "message": "Duplicate function implementation.",\n "start": 9,\n "length": 3,\n "category": "error",\n "code": 2393\n }\n]'); +verify.getSemanticDiagnostics([{ + message: "Duplicate function implementation.", + start: 9, + length: 3, + category: "error", + code: 2393 +}]); verify.verifyGetEmitOutputContentsForCurrentFile([ { name: "out.js", text: "function foo() { return 10; }\r\nfunction foo() { return 30; }\r\n", writeByteOrderMark: false }, { name: "out.d.ts", text: "", writeByteOrderMark: false }]); goTo.marker("2"); -verify.getSemanticDiagnostics('[\n {\n "message": "Duplicate function implementation.",\n "start": 9,\n "length": 3,\n "category": "error",\n "code": 2393\n }\n]'); +verify.getSemanticDiagnostics([{ + message: "Duplicate function implementation.", + start: 9, + length: 3, + category: "error", + code: 2393 +}]); goTo.marker("1"); -verify.getSemanticDiagnostics('[]'); \ No newline at end of file +verify.getSemanticDiagnostics([]); diff --git a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts index 0aa88ebd90c..d06395186e4 100644 --- a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts +++ b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts @@ -4,20 +4,20 @@ // @Filename: a.js //// var ===; -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "Variable declaration expected.", - "start": 4, - "length": 3, - "category": "error", - "code": 1134 + message: "Variable declaration expected.", + start: 4, + length: 3, + category: "error", + code: 1134 }, { - "message": "Expression expected.", - "start": 7, - "length": 1, - "category": "error", - "code": 1109 - } -]`); -verify.getSemanticDiagnostics(`[]`); \ No newline at end of file + message: "Expression expected.", + start: 7, + length: 1, + category: "error", + code: 1109 + }, +]); +verify.getSemanticDiagnostics([]); diff --git a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts index a19d170217c..ab12a5c146d 100644 --- a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts +++ b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts @@ -7,41 +7,41 @@ //// function foo(): string { } //// var var = "c"; -verify.getSyntacticDiagnostics(`[ +verify.getSyntacticDiagnostics([ { - "message": "\'types\' can only be used in a .ts file.", - "start": 20, - "length": 7, - "category": "error", - "code": 8010 + message: "'types' can only be used in a .ts file.", + start: 20, + length: 7, + category: "error", + code: 8010 }, { - "message": "\'types\' can only be used in a .ts file.", - "start": 52, - "length": 6, - "category": "error", - "code": 8010 + message: "\'types\' can only be used in a .ts file.", + start: 52, + length: 6, + category: "error", + code: 8010 }, { - "message": "Variable declaration expected.", - "start": 67, - "length": 3, - "category": "error", - "code": 1134 + message: "Variable declaration expected.", + start: 67, + length: 3, + category: "error", + code: 1134 }, { - "message": "Variable declaration expected.", - "start": 71, - "length": 1, - "category": "error", - "code": 1134 + message: "Variable declaration expected.", + start: 71, + length: 1, + category: "error", + code: 1134 }, { - "message": "Variable declaration expected.", - "start": 73, - "length": 3, - "category": "error", - "code": 1134 - } -]`); -verify.getSemanticDiagnostics(`[]`); \ No newline at end of file + message: "Variable declaration expected.", + start: 73, + length: 3, + category: "error", + code: 1134 + }, +]); +verify.getSemanticDiagnostics([]); From 32c63a26284c0fcf6dfbdce709f3da680c2940d9 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 26 Feb 2018 16:10:00 -0800 Subject: [PATCH 233/298] Add support for transpiling per-file jsx pragmas (#21218) * Add support for per-file jsx pragmas * Add error for using jsx factory pragma with fragments * More tests, use different regex class for pragma capture * Unify all pragma parsing machinery --- src/compiler/checker.ts | 30 +- src/compiler/diagnosticMessages.json | 4 + src/compiler/factory.ts | 3 + src/compiler/parser.ts | 317 +++++++++++++----- src/compiler/transformers/jsx.ts | 4 +- src/compiler/types.ts | 130 ++++++- src/compiler/utilities.ts | 34 -- src/services/codefixes/importFixes.ts | 2 +- src/services/preProcess.ts | 39 +-- src/services/services.ts | 3 + .../reference/inlineJsxFactoryDeclarations.js | 74 ++++ .../inlineJsxFactoryDeclarations.symbols | 80 +++++ .../inlineJsxFactoryDeclarations.types | 85 +++++ ...inlineJsxFactoryOverridesCompilerOption.js | 32 ++ ...eJsxFactoryOverridesCompilerOption.symbols | 39 +++ ...ineJsxFactoryOverridesCompilerOption.types | 41 +++ ...neJsxFactoryWithFragmentIsError.errors.txt | 26 ++ .../inlineJsxFactoryWithFragmentIsError.js | 35 ++ ...nlineJsxFactoryWithFragmentIsError.symbols | 39 +++ .../inlineJsxFactoryWithFragmentIsError.types | 43 +++ .../inline/inlineJsxFactoryDeclarations.tsx | 36 ++ ...nlineJsxFactoryOverridesCompilerOption.tsx | 19 ++ .../inlineJsxFactoryWithFragmentIsError.tsx | 19 ++ 23 files changed, 975 insertions(+), 159 deletions(-) create mode 100644 tests/baselines/reference/inlineJsxFactoryDeclarations.js create mode 100644 tests/baselines/reference/inlineJsxFactoryDeclarations.symbols create mode 100644 tests/baselines/reference/inlineJsxFactoryDeclarations.types create mode 100644 tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.js create mode 100644 tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.symbols create mode 100644 tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.types create mode 100644 tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.errors.txt create mode 100644 tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.js create mode 100644 tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.symbols create mode 100644 tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.types create mode 100644 tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarations.tsx create mode 100644 tests/cases/conformance/jsx/inline/inlineJsxFactoryOverridesCompilerOption.tsx create mode 100644 tests/cases/conformance/jsx/inline/inlineJsxFactoryWithFragmentIsError.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 2fcc924a7b8..63b8d18c451 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -299,7 +299,7 @@ namespace ts { resolveName(name, location, meaning, excludeGlobals) { return resolveName(location, escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals); }, - getJsxNamespace: () => unescapeLeadingUnderscores(getJsxNamespace()), + getJsxNamespace: n => unescapeLeadingUnderscores(getJsxNamespace(n)), getAccessibleSymbolChain, getTypePredicateOfSignature, resolveExternalModuleSymbol, @@ -765,7 +765,23 @@ namespace ts { } } - function getJsxNamespace(): __String { + function getJsxNamespace(location: Node | undefined): __String { + if (location) { + const file = getSourceFileOfNode(location); + if (file) { + if (file.localJsxNamespace) { + return file.localJsxNamespace; + } + const jsxPragma = file.pragmas.get("jsx"); + if (jsxPragma) { + const chosenpragma = isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; + file.localJsxFactory = parseIsolatedEntityName(chosenpragma.arguments.factory, languageVersion); + if (file.localJsxFactory) { + return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; + } + } + } + } if (!_jsxNamespace) { _jsxNamespace = "React" as __String; if (compilerOptions.jsxFactory) { @@ -15082,8 +15098,10 @@ namespace ts { function checkJsxFragment(node: JsxFragment, checkMode: CheckMode): Type { checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); - if (compilerOptions.jsx === JsxEmit.React && compilerOptions.jsxFactory) { - error(node, Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); + if (compilerOptions.jsx === JsxEmit.React && (compilerOptions.jsxFactory || getSourceFileOfNode(node).pragmas.has("jsx"))) { + error(node, compilerOptions.jsxFactory + ? Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory + : Diagnostics.JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma); } return getJsxGlobalElementType() || anyType; @@ -15709,7 +15727,7 @@ namespace ts { // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. const reactRefErr = diagnostics && compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined; - const reactNamespace = getJsxNamespace(); + const reactNamespace = getJsxNamespace(node); const reactLocation = isNodeOpeningLikeElement ? (node).tagName : node; const reactSym = resolveName(reactLocation, reactNamespace, SymbolFlags.Value, reactRefErr, reactNamespace, /*isUse*/ true); if (reactSym) { @@ -25556,7 +25574,7 @@ namespace ts { return !!(symbol && getCheckFlags(symbol) & CheckFlags.Late); }, writeLiteralConstValue, - getJsxFactoryEntity: () => _jsxFactoryEntity + getJsxFactoryEntity: location => location ? (getJsxNamespace(location), (getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity }; // defined here to avoid outer scope pollution diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 9801da54a5f..23549f012a0 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3788,6 +3788,10 @@ "category": "Error", "code": 17016 }, + "JSX fragment is not supported when using an inline JSX factory pragma": { + "category": "Error", + "code": 17017 + }, "Circularity detected while resolving configuration: {0}": { "category": "Error", diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 92d353aeb0e..bb00a967336 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2375,6 +2375,9 @@ namespace ts { if (node.resolvedTypeReferenceDirectiveNames !== undefined) updated.resolvedTypeReferenceDirectiveNames = node.resolvedTypeReferenceDirectiveNames; if (node.imports !== undefined) updated.imports = node.imports; if (node.moduleAugmentations !== undefined) updated.moduleAugmentations = node.moduleAugmentations; + if (node.pragmas !== undefined) updated.pragmas = node.pragmas; + if (node.localJsxFactory !== undefined) updated.localJsxFactory = node.localJsxFactory; + if (node.localJsxNamespace !== undefined) updated.localJsxNamespace = node.localJsxNamespace; return updateNode(updated, node); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 70ddb7b791d..b350af01bb0 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -769,7 +769,9 @@ namespace ts { // Prime the scanner. nextToken(); - processReferenceComments(sourceFile); + // A member of ReadonlyArray isn't assignable to a member of T[] (and prevents a direct cast) - but this is where we set up those members so they can be readonly in the future + processCommentPragmas(sourceFile as {} as PragmaContext, sourceText); + processPragmasIntoFields(sourceFile as {} as PragmaContext, reportPragmaDiagnostic); sourceFile.statements = parseList(ParsingContext.SourceElements, parseStatement); Debug.assert(token() === SyntaxKind.EndOfFileToken); @@ -787,6 +789,10 @@ namespace ts { } return sourceFile; + + function reportPragmaDiagnostic(pos: number, end: number, diagnostic: DiagnosticMessage) { + parseDiagnostics.push(createFileDiagnostic(sourceFile, pos, end, diagnostic)); + } } function addJSDocComment(node: T): T { @@ -6084,94 +6090,6 @@ namespace ts { return finishNode(node); } - function processReferenceComments(sourceFile: SourceFile): void { - const triviaScanner = createScanner(sourceFile.languageVersion, /*skipTrivia*/ false, LanguageVariant.Standard, sourceText); - const referencedFiles: FileReference[] = []; - const typeReferenceDirectives: FileReference[] = []; - const amdDependencies: { path: string; name: string }[] = []; - let amdModuleName: string; - let checkJsDirective: CheckJsDirective = undefined; - - // Keep scanning all the leading trivia in the file until we get to something that - // isn't trivia. Any single line comment will be analyzed to see if it is a - // reference comment. - while (true) { - const kind = triviaScanner.scan(); - if (kind !== SyntaxKind.SingleLineCommentTrivia) { - if (isTrivia(kind)) { - continue; - } - else { - break; - } - } - - const range = { - kind: triviaScanner.getToken(), - pos: triviaScanner.getTokenPos(), - end: triviaScanner.getTextPos(), - }; - - const comment = sourceText.substring(range.pos, range.end); - const referencePathMatchResult = getFileReferenceFromReferencePath(comment, range); - if (referencePathMatchResult) { - const fileReference = referencePathMatchResult.fileReference; - sourceFile.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - const diagnosticMessage = referencePathMatchResult.diagnosticMessage; - if (fileReference) { - if (referencePathMatchResult.isTypeReferenceDirective) { - typeReferenceDirectives.push(fileReference); - } - else { - referencedFiles.push(fileReference); - } - } - if (diagnosticMessage) { - parseDiagnostics.push(createFileDiagnostic(sourceFile, range.pos, range.end - range.pos, diagnosticMessage)); - } - } - else { - const amdModuleNameRegEx = /^\/\/\/\s* hasModifier(node, ModifierFlags.Export) @@ -7552,4 +7470,225 @@ namespace ts { function isDeclarationFileName(fileName: string): boolean { return fileExtensionIs(fileName, Extension.Dts); } + + /*@internal*/ + export interface PragmaContext { + languageVersion: ScriptTarget; + pragmas?: PragmaMap; + checkJsDirective?: CheckJsDirective; + referencedFiles: FileReference[]; + typeReferenceDirectives: FileReference[]; + amdDependencies: AmdDependency[]; + hasNoDefaultLib?: boolean; + moduleName?: string; + } + + /*@internal*/ + export function processCommentPragmas(context: PragmaContext, sourceText: string): void { + const triviaScanner = createScanner(context.languageVersion, /*skipTrivia*/ false, LanguageVariant.Standard, sourceText); + const pragmas: PragmaPsuedoMapEntry[] = []; + + // Keep scanning all the leading trivia in the file until we get to something that + // isn't trivia. Any single line comment will be analyzed to see if it is a + // reference comment. + while (true) { + const kind = triviaScanner.scan(); + if (!isTrivia(kind)) { + break; + } + + const range = { + kind: triviaScanner.getToken(), + pos: triviaScanner.getTokenPos(), + end: triviaScanner.getTextPos(), + }; + + const comment = sourceText.substring(range.pos, range.end); + extractPragmas(pragmas, range, comment); + } + + context.pragmas = createMap() as PragmaMap; + for (const pragma of pragmas) { + if (context.pragmas.has(pragma.name)) { + const currentValue = context.pragmas.get(pragma.name); + if (currentValue instanceof Array) { + currentValue.push(pragma.args); + } + else { + context.pragmas.set(pragma.name, [currentValue, pragma.args]); + } + continue; + } + context.pragmas.set(pragma.name, pragma.args); + } + } + + /*@internal*/ + type PragmaDiagnosticReporter = (pos: number, length: number, message: DiagnosticMessage) => void; + + /*@internal*/ + export function processPragmasIntoFields(context: PragmaContext, reportDiagnostic: PragmaDiagnosticReporter): void { + context.checkJsDirective = undefined; + context.referencedFiles = []; + context.typeReferenceDirectives = []; + context.amdDependencies = []; + context.hasNoDefaultLib = false; + context.pragmas.forEach((entryOrList, key) => { + // TODO: The below should be strongly type-guarded and not need casts/explicit annotations, since entryOrList is related to + // key and key is constrained to a union; but it's not (see GH#21483 for at least partial fix) :( + switch (key) { + case "reference": { + const referencedFiles = context.referencedFiles; + const typeReferenceDirectives = context.typeReferenceDirectives; + forEach(toArray(entryOrList), (arg: PragmaPsuedoMap["reference"]) => { + if (arg.arguments["no-default-lib"]) { + context.hasNoDefaultLib = true; + } + else if (arg.arguments.types) { + typeReferenceDirectives.push({ pos: arg.arguments.types.pos, end: arg.arguments.types.end, fileName: arg.arguments.types.value }); + } + else if (arg.arguments.path) { + referencedFiles.push({ pos: arg.arguments.path.pos, end: arg.arguments.path.end, fileName: arg.arguments.path.value }); + } + else { + reportDiagnostic(arg.range.pos, arg.range.end - arg.range.pos, Diagnostics.Invalid_reference_directive_syntax); + } + }); + break; + } + case "amd-dependency": { + context.amdDependencies = map( + toArray(entryOrList), + ({ arguments: { name, path } }: PragmaPsuedoMap["amd-dependency"]) => ({ name, path }) + ); + break; + } + case "amd-module": { + if (entryOrList instanceof Array) { + for (const entry of entryOrList) { + if (context.moduleName) { + // TODO: It's probably fine to issue this diagnostic on all instances of the pragma + reportDiagnostic(entry.range.pos, entry.range.end - entry.range.pos, Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments); + } + context.moduleName = (entry as PragmaPsuedoMap["amd-module"]).arguments.name; + } + } + else { + context.moduleName = (entryOrList as PragmaPsuedoMap["amd-module"]).arguments.name; + } + break; + } + case "ts-nocheck": + case "ts-check": { + // _last_ of either nocheck or check in a file is the "winner" + forEach(toArray(entryOrList), entry => { + if (!context.checkJsDirective || entry.range.pos > context.checkJsDirective.pos) { + context.checkJsDirective = { + enabled: key === "ts-check", + end: entry.range.end, + pos: entry.range.pos + }; + } + }); + break; + } + case "jsx": return; // Accessed directly + default: Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? + } + }); + } + + const namedArgRegExCache = createMap(); + function getNamedArgRegEx(name: string) { + if (namedArgRegExCache.has(name)) { + return namedArgRegExCache.get(name); + } + const result = new RegExp(`(\\s${name}\\s*=\\s*)('|")(.+?)\\2`, "im"); + namedArgRegExCache.set(name, result); + return result; + } + + const tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; + const singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im; + function extractPragmas(pragmas: PragmaPsuedoMapEntry[], range: CommentRange, text: string) { + const tripleSlash = tripleSlashXMLCommentStartRegEx.exec(text); + if (tripleSlash) { + const name = tripleSlash[1].toLowerCase() as keyof PragmaPsuedoMap; // Technically unsafe cast, but we do it so the below check to make it safe typechecks + const pragma = commentPragmas[name] as PragmaDefinition; + if (!pragma || !(pragma.kind & PragmaKindFlags.TripleSlashXML)) { + return; + } + if (pragma.args) { + const argument: {[index: string]: string | {value: string, pos: number, end: number}} = {}; + for (const arg of pragma.args) { + const matcher = getNamedArgRegEx(arg.name); + const matchResult = matcher.exec(text); + if (!matchResult && !arg.optional) { + return; // Missing required argument, don't parse + } + else if (matchResult) { + if (arg.captureSpan) { + const startPos = range.pos + matchResult.index + matchResult[1].length + matchResult[2].length; + argument[arg.name] = { + value: matchResult[3], + pos: startPos, + end: startPos + matchResult[3].length + }; + } + else { + argument[arg.name] = matchResult[3]; + } + } + } + pragmas.push({ name, args: { arguments: argument, range } } as PragmaPsuedoMapEntry); + } + else { + pragmas.push({ name, args: { arguments: {}, range } } as PragmaPsuedoMapEntry); + } + return; + } + + const singleLine = singleLinePragmaRegEx.exec(text); + if (singleLine) { + return addPragmaForMatch(pragmas, range, PragmaKindFlags.SingleLine, singleLine); + } + + const multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating) + let multiLineMatch: RegExpExecArray; + while (multiLineMatch = multiLinePragmaRegEx.exec(text)) { + addPragmaForMatch(pragmas, range, PragmaKindFlags.MultiLine, multiLineMatch); + } + } + + function addPragmaForMatch(pragmas: PragmaPsuedoMapEntry[], range: CommentRange, kind: PragmaKindFlags, match: RegExpExecArray) { + if (!match) return; + const name = match[1].toLowerCase() as keyof PragmaPsuedoMap; // Technically unsafe cast, but we do it so they below check to make it safe typechecks + const pragma = commentPragmas[name] as PragmaDefinition; + if (!pragma || !(pragma.kind & kind)) { + return; + } + const args = match[2]; // Split on spaces and match up positionally with definition + const argument = getNamedPragmaArguments(pragma, args); + if (argument === "fail") return; // Missing required argument, fail to parse it + pragmas.push({ name, args: { arguments: argument, range } } as PragmaPsuedoMapEntry); + return; + } + + function getNamedPragmaArguments(pragma: PragmaDefinition, text: string | undefined): {[index: string]: string} | "fail" { + if (!text) return {}; + if (!pragma.args) return {}; + const args = text.split(/\s+/); + const argMap: {[index: string]: string} = {}; + for (let i = 0; i < pragma.args.length; i++) { + const argument = pragma.args[i]; + if (!args[i] && !argument.optional) { + return "fail"; + } + if (argument.captureSpan) { + return Debug.fail("Capture spans not yet implemented for non-xml pragmas"); + } + argMap[argument.name] = args[i]; + } + return argMap; + } } diff --git a/src/compiler/transformers/jsx.ts b/src/compiler/transformers/jsx.ts index 94e41af9c28..25e1ae02ef8 100644 --- a/src/compiler/transformers/jsx.ts +++ b/src/compiler/transformers/jsx.ts @@ -122,7 +122,7 @@ namespace ts { } const element = createExpressionForJsxElement( - context.getEmitResolver().getJsxFactoryEntity(), + context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, tagName, objectProperties, @@ -140,7 +140,7 @@ namespace ts { function visitJsxOpeningFragment(node: JsxOpeningFragment, children: ReadonlyArray, isChild: boolean, location: TextRange) { const element = createExpressionForJsxFragment( - context.getEmitResolver().getJsxFactoryEntity(), + context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, mapDefined(children, transformJsxChildToExpression), node, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6b325bf6abe..6631c66f0eb 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2568,6 +2568,9 @@ namespace ts { /* @internal */ ambientModuleNames: ReadonlyArray; /* @internal */ checkJsDirective: CheckJsDirective | undefined; /* @internal */ version: string; + /* @internal */ pragmas: PragmaMap; + /* @internal */ localJsxNamespace?: __String; + /* @internal */ localJsxFactory?: EntityName; } export interface Bundle extends Node { @@ -2934,7 +2937,7 @@ namespace ts { /* @internal */ isArrayLikeType(type: Type): boolean; /* @internal */ getAllPossiblePropertiesOfTypes(type: ReadonlyArray): Symbol[]; /* @internal */ resolveName(name: string, location: Node, meaning: SymbolFlags, excludeGlobals: boolean): Symbol | undefined; - /* @internal */ getJsxNamespace(): string; + /* @internal */ getJsxNamespace(location?: Node): string; /** * Note that this will return undefined in the following case: @@ -3208,7 +3211,7 @@ namespace ts { getTypeReferenceDirectivesForSymbol(symbol: Symbol, meaning?: SymbolFlags): string[]; isLiteralConstDeclaration(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration): boolean; writeLiteralConstValue(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration, writer: EmitTextWriter): void; - getJsxFactoryEntity(): EntityName; + getJsxFactoryEntity(location?: Node): EntityName; } export const enum SymbolFlags { @@ -5127,4 +5130,127 @@ namespace ts { Parameters = CommaDelimited | SpaceBetweenSiblings | SingleLine | Parenthesis, IndexSignatureParameters = CommaDelimited | SpaceBetweenSiblings | SingleLine | Indented | SquareBrackets, } + + /* @internal */ + export const enum PragmaKindFlags { + None = 0, + /** + * Triple slash comment of the form + * /// + */ + TripleSlashXML = 1 << 0, + /** + * Single line comment of the form + * // @pragma-name argval1 argval2 + * or + * /// @pragma-name argval1 argval2 + */ + SingleLine = 1 << 1, + /** + * Multiline non-jsdoc pragma of the form + * /* @pragma-name argval1 argval2 * / + */ + MultiLine = 1 << 2, + All = TripleSlashXML | SingleLine | MultiLine, + Default = All, + } + + /* @internal */ + interface PragmaArgumentSpecification { + name: TName; // Determines the name of the key in the resulting parsed type, type parameter to cause literal type inference + optional?: boolean; + captureSpan?: boolean; + } + + /* @internal */ + export interface PragmaDefinition { + args?: [PragmaArgumentSpecification] | [PragmaArgumentSpecification, PragmaArgumentSpecification] | [PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification]; + // If not present, defaults to PragmaKindFlags.Default + kind?: PragmaKindFlags; + } + + /** + * This function only exists to cause exact types to be inferred for all the literals within `commentPragmas` + */ + /* @internal */ + function _contextuallyTypePragmas}, K1 extends string, K2 extends string, K3 extends string>(args: T): T { + return args; + } + + // While not strictly a type, this is here because `PragmaMap` needs to be here to be used with `SourceFile`, and we don't + // fancy effectively defining it twice, once in value-space and once in type-space + /* @internal */ + export const commentPragmas = _contextuallyTypePragmas({ + "reference": { + args: [ + { name: "types", optional: true, captureSpan: true }, + { name: "path", optional: true, captureSpan: true }, + { name: "no-default-lib", optional: true } + ], + kind: PragmaKindFlags.TripleSlashXML + }, + "amd-dependency": { + args: [{ name: "path" }, { name: "name", optional: true }], + kind: PragmaKindFlags.TripleSlashXML + }, + "amd-module": { + args: [{ name: "name" }], + kind: PragmaKindFlags.TripleSlashXML + }, + "ts-check": { + kind: PragmaKindFlags.SingleLine + }, + "ts-nocheck": { + kind: PragmaKindFlags.SingleLine + }, + "jsx": { + args: [{ name: "factory" }], + kind: PragmaKindFlags.MultiLine + }, + }); + + /* @internal */ + type PragmaArgTypeMaybeCapture = TDesc extends {captureSpan: true} ? {value: string, pos: number, end: number} : string; + + /* @internal */ + type PragmaArgTypeOptional = + TDesc extends {optional: true} + ? {[K in TName]?: PragmaArgTypeMaybeCapture} + : {[K in TName]: PragmaArgTypeMaybeCapture}; + + /** + * Maps a pragma definition into the desired shape for its arguments object + * Maybe the below is a good argument for types being iterable on struture in some way. + */ + /* @internal */ + type PragmaArgumentType = + T extends { args: [PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification] } + ? PragmaArgTypeOptional & PragmaArgTypeOptional & PragmaArgTypeOptional + : T extends { args: [PragmaArgumentSpecification, PragmaArgumentSpecification] } + ? PragmaArgTypeOptional & PragmaArgTypeOptional + : T extends { args: [PragmaArgumentSpecification] } + ? PragmaArgTypeOptional + : object; + // The above fallback to `object` when there's no args to allow `{}` (as intended), but not the number 2, for example + // TODO: Swap to `undefined` for a cleaner API once strictNullChecks is enabled + + type ConcretePragmaSpecs = typeof commentPragmas; + + /* @internal */ + export type PragmaPsuedoMap = {[K in keyof ConcretePragmaSpecs]?: {arguments: PragmaArgumentType, range: CommentRange}}; + + /* @internal */ + export type PragmaPsuedoMapEntry = {[K in keyof PragmaPsuedoMap]: {name: K, args: PragmaPsuedoMap[K]}}[keyof PragmaPsuedoMap]; + + /** + * A strongly-typed es6 map of pragma entries, the values of which are either a single argument + * value (if only one was found), or an array of multiple argument values if the pragma is present + * in multiple places + */ + /* @internal */ + export interface PragmaMap extends Map { + set(key: TKey, value: PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][]): this; + get(key: TKey): PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][]; + forEach(action: (value: PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][], key: TKey) => void): void; + } } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index af0dc443e92..63c8d6989f4 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1989,40 +1989,6 @@ namespace ts { return undefined; } - export function getFileReferenceFromReferencePath(comment: string, commentRange: CommentRange): ReferencePathMatchResult { - const simpleReferenceRegEx = /^\/\/\/\s*parent).tagName === token) || parent.kind === SyntaxKind.JsxOpeningFragment) { - umdSymbol = checker.resolveName(checker.getJsxNamespace(), + umdSymbol = checker.resolveName(checker.getJsxNamespace(parent), isNodeOpeningLikeElement ? (parent).tagName : parent, SymbolFlags.Value, /*excludeGlobals*/ false); } } diff --git a/src/services/preProcess.ts b/src/services/preProcess.ts index a99683d45ef..fb138a87866 100644 --- a/src/services/preProcess.ts +++ b/src/services/preProcess.ts @@ -1,10 +1,17 @@ namespace ts { export function preProcessFile(sourceText: string, readImportFiles = true, detectJavaScriptImports = false): PreProcessedFileInfo { - const referencedFiles: FileReference[] = []; - const typeReferenceDirectives: FileReference[] = []; + const pragmaContext: PragmaContext = { + languageVersion: ScriptTarget.ES5, // controls weather the token scanner considers unicode identifiers or not - shouldn't matter, since we're only using it for trivia + pragmas: undefined, + checkJsDirective: undefined, + referencedFiles: [], + typeReferenceDirectives: [], + amdDependencies: [], + hasNoDefaultLib: undefined, + moduleName: undefined + }; const importedFiles: FileReference[] = []; let ambientExternalModules: { ref: FileReference, depth: number }[]; - let isNoDefaultLib = false; let braceNesting = 0; // assume that text represent an external module if it contains at least one top level import/export // ambient modules that are found inside external modules are interpreted as module augmentations @@ -21,25 +28,6 @@ namespace ts { return token; } - function processTripleSlashDirectives(): void { - const commentRanges = getLeadingCommentRanges(sourceText, 0); - forEach(commentRanges, commentRange => { - const comment = sourceText.substring(commentRange.pos, commentRange.end); - const referencePathMatchResult = getFileReferenceFromReferencePath(comment, commentRange); - if (referencePathMatchResult) { - isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - const fileReference = referencePathMatchResult.fileReference; - if (fileReference) { - const collection = referencePathMatchResult.isTypeReferenceDirective - ? typeReferenceDirectives - : referencedFiles; - - collection.push(fileReference); - } - } - }); - } - function getFileReference() { const fileName = scanner.getTokenValue(); const pos = scanner.getTokenPos(); @@ -328,7 +316,8 @@ namespace ts { if (readImportFiles) { processImports(); } - processTripleSlashDirectives(); + processCommentPragmas(pragmaContext, sourceText); + processPragmasIntoFields(pragmaContext, noop); if (externalModule) { // for external modules module all nested ambient modules are augmentations if (ambientExternalModules) { @@ -337,7 +326,7 @@ namespace ts { importedFiles.push(decl.ref); } } - return { referencedFiles, typeReferenceDirectives, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: undefined }; + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: undefined }; } else { // for global scripts ambient modules still can have augmentations - look for ambient modules with depth > 0 @@ -355,7 +344,7 @@ namespace ts { } } } - return { referencedFiles, typeReferenceDirectives, importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientModuleNames }; + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames }; } } } diff --git a/src/services/services.ts b/src/services/services.ts index 624ca8c42bb..a4da9b12ead 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -651,6 +651,9 @@ namespace ts { public ambientModuleNames: string[]; public checkJsDirective: CheckJsDirective | undefined; public possiblyContainDynamicImport: boolean; + public pragmas: PragmaMap; + public localJsxFactory: EntityName; + public localJsxNamespace: __String; constructor(kind: SyntaxKind, pos: number, end: number) { super(kind, pos, end); diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarations.js b/tests/baselines/reference/inlineJsxFactoryDeclarations.js new file mode 100644 index 00000000000..958c43af83f --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryDeclarations.js @@ -0,0 +1,74 @@ +//// [tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarations.tsx] //// + +//// [renderer.d.ts] +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: any; + } + } +} +export function dom(): void; +export function otherdom(): void; +export function createElement(): void; +export { dom as default }; +//// [otherreacty.tsx] +/** @jsx React.createElement */ +import * as React from "./renderer"; + +//// [other.tsx] +/** @jsx h */ +import { dom as h } from "./renderer" +export const prerendered = ; +//// [othernoalias.tsx] +/** @jsx otherdom */ +import { otherdom } from "./renderer" +export const prerendered2 = ; +//// [reacty.tsx] +import React from "./renderer" +export const prerendered3 = ; + +//// [index.tsx] +/** @jsx dom */ +import { dom } from "./renderer" + +export * from "./other"; +export * from "./othernoalias"; +export * from "./reacty"; + + +//// [otherreacty.js] +"use strict"; +exports.__esModule = true; +/** @jsx React.createElement */ +var React = require("./renderer"); +React.createElement("h", null); +//// [other.js] +"use strict"; +exports.__esModule = true; +/** @jsx h */ +var renderer_1 = require("./renderer"); +exports.prerendered = renderer_1.dom("h", null); +//// [othernoalias.js] +"use strict"; +exports.__esModule = true; +/** @jsx otherdom */ +var renderer_1 = require("./renderer"); +exports.prerendered2 = renderer_1.otherdom("h", null); +//// [reacty.js] +"use strict"; +exports.__esModule = true; +var renderer_1 = require("./renderer"); +exports.prerendered3 = renderer_1["default"].createElement("h", null); +//// [index.js] +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +exports.__esModule = true; +/** @jsx dom */ +var renderer_1 = require("./renderer"); +renderer_1.dom("h", null); +__export(require("./other")); +__export(require("./othernoalias")); +__export(require("./reacty")); diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarations.symbols b/tests/baselines/reference/inlineJsxFactoryDeclarations.symbols new file mode 100644 index 00000000000..43a53ec9df2 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryDeclarations.symbols @@ -0,0 +1,80 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : Symbol(global, Decl(renderer.d.ts, 0, 0)) + + namespace JSX { +>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 16)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + + [e: string]: any; +>e : Symbol(e, Decl(renderer.d.ts, 3, 13)) + } + } +} +export function dom(): void; +>dom : Symbol(dom, Decl(renderer.d.ts, 6, 1)) + +export function otherdom(): void; +>otherdom : Symbol(otherdom, Decl(renderer.d.ts, 7, 28)) + +export function createElement(): void; +>createElement : Symbol(createElement, Decl(renderer.d.ts, 8, 33)) + +export { dom as default }; +>dom : Symbol(default, Decl(renderer.d.ts, 10, 8)) +>default : Symbol(default, Decl(renderer.d.ts, 10, 8)) + +=== tests/cases/conformance/jsx/inline/otherreacty.tsx === +/** @jsx React.createElement */ +import * as React from "./renderer"; +>React : Symbol(React, Decl(otherreacty.tsx, 1, 6)) + + +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/other.tsx === +/** @jsx h */ +import { dom as h } from "./renderer" +>dom : Symbol(h, Decl(other.tsx, 1, 8)) +>h : Symbol(h, Decl(other.tsx, 1, 8)) + +export const prerendered = ; +>prerendered : Symbol(prerendered, Decl(other.tsx, 2, 12)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/othernoalias.tsx === +/** @jsx otherdom */ +import { otherdom } from "./renderer" +>otherdom : Symbol(otherdom, Decl(othernoalias.tsx, 1, 8)) + +export const prerendered2 = ; +>prerendered2 : Symbol(prerendered2, Decl(othernoalias.tsx, 2, 12)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/reacty.tsx === +import React from "./renderer" +>React : Symbol(React, Decl(reacty.tsx, 0, 6)) + +export const prerendered3 = ; +>prerendered3 : Symbol(prerendered3, Decl(reacty.tsx, 1, 12)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer" +>dom : Symbol(dom, Decl(index.tsx, 1, 8)) + + +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +export * from "./other"; +export * from "./othernoalias"; +export * from "./reacty"; + diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarations.types b/tests/baselines/reference/inlineJsxFactoryDeclarations.types new file mode 100644 index 00000000000..13c382fe45c --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryDeclarations.types @@ -0,0 +1,85 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : any + + namespace JSX { +>JSX : any + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [e: string]: any; +>e : string + } + } +} +export function dom(): void; +>dom : () => void + +export function otherdom(): void; +>otherdom : () => void + +export function createElement(): void; +>createElement : () => void + +export { dom as default }; +>dom : () => void +>default : () => void + +=== tests/cases/conformance/jsx/inline/otherreacty.tsx === +/** @jsx React.createElement */ +import * as React from "./renderer"; +>React : typeof React + + +> : any +>h : any +>h : any + +=== tests/cases/conformance/jsx/inline/other.tsx === +/** @jsx h */ +import { dom as h } from "./renderer" +>dom : () => void +>h : () => void + +export const prerendered = ; +>prerendered : any +> : any +>h : () => void +>h : () => void + +=== tests/cases/conformance/jsx/inline/othernoalias.tsx === +/** @jsx otherdom */ +import { otherdom } from "./renderer" +>otherdom : () => void + +export const prerendered2 = ; +>prerendered2 : any +> : any +>h : any +>h : any + +=== tests/cases/conformance/jsx/inline/reacty.tsx === +import React from "./renderer" +>React : () => void + +export const prerendered3 = ; +>prerendered3 : any +> : any +>h : any +>h : any + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer" +>dom : () => void + + +> : any +>h : any +>h : any + +export * from "./other"; +export * from "./othernoalias"; +export * from "./reacty"; + diff --git a/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.js b/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.js new file mode 100644 index 00000000000..fef2e38ee3b --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.js @@ -0,0 +1,32 @@ +//// [tests/cases/conformance/jsx/inline/inlineJsxFactoryOverridesCompilerOption.tsx] //// + +//// [renderer.d.ts] +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: any; + } + } +} +export function dom(): void; +export { dom as p }; +//// [reacty.tsx] +/** @jsx dom */ +import {dom} from "./renderer"; + +//// [index.tsx] +import { p } from "./renderer"; + + + +//// [reacty.js] +"use strict"; +exports.__esModule = true; +/** @jsx dom */ +var renderer_1 = require("./renderer"); +renderer_1.dom("h", null); +//// [index.js] +"use strict"; +exports.__esModule = true; +var renderer_1 = require("./renderer"); +renderer_1.p("h", null); diff --git a/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.symbols b/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.symbols new file mode 100644 index 00000000000..d3c513c5876 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : Symbol(global, Decl(renderer.d.ts, 0, 0)) + + namespace JSX { +>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 16)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + + [e: string]: any; +>e : Symbol(e, Decl(renderer.d.ts, 3, 13)) + } + } +} +export function dom(): void; +>dom : Symbol(dom, Decl(renderer.d.ts, 6, 1)) + +export { dom as p }; +>dom : Symbol(p, Decl(renderer.d.ts, 8, 8)) +>p : Symbol(p, Decl(renderer.d.ts, 8, 8)) + +=== tests/cases/conformance/jsx/inline/reacty.tsx === +/** @jsx dom */ +import {dom} from "./renderer"; +>dom : Symbol(dom, Decl(reacty.tsx, 1, 8)) + + +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/index.tsx === +import { p } from "./renderer"; +>p : Symbol(p, Decl(index.tsx, 0, 8)) + + +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + diff --git a/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.types b/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.types new file mode 100644 index 00000000000..36b50405dcb --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryOverridesCompilerOption.types @@ -0,0 +1,41 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : any + + namespace JSX { +>JSX : any + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [e: string]: any; +>e : string + } + } +} +export function dom(): void; +>dom : () => void + +export { dom as p }; +>dom : () => void +>p : () => void + +=== tests/cases/conformance/jsx/inline/reacty.tsx === +/** @jsx dom */ +import {dom} from "./renderer"; +>dom : () => void + + +> : any +>h : any +>h : any + +=== tests/cases/conformance/jsx/inline/index.tsx === +import { p } from "./renderer"; +>p : () => void + + +> : any +>h : any +>h : any + diff --git a/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.errors.txt b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.errors.txt new file mode 100644 index 00000000000..b70ddf5f9b9 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.errors.txt @@ -0,0 +1,26 @@ +tests/cases/conformance/jsx/inline/index.tsx(3,1): error TS17017: JSX fragment is not supported when using an inline JSX factory pragma +tests/cases/conformance/jsx/inline/reacty.tsx(3,1): error TS17017: JSX fragment is not supported when using an inline JSX factory pragma + + +==== tests/cases/conformance/jsx/inline/renderer.d.ts (0 errors) ==== + declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: any; + } + } + } + export function dom(): void; + export function createElement(): void; +==== tests/cases/conformance/jsx/inline/reacty.tsx (1 errors) ==== + /** @jsx React.createElement */ + import * as React from "./renderer"; + <> + ~~~~~~~~~~~~ +!!! error TS17017: JSX fragment is not supported when using an inline JSX factory pragma +==== tests/cases/conformance/jsx/inline/index.tsx (1 errors) ==== + /** @jsx dom */ + import { dom } from "./renderer"; + <> + ~~~~~~~~~~~~ +!!! error TS17017: JSX fragment is not supported when using an inline JSX factory pragma \ No newline at end of file diff --git a/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.js b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.js new file mode 100644 index 00000000000..3af54bc04e6 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.js @@ -0,0 +1,35 @@ +//// [tests/cases/conformance/jsx/inline/inlineJsxFactoryWithFragmentIsError.tsx] //// + +//// [renderer.d.ts] +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: any; + } + } +} +export function dom(): void; +export function createElement(): void; +//// [reacty.tsx] +/** @jsx React.createElement */ +import * as React from "./renderer"; +<> +//// [index.tsx] +/** @jsx dom */ +import { dom } from "./renderer"; +<> + +//// [reacty.js] +"use strict"; +exports.__esModule = true; +/** @jsx React.createElement */ +var React = require("./renderer"); +React.createElement(React.Fragment, null, + React.createElement("h", null)); +//// [index.js] +"use strict"; +exports.__esModule = true; +/** @jsx dom */ +var renderer_1 = require("./renderer"); +renderer_1.dom(React.Fragment, null, + renderer_1.dom("h", null)); diff --git a/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.symbols b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.symbols new file mode 100644 index 00000000000..0453bd26105 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.symbols @@ -0,0 +1,39 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : Symbol(global, Decl(renderer.d.ts, 0, 0)) + + namespace JSX { +>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 16)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + + [e: string]: any; +>e : Symbol(e, Decl(renderer.d.ts, 3, 13)) + } + } +} +export function dom(): void; +>dom : Symbol(dom, Decl(renderer.d.ts, 6, 1)) + +export function createElement(): void; +>createElement : Symbol(createElement, Decl(renderer.d.ts, 7, 28)) + +=== tests/cases/conformance/jsx/inline/reacty.tsx === +/** @jsx React.createElement */ +import * as React from "./renderer"; +>React : Symbol(React, Decl(reacty.tsx, 1, 6)) + +<> +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer"; +>dom : Symbol(dom, Decl(index.tsx, 1, 8)) + +<> +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + diff --git a/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.types b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.types new file mode 100644 index 00000000000..e7cd48810b0 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.types @@ -0,0 +1,43 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : any + + namespace JSX { +>JSX : any + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [e: string]: any; +>e : string + } + } +} +export function dom(): void; +>dom : () => void + +export function createElement(): void; +>createElement : () => void + +=== tests/cases/conformance/jsx/inline/reacty.tsx === +/** @jsx React.createElement */ +import * as React from "./renderer"; +>React : typeof React + +<> +><> : any +> : any +>h : any +>h : any + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer"; +>dom : () => void + +<> +><> : any +> : any +>h : any +>h : any + diff --git a/tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarations.tsx b/tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarations.tsx new file mode 100644 index 00000000000..f574c7e9db9 --- /dev/null +++ b/tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarations.tsx @@ -0,0 +1,36 @@ +// @jsx: react +// @filename: renderer.d.ts +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: any; + } + } +} +export function dom(): void; +export function otherdom(): void; +export function createElement(): void; +export { dom as default }; +// @filename: otherreacty.tsx +/** @jsx React.createElement */ +import * as React from "./renderer"; + +// @filename: other.tsx +/** @jsx h */ +import { dom as h } from "./renderer" +export const prerendered = ; +// @filename: othernoalias.tsx +/** @jsx otherdom */ +import { otherdom } from "./renderer" +export const prerendered2 = ; +// @filename: reacty.tsx +import React from "./renderer" +export const prerendered3 = ; + +// @filename: index.tsx +/** @jsx dom */ +import { dom } from "./renderer" + +export * from "./other"; +export * from "./othernoalias"; +export * from "./reacty"; diff --git a/tests/cases/conformance/jsx/inline/inlineJsxFactoryOverridesCompilerOption.tsx b/tests/cases/conformance/jsx/inline/inlineJsxFactoryOverridesCompilerOption.tsx new file mode 100644 index 00000000000..4efd32876ad --- /dev/null +++ b/tests/cases/conformance/jsx/inline/inlineJsxFactoryOverridesCompilerOption.tsx @@ -0,0 +1,19 @@ +// @jsx: react +// @jsxFactory: p +// @filename: renderer.d.ts +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: any; + } + } +} +export function dom(): void; +export { dom as p }; +// @filename: reacty.tsx +/** @jsx dom */ +import {dom} from "./renderer"; + +// @filename: index.tsx +import { p } from "./renderer"; + diff --git a/tests/cases/conformance/jsx/inline/inlineJsxFactoryWithFragmentIsError.tsx b/tests/cases/conformance/jsx/inline/inlineJsxFactoryWithFragmentIsError.tsx new file mode 100644 index 00000000000..280ac26b5ce --- /dev/null +++ b/tests/cases/conformance/jsx/inline/inlineJsxFactoryWithFragmentIsError.tsx @@ -0,0 +1,19 @@ +// @jsx: react +// @filename: renderer.d.ts +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: any; + } + } +} +export function dom(): void; +export function createElement(): void; +// @filename: reacty.tsx +/** @jsx React.createElement */ +import * as React from "./renderer"; +<> +// @filename: index.tsx +/** @jsx dom */ +import { dom } from "./renderer"; +<> \ No newline at end of file From f4af74aae182629c6615c39325b92915e7f9ac79 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 27 Feb 2018 12:26:05 -0800 Subject: [PATCH 234/298] Simplify TextChanges#getChanges (#22157) * Simplify TextChanges#getChanges * Rename function and improve assert --- src/compiler/types.ts | 2 +- src/harness/unittests/textChanges.ts | 13 +- src/services/textChanges.ts | 125 +++++++----------- .../organizeImports/CoalesceTrivia.ts | 1 - .../reference/organizeImports/SortTrivia.ts | 1 - .../organizeImports/UnusedTrivia2.ts | 1 - 6 files changed, 56 insertions(+), 87 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6631c66f0eb..6c0eaf586d1 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2473,7 +2473,7 @@ namespace ts { */ export interface SourceFileLike { readonly text: string; - lineMap: ReadonlyArray; + lineMap?: ReadonlyArray; } diff --git a/src/harness/unittests/textChanges.ts b/src/harness/unittests/textChanges.ts index e3f67b8c513..df940fa8b74 100644 --- a/src/harness/unittests/textChanges.ts +++ b/src/harness/unittests/textChanges.ts @@ -28,17 +28,14 @@ namespace ts { } // validate that positions that were recovered from the printed text actually match positions that will be created if the same text is parsed. - function verifyPositions({ text, node }: textChanges.NonFormattedText): void { + function verifyPositions(node: Node, text: string): void { const nodeList = flattenNodes(node); const sourceFile = createSourceFile("f.ts", text, ScriptTarget.ES2015); const parsedNodeList = flattenNodes(sourceFile.statements[0]); - Debug.assert(nodeList.length === parsedNodeList.length); - for (let i = 0; i < nodeList.length; i++) { - const left = nodeList[i]; - const right = parsedNodeList[i]; + zipWith(nodeList, parsedNodeList, (left, right) => { Debug.assert(left.pos === right.pos); Debug.assert(left.end === right.end); - } + }); function flattenNodes(n: Node) { const data: (Node | NodeArray)[] = []; @@ -57,9 +54,9 @@ namespace ts { Harness.Baseline.runBaseline(`textChanges/${caption}.js`, () => { const sourceFile = createSourceFile("source.ts", text, ScriptTarget.ES2015, /*setParentNodes*/ true); const rulesProvider = getRuleProvider(placeOpenBraceOnNewLineForFunctions); - const changeTracker = new textChanges.ChangeTracker(newLineCharacter, rulesProvider, validateNodes ? verifyPositions : undefined); + const changeTracker = new textChanges.ChangeTracker(newLineCharacter, rulesProvider); testBlock(sourceFile, changeTracker); - const changes = changeTracker.getChanges(); + const changes = changeTracker.getChanges(validateNodes ? verifyPositions : undefined); assert.equal(changes.length, 1); assert.equal(changes[0].fileName, sourceFile.fileName); const modified = textChanges.applyChanges(sourceFile.text, changes[0].textChanges); diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 04a20bbbbb8..bc70106e530 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -212,11 +212,7 @@ namespace ts.textChanges { } /** Public for tests only. Other callers should use `ChangeTracker.with`. */ - constructor( - private readonly newLineCharacter: string, - private readonly formatContext: ts.formatting.FormatContext, - private readonly validator?: (text: NonFormattedText) => void) { - } + constructor(private readonly newLineCharacter: string, private readonly formatContext: ts.formatting.FormatContext) {} public deleteRange(sourceFile: SourceFile, range: TextRange) { this.changes.push({ kind: ChangeKind.Remove, sourceFile, range }); @@ -590,104 +586,83 @@ namespace ts.textChanges { }); } - public getChanges(): FileTextChanges[] { + /** + * Note: after calling this, the TextChanges object must be discarded! + * @param validate only for tests + * The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions, + * so we can only call this once and can't get the non-formatted text separately. + */ + public getChanges(validate?: ValidateNonFormattedText): FileTextChanges[] { this.finishInsertNodeAtClassStart(); - return group(this.changes, c => c.sourceFile.path).map(changesInFile => { + return changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate); + } + } + + export type ValidateNonFormattedText = (node: Node, text: string) => void; + + namespace changesToText { + export function getTextChangesFromChanges(changes: ReadonlyArray, newLineCharacter: string, formatContext: formatting.FormatContext, validate: ValidateNonFormattedText): FileTextChanges[] { + return group(changes, c => c.sourceFile.path).map(changesInFile => { const sourceFile = changesInFile[0].sourceFile; - const textChanges = ChangeTracker.normalize(changesInFile).map(c => - createTextChange(createTextSpanFromRange(c.range), this.computeNewText(c, sourceFile))); + // order changes by start position + const normalized = stableSort(changesInFile, (a, b) => a.range.pos - b.range.pos); + // verify that change intervals do not overlap, except possibly at end points. + for (let i = 0; i < normalized.length - 2; i++) { + Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", () => + `${JSON.stringify(normalized[i].range)} and ${JSON.stringify(normalized[i + 1].range)}`); + } + const textChanges = normalized.map(c => + createTextChange(createTextSpanFromRange(c.range), computeNewText(c, sourceFile, newLineCharacter, formatContext, validate))); return { fileName: sourceFile.fileName, textChanges }; }); } - private computeNewText(change: Change, sourceFile: SourceFile): string { + function computeNewText(change: Change, sourceFile: SourceFile, newLineCharacter: string, formatContext: formatting.FormatContext, validate: ValidateNonFormattedText): string { if (change.kind === ChangeKind.Remove) { - // deletion case return ""; } - const options = change.options || {}; - let text: string; - const pos = change.range.pos; - const posStartsLine = getLineStartPositionForPosition(pos, sourceFile) === pos; - if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - const lastIndex = change.nodes.length - 1; - const parts = change.nodes.map((n, index) => { - const formatted = this.getFormattedTextOfNode(n, sourceFile, pos, options); - return index === lastIndex || endsWith(formatted, this.newLineCharacter) - ? formatted - : (formatted + this.newLineCharacter); - }); - text = parts.join(""); - } - else { - Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); - text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); - } + const { options = {}, range: { pos } } = change; + const format = (n: Node) => getFormattedTextOfNode(n, sourceFile, pos, options, newLineCharacter, formatContext, validate); + const text = change.kind === ChangeKind.ReplaceWithMultipleNodes + ? change.nodes.map(n => removeSuffix(format(n), newLineCharacter)).join(newLineCharacter) + : format(change.node); // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line - text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); + const noIndent = (options.indentation !== undefined || getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + noIndent + (options.suffix || ""); } - private getFormattedTextOfNode(node: Node, sourceFile: SourceFile, pos: number, options: ChangeNodeOptions): string { - const nonformattedText = getNonformattedText(node, sourceFile, this.newLineCharacter); - if (this.validator) { - this.validator(nonformattedText); - } - - const { options: formatOptions } = this.formatContext; - const posStartsLine = getLineStartPositionForPosition(pos, sourceFile) === pos; - + /** Note: this may mutate `nodeIn`. */ + function getFormattedTextOfNode(nodeIn: Node, sourceFile: SourceFile, pos: number, options: ChangeNodeOptions, newLineCharacter: string, formatContext: formatting.FormatContext, validate: ValidateNonFormattedText): string { + const { node, text } = getNonformattedText(nodeIn, sourceFile, newLineCharacter); + if (validate) validate(node, text); + const { options: formatOptions } = formatContext; const initialIndentation = options.indentation !== undefined ? options.indentation : (options.useIndentationFromFile !== false) - ? formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) + ? formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, options.prefix === newLineCharacter || getLineStartPositionForPosition(pos, sourceFile) === pos) : 0; const delta = options.delta !== undefined ? options.delta - : formatting.SmartIndenter.shouldIndentChildNode(node) + : formatting.SmartIndenter.shouldIndentChildNode(nodeIn) ? (formatOptions.indentSize || 0) : 0; - - return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.formatContext); + const file: SourceFileLike = { text, getLineAndCharacterOfPosition(pos) { return getLineAndCharacterOfPosition(this, pos); } }; + const changes = formatting.formatNodeGivenIndentation(node, file, sourceFile.languageVariant, initialIndentation, delta, formatContext); + return applyChanges(text, changes); } - private static normalize(changes: ReadonlyArray): ReadonlyArray { - // order changes by start position - const normalized = stableSort(changes, (a, b) => a.range.pos - b.range.pos); - // verify that change intervals do not overlap, except possibly at end points. - for (let i = 0; i < normalized.length - 2; i++) { - Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos); - } - return normalized; + /** Note: output node may be mutated input node. */ + function getNonformattedText(node: Node, sourceFile: SourceFile | undefined, newLineCharacter: string): { text: string, node: Node } { + const writer = new Writer(newLineCharacter); + const newLine = newLineCharacter === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed; + createPrinter({ newLine }, writer).writeNode(EmitHint.Unspecified, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; } } - export interface NonFormattedText { - readonly text: string; - readonly node: Node; - } - - function getNonformattedText(node: Node, sourceFile: SourceFile | undefined, newLine: string): NonFormattedText { - const writer = new Writer(newLine); - const printer = createPrinter({ newLine: newLine === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed }, writer); - printer.writeNode(EmitHint.Unspecified, node, sourceFile, writer); - return { text: writer.getText(), node: assignPositionsToNode(node) }; - } - - function applyFormatting(nonFormattedText: NonFormattedText, sourceFile: SourceFile, initialIndentation: number, delta: number, formatContext: ts.formatting.FormatContext) { - const lineMap = computeLineStarts(nonFormattedText.text); - const file: SourceFileLike = { - text: nonFormattedText.text, - lineMap, - getLineAndCharacterOfPosition: pos => computeLineAndCharacterOfPosition(lineMap, pos) - }; - const changes = formatting.formatNodeGivenIndentation(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, formatContext); - return applyChanges(nonFormattedText.text, changes); - } - export function applyChanges(text: string, changes: TextChange[]): string { for (let i = changes.length - 1; i >= 0; i--) { const change = changes[i]; diff --git a/tests/baselines/reference/organizeImports/CoalesceTrivia.ts b/tests/baselines/reference/organizeImports/CoalesceTrivia.ts index 972df9e18eb..536ee4bdd67 100644 --- a/tests/baselines/reference/organizeImports/CoalesceTrivia.ts +++ b/tests/baselines/reference/organizeImports/CoalesceTrivia.ts @@ -10,6 +10,5 @@ F2(); /*A*/ import { /*L*/ F1 /*M*/, /*C*/ F2 /*D*/ } /*E*/ from "lib" /*G*/; /*H*/ //I - F1(); F2(); diff --git a/tests/baselines/reference/organizeImports/SortTrivia.ts b/tests/baselines/reference/organizeImports/SortTrivia.ts index e46c836b966..bbed82c8383 100644 --- a/tests/baselines/reference/organizeImports/SortTrivia.ts +++ b/tests/baselines/reference/organizeImports/SortTrivia.ts @@ -7,4 +7,3 @@ /*F*/ import "lib1" /*H*/; /*I*/ //J /*A*/ import "lib2" /*C*/; /*D*/ //E - diff --git a/tests/baselines/reference/organizeImports/UnusedTrivia2.ts b/tests/baselines/reference/organizeImports/UnusedTrivia2.ts index f853015303e..5575f95fbf4 100644 --- a/tests/baselines/reference/organizeImports/UnusedTrivia2.ts +++ b/tests/baselines/reference/organizeImports/UnusedTrivia2.ts @@ -8,5 +8,4 @@ F1(); /*A*/ import { /*C*/ F1 /*D*/ } /*G*/ from "lib" /*I*/; /*J*/ //K - F1(); From de3871a4fcc1b3f412883a13ad0d3790b5dac012 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 27 Feb 2018 15:10:43 -0800 Subject: [PATCH 235/298] Propagate 'never' and the wildcard type in type inference --- src/compiler/checker.ts | 25 ++++++++++++++++++------- src/compiler/types.ts | 3 +++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d7fbe746927..cf15ca84784 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11496,8 +11496,15 @@ namespace ts { if (!couldContainTypeVariables(target)) { return; } - if (source === wildcardType) { - source = getWildcardInstantiation(target); + if (source === neverType || source === wildcardType) { + // We are inferring from 'never' or the wildcard type. We want to infer this + // type for every type parameter referenced in the target type, so we infer from + // target to itself with a flag we check when recording candidates. + const savePriority = priority; + priority |= source === neverType ? InferencePriority.Never : InferencePriority.Wildcard; + inferFromTypes(target, target); + priority = savePriority; + return; } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { // Source and target are types originating in the same generic type alias declaration. @@ -11560,17 +11567,21 @@ namespace ts { const inference = getInferenceInfoForType(target); if (inference) { if (!inference.isFixed) { - if (inference.priority === undefined || priority < inference.priority) { + const p = priority & InferencePriority.Mask; + if (inference.priority === undefined || p < inference.priority) { inference.candidates = undefined; inference.contraCandidates = undefined; - inference.priority = priority; + inference.priority = p; } - if (priority === inference.priority) { + if (p === inference.priority) { + const candidate = priority & InferencePriority.Never ? neverType : + priority & InferencePriority.Wildcard ? wildcardType : + source; if (contravariant) { - inference.contraCandidates = append(inference.contraCandidates, source); + inference.contraCandidates = append(inference.contraCandidates, candidate); } else { - inference.candidates = append(inference.candidates, source); + inference.candidates = append(inference.candidates, candidate); } } if (!(priority & InferencePriority.ReturnType) && target.flags & TypeFlags.TypeParameter && !isTypeParameterAtTopLevel(originalTarget, target)) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4f5dc46f4fc..cd5f7dda442 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3915,6 +3915,9 @@ namespace ts { ReturnType = 1 << 2, // Inference made from return type of generic function NoConstraints = 1 << 3, // Don't infer from constraints of instantiable types AlwaysStrict = 1 << 4, // Always use strict rules for contravariant inferences + Wildcard = 1 << 5, // Inferring from wildcard type + Never = 1 << 6, // Inferring from never type + Mask = NakedTypeVariable | MappedType | ReturnType, } /* @internal */ From 20fe73bb661a2482d745e1752e85c2a8787cafba Mon Sep 17 00:00:00 2001 From: csigs Date: Tue, 27 Feb 2018 23:10:46 +0000 Subject: [PATCH 236/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 5d0a9a141b0..38b72098bd7 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -893,6 +893,15 @@ + + + + + + + + + @@ -905,6 +914,15 @@ + + + + + + + + + @@ -929,6 +947,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index f65f2418896..e12a181198d 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -893,6 +893,15 @@ + + + + + + + + + @@ -905,6 +914,15 @@ + + + + + + + + + @@ -929,6 +947,15 @@ + + + + + + + + + From 5105cdfffc3b911fd039c0cd41ce49864949736e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 27 Feb 2018 15:14:49 -0800 Subject: [PATCH 237/298] Accept API baseline changes --- tests/baselines/reference/api/tsserverlibrary.d.ts | 3 +++ tests/baselines/reference/api/typescript.d.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 52320578833..cad801c08ff 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2240,6 +2240,9 @@ declare namespace ts { ReturnType = 4, NoConstraints = 8, AlwaysStrict = 16, + Wildcard = 32, + Never = 64, + Mask = 7, } interface JsFileExtensionInfo { extension: string; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index dda17b0666c..7aee81a7b0f 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2240,6 +2240,9 @@ declare namespace ts { ReturnType = 4, NoConstraints = 8, AlwaysStrict = 16, + Wildcard = 32, + Never = 64, + Mask = 7, } interface JsFileExtensionInfo { extension: string; From c9c282b2d78c26838864079bc42cf0768e42a8bd Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 27 Feb 2018 15:15:08 -0800 Subject: [PATCH 238/298] Update test --- tests/cases/conformance/types/conditional/inferTypes1.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/conformance/types/conditional/inferTypes1.ts b/tests/cases/conformance/types/conditional/inferTypes1.ts index 13b142e0122..15f86c751d7 100644 --- a/tests/cases/conformance/types/conditional/inferTypes1.ts +++ b/tests/cases/conformance/types/conditional/inferTypes1.ts @@ -13,7 +13,7 @@ type T02 = Unpacked<() => string>; // string type T03 = Unpacked>; // string type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any -type T06 = Unpacked; // {} +type T06 = Unpacked; // never function f1(s: string) { return { a: 1, b: s }; From a0b16fd5d4d5e5fe66f504a8c0e4649c49d8143d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 27 Feb 2018 15:15:23 -0800 Subject: [PATCH 239/298] Accept baseline changes --- tests/baselines/reference/inferTypes1.errors.txt | 2 +- tests/baselines/reference/inferTypes1.js | 2 +- tests/baselines/reference/inferTypes1.symbols | 2 +- tests/baselines/reference/inferTypes1.types | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 6b4e4169240..ba5cfc6be39 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -33,7 +33,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type T03 = Unpacked>; // string type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any - type T06 = Unpacked; // {} + type T06 = Unpacked; // never function f1(s: string) { return { a: 1, b: s }; diff --git a/tests/baselines/reference/inferTypes1.js b/tests/baselines/reference/inferTypes1.js index a7d68878cde..0aea24ec734 100644 --- a/tests/baselines/reference/inferTypes1.js +++ b/tests/baselines/reference/inferTypes1.js @@ -11,7 +11,7 @@ type T02 = Unpacked<() => string>; // string type T03 = Unpacked>; // string type T04 = Unpacked[]>>; // string type T05 = Unpacked; // any -type T06 = Unpacked; // {} +type T06 = Unpacked; // never function f1(s: string) { return { a: 1, b: s }; diff --git a/tests/baselines/reference/inferTypes1.symbols b/tests/baselines/reference/inferTypes1.symbols index 49b6ca2656b..5d2b7949676 100644 --- a/tests/baselines/reference/inferTypes1.symbols +++ b/tests/baselines/reference/inferTypes1.symbols @@ -50,7 +50,7 @@ type T05 = Unpacked; // any >T05 : Symbol(T05, Decl(inferTypes1.ts, 10, 49)) >Unpacked : Symbol(Unpacked, Decl(inferTypes1.ts, 0, 0)) -type T06 = Unpacked; // {} +type T06 = Unpacked; // never >T06 : Symbol(T06, Decl(inferTypes1.ts, 11, 25)) >Unpacked : Symbol(Unpacked, Decl(inferTypes1.ts, 0, 0)) diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index 43bb087affc..5d14cdf5286 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -50,8 +50,8 @@ type T05 = Unpacked; // any >T05 : any >Unpacked : Unpacked -type T06 = Unpacked; // {} ->T06 : {} +type T06 = Unpacked; // never +>T06 : never >Unpacked : Unpacked function f1(s: string) { From dafa7321c64145d8d92759cf6a860d0c5e8650b0 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 27 Feb 2018 16:11:33 -0800 Subject: [PATCH 240/298] Add semicolons to import helpers (#22212) --- src/compiler/transformers/module/module.ts | 4 ++-- tests/baselines/reference/esModuleInterop.js | 4 ++-- tests/baselines/reference/esModuleInteropImportCall.js | 2 +- tests/baselines/reference/esModuleInteropImportNamespace.js | 2 +- .../baselines/reference/esModuleInteropNamedDefaultImports.js | 4 ++-- tests/baselines/reference/esModuleIntersectionCrash.js | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index b55dc583aa9..a4f4cb869dc 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -1728,7 +1728,7 @@ var __importStar = (this && this.__importStar) || function (mod) { if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; -}` +};` }; // emit helper for `import Name from "foo"` @@ -1738,6 +1738,6 @@ var __importStar = (this && this.__importStar) || function (mod) { text: ` var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; -}` +};` }; } diff --git a/tests/baselines/reference/esModuleInterop.js b/tests/baselines/reference/esModuleInterop.js index 9a04ab01be6..c5cc264fe71 100644 --- a/tests/baselines/reference/esModuleInterop.js +++ b/tests/baselines/reference/esModuleInterop.js @@ -22,14 +22,14 @@ fs; "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; -} +}; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; -} +}; exports.__esModule = true; var hybrid_1 = require("./hybrid"); var path_1 = __importDefault(require("./path")); diff --git a/tests/baselines/reference/esModuleInteropImportCall.js b/tests/baselines/reference/esModuleInteropImportCall.js index 2aa681ded7f..d7bf027b001 100644 --- a/tests/baselines/reference/esModuleInteropImportCall.js +++ b/tests/baselines/reference/esModuleInteropImportCall.js @@ -17,7 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) { if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; -} +}; Promise.resolve().then(function () { return __importStar(require("./foo")); }).then(function (f) { f["default"]; }); diff --git a/tests/baselines/reference/esModuleInteropImportNamespace.js b/tests/baselines/reference/esModuleInteropImportNamespace.js index 605976faaaa..74449347623 100644 --- a/tests/baselines/reference/esModuleInteropImportNamespace.js +++ b/tests/baselines/reference/esModuleInteropImportNamespace.js @@ -18,7 +18,7 @@ var __importStar = (this && this.__importStar) || function (mod) { if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; -} +}; exports.__esModule = true; var foo = __importStar(require("./foo")); foo["default"]; diff --git a/tests/baselines/reference/esModuleInteropNamedDefaultImports.js b/tests/baselines/reference/esModuleInteropNamedDefaultImports.js index d3a804b5e4c..f8181c59550 100644 --- a/tests/baselines/reference/esModuleInteropNamedDefaultImports.js +++ b/tests/baselines/reference/esModuleInteropNamedDefaultImports.js @@ -31,14 +31,14 @@ exports.Bar = Bar; "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; -} +}; var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; -} +}; exports.__esModule = true; var mod_1 = __importDefault(require("./mod")); var mod_2 = __importDefault(require("./mod")); diff --git a/tests/baselines/reference/esModuleIntersectionCrash.js b/tests/baselines/reference/esModuleIntersectionCrash.js index a8f6ed5c014..27de446e93c 100644 --- a/tests/baselines/reference/esModuleIntersectionCrash.js +++ b/tests/baselines/reference/esModuleIntersectionCrash.js @@ -20,7 +20,7 @@ var __importStar = (this && this.__importStar) || function (mod) { if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result["default"] = mod; return result; -} +}; exports.__esModule = true; var mod = __importStar(require("./mod")); mod.a; From c1128d6957c7e60f54ef6b7c5cd7e1308fa2bb69 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 27 Feb 2018 16:12:03 -0800 Subject: [PATCH 241/298] Fix declaration emitted crash on mapped type with no type (#22213) --- src/compiler/declarationEmitter.ts | 7 ++++++- .../reference/mappedTypeNoTypeNoCrash.errors.txt | 16 ++++++++++++++++ .../reference/mappedTypeNoTypeNoCrash.js | 4 ++++ .../reference/mappedTypeNoTypeNoCrash.symbols | 9 +++++++++ .../reference/mappedTypeNoTypeNoCrash.types | 11 +++++++++++ tests/cases/compiler/mappedTypeNoTypeNoCrash.ts | 2 ++ 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/mappedTypeNoTypeNoCrash.errors.txt create mode 100644 tests/baselines/reference/mappedTypeNoTypeNoCrash.js create mode 100644 tests/baselines/reference/mappedTypeNoTypeNoCrash.symbols create mode 100644 tests/baselines/reference/mappedTypeNoTypeNoCrash.types create mode 100644 tests/cases/compiler/mappedTypeNoTypeNoCrash.ts diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index a9b3568bfe6..43c635db2f2 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -608,7 +608,12 @@ namespace ts { "?"); } write(": "); - emitType(node.type); + if (node.type) { + emitType(node.type); + } + else { + write("any"); + } write(";"); writeLine(); decreaseIndent(); diff --git a/tests/baselines/reference/mappedTypeNoTypeNoCrash.errors.txt b/tests/baselines/reference/mappedTypeNoTypeNoCrash.errors.txt new file mode 100644 index 00000000000..1e32656c699 --- /dev/null +++ b/tests/baselines/reference/mappedTypeNoTypeNoCrash.errors.txt @@ -0,0 +1,16 @@ +tests/cases/compiler/mappedTypeNoTypeNoCrash.ts(1,51): error TS2304: Cannot find name 'K'. +tests/cases/compiler/mappedTypeNoTypeNoCrash.ts(1,51): error TS4081: Exported type alias 'T0' has or is using private name 'K'. +tests/cases/compiler/mappedTypeNoTypeNoCrash.ts(1,57): error TS2304: Cannot find name 'K'. +tests/cases/compiler/mappedTypeNoTypeNoCrash.ts(1,57): error TS4081: Exported type alias 'T0' has or is using private name 'K'. + + +==== tests/cases/compiler/mappedTypeNoTypeNoCrash.ts (4 errors) ==== + type T0 = ({[K in keyof T]}) extends ({[key in K]: T[K]}) ? number : never; + ~ +!!! error TS2304: Cannot find name 'K'. + ~ +!!! error TS4081: Exported type alias 'T0' has or is using private name 'K'. + ~ +!!! error TS2304: Cannot find name 'K'. + ~ +!!! error TS4081: Exported type alias 'T0' has or is using private name 'K'. \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeNoTypeNoCrash.js b/tests/baselines/reference/mappedTypeNoTypeNoCrash.js new file mode 100644 index 00000000000..ad1d9bba0bf --- /dev/null +++ b/tests/baselines/reference/mappedTypeNoTypeNoCrash.js @@ -0,0 +1,4 @@ +//// [mappedTypeNoTypeNoCrash.ts] +type T0 = ({[K in keyof T]}) extends ({[key in K]: T[K]}) ? number : never; + +//// [mappedTypeNoTypeNoCrash.js] diff --git a/tests/baselines/reference/mappedTypeNoTypeNoCrash.symbols b/tests/baselines/reference/mappedTypeNoTypeNoCrash.symbols new file mode 100644 index 00000000000..7faf2d7b35f --- /dev/null +++ b/tests/baselines/reference/mappedTypeNoTypeNoCrash.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/mappedTypeNoTypeNoCrash.ts === +type T0 = ({[K in keyof T]}) extends ({[key in K]: T[K]}) ? number : never; +>T0 : Symbol(T0, Decl(mappedTypeNoTypeNoCrash.ts, 0, 0)) +>T : Symbol(T, Decl(mappedTypeNoTypeNoCrash.ts, 0, 8)) +>K : Symbol(K, Decl(mappedTypeNoTypeNoCrash.ts, 0, 16)) +>T : Symbol(T, Decl(mappedTypeNoTypeNoCrash.ts, 0, 8)) +>key : Symbol(key, Decl(mappedTypeNoTypeNoCrash.ts, 0, 43)) +>T : Symbol(T, Decl(mappedTypeNoTypeNoCrash.ts, 0, 8)) + diff --git a/tests/baselines/reference/mappedTypeNoTypeNoCrash.types b/tests/baselines/reference/mappedTypeNoTypeNoCrash.types new file mode 100644 index 00000000000..0ec1e7723f8 --- /dev/null +++ b/tests/baselines/reference/mappedTypeNoTypeNoCrash.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/mappedTypeNoTypeNoCrash.ts === +type T0 = ({[K in keyof T]}) extends ({[key in K]: T[K]}) ? number : never; +>T0 : number +>T : T +>K : K +>T : T +>key : key +>K : No type information available! +>T : T +>K : No type information available! + diff --git a/tests/cases/compiler/mappedTypeNoTypeNoCrash.ts b/tests/cases/compiler/mappedTypeNoTypeNoCrash.ts new file mode 100644 index 00000000000..fc9760c7a69 --- /dev/null +++ b/tests/cases/compiler/mappedTypeNoTypeNoCrash.ts @@ -0,0 +1,2 @@ +// @declaration: true +type T0 = ({[K in keyof T]}) extends ({[key in K]: T[K]}) ? number : never; \ No newline at end of file From daf3ed8e22c64a4839bf9d75236ad51e16035822 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 27 Feb 2018 17:34:49 -0800 Subject: [PATCH 242/298] Fix comment --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cf15ca84784..54e1887fff1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8225,7 +8225,7 @@ namespace ts { // conditional type instead of deferring resolution. Also, we always want strict function // types rules (i.e. proper contravariance) for inferences. inferTypes(inferences, checkType, extendsType, InferencePriority.NoConstraints | InferencePriority.AlwaysStrict); - // We infer 'never' when there are no candidates for a type parameter + // We infer {} when there are no candidates for a type parameter const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || emptyObjectType); combinedMapper = combineTypeMappers(mapper, createTypeMapper(root.inferTypeParameters, inferredTypes)); } From 56e6deefc73bd46036dd8ff60adb8a5786e161be Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Feb 2018 06:39:17 -0800 Subject: [PATCH 243/298] Distributive conditional type applied to 'never' produces 'never' --- src/compiler/checker.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 54e1887fff1..756accf41b4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8229,8 +8229,8 @@ namespace ts { const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || emptyObjectType); combinedMapper = combineTypeMappers(mapper, createTypeMapper(root.inferTypeParameters, inferredTypes)); } - // Return union of trueType and falseType for any and never since they match anything - if (checkType.flags & TypeFlags.Any || (checkType.flags & TypeFlags.Never && !(extendsType.flags & TypeFlags.Never))) { + // Return union of trueType and falseType for 'any' since it matches anything + if (checkType.flags & TypeFlags.Any) { return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); } // Instantiate the extends type including inferences for 'infer T' type parameters @@ -8911,7 +8911,7 @@ namespace ts { if (root.isDistributive) { const checkType = root.checkType; const instantiatedType = mapper(checkType); - if (checkType !== instantiatedType && instantiatedType.flags & TypeFlags.Union) { + if (checkType !== instantiatedType && instantiatedType.flags & (TypeFlags.Union | TypeFlags.Never)) { return mapType(instantiatedType, t => getConditionalType(root, createReplacementMapper(checkType, t, mapper))); } } @@ -12449,6 +12449,9 @@ namespace ts { // is a union type, the mapping function is applied to each constituent type and a union // of the resulting types is returned. function mapType(type: Type, mapper: (t: Type) => Type, noReductions?: boolean): Type { + if (type.flags & TypeFlags.Never) { + return type; + } if (!(type.flags & TypeFlags.Union)) { return mapper(type); } From 3fca99522b7106589b910dd047834d7adf5be481 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Feb 2018 06:39:36 -0800 Subject: [PATCH 244/298] Update tests --- .../conformance/types/conditional/conditionalTypes1.ts | 8 ++++---- tests/cases/conformance/types/conditional/inferTypes1.ts | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes1.ts b/tests/cases/conformance/types/conditional/conditionalTypes1.ts index 9449cc6d766..3ef044625eb 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes1.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes1.ts @@ -66,7 +66,7 @@ type TypeName = type T20 = TypeName void)>; // "string" | "function" type T21 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" -type T22 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" +type T22 = TypeName; // never type T23 = TypeName<{}>; // "object" type KnockoutObservable = { object: T }; @@ -174,7 +174,7 @@ type IsString = Extends; type Q1 = IsString; // false type Q2 = IsString<"abc">; // true type Q3 = IsString; // boolean -type Q4 = IsString; // boolean +type Q4 = IsString; // never type N1 = Not; // true type N2 = Not; // false @@ -202,9 +202,9 @@ type O9 = Or; // boolean type T40 = never extends never ? true : false; // true type T41 = number extends never ? true : false; // false -type T42 = never extends number ? true : false; // boolean +type T42 = never extends number ? true : false; // true -type IsNever = T extends never ? true : false; +type IsNever = [T] extends [never] ? true : false; type T50 = IsNever; // true type T51 = IsNever; // false diff --git a/tests/cases/conformance/types/conditional/inferTypes1.ts b/tests/cases/conformance/types/conditional/inferTypes1.ts index 15f86c751d7..671d68c3247 100644 --- a/tests/cases/conformance/types/conditional/inferTypes1.ts +++ b/tests/cases/conformance/types/conditional/inferTypes1.ts @@ -30,13 +30,13 @@ type T12 = ReturnType<(() => T)>; // {} type T13 = ReturnType<(() => T)>; // number[] type T14 = ReturnType; // { a: number, b: string } type T15 = ReturnType; // any -type T16 = ReturnType; // any +type T16 = ReturnType; // never type T17 = ReturnType; // Error type T18 = ReturnType; // Error type U10 = InstanceType; // C type U11 = InstanceType; // any -type U12 = InstanceType; // any +type U12 = InstanceType; // never type U13 = InstanceType; // Error type U14 = InstanceType; // Error @@ -49,7 +49,7 @@ type T23 = ArgumentType<(...args: string[]) => number>; // string type T24 = ArgumentType<(x: string, y: string) => number>; // Error type T25 = ArgumentType; // Error type T26 = ArgumentType; // any -type T27 = ArgumentType; // any +type T27 = ArgumentType; // never type X1 = T extends { x: infer X, y: infer Y } ? [X, Y] : any; From c0c3f4aa12924e765e3a9ec70cd139f1b03c3410 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Feb 2018 06:39:44 -0800 Subject: [PATCH 245/298] Accept new baselines --- .../reference/conditionalTypes1.errors.txt | 8 ++++---- tests/baselines/reference/conditionalTypes1.js | 10 +++++----- .../reference/conditionalTypes1.symbols | 10 +++++----- .../reference/conditionalTypes1.types | 18 +++++++++--------- .../baselines/reference/inferTypes1.errors.txt | 6 +++--- tests/baselines/reference/inferTypes1.js | 6 +++--- tests/baselines/reference/inferTypes1.symbols | 6 +++--- tests/baselines/reference/inferTypes1.types | 12 ++++++------ 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 72d88b60d64..afc020f663a 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -157,7 +157,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(275,43): error TS type T20 = TypeName void)>; // "string" | "function" type T21 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" - type T22 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" + type T22 = TypeName; // never type T23 = TypeName<{}>; // "object" type KnockoutObservable = { object: T }; @@ -329,7 +329,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(275,43): error TS type Q1 = IsString; // false type Q2 = IsString<"abc">; // true type Q3 = IsString; // boolean - type Q4 = IsString; // boolean + type Q4 = IsString; // never type N1 = Not; // true type N2 = Not; // false @@ -357,9 +357,9 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(275,43): error TS type T40 = never extends never ? true : false; // true type T41 = number extends never ? true : false; // false - type T42 = never extends number ? true : false; // boolean + type T42 = never extends number ? true : false; // true - type IsNever = T extends never ? true : false; + type IsNever = [T] extends [never] ? true : false; type T50 = IsNever; // true type T51 = IsNever; // false diff --git a/tests/baselines/reference/conditionalTypes1.js b/tests/baselines/reference/conditionalTypes1.js index 780163286b6..d941ba6454b 100644 --- a/tests/baselines/reference/conditionalTypes1.js +++ b/tests/baselines/reference/conditionalTypes1.js @@ -64,7 +64,7 @@ type TypeName = type T20 = TypeName void)>; // "string" | "function" type T21 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" -type T22 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" +type T22 = TypeName; // never type T23 = TypeName<{}>; // "object" type KnockoutObservable = { object: T }; @@ -172,7 +172,7 @@ type IsString = Extends; type Q1 = IsString; // false type Q2 = IsString<"abc">; // true type Q3 = IsString; // boolean -type Q4 = IsString; // boolean +type Q4 = IsString; // never type N1 = Not; // true type N2 = Not; // false @@ -200,9 +200,9 @@ type O9 = Or; // boolean type T40 = never extends never ? true : false; // true type T41 = number extends never ? true : false; // false -type T42 = never extends number ? true : false; // boolean +type T42 = never extends number ? true : false; // true -type IsNever = T extends never ? true : false; +type IsNever = [T] extends [never] ? true : false; type T50 = IsNever; // true type T51 = IsNever; // false @@ -551,7 +551,7 @@ declare type O9 = Or; declare type T40 = never extends never ? true : false; declare type T41 = number extends never ? true : false; declare type T42 = never extends number ? true : false; -declare type IsNever = T extends never ? true : false; +declare type IsNever = [T] extends [never] ? true : false; declare type T50 = IsNever; declare type T51 = IsNever; declare type T52 = IsNever; diff --git a/tests/baselines/reference/conditionalTypes1.symbols b/tests/baselines/reference/conditionalTypes1.symbols index 8802f25b1a8..5e72d1ebd3c 100644 --- a/tests/baselines/reference/conditionalTypes1.symbols +++ b/tests/baselines/reference/conditionalTypes1.symbols @@ -243,7 +243,7 @@ type T21 = TypeName; // "string" | "number" | "boolean" | "undefined" | "f >T21 : Symbol(T21, Decl(conditionalTypes1.ts, 63, 43)) >TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 53, 43)) -type T22 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" +type T22 = TypeName; // never >T22 : Symbol(T22, Decl(conditionalTypes1.ts, 64, 25)) >TypeName : Symbol(TypeName, Decl(conditionalTypes1.ts, 53, 43)) @@ -668,7 +668,7 @@ type Q3 = IsString; // boolean >Q3 : Symbol(Q3, Decl(conditionalTypes1.ts, 171, 26)) >IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 166, 63)) -type Q4 = IsString; // boolean +type Q4 = IsString; // never >Q4 : Symbol(Q4, Decl(conditionalTypes1.ts, 172, 24)) >IsString : Symbol(IsString, Decl(conditionalTypes1.ts, 166, 63)) @@ -762,16 +762,16 @@ type T40 = never extends never ? true : false; // true type T41 = number extends never ? true : false; // false >T41 : Symbol(T41, Decl(conditionalTypes1.ts, 199, 46)) -type T42 = never extends number ? true : false; // boolean +type T42 = never extends number ? true : false; // true >T42 : Symbol(T42, Decl(conditionalTypes1.ts, 200, 47)) -type IsNever = T extends never ? true : false; +type IsNever = [T] extends [never] ? true : false; >IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 201, 47)) >T : Symbol(T, Decl(conditionalTypes1.ts, 203, 13)) >T : Symbol(T, Decl(conditionalTypes1.ts, 203, 13)) type T50 = IsNever; // true ->T50 : Symbol(T50, Decl(conditionalTypes1.ts, 203, 49)) +>T50 : Symbol(T50, Decl(conditionalTypes1.ts, 203, 53)) >IsNever : Symbol(IsNever, Decl(conditionalTypes1.ts, 201, 47)) type T51 = IsNever; // false diff --git a/tests/baselines/reference/conditionalTypes1.types b/tests/baselines/reference/conditionalTypes1.types index 086ea598ba5..17c4e7ac5e9 100644 --- a/tests/baselines/reference/conditionalTypes1.types +++ b/tests/baselines/reference/conditionalTypes1.types @@ -254,8 +254,8 @@ type T21 = TypeName; // "string" | "number" | "boolean" | "undefined" | "f >T21 : "string" | "number" | "boolean" | "undefined" | "object" | "function" >TypeName : TypeName -type T22 = TypeName; // "string" | "number" | "boolean" | "undefined" | "function" | "object" ->T22 : "string" | "number" | "boolean" | "undefined" | "object" | "function" +type T22 = TypeName; // never +>T22 : never >TypeName : TypeName type T23 = TypeName<{}>; // "object" @@ -741,8 +741,8 @@ type Q3 = IsString; // boolean >Q3 : boolean >IsString : Extends -type Q4 = IsString; // boolean ->Q4 : boolean +type Q4 = IsString; // never +>Q4 : never >IsString : Extends type N1 = Not; // true @@ -865,12 +865,12 @@ type T41 = number extends never ? true : false; // false >true : true >false : false -type T42 = never extends number ? true : false; // boolean ->T42 : boolean +type T42 = never extends number ? true : false; // true +>T42 : true >true : true >false : false -type IsNever = T extends never ? true : false; +type IsNever = [T] extends [never] ? true : false; >IsNever : IsNever >T : T >T : T @@ -1236,7 +1236,7 @@ function f50() { >T : T type Omit = { [P in keyof T]: If, never, P>; }[keyof T]; ->Omit : { [P in keyof T]: (T[P] extends never ? boolean : false) extends false ? P : never; }[keyof T] +>Omit : { [P in keyof T]: (T[P] extends never ? never : false) extends false ? P : never; }[keyof T] >T : T >P : P >T : T @@ -1263,7 +1263,7 @@ function f50() { type A = Omit<{ a: void; b: never; }>; // 'a' >A : "a" ->Omit : { [P in keyof T]: (T[P] extends never ? boolean : false) extends false ? P : never; }[keyof T] +>Omit : { [P in keyof T]: (T[P] extends never ? never : false) extends false ? P : never; }[keyof T] >a : void >b : never diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index ba5cfc6be39..b36528f721d 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -50,7 +50,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type T13 = ReturnType<(() => T)>; // number[] type T14 = ReturnType; // { a: number, b: string } type T15 = ReturnType; // any - type T16 = ReturnType; // any + type T16 = ReturnType; // never type T17 = ReturnType; // Error ~~~~~~ !!! error TS2344: Type 'string' does not satisfy the constraint '(...args: any[]) => any'. @@ -61,7 +61,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type U10 = InstanceType; // C type U11 = InstanceType; // any - type U12 = InstanceType; // any + type U12 = InstanceType; // never type U13 = InstanceType; // Error ~~~~~~ !!! error TS2344: Type 'string' does not satisfy the constraint 'new (...args: any[]) => any'. @@ -84,7 +84,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: !!! error TS2344: Type 'Function' does not satisfy the constraint '(x: any) => any'. !!! error TS2344: Type 'Function' provides no match for the signature '(x: any): any'. type T26 = ArgumentType; // any - type T27 = ArgumentType; // any + type T27 = ArgumentType; // never type X1 = T extends { x: infer X, y: infer Y } ? [X, Y] : any; diff --git a/tests/baselines/reference/inferTypes1.js b/tests/baselines/reference/inferTypes1.js index 0aea24ec734..bc53f238997 100644 --- a/tests/baselines/reference/inferTypes1.js +++ b/tests/baselines/reference/inferTypes1.js @@ -28,13 +28,13 @@ type T12 = ReturnType<(() => T)>; // {} type T13 = ReturnType<(() => T)>; // number[] type T14 = ReturnType; // { a: number, b: string } type T15 = ReturnType; // any -type T16 = ReturnType; // any +type T16 = ReturnType; // never type T17 = ReturnType; // Error type T18 = ReturnType; // Error type U10 = InstanceType; // C type U11 = InstanceType; // any -type U12 = InstanceType; // any +type U12 = InstanceType; // never type U13 = InstanceType; // Error type U14 = InstanceType; // Error @@ -47,7 +47,7 @@ type T23 = ArgumentType<(...args: string[]) => number>; // string type T24 = ArgumentType<(x: string, y: string) => number>; // Error type T25 = ArgumentType; // Error type T26 = ArgumentType; // any -type T27 = ArgumentType; // any +type T27 = ArgumentType; // never type X1 = T extends { x: infer X, y: infer Y } ? [X, Y] : any; diff --git a/tests/baselines/reference/inferTypes1.symbols b/tests/baselines/reference/inferTypes1.symbols index 5d2b7949676..784482e72c9 100644 --- a/tests/baselines/reference/inferTypes1.symbols +++ b/tests/baselines/reference/inferTypes1.symbols @@ -106,7 +106,7 @@ type T15 = ReturnType; // any >T15 : Symbol(T15, Decl(inferTypes1.ts, 27, 33)) >ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) -type T16 = ReturnType; // any +type T16 = ReturnType; // never >T16 : Symbol(T16, Decl(inferTypes1.ts, 28, 27)) >ReturnType : Symbol(ReturnType, Decl(lib.d.ts, --, --)) @@ -128,7 +128,7 @@ type U11 = InstanceType; // any >U11 : Symbol(U11, Decl(inferTypes1.ts, 33, 34)) >InstanceType : Symbol(InstanceType, Decl(lib.d.ts, --, --)) -type U12 = InstanceType; // any +type U12 = InstanceType; // never >U12 : Symbol(U12, Decl(inferTypes1.ts, 34, 29)) >InstanceType : Symbol(InstanceType, Decl(lib.d.ts, --, --)) @@ -184,7 +184,7 @@ type T26 = ArgumentType; // any >T26 : Symbol(T26, Decl(inferTypes1.ts, 46, 34)) >ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) -type T27 = ArgumentType; // any +type T27 = ArgumentType; // never >T27 : Symbol(T27, Decl(inferTypes1.ts, 47, 29)) >ArgumentType : Symbol(ArgumentType, Decl(inferTypes1.ts, 37, 34)) diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index 5d14cdf5286..4ca78f65081 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -110,8 +110,8 @@ type T15 = ReturnType; // any >T15 : any >ReturnType : ReturnType -type T16 = ReturnType; // any ->T16 : any +type T16 = ReturnType; // never +>T16 : never >ReturnType : ReturnType type T17 = ReturnType; // Error @@ -132,8 +132,8 @@ type U11 = InstanceType; // any >U11 : any >InstanceType : InstanceType -type U12 = InstanceType; // any ->U12 : any +type U12 = InstanceType; // never +>U12 : never >InstanceType : InstanceType type U13 = InstanceType; // Error @@ -188,8 +188,8 @@ type T26 = ArgumentType; // any >T26 : any >ArgumentType : ArgumentType -type T27 = ArgumentType; // any ->T27 : any +type T27 = ArgumentType; // never +>T27 : never >ArgumentType : ArgumentType type X1 = T extends { x: infer X, y: infer Y } ? [X, Y] : any; From d6448b8a7e152b3ede2b58663dca798509782f08 Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 28 Feb 2018 17:10:29 +0000 Subject: [PATCH 246/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl index 476ae69b584..6be77191686 100644 --- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -903,6 +903,15 @@ + + + + + + + + + @@ -915,6 +924,15 @@ + + + + + + + + + @@ -939,6 +957,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1d0a08bdfe6..35dc89a8c24 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -912,6 +912,15 @@ + + + + + + + + + @@ -924,6 +933,15 @@ + + + + + + + + + @@ -948,6 +966,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl index 59ede10c95b..ded26e10335 100644 --- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -903,6 +903,15 @@ + + + + + + + + + @@ -915,6 +924,15 @@ + + + + + + + + + @@ -939,6 +957,15 @@ + + + + + + + + + From fa4619c5c17a6a592245069f416b91e2ea40c36d Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 28 Feb 2018 11:16:32 -0800 Subject: [PATCH 247/298] Add 'info' diagnostics (#22204) * Add 'info' diagnostics * Code review --- src/compiler/diagnosticMessages.json | 5 + src/compiler/program.ts | 10 +- src/compiler/types.ts | 6 ++ src/harness/fourslash.ts | 17 ++- src/harness/harness.ts | 4 +- src/harness/harnessLanguageService.ts | 3 + src/harness/unittests/session.ts | 1 + .../unittests/tsserverProjectSystem.ts | 102 +++++++++++++++--- src/harness/virtualFileSystemWithWatch.ts | 5 +- src/server/client.ts | 52 ++++----- src/server/protocol.ts | 15 ++- src/server/session.ts | 94 +++++++++------- .../convertToEs6Module.ts | 97 +++-------------- src/services/codefixes/fixes.ts | 1 + src/services/refactors/refactors.ts | 1 - src/services/services.ts | 7 ++ src/services/shims.ts | 8 +- src/services/suggestionDiagnostics.ts | 8 ++ src/services/tsconfig.json | 1 + src/services/types.ts | 1 + .../reference/api/tsserverlibrary.d.ts | 19 +++- tests/baselines/reference/api/typescript.d.ts | 4 +- tests/cases/fourslash/findAllRefsForModule.ts | 2 - tests/cases/fourslash/fourslash.ts | 1 + ...refactorConvertToEs6Module_export_alias.ts | 11 +- ...torConvertToEs6Module_export_dotDefault.ts | 12 +-- ...orConvertToEs6Module_export_invalidName.ts | 12 +-- ...vertToEs6Module_export_moduleDotExports.ts | 14 ++- ...le_export_moduleDotExportsEqualsRequire.ts | 12 +-- ..._export_moduleDotExports_changesImports.ts | 11 +- ...refactorConvertToEs6Module_export_named.ts | 20 ++-- ...s6Module_export_namedFunctionExpression.ts | 13 +-- ...efactorConvertToEs6Module_export_object.ts | 12 +-- ...vertToEs6Module_export_object_shorthand.ts | 12 +-- ...torConvertToEs6Module_export_referenced.ts | 12 +-- ...vertToEs6Module_expressionToDeclaration.ts | 12 +-- ...tToEs6Module_import_arrayBindingPattern.ts | 9 +- ...rtToEs6Module_import_includeDefaultUses.ts | 10 +- ...Module_import_multipleUniqueIdentifiers.ts | 14 ++- ...ule_import_multipleVariableDeclarations.ts | 12 +-- ...s6Module_import_nameFromModuleSpecifier.ts | 18 ++-- ...ule_import_objectBindingPattern_complex.ts | 12 +-- ...odule_import_objectBindingPattern_plain.ts | 11 +- ...vertToEs6Module_import_onlyNamedImports.ts | 12 +-- ...onvertToEs6Module_import_propertyAccess.ts | 12 +-- ...ctorConvertToEs6Module_import_shadowing.ts | 14 ++- ...torConvertToEs6Module_import_sideEffect.ts | 9 +- .../refactorConvertToEs6Module_triggers.ts | 13 --- ...ertToEs6Module_triggers_declarationList.ts | 9 -- ...nvertToEs6Module_triggers_noInitializer.ts | 11 -- 50 files changed, 400 insertions(+), 383 deletions(-) rename src/services/{refactors => codefixes}/convertToEs6Module.ts (85%) create mode 100644 src/services/suggestionDiagnostics.ts delete mode 100644 tests/cases/fourslash/refactorConvertToEs6Module_triggers.ts delete mode 100644 tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts delete mode 100644 tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 23549f012a0..689d1079eef 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3810,6 +3810,11 @@ "code": 18003 }, + "File is a CommonJS module; it may be converted to an ES6 module.": { + "category": "Suggestion", + "code": 80001 + }, + "Add missing 'super()' call": { "category": "Message", "code": 90001 diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 1ce672a6a75..aff5154abe0 100755 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -227,8 +227,7 @@ namespace ts { } export function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string { - const category = DiagnosticCategory[diagnostic.category].toLowerCase(); - const errorMessage = `${category} TS${diagnostic.code}: ${flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())}${host.getNewLine()}`; + const errorMessage = `${diagnosticCategoryName(diagnostic)} TS${diagnostic.code}: ${flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())}${host.getNewLine()}`; if (diagnostic.file) { const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); @@ -254,8 +253,9 @@ namespace ts { const ellipsis = "..."; function getCategoryFormat(category: DiagnosticCategory): string { switch (category) { - case DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; case DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case DiagnosticCategory.Suggestion: return Debug.fail("Should never get an Info diagnostic on the command line."); case DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } @@ -337,9 +337,7 @@ namespace ts { output += " - "; } - const categoryColor = getCategoryFormat(diagnostic.category); - const category = DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category)); output += formatColorAndReset(` TS${ diagnostic.code }: `, ForegroundColorEscapeSequences.Grey); output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 6c0eaf586d1..c40af194971 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4017,8 +4017,14 @@ namespace ts { export enum DiagnosticCategory { Warning, Error, + Suggestion, Message } + /* @internal */ + export function diagnosticCategoryName(d: { category: DiagnosticCategory }, lowerCase = true): string { + const name = DiagnosticCategory[d.category]; + return lowerCase ? name.toLowerCase() : name; + } export enum ModuleResolutionKind { Classic = 1, diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 88b1c32814e..b244ac9d589 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -506,8 +506,11 @@ namespace FourSlash { } private getDiagnostics(fileName: string): ts.Diagnostic[] { - return ts.concatenate(this.languageService.getSyntacticDiagnostics(fileName), - this.languageService.getSemanticDiagnostics(fileName)); + return [ + ...this.languageService.getSyntacticDiagnostics(fileName), + ...this.languageService.getSemanticDiagnostics(fileName), + ...this.languageService.getSuggestionDiagnostics(fileName), + ]; } private getAllDiagnostics(): ts.Diagnostic[] { @@ -581,7 +584,7 @@ namespace FourSlash { public verifyNoErrors() { ts.forEachKey(this.inputFiles, fileName => { if (!ts.isAnySupportedFileExtension(fileName)) return; - const errors = this.getDiagnostics(fileName); + const errors = this.getDiagnostics(fileName).filter(e => e.category !== ts.DiagnosticCategory.Suggestion); if (errors.length) { this.printErrorLog(/*expectErrors*/ false, errors); const error = errors[0]; @@ -1246,6 +1249,10 @@ Actual: ${stringify(fullActual)}`); this.testDiagnostics(expected, diagnostics); } + public getSuggestionDiagnostics(expected: ReadonlyArray): void { + this.testDiagnostics(expected, this.languageService.getSuggestionDiagnostics(this.activeFile.fileName)); + } + private testDiagnostics(expected: ReadonlyArray, diagnostics: ReadonlyArray) { assert.deepEqual(ts.realizeDiagnostics(diagnostics, ts.newLineCharacter), expected); } @@ -4327,6 +4334,10 @@ namespace FourSlashInterface { this.state.getSemanticDiagnostics(expected); } + public getSuggestionDiagnostics(expected: ReadonlyArray) { + this.state.getSuggestionDiagnostics(expected); + } + public ProjectInfo(expected: string[]) { this.state.verifyProjectInfo(expected); } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index d3bd537ad4c..e2bed4f0318 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -242,7 +242,7 @@ namespace Utils { start: diagnostic.start, length: diagnostic.length, messageText: ts.flattenDiagnosticMessageText(diagnostic.messageText, Harness.IO.newLine()), - category: (ts).DiagnosticCategory[diagnostic.category], + category: ts.diagnosticCategoryName(diagnostic, /*lowerCase*/ false), code: diagnostic.code }; } @@ -1376,7 +1376,7 @@ namespace Harness { .split("\n") .map(s => s.length > 0 && s.charAt(s.length - 1) === "\r" ? s.substr(0, s.length - 1) : s) .filter(s => s.length > 0) - .map(s => "!!! " + ts.DiagnosticCategory[error.category].toLowerCase() + " TS" + error.code + ": " + s); + .map(s => "!!! " + ts.diagnosticCategoryName(error) + " TS" + error.code + ": " + s); errLines.forEach(e => outputLines += (newLine() + e)); errorsReported++; diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index c38ab1f3c6d..503246c72ca 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -402,6 +402,9 @@ namespace Harness.LanguageService { getSemanticDiagnostics(fileName: string): ts.Diagnostic[] { return unwrapJSONCallResult(this.shim.getSemanticDiagnostics(fileName)); } + getSuggestionDiagnostics(fileName: string): ts.Diagnostic[] { + return unwrapJSONCallResult(this.shim.getSuggestionDiagnostics(fileName)); + } getCompilerOptionsDiagnostics(): ts.Diagnostic[] { return unwrapJSONCallResult(this.shim.getCompilerOptionsDiagnostics()); } diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 765fc29ee49..b690045d7c1 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -216,6 +216,7 @@ namespace ts.server { CommandNames.GeterrForProject, CommandNames.SemanticDiagnosticsSync, CommandNames.SyntacticDiagnosticsSync, + CommandNames.SuggestionDiagnosticsSync, CommandNames.NavBar, CommandNames.NavBarFull, CommandNames.Navto, diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index e09dff2a6d5..66f224d431e 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -467,12 +467,12 @@ namespace ts.projectSystem { verifyDiagnostics(actual, []); } - function checkErrorMessage(session: TestSession, eventName: "syntaxDiag" | "semanticDiag", diagnostics: protocol.DiagnosticEventBody) { - checkNthEvent(session, ts.server.toEvent(eventName, diagnostics), 0, /*isMostRecent*/ false); + function checkErrorMessage(session: TestSession, eventName: protocol.DiagnosticEventKind, diagnostics: protocol.DiagnosticEventBody, isMostRecent = false): void { + checkNthEvent(session, ts.server.toEvent(eventName, diagnostics), 0, isMostRecent); } - function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number) { - checkNthEvent(session, ts.server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, /*isMostRecent*/ true); + function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number, isMostRecent = true): void { + checkNthEvent(session, ts.server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); } function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { @@ -3076,8 +3076,13 @@ namespace ts.projectSystem { host.runQueuedImmediateCallbacks(); assert.isFalse(hasError()); checkErrorMessage(session, "semanticDiag", { file: untitledFile, diagnostics: [] }); + session.clearMessages(); + host.runQueuedImmediateCallbacks(1); + assert.isFalse(hasError()); + checkErrorMessage(session, "suggestionDiag", { file: untitledFile, diagnostics: [] }); checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); } it("has projectRoot", () => { @@ -3136,6 +3141,10 @@ namespace ts.projectSystem { host.runQueuedImmediateCallbacks(); checkErrorMessage(session, "semanticDiag", { file: app.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + checkErrorMessage(session, "suggestionDiag", { file: app.path, diagnostics: [] }); checkCompleteEvent(session, 2, expectedSequenceId); session.clearMessages(); } @@ -3934,18 +3943,17 @@ namespace ts.projectSystem { session.clearMessages(); host.runQueuedImmediateCallbacks(); - const moduleNotFound = Diagnostics.Cannot_find_module_0; const startOffset = file1.content.indexOf('"') + 1; checkErrorMessage(session, "semanticDiag", { - file: file1.path, diagnostics: [{ - start: { line: 1, offset: startOffset }, - end: { line: 1, offset: startOffset + '"pad"'.length }, - text: formatStringFromArgs(moduleNotFound.message, ["pad"]), - code: moduleNotFound.code, - category: DiagnosticCategory[moduleNotFound.category].toLowerCase(), - source: undefined - }] + file: file1.path, + diagnostics: [ + createDiagnostic({ line: 1, offset: startOffset }, { line: 1, offset: startOffset + '"pad"'.length }, Diagnostics.Cannot_find_module_0, ["pad"]) + ], }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + checkErrorMessage(session, "suggestionDiag", { file: file1.path, diagnostics: [] }); checkCompleteEvent(session, 2, expectedSequenceId); session.clearMessages(); @@ -3966,6 +3974,63 @@ namespace ts.projectSystem { host.runQueuedImmediateCallbacks(); checkErrorMessage(session, "semanticDiag", { file: file1.path, diagnostics: [] }); }); + + it("info diagnostics", () => { + const file: FileOrFolder = { + path: "/a.js", + content: 'require("b")', + }; + + const host = createServerHost([file]); + const session = createSession(host, { canUseEvents: true }); + const service = session.getProjectService(); + + session.executeCommandSeq({ + command: server.CommandNames.Open, + arguments: { file: file.path, fileContent: file.content }, + }); + + checkNumberOfProjects(service, { inferredProjects: 1 }); + session.clearMessages(); + const expectedSequenceId = session.getNextSeq(); + host.checkTimeoutQueueLengthAndRun(2); + + checkProjectUpdatedInBackgroundEvent(session, [file.path]); + session.clearMessages(); + + session.executeCommandSeq({ + command: server.CommandNames.Geterr, + arguments: { + delay: 0, + files: [file.path], + } + }); + + host.checkTimeoutQueueLengthAndRun(1); + + checkErrorMessage(session, "syntaxDiag", { file: file.path, diagnostics: [] }, /*isMostRecent*/ true); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "semanticDiag", { file: file.path, diagnostics: [] }); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + + checkErrorMessage(session, "suggestionDiag", { + file: file.path, + diagnostics: [ + createDiagnostic({ line: 1, offset: 1 }, { line: 1, offset: 13 }, Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module) + ], + }); + checkCompleteEvent(session, 2, expectedSequenceId); + session.clearMessages(); + }); + + function createDiagnostic(start: protocol.Location, end: protocol.Location, message: DiagnosticMessage, args: ReadonlyArray = []): protocol.Diagnostic { + return { start, end, text: formatStringFromArgs(message.message, args), code: message.code, category: diagnosticCategoryName(message), source: undefined }; + } }); describe("tsserverProjectSystem Configure file diagnostics events", () => { @@ -5154,9 +5219,15 @@ namespace ts.projectSystem { // the semanticDiag message host.runQueuedImmediateCallbacks(); - assert.equal(host.getOutput().length, 2, "expect 2 messages"); + assert.equal(host.getOutput().length, 1); const e2 = getMessage(0); assert.equal(e2.event, "semanticDiag"); + session.clearMessages(); + + host.runQueuedImmediateCallbacks(1); + assert.equal(host.getOutput().length, 2); + const e3 = getMessage(0); + assert.equal(e3.event, "suggestionDiag"); verifyRequestCompleted(getErrId, 1); cancellationToken.resetToken(); @@ -5194,6 +5265,7 @@ namespace ts.projectSystem { return JSON.parse(server.extractMessage(host.getOutput()[n])); } }); + it("Lower priority tasks are cancellable", () => { const f1 = { path: "/a/app.ts", @@ -5495,7 +5567,7 @@ namespace ts.projectSystem { } type CalledMaps = CalledMapsWithSingleArg | CalledMapsWithFiveArgs; function createCallsTrackingHost(host: TestServerHost) { - const calledMaps: Record> & Record, ReadonlyArray, ReadonlyArray, number]>> = { + const calledMaps: Record> & Record, ReadonlyArray, ReadonlyArray, number]>> = { fileExists: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.fileExists), directoryExists: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.directoryExists), getDirectories: setCallsTrackingWithSingleArgFn(CalledMapsWithSingleArg.getDirectories), diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 93fdc6cdbc6..54a353a59c6 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -708,7 +708,10 @@ interface Array {}` } } - runQueuedImmediateCallbacks() { + runQueuedImmediateCallbacks(checkCount?: number) { + if (checkCount !== undefined) { + assert.equal(this.immediateCallbacks.count(), checkCount); + } this.immediateCallbacks.invoke(); } diff --git a/src/server/client.ts b/src/server/client.ts index cee65c0e5a4..6f04f141957 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -75,7 +75,7 @@ namespace ts.server { return { span: this.decodeSpan(codeEdit, fileName), newText: codeEdit.newText }; } - private processRequest(command: string, args?: any): T { + private processRequest(command: string, args?: T["arguments"]): T { const request: protocol.Request = { seq: this.sequence, type: "request", @@ -343,41 +343,31 @@ namespace ts.server { } getSyntacticDiagnostics(file: string): Diagnostic[] { - const args: protocol.SyntacticDiagnosticsSyncRequestArgs = { file, includeLinePosition: true }; - - const request = this.processRequest(CommandNames.SyntacticDiagnosticsSync, args); - const response = this.processResponse(request); - - return (response.body).map(entry => this.convertDiagnostic(entry, file)); + return this.getDiagnostics(file, CommandNames.SyntacticDiagnosticsSync); } - getSemanticDiagnostics(file: string): Diagnostic[] { - const args: protocol.SemanticDiagnosticsSyncRequestArgs = { file, includeLinePosition: true }; - - const request = this.processRequest(CommandNames.SemanticDiagnosticsSync, args); - const response = this.processResponse(request); - - return (response.body).map(entry => this.convertDiagnostic(entry, file)); + return this.getDiagnostics(file, CommandNames.SemanticDiagnosticsSync); + } + getSuggestionDiagnostics(file: string): Diagnostic[] { + return this.getDiagnostics(file, CommandNames.SuggestionDiagnosticsSync); } - convertDiagnostic(entry: protocol.DiagnosticWithLinePosition, _fileName: string): Diagnostic { - let category: DiagnosticCategory; - for (const id in DiagnosticCategory) { - if (isString(id) && entry.category === id.toLowerCase()) { - category = (DiagnosticCategory)[id]; - } - } + private getDiagnostics(file: string, command: CommandNames) { + const request = this.processRequest(command, { file, includeLinePosition: true }); + const response = this.processResponse(request); - Debug.assert(category !== undefined, "convertDiagnostic: category should not be undefined"); - - return { - file: undefined, - start: entry.start, - length: entry.length, - messageText: entry.message, - category, - code: entry.code - }; + return (response.body).map(entry => { + const category = firstDefined(Object.keys(DiagnosticCategory), id => + isString(id) && entry.category === id.toLowerCase() ? (DiagnosticCategory)[id] : undefined); + return { + file: undefined, + start: entry.start, + length: entry.length, + messageText: entry.message, + category: Debug.assertDefined(category, "convertDiagnostic: category should not be undefined"), + code: entry.code + }; + }); } getCompilerOptionsDiagnostics(): Diagnostic[] { diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 76d954ebe23..40bee65e9f0 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -42,6 +42,7 @@ namespace ts.server.protocol { GeterrForProject = "geterrForProject", SemanticDiagnosticsSync = "semanticDiagnosticsSync", SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", + SuggestionDiagnosticsSync = "suggestionDiagnosticsSync", NavBar = "navbar", /* @internal */ NavBarFull = "navbar-full", @@ -2010,6 +2011,14 @@ namespace ts.server.protocol { body?: Diagnostic[] | DiagnosticWithLinePosition[]; } + export interface SuggestionDiagnosticsSyncRequest extends FileRequest { + command: CommandTypes.SuggestionDiagnosticsSync; + arguments: SuggestionDiagnosticsSyncRequestArgs; + } + + export type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs; + export type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse; + /** * Synchronous request for syntactic diagnostics of one file. */ @@ -2121,7 +2130,7 @@ namespace ts.server.protocol { text: string; /** - * The category of the diagnostic message, e.g. "error" vs. "warning" + * The category of the diagnostic message, e.g. "error", "warning", or "suggestion". */ category: string; @@ -2155,8 +2164,10 @@ namespace ts.server.protocol { diagnostics: Diagnostic[]; } + export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag"; + /** - * Event message for "syntaxDiag" and "semanticDiag" event types. + * Event message for DiagnosticEventKind event types. * These events provide syntactic and semantic errors for a file. */ export interface DiagnosticEvent extends Event { diff --git a/src/server/session.ts b/src/server/session.ts index bff19d7bc23..4f0981a3880 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -79,7 +79,7 @@ namespace ts.server { end: scriptInfo.positionToLineOffset(diag.start + diag.length), text: flattenDiagnosticMessageText(diag.messageText, "\n"), code: diag.code, - category: DiagnosticCategory[diag.category].toLowerCase(), + category: diagnosticCategoryName(diag), source: diag.source }; } @@ -95,7 +95,7 @@ namespace ts.server { const end = diag.file && convertToLocation(getLineAndCharacterOfPosition(diag.file, diag.start + diag.length)); const text = flattenDiagnosticMessageText(diag.messageText, "\n"); const { code, source } = diag; - const category = DiagnosticCategory[diag.category].toLowerCase(); + const category = diagnosticCategoryName(diag); return includeFileName ? { start, end, text, code, category, source, fileName: diag.file && diag.file.fileName } : { start, end, text, code, category, source }; } @@ -466,30 +466,26 @@ namespace ts.server { } private semanticCheck(file: NormalizedPath, project: Project) { - try { - let diags: ReadonlyArray = emptyArray; - if (!isDeclarationFileInJSOnlyNonConfiguredProject(project, file)) { - diags = project.getLanguageService().getSemanticDiagnostics(file); - } - - const bakedDiags = diags.map((diag) => formatDiag(file, project, diag)); - this.event({ file, diagnostics: bakedDiags }, "semanticDiag"); - } - catch (err) { - this.logError(err, "semantic check"); - } + const diags = isDeclarationFileInJSOnlyNonConfiguredProject(project, file) + ? emptyArray + : project.getLanguageService().getSemanticDiagnostics(file); + this.sendDiagnosticsEvent(file, project, diags, "semanticDiag"); } private syntacticCheck(file: NormalizedPath, project: Project) { + this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag"); + } + + private infoCheck(file: NormalizedPath, project: Project) { + this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag"); + } + + private sendDiagnosticsEvent(file: NormalizedPath, project: Project, diagnostics: ReadonlyArray, kind: protocol.DiagnosticEventKind): void { try { - const diags = project.getLanguageService().getSyntacticDiagnostics(file); - if (diags) { - const bakedDiags = diags.map((diag) => formatDiag(file, project, diag)); - this.event({ file, diagnostics: bakedDiags }, "syntaxDiag"); - } + this.event({ file, diagnostics: diagnostics.map(diag => formatDiag(file, project, diag)) }, kind); } catch (err) { - this.logError(err, "syntactic check"); + this.logError(err, kind); } } @@ -499,21 +495,34 @@ namespace ts.server { let index = 0; const checkOne = () => { - if (this.changeSeq === seq) { - const checkSpec = checkList[index]; - index++; - if (checkSpec.project.containsFile(checkSpec.fileName, requireOpen)) { - this.syntacticCheck(checkSpec.fileName, checkSpec.project); - if (this.changeSeq === seq) { - next.immediate(() => { - this.semanticCheck(checkSpec.fileName, checkSpec.project); - if (checkList.length > index) { - next.delay(followMs, checkOne); - } - }); - } - } + if (this.changeSeq !== seq) { + return; } + + const { fileName, project } = checkList[index]; + index++; + if (!project.containsFile(fileName, requireOpen)) { + return; + } + + this.syntacticCheck(fileName, project); + if (this.changeSeq !== seq) { + return; + } + + next.immediate(() => { + this.semanticCheck(fileName, project); + if (this.changeSeq !== seq) { + return; + } + + next.immediate(() => { + this.infoCheck(fileName, project); + if (checkList.length > index) { + next.delay(followMs, checkOne); + } + }); + }); }; if (checkList.length > index && this.changeSeq === seq) { @@ -580,7 +589,7 @@ namespace ts.server { message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), start: d.start, length: d.length, - category: DiagnosticCategory[d.category].toLowerCase(), + category: diagnosticCategoryName(d), code: d.code, startLocation: d.file && convertToLocation(getLineAndCharacterOfPosition(d.file, d.start)), endLocation: d.file && convertToLocation(getLineAndCharacterOfPosition(d.file, d.start + d.length)) @@ -606,7 +615,7 @@ namespace ts.server { message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), start: d.start, length: d.length, - category: DiagnosticCategory[d.category].toLowerCase(), + category: diagnosticCategoryName(d), code: d.code, source: d.source, startLocation: scriptInfo && scriptInfo.positionToLineOffset(d.start), @@ -756,6 +765,16 @@ namespace ts.server { return this.getDiagnosticsWorker(args, /*isSemantic*/ true, (project, file) => project.getLanguageService().getSemanticDiagnostics(file), args.includeLinePosition); } + private getSuggestionDiagnosticsSync(args: protocol.SuggestionDiagnosticsSyncRequestArgs): ReadonlyArray | ReadonlyArray { + const { configFile } = this.getConfigFileAndProject(args); + if (configFile) { + // Currently there are no info diagnostics for config files. + return emptyArray; + } + // isSemantic because we don't want to info diagnostics in declaration files for JS-only users + return this.getDiagnosticsWorker(args, /*isSemantic*/ true, (project, file) => project.getLanguageService().getSuggestionDiagnostics(file), args.includeLinePosition); + } + private getDocumentHighlights(args: protocol.DocumentHighlightsRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray { const { file, project } = this.getFileAndProject(args); const position = this.getPositionInFile(args, file); @@ -1953,6 +1972,9 @@ namespace ts.server { [CommandNames.SyntacticDiagnosticsSync]: (request: protocol.SyntacticDiagnosticsSyncRequest) => { return this.requiredResponse(this.getSyntacticDiagnosticsSync(request.arguments)); }, + [CommandNames.SuggestionDiagnosticsSync]: (request: protocol.SuggestionDiagnosticsSyncRequest) => { + return this.requiredResponse(this.getSuggestionDiagnosticsSync(request.arguments)); + }, [CommandNames.Geterr]: (request: protocol.GeterrRequest) => { this.errorCheck.startNew(next => this.getDiagnostics(next, request.arguments.delay, request.arguments.files)); return this.notRequired(); diff --git a/src/services/refactors/convertToEs6Module.ts b/src/services/codefixes/convertToEs6Module.ts similarity index 85% rename from src/services/refactors/convertToEs6Module.ts rename to src/services/codefixes/convertToEs6Module.ts index 6ed9cbec2ee..d494e5c907f 100644 --- a/src/services/refactors/convertToEs6Module.ts +++ b/src/services/codefixes/convertToEs6Module.ts @@ -1,85 +1,22 @@ /* @internal */ -namespace ts.refactor { - const actionName = "Convert to ES6 module"; - const description = getLocaleSpecificMessage(Diagnostics.Convert_to_ES6_module); - registerRefactor(actionName, { getEditsForAction, getAvailableActions }); - - function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined { - const { file, startPosition } = context; - if (!isSourceFileJavaScript(file) || !file.commonJsModuleIndicator) { - return undefined; - } - - const node = getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - return !isAtTriggerLocation(file, node) ? undefined : [ - { - name: actionName, - description, - actions: [ - { - description, - name: actionName, - }, - ], - }, - ]; - } - - function isAtTriggerLocation(sourceFile: SourceFile, node: Node, onSecondTry = false): boolean { - switch (node.kind) { - case SyntaxKind.CallExpression: - return isAtTopLevelRequire(node as CallExpression); - case SyntaxKind.PropertyAccessExpression: - return isExportsOrModuleExportsOrAlias(sourceFile, node as PropertyAccessExpression) - || isExportsOrModuleExportsOrAlias(sourceFile, (node as PropertyAccessExpression).expression); - case SyntaxKind.VariableDeclarationList: - return isVariableDeclarationTriggerLocation(firstOrUndefined((node as VariableDeclarationList).declarations)); - case SyntaxKind.VariableDeclaration: - return isVariableDeclarationTriggerLocation(node as VariableDeclaration); - default: - return isExpression(node) && isExportsOrModuleExportsOrAlias(sourceFile, node) - || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, /*onSecondTry*/ true); - } - - function isVariableDeclarationTriggerLocation(decl: VariableDeclaration | undefined) { - return !!decl && !!decl.initializer && isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); - } - } - - function isAtTopLevelRequire(call: CallExpression): boolean { - if (!isRequireCall(call, /*checkArgumentIsStringLiteral*/ true)) { - return false; - } - const { parent: propAccess } = call; - const varDecl = isPropertyAccessExpression(propAccess) ? propAccess.parent : propAccess; - if (isExpressionStatement(varDecl) && isSourceFile(varDecl.parent)) { // `require("x");` as a statement - return true; - } - if (!isVariableDeclaration(varDecl)) { - return false; - } - const { parent: varDeclList } = varDecl; - if (varDeclList.kind !== SyntaxKind.VariableDeclarationList) { - return false; - } - const { parent: varStatement } = varDeclList; - return varStatement.kind === SyntaxKind.VariableStatement && varStatement.parent.kind === SyntaxKind.SourceFile; - } - - function getEditsForAction(context: RefactorContext, _actionName: string): RefactorEditInfo | undefined { - Debug.assertEqual(actionName, _actionName); - const { file, program } = context; - Debug.assert(isSourceFileJavaScript(file)); - const edits = textChanges.ChangeTracker.with(context, changes => { - const moduleExportsChangedToDefault = convertFileToEs6Module(file, program.getTypeChecker(), changes, program.getCompilerOptions().target); - if (moduleExportsChangedToDefault) { - for (const importingFile of program.getSourceFiles()) { - fixImportOfModuleExports(importingFile, file, changes); +namespace ts.codefix { + registerCodeFix({ + errorCodes: [Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module.code], + getCodeActions(context) { + const description = getLocaleSpecificMessage(Diagnostics.Convert_to_ES6_module); + const { sourceFile, program } = context; + const changes = textChanges.ChangeTracker.with(context, changes => { + const moduleExportsChangedToDefault = convertFileToEs6Module(sourceFile, program.getTypeChecker(), changes, program.getCompilerOptions().target); + if (moduleExportsChangedToDefault) { + for (const importingFile of program.getSourceFiles()) { + fixImportOfModuleExports(importingFile, sourceFile, changes); + } } - } - }); - return { edits, renameFilename: undefined, renameLocation: undefined }; - } + }); + // No support for fix-all since this applies to the whole file at once anyway. + return [{ description, changes, fixId: undefined }]; + }, + }); function fixImportOfModuleExports(importingFile: ts.SourceFile, exportingFile: ts.SourceFile, changes: textChanges.ChangeTracker) { for (const moduleSpecifier of importingFile.imports) { diff --git a/src/services/codefixes/fixes.ts b/src/services/codefixes/fixes.ts index 671f2251a32..24b726717a0 100644 --- a/src/services/codefixes/fixes.ts +++ b/src/services/codefixes/fixes.ts @@ -1,4 +1,5 @@ /// +/// /// /// /// diff --git a/src/services/refactors/refactors.ts b/src/services/refactors/refactors.ts index 8b4561700d5..3858b198743 100644 --- a/src/services/refactors/refactors.ts +++ b/src/services/refactors/refactors.ts @@ -1,6 +1,5 @@ /// /// -/// /// /// /// diff --git a/src/services/services.ts b/src/services/services.ts index a4da9b12ead..e29633a92e0 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -20,6 +20,7 @@ /// /// /// +/// /// /// /// @@ -1419,6 +1420,11 @@ namespace ts { return [...semanticDiagnostics, ...declarationDiagnostics]; } + function getSuggestionDiagnostics(fileName: string): Diagnostic[] { + synchronizeHostData(); + return computeSuggestionDiagnostics(getValidSourceFile(fileName)); + } + function getCompilerOptionsDiagnostics() { synchronizeHostData(); return [...program.getOptionsDiagnostics(cancellationToken), ...program.getGlobalDiagnostics(cancellationToken)]; @@ -2101,6 +2107,7 @@ namespace ts { cleanupSemanticCache, getSyntacticDiagnostics, getSemanticDiagnostics, + getSuggestionDiagnostics, getCompilerOptionsDiagnostics, getSyntacticClassifications, getSemanticClassifications, diff --git a/src/services/shims.ts b/src/services/shims.ts index 5abf5da2c07..5d3f82eb966 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -144,6 +144,7 @@ namespace ts { getSyntacticDiagnostics(fileName: string): string; getSemanticDiagnostics(fileName: string): string; + getSuggestionDiagnostics(fileName: string): string; getCompilerOptionsDiagnostics(): string; getSyntacticClassifications(fileName: string, start: number, length: number): string; @@ -597,8 +598,7 @@ namespace ts { message: flattenDiagnosticMessageText(diagnostic.messageText, newLine), start: diagnostic.start, length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: DiagnosticCategory[diagnostic.category].toLowerCase(), + category: diagnosticCategoryName(diagnostic), code: diagnostic.code }; } @@ -716,6 +716,10 @@ namespace ts { }); } + public getSuggestionDiagnostics(fileName: string): string { + return this.forwardJSONCall(`getSuggestionDiagnostics('${fileName}')`, () => this.realizeDiagnostics(this.languageService.getSuggestionDiagnostics(fileName))); + } + public getCompilerOptionsDiagnostics(): string { return this.forwardJSONCall( "getCompilerOptionsDiagnostics()", diff --git a/src/services/suggestionDiagnostics.ts b/src/services/suggestionDiagnostics.ts new file mode 100644 index 00000000000..8cb26f74a01 --- /dev/null +++ b/src/services/suggestionDiagnostics.ts @@ -0,0 +1,8 @@ +/* @internal */ +namespace ts { + export function computeSuggestionDiagnostics(sourceFile: SourceFile): Diagnostic[] { + return sourceFile.commonJsModuleIndicator + ? [createDiagnosticForNode(sourceFile.commonJsModuleIndicator, Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)] + : emptyArray; + } +} diff --git a/src/services/tsconfig.json b/src/services/tsconfig.json index bbd88a1a004..686c3357bc3 100644 --- a/src/services/tsconfig.json +++ b/src/services/tsconfig.json @@ -70,6 +70,7 @@ "semver.ts", "shims.ts", "signatureHelp.ts", + "suggestionDiagnostics.ts", "symbolDisplay.ts", "textChanges.ts", "refactorProvider.ts", diff --git a/src/services/types.ts b/src/services/types.ts index b67c2569f27..dba10960cdf 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -223,6 +223,7 @@ namespace ts { getSyntacticDiagnostics(fileName: string): Diagnostic[]; getSemanticDiagnostics(fileName: string): Diagnostic[]; + getSuggestionDiagnostics(fileName: string): Diagnostic[]; // TODO: Rename this to getProgramDiagnostics to better indicate that these are any // diagnostics present for the program level, and not just 'options' diagnostics. diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 9f5ceb1f0cb..23af7487675 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2262,7 +2262,8 @@ declare namespace ts { enum DiagnosticCategory { Warning = 0, Error = 1, - Message = 2, + Suggestion = 2, + Message = 3, } enum ModuleResolutionKind { Classic = 1, @@ -4054,6 +4055,7 @@ declare namespace ts { cleanupSemanticCache(): void; getSyntacticDiagnostics(fileName: string): Diagnostic[]; getSemanticDiagnostics(fileName: string): Diagnostic[]; + getSuggestionDiagnostics(fileName: string): Diagnostic[]; getCompilerOptionsDiagnostics(): Diagnostic[]; /** * @deprecated Use getEncodedSyntacticClassifications instead. @@ -5024,6 +5026,7 @@ declare namespace ts.server.protocol { GeterrForProject = "geterrForProject", SemanticDiagnosticsSync = "semanticDiagnosticsSync", SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", + SuggestionDiagnosticsSync = "suggestionDiagnosticsSync", NavBar = "navbar", Navto = "navto", NavTree = "navtree", @@ -6546,6 +6549,12 @@ declare namespace ts.server.protocol { interface SemanticDiagnosticsSyncResponse extends Response { body?: Diagnostic[] | DiagnosticWithLinePosition[]; } + interface SuggestionDiagnosticsSyncRequest extends FileRequest { + command: CommandTypes.SuggestionDiagnosticsSync; + arguments: SuggestionDiagnosticsSyncRequestArgs; + } + type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs; + type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse; /** * Synchronous request for syntactic diagnostics of one file. */ @@ -6642,7 +6651,7 @@ declare namespace ts.server.protocol { */ text: string; /** - * The category of the diagnostic message, e.g. "error" vs. "warning" + * The category of the diagnostic message, e.g. "error", "warning", or "suggestion". */ category: string; /** @@ -6670,8 +6679,9 @@ declare namespace ts.server.protocol { */ diagnostics: Diagnostic[]; } + type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag"; /** - * Event message for "syntaxDiag" and "semanticDiag" event types. + * Event message for DiagnosticEventKind event types. * These events provide syntactic and semantic errors for a file. */ interface DiagnosticEvent extends Event { @@ -7206,6 +7216,8 @@ declare namespace ts.server { private doOutput(info, cmdName, reqSeq, success, message?); private semanticCheck(file, project); private syntacticCheck(file, project); + private infoCheck(file, project); + private sendDiagnosticsEvent(file, project, diagnostics, kind); private updateErrorCheck(next, checkList, ms, requireOpen?); private cleanProjects(caption, projects); private cleanup(); @@ -7226,6 +7238,7 @@ declare namespace ts.server { private getOccurrences(args); private getSyntacticDiagnosticsSync(args); private getSemanticDiagnosticsSync(args); + private getSuggestionDiagnosticsSync(args); private getDocumentHighlights(args, simplifiedResult); private setCompilerOptionsForInferredProjects(args); private getProjectInfo(args); diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index e5fb0b1e169..ab4e3aeff8c 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2262,7 +2262,8 @@ declare namespace ts { enum DiagnosticCategory { Warning = 0, Error = 1, - Message = 2, + Suggestion = 2, + Message = 3, } enum ModuleResolutionKind { Classic = 1, @@ -4306,6 +4307,7 @@ declare namespace ts { cleanupSemanticCache(): void; getSyntacticDiagnostics(fileName: string): Diagnostic[]; getSemanticDiagnostics(fileName: string): Diagnostic[]; + getSuggestionDiagnostics(fileName: string): Diagnostic[]; getCompilerOptionsDiagnostics(): Diagnostic[]; /** * @deprecated Use getEncodedSyntacticClassifications instead. diff --git a/tests/cases/fourslash/findAllRefsForModule.ts b/tests/cases/fourslash/findAllRefsForModule.ts index bff3aa17785..a8641625075 100644 --- a/tests/cases/fourslash/findAllRefsForModule.ts +++ b/tests/cases/fourslash/findAllRefsForModule.ts @@ -14,8 +14,6 @@ // @Filename: /d.ts //// /// -verify.noErrors(); - const ranges = test.ranges(); const [r0, r1, r2] = ranges; verify.referenceGroups(ranges, [{ definition: 'module "/a"', ranges: [r0, r2, r1] }]); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 9680eb822a7..7561ca3793d 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -349,6 +349,7 @@ declare namespace FourSlashInterface { }, displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[], tags: ts.JSDocTagInfo[]): void; getSyntacticDiagnostics(expected: ReadonlyArray): void; getSemanticDiagnostics(expected: ReadonlyArray): void; + getSuggestionDiagnostics(expected: ReadonlyArray): void; ProjectInfo(expected: string[]): void; allRangesAppearInImplementationList(markerName: string): void; } diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_alias.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_alias.ts index 6529bb64af0..73cd606adf9 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_alias.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_alias.ts @@ -5,14 +5,11 @@ // @Filename: /a.js ////const exportsAlias = exports; ////exportsAlias.f = function() {}; -/////*a*/module/*b*/.exports = exportsAlias; +////module.exports = exportsAlias; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: ` +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: ` export function f() { } `, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_dotDefault.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_dotDefault.ts index 1c8633eb4eb..1283b0053a8 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_dotDefault.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_dotDefault.ts @@ -5,15 +5,13 @@ // @allowJs: true // @Filename: /a.js -/////*a*/exports/*b*/.default = 0; +////exports.default = 0; ////exports.default; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `const _default = 0; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`const _default = 0; export { _default as default }; _default;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_invalidName.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_invalidName.ts index 16b48fcd204..83a831effb0 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_invalidName.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_invalidName.ts @@ -5,15 +5,13 @@ // @allowJs: true // @Filename: /a.js -/////*a*/exports/*b*/.class = 0; +////exports.class = 0; ////exports.async = 1; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `const _class = 0; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`const _class = 0; export { _class as class }; export const async = 1;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports.ts index ddcf79d0114..3382228babb 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports.ts @@ -3,7 +3,7 @@ // @allowJs: true // @Filename: /a.js -/////*a*/module/*b*/.exports = function() {} +////module.exports = function() {} ////module.exports = function f() {} ////module.exports = class {} ////module.exports = class C {} @@ -11,16 +11,14 @@ // See also `refactorConvertToEs6Module_export_moduleDotExportsEqualsRequire.ts` -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `export default function() { } +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`export default function() { } export default function f() { } export default class { } export default class C { } -export default 0;` +export default 0;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExportsEqualsRequire.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExportsEqualsRequire.ts index 8d22ea77c2b..81877c8a98b 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExportsEqualsRequire.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExportsEqualsRequire.ts @@ -18,7 +18,7 @@ // @Filename: /z.js // Normally -- just `export *` -/////*a*/module/*b*/.exports = require("./a"); +////module.exports = require("./a"); // If just a default is exported, just `export { default }` ////module.exports = require("./b"); // May need both @@ -28,12 +28,10 @@ // In untyped case just go with `export *` ////module.exports = require("./unknown"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: +goTo.file("/z.js"); +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: `export * from "./a"; export { default } from "./b"; export * from "./c"; diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports_changesImports.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports_changesImports.ts index 7b48bd5f91e..84f081d24b3 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports_changesImports.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_moduleDotExports_changesImports.ts @@ -3,7 +3,7 @@ // @allowJs: true // @Filename: /a.js -/////*a*/module/*b*/.exports = 0; +////module.exports = 0; // @Filename: /b.ts ////import a = require("./a"); @@ -11,12 +11,9 @@ // @Filename: /c.js ////const a = require("./a"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `export default 0;`, +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: "export default 0;", }); goTo.file("/b.ts"); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts index 8251f90fc0d..03303b1e09e 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts @@ -3,16 +3,22 @@ // @allowJs: true // @Filename: /a.js -/////*a*/exports/*b*/.f = function() {} +////exports.f = function() {}/*diagEnd*/ ////exports.C = class {} ////exports.x = 0; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `export function f() { } +verify.getSuggestionDiagnostics([{ + message: "File is a CommonJS module; it may be converted to an ES6 module.", + start: 0, + length: test.marker("diagEnd").position, + category: "suggestion", + code: 80001, +}]); + +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`export function f() { } export class C { } export const x = 0;`, diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_namedFunctionExpression.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_namedFunctionExpression.ts index a4b0ba24109..dbd4e6a0a4c 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_namedFunctionExpression.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_namedFunctionExpression.ts @@ -3,15 +3,12 @@ // @allowJs: true // @Filename: /a.js -/////*a*/exports/*b*/.f = function g() { g(); } +////exports.f = function g() { g(); } ////exports.h = function h() { h(); } -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: `export const f = function g() { g(); }; -export function h() { h(); }` +export function h() { h(); }`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_object.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_object.ts index b18bc94579d..61c46c98b3c 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_object.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_object.ts @@ -3,7 +3,7 @@ // @allowJs: true // @Filename: /a.js -/////*a*/module/*b*/.exports = { +////module.exports = { //// x: 0, //// f: function() {}, //// g: () => {}, @@ -11,12 +11,10 @@ //// C: class {}, ////}; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `export const x = 0; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`export const x = 0; export function f() { } export function g() { } export function h() { } diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_object_shorthand.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_object_shorthand.ts index 05b4903eda3..f6fe1048820 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_object_shorthand.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_object_shorthand.ts @@ -6,13 +6,11 @@ // @Filename: /a.js ////function f() {} -/////*a*/module/*b*/.exports = { f }; +////module.exports = { f }; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `function f() {} +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`function f() {} export default { f };`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_referenced.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_referenced.ts index da9976fa7d0..ff87d3c6948 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_referenced.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_referenced.ts @@ -7,7 +7,7 @@ ////exports.x; //// ////const y = 1; -/////*a*/exports/*b*/.y = y; +////exports.y = y; ////exports.y; //// ////exports.z = 2; @@ -15,12 +15,10 @@ //// exports.z; ////} -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `export const x = 0; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`export const x = 0; x; const y = 1; diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_expressionToDeclaration.ts b/tests/cases/fourslash/refactorConvertToEs6Module_expressionToDeclaration.ts index b3b7fbf94c6..746524e849c 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_expressionToDeclaration.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_expressionToDeclaration.ts @@ -3,15 +3,13 @@ // @allowJs: true // @Filename: /a.js -/////*a*/exports/*b*/.f = async function* f(p) {} +////exports.f = async function* f(p) {} ////exports.C = class C extends D { m() {} } -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `export async function* f(p) { } +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`export async function* f(p) { } export class C extends D { m() { } }`, diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_arrayBindingPattern.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_arrayBindingPattern.ts index b33b0a1a160..d7e857b5d5e 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_arrayBindingPattern.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_arrayBindingPattern.ts @@ -5,11 +5,8 @@ // @Filename: /a.js ////const [x, y] = /*a*/require/*b*/("x"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import _x from "x"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: `import _x from "x"; const [x, y] = _x;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_includeDefaultUses.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_includeDefaultUses.ts index 7c5415c1451..0e69f9519ee 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_includeDefaultUses.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_includeDefaultUses.ts @@ -7,12 +7,10 @@ ////x(); ////x.y; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import x, { y } from "x"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import x, { y } from "x"; x(); y;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleUniqueIdentifiers.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleUniqueIdentifiers.ts index 321a9cccf8b..a42f1fe5321 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleUniqueIdentifiers.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleUniqueIdentifiers.ts @@ -4,17 +4,15 @@ // @Filename: /a.js ////const x = require("x"); -////const [a, b] = /*a*/require/*b*/("x"); +////const [a, b] = require("x"); ////const {c, ...d} = require("x"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import x from "x"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import x from "x"; import _x from "x"; const [a, b] = _x; import __x from "x"; -const { c, ...d } = __x;` +const { c, ...d } = __x;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleVariableDeclarations.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleVariableDeclarations.ts index 37d65ddc622..3c45950c90d 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleVariableDeclarations.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_multipleVariableDeclarations.ts @@ -5,14 +5,12 @@ // @allowJs: true // @Filename: /a.js -////const x = /*a*/require/*b*/("x"), y = 0, { z } = require("z"); +////const x = require("x"), y = 0, { z } = require("z"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import x from "x"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import x from "x"; const y = 0; import { z } from "z";`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_nameFromModuleSpecifier.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_nameFromModuleSpecifier.ts index 0c953b2e7e6..510b610315a 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_nameFromModuleSpecifier.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_nameFromModuleSpecifier.ts @@ -3,19 +3,17 @@ // @allowJs: true // @Filename: /a.js -////const [] = /*a0*/require/*b0*/("a-b"); -////const [] = /*a1*/require/*b1*/("0a"); -////const [] = /*a2*/require/*b2*/("1a"); +////const [] = require("a-b"); +////const [] = require("0a"); +////const [] = require("1a"); -goTo.select("a0", "b0"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import aB from "a-b"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import aB from "a-b"; const [] = aB; import A from "0a"; const [] = A; import _A from "1a"; -const [] = _A;` +const [] = _A;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_complex.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_complex.ts index f757db2164a..32df9906964 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_complex.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_complex.ts @@ -3,13 +3,11 @@ // @allowJs: true // @Filename: /a.js -////const { x: { a, b } } = /*a*/require/*b*/("x"); +////const { x: { a, b } } = require("x"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import x from "x"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import x from "x"; const { x: { a, b } } = x;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_plain.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_plain.ts index 474fd4b0f0f..4bff560e530 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_plain.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_objectBindingPattern_plain.ts @@ -3,12 +3,9 @@ // @allowJs: true // @Filename: /a.js -////const { x, y: z } = /*a*/require/*b*/("x"); +////const { x, y: z } = require("x"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: 'import { x, y as z } from "x";', +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: 'import { x, y as z } from "x";', }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_onlyNamedImports.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_onlyNamedImports.ts index bf7e207550e..7f66b67685e 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_onlyNamedImports.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_onlyNamedImports.ts @@ -3,14 +3,12 @@ // @allowJs: true // @Filename: /a.js -////const x = /*a*/require/*b*/("x"); +////const x = require("x"); ////x.y; -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import { y } from "x"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import { y } from "x"; y;`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_propertyAccess.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_propertyAccess.ts index 57efd5370f2..34c6ee6aa57 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_propertyAccess.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_propertyAccess.ts @@ -3,18 +3,16 @@ // @allowJs: true // @Filename: /a.js -////const x = /*a*/require/*b*/("x").default; +////const x = require("x").default; ////const a = require("b").c; ////const a = require("a").a; ////const [a, b] = require("c").d; ////const [a, b] = require("c").a; // Test that we avoid shadowing the earlier local variable 'a' from 'const [a,b] = d;'. -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import x from "x"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import x from "x"; import { c as a } from "b"; import { a } from "a"; import { d } from "c"; diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_shadowing.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_shadowing.ts index c389280d75c..dec87859901 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_shadowing.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_shadowing.ts @@ -3,16 +3,14 @@ // @allowJs: true // @Filename: /a.js -////const mod = /*a*/require/*b*/("mod"); +////const mod = require("mod"); ////const x = 0; ////mod.x(x); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: `import { x as _x } from "mod"; +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: +`import { x as _x } from "mod"; const x = 0; -_x(x);` +_x(x);`, }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_import_sideEffect.ts b/tests/cases/fourslash/refactorConvertToEs6Module_import_sideEffect.ts index 2b81c816e20..f729f0a9815 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_import_sideEffect.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_import_sideEffect.ts @@ -7,10 +7,7 @@ // @Filename: /a.js /////*a*/require/*b*/("foo"); -goTo.select("a", "b"); -edit.applyRefactor({ - refactorName: "Convert to ES6 module", - actionName: "Convert to ES6 module", - actionDescription: "Convert to ES6 module", - newContent: 'import "foo";', +verify.codeFix({ + description: "Convert to ES6 module", + newFileContent: 'import "foo";', }); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_triggers.ts b/tests/cases/fourslash/refactorConvertToEs6Module_triggers.ts deleted file mode 100644 index 8d441f47dc3..00000000000 --- a/tests/cases/fourslash/refactorConvertToEs6Module_triggers.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// - -// @allowJs: true - -// @Filename: /a.js -////c[|o|]nst [|a|]lias [|=|] [|m|]odule[|.|]export[|s|]; -////[|a|]lias[|.|][|x|] = 0; -////[|module.exports|]; -////[|require("x")|]; -////[|require("x").y;|]; - -goTo.eachRange(() => verify.refactorAvailable("Convert to ES6 module")); - diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts b/tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts deleted file mode 100644 index 36ec32b0561..00000000000 --- a/tests/cases/fourslash/refactorConvertToEs6Module_triggers_declarationList.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// - -// @allowJs: true - -// @Filename: /a.js -////c[|o|]nst; -////require("x"); - -goTo.eachRange(() => verify.not.refactorAvailable("Convert to ES6 module")); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts b/tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts deleted file mode 100644 index 23cbdd12aee..00000000000 --- a/tests/cases/fourslash/refactorConvertToEs6Module_triggers_noInitializer.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -// @allowJs: true - -// @Filename: /a.js -/////*a*/const/*b*/ alias; -////require("x"); - -goTo.select("a", "b"); -verify.not.refactorAvailable("Convert to ES6 module"); - From e5b568f9f41513a04e9d52eddb43109a15710f07 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Feb 2018 14:08:25 -0800 Subject: [PATCH 248/298] Consistently propagate 'any' and 'never' types in type inference --- src/compiler/checker.ts | 26 ++++++++++++-------------- src/compiler/types.ts | 3 --- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 756accf41b4..0be1c8438b4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11490,20 +11490,21 @@ namespace ts { let symbolStack: Symbol[]; let visited: Map; let contravariant = false; + let propagationType: Type; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source: Type, target: Type) { if (!couldContainTypeVariables(target)) { return; } - if (source === neverType || source === wildcardType) { - // We are inferring from 'never' or the wildcard type. We want to infer this - // type for every type parameter referenced in the target type, so we infer from - // target to itself with a flag we check when recording candidates. - const savePriority = priority; - priority |= source === neverType ? InferencePriority.Never : InferencePriority.Wildcard; + if (source.flags & (TypeFlags.Any | TypeFlags.Never) && source !== silentNeverType) { + // We are inferring from 'any' or 'never'. We want to infer this type for every type parameter + // referenced in the target type, so we record the propagation type and infer from the target + // to itself. Then, as we find candidates we substitute the propagation type. + const savePropagationType = propagationType; + propagationType = source; inferFromTypes(target, target); - priority = savePriority; + propagationType = savePropagationType; return; } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { @@ -11567,16 +11568,13 @@ namespace ts { const inference = getInferenceInfoForType(target); if (inference) { if (!inference.isFixed) { - const p = priority & InferencePriority.Mask; - if (inference.priority === undefined || p < inference.priority) { + if (inference.priority === undefined || priority < inference.priority) { inference.candidates = undefined; inference.contraCandidates = undefined; - inference.priority = p; + inference.priority = priority; } - if (p === inference.priority) { - const candidate = priority & InferencePriority.Never ? neverType : - priority & InferencePriority.Wildcard ? wildcardType : - source; + if (priority === inference.priority) { + const candidate = propagationType || source; if (contravariant) { inference.contraCandidates = append(inference.contraCandidates, candidate); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index cd5f7dda442..4f5dc46f4fc 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3915,9 +3915,6 @@ namespace ts { ReturnType = 1 << 2, // Inference made from return type of generic function NoConstraints = 1 << 3, // Don't infer from constraints of instantiable types AlwaysStrict = 1 << 4, // Always use strict rules for contravariant inferences - Wildcard = 1 << 5, // Inferring from wildcard type - Never = 1 << 6, // Inferring from never type - Mask = NakedTypeVariable | MappedType | ReturnType, } /* @internal */ From 992870aefa8327915fe15999b4e881fc9ed3d077 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Feb 2018 14:08:49 -0800 Subject: [PATCH 249/298] Accept new baselines --- tests/baselines/reference/api/tsserverlibrary.d.ts | 3 --- tests/baselines/reference/api/typescript.d.ts | 3 --- .../reference/mappedTypeRecursiveInference.types | 8 ++++---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index cad801c08ff..52320578833 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2240,9 +2240,6 @@ declare namespace ts { ReturnType = 4, NoConstraints = 8, AlwaysStrict = 16, - Wildcard = 32, - Never = 64, - Mask = 7, } interface JsFileExtensionInfo { extension: string; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 7aee81a7b0f..dda17b0666c 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2240,9 +2240,6 @@ declare namespace ts { ReturnType = 4, NoConstraints = 8, AlwaysStrict = 16, - Wildcard = 32, - Never = 64, - Mask = 7, } interface JsFileExtensionInfo { extension: string; diff --git a/tests/baselines/reference/mappedTypeRecursiveInference.types b/tests/baselines/reference/mappedTypeRecursiveInference.types index 4db91e61ba1..6248422f8d4 100644 --- a/tests/baselines/reference/mappedTypeRecursiveInference.types +++ b/tests/baselines/reference/mappedTypeRecursiveInference.types @@ -108,14 +108,14 @@ let xhr: XMLHttpRequest; >XMLHttpRequest : XMLHttpRequest const out2 = foo(xhr); ->out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } ->foo(xhr) : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: any; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>foo(xhr) : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: any; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } >foo : (deep: Deep) => T >xhr : XMLHttpRequest out2.responseXML >out2.responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } ->out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: any; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } >responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } out2.responseXML.activeElement.className.length @@ -123,7 +123,7 @@ out2.responseXML.activeElement.className.length >out2.responseXML.activeElement.className : { toString: {}; charAt: {}; charCodeAt: {}; concat: {}; indexOf: {}; lastIndexOf: {}; localeCompare: {}; match: {}; replace: {}; search: {}; slice: {}; split: {}; substring: {}; toLowerCase: {}; toLocaleLowerCase: {}; toUpperCase: {}; toLocaleUpperCase: {}; trim: {}; readonly length: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; substr: {}; valueOf: {}; [Symbol.iterator]: {}; codePointAt: {}; includes: {}; endsWith: {}; normalize: {}; repeat: {}; startsWith: {}; anchor: {}; big: {}; blink: {}; bold: {}; fixed: {}; fontcolor: {}; fontsize: {}; italics: {}; link: {}; small: {}; strike: {}; sub: {}; sup: {}; } >out2.responseXML.activeElement : { readonly classList: { readonly length: any; add: any; contains: any; item: any; remove: any; toggle: any; toString: any; }; className: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly clientHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; id: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; innerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; msContentZoomFactor: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly msRegionOverflow: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly prefix: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly scrollHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly scrollWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly tagName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly assignedSlot: { name: any; assignedNodes: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; slot: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly shadowRoot: { readonly host: any; innerHTML: any; readonly activeElement: any; readonly styleSheets: any; getSelection: any; elementFromPoint: any; elementsFromPoint: any; getElementById: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; querySelector: any; querySelectorAll: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; }; getAttribute: {}; getAttributeNode: {}; getAttributeNodeNS: {}; getAttributeNS: {}; getBoundingClientRect: {}; getClientRects: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; hasAttribute: {}; hasAttributeNS: {}; msGetRegionContent: {}; msGetUntransformedBounds: {}; msMatchesSelector: {}; msReleasePointerCapture: {}; msSetPointerCapture: {}; msZoomTo: {}; releasePointerCapture: {}; removeAttribute: {}; removeAttributeNode: {}; removeAttributeNS: {}; requestFullscreen: {}; requestPointerLock: {}; setAttribute: {}; setAttributeNode: {}; setAttributeNodeNS: {}; setAttributeNS: {}; setPointerCapture: {}; webkitMatchesSelector: {}; webkitRequestFullscreen: {}; webkitRequestFullScreen: {}; getElementsByClassName: {}; matches: {}; closest: {}; scrollIntoView: {}; scroll: {}; scrollTo: {}; scrollBy: {}; insertAdjacentElement: {}; insertAdjacentHTML: {}; insertAdjacentText: {}; attachShadow: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly nextElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly previousElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; querySelector: {}; querySelectorAll: {}; remove: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; } >out2.responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } ->out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: {}; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } +>out2 : { onreadystatechange: {}; readonly readyState: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly response: any; readonly responseText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; responseType: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseURL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly responseXML: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly status: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly statusText: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; timeout: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly upload: { addEventListener: any; removeEventListener: any; dispatchEvent: any; onabort: any; onerror: any; onload: any; onloadend: any; onloadstart: any; onprogress: any; ontimeout: any; }; withCredentials: { valueOf: any; }; msCaching?: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; abort: {}; getAllResponseHeaders: {}; getResponseHeader: {}; msCachingEnabled: {}; open: {}; overrideMimeType: {}; send: {}; setRequestHeader: {}; readonly DONE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly HEADERS_RECEIVED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly LOADING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly OPENED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly UNSENT: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; addEventListener: {}; removeEventListener: {}; dispatchEvent: {}; onabort: {}; onerror: {}; onload: {}; onloadend: {}; onloadstart: {}; onprogress: {}; ontimeout: {}; } >responseXML : { readonly activeElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; alinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly all: { readonly length: any; item: any; namedItem: any; }; anchors: { item: any; namedItem: any; readonly length: any; }; applets: { item: any; namedItem: any; readonly length: any; }; bgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; body: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly characterSet: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; charset: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly compatMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; cookie: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly currentScript: { async: any; charset: any; crossOrigin: any; defer: any; event: any; htmlFor: any; src: any; text: any; type: any; integrity: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; } | { type: any; addEventListener: any; removeEventListener: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly href: any; }; readonly defaultView: { readonly applicationCache: any; readonly caches: any; readonly clientInformation: any; readonly closed: any; readonly crypto: any; defaultStatus: any; readonly devicePixelRatio: any; readonly document: any; readonly doNotTrack: any; event: any; readonly external: any; readonly frameElement: any; readonly frames: any; readonly history: any; readonly innerHeight: any; readonly innerWidth: any; readonly isSecureContext: any; readonly length: any; readonly location: any; readonly locationbar: any; readonly menubar: any; readonly msContentScript: any; readonly msCredentials: any; name: any; readonly navigator: any; offscreenBuffering: any; onabort: any; onafterprint: any; onbeforeprint: any; onbeforeunload: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncompassneedscalibration: any; oncontextmenu: any; ondblclick: any; ondevicelight: any; ondevicemotion: any; ondeviceorientation: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onhashchange: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmessage: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onoffline: any; ononline: any; onorientationchange: any; onpagehide: any; onpageshow: any; onpause: any; onplay: any; onplaying: any; onpopstate: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onresize: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onstalled: any; onstorage: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onunload: any; onvolumechange: any; onwaiting: any; opener: any; orientation: any; readonly outerHeight: any; readonly outerWidth: any; readonly pageXOffset: any; readonly pageYOffset: any; readonly parent: any; readonly performance: any; readonly personalbar: any; readonly screen: any; readonly screenLeft: any; readonly screenTop: any; readonly screenX: any; readonly screenY: any; readonly scrollbars: any; readonly scrollX: any; readonly scrollY: any; readonly self: any; readonly speechSynthesis: any; status: any; readonly statusbar: any; readonly styleMedia: any; readonly toolbar: any; readonly top: any; readonly window: any; URL: any; URLSearchParams: any; Blob: any; customElements: any; alert: any; blur: any; cancelAnimationFrame: any; captureEvents: any; close: any; confirm: any; departFocus: any; focus: any; getComputedStyle: any; getMatchedCSSRules: any; getSelection: any; matchMedia: any; moveBy: any; moveTo: any; msWriteProfilerMark: any; open: any; postMessage: any; print: any; prompt: any; releaseEvents: any; requestAnimationFrame: any; resizeBy: any; resizeTo: any; scroll: any; scrollBy: any; scrollTo: any; stop: any; webkitCancelAnimationFrame: any; webkitConvertPointFromNodeToPage: any; webkitConvertPointFromPageToNode: any; webkitRequestAnimationFrame: any; createImageBitmap: any; addEventListener: any; removeEventListener: any; dispatchEvent: any; clearInterval: any; clearTimeout: any; setInterval: any; setTimeout: any; constructor: any; toString: any; toLocaleString: any; valueOf: any; hasOwnProperty: any; isPrototypeOf: any; propertyIsEnumerable: any; clearImmediate: any; setImmediate: any; readonly sessionStorage: any; readonly localStorage: any; readonly console: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly indexedDB: any; atob: any; btoa: any; fetch: any; }; designMode: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; dir: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly doctype: { readonly entities: any; readonly internalSubset: any; readonly name: any; readonly notations: any; readonly publicId: any; readonly systemId: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; remove: any; }; documentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; domain: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; embeds: { item: any; namedItem: any; readonly length: any; }; fgColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; forms: { item: any; namedItem: any; readonly length: any; }; readonly fullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly fullscreenEnabled: { valueOf: any; }; readonly head: { profile: any; addEventListener: any; removeEventListener: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly hidden: { valueOf: any; }; images: { item: any; namedItem: any; readonly length: any; }; readonly implementation: { createDocument: any; createDocumentType: any; createHTMLDocument: any; hasFeature: any; }; readonly inputEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly lastModified: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; linkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; links: { item: any; namedItem: any; readonly length: any; }; readonly location: { hash: any; host: any; hostname: any; href: any; readonly origin: any; pathname: any; port: any; protocol: any; search: any; assign: any; reload: any; replace: any; toString: any; }; msCapsLockWarningOff: { valueOf: any; }; msCSSOMElementFloatMetrics: { valueOf: any; }; onabort: {}; onactivate: {}; onbeforeactivate: {}; onbeforedeactivate: {}; onblur: {}; oncanplay: {}; oncanplaythrough: {}; onchange: {}; onclick: {}; oncontextmenu: {}; ondblclick: {}; ondeactivate: {}; ondrag: {}; ondragend: {}; ondragenter: {}; ondragleave: {}; ondragover: {}; ondragstart: {}; ondrop: {}; ondurationchange: {}; onemptied: {}; onended: {}; onerror: {}; onfocus: {}; onfullscreenchange: {}; onfullscreenerror: {}; oninput: {}; oninvalid: {}; onkeydown: {}; onkeypress: {}; onkeyup: {}; onload: {}; onloadeddata: {}; onloadedmetadata: {}; onloadstart: {}; onmousedown: {}; onmousemove: {}; onmouseout: {}; onmouseover: {}; onmouseup: {}; onmousewheel: {}; onmscontentzoom: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsinertiastart: {}; onmsmanipulationstatechanged: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; onmssitemodejumplistitemremoved: {}; onmsthumbnailclick: {}; onpause: {}; onplay: {}; onplaying: {}; onpointerlockchange: {}; onpointerlockerror: {}; onprogress: {}; onratechange: {}; onreadystatechange: {}; onreset: {}; onscroll: {}; onseeked: {}; onseeking: {}; onselect: {}; onselectionchange: {}; onselectstart: {}; onstalled: {}; onstop: {}; onsubmit: {}; onsuspend: {}; ontimeupdate: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onvolumechange: {}; onwaiting: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; plugins: { item: any; namedItem: any; readonly length: any; }; readonly pointerLockElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly readyState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly referrer: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly rootElement: { contentScriptType: any; contentStyleType: any; currentScale: any; readonly currentTranslate: any; readonly height: any; onabort: any; onerror: any; onresize: any; onscroll: any; onunload: any; onzoom: any; readonly pixelUnitToMillimeterX: any; readonly pixelUnitToMillimeterY: any; readonly screenPixelToMillimeterX: any; readonly screenPixelToMillimeterY: any; readonly viewport: any; readonly width: any; readonly x: any; readonly y: any; checkEnclosure: any; checkIntersection: any; createSVGAngle: any; createSVGLength: any; createSVGMatrix: any; createSVGNumber: any; createSVGPoint: any; createSVGRect: any; createSVGTransform: any; createSVGTransformFromMatrix: any; deselectAll: any; forceRedraw: any; getComputedStyle: any; getCurrentTime: any; getElementById: any; getEnclosureList: any; getIntersectionList: any; pauseAnimations: any; setCurrentTime: any; suspendRedraw: any; unpauseAnimations: any; unsuspendRedraw: any; unsuspendRedrawAll: any; addEventListener: any; removeEventListener: any; readonly farthestViewportElement: any; readonly nearestViewportElement: any; readonly transform: any; getBBox: any; getCTM: any; getScreenCTM: any; getTransformToElement: any; className: any; onclick: any; ondblclick: any; onfocusin: any; onfocusout: any; onload: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; readonly ownerSVGElement: any; readonly style: any; readonly viewportElement: any; xmlbase: any; readonly classList: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; readonly requiredExtensions: any; readonly requiredFeatures: any; readonly systemLanguage: any; hasExtension: any; createEvent: any; readonly preserveAspectRatio: any; readonly viewBox: any; readonly zoomAndPan: any; }; scripts: { item: any; namedItem: any; readonly length: any; }; readonly scrollingElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly styleSheets: { readonly length: any; item: any; }; title: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URL: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly URLUnencoded: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly visibilityState: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; vlinkColor: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly webkitCurrentFullScreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenElement: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly webkitFullscreenEnabled: { valueOf: any; }; readonly webkitIsFullScreen: { valueOf: any; }; readonly xmlEncoding: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; xmlStandalone: { valueOf: any; }; xmlVersion: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onvisibilitychange: {}; adoptNode: {}; captureEvents: {}; caretRangeFromPoint: {}; clear: {}; close: {}; createAttribute: {}; createAttributeNS: {}; createCDATASection: {}; createComment: {}; createDocumentFragment: {}; createElement: {}; createElementNS: {}; createExpression: {}; createNodeIterator: {}; createNSResolver: {}; createProcessingInstruction: {}; createRange: {}; createTextNode: {}; createTouch: {}; createTouchList: {}; createTreeWalker: {}; elementFromPoint: {}; evaluate: {}; execCommand: {}; execCommandShowHelp: {}; exitFullscreen: {}; exitPointerLock: {}; focus: {}; getElementById: {}; getElementsByClassName: {}; getElementsByName: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; getSelection: {}; hasFocus: {}; importNode: {}; msElementsFromPoint: {}; msElementsFromRect: {}; open: {}; queryCommandEnabled: {}; queryCommandIndeterm: {}; queryCommandState: {}; queryCommandSupported: {}; queryCommandText: {}; queryCommandValue: {}; releaseEvents: {}; updateSettings: {}; webkitCancelFullScreen: {}; webkitExitFullscreen: {}; write: {}; writeln: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; querySelector: {}; querySelectorAll: {}; createEvent: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; elementsFromPoint: {}; } >activeElement : { readonly classList: { readonly length: any; add: any; contains: any; item: any; remove: any; toggle: any; toString: any; }; className: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly clientHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly clientWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; id: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; innerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; msContentZoomFactor: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly msRegionOverflow: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; onariarequest: {}; oncommand: {}; ongotpointercapture: {}; onlostpointercapture: {}; onmsgesturechange: {}; onmsgesturedoubletap: {}; onmsgestureend: {}; onmsgesturehold: {}; onmsgesturestart: {}; onmsgesturetap: {}; onmsgotpointercapture: {}; onmsinertiastart: {}; onmslostpointercapture: {}; onmspointercancel: {}; onmspointerdown: {}; onmspointerenter: {}; onmspointerleave: {}; onmspointermove: {}; onmspointerout: {}; onmspointerover: {}; onmspointerup: {}; ontouchcancel: {}; ontouchend: {}; ontouchmove: {}; ontouchstart: {}; onwebkitfullscreenchange: {}; onwebkitfullscreenerror: {}; outerHTML: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly prefix: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly scrollHeight: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollLeft: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; scrollTop: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly scrollWidth: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly tagName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly assignedSlot: { name: any; assignedNodes: any; accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; slot: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly shadowRoot: { readonly host: any; innerHTML: any; readonly activeElement: any; readonly styleSheets: any; getSelection: any; elementFromPoint: any; elementsFromPoint: any; getElementById: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; querySelector: any; querySelectorAll: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; }; getAttribute: {}; getAttributeNode: {}; getAttributeNodeNS: {}; getAttributeNS: {}; getBoundingClientRect: {}; getClientRects: {}; getElementsByTagName: {}; getElementsByTagNameNS: {}; hasAttribute: {}; hasAttributeNS: {}; msGetRegionContent: {}; msGetUntransformedBounds: {}; msMatchesSelector: {}; msReleasePointerCapture: {}; msSetPointerCapture: {}; msZoomTo: {}; releasePointerCapture: {}; removeAttribute: {}; removeAttributeNode: {}; removeAttributeNS: {}; requestFullscreen: {}; requestPointerLock: {}; setAttribute: {}; setAttributeNode: {}; setAttributeNodeNS: {}; setAttributeNS: {}; setPointerCapture: {}; webkitMatchesSelector: {}; webkitRequestFullscreen: {}; webkitRequestFullScreen: {}; getElementsByClassName: {}; matches: {}; closest: {}; scrollIntoView: {}; scroll: {}; scrollTo: {}; scrollBy: {}; insertAdjacentElement: {}; insertAdjacentHTML: {}; insertAdjacentText: {}; attachShadow: {}; addEventListener: {}; removeEventListener: {}; readonly attributes: { readonly length: any; getNamedItem: any; getNamedItemNS: any; item: any; removeNamedItem: any; removeNamedItemNS: any; setNamedItem: any; setNamedItemNS: any; }; readonly baseURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly childNodes: { readonly length: any; item: any; }; readonly firstChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly lastChild: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly localName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly namespaceURI: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nextSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly nodeName: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly nodeType: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; nodeValue: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; readonly ownerDocument: { readonly activeElement: any; alinkColor: any; readonly all: any; anchors: any; applets: any; bgColor: any; body: any; readonly characterSet: any; charset: any; readonly compatMode: any; cookie: any; readonly currentScript: any; readonly defaultView: any; designMode: any; dir: any; readonly doctype: any; documentElement: any; domain: any; embeds: any; fgColor: any; forms: any; readonly fullscreenElement: any; readonly fullscreenEnabled: any; readonly head: any; readonly hidden: any; images: any; readonly implementation: any; readonly inputEncoding: any; readonly lastModified: any; linkColor: any; links: any; readonly location: any; msCapsLockWarningOff: any; msCSSOMElementFloatMetrics: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforedeactivate: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; onfullscreenchange: any; onfullscreenerror: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsinertiastart: any; onmsmanipulationstatechanged: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; onmssitemodejumplistitemremoved: any; onmsthumbnailclick: any; onpause: any; onplay: any; onplaying: any; onpointerlockchange: any; onpointerlockerror: any; onprogress: any; onratechange: any; onreadystatechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectionchange: any; onselectstart: any; onstalled: any; onstop: any; onsubmit: any; onsuspend: any; ontimeupdate: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onvolumechange: any; onwaiting: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; plugins: any; readonly pointerLockElement: any; readonly readyState: any; readonly referrer: any; readonly rootElement: any; scripts: any; readonly scrollingElement: any; readonly styleSheets: any; title: any; readonly URL: any; readonly URLUnencoded: any; readonly visibilityState: any; vlinkColor: any; readonly webkitCurrentFullScreenElement: any; readonly webkitFullscreenElement: any; readonly webkitFullscreenEnabled: any; readonly webkitIsFullScreen: any; readonly xmlEncoding: any; xmlStandalone: any; xmlVersion: any; onvisibilitychange: any; adoptNode: any; captureEvents: any; caretRangeFromPoint: any; clear: any; close: any; createAttribute: any; createAttributeNS: any; createCDATASection: any; createComment: any; createDocumentFragment: any; createElement: any; createElementNS: any; createExpression: any; createNodeIterator: any; createNSResolver: any; createProcessingInstruction: any; createRange: any; createTextNode: any; createTouch: any; createTouchList: any; createTreeWalker: any; elementFromPoint: any; evaluate: any; execCommand: any; execCommandShowHelp: any; exitFullscreen: any; exitPointerLock: any; focus: any; getElementById: any; getElementsByClassName: any; getElementsByName: any; getElementsByTagName: any; getElementsByTagNameNS: any; getSelection: any; hasFocus: any; importNode: any; msElementsFromPoint: any; msElementsFromRect: any; open: any; queryCommandEnabled: any; queryCommandIndeterm: any; queryCommandState: any; queryCommandSupported: any; queryCommandText: any; queryCommandValue: any; releaseEvents: any; updateSettings: any; webkitCancelFullScreen: any; webkitExitFullscreen: any; write: any; writeln: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; querySelector: any; querySelectorAll: any; createEvent: any; readonly children: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly childElementCount: any; elementsFromPoint: any; }; readonly parentElement: { accessKey: any; readonly children: any; contentEditable: any; readonly dataset: any; dir: any; draggable: any; hidden: any; hideFocus: any; innerText: any; readonly isContentEditable: any; lang: any; readonly offsetHeight: any; readonly offsetLeft: any; readonly offsetParent: any; readonly offsetTop: any; readonly offsetWidth: any; onabort: any; onactivate: any; onbeforeactivate: any; onbeforecopy: any; onbeforecut: any; onbeforedeactivate: any; onbeforepaste: any; onblur: any; oncanplay: any; oncanplaythrough: any; onchange: any; onclick: any; oncontextmenu: any; oncopy: any; oncuechange: any; oncut: any; ondblclick: any; ondeactivate: any; ondrag: any; ondragend: any; ondragenter: any; ondragleave: any; ondragover: any; ondragstart: any; ondrop: any; ondurationchange: any; onemptied: any; onended: any; onerror: any; onfocus: any; oninput: any; oninvalid: any; onkeydown: any; onkeypress: any; onkeyup: any; onload: any; onloadeddata: any; onloadedmetadata: any; onloadstart: any; onmousedown: any; onmouseenter: any; onmouseleave: any; onmousemove: any; onmouseout: any; onmouseover: any; onmouseup: any; onmousewheel: any; onmscontentzoom: any; onmsmanipulationstatechanged: any; onpaste: any; onpause: any; onplay: any; onplaying: any; onprogress: any; onratechange: any; onreset: any; onscroll: any; onseeked: any; onseeking: any; onselect: any; onselectstart: any; onstalled: any; onsubmit: any; onsuspend: any; ontimeupdate: any; onvolumechange: any; onwaiting: any; outerText: any; spellcheck: any; readonly style: any; tabIndex: any; title: any; blur: any; click: any; dragDrop: any; focus: any; msGetInputContext: any; animate: any; addEventListener: any; removeEventListener: any; readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; }; readonly parentNode: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; readonly previousSibling: { readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; addEventListener: any; dispatchEvent: any; removeEventListener: any; }; textContent: { toString: any; charAt: any; charCodeAt: any; concat: any; indexOf: any; lastIndexOf: any; localeCompare: any; match: any; replace: any; search: any; slice: any; split: any; substring: any; toLowerCase: any; toLocaleLowerCase: any; toUpperCase: any; toLocaleUpperCase: any; trim: any; readonly length: any; substr: any; valueOf: any; [Symbol.iterator]: any; codePointAt: any; includes: any; endsWith: any; normalize: any; repeat: any; startsWith: any; anchor: any; big: any; blink: any; bold: any; fixed: any; fontcolor: any; fontsize: any; italics: any; link: any; small: any; strike: any; sub: any; sup: any; }; appendChild: {}; cloneNode: {}; compareDocumentPosition: {}; contains: {}; hasAttributes: {}; hasChildNodes: {}; insertBefore: {}; isDefaultNamespace: {}; isEqualNode: {}; isSameNode: {}; lookupNamespaceURI: {}; lookupPrefix: {}; normalize: {}; removeChild: {}; replaceChild: {}; readonly ATTRIBUTE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly CDATA_SECTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly COMMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_FRAGMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINED_BY: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_CONTAINS: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_DISCONNECTED: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_FOLLOWING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_POSITION_PRECEDING: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly DOCUMENT_TYPE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ELEMENT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly ENTITY_REFERENCE_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly NOTATION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly PROCESSING_INSTRUCTION_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly TEXT_NODE: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; dispatchEvent: {}; onpointercancel: {}; onpointerdown: {}; onpointerenter: {}; onpointerleave: {}; onpointermove: {}; onpointerout: {}; onpointerover: {}; onpointerup: {}; onwheel: {}; readonly childElementCount: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; readonly firstElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly lastElementChild: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly nextElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; readonly previousElementSibling: { readonly classList: any; className: any; readonly clientHeight: any; readonly clientLeft: any; readonly clientTop: any; readonly clientWidth: any; id: any; innerHTML: any; msContentZoomFactor: any; readonly msRegionOverflow: any; onariarequest: any; oncommand: any; ongotpointercapture: any; onlostpointercapture: any; onmsgesturechange: any; onmsgesturedoubletap: any; onmsgestureend: any; onmsgesturehold: any; onmsgesturestart: any; onmsgesturetap: any; onmsgotpointercapture: any; onmsinertiastart: any; onmslostpointercapture: any; onmspointercancel: any; onmspointerdown: any; onmspointerenter: any; onmspointerleave: any; onmspointermove: any; onmspointerout: any; onmspointerover: any; onmspointerup: any; ontouchcancel: any; ontouchend: any; ontouchmove: any; ontouchstart: any; onwebkitfullscreenchange: any; onwebkitfullscreenerror: any; outerHTML: any; readonly prefix: any; readonly scrollHeight: any; scrollLeft: any; scrollTop: any; readonly scrollWidth: any; readonly tagName: any; readonly assignedSlot: any; slot: any; readonly shadowRoot: any; getAttribute: any; getAttributeNode: any; getAttributeNodeNS: any; getAttributeNS: any; getBoundingClientRect: any; getClientRects: any; getElementsByTagName: any; getElementsByTagNameNS: any; hasAttribute: any; hasAttributeNS: any; msGetRegionContent: any; msGetUntransformedBounds: any; msMatchesSelector: any; msReleasePointerCapture: any; msSetPointerCapture: any; msZoomTo: any; releasePointerCapture: any; removeAttribute: any; removeAttributeNode: any; removeAttributeNS: any; requestFullscreen: any; requestPointerLock: any; setAttribute: any; setAttributeNode: any; setAttributeNodeNS: any; setAttributeNS: any; setPointerCapture: any; webkitMatchesSelector: any; webkitRequestFullscreen: any; webkitRequestFullScreen: any; getElementsByClassName: any; matches: any; closest: any; scrollIntoView: any; scroll: any; scrollTo: any; scrollBy: any; insertAdjacentElement: any; insertAdjacentHTML: any; insertAdjacentText: any; attachShadow: any; addEventListener: any; removeEventListener: any; readonly attributes: any; readonly baseURI: any; readonly childNodes: any; readonly firstChild: any; readonly lastChild: any; readonly localName: any; readonly namespaceURI: any; readonly nextSibling: any; readonly nodeName: any; readonly nodeType: any; nodeValue: any; readonly ownerDocument: any; readonly parentElement: any; readonly parentNode: any; readonly previousSibling: any; textContent: any; appendChild: any; cloneNode: any; compareDocumentPosition: any; contains: any; hasAttributes: any; hasChildNodes: any; insertBefore: any; isDefaultNamespace: any; isEqualNode: any; isSameNode: any; lookupNamespaceURI: any; lookupPrefix: any; normalize: any; removeChild: any; replaceChild: any; readonly ATTRIBUTE_NODE: any; readonly CDATA_SECTION_NODE: any; readonly COMMENT_NODE: any; readonly DOCUMENT_FRAGMENT_NODE: any; readonly DOCUMENT_NODE: any; readonly DOCUMENT_POSITION_CONTAINED_BY: any; readonly DOCUMENT_POSITION_CONTAINS: any; readonly DOCUMENT_POSITION_DISCONNECTED: any; readonly DOCUMENT_POSITION_FOLLOWING: any; readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: any; readonly DOCUMENT_POSITION_PRECEDING: any; readonly DOCUMENT_TYPE_NODE: any; readonly ELEMENT_NODE: any; readonly ENTITY_NODE: any; readonly ENTITY_REFERENCE_NODE: any; readonly NOTATION_NODE: any; readonly PROCESSING_INSTRUCTION_NODE: any; readonly TEXT_NODE: any; dispatchEvent: any; onpointercancel: any; onpointerdown: any; onpointerenter: any; onpointerleave: any; onpointermove: any; onpointerout: any; onpointerover: any; onpointerup: any; onwheel: any; readonly childElementCount: any; readonly firstElementChild: any; readonly lastElementChild: any; readonly nextElementSibling: any; readonly previousElementSibling: any; querySelector: any; querySelectorAll: any; remove: any; readonly children: any; }; querySelector: {}; querySelectorAll: {}; remove: {}; readonly children: { namedItem: any; readonly length: any; item: any; }; } >className : { toString: {}; charAt: {}; charCodeAt: {}; concat: {}; indexOf: {}; lastIndexOf: {}; localeCompare: {}; match: {}; replace: {}; search: {}; slice: {}; split: {}; substring: {}; toLowerCase: {}; toLocaleLowerCase: {}; toUpperCase: {}; toLocaleUpperCase: {}; trim: {}; readonly length: { toString: any; toFixed: any; toExponential: any; toPrecision: any; valueOf: any; toLocaleString: any; }; substr: {}; valueOf: {}; [Symbol.iterator]: {}; codePointAt: {}; includes: {}; endsWith: {}; normalize: {}; repeat: {}; startsWith: {}; anchor: {}; big: {}; blink: {}; bold: {}; fixed: {}; fontcolor: {}; fontsize: {}; italics: {}; link: {}; small: {}; strike: {}; sub: {}; sup: {}; } From 7adcd663f8a3c2aeb2705e41ca8337da0d40f562 Mon Sep 17 00:00:00 2001 From: csigs Date: Wed, 28 Feb 2018 23:10:37 +0000 Subject: [PATCH 250/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl index be0db6f399c..91b2ba9c341 100644 --- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -912,6 +912,15 @@ + + + + + + + + + @@ -924,6 +933,15 @@ + + + + + + + + + @@ -948,6 +966,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index a1515e25bc4..94dc752de40 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -903,6 +903,15 @@ + + + + + + + + + @@ -915,6 +924,15 @@ + + + + + + + + + @@ -939,6 +957,15 @@ + + + + + + + + + From 7a31192ecbf7c54a324faf08df57d3326f1f1a36 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Feb 2018 15:43:13 -0800 Subject: [PATCH 251/298] Stop binding type predicate types twice (#22210) --- src/compiler/binder.ts | 13 +------------ .../typeGuardOnContainerTypeNoHang.js | 18 ++++++++++++++++++ .../typeGuardOnContainerTypeNoHang.symbols | 15 +++++++++++++++ .../typeGuardOnContainerTypeNoHang.types | 19 +++++++++++++++++++ .../typeGuardOnContainerTypeNoHang.ts | 6 ++++++ 5 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 tests/baselines/reference/typeGuardOnContainerTypeNoHang.js create mode 100644 tests/baselines/reference/typeGuardOnContainerTypeNoHang.symbols create mode 100644 tests/baselines/reference/typeGuardOnContainerTypeNoHang.types create mode 100644 tests/cases/compiler/typeGuardOnContainerTypeNoHang.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 782363dd6df..86c9c97bdd5 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2071,7 +2071,7 @@ namespace ts { seenThisKeyword = true; return; case SyntaxKind.TypePredicate: - return checkTypePredicate(node as TypePredicateNode); + break; // Binding the children will handle everything case SyntaxKind.TypeParameter: return bindTypeParameter(node as TypeParameterDeclaration); case SyntaxKind.Parameter: @@ -2204,17 +2204,6 @@ namespace ts { return bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, InternalSymbolName.Type); } - function checkTypePredicate(node: TypePredicateNode) { - const { parameterName, type } = node; - if (parameterName && parameterName.kind === SyntaxKind.Identifier) { - checkStrictModeIdentifier(parameterName); - } - if (parameterName && parameterName.kind === SyntaxKind.ThisType) { - seenThisKeyword = true; - } - bind(type); - } - function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (isExternalModule(file)) { diff --git a/tests/baselines/reference/typeGuardOnContainerTypeNoHang.js b/tests/baselines/reference/typeGuardOnContainerTypeNoHang.js new file mode 100644 index 00000000000..238676b7974 --- /dev/null +++ b/tests/baselines/reference/typeGuardOnContainerTypeNoHang.js @@ -0,0 +1,18 @@ +//// [typeGuardOnContainerTypeNoHang.ts] +export namespace TypeGuards { + export function IsObject(value: any) : value is {[index:string]:any} { + return typeof(value) === 'object' + } + +} + +//// [typeGuardOnContainerTypeNoHang.js] +"use strict"; +exports.__esModule = true; +var TypeGuards; +(function (TypeGuards) { + function IsObject(value) { + return typeof (value) === 'object'; + } + TypeGuards.IsObject = IsObject; +})(TypeGuards = exports.TypeGuards || (exports.TypeGuards = {})); diff --git a/tests/baselines/reference/typeGuardOnContainerTypeNoHang.symbols b/tests/baselines/reference/typeGuardOnContainerTypeNoHang.symbols new file mode 100644 index 00000000000..eacc6b7f100 --- /dev/null +++ b/tests/baselines/reference/typeGuardOnContainerTypeNoHang.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/typeGuardOnContainerTypeNoHang.ts === +export namespace TypeGuards { +>TypeGuards : Symbol(TypeGuards, Decl(typeGuardOnContainerTypeNoHang.ts, 0, 0)) + + export function IsObject(value: any) : value is {[index:string]:any} { +>IsObject : Symbol(IsObject, Decl(typeGuardOnContainerTypeNoHang.ts, 0, 29)) +>value : Symbol(value, Decl(typeGuardOnContainerTypeNoHang.ts, 1, 29)) +>value : Symbol(value, Decl(typeGuardOnContainerTypeNoHang.ts, 1, 29)) +>index : Symbol(index, Decl(typeGuardOnContainerTypeNoHang.ts, 1, 54)) + + return typeof(value) === 'object' +>value : Symbol(value, Decl(typeGuardOnContainerTypeNoHang.ts, 1, 29)) + } + +} diff --git a/tests/baselines/reference/typeGuardOnContainerTypeNoHang.types b/tests/baselines/reference/typeGuardOnContainerTypeNoHang.types new file mode 100644 index 00000000000..cc7d90e76df --- /dev/null +++ b/tests/baselines/reference/typeGuardOnContainerTypeNoHang.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/typeGuardOnContainerTypeNoHang.ts === +export namespace TypeGuards { +>TypeGuards : typeof TypeGuards + + export function IsObject(value: any) : value is {[index:string]:any} { +>IsObject : (value: any) => value is { [index: string]: any; } +>value : any +>value : any +>index : string + + return typeof(value) === 'object' +>typeof(value) === 'object' : boolean +>typeof(value) : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" +>(value) : any +>value : any +>'object' : "object" + } + +} diff --git a/tests/cases/compiler/typeGuardOnContainerTypeNoHang.ts b/tests/cases/compiler/typeGuardOnContainerTypeNoHang.ts new file mode 100644 index 00000000000..faab957a4a2 --- /dev/null +++ b/tests/cases/compiler/typeGuardOnContainerTypeNoHang.ts @@ -0,0 +1,6 @@ +export namespace TypeGuards { + export function IsObject(value: any) : value is {[index:string]:any} { + return typeof(value) === 'object' + } + +} \ No newline at end of file From 62185673fd2a9d9c8af2c2d7034309fd4058cde3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Feb 2018 15:44:12 -0800 Subject: [PATCH 252/298] Emit unqiue symbols with typeof if possible before issuing an error (#21403) --- src/compiler/checker.ts | 3 +++ src/harness/typeWriter.ts | 2 +- .../indirectUniqueSymbolDeclarationEmit.js | 23 ++++++++++++++++++ ...ndirectUniqueSymbolDeclarationEmit.symbols | 20 ++++++++++++++++ .../indirectUniqueSymbolDeclarationEmit.types | 24 +++++++++++++++++++ .../indirectUniqueSymbolDeclarationEmit.ts | 8 +++++++ 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.js create mode 100644 tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.symbols create mode 100644 tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.types create mode 100644 tests/cases/compiler/indirectUniqueSymbolDeclarationEmit.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 63b8d18c451..98529f2b8f3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2898,6 +2898,9 @@ namespace ts { } if (type.flags & TypeFlags.UniqueESSymbol) { if (!(context.flags & NodeBuilderFlags.AllowUniqueESSymbolType)) { + if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) { + return createTypeQueryNode(symbolToName(type.symbol, context, SymbolFlags.Value, /*expectsIdentifier*/ false)); + } if (context.tracker.reportInaccessibleUniqueSymbolError) { context.tracker.reportInaccessibleUniqueSymbolError(); } diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index bc25bfd12d6..060dacebdca 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -79,7 +79,7 @@ class TypeWriterWalker { // Workaround to ensure we output 'C' instead of 'typeof C' for base class expressions // let type = this.checker.getTypeAtLocation(node); const type = node.parent && ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent) && this.checker.getTypeAtLocation(node.parent) || this.checker.getTypeAtLocation(node); - const typeString = type ? this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation) : "No type information available!"; + const typeString = type ? this.checker.typeToString(type, node.parent, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.AllowUniqueESSymbolType) : "No type information available!"; return { line: lineAndCharacter.line, syntaxKind: node.kind, diff --git a/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.js b/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.js new file mode 100644 index 00000000000..d3f312ae82e --- /dev/null +++ b/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.js @@ -0,0 +1,23 @@ +//// [indirectUniqueSymbolDeclarationEmit.ts] +export const x = Symbol(); +export const y = Symbol(); +declare function rand(): boolean; +export function f() { + return rand() ? x : y; +} + +//// [indirectUniqueSymbolDeclarationEmit.js] +"use strict"; +exports.__esModule = true; +exports.x = Symbol(); +exports.y = Symbol(); +function f() { + return rand() ? exports.x : exports.y; +} +exports.f = f; + + +//// [indirectUniqueSymbolDeclarationEmit.d.ts] +export declare const x: unique symbol; +export declare const y: unique symbol; +export declare function f(): typeof x | typeof y; diff --git a/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.symbols b/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.symbols new file mode 100644 index 00000000000..9f205084ecb --- /dev/null +++ b/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.symbols @@ -0,0 +1,20 @@ +=== tests/cases/compiler/indirectUniqueSymbolDeclarationEmit.ts === +export const x = Symbol(); +>x : Symbol(x, Decl(indirectUniqueSymbolDeclarationEmit.ts, 0, 12)) +>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) + +export const y = Symbol(); +>y : Symbol(y, Decl(indirectUniqueSymbolDeclarationEmit.ts, 1, 12)) +>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) + +declare function rand(): boolean; +>rand : Symbol(rand, Decl(indirectUniqueSymbolDeclarationEmit.ts, 1, 26)) + +export function f() { +>f : Symbol(f, Decl(indirectUniqueSymbolDeclarationEmit.ts, 2, 33)) + + return rand() ? x : y; +>rand : Symbol(rand, Decl(indirectUniqueSymbolDeclarationEmit.ts, 1, 26)) +>x : Symbol(x, Decl(indirectUniqueSymbolDeclarationEmit.ts, 0, 12)) +>y : Symbol(y, Decl(indirectUniqueSymbolDeclarationEmit.ts, 1, 12)) +} diff --git a/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.types b/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.types new file mode 100644 index 00000000000..f50010d8f53 --- /dev/null +++ b/tests/baselines/reference/indirectUniqueSymbolDeclarationEmit.types @@ -0,0 +1,24 @@ +=== tests/cases/compiler/indirectUniqueSymbolDeclarationEmit.ts === +export const x = Symbol(); +>x : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +export const y = Symbol(); +>y : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +declare function rand(): boolean; +>rand : () => boolean + +export function f() { +>f : () => unique symbol | unique symbol + + return rand() ? x : y; +>rand() ? x : y : unique symbol | unique symbol +>rand() : boolean +>rand : () => boolean +>x : unique symbol +>y : unique symbol +} diff --git a/tests/cases/compiler/indirectUniqueSymbolDeclarationEmit.ts b/tests/cases/compiler/indirectUniqueSymbolDeclarationEmit.ts new file mode 100644 index 00000000000..5554c5d05c3 --- /dev/null +++ b/tests/cases/compiler/indirectUniqueSymbolDeclarationEmit.ts @@ -0,0 +1,8 @@ +// @lib: es6 +// @declaration: true +export const x = Symbol(); +export const y = Symbol(); +declare function rand(): boolean; +export function f() { + return rand() ? x : y; +} \ No newline at end of file From 1a43ad01a738f3628322a4985cc7179281ea3542 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Feb 2018 15:48:33 -0800 Subject: [PATCH 253/298] Lookup JSX namespace within factory function (#22207) * Lookup JSX namespace within factory function * Rename functions --- src/compiler/checker.ts | 171 +++----- src/compiler/types.ts | 2 +- src/services/completions.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- ...sxFactoryDeclarationsLocalTypes.errors.txt | 129 ++++++ .../inlineJsxFactoryDeclarationsLocalTypes.js | 164 ++++++++ ...neJsxFactoryDeclarationsLocalTypes.symbols | 346 +++++++++++++++ ...lineJsxFactoryDeclarationsLocalTypes.types | 394 ++++++++++++++++++ ...xFactoryLocalTypeGlobalFallback.errors.txt | 51 +++ ...inlineJsxFactoryLocalTypeGlobalFallback.js | 61 +++ ...eJsxFactoryLocalTypeGlobalFallback.symbols | 107 +++++ ...ineJsxFactoryLocalTypeGlobalFallback.types | 110 +++++ .../tsxElementResolution16.errors.txt | 5 +- ...inlineJsxFactoryDeclarationsLocalTypes.tsx | 86 ++++ ...nlineJsxFactoryLocalTypeGlobalFallback.tsx | 44 ++ 16 files changed, 1561 insertions(+), 115 deletions(-) create mode 100644 tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt create mode 100644 tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.js create mode 100644 tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.symbols create mode 100644 tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.types create mode 100644 tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.errors.txt create mode 100644 tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.js create mode 100644 tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.symbols create mode 100644 tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.types create mode 100644 tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarationsLocalTypes.tsx create mode 100644 tests/cases/conformance/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallback.tsx diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 98529f2b8f3..e7ff00df556 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -260,7 +260,7 @@ namespace ts { node = getParseTreeNode(node, isJsxOpeningLikeElement); return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; }, - getJsxIntrinsicTagNames, + getJsxIntrinsicTagNamesAt, isOptionalParameter: node => { node = getParseTreeNode(node, isParameter); return node ? isOptionalParameter(node) : false; @@ -417,9 +417,6 @@ namespace ts { let deferredGlobalAsyncIteratorType: GenericType; let deferredGlobalAsyncIterableIteratorType: GenericType; let deferredGlobalTemplateStringsArrayType: ObjectType; - let deferredJsxElementClassType: Type; - let deferredJsxElementType: Type; - let deferredJsxStatelessElementType: Type; let deferredNodes: Node[]; let deferredUnusedIdentifierNodes: Node[]; @@ -545,13 +542,6 @@ namespace ts { let _jsxNamespace: __String; let _jsxFactoryEntity: EntityName; - let _jsxElementPropertiesName: __String; - let _hasComputedJsxElementPropertiesName = false; - let _jsxElementChildrenPropertyName: __String; - let _hasComputedJsxElementChildrenPropertyName = false; - - /** Things we lazy load from the JSX namespace */ - const jsxTypes = createUnderscoreEscapedMap(); const subtypeRelation = createMap(); const assignableRelation = createMap(); @@ -7524,16 +7514,6 @@ namespace ts { return symbol && getTypeOfGlobalSymbol(symbol, arity); } - /** - * Returns a type that is inside a namespace at the global scope, e.g. - * getExportedTypeFromNamespace('JSX', 'Element') returns the JSX.Element type - */ - function getExportedTypeFromNamespace(namespace: __String, name: __String): Type { - const namespaceSymbol = getGlobalSymbol(namespace, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined); - const typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, SymbolFlags.Type); - return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); - } - /** * Instantiates a global type that is generic with some element type, and returns that instantiation. */ @@ -14348,7 +14328,7 @@ namespace ts { function getContextualTypeForChildJsxExpression(node: JsxElement) { const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) - const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; } @@ -14502,18 +14482,10 @@ namespace ts { } const isJs = isInJavaScriptFile(node); - return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + return mapType(valueType, t => getJsxSignaturesParameterTypes(t, isJs, node)); } - function getJsxSignaturesParameterTypes(valueType: Type) { - return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ false); - } - - function getJsxSignaturesParameterTypesJs(valueType: Type) { - return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ true); - } - - function getJsxSignaturesParameterTypesInternal(valueType: Type, isJs: boolean) { + function getJsxSignaturesParameterTypes(valueType: Type, isJs: boolean, context: Node) { // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type if (valueType.flags & TypeFlags.String) { return anyType; @@ -14523,7 +14495,7 @@ namespace ts { // For example: // var CustomTag: "h1" = "h1"; // Hello World - const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, context); if (intrinsicElementsType !== unknownType) { const stringLiteralTypeName = (valueType).value; const intrinsicProp = getPropertyOfType(intrinsicElementsType, escapeLeadingUnderscores(stringLiteralTypeName)); @@ -14551,24 +14523,24 @@ namespace ts { } } - return getUnionType(map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), UnionReduction.None); + return getUnionType(map(signatures, ctor ? t => getJsxPropsTypeFromConstructSignature(t, isJs, context) : t => getJsxPropsTypeFromCallSignature(t, context)), UnionReduction.None); } - function getJsxPropsTypeFromCallSignature(sig: Signature) { + function getJsxPropsTypeFromCallSignature(sig: Signature, context: Node) { let propsType = getTypeOfFirstParameterOfSignature(sig); - const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== unknownType) { propsType = intersectTypes(intrinsicAttribs, propsType); } return propsType; } - function getJsxPropsTypeFromClassType(hostClassType: Type, isJs: boolean) { + function getJsxPropsTypeFromClassType(hostClassType: Type, isJs: boolean, context: Node) { if (isTypeAny(hostClassType)) { return hostClassType; } - const propsName = getJsxElementPropertiesName(); + const propsName = getJsxElementPropertiesName(getJsxNamespaceAt(context)); if (propsName === undefined) { // There is no type ElementAttributesProperty, return 'any' return anyType; @@ -14591,7 +14563,7 @@ namespace ts { else { // Normal case -- add in IntrinsicClassElements and IntrinsicElements let apparentAttributesType = attributesType; - const intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + const intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context); if (intrinsicClassAttribs !== unknownType) { const typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); apparentAttributesType = intersectTypes( @@ -14602,7 +14574,7 @@ namespace ts { ); } - const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + const intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== unknownType) { apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); } @@ -14612,20 +14584,12 @@ namespace ts { } } - function getJsxPropsTypeFromConstructSignatureJs(sig: Signature) { - return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ true); - } - - function getJsxPropsTypeFromConstructSignature(sig: Signature) { - return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ false); - } - - function getJsxPropsTypeFromConstructSignatureInternal(sig: Signature, isJs: boolean) { + function getJsxPropsTypeFromConstructSignature(sig: Signature, isJs: boolean, context: Node) { const hostClassType = getReturnTypeOfSignature(sig); if (hostClassType) { - return getJsxPropsTypeFromClassType(hostClassType, isJs); + return getJsxPropsTypeFromClassType(hostClassType, isJs, context); } - return getJsxPropsTypeFromCallSignature(sig); + return getJsxPropsTypeFromCallSignature(sig, context); } @@ -15080,7 +15044,7 @@ namespace ts { function checkJsxSelfClosingElement(node: JsxSelfClosingElement, checkMode: CheckMode): Type { checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } function checkJsxElement(node: JsxElement, checkMode: CheckMode): Type { @@ -15095,7 +15059,7 @@ namespace ts { checkExpression(node.closingElement.tagName); } - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } function checkJsxFragment(node: JsxFragment, checkMode: CheckMode): Type { @@ -15107,7 +15071,7 @@ namespace ts { : Diagnostics.JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma); } - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } /** @@ -15156,7 +15120,7 @@ namespace ts { let hasSpreadAnyType = false; let typeToIntersect: Type; let explicitlySpecifyChildrenAttribute = false; - const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement)); for (const attributeDecl of attributes.properties) { const member = attributeDecl.symbol; @@ -15272,12 +15236,11 @@ namespace ts { return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } - function getJsxType(name: __String) { - let jsxType = jsxTypes.get(name); - if (jsxType === undefined) { - jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); - } - return jsxType; + function getJsxType(name: __String, location: Node) { + const namespace = getJsxNamespaceAt(location); + const exports = namespace && getExportsOfSymbol(namespace); + const typeSymbol = exports && getSymbol(exports, name, SymbolFlags.Type); + return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : unknownType; } /** @@ -15289,7 +15252,7 @@ namespace ts { function getIntrinsicTagSymbol(node: JsxOpeningLikeElement | JsxClosingElement): Symbol { const links = getNodeLinks(node); if (!links.resolvedSymbol) { - const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node); if (intrinsicElementsType !== unknownType) { // Property case if (!isIdentifier(node.tagName)) throw Debug.fail(); @@ -15361,6 +15324,19 @@ namespace ts { return getUnionType(map(instantiatedSignatures, getReturnTypeOfSignature), UnionReduction.Subtype); } + function getJsxNamespaceAt(location: Node) { + const namespaceName = getJsxNamespace(location); + const resolvedNamespace = resolveName(location, namespaceName, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + if (resolvedNamespace) { + const candidate = getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, SymbolFlags.Namespace); + if (candidate) { + return candidate; + } + } + // JSX global fallback + return getGlobalSymbol(JsxNames.JSX, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined); + } + /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. * Get a single property from that container if existed. Report an error if there are more than one property. @@ -15368,9 +15344,7 @@ namespace ts { * @param nameOfAttribPropContainer a string of value JsxNames.ElementAttributesPropertyNameContainer or JsxNames.ElementChildrenAttributeNameContainer * if other string is given or the container doesn't exist, return undefined. */ - function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer: __String): __String { - // JSX - const jsxNamespace = getGlobalSymbol(JsxNames.JSX, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined); + function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer: __String, jsxNamespace: Symbol): __String { // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [symbol] const jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, SymbolFlags.Type); // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [type] @@ -15400,22 +15374,12 @@ namespace ts { /// non-intrinsic elements' attributes type is 'any'), /// or '' if it has 0 properties (which means every /// non-intrinsic elements' attributes type is the element instance type) - function getJsxElementPropertiesName() { - if (!_hasComputedJsxElementPropertiesName) { - _hasComputedJsxElementPropertiesName = true; - _jsxElementPropertiesName = getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer); - } - - return _jsxElementPropertiesName; + function getJsxElementPropertiesName(jsxNamespace: Symbol) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace); } - function getJsxElementChildrenPropertyName(): __String { - if (!_hasComputedJsxElementChildrenPropertyName) { - _hasComputedJsxElementChildrenPropertyName = true; - _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); - } - - return _jsxElementChildrenPropertyName; + function getJsxElementChildrenPropertyName(jsxNamespace: Symbol): __String { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } function getApparentTypeOfJsxPropsType(propsType: Type): Type { @@ -15445,7 +15409,7 @@ namespace ts { function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement: JsxOpeningLikeElement, elementType: Type, elemInstanceType: Type, elementClassType?: Type): Type { Debug.assert(!(elementType.flags & TypeFlags.Union)); if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { - const jsxStatelessElementType = getJsxGlobalStatelessElementType(); + const jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement); if (jsxStatelessElementType) { // We don't call getResolvedSignature here because we have already resolve the type of JSX Element. const callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined); @@ -15455,7 +15419,7 @@ namespace ts { paramType = getApparentTypeOfJsxPropsType(paramType); if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { // Intersect in JSX.IntrinsicAttributes if it exists - const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement); if (intrinsicAttributes !== unknownType) { paramType = intersectTypes(intrinsicAttributes, paramType); } @@ -15481,7 +15445,7 @@ namespace ts { Debug.assert(!(elementType.flags & TypeFlags.Union)); if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type - const jsxStatelessElementType = getJsxGlobalStatelessElementType(); + const jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement); if (jsxStatelessElementType) { // We don't call getResolvedSignature because here we have already resolve the type of JSX Element. const candidatesOutArray: Signature[] = []; @@ -15514,7 +15478,7 @@ namespace ts { result = allMatchingAttributesType; } // Intersect in JSX.IntrinsicAttributes if it exists - const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement); if (intrinsicAttributes !== unknownType) { result = intersectTypes(intrinsicAttributes, result); } @@ -15563,7 +15527,7 @@ namespace ts { // For example: // var CustomTag: "h1" = "h1"; // Hello World - const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, openingLikeElement); if (intrinsicElementsType !== unknownType) { const stringLiteralTypeName = (elementType).value; const intrinsicProp = getPropertyOfType(intrinsicElementsType, escapeLeadingUnderscores(stringLiteralTypeName)); @@ -15598,7 +15562,7 @@ namespace ts { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - return getJsxPropsTypeFromClassType(elemInstanceType, isInJavaScriptFile(openingLikeElement)); + return getJsxPropsTypeFromClassType(elemInstanceType, isInJavaScriptFile(openingLikeElement), openingLikeElement); } /** @@ -15631,7 +15595,7 @@ namespace ts { * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component */ function getCustomJsxElementAttributesType(node: JsxOpeningLikeElement, shouldIncludeAllStatelessAttributesType: boolean): Type { - return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxElementClassTypeAt(node)); } /** @@ -15675,35 +15639,28 @@ namespace ts { return prop || unknownSymbol; } - function getJsxGlobalElementClassType(): Type { - if (!deferredJsxElementClassType) { - deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); - } - return deferredJsxElementClassType; + function getJsxElementClassTypeAt(location: Node): Type { + const type = getJsxType(JsxNames.ElementClass, location); + if (type === unknownType) return undefined; + return type; } - function getJsxGlobalElementType(): Type { - if (!deferredJsxElementType) { - deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); - } - return deferredJsxElementType; + function getJsxElementTypeAt(location: Node): Type { + return getJsxType(JsxNames.Element, location); } - function getJsxGlobalStatelessElementType(): Type { - if (!deferredJsxStatelessElementType) { - const jsxElementType = getJsxGlobalElementType(); - if (jsxElementType) { - deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); - } + function getJsxStatelessElementTypeAt(location: Node): Type { + const jsxElementType = getJsxElementTypeAt(location); + if (jsxElementType) { + return getUnionType([jsxElementType, nullType]); } - return deferredJsxStatelessElementType; } /** * Returns all the properties of the Jsx.IntrinsicElements interface */ - function getJsxIntrinsicTagNames(): Symbol[] { - const intrinsics = getJsxType(JsxNames.IntrinsicElements); + function getJsxIntrinsicTagNamesAt(location: Node): Symbol[] { + const intrinsics = getJsxType(JsxNames.IntrinsicElements, location); return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray; } @@ -15713,7 +15670,7 @@ namespace ts { error(errorNode, Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (getJsxGlobalElementType() === undefined) { + if (getJsxElementTypeAt(errorNode) === undefined) { if (noImplicitAny) { error(errorNode, Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } @@ -15813,7 +15770,7 @@ namespace ts { // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { - error(openingLikeElement, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(getJsxElementPropertiesName())); + error(openingLikeElement, Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, unescapeLeadingUnderscores(getJsxElementPropertiesName(getJsxNamespaceAt(openingLikeElement)))); } else { // Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties diff --git a/src/compiler/types.ts b/src/compiler/types.ts index c40af194971..3be8602f6d2 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2871,7 +2871,7 @@ namespace ts { /* @internal */ getExportsAndPropertiesOfModule(moduleSymbol: Symbol): Symbol[]; getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type | undefined; - getJsxIntrinsicTagNames(): Symbol[]; + getJsxIntrinsicTagNamesAt(location: Node): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; diff --git a/src/services/completions.ts b/src/services/completions.ts index d07c2f494da..640cb5bedf3 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -943,7 +943,7 @@ namespace ts.Completions { getTypeScriptMemberSymbols(); } else if (isRightOfOpenTag) { - const tagSymbols = Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNames(), "getJsxIntrinsicTagNames() should all be defined"); + const tagSymbols = Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNamesAt(location), "getJsxIntrinsicTagNames() should all be defined"); if (tryGetGlobalSymbols()) { symbols = tagSymbols.concat(symbols.filter(s => !!(s.flags & (SymbolFlags.Value | SymbolFlags.Alias)))); } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 23af7487675..43ebec6ad24 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1811,7 +1811,7 @@ declare namespace ts { getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type | undefined; - getJsxIntrinsicTagNames(): Symbol[]; + getJsxIntrinsicTagNamesAt(location: Node): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index ab4e3aeff8c..f111d09013b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1811,7 +1811,7 @@ declare namespace ts { getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type | undefined; - getJsxIntrinsicTagNames(): Symbol[]; + getJsxIntrinsicTagNamesAt(location: Node): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt new file mode 100644 index 00000000000..438d492d020 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.errors.txt @@ -0,0 +1,129 @@ +tests/cases/conformance/jsx/inline/index.tsx(5,1): error TS2322: Type 'dom.JSX.Element' is not assignable to type 'predom.JSX.Element'. + Property '__predomBrand' is missing in type 'Element'. +tests/cases/conformance/jsx/inline/index.tsx(21,21): error TS2605: JSX element type 'Element' is not a constructor function for JSX elements. + Property 'render' is missing in type 'Element'. +tests/cases/conformance/jsx/inline/index.tsx(21,28): error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ children?: Element[]; }'. + Types of property 'children' are incompatible. + Type 'dom.JSX.Element[]' is not assignable to type 'predom.JSX.Element[]'. + Type 'dom.JSX.Element' is not assignable to type 'predom.JSX.Element'. +tests/cases/conformance/jsx/inline/index.tsx(21,40): error TS2605: JSX element type 'MyClass' is not a constructor function for JSX elements. +tests/cases/conformance/jsx/inline/index.tsx(21,40): error TS2605: JSX element type 'MyClass' is not a constructor function for JSX elements. + Property '__domBrand' is missing in type 'MyClass'. +tests/cases/conformance/jsx/inline/index.tsx(21,63): error TS2605: JSX element type 'MyClass' is not a constructor function for JSX elements. +tests/cases/conformance/jsx/inline/index.tsx(24,30): error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ x: number; y: number; children?: Element[]; }'. + Types of property 'children' are incompatible. + Type 'predom.JSX.Element[]' is not assignable to type 'dom.JSX.Element[]'. + Type 'predom.JSX.Element' is not assignable to type 'dom.JSX.Element'. + Property '__domBrand' is missing in type 'Element'. + + +==== tests/cases/conformance/jsx/inline/renderer.d.ts (0 errors) ==== + export namespace dom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __domBrand: void; + props: { + children?: Element[]; + }; + } + interface ElementClass extends Element { + render(): Element; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } + } + export function dom(): dom.JSX.Element; +==== tests/cases/conformance/jsx/inline/renderer2.d.ts (0 errors) ==== + export namespace predom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __predomBrand: void; + props: { + children?: Element[]; + }; + } + interface ElementClass extends Element { + render(): Element; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } + } + export function predom(): predom.JSX.Element; +==== tests/cases/conformance/jsx/inline/component.tsx (0 errors) ==== + /** @jsx predom */ + import { predom } from "./renderer2" + + export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{...this.props.children}

; + + export class MyClass implements predom.JSX.Element { + __predomBrand!: void; + constructor(public props: {x: number, y: number, children?: predom.JSX.Element[]}) {} + render() { + return

+ {this.props.x} + {this.props.y} = {this.props.x + this.props.y} + {...this.props.children} +

; + } + } + export const tree = + + export default + +==== tests/cases/conformance/jsx/inline/index.tsx (7 errors) ==== + /** @jsx dom */ + import { dom } from "./renderer" + import prerendered, {MySFC, MyClass, tree} from "./component"; + let elem = prerendered; + elem = ; // Expect assignability error here + ~~~~ +!!! error TS2322: Type 'dom.JSX.Element' is not assignable to type 'predom.JSX.Element'. +!!! error TS2322: Property '__predomBrand' is missing in type 'Element'. + + const DOMSFC = (props: {x: number, y: number, children?: dom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{props.children}

; + + class DOMClass implements dom.JSX.Element { + __domBrand!: void; + constructor(public props: {x: number, y: number, children?: dom.JSX.Element[]}) {} + render() { + return

{this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}

; + } + } + + // Should work, everything is a DOM element + const _tree = + + // Should fail, no dom elements + const _brokenTree = + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type 'Element' is not a constructor function for JSX elements. +!!! error TS2605: Property 'render' is missing in type 'Element'. + ~~~~~~~~~~~ +!!! error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ children?: Element[]; }'. +!!! error TS2322: Types of property 'children' are incompatible. +!!! error TS2322: Type 'dom.JSX.Element[]' is not assignable to type 'predom.JSX.Element[]'. +!!! error TS2322: Type 'dom.JSX.Element' is not assignable to type 'predom.JSX.Element'. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type 'MyClass' is not a constructor function for JSX elements. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type 'MyClass' is not a constructor function for JSX elements. +!!! error TS2605: Property '__domBrand' is missing in type 'MyClass'. + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2605: JSX element type 'MyClass' is not a constructor function for JSX elements. + + // Should fail, nondom isn't allowed as children of dom + const _brokenTree2 = {tree}{tree} + ~~~~~~~~~~~ +!!! error TS2322: Type '{ children: Element[]; x: number; y: number; }' is not assignable to type '{ x: number; y: number; children?: Element[]; }'. +!!! error TS2322: Types of property 'children' are incompatible. +!!! error TS2322: Type 'predom.JSX.Element[]' is not assignable to type 'dom.JSX.Element[]'. +!!! error TS2322: Type 'predom.JSX.Element' is not assignable to type 'dom.JSX.Element'. +!!! error TS2322: Property '__domBrand' is missing in type 'Element'. + \ No newline at end of file diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.js b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.js new file mode 100644 index 00000000000..87487b4139d --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.js @@ -0,0 +1,164 @@ +//// [tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarationsLocalTypes.tsx] //// + +//// [renderer.d.ts] +export namespace dom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __domBrand: void; + props: { + children?: Element[]; + }; + } + interface ElementClass extends Element { + render(): Element; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function dom(): dom.JSX.Element; +//// [renderer2.d.ts] +export namespace predom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __predomBrand: void; + props: { + children?: Element[]; + }; + } + interface ElementClass extends Element { + render(): Element; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function predom(): predom.JSX.Element; +//// [component.tsx] +/** @jsx predom */ +import { predom } from "./renderer2" + +export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{...this.props.children}

; + +export class MyClass implements predom.JSX.Element { + __predomBrand!: void; + constructor(public props: {x: number, y: number, children?: predom.JSX.Element[]}) {} + render() { + return

+ {this.props.x} + {this.props.y} = {this.props.x + this.props.y} + {...this.props.children} +

; + } +} +export const tree = + +export default + +//// [index.tsx] +/** @jsx dom */ +import { dom } from "./renderer" +import prerendered, {MySFC, MyClass, tree} from "./component"; +let elem = prerendered; +elem = ; // Expect assignability error here + +const DOMSFC = (props: {x: number, y: number, children?: dom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{props.children}

; + +class DOMClass implements dom.JSX.Element { + __domBrand!: void; + constructor(public props: {x: number, y: number, children?: dom.JSX.Element[]}) {} + render() { + return

{this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}

; + } +} + +// Should work, everything is a DOM element +const _tree = + +// Should fail, no dom elements +const _brokenTree = + +// Should fail, nondom isn't allowed as children of dom +const _brokenTree2 = {tree}{tree} + + +//// [component.js] +"use strict"; +var _this = this; +exports.__esModule = true; +/** @jsx predom */ +var renderer2_1 = require("./renderer2"); +exports.MySFC = function (props) { return renderer2_1.predom("p", null, + props.x, + " + ", + props.y, + " = ", + props.x + props.y, + _this.props.children); }; +var MyClass = /** @class */ (function () { + function MyClass(props) { + this.props = props; + } + MyClass.prototype.render = function () { + return renderer2_1.predom("p", null, + this.props.x, + " + ", + this.props.y, + " = ", + this.props.x + this.props.y, + this.props.children); + }; + return MyClass; +}()); +exports.MyClass = MyClass; +exports.tree = renderer2_1.predom(exports.MySFC, { x: 1, y: 2 }, + renderer2_1.predom(MyClass, { x: 3, y: 4 }), + renderer2_1.predom(MyClass, { x: 5, y: 6 })); +exports["default"] = renderer2_1.predom("h", null); +//// [index.js] +"use strict"; +exports.__esModule = true; +/** @jsx dom */ +var renderer_1 = require("./renderer"); +var component_1 = require("./component"); +var elem = component_1["default"]; +elem = renderer_1.dom("h", null); // Expect assignability error here +var DOMSFC = function (props) { return renderer_1.dom("p", null, + props.x, + " + ", + props.y, + " = ", + props.x + props.y, + props.children); }; +var DOMClass = /** @class */ (function () { + function DOMClass(props) { + this.props = props; + } + DOMClass.prototype.render = function () { + return renderer_1.dom("p", null, + this.props.x, + " + ", + this.props.y, + " = ", + this.props.x + this.props.y, + this.props.children); + }; + return DOMClass; +}()); +// Should work, everything is a DOM element +var _tree = renderer_1.dom(DOMSFC, { x: 1, y: 2 }, + renderer_1.dom(DOMClass, { x: 3, y: 4 }), + renderer_1.dom(DOMClass, { x: 5, y: 6 })); +// Should fail, no dom elements +var _brokenTree = renderer_1.dom(component_1.MySFC, { x: 1, y: 2 }, + renderer_1.dom(component_1.MyClass, { x: 3, y: 4 }), + renderer_1.dom(component_1.MyClass, { x: 5, y: 6 })); +// Should fail, nondom isn't allowed as children of dom +var _brokenTree2 = renderer_1.dom(DOMSFC, { x: 1, y: 2 }, + component_1.tree, + component_1.tree); diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.symbols b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.symbols new file mode 100644 index 00000000000..c5b4e795cf6 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.symbols @@ -0,0 +1,346 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +export namespace dom { +>dom : Symbol(dom, Decl(renderer.d.ts, 0, 0), Decl(renderer.d.ts, 17, 1)) + + namespace JSX { +>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 22)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + + [e: string]: {}; +>e : Symbol(e, Decl(renderer.d.ts, 3, 13)) + } + interface Element { +>Element : Symbol(Element, Decl(renderer.d.ts, 4, 9)) + + __domBrand: void; +>__domBrand : Symbol(Element.__domBrand, Decl(renderer.d.ts, 5, 27)) + + props: { +>props : Symbol(Element.props, Decl(renderer.d.ts, 6, 29)) + + children?: Element[]; +>children : Symbol(children, Decl(renderer.d.ts, 7, 20)) +>Element : Symbol(Element, Decl(renderer.d.ts, 4, 9)) + + }; + } + interface ElementClass extends Element { +>ElementClass : Symbol(ElementClass, Decl(renderer.d.ts, 10, 9)) +>Element : Symbol(Element, Decl(renderer.d.ts, 4, 9)) + + render(): Element; +>render : Symbol(ElementClass.render, Decl(renderer.d.ts, 11, 48)) +>Element : Symbol(Element, Decl(renderer.d.ts, 4, 9)) + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(renderer.d.ts, 13, 9)) +>props : Symbol(ElementAttributesProperty.props, Decl(renderer.d.ts, 14, 45)) + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : Symbol(ElementChildrenAttribute, Decl(renderer.d.ts, 14, 59)) +>children : Symbol(ElementChildrenAttribute.children, Decl(renderer.d.ts, 15, 44)) + } +} +export function dom(): dom.JSX.Element; +>dom : Symbol(dom, Decl(renderer.d.ts, 0, 0), Decl(renderer.d.ts, 17, 1)) +>dom : Symbol(dom, Decl(renderer.d.ts, 0, 0), Decl(renderer.d.ts, 17, 1)) +>JSX : Symbol(dom.JSX, Decl(renderer.d.ts, 0, 22)) +>Element : Symbol(dom.JSX.Element, Decl(renderer.d.ts, 4, 9)) + +=== tests/cases/conformance/jsx/inline/renderer2.d.ts === +export namespace predom { +>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 17, 1)) + + namespace JSX { +>JSX : Symbol(JSX, Decl(renderer2.d.ts, 0, 25)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) + + [e: string]: {}; +>e : Symbol(e, Decl(renderer2.d.ts, 3, 13)) + } + interface Element { +>Element : Symbol(Element, Decl(renderer2.d.ts, 4, 9)) + + __predomBrand: void; +>__predomBrand : Symbol(Element.__predomBrand, Decl(renderer2.d.ts, 5, 27)) + + props: { +>props : Symbol(Element.props, Decl(renderer2.d.ts, 6, 32)) + + children?: Element[]; +>children : Symbol(children, Decl(renderer2.d.ts, 7, 20)) +>Element : Symbol(Element, Decl(renderer2.d.ts, 4, 9)) + + }; + } + interface ElementClass extends Element { +>ElementClass : Symbol(ElementClass, Decl(renderer2.d.ts, 10, 9)) +>Element : Symbol(Element, Decl(renderer2.d.ts, 4, 9)) + + render(): Element; +>render : Symbol(ElementClass.render, Decl(renderer2.d.ts, 11, 48)) +>Element : Symbol(Element, Decl(renderer2.d.ts, 4, 9)) + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(renderer2.d.ts, 13, 9)) +>props : Symbol(ElementAttributesProperty.props, Decl(renderer2.d.ts, 14, 45)) + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : Symbol(ElementChildrenAttribute, Decl(renderer2.d.ts, 14, 59)) +>children : Symbol(ElementChildrenAttribute.children, Decl(renderer2.d.ts, 15, 44)) + } +} +export function predom(): predom.JSX.Element; +>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 17, 1)) +>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 17, 1)) +>JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25)) +>Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9)) + +=== tests/cases/conformance/jsx/inline/component.tsx === +/** @jsx predom */ +import { predom } from "./renderer2" +>predom : Symbol(predom, Decl(component.tsx, 1, 8)) + +export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{...this.props.children}

; +>MySFC : Symbol(MySFC, Decl(component.tsx, 3, 12)) +>props : Symbol(props, Decl(component.tsx, 3, 22)) +>x : Symbol(x, Decl(component.tsx, 3, 30)) +>y : Symbol(y, Decl(component.tsx, 3, 40)) +>children : Symbol(children, Decl(component.tsx, 3, 51)) +>predom : Symbol(predom, Decl(component.tsx, 1, 8)) +>JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25)) +>Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9)) +>p : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) +>props.x : Symbol(x, Decl(component.tsx, 3, 30)) +>props : Symbol(props, Decl(component.tsx, 3, 22)) +>x : Symbol(x, Decl(component.tsx, 3, 30)) +>props.y : Symbol(y, Decl(component.tsx, 3, 40)) +>props : Symbol(props, Decl(component.tsx, 3, 22)) +>y : Symbol(y, Decl(component.tsx, 3, 40)) +>props.x : Symbol(x, Decl(component.tsx, 3, 30)) +>props : Symbol(props, Decl(component.tsx, 3, 22)) +>x : Symbol(x, Decl(component.tsx, 3, 30)) +>props.y : Symbol(y, Decl(component.tsx, 3, 40)) +>props : Symbol(props, Decl(component.tsx, 3, 22)) +>y : Symbol(y, Decl(component.tsx, 3, 40)) +>p : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) + +export class MyClass implements predom.JSX.Element { +>MyClass : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>predom.JSX.Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9)) +>predom.JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25)) +>predom : Symbol(predom, Decl(component.tsx, 1, 8)) +>JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25)) +>Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9)) + + __predomBrand!: void; +>__predomBrand : Symbol(MyClass.__predomBrand, Decl(component.tsx, 5, 52)) + + constructor(public props: {x: number, y: number, children?: predom.JSX.Element[]}) {} +>props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>x : Symbol(x, Decl(component.tsx, 7, 31)) +>y : Symbol(y, Decl(component.tsx, 7, 41)) +>children : Symbol(children, Decl(component.tsx, 7, 52)) +>predom : Symbol(predom, Decl(component.tsx, 1, 8)) +>JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25)) +>Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9)) + + render() { +>render : Symbol(MyClass.render, Decl(component.tsx, 7, 89)) + + return

+>p : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) + + {this.props.x} + {this.props.y} = {this.props.x + this.props.y} +>this.props.x : Symbol(x, Decl(component.tsx, 7, 31)) +>this.props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>this : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>x : Symbol(x, Decl(component.tsx, 7, 31)) +>this.props.y : Symbol(y, Decl(component.tsx, 7, 41)) +>this.props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>this : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>y : Symbol(y, Decl(component.tsx, 7, 41)) +>this.props.x : Symbol(x, Decl(component.tsx, 7, 31)) +>this.props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>this : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>x : Symbol(x, Decl(component.tsx, 7, 31)) +>this.props.y : Symbol(y, Decl(component.tsx, 7, 41)) +>this.props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>this : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>y : Symbol(y, Decl(component.tsx, 7, 41)) + + {...this.props.children} +>this.props.children : Symbol(children, Decl(component.tsx, 7, 52)) +>this.props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>this : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>props : Symbol(MyClass.props, Decl(component.tsx, 7, 16)) +>children : Symbol(children, Decl(component.tsx, 7, 52)) + +

; +>p : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) + } +} +export const tree = +>tree : Symbol(tree, Decl(component.tsx, 15, 12)) +>MySFC : Symbol(MySFC, Decl(component.tsx, 3, 12)) +>x : Symbol(x, Decl(component.tsx, 15, 26)) +>y : Symbol(y, Decl(component.tsx, 15, 32)) +>MyClass : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>x : Symbol(x, Decl(component.tsx, 15, 47)) +>y : Symbol(y, Decl(component.tsx, 15, 53)) +>MyClass : Symbol(MyClass, Decl(component.tsx, 3, 164)) +>x : Symbol(x, Decl(component.tsx, 15, 70)) +>y : Symbol(y, Decl(component.tsx, 15, 76)) +>MySFC : Symbol(MySFC, Decl(component.tsx, 3, 12)) + +export default +>h : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) +>h : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer" +>dom : Symbol(dom, Decl(index.tsx, 1, 8)) + +import prerendered, {MySFC, MyClass, tree} from "./component"; +>prerendered : Symbol(prerendered, Decl(index.tsx, 2, 6)) +>MySFC : Symbol(MySFC, Decl(index.tsx, 2, 21)) +>MyClass : Symbol(MyClass, Decl(index.tsx, 2, 27)) +>tree : Symbol(tree, Decl(index.tsx, 2, 36)) + +let elem = prerendered; +>elem : Symbol(elem, Decl(index.tsx, 3, 3)) +>prerendered : Symbol(prerendered, Decl(index.tsx, 2, 6)) + +elem = ; // Expect assignability error here +>elem : Symbol(elem, Decl(index.tsx, 3, 3)) +>h : Symbol(dom.JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(dom.JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +const DOMSFC = (props: {x: number, y: number, children?: dom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{props.children}

; +>DOMSFC : Symbol(DOMSFC, Decl(index.tsx, 6, 5)) +>props : Symbol(props, Decl(index.tsx, 6, 16)) +>x : Symbol(x, Decl(index.tsx, 6, 24)) +>y : Symbol(y, Decl(index.tsx, 6, 34)) +>children : Symbol(children, Decl(index.tsx, 6, 45)) +>dom : Symbol(dom, Decl(index.tsx, 1, 8)) +>JSX : Symbol(dom.JSX, Decl(renderer.d.ts, 0, 22)) +>Element : Symbol(dom.JSX.Element, Decl(renderer.d.ts, 4, 9)) +>p : Symbol(dom.JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>props.x : Symbol(x, Decl(index.tsx, 6, 24)) +>props : Symbol(props, Decl(index.tsx, 6, 16)) +>x : Symbol(x, Decl(index.tsx, 6, 24)) +>props.y : Symbol(y, Decl(index.tsx, 6, 34)) +>props : Symbol(props, Decl(index.tsx, 6, 16)) +>y : Symbol(y, Decl(index.tsx, 6, 34)) +>props.x : Symbol(x, Decl(index.tsx, 6, 24)) +>props : Symbol(props, Decl(index.tsx, 6, 16)) +>x : Symbol(x, Decl(index.tsx, 6, 24)) +>props.y : Symbol(y, Decl(index.tsx, 6, 34)) +>props : Symbol(props, Decl(index.tsx, 6, 16)) +>y : Symbol(y, Decl(index.tsx, 6, 34)) +>props.children : Symbol(children, Decl(index.tsx, 6, 45)) +>props : Symbol(props, Decl(index.tsx, 6, 16)) +>children : Symbol(children, Decl(index.tsx, 6, 45)) +>p : Symbol(dom.JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + +class DOMClass implements dom.JSX.Element { +>DOMClass : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>dom.JSX.Element : Symbol(dom.JSX.Element, Decl(renderer.d.ts, 4, 9)) +>dom.JSX : Symbol(dom.JSX, Decl(renderer.d.ts, 0, 22)) +>dom : Symbol(dom, Decl(index.tsx, 1, 8)) +>JSX : Symbol(dom.JSX, Decl(renderer.d.ts, 0, 22)) +>Element : Symbol(dom.JSX.Element, Decl(renderer.d.ts, 4, 9)) + + __domBrand!: void; +>__domBrand : Symbol(DOMClass.__domBrand, Decl(index.tsx, 8, 43)) + + constructor(public props: {x: number, y: number, children?: dom.JSX.Element[]}) {} +>props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>x : Symbol(x, Decl(index.tsx, 10, 31)) +>y : Symbol(y, Decl(index.tsx, 10, 41)) +>children : Symbol(children, Decl(index.tsx, 10, 52)) +>dom : Symbol(dom, Decl(index.tsx, 1, 8)) +>JSX : Symbol(dom.JSX, Decl(renderer.d.ts, 0, 22)) +>Element : Symbol(dom.JSX.Element, Decl(renderer.d.ts, 4, 9)) + + render() { +>render : Symbol(DOMClass.render, Decl(index.tsx, 10, 86)) + + return

{this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}

; +>p : Symbol(dom.JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>this.props.x : Symbol(x, Decl(index.tsx, 10, 31)) +>this.props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>this : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>x : Symbol(x, Decl(index.tsx, 10, 31)) +>this.props.y : Symbol(y, Decl(index.tsx, 10, 41)) +>this.props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>this : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>y : Symbol(y, Decl(index.tsx, 10, 41)) +>this.props.x : Symbol(x, Decl(index.tsx, 10, 31)) +>this.props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>this : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>x : Symbol(x, Decl(index.tsx, 10, 31)) +>this.props.y : Symbol(y, Decl(index.tsx, 10, 41)) +>this.props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>this : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>y : Symbol(y, Decl(index.tsx, 10, 41)) +>this.props.children : Symbol(children, Decl(index.tsx, 10, 52)) +>this.props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>this : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>props : Symbol(DOMClass.props, Decl(index.tsx, 10, 16)) +>children : Symbol(children, Decl(index.tsx, 10, 52)) +>p : Symbol(dom.JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + } +} + +// Should work, everything is a DOM element +const _tree = +>_tree : Symbol(_tree, Decl(index.tsx, 17, 5)) +>DOMSFC : Symbol(DOMSFC, Decl(index.tsx, 6, 5)) +>x : Symbol(x, Decl(index.tsx, 17, 21)) +>y : Symbol(y, Decl(index.tsx, 17, 27)) +>DOMClass : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>x : Symbol(x, Decl(index.tsx, 17, 43)) +>y : Symbol(y, Decl(index.tsx, 17, 49)) +>DOMClass : Symbol(DOMClass, Decl(index.tsx, 6, 147)) +>x : Symbol(x, Decl(index.tsx, 17, 67)) +>y : Symbol(y, Decl(index.tsx, 17, 73)) +>DOMSFC : Symbol(DOMSFC, Decl(index.tsx, 6, 5)) + +// Should fail, no dom elements +const _brokenTree = +>_brokenTree : Symbol(_brokenTree, Decl(index.tsx, 20, 5)) +>MySFC : Symbol(MySFC, Decl(index.tsx, 2, 21)) +>x : Symbol(x, Decl(index.tsx, 20, 26)) +>y : Symbol(y, Decl(index.tsx, 20, 32)) +>MyClass : Symbol(MyClass, Decl(index.tsx, 2, 27)) +>x : Symbol(x, Decl(index.tsx, 20, 47)) +>y : Symbol(y, Decl(index.tsx, 20, 53)) +>MyClass : Symbol(MyClass, Decl(index.tsx, 2, 27)) +>x : Symbol(x, Decl(index.tsx, 20, 70)) +>y : Symbol(y, Decl(index.tsx, 20, 76)) +>MySFC : Symbol(MySFC, Decl(index.tsx, 2, 21)) + +// Should fail, nondom isn't allowed as children of dom +const _brokenTree2 = {tree}{tree} +>_brokenTree2 : Symbol(_brokenTree2, Decl(index.tsx, 23, 5)) +>DOMSFC : Symbol(DOMSFC, Decl(index.tsx, 6, 5)) +>x : Symbol(x, Decl(index.tsx, 23, 28)) +>y : Symbol(y, Decl(index.tsx, 23, 34)) +>tree : Symbol(tree, Decl(index.tsx, 2, 36)) +>tree : Symbol(tree, Decl(index.tsx, 2, 36)) +>DOMSFC : Symbol(DOMSFC, Decl(index.tsx, 6, 5)) + diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.types b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.types new file mode 100644 index 00000000000..d33da0d6494 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryDeclarationsLocalTypes.types @@ -0,0 +1,394 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +export namespace dom { +>dom : () => JSX.Element + + namespace JSX { +>JSX : any + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [e: string]: {}; +>e : string + } + interface Element { +>Element : Element + + __domBrand: void; +>__domBrand : void + + props: { +>props : { children?: Element[]; } + + children?: Element[]; +>children : Element[] +>Element : Element + + }; + } + interface ElementClass extends Element { +>ElementClass : ElementClass +>Element : Element + + render(): Element; +>render : () => Element +>Element : Element + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : ElementAttributesProperty +>props : any + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : ElementChildrenAttribute +>children : any + } +} +export function dom(): dom.JSX.Element; +>dom : () => dom.JSX.Element +>dom : any +>JSX : any +>Element : dom.JSX.Element + +=== tests/cases/conformance/jsx/inline/renderer2.d.ts === +export namespace predom { +>predom : () => JSX.Element + + namespace JSX { +>JSX : any + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [e: string]: {}; +>e : string + } + interface Element { +>Element : Element + + __predomBrand: void; +>__predomBrand : void + + props: { +>props : { children?: Element[]; } + + children?: Element[]; +>children : Element[] +>Element : Element + + }; + } + interface ElementClass extends Element { +>ElementClass : ElementClass +>Element : Element + + render(): Element; +>render : () => Element +>Element : Element + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : ElementAttributesProperty +>props : any + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : ElementChildrenAttribute +>children : any + } +} +export function predom(): predom.JSX.Element; +>predom : () => predom.JSX.Element +>predom : any +>JSX : any +>Element : predom.JSX.Element + +=== tests/cases/conformance/jsx/inline/component.tsx === +/** @jsx predom */ +import { predom } from "./renderer2" +>predom : () => predom.JSX.Element + +export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{...this.props.children}

; +>MySFC : (props: { x: number; y: number; children?: predom.JSX.Element[]; }) => predom.JSX.Element +>(props: {x: number, y: number, children?: predom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{...this.props.children}

: (props: { x: number; y: number; children?: predom.JSX.Element[]; }) => predom.JSX.Element +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>x : number +>y : number +>children : predom.JSX.Element[] +>predom : any +>JSX : any +>Element : predom.JSX.Element +>

{props.x} + {props.y} = {props.x + props.y}{...this.props.children}

: predom.JSX.Element +>p : any +>props.x : number +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>x : number +>props.y : number +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>y : number +>props.x + props.y : number +>props.x : number +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>x : number +>props.y : number +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>y : number +>this.props.children : any +>this.props : any +>this : any +>props : any +>children : any +>p : any + +export class MyClass implements predom.JSX.Element { +>MyClass : MyClass +>predom.JSX.Element : any +>predom.JSX : any +>predom : () => predom.JSX.Element +>JSX : any +>Element : predom.JSX.Element + + __predomBrand!: void; +>__predomBrand : void + + constructor(public props: {x: number, y: number, children?: predom.JSX.Element[]}) {} +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>x : number +>y : number +>children : predom.JSX.Element[] +>predom : any +>JSX : any +>Element : predom.JSX.Element + + render() { +>render : () => predom.JSX.Element + + return

+>

{this.props.x} + {this.props.y} = {this.props.x + this.props.y} {...this.props.children}

: predom.JSX.Element +>p : any + + {this.props.x} + {this.props.y} = {this.props.x + this.props.y} +>this.props.x : number +>this.props : { x: number; y: number; children?: predom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>x : number +>this.props.y : number +>this.props : { x: number; y: number; children?: predom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>y : number +>this.props.x + this.props.y : number +>this.props.x : number +>this.props : { x: number; y: number; children?: predom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>x : number +>this.props.y : number +>this.props : { x: number; y: number; children?: predom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>y : number + + {...this.props.children} +>this.props.children : predom.JSX.Element[] +>this.props : { x: number; y: number; children?: predom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: predom.JSX.Element[]; } +>children : predom.JSX.Element[] + +

; +>p : any + } +} +export const tree = +>tree : predom.JSX.Element +> : predom.JSX.Element +>MySFC : (props: { x: number; y: number; children?: predom.JSX.Element[]; }) => predom.JSX.Element +>x : number +>1 : 1 +>y : number +>2 : 2 +> : predom.JSX.Element +>MyClass : typeof MyClass +>x : number +>3 : 3 +>y : number +>4 : 4 +> : predom.JSX.Element +>MyClass : typeof MyClass +>x : number +>5 : 5 +>y : number +>6 : 6 +>MySFC : (props: { x: number; y: number; children?: predom.JSX.Element[]; }) => predom.JSX.Element + +export default +> : predom.JSX.Element +>h : any +>h : any + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer" +>dom : () => dom.JSX.Element + +import prerendered, {MySFC, MyClass, tree} from "./component"; +>prerendered : predom.JSX.Element +>MySFC : (props: { x: number; y: number; children?: predom.JSX.Element[]; }) => predom.JSX.Element +>MyClass : typeof MyClass +>tree : predom.JSX.Element + +let elem = prerendered; +>elem : predom.JSX.Element +>prerendered : predom.JSX.Element + +elem = ; // Expect assignability error here +>elem = : dom.JSX.Element +>elem : predom.JSX.Element +> : dom.JSX.Element +>h : any +>h : any + +const DOMSFC = (props: {x: number, y: number, children?: dom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{props.children}

; +>DOMSFC : (props: { x: number; y: number; children?: dom.JSX.Element[]; }) => dom.JSX.Element +>(props: {x: number, y: number, children?: dom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{props.children}

: (props: { x: number; y: number; children?: dom.JSX.Element[]; }) => dom.JSX.Element +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>x : number +>y : number +>children : dom.JSX.Element[] +>dom : any +>JSX : any +>Element : dom.JSX.Element +>

{props.x} + {props.y} = {props.x + props.y}{props.children}

: dom.JSX.Element +>p : any +>props.x : number +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>x : number +>props.y : number +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>y : number +>props.x + props.y : number +>props.x : number +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>x : number +>props.y : number +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>y : number +>props.children : dom.JSX.Element[] +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>children : dom.JSX.Element[] +>p : any + +class DOMClass implements dom.JSX.Element { +>DOMClass : DOMClass +>dom.JSX.Element : any +>dom.JSX : any +>dom : () => dom.JSX.Element +>JSX : any +>Element : dom.JSX.Element + + __domBrand!: void; +>__domBrand : void + + constructor(public props: {x: number, y: number, children?: dom.JSX.Element[]}) {} +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>x : number +>y : number +>children : dom.JSX.Element[] +>dom : any +>JSX : any +>Element : dom.JSX.Element + + render() { +>render : () => dom.JSX.Element + + return

{this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}

; +>

{this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}

: dom.JSX.Element +>p : any +>this.props.x : number +>this.props : { x: number; y: number; children?: dom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>x : number +>this.props.y : number +>this.props : { x: number; y: number; children?: dom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>y : number +>this.props.x + this.props.y : number +>this.props.x : number +>this.props : { x: number; y: number; children?: dom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>x : number +>this.props.y : number +>this.props : { x: number; y: number; children?: dom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>y : number +>this.props.children : dom.JSX.Element[] +>this.props : { x: number; y: number; children?: dom.JSX.Element[]; } +>this : this +>props : { x: number; y: number; children?: dom.JSX.Element[]; } +>children : dom.JSX.Element[] +>p : any + } +} + +// Should work, everything is a DOM element +const _tree = +>_tree : dom.JSX.Element +> : dom.JSX.Element +>DOMSFC : (props: { x: number; y: number; children?: dom.JSX.Element[]; }) => dom.JSX.Element +>x : number +>1 : 1 +>y : number +>2 : 2 +> : dom.JSX.Element +>DOMClass : typeof DOMClass +>x : number +>3 : 3 +>y : number +>4 : 4 +> : dom.JSX.Element +>DOMClass : typeof DOMClass +>x : number +>5 : 5 +>y : number +>6 : 6 +>DOMSFC : (props: { x: number; y: number; children?: dom.JSX.Element[]; }) => dom.JSX.Element + +// Should fail, no dom elements +const _brokenTree = +>_brokenTree : dom.JSX.Element +> : dom.JSX.Element +>MySFC : (props: { x: number; y: number; children?: predom.JSX.Element[]; }) => predom.JSX.Element +>x : number +>1 : 1 +>y : number +>2 : 2 +> : dom.JSX.Element +>MyClass : typeof MyClass +>x : number +>3 : 3 +>y : number +>4 : 4 +> : dom.JSX.Element +>MyClass : typeof MyClass +>x : number +>5 : 5 +>y : number +>6 : 6 +>MySFC : (props: { x: number; y: number; children?: predom.JSX.Element[]; }) => predom.JSX.Element + +// Should fail, nondom isn't allowed as children of dom +const _brokenTree2 = {tree}{tree} +>_brokenTree2 : dom.JSX.Element +>{tree}{tree} : dom.JSX.Element +>DOMSFC : (props: { x: number; y: number; children?: dom.JSX.Element[]; }) => dom.JSX.Element +>x : number +>1 : 1 +>y : number +>2 : 2 +>tree : predom.JSX.Element +>tree : predom.JSX.Element +>DOMSFC : (props: { x: number; y: number; children?: dom.JSX.Element[]; }) => dom.JSX.Element + diff --git a/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.errors.txt b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.errors.txt new file mode 100644 index 00000000000..9d4e4e0a026 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/jsx/inline/index.tsx(5,1): error TS2322: Type 'JSX.Element' is not assignable to type 'predom.JSX.Element'. + Property '__predomBrand' is missing in type 'Element'. + + +==== tests/cases/conformance/jsx/inline/renderer.d.ts (0 errors) ==== + declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __domBrand: void; + children: Element[]; + props: {}; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } + } + export function dom(): JSX.Element; +==== tests/cases/conformance/jsx/inline/renderer2.d.ts (0 errors) ==== + export namespace predom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __predomBrand: void; + children: Element[]; + props: {}; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } + } + export function predom(): predom.JSX.Element; +==== tests/cases/conformance/jsx/inline/component.tsx (0 errors) ==== + /** @jsx predom */ + import { predom } from "./renderer2" + export default + +==== tests/cases/conformance/jsx/inline/index.tsx (1 errors) ==== + /** @jsx dom */ + import { dom } from "./renderer" + import prerendered from "./component"; + let elem = prerendered; + elem = ; // Expect assignability error here + ~~~~ +!!! error TS2322: Type 'JSX.Element' is not assignable to type 'predom.JSX.Element'. +!!! error TS2322: Property '__predomBrand' is missing in type 'Element'. + \ No newline at end of file diff --git a/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.js b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.js new file mode 100644 index 00000000000..4f5123ed67d --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.js @@ -0,0 +1,61 @@ +//// [tests/cases/conformance/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallback.tsx] //// + +//// [renderer.d.ts] +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __domBrand: void; + children: Element[]; + props: {}; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function dom(): JSX.Element; +//// [renderer2.d.ts] +export namespace predom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __predomBrand: void; + children: Element[]; + props: {}; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function predom(): predom.JSX.Element; +//// [component.tsx] +/** @jsx predom */ +import { predom } from "./renderer2" +export default + +//// [index.tsx] +/** @jsx dom */ +import { dom } from "./renderer" +import prerendered from "./component"; +let elem = prerendered; +elem = ; // Expect assignability error here + + +//// [component.js] +"use strict"; +exports.__esModule = true; +/** @jsx predom */ +var renderer2_1 = require("./renderer2"); +exports["default"] = renderer2_1.predom("h", null); +//// [index.js] +"use strict"; +exports.__esModule = true; +/** @jsx dom */ +var renderer_1 = require("./renderer"); +var component_1 = require("./component"); +var elem = component_1["default"]; +elem = renderer_1.dom("h", null); // Expect assignability error here diff --git a/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.symbols b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.symbols new file mode 100644 index 00000000000..c4962015871 --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.symbols @@ -0,0 +1,107 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : Symbol(global, Decl(renderer.d.ts, 0, 0)) + + namespace JSX { +>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 16)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + + [e: string]: {}; +>e : Symbol(e, Decl(renderer.d.ts, 3, 13)) + } + interface Element { +>Element : Symbol(Element, Decl(renderer.d.ts, 4, 9)) + + __domBrand: void; +>__domBrand : Symbol(Element.__domBrand, Decl(renderer.d.ts, 5, 27)) + + children: Element[]; +>children : Symbol(Element.children, Decl(renderer.d.ts, 6, 29)) +>Element : Symbol(Element, Decl(renderer.d.ts, 4, 9)) + + props: {}; +>props : Symbol(Element.props, Decl(renderer.d.ts, 7, 32)) + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(renderer.d.ts, 9, 9)) +>props : Symbol(ElementAttributesProperty.props, Decl(renderer.d.ts, 10, 45)) + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : Symbol(ElementChildrenAttribute, Decl(renderer.d.ts, 10, 59)) +>children : Symbol(ElementChildrenAttribute.children, Decl(renderer.d.ts, 11, 44)) + } +} +export function dom(): JSX.Element; +>dom : Symbol(dom, Decl(renderer.d.ts, 13, 1)) +>JSX : Symbol(JSX, Decl(renderer.d.ts, 0, 16)) +>Element : Symbol(JSX.Element, Decl(renderer.d.ts, 4, 9)) + +=== tests/cases/conformance/jsx/inline/renderer2.d.ts === +export namespace predom { +>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 13, 1)) + + namespace JSX { +>JSX : Symbol(JSX, Decl(renderer2.d.ts, 0, 25)) + + interface IntrinsicElements { +>IntrinsicElements : Symbol(IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) + + [e: string]: {}; +>e : Symbol(e, Decl(renderer2.d.ts, 3, 13)) + } + interface Element { +>Element : Symbol(Element, Decl(renderer2.d.ts, 4, 9)) + + __predomBrand: void; +>__predomBrand : Symbol(Element.__predomBrand, Decl(renderer2.d.ts, 5, 27)) + + children: Element[]; +>children : Symbol(Element.children, Decl(renderer2.d.ts, 6, 32)) +>Element : Symbol(Element, Decl(renderer2.d.ts, 4, 9)) + + props: {}; +>props : Symbol(Element.props, Decl(renderer2.d.ts, 7, 32)) + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : Symbol(ElementAttributesProperty, Decl(renderer2.d.ts, 9, 9)) +>props : Symbol(ElementAttributesProperty.props, Decl(renderer2.d.ts, 10, 45)) + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : Symbol(ElementChildrenAttribute, Decl(renderer2.d.ts, 10, 59)) +>children : Symbol(ElementChildrenAttribute.children, Decl(renderer2.d.ts, 11, 44)) + } +} +export function predom(): predom.JSX.Element; +>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 13, 1)) +>predom : Symbol(predom, Decl(renderer2.d.ts, 0, 0), Decl(renderer2.d.ts, 13, 1)) +>JSX : Symbol(predom.JSX, Decl(renderer2.d.ts, 0, 25)) +>Element : Symbol(predom.JSX.Element, Decl(renderer2.d.ts, 4, 9)) + +=== tests/cases/conformance/jsx/inline/component.tsx === +/** @jsx predom */ +import { predom } from "./renderer2" +>predom : Symbol(predom, Decl(component.tsx, 1, 8)) + +export default +>h : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) +>h : Symbol(predom.JSX.IntrinsicElements, Decl(renderer2.d.ts, 1, 19)) + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer" +>dom : Symbol(dom, Decl(index.tsx, 1, 8)) + +import prerendered from "./component"; +>prerendered : Symbol(prerendered, Decl(index.tsx, 2, 6)) + +let elem = prerendered; +>elem : Symbol(elem, Decl(index.tsx, 3, 3)) +>prerendered : Symbol(prerendered, Decl(index.tsx, 2, 6)) + +elem = ; // Expect assignability error here +>elem : Symbol(elem, Decl(index.tsx, 3, 3)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) +>h : Symbol(JSX.IntrinsicElements, Decl(renderer.d.ts, 1, 19)) + diff --git a/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.types b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.types new file mode 100644 index 00000000000..369341f0f7a --- /dev/null +++ b/tests/baselines/reference/inlineJsxFactoryLocalTypeGlobalFallback.types @@ -0,0 +1,110 @@ +=== tests/cases/conformance/jsx/inline/renderer.d.ts === +declare global { +>global : any + + namespace JSX { +>JSX : any + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [e: string]: {}; +>e : string + } + interface Element { +>Element : Element + + __domBrand: void; +>__domBrand : void + + children: Element[]; +>children : Element[] +>Element : Element + + props: {}; +>props : {} + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : ElementAttributesProperty +>props : any + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : ElementChildrenAttribute +>children : any + } +} +export function dom(): JSX.Element; +>dom : () => JSX.Element +>JSX : any +>Element : JSX.Element + +=== tests/cases/conformance/jsx/inline/renderer2.d.ts === +export namespace predom { +>predom : () => JSX.Element + + namespace JSX { +>JSX : any + + interface IntrinsicElements { +>IntrinsicElements : IntrinsicElements + + [e: string]: {}; +>e : string + } + interface Element { +>Element : Element + + __predomBrand: void; +>__predomBrand : void + + children: Element[]; +>children : Element[] +>Element : Element + + props: {}; +>props : {} + } + interface ElementAttributesProperty { props: any; } +>ElementAttributesProperty : ElementAttributesProperty +>props : any + + interface ElementChildrenAttribute { children: any; } +>ElementChildrenAttribute : ElementChildrenAttribute +>children : any + } +} +export function predom(): predom.JSX.Element; +>predom : () => predom.JSX.Element +>predom : any +>JSX : any +>Element : predom.JSX.Element + +=== tests/cases/conformance/jsx/inline/component.tsx === +/** @jsx predom */ +import { predom } from "./renderer2" +>predom : () => predom.JSX.Element + +export default +> : predom.JSX.Element +>h : any +>h : any + +=== tests/cases/conformance/jsx/inline/index.tsx === +/** @jsx dom */ +import { dom } from "./renderer" +>dom : () => JSX.Element + +import prerendered from "./component"; +>prerendered : predom.JSX.Element + +let elem = prerendered; +>elem : predom.JSX.Element +>prerendered : predom.JSX.Element + +elem = ; // Expect assignability error here +>elem = : JSX.Element +>elem : predom.JSX.Element +> : JSX.Element +>h : any +>h : any + diff --git a/tests/baselines/reference/tsxElementResolution16.errors.txt b/tests/baselines/reference/tsxElementResolution16.errors.txt index b68c442c36d..07b2ec54b44 100644 --- a/tests/baselines/reference/tsxElementResolution16.errors.txt +++ b/tests/baselines/reference/tsxElementResolution16.errors.txt @@ -1,8 +1,7 @@ -tests/cases/conformance/jsx/file.tsx(8,1): error TS2602: JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist. tests/cases/conformance/jsx/file.tsx(8,1): error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. -==== tests/cases/conformance/jsx/file.tsx (2 errors) ==== +==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== declare module JSX { } @@ -12,7 +11,5 @@ tests/cases/conformance/jsx/file.tsx(8,1): error TS7026: JSX element implicitly var obj1: Obj1; ; // Error (JSX.Element is implicit any) ~~~~~~~~~~~~~~~ -!!! error TS2602: JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist. - ~~~~~~~~~~~~~~~ !!! error TS7026: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. \ No newline at end of file diff --git a/tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarationsLocalTypes.tsx b/tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarationsLocalTypes.tsx new file mode 100644 index 00000000000..009abe2e852 --- /dev/null +++ b/tests/cases/conformance/jsx/inline/inlineJsxFactoryDeclarationsLocalTypes.tsx @@ -0,0 +1,86 @@ +// @jsx: react +// @filename: renderer.d.ts +export namespace dom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __domBrand: void; + props: { + children?: Element[]; + }; + } + interface ElementClass extends Element { + render(): Element; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function dom(): dom.JSX.Element; +// @filename: renderer2.d.ts +export namespace predom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __predomBrand: void; + props: { + children?: Element[]; + }; + } + interface ElementClass extends Element { + render(): Element; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function predom(): predom.JSX.Element; +// @filename: component.tsx +/** @jsx predom */ +import { predom } from "./renderer2" + +export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{...this.props.children}

; + +export class MyClass implements predom.JSX.Element { + __predomBrand!: void; + constructor(public props: {x: number, y: number, children?: predom.JSX.Element[]}) {} + render() { + return

+ {this.props.x} + {this.props.y} = {this.props.x + this.props.y} + {...this.props.children} +

; + } +} +export const tree = + +export default + +// @filename: index.tsx +/** @jsx dom */ +import { dom } from "./renderer" +import prerendered, {MySFC, MyClass, tree} from "./component"; +let elem = prerendered; +elem = ; // Expect assignability error here + +const DOMSFC = (props: {x: number, y: number, children?: dom.JSX.Element[]}) =>

{props.x} + {props.y} = {props.x + props.y}{props.children}

; + +class DOMClass implements dom.JSX.Element { + __domBrand!: void; + constructor(public props: {x: number, y: number, children?: dom.JSX.Element[]}) {} + render() { + return

{this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}

; + } +} + +// Should work, everything is a DOM element +const _tree = + +// Should fail, no dom elements +const _brokenTree = + +// Should fail, nondom isn't allowed as children of dom +const _brokenTree2 = {tree}{tree} diff --git a/tests/cases/conformance/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallback.tsx b/tests/cases/conformance/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallback.tsx new file mode 100644 index 00000000000..3f4340f518b --- /dev/null +++ b/tests/cases/conformance/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallback.tsx @@ -0,0 +1,44 @@ +// @jsx: react +// @filename: renderer.d.ts +declare global { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __domBrand: void; + children: Element[]; + props: {}; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function dom(): JSX.Element; +// @filename: renderer2.d.ts +export namespace predom { + namespace JSX { + interface IntrinsicElements { + [e: string]: {}; + } + interface Element { + __predomBrand: void; + children: Element[]; + props: {}; + } + interface ElementAttributesProperty { props: any; } + interface ElementChildrenAttribute { children: any; } + } +} +export function predom(): predom.JSX.Element; +// @filename: component.tsx +/** @jsx predom */ +import { predom } from "./renderer2" +export default + +// @filename: index.tsx +/** @jsx dom */ +import { dom } from "./renderer" +import prerendered from "./component"; +let elem = prerendered; +elem = ; // Expect assignability error here From b8e0009c9b591d20697bfdb6ed7f2d3715b2bb73 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Feb 2018 16:03:05 -0800 Subject: [PATCH 254/298] Set syntheticLiteralTypeOrigin on synthetic `undefined`-type members (#22216) * Have getNameOfSymbolAsWritten quote nonidentifier nonnumeric symbols all the time * Revert checker changes * Reuse synthetic origin to indicate that derived declaration name may need to be quoted --- src/compiler/checker.ts | 4 ++++ .../inferredNonidentifierTypesGetQuotes.js | 22 +++++++++++++++++++ ...nferredNonidentifierTypesGetQuotes.symbols | 10 +++++++++ .../inferredNonidentifierTypesGetQuotes.types | 18 +++++++++++++++ .../inferredNonidentifierTypesGetQuotes.ts | 4 ++++ 5 files changed, 58 insertions(+) create mode 100644 tests/baselines/reference/inferredNonidentifierTypesGetQuotes.js create mode 100644 tests/baselines/reference/inferredNonidentifierTypesGetQuotes.symbols create mode 100644 tests/baselines/reference/inferredNonidentifierTypesGetQuotes.types create mode 100644 tests/cases/compiler/inferredNonidentifierTypesGetQuotes.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e7ff00df556..f98031cf44d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11150,6 +11150,10 @@ namespace ts { } const result = createSymbol(SymbolFlags.Property | SymbolFlags.Optional, name); result.type = undefinedType; + const associatedKeyType = getLiteralType(unescapeLeadingUnderscores(name)); + if (associatedKeyType.flags & TypeFlags.StringLiteral) { + result.syntheticLiteralTypeOrigin = associatedKeyType as StringLiteralType; + } undefinedProperties.set(name, result); return result; } diff --git a/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.js b/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.js new file mode 100644 index 00000000000..e9ce8e56d1f --- /dev/null +++ b/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.js @@ -0,0 +1,22 @@ +//// [inferredNonidentifierTypesGetQuotes.ts] +var x = [{ "a-b": "string" }, {}]; + +var y = [{ ["a-b"]: "string" }, {}]; + +//// [inferredNonidentifierTypesGetQuotes.js] +var x = [{ "a-b": "string" }, {}]; +var y = [(_a = {}, _a["a-b"] = "string", _a), {}]; +var _a; + + +//// [inferredNonidentifierTypesGetQuotes.d.ts] +declare var x: ({ + "a-b": string; +} | { + "a-b"?: undefined; +})[]; +declare var y: ({ + ["a-b"]: string; +} | { + "a-b"?: undefined; +})[]; diff --git a/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.symbols b/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.symbols new file mode 100644 index 00000000000..f37063dcee5 --- /dev/null +++ b/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.symbols @@ -0,0 +1,10 @@ +=== tests/cases/compiler/inferredNonidentifierTypesGetQuotes.ts === +var x = [{ "a-b": "string" }, {}]; +>x : Symbol(x, Decl(inferredNonidentifierTypesGetQuotes.ts, 0, 3)) +>"a-b" : Symbol("a-b", Decl(inferredNonidentifierTypesGetQuotes.ts, 0, 10)) + +var y = [{ ["a-b"]: "string" }, {}]; +>y : Symbol(y, Decl(inferredNonidentifierTypesGetQuotes.ts, 2, 3)) +>["a-b"] : Symbol(["a-b"], Decl(inferredNonidentifierTypesGetQuotes.ts, 2, 10)) +>"a-b" : Symbol(["a-b"], Decl(inferredNonidentifierTypesGetQuotes.ts, 2, 10)) + diff --git a/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.types b/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.types new file mode 100644 index 00000000000..361b550952a --- /dev/null +++ b/tests/baselines/reference/inferredNonidentifierTypesGetQuotes.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/inferredNonidentifierTypesGetQuotes.ts === +var x = [{ "a-b": "string" }, {}]; +>x : ({ "a-b": string; } | { "a-b"?: undefined; })[] +>[{ "a-b": "string" }, {}] : ({ "a-b": string; } | {})[] +>{ "a-b": "string" } : { "a-b": string; } +>"a-b" : string +>"string" : "string" +>{} : {} + +var y = [{ ["a-b"]: "string" }, {}]; +>y : ({ ["a-b"]: string; } | { "a-b"?: undefined; })[] +>[{ ["a-b"]: "string" }, {}] : ({ ["a-b"]: string; } | {})[] +>{ ["a-b"]: "string" } : { ["a-b"]: string; } +>["a-b"] : string +>"a-b" : "a-b" +>"string" : "string" +>{} : {} + diff --git a/tests/cases/compiler/inferredNonidentifierTypesGetQuotes.ts b/tests/cases/compiler/inferredNonidentifierTypesGetQuotes.ts new file mode 100644 index 00000000000..70e3296bef6 --- /dev/null +++ b/tests/cases/compiler/inferredNonidentifierTypesGetQuotes.ts @@ -0,0 +1,4 @@ +// @declaration: true +var x = [{ "a-b": "string" }, {}]; + +var y = [{ ["a-b"]: "string" }, {}]; \ No newline at end of file From ec249f7f674d1663a5d031376d75efface967885 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Feb 2018 16:56:54 -0800 Subject: [PATCH 255/298] Fix typo in inference (#22243) --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f98031cf44d..ffbd83456aa 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11634,7 +11634,7 @@ namespace ts { } } else { - if (!(priority && InferencePriority.NoConstraints && source.flags & (TypeFlags.Intersection | TypeFlags.Instantiable))) { + if (!(priority & InferencePriority.NoConstraints && source.flags & (TypeFlags.Intersection | TypeFlags.Instantiable))) { source = getApparentType(source); } if (source.flags & (TypeFlags.Object | TypeFlags.Intersection)) { From 69580c4561b75db1cf8eae53593abe4d27189f2c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 28 Feb 2018 16:57:25 -0800 Subject: [PATCH 256/298] Filter outer type parameters (similar to anonymous types) --- src/compiler/checker.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0be1c8438b4..520b477da0b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8278,7 +8278,9 @@ namespace ts { const links = getNodeLinks(node); if (!links.resolvedType) { const checkType = getTypeFromTypeNode(node.checkType); - const outerTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true); + const aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node); + const allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true); + const outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : filter(allOuterTypeParameters, tp => isTypeParameterPossiblyReferenced(tp, node)); const root: ConditionalRoot = { node, checkType, @@ -8290,7 +8292,7 @@ namespace ts { outerTypeParameters, instantiations: undefined, aliasSymbol: getAliasSymbolForTypeNode(node), - aliasTypeArguments: getAliasTypeArgumentsForTypeNode(node) + aliasTypeArguments }; links.resolvedType = getConditionalType(root, /*mapper*/ undefined); if (outerTypeParameters) { From c12fc0d6c3faa413b9feb2f3e9751e5614d8e5fe Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 28 Feb 2018 17:55:56 -0800 Subject: [PATCH 257/298] Format unique symmbol string output with `unique symbol` and not `typeof` within checker (#22247) * Accept baseline update to symbol test * Set default node flag instead of accepting new error --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ffbd83456aa..9579ba80d0f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2756,7 +2756,7 @@ namespace ts { } } - function typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags, writer: EmitTextWriter = createTextWriter("")): string { + function typeToString(type: Type, enclosingDeclaration?: Node, flags: TypeFormatFlags = TypeFormatFlags.AllowUniqueESSymbolType, writer: EmitTextWriter = createTextWriter("")): string { const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | NodeBuilderFlags.IgnoreErrors, writer); Debug.assert(typeNode !== undefined, "should always get typenode"); const options = { removeComments: true }; From 75c6c8c78802a5bfd5f52deebc28b722861d4993 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 1 Mar 2018 05:10:18 +0000 Subject: [PATCH 258/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl index 332e2933d2a..d732d0101c3 100644 --- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -912,6 +912,15 @@
+ + + + + + + + + @@ -924,6 +933,15 @@ + + + + + + + + + @@ -948,6 +966,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index 9c0ffaf818e..6ab6de8613c 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -903,6 +903,15 @@ + + + + + + + + + @@ -915,6 +924,15 @@ + + + + + + + + + @@ -939,6 +957,15 @@ + + + + + + + + + From 3df0b4cd61c1bf244e12ff90bb04326e5129cd85 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 1 Mar 2018 11:10:18 +0000 Subject: [PATCH 259/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 15c5e26b54f..b8891b5a90b 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -902,6 +902,15 @@ + + + + + + + + + @@ -914,6 +923,15 @@ + + + + + + + + + @@ -938,6 +956,15 @@ + + + + + + + + + From 6385c66215f2a2644cdf52e6ba7193a08fae2b8b Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 07:34:51 -0800 Subject: [PATCH 260/298] Simplify diagnostics fourslash tests (#22245) --- src/harness/fourslash.ts | 23 +++++++++------ tests/cases/fourslash/fourslash.ts | 13 ++++----- .../getJavaScriptSyntacticDiagnostics1.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics10.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics11.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics12.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics13.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics14.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics15.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics16.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics17.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics18.ts | 23 +++++---------- .../getJavaScriptSyntacticDiagnostics19.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics2.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics3.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics4.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics5.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics6.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics7.ts | 11 ++------ .../getJavaScriptSyntacticDiagnostics8.ts | 15 ++++------ .../getJavaScriptSyntacticDiagnostics9.ts | 11 ++------ .../fourslash/jsDocAugmentsAndExtends.ts | 5 +--- ...pilationDuplicateFunctionImplementation.ts | 8 +----- ...refactorConvertToEs6Module_export_named.ts | 6 ++-- .../getJavaScriptSyntacticDiagnostics01.ts | 10 ++----- .../getJavaScriptSyntacticDiagnostics02.ts | 28 ++++++------------- 26 files changed, 100 insertions(+), 218 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index b244ac9d589..f5efa233a61 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1239,22 +1239,23 @@ Actual: ${stringify(fullActual)}`); return this.languageService.findReferences(this.activeFile.fileName, this.currentCaretPosition); } - public getSyntacticDiagnostics(expected: ReadonlyArray) { + public getSyntacticDiagnostics(expected: ReadonlyArray) { const diagnostics = this.languageService.getSyntacticDiagnostics(this.activeFile.fileName); - this.testDiagnostics(expected, diagnostics); + this.testDiagnostics(expected, diagnostics, "error"); } - public getSemanticDiagnostics(expected: ReadonlyArray) { + public getSemanticDiagnostics(expected: ReadonlyArray) { const diagnostics = this.languageService.getSemanticDiagnostics(this.activeFile.fileName); - this.testDiagnostics(expected, diagnostics); + this.testDiagnostics(expected, diagnostics, "error"); } - public getSuggestionDiagnostics(expected: ReadonlyArray): void { - this.testDiagnostics(expected, this.languageService.getSuggestionDiagnostics(this.activeFile.fileName)); + public getSuggestionDiagnostics(expected: ReadonlyArray): void { + this.testDiagnostics(expected, this.languageService.getSuggestionDiagnostics(this.activeFile.fileName), "suggestion"); } - private testDiagnostics(expected: ReadonlyArray, diagnostics: ReadonlyArray) { - assert.deepEqual(ts.realizeDiagnostics(diagnostics, ts.newLineCharacter), expected); + private testDiagnostics(expected: ReadonlyArray, diagnostics: ReadonlyArray, category: string) { + assert.deepEqual(ts.realizeDiagnostics(diagnostics, ts.newLineCharacter), expected.map(e => ( + { message: e.message, category, code: e.code, ...ts.createTextSpanFromRange(e.range || this.getRanges()[0]) }))); } public verifyQuickInfoAt(markerName: string, expectedText: string, expectedDocumentation?: string) { @@ -4676,4 +4677,10 @@ namespace FourSlashInterface { source?: string; description: string; } + + export interface Diagnostic { + message: string; + range?: FourSlash.Range; + code: number; + } } diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 7561ca3793d..0bf9a6d3913 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -347,9 +347,9 @@ declare namespace FourSlashInterface { start: number; length: number; }, displayParts: ts.SymbolDisplayPart[], documentation: ts.SymbolDisplayPart[], tags: ts.JSDocTagInfo[]): void; - getSyntacticDiagnostics(expected: ReadonlyArray): void; - getSemanticDiagnostics(expected: ReadonlyArray): void; - getSuggestionDiagnostics(expected: ReadonlyArray): void; + getSyntacticDiagnostics(expected: ReadonlyArray): void; + getSemanticDiagnostics(expected: ReadonlyArray): void; + getSuggestionDiagnostics(expected: ReadonlyArray): void; ProjectInfo(expected: string[]): void; allRangesAppearInImplementationList(markerName: string): void; } @@ -521,11 +521,10 @@ declare namespace FourSlashInterface { text: string; range: Range; } - interface RealizedDiagnostic { + interface Diagnostic { message: string; - start: number; - length: number; - category: string; + /** @default `test.ranges()[0]` */ + range?: Range; code: number; } } diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts index 20ca5101ba8..46d9062c468 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// import a = b; +////[|import a = b;|] -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'import ... =' can only be used in a .ts file.", - start: 0, - length: 13, - category: "error", code: 8002 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts index fb9d68336e0..9f859c527d1 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics10.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// function F() { } +////function F<[|T|]>() { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'type parameter declarations' can only be used in a .ts file.", - start: 11, - length: 1, - category: "error", code: 8004 - } -]); +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts index 4a5dafd1042..f3928bf997d 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics11.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// function F(): number { } +////function F(): [|number|] { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'types' can only be used in a .ts file.", - start: 14, - length: 6, - category: "error", code: 8010 - } -]); +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts index fc7956d73c9..e9494017d5d 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics12.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// declare var v; +////[|declare|] var v; -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'declare' can only be used in a .ts file.", - start: 0, - length: 7, - category: "error", code: 8009 - } -]); +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts index 87cc7b37867..98b0471b256 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics13.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// var v: () => number; +////var v: [|() => number|]; -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'types' can only be used in a .ts file.", - start: 7, - length: 12, - category: "error", code: 8010 - } -]); \ No newline at end of file +}]); \ No newline at end of file diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts index 4659897559c..ed694fc4e5b 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics14.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// Foo(); +////Foo<[|number|]>(); -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'type arguments' can only be used in a .ts file.", - start: 4, - length: 6, - category: "error", code: 8011 - } -]); +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts index 31194e37fcb..5e3955a658b 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics15.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// function F(public p) { } +////function F([|public|] p) { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'parameter modifiers' can only be used in a .ts file.", - start: 11, - length: 6, - category: "error", code: 8012 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts index 4d4e3a56287..826c4157036 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics16.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// function F(p?) { } +////function F(p[|?|]) { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'?' can only be used in a .ts file.", - start: 12, - length: 1, - category: "error", code: 8009 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts index f6d4d65a83d..2bda62590d7 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics17.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// function F(a: number) { } +////function F(a: [|number|]) { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'types' can only be used in a .ts file.", - start: 14, - length: 6, - category: "error", code: 8010 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts index 71e098b0ee2..3344a630ca6 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics18.ts @@ -5,32 +5,23 @@ ////class C { //// x; // Regular property declaration allowed //// static y; // static allowed -//// public z; // public not allowed +//// [|public|] z; // public not allowed ////} goTo.file("a.js"); -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "\'public\' can only be used in a .ts file.", - start: 93, - length: 6, - category: "error", code: 8009 - } -]); +}]); // @Filename: b.js ////class C { -//// x: number; // Types not allowed +//// x: [|number|]; // Types not allowed ////} goTo.file("b.js"); -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'types' can only be used in a .ts file.", - start: 17, - length: 6, - category: "error", + range: test.ranges()[1], code: 8010 - } -]); +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts index fe602056dcb..3198615d8b4 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics19.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// enum E { } +////enum [|E|] { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'enum declarations' can only be used in a .ts file.", - start: 5, - length: 1, - category: "error", code: 8015 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts index 0a14c8b5ddf..1ad538071dd 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics2.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// export = b; +////[|export = b;|] -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'export=' can only be used in a .ts file.", - start: 0, - length: 11, - category: "error", code: 8003 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts index 47837864781..709e466bcf1 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics3.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// class C { } +////class C<[|T|]> { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'type parameter declarations' can only be used in a .ts file.", - start: 8, - length: 1, - category: "error", code: 8004 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts index efd8fe85964..936d6ede996 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics4.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// public class C { } +////[|public|] class C { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'public' can only be used in a .ts file.", - start: 0, - length: 6, - category: "error", code: 8009 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts index 0fcc7652101..f0b765e0ce9 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics5.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// class C implements D { } +////class C [|implements D|] { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'implements clauses' can only be used in a .ts file.", - start: 8, - length: 12, - category: "error", code: 8005 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts index 6d4c7e7dcca..565513d8c07 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics6.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// interface I { } +////interface [|I|] { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'interface declarations' can only be used in a .ts file.", - start: 10, - length: 1, - category: "error", code: 8006 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts index 32ebf6bde0d..66985164936 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics7.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// module M { } +////module [|M|] { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'module declarations' can only be used in a .ts file.", - start: 7, - length: 1, - category: "error", code: 8007 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts index 7ab0db792e8..6655f923022 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics8.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// type a = b; +////type [|a|] = b; -verify.getSyntacticDiagnostics([ - { - message: "'type aliases' can only be used in a .ts file.", - start: 5, - length: 1, - category: "error", - code: 8008 - } -]); \ No newline at end of file +verify.getSyntacticDiagnostics([{ + message: "'type aliases' can only be used in a .ts file.", + code: 8008 +}]); diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts index c18f32e378e..fe83ad8488e 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics9.ts @@ -2,14 +2,9 @@ // @allowJs: true // @Filename: a.js -//// public function F() { } +////[|public|] function F() { } -verify.getSyntacticDiagnostics([ - { +verify.getSyntacticDiagnostics([{ message: "'public' can only be used in a .ts file.", - start: 0, - length: 6, - category: "error", code: 8009 - } -]); \ No newline at end of file +}]); diff --git a/tests/cases/fourslash/jsDocAugmentsAndExtends.ts b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts index ca703f33025..c60475c072b 100644 --- a/tests/cases/fourslash/jsDocAugmentsAndExtends.ts +++ b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts @@ -6,7 +6,7 @@ //// /** //// * @augments {Thing} -//// * @extends {Thing} +//// * [|@extends {Thing}|] //// */ //// class MyStringThing extends Thing { //// constructor() { @@ -27,8 +27,5 @@ goTo.marker(); verify.quickInfoIs("(local var) x: number"); verify.getSemanticDiagnostics([{ message: "Class declarations cannot have more than one \`@augments\` or \`@extends\` tag.", - start: 36, - length: 24, - category: "error", code: 8025 }]); diff --git a/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts b/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts index 115964b40f0..927d84ed8ba 100644 --- a/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts +++ b/tests/cases/fourslash/jsFileCompilationDuplicateFunctionImplementation.ts @@ -9,16 +9,13 @@ // @Filename: a.ts // @emitThisFile: true -////function foo() { return 30; }/*2*/ +////function [|foo|]() { return 30; }/*2*/ goTo.marker("1"); verify.getSemanticDiagnostics([]); goTo.marker("2"); verify.getSemanticDiagnostics([{ message: "Duplicate function implementation.", - start: 9, - length: 3, - category: "error", code: 2393 }]); verify.verifyGetEmitOutputContentsForCurrentFile([ @@ -27,9 +24,6 @@ verify.verifyGetEmitOutputContentsForCurrentFile([ goTo.marker("2"); verify.getSemanticDiagnostics([{ message: "Duplicate function implementation.", - start: 9, - length: 3, - category: "error", code: 2393 }]); goTo.marker("1"); diff --git a/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts b/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts index 03303b1e09e..fc910965aad 100644 --- a/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts +++ b/tests/cases/fourslash/refactorConvertToEs6Module_export_named.ts @@ -3,14 +3,12 @@ // @allowJs: true // @Filename: /a.js -////exports.f = function() {}/*diagEnd*/ -////exports.C = class {} +////[|exports.f = function() {}|]; +////exports.C = class {}; ////exports.x = 0; verify.getSuggestionDiagnostics([{ message: "File is a CommonJS module; it may be converted to an ES6 module.", - start: 0, - length: test.marker("diagEnd").position, category: "suggestion", code: 80001, }]); diff --git a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts index d06395186e4..9b3153b13ac 100644 --- a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts +++ b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics01.ts @@ -2,21 +2,17 @@ // @allowJs: true // @Filename: a.js -//// var ===; +////var [|===|][|;|] verify.getSyntacticDiagnostics([ { message: "Variable declaration expected.", - start: 4, - length: 3, - category: "error", + range: test.ranges()[0], code: 1134 }, { message: "Expression expected.", - start: 7, - length: 1, - category: "error", + range: test.ranges()[1], code: 1109 }, ]); diff --git a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts index ab12a5c146d..4d2b3d5d989 100644 --- a/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts +++ b/tests/cases/fourslash/server/getJavaScriptSyntacticDiagnostics02.ts @@ -2,45 +2,35 @@ // @allowJs: true // @Filename: b.js -//// var a = "a"; -//// var b: boolean = true; -//// function foo(): string { } -//// var var = "c"; +////var a = "a"; +////var b: [|boolean|] = true; +////function foo(): [|string|] { } +////var [|var|] [|=|] [|"c"|]; verify.getSyntacticDiagnostics([ { message: "'types' can only be used in a .ts file.", - start: 20, - length: 7, - category: "error", + range: test.ranges()[0], code: 8010 }, { message: "\'types\' can only be used in a .ts file.", - start: 52, - length: 6, - category: "error", + range: test.ranges()[1], code: 8010 }, { message: "Variable declaration expected.", - start: 67, - length: 3, - category: "error", + range: test.ranges()[2], code: 1134 }, { message: "Variable declaration expected.", - start: 71, - length: 1, - category: "error", + range: test.ranges()[3], code: 1134 }, { message: "Variable declaration expected.", - start: 73, - length: 3, - category: "error", + range: test.ranges()[4], code: 1134 }, ]); From 03ba8a0852b5b038d2377d53e9a2e12c860f5a79 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 07:35:42 -0800 Subject: [PATCH 261/298] mergeMapLikes: Improve type (#22237) * mergeMapLikes: Improve type * Make source Partial * T extends object * Update api baseline --- src/server/utilities.ts | 2 +- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/utilities.ts b/src/server/utilities.ts index a086d95f910..2b38de6fa55 100644 --- a/src/server/utilities.ts +++ b/src/server/utilities.ts @@ -83,7 +83,7 @@ namespace ts.server { }; } - export function mergeMapLikes(target: MapLike, source: MapLike): void { + export function mergeMapLikes(target: T, source: Partial): void { for (const key in source) { if (hasProperty(source, key)) { target[key] = source[key]; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 43ebec6ad24..c04a26b117c 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4966,7 +4966,7 @@ declare namespace ts.server { function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never; } function getDefaultFormatCodeSettings(host: ServerHost): FormatCodeSettings; - function mergeMapLikes(target: MapLike, source: MapLike): void; + function mergeMapLikes(target: T, source: Partial): void; type NormalizedPath = string & { __normalizedPathTag: any; }; From a9440cb05739fc1bbcb4214b30a42b336bbb0ab7 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 1 Mar 2018 17:10:24 +0000 Subject: [PATCH 262/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl index d08460314f5..7f8a35da56a 100644 --- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -903,6 +903,15 @@ + + + + + + + + + @@ -915,6 +924,15 @@ + + + + + + + + + @@ -939,6 +957,15 @@ + + + + + + + + + From 24d3035184ce859741077de8c944a3c3a3d59f79 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 1 Mar 2018 09:55:58 -0800 Subject: [PATCH 263/298] Added --preserveWatchOutput flag (#21303) Description: "Whether to keep outdated console output in watch mode instead of clearing the screen." Since the `pretty?` compiler options flag is marked as `@internal`, made this one too. --- src/compiler/commandLineParser.ts | 7 +++++++ src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/types.ts | 1 + src/compiler/watch.ts | 1 + src/harness/unittests/tscWatchMode.ts | 23 ++++++++++++++++------- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 825f2c632e7..f61efe57cac 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -62,6 +62,13 @@ namespace ts { category: Diagnostics.Command_line_Options, description: Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, + { + name: "preserveWatchOutput", + type: "boolean", + showInSimplifiedHelpView: false, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen, + }, { name: "watch", shortName: "w", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index ba69e4db966..ced3699c6d4 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3472,6 +3472,10 @@ "category": "Message", "code": 6190 }, + "Whether to keep outdated console output in watch mode instead of clearing the screen.": { + "category": "Message", + "code": 6191 + }, "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 3be8602f6d2..cc78623382e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4100,6 +4100,7 @@ namespace ts { /*@internal*/ plugins?: PluginImport[]; preserveConstEnums?: boolean; preserveSymlinks?: boolean; + /* @internal */ preserveWatchOutput?: boolean; project?: string; /* @internal */ pretty?: DiagnosticStyle; reactNamespace?: string; diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index ff21c750089..8494323a60d 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -33,6 +33,7 @@ namespace ts { function clearScreenIfNotWatchingForFileChanges(system: System, diagnostic: Diagnostic, options: CompilerOptions) { if (system.clearScreen && + !options.preserveWatchOutput && diagnostic.code !== Diagnostics.Compilation_complete_Watching_for_file_changes.code && !options.extendedDiagnostics && !options.diagnostics) { diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 17431d17da6..5f5d871304f 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -2162,7 +2162,7 @@ declare module "fs" { }); describe("tsc-watch console clearing", () => { - function checkConsoleClearing(diagnostics: boolean, extendedDiagnostics: boolean) { + function checkConsoleClearing(options: CompilerOptions = {}) { const file = { path: "f.ts", content: "" @@ -2172,7 +2172,7 @@ declare module "fs" { let clearCount: number | undefined; checkConsoleClears(); - createWatchOfFilesAndCompilerOptions([file.path], host, { diagnostics, extendedDiagnostics }); + createWatchOfFilesAndCompilerOptions([file.path], host, options); checkConsoleClears(); file.content = "//"; @@ -2182,10 +2182,10 @@ declare module "fs" { checkConsoleClears(); function checkConsoleClears() { - if (clearCount === undefined) { + if (clearCount === undefined || options.preserveWatchOutput) { clearCount = 0; } - else if (!diagnostics && !extendedDiagnostics) { + else if (!options.diagnostics && !options.extendedDiagnostics) { clearCount++; } host.checkScreenClears(clearCount); @@ -2194,13 +2194,22 @@ declare module "fs" { } it("without --diagnostics or --extendedDiagnostics", () => { - checkConsoleClearing(/*diagnostics*/ false, /*extendedDiagnostics*/ false); + checkConsoleClearing(); }); it("with --diagnostics", () => { - checkConsoleClearing(/*diagnostics*/ true, /*extendedDiagnostics*/ false); + checkConsoleClearing({ + diagnostics: true, + }); }); it("with --extendedDiagnostics", () => { - checkConsoleClearing(/*diagnostics*/ false, /*extendedDiagnostics*/ true); + checkConsoleClearing({ + extendedDiagnostics: true, + }); + }); + it("with --preserveWatchOutput", () => { + checkConsoleClearing({ + preserveWatchOutput: true, + }); }); }); } From 0a72568e5996416de140360d9f50dfd84e99fa9c Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 12:46:00 -0800 Subject: [PATCH 264/298] findAllReferences: Make definition info independent of search location (#21748) --- src/services/findAllReferences.ts | 82 +++++++++---------- ...cellationWhenfindingAllRefsOnDefinition.ts | 5 +- .../findAllReferencesOfConstructor.ts | 4 +- ...dAllReferencesOfConstructor_badOverload.ts | 2 +- .../cases/fourslash/findAllRefsDefinition.ts | 7 +- ...indAllRefsExportDefaultClassConstructor.ts | 2 +- .../fourslash/findAllRefsForDefaultExport.ts | 3 +- .../findAllRefsForDefaultExport01.ts | 5 +- .../findAllRefsForDefaultExport03.ts | 5 +- .../findAllRefsImportStarOfExportEquals.ts | 19 +---- .../findAllRefsOfConstructor_withModifier.ts | 2 +- .../fourslash/findAllRefsOnDefinition.ts | 5 +- .../fourslash/findAllRefsOnDefinition2.ts | 5 +- .../fourslash/findAllRefsOnImportAliases.ts | 7 +- .../fourslash/findAllRefsOnImportAliases2.ts | 3 +- tests/cases/fourslash/findAllRefsReExports.ts | 21 ++--- tests/cases/fourslash/fourslash.ts | 2 +- .../getOccurrencesIsDefinitionOfClass.ts | 5 +- ...rencesIsDefinitionOfInterfaceClassMerge.ts | 5 +- tests/cases/fourslash/referenceToClass.ts | 5 +- .../referencesForGlobalsInExternalModule.ts | 3 +- .../referencesForMergedDeclarations.ts | 3 +- .../referencesForMergedDeclarations3.ts | 3 +- .../referencesForMergedDeclarations4.ts | 4 +- .../referencesForMergedDeclarations5.ts | 2 +- .../referencesForMergedDeclarations7.ts | 2 +- .../referencesForPropertiesOfGenericType.ts | 6 +- ...rencesForStaticsAndMembersWithSameNames.ts | 7 +- tests/cases/fourslash/remoteGetReferences.ts | 10 +-- tests/cases/fourslash/renameDefaultImport.ts | 6 +- .../renameDefaultImportDifferentName.ts | 4 +- tests/cases/fourslash/renameJsExports03.ts | 4 +- .../shims-pp/getReferencesAtPosition.ts | 5 +- .../shims/getReferencesAtPosition.ts | 5 +- .../fourslash/transitiveExportImports.ts | 2 +- 35 files changed, 83 insertions(+), 177 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 3b9d465764e..63cdaa6b1aa 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -8,7 +8,7 @@ namespace ts.FindAllReferences { } export type Definition = - | { type: "symbol"; symbol: Symbol; node: Node } + | { type: "symbol"; symbol: Symbol } | { type: "label"; node: Identifier } | { type: "keyword"; node: ts.Node } | { type: "this"; node: ts.Node } @@ -42,11 +42,12 @@ namespace ts.FindAllReferences { } export function findReferencedSymbols(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number): ReferencedSymbol[] | undefined { - const referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); + const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + const referencedSymbols = Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, /*options*/ {}); const checker = program.getTypeChecker(); return !referencedSymbols || !referencedSymbols.length ? undefined : mapDefined(referencedSymbols, ({ definition, references }) => // Only include referenced symbols that have a valid definition. - definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }); + definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker, node), references: references.map(toReferenceEntry) }); } export function getImplementationsAtPosition(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number): ImplementationLocation[] { @@ -83,31 +84,26 @@ namespace ts.FindAllReferences { } export function findReferencedEntries(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number, options?: Options): ReferenceEntry[] | undefined { - const x = flattenEntries(findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options)); - return map(x, toReferenceEntry); + const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return map(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), toReferenceEntry); } export function getReferenceEntriesForNode(position: number, node: Node, program: Program, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken, options: Options = {}): Entry[] | undefined { return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)); } - function findAllReferencedSymbols(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number, options?: Options): SymbolAndEntries[] | undefined { - const node = getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - return Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); - } - function flattenEntries(referenceSymbols: SymbolAndEntries[]): Entry[] { return referenceSymbols && flatMap(referenceSymbols, r => r.references); } - function definitionToReferencedSymbolDefinitionInfo(def: Definition, checker: TypeChecker): ReferencedSymbolDefinitionInfo | undefined { + function definitionToReferencedSymbolDefinitionInfo(def: Definition, checker: TypeChecker, originalNode: Node): ReferencedSymbolDefinitionInfo | undefined { const info = (() => { switch (def.type) { case "symbol": { - const { symbol, node } = def; - const { displayParts, kind } = getDefinitionKindAndDisplayParts(symbol, node, checker); + const { symbol } = def; + const { displayParts, kind } = getDefinitionKindAndDisplayParts(symbol, checker, originalNode); const name = displayParts.map(p => p.text).join(""); - return { node, name, kind, displayParts }; + return { node: symbol.declarations ? getNameOfDeclaration(first(symbol.declarations)) || first(symbol.declarations) : originalNode, name, kind, displayParts }; } case "label": { const { node } = def; @@ -129,13 +125,11 @@ namespace ts.FindAllReferences { const { node } = def; return { node, name: node.text, kind: ScriptElementKind.variableElement, displayParts: [displayPart(getTextOfNode(node), SymbolDisplayPartKind.stringLiteral)] }; } + default: + return Debug.assertNever(def); } })(); - if (!info) { - return undefined; - } - const { node, name, kind, displayParts } = info; const sourceFile = node.getSourceFile(); return { @@ -149,9 +143,11 @@ namespace ts.FindAllReferences { }; } - function getDefinitionKindAndDisplayParts(symbol: Symbol, node: Node, checker: TypeChecker): { displayParts: SymbolDisplayPart[], kind: ScriptElementKind } { + function getDefinitionKindAndDisplayParts(symbol: Symbol, checker: TypeChecker, node: Node): { displayParts: SymbolDisplayPart[], kind: ScriptElementKind } { + const meaning = Core.getIntersectingMeaningFromDeclarations(node, symbol); + const enclosingDeclaration = firstOrUndefined(symbol.declarations) || node; const { displayParts, symbolKind } = - SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), getContainerNode(node), node); + SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning); return { displayParts, kind: symbolKind }; } @@ -186,7 +182,7 @@ namespace ts.FindAllReferences { function implementationKindDisplayParts(node: ts.Node, checker: ts.TypeChecker): { kind: ScriptElementKind, displayParts: SymbolDisplayPart[] } { const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node); if (symbol) { - return getDefinitionKindAndDisplayParts(symbol, node, checker); + return getDefinitionKindAndDisplayParts(symbol, checker, node); } else if (node.kind === SyntaxKind.ObjectLiteralExpression) { return { @@ -317,10 +313,7 @@ namespace ts.FindAllReferences.Core { } } - return [{ - definition: { type: "symbol", symbol, node: symbol.valueDeclaration }, - references - }]; + return [{ definition: { type: "symbol", symbol }, references }]; } /** getReferencedSymbols for special node kinds. */ @@ -357,13 +350,13 @@ namespace ts.FindAllReferences.Core { symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; // Compute the meaning from the location and the symbol it references - const searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), symbol.declarations); + const searchMeaning = getIntersectingMeaningFromDeclarations(node, symbol); const result: SymbolAndEntries[] = []; const state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result); if (node.kind === SyntaxKind.DefaultKeyword) { - addReference(node, symbol, node, state); + addReference(node, symbol, state); searchForImportsOfExport(node, symbol, { exportingModuleSymbol: Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: ExportKind.Default }, state); } else { @@ -434,7 +427,6 @@ namespace ts.FindAllReferences.Core { /** If coming from an export, we will not recursively search for the imported symbol (since that's where we came from). */ readonly comingFrom?: ImportExport; - readonly location: Node; readonly symbol: Symbol; readonly text: string; readonly escapedText: __String; @@ -514,7 +506,7 @@ namespace ts.FindAllReferences.Core { const escapedText = escapeLeadingUnderscores(text); const parents = this.options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, this.checker); return { - location, symbol, comingFrom, text, escapedText, parents, + symbol, comingFrom, text, escapedText, parents, includes: referenceSymbol => allSearchSymbols ? contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol, }; } @@ -524,12 +516,12 @@ namespace ts.FindAllReferences.Core { * Callback to add references for a particular searched symbol. * This initializes a reference group, so only call this if you will add at least one reference. */ - referenceAdder(searchSymbol: Symbol, searchLocation: Node): (node: Node) => void { + referenceAdder(searchSymbol: Symbol): (node: Node) => void { const symbolId = getSymbolId(searchSymbol); let references = this.symbolIdToReferences[symbolId]; if (!references) { references = this.symbolIdToReferences[symbolId] = []; - this.result.push({ definition: { type: "symbol", symbol: searchSymbol, node: searchLocation }, references }); + this.result.push({ definition: { type: "symbol", symbol: searchSymbol }, references }); } return node => references.push(nodeEntry(node)); } @@ -559,7 +551,7 @@ namespace ts.FindAllReferences.Core { // For `import { foo as bar }` just add the reference to `foo`, and don't otherwise search in the file. if (singleReferences.length) { - const addRef = state.referenceAdder(exportSymbol, exportLocation); + const addRef = state.referenceAdder(exportSymbol); for (const singleRef of singleReferences) { addRef(singleRef); } @@ -862,7 +854,7 @@ namespace ts.FindAllReferences.Core { switch (state.specialSearchKind) { case SpecialSearchKind.None: - addReference(referenceLocation, relatedSymbol, search.location, state); + addReference(referenceLocation, relatedSymbol, state); break; case SpecialSearchKind.Constructor: addConstructorReferences(referenceLocation, sourceFile, search, state); @@ -896,7 +888,7 @@ namespace ts.FindAllReferences.Core { } if (!state.options.isForRename && state.markSeenReExportRHS(name)) { - addReference(name, referenceSymbol, name, state); + addReference(name, referenceSymbol, state); } } else { @@ -920,7 +912,7 @@ namespace ts.FindAllReferences.Core { } function addRef() { - addReference(referenceLocation, localSymbol, search.location, state); + addReference(referenceLocation, localSymbol, state); } } @@ -969,12 +961,12 @@ namespace ts.FindAllReferences.Core { * position of property accessing, the referenceEntry of such position will be handled in the first case. */ if (!(flags & SymbolFlags.Transient) && search.includes(shorthandValueSymbol)) { - addReference(getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, search.location, state); + addReference(getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, state); } } - function addReference(referenceLocation: Node, relatedSymbol: Symbol, searchLocation: Node, state: State): void { - const addRef = state.referenceAdder(relatedSymbol, searchLocation); + function addReference(referenceLocation: Node, relatedSymbol: Symbol, state: State): void { + const addRef = state.referenceAdder(relatedSymbol); if (state.options.implementations) { addImplementationReferences(referenceLocation, addRef, state); } @@ -986,10 +978,10 @@ namespace ts.FindAllReferences.Core { /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ function addConstructorReferences(referenceLocation: Node, sourceFile: SourceFile, search: Search, state: State): void { if (isNewExpressionTarget(referenceLocation)) { - addReference(referenceLocation, search.symbol, search.location, state); + addReference(referenceLocation, search.symbol, state); } - const pusher = () => state.referenceAdder(search.symbol, search.location); + const pusher = () => state.referenceAdder(search.symbol); if (isClassLike(referenceLocation.parent)) { Debug.assert(referenceLocation.kind === SyntaxKind.DefaultKeyword || referenceLocation.parent.name === referenceLocation); @@ -1006,11 +998,11 @@ namespace ts.FindAllReferences.Core { } function addClassStaticThisReferences(referenceLocation: Node, search: Search, state: State): void { - addReference(referenceLocation, search.symbol, search.location, state); + addReference(referenceLocation, search.symbol, state); if (isClassLike(referenceLocation.parent)) { Debug.assert(referenceLocation.parent.name === referenceLocation); // This is the class declaration. - addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location)); + addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol)); } } @@ -1300,7 +1292,7 @@ namespace ts.FindAllReferences.Core { return container && (ModifierFlags.Static & getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : undefined; }); - return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references }]; + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol }, references }]; } function getReferencesForThisKeyword(thisOrSuperKeyword: Node, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken): SymbolAndEntries[] { @@ -1645,7 +1637,9 @@ namespace ts.FindAllReferences.Core { * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) * do not intersect in any of the three spaces. */ - function getIntersectingMeaningFromDeclarations(meaning: SemanticMeaning, declarations: Declaration[]): SemanticMeaning { + export function getIntersectingMeaningFromDeclarations(node: Node, symbol: Symbol): SemanticMeaning { + let meaning = getMeaningFromLocation(node); + const { declarations } = symbol; if (declarations) { let lastIterationMeaning: SemanticMeaning; do { diff --git a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts index 13927f9d2dd..9334ab28b48 100644 --- a/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts +++ b/tests/cases/fourslash/cancellationWhenfindingAllRefsOnDefinition.ts @@ -33,8 +33,5 @@ cancellation.resetCancelled(); checkRefs(); function checkRefs() { - const ranges = test.ranges(); - const [r0, r1] = ranges; - verify.referenceGroups(r0, [{ definition: "(method) Test.start(): this", ranges }]); - verify.referenceGroups(r1, [{ definition: "(method) Second.Test.start(): Second.Test", ranges }]); + verify.singleReferenceGroup("(method) Test.start(): this"); } diff --git a/tests/cases/fourslash/findAllReferencesOfConstructor.ts b/tests/cases/fourslash/findAllReferencesOfConstructor.ts index d177907b974..3dffdeaffb9 100644 --- a/tests/cases/fourslash/findAllReferencesOfConstructor.ts +++ b/tests/cases/fourslash/findAllReferencesOfConstructor.ts @@ -42,8 +42,8 @@ const ranges = test.ranges(); const [a0, a1, a2, a3, a4, b0, c0, d0, d1] = ranges; -verify.referenceGroups([a0, a2], defs("constructor C(n: number): C (+1 overload)")); -verify.referenceGroups(a1, defs("constructor C(): C (+1 overload)")); +verify.referenceGroups([a0, a2], defs("class C")); +verify.referenceGroups(a1, defs("class C")); function defs(definition: string) { return [ diff --git a/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts b/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts index bb8b62a1462..2c4857145e1 100644 --- a/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts +++ b/tests/cases/fourslash/findAllReferencesOfConstructor_badOverload.ts @@ -5,4 +5,4 @@ //// [|constructor|](){} ////} -verify.singleReferenceGroup("constructor C(n: number): C"); +verify.singleReferenceGroup("class C"); diff --git a/tests/cases/fourslash/findAllRefsDefinition.ts b/tests/cases/fourslash/findAllRefsDefinition.ts index 611bacf52ca..7b7016e7049 100644 --- a/tests/cases/fourslash/findAllRefsDefinition.ts +++ b/tests/cases/fourslash/findAllRefsDefinition.ts @@ -3,13 +3,10 @@ ////const [|{| "isWriteAccess": true, "isDefinition": true |}x|] = 0; ////[|x|]; -// TODO: GH#21301 - const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.referenceGroups(r1, [ +verify.referenceGroups(ranges, [ { - definition: { text: "const x: 0", range: r1 }, + definition: { text: "const x: 0", range: ranges[0] }, ranges, }, ]) diff --git a/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts b/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts index 4cd0ab1ce3d..0f269bd5f5b 100644 --- a/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts +++ b/tests/cases/fourslash/findAllRefsExportDefaultClassConstructor.ts @@ -2,4 +2,4 @@ //// [|constructor|]() {} ////} -verify.singleReferenceGroup("constructor default(): default"); +verify.singleReferenceGroup("class default"); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport.ts b/tests/cases/fourslash/findAllRefsForDefaultExport.ts index 1fe48cd78ae..71c566a6f42 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport.ts @@ -16,7 +16,6 @@ verify.referenceGroups(r0, [ { definition: "function f(): void", ranges: [r0] }, { definition: "(alias) function g(): void\nimport g", ranges: [r1, r2] } ]); -verify.referenceGroups(r1, [{ definition: "(alias) function g(): void\nimport g", ranges: [r1, r2] }]); -verify.referenceGroups(r2, [{ definition: "(alias) g(): void\nimport g", ranges: [r1, r2] }]); +verify.singleReferenceGroup("(alias) function g(): void\nimport g", [r1, r2]); verify.goToDefinition("ref", "def"); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport01.ts b/tests/cases/fourslash/findAllRefsForDefaultExport01.ts index c04550e54f3..419262bd10f 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport01.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport01.ts @@ -7,7 +7,4 @@ //// ////var y = new [|DefaultExportedClass|]; -const ranges = test.ranges(); -const [r0, r1, r2] = ranges; -verify.referenceGroups([r0, r1], [{ definition: "class DefaultExportedClass", ranges }]); -verify.referenceGroups(r2, [{ definition: "constructor DefaultExportedClass(): DefaultExportedClass", ranges }]); +verify.singleReferenceGroup("class DefaultExportedClass"); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport03.ts b/tests/cases/fourslash/findAllRefsForDefaultExport03.ts index d94043f4016..75cbe556e36 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport03.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport03.ts @@ -14,7 +14,4 @@ //// var local = 100; ////} -const ranges = test.ranges(); -const [r0, r1, r2, r3, r4] = ranges; -verify.referenceGroups([r0, r3], [{ definition: "function f(): number\nnamespace f", ranges }]); -verify.referenceGroups([r1, r2, r4], [{ definition: "namespace f\nfunction f(): number", ranges }]); +verify.singleReferenceGroup("namespace f\nfunction f(): number"); diff --git a/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts b/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts index 033532a18ad..7cab65bc388 100644 --- a/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts +++ b/tests/cases/fourslash/findAllRefsImportStarOfExportEquals.ts @@ -27,34 +27,21 @@ const aRanges = [a0, a1, a2]; const bRanges = [b0, b1, b2]; const cRanges = [c0, c1, c2]; -verify.referenceGroups(a0, [ - { definition: "function a(): void\nnamespace a", ranges: aRanges }, - { definition: "(alias) function b(): void\n(alias) namespace b\nimport b", ranges: bRanges }, - { definition: "(alias) function a(): void\n(alias) namespace a\nimport a", ranges: cRanges } -]); -verify.referenceGroups([a1, a2], [ +verify.referenceGroups([a0, a1, a2], [ { definition: "namespace a\nfunction a(): void", ranges: aRanges }, { definition: "(alias) function b(): void\n(alias) namespace b\nimport b", ranges: bRanges }, { definition: "(alias) function a(): void\n(alias) namespace a\nimport a", ranges: cRanges } ]); -verify.referenceGroups([b0, b0], [ +verify.referenceGroups([b0, b1], [ { definition: "(alias) function b(): void\n(alias) namespace b\nimport b", ranges: bRanges } ]); -verify.referenceGroups(b1, [ - { definition: "(alias) b(): void\nimport b", ranges: bRanges } -]); -verify.referenceGroups([c0, c2], [ +verify.referenceGroups([c0, c1, c2], [ { definition: "(alias) function a(): void\n(alias) namespace a\nimport a", ranges: cRanges }, { definition: "namespace a\nfunction a(): void", ranges: aRanges }, { definition: "(alias) function b(): void\n(alias) namespace b\nimport b", ranges: bRanges } ]); -verify.referenceGroups(c1, [ - { definition: "(alias) a(): void\nimport a", ranges: cRanges }, - { definition: "namespace a\nfunction a(): void", ranges: aRanges }, - { definition: "(alias) function b(): void\n(alias) namespace b\nimport b", ranges: bRanges } -]); verify.renameLocations(aRanges, aRanges.concat(cRanges)); verify.rangesAreRenameLocations(bRanges); diff --git a/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts b/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts index 061903e703d..c425029490f 100644 --- a/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts +++ b/tests/cases/fourslash/findAllRefsOfConstructor_withModifier.ts @@ -6,4 +6,4 @@ ////var x = new [|X|](); const ranges = test.ranges(); -verify.referenceGroups(ranges[0], [{ definition: "constructor X(): X", ranges }]); +verify.referenceGroups(ranges[0], [{ definition: "class X", ranges }]); diff --git a/tests/cases/fourslash/findAllRefsOnDefinition.ts b/tests/cases/fourslash/findAllRefsOnDefinition.ts index 99b402aba8c..91582b92884 100644 --- a/tests/cases/fourslash/findAllRefsOnDefinition.ts +++ b/tests/cases/fourslash/findAllRefsOnDefinition.ts @@ -23,7 +23,4 @@ ////second.[|start|](); ////second.stop(); -const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.referenceGroups(r0, [{ definition: "(method) Test.start(): this", ranges }]); -verify.referenceGroups(r1, [{ definition: "(method) Second.Test.start(): Second.Test", ranges }]); +verify.singleReferenceGroup("(method) Test.start(): this"); diff --git a/tests/cases/fourslash/findAllRefsOnDefinition2.ts b/tests/cases/fourslash/findAllRefsOnDefinition2.ts index 0212d12a3be..9a0fd390c1e 100644 --- a/tests/cases/fourslash/findAllRefsOnDefinition2.ts +++ b/tests/cases/fourslash/findAllRefsOnDefinition2.ts @@ -14,7 +14,4 @@ ////var start: Second.Test.[|start|]; ////var stop: Second.Test.stop; -const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.referenceGroups(r0, [{ definition: "interface Test.start", ranges }]); -verify.referenceGroups(r1, [{ definition: "interface Second.Test.start", ranges }]); +verify.singleReferenceGroup("interface Test.start"); diff --git a/tests/cases/fourslash/findAllRefsOnImportAliases.ts b/tests/cases/fourslash/findAllRefsOnImportAliases.ts index cb5dc082157..6bec755bce3 100644 --- a/tests/cases/fourslash/findAllRefsOnImportAliases.ts +++ b/tests/cases/fourslash/findAllRefsOnImportAliases.ts @@ -18,9 +18,4 @@ const classes = { definition: "class Class", ranges: [r0] }; const imports = { definition: "(alias) class Class\nimport Class", ranges: [r1, r2] }; const reExports = { definition: "(alias) class Class\nimport Class", ranges: [r3] }; verify.referenceGroups(r0, [classes, imports, reExports]); -verify.referenceGroups(r1, [imports, classes, reExports]); -verify.referenceGroups(r2, [ - { definition: "(alias) new Class(): Class\nimport Class", ranges: [r1, r2] }, - classes, - reExports -]); +verify.referenceGroups([r1, r2], [imports, classes, reExports]); diff --git a/tests/cases/fourslash/findAllRefsOnImportAliases2.ts b/tests/cases/fourslash/findAllRefsOnImportAliases2.ts index 74b099ea767..21dabf5b6e2 100644 --- a/tests/cases/fourslash/findAllRefsOnImportAliases2.ts +++ b/tests/cases/fourslash/findAllRefsOnImportAliases2.ts @@ -22,8 +22,7 @@ const c3s = { definition: "(alias) class C3\nimport C3", ranges: c3Ranges }; verify.referenceGroups(classRanges, [classes, c2s, c3s]); -verify.referenceGroups(c2_0, [c2s]) -verify.referenceGroups(c2_1, [{ definition: "(alias) new C2(): C2\nimport C2", ranges: c2Ranges }]); +verify.referenceGroups(c2Ranges, [c2s]) verify.referenceGroups(c3Ranges, [c3s]); diff --git a/tests/cases/fourslash/findAllRefsReExports.ts b/tests/cases/fourslash/findAllRefsReExports.ts index 9c0e3b26bfc..af2588de455 100644 --- a/tests/cases/fourslash/findAllRefsReExports.ts +++ b/tests/cases/fourslash/findAllRefsReExports.ts @@ -33,25 +33,14 @@ const eBoom = { definition: "(alias) function boom(): void\nimport boom", ranges verify.referenceGroups([foo0, foo1, foo2], [a, b, eBar, c, d, eBoom, eBaz, eBang]); verify.referenceGroups(bar0, [b, eBar]); -verify.referenceGroups(bar1, [eBar, b]); -verify.referenceGroups(bar2, [{ ...eBar, definition: "(alias) bar(): void\nimport bar" }, b]); +verify.referenceGroups([bar1, bar2], [eBar, b]); -verify.referenceGroups([defaultC], [c, d, eBoom, eBaz, eBang]); +verify.referenceGroups([defaultC, defaultE], [c, d, eBoom, eBaz, eBang]); verify.referenceGroups(defaultD, [d, eBoom, a, b, eBar,c, eBaz, eBang]); -verify.referenceGroups(defaultE, [c, d, eBoom, eBaz, eBang]); -verify.referenceGroups(baz0, [eBaz, c, d, eBoom, eBang]); -verify.referenceGroups(baz1, [ - { ...eBaz, definition: "(alias) baz(): void\nimport baz" }, - c, d, eBoom, eBang, -]); +verify.referenceGroups([baz0, baz1], [eBaz, c, d, eBoom, eBang]); -verify.referenceGroups(bang0, [eBang]); -verify.referenceGroups(bang1, [{ ...eBang, definition: "(alias) bang(): void\nimport bang" }]); -verify.referenceGroups(boom0, [eBoom, d, a, b, eBar, c, eBaz, eBang]); -verify.referenceGroups(boom1, [ - { ...eBoom, definition: "(alias) boom(): void\nimport boom" }, - d, a, b, eBar, c, eBaz, eBang, -]); +verify.referenceGroups([bang0, bang1], [eBang]); +verify.referenceGroups([boom0, boom1], [eBoom, d, a, b, eBar, c, eBaz, eBang]); test.rangesByText().forEach((ranges, text) => { if (text === "default") { diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 0bf9a6d3913..b318b05c8c8 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -517,7 +517,7 @@ declare namespace FourSlashInterface { }; } - interface ReferencesDefinition { + type ReferencesDefinition = string | { text: string; range: Range; } diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts index b39c11dfe6b..302ed5ce6f5 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfClass.ts @@ -7,7 +7,4 @@ ////} ////let c = new [|C|](); -const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.referenceGroups(r0, [{ definition: "class C", ranges }]); -verify.referenceGroups(r1, [{ definition: "constructor C(): C", ranges }]); +verify.singleReferenceGroup("class C"); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts index 0e949ca6496..0e363a216eb 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfInterfaceClassMerge.ts @@ -13,7 +13,4 @@ ////let i: [|Numbers|] = new [|Numbers|](); ////let x = i.f(i.p + i.m); -const ranges = test.ranges(); -const [r0, r1, r2, r3, r4] = ranges; -verify.referenceGroups([r0, r1, r2, r3], [{ definition: "class Numbers\ninterface Numbers", ranges }]); -verify.referenceGroups(r4, [{ definition: "constructor Numbers(): Numbers", ranges }]); +verify.singleReferenceGroup("class Numbers\ninterface Numbers"); diff --git a/tests/cases/fourslash/referenceToClass.ts b/tests/cases/fourslash/referenceToClass.ts index d6d2171507c..d74f24703d2 100644 --- a/tests/cases/fourslash/referenceToClass.ts +++ b/tests/cases/fourslash/referenceToClass.ts @@ -20,7 +20,4 @@ // @Filename: referenceToClass_2.ts ////var k: [|foo|]; -const ranges = test.ranges(); -const [r0, r1, r2, r3, r4, r5] = ranges; -verify.referenceGroups([r0, r1, r2, r4, r5], [{ definition: "class foo", ranges }]); -verify.referenceGroups(r3, [{ definition: "constructor foo(): foo", ranges }]); +verify.singleReferenceGroup("class foo"); diff --git a/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts b/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts index 5047a2f12a4..7bfbb0ff881 100644 --- a/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts +++ b/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts @@ -22,8 +22,7 @@ const ranges = test.rangesByText(); verify.singleReferenceGroup("var topLevelVar: number", ranges.get("topLevelVar")); const topLevelClass = ranges.get("topLevelClass"); -verify.referenceGroups(topLevelClass[0], [{ definition: "class topLevelClass", ranges: topLevelClass }]); -verify.referenceGroups(topLevelClass[1], [{ definition: "constructor topLevelClass(): topLevelClass", ranges: topLevelClass }]); +verify.singleReferenceGroup("class topLevelClass", topLevelClass); verify.singleReferenceGroup("interface topLevelInterface", ranges.get("topLevelInterface")); verify.singleReferenceGroup("namespace topLevelModule", ranges.get("topLevelModule")); diff --git a/tests/cases/fourslash/referencesForMergedDeclarations.ts b/tests/cases/fourslash/referencesForMergedDeclarations.ts index 3e2fe8e4b2c..a6a5220497a 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations.ts @@ -17,5 +17,4 @@ const [type1, namespace1, value1, namespace2, type2, value2] = test.ranges(); verify.singleReferenceGroup("interface Foo\nnamespace Foo\nfunction Foo(): void", [type1, type2]); verify.singleReferenceGroup("namespace Foo\nfunction Foo(): void", [namespace1, namespace2]); -verify.referenceGroups(value1, [{ definition: "function Foo(): void\nnamespace Foo", ranges: [value1, value2] }]); -verify.referenceGroups(value2, [{ definition: "namespace Foo\nfunction Foo(): void", ranges: [value1, value2] }]); +verify.singleReferenceGroup("namespace Foo\nfunction Foo(): void", [value1, value2]); diff --git a/tests/cases/fourslash/referencesForMergedDeclarations3.ts b/tests/cases/fourslash/referencesForMergedDeclarations3.ts index 5ce024258ed..27c442b5bcc 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations3.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations3.ts @@ -23,5 +23,4 @@ const [class0, module0, class1, module1, class2, class3, class4, class5] = test.ranges(); verify.singleReferenceGroup("class testClass\nnamespace testClass", [module0, module1]); const classes = [class0, class1, class2, class3, class4, class5]; -verify.referenceGroups(classes.slice(0, 5), [{ definition: "class testClass\nnamespace testClass", ranges: classes }]); -verify.referenceGroups(class5, [{ definition: "constructor testClass(): testClass\nnamespace testClass", ranges: classes }]); +verify.referenceGroups(classes, [{ definition: "class testClass\nnamespace testClass", ranges: classes }]); diff --git a/tests/cases/fourslash/referencesForMergedDeclarations4.ts b/tests/cases/fourslash/referencesForMergedDeclarations4.ts index 55eb331dd90..14189120197 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations4.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations4.ts @@ -22,6 +22,4 @@ ////[|testClass|].s; ////new [|testClass|](); -const ranges = test.ranges(); -verify.referenceGroups(ranges.slice(0, 8), [{ definition: "class testClass\nnamespace testClass", ranges }]); -verify.referenceGroups(ranges[8], [{ definition: "constructor testClass(): testClass\nnamespace testClass", ranges }]); +verify.singleReferenceGroup("class testClass\nnamespace testClass"); diff --git a/tests/cases/fourslash/referencesForMergedDeclarations5.ts b/tests/cases/fourslash/referencesForMergedDeclarations5.ts index 8cf597333b0..0116389a4de 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations5.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations5.ts @@ -10,5 +10,5 @@ const ranges = test.ranges(); const [r0, r1, r2, r3] = ranges; verify.referenceGroups(r0, [{ definition: "interface Foo\nnamespace Foo\nfunction Foo(): void", ranges: [r0, r3] }]); verify.referenceGroups(r1, [{ definition: "namespace Foo\nfunction Foo(): void", ranges: [r1, r3] }]); -verify.referenceGroups(r2, [{ definition: "function Foo(): void\nnamespace Foo", ranges: [r2, r3] }]); +verify.referenceGroups(r2, [{ definition: "namespace Foo\nfunction Foo(): void", ranges: [r2, r3] }]); verify.referenceGroups(r3, [{ definition: "interface Foo\nnamespace Foo\nfunction Foo(): void", ranges }]); diff --git a/tests/cases/fourslash/referencesForMergedDeclarations7.ts b/tests/cases/fourslash/referencesForMergedDeclarations7.ts index 66acffde980..7defbecf6a1 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations7.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations7.ts @@ -14,5 +14,5 @@ const ranges = test.ranges(); const [r0, r1, r2, r3] = ranges; verify.referenceGroups(r0, [{ definition: "interface Foo.Bar\nnamespace Foo.Bar\nfunction Foo.Bar(): void", ranges: [r0, r3] }]); verify.referenceGroups(r1, [{ definition: "namespace Foo.Bar\nfunction Foo.Bar(): void", ranges: [r1, r3] }]); -verify.referenceGroups(r2, [{ definition: "function Foo.Bar(): void\nnamespace Foo.Bar", ranges: [r2, r3] }]); +verify.referenceGroups(r2, [{ definition: "namespace Foo.Bar\nfunction Foo.Bar(): void", ranges: [r2, r3] }]); verify.referenceGroups(r3, [{ definition: "interface Foo.Bar\nnamespace Foo.Bar\nfunction Foo.Bar(): void", ranges }]); diff --git a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts index 34c84dba5ca..a84bdc6315a 100644 --- a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts +++ b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts @@ -10,8 +10,4 @@ ////var y: IFoo; ////y.[|doSomething|](12); -const ranges = test.ranges(); -const [r0, r1, r2] = ranges; -verify.referenceGroups(r0, [{ definition: "(method) IFoo.doSomething(v: T): T", ranges }]); -verify.referenceGroups(r1, [{ definition: "(method) IFoo.doSomething(v: string): string", ranges }]); -verify.referenceGroups(r2, [{ definition: "(method) IFoo.doSomething(v: number): number", ranges }]); +verify.singleReferenceGroup("(method) IFoo.doSomething(v: T): T"); diff --git a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts index 1e393ef6761..9e7f30f4c49 100644 --- a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts +++ b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts @@ -34,10 +34,7 @@ verify.singleReferenceGroup("(method) MixedStaticsClassTest.Foo.foo(): void", [f verify.singleReferenceGroup("(method) MixedStaticsClassTest.Foo.foo(): void", [fooStaticFoo, staticFoo]); // References to a member property with the same name as a static. -//verify.singleReferenceGroup("(property) MixedStaticsClassTest.Foo.bar: Foo", [fooBar, xBar]); -verify.referenceGroups(fooBar, [{ definition: "(property) MixedStaticsClassTest.Foo.bar: Foo", ranges: [fooBar, xBar] }]); -verify.referenceGroups(xBar, [{ definition: "(property) MixedStaticsClassTest.Foo.bar: MixedStaticsClassTest.Foo", ranges: [fooBar, xBar] }]); +verify.singleReferenceGroup("(property) MixedStaticsClassTest.Foo.bar: Foo", [fooBar, xBar]); // References to a static property with the same name as a member. -verify.referenceGroups(fooStaticBar, [{ definition: "(property) MixedStaticsClassTest.Foo.bar: Foo", ranges: [fooStaticBar, staticBar] }]); -verify.referenceGroups(staticBar, [{ definition: "(property) MixedStaticsClassTest.Foo.bar: MixedStaticsClassTest.Foo", ranges: [fooStaticBar, staticBar] }]); +verify.singleReferenceGroup("(property) MixedStaticsClassTest.Foo.bar: Foo", [fooStaticBar, staticBar]); diff --git a/tests/cases/fourslash/remoteGetReferences.ts b/tests/cases/fourslash/remoteGetReferences.ts index a09e3fb3b01..c9b8c3b4e2f 100644 --- a/tests/cases/fourslash/remoteGetReferences.ts +++ b/tests/cases/fourslash/remoteGetReferences.ts @@ -188,13 +188,5 @@ test.rangesByText().forEach((ranges, text) => { } })(); - if (text === "remotefooCls") { - verify.referenceGroups([ranges[0], ...ranges.slice(2)], [{ definition, ranges }]); - verify.referenceGroups(ranges[1], [ - { definition: "constructor remotefooCls(remoteclsParam: number): remotefooCls", ranges} - ]); - } - else { - verify.singleReferenceGroup(definition, ranges); - } + verify.singleReferenceGroup(definition, ranges); }); diff --git a/tests/cases/fourslash/renameDefaultImport.ts b/tests/cases/fourslash/renameDefaultImport.ts index 3cf0c8b0880..a3a698ec4c4 100644 --- a/tests/cases/fourslash/renameDefaultImport.ts +++ b/tests/cases/fourslash/renameDefaultImport.ts @@ -20,11 +20,7 @@ const [C, B0, B1] = ranges; const classes = { definition: "class B", ranges: [C] }; const imports = { definition: "(alias) class B\nimport B", ranges: [B0, B1] }; verify.referenceGroups(C, [classes, imports]); -verify.referenceGroups(B0, [imports, classes]); -verify.referenceGroups(B1, [ - { definition: "(alias) new B(): B\nimport B", ranges: [B0, B1] }, - classes -]); +verify.referenceGroups([B0, B1], [imports, classes]); verify.renameLocations(C, ranges); verify.rangesAreRenameLocations([B0, B1]); diff --git a/tests/cases/fourslash/renameDefaultImportDifferentName.ts b/tests/cases/fourslash/renameDefaultImportDifferentName.ts index 75f80257e0b..11473ade501 100644 --- a/tests/cases/fourslash/renameDefaultImportDifferentName.ts +++ b/tests/cases/fourslash/renameDefaultImportDifferentName.ts @@ -20,8 +20,8 @@ const bRanges = [B0, B1]; const classes = { definition: "class C", ranges: [C] }; const imports = { definition: "(alias) class B\nimport B", ranges: [B0, B1] }; verify.referenceGroups(C, [classes, imports]); -verify.referenceGroups(B0, [imports]); -verify.referenceGroups(B1, [{ definition: "(alias) new B(): B\nimport B", ranges: bRanges }]); +verify.singleReferenceGroup(imports.definition, [B0, B1]); + verify.rangesAreRenameLocations([C]); verify.rangesAreRenameLocations(bRanges); diff --git a/tests/cases/fourslash/renameJsExports03.ts b/tests/cases/fourslash/renameJsExports03.ts index 0ffd4d04692..c4378cfaa1a 100644 --- a/tests/cases/fourslash/renameJsExports03.ts +++ b/tests/cases/fourslash/renameJsExports03.ts @@ -18,7 +18,7 @@ verify.referenceGroups([r0, r2], [ ]); verify.referenceGroups(r1, [ - { definition: "constructor A(): A", ranges: [r1] }, + { definition: "class A", ranges: [r1] }, { definition: "const A: typeof A", ranges: [r4] } ]); @@ -26,6 +26,6 @@ verify.referenceGroups(r3, [ { definition: "const A: typeof A", ranges: [r3, r4] } ]); verify.referenceGroups(r4, [ - { definition: "const A: new () => A", ranges: [r3, r4] } + { definition: "const A: typeof A", ranges: [r3, r4] } ]); diff --git a/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts b/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts index 0b333721914..7189738435f 100644 --- a/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts +++ b/tests/cases/fourslash/shims-pp/getReferencesAtPosition.ts @@ -23,7 +23,4 @@ ////second.[|start|](); ////second.stop(); -const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.referenceGroups(r0, [{ definition: "(method) Test.start(): this", ranges }]); -verify.referenceGroups(r1, [{ definition: "(method) Second.Test.start(): Second.Test", ranges }]); +verify.singleReferenceGroup("(method) Test.start(): this"); diff --git a/tests/cases/fourslash/shims/getReferencesAtPosition.ts b/tests/cases/fourslash/shims/getReferencesAtPosition.ts index 0b333721914..7189738435f 100644 --- a/tests/cases/fourslash/shims/getReferencesAtPosition.ts +++ b/tests/cases/fourslash/shims/getReferencesAtPosition.ts @@ -23,7 +23,4 @@ ////second.[|start|](); ////second.stop(); -const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.referenceGroups(r0, [{ definition: "(method) Test.start(): this", ranges }]); -verify.referenceGroups(r1, [{ definition: "(method) Second.Test.start(): Second.Test", ranges }]); +verify.singleReferenceGroup("(method) Test.start(): this"); diff --git a/tests/cases/fourslash/transitiveExportImports.ts b/tests/cases/fourslash/transitiveExportImports.ts index 68cca0c407b..9cdfb2e3a12 100644 --- a/tests/cases/fourslash/transitiveExportImports.ts +++ b/tests/cases/fourslash/transitiveExportImports.ts @@ -28,7 +28,7 @@ verify.referenceGroups(aRanges, [ bGroup ]); verify.referenceGroups(b0, [bGroup]); -verify.referenceGroups(c2, [{ ...bGroup, definition: "(alias) new b.b(): b.b\nimport b.b = require('./a')"}]); +verify.referenceGroups(c2, [{ ...bGroup, definition: "(alias) class b\nimport b = require('./a')"}]); verify.singleReferenceGroup("import b = require('./b')", cRanges); verify.rangesAreRenameLocations(aRanges); From c7f65e87253b89e2f9fa96c02419f561f64474a1 Mon Sep 17 00:00:00 2001 From: Yuichi Nukiyama Date: Fri, 2 Mar 2018 05:58:25 +0900 Subject: [PATCH 265/298] support groups property (#22176) * support groups property * fix option unittests --- Gulpfile.ts | 2 +- Jakefile.js | 2 +- src/compiler/commandLineParser.ts | 1 + src/harness/unittests/commandLineParsing.ts | 6 +- .../convertCompilerOptionsFromJson.ts | 8 +- src/lib/es2018.d.ts | 1 + src/lib/es2018.regexp.d.ts | 11 +++ tests/baselines/reference/useRegexpGroups.js | 28 +++++++ .../reference/useRegexpGroups.symbols | 51 +++++++++++++ .../baselines/reference/useRegexpGroups.types | 74 +++++++++++++++++++ .../conformance/es2018/useRegexpGroups.ts | 18 +++++ 11 files changed, 193 insertions(+), 9 deletions(-) create mode 100644 src/lib/es2018.regexp.d.ts create mode 100644 tests/baselines/reference/useRegexpGroups.js create mode 100644 tests/baselines/reference/useRegexpGroups.symbols create mode 100644 tests/baselines/reference/useRegexpGroups.types create mode 100644 tests/cases/conformance/es2018/useRegexpGroups.ts diff --git a/Gulpfile.ts b/Gulpfile.ts index e8bd7a990fe..0044ff32339 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -143,7 +143,7 @@ const es2017LibrarySource = [ const es2017LibrarySourceMap = es2017LibrarySource.map(source => ({ target: "lib." + source, sources: ["header.d.ts", source] })); -const es2018LibrarySource = []; +const es2018LibrarySource = ["es2018.regexp.d.ts"]; const es2018LibrarySourceMap = es2018LibrarySource.map(source => ({ target: "lib." + source, sources: ["header.d.ts", source] })); diff --git a/Jakefile.js b/Jakefile.js index 9935b6b0f13..e10517de00c 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -206,7 +206,7 @@ var es2017LibrarySourceMap = es2017LibrarySource.map(function (source) { return { target: "lib." + source, sources: ["header.d.ts", source] }; }); -var es2018LibrarySource = []; +var es2018LibrarySource = ["es2018.regexp.d.ts"]; var es2018LibrarySourceMap = es2018LibrarySource.map(function (source) { return { target: "lib." + source, sources: ["header.d.ts", source] }; diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index f61efe57cac..89e6961e455 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -151,6 +151,7 @@ namespace ts { "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "es2018.regexp": "lib.es2018.regexp.d.ts", "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", "esnext.promise": "lib.esnext.promise.d.ts", diff --git a/src/harness/unittests/commandLineParsing.ts b/src/harness/unittests/commandLineParsing.ts index 050178f63b3..eebbf4a7a24 100644 --- a/src/harness/unittests/commandLineParsing.ts +++ b/src/harness/unittests/commandLineParsing.ts @@ -60,7 +60,7 @@ namespace ts { assertParseResult(["--lib", "es5,invalidOption", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, @@ -263,7 +263,7 @@ namespace ts { assertParseResult(["--lib", "es5,", "es7", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, @@ -283,7 +283,7 @@ namespace ts { assertParseResult(["--lib", "es5, ", "es7", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, diff --git a/src/harness/unittests/convertCompilerOptionsFromJson.ts b/src/harness/unittests/convertCompilerOptionsFromJson.ts index 6a88f2ba67e..90bd12d4120 100644 --- a/src/harness/unittests/convertCompilerOptionsFromJson.ts +++ b/src/harness/unittests/convertCompilerOptionsFromJson.ts @@ -266,7 +266,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] @@ -297,7 +297,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] @@ -328,7 +328,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] @@ -359,7 +359,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] diff --git a/src/lib/es2018.d.ts b/src/lib/es2018.d.ts index 90f6d4931f4..4f9d4d3a56c 100644 --- a/src/lib/es2018.d.ts +++ b/src/lib/es2018.d.ts @@ -1 +1,2 @@ /// +/// \ No newline at end of file diff --git a/src/lib/es2018.regexp.d.ts b/src/lib/es2018.regexp.d.ts new file mode 100644 index 00000000000..85e1bc909b5 --- /dev/null +++ b/src/lib/es2018.regexp.d.ts @@ -0,0 +1,11 @@ +interface RegExpMatchArray { + groups?: { + [key: string]: string + } +} + +interface RegExpExecArray { + groups?: { + [key: string]: string + } +} \ No newline at end of file diff --git a/tests/baselines/reference/useRegexpGroups.js b/tests/baselines/reference/useRegexpGroups.js new file mode 100644 index 00000000000..999cb432af2 --- /dev/null +++ b/tests/baselines/reference/useRegexpGroups.js @@ -0,0 +1,28 @@ +//// [useRegexpGroups.ts] +let re = /(?\d{4})-(?\d{2})-(?\d{2})/u; +let result = re.exec("2015-01-02"); + +let date = result[0]; + +let year1 = result.groups.year; +let year2 = result[1]; + +let month1 = result.groups.month; +let month2 = result[2]; + +let day1 = result.groups.day; +let day2 = result[3]; + +let foo = "foo".match(/(?foo)/)!.groups.foo; + +//// [useRegexpGroups.js] +var re = /(?\d{4})-(?\d{2})-(?\d{2})/u; +var result = re.exec("2015-01-02"); +var date = result[0]; +var year1 = result.groups.year; +var year2 = result[1]; +var month1 = result.groups.month; +var month2 = result[2]; +var day1 = result.groups.day; +var day2 = result[3]; +var foo = "foo".match(/(?foo)/).groups.foo; diff --git a/tests/baselines/reference/useRegexpGroups.symbols b/tests/baselines/reference/useRegexpGroups.symbols new file mode 100644 index 00000000000..ebfa86f6c2c --- /dev/null +++ b/tests/baselines/reference/useRegexpGroups.symbols @@ -0,0 +1,51 @@ +=== tests/cases/conformance/es2018/useRegexpGroups.ts === +let re = /(?\d{4})-(?\d{2})-(?\d{2})/u; +>re : Symbol(re, Decl(useRegexpGroups.ts, 0, 3)) + +let result = re.exec("2015-01-02"); +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) +>re.exec : Symbol(RegExp.exec, Decl(lib.es5.d.ts, --, --)) +>re : Symbol(re, Decl(useRegexpGroups.ts, 0, 3)) +>exec : Symbol(RegExp.exec, Decl(lib.es5.d.ts, --, --)) + +let date = result[0]; +>date : Symbol(date, Decl(useRegexpGroups.ts, 3, 3)) +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) + +let year1 = result.groups.year; +>year1 : Symbol(year1, Decl(useRegexpGroups.ts, 5, 3)) +>result.groups : Symbol(RegExpExecArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) +>groups : Symbol(RegExpExecArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) + +let year2 = result[1]; +>year2 : Symbol(year2, Decl(useRegexpGroups.ts, 6, 3)) +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) + +let month1 = result.groups.month; +>month1 : Symbol(month1, Decl(useRegexpGroups.ts, 8, 3)) +>result.groups : Symbol(RegExpExecArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) +>groups : Symbol(RegExpExecArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) + +let month2 = result[2]; +>month2 : Symbol(month2, Decl(useRegexpGroups.ts, 9, 3)) +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) + +let day1 = result.groups.day; +>day1 : Symbol(day1, Decl(useRegexpGroups.ts, 11, 3)) +>result.groups : Symbol(RegExpExecArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) +>groups : Symbol(RegExpExecArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) + +let day2 = result[3]; +>day2 : Symbol(day2, Decl(useRegexpGroups.ts, 12, 3)) +>result : Symbol(result, Decl(useRegexpGroups.ts, 1, 3)) + +let foo = "foo".match(/(?foo)/)!.groups.foo; +>foo : Symbol(foo, Decl(useRegexpGroups.ts, 14, 3)) +>"foo".match(/(?foo)/)!.groups : Symbol(RegExpMatchArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) +>"foo".match : Symbol(String.match, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>groups : Symbol(RegExpMatchArray.groups, Decl(lib.es2018.regexp.d.ts, --, --)) + diff --git a/tests/baselines/reference/useRegexpGroups.types b/tests/baselines/reference/useRegexpGroups.types new file mode 100644 index 00000000000..7e4ab00ed42 --- /dev/null +++ b/tests/baselines/reference/useRegexpGroups.types @@ -0,0 +1,74 @@ +=== tests/cases/conformance/es2018/useRegexpGroups.ts === +let re = /(?\d{4})-(?\d{2})-(?\d{2})/u; +>re : RegExp +>/(?\d{4})-(?\d{2})-(?\d{2})/u : RegExp + +let result = re.exec("2015-01-02"); +>result : RegExpExecArray +>re.exec("2015-01-02") : RegExpExecArray +>re.exec : (string: string) => RegExpExecArray +>re : RegExp +>exec : (string: string) => RegExpExecArray +>"2015-01-02" : "2015-01-02" + +let date = result[0]; +>date : string +>result[0] : string +>result : RegExpExecArray +>0 : 0 + +let year1 = result.groups.year; +>year1 : string +>result.groups.year : string +>result.groups : { [key: string]: string; } +>result : RegExpExecArray +>groups : { [key: string]: string; } +>year : string + +let year2 = result[1]; +>year2 : string +>result[1] : string +>result : RegExpExecArray +>1 : 1 + +let month1 = result.groups.month; +>month1 : string +>result.groups.month : string +>result.groups : { [key: string]: string; } +>result : RegExpExecArray +>groups : { [key: string]: string; } +>month : string + +let month2 = result[2]; +>month2 : string +>result[2] : string +>result : RegExpExecArray +>2 : 2 + +let day1 = result.groups.day; +>day1 : string +>result.groups.day : string +>result.groups : { [key: string]: string; } +>result : RegExpExecArray +>groups : { [key: string]: string; } +>day : string + +let day2 = result[3]; +>day2 : string +>result[3] : string +>result : RegExpExecArray +>3 : 3 + +let foo = "foo".match(/(?foo)/)!.groups.foo; +>foo : string +>"foo".match(/(?foo)/)!.groups.foo : string +>"foo".match(/(?foo)/)!.groups : { [key: string]: string; } +>"foo".match(/(?foo)/)! : RegExpMatchArray +>"foo".match(/(?foo)/) : RegExpMatchArray +>"foo".match : { (regexp: string | RegExp): RegExpMatchArray; (matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray; } +>"foo" : "foo" +>match : { (regexp: string | RegExp): RegExpMatchArray; (matcher: { [Symbol.match](string: string): RegExpMatchArray; }): RegExpMatchArray; } +>/(?foo)/ : RegExp +>groups : { [key: string]: string; } +>foo : string + diff --git a/tests/cases/conformance/es2018/useRegexpGroups.ts b/tests/cases/conformance/es2018/useRegexpGroups.ts new file mode 100644 index 00000000000..65d3be9fbfd --- /dev/null +++ b/tests/cases/conformance/es2018/useRegexpGroups.ts @@ -0,0 +1,18 @@ +// @target: es5 +// @lib: es6,es2018 + +let re = /(?\d{4})-(?\d{2})-(?\d{2})/u; +let result = re.exec("2015-01-02"); + +let date = result[0]; + +let year1 = result.groups.year; +let year2 = result[1]; + +let month1 = result.groups.month; +let month2 = result[2]; + +let day1 = result.groups.day; +let day2 = result[3]; + +let foo = "foo".match(/(?foo)/)!.groups.foo; \ No newline at end of file From 7b929e090d69147bd163e6c20d1aaf6f347fa383 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 13:11:45 -0800 Subject: [PATCH 266/298] Remove unnecessary length check in `getSyntacticDocumentHighlights` (#22064) --- src/services/documentHighlights.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/services/documentHighlights.ts b/src/services/documentHighlights.ts index 6d3094fc190..8d48d526a4b 100644 --- a/src/services/documentHighlights.ts +++ b/src/services/documentHighlights.ts @@ -30,11 +30,7 @@ namespace ts.DocumentHighlights { function getSyntacticDocumentHighlights(node: Node, sourceFile: SourceFile): DocumentHighlights[] { const highlightSpans = getHighlightSpans(node, sourceFile); - if (!highlightSpans || highlightSpans.length === 0) { - return undefined; - } - - return [{ fileName: sourceFile.fileName, highlightSpans }]; + return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans }]; } function getHighlightSpans(node: Node, sourceFile: SourceFile): HighlightSpan[] | undefined { From 928ffaa1b5173015a04f0f34f0693b90e048a451 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 13:12:18 -0800 Subject: [PATCH 267/298] Fix type of isIterationStatement (#22065) --- src/compiler/utilities.ts | 2 ++ tests/baselines/reference/api/tsserverlibrary.d.ts | 3 ++- tests/baselines/reference/api/typescript.d.ts | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 63c8d6989f4..36dabb5632e 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5578,6 +5578,8 @@ namespace ts { // Statement + export function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; + export function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; export function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement { switch (node.kind) { case SyntaxKind.ForStatement: diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index a3c304dbd73..4fef3fc30d8 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3231,7 +3231,8 @@ declare namespace ts { function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; function isTemplateLiteral(node: Node): node is TemplateLiteral; function isAssertionExpression(node: Node): node is AssertionExpression; - function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement; + function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; + function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; /** True if node is of a kind that may contain comment text. */ diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 76e80978a52..c1f088c058b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3286,7 +3286,8 @@ declare namespace ts { function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; function isTemplateLiteral(node: Node): node is TemplateLiteral; function isAssertionExpression(node: Node): node is AssertionExpression; - function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement; + function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; + function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; /** True if node is of a kind that may contain comment text. */ From 0701ed5d4b7680827fe4e5a40115d8abcc49ce1d Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 13:12:53 -0800 Subject: [PATCH 268/298] isControlFlowEndingStatement: don't try to enumerate all possible parent kinds (#22131) --- src/services/formatting/smartIndenter.ts | 26 +++++++----------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index f124c444f6d..b8574ba89c1 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -565,26 +565,14 @@ namespace ts.formatting { function isControlFlowEndingStatement(kind: SyntaxKind, parent: TextRangeWithKind): boolean { switch (kind) { case SyntaxKind.ReturnStatement: - case SyntaxKind.ThrowStatement: - switch (parent.kind) { - case SyntaxKind.Block: - const grandParent = (parent as Node).parent; - switch (grandParent && grandParent.kind) { - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.FunctionExpression: - // We may want to write inner functions after this. - return false; - default: - return true; - } - case SyntaxKind.CaseClause: - case SyntaxKind.DefaultClause: - case SyntaxKind.SourceFile: - case SyntaxKind.ModuleBlock: - return true; - default: - throw Debug.fail(); + case SyntaxKind.ThrowStatement: { + if (parent.kind !== SyntaxKind.Block) { + return true; } + const grandParent = (parent as Node).parent; + // In a function, we may want to write inner functions after this. + return !(grandParent && grandParent.kind === SyntaxKind.FunctionExpression || grandParent.kind === SyntaxKind.FunctionDeclaration); + } case SyntaxKind.ContinueStatement: case SyntaxKind.BreakStatement: return true; From 6c63dd25e6c98a177591d6250a7d2691343e67dd Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 13:13:27 -0800 Subject: [PATCH 269/298] breakpoints: Fix invalid cast (#22153) --- src/services/breakpoints.ts | 92 ++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index efc27314a98..c608028b55f 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -78,7 +78,7 @@ namespace ts.BreakpointResolver { case SyntaxKind.VariableDeclaration: case SyntaxKind.PropertyDeclaration: case SyntaxKind.PropertySignature: - return spanInVariableDeclaration(node); + return spanInVariableDeclaration(node); case SyntaxKind.Parameter: return spanInParameterDeclaration(node); @@ -273,18 +273,17 @@ namespace ts.BreakpointResolver { } if (node.kind === SyntaxKind.BinaryExpression) { - const binaryExpression = node; + const { left, operatorToken } = node; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of // [a, b, c] = expression or // {a, b, c} = expression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { return spanInArrayLiteralOrObjectLiteralDestructuringPattern( - binaryExpression.left); + left); } - if (binaryExpression.operatorToken.kind === SyntaxKind.EqualsToken && - isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + if (operatorToken.kind === SyntaxKind.EqualsToken && isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { // Set breakpoint on assignment expression element of destructuring pattern // a = expression of // [a = expression, b, c] = someExpression or @@ -292,8 +291,8 @@ namespace ts.BreakpointResolver { return textSpan(node); } - if (binaryExpression.operatorToken.kind === SyntaxKind.CommaToken) { - return spanInNode(binaryExpression.left); + if (operatorToken.kind === SyntaxKind.CommaToken) { + return spanInNode(left); } } @@ -327,42 +326,42 @@ namespace ts.BreakpointResolver { } } - // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === SyntaxKind.PropertyAssignment && - (node.parent).name === node && - !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { - return spanInNode((node.parent).initializer); - } - - // Breakpoint in type assertion goes to its operand - if (node.parent.kind === SyntaxKind.TypeAssertionExpression && (node.parent).type === node) { - return spanInNextNode((node.parent).type); - } - - // return type of function go to previous token - if (isFunctionLike(node.parent) && (node.parent).type === node) { - return spanInPreviousNode(node); - } - - // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === SyntaxKind.VariableDeclaration || - node.parent.kind === SyntaxKind.Parameter)) { - const paramOrVarDecl = node.parent; - if (paramOrVarDecl.initializer === node || - paramOrVarDecl.type === node || - isAssignmentOperator(node.kind)) { - return spanInPreviousNode(node); + switch (node.parent.kind) { + case SyntaxKind.PropertyAssignment: + // If this is name of property assignment, set breakpoint in the initializer + if ((node.parent).name === node && + !isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { + return spanInNode((node.parent).initializer); + } + break; + case SyntaxKind.TypeAssertionExpression: + // Breakpoint in type assertion goes to its operand + if ((node.parent).type === node) { + return spanInNextNode((node.parent).type); + } + break; + case SyntaxKind.VariableDeclaration: + case SyntaxKind.Parameter: { + // initializer of variable/parameter declaration go to previous node + const { initializer, type } = node.parent; + if (initializer === node || type === node || isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + break; } - } - - if (node.parent.kind === SyntaxKind.BinaryExpression) { - const binaryExpression = node.parent; - if (isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && - (binaryExpression.right === node || - binaryExpression.operatorToken === node)) { - // If initializer of destructuring assignment move to previous token - return spanInPreviousNode(node); + case SyntaxKind.BinaryExpression: { + const { left } = node.parent; + if (isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { + // If initializer of destructuring assignment move to previous token + return spanInPreviousNode(node); + } + break; } + default: + // return type of function go to previous token + if (isFunctionLike(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } } // Default go to parent to set the breakpoint @@ -370,9 +369,8 @@ namespace ts.BreakpointResolver { } } - function textSpanFromVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { - if (variableDeclaration.parent.kind === SyntaxKind.VariableDeclarationList && - variableDeclaration.parent.declarations[0] === variableDeclaration) { + function textSpanFromVariableDeclaration(variableDeclaration: VariableDeclaration | PropertyDeclaration | PropertySignature): TextSpan { + if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } @@ -382,7 +380,7 @@ namespace ts.BreakpointResolver { } } - function spanInVariableDeclaration(variableDeclaration: VariableDeclaration): TextSpan { + function spanInVariableDeclaration(variableDeclaration: VariableDeclaration | PropertyDeclaration | PropertySignature): TextSpan { // If declaration of for in statement, just set the span in parent if (variableDeclaration.parent.parent.kind === SyntaxKind.ForInStatement) { return spanInNode(variableDeclaration.parent.parent); @@ -401,7 +399,7 @@ namespace ts.BreakpointResolver { return textSpanFromVariableDeclaration(variableDeclaration); } - if (variableDeclaration.parent.kind === SyntaxKind.VariableDeclarationList && + if (isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and From 9acad22678483c0ba297c1179704ce40a5753290 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 13:13:59 -0800 Subject: [PATCH 270/298] PropertyAssignment#initializer should be non-optional (#22209) --- src/compiler/factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index bb00a967336..342ea067c0e 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2287,7 +2287,7 @@ namespace ts { const node = createSynthesizedNode(SyntaxKind.PropertyAssignment); node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? parenthesizeExpressionForList(initializer) : undefined; + node.initializer = parenthesizeExpressionForList(initializer); return node; } From c12369b354607574cd0bd736d88a31b7ddcdb282 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 13:44:53 -0800 Subject: [PATCH 271/298] Fix bug where findAllReferences included a node outside of sourceFilesToSearch (#22062) --- src/services/findAllReferences.ts | 15 +++++++++++++-- .../fourslash/documentHighlights_filesToSearch.ts | 11 +++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/documentHighlights_filesToSearch.ts diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 63cdaa6b1aa..b917c426b7d 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -476,6 +476,8 @@ namespace ts.FindAllReferences.Core { */ readonly markSeenReExportRHS = nodeSeenTracker(); + private readonly includedSourceFiles: Map; + constructor( readonly sourceFiles: ReadonlyArray, /** True if we're searching for constructor references. */ @@ -484,7 +486,13 @@ namespace ts.FindAllReferences.Core { readonly cancellationToken: CancellationToken, readonly searchMeaning: SemanticMeaning, readonly options: Options, - private readonly result: Push) {} + private readonly result: Push) { + this.includedSourceFiles = arrayToSet(sourceFiles, s => s.fileName); + } + + includesSourceFile(sourceFile: SourceFile): boolean { + return this.includedSourceFiles.has(sourceFile.fileName); + } private importTracker: ImportTracker | undefined; /** Gets every place to look for references of an exported symbols. See `ImportsResult` in `importTracker.ts` for more documentation. */ @@ -586,7 +594,10 @@ namespace ts.FindAllReferences.Core { // Go to the symbol we imported from and find references for it. function searchForImportedSymbol(symbol: Symbol, state: State): void { for (const declaration of symbol.declarations) { - getReferencesInSourceFile(declaration.getSourceFile(), state.createSearch(declaration, symbol, ImportExport.Import), state); + const exportingFile = declaration.getSourceFile(); + if (state.includesSourceFile(exportingFile)) { + getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, ImportExport.Import), state); + } } } diff --git a/tests/cases/fourslash/documentHighlights_filesToSearch.ts b/tests/cases/fourslash/documentHighlights_filesToSearch.ts new file mode 100644 index 00000000000..ae889be5281 --- /dev/null +++ b/tests/cases/fourslash/documentHighlights_filesToSearch.ts @@ -0,0 +1,11 @@ +/// + +// @Filename: /a.ts +////export const [|x|] = 0; + +// @Filename: /b.ts +////import { [|x|] } from "./a"; + +const [r0, r1] = test.ranges(); +verify.documentHighlightsOf(r0, [r0], { filesToSearch: [r0.fileName] }); +verify.documentHighlightsOf(r1, [r1], { filesToSearch: [r1.fileName] }); From a564912d9a335fe67ce7c5e4dabce46015bad8d4 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 14:20:18 -0800 Subject: [PATCH 272/298] Apply 'no-unnecessary-qualifier' lint rule (#22009) --- src/compiler/checker.ts | 12 +- src/compiler/commandLineParser.ts | 14 +- src/compiler/core.ts | 2 +- src/compiler/moduleNameResolver.ts | 8 +- src/compiler/parser.ts | 2 +- src/compiler/sourcemap.ts | 2 +- src/compiler/sys.ts | 2 +- src/compiler/tsc.ts | 6 +- src/compiler/utilities.ts | 9 +- src/compiler/watch.ts | 10 +- src/harness/fourslash.ts | 8 +- src/harness/harness.ts | 72 ++--- src/harness/harnessLanguageService.ts | 6 +- src/harness/parallel/host.ts | 10 +- src/harness/unittests/commandLineParsing.ts | 74 ++--- src/harness/unittests/compileOnSave.ts | 8 +- .../unittests/configurationExtension.ts | 8 +- src/harness/unittests/convertToBase64.ts | 2 +- src/harness/unittests/extractRanges.ts | 4 +- src/harness/unittests/extractTestHelpers.ts | 4 +- src/harness/unittests/hostNewLineSupport.ts | 2 +- src/harness/unittests/incrementalParser.ts | 2 +- src/harness/unittests/jsDocParsing.ts | 14 +- src/harness/unittests/languageService.ts | 8 +- src/harness/unittests/matchFiles.ts | 260 +++++++++--------- src/harness/unittests/moduleResolution.ts | 16 +- .../unittests/reuseProgramStructure.ts | 6 +- src/harness/unittests/session.ts | 14 +- src/harness/unittests/telemetry.ts | 16 +- src/harness/unittests/textStorage.ts | 4 +- src/harness/unittests/transform.ts | 114 ++++---- src/harness/unittests/transpile.ts | 4 +- src/harness/unittests/tscWatchMode.ts | 22 +- src/harness/unittests/tsconfigParsing.ts | 24 +- .../unittests/tsserverProjectSystem.ts | 46 ++-- src/harness/unittests/typingsInstaller.ts | 4 +- src/harness/unittests/versionCache.ts | 2 +- src/harness/virtualFileSystemWithWatch.ts | 2 +- src/server/client.ts | 10 +- src/server/editorServices.ts | 28 +- src/server/project.ts | 2 +- src/server/protocol.ts | 2 + src/server/server.ts | 6 +- src/server/session.ts | 6 +- .../typingsInstaller/nodeTypingsInstaller.ts | 10 +- .../typingsInstaller/typingsInstaller.ts | 8 +- src/services/classifier.ts | 2 +- src/services/codefixes/convertToEs6Module.ts | 4 +- .../fixExtendsInterfaceBecomesImplements.ts | 2 +- src/services/codefixes/importFixes.ts | 10 +- src/services/codefixes/inferFromUsage.ts | 6 +- src/services/completions.ts | 34 +-- src/services/findAllReferences.ts | 32 +-- src/services/formatting/formatting.ts | 4 +- src/services/formatting/formattingContext.ts | 2 +- src/services/formatting/rulesMap.ts | 2 +- src/services/formatting/smartIndenter.ts | 2 +- src/services/goToDefinition.ts | 10 +- src/services/importTracker.ts | 14 +- src/services/jsDoc.ts | 8 +- src/services/jsTyping.ts | 4 +- src/services/navigateTo.ts | 2 +- src/services/navigationBar.ts | 2 +- src/services/pathCompletions.ts | 2 +- src/services/refactors/extractSymbol.ts | 4 +- src/services/rename.ts | 4 +- src/services/services.ts | 20 +- src/services/shims.ts | 10 +- src/services/symbolDisplay.ts | 14 +- src/services/textChanges.ts | 4 +- .../reference/api/tsserverlibrary.d.ts | 2 +- tslint.json | 1 + 72 files changed, 549 insertions(+), 547 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 587f7eb4837..d30387e43da 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -680,9 +680,9 @@ namespace ts { function emitTextWriterWrapper(underlying: SymbolWriter): EmitTextWriter { return { - write: ts.noop, - writeTextOfNode: ts.noop, - writeLine: ts.noop, + write: noop, + writeTextOfNode: noop, + writeLine: noop, increaseIndent() { return underlying.increaseIndent(); }, @@ -692,7 +692,7 @@ namespace ts { getText() { return ""; }, - rawWrite: ts.noop, + rawWrite: noop, writeLiteral(s) { return underlying.writeStringLiteral(s); }, @@ -3449,7 +3449,7 @@ namespace ts { // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols. endOfChain || // If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.) - !(!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) && + !(!parentSymbol && forEach(symbol.declarations, hasExternalModuleSymbol)) && // If a parent symbol is an anonymous type, don't write it. !(symbol.flags & (SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral))) { @@ -16308,7 +16308,7 @@ namespace ts { function isValidPropertyAccessForCompletions(node: PropertyAccessExpression, type: Type, property: Symbol): boolean { return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) - && (!(property.flags & ts.SymbolFlags.Method) || isValidMethodAccess(property, type)); + && (!(property.flags & SymbolFlags.Method) || isValidMethodAccess(property, type)); } function isValidMethodAccess(method: Symbol, type: Type) { const propType = getTypeOfFuncClassEnumModule(method); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 89e6961e455..feb605551d6 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1739,7 +1739,7 @@ namespace ts { function getExtendedConfig( sourceFile: JsonSourceFile, extendedConfigPath: string, - host: ts.ParseConfigHost, + host: ParseConfigHost, basePath: string, resolutionStack: string[], errors: Push, @@ -2115,7 +2115,7 @@ namespace ts { } } - function specToDiagnostic(spec: string, allowTrailingRecursion: boolean): ts.DiagnosticMessage | undefined { + function specToDiagnostic(spec: string, allowTrailingRecursion: boolean): DiagnosticMessage | undefined { if (!allowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) { return Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } @@ -2142,7 +2142,7 @@ namespace ts { // /a/b/a?z - Watch /a/b directly to catch any new file matching a?z const rawExcludeRegex = getRegularExpressionForWildcard(exclude, path, "exclude"); const excludeRegex = rawExcludeRegex && new RegExp(rawExcludeRegex, useCaseSensitiveFileNames ? "" : "i"); - const wildcardDirectories: ts.MapLike = {}; + const wildcardDirectories: MapLike = {}; if (include !== undefined) { const recursiveKeys: string[] = []; for (const file of include) { @@ -2256,8 +2256,8 @@ namespace ts { * Also converts enum values back to strings. */ /* @internal */ - export function convertCompilerOptionsForTelemetry(opts: ts.CompilerOptions): ts.CompilerOptions { - const out: ts.CompilerOptions = {}; + export function convertCompilerOptionsForTelemetry(opts: CompilerOptions): CompilerOptions { + const out: CompilerOptions = {}; for (const key in opts) { if (opts.hasOwnProperty(key)) { const type = getOptionFromName(key); @@ -2281,9 +2281,9 @@ namespace ts { return typeof value === "boolean" ? value : ""; case "list": const elementType = (option as CommandLineOptionOfListType).element; - return ts.isArray(value) ? value.map(v => getOptionValueWithEmptyStrings(v, elementType)) : ""; + return isArray(value) ? value.map(v => getOptionValueWithEmptyStrings(v, elementType)) : ""; default: - return ts.forEachEntry(option.type, (optionEnumValue, optionStringValue) => { + return forEachEntry(option.type, (optionEnumValue, optionStringValue) => { if (optionEnumValue === value) { return optionStringValue; } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index ecf667237c5..c3bfe55b40b 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -2618,7 +2618,7 @@ namespace ts { // Iterate over each include base path and include unique base paths that are not a // subpath of an existing base path for (const includeBasePath of includeBasePaths) { - if (ts.every(basePaths, basePath => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) { + if (every(basePaths, basePath => !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames))) { basePaths.push(includeBasePath); } } diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index de59e640192..534f44cfb7a 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -161,7 +161,7 @@ namespace ts { } let typeRoots: string[]; - forEachAncestorDirectory(ts.normalizePath(currentDirectory), directory => { + forEachAncestorDirectory(normalizePath(currentDirectory), directory => { const atTypes = combinePaths(directory, nodeModulesAtTypes); if (host.directoryExists(atTypes)) { (typeRoots || (typeRoots = [])).push(atTypes); @@ -729,7 +729,7 @@ namespace ts { /* @internal */ export function resolveJavaScriptModule(moduleName: string, initialDir: string, host: ModuleResolutionHost): string { const { resolvedModule, failedLookupLocations } = - nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ts.ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, /*jsOnly*/ true); + nodeModuleNameResolverWorker(moduleName, initialDir, { moduleResolution: ModuleResolutionKind.NodeJs, allowJs: true }, host, /*cache*/ undefined, /*jsOnly*/ true); if (!resolvedModule) { throw new Error(`Could not resolve JS module '${moduleName}' starting at '${initialDir}'. Looked in: ${failedLookupLocations.join(", ")}`); } @@ -1172,7 +1172,7 @@ namespace ts { /* @internal */ export function getMangledNameForScopedPackage(packageName: string): string { if (startsWith(packageName, "@")) { - const replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator); + const replaceSlash = packageName.replace(directorySeparator, mangledScopedPackageSeparator); if (replaceSlash !== packageName) { return replaceSlash.slice(1); // Take off the "@" } @@ -1192,7 +1192,7 @@ namespace ts { /* @internal */ export function getUnmangledNameForScopedPackage(typesPackageName: string): string { return stringContains(typesPackageName, mangledScopedPackageSeparator) ? - "@" + typesPackageName.replace(mangledScopedPackageSeparator, ts.directorySeparator) : + "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName; } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index b350af01bb0..13c00867372 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -5927,7 +5927,7 @@ namespace ts { return finishNode(node); } - function parseImportEqualsDeclaration(node: ImportEqualsDeclaration, identifier: ts.Identifier): ImportEqualsDeclaration { + function parseImportEqualsDeclaration(node: ImportEqualsDeclaration, identifier: Identifier): ImportEqualsDeclaration { node.kind = SyntaxKind.ImportEqualsDeclaration; node.name = identifier; parseExpected(SyntaxKind.EqualsToken); diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index 2dabb97b08d..f6ad5e5c52f 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -159,7 +159,7 @@ namespace ts { // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the // relative paths of the sources list in the sourcemap - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); + sourceMapData.sourceMapSourceRoot = normalizeSlashes(sourceMapData.sourceMapSourceRoot); if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== CharacterCodes.slash) { sourceMapData.sourceMapSourceRoot += directorySeparator; } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 8cafd8c0138..c0159797efe 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -212,7 +212,7 @@ namespace ts { // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" const fileName = !isString(relativeFileName) ? undefined - : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); + : getNormalizedAbsolutePath(relativeFileName, baseDirPath); // Some applications save a working file via rename operations if ((eventName === "change" || eventName === "rename")) { const callbacks = fileWatcherCallbacks.get(fileName); diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 15e4867d7f7..245d5c2219c 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -167,7 +167,7 @@ namespace ts { } function createWatchOfConfigFile(configParseResult: ParsedCommandLine, optionsToExtend: CompilerOptions) { - const watchCompilerHost = ts.createWatchCompilerHostOfConfigFile(configParseResult.options.configFilePath, optionsToExtend, sys, /*createProgram*/ undefined, reportDiagnostic, createWatchStatusReporter(configParseResult.options)); + const watchCompilerHost = createWatchCompilerHostOfConfigFile(configParseResult.options.configFilePath, optionsToExtend, sys, /*createProgram*/ undefined, reportDiagnostic, createWatchStatusReporter(configParseResult.options)); updateWatchCompilationHost(watchCompilerHost); watchCompilerHost.rootFiles = configParseResult.fileNames; watchCompilerHost.options = configParseResult.options; @@ -177,7 +177,7 @@ namespace ts { } function createWatchOfFilesAndCompilerOptions(rootFiles: string[], options: CompilerOptions) { - const watchCompilerHost = ts.createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, sys, /*createProgram*/ undefined, reportDiagnostic, createWatchStatusReporter(options)); + const watchCompilerHost = createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles, options, sys, /*createProgram*/ undefined, reportDiagnostic, createWatchStatusReporter(options)); updateWatchCompilationHost(watchCompilerHost); createWatchProgram(watchCompilerHost); } @@ -262,7 +262,7 @@ namespace ts { } function printVersion() { - sys.write(getDiagnosticText(Diagnostics.Version_0, ts.version) + sys.newLine); + sys.write(getDiagnosticText(Diagnostics.Version_0, version) + sys.newLine); } function printHelp(showAllOptions: boolean) { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 36dabb5632e..040001c4fdd 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1545,7 +1545,7 @@ namespace ts { return SpecialPropertyAssignmentKind.None; } - export function isSpecialPropertyDeclaration(expr: ts.PropertyAccessExpression): boolean { + export function isSpecialPropertyDeclaration(expr: PropertyAccessExpression): boolean { return isInJavaScriptFile(expr) && expr.parent && expr.parent.kind === SyntaxKind.ExpressionStatement && !!getJSDocTypeTag(expr.parent); @@ -1619,10 +1619,10 @@ namespace ts { function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node: Node): Expression | undefined { switch (node.kind) { - case ts.SyntaxKind.VariableStatement: + case SyntaxKind.VariableStatement: const v = getSingleVariableOfVariableStatement(node); return v && v.initializer; - case ts.SyntaxKind.PropertyDeclaration: + case SyntaxKind.PropertyDeclaration: return (node as PropertyDeclaration).initializer; } } @@ -1717,7 +1717,7 @@ namespace ts { export function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { parent: JSDocTemplateTag }): TypeParameterDeclaration | undefined { const name = node.name.escapedText; - const { typeParameters } = (node.parent.parent.parent as ts.SignatureDeclaration | ts.InterfaceDeclaration | ts.ClassDeclaration); + const { typeParameters } = (node.parent.parent.parent as SignatureDeclaration | InterfaceDeclaration | ClassDeclaration); return find(typeParameters, p => p.name.escapedText === name); } @@ -4097,6 +4097,7 @@ namespace ts { return false; } try { + // tslint:disable-next-line no-unnecessary-qualifier (making clear this is a global mutation!) ts.localizedDiagnosticMessages = JSON.parse(fileContents); } catch (e) { diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 8494323a60d..552316d7751 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -20,7 +20,7 @@ namespace ts { getCanonicalFileName: createGetCanonicalFileName(system.useCaseSensitiveFileNames), }; if (!pretty) { - return diagnostic => system.write(ts.formatDiagnostic(diagnostic, host)); + return diagnostic => system.write(formatDiagnostic(diagnostic, host)); } const diagnostics: Diagnostic[] = new Array(1); @@ -485,9 +485,9 @@ namespace ts { const trace = host.trace && ((s: string) => { host.trace(s + newLine); }); const loggingEnabled = trace && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); const writeLog = loggingEnabled ? trace : noop; - const watchFile = compilerOptions.extendedDiagnostics ? ts.addFileWatcherWithLogging : loggingEnabled ? ts.addFileWatcherWithOnlyTriggerLogging : ts.addFileWatcher; - const watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; - const watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; + const watchFile = compilerOptions.extendedDiagnostics ? addFileWatcherWithLogging : loggingEnabled ? addFileWatcherWithOnlyTriggerLogging : addFileWatcher; + const watchFilePath = compilerOptions.extendedDiagnostics ? addFilePathWatcherWithLogging : addFilePathWatcher; + const watchDirectoryWorker = compilerOptions.extendedDiagnostics ? addDirectoryWatcherWithLogging : addDirectoryWatcher; const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); let newLine = updateNewLine(); @@ -827,7 +827,7 @@ namespace ts { } function parseConfigFile() { - const configParseResult = ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost); + const configParseResult = getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost); rootFileNames = configParseResult.fileNames; compilerOptions = configParseResult.options; configFileSpecs = configParseResult.configFileSpecs; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index f5efa233a61..d52bc304770 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -418,7 +418,7 @@ namespace FourSlash { this.goToPosition(marker.position); } - public goToEachMarker(markers: ReadonlyArray, action: (marker: FourSlash.Marker, index: number) => void) { + public goToEachMarker(markers: ReadonlyArray, action: (marker: Marker, index: number) => void) { assert(markers.length); for (let i = 0; i < markers.length; i++) { this.goToMarker(markers[i]); @@ -2356,7 +2356,7 @@ Actual: ${stringify(fullActual)}`); this.verifyClassifications(expected, actual, this.activeFile.content); } - public verifyOutliningSpans(spans: FourSlash.Range[]) { + public verifyOutliningSpans(spans: Range[]) { const actual = this.languageService.getOutliningSpans(this.activeFile.fileName); if (actual.length !== spans.length) { @@ -3290,7 +3290,7 @@ ${code} const format = new FourSlashInterface.Format(state); const cancellation = new FourSlashInterface.Cancellation(state); const f = eval(wrappedCode); - f(test, goTo, verify, edit, debug, format, cancellation, FourSlashInterface.Classification, FourSlash.verifyOperationIsCancelled); + f(test, goTo, verify, edit, debug, format, cancellation, FourSlashInterface.Classification, verifyOperationIsCancelled); } catch (err) { throw err; @@ -3963,7 +3963,7 @@ namespace FourSlashInterface { this.state.verifySpanOfEnclosingComment(this.negative, onlyMultiLineDiverges); } - public codeFix(options: FourSlashInterface.VerifyCodeFixOptions) { + public codeFix(options: VerifyCodeFixOptions) { this.state.verifyCodeFix(options); } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index e2bed4f0318..12ebf4c4baf 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -336,7 +336,7 @@ namespace Utils { case "referenceDiagnostics": case "parseDiagnostics": - o[propertyName] = Utils.convertDiagnostics((n)[propertyName]); + o[propertyName] = convertDiagnostics((n)[propertyName]); break; case "nextContainer": @@ -852,7 +852,7 @@ namespace Harness { sourceText: string, languageVersion: ts.ScriptTarget) { // We'll only assert invariants outside of light mode. - const shouldAssertInvariants = !Harness.lightMode; + const shouldAssertInvariants = !lightMode; // Only set the parent nodes if we're asserting invariants. We don't need them otherwise. const result = ts.createSourceFile(fileName, sourceText, languageVersion, /*setParentNodes:*/ shouldAssertInvariants); @@ -984,7 +984,7 @@ namespace Harness { } else if (fileName === fourslashFileName) { const tsFn = "tests/cases/fourslash/" + fourslashFileName; - fourslashSourceFile = fourslashSourceFile || createSourceFileAndAssertInvariants(tsFn, Harness.IO.readFile(tsFn), scriptTarget); + fourslashSourceFile = fourslashSourceFile || createSourceFileAndAssertInvariants(tsFn, IO.readFile(tsFn), scriptTarget); return fourslashSourceFile; } else if (ts.startsWith(fileName, "tests/lib/")) { @@ -1000,7 +1000,7 @@ namespace Harness { const newLine = newLineKind === ts.NewLineKind.CarriageReturnLineFeed ? carriageReturnLineFeed : newLineKind === ts.NewLineKind.LineFeed ? lineFeed : - Harness.IO.newLine(); + IO.newLine(); function toPath(fileName: string): ts.Path { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); @@ -1103,7 +1103,7 @@ namespace Harness { return optionsIndex.get(name.toLowerCase()); } - export function setCompilerOptionsFromHarnessSetting(settings: Harness.TestCaseParser.CompilerSettings, options: ts.CompilerOptions & HarnessOptions): void { + export function setCompilerOptionsFromHarnessSetting(settings: TestCaseParser.CompilerSettings, options: ts.CompilerOptions & HarnessOptions): void { for (const name in settings) { if (settings.hasOwnProperty(name)) { const value = settings[name]; @@ -1171,7 +1171,7 @@ namespace Harness { options.skipDefaultLibCheck = typeof options.skipDefaultLibCheck === "undefined" ? true : options.skipDefaultLibCheck; if (typeof currentDirectory === "undefined") { - currentDirectory = Harness.IO.getCurrentDirectory(); + currentDirectory = IO.getCurrentDirectory(); } // Parse settings @@ -1182,7 +1182,7 @@ namespace Harness { options.rootDirs = ts.map(options.rootDirs, d => ts.getNormalizedAbsolutePath(d, currentDirectory)); } - const useCaseSensitiveFileNames = options.useCaseSensitiveFileNames !== undefined ? options.useCaseSensitiveFileNames : Harness.IO.useCaseSensitiveFileNames(); + const useCaseSensitiveFileNames = options.useCaseSensitiveFileNames !== undefined ? options.useCaseSensitiveFileNames : IO.useCaseSensitiveFileNames(); const programFiles: TestFile[] = inputFiles.slice(); // Files from built\local that are requested by test "@includeBuiltFiles" to be in the context. // Treat them as library files, so include them in build, but not in baselines. @@ -1190,7 +1190,7 @@ namespace Harness { const builtFileName = ts.combinePaths(libFolder, options.includeBuiltFile); const builtFile: TestFile = { unitName: builtFileName, - content: normalizeLineEndings(IO.readFile(builtFileName), Harness.IO.newLine()), + content: normalizeLineEndings(IO.readFile(builtFileName), IO.newLine()), }; programFiles.push(builtFile); } @@ -1232,7 +1232,7 @@ namespace Harness { const errors = ts.getPreEmitDiagnostics(program); - const result = new CompilerResult(fileOutputs, errors, program, Harness.IO.getCurrentDirectory(), emitResult.sourceMaps, traceResults); + const result = new CompilerResult(fileOutputs, errors, program, IO.getCurrentDirectory(), emitResult.sourceMaps, traceResults); return { result, options }; } @@ -1336,7 +1336,7 @@ namespace Harness { } export function minimalDiagnosticsToString(diagnostics: ReadonlyArray, pretty?: boolean) { - const host = { getCanonicalFileName, getCurrentDirectory: () => "", getNewLine: () => Harness.IO.newLine() }; + const host = { getCanonicalFileName, getCurrentDirectory: () => "", getNewLine: () => IO.newLine() }; return (pretty ? ts.formatDiagnosticsWithColorAndContext : ts.formatDiagnostics)(diagnostics, host); } @@ -1370,7 +1370,7 @@ namespace Harness { } function outputErrorText(error: ts.Diagnostic) { - const message = ts.flattenDiagnosticMessageText(error.messageText, Harness.IO.newLine()); + const message = ts.flattenDiagnosticMessageText(error.messageText, IO.newLine()); const errLines = RunnerBase.removeFullPaths(message) .split("\n") @@ -1390,7 +1390,7 @@ namespace Harness { } } - yield [diagnosticSummaryMarker, minimalDiagnosticsToString(diagnostics, pretty) + Harness.IO.newLine() + Harness.IO.newLine(), diagnostics.length]; + yield [diagnosticSummaryMarker, minimalDiagnosticsToString(diagnostics, pretty) + IO.newLine() + IO.newLine(), diagnostics.length]; // Report global errors const globalErrors = diagnostics.filter(err => !err.file); @@ -1486,7 +1486,7 @@ namespace Harness { } export function doErrorBaseline(baselinePath: string, inputFiles: TestFile[], errors: ts.Diagnostic[], pretty?: boolean) { - Harness.Baseline.runBaseline(baselinePath.replace(/\.tsx?$/, ".errors.txt"), (): string => { + Baseline.runBaseline(baselinePath.replace(/\.tsx?$/, ".errors.txt"), (): string => { if (!errors || (errors.length === 0)) { /* tslint:disable:no-null-keyword */ return null; @@ -1496,7 +1496,7 @@ namespace Harness { }); } - export function doTypeAndSymbolBaseline(baselinePath: string, program: ts.Program, allFiles: {unitName: string, content: string}[], opts?: Harness.Baseline.BaselineOptions, multifile?: boolean, skipTypeBaselines?: boolean, skipSymbolBaselines?: boolean) { + export function doTypeAndSymbolBaseline(baselinePath: string, program: ts.Program, allFiles: {unitName: string, content: string}[], opts?: Baseline.BaselineOptions, multifile?: boolean, skipTypeBaselines?: boolean, skipSymbolBaselines?: boolean) { // The full walker simulates the types that you would get from doing a full // compile. The pull walker simulates the types you get when you just do // a type query for a random node (like how the LS would do it). Most of the @@ -1532,7 +1532,7 @@ namespace Harness { } if (typesError && symbolsError) { - throw new Error(typesError.stack + Harness.IO.newLine() + symbolsError.stack); + throw new Error(typesError.stack + IO.newLine() + symbolsError.stack); } if (typesError) { @@ -1555,10 +1555,10 @@ namespace Harness { if (!multifile) { const fullBaseLine = generateBaseLine(isSymbolBaseLine, isSymbolBaseLine ? skipSymbolBaselines : skipTypeBaselines); - Harness.Baseline.runBaseline(outputFileName + fullExtension, () => fullBaseLine, opts); + Baseline.runBaseline(outputFileName + fullExtension, () => fullBaseLine, opts); } else { - Harness.Baseline.runMultifileBaseline(outputFileName, fullExtension, () => { + Baseline.runMultifileBaseline(outputFileName, fullExtension, () => { return iterateBaseLine(isSymbolBaseLine, isSymbolBaseLine ? skipSymbolBaselines : skipTypeBaselines); }, opts); } @@ -1627,11 +1627,11 @@ namespace Harness { } } - function getByteOrderMarkText(file: Harness.Compiler.GeneratedFile): string { + function getByteOrderMarkText(file: GeneratedFile): string { return file.writeByteOrderMark ? "\u00EF\u00BB\u00BF" : ""; } - export function doSourcemapBaseline(baselinePath: string, options: ts.CompilerOptions, result: CompilerResult, harnessSettings: Harness.TestCaseParser.CompilerSettings) { + export function doSourcemapBaseline(baselinePath: string, options: ts.CompilerOptions, result: CompilerResult, harnessSettings: TestCaseParser.CompilerSettings) { if (options.inlineSourceMap) { if (result.sourceMaps.length > 0) { throw new Error("No sourcemap files should be generated if inlineSourceMaps was set."); @@ -1643,7 +1643,7 @@ namespace Harness { throw new Error("Number of sourcemap files should be same as js files."); } - Harness.Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ".js.map"), () => { + Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ".js.map"), () => { if ((options.noEmitOnError && result.errors.length !== 0) || result.sourceMaps.length === 0) { // We need to return null here or the runBaseLine will actually create a empty file. // Baselining isn't required here because there is no output. @@ -1662,13 +1662,13 @@ namespace Harness { } } - export function doJsEmitBaseline(baselinePath: string, header: string, options: ts.CompilerOptions, result: CompilerResult, tsConfigFiles: Harness.Compiler.TestFile[], toBeCompiled: Harness.Compiler.TestFile[], otherFiles: Harness.Compiler.TestFile[], harnessSettings: Harness.TestCaseParser.CompilerSettings) { + export function doJsEmitBaseline(baselinePath: string, header: string, options: ts.CompilerOptions, result: CompilerResult, tsConfigFiles: TestFile[], toBeCompiled: TestFile[], otherFiles: TestFile[], harnessSettings: TestCaseParser.CompilerSettings) { if (!options.noEmit && !options.emitDeclarationOnly && result.files.length === 0 && result.errors.length === 0) { throw new Error("Expected at least one js file to be emitted or at least one error to be created."); } // check js output - Harness.Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ts.Extension.Js), () => { + Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ts.Extension.Js), () => { let tsCode = ""; const tsSources = otherFiles.concat(toBeCompiled); if (tsSources.length > 1) { @@ -1691,15 +1691,15 @@ namespace Harness { } } - const declFileContext = Harness.Compiler.prepareDeclarationCompilationContext( + const declFileContext = prepareDeclarationCompilationContext( toBeCompiled, otherFiles, result, harnessSettings, options, /*currentDirectory*/ undefined ); - const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles(declFileContext); + const declFileCompilationResult = compileDeclarationFiles(declFileContext); if (declFileCompilationResult && declFileCompilationResult.declResult.errors.length) { jsCode += "\r\n\r\n//// [DtsFileErrors]\r\n"; jsCode += "\r\n\r\n"; - jsCode += Harness.Compiler.getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.errors); + jsCode += getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.errors); } if (jsCode.length > 0) { @@ -1713,12 +1713,12 @@ namespace Harness { }); } - function fileOutput(file: GeneratedFile, harnessSettings: Harness.TestCaseParser.CompilerSettings): string { + function fileOutput(file: GeneratedFile, harnessSettings: TestCaseParser.CompilerSettings): string { const fileName = harnessSettings.fullEmitPaths ? file.fileName : ts.getBaseFileName(file.fileName); return "//// [" + fileName + "]\r\n" + getByteOrderMarkText(file) + file.code; } - export function collateOutputs(outputFiles: Harness.Compiler.GeneratedFile[]): string { + export function collateOutputs(outputFiles: GeneratedFile[]): string { const gen = iterateOutputs(outputFiles); // Emit them let result = ""; @@ -1734,7 +1734,7 @@ namespace Harness { return result; } - export function *iterateOutputs(outputFiles: Harness.Compiler.GeneratedFile[]): IterableIterator<[string, string]> { + export function *iterateOutputs(outputFiles: GeneratedFile[]): IterableIterator<[string, string]> { // Collect, test, and sort the fileNames outputFiles.sort((a, b) => ts.compareStringsCaseSensitive(cleanName(a.fileName), cleanName(b.fileName))); const dupeCase = ts.createMap(); @@ -1839,7 +1839,7 @@ namespace Harness { public getSourceMapRecord() { if (this.sourceMapData && this.sourceMapData.length > 0) { - return Harness.SourceMapRecorder.getSourceMapRecord(this.sourceMapData, this.program, this.files); + return SourceMapRecorder.getSourceMapRecord(this.sourceMapData, this.program, this.files); } } } @@ -2020,10 +2020,10 @@ namespace Harness { function baselinePath(fileName: string, type: string, baselineFolder: string, subfolder?: string) { if (subfolder !== undefined) { - return Harness.userSpecifiedRoot + baselineFolder + "/" + subfolder + "/" + type + "/" + fileName; + return userSpecifiedRoot + baselineFolder + "/" + subfolder + "/" + type + "/" + fileName; } else { - return Harness.userSpecifiedRoot + baselineFolder + "/" + type + "/" + fileName; + return userSpecifiedRoot + baselineFolder + "/" + type + "/" + fileName; } } @@ -2082,7 +2082,7 @@ namespace Harness { } // Create folders if needed - createDirectoryStructure(Harness.IO.directoryName(actualFileName)); + createDirectoryStructure(IO.directoryName(actualFileName)); // Delete the actual file in case it fails if (IO.fileExists(actualFileName)) { @@ -2131,7 +2131,7 @@ namespace Harness { } const referenceDir = referencePath(relativeFileBase, opts && opts.Baselinefolder, opts && opts.Subfolder); - let existing = Harness.IO.readDirectory(referenceDir, referencedExtensions || [extension]); + let existing = IO.readDirectory(referenceDir, referencedExtensions || [extension]); if (extension === ".ts" || referencedExtensions && referencedExtensions.indexOf(".ts") > -1 && referencedExtensions.indexOf(".d.ts") === -1) { // special-case and filter .d.ts out of .ts results existing = existing.filter(f => !ts.endsWith(f, ".d.ts")); @@ -2173,11 +2173,11 @@ namespace Harness { } export function isBuiltFile(filePath: string): boolean { - return filePath.indexOf(Harness.libFolder) === 0; + return ts.startsWith(filePath, libFolder); } - export function getDefaultLibraryFile(filePath: string, io: Harness.Io): Harness.Compiler.TestFile { - const libFile = Harness.userSpecifiedRoot + Harness.libFolder + ts.getBaseFileName(ts.normalizeSlashes(filePath)); + export function getDefaultLibraryFile(filePath: string, io: Io): Compiler.TestFile { + const libFile = userSpecifiedRoot + libFolder + ts.getBaseFileName(ts.normalizeSlashes(filePath)); return { unitName: libFile, content: io.readFile(libFile) }; } diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 503246c72ca..23aa5ee2b8d 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -192,7 +192,7 @@ namespace Harness.LanguageService { return dir && dir.isDirectory() ? dir.getDirectories().map(d => d.name) : []; } getCurrentDirectory(): string { return virtualFileSystemRoot; } - getDefaultLibFileName(): string { return Harness.Compiler.defaultLibFileName; } + getDefaultLibFileName(): string { return Compiler.defaultLibFileName; } getScriptFileNames(): string[] { return this.getFilenames().filter(ts.isAnySupportedFileExtension); } @@ -641,8 +641,8 @@ namespace Harness.LanguageService { } readFile(fileName: string): string | undefined { - if (fileName.indexOf(Harness.Compiler.defaultLibFileName) >= 0) { - fileName = Harness.Compiler.defaultLibFileName; + if (ts.stringContains(fileName, Compiler.defaultLibFileName)) { + fileName = Compiler.defaultLibFileName; } const snapshot = this.host.getScriptSnapshot(fileName); diff --git a/src/harness/parallel/host.ts b/src/harness/parallel/host.ts index 59105cd5b08..49e7aaa6bd3 100644 --- a/src/harness/parallel/host.ts +++ b/src/harness/parallel/host.ts @@ -33,7 +33,7 @@ namespace Harness.Parallel.Host { return `${perfdataFileNameFragment}${target ? `.${target}` : ""}.json`; } function readSavedPerfData(target?: string): {[testHash: string]: number} { - const perfDataContents = Harness.IO.readFile(perfdataFileName(target)); + const perfDataContents = IO.readFile(perfdataFileName(target)); if (perfDataContents) { return JSON.parse(perfDataContents); } @@ -90,7 +90,7 @@ namespace Harness.Parallel.Host { catch { // May be a directory try { - size = Harness.IO.listFiles(path.join(runner.workingDirectory, file), /.*/g, { recursive: true }).reduce((acc, elem) => acc + statSync(elem).size, 0); + size = IO.listFiles(path.join(runner.workingDirectory, file), /.*/g, { recursive: true }).reduce((acc, elem) => acc + statSync(elem).size, 0); } catch { // Unknown test kind, just return 0 and let the historical analysis take over after one run @@ -144,9 +144,9 @@ namespace Harness.Parallel.Host { let closedWorkers = 0; for (let i = 0; i < workerCount; i++) { // TODO: Just send the config over the IPC channel or in the command line arguments - const config: TestConfig = { light: Harness.lightMode, listenForWork: true, runUnitTests }; + const config: TestConfig = { light: lightMode, listenForWork: true, runUnitTests }; const configPath = ts.combinePaths(taskConfigsFolder, `task-config${i}.json`); - Harness.IO.writeFile(configPath, JSON.stringify(config)); + IO.writeFile(configPath, JSON.stringify(config)); const child = fork(__filename, [`--config="${configPath}"`]); let currentTimeout = defaultTimeout; const killChild = () => { @@ -364,7 +364,7 @@ namespace Harness.Parallel.Host { reporter.epilogue(); } - Harness.IO.writeFile(perfdataFileName(configOption), JSON.stringify(newPerfData, null, 4)); // tslint:disable-line:no-null-keyword + IO.writeFile(perfdataFileName(configOption), JSON.stringify(newPerfData, null, 4)); // tslint:disable-line:no-null-keyword process.exit(errorResults.length); } diff --git a/src/harness/unittests/commandLineParsing.ts b/src/harness/unittests/commandLineParsing.ts index eebbf4a7a24..dbfa128b365 100644 --- a/src/harness/unittests/commandLineParsing.ts +++ b/src/harness/unittests/commandLineParsing.ts @@ -4,8 +4,8 @@ namespace ts { describe("parseCommandLine", () => { - function assertParseResult(commandLine: string[], expectedParsedCommandLine: ts.ParsedCommandLine) { - const parsed = ts.parseCommandLine(commandLine); + function assertParseResult(commandLine: string[], expectedParsedCommandLine: ParsedCommandLine) { + const parsed = parseCommandLine(commandLine); const parsedCompilerOptions = JSON.stringify(parsed.options); const expectedCompilerOptions = JSON.stringify(expectedParsedCommandLine.options); assert.equal(parsedCompilerOptions, expectedCompilerOptions); @@ -61,8 +61,8 @@ namespace ts { { errors: [{ messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -80,16 +80,16 @@ namespace ts { { errors: [{ messageText: "Compiler option 'jsx' expects an argument.", - category: ts.Diagnostics.Compiler_option_0_expects_an_argument.category, - code: ts.Diagnostics.Compiler_option_0_expects_an_argument.code, + category: Diagnostics.Compiler_option_0_expects_an_argument.category, + code: Diagnostics.Compiler_option_0_expects_an_argument.code, file: undefined, start: undefined, length: undefined, }, { messageText: "Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -106,16 +106,16 @@ namespace ts { { errors: [{ messageText: "Compiler option 'module' expects an argument.", - category: ts.Diagnostics.Compiler_option_0_expects_an_argument.category, - code: ts.Diagnostics.Compiler_option_0_expects_an_argument.code, + category: Diagnostics.Compiler_option_0_expects_an_argument.category, + code: Diagnostics.Compiler_option_0_expects_an_argument.code, file: undefined, start: undefined, length: undefined, }, { messageText: "Argument for '--module' option must be: 'none', 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'esnext'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -132,16 +132,16 @@ namespace ts { { errors: [{ messageText: "Compiler option 'newLine' expects an argument.", - category: ts.Diagnostics.Compiler_option_0_expects_an_argument.category, - code: ts.Diagnostics.Compiler_option_0_expects_an_argument.code, + category: Diagnostics.Compiler_option_0_expects_an_argument.category, + code: Diagnostics.Compiler_option_0_expects_an_argument.code, file: undefined, start: undefined, length: undefined, }, { messageText: "Argument for '--newLine' option must be: 'crlf', 'lf'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -158,16 +158,16 @@ namespace ts { { errors: [{ messageText: "Compiler option 'target' expects an argument.", - category: ts.Diagnostics.Compiler_option_0_expects_an_argument.category, - code: ts.Diagnostics.Compiler_option_0_expects_an_argument.code, + category: Diagnostics.Compiler_option_0_expects_an_argument.category, + code: Diagnostics.Compiler_option_0_expects_an_argument.code, file: undefined, start: undefined, length: undefined, }, { messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -184,16 +184,16 @@ namespace ts { { errors: [{ messageText: "Compiler option 'moduleResolution' expects an argument.", - category: ts.Diagnostics.Compiler_option_0_expects_an_argument.category, - code: ts.Diagnostics.Compiler_option_0_expects_an_argument.code, + category: Diagnostics.Compiler_option_0_expects_an_argument.category, + code: Diagnostics.Compiler_option_0_expects_an_argument.code, file: undefined, start: undefined, length: undefined, }, { messageText: "Argument for '--moduleResolution' option must be: 'node', 'classic'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -210,8 +210,8 @@ namespace ts { { errors: [{ messageText: "Compiler option 'lib' expects an argument.", - category: ts.Diagnostics.Compiler_option_0_expects_an_argument.category, - code: ts.Diagnostics.Compiler_option_0_expects_an_argument.code, + category: Diagnostics.Compiler_option_0_expects_an_argument.category, + code: Diagnostics.Compiler_option_0_expects_an_argument.code, file: undefined, start: undefined, @@ -231,8 +231,8 @@ namespace ts { { errors: [{ messageText: "Compiler option 'lib' expects an argument.", - category: ts.Diagnostics.Compiler_option_0_expects_an_argument.category, - code: ts.Diagnostics.Compiler_option_0_expects_an_argument.code, + category: Diagnostics.Compiler_option_0_expects_an_argument.category, + code: Diagnostics.Compiler_option_0_expects_an_argument.code, file: undefined, start: undefined, @@ -264,8 +264,8 @@ namespace ts { { errors: [{ messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -284,8 +284,8 @@ namespace ts { { errors: [{ messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", - category: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.category, - code: ts.Diagnostics.Argument_for_0_option_must_be_Colon_1.code, + category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, + code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, file: undefined, start: undefined, @@ -306,7 +306,7 @@ namespace ts { fileNames: ["0.ts"], options: { lib: ["lib.es5.d.ts", "lib.es2015.symbol.wellknown.d.ts"], - target: ts.ScriptTarget.ES5, + target: ScriptTarget.ES5, } }); }); @@ -318,8 +318,8 @@ namespace ts { errors: [], fileNames: ["0.ts"], options: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, + module: ModuleKind.CommonJS, + target: ScriptTarget.ES5, lib: ["lib.es5.d.ts", "lib.es2015.symbol.wellknown.d.ts"], } }); @@ -332,8 +332,8 @@ namespace ts { errors: [], fileNames: ["0.ts"], options: { - module: ts.ModuleKind.CommonJS, - target: ts.ScriptTarget.ES5, + module: ModuleKind.CommonJS, + target: ScriptTarget.ES5, lib: ["lib.es2015.core.d.ts", "lib.es2015.symbol.wellknown.d.ts"], } }); diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index a64d7bdd2a5..0efd8662cf1 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -13,8 +13,8 @@ namespace ts.projectSystem { describe("CompileOnSave affected list", () => { function sendAffectedFileRequestAndCheckResult(session: server.Session, request: server.protocol.Request, expectedFileList: { projectFileName: string, files: FileOrFolder[] }[]) { const response = session.executeCommand(request).response as server.protocol.CompileOnSaveAffectedFileListSingleProject[]; - const actualResult = response.sort((list1, list2) => ts.compareStringsCaseSensitive(list1.projectFileName, list2.projectFileName)); - expectedFileList = expectedFileList.sort((list1, list2) => ts.compareStringsCaseSensitive(list1.projectFileName, list2.projectFileName)); + const actualResult = response.sort((list1, list2) => compareStringsCaseSensitive(list1.projectFileName, list2.projectFileName)); + expectedFileList = expectedFileList.sort((list1, list2) => compareStringsCaseSensitive(list1.projectFileName, list2.projectFileName)); assert.equal(actualResult.length, expectedFileList.length, `Actual result project number is different from the expected project number`); @@ -517,7 +517,7 @@ namespace ts.projectSystem { const lines = ["var x = 1;", "var y = 2;"]; const path = "/a/app"; const f = { - path: path + ts.Extension.Ts, + path: path + Extension.Ts, content: lines.join(newLine) }; const host = createServerHost([f], { newLine }); @@ -536,7 +536,7 @@ namespace ts.projectSystem { arguments: { file: f.path } }; session.executeCommand(emitFileRequest); - const emitOutput = host.readFile(path + ts.Extension.Js); + const emitOutput = host.readFile(path + Extension.Js); assert.equal(emitOutput, f.content + newLine, "content of emit output should be identical with the input + newline"); } }); diff --git a/src/harness/unittests/configurationExtension.ts b/src/harness/unittests/configurationExtension.ts index 5a1b155fbcf..7e0eb5bad7e 100644 --- a/src/harness/unittests/configurationExtension.ts +++ b/src/harness/unittests/configurationExtension.ts @@ -129,17 +129,17 @@ namespace ts { ["under a case sensitive host", caseSensitiveBasePath, caseSensitiveHost] ], ([testName, basePath, host]) => { function getParseCommandLine(entry: string) { - const {config, error} = ts.readConfigFile(entry, name => host.readFile(name)); + const {config, error} = readConfigFile(entry, name => host.readFile(name)); assert(config && !error, flattenDiagnosticMessageText(error && error.messageText, "\n")); - return ts.parseJsonConfigFileContent(config, host, basePath, {}, entry); + return parseJsonConfigFileContent(config, host, basePath, {}, entry); } function getParseCommandLineJsonSourceFile(entry: string) { - const jsonSourceFile = ts.readJsonConfigFile(entry, name => host.readFile(name)); + const jsonSourceFile = readJsonConfigFile(entry, name => host.readFile(name)); assert(jsonSourceFile.endOfFileToken && !jsonSourceFile.parseDiagnostics.length, flattenDiagnosticMessageText(jsonSourceFile.parseDiagnostics[0] && jsonSourceFile.parseDiagnostics[0].messageText, "\n")); return { jsonSourceFile, - parsed: ts.parseJsonSourceFileConfigFileContent(jsonSourceFile, host, basePath, {}, entry) + parsed: parseJsonSourceFileConfigFileContent(jsonSourceFile, host, basePath, {}, entry) }; } diff --git a/src/harness/unittests/convertToBase64.ts b/src/harness/unittests/convertToBase64.ts index 975d21a3838..93c149c72ee 100644 --- a/src/harness/unittests/convertToBase64.ts +++ b/src/harness/unittests/convertToBase64.ts @@ -3,7 +3,7 @@ namespace ts { describe("convertToBase64", () => { function runTest(input: string): void { - const actual = ts.convertToBase64(input); + const actual = convertToBase64(input); const expected = new Buffer(input).toString("base64"); assert.equal(actual, expected, "Encoded string using convertToBase64 does not match buffer.toString('base64')"); } diff --git a/src/harness/unittests/extractRanges.ts b/src/harness/unittests/extractRanges.ts index ce9d18815bf..68d8289d206 100644 --- a/src/harness/unittests/extractRanges.ts +++ b/src/harness/unittests/extractRanges.ts @@ -27,9 +27,9 @@ namespace ts { const expectedRange = t.ranges.get("extracted"); if (expectedRange) { let pos: number, end: number; - if (ts.isArray(result.targetRange.range)) { + if (isArray(result.targetRange.range)) { pos = result.targetRange.range[0].getStart(f); - end = ts.lastOrUndefined(result.targetRange.range).getEnd(); + end = lastOrUndefined(result.targetRange.range).getEnd(); } else { pos = result.targetRange.range.getStart(f); diff --git a/src/harness/unittests/extractTestHelpers.ts b/src/harness/unittests/extractTestHelpers.ts index 8970990326c..1e3e3c8c81a 100644 --- a/src/harness/unittests/extractTestHelpers.ts +++ b/src/harness/unittests/extractTestHelpers.ts @@ -67,12 +67,12 @@ namespace ts { } export const newLineCharacter = "\n"; - export const testFormatOptions: ts.FormatCodeSettings = { + export const testFormatOptions: FormatCodeSettings = { indentSize: 4, tabSize: 4, newLineCharacter, convertTabsToSpaces: true, - indentStyle: ts.IndentStyle.Smart, + indentStyle: IndentStyle.Smart, insertSpaceAfterConstructor: false, insertSpaceAfterCommaDelimiter: true, insertSpaceAfterSemicolonInForStatements: true, diff --git a/src/harness/unittests/hostNewLineSupport.ts b/src/harness/unittests/hostNewLineSupport.ts index e7e5c11e33e..34543f2ec6f 100644 --- a/src/harness/unittests/hostNewLineSupport.ts +++ b/src/harness/unittests/hostNewLineSupport.ts @@ -17,7 +17,7 @@ namespace ts { getDefaultLibFileName: () => "lib.d.ts", getCurrentDirectory: () => "", }; - return ts.createLanguageService(lshost); + return createLanguageService(lshost); } function verifyNewLines(content: string, options: CompilerOptions) { diff --git a/src/harness/unittests/incrementalParser.ts b/src/harness/unittests/incrementalParser.ts index cdccce418bc..3792664601e 100644 --- a/src/harness/unittests/incrementalParser.ts +++ b/src/harness/unittests/incrementalParser.ts @@ -2,7 +2,7 @@ /// namespace ts { - ts.disableIncrementalParsing = false; + ts.disableIncrementalParsing = false; // tslint:disable-line no-unnecessary-qualifier (make clear this is a global mutation!) function withChange(text: IScriptSnapshot, start: number, length: number, newText: string): { text: IScriptSnapshot; textChangeRange: TextChangeRange; } { const contents = getSnapshotText(text); diff --git a/src/harness/unittests/jsDocParsing.ts b/src/harness/unittests/jsDocParsing.ts index b7215f5ea35..2d670a2b647 100644 --- a/src/harness/unittests/jsDocParsing.ts +++ b/src/harness/unittests/jsDocParsing.ts @@ -6,7 +6,7 @@ namespace ts { describe("TypeExpressions", () => { function parsesCorrectly(name: string, content: string) { it(name, () => { - const typeAndDiagnostics = ts.parseJSDocTypeExpressionForTests(content); + const typeAndDiagnostics = parseJSDocTypeExpressionForTests(content); assert.isTrue(typeAndDiagnostics && typeAndDiagnostics.diagnostics.length === 0, "no errors issued"); Harness.Baseline.runBaseline("JSDocParsing/TypeExpressions.parsesCorrectly." + name + ".json", @@ -16,7 +16,7 @@ namespace ts { function parsesIncorrectly(name: string, content: string) { it(name, () => { - const type = ts.parseJSDocTypeExpressionForTests(content); + const type = parseJSDocTypeExpressionForTests(content); assert.isTrue(!type || type.diagnostics.length > 0); }); } @@ -309,21 +309,21 @@ namespace ts { }); describe("getFirstToken", () => { it("gets jsdoc", () => { - const root = ts.createSourceFile("foo.ts", "/** comment */var a = true;", ts.ScriptTarget.ES5, /*setParentNodes*/ true); + const root = createSourceFile("foo.ts", "/** comment */var a = true;", ScriptTarget.ES5, /*setParentNodes*/ true); assert.isDefined(root); - assert.equal(root.kind, ts.SyntaxKind.SourceFile); + assert.equal(root.kind, SyntaxKind.SourceFile); const first = root.getFirstToken(); assert.isDefined(first); - assert.equal(first.kind, ts.SyntaxKind.VarKeyword); + assert.equal(first.kind, SyntaxKind.VarKeyword); }); }); describe("getLastToken", () => { it("gets jsdoc", () => { - const root = ts.createSourceFile("foo.ts", "var a = true;/** comment */", ts.ScriptTarget.ES5, /*setParentNodes*/ true); + const root = createSourceFile("foo.ts", "var a = true;/** comment */", ScriptTarget.ES5, /*setParentNodes*/ true); assert.isDefined(root); const last = root.getLastToken(); assert.isDefined(last); - assert.equal(last.kind, ts.SyntaxKind.EndOfFileToken); + assert.equal(last.kind, SyntaxKind.EndOfFileToken); }); }); }); diff --git a/src/harness/unittests/languageService.ts b/src/harness/unittests/languageService.ts index f14b9daad82..14bdff9867e 100644 --- a/src/harness/unittests/languageService.ts +++ b/src/harness/unittests/languageService.ts @@ -20,7 +20,7 @@ export function Component(x: Config): any;` // Regression test for GH #18245 - bug in single line comment writer caused a debug assertion when attempting // to write an alias to a module's default export was referrenced across files and had no default export it("should be able to create a language service which can respond to deinition requests without throwing", () => { - const languageService = ts.createLanguageService({ + const languageService = createLanguageService({ getCompilationSettings() { return {}; }, @@ -32,13 +32,13 @@ export function Component(x: Config): any;` }, getScriptSnapshot(fileName) { if (fileName === ".ts") { - return ts.ScriptSnapshot.fromString(""); + return ScriptSnapshot.fromString(""); } - return ts.ScriptSnapshot.fromString(files[fileName] || ""); + return ScriptSnapshot.fromString(files[fileName] || ""); }, getCurrentDirectory: () => ".", getDefaultLibFileName(options) { - return ts.getDefaultLibFilePath(options); + return getDefaultLibFilePath(options); }, }); const definitions = languageService.getDefinitionAtPosition("foo.ts", 160); // 160 is the latter `vueTemplateHtml` position diff --git a/src/harness/unittests/matchFiles.ts b/src/harness/unittests/matchFiles.ts index 17a0db04fdf..bbefd24bb57 100644 --- a/src/harness/unittests/matchFiles.ts +++ b/src/harness/unittests/matchFiles.ts @@ -91,17 +91,17 @@ namespace ts { "c:/dev/g.min.js/.g/g.ts" ]); - function assertParsed(actual: ts.ParsedCommandLine, expected: ts.ParsedCommandLine): void { + function assertParsed(actual: ParsedCommandLine, expected: ParsedCommandLine): void { assert.deepEqual(actual.fileNames, expected.fileNames); assert.deepEqual(actual.wildcardDirectories, expected.wildcardDirectories); assert.deepEqual(actual.errors, expected.errors); } - function validateMatches(expected: ts.ParsedCommandLine, json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[]) { + function validateMatches(expected: ParsedCommandLine, json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[]) { { const jsonText = JSON.stringify(json); const result = parseJsonText(caseInsensitiveTsconfigPath, jsonText); - const actual = ts.parseJsonSourceFileConfigFileContent(result, host, basePath, existingOptions, configFileName, resolutionStack); + const actual = parseJsonSourceFileConfigFileContent(result, host, basePath, existingOptions, configFileName, resolutionStack); for (const error of expected.errors) { if (error.file) { error.file = result; @@ -110,7 +110,7 @@ namespace ts { assertParsed(actual, expected); } { - const actual = ts.parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack); + const actual = parseJsonConfigFileContent(json, host, basePath, existingOptions, configFileName, resolutionStack); expected.errors = expected.errors.map(error => ({ category: error.category, code: error.code, @@ -130,13 +130,13 @@ namespace ts { kind: SyntaxKind.SourceFile, text }; - return ts.createFileDiagnostic(file, start, length, diagnosticMessage, arg0); + return createFileDiagnostic(file, start, length, diagnosticMessage, arg0); } describe("matchFiles", () => { it("with defaults", () => { const json = {}; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -145,7 +145,7 @@ namespace ts { "c:/dev/x/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); @@ -159,7 +159,7 @@ namespace ts { "b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -177,7 +177,7 @@ namespace ts { "x.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -198,7 +198,7 @@ namespace ts { "b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -219,7 +219,7 @@ namespace ts { "b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -237,10 +237,10 @@ namespace ts { "b.js" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") ], fileNames: [], @@ -255,10 +255,10 @@ namespace ts { "x.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") ], fileNames: [], @@ -276,7 +276,7 @@ namespace ts { "b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -302,7 +302,7 @@ namespace ts { "*/b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -327,7 +327,7 @@ namespace ts { "**/b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -348,7 +348,7 @@ namespace ts { "**/b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -368,7 +368,7 @@ namespace ts { "jspm_packages/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -396,7 +396,7 @@ namespace ts { "b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -418,7 +418,7 @@ namespace ts { "jspm_packages/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -442,7 +442,7 @@ namespace ts { "x/*.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -457,8 +457,8 @@ namespace ts { "c:/dev/x/b.ts" ], wildcardDirectories: { - "c:/dev/z": ts.WatchDirectoryFlags.None, - "c:/dev/x": ts.WatchDirectoryFlags.None + "c:/dev/z": WatchDirectoryFlags.None, + "c:/dev/x": WatchDirectoryFlags.None }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -469,7 +469,7 @@ namespace ts { "*.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -478,7 +478,7 @@ namespace ts { "c:/dev/c.d.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.None + "c:/dev": WatchDirectoryFlags.None }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -489,7 +489,7 @@ namespace ts { "*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -498,7 +498,7 @@ namespace ts { "c:/dev/c.d.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.None + "c:/dev": WatchDirectoryFlags.None }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -509,7 +509,7 @@ namespace ts { "x/?.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -517,7 +517,7 @@ namespace ts { "c:/dev/x/b.ts" ], wildcardDirectories: { - "c:/dev/x": ts.WatchDirectoryFlags.None + "c:/dev/x": WatchDirectoryFlags.None }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -528,7 +528,7 @@ namespace ts { "**/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -538,7 +538,7 @@ namespace ts { "c:/dev/z/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -551,7 +551,7 @@ namespace ts { "z/**/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -560,8 +560,8 @@ namespace ts { "c:/dev/z/a.ts" ], wildcardDirectories: { - "c:/dev/x": ts.WatchDirectoryFlags.Recursive, - "c:/dev/z": ts.WatchDirectoryFlags.Recursive + "c:/dev/x": WatchDirectoryFlags.Recursive, + "c:/dev/z": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -572,14 +572,14 @@ namespace ts { "**/A.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ "/dev/A.ts" ], wildcardDirectories: { - "/dev": ts.WatchDirectoryFlags.Recursive + "/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath); @@ -590,15 +590,15 @@ namespace ts { "*/z.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") ], fileNames: [], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); @@ -615,14 +615,14 @@ namespace ts { "**/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ "c:/dev/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -637,7 +637,7 @@ namespace ts { "x" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -646,7 +646,7 @@ namespace ts { "c:/dev/c.d.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -658,7 +658,7 @@ namespace ts { "**/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -666,7 +666,7 @@ namespace ts { "c:/dev/x/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); @@ -680,7 +680,7 @@ namespace ts { "a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -688,7 +688,7 @@ namespace ts { "c:/dev/x/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); @@ -700,7 +700,7 @@ namespace ts { ], exclude: [] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -708,7 +708,7 @@ namespace ts { "c:/dev/x/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); @@ -720,7 +720,7 @@ namespace ts { "**/node_modules/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -729,7 +729,7 @@ namespace ts { "c:/dev/node_modules/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); @@ -740,14 +740,14 @@ namespace ts { "*/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ "c:/dev/x/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); @@ -759,7 +759,7 @@ namespace ts { "node_modules/a.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -767,7 +767,7 @@ namespace ts { "c:/dev/node_modules/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive }, }; validateMatches(expected, json, caseInsensitiveCommonFoldersHost, caseInsensitiveBasePath); @@ -782,17 +782,17 @@ namespace ts { "js/*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { allowJs: false }, errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") ], fileNames: [], wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None + "c:/dev/js": WatchDirectoryFlags.None } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); @@ -806,7 +806,7 @@ namespace ts { "js/*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { allowJs: true }, @@ -816,7 +816,7 @@ namespace ts { "c:/dev/js/b.js" ], wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None + "c:/dev/js": WatchDirectoryFlags.None } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -830,7 +830,7 @@ namespace ts { "js/*.min.js" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { allowJs: true }, @@ -840,7 +840,7 @@ namespace ts { "c:/dev/js/d.min.js" ], wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None + "c:/dev/js": WatchDirectoryFlags.None } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -852,7 +852,7 @@ namespace ts { "c:/ext/*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -862,8 +862,8 @@ namespace ts { "c:/ext/ext.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.None, - "c:/ext": ts.WatchDirectoryFlags.None + "c:/dev": WatchDirectoryFlags.None, + "c:/ext": WatchDirectoryFlags.None } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -878,14 +878,14 @@ namespace ts { "**" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ "c:/ext/ext.ts" ], wildcardDirectories: { - "c:/ext": ts.WatchDirectoryFlags.None + "c:/ext": WatchDirectoryFlags.None } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -899,10 +899,10 @@ namespace ts { "../**" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), JSON.stringify(json.exclude))] , fileNames: [], @@ -919,7 +919,7 @@ namespace ts { "**" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -938,14 +938,14 @@ namespace ts { "c:/ext/b/a..b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ "c:/ext/ext.ts", ], wildcardDirectories: { - "c:/ext": ts.WatchDirectoryFlags.Recursive + "c:/ext": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -956,7 +956,7 @@ namespace ts { allowJs: false } }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { allowJs: false }, @@ -967,7 +967,7 @@ namespace ts { "c:/dev/c.tsx", ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); @@ -979,9 +979,9 @@ namespace ts { allowJs: false } }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { - jsx: ts.JsxEmit.Preserve, + jsx: JsxEmit.Preserve, allowJs: false }, errors: [], @@ -991,7 +991,7 @@ namespace ts { "c:/dev/c.tsx", ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); @@ -1003,9 +1003,9 @@ namespace ts { allowJs: false } }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { - jsx: ts.JsxEmit.ReactNative, + jsx: JsxEmit.ReactNative, allowJs: false }, errors: [], @@ -1015,7 +1015,7 @@ namespace ts { "c:/dev/c.tsx", ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); @@ -1026,7 +1026,7 @@ namespace ts { allowJs: true } }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { allowJs: true }, @@ -1039,7 +1039,7 @@ namespace ts { "c:/dev/e.jsx", ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); @@ -1051,9 +1051,9 @@ namespace ts { allowJs: true } }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { - jsx: ts.JsxEmit.Preserve, + jsx: JsxEmit.Preserve, allowJs: true }, errors: [], @@ -1065,7 +1065,7 @@ namespace ts { "c:/dev/e.jsx", ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); @@ -1077,9 +1077,9 @@ namespace ts { allowJs: true } }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { - jsx: ts.JsxEmit.ReactNative, + jsx: JsxEmit.ReactNative, allowJs: true }, errors: [], @@ -1091,7 +1091,7 @@ namespace ts { "c:/dev/e.jsx", ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveMixedExtensionHost, caseInsensitiveBasePath); @@ -1108,7 +1108,7 @@ namespace ts { "js/a*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: { allowJs: true }, @@ -1117,7 +1117,7 @@ namespace ts { "c:/dev/js/d.min.js" ], wildcardDirectories: { - "c:/dev/js": ts.WatchDirectoryFlags.None + "c:/dev/js": WatchDirectoryFlags.None } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -1130,11 +1130,11 @@ namespace ts { "**" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - createDiagnosticForConfigFile(json, 12, 4, ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**"), - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createDiagnosticForConfigFile(json, 12, 4, Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**"), + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") ], fileNames: [], @@ -1151,10 +1151,10 @@ namespace ts { "**" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), JSON.stringify(json.exclude)) ], fileNames: [], @@ -1170,7 +1170,7 @@ namespace ts { "**/x/**/*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1181,7 +1181,7 @@ namespace ts { "c:/dev/x/y/b.ts", ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath, /*existingOptions*/ undefined, caseInsensitiveTsconfigPath); @@ -1195,7 +1195,7 @@ namespace ts { "**/x/**" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1203,7 +1203,7 @@ namespace ts { "c:/dev/z/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -1217,11 +1217,11 @@ namespace ts { "**/../*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - createDiagnosticForConfigFile(json, 12, 9, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/../*"), - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createDiagnosticForConfigFile(json, 12, 9, Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/../*"), + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") ], fileNames: [], @@ -1236,11 +1236,11 @@ namespace ts { "**/y/../*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - createDiagnosticForConfigFile(json, 12, 11, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/y/../*"), - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createDiagnosticForConfigFile(json, 12, 11, Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/y/../*"), + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), "[]") ], fileNames: [], @@ -1258,10 +1258,10 @@ namespace ts { "**/.." ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - createDiagnosticForConfigFile(json, 34, 7, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/..") + createDiagnosticForConfigFile(json, 34, 7, Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/..") ], fileNames: [ "c:/dev/a.ts", @@ -1270,7 +1270,7 @@ namespace ts { "c:/dev/z/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -1285,10 +1285,10 @@ namespace ts { "**/y/.." ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - createDiagnosticForConfigFile(json, 34, 9, ts.Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/y/..") + createDiagnosticForConfigFile(json, 34, 9, Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, "**/y/..") ], fileNames: [ "c:/dev/a.ts", @@ -1297,7 +1297,7 @@ namespace ts { "c:/dev/z/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -1309,12 +1309,12 @@ namespace ts { const json = { include: ["z"] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ "a.ts", "aba.ts", "abz.ts", "b.ts", "bba.ts", "bbz.ts" ].map(x => `c:/dev/z/${x}`), wildcardDirectories: { - "c:/dev/z": ts.WatchDirectoryFlags.Recursive + "c:/dev/z": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveHost, caseInsensitiveBasePath); @@ -1330,7 +1330,7 @@ namespace ts { "w/*/*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1338,8 +1338,8 @@ namespace ts { "c:/dev/x/y/d.ts", ], wildcardDirectories: { - "c:/dev/x": ts.WatchDirectoryFlags.Recursive, - "c:/dev/w": ts.WatchDirectoryFlags.Recursive + "c:/dev/x": WatchDirectoryFlags.Recursive, + "c:/dev/w": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); @@ -1352,7 +1352,7 @@ namespace ts { "c:/dev/.z/.b.ts" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1369,7 +1369,7 @@ namespace ts { "**/.*/*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1379,7 +1379,7 @@ namespace ts { "c:/dev/x/.y/a.ts" ], wildcardDirectories: { - "c:/dev": ts.WatchDirectoryFlags.Recursive + "c:/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); @@ -1391,7 +1391,7 @@ namespace ts { ".z/**/.*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1399,8 +1399,8 @@ namespace ts { "c:/dev/.z/.b.ts" ], wildcardDirectories: { - "c:/dev/.z": ts.WatchDirectoryFlags.Recursive, - "c:/dev/x": ts.WatchDirectoryFlags.Recursive + "c:/dev/.z": WatchDirectoryFlags.Recursive, + "c:/dev/x": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseInsensitiveDottedFoldersHost, caseInsensitiveBasePath); @@ -1414,10 +1414,10 @@ namespace ts { "**/*" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [ - ts.createCompilerDiagnostic(ts.Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, + createCompilerDiagnostic(Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, caseInsensitiveTsconfigPath, JSON.stringify(json.include), JSON.stringify(json.exclude)) ], fileNames: [], @@ -1435,7 +1435,7 @@ namespace ts { "**/x" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1453,7 +1453,7 @@ namespace ts { "/dev/z/bbz.ts", ], wildcardDirectories: { - "/dev": ts.WatchDirectoryFlags.Recursive + "/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath); @@ -1465,7 +1465,7 @@ namespace ts { "**/a/**/b" ] }; - const expected: ts.ParsedCommandLine = { + const expected: ParsedCommandLine = { options: {}, errors: [], fileNames: [ @@ -1476,7 +1476,7 @@ namespace ts { "/dev/q/a/c/b/d.ts", ], wildcardDirectories: { - "/dev": ts.WatchDirectoryFlags.Recursive + "/dev": WatchDirectoryFlags.Recursive } }; validateMatches(expected, json, caseSensitiveHost, caseSensitiveBasePath); diff --git a/src/harness/unittests/moduleResolution.ts b/src/harness/unittests/moduleResolution.ts index 0dd016b2f22..13ff6776a1f 100644 --- a/src/harness/unittests/moduleResolution.ts +++ b/src/harness/unittests/moduleResolution.ts @@ -441,7 +441,7 @@ export = C; "/a/b/c.ts": `/// `, "/a/b/d.ts": "var x" }); - test(files, { module: ts.ModuleKind.AMD }, "/a/b", /*useCaseSensitiveFileNames*/ false, ["c.ts", "/a/b/d.ts"], []); + test(files, { module: ModuleKind.AMD }, "/a/b", /*useCaseSensitiveFileNames*/ false, ["c.ts", "/a/b/d.ts"], []); }); it("should fail when two files used in program differ only in casing (tripleslash references)", () => { @@ -449,7 +449,7 @@ export = C; "/a/b/c.ts": `/// `, "/a/b/d.ts": "var x" }); - test(files, { module: ts.ModuleKind.AMD, forceConsistentCasingInFileNames: true }, "/a/b", /*useCaseSensitiveFileNames*/ false, ["c.ts", "d.ts"], [1149]); + test(files, { module: ModuleKind.AMD, forceConsistentCasingInFileNames: true }, "/a/b", /*useCaseSensitiveFileNames*/ false, ["c.ts", "d.ts"], [1149]); }); it("should fail when two files used in program differ only in casing (imports)", () => { @@ -457,7 +457,7 @@ export = C; "/a/b/c.ts": `import {x} from "D"`, "/a/b/d.ts": "export var x" }); - test(files, { module: ts.ModuleKind.AMD, forceConsistentCasingInFileNames: true }, "/a/b", /*useCaseSensitiveFileNames*/ false, ["c.ts", "d.ts"], [1149]); + test(files, { module: ModuleKind.AMD, forceConsistentCasingInFileNames: true }, "/a/b", /*useCaseSensitiveFileNames*/ false, ["c.ts", "d.ts"], [1149]); }); it("should fail when two files used in program differ only in casing (imports, relative module names)", () => { @@ -465,7 +465,7 @@ export = C; "moduleA.ts": `import {x} from "./ModuleB"`, "moduleB.ts": "export var x" }); - test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "", /*useCaseSensitiveFileNames*/ false, ["moduleA.ts", "moduleB.ts"], [1149]); + test(files, { module: ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "", /*useCaseSensitiveFileNames*/ false, ["moduleA.ts", "moduleB.ts"], [1149]); }); it("should fail when two files exist on disk that differs only in casing", () => { @@ -474,7 +474,7 @@ export = C; "/a/b/D.ts": "export var x", "/a/b/d.ts": "export var y" }); - test(files, { module: ts.ModuleKind.AMD }, "/a/b", /*useCaseSensitiveFileNames*/ true, ["c.ts", "d.ts"], [1149]); + test(files, { module: ModuleKind.AMD }, "/a/b", /*useCaseSensitiveFileNames*/ true, ["c.ts", "d.ts"], [1149]); }); it("should fail when module name in 'require' calls has inconsistent casing", () => { @@ -483,7 +483,7 @@ export = C; "moduleB.ts": `import a = require("./moduleC")`, "moduleC.ts": "export var x" }); - test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "", /*useCaseSensitiveFileNames*/ false, ["moduleA.ts", "moduleB.ts", "moduleC.ts"], [1149, 1149]); + test(files, { module: ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "", /*useCaseSensitiveFileNames*/ false, ["moduleA.ts", "moduleB.ts", "moduleC.ts"], [1149, 1149]); }); it("should fail when module names in 'require' calls has inconsistent casing and current directory has uppercase chars", () => { @@ -496,7 +496,7 @@ import a = require("./moduleA"); import b = require("./moduleB"); ` }); - test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /*useCaseSensitiveFileNames*/ false, ["moduleD.ts"], [1149]); + test(files, { module: ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /*useCaseSensitiveFileNames*/ false, ["moduleD.ts"], [1149]); }); it("should not fail when module names in 'require' calls has consistent casing and current directory has uppercase chars", () => { const files = createMapFromTemplate({ @@ -508,7 +508,7 @@ import a = require("./moduleA"); import b = require("./moduleB"); ` }); - test(files, { module: ts.ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /*useCaseSensitiveFileNames*/ false, ["moduleD.ts"], []); + test(files, { module: ModuleKind.CommonJS, forceConsistentCasingInFileNames: true }, "/a/B/c", /*useCaseSensitiveFileNames*/ false, ["moduleD.ts"], []); }); }); diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts index 70325831f51..0ba9e6f6351 100644 --- a/src/harness/unittests/reuseProgramStructure.ts +++ b/src/harness/unittests/reuseProgramStructure.ts @@ -884,9 +884,9 @@ namespace ts { }); }); - type FileOrFolder = ts.TestFSWithWatch.FileOrFolder; - import createTestSystem = ts.TestFSWithWatch.createWatchedSystem; - import libFile = ts.TestFSWithWatch.libFile; + type FileOrFolder = TestFSWithWatch.FileOrFolder; + import createTestSystem = TestFSWithWatch.createWatchedSystem; + import libFile = TestFSWithWatch.libFile; describe("isProgramUptoDate should return true when there is no change in compiler options and", () => { function verifyProgramIsUptoDate( diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index b690045d7c1..7ba8019e2bd 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -42,7 +42,7 @@ namespace ts.server { let lastSent: protocol.Message; function createSession(): TestSession { - const opts: server.SessionOptions = { + const opts: SessionOptions = { host: mockHost, cancellationToken: nullCancellationToken, useSingleInferredProject: false, @@ -181,9 +181,7 @@ namespace ts.server { type: "request" }; - const expected: protocol.StatusResponseBody = { - version: ts.version - }; + const expected: protocol.StatusResponseBody = { version }; assert.deepEqual(session.executeCommand(req).response, expected); }); }); @@ -330,7 +328,7 @@ namespace ts.server { describe("send", () => { it("is an overrideable handle which sends protocol messages over the wire", () => { - const msg: server.protocol.Request = { seq: 0, type: "request", command: "" }; + const msg: protocol.Request = { seq: 0, type: "request", command: "" }; const strmsg = JSON.stringify(msg); const len = 1 + Utils.byteLength(strmsg, "utf8"); const resultMsg = `Content-Length: ${len}\r\n\r\n${strmsg}\n`; @@ -348,7 +346,7 @@ namespace ts.server { item: false }; const command = "newhandle"; - const result: ts.server.HandlerResponse = { + const result: HandlerResponse = { response: respBody, responseRequired: true }; @@ -365,7 +363,7 @@ namespace ts.server { const respBody = { item: false }; - const resp: ts.server.HandlerResponse = { + const resp: HandlerResponse = { response: respBody, responseRequired: true }; @@ -712,7 +710,7 @@ namespace ts.server { const text = `// blank line\nconst x = 0;`; const renameLocationInOldText = text.indexOf("0"); const fileName = "/a.ts"; - const edits: ts.FileTextChanges = { + const edits: FileTextChanges = { fileName, textChanges: [ { diff --git a/src/harness/unittests/telemetry.ts b/src/harness/unittests/telemetry.ts index 5cea42efcf5..27512ba1e8c 100644 --- a/src/harness/unittests/telemetry.ts +++ b/src/harness/unittests/telemetry.ts @@ -7,7 +7,7 @@ namespace ts.projectSystem { const file = makeFile("/a.js"); const et = new TestServerEventManager([file]); et.service.openClientFile(file.path); - et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); + et.hasZeroEvent(server.ProjectInfoTelemetryEvent); }); it("only sends an event once", () => { @@ -25,18 +25,18 @@ namespace ts.projectSystem { et.service.openClientFile(file2.path); checkNumberOfProjects(et.service, { inferredProjects: 1 }); - et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); + et.hasZeroEvent(server.ProjectInfoTelemetryEvent); et.service.openClientFile(file.path); checkNumberOfProjects(et.service, { configuredProjects: 1, inferredProjects: 1 }); - et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); + et.hasZeroEvent(server.ProjectInfoTelemetryEvent); }); it("counts files by extension", () => { const files = ["ts.ts", "tsx.tsx", "moo.ts", "dts.d.ts", "jsx.jsx", "js.js", "badExtension.badExtension"].map(f => makeFile(`/src/${f}`)); const notIncludedFile = makeFile("/bin/ts.js"); - const compilerOptions: ts.CompilerOptions = { allowJs: true }; + const compilerOptions: CompilerOptions = { allowJs: true }; const tsconfig = makeFile("/tsconfig.json", { compilerOptions, include: ["src"] }); const et = new TestServerEventManager([...files, notIncludedFile, tsconfig]); @@ -51,7 +51,7 @@ namespace ts.projectSystem { it("works with external project", () => { const file1 = makeFile("/a.ts"); const et = new TestServerEventManager([file1]); - const compilerOptions: ts.server.protocol.CompilerOptions = { strict: true }; + const compilerOptions: server.protocol.CompilerOptions = { strict: true }; const projectFileName = "/hunter2/foo.csproj"; @@ -92,7 +92,7 @@ namespace ts.projectSystem { it("does not expose paths", () => { const file = makeFile("/a.ts"); - const compilerOptions: ts.CompilerOptions = { + const compilerOptions: CompilerOptions = { project: "", outFile: "hunter2.js", outDir: "hunter2", @@ -122,7 +122,7 @@ namespace ts.projectSystem { // Sensitive data doesn't get through even if sent to an option of safe type checkJs: "hunter2" as any as boolean, }; - const safeCompilerOptions: ts.CompilerOptions = { + const safeCompilerOptions: CompilerOptions = { project: "", outFile: "", outDir: "", @@ -236,7 +236,7 @@ namespace ts.projectSystem { }); }); - function makeFile(path: string, content: {} = ""): projectSystem.FileOrFolder { + function makeFile(path: string, content: {} = ""): FileOrFolder { return { path, content: isString(content) ? "" : JSON.stringify(content) }; } } diff --git a/src/harness/unittests/textStorage.ts b/src/harness/unittests/textStorage.ts index aa8231aa31a..755766bd02f 100644 --- a/src/harness/unittests/textStorage.ts +++ b/src/harness/unittests/textStorage.ts @@ -16,7 +16,7 @@ namespace ts.textStorage { it("text based storage should be have exactly the same as script version cache", () => { - const host = ts.projectSystem.createServerHost([f]); + const host = projectSystem.createServerHost([f]); const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path)); const ts2 = new server.TextStorage(host, server.asNormalizedPath(f.path)); @@ -51,7 +51,7 @@ namespace ts.textStorage { }); it("should switch to script version cache if necessary", () => { - const host = ts.projectSystem.createServerHost([f]); + const host = projectSystem.createServerHost([f]); const ts1 = new server.TextStorage(host, server.asNormalizedPath(f.path)); ts1.getSnapshot(); diff --git a/src/harness/unittests/transform.ts b/src/harness/unittests/transform.ts index 64f0a19b32d..3cca8f6210c 100644 --- a/src/harness/unittests/transform.ts +++ b/src/harness/unittests/transform.ts @@ -3,7 +3,7 @@ namespace ts { describe("TransformAPI", () => { - function replaceUndefinedWithVoid0(context: ts.TransformationContext) { + function replaceUndefinedWithVoid0(context: TransformationContext) { const previousOnSubstituteNode = context.onSubstituteNode; context.enableSubstitution(SyntaxKind.Identifier); context.onSubstituteNode = (hint, node) => { @@ -18,19 +18,19 @@ namespace ts { } return node; }; - return (file: ts.SourceFile) => file; + return (file: SourceFile) => file; } - function replaceNumberWith2(context: ts.TransformationContext) { + function replaceNumberWith2(context: TransformationContext) { function visitor(node: Node): Node { if (isNumericLiteral(node)) { return createNumericLiteral("2"); } return visitEachChild(node, visitor, context); } - return (file: ts.SourceFile) => visitNode(file, visitor); + return (file: SourceFile) => visitNode(file, visitor); } - function replaceIdentifiersNamedOldNameWithNewName(context: ts.TransformationContext) { + function replaceIdentifiersNamedOldNameWithNewName(context: TransformationContext) { const previousOnSubstituteNode = context.onSubstituteNode; context.enableSubstitution(SyntaxKind.Identifier); context.onSubstituteNode = (hint, node) => { @@ -40,7 +40,7 @@ namespace ts { } return node; }; - return (file: ts.SourceFile) => file; + return (file: SourceFile) => file; } function transformSourceFile(sourceText: string, transformers: TransformerFactory[]) { @@ -73,7 +73,7 @@ namespace ts { }); testBaseline("fromTranspileModule", () => { - return ts.transpileModule(`var oldName = undefined;`, { + return transpileModule(`var oldName = undefined;`, { transformers: { before: [replaceUndefinedWithVoid0], after: [replaceIdentifiersNamedOldNameWithNewName] @@ -85,7 +85,7 @@ namespace ts { }); testBaseline("rewrittenNamespace", () => { - return ts.transpileModule(`namespace Reflect { const x = 1; }`, { + return transpileModule(`namespace Reflect { const x = 1; }`, { transformers: { before: [forceNamespaceRewrite], }, @@ -96,7 +96,7 @@ namespace ts { }); testBaseline("rewrittenNamespaceFollowingClass", () => { - return ts.transpileModule(` + return transpileModule(` class C { foo = 10; static bar = 20 } namespace C { export let x = 10; } `, { @@ -104,90 +104,90 @@ namespace ts { before: [forceNamespaceRewrite], }, compilerOptions: { - target: ts.ScriptTarget.ESNext, + target: ScriptTarget.ESNext, newLine: NewLineKind.CarriageReturnLineFeed, } }).outputText; }); testBaseline("transformTypesInExportDefault", () => { - return ts.transpileModule(` + return transpileModule(` export default (foo: string) => { return 1; } `, { transformers: { before: [replaceNumberWith2], }, compilerOptions: { - target: ts.ScriptTarget.ESNext, + target: ScriptTarget.ESNext, newLine: NewLineKind.CarriageReturnLineFeed, } }).outputText; }); testBaseline("synthesizedClassAndNamespaceCombination", () => { - return ts.transpileModule("", { + return transpileModule("", { transformers: { before: [replaceWithClassAndNamespace], }, compilerOptions: { - target: ts.ScriptTarget.ESNext, + target: ScriptTarget.ESNext, newLine: NewLineKind.CarriageReturnLineFeed, } }).outputText; function replaceWithClassAndNamespace() { - return (sourceFile: ts.SourceFile) => { + return (sourceFile: SourceFile) => { const result = getMutableClone(sourceFile); - result.statements = ts.createNodeArray([ - ts.createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, "Foo", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, /*members*/ undefined), - ts.createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createIdentifier("Foo"), createModuleBlock([createEmptyStatement()])) + result.statements = createNodeArray([ + createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, "Foo", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, /*members*/ undefined), + createModuleDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, createIdentifier("Foo"), createModuleBlock([createEmptyStatement()])) ]); return result; }; } }); - function forceNamespaceRewrite(context: ts.TransformationContext) { - return (sourceFile: ts.SourceFile): ts.SourceFile => { + function forceNamespaceRewrite(context: TransformationContext) { + return (sourceFile: SourceFile): SourceFile => { return visitNode(sourceFile); - function visitNode(node: T): T { - if (node.kind === ts.SyntaxKind.ModuleBlock) { - const block = node as T & ts.ModuleBlock; - const statements = ts.createNodeArray([...block.statements]); - return ts.updateModuleBlock(block, statements) as typeof block; + function visitNode(node: T): T { + if (node.kind === SyntaxKind.ModuleBlock) { + const block = node as T & ModuleBlock; + const statements = createNodeArray([...block.statements]); + return updateModuleBlock(block, statements) as typeof block; } - return ts.visitEachChild(node, visitNode, context); + return visitEachChild(node, visitNode, context); } }; } testBaseline("transformAwayExportStar", () => { - return ts.transpileModule("export * from './helper';", { + return transpileModule("export * from './helper';", { transformers: { before: [expandExportStar], }, compilerOptions: { - target: ts.ScriptTarget.ESNext, + target: ScriptTarget.ESNext, newLine: NewLineKind.CarriageReturnLineFeed, } }).outputText; - function expandExportStar(context: ts.TransformationContext) { - return (sourceFile: ts.SourceFile): ts.SourceFile => { + function expandExportStar(context: TransformationContext) { + return (sourceFile: SourceFile): SourceFile => { return visitNode(sourceFile); - function visitNode(node: T): T { - if (node.kind === ts.SyntaxKind.ExportDeclaration) { - const ed = node as ts.Node as ts.ExportDeclaration; + function visitNode(node: T): T { + if (node.kind === SyntaxKind.ExportDeclaration) { + const ed = node as Node as ExportDeclaration; const exports = [{ name: "x" }]; - const exportSpecifiers = exports.map(e => ts.createExportSpecifier(e.name, e.name)); - const exportClause = ts.createNamedExports(exportSpecifiers); - const newEd = ts.updateExportDeclaration(ed, ed.decorators, ed.modifiers, exportClause, ed.moduleSpecifier); + const exportSpecifiers = exports.map(e => createExportSpecifier(e.name, e.name)); + const exportClause = createNamedExports(exportSpecifiers); + const newEd = updateExportDeclaration(ed, ed.decorators, ed.modifiers, exportClause, ed.moduleSpecifier); - return newEd as ts.Node as T; + return newEd as Node as T; } - return ts.visitEachChild(node, visitNode, context); + return visitEachChild(node, visitNode, context); } }; } @@ -195,58 +195,58 @@ namespace ts { // https://github.com/Microsoft/TypeScript/issues/19618 testBaseline("transformAddImportStar", () => { - return ts.transpileModule("", { + return transpileModule("", { transformers: { before: [transformAddImportStar], }, compilerOptions: { - target: ts.ScriptTarget.ES5, - module: ts.ModuleKind.System, + target: ScriptTarget.ES5, + module: ModuleKind.System, newLine: NewLineKind.CarriageReturnLineFeed, } }).outputText; - function transformAddImportStar(_context: ts.TransformationContext) { - return (sourceFile: ts.SourceFile): ts.SourceFile => { + function transformAddImportStar(_context: TransformationContext) { + return (sourceFile: SourceFile): SourceFile => { return visitNode(sourceFile); }; - function visitNode(sf: ts.SourceFile) { + function visitNode(sf: SourceFile) { // produce `import * as i0 from './comp'; - const importStar = ts.createImportDeclaration( + const importStar = createImportDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, - /*importClause*/ ts.createImportClause( + /*importClause*/ createImportClause( /*name*/ undefined, - ts.createNamespaceImport(ts.createIdentifier("i0")) + createNamespaceImport(createIdentifier("i0")) ), - /*moduleSpecifier*/ ts.createLiteral("./comp1")); - return ts.updateSourceFileNode(sf, [importStar]); + /*moduleSpecifier*/ createLiteral("./comp1")); + return updateSourceFileNode(sf, [importStar]); } } }); // https://github.com/Microsoft/TypeScript/issues/17384 testBaseline("transformAddDecoratedNode", () => { - return ts.transpileModule("", { + return transpileModule("", { transformers: { before: [transformAddDecoratedNode], }, compilerOptions: { - target: ts.ScriptTarget.ES5, + target: ScriptTarget.ES5, newLine: NewLineKind.CarriageReturnLineFeed, } }).outputText; - function transformAddDecoratedNode(_context: ts.TransformationContext) { - return (sourceFile: ts.SourceFile): ts.SourceFile => { + function transformAddDecoratedNode(_context: TransformationContext) { + return (sourceFile: SourceFile): SourceFile => { return visitNode(sourceFile); }; - function visitNode(sf: ts.SourceFile) { + function visitNode(sf: SourceFile) { // produce `class Foo { @Bar baz() {} }`; - const classDecl = ts.createClassDeclaration([], [], "Foo", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, [ - ts.createMethod([ts.createDecorator(ts.createIdentifier("Bar"))], [], /**/ undefined, "baz", /**/ undefined, /**/ undefined, [], /**/ undefined, ts.createBlock([])) + const classDecl = createClassDeclaration([], [], "Foo", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, [ + createMethod([createDecorator(createIdentifier("Bar"))], [], /**/ undefined, "baz", /**/ undefined, /**/ undefined, [], /**/ undefined, createBlock([])) ]); - return ts.updateSourceFileNode(sf, [classDecl]); + return updateSourceFileNode(sf, [classDecl]); } } }); diff --git a/src/harness/unittests/transpile.ts b/src/harness/unittests/transpile.ts index 7c4af8be167..7cf663bf06e 100644 --- a/src/harness/unittests/transpile.ts +++ b/src/harness/unittests/transpile.ts @@ -24,7 +24,7 @@ namespace ts { if (transpileOptions.compilerOptions.newLine === undefined) { // use \r\n as default new line - transpileOptions.compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed; + transpileOptions.compilerOptions.newLine = NewLineKind.CarriageReturnLineFeed; } transpileOptions.compilerOptions.sourceMap = true; @@ -85,7 +85,7 @@ namespace ts { } it("Correct output for " + justName, () => { - Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, ts.Extension.Js), () => { + Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, Extension.Js), () => { if (transpileResult.outputText) { return transpileResult.outputText; } diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 5f5d871304f..1c23eb04ea4 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -4,15 +4,15 @@ namespace ts.tscWatch { - import WatchedSystem = ts.TestFSWithWatch.TestServerHost; - type FileOrFolder = ts.TestFSWithWatch.FileOrFolder; - import createWatchedSystem = ts.TestFSWithWatch.createWatchedSystem; - import checkFileNames = ts.TestFSWithWatch.checkFileNames; - import libFile = ts.TestFSWithWatch.libFile; - import checkWatchedFiles = ts.TestFSWithWatch.checkWatchedFiles; - import checkWatchedDirectories = ts.TestFSWithWatch.checkWatchedDirectories; - import checkOutputContains = ts.TestFSWithWatch.checkOutputContains; - import checkOutputDoesNotContain = ts.TestFSWithWatch.checkOutputDoesNotContain; + import WatchedSystem = TestFSWithWatch.TestServerHost; + type FileOrFolder = TestFSWithWatch.FileOrFolder; + import createWatchedSystem = TestFSWithWatch.createWatchedSystem; + import checkFileNames = TestFSWithWatch.checkFileNames; + import libFile = TestFSWithWatch.libFile; + import checkWatchedFiles = TestFSWithWatch.checkWatchedFiles; + import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; + import checkOutputContains = TestFSWithWatch.checkOutputContains; + import checkOutputDoesNotContain = TestFSWithWatch.checkOutputDoesNotContain; export function checkProgramActualFiles(program: Program, expectedFiles: string[]) { checkFileNames(`Program actual files`, program.getSourceFiles().map(file => file.fileName), expectedFiles); @@ -23,7 +23,7 @@ namespace ts.tscWatch { } function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) { - const compilerHost = ts.createWatchCompilerHostOfConfigFile(configFileName, {}, host); + const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host); compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation; const watch = createWatchProgram(compilerHost); return () => watch.getCurrentProgram().getProgram(); @@ -111,7 +111,7 @@ namespace ts.tscWatch { }); if (!skipWaiting) { if (errorsPosition === ExpectedOutputErrorsPosition.BeforeCompilationStarts) { - assertWatchDiagnosticAt(host, index, ts.Diagnostics.Starting_compilation_in_watch_mode); + assertWatchDiagnosticAt(host, index, Diagnostics.Starting_compilation_in_watch_mode); index += 1; } assertWatchDiagnosticAt(host, index, Diagnostics.Compilation_complete_Watching_for_file_changes); diff --git a/src/harness/unittests/tsconfigParsing.ts b/src/harness/unittests/tsconfigParsing.ts index 8d56360bba5..cf2ef33866b 100644 --- a/src/harness/unittests/tsconfigParsing.ts +++ b/src/harness/unittests/tsconfigParsing.ts @@ -4,41 +4,41 @@ namespace ts { describe("parseConfigFileTextToJson", () => { function assertParseResult(jsonText: string, expectedConfigObject: { config?: any; error?: Diagnostic[] }) { - const parsed = ts.parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); + const parsed = parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); assert.equal(JSON.stringify(parsed), JSON.stringify(expectedConfigObject)); } function assertParseError(jsonText: string) { - const parsed = ts.parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); + const parsed = parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); assert.deepEqual(parsed.config, {}); assert.isTrue(undefined !== parsed.error); } function assertParseErrorWithExcludesKeyword(jsonText: string) { { - const parsed = ts.parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); - const parsedCommand = ts.parseJsonConfigFileContent(parsed.config, ts.sys, "tests/cases/unittests"); + const parsed = parseConfigFileTextToJson("/apath/tsconfig.json", jsonText); + const parsedCommand = parseJsonConfigFileContent(parsed.config, sys, "tests/cases/unittests"); assert.isTrue(parsedCommand.errors && parsedCommand.errors.length === 1 && - parsedCommand.errors[0].code === ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude.code); + parsedCommand.errors[0].code === Diagnostics.Unknown_option_excludes_Did_you_mean_exclude.code); } { - const parsed = ts.parseJsonText("/apath/tsconfig.json", jsonText); - const parsedCommand = ts.parseJsonSourceFileConfigFileContent(parsed, ts.sys, "tests/cases/unittests"); + const parsed = parseJsonText("/apath/tsconfig.json", jsonText); + const parsedCommand = parseJsonSourceFileConfigFileContent(parsed, sys, "tests/cases/unittests"); assert.isTrue(parsedCommand.errors && parsedCommand.errors.length === 1 && - parsedCommand.errors[0].code === ts.Diagnostics.Unknown_option_excludes_Did_you_mean_exclude.code); + parsedCommand.errors[0].code === Diagnostics.Unknown_option_excludes_Did_you_mean_exclude.code); } } function getParsedCommandJson(jsonText: string, configFileName: string, basePath: string, allFileList: string[]) { - const parsed = ts.parseConfigFileTextToJson(configFileName, jsonText); + const parsed = parseConfigFileTextToJson(configFileName, jsonText); const host: ParseConfigHost = new Utils.MockParseConfigHost(basePath, true, allFileList); - return ts.parseJsonConfigFileContent(parsed.config, host, basePath, /*existingOptions*/ undefined, configFileName); + return parseJsonConfigFileContent(parsed.config, host, basePath, /*existingOptions*/ undefined, configFileName); } function getParsedCommandJsonNode(jsonText: string, configFileName: string, basePath: string, allFileList: string[]) { - const parsed = ts.parseJsonText(configFileName, jsonText); + const parsed = parseJsonText(configFileName, jsonText); const host: ParseConfigHost = new Utils.MockParseConfigHost(basePath, true, allFileList); - return ts.parseJsonSourceFileConfigFileContent(parsed, host, basePath, /*existingOptions*/ undefined, configFileName); + return parseJsonSourceFileConfigFileContent(parsed, host, basePath, /*existingOptions*/ undefined, configFileName); } function assertParseFileList(jsonText: string, configFileName: string, basePath: string, allFileList: string[], expectedFileList: string[]) { diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index f596896aacb..10f958ff800 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -7,14 +7,14 @@ namespace ts.projectSystem { import protocol = server.protocol; import CommandNames = server.CommandNames; - export import TestServerHost = ts.TestFSWithWatch.TestServerHost; - export type FileOrFolder = ts.TestFSWithWatch.FileOrFolder; - export import createServerHost = ts.TestFSWithWatch.createServerHost; - export import checkFileNames = ts.TestFSWithWatch.checkFileNames; - export import libFile = ts.TestFSWithWatch.libFile; - export import checkWatchedFiles = ts.TestFSWithWatch.checkWatchedFiles; - import checkWatchedDirectories = ts.TestFSWithWatch.checkWatchedDirectories; - import safeList = ts.TestFSWithWatch.safeList; + export import TestServerHost = TestFSWithWatch.TestServerHost; + export type FileOrFolder = TestFSWithWatch.FileOrFolder; + export import createServerHost = TestFSWithWatch.createServerHost; + export import checkFileNames = TestFSWithWatch.checkFileNames; + export import libFile = TestFSWithWatch.libFile; + export import checkWatchedFiles = TestFSWithWatch.checkWatchedFiles; + import checkWatchedDirectories = TestFSWithWatch.checkWatchedDirectories; + import safeList = TestFSWithWatch.safeList; export const customTypesMap = { path: "/typesMap.json", @@ -167,8 +167,8 @@ namespace ts.projectSystem { private events: server.ProjectServiceEvent[] = []; readonly session: TestSession; readonly service: server.ProjectService; - readonly host: projectSystem.TestServerHost; - constructor(files: projectSystem.FileOrFolder[]) { + readonly host: TestServerHost; + constructor(files: FileOrFolder[]) { this.host = createServerHost(files); this.session = createSession(this.host, { canUseEvents: true, @@ -210,7 +210,7 @@ namespace ts.projectSystem { } assertProjectInfoTelemetryEvent(partial: Partial, configFile?: string): void { - assert.deepEqual(this.getEvent(ts.server.ProjectInfoTelemetryEvent), { + assert.deepEqual(this.getEvent(server.ProjectInfoTelemetryEvent), { projectId: Harness.mockHash(configFile || "/tsconfig.json"), fileStats: fileStats({ ts: 1 }), compilerOptions: {}, @@ -227,7 +227,7 @@ namespace ts.projectSystem { configFileName: "tsconfig.json", projectType: "configured", languageServiceEnabled: true, - version: ts.version, + version, ...partial, }); } @@ -474,15 +474,15 @@ namespace ts.projectSystem { } function checkErrorMessage(session: TestSession, eventName: protocol.DiagnosticEventKind, diagnostics: protocol.DiagnosticEventBody, isMostRecent = false): void { - checkNthEvent(session, ts.server.toEvent(eventName, diagnostics), 0, isMostRecent); + checkNthEvent(session, server.toEvent(eventName, diagnostics), 0, isMostRecent); } function checkCompleteEvent(session: TestSession, numberOfCurrentEvents: number, expectedSequenceId: number, isMostRecent = true): void { - checkNthEvent(session, ts.server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); + checkNthEvent(session, server.toEvent("requestCompleted", { request_seq: expectedSequenceId }), numberOfCurrentEvents - 1, isMostRecent); } function checkProjectUpdatedInBackgroundEvent(session: TestSession, openFiles: string[]) { - checkNthEvent(session, ts.server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); + checkNthEvent(session, server.toEvent("projectsUpdatedInBackground", { openFiles }), 0, /*isMostRecent*/ true); } function checkNthEvent(session: TestSession, expectedEvent: protocol.Event, index: number, isMostRecent: boolean) { @@ -4890,7 +4890,7 @@ namespace ts.projectSystem { command: server.CommandNames.CompilerOptionsDiagnosticsFull, seq: 2, arguments: { projectFileName } - }).response as ReadonlyArray; + }).response as ReadonlyArray; assert.isTrue(diags.length === 0); session.executeCommand({ @@ -4908,7 +4908,7 @@ namespace ts.projectSystem { command: server.CommandNames.CompilerOptionsDiagnosticsFull, seq: 4, arguments: { projectFileName } - }).response as ReadonlyArray; + }).response as ReadonlyArray; assert.isTrue(diagsAfterUpdate.length === 0); }); }); @@ -5072,7 +5072,7 @@ namespace ts.projectSystem { describe("tsserverProjectSystem cancellationToken", () => { // Disable sourcemap support for the duration of the test, as sourcemapping the errors generated during this test is slow and not something we care to test - let oldPrepare: ts.AnyFunction; + let oldPrepare: AnyFunction; before(() => { oldPrepare = (Error as any).prepareStackTrace; delete (Error as any).prepareStackTrace; @@ -5623,7 +5623,7 @@ namespace ts.projectSystem { function verifyCalledOnEachEntry(callback: CalledMaps, expectedKeys: Map) { const calledMap = calledMaps[callback]; - ts.TestFSWithWatch.verifyMapSize(callback, calledMap, arrayFrom(expectedKeys.keys())); + TestFSWithWatch.verifyMapSize(callback, calledMap, arrayFrom(expectedKeys.keys())); expectedKeys.forEach((called, name) => { assert.isTrue(calledMap.has(name), `${callback} is expected to contain ${name}, actual keys: ${arrayFrom(calledMap.keys())}`); assert.equal(calledMap.get(name).length, called, `${callback} is expected to be called ${called} times with ${name}. Actual entry: ${calledMap.get(name)}`); @@ -5674,7 +5674,7 @@ namespace ts.projectSystem { const host = createServerHost([root, imported]); const projectService = createProjectService(host); - projectService.setCompilerOptionsForInferredProjects({ module: ts.ModuleKind.AMD, noLib: true }); + projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true }); projectService.openClientFile(root.path); checkNumberOfProjects(projectService, { inferredProjects: 1 }); const project = projectService.inferredProjects[0]; @@ -5720,7 +5720,7 @@ namespace ts.projectSystem { // setting compiler options discards module resolution cache callsTrackingHost.clear(); - projectService.setCompilerOptionsForInferredProjects({ module: ts.ModuleKind.AMD, noLib: true, target: ts.ScriptTarget.ES5 }); + projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true, target: ScriptTarget.ES5 }); verifyImportedDiagnostics(); vertifyF1Lookups(); @@ -5790,7 +5790,7 @@ namespace ts.projectSystem { const host = createServerHost([root]); const projectService = createProjectService(host); - projectService.setCompilerOptionsForInferredProjects({ module: ts.ModuleKind.AMD, noLib: true }); + projectService.setCompilerOptionsForInferredProjects({ module: ModuleKind.AMD, noLib: true }); const callsTrackingHost = createCallsTrackingHost(host); projectService.openClientFile(root.path); checkNumberOfProjects(projectService, { inferredProjects: 1 }); @@ -6754,7 +6754,7 @@ namespace ts.projectSystem { const events: protocol.ProjectsUpdatedInBackgroundEvent[] = filter( map( host.getOutput(), s => convertToObject( - ts.parseJsonText("json.json", s.replace(outputEventRegex, "")), + parseJsonText("json.json", s.replace(outputEventRegex, "")), [] ) ), diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index b5265c5e5f2..0a27f860352 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1387,7 +1387,7 @@ namespace ts.projectSystem { node: { typingLocation: node.path, version: Semver.parse("1.0.0") } }); const registry = createTypesRegistry("node"); - registry.delete(`ts${ts.versionMajorMinor}`); + registry.delete(`ts${versionMajorMinor}`); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http"], registry); assert.deepEqual(logger.finish(), [ @@ -1419,7 +1419,7 @@ namespace ts.projectSystem { commander: { typingLocation: commander.path, version: Semver.parse("1.3.0-next.0") } }); const registry = createTypesRegistry("node", "commander"); - registry.get("node")[`ts${ts.versionMajorMinor}`] = "1.3.0-next.1"; + registry.get("node")[`ts${versionMajorMinor}`] = "1.3.0-next.1"; const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, ["http", "commander"], registry); assert.deepEqual(logger.finish(), [ diff --git a/src/harness/unittests/versionCache.ts b/src/harness/unittests/versionCache.ts index 3062a55170c..f688a9e56bb 100644 --- a/src/harness/unittests/versionCache.ts +++ b/src/harness/unittests/versionCache.ts @@ -302,7 +302,7 @@ and grew 1cm per day`; it("Line/offset from pos", () => { for (let i = 0; i < iterationCount; i++) { const lp = lineIndex.positionToLineOffset(rsa[i]); - const lac = ts.computeLineAndCharacterOfPosition(lineMap, rsa[i]); + const lac = computeLineAndCharacterOfPosition(lineMap, rsa[i]); assert.equal(lac.line + 1, lp.line, "Line number mismatch " + (lac.line + 1) + " " + lp.line + " " + i); assert.equal(lac.character, lp.offset - 1, "Character offset mismatch " + lac.character + " " + (lp.offset - 1) + " " + i); } diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 54a353a59c6..d518ce5e2c4 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -624,7 +624,7 @@ interface Array {}` } readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[] { - return ts.matchFiles(path, extensions, exclude, include, this.useCaseSensitiveFileNames, this.getCurrentDirectory(), depth, (dir) => { + return matchFiles(path, extensions, exclude, include, this.useCaseSensitiveFileNames, this.getCurrentDirectory(), depth, (dir) => { const directories: string[] = []; const files: string[] = []; const folder = this.getRealFolder(this.toPath(dir)); diff --git a/src/server/client.ts b/src/server/client.ts index 6f04f141957..f4e70cae59e 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -71,7 +71,7 @@ namespace ts.server { }; } - private convertCodeEditsToTextChange(fileName: string, codeEdit: protocol.CodeEdit): ts.TextChange { + private convertCodeEditsToTextChange(fileName: string, codeEdit: protocol.CodeEdit): TextChange { return { span: this.decodeSpan(codeEdit, fileName), newText: codeEdit.newText }; } @@ -229,7 +229,7 @@ namespace ts.server { })); } - getFormattingEditsForRange(file: string, start: number, end: number, _options: FormatCodeOptions): ts.TextChange[] { + getFormattingEditsForRange(file: string, start: number, end: number, _options: FormatCodeOptions): TextChange[] { const args: protocol.FormatRequestArgs = this.createFileLocationRequestArgsWithEndLineAndOffset(file, start, end); @@ -240,11 +240,11 @@ namespace ts.server { return response.body.map(entry => this.convertCodeEditsToTextChange(file, entry)); } - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): ts.TextChange[] { + getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[] { return this.getFormattingEditsForRange(fileName, 0, this.host.getScriptSnapshot(fileName).getLength(), options); } - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, _options: FormatCodeOptions): ts.TextChange[] { + getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, _options: FormatCodeOptions): TextChange[] { const args: protocol.FormatOnKeyRequestArgs = { ...this.createFileLocationRequestArgs(fileName, position), key }; // TODO: handle FormatCodeOptions @@ -640,7 +640,7 @@ namespace ts.server { })); } - convertTextChangeToCodeEdit(change: protocol.CodeEdit, fileName: string): ts.TextChange { + convertTextChangeToCodeEdit(change: protocol.CodeEdit, fileName: string): TextChange { return { span: this.decodeSpan(change, fileName), newText: change.newText ? change.newText : "" diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index c525d5a3bc8..6c493bd35a1 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -448,19 +448,19 @@ namespace ts.server { this.documentRegistry = createDocumentRegistry(this.host.useCaseSensitiveFileNames, this.currentDirectory); if (this.logger.hasLevel(LogLevel.verbose)) { - this.watchFile = (host, file, cb, watchType, project) => ts.addFileWatcherWithLogging(host, file, cb, this.createWatcherLog(watchType, project)); - this.watchFilePath = (host, file, cb, path, watchType, project) => ts.addFilePathWatcherWithLogging(host, file, cb, path, this.createWatcherLog(watchType, project)); - this.watchDirectory = (host, dir, cb, flags, watchType, project) => ts.addDirectoryWatcherWithLogging(host, dir, cb, flags, this.createWatcherLog(watchType, project)); + this.watchFile = (host, file, cb, watchType, project) => addFileWatcherWithLogging(host, file, cb, this.createWatcherLog(watchType, project)); + this.watchFilePath = (host, file, cb, path, watchType, project) => addFilePathWatcherWithLogging(host, file, cb, path, this.createWatcherLog(watchType, project)); + this.watchDirectory = (host, dir, cb, flags, watchType, project) => addDirectoryWatcherWithLogging(host, dir, cb, flags, this.createWatcherLog(watchType, project)); } else if (this.logger.loggingEnabled()) { - this.watchFile = (host, file, cb, watchType, project) => ts.addFileWatcherWithOnlyTriggerLogging(host, file, cb, this.createWatcherLog(watchType, project)); - this.watchFilePath = (host, file, cb, path, watchType, project) => ts.addFilePathWatcherWithOnlyTriggerLogging(host, file, cb, path, this.createWatcherLog(watchType, project)); - this.watchDirectory = (host, dir, cb, flags, watchType, project) => ts.addDirectoryWatcherWithOnlyTriggerLogging(host, dir, cb, flags, this.createWatcherLog(watchType, project)); + this.watchFile = (host, file, cb, watchType, project) => addFileWatcherWithOnlyTriggerLogging(host, file, cb, this.createWatcherLog(watchType, project)); + this.watchFilePath = (host, file, cb, path, watchType, project) => addFilePathWatcherWithOnlyTriggerLogging(host, file, cb, path, this.createWatcherLog(watchType, project)); + this.watchDirectory = (host, dir, cb, flags, watchType, project) => addDirectoryWatcherWithOnlyTriggerLogging(host, dir, cb, flags, this.createWatcherLog(watchType, project)); } else { - this.watchFile = ts.addFileWatcher; - this.watchFilePath = ts.addFilePathWatcher; - this.watchDirectory = ts.addDirectoryWatcher; + this.watchFile = addFileWatcher; + this.watchFilePath = addFilePathWatcher; + this.watchDirectory = addDirectoryWatcher; } } @@ -1412,7 +1412,7 @@ namespace ts.server { return project; } - private sendProjectTelemetry(projectKey: string, project: server.ExternalProject | server.ConfiguredProject, projectOptions?: ProjectOptions): void { + private sendProjectTelemetry(projectKey: string, project: ExternalProject | ConfiguredProject, projectOptions?: ProjectOptions): void { if (this.seenProjects.has(projectKey)) { return; } @@ -1433,18 +1433,18 @@ namespace ts.server { exclude: projectOptions && projectOptions.configHasExcludeProperty, compileOnSave: project.compileOnSaveEnabled, configFileName: configFileName(), - projectType: project instanceof server.ExternalProject ? "external" : "configured", + projectType: project instanceof ExternalProject ? "external" : "configured", languageServiceEnabled: project.languageServiceEnabled, version, }; this.eventHandler({ eventName: ProjectInfoTelemetryEvent, data }); function configFileName(): ProjectInfoTelemetryEventData["configFileName"] { - if (!(project instanceof server.ConfiguredProject)) { + if (!(project instanceof ConfiguredProject)) { return "other"; } - const configFilePath = project instanceof server.ConfiguredProject && project.getConfigFilePath(); + const configFilePath = project instanceof ConfiguredProject && project.getConfigFilePath(); return getBaseConfigFileName(configFilePath) || "other"; } @@ -2256,7 +2256,7 @@ namespace ts.server { } const excludeRegexes = excludeRules.map(e => new RegExp(e, "i")); - const filesToKeep: ts.server.protocol.ExternalFile[] = []; + const filesToKeep: protocol.ExternalFile[] = []; for (let i = 0; i < proj.rootFiles.length; i++) { if (excludeRegexes.some(re => re.test(normalizedNames[i]))) { excludedFiles.push(normalizedNames[i]); diff --git a/src/server/project.ts b/src/server/project.ts index bfd039f26fb..e155466a10e 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -860,7 +860,7 @@ namespace ts.server { } protected removeExistingTypings(include: string[]): string[] { - const existing = ts.getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost); + const existing = getAutomaticTypeDirectiveNames(this.getCompilerOptions(), this.directoryStructureHost); return include.filter(i => existing.indexOf(i) < 0); } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 40bee65e9f0..ea312196d0b 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -1,3 +1,5 @@ +// tslint:disable no-unnecessary-qualifier + /** * Declaration module describing the TypeScript Server protocol */ diff --git a/src/server/server.ts b/src/server/server.ts index 7f545ff3875..f70280c34a3 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -142,7 +142,7 @@ namespace ts.server { terminal: false, }); - class Logger implements server.Logger { + class Logger implements server.Logger { // tslint:disable-line no-unnecessary-qualifier private fd = -1; private seq = 0; private inGroup = false; @@ -266,7 +266,7 @@ namespace ts.server { constructor( private readonly telemetryEnabled: boolean, - private readonly logger: server.Logger, + private readonly logger: Logger, private readonly host: ServerHost, readonly globalTypingsCacheLocation: string, readonly typingSafeListLocation: string, @@ -391,7 +391,7 @@ namespace ts.server { switch (response.kind) { case EventTypesRegistry: - this.typesRegistryCache = ts.createMapFromTemplate(response.typesRegistry); + this.typesRegistryCache = createMapFromTemplate(response.typesRegistry); break; case ActionPackageInstalled: { const { success, message } = response; diff --git a/src/server/session.ts b/src/server/session.ts index 4f0981a3880..92b0c2ad02b 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -105,7 +105,7 @@ namespace ts.server { project: Project; } - function allEditsBeforePos(edits: ts.TextChange[], pos: number) { + function allEditsBeforePos(edits: TextChange[], pos: number) { for (const edit of edits) { if (textSpanEnd(edit.span) >= pos) { return false; @@ -122,7 +122,7 @@ namespace ts.server { export type CommandNames = protocol.CommandTypes; export const CommandNames = (protocol).CommandTypes; // tslint:disable-line variable-name - export function formatMessage(msg: T, logger: server.Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string { + export function formatMessage(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string { const verboseLogging = logger.hasLevel(LogLevel.verbose); const json = JSON.stringify(msg); @@ -1713,7 +1713,7 @@ namespace ts.server { }; } - private convertTextChangeToCodeEdit(change: ts.TextChange, scriptInfo: ScriptInfo): protocol.CodeEdit { + private convertTextChangeToCodeEdit(change: TextChange, scriptInfo: ScriptInfo): protocol.CodeEdit { return { start: scriptInfo.positionToLineOffset(change.span.start), end: scriptInfo.positionToLineOffset(change.span.start + change.span.length), diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index b0844b2369c..018dac7ec10 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -221,11 +221,11 @@ namespace ts.server.typingsInstaller { }); } - const logFilePath = findArgument(server.Arguments.LogFile); - const globalTypingsCacheLocation = findArgument(server.Arguments.GlobalCacheLocation); - const typingSafeListLocation = findArgument(server.Arguments.TypingSafeListLocation); - const typesMapLocation = findArgument(server.Arguments.TypesMapLocation); - const npmLocation = findArgument(server.Arguments.NpmLocation); + const logFilePath = findArgument(Arguments.LogFile); + const globalTypingsCacheLocation = findArgument(Arguments.GlobalCacheLocation); + const typingSafeListLocation = findArgument(Arguments.TypingSafeListLocation); + const typesMapLocation = findArgument(Arguments.TypesMapLocation); + const npmLocation = findArgument(Arguments.NpmLocation); const log = new FileLog(logFilePath); if (log.isEnabled()) { diff --git a/src/server/typingsInstaller/typingsInstaller.ts b/src/server/typingsInstaller/typingsInstaller.ts index 059967ecb4d..80c1c7be6ea 100644 --- a/src/server/typingsInstaller/typingsInstaller.ts +++ b/src/server/typingsInstaller/typingsInstaller.ts @@ -277,7 +277,7 @@ namespace ts.server.typingsInstaller { this.sendResponse({ kind: EventBeginInstallTypes, eventId: requestId, - typingsInstallerVersion: ts.version, // qualified explicitly to prevent occasional shadowing + typingsInstallerVersion: ts.version, // tslint:disable-line no-unnecessary-qualifier (qualified explicitly to prevent occasional shadowing) projectName: req.projectName }); @@ -308,7 +308,7 @@ namespace ts.server.typingsInstaller { // packageName is guaranteed to exist in typesRegistry by filterTypings const distTags = this.typesRegistry.get(packageName); - const newVersion = Semver.parse(distTags[`ts${ts.versionMajorMinor}`] || distTags[latestDistTag]); + const newVersion = Semver.parse(distTags[`ts${versionMajorMinor}`] || distTags[latestDistTag]); const newTyping: JsTyping.CachedTyping = { typingLocation: typingFile, version: newVersion }; this.packageNameToTypingLocation.set(packageName, newTyping); installedTypingFiles.push(typingFile); @@ -326,7 +326,7 @@ namespace ts.server.typingsInstaller { projectName: req.projectName, packagesToInstall: scopedTypings, installSuccess: ok, - typingsInstallerVersion: ts.version // qualified explicitly to prevent occasional shadowing + typingsInstallerVersion: ts.version // tslint:disable-line no-unnecessary-qualifier (qualified explicitly to prevent occasional shadowing) }; this.sendResponse(response); } @@ -359,7 +359,7 @@ namespace ts.server.typingsInstaller { this.log.writeLine(`Got FS notification for ${f}, handler is already invoked '${isInvoked}'`); } if (!isInvoked) { - this.sendResponse({ projectName, kind: server.ActionInvalidate }); + this.sendResponse({ projectName, kind: ActionInvalidate }); isInvoked = true; } }, /*pollingInterval*/ 2000); diff --git a/src/services/classifier.ts b/src/services/classifier.ts index aff626ca9fe..4a8721154cb 100644 --- a/src/services/classifier.ts +++ b/src/services/classifier.ts @@ -178,7 +178,7 @@ namespace ts { /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where /// we have a series of divide operator. this list allows us to be more accurate by ruling out /// locations where a regexp cannot exist. - const noRegexTable: true[] = ts.arrayToNumericMap([ + const noRegexTable: true[] = arrayToNumericMap([ SyntaxKind.Identifier, SyntaxKind.StringLiteral, SyntaxKind.NumericLiteral, diff --git a/src/services/codefixes/convertToEs6Module.ts b/src/services/codefixes/convertToEs6Module.ts index d494e5c907f..2ce8430e8b4 100644 --- a/src/services/codefixes/convertToEs6Module.ts +++ b/src/services/codefixes/convertToEs6Module.ts @@ -18,7 +18,7 @@ namespace ts.codefix { }, }); - function fixImportOfModuleExports(importingFile: ts.SourceFile, exportingFile: ts.SourceFile, changes: textChanges.ChangeTracker) { + function fixImportOfModuleExports(importingFile: SourceFile, exportingFile: SourceFile, changes: textChanges.ChangeTracker) { for (const moduleSpecifier of importingFile.imports) { const imported = getResolvedModule(importingFile, moduleSpecifier.text); if (!imported || imported.resolvedFileName !== exportingFile.fileName) { @@ -365,7 +365,7 @@ namespace ts.codefix { import x from "x"; const [a, b, c] = x; */ - const tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); + const tmp = makeUniqueName(moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); return [ makeImport(createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), makeConst(/*modifiers*/ undefined, getSynthesizedDeepClone(name), createIdentifier(tmp)), diff --git a/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts b/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts index 551662210c1..9b775bef622 100644 --- a/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts +++ b/src/services/codefixes/fixExtendsInterfaceBecomesImplements.ts @@ -42,7 +42,7 @@ namespace ts.codefix { // (Trailing because leading might be indentation, which is more sensitive.) const text = sourceFile.text; let end = implementsToken.end; - while (end < text.length && ts.isWhiteSpaceSingleLine(text.charCodeAt(end))) { + while (end < text.length && isWhiteSpaceSingleLine(text.charCodeAt(end))) { end++; } diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index 74a2aba76bb..4c43d323848 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -88,11 +88,11 @@ namespace ts.codefix { sourceFile: SourceFile, symbolName: string, host: LanguageServiceHost, - program: ts.Program, - checker: ts.TypeChecker, - compilerOptions: ts.CompilerOptions, - allSourceFiles: ReadonlyArray, - formatContext: ts.formatting.FormatContext, + program: Program, + checker: TypeChecker, + compilerOptions: CompilerOptions, + allSourceFiles: ReadonlyArray, + formatContext: formatting.FormatContext, getCanonicalFileName: GetCanonicalFileName, symbolToken: Node | undefined, ): { readonly moduleSpecifier: string, readonly codeAction: CodeAction } { diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index e17c5183611..dd47f96e62a 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -310,13 +310,13 @@ namespace ts.codefix { const callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; return callContexts && declaration.parameters.map((parameter, parameterIndex) => { const types: Type[] = []; - const isRestParameter = ts.isRestParameter(parameter); + const isRest = isRestParameter(parameter); for (const callContext of callContexts) { if (callContext.argumentTypes.length <= parameterIndex) { continue; } - if (isRestParameter) { + if (isRest) { for (let i = parameterIndex; i < callContext.argumentTypes.length; i++) { types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); } @@ -329,7 +329,7 @@ namespace ts.codefix { return undefined; } const type = checker.getWidenedType(checker.getUnionType(types, UnionReduction.Subtype)); - return isRestParameter ? checker.createArrayType(type) : type; + return isRest ? checker.createArrayType(type) : type; }); } diff --git a/src/services/completions.ts b/src/services/completions.ts index 640cb5bedf3..9470381bd24 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -673,11 +673,11 @@ namespace ts.Completions { return getContextualTypeFromParent(currentToken as Identifier, checker); case SyntaxKind.EqualsToken: switch (parent.kind) { - case ts.SyntaxKind.VariableDeclaration: + case SyntaxKind.VariableDeclaration: return checker.getContextualType((parent as VariableDeclaration).initializer); - case ts.SyntaxKind.BinaryExpression: + case SyntaxKind.BinaryExpression: return checker.getTypeAtLocation((parent as BinaryExpression).left); - case ts.SyntaxKind.JsxAttribute: + case SyntaxKind.JsxAttribute: return checker.getContextualTypeForJsxAttribute(parent as JsxAttribute); default: return undefined; @@ -700,25 +700,25 @@ namespace ts.Completions { } } - function getContextualTypeFromParent(node: ts.Expression, checker: ts.TypeChecker): Type | undefined { + function getContextualTypeFromParent(node: Expression, checker: TypeChecker): Type | undefined { const { parent } = node; switch (parent.kind) { - case ts.SyntaxKind.NewExpression: - return checker.getContextualType(parent as ts.NewExpression); - case ts.SyntaxKind.BinaryExpression: { - const { left, operatorToken, right } = parent as ts.BinaryExpression; + case SyntaxKind.NewExpression: + return checker.getContextualType(parent as NewExpression); + case SyntaxKind.BinaryExpression: { + const { left, operatorToken, right } = parent as BinaryExpression; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case ts.SyntaxKind.CaseClause: - return (parent as ts.CaseClause).expression === node ? getSwitchedType(parent as ts.CaseClause, checker) : undefined; + case SyntaxKind.CaseClause: + return (parent as CaseClause).expression === node ? getSwitchedType(parent as CaseClause, checker) : undefined; default: return checker.getContextualType(node); } } - function getSwitchedType(caseClause: ts.CaseClause, checker: ts.TypeChecker): ts.Type { + function getSwitchedType(caseClause: CaseClause, checker: TypeChecker): Type { return checker.getTypeAtLocation(caseClause.parent.parent.expression); } @@ -2140,7 +2140,7 @@ namespace ts.Completions { // A cache of completion entries for keywords, these do not change between sessions const _keywordCompletions: ReadonlyArray[] = []; - const allKeywordsCompletions: () => ReadonlyArray = ts.memoize(() => { + const allKeywordsCompletions: () => ReadonlyArray = memoize(() => { const res: CompletionEntry[] = []; for (let i = SyntaxKind.FirstKeyword; i <= SyntaxKind.LastKeyword; i++) { res.push({ @@ -2224,12 +2224,12 @@ namespace ts.Completions { return true; } - function isEqualityOperatorKind(kind: ts.SyntaxKind): kind is EqualityOperator { + function isEqualityOperatorKind(kind: SyntaxKind): kind is EqualityOperator { switch (kind) { - case ts.SyntaxKind.EqualsEqualsEqualsToken: - case ts.SyntaxKind.EqualsEqualsToken: - case ts.SyntaxKind.ExclamationEqualsEqualsToken: - case ts.SyntaxKind.ExclamationEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: return true; default: return false; diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index b917c426b7d..ee4f44d31db 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -10,9 +10,9 @@ namespace ts.FindAllReferences { export type Definition = | { type: "symbol"; symbol: Symbol } | { type: "label"; node: Identifier } - | { type: "keyword"; node: ts.Node } - | { type: "this"; node: ts.Node } - | { type: "string"; node: ts.StringLiteral }; + | { type: "keyword"; node: Node } + | { type: "this"; node: Node } + | { type: "string"; node: StringLiteral }; export type Entry = NodeEntry | SpanEntry; export interface NodeEntry { @@ -25,7 +25,7 @@ namespace ts.FindAllReferences { fileName: string; textSpan: TextSpan; } - export function nodeEntry(node: ts.Node, isInString?: true): NodeEntry { + export function nodeEntry(node: Node, isInString?: true): NodeEntry { return { type: "node", node, isInString }; } @@ -168,7 +168,7 @@ namespace ts.FindAllReferences { }; } - function toImplementationLocation(entry: Entry, checker: ts.TypeChecker): ImplementationLocation { + function toImplementationLocation(entry: Entry, checker: TypeChecker): ImplementationLocation { if (entry.type === "node") { const { node } = entry; return { textSpan: getTextSpan(node), fileName: node.getSourceFile().fileName, ...implementationKindDisplayParts(node, checker) }; @@ -179,7 +179,7 @@ namespace ts.FindAllReferences { } } - function implementationKindDisplayParts(node: ts.Node, checker: ts.TypeChecker): { kind: ScriptElementKind, displayParts: SymbolDisplayPart[] } { + function implementationKindDisplayParts(node: Node, checker: TypeChecker): { kind: ScriptElementKind, displayParts: SymbolDisplayPart[] } { const symbol = checker.getSymbolAtLocation(isDeclaration(node) && node.name ? node.name : node); if (symbol) { return getDefinitionKindAndDisplayParts(symbol, checker, node); @@ -201,7 +201,7 @@ namespace ts.FindAllReferences { } } - export function toHighlightSpan(entry: FindAllReferences.Entry): { fileName: string, span: HighlightSpan } { + export function toHighlightSpan(entry: Entry): { fileName: string, span: HighlightSpan } { if (entry.type === "span") { const { fileName, textSpan } = entry; return { fileName, span: { textSpan, kind: HighlightSpanKind.reference } }; @@ -267,7 +267,7 @@ namespace ts.FindAllReferences.Core { return getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options); } - function isModuleReferenceLocation(node: ts.Node): boolean { + function isModuleReferenceLocation(node: Node): boolean { if (!isStringLiteralLike(node)) { return false; } @@ -302,11 +302,11 @@ namespace ts.FindAllReferences.Core { for (const decl of symbol.declarations) { switch (decl.kind) { - case ts.SyntaxKind.SourceFile: + case SyntaxKind.SourceFile: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case ts.SyntaxKind.ModuleDeclaration: - references.push({ type: "node", node: (decl as ts.ModuleDeclaration).name }); + case SyntaxKind.ModuleDeclaration: + references.push({ type: "node", node: (decl as ModuleDeclaration).name }); break; default: Debug.fail("Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); @@ -787,7 +787,7 @@ namespace ts.FindAllReferences.Core { } } - function getAllReferencesForKeyword(sourceFiles: ReadonlyArray, keywordKind: ts.SyntaxKind, cancellationToken: CancellationToken): SymbolAndEntries[] { + function getAllReferencesForKeyword(sourceFiles: ReadonlyArray, keywordKind: SyntaxKind, cancellationToken: CancellationToken): SymbolAndEntries[] { const references = flatMap(sourceFiles, sourceFile => { cancellationToken.throwIfCancellationRequested(); return mapDefined(getPossibleSymbolReferencePositions(sourceFile, tokenToString(keywordKind), sourceFile), position => { @@ -798,7 +798,7 @@ namespace ts.FindAllReferences.Core { return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references }] : undefined; } - function getReferencesInSourceFile(sourceFile: ts.SourceFile, search: Search, state: State): void { + function getReferencesInSourceFile(sourceFile: SourceFile, search: Search, state: State): void { state.cancellationToken.throwIfCancellationRequested(); return getReferencesInContainer(sourceFile, sourceFile, search, state); } @@ -808,7 +808,7 @@ namespace ts.FindAllReferences.Core { * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). * searchLocation: a node where the search value */ - function getReferencesInContainer(container: Node, sourceFile: ts.SourceFile, search: Search, state: State): void { + function getReferencesInContainer(container: Node, sourceFile: SourceFile, search: Search, state: State): void { if (!state.markSearchedSymbol(sourceFile, search.symbol)) { return; } @@ -910,7 +910,7 @@ namespace ts.FindAllReferences.Core { // For `export { foo as bar }`, rename `foo`, but not `bar`. if (!(referenceLocation === propertyName && state.options.isForRename)) { - const exportKind = referenceLocation.originalKeywordKind === ts.SyntaxKind.DefaultKeyword ? ExportKind.Default : ExportKind.Named; + const exportKind = referenceLocation.originalKeywordKind === SyntaxKind.DefaultKeyword ? ExportKind.Default : ExportKind.Named; const exportInfo = getExportInfo(referenceSymbol, exportKind, state.checker); Debug.assert(!!exportInfo); searchForImportsOfExport(referenceLocation, referenceSymbol, exportInfo, state); @@ -1043,7 +1043,7 @@ namespace ts.FindAllReferences.Core { */ function findOwnConstructorReferences(classSymbol: Symbol, sourceFile: SourceFile, addNode: (node: Node) => void): void { for (const decl of classSymbol.members.get(InternalSymbolName.Constructor).declarations) { - const ctrKeyword = findChildOfKind(decl, ts.SyntaxKind.ConstructorKeyword, sourceFile)!; + const ctrKeyword = findChildOfKind(decl, SyntaxKind.ConstructorKeyword, sourceFile)!; Debug.assert(decl.kind === SyntaxKind.Constructor && !!ctrKeyword); addNode(ctrKeyword); } diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 3ed602d17fb..967015a88c1 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -6,8 +6,8 @@ /* @internal */ namespace ts.formatting { export interface FormatContext { - readonly options: ts.FormatCodeSettings; - readonly getRule: ts.formatting.RulesMap; + readonly options: FormatCodeSettings; + readonly getRule: RulesMap; } export interface TextRangeWithKind extends TextRange { diff --git a/src/services/formatting/formattingContext.ts b/src/services/formatting/formattingContext.ts index 2ba987e4af3..036cc64c98e 100644 --- a/src/services/formatting/formattingContext.ts +++ b/src/services/formatting/formattingContext.ts @@ -22,7 +22,7 @@ namespace ts.formatting { private contextNodeBlockIsOnOneLine: boolean; private nextNodeBlockIsOnOneLine: boolean; - constructor(public readonly sourceFile: SourceFileLike, public formattingRequestKind: FormattingRequestKind, public options: ts.FormatCodeSettings) { + constructor(public readonly sourceFile: SourceFileLike, public formattingRequestKind: FormattingRequestKind, public options: FormatCodeSettings) { } public updateContext(currentRange: TextRangeWithKind, currentTokenParent: Node, nextRange: TextRangeWithKind, nextTokenParent: Node, commonParent: Node) { diff --git a/src/services/formatting/rulesMap.ts b/src/services/formatting/rulesMap.ts index d44e47a763a..75cc68cb268 100644 --- a/src/services/formatting/rulesMap.ts +++ b/src/services/formatting/rulesMap.ts @@ -2,7 +2,7 @@ /* @internal */ namespace ts.formatting { - export function getFormatContext(options: FormatCodeSettings): formatting.FormatContext { + export function getFormatContext(options: FormatCodeSettings): FormatContext { return { options, getRule: getRulesMap() }; } diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index b8574ba89c1..7904db0969f 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -102,7 +102,7 @@ namespace ts.formatting { current--; } - const lineStart = ts.getLineStartPositionForPosition(current, sourceFile); + const lineStart = getLineStartPositionForPosition(current, sourceFile); return findFirstNonWhitespaceColumn(lineStart, current, sourceFile, options); } diff --git a/src/services/goToDefinition.ts b/src/services/goToDefinition.ts index cf51e8f93cd..08478344428 100644 --- a/src/services/goToDefinition.ts +++ b/src/services/goToDefinition.ts @@ -212,11 +212,11 @@ namespace ts.GoToDefinition { function isSignatureDeclaration(node: Node): boolean { switch (node.kind) { - case ts.SyntaxKind.Constructor: - case ts.SyntaxKind.ConstructSignature: - case ts.SyntaxKind.FunctionDeclaration: - case ts.SyntaxKind.MethodDeclaration: - case ts.SyntaxKind.MethodSignature: + case SyntaxKind.Constructor: + case SyntaxKind.ConstructSignature: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.MethodSignature: return true; default: return false; diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index beecafe0e81..9f61b4ea69d 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -86,7 +86,7 @@ namespace ts.FindAllReferences { if (!isAvailableThroughGlobal) { const parent = direct.parent!; if (exportKind === ExportKind.ExportEquals && parent.kind === SyntaxKind.VariableDeclaration) { - const { name } = parent as ts.VariableDeclaration; + const { name } = parent as VariableDeclaration; if (name.kind === SyntaxKind.Identifier) { directImports.push(name); break; @@ -209,7 +209,7 @@ namespace ts.FindAllReferences { return; } - if (decl.kind === ts.SyntaxKind.Identifier) { + if (decl.kind === SyntaxKind.Identifier) { handleNamespaceImportLike(decl); return; } @@ -329,7 +329,7 @@ namespace ts.FindAllReferences { const checker = program.getTypeChecker(); for (const referencingFile of sourceFiles) { const searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === ts.SyntaxKind.SourceFile) { + if (searchSourceFile.kind === SyntaxKind.SourceFile) { for (const ref of referencingFile.referencedFiles) { if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { refs.push({ kind: "reference", referencingFile, ref }); @@ -337,7 +337,7 @@ namespace ts.FindAllReferences { } for (const ref of referencingFile.typeReferenceDirectives) { const referenced = program.getResolvedTypeReferenceDirectives().get(ref.fileName); - if (referenced !== undefined && referenced.resolvedFileName === (searchSourceFile as ts.SourceFile).fileName) { + if (referenced !== undefined && referenced.resolvedFileName === (searchSourceFile as SourceFile).fileName) { refs.push({ kind: "reference", referencingFile, ref }); } } @@ -503,7 +503,7 @@ namespace ts.FindAllReferences { return { kind: ImportExport.Export, symbol, exportInfo: { exportingModuleSymbol, exportKind } }; } - function getSpecialPropertyExport(node: ts.BinaryExpression, useLhsSymbol: boolean): ExportedSymbol | undefined { + function getSpecialPropertyExport(node: BinaryExpression, useLhsSymbol: boolean): ExportedSymbol | undefined { let kind: ExportKind; switch (getSpecialPropertyAssignmentKind(node)) { case SpecialPropertyAssignmentKind.ExportsProperty: @@ -579,9 +579,9 @@ namespace ts.FindAllReferences { // If a reference is a variable declaration, the exported node would be the variable statement. function getExportNode(parent: Node, node: Node): Node | undefined { if (parent.kind === SyntaxKind.VariableDeclaration) { - const p = parent as ts.VariableDeclaration; + const p = parent as VariableDeclaration; return p.name !== node ? undefined : - p.parent.kind === ts.SyntaxKind.CatchClause ? undefined : p.parent.parent.kind === SyntaxKind.VariableStatement ? p.parent.parent : undefined; + p.parent.kind === SyntaxKind.CatchClause ? undefined : p.parent.parent.kind === SyntaxKind.VariableStatement ? p.parent.parent : undefined; } else { return parent; diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts index cf3c9606fb4..4033f40f76c 100644 --- a/src/services/jsDoc.ts +++ b/src/services/jsDoc.ts @@ -139,7 +139,7 @@ namespace ts.JsDoc { } export function getJSDocTagNameCompletions(): CompletionEntry[] { - return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = ts.map(jsDocTagNames, tagName => { + return jsDocTagNameCompletionEntries || (jsDocTagNameCompletionEntries = map(jsDocTagNames, tagName => { return { name: tagName, kind: ScriptElementKind.keyword, @@ -152,7 +152,7 @@ namespace ts.JsDoc { export const getJSDocTagNameCompletionDetails = getJSDocTagCompletionDetails; export function getJSDocTagCompletions(): CompletionEntry[] { - return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, tagName => { + return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = map(jsDocTagNames, tagName => { return { name: `@${tagName}`, kind: ScriptElementKind.keyword, @@ -181,7 +181,7 @@ namespace ts.JsDoc { const nameThusFar = tag.name.text; const jsdoc = tag.parent; const fn = jsdoc.parent; - if (!ts.isFunctionLike(fn)) return []; + if (!isFunctionLike(fn)) return []; return mapDefined(fn.parameters, param => { if (!isIdentifier(param.name)) return undefined; @@ -338,7 +338,7 @@ namespace ts.JsDoc { case SyntaxKind.BinaryExpression: { const be = commentOwner as BinaryExpression; - if (getSpecialPropertyAssignmentKind(be) === ts.SpecialPropertyAssignmentKind.None) { + if (getSpecialPropertyAssignmentKind(be) === SpecialPropertyAssignmentKind.None) { return undefined; } const parameters = isFunctionLike(be.right) ? be.right.parameters : emptyArray; diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index bd6c2e5cb9f..0d78ed92fab 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -33,8 +33,8 @@ namespace ts.JsTyping { } /* @internal */ - export function isTypingUpToDate(cachedTyping: JsTyping.CachedTyping, availableTypingVersions: MapLike) { - const availableVersion = Semver.parse(getProperty(availableTypingVersions, `ts${ts.versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")); + export function isTypingUpToDate(cachedTyping: CachedTyping, availableTypingVersions: MapLike) { + const availableVersion = Semver.parse(getProperty(availableTypingVersions, `ts${versionMajorMinor}`) || getProperty(availableTypingVersions, "latest")); return !availableVersion.greaterThan(cachedTyping.version); } diff --git a/src/services/navigateTo.ts b/src/services/navigateTo.ts index 21d8a792759..5165dcc6113 100644 --- a/src/services/navigateTo.ts +++ b/src/services/navigateTo.ts @@ -62,7 +62,7 @@ namespace ts.NavigateTo { } } - function shouldKeepItem(declaration: Declaration, checker: ts.TypeChecker): boolean { + function shouldKeepItem(declaration: Declaration, checker: TypeChecker): boolean { switch (declaration.kind) { case SyntaxKind.ImportClause: case SyntaxKind.ImportSpecifier: diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index cdc7b2b1864..5e9b07ab2d2 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -635,7 +635,7 @@ namespace ts.NavigationBar { return node.kind === SyntaxKind.SourceFile ? createTextSpanFromRange(node) : createTextSpanFromNode(node, curSourceFile); } - function getModifiers(node: ts.Node): string { + function getModifiers(node: Node): string { if (node.parent && node.parent.kind === SyntaxKind.VariableDeclaration) { node = node.parent; } diff --git a/src/services/pathCompletions.ts b/src/services/pathCompletions.ts index fd639aef817..cdf940cdc79 100644 --- a/src/services/pathCompletions.ts +++ b/src/services/pathCompletions.ts @@ -170,7 +170,7 @@ namespace ts.Completions.PathCompletions { } } - if (compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs) { + if (compilerOptions.moduleResolution === ModuleResolutionKind.NodeJs) { forEachAncestorDirectory(scriptPath, ancestor => { const nodeModules = combinePaths(ancestor, "node_modules"); if (host.directoryExists(nodeModules)) { diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 65c9fd6268c..1bec23a15d6 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -405,7 +405,7 @@ namespace ts.refactor.extractSymbol { switch (node.kind) { case SyntaxKind.FunctionDeclaration: case SyntaxKind.ClassDeclaration: - if (node.parent.kind === SyntaxKind.SourceFile && (node.parent as ts.SourceFile).externalModuleIndicator === undefined) { + if (isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } @@ -1358,7 +1358,7 @@ namespace ts.refactor.extractSymbol { } function getPropertyAssignmentsForWritesAndVariableDeclarations( - exposedVariableDeclarations: ReadonlyArray, + exposedVariableDeclarations: ReadonlyArray, writes: ReadonlyArray) { const variableAssignments = map(exposedVariableDeclarations, v => createShorthandPropertyAssignment(v.symbol.name)); diff --git a/src/services/rename.ts b/src/services/rename.ts index eed2d120519..c40f7908776 100644 --- a/src/services/rename.ts +++ b/src/services/rename.ts @@ -1,7 +1,7 @@ /* @internal */ namespace ts.Rename { export function getRenameInfo(typeChecker: TypeChecker, defaultLibFileName: string, getCanonicalFileName: GetCanonicalFileName, sourceFile: SourceFile, position: number): RenameInfo { - const getCanonicalDefaultLibName = memoize(() => getCanonicalFileName(ts.normalizePath(defaultLibFileName))); + const getCanonicalDefaultLibName = memoize(() => getCanonicalFileName(normalizePath(defaultLibFileName))); const node = getTouchingWord(sourceFile, position, /*includeJsDocComment*/ true); const renameInfo = node && nodeIsEligibleForRename(node) ? getRenameInfoForNode(node, typeChecker, sourceFile, isDefinedInLibraryFile) @@ -14,7 +14,7 @@ namespace ts.Rename { } const sourceFile = declaration.getSourceFile(); - const canonicalName = getCanonicalFileName(ts.normalizePath(sourceFile.fileName)); + const canonicalName = getCanonicalFileName(normalizePath(sourceFile.fileName)); return canonicalName === getCanonicalDefaultLibName(); } } diff --git a/src/services/services.ts b/src/services/services.ts index e29633a92e0..621cf6a9235 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -225,7 +225,7 @@ namespace ts { return undefined; } - const child = ts.find(children, kid => kid.kind < SyntaxKind.FirstJSDocNode || kid.kind > SyntaxKind.LastJSDocNode); + const child = find(children, kid => kid.kind < SyntaxKind.FirstJSDocNode || kid.kind > SyntaxKind.LastJSDocNode); return child.kind < SyntaxKind.FirstNode ? child : child.getFirstToken(sourceFile); @@ -377,7 +377,7 @@ namespace ts { const inheritedDocs = findInheritedJSDocComments(declaration, this.getName(), checker); if (inheritedDocs.length > 0) { if (this.documentationComment.length > 0) { - inheritedDocs.push(ts.lineBreakPart()); + inheritedDocs.push(lineBreakPart()); } this.documentationComment = concatenate(inheritedDocs, this.documentationComment); break; @@ -531,7 +531,7 @@ namespace ts { if (this.documentationComment.length === 0 || hasJSDocInheritDocTag(this.declaration)) { const inheritedDocs = findInheritedJSDocComments(this.declaration, this.declaration.symbol.getName(), this.checker); if (this.documentationComment.length > 0) { - inheritedDocs.push(ts.lineBreakPart()); + inheritedDocs.push(lineBreakPart()); } this.documentationComment = concatenate( inheritedDocs, @@ -562,7 +562,7 @@ namespace ts { * @returns `true` if `node` has a JSDoc "inheritDoc" tag on it, otherwise `false`. */ function hasJSDocInheritDocTag(node: Node) { - return ts.getJSDocTags(node).some(tag => tag.tagName.text === "inheritDoc"); + return getJSDocTags(node).some(tag => tag.tagName.text === "inheritDoc"); } /** @@ -665,7 +665,7 @@ namespace ts { } public getLineAndCharacterOfPosition(position: number): LineAndCharacter { - return ts.getLineAndCharacterOfPosition(this, position); + return getLineAndCharacterOfPosition(this, position); } public getLineStarts(): ReadonlyArray { @@ -673,7 +673,7 @@ namespace ts { } public getPositionOfLineAndCharacter(line: number, character: number): number { - return ts.getPositionOfLineAndCharacter(this, line, character); + return getPositionOfLineAndCharacter(this, line, character); } public getLineEndOfPosition(pos: number): number { @@ -848,7 +848,7 @@ namespace ts { constructor(public fileName: string, public text: string, public skipTrivia?: (pos: number) => number) { } public getLineAndCharacterOfPosition(pos: number): LineAndCharacter { - return ts.getLineAndCharacterOfPosition(this, pos); + return getLineAndCharacterOfPosition(this, pos); } } @@ -1617,7 +1617,7 @@ namespace ts { synchronizeHostData(); const sourceFiles = fileName ? [getValidSourceFile(fileName)] : program.getSourceFiles(); - return ts.NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles); + return NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles); } function getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean) { @@ -1914,7 +1914,7 @@ namespace ts { function getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean) { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - const range = ts.formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine); + const range = formatting.getRangeOfEnclosingComment(sourceFile, position, onlyMultiLine); return range && createTextSpanFromRange(range); } @@ -2189,7 +2189,7 @@ namespace ts { * then we want 'something' to be in the name table. Similarly, if we have * "a['propname']" then we want to store "propname" in the name table. */ - function literalIsName(node: ts.StringLiteral | ts.NumericLiteral): boolean { + function literalIsName(node: StringLiteral | NumericLiteral): boolean { return isDeclarationName(node) || node.parent.kind === SyntaxKind.ExternalModuleReference || isArgumentOfElementAccessExpression(node) || diff --git a/src/services/shims.ts b/src/services/shims.ts index 5d3f82eb966..1a43fbda146 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -663,7 +663,7 @@ namespace ts { private realizeDiagnostics(diagnostics: ReadonlyArray): { message: string; start: number; length: number; category: string; }[] { const newLine = getNewLineOrDefaultFromHost(this.host); - return ts.realizeDiagnostics(diagnostics, newLine); + return realizeDiagnostics(diagnostics, newLine); } public getSyntacticClassifications(fileName: string, start: number, length: number): string { @@ -925,7 +925,7 @@ namespace ts { return this.forwardJSONCall( `getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`, () => { - const localOptions: ts.FormatCodeOptions = options === undefined ? undefined : JSON.parse(options); + const localOptions: FormatCodeOptions = options === undefined ? undefined : JSON.parse(options); return this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source); } ); @@ -935,7 +935,7 @@ namespace ts { return this.forwardJSONCall( `getFormattingEditsForRange('${fileName}', ${start}, ${end})`, () => { - const localOptions: ts.FormatCodeOptions = JSON.parse(options); + const localOptions: FormatCodeOptions = JSON.parse(options); return this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); }); } @@ -944,7 +944,7 @@ namespace ts { return this.forwardJSONCall( `getFormattingEditsForDocument('${fileName}')`, () => { - const localOptions: ts.FormatCodeOptions = JSON.parse(options); + const localOptions: FormatCodeOptions = JSON.parse(options); return this.languageService.getFormattingEditsForDocument(fileName, localOptions); }); } @@ -953,7 +953,7 @@ namespace ts { return this.forwardJSONCall( `getFormattingEditsAfterKeystroke('${fileName}', ${position}, '${key}')`, () => { - const localOptions: ts.FormatCodeOptions = JSON.parse(options); + const localOptions: FormatCodeOptions = JSON.parse(options); return this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); }); } diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index 135e906143f..1b77f23fa33 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -117,7 +117,7 @@ namespace ts.SymbolDisplay { const displayParts: SymbolDisplayPart[] = []; let documentation: SymbolDisplayPart[]; let tags: JSDocTagInfo[]; - const symbolFlags = ts.getCombinedLocalAndExportSymbolFlags(symbol); + const symbolFlags = getCombinedLocalAndExportSymbolFlags(symbol); let symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); let hasAddedSymbolInfo: boolean; const isThisExpression = location.kind === SyntaxKind.ThisKeyword && isExpression(location); @@ -369,16 +369,16 @@ namespace ts.SymbolDisplay { const resolvedSymbol = typeChecker.getAliasedSymbol(symbol); if (resolvedSymbol !== symbol && resolvedSymbol.declarations && resolvedSymbol.declarations.length > 0) { const resolvedNode = resolvedSymbol.declarations[0]; - const declarationName = ts.getNameOfDeclaration(resolvedNode); + const declarationName = getNameOfDeclaration(resolvedNode); if (declarationName) { const isExternalModuleDeclaration = - ts.isModuleWithStringLiteralName(resolvedNode) && - ts.hasModifier(resolvedNode, ModifierFlags.Ambient); + isModuleWithStringLiteralName(resolvedNode) && + hasModifier(resolvedNode, ModifierFlags.Ambient); const shouldUseAliasName = symbol.name !== "default" && !isExternalModuleDeclaration; const resolvedInfo = getSymbolDisplayPartsDocumentationAndSymbolKind( typeChecker, resolvedSymbol, - ts.getSourceFileOfNode(resolvedNode), + getSourceFileOfNode(resolvedNode), resolvedNode, declarationName, semanticMeaning, @@ -406,7 +406,7 @@ namespace ts.SymbolDisplay { } displayParts.push(spacePart()); addFullSymbolName(symbol); - ts.forEach(symbol.declarations, declaration => { + forEach(symbol.declarations, declaration => { if (declaration.kind === SyntaxKind.ImportEqualsDeclaration) { const importEqualsDeclaration = declaration; if (isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { @@ -607,7 +607,7 @@ namespace ts.SymbolDisplay { return false; // This is exported symbol } - return ts.forEach(symbol.declarations, declaration => { + return forEach(symbol.declarations, declaration => { // Function expressions are local if (declaration.kind === SyntaxKind.FunctionExpression) { return true; diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index bc70106e530..3ad3d6d57c6 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -192,7 +192,7 @@ namespace ts.textChanges { export interface TextChangesContext { host: LanguageServiceHost; - formatContext: ts.formatting.FormatContext; + formatContext: formatting.FormatContext; } export class ChangeTracker { @@ -212,7 +212,7 @@ namespace ts.textChanges { } /** Public for tests only. Other callers should use `ChangeTracker.with`. */ - constructor(private readonly newLineCharacter: string, private readonly formatContext: ts.formatting.FormatContext) {} + constructor(private readonly newLineCharacter: string, private readonly formatContext: formatting.FormatContext) {} public deleteRange(sourceFile: SourceFile, range: TextRange) { this.changes.push({ kind: ChangeKind.Remove, sourceFile, range }); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 4fef3fc30d8..90ed78047e6 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7181,7 +7181,7 @@ declare namespace ts.server { } type CommandNames = protocol.CommandTypes; const CommandNames: any; - function formatMessage(msg: T, logger: server.Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string; + function formatMessage(msg: T, logger: Logger, byteLength: (s: string, encoding: string) => number, newLine: string): string; type Event = (body: T, eventName: string) => void; interface EventSender { event: Event; diff --git a/tslint.json b/tslint.json index bd06724edb8..eaf76b52155 100644 --- a/tslint.json +++ b/tslint.json @@ -42,6 +42,7 @@ "no-switch-case-fall-through": true, "no-trailing-whitespace": [true, "ignore-template-strings"], "no-type-assertion-whitespace": true, + "no-unnecessary-qualifier": true, "no-var-keyword": true, "object-literal-shorthand": true, "object-literal-surrounding-space": true, From 16fc2568236a86ee1521ff43a9d864af10252258 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 1 Mar 2018 14:41:55 -0800 Subject: [PATCH 273/298] Convert 'installTypesForPackge' refactor to a suggestion (#22267) * Convert 'installTypesForPackge' refactor to a suggestion * Have checker collect a list of suggestion diagnostics instead of redoing work in calculateSuggestionDiagnostics * Add comment * Add diagnostic even with `--allowJs` --- src/compiler/checker.ts | 41 +++++++++--- src/compiler/types.ts | 6 ++ src/harness/fourslash.ts | 9 +-- src/services/codefixes/fixCannotFindModule.ts | 2 +- .../refactors/installTypesForPackage.ts | 67 ------------------- src/services/refactors/refactors.ts | 1 - src/services/services.ts | 2 +- src/services/suggestionDiagnostics.ts | 14 ++-- .../codeFixCannotFindModule_suggestion.ts | 29 ++++++++ .../codeFixCannotFindModule_suggestion_js.ts | 32 +++++++++ .../refactorInstallTypesForPackage.ts | 25 ------- ...ctorInstallTypesForPackage_importEquals.ts | 25 ------- .../refactorInstallTypesForPackage_js.ts | 29 -------- 13 files changed, 116 insertions(+), 166 deletions(-) delete mode 100644 src/services/refactors/installTypesForPackage.ts create mode 100644 tests/cases/fourslash/codeFixCannotFindModule_suggestion.ts create mode 100644 tests/cases/fourslash/codeFixCannotFindModule_suggestion_js.ts delete mode 100644 tests/cases/fourslash/refactorInstallTypesForPackage.ts delete mode 100644 tests/cases/fourslash/refactorInstallTypesForPackage_importEquals.ts delete mode 100644 tests/cases/fourslash/refactorInstallTypesForPackage_js.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d30387e43da..ae91d887781 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -311,6 +311,8 @@ namespace ts { node = getParseTreeNode(node, isTypeNode); return node && getTypeArgumentConstraint(node); }, + + getSuggestionDiagnostics: file => suggestionDiagnostics.get(file.fileName) || emptyArray, }; const tupleTypes: GenericType[] = []; @@ -448,6 +450,19 @@ namespace ts { const awaitedTypeStack: number[] = []; const diagnostics = createDiagnosticCollection(); + // Suggestion diagnostics must have a file. Keyed by source file name. + const suggestionDiagnostics = createMultiMap(); + function addSuggestionDiagnostic(diag: Diagnostic): void { + suggestionDiagnostics.add(diag.file.fileName, { ...diag, category: DiagnosticCategory.Suggestion }); + } + function addErrorOrSuggestionDiagnostic(isError: boolean, diag: Diagnostic): void { + if (isError) { + diagnostics.add(diag); + } + else { + addSuggestionDiagnostic(diag); + } + } const enum TypeFacts { None = 0, @@ -2072,6 +2087,9 @@ namespace ts { const sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { + if (resolvedModule.isExternalLibraryImport && !extensionIsTypeScript(resolvedModule.extension)) { + addSuggestionDiagnostic(createModuleImplicitlyAnyDiagnostic(errorNode, resolvedModule, moduleReference)); + } // merged symbol is module declaration symbol combined with all augmentations return getMergedSymbol(sourceFile.symbol); } @@ -2095,15 +2113,8 @@ namespace ts { const diag = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (noImplicitAny && moduleNotFoundError) { - let errorInfo = resolvedModule.packageId && chainDiagnosticMessages(/*details*/ undefined, - Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, - getMangledNameForScopedPackage(resolvedModule.packageId.name)); - errorInfo = chainDiagnosticMessages(errorInfo, - Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, - moduleReference, - resolvedModule.resolvedFileName); - diagnostics.add(createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); + else { + addErrorOrSuggestionDiagnostic(noImplicitAny && !!moduleNotFoundError, createModuleImplicitlyAnyDiagnostic(errorNode, resolvedModule, moduleReference)); } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. return undefined; @@ -2128,6 +2139,18 @@ namespace ts { return undefined; } + function createModuleImplicitlyAnyDiagnostic(errorNode: Node, { packageId, resolvedFileName }: ResolvedModuleFull, moduleReference: string): Diagnostic { + const errorInfo = packageId && chainDiagnosticMessages( + /*details*/ undefined, + Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, + getMangledNameForScopedPackage(packageId.name)); + return createDiagnosticForNodeFromMessageChain(errorNode, chainDiagnosticMessages( + errorInfo, + Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, + moduleReference, + resolvedFileName)); + } + // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol: Symbol, dontResolveAlias?: boolean): Symbol { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 63d03691ebd..b933d6853af 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2954,6 +2954,12 @@ namespace ts { /** @param node A location where we might consider accessing `this`. Not necessarily a ThisExpression. */ /* @internal */ tryGetThisTypeAt(node: Node): Type | undefined; /* @internal */ getTypeArgumentConstraint(node: TypeNode): Type | undefined; + + /** + * Does *not* get *all* suggestion diagnostics, just the ones that were convenient to report in the checker. + * Others are added in computeSuggestionDiagnostics. + */ + /* @internal */ getSuggestionDiagnostics(file: SourceFile): ReadonlyArray; } /* @internal */ diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index d52bc304770..401caac3234 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -505,11 +505,11 @@ namespace FourSlash { return "\nMarker: " + this.lastKnownMarker + "\nChecking: " + msg + "\n\n"; } - private getDiagnostics(fileName: string): ts.Diagnostic[] { + private getDiagnostics(fileName: string, includeSuggestions = false): ts.Diagnostic[] { return [ ...this.languageService.getSyntacticDiagnostics(fileName), ...this.languageService.getSemanticDiagnostics(fileName), - ...this.languageService.getSuggestionDiagnostics(fileName), + ...(includeSuggestions ? this.languageService.getSuggestionDiagnostics(fileName) : ts.emptyArray), ]; } @@ -583,7 +583,8 @@ namespace FourSlash { public verifyNoErrors() { ts.forEachKey(this.inputFiles, fileName => { - if (!ts.isAnySupportedFileExtension(fileName)) return; + if (!ts.isAnySupportedFileExtension(fileName) + || !this.getProgram().getCompilerOptions().allowJs && !ts.extensionIsTypeScript(ts.extensionFromPath(fileName))) return; const errors = this.getDiagnostics(fileName).filter(e => e.category !== ts.DiagnosticCategory.Suggestion); if (errors.length) { this.printErrorLog(/*expectErrors*/ false, errors); @@ -2522,7 +2523,7 @@ Actual: ${stringify(fullActual)}`); * @param fileName Path to file where error should be retrieved from. */ private getCodeFixes(fileName: string, errorCode?: number): ts.CodeFixAction[] { - const diagnosticsForCodeFix = this.getDiagnostics(fileName).map(diagnostic => ({ + const diagnosticsForCodeFix = this.getDiagnostics(fileName, /*includeSuggestions*/ true).map(diagnostic => ({ start: diagnostic.start, length: diagnostic.length, code: diagnostic.code diff --git a/src/services/codefixes/fixCannotFindModule.ts b/src/services/codefixes/fixCannotFindModule.ts index a28a46caf1b..41563e6ca90 100644 --- a/src/services/codefixes/fixCannotFindModule.ts +++ b/src/services/codefixes/fixCannotFindModule.ts @@ -31,7 +31,7 @@ namespace ts.codefix { return host.isKnownTypesPackageName(packageName) ? getTypesPackageName(packageName) : undefined; } - export function tryGetCodeActionForInstallPackageTypes(host: LanguageServiceHost, fileName: string, moduleName: string): CodeAction | undefined { + function tryGetCodeActionForInstallPackageTypes(host: LanguageServiceHost, fileName: string, moduleName: string): CodeAction | undefined { const packageName = getTypesPackageNameToInstall(host, moduleName); return packageName === undefined ? undefined : { description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Install_0), [packageName]), diff --git a/src/services/refactors/installTypesForPackage.ts b/src/services/refactors/installTypesForPackage.ts deleted file mode 100644 index 4e1d71daf66..00000000000 --- a/src/services/refactors/installTypesForPackage.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* @internal */ -namespace ts.refactor.installTypesForPackage { - const refactorName = "Install missing types package"; - const actionName = "install"; - const description = "Install missing types package"; - registerRefactor(refactorName, { getEditsForAction, getAvailableActions }); - - function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined { - if (getStrictOptionValue(context.program.getCompilerOptions(), "noImplicitAny")) { - // Then it will be available via `fixCannotFindModule`. - return undefined; - } - - const action = getAction(context); - return action && [ - { - name: refactorName, - description, - actions: [ - { - description: action.description, - name: actionName, - }, - ], - }, - ]; - } - - function getEditsForAction(context: RefactorContext, _actionName: string): RefactorEditInfo | undefined { - Debug.assertEqual(actionName, _actionName); - const action = getAction(context)!; // Should be defined if we said there was an action available. - return { - edits: [], - renameFilename: undefined, - renameLocation: undefined, - commands: action.commands, - }; - } - - function getAction(context: RefactorContext): CodeAction | undefined { - const { file, startPosition } = context; - const node = getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - if (!isStringLiteral(node) || !isModuleIdentifier(node)) { - return undefined; - } - - const resolvedTo = getResolvedModule(file, node.text); - // Still offer to install types if it resolved to e.g. a ".js" file. - // `tryGetCodeActionForInstallPackageTypes` will verify that we're looking for a valid package name, - // so the fix won't trigger for imports of ".js" files that couldn't be better replaced by typings. - if (resolvedTo && extensionIsTypeScript(resolvedTo.extension)) { - return undefined; - } - - return codefix.tryGetCodeActionForInstallPackageTypes(context.host, file.fileName, node.text); - } - - function isModuleIdentifier(node: StringLiteral): boolean { - switch (node.parent.kind) { - case SyntaxKind.ImportDeclaration: - case SyntaxKind.ExternalModuleReference: - return true; - default: - return false; - } - } -} diff --git a/src/services/refactors/refactors.ts b/src/services/refactors/refactors.ts index 3858b198743..bc82b2a2473 100644 --- a/src/services/refactors/refactors.ts +++ b/src/services/refactors/refactors.ts @@ -1,5 +1,4 @@ /// /// /// -/// /// diff --git a/src/services/services.ts b/src/services/services.ts index 621cf6a9235..c3f25f3b98b 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1422,7 +1422,7 @@ namespace ts { function getSuggestionDiagnostics(fileName: string): Diagnostic[] { synchronizeHostData(); - return computeSuggestionDiagnostics(getValidSourceFile(fileName)); + return computeSuggestionDiagnostics(getValidSourceFile(fileName), program); } function getCompilerOptionsDiagnostics() { diff --git a/src/services/suggestionDiagnostics.ts b/src/services/suggestionDiagnostics.ts index 8cb26f74a01..2588dee2726 100644 --- a/src/services/suggestionDiagnostics.ts +++ b/src/services/suggestionDiagnostics.ts @@ -1,8 +1,14 @@ /* @internal */ namespace ts { - export function computeSuggestionDiagnostics(sourceFile: SourceFile): Diagnostic[] { - return sourceFile.commonJsModuleIndicator - ? [createDiagnosticForNode(sourceFile.commonJsModuleIndicator, Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)] - : emptyArray; + export function computeSuggestionDiagnostics(sourceFile: SourceFile, program: Program): Diagnostic[] { + program.getSemanticDiagnostics(sourceFile); + const checker = program.getDiagnosticsProducingTypeChecker(); + const diags: Diagnostic[] = []; + + if (sourceFile.commonJsModuleIndicator) { + diags.push(createDiagnosticForNode(sourceFile.commonJsModuleIndicator, Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)); + } + + return diags.concat(checker.getSuggestionDiagnostics(sourceFile)); } } diff --git a/tests/cases/fourslash/codeFixCannotFindModule_suggestion.ts b/tests/cases/fourslash/codeFixCannotFindModule_suggestion.ts new file mode 100644 index 00000000000..778ac040c18 --- /dev/null +++ b/tests/cases/fourslash/codeFixCannotFindModule_suggestion.ts @@ -0,0 +1,29 @@ +/// + +// @moduleResolution: node + +// @Filename: /node_modules/abs/subModule.js +////export const x = 0; + +// @Filename: /a.ts +////import * as abs from [|"abs/subModule"|]; + +test.setTypesRegistry({ + "abs": undefined, +}); + +verify.noErrors(); +goTo.file("/a.ts"); +verify.getSuggestionDiagnostics([{ + message: "Could not find a declaration file for module 'abs/subModule'. '/node_modules/abs/subModule.js' implicitly has an 'any' type.", + code: 7016, +}]); + +verify.codeFixAvailable([{ + description: "Install '@types/abs'", + commands: [{ + type: "install package", + file: "/a.ts", + packageName: "@types/abs", + }], +}]); diff --git a/tests/cases/fourslash/codeFixCannotFindModule_suggestion_js.ts b/tests/cases/fourslash/codeFixCannotFindModule_suggestion_js.ts new file mode 100644 index 00000000000..a8ca9156cf1 --- /dev/null +++ b/tests/cases/fourslash/codeFixCannotFindModule_suggestion_js.ts @@ -0,0 +1,32 @@ +/// + +// @allowJs: true +// @checkJs: true + +// @Filename: /node_modules/abs/index.js +////export default function abs() {} + +// @Filename: /a.js +////import abs from [|"abs"|]; + +test.setTypesRegistry({ "abs": undefined }); + +verify.noErrors(); +goTo.file("/a.js"); +verify.getSuggestionDiagnostics([{ + message: "Could not find a declaration file for module 'abs'. '/node_modules/abs/index.js' implicitly has an 'any' type.", + code: 7016, +}]); + +verify.codeFixAvailable([ + { + description: "Install '@types/abs'", + commands: [{ + type: "install package", + file: "/a.js", + packageName: "@types/abs", + }], + }, + { description: "Ignore this error message" }, + { description: "Disable checking for this file" }, +]); diff --git a/tests/cases/fourslash/refactorInstallTypesForPackage.ts b/tests/cases/fourslash/refactorInstallTypesForPackage.ts deleted file mode 100644 index edcdc2ba6e0..00000000000 --- a/tests/cases/fourslash/refactorInstallTypesForPackage.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// - -////import * as abs from "/*a*/abs/subModule/*b*/"; - -test.setTypesRegistry({ - "abs": undefined, -}); - -goTo.select("a", "b"); -verify.refactor({ - name: "Install missing types package", - actionName: "install", - refactors: [ - { - name: "Install missing types package", - description: "Install missing types package", - actions: [ - { - description: "Install '@types/abs'", - name: "install", - } - ] - } - ], -}); diff --git a/tests/cases/fourslash/refactorInstallTypesForPackage_importEquals.ts b/tests/cases/fourslash/refactorInstallTypesForPackage_importEquals.ts deleted file mode 100644 index 18793e4b353..00000000000 --- a/tests/cases/fourslash/refactorInstallTypesForPackage_importEquals.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// - -////import abs = require("/*a*/abs/subModule/*b*/"); - -test.setTypesRegistry({ - "abs": undefined, -}); - -goTo.select("a", "b"); -verify.refactor({ - name: "Install missing types package", - actionName: "install", - refactors: [ - { - name: "Install missing types package", - description: "Install missing types package", - actions: [ - { - description: "Install '@types/abs'", - name: "install", - } - ] - } - ], -}); diff --git a/tests/cases/fourslash/refactorInstallTypesForPackage_js.ts b/tests/cases/fourslash/refactorInstallTypesForPackage_js.ts deleted file mode 100644 index 1cce0d33526..00000000000 --- a/tests/cases/fourslash/refactorInstallTypesForPackage_js.ts +++ /dev/null @@ -1,29 +0,0 @@ -/// - -// @allowJs: true - -// @Filename: /node_modules/abs/index.js -////not read - -// @Filename: /a.js -////import abs = require("/*a*/abs/*b*/"); - -test.setTypesRegistry({ "abs": undefined }); - -goTo.select("a", "b"); -verify.refactor({ - name: "Install missing types package", - actionName: "install", - refactors: [ - { - name: "Install missing types package", - description: "Install missing types package", - actions: [ - { - description: "Install '@types/abs'", - name: "install", - } - ] - } - ], -}); From 2a8af806c9802c1f455d38559e9522ef5814fba0 Mon Sep 17 00:00:00 2001 From: csigs Date: Thu, 1 Mar 2018 23:12:32 +0000 Subject: [PATCH 274/298] LEGO: check in for master to temporary branch. --- .../diagnosticMessages.generated.json.lcl | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 14a0aa42355..809a81ccdfb 100644 --- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -896,6 +896,15 @@ + + + + + + + + + @@ -908,6 +917,15 @@ + + + + + + + + + @@ -932,6 +950,15 @@ + + + + + + + + + From 7a19b66cc0ae44456b7c62a4c84b718d35777a7c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 1 Mar 2018 16:01:32 -0800 Subject: [PATCH 275/298] Don't propagate 'never' types in type inference --- src/compiler/checker.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ae91d887781..1931661bf5f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11525,10 +11525,10 @@ namespace ts { if (!couldContainTypeVariables(target)) { return; } - if (source.flags & (TypeFlags.Any | TypeFlags.Never) && source !== silentNeverType) { - // We are inferring from 'any' or 'never'. We want to infer this type for every type parameter - // referenced in the target type, so we record the propagation type and infer from the target - // to itself. Then, as we find candidates we substitute the propagation type. + if (source.flags & TypeFlags.Any) { + // We are inferring from an 'any' type. We want to infer this type for every type parameter + // referenced in the target type, so we record it as the propagation type and infer from the + // target to itself. Then, as we find candidates we substitute the propagation type. const savePropagationType = propagationType; propagationType = source; inferFromTypes(target, target); From 10e3b73330ceea08f338117568dfb72b6fb564f3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 1 Mar 2018 16:49:42 -0800 Subject: [PATCH 276/298] Debug assert on parent rebind, mitigate circularity in symbol access checking (#22282) * Assert that symbol parents are never rebound to different parents * mitigate circularities in symbol accessibility checking --- src/compiler/binder.ts | 7 ++++++- src/compiler/checker.ts | 20 ++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 86c9c97bdd5..a3a2be8bca3 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -427,7 +427,12 @@ namespace ts { } addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; + if (symbol.parent) { + Debug.assert(symbol.parent === parent, "Existing symbol parent should match new one"); + } + else { + symbol.parent = parent; + } return symbol; } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1931661bf5f..515789a3fd7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2470,12 +2470,19 @@ namespace ts { return rightMeaning === SymbolFlags.Value ? SymbolFlags.Value : SymbolFlags.Namespace; } - function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, useOnlyExternalAliasing: boolean): Symbol[] | undefined { + function getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, useOnlyExternalAliasing: boolean, visitedSymbolTablesMap: Map = createMap()): Symbol[] | undefined { if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) { return undefined; } - const visitedSymbolTables: SymbolTable[] = []; + const id = "" + getSymbolId(symbol); + let visitedSymbolTables: SymbolTable[]; + if (visitedSymbolTablesMap.has(id)) { + visitedSymbolTables = visitedSymbolTablesMap.get(id); + } + else { + visitedSymbolTablesMap.set(id, visitedSymbolTables = []); + } return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); /** @@ -2495,7 +2502,7 @@ namespace ts { // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning) || // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too - !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); + !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing, visitedSymbolTablesMap); } function isAccessible(symbolFromSymbolTable: Symbol, resolvedAliasSymbol?: Symbol, ignoreQualification?: boolean) { @@ -5445,7 +5452,12 @@ namespace ts { } addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); - lateSymbol.parent = parent; + if (lateSymbol.parent) { + Debug.assert(lateSymbol.parent === parent, "Existing symbol parent should match new one"); + } + else { + lateSymbol.parent = parent; + } return links.resolvedSymbol = lateSymbol; } } From 36bebe9487dbaaf762e9a66829a03bc5be52dd19 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 1 Mar 2018 16:49:56 -0800 Subject: [PATCH 277/298] Parenthesize computed names if not an assignment expression (#22280) --- src/compiler/factory.ts | 9 ++++++- .../decoratorsOnComputedProperties.js | 24 +++++++++---------- tests/baselines/reference/symbolProperty7.js | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 342ea067c0e..951f3bd8fd4 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -230,9 +230,16 @@ namespace ts { : node; } + function parenthesizeForComputedName(expression: Expression): Expression { + return (isBinaryExpression(expression) && expression.operatorToken.kind === SyntaxKind.CommaToken) || + expression.kind === SyntaxKind.CommaListExpression ? + createParen(expression) : + expression; + } + export function createComputedPropertyName(expression: Expression) { const node = createSynthesizedNode(SyntaxKind.ComputedPropertyName); - node.expression = expression; + node.expression = parenthesizeForComputedName(expression); return node; } diff --git a/tests/baselines/reference/decoratorsOnComputedProperties.js b/tests/baselines/reference/decoratorsOnComputedProperties.js index 0083bc8b9a1..ee7db88503f 100644 --- a/tests/baselines/reference/decoratorsOnComputedProperties.js +++ b/tests/baselines/reference/decoratorsOnComputedProperties.js @@ -262,7 +262,7 @@ class C { this[_k] = null; this[_l] = null; } - [foo(), _m = foo(), _k = foo(), _o = fieldNameB, _l = fieldNameC, "some" + "method"]() { } + [(foo(), _m = foo(), _k = foo(), _o = fieldNameB, _l = fieldNameC, "some" + "method")]() { } } __decorate([ x @@ -297,7 +297,7 @@ void class D { this[_p] = null; this[_q] = null; } - [foo(), _r = foo(), _p = foo(), _s = fieldNameB, _q = fieldNameC, "some" + "method"]() { } + [(foo(), _r = foo(), _p = foo(), _s = fieldNameB, _q = fieldNameC, "some" + "method")]() { } }; class E { constructor() { @@ -308,7 +308,7 @@ class E { this[_t] = null; this[_u] = null; } - [foo(), _v = foo(), _t = foo(), "some" + "method"]() { } + [(foo(), _v = foo(), _t = foo(), "some" + "method")]() { } } _w = fieldNameB, _u = fieldNameC; __decorate([ @@ -344,7 +344,7 @@ void (_x = class F { this[_y] = null; this[_z] = null; } - [foo(), _0 = foo(), _y = foo(), "some" + "method"]() { } + [(foo(), _0 = foo(), _y = foo(), "some" + "method")]() { } }, _1 = fieldNameB, _z = fieldNameC, @@ -358,8 +358,8 @@ class G { this[_2] = null; this[_3] = null; } - [foo(), _4 = foo(), _2 = foo(), "some" + "method"]() { } - [_5 = fieldNameB, "some" + "method2"]() { } + [(foo(), _4 = foo(), _2 = foo(), "some" + "method")]() { } + [(_5 = fieldNameB, "some" + "method2")]() { } } _3 = fieldNameC; __decorate([ @@ -395,8 +395,8 @@ void (_6 = class H { this[_7] = null; this[_8] = null; } - [foo(), _9 = foo(), _7 = foo(), "some" + "method"]() { } - [_10 = fieldNameB, "some" + "method2"]() { } + [(foo(), _9 = foo(), _7 = foo(), "some" + "method")]() { } + [(_10 = fieldNameB, "some" + "method2")]() { } }, _8 = fieldNameC, _6); @@ -409,8 +409,8 @@ class I { this[_11] = null; this[_12] = null; } - [foo(), _13 = foo(), _11 = foo(), _14 = "some" + "method"]() { } - [_15 = fieldNameB, "some" + "method2"]() { } + [(foo(), _13 = foo(), _11 = foo(), _14 = "some" + "method")]() { } + [(_15 = fieldNameB, "some" + "method2")]() { } } _12 = fieldNameC; __decorate([ @@ -449,8 +449,8 @@ void (_16 = class J { this[_17] = null; this[_18] = null; } - [foo(), _19 = foo(), _17 = foo(), _20 = "some" + "method"]() { } - [_21 = fieldNameB, "some" + "method2"]() { } + [(foo(), _19 = foo(), _17 = foo(), _20 = "some" + "method")]() { } + [(_21 = fieldNameB, "some" + "method2")]() { } }, _18 = fieldNameC, _16); diff --git a/tests/baselines/reference/symbolProperty7.js b/tests/baselines/reference/symbolProperty7.js index 9dbe5a1abb1..bebc929e95d 100644 --- a/tests/baselines/reference/symbolProperty7.js +++ b/tests/baselines/reference/symbolProperty7.js @@ -13,7 +13,7 @@ class C { constructor() { this[_a] = 0; } - [_a = Symbol(), Symbol(), Symbol()]() { } + [(_a = Symbol(), Symbol(), Symbol())]() { } get [Symbol()]() { return 0; } From fe075f26a26a7813d622044a52505628265d6270 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 2 Mar 2018 09:11:33 -0800 Subject: [PATCH 278/298] Transform 'keyof (A & B)' to 'keyof A | keyof B' --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1931661bf5f..c476297bb68 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7987,7 +7987,8 @@ namespace ts { } function getIndexType(type: Type): Type { - return maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(type) : + return type.flags & TypeFlags.Intersection ? getUnionType(map((type).types, t => getIndexType(t))) : + maybeTypeOfKind(type, TypeFlags.InstantiableNonPrimitive) ? getIndexTypeForGenericType(type) : getObjectFlags(type) & ObjectFlags.Mapped ? getConstraintTypeFromMappedType(type) : type === wildcardType ? wildcardType : type.flags & TypeFlags.Any || getIndexInfoOfType(type, IndexKind.String) ? stringType : From 4256be1591dcf140d38c0c6fe25e4a6a49bba869 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 2 Mar 2018 09:24:59 -0800 Subject: [PATCH 279/298] Accept new baselines --- .../reference/indexedAccessRelation.types | 4 +-- .../reference/keyofAndIndexedAccess.types | 28 +++++++++---------- .../keyofAndIndexedAccessErrors.errors.txt | 10 ++++--- .../keyofAndIndexedAccessErrors.types | 18 ++++++------ 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/tests/baselines/reference/indexedAccessRelation.types b/tests/baselines/reference/indexedAccessRelation.types index 2564a82702d..02884d8682a 100644 --- a/tests/baselines/reference/indexedAccessRelation.types +++ b/tests/baselines/reference/indexedAccessRelation.types @@ -44,9 +44,9 @@ class Comp extends Component> this.setState({ a: a }); >this.setState({ a: a }) : void ->this.setState : )>(state: Pick, K>) => void +>this.setState : (state: Pick, K>) => void >this : this ->setState : )>(state: Pick, K>) => void +>setState : (state: Pick, K>) => void >{ a: a } : { a: T; } >a : T >a : T diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index af441e865ff..694abf7d10e 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -888,20 +888,20 @@ function f60(source: T, target: T) { } function f70(func: (k1: keyof (T | U), k2: keyof (T & U)) => void) { ->f70 : (func: (k1: keyof (T | U), k2: keyof (T & U)) => void) => void ->func : (k1: keyof (T | U), k2: keyof (T & U)) => void +>f70 : (func: (k1: keyof (T | U), k2: keyof T | keyof U) => void) => void +>func : (k1: keyof (T | U), k2: keyof T | keyof U) => void >T : T >U : U >k1 : keyof (T | U) >T : T >U : U ->k2 : keyof (T & U) +>k2 : keyof T | keyof U >T : T >U : U func<{ a: any, b: any }, { a: any, c: any }>('a', 'a'); >func<{ a: any, b: any }, { a: any, c: any }>('a', 'a') : void ->func : (k1: keyof (T | U), k2: keyof (T & U)) => void +>func : (k1: keyof (T | U), k2: keyof T | keyof U) => void >a : any >b : any >a : any @@ -911,7 +911,7 @@ function f70(func: (k1: keyof (T | U), k2: keyof (T & U)) => void) { func<{ a: any, b: any }, { a: any, c: any }>('a', 'b'); >func<{ a: any, b: any }, { a: any, c: any }>('a', 'b') : void ->func : (k1: keyof (T | U), k2: keyof (T & U)) => void +>func : (k1: keyof (T | U), k2: keyof T | keyof U) => void >a : any >b : any >a : any @@ -921,7 +921,7 @@ function f70(func: (k1: keyof (T | U), k2: keyof (T & U)) => void) { func<{ a: any, b: any }, { a: any, c: any }>('a', 'c'); >func<{ a: any, b: any }, { a: any, c: any }>('a', 'c') : void ->func : (k1: keyof (T | U), k2: keyof (T & U)) => void +>func : (k1: keyof (T | U), k2: keyof T | keyof U) => void >a : any >b : any >a : any @@ -1034,8 +1034,8 @@ function f72(func: (x: T, y: U, k: K) => (T & } function f73(func: (x: T, y: U, k: K) => (T & U)[K]) { ->f73 : (func: (x: T, y: U, k: K) => (T & U)[K]) => void ->func : (x: T, y: U, k: K) => (T & U)[K] +>f73 : (func: (x: T, y: U, k: K) => (T & U)[K]) => void +>func : (x: T, y: U, k: K) => (T & U)[K] >T : T >U : U >K : K @@ -1054,7 +1054,7 @@ function f73(func: (x: T, y: U, k: K) => (T & U)[ let a = func({ a: 1, b: "hello" }, { c: true }, 'a'); // number >a : number >func({ a: 1, b: "hello" }, { c: true }, 'a') : number ->func : (x: T, y: U, k: K) => (T & U)[K] +>func : (x: T, y: U, k: K) => (T & U)[K] >{ a: 1, b: "hello" } : { a: number; b: string; } >a : number >1 : 1 @@ -1068,7 +1068,7 @@ function f73(func: (x: T, y: U, k: K) => (T & U)[ let b = func({ a: 1, b: "hello" }, { c: true }, 'b'); // string >b : string >func({ a: 1, b: "hello" }, { c: true }, 'b') : string ->func : (x: T, y: U, k: K) => (T & U)[K] +>func : (x: T, y: U, k: K) => (T & U)[K] >{ a: 1, b: "hello" } : { a: number; b: string; } >a : number >1 : 1 @@ -1082,7 +1082,7 @@ function f73(func: (x: T, y: U, k: K) => (T & U)[ let c = func({ a: 1, b: "hello" }, { c: true }, 'c'); // boolean >c : boolean >func({ a: 1, b: "hello" }, { c: true }, 'c') : boolean ->func : (x: T, y: U, k: K) => (T & U)[K] +>func : (x: T, y: U, k: K) => (T & U)[K] >{ a: 1, b: "hello" } : { a: number; b: string; } >a : number >1 : 1 @@ -1837,7 +1837,7 @@ declare class Component1 { >Computed : Computed get(key: K): (Data & Computed)[K]; ->get : (key: K) => (Data & Computed)[K] +>get : (key: K) => (Data & Computed)[K] >K : K >Data : Data >Computed : Computed @@ -2035,9 +2035,9 @@ function onChangeGenericFunction(handler: Handler) { handler.onChange('preset') >handler.onChange('preset') : void ->handler.onChange : (name: keyof (T & { preset: number; })) => void +>handler.onChange : (name: keyof T | "preset") => void >handler : Handler ->onChange : (name: keyof (T & { preset: number; })) => void +>onChange : (name: keyof T | "preset") => void >'preset' : "preset" } diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt index 0b2da3f8e61..49f44115e72 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt @@ -22,11 +22,12 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(64,33): error tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(66,24): error TS2345: Argument of type '"size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(67,24): error TS2345: Argument of type '"name" | "size"' is not assignable to parameter of type '"name" | "width" | "height" | "visible"'. Type '"size"' is not assignable to type '"name" | "width" | "height" | "visible"'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(72,5): error TS2536: Type 'keyof (T & U)' cannot be used to index type 'T | U'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(72,5): error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(76,5): error TS2322: Type 'T | U' is not assignable to type 'T & U'. Type 'T' is not assignable to type 'T & U'. Type 'T' is not assignable to type 'U'. -tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(77,5): error TS2322: Type 'keyof (T & U)' is not assignable to type 'keyof (T | U)'. +tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(77,5): error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof (T | U)'. + Type 'keyof T' is not assignable to type 'keyof (T | U)'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(86,9): error TS2322: Type 'keyof T' is not assignable to type 'K'. tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(88,9): error TS2322: Type 'T[keyof T]' is not assignable to type 'T[K]'. Type 'keyof T' is not assignable to type 'K'. @@ -161,7 +162,7 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(100,5): error o1[k1]; o1[k2]; // Error ~~~~~~ -!!! error TS2536: Type 'keyof (T & U)' cannot be used to index type 'T | U'. +!!! error TS2536: Type 'keyof T | keyof U' cannot be used to index type 'T | U'. o2[k1]; o2[k2]; o1 = o2; @@ -172,7 +173,8 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(100,5): error !!! error TS2322: Type 'T' is not assignable to type 'U'. k1 = k2; // Error ~~ -!!! error TS2322: Type 'keyof (T & U)' is not assignable to type 'keyof (T | U)'. +!!! error TS2322: Type 'keyof T | keyof U' is not assignable to type 'keyof (T | U)'. +!!! error TS2322: Type 'keyof T' is not assignable to type 'keyof (T | U)'. k2 = k1; } diff --git a/tests/baselines/reference/keyofAndIndexedAccessErrors.types b/tests/baselines/reference/keyofAndIndexedAccessErrors.types index 0c51d3a575c..bcd3878013d 100644 --- a/tests/baselines/reference/keyofAndIndexedAccessErrors.types +++ b/tests/baselines/reference/keyofAndIndexedAccessErrors.types @@ -243,13 +243,13 @@ function f10(shape: Shape) { } function f20(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) { ->f20 : (k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) => void +>f20 : (k1: keyof (T | U), k2: keyof T | keyof U, o1: T | U, o2: T & U) => void >T : T >U : U >k1 : keyof (T | U) >T : T >U : U ->k2 : keyof (T & U) +>k2 : keyof T | keyof U >T : T >U : U >o1 : T | U @@ -265,9 +265,9 @@ function f20(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) { >k1 : keyof (T | U) o1[k2]; // Error ->o1[k2] : (T | U)[keyof (T & U)] +>o1[k2] : (T | U)[keyof T | keyof U] >o1 : T | U ->k2 : keyof (T & U) +>k2 : keyof T | keyof U o2[k1]; >o2[k1] : (T & U)[keyof (T | U)] @@ -275,9 +275,9 @@ function f20(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) { >k1 : keyof (T | U) o2[k2]; ->o2[k2] : (T & U)[keyof (T & U)] +>o2[k2] : (T & U)[keyof T | keyof U] >o2 : T & U ->k2 : keyof (T & U) +>k2 : keyof T | keyof U o1 = o2; >o1 = o2 : T & U @@ -290,13 +290,13 @@ function f20(k1: keyof (T | U), k2: keyof (T & U), o1: T | U, o2: T & U) { >o1 : T | U k1 = k2; // Error ->k1 = k2 : keyof (T & U) +>k1 = k2 : keyof T | keyof U >k1 : keyof (T | U) ->k2 : keyof (T & U) +>k2 : keyof T | keyof U k2 = k1; >k2 = k1 : keyof (T | U) ->k2 : keyof (T & U) +>k2 : keyof T | keyof U >k1 : keyof (T | U) } From 95bb156a3e3064ccc6c0a5fc5a92e652c84a7872 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 2 Mar 2018 09:26:52 -0800 Subject: [PATCH 280/298] Add tests --- .../types/keyof/keyofIntersection.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cases/conformance/types/keyof/keyofIntersection.ts diff --git a/tests/cases/conformance/types/keyof/keyofIntersection.ts b/tests/cases/conformance/types/keyof/keyofIntersection.ts new file mode 100644 index 00000000000..f570a873242 --- /dev/null +++ b/tests/cases/conformance/types/keyof/keyofIntersection.ts @@ -0,0 +1,29 @@ +// @strict: true +// @declaration: true + +type A = { a: string }; +type B = { b: string }; + +type T01 = keyof (A & B); // "a" | "b" +type T02 = keyof (T & B); // "b" | keyof T +type T03 = keyof (A & U); // "a" | keyof U +type T04 = keyof (T & U); // keyof T | keyof U +type T05 = T02
; // "a" | "b" +type T06 = T03; // "a" | "b" +type T07 = T04; // "a" | "b" + +// Repros from #22291 + +type Example1 = keyof (Record & Record); +type Result1 = Example1<'x', 'y'>; // "x" | "y" + +type Result2 = keyof (Record<'x', any> & Record<'y', any>); // "x" | "y" + +type Example3 = keyof (Record); +type Result3 = Example3<'x' | 'y'>; // "x" | "y" + +type Example4 = (Record & Record); +type Result4 = keyof Example4<'x', 'y'>; // "x" | "y" + +type Example5 = keyof (T & U); +type Result5 = Example5, Record<'y', any>>; // "x" | "y" From 886191390ed413ce70277e70063a5fa65c3fe901 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 2 Mar 2018 09:27:07 -0800 Subject: [PATCH 281/298] Accept new baselines --- .../baselines/reference/keyofIntersection.js | 56 ++++++++++ .../reference/keyofIntersection.symbols | 105 ++++++++++++++++++ .../reference/keyofIntersection.types | 105 ++++++++++++++++++ 3 files changed, 266 insertions(+) create mode 100644 tests/baselines/reference/keyofIntersection.js create mode 100644 tests/baselines/reference/keyofIntersection.symbols create mode 100644 tests/baselines/reference/keyofIntersection.types diff --git a/tests/baselines/reference/keyofIntersection.js b/tests/baselines/reference/keyofIntersection.js new file mode 100644 index 00000000000..3b6fc7eea1b --- /dev/null +++ b/tests/baselines/reference/keyofIntersection.js @@ -0,0 +1,56 @@ +//// [keyofIntersection.ts] +type A = { a: string }; +type B = { b: string }; + +type T01 = keyof (A & B); // "a" | "b" +type T02 = keyof (T & B); // "b" | keyof T +type T03 = keyof (A & U); // "a" | keyof U +type T04 = keyof (T & U); // keyof T | keyof U +type T05 = T02; // "a" | "b" +type T06 = T03; // "a" | "b" +type T07 = T04; // "a" | "b" + +// Repros from #22291 + +type Example1 = keyof (Record & Record); +type Result1 = Example1<'x', 'y'>; // "x" | "y" + +type Result2 = keyof (Record<'x', any> & Record<'y', any>); // "x" | "y" + +type Example3 = keyof (Record); +type Result3 = Example3<'x' | 'y'>; // "x" | "y" + +type Example4 = (Record & Record); +type Result4 = keyof Example4<'x', 'y'>; // "x" | "y" + +type Example5 = keyof (T & U); +type Result5 = Example5, Record<'y', any>>; // "x" | "y" + + +//// [keyofIntersection.js] +"use strict"; + + +//// [keyofIntersection.d.ts] +declare type A = { + a: string; +}; +declare type B = { + b: string; +}; +declare type T01 = keyof (A & B); +declare type T02 = keyof (T & B); +declare type T03 = keyof (A & U); +declare type T04 = keyof (T & U); +declare type T05 = T02; +declare type T06 = T03; +declare type T07 = T04; +declare type Example1 = keyof (Record & Record); +declare type Result1 = Example1<'x', 'y'>; +declare type Result2 = keyof (Record<'x', any> & Record<'y', any>); +declare type Example3 = keyof (Record); +declare type Result3 = Example3<'x' | 'y'>; +declare type Example4 = (Record & Record); +declare type Result4 = keyof Example4<'x', 'y'>; +declare type Example5 = keyof (T & U); +declare type Result5 = Example5, Record<'y', any>>; diff --git a/tests/baselines/reference/keyofIntersection.symbols b/tests/baselines/reference/keyofIntersection.symbols new file mode 100644 index 00000000000..aac8341f363 --- /dev/null +++ b/tests/baselines/reference/keyofIntersection.symbols @@ -0,0 +1,105 @@ +=== tests/cases/conformance/types/keyof/keyofIntersection.ts === +type A = { a: string }; +>A : Symbol(A, Decl(keyofIntersection.ts, 0, 0)) +>a : Symbol(a, Decl(keyofIntersection.ts, 0, 10)) + +type B = { b: string }; +>B : Symbol(B, Decl(keyofIntersection.ts, 0, 23)) +>b : Symbol(b, Decl(keyofIntersection.ts, 1, 10)) + +type T01 = keyof (A & B); // "a" | "b" +>T01 : Symbol(T01, Decl(keyofIntersection.ts, 1, 23)) +>A : Symbol(A, Decl(keyofIntersection.ts, 0, 0)) +>B : Symbol(B, Decl(keyofIntersection.ts, 0, 23)) + +type T02 = keyof (T & B); // "b" | keyof T +>T02 : Symbol(T02, Decl(keyofIntersection.ts, 3, 25)) +>T : Symbol(T, Decl(keyofIntersection.ts, 4, 9)) +>T : Symbol(T, Decl(keyofIntersection.ts, 4, 9)) +>B : Symbol(B, Decl(keyofIntersection.ts, 0, 23)) + +type T03 = keyof (A & U); // "a" | keyof U +>T03 : Symbol(T03, Decl(keyofIntersection.ts, 4, 28)) +>U : Symbol(U, Decl(keyofIntersection.ts, 5, 9)) +>A : Symbol(A, Decl(keyofIntersection.ts, 0, 0)) +>U : Symbol(U, Decl(keyofIntersection.ts, 5, 9)) + +type T04 = keyof (T & U); // keyof T | keyof U +>T04 : Symbol(T04, Decl(keyofIntersection.ts, 5, 28)) +>T : Symbol(T, Decl(keyofIntersection.ts, 6, 9)) +>U : Symbol(U, Decl(keyofIntersection.ts, 6, 11)) +>T : Symbol(T, Decl(keyofIntersection.ts, 6, 9)) +>U : Symbol(U, Decl(keyofIntersection.ts, 6, 11)) + +type T05 = T02; // "a" | "b" +>T05 : Symbol(T05, Decl(keyofIntersection.ts, 6, 31)) +>T02 : Symbol(T02, Decl(keyofIntersection.ts, 3, 25)) +>A : Symbol(A, Decl(keyofIntersection.ts, 0, 0)) + +type T06 = T03; // "a" | "b" +>T06 : Symbol(T06, Decl(keyofIntersection.ts, 7, 18)) +>T03 : Symbol(T03, Decl(keyofIntersection.ts, 4, 28)) +>B : Symbol(B, Decl(keyofIntersection.ts, 0, 23)) + +type T07 = T04; // "a" | "b" +>T07 : Symbol(T07, Decl(keyofIntersection.ts, 8, 18)) +>T04 : Symbol(T04, Decl(keyofIntersection.ts, 5, 28)) +>A : Symbol(A, Decl(keyofIntersection.ts, 0, 0)) +>B : Symbol(B, Decl(keyofIntersection.ts, 0, 23)) + +// Repros from #22291 + +type Example1 = keyof (Record & Record); +>Example1 : Symbol(Example1, Decl(keyofIntersection.ts, 9, 21)) +>T : Symbol(T, Decl(keyofIntersection.ts, 13, 14)) +>U : Symbol(U, Decl(keyofIntersection.ts, 13, 31)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(keyofIntersection.ts, 13, 14)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>U : Symbol(U, Decl(keyofIntersection.ts, 13, 31)) + +type Result1 = Example1<'x', 'y'>; // "x" | "y" +>Result1 : Symbol(Result1, Decl(keyofIntersection.ts, 13, 92)) +>Example1 : Symbol(Example1, Decl(keyofIntersection.ts, 9, 21)) + +type Result2 = keyof (Record<'x', any> & Record<'y', any>); // "x" | "y" +>Result2 : Symbol(Result2, Decl(keyofIntersection.ts, 14, 34)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) + +type Example3 = keyof (Record); +>Example3 : Symbol(Example3, Decl(keyofIntersection.ts, 16, 59)) +>T : Symbol(T, Decl(keyofIntersection.ts, 18, 14)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(keyofIntersection.ts, 18, 14)) + +type Result3 = Example3<'x' | 'y'>; // "x" | "y" +>Result3 : Symbol(Result3, Decl(keyofIntersection.ts, 18, 57)) +>Example3 : Symbol(Example3, Decl(keyofIntersection.ts, 16, 59)) + +type Example4 = (Record & Record); +>Example4 : Symbol(Example4, Decl(keyofIntersection.ts, 19, 35)) +>T : Symbol(T, Decl(keyofIntersection.ts, 21, 14)) +>U : Symbol(U, Decl(keyofIntersection.ts, 21, 31)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>T : Symbol(T, Decl(keyofIntersection.ts, 21, 14)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>U : Symbol(U, Decl(keyofIntersection.ts, 21, 31)) + +type Result4 = keyof Example4<'x', 'y'>; // "x" | "y" +>Result4 : Symbol(Result4, Decl(keyofIntersection.ts, 21, 86)) +>Example4 : Symbol(Example4, Decl(keyofIntersection.ts, 19, 35)) + +type Example5 = keyof (T & U); +>Example5 : Symbol(Example5, Decl(keyofIntersection.ts, 22, 40)) +>T : Symbol(T, Decl(keyofIntersection.ts, 24, 14)) +>U : Symbol(U, Decl(keyofIntersection.ts, 24, 16)) +>T : Symbol(T, Decl(keyofIntersection.ts, 24, 14)) +>U : Symbol(U, Decl(keyofIntersection.ts, 24, 16)) + +type Result5 = Example5, Record<'y', any>>; // "x" | "y" +>Result5 : Symbol(Result5, Decl(keyofIntersection.ts, 24, 36)) +>Example5 : Symbol(Example5, Decl(keyofIntersection.ts, 22, 40)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/keyofIntersection.types b/tests/baselines/reference/keyofIntersection.types new file mode 100644 index 00000000000..f9c312b4120 --- /dev/null +++ b/tests/baselines/reference/keyofIntersection.types @@ -0,0 +1,105 @@ +=== tests/cases/conformance/types/keyof/keyofIntersection.ts === +type A = { a: string }; +>A : A +>a : string + +type B = { b: string }; +>B : B +>b : string + +type T01 = keyof (A & B); // "a" | "b" +>T01 : "b" | "a" +>A : A +>B : B + +type T02 = keyof (T & B); // "b" | keyof T +>T02 : keyof T | "b" +>T : T +>T : T +>B : B + +type T03 = keyof (A & U); // "a" | keyof U +>T03 : "a" | keyof U +>U : U +>A : A +>U : U + +type T04 = keyof (T & U); // keyof T | keyof U +>T04 : keyof T | keyof U +>T : T +>U : U +>T : T +>U : U + +type T05 = T02; // "a" | "b" +>T05 : "b" | "a" +>T02 : keyof T | "b" +>A : A + +type T06 = T03; // "a" | "b" +>T06 : "b" | "a" +>T03 : "a" | keyof U +>B : B + +type T07 = T04; // "a" | "b" +>T07 : "b" | "a" +>T04 : keyof T | keyof U +>A : A +>B : B + +// Repros from #22291 + +type Example1 = keyof (Record & Record); +>Example1 : T | U +>T : T +>U : U +>Record : Record +>T : T +>Record : Record +>U : U + +type Result1 = Example1<'x', 'y'>; // "x" | "y" +>Result1 : "x" | "y" +>Example1 : T | U + +type Result2 = keyof (Record<'x', any> & Record<'y', any>); // "x" | "y" +>Result2 : "x" | "y" +>Record : Record +>Record : Record + +type Example3 = keyof (Record); +>Example3 : T +>T : T +>Record : Record +>T : T + +type Result3 = Example3<'x' | 'y'>; // "x" | "y" +>Result3 : "x" | "y" +>Example3 : T + +type Example4 = (Record & Record); +>Example4 : Record & Record +>T : T +>U : U +>Record : Record +>T : T +>Record : Record +>U : U + +type Result4 = keyof Example4<'x', 'y'>; // "x" | "y" +>Result4 : "x" | "y" +>Example4 : Record & Record + +type Example5 = keyof (T & U); +>Example5 : keyof T | keyof U +>T : T +>U : U +>T : T +>U : U + +type Result5 = Example5, Record<'y', any>>; // "x" | "y" +>Result5 : "x" | "y" +>Example5 : keyof T | keyof U +>Record : Record +>Record : Record + From b90cdb2221521b7cbfa5fabb833139336d3cbbd3 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 2 Mar 2018 10:22:52 -0800 Subject: [PATCH 282/298] Reduce duplicate code for TextChange overlaps (#22278) --- src/compiler/utilities.ts | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 040001c4fdd..8108d0f1692 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3759,27 +3759,20 @@ namespace ts { } export function textSpanOverlapsWith(span: TextSpan, other: TextSpan) { - const overlapStart = Math.max(span.start, other.start); - const overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; + return textSpanOverlap(span, other) !== undefined; } export function textSpanOverlap(span1: TextSpan, span2: TextSpan) { - const overlapStart = Math.max(span1.start, span2.start); - const overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; + const overlap = textSpanIntersection(span1, span2); + return overlap && overlap.length === 0 ? undefined : overlap; } export function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length); } export function textSpanIntersectsWith(span: TextSpan, start: number, length: number) { - const end = start + length; - return start <= textSpanEnd(span) && end >= span.start; + return decodedTextSpanIntersectsWith(span.start, span.length, start, length); } export function decodedTextSpanIntersectsWith(start1: number, length1: number, start2: number, length2: number) { @@ -3793,12 +3786,9 @@ namespace ts { } export function textSpanIntersection(span1: TextSpan, span2: TextSpan) { - const intersectStart = Math.max(span1.start, span2.start); - const intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; + const start = Math.max(span1.start, span2.start); + const end = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + return start <= end ? createTextSpanFromBounds(start, end) : undefined; } export function createTextSpan(start: number, length: number): TextSpan { From dd27288e5ab087130a34a4f724961ee2f9e15fb2 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 2 Mar 2018 10:23:08 -0800 Subject: [PATCH 283/298] Don't rename static 'this' when renaming class (#22235) --- src/services/findAllReferences.ts | 2 +- tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index ee4f44d31db..7faf4e2b7f9 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -1010,7 +1010,7 @@ namespace ts.FindAllReferences.Core { function addClassStaticThisReferences(referenceLocation: Node, search: Search, state: State): void { addReference(referenceLocation, search.symbol, state); - if (isClassLike(referenceLocation.parent)) { + if (!state.options.isForRename && isClassLike(referenceLocation.parent)) { Debug.assert(referenceLocation.parent.name === referenceLocation); // This is the class declaration. addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol)); diff --git a/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts b/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts index 9bb128e4556..4802ca40448 100644 --- a/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts +++ b/tests/cases/fourslash/findAllRefsClassWithStaticThisAccess.ts @@ -9,4 +9,6 @@ const [r0, r1, r2] = test.ranges(); verify.referenceGroups(r0, [{ definition: "class C", ranges: [r0, r1, r2] }]); -verify.referenceGroups([r1, r2], [{ definition: "this: typeof C", ranges: [r1, r2] }]); +verify.singleReferenceGroup("this: typeof C", [r1, r2]); + +verify.renameLocations(r0, [r0]); From b15157356a6d8b9fe57beed09021af41620ccaa8 Mon Sep 17 00:00:00 2001 From: Wenlu Wang Date: Sat, 3 Mar 2018 02:24:55 +0800 Subject: [PATCH 284/298] add spelling suggestion support for module import (#22283) --- src/compiler/checker.ts | 15 ++++++++++++- src/compiler/diagnosticMessages.json | 4 ++++ .../exportSpellingSuggestion.errors.txt | 13 ++++++++++++ .../reference/exportSpellingSuggestion.js | 21 +++++++++++++++++++ .../exportSpellingSuggestion.symbols | 15 +++++++++++++ .../reference/exportSpellingSuggestion.types | 18 ++++++++++++++++ .../es6/modules/exportSpellingSuggestion.ts | 7 +++++++ 7 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/exportSpellingSuggestion.errors.txt create mode 100644 tests/baselines/reference/exportSpellingSuggestion.js create mode 100644 tests/baselines/reference/exportSpellingSuggestion.symbols create mode 100644 tests/baselines/reference/exportSpellingSuggestion.types create mode 100644 tests/cases/conformance/es6/modules/exportSpellingSuggestion.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 515789a3fd7..3bc2ffe8f15 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1857,7 +1857,15 @@ namespace ts { combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name, Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), declarationNameToString(name)); + const moduleName = getFullyQualifiedName(moduleSymbol); + const declarationName = declarationNameToString(name); + const suggestion = getSuggestionForNonexistentModule(name, targetSymbol); + if (suggestion !== undefined) { + error(name, Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestion); + } + else { + error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); + } } return symbol; } @@ -16218,6 +16226,11 @@ namespace ts { return result && symbolName(result); } + function getSuggestionForNonexistentModule(name: Identifier, targetModule: Symbol): string | undefined { + const suggestion = targetModule.exports && getSpellingSuggestionForName(idText(name), getExportsOfModuleAsArray(targetModule), SymbolFlags.ModuleMember); + return suggestion && symbolName(suggestion); + } + /** * Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough. * Names less than length 3 only check for case-insensitive equality, not levenshtein distance. diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index ced3699c6d4..a76a71fb407 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2317,6 +2317,10 @@ "category": "Error", "code": 2723 }, + "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?": { + "category": "Error", + "code": 2724 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 diff --git a/tests/baselines/reference/exportSpellingSuggestion.errors.txt b/tests/baselines/reference/exportSpellingSuggestion.errors.txt new file mode 100644 index 00000000000..fefae723515 --- /dev/null +++ b/tests/baselines/reference/exportSpellingSuggestion.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/modules/b.ts(1,10): error TS2724: Module '"tests/cases/conformance/es6/modules/a"' has no exported member 'assertNevar'. Did you mean 'assertNever'? + + +==== tests/cases/conformance/es6/modules/a.ts (0 errors) ==== + export function assertNever(x: never, msg: string) { + throw new Error("Unexpected " + msg); + } + +==== tests/cases/conformance/es6/modules/b.ts (1 errors) ==== + import { assertNevar } from "./a"; + ~~~~~~~~~~~ +!!! error TS2724: Module '"tests/cases/conformance/es6/modules/a"' has no exported member 'assertNevar'. Did you mean 'assertNever'? + \ No newline at end of file diff --git a/tests/baselines/reference/exportSpellingSuggestion.js b/tests/baselines/reference/exportSpellingSuggestion.js new file mode 100644 index 00000000000..66bf80f6094 --- /dev/null +++ b/tests/baselines/reference/exportSpellingSuggestion.js @@ -0,0 +1,21 @@ +//// [tests/cases/conformance/es6/modules/exportSpellingSuggestion.ts] //// + +//// [a.ts] +export function assertNever(x: never, msg: string) { + throw new Error("Unexpected " + msg); +} + +//// [b.ts] +import { assertNevar } from "./a"; + + +//// [a.js] +"use strict"; +exports.__esModule = true; +function assertNever(x, msg) { + throw new Error("Unexpected " + msg); +} +exports.assertNever = assertNever; +//// [b.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/exportSpellingSuggestion.symbols b/tests/baselines/reference/exportSpellingSuggestion.symbols new file mode 100644 index 00000000000..ad22b4bbeb0 --- /dev/null +++ b/tests/baselines/reference/exportSpellingSuggestion.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es6/modules/a.ts === +export function assertNever(x: never, msg: string) { +>assertNever : Symbol(assertNever, Decl(a.ts, 0, 0)) +>x : Symbol(x, Decl(a.ts, 0, 28)) +>msg : Symbol(msg, Decl(a.ts, 0, 37)) + + throw new Error("Unexpected " + msg); +>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>msg : Symbol(msg, Decl(a.ts, 0, 37)) +} + +=== tests/cases/conformance/es6/modules/b.ts === +import { assertNevar } from "./a"; +>assertNevar : Symbol(assertNevar, Decl(b.ts, 0, 8)) + diff --git a/tests/baselines/reference/exportSpellingSuggestion.types b/tests/baselines/reference/exportSpellingSuggestion.types new file mode 100644 index 00000000000..134da4d700b --- /dev/null +++ b/tests/baselines/reference/exportSpellingSuggestion.types @@ -0,0 +1,18 @@ +=== tests/cases/conformance/es6/modules/a.ts === +export function assertNever(x: never, msg: string) { +>assertNever : (x: never, msg: string) => void +>x : never +>msg : string + + throw new Error("Unexpected " + msg); +>new Error("Unexpected " + msg) : Error +>Error : ErrorConstructor +>"Unexpected " + msg : string +>"Unexpected " : "Unexpected " +>msg : string +} + +=== tests/cases/conformance/es6/modules/b.ts === +import { assertNevar } from "./a"; +>assertNevar : any + diff --git a/tests/cases/conformance/es6/modules/exportSpellingSuggestion.ts b/tests/cases/conformance/es6/modules/exportSpellingSuggestion.ts new file mode 100644 index 00000000000..c6373270869 --- /dev/null +++ b/tests/cases/conformance/es6/modules/exportSpellingSuggestion.ts @@ -0,0 +1,7 @@ +// @filename: a.ts +export function assertNever(x: never, msg: string) { + throw new Error("Unexpected " + msg); +} + +// @filename: b.ts +import { assertNevar } from "./a"; From ba8879d005b8e0ec08da39ae72599d526fddbfeb Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 2 Mar 2018 10:44:06 -0800 Subject: [PATCH 285/298] Prefer 'return Debug.fail()' over 'throw Debug.fail()' (#22092) --- src/compiler/checker.ts | 6 +++--- src/compiler/visitor.ts | 4 ++-- src/services/classifier.ts | 4 ++-- src/services/codefixes/importFixes.ts | 2 +- src/services/codefixes/inferFromUsage.ts | 2 +- src/services/completions.ts | 4 ++-- src/services/jsTyping.ts | 2 +- src/services/textChanges.ts | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3bc2ffe8f15..fa2bd8d3b2e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15333,7 +15333,7 @@ namespace ts { const intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node); if (intrinsicElementsType !== unknownType) { // Property case - if (!isIdentifier(node.tagName)) throw Debug.fail(); + if (!isIdentifier(node.tagName)) return Debug.fail(); const intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText); if (intrinsicProp) { links.jsxFlags |= JsxFlags.IntrinsicNamedElement; @@ -18106,7 +18106,7 @@ namespace ts { } // Make sure require is not a local function - if (!isIdentifier(node.expression)) throw Debug.fail(); + if (!isIdentifier(node.expression)) return Debug.fail(); const resolvedRequire = resolveName(node.expression, node.expression.escapedText, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); if (!resolvedRequire) { // project does not contain symbol named 'require' - assume commonjs require @@ -21841,7 +21841,7 @@ namespace ts { const symbol = getSymbolOfNode(node); if (symbol.flags & SymbolFlags.FunctionScopedVariable) { - if (!isIdentifier(node.name)) throw Debug.fail(); + if (!isIdentifier(node.name)) return Debug.fail(); const localDeclarationSymbol = resolveName(node, node.name.escapedText, SymbolFlags.Variable, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts index 9c1462e7ec6..dbaf28a23aa 100644 --- a/src/compiler/visitor.ts +++ b/src/compiler/visitor.ts @@ -1545,10 +1545,10 @@ namespace ts { let isDebugInfoEnabled = false; export const failBadSyntaxKind = shouldAssert(AssertionLevel.Normal) - ? (node: Node, message?: string): void => fail( + ? (node: Node, message?: string): never => fail( `${message || "Unexpected node."}\r\nNode ${formatSyntaxKind(node.kind)} was unexpected.`, failBadSyntaxKind) - : noop; + : noop as () => never; // TODO: GH#22091 export const assertEachNode = shouldAssert(AssertionLevel.Normal) ? (nodes: Node[], test: (node: Node) => boolean, message?: string): void => assert( diff --git a/src/services/classifier.ts b/src/services/classifier.ts index 4a8721154cb..89c96a45021 100644 --- a/src/services/classifier.ts +++ b/src/services/classifier.ts @@ -224,7 +224,7 @@ namespace ts { case SyntaxKind.NoSubstitutionTemplateLiteral: return EndOfLineState.InTemplateHeadOrNoSubstitutionTemplate; default: - throw Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); + return Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); } } return lastOnTemplateStack === SyntaxKind.TemplateHead ? EndOfLineState.InTemplateSubstitutionPosition : undefined; @@ -343,7 +343,7 @@ namespace ts { case EndOfLineState.None: return { prefix: "" }; default: - throw Debug.assertNever(lexState); + return Debug.assertNever(lexState); } } diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index 4c43d323848..5368a36346b 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -699,7 +699,7 @@ namespace ts.codefix { // Fall back to the `import * as ns` style import. return ImportKind.Namespace; default: - throw Debug.assertNever(moduleKind); + return Debug.assertNever(moduleKind); } } diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index dd47f96e62a..b5a9e15f5a4 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -109,7 +109,7 @@ namespace ts.codefix { return isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, program, cancellationToken) : undefined; default: - throw Debug.fail(String(errorCode)); + return Debug.fail(String(errorCode)); } } diff --git a/src/services/completions.ts b/src/services/completions.ts index 9470381bd24..e16cbe9cde6 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -69,7 +69,7 @@ namespace ts.Completions { case CompletionDataKind.JsDocParameterName: return jsdocCompletionInfo(JsDoc.getJSDocParameterNameCompletions(completionData.tag)); default: - throw Debug.assertNever(completionData); + return Debug.assertNever(completionData); } } @@ -1453,7 +1453,7 @@ namespace ts.Completions { isNewIdentifierLocation = false; const rootDeclaration = getRootDeclaration(objectLikeContainer.parent); - if (!isVariableLike(rootDeclaration)) throw Debug.fail("Root declaration is not variable-like."); + if (!isVariableLike(rootDeclaration)) return Debug.fail("Root declaration is not variable-like."); // We don't want to complete using the type acquired by the shape // of the binding pattern; we are only interested in types acquired diff --git a/src/services/jsTyping.ts b/src/services/jsTyping.ts index 0d78ed92fab..393b8ca34e0 100644 --- a/src/services/jsTyping.ts +++ b/src/services/jsTyping.ts @@ -318,7 +318,7 @@ namespace ts.JsTyping { case PackageNameValidationResult.NameContainsNonURISafeCharacters: return `Package name '${typing}' contains non URI safe characters`; case PackageNameValidationResult.Ok: - throw Debug.fail(); // Shouldn't have called this. + return Debug.fail(); // Shouldn't have called this. default: Debug.assertNever(result); } diff --git a/src/services/textChanges.ts b/src/services/textChanges.ts index 3ad3d6d57c6..133fd8f96bd 100644 --- a/src/services/textChanges.ts +++ b/src/services/textChanges.ts @@ -346,7 +346,7 @@ namespace ts.textChanges { else if (isVariableDeclaration(before)) { // insert `x = 1, ` into `const x = 1, y = 2; return { suffix: ", " }; } - throw Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it + return Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it } public insertNodeAtConstructorStart(sourceFile: SourceFile, ctr: ConstructorDeclaration, newStatement: Statement): void { @@ -430,7 +430,7 @@ namespace ts.textChanges { else if (isVariableDeclaration(node)) { return { prefix: ", " }; } - throw Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it + return Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it } /** From 81c313ef1903059ce98b080c6fa578f826a1d561 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Fri, 2 Mar 2018 10:56:04 -0800 Subject: [PATCH 286/298] Update baselines for user tests (#22276) --- .../reference/user/chrome-devtools-frontend.log | 16 ++-------------- tests/baselines/reference/user/leveldown.log | 8 -------- tests/baselines/reference/user/sift.log | 8 -------- 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 tests/baselines/reference/user/leveldown.log delete mode 100644 tests/baselines/reference/user/sift.log diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index ff54d52ea86..1d046e53073 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -18,12 +18,9 @@ Standard output: node_modules/chrome-devtools-frontend/front_end/Runtime.js(43,8): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(95,28): error TS2339: Property 'response' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(147,37): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/Runtime.js(158,21): error TS2345: Argument of type 'Promise' is not assignable to parameter of type 'Promise'. - Type 'string' is not assignable to type 'undefined'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(161,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. Type 'undefined[]' is not assignable to type 'undefined'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(187,12): error TS2339: Property 'eval' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/Runtime.js(197,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(219,13): error TS2339: Property 'timeStamp' does not exist on type 'Console'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(267,14): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(269,59): error TS2339: Property 'runtime' does not exist on type 'Window'. @@ -3655,8 +3652,6 @@ node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(341, node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(351,31): error TS2694: Namespace 'Protocol' has no exported member 'Debugger'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(362,31): error TS2694: Namespace 'Protocol' has no exported member 'Debugger'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(375,9): error TS2322: Type 'Promise' is not assignable to type 'Promise'. -node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(378,9): error TS2322: Type 'Promise' is not assignable to type 'Promise'. -node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(381,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(43,52): error TS2339: Property 'Storage' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(49,89): error TS2694: Namespace 'Bindings' has no exported member 'BreakpointManager'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(51,63): error TS2694: Namespace 'Bindings' has no exported member 'BreakpointManager'. @@ -8056,7 +8051,6 @@ node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(28 node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(2906,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(2910,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(2918,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. -node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(2956,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(2977,107): error TS1003: Identifier expected. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(2978,35): error TS2300: Duplicate identifier 'Context'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(2978,35): error TS2339: Property 'Context' does not exist on type 'typeof (Anonymous class)'. @@ -13090,9 +13084,9 @@ node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1057,39): node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1108,15): error TS2339: Property 'valuesArray' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1116,15): error TS2339: Property 'firstValue' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1126,15): error TS2339: Property 'addAll' does not exist on type 'Set'. -node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1127,17): error TS2495: Type 'Iterable | T[]' is not an array type or a string type. +node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1127,17): error TS2495: Type 'T[] | Iterable' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1136,15): error TS2339: Property 'containsAll' does not exist on type 'Set'. -node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1137,17): error TS2495: Type 'Iterable | T[]' is not an array type or a string type. +node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1137,17): error TS2495: Type 'T[] | Iterable' is not an array type or a string type. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1148,15): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1155,21): error TS2304: Cannot find name 'VALUE'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(1157,15): error TS2339: Property 'valuesArray' does not exist on type 'Map'. @@ -16337,10 +16331,6 @@ node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1153,31): er node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1176,31): error TS2694: Namespace 'Protocol' has no exported member 'Runtime'. node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1234,21): error TS2694: Namespace 'SDK' has no exported member 'CallFunctionResult'. node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1265,21): error TS2694: Namespace 'SDK' has no exported member 'CallFunctionResult'. -node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1325,5): error TS2322: Type 'Promise<{ properties: (Anonymous class)[]; internalProperties: (Anonymous class)[]; }>' is not assignable to type 'Promise<(Anonymous class)>'. -node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1325,5): error TS2322: Type 'Promise<{ properties: (Anonymous class)[]; internalProperties: (Anonymous class)[]; }>' is not assignable to type 'Promise<(Anonymous class)>'. - Type '{ properties: (Anonymous class)[]; internalProperties: (Anonymous class)[]; }' is not assignable to type '(Anonymous class)'. - Property 'customPreview' is missing in type '{ properties: (Anonymous class)[]; internalProperties: (Anonymous class)[]; }'. node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1345,29): error TS2694: Namespace 'SDK' has no exported member 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1352,31): error TS2694: Namespace 'SDK' has no exported member 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/sdk/RemoteObject.js(1363,21): error TS2694: Namespace 'SDK' has no exported member 'DebuggerModel'. @@ -18006,12 +17996,10 @@ node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSid node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(73,36): error TS2339: Property 'createChild' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(74,56): error TS2339: Property '_snippetElementSymbol' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(77,51): error TS2339: Property 'get' does not exist on type '{ _map: Map>; }'. -node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(78,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'uiLocation' must be of type '(Anonymous class)', but here has type 'any'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(91,13): error TS2339: Property 'remove' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(110,54): error TS2339: Property '_locationSymbol' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(113,74): error TS2339: Property '_checkboxLabelSymbol' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(118,75): error TS2339: Property '_snippetElementSymbol' does not exist on type 'typeof (Anonymous class)'. -node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(119,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(141,29): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(144,58): error TS2339: Property '_locationSymbol' does not exist on type 'typeof (Anonymous class)'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(156,33): error TS2339: Property 'checkboxElement' does not exist on type 'EventTarget'. diff --git a/tests/baselines/reference/user/leveldown.log b/tests/baselines/reference/user/leveldown.log deleted file mode 100644 index 170ed7ca0a3..00000000000 --- a/tests/baselines/reference/user/leveldown.log +++ /dev/null @@ -1,8 +0,0 @@ -Exit Code: 1 -Standard output: -node_modules/abstract-leveldown/index.d.ts(43,27): error TS1005: ',' expected. -node_modules/abstract-leveldown/index.d.ts(43,28): error TS1139: Type parameter declaration expected. - - - -Standard error: diff --git a/tests/baselines/reference/user/sift.log b/tests/baselines/reference/user/sift.log deleted file mode 100644 index 62386ea0fca..00000000000 --- a/tests/baselines/reference/user/sift.log +++ /dev/null @@ -1,8 +0,0 @@ -Exit Code: 1 -Standard output: -node_modules/sift/index.d.ts(22,54): error TS2344: Type 'T[0][index]' does not satisfy the constraint 'any[]'. -node_modules/sift/index.d.ts(32,35): error TS2344: Type 'T[0][P]' does not satisfy the constraint 'any[]'. - - - -Standard error: From 87c3cca3f0fe12ed53a20369de555cd69af16e27 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 2 Mar 2018 12:57:29 -0800 Subject: [PATCH 287/298] Make convertFunctionToEs6Class a codefix (#22241) * Make convertFunctionToEs6Class a codefix * Change diagnostic message --- src/compiler/diagnosticMessages.json | 4 + .../convertFunctionToEs6Class.ts | 125 ++++++------------ src/services/codefixes/fixes.ts | 1 + src/services/refactors/refactors.ts | 1 - src/services/suggestionDiagnostics.ts | 16 +++ .../fourslash/convertFunctionToEs6Class1.ts | 30 +++-- .../fourslash/convertFunctionToEs6Class2.ts | 25 ++-- .../fourslash/convertFunctionToEs6Class3.ts | 25 ++-- .../convertFunctionToEs6ClassJsDoc.ts | 42 +++--- .../convertFunctionToEs6Class_asyncMethods.ts | 7 +- ...nvertFunctionToEs6Class_emptySwitchCase.ts | 7 +- ...nvertFunctionToEs6Class_exportModifier1.ts | 7 +- ...nvertFunctionToEs6Class_exportModifier2.ts | 9 +- ...ToEs6Class_objectLiteralInArrowFunction.ts | 7 +- .../convertToEs6Class_emptyCatchClause.ts | 7 +- .../convertFunctionToEs6Class-server.ts | 8 +- 16 files changed, 160 insertions(+), 161 deletions(-) rename src/services/{refactors => codefixes}/convertFunctionToEs6Class.ts (71%) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index a76a71fb407..8b6f0edb059 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3822,6 +3822,10 @@ "category": "Suggestion", "code": 80001 }, + "This constructor function may be converted to a class declaration.": { + "category": "Suggestion", + "code": 80002 + }, "Add missing 'super()' call": { "category": "Message", diff --git a/src/services/refactors/convertFunctionToEs6Class.ts b/src/services/codefixes/convertFunctionToEs6Class.ts similarity index 71% rename from src/services/refactors/convertFunctionToEs6Class.ts rename to src/services/codefixes/convertFunctionToEs6Class.ts index ddb13c3e04c..67098a0a4dc 100644 --- a/src/services/refactors/convertFunctionToEs6Class.ts +++ b/src/services/codefixes/convertFunctionToEs6Class.ts @@ -1,59 +1,28 @@ /* @internal */ +namespace ts.codefix { + const fixId = "convertFunctionToEs6Class"; + const errorCodes = [Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code]; + registerCodeFix({ + errorCodes, + getCodeActions(context: CodeFixContext) { + const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, context.span.start, context.program.getTypeChecker())); + return [{ description: getLocaleSpecificMessage(Diagnostics.Convert_function_to_an_ES2015_class), changes, fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, err) => doChange(changes, err.file!, err.start, context.program.getTypeChecker())), + }); -namespace ts.refactor.convertFunctionToES6Class { - const refactorName = "Convert to ES2015 class"; - const actionName = "convert"; - const description = Diagnostics.Convert_function_to_an_ES2015_class.message; - registerRefactor(refactorName, { getEditsForAction, getAvailableActions }); - - function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined { - if (!isInJavaScriptFile(context.file)) { - return undefined; - } - - let symbol = getConstructorSymbol(context); - if (!symbol) { - return undefined; - } - - if (isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = (symbol.valueDeclaration as VariableDeclaration).initializer.symbol; - } - - if ((symbol.flags & SymbolFlags.Function) && symbol.members && (symbol.members.size > 0)) { - return [ - { - name: refactorName, - description, - actions: [ - { - description, - name: actionName - } - ] - } - ]; - } - } - - function getEditsForAction(context: RefactorContext, action: string): RefactorEditInfo | undefined { - // Somehow wrong action got invoked? - if (actionName !== action) { - return undefined; - } - - const { file: sourceFile } = context; - const ctorSymbol = getConstructorSymbol(context); - + function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, position: number, checker: TypeChecker): void { const deletedNodes: Node[] = []; - const deletes: (() => any)[] = []; + const deletes: (() => void)[] = []; + const ctorSymbol = checker.getSymbolAtLocation(getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false)); - if (!(ctorSymbol.flags & (SymbolFlags.Function | SymbolFlags.Variable))) { + if (!ctorSymbol || !(ctorSymbol.flags & (SymbolFlags.Function | SymbolFlags.Variable))) { + // Bad input return undefined; } const ctorDeclaration = ctorSymbol.valueDeclaration; - const changeTracker = textChanges.ChangeTracker.fromContext(context); let precedingNode: Node; let newClassDeclaration: ClassDeclaration; @@ -81,17 +50,11 @@ namespace ts.refactor.convertFunctionToES6Class { } // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); + changes.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); for (const deleteCallback of deletes) { deleteCallback(); } - return { - edits: changeTracker.getChanges(), - renameFilename: undefined, - renameLocation: undefined, - }; - function deleteNode(node: Node, inList = false) { if (deletedNodes.some(n => isNodeDescendantOf(node, n))) { // Parent node has already been deleted; do nothing @@ -99,10 +62,10 @@ namespace ts.refactor.convertFunctionToES6Class { } deletedNodes.push(node); if (inList) { - deletes.push(() => changeTracker.deleteNodeInList(sourceFile, node)); + deletes.push(() => changes.deleteNodeInList(sourceFile, node)); } else { - deletes.push(() => changeTracker.deleteNode(sourceFile, node)); + deletes.push(() => changes.deleteNode(sourceFile, node)); } } @@ -165,7 +128,7 @@ namespace ts.refactor.convertFunctionToES6Class { const fullModifiers = concatenate(modifiers, getModifierKindFromSource(functionExpression, SyntaxKind.AsyncKeyword)); const method = createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); - copyComments(assignmentBinaryExpression, method); + copyComments(assignmentBinaryExpression, method, sourceFile); return method; } @@ -185,7 +148,7 @@ namespace ts.refactor.convertFunctionToES6Class { const fullModifiers = concatenate(modifiers, getModifierKindFromSource(arrowFunction, SyntaxKind.AsyncKeyword)); const method = createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); - copyComments(assignmentBinaryExpression, method); + copyComments(assignmentBinaryExpression, method, sourceFile); return method; } @@ -196,29 +159,13 @@ namespace ts.refactor.convertFunctionToES6Class { } const prop = createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, /*type*/ undefined, assignmentBinaryExpression.right); - copyComments(assignmentBinaryExpression.parent, prop); + copyComments(assignmentBinaryExpression.parent, prop, sourceFile); return prop; } } } } - function copyComments(sourceNode: Node, targetNode: Node) { - forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, (pos, end, kind, htnl) => { - if (kind === SyntaxKind.MultiLineCommentTrivia) { - // Remove leading /* - pos += 2; - // Remove trailing */ - end -= 2; - } - else { - // Remove leading // - pos += 2; - } - addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); - }); - } - function createClassFromVariableDeclaration(node: VariableDeclaration): ClassDeclaration { const initializer = node.initializer as FunctionExpression; if (!initializer || initializer.kind !== SyntaxKind.FunctionExpression) { @@ -253,15 +200,25 @@ namespace ts.refactor.convertFunctionToES6Class { // Don't call copyComments here because we'll already leave them in place return cls; } - - function getModifierKindFromSource(source: Node, kind: SyntaxKind) { - return filter(source.modifiers, modifier => modifier.kind === kind); - } } - function getConstructorSymbol({ startPosition, file, program }: RefactorContext): Symbol { - const checker = program.getTypeChecker(); - const token = getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - return checker.getSymbolAtLocation(token); + function copyComments(sourceNode: Node, targetNode: Node, sourceFile: SourceFile) { + forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, (pos, end, kind, htnl) => { + if (kind === SyntaxKind.MultiLineCommentTrivia) { + // Remove leading /* + pos += 2; + // Remove trailing */ + end -= 2; + } + else { + // Remove leading // + pos += 2; + } + addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); + }); + } + + function getModifierKindFromSource(source: Node, kind: SyntaxKind): ReadonlyArray { + return filter(source.modifiers, modifier => modifier.kind === kind); } } \ No newline at end of file diff --git a/src/services/codefixes/fixes.ts b/src/services/codefixes/fixes.ts index 24b726717a0..27435a56dbf 100644 --- a/src/services/codefixes/fixes.ts +++ b/src/services/codefixes/fixes.ts @@ -1,4 +1,5 @@ /// +/// /// /// /// diff --git a/src/services/refactors/refactors.ts b/src/services/refactors/refactors.ts index bc82b2a2473..c63f66dbbb8 100644 --- a/src/services/refactors/refactors.ts +++ b/src/services/refactors/refactors.ts @@ -1,4 +1,3 @@ /// -/// /// /// diff --git a/src/services/suggestionDiagnostics.ts b/src/services/suggestionDiagnostics.ts index 2588dee2726..bb6e510d2fd 100644 --- a/src/services/suggestionDiagnostics.ts +++ b/src/services/suggestionDiagnostics.ts @@ -9,6 +9,22 @@ namespace ts { diags.push(createDiagnosticForNode(sourceFile.commonJsModuleIndicator, Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)); } + function check(node: Node) { + switch (node.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.FunctionExpression: + const symbol = node.symbol; + if (symbol.members && (symbol.members.size > 0)) { + diags.push(createDiagnosticForNode(isVariableDeclaration(node.parent) ? node.parent.name : node, Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); + } + break; + } + node.forEachChild(check); + } + if (isInJavaScriptFile(sourceFile)) { + check(sourceFile); + } + return diags.concat(checker.getSuggestionDiagnostics(sourceFile)); } } diff --git a/tests/cases/fourslash/convertFunctionToEs6Class1.ts b/tests/cases/fourslash/convertFunctionToEs6Class1.ts index 51cc73fd64a..d14ca4f23bd 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class1.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class1.ts @@ -2,17 +2,24 @@ // @allowNonTsExtensions: true // @Filename: test123.js -//// [|function /*1*/foo() { } -//// /*2*/foo.prototype.instanceMethod1 = function() { return "this is name"; }; -//// /*3*/foo.prototype.instanceMethod2 = () => { return "this is name"; }; -//// /*4*/foo.prototype.instanceProp1 = "hello"; -//// /*5*/foo.prototype.instanceProp2 = undefined; -//// /*6*/foo.staticProp = "world"; -//// /*7*/foo.staticMethod1 = function() { return "this is static name"; }; -//// /*8*/foo.staticMethod2 = () => "this is static name";|] +////function [|foo|]() { } +////foo.prototype.instanceMethod1 = function() { return "this is name"; }; +////foo.prototype.instanceMethod2 = () => { return "this is name"; }; +////foo.prototype.instanceProp1 = "hello"; +////foo.prototype.instanceProp2 = undefined; +////foo.staticProp = "world"; +////foo.staticMethod1 = function() { return "this is static name"; }; +////foo.staticMethod2 = () => "this is static name"; -['1', '2', '3', '4', '5', '6', '7', '8'].forEach(m => verify.applicableRefactorAvailableAtMarker(m)); -verify.fileAfterApplyingRefactorAtMarker('1', +verify.getSuggestionDiagnostics([{ + message: "This constructor function may be converted to a class declaration.", + category: "suggestion", + code: 80002, +}]); + +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `class foo { constructor() { } instanceMethod1() { return "this is name"; } @@ -23,4 +30,5 @@ verify.fileAfterApplyingRefactorAtMarker('1', foo.prototype.instanceProp1 = "hello"; foo.prototype.instanceProp2 = undefined; foo.staticProp = "world"; -`, 'Convert to ES2015 class', 'convert'); \ No newline at end of file +`, +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class2.ts b/tests/cases/fourslash/convertFunctionToEs6Class2.ts index d5ed277b452..5326c30eea4 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class2.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class2.ts @@ -2,18 +2,18 @@ // @allowNonTsExtensions: true // @Filename: test123.js -//// [|var /*1*/foo = function() { }; -//// /*2*/foo.prototype.instanceMethod1 = function() { return "this is name"; }; -//// /*3*/foo.prototype.instanceMethod2 = () => { return "this is name"; }; -//// /*4*/foo.instanceProp1 = "hello"; -//// /*5*/foo.instanceProp2 = undefined; -//// /*6*/foo.staticProp = "world"; -//// /*7*/foo.staticMethod1 = function() { return "this is static name"; }; -//// /*8*/foo.staticMethod2 = () => "this is static name";|] +////var foo = function() { }; +////foo.prototype.instanceMethod1 = function() { return "this is name"; }; +////foo.prototype.instanceMethod2 = () => { return "this is name"; }; +////foo.instanceProp1 = "hello"; +////foo.instanceProp2 = undefined; +////foo.staticProp = "world"; +////foo.staticMethod1 = function() { return "this is static name"; }; +////foo.staticMethod2 = () => "this is static name"; - -['1', '2', '3', '4', '5', '6', '7', '8'].forEach(m => verify.applicableRefactorAvailableAtMarker(m)); -verify.fileAfterApplyingRefactorAtMarker('4', +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `class foo { constructor() { } instanceMethod1() { return "this is name"; } @@ -24,4 +24,5 @@ verify.fileAfterApplyingRefactorAtMarker('4', foo.instanceProp1 = "hello"; foo.instanceProp2 = undefined; foo.staticProp = "world"; -`, 'Convert to ES2015 class', 'convert'); +`, +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class3.ts b/tests/cases/fourslash/convertFunctionToEs6Class3.ts index fec4dd8edfa..d88c4b80a8d 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class3.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class3.ts @@ -2,18 +2,18 @@ // @allowNonTsExtensions: true // @Filename: test123.js -//// var bar = 10, /*1*/foo = function() { }; -//// /*2*/foo.prototype.instanceMethod1 = function() { return "this is name"; }; -//// /*3*/foo.prototype.instanceMethod2 = () => { return "this is name"; }; -//// /*4*/foo.prototype.instanceProp1 = "hello"; -//// /*5*/foo.prototype.instanceProp2 = undefined; -//// /*6*/foo.staticProp = "world"; -//// /*7*/foo.staticMethod1 = function() { return "this is static name"; }; -//// /*8*/foo.staticMethod2 = () => "this is static name"; +////var bar = 10, foo = function() { }; +////foo.prototype.instanceMethod1 = function() { return "this is name"; }; +////foo.prototype.instanceMethod2 = () => { return "this is name"; }; +////foo.prototype.instanceProp1 = "hello"; +////foo.prototype.instanceProp2 = undefined; +////foo.staticProp = "world"; +////foo.staticMethod1 = function() { return "this is static name"; }; +////foo.staticMethod2 = () => "this is static name"; - -['1', '2', '3', '4', '5', '6', '7', '8'].forEach(m => verify.applicableRefactorAvailableAtMarker(m)); -verify.fileAfterApplyingRefactorAtMarker('7', +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `var bar = 10; class foo { constructor() { } @@ -25,4 +25,5 @@ class foo { foo.prototype.instanceProp1 = "hello"; foo.prototype.instanceProp2 = undefined; foo.staticProp = "world"; -`, 'Convert to ES2015 class', 'convert'); \ No newline at end of file +`, +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6ClassJsDoc.ts b/tests/cases/fourslash/convertFunctionToEs6ClassJsDoc.ts index e9f6449c8fd..fe21e585444 100644 --- a/tests/cases/fourslash/convertFunctionToEs6ClassJsDoc.ts +++ b/tests/cases/fourslash/convertFunctionToEs6ClassJsDoc.ts @@ -2,26 +2,29 @@ // @allowNonTsExtensions: true // @Filename: test123.js -//// function fn() { -//// /** neat! */ -//// this.x = 100; -//// } +////function fn() { +//// /** neat! */ +//// this.x = 100; +////} //// -//// /** awesome -//// * stuff -//// */ -//// fn.prototype.arr = () => { return ""; } -//// /** great */ -//// fn.prototype.arr2 = () => []; -//// -//// /** -//// * This is a cool function! -//// */ -//// /*1*/fn.prototype.bar = function (x, y, z) { -//// this.x = y; -//// }; +/////** awesome +//// * stuff +//// */ +////fn.prototype.arr = () => { return ""; } +/////** great */ +////fn.prototype.arr2 = () => []; +//// +/////** +//// * This is a cool function! +////*/ +////fn.prototype.bar = function (x, y, z) { +//// this.x = y; +////}; -verify.fileAfterApplyingRefactorAtMarker('1', +verify.codeFix({ + description: "Convert function to an ES2015 class", + index: 0, // TODO: GH#22240 + newFileContent: `class fn { constructor() { /** neat! */ @@ -42,4 +45,5 @@ verify.fileAfterApplyingRefactorAtMarker('1', } -`, 'Convert to ES2015 class', 'convert'); +`, +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts b/tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts index ed230d50435..fb3b46763c8 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts @@ -11,8 +11,9 @@ //// await 3; ////} -verify.applicableRefactorAvailableAtMarker(""); -verify.fileAfterApplyingRefactorAtMarker("", +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `export class MyClass { constructor() { } @@ -24,4 +25,4 @@ verify.fileAfterApplyingRefactorAtMarker("", } } `, -'Convert to ES2015 class', 'convert'); +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_emptySwitchCase.ts b/tests/cases/fourslash/convertFunctionToEs6Class_emptySwitchCase.ts index 90bd48784ce..f055b9bbfa2 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class_emptySwitchCase.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class_emptySwitchCase.ts @@ -10,8 +10,9 @@ //// } ////} -verify.applicableRefactorAvailableAtMarker(""); -verify.fileAfterApplyingRefactorAtMarker("", +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `class MyClass { constructor() { } @@ -22,4 +23,4 @@ verify.fileAfterApplyingRefactorAtMarker("", } } `, -'Convert to ES2015 class', 'convert'); +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts index 940a68a05b6..76a853c0de3 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts @@ -7,8 +7,9 @@ ////MyClass.prototype.foo = function() { ////} -verify.applicableRefactorAvailableAtMarker(""); -verify.fileAfterApplyingRefactorAtMarker("", +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `export class MyClass { constructor() { } @@ -16,4 +17,4 @@ verify.fileAfterApplyingRefactorAtMarker("", } } `, -'Convert to ES2015 class', 'convert'); +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts index fb1276d4f03..ec0566440cb 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts @@ -2,13 +2,14 @@ // @allowNonTsExtensions: true // @Filename: test123.js -////export const /**/foo = function() { +////export const foo = function() { ////}; ////foo.prototype.instanceMethod = function() { ////}; -verify.applicableRefactorAvailableAtMarker(""); -verify.fileAfterApplyingRefactorAtMarker("", +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `export class foo { constructor() { } @@ -16,4 +17,4 @@ verify.fileAfterApplyingRefactorAtMarker("", } } `, -'Convert to ES2015 class', 'convert'); +}); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_objectLiteralInArrowFunction.ts b/tests/cases/fourslash/convertFunctionToEs6Class_objectLiteralInArrowFunction.ts index 0bbbf4e0024..a86af1e6d3d 100644 --- a/tests/cases/fourslash/convertFunctionToEs6Class_objectLiteralInArrowFunction.ts +++ b/tests/cases/fourslash/convertFunctionToEs6Class_objectLiteralInArrowFunction.ts @@ -8,8 +8,9 @@ //// ({ bar: () => { } }) ////} -verify.applicableRefactorAvailableAtMarker(""); -verify.fileAfterApplyingRefactorAtMarker("", +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `class MyClass { constructor() { } @@ -18,4 +19,4 @@ verify.fileAfterApplyingRefactorAtMarker("", } } `, -'Convert to ES2015 class', 'convert'); +}); diff --git a/tests/cases/fourslash/convertToEs6Class_emptyCatchClause.ts b/tests/cases/fourslash/convertToEs6Class_emptyCatchClause.ts index e9027178aa7..7fed94e84cc 100644 --- a/tests/cases/fourslash/convertToEs6Class_emptyCatchClause.ts +++ b/tests/cases/fourslash/convertToEs6Class_emptyCatchClause.ts @@ -7,8 +7,9 @@ //// try {} catch() {} ////} -verify.applicableRefactorAvailableAtMarker(""); -verify.fileAfterApplyingRefactorAtMarker("", +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: `class MyClass { constructor() { } foo() { @@ -17,4 +18,4 @@ verify.fileAfterApplyingRefactorAtMarker("", } } `, -'Convert to ES2015 class', 'convert'); +}); diff --git a/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts b/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts index 0bdd44f6753..498c976e71e 100644 --- a/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts +++ b/tests/cases/fourslash/server/convertFunctionToEs6Class-server.ts @@ -11,10 +11,11 @@ //// console.log('hello world'); //// } -verify.applicableRefactorAvailableAtMarker('1'); +verify.codeFix({ + description: "Convert function to an ES2015 class", + newFileContent: // NOTE: '// Comment' should be included, but due to incorrect handling of trivia, // it's omitted right now. -verify.fileAfterApplyingRefactorAtMarker('1', `class fn {\r constructor() {\r this.baz = 10;\r @@ -23,4 +24,5 @@ verify.fileAfterApplyingRefactorAtMarker('1', console.log('hello world');\r }\r }\r -`, 'Convert to ES2015 class', 'convert'); +`, +}); From dc7ee381d5645f1b00be8d9d43b4afecc9b65ca7 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 2 Mar 2018 16:10:34 -0800 Subject: [PATCH 288/298] Add tests when declaration emit for indirect alias usuage results in wrong error reporting Test for #22257 --- ...rationEmitAliasFromIndirectFile.errors.txt | 31 +++++++++ .../declarationEmitAliasFromIndirectFile.js | 59 ++++++++++++++++ ...clarationEmitAliasFromIndirectFile.symbols | 64 +++++++++++++++++ ...declarationEmitAliasFromIndirectFile.types | 68 +++++++++++++++++++ .../declarationEmitAliasFromIndirectFile.ts | 27 ++++++++ 5 files changed, 249 insertions(+) create mode 100644 tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt create mode 100644 tests/baselines/reference/declarationEmitAliasFromIndirectFile.js create mode 100644 tests/baselines/reference/declarationEmitAliasFromIndirectFile.symbols create mode 100644 tests/baselines/reference/declarationEmitAliasFromIndirectFile.types create mode 100644 tests/cases/compiler/declarationEmitAliasFromIndirectFile.ts diff --git a/tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt new file mode 100644 index 00000000000..22d258590e9 --- /dev/null +++ b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt @@ -0,0 +1,31 @@ +tests/cases/compiler/app.ts(3,16): error TS2503: Cannot find namespace 'fp'. + + +==== tests/cases/compiler/locale.d.ts (0 errors) ==== + export type Locale = { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; + }; + export type CustomLocale = { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; + }; + export type key = "ar" | "bg"; + +==== tests/cases/compiler/instance.d.ts (0 errors) ==== + import { Locale, CustomLocale, key as LocaleKey } from "./locale"; + export interface FlatpickrFn { + l10ns: {[k in LocaleKey]?: CustomLocale } & { default: Locale }; + } + +==== tests/cases/compiler/app.ts (1 errors) ==== + import { FlatpickrFn } from "./instance"; + const fp = { l10ns: {} } as FlatpickrFn; + export default fp.l10ns; + ~~ +!!! error TS2503: Cannot find namespace 'fp'. + \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitAliasFromIndirectFile.js b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.js new file mode 100644 index 00000000000..1d55514eb9d --- /dev/null +++ b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.js @@ -0,0 +1,59 @@ +//// [tests/cases/compiler/declarationEmitAliasFromIndirectFile.ts] //// + +//// [locale.d.ts] +export type Locale = { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; +}; +export type CustomLocale = { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; +}; +export type key = "ar" | "bg"; + +//// [instance.d.ts] +import { Locale, CustomLocale, key as LocaleKey } from "./locale"; +export interface FlatpickrFn { + l10ns: {[k in LocaleKey]?: CustomLocale } & { default: Locale }; +} + +//// [app.ts] +import { FlatpickrFn } from "./instance"; +const fp = { l10ns: {} } as FlatpickrFn; +export default fp.l10ns; + + +//// [app.js] +"use strict"; +exports.__esModule = true; +var fp = { l10ns: {} }; +exports["default"] = fp.l10ns; + + +//// [app.d.ts] +declare const _default: { + ar?: { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; + }; + bg?: { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; + }; +} & { + default: { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; + }; +}; +export default _default; diff --git a/tests/baselines/reference/declarationEmitAliasFromIndirectFile.symbols b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.symbols new file mode 100644 index 00000000000..78dba37e97e --- /dev/null +++ b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.symbols @@ -0,0 +1,64 @@ +=== tests/cases/compiler/locale.d.ts === +export type Locale = { +>Locale : Symbol(Locale, Decl(locale.d.ts, 0, 0)) + + weekdays: { +>weekdays : Symbol(weekdays, Decl(locale.d.ts, 0, 22)) + + shorthand: [string, string, string, string, string, string, string]; +>shorthand : Symbol(shorthand, Decl(locale.d.ts, 1, 15)) + + longhand: [string, string, string, string, string, string, string]; +>longhand : Symbol(longhand, Decl(locale.d.ts, 2, 76)) + + }; +}; +export type CustomLocale = { +>CustomLocale : Symbol(CustomLocale, Decl(locale.d.ts, 5, 2)) + + weekdays: { +>weekdays : Symbol(weekdays, Decl(locale.d.ts, 6, 28)) + + shorthand: [string, string, string, string, string, string, string]; +>shorthand : Symbol(shorthand, Decl(locale.d.ts, 7, 15)) + + longhand: [string, string, string, string, string, string, string]; +>longhand : Symbol(longhand, Decl(locale.d.ts, 8, 76)) + + }; +}; +export type key = "ar" | "bg"; +>key : Symbol(key, Decl(locale.d.ts, 11, 2)) + +=== tests/cases/compiler/instance.d.ts === +import { Locale, CustomLocale, key as LocaleKey } from "./locale"; +>Locale : Symbol(Locale, Decl(instance.d.ts, 0, 8)) +>CustomLocale : Symbol(CustomLocale, Decl(instance.d.ts, 0, 16)) +>key : Symbol(LocaleKey, Decl(instance.d.ts, 0, 30)) +>LocaleKey : Symbol(LocaleKey, Decl(instance.d.ts, 0, 30)) + +export interface FlatpickrFn { +>FlatpickrFn : Symbol(FlatpickrFn, Decl(instance.d.ts, 0, 66)) + + l10ns: {[k in LocaleKey]?: CustomLocale } & { default: Locale }; +>l10ns : Symbol(FlatpickrFn.l10ns, Decl(instance.d.ts, 1, 30)) +>k : Symbol(k, Decl(instance.d.ts, 2, 13)) +>LocaleKey : Symbol(LocaleKey, Decl(instance.d.ts, 0, 30)) +>CustomLocale : Symbol(CustomLocale, Decl(instance.d.ts, 0, 16)) +>default : Symbol(default, Decl(instance.d.ts, 2, 49)) +>Locale : Symbol(Locale, Decl(instance.d.ts, 0, 8)) +} + +=== tests/cases/compiler/app.ts === +import { FlatpickrFn } from "./instance"; +>FlatpickrFn : Symbol(FlatpickrFn, Decl(app.ts, 0, 8)) + +const fp = { l10ns: {} } as FlatpickrFn; +>fp : Symbol(fp, Decl(app.ts, 1, 5)) +>l10ns : Symbol(l10ns, Decl(app.ts, 1, 12)) +>FlatpickrFn : Symbol(FlatpickrFn, Decl(app.ts, 0, 8)) + +export default fp.l10ns; +>fp : Symbol(fp, Decl(app.ts, 1, 5)) +>l10ns : Symbol(FlatpickrFn.l10ns, Decl(instance.d.ts, 1, 30)) + diff --git a/tests/baselines/reference/declarationEmitAliasFromIndirectFile.types b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.types new file mode 100644 index 00000000000..16730debf8e --- /dev/null +++ b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.types @@ -0,0 +1,68 @@ +=== tests/cases/compiler/locale.d.ts === +export type Locale = { +>Locale : Locale + + weekdays: { +>weekdays : { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; } + + shorthand: [string, string, string, string, string, string, string]; +>shorthand : [string, string, string, string, string, string, string] + + longhand: [string, string, string, string, string, string, string]; +>longhand : [string, string, string, string, string, string, string] + + }; +}; +export type CustomLocale = { +>CustomLocale : CustomLocale + + weekdays: { +>weekdays : { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; } + + shorthand: [string, string, string, string, string, string, string]; +>shorthand : [string, string, string, string, string, string, string] + + longhand: [string, string, string, string, string, string, string]; +>longhand : [string, string, string, string, string, string, string] + + }; +}; +export type key = "ar" | "bg"; +>key : key + +=== tests/cases/compiler/instance.d.ts === +import { Locale, CustomLocale, key as LocaleKey } from "./locale"; +>Locale : any +>CustomLocale : any +>key : any +>LocaleKey : any + +export interface FlatpickrFn { +>FlatpickrFn : FlatpickrFn + + l10ns: {[k in LocaleKey]?: CustomLocale } & { default: Locale }; +>l10ns : { ar?: CustomLocale; bg?: CustomLocale; } & { default: Locale; } +>k : k +>LocaleKey : LocaleKey +>CustomLocale : CustomLocale +>default : Locale +>Locale : Locale +} + +=== tests/cases/compiler/app.ts === +import { FlatpickrFn } from "./instance"; +>FlatpickrFn : any + +const fp = { l10ns: {} } as FlatpickrFn; +>fp : FlatpickrFn +>{ l10ns: {} } as FlatpickrFn : FlatpickrFn +>{ l10ns: {} } : { l10ns: {}; } +>l10ns : {} +>{} : {} +>FlatpickrFn : FlatpickrFn + +export default fp.l10ns; +>fp.l10ns : { ar?: { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }; bg?: { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }; } & { default: { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }; } +>fp : FlatpickrFn +>l10ns : { ar?: { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }; bg?: { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }; } & { default: { weekdays: { shorthand: [string, string, string, string, string, string, string]; longhand: [string, string, string, string, string, string, string]; }; }; } + diff --git a/tests/cases/compiler/declarationEmitAliasFromIndirectFile.ts b/tests/cases/compiler/declarationEmitAliasFromIndirectFile.ts new file mode 100644 index 00000000000..b76a058ab41 --- /dev/null +++ b/tests/cases/compiler/declarationEmitAliasFromIndirectFile.ts @@ -0,0 +1,27 @@ +// @declaration: true + +// @filename: locale.d.ts +export type Locale = { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; +}; +export type CustomLocale = { + weekdays: { + shorthand: [string, string, string, string, string, string, string]; + longhand: [string, string, string, string, string, string, string]; + }; +}; +export type key = "ar" | "bg"; + +// @filename: instance.d.ts +import { Locale, CustomLocale, key as LocaleKey } from "./locale"; +export interface FlatpickrFn { + l10ns: {[k in LocaleKey]?: CustomLocale } & { default: Locale }; +} + +// @filename: app.ts +import { FlatpickrFn } from "./instance"; +const fp = { l10ns: {} } as FlatpickrFn; +export default fp.l10ns; From 9f1079002355e57bc6d5459e3d654d41ac550b1b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 2 Mar 2018 16:23:10 -0800 Subject: [PATCH 289/298] Do not try to resolve alias for default symbol Fixes #22257 --- src/compiler/checker.ts | 3 +- ...rationEmitAliasFromIndirectFile.errors.txt | 31 ------------------- .../reference/exportDefaultProperty.symbols | 12 +++---- .../reference/exportDefaultProperty.types | 8 ++--- .../reference/exportDefaultProperty2.symbols | 6 ++-- 5 files changed, 15 insertions(+), 45 deletions(-) delete mode 100644 tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fa2bd8d3b2e..7156615131c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2531,7 +2531,8 @@ namespace ts { // Check if symbol is any of the alias return forEachEntry(symbols, symbolFromSymbolTable => { if (symbolFromSymbolTable.flags & SymbolFlags.Alias - && symbolFromSymbolTable.escapedName !== "export=" + && symbolFromSymbolTable.escapedName !== InternalSymbolName.ExportEquals + && symbolFromSymbolTable.escapedName !== InternalSymbolName.Default && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && isExternalModule(getSourceFileOfNode(enclosingDeclaration))) // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name && (!useOnlyExternalAliasing || some(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration))) { diff --git a/tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt b/tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt deleted file mode 100644 index 22d258590e9..00000000000 --- a/tests/baselines/reference/declarationEmitAliasFromIndirectFile.errors.txt +++ /dev/null @@ -1,31 +0,0 @@ -tests/cases/compiler/app.ts(3,16): error TS2503: Cannot find namespace 'fp'. - - -==== tests/cases/compiler/locale.d.ts (0 errors) ==== - export type Locale = { - weekdays: { - shorthand: [string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string]; - }; - }; - export type CustomLocale = { - weekdays: { - shorthand: [string, string, string, string, string, string, string]; - longhand: [string, string, string, string, string, string, string]; - }; - }; - export type key = "ar" | "bg"; - -==== tests/cases/compiler/instance.d.ts (0 errors) ==== - import { Locale, CustomLocale, key as LocaleKey } from "./locale"; - export interface FlatpickrFn { - l10ns: {[k in LocaleKey]?: CustomLocale } & { default: Locale }; - } - -==== tests/cases/compiler/app.ts (1 errors) ==== - import { FlatpickrFn } from "./instance"; - const fp = { l10ns: {} } as FlatpickrFn; - export default fp.l10ns; - ~~ -!!! error TS2503: Cannot find namespace 'fp'. - \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultProperty.symbols b/tests/baselines/reference/exportDefaultProperty.symbols index 709bf6c3f37..6f559438ba1 100644 --- a/tests/baselines/reference/exportDefaultProperty.symbols +++ b/tests/baselines/reference/exportDefaultProperty.symbols @@ -56,20 +56,20 @@ declare module "foobar" { >"foobar" : Symbol("foobar", Decl(declarations.d.ts, 5, 1)) export default foo.bar; ->foo.bar : Symbol(default, Decl(declarations.d.ts, 2, 22)) +>foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22)) >foo : Symbol(foo, Decl(declarations.d.ts, 0, 0)) ->bar : Symbol(default, Decl(declarations.d.ts, 2, 22)) +>bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22)) } declare module "foobarx" { >"foobarx" : Symbol("foobarx", Decl(declarations.d.ts, 9, 1)) export default foo.bar.X; ->foo.bar.X : Symbol(default, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) +>foo.bar.X : Symbol(foo.bar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) >foo.bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22)) >foo : Symbol(foo, Decl(declarations.d.ts, 0, 0)) >bar : Symbol(foo.bar, Decl(declarations.d.ts, 2, 22)) ->X : Symbol(default, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) +>X : Symbol(foo.bar.X, Decl(declarations.d.ts, 2, 27), Decl(declarations.d.ts, 4, 16)) } === tests/cases/compiler/a.ts === @@ -85,9 +85,9 @@ namespace A { >b : Symbol(b, Decl(a.ts, 2, 37)) } export default A.B; ->A.B : Symbol(default, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) +>A.B : Symbol(A.B, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) >A : Symbol(A, Decl(a.ts, 0, 0)) ->B : Symbol(default, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) +>B : Symbol(A.B, Decl(a.ts, 0, 13), Decl(a.ts, 1, 48)) === tests/cases/compiler/b.ts === export default "foo".length; diff --git a/tests/baselines/reference/exportDefaultProperty.types b/tests/baselines/reference/exportDefaultProperty.types index c7439f7050c..55801a1d92d 100644 --- a/tests/baselines/reference/exportDefaultProperty.types +++ b/tests/baselines/reference/exportDefaultProperty.types @@ -59,9 +59,9 @@ declare module "foobar" { >"foobar" : typeof "foobar" export default foo.bar; ->foo.bar : typeof default +>foo.bar : typeof foo.bar >foo : typeof foo ->bar : typeof default +>bar : typeof foo.bar } declare module "foobarx" { @@ -89,9 +89,9 @@ namespace A { >0 : 0 } export default A.B; ->A.B : typeof default +>A.B : typeof A.B >A : typeof A ->B : typeof default +>B : typeof A.B === tests/cases/compiler/b.ts === export default "foo".length; diff --git a/tests/baselines/reference/exportDefaultProperty2.symbols b/tests/baselines/reference/exportDefaultProperty2.symbols index d3d7519aa94..1ad06f75ae9 100644 --- a/tests/baselines/reference/exportDefaultProperty2.symbols +++ b/tests/baselines/reference/exportDefaultProperty2.symbols @@ -5,7 +5,7 @@ class C { >C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1)) static B: number; ->B : Symbol(default, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13)) +>B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13)) } namespace C { >C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1)) @@ -16,9 +16,9 @@ namespace C { } export default C.B; ->C.B : Symbol(default, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13)) +>C.B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13)) >C : Symbol(C, Decl(a.ts, 0, 0), Decl(a.ts, 4, 1)) ->B : Symbol(default, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13)) +>B : Symbol(C.B, Decl(a.ts, 2, 9), Decl(a.ts, 5, 13)) === tests/cases/compiler/b.ts === import B from "./a"; From 25525bc9d605867fb9ba388913fec7fab07f2a19 Mon Sep 17 00:00:00 2001 From: Yuichi Nukiyama Date: Sat, 3 Mar 2018 10:08:36 +0900 Subject: [PATCH 290/298] Change esnext.promise to es2018.promise (#22292) * change esnest.promise to es2018.promise * modify unit tests * resolve conflict * resolve conflict --- Gulpfile.ts | 8 +++-- Jakefile.js | 8 +++-- src/compiler/commandLineParser.ts | 2 +- src/harness/unittests/commandLineParsing.ts | 9 ++---- .../convertCompilerOptionsFromJson.ts | 8 ++--- src/lib/es2018.d.ts | 1 + ...snext.promise.d.ts => es2018.promise.d.ts} | 0 src/lib/esnext.d.ts | 1 - .../types.asyncGenerators.esnext.1.symbols | 32 +++++++++---------- .../types.asyncGenerators.esnext.2.symbols | 2 +- .../baselines/reference/uniqueSymbols.symbols | 4 +-- .../uniqueSymbolsDeclarations.symbols | 4 +-- .../baselines/reference/usePromiseFinally.js | 8 +++++ .../reference/usePromiseFinally.symbols | 11 +++++++ .../reference/usePromiseFinally.types | 15 +++++++++ .../conformance/es2018/usePromiseFinally.ts | 5 +++ 16 files changed, 79 insertions(+), 39 deletions(-) rename src/lib/{esnext.promise.d.ts => es2018.promise.d.ts} (100%) create mode 100644 tests/baselines/reference/usePromiseFinally.js create mode 100644 tests/baselines/reference/usePromiseFinally.symbols create mode 100644 tests/baselines/reference/usePromiseFinally.types create mode 100644 tests/cases/conformance/es2018/usePromiseFinally.ts diff --git a/Gulpfile.ts b/Gulpfile.ts index 0044ff32339..1c6cfdd7ed1 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -143,14 +143,16 @@ const es2017LibrarySource = [ const es2017LibrarySourceMap = es2017LibrarySource.map(source => ({ target: "lib." + source, sources: ["header.d.ts", source] })); -const es2018LibrarySource = ["es2018.regexp.d.ts"]; +const es2018LibrarySource = [ + "es2018.regexp.d.ts", + "es2018.promise.d.ts" +]; const es2018LibrarySourceMap = es2018LibrarySource.map(source => ({ target: "lib." + source, sources: ["header.d.ts", source] })); const esnextLibrarySource = [ "esnext.asynciterable.d.ts", - "esnext.array.d.ts", - "esnext.promise.d.ts" + "esnext.array.d.ts" ]; const esnextLibrarySourceMap = esnextLibrarySource.map(source => diff --git a/Jakefile.js b/Jakefile.js index e10517de00c..584a9aa82b3 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -206,7 +206,10 @@ var es2017LibrarySourceMap = es2017LibrarySource.map(function (source) { return { target: "lib." + source, sources: ["header.d.ts", source] }; }); -var es2018LibrarySource = ["es2018.regexp.d.ts"]; +var es2018LibrarySource = [ + "es2018.regexp.d.ts", + "es2018.promise.d.ts" +]; var es2018LibrarySourceMap = es2018LibrarySource.map(function (source) { return { target: "lib." + source, sources: ["header.d.ts", source] }; @@ -214,8 +217,7 @@ var es2018LibrarySourceMap = es2018LibrarySource.map(function (source) { var esnextLibrarySource = [ "esnext.asynciterable.d.ts", - "esnext.array.d.ts", - "esnext.promise.d.ts" + "esnext.array.d.ts" ]; var esnextLibrarySourceMap = esnextLibrarySource.map(function (source) { diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index feb605551d6..b0370620be4 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -151,10 +151,10 @@ namespace ts { "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "es2018.promise": "lib.es2018.promise.d.ts", "es2018.regexp": "lib.es2018.regexp.d.ts", "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", - "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, diff --git a/src/harness/unittests/commandLineParsing.ts b/src/harness/unittests/commandLineParsing.ts index dbfa128b365..00ea059dae5 100644 --- a/src/harness/unittests/commandLineParsing.ts +++ b/src/harness/unittests/commandLineParsing.ts @@ -60,10 +60,9 @@ namespace ts { assertParseResult(["--lib", "es5,invalidOption", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - file: undefined, start: undefined, length: undefined, @@ -263,10 +262,9 @@ namespace ts { assertParseResult(["--lib", "es5,", "es7", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - file: undefined, start: undefined, length: undefined, @@ -283,10 +281,9 @@ namespace ts { assertParseResult(["--lib", "es5, ", "es7", "0.ts"], { errors: [{ - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable'.", category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category, code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, - file: undefined, start: undefined, length: undefined, diff --git a/src/harness/unittests/convertCompilerOptionsFromJson.ts b/src/harness/unittests/convertCompilerOptionsFromJson.ts index 90bd12d4120..8178d4d0529 100644 --- a/src/harness/unittests/convertCompilerOptionsFromJson.ts +++ b/src/harness/unittests/convertCompilerOptionsFromJson.ts @@ -266,7 +266,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] @@ -297,7 +297,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] @@ -328,7 +328,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] @@ -359,7 +359,7 @@ namespace ts { file: undefined, start: 0, length: 0, - messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable', 'esnext.promise'.", + messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'esnext', 'dom', 'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.promise', 'es2018.regexp', 'esnext.array', 'esnext.asynciterable'.", code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code, category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category }] diff --git a/src/lib/es2018.d.ts b/src/lib/es2018.d.ts index 4f9d4d3a56c..1abddc6fe22 100644 --- a/src/lib/es2018.d.ts +++ b/src/lib/es2018.d.ts @@ -1,2 +1,3 @@ /// +/// /// \ No newline at end of file diff --git a/src/lib/esnext.promise.d.ts b/src/lib/es2018.promise.d.ts similarity index 100% rename from src/lib/esnext.promise.d.ts rename to src/lib/es2018.promise.d.ts diff --git a/src/lib/esnext.d.ts b/src/lib/esnext.d.ts index bbfb9535aa7..831d241cc3c 100644 --- a/src/lib/esnext.d.ts +++ b/src/lib/esnext.d.ts @@ -1,4 +1,3 @@ /// /// /// -/// diff --git a/tests/baselines/reference/types.asyncGenerators.esnext.1.symbols b/tests/baselines/reference/types.asyncGenerators.esnext.1.symbols index 59b93d7ab1a..58aefd0087e 100644 --- a/tests/baselines/reference/types.asyncGenerators.esnext.1.symbols +++ b/tests/baselines/reference/types.asyncGenerators.esnext.1.symbols @@ -17,7 +17,7 @@ async function * inferReturnType4() { yield Promise.resolve(1); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * inferReturnType5() { @@ -26,7 +26,7 @@ async function * inferReturnType5() { yield 1; yield Promise.resolve(2); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * inferReturnType6() { @@ -39,7 +39,7 @@ async function * inferReturnType7() { yield* [Promise.resolve(1)]; >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * inferReturnType8() { @@ -59,7 +59,7 @@ const assignability2: () => AsyncIterableIterator = async function * () yield Promise.resolve(1); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) }; @@ -75,7 +75,7 @@ const assignability4: () => AsyncIterableIterator = async function * () yield* [Promise.resolve(1)]; >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) }; @@ -97,7 +97,7 @@ const assignability7: () => AsyncIterable = async function * () { yield Promise.resolve(1); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) }; @@ -113,7 +113,7 @@ const assignability9: () => AsyncIterable = async function * () { yield* [Promise.resolve(1)]; >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) }; @@ -135,7 +135,7 @@ const assignability12: () => AsyncIterator = async function * () { yield Promise.resolve(1); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) }; @@ -151,7 +151,7 @@ const assignability14: () => AsyncIterator = async function * () { yield* [Promise.resolve(1)]; >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) }; @@ -173,7 +173,7 @@ async function * explicitReturnType2(): AsyncIterableIterator { yield Promise.resolve(1); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * explicitReturnType3(): AsyncIterableIterator { @@ -188,7 +188,7 @@ async function * explicitReturnType4(): AsyncIterableIterator { yield* [Promise.resolve(1)]; >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * explicitReturnType5(): AsyncIterableIterator { @@ -209,7 +209,7 @@ async function * explicitReturnType7(): AsyncIterable { yield Promise.resolve(1); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * explicitReturnType8(): AsyncIterable { @@ -224,7 +224,7 @@ async function * explicitReturnType9(): AsyncIterable { yield* [Promise.resolve(1)]; >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * explicitReturnType10(): AsyncIterable { @@ -245,7 +245,7 @@ async function * explicitReturnType12(): AsyncIterator { yield Promise.resolve(1); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * explicitReturnType13(): AsyncIterator { @@ -260,7 +260,7 @@ async function * explicitReturnType14(): AsyncIterator { yield* [Promise.resolve(1)]; >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } async function * explicitReturnType15(): AsyncIterator { @@ -286,6 +286,6 @@ async function * awaitedType2() { const x = await Promise.resolve(1); >x : Symbol(x, Decl(types.asyncGenerators.esnext.1.ts, 121, 9)) >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } diff --git a/tests/baselines/reference/types.asyncGenerators.esnext.2.symbols b/tests/baselines/reference/types.asyncGenerators.esnext.2.symbols index 9d4bcc17b13..af5a65d9b42 100644 --- a/tests/baselines/reference/types.asyncGenerators.esnext.2.symbols +++ b/tests/baselines/reference/types.asyncGenerators.esnext.2.symbols @@ -15,7 +15,7 @@ async function * inferReturnType3() { yield* Promise.resolve([1, 2]); >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) } const assignability1: () => AsyncIterableIterator = async function * () { diff --git a/tests/baselines/reference/uniqueSymbols.symbols b/tests/baselines/reference/uniqueSymbols.symbols index ba651b89a41..e06047f19a9 100644 --- a/tests/baselines/reference/uniqueSymbols.symbols +++ b/tests/baselines/reference/uniqueSymbols.symbols @@ -388,7 +388,7 @@ const constInitToLReadonlyNestedTypeWithIndexedAccess: L["nested"]["readonlyNest const promiseForConstCall = Promise.resolve(constCall); >promiseForConstCall : Symbol(promiseForConstCall, Decl(uniqueSymbols.ts, 111, 5)) >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >constCall : Symbol(constCall, Decl(uniqueSymbols.ts, 1, 5)) @@ -733,7 +733,7 @@ interface Context { method2(): Promise; >method2 : Symbol(Context.method2, Decl(uniqueSymbols.ts, 214, 24)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >s : Symbol(s, Decl(uniqueSymbols.ts, 115, 13)) method3(): AsyncIterableIterator; diff --git a/tests/baselines/reference/uniqueSymbolsDeclarations.symbols b/tests/baselines/reference/uniqueSymbolsDeclarations.symbols index c145b32059c..76015faf748 100644 --- a/tests/baselines/reference/uniqueSymbolsDeclarations.symbols +++ b/tests/baselines/reference/uniqueSymbolsDeclarations.symbols @@ -388,7 +388,7 @@ const constInitToLReadonlyNestedTypeWithIndexedAccess: L["nested"]["readonlyNest const promiseForConstCall = Promise.resolve(constCall); >promiseForConstCall : Symbol(promiseForConstCall, Decl(uniqueSymbolsDeclarations.ts, 111, 5)) >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >constCall : Symbol(constCall, Decl(uniqueSymbolsDeclarations.ts, 1, 5)) @@ -733,7 +733,7 @@ interface Context { method2(): Promise; >method2 : Symbol(Context.method2, Decl(uniqueSymbolsDeclarations.ts, 214, 24)) ->Promise : Symbol(Promise, Decl(lib.esnext.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) >s : Symbol(s, Decl(uniqueSymbolsDeclarations.ts, 115, 13)) method3(): AsyncIterableIterator; diff --git a/tests/baselines/reference/usePromiseFinally.js b/tests/baselines/reference/usePromiseFinally.js new file mode 100644 index 00000000000..cdbace96ec5 --- /dev/null +++ b/tests/baselines/reference/usePromiseFinally.js @@ -0,0 +1,8 @@ +//// [usePromiseFinally.ts] +let promise1 = new Promise(function(resolve, reject) {}) + .finally(function() {}); + + +//// [usePromiseFinally.js] +var promise1 = new Promise(function (resolve, reject) { }) + .finally(function () { }); diff --git a/tests/baselines/reference/usePromiseFinally.symbols b/tests/baselines/reference/usePromiseFinally.symbols new file mode 100644 index 00000000000..aaffd056eb8 --- /dev/null +++ b/tests/baselines/reference/usePromiseFinally.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/es2018/usePromiseFinally.ts === +let promise1 = new Promise(function(resolve, reject) {}) +>promise1 : Symbol(promise1, Decl(usePromiseFinally.ts, 0, 3)) +>new Promise(function(resolve, reject) {}) .finally : Symbol(Promise.finally, Decl(lib.es2018.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es2018.promise.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>resolve : Symbol(resolve, Decl(usePromiseFinally.ts, 0, 36)) +>reject : Symbol(reject, Decl(usePromiseFinally.ts, 0, 44)) + + .finally(function() {}); +>finally : Symbol(Promise.finally, Decl(lib.es2018.promise.d.ts, --, --)) + diff --git a/tests/baselines/reference/usePromiseFinally.types b/tests/baselines/reference/usePromiseFinally.types new file mode 100644 index 00000000000..80534c75610 --- /dev/null +++ b/tests/baselines/reference/usePromiseFinally.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/es2018/usePromiseFinally.ts === +let promise1 = new Promise(function(resolve, reject) {}) +>promise1 : Promise<{}> +>new Promise(function(resolve, reject) {}) .finally(function() {}) : Promise<{}> +>new Promise(function(resolve, reject) {}) .finally : (onfinally?: () => void) => Promise<{}> +>new Promise(function(resolve, reject) {}) : Promise<{}> +>Promise : PromiseConstructor +>function(resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void +>resolve : (value?: {} | PromiseLike<{}>) => void +>reject : (reason?: any) => void + + .finally(function() {}); +>finally : (onfinally?: () => void) => Promise<{}> +>function() {} : () => void + diff --git a/tests/cases/conformance/es2018/usePromiseFinally.ts b/tests/cases/conformance/es2018/usePromiseFinally.ts new file mode 100644 index 00000000000..c9c96a913d8 --- /dev/null +++ b/tests/cases/conformance/es2018/usePromiseFinally.ts @@ -0,0 +1,5 @@ +// @target: es5 +// @lib: es6,es2018 + +let promise1 = new Promise(function(resolve, reject) {}) + .finally(function() {}); From 1c93744a9cd5c8bb02b5d4eae5ce5fefacd5349e Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 2 Mar 2018 17:23:59 -0800 Subject: [PATCH 291/298] Much better comment preservation (#22141) * Retain comments on (and produce sourcemaps on) the equals token in initializers * Improved comments/sourcemaps for await, yield, while, and for * Retain comments on block curly-braces * Emit comments for if statements * Improved switch case comment emit * Improve comment and sourcemap emit for try/catch, throw, and continue statements * Improve sourcemap emit and comments for with statements * More accurate sourcemaps+comments emit for new, typeof, void, and delete * Improve comment emit for element access expressions * Preserve more comments on imports and exports * Make function a bit more defensive like other usages of emitTrailingCommentsOfPosition * Support preserving comments within empty lists * Handle leading comments of tokens, conditionally indent leading comments * Stop heuristically sourcemapping tokens When the transform was trivial it worked, but was unneeded, but when it was complex, it was brittle - best leave source mapping up to the transformers * Fix unneeded +1 * Tighten up element access comments * Handle comments on parenthesized expression tokens * Fix nit --- src/compiler/emitter.ts | 234 +- tests/baselines/reference/ES5For-of1.js.map | 2 +- .../reference/ES5For-of1.sourcemap.txt | 90 +- tests/baselines/reference/ES5For-of13.js.map | 2 +- .../reference/ES5For-of13.sourcemap.txt | 90 +- tests/baselines/reference/ES5For-of25.js.map | 2 +- .../reference/ES5For-of25.sourcemap.txt | 54 +- tests/baselines/reference/ES5For-of26.js.map | 2 +- .../reference/ES5For-of26.sourcemap.txt | 80 +- tests/baselines/reference/ES5For-of3.js.map | 2 +- .../reference/ES5For-of3.sourcemap.txt | 90 +- tests/baselines/reference/ES5For-of33.js.map | 2 +- .../reference/ES5For-of33.sourcemap.txt | 84 +- tests/baselines/reference/ES5For-of34.js.map | 2 +- .../reference/ES5For-of34.sourcemap.txt | 129 +- tests/baselines/reference/ES5For-of35.js.map | 2 +- .../reference/ES5For-of35.sourcemap.txt | 74 +- tests/baselines/reference/ES5For-of36.js.map | 2 +- .../reference/ES5For-of36.sourcemap.txt | 74 +- tests/baselines/reference/ES5For-of8.js.map | 2 +- .../reference/ES5For-of8.sourcemap.txt | 135 +- .../awaitExpressionInnerCommentEmit.js | 13 + .../awaitExpressionInnerCommentEmit.symbols | 8 + .../awaitExpressionInnerCommentEmit.types | 16 + .../reference/commentInEmptyParameterList1.js | 2 +- ...mentOnParenthesizedExpressionOpenParen1.js | 2 +- .../reference/commentsAfterCaseClauses1.js | 6 +- .../reference/commentsAfterCaseClauses2.js | 7 +- .../reference/commentsAfterCaseClauses3.js | 6 +- tests/baselines/reference/commentsFunction.js | 4 +- tests/baselines/reference/commentsVarDecl.js | 4 +- ...computedPropertyNamesSourceMap1_ES5.js.map | 2 +- ...dPropertyNamesSourceMap1_ES5.sourcemap.txt | 21 +- ...computedPropertyNamesSourceMap1_ES6.js.map | 2 +- ...dPropertyNamesSourceMap1_ES6.sourcemap.txt | 21 +- ...computedPropertyNamesSourceMap2_ES5.js.map | 2 +- ...dPropertyNamesSourceMap2_ES5.sourcemap.txt | 21 +- ...computedPropertyNamesSourceMap2_ES6.js.map | 2 +- ...dPropertyNamesSourceMap2_ES6.sourcemap.txt | 21 +- .../reference/contextualTyping.js.map | 2 +- .../reference/contextualTyping.sourcemap.txt | 1677 ++++---- .../continueStatementInternalComments.js | 9 + .../continueStatementInternalComments.symbols | 5 + .../continueStatementInternalComments.types | 7 + .../baselines/reference/controlFlowArrays.js | 4 +- .../declFileObjectLiteralWithAccessors.js | 2 +- .../declFileObjectLiteralWithOnlyGetter.js | 2 +- .../declFileObjectLiteralWithOnlySetter.js | 2 +- ...assConstructorWithExplicitReturns01.js.map | 2 +- ...tructorWithExplicitReturns01.sourcemap.txt | 213 +- .../baselines/reference/destructuringCatch.js | 2 +- .../reference/duplicateLocalVariable1.js | 2 +- ...elementAccessExpressionInternalComments.js | 17 + ...ntAccessExpressionInternalComments.symbols | 15 + ...mentAccessExpressionInternalComments.types | 17 + .../reference/emptyArgumentsListComment.js | 22 + .../emptyArgumentsListComment.symbols | 17 + .../reference/emptyArgumentsListComment.types | 19 + .../reference/es3-sourcemap-amd.js.map | 2 +- .../reference/es3-sourcemap-amd.sourcemap.txt | 21 +- .../reference/es5-souremap-amd.js.map | 2 +- .../reference/es5-souremap-amd.sourcemap.txt | 21 +- .../reference/es6-sourcemap-amd.js.map | 2 +- .../reference/es6-sourcemap-amd.sourcemap.txt | 21 +- tests/baselines/reference/for.js | 17 +- tests/baselines/reference/forIn.js | 6 +- .../reference/forStatementInnerComments.js | 15 + .../forStatementInnerComments.symbols | 25 + .../reference/forStatementInnerComments.types | 25 + .../getEmitOutputSourceMap2.baseline | 2 +- .../reference/ifStatementInternalComments.js | 10 + .../ifStatementInternalComments.symbols | 6 + .../ifStatementInternalComments.types | 7 + .../reference/importExportInternalComments.js | 25 + .../importExportInternalComments.symbols | 30 + .../importExportInternalComments.types | 34 + .../reference/invalidTryStatements2.js | 3 +- tests/baselines/reference/jsdocTypeTagCast.js | 8 +- .../reference/jsdocTypecastNoTypeNoCrash.js | 2 +- .../reference/jsxFactoryIdentifier.js.map | 4 +- .../jsxFactoryIdentifier.sourcemap.txt | 176 +- .../jsxFactoryIdentifierAsParameter.js.map | 2 +- ...FactoryIdentifierAsParameter.sourcemap.txt | 21 +- ...actoryIdentifierWithAbsentParameter.js.map | 2 +- ...dentifierWithAbsentParameter.sourcemap.txt | 21 +- .../reference/jsxFactoryQualifiedName.js.map | 4 +- .../jsxFactoryQualifiedName.sourcemap.txt | 176 +- ...FactoryQualifiedNameResolutionError.js.map | 2 +- ...QualifiedNameResolutionError.sourcemap.txt | 21 +- .../keywordExpressionInternalComments.js | 12 + .../keywordExpressionInternalComments.symbols | 15 + .../keywordExpressionInternalComments.types | 19 + .../narrowExceptionVariableInCatchClause.js | 2 +- .../reference/narrowFromAnyWithInstanceof.js | 6 +- .../narrowFromAnyWithTypePredicate.js | 6 +- tests/baselines/reference/noCatchBlock.js.map | 2 +- .../reference/noCatchBlock.sourcemap.txt | 36 +- .../organizeImports/CoalesceTrivia.ts | 2 +- .../reference/organizeImports/SortTrivia.ts | 4 +- .../organizeImports/UnusedTrivia2.ts | 2 +- tests/baselines/reference/out-flag.js.map | 2 +- .../reference/out-flag.sourcemap.txt | 21 +- ...parenthesizedExpressionInternalComments.js | 21 + ...thesizedExpressionInternalComments.symbols | 13 + ...enthesizedExpressionInternalComments.types | 19 + ...parseRegularExpressionMixedWithComments.js | 9 +- .../reference/parser15.4.4.14-9-2.js | 3 +- tests/baselines/reference/parserNotRegex1.js | 3 +- .../baselines/reference/parserRealSource1.js | 16 +- .../baselines/reference/parserRealSource7.js | 6 +- tests/baselines/reference/parserindenter.js | 8 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../maprootUrlSimpleNoOutdir/amd/m1.js.map | 2 +- .../maprootUrlSimpleNoOutdir/amd/test.js.map | 2 +- .../maprootUrlSimpleNoOutdir/node/m1.js.map | 2 +- .../maprootUrlSimpleNoOutdir/node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../sourcemapSimpleNoOutdir/amd/m1.js.map | 2 +- .../sourcemapSimpleNoOutdir/amd/test.js.map | 2 +- .../sourcemapSimpleNoOutdir/node/m1.js.map | 2 +- .../sourcemapSimpleNoOutdir/node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/ref/m2.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/ref/m2.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/ref/m2.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/ref/m2.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/bin/outAndOutDirFile.js.map | 2 +- .../node/bin/outAndOutDirFile.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../ref/m1.js.map | 2 +- .../outputdir_module_multifolder/test.js.map | 2 +- .../m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../amd/diskFile0.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/diskFile0.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../outputdir_multifolder/ref/m1.js.map | 2 +- .../simple/outputdir_multifolder/test.js.map | 2 +- .../outputdir_multifolder_ref/m2.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../sourcerootUrlSimpleNoOutdir/amd/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- .../amd/ref/m1.js.map | 2 +- .../amd/test.js.map | 2 +- .../node/ref/m1.js.map | 2 +- .../node/test.js.map | 2 +- .../amd/outdir/simple/ref/m1.js.map | 2 +- .../amd/outdir/simple/test.js.map | 2 +- .../node/outdir/simple/ref/m1.js.map | 2 +- .../node/outdir/simple/test.js.map | 2 +- .../amd/bin/test.js.map | 2 +- .../node/bin/test.js.map | 2 +- tests/baselines/reference/properties.js.map | 2 +- .../reference/properties.sourcemap.txt | 21 +- .../propertyAccessExpressionInnerComments.js | 29 + ...pertyAccessExpressionInnerComments.symbols | 31 + ...ropertyAccessExpressionInnerComments.types | 31 + .../recursiveClassReferenceTest.js.map | 2 +- .../recursiveClassReferenceTest.sourcemap.txt | 334 +- .../reference/sourceMap-Comments.js.map | 2 +- .../sourceMap-Comments.sourcemap.txt | 73 +- .../reference/sourceMap-Comments2.js.map | 2 +- .../sourceMap-Comments2.sourcemap.txt | 36 +- .../sourceMap-FileWithComments.js.map | 2 +- .../sourceMap-FileWithComments.sourcemap.txt | 147 +- .../reference/sourceMap-SkippedNode.js.map | 2 +- .../sourceMap-SkippedNode.sourcemap.txt | 36 +- .../reference/sourceMapSample.js.map | 2 +- .../reference/sourceMapSample.sourcemap.txt | 349 +- .../reference/sourceMapValidationClass.js.map | 2 +- .../sourceMapValidationClass.sourcemap.txt | 123 +- .../sourceMapValidationClasses.js.map | 2 +- .../sourceMapValidationClasses.sourcemap.txt | 349 +- .../sourceMapValidationDecorators.js.map | 2 +- ...ourceMapValidationDecorators.sourcemap.txt | 123 +- ...DestructuringForArrayBindingPattern.js.map | 2 +- ...turingForArrayBindingPattern.sourcemap.txt | 3138 +++++++------- ...estructuringForArrayBindingPattern2.js.map | 2 +- ...uringForArrayBindingPattern2.sourcemap.txt | 3162 +++++++------- ...ForArrayBindingPatternDefaultValues.js.map | 2 +- ...yBindingPatternDefaultValues.sourcemap.txt | 3308 +++++++-------- ...orArrayBindingPatternDefaultValues2.js.map | 2 +- ...BindingPatternDefaultValues2.sourcemap.txt | 3308 +++++++-------- ...estructuringForObjectBindingPattern.js.map | 2 +- ...uringForObjectBindingPattern.sourcemap.txt | 1650 ++++---- ...structuringForObjectBindingPattern2.js.map | 2 +- ...ringForObjectBindingPattern2.sourcemap.txt | 3026 ++++++------- ...orObjectBindingPatternDefaultValues.js.map | 2 +- ...tBindingPatternDefaultValues.sourcemap.txt | 2018 ++++----- ...rObjectBindingPatternDefaultValues2.js.map | 2 +- ...BindingPatternDefaultValues2.sourcemap.txt | 3754 ++++++++--------- ...structuringForOfArrayBindingPattern.js.map | 2 +- ...ringForOfArrayBindingPattern.sourcemap.txt | 1650 ++++---- ...tructuringForOfArrayBindingPattern2.js.map | 2 +- ...ingForOfArrayBindingPattern2.sourcemap.txt | 1650 ++++---- ...rOfArrayBindingPatternDefaultValues.js.map | 2 +- ...yBindingPatternDefaultValues.sourcemap.txt | 1500 +++---- ...OfArrayBindingPatternDefaultValues2.js.map | 2 +- ...BindingPatternDefaultValues2.sourcemap.txt | 1496 +++---- ...tructuringForOfObjectBindingPattern.js.map | 2 +- ...ingForOfObjectBindingPattern.sourcemap.txt | 1150 +++-- ...ructuringForOfObjectBindingPattern2.js.map | 2 +- ...ngForOfObjectBindingPattern2.sourcemap.txt | 2250 +++++----- ...OfObjectBindingPatternDefaultValues.js.map | 2 +- ...tBindingPatternDefaultValues.sourcemap.txt | 1212 +++--- ...fObjectBindingPatternDefaultValues2.js.map | 2 +- ...BindingPatternDefaultValues2.sourcemap.txt | 2392 +++++------ ...ationDestructuringVariableStatement.js.map | 2 +- ...structuringVariableStatement.sourcemap.txt | 87 +- ...tionDestructuringVariableStatement1.js.map | 2 +- ...tructuringVariableStatement1.sourcemap.txt | 87 +- ...ariableStatementArrayBindingPattern.js.map | 2 +- ...StatementArrayBindingPattern.sourcemap.txt | 57 +- ...riableStatementArrayBindingPattern2.js.map | 2 +- ...tatementArrayBindingPattern2.sourcemap.txt | 57 +- ...riableStatementArrayBindingPattern3.js.map | 2 +- ...tatementArrayBindingPattern3.sourcemap.txt | 99 +- ...entArrayBindingPatternDefaultValues.js.map | 2 +- ...yBindingPatternDefaultValues.sourcemap.txt | 57 +- ...ntArrayBindingPatternDefaultValues2.js.map | 2 +- ...BindingPatternDefaultValues2.sourcemap.txt | 57 +- ...ntArrayBindingPatternDefaultValues3.js.map | 2 +- ...BindingPatternDefaultValues3.sourcemap.txt | 99 +- ...uringVariableStatementDefaultValues.js.map | 2 +- ...riableStatementDefaultValues.sourcemap.txt | 87 +- ...StatementNestedObjectBindingPattern.js.map | 2 +- ...ntNestedObjectBindingPattern.sourcemap.txt | 87 +- ...jectBindingPatternWithDefaultValues.js.map | 2 +- ...dingPatternWithDefaultValues.sourcemap.txt | 87 +- .../reference/sourceMapValidationDo.js.map | 2 +- .../sourceMapValidationDo.sourcemap.txt | 94 +- .../reference/sourceMapValidationFor.js.map | 2 +- .../sourceMapValidationFor.sourcemap.txt | 843 ++-- .../reference/sourceMapValidationForIn.js.map | 2 +- .../sourceMapValidationForIn.sourcemap.txt | 240 +- ...rceMapValidationFunctionExpressions.js.map | 2 +- ...alidationFunctionExpressions.sourcemap.txt | 21 +- .../sourceMapValidationFunctions.js.map | 2 +- ...sourceMapValidationFunctions.sourcemap.txt | 51 +- .../sourceMapValidationIfElse.js.map | 2 +- .../sourceMapValidationIfElse.sourcemap.txt | 306 +- .../sourceMapValidationModule.js.map | 2 +- .../sourceMapValidationModule.sourcemap.txt | 33 +- .../sourceMapValidationStatements.js.map | 2 +- ...ourceMapValidationStatements.sourcemap.txt | 747 ++-- .../sourceMapValidationSwitch.js.map | 2 +- .../sourceMapValidationSwitch.sourcemap.txt | 186 +- .../sourceMapValidationTryCatchFinally.js.map | 2 +- ...MapValidationTryCatchFinally.sourcemap.txt | 164 +- .../reference/sourceMapValidationWhile.js.map | 2 +- .../sourceMapValidationWhile.sourcemap.txt | 32 +- .../sourceMapValidationWithComments.js.map | 2 +- ...rceMapValidationWithComments.sourcemap.txt | 21 +- .../reference/switchCaseInternalComments.js | 17 + .../switchCaseInternalComments.symbols | 9 + .../switchCaseInternalComments.types | 17 + .../switchStatementsWithMultipleDefaults.js | 6 +- .../switchStatementsWithMultipleDefaults1.js | 2 +- .../reference/tryStatementInternalComments.js | 17 + .../tryStatementInternalComments.symbols | 9 + .../tryStatementInternalComments.types | 11 + tests/baselines/reference/typeAssertions.js | 4 +- .../reference/typeGuardIntersectionTypes.js | 2 + .../reference/typeGuardOfFormTypeOfOther.js | 2 +- ...rdsWithInstanceOfByConstructorSignature.js | 20 +- tests/baselines/reference/unknownSymbols2.js | 2 +- .../variableDeclarationInnerCommentEmit.js | 14 + ...ariableDeclarationInnerCommentEmit.symbols | 14 + .../variableDeclarationInnerCommentEmit.types | 18 + .../reference/whileStatementInnerComments.js | 9 + .../whileStatementInnerComments.symbols | 6 + .../whileStatementInnerComments.types | 7 + tests/baselines/reference/withStatement.js | 2 +- .../reference/withStatementErrors.js | 2 +- .../withStatementInternalComments.js | 7 + .../withStatementInternalComments.symbols | 4 + .../withStatementInternalComments.types | 5 + .../yieldExpressionInnerCommentEmit.js | 18 + .../yieldExpressionInnerCommentEmit.symbols | 11 + .../yieldExpressionInnerCommentEmit.types | 27 + .../awaitExpressionInnerCommentEmit.ts | 6 + .../continueStatementInternalComments.ts | 3 + ...elementAccessExpressionInternalComments.ts | 7 + .../compiler/emptyArgumentsListComment.ts | 10 + .../compiler/forStatementInnerComments.ts | 7 + .../compiler/ifStatementInternalComments.ts | 3 + .../compiler/importExportInternalComments.ts | 15 + .../keywordExpressionInternalComments.ts | 4 + ...parenthesizedExpressionInternalComments.ts | 10 + .../propertyAccessExpressionInnerComments.ts | 14 + .../compiler/switchCaseInternalComments.ts | 7 + .../compiler/tryStatementInternalComments.ts | 7 + .../variableDeclarationInnerCommentEmit.ts | 6 + .../compiler/whileStatementInnerComments.ts | 3 + .../compiler/withStatementInternalComments.ts | 2 + .../yieldExpressionInnerCommentEmit.ts | 8 + 951 files changed, 22314 insertions(+), 25785 deletions(-) create mode 100644 tests/baselines/reference/awaitExpressionInnerCommentEmit.js create mode 100644 tests/baselines/reference/awaitExpressionInnerCommentEmit.symbols create mode 100644 tests/baselines/reference/awaitExpressionInnerCommentEmit.types create mode 100644 tests/baselines/reference/continueStatementInternalComments.js create mode 100644 tests/baselines/reference/continueStatementInternalComments.symbols create mode 100644 tests/baselines/reference/continueStatementInternalComments.types create mode 100644 tests/baselines/reference/elementAccessExpressionInternalComments.js create mode 100644 tests/baselines/reference/elementAccessExpressionInternalComments.symbols create mode 100644 tests/baselines/reference/elementAccessExpressionInternalComments.types create mode 100644 tests/baselines/reference/emptyArgumentsListComment.js create mode 100644 tests/baselines/reference/emptyArgumentsListComment.symbols create mode 100644 tests/baselines/reference/emptyArgumentsListComment.types create mode 100644 tests/baselines/reference/forStatementInnerComments.js create mode 100644 tests/baselines/reference/forStatementInnerComments.symbols create mode 100644 tests/baselines/reference/forStatementInnerComments.types create mode 100644 tests/baselines/reference/ifStatementInternalComments.js create mode 100644 tests/baselines/reference/ifStatementInternalComments.symbols create mode 100644 tests/baselines/reference/ifStatementInternalComments.types create mode 100644 tests/baselines/reference/importExportInternalComments.js create mode 100644 tests/baselines/reference/importExportInternalComments.symbols create mode 100644 tests/baselines/reference/importExportInternalComments.types create mode 100644 tests/baselines/reference/keywordExpressionInternalComments.js create mode 100644 tests/baselines/reference/keywordExpressionInternalComments.symbols create mode 100644 tests/baselines/reference/keywordExpressionInternalComments.types create mode 100644 tests/baselines/reference/parenthesizedExpressionInternalComments.js create mode 100644 tests/baselines/reference/parenthesizedExpressionInternalComments.symbols create mode 100644 tests/baselines/reference/parenthesizedExpressionInternalComments.types create mode 100644 tests/baselines/reference/propertyAccessExpressionInnerComments.js create mode 100644 tests/baselines/reference/propertyAccessExpressionInnerComments.symbols create mode 100644 tests/baselines/reference/propertyAccessExpressionInnerComments.types create mode 100644 tests/baselines/reference/switchCaseInternalComments.js create mode 100644 tests/baselines/reference/switchCaseInternalComments.symbols create mode 100644 tests/baselines/reference/switchCaseInternalComments.types create mode 100644 tests/baselines/reference/tryStatementInternalComments.js create mode 100644 tests/baselines/reference/tryStatementInternalComments.symbols create mode 100644 tests/baselines/reference/tryStatementInternalComments.types create mode 100644 tests/baselines/reference/variableDeclarationInnerCommentEmit.js create mode 100644 tests/baselines/reference/variableDeclarationInnerCommentEmit.symbols create mode 100644 tests/baselines/reference/variableDeclarationInnerCommentEmit.types create mode 100644 tests/baselines/reference/whileStatementInnerComments.js create mode 100644 tests/baselines/reference/whileStatementInnerComments.symbols create mode 100644 tests/baselines/reference/whileStatementInnerComments.types create mode 100644 tests/baselines/reference/withStatementInternalComments.js create mode 100644 tests/baselines/reference/withStatementInternalComments.symbols create mode 100644 tests/baselines/reference/withStatementInternalComments.types create mode 100644 tests/baselines/reference/yieldExpressionInnerCommentEmit.js create mode 100644 tests/baselines/reference/yieldExpressionInnerCommentEmit.symbols create mode 100644 tests/baselines/reference/yieldExpressionInnerCommentEmit.types create mode 100644 tests/cases/compiler/awaitExpressionInnerCommentEmit.ts create mode 100644 tests/cases/compiler/continueStatementInternalComments.ts create mode 100644 tests/cases/compiler/elementAccessExpressionInternalComments.ts create mode 100644 tests/cases/compiler/emptyArgumentsListComment.ts create mode 100644 tests/cases/compiler/forStatementInnerComments.ts create mode 100644 tests/cases/compiler/ifStatementInternalComments.ts create mode 100644 tests/cases/compiler/importExportInternalComments.ts create mode 100644 tests/cases/compiler/keywordExpressionInternalComments.ts create mode 100644 tests/cases/compiler/parenthesizedExpressionInternalComments.ts create mode 100644 tests/cases/compiler/propertyAccessExpressionInnerComments.ts create mode 100644 tests/cases/compiler/switchCaseInternalComments.ts create mode 100644 tests/cases/compiler/tryStatementInternalComments.ts create mode 100644 tests/cases/compiler/variableDeclarationInnerCommentEmit.ts create mode 100644 tests/cases/compiler/whileStatementInnerComments.ts create mode 100644 tests/cases/compiler/withStatementInternalComments.ts create mode 100644 tests/cases/compiler/yieldExpressionInnerCommentEmit.ts diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 3fa05950b23..c18a7f74113 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -998,7 +998,8 @@ namespace ts { else { emitTypeAnnotation(node.type); } - emitInitializer(node.initializer); + // The comment position has to fallback to any present node within the parameterdeclaration because as it turns out, the parser can make parameter declarations with _just_ an initializer. + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.decorators ? node.decorators.end : node.pos, node); } function emitDecorator(decorator: Decorator) { @@ -1026,7 +1027,7 @@ namespace ts { emitIfPresent(node.questionToken); emitIfPresent(node.exclamationToken); emitTypeAnnotation(node.type); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); writeSemicolon(); } @@ -1308,7 +1309,7 @@ namespace ts { writeSpace(); } emit(node.name); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.name.end, node); } // @@ -1353,7 +1354,10 @@ namespace ts { increaseIndentIf(indentBeforeDot); const shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - writePunctuation(shouldEmitDotDot ? ".." : "."); + if (shouldEmitDotDot) { + writePunctuation("."); + } + emitTokenWithComment(SyntaxKind.DotToken, node.expression.end, writePunctuation, node); increaseIndentIf(indentAfterDot); emit(node.name); @@ -1382,9 +1386,9 @@ namespace ts { function emitElementAccessExpression(node: ElementAccessExpression) { emitExpression(node.expression); - writePunctuation("["); + const openPos = emitTokenWithComment(SyntaxKind.OpenBracketToken, node.expression.end, writePunctuation, node); emitExpression(node.argumentExpression); - writePunctuation("]"); + emitTokenWithComment(SyntaxKind.CloseBracketToken, node.argumentExpression ? node.argumentExpression.end : openPos, writePunctuation, node); } function emitCallExpression(node: CallExpression) { @@ -1394,7 +1398,7 @@ namespace ts { } function emitNewExpression(node: NewExpression) { - writeKeyword("new"); + emitTokenWithComment(SyntaxKind.NewKeyword, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); @@ -1415,9 +1419,9 @@ namespace ts { } function emitParenthesizedExpression(node: ParenthesizedExpression) { - writePunctuation("("); + const openParenPos = emitTokenWithComment(SyntaxKind.OpenParenToken, node.pos, writePunctuation, node); emitExpression(node.expression); - writePunctuation(")"); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression ? node.expression.end : openParenPos, writePunctuation, node); } function emitFunctionExpression(node: FunctionExpression) { @@ -1439,25 +1443,25 @@ namespace ts { } function emitDeleteExpression(node: DeleteExpression) { - writeKeyword("delete"); + emitTokenWithComment(SyntaxKind.DeleteKeyword, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node: TypeOfExpression) { - writeKeyword("typeof"); + emitTokenWithComment(SyntaxKind.TypeOfKeyword, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node: VoidExpression) { - writeKeyword("void"); + emitTokenWithComment(SyntaxKind.VoidKeyword, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node: AwaitExpression) { - writeKeyword("await"); + emitTokenWithComment(SyntaxKind.AwaitKeyword, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } @@ -1535,7 +1539,7 @@ namespace ts { } function emitYieldExpression(node: YieldExpression) { - writeKeyword("yield"); + emitTokenWithComment(SyntaxKind.YieldKeyword, node.pos, writeKeyword, node); emit(node.asteriskToken); emitExpressionWithLeadingSpace(node.expression); } @@ -1589,18 +1593,14 @@ namespace ts { // function emitBlock(node: Block) { - writeToken(SyntaxKind.OpenBraceToken, node.pos, writePunctuation, /*contextNode*/ node); emitBlockStatements(node, /*forceSingleLine*/ !node.multiLine && isEmptyBlock(node)); - // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted - increaseIndent(); - emitLeadingCommentsOfPosition(node.statements.end); - decreaseIndent(); - writeToken(SyntaxKind.CloseBraceToken, node.statements.end, writePunctuation, /*contextNode*/ node); } function emitBlockStatements(node: BlockLike, forceSingleLine: boolean) { + emitTokenWithComment(SyntaxKind.OpenBraceToken, node.pos, writePunctuation, /*contextNode*/ node); const format = forceSingleLine || getEmitFlags(node) & EmitFlags.SingleLine ? ListFormat.SingleLineBlockStatements : ListFormat.MultiLineBlockStatements; emitList(node, node.statements, format); + emitTokenWithComment(SyntaxKind.CloseBraceToken, node.statements.end, writePunctuation, /*contextNode*/ node, /*indentLeading*/ !!(format & ListFormat.MultiLine)); } function emitVariableStatement(node: VariableStatement) { @@ -1619,15 +1619,15 @@ namespace ts { } function emitIfStatement(node: IfStatement) { - const openParenPos = writeToken(SyntaxKind.IfKeyword, node.pos, writeKeyword, node); + const openParenPos = emitTokenWithComment(SyntaxKind.IfKeyword, node.pos, writeKeyword, node); writeSpace(); - writeToken(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); + emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation, node); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(SyntaxKind.ElseKeyword, node.thenStatement.end, writeKeyword, node); + emitTokenWithComment(SyntaxKind.ElseKeyword, node.thenStatement.end, writeKeyword, node); if (node.elseStatement.kind === SyntaxKind.IfStatement) { writeSpace(); emit(node.elseStatement); @@ -1638,8 +1638,16 @@ namespace ts { } } + function emitWhileClause(node: WhileStatement | DoStatement, startPos: number) { + const openParenPos = emitTokenWithComment(SyntaxKind.WhileKeyword, startPos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation, node); + } + function emitDoStatement(node: DoStatement) { - writeKeyword("do"); + emitTokenWithComment(SyntaxKind.DoKeyword, node.pos, writeKeyword, node); emitEmbeddedStatement(node, node.statement); if (isBlock(node.statement)) { writeSpace(); @@ -1648,59 +1656,52 @@ namespace ts { writeLineOrSpace(node); } - writeKeyword("while"); - writeSpace(); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(");"); + emitWhileClause(node, node.statement.end); + writePunctuation(";"); } function emitWhileStatement(node: WhileStatement) { - writeKeyword("while"); - writeSpace(); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(")"); + emitWhileClause(node, node.pos); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node: ForStatement) { - const openParenPos = writeToken(SyntaxKind.ForKeyword, node.pos, writeKeyword); + const openParenPos = emitTokenWithComment(SyntaxKind.ForKeyword, node.pos, writeKeyword, node); writeSpace(); - writeToken(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, /*contextNode*/ node); + let pos = emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, /*contextNode*/ node); emitForBinding(node.initializer); - writeSemicolon(); + pos = emitTokenWithComment(SyntaxKind.SemicolonToken, node.initializer ? node.initializer.end : pos, writeSemicolon, node); emitExpressionWithLeadingSpace(node.condition); - writeSemicolon(); + pos = emitTokenWithComment(SyntaxKind.SemicolonToken, node.condition ? node.condition.end : pos, writeSemicolon, node); emitExpressionWithLeadingSpace(node.incrementor); - writePunctuation(")"); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node: ForInStatement) { - const openParenPos = writeToken(SyntaxKind.ForKeyword, node.pos, writeKeyword); + const openParenPos = emitTokenWithComment(SyntaxKind.ForKeyword, node.pos, writeKeyword, node); writeSpace(); - writeToken(SyntaxKind.OpenParenToken, openParenPos, writePunctuation); + emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - writeKeyword("in"); + emitTokenWithComment(SyntaxKind.InKeyword, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writeToken(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node: ForOfStatement) { - const openParenPos = writeToken(SyntaxKind.ForKeyword, node.pos, writeKeyword); + const openParenPos = emitTokenWithComment(SyntaxKind.ForKeyword, node.pos, writeKeyword, node); writeSpace(); emitWithTrailingSpace(node.awaitModifier); - writeToken(SyntaxKind.OpenParenToken, openParenPos, writePunctuation); + emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - writeKeyword("of"); + emitTokenWithComment(SyntaxKind.OfKeyword, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writeToken(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } @@ -1716,24 +1717,36 @@ namespace ts { } function emitContinueStatement(node: ContinueStatement) { - writeToken(SyntaxKind.ContinueKeyword, node.pos, writeKeyword); + emitTokenWithComment(SyntaxKind.ContinueKeyword, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeSemicolon(); } function emitBreakStatement(node: BreakStatement) { - writeToken(SyntaxKind.BreakKeyword, node.pos, writeKeyword); + emitTokenWithComment(SyntaxKind.BreakKeyword, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeSemicolon(); } - function emitTokenWithComment(token: SyntaxKind, pos: number, writer: (s: string) => void, contextNode?: Node) { + function emitTokenWithComment(token: SyntaxKind, pos: number, writer: (s: string) => void, contextNode?: Node, indentLeading?: boolean) { const node = contextNode && getParseTreeNode(contextNode); - if (node && node.kind === contextNode.kind) { + const isSimilarNode = node && node.kind === contextNode.kind; + const startPos = pos; + if (isSimilarNode) { pos = skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, writer, /*contextNode*/ contextNode); - if (node && node.kind === contextNode.kind) { + if (emitLeadingCommentsOfPosition && isSimilarNode) { + const needsIndent = indentLeading && !positionsAreOnSameLine(startPos, pos, currentSourceFile); + if (needsIndent) { + increaseIndent(); + } + emitLeadingCommentsOfPosition(startPos); + if (needsIndent) { + decreaseIndent(); + } + } + pos = writeTokenText(token, writer, pos); + if (emitTrailingCommentsOfPosition && isSimilarNode) { emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); } return pos; @@ -1746,39 +1759,39 @@ namespace ts { } function emitWithStatement(node: WithStatement) { - writeKeyword("with"); + const openParenPos = emitTokenWithComment(SyntaxKind.WithKeyword, node.pos, writeKeyword, node); writeSpace(); - writePunctuation("("); + emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); emitExpression(node.expression); - writePunctuation(")"); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node: SwitchStatement) { - const openParenPos = writeToken(SyntaxKind.SwitchKeyword, node.pos, writeKeyword); + const openParenPos = emitTokenWithComment(SyntaxKind.SwitchKeyword, node.pos, writeKeyword, node); writeSpace(); - writeToken(SyntaxKind.OpenParenToken, openParenPos, writePunctuation); + emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.expression.end, writePunctuation, node); writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node: LabeledStatement) { emit(node.label); - writePunctuation(":"); + emitTokenWithComment(SyntaxKind.ColonToken, node.label.end, writePunctuation, node); writeSpace(); emit(node.statement); } function emitThrowStatement(node: ThrowStatement) { - writeKeyword("throw"); + emitTokenWithComment(SyntaxKind.ThrowKeyword, node.pos, writeKeyword, node); emitExpressionWithLeadingSpace(node.expression); writeSemicolon(); } function emitTryStatement(node: TryStatement) { - writeKeyword("try"); + emitTokenWithComment(SyntaxKind.TryKeyword, node.pos, writeKeyword, node); writeSpace(); emit(node.tryBlock); if (node.catchClause) { @@ -1787,7 +1800,7 @@ namespace ts { } if (node.finallyBlock) { writeLineOrSpace(node); - writeKeyword("finally"); + emitTokenWithComment(SyntaxKind.FinallyKeyword, (node.catchClause || node.tryBlock).end, writeKeyword, node); writeSpace(); emit(node.finallyBlock); } @@ -1805,7 +1818,7 @@ namespace ts { function emitVariableDeclaration(node: VariableDeclaration) { emit(node.name); emitTypeAnnotation(node.type); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node); } function emitVariableDeclarationList(node: VariableDeclarationList) { @@ -2043,25 +2056,23 @@ namespace ts { function emitModuleBlock(node: ModuleBlock) { pushNameGenerationScope(node); - writePunctuation("{"); emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node)); - writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node: CaseBlock) { - writeToken(SyntaxKind.OpenBraceToken, node.pos, writePunctuation); + emitTokenWithComment(SyntaxKind.OpenBraceToken, node.pos, writePunctuation, node); emitList(node, node.clauses, ListFormat.CaseBlockClauses); - writeToken(SyntaxKind.CloseBraceToken, node.clauses.end, writePunctuation); + emitTokenWithComment(SyntaxKind.CloseBraceToken, node.clauses.end, writePunctuation, node, /*indentLeading*/ true); } function emitImportEqualsDeclaration(node: ImportEqualsDeclaration) { emitModifiers(node, node.modifiers); - writeKeyword("import"); + emitTokenWithComment(SyntaxKind.ImportKeyword, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); emit(node.name); writeSpace(); - writePunctuation("="); + emitTokenWithComment(SyntaxKind.EqualsToken, node.name.end, writePunctuation, node); writeSpace(); emitModuleReference(node.moduleReference); writeSemicolon(); @@ -2078,12 +2089,12 @@ namespace ts { function emitImportDeclaration(node: ImportDeclaration) { emitModifiers(node, node.modifiers); - writeKeyword("import"); + emitTokenWithComment(SyntaxKind.ImportKeyword, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { emit(node.importClause); writeSpace(); - writeKeyword("from"); + emitTokenWithComment(SyntaxKind.FromKeyword, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -2093,16 +2104,16 @@ namespace ts { function emitImportClause(node: ImportClause) { emit(node.name); if (node.name && node.namedBindings) { - writePunctuation(","); + emitTokenWithComment(SyntaxKind.CommaToken, node.name.end, writePunctuation, node); writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node: NamespaceImport) { - writePunctuation("*"); + const asPos = emitTokenWithComment(SyntaxKind.AsteriskToken, node.pos, writePunctuation, node); writeSpace(); - writeKeyword("as"); + emitTokenWithComment(SyntaxKind.AsKeyword, asPos, writeKeyword, node); writeSpace(); emit(node.name); } @@ -2116,13 +2127,13 @@ namespace ts { } function emitExportAssignment(node: ExportAssignment) { - writeKeyword("export"); + const nextPos = emitTokenWithComment(SyntaxKind.ExportKeyword, node.pos, writeKeyword, node); writeSpace(); if (node.isExportEquals) { - writeOperator("="); + emitTokenWithComment(SyntaxKind.EqualsToken, nextPos, writeOperator, node); } else { - writeKeyword("default"); + emitTokenWithComment(SyntaxKind.DefaultKeyword, nextPos, writeKeyword, node); } writeSpace(); emitExpression(node.expression); @@ -2130,17 +2141,18 @@ namespace ts { } function emitExportDeclaration(node: ExportDeclaration) { - writeKeyword("export"); + let nextPos = emitTokenWithComment(SyntaxKind.ExportKeyword, node.pos, writeKeyword, node); writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - writePunctuation("*"); + nextPos = emitTokenWithComment(SyntaxKind.AsteriskToken, nextPos, writePunctuation, node); } if (node.moduleSpecifier) { writeSpace(); - writeKeyword("from"); + const fromPos = node.exportClause ? node.exportClause.end : nextPos; + emitTokenWithComment(SyntaxKind.FromKeyword, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } @@ -2148,11 +2160,11 @@ namespace ts { } function emitNamespaceExportDeclaration(node: NamespaceExportDeclaration) { - writeKeyword("export"); + let nextPos = emitTokenWithComment(SyntaxKind.ExportKeyword, node.pos, writeKeyword, node); writeSpace(); - writeKeyword("as"); + nextPos = emitTokenWithComment(SyntaxKind.AsKeyword, nextPos, writeKeyword, node); writeSpace(); - writeKeyword("namespace"); + nextPos = emitTokenWithComment(SyntaxKind.NamespaceKeyword, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeSemicolon(); @@ -2176,7 +2188,7 @@ namespace ts { if (node.propertyName) { emit(node.propertyName); writeSpace(); - writeKeyword("as"); + emitTokenWithComment(SyntaxKind.AsKeyword, node.propertyName.end, writeKeyword, node); writeSpace(); } @@ -2287,21 +2299,19 @@ namespace ts { // function emitCaseClause(node: CaseClause) { - writeKeyword("case"); + emitTokenWithComment(SyntaxKind.CaseKeyword, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writePunctuation(":"); - emitCaseOrDefaultClauseStatements(node, node.statements); + emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); } function emitDefaultClause(node: DefaultClause) { - writeKeyword("default"); - writePunctuation(":"); - emitCaseOrDefaultClauseStatements(node, node.statements); + const pos = emitTokenWithComment(SyntaxKind.DefaultKeyword, node.pos, writeKeyword, node); + emitCaseOrDefaultClauseRest(node, node.statements, pos); } - function emitCaseOrDefaultClauseStatements(parentNode: Node, statements: NodeArray) { + function emitCaseOrDefaultClauseRest(parentNode: Node, statements: NodeArray, colonPos: number) { const emitAsSingleStatement = statements.length === 1 && ( @@ -2311,27 +2321,15 @@ namespace ts { rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile) ); - // e.g: - // case 0: // Zero - // case 1: // One - // case 2: // two - // return "hi"; - // If there is no statements, emitNodeWithComments of the parentNode which is caseClause will take care of trailing comment. - // So in example above, comment "// Zero" and "// One" will be emit in emitTrailingComments in emitNodeWithComments. - // However, for "case 2", because parentNode which is caseClause has an "end" property to be end of the statements (in this case return statement) - // comment "// two" will not be emitted in emitNodeWithComments. - // Therefore, we have to do the check here to emit such comment. - if (statements.length > 0) { - // We use emitTrailingCommentsOfPosition instead of emitLeadingCommentsOfPosition because leading comments is defined as comments before the node after newline character separating it from previous line - // Note: we can't use parentNode.end as such position includes statements. - emitTrailingCommentsOfPosition(statements.pos); - } - let format = ListFormat.CaseOrDefaultClauseStatements; if (emitAsSingleStatement) { + writeToken(SyntaxKind.ColonToken, colonPos, writePunctuation, parentNode); writeSpace(); format &= ~(ListFormat.MultiLine | ListFormat.Indented); } + else { + emitTokenWithComment(SyntaxKind.ColonToken, colonPos, writePunctuation, parentNode); + } emitList(parentNode, statements, format); } @@ -2343,12 +2341,12 @@ namespace ts { } function emitCatchClause(node: CatchClause) { - const openParenPos = writeToken(SyntaxKind.CatchKeyword, node.pos, writeKeyword); + const openParenPos = emitTokenWithComment(SyntaxKind.CatchKeyword, node.pos, writeKeyword, node); writeSpace(); if (node.variableDeclaration) { - writeToken(SyntaxKind.OpenParenToken, openParenPos, writePunctuation); + emitTokenWithComment(SyntaxKind.OpenParenToken, openParenPos, writePunctuation, node); emit(node.variableDeclaration); - writeToken(SyntaxKind.CloseParenToken, node.variableDeclaration.end, writePunctuation); + emitTokenWithComment(SyntaxKind.CloseParenToken, node.variableDeclaration.end, writePunctuation, node); writeSpace(); } emit(node.block); @@ -2400,7 +2398,7 @@ namespace ts { function emitEnumMember(node: EnumMember) { emit(node.name); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.name.end, node); } // @@ -2530,10 +2528,10 @@ namespace ts { } } - function emitInitializer(node: Expression | undefined) { + function emitInitializer(node: Expression | undefined, equalCommentStartPos: number, container: Node) { if (node) { writeSpace(); - writeOperator("="); + emitTokenWithComment(SyntaxKind.EqualsToken, equalCommentStartPos, writeOperator, container); writeSpace(); emitExpression(node); } @@ -2674,6 +2672,9 @@ namespace ts { if (format & ListFormat.BracketsMask) { writePunctuation(getOpeningBracket(format)); + if (isEmpty) { + emitTrailingCommentsOfPosition(children.pos, /*prefixSpace*/ true); // Emit comments within empty bracketed lists + } } if (onBeforeEmitNodeArray) { @@ -2799,6 +2800,9 @@ namespace ts { } if (format & ListFormat.BracketsMask) { + if (isEmpty) { + emitLeadingCommentsOfPosition(children.end); // Emit leading comments within empty lists + } writePunctuation(getClosingBracket(format)); } } diff --git a/tests/baselines/reference/ES5For-of1.js.map b/tests/baselines/reference/ES5For-of1.js.map index 6415b662186..4f2996812ac 100644 --- a/tests/baselines/reference/ES5For-of1.js.map +++ b/tests/baselines/reference/ES5For-of1.js.map @@ -1,2 +1,2 @@ //// [ES5For-of1.js.map] -{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file +{"version":3,"file":"ES5For-of1.js","sourceRoot":"","sources":["ES5For-of1.ts"],"names":[],"mappings":"AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAClB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.sourcemap.txt b/tests/baselines/reference/ES5For-of1.sourcemap.txt index f6a89d058fe..30ac221a423 100644 --- a/tests/baselines/reference/ES5For-of1.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of1.sourcemap.txt @@ -10,56 +10,50 @@ sourceFile:ES5For-of1.ts ------------------------------------------------------------------- >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^ -9 > ^^ -10> ^^^ -11> ^^ -12> ^^^ -13> ^ -14> ^^ -15> ^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^ +7 > ^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ 1 > -2 >for -3 > -4 > (var v of -5 > ['a', 'b', 'c'] -6 > -7 > [ -8 > 'a' -9 > , -10> 'b' -11> , -12> 'c' -13> ] -14> -15> ['a', 'b', 'c'] -16> -17> ['a', 'b', 'c'] +2 >for (var v of +3 > ['a', 'b', 'c'] +4 > +5 > [ +6 > 'a' +7 > , +8 > 'b' +9 > , +10> 'c' +11> ] +12> +13> ['a', 'b', 'c'] +14> +15> ['a', 'b', 'c'] 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) -3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) -5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) -6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) -7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) -8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) -9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) -10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) -11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) -12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) -13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) -17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +2 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) +3 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) +5 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +7 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +8 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) +9 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) +10>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +11>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +12>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +13>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 56) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 60) Source(1, 30) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ diff --git a/tests/baselines/reference/ES5For-of13.js.map b/tests/baselines/reference/ES5For-of13.js.map index 1cb5d6039d3..1392eeb9bac 100644 --- a/tests/baselines/reference/ES5For-of13.js.map +++ b/tests/baselines/reference/ES5For-of13.js.map @@ -1,2 +1,2 @@ //// [ES5For-of13.js.map] -{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file +{"version":3,"file":"ES5For-of13.js","sourceRoot":"","sources":["ES5For-of13.ts"],"names":[],"mappings":"AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CACb"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of13.sourcemap.txt b/tests/baselines/reference/ES5For-of13.sourcemap.txt index a7386dddc50..b6cf15ca7fd 100644 --- a/tests/baselines/reference/ES5For-of13.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of13.sourcemap.txt @@ -10,56 +10,50 @@ sourceFile:ES5For-of13.ts ------------------------------------------------------------------- >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^ -9 > ^^ -10> ^^^ -11> ^^ -12> ^^^ -13> ^ -14> ^^ -15> ^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^ +7 > ^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ 1 > -2 >for -3 > -4 > (let v of -5 > ['a', 'b', 'c'] -6 > -7 > [ -8 > 'a' -9 > , -10> 'b' -11> , -12> 'c' -13> ] -14> -15> ['a', 'b', 'c'] -16> -17> ['a', 'b', 'c'] +2 >for (let v of +3 > ['a', 'b', 'c'] +4 > +5 > [ +6 > 'a' +7 > , +8 > 'b' +9 > , +10> 'c' +11> ] +12> +13> ['a', 'b', 'c'] +14> +15> ['a', 'b', 'c'] 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) -3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) -5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) -6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) -7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) -8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) -9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) -10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) -11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) -12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) -13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) -17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +2 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) +3 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) +5 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +7 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +8 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) +9 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) +10>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +11>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +12>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +13>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 56) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 60) Source(1, 30) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ diff --git a/tests/baselines/reference/ES5For-of25.js.map b/tests/baselines/reference/ES5For-of25.js.map index f1c97506f2d..d880d11d880 100644 --- a/tests/baselines/reference/ES5For-of25.js.map +++ b/tests/baselines/reference/ES5For-of25.js.map @@ -1,2 +1,2 @@ //// [ES5For-of25.js.map] -{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,GAAG,CAAC,CAAU,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC;IAAV,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of25.js","sourceRoot":"","sources":["ES5For-of25.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAClB,KAAc,UAAC,EAAD,OAAC,EAAD,eAAC,EAAD,IAAC;IAAV,IAAI,CAAC,UAAA;IACN,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of25.sourcemap.txt b/tests/baselines/reference/ES5For-of25.sourcemap.txt index 31b10538fa6..2559fb3791e 100644 --- a/tests/baselines/reference/ES5For-of25.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of25.sourcemap.txt @@ -49,39 +49,33 @@ sourceFile:ES5For-of25.ts --- >>>for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > -2 >for -3 > -4 > (var v of -5 > a -6 > -7 > a -8 > -9 > a -10> -11> a +2 >for (var v of +3 > a +4 > +5 > a +6 > +7 > a +8 > +9 > a 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 4) Source(2, 4) + SourceIndex(0) -3 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -4 >Emitted(2, 6) Source(2, 15) + SourceIndex(0) -5 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) -6 >Emitted(2, 18) Source(2, 15) + SourceIndex(0) -7 >Emitted(2, 25) Source(2, 16) + SourceIndex(0) -8 >Emitted(2, 27) Source(2, 15) + SourceIndex(0) -9 >Emitted(2, 42) Source(2, 16) + SourceIndex(0) -10>Emitted(2, 44) Source(2, 15) + SourceIndex(0) -11>Emitted(2, 48) Source(2, 16) + SourceIndex(0) +2 >Emitted(2, 6) Source(2, 15) + SourceIndex(0) +3 >Emitted(2, 16) Source(2, 16) + SourceIndex(0) +4 >Emitted(2, 18) Source(2, 15) + SourceIndex(0) +5 >Emitted(2, 25) Source(2, 16) + SourceIndex(0) +6 >Emitted(2, 27) Source(2, 15) + SourceIndex(0) +7 >Emitted(2, 42) Source(2, 16) + SourceIndex(0) +8 >Emitted(2, 44) Source(2, 15) + SourceIndex(0) +9 >Emitted(2, 48) Source(2, 16) + SourceIndex(0) --- >>> var v = a_1[_i]; 1 >^^^^ diff --git a/tests/baselines/reference/ES5For-of26.js.map b/tests/baselines/reference/ES5For-of26.js.map index 0afbe7ec42e..be52fcd01f1 100644 --- a/tests/baselines/reference/ES5For-of26.js.map +++ b/tests/baselines/reference/ES5For-of26.js.map @@ -1,2 +1,2 @@ //// [ES5For-of26.js.map] -{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAuB,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM;IAAxB,IAAA,WAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of26.js","sourceRoot":"","sources":["ES5For-of26.ts"],"names":[],"mappings":"AAAA,KAA2B,UAAM,EAAN,MAAC,CAAC,EAAE,CAAC,CAAC,EAAN,cAAM,EAAN,IAAM;IAAxB,IAAA,WAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;IAClB,CAAC,CAAC;IACF,CAAC,CAAC;CACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of26.sourcemap.txt b/tests/baselines/reference/ES5For-of26.sourcemap.txt index ce13a75e5cf..be84e5d6733 100644 --- a/tests/baselines/reference/ES5For-of26.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of26.sourcemap.txt @@ -10,51 +10,45 @@ sourceFile:ES5For-of26.ts ------------------------------------------------------------------- >>>for (var _i = 0, _a = [2, 3]; _i < _a.length; _i++) { 1 > -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -2 >for -3 > -4 > (var [a = 0, b = 1] of -5 > [2, 3] -6 > -7 > [ -8 > 2 -9 > , -10> 3 -11> ] -12> -13> [2, 3] -14> -15> [2, 3] +2 >for (var [a = 0, b = 1] of +3 > [2, 3] +4 > +5 > [ +6 > 2 +7 > , +8 > 3 +9 > ] +10> +11> [2, 3] +12> +13> [2, 3] 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) -3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -4 >Emitted(1, 6) Source(1, 28) + SourceIndex(0) -5 >Emitted(1, 16) Source(1, 34) + SourceIndex(0) -6 >Emitted(1, 18) Source(1, 28) + SourceIndex(0) -7 >Emitted(1, 24) Source(1, 29) + SourceIndex(0) -8 >Emitted(1, 25) Source(1, 30) + SourceIndex(0) -9 >Emitted(1, 27) Source(1, 32) + SourceIndex(0) -10>Emitted(1, 28) Source(1, 33) + SourceIndex(0) -11>Emitted(1, 29) Source(1, 34) + SourceIndex(0) -12>Emitted(1, 31) Source(1, 28) + SourceIndex(0) -13>Emitted(1, 45) Source(1, 34) + SourceIndex(0) -14>Emitted(1, 47) Source(1, 28) + SourceIndex(0) -15>Emitted(1, 51) Source(1, 34) + SourceIndex(0) +2 >Emitted(1, 6) Source(1, 28) + SourceIndex(0) +3 >Emitted(1, 16) Source(1, 34) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 28) + SourceIndex(0) +5 >Emitted(1, 24) Source(1, 29) + SourceIndex(0) +6 >Emitted(1, 25) Source(1, 30) + SourceIndex(0) +7 >Emitted(1, 27) Source(1, 32) + SourceIndex(0) +8 >Emitted(1, 28) Source(1, 33) + SourceIndex(0) +9 >Emitted(1, 29) Source(1, 34) + SourceIndex(0) +10>Emitted(1, 31) Source(1, 28) + SourceIndex(0) +11>Emitted(1, 45) Source(1, 34) + SourceIndex(0) +12>Emitted(1, 47) Source(1, 28) + SourceIndex(0) +13>Emitted(1, 51) Source(1, 34) + SourceIndex(0) --- >>> var _b = _a[_i], _c = _b[0], a = _c === void 0 ? 0 : _c, _d = _b[1], b = _d === void 0 ? 1 : _d; 1->^^^^ diff --git a/tests/baselines/reference/ES5For-of3.js.map b/tests/baselines/reference/ES5For-of3.js.map index ffcee0b3a52..e1687964d1c 100644 --- a/tests/baselines/reference/ES5For-of3.js.map +++ b/tests/baselines/reference/ES5For-of3.js.map @@ -1,2 +1,2 @@ //// [ES5For-of3.js.map] -{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAU,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"ES5For-of3.js","sourceRoot":"","sources":["ES5For-of3.ts"],"names":[],"mappings":"AAAA,KAAc,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAAxB,IAAI,CAAC,SAAA;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of3.sourcemap.txt b/tests/baselines/reference/ES5For-of3.sourcemap.txt index 4eea9dfaed4..f7d9233bfea 100644 --- a/tests/baselines/reference/ES5For-of3.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of3.sourcemap.txt @@ -10,56 +10,50 @@ sourceFile:ES5For-of3.ts ------------------------------------------------------------------- >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1 > -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^ -9 > ^^ -10> ^^^ -11> ^^ -12> ^^^ -13> ^ -14> ^^ -15> ^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^ +7 > ^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ 1 > -2 >for -3 > -4 > (var v of -5 > ['a', 'b', 'c'] -6 > -7 > [ -8 > 'a' -9 > , -10> 'b' -11> , -12> 'c' -13> ] -14> -15> ['a', 'b', 'c'] -16> -17> ['a', 'b', 'c'] +2 >for (var v of +3 > ['a', 'b', 'c'] +4 > +5 > [ +6 > 'a' +7 > , +8 > 'b' +9 > , +10> 'c' +11> ] +12> +13> ['a', 'b', 'c'] +14> +15> ['a', 'b', 'c'] 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) -3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -4 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) -5 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) -6 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) -7 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) -8 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) -9 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) -10>Emitted(1, 32) Source(1, 24) + SourceIndex(0) -11>Emitted(1, 34) Source(1, 26) + SourceIndex(0) -12>Emitted(1, 37) Source(1, 29) + SourceIndex(0) -13>Emitted(1, 38) Source(1, 30) + SourceIndex(0) -14>Emitted(1, 40) Source(1, 15) + SourceIndex(0) -15>Emitted(1, 54) Source(1, 30) + SourceIndex(0) -16>Emitted(1, 56) Source(1, 15) + SourceIndex(0) -17>Emitted(1, 60) Source(1, 30) + SourceIndex(0) +2 >Emitted(1, 6) Source(1, 15) + SourceIndex(0) +3 >Emitted(1, 16) Source(1, 30) + SourceIndex(0) +4 >Emitted(1, 18) Source(1, 15) + SourceIndex(0) +5 >Emitted(1, 24) Source(1, 16) + SourceIndex(0) +6 >Emitted(1, 27) Source(1, 19) + SourceIndex(0) +7 >Emitted(1, 29) Source(1, 21) + SourceIndex(0) +8 >Emitted(1, 32) Source(1, 24) + SourceIndex(0) +9 >Emitted(1, 34) Source(1, 26) + SourceIndex(0) +10>Emitted(1, 37) Source(1, 29) + SourceIndex(0) +11>Emitted(1, 38) Source(1, 30) + SourceIndex(0) +12>Emitted(1, 40) Source(1, 15) + SourceIndex(0) +13>Emitted(1, 54) Source(1, 30) + SourceIndex(0) +14>Emitted(1, 56) Source(1, 15) + SourceIndex(0) +15>Emitted(1, 60) Source(1, 30) + SourceIndex(0) --- >>> var v = _a[_i]; 1 >^^^^ diff --git a/tests/baselines/reference/ES5For-of33.js.map b/tests/baselines/reference/ES5For-of33.js.map index 5d5969b4585..21bdbf37da5 100644 --- a/tests/baselines/reference/ES5For-of33.js.map +++ b/tests/baselines/reference/ES5For-of33.js.map @@ -1,2 +1,2 @@ //// [ES5For-of33.js.map] -{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,GAAG,CAAC,CAAU,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA;QAAxB,IAAI,CAAC,WAAA;QACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAClB"} \ No newline at end of file +{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,KAAc,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA;QAAxB,IAAI,CAAC,WAAA;QACN,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAClB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of33.sourcemap.txt b/tests/baselines/reference/ES5For-of33.sourcemap.txt index 12dd243cf0e..9ca328a50e1 100644 --- a/tests/baselines/reference/ES5For-of33.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of33.sourcemap.txt @@ -21,53 +21,47 @@ sourceFile:ES5For-of33.ts >>>try { >>> for (var _a = __values(['a', 'b', 'c']), _b = _a.next(); !_b.done; _b = _a.next()) { 1 >^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^^^^^^^^ -8 > ^ -9 > ^^^ -10> ^^ -11> ^^^ -12> ^^ -13> ^^^ -14> ^ -15> ^ -16> ^^^^^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^^^^^^^^^ +6 > ^ +7 > ^^^ +8 > ^^ +9 > ^^^ +10> ^^ +11> ^^^ +12> ^ +13> ^ +14> ^^^^^^^^^^^^^^^^ 1 > -2 > for -3 > -4 > (var v of -5 > -6 > -7 > -8 > [ -9 > 'a' -10> , -11> 'b' -12> , -13> 'c' -14> ] -15> -16> +2 > for (var v of +3 > +4 > +5 > +6 > [ +7 > 'a' +8 > , +9 > 'b' +10> , +11> 'c' +12> ] +13> +14> 1 >Emitted(12, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(12, 8) Source(1, 4) + SourceIndex(0) -3 >Emitted(12, 9) Source(1, 5) + SourceIndex(0) -4 >Emitted(12, 10) Source(1, 15) + SourceIndex(0) -5 >Emitted(12, 14) Source(1, 15) + SourceIndex(0) -6 >Emitted(12, 19) Source(1, 15) + SourceIndex(0) -7 >Emitted(12, 28) Source(1, 15) + SourceIndex(0) -8 >Emitted(12, 29) Source(1, 16) + SourceIndex(0) -9 >Emitted(12, 32) Source(1, 19) + SourceIndex(0) -10>Emitted(12, 34) Source(1, 21) + SourceIndex(0) -11>Emitted(12, 37) Source(1, 24) + SourceIndex(0) -12>Emitted(12, 39) Source(1, 26) + SourceIndex(0) -13>Emitted(12, 42) Source(1, 29) + SourceIndex(0) -14>Emitted(12, 43) Source(1, 30) + SourceIndex(0) -15>Emitted(12, 44) Source(1, 30) + SourceIndex(0) -16>Emitted(12, 60) Source(1, 30) + SourceIndex(0) +2 >Emitted(12, 10) Source(1, 15) + SourceIndex(0) +3 >Emitted(12, 14) Source(1, 15) + SourceIndex(0) +4 >Emitted(12, 19) Source(1, 15) + SourceIndex(0) +5 >Emitted(12, 28) Source(1, 15) + SourceIndex(0) +6 >Emitted(12, 29) Source(1, 16) + SourceIndex(0) +7 >Emitted(12, 32) Source(1, 19) + SourceIndex(0) +8 >Emitted(12, 34) Source(1, 21) + SourceIndex(0) +9 >Emitted(12, 37) Source(1, 24) + SourceIndex(0) +10>Emitted(12, 39) Source(1, 26) + SourceIndex(0) +11>Emitted(12, 42) Source(1, 29) + SourceIndex(0) +12>Emitted(12, 43) Source(1, 30) + SourceIndex(0) +13>Emitted(12, 44) Source(1, 30) + SourceIndex(0) +14>Emitted(12, 60) Source(1, 30) + SourceIndex(0) --- >>> var v = _b.value; 1 >^^^^^^^^ diff --git a/tests/baselines/reference/ES5For-of34.js.map b/tests/baselines/reference/ES5For-of34.js.map index 041fda734b5..52f4812e855 100644 --- a/tests/baselines/reference/ES5For-of34.js.map +++ b/tests/baselines/reference/ES5For-of34.js.map @@ -1,2 +1,2 @@ //// [ES5For-of34.js.map] -{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;IACI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;;IACD,GAAG,CAAC,CAAY,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA;QAA1B,GAAG,EAAE,CAAC,CAAC,WAAA;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;KACnB"} \ No newline at end of file +{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;IACI,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;;IACD,KAAgB,IAAA,KAAA,SAAA,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA,gBAAA;QAA1B,GAAG,EAAE,CAAC,CAAC,WAAA;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;KACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of34.sourcemap.txt b/tests/baselines/reference/ES5For-of34.sourcemap.txt index 540d52cc581..00b6b6aa4d3 100644 --- a/tests/baselines/reference/ES5For-of34.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of34.sourcemap.txt @@ -26,33 +26,30 @@ sourceFile:ES5For-of34.ts --- >>> return { x: 0 }; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -6 > ^^ -7 > ^ -8 > ^^ -9 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^ +8 > ^ 1->function foo() { > -2 > return -3 > -4 > { -5 > x -6 > : -7 > 0 -8 > } -9 > ; +2 > return +3 > { +4 > x +5 > : +6 > 0 +7 > } +8 > ; 1->Emitted(12, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(2, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(2, 12) + SourceIndex(0) -4 >Emitted(12, 14) Source(2, 14) + SourceIndex(0) -5 >Emitted(12, 15) Source(2, 15) + SourceIndex(0) -6 >Emitted(12, 17) Source(2, 17) + SourceIndex(0) -7 >Emitted(12, 18) Source(2, 18) + SourceIndex(0) -8 >Emitted(12, 20) Source(2, 20) + SourceIndex(0) -9 >Emitted(12, 21) Source(2, 21) + SourceIndex(0) +2 >Emitted(12, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(12, 14) Source(2, 14) + SourceIndex(0) +4 >Emitted(12, 15) Source(2, 15) + SourceIndex(0) +5 >Emitted(12, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(12, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(12, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(12, 21) Source(2, 21) + SourceIndex(0) --- >>>} 1 > @@ -67,54 +64,48 @@ sourceFile:ES5For-of34.ts >>>try { >>> for (var _a = __values(['a', 'b', 'c']), _b = _a.next(); !_b.done; _b = _a.next()) { 1->^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^^^^^^^^ -8 > ^ -9 > ^^^ -10> ^^ -11> ^^^ -12> ^^ -13> ^^^ -14> ^ -15> ^ -16> ^^^^^^^^^^^^^^^^ +2 > ^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^^^^^^^^^ +6 > ^ +7 > ^^^ +8 > ^^ +9 > ^^^ +10> ^^ +11> ^^^ +12> ^ +13> ^ +14> ^^^^^^^^^^^^^^^^ 1-> > -2 > for -3 > -4 > (foo().x of -5 > -6 > -7 > -8 > [ -9 > 'a' -10> , -11> 'b' -12> , -13> 'c' -14> ] -15> -16> +2 > for (foo().x of +3 > +4 > +5 > +6 > [ +7 > 'a' +8 > , +9 > 'b' +10> , +11> 'c' +12> ] +13> +14> 1->Emitted(15, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(15, 8) Source(4, 4) + SourceIndex(0) -3 >Emitted(15, 9) Source(4, 5) + SourceIndex(0) -4 >Emitted(15, 10) Source(4, 17) + SourceIndex(0) -5 >Emitted(15, 14) Source(4, 17) + SourceIndex(0) -6 >Emitted(15, 19) Source(4, 17) + SourceIndex(0) -7 >Emitted(15, 28) Source(4, 17) + SourceIndex(0) -8 >Emitted(15, 29) Source(4, 18) + SourceIndex(0) -9 >Emitted(15, 32) Source(4, 21) + SourceIndex(0) -10>Emitted(15, 34) Source(4, 23) + SourceIndex(0) -11>Emitted(15, 37) Source(4, 26) + SourceIndex(0) -12>Emitted(15, 39) Source(4, 28) + SourceIndex(0) -13>Emitted(15, 42) Source(4, 31) + SourceIndex(0) -14>Emitted(15, 43) Source(4, 32) + SourceIndex(0) -15>Emitted(15, 44) Source(4, 32) + SourceIndex(0) -16>Emitted(15, 60) Source(4, 32) + SourceIndex(0) +2 >Emitted(15, 10) Source(4, 17) + SourceIndex(0) +3 >Emitted(15, 14) Source(4, 17) + SourceIndex(0) +4 >Emitted(15, 19) Source(4, 17) + SourceIndex(0) +5 >Emitted(15, 28) Source(4, 17) + SourceIndex(0) +6 >Emitted(15, 29) Source(4, 18) + SourceIndex(0) +7 >Emitted(15, 32) Source(4, 21) + SourceIndex(0) +8 >Emitted(15, 34) Source(4, 23) + SourceIndex(0) +9 >Emitted(15, 37) Source(4, 26) + SourceIndex(0) +10>Emitted(15, 39) Source(4, 28) + SourceIndex(0) +11>Emitted(15, 42) Source(4, 31) + SourceIndex(0) +12>Emitted(15, 43) Source(4, 32) + SourceIndex(0) +13>Emitted(15, 44) Source(4, 32) + SourceIndex(0) +14>Emitted(15, 60) Source(4, 32) + SourceIndex(0) --- >>> foo().x = _b.value; 1 >^^^^^^^^ diff --git a/tests/baselines/reference/ES5For-of35.js.map b/tests/baselines/reference/ES5For-of35.js.map index f1ee2418d17..f40fba90bf0 100644 --- a/tests/baselines/reference/ES5For-of35.js.map +++ b/tests/baselines/reference/ES5For-of35.js.map @@ -1,2 +1,2 @@ //// [ES5For-of35.js.map] -{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,GAAG,CAAC,CAA+B,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA;QAA9B,IAAA,aAAoB,EAAnB,SAAQ,EAAR,0BAAQ,EAAE,SAAQ,EAAR,0BAAQ;QAC1B,CAAC,CAAC;QACF,CAAC,CAAC;KACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";;;;;;;;;;;IAAA,KAAmC,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA;QAA9B,IAAA,aAAoB,EAAnB,SAAQ,EAAR,0BAAQ,EAAE,SAAQ,EAAR,0BAAQ;QAC1B,CAAC,CAAC;QACF,CAAC,CAAC;KACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of35.sourcemap.txt b/tests/baselines/reference/ES5For-of35.sourcemap.txt index 1961188da49..66ba7d1dca4 100644 --- a/tests/baselines/reference/ES5For-of35.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of35.sourcemap.txt @@ -21,48 +21,42 @@ sourceFile:ES5For-of35.ts >>>try { >>> for (var _a = __values([2, 3]), _b = _a.next(); !_b.done; _b = _a.next()) { 1 >^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^^^^^^^^ -8 > ^ -9 > ^ -10> ^^ -11> ^ -12> ^ -13> ^ -14> ^^^^^^^^^^^^^^^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^ +9 > ^ +10> ^ +11> ^ +12> ^^^^^^^^^^^^^^^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -2 > for -3 > -4 > (const {x: a = 0, y: b = 1} of -5 > -6 > -7 > -8 > [ -9 > 2 -10> , -11> 3 -12> ] -13> -14> +2 > for (const {x: a = 0, y: b = 1} of +3 > +4 > +5 > +6 > [ +7 > 2 +8 > , +9 > 3 +10> ] +11> +12> 1 >Emitted(12, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(12, 8) Source(1, 4) + SourceIndex(0) -3 >Emitted(12, 9) Source(1, 5) + SourceIndex(0) -4 >Emitted(12, 10) Source(1, 36) + SourceIndex(0) -5 >Emitted(12, 14) Source(1, 36) + SourceIndex(0) -6 >Emitted(12, 19) Source(1, 36) + SourceIndex(0) -7 >Emitted(12, 28) Source(1, 36) + SourceIndex(0) -8 >Emitted(12, 29) Source(1, 37) + SourceIndex(0) -9 >Emitted(12, 30) Source(1, 38) + SourceIndex(0) -10>Emitted(12, 32) Source(1, 40) + SourceIndex(0) -11>Emitted(12, 33) Source(1, 41) + SourceIndex(0) -12>Emitted(12, 34) Source(1, 42) + SourceIndex(0) -13>Emitted(12, 35) Source(1, 42) + SourceIndex(0) -14>Emitted(12, 51) Source(1, 42) + SourceIndex(0) +2 >Emitted(12, 10) Source(1, 36) + SourceIndex(0) +3 >Emitted(12, 14) Source(1, 36) + SourceIndex(0) +4 >Emitted(12, 19) Source(1, 36) + SourceIndex(0) +5 >Emitted(12, 28) Source(1, 36) + SourceIndex(0) +6 >Emitted(12, 29) Source(1, 37) + SourceIndex(0) +7 >Emitted(12, 30) Source(1, 38) + SourceIndex(0) +8 >Emitted(12, 32) Source(1, 40) + SourceIndex(0) +9 >Emitted(12, 33) Source(1, 41) + SourceIndex(0) +10>Emitted(12, 34) Source(1, 42) + SourceIndex(0) +11>Emitted(12, 35) Source(1, 42) + SourceIndex(0) +12>Emitted(12, 51) Source(1, 42) + SourceIndex(0) --- >>> var _c = _b.value, _d = _c.x, a = _d === void 0 ? 0 : _d, _e = _c.y, b = _e === void 0 ? 1 : _e; 1->^^^^^^^^ diff --git a/tests/baselines/reference/ES5For-of36.js.map b/tests/baselines/reference/ES5For-of36.js.map index f53bc850818..90fbff64753 100644 --- a/tests/baselines/reference/ES5For-of36.js.map +++ b/tests/baselines/reference/ES5For-of36.js.map @@ -1,2 +1,2 @@ //// [ES5For-of36.js.map] -{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,GAAG,CAAC,CAAuB,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA;QAAxB,IAAA,wBAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;QAClB,CAAC,CAAC;QACF,CAAC,CAAC;KACL"} \ No newline at end of file +{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,KAA2B,IAAA,KAAA,SAAA,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA,gBAAA;QAAxB,IAAA,wBAAc,EAAb,UAAK,EAAL,0BAAK,EAAE,UAAK,EAAL,0BAAK;QAClB,CAAC,CAAC;QACF,CAAC,CAAC;KACL"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of36.sourcemap.txt b/tests/baselines/reference/ES5For-of36.sourcemap.txt index 4b16e02b3b1..65da4ca312c 100644 --- a/tests/baselines/reference/ES5For-of36.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of36.sourcemap.txt @@ -37,48 +37,42 @@ sourceFile:ES5For-of36.ts >>>try { >>> for (var _a = __values([2, 3]), _b = _a.next(); !_b.done; _b = _a.next()) { 1 >^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^ -7 > ^^^^^^^^^ -8 > ^ -9 > ^ -10> ^^ -11> ^ -12> ^ -13> ^ -14> ^^^^^^^^^^^^^^^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^^^^^^^^^ +6 > ^ +7 > ^ +8 > ^^ +9 > ^ +10> ^ +11> ^ +12> ^^^^^^^^^^^^^^^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -2 > for -3 > -4 > (let [a = 0, b = 1] of -5 > -6 > -7 > -8 > [ -9 > 2 -10> , -11> 3 -12> ] -13> -14> +2 > for (let [a = 0, b = 1] of +3 > +4 > +5 > +6 > [ +7 > 2 +8 > , +9 > 3 +10> ] +11> +12> 1 >Emitted(28, 5) Source(1, 1) + SourceIndex(0) -2 >Emitted(28, 8) Source(1, 4) + SourceIndex(0) -3 >Emitted(28, 9) Source(1, 5) + SourceIndex(0) -4 >Emitted(28, 10) Source(1, 28) + SourceIndex(0) -5 >Emitted(28, 14) Source(1, 28) + SourceIndex(0) -6 >Emitted(28, 19) Source(1, 28) + SourceIndex(0) -7 >Emitted(28, 28) Source(1, 28) + SourceIndex(0) -8 >Emitted(28, 29) Source(1, 29) + SourceIndex(0) -9 >Emitted(28, 30) Source(1, 30) + SourceIndex(0) -10>Emitted(28, 32) Source(1, 32) + SourceIndex(0) -11>Emitted(28, 33) Source(1, 33) + SourceIndex(0) -12>Emitted(28, 34) Source(1, 34) + SourceIndex(0) -13>Emitted(28, 35) Source(1, 34) + SourceIndex(0) -14>Emitted(28, 51) Source(1, 34) + SourceIndex(0) +2 >Emitted(28, 10) Source(1, 28) + SourceIndex(0) +3 >Emitted(28, 14) Source(1, 28) + SourceIndex(0) +4 >Emitted(28, 19) Source(1, 28) + SourceIndex(0) +5 >Emitted(28, 28) Source(1, 28) + SourceIndex(0) +6 >Emitted(28, 29) Source(1, 29) + SourceIndex(0) +7 >Emitted(28, 30) Source(1, 30) + SourceIndex(0) +8 >Emitted(28, 32) Source(1, 32) + SourceIndex(0) +9 >Emitted(28, 33) Source(1, 33) + SourceIndex(0) +10>Emitted(28, 34) Source(1, 34) + SourceIndex(0) +11>Emitted(28, 35) Source(1, 34) + SourceIndex(0) +12>Emitted(28, 51) Source(1, 34) + SourceIndex(0) --- >>> var _c = __read(_b.value, 2), _d = _c[0], a = _d === void 0 ? 0 : _d, _e = _c[1], b = _e === void 0 ? 1 : _e; 1->^^^^^^^^ diff --git a/tests/baselines/reference/ES5For-of8.js.map b/tests/baselines/reference/ES5For-of8.js.map index 1f6cf096412..054440c5c63 100644 --- a/tests/baselines/reference/ES5For-of8.js.map +++ b/tests/baselines/reference/ES5For-of8.js.map @@ -1,2 +1,2 @@ //// [ES5For-of8.js.map] -{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA;IACI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAY,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAA1B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"ES5For-of8.js","sourceRoot":"","sources":["ES5For-of8.ts"],"names":[],"mappings":"AAAA;IACI,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAgB,UAAe,EAAf,MAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAf,cAAe,EAAf,IAAe;IAA1B,GAAG,EAAE,CAAC,CAAC,SAAA;IACR,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of8.sourcemap.txt b/tests/baselines/reference/ES5For-of8.sourcemap.txt index 1a58d5f107b..5520a965958 100644 --- a/tests/baselines/reference/ES5For-of8.sourcemap.txt +++ b/tests/baselines/reference/ES5For-of8.sourcemap.txt @@ -16,33 +16,30 @@ sourceFile:ES5For-of8.ts --- >>> return { x: 0 }; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -6 > ^^ -7 > ^ -8 > ^^ -9 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^ +8 > ^ 1->function foo() { > -2 > return -3 > -4 > { -5 > x -6 > : -7 > 0 -8 > } -9 > ; +2 > return +3 > { +4 > x +5 > : +6 > 0 +7 > } +8 > ; 1->Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) -3 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -4 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) -5 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) -6 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) -7 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) -8 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) -9 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) +2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) +4 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) +5 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(2, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) --- >>>} 1 > @@ -56,57 +53,51 @@ sourceFile:ES5For-of8.ts --- >>>for (var _i = 0, _a = ['a', 'b', 'c']; _i < _a.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^ -9 > ^^ -10> ^^^ -11> ^^ -12> ^^^ -13> ^ -14> ^^ -15> ^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^ +7 > ^^ +8 > ^^^ +9 > ^^ +10> ^^^ +11> ^ +12> ^^ +13> ^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^ 1-> > -2 >for -3 > -4 > (foo().x of -5 > ['a', 'b', 'c'] -6 > -7 > [ -8 > 'a' -9 > , -10> 'b' -11> , -12> 'c' -13> ] -14> -15> ['a', 'b', 'c'] -16> -17> ['a', 'b', 'c'] +2 >for (foo().x of +3 > ['a', 'b', 'c'] +4 > +5 > [ +6 > 'a' +7 > , +8 > 'b' +9 > , +10> 'c' +11> ] +12> +13> ['a', 'b', 'c'] +14> +15> ['a', 'b', 'c'] 1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) -3 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -4 >Emitted(4, 6) Source(4, 17) + SourceIndex(0) -5 >Emitted(4, 16) Source(4, 32) + SourceIndex(0) -6 >Emitted(4, 18) Source(4, 17) + SourceIndex(0) -7 >Emitted(4, 24) Source(4, 18) + SourceIndex(0) -8 >Emitted(4, 27) Source(4, 21) + SourceIndex(0) -9 >Emitted(4, 29) Source(4, 23) + SourceIndex(0) -10>Emitted(4, 32) Source(4, 26) + SourceIndex(0) -11>Emitted(4, 34) Source(4, 28) + SourceIndex(0) -12>Emitted(4, 37) Source(4, 31) + SourceIndex(0) -13>Emitted(4, 38) Source(4, 32) + SourceIndex(0) -14>Emitted(4, 40) Source(4, 17) + SourceIndex(0) -15>Emitted(4, 54) Source(4, 32) + SourceIndex(0) -16>Emitted(4, 56) Source(4, 17) + SourceIndex(0) -17>Emitted(4, 60) Source(4, 32) + SourceIndex(0) +2 >Emitted(4, 6) Source(4, 17) + SourceIndex(0) +3 >Emitted(4, 16) Source(4, 32) + SourceIndex(0) +4 >Emitted(4, 18) Source(4, 17) + SourceIndex(0) +5 >Emitted(4, 24) Source(4, 18) + SourceIndex(0) +6 >Emitted(4, 27) Source(4, 21) + SourceIndex(0) +7 >Emitted(4, 29) Source(4, 23) + SourceIndex(0) +8 >Emitted(4, 32) Source(4, 26) + SourceIndex(0) +9 >Emitted(4, 34) Source(4, 28) + SourceIndex(0) +10>Emitted(4, 37) Source(4, 31) + SourceIndex(0) +11>Emitted(4, 38) Source(4, 32) + SourceIndex(0) +12>Emitted(4, 40) Source(4, 17) + SourceIndex(0) +13>Emitted(4, 54) Source(4, 32) + SourceIndex(0) +14>Emitted(4, 56) Source(4, 17) + SourceIndex(0) +15>Emitted(4, 60) Source(4, 32) + SourceIndex(0) --- >>> foo().x = _a[_i]; 1 >^^^^ diff --git a/tests/baselines/reference/awaitExpressionInnerCommentEmit.js b/tests/baselines/reference/awaitExpressionInnerCommentEmit.js new file mode 100644 index 00000000000..4cc1ccad8b5 --- /dev/null +++ b/tests/baselines/reference/awaitExpressionInnerCommentEmit.js @@ -0,0 +1,13 @@ +//// [awaitExpressionInnerCommentEmit.ts] +async function foo() { + /*comment1*/ await 1; + await /*comment2*/ 2; + await 3 /*comment3*/ +} + +//// [awaitExpressionInnerCommentEmit.js] +async function foo() { + /*comment1*/ await 1; + await /*comment2*/ 2; + await 3; /*comment3*/ +} diff --git a/tests/baselines/reference/awaitExpressionInnerCommentEmit.symbols b/tests/baselines/reference/awaitExpressionInnerCommentEmit.symbols new file mode 100644 index 00000000000..862c8bbb0a5 --- /dev/null +++ b/tests/baselines/reference/awaitExpressionInnerCommentEmit.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/awaitExpressionInnerCommentEmit.ts === +async function foo() { +>foo : Symbol(foo, Decl(awaitExpressionInnerCommentEmit.ts, 0, 0)) + + /*comment1*/ await 1; + await /*comment2*/ 2; + await 3 /*comment3*/ +} diff --git a/tests/baselines/reference/awaitExpressionInnerCommentEmit.types b/tests/baselines/reference/awaitExpressionInnerCommentEmit.types new file mode 100644 index 00000000000..40757103972 --- /dev/null +++ b/tests/baselines/reference/awaitExpressionInnerCommentEmit.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/awaitExpressionInnerCommentEmit.ts === +async function foo() { +>foo : () => Promise + + /*comment1*/ await 1; +>await 1 : 1 +>1 : 1 + + await /*comment2*/ 2; +>await /*comment2*/ 2 : 2 +>2 : 2 + + await 3 /*comment3*/ +>await 3 : 3 +>3 : 3 +} diff --git a/tests/baselines/reference/commentInEmptyParameterList1.js b/tests/baselines/reference/commentInEmptyParameterList1.js index 8f4e13d82d6..09b34f93536 100644 --- a/tests/baselines/reference/commentInEmptyParameterList1.js +++ b/tests/baselines/reference/commentInEmptyParameterList1.js @@ -3,5 +3,5 @@ function foo(/** nothing */) { } //// [commentInEmptyParameterList1.js] -function foo() { +function foo( /** nothing */) { } diff --git a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js index d014043dfe0..523eaf2033f 100644 --- a/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js +++ b/tests/baselines/reference/commentOnParenthesizedExpressionOpenParen1.js @@ -7,4 +7,4 @@ var f: () => any; //// [commentOnParenthesizedExpressionOpenParen1.js] var j; var f; -(j = f()); +( /* Preserve */j = f()); diff --git a/tests/baselines/reference/commentsAfterCaseClauses1.js b/tests/baselines/reference/commentsAfterCaseClauses1.js index e12fe703335..837d5d6923e 100644 --- a/tests/baselines/reference/commentsAfterCaseClauses1.js +++ b/tests/baselines/reference/commentsAfterCaseClauses1.js @@ -19,13 +19,13 @@ function getSecurity(level) { switch (level) { case 0: // Zero case 1: // one - case 2:// two + case 2: // two return "Hi"; case 3: // three - case 4:// four + case 4: // four return "hello"; case 5: // five - default:// default + default: // default return "world"; } } diff --git a/tests/baselines/reference/commentsAfterCaseClauses2.js b/tests/baselines/reference/commentsAfterCaseClauses2.js index 44cd3c0da74..cb15d44965b 100644 --- a/tests/baselines/reference/commentsAfterCaseClauses2.js +++ b/tests/baselines/reference/commentsAfterCaseClauses2.js @@ -22,15 +22,16 @@ function getSecurity(level) { switch (level) { case 0: // Zero case 1: // one - case 2:// two + case 2: // two // Leading comments return "Hi"; case 3: // three - case 4:// four + case 4: // four return "hello"; case 5: // five - default:// default + default: // default return "world"; + // Comment After } /*Comment 1*/ // Comment After 1 // Comment After 2 } diff --git a/tests/baselines/reference/commentsAfterCaseClauses3.js b/tests/baselines/reference/commentsAfterCaseClauses3.js index 9538ad06c4f..2e7b71d3dd6 100644 --- a/tests/baselines/reference/commentsAfterCaseClauses3.js +++ b/tests/baselines/reference/commentsAfterCaseClauses3.js @@ -21,14 +21,14 @@ function getSecurity(level) { switch (level) { case 0: /*Zero*/ case 1: /*One*/ - case 2:/*two*/ + case 2: /*two*/ // Leading comments return "Hi"; case 3: /*three*/ - case 4:/*four*/ + case 4: /*four*/ return "hello"; case 5: /*five*/ - default:/*six*/ + default: /*six*/ return "world"; } } diff --git a/tests/baselines/reference/commentsFunction.js b/tests/baselines/reference/commentsFunction.js index 5588a27f5ba..23aa13aae91 100644 --- a/tests/baselines/reference/commentsFunction.js +++ b/tests/baselines/reference/commentsFunction.js @@ -73,8 +73,8 @@ var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b) { return b; }; /// lamdaFoo var comment -var lambdaFoo = function (/**param a*/ a, /**param b*/ b) { return a + b; }; -var lambddaNoVarComment = function (/**param a*/ a, /**param b*/ b) { return a * b; }; +var lambdaFoo = /** this is lambda comment*/ function (/**param a*/ a, /**param b*/ b) { return a + b; }; +var lambddaNoVarComment = /** this is lambda multiplication*/ function (/**param a*/ a, /**param b*/ b) { return a * b; }; lambdaFoo(10, 20); lambddaNoVarComment(10, 20); function blah(a /* multiline trailing comment diff --git a/tests/baselines/reference/commentsVarDecl.js b/tests/baselines/reference/commentsVarDecl.js index 001b3b5ed1f..ec90264b690 100644 --- a/tests/baselines/reference/commentsVarDecl.js +++ b/tests/baselines/reference/commentsVarDecl.js @@ -63,13 +63,13 @@ x = myVariable; /** jsdocstyle comment - only this comment should be in .d.ts file*/ var n = 30; /** var deckaration with comment on type as well*/ -var y = 20; +var y = /** value comment */ 20; /// var deckaration with comment on type as well var yy = /// value comment 20; /** comment2 */ -var z = function (x, y) { return x + y; }; +var z = /** lambda comment */ function (x, y) { return x + y; }; var z2; var x2 = z2; var n4; diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map index 114df45af46..84b959d8cce 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap1_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,sBAAW;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,sBAAW;aAAf;YACF,OAAO,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt index 506d30c4fbf..c8fbb2cc1db 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES5.sourcemap.txt @@ -95,21 +95,18 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts --- >>> return 0; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1->get ["goodbye"]() { > -2 > return -3 > -4 > 0 -5 > ; +2 > return +3 > 0 +4 > ; 1->Emitted(9, 13) Source(6, 3) + SourceIndex(0) -2 >Emitted(9, 19) Source(6, 9) + SourceIndex(0) -3 >Emitted(9, 20) Source(6, 10) + SourceIndex(0) -4 >Emitted(9, 21) Source(6, 11) + SourceIndex(0) -5 >Emitted(9, 22) Source(6, 12) + SourceIndex(0) +2 >Emitted(9, 20) Source(6, 10) + SourceIndex(0) +3 >Emitted(9, 21) Source(6, 11) + SourceIndex(0) +4 >Emitted(9, 22) Source(6, 12) + SourceIndex(0) --- >>> }, 1 >^^^^^^^^ diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map index 64c3283f702..bcfa87996bf 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap1_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;CACD"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,OAAO,CAAC,CAAC;IACV,CAAC;CACD"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt index 2463a24e085..b2f78ea1142 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap1_ES6.sourcemap.txt @@ -72,21 +72,18 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts --- >>> return 0; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1 >() { > -2 > return -3 > -4 > 0 -5 > ; +2 > return +3 > 0 +4 > ; 1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) -2 >Emitted(6, 15) Source(6, 9) + SourceIndex(0) -3 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) -4 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) -5 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +2 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) +3 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) +4 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map index 36259a4c7cb..24dd2e2afb7 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES5.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC;IACD,GAAC,OAAO,IAAR;QACI,QAAQ,CAAC;IAChB,CAAC;0BACM,aAAW;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACV,CAAC;;;;OACD,CAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC;IACD,GAAC,OAAO,IAAR;QACI,QAAQ,CAAC;IAChB,CAAC;0BACM,aAAW;aAAf;YACF,OAAO,CAAC,CAAC;QACV,CAAC;;;;OACD,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt index aa20d1d7960..9b44702cb22 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES5.sourcemap.txt @@ -74,21 +74,18 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts --- >>> return 0; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1->get ["goodbye"]() { > -2 > return -3 > -4 > 0 -5 > ; +2 > return +3 > 0 +4 > ; 1->Emitted(7, 13) Source(6, 3) + SourceIndex(0) -2 >Emitted(7, 19) Source(6, 9) + SourceIndex(0) -3 >Emitted(7, 20) Source(6, 10) + SourceIndex(0) -4 >Emitted(7, 21) Source(6, 11) + SourceIndex(0) -5 >Emitted(7, 22) Source(6, 12) + SourceIndex(0) +2 >Emitted(7, 20) Source(6, 10) + SourceIndex(0) +3 >Emitted(7, 21) Source(6, 11) + SourceIndex(0) +4 >Emitted(7, 22) Source(6, 12) + SourceIndex(0) --- >>> }, 1 >^^^^^^^^ diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map index e1f238177b2..2b44c1516a4 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.js.map @@ -1,2 +1,2 @@ //// [computedPropertyNamesSourceMap2_ES6.js.map] -{"version":3,"file":"computedPropertyNamesSourceMap2_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES6.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;CACD,CAAA"} \ No newline at end of file +{"version":3,"file":"computedPropertyNamesSourceMap2_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES6.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,OAAO,CAAC,CAAC;IACV,CAAC;CACD,CAAA"} \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt index e0aeed1efbd..b58721faaed 100644 --- a/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt +++ b/tests/baselines/reference/computedPropertyNamesSourceMap2_ES6.sourcemap.txt @@ -81,21 +81,18 @@ sourceFile:computedPropertyNamesSourceMap2_ES6.ts --- >>> return 0; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1 >() { > -2 > return -3 > -4 > 0 -5 > ; +2 > return +3 > 0 +4 > ; 1 >Emitted(6, 9) Source(6, 3) + SourceIndex(0) -2 >Emitted(6, 15) Source(6, 9) + SourceIndex(0) -3 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) -4 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) -5 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) +2 >Emitted(6, 16) Source(6, 10) + SourceIndex(0) +3 >Emitted(6, 17) Source(6, 11) + SourceIndex(0) +4 >Emitted(6, 18) Source(6, 12) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/contextualTyping.js.map b/tests/baselines/reference/contextualTyping.js.map index 24a38dc407d..12b2a0da322 100644 --- a/tests/baselines/reference/contextualTyping.js.map +++ b/tests/baselines/reference/contextualTyping.js.map @@ -1,2 +1,2 @@ //// [contextualTyping.js.map] -{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":[],"mappings":"AAYA,sCAAsC;AACtC;IAAA;QACI,QAAG,GAAqC,UAAS,CAAC;YAC9C,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;IAAD,WAAC;AAAD,CAAC,AAJD,IAIC;AAED,uCAAuC;AACvC,IAAO,IAAI,CAIV;AAJD,WAAO,IAAI;IACI,QAAG,GAAqC,UAAS,CAAC;QACzD,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EAJM,IAAI,KAAJ,IAAI,QAIV;AAED,gCAAgC;AAChC,IAAI,IAAI,GAA0B,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,IAAI,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAA;AACF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,IAAI,IAAI,GAAe,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,IAAI,KAAK,GAAS;IACd,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,qCAAqC;AACrC;IAEI;QACI,IAAI,CAAC,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;YACpB,MAAM,CAAC,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;IACL,WAAC;AAAD,CAAC,AAPD,IAOC;AAED,sCAAsC;AACtC,IAAO,IAAI,CAKV;AALD,WAAO,IAAI;IAEP,KAAA,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;QACf,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EALM,IAAI,KAAJ,IAAI,QAKV;AAED,+BAA+B;AAC/B,IAAI,IAAyB,CAAC;AAC9B,IAAI,GAAwB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAE9D,kCAAkC;AAClC,IAAI,IAAY,CAAC;AACjB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AACtC,KAAK,CAAC,EAAE,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,CAAC,GAAG,GAAG;IACR,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AACF,yBAAyB;AACzB,cAAc,CAAsB,IAAG,CAAC;AAAA,CAAC;AACzC,IAAI,CAAC,UAAS,CAAC;IACX,MAAM,CAAO,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,4BAA4B;AAC5B,IAAI,KAAK,GAA8B,cAAa,MAAM,CAAC,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE/F,0BAA0B;AAC1B;IAAc,eAAY,CAAsB;IAAI,CAAC;IAAC,YAAC;AAAD,CAAC,AAAvD,IAAuD;AAAA,CAAC;AACxD,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAErD,qCAAqC;AACrC,IAAI,KAAK,GAA2B,CAAC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC/D,IAAI,KAAK,GAAU,CAAC;IAChB,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,IAAI,KAAK,GAAc,EAAE,CAAC;AAC1B,IAAI,KAAK,GAAgB,cAAa,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAO,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ,IAAI,MAAM,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,GAAY,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,aAAa,CAAC,EAAC,CAAC,IAAI,MAAM,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,eAAe,CAAC,EAAE,CAAC;IACf,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAEX,MAAM,CAAC,IAAI,CAAC;AAChB,CAAC;AAED,KAAK,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAAE,EAAE;IACjC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,GAAG;IACd,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,UAAS,EAAE,EAAE,EAAE;QAChB,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAC;AAIF,IAAI,CAAC,GAAM,EAAG,CAAC"} \ No newline at end of file +{"version":3,"file":"contextualTyping.js","sourceRoot":"","sources":["contextualTyping.ts"],"names":[],"mappings":"AAYA,sCAAsC;AACtC;IAAA;QACI,QAAG,GAAqC,UAAS,CAAC;YAC9C,OAAO,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;IAAD,WAAC;AAAD,CAAC,AAJD,IAIC;AAED,uCAAuC;AACvC,IAAO,IAAI,CAIV;AAJD,WAAO,IAAI;IACI,QAAG,GAAqC,UAAS,CAAC;QACzD,OAAO,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EAJM,IAAI,KAAJ,IAAI,QAIV;AAED,gCAAgC;AAChC,IAAI,IAAI,GAA0B,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC7D,IAAI,IAAI,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAA;AACF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,IAAI,IAAI,GAAe,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACxD,IAAI,IAAI,GAAwB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClE,IAAI,IAAI,GAAmC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChF,IAAI,IAAI,GAGJ,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9B,IAAI,IAAI,GAAqC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,IAAI,IAAI,GAAe,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AAC/B,IAAI,KAAK,GAAW,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,IAAI,KAAK,GAAwC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,IAAI,KAAK,GAAS;IACd,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,KAAK,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAEF,qCAAqC;AACrC;IAEI;QACI,IAAI,CAAC,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,CAAC;QACb,CAAC,CAAA;IACL,CAAC;IACL,WAAC;AAAD,CAAC,AAPD,IAOC;AAED,sCAAsC;AACtC,IAAO,IAAI,CAKV;AALD,WAAO,IAAI;IAEP,KAAA,GAAG,GAAG,UAAS,CAAC,EAAE,CAAC;QACf,OAAO,CAAC,CAAC;IACb,CAAC,CAAA;AACL,CAAC,EALM,IAAI,KAAJ,IAAI,QAKV;AAED,+BAA+B;AAC/B,IAAI,IAAyB,CAAC;AAC9B,IAAI,GAAwB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAE9D,kCAAkC;AAClC,IAAI,IAAY,CAAC;AACjB,IAAI,CAAC,CAAC,CAAC,GAAS,CAAC,EAAC,CAAC,EAAE,CAAC,EAAC,CAAC,CAAC;AAuBzB,IAAI,KAAK,GAkBS,CAAC,EAAE,CAAC,CAAC;AAEvB,KAAK,CAAC,EAAE,GAAG,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AACtC,KAAK,CAAC,EAAE,GAAS,CAAC;IACd,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC7C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAChD,KAAK,CAAC,EAAE,GAAG,UAAS,CAAS,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC;AAE5C,KAAK,CAAC,EAAE,GAAG,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,KAAK,CAAC,EAAE,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACnB,KAAK,CAAC,GAAG,GAAG,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC,GAAG,GAAG,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,CAAC,GAAG,GAAG;IACR,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,KAAK,CAAC,GAAG,GAAS,CAAC;IACf,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AACF,yBAAyB;AACzB,cAAc,CAAsB,IAAG,CAAC;AAAA,CAAC;AACzC,IAAI,CAAC,UAAS,CAAC;IACX,OAAa,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,4BAA4B;AAC5B,IAAI,KAAK,GAA8B,cAAa,OAAO,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;AAE/F,0BAA0B;AAC1B;IAAc,eAAY,CAAsB;IAAI,CAAC;IAAC,YAAC;AAAD,CAAC,AAAvD,IAAuD;AAAA,CAAC;AACxD,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAErD,qCAAqC;AACrC,IAAI,KAAK,GAA2B,CAAC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC,CAAC;AAC/D,IAAI,KAAK,GAAU,CAAC;IAChB,CAAC,EAAE,CAAC;CACP,CAAC,CAAC;AACH,IAAI,KAAK,GAAc,EAAE,CAAC;AAC1B,IAAI,KAAK,GAAgB,cAAa,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAC1D,IAAI,KAAK,GAAyB,UAAS,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AACpE,IAAI,KAAK,GAAoC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAa,CAAC,EAAE,CAAC,CAAA,CAAC,CAAC,CAAC;AAClF,IAAI,KAAK,GAGN,UAAS,CAAQ,IAAI,OAAO,CAAC,CAAA,CAAC,CAAC,CAAC;AAEnC,IAAI,KAAK,GAAsC,UAAS,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,IAAI,KAAK,GAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;AACjC,IAAI,MAAM,GAAY,CAAO,CAAC,EAAE,CAAC,EAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9C,IAAI,MAAM,GAAyC,CAAC,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,IAAI,MAAM,GAAU;IAChB,GAAG,EAAQ,CAAC,EAAE,CAAC;CAClB,CAAA;AACD,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,UAAS,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClC,CAAC,CAAA;AACF,IAAI,MAAM,GAAU,CAAC;IACjB,CAAC,EAAE,EAAE;CACR,CAAC,CAAA;AAOF,aAAa,CAAC,EAAC,CAAC,IAAI,OAAO,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC;AAEjC,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;AAcnB,eAAe,CAAC,EAAE,CAAC;IACf,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAEX,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,KAAK,CAAC,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE/B,KAAK,CAAC,SAAS,CAAC,GAAG,GAAG,UAAS,EAAE,EAAE,EAAE;IACjC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,KAAK,CAAC,SAAS,GAAG;IACd,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,GAAG,EAAE,UAAS,EAAE,EAAE,EAAE;QAChB,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAC;AAIF,IAAI,CAAC,GAAM,EAAG,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.sourcemap.txt b/tests/baselines/reference/contextualTyping.sourcemap.txt index 9c5d14a6e45..e70ee9e3344 100644 --- a/tests/baselines/reference/contextualTyping.sourcemap.txt +++ b/tests/baselines/reference/contextualTyping.sourcemap.txt @@ -62,21 +62,18 @@ sourceFile:contextualTyping.ts --- >>> return i; 1 >^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1 >) { > -2 > return -3 > -4 > i -5 > ; +2 > return +3 > i +4 > ; 1 >Emitted(5, 13) Source(16, 9) + SourceIndex(0) -2 >Emitted(5, 19) Source(16, 15) + SourceIndex(0) -3 >Emitted(5, 20) Source(16, 16) + SourceIndex(0) -4 >Emitted(5, 21) Source(16, 17) + SourceIndex(0) -5 >Emitted(5, 22) Source(16, 18) + SourceIndex(0) +2 >Emitted(5, 20) Source(16, 16) + SourceIndex(0) +3 >Emitted(5, 21) Source(16, 17) + SourceIndex(0) +4 >Emitted(5, 22) Source(16, 18) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^ @@ -189,21 +186,18 @@ sourceFile:contextualTyping.ts --- >>> return i; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1 >) { > -2 > return -3 > -4 > i -5 > ; +2 > return +3 > i +4 > ; 1 >Emitted(14, 9) Source(23, 9) + SourceIndex(0) -2 >Emitted(14, 15) Source(23, 15) + SourceIndex(0) -3 >Emitted(14, 16) Source(23, 16) + SourceIndex(0) -4 >Emitted(14, 17) Source(23, 17) + SourceIndex(0) -5 >Emitted(14, 18) Source(23, 18) + SourceIndex(0) +2 >Emitted(14, 16) Source(23, 16) + SourceIndex(0) +3 >Emitted(14, 17) Source(23, 17) + SourceIndex(0) +4 >Emitted(14, 18) Source(23, 18) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -267,14 +261,13 @@ sourceFile:contextualTyping.ts 6 > ^^^^^^^^^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ +9 > ^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ 1-> > 2 >var @@ -284,14 +277,13 @@ sourceFile:contextualTyping.ts 6 > function( 7 > s 8 > ) { -9 > return -10> -11> s -12> -13> -14> } -15> ) -16> ; +9 > return +10> s +11> +12> +13> } +14> ) +15> ; 1->Emitted(18, 1) Source(28, 1) + SourceIndex(0) 2 >Emitted(18, 5) Source(28, 5) + SourceIndex(0) 3 >Emitted(18, 9) Source(28, 9) + SourceIndex(0) @@ -300,14 +292,13 @@ sourceFile:contextualTyping.ts 6 >Emitted(18, 23) Source(28, 45) + SourceIndex(0) 7 >Emitted(18, 24) Source(28, 46) + SourceIndex(0) 8 >Emitted(18, 28) Source(28, 50) + SourceIndex(0) -9 >Emitted(18, 34) Source(28, 56) + SourceIndex(0) -10>Emitted(18, 35) Source(28, 57) + SourceIndex(0) -11>Emitted(18, 36) Source(28, 58) + SourceIndex(0) -12>Emitted(18, 37) Source(28, 58) + SourceIndex(0) -13>Emitted(18, 38) Source(28, 59) + SourceIndex(0) -14>Emitted(18, 39) Source(28, 60) + SourceIndex(0) -15>Emitted(18, 40) Source(28, 61) + SourceIndex(0) -16>Emitted(18, 41) Source(28, 62) + SourceIndex(0) +9 >Emitted(18, 35) Source(28, 57) + SourceIndex(0) +10>Emitted(18, 36) Source(28, 58) + SourceIndex(0) +11>Emitted(18, 37) Source(28, 58) + SourceIndex(0) +12>Emitted(18, 38) Source(28, 59) + SourceIndex(0) +13>Emitted(18, 39) Source(28, 60) + SourceIndex(0) +14>Emitted(18, 40) Source(28, 61) + SourceIndex(0) +15>Emitted(18, 41) Source(28, 62) + SourceIndex(0) --- >>>var c3t2 = ({ 1 > @@ -383,45 +374,42 @@ sourceFile:contextualTyping.ts 3 > ^^^^ 4 > ^^^ 5 > ^^^^^^^^^^^^^^ -6 > ^^^^^^ -7 > ^ -8 > ^ -9 > ^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^^-> +6 > ^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^^-> 1-> > 2 >var 3 > c3t4 4 > : () => IFoo = 5 > function() { -6 > return -7 > -8 > ( -9 > {} -10> ) -11> -12> -13> } -14> ; +6 > return +7 > ( +8 > {} +9 > ) +10> +11> +12> } +13> ; 1->Emitted(23, 1) Source(33, 1) + SourceIndex(0) 2 >Emitted(23, 5) Source(33, 5) + SourceIndex(0) 3 >Emitted(23, 9) Source(33, 9) + SourceIndex(0) 4 >Emitted(23, 12) Source(33, 24) + SourceIndex(0) 5 >Emitted(23, 26) Source(33, 37) + SourceIndex(0) -6 >Emitted(23, 32) Source(33, 43) + SourceIndex(0) -7 >Emitted(23, 33) Source(33, 50) + SourceIndex(0) -8 >Emitted(23, 34) Source(33, 51) + SourceIndex(0) -9 >Emitted(23, 36) Source(33, 53) + SourceIndex(0) -10>Emitted(23, 37) Source(33, 54) + SourceIndex(0) -11>Emitted(23, 38) Source(33, 54) + SourceIndex(0) -12>Emitted(23, 39) Source(33, 55) + SourceIndex(0) -13>Emitted(23, 40) Source(33, 56) + SourceIndex(0) -14>Emitted(23, 41) Source(33, 57) + SourceIndex(0) +6 >Emitted(23, 33) Source(33, 50) + SourceIndex(0) +7 >Emitted(23, 34) Source(33, 51) + SourceIndex(0) +8 >Emitted(23, 36) Source(33, 53) + SourceIndex(0) +9 >Emitted(23, 37) Source(33, 54) + SourceIndex(0) +10>Emitted(23, 38) Source(33, 54) + SourceIndex(0) +11>Emitted(23, 39) Source(33, 55) + SourceIndex(0) +12>Emitted(23, 40) Source(33, 56) + SourceIndex(0) +13>Emitted(23, 41) Source(33, 57) + SourceIndex(0) --- >>>var c3t5 = function (n) { return ({}); }; 1-> @@ -431,16 +419,15 @@ sourceFile:contextualTyping.ts 5 > ^^^^^^^^^^ 6 > ^ 7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ -17> ^^^^-> +8 > ^^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^^^^-> 1-> > 2 >var @@ -449,15 +436,14 @@ sourceFile:contextualTyping.ts 5 > function( 6 > n 7 > ) { -8 > return -9 > -10> ( -11> {} -12> ) -13> -14> -15> } -16> ; +8 > return +9 > ( +10> {} +11> ) +12> +13> +14> } +15> ; 1->Emitted(24, 1) Source(34, 1) + SourceIndex(0) 2 >Emitted(24, 5) Source(34, 5) + SourceIndex(0) 3 >Emitted(24, 9) Source(34, 9) + SourceIndex(0) @@ -465,15 +451,14 @@ sourceFile:contextualTyping.ts 5 >Emitted(24, 22) Source(34, 42) + SourceIndex(0) 6 >Emitted(24, 23) Source(34, 43) + SourceIndex(0) 7 >Emitted(24, 27) Source(34, 47) + SourceIndex(0) -8 >Emitted(24, 33) Source(34, 53) + SourceIndex(0) -9 >Emitted(24, 34) Source(34, 60) + SourceIndex(0) -10>Emitted(24, 35) Source(34, 61) + SourceIndex(0) -11>Emitted(24, 37) Source(34, 63) + SourceIndex(0) -12>Emitted(24, 38) Source(34, 64) + SourceIndex(0) -13>Emitted(24, 39) Source(34, 64) + SourceIndex(0) -14>Emitted(24, 40) Source(34, 65) + SourceIndex(0) -15>Emitted(24, 41) Source(34, 66) + SourceIndex(0) -16>Emitted(24, 42) Source(34, 67) + SourceIndex(0) +8 >Emitted(24, 34) Source(34, 60) + SourceIndex(0) +9 >Emitted(24, 35) Source(34, 61) + SourceIndex(0) +10>Emitted(24, 37) Source(34, 63) + SourceIndex(0) +11>Emitted(24, 38) Source(34, 64) + SourceIndex(0) +12>Emitted(24, 39) Source(34, 64) + SourceIndex(0) +13>Emitted(24, 40) Source(34, 65) + SourceIndex(0) +14>Emitted(24, 41) Source(34, 66) + SourceIndex(0) +15>Emitted(24, 42) Source(34, 67) + SourceIndex(0) --- >>>var c3t6 = function (n, s) { return ({}); }; 1-> @@ -485,15 +470,14 @@ sourceFile:contextualTyping.ts 7 > ^^ 8 > ^ 9 > ^^^^ -10> ^^^^^^ -11> ^ -12> ^ -13> ^^ -14> ^ -15> ^ -16> ^ -17> ^ -18> ^ +10> ^^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ 1-> > 2 >var @@ -504,15 +488,14 @@ sourceFile:contextualTyping.ts 7 > , 8 > s 9 > ) { -10> return -11> -12> ( -13> {} -14> ) -15> -16> -17> } -18> ; +10> return +11> ( +12> {} +13> ) +14> +15> +16> } +17> ; 1->Emitted(25, 1) Source(35, 1) + SourceIndex(0) 2 >Emitted(25, 5) Source(35, 5) + SourceIndex(0) 3 >Emitted(25, 9) Source(35, 9) + SourceIndex(0) @@ -522,15 +505,14 @@ sourceFile:contextualTyping.ts 7 >Emitted(25, 25) Source(35, 56) + SourceIndex(0) 8 >Emitted(25, 26) Source(35, 57) + SourceIndex(0) 9 >Emitted(25, 30) Source(35, 61) + SourceIndex(0) -10>Emitted(25, 36) Source(35, 67) + SourceIndex(0) -11>Emitted(25, 37) Source(35, 74) + SourceIndex(0) -12>Emitted(25, 38) Source(35, 75) + SourceIndex(0) -13>Emitted(25, 40) Source(35, 77) + SourceIndex(0) -14>Emitted(25, 41) Source(35, 78) + SourceIndex(0) -15>Emitted(25, 42) Source(35, 78) + SourceIndex(0) -16>Emitted(25, 43) Source(35, 79) + SourceIndex(0) -17>Emitted(25, 44) Source(35, 80) + SourceIndex(0) -18>Emitted(25, 45) Source(35, 81) + SourceIndex(0) +10>Emitted(25, 37) Source(35, 74) + SourceIndex(0) +11>Emitted(25, 38) Source(35, 75) + SourceIndex(0) +12>Emitted(25, 40) Source(35, 77) + SourceIndex(0) +13>Emitted(25, 41) Source(35, 78) + SourceIndex(0) +14>Emitted(25, 42) Source(35, 78) + SourceIndex(0) +15>Emitted(25, 43) Source(35, 79) + SourceIndex(0) +16>Emitted(25, 44) Source(35, 80) + SourceIndex(0) +17>Emitted(25, 45) Source(35, 81) + SourceIndex(0) --- >>>var c3t7 = function (n) { return n; }; 1 > @@ -540,14 +522,13 @@ sourceFile:contextualTyping.ts 5 > ^^^^^^^^^^ 6 > ^ 7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^-> +8 > ^^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^-> 1 > > 2 >var @@ -559,13 +540,12 @@ sourceFile:contextualTyping.ts 5 > function( 6 > n 7 > ) { -8 > return -9 > -10> n -11> ; -12> -13> } -14> ; +8 > return +9 > n +10> ; +11> +12> } +13> ; 1 >Emitted(26, 1) Source(36, 1) + SourceIndex(0) 2 >Emitted(26, 5) Source(36, 5) + SourceIndex(0) 3 >Emitted(26, 9) Source(36, 9) + SourceIndex(0) @@ -573,13 +553,12 @@ sourceFile:contextualTyping.ts 5 >Emitted(26, 22) Source(39, 14) + SourceIndex(0) 6 >Emitted(26, 23) Source(39, 15) + SourceIndex(0) 7 >Emitted(26, 27) Source(39, 19) + SourceIndex(0) -8 >Emitted(26, 33) Source(39, 25) + SourceIndex(0) -9 >Emitted(26, 34) Source(39, 26) + SourceIndex(0) -10>Emitted(26, 35) Source(39, 27) + SourceIndex(0) -11>Emitted(26, 36) Source(39, 28) + SourceIndex(0) -12>Emitted(26, 37) Source(39, 29) + SourceIndex(0) -13>Emitted(26, 38) Source(39, 30) + SourceIndex(0) -14>Emitted(26, 39) Source(39, 31) + SourceIndex(0) +8 >Emitted(26, 34) Source(39, 26) + SourceIndex(0) +9 >Emitted(26, 35) Source(39, 27) + SourceIndex(0) +10>Emitted(26, 36) Source(39, 28) + SourceIndex(0) +11>Emitted(26, 37) Source(39, 29) + SourceIndex(0) +12>Emitted(26, 38) Source(39, 30) + SourceIndex(0) +13>Emitted(26, 39) Source(39, 31) + SourceIndex(0) --- >>>var c3t8 = function (n) { return n; }; 1-> @@ -589,13 +568,12 @@ sourceFile:contextualTyping.ts 5 > ^^^^^^^^^^ 6 > ^ 7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ +8 > ^^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ 1-> > > @@ -605,13 +583,12 @@ sourceFile:contextualTyping.ts 5 > function( 6 > n 7 > ) { -8 > return -9 > -10> n -11> ; -12> -13> } -14> ; +8 > return +9 > n +10> ; +11> +12> } +13> ; 1->Emitted(27, 1) Source(41, 1) + SourceIndex(0) 2 >Emitted(27, 5) Source(41, 5) + SourceIndex(0) 3 >Emitted(27, 9) Source(41, 9) + SourceIndex(0) @@ -619,13 +596,12 @@ sourceFile:contextualTyping.ts 5 >Emitted(27, 22) Source(41, 55) + SourceIndex(0) 6 >Emitted(27, 23) Source(41, 56) + SourceIndex(0) 7 >Emitted(27, 27) Source(41, 60) + SourceIndex(0) -8 >Emitted(27, 33) Source(41, 66) + SourceIndex(0) -9 >Emitted(27, 34) Source(41, 67) + SourceIndex(0) -10>Emitted(27, 35) Source(41, 68) + SourceIndex(0) -11>Emitted(27, 36) Source(41, 69) + SourceIndex(0) -12>Emitted(27, 37) Source(41, 70) + SourceIndex(0) -13>Emitted(27, 38) Source(41, 71) + SourceIndex(0) -14>Emitted(27, 39) Source(41, 72) + SourceIndex(0) +8 >Emitted(27, 34) Source(41, 67) + SourceIndex(0) +9 >Emitted(27, 35) Source(41, 68) + SourceIndex(0) +10>Emitted(27, 36) Source(41, 69) + SourceIndex(0) +11>Emitted(27, 37) Source(41, 70) + SourceIndex(0) +12>Emitted(27, 38) Source(41, 71) + SourceIndex(0) +13>Emitted(27, 39) Source(41, 72) + SourceIndex(0) --- >>>var c3t9 = [[], []]; 1 > @@ -718,14 +694,13 @@ sourceFile:contextualTyping.ts 8 > ^^ 9 > ^ 10> ^^^^ -11> ^^^^^^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ -17> ^ -18> ^ +11> ^^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ 1-> > 2 >var @@ -737,14 +712,13 @@ sourceFile:contextualTyping.ts 8 > , 9 > s 10> ) { -11> return -12> -13> s -14> ; -15> -16> } -17> ] -18> ; +11> return +12> s +13> ; +14> +15> } +16> ] +17> ; 1->Emitted(30, 1) Source(44, 1) + SourceIndex(0) 2 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) 3 >Emitted(30, 10) Source(44, 10) + SourceIndex(0) @@ -755,14 +729,13 @@ sourceFile:contextualTyping.ts 8 >Emitted(30, 27) Source(44, 63) + SourceIndex(0) 9 >Emitted(30, 28) Source(44, 64) + SourceIndex(0) 10>Emitted(30, 32) Source(44, 68) + SourceIndex(0) -11>Emitted(30, 38) Source(44, 74) + SourceIndex(0) -12>Emitted(30, 39) Source(44, 75) + SourceIndex(0) -13>Emitted(30, 40) Source(44, 76) + SourceIndex(0) -14>Emitted(30, 41) Source(44, 77) + SourceIndex(0) -15>Emitted(30, 42) Source(44, 78) + SourceIndex(0) -16>Emitted(30, 43) Source(44, 79) + SourceIndex(0) -17>Emitted(30, 44) Source(44, 80) + SourceIndex(0) -18>Emitted(30, 45) Source(44, 81) + SourceIndex(0) +11>Emitted(30, 39) Source(44, 75) + SourceIndex(0) +12>Emitted(30, 40) Source(44, 76) + SourceIndex(0) +13>Emitted(30, 41) Source(44, 77) + SourceIndex(0) +14>Emitted(30, 42) Source(44, 78) + SourceIndex(0) +15>Emitted(30, 43) Source(44, 79) + SourceIndex(0) +16>Emitted(30, 44) Source(44, 80) + SourceIndex(0) +17>Emitted(30, 45) Source(44, 81) + SourceIndex(0) --- >>>var c3t12 = { 1 > @@ -839,12 +812,11 @@ sourceFile:contextualTyping.ts 6 > ^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ +9 > ^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ 1->{ > 2 > f @@ -854,12 +826,11 @@ sourceFile:contextualTyping.ts 6 > , 7 > s 8 > ) { -9 > return -10> -11> s -12> ; -13> -14> } +9 > return +10> s +11> ; +12> +13> } 1->Emitted(35, 5) Source(49, 5) + SourceIndex(0) 2 >Emitted(35, 6) Source(49, 6) + SourceIndex(0) 3 >Emitted(35, 8) Source(49, 8) + SourceIndex(0) @@ -868,12 +839,11 @@ sourceFile:contextualTyping.ts 6 >Emitted(35, 21) Source(49, 20) + SourceIndex(0) 7 >Emitted(35, 22) Source(49, 21) + SourceIndex(0) 8 >Emitted(35, 26) Source(49, 25) + SourceIndex(0) -9 >Emitted(35, 32) Source(49, 31) + SourceIndex(0) -10>Emitted(35, 33) Source(49, 32) + SourceIndex(0) -11>Emitted(35, 34) Source(49, 33) + SourceIndex(0) -12>Emitted(35, 35) Source(49, 34) + SourceIndex(0) -13>Emitted(35, 36) Source(49, 35) + SourceIndex(0) -14>Emitted(35, 37) Source(49, 36) + SourceIndex(0) +9 >Emitted(35, 33) Source(49, 32) + SourceIndex(0) +10>Emitted(35, 34) Source(49, 33) + SourceIndex(0) +11>Emitted(35, 35) Source(49, 34) + SourceIndex(0) +12>Emitted(35, 36) Source(49, 35) + SourceIndex(0) +13>Emitted(35, 37) Source(49, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -992,21 +962,18 @@ sourceFile:contextualTyping.ts --- >>> return s; 1 >^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1 >) { > -2 > return -3 > -4 > s -5 > ; +2 > return +3 > s +4 > ; 1 >Emitted(44, 13) Source(60, 13) + SourceIndex(0) -2 >Emitted(44, 19) Source(60, 19) + SourceIndex(0) -3 >Emitted(44, 20) Source(60, 20) + SourceIndex(0) -4 >Emitted(44, 21) Source(60, 21) + SourceIndex(0) -5 >Emitted(44, 22) Source(60, 22) + SourceIndex(0) +2 >Emitted(44, 20) Source(60, 20) + SourceIndex(0) +3 >Emitted(44, 21) Source(60, 21) + SourceIndex(0) +4 >Emitted(44, 22) Source(60, 22) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^ @@ -1134,21 +1101,18 @@ sourceFile:contextualTyping.ts --- >>> return s; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^ 1 >) { > -2 > return -3 > -4 > s -5 > ; +2 > return +3 > s +4 > ; 1 >Emitted(53, 9) Source(69, 9) + SourceIndex(0) -2 >Emitted(53, 15) Source(69, 15) + SourceIndex(0) -3 >Emitted(53, 16) Source(69, 16) + SourceIndex(0) -4 >Emitted(53, 17) Source(69, 17) + SourceIndex(0) -5 >Emitted(53, 18) Source(69, 18) + SourceIndex(0) +2 >Emitted(53, 16) Source(69, 16) + SourceIndex(0) +3 >Emitted(53, 17) Source(69, 17) + SourceIndex(0) +4 >Emitted(53, 18) Source(69, 18) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -1226,15 +1190,14 @@ sourceFile:contextualTyping.ts 4 > ^^^^^^^^^^ 5 > ^ 6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ +7 > ^^^^^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ 1-> > 2 >c6t5 @@ -1242,30 +1205,28 @@ sourceFile:contextualTyping.ts 4 > function( 5 > n 6 > ) { -7 > return -8 > -9 > ( -10> {} -11> ) -12> -13> -14> } -15> ; +7 > return +8 > ( +9 > {} +10> ) +11> +12> +13> } +14> ; 1->Emitted(58, 1) Source(75, 1) + SourceIndex(0) 2 >Emitted(58, 5) Source(75, 5) + SourceIndex(0) 3 >Emitted(58, 8) Source(75, 29) + SourceIndex(0) 4 >Emitted(58, 18) Source(75, 38) + SourceIndex(0) 5 >Emitted(58, 19) Source(75, 39) + SourceIndex(0) 6 >Emitted(58, 23) Source(75, 43) + SourceIndex(0) -7 >Emitted(58, 29) Source(75, 49) + SourceIndex(0) -8 >Emitted(58, 30) Source(75, 56) + SourceIndex(0) -9 >Emitted(58, 31) Source(75, 57) + SourceIndex(0) -10>Emitted(58, 33) Source(75, 59) + SourceIndex(0) -11>Emitted(58, 34) Source(75, 60) + SourceIndex(0) -12>Emitted(58, 35) Source(75, 60) + SourceIndex(0) -13>Emitted(58, 36) Source(75, 61) + SourceIndex(0) -14>Emitted(58, 37) Source(75, 62) + SourceIndex(0) -15>Emitted(58, 38) Source(75, 63) + SourceIndex(0) +7 >Emitted(58, 30) Source(75, 56) + SourceIndex(0) +8 >Emitted(58, 31) Source(75, 57) + SourceIndex(0) +9 >Emitted(58, 33) Source(75, 59) + SourceIndex(0) +10>Emitted(58, 34) Source(75, 60) + SourceIndex(0) +11>Emitted(58, 35) Source(75, 60) + SourceIndex(0) +12>Emitted(58, 36) Source(75, 61) + SourceIndex(0) +13>Emitted(58, 37) Source(75, 62) + SourceIndex(0) +14>Emitted(58, 38) Source(75, 63) + SourceIndex(0) --- >>>// CONTEXT: Array index assignment 1 > @@ -1416,14 +1377,13 @@ sourceFile:contextualTyping.ts 7 > ^^^^^^^^^^ 8 > ^ 9 > ^^^^ -10> ^^^^^^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ -17> ^ +10> ^^^^^^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ 1-> > > @@ -1435,14 +1395,13 @@ sourceFile:contextualTyping.ts 7 > function( 8 > s 9 > ) { -10> return -11> -12> s -13> -14> -15> } -16> ) -17> ; +10> return +11> s +12> +13> +14> } +15> ) +16> ; 1->Emitted(63, 1) Source(122, 1) + SourceIndex(0) 2 >Emitted(63, 6) Source(122, 6) + SourceIndex(0) 3 >Emitted(63, 7) Source(122, 7) + SourceIndex(0) @@ -1452,14 +1411,13 @@ sourceFile:contextualTyping.ts 7 >Emitted(63, 23) Source(122, 22) + SourceIndex(0) 8 >Emitted(63, 24) Source(122, 23) + SourceIndex(0) 9 >Emitted(63, 28) Source(122, 27) + SourceIndex(0) -10>Emitted(63, 34) Source(122, 33) + SourceIndex(0) -11>Emitted(63, 35) Source(122, 34) + SourceIndex(0) -12>Emitted(63, 36) Source(122, 35) + SourceIndex(0) -13>Emitted(63, 37) Source(122, 35) + SourceIndex(0) -14>Emitted(63, 38) Source(122, 36) + SourceIndex(0) -15>Emitted(63, 39) Source(122, 37) + SourceIndex(0) -16>Emitted(63, 40) Source(122, 38) + SourceIndex(0) -17>Emitted(63, 41) Source(122, 39) + SourceIndex(0) +10>Emitted(63, 35) Source(122, 34) + SourceIndex(0) +11>Emitted(63, 36) Source(122, 35) + SourceIndex(0) +12>Emitted(63, 37) Source(122, 35) + SourceIndex(0) +13>Emitted(63, 38) Source(122, 36) + SourceIndex(0) +14>Emitted(63, 39) Source(122, 37) + SourceIndex(0) +15>Emitted(63, 40) Source(122, 38) + SourceIndex(0) +16>Emitted(63, 41) Source(122, 39) + SourceIndex(0) --- >>>objc8.t2 = ({ 1 > @@ -1542,16 +1500,15 @@ sourceFile:contextualTyping.ts 4 > ^^ 5 > ^^^ 6 > ^^^^^^^^^^^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^^-> +7 > ^^^^^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^^-> 1-> > 2 >objc8 @@ -1559,30 +1516,28 @@ sourceFile:contextualTyping.ts 4 > t4 5 > = 6 > function() { -7 > return -8 > -9 > ( -10> {} -11> ) -12> -13> -14> } -15> ; +7 > return +8 > ( +9 > {} +10> ) +11> +12> +13> } +14> ; 1->Emitted(68, 1) Source(127, 1) + SourceIndex(0) 2 >Emitted(68, 6) Source(127, 6) + SourceIndex(0) 3 >Emitted(68, 7) Source(127, 7) + SourceIndex(0) 4 >Emitted(68, 9) Source(127, 9) + SourceIndex(0) 5 >Emitted(68, 12) Source(127, 12) + SourceIndex(0) 6 >Emitted(68, 26) Source(127, 25) + SourceIndex(0) -7 >Emitted(68, 32) Source(127, 31) + SourceIndex(0) -8 >Emitted(68, 33) Source(127, 38) + SourceIndex(0) -9 >Emitted(68, 34) Source(127, 39) + SourceIndex(0) -10>Emitted(68, 36) Source(127, 41) + SourceIndex(0) -11>Emitted(68, 37) Source(127, 42) + SourceIndex(0) -12>Emitted(68, 38) Source(127, 42) + SourceIndex(0) -13>Emitted(68, 39) Source(127, 43) + SourceIndex(0) -14>Emitted(68, 40) Source(127, 44) + SourceIndex(0) -15>Emitted(68, 41) Source(127, 45) + SourceIndex(0) +7 >Emitted(68, 33) Source(127, 38) + SourceIndex(0) +8 >Emitted(68, 34) Source(127, 39) + SourceIndex(0) +9 >Emitted(68, 36) Source(127, 41) + SourceIndex(0) +10>Emitted(68, 37) Source(127, 42) + SourceIndex(0) +11>Emitted(68, 38) Source(127, 42) + SourceIndex(0) +12>Emitted(68, 39) Source(127, 43) + SourceIndex(0) +13>Emitted(68, 40) Source(127, 44) + SourceIndex(0) +14>Emitted(68, 41) Source(127, 45) + SourceIndex(0) --- >>>objc8.t5 = function (n) { return ({}); }; 1-> @@ -1593,16 +1548,15 @@ sourceFile:contextualTyping.ts 6 > ^^^^^^^^^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^^ -13> ^ -14> ^ -15> ^ -16> ^ -17> ^ -18> ^^^^-> +9 > ^^^^^^^ +10> ^ +11> ^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^^^^-> 1-> > 2 >objc8 @@ -1612,15 +1566,14 @@ sourceFile:contextualTyping.ts 6 > function( 7 > n 8 > ) { -9 > return -10> -11> ( -12> {} -13> ) -14> -15> -16> } -17> ; +9 > return +10> ( +11> {} +12> ) +13> +14> +15> } +16> ; 1->Emitted(69, 1) Source(128, 1) + SourceIndex(0) 2 >Emitted(69, 6) Source(128, 6) + SourceIndex(0) 3 >Emitted(69, 7) Source(128, 7) + SourceIndex(0) @@ -1629,15 +1582,14 @@ sourceFile:contextualTyping.ts 6 >Emitted(69, 22) Source(128, 21) + SourceIndex(0) 7 >Emitted(69, 23) Source(128, 22) + SourceIndex(0) 8 >Emitted(69, 27) Source(128, 26) + SourceIndex(0) -9 >Emitted(69, 33) Source(128, 32) + SourceIndex(0) -10>Emitted(69, 34) Source(128, 39) + SourceIndex(0) -11>Emitted(69, 35) Source(128, 40) + SourceIndex(0) -12>Emitted(69, 37) Source(128, 42) + SourceIndex(0) -13>Emitted(69, 38) Source(128, 43) + SourceIndex(0) -14>Emitted(69, 39) Source(128, 43) + SourceIndex(0) -15>Emitted(69, 40) Source(128, 44) + SourceIndex(0) -16>Emitted(69, 41) Source(128, 45) + SourceIndex(0) -17>Emitted(69, 42) Source(128, 46) + SourceIndex(0) +9 >Emitted(69, 34) Source(128, 39) + SourceIndex(0) +10>Emitted(69, 35) Source(128, 40) + SourceIndex(0) +11>Emitted(69, 37) Source(128, 42) + SourceIndex(0) +12>Emitted(69, 38) Source(128, 43) + SourceIndex(0) +13>Emitted(69, 39) Source(128, 43) + SourceIndex(0) +14>Emitted(69, 40) Source(128, 44) + SourceIndex(0) +15>Emitted(69, 41) Source(128, 45) + SourceIndex(0) +16>Emitted(69, 42) Source(128, 46) + SourceIndex(0) --- >>>objc8.t6 = function (n, s) { return ({}); }; 1-> @@ -1650,15 +1602,14 @@ sourceFile:contextualTyping.ts 8 > ^^ 9 > ^ 10> ^^^^ -11> ^^^^^^ -12> ^ -13> ^ -14> ^^ -15> ^ -16> ^ -17> ^ -18> ^ -19> ^ +11> ^^^^^^^ +12> ^ +13> ^^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ 1-> > 2 >objc8 @@ -1670,15 +1621,14 @@ sourceFile:contextualTyping.ts 8 > , 9 > s 10> ) { -11> return -12> -13> ( -14> {} -15> ) -16> -17> -18> } -19> ; +11> return +12> ( +13> {} +14> ) +15> +16> +17> } +18> ; 1->Emitted(70, 1) Source(129, 1) + SourceIndex(0) 2 >Emitted(70, 6) Source(129, 6) + SourceIndex(0) 3 >Emitted(70, 7) Source(129, 7) + SourceIndex(0) @@ -1689,15 +1639,14 @@ sourceFile:contextualTyping.ts 8 >Emitted(70, 25) Source(129, 24) + SourceIndex(0) 9 >Emitted(70, 26) Source(129, 25) + SourceIndex(0) 10>Emitted(70, 30) Source(129, 29) + SourceIndex(0) -11>Emitted(70, 36) Source(129, 35) + SourceIndex(0) -12>Emitted(70, 37) Source(129, 42) + SourceIndex(0) -13>Emitted(70, 38) Source(129, 43) + SourceIndex(0) -14>Emitted(70, 40) Source(129, 45) + SourceIndex(0) -15>Emitted(70, 41) Source(129, 46) + SourceIndex(0) -16>Emitted(70, 42) Source(129, 46) + SourceIndex(0) -17>Emitted(70, 43) Source(129, 47) + SourceIndex(0) -18>Emitted(70, 44) Source(129, 48) + SourceIndex(0) -19>Emitted(70, 45) Source(129, 49) + SourceIndex(0) +11>Emitted(70, 37) Source(129, 42) + SourceIndex(0) +12>Emitted(70, 38) Source(129, 43) + SourceIndex(0) +13>Emitted(70, 40) Source(129, 45) + SourceIndex(0) +14>Emitted(70, 41) Source(129, 46) + SourceIndex(0) +15>Emitted(70, 42) Source(129, 46) + SourceIndex(0) +16>Emitted(70, 43) Source(129, 47) + SourceIndex(0) +17>Emitted(70, 44) Source(129, 48) + SourceIndex(0) +18>Emitted(70, 45) Source(129, 49) + SourceIndex(0) --- >>>objc8.t7 = function (n) { return n; }; 1 > @@ -1708,14 +1657,13 @@ sourceFile:contextualTyping.ts 6 > ^^^^^^^^^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^-> +9 > ^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^-> 1 > > 2 >objc8 @@ -1725,13 +1673,12 @@ sourceFile:contextualTyping.ts 6 > function( 7 > n: number 8 > ) { -9 > return -10> -11> n -12> -13> -14> } -15> ; +9 > return +10> n +11> +12> +13> } +14> ; 1 >Emitted(71, 1) Source(130, 1) + SourceIndex(0) 2 >Emitted(71, 6) Source(130, 6) + SourceIndex(0) 3 >Emitted(71, 7) Source(130, 7) + SourceIndex(0) @@ -1740,13 +1687,12 @@ sourceFile:contextualTyping.ts 6 >Emitted(71, 22) Source(130, 21) + SourceIndex(0) 7 >Emitted(71, 23) Source(130, 30) + SourceIndex(0) 8 >Emitted(71, 27) Source(130, 34) + SourceIndex(0) -9 >Emitted(71, 33) Source(130, 40) + SourceIndex(0) -10>Emitted(71, 34) Source(130, 41) + SourceIndex(0) -11>Emitted(71, 35) Source(130, 42) + SourceIndex(0) -12>Emitted(71, 36) Source(130, 42) + SourceIndex(0) -13>Emitted(71, 37) Source(130, 43) + SourceIndex(0) -14>Emitted(71, 38) Source(130, 44) + SourceIndex(0) -15>Emitted(71, 39) Source(130, 45) + SourceIndex(0) +9 >Emitted(71, 34) Source(130, 41) + SourceIndex(0) +10>Emitted(71, 35) Source(130, 42) + SourceIndex(0) +11>Emitted(71, 36) Source(130, 42) + SourceIndex(0) +12>Emitted(71, 37) Source(130, 43) + SourceIndex(0) +13>Emitted(71, 38) Source(130, 44) + SourceIndex(0) +14>Emitted(71, 39) Source(130, 45) + SourceIndex(0) --- >>>objc8.t8 = function (n) { return n; }; 1-> @@ -1757,13 +1703,12 @@ sourceFile:contextualTyping.ts 6 > ^^^^^^^^^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ +9 > ^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ 1-> > > @@ -1774,13 +1719,12 @@ sourceFile:contextualTyping.ts 6 > function( 7 > n 8 > ) { -9 > return -10> -11> n -12> ; -13> -14> } -15> ; +9 > return +10> n +11> ; +12> +13> } +14> ; 1->Emitted(72, 1) Source(132, 1) + SourceIndex(0) 2 >Emitted(72, 6) Source(132, 6) + SourceIndex(0) 3 >Emitted(72, 7) Source(132, 7) + SourceIndex(0) @@ -1789,13 +1733,12 @@ sourceFile:contextualTyping.ts 6 >Emitted(72, 22) Source(132, 21) + SourceIndex(0) 7 >Emitted(72, 23) Source(132, 22) + SourceIndex(0) 8 >Emitted(72, 27) Source(132, 26) + SourceIndex(0) -9 >Emitted(72, 33) Source(132, 32) + SourceIndex(0) -10>Emitted(72, 34) Source(132, 33) + SourceIndex(0) -11>Emitted(72, 35) Source(132, 34) + SourceIndex(0) -12>Emitted(72, 36) Source(132, 35) + SourceIndex(0) -13>Emitted(72, 37) Source(132, 36) + SourceIndex(0) -14>Emitted(72, 38) Source(132, 37) + SourceIndex(0) -15>Emitted(72, 39) Source(132, 38) + SourceIndex(0) +9 >Emitted(72, 34) Source(132, 33) + SourceIndex(0) +10>Emitted(72, 35) Source(132, 34) + SourceIndex(0) +11>Emitted(72, 36) Source(132, 35) + SourceIndex(0) +12>Emitted(72, 37) Source(132, 36) + SourceIndex(0) +13>Emitted(72, 38) Source(132, 37) + SourceIndex(0) +14>Emitted(72, 39) Source(132, 38) + SourceIndex(0) --- >>>objc8.t9 = [[], []]; 1 > @@ -1895,14 +1838,13 @@ sourceFile:contextualTyping.ts 9 > ^^ 10> ^ 11> ^^^^ -12> ^^^^^^ -13> ^ -14> ^ -15> ^ -16> ^ -17> ^ -18> ^ -19> ^ +12> ^^^^^^^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ 1-> > 2 >objc8 @@ -1915,14 +1857,13 @@ sourceFile:contextualTyping.ts 9 > , 10> s 11> ) { -12> return -13> -14> s -15> ; -16> -17> } -18> ] -19> ; +12> return +13> s +14> ; +15> +16> } +17> ] +18> ; 1->Emitted(75, 1) Source(135, 1) + SourceIndex(0) 2 >Emitted(75, 6) Source(135, 6) + SourceIndex(0) 3 >Emitted(75, 7) Source(135, 7) + SourceIndex(0) @@ -1934,14 +1875,13 @@ sourceFile:contextualTyping.ts 9 >Emitted(75, 27) Source(135, 26) + SourceIndex(0) 10>Emitted(75, 28) Source(135, 27) + SourceIndex(0) 11>Emitted(75, 32) Source(135, 31) + SourceIndex(0) -12>Emitted(75, 38) Source(135, 37) + SourceIndex(0) -13>Emitted(75, 39) Source(135, 38) + SourceIndex(0) -14>Emitted(75, 40) Source(135, 39) + SourceIndex(0) -15>Emitted(75, 41) Source(135, 40) + SourceIndex(0) -16>Emitted(75, 42) Source(135, 41) + SourceIndex(0) -17>Emitted(75, 43) Source(135, 42) + SourceIndex(0) -18>Emitted(75, 44) Source(135, 43) + SourceIndex(0) -19>Emitted(75, 45) Source(135, 44) + SourceIndex(0) +12>Emitted(75, 39) Source(135, 38) + SourceIndex(0) +13>Emitted(75, 40) Source(135, 39) + SourceIndex(0) +14>Emitted(75, 41) Source(135, 40) + SourceIndex(0) +15>Emitted(75, 42) Source(135, 41) + SourceIndex(0) +16>Emitted(75, 43) Source(135, 42) + SourceIndex(0) +17>Emitted(75, 44) Source(135, 43) + SourceIndex(0) +18>Emitted(75, 45) Source(135, 44) + SourceIndex(0) --- >>>objc8.t12 = { 1 > @@ -2024,12 +1964,11 @@ sourceFile:contextualTyping.ts 6 > ^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ +9 > ^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ 1->{ > 2 > f @@ -2039,12 +1978,11 @@ sourceFile:contextualTyping.ts 6 > , 7 > s 8 > ) { -9 > return -10> -11> s -12> ; -13> -14> } +9 > return +10> s +11> ; +12> +13> } 1->Emitted(80, 5) Source(140, 5) + SourceIndex(0) 2 >Emitted(80, 6) Source(140, 6) + SourceIndex(0) 3 >Emitted(80, 8) Source(140, 8) + SourceIndex(0) @@ -2053,12 +1991,11 @@ sourceFile:contextualTyping.ts 6 >Emitted(80, 21) Source(140, 20) + SourceIndex(0) 7 >Emitted(80, 22) Source(140, 21) + SourceIndex(0) 8 >Emitted(80, 26) Source(140, 25) + SourceIndex(0) -9 >Emitted(80, 32) Source(140, 31) + SourceIndex(0) -10>Emitted(80, 33) Source(140, 32) + SourceIndex(0) -11>Emitted(80, 34) Source(140, 33) + SourceIndex(0) -12>Emitted(80, 35) Source(140, 34) + SourceIndex(0) -13>Emitted(80, 36) Source(140, 35) + SourceIndex(0) -14>Emitted(80, 37) Source(140, 36) + SourceIndex(0) +9 >Emitted(80, 33) Source(140, 32) + SourceIndex(0) +10>Emitted(80, 34) Source(140, 33) + SourceIndex(0) +11>Emitted(80, 35) Source(140, 34) + SourceIndex(0) +12>Emitted(80, 36) Source(140, 35) + SourceIndex(0) +13>Emitted(80, 37) Source(140, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -2179,27 +2116,24 @@ sourceFile:contextualTyping.ts --- >>> return ({}); 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ +2 > ^^^^^^^ +3 > ^ +4 > ^^ +5 > ^ +6 > ^ 1->) { > -2 > return -3 > -4 > ( -5 > {} -6 > ) -7 > ; +2 > return +3 > ( +4 > {} +5 > ) +6 > ; 1->Emitted(89, 5) Source(148, 5) + SourceIndex(0) -2 >Emitted(89, 11) Source(148, 11) + SourceIndex(0) -3 >Emitted(89, 12) Source(148, 18) + SourceIndex(0) -4 >Emitted(89, 13) Source(148, 19) + SourceIndex(0) -5 >Emitted(89, 15) Source(148, 21) + SourceIndex(0) -6 >Emitted(89, 16) Source(148, 22) + SourceIndex(0) -7 >Emitted(89, 17) Source(148, 23) + SourceIndex(0) +2 >Emitted(89, 12) Source(148, 18) + SourceIndex(0) +3 >Emitted(89, 13) Source(148, 19) + SourceIndex(0) +4 >Emitted(89, 15) Source(148, 21) + SourceIndex(0) +5 >Emitted(89, 16) Source(148, 22) + SourceIndex(0) +6 >Emitted(89, 17) Source(148, 23) + SourceIndex(0) --- >>>}); 1 > @@ -2234,68 +2168,62 @@ sourceFile:contextualTyping.ts 3 > ^^^^^ 4 > ^^^ 5 > ^^^^^^^^^^^^^^ -6 > ^^^^^^ -7 > ^ -8 > ^^^^^^^^^^ -9 > ^ -10> ^^^^ -11> ^^^^^^ -12> ^ -13> ^ -14> ^^ -15> ^ -16> ^ -17> ^ -18> ^ -19> ^ -20> ^ -21> ^ -22> ^ +6 > ^^^^^^^ +7 > ^^^^^^^^^^ +8 > ^ +9 > ^^^^ +10> ^^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ +19> ^ +20> ^ 1-> > 2 >var 3 > c10t5 4 > : () => (n: number) => IFoo = 5 > function() { -6 > return -7 > -8 > function( -9 > n -10> ) { -11> return -12> -13> ( -14> {} -15> ) -16> -17> -18> } -19> -20> -21> } -22> ; +6 > return +7 > function( +8 > n +9 > ) { +10> return +11> ( +12> {} +13> ) +14> +15> +16> } +17> +18> +19> } +20> ; 1->Emitted(92, 1) Source(152, 1) + SourceIndex(0) 2 >Emitted(92, 5) Source(152, 5) + SourceIndex(0) 3 >Emitted(92, 10) Source(152, 10) + SourceIndex(0) 4 >Emitted(92, 13) Source(152, 40) + SourceIndex(0) 5 >Emitted(92, 27) Source(152, 53) + SourceIndex(0) -6 >Emitted(92, 33) Source(152, 59) + SourceIndex(0) -7 >Emitted(92, 34) Source(152, 60) + SourceIndex(0) -8 >Emitted(92, 44) Source(152, 69) + SourceIndex(0) -9 >Emitted(92, 45) Source(152, 70) + SourceIndex(0) -10>Emitted(92, 49) Source(152, 74) + SourceIndex(0) -11>Emitted(92, 55) Source(152, 80) + SourceIndex(0) -12>Emitted(92, 56) Source(152, 87) + SourceIndex(0) -13>Emitted(92, 57) Source(152, 88) + SourceIndex(0) -14>Emitted(92, 59) Source(152, 90) + SourceIndex(0) -15>Emitted(92, 60) Source(152, 91) + SourceIndex(0) -16>Emitted(92, 61) Source(152, 91) + SourceIndex(0) -17>Emitted(92, 62) Source(152, 92) + SourceIndex(0) -18>Emitted(92, 63) Source(152, 93) + SourceIndex(0) -19>Emitted(92, 64) Source(152, 93) + SourceIndex(0) -20>Emitted(92, 65) Source(152, 94) + SourceIndex(0) -21>Emitted(92, 66) Source(152, 95) + SourceIndex(0) -22>Emitted(92, 67) Source(152, 96) + SourceIndex(0) +6 >Emitted(92, 34) Source(152, 60) + SourceIndex(0) +7 >Emitted(92, 44) Source(152, 69) + SourceIndex(0) +8 >Emitted(92, 45) Source(152, 70) + SourceIndex(0) +9 >Emitted(92, 49) Source(152, 74) + SourceIndex(0) +10>Emitted(92, 56) Source(152, 87) + SourceIndex(0) +11>Emitted(92, 57) Source(152, 88) + SourceIndex(0) +12>Emitted(92, 59) Source(152, 90) + SourceIndex(0) +13>Emitted(92, 60) Source(152, 91) + SourceIndex(0) +14>Emitted(92, 61) Source(152, 91) + SourceIndex(0) +15>Emitted(92, 62) Source(152, 92) + SourceIndex(0) +16>Emitted(92, 63) Source(152, 93) + SourceIndex(0) +17>Emitted(92, 64) Source(152, 93) + SourceIndex(0) +18>Emitted(92, 65) Source(152, 94) + SourceIndex(0) +19>Emitted(92, 66) Source(152, 95) + SourceIndex(0) +20>Emitted(92, 67) Source(152, 96) + SourceIndex(0) --- >>>// CONTEXT: Newing a class 1 > @@ -2377,16 +2305,15 @@ sourceFile:contextualTyping.ts 8 > ^^^^^^^^^^ 9 > ^ 10> ^^^^ -11> ^^^^^^ -12> ^ -13> ^ -14> ^^ -15> ^ -16> ^ -17> ^ -18> ^ -19> ^ -20> ^ +11> ^^^^^^^ +12> ^ +13> ^^ +14> ^ +15> ^ +16> ^ +17> ^ +18> ^ +19> ^ 1-> > 2 >var @@ -2398,16 +2325,15 @@ sourceFile:contextualTyping.ts 8 > function( 9 > n 10> ) { -11> return -12> -13> ( -14> {} -15> ) -16> -17> -18> } -19> ) -20> ; +11> return +12> ( +13> {} +14> ) +15> +16> +17> } +18> ) +19> ; 1->Emitted(100, 1) Source(156, 1) + SourceIndex(0) 2 >Emitted(100, 5) Source(156, 5) + SourceIndex(0) 3 >Emitted(100, 6) Source(156, 6) + SourceIndex(0) @@ -2418,16 +2344,15 @@ sourceFile:contextualTyping.ts 8 >Emitted(100, 29) Source(156, 28) + SourceIndex(0) 9 >Emitted(100, 30) Source(156, 29) + SourceIndex(0) 10>Emitted(100, 34) Source(156, 33) + SourceIndex(0) -11>Emitted(100, 40) Source(156, 39) + SourceIndex(0) -12>Emitted(100, 41) Source(156, 46) + SourceIndex(0) -13>Emitted(100, 42) Source(156, 47) + SourceIndex(0) -14>Emitted(100, 44) Source(156, 49) + SourceIndex(0) -15>Emitted(100, 45) Source(156, 50) + SourceIndex(0) -16>Emitted(100, 46) Source(156, 50) + SourceIndex(0) -17>Emitted(100, 47) Source(156, 51) + SourceIndex(0) -18>Emitted(100, 48) Source(156, 52) + SourceIndex(0) -19>Emitted(100, 49) Source(156, 53) + SourceIndex(0) -20>Emitted(100, 50) Source(156, 54) + SourceIndex(0) +11>Emitted(100, 41) Source(156, 46) + SourceIndex(0) +12>Emitted(100, 42) Source(156, 47) + SourceIndex(0) +13>Emitted(100, 44) Source(156, 49) + SourceIndex(0) +14>Emitted(100, 45) Source(156, 50) + SourceIndex(0) +15>Emitted(100, 46) Source(156, 50) + SourceIndex(0) +16>Emitted(100, 47) Source(156, 51) + SourceIndex(0) +17>Emitted(100, 48) Source(156, 52) + SourceIndex(0) +18>Emitted(100, 49) Source(156, 53) + SourceIndex(0) +19>Emitted(100, 50) Source(156, 54) + SourceIndex(0) --- >>>// CONTEXT: Type annotated expression 1 > @@ -2449,14 +2374,13 @@ sourceFile:contextualTyping.ts 6 > ^^^^^^^^^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ +9 > ^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ 1-> > 2 >var @@ -2466,14 +2390,13 @@ sourceFile:contextualTyping.ts 6 > function( 7 > s 8 > ) { -9 > return -10> -11> s -12> -13> -14> } -15> ) -16> ; +9 > return +10> s +11> +12> +13> } +14> ) +15> ; 1->Emitted(102, 1) Source(159, 1) + SourceIndex(0) 2 >Emitted(102, 5) Source(159, 5) + SourceIndex(0) 3 >Emitted(102, 10) Source(159, 10) + SourceIndex(0) @@ -2482,14 +2405,13 @@ sourceFile:contextualTyping.ts 6 >Emitted(102, 24) Source(159, 47) + SourceIndex(0) 7 >Emitted(102, 25) Source(159, 48) + SourceIndex(0) 8 >Emitted(102, 29) Source(159, 52) + SourceIndex(0) -9 >Emitted(102, 35) Source(159, 58) + SourceIndex(0) -10>Emitted(102, 36) Source(159, 59) + SourceIndex(0) -11>Emitted(102, 37) Source(159, 60) + SourceIndex(0) -12>Emitted(102, 38) Source(159, 60) + SourceIndex(0) -13>Emitted(102, 39) Source(159, 61) + SourceIndex(0) -14>Emitted(102, 40) Source(159, 62) + SourceIndex(0) -15>Emitted(102, 41) Source(159, 63) + SourceIndex(0) -16>Emitted(102, 42) Source(159, 64) + SourceIndex(0) +9 >Emitted(102, 36) Source(159, 59) + SourceIndex(0) +10>Emitted(102, 37) Source(159, 60) + SourceIndex(0) +11>Emitted(102, 38) Source(159, 60) + SourceIndex(0) +12>Emitted(102, 39) Source(159, 61) + SourceIndex(0) +13>Emitted(102, 40) Source(159, 62) + SourceIndex(0) +14>Emitted(102, 41) Source(159, 63) + SourceIndex(0) +15>Emitted(102, 42) Source(159, 64) + SourceIndex(0) --- >>>var c12t2 = ({ 1 > @@ -2565,45 +2487,42 @@ sourceFile:contextualTyping.ts 3 > ^^^^^ 4 > ^^^ 5 > ^^^^^^^^^^^^^^ -6 > ^^^^^^ -7 > ^ -8 > ^ -9 > ^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^^-> +6 > ^^^^^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^^-> 1-> > 2 >var 3 > c12t4 4 > = <() => IFoo> 5 > function() { -6 > return -7 > -8 > ( -9 > {} -10> ) -11> -12> -13> } -14> ; +6 > return +7 > ( +8 > {} +9 > ) +10> +11> +12> } +13> ; 1->Emitted(107, 1) Source(164, 1) + SourceIndex(0) 2 >Emitted(107, 5) Source(164, 5) + SourceIndex(0) 3 >Emitted(107, 10) Source(164, 10) + SourceIndex(0) 4 >Emitted(107, 13) Source(164, 26) + SourceIndex(0) 5 >Emitted(107, 27) Source(164, 39) + SourceIndex(0) -6 >Emitted(107, 33) Source(164, 45) + SourceIndex(0) -7 >Emitted(107, 34) Source(164, 52) + SourceIndex(0) -8 >Emitted(107, 35) Source(164, 53) + SourceIndex(0) -9 >Emitted(107, 37) Source(164, 55) + SourceIndex(0) -10>Emitted(107, 38) Source(164, 56) + SourceIndex(0) -11>Emitted(107, 39) Source(164, 56) + SourceIndex(0) -12>Emitted(107, 40) Source(164, 57) + SourceIndex(0) -13>Emitted(107, 41) Source(164, 58) + SourceIndex(0) -14>Emitted(107, 42) Source(164, 59) + SourceIndex(0) +6 >Emitted(107, 34) Source(164, 52) + SourceIndex(0) +7 >Emitted(107, 35) Source(164, 53) + SourceIndex(0) +8 >Emitted(107, 37) Source(164, 55) + SourceIndex(0) +9 >Emitted(107, 38) Source(164, 56) + SourceIndex(0) +10>Emitted(107, 39) Source(164, 56) + SourceIndex(0) +11>Emitted(107, 40) Source(164, 57) + SourceIndex(0) +12>Emitted(107, 41) Source(164, 58) + SourceIndex(0) +13>Emitted(107, 42) Source(164, 59) + SourceIndex(0) --- >>>var c12t5 = function (n) { return ({}); }; 1-> @@ -2613,16 +2532,15 @@ sourceFile:contextualTyping.ts 5 > ^^^^^^^^^^ 6 > ^ 7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ -17> ^^^^-> +8 > ^^^^^^^ +9 > ^ +10> ^^ +11> ^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^^^^-> 1-> > 2 >var @@ -2631,15 +2549,14 @@ sourceFile:contextualTyping.ts 5 > function( 6 > n 7 > ) { -8 > return -9 > -10> ( -11> {} -12> ) -13> -14> -15> } -16> ; +8 > return +9 > ( +10> {} +11> ) +12> +13> +14> } +15> ; 1->Emitted(108, 1) Source(165, 1) + SourceIndex(0) 2 >Emitted(108, 5) Source(165, 5) + SourceIndex(0) 3 >Emitted(108, 10) Source(165, 10) + SourceIndex(0) @@ -2647,15 +2564,14 @@ sourceFile:contextualTyping.ts 5 >Emitted(108, 23) Source(165, 44) + SourceIndex(0) 6 >Emitted(108, 24) Source(165, 45) + SourceIndex(0) 7 >Emitted(108, 28) Source(165, 49) + SourceIndex(0) -8 >Emitted(108, 34) Source(165, 55) + SourceIndex(0) -9 >Emitted(108, 35) Source(165, 62) + SourceIndex(0) -10>Emitted(108, 36) Source(165, 63) + SourceIndex(0) -11>Emitted(108, 38) Source(165, 65) + SourceIndex(0) -12>Emitted(108, 39) Source(165, 66) + SourceIndex(0) -13>Emitted(108, 40) Source(165, 66) + SourceIndex(0) -14>Emitted(108, 41) Source(165, 67) + SourceIndex(0) -15>Emitted(108, 42) Source(165, 68) + SourceIndex(0) -16>Emitted(108, 43) Source(165, 69) + SourceIndex(0) +8 >Emitted(108, 35) Source(165, 62) + SourceIndex(0) +9 >Emitted(108, 36) Source(165, 63) + SourceIndex(0) +10>Emitted(108, 38) Source(165, 65) + SourceIndex(0) +11>Emitted(108, 39) Source(165, 66) + SourceIndex(0) +12>Emitted(108, 40) Source(165, 66) + SourceIndex(0) +13>Emitted(108, 41) Source(165, 67) + SourceIndex(0) +14>Emitted(108, 42) Source(165, 68) + SourceIndex(0) +15>Emitted(108, 43) Source(165, 69) + SourceIndex(0) --- >>>var c12t6 = function (n, s) { return ({}); }; 1-> @@ -2667,15 +2583,14 @@ sourceFile:contextualTyping.ts 7 > ^^ 8 > ^ 9 > ^^^^ -10> ^^^^^^ -11> ^ -12> ^ -13> ^^ -14> ^ -15> ^ -16> ^ -17> ^ -18> ^ +10> ^^^^^^^ +11> ^ +12> ^^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ 1-> > 2 >var @@ -2686,15 +2601,14 @@ sourceFile:contextualTyping.ts 7 > , 8 > s 9 > ) { -10> return -11> -12> ( -13> {} -14> ) -15> -16> -17> } -18> ; +10> return +11> ( +12> {} +13> ) +14> +15> +16> } +17> ; 1->Emitted(109, 1) Source(166, 1) + SourceIndex(0) 2 >Emitted(109, 5) Source(166, 5) + SourceIndex(0) 3 >Emitted(109, 10) Source(166, 10) + SourceIndex(0) @@ -2704,15 +2618,14 @@ sourceFile:contextualTyping.ts 7 >Emitted(109, 26) Source(166, 58) + SourceIndex(0) 8 >Emitted(109, 27) Source(166, 59) + SourceIndex(0) 9 >Emitted(109, 31) Source(166, 63) + SourceIndex(0) -10>Emitted(109, 37) Source(166, 69) + SourceIndex(0) -11>Emitted(109, 38) Source(166, 76) + SourceIndex(0) -12>Emitted(109, 39) Source(166, 77) + SourceIndex(0) -13>Emitted(109, 41) Source(166, 79) + SourceIndex(0) -14>Emitted(109, 42) Source(166, 80) + SourceIndex(0) -15>Emitted(109, 43) Source(166, 80) + SourceIndex(0) -16>Emitted(109, 44) Source(166, 81) + SourceIndex(0) -17>Emitted(109, 45) Source(166, 82) + SourceIndex(0) -18>Emitted(109, 46) Source(166, 83) + SourceIndex(0) +10>Emitted(109, 38) Source(166, 76) + SourceIndex(0) +11>Emitted(109, 39) Source(166, 77) + SourceIndex(0) +12>Emitted(109, 41) Source(166, 79) + SourceIndex(0) +13>Emitted(109, 42) Source(166, 80) + SourceIndex(0) +14>Emitted(109, 43) Source(166, 80) + SourceIndex(0) +15>Emitted(109, 44) Source(166, 81) + SourceIndex(0) +16>Emitted(109, 45) Source(166, 82) + SourceIndex(0) +17>Emitted(109, 46) Source(166, 83) + SourceIndex(0) --- >>>var c12t7 = function (n) { return n; }; 1 > @@ -2722,14 +2635,13 @@ sourceFile:contextualTyping.ts 5 > ^^^^^^^^^^ 6 > ^ 7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ -15> ^-> +8 > ^^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ +14> ^-> 1 > > 2 >var @@ -2741,13 +2653,12 @@ sourceFile:contextualTyping.ts 5 > function( 6 > n:number 7 > ) { -8 > return -9 > -10> n -11> -12> -13> } -14> ; +8 > return +9 > n +10> +11> +12> } +13> ; 1 >Emitted(110, 1) Source(167, 1) + SourceIndex(0) 2 >Emitted(110, 5) Source(167, 5) + SourceIndex(0) 3 >Emitted(110, 10) Source(167, 10) + SourceIndex(0) @@ -2755,13 +2666,12 @@ sourceFile:contextualTyping.ts 5 >Emitted(110, 23) Source(170, 13) + SourceIndex(0) 6 >Emitted(110, 24) Source(170, 21) + SourceIndex(0) 7 >Emitted(110, 28) Source(170, 25) + SourceIndex(0) -8 >Emitted(110, 34) Source(170, 31) + SourceIndex(0) -9 >Emitted(110, 35) Source(170, 32) + SourceIndex(0) -10>Emitted(110, 36) Source(170, 33) + SourceIndex(0) -11>Emitted(110, 37) Source(170, 33) + SourceIndex(0) -12>Emitted(110, 38) Source(170, 34) + SourceIndex(0) -13>Emitted(110, 39) Source(170, 35) + SourceIndex(0) -14>Emitted(110, 40) Source(170, 36) + SourceIndex(0) +8 >Emitted(110, 35) Source(170, 32) + SourceIndex(0) +9 >Emitted(110, 36) Source(170, 33) + SourceIndex(0) +10>Emitted(110, 37) Source(170, 33) + SourceIndex(0) +11>Emitted(110, 38) Source(170, 34) + SourceIndex(0) +12>Emitted(110, 39) Source(170, 35) + SourceIndex(0) +13>Emitted(110, 40) Source(170, 36) + SourceIndex(0) --- >>>var c12t8 = function (n) { return n; }; 1-> @@ -2771,13 +2681,12 @@ sourceFile:contextualTyping.ts 5 > ^^^^^^^^^^ 6 > ^ 7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ +8 > ^^^^^^^ +9 > ^ +10> ^ +11> ^ +12> ^ +13> ^ 1-> > > @@ -2787,13 +2696,12 @@ sourceFile:contextualTyping.ts 5 > function( 6 > n 7 > ) { -8 > return -9 > -10> n -11> ; -12> -13> } -14> ; +8 > return +9 > n +10> ; +11> +12> } +13> ; 1->Emitted(111, 1) Source(172, 1) + SourceIndex(0) 2 >Emitted(111, 5) Source(172, 5) + SourceIndex(0) 3 >Emitted(111, 10) Source(172, 10) + SourceIndex(0) @@ -2801,13 +2709,12 @@ sourceFile:contextualTyping.ts 5 >Emitted(111, 23) Source(172, 57) + SourceIndex(0) 6 >Emitted(111, 24) Source(172, 58) + SourceIndex(0) 7 >Emitted(111, 28) Source(172, 62) + SourceIndex(0) -8 >Emitted(111, 34) Source(172, 68) + SourceIndex(0) -9 >Emitted(111, 35) Source(172, 69) + SourceIndex(0) -10>Emitted(111, 36) Source(172, 70) + SourceIndex(0) -11>Emitted(111, 37) Source(172, 71) + SourceIndex(0) -12>Emitted(111, 38) Source(172, 72) + SourceIndex(0) -13>Emitted(111, 39) Source(172, 73) + SourceIndex(0) -14>Emitted(111, 40) Source(172, 74) + SourceIndex(0) +8 >Emitted(111, 35) Source(172, 69) + SourceIndex(0) +9 >Emitted(111, 36) Source(172, 70) + SourceIndex(0) +10>Emitted(111, 37) Source(172, 71) + SourceIndex(0) +11>Emitted(111, 38) Source(172, 72) + SourceIndex(0) +12>Emitted(111, 39) Source(172, 73) + SourceIndex(0) +13>Emitted(111, 40) Source(172, 74) + SourceIndex(0) --- >>>var c12t9 = [[], []]; 1 > @@ -2900,14 +2807,13 @@ sourceFile:contextualTyping.ts 8 > ^^ 9 > ^ 10> ^^^^ -11> ^^^^^^ -12> ^ -13> ^ -14> ^ -15> ^ -16> ^ -17> ^ -18> ^ +11> ^^^^^^^ +12> ^ +13> ^ +14> ^ +15> ^ +16> ^ +17> ^ 1-> > 2 >var @@ -2919,14 +2825,13 @@ sourceFile:contextualTyping.ts 8 > , 9 > s 10> ) { -11> return -12> -13> s -14> ; -15> -16> } -17> ] -18> ; +11> return +12> s +13> ; +14> +15> } +16> ] +17> ; 1->Emitted(114, 1) Source(175, 1) + SourceIndex(0) 2 >Emitted(114, 5) Source(175, 5) + SourceIndex(0) 3 >Emitted(114, 11) Source(175, 11) + SourceIndex(0) @@ -2937,14 +2842,13 @@ sourceFile:contextualTyping.ts 8 >Emitted(114, 28) Source(175, 65) + SourceIndex(0) 9 >Emitted(114, 29) Source(175, 66) + SourceIndex(0) 10>Emitted(114, 33) Source(175, 70) + SourceIndex(0) -11>Emitted(114, 39) Source(175, 76) + SourceIndex(0) -12>Emitted(114, 40) Source(175, 77) + SourceIndex(0) -13>Emitted(114, 41) Source(175, 78) + SourceIndex(0) -14>Emitted(114, 42) Source(175, 79) + SourceIndex(0) -15>Emitted(114, 43) Source(175, 80) + SourceIndex(0) -16>Emitted(114, 44) Source(175, 81) + SourceIndex(0) -17>Emitted(114, 45) Source(175, 82) + SourceIndex(0) -18>Emitted(114, 46) Source(175, 83) + SourceIndex(0) +11>Emitted(114, 40) Source(175, 77) + SourceIndex(0) +12>Emitted(114, 41) Source(175, 78) + SourceIndex(0) +13>Emitted(114, 42) Source(175, 79) + SourceIndex(0) +14>Emitted(114, 43) Source(175, 80) + SourceIndex(0) +15>Emitted(114, 44) Source(175, 81) + SourceIndex(0) +16>Emitted(114, 45) Source(175, 82) + SourceIndex(0) +17>Emitted(114, 46) Source(175, 83) + SourceIndex(0) --- >>>var c12t12 = { 1 > @@ -3021,12 +2925,11 @@ sourceFile:contextualTyping.ts 6 > ^^ 7 > ^ 8 > ^^^^ -9 > ^^^^^^ -10> ^ -11> ^ -12> ^ -13> ^ -14> ^ +9 > ^^^^^^^ +10> ^ +11> ^ +12> ^ +13> ^ 1->{ > 2 > f @@ -3036,12 +2939,11 @@ sourceFile:contextualTyping.ts 6 > , 7 > s 8 > ) { -9 > return -10> -11> s -12> ; -13> -14> } +9 > return +10> s +11> ; +12> +13> } 1->Emitted(119, 5) Source(180, 5) + SourceIndex(0) 2 >Emitted(119, 6) Source(180, 6) + SourceIndex(0) 3 >Emitted(119, 8) Source(180, 8) + SourceIndex(0) @@ -3050,12 +2952,11 @@ sourceFile:contextualTyping.ts 6 >Emitted(119, 21) Source(180, 20) + SourceIndex(0) 7 >Emitted(119, 22) Source(180, 21) + SourceIndex(0) 8 >Emitted(119, 26) Source(180, 25) + SourceIndex(0) -9 >Emitted(119, 32) Source(180, 31) + SourceIndex(0) -10>Emitted(119, 33) Source(180, 32) + SourceIndex(0) -11>Emitted(119, 34) Source(180, 33) + SourceIndex(0) -12>Emitted(119, 35) Source(180, 34) + SourceIndex(0) -13>Emitted(119, 36) Source(180, 35) + SourceIndex(0) -14>Emitted(119, 37) Source(180, 36) + SourceIndex(0) +9 >Emitted(119, 33) Source(180, 32) + SourceIndex(0) +10>Emitted(119, 34) Source(180, 33) + SourceIndex(0) +11>Emitted(119, 35) Source(180, 34) + SourceIndex(0) +12>Emitted(119, 36) Source(180, 35) + SourceIndex(0) +13>Emitted(119, 37) Source(180, 36) + SourceIndex(0) --- >>>}); 1 >^ @@ -3123,14 +3024,13 @@ sourceFile:contextualTyping.ts 4 > ^^ 5 > ^ 6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^^^ -11> ^ -12> ^ -13> ^ -14> ^ +7 > ^^^^^^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^ +12> ^ +13> ^ 1-> > >// CONTEXT: Contextual typing declarations @@ -3144,28 +3044,26 @@ sourceFile:contextualTyping.ts 4 > , 5 > b 6 > ) { -7 > return -8 > -9 > a -10> + -11> b -12> ; -13> -14> } +7 > return +8 > a +9 > + +10> b +11> ; +12> +13> } 1->Emitted(124, 1) Source(191, 1) + SourceIndex(0) 2 >Emitted(124, 14) Source(191, 14) + SourceIndex(0) 3 >Emitted(124, 15) Source(191, 15) + SourceIndex(0) 4 >Emitted(124, 17) Source(191, 16) + SourceIndex(0) 5 >Emitted(124, 18) Source(191, 17) + SourceIndex(0) 6 >Emitted(124, 22) Source(191, 21) + SourceIndex(0) -7 >Emitted(124, 28) Source(191, 27) + SourceIndex(0) -8 >Emitted(124, 29) Source(191, 28) + SourceIndex(0) -9 >Emitted(124, 30) Source(191, 29) + SourceIndex(0) -10>Emitted(124, 33) Source(191, 30) + SourceIndex(0) -11>Emitted(124, 34) Source(191, 31) + SourceIndex(0) -12>Emitted(124, 35) Source(191, 32) + SourceIndex(0) -13>Emitted(124, 36) Source(191, 33) + SourceIndex(0) -14>Emitted(124, 37) Source(191, 34) + SourceIndex(0) +7 >Emitted(124, 29) Source(191, 28) + SourceIndex(0) +8 >Emitted(124, 30) Source(191, 29) + SourceIndex(0) +9 >Emitted(124, 33) Source(191, 30) + SourceIndex(0) +10>Emitted(124, 34) Source(191, 31) + SourceIndex(0) +11>Emitted(124, 35) Source(191, 32) + SourceIndex(0) +12>Emitted(124, 36) Source(191, 33) + SourceIndex(0) +13>Emitted(124, 37) Source(191, 34) + SourceIndex(0) --- >>>var efv = EF1(1, 2); 1 > @@ -3288,22 +3186,19 @@ sourceFile:contextualTyping.ts --- >>> return this; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ 1-> > > -2 > return -3 > -4 > this -5 > ; +2 > return +3 > this +4 > ; 1->Emitted(129, 5) Source(211, 5) + SourceIndex(0) -2 >Emitted(129, 11) Source(211, 11) + SourceIndex(0) -3 >Emitted(129, 12) Source(211, 12) + SourceIndex(0) -4 >Emitted(129, 16) Source(211, 16) + SourceIndex(0) -5 >Emitted(129, 17) Source(211, 17) + SourceIndex(0) +2 >Emitted(129, 12) Source(211, 12) + SourceIndex(0) +3 >Emitted(129, 16) Source(211, 16) + SourceIndex(0) +4 >Emitted(129, 17) Source(211, 17) + SourceIndex(0) --- >>>} 1 > @@ -3399,63 +3294,60 @@ sourceFile:contextualTyping.ts --- >>> return new Point(this.x + dx, this.y + dy); 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^ -10> ^^^ -11> ^^ -12> ^^ -13> ^^^^ -14> ^ -15> ^ -16> ^^^ -17> ^^ -18> ^ -19> ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +9 > ^^^ +10> ^^ +11> ^^ +12> ^^^^ +13> ^ +14> ^ +15> ^^^ +16> ^^ +17> ^ +18> ^ 1->) { > -2 > return -3 > -4 > new -5 > Point -6 > ( -7 > this -8 > . -9 > x -10> + -11> dx -12> , -13> this -14> . -15> y -16> + -17> dy -18> ) -19> ; +2 > return +3 > new +4 > Point +5 > ( +6 > this +7 > . +8 > x +9 > + +10> dx +11> , +12> this +13> . +14> y +15> + +16> dy +17> ) +18> ; 1->Emitted(133, 5) Source(217, 5) + SourceIndex(0) -2 >Emitted(133, 11) Source(217, 11) + SourceIndex(0) -3 >Emitted(133, 12) Source(217, 12) + SourceIndex(0) -4 >Emitted(133, 16) Source(217, 16) + SourceIndex(0) -5 >Emitted(133, 21) Source(217, 21) + SourceIndex(0) -6 >Emitted(133, 22) Source(217, 22) + SourceIndex(0) -7 >Emitted(133, 26) Source(217, 26) + SourceIndex(0) -8 >Emitted(133, 27) Source(217, 27) + SourceIndex(0) -9 >Emitted(133, 28) Source(217, 28) + SourceIndex(0) -10>Emitted(133, 31) Source(217, 31) + SourceIndex(0) -11>Emitted(133, 33) Source(217, 33) + SourceIndex(0) -12>Emitted(133, 35) Source(217, 35) + SourceIndex(0) -13>Emitted(133, 39) Source(217, 39) + SourceIndex(0) -14>Emitted(133, 40) Source(217, 40) + SourceIndex(0) -15>Emitted(133, 41) Source(217, 41) + SourceIndex(0) -16>Emitted(133, 44) Source(217, 44) + SourceIndex(0) -17>Emitted(133, 46) Source(217, 46) + SourceIndex(0) -18>Emitted(133, 47) Source(217, 47) + SourceIndex(0) -19>Emitted(133, 48) Source(217, 48) + SourceIndex(0) +2 >Emitted(133, 12) Source(217, 12) + SourceIndex(0) +3 >Emitted(133, 16) Source(217, 16) + SourceIndex(0) +4 >Emitted(133, 21) Source(217, 21) + SourceIndex(0) +5 >Emitted(133, 22) Source(217, 22) + SourceIndex(0) +6 >Emitted(133, 26) Source(217, 26) + SourceIndex(0) +7 >Emitted(133, 27) Source(217, 27) + SourceIndex(0) +8 >Emitted(133, 28) Source(217, 28) + SourceIndex(0) +9 >Emitted(133, 31) Source(217, 31) + SourceIndex(0) +10>Emitted(133, 33) Source(217, 33) + SourceIndex(0) +11>Emitted(133, 35) Source(217, 35) + SourceIndex(0) +12>Emitted(133, 39) Source(217, 39) + SourceIndex(0) +13>Emitted(133, 40) Source(217, 40) + SourceIndex(0) +14>Emitted(133, 41) Source(217, 41) + SourceIndex(0) +15>Emitted(133, 44) Source(217, 44) + SourceIndex(0) +16>Emitted(133, 46) Source(217, 46) + SourceIndex(0) +17>Emitted(133, 47) Source(217, 47) + SourceIndex(0) +18>Emitted(133, 48) Source(217, 48) + SourceIndex(0) --- >>>}; 1 > @@ -3548,63 +3440,60 @@ sourceFile:contextualTyping.ts --- >>> return new Point(this.x + dx, this.y + dy); 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^ -10> ^^^ -11> ^^ -12> ^^ -13> ^^^^ -14> ^ -15> ^ -16> ^^^ -17> ^^ -18> ^ -19> ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ +9 > ^^^ +10> ^^ +11> ^^ +12> ^^^^ +13> ^ +14> ^ +15> ^^^ +16> ^^ +17> ^ +18> ^ 1->) { > -2 > return -3 > -4 > new -5 > Point -6 > ( -7 > this -8 > . -9 > x -10> + -11> dx -12> , -13> this -14> . -15> y -16> + -17> dy -18> ) -19> ; +2 > return +3 > new +4 > Point +5 > ( +6 > this +7 > . +8 > x +9 > + +10> dx +11> , +12> this +13> . +14> y +15> + +16> dy +17> ) +18> ; 1->Emitted(139, 9) Source(224, 9) + SourceIndex(0) -2 >Emitted(139, 15) Source(224, 15) + SourceIndex(0) -3 >Emitted(139, 16) Source(224, 16) + SourceIndex(0) -4 >Emitted(139, 20) Source(224, 20) + SourceIndex(0) -5 >Emitted(139, 25) Source(224, 25) + SourceIndex(0) -6 >Emitted(139, 26) Source(224, 26) + SourceIndex(0) -7 >Emitted(139, 30) Source(224, 30) + SourceIndex(0) -8 >Emitted(139, 31) Source(224, 31) + SourceIndex(0) -9 >Emitted(139, 32) Source(224, 32) + SourceIndex(0) -10>Emitted(139, 35) Source(224, 35) + SourceIndex(0) -11>Emitted(139, 37) Source(224, 37) + SourceIndex(0) -12>Emitted(139, 39) Source(224, 39) + SourceIndex(0) -13>Emitted(139, 43) Source(224, 43) + SourceIndex(0) -14>Emitted(139, 44) Source(224, 44) + SourceIndex(0) -15>Emitted(139, 45) Source(224, 45) + SourceIndex(0) -16>Emitted(139, 48) Source(224, 48) + SourceIndex(0) -17>Emitted(139, 50) Source(224, 50) + SourceIndex(0) -18>Emitted(139, 51) Source(224, 51) + SourceIndex(0) -19>Emitted(139, 52) Source(224, 52) + SourceIndex(0) +2 >Emitted(139, 16) Source(224, 16) + SourceIndex(0) +3 >Emitted(139, 20) Source(224, 20) + SourceIndex(0) +4 >Emitted(139, 25) Source(224, 25) + SourceIndex(0) +5 >Emitted(139, 26) Source(224, 26) + SourceIndex(0) +6 >Emitted(139, 30) Source(224, 30) + SourceIndex(0) +7 >Emitted(139, 31) Source(224, 31) + SourceIndex(0) +8 >Emitted(139, 32) Source(224, 32) + SourceIndex(0) +9 >Emitted(139, 35) Source(224, 35) + SourceIndex(0) +10>Emitted(139, 37) Source(224, 37) + SourceIndex(0) +11>Emitted(139, 39) Source(224, 39) + SourceIndex(0) +12>Emitted(139, 43) Source(224, 43) + SourceIndex(0) +13>Emitted(139, 44) Source(224, 44) + SourceIndex(0) +14>Emitted(139, 45) Source(224, 45) + SourceIndex(0) +15>Emitted(139, 48) Source(224, 48) + SourceIndex(0) +16>Emitted(139, 50) Source(224, 50) + SourceIndex(0) +17>Emitted(139, 51) Source(224, 51) + SourceIndex(0) +18>Emitted(139, 52) Source(224, 52) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/continueStatementInternalComments.js b/tests/baselines/reference/continueStatementInternalComments.js new file mode 100644 index 00000000000..82a26fe452a --- /dev/null +++ b/tests/baselines/reference/continueStatementInternalComments.js @@ -0,0 +1,9 @@ +//// [continueStatementInternalComments.ts] +foo: for (;;) { + /*1*/ continue /*2*/ foo /*3*/; +} + +//// [continueStatementInternalComments.js] +foo: for (;;) { + /*1*/ continue /*2*/ foo /*3*/; +} diff --git a/tests/baselines/reference/continueStatementInternalComments.symbols b/tests/baselines/reference/continueStatementInternalComments.symbols new file mode 100644 index 00000000000..51b8189ab16 --- /dev/null +++ b/tests/baselines/reference/continueStatementInternalComments.symbols @@ -0,0 +1,5 @@ +=== tests/cases/compiler/continueStatementInternalComments.ts === +foo: for (;;) { +No type information for this code. /*1*/ continue /*2*/ foo /*3*/; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueStatementInternalComments.types b/tests/baselines/reference/continueStatementInternalComments.types new file mode 100644 index 00000000000..d04f1d7fe16 --- /dev/null +++ b/tests/baselines/reference/continueStatementInternalComments.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/continueStatementInternalComments.ts === +foo: for (;;) { +>foo : any + + /*1*/ continue /*2*/ foo /*3*/; +>foo : any +} diff --git a/tests/baselines/reference/controlFlowArrays.js b/tests/baselines/reference/controlFlowArrays.js index 134216b2eea..73ac8932f7b 100644 --- a/tests/baselines/reference/controlFlowArrays.js +++ b/tests/baselines/reference/controlFlowArrays.js @@ -283,7 +283,7 @@ function f10() { } function f11() { var x = []; - if (x.length === 0) { + if (x.length === 0) { // x.length ok on implicit any[] x.push("hello"); } return x; @@ -291,7 +291,7 @@ function f11() { function f12() { var x; x = []; - if (x.length === 0) { + if (x.length === 0) { // x.length ok on implicit any[] x.push("hello"); } return x; diff --git a/tests/baselines/reference/declFileObjectLiteralWithAccessors.js b/tests/baselines/reference/declFileObjectLiteralWithAccessors.js index 9c9f897e8b3..8a6ebfec004 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithAccessors.js +++ b/tests/baselines/reference/declFileObjectLiteralWithAccessors.js @@ -21,7 +21,7 @@ function makePoint(x) { ; var /*4*/ point = makePoint(2); var /*2*/ x = point.x; -point.x = 30; +point. /*3*/x = 30; //// [declFileObjectLiteralWithAccessors.d.ts] diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js index 4d7f3fe7cfe..1552386b3cd 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlyGetter.js @@ -16,7 +16,7 @@ function makePoint(x) { } ; var /*4*/ point = makePoint(2); -var /*2*/ x = point.x; +var /*2*/ x = point. /*3*/x; //// [declFileObjectLiteralWithOnlyGetter.d.ts] diff --git a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js index 188e47c8b8e..03174e7714f 100644 --- a/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js +++ b/tests/baselines/reference/declFileObjectLiteralWithOnlySetter.js @@ -17,7 +17,7 @@ function makePoint(x) { } ; var /*3*/ point = makePoint(2); -point.x = 30; +point. /*2*/x = 30; //// [declFileObjectLiteralWithOnlySetter.d.ts] diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map index 4075fca49c9..95863180dd8 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.js.map @@ -1,2 +1,2 @@ //// [derivedClassConstructorWithExplicitReturns01.js.map] -{"version":3,"file":"derivedClassConstructorWithExplicitReturns01.js","sourceRoot":"","sources":["derivedClassConstructorWithExplicitReturns01.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;IAKI,WAAY,KAAa;QAJzB,UAAK,GAAG,EAAE,CAAC;QAKP,MAAM,CAAC;YACH,KAAK,EAAE,KAAK;YACZ,GAAG;gBACC,MAAM,CAAC,8BAA8B,CAAC;YAC1C,CAAC;SACJ,CAAA;IACL,CAAC;IATD,eAAG,GAAH,cAAQ,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAU7C,QAAC;AAAD,CAAC,AAbD,IAaC;AAED;IAAgB,qBAAC;IAGb,WAAY,CAAO;QAAP,kBAAA,EAAA,OAAO;QAAnB,YACI,kBAAM,CAAC,CAAC,SAYX;QAfD,WAAK,GAAG,cAAM,OAAA,KAAI,EAAJ,CAAI,CAAC;QAKf,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;YACtB,UAAU,CAAA;YACV,MAAM,CAAC;gBACH,KAAK,EAAE,CAAC;gBACR,KAAK,EAAE,cAAM,OAAA,KAAI,EAAJ,CAAI;gBACjB,GAAG,gBAAK,MAAM,CAAC,cAAc,CAAA,CAAC,CAAC;aAClC,CAAC;QACN,CAAC;QACD,IAAI;YACA,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC;IACL,QAAC;AAAD,CAAC,AAjBD,CAAgB,CAAC,GAiBhB"} \ No newline at end of file +{"version":3,"file":"derivedClassConstructorWithExplicitReturns01.js","sourceRoot":"","sources":["derivedClassConstructorWithExplicitReturns01.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;IAKI,WAAY,KAAa;QAJzB,UAAK,GAAG,EAAE,CAAC;QAKP,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,GAAG;gBACC,OAAO,8BAA8B,CAAC;YAC1C,CAAC;SACJ,CAAA;IACL,CAAC;IATD,eAAG,GAAH,cAAQ,OAAO,uBAAuB,CAAC,CAAC,CAAC;IAU7C,QAAC;AAAD,CAAC,AAbD,IAaC;AAED;IAAgB,qBAAC;IAGb,WAAY,CAAO;QAAP,kBAAA,EAAA,OAAO;QAAnB,YACI,kBAAM,CAAC,CAAC,SAYX;QAfD,WAAK,GAAG,cAAM,OAAA,KAAI,EAAJ,CAAI,CAAC;QAKf,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE;YACrB,UAAU,CAAA;YACV,OAAO;gBACH,KAAK,EAAE,CAAC;gBACR,KAAK,EAAE,cAAM,OAAA,KAAI,EAAJ,CAAI;gBACjB,GAAG,gBAAK,OAAO,cAAc,CAAA,CAAC,CAAC;aAClC,CAAC;SACL;;YAEG,OAAO,IAAI,CAAC;IACpB,CAAC;IACL,QAAC;AAAD,CAAC,AAjBD,CAAgB,CAAC,GAiBhB"} \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt index 0035175c62f..4f91f9c1c6d 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.sourcemap.txt @@ -60,20 +60,17 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts --- >>> return { 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^-> +2 > ^^^^^^^ +3 > ^^^^^^^^^^^-> 1 > > > foo() { return "this never gets used."; } > > constructor(value: number) { > -2 > return -3 > +2 > return 1 >Emitted(14, 9) Source(7, 9) + SourceIndex(0) -2 >Emitted(14, 15) Source(7, 15) + SourceIndex(0) -3 >Emitted(14, 16) Source(7, 16) + SourceIndex(0) +2 >Emitted(14, 16) Source(7, 16) + SourceIndex(0) --- >>> cProp: value, 1->^^^^^^^^^^^^ @@ -103,21 +100,18 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts --- >>> return "well this looks kinda C-ish."; 1->^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^ 1->() { > -2 > return -3 > -4 > "well this looks kinda C-ish." -5 > ; +2 > return +3 > "well this looks kinda C-ish." +4 > ; 1->Emitted(17, 17) Source(10, 17) + SourceIndex(0) -2 >Emitted(17, 23) Source(10, 23) + SourceIndex(0) -3 >Emitted(17, 24) Source(10, 24) + SourceIndex(0) -4 >Emitted(17, 54) Source(10, 54) + SourceIndex(0) -5 >Emitted(17, 55) Source(10, 55) + SourceIndex(0) +2 >Emitted(17, 24) Source(10, 24) + SourceIndex(0) +3 >Emitted(17, 54) Source(10, 54) + SourceIndex(0) +4 >Emitted(17, 55) Source(10, 55) + SourceIndex(0) --- >>> } 1 >^^^^^^^^^^^^ @@ -152,32 +146,29 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 2 > ^^^^^^^^^^^^^^^ 3 > ^^^ 4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^ -6 > ^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^ -9 > ^ -10> ^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^ +8 > ^ +9 > ^ 1-> 2 > foo 3 > 4 > foo() { -5 > return -6 > -7 > "this never gets used." -8 > ; -9 > -10> } +5 > return +6 > "this never gets used." +7 > ; +8 > +9 > } 1->Emitted(21, 5) Source(4, 5) + SourceIndex(0) 2 >Emitted(21, 20) Source(4, 8) + SourceIndex(0) 3 >Emitted(21, 23) Source(4, 5) + SourceIndex(0) 4 >Emitted(21, 37) Source(4, 13) + SourceIndex(0) -5 >Emitted(21, 43) Source(4, 19) + SourceIndex(0) -6 >Emitted(21, 44) Source(4, 20) + SourceIndex(0) -7 >Emitted(21, 67) Source(4, 43) + SourceIndex(0) -8 >Emitted(21, 68) Source(4, 44) + SourceIndex(0) -9 >Emitted(21, 69) Source(4, 45) + SourceIndex(0) -10>Emitted(21, 70) Source(4, 46) + SourceIndex(0) +5 >Emitted(21, 44) Source(4, 20) + SourceIndex(0) +6 >Emitted(21, 67) Source(4, 43) + SourceIndex(0) +7 >Emitted(21, 68) Source(4, 44) + SourceIndex(0) +8 >Emitted(21, 69) Source(4, 45) + SourceIndex(0) +9 >Emitted(21, 70) Source(4, 46) + SourceIndex(0) --- >>> return C; 1 >^^^^ @@ -336,55 +327,43 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts --- >>> if (Math.random() < 0.5) { 1 >^^^^^^^^ -2 > ^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^ -10> ^^^ -11> ^ -12> ^ -13> ^ +2 > ^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^ +8 > ^^^ +9 > ^^ 1 > > > constructor(a = 100) { > super(a); > > -2 > if -3 > -4 > ( -5 > Math -6 > . -7 > random -8 > () -9 > < -10> 0.5 -11> ) -12> -13> { +2 > if ( +3 > Math +4 > . +5 > random +6 > () +7 > < +8 > 0.5 +9 > ) 1 >Emitted(30, 9) Source(22, 9) + SourceIndex(0) -2 >Emitted(30, 11) Source(22, 11) + SourceIndex(0) -3 >Emitted(30, 12) Source(22, 12) + SourceIndex(0) -4 >Emitted(30, 13) Source(22, 13) + SourceIndex(0) -5 >Emitted(30, 17) Source(22, 17) + SourceIndex(0) -6 >Emitted(30, 18) Source(22, 18) + SourceIndex(0) -7 >Emitted(30, 24) Source(22, 24) + SourceIndex(0) -8 >Emitted(30, 26) Source(22, 26) + SourceIndex(0) -9 >Emitted(30, 29) Source(22, 29) + SourceIndex(0) -10>Emitted(30, 32) Source(22, 32) + SourceIndex(0) -11>Emitted(30, 33) Source(22, 33) + SourceIndex(0) -12>Emitted(30, 34) Source(22, 34) + SourceIndex(0) -13>Emitted(30, 35) Source(22, 35) + SourceIndex(0) +2 >Emitted(30, 13) Source(22, 13) + SourceIndex(0) +3 >Emitted(30, 17) Source(22, 17) + SourceIndex(0) +4 >Emitted(30, 18) Source(22, 18) + SourceIndex(0) +5 >Emitted(30, 24) Source(22, 24) + SourceIndex(0) +6 >Emitted(30, 26) Source(22, 26) + SourceIndex(0) +7 >Emitted(30, 29) Source(22, 29) + SourceIndex(0) +8 >Emitted(30, 32) Source(22, 32) + SourceIndex(0) +9 >Emitted(30, 34) Source(22, 34) + SourceIndex(0) --- >>> "You win!"; 1 >^^^^^^^^^^^^ 2 > ^^^^^^^^^^ 3 > ^ -1 > +1 >{ > 2 > "You win!" 3 > @@ -394,16 +373,13 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts --- >>> return { 1 >^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^-> +2 > ^^^^^^^ +3 > ^^^^^^^-> 1 > > -2 > return -3 > +2 > return 1 >Emitted(32, 13) Source(24, 13) + SourceIndex(0) -2 >Emitted(32, 19) Source(24, 19) + SourceIndex(0) -3 >Emitted(32, 20) Source(24, 20) + SourceIndex(0) +2 >Emitted(32, 20) Source(24, 20) + SourceIndex(0) --- >>> cProp: 1, 1->^^^^^^^^^^^^^^^^ @@ -453,31 +429,28 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1->^^^^^^^^^^^^^^^^ 2 > ^^^ 3 > ^^^^^^^^^^^^^^^^ -4 > ^^^^^^ -5 > ^ -6 > ^^^^^^^^^^^^^^ -7 > ^ -8 > ^ -9 > ^ +4 > ^^^^^^^ +5 > ^^^^^^^^^^^^^^ +6 > ^ +7 > ^ +8 > ^ 1->, > 2 > foo 3 > () { -4 > return -5 > -6 > "You win!!!!!" -7 > -8 > -9 > } +4 > return +5 > "You win!!!!!" +6 > +7 > +8 > } 1->Emitted(35, 17) Source(27, 17) + SourceIndex(0) 2 >Emitted(35, 20) Source(27, 20) + SourceIndex(0) 3 >Emitted(35, 36) Source(27, 25) + SourceIndex(0) -4 >Emitted(35, 42) Source(27, 31) + SourceIndex(0) -5 >Emitted(35, 43) Source(27, 32) + SourceIndex(0) -6 >Emitted(35, 57) Source(27, 46) + SourceIndex(0) -7 >Emitted(35, 58) Source(27, 46) + SourceIndex(0) -8 >Emitted(35, 59) Source(27, 47) + SourceIndex(0) -9 >Emitted(35, 60) Source(27, 48) + SourceIndex(0) +4 >Emitted(35, 43) Source(27, 32) + SourceIndex(0) +5 >Emitted(35, 57) Source(27, 46) + SourceIndex(0) +6 >Emitted(35, 58) Source(27, 46) + SourceIndex(0) +7 >Emitted(35, 59) Source(27, 47) + SourceIndex(0) +8 >Emitted(35, 60) Source(27, 48) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^ @@ -489,42 +462,28 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 2 >Emitted(36, 15) Source(28, 15) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^-> +1 >^^^^^^^^^ +2 > ^^^^-> 1 > - > -2 > } -1 >Emitted(37, 9) Source(29, 9) + SourceIndex(0) -2 >Emitted(37, 10) Source(29, 10) + SourceIndex(0) + > } +1 >Emitted(37, 10) Source(29, 10) + SourceIndex(0) --- >>> else -1->^^^^^^^^ -2 > ^^^^ -3 > ^^^^^^^^^^^^^-> -1-> - > -2 > else -1->Emitted(38, 9) Source(30, 9) + SourceIndex(0) -2 >Emitted(38, 13) Source(30, 13) + SourceIndex(0) ---- >>> return null; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ 1-> + > else > -2 > return -3 > -4 > null -5 > ; +2 > return +3 > null +4 > ; 1->Emitted(39, 13) Source(31, 13) + SourceIndex(0) -2 >Emitted(39, 19) Source(31, 19) + SourceIndex(0) -3 >Emitted(39, 20) Source(31, 20) + SourceIndex(0) -4 >Emitted(39, 24) Source(31, 24) + SourceIndex(0) -5 >Emitted(39, 25) Source(31, 25) + SourceIndex(0) +2 >Emitted(39, 20) Source(31, 20) + SourceIndex(0) +3 >Emitted(39, 24) Source(31, 24) + SourceIndex(0) +4 >Emitted(39, 25) Source(31, 25) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/destructuringCatch.js b/tests/baselines/reference/destructuringCatch.js index 8a10c01f6f8..3230b7d1aad 100644 --- a/tests/baselines/reference/destructuringCatch.js +++ b/tests/baselines/reference/destructuringCatch.js @@ -53,6 +53,6 @@ catch (_c) { // Test of comment ranges. A fix to GH#11755 should update this. try { } -catch (_e) { +catch ( /*Test comment ranges*/_e) { var /*a*/ a = _e[0]; } diff --git a/tests/baselines/reference/duplicateLocalVariable1.js b/tests/baselines/reference/duplicateLocalVariable1.js index d0d17ff0b4c..b2e03768cf1 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.js +++ b/tests/baselines/reference/duplicateLocalVariable1.js @@ -382,7 +382,7 @@ var TestRunner = /** @class */ (function () { exception = true; testResult = false; if (typeof testcase.errorMessageRegEx === "string") { - if (testcase.errorMessageRegEx === "") { + if (testcase.errorMessageRegEx === "") { // Any error is fine testResult = true; } else if (e.message) { diff --git a/tests/baselines/reference/elementAccessExpressionInternalComments.js b/tests/baselines/reference/elementAccessExpressionInternalComments.js new file mode 100644 index 00000000000..99d6537df99 --- /dev/null +++ b/tests/baselines/reference/elementAccessExpressionInternalComments.js @@ -0,0 +1,17 @@ +//// [elementAccessExpressionInternalComments.ts] +/*0*/ Array /*1*/[ /*2*/ "toString" /*3*/ ] /*4*/; /*5*/ + +/*0*/ Array + // single line + /*1*/[ /*2*/ "toString" + // single line + /*3*/ ] /*4*/ + + +//// [elementAccessExpressionInternalComments.js] +/*0*/ Array /*1*/[ /*2*/"toString" /*3*/] /*4*/; /*5*/ +/*0*/ Array +// single line +/*1*/ [ /*2*/"toString" +// single line +/*3*/ ]; /*4*/ diff --git a/tests/baselines/reference/elementAccessExpressionInternalComments.symbols b/tests/baselines/reference/elementAccessExpressionInternalComments.symbols new file mode 100644 index 00000000000..c5b6cb7afc4 --- /dev/null +++ b/tests/baselines/reference/elementAccessExpressionInternalComments.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/elementAccessExpressionInternalComments.ts === +/*0*/ Array /*1*/[ /*2*/ "toString" /*3*/ ] /*4*/; /*5*/ +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>"toString" : Symbol(Function.toString, Decl(lib.d.ts, --, --)) + +/*0*/ Array +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + // single line + /*1*/[ /*2*/ "toString" +>"toString" : Symbol(Function.toString, Decl(lib.d.ts, --, --)) + + // single line + /*3*/ ] /*4*/ + diff --git a/tests/baselines/reference/elementAccessExpressionInternalComments.types b/tests/baselines/reference/elementAccessExpressionInternalComments.types new file mode 100644 index 00000000000..f5aef6036de --- /dev/null +++ b/tests/baselines/reference/elementAccessExpressionInternalComments.types @@ -0,0 +1,17 @@ +=== tests/cases/compiler/elementAccessExpressionInternalComments.ts === +/*0*/ Array /*1*/[ /*2*/ "toString" /*3*/ ] /*4*/; /*5*/ +>Array /*1*/[ /*2*/ "toString" /*3*/ ] : () => string +>Array : ArrayConstructor +>"toString" : "toString" + +/*0*/ Array +>Array // single line /*1*/[ /*2*/ "toString" // single line /*3*/ ] : () => string +>Array : ArrayConstructor + + // single line + /*1*/[ /*2*/ "toString" +>"toString" : "toString" + + // single line + /*3*/ ] /*4*/ + diff --git a/tests/baselines/reference/emptyArgumentsListComment.js b/tests/baselines/reference/emptyArgumentsListComment.js new file mode 100644 index 00000000000..a8f3f9cbcde --- /dev/null +++ b/tests/baselines/reference/emptyArgumentsListComment.js @@ -0,0 +1,22 @@ +//// [emptyArgumentsListComment.ts] +declare var a; + +a(/*1*/); +a( + /*first*/ + // foo + /*middle*/ + // bar + /*last*/ +); + + +//// [emptyArgumentsListComment.js] +a( /*1*/); +a( +/*first*/ +// foo +/*middle*/ +// bar +/*last*/ +); diff --git a/tests/baselines/reference/emptyArgumentsListComment.symbols b/tests/baselines/reference/emptyArgumentsListComment.symbols new file mode 100644 index 00000000000..04fbe278d7a --- /dev/null +++ b/tests/baselines/reference/emptyArgumentsListComment.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/emptyArgumentsListComment.ts === +declare var a; +>a : Symbol(a, Decl(emptyArgumentsListComment.ts, 0, 11)) + +a(/*1*/); +>a : Symbol(a, Decl(emptyArgumentsListComment.ts, 0, 11)) + +a( +>a : Symbol(a, Decl(emptyArgumentsListComment.ts, 0, 11)) + + /*first*/ + // foo + /*middle*/ + // bar + /*last*/ +); + diff --git a/tests/baselines/reference/emptyArgumentsListComment.types b/tests/baselines/reference/emptyArgumentsListComment.types new file mode 100644 index 00000000000..71e2c06aafe --- /dev/null +++ b/tests/baselines/reference/emptyArgumentsListComment.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/emptyArgumentsListComment.ts === +declare var a; +>a : any + +a(/*1*/); +>a(/*1*/) : any +>a : any + +a( +>a( /*first*/ // foo /*middle*/ // bar /*last*/) : any +>a : any + + /*first*/ + // foo + /*middle*/ + // bar + /*last*/ +); + diff --git a/tests/baselines/reference/es3-sourcemap-amd.js.map b/tests/baselines/reference/es3-sourcemap-amd.js.map index ea5ed85a88e..e4249c7322f 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.js.map +++ b/tests/baselines/reference/es3-sourcemap-amd.js.map @@ -1,2 +1,2 @@ //// [es3-sourcemap-amd.js.map] -{"version":3,"file":"es3-sourcemap-amd.js","sourceRoot":"","sources":["es3-sourcemap-amd.ts"],"names":[],"mappings":"AAAA;IAEI;IAGA,CAAC;IAEM,aAAC,GAAR;QAEI,MAAM,CAAC,EAAE,CAAC;IACd,CAAC;IACL,QAAC;AAAD,CAAC,AAXD,IAWC"} \ No newline at end of file +{"version":3,"file":"es3-sourcemap-amd.js","sourceRoot":"","sources":["es3-sourcemap-amd.ts"],"names":[],"mappings":"AAAA;IAEI;IAGA,CAAC;IAEM,aAAC,GAAR;QAEI,OAAO,EAAE,CAAC;IACd,CAAC;IACL,QAAC;AAAD,CAAC,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt b/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt index 2c2bf5e3102..03983091812 100644 --- a/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt +++ b/tests/baselines/reference/es3-sourcemap-amd.sourcemap.txt @@ -49,22 +49,19 @@ sourceFile:es3-sourcemap-amd.ts --- >>> return 42; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ 1 >public B() > { > -2 > return -3 > -4 > 42 -5 > ; +2 > return +3 > 42 +4 > ; 1 >Emitted(5, 9) Source(10, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(10, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(10, 16) + SourceIndex(0) -4 >Emitted(5, 18) Source(10, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) +2 >Emitted(5, 16) Source(10, 16) + SourceIndex(0) +3 >Emitted(5, 18) Source(10, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) --- >>> }; 1 >^^^^ diff --git a/tests/baselines/reference/es5-souremap-amd.js.map b/tests/baselines/reference/es5-souremap-amd.js.map index 111d19c26fc..9aa39e9c7c8 100644 --- a/tests/baselines/reference/es5-souremap-amd.js.map +++ b/tests/baselines/reference/es5-souremap-amd.js.map @@ -1,2 +1,2 @@ //// [es5-souremap-amd.js.map] -{"version":3,"file":"es5-souremap-amd.js","sourceRoot":"","sources":["es5-souremap-amd.ts"],"names":[],"mappings":"AAAA;IAEI;IAGA,CAAC;IAEM,aAAC,GAAR;QAEI,MAAM,CAAC,EAAE,CAAC;IACd,CAAC;IACL,QAAC;AAAD,CAAC,AAXD,IAWC"} \ No newline at end of file +{"version":3,"file":"es5-souremap-amd.js","sourceRoot":"","sources":["es5-souremap-amd.ts"],"names":[],"mappings":"AAAA;IAEI;IAGA,CAAC;IAEM,aAAC,GAAR;QAEI,OAAO,EAAE,CAAC;IACd,CAAC;IACL,QAAC;AAAD,CAAC,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/es5-souremap-amd.sourcemap.txt b/tests/baselines/reference/es5-souremap-amd.sourcemap.txt index 3494eaf937e..2e0652a2e39 100644 --- a/tests/baselines/reference/es5-souremap-amd.sourcemap.txt +++ b/tests/baselines/reference/es5-souremap-amd.sourcemap.txt @@ -49,22 +49,19 @@ sourceFile:es5-souremap-amd.ts --- >>> return 42; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ 1 >public B() > { > -2 > return -3 > -4 > 42 -5 > ; +2 > return +3 > 42 +4 > ; 1 >Emitted(5, 9) Source(10, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(10, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(10, 16) + SourceIndex(0) -4 >Emitted(5, 18) Source(10, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) +2 >Emitted(5, 16) Source(10, 16) + SourceIndex(0) +3 >Emitted(5, 18) Source(10, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) --- >>> }; 1 >^^^^ diff --git a/tests/baselines/reference/es6-sourcemap-amd.js.map b/tests/baselines/reference/es6-sourcemap-amd.js.map index 0b8d7530c24..7f1e7123835 100644 --- a/tests/baselines/reference/es6-sourcemap-amd.js.map +++ b/tests/baselines/reference/es6-sourcemap-amd.js.map @@ -1,2 +1,2 @@ //// [es6-sourcemap-amd.js.map] -{"version":3,"file":"es6-sourcemap-amd.js","sourceRoot":"","sources":["es6-sourcemap-amd.ts"],"names":[],"mappings":"AAAA;IAEI;IAGA,CAAC;IAEM,CAAC;QAEJ,MAAM,CAAC,EAAE,CAAC;IACd,CAAC;CACJ"} \ No newline at end of file +{"version":3,"file":"es6-sourcemap-amd.js","sourceRoot":"","sources":["es6-sourcemap-amd.ts"],"names":[],"mappings":"AAAA;IAEI;IAGA,CAAC;IAEM,CAAC;QAEJ,OAAO,EAAE,CAAC;IACd,CAAC;CACJ"} \ No newline at end of file diff --git a/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt b/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt index fbc12ecf84b..f1669060fe6 100644 --- a/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt +++ b/tests/baselines/reference/es6-sourcemap-amd.sourcemap.txt @@ -47,22 +47,19 @@ sourceFile:es6-sourcemap-amd.ts --- >>> return 42; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ 1->() > { > -2 > return -3 > -4 > 42 -5 > ; +2 > return +3 > 42 +4 > ; 1->Emitted(5, 9) Source(10, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(10, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(10, 16) + SourceIndex(0) -4 >Emitted(5, 18) Source(10, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) +2 >Emitted(5, 16) Source(10, 16) + SourceIndex(0) +3 >Emitted(5, 18) Source(10, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(10, 19) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/for.js b/tests/baselines/reference/for.js index a77b68d8b6e..65595a77b6c 100644 --- a/tests/baselines/reference/for.js +++ b/tests/baselines/reference/for.js @@ -31,26 +31,27 @@ for () { // error } //// [for.js] -for (var i = 0; i < 10; i++) { +for (var i = 0; i < 10; i++) { // ok var x1 = i; } -for (var j = 0; j < 10; j++) { +for (var j = 0; j < 10; j++) { // ok var x2 = j; } -for (var k = 0; k < 10;) { +for (var k = 0; k < 10;) { // ok k++; } -for (; i < 10;) { +for (; i < 10;) { // ok i++; } -for (; i > 1; i--) { +for (; i > 1; i--) { // ok } -for (var l = 0;; l++) { +for (var l = 0;; l++) { // ok if (l > 10) { break; } } -for (;;) { +for (;;) { // ok } -for (;;) { +for (;; // error +) { // error } diff --git a/tests/baselines/reference/forIn.js b/tests/baselines/reference/forIn.js index 28e395a9cf3..a921ba17fbf 100644 --- a/tests/baselines/reference/forIn.js +++ b/tests/baselines/reference/forIn.js @@ -23,16 +23,16 @@ for (var l in arr) { //// [forIn.js] var arr = null; -for (var i in arr) { +for (var i in arr) { // error var x1 = arr[i]; var y1 = arr[i]; } -for (var j in arr) { +for (var j in arr) { // ok var x2 = arr[j]; var y2 = arr[j]; } var arr2 = []; -for (j in arr2) { +for (j in arr2) { // ok var x3 = arr2[j]; var y3 = arr2[j]; } diff --git a/tests/baselines/reference/forStatementInnerComments.js b/tests/baselines/reference/forStatementInnerComments.js new file mode 100644 index 00000000000..b21385a7406 --- /dev/null +++ b/tests/baselines/reference/forStatementInnerComments.js @@ -0,0 +1,15 @@ +//// [forStatementInnerComments.ts] +declare var a; +/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ {} +/*0*/ for /*1*/ ( /*2*/ var /*3*/ y /*4*/ of /*5*/ a /*6*/) /*7*/ {} +/*0*/ for /*1*/ ( /*2*/ x /*3*/ in /*4*/ a /*5*/) /*6*/ {} +/*0*/ for /*1*/ ( /*2*/ y /*3*/ of /*4*/ a /*5*/) /*6*/ {} +/*0*/ for /*1*/ ( /*2*/ a /*3*/ ; /*4*/ a /*5*/ ; /*6*/ a /*7*/) /*8*/ {} + + +//// [forStatementInnerComments.js] +/*0*/ for /*1*/ ( /*2*/var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ { } +/*0*/ for /*1*/ ( /*2*/var /*3*/ y /*4*/ of /*5*/ a /*6*/) /*7*/ { } +/*0*/ for /*1*/ ( /*2*/x /*3*/ in /*4*/ a /*5*/) /*6*/ { } +/*0*/ for /*1*/ ( /*2*/y /*3*/ of /*4*/ a /*5*/) /*6*/ { } +/*0*/ for /*1*/ ( /*2*/a /*3*/; /*4*/ a /*5*/; /*6*/ a /*7*/) /*8*/ { } diff --git a/tests/baselines/reference/forStatementInnerComments.symbols b/tests/baselines/reference/forStatementInnerComments.symbols new file mode 100644 index 00000000000..71f0004f962 --- /dev/null +++ b/tests/baselines/reference/forStatementInnerComments.symbols @@ -0,0 +1,25 @@ +=== tests/cases/compiler/forStatementInnerComments.ts === +declare var a; +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) + +/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ {} +>x : Symbol(x, Decl(forStatementInnerComments.ts, 1, 27)) +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) + +/*0*/ for /*1*/ ( /*2*/ var /*3*/ y /*4*/ of /*5*/ a /*6*/) /*7*/ {} +>y : Symbol(y, Decl(forStatementInnerComments.ts, 2, 27)) +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) + +/*0*/ for /*1*/ ( /*2*/ x /*3*/ in /*4*/ a /*5*/) /*6*/ {} +>x : Symbol(x, Decl(forStatementInnerComments.ts, 1, 27)) +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) + +/*0*/ for /*1*/ ( /*2*/ y /*3*/ of /*4*/ a /*5*/) /*6*/ {} +>y : Symbol(y, Decl(forStatementInnerComments.ts, 2, 27)) +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) + +/*0*/ for /*1*/ ( /*2*/ a /*3*/ ; /*4*/ a /*5*/ ; /*6*/ a /*7*/) /*8*/ {} +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) +>a : Symbol(a, Decl(forStatementInnerComments.ts, 0, 11)) + diff --git a/tests/baselines/reference/forStatementInnerComments.types b/tests/baselines/reference/forStatementInnerComments.types new file mode 100644 index 00000000000..875b8d0f89d --- /dev/null +++ b/tests/baselines/reference/forStatementInnerComments.types @@ -0,0 +1,25 @@ +=== tests/cases/compiler/forStatementInnerComments.ts === +declare var a; +>a : any + +/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ {} +>x : string +>a : any + +/*0*/ for /*1*/ ( /*2*/ var /*3*/ y /*4*/ of /*5*/ a /*6*/) /*7*/ {} +>y : any +>a : any + +/*0*/ for /*1*/ ( /*2*/ x /*3*/ in /*4*/ a /*5*/) /*6*/ {} +>x : string +>a : any + +/*0*/ for /*1*/ ( /*2*/ y /*3*/ of /*4*/ a /*5*/) /*6*/ {} +>y : any +>a : any + +/*0*/ for /*1*/ ( /*2*/ a /*3*/ ; /*4*/ a /*5*/ ; /*6*/ a /*7*/) /*8*/ {} +>a : any +>a : any +>a : any + diff --git a/tests/baselines/reference/getEmitOutputSourceMap2.baseline b/tests/baselines/reference/getEmitOutputSourceMap2.baseline index 35fdb2b8329..ccd11b1fec0 100644 --- a/tests/baselines/reference/getEmitOutputSourceMap2.baseline +++ b/tests/baselines/reference/getEmitOutputSourceMap2.baseline @@ -11,7 +11,7 @@ var M = /** @class */ (function () { //# sourceMappingURL=inputFile1.js.map EmitSkipped: false FileName : sample/outDir/inputFile2.js.map -{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,aAAa,CAAC;AAC1B,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;IACvB,IAAI,CAAC,GAAG,EAAE,CAAC;AACd,CAAC"}FileName : sample/outDir/inputFile2.js +{"version":3,"file":"inputFile2.js","sourceRoot":"","sources":["../../tests/cases/fourslash/inputFile2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,aAAa,CAAC;AAC1B,IAAI,KAAK,KAAK,SAAS,EAAE;IACtB,IAAI,CAAC,GAAG,EAAE,CAAC;CACb"}FileName : sample/outDir/inputFile2.js var intro = "hello world"; if (intro !== undefined) { var k = 10; diff --git a/tests/baselines/reference/ifStatementInternalComments.js b/tests/baselines/reference/ifStatementInternalComments.js new file mode 100644 index 00000000000..f7b3ee2bc90 --- /dev/null +++ b/tests/baselines/reference/ifStatementInternalComments.js @@ -0,0 +1,10 @@ +//// [ifStatementInternalComments.ts] +/*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} + +/*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} /*6*/ else /*7*/ {} + + +//// [ifStatementInternalComments.js] +/*1*/ if /*2*/ ( /*3*/true /*4*/) /*5*/ { } +/*1*/ if /*2*/ ( /*3*/true /*4*/) /*5*/ { } /*6*/ +else /*7*/ { } diff --git a/tests/baselines/reference/ifStatementInternalComments.symbols b/tests/baselines/reference/ifStatementInternalComments.symbols new file mode 100644 index 00000000000..a7d0c5feef9 --- /dev/null +++ b/tests/baselines/reference/ifStatementInternalComments.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/ifStatementInternalComments.ts === +/*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} +No type information for this code. +No type information for this code./*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} /*6*/ else /*7*/ {} +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/ifStatementInternalComments.types b/tests/baselines/reference/ifStatementInternalComments.types new file mode 100644 index 00000000000..8c8e82b5017 --- /dev/null +++ b/tests/baselines/reference/ifStatementInternalComments.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/ifStatementInternalComments.ts === +/*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} +>true : true + +/*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} /*6*/ else /*7*/ {} +>true : true + diff --git a/tests/baselines/reference/importExportInternalComments.js b/tests/baselines/reference/importExportInternalComments.js new file mode 100644 index 00000000000..c48d7a5ecf9 --- /dev/null +++ b/tests/baselines/reference/importExportInternalComments.js @@ -0,0 +1,25 @@ +//// [tests/cases/compiler/importExportInternalComments.ts] //// + +//// [include.d.ts] +declare module "foo"; + +//// [default.ts] +/*1*/ export /*2*/ default /*3*/ Array /*4*/; + +//// [index.ts] +/*1*/ import /*2*/ D /*3*/, /*4*/ { /*5*/ A /*6*/, /*7*/ B /*8*/ as /*9*/ C /*10*/ } /*11*/ from /*12*/ "foo"; +/*1*/ import /*2*/ * /*3*/ as /*4*/ foo /*5*/ from /*6*/ "foo"; + +void D, A, C, foo; // Use the variables to prevent ellision + +/*1*/ export /*2*/ { /*3*/ A /*4*/, /*5*/ B /*6*/ as /*7*/ C /*8*/ } /*9*/ from /*10*/ "foo"; +/*1*/ export /*2*/ * /*3*/ from /*4*/ "foo" + +//// [default.js] +/*1*/ export /*2*/ default /*3*/ Array /*4*/; +//// [index.js] +/*1*/ import /*2*/ D /*3*/, /*4*/ { /*5*/ A /*6*/, /*7*/ B /*8*/ as /*9*/ C /*10*/ } /*11*/ from /*12*/ "foo"; +/*1*/ import /*2*/ * /*3*/ as /*4*/ foo /*5*/ from /*6*/ "foo"; +void D, A, C, foo; // Use the variables to prevent ellision +/*1*/ export /*2*/ { /*3*/ A /*4*/, /*5*/ B /*6*/ as /*7*/ C /*8*/ } /*9*/ from /*10*/ "foo"; +/*1*/ export /*2*/ * /*3*/ from /*4*/ "foo"; diff --git a/tests/baselines/reference/importExportInternalComments.symbols b/tests/baselines/reference/importExportInternalComments.symbols new file mode 100644 index 00000000000..64096881954 --- /dev/null +++ b/tests/baselines/reference/importExportInternalComments.symbols @@ -0,0 +1,30 @@ +=== tests/cases/compiler/include.d.ts === +declare module "foo"; +>"foo" : Symbol("foo", Decl(include.d.ts, 0, 0)) + +=== tests/cases/compiler/default.ts === +/*1*/ export /*2*/ default /*3*/ Array /*4*/; +>Array : Symbol(Array, Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) + +=== tests/cases/compiler/index.ts === +/*1*/ import /*2*/ D /*3*/, /*4*/ { /*5*/ A /*6*/, /*7*/ B /*8*/ as /*9*/ C /*10*/ } /*11*/ from /*12*/ "foo"; +>D : Symbol(D, Decl(index.ts, 0, 12)) +>A : Symbol(A, Decl(index.ts, 0, 35)) +>B : Symbol(C, Decl(index.ts, 0, 50)) +>C : Symbol(C, Decl(index.ts, 0, 50)) + +/*1*/ import /*2*/ * /*3*/ as /*4*/ foo /*5*/ from /*6*/ "foo"; +>foo : Symbol(foo, Decl(index.ts, 1, 12)) + +void D, A, C, foo; // Use the variables to prevent ellision +>D : Symbol(D, Decl(index.ts, 0, 12)) +>A : Symbol(A, Decl(index.ts, 0, 35)) +>C : Symbol(C, Decl(index.ts, 0, 50)) +>foo : Symbol(foo, Decl(index.ts, 1, 12)) + +/*1*/ export /*2*/ { /*3*/ A /*4*/, /*5*/ B /*6*/ as /*7*/ C /*8*/ } /*9*/ from /*10*/ "foo"; +>A : Symbol(A, Decl(index.ts, 5, 20)) +>B : Symbol(C, Decl(index.ts, 5, 35)) +>C : Symbol(C, Decl(index.ts, 5, 35)) + +/*1*/ export /*2*/ * /*3*/ from /*4*/ "foo" diff --git a/tests/baselines/reference/importExportInternalComments.types b/tests/baselines/reference/importExportInternalComments.types new file mode 100644 index 00000000000..602a89fe5d0 --- /dev/null +++ b/tests/baselines/reference/importExportInternalComments.types @@ -0,0 +1,34 @@ +=== tests/cases/compiler/include.d.ts === +declare module "foo"; +>"foo" : any + +=== tests/cases/compiler/default.ts === +/*1*/ export /*2*/ default /*3*/ Array /*4*/; +>Array : T[] + +=== tests/cases/compiler/index.ts === +/*1*/ import /*2*/ D /*3*/, /*4*/ { /*5*/ A /*6*/, /*7*/ B /*8*/ as /*9*/ C /*10*/ } /*11*/ from /*12*/ "foo"; +>D : any +>A : any +>B : any +>C : any + +/*1*/ import /*2*/ * /*3*/ as /*4*/ foo /*5*/ from /*6*/ "foo"; +>foo : any + +void D, A, C, foo; // Use the variables to prevent ellision +>void D, A, C, foo : any +>void D, A, C : any +>void D, A : any +>void D : undefined +>D : any +>A : any +>C : any +>foo : any + +/*1*/ export /*2*/ { /*3*/ A /*4*/, /*5*/ B /*6*/ as /*7*/ C /*8*/ } /*9*/ from /*10*/ "foo"; +>A : any +>B : any +>C : any + +/*1*/ export /*2*/ * /*3*/ from /*4*/ "foo" diff --git a/tests/baselines/reference/invalidTryStatements2.js b/tests/baselines/reference/invalidTryStatements2.js index 50aff00c515..c866626848b 100644 --- a/tests/baselines/reference/invalidTryStatements2.js +++ b/tests/baselines/reference/invalidTryStatements2.js @@ -27,7 +27,8 @@ function fn() { catch (x) { } // error missing try finally { } // potential error; can be absorbed by the 'catch' try { } - finally { } + finally { // error missing finally + } // error missing finally ; // error missing finally } function fn2() { diff --git a/tests/baselines/reference/jsdocTypeTagCast.js b/tests/baselines/reference/jsdocTypeTagCast.js index 65e46c97757..67501b3c383 100644 --- a/tests/baselines/reference/jsdocTypeTagCast.js +++ b/tests/baselines/reference/jsdocTypeTagCast.js @@ -90,13 +90,13 @@ var __extends = (this && this.__extends) || (function () { }; })(); // @ts-check -var W = ((4)); -var W = (4); // Error +var W = /** @type {string} */ ( /** @type {*} */(4)); +var W = /** @type {string} */ (4); // Error /** @type {*} */ var a; /** @type {string} */ var s; -var a = ("" + 4); +var a = /** @type {*} */ ("" + 4); var s = "" + /** @type {*} */ (4); var SomeBase = /** @class */ (function () { function SomeBase() { @@ -146,6 +146,6 @@ someBase = /** @type {SomeBase} */ (someFakeClass); var numOrStr; /** @type {string} */ var str; -if ((numOrStr === undefined)) { +if ( /** @type {numOrStr is string} */(numOrStr === undefined)) { // Error str = numOrStr; // Error, no narrowing occurred } diff --git a/tests/baselines/reference/jsdocTypecastNoTypeNoCrash.js b/tests/baselines/reference/jsdocTypecastNoTypeNoCrash.js index 06c7924440b..aaaa5d24ebb 100644 --- a/tests/baselines/reference/jsdocTypecastNoTypeNoCrash.js +++ b/tests/baselines/reference/jsdocTypecastNoTypeNoCrash.js @@ -5,4 +5,4 @@ const a = /* @type string */(Foo); //// [index.js] function Foo() { } -var a = (Foo); +var a = /* @type string */ (Foo); diff --git a/tests/baselines/reference/jsxFactoryIdentifier.js.map b/tests/baselines/reference/jsxFactoryIdentifier.js.map index ab23c9b10b3..155d6fa4f55 100644 --- a/tests/baselines/reference/jsxFactoryIdentifier.js.map +++ b/tests/baselines/reference/jsxFactoryIdentifier.js.map @@ -1,3 +1,3 @@ //// [Element.js.map] -{"version":3,"file":"Element.js","sourceRoot":"","sources":["Element.ts"],"names":[],"mappings":";;AAYA,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACpB,mBAA0B,EAAO;QAC7B,MAAM,CAAC,EAAE,CAAC,wBAAwB,KAAK,SAAS,CAAC;IACrD,CAAC;IAFe,iBAAS,YAExB,CAAA;IAED,uBAA8B,IAAW;QAErC,MAAM,CAAC,EACN,CAAA;IACL,CAAC;IAJe,qBAAa,gBAI5B,CAAA;AACL,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEjD,qBAAqB,IAAY;IAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}//// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF;IACC,IAAI;QACH,MAAM,CAAC;YACN,wBAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,wBAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file +{"version":3,"file":"Element.js","sourceRoot":"","sources":["Element.ts"],"names":[],"mappings":";;AAYA,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACpB,mBAA0B,EAAO;QAC7B,OAAO,EAAE,CAAC,wBAAwB,KAAK,SAAS,CAAC;IACrD,CAAC;IAFe,iBAAS,YAExB,CAAA;IAED,uBAA8B,IAAW;QAErC,OAAO,EACN,CAAA;IACL,CAAC;IAJe,qBAAa,gBAI5B,CAAA;AACL,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEjD,qBAAqB,IAAY;IAC7B,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}//// [test.js.map] +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AACnC,IAAI,aAAa,GAAG,iBAAO,CAAC,aAAa,CAAC;AAC1C,IAAI,CAIH,CAAC;AAEF;IACC,IAAI;QACH,OAAO;YACN,wBAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,wBAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt b/tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt index c0359aa61d0..d73ddd30dd5 100644 --- a/tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt +++ b/tests/baselines/reference/jsxFactoryIdentifier.sourcemap.txt @@ -74,33 +74,30 @@ sourceFile:Element.ts --- >>> return el.markAsChildOfRootElement !== undefined; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^^^^ +7 > ^^^^^^^^^ +8 > ^ 1->): el is JSX.Element { > -2 > return -3 > -4 > el -5 > . -6 > markAsChildOfRootElement -7 > !== -8 > undefined -9 > ; +2 > return +3 > el +4 > . +5 > markAsChildOfRootElement +6 > !== +7 > undefined +8 > ; 1->Emitted(6, 9) Source(15, 9) + SourceIndex(0) -2 >Emitted(6, 15) Source(15, 15) + SourceIndex(0) -3 >Emitted(6, 16) Source(15, 16) + SourceIndex(0) -4 >Emitted(6, 18) Source(15, 18) + SourceIndex(0) -5 >Emitted(6, 19) Source(15, 19) + SourceIndex(0) -6 >Emitted(6, 43) Source(15, 43) + SourceIndex(0) -7 >Emitted(6, 48) Source(15, 48) + SourceIndex(0) -8 >Emitted(6, 57) Source(15, 57) + SourceIndex(0) -9 >Emitted(6, 58) Source(15, 58) + SourceIndex(0) +2 >Emitted(6, 16) Source(15, 16) + SourceIndex(0) +3 >Emitted(6, 18) Source(15, 18) + SourceIndex(0) +4 >Emitted(6, 19) Source(15, 19) + SourceIndex(0) +5 >Emitted(6, 43) Source(15, 43) + SourceIndex(0) +6 >Emitted(6, 48) Source(15, 48) + SourceIndex(0) +7 >Emitted(6, 57) Source(15, 57) + SourceIndex(0) +8 >Emitted(6, 58) Source(15, 58) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -144,23 +141,20 @@ sourceFile:Element.ts --- >>> return {}; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ 1 >) { > > -2 > return -3 > -4 > { +2 > return +3 > { > } -5 > +4 > 1 >Emitted(10, 9) Source(20, 9) + SourceIndex(0) -2 >Emitted(10, 15) Source(20, 15) + SourceIndex(0) -3 >Emitted(10, 16) Source(20, 16) + SourceIndex(0) -4 >Emitted(10, 18) Source(21, 10) + SourceIndex(0) -5 >Emitted(10, 19) Source(21, 10) + SourceIndex(0) +2 >Emitted(10, 16) Source(20, 16) + SourceIndex(0) +3 >Emitted(10, 18) Source(21, 10) + SourceIndex(0) +4 >Emitted(10, 19) Source(21, 10) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -275,60 +269,57 @@ sourceFile:Element.ts --- >>> return text[0].toLowerCase() + text.substring(1); 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^^^^^^^^ -10> ^^ -11> ^^^ -12> ^^^^ -13> ^ -14> ^^^^^^^^^ -15> ^ -16> ^ -17> ^ -18> ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^ +14> ^ +15> ^ +16> ^ +17> ^ 1->): string { > -2 > return -3 > -4 > text -5 > [ -6 > 0 -7 > ] -8 > . -9 > toLowerCase -10> () -11> + -12> text -13> . -14> substring -15> ( -16> 1 -17> ) -18> ; +2 > return +3 > text +4 > [ +5 > 0 +6 > ] +7 > . +8 > toLowerCase +9 > () +10> + +11> text +12> . +13> substring +14> ( +15> 1 +16> ) +17> ; 1->Emitted(16, 5) Source(28, 5) + SourceIndex(0) -2 >Emitted(16, 11) Source(28, 11) + SourceIndex(0) -3 >Emitted(16, 12) Source(28, 12) + SourceIndex(0) -4 >Emitted(16, 16) Source(28, 16) + SourceIndex(0) -5 >Emitted(16, 17) Source(28, 17) + SourceIndex(0) -6 >Emitted(16, 18) Source(28, 18) + SourceIndex(0) -7 >Emitted(16, 19) Source(28, 19) + SourceIndex(0) -8 >Emitted(16, 20) Source(28, 20) + SourceIndex(0) -9 >Emitted(16, 31) Source(28, 31) + SourceIndex(0) -10>Emitted(16, 33) Source(28, 33) + SourceIndex(0) -11>Emitted(16, 36) Source(28, 36) + SourceIndex(0) -12>Emitted(16, 40) Source(28, 40) + SourceIndex(0) -13>Emitted(16, 41) Source(28, 41) + SourceIndex(0) -14>Emitted(16, 50) Source(28, 50) + SourceIndex(0) -15>Emitted(16, 51) Source(28, 51) + SourceIndex(0) -16>Emitted(16, 52) Source(28, 52) + SourceIndex(0) -17>Emitted(16, 53) Source(28, 53) + SourceIndex(0) -18>Emitted(16, 54) Source(28, 54) + SourceIndex(0) +2 >Emitted(16, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(16, 16) Source(28, 16) + SourceIndex(0) +4 >Emitted(16, 17) Source(28, 17) + SourceIndex(0) +5 >Emitted(16, 18) Source(28, 18) + SourceIndex(0) +6 >Emitted(16, 19) Source(28, 19) + SourceIndex(0) +7 >Emitted(16, 20) Source(28, 20) + SourceIndex(0) +8 >Emitted(16, 31) Source(28, 31) + SourceIndex(0) +9 >Emitted(16, 33) Source(28, 33) + SourceIndex(0) +10>Emitted(16, 36) Source(28, 36) + SourceIndex(0) +11>Emitted(16, 40) Source(28, 40) + SourceIndex(0) +12>Emitted(16, 41) Source(28, 41) + SourceIndex(0) +13>Emitted(16, 50) Source(28, 50) + SourceIndex(0) +14>Emitted(16, 51) Source(28, 51) + SourceIndex(0) +15>Emitted(16, 52) Source(28, 52) + SourceIndex(0) +16>Emitted(16, 53) Source(28, 53) + SourceIndex(0) +17>Emitted(16, 54) Source(28, 54) + SourceIndex(0) --- >>>} 1 > @@ -428,16 +419,13 @@ sourceFile:test.tsx --- >>> return [ 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->() { > -2 > return -3 > +2 > return 1->Emitted(8, 9) Source(11, 3) + SourceIndex(0) -2 >Emitted(8, 15) Source(11, 9) + SourceIndex(0) -3 >Emitted(8, 16) Source(11, 10) + SourceIndex(0) +2 >Emitted(8, 16) Source(11, 10) + SourceIndex(0) --- >>> createElement("meta", { content: "helloworld" }), 1->^^^^^^^^^^^^ diff --git a/tests/baselines/reference/jsxFactoryIdentifierAsParameter.js.map b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.js.map index c0e44a28e3f..fde817c3269 100644 --- a/tests/baselines/reference/jsxFactoryIdentifierAsParameter.js.map +++ b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.js.map @@ -1,2 +1,2 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAMA;IACI,MAAM,CAAC,aAAa;QAChB,MAAM,CAAC,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAMA;IACI,MAAM,CAAC,aAAa;QAChB,OAAO,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryIdentifierAsParameter.sourcemap.txt b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.sourcemap.txt index b8836a65a1c..31db7ff6aab 100644 --- a/tests/baselines/reference/jsxFactoryIdentifierAsParameter.sourcemap.txt +++ b/tests/baselines/reference/jsxFactoryIdentifierAsParameter.sourcemap.txt @@ -40,21 +40,18 @@ sourceFile:test.tsx --- >>> return createElement("div", null); 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^ 1->) { > -2 > return -3 > -4 >
-5 > ; +2 > return +3 >
+4 > ; 1->Emitted(5, 9) Source(9, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(9, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) -4 >Emitted(5, 42) Source(9, 23) + SourceIndex(0) -5 >Emitted(5, 43) Source(9, 24) + SourceIndex(0) +2 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) +3 >Emitted(5, 42) Source(9, 23) + SourceIndex(0) +4 >Emitted(5, 43) Source(9, 24) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.js.map b/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.js.map index 28e14ed6be5..0ac9c86dfee 100644 --- a/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.js.map +++ b/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.js.map @@ -1,2 +1,2 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAMA;IACI,MAAM;QACF,MAAM,CAAC,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAMA;IACI,MAAM;QACF,OAAO,0BAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt b/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt index 378b69deb69..d2d19971bbf 100644 --- a/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt +++ b/tests/baselines/reference/jsxFactoryIdentifierWithAbsentParameter.sourcemap.txt @@ -34,21 +34,18 @@ sourceFile:test.tsx --- >>> return createElement("div", null); 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^ 1->() { > -2 > return -3 > -4 >
-5 > ; +2 > return +3 >
+4 > ; 1->Emitted(5, 9) Source(9, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(9, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) -4 >Emitted(5, 42) Source(9, 23) + SourceIndex(0) -5 >Emitted(5, 43) Source(9, 24) + SourceIndex(0) +2 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) +3 >Emitted(5, 42) Source(9, 23) + SourceIndex(0) +4 >Emitted(5, 43) Source(9, 24) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/jsxFactoryQualifiedName.js.map b/tests/baselines/reference/jsxFactoryQualifiedName.js.map index c4ac2d8e7e4..9c739fb7f67 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedName.js.map +++ b/tests/baselines/reference/jsxFactoryQualifiedName.js.map @@ -1,3 +1,3 @@ //// [Element.js.map] -{"version":3,"file":"Element.js","sourceRoot":"","sources":["Element.ts"],"names":[],"mappings":";;AAYA,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACpB,mBAA0B,EAAO;QAC7B,MAAM,CAAC,EAAE,CAAC,wBAAwB,KAAK,SAAS,CAAC;IACrD,CAAC;IAFe,iBAAS,YAExB,CAAA;IAED,uBAA8B,IAAW;QAErC,MAAM,CAAC,EACN,CAAA;IACL,CAAC;IAJe,qBAAa,gBAI5B,CAAA;AACL,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEjD,qBAAqB,IAAY;IAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}//// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF;IACC,IAAI;QACH,MAAM,CAAC;YACN,0CAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,0CAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file +{"version":3,"file":"Element.js","sourceRoot":"","sources":["Element.ts"],"names":[],"mappings":";;AAYA,IAAiB,OAAO,CAUvB;AAVD,WAAiB,OAAO;IACpB,mBAA0B,EAAO;QAC7B,OAAO,EAAE,CAAC,wBAAwB,KAAK,SAAS,CAAC;IACrD,CAAC;IAFe,iBAAS,YAExB,CAAA;IAED,uBAA8B,IAAW;QAErC,OAAO,EACN,CAAA;IACL,CAAC;IAJe,qBAAa,gBAI5B,CAAA;AACL,CAAC,EAVgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAUvB;AAEU,QAAA,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAEjD,qBAAqB,IAAY;IAC7B,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}//// [test.js.map] +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAAA,uCAAmC;AAEnC,IAAI,CAIH,CAAC;AAEF;IACC,IAAI;QACH,OAAO;YACN,0CAAM,OAAO,EAAC,YAAY,GAAQ;YAClC,0CAAM,OAAO,EAAE,CAAC,CAAC,CAAE,CAAC,CAAC,GAAS;SAC9B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryQualifiedName.sourcemap.txt b/tests/baselines/reference/jsxFactoryQualifiedName.sourcemap.txt index 46a5945cc15..51e916697c2 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedName.sourcemap.txt +++ b/tests/baselines/reference/jsxFactoryQualifiedName.sourcemap.txt @@ -74,33 +74,30 @@ sourceFile:Element.ts --- >>> return el.markAsChildOfRootElement !== undefined; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^^^^ +7 > ^^^^^^^^^ +8 > ^ 1->): el is JSX.Element { > -2 > return -3 > -4 > el -5 > . -6 > markAsChildOfRootElement -7 > !== -8 > undefined -9 > ; +2 > return +3 > el +4 > . +5 > markAsChildOfRootElement +6 > !== +7 > undefined +8 > ; 1->Emitted(6, 9) Source(15, 9) + SourceIndex(0) -2 >Emitted(6, 15) Source(15, 15) + SourceIndex(0) -3 >Emitted(6, 16) Source(15, 16) + SourceIndex(0) -4 >Emitted(6, 18) Source(15, 18) + SourceIndex(0) -5 >Emitted(6, 19) Source(15, 19) + SourceIndex(0) -6 >Emitted(6, 43) Source(15, 43) + SourceIndex(0) -7 >Emitted(6, 48) Source(15, 48) + SourceIndex(0) -8 >Emitted(6, 57) Source(15, 57) + SourceIndex(0) -9 >Emitted(6, 58) Source(15, 58) + SourceIndex(0) +2 >Emitted(6, 16) Source(15, 16) + SourceIndex(0) +3 >Emitted(6, 18) Source(15, 18) + SourceIndex(0) +4 >Emitted(6, 19) Source(15, 19) + SourceIndex(0) +5 >Emitted(6, 43) Source(15, 43) + SourceIndex(0) +6 >Emitted(6, 48) Source(15, 48) + SourceIndex(0) +7 >Emitted(6, 57) Source(15, 57) + SourceIndex(0) +8 >Emitted(6, 58) Source(15, 58) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -144,23 +141,20 @@ sourceFile:Element.ts --- >>> return {}; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ 1 >) { > > -2 > return -3 > -4 > { +2 > return +3 > { > } -5 > +4 > 1 >Emitted(10, 9) Source(20, 9) + SourceIndex(0) -2 >Emitted(10, 15) Source(20, 15) + SourceIndex(0) -3 >Emitted(10, 16) Source(20, 16) + SourceIndex(0) -4 >Emitted(10, 18) Source(21, 10) + SourceIndex(0) -5 >Emitted(10, 19) Source(21, 10) + SourceIndex(0) +2 >Emitted(10, 16) Source(20, 16) + SourceIndex(0) +3 >Emitted(10, 18) Source(21, 10) + SourceIndex(0) +4 >Emitted(10, 19) Source(21, 10) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -275,60 +269,57 @@ sourceFile:Element.ts --- >>> return text[0].toLowerCase() + text.substring(1); 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^^^^^^^^ -10> ^^ -11> ^^^ -12> ^^^^ -13> ^ -14> ^^^^^^^^^ -15> ^ -16> ^ -17> ^ -18> ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^ +7 > ^ +8 > ^^^^^^^^^^^ +9 > ^^ +10> ^^^ +11> ^^^^ +12> ^ +13> ^^^^^^^^^ +14> ^ +15> ^ +16> ^ +17> ^ 1->): string { > -2 > return -3 > -4 > text -5 > [ -6 > 0 -7 > ] -8 > . -9 > toLowerCase -10> () -11> + -12> text -13> . -14> substring -15> ( -16> 1 -17> ) -18> ; +2 > return +3 > text +4 > [ +5 > 0 +6 > ] +7 > . +8 > toLowerCase +9 > () +10> + +11> text +12> . +13> substring +14> ( +15> 1 +16> ) +17> ; 1->Emitted(16, 5) Source(28, 5) + SourceIndex(0) -2 >Emitted(16, 11) Source(28, 11) + SourceIndex(0) -3 >Emitted(16, 12) Source(28, 12) + SourceIndex(0) -4 >Emitted(16, 16) Source(28, 16) + SourceIndex(0) -5 >Emitted(16, 17) Source(28, 17) + SourceIndex(0) -6 >Emitted(16, 18) Source(28, 18) + SourceIndex(0) -7 >Emitted(16, 19) Source(28, 19) + SourceIndex(0) -8 >Emitted(16, 20) Source(28, 20) + SourceIndex(0) -9 >Emitted(16, 31) Source(28, 31) + SourceIndex(0) -10>Emitted(16, 33) Source(28, 33) + SourceIndex(0) -11>Emitted(16, 36) Source(28, 36) + SourceIndex(0) -12>Emitted(16, 40) Source(28, 40) + SourceIndex(0) -13>Emitted(16, 41) Source(28, 41) + SourceIndex(0) -14>Emitted(16, 50) Source(28, 50) + SourceIndex(0) -15>Emitted(16, 51) Source(28, 51) + SourceIndex(0) -16>Emitted(16, 52) Source(28, 52) + SourceIndex(0) -17>Emitted(16, 53) Source(28, 53) + SourceIndex(0) -18>Emitted(16, 54) Source(28, 54) + SourceIndex(0) +2 >Emitted(16, 12) Source(28, 12) + SourceIndex(0) +3 >Emitted(16, 16) Source(28, 16) + SourceIndex(0) +4 >Emitted(16, 17) Source(28, 17) + SourceIndex(0) +5 >Emitted(16, 18) Source(28, 18) + SourceIndex(0) +6 >Emitted(16, 19) Source(28, 19) + SourceIndex(0) +7 >Emitted(16, 20) Source(28, 20) + SourceIndex(0) +8 >Emitted(16, 31) Source(28, 31) + SourceIndex(0) +9 >Emitted(16, 33) Source(28, 33) + SourceIndex(0) +10>Emitted(16, 36) Source(28, 36) + SourceIndex(0) +11>Emitted(16, 40) Source(28, 40) + SourceIndex(0) +12>Emitted(16, 41) Source(28, 41) + SourceIndex(0) +13>Emitted(16, 50) Source(28, 50) + SourceIndex(0) +14>Emitted(16, 51) Source(28, 51) + SourceIndex(0) +15>Emitted(16, 52) Source(28, 52) + SourceIndex(0) +16>Emitted(16, 53) Source(28, 53) + SourceIndex(0) +17>Emitted(16, 54) Source(28, 54) + SourceIndex(0) --- >>>} 1 > @@ -401,16 +392,13 @@ sourceFile:test.tsx --- >>> return [ 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->() { > -2 > return -3 > +2 > return 1->Emitted(7, 9) Source(11, 3) + SourceIndex(0) -2 >Emitted(7, 15) Source(11, 9) + SourceIndex(0) -3 >Emitted(7, 16) Source(11, 10) + SourceIndex(0) +2 >Emitted(7, 16) Source(11, 10) + SourceIndex(0) --- >>> Element_1.Element.createElement("meta", { content: "helloworld" }), 1->^^^^^^^^^^^^ diff --git a/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.js.map b/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.js.map index 5927e451e8c..cc58b1eca48 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.js.map +++ b/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.js.map @@ -1,2 +1,2 @@ //// [test.js.map] -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAMA;IACI,MAAM,CAAC,aAAa;QAChB,MAAM,CAAC,oCAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.tsx"],"names":[],"mappings":";;AAMA;IACI,MAAM,CAAC,aAAa;QAChB,OAAO,oCAAO,CAAC;IACnB,CAAC;CACJ;AAJD,oCAIC"} \ No newline at end of file diff --git a/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.sourcemap.txt b/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.sourcemap.txt index ee89acac087..3a4dbd4e9d8 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.sourcemap.txt +++ b/tests/baselines/reference/jsxFactoryQualifiedNameResolutionError.sourcemap.txt @@ -40,21 +40,18 @@ sourceFile:test.tsx --- >>> return MyElement.createElement("div", null); 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^ 1->) { > -2 > return -3 > -4 >
-5 > ; +2 > return +3 >
+4 > ; 1->Emitted(5, 9) Source(9, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(9, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) -4 >Emitted(5, 52) Source(9, 23) + SourceIndex(0) -5 >Emitted(5, 53) Source(9, 24) + SourceIndex(0) +2 >Emitted(5, 16) Source(9, 16) + SourceIndex(0) +3 >Emitted(5, 52) Source(9, 23) + SourceIndex(0) +4 >Emitted(5, 53) Source(9, 24) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/keywordExpressionInternalComments.js b/tests/baselines/reference/keywordExpressionInternalComments.js new file mode 100644 index 00000000000..25b3766ab1b --- /dev/null +++ b/tests/baselines/reference/keywordExpressionInternalComments.js @@ -0,0 +1,12 @@ +//// [keywordExpressionInternalComments.ts] +/*1*/ new /*2*/ Array /*3*/; +/*1*/ typeof /*2*/ Array /*3*/; +/*1*/ void /*2*/ Array /*3*/; +/*1*/ delete /*2*/ Array.toString /*3*/; + + +//// [keywordExpressionInternalComments.js] +/*1*/ new /*2*/ Array /*3*/; +/*1*/ typeof /*2*/ Array /*3*/; +/*1*/ void /*2*/ Array /*3*/; +/*1*/ delete /*2*/ Array.toString /*3*/; diff --git a/tests/baselines/reference/keywordExpressionInternalComments.symbols b/tests/baselines/reference/keywordExpressionInternalComments.symbols new file mode 100644 index 00000000000..95552462f6f --- /dev/null +++ b/tests/baselines/reference/keywordExpressionInternalComments.symbols @@ -0,0 +1,15 @@ +=== tests/cases/compiler/keywordExpressionInternalComments.ts === +/*1*/ new /*2*/ Array /*3*/; +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +/*1*/ typeof /*2*/ Array /*3*/; +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +/*1*/ void /*2*/ Array /*3*/; +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +/*1*/ delete /*2*/ Array.toString /*3*/; +>Array.toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/keywordExpressionInternalComments.types b/tests/baselines/reference/keywordExpressionInternalComments.types new file mode 100644 index 00000000000..b987c1132fe --- /dev/null +++ b/tests/baselines/reference/keywordExpressionInternalComments.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/keywordExpressionInternalComments.ts === +/*1*/ new /*2*/ Array /*3*/; +>new /*2*/ Array : any[] +>Array : ArrayConstructor + +/*1*/ typeof /*2*/ Array /*3*/; +>typeof /*2*/ Array : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" +>Array : ArrayConstructor + +/*1*/ void /*2*/ Array /*3*/; +>void /*2*/ Array : undefined +>Array : ArrayConstructor + +/*1*/ delete /*2*/ Array.toString /*3*/; +>delete /*2*/ Array.toString : boolean +>Array.toString : () => string +>Array : ArrayConstructor +>toString : () => string + diff --git a/tests/baselines/reference/narrowExceptionVariableInCatchClause.js b/tests/baselines/reference/narrowExceptionVariableInCatchClause.js index b7dbf717e34..3158b0646a2 100644 --- a/tests/baselines/reference/narrowExceptionVariableInCatchClause.js +++ b/tests/baselines/reference/narrowExceptionVariableInCatchClause.js @@ -29,7 +29,7 @@ function tryCatch() { try { // do stuff... } - catch (err) { + catch (err) { // err is implicitly 'any' and cannot be annotated if (isFooError(err)) { err.dontPanic(); // OK err.doPanic(); // ERROR: Property 'doPanic' does not exist on type '{...}' diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.js b/tests/baselines/reference/narrowFromAnyWithInstanceof.js index 4cf1ca174aa..6a2cf937371 100644 --- a/tests/baselines/reference/narrowFromAnyWithInstanceof.js +++ b/tests/baselines/reference/narrowFromAnyWithInstanceof.js @@ -25,17 +25,17 @@ if (x instanceof Date) { //// [narrowFromAnyWithInstanceof.js] -if (x instanceof Function) { +if (x instanceof Function) { // 'any' is not narrowed when target type is 'Function' x(); x(1, 2, 3); x("hello!"); x.prop; } -if (x instanceof Object) { +if (x instanceof Object) { // 'any' is not narrowed when target type is 'Object' x.method(); x(); } -if (x instanceof Error) { +if (x instanceof Error) { // 'any' is narrowed to types other than 'Function'/'Object' x.message; x.mesage; } diff --git a/tests/baselines/reference/narrowFromAnyWithTypePredicate.js b/tests/baselines/reference/narrowFromAnyWithTypePredicate.js index 958a3cfd70d..b4f1bd46bc8 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.js +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.js @@ -36,17 +36,17 @@ if (isDate(x)) { //// [narrowFromAnyWithTypePredicate.js] -if (isFunction(x)) { +if (isFunction(x)) { // 'any' is not narrowed when target type is 'Function' x(); x(1, 2, 3); x("hello!"); x.prop; } -if (isObject(x)) { +if (isObject(x)) { // 'any' is not narrowed when target type is 'Object' x.method(); x(); } -if (isAnything(x)) { +if (isAnything(x)) { // 'any' is narrowed to types other than 'Function'/'Object' (including {}) x.method(); x(); } diff --git a/tests/baselines/reference/noCatchBlock.js.map b/tests/baselines/reference/noCatchBlock.js.map index 9e3da66cb31..2dc7b8fbef7 100644 --- a/tests/baselines/reference/noCatchBlock.js.map +++ b/tests/baselines/reference/noCatchBlock.js.map @@ -1,2 +1,2 @@ //// [noCatchBlock.js.map] -{"version":3,"file":"noCatchBlock.js","sourceRoot":"","sources":["noCatchBlock.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC;IACJ,MAAM;AACP,CAAC;QAAS,CAAC;IACV,wBAAwB;AACzB,CAAC"} \ No newline at end of file +{"version":3,"file":"noCatchBlock.js","sourceRoot":"","sources":["noCatchBlock.ts"],"names":[],"mappings":"AAAA,IAAI;IACH,MAAM;CACN;QAAS;IACT,wBAAwB;CACxB"} \ No newline at end of file diff --git a/tests/baselines/reference/noCatchBlock.sourcemap.txt b/tests/baselines/reference/noCatchBlock.sourcemap.txt index 455d0538d65..e2fc62d07a2 100644 --- a/tests/baselines/reference/noCatchBlock.sourcemap.txt +++ b/tests/baselines/reference/noCatchBlock.sourcemap.txt @@ -11,60 +11,48 @@ sourceFile:noCatchBlock.ts >>>try { 1 > 2 >^^^^ -3 > ^ -4 > ^^^^^^-> +3 > ^^^^^^^-> 1 > 2 >try -3 > { 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) --- >>> // ... 1->^^^^ 2 > ^^^^^^ -1-> +1->{ > 2 > // ... 1->Emitted(2, 5) Source(2, 2) + SourceIndex(0) 2 >Emitted(2, 11) Source(2, 8) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) + >} +1 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) --- >>>finally { 1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^-> 1-> finally -2 > { 1->Emitted(4, 9) Source(3, 11) + SourceIndex(0) -2 >Emitted(4, 10) Source(3, 12) + SourceIndex(0) --- >>> // N.B. No 'catch' block 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^ -1-> +1->{ > 2 > // N.B. No 'catch' block 1->Emitted(5, 5) Source(4, 2) + SourceIndex(0) 2 >Emitted(5, 29) Source(4, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) + >} +1 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=noCatchBlock.js.map \ No newline at end of file diff --git a/tests/baselines/reference/organizeImports/CoalesceTrivia.ts b/tests/baselines/reference/organizeImports/CoalesceTrivia.ts index 536ee4bdd67..c5bd76cadec 100644 --- a/tests/baselines/reference/organizeImports/CoalesceTrivia.ts +++ b/tests/baselines/reference/organizeImports/CoalesceTrivia.ts @@ -8,7 +8,7 @@ F2(); // ==ORGANIZED== -/*A*/ import { /*L*/ F1 /*M*/, /*C*/ F2 /*D*/ } /*E*/ from "lib" /*G*/; /*H*/ //I +/*A*/ import /*B*/ { /*L*/ F1 /*M*/, /*C*/ F2 /*D*/ } /*E*/ from /*F*/ "lib" /*G*/; /*H*/ //I F1(); F2(); diff --git a/tests/baselines/reference/organizeImports/SortTrivia.ts b/tests/baselines/reference/organizeImports/SortTrivia.ts index bbed82c8383..cd3a0f0bc4b 100644 --- a/tests/baselines/reference/organizeImports/SortTrivia.ts +++ b/tests/baselines/reference/organizeImports/SortTrivia.ts @@ -5,5 +5,5 @@ // ==ORGANIZED== -/*F*/ import "lib1" /*H*/; /*I*/ //J -/*A*/ import "lib2" /*C*/; /*D*/ //E +/*F*/ import /*G*/ "lib1" /*H*/; /*I*/ //J +/*A*/ import /*B*/ "lib2" /*C*/; /*D*/ //E diff --git a/tests/baselines/reference/organizeImports/UnusedTrivia2.ts b/tests/baselines/reference/organizeImports/UnusedTrivia2.ts index 5575f95fbf4..b36fd9733be 100644 --- a/tests/baselines/reference/organizeImports/UnusedTrivia2.ts +++ b/tests/baselines/reference/organizeImports/UnusedTrivia2.ts @@ -6,6 +6,6 @@ F1(); // ==ORGANIZED== -/*A*/ import { /*C*/ F1 /*D*/ } /*G*/ from "lib" /*I*/; /*J*/ //K +/*A*/ import /*B*/ { /*C*/ F1 /*D*/ } /*G*/ from /*H*/ "lib" /*I*/; /*J*/ //K F1(); diff --git a/tests/baselines/reference/out-flag.js.map b/tests/baselines/reference/out-flag.js.map index 5d3af0ec652..70f0667a65a 100644 --- a/tests/baselines/reference/out-flag.js.map +++ b/tests/baselines/reference/out-flag.js.map @@ -1,2 +1,2 @@ //// [out-flag.js.map] -{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":[],"mappings":"AAAA,eAAe;AAEf,oBAAoB;AACpB;IAAA;IAYA,CAAC;IAVG,uBAAuB;IAChB,uBAAK,GAAZ;QAEI,MAAM,CAAC,EAAE,CAAC;IACd,CAAC;IAEM,0BAAQ,GAAf,UAAgB,KAAa;QAEzB,EAAE;IACN,CAAC;IACL,cAAC;AAAD,CAAC,AAZD,IAYC"} \ No newline at end of file +{"version":3,"file":"out-flag.js","sourceRoot":"","sources":["out-flag.ts"],"names":[],"mappings":"AAAA,eAAe;AAEf,oBAAoB;AACpB;IAAA;IAYA,CAAC;IAVG,uBAAuB;IAChB,uBAAK,GAAZ;QAEI,OAAO,EAAE,CAAC;IACd,CAAC;IAEM,0BAAQ,GAAf,UAAgB,KAAa;QAEzB,EAAE;IACN,CAAC;IACL,cAAC;AAAD,CAAC,AAZD,IAYC"} \ No newline at end of file diff --git a/tests/baselines/reference/out-flag.sourcemap.txt b/tests/baselines/reference/out-flag.sourcemap.txt index 509e6271437..e4ba684f351 100644 --- a/tests/baselines/reference/out-flag.sourcemap.txt +++ b/tests/baselines/reference/out-flag.sourcemap.txt @@ -85,22 +85,19 @@ sourceFile:out-flag.ts --- >>> return 42; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ 1 >public Count(): number > { > -2 > return -3 > -4 > 42 -5 > ; +2 > return +3 > 42 +4 > ; 1 >Emitted(8, 9) Source(9, 9) + SourceIndex(0) -2 >Emitted(8, 15) Source(9, 15) + SourceIndex(0) -3 >Emitted(8, 16) Source(9, 16) + SourceIndex(0) -4 >Emitted(8, 18) Source(9, 18) + SourceIndex(0) -5 >Emitted(8, 19) Source(9, 19) + SourceIndex(0) +2 >Emitted(8, 16) Source(9, 16) + SourceIndex(0) +3 >Emitted(8, 18) Source(9, 18) + SourceIndex(0) +4 >Emitted(8, 19) Source(9, 19) + SourceIndex(0) --- >>> }; 1 >^^^^ diff --git a/tests/baselines/reference/parenthesizedExpressionInternalComments.js b/tests/baselines/reference/parenthesizedExpressionInternalComments.js new file mode 100644 index 00000000000..f02b0e86c70 --- /dev/null +++ b/tests/baselines/reference/parenthesizedExpressionInternalComments.js @@ -0,0 +1,21 @@ +//// [parenthesizedExpressionInternalComments.ts] +/*1*/(/*2*/ "foo" /*3*/)/*4*/ +; + +// open +/*1*/( + // next + /*2*/"foo" + //close + /*3*/)/*4*/ +; + + +//// [parenthesizedExpressionInternalComments.js] +/*1*/ ( /*2*/"foo" /*3*/) /*4*/; +// open +/*1*/ ( +// next +/*2*/ "foo" +//close +/*3*/ ) /*4*/; diff --git a/tests/baselines/reference/parenthesizedExpressionInternalComments.symbols b/tests/baselines/reference/parenthesizedExpressionInternalComments.symbols new file mode 100644 index 00000000000..ae9c793bee4 --- /dev/null +++ b/tests/baselines/reference/parenthesizedExpressionInternalComments.symbols @@ -0,0 +1,13 @@ +=== tests/cases/compiler/parenthesizedExpressionInternalComments.ts === +/*1*/(/*2*/ "foo" /*3*/)/*4*/ +No type information for this code.; +No type information for this code. +No type information for this code.// open +No type information for this code./*1*/( +No type information for this code. // next +No type information for this code. /*2*/"foo" +No type information for this code. //close +No type information for this code. /*3*/)/*4*/ +No type information for this code.; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parenthesizedExpressionInternalComments.types b/tests/baselines/reference/parenthesizedExpressionInternalComments.types new file mode 100644 index 00000000000..4b3bff8dbbc --- /dev/null +++ b/tests/baselines/reference/parenthesizedExpressionInternalComments.types @@ -0,0 +1,19 @@ +=== tests/cases/compiler/parenthesizedExpressionInternalComments.ts === +/*1*/(/*2*/ "foo" /*3*/)/*4*/ +>(/*2*/ "foo" /*3*/) : "foo" +>"foo" : "foo" + +; + +// open +/*1*/( +>( // next /*2*/"foo" //close /*3*/) : "foo" + + // next + /*2*/"foo" +>"foo" : "foo" + + //close + /*3*/)/*4*/ +; + diff --git a/tests/baselines/reference/parseRegularExpressionMixedWithComments.js b/tests/baselines/reference/parseRegularExpressionMixedWithComments.js index a955ba31f2f..c15635631d0 100644 --- a/tests/baselines/reference/parseRegularExpressionMixedWithComments.js +++ b/tests/baselines/reference/parseRegularExpressionMixedWithComments.js @@ -8,7 +8,8 @@ var regex5 = /**// asdf/**/ /; //// [parseRegularExpressionMixedWithComments.js] var regex1 = / asdf /; -var regex2 = / asdf /; -var regex3 = 1; -var regex4 = Math.pow(/**/ / /, /asdf /); -var regex5 = Math.pow(/**/ / asdf/, / /); +var regex2 = /**/ / asdf /; +var regex3 = /**/ //**/ asdf / // should be a comment line + 1; +var regex4 = /**/ Math.pow(/**/ / /, /asdf /); +var regex5 = /**/ Math.pow(/**/ / asdf/, / /); diff --git a/tests/baselines/reference/parser15.4.4.14-9-2.js b/tests/baselines/reference/parser15.4.4.14-9-2.js index 78ddfbac26b..57ba8b1da4a 100644 --- a/tests/baselines/reference/parser15.4.4.14-9-2.js +++ b/tests/baselines/reference/parser15.4.4.14-9-2.js @@ -44,7 +44,8 @@ function testcase() { if (a.indexOf(-(4 / 3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && // a[7] = +0, 0===+0 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0 - a.indexOf(1) === 10) { + a.indexOf(1) === 10) // a[10] =one=== 1 + { return true; } } diff --git a/tests/baselines/reference/parserNotRegex1.js b/tests/baselines/reference/parserNotRegex1.js index 1169640d850..abaa4697655 100644 --- a/tests/baselines/reference/parserNotRegex1.js +++ b/tests/baselines/reference/parserNotRegex1.js @@ -5,6 +5,7 @@ } //// [parserNotRegex1.js] -if (a.indexOf(-(4 / 3))) { +if (a.indexOf(-(4 / 3))) // We should not get a regex here becuase of the / in the comment. + { return true; } diff --git a/tests/baselines/reference/parserRealSource1.js b/tests/baselines/reference/parserRealSource1.js index 73da63032cb..e9cf326b542 100644 --- a/tests/baselines/reference/parserRealSource1.js +++ b/tests/baselines/reference/parserRealSource1.js @@ -247,28 +247,28 @@ var TypeScript; var addChar = function (index) { var ch = value.charCodeAt(index); switch (ch) { - case 0x09:// tab + case 0x09: // tab result += "\\t"; break; - case 0x0a:// line feed + case 0x0a: // line feed result += "\\n"; break; - case 0x0b:// vertical tab + case 0x0b: // vertical tab result += "\\v"; break; - case 0x0c:// form feed + case 0x0c: // form feed result += "\\f"; break; - case 0x0d:// carriage return + case 0x0d: // carriage return result += "\\r"; break; - case 0x22:// double quote + case 0x22: // double quote result += "\\\""; break; - case 0x27:// single quote + case 0x27: // single quote result += "\\\'"; break; - case 0x5c:// Backslash + case 0x5c: // Backslash result += "\\"; break; default: diff --git a/tests/baselines/reference/parserRealSource7.js b/tests/baselines/reference/parserRealSource7.js index c3938341017..f2681caaa82 100644 --- a/tests/baselines/reference/parserRealSource7.js +++ b/tests/baselines/reference/parserRealSource7.js @@ -1369,7 +1369,7 @@ var TypeScript; fgSym.declAST = ast; } } - else { + else { // there exists a symbol with this name if ((fgSym.kind() == SymbolKind.Type)) { fgSym = context.checker.createFunctionSignature(funcDecl, containerSym, containerScope, fgSym, false).declAST.type.symbol; } @@ -1428,7 +1428,7 @@ var TypeScript; funcDecl.accessorSymbol = context.checker.createAccessorSymbol(funcDecl, fgSym, containerSym.type, (funcDecl.isMethod() && isStatic), true, containerScope, containerSym); } funcDecl.type.symbol.declAST = ast; - if (funcDecl.isConstructor) { + if (funcDecl.isConstructor) { // REVIEW: Remove when classes completely replace oldclass go = true; } ; @@ -1482,6 +1482,8 @@ var TypeScript; else if (ast.nodeType == NodeType.InterfaceDeclaration) { go = preCollectInterfaceTypes(ast, parent, context); } + // This will be a constructor arg because this pass only traverses + // constructor arg lists else if (ast.nodeType == NodeType.ArgDecl) { go = preCollectArgDeclTypes(ast, parent, context); } diff --git a/tests/baselines/reference/parserindenter.js b/tests/baselines/reference/parserindenter.js index 27b73e50202..da91d0cc92e 100644 --- a/tests/baselines/reference/parserindenter.js +++ b/tests/baselines/reference/parserindenter.js @@ -912,20 +912,20 @@ var Formatting; Indenter.prototype.GetSpecialCaseIndentation = function (token, node) { var indentationInfo = null; switch (token.Token) { - case AuthorTokenKind.atkLCurly:// { is not part of the tree + case AuthorTokenKind.atkLCurly: // { is not part of the tree indentationInfo = this.GetSpecialCaseIndentationForLCurly(node); return indentationInfo; case AuthorTokenKind.atkElse: // else is not part of the tree - case AuthorTokenKind.atkRBrack:// ] is not part of the tree + case AuthorTokenKind.atkRBrack: // ] is not part of the tree indentationInfo = node.GetNodeStartLineIndentation(this); return indentationInfo; - case AuthorTokenKind.atkRCurly:// } is not part of the tree + case AuthorTokenKind.atkRCurly: // } is not part of the tree // if '}' is for a body-block, get indentation based on its parent. if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkBlock && node.AuthorNode.EdgeLabel == AuthorParseNodeEdge.apneBody) node = node.Parent; indentationInfo = node.GetNodeStartLineIndentation(this); return indentationInfo; - case AuthorTokenKind.atkWhile:// while (in do-while) is not part of the tree + case AuthorTokenKind.atkWhile: // while (in do-while) is not part of the tree if (node.AuthorNode.Details.Kind == AuthorParseNodeKind.apnkDoWhile) { indentationInfo = node.GetNodeStartLineIndentation(this); return indentationInfo; diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map index c44e24a081e..0919c22fe39 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map index 2d046c948af..05111bff94f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map index 436eab5db94..d2eb9d40946 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map index 2d046c948af..05111bff94f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index c44e24a081e..0919c22fe39 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 2d046c948af..05111bff94f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index 436eab5db94..d2eb9d40946 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 2d046c948af..05111bff94f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index df6d2c811c0..17fc06ba650 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 0865ddc2903..cd04ee012e5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 0c75dbb2b00..424676780c4 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 8430db389ed..aaddc7bf4cb 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map index b49f0a04b53..0005ea5e547 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map index 8f88c077a44..00081f11872 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map index b3b4c42289f..28ca1d3c0c7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map index 80d6ba438ba..7214e93dbe6 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map index 6c7d26906a4..2250cf85abc 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map index 3813e4b2cca..2c9fd55880a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 8f88c077a44..00081f11872 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index b3b4c42289f..28ca1d3c0c7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index b49f0a04b53..0005ea5e547 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 6c7d26906a4..2250cf85abc 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index 3813e4b2cca..2c9fd55880a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 80d6ba438ba..7214e93dbe6 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 783691c52ed..9a3b2a583e7 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map index 16e1f512923..b71b40ce3c5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map index f1777998477..d23ca063753 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map index d16575e8a97..a68c1c28cc9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map index 47915c9660b..db6682ddd2d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 16e1f512923..b71b40ce3c5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index f1777998477..d23ca063753 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index d16575e8a97..a68c1c28cc9 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 47915c9660b..db6682ddd2d 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index 293a1478989..4b66b94e9fd 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map index 9cef03b0711..e28bbd77d53 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map index f1777998477..d23ca063753 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map index de654530492..d95817e6cec 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map index 4a1329681e8..05b27456a0e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 9cef03b0711..e28bbd77d53 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index f1777998477..d23ca063753 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index de654530492..d95817e6cec 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 4a1329681e8..05b27456a0e 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 61dfeeeb8d3..b661642b391 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map index 2b699d27069..c1cb1602dce 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map index cd0afe5bb0f..89c95b0739a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map index 2b699d27069..c1cb1602dce 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map index cd0afe5bb0f..89c95b0739a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index cd0afe5bb0f..89c95b0739a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index 2b699d27069..c1cb1602dce 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index cd0afe5bb0f..89c95b0739a 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index 2b699d27069..c1cb1602dce 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index 16fc574b9c1..8a1e8e7a47c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map index 16fc574b9c1..8a1e8e7a47c 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js.map index 6bbdb177623..c2fbf96083f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map index 4556d50eb30..ba8b1faf1a5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js.map index 6bbdb177623..c2fbf96083f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map index 4556d50eb30..ba8b1faf1a5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 6bbdb177623..c2fbf96083f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 4556d50eb30..ba8b1faf1a5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 6bbdb177623..c2fbf96083f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 4556d50eb30..ba8b1faf1a5 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map index 0f1b26bbb4c..554e1674f1f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map index 0f1b26bbb4c..554e1674f1f 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map index bd2470b8ccf..6e569fed033 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map index bd2470b8ccf..6e569fed033 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index bd2470b8ccf..6e569fed033 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 2ec23553c3b..6a2c53a7825 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index bd2470b8ccf..6e569fed033 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index 0b06c404460..bb85a951174 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map index 0b06c404460..bb85a951174 100644 --- a/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map index 67e8b70639d..117f9083303 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map index 7c959ab9408..adb4e2cab15 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map index b142ff216f2..9a824a4b02e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map index 67e8b70639d..117f9083303 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map index 15c5c91190e..96fc6872262 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map index b142ff216f2..9a824a4b02e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 67e8b70639d..117f9083303 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index 7c959ab9408..adb4e2cab15 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index b142ff216f2..9a824a4b02e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 67e8b70639d..117f9083303 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index 15c5c91190e..96fc6872262 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index b142ff216f2..9a824a4b02e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 0b7f01fdec5..31510a15e2e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 2118f70902b..6294e5d70b4 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index d4bfc447280..3c2c85915fb 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/ref/m2.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index c9efc4d02d1..8099daa4c09 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../outputdir_mixed_subfolder/ref/m1.ts","../outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map index 59de6353786..4569713071f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map index 301f83dab55..c5db7f2081c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map index 6c74ce312be..4ef41bde542 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map index 97b03befa22..80dc3730994 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map index bd9b5d0051a..8371af923dd 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js.map index 3821a46478a..f22ddb5b20a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 301f83dab55..c5db7f2081c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index 6c74ce312be..4ef41bde542 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 59de6353786..4569713071f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index bd9b5d0051a..8371af923dd 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index 3821a46478a..f22ddb5b20a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 97b03befa22..80dc3730994 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 83050ce43fe..42a68b8e6e2 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_module_multifolder/ref/m1.ts","../projects/outputdir_module_multifolder_ref/m2.ts","../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_module_multifolder/ref/m1.ts","../projects/outputdir_module_multifolder_ref/m2.ts","../projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map index df737e96f26..2da942ca76c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js.map index 84f19710abc..d821c196c5c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js.map index ea360554f92..7ed1a197f9e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js.map index e395bf8648f..ecde38146fa 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index df737e96f26..2da942ca76c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 84f19710abc..d821c196c5c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index ea360554f92..7ed1a197f9e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index e395bf8648f..ecde38146fa 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index 5e9e5c8593d..15f5b5e85f8 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts","../outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_simple/m1.ts","../outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map index dcfdb34145e..6488971de2e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map index 2df46e6835c..f12cabe285e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map index 44556b78663..4c31f13c0f6 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js.map index 47558364d4b..48069602b7a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index dcfdb34145e..6488971de2e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 2df46e6835c..f12cabe285e 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 44556b78663..4c31f13c0f6 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 47558364d4b..48069602b7a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index aa198a56dbe..3bb96febec3 100644 --- a/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/ref/m1.ts","../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_module_subfolder/ref/m1.ts","../outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map index 4065af78119..e80b62f38d7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map index 2d943711749..8f8e4a9e04c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map index 2c4b424daf2..74b481ea3aa 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map index 4065af78119..e80b62f38d7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map index 2d943711749..8f8e4a9e04c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map index 2c4b424daf2..74b481ea3aa 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 2d943711749..8f8e4a9e04c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 2c4b424daf2..74b481ea3aa 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index 4065af78119..e80b62f38d7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 2d943711749..8f8e4a9e04c 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 2c4b424daf2..74b481ea3aa 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index 4065af78119..e80b62f38d7 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index 5fe8191c828..463b4a44a6a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_multifolder/ref/m1.ts","../projects/outputdir_multifolder_ref/m2.ts","../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_multifolder/ref/m1.ts","../projects/outputdir_multifolder_ref/m2.ts","../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map index 5fe8191c828..463b4a44a6a 100644 --- a/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_multifolder/ref/m1.ts","../projects/outputdir_multifolder_ref/m2.ts","../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../projects/outputdir_multifolder/ref/m1.ts","../projects/outputdir_multifolder_ref/m2.ts","../projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js.map index 06c3d793d00..d564380ce4f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map index a0304c41f55..c54a0979210 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js.map index 06c3d793d00..d564380ce4f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map index a0304c41f55..c54a0979210 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 06c3d793d00..d564380ce4f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index a0304c41f55..c54a0979210 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 06c3d793d00..d564380ce4f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index a0304c41f55..c54a0979210 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map index c6dac016fa3..0752359c5a9 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map index c6dac016fa3..0752359c5a9 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_simple/m1.ts","../outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js.map index 4fd259015f5..3eec9c91314 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js.map index 4fd259015f5..3eec9c91314 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 4fd259015f5..3eec9c91314 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index 4fd259015f5..3eec9c91314 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map index 4fd259015f5..3eec9c91314 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map index 4fd259015f5..3eec9c91314 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map index d27f0a2f6c3..f988b35f538 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map index 2e3d358f192..d7869490d92 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map index d27f0a2f6c3..f988b35f538 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map index 2e3d358f192..d7869490d92 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index d27f0a2f6c3..f988b35f538 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 2e3d358f192..d7869490d92 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index d27f0a2f6c3..f988b35f538 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 2e3d358f192..d7869490d92 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index c23b45ac58e..bcca86c4b0f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map index c23b45ac58e..bcca86c4b0f 100644 --- a/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/mapRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../outputdir_subfolder/ref/m1.ts","../outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map index df653772beb..67d7bee8df7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map index 4d37c4456a3..7b7590bfe7b 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map index bd199ac9a0e..ff81e2cc08a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map index df653772beb..67d7bee8df7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map index 6ba684e3841..c5e886b1de7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map index bd199ac9a0e..ff81e2cc08a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index df653772beb..67d7bee8df7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index 4d37c4456a3..7b7590bfe7b 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index bd199ac9a0e..ff81e2cc08a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index df653772beb..67d7bee8df7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index 6ba684e3841..c5e886b1de7 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index bd199ac9a0e..ff81e2cc08a 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index e84545ade77..706b2f76003 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 0e5790298d1..d4974becf8e 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index e115b1ebd64..3b836eda217 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m2.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 83c95ed2c07..8f4a7b2bfe8 100644 --- a/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_mixed_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_mixed_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map index 0b4d12cead1..cc4ad4fade3 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map index fa0bcf94a5d..e64fee0e4e5 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js.map index 6a2bfc777e9..753acc11236 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map index 29b98b193fb..961f4e49177 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map index f4de6b06e49..833ee43fea8 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js.map index 842d34fe73d..24de9a73ef4 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index fa0bcf94a5d..e64fee0e4e5 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index 6a2bfc777e9..753acc11236 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 0b4d12cead1..cc4ad4fade3 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index f4de6b06e49..833ee43fea8 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index 842d34fe73d..24de9a73ef4 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 29b98b193fb..961f4e49177 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index cd6a7fab377..cf123dfab08 100644 --- a/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js.map index f0cb61b0632..55a472782f4 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js.map index ed2f67c585b..e58e0517086 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js.map index da3b77ba146..c847aae481d 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js.map index f4d0ecfe24b..9b003d5d16a 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index f0cb61b0632..55a472782f4 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ed2f67c585b..e58e0517086 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index da3b77ba146..c847aae481d 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index f4d0ecfe24b..9b003d5d16a 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index ba2950b1a5e..5528eb7506c 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts","file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_simple/m1.ts","file:///tests/cases/projects/outputdir_module_simple/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map index 2f6470b65ff..56a2e8a17a5 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js.map index a88a706d9b1..7cdce4a0b5e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map index 5b58a2ee571..b05e12a5993 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js.map index d4034d62c4a..e1aa8134746 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 2f6470b65ff..56a2e8a17a5 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index a88a706d9b1..7cdce4a0b5e 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 5b58a2ee571..b05e12a5993 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index d4034d62c4a..e1aa8134746 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 12f2439e6f5..52eb11dc5d7 100644 --- a/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_module_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_module_subfolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile0.js.map index 21fcb42a117..ef787d82b98 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js.map index 51aa3088c8e..b680b30bba1 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map index c5bffb75041..b7568d63097 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile0.js.map index 21fcb42a117..ef787d82b98 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js.map index 51aa3088c8e..b680b30bba1 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map index c5bffb75041..b7568d63097 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 51aa3088c8e..b680b30bba1 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index c5bffb75041..b7568d63097 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index 21fcb42a117..ef787d82b98 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 51aa3088c8e..b680b30bba1 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index c5bffb75041..b7568d63097 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index 21fcb42a117..ef787d82b98 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map index fa2ace48603..5b15320a2bc 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map index fa2ace48603..5b15320a2bc 100644 --- a/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_multifolder/ref/m1.ts","file:///tests/cases/projects/outputdir_multifolder_ref/m2.ts","file:///tests/cases/projects/outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js.map index 811549fe24b..1acd4bdc432 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map index d11bc79cf03..594743ba766 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js.map index 811549fe24b..1acd4bdc432 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map index d11bc79cf03..594743ba766 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 811549fe24b..1acd4bdc432 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index d11bc79cf03..594743ba766 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 811549fe24b..1acd4bdc432 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index d11bc79cf03..594743ba766 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map index 141dd1ad654..b2e0b46abe8 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map index 141dd1ad654..b2e0b46abe8 100644 --- a/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_simple/m1.ts","file:///tests/cases/projects/outputdir_simple/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js.map index ee286c89ca6..f7815593ad2 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js.map index ee286c89ca6..f7815593ad2 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ee286c89ca6..f7815593ad2 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index ee286c89ca6..f7815593ad2 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map index ee286c89ca6..f7815593ad2 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map index ee286c89ca6..f7815593ad2 100644 --- a/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_singleFile/test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js.map index 3f248eb9a9f..56a7cdbbc5d 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map index 4b826d6120d..db25b713593 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js.map index 3f248eb9a9f..56a7cdbbc5d 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map index 4b826d6120d..db25b713593 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 3f248eb9a9f..56a7cdbbc5d 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 4b826d6120d..db25b713593 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 3f248eb9a9f..56a7cdbbc5d 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 4b826d6120d..db25b713593 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map index b9dedfdcff0..9ef3dc349d0 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map index b9dedfdcff0..9ef3dc349d0 100644 --- a/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["file:///tests/cases/projects/outputdir_subfolder/ref/m1.ts","file:///tests/cases/projects/outputdir_subfolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map index 85be78ed9b4..1c6f73b1e34 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map index e7ecba5fc92..d89ce104a45 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index 85be78ed9b4..1c6f73b1e34 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index e7ecba5fc92..d89ce104a45 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 92315bfcacc..f83be98ecaf 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 2d0fd86fc16..8adc7b4743a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index c98b66faded..74a9bd45879 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 7b3f8edb8a6..657ff532b39 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map index e8fba0d4b55..791976cd5e0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map index 8087b94c0c3..b3a443ea00d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map index a8f0695ded3..a4a1869d935 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map index 50a28887d0b..089936a2d5e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map index 56a4f46ae00..e52966e3475 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js.map index 6ad9ecad595..073139b30b1 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 8087b94c0c3..b3a443ea00d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index a8f0695ded3..a4a1869d935 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index e8fba0d4b55..791976cd5e0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 56a4f46ae00..e52966e3475 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index 6ad9ecad595..073139b30b1 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 50a28887d0b..089936a2d5e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 5d14898713d..1f75f4c5d42 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map index caee4b20553..a168a8072e0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js.map index fa989919301..7c523475497 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js.map index 1ec67278ba3..a9000d4135a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index caee4b20553..a168a8072e0 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index fa989919301..7c523475497 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 1ec67278ba3..a9000d4135a 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index f5849debd83..ed68890c28f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map index 15b12e3a189..9c73b3cc045 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map index 6e97669732b..2732be08599 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js.map index badcd2b1b9c..7d90386ab45 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 15b12e3a189..9c73b3cc045 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 6e97669732b..2732be08599 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index badcd2b1b9c..7d90386ab45 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 6f4defc3e4c..396b19f5b5f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map index 429ef42162b..07871f1abb3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map index 429ef42162b..07871f1abb3 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map index d876a9633b4..2353544e666 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map index d876a9633b4..2353544e666 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map index 386fdffa417..8b93c41bc1b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map index 386fdffa417..8b93c41bc1b 100644 --- a/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/maprootUrlsourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map index f0aa7384842..e626d325228 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map index 67693560dfc..1967990eadf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map index d795c3d1f0d..80600215f26 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map index f0aa7384842..e626d325228 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map index d188f8a16bd..0e7c9b5a8b0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map index d795c3d1f0d..80600215f26 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index f0aa7384842..e626d325228 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index 67693560dfc..1967990eadf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index d795c3d1f0d..80600215f26 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index f0aa7384842..e626d325228 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index d188f8a16bd..0e7c9b5a8b0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index d795c3d1f0d..80600215f26 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 3520f3c0a5f..64fb3fb54d0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index b5bfe6f35c7..b9076425a0d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index ed2de159383..8922cbd851c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 9f13c07cc7c..461cf96d93d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"/tests/cases/projects/outputdir_mixed_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map index bed0bf9b3e2..ddbeba83e83 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map index 616307fc2aa..356f0f3ae21 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map index ac1540d3d7c..4d711b5af70 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map index 4281eb94fe5..dc794e278ee 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map index 20f34963221..2d9eb7f319a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map index e794023608c..e7f7303765c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 616307fc2aa..356f0f3ae21 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index ac1540d3d7c..4d711b5af70 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index bed0bf9b3e2..ddbeba83e83 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 20f34963221..2d9eb7f319a 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index e794023608c..e7f7303765c 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 4281eb94fe5..dc794e278ee 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 5970dfad43e..50226be6182 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_multifolder/src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map index 101e0b07546..1def8f17e61 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map index 5194b89b4a5..2c3bdf19675 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map index 6316b37945c..609efabc4cf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map index ec26fbe336a..ca33d719a0d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 101e0b07546..1def8f17e61 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 5194b89b4a5..2c3bdf19675 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 6316b37945c..609efabc4cf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index ec26fbe336a..ca33d719a0d 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index 64a56e71714..8d09c26d595 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_simple/src/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map index a8d5da3a201..5a21f32f5ad 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map index 1628374eef4..5004d5031f0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map index f43884731e0..a7a6c1f3485 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map index 649377c06fc..f53d4e46624 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index a8d5da3a201..5a21f32f5ad 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 1628374eef4..5004d5031f0 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index f43884731e0..a7a6c1f3485 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 649377c06fc..f53d4e46624 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index bbf9b58c64f..a461b201688 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_module_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map index 6d8889bab50..c809a3684d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map index 1ed71a40f78..510f585576e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map index 02d8fb800bf..b428d3342d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map index 6d8889bab50..c809a3684d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map index 1ed71a40f78..510f585576e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map index 02d8fb800bf..b428d3342d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 1ed71a40f78..510f585576e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 02d8fb800bf..b428d3342d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index 6d8889bab50..c809a3684d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 1ed71a40f78..510f585576e 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 02d8fb800bf..b428d3342d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index 6d8889bab50..c809a3684d8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index 35b866d6488..f527dd50ce8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map index 35b866d6488..f527dd50ce8 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_multifolder/src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js.map index 9443bade403..58b35a1f6c7 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map index e0b6ac94e0d..40086837d59 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js.map index 9443bade403..58b35a1f6c7 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map index e0b6ac94e0d..40086837d59 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 9443bade403..58b35a1f6c7 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index e0b6ac94e0d..40086837d59 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 9443bade403..58b35a1f6c7 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index e0b6ac94e0d..40086837d59 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map index 7156ba8dc54..9fce35324cf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map index 7156ba8dc54..9fce35324cf 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_simple/src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js.map index 9b57a17d7b8..527d1eac8d2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js.map index 9b57a17d7b8..527d1eac8d2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 9b57a17d7b8..527d1eac8d2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index 9b57a17d7b8..527d1eac8d2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map index 9b57a17d7b8..527d1eac8d2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map index 9b57a17d7b8..527d1eac8d2 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_singleFile/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map index 3f9a2d1663c..2bac8a8453b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map index 624510e0e30..94762386f99 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map index 3f9a2d1663c..2bac8a8453b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map index 624510e0e30..94762386f99 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 3f9a2d1663c..2bac8a8453b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 624510e0e30..94762386f99 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 3f9a2d1663c..2bac8a8453b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 624510e0e30..94762386f99 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index 38a56a19d6e..03f3b750e5b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map index 38a56a19d6e..03f3b750e5b 100644 --- a/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootAbsolutePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"/tests/cases/projects/outputdir_subfolder/src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map index d65693aee66..09674bf0339 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map index d1d1c89c2d0..a0a56221fe1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map index 5d1100e38fa..3f96f899269 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map index d1d1c89c2d0..a0a56221fe1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index d65693aee66..09674bf0339 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index d1d1c89c2d0..a0a56221fe1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index 5d1100e38fa..3f96f899269 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index d1d1c89c2d0..a0a56221fe1 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 544b444f69a..dc3b8fa7345 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 2e303ee1885..9bbcae6d3e3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 39cc19f0b09..cb8a9c432dc 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 8fa001f03aa..2e245f977fc 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map index 7571615de41..975964fcb1a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map index ad01eacc00c..64957294c8b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map index 343b30f743a..800cd2d08f3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map index a7121ab0fb4..4bc4ac5c80a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map index ddd49759374..9afc96b9c02 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js.map index 34026638960..bc2dd3e62bd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index ad01eacc00c..64957294c8b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index 343b30f743a..800cd2d08f3 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 7571615de41..975964fcb1a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index ddd49759374..9afc96b9c02 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index 34026638960..bc2dd3e62bd 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index a7121ab0fb4..4bc4ac5c80a 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 12697408ddd..c83e65e00b0 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map index f9a2fd1d740..408641f985e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js.map index 17545cd729c..a002858d99f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js.map index 70db4f7545c..585a6ba5eca 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js.map index 0e6c49a9aec..de4f5555e95 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index f9a2fd1d740..408641f985e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 17545cd729c..a002858d99f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 70db4f7545c..585a6ba5eca 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 0e6c49a9aec..de4f5555e95 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index 1132db08bd0..0b2859a88b4 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map index 07643a2c9dc..ae158cf4308 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map index 17545cd729c..a002858d99f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map index a9e9284e21d..5252572c3ea 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js.map index 9b21b166c37..da84d79da81 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 07643a2c9dc..ae158cf4308 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 17545cd729c..a002858d99f 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index a9e9284e21d..5252572c3ea 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 9b21b166c37..da84d79da81 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 5121f5c6a1e..17b0405ad01 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map index b0102393a6d..0a952711f80 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map index 8b0aa0b151b..3336b61629e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map index 52a842ad8ea..4d1fc2a9043 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map index b0102393a6d..0a952711f80 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map index 8b0aa0b151b..3336b61629e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map index 52a842ad8ea..4d1fc2a9043 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 8b0aa0b151b..3336b61629e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 52a842ad8ea..4d1fc2a9043 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index b0102393a6d..0a952711f80 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 8b0aa0b151b..3336b61629e 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 52a842ad8ea..4d1fc2a9043 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index b0102393a6d..0a952711f80 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"../src/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map index 57f6637b4f4..510e88b4c49 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map index 57f6637b4f4..510e88b4c49 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js.map index 7cd5a10b95d..32dd5fa98cb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map index 5e5a862e511..89bd06df9b6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js.map index 7cd5a10b95d..32dd5fa98cb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map index 5e5a862e511..89bd06df9b6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 7cd5a10b95d..32dd5fa98cb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 5e5a862e511..89bd06df9b6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 7cd5a10b95d..32dd5fa98cb 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 5e5a862e511..89bd06df9b6 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map index b1adff8db7e..5af11b9e6c9 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map index b1adff8db7e..5af11b9e6c9 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js.map index ce0e3492048..1ab5c9ec2d8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js.map index ce0e3492048..1ab5c9ec2d8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ce0e3492048..1ab5c9ec2d8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index ce0e3492048..1ab5c9ec2d8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map index ce0e3492048..1ab5c9ec2d8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map index ce0e3492048..1ab5c9ec2d8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map index 0fee1b5aff7..1501fb6e7b8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map index 0fee1b5aff7..1501fb6e7b8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 0fee1b5aff7..1501fb6e7b8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 003271f6730..c98f28c8284 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"../src/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 0fee1b5aff7..1501fb6e7b8 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map index 2b18772f2d6..d1c69abdf3b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map index 2b18772f2d6..d1c69abdf3b 100644 --- a/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourceRootRelativePathSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"../src/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js.map index a7a1fecb87f..5f0694e3ef7 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map index 6be8dbd2c2f..5e41b746b07 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js.map index ba1b40abf87..03ebcbb498e 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map index 6be8dbd2c2f..5e41b746b07 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index 35edbb3cd9c..02dad7af149 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 6e310b886d4..31ad76f2012 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index 3c66628ccf7..78034f93e9a 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 6e310b886d4..31ad76f2012 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index df6d2c811c0..17fc06ba650 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 0865ddc2903..cd04ee012e5 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index 0c75dbb2b00..424676780c4 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 8430db389ed..aaddc7bf4cb 100644 --- a/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcemapMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile0.js.map index a7a1fecb87f..5f0694e3ef7 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js.map index fb3dc7e5f1a..0209adbb07b 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js.map index 99618a3d6a7..4a05aaeebcb 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile0.js.map index ba1b40abf87..03ebcbb498e 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js.map index 5660dd85010..1d326abd5de 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js.map index 308a0083438..eebed1f00e5 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 8ba69854427..f0efd1446ce 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index 1179d812037..a16d56a891d 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 14fbdd65f4f..4948f91a6b8 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index a42c40521a1..b40c0866dbb 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index 86d72e20c93..388ab4704c9 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 18103b0a8b1..b076adc221b 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 783691c52ed..9a3b2a583e7 100644 --- a/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_module_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js.map index fb3dc7e5f1a..0209adbb07b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js.map index 80722609800..ac7e16bdb6b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js.map index 5660dd85010..1d326abd5de 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js.map index 90f1d966b1c..883f2933ef3 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 2eb15ca540b..bf1e5fcc006 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 742f4f4a9af..9ea18615ef4 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index c819ff2c52c..292d92a4efd 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index b94230beb69..b67114453b6 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index 293a1478989..4b66b94e9fd 100644 --- a/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js.map index fb3dc7e5f1a..0209adbb07b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js.map index 80722609800..ac7e16bdb6b 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js.map index 5660dd85010..1d326abd5de 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js.map index 6f61cbbee19..40e5cef6fc3 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 8f88c077a44..00081f11872 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 742f4f4a9af..9ea18615ef4 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 6c7d26906a4..2250cf85abc 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index ab37fc26b40..dee25be1479 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 61dfeeeb8d3..b661642b391 100644 --- a/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile0.js.map index ffa9f9f8801..e0fca9a0923 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map index e267093ff28..12f543f292d 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile0.js.map index ffa9f9f8801..e0fca9a0923 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map index e267093ff28..12f543f292d 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 3a3e660ebb5..5713450401b 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index 5fecc97d364..0057a1b0faa 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index 909bc0e42ef..3b0e13a7755 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 3a3e660ebb5..5713450401b 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index 5fecc97d364..0057a1b0faa 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index 909bc0e42ef..3b0e13a7755 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"","sources":["../../../../outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map index 16fc574b9c1..8a1e8e7a47c 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map index 16fc574b9c1..8a1e8e7a47c 100644 --- a/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../../outputdir_multifolder_ref/m2.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map index 432c227c72b..18ef91f109c 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map index 432c227c72b..18ef91f109c 100644 --- a/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index d3339c99f19..68fbeba4c1f 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 9026931ffe9..3ebdce493bc 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index d3339c99f19..68fbeba4c1f 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 9026931ffe9..3ebdce493bc 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map index 0f1b26bbb4c..554e1674f1f 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map index 0f1b26bbb4c..554e1674f1f 100644 --- a/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js.map index 27d7a9ee733..1e808b494ca 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js.map index 27d7a9ee733..1e808b494ca 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 9b9740e3555..53492f30f52 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index 9b9740e3555..53492f30f52 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js.map index 1ea77ceaed1..9ff76136d24 100644 --- a/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map index ec2e68648b7..ebb1d1e2dd9 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js.map index fa208c79390..5aad02ee1fe 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map index ec2e68648b7..ebb1d1e2dd9 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 21d3e73474e..0cff89a4f1b 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 1733ce01719..77a0d1edd4b 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"","sources":["../../../ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index 21d3e73474e..0cff89a4f1b 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map index 0b06c404460..bb85a951174 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map index 0b06c404460..bb85a951174 100644 --- a/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcemapSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"","sources":["../ref/m1.ts","../test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map index 85be78ed9b4..1c6f73b1e34 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map index e7ecba5fc92..d89ce104a45 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map index 85be78ed9b4..1c6f73b1e34 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map index e7ecba5fc92..d89ce104a45 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index ba0f9afb820..911794b77be 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map index 92315bfcacc..f83be98ecaf 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map index 2d0fd86fc16..8adc7b4743a 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map index c98b66faded..74a9bd45879 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/amd/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","ref/m2.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map index 7b3f8edb8a6..657ff532b39 100644 --- a/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMixedSubfolderSpecifyOutputFileAndOutputDirectory/node/bin/outAndOutDirFile.js.map @@ -1 +1 @@ -{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"outAndOutDirFile.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map index e8fba0d4b55..791976cd5e0 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map index 8087b94c0c3..b3a443ea00d 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map index a8f0695ded3..a4a1869d935 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map index 50a28887d0b..089936a2d5e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map index 56a4f46ae00..e52966e3475 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js.map index 6ad9ecad595..073139b30b1 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 8087b94c0c3..b3a443ea00d 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map index a8f0695ded3..a4a1869d935 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAEW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index e8fba0d4b55..791976cd5e0 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map index 56a4f46ae00..e52966e3475 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map index 6ad9ecad595..073139b30b1 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,2DAA8D;AACnD,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;AACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map index 50a28887d0b..089936a2d5e 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_module_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder_ref/m2.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map index 5d14898713d..1f75f4c5d42 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_module_multifolder/ref/m1.ts","outputdir_module_multifolder_ref/m2.ts","outputdir_module_multifolder/test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICRU,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICNU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC;IACd,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map index caee4b20553..a168a8072e0 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js.map index fa989919301..7c523475497 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js.map index 1ec67278ba3..a9000d4135a 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index caee4b20553..a168a8072e0 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index fa989919301..7c523475497 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 1ec67278ba3..a9000d4135a 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,uBAA0B;AACf,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map index f5849debd83..ed68890c28f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map index 15b12e3a189..9c73b3cc045 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map index 6e97669732b..2732be08599 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js.map index badcd2b1b9c..7d90386ab45 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 15b12e3a189..9c73b3cc045 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 43c2c887c65..c6f0db6edfc 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;;IACW,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 6e97669732b..2732be08599 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,MAAM,CAAC,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":";;AAAW,QAAA,KAAK,GAAG,EAAE,CAAC;AACtB;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAFY,sBAAK;AAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AACtC;IACI,OAAO,oBAAY,CAAC;AACxB,CAAC;AAFD,sBAEC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index badcd2b1b9c..7d90386ab45 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,MAAM,CAAC,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AACnB,QAAA,EAAE,GAAG,EAAE,CAAC;AACnB;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAFY,gBAAE;AAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AAChC;IACI,OAAO,iBAAS,CAAC;AACrB,CAAC;AAFD,gBAEC;AAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map index 6f4defc3e4c..396b19f5b5f 100644 --- a/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlModuleSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,MAAM,CAAC,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,MAAM,CAAC,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":";;;IAAW,QAAA,KAAK,GAAG,EAAE,CAAC;IACtB;QAAA;QAEA,CAAC;QAAD,YAAC;IAAD,CAAC,AAFD,IAEC;IAFY,sBAAK;IAIP,QAAA,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;IACtC;QACI,OAAO,oBAAY,CAAC;IACxB,CAAC;IAFD,sBAEC;;;;;ICPU,QAAA,EAAE,GAAG,EAAE,CAAC;IACnB;QAAA;QAEA,CAAC;QAAD,SAAC;IAAD,CAAC,AAFD,IAEC;IAFY,gBAAE;IAIJ,QAAA,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;IAChC;QACI,OAAO,iBAAS,CAAC;IACrB,CAAC;IAFD,gBAEC;IAEU,QAAA,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/diskFile0.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/amd/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map index 97e0d452dba..e02f0c8864f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map index d668056049e..9d7183f8ace 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map index 02fe5ddcde5..b3909f7bb5f 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputDirectory/node/outdir/simple/outputdir_multifolder_ref/m2.js.map @@ -1 +1 @@ -{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m2.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder_ref/m2.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map index 429ef42162b..07871f1abb3 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map index 429ef42162b..07871f1abb3 100644 --- a/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlMultifolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["outputdir_multifolder/ref/m1.ts","outputdir_multifolder_ref/m2.ts","outputdir_multifolder/test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,0DAA0D;AAC1D,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map index 43b7b9cb126..0661fc9169d 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map index 83557b43a86..f2395c4b1d7 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map index d876a9633b4..2353544e666 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map index d876a9633b4..2353544e666 100644 --- a/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSimpleSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,6BAA6B;AAC7B,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map index 9dc5e9c0cae..3ea08c440ac 100644 --- a/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSingleFileSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/amd/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderNoOutdir/node/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/amd/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map index 48ee93efbeb..6464269b283 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/ref/m1.js.map @@ -1 +1 @@ -{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"m1.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map index f43236fa96a..d03776e1d6e 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputDirectory/node/outdir/simple/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["test.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map index 386fdffa417..8b93c41bc1b 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/amd/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map index 386fdffa417..8b93c41bc1b 100644 --- a/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map +++ b/tests/baselines/reference/project/sourcerootUrlSubfolderSpecifyOutputFile/node/bin/test.js.map @@ -1 +1 @@ -{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,MAAM,CAAC,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file +{"version":3,"file":"test.js","sourceRoot":"http://typescript.codeplex.com/","sources":["ref/m1.ts","test.ts"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,EAAE,CAAC;AACf;IAAA;IAEA,CAAC;IAAD,YAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAC;AAC/B;IACI,OAAO,YAAY,CAAC;AACxB,CAAC;ACRD,iCAAiC;AACjC,IAAI,EAAE,GAAG,EAAE,CAAC;AACZ;IAAA;IAEA,CAAC;IAAD,SAAC;AAAD,CAAC,AAFD,IAEC;AAED,IAAI,SAAS,GAAG,IAAI,EAAE,EAAE,CAAC;AACzB;IACI,OAAO,SAAS,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/properties.js.map b/tests/baselines/reference/properties.js.map index 47c17f796c9..614db7b5edc 100644 --- a/tests/baselines/reference/properties.js.map +++ b/tests/baselines/reference/properties.js.map @@ -1,2 +1,2 @@ //// [properties.js.map] -{"version":3,"file":"properties.js","sourceRoot":"","sources":["properties.ts"],"names":[],"mappings":"AAAA;IAAA;IAWA,CAAC;IATG,sBAAW,0BAAK;aAAhB;YAEI,MAAM,CAAC,EAAE,CAAC;QACd,CAAC;aAED,UAAiB,KAAa;YAE1B,EAAE;QACN,CAAC;;;OALA;IAML,cAAC;AAAD,CAAC,AAXD,IAWC"} \ No newline at end of file +{"version":3,"file":"properties.js","sourceRoot":"","sources":["properties.ts"],"names":[],"mappings":"AAAA;IAAA;IAWA,CAAC;IATG,sBAAW,0BAAK;aAAhB;YAEI,OAAO,EAAE,CAAC;QACd,CAAC;aAED,UAAiB,KAAa;YAE1B,EAAE;QACN,CAAC;;;OALA;IAML,cAAC;AAAD,CAAC,AAXD,IAWC"} \ No newline at end of file diff --git a/tests/baselines/reference/properties.sourcemap.txt b/tests/baselines/reference/properties.sourcemap.txt index 762044e5c2b..dcb2822b46b 100644 --- a/tests/baselines/reference/properties.sourcemap.txt +++ b/tests/baselines/reference/properties.sourcemap.txt @@ -59,22 +59,19 @@ sourceFile:properties.ts --- >>> return 42; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ 1->public get Count(): number > { > -2 > return -3 > -4 > 42 -5 > ; +2 > return +3 > 42 +4 > ; 1->Emitted(6, 13) Source(5, 9) + SourceIndex(0) -2 >Emitted(6, 19) Source(5, 15) + SourceIndex(0) -3 >Emitted(6, 20) Source(5, 16) + SourceIndex(0) -4 >Emitted(6, 22) Source(5, 18) + SourceIndex(0) -5 >Emitted(6, 23) Source(5, 19) + SourceIndex(0) +2 >Emitted(6, 20) Source(5, 16) + SourceIndex(0) +3 >Emitted(6, 22) Source(5, 18) + SourceIndex(0) +4 >Emitted(6, 23) Source(5, 19) + SourceIndex(0) --- >>> }, 1 >^^^^^^^^ diff --git a/tests/baselines/reference/propertyAccessExpressionInnerComments.js b/tests/baselines/reference/propertyAccessExpressionInnerComments.js new file mode 100644 index 00000000000..3348c043219 --- /dev/null +++ b/tests/baselines/reference/propertyAccessExpressionInnerComments.js @@ -0,0 +1,29 @@ +//// [propertyAccessExpressionInnerComments.ts] +/*1*/Array/*2*/./*3*/toString/*4*/ + +/*1*/Array +/*2*/./*3*/ + // Single-line comment + toString/*4*/ + +/*1*/Array/*2*/./*3*/ + // Single-line comment + toString/*4*/ + +/*1*/Array + // Single-line comment + /*2*/./*3*/toString/*4*/ + + +//// [propertyAccessExpressionInnerComments.js] +/*1*/ Array /*2*/. /*3*/toString; /*4*/ +/*1*/ Array + /*2*/ . /*3*/ + // Single-line comment + toString; /*4*/ +/*1*/ Array /*2*/. /*3*/ + // Single-line comment + toString; /*4*/ +/*1*/ Array + // Single-line comment + /*2*/ . /*3*/toString; /*4*/ diff --git a/tests/baselines/reference/propertyAccessExpressionInnerComments.symbols b/tests/baselines/reference/propertyAccessExpressionInnerComments.symbols new file mode 100644 index 00000000000..a8a7214c555 --- /dev/null +++ b/tests/baselines/reference/propertyAccessExpressionInnerComments.symbols @@ -0,0 +1,31 @@ +=== tests/cases/compiler/propertyAccessExpressionInnerComments.ts === +/*1*/Array/*2*/./*3*/toString/*4*/ +>Array/*2*/./*3*/toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) + +/*1*/Array +>Array/*2*/./*3*/ // Single-line comment toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + +/*2*/./*3*/ + // Single-line comment + toString/*4*/ +>toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) + +/*1*/Array/*2*/./*3*/ +>Array/*2*/./*3*/ // Single-line comment toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + // Single-line comment + toString/*4*/ +>toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) + +/*1*/Array +>Array // Single-line comment /*2*/./*3*/toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + // Single-line comment + /*2*/./*3*/toString/*4*/ +>toString : Symbol(Function.toString, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/propertyAccessExpressionInnerComments.types b/tests/baselines/reference/propertyAccessExpressionInnerComments.types new file mode 100644 index 00000000000..63bd06c68d4 --- /dev/null +++ b/tests/baselines/reference/propertyAccessExpressionInnerComments.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/propertyAccessExpressionInnerComments.ts === +/*1*/Array/*2*/./*3*/toString/*4*/ +>Array/*2*/./*3*/toString : () => string +>Array : ArrayConstructor +>toString : () => string + +/*1*/Array +>Array/*2*/./*3*/ // Single-line comment toString : () => string +>Array : ArrayConstructor + +/*2*/./*3*/ + // Single-line comment + toString/*4*/ +>toString : () => string + +/*1*/Array/*2*/./*3*/ +>Array/*2*/./*3*/ // Single-line comment toString : () => string +>Array : ArrayConstructor + + // Single-line comment + toString/*4*/ +>toString : () => string + +/*1*/Array +>Array // Single-line comment /*2*/./*3*/toString : () => string +>Array : ArrayConstructor + + // Single-line comment + /*2*/./*3*/toString/*4*/ +>toString : () => string + diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index b27f18ddffa..5c1b0fc9d30 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js.map +++ b/tests/baselines/reference/recursiveClassReferenceTest.js.map @@ -1,2 +1,2 @@ //// [recursiveClassReferenceTest.js.map] -{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAAC,IAAA,OAAO,CAUpB;IAVa,WAAA,OAAO;QAAC,IAAA,KAAK,CAU1B;QAVqB,WAAA,OAAK;YAAC,IAAA,IAAI,CAU/B;YAV2B,WAAA,IAAI;gBAC/B;oBAAA;oBAQA,CAAC;oBANO,+BAAK,GAAZ,cAAiB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBAExB,6BAAG,GAAV,UAAW,KAA6B;wBAEvC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBACF,sBAAC;gBAAD,CAAC,AARD,IAQC;gBARY,oBAAe,kBAQ3B,CAAA;YACF,CAAC,EAV2B,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAU/B;QAAD,CAAC,EAVqB,KAAK,GAAL,aAAK,KAAL,aAAK,QAU1B;IAAD,CAAC,EAVa,OAAO,GAAP,cAAO,KAAP,cAAO,QAUpB;AAAD,CAAC,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,WAAO,MAAM;IAAC,IAAA,KAAK,CAoBlB;IApBa,WAAA,KAAK;QAAC,IAAA,OAAO,CAoB1B;QApBmB,WAAA,OAAO;YAC1B;gBAKC,oBAAoB,SAAkC;oBAAlC,cAAS,GAAT,SAAS,CAAyB;oBAD9C,YAAO,GAAO,IAAI,CAAC;oBAEvB,aAAa;oBACb,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAC3C,CAAC;gBANM,wBAAG,GAAV,UAAW,MAAyC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBAAA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAAA,CAAC,CAAA,CAAC;gBAQlF,+BAAU,GAAjB;oBACC,MAAM,CAAC,OAAO,CAAC;gBAChB,CAAC;gBAEM,4BAAO,GAAd;gBAEA,CAAC;gBAEF,iBAAC;YAAD,CAAC,AAlBD,IAkBC;YAlBY,kBAAU,aAkBtB,CAAA;QACF,CAAC,EApBmB,OAAO,GAAP,aAAO,KAAP,aAAO,QAoB1B;IAAD,CAAC,EApBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAoBlB;AAAD,CAAC,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAA;IAAuF,CAAC;IAA3C,sCAAe,GAAtB,cAAmC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAC;IAAC,mBAAC;AAAD,CAAC,AAAxF,IAAwF;AASxF,WAAO,MAAM;IAAC,IAAA,KAAK,CAwBlB;IAxBa,WAAA,KAAK;QAAC,IAAA,SAAS,CAwB5B;QAxBmB,WAAA,SAAS;YAAC,IAAA,SAAS,CAwBtC;YAxB6B,WAAA,SAAS;gBAEtC;oBACO,eAAoB,IAAW;wBAAX,SAAI,GAAJ,IAAI,CAAO;oBAAI,CAAC;oBACnC,qBAAK,GAAZ;wBACC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBAEM,sBAAM,GAAb,UAAc,KAAY;wBACzB,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC;oBACvB,CAAC;oBAEM,uBAAO,GAAd,cAA0B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzC,YAAC;gBAAD,CAAC,AAXD,IAWC;gBAXY,eAAK,QAWjB,CAAA;gBAED;oBAA0B,wBAAY;oBAAtC;;oBAQA,CAAC;oBANA,aAAa;oBACN,8BAAe,GAAtB;wBACC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAGF,WAAC;gBAAD,CAAC,AARD,CAA0B,YAAY,GAQrC;gBARY,cAAI,OAQhB,CAAA;YACF,CAAC,EAxB6B,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAwBtC;QAAD,CAAC,EAxBmB,SAAS,GAAT,eAAS,KAAT,eAAS,QAwB5B;IAAD,CAAC,EAxBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAwBlB;AAAD,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file +{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAAC,IAAA,OAAO,CAUpB;IAVa,WAAA,OAAO;QAAC,IAAA,KAAK,CAU1B;QAVqB,WAAA,OAAK;YAAC,IAAA,IAAI,CAU/B;YAV2B,WAAA,IAAI;gBAC/B;oBAAA;oBAQA,CAAC;oBANO,+BAAK,GAAZ,cAAiB,OAAO,IAAI,CAAC,CAAC,CAAC;oBAExB,6BAAG,GAAV,UAAW,KAA6B;wBAEvC,OAAO,IAAI,CAAC;oBACb,CAAC;oBACF,sBAAC;gBAAD,CAAC,AARD,IAQC;gBARY,oBAAe,kBAQ3B,CAAA;YACF,CAAC,EAV2B,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAU/B;QAAD,CAAC,EAVqB,KAAK,GAAL,aAAK,KAAL,aAAK,QAU1B;IAAD,CAAC,EAVa,OAAO,GAAP,cAAO,KAAP,cAAO,QAUpB;AAAD,CAAC,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,WAAO,MAAM;IAAC,IAAA,KAAK,CAoBlB;IApBa,WAAA,KAAK;QAAC,IAAA,OAAO,CAoB1B;QApBmB,WAAA,OAAO;YAC1B;gBAKC,oBAAoB,SAAkC;oBAAlC,cAAS,GAAT,SAAS,CAAyB;oBAD9C,YAAO,GAAO,IAAI,CAAC;oBAEvB,aAAa;oBACb,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAC3C,CAAC;gBANM,wBAAG,GAAV,UAAW,MAAyC,IAAI,IAAI,IAAI,EAAE;oBAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;iBAAC,CAAA,CAAC;gBAQlF,+BAAU,GAAjB;oBACC,OAAO,OAAO,CAAC;gBAChB,CAAC;gBAEM,4BAAO,GAAd;gBAEA,CAAC;gBAEF,iBAAC;YAAD,CAAC,AAlBD,IAkBC;YAlBY,kBAAU,aAkBtB,CAAA;QACF,CAAC,EApBmB,OAAO,GAAP,aAAO,KAAP,aAAO,QAoB1B;IAAD,CAAC,EApBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAoBlB;AAAD,CAAC,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAA;IAAuF,CAAC;IAA3C,sCAAe,GAAtB,cAAmC,OAAO,IAAI,CAAC,CAAA,CAAC;IAAC,mBAAC;AAAD,CAAC,AAAxF,IAAwF;AASxF,WAAO,MAAM;IAAC,IAAA,KAAK,CAwBlB;IAxBa,WAAA,KAAK;QAAC,IAAA,SAAS,CAwB5B;QAxBmB,WAAA,SAAS;YAAC,IAAA,SAAS,CAwBtC;YAxB6B,WAAA,SAAS;gBAEtC;oBACO,eAAoB,IAAW;wBAAX,SAAI,GAAJ,IAAI,CAAO;oBAAI,CAAC;oBACnC,qBAAK,GAAZ;wBACC,OAAO,IAAI,CAAC;oBACb,CAAC;oBAEM,sBAAM,GAAb,UAAc,KAAY;wBACzB,OAAO,IAAI,KAAK,KAAK,CAAC;oBACvB,CAAC;oBAEM,uBAAO,GAAd,cAA0B,OAAO,IAAI,CAAC,CAAC,CAAC;oBACzC,YAAC;gBAAD,CAAC,AAXD,IAWC;gBAXY,eAAK,QAWjB,CAAA;gBAED;oBAA0B,wBAAY;oBAAtC;;oBAQA,CAAC;oBANA,aAAa;oBACN,8BAAe,GAAtB;wBACC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAGF,WAAC;gBAAD,CAAC,AARD,CAA0B,YAAY,GAQrC;gBARY,cAAI,OAQhB,CAAA;YACF,CAAC,EAxB6B,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAwBtC;QAAD,CAAC,EAxBmB,SAAS,GAAT,eAAS,KAAT,eAAS,QAwB5B;IAAD,CAAC,EAxBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAwBlB;AAAD,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index 07b13ffe30c..5932454da19 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -246,32 +246,29 @@ sourceFile:recursiveClassReferenceTest.ts 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ 4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^ -10> ^ +5 > ^^^^^^^ +6 > ^^^^ +7 > ^ +8 > ^ +9 > ^ 1-> 2 > getId 3 > 4 > public getId() { -5 > return -6 > -7 > "yo" -8 > ; -9 > -10> } +5 > return +6 > "yo" +7 > ; +8 > +9 > } 1->Emitted(24, 21) Source(35, 10) + SourceIndex(0) 2 >Emitted(24, 52) Source(35, 15) + SourceIndex(0) 3 >Emitted(24, 55) Source(35, 3) + SourceIndex(0) 4 >Emitted(24, 69) Source(35, 20) + SourceIndex(0) -5 >Emitted(24, 75) Source(35, 26) + SourceIndex(0) -6 >Emitted(24, 76) Source(35, 27) + SourceIndex(0) -7 >Emitted(24, 80) Source(35, 31) + SourceIndex(0) -8 >Emitted(24, 81) Source(35, 32) + SourceIndex(0) -9 >Emitted(24, 82) Source(35, 33) + SourceIndex(0) -10>Emitted(24, 83) Source(35, 34) + SourceIndex(0) +5 >Emitted(24, 76) Source(35, 27) + SourceIndex(0) +6 >Emitted(24, 80) Source(35, 31) + SourceIndex(0) +7 >Emitted(24, 81) Source(35, 32) + SourceIndex(0) +8 >Emitted(24, 82) Source(35, 33) + SourceIndex(0) +9 >Emitted(24, 83) Source(35, 34) + SourceIndex(0) --- >>> StartFindAction.prototype.run = function (Thing) { 1 >^^^^^^^^^^^^^^^^^^^^ @@ -294,22 +291,19 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> return true; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ 1 >):boolean { > > -2 > return -3 > -4 > true -5 > ; +2 > return +3 > true +4 > ; 1 >Emitted(26, 25) Source(39, 4) + SourceIndex(0) -2 >Emitted(26, 31) Source(39, 10) + SourceIndex(0) -3 >Emitted(26, 32) Source(39, 11) + SourceIndex(0) -4 >Emitted(26, 36) Source(39, 15) + SourceIndex(0) -5 >Emitted(26, 37) Source(39, 16) + SourceIndex(0) +2 >Emitted(26, 32) Source(39, 11) + SourceIndex(0) +3 >Emitted(26, 36) Source(39, 15) + SourceIndex(0) +4 >Emitted(26, 37) Source(39, 16) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -754,80 +748,62 @@ sourceFile:recursiveClassReferenceTest.ts 4 > ^^^^^^^^^^ 5 > ^^^^^^ 6 > ^^^^ -7 > ^^ -8 > ^ -9 > ^ -10> ^^^^ -11> ^ -12> ^ -13> ^ +7 > ^^^^ +8 > ^^^^ +9 > ^^ 1-> 2 > gar 3 > 4 > public gar( 5 > runner:(widget:Sample.Thing.IWidget)=>any 6 > ) { -7 > if -8 > -9 > ( -10> true -11> ) -12> -13> { +7 > if ( +8 > true +9 > ) 1->Emitted(47, 17) Source(47, 10) + SourceIndex(0) 2 >Emitted(47, 41) Source(47, 13) + SourceIndex(0) 3 >Emitted(47, 44) Source(47, 3) + SourceIndex(0) 4 >Emitted(47, 54) Source(47, 14) + SourceIndex(0) 5 >Emitted(47, 60) Source(47, 55) + SourceIndex(0) 6 >Emitted(47, 64) Source(47, 59) + SourceIndex(0) -7 >Emitted(47, 66) Source(47, 61) + SourceIndex(0) -8 >Emitted(47, 67) Source(47, 62) + SourceIndex(0) -9 >Emitted(47, 68) Source(47, 63) + SourceIndex(0) -10>Emitted(47, 72) Source(47, 67) + SourceIndex(0) -11>Emitted(47, 73) Source(47, 68) + SourceIndex(0) -12>Emitted(47, 74) Source(47, 69) + SourceIndex(0) -13>Emitted(47, 75) Source(47, 70) + SourceIndex(0) +7 >Emitted(47, 68) Source(47, 63) + SourceIndex(0) +8 >Emitted(47, 72) Source(47, 67) + SourceIndex(0) +9 >Emitted(47, 74) Source(47, 69) + SourceIndex(0) --- >>> return runner(this); 1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ -6 > ^^^^ -7 > ^ -8 > ^ -1 > -2 > return -3 > -4 > runner -5 > ( -6 > this -7 > ) -8 > ; +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ +5 > ^^^^ +6 > ^ +7 > ^ +1 >{ +2 > return +3 > runner +4 > ( +5 > this +6 > ) +7 > ; 1 >Emitted(48, 21) Source(47, 70) + SourceIndex(0) -2 >Emitted(48, 27) Source(47, 76) + SourceIndex(0) -3 >Emitted(48, 28) Source(47, 77) + SourceIndex(0) -4 >Emitted(48, 34) Source(47, 83) + SourceIndex(0) -5 >Emitted(48, 35) Source(47, 84) + SourceIndex(0) -6 >Emitted(48, 39) Source(47, 88) + SourceIndex(0) -7 >Emitted(48, 40) Source(47, 89) + SourceIndex(0) -8 >Emitted(48, 41) Source(47, 90) + SourceIndex(0) +2 >Emitted(48, 28) Source(47, 77) + SourceIndex(0) +3 >Emitted(48, 34) Source(47, 83) + SourceIndex(0) +4 >Emitted(48, 35) Source(47, 84) + SourceIndex(0) +5 >Emitted(48, 39) Source(47, 88) + SourceIndex(0) +6 >Emitted(48, 40) Source(47, 89) + SourceIndex(0) +7 >Emitted(48, 41) Source(47, 90) + SourceIndex(0) --- >>> } }; -1 >^^^^^^^^^^^^^^^^ -2 > ^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 > } -3 > -4 > } -1 >Emitted(49, 17) Source(47, 90) + SourceIndex(0) -2 >Emitted(49, 18) Source(47, 91) + SourceIndex(0) -3 >Emitted(49, 19) Source(47, 91) + SourceIndex(0) -4 >Emitted(49, 20) Source(47, 92) + SourceIndex(0) +1 >^^^^^^^^^^^^^^^^^ +2 > ^ +3 > ^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >} +2 > +3 > } +1 >Emitted(49, 18) Source(47, 91) + SourceIndex(0) +2 >Emitted(49, 19) Source(47, 91) + SourceIndex(0) +3 >Emitted(49, 20) Source(47, 92) + SourceIndex(0) --- >>> FindWidget.prototype.getDomNode = function () { 1->^^^^^^^^^^^^^^^^ @@ -850,21 +826,18 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> return domNode; 1 >^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^ +4 > ^ 1 >public getDomNode() { > -2 > return -3 > -4 > domNode -5 > ; +2 > return +3 > domNode +4 > ; 1 >Emitted(51, 21) Source(56, 4) + SourceIndex(0) -2 >Emitted(51, 27) Source(56, 10) + SourceIndex(0) -3 >Emitted(51, 28) Source(56, 11) + SourceIndex(0) -4 >Emitted(51, 35) Source(56, 18) + SourceIndex(0) -5 >Emitted(51, 36) Source(56, 19) + SourceIndex(0) +2 >Emitted(51, 28) Source(56, 11) + SourceIndex(0) +3 >Emitted(51, 35) Source(56, 18) + SourceIndex(0) +4 >Emitted(51, 36) Source(56, 19) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -1148,32 +1121,29 @@ sourceFile:recursiveClassReferenceTest.ts 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ 4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^ -10> ^ +5 > ^^^^^^^ +6 > ^^^^ +7 > ^ +8 > ^ +9 > ^ 1-> 2 > getInitialState 3 > 4 > public getInitialState(): IState { -5 > return -6 > -7 > null -8 > ; -9 > -10> } +5 > return +6 > null +7 > ; +8 > +9 > } 1->Emitted(64, 5) Source(67, 46) + SourceIndex(0) 2 >Emitted(64, 43) Source(67, 61) + SourceIndex(0) 3 >Emitted(64, 46) Source(67, 39) + SourceIndex(0) 4 >Emitted(64, 60) Source(67, 74) + SourceIndex(0) -5 >Emitted(64, 66) Source(67, 80) + SourceIndex(0) -6 >Emitted(64, 67) Source(67, 81) + SourceIndex(0) -7 >Emitted(64, 71) Source(67, 85) + SourceIndex(0) -8 >Emitted(64, 72) Source(67, 86) + SourceIndex(0) -9 >Emitted(64, 73) Source(67, 86) + SourceIndex(0) -10>Emitted(64, 74) Source(67, 87) + SourceIndex(0) +5 >Emitted(64, 67) Source(67, 81) + SourceIndex(0) +6 >Emitted(64, 71) Source(67, 85) + SourceIndex(0) +7 >Emitted(64, 72) Source(67, 86) + SourceIndex(0) +8 >Emitted(64, 73) Source(67, 86) + SourceIndex(0) +9 >Emitted(64, 74) Source(67, 87) + SourceIndex(0) --- >>> return AbstractMode; 1 >^^^^ @@ -1431,21 +1401,18 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> return this; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ 1 >public clone():IState { > -2 > return -3 > -4 > this -5 > ; +2 > return +3 > this +4 > ; 1 >Emitted(79, 25) Source(81, 4) + SourceIndex(0) -2 >Emitted(79, 31) Source(81, 10) + SourceIndex(0) -3 >Emitted(79, 32) Source(81, 11) + SourceIndex(0) -4 >Emitted(79, 36) Source(81, 15) + SourceIndex(0) -5 >Emitted(79, 37) Source(81, 16) + SourceIndex(0) +2 >Emitted(79, 32) Source(81, 11) + SourceIndex(0) +3 >Emitted(79, 36) Source(81, 15) + SourceIndex(0) +4 >Emitted(79, 37) Source(81, 16) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1478,27 +1445,24 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> return this === other; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^^^^^ -6 > ^^^^^ -7 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^^^^^ +6 > ^ 1 >):boolean { > -2 > return -3 > -4 > this -5 > === -6 > other -7 > ; +2 > return +3 > this +4 > === +5 > other +6 > ; 1 >Emitted(82, 25) Source(85, 4) + SourceIndex(0) -2 >Emitted(82, 31) Source(85, 10) + SourceIndex(0) -3 >Emitted(82, 32) Source(85, 11) + SourceIndex(0) -4 >Emitted(82, 36) Source(85, 15) + SourceIndex(0) -5 >Emitted(82, 41) Source(85, 20) + SourceIndex(0) -6 >Emitted(82, 46) Source(85, 25) + SourceIndex(0) -7 >Emitted(82, 47) Source(85, 26) + SourceIndex(0) +2 >Emitted(82, 32) Source(85, 11) + SourceIndex(0) +3 >Emitted(82, 36) Source(85, 15) + SourceIndex(0) +4 >Emitted(82, 41) Source(85, 20) + SourceIndex(0) +5 >Emitted(82, 46) Source(85, 25) + SourceIndex(0) +6 >Emitted(82, 47) Source(85, 26) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1515,34 +1479,31 @@ sourceFile:recursiveClassReferenceTest.ts 2 > ^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ 4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^ -10> ^ +5 > ^^^^^^^ +6 > ^^^^ +7 > ^ +8 > ^ +9 > ^ 1-> > > public 2 > getMode 3 > 4 > public getMode(): IMode { -5 > return -6 > -7 > mode -8 > ; -9 > -10> } +5 > return +6 > mode +7 > ; +8 > +9 > } 1->Emitted(84, 21) Source(88, 10) + SourceIndex(0) 2 >Emitted(84, 44) Source(88, 17) + SourceIndex(0) 3 >Emitted(84, 47) Source(88, 3) + SourceIndex(0) 4 >Emitted(84, 61) Source(88, 29) + SourceIndex(0) -5 >Emitted(84, 67) Source(88, 35) + SourceIndex(0) -6 >Emitted(84, 68) Source(88, 36) + SourceIndex(0) -7 >Emitted(84, 72) Source(88, 40) + SourceIndex(0) -8 >Emitted(84, 73) Source(88, 41) + SourceIndex(0) -9 >Emitted(84, 74) Source(88, 42) + SourceIndex(0) -10>Emitted(84, 75) Source(88, 43) + SourceIndex(0) +5 >Emitted(84, 68) Source(88, 36) + SourceIndex(0) +6 >Emitted(84, 72) Source(88, 40) + SourceIndex(0) +7 >Emitted(84, 73) Source(88, 41) + SourceIndex(0) +8 >Emitted(84, 74) Source(88, 42) + SourceIndex(0) +9 >Emitted(84, 75) Source(88, 43) + SourceIndex(0) --- >>> return State; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1668,33 +1629,30 @@ sourceFile:recursiveClassReferenceTest.ts --- >>> return new State(self); 1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^^^^^ +5 > ^ +6 > ^^^^ +7 > ^ +8 > ^ 1 >public getInitialState(): IState { > -2 > return -3 > -4 > new -5 > State -6 > ( -7 > self -8 > ) -9 > ; +2 > return +3 > new +4 > State +5 > ( +6 > self +7 > ) +8 > ; 1 >Emitted(95, 25) Source(95, 4) + SourceIndex(0) -2 >Emitted(95, 31) Source(95, 10) + SourceIndex(0) -3 >Emitted(95, 32) Source(95, 11) + SourceIndex(0) -4 >Emitted(95, 36) Source(95, 15) + SourceIndex(0) -5 >Emitted(95, 41) Source(95, 20) + SourceIndex(0) -6 >Emitted(95, 42) Source(95, 21) + SourceIndex(0) -7 >Emitted(95, 46) Source(95, 25) + SourceIndex(0) -8 >Emitted(95, 47) Source(95, 26) + SourceIndex(0) -9 >Emitted(95, 48) Source(95, 27) + SourceIndex(0) +2 >Emitted(95, 32) Source(95, 11) + SourceIndex(0) +3 >Emitted(95, 36) Source(95, 15) + SourceIndex(0) +4 >Emitted(95, 41) Source(95, 20) + SourceIndex(0) +5 >Emitted(95, 42) Source(95, 21) + SourceIndex(0) +6 >Emitted(95, 46) Source(95, 25) + SourceIndex(0) +7 >Emitted(95, 47) Source(95, 26) + SourceIndex(0) +8 >Emitted(95, 48) Source(95, 27) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/sourceMap-Comments.js.map b/tests/baselines/reference/sourceMap-Comments.js.map index 1905d050a0b..a349925353d 100644 --- a/tests/baselines/reference/sourceMap-Comments.js.map +++ b/tests/baselines/reference/sourceMap-Comments.js.map @@ -1,2 +1,2 @@ //// [sourceMap-Comments.js.map] -{"version":3,"file":"sourceMap-Comments.js","sourceRoot":"","sources":["sourceMap-Comments.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkBT;AAlBD,WAAO,GAAG;IAAC,IAAA,KAAK,CAkBf;IAlBU,WAAA,KAAK;QACZ;YAAA;YAeA,CAAC;YAdU,kBAAG,GAAV;gBACI,IAAI,CAAC,GAAW,CAAC,CAAC;gBAClB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACR,KAAK,CAAC;wBACF,KAAK,CAAC;oBACV,KAAK,CAAC;wBACF,gBAAgB;wBAChB,gBAAgB;wBAChB,KAAK,CAAC;oBACV,KAAK,CAAC;wBACF,WAAW;wBACX,KAAK,CAAC;gBACd,CAAC;YACL,CAAC;YACL,WAAC;QAAD,CAAC,AAfD,IAeC;QAfY,UAAI,OAehB,CAAA;IAEL,CAAC,EAlBU,KAAK,GAAL,SAAK,KAAL,SAAK,QAkBf;AAAD,CAAC,EAlBM,GAAG,KAAH,GAAG,QAkBT"} \ No newline at end of file +{"version":3,"file":"sourceMap-Comments.js","sourceRoot":"","sources":["sourceMap-Comments.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkBT;AAlBD,WAAO,GAAG;IAAC,IAAA,KAAK,CAkBf;IAlBU,WAAA,KAAK;QACZ;YAAA;YAeA,CAAC;YAdU,kBAAG,GAAV;gBACI,IAAI,CAAC,GAAW,CAAC,CAAC;gBAClB,QAAQ,CAAC,EAAE;oBACP,KAAK,CAAC;wBACF,MAAM;oBACV,KAAK,CAAC;wBACF,gBAAgB;wBAChB,gBAAgB;wBAChB,MAAM;oBACV,KAAK,CAAC;wBACF,WAAW;wBACX,MAAM;iBACb;YACL,CAAC;YACL,WAAC;QAAD,CAAC,AAfD,IAeC;QAfY,UAAI,OAehB,CAAA;IAEL,CAAC,EAlBU,KAAK,GAAL,SAAK,KAAL,SAAK,QAkBf;AAAD,CAAC,EAlBM,GAAG,KAAH,GAAG,QAkBT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-Comments.sourcemap.txt b/tests/baselines/reference/sourceMap-Comments.sourcemap.txt index ab5c2293f35..ad3301e314a 100644 --- a/tests/baselines/reference/sourceMap-Comments.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-Comments.sourcemap.txt @@ -170,55 +170,41 @@ sourceFile:sourceMap-Comments.ts --- >>> switch (f) { 1->^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ +2 > ^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^-> 1-> > -2 > switch -3 > -4 > ( -5 > f -6 > ) -7 > -8 > { +2 > switch ( +3 > f +4 > ) 1->Emitted(10, 17) Source(5, 13) + SourceIndex(0) -2 >Emitted(10, 23) Source(5, 19) + SourceIndex(0) -3 >Emitted(10, 24) Source(5, 20) + SourceIndex(0) -4 >Emitted(10, 25) Source(5, 21) + SourceIndex(0) -5 >Emitted(10, 26) Source(5, 22) + SourceIndex(0) -6 >Emitted(10, 27) Source(5, 23) + SourceIndex(0) -7 >Emitted(10, 28) Source(5, 24) + SourceIndex(0) -8 >Emitted(10, 29) Source(5, 25) + SourceIndex(0) +2 >Emitted(10, 25) Source(5, 21) + SourceIndex(0) +3 >Emitted(10, 26) Source(5, 22) + SourceIndex(0) +4 >Emitted(10, 28) Source(5, 24) + SourceIndex(0) --- >>> case 1: -1 >^^^^^^^^^^^^^^^^^^^^ +1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^ 3 > ^ 4 > ^^^^^-> -1 > +1->{ > 2 > case 3 > 1 -1 >Emitted(11, 21) Source(6, 17) + SourceIndex(0) +1->Emitted(11, 21) Source(6, 17) + SourceIndex(0) 2 >Emitted(11, 26) Source(6, 22) + SourceIndex(0) 3 >Emitted(11, 27) Source(6, 23) + SourceIndex(0) --- >>> break; 1->^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1->: > -2 > break -3 > ; +2 > break; 1->Emitted(12, 25) Source(7, 21) + SourceIndex(0) -2 >Emitted(12, 30) Source(7, 26) + SourceIndex(0) -3 >Emitted(12, 31) Source(7, 27) + SourceIndex(0) +2 >Emitted(12, 31) Source(7, 27) + SourceIndex(0) --- >>> case 2: 1 >^^^^^^^^^^^^^^^^^^^^ @@ -254,15 +240,12 @@ sourceFile:sourceMap-Comments.ts --- >>> break; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1 > > -2 > break -3 > ; +2 > break; 1 >Emitted(16, 25) Source(11, 21) + SourceIndex(0) -2 >Emitted(16, 30) Source(11, 26) + SourceIndex(0) -3 >Emitted(16, 31) Source(11, 27) + SourceIndex(0) +2 >Emitted(16, 31) Source(11, 27) + SourceIndex(0) --- >>> case 3: 1 >^^^^^^^^^^^^^^^^^^^^ @@ -288,24 +271,18 @@ sourceFile:sourceMap-Comments.ts --- >>> break; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1 > > -2 > break -3 > ; +2 > break; 1 >Emitted(19, 25) Source(14, 21) + SourceIndex(0) -2 >Emitted(19, 30) Source(14, 26) + SourceIndex(0) -3 >Emitted(19, 31) Source(14, 27) + SourceIndex(0) +2 >Emitted(19, 31) Source(14, 27) + SourceIndex(0) --- >>> } -1 >^^^^^^^^^^^^^^^^ -2 > ^ +1 >^^^^^^^^^^^^^^^^^ 1 > - > -2 > } -1 >Emitted(20, 17) Source(15, 13) + SourceIndex(0) -2 >Emitted(20, 18) Source(15, 14) + SourceIndex(0) + > } +1 >Emitted(20, 18) Source(15, 14) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^ diff --git a/tests/baselines/reference/sourceMap-Comments2.js.map b/tests/baselines/reference/sourceMap-Comments2.js.map index e5a5387a72f..87814e66c57 100644 --- a/tests/baselines/reference/sourceMap-Comments2.js.map +++ b/tests/baselines/reference/sourceMap-Comments2.js.map @@ -1,2 +1,2 @@ //// [sourceMap-Comments2.js.map] -{"version":3,"file":"sourceMap-Comments2.js","sourceRoot":"","sources":["sourceMap-Comments2.ts"],"names":[],"mappings":"AAAA,aAAa,GAAW,EAAE,GAAW;IACjC,MAAM,CAAC;AACX,CAAC;AAED;;GAEG;AACH,aAAa,GAAW,EAAE,GAAW;IACjC,MAAM,CAAC;AACX,CAAC;AAED,uBAAuB;AACvB,aAAa,GAAW,EAAE,GAAW;IACjC,MAAM,CAAC;AACX,CAAC;AAED,aAAa,GAAW,EAAE,GAAW;IACjC,MAAM,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMap-Comments2.js","sourceRoot":"","sources":["sourceMap-Comments2.ts"],"names":[],"mappings":"AAAA,aAAa,GAAW,EAAE,GAAW;IACjC,OAAO;AACX,CAAC;AAED;;GAEG;AACH,aAAa,GAAW,EAAE,GAAW;IACjC,OAAO;AACX,CAAC;AAED,uBAAuB;AACvB,aAAa,GAAW,EAAE,GAAW;IACjC,OAAO;AACX,CAAC;AAED,aAAa,GAAW,EAAE,GAAW;IACjC,OAAO;AACX,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-Comments2.sourcemap.txt b/tests/baselines/reference/sourceMap-Comments2.sourcemap.txt index 88c78671f0f..4e77b4a51dd 100644 --- a/tests/baselines/reference/sourceMap-Comments2.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-Comments2.sourcemap.txt @@ -27,15 +27,12 @@ sourceFile:sourceMap-Comments2.ts --- >>> return; 1 >^^^^ -2 > ^^^^^^ -3 > ^ +2 > ^^^^^^^ 1 >): void { > -2 > return -3 > ; +2 > return; 1 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) -3 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +2 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) --- >>>} 1 > @@ -84,15 +81,12 @@ sourceFile:sourceMap-Comments2.ts --- >>> return; 1 >^^^^ -2 > ^^^^^^ -3 > ^ +2 > ^^^^^^^ 1 >): void { > -2 > return -3 > ; +2 > return; 1 >Emitted(8, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) +2 >Emitted(8, 12) Source(9, 12) + SourceIndex(0) --- >>>} 1 > @@ -135,15 +129,12 @@ sourceFile:sourceMap-Comments2.ts --- >>> return; 1 >^^^^ -2 > ^^^^^^ -3 > ^ +2 > ^^^^^^^ 1 >): void { > -2 > return -3 > ; +2 > return; 1 >Emitted(12, 5) Source(14, 5) + SourceIndex(0) -2 >Emitted(12, 11) Source(14, 11) + SourceIndex(0) -3 >Emitted(12, 12) Source(14, 12) + SourceIndex(0) +2 >Emitted(12, 12) Source(14, 12) + SourceIndex(0) --- >>>} 1 > @@ -176,15 +167,12 @@ sourceFile:sourceMap-Comments2.ts --- >>> return; 1 >^^^^ -2 > ^^^^^^ -3 > ^ +2 > ^^^^^^^ 1 >): void { > -2 > return -3 > ; +2 > return; 1 >Emitted(15, 5) Source(18, 5) + SourceIndex(0) -2 >Emitted(15, 11) Source(18, 11) + SourceIndex(0) -3 >Emitted(15, 12) Source(18, 12) + SourceIndex(0) +2 >Emitted(15, 12) Source(18, 12) + SourceIndex(0) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMap-FileWithComments.js.map b/tests/baselines/reference/sourceMap-FileWithComments.js.map index 073fa862fc7..d874bba1c4f 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.js.map +++ b/tests/baselines/reference/sourceMap-FileWithComments.js.map @@ -1,2 +1,2 @@ //// [sourceMap-FileWithComments.js.map] -{"version":3,"file":"sourceMap-FileWithComments.js","sourceRoot":"","sources":["sourceMap-FileWithComments.ts"],"names":[],"mappings":"AAKA,SAAS;AACT,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAET,QAAQ;IACR;QACI,cAAc;QACd,eAAmB,CAAS,EAAS,CAAS;YAA3B,MAAC,GAAD,CAAC,CAAQ;YAAS,MAAC,GAAD,CAAC,CAAQ;QAAI,CAAC;QAEnD,kBAAkB;QAClB,uBAAO,GAAP,cAAY,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAElE,gBAAgB;QACT,YAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpC,YAAC;KAAA,AATD,IASC;IATY,YAAK,QASjB,CAAA;IAED,+BAA+B;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX;IACA,CAAC;IADe,UAAG,MAClB,CAAA;IAED;;MAEE;IACF,IAAI,CAAC,GAAG,EAAE,CAAC;AACf,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ;AAED,qBAAqB;AACrB,IAAI,CAAC,GAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMap-FileWithComments.js","sourceRoot":"","sources":["sourceMap-FileWithComments.ts"],"names":[],"mappings":"AAKA,SAAS;AACT,IAAO,MAAM,CAwBZ;AAxBD,WAAO,MAAM;IAET,QAAQ;IACR;QACI,cAAc;QACd,eAAmB,CAAS,EAAS,CAAS;YAA3B,MAAC,GAAD,CAAC,CAAQ;YAAS,MAAC,GAAD,CAAC,CAAQ;QAAI,CAAC;QAEnD,kBAAkB;QAClB,uBAAO,GAAP,cAAY,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAElE,gBAAgB;QACT,YAAM,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpC,YAAC;KAAA,AATD,IASC;IATY,YAAK,QASjB,CAAA;IAED,+BAA+B;IAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX;IACA,CAAC;IADe,UAAG,MAClB,CAAA;IAED;;MAEE;IACF,IAAI,CAAC,GAAG,EAAE,CAAC;AACf,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ;AAED,qBAAqB;AACrB,IAAI,CAAC,GAAW,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt index 7ab22e9d0ad..57a06f4522b 100644 --- a/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-FileWithComments.sourcemap.txt @@ -179,90 +179,87 @@ sourceFile:sourceMap-FileWithComments.ts 2 > ^^^^^^^^^^^^^^^^^^^^^^^ 3 > ^^^ 4 > ^^^^^^^^^^^^^^ -5 > ^^^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^^^^ -10> ^ -11> ^^^^ -12> ^ -13> ^ -14> ^^^ -15> ^^^^ -16> ^ -17> ^ -18> ^^^ -19> ^^^^ -20> ^ -21> ^ -22> ^^^ -23> ^^^^ -24> ^ -25> ^ -26> ^ -27> ^ -28> ^ -29> ^ +5 > ^^^^^^^ +6 > ^^^^ +7 > ^ +8 > ^^^^ +9 > ^ +10> ^^^^ +11> ^ +12> ^ +13> ^^^ +14> ^^^^ +15> ^ +16> ^ +17> ^^^ +18> ^^^^ +19> ^ +20> ^ +21> ^^^ +22> ^^^^ +23> ^ +24> ^ +25> ^ +26> ^ +27> ^ +28> ^ 1-> > 2 > getDist 3 > 4 > getDist() { -5 > return -6 > -7 > Math -8 > . -9 > sqrt -10> ( -11> this -12> . -13> x -14> * -15> this -16> . -17> x -18> + -19> this -20> . -21> y -22> * -23> this -24> . -25> y -26> ) -27> ; -28> -29> } +5 > return +6 > Math +7 > . +8 > sqrt +9 > ( +10> this +11> . +12> x +13> * +14> this +15> . +16> x +17> + +18> this +19> . +20> y +21> * +22> this +23> . +24> y +25> ) +26> ; +27> +28> } 1->Emitted(12, 9) Source(15, 9) + SourceIndex(0) 2 >Emitted(12, 32) Source(15, 16) + SourceIndex(0) 3 >Emitted(12, 35) Source(15, 9) + SourceIndex(0) 4 >Emitted(12, 49) Source(15, 21) + SourceIndex(0) -5 >Emitted(12, 55) Source(15, 27) + SourceIndex(0) -6 >Emitted(12, 56) Source(15, 28) + SourceIndex(0) -7 >Emitted(12, 60) Source(15, 32) + SourceIndex(0) -8 >Emitted(12, 61) Source(15, 33) + SourceIndex(0) -9 >Emitted(12, 65) Source(15, 37) + SourceIndex(0) -10>Emitted(12, 66) Source(15, 38) + SourceIndex(0) -11>Emitted(12, 70) Source(15, 42) + SourceIndex(0) -12>Emitted(12, 71) Source(15, 43) + SourceIndex(0) -13>Emitted(12, 72) Source(15, 44) + SourceIndex(0) -14>Emitted(12, 75) Source(15, 47) + SourceIndex(0) -15>Emitted(12, 79) Source(15, 51) + SourceIndex(0) -16>Emitted(12, 80) Source(15, 52) + SourceIndex(0) -17>Emitted(12, 81) Source(15, 53) + SourceIndex(0) -18>Emitted(12, 84) Source(15, 56) + SourceIndex(0) -19>Emitted(12, 88) Source(15, 60) + SourceIndex(0) -20>Emitted(12, 89) Source(15, 61) + SourceIndex(0) -21>Emitted(12, 90) Source(15, 62) + SourceIndex(0) -22>Emitted(12, 93) Source(15, 65) + SourceIndex(0) -23>Emitted(12, 97) Source(15, 69) + SourceIndex(0) -24>Emitted(12, 98) Source(15, 70) + SourceIndex(0) -25>Emitted(12, 99) Source(15, 71) + SourceIndex(0) -26>Emitted(12, 100) Source(15, 72) + SourceIndex(0) -27>Emitted(12, 101) Source(15, 73) + SourceIndex(0) -28>Emitted(12, 102) Source(15, 74) + SourceIndex(0) -29>Emitted(12, 103) Source(15, 75) + SourceIndex(0) +5 >Emitted(12, 56) Source(15, 28) + SourceIndex(0) +6 >Emitted(12, 60) Source(15, 32) + SourceIndex(0) +7 >Emitted(12, 61) Source(15, 33) + SourceIndex(0) +8 >Emitted(12, 65) Source(15, 37) + SourceIndex(0) +9 >Emitted(12, 66) Source(15, 38) + SourceIndex(0) +10>Emitted(12, 70) Source(15, 42) + SourceIndex(0) +11>Emitted(12, 71) Source(15, 43) + SourceIndex(0) +12>Emitted(12, 72) Source(15, 44) + SourceIndex(0) +13>Emitted(12, 75) Source(15, 47) + SourceIndex(0) +14>Emitted(12, 79) Source(15, 51) + SourceIndex(0) +15>Emitted(12, 80) Source(15, 52) + SourceIndex(0) +16>Emitted(12, 81) Source(15, 53) + SourceIndex(0) +17>Emitted(12, 84) Source(15, 56) + SourceIndex(0) +18>Emitted(12, 88) Source(15, 60) + SourceIndex(0) +19>Emitted(12, 89) Source(15, 61) + SourceIndex(0) +20>Emitted(12, 90) Source(15, 62) + SourceIndex(0) +21>Emitted(12, 93) Source(15, 65) + SourceIndex(0) +22>Emitted(12, 97) Source(15, 69) + SourceIndex(0) +23>Emitted(12, 98) Source(15, 70) + SourceIndex(0) +24>Emitted(12, 99) Source(15, 71) + SourceIndex(0) +25>Emitted(12, 100) Source(15, 72) + SourceIndex(0) +26>Emitted(12, 101) Source(15, 73) + SourceIndex(0) +27>Emitted(12, 102) Source(15, 74) + SourceIndex(0) +28>Emitted(12, 103) Source(15, 75) + SourceIndex(0) --- >>> // Static member 1 >^^^^^^^^ diff --git a/tests/baselines/reference/sourceMap-SkippedNode.js.map b/tests/baselines/reference/sourceMap-SkippedNode.js.map index f3444919d41..96bd1ada996 100644 --- a/tests/baselines/reference/sourceMap-SkippedNode.js.map +++ b/tests/baselines/reference/sourceMap-SkippedNode.js.map @@ -1,2 +1,2 @@ //// [sourceMap-SkippedNode.js.map] -{"version":3,"file":"sourceMap-SkippedNode.js","sourceRoot":"","sources":["sourceMap-SkippedNode.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC;IACL,MAAM;AACN,CAAC;QAAS,CAAC;IACX,wBAAwB;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMap-SkippedNode.js","sourceRoot":"","sources":["sourceMap-SkippedNode.ts"],"names":[],"mappings":"AAAA,IAAI;IACJ,MAAM;CACL;QAAS;IACV,wBAAwB;CACvB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMap-SkippedNode.sourcemap.txt b/tests/baselines/reference/sourceMap-SkippedNode.sourcemap.txt index c54676a697e..20f42f722a7 100644 --- a/tests/baselines/reference/sourceMap-SkippedNode.sourcemap.txt +++ b/tests/baselines/reference/sourceMap-SkippedNode.sourcemap.txt @@ -11,60 +11,48 @@ sourceFile:sourceMap-SkippedNode.ts >>>try { 1 > 2 >^^^^ -3 > ^ -4 > ^^^^^^-> +3 > ^^^^^^^-> 1 > 2 >try -3 > { 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) 2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) --- >>> // ... 1->^^^^ 2 > ^^^^^^ -1-> +1->{ > 2 > // ... 1->Emitted(2, 5) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 11) Source(2, 7) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) + >} +1 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) --- >>>finally { 1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^^^^^^-> 1-> finally -2 > { 1->Emitted(4, 9) Source(3, 11) + SourceIndex(0) -2 >Emitted(4, 10) Source(3, 12) + SourceIndex(0) --- >>> // N.B. No 'catch' block 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^ -1-> +1->{ > 2 > // N.B. No 'catch' block 1->Emitted(5, 5) Source(4, 1) + SourceIndex(0) 2 >Emitted(5, 29) Source(4, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(6, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) + >} +1 >Emitted(6, 2) Source(5, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMap-SkippedNode.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.js.map b/tests/baselines/reference/sourceMapSample.js.map index 783ff610f66..46371b5454b 100644 --- a/tests/baselines/reference/sourceMapSample.js.map +++ b/tests/baselines/reference/sourceMapSample.js.map @@ -1,2 +1,2 @@ //// [sourceMapSample.js.map] -{"version":3,"file":"sourceMapSample.js","sourceRoot":"","sources":["sourceMapSample.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkCT;AAlCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAkCb;IAlCU,WAAA,GAAG;QACV,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,uBAA0B;iBAA1B,UAA0B,EAA1B,qBAA0B,EAA1B,IAA0B;gBAA1B,sCAA0B;;YACtD,IAAI,QAAQ,GAAc,EAAE,CAAC;YAC7B,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAlCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAkCb;AAAD,CAAC,EAlCM,GAAG,KAAH,GAAG,QAkCT"} \ No newline at end of file +{"version":3,"file":"sourceMapSample.js","sourceRoot":"","sources":["sourceMapSample.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAkCT;AAlCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAkCb;IAlCU,WAAA,GAAG;QACV,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,OAAO,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,uBAA0B;iBAA1B,UAA0B,EAA1B,qBAA0B,EAA1B,IAA0B;gBAA1B,sCAA0B;;YACtD,IAAI,QAAQ,GAAc,EAAE,CAAC;YAC7B,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC3C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAChD;YAED,OAAO,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;SAChB;IACL,CAAC,EAlCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAkCb;AAAD,CAAC,EAlCM,GAAG,KAAH,GAAG,QAkCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapSample.sourcemap.txt b/tests/baselines/reference/sourceMapSample.sourcemap.txt index a24bb2cbb06..2e500263136 100644 --- a/tests/baselines/reference/sourceMapSample.sourcemap.txt +++ b/tests/baselines/reference/sourceMapSample.sourcemap.txt @@ -206,39 +206,36 @@ sourceFile:sourceMapSample.ts --- >>> return "

" + this.greeting + "

"; 1->^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^^^ -6 > ^^^^ -7 > ^ -8 > ^^^^^^^^ -9 > ^^^ -10> ^^^^^^^ -11> ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^ +7 > ^^^^^^^^ +8 > ^^^ +9 > ^^^^^^^ +10> ^ 1->greet() { > -2 > return -3 > -4 > "

" -5 > + -6 > this -7 > . -8 > greeting -9 > + -10> "

" -11> ; +2 > return +3 > "

" +4 > + +5 > this +6 > . +7 > greeting +8 > + +9 > "

" +10> ; 1->Emitted(11, 17) Source(9, 13) + SourceIndex(0) -2 >Emitted(11, 23) Source(9, 19) + SourceIndex(0) -3 >Emitted(11, 24) Source(9, 20) + SourceIndex(0) -4 >Emitted(11, 30) Source(9, 26) + SourceIndex(0) -5 >Emitted(11, 33) Source(9, 29) + SourceIndex(0) -6 >Emitted(11, 37) Source(9, 33) + SourceIndex(0) -7 >Emitted(11, 38) Source(9, 34) + SourceIndex(0) -8 >Emitted(11, 46) Source(9, 42) + SourceIndex(0) -9 >Emitted(11, 49) Source(9, 45) + SourceIndex(0) -10>Emitted(11, 56) Source(9, 52) + SourceIndex(0) -11>Emitted(11, 57) Source(9, 53) + SourceIndex(0) +2 >Emitted(11, 24) Source(9, 20) + SourceIndex(0) +3 >Emitted(11, 30) Source(9, 26) + SourceIndex(0) +4 >Emitted(11, 33) Source(9, 29) + SourceIndex(0) +5 >Emitted(11, 37) Source(9, 33) + SourceIndex(0) +6 >Emitted(11, 38) Source(9, 34) + SourceIndex(0) +7 >Emitted(11, 46) Source(9, 42) + SourceIndex(0) +8 >Emitted(11, 49) Source(9, 45) + SourceIndex(0) +9 >Emitted(11, 56) Source(9, 52) + SourceIndex(0) +10>Emitted(11, 57) Source(9, 53) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^ @@ -298,33 +295,30 @@ sourceFile:sourceMapSample.ts --- >>> return new Greeter(greeting); 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^^^^^^^ -6 > ^ -7 > ^^^^^^^^ -8 > ^ -9 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ 1->): Foo.Bar.Greeter { > -2 > return -3 > -4 > new -5 > Greeter -6 > ( -7 > greeting -8 > ) -9 > ; +2 > return +3 > new +4 > Greeter +5 > ( +6 > greeting +7 > ) +8 > ; 1->Emitted(16, 13) Source(15, 9) + SourceIndex(0) -2 >Emitted(16, 19) Source(15, 15) + SourceIndex(0) -3 >Emitted(16, 20) Source(15, 16) + SourceIndex(0) -4 >Emitted(16, 24) Source(15, 20) + SourceIndex(0) -5 >Emitted(16, 31) Source(15, 27) + SourceIndex(0) -6 >Emitted(16, 32) Source(15, 28) + SourceIndex(0) -7 >Emitted(16, 40) Source(15, 36) + SourceIndex(0) -8 >Emitted(16, 41) Source(15, 37) + SourceIndex(0) -9 >Emitted(16, 42) Source(15, 38) + SourceIndex(0) +2 >Emitted(16, 20) Source(15, 16) + SourceIndex(0) +3 >Emitted(16, 24) Source(15, 20) + SourceIndex(0) +4 >Emitted(16, 31) Source(15, 27) + SourceIndex(0) +5 >Emitted(16, 32) Source(15, 28) + SourceIndex(0) +6 >Emitted(16, 40) Source(15, 36) + SourceIndex(0) +7 >Emitted(16, 41) Source(15, 37) + SourceIndex(0) +8 >Emitted(16, 42) Source(15, 38) + SourceIndex(0) --- >>> } 1 >^^^^^^^^ @@ -516,64 +510,55 @@ sourceFile:sourceMapSample.ts --- >>> for (var i = 0; i < restGreetings.length; i++) { 1->^^^^^^^^^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^^^^^^^^^^^^ -13> ^ -14> ^^^^^^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ -20> ^^-> +2 > ^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^^^^^^^^^^^^^ +11> ^ +12> ^^^^^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ +17> ^^^-> 1-> > -2 > for -3 > -4 > ( -5 > var -6 > i -7 > = -8 > 0 -9 > ; -10> i -11> < -12> restGreetings -13> . -14> length -15> ; -16> i -17> ++ -18> ) -19> { +2 > for ( +3 > var +4 > i +5 > = +6 > 0 +7 > ; +8 > i +9 > < +10> restGreetings +11> . +12> length +13> ; +14> i +15> ++ +16> ) 1->Emitted(27, 13) Source(24, 9) + SourceIndex(0) -2 >Emitted(27, 16) Source(24, 12) + SourceIndex(0) -3 >Emitted(27, 17) Source(24, 13) + SourceIndex(0) -4 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) -5 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) -6 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) -7 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) -8 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) -9 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) -10>Emitted(27, 30) Source(24, 26) + SourceIndex(0) -11>Emitted(27, 33) Source(24, 29) + SourceIndex(0) -12>Emitted(27, 46) Source(24, 42) + SourceIndex(0) -13>Emitted(27, 47) Source(24, 43) + SourceIndex(0) -14>Emitted(27, 53) Source(24, 49) + SourceIndex(0) -15>Emitted(27, 55) Source(24, 51) + SourceIndex(0) -16>Emitted(27, 56) Source(24, 52) + SourceIndex(0) -17>Emitted(27, 58) Source(24, 54) + SourceIndex(0) -18>Emitted(27, 60) Source(24, 56) + SourceIndex(0) -19>Emitted(27, 61) Source(24, 57) + SourceIndex(0) +2 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) +3 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) +4 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) +5 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) +6 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) +7 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) +8 >Emitted(27, 30) Source(24, 26) + SourceIndex(0) +9 >Emitted(27, 33) Source(24, 29) + SourceIndex(0) +10>Emitted(27, 46) Source(24, 42) + SourceIndex(0) +11>Emitted(27, 47) Source(24, 43) + SourceIndex(0) +12>Emitted(27, 53) Source(24, 49) + SourceIndex(0) +13>Emitted(27, 55) Source(24, 51) + SourceIndex(0) +14>Emitted(27, 56) Source(24, 52) + SourceIndex(0) +15>Emitted(27, 58) Source(24, 54) + SourceIndex(0) +16>Emitted(27, 60) Source(24, 56) + SourceIndex(0) --- >>> greeters.push(new Greeter(restGreetings[i])); 1->^^^^^^^^^^^^^^^^ @@ -591,7 +576,7 @@ sourceFile:sourceMapSample.ts 13> ^ 14> ^ 15> ^ -1-> +1->{ > 2 > greeters 3 > . @@ -624,33 +609,27 @@ sourceFile:sourceMapSample.ts 15>Emitted(28, 62) Source(25, 58) + SourceIndex(0) --- >>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> +1 >^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(29, 13) Source(26, 9) + SourceIndex(0) -2 >Emitted(29, 14) Source(26, 10) + SourceIndex(0) + > } +1 >Emitted(29, 14) Source(26, 10) + SourceIndex(0) --- >>> return greeters; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^ +4 > ^ 1-> > > -2 > return -3 > -4 > greeters -5 > ; +2 > return +3 > greeters +4 > ; 1->Emitted(30, 13) Source(28, 9) + SourceIndex(0) -2 >Emitted(30, 19) Source(28, 15) + SourceIndex(0) -3 >Emitted(30, 20) Source(28, 16) + SourceIndex(0) -4 >Emitted(30, 28) Source(28, 24) + SourceIndex(0) -5 >Emitted(30, 29) Source(28, 25) + SourceIndex(0) +2 >Emitted(30, 20) Source(28, 16) + SourceIndex(0) +3 >Emitted(30, 28) Source(28, 24) + SourceIndex(0) +4 >Emitted(30, 29) Source(28, 25) + SourceIndex(0) --- >>> } 1 >^^^^^^^^ @@ -708,63 +687,54 @@ sourceFile:sourceMapSample.ts --- >>> for (var j = 0; j < b.length; j++) { 1->^^^^^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^ -14> ^^^^^^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 > ^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^ +12> ^^^^^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 > for -3 > -4 > ( -5 > var -6 > j -7 > = -8 > 0 -9 > ; -10> j -11> < -12> b -13> . -14> length -15> ; -16> j -17> ++ -18> ) -19> { +2 > for ( +3 > var +4 > j +5 > = +6 > 0 +7 > ; +8 > j +9 > < +10> b +11> . +12> length +13> ; +14> j +15> ++ +16> ) 1->Emitted(33, 9) Source(32, 5) + SourceIndex(0) -2 >Emitted(33, 12) Source(32, 8) + SourceIndex(0) -3 >Emitted(33, 13) Source(32, 9) + SourceIndex(0) -4 >Emitted(33, 14) Source(32, 10) + SourceIndex(0) -5 >Emitted(33, 18) Source(32, 14) + SourceIndex(0) -6 >Emitted(33, 19) Source(32, 15) + SourceIndex(0) -7 >Emitted(33, 22) Source(32, 18) + SourceIndex(0) -8 >Emitted(33, 23) Source(32, 19) + SourceIndex(0) -9 >Emitted(33, 25) Source(32, 21) + SourceIndex(0) -10>Emitted(33, 26) Source(32, 22) + SourceIndex(0) -11>Emitted(33, 29) Source(32, 25) + SourceIndex(0) -12>Emitted(33, 30) Source(32, 26) + SourceIndex(0) -13>Emitted(33, 31) Source(32, 27) + SourceIndex(0) -14>Emitted(33, 37) Source(32, 33) + SourceIndex(0) -15>Emitted(33, 39) Source(32, 35) + SourceIndex(0) -16>Emitted(33, 40) Source(32, 36) + SourceIndex(0) -17>Emitted(33, 42) Source(32, 38) + SourceIndex(0) -18>Emitted(33, 44) Source(32, 40) + SourceIndex(0) -19>Emitted(33, 45) Source(32, 41) + SourceIndex(0) +2 >Emitted(33, 14) Source(32, 10) + SourceIndex(0) +3 >Emitted(33, 18) Source(32, 14) + SourceIndex(0) +4 >Emitted(33, 19) Source(32, 15) + SourceIndex(0) +5 >Emitted(33, 22) Source(32, 18) + SourceIndex(0) +6 >Emitted(33, 23) Source(32, 19) + SourceIndex(0) +7 >Emitted(33, 25) Source(32, 21) + SourceIndex(0) +8 >Emitted(33, 26) Source(32, 22) + SourceIndex(0) +9 >Emitted(33, 29) Source(32, 25) + SourceIndex(0) +10>Emitted(33, 30) Source(32, 26) + SourceIndex(0) +11>Emitted(33, 31) Source(32, 27) + SourceIndex(0) +12>Emitted(33, 37) Source(32, 33) + SourceIndex(0) +13>Emitted(33, 39) Source(32, 35) + SourceIndex(0) +14>Emitted(33, 40) Source(32, 36) + SourceIndex(0) +15>Emitted(33, 42) Source(32, 38) + SourceIndex(0) +16>Emitted(33, 44) Source(32, 40) + SourceIndex(0) --- >>> b[j].greet(); 1 >^^^^^^^^^^^^ @@ -776,7 +746,7 @@ sourceFile:sourceMapSample.ts 7 > ^^^^^ 8 > ^^ 9 > ^ -1 > +1 >{ > 2 > b 3 > [ @@ -797,14 +767,11 @@ sourceFile:sourceMapSample.ts 9 >Emitted(34, 26) Source(33, 22) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(35, 9) Source(34, 5) + SourceIndex(0) -2 >Emitted(35, 10) Source(34, 6) + SourceIndex(0) + > } +1 >Emitted(35, 10) Source(34, 6) + SourceIndex(0) --- >>> })(Bar = Foo.Bar || (Foo.Bar = {})); 1->^^^^ diff --git a/tests/baselines/reference/sourceMapValidationClass.js.map b/tests/baselines/reference/sourceMapValidationClass.js.map index 8baf4772a27..73efa147b8a 100644 --- a/tests/baselines/reference/sourceMapValidationClass.js.map +++ b/tests/baselines/reference/sourceMapValidationClass.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClass.js.map] -{"version":3,"file":"sourceMapValidationClass.js","sourceRoot":"","sources":["sourceMapValidationClass.ts"],"names":[],"mappings":"AAAA;IACI,iBAAmB,QAAgB;QAAE,WAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,0BAAc;;QAAhC,aAAQ,GAAR,QAAQ,CAAQ;QAM3B,OAAE,GAAW,EAAE,CAAC;IALxB,CAAC;IACD,uBAAK,GAAL;QACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5C,CAAC;IAGO,oBAAE,GAAV;QACI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,sBAAI,8BAAS;aAAb;YACI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aACD,UAAc,SAAiB;YAC3B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC9B,CAAC;;;OAHA;IAIL,cAAC;AAAD,CAAC,AAjBD,IAiBC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClass.js","sourceRoot":"","sources":["sourceMapValidationClass.ts"],"names":[],"mappings":"AAAA;IACI,iBAAmB,QAAgB;QAAE,WAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,0BAAc;;QAAhC,aAAQ,GAAR,QAAQ,CAAQ;QAM3B,OAAE,GAAW,EAAE,CAAC;IALxB,CAAC;IACD,uBAAK,GAAL;QACI,OAAO,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5C,CAAC;IAGO,oBAAE,GAAV;QACI,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,sBAAI,8BAAS;aAAb;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aACD,UAAc,SAAiB;YAC3B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC9B,CAAC;;;OAHA;IAIL,cAAC;AAAD,CAAC,AAjBD,IAiBC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt index 137b83e230f..be1665313a1 100644 --- a/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClass.sourcemap.txt @@ -128,39 +128,36 @@ sourceFile:sourceMapValidationClass.ts --- >>> return "

" + this.greeting + "

"; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^^^ -6 > ^^^^ -7 > ^ -8 > ^^^^^^^^ -9 > ^^^ -10> ^^^^^^^ -11> ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^ +7 > ^^^^^^^^ +8 > ^^^ +9 > ^^^^^^^ +10> ^ 1->greet() { > -2 > return -3 > -4 > "

" -5 > + -6 > this -7 > . -8 > greeting -9 > + -10> "

" -11> ; +2 > return +3 > "

" +4 > + +5 > this +6 > . +7 > greeting +8 > + +9 > "

" +10> ; 1->Emitted(11, 9) Source(5, 9) + SourceIndex(0) -2 >Emitted(11, 15) Source(5, 15) + SourceIndex(0) -3 >Emitted(11, 16) Source(5, 16) + SourceIndex(0) -4 >Emitted(11, 22) Source(5, 22) + SourceIndex(0) -5 >Emitted(11, 25) Source(5, 25) + SourceIndex(0) -6 >Emitted(11, 29) Source(5, 29) + SourceIndex(0) -7 >Emitted(11, 30) Source(5, 30) + SourceIndex(0) -8 >Emitted(11, 38) Source(5, 38) + SourceIndex(0) -9 >Emitted(11, 41) Source(5, 41) + SourceIndex(0) -10>Emitted(11, 48) Source(5, 48) + SourceIndex(0) -11>Emitted(11, 49) Source(5, 49) + SourceIndex(0) +2 >Emitted(11, 16) Source(5, 16) + SourceIndex(0) +3 >Emitted(11, 22) Source(5, 22) + SourceIndex(0) +4 >Emitted(11, 25) Source(5, 25) + SourceIndex(0) +5 >Emitted(11, 29) Source(5, 29) + SourceIndex(0) +6 >Emitted(11, 30) Source(5, 30) + SourceIndex(0) +7 >Emitted(11, 38) Source(5, 38) + SourceIndex(0) +8 >Emitted(11, 41) Source(5, 41) + SourceIndex(0) +9 >Emitted(11, 48) Source(5, 48) + SourceIndex(0) +10>Emitted(11, 49) Source(5, 49) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -189,27 +186,24 @@ sourceFile:sourceMapValidationClass.ts --- >>> return this.greeting; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -6 > ^^^^^^^^ -7 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^ 1->private fn() { > -2 > return -3 > -4 > this -5 > . -6 > greeting -7 > ; +2 > return +3 > this +4 > . +5 > greeting +6 > ; 1->Emitted(14, 9) Source(10, 9) + SourceIndex(0) -2 >Emitted(14, 15) Source(10, 15) + SourceIndex(0) -3 >Emitted(14, 16) Source(10, 16) + SourceIndex(0) -4 >Emitted(14, 20) Source(10, 20) + SourceIndex(0) -5 >Emitted(14, 21) Source(10, 21) + SourceIndex(0) -6 >Emitted(14, 29) Source(10, 29) + SourceIndex(0) -7 >Emitted(14, 30) Source(10, 30) + SourceIndex(0) +2 >Emitted(14, 16) Source(10, 16) + SourceIndex(0) +3 >Emitted(14, 20) Source(10, 20) + SourceIndex(0) +4 >Emitted(14, 21) Source(10, 21) + SourceIndex(0) +5 >Emitted(14, 29) Source(10, 29) + SourceIndex(0) +6 >Emitted(14, 30) Source(10, 30) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -241,27 +235,24 @@ sourceFile:sourceMapValidationClass.ts --- >>> return this.greeting; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -6 > ^^^^^^^^ -7 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^ 1->get greetings() { > -2 > return -3 > -4 > this -5 > . -6 > greeting -7 > ; +2 > return +3 > this +4 > . +5 > greeting +6 > ; 1->Emitted(18, 13) Source(13, 9) + SourceIndex(0) -2 >Emitted(18, 19) Source(13, 15) + SourceIndex(0) -3 >Emitted(18, 20) Source(13, 16) + SourceIndex(0) -4 >Emitted(18, 24) Source(13, 20) + SourceIndex(0) -5 >Emitted(18, 25) Source(13, 21) + SourceIndex(0) -6 >Emitted(18, 33) Source(13, 29) + SourceIndex(0) -7 >Emitted(18, 34) Source(13, 30) + SourceIndex(0) +2 >Emitted(18, 20) Source(13, 16) + SourceIndex(0) +3 >Emitted(18, 24) Source(13, 20) + SourceIndex(0) +4 >Emitted(18, 25) Source(13, 21) + SourceIndex(0) +5 >Emitted(18, 33) Source(13, 29) + SourceIndex(0) +6 >Emitted(18, 34) Source(13, 30) + SourceIndex(0) --- >>> }, 1 >^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationClasses.js.map b/tests/baselines/reference/sourceMapValidationClasses.js.map index 294ce8b315d..e2f94e19d1c 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.js.map +++ b/tests/baselines/reference/sourceMapValidationClasses.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClasses.js.map] -{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAmCb;IAnCU,WAAA,GAAG;QACV,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,kBAAiB,mBAAmB,MAAU;iBAA9C,UAA8C,EAA9C,qBAA8C,EAA9C,IAA8C;gBAA9C,sCAA8C;;YAC1E,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC5C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,qCAAqC;QACrC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,EAnCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAmCb;AAAD,CAAC,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":[],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAAC,IAAA,GAAG,CAmCb;IAnCU,WAAA,GAAG;QACV,YAAY,CAAC;QAEb;YACI,iBAAmB,QAAgB;gBAAhB,aAAQ,GAAR,QAAQ,CAAQ;YACnC,CAAC;YAED,uBAAK,GAAL;gBACI,OAAO,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAC5C,CAAC;YACL,cAAC;QAAD,CAAC,AAPD,IAOC;QAGD,aAAa,QAAgB;YACzB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;QAC3C,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAE1B,cAAc,QAAgB;YAAE,kBAAiB,mBAAmB,MAAU;iBAA9C,UAA8C,EAA9C,qBAA8C,EAA9C,IAA8C;gBAA9C,sCAA8C;;YAC1E,IAAI,QAAQ,GAAc,EAAE,CAAC,CAAC,0BAA0B;YACxD,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;YACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC3C,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAChD;YAED,OAAO,QAAQ,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;QACpC,qCAAqC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC/B,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;SAChB;IACL,CAAC,EAnCU,GAAG,GAAH,OAAG,KAAH,OAAG,QAmCb;AAAD,CAAC,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt index efe8c68b7b7..b166228df2d 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -208,39 +208,36 @@ sourceFile:sourceMapValidationClasses.ts --- >>> return "

" + this.greeting + "

"; 1->^^^^^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^^^ -6 > ^^^^ -7 > ^ -8 > ^^^^^^^^ -9 > ^^^ -10> ^^^^^^^ -11> ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^ +7 > ^^^^^^^^ +8 > ^^^ +9 > ^^^^^^^ +10> ^ 1->greet() { > -2 > return -3 > -4 > "

" -5 > + -6 > this -7 > . -8 > greeting -9 > + -10> "

" -11> ; +2 > return +3 > "

" +4 > + +5 > this +6 > . +7 > greeting +8 > + +9 > "

" +10> ; 1->Emitted(11, 17) Source(9, 13) + SourceIndex(0) -2 >Emitted(11, 23) Source(9, 19) + SourceIndex(0) -3 >Emitted(11, 24) Source(9, 20) + SourceIndex(0) -4 >Emitted(11, 30) Source(9, 26) + SourceIndex(0) -5 >Emitted(11, 33) Source(9, 29) + SourceIndex(0) -6 >Emitted(11, 37) Source(9, 33) + SourceIndex(0) -7 >Emitted(11, 38) Source(9, 34) + SourceIndex(0) -8 >Emitted(11, 46) Source(9, 42) + SourceIndex(0) -9 >Emitted(11, 49) Source(9, 45) + SourceIndex(0) -10>Emitted(11, 56) Source(9, 52) + SourceIndex(0) -11>Emitted(11, 57) Source(9, 53) + SourceIndex(0) +2 >Emitted(11, 24) Source(9, 20) + SourceIndex(0) +3 >Emitted(11, 30) Source(9, 26) + SourceIndex(0) +4 >Emitted(11, 33) Source(9, 29) + SourceIndex(0) +5 >Emitted(11, 37) Source(9, 33) + SourceIndex(0) +6 >Emitted(11, 38) Source(9, 34) + SourceIndex(0) +7 >Emitted(11, 46) Source(9, 42) + SourceIndex(0) +8 >Emitted(11, 49) Source(9, 45) + SourceIndex(0) +9 >Emitted(11, 56) Source(9, 52) + SourceIndex(0) +10>Emitted(11, 57) Source(9, 53) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^ @@ -300,33 +297,30 @@ sourceFile:sourceMapValidationClasses.ts --- >>> return new Greeter(greeting); 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^^^^^^^ -6 > ^ -7 > ^^^^^^^^ -8 > ^ -9 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^^^^^^^ +5 > ^ +6 > ^^^^^^^^ +7 > ^ +8 > ^ 1->): Greeter { > -2 > return -3 > -4 > new -5 > Greeter -6 > ( -7 > greeting -8 > ) -9 > ; +2 > return +3 > new +4 > Greeter +5 > ( +6 > greeting +7 > ) +8 > ; 1->Emitted(16, 13) Source(15, 9) + SourceIndex(0) -2 >Emitted(16, 19) Source(15, 15) + SourceIndex(0) -3 >Emitted(16, 20) Source(15, 16) + SourceIndex(0) -4 >Emitted(16, 24) Source(15, 20) + SourceIndex(0) -5 >Emitted(16, 31) Source(15, 27) + SourceIndex(0) -6 >Emitted(16, 32) Source(15, 28) + SourceIndex(0) -7 >Emitted(16, 40) Source(15, 36) + SourceIndex(0) -8 >Emitted(16, 41) Source(15, 37) + SourceIndex(0) -9 >Emitted(16, 42) Source(15, 38) + SourceIndex(0) +2 >Emitted(16, 20) Source(15, 16) + SourceIndex(0) +3 >Emitted(16, 24) Source(15, 20) + SourceIndex(0) +4 >Emitted(16, 31) Source(15, 27) + SourceIndex(0) +5 >Emitted(16, 32) Source(15, 28) + SourceIndex(0) +6 >Emitted(16, 40) Source(15, 36) + SourceIndex(0) +7 >Emitted(16, 41) Source(15, 37) + SourceIndex(0) +8 >Emitted(16, 42) Source(15, 38) + SourceIndex(0) --- >>> } 1 >^^^^^^^^ @@ -529,64 +523,55 @@ sourceFile:sourceMapValidationClasses.ts --- >>> for (var i = 0; i < restGreetings.length; i++) { 1->^^^^^^^^^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^^^^^^^^^^^^ -13> ^ -14> ^^^^^^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ -20> ^^-> +2 > ^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^^^^^^^^^^^^^ +11> ^ +12> ^^^^^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ +17> ^^^-> 1-> > -2 > for -3 > -4 > ( -5 > var -6 > i -7 > = -8 > 0 -9 > ; -10> i -11> < -12> restGreetings -13> . -14> length -15> ; -16> i -17> ++ -18> ) -19> { +2 > for ( +3 > var +4 > i +5 > = +6 > 0 +7 > ; +8 > i +9 > < +10> restGreetings +11> . +12> length +13> ; +14> i +15> ++ +16> ) 1->Emitted(27, 13) Source(24, 9) + SourceIndex(0) -2 >Emitted(27, 16) Source(24, 12) + SourceIndex(0) -3 >Emitted(27, 17) Source(24, 13) + SourceIndex(0) -4 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) -5 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) -6 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) -7 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) -8 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) -9 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) -10>Emitted(27, 30) Source(24, 26) + SourceIndex(0) -11>Emitted(27, 33) Source(24, 29) + SourceIndex(0) -12>Emitted(27, 46) Source(24, 42) + SourceIndex(0) -13>Emitted(27, 47) Source(24, 43) + SourceIndex(0) -14>Emitted(27, 53) Source(24, 49) + SourceIndex(0) -15>Emitted(27, 55) Source(24, 51) + SourceIndex(0) -16>Emitted(27, 56) Source(24, 52) + SourceIndex(0) -17>Emitted(27, 58) Source(24, 54) + SourceIndex(0) -18>Emitted(27, 60) Source(24, 56) + SourceIndex(0) -19>Emitted(27, 61) Source(24, 57) + SourceIndex(0) +2 >Emitted(27, 18) Source(24, 14) + SourceIndex(0) +3 >Emitted(27, 22) Source(24, 18) + SourceIndex(0) +4 >Emitted(27, 23) Source(24, 19) + SourceIndex(0) +5 >Emitted(27, 26) Source(24, 22) + SourceIndex(0) +6 >Emitted(27, 27) Source(24, 23) + SourceIndex(0) +7 >Emitted(27, 29) Source(24, 25) + SourceIndex(0) +8 >Emitted(27, 30) Source(24, 26) + SourceIndex(0) +9 >Emitted(27, 33) Source(24, 29) + SourceIndex(0) +10>Emitted(27, 46) Source(24, 42) + SourceIndex(0) +11>Emitted(27, 47) Source(24, 43) + SourceIndex(0) +12>Emitted(27, 53) Source(24, 49) + SourceIndex(0) +13>Emitted(27, 55) Source(24, 51) + SourceIndex(0) +14>Emitted(27, 56) Source(24, 52) + SourceIndex(0) +15>Emitted(27, 58) Source(24, 54) + SourceIndex(0) +16>Emitted(27, 60) Source(24, 56) + SourceIndex(0) --- >>> greeters.push(new Greeter(restGreetings[i])); 1->^^^^^^^^^^^^^^^^ @@ -604,7 +589,7 @@ sourceFile:sourceMapValidationClasses.ts 13> ^ 14> ^ 15> ^ -1-> +1->{ > 2 > greeters 3 > . @@ -637,33 +622,27 @@ sourceFile:sourceMapValidationClasses.ts 15>Emitted(28, 62) Source(25, 58) + SourceIndex(0) --- >>> } -1 >^^^^^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> +1 >^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(29, 13) Source(26, 9) + SourceIndex(0) -2 >Emitted(29, 14) Source(26, 10) + SourceIndex(0) + > } +1 >Emitted(29, 14) Source(26, 10) + SourceIndex(0) --- >>> return greeters; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^ +4 > ^ 1-> > > -2 > return -3 > -4 > greeters -5 > ; +2 > return +3 > greeters +4 > ; 1->Emitted(30, 13) Source(28, 9) + SourceIndex(0) -2 >Emitted(30, 19) Source(28, 15) + SourceIndex(0) -3 >Emitted(30, 20) Source(28, 16) + SourceIndex(0) -4 >Emitted(30, 28) Source(28, 24) + SourceIndex(0) -5 >Emitted(30, 29) Source(28, 25) + SourceIndex(0) +2 >Emitted(30, 20) Source(28, 16) + SourceIndex(0) +3 >Emitted(30, 28) Source(28, 24) + SourceIndex(0) +4 >Emitted(30, 29) Source(28, 25) + SourceIndex(0) --- >>> } 1 >^^^^^^^^ @@ -730,63 +709,54 @@ sourceFile:sourceMapValidationClasses.ts --- >>> for (var j = 0; j < b.length; j++) { 1 >^^^^^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^ -14> ^^^^^^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 > ^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^ +12> ^^^^^^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1 > > -2 > for -3 > -4 > ( -5 > var -6 > j -7 > = -8 > 0 -9 > ; -10> j -11> < -12> b -13> . -14> length -15> ; -16> j -17> ++ -18> ) -19> { +2 > for ( +3 > var +4 > j +5 > = +6 > 0 +7 > ; +8 > j +9 > < +10> b +11> . +12> length +13> ; +14> j +15> ++ +16> ) 1 >Emitted(34, 9) Source(33, 5) + SourceIndex(0) -2 >Emitted(34, 12) Source(33, 8) + SourceIndex(0) -3 >Emitted(34, 13) Source(33, 9) + SourceIndex(0) -4 >Emitted(34, 14) Source(33, 10) + SourceIndex(0) -5 >Emitted(34, 18) Source(33, 14) + SourceIndex(0) -6 >Emitted(34, 19) Source(33, 15) + SourceIndex(0) -7 >Emitted(34, 22) Source(33, 18) + SourceIndex(0) -8 >Emitted(34, 23) Source(33, 19) + SourceIndex(0) -9 >Emitted(34, 25) Source(33, 21) + SourceIndex(0) -10>Emitted(34, 26) Source(33, 22) + SourceIndex(0) -11>Emitted(34, 29) Source(33, 25) + SourceIndex(0) -12>Emitted(34, 30) Source(33, 26) + SourceIndex(0) -13>Emitted(34, 31) Source(33, 27) + SourceIndex(0) -14>Emitted(34, 37) Source(33, 33) + SourceIndex(0) -15>Emitted(34, 39) Source(33, 35) + SourceIndex(0) -16>Emitted(34, 40) Source(33, 36) + SourceIndex(0) -17>Emitted(34, 42) Source(33, 38) + SourceIndex(0) -18>Emitted(34, 44) Source(33, 40) + SourceIndex(0) -19>Emitted(34, 45) Source(33, 41) + SourceIndex(0) +2 >Emitted(34, 14) Source(33, 10) + SourceIndex(0) +3 >Emitted(34, 18) Source(33, 14) + SourceIndex(0) +4 >Emitted(34, 19) Source(33, 15) + SourceIndex(0) +5 >Emitted(34, 22) Source(33, 18) + SourceIndex(0) +6 >Emitted(34, 23) Source(33, 19) + SourceIndex(0) +7 >Emitted(34, 25) Source(33, 21) + SourceIndex(0) +8 >Emitted(34, 26) Source(33, 22) + SourceIndex(0) +9 >Emitted(34, 29) Source(33, 25) + SourceIndex(0) +10>Emitted(34, 30) Source(33, 26) + SourceIndex(0) +11>Emitted(34, 31) Source(33, 27) + SourceIndex(0) +12>Emitted(34, 37) Source(33, 33) + SourceIndex(0) +13>Emitted(34, 39) Source(33, 35) + SourceIndex(0) +14>Emitted(34, 40) Source(33, 36) + SourceIndex(0) +15>Emitted(34, 42) Source(33, 38) + SourceIndex(0) +16>Emitted(34, 44) Source(33, 40) + SourceIndex(0) --- >>> b[j].greet(); 1 >^^^^^^^^^^^^ @@ -798,7 +768,7 @@ sourceFile:sourceMapValidationClasses.ts 7 > ^^^^^ 8 > ^^ 9 > ^ -1 > +1 >{ > 2 > b 3 > [ @@ -819,14 +789,11 @@ sourceFile:sourceMapValidationClasses.ts 9 >Emitted(35, 26) Source(34, 22) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^^^^^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(36, 9) Source(35, 5) + SourceIndex(0) -2 >Emitted(36, 10) Source(35, 6) + SourceIndex(0) + > } +1 >Emitted(36, 10) Source(35, 6) + SourceIndex(0) --- >>> })(Bar = Foo.Bar || (Foo.Bar = {})); 1->^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDecorators.js.map b/tests/baselines/reference/sourceMapValidationDecorators.js.map index c5666dc3147..a3074387fd0 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.js.map +++ b/tests/baselines/reference/sourceMapValidationDecorators.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDecorators.js.map] -{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":[],"mappings":";;;;;;;;;AASA;IACI,iBAGS,QAAgB;QAIvB,WAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,0BAAc;;QAJP,aAAQ,GAAR,QAAQ,CAAQ;IAKzB,CAAC;IAID,uBAAK,GAAL;QACI,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5C,CAAC;IAUO,oBAAE,GAAV,UAGE,CAAS;QACP,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAID,sBAAI,8BAAS;aAAb;YACI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAGE,SAAiB;YACf,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC9B,CAAC;;;OAPA;IAbc,UAAE,GAAW,EAAE,CAAC;IAV/B;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;wCAGtB;IAID;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;sCACL;IAMlB;QACG,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;qCAGzB;IAID;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;QAMpB,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;4CAJzB;IAbD;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;6BACQ;IAvB7B,OAAO;QAFZ,eAAe;QACf,eAAe,CAAC,EAAE,CAAC;QAGb,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;QAGvB,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;OAPxB,OAAO,CA4CZ;IAAD,cAAC;CAAA,AA5CD,IA4CC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":[],"mappings":";;;;;;;;;AASA;IACI,iBAGS,QAAgB;QAIvB,WAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,0BAAc;;QAJP,aAAQ,GAAR,QAAQ,CAAQ;IAKzB,CAAC;IAID,uBAAK,GAAL;QACI,OAAO,MAAM,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5C,CAAC;IAUO,oBAAE,GAAV,UAGE,CAAS;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAID,sBAAI,8BAAS;aAAb;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAGE,SAAiB;YACf,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC9B,CAAC;;;OAPA;IAbc,UAAE,GAAW,EAAE,CAAC;IAV/B;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;wCAGtB;IAID;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;sCACL;IAMlB;QACG,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;qCAGzB;IAID;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;QAMpB,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;4CAJzB;IAbD;QAFC,kBAAkB;QAClB,kBAAkB,CAAC,EAAE,CAAC;6BACQ;IAvB7B,OAAO;QAFZ,eAAe;QACf,eAAe,CAAC,EAAE,CAAC;QAGb,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;QAGvB,WAAA,mBAAmB,CAAA;QACnB,WAAA,mBAAmB,CAAC,EAAE,CAAC,CAAA;OAPxB,OAAO,CA4CZ;IAAD,cAAC;CAAA,AA5CD,IA4CC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt index 8849270fb61..257fbcd7831 100644 --- a/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDecorators.sourcemap.txt @@ -138,39 +138,36 @@ sourceFile:sourceMapValidationDecorators.ts --- >>> return "

" + this.greeting + "

"; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^^^ -6 > ^^^^ -7 > ^ -8 > ^^^^^^^^ -9 > ^^^ -10> ^^^^^^^ -11> ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^^^ +5 > ^^^^ +6 > ^ +7 > ^^^^^^^^ +8 > ^^^ +9 > ^^^^^^^ +10> ^ 1->greet() { > -2 > return -3 > -4 > "

" -5 > + -6 > this -7 > . -8 > greeting -9 > + -10> "

" -11> ; +2 > return +3 > "

" +4 > + +5 > this +6 > . +7 > greeting +8 > + +9 > "

" +10> ; 1->Emitted(19, 9) Source(24, 9) + SourceIndex(0) -2 >Emitted(19, 15) Source(24, 15) + SourceIndex(0) -3 >Emitted(19, 16) Source(24, 16) + SourceIndex(0) -4 >Emitted(19, 22) Source(24, 22) + SourceIndex(0) -5 >Emitted(19, 25) Source(24, 25) + SourceIndex(0) -6 >Emitted(19, 29) Source(24, 29) + SourceIndex(0) -7 >Emitted(19, 30) Source(24, 30) + SourceIndex(0) -8 >Emitted(19, 38) Source(24, 38) + SourceIndex(0) -9 >Emitted(19, 41) Source(24, 41) + SourceIndex(0) -10>Emitted(19, 48) Source(24, 48) + SourceIndex(0) -11>Emitted(19, 49) Source(24, 49) + SourceIndex(0) +2 >Emitted(19, 16) Source(24, 16) + SourceIndex(0) +3 >Emitted(19, 22) Source(24, 22) + SourceIndex(0) +4 >Emitted(19, 25) Source(24, 25) + SourceIndex(0) +5 >Emitted(19, 29) Source(24, 29) + SourceIndex(0) +6 >Emitted(19, 30) Source(24, 30) + SourceIndex(0) +7 >Emitted(19, 38) Source(24, 38) + SourceIndex(0) +8 >Emitted(19, 41) Source(24, 41) + SourceIndex(0) +9 >Emitted(19, 48) Source(24, 48) + SourceIndex(0) +10>Emitted(19, 49) Source(24, 49) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -214,27 +211,24 @@ sourceFile:sourceMapValidationDecorators.ts --- >>> return this.greeting; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -6 > ^^^^^^^^ -7 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^ 1 >) { > -2 > return -3 > -4 > this -5 > . -6 > greeting -7 > ; +2 > return +3 > this +4 > . +5 > greeting +6 > ; 1 >Emitted(22, 9) Source(39, 9) + SourceIndex(0) -2 >Emitted(22, 15) Source(39, 15) + SourceIndex(0) -3 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) -4 >Emitted(22, 20) Source(39, 20) + SourceIndex(0) -5 >Emitted(22, 21) Source(39, 21) + SourceIndex(0) -6 >Emitted(22, 29) Source(39, 29) + SourceIndex(0) -7 >Emitted(22, 30) Source(39, 30) + SourceIndex(0) +2 >Emitted(22, 16) Source(39, 16) + SourceIndex(0) +3 >Emitted(22, 20) Source(39, 20) + SourceIndex(0) +4 >Emitted(22, 21) Source(39, 21) + SourceIndex(0) +5 >Emitted(22, 29) Source(39, 29) + SourceIndex(0) +6 >Emitted(22, 30) Source(39, 30) + SourceIndex(0) --- >>> }; 1 >^^^^ @@ -269,27 +263,24 @@ sourceFile:sourceMapValidationDecorators.ts --- >>> return this.greeting; 1->^^^^^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ -6 > ^^^^^^^^ -7 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^^^^^ +6 > ^ 1->get greetings() { > -2 > return -3 > -4 > this -5 > . -6 > greeting -7 > ; +2 > return +3 > this +4 > . +5 > greeting +6 > ; 1->Emitted(26, 13) Source(45, 9) + SourceIndex(0) -2 >Emitted(26, 19) Source(45, 15) + SourceIndex(0) -3 >Emitted(26, 20) Source(45, 16) + SourceIndex(0) -4 >Emitted(26, 24) Source(45, 20) + SourceIndex(0) -5 >Emitted(26, 25) Source(45, 21) + SourceIndex(0) -6 >Emitted(26, 33) Source(45, 29) + SourceIndex(0) -7 >Emitted(26, 34) Source(45, 30) + SourceIndex(0) +2 >Emitted(26, 20) Source(45, 16) + SourceIndex(0) +3 >Emitted(26, 24) Source(45, 20) + SourceIndex(0) +4 >Emitted(26, 25) Source(45, 21) + SourceIndex(0) +5 >Emitted(26, 33) Source(45, 29) + SourceIndex(0) +6 >Emitted(26, 34) Source(45, 30) + SourceIndex(0) --- >>> }, 1 >^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map index 79073166e0f..b14ebbafcf7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForArrayBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAQ,IAAA,iBAAK,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAAsB,EAAnB,aAAK,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,+BAAsC,EAAnC,aAAK,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAQ,IAAA,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,oBAAsD,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,wCAA0E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,mBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,uBAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,uCAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,sBAAK,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,0BAAK,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,8CAAK,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAAwC,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,+BAAwD,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,oBAA4D,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,oBAAQ,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAAsC,EAArC,gBAAQ,EAAE,wBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,+BAAsD,EAArD,gBAAQ,EAAE,wBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,sCAAkB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,0CAAkB,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,8DAAkB,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,KAAY,IAAA,iBAAK,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,eAAsB,EAAnB,aAAK,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,+BAAsC,EAAnC,aAAK,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAY,IAAA,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAS,IAAA,oBAAsD,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChF,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAS,IAAA,wCAA0E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAAU,IAAA,mBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAU,IAAA,uBAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAU,IAAA,uCAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAU,IAAA,sBAAK,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,0BAAK,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,8CAAK,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACvE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAU,IAAA,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC9D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,eAAwC,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,+BAAwD,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAU,IAAA,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,oBAA4D,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACtF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAAU,IAAA,oBAAQ,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,eAAsC,EAArC,gBAAQ,EAAE,wBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,+BAAsD,EAArD,gBAAQ,EAAE,wBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAU,IAAA,sCAAkB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAAU,IAAA,0CAAkB,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAAU,IAAA,8DAAkB,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpF,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt index d0dbc25229c..f343ab20b86 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.sourcemap.txt @@ -61,21 +61,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts --- >>> return robotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robotA -5 > ; +2 > return +3 > robotA +4 > ; 1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) -5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +2 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +3 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) --- >>>} 1 > @@ -188,21 +185,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts --- >>> return multiRobotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobotA -5 > ; +2 > return +3 > multiRobotA +4 > ; 1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) --- >>>} 1 > @@ -216,64 +210,55 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts --- >>>for (var nameA = robotA[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > > -2 >for -3 > -4 > (let [, -5 > -6 > nameA -7 > ] = robotA, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [, +3 > +4 > nameA +5 > ] = robotA, +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) -2 >Emitted(10, 4) Source(18, 4) + SourceIndex(0) -3 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) -4 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) -5 >Emitted(10, 10) Source(18, 13) + SourceIndex(0) -6 >Emitted(10, 27) Source(18, 18) + SourceIndex(0) -7 >Emitted(10, 29) Source(18, 30) + SourceIndex(0) -8 >Emitted(10, 30) Source(18, 31) + SourceIndex(0) -9 >Emitted(10, 33) Source(18, 34) + SourceIndex(0) -10>Emitted(10, 34) Source(18, 35) + SourceIndex(0) -11>Emitted(10, 36) Source(18, 37) + SourceIndex(0) -12>Emitted(10, 37) Source(18, 38) + SourceIndex(0) -13>Emitted(10, 40) Source(18, 41) + SourceIndex(0) -14>Emitted(10, 41) Source(18, 42) + SourceIndex(0) -15>Emitted(10, 43) Source(18, 44) + SourceIndex(0) -16>Emitted(10, 44) Source(18, 45) + SourceIndex(0) -17>Emitted(10, 46) Source(18, 47) + SourceIndex(0) -18>Emitted(10, 48) Source(18, 49) + SourceIndex(0) -19>Emitted(10, 49) Source(18, 50) + SourceIndex(0) +2 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) +3 >Emitted(10, 10) Source(18, 13) + SourceIndex(0) +4 >Emitted(10, 27) Source(18, 18) + SourceIndex(0) +5 >Emitted(10, 29) Source(18, 30) + SourceIndex(0) +6 >Emitted(10, 30) Source(18, 31) + SourceIndex(0) +7 >Emitted(10, 33) Source(18, 34) + SourceIndex(0) +8 >Emitted(10, 34) Source(18, 35) + SourceIndex(0) +9 >Emitted(10, 36) Source(18, 37) + SourceIndex(0) +10>Emitted(10, 37) Source(18, 38) + SourceIndex(0) +11>Emitted(10, 40) Source(18, 41) + SourceIndex(0) +12>Emitted(10, 41) Source(18, 42) + SourceIndex(0) +13>Emitted(10, 43) Source(18, 44) + SourceIndex(0) +14>Emitted(10, 44) Source(18, 45) + SourceIndex(0) +15>Emitted(10, 46) Source(18, 47) + SourceIndex(0) +16>Emitted(10, 48) Source(18, 49) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -284,7 +269,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -303,80 +288,68 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(11, 24) Source(19, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(12, 1) Source(20, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) + >} +1 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) --- >>>for (var _a = getRobot(), nameA = _a[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, nameA] = getRobot() -7 > -8 > nameA -9 > ] = getRobot(), -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let +3 > +4 > [, nameA] = getRobot() +5 > +6 > nameA +7 > ] = getRobot(), +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) -3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) -4 >Emitted(13, 6) Source(21, 10) + SourceIndex(0) -5 >Emitted(13, 10) Source(21, 10) + SourceIndex(0) -6 >Emitted(13, 25) Source(21, 32) + SourceIndex(0) -7 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) -8 >Emitted(13, 40) Source(21, 18) + SourceIndex(0) -9 >Emitted(13, 42) Source(21, 34) + SourceIndex(0) -10>Emitted(13, 43) Source(21, 35) + SourceIndex(0) -11>Emitted(13, 46) Source(21, 38) + SourceIndex(0) -12>Emitted(13, 47) Source(21, 39) + SourceIndex(0) -13>Emitted(13, 49) Source(21, 41) + SourceIndex(0) -14>Emitted(13, 50) Source(21, 42) + SourceIndex(0) -15>Emitted(13, 53) Source(21, 45) + SourceIndex(0) -16>Emitted(13, 54) Source(21, 46) + SourceIndex(0) -17>Emitted(13, 56) Source(21, 48) + SourceIndex(0) -18>Emitted(13, 57) Source(21, 49) + SourceIndex(0) -19>Emitted(13, 59) Source(21, 51) + SourceIndex(0) -20>Emitted(13, 61) Source(21, 53) + SourceIndex(0) -21>Emitted(13, 62) Source(21, 54) + SourceIndex(0) +2 >Emitted(13, 6) Source(21, 10) + SourceIndex(0) +3 >Emitted(13, 10) Source(21, 10) + SourceIndex(0) +4 >Emitted(13, 25) Source(21, 32) + SourceIndex(0) +5 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) +6 >Emitted(13, 40) Source(21, 18) + SourceIndex(0) +7 >Emitted(13, 42) Source(21, 34) + SourceIndex(0) +8 >Emitted(13, 43) Source(21, 35) + SourceIndex(0) +9 >Emitted(13, 46) Source(21, 38) + SourceIndex(0) +10>Emitted(13, 47) Source(21, 39) + SourceIndex(0) +11>Emitted(13, 49) Source(21, 41) + SourceIndex(0) +12>Emitted(13, 50) Source(21, 42) + SourceIndex(0) +13>Emitted(13, 53) Source(21, 45) + SourceIndex(0) +14>Emitted(13, 54) Source(21, 46) + SourceIndex(0) +15>Emitted(13, 56) Source(21, 48) + SourceIndex(0) +16>Emitted(13, 57) Source(21, 49) + SourceIndex(0) +17>Emitted(13, 59) Source(21, 51) + SourceIndex(0) +18>Emitted(13, 61) Source(21, 53) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -387,7 +360,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -406,80 +379,68 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(14, 24) Source(22, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(15, 1) Source(23, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) + >} +1 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) --- >>>for (var _b = [2, "trimmer", "trimming"], nameA = _b[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, nameA] = [2, "trimmer", "trimming"] -7 > -8 > nameA -9 > ] = [2, "trimmer", "trimming"], -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let +3 > +4 > [, nameA] = [2, "trimmer", "trimming"] +5 > +6 > nameA +7 > ] = [2, "trimmer", "trimming"], +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(16, 4) Source(24, 4) + SourceIndex(0) -3 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) -4 >Emitted(16, 6) Source(24, 10) + SourceIndex(0) -5 >Emitted(16, 10) Source(24, 10) + SourceIndex(0) -6 >Emitted(16, 41) Source(24, 48) + SourceIndex(0) -7 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) -8 >Emitted(16, 56) Source(24, 18) + SourceIndex(0) -9 >Emitted(16, 58) Source(24, 50) + SourceIndex(0) -10>Emitted(16, 59) Source(24, 51) + SourceIndex(0) -11>Emitted(16, 62) Source(24, 54) + SourceIndex(0) -12>Emitted(16, 63) Source(24, 55) + SourceIndex(0) -13>Emitted(16, 65) Source(24, 57) + SourceIndex(0) -14>Emitted(16, 66) Source(24, 58) + SourceIndex(0) -15>Emitted(16, 69) Source(24, 61) + SourceIndex(0) -16>Emitted(16, 70) Source(24, 62) + SourceIndex(0) -17>Emitted(16, 72) Source(24, 64) + SourceIndex(0) -18>Emitted(16, 73) Source(24, 65) + SourceIndex(0) -19>Emitted(16, 75) Source(24, 67) + SourceIndex(0) -20>Emitted(16, 77) Source(24, 69) + SourceIndex(0) -21>Emitted(16, 78) Source(24, 70) + SourceIndex(0) +2 >Emitted(16, 6) Source(24, 10) + SourceIndex(0) +3 >Emitted(16, 10) Source(24, 10) + SourceIndex(0) +4 >Emitted(16, 41) Source(24, 48) + SourceIndex(0) +5 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) +6 >Emitted(16, 56) Source(24, 18) + SourceIndex(0) +7 >Emitted(16, 58) Source(24, 50) + SourceIndex(0) +8 >Emitted(16, 59) Source(24, 51) + SourceIndex(0) +9 >Emitted(16, 62) Source(24, 54) + SourceIndex(0) +10>Emitted(16, 63) Source(24, 55) + SourceIndex(0) +11>Emitted(16, 65) Source(24, 57) + SourceIndex(0) +12>Emitted(16, 66) Source(24, 58) + SourceIndex(0) +13>Emitted(16, 69) Source(24, 61) + SourceIndex(0) +14>Emitted(16, 70) Source(24, 62) + SourceIndex(0) +15>Emitted(16, 72) Source(24, 64) + SourceIndex(0) +16>Emitted(16, 73) Source(24, 65) + SourceIndex(0) +17>Emitted(16, 75) Source(24, 67) + SourceIndex(0) +18>Emitted(16, 77) Source(24, 69) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -490,7 +451,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -509,86 +470,74 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(17, 24) Source(25, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(18, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) + >} +1 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) --- >>>for (var _c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let [, -5 > -6 > [primarySkillA, secondarySkillA] -7 > -8 > primarySkillA -9 > , -10> secondarySkillA -11> ]] = multiRobotA, -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let [, +3 > +4 > [primarySkillA, secondarySkillA] +5 > +6 > primarySkillA +7 > , +8 > secondarySkillA +9 > ]] = multiRobotA, +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(19, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(19, 4) Source(27, 4) + SourceIndex(0) -3 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) -4 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) -5 >Emitted(19, 10) Source(27, 13) + SourceIndex(0) -6 >Emitted(19, 29) Source(27, 45) + SourceIndex(0) -7 >Emitted(19, 31) Source(27, 14) + SourceIndex(0) -8 >Emitted(19, 52) Source(27, 27) + SourceIndex(0) -9 >Emitted(19, 54) Source(27, 29) + SourceIndex(0) -10>Emitted(19, 77) Source(27, 44) + SourceIndex(0) -11>Emitted(19, 79) Source(27, 62) + SourceIndex(0) -12>Emitted(19, 80) Source(27, 63) + SourceIndex(0) -13>Emitted(19, 83) Source(27, 66) + SourceIndex(0) -14>Emitted(19, 84) Source(27, 67) + SourceIndex(0) -15>Emitted(19, 86) Source(27, 69) + SourceIndex(0) -16>Emitted(19, 87) Source(27, 70) + SourceIndex(0) -17>Emitted(19, 90) Source(27, 73) + SourceIndex(0) -18>Emitted(19, 91) Source(27, 74) + SourceIndex(0) -19>Emitted(19, 93) Source(27, 76) + SourceIndex(0) -20>Emitted(19, 94) Source(27, 77) + SourceIndex(0) -21>Emitted(19, 96) Source(27, 79) + SourceIndex(0) -22>Emitted(19, 98) Source(27, 81) + SourceIndex(0) -23>Emitted(19, 99) Source(27, 82) + SourceIndex(0) +2 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) +3 >Emitted(19, 10) Source(27, 13) + SourceIndex(0) +4 >Emitted(19, 29) Source(27, 45) + SourceIndex(0) +5 >Emitted(19, 31) Source(27, 14) + SourceIndex(0) +6 >Emitted(19, 52) Source(27, 27) + SourceIndex(0) +7 >Emitted(19, 54) Source(27, 29) + SourceIndex(0) +8 >Emitted(19, 77) Source(27, 44) + SourceIndex(0) +9 >Emitted(19, 79) Source(27, 62) + SourceIndex(0) +10>Emitted(19, 80) Source(27, 63) + SourceIndex(0) +11>Emitted(19, 83) Source(27, 66) + SourceIndex(0) +12>Emitted(19, 84) Source(27, 67) + SourceIndex(0) +13>Emitted(19, 86) Source(27, 69) + SourceIndex(0) +14>Emitted(19, 87) Source(27, 70) + SourceIndex(0) +15>Emitted(19, 90) Source(27, 73) + SourceIndex(0) +16>Emitted(19, 91) Source(27, 74) + SourceIndex(0) +17>Emitted(19, 93) Source(27, 76) + SourceIndex(0) +18>Emitted(19, 94) Source(27, 77) + SourceIndex(0) +19>Emitted(19, 96) Source(27, 79) + SourceIndex(0) +20>Emitted(19, 98) Source(27, 81) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -599,7 +548,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -618,92 +567,80 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(20, 32) Source(28, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(21, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(21, 2) Source(29, 2) + SourceIndex(0) + >} +1 >Emitted(21, 2) Source(29, 2) + SourceIndex(0) --- >>>for (var _d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, [primarySkillA, secondarySkillA]] = getMultiRobot() -7 > -8 > [primarySkillA, secondarySkillA] -9 > -10> primarySkillA -11> , -12> secondarySkillA -13> ]] = getMultiRobot(), -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let +3 > +4 > [, [primarySkillA, secondarySkillA]] = getMultiRobot() +5 > +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +11> ]] = getMultiRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(22, 1) Source(30, 1) + SourceIndex(0) -2 >Emitted(22, 4) Source(30, 4) + SourceIndex(0) -3 >Emitted(22, 5) Source(30, 5) + SourceIndex(0) -4 >Emitted(22, 6) Source(30, 10) + SourceIndex(0) -5 >Emitted(22, 10) Source(30, 10) + SourceIndex(0) -6 >Emitted(22, 30) Source(30, 64) + SourceIndex(0) -7 >Emitted(22, 32) Source(30, 13) + SourceIndex(0) -8 >Emitted(22, 42) Source(30, 45) + SourceIndex(0) -9 >Emitted(22, 44) Source(30, 14) + SourceIndex(0) -10>Emitted(22, 65) Source(30, 27) + SourceIndex(0) -11>Emitted(22, 67) Source(30, 29) + SourceIndex(0) -12>Emitted(22, 90) Source(30, 44) + SourceIndex(0) -13>Emitted(22, 92) Source(30, 66) + SourceIndex(0) -14>Emitted(22, 93) Source(30, 67) + SourceIndex(0) -15>Emitted(22, 96) Source(30, 70) + SourceIndex(0) -16>Emitted(22, 97) Source(30, 71) + SourceIndex(0) -17>Emitted(22, 99) Source(30, 73) + SourceIndex(0) -18>Emitted(22, 100) Source(30, 74) + SourceIndex(0) -19>Emitted(22, 103) Source(30, 77) + SourceIndex(0) -20>Emitted(22, 104) Source(30, 78) + SourceIndex(0) -21>Emitted(22, 106) Source(30, 80) + SourceIndex(0) -22>Emitted(22, 107) Source(30, 81) + SourceIndex(0) -23>Emitted(22, 109) Source(30, 83) + SourceIndex(0) -24>Emitted(22, 111) Source(30, 85) + SourceIndex(0) -25>Emitted(22, 112) Source(30, 86) + SourceIndex(0) +2 >Emitted(22, 6) Source(30, 10) + SourceIndex(0) +3 >Emitted(22, 10) Source(30, 10) + SourceIndex(0) +4 >Emitted(22, 30) Source(30, 64) + SourceIndex(0) +5 >Emitted(22, 32) Source(30, 13) + SourceIndex(0) +6 >Emitted(22, 42) Source(30, 45) + SourceIndex(0) +7 >Emitted(22, 44) Source(30, 14) + SourceIndex(0) +8 >Emitted(22, 65) Source(30, 27) + SourceIndex(0) +9 >Emitted(22, 67) Source(30, 29) + SourceIndex(0) +10>Emitted(22, 90) Source(30, 44) + SourceIndex(0) +11>Emitted(22, 92) Source(30, 66) + SourceIndex(0) +12>Emitted(22, 93) Source(30, 67) + SourceIndex(0) +13>Emitted(22, 96) Source(30, 70) + SourceIndex(0) +14>Emitted(22, 97) Source(30, 71) + SourceIndex(0) +15>Emitted(22, 99) Source(30, 73) + SourceIndex(0) +16>Emitted(22, 100) Source(30, 74) + SourceIndex(0) +17>Emitted(22, 103) Source(30, 77) + SourceIndex(0) +18>Emitted(22, 104) Source(30, 78) + SourceIndex(0) +19>Emitted(22, 106) Source(30, 80) + SourceIndex(0) +20>Emitted(22, 107) Source(30, 81) + SourceIndex(0) +21>Emitted(22, 109) Source(30, 83) + SourceIndex(0) +22>Emitted(22, 111) Source(30, 85) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -714,7 +651,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -733,92 +670,80 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(23, 32) Source(31, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(24, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(24, 2) Source(32, 2) + SourceIndex(0) + >} +1 >Emitted(24, 2) Source(32, 2) + SourceIndex(0) --- >>>for (var _f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] -7 > -8 > [primarySkillA, secondarySkillA] -9 > -10> primarySkillA -11> , -12> secondarySkillA -13> ]] = ["trimmer", ["trimming", "edging"]], -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let +3 > +4 > [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +5 > +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +11> ]] = ["trimmer", ["trimming", "edging"]], +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(25, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(25, 4) Source(33, 4) + SourceIndex(0) -3 >Emitted(25, 5) Source(33, 5) + SourceIndex(0) -4 >Emitted(25, 6) Source(33, 10) + SourceIndex(0) -5 >Emitted(25, 10) Source(33, 10) + SourceIndex(0) -6 >Emitted(25, 50) Source(33, 84) + SourceIndex(0) -7 >Emitted(25, 52) Source(33, 13) + SourceIndex(0) -8 >Emitted(25, 62) Source(33, 45) + SourceIndex(0) -9 >Emitted(25, 64) Source(33, 14) + SourceIndex(0) -10>Emitted(25, 85) Source(33, 27) + SourceIndex(0) -11>Emitted(25, 87) Source(33, 29) + SourceIndex(0) -12>Emitted(25, 110) Source(33, 44) + SourceIndex(0) -13>Emitted(25, 112) Source(33, 86) + SourceIndex(0) -14>Emitted(25, 113) Source(33, 87) + SourceIndex(0) -15>Emitted(25, 116) Source(33, 90) + SourceIndex(0) -16>Emitted(25, 117) Source(33, 91) + SourceIndex(0) -17>Emitted(25, 119) Source(33, 93) + SourceIndex(0) -18>Emitted(25, 120) Source(33, 94) + SourceIndex(0) -19>Emitted(25, 123) Source(33, 97) + SourceIndex(0) -20>Emitted(25, 124) Source(33, 98) + SourceIndex(0) -21>Emitted(25, 126) Source(33, 100) + SourceIndex(0) -22>Emitted(25, 127) Source(33, 101) + SourceIndex(0) -23>Emitted(25, 129) Source(33, 103) + SourceIndex(0) -24>Emitted(25, 131) Source(33, 105) + SourceIndex(0) -25>Emitted(25, 132) Source(33, 106) + SourceIndex(0) +2 >Emitted(25, 6) Source(33, 10) + SourceIndex(0) +3 >Emitted(25, 10) Source(33, 10) + SourceIndex(0) +4 >Emitted(25, 50) Source(33, 84) + SourceIndex(0) +5 >Emitted(25, 52) Source(33, 13) + SourceIndex(0) +6 >Emitted(25, 62) Source(33, 45) + SourceIndex(0) +7 >Emitted(25, 64) Source(33, 14) + SourceIndex(0) +8 >Emitted(25, 85) Source(33, 27) + SourceIndex(0) +9 >Emitted(25, 87) Source(33, 29) + SourceIndex(0) +10>Emitted(25, 110) Source(33, 44) + SourceIndex(0) +11>Emitted(25, 112) Source(33, 86) + SourceIndex(0) +12>Emitted(25, 113) Source(33, 87) + SourceIndex(0) +13>Emitted(25, 116) Source(33, 90) + SourceIndex(0) +14>Emitted(25, 117) Source(33, 91) + SourceIndex(0) +15>Emitted(25, 119) Source(33, 93) + SourceIndex(0) +16>Emitted(25, 120) Source(33, 94) + SourceIndex(0) +17>Emitted(25, 123) Source(33, 97) + SourceIndex(0) +18>Emitted(25, 124) Source(33, 98) + SourceIndex(0) +19>Emitted(25, 126) Source(33, 100) + SourceIndex(0) +20>Emitted(25, 127) Source(33, 101) + SourceIndex(0) +21>Emitted(25, 129) Source(33, 103) + SourceIndex(0) +22>Emitted(25, 131) Source(33, 105) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -829,7 +754,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -848,75 +773,63 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(26, 32) Source(34, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(27, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(27, 2) Source(35, 2) + SourceIndex(0) + >} +1 >Emitted(27, 2) Source(35, 2) + SourceIndex(0) --- >>>for (var numberB = robotA[0], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > > -2 >for -3 > -4 > (let [ -5 > -6 > numberB -7 > ] = robotA, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > numberB +5 > ] = robotA, +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(28, 1) Source(37, 1) + SourceIndex(0) -2 >Emitted(28, 4) Source(37, 4) + SourceIndex(0) -3 >Emitted(28, 5) Source(37, 5) + SourceIndex(0) -4 >Emitted(28, 6) Source(37, 11) + SourceIndex(0) -5 >Emitted(28, 10) Source(37, 11) + SourceIndex(0) -6 >Emitted(28, 29) Source(37, 18) + SourceIndex(0) -7 >Emitted(28, 31) Source(37, 30) + SourceIndex(0) -8 >Emitted(28, 32) Source(37, 31) + SourceIndex(0) -9 >Emitted(28, 35) Source(37, 34) + SourceIndex(0) -10>Emitted(28, 36) Source(37, 35) + SourceIndex(0) -11>Emitted(28, 38) Source(37, 37) + SourceIndex(0) -12>Emitted(28, 39) Source(37, 38) + SourceIndex(0) -13>Emitted(28, 42) Source(37, 41) + SourceIndex(0) -14>Emitted(28, 43) Source(37, 42) + SourceIndex(0) -15>Emitted(28, 45) Source(37, 44) + SourceIndex(0) -16>Emitted(28, 46) Source(37, 45) + SourceIndex(0) -17>Emitted(28, 48) Source(37, 47) + SourceIndex(0) -18>Emitted(28, 50) Source(37, 49) + SourceIndex(0) -19>Emitted(28, 51) Source(37, 50) + SourceIndex(0) +2 >Emitted(28, 6) Source(37, 11) + SourceIndex(0) +3 >Emitted(28, 10) Source(37, 11) + SourceIndex(0) +4 >Emitted(28, 29) Source(37, 18) + SourceIndex(0) +5 >Emitted(28, 31) Source(37, 30) + SourceIndex(0) +6 >Emitted(28, 32) Source(37, 31) + SourceIndex(0) +7 >Emitted(28, 35) Source(37, 34) + SourceIndex(0) +8 >Emitted(28, 36) Source(37, 35) + SourceIndex(0) +9 >Emitted(28, 38) Source(37, 37) + SourceIndex(0) +10>Emitted(28, 39) Source(37, 38) + SourceIndex(0) +11>Emitted(28, 42) Source(37, 41) + SourceIndex(0) +12>Emitted(28, 43) Source(37, 42) + SourceIndex(0) +13>Emitted(28, 45) Source(37, 44) + SourceIndex(0) +14>Emitted(28, 46) Source(37, 45) + SourceIndex(0) +15>Emitted(28, 48) Source(37, 47) + SourceIndex(0) +16>Emitted(28, 50) Source(37, 49) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -927,7 +840,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -946,74 +859,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(29, 26) Source(38, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(30, 1) Source(39, 1) + SourceIndex(0) -2 >Emitted(30, 2) Source(39, 2) + SourceIndex(0) + >} +1 >Emitted(30, 2) Source(39, 2) + SourceIndex(0) --- >>>for (var numberB = getRobot()[0], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > numberB -7 > ] = getRobot(), -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > numberB +5 > ] = getRobot(), +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(31, 1) Source(40, 1) + SourceIndex(0) -2 >Emitted(31, 4) Source(40, 4) + SourceIndex(0) -3 >Emitted(31, 5) Source(40, 5) + SourceIndex(0) -4 >Emitted(31, 6) Source(40, 11) + SourceIndex(0) -5 >Emitted(31, 10) Source(40, 11) + SourceIndex(0) -6 >Emitted(31, 33) Source(40, 18) + SourceIndex(0) -7 >Emitted(31, 35) Source(40, 34) + SourceIndex(0) -8 >Emitted(31, 36) Source(40, 35) + SourceIndex(0) -9 >Emitted(31, 39) Source(40, 38) + SourceIndex(0) -10>Emitted(31, 40) Source(40, 39) + SourceIndex(0) -11>Emitted(31, 42) Source(40, 41) + SourceIndex(0) -12>Emitted(31, 43) Source(40, 42) + SourceIndex(0) -13>Emitted(31, 46) Source(40, 45) + SourceIndex(0) -14>Emitted(31, 47) Source(40, 46) + SourceIndex(0) -15>Emitted(31, 49) Source(40, 48) + SourceIndex(0) -16>Emitted(31, 50) Source(40, 49) + SourceIndex(0) -17>Emitted(31, 52) Source(40, 51) + SourceIndex(0) -18>Emitted(31, 54) Source(40, 53) + SourceIndex(0) -19>Emitted(31, 55) Source(40, 54) + SourceIndex(0) +2 >Emitted(31, 6) Source(40, 11) + SourceIndex(0) +3 >Emitted(31, 10) Source(40, 11) + SourceIndex(0) +4 >Emitted(31, 33) Source(40, 18) + SourceIndex(0) +5 >Emitted(31, 35) Source(40, 34) + SourceIndex(0) +6 >Emitted(31, 36) Source(40, 35) + SourceIndex(0) +7 >Emitted(31, 39) Source(40, 38) + SourceIndex(0) +8 >Emitted(31, 40) Source(40, 39) + SourceIndex(0) +9 >Emitted(31, 42) Source(40, 41) + SourceIndex(0) +10>Emitted(31, 43) Source(40, 42) + SourceIndex(0) +11>Emitted(31, 46) Source(40, 45) + SourceIndex(0) +12>Emitted(31, 47) Source(40, 46) + SourceIndex(0) +13>Emitted(31, 49) Source(40, 48) + SourceIndex(0) +14>Emitted(31, 50) Source(40, 49) + SourceIndex(0) +15>Emitted(31, 52) Source(40, 51) + SourceIndex(0) +16>Emitted(31, 54) Source(40, 53) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1024,7 +925,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1043,74 +944,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(32, 26) Source(41, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(33, 1) Source(42, 1) + SourceIndex(0) -2 >Emitted(33, 2) Source(42, 2) + SourceIndex(0) + >} +1 >Emitted(33, 2) Source(42, 2) + SourceIndex(0) --- >>>for (var numberB = [2, "trimmer", "trimming"][0], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > numberB -7 > ] = [2, "trimmer", "trimming"], -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > numberB +5 > ] = [2, "trimmer", "trimming"], +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(34, 1) Source(43, 1) + SourceIndex(0) -2 >Emitted(34, 4) Source(43, 4) + SourceIndex(0) -3 >Emitted(34, 5) Source(43, 5) + SourceIndex(0) -4 >Emitted(34, 6) Source(43, 11) + SourceIndex(0) -5 >Emitted(34, 10) Source(43, 11) + SourceIndex(0) -6 >Emitted(34, 49) Source(43, 18) + SourceIndex(0) -7 >Emitted(34, 51) Source(43, 50) + SourceIndex(0) -8 >Emitted(34, 52) Source(43, 51) + SourceIndex(0) -9 >Emitted(34, 55) Source(43, 54) + SourceIndex(0) -10>Emitted(34, 56) Source(43, 55) + SourceIndex(0) -11>Emitted(34, 58) Source(43, 57) + SourceIndex(0) -12>Emitted(34, 59) Source(43, 58) + SourceIndex(0) -13>Emitted(34, 62) Source(43, 61) + SourceIndex(0) -14>Emitted(34, 63) Source(43, 62) + SourceIndex(0) -15>Emitted(34, 65) Source(43, 64) + SourceIndex(0) -16>Emitted(34, 66) Source(43, 65) + SourceIndex(0) -17>Emitted(34, 68) Source(43, 67) + SourceIndex(0) -18>Emitted(34, 70) Source(43, 69) + SourceIndex(0) -19>Emitted(34, 71) Source(43, 70) + SourceIndex(0) +2 >Emitted(34, 6) Source(43, 11) + SourceIndex(0) +3 >Emitted(34, 10) Source(43, 11) + SourceIndex(0) +4 >Emitted(34, 49) Source(43, 18) + SourceIndex(0) +5 >Emitted(34, 51) Source(43, 50) + SourceIndex(0) +6 >Emitted(34, 52) Source(43, 51) + SourceIndex(0) +7 >Emitted(34, 55) Source(43, 54) + SourceIndex(0) +8 >Emitted(34, 56) Source(43, 55) + SourceIndex(0) +9 >Emitted(34, 58) Source(43, 57) + SourceIndex(0) +10>Emitted(34, 59) Source(43, 58) + SourceIndex(0) +11>Emitted(34, 62) Source(43, 61) + SourceIndex(0) +12>Emitted(34, 63) Source(43, 62) + SourceIndex(0) +13>Emitted(34, 65) Source(43, 64) + SourceIndex(0) +14>Emitted(34, 66) Source(43, 65) + SourceIndex(0) +15>Emitted(34, 68) Source(43, 67) + SourceIndex(0) +16>Emitted(34, 70) Source(43, 69) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1121,7 +1010,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1140,74 +1029,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(35, 26) Source(44, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(36, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(36, 2) Source(45, 2) + SourceIndex(0) + >} +1 >Emitted(36, 2) Source(45, 2) + SourceIndex(0) --- >>>for (var nameB = multiRobotA[0], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > nameB -7 > ] = multiRobotA, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > nameB +5 > ] = multiRobotA, +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(37, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(46, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(46, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(46, 11) + SourceIndex(0) -5 >Emitted(37, 10) Source(46, 11) + SourceIndex(0) -6 >Emitted(37, 32) Source(46, 16) + SourceIndex(0) -7 >Emitted(37, 34) Source(46, 33) + SourceIndex(0) -8 >Emitted(37, 35) Source(46, 34) + SourceIndex(0) -9 >Emitted(37, 38) Source(46, 37) + SourceIndex(0) -10>Emitted(37, 39) Source(46, 38) + SourceIndex(0) -11>Emitted(37, 41) Source(46, 40) + SourceIndex(0) -12>Emitted(37, 42) Source(46, 41) + SourceIndex(0) -13>Emitted(37, 45) Source(46, 44) + SourceIndex(0) -14>Emitted(37, 46) Source(46, 45) + SourceIndex(0) -15>Emitted(37, 48) Source(46, 47) + SourceIndex(0) -16>Emitted(37, 49) Source(46, 48) + SourceIndex(0) -17>Emitted(37, 51) Source(46, 50) + SourceIndex(0) -18>Emitted(37, 53) Source(46, 52) + SourceIndex(0) -19>Emitted(37, 54) Source(46, 53) + SourceIndex(0) +2 >Emitted(37, 6) Source(46, 11) + SourceIndex(0) +3 >Emitted(37, 10) Source(46, 11) + SourceIndex(0) +4 >Emitted(37, 32) Source(46, 16) + SourceIndex(0) +5 >Emitted(37, 34) Source(46, 33) + SourceIndex(0) +6 >Emitted(37, 35) Source(46, 34) + SourceIndex(0) +7 >Emitted(37, 38) Source(46, 37) + SourceIndex(0) +8 >Emitted(37, 39) Source(46, 38) + SourceIndex(0) +9 >Emitted(37, 41) Source(46, 40) + SourceIndex(0) +10>Emitted(37, 42) Source(46, 41) + SourceIndex(0) +11>Emitted(37, 45) Source(46, 44) + SourceIndex(0) +12>Emitted(37, 46) Source(46, 45) + SourceIndex(0) +13>Emitted(37, 48) Source(46, 47) + SourceIndex(0) +14>Emitted(37, 49) Source(46, 48) + SourceIndex(0) +15>Emitted(37, 51) Source(46, 50) + SourceIndex(0) +16>Emitted(37, 53) Source(46, 52) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1218,7 +1095,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1237,74 +1114,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(38, 24) Source(47, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(39, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(39, 2) Source(48, 2) + SourceIndex(0) + >} +1 >Emitted(39, 2) Source(48, 2) + SourceIndex(0) --- >>>for (var nameB = getMultiRobot()[0], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > nameB -7 > ] = getMultiRobot(), -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > nameB +5 > ] = getMultiRobot(), +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(40, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(40, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(40, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(40, 6) Source(49, 11) + SourceIndex(0) -5 >Emitted(40, 10) Source(49, 11) + SourceIndex(0) -6 >Emitted(40, 36) Source(49, 16) + SourceIndex(0) -7 >Emitted(40, 38) Source(49, 37) + SourceIndex(0) -8 >Emitted(40, 39) Source(49, 38) + SourceIndex(0) -9 >Emitted(40, 42) Source(49, 41) + SourceIndex(0) -10>Emitted(40, 43) Source(49, 42) + SourceIndex(0) -11>Emitted(40, 45) Source(49, 44) + SourceIndex(0) -12>Emitted(40, 46) Source(49, 45) + SourceIndex(0) -13>Emitted(40, 49) Source(49, 48) + SourceIndex(0) -14>Emitted(40, 50) Source(49, 49) + SourceIndex(0) -15>Emitted(40, 52) Source(49, 51) + SourceIndex(0) -16>Emitted(40, 53) Source(49, 52) + SourceIndex(0) -17>Emitted(40, 55) Source(49, 54) + SourceIndex(0) -18>Emitted(40, 57) Source(49, 56) + SourceIndex(0) -19>Emitted(40, 58) Source(49, 57) + SourceIndex(0) +2 >Emitted(40, 6) Source(49, 11) + SourceIndex(0) +3 >Emitted(40, 10) Source(49, 11) + SourceIndex(0) +4 >Emitted(40, 36) Source(49, 16) + SourceIndex(0) +5 >Emitted(40, 38) Source(49, 37) + SourceIndex(0) +6 >Emitted(40, 39) Source(49, 38) + SourceIndex(0) +7 >Emitted(40, 42) Source(49, 41) + SourceIndex(0) +8 >Emitted(40, 43) Source(49, 42) + SourceIndex(0) +9 >Emitted(40, 45) Source(49, 44) + SourceIndex(0) +10>Emitted(40, 46) Source(49, 45) + SourceIndex(0) +11>Emitted(40, 49) Source(49, 48) + SourceIndex(0) +12>Emitted(40, 50) Source(49, 49) + SourceIndex(0) +13>Emitted(40, 52) Source(49, 51) + SourceIndex(0) +14>Emitted(40, 53) Source(49, 52) + SourceIndex(0) +15>Emitted(40, 55) Source(49, 54) + SourceIndex(0) +16>Emitted(40, 57) Source(49, 56) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1315,7 +1180,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1334,74 +1199,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(41, 24) Source(50, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(42, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(42, 2) Source(51, 2) + SourceIndex(0) + >} +1 >Emitted(42, 2) Source(51, 2) + SourceIndex(0) --- >>>for (var nameB = ["trimmer", ["trimming", "edging"]][0], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > nameB -7 > ] = ["trimmer", ["trimming", "edging"]], -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > nameB +5 > ] = ["trimmer", ["trimming", "edging"]], +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(43, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(43, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(43, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(43, 6) Source(52, 11) + SourceIndex(0) -5 >Emitted(43, 10) Source(52, 11) + SourceIndex(0) -6 >Emitted(43, 56) Source(52, 16) + SourceIndex(0) -7 >Emitted(43, 58) Source(52, 57) + SourceIndex(0) -8 >Emitted(43, 59) Source(52, 58) + SourceIndex(0) -9 >Emitted(43, 62) Source(52, 61) + SourceIndex(0) -10>Emitted(43, 63) Source(52, 62) + SourceIndex(0) -11>Emitted(43, 65) Source(52, 64) + SourceIndex(0) -12>Emitted(43, 66) Source(52, 65) + SourceIndex(0) -13>Emitted(43, 69) Source(52, 68) + SourceIndex(0) -14>Emitted(43, 70) Source(52, 69) + SourceIndex(0) -15>Emitted(43, 72) Source(52, 71) + SourceIndex(0) -16>Emitted(43, 73) Source(52, 72) + SourceIndex(0) -17>Emitted(43, 75) Source(52, 74) + SourceIndex(0) -18>Emitted(43, 77) Source(52, 76) + SourceIndex(0) -19>Emitted(43, 78) Source(52, 77) + SourceIndex(0) +2 >Emitted(43, 6) Source(52, 11) + SourceIndex(0) +3 >Emitted(43, 10) Source(52, 11) + SourceIndex(0) +4 >Emitted(43, 56) Source(52, 16) + SourceIndex(0) +5 >Emitted(43, 58) Source(52, 57) + SourceIndex(0) +6 >Emitted(43, 59) Source(52, 58) + SourceIndex(0) +7 >Emitted(43, 62) Source(52, 61) + SourceIndex(0) +8 >Emitted(43, 63) Source(52, 62) + SourceIndex(0) +9 >Emitted(43, 65) Source(52, 64) + SourceIndex(0) +10>Emitted(43, 66) Source(52, 65) + SourceIndex(0) +11>Emitted(43, 69) Source(52, 68) + SourceIndex(0) +12>Emitted(43, 70) Source(52, 69) + SourceIndex(0) +13>Emitted(43, 72) Source(52, 71) + SourceIndex(0) +14>Emitted(43, 73) Source(52, 72) + SourceIndex(0) +15>Emitted(43, 75) Source(52, 74) + SourceIndex(0) +16>Emitted(43, 77) Source(52, 76) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1412,7 +1265,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1431,87 +1284,75 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(44, 24) Source(53, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(45, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(45, 2) Source(54, 2) + SourceIndex(0) + >} +1 >Emitted(45, 2) Source(54, 2) + SourceIndex(0) --- >>>for (var numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > > -2 >for -3 > -4 > (let [ -5 > -6 > numberA2 -7 > , -8 > nameA2 -9 > , -10> skillA2 -11> ] = robotA, -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let [ +3 > +4 > numberA2 +5 > , +6 > nameA2 +7 > , +8 > skillA2 +9 > ] = robotA, +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(46, 1) Source(56, 1) + SourceIndex(0) -2 >Emitted(46, 4) Source(56, 4) + SourceIndex(0) -3 >Emitted(46, 5) Source(56, 5) + SourceIndex(0) -4 >Emitted(46, 6) Source(56, 11) + SourceIndex(0) -5 >Emitted(46, 10) Source(56, 11) + SourceIndex(0) -6 >Emitted(46, 30) Source(56, 19) + SourceIndex(0) -7 >Emitted(46, 32) Source(56, 21) + SourceIndex(0) -8 >Emitted(46, 50) Source(56, 27) + SourceIndex(0) -9 >Emitted(46, 52) Source(56, 29) + SourceIndex(0) -10>Emitted(46, 71) Source(56, 36) + SourceIndex(0) -11>Emitted(46, 73) Source(56, 48) + SourceIndex(0) -12>Emitted(46, 74) Source(56, 49) + SourceIndex(0) -13>Emitted(46, 77) Source(56, 52) + SourceIndex(0) -14>Emitted(46, 78) Source(56, 53) + SourceIndex(0) -15>Emitted(46, 80) Source(56, 55) + SourceIndex(0) -16>Emitted(46, 81) Source(56, 56) + SourceIndex(0) -17>Emitted(46, 84) Source(56, 59) + SourceIndex(0) -18>Emitted(46, 85) Source(56, 60) + SourceIndex(0) -19>Emitted(46, 87) Source(56, 62) + SourceIndex(0) -20>Emitted(46, 88) Source(56, 63) + SourceIndex(0) -21>Emitted(46, 90) Source(56, 65) + SourceIndex(0) -22>Emitted(46, 92) Source(56, 67) + SourceIndex(0) -23>Emitted(46, 93) Source(56, 68) + SourceIndex(0) +2 >Emitted(46, 6) Source(56, 11) + SourceIndex(0) +3 >Emitted(46, 10) Source(56, 11) + SourceIndex(0) +4 >Emitted(46, 30) Source(56, 19) + SourceIndex(0) +5 >Emitted(46, 32) Source(56, 21) + SourceIndex(0) +6 >Emitted(46, 50) Source(56, 27) + SourceIndex(0) +7 >Emitted(46, 52) Source(56, 29) + SourceIndex(0) +8 >Emitted(46, 71) Source(56, 36) + SourceIndex(0) +9 >Emitted(46, 73) Source(56, 48) + SourceIndex(0) +10>Emitted(46, 74) Source(56, 49) + SourceIndex(0) +11>Emitted(46, 77) Source(56, 52) + SourceIndex(0) +12>Emitted(46, 78) Source(56, 53) + SourceIndex(0) +13>Emitted(46, 80) Source(56, 55) + SourceIndex(0) +14>Emitted(46, 81) Source(56, 56) + SourceIndex(0) +15>Emitted(46, 84) Source(56, 59) + SourceIndex(0) +16>Emitted(46, 85) Source(56, 60) + SourceIndex(0) +17>Emitted(46, 87) Source(56, 62) + SourceIndex(0) +18>Emitted(46, 88) Source(56, 63) + SourceIndex(0) +19>Emitted(46, 90) Source(56, 65) + SourceIndex(0) +20>Emitted(46, 92) Source(56, 67) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1522,7 +1363,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1541,92 +1382,80 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(47, 25) Source(57, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(48, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(48, 2) Source(58, 2) + SourceIndex(0) + >} +1 >Emitted(48, 2) Source(58, 2) + SourceIndex(0) --- >>>for (var _h = getRobot(), numberA2 = _h[0], nameA2 = _h[1], skillA2 = _h[2], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA2, nameA2, skillA2] = getRobot() -7 > -8 > numberA2 -9 > , -10> nameA2 -11> , -12> skillA2 -13> ] = getRobot(), -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let +3 > +4 > [numberA2, nameA2, skillA2] = getRobot() +5 > +6 > numberA2 +7 > , +8 > nameA2 +9 > , +10> skillA2 +11> ] = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(49, 1) Source(59, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(59, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(59, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(59, 10) + SourceIndex(0) -5 >Emitted(49, 10) Source(59, 10) + SourceIndex(0) -6 >Emitted(49, 25) Source(59, 50) + SourceIndex(0) -7 >Emitted(49, 27) Source(59, 11) + SourceIndex(0) -8 >Emitted(49, 43) Source(59, 19) + SourceIndex(0) -9 >Emitted(49, 45) Source(59, 21) + SourceIndex(0) -10>Emitted(49, 59) Source(59, 27) + SourceIndex(0) -11>Emitted(49, 61) Source(59, 29) + SourceIndex(0) -12>Emitted(49, 76) Source(59, 36) + SourceIndex(0) -13>Emitted(49, 78) Source(59, 52) + SourceIndex(0) -14>Emitted(49, 79) Source(59, 53) + SourceIndex(0) -15>Emitted(49, 82) Source(59, 56) + SourceIndex(0) -16>Emitted(49, 83) Source(59, 57) + SourceIndex(0) -17>Emitted(49, 85) Source(59, 59) + SourceIndex(0) -18>Emitted(49, 86) Source(59, 60) + SourceIndex(0) -19>Emitted(49, 89) Source(59, 63) + SourceIndex(0) -20>Emitted(49, 90) Source(59, 64) + SourceIndex(0) -21>Emitted(49, 92) Source(59, 66) + SourceIndex(0) -22>Emitted(49, 93) Source(59, 67) + SourceIndex(0) -23>Emitted(49, 95) Source(59, 69) + SourceIndex(0) -24>Emitted(49, 97) Source(59, 71) + SourceIndex(0) -25>Emitted(49, 98) Source(59, 72) + SourceIndex(0) +2 >Emitted(49, 6) Source(59, 10) + SourceIndex(0) +3 >Emitted(49, 10) Source(59, 10) + SourceIndex(0) +4 >Emitted(49, 25) Source(59, 50) + SourceIndex(0) +5 >Emitted(49, 27) Source(59, 11) + SourceIndex(0) +6 >Emitted(49, 43) Source(59, 19) + SourceIndex(0) +7 >Emitted(49, 45) Source(59, 21) + SourceIndex(0) +8 >Emitted(49, 59) Source(59, 27) + SourceIndex(0) +9 >Emitted(49, 61) Source(59, 29) + SourceIndex(0) +10>Emitted(49, 76) Source(59, 36) + SourceIndex(0) +11>Emitted(49, 78) Source(59, 52) + SourceIndex(0) +12>Emitted(49, 79) Source(59, 53) + SourceIndex(0) +13>Emitted(49, 82) Source(59, 56) + SourceIndex(0) +14>Emitted(49, 83) Source(59, 57) + SourceIndex(0) +15>Emitted(49, 85) Source(59, 59) + SourceIndex(0) +16>Emitted(49, 86) Source(59, 60) + SourceIndex(0) +17>Emitted(49, 89) Source(59, 63) + SourceIndex(0) +18>Emitted(49, 90) Source(59, 64) + SourceIndex(0) +19>Emitted(49, 92) Source(59, 66) + SourceIndex(0) +20>Emitted(49, 93) Source(59, 67) + SourceIndex(0) +21>Emitted(49, 95) Source(59, 69) + SourceIndex(0) +22>Emitted(49, 97) Source(59, 71) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1637,7 +1466,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1656,92 +1485,80 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(50, 25) Source(60, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(51, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(51, 2) Source(61, 2) + SourceIndex(0) + >} +1 >Emitted(51, 2) Source(61, 2) + SourceIndex(0) --- >>>for (var _j = [2, "trimmer", "trimming"], numberA2 = _j[0], nameA2 = _j[1], skillA2 = _j[2], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] -7 > -8 > numberA2 -9 > , -10> nameA2 -11> , -12> skillA2 -13> ] = [2, "trimmer", "trimming"], -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let +3 > +4 > [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] +5 > +6 > numberA2 +7 > , +8 > nameA2 +9 > , +10> skillA2 +11> ] = [2, "trimmer", "trimming"], +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(52, 1) Source(62, 1) + SourceIndex(0) -2 >Emitted(52, 4) Source(62, 4) + SourceIndex(0) -3 >Emitted(52, 5) Source(62, 5) + SourceIndex(0) -4 >Emitted(52, 6) Source(62, 10) + SourceIndex(0) -5 >Emitted(52, 10) Source(62, 10) + SourceIndex(0) -6 >Emitted(52, 41) Source(62, 66) + SourceIndex(0) -7 >Emitted(52, 43) Source(62, 11) + SourceIndex(0) -8 >Emitted(52, 59) Source(62, 19) + SourceIndex(0) -9 >Emitted(52, 61) Source(62, 21) + SourceIndex(0) -10>Emitted(52, 75) Source(62, 27) + SourceIndex(0) -11>Emitted(52, 77) Source(62, 29) + SourceIndex(0) -12>Emitted(52, 92) Source(62, 36) + SourceIndex(0) -13>Emitted(52, 94) Source(62, 68) + SourceIndex(0) -14>Emitted(52, 95) Source(62, 69) + SourceIndex(0) -15>Emitted(52, 98) Source(62, 72) + SourceIndex(0) -16>Emitted(52, 99) Source(62, 73) + SourceIndex(0) -17>Emitted(52, 101) Source(62, 75) + SourceIndex(0) -18>Emitted(52, 102) Source(62, 76) + SourceIndex(0) -19>Emitted(52, 105) Source(62, 79) + SourceIndex(0) -20>Emitted(52, 106) Source(62, 80) + SourceIndex(0) -21>Emitted(52, 108) Source(62, 82) + SourceIndex(0) -22>Emitted(52, 109) Source(62, 83) + SourceIndex(0) -23>Emitted(52, 111) Source(62, 85) + SourceIndex(0) -24>Emitted(52, 113) Source(62, 87) + SourceIndex(0) -25>Emitted(52, 114) Source(62, 88) + SourceIndex(0) +2 >Emitted(52, 6) Source(62, 10) + SourceIndex(0) +3 >Emitted(52, 10) Source(62, 10) + SourceIndex(0) +4 >Emitted(52, 41) Source(62, 66) + SourceIndex(0) +5 >Emitted(52, 43) Source(62, 11) + SourceIndex(0) +6 >Emitted(52, 59) Source(62, 19) + SourceIndex(0) +7 >Emitted(52, 61) Source(62, 21) + SourceIndex(0) +8 >Emitted(52, 75) Source(62, 27) + SourceIndex(0) +9 >Emitted(52, 77) Source(62, 29) + SourceIndex(0) +10>Emitted(52, 92) Source(62, 36) + SourceIndex(0) +11>Emitted(52, 94) Source(62, 68) + SourceIndex(0) +12>Emitted(52, 95) Source(62, 69) + SourceIndex(0) +13>Emitted(52, 98) Source(62, 72) + SourceIndex(0) +14>Emitted(52, 99) Source(62, 73) + SourceIndex(0) +15>Emitted(52, 101) Source(62, 75) + SourceIndex(0) +16>Emitted(52, 102) Source(62, 76) + SourceIndex(0) +17>Emitted(52, 105) Source(62, 79) + SourceIndex(0) +18>Emitted(52, 106) Source(62, 80) + SourceIndex(0) +19>Emitted(52, 108) Source(62, 82) + SourceIndex(0) +20>Emitted(52, 109) Source(62, 83) + SourceIndex(0) +21>Emitted(52, 111) Source(62, 85) + SourceIndex(0) +22>Emitted(52, 113) Source(62, 87) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1752,7 +1569,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1771,92 +1588,80 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(53, 25) Source(63, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(54, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(54, 2) Source(64, 2) + SourceIndex(0) + >} +1 >Emitted(54, 2) Source(64, 2) + SourceIndex(0) --- >>>for (var nameMA = multiRobotA[0], _k = multiRobotA[1], primarySkillA = _k[0], secondarySkillA = _k[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > nameMA -7 > , -8 > [primarySkillA, secondarySkillA] -9 > -10> primarySkillA -11> , -12> secondarySkillA -13> ]] = multiRobotA, -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let [ +3 > +4 > nameMA +5 > , +6 > [primarySkillA, secondarySkillA] +7 > +8 > primarySkillA +9 > , +10> secondarySkillA +11> ]] = multiRobotA, +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(55, 1) Source(65, 1) + SourceIndex(0) -2 >Emitted(55, 4) Source(65, 4) + SourceIndex(0) -3 >Emitted(55, 5) Source(65, 5) + SourceIndex(0) -4 >Emitted(55, 6) Source(65, 11) + SourceIndex(0) -5 >Emitted(55, 10) Source(65, 11) + SourceIndex(0) -6 >Emitted(55, 33) Source(65, 17) + SourceIndex(0) -7 >Emitted(55, 35) Source(65, 19) + SourceIndex(0) -8 >Emitted(55, 54) Source(65, 51) + SourceIndex(0) -9 >Emitted(55, 56) Source(65, 20) + SourceIndex(0) -10>Emitted(55, 77) Source(65, 33) + SourceIndex(0) -11>Emitted(55, 79) Source(65, 35) + SourceIndex(0) -12>Emitted(55, 102) Source(65, 50) + SourceIndex(0) -13>Emitted(55, 104) Source(65, 68) + SourceIndex(0) -14>Emitted(55, 105) Source(65, 69) + SourceIndex(0) -15>Emitted(55, 108) Source(65, 72) + SourceIndex(0) -16>Emitted(55, 109) Source(65, 73) + SourceIndex(0) -17>Emitted(55, 111) Source(65, 75) + SourceIndex(0) -18>Emitted(55, 112) Source(65, 76) + SourceIndex(0) -19>Emitted(55, 115) Source(65, 79) + SourceIndex(0) -20>Emitted(55, 116) Source(65, 80) + SourceIndex(0) -21>Emitted(55, 118) Source(65, 82) + SourceIndex(0) -22>Emitted(55, 119) Source(65, 83) + SourceIndex(0) -23>Emitted(55, 121) Source(65, 85) + SourceIndex(0) -24>Emitted(55, 123) Source(65, 87) + SourceIndex(0) -25>Emitted(55, 124) Source(65, 88) + SourceIndex(0) +2 >Emitted(55, 6) Source(65, 11) + SourceIndex(0) +3 >Emitted(55, 10) Source(65, 11) + SourceIndex(0) +4 >Emitted(55, 33) Source(65, 17) + SourceIndex(0) +5 >Emitted(55, 35) Source(65, 19) + SourceIndex(0) +6 >Emitted(55, 54) Source(65, 51) + SourceIndex(0) +7 >Emitted(55, 56) Source(65, 20) + SourceIndex(0) +8 >Emitted(55, 77) Source(65, 33) + SourceIndex(0) +9 >Emitted(55, 79) Source(65, 35) + SourceIndex(0) +10>Emitted(55, 102) Source(65, 50) + SourceIndex(0) +11>Emitted(55, 104) Source(65, 68) + SourceIndex(0) +12>Emitted(55, 105) Source(65, 69) + SourceIndex(0) +13>Emitted(55, 108) Source(65, 72) + SourceIndex(0) +14>Emitted(55, 109) Source(65, 73) + SourceIndex(0) +15>Emitted(55, 111) Source(65, 75) + SourceIndex(0) +16>Emitted(55, 112) Source(65, 76) + SourceIndex(0) +17>Emitted(55, 115) Source(65, 79) + SourceIndex(0) +18>Emitted(55, 116) Source(65, 80) + SourceIndex(0) +19>Emitted(55, 118) Source(65, 82) + SourceIndex(0) +20>Emitted(55, 119) Source(65, 83) + SourceIndex(0) +21>Emitted(55, 121) Source(65, 85) + SourceIndex(0) +22>Emitted(55, 123) Source(65, 87) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -1867,7 +1672,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1886,98 +1691,86 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(56, 25) Source(66, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(57, 1) Source(67, 1) + SourceIndex(0) -2 >Emitted(57, 2) Source(67, 2) + SourceIndex(0) + >} +1 >Emitted(57, 2) Source(67, 2) + SourceIndex(0) --- >>>for (var _l = getMultiRobot(), nameMA = _l[0], _m = _l[1], primarySkillA = _m[0], secondarySkillA = _m[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^ -26> ^^ -27> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() -7 > -8 > nameMA -9 > , -10> [primarySkillA, secondarySkillA] -11> -12> primarySkillA -13> , -14> secondarySkillA -15> ]] = getMultiRobot(), -16> i -17> = -18> 0 -19> ; -20> i -21> < -22> 1 -23> ; -24> i -25> ++ -26> ) -27> { +2 >for (let +3 > +4 > [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() +5 > +6 > nameMA +7 > , +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = getMultiRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) 1->Emitted(58, 1) Source(68, 1) + SourceIndex(0) -2 >Emitted(58, 4) Source(68, 4) + SourceIndex(0) -3 >Emitted(58, 5) Source(68, 5) + SourceIndex(0) -4 >Emitted(58, 6) Source(68, 10) + SourceIndex(0) -5 >Emitted(58, 10) Source(68, 10) + SourceIndex(0) -6 >Emitted(58, 30) Source(68, 70) + SourceIndex(0) -7 >Emitted(58, 32) Source(68, 11) + SourceIndex(0) -8 >Emitted(58, 46) Source(68, 17) + SourceIndex(0) -9 >Emitted(58, 48) Source(68, 19) + SourceIndex(0) -10>Emitted(58, 58) Source(68, 51) + SourceIndex(0) -11>Emitted(58, 60) Source(68, 20) + SourceIndex(0) -12>Emitted(58, 81) Source(68, 33) + SourceIndex(0) -13>Emitted(58, 83) Source(68, 35) + SourceIndex(0) -14>Emitted(58, 106) Source(68, 50) + SourceIndex(0) -15>Emitted(58, 108) Source(68, 72) + SourceIndex(0) -16>Emitted(58, 109) Source(68, 73) + SourceIndex(0) -17>Emitted(58, 112) Source(68, 76) + SourceIndex(0) -18>Emitted(58, 113) Source(68, 77) + SourceIndex(0) -19>Emitted(58, 115) Source(68, 79) + SourceIndex(0) -20>Emitted(58, 116) Source(68, 80) + SourceIndex(0) -21>Emitted(58, 119) Source(68, 83) + SourceIndex(0) -22>Emitted(58, 120) Source(68, 84) + SourceIndex(0) -23>Emitted(58, 122) Source(68, 86) + SourceIndex(0) -24>Emitted(58, 123) Source(68, 87) + SourceIndex(0) -25>Emitted(58, 125) Source(68, 89) + SourceIndex(0) -26>Emitted(58, 127) Source(68, 91) + SourceIndex(0) -27>Emitted(58, 128) Source(68, 92) + SourceIndex(0) +2 >Emitted(58, 6) Source(68, 10) + SourceIndex(0) +3 >Emitted(58, 10) Source(68, 10) + SourceIndex(0) +4 >Emitted(58, 30) Source(68, 70) + SourceIndex(0) +5 >Emitted(58, 32) Source(68, 11) + SourceIndex(0) +6 >Emitted(58, 46) Source(68, 17) + SourceIndex(0) +7 >Emitted(58, 48) Source(68, 19) + SourceIndex(0) +8 >Emitted(58, 58) Source(68, 51) + SourceIndex(0) +9 >Emitted(58, 60) Source(68, 20) + SourceIndex(0) +10>Emitted(58, 81) Source(68, 33) + SourceIndex(0) +11>Emitted(58, 83) Source(68, 35) + SourceIndex(0) +12>Emitted(58, 106) Source(68, 50) + SourceIndex(0) +13>Emitted(58, 108) Source(68, 72) + SourceIndex(0) +14>Emitted(58, 109) Source(68, 73) + SourceIndex(0) +15>Emitted(58, 112) Source(68, 76) + SourceIndex(0) +16>Emitted(58, 113) Source(68, 77) + SourceIndex(0) +17>Emitted(58, 115) Source(68, 79) + SourceIndex(0) +18>Emitted(58, 116) Source(68, 80) + SourceIndex(0) +19>Emitted(58, 119) Source(68, 83) + SourceIndex(0) +20>Emitted(58, 120) Source(68, 84) + SourceIndex(0) +21>Emitted(58, 122) Source(68, 86) + SourceIndex(0) +22>Emitted(58, 123) Source(68, 87) + SourceIndex(0) +23>Emitted(58, 125) Source(68, 89) + SourceIndex(0) +24>Emitted(58, 127) Source(68, 91) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -1988,7 +1781,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2007,98 +1800,86 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(59, 25) Source(69, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(60, 1) Source(70, 1) + SourceIndex(0) -2 >Emitted(60, 2) Source(70, 2) + SourceIndex(0) + >} +1 >Emitted(60, 2) Source(70, 2) + SourceIndex(0) --- >>>for (var _o = ["trimmer", ["trimming", "edging"]], nameMA = _o[0], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1], i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^ -26> ^^ -27> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] -7 > -8 > nameMA -9 > , -10> [primarySkillA, secondarySkillA] -11> -12> primarySkillA -13> , -14> secondarySkillA -15> ]] = ["trimmer", ["trimming", "edging"]], -16> i -17> = -18> 0 -19> ; -20> i -21> < -22> 1 -23> ; -24> i -25> ++ -26> ) -27> { +2 >for (let +3 > +4 > [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +5 > +6 > nameMA +7 > , +8 > [primarySkillA, secondarySkillA] +9 > +10> primarySkillA +11> , +12> secondarySkillA +13> ]] = ["trimmer", ["trimming", "edging"]], +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) 1->Emitted(61, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(71, 10) + SourceIndex(0) -5 >Emitted(61, 10) Source(71, 10) + SourceIndex(0) -6 >Emitted(61, 50) Source(71, 90) + SourceIndex(0) -7 >Emitted(61, 52) Source(71, 11) + SourceIndex(0) -8 >Emitted(61, 66) Source(71, 17) + SourceIndex(0) -9 >Emitted(61, 68) Source(71, 19) + SourceIndex(0) -10>Emitted(61, 78) Source(71, 51) + SourceIndex(0) -11>Emitted(61, 80) Source(71, 20) + SourceIndex(0) -12>Emitted(61, 101) Source(71, 33) + SourceIndex(0) -13>Emitted(61, 103) Source(71, 35) + SourceIndex(0) -14>Emitted(61, 126) Source(71, 50) + SourceIndex(0) -15>Emitted(61, 128) Source(71, 92) + SourceIndex(0) -16>Emitted(61, 129) Source(71, 93) + SourceIndex(0) -17>Emitted(61, 132) Source(71, 96) + SourceIndex(0) -18>Emitted(61, 133) Source(71, 97) + SourceIndex(0) -19>Emitted(61, 135) Source(71, 99) + SourceIndex(0) -20>Emitted(61, 136) Source(71, 100) + SourceIndex(0) -21>Emitted(61, 139) Source(71, 103) + SourceIndex(0) -22>Emitted(61, 140) Source(71, 104) + SourceIndex(0) -23>Emitted(61, 142) Source(71, 106) + SourceIndex(0) -24>Emitted(61, 143) Source(71, 107) + SourceIndex(0) -25>Emitted(61, 145) Source(71, 109) + SourceIndex(0) -26>Emitted(61, 147) Source(71, 111) + SourceIndex(0) -27>Emitted(61, 148) Source(71, 112) + SourceIndex(0) +2 >Emitted(61, 6) Source(71, 10) + SourceIndex(0) +3 >Emitted(61, 10) Source(71, 10) + SourceIndex(0) +4 >Emitted(61, 50) Source(71, 90) + SourceIndex(0) +5 >Emitted(61, 52) Source(71, 11) + SourceIndex(0) +6 >Emitted(61, 66) Source(71, 17) + SourceIndex(0) +7 >Emitted(61, 68) Source(71, 19) + SourceIndex(0) +8 >Emitted(61, 78) Source(71, 51) + SourceIndex(0) +9 >Emitted(61, 80) Source(71, 20) + SourceIndex(0) +10>Emitted(61, 101) Source(71, 33) + SourceIndex(0) +11>Emitted(61, 103) Source(71, 35) + SourceIndex(0) +12>Emitted(61, 126) Source(71, 50) + SourceIndex(0) +13>Emitted(61, 128) Source(71, 92) + SourceIndex(0) +14>Emitted(61, 129) Source(71, 93) + SourceIndex(0) +15>Emitted(61, 132) Source(71, 96) + SourceIndex(0) +16>Emitted(61, 133) Source(71, 97) + SourceIndex(0) +17>Emitted(61, 135) Source(71, 99) + SourceIndex(0) +18>Emitted(61, 136) Source(71, 100) + SourceIndex(0) +19>Emitted(61, 139) Source(71, 103) + SourceIndex(0) +20>Emitted(61, 140) Source(71, 104) + SourceIndex(0) +21>Emitted(61, 142) Source(71, 106) + SourceIndex(0) +22>Emitted(61, 143) Source(71, 107) + SourceIndex(0) +23>Emitted(61, 145) Source(71, 109) + SourceIndex(0) +24>Emitted(61, 147) Source(71, 111) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2109,7 +1890,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2128,81 +1909,69 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(62, 25) Source(72, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(63, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(63, 2) Source(73, 2) + SourceIndex(0) + >} +1 >Emitted(63, 2) Source(73, 2) + SourceIndex(0) --- >>>for (var numberA3 = robotA[0], robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > > -2 >for -3 > -4 > (let [ -5 > -6 > numberA3 -7 > , -8 > ...robotAInfo -9 > ] = robotA, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [ +3 > +4 > numberA3 +5 > , +6 > ...robotAInfo +7 > ] = robotA, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(64, 1) Source(75, 1) + SourceIndex(0) -2 >Emitted(64, 4) Source(75, 4) + SourceIndex(0) -3 >Emitted(64, 5) Source(75, 5) + SourceIndex(0) -4 >Emitted(64, 6) Source(75, 11) + SourceIndex(0) -5 >Emitted(64, 10) Source(75, 11) + SourceIndex(0) -6 >Emitted(64, 30) Source(75, 19) + SourceIndex(0) -7 >Emitted(64, 32) Source(75, 21) + SourceIndex(0) -8 >Emitted(64, 60) Source(75, 34) + SourceIndex(0) -9 >Emitted(64, 62) Source(75, 46) + SourceIndex(0) -10>Emitted(64, 63) Source(75, 47) + SourceIndex(0) -11>Emitted(64, 66) Source(75, 50) + SourceIndex(0) -12>Emitted(64, 67) Source(75, 51) + SourceIndex(0) -13>Emitted(64, 69) Source(75, 53) + SourceIndex(0) -14>Emitted(64, 70) Source(75, 54) + SourceIndex(0) -15>Emitted(64, 73) Source(75, 57) + SourceIndex(0) -16>Emitted(64, 74) Source(75, 58) + SourceIndex(0) -17>Emitted(64, 76) Source(75, 60) + SourceIndex(0) -18>Emitted(64, 77) Source(75, 61) + SourceIndex(0) -19>Emitted(64, 79) Source(75, 63) + SourceIndex(0) -20>Emitted(64, 81) Source(75, 65) + SourceIndex(0) -21>Emitted(64, 82) Source(75, 66) + SourceIndex(0) +2 >Emitted(64, 6) Source(75, 11) + SourceIndex(0) +3 >Emitted(64, 10) Source(75, 11) + SourceIndex(0) +4 >Emitted(64, 30) Source(75, 19) + SourceIndex(0) +5 >Emitted(64, 32) Source(75, 21) + SourceIndex(0) +6 >Emitted(64, 60) Source(75, 34) + SourceIndex(0) +7 >Emitted(64, 62) Source(75, 46) + SourceIndex(0) +8 >Emitted(64, 63) Source(75, 47) + SourceIndex(0) +9 >Emitted(64, 66) Source(75, 50) + SourceIndex(0) +10>Emitted(64, 67) Source(75, 51) + SourceIndex(0) +11>Emitted(64, 69) Source(75, 53) + SourceIndex(0) +12>Emitted(64, 70) Source(75, 54) + SourceIndex(0) +13>Emitted(64, 73) Source(75, 57) + SourceIndex(0) +14>Emitted(64, 74) Source(75, 58) + SourceIndex(0) +15>Emitted(64, 76) Source(75, 60) + SourceIndex(0) +16>Emitted(64, 77) Source(75, 61) + SourceIndex(0) +17>Emitted(64, 79) Source(75, 63) + SourceIndex(0) +18>Emitted(64, 81) Source(75, 65) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2213,7 +1982,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2232,86 +2001,74 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(65, 27) Source(76, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(66, 1) Source(77, 1) + SourceIndex(0) -2 >Emitted(66, 2) Source(77, 2) + SourceIndex(0) + >} +1 >Emitted(66, 2) Source(77, 2) + SourceIndex(0) --- >>>for (var _q = getRobot(), numberA3 = _q[0], robotAInfo = _q.slice(1), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA3, ...robotAInfo] = getRobot() -7 > -8 > numberA3 -9 > , -10> ...robotAInfo -11> ] = getRobot(), -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let +3 > +4 > [numberA3, ...robotAInfo] = getRobot() +5 > +6 > numberA3 +7 > , +8 > ...robotAInfo +9 > ] = getRobot(), +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(67, 1) Source(78, 1) + SourceIndex(0) -2 >Emitted(67, 4) Source(78, 4) + SourceIndex(0) -3 >Emitted(67, 5) Source(78, 5) + SourceIndex(0) -4 >Emitted(67, 6) Source(78, 10) + SourceIndex(0) -5 >Emitted(67, 10) Source(78, 10) + SourceIndex(0) -6 >Emitted(67, 25) Source(78, 48) + SourceIndex(0) -7 >Emitted(67, 27) Source(78, 11) + SourceIndex(0) -8 >Emitted(67, 43) Source(78, 19) + SourceIndex(0) -9 >Emitted(67, 45) Source(78, 21) + SourceIndex(0) -10>Emitted(67, 69) Source(78, 34) + SourceIndex(0) -11>Emitted(67, 71) Source(78, 50) + SourceIndex(0) -12>Emitted(67, 72) Source(78, 51) + SourceIndex(0) -13>Emitted(67, 75) Source(78, 54) + SourceIndex(0) -14>Emitted(67, 76) Source(78, 55) + SourceIndex(0) -15>Emitted(67, 78) Source(78, 57) + SourceIndex(0) -16>Emitted(67, 79) Source(78, 58) + SourceIndex(0) -17>Emitted(67, 82) Source(78, 61) + SourceIndex(0) -18>Emitted(67, 83) Source(78, 62) + SourceIndex(0) -19>Emitted(67, 85) Source(78, 64) + SourceIndex(0) -20>Emitted(67, 86) Source(78, 65) + SourceIndex(0) -21>Emitted(67, 88) Source(78, 67) + SourceIndex(0) -22>Emitted(67, 90) Source(78, 69) + SourceIndex(0) -23>Emitted(67, 91) Source(78, 70) + SourceIndex(0) +2 >Emitted(67, 6) Source(78, 10) + SourceIndex(0) +3 >Emitted(67, 10) Source(78, 10) + SourceIndex(0) +4 >Emitted(67, 25) Source(78, 48) + SourceIndex(0) +5 >Emitted(67, 27) Source(78, 11) + SourceIndex(0) +6 >Emitted(67, 43) Source(78, 19) + SourceIndex(0) +7 >Emitted(67, 45) Source(78, 21) + SourceIndex(0) +8 >Emitted(67, 69) Source(78, 34) + SourceIndex(0) +9 >Emitted(67, 71) Source(78, 50) + SourceIndex(0) +10>Emitted(67, 72) Source(78, 51) + SourceIndex(0) +11>Emitted(67, 75) Source(78, 54) + SourceIndex(0) +12>Emitted(67, 76) Source(78, 55) + SourceIndex(0) +13>Emitted(67, 78) Source(78, 57) + SourceIndex(0) +14>Emitted(67, 79) Source(78, 58) + SourceIndex(0) +15>Emitted(67, 82) Source(78, 61) + SourceIndex(0) +16>Emitted(67, 83) Source(78, 62) + SourceIndex(0) +17>Emitted(67, 85) Source(78, 64) + SourceIndex(0) +18>Emitted(67, 86) Source(78, 65) + SourceIndex(0) +19>Emitted(67, 88) Source(78, 67) + SourceIndex(0) +20>Emitted(67, 90) Source(78, 69) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2322,7 +2079,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2341,86 +2098,74 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(68, 27) Source(79, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(69, 1) Source(80, 1) + SourceIndex(0) -2 >Emitted(69, 2) Source(80, 2) + SourceIndex(0) + >} +1 >Emitted(69, 2) Source(80, 2) + SourceIndex(0) --- >>>for (var _r = [2, "trimmer", "trimming"], numberA3 = _r[0], robotAInfo = _r.slice(1), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] -7 > -8 > numberA3 -9 > , -10> ...robotAInfo -11> ] = [2, "trimmer", "trimming"], -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let +3 > +4 > [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] +5 > +6 > numberA3 +7 > , +8 > ...robotAInfo +9 > ] = [2, "trimmer", "trimming"], +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(70, 1) Source(81, 1) + SourceIndex(0) -2 >Emitted(70, 4) Source(81, 4) + SourceIndex(0) -3 >Emitted(70, 5) Source(81, 5) + SourceIndex(0) -4 >Emitted(70, 6) Source(81, 10) + SourceIndex(0) -5 >Emitted(70, 10) Source(81, 10) + SourceIndex(0) -6 >Emitted(70, 41) Source(81, 64) + SourceIndex(0) -7 >Emitted(70, 43) Source(81, 11) + SourceIndex(0) -8 >Emitted(70, 59) Source(81, 19) + SourceIndex(0) -9 >Emitted(70, 61) Source(81, 21) + SourceIndex(0) -10>Emitted(70, 85) Source(81, 34) + SourceIndex(0) -11>Emitted(70, 87) Source(81, 66) + SourceIndex(0) -12>Emitted(70, 88) Source(81, 67) + SourceIndex(0) -13>Emitted(70, 91) Source(81, 70) + SourceIndex(0) -14>Emitted(70, 92) Source(81, 71) + SourceIndex(0) -15>Emitted(70, 94) Source(81, 73) + SourceIndex(0) -16>Emitted(70, 95) Source(81, 74) + SourceIndex(0) -17>Emitted(70, 98) Source(81, 77) + SourceIndex(0) -18>Emitted(70, 99) Source(81, 78) + SourceIndex(0) -19>Emitted(70, 101) Source(81, 80) + SourceIndex(0) -20>Emitted(70, 102) Source(81, 81) + SourceIndex(0) -21>Emitted(70, 104) Source(81, 83) + SourceIndex(0) -22>Emitted(70, 106) Source(81, 85) + SourceIndex(0) -23>Emitted(70, 107) Source(81, 86) + SourceIndex(0) +2 >Emitted(70, 6) Source(81, 10) + SourceIndex(0) +3 >Emitted(70, 10) Source(81, 10) + SourceIndex(0) +4 >Emitted(70, 41) Source(81, 64) + SourceIndex(0) +5 >Emitted(70, 43) Source(81, 11) + SourceIndex(0) +6 >Emitted(70, 59) Source(81, 19) + SourceIndex(0) +7 >Emitted(70, 61) Source(81, 21) + SourceIndex(0) +8 >Emitted(70, 85) Source(81, 34) + SourceIndex(0) +9 >Emitted(70, 87) Source(81, 66) + SourceIndex(0) +10>Emitted(70, 88) Source(81, 67) + SourceIndex(0) +11>Emitted(70, 91) Source(81, 70) + SourceIndex(0) +12>Emitted(70, 92) Source(81, 71) + SourceIndex(0) +13>Emitted(70, 94) Source(81, 73) + SourceIndex(0) +14>Emitted(70, 95) Source(81, 74) + SourceIndex(0) +15>Emitted(70, 98) Source(81, 77) + SourceIndex(0) +16>Emitted(70, 99) Source(81, 78) + SourceIndex(0) +17>Emitted(70, 101) Source(81, 80) + SourceIndex(0) +18>Emitted(70, 102) Source(81, 81) + SourceIndex(0) +19>Emitted(70, 104) Source(81, 83) + SourceIndex(0) +20>Emitted(70, 106) Source(81, 85) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2431,7 +2176,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2450,74 +2195,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(71, 27) Source(82, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(72, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(72, 2) Source(83, 2) + SourceIndex(0) + >} +1 >Emitted(72, 2) Source(83, 2) + SourceIndex(0) --- >>>for (var multiRobotAInfo = multiRobotA.slice(0), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > ...multiRobotAInfo -7 > ] = multiRobotA, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > ...multiRobotAInfo +5 > ] = multiRobotA, +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(73, 1) Source(84, 1) + SourceIndex(0) -2 >Emitted(73, 4) Source(84, 4) + SourceIndex(0) -3 >Emitted(73, 5) Source(84, 5) + SourceIndex(0) -4 >Emitted(73, 6) Source(84, 11) + SourceIndex(0) -5 >Emitted(73, 10) Source(84, 11) + SourceIndex(0) -6 >Emitted(73, 48) Source(84, 29) + SourceIndex(0) -7 >Emitted(73, 50) Source(84, 46) + SourceIndex(0) -8 >Emitted(73, 51) Source(84, 47) + SourceIndex(0) -9 >Emitted(73, 54) Source(84, 50) + SourceIndex(0) -10>Emitted(73, 55) Source(84, 51) + SourceIndex(0) -11>Emitted(73, 57) Source(84, 53) + SourceIndex(0) -12>Emitted(73, 58) Source(84, 54) + SourceIndex(0) -13>Emitted(73, 61) Source(84, 57) + SourceIndex(0) -14>Emitted(73, 62) Source(84, 58) + SourceIndex(0) -15>Emitted(73, 64) Source(84, 60) + SourceIndex(0) -16>Emitted(73, 65) Source(84, 61) + SourceIndex(0) -17>Emitted(73, 67) Source(84, 63) + SourceIndex(0) -18>Emitted(73, 69) Source(84, 65) + SourceIndex(0) -19>Emitted(73, 70) Source(84, 66) + SourceIndex(0) +2 >Emitted(73, 6) Source(84, 11) + SourceIndex(0) +3 >Emitted(73, 10) Source(84, 11) + SourceIndex(0) +4 >Emitted(73, 48) Source(84, 29) + SourceIndex(0) +5 >Emitted(73, 50) Source(84, 46) + SourceIndex(0) +6 >Emitted(73, 51) Source(84, 47) + SourceIndex(0) +7 >Emitted(73, 54) Source(84, 50) + SourceIndex(0) +8 >Emitted(73, 55) Source(84, 51) + SourceIndex(0) +9 >Emitted(73, 57) Source(84, 53) + SourceIndex(0) +10>Emitted(73, 58) Source(84, 54) + SourceIndex(0) +11>Emitted(73, 61) Source(84, 57) + SourceIndex(0) +12>Emitted(73, 62) Source(84, 58) + SourceIndex(0) +13>Emitted(73, 64) Source(84, 60) + SourceIndex(0) +14>Emitted(73, 65) Source(84, 61) + SourceIndex(0) +15>Emitted(73, 67) Source(84, 63) + SourceIndex(0) +16>Emitted(73, 69) Source(84, 65) + SourceIndex(0) --- >>> console.log(multiRobotAInfo); 1 >^^^^ @@ -2528,7 +2261,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2547,74 +2280,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(74, 34) Source(85, 34) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(75, 1) Source(86, 1) + SourceIndex(0) -2 >Emitted(75, 2) Source(86, 2) + SourceIndex(0) + >} +1 >Emitted(75, 2) Source(86, 2) + SourceIndex(0) --- >>>for (var multiRobotAInfo = getMultiRobot().slice(0), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > ...multiRobotAInfo -7 > ] = getMultiRobot(), -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > ...multiRobotAInfo +5 > ] = getMultiRobot(), +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(76, 1) Source(87, 1) + SourceIndex(0) -2 >Emitted(76, 4) Source(87, 4) + SourceIndex(0) -3 >Emitted(76, 5) Source(87, 5) + SourceIndex(0) -4 >Emitted(76, 6) Source(87, 11) + SourceIndex(0) -5 >Emitted(76, 10) Source(87, 11) + SourceIndex(0) -6 >Emitted(76, 52) Source(87, 29) + SourceIndex(0) -7 >Emitted(76, 54) Source(87, 50) + SourceIndex(0) -8 >Emitted(76, 55) Source(87, 51) + SourceIndex(0) -9 >Emitted(76, 58) Source(87, 54) + SourceIndex(0) -10>Emitted(76, 59) Source(87, 55) + SourceIndex(0) -11>Emitted(76, 61) Source(87, 57) + SourceIndex(0) -12>Emitted(76, 62) Source(87, 58) + SourceIndex(0) -13>Emitted(76, 65) Source(87, 61) + SourceIndex(0) -14>Emitted(76, 66) Source(87, 62) + SourceIndex(0) -15>Emitted(76, 68) Source(87, 64) + SourceIndex(0) -16>Emitted(76, 69) Source(87, 65) + SourceIndex(0) -17>Emitted(76, 71) Source(87, 67) + SourceIndex(0) -18>Emitted(76, 73) Source(87, 69) + SourceIndex(0) -19>Emitted(76, 74) Source(87, 70) + SourceIndex(0) +2 >Emitted(76, 6) Source(87, 11) + SourceIndex(0) +3 >Emitted(76, 10) Source(87, 11) + SourceIndex(0) +4 >Emitted(76, 52) Source(87, 29) + SourceIndex(0) +5 >Emitted(76, 54) Source(87, 50) + SourceIndex(0) +6 >Emitted(76, 55) Source(87, 51) + SourceIndex(0) +7 >Emitted(76, 58) Source(87, 54) + SourceIndex(0) +8 >Emitted(76, 59) Source(87, 55) + SourceIndex(0) +9 >Emitted(76, 61) Source(87, 57) + SourceIndex(0) +10>Emitted(76, 62) Source(87, 58) + SourceIndex(0) +11>Emitted(76, 65) Source(87, 61) + SourceIndex(0) +12>Emitted(76, 66) Source(87, 62) + SourceIndex(0) +13>Emitted(76, 68) Source(87, 64) + SourceIndex(0) +14>Emitted(76, 69) Source(87, 65) + SourceIndex(0) +15>Emitted(76, 71) Source(87, 67) + SourceIndex(0) +16>Emitted(76, 73) Source(87, 69) + SourceIndex(0) --- >>> console.log(multiRobotAInfo); 1 >^^^^ @@ -2625,7 +2346,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2644,74 +2365,62 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(77, 34) Source(88, 34) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(78, 1) Source(89, 1) + SourceIndex(0) -2 >Emitted(78, 2) Source(89, 2) + SourceIndex(0) + >} +1 >Emitted(78, 2) Source(89, 2) + SourceIndex(0) --- >>>for (var multiRobotAInfo = ["trimmer", ["trimming", "edging"]].slice(0), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > ...multiRobotAInfo -7 > ] = ["trimmer", ["trimming", "edging"]], -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let [ +3 > +4 > ...multiRobotAInfo +5 > ] = ["trimmer", ["trimming", "edging"]], +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(79, 1) Source(90, 1) + SourceIndex(0) -2 >Emitted(79, 4) Source(90, 4) + SourceIndex(0) -3 >Emitted(79, 5) Source(90, 5) + SourceIndex(0) -4 >Emitted(79, 6) Source(90, 11) + SourceIndex(0) -5 >Emitted(79, 10) Source(90, 11) + SourceIndex(0) -6 >Emitted(79, 72) Source(90, 29) + SourceIndex(0) -7 >Emitted(79, 74) Source(90, 70) + SourceIndex(0) -8 >Emitted(79, 75) Source(90, 71) + SourceIndex(0) -9 >Emitted(79, 78) Source(90, 74) + SourceIndex(0) -10>Emitted(79, 79) Source(90, 75) + SourceIndex(0) -11>Emitted(79, 81) Source(90, 77) + SourceIndex(0) -12>Emitted(79, 82) Source(90, 78) + SourceIndex(0) -13>Emitted(79, 85) Source(90, 81) + SourceIndex(0) -14>Emitted(79, 86) Source(90, 82) + SourceIndex(0) -15>Emitted(79, 88) Source(90, 84) + SourceIndex(0) -16>Emitted(79, 89) Source(90, 85) + SourceIndex(0) -17>Emitted(79, 91) Source(90, 87) + SourceIndex(0) -18>Emitted(79, 93) Source(90, 89) + SourceIndex(0) -19>Emitted(79, 94) Source(90, 90) + SourceIndex(0) +2 >Emitted(79, 6) Source(90, 11) + SourceIndex(0) +3 >Emitted(79, 10) Source(90, 11) + SourceIndex(0) +4 >Emitted(79, 72) Source(90, 29) + SourceIndex(0) +5 >Emitted(79, 74) Source(90, 70) + SourceIndex(0) +6 >Emitted(79, 75) Source(90, 71) + SourceIndex(0) +7 >Emitted(79, 78) Source(90, 74) + SourceIndex(0) +8 >Emitted(79, 79) Source(90, 75) + SourceIndex(0) +9 >Emitted(79, 81) Source(90, 77) + SourceIndex(0) +10>Emitted(79, 82) Source(90, 78) + SourceIndex(0) +11>Emitted(79, 85) Source(90, 81) + SourceIndex(0) +12>Emitted(79, 86) Source(90, 82) + SourceIndex(0) +13>Emitted(79, 88) Source(90, 84) + SourceIndex(0) +14>Emitted(79, 89) Source(90, 85) + SourceIndex(0) +15>Emitted(79, 91) Source(90, 87) + SourceIndex(0) +16>Emitted(79, 93) Source(90, 89) + SourceIndex(0) --- >>> console.log(multiRobotAInfo); 1 >^^^^ @@ -2722,7 +2431,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 6 > ^^^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2741,13 +2450,10 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern.ts 8 >Emitted(80, 34) Source(91, 34) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(81, 1) Source(92, 1) + SourceIndex(0) -2 >Emitted(81, 2) Source(92, 2) + SourceIndex(0) + >} +1 >Emitted(81, 2) Source(92, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map index 4e060bd1d9a..2bb59dad290 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForArrayBindingPattern2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,GAAG,CAAC,CAAI,iBAAK,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAAsB,EAAnB,aAAK,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,+BAAsC,EAAnC,aAAK,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAI,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,oBAAsD,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,wCAA0E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAE,mBAAO,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,eAAsB,EAArB,eAAO,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,+BAAsC,EAArC,eAAO,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAE,sBAAK,EAAI,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,oBAAyB,EAAxB,aAAK,MAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,wCAA6C,EAA5C,aAAK,MAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAE,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,eAAwC,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,+BAAwD,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAE,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,oBAA4D,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAE,oBAAQ,EAAE,4BAAa,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,eAAsC,EAArC,gBAAQ,EAAE,wBAAa,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,+BAA6D,EAA5D,gBAAQ,EAAE,wBAAa,MAAuC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAE,sCAAkB,EAAI,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAC,oBAAsC,EAArC,6BAAkB,MAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC;AACD,GAAG,CAAC,CAAC,wCAA6E,EAA5E,6BAAkB,MAA4D,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACjC,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,KAAQ,iBAAK,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAAsB,EAAnB,aAAK,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,+BAAsC,EAAnC,aAAK,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAQ,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAK,oBAAsD,EAAnD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAK,wCAA0E,EAAvE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAAM,mBAAO,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAK,eAAsB,EAArB,eAAO,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAK,+BAAsC,EAArC,eAAO,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAM,sBAAK,EAAI,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,oBAAyB,EAAxB,aAAK,MAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,wCAA6C,EAA5C,aAAK,MAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAM,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAK,eAAwC,EAAvC,gBAAQ,EAAE,cAAM,EAAE,eAAO,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC9D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAK,+BAAwD,EAAvD,gBAAQ,EAAE,cAAM,EAAE,eAAO,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC9E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAM,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,EAAK,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC9E,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAK,oBAA4D,EAA3D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAAsB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAK,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,MAA0C,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACtG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAAM,oBAAQ,EAAE,4BAAa,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,eAAsC,EAArC,gBAAQ,EAAE,wBAAa,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,+BAA6D,EAA5D,gBAAQ,EAAE,wBAAa,MAAuC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAM,sCAAkB,EAAI,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAAK,oBAAsC,EAArC,6BAAkB,MAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAAK,wCAA6E,EAA5E,6BAAkB,MAA4D,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt index 9b6f6146cad..5469a9b1664 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.sourcemap.txt @@ -61,21 +61,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts --- >>> return robotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robotA -5 > ; +2 > return +3 > robotA +4 > ; 1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) -5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +2 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +3 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) --- >>>} 1 > @@ -188,21 +185,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts --- >>> return multiRobotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobotA -5 > ; +2 > return +3 > multiRobotA +4 > ; 1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) --- >>>} 1 > @@ -343,67 +337,58 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts --- >>>for (nameA = robotA[1], robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > > -2 >for -3 > -4 > ([, -5 > nameA -6 > ] = -7 > robotA -8 > , -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ([, +3 > nameA +4 > ] = +5 > robotA +6 > , +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(15, 4) Source(24, 4) + SourceIndex(0) -3 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) -4 >Emitted(15, 6) Source(24, 9) + SourceIndex(0) -5 >Emitted(15, 23) Source(24, 14) + SourceIndex(0) -6 >Emitted(15, 25) Source(24, 18) + SourceIndex(0) -7 >Emitted(15, 31) Source(24, 24) + SourceIndex(0) -8 >Emitted(15, 33) Source(24, 26) + SourceIndex(0) -9 >Emitted(15, 34) Source(24, 27) + SourceIndex(0) -10>Emitted(15, 37) Source(24, 30) + SourceIndex(0) -11>Emitted(15, 38) Source(24, 31) + SourceIndex(0) -12>Emitted(15, 40) Source(24, 33) + SourceIndex(0) -13>Emitted(15, 41) Source(24, 34) + SourceIndex(0) -14>Emitted(15, 44) Source(24, 37) + SourceIndex(0) -15>Emitted(15, 45) Source(24, 38) + SourceIndex(0) -16>Emitted(15, 47) Source(24, 40) + SourceIndex(0) -17>Emitted(15, 48) Source(24, 41) + SourceIndex(0) -18>Emitted(15, 50) Source(24, 43) + SourceIndex(0) -19>Emitted(15, 52) Source(24, 45) + SourceIndex(0) -20>Emitted(15, 53) Source(24, 46) + SourceIndex(0) +2 >Emitted(15, 6) Source(24, 9) + SourceIndex(0) +3 >Emitted(15, 23) Source(24, 14) + SourceIndex(0) +4 >Emitted(15, 25) Source(24, 18) + SourceIndex(0) +5 >Emitted(15, 31) Source(24, 24) + SourceIndex(0) +6 >Emitted(15, 33) Source(24, 26) + SourceIndex(0) +7 >Emitted(15, 34) Source(24, 27) + SourceIndex(0) +8 >Emitted(15, 37) Source(24, 30) + SourceIndex(0) +9 >Emitted(15, 38) Source(24, 31) + SourceIndex(0) +10>Emitted(15, 40) Source(24, 33) + SourceIndex(0) +11>Emitted(15, 41) Source(24, 34) + SourceIndex(0) +12>Emitted(15, 44) Source(24, 37) + SourceIndex(0) +13>Emitted(15, 45) Source(24, 38) + SourceIndex(0) +14>Emitted(15, 47) Source(24, 40) + SourceIndex(0) +15>Emitted(15, 48) Source(24, 41) + SourceIndex(0) +16>Emitted(15, 50) Source(24, 43) + SourceIndex(0) +17>Emitted(15, 52) Source(24, 45) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -414,7 +399,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -433,77 +418,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(16, 24) Source(25, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(17, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) + >} +1 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) --- >>>for (_a = getRobot(), nameA = _a[1], _a, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, nameA] = getRobot() -6 > -7 > nameA -8 > ] = getRobot(), -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [, nameA] = getRobot() +4 > +5 > nameA +6 > ] = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(18, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(18, 4) Source(27, 4) + SourceIndex(0) -3 >Emitted(18, 5) Source(27, 5) + SourceIndex(0) -4 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) -5 >Emitted(18, 21) Source(27, 28) + SourceIndex(0) -6 >Emitted(18, 23) Source(27, 9) + SourceIndex(0) -7 >Emitted(18, 36) Source(27, 14) + SourceIndex(0) -8 >Emitted(18, 42) Source(27, 30) + SourceIndex(0) -9 >Emitted(18, 43) Source(27, 31) + SourceIndex(0) -10>Emitted(18, 46) Source(27, 34) + SourceIndex(0) -11>Emitted(18, 47) Source(27, 35) + SourceIndex(0) -12>Emitted(18, 49) Source(27, 37) + SourceIndex(0) -13>Emitted(18, 50) Source(27, 38) + SourceIndex(0) -14>Emitted(18, 53) Source(27, 41) + SourceIndex(0) -15>Emitted(18, 54) Source(27, 42) + SourceIndex(0) -16>Emitted(18, 56) Source(27, 44) + SourceIndex(0) -17>Emitted(18, 57) Source(27, 45) + SourceIndex(0) -18>Emitted(18, 59) Source(27, 47) + SourceIndex(0) -19>Emitted(18, 61) Source(27, 49) + SourceIndex(0) -20>Emitted(18, 62) Source(27, 50) + SourceIndex(0) +2 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) +3 >Emitted(18, 21) Source(27, 28) + SourceIndex(0) +4 >Emitted(18, 23) Source(27, 9) + SourceIndex(0) +5 >Emitted(18, 36) Source(27, 14) + SourceIndex(0) +6 >Emitted(18, 42) Source(27, 30) + SourceIndex(0) +7 >Emitted(18, 43) Source(27, 31) + SourceIndex(0) +8 >Emitted(18, 46) Source(27, 34) + SourceIndex(0) +9 >Emitted(18, 47) Source(27, 35) + SourceIndex(0) +10>Emitted(18, 49) Source(27, 37) + SourceIndex(0) +11>Emitted(18, 50) Source(27, 38) + SourceIndex(0) +12>Emitted(18, 53) Source(27, 41) + SourceIndex(0) +13>Emitted(18, 54) Source(27, 42) + SourceIndex(0) +14>Emitted(18, 56) Source(27, 44) + SourceIndex(0) +15>Emitted(18, 57) Source(27, 45) + SourceIndex(0) +16>Emitted(18, 59) Source(27, 47) + SourceIndex(0) +17>Emitted(18, 61) Source(27, 49) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -514,7 +487,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -533,77 +506,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(19, 24) Source(28, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(20, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) + >} +1 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) --- >>>for (_b = [2, "trimmer", "trimming"], nameA = _b[1], _b, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, nameA] = [2, "trimmer", "trimming"] -6 > -7 > nameA -8 > ] = [2, "trimmer", "trimming"], -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [, nameA] = [2, "trimmer", "trimming"] +4 > +5 > nameA +6 > ] = [2, "trimmer", "trimming"], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(21, 1) Source(30, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(30, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(30, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) -5 >Emitted(21, 37) Source(30, 44) + SourceIndex(0) -6 >Emitted(21, 39) Source(30, 9) + SourceIndex(0) -7 >Emitted(21, 52) Source(30, 14) + SourceIndex(0) -8 >Emitted(21, 58) Source(30, 46) + SourceIndex(0) -9 >Emitted(21, 59) Source(30, 47) + SourceIndex(0) -10>Emitted(21, 62) Source(30, 50) + SourceIndex(0) -11>Emitted(21, 63) Source(30, 51) + SourceIndex(0) -12>Emitted(21, 65) Source(30, 53) + SourceIndex(0) -13>Emitted(21, 66) Source(30, 54) + SourceIndex(0) -14>Emitted(21, 69) Source(30, 57) + SourceIndex(0) -15>Emitted(21, 70) Source(30, 58) + SourceIndex(0) -16>Emitted(21, 72) Source(30, 60) + SourceIndex(0) -17>Emitted(21, 73) Source(30, 61) + SourceIndex(0) -18>Emitted(21, 75) Source(30, 63) + SourceIndex(0) -19>Emitted(21, 77) Source(30, 65) + SourceIndex(0) -20>Emitted(21, 78) Source(30, 66) + SourceIndex(0) +2 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) +3 >Emitted(21, 37) Source(30, 44) + SourceIndex(0) +4 >Emitted(21, 39) Source(30, 9) + SourceIndex(0) +5 >Emitted(21, 52) Source(30, 14) + SourceIndex(0) +6 >Emitted(21, 58) Source(30, 46) + SourceIndex(0) +7 >Emitted(21, 59) Source(30, 47) + SourceIndex(0) +8 >Emitted(21, 62) Source(30, 50) + SourceIndex(0) +9 >Emitted(21, 63) Source(30, 51) + SourceIndex(0) +10>Emitted(21, 65) Source(30, 53) + SourceIndex(0) +11>Emitted(21, 66) Source(30, 54) + SourceIndex(0) +12>Emitted(21, 69) Source(30, 57) + SourceIndex(0) +13>Emitted(21, 70) Source(30, 58) + SourceIndex(0) +14>Emitted(21, 72) Source(30, 60) + SourceIndex(0) +15>Emitted(21, 73) Source(30, 61) + SourceIndex(0) +16>Emitted(21, 75) Source(30, 63) + SourceIndex(0) +17>Emitted(21, 77) Source(30, 65) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -614,7 +575,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -633,89 +594,77 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(22, 24) Source(31, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(23, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) + >} +1 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) --- >>>for (_c = multiRobotA[1], primarySkillA = _c[0], secondarySkillA = _c[1], multiRobotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ([, -5 > [primarySkillA, secondarySkillA] -6 > -7 > primarySkillA -8 > , -9 > secondarySkillA -10> ]] = -11> multiRobotA -12> , -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ([, +3 > [primarySkillA, secondarySkillA] +4 > +5 > primarySkillA +6 > , +7 > secondarySkillA +8 > ]] = +9 > multiRobotA +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(24, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(24, 4) Source(33, 4) + SourceIndex(0) -3 >Emitted(24, 5) Source(33, 5) + SourceIndex(0) -4 >Emitted(24, 6) Source(33, 9) + SourceIndex(0) -5 >Emitted(24, 25) Source(33, 41) + SourceIndex(0) -6 >Emitted(24, 27) Source(33, 10) + SourceIndex(0) -7 >Emitted(24, 48) Source(33, 23) + SourceIndex(0) -8 >Emitted(24, 50) Source(33, 25) + SourceIndex(0) -9 >Emitted(24, 73) Source(33, 40) + SourceIndex(0) -10>Emitted(24, 75) Source(33, 45) + SourceIndex(0) -11>Emitted(24, 86) Source(33, 56) + SourceIndex(0) -12>Emitted(24, 88) Source(33, 58) + SourceIndex(0) -13>Emitted(24, 89) Source(33, 59) + SourceIndex(0) -14>Emitted(24, 92) Source(33, 62) + SourceIndex(0) -15>Emitted(24, 93) Source(33, 63) + SourceIndex(0) -16>Emitted(24, 95) Source(33, 65) + SourceIndex(0) -17>Emitted(24, 96) Source(33, 66) + SourceIndex(0) -18>Emitted(24, 99) Source(33, 69) + SourceIndex(0) -19>Emitted(24, 100) Source(33, 70) + SourceIndex(0) -20>Emitted(24, 102) Source(33, 72) + SourceIndex(0) -21>Emitted(24, 103) Source(33, 73) + SourceIndex(0) -22>Emitted(24, 105) Source(33, 75) + SourceIndex(0) -23>Emitted(24, 107) Source(33, 77) + SourceIndex(0) -24>Emitted(24, 108) Source(33, 78) + SourceIndex(0) +2 >Emitted(24, 6) Source(33, 9) + SourceIndex(0) +3 >Emitted(24, 25) Source(33, 41) + SourceIndex(0) +4 >Emitted(24, 27) Source(33, 10) + SourceIndex(0) +5 >Emitted(24, 48) Source(33, 23) + SourceIndex(0) +6 >Emitted(24, 50) Source(33, 25) + SourceIndex(0) +7 >Emitted(24, 73) Source(33, 40) + SourceIndex(0) +8 >Emitted(24, 75) Source(33, 45) + SourceIndex(0) +9 >Emitted(24, 86) Source(33, 56) + SourceIndex(0) +10>Emitted(24, 88) Source(33, 58) + SourceIndex(0) +11>Emitted(24, 89) Source(33, 59) + SourceIndex(0) +12>Emitted(24, 92) Source(33, 62) + SourceIndex(0) +13>Emitted(24, 93) Source(33, 63) + SourceIndex(0) +14>Emitted(24, 95) Source(33, 65) + SourceIndex(0) +15>Emitted(24, 96) Source(33, 66) + SourceIndex(0) +16>Emitted(24, 99) Source(33, 69) + SourceIndex(0) +17>Emitted(24, 100) Source(33, 70) + SourceIndex(0) +18>Emitted(24, 102) Source(33, 72) + SourceIndex(0) +19>Emitted(24, 103) Source(33, 73) + SourceIndex(0) +20>Emitted(24, 105) Source(33, 75) + SourceIndex(0) +21>Emitted(24, 107) Source(33, 77) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -726,7 +675,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -745,89 +694,77 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(25, 32) Source(34, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(26, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(26, 2) Source(35, 2) + SourceIndex(0) + >} +1 >Emitted(26, 2) Source(35, 2) + SourceIndex(0) --- >>>for (_d = getMultiRobot(), _e = _d[1], primarySkillA = _e[0], secondarySkillA = _e[1], _d, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, [primarySkillA, secondarySkillA]] = getMultiRobot() -6 > -7 > [primarySkillA, secondarySkillA] -8 > -9 > primarySkillA -10> , -11> secondarySkillA -12> ]] = getMultiRobot(), -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > [, [primarySkillA, secondarySkillA]] = getMultiRobot() +4 > +5 > [primarySkillA, secondarySkillA] +6 > +7 > primarySkillA +8 > , +9 > secondarySkillA +10> ]] = getMultiRobot(), +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(27, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(27, 4) Source(36, 4) + SourceIndex(0) -3 >Emitted(27, 5) Source(36, 5) + SourceIndex(0) -4 >Emitted(27, 6) Source(36, 6) + SourceIndex(0) -5 >Emitted(27, 26) Source(36, 60) + SourceIndex(0) -6 >Emitted(27, 28) Source(36, 9) + SourceIndex(0) -7 >Emitted(27, 38) Source(36, 41) + SourceIndex(0) -8 >Emitted(27, 40) Source(36, 10) + SourceIndex(0) -9 >Emitted(27, 61) Source(36, 23) + SourceIndex(0) -10>Emitted(27, 63) Source(36, 25) + SourceIndex(0) -11>Emitted(27, 86) Source(36, 40) + SourceIndex(0) -12>Emitted(27, 92) Source(36, 62) + SourceIndex(0) -13>Emitted(27, 93) Source(36, 63) + SourceIndex(0) -14>Emitted(27, 96) Source(36, 66) + SourceIndex(0) -15>Emitted(27, 97) Source(36, 67) + SourceIndex(0) -16>Emitted(27, 99) Source(36, 69) + SourceIndex(0) -17>Emitted(27, 100) Source(36, 70) + SourceIndex(0) -18>Emitted(27, 103) Source(36, 73) + SourceIndex(0) -19>Emitted(27, 104) Source(36, 74) + SourceIndex(0) -20>Emitted(27, 106) Source(36, 76) + SourceIndex(0) -21>Emitted(27, 107) Source(36, 77) + SourceIndex(0) -22>Emitted(27, 109) Source(36, 79) + SourceIndex(0) -23>Emitted(27, 111) Source(36, 81) + SourceIndex(0) -24>Emitted(27, 112) Source(36, 82) + SourceIndex(0) +2 >Emitted(27, 6) Source(36, 6) + SourceIndex(0) +3 >Emitted(27, 26) Source(36, 60) + SourceIndex(0) +4 >Emitted(27, 28) Source(36, 9) + SourceIndex(0) +5 >Emitted(27, 38) Source(36, 41) + SourceIndex(0) +6 >Emitted(27, 40) Source(36, 10) + SourceIndex(0) +7 >Emitted(27, 61) Source(36, 23) + SourceIndex(0) +8 >Emitted(27, 63) Source(36, 25) + SourceIndex(0) +9 >Emitted(27, 86) Source(36, 40) + SourceIndex(0) +10>Emitted(27, 92) Source(36, 62) + SourceIndex(0) +11>Emitted(27, 93) Source(36, 63) + SourceIndex(0) +12>Emitted(27, 96) Source(36, 66) + SourceIndex(0) +13>Emitted(27, 97) Source(36, 67) + SourceIndex(0) +14>Emitted(27, 99) Source(36, 69) + SourceIndex(0) +15>Emitted(27, 100) Source(36, 70) + SourceIndex(0) +16>Emitted(27, 103) Source(36, 73) + SourceIndex(0) +17>Emitted(27, 104) Source(36, 74) + SourceIndex(0) +18>Emitted(27, 106) Source(36, 76) + SourceIndex(0) +19>Emitted(27, 107) Source(36, 77) + SourceIndex(0) +20>Emitted(27, 109) Source(36, 79) + SourceIndex(0) +21>Emitted(27, 111) Source(36, 81) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -838,7 +775,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -857,89 +794,77 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(28, 32) Source(37, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(29, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(38, 2) + SourceIndex(0) + >} +1 >Emitted(29, 2) Source(38, 2) + SourceIndex(0) --- >>>for (_f = ["trimmer", ["trimming", "edging"]], _g = _f[1], primarySkillA = _g[0], secondarySkillA = _g[1], _f, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] -6 > -7 > [primarySkillA, secondarySkillA] -8 > -9 > primarySkillA -10> , -11> secondarySkillA -12> ]] = ["trimmer", ["trimming", "edging"]], -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > [, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +4 > +5 > [primarySkillA, secondarySkillA] +6 > +7 > primarySkillA +8 > , +9 > secondarySkillA +10> ]] = ["trimmer", ["trimming", "edging"]], +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(30, 1) Source(39, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(39, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(39, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(39, 6) + SourceIndex(0) -5 >Emitted(30, 46) Source(39, 80) + SourceIndex(0) -6 >Emitted(30, 48) Source(39, 9) + SourceIndex(0) -7 >Emitted(30, 58) Source(39, 41) + SourceIndex(0) -8 >Emitted(30, 60) Source(39, 10) + SourceIndex(0) -9 >Emitted(30, 81) Source(39, 23) + SourceIndex(0) -10>Emitted(30, 83) Source(39, 25) + SourceIndex(0) -11>Emitted(30, 106) Source(39, 40) + SourceIndex(0) -12>Emitted(30, 112) Source(39, 82) + SourceIndex(0) -13>Emitted(30, 113) Source(39, 83) + SourceIndex(0) -14>Emitted(30, 116) Source(39, 86) + SourceIndex(0) -15>Emitted(30, 117) Source(39, 87) + SourceIndex(0) -16>Emitted(30, 119) Source(39, 89) + SourceIndex(0) -17>Emitted(30, 120) Source(39, 90) + SourceIndex(0) -18>Emitted(30, 123) Source(39, 93) + SourceIndex(0) -19>Emitted(30, 124) Source(39, 94) + SourceIndex(0) -20>Emitted(30, 126) Source(39, 96) + SourceIndex(0) -21>Emitted(30, 127) Source(39, 97) + SourceIndex(0) -22>Emitted(30, 129) Source(39, 99) + SourceIndex(0) -23>Emitted(30, 131) Source(39, 101) + SourceIndex(0) -24>Emitted(30, 132) Source(39, 102) + SourceIndex(0) +2 >Emitted(30, 6) Source(39, 6) + SourceIndex(0) +3 >Emitted(30, 46) Source(39, 80) + SourceIndex(0) +4 >Emitted(30, 48) Source(39, 9) + SourceIndex(0) +5 >Emitted(30, 58) Source(39, 41) + SourceIndex(0) +6 >Emitted(30, 60) Source(39, 10) + SourceIndex(0) +7 >Emitted(30, 81) Source(39, 23) + SourceIndex(0) +8 >Emitted(30, 83) Source(39, 25) + SourceIndex(0) +9 >Emitted(30, 106) Source(39, 40) + SourceIndex(0) +10>Emitted(30, 112) Source(39, 82) + SourceIndex(0) +11>Emitted(30, 113) Source(39, 83) + SourceIndex(0) +12>Emitted(30, 116) Source(39, 86) + SourceIndex(0) +13>Emitted(30, 117) Source(39, 87) + SourceIndex(0) +14>Emitted(30, 119) Source(39, 89) + SourceIndex(0) +15>Emitted(30, 120) Source(39, 90) + SourceIndex(0) +16>Emitted(30, 123) Source(39, 93) + SourceIndex(0) +17>Emitted(30, 124) Source(39, 94) + SourceIndex(0) +18>Emitted(30, 126) Source(39, 96) + SourceIndex(0) +19>Emitted(30, 127) Source(39, 97) + SourceIndex(0) +20>Emitted(30, 129) Source(39, 99) + SourceIndex(0) +21>Emitted(30, 131) Source(39, 101) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -950,7 +875,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -969,78 +894,66 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(31, 32) Source(40, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(32, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(41, 2) + SourceIndex(0) + >} +1 >Emitted(32, 2) Source(41, 2) + SourceIndex(0) --- >>>for (numberB = robotA[0], robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > > -2 >for -3 > -4 > ([ -5 > numberB -6 > ] = -7 > robotA -8 > , -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ([ +3 > numberB +4 > ] = +5 > robotA +6 > , +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(33, 1) Source(43, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(43, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(43, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(43, 7) + SourceIndex(0) -5 >Emitted(33, 25) Source(43, 14) + SourceIndex(0) -6 >Emitted(33, 27) Source(43, 18) + SourceIndex(0) -7 >Emitted(33, 33) Source(43, 24) + SourceIndex(0) -8 >Emitted(33, 35) Source(43, 26) + SourceIndex(0) -9 >Emitted(33, 36) Source(43, 27) + SourceIndex(0) -10>Emitted(33, 39) Source(43, 30) + SourceIndex(0) -11>Emitted(33, 40) Source(43, 31) + SourceIndex(0) -12>Emitted(33, 42) Source(43, 33) + SourceIndex(0) -13>Emitted(33, 43) Source(43, 34) + SourceIndex(0) -14>Emitted(33, 46) Source(43, 37) + SourceIndex(0) -15>Emitted(33, 47) Source(43, 38) + SourceIndex(0) -16>Emitted(33, 49) Source(43, 40) + SourceIndex(0) -17>Emitted(33, 50) Source(43, 41) + SourceIndex(0) -18>Emitted(33, 52) Source(43, 43) + SourceIndex(0) -19>Emitted(33, 54) Source(43, 45) + SourceIndex(0) -20>Emitted(33, 55) Source(43, 46) + SourceIndex(0) +2 >Emitted(33, 6) Source(43, 7) + SourceIndex(0) +3 >Emitted(33, 25) Source(43, 14) + SourceIndex(0) +4 >Emitted(33, 27) Source(43, 18) + SourceIndex(0) +5 >Emitted(33, 33) Source(43, 24) + SourceIndex(0) +6 >Emitted(33, 35) Source(43, 26) + SourceIndex(0) +7 >Emitted(33, 36) Source(43, 27) + SourceIndex(0) +8 >Emitted(33, 39) Source(43, 30) + SourceIndex(0) +9 >Emitted(33, 40) Source(43, 31) + SourceIndex(0) +10>Emitted(33, 42) Source(43, 33) + SourceIndex(0) +11>Emitted(33, 43) Source(43, 34) + SourceIndex(0) +12>Emitted(33, 46) Source(43, 37) + SourceIndex(0) +13>Emitted(33, 47) Source(43, 38) + SourceIndex(0) +14>Emitted(33, 49) Source(43, 40) + SourceIndex(0) +15>Emitted(33, 50) Source(43, 41) + SourceIndex(0) +16>Emitted(33, 52) Source(43, 43) + SourceIndex(0) +17>Emitted(33, 54) Source(43, 45) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1051,7 +964,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1070,77 +983,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(34, 26) Source(44, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(35, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(35, 2) Source(45, 2) + SourceIndex(0) + >} +1 >Emitted(35, 2) Source(45, 2) + SourceIndex(0) --- >>>for (_h = getRobot(), numberB = _h[0], _h, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberB] = getRobot() -6 > -7 > numberB -8 > ] = getRobot(), -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [numberB] = getRobot() +4 > +5 > numberB +6 > ] = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(36, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(36, 4) Source(46, 4) + SourceIndex(0) -3 >Emitted(36, 5) Source(46, 5) + SourceIndex(0) -4 >Emitted(36, 6) Source(46, 6) + SourceIndex(0) -5 >Emitted(36, 21) Source(46, 28) + SourceIndex(0) -6 >Emitted(36, 23) Source(46, 7) + SourceIndex(0) -7 >Emitted(36, 38) Source(46, 14) + SourceIndex(0) -8 >Emitted(36, 44) Source(46, 30) + SourceIndex(0) -9 >Emitted(36, 45) Source(46, 31) + SourceIndex(0) -10>Emitted(36, 48) Source(46, 34) + SourceIndex(0) -11>Emitted(36, 49) Source(46, 35) + SourceIndex(0) -12>Emitted(36, 51) Source(46, 37) + SourceIndex(0) -13>Emitted(36, 52) Source(46, 38) + SourceIndex(0) -14>Emitted(36, 55) Source(46, 41) + SourceIndex(0) -15>Emitted(36, 56) Source(46, 42) + SourceIndex(0) -16>Emitted(36, 58) Source(46, 44) + SourceIndex(0) -17>Emitted(36, 59) Source(46, 45) + SourceIndex(0) -18>Emitted(36, 61) Source(46, 47) + SourceIndex(0) -19>Emitted(36, 63) Source(46, 49) + SourceIndex(0) -20>Emitted(36, 64) Source(46, 50) + SourceIndex(0) +2 >Emitted(36, 6) Source(46, 6) + SourceIndex(0) +3 >Emitted(36, 21) Source(46, 28) + SourceIndex(0) +4 >Emitted(36, 23) Source(46, 7) + SourceIndex(0) +5 >Emitted(36, 38) Source(46, 14) + SourceIndex(0) +6 >Emitted(36, 44) Source(46, 30) + SourceIndex(0) +7 >Emitted(36, 45) Source(46, 31) + SourceIndex(0) +8 >Emitted(36, 48) Source(46, 34) + SourceIndex(0) +9 >Emitted(36, 49) Source(46, 35) + SourceIndex(0) +10>Emitted(36, 51) Source(46, 37) + SourceIndex(0) +11>Emitted(36, 52) Source(46, 38) + SourceIndex(0) +12>Emitted(36, 55) Source(46, 41) + SourceIndex(0) +13>Emitted(36, 56) Source(46, 42) + SourceIndex(0) +14>Emitted(36, 58) Source(46, 44) + SourceIndex(0) +15>Emitted(36, 59) Source(46, 45) + SourceIndex(0) +16>Emitted(36, 61) Source(46, 47) + SourceIndex(0) +17>Emitted(36, 63) Source(46, 49) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1151,7 +1052,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1170,77 +1071,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(37, 26) Source(47, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(38, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(38, 2) Source(48, 2) + SourceIndex(0) + >} +1 >Emitted(38, 2) Source(48, 2) + SourceIndex(0) --- >>>for (_j = [2, "trimmer", "trimming"], numberB = _j[0], _j, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberB] = [2, "trimmer", "trimming"] -6 > -7 > numberB -8 > ] = [2, "trimmer", "trimming"], -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [numberB] = [2, "trimmer", "trimming"] +4 > +5 > numberB +6 > ] = [2, "trimmer", "trimming"], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(39, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(49, 6) + SourceIndex(0) -5 >Emitted(39, 37) Source(49, 44) + SourceIndex(0) -6 >Emitted(39, 39) Source(49, 7) + SourceIndex(0) -7 >Emitted(39, 54) Source(49, 14) + SourceIndex(0) -8 >Emitted(39, 60) Source(49, 46) + SourceIndex(0) -9 >Emitted(39, 61) Source(49, 47) + SourceIndex(0) -10>Emitted(39, 64) Source(49, 50) + SourceIndex(0) -11>Emitted(39, 65) Source(49, 51) + SourceIndex(0) -12>Emitted(39, 67) Source(49, 53) + SourceIndex(0) -13>Emitted(39, 68) Source(49, 54) + SourceIndex(0) -14>Emitted(39, 71) Source(49, 57) + SourceIndex(0) -15>Emitted(39, 72) Source(49, 58) + SourceIndex(0) -16>Emitted(39, 74) Source(49, 60) + SourceIndex(0) -17>Emitted(39, 75) Source(49, 61) + SourceIndex(0) -18>Emitted(39, 77) Source(49, 63) + SourceIndex(0) -19>Emitted(39, 79) Source(49, 65) + SourceIndex(0) -20>Emitted(39, 80) Source(49, 66) + SourceIndex(0) +2 >Emitted(39, 6) Source(49, 6) + SourceIndex(0) +3 >Emitted(39, 37) Source(49, 44) + SourceIndex(0) +4 >Emitted(39, 39) Source(49, 7) + SourceIndex(0) +5 >Emitted(39, 54) Source(49, 14) + SourceIndex(0) +6 >Emitted(39, 60) Source(49, 46) + SourceIndex(0) +7 >Emitted(39, 61) Source(49, 47) + SourceIndex(0) +8 >Emitted(39, 64) Source(49, 50) + SourceIndex(0) +9 >Emitted(39, 65) Source(49, 51) + SourceIndex(0) +10>Emitted(39, 67) Source(49, 53) + SourceIndex(0) +11>Emitted(39, 68) Source(49, 54) + SourceIndex(0) +12>Emitted(39, 71) Source(49, 57) + SourceIndex(0) +13>Emitted(39, 72) Source(49, 58) + SourceIndex(0) +14>Emitted(39, 74) Source(49, 60) + SourceIndex(0) +15>Emitted(39, 75) Source(49, 61) + SourceIndex(0) +16>Emitted(39, 77) Source(49, 63) + SourceIndex(0) +17>Emitted(39, 79) Source(49, 65) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1251,7 +1140,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1270,77 +1159,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(40, 26) Source(50, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(41, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(41, 2) Source(51, 2) + SourceIndex(0) + >} +1 >Emitted(41, 2) Source(51, 2) + SourceIndex(0) --- >>>for (nameB = multiRobotA[0], multiRobotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ([ -5 > nameB -6 > ] = -7 > multiRobotA -8 > , -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ([ +3 > nameB +4 > ] = +5 > multiRobotA +6 > , +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(42, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(42, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(42, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(42, 6) Source(52, 7) + SourceIndex(0) -5 >Emitted(42, 28) Source(52, 12) + SourceIndex(0) -6 >Emitted(42, 30) Source(52, 16) + SourceIndex(0) -7 >Emitted(42, 41) Source(52, 27) + SourceIndex(0) -8 >Emitted(42, 43) Source(52, 29) + SourceIndex(0) -9 >Emitted(42, 44) Source(52, 30) + SourceIndex(0) -10>Emitted(42, 47) Source(52, 33) + SourceIndex(0) -11>Emitted(42, 48) Source(52, 34) + SourceIndex(0) -12>Emitted(42, 50) Source(52, 36) + SourceIndex(0) -13>Emitted(42, 51) Source(52, 37) + SourceIndex(0) -14>Emitted(42, 54) Source(52, 40) + SourceIndex(0) -15>Emitted(42, 55) Source(52, 41) + SourceIndex(0) -16>Emitted(42, 57) Source(52, 43) + SourceIndex(0) -17>Emitted(42, 58) Source(52, 44) + SourceIndex(0) -18>Emitted(42, 60) Source(52, 46) + SourceIndex(0) -19>Emitted(42, 62) Source(52, 48) + SourceIndex(0) -20>Emitted(42, 63) Source(52, 49) + SourceIndex(0) +2 >Emitted(42, 6) Source(52, 7) + SourceIndex(0) +3 >Emitted(42, 28) Source(52, 12) + SourceIndex(0) +4 >Emitted(42, 30) Source(52, 16) + SourceIndex(0) +5 >Emitted(42, 41) Source(52, 27) + SourceIndex(0) +6 >Emitted(42, 43) Source(52, 29) + SourceIndex(0) +7 >Emitted(42, 44) Source(52, 30) + SourceIndex(0) +8 >Emitted(42, 47) Source(52, 33) + SourceIndex(0) +9 >Emitted(42, 48) Source(52, 34) + SourceIndex(0) +10>Emitted(42, 50) Source(52, 36) + SourceIndex(0) +11>Emitted(42, 51) Source(52, 37) + SourceIndex(0) +12>Emitted(42, 54) Source(52, 40) + SourceIndex(0) +13>Emitted(42, 55) Source(52, 41) + SourceIndex(0) +14>Emitted(42, 57) Source(52, 43) + SourceIndex(0) +15>Emitted(42, 58) Source(52, 44) + SourceIndex(0) +16>Emitted(42, 60) Source(52, 46) + SourceIndex(0) +17>Emitted(42, 62) Source(52, 48) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1351,7 +1228,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1370,77 +1247,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(43, 24) Source(53, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(44, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(44, 2) Source(54, 2) + SourceIndex(0) + >} +1 >Emitted(44, 2) Source(54, 2) + SourceIndex(0) --- >>>for (_k = getMultiRobot(), nameB = _k[0], _k, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameB] = getMultiRobot() -6 > -7 > nameB -8 > ] = getMultiRobot(), -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [nameB] = getMultiRobot() +4 > +5 > nameB +6 > ] = getMultiRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(45, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(55, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(55, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(55, 6) + SourceIndex(0) -5 >Emitted(45, 26) Source(55, 31) + SourceIndex(0) -6 >Emitted(45, 28) Source(55, 7) + SourceIndex(0) -7 >Emitted(45, 41) Source(55, 12) + SourceIndex(0) -8 >Emitted(45, 47) Source(55, 33) + SourceIndex(0) -9 >Emitted(45, 48) Source(55, 34) + SourceIndex(0) -10>Emitted(45, 51) Source(55, 37) + SourceIndex(0) -11>Emitted(45, 52) Source(55, 38) + SourceIndex(0) -12>Emitted(45, 54) Source(55, 40) + SourceIndex(0) -13>Emitted(45, 55) Source(55, 41) + SourceIndex(0) -14>Emitted(45, 58) Source(55, 44) + SourceIndex(0) -15>Emitted(45, 59) Source(55, 45) + SourceIndex(0) -16>Emitted(45, 61) Source(55, 47) + SourceIndex(0) -17>Emitted(45, 62) Source(55, 48) + SourceIndex(0) -18>Emitted(45, 64) Source(55, 50) + SourceIndex(0) -19>Emitted(45, 66) Source(55, 52) + SourceIndex(0) -20>Emitted(45, 67) Source(55, 53) + SourceIndex(0) +2 >Emitted(45, 6) Source(55, 6) + SourceIndex(0) +3 >Emitted(45, 26) Source(55, 31) + SourceIndex(0) +4 >Emitted(45, 28) Source(55, 7) + SourceIndex(0) +5 >Emitted(45, 41) Source(55, 12) + SourceIndex(0) +6 >Emitted(45, 47) Source(55, 33) + SourceIndex(0) +7 >Emitted(45, 48) Source(55, 34) + SourceIndex(0) +8 >Emitted(45, 51) Source(55, 37) + SourceIndex(0) +9 >Emitted(45, 52) Source(55, 38) + SourceIndex(0) +10>Emitted(45, 54) Source(55, 40) + SourceIndex(0) +11>Emitted(45, 55) Source(55, 41) + SourceIndex(0) +12>Emitted(45, 58) Source(55, 44) + SourceIndex(0) +13>Emitted(45, 59) Source(55, 45) + SourceIndex(0) +14>Emitted(45, 61) Source(55, 47) + SourceIndex(0) +15>Emitted(45, 62) Source(55, 48) + SourceIndex(0) +16>Emitted(45, 64) Source(55, 50) + SourceIndex(0) +17>Emitted(45, 66) Source(55, 52) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1451,7 +1316,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1470,77 +1335,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(46, 24) Source(56, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(47, 1) Source(57, 1) + SourceIndex(0) -2 >Emitted(47, 2) Source(57, 2) + SourceIndex(0) + >} +1 >Emitted(47, 2) Source(57, 2) + SourceIndex(0) --- >>>for (_l = ["trimmer", ["trimming", "edging"]], nameB = _l[0], _l, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameB] = ["trimmer", ["trimming", "edging"]] -6 > -7 > nameB -8 > ] = ["trimmer", ["trimming", "edging"]], -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [nameB] = ["trimmer", ["trimming", "edging"]] +4 > +5 > nameB +6 > ] = ["trimmer", ["trimming", "edging"]], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(48, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(48, 4) Source(58, 4) + SourceIndex(0) -3 >Emitted(48, 5) Source(58, 5) + SourceIndex(0) -4 >Emitted(48, 6) Source(58, 6) + SourceIndex(0) -5 >Emitted(48, 46) Source(58, 51) + SourceIndex(0) -6 >Emitted(48, 48) Source(58, 7) + SourceIndex(0) -7 >Emitted(48, 61) Source(58, 12) + SourceIndex(0) -8 >Emitted(48, 67) Source(58, 53) + SourceIndex(0) -9 >Emitted(48, 68) Source(58, 54) + SourceIndex(0) -10>Emitted(48, 71) Source(58, 57) + SourceIndex(0) -11>Emitted(48, 72) Source(58, 58) + SourceIndex(0) -12>Emitted(48, 74) Source(58, 60) + SourceIndex(0) -13>Emitted(48, 75) Source(58, 61) + SourceIndex(0) -14>Emitted(48, 78) Source(58, 64) + SourceIndex(0) -15>Emitted(48, 79) Source(58, 65) + SourceIndex(0) -16>Emitted(48, 81) Source(58, 67) + SourceIndex(0) -17>Emitted(48, 82) Source(58, 68) + SourceIndex(0) -18>Emitted(48, 84) Source(58, 70) + SourceIndex(0) -19>Emitted(48, 86) Source(58, 72) + SourceIndex(0) -20>Emitted(48, 87) Source(58, 73) + SourceIndex(0) +2 >Emitted(48, 6) Source(58, 6) + SourceIndex(0) +3 >Emitted(48, 46) Source(58, 51) + SourceIndex(0) +4 >Emitted(48, 48) Source(58, 7) + SourceIndex(0) +5 >Emitted(48, 61) Source(58, 12) + SourceIndex(0) +6 >Emitted(48, 67) Source(58, 53) + SourceIndex(0) +7 >Emitted(48, 68) Source(58, 54) + SourceIndex(0) +8 >Emitted(48, 71) Source(58, 57) + SourceIndex(0) +9 >Emitted(48, 72) Source(58, 58) + SourceIndex(0) +10>Emitted(48, 74) Source(58, 60) + SourceIndex(0) +11>Emitted(48, 75) Source(58, 61) + SourceIndex(0) +12>Emitted(48, 78) Source(58, 64) + SourceIndex(0) +13>Emitted(48, 79) Source(58, 65) + SourceIndex(0) +14>Emitted(48, 81) Source(58, 67) + SourceIndex(0) +15>Emitted(48, 82) Source(58, 68) + SourceIndex(0) +16>Emitted(48, 84) Source(58, 70) + SourceIndex(0) +17>Emitted(48, 86) Source(58, 72) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1551,7 +1404,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1570,90 +1423,78 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(49, 24) Source(59, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(50, 1) Source(60, 1) + SourceIndex(0) -2 >Emitted(50, 2) Source(60, 2) + SourceIndex(0) + >} +1 >Emitted(50, 2) Source(60, 2) + SourceIndex(0) --- >>>for (numberA2 = robotA[0], nameA2 = robotA[1], skillA2 = robotA[2], robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > > -2 >for -3 > -4 > ([ -5 > numberA2 -6 > , -7 > nameA2 -8 > , -9 > skillA2 -10> ] = -11> robotA -12> , -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ([ +3 > numberA2 +4 > , +5 > nameA2 +6 > , +7 > skillA2 +8 > ] = +9 > robotA +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(51, 1) Source(62, 1) + SourceIndex(0) -2 >Emitted(51, 4) Source(62, 4) + SourceIndex(0) -3 >Emitted(51, 5) Source(62, 5) + SourceIndex(0) -4 >Emitted(51, 6) Source(62, 7) + SourceIndex(0) -5 >Emitted(51, 26) Source(62, 15) + SourceIndex(0) -6 >Emitted(51, 28) Source(62, 17) + SourceIndex(0) -7 >Emitted(51, 46) Source(62, 23) + SourceIndex(0) -8 >Emitted(51, 48) Source(62, 25) + SourceIndex(0) -9 >Emitted(51, 67) Source(62, 32) + SourceIndex(0) -10>Emitted(51, 69) Source(62, 36) + SourceIndex(0) -11>Emitted(51, 75) Source(62, 42) + SourceIndex(0) -12>Emitted(51, 77) Source(62, 44) + SourceIndex(0) -13>Emitted(51, 78) Source(62, 45) + SourceIndex(0) -14>Emitted(51, 81) Source(62, 48) + SourceIndex(0) -15>Emitted(51, 82) Source(62, 49) + SourceIndex(0) -16>Emitted(51, 84) Source(62, 51) + SourceIndex(0) -17>Emitted(51, 85) Source(62, 52) + SourceIndex(0) -18>Emitted(51, 88) Source(62, 55) + SourceIndex(0) -19>Emitted(51, 89) Source(62, 56) + SourceIndex(0) -20>Emitted(51, 91) Source(62, 58) + SourceIndex(0) -21>Emitted(51, 92) Source(62, 59) + SourceIndex(0) -22>Emitted(51, 94) Source(62, 61) + SourceIndex(0) -23>Emitted(51, 96) Source(62, 63) + SourceIndex(0) -24>Emitted(51, 97) Source(62, 64) + SourceIndex(0) +2 >Emitted(51, 6) Source(62, 7) + SourceIndex(0) +3 >Emitted(51, 26) Source(62, 15) + SourceIndex(0) +4 >Emitted(51, 28) Source(62, 17) + SourceIndex(0) +5 >Emitted(51, 46) Source(62, 23) + SourceIndex(0) +6 >Emitted(51, 48) Source(62, 25) + SourceIndex(0) +7 >Emitted(51, 67) Source(62, 32) + SourceIndex(0) +8 >Emitted(51, 69) Source(62, 36) + SourceIndex(0) +9 >Emitted(51, 75) Source(62, 42) + SourceIndex(0) +10>Emitted(51, 77) Source(62, 44) + SourceIndex(0) +11>Emitted(51, 78) Source(62, 45) + SourceIndex(0) +12>Emitted(51, 81) Source(62, 48) + SourceIndex(0) +13>Emitted(51, 82) Source(62, 49) + SourceIndex(0) +14>Emitted(51, 84) Source(62, 51) + SourceIndex(0) +15>Emitted(51, 85) Source(62, 52) + SourceIndex(0) +16>Emitted(51, 88) Source(62, 55) + SourceIndex(0) +17>Emitted(51, 89) Source(62, 56) + SourceIndex(0) +18>Emitted(51, 91) Source(62, 58) + SourceIndex(0) +19>Emitted(51, 92) Source(62, 59) + SourceIndex(0) +20>Emitted(51, 94) Source(62, 61) + SourceIndex(0) +21>Emitted(51, 96) Source(62, 63) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1664,7 +1505,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1683,89 +1524,77 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(52, 25) Source(63, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(53, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(53, 2) Source(64, 2) + SourceIndex(0) + >} +1 >Emitted(53, 2) Source(64, 2) + SourceIndex(0) --- >>>for (_m = getRobot(), numberA2 = _m[0], nameA2 = _m[1], skillA2 = _m[2], _m, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA2, nameA2, skillA2] = getRobot() -6 > -7 > numberA2 -8 > , -9 > nameA2 -10> , -11> skillA2 -12> ] = getRobot(), -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > [numberA2, nameA2, skillA2] = getRobot() +4 > +5 > numberA2 +6 > , +7 > nameA2 +8 > , +9 > skillA2 +10> ] = getRobot(), +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(54, 1) Source(65, 1) + SourceIndex(0) -2 >Emitted(54, 4) Source(65, 4) + SourceIndex(0) -3 >Emitted(54, 5) Source(65, 5) + SourceIndex(0) -4 >Emitted(54, 6) Source(65, 6) + SourceIndex(0) -5 >Emitted(54, 21) Source(65, 46) + SourceIndex(0) -6 >Emitted(54, 23) Source(65, 7) + SourceIndex(0) -7 >Emitted(54, 39) Source(65, 15) + SourceIndex(0) -8 >Emitted(54, 41) Source(65, 17) + SourceIndex(0) -9 >Emitted(54, 55) Source(65, 23) + SourceIndex(0) -10>Emitted(54, 57) Source(65, 25) + SourceIndex(0) -11>Emitted(54, 72) Source(65, 32) + SourceIndex(0) -12>Emitted(54, 78) Source(65, 48) + SourceIndex(0) -13>Emitted(54, 79) Source(65, 49) + SourceIndex(0) -14>Emitted(54, 82) Source(65, 52) + SourceIndex(0) -15>Emitted(54, 83) Source(65, 53) + SourceIndex(0) -16>Emitted(54, 85) Source(65, 55) + SourceIndex(0) -17>Emitted(54, 86) Source(65, 56) + SourceIndex(0) -18>Emitted(54, 89) Source(65, 59) + SourceIndex(0) -19>Emitted(54, 90) Source(65, 60) + SourceIndex(0) -20>Emitted(54, 92) Source(65, 62) + SourceIndex(0) -21>Emitted(54, 93) Source(65, 63) + SourceIndex(0) -22>Emitted(54, 95) Source(65, 65) + SourceIndex(0) -23>Emitted(54, 97) Source(65, 67) + SourceIndex(0) -24>Emitted(54, 98) Source(65, 68) + SourceIndex(0) +2 >Emitted(54, 6) Source(65, 6) + SourceIndex(0) +3 >Emitted(54, 21) Source(65, 46) + SourceIndex(0) +4 >Emitted(54, 23) Source(65, 7) + SourceIndex(0) +5 >Emitted(54, 39) Source(65, 15) + SourceIndex(0) +6 >Emitted(54, 41) Source(65, 17) + SourceIndex(0) +7 >Emitted(54, 55) Source(65, 23) + SourceIndex(0) +8 >Emitted(54, 57) Source(65, 25) + SourceIndex(0) +9 >Emitted(54, 72) Source(65, 32) + SourceIndex(0) +10>Emitted(54, 78) Source(65, 48) + SourceIndex(0) +11>Emitted(54, 79) Source(65, 49) + SourceIndex(0) +12>Emitted(54, 82) Source(65, 52) + SourceIndex(0) +13>Emitted(54, 83) Source(65, 53) + SourceIndex(0) +14>Emitted(54, 85) Source(65, 55) + SourceIndex(0) +15>Emitted(54, 86) Source(65, 56) + SourceIndex(0) +16>Emitted(54, 89) Source(65, 59) + SourceIndex(0) +17>Emitted(54, 90) Source(65, 60) + SourceIndex(0) +18>Emitted(54, 92) Source(65, 62) + SourceIndex(0) +19>Emitted(54, 93) Source(65, 63) + SourceIndex(0) +20>Emitted(54, 95) Source(65, 65) + SourceIndex(0) +21>Emitted(54, 97) Source(65, 67) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1776,7 +1605,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1795,89 +1624,77 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(55, 25) Source(66, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(56, 1) Source(67, 1) + SourceIndex(0) -2 >Emitted(56, 2) Source(67, 2) + SourceIndex(0) + >} +1 >Emitted(56, 2) Source(67, 2) + SourceIndex(0) --- >>>for (_o = [2, "trimmer", "trimming"], numberA2 = _o[0], nameA2 = _o[1], skillA2 = _o[2], _o, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] -6 > -7 > numberA2 -8 > , -9 > nameA2 -10> , -11> skillA2 -12> ] = [2, "trimmer", "trimming"], -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > [numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] +4 > +5 > numberA2 +6 > , +7 > nameA2 +8 > , +9 > skillA2 +10> ] = [2, "trimmer", "trimming"], +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(57, 1) Source(68, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(68, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(68, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(68, 6) + SourceIndex(0) -5 >Emitted(57, 37) Source(68, 62) + SourceIndex(0) -6 >Emitted(57, 39) Source(68, 7) + SourceIndex(0) -7 >Emitted(57, 55) Source(68, 15) + SourceIndex(0) -8 >Emitted(57, 57) Source(68, 17) + SourceIndex(0) -9 >Emitted(57, 71) Source(68, 23) + SourceIndex(0) -10>Emitted(57, 73) Source(68, 25) + SourceIndex(0) -11>Emitted(57, 88) Source(68, 32) + SourceIndex(0) -12>Emitted(57, 94) Source(68, 64) + SourceIndex(0) -13>Emitted(57, 95) Source(68, 65) + SourceIndex(0) -14>Emitted(57, 98) Source(68, 68) + SourceIndex(0) -15>Emitted(57, 99) Source(68, 69) + SourceIndex(0) -16>Emitted(57, 101) Source(68, 71) + SourceIndex(0) -17>Emitted(57, 102) Source(68, 72) + SourceIndex(0) -18>Emitted(57, 105) Source(68, 75) + SourceIndex(0) -19>Emitted(57, 106) Source(68, 76) + SourceIndex(0) -20>Emitted(57, 108) Source(68, 78) + SourceIndex(0) -21>Emitted(57, 109) Source(68, 79) + SourceIndex(0) -22>Emitted(57, 111) Source(68, 81) + SourceIndex(0) -23>Emitted(57, 113) Source(68, 83) + SourceIndex(0) -24>Emitted(57, 114) Source(68, 84) + SourceIndex(0) +2 >Emitted(57, 6) Source(68, 6) + SourceIndex(0) +3 >Emitted(57, 37) Source(68, 62) + SourceIndex(0) +4 >Emitted(57, 39) Source(68, 7) + SourceIndex(0) +5 >Emitted(57, 55) Source(68, 15) + SourceIndex(0) +6 >Emitted(57, 57) Source(68, 17) + SourceIndex(0) +7 >Emitted(57, 71) Source(68, 23) + SourceIndex(0) +8 >Emitted(57, 73) Source(68, 25) + SourceIndex(0) +9 >Emitted(57, 88) Source(68, 32) + SourceIndex(0) +10>Emitted(57, 94) Source(68, 64) + SourceIndex(0) +11>Emitted(57, 95) Source(68, 65) + SourceIndex(0) +12>Emitted(57, 98) Source(68, 68) + SourceIndex(0) +13>Emitted(57, 99) Source(68, 69) + SourceIndex(0) +14>Emitted(57, 101) Source(68, 71) + SourceIndex(0) +15>Emitted(57, 102) Source(68, 72) + SourceIndex(0) +16>Emitted(57, 105) Source(68, 75) + SourceIndex(0) +17>Emitted(57, 106) Source(68, 76) + SourceIndex(0) +18>Emitted(57, 108) Source(68, 78) + SourceIndex(0) +19>Emitted(57, 109) Source(68, 79) + SourceIndex(0) +20>Emitted(57, 111) Source(68, 81) + SourceIndex(0) +21>Emitted(57, 113) Source(68, 83) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1888,7 +1705,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1907,95 +1724,83 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(58, 25) Source(69, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(59, 1) Source(70, 1) + SourceIndex(0) -2 >Emitted(59, 2) Source(70, 2) + SourceIndex(0) + >} +1 >Emitted(59, 2) Source(70, 2) + SourceIndex(0) --- >>>for (nameMA = multiRobotA[0], _p = multiRobotA[1], primarySkillA = _p[0], secondarySkillA = _p[1], multiRobotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ([ -5 > nameMA -6 > , -7 > [primarySkillA, secondarySkillA] -8 > -9 > primarySkillA -10> , -11> secondarySkillA -12> ]] = -13> multiRobotA -14> , -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ([ +3 > nameMA +4 > , +5 > [primarySkillA, secondarySkillA] +6 > +7 > primarySkillA +8 > , +9 > secondarySkillA +10> ]] = +11> multiRobotA +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(60, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(60, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(60, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(60, 6) Source(71, 7) + SourceIndex(0) -5 >Emitted(60, 29) Source(71, 13) + SourceIndex(0) -6 >Emitted(60, 31) Source(71, 15) + SourceIndex(0) -7 >Emitted(60, 50) Source(71, 47) + SourceIndex(0) -8 >Emitted(60, 52) Source(71, 16) + SourceIndex(0) -9 >Emitted(60, 73) Source(71, 29) + SourceIndex(0) -10>Emitted(60, 75) Source(71, 31) + SourceIndex(0) -11>Emitted(60, 98) Source(71, 46) + SourceIndex(0) -12>Emitted(60, 100) Source(71, 51) + SourceIndex(0) -13>Emitted(60, 111) Source(71, 62) + SourceIndex(0) -14>Emitted(60, 113) Source(71, 64) + SourceIndex(0) -15>Emitted(60, 114) Source(71, 65) + SourceIndex(0) -16>Emitted(60, 117) Source(71, 68) + SourceIndex(0) -17>Emitted(60, 118) Source(71, 69) + SourceIndex(0) -18>Emitted(60, 120) Source(71, 71) + SourceIndex(0) -19>Emitted(60, 121) Source(71, 72) + SourceIndex(0) -20>Emitted(60, 124) Source(71, 75) + SourceIndex(0) -21>Emitted(60, 125) Source(71, 76) + SourceIndex(0) -22>Emitted(60, 127) Source(71, 78) + SourceIndex(0) -23>Emitted(60, 128) Source(71, 79) + SourceIndex(0) -24>Emitted(60, 130) Source(71, 81) + SourceIndex(0) -25>Emitted(60, 132) Source(71, 83) + SourceIndex(0) -26>Emitted(60, 133) Source(71, 84) + SourceIndex(0) +2 >Emitted(60, 6) Source(71, 7) + SourceIndex(0) +3 >Emitted(60, 29) Source(71, 13) + SourceIndex(0) +4 >Emitted(60, 31) Source(71, 15) + SourceIndex(0) +5 >Emitted(60, 50) Source(71, 47) + SourceIndex(0) +6 >Emitted(60, 52) Source(71, 16) + SourceIndex(0) +7 >Emitted(60, 73) Source(71, 29) + SourceIndex(0) +8 >Emitted(60, 75) Source(71, 31) + SourceIndex(0) +9 >Emitted(60, 98) Source(71, 46) + SourceIndex(0) +10>Emitted(60, 100) Source(71, 51) + SourceIndex(0) +11>Emitted(60, 111) Source(71, 62) + SourceIndex(0) +12>Emitted(60, 113) Source(71, 64) + SourceIndex(0) +13>Emitted(60, 114) Source(71, 65) + SourceIndex(0) +14>Emitted(60, 117) Source(71, 68) + SourceIndex(0) +15>Emitted(60, 118) Source(71, 69) + SourceIndex(0) +16>Emitted(60, 120) Source(71, 71) + SourceIndex(0) +17>Emitted(60, 121) Source(71, 72) + SourceIndex(0) +18>Emitted(60, 124) Source(71, 75) + SourceIndex(0) +19>Emitted(60, 125) Source(71, 76) + SourceIndex(0) +20>Emitted(60, 127) Source(71, 78) + SourceIndex(0) +21>Emitted(60, 128) Source(71, 79) + SourceIndex(0) +22>Emitted(60, 130) Source(71, 81) + SourceIndex(0) +23>Emitted(60, 132) Source(71, 83) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2006,7 +1811,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2025,95 +1830,83 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(61, 25) Source(72, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(62, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(62, 2) Source(73, 2) + SourceIndex(0) + >} +1 >Emitted(62, 2) Source(73, 2) + SourceIndex(0) --- >>>for (_q = getMultiRobot(), nameMA = _q[0], _r = _q[1], primarySkillA = _r[0], secondarySkillA = _r[1], _q, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() -6 > -7 > nameMA -8 > , -9 > [primarySkillA, secondarySkillA] -10> -11> primarySkillA -12> , -13> secondarySkillA -14> ]] = getMultiRobot(), -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > [nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot() +4 > +5 > nameMA +6 > , +7 > [primarySkillA, secondarySkillA] +8 > +9 > primarySkillA +10> , +11> secondarySkillA +12> ]] = getMultiRobot(), +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(63, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(63, 4) Source(74, 4) + SourceIndex(0) -3 >Emitted(63, 5) Source(74, 5) + SourceIndex(0) -4 >Emitted(63, 6) Source(74, 6) + SourceIndex(0) -5 >Emitted(63, 26) Source(74, 66) + SourceIndex(0) -6 >Emitted(63, 28) Source(74, 7) + SourceIndex(0) -7 >Emitted(63, 42) Source(74, 13) + SourceIndex(0) -8 >Emitted(63, 44) Source(74, 15) + SourceIndex(0) -9 >Emitted(63, 54) Source(74, 47) + SourceIndex(0) -10>Emitted(63, 56) Source(74, 16) + SourceIndex(0) -11>Emitted(63, 77) Source(74, 29) + SourceIndex(0) -12>Emitted(63, 79) Source(74, 31) + SourceIndex(0) -13>Emitted(63, 102) Source(74, 46) + SourceIndex(0) -14>Emitted(63, 108) Source(74, 68) + SourceIndex(0) -15>Emitted(63, 109) Source(74, 69) + SourceIndex(0) -16>Emitted(63, 112) Source(74, 72) + SourceIndex(0) -17>Emitted(63, 113) Source(74, 73) + SourceIndex(0) -18>Emitted(63, 115) Source(74, 75) + SourceIndex(0) -19>Emitted(63, 116) Source(74, 76) + SourceIndex(0) -20>Emitted(63, 119) Source(74, 79) + SourceIndex(0) -21>Emitted(63, 120) Source(74, 80) + SourceIndex(0) -22>Emitted(63, 122) Source(74, 82) + SourceIndex(0) -23>Emitted(63, 123) Source(74, 83) + SourceIndex(0) -24>Emitted(63, 125) Source(74, 85) + SourceIndex(0) -25>Emitted(63, 127) Source(74, 87) + SourceIndex(0) -26>Emitted(63, 128) Source(74, 88) + SourceIndex(0) +2 >Emitted(63, 6) Source(74, 6) + SourceIndex(0) +3 >Emitted(63, 26) Source(74, 66) + SourceIndex(0) +4 >Emitted(63, 28) Source(74, 7) + SourceIndex(0) +5 >Emitted(63, 42) Source(74, 13) + SourceIndex(0) +6 >Emitted(63, 44) Source(74, 15) + SourceIndex(0) +7 >Emitted(63, 54) Source(74, 47) + SourceIndex(0) +8 >Emitted(63, 56) Source(74, 16) + SourceIndex(0) +9 >Emitted(63, 77) Source(74, 29) + SourceIndex(0) +10>Emitted(63, 79) Source(74, 31) + SourceIndex(0) +11>Emitted(63, 102) Source(74, 46) + SourceIndex(0) +12>Emitted(63, 108) Source(74, 68) + SourceIndex(0) +13>Emitted(63, 109) Source(74, 69) + SourceIndex(0) +14>Emitted(63, 112) Source(74, 72) + SourceIndex(0) +15>Emitted(63, 113) Source(74, 73) + SourceIndex(0) +16>Emitted(63, 115) Source(74, 75) + SourceIndex(0) +17>Emitted(63, 116) Source(74, 76) + SourceIndex(0) +18>Emitted(63, 119) Source(74, 79) + SourceIndex(0) +19>Emitted(63, 120) Source(74, 80) + SourceIndex(0) +20>Emitted(63, 122) Source(74, 82) + SourceIndex(0) +21>Emitted(63, 123) Source(74, 83) + SourceIndex(0) +22>Emitted(63, 125) Source(74, 85) + SourceIndex(0) +23>Emitted(63, 127) Source(74, 87) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2124,7 +1917,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2143,95 +1936,83 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(64, 25) Source(75, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(65, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(65, 2) Source(76, 2) + SourceIndex(0) + >} +1 >Emitted(65, 2) Source(76, 2) + SourceIndex(0) --- >>>for (_s = ["trimmer", ["trimming", "edging"]], nameMA = _s[0], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1], _s, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] -6 > -7 > nameMA -8 > , -9 > [primarySkillA, secondarySkillA] -10> -11> primarySkillA -12> , -13> secondarySkillA -14> ]] = ["trimmer", ["trimming", "edging"]], -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > [nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] +4 > +5 > nameMA +6 > , +7 > [primarySkillA, secondarySkillA] +8 > +9 > primarySkillA +10> , +11> secondarySkillA +12> ]] = ["trimmer", ["trimming", "edging"]], +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(66, 1) Source(77, 1) + SourceIndex(0) -2 >Emitted(66, 4) Source(77, 4) + SourceIndex(0) -3 >Emitted(66, 5) Source(77, 5) + SourceIndex(0) -4 >Emitted(66, 6) Source(77, 6) + SourceIndex(0) -5 >Emitted(66, 46) Source(77, 86) + SourceIndex(0) -6 >Emitted(66, 48) Source(77, 7) + SourceIndex(0) -7 >Emitted(66, 62) Source(77, 13) + SourceIndex(0) -8 >Emitted(66, 64) Source(77, 15) + SourceIndex(0) -9 >Emitted(66, 74) Source(77, 47) + SourceIndex(0) -10>Emitted(66, 76) Source(77, 16) + SourceIndex(0) -11>Emitted(66, 97) Source(77, 29) + SourceIndex(0) -12>Emitted(66, 99) Source(77, 31) + SourceIndex(0) -13>Emitted(66, 122) Source(77, 46) + SourceIndex(0) -14>Emitted(66, 128) Source(77, 88) + SourceIndex(0) -15>Emitted(66, 129) Source(77, 89) + SourceIndex(0) -16>Emitted(66, 132) Source(77, 92) + SourceIndex(0) -17>Emitted(66, 133) Source(77, 93) + SourceIndex(0) -18>Emitted(66, 135) Source(77, 95) + SourceIndex(0) -19>Emitted(66, 136) Source(77, 96) + SourceIndex(0) -20>Emitted(66, 139) Source(77, 99) + SourceIndex(0) -21>Emitted(66, 140) Source(77, 100) + SourceIndex(0) -22>Emitted(66, 142) Source(77, 102) + SourceIndex(0) -23>Emitted(66, 143) Source(77, 103) + SourceIndex(0) -24>Emitted(66, 145) Source(77, 105) + SourceIndex(0) -25>Emitted(66, 147) Source(77, 107) + SourceIndex(0) -26>Emitted(66, 148) Source(77, 108) + SourceIndex(0) +2 >Emitted(66, 6) Source(77, 6) + SourceIndex(0) +3 >Emitted(66, 46) Source(77, 86) + SourceIndex(0) +4 >Emitted(66, 48) Source(77, 7) + SourceIndex(0) +5 >Emitted(66, 62) Source(77, 13) + SourceIndex(0) +6 >Emitted(66, 64) Source(77, 15) + SourceIndex(0) +7 >Emitted(66, 74) Source(77, 47) + SourceIndex(0) +8 >Emitted(66, 76) Source(77, 16) + SourceIndex(0) +9 >Emitted(66, 97) Source(77, 29) + SourceIndex(0) +10>Emitted(66, 99) Source(77, 31) + SourceIndex(0) +11>Emitted(66, 122) Source(77, 46) + SourceIndex(0) +12>Emitted(66, 128) Source(77, 88) + SourceIndex(0) +13>Emitted(66, 129) Source(77, 89) + SourceIndex(0) +14>Emitted(66, 132) Source(77, 92) + SourceIndex(0) +15>Emitted(66, 133) Source(77, 93) + SourceIndex(0) +16>Emitted(66, 135) Source(77, 95) + SourceIndex(0) +17>Emitted(66, 136) Source(77, 96) + SourceIndex(0) +18>Emitted(66, 139) Source(77, 99) + SourceIndex(0) +19>Emitted(66, 140) Source(77, 100) + SourceIndex(0) +20>Emitted(66, 142) Source(77, 102) + SourceIndex(0) +21>Emitted(66, 143) Source(77, 103) + SourceIndex(0) +22>Emitted(66, 145) Source(77, 105) + SourceIndex(0) +23>Emitted(66, 147) Source(77, 107) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2242,7 +2023,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2261,84 +2042,72 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(67, 25) Source(78, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(68, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(68, 2) Source(79, 2) + SourceIndex(0) + >} +1 >Emitted(68, 2) Source(79, 2) + SourceIndex(0) --- >>>for (numberA3 = robotA[0], robotAInfo = robotA.slice(1), robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > > -2 >for -3 > -4 > ([ -5 > numberA3 -6 > , -7 > ...robotAInfo -8 > ] = -9 > robotA -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ([ +3 > numberA3 +4 > , +5 > ...robotAInfo +6 > ] = +7 > robotA +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(69, 1) Source(81, 1) + SourceIndex(0) -2 >Emitted(69, 4) Source(81, 4) + SourceIndex(0) -3 >Emitted(69, 5) Source(81, 5) + SourceIndex(0) -4 >Emitted(69, 6) Source(81, 7) + SourceIndex(0) -5 >Emitted(69, 26) Source(81, 15) + SourceIndex(0) -6 >Emitted(69, 28) Source(81, 17) + SourceIndex(0) -7 >Emitted(69, 56) Source(81, 30) + SourceIndex(0) -8 >Emitted(69, 58) Source(81, 34) + SourceIndex(0) -9 >Emitted(69, 64) Source(81, 40) + SourceIndex(0) -10>Emitted(69, 66) Source(81, 42) + SourceIndex(0) -11>Emitted(69, 67) Source(81, 43) + SourceIndex(0) -12>Emitted(69, 70) Source(81, 46) + SourceIndex(0) -13>Emitted(69, 71) Source(81, 47) + SourceIndex(0) -14>Emitted(69, 73) Source(81, 49) + SourceIndex(0) -15>Emitted(69, 74) Source(81, 50) + SourceIndex(0) -16>Emitted(69, 77) Source(81, 53) + SourceIndex(0) -17>Emitted(69, 78) Source(81, 54) + SourceIndex(0) -18>Emitted(69, 80) Source(81, 56) + SourceIndex(0) -19>Emitted(69, 81) Source(81, 57) + SourceIndex(0) -20>Emitted(69, 83) Source(81, 59) + SourceIndex(0) -21>Emitted(69, 85) Source(81, 61) + SourceIndex(0) -22>Emitted(69, 86) Source(81, 62) + SourceIndex(0) +2 >Emitted(69, 6) Source(81, 7) + SourceIndex(0) +3 >Emitted(69, 26) Source(81, 15) + SourceIndex(0) +4 >Emitted(69, 28) Source(81, 17) + SourceIndex(0) +5 >Emitted(69, 56) Source(81, 30) + SourceIndex(0) +6 >Emitted(69, 58) Source(81, 34) + SourceIndex(0) +7 >Emitted(69, 64) Source(81, 40) + SourceIndex(0) +8 >Emitted(69, 66) Source(81, 42) + SourceIndex(0) +9 >Emitted(69, 67) Source(81, 43) + SourceIndex(0) +10>Emitted(69, 70) Source(81, 46) + SourceIndex(0) +11>Emitted(69, 71) Source(81, 47) + SourceIndex(0) +12>Emitted(69, 73) Source(81, 49) + SourceIndex(0) +13>Emitted(69, 74) Source(81, 50) + SourceIndex(0) +14>Emitted(69, 77) Source(81, 53) + SourceIndex(0) +15>Emitted(69, 78) Source(81, 54) + SourceIndex(0) +16>Emitted(69, 80) Source(81, 56) + SourceIndex(0) +17>Emitted(69, 81) Source(81, 57) + SourceIndex(0) +18>Emitted(69, 83) Source(81, 59) + SourceIndex(0) +19>Emitted(69, 85) Source(81, 61) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2349,7 +2118,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2368,83 +2137,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(70, 27) Source(82, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(71, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(71, 2) Source(83, 2) + SourceIndex(0) + >} +1 >Emitted(71, 2) Source(83, 2) + SourceIndex(0) --- >>>for (_u = getRobot(), numberA3 = _u[0], robotAInfo = _u.slice(1), _u, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA3, ...robotAInfo] = getRobot() -6 > -7 > numberA3 -8 > , -9 > ...robotAInfo -10> ] = getRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [numberA3, ...robotAInfo] = getRobot() +4 > +5 > numberA3 +6 > , +7 > ...robotAInfo +8 > ] = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(72, 1) Source(84, 1) + SourceIndex(0) -2 >Emitted(72, 4) Source(84, 4) + SourceIndex(0) -3 >Emitted(72, 5) Source(84, 5) + SourceIndex(0) -4 >Emitted(72, 6) Source(84, 6) + SourceIndex(0) -5 >Emitted(72, 21) Source(84, 44) + SourceIndex(0) -6 >Emitted(72, 23) Source(84, 7) + SourceIndex(0) -7 >Emitted(72, 39) Source(84, 15) + SourceIndex(0) -8 >Emitted(72, 41) Source(84, 17) + SourceIndex(0) -9 >Emitted(72, 65) Source(84, 30) + SourceIndex(0) -10>Emitted(72, 71) Source(84, 46) + SourceIndex(0) -11>Emitted(72, 72) Source(84, 47) + SourceIndex(0) -12>Emitted(72, 75) Source(84, 50) + SourceIndex(0) -13>Emitted(72, 76) Source(84, 51) + SourceIndex(0) -14>Emitted(72, 78) Source(84, 53) + SourceIndex(0) -15>Emitted(72, 79) Source(84, 54) + SourceIndex(0) -16>Emitted(72, 82) Source(84, 57) + SourceIndex(0) -17>Emitted(72, 83) Source(84, 58) + SourceIndex(0) -18>Emitted(72, 85) Source(84, 60) + SourceIndex(0) -19>Emitted(72, 86) Source(84, 61) + SourceIndex(0) -20>Emitted(72, 88) Source(84, 63) + SourceIndex(0) -21>Emitted(72, 90) Source(84, 65) + SourceIndex(0) -22>Emitted(72, 91) Source(84, 66) + SourceIndex(0) +2 >Emitted(72, 6) Source(84, 6) + SourceIndex(0) +3 >Emitted(72, 21) Source(84, 44) + SourceIndex(0) +4 >Emitted(72, 23) Source(84, 7) + SourceIndex(0) +5 >Emitted(72, 39) Source(84, 15) + SourceIndex(0) +6 >Emitted(72, 41) Source(84, 17) + SourceIndex(0) +7 >Emitted(72, 65) Source(84, 30) + SourceIndex(0) +8 >Emitted(72, 71) Source(84, 46) + SourceIndex(0) +9 >Emitted(72, 72) Source(84, 47) + SourceIndex(0) +10>Emitted(72, 75) Source(84, 50) + SourceIndex(0) +11>Emitted(72, 76) Source(84, 51) + SourceIndex(0) +12>Emitted(72, 78) Source(84, 53) + SourceIndex(0) +13>Emitted(72, 79) Source(84, 54) + SourceIndex(0) +14>Emitted(72, 82) Source(84, 57) + SourceIndex(0) +15>Emitted(72, 83) Source(84, 58) + SourceIndex(0) +16>Emitted(72, 85) Source(84, 60) + SourceIndex(0) +17>Emitted(72, 86) Source(84, 61) + SourceIndex(0) +18>Emitted(72, 88) Source(84, 63) + SourceIndex(0) +19>Emitted(72, 90) Source(84, 65) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2455,7 +2212,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2474,83 +2231,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(73, 27) Source(85, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(74, 1) Source(86, 1) + SourceIndex(0) -2 >Emitted(74, 2) Source(86, 2) + SourceIndex(0) + >} +1 >Emitted(74, 2) Source(86, 2) + SourceIndex(0) --- >>>for (_v = [2, "trimmer", "trimming"], numberA3 = _v[0], robotAInfo = _v.slice(1), _v, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] -6 > -7 > numberA3 -8 > , -9 > ...robotAInfo -10> ] = [2, "trimmer", "trimming"], -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [numberA3, ...robotAInfo] = [2, "trimmer", "trimming"] +4 > +5 > numberA3 +6 > , +7 > ...robotAInfo +8 > ] = [2, "trimmer", "trimming"], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(75, 1) Source(87, 1) + SourceIndex(0) -2 >Emitted(75, 4) Source(87, 4) + SourceIndex(0) -3 >Emitted(75, 5) Source(87, 5) + SourceIndex(0) -4 >Emitted(75, 6) Source(87, 6) + SourceIndex(0) -5 >Emitted(75, 37) Source(87, 67) + SourceIndex(0) -6 >Emitted(75, 39) Source(87, 7) + SourceIndex(0) -7 >Emitted(75, 55) Source(87, 15) + SourceIndex(0) -8 >Emitted(75, 57) Source(87, 17) + SourceIndex(0) -9 >Emitted(75, 81) Source(87, 30) + SourceIndex(0) -10>Emitted(75, 87) Source(87, 69) + SourceIndex(0) -11>Emitted(75, 88) Source(87, 70) + SourceIndex(0) -12>Emitted(75, 91) Source(87, 73) + SourceIndex(0) -13>Emitted(75, 92) Source(87, 74) + SourceIndex(0) -14>Emitted(75, 94) Source(87, 76) + SourceIndex(0) -15>Emitted(75, 95) Source(87, 77) + SourceIndex(0) -16>Emitted(75, 98) Source(87, 80) + SourceIndex(0) -17>Emitted(75, 99) Source(87, 81) + SourceIndex(0) -18>Emitted(75, 101) Source(87, 83) + SourceIndex(0) -19>Emitted(75, 102) Source(87, 84) + SourceIndex(0) -20>Emitted(75, 104) Source(87, 86) + SourceIndex(0) -21>Emitted(75, 106) Source(87, 88) + SourceIndex(0) -22>Emitted(75, 107) Source(87, 89) + SourceIndex(0) +2 >Emitted(75, 6) Source(87, 6) + SourceIndex(0) +3 >Emitted(75, 37) Source(87, 67) + SourceIndex(0) +4 >Emitted(75, 39) Source(87, 7) + SourceIndex(0) +5 >Emitted(75, 55) Source(87, 15) + SourceIndex(0) +6 >Emitted(75, 57) Source(87, 17) + SourceIndex(0) +7 >Emitted(75, 81) Source(87, 30) + SourceIndex(0) +8 >Emitted(75, 87) Source(87, 69) + SourceIndex(0) +9 >Emitted(75, 88) Source(87, 70) + SourceIndex(0) +10>Emitted(75, 91) Source(87, 73) + SourceIndex(0) +11>Emitted(75, 92) Source(87, 74) + SourceIndex(0) +12>Emitted(75, 94) Source(87, 76) + SourceIndex(0) +13>Emitted(75, 95) Source(87, 77) + SourceIndex(0) +14>Emitted(75, 98) Source(87, 80) + SourceIndex(0) +15>Emitted(75, 99) Source(87, 81) + SourceIndex(0) +16>Emitted(75, 101) Source(87, 83) + SourceIndex(0) +17>Emitted(75, 102) Source(87, 84) + SourceIndex(0) +18>Emitted(75, 104) Source(87, 86) + SourceIndex(0) +19>Emitted(75, 106) Source(87, 88) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2561,7 +2306,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2580,77 +2325,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(76, 27) Source(88, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(77, 1) Source(89, 1) + SourceIndex(0) -2 >Emitted(77, 2) Source(89, 2) + SourceIndex(0) + >} +1 >Emitted(77, 2) Source(89, 2) + SourceIndex(0) --- >>>for (multiRobotAInfo = multiRobotA.slice(0), multiRobotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ([ -5 > ...multiRobotAInfo -6 > ] = -7 > multiRobotA -8 > , -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ([ +3 > ...multiRobotAInfo +4 > ] = +5 > multiRobotA +6 > , +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(78, 1) Source(90, 1) + SourceIndex(0) -2 >Emitted(78, 4) Source(90, 4) + SourceIndex(0) -3 >Emitted(78, 5) Source(90, 5) + SourceIndex(0) -4 >Emitted(78, 6) Source(90, 7) + SourceIndex(0) -5 >Emitted(78, 44) Source(90, 25) + SourceIndex(0) -6 >Emitted(78, 46) Source(90, 29) + SourceIndex(0) -7 >Emitted(78, 57) Source(90, 40) + SourceIndex(0) -8 >Emitted(78, 59) Source(90, 42) + SourceIndex(0) -9 >Emitted(78, 60) Source(90, 43) + SourceIndex(0) -10>Emitted(78, 63) Source(90, 46) + SourceIndex(0) -11>Emitted(78, 64) Source(90, 47) + SourceIndex(0) -12>Emitted(78, 66) Source(90, 49) + SourceIndex(0) -13>Emitted(78, 67) Source(90, 50) + SourceIndex(0) -14>Emitted(78, 70) Source(90, 53) + SourceIndex(0) -15>Emitted(78, 71) Source(90, 54) + SourceIndex(0) -16>Emitted(78, 73) Source(90, 56) + SourceIndex(0) -17>Emitted(78, 74) Source(90, 57) + SourceIndex(0) -18>Emitted(78, 76) Source(90, 59) + SourceIndex(0) -19>Emitted(78, 78) Source(90, 61) + SourceIndex(0) -20>Emitted(78, 79) Source(90, 62) + SourceIndex(0) +2 >Emitted(78, 6) Source(90, 7) + SourceIndex(0) +3 >Emitted(78, 44) Source(90, 25) + SourceIndex(0) +4 >Emitted(78, 46) Source(90, 29) + SourceIndex(0) +5 >Emitted(78, 57) Source(90, 40) + SourceIndex(0) +6 >Emitted(78, 59) Source(90, 42) + SourceIndex(0) +7 >Emitted(78, 60) Source(90, 43) + SourceIndex(0) +8 >Emitted(78, 63) Source(90, 46) + SourceIndex(0) +9 >Emitted(78, 64) Source(90, 47) + SourceIndex(0) +10>Emitted(78, 66) Source(90, 49) + SourceIndex(0) +11>Emitted(78, 67) Source(90, 50) + SourceIndex(0) +12>Emitted(78, 70) Source(90, 53) + SourceIndex(0) +13>Emitted(78, 71) Source(90, 54) + SourceIndex(0) +14>Emitted(78, 73) Source(90, 56) + SourceIndex(0) +15>Emitted(78, 74) Source(90, 57) + SourceIndex(0) +16>Emitted(78, 76) Source(90, 59) + SourceIndex(0) +17>Emitted(78, 78) Source(90, 61) + SourceIndex(0) --- >>> console.log(multiRobotAInfo); 1 >^^^^ @@ -2661,7 +2394,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2680,77 +2413,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(79, 34) Source(91, 34) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(80, 1) Source(92, 1) + SourceIndex(0) -2 >Emitted(80, 2) Source(92, 2) + SourceIndex(0) + >} +1 >Emitted(80, 2) Source(92, 2) + SourceIndex(0) --- >>>for (_w = getMultiRobot(), multiRobotAInfo = _w.slice(0), _w, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [...multiRobotAInfo] = getMultiRobot() -6 > -7 > ...multiRobotAInfo -8 > ] = getMultiRobot(), -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [...multiRobotAInfo] = getMultiRobot() +4 > +5 > ...multiRobotAInfo +6 > ] = getMultiRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(81, 1) Source(93, 1) + SourceIndex(0) -2 >Emitted(81, 4) Source(93, 4) + SourceIndex(0) -3 >Emitted(81, 5) Source(93, 5) + SourceIndex(0) -4 >Emitted(81, 6) Source(93, 6) + SourceIndex(0) -5 >Emitted(81, 26) Source(93, 44) + SourceIndex(0) -6 >Emitted(81, 28) Source(93, 7) + SourceIndex(0) -7 >Emitted(81, 57) Source(93, 25) + SourceIndex(0) -8 >Emitted(81, 63) Source(93, 46) + SourceIndex(0) -9 >Emitted(81, 64) Source(93, 47) + SourceIndex(0) -10>Emitted(81, 67) Source(93, 50) + SourceIndex(0) -11>Emitted(81, 68) Source(93, 51) + SourceIndex(0) -12>Emitted(81, 70) Source(93, 53) + SourceIndex(0) -13>Emitted(81, 71) Source(93, 54) + SourceIndex(0) -14>Emitted(81, 74) Source(93, 57) + SourceIndex(0) -15>Emitted(81, 75) Source(93, 58) + SourceIndex(0) -16>Emitted(81, 77) Source(93, 60) + SourceIndex(0) -17>Emitted(81, 78) Source(93, 61) + SourceIndex(0) -18>Emitted(81, 80) Source(93, 63) + SourceIndex(0) -19>Emitted(81, 82) Source(93, 65) + SourceIndex(0) -20>Emitted(81, 83) Source(93, 66) + SourceIndex(0) +2 >Emitted(81, 6) Source(93, 6) + SourceIndex(0) +3 >Emitted(81, 26) Source(93, 44) + SourceIndex(0) +4 >Emitted(81, 28) Source(93, 7) + SourceIndex(0) +5 >Emitted(81, 57) Source(93, 25) + SourceIndex(0) +6 >Emitted(81, 63) Source(93, 46) + SourceIndex(0) +7 >Emitted(81, 64) Source(93, 47) + SourceIndex(0) +8 >Emitted(81, 67) Source(93, 50) + SourceIndex(0) +9 >Emitted(81, 68) Source(93, 51) + SourceIndex(0) +10>Emitted(81, 70) Source(93, 53) + SourceIndex(0) +11>Emitted(81, 71) Source(93, 54) + SourceIndex(0) +12>Emitted(81, 74) Source(93, 57) + SourceIndex(0) +13>Emitted(81, 75) Source(93, 58) + SourceIndex(0) +14>Emitted(81, 77) Source(93, 60) + SourceIndex(0) +15>Emitted(81, 78) Source(93, 61) + SourceIndex(0) +16>Emitted(81, 80) Source(93, 63) + SourceIndex(0) +17>Emitted(81, 82) Source(93, 65) + SourceIndex(0) --- >>> console.log(multiRobotAInfo); 1 >^^^^ @@ -2761,7 +2482,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2780,77 +2501,65 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(82, 34) Source(94, 34) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(83, 1) Source(95, 1) + SourceIndex(0) -2 >Emitted(83, 2) Source(95, 2) + SourceIndex(0) + >} +1 >Emitted(83, 2) Source(95, 2) + SourceIndex(0) --- >>>for (_x = ["trimmer", ["trimming", "edging"]], multiRobotAInfo = _x.slice(0), _x, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] -6 > -7 > ...multiRobotAInfo -8 > ] = ["trimmer", ["trimming", "edging"]], -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] +4 > +5 > ...multiRobotAInfo +6 > ] = ["trimmer", ["trimming", "edging"]], +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(84, 1) Source(96, 1) + SourceIndex(0) -2 >Emitted(84, 4) Source(96, 4) + SourceIndex(0) -3 >Emitted(84, 5) Source(96, 5) + SourceIndex(0) -4 >Emitted(84, 6) Source(96, 6) + SourceIndex(0) -5 >Emitted(84, 46) Source(96, 83) + SourceIndex(0) -6 >Emitted(84, 48) Source(96, 7) + SourceIndex(0) -7 >Emitted(84, 77) Source(96, 25) + SourceIndex(0) -8 >Emitted(84, 83) Source(96, 85) + SourceIndex(0) -9 >Emitted(84, 84) Source(96, 86) + SourceIndex(0) -10>Emitted(84, 87) Source(96, 89) + SourceIndex(0) -11>Emitted(84, 88) Source(96, 90) + SourceIndex(0) -12>Emitted(84, 90) Source(96, 92) + SourceIndex(0) -13>Emitted(84, 91) Source(96, 93) + SourceIndex(0) -14>Emitted(84, 94) Source(96, 96) + SourceIndex(0) -15>Emitted(84, 95) Source(96, 97) + SourceIndex(0) -16>Emitted(84, 97) Source(96, 99) + SourceIndex(0) -17>Emitted(84, 98) Source(96, 100) + SourceIndex(0) -18>Emitted(84, 100) Source(96, 102) + SourceIndex(0) -19>Emitted(84, 102) Source(96, 104) + SourceIndex(0) -20>Emitted(84, 103) Source(96, 105) + SourceIndex(0) +2 >Emitted(84, 6) Source(96, 6) + SourceIndex(0) +3 >Emitted(84, 46) Source(96, 83) + SourceIndex(0) +4 >Emitted(84, 48) Source(96, 7) + SourceIndex(0) +5 >Emitted(84, 77) Source(96, 25) + SourceIndex(0) +6 >Emitted(84, 83) Source(96, 85) + SourceIndex(0) +7 >Emitted(84, 84) Source(96, 86) + SourceIndex(0) +8 >Emitted(84, 87) Source(96, 89) + SourceIndex(0) +9 >Emitted(84, 88) Source(96, 90) + SourceIndex(0) +10>Emitted(84, 90) Source(96, 92) + SourceIndex(0) +11>Emitted(84, 91) Source(96, 93) + SourceIndex(0) +12>Emitted(84, 94) Source(96, 96) + SourceIndex(0) +13>Emitted(84, 95) Source(96, 97) + SourceIndex(0) +14>Emitted(84, 97) Source(96, 99) + SourceIndex(0) +15>Emitted(84, 98) Source(96, 100) + SourceIndex(0) +16>Emitted(84, 100) Source(96, 102) + SourceIndex(0) +17>Emitted(84, 102) Source(96, 104) + SourceIndex(0) --- >>> console.log(multiRobotAInfo); 1 >^^^^ @@ -2861,7 +2570,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 6 > ^^^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2880,14 +2589,11 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPattern2.ts 8 >Emitted(85, 34) Source(97, 34) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(86, 1) Source(98, 1) + SourceIndex(0) -2 >Emitted(86, 2) Source(98, 2) + SourceIndex(0) + >} +1 >Emitted(86, 2) Source(98, 2) + SourceIndex(0) --- >>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; >>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map index 58097c096a5..8bf2646831a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAQ,IAAA,cAAa,EAAb,mCAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAA+B,EAA5B,UAAc,EAAd,mCAAc,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,+BAA+C,EAA5C,UAAc,EAAd,mCAAc,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAQ,IAAA,mBAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,oBAG8B,EAH3B,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,wCAGkD,EAH/C,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EAC4B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,cAAY,EAAZ,iCAAY,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,kBAAY,EAAZ,iCAAY,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,kCAAY,EAAZ,iCAAY,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,mBAAc,EAAd,mCAAc,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,uBAAc,EAAd,mCAAc,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,2CAAc,EAAd,mCAAc,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,cAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAAgE,EAA/D,UAAa,EAAb,kCAAa,EAAE,UAAe,EAAf,oCAAe,EAAE,UAAiB,EAAjB,sCAAiB,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,+BAAgF,EAA/E,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CACC,IAAA,oBAAiB,EAAjB,wCAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEpB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,qBAKW,EALV,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEf,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,yCAK+B,EAL9B,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,eAAa,EAAb,oCAAa,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,gBAA2C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,gCAA2D,EAA1D,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,KAAY,IAAA,cAAa,EAAb,mCAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,eAA+B,EAA5B,UAAc,EAAd,mCAAc,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,+BAA+C,EAA5C,UAAc,EAAd,mCAAc,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACzE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAY,IAAA,mBAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAS,IAAA,oBAG8B,EAH3B,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAS,IAAA,wCAGkD,EAH/C,UAGQ,EAHR,0CAGQ,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EAC4B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAAU,IAAA,cAAY,EAAZ,iCAAY,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAU,IAAA,kBAAY,EAAZ,iCAAY,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAU,IAAA,kCAAY,EAAZ,iCAAY,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAU,IAAA,mBAAc,EAAd,mCAAc,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,uBAAc,EAAd,mCAAc,EAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,2CAAc,EAAd,mCAAc,EAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAU,IAAA,cAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACtF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,eAAgE,EAA/D,UAAa,EAAb,kCAAa,EAAE,UAAe,EAAf,oCAAe,EAAE,UAAiB,EAAjB,sCAAiB,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1F,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,+BAAgF,EAA/E,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1G,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KACK,IAAA,oBAAiB,EAAjB,wCAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEpB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,qBAKW,EALV,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEf,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAS,IAAA,yCAK+B,EAL9B,YAAiB,EAAjB,wCAAiB,EACvB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,EAEK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAAU,IAAA,eAAa,EAAb,oCAAa,EAAE,4BAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,gBAA2C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,gCAA2D,EAA1D,YAAa,EAAb,oCAAa,EAAE,yBAAa,EAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt index 1a8dde7dee4..3c46d62dbb4 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.sourcemap.txt @@ -61,21 +61,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t --- >>> return robotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robotA -5 > ; +2 > return +3 > robotA +4 > ; 1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) -5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +2 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +3 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) --- >>>} 1 > @@ -188,21 +185,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t --- >>> return multiRobotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobotA -5 > ; +2 > return +3 > multiRobotA +4 > ; 1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) --- >>>} 1 > @@ -216,70 +210,61 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t --- >>>for (var _a = robotA[1], nameA = _a === void 0 ? "name" : _a, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > > -2 >for -3 > -4 > (let [, -5 > -6 > nameA ="name" -7 > -8 > nameA ="name" -9 > ] = robotA, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [, +3 > +4 > nameA ="name" +5 > +6 > nameA ="name" +7 > ] = robotA, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(10, 1) Source(18, 1) + SourceIndex(0) -2 >Emitted(10, 4) Source(18, 4) + SourceIndex(0) -3 >Emitted(10, 5) Source(18, 5) + SourceIndex(0) -4 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) -5 >Emitted(10, 10) Source(18, 13) + SourceIndex(0) -6 >Emitted(10, 24) Source(18, 26) + SourceIndex(0) -7 >Emitted(10, 26) Source(18, 13) + SourceIndex(0) -8 >Emitted(10, 61) Source(18, 26) + SourceIndex(0) -9 >Emitted(10, 63) Source(18, 38) + SourceIndex(0) -10>Emitted(10, 64) Source(18, 39) + SourceIndex(0) -11>Emitted(10, 67) Source(18, 42) + SourceIndex(0) -12>Emitted(10, 68) Source(18, 43) + SourceIndex(0) -13>Emitted(10, 70) Source(18, 45) + SourceIndex(0) -14>Emitted(10, 71) Source(18, 46) + SourceIndex(0) -15>Emitted(10, 74) Source(18, 49) + SourceIndex(0) -16>Emitted(10, 75) Source(18, 50) + SourceIndex(0) -17>Emitted(10, 77) Source(18, 52) + SourceIndex(0) -18>Emitted(10, 78) Source(18, 53) + SourceIndex(0) -19>Emitted(10, 80) Source(18, 55) + SourceIndex(0) -20>Emitted(10, 82) Source(18, 57) + SourceIndex(0) -21>Emitted(10, 83) Source(18, 58) + SourceIndex(0) +2 >Emitted(10, 6) Source(18, 13) + SourceIndex(0) +3 >Emitted(10, 10) Source(18, 13) + SourceIndex(0) +4 >Emitted(10, 24) Source(18, 26) + SourceIndex(0) +5 >Emitted(10, 26) Source(18, 13) + SourceIndex(0) +6 >Emitted(10, 61) Source(18, 26) + SourceIndex(0) +7 >Emitted(10, 63) Source(18, 38) + SourceIndex(0) +8 >Emitted(10, 64) Source(18, 39) + SourceIndex(0) +9 >Emitted(10, 67) Source(18, 42) + SourceIndex(0) +10>Emitted(10, 68) Source(18, 43) + SourceIndex(0) +11>Emitted(10, 70) Source(18, 45) + SourceIndex(0) +12>Emitted(10, 71) Source(18, 46) + SourceIndex(0) +13>Emitted(10, 74) Source(18, 49) + SourceIndex(0) +14>Emitted(10, 75) Source(18, 50) + SourceIndex(0) +15>Emitted(10, 77) Source(18, 52) + SourceIndex(0) +16>Emitted(10, 78) Source(18, 53) + SourceIndex(0) +17>Emitted(10, 80) Source(18, 55) + SourceIndex(0) +18>Emitted(10, 82) Source(18, 57) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -290,7 +275,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -309,86 +294,74 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(11, 24) Source(19, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(12, 1) Source(20, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) + >} +1 >Emitted(12, 2) Source(20, 2) + SourceIndex(0) --- >>>for (var _b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, nameA = "name"] = getRobot() -7 > -8 > nameA = "name" -9 > -10> nameA = "name" -11> ] = getRobot(), -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let +3 > +4 > [, nameA = "name"] = getRobot() +5 > +6 > nameA = "name" +7 > +8 > nameA = "name" +9 > ] = getRobot(), +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) -3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) -4 >Emitted(13, 6) Source(21, 10) + SourceIndex(0) -5 >Emitted(13, 10) Source(21, 10) + SourceIndex(0) -6 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) -7 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) -8 >Emitted(13, 37) Source(21, 27) + SourceIndex(0) -9 >Emitted(13, 39) Source(21, 13) + SourceIndex(0) -10>Emitted(13, 74) Source(21, 27) + SourceIndex(0) -11>Emitted(13, 76) Source(21, 43) + SourceIndex(0) -12>Emitted(13, 77) Source(21, 44) + SourceIndex(0) -13>Emitted(13, 80) Source(21, 47) + SourceIndex(0) -14>Emitted(13, 81) Source(21, 48) + SourceIndex(0) -15>Emitted(13, 83) Source(21, 50) + SourceIndex(0) -16>Emitted(13, 84) Source(21, 51) + SourceIndex(0) -17>Emitted(13, 87) Source(21, 54) + SourceIndex(0) -18>Emitted(13, 88) Source(21, 55) + SourceIndex(0) -19>Emitted(13, 90) Source(21, 57) + SourceIndex(0) -20>Emitted(13, 91) Source(21, 58) + SourceIndex(0) -21>Emitted(13, 93) Source(21, 60) + SourceIndex(0) -22>Emitted(13, 95) Source(21, 62) + SourceIndex(0) -23>Emitted(13, 96) Source(21, 63) + SourceIndex(0) +2 >Emitted(13, 6) Source(21, 10) + SourceIndex(0) +3 >Emitted(13, 10) Source(21, 10) + SourceIndex(0) +4 >Emitted(13, 25) Source(21, 41) + SourceIndex(0) +5 >Emitted(13, 27) Source(21, 13) + SourceIndex(0) +6 >Emitted(13, 37) Source(21, 27) + SourceIndex(0) +7 >Emitted(13, 39) Source(21, 13) + SourceIndex(0) +8 >Emitted(13, 74) Source(21, 27) + SourceIndex(0) +9 >Emitted(13, 76) Source(21, 43) + SourceIndex(0) +10>Emitted(13, 77) Source(21, 44) + SourceIndex(0) +11>Emitted(13, 80) Source(21, 47) + SourceIndex(0) +12>Emitted(13, 81) Source(21, 48) + SourceIndex(0) +13>Emitted(13, 83) Source(21, 50) + SourceIndex(0) +14>Emitted(13, 84) Source(21, 51) + SourceIndex(0) +15>Emitted(13, 87) Source(21, 54) + SourceIndex(0) +16>Emitted(13, 88) Source(21, 55) + SourceIndex(0) +17>Emitted(13, 90) Source(21, 57) + SourceIndex(0) +18>Emitted(13, 91) Source(21, 58) + SourceIndex(0) +19>Emitted(13, 93) Source(21, 60) + SourceIndex(0) +20>Emitted(13, 95) Source(21, 62) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -399,7 +372,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -418,86 +391,74 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(14, 24) Source(22, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(15, 1) Source(23, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) + >} +1 >Emitted(15, 2) Source(23, 2) + SourceIndex(0) --- >>>for (var _d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, nameA = "name"] = [2, "trimmer", "trimming"] -7 > -8 > nameA = "name" -9 > -10> nameA = "name" -11> ] = [2, "trimmer", "trimming"], -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let +3 > +4 > [, nameA = "name"] = [2, "trimmer", "trimming"] +5 > +6 > nameA = "name" +7 > +8 > nameA = "name" +9 > ] = [2, "trimmer", "trimming"], +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(16, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(16, 4) Source(24, 4) + SourceIndex(0) -3 >Emitted(16, 5) Source(24, 5) + SourceIndex(0) -4 >Emitted(16, 6) Source(24, 10) + SourceIndex(0) -5 >Emitted(16, 10) Source(24, 10) + SourceIndex(0) -6 >Emitted(16, 41) Source(24, 57) + SourceIndex(0) -7 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) -8 >Emitted(16, 53) Source(24, 27) + SourceIndex(0) -9 >Emitted(16, 55) Source(24, 13) + SourceIndex(0) -10>Emitted(16, 90) Source(24, 27) + SourceIndex(0) -11>Emitted(16, 92) Source(24, 59) + SourceIndex(0) -12>Emitted(16, 93) Source(24, 60) + SourceIndex(0) -13>Emitted(16, 96) Source(24, 63) + SourceIndex(0) -14>Emitted(16, 97) Source(24, 64) + SourceIndex(0) -15>Emitted(16, 99) Source(24, 66) + SourceIndex(0) -16>Emitted(16, 100) Source(24, 67) + SourceIndex(0) -17>Emitted(16, 103) Source(24, 70) + SourceIndex(0) -18>Emitted(16, 104) Source(24, 71) + SourceIndex(0) -19>Emitted(16, 106) Source(24, 73) + SourceIndex(0) -20>Emitted(16, 107) Source(24, 74) + SourceIndex(0) -21>Emitted(16, 109) Source(24, 76) + SourceIndex(0) -22>Emitted(16, 111) Source(24, 78) + SourceIndex(0) -23>Emitted(16, 112) Source(24, 79) + SourceIndex(0) +2 >Emitted(16, 6) Source(24, 10) + SourceIndex(0) +3 >Emitted(16, 10) Source(24, 10) + SourceIndex(0) +4 >Emitted(16, 41) Source(24, 57) + SourceIndex(0) +5 >Emitted(16, 43) Source(24, 13) + SourceIndex(0) +6 >Emitted(16, 53) Source(24, 27) + SourceIndex(0) +7 >Emitted(16, 55) Source(24, 13) + SourceIndex(0) +8 >Emitted(16, 90) Source(24, 27) + SourceIndex(0) +9 >Emitted(16, 92) Source(24, 59) + SourceIndex(0) +10>Emitted(16, 93) Source(24, 60) + SourceIndex(0) +11>Emitted(16, 96) Source(24, 63) + SourceIndex(0) +12>Emitted(16, 97) Source(24, 64) + SourceIndex(0) +13>Emitted(16, 99) Source(24, 66) + SourceIndex(0) +14>Emitted(16, 100) Source(24, 67) + SourceIndex(0) +15>Emitted(16, 103) Source(24, 70) + SourceIndex(0) +16>Emitted(16, 104) Source(24, 71) + SourceIndex(0) +17>Emitted(16, 106) Source(24, 73) + SourceIndex(0) +18>Emitted(16, 107) Source(24, 74) + SourceIndex(0) +19>Emitted(16, 109) Source(24, 76) + SourceIndex(0) +20>Emitted(16, 111) Source(24, 78) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -508,7 +469,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -527,112 +488,100 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(17, 24) Source(25, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(18, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) + >} +1 >Emitted(18, 2) Source(26, 2) + SourceIndex(0) --- >>>for (var _f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^ -28> ^^ -29> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ 1-> > -2 >for -3 > -4 > (let [, -5 > -6 > [ +2 >for (let [, +3 > +4 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -7 > -8 > [ +5 > +6 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -9 > -10> primarySkillA = "primary" -11> -12> primarySkillA = "primary" -13> , +7 > +8 > primarySkillA = "primary" +9 > +10> primarySkillA = "primary" +11> , > -14> secondarySkillA = "secondary" -15> -16> secondarySkillA = "secondary" -17> +12> secondarySkillA = "secondary" +13> +14> secondarySkillA = "secondary" +15> > ] = ["none", "none"]] = multiRobotA, -18> i -19> = -20> 0 -21> ; -22> i -23> < -24> 1 -25> ; -26> i -27> ++ -28> ) -29> { +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) 1->Emitted(19, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(19, 4) Source(27, 4) + SourceIndex(0) -3 >Emitted(19, 5) Source(27, 5) + SourceIndex(0) -4 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) -5 >Emitted(19, 10) Source(27, 13) + SourceIndex(0) -6 >Emitted(19, 29) Source(30, 21) + SourceIndex(0) -7 >Emitted(19, 31) Source(27, 13) + SourceIndex(0) -8 >Emitted(19, 73) Source(30, 21) + SourceIndex(0) -9 >Emitted(19, 75) Source(28, 5) + SourceIndex(0) -10>Emitted(19, 85) Source(28, 30) + SourceIndex(0) -11>Emitted(19, 87) Source(28, 5) + SourceIndex(0) -12>Emitted(19, 133) Source(28, 30) + SourceIndex(0) -13>Emitted(19, 135) Source(29, 5) + SourceIndex(0) -14>Emitted(19, 145) Source(29, 34) + SourceIndex(0) -15>Emitted(19, 147) Source(29, 5) + SourceIndex(0) -16>Emitted(19, 197) Source(29, 34) + SourceIndex(0) -17>Emitted(19, 199) Source(30, 38) + SourceIndex(0) -18>Emitted(19, 200) Source(30, 39) + SourceIndex(0) -19>Emitted(19, 203) Source(30, 42) + SourceIndex(0) -20>Emitted(19, 204) Source(30, 43) + SourceIndex(0) -21>Emitted(19, 206) Source(30, 45) + SourceIndex(0) -22>Emitted(19, 207) Source(30, 46) + SourceIndex(0) -23>Emitted(19, 210) Source(30, 49) + SourceIndex(0) -24>Emitted(19, 211) Source(30, 50) + SourceIndex(0) -25>Emitted(19, 213) Source(30, 52) + SourceIndex(0) -26>Emitted(19, 214) Source(30, 53) + SourceIndex(0) -27>Emitted(19, 216) Source(30, 55) + SourceIndex(0) -28>Emitted(19, 218) Source(30, 57) + SourceIndex(0) -29>Emitted(19, 219) Source(30, 58) + SourceIndex(0) +2 >Emitted(19, 6) Source(27, 13) + SourceIndex(0) +3 >Emitted(19, 10) Source(27, 13) + SourceIndex(0) +4 >Emitted(19, 29) Source(30, 21) + SourceIndex(0) +5 >Emitted(19, 31) Source(27, 13) + SourceIndex(0) +6 >Emitted(19, 73) Source(30, 21) + SourceIndex(0) +7 >Emitted(19, 75) Source(28, 5) + SourceIndex(0) +8 >Emitted(19, 85) Source(28, 30) + SourceIndex(0) +9 >Emitted(19, 87) Source(28, 5) + SourceIndex(0) +10>Emitted(19, 133) Source(28, 30) + SourceIndex(0) +11>Emitted(19, 135) Source(29, 5) + SourceIndex(0) +12>Emitted(19, 145) Source(29, 34) + SourceIndex(0) +13>Emitted(19, 147) Source(29, 5) + SourceIndex(0) +14>Emitted(19, 197) Source(29, 34) + SourceIndex(0) +15>Emitted(19, 199) Source(30, 38) + SourceIndex(0) +16>Emitted(19, 200) Source(30, 39) + SourceIndex(0) +17>Emitted(19, 203) Source(30, 42) + SourceIndex(0) +18>Emitted(19, 204) Source(30, 43) + SourceIndex(0) +19>Emitted(19, 206) Source(30, 45) + SourceIndex(0) +20>Emitted(19, 207) Source(30, 46) + SourceIndex(0) +21>Emitted(19, 210) Source(30, 49) + SourceIndex(0) +22>Emitted(19, 211) Source(30, 50) + SourceIndex(0) +23>Emitted(19, 213) Source(30, 52) + SourceIndex(0) +24>Emitted(19, 214) Source(30, 53) + SourceIndex(0) +25>Emitted(19, 216) Source(30, 55) + SourceIndex(0) +26>Emitted(19, 218) Source(30, 57) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -643,7 +592,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -662,121 +611,109 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(20, 32) Source(31, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(21, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(21, 2) Source(32, 2) + SourceIndex(0) + >} +1 >Emitted(21, 2) Source(32, 2) + SourceIndex(0) --- >>>for (var _k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^ -30> ^^ -31> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^ +28> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, [ +2 >for (let +3 > +4 > [, [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"]] = getMultiRobot() -7 > -8 > [ +5 > +6 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -9 > -10> [ +7 > +8 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -11> -12> primarySkillA = "primary" -13> -14> primarySkillA = "primary" -15> , +9 > +10> primarySkillA = "primary" +11> +12> primarySkillA = "primary" +13> , > -16> secondarySkillA = "secondary" -17> -18> secondarySkillA = "secondary" -19> +14> secondarySkillA = "secondary" +15> +16> secondarySkillA = "secondary" +17> > ] = ["none", "none"]] = getMultiRobot(), -20> i -21> = -22> 0 -23> ; -24> i -25> < -26> 1 -27> ; -28> i -29> ++ -30> ) -31> { +18> i +19> = +20> 0 +21> ; +22> i +23> < +24> 1 +25> ; +26> i +27> ++ +28> ) 1->Emitted(22, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(22, 4) Source(33, 4) + SourceIndex(0) -3 >Emitted(22, 5) Source(33, 5) + SourceIndex(0) -4 >Emitted(22, 6) Source(33, 10) + SourceIndex(0) -5 >Emitted(22, 10) Source(33, 10) + SourceIndex(0) -6 >Emitted(22, 30) Source(36, 40) + SourceIndex(0) -7 >Emitted(22, 32) Source(33, 13) + SourceIndex(0) -8 >Emitted(22, 42) Source(36, 21) + SourceIndex(0) -9 >Emitted(22, 44) Source(33, 13) + SourceIndex(0) -10>Emitted(22, 86) Source(36, 21) + SourceIndex(0) -11>Emitted(22, 88) Source(34, 5) + SourceIndex(0) -12>Emitted(22, 98) Source(34, 30) + SourceIndex(0) -13>Emitted(22, 100) Source(34, 5) + SourceIndex(0) -14>Emitted(22, 146) Source(34, 30) + SourceIndex(0) -15>Emitted(22, 148) Source(35, 5) + SourceIndex(0) -16>Emitted(22, 158) Source(35, 34) + SourceIndex(0) -17>Emitted(22, 160) Source(35, 5) + SourceIndex(0) -18>Emitted(22, 210) Source(35, 34) + SourceIndex(0) -19>Emitted(22, 212) Source(36, 42) + SourceIndex(0) -20>Emitted(22, 213) Source(36, 43) + SourceIndex(0) -21>Emitted(22, 216) Source(36, 46) + SourceIndex(0) -22>Emitted(22, 217) Source(36, 47) + SourceIndex(0) -23>Emitted(22, 219) Source(36, 49) + SourceIndex(0) -24>Emitted(22, 220) Source(36, 50) + SourceIndex(0) -25>Emitted(22, 223) Source(36, 53) + SourceIndex(0) -26>Emitted(22, 224) Source(36, 54) + SourceIndex(0) -27>Emitted(22, 226) Source(36, 56) + SourceIndex(0) -28>Emitted(22, 227) Source(36, 57) + SourceIndex(0) -29>Emitted(22, 229) Source(36, 59) + SourceIndex(0) -30>Emitted(22, 231) Source(36, 61) + SourceIndex(0) -31>Emitted(22, 232) Source(36, 62) + SourceIndex(0) +2 >Emitted(22, 6) Source(33, 10) + SourceIndex(0) +3 >Emitted(22, 10) Source(33, 10) + SourceIndex(0) +4 >Emitted(22, 30) Source(36, 40) + SourceIndex(0) +5 >Emitted(22, 32) Source(33, 13) + SourceIndex(0) +6 >Emitted(22, 42) Source(36, 21) + SourceIndex(0) +7 >Emitted(22, 44) Source(33, 13) + SourceIndex(0) +8 >Emitted(22, 86) Source(36, 21) + SourceIndex(0) +9 >Emitted(22, 88) Source(34, 5) + SourceIndex(0) +10>Emitted(22, 98) Source(34, 30) + SourceIndex(0) +11>Emitted(22, 100) Source(34, 5) + SourceIndex(0) +12>Emitted(22, 146) Source(34, 30) + SourceIndex(0) +13>Emitted(22, 148) Source(35, 5) + SourceIndex(0) +14>Emitted(22, 158) Source(35, 34) + SourceIndex(0) +15>Emitted(22, 160) Source(35, 5) + SourceIndex(0) +16>Emitted(22, 210) Source(35, 34) + SourceIndex(0) +17>Emitted(22, 212) Source(36, 42) + SourceIndex(0) +18>Emitted(22, 213) Source(36, 43) + SourceIndex(0) +19>Emitted(22, 216) Source(36, 46) + SourceIndex(0) +20>Emitted(22, 217) Source(36, 47) + SourceIndex(0) +21>Emitted(22, 219) Source(36, 49) + SourceIndex(0) +22>Emitted(22, 220) Source(36, 50) + SourceIndex(0) +23>Emitted(22, 223) Source(36, 53) + SourceIndex(0) +24>Emitted(22, 224) Source(36, 54) + SourceIndex(0) +25>Emitted(22, 226) Source(36, 56) + SourceIndex(0) +26>Emitted(22, 227) Source(36, 57) + SourceIndex(0) +27>Emitted(22, 229) Source(36, 59) + SourceIndex(0) +28>Emitted(22, 231) Source(36, 61) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -787,7 +724,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -806,121 +743,109 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(23, 32) Source(37, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(24, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(24, 2) Source(38, 2) + SourceIndex(0) + >} +1 >Emitted(24, 2) Source(38, 2) + SourceIndex(0) --- >>>for (var _q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^ -30> ^^ -31> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^ +28> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [, [ +2 >for (let +3 > +4 > [, [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] -7 > -8 > [ +5 > +6 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -9 > -10> [ +7 > +8 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -11> -12> primarySkillA = "primary" -13> -14> primarySkillA = "primary" -15> , +9 > +10> primarySkillA = "primary" +11> +12> primarySkillA = "primary" +13> , > -16> secondarySkillA = "secondary" -17> -18> secondarySkillA = "secondary" -19> +14> secondarySkillA = "secondary" +15> +16> secondarySkillA = "secondary" +17> > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], -20> i -21> = -22> 0 -23> ; -24> i -25> < -26> 1 -27> ; -28> i -29> ++ -30> ) -31> { +18> i +19> = +20> 0 +21> ; +22> i +23> < +24> 1 +25> ; +26> i +27> ++ +28> ) 1->Emitted(25, 1) Source(39, 1) + SourceIndex(0) -2 >Emitted(25, 4) Source(39, 4) + SourceIndex(0) -3 >Emitted(25, 5) Source(39, 5) + SourceIndex(0) -4 >Emitted(25, 6) Source(39, 10) + SourceIndex(0) -5 >Emitted(25, 10) Source(39, 10) + SourceIndex(0) -6 >Emitted(25, 50) Source(42, 60) + SourceIndex(0) -7 >Emitted(25, 52) Source(39, 13) + SourceIndex(0) -8 >Emitted(25, 62) Source(42, 21) + SourceIndex(0) -9 >Emitted(25, 64) Source(39, 13) + SourceIndex(0) -10>Emitted(25, 106) Source(42, 21) + SourceIndex(0) -11>Emitted(25, 108) Source(40, 5) + SourceIndex(0) -12>Emitted(25, 118) Source(40, 30) + SourceIndex(0) -13>Emitted(25, 120) Source(40, 5) + SourceIndex(0) -14>Emitted(25, 166) Source(40, 30) + SourceIndex(0) -15>Emitted(25, 168) Source(41, 5) + SourceIndex(0) -16>Emitted(25, 178) Source(41, 34) + SourceIndex(0) -17>Emitted(25, 180) Source(41, 5) + SourceIndex(0) -18>Emitted(25, 230) Source(41, 34) + SourceIndex(0) -19>Emitted(25, 232) Source(42, 62) + SourceIndex(0) -20>Emitted(25, 233) Source(42, 63) + SourceIndex(0) -21>Emitted(25, 236) Source(42, 66) + SourceIndex(0) -22>Emitted(25, 237) Source(42, 67) + SourceIndex(0) -23>Emitted(25, 239) Source(42, 69) + SourceIndex(0) -24>Emitted(25, 240) Source(42, 70) + SourceIndex(0) -25>Emitted(25, 243) Source(42, 73) + SourceIndex(0) -26>Emitted(25, 244) Source(42, 74) + SourceIndex(0) -27>Emitted(25, 246) Source(42, 76) + SourceIndex(0) -28>Emitted(25, 247) Source(42, 77) + SourceIndex(0) -29>Emitted(25, 249) Source(42, 79) + SourceIndex(0) -30>Emitted(25, 251) Source(42, 81) + SourceIndex(0) -31>Emitted(25, 252) Source(42, 82) + SourceIndex(0) +2 >Emitted(25, 6) Source(39, 10) + SourceIndex(0) +3 >Emitted(25, 10) Source(39, 10) + SourceIndex(0) +4 >Emitted(25, 50) Source(42, 60) + SourceIndex(0) +5 >Emitted(25, 52) Source(39, 13) + SourceIndex(0) +6 >Emitted(25, 62) Source(42, 21) + SourceIndex(0) +7 >Emitted(25, 64) Source(39, 13) + SourceIndex(0) +8 >Emitted(25, 106) Source(42, 21) + SourceIndex(0) +9 >Emitted(25, 108) Source(40, 5) + SourceIndex(0) +10>Emitted(25, 118) Source(40, 30) + SourceIndex(0) +11>Emitted(25, 120) Source(40, 5) + SourceIndex(0) +12>Emitted(25, 166) Source(40, 30) + SourceIndex(0) +13>Emitted(25, 168) Source(41, 5) + SourceIndex(0) +14>Emitted(25, 178) Source(41, 34) + SourceIndex(0) +15>Emitted(25, 180) Source(41, 5) + SourceIndex(0) +16>Emitted(25, 230) Source(41, 34) + SourceIndex(0) +17>Emitted(25, 232) Source(42, 62) + SourceIndex(0) +18>Emitted(25, 233) Source(42, 63) + SourceIndex(0) +19>Emitted(25, 236) Source(42, 66) + SourceIndex(0) +20>Emitted(25, 237) Source(42, 67) + SourceIndex(0) +21>Emitted(25, 239) Source(42, 69) + SourceIndex(0) +22>Emitted(25, 240) Source(42, 70) + SourceIndex(0) +23>Emitted(25, 243) Source(42, 73) + SourceIndex(0) +24>Emitted(25, 244) Source(42, 74) + SourceIndex(0) +25>Emitted(25, 246) Source(42, 76) + SourceIndex(0) +26>Emitted(25, 247) Source(42, 77) + SourceIndex(0) +27>Emitted(25, 249) Source(42, 79) + SourceIndex(0) +28>Emitted(25, 251) Source(42, 81) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -931,7 +856,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -950,81 +875,69 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(26, 32) Source(43, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(27, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(27, 2) Source(44, 2) + SourceIndex(0) + >} +1 >Emitted(27, 2) Source(44, 2) + SourceIndex(0) --- >>>for (var _v = robotA[0], numberB = _v === void 0 ? -1 : _v, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > > -2 >for -3 > -4 > (let [ -5 > -6 > numberB = -1 -7 > -8 > numberB = -1 -9 > ] = robotA, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [ +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > ] = robotA, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(28, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(28, 4) Source(46, 4) + SourceIndex(0) -3 >Emitted(28, 5) Source(46, 5) + SourceIndex(0) -4 >Emitted(28, 6) Source(46, 11) + SourceIndex(0) -5 >Emitted(28, 10) Source(46, 11) + SourceIndex(0) -6 >Emitted(28, 24) Source(46, 23) + SourceIndex(0) -7 >Emitted(28, 26) Source(46, 11) + SourceIndex(0) -8 >Emitted(28, 59) Source(46, 23) + SourceIndex(0) -9 >Emitted(28, 61) Source(46, 35) + SourceIndex(0) -10>Emitted(28, 62) Source(46, 36) + SourceIndex(0) -11>Emitted(28, 65) Source(46, 39) + SourceIndex(0) -12>Emitted(28, 66) Source(46, 40) + SourceIndex(0) -13>Emitted(28, 68) Source(46, 42) + SourceIndex(0) -14>Emitted(28, 69) Source(46, 43) + SourceIndex(0) -15>Emitted(28, 72) Source(46, 46) + SourceIndex(0) -16>Emitted(28, 73) Source(46, 47) + SourceIndex(0) -17>Emitted(28, 75) Source(46, 49) + SourceIndex(0) -18>Emitted(28, 76) Source(46, 50) + SourceIndex(0) -19>Emitted(28, 78) Source(46, 52) + SourceIndex(0) -20>Emitted(28, 80) Source(46, 54) + SourceIndex(0) -21>Emitted(28, 81) Source(46, 55) + SourceIndex(0) +2 >Emitted(28, 6) Source(46, 11) + SourceIndex(0) +3 >Emitted(28, 10) Source(46, 11) + SourceIndex(0) +4 >Emitted(28, 24) Source(46, 23) + SourceIndex(0) +5 >Emitted(28, 26) Source(46, 11) + SourceIndex(0) +6 >Emitted(28, 59) Source(46, 23) + SourceIndex(0) +7 >Emitted(28, 61) Source(46, 35) + SourceIndex(0) +8 >Emitted(28, 62) Source(46, 36) + SourceIndex(0) +9 >Emitted(28, 65) Source(46, 39) + SourceIndex(0) +10>Emitted(28, 66) Source(46, 40) + SourceIndex(0) +11>Emitted(28, 68) Source(46, 42) + SourceIndex(0) +12>Emitted(28, 69) Source(46, 43) + SourceIndex(0) +13>Emitted(28, 72) Source(46, 46) + SourceIndex(0) +14>Emitted(28, 73) Source(46, 47) + SourceIndex(0) +15>Emitted(28, 75) Source(46, 49) + SourceIndex(0) +16>Emitted(28, 76) Source(46, 50) + SourceIndex(0) +17>Emitted(28, 78) Source(46, 52) + SourceIndex(0) +18>Emitted(28, 80) Source(46, 54) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1035,7 +948,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1054,80 +967,68 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(29, 26) Source(47, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(30, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(30, 2) Source(48, 2) + SourceIndex(0) + >} +1 >Emitted(30, 2) Source(48, 2) + SourceIndex(0) --- >>>for (var _w = getRobot()[0], numberB = _w === void 0 ? -1 : _w, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > numberB = -1 -7 > -8 > numberB = -1 -9 > ] = getRobot(), -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [ +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > ] = getRobot(), +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(31, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(31, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(31, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(31, 6) Source(49, 11) + SourceIndex(0) -5 >Emitted(31, 10) Source(49, 11) + SourceIndex(0) -6 >Emitted(31, 28) Source(49, 23) + SourceIndex(0) -7 >Emitted(31, 30) Source(49, 11) + SourceIndex(0) -8 >Emitted(31, 63) Source(49, 23) + SourceIndex(0) -9 >Emitted(31, 65) Source(49, 39) + SourceIndex(0) -10>Emitted(31, 66) Source(49, 40) + SourceIndex(0) -11>Emitted(31, 69) Source(49, 43) + SourceIndex(0) -12>Emitted(31, 70) Source(49, 44) + SourceIndex(0) -13>Emitted(31, 72) Source(49, 46) + SourceIndex(0) -14>Emitted(31, 73) Source(49, 47) + SourceIndex(0) -15>Emitted(31, 76) Source(49, 50) + SourceIndex(0) -16>Emitted(31, 77) Source(49, 51) + SourceIndex(0) -17>Emitted(31, 79) Source(49, 53) + SourceIndex(0) -18>Emitted(31, 80) Source(49, 54) + SourceIndex(0) -19>Emitted(31, 82) Source(49, 56) + SourceIndex(0) -20>Emitted(31, 84) Source(49, 58) + SourceIndex(0) -21>Emitted(31, 85) Source(49, 59) + SourceIndex(0) +2 >Emitted(31, 6) Source(49, 11) + SourceIndex(0) +3 >Emitted(31, 10) Source(49, 11) + SourceIndex(0) +4 >Emitted(31, 28) Source(49, 23) + SourceIndex(0) +5 >Emitted(31, 30) Source(49, 11) + SourceIndex(0) +6 >Emitted(31, 63) Source(49, 23) + SourceIndex(0) +7 >Emitted(31, 65) Source(49, 39) + SourceIndex(0) +8 >Emitted(31, 66) Source(49, 40) + SourceIndex(0) +9 >Emitted(31, 69) Source(49, 43) + SourceIndex(0) +10>Emitted(31, 70) Source(49, 44) + SourceIndex(0) +11>Emitted(31, 72) Source(49, 46) + SourceIndex(0) +12>Emitted(31, 73) Source(49, 47) + SourceIndex(0) +13>Emitted(31, 76) Source(49, 50) + SourceIndex(0) +14>Emitted(31, 77) Source(49, 51) + SourceIndex(0) +15>Emitted(31, 79) Source(49, 53) + SourceIndex(0) +16>Emitted(31, 80) Source(49, 54) + SourceIndex(0) +17>Emitted(31, 82) Source(49, 56) + SourceIndex(0) +18>Emitted(31, 84) Source(49, 58) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1138,7 +1039,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1157,80 +1058,68 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(32, 26) Source(50, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(33, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(33, 2) Source(51, 2) + SourceIndex(0) + >} +1 >Emitted(33, 2) Source(51, 2) + SourceIndex(0) --- >>>for (var _x = [2, "trimmer", "trimming"][0], numberB = _x === void 0 ? -1 : _x, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > numberB = -1 -7 > -8 > numberB = -1 -9 > ] = [2, "trimmer", "trimming"], -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [ +3 > +4 > numberB = -1 +5 > +6 > numberB = -1 +7 > ] = [2, "trimmer", "trimming"], +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(34, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(34, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(34, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(34, 6) Source(52, 11) + SourceIndex(0) -5 >Emitted(34, 10) Source(52, 11) + SourceIndex(0) -6 >Emitted(34, 44) Source(52, 23) + SourceIndex(0) -7 >Emitted(34, 46) Source(52, 11) + SourceIndex(0) -8 >Emitted(34, 79) Source(52, 23) + SourceIndex(0) -9 >Emitted(34, 81) Source(52, 55) + SourceIndex(0) -10>Emitted(34, 82) Source(52, 56) + SourceIndex(0) -11>Emitted(34, 85) Source(52, 59) + SourceIndex(0) -12>Emitted(34, 86) Source(52, 60) + SourceIndex(0) -13>Emitted(34, 88) Source(52, 62) + SourceIndex(0) -14>Emitted(34, 89) Source(52, 63) + SourceIndex(0) -15>Emitted(34, 92) Source(52, 66) + SourceIndex(0) -16>Emitted(34, 93) Source(52, 67) + SourceIndex(0) -17>Emitted(34, 95) Source(52, 69) + SourceIndex(0) -18>Emitted(34, 96) Source(52, 70) + SourceIndex(0) -19>Emitted(34, 98) Source(52, 72) + SourceIndex(0) -20>Emitted(34, 100) Source(52, 74) + SourceIndex(0) -21>Emitted(34, 101) Source(52, 75) + SourceIndex(0) +2 >Emitted(34, 6) Source(52, 11) + SourceIndex(0) +3 >Emitted(34, 10) Source(52, 11) + SourceIndex(0) +4 >Emitted(34, 44) Source(52, 23) + SourceIndex(0) +5 >Emitted(34, 46) Source(52, 11) + SourceIndex(0) +6 >Emitted(34, 79) Source(52, 23) + SourceIndex(0) +7 >Emitted(34, 81) Source(52, 55) + SourceIndex(0) +8 >Emitted(34, 82) Source(52, 56) + SourceIndex(0) +9 >Emitted(34, 85) Source(52, 59) + SourceIndex(0) +10>Emitted(34, 86) Source(52, 60) + SourceIndex(0) +11>Emitted(34, 88) Source(52, 62) + SourceIndex(0) +12>Emitted(34, 89) Source(52, 63) + SourceIndex(0) +13>Emitted(34, 92) Source(52, 66) + SourceIndex(0) +14>Emitted(34, 93) Source(52, 67) + SourceIndex(0) +15>Emitted(34, 95) Source(52, 69) + SourceIndex(0) +16>Emitted(34, 96) Source(52, 70) + SourceIndex(0) +17>Emitted(34, 98) Source(52, 72) + SourceIndex(0) +18>Emitted(34, 100) Source(52, 74) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1241,7 +1130,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1260,80 +1149,68 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(35, 26) Source(53, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(36, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(36, 2) Source(54, 2) + SourceIndex(0) + >} +1 >Emitted(36, 2) Source(54, 2) + SourceIndex(0) --- >>>for (var _y = multiRobotA[0], nameB = _y === void 0 ? "name" : _y, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > nameB = "name" -7 > -8 > nameB = "name" -9 > ] = multiRobotA, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [ +3 > +4 > nameB = "name" +5 > +6 > nameB = "name" +7 > ] = multiRobotA, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(37, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(55, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(55, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(55, 11) + SourceIndex(0) -5 >Emitted(37, 10) Source(55, 11) + SourceIndex(0) -6 >Emitted(37, 29) Source(55, 25) + SourceIndex(0) -7 >Emitted(37, 31) Source(55, 11) + SourceIndex(0) -8 >Emitted(37, 66) Source(55, 25) + SourceIndex(0) -9 >Emitted(37, 68) Source(55, 42) + SourceIndex(0) -10>Emitted(37, 69) Source(55, 43) + SourceIndex(0) -11>Emitted(37, 72) Source(55, 46) + SourceIndex(0) -12>Emitted(37, 73) Source(55, 47) + SourceIndex(0) -13>Emitted(37, 75) Source(55, 49) + SourceIndex(0) -14>Emitted(37, 76) Source(55, 50) + SourceIndex(0) -15>Emitted(37, 79) Source(55, 53) + SourceIndex(0) -16>Emitted(37, 80) Source(55, 54) + SourceIndex(0) -17>Emitted(37, 82) Source(55, 56) + SourceIndex(0) -18>Emitted(37, 83) Source(55, 57) + SourceIndex(0) -19>Emitted(37, 85) Source(55, 59) + SourceIndex(0) -20>Emitted(37, 87) Source(55, 61) + SourceIndex(0) -21>Emitted(37, 88) Source(55, 62) + SourceIndex(0) +2 >Emitted(37, 6) Source(55, 11) + SourceIndex(0) +3 >Emitted(37, 10) Source(55, 11) + SourceIndex(0) +4 >Emitted(37, 29) Source(55, 25) + SourceIndex(0) +5 >Emitted(37, 31) Source(55, 11) + SourceIndex(0) +6 >Emitted(37, 66) Source(55, 25) + SourceIndex(0) +7 >Emitted(37, 68) Source(55, 42) + SourceIndex(0) +8 >Emitted(37, 69) Source(55, 43) + SourceIndex(0) +9 >Emitted(37, 72) Source(55, 46) + SourceIndex(0) +10>Emitted(37, 73) Source(55, 47) + SourceIndex(0) +11>Emitted(37, 75) Source(55, 49) + SourceIndex(0) +12>Emitted(37, 76) Source(55, 50) + SourceIndex(0) +13>Emitted(37, 79) Source(55, 53) + SourceIndex(0) +14>Emitted(37, 80) Source(55, 54) + SourceIndex(0) +15>Emitted(37, 82) Source(55, 56) + SourceIndex(0) +16>Emitted(37, 83) Source(55, 57) + SourceIndex(0) +17>Emitted(37, 85) Source(55, 59) + SourceIndex(0) +18>Emitted(37, 87) Source(55, 61) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1344,7 +1221,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1363,80 +1240,68 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(38, 24) Source(56, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(39, 1) Source(57, 1) + SourceIndex(0) -2 >Emitted(39, 2) Source(57, 2) + SourceIndex(0) + >} +1 >Emitted(39, 2) Source(57, 2) + SourceIndex(0) --- >>>for (var _z = getMultiRobot()[0], nameB = _z === void 0 ? "name" : _z, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > nameB = "name" -7 > -8 > nameB = "name" -9 > ] = getMultiRobot(), -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [ +3 > +4 > nameB = "name" +5 > +6 > nameB = "name" +7 > ] = getMultiRobot(), +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(40, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(40, 4) Source(58, 4) + SourceIndex(0) -3 >Emitted(40, 5) Source(58, 5) + SourceIndex(0) -4 >Emitted(40, 6) Source(58, 11) + SourceIndex(0) -5 >Emitted(40, 10) Source(58, 11) + SourceIndex(0) -6 >Emitted(40, 33) Source(58, 25) + SourceIndex(0) -7 >Emitted(40, 35) Source(58, 11) + SourceIndex(0) -8 >Emitted(40, 70) Source(58, 25) + SourceIndex(0) -9 >Emitted(40, 72) Source(58, 46) + SourceIndex(0) -10>Emitted(40, 73) Source(58, 47) + SourceIndex(0) -11>Emitted(40, 76) Source(58, 50) + SourceIndex(0) -12>Emitted(40, 77) Source(58, 51) + SourceIndex(0) -13>Emitted(40, 79) Source(58, 53) + SourceIndex(0) -14>Emitted(40, 80) Source(58, 54) + SourceIndex(0) -15>Emitted(40, 83) Source(58, 57) + SourceIndex(0) -16>Emitted(40, 84) Source(58, 58) + SourceIndex(0) -17>Emitted(40, 86) Source(58, 60) + SourceIndex(0) -18>Emitted(40, 87) Source(58, 61) + SourceIndex(0) -19>Emitted(40, 89) Source(58, 63) + SourceIndex(0) -20>Emitted(40, 91) Source(58, 65) + SourceIndex(0) -21>Emitted(40, 92) Source(58, 66) + SourceIndex(0) +2 >Emitted(40, 6) Source(58, 11) + SourceIndex(0) +3 >Emitted(40, 10) Source(58, 11) + SourceIndex(0) +4 >Emitted(40, 33) Source(58, 25) + SourceIndex(0) +5 >Emitted(40, 35) Source(58, 11) + SourceIndex(0) +6 >Emitted(40, 70) Source(58, 25) + SourceIndex(0) +7 >Emitted(40, 72) Source(58, 46) + SourceIndex(0) +8 >Emitted(40, 73) Source(58, 47) + SourceIndex(0) +9 >Emitted(40, 76) Source(58, 50) + SourceIndex(0) +10>Emitted(40, 77) Source(58, 51) + SourceIndex(0) +11>Emitted(40, 79) Source(58, 53) + SourceIndex(0) +12>Emitted(40, 80) Source(58, 54) + SourceIndex(0) +13>Emitted(40, 83) Source(58, 57) + SourceIndex(0) +14>Emitted(40, 84) Source(58, 58) + SourceIndex(0) +15>Emitted(40, 86) Source(58, 60) + SourceIndex(0) +16>Emitted(40, 87) Source(58, 61) + SourceIndex(0) +17>Emitted(40, 89) Source(58, 63) + SourceIndex(0) +18>Emitted(40, 91) Source(58, 65) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1447,7 +1312,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1466,80 +1331,68 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(41, 24) Source(59, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(42, 1) Source(60, 1) + SourceIndex(0) -2 >Emitted(42, 2) Source(60, 2) + SourceIndex(0) + >} +1 >Emitted(42, 2) Source(60, 2) + SourceIndex(0) --- >>>for (var _0 = ["trimmer", ["trimming", "edging"]][0], nameB = _0 === void 0 ? "name" : _0, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let [ -5 > -6 > nameB = "name" -7 > -8 > nameB = "name" -9 > ] = ["trimmer", ["trimming", "edging"]], -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let [ +3 > +4 > nameB = "name" +5 > +6 > nameB = "name" +7 > ] = ["trimmer", ["trimming", "edging"]], +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(43, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(43, 4) Source(61, 4) + SourceIndex(0) -3 >Emitted(43, 5) Source(61, 5) + SourceIndex(0) -4 >Emitted(43, 6) Source(61, 11) + SourceIndex(0) -5 >Emitted(43, 10) Source(61, 11) + SourceIndex(0) -6 >Emitted(43, 53) Source(61, 25) + SourceIndex(0) -7 >Emitted(43, 55) Source(61, 11) + SourceIndex(0) -8 >Emitted(43, 90) Source(61, 25) + SourceIndex(0) -9 >Emitted(43, 92) Source(61, 66) + SourceIndex(0) -10>Emitted(43, 93) Source(61, 67) + SourceIndex(0) -11>Emitted(43, 96) Source(61, 70) + SourceIndex(0) -12>Emitted(43, 97) Source(61, 71) + SourceIndex(0) -13>Emitted(43, 99) Source(61, 73) + SourceIndex(0) -14>Emitted(43, 100) Source(61, 74) + SourceIndex(0) -15>Emitted(43, 103) Source(61, 77) + SourceIndex(0) -16>Emitted(43, 104) Source(61, 78) + SourceIndex(0) -17>Emitted(43, 106) Source(61, 80) + SourceIndex(0) -18>Emitted(43, 107) Source(61, 81) + SourceIndex(0) -19>Emitted(43, 109) Source(61, 83) + SourceIndex(0) -20>Emitted(43, 111) Source(61, 85) + SourceIndex(0) -21>Emitted(43, 112) Source(61, 86) + SourceIndex(0) +2 >Emitted(43, 6) Source(61, 11) + SourceIndex(0) +3 >Emitted(43, 10) Source(61, 11) + SourceIndex(0) +4 >Emitted(43, 53) Source(61, 25) + SourceIndex(0) +5 >Emitted(43, 55) Source(61, 11) + SourceIndex(0) +6 >Emitted(43, 90) Source(61, 25) + SourceIndex(0) +7 >Emitted(43, 92) Source(61, 66) + SourceIndex(0) +8 >Emitted(43, 93) Source(61, 67) + SourceIndex(0) +9 >Emitted(43, 96) Source(61, 70) + SourceIndex(0) +10>Emitted(43, 97) Source(61, 71) + SourceIndex(0) +11>Emitted(43, 99) Source(61, 73) + SourceIndex(0) +12>Emitted(43, 100) Source(61, 74) + SourceIndex(0) +13>Emitted(43, 103) Source(61, 77) + SourceIndex(0) +14>Emitted(43, 104) Source(61, 78) + SourceIndex(0) +15>Emitted(43, 106) Source(61, 80) + SourceIndex(0) +16>Emitted(43, 107) Source(61, 81) + SourceIndex(0) +17>Emitted(43, 109) Source(61, 83) + SourceIndex(0) +18>Emitted(43, 111) Source(61, 85) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1550,7 +1403,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1569,105 +1422,93 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(44, 24) Source(62, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(45, 1) Source(63, 1) + SourceIndex(0) -2 >Emitted(45, 2) Source(63, 2) + SourceIndex(0) + >} +1 >Emitted(45, 2) Source(63, 2) + SourceIndex(0) --- >>>for (var _1 = robotA[0], numberA2 = _1 === void 0 ? -1 : _1, _2 = robotA[1], nameA2 = _2 === void 0 ? "name" : _2, _3 = robotA[2], skillA2 = _3 === void 0 ? "skill" : _3, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^ -28> ^^ -29> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ 1-> > > -2 >for -3 > -4 > (let [ -5 > -6 > numberA2 = -1 -7 > -8 > numberA2 = -1 -9 > , -10> nameA2 = "name" -11> -12> nameA2 = "name" -13> , -14> skillA2 = "skill" -15> -16> skillA2 = "skill" -17> ] = robotA, -18> i -19> = -20> 0 -21> ; -22> i -23> < -24> 1 -25> ; -26> i -27> ++ -28> ) -29> { +2 >for (let [ +3 > +4 > numberA2 = -1 +5 > +6 > numberA2 = -1 +7 > , +8 > nameA2 = "name" +9 > +10> nameA2 = "name" +11> , +12> skillA2 = "skill" +13> +14> skillA2 = "skill" +15> ] = robotA, +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) 1->Emitted(46, 1) Source(65, 1) + SourceIndex(0) -2 >Emitted(46, 4) Source(65, 4) + SourceIndex(0) -3 >Emitted(46, 5) Source(65, 5) + SourceIndex(0) -4 >Emitted(46, 6) Source(65, 11) + SourceIndex(0) -5 >Emitted(46, 10) Source(65, 11) + SourceIndex(0) -6 >Emitted(46, 24) Source(65, 24) + SourceIndex(0) -7 >Emitted(46, 26) Source(65, 11) + SourceIndex(0) -8 >Emitted(46, 60) Source(65, 24) + SourceIndex(0) -9 >Emitted(46, 62) Source(65, 26) + SourceIndex(0) -10>Emitted(46, 76) Source(65, 41) + SourceIndex(0) -11>Emitted(46, 78) Source(65, 26) + SourceIndex(0) -12>Emitted(46, 114) Source(65, 41) + SourceIndex(0) -13>Emitted(46, 116) Source(65, 43) + SourceIndex(0) -14>Emitted(46, 130) Source(65, 60) + SourceIndex(0) -15>Emitted(46, 132) Source(65, 43) + SourceIndex(0) -16>Emitted(46, 170) Source(65, 60) + SourceIndex(0) -17>Emitted(46, 172) Source(65, 72) + SourceIndex(0) -18>Emitted(46, 173) Source(65, 73) + SourceIndex(0) -19>Emitted(46, 176) Source(65, 76) + SourceIndex(0) -20>Emitted(46, 177) Source(65, 77) + SourceIndex(0) -21>Emitted(46, 179) Source(65, 79) + SourceIndex(0) -22>Emitted(46, 180) Source(65, 80) + SourceIndex(0) -23>Emitted(46, 183) Source(65, 83) + SourceIndex(0) -24>Emitted(46, 184) Source(65, 84) + SourceIndex(0) -25>Emitted(46, 186) Source(65, 86) + SourceIndex(0) -26>Emitted(46, 187) Source(65, 87) + SourceIndex(0) -27>Emitted(46, 189) Source(65, 89) + SourceIndex(0) -28>Emitted(46, 191) Source(65, 91) + SourceIndex(0) -29>Emitted(46, 192) Source(65, 92) + SourceIndex(0) +2 >Emitted(46, 6) Source(65, 11) + SourceIndex(0) +3 >Emitted(46, 10) Source(65, 11) + SourceIndex(0) +4 >Emitted(46, 24) Source(65, 24) + SourceIndex(0) +5 >Emitted(46, 26) Source(65, 11) + SourceIndex(0) +6 >Emitted(46, 60) Source(65, 24) + SourceIndex(0) +7 >Emitted(46, 62) Source(65, 26) + SourceIndex(0) +8 >Emitted(46, 76) Source(65, 41) + SourceIndex(0) +9 >Emitted(46, 78) Source(65, 26) + SourceIndex(0) +10>Emitted(46, 114) Source(65, 41) + SourceIndex(0) +11>Emitted(46, 116) Source(65, 43) + SourceIndex(0) +12>Emitted(46, 130) Source(65, 60) + SourceIndex(0) +13>Emitted(46, 132) Source(65, 43) + SourceIndex(0) +14>Emitted(46, 170) Source(65, 60) + SourceIndex(0) +15>Emitted(46, 172) Source(65, 72) + SourceIndex(0) +16>Emitted(46, 173) Source(65, 73) + SourceIndex(0) +17>Emitted(46, 176) Source(65, 76) + SourceIndex(0) +18>Emitted(46, 177) Source(65, 77) + SourceIndex(0) +19>Emitted(46, 179) Source(65, 79) + SourceIndex(0) +20>Emitted(46, 180) Source(65, 80) + SourceIndex(0) +21>Emitted(46, 183) Source(65, 83) + SourceIndex(0) +22>Emitted(46, 184) Source(65, 84) + SourceIndex(0) +23>Emitted(46, 186) Source(65, 86) + SourceIndex(0) +24>Emitted(46, 187) Source(65, 87) + SourceIndex(0) +25>Emitted(46, 189) Source(65, 89) + SourceIndex(0) +26>Emitted(46, 191) Source(65, 91) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1678,7 +1519,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1697,110 +1538,98 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(47, 25) Source(66, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(48, 1) Source(67, 1) + SourceIndex(0) -2 >Emitted(48, 2) Source(67, 2) + SourceIndex(0) + >} +1 >Emitted(48, 2) Source(67, 2) + SourceIndex(0) --- >>>for (var _4 = getRobot(), _5 = _4[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = _4[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = _4[2], skillA2 = _7 === void 0 ? "skill" : _7, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^ -30> ^^ -31> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^ +28> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() -7 > -8 > numberA2 = -1 -9 > -10> numberA2 = -1 -11> , -12> nameA2 = "name" -13> -14> nameA2 = "name" -15> , -16> skillA2 = "skill" -17> -18> skillA2 = "skill" -19> ] = getRobot(), -20> i -21> = -22> 0 -23> ; -24> i -25> < -26> 1 -27> ; -28> i -29> ++ -30> ) -31> { +2 >for (let +3 > +4 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() +5 > +6 > numberA2 = -1 +7 > +8 > numberA2 = -1 +9 > , +10> nameA2 = "name" +11> +12> nameA2 = "name" +13> , +14> skillA2 = "skill" +15> +16> skillA2 = "skill" +17> ] = getRobot(), +18> i +19> = +20> 0 +21> ; +22> i +23> < +24> 1 +25> ; +26> i +27> ++ +28> ) 1->Emitted(49, 1) Source(68, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(68, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(68, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(68, 10) + SourceIndex(0) -5 >Emitted(49, 10) Source(68, 10) + SourceIndex(0) -6 >Emitted(49, 25) Source(68, 74) + SourceIndex(0) -7 >Emitted(49, 27) Source(68, 11) + SourceIndex(0) -8 >Emitted(49, 37) Source(68, 24) + SourceIndex(0) -9 >Emitted(49, 39) Source(68, 11) + SourceIndex(0) -10>Emitted(49, 73) Source(68, 24) + SourceIndex(0) -11>Emitted(49, 75) Source(68, 26) + SourceIndex(0) -12>Emitted(49, 85) Source(68, 41) + SourceIndex(0) -13>Emitted(49, 87) Source(68, 26) + SourceIndex(0) -14>Emitted(49, 123) Source(68, 41) + SourceIndex(0) -15>Emitted(49, 125) Source(68, 43) + SourceIndex(0) -16>Emitted(49, 135) Source(68, 60) + SourceIndex(0) -17>Emitted(49, 137) Source(68, 43) + SourceIndex(0) -18>Emitted(49, 175) Source(68, 60) + SourceIndex(0) -19>Emitted(49, 177) Source(68, 76) + SourceIndex(0) -20>Emitted(49, 178) Source(68, 77) + SourceIndex(0) -21>Emitted(49, 181) Source(68, 80) + SourceIndex(0) -22>Emitted(49, 182) Source(68, 81) + SourceIndex(0) -23>Emitted(49, 184) Source(68, 83) + SourceIndex(0) -24>Emitted(49, 185) Source(68, 84) + SourceIndex(0) -25>Emitted(49, 188) Source(68, 87) + SourceIndex(0) -26>Emitted(49, 189) Source(68, 88) + SourceIndex(0) -27>Emitted(49, 191) Source(68, 90) + SourceIndex(0) -28>Emitted(49, 192) Source(68, 91) + SourceIndex(0) -29>Emitted(49, 194) Source(68, 93) + SourceIndex(0) -30>Emitted(49, 196) Source(68, 95) + SourceIndex(0) -31>Emitted(49, 197) Source(68, 96) + SourceIndex(0) +2 >Emitted(49, 6) Source(68, 10) + SourceIndex(0) +3 >Emitted(49, 10) Source(68, 10) + SourceIndex(0) +4 >Emitted(49, 25) Source(68, 74) + SourceIndex(0) +5 >Emitted(49, 27) Source(68, 11) + SourceIndex(0) +6 >Emitted(49, 37) Source(68, 24) + SourceIndex(0) +7 >Emitted(49, 39) Source(68, 11) + SourceIndex(0) +8 >Emitted(49, 73) Source(68, 24) + SourceIndex(0) +9 >Emitted(49, 75) Source(68, 26) + SourceIndex(0) +10>Emitted(49, 85) Source(68, 41) + SourceIndex(0) +11>Emitted(49, 87) Source(68, 26) + SourceIndex(0) +12>Emitted(49, 123) Source(68, 41) + SourceIndex(0) +13>Emitted(49, 125) Source(68, 43) + SourceIndex(0) +14>Emitted(49, 135) Source(68, 60) + SourceIndex(0) +15>Emitted(49, 137) Source(68, 43) + SourceIndex(0) +16>Emitted(49, 175) Source(68, 60) + SourceIndex(0) +17>Emitted(49, 177) Source(68, 76) + SourceIndex(0) +18>Emitted(49, 178) Source(68, 77) + SourceIndex(0) +19>Emitted(49, 181) Source(68, 80) + SourceIndex(0) +20>Emitted(49, 182) Source(68, 81) + SourceIndex(0) +21>Emitted(49, 184) Source(68, 83) + SourceIndex(0) +22>Emitted(49, 185) Source(68, 84) + SourceIndex(0) +23>Emitted(49, 188) Source(68, 87) + SourceIndex(0) +24>Emitted(49, 189) Source(68, 88) + SourceIndex(0) +25>Emitted(49, 191) Source(68, 90) + SourceIndex(0) +26>Emitted(49, 192) Source(68, 91) + SourceIndex(0) +27>Emitted(49, 194) Source(68, 93) + SourceIndex(0) +28>Emitted(49, 196) Source(68, 95) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1811,7 +1640,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1830,110 +1659,98 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(50, 25) Source(69, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(51, 1) Source(70, 1) + SourceIndex(0) -2 >Emitted(51, 2) Source(70, 2) + SourceIndex(0) + >} +1 >Emitted(51, 2) Source(70, 2) + SourceIndex(0) --- >>>for (var _8 = [2, "trimmer", "trimming"], _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^ -30> ^^ -31> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^ +28> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] -7 > -8 > numberA2 = -1 -9 > -10> numberA2 = -1 -11> , -12> nameA2 = "name" -13> -14> nameA2 = "name" -15> , -16> skillA2 = "skill" -17> -18> skillA2 = "skill" -19> ] = [2, "trimmer", "trimming"], -20> i -21> = -22> 0 -23> ; -24> i -25> < -26> 1 -27> ; -28> i -29> ++ -30> ) -31> { +2 >for (let +3 > +4 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] +5 > +6 > numberA2 = -1 +7 > +8 > numberA2 = -1 +9 > , +10> nameA2 = "name" +11> +12> nameA2 = "name" +13> , +14> skillA2 = "skill" +15> +16> skillA2 = "skill" +17> ] = [2, "trimmer", "trimming"], +18> i +19> = +20> 0 +21> ; +22> i +23> < +24> 1 +25> ; +26> i +27> ++ +28> ) 1->Emitted(52, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(52, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(52, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(52, 6) Source(71, 10) + SourceIndex(0) -5 >Emitted(52, 10) Source(71, 10) + SourceIndex(0) -6 >Emitted(52, 41) Source(71, 90) + SourceIndex(0) -7 >Emitted(52, 43) Source(71, 11) + SourceIndex(0) -8 >Emitted(52, 53) Source(71, 24) + SourceIndex(0) -9 >Emitted(52, 55) Source(71, 11) + SourceIndex(0) -10>Emitted(52, 89) Source(71, 24) + SourceIndex(0) -11>Emitted(52, 91) Source(71, 26) + SourceIndex(0) -12>Emitted(52, 102) Source(71, 41) + SourceIndex(0) -13>Emitted(52, 104) Source(71, 26) + SourceIndex(0) -14>Emitted(52, 142) Source(71, 41) + SourceIndex(0) -15>Emitted(52, 144) Source(71, 43) + SourceIndex(0) -16>Emitted(52, 155) Source(71, 60) + SourceIndex(0) -17>Emitted(52, 157) Source(71, 43) + SourceIndex(0) -18>Emitted(52, 197) Source(71, 60) + SourceIndex(0) -19>Emitted(52, 199) Source(71, 92) + SourceIndex(0) -20>Emitted(52, 200) Source(71, 93) + SourceIndex(0) -21>Emitted(52, 203) Source(71, 96) + SourceIndex(0) -22>Emitted(52, 204) Source(71, 97) + SourceIndex(0) -23>Emitted(52, 206) Source(71, 99) + SourceIndex(0) -24>Emitted(52, 207) Source(71, 100) + SourceIndex(0) -25>Emitted(52, 210) Source(71, 103) + SourceIndex(0) -26>Emitted(52, 211) Source(71, 104) + SourceIndex(0) -27>Emitted(52, 213) Source(71, 106) + SourceIndex(0) -28>Emitted(52, 214) Source(71, 107) + SourceIndex(0) -29>Emitted(52, 216) Source(71, 109) + SourceIndex(0) -30>Emitted(52, 218) Source(71, 111) + SourceIndex(0) -31>Emitted(52, 219) Source(71, 112) + SourceIndex(0) +2 >Emitted(52, 6) Source(71, 10) + SourceIndex(0) +3 >Emitted(52, 10) Source(71, 10) + SourceIndex(0) +4 >Emitted(52, 41) Source(71, 90) + SourceIndex(0) +5 >Emitted(52, 43) Source(71, 11) + SourceIndex(0) +6 >Emitted(52, 53) Source(71, 24) + SourceIndex(0) +7 >Emitted(52, 55) Source(71, 11) + SourceIndex(0) +8 >Emitted(52, 89) Source(71, 24) + SourceIndex(0) +9 >Emitted(52, 91) Source(71, 26) + SourceIndex(0) +10>Emitted(52, 102) Source(71, 41) + SourceIndex(0) +11>Emitted(52, 104) Source(71, 26) + SourceIndex(0) +12>Emitted(52, 142) Source(71, 41) + SourceIndex(0) +13>Emitted(52, 144) Source(71, 43) + SourceIndex(0) +14>Emitted(52, 155) Source(71, 60) + SourceIndex(0) +15>Emitted(52, 157) Source(71, 43) + SourceIndex(0) +16>Emitted(52, 197) Source(71, 60) + SourceIndex(0) +17>Emitted(52, 199) Source(71, 92) + SourceIndex(0) +18>Emitted(52, 200) Source(71, 93) + SourceIndex(0) +19>Emitted(52, 203) Source(71, 96) + SourceIndex(0) +20>Emitted(52, 204) Source(71, 97) + SourceIndex(0) +21>Emitted(52, 206) Source(71, 99) + SourceIndex(0) +22>Emitted(52, 207) Source(71, 100) + SourceIndex(0) +23>Emitted(52, 210) Source(71, 103) + SourceIndex(0) +24>Emitted(52, 211) Source(71, 104) + SourceIndex(0) +25>Emitted(52, 213) Source(71, 106) + SourceIndex(0) +26>Emitted(52, 214) Source(71, 107) + SourceIndex(0) +27>Emitted(52, 216) Source(71, 109) + SourceIndex(0) +28>Emitted(52, 218) Source(71, 111) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1944,7 +1761,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1963,127 +1780,115 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(53, 25) Source(72, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(54, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(54, 2) Source(73, 2) + SourceIndex(0) + >} +1 >Emitted(54, 2) Source(73, 2) + SourceIndex(0) --- >>>for (var _12 = multiRobotA[0], nameMA = _12 === void 0 ? "noName" : _12, _13 = multiRobotA[1], _14 = _13 === void 0 ? ["none", "none"] : _13, _15 = _14[0], primarySkillA = _15 === void 0 ? "primary" : _15, _16 = _14[1], secondarySkillA = _16 === void 0 ? "secondary" : _16, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^ -19> ^^ -20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^^ -28> ^ -29> ^^ -30> ^ -31> ^^ -32> ^^ -33> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ 1-> > -2 >for -3 > -4 > (let - > [ -5 > -6 > nameMA = "noName" -7 > -8 > nameMA = "noName" -9 > , +2 >for (let + > [ +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , > -10> [ +8 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -11> -12> [ +9 > +10> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -13> -14> primarySkillA = "primary" -15> -16> primarySkillA = "primary" -17> , +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , > -18> secondarySkillA = "secondary" -19> -20> secondarySkillA = "secondary" -21> +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> > ] = ["none", "none"] > ] = multiRobotA, -22> i -23> = -24> 0 -25> ; -26> i -27> < -28> 1 -29> ; -30> i -31> ++ -32> ) -33> { +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) 1->Emitted(55, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(55, 4) Source(74, 4) + SourceIndex(0) -3 >Emitted(55, 5) Source(74, 5) + SourceIndex(0) -4 >Emitted(55, 6) Source(75, 6) + SourceIndex(0) -5 >Emitted(55, 10) Source(75, 6) + SourceIndex(0) -6 >Emitted(55, 30) Source(75, 23) + SourceIndex(0) -7 >Emitted(55, 32) Source(75, 6) + SourceIndex(0) -8 >Emitted(55, 72) Source(75, 23) + SourceIndex(0) -9 >Emitted(55, 74) Source(76, 9) + SourceIndex(0) -10>Emitted(55, 94) Source(79, 29) + SourceIndex(0) -11>Emitted(55, 96) Source(76, 9) + SourceIndex(0) -12>Emitted(55, 141) Source(79, 29) + SourceIndex(0) -13>Emitted(55, 143) Source(77, 13) + SourceIndex(0) -14>Emitted(55, 155) Source(77, 38) + SourceIndex(0) -15>Emitted(55, 157) Source(77, 13) + SourceIndex(0) -16>Emitted(55, 205) Source(77, 38) + SourceIndex(0) -17>Emitted(55, 207) Source(78, 13) + SourceIndex(0) -18>Emitted(55, 219) Source(78, 42) + SourceIndex(0) -19>Emitted(55, 221) Source(78, 13) + SourceIndex(0) -20>Emitted(55, 273) Source(78, 42) + SourceIndex(0) -21>Emitted(55, 275) Source(80, 22) + SourceIndex(0) -22>Emitted(55, 276) Source(80, 23) + SourceIndex(0) -23>Emitted(55, 279) Source(80, 26) + SourceIndex(0) -24>Emitted(55, 280) Source(80, 27) + SourceIndex(0) -25>Emitted(55, 282) Source(80, 29) + SourceIndex(0) -26>Emitted(55, 283) Source(80, 30) + SourceIndex(0) -27>Emitted(55, 286) Source(80, 33) + SourceIndex(0) -28>Emitted(55, 287) Source(80, 34) + SourceIndex(0) -29>Emitted(55, 289) Source(80, 36) + SourceIndex(0) -30>Emitted(55, 290) Source(80, 37) + SourceIndex(0) -31>Emitted(55, 292) Source(80, 39) + SourceIndex(0) -32>Emitted(55, 294) Source(80, 41) + SourceIndex(0) -33>Emitted(55, 295) Source(80, 42) + SourceIndex(0) +2 >Emitted(55, 6) Source(75, 6) + SourceIndex(0) +3 >Emitted(55, 10) Source(75, 6) + SourceIndex(0) +4 >Emitted(55, 30) Source(75, 23) + SourceIndex(0) +5 >Emitted(55, 32) Source(75, 6) + SourceIndex(0) +6 >Emitted(55, 72) Source(75, 23) + SourceIndex(0) +7 >Emitted(55, 74) Source(76, 9) + SourceIndex(0) +8 >Emitted(55, 94) Source(79, 29) + SourceIndex(0) +9 >Emitted(55, 96) Source(76, 9) + SourceIndex(0) +10>Emitted(55, 141) Source(79, 29) + SourceIndex(0) +11>Emitted(55, 143) Source(77, 13) + SourceIndex(0) +12>Emitted(55, 155) Source(77, 38) + SourceIndex(0) +13>Emitted(55, 157) Source(77, 13) + SourceIndex(0) +14>Emitted(55, 205) Source(77, 38) + SourceIndex(0) +15>Emitted(55, 207) Source(78, 13) + SourceIndex(0) +16>Emitted(55, 219) Source(78, 42) + SourceIndex(0) +17>Emitted(55, 221) Source(78, 13) + SourceIndex(0) +18>Emitted(55, 273) Source(78, 42) + SourceIndex(0) +19>Emitted(55, 275) Source(80, 22) + SourceIndex(0) +20>Emitted(55, 276) Source(80, 23) + SourceIndex(0) +21>Emitted(55, 279) Source(80, 26) + SourceIndex(0) +22>Emitted(55, 280) Source(80, 27) + SourceIndex(0) +23>Emitted(55, 282) Source(80, 29) + SourceIndex(0) +24>Emitted(55, 283) Source(80, 30) + SourceIndex(0) +25>Emitted(55, 286) Source(80, 33) + SourceIndex(0) +26>Emitted(55, 287) Source(80, 34) + SourceIndex(0) +27>Emitted(55, 289) Source(80, 36) + SourceIndex(0) +28>Emitted(55, 290) Source(80, 37) + SourceIndex(0) +29>Emitted(55, 292) Source(80, 39) + SourceIndex(0) +30>Emitted(55, 294) Source(80, 41) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2094,7 +1899,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2113,137 +1918,125 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(56, 25) Source(81, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(57, 1) Source(82, 1) + SourceIndex(0) -2 >Emitted(57, 2) Source(82, 2) + SourceIndex(0) + >} +1 >Emitted(57, 2) Source(82, 2) + SourceIndex(0) --- >>>for (var _17 = getMultiRobot(), _18 = _17[0], nameMA = _18 === void 0 ? "noName" : _18, _19 = _17[1], _20 = _19 === void 0 ? ["none", "none"] : _19, _21 = _20[0], primarySkillA = _21 === void 0 ? "primary" : _21, _22 = _20[1], secondarySkillA = _22 === void 0 ? "secondary" : _22, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^^^^^^^^^^^^ -21> ^^ -22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^^ -30> ^ -31> ^^ -32> ^ -33> ^^ -34> ^^ -35> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^^ +28> ^ +29> ^^ +30> ^ +31> ^^ +32> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [nameMA = "noName", +2 >for (let +3 > +4 > [nameMA = "noName", > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] > ] = getMultiRobot() -7 > -8 > nameMA = "noName" -9 > -10> nameMA = "noName" -11> , +5 > +6 > nameMA = "noName" +7 > +8 > nameMA = "noName" +9 > , > -12> [ +10> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -13> -14> [ +11> +12> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -15> -16> primarySkillA = "primary" -17> -18> primarySkillA = "primary" -19> , +13> +14> primarySkillA = "primary" +15> +16> primarySkillA = "primary" +17> , > -20> secondarySkillA = "secondary" -21> -22> secondarySkillA = "secondary" -23> +18> secondarySkillA = "secondary" +19> +20> secondarySkillA = "secondary" +21> > ] = ["none", "none"] > ] = getMultiRobot(), -24> i -25> = -26> 0 -27> ; -28> i -29> < -30> 1 -31> ; -32> i -33> ++ -34> ) -35> { +22> i +23> = +24> 0 +25> ; +26> i +27> < +28> 1 +29> ; +30> i +31> ++ +32> ) 1->Emitted(58, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(58, 4) Source(83, 4) + SourceIndex(0) -3 >Emitted(58, 5) Source(83, 5) + SourceIndex(0) -4 >Emitted(58, 6) Source(83, 10) + SourceIndex(0) -5 >Emitted(58, 10) Source(83, 10) + SourceIndex(0) -6 >Emitted(58, 31) Source(88, 21) + SourceIndex(0) -7 >Emitted(58, 33) Source(83, 11) + SourceIndex(0) -8 >Emitted(58, 45) Source(83, 28) + SourceIndex(0) -9 >Emitted(58, 47) Source(83, 11) + SourceIndex(0) -10>Emitted(58, 87) Source(83, 28) + SourceIndex(0) -11>Emitted(58, 89) Source(84, 5) + SourceIndex(0) -12>Emitted(58, 101) Source(87, 25) + SourceIndex(0) -13>Emitted(58, 103) Source(84, 5) + SourceIndex(0) -14>Emitted(58, 148) Source(87, 25) + SourceIndex(0) -15>Emitted(58, 150) Source(85, 9) + SourceIndex(0) -16>Emitted(58, 162) Source(85, 34) + SourceIndex(0) -17>Emitted(58, 164) Source(85, 9) + SourceIndex(0) -18>Emitted(58, 212) Source(85, 34) + SourceIndex(0) -19>Emitted(58, 214) Source(86, 9) + SourceIndex(0) -20>Emitted(58, 226) Source(86, 38) + SourceIndex(0) -21>Emitted(58, 228) Source(86, 9) + SourceIndex(0) -22>Emitted(58, 280) Source(86, 38) + SourceIndex(0) -23>Emitted(58, 282) Source(88, 23) + SourceIndex(0) -24>Emitted(58, 283) Source(88, 24) + SourceIndex(0) -25>Emitted(58, 286) Source(88, 27) + SourceIndex(0) -26>Emitted(58, 287) Source(88, 28) + SourceIndex(0) -27>Emitted(58, 289) Source(88, 30) + SourceIndex(0) -28>Emitted(58, 290) Source(88, 31) + SourceIndex(0) -29>Emitted(58, 293) Source(88, 34) + SourceIndex(0) -30>Emitted(58, 294) Source(88, 35) + SourceIndex(0) -31>Emitted(58, 296) Source(88, 37) + SourceIndex(0) -32>Emitted(58, 297) Source(88, 38) + SourceIndex(0) -33>Emitted(58, 299) Source(88, 40) + SourceIndex(0) -34>Emitted(58, 301) Source(88, 42) + SourceIndex(0) -35>Emitted(58, 302) Source(88, 43) + SourceIndex(0) +2 >Emitted(58, 6) Source(83, 10) + SourceIndex(0) +3 >Emitted(58, 10) Source(83, 10) + SourceIndex(0) +4 >Emitted(58, 31) Source(88, 21) + SourceIndex(0) +5 >Emitted(58, 33) Source(83, 11) + SourceIndex(0) +6 >Emitted(58, 45) Source(83, 28) + SourceIndex(0) +7 >Emitted(58, 47) Source(83, 11) + SourceIndex(0) +8 >Emitted(58, 87) Source(83, 28) + SourceIndex(0) +9 >Emitted(58, 89) Source(84, 5) + SourceIndex(0) +10>Emitted(58, 101) Source(87, 25) + SourceIndex(0) +11>Emitted(58, 103) Source(84, 5) + SourceIndex(0) +12>Emitted(58, 148) Source(87, 25) + SourceIndex(0) +13>Emitted(58, 150) Source(85, 9) + SourceIndex(0) +14>Emitted(58, 162) Source(85, 34) + SourceIndex(0) +15>Emitted(58, 164) Source(85, 9) + SourceIndex(0) +16>Emitted(58, 212) Source(85, 34) + SourceIndex(0) +17>Emitted(58, 214) Source(86, 9) + SourceIndex(0) +18>Emitted(58, 226) Source(86, 38) + SourceIndex(0) +19>Emitted(58, 228) Source(86, 9) + SourceIndex(0) +20>Emitted(58, 280) Source(86, 38) + SourceIndex(0) +21>Emitted(58, 282) Source(88, 23) + SourceIndex(0) +22>Emitted(58, 283) Source(88, 24) + SourceIndex(0) +23>Emitted(58, 286) Source(88, 27) + SourceIndex(0) +24>Emitted(58, 287) Source(88, 28) + SourceIndex(0) +25>Emitted(58, 289) Source(88, 30) + SourceIndex(0) +26>Emitted(58, 290) Source(88, 31) + SourceIndex(0) +27>Emitted(58, 293) Source(88, 34) + SourceIndex(0) +28>Emitted(58, 294) Source(88, 35) + SourceIndex(0) +29>Emitted(58, 296) Source(88, 37) + SourceIndex(0) +30>Emitted(58, 297) Source(88, 38) + SourceIndex(0) +31>Emitted(58, 299) Source(88, 40) + SourceIndex(0) +32>Emitted(58, 301) Source(88, 42) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2254,7 +2047,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2273,137 +2066,125 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(59, 25) Source(89, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(60, 1) Source(90, 1) + SourceIndex(0) -2 >Emitted(60, 2) Source(90, 2) + SourceIndex(0) + >} +1 >Emitted(60, 2) Source(90, 2) + SourceIndex(0) --- >>>for (var _23 = ["trimmer", ["trimming", "edging"]], _24 = _23[0], nameMA = _24 === void 0 ? "noName" : _24, _25 = _23[1], _26 = _25 === void 0 ? ["none", "none"] : _25, _27 = _26[0], primarySkillA = _27 === void 0 ? "primary" : _27, _28 = _26[1], secondarySkillA = _28 === void 0 ? "secondary" : _28, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^^^^^^^^^^^^ -21> ^^ -22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^^ -30> ^ -31> ^^ -32> ^ -33> ^^ -34> ^^ -35> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^^ +28> ^ +29> ^^ +30> ^ +31> ^^ +32> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [nameMA = "noName", +2 >for (let +3 > +4 > [nameMA = "noName", > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] > ] = ["trimmer", ["trimming", "edging"]] -7 > -8 > nameMA = "noName" -9 > -10> nameMA = "noName" -11> , +5 > +6 > nameMA = "noName" +7 > +8 > nameMA = "noName" +9 > , > -12> [ +10> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -13> -14> [ +11> +12> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -15> -16> primarySkillA = "primary" -17> -18> primarySkillA = "primary" -19> , +13> +14> primarySkillA = "primary" +15> +16> primarySkillA = "primary" +17> , > -20> secondarySkillA = "secondary" -21> -22> secondarySkillA = "secondary" -23> +18> secondarySkillA = "secondary" +19> +20> secondarySkillA = "secondary" +21> > ] = ["none", "none"] > ] = ["trimmer", ["trimming", "edging"]], -24> i -25> = -26> 0 -27> ; -28> i -29> < -30> 1 -31> ; -32> i -33> ++ -34> ) -35> { +22> i +23> = +24> 0 +25> ; +26> i +27> < +28> 1 +29> ; +30> i +31> ++ +32> ) 1->Emitted(61, 1) Source(91, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(91, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(91, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(91, 10) + SourceIndex(0) -5 >Emitted(61, 10) Source(91, 10) + SourceIndex(0) -6 >Emitted(61, 51) Source(96, 41) + SourceIndex(0) -7 >Emitted(61, 53) Source(91, 11) + SourceIndex(0) -8 >Emitted(61, 65) Source(91, 28) + SourceIndex(0) -9 >Emitted(61, 67) Source(91, 11) + SourceIndex(0) -10>Emitted(61, 107) Source(91, 28) + SourceIndex(0) -11>Emitted(61, 109) Source(92, 5) + SourceIndex(0) -12>Emitted(61, 121) Source(95, 25) + SourceIndex(0) -13>Emitted(61, 123) Source(92, 5) + SourceIndex(0) -14>Emitted(61, 168) Source(95, 25) + SourceIndex(0) -15>Emitted(61, 170) Source(93, 9) + SourceIndex(0) -16>Emitted(61, 182) Source(93, 34) + SourceIndex(0) -17>Emitted(61, 184) Source(93, 9) + SourceIndex(0) -18>Emitted(61, 232) Source(93, 34) + SourceIndex(0) -19>Emitted(61, 234) Source(94, 9) + SourceIndex(0) -20>Emitted(61, 246) Source(94, 38) + SourceIndex(0) -21>Emitted(61, 248) Source(94, 9) + SourceIndex(0) -22>Emitted(61, 300) Source(94, 38) + SourceIndex(0) -23>Emitted(61, 302) Source(96, 43) + SourceIndex(0) -24>Emitted(61, 303) Source(96, 44) + SourceIndex(0) -25>Emitted(61, 306) Source(96, 47) + SourceIndex(0) -26>Emitted(61, 307) Source(96, 48) + SourceIndex(0) -27>Emitted(61, 309) Source(96, 50) + SourceIndex(0) -28>Emitted(61, 310) Source(96, 51) + SourceIndex(0) -29>Emitted(61, 313) Source(96, 54) + SourceIndex(0) -30>Emitted(61, 314) Source(96, 55) + SourceIndex(0) -31>Emitted(61, 316) Source(96, 57) + SourceIndex(0) -32>Emitted(61, 317) Source(96, 58) + SourceIndex(0) -33>Emitted(61, 319) Source(96, 60) + SourceIndex(0) -34>Emitted(61, 321) Source(96, 62) + SourceIndex(0) -35>Emitted(61, 322) Source(96, 63) + SourceIndex(0) +2 >Emitted(61, 6) Source(91, 10) + SourceIndex(0) +3 >Emitted(61, 10) Source(91, 10) + SourceIndex(0) +4 >Emitted(61, 51) Source(96, 41) + SourceIndex(0) +5 >Emitted(61, 53) Source(91, 11) + SourceIndex(0) +6 >Emitted(61, 65) Source(91, 28) + SourceIndex(0) +7 >Emitted(61, 67) Source(91, 11) + SourceIndex(0) +8 >Emitted(61, 107) Source(91, 28) + SourceIndex(0) +9 >Emitted(61, 109) Source(92, 5) + SourceIndex(0) +10>Emitted(61, 121) Source(95, 25) + SourceIndex(0) +11>Emitted(61, 123) Source(92, 5) + SourceIndex(0) +12>Emitted(61, 168) Source(95, 25) + SourceIndex(0) +13>Emitted(61, 170) Source(93, 9) + SourceIndex(0) +14>Emitted(61, 182) Source(93, 34) + SourceIndex(0) +15>Emitted(61, 184) Source(93, 9) + SourceIndex(0) +16>Emitted(61, 232) Source(93, 34) + SourceIndex(0) +17>Emitted(61, 234) Source(94, 9) + SourceIndex(0) +18>Emitted(61, 246) Source(94, 38) + SourceIndex(0) +19>Emitted(61, 248) Source(94, 9) + SourceIndex(0) +20>Emitted(61, 300) Source(94, 38) + SourceIndex(0) +21>Emitted(61, 302) Source(96, 43) + SourceIndex(0) +22>Emitted(61, 303) Source(96, 44) + SourceIndex(0) +23>Emitted(61, 306) Source(96, 47) + SourceIndex(0) +24>Emitted(61, 307) Source(96, 48) + SourceIndex(0) +25>Emitted(61, 309) Source(96, 50) + SourceIndex(0) +26>Emitted(61, 310) Source(96, 51) + SourceIndex(0) +27>Emitted(61, 313) Source(96, 54) + SourceIndex(0) +28>Emitted(61, 314) Source(96, 55) + SourceIndex(0) +29>Emitted(61, 316) Source(96, 57) + SourceIndex(0) +30>Emitted(61, 317) Source(96, 58) + SourceIndex(0) +31>Emitted(61, 319) Source(96, 60) + SourceIndex(0) +32>Emitted(61, 321) Source(96, 62) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2414,7 +2195,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2433,87 +2214,75 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(62, 25) Source(97, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(63, 1) Source(98, 1) + SourceIndex(0) -2 >Emitted(63, 2) Source(98, 2) + SourceIndex(0) + >} +1 >Emitted(63, 2) Source(98, 2) + SourceIndex(0) --- >>>for (var _29 = robotA[0], numberA3 = _29 === void 0 ? -1 : _29, robotAInfo = robotA.slice(1), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > > -2 >for -3 > -4 > (let [ -5 > -6 > numberA3 = -1 -7 > -8 > numberA3 = -1 -9 > , -10> ...robotAInfo -11> ] = robotA, -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let [ +3 > +4 > numberA3 = -1 +5 > +6 > numberA3 = -1 +7 > , +8 > ...robotAInfo +9 > ] = robotA, +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(64, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(64, 4) Source(100, 4) + SourceIndex(0) -3 >Emitted(64, 5) Source(100, 5) + SourceIndex(0) -4 >Emitted(64, 6) Source(100, 11) + SourceIndex(0) -5 >Emitted(64, 10) Source(100, 11) + SourceIndex(0) -6 >Emitted(64, 25) Source(100, 24) + SourceIndex(0) -7 >Emitted(64, 27) Source(100, 11) + SourceIndex(0) -8 >Emitted(64, 63) Source(100, 24) + SourceIndex(0) -9 >Emitted(64, 65) Source(100, 26) + SourceIndex(0) -10>Emitted(64, 93) Source(100, 39) + SourceIndex(0) -11>Emitted(64, 95) Source(100, 51) + SourceIndex(0) -12>Emitted(64, 96) Source(100, 52) + SourceIndex(0) -13>Emitted(64, 99) Source(100, 55) + SourceIndex(0) -14>Emitted(64, 100) Source(100, 56) + SourceIndex(0) -15>Emitted(64, 102) Source(100, 58) + SourceIndex(0) -16>Emitted(64, 103) Source(100, 59) + SourceIndex(0) -17>Emitted(64, 106) Source(100, 62) + SourceIndex(0) -18>Emitted(64, 107) Source(100, 63) + SourceIndex(0) -19>Emitted(64, 109) Source(100, 65) + SourceIndex(0) -20>Emitted(64, 110) Source(100, 66) + SourceIndex(0) -21>Emitted(64, 112) Source(100, 68) + SourceIndex(0) -22>Emitted(64, 114) Source(100, 70) + SourceIndex(0) -23>Emitted(64, 115) Source(100, 71) + SourceIndex(0) +2 >Emitted(64, 6) Source(100, 11) + SourceIndex(0) +3 >Emitted(64, 10) Source(100, 11) + SourceIndex(0) +4 >Emitted(64, 25) Source(100, 24) + SourceIndex(0) +5 >Emitted(64, 27) Source(100, 11) + SourceIndex(0) +6 >Emitted(64, 63) Source(100, 24) + SourceIndex(0) +7 >Emitted(64, 65) Source(100, 26) + SourceIndex(0) +8 >Emitted(64, 93) Source(100, 39) + SourceIndex(0) +9 >Emitted(64, 95) Source(100, 51) + SourceIndex(0) +10>Emitted(64, 96) Source(100, 52) + SourceIndex(0) +11>Emitted(64, 99) Source(100, 55) + SourceIndex(0) +12>Emitted(64, 100) Source(100, 56) + SourceIndex(0) +13>Emitted(64, 102) Source(100, 58) + SourceIndex(0) +14>Emitted(64, 103) Source(100, 59) + SourceIndex(0) +15>Emitted(64, 106) Source(100, 62) + SourceIndex(0) +16>Emitted(64, 107) Source(100, 63) + SourceIndex(0) +17>Emitted(64, 109) Source(100, 65) + SourceIndex(0) +18>Emitted(64, 110) Source(100, 66) + SourceIndex(0) +19>Emitted(64, 112) Source(100, 68) + SourceIndex(0) +20>Emitted(64, 114) Source(100, 70) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2524,7 +2293,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2543,92 +2312,80 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(65, 27) Source(101, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(66, 1) Source(102, 1) + SourceIndex(0) -2 >Emitted(66, 2) Source(102, 2) + SourceIndex(0) + >} +1 >Emitted(66, 2) Source(102, 2) + SourceIndex(0) --- >>>for (var _30 = getRobot(), _31 = _30[0], numberA3 = _31 === void 0 ? -1 : _31, robotAInfo = _30.slice(1), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA3 = -1, ...robotAInfo] = getRobot() -7 > -8 > numberA3 = -1 -9 > -10> numberA3 = -1 -11> , -12> ...robotAInfo -13> ] = getRobot(), -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let +3 > +4 > [numberA3 = -1, ...robotAInfo] = getRobot() +5 > +6 > numberA3 = -1 +7 > +8 > numberA3 = -1 +9 > , +10> ...robotAInfo +11> ] = getRobot(), +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(67, 1) Source(103, 1) + SourceIndex(0) -2 >Emitted(67, 4) Source(103, 4) + SourceIndex(0) -3 >Emitted(67, 5) Source(103, 5) + SourceIndex(0) -4 >Emitted(67, 6) Source(103, 10) + SourceIndex(0) -5 >Emitted(67, 10) Source(103, 10) + SourceIndex(0) -6 >Emitted(67, 26) Source(103, 53) + SourceIndex(0) -7 >Emitted(67, 28) Source(103, 11) + SourceIndex(0) -8 >Emitted(67, 40) Source(103, 24) + SourceIndex(0) -9 >Emitted(67, 42) Source(103, 11) + SourceIndex(0) -10>Emitted(67, 78) Source(103, 24) + SourceIndex(0) -11>Emitted(67, 80) Source(103, 26) + SourceIndex(0) -12>Emitted(67, 105) Source(103, 39) + SourceIndex(0) -13>Emitted(67, 107) Source(103, 55) + SourceIndex(0) -14>Emitted(67, 108) Source(103, 56) + SourceIndex(0) -15>Emitted(67, 111) Source(103, 59) + SourceIndex(0) -16>Emitted(67, 112) Source(103, 60) + SourceIndex(0) -17>Emitted(67, 114) Source(103, 62) + SourceIndex(0) -18>Emitted(67, 115) Source(103, 63) + SourceIndex(0) -19>Emitted(67, 118) Source(103, 66) + SourceIndex(0) -20>Emitted(67, 119) Source(103, 67) + SourceIndex(0) -21>Emitted(67, 121) Source(103, 69) + SourceIndex(0) -22>Emitted(67, 122) Source(103, 70) + SourceIndex(0) -23>Emitted(67, 124) Source(103, 72) + SourceIndex(0) -24>Emitted(67, 126) Source(103, 74) + SourceIndex(0) -25>Emitted(67, 127) Source(103, 75) + SourceIndex(0) +2 >Emitted(67, 6) Source(103, 10) + SourceIndex(0) +3 >Emitted(67, 10) Source(103, 10) + SourceIndex(0) +4 >Emitted(67, 26) Source(103, 53) + SourceIndex(0) +5 >Emitted(67, 28) Source(103, 11) + SourceIndex(0) +6 >Emitted(67, 40) Source(103, 24) + SourceIndex(0) +7 >Emitted(67, 42) Source(103, 11) + SourceIndex(0) +8 >Emitted(67, 78) Source(103, 24) + SourceIndex(0) +9 >Emitted(67, 80) Source(103, 26) + SourceIndex(0) +10>Emitted(67, 105) Source(103, 39) + SourceIndex(0) +11>Emitted(67, 107) Source(103, 55) + SourceIndex(0) +12>Emitted(67, 108) Source(103, 56) + SourceIndex(0) +13>Emitted(67, 111) Source(103, 59) + SourceIndex(0) +14>Emitted(67, 112) Source(103, 60) + SourceIndex(0) +15>Emitted(67, 114) Source(103, 62) + SourceIndex(0) +16>Emitted(67, 115) Source(103, 63) + SourceIndex(0) +17>Emitted(67, 118) Source(103, 66) + SourceIndex(0) +18>Emitted(67, 119) Source(103, 67) + SourceIndex(0) +19>Emitted(67, 121) Source(103, 69) + SourceIndex(0) +20>Emitted(67, 122) Source(103, 70) + SourceIndex(0) +21>Emitted(67, 124) Source(103, 72) + SourceIndex(0) +22>Emitted(67, 126) Source(103, 74) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2639,7 +2396,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2658,92 +2415,80 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(68, 27) Source(104, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(69, 1) Source(105, 1) + SourceIndex(0) -2 >Emitted(69, 2) Source(105, 2) + SourceIndex(0) + >} +1 >Emitted(69, 2) Source(105, 2) + SourceIndex(0) --- >>>for (var _32 = [2, "trimmer", "trimming"], _33 = _32[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = _32.slice(1), i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] -7 > -8 > numberA3 = -1 -9 > -10> numberA3 = -1 -11> , -12> ...robotAInfo -13> ] = [2, "trimmer", "trimming"], -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let +3 > +4 > [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +5 > +6 > numberA3 = -1 +7 > +8 > numberA3 = -1 +9 > , +10> ...robotAInfo +11> ] = [2, "trimmer", "trimming"], +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(70, 1) Source(106, 1) + SourceIndex(0) -2 >Emitted(70, 4) Source(106, 4) + SourceIndex(0) -3 >Emitted(70, 5) Source(106, 5) + SourceIndex(0) -4 >Emitted(70, 6) Source(106, 10) + SourceIndex(0) -5 >Emitted(70, 10) Source(106, 10) + SourceIndex(0) -6 >Emitted(70, 42) Source(106, 69) + SourceIndex(0) -7 >Emitted(70, 44) Source(106, 11) + SourceIndex(0) -8 >Emitted(70, 56) Source(106, 24) + SourceIndex(0) -9 >Emitted(70, 58) Source(106, 11) + SourceIndex(0) -10>Emitted(70, 94) Source(106, 24) + SourceIndex(0) -11>Emitted(70, 96) Source(106, 26) + SourceIndex(0) -12>Emitted(70, 121) Source(106, 39) + SourceIndex(0) -13>Emitted(70, 123) Source(106, 71) + SourceIndex(0) -14>Emitted(70, 124) Source(106, 72) + SourceIndex(0) -15>Emitted(70, 127) Source(106, 75) + SourceIndex(0) -16>Emitted(70, 128) Source(106, 76) + SourceIndex(0) -17>Emitted(70, 130) Source(106, 78) + SourceIndex(0) -18>Emitted(70, 131) Source(106, 79) + SourceIndex(0) -19>Emitted(70, 134) Source(106, 82) + SourceIndex(0) -20>Emitted(70, 135) Source(106, 83) + SourceIndex(0) -21>Emitted(70, 137) Source(106, 85) + SourceIndex(0) -22>Emitted(70, 138) Source(106, 86) + SourceIndex(0) -23>Emitted(70, 140) Source(106, 88) + SourceIndex(0) -24>Emitted(70, 142) Source(106, 90) + SourceIndex(0) -25>Emitted(70, 143) Source(106, 91) + SourceIndex(0) +2 >Emitted(70, 6) Source(106, 10) + SourceIndex(0) +3 >Emitted(70, 10) Source(106, 10) + SourceIndex(0) +4 >Emitted(70, 42) Source(106, 69) + SourceIndex(0) +5 >Emitted(70, 44) Source(106, 11) + SourceIndex(0) +6 >Emitted(70, 56) Source(106, 24) + SourceIndex(0) +7 >Emitted(70, 58) Source(106, 11) + SourceIndex(0) +8 >Emitted(70, 94) Source(106, 24) + SourceIndex(0) +9 >Emitted(70, 96) Source(106, 26) + SourceIndex(0) +10>Emitted(70, 121) Source(106, 39) + SourceIndex(0) +11>Emitted(70, 123) Source(106, 71) + SourceIndex(0) +12>Emitted(70, 124) Source(106, 72) + SourceIndex(0) +13>Emitted(70, 127) Source(106, 75) + SourceIndex(0) +14>Emitted(70, 128) Source(106, 76) + SourceIndex(0) +15>Emitted(70, 130) Source(106, 78) + SourceIndex(0) +16>Emitted(70, 131) Source(106, 79) + SourceIndex(0) +17>Emitted(70, 134) Source(106, 82) + SourceIndex(0) +18>Emitted(70, 135) Source(106, 83) + SourceIndex(0) +19>Emitted(70, 137) Source(106, 85) + SourceIndex(0) +20>Emitted(70, 138) Source(106, 86) + SourceIndex(0) +21>Emitted(70, 140) Source(106, 88) + SourceIndex(0) +22>Emitted(70, 142) Source(106, 90) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2754,7 +2499,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2773,13 +2518,10 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.t 8 >Emitted(71, 27) Source(107, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(72, 1) Source(108, 1) + SourceIndex(0) -2 >Emitted(72, 2) Source(108, 2) + SourceIndex(0) + >} +1 >Emitted(72, 2) Source(108, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map index d3452bfd56e..16da624a97d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,GAAG,CAAC,CAAI,cAAc,EAAd,mCAAc,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAA+B,EAA5B,UAAc,EAAd,mCAAc,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,+BAA+C,EAA5C,UAAc,EAAd,mCAAc,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAI,mBAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACT,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,oBAGkC,EAH/B,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,MACQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AACD,GAAG,CAAC,CAAC,wCAGsD,EAHnD,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,MAC4B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC;AAED,GAAG,CAAC,CAAE,cAAY,EAAZ,iCAAY,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,eAA2B,EAA1B,UAAY,EAAZ,iCAAY,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAC,+BAA2C,EAA1C,UAAY,EAAZ,iCAAY,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,GAAG,CAAC,CAAE,mBAAc,EAAd,mCAAc,EAAI,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,oBAAkC,EAAjC,UAAc,EAAd,mCAAc,MAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,wCAAsD,EAArD,UAAc,EAAd,mCAAc,MAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAE,cAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,eAAgE,EAA/D,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,gCAAgF,EAA/E,YAAa,EAAb,oCAAa,EAAE,YAAe,EAAf,sCAAe,EAAE,YAAiB,EAAjB,wCAAiB,OAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CACC,IAAA,oBAAiB,EAAjB,0CAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,kDAAyB,EACzB,YAA6B,EAA7B,sDAA6B,EAEpB,GAAC,GAAG,CAAC,EAAE,GAAC,GAAG,CAAC,EAAE,GAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,qBAKc,EALb,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,OAEhB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,GAAG,CAAC,CAAC,yCAKkC,EALjC,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,OAEI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED,GAAG,CAAC,CAAE,eAAa,EAAb,oCAAa,EAAE,4BAAa,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,gBAA2C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,OAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,gCAAkE,EAAjE,YAAa,EAAb,oCAAa,EAAE,yBAAa,OAAuC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AACtG,IAAI,CAAS,CAAC;AAEd,KAAQ,cAAc,EAAd,mCAAc,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAA+B,EAA5B,UAAc,EAAd,mCAAc,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,+BAA+C,EAA5C,UAAc,EAAd,mCAAc,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAQ,mBAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,EACT,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAK,oBAGkC,EAH/B,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,MACQ,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAK,wCAGsD,EAHnD,UAGY,EAHZ,0CAGY,EAFhB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B,MAC4B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5E,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAAM,cAAY,EAAZ,iCAAY,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAK,eAA2B,EAA1B,UAAY,EAAZ,iCAAY,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAK,+BAA2C,EAA1C,UAAY,EAAZ,iCAAY,MAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAM,mBAAc,EAAd,mCAAc,EAAI,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,oBAAkC,EAAjC,UAAc,EAAd,mCAAc,MAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,wCAAsD,EAArD,UAAc,EAAd,mCAAc,MAAyC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAM,cAAa,EAAb,kCAAa,EAAE,cAAe,EAAf,oCAAe,EAAE,cAAiB,EAAjB,sCAAiB,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAK,eAAgE,EAA/D,UAAa,EAAb,kCAAa,EAAE,WAAe,EAAf,sCAAe,EAAE,WAAiB,EAAjB,wCAAiB,MAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACtF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAK,gCAAgF,EAA/E,YAAa,EAAb,oCAAa,EAAE,YAAe,EAAf,sCAAe,EAAE,YAAiB,EAAjB,wCAAiB,OAAgC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACtG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KACK,IAAA,oBAAiB,EAAjB,0CAAiB,EACd,oBAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,kDAAyB,EACzB,YAA6B,EAA7B,sDAA6B,EAEpB,GAAC,GAAG,CAAC,EAAE,GAAC,GAAG,CAAC,EAAE,GAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,QAAM,CAAC,CAAC;CACvB;AACD,KAAK,qBAKc,EALb,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,OAEhB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAK,yCAKkC,EALjC,YAAiB,EAAjB,wCAAiB,EACnB,YAGoB,EAHpB,6CAGoB,EAFhB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B,OAEI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAAM,eAAa,EAAb,oCAAa,EAAE,4BAAa,EAAI,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,gBAA2C,EAA1C,YAAa,EAAb,oCAAa,EAAE,yBAAa,OAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,gCAAkE,EAAjE,YAAa,EAAb,oCAAa,EAAE,yBAAa,OAAuC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt index aa1a4f7a016..12c73bc4408 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.sourcemap.txt @@ -61,21 +61,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. --- >>> return robotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robotA -5 > ; +2 > return +3 > robotA +4 > ; 1->Emitted(3, 5) Source(9, 5) + SourceIndex(0) -2 >Emitted(3, 11) Source(9, 11) + SourceIndex(0) -3 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) -4 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) -5 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) +2 >Emitted(3, 12) Source(9, 12) + SourceIndex(0) +3 >Emitted(3, 18) Source(9, 18) + SourceIndex(0) +4 >Emitted(3, 19) Source(9, 19) + SourceIndex(0) --- >>>} 1 > @@ -188,21 +185,18 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. --- >>> return multiRobotA; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobotA -5 > ; +2 > return +3 > multiRobotA +4 > ; 1->Emitted(8, 5) Source(15, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(15, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(15, 24) + SourceIndex(0) --- >>>} 1 > @@ -343,73 +337,64 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. --- >>>for (_a = robotA[1], nameA = _a === void 0 ? "name" : _a, robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > > -2 >for -3 > -4 > ([, -5 > nameA = "name" -6 > -7 > nameA = "name" -8 > ] = -9 > robotA -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ([, +3 > nameA = "name" +4 > +5 > nameA = "name" +6 > ] = +7 > robotA +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(15, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(15, 4) Source(24, 4) + SourceIndex(0) -3 >Emitted(15, 5) Source(24, 5) + SourceIndex(0) -4 >Emitted(15, 6) Source(24, 9) + SourceIndex(0) -5 >Emitted(15, 20) Source(24, 23) + SourceIndex(0) -6 >Emitted(15, 22) Source(24, 9) + SourceIndex(0) -7 >Emitted(15, 57) Source(24, 23) + SourceIndex(0) -8 >Emitted(15, 59) Source(24, 27) + SourceIndex(0) -9 >Emitted(15, 65) Source(24, 33) + SourceIndex(0) -10>Emitted(15, 67) Source(24, 35) + SourceIndex(0) -11>Emitted(15, 68) Source(24, 36) + SourceIndex(0) -12>Emitted(15, 71) Source(24, 39) + SourceIndex(0) -13>Emitted(15, 72) Source(24, 40) + SourceIndex(0) -14>Emitted(15, 74) Source(24, 42) + SourceIndex(0) -15>Emitted(15, 75) Source(24, 43) + SourceIndex(0) -16>Emitted(15, 78) Source(24, 46) + SourceIndex(0) -17>Emitted(15, 79) Source(24, 47) + SourceIndex(0) -18>Emitted(15, 81) Source(24, 49) + SourceIndex(0) -19>Emitted(15, 82) Source(24, 50) + SourceIndex(0) -20>Emitted(15, 84) Source(24, 52) + SourceIndex(0) -21>Emitted(15, 86) Source(24, 54) + SourceIndex(0) -22>Emitted(15, 87) Source(24, 55) + SourceIndex(0) +2 >Emitted(15, 6) Source(24, 9) + SourceIndex(0) +3 >Emitted(15, 20) Source(24, 23) + SourceIndex(0) +4 >Emitted(15, 22) Source(24, 9) + SourceIndex(0) +5 >Emitted(15, 57) Source(24, 23) + SourceIndex(0) +6 >Emitted(15, 59) Source(24, 27) + SourceIndex(0) +7 >Emitted(15, 65) Source(24, 33) + SourceIndex(0) +8 >Emitted(15, 67) Source(24, 35) + SourceIndex(0) +9 >Emitted(15, 68) Source(24, 36) + SourceIndex(0) +10>Emitted(15, 71) Source(24, 39) + SourceIndex(0) +11>Emitted(15, 72) Source(24, 40) + SourceIndex(0) +12>Emitted(15, 74) Source(24, 42) + SourceIndex(0) +13>Emitted(15, 75) Source(24, 43) + SourceIndex(0) +14>Emitted(15, 78) Source(24, 46) + SourceIndex(0) +15>Emitted(15, 79) Source(24, 47) + SourceIndex(0) +16>Emitted(15, 81) Source(24, 49) + SourceIndex(0) +17>Emitted(15, 82) Source(24, 50) + SourceIndex(0) +18>Emitted(15, 84) Source(24, 52) + SourceIndex(0) +19>Emitted(15, 86) Source(24, 54) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -420,7 +405,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -439,83 +424,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(16, 24) Source(25, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(17, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) + >} +1 >Emitted(17, 2) Source(26, 2) + SourceIndex(0) --- >>>for (_b = getRobot(), _c = _b[1], nameA = _c === void 0 ? "name" : _c, _b, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, nameA = "name"] = getRobot() -6 > -7 > nameA = "name" -8 > -9 > nameA = "name" -10> ] = getRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [, nameA = "name"] = getRobot() +4 > +5 > nameA = "name" +6 > +7 > nameA = "name" +8 > ] = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(18, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(18, 4) Source(27, 4) + SourceIndex(0) -3 >Emitted(18, 5) Source(27, 5) + SourceIndex(0) -4 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) -5 >Emitted(18, 21) Source(27, 37) + SourceIndex(0) -6 >Emitted(18, 23) Source(27, 9) + SourceIndex(0) -7 >Emitted(18, 33) Source(27, 23) + SourceIndex(0) -8 >Emitted(18, 35) Source(27, 9) + SourceIndex(0) -9 >Emitted(18, 70) Source(27, 23) + SourceIndex(0) -10>Emitted(18, 76) Source(27, 39) + SourceIndex(0) -11>Emitted(18, 77) Source(27, 40) + SourceIndex(0) -12>Emitted(18, 80) Source(27, 43) + SourceIndex(0) -13>Emitted(18, 81) Source(27, 44) + SourceIndex(0) -14>Emitted(18, 83) Source(27, 46) + SourceIndex(0) -15>Emitted(18, 84) Source(27, 47) + SourceIndex(0) -16>Emitted(18, 87) Source(27, 50) + SourceIndex(0) -17>Emitted(18, 88) Source(27, 51) + SourceIndex(0) -18>Emitted(18, 90) Source(27, 53) + SourceIndex(0) -19>Emitted(18, 91) Source(27, 54) + SourceIndex(0) -20>Emitted(18, 93) Source(27, 56) + SourceIndex(0) -21>Emitted(18, 95) Source(27, 58) + SourceIndex(0) -22>Emitted(18, 96) Source(27, 59) + SourceIndex(0) +2 >Emitted(18, 6) Source(27, 6) + SourceIndex(0) +3 >Emitted(18, 21) Source(27, 37) + SourceIndex(0) +4 >Emitted(18, 23) Source(27, 9) + SourceIndex(0) +5 >Emitted(18, 33) Source(27, 23) + SourceIndex(0) +6 >Emitted(18, 35) Source(27, 9) + SourceIndex(0) +7 >Emitted(18, 70) Source(27, 23) + SourceIndex(0) +8 >Emitted(18, 76) Source(27, 39) + SourceIndex(0) +9 >Emitted(18, 77) Source(27, 40) + SourceIndex(0) +10>Emitted(18, 80) Source(27, 43) + SourceIndex(0) +11>Emitted(18, 81) Source(27, 44) + SourceIndex(0) +12>Emitted(18, 83) Source(27, 46) + SourceIndex(0) +13>Emitted(18, 84) Source(27, 47) + SourceIndex(0) +14>Emitted(18, 87) Source(27, 50) + SourceIndex(0) +15>Emitted(18, 88) Source(27, 51) + SourceIndex(0) +16>Emitted(18, 90) Source(27, 53) + SourceIndex(0) +17>Emitted(18, 91) Source(27, 54) + SourceIndex(0) +18>Emitted(18, 93) Source(27, 56) + SourceIndex(0) +19>Emitted(18, 95) Source(27, 58) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -526,7 +499,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -545,83 +518,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(19, 24) Source(28, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(20, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) + >} +1 >Emitted(20, 2) Source(29, 2) + SourceIndex(0) --- >>>for (_d = [2, "trimmer", "trimming"], _e = _d[1], nameA = _e === void 0 ? "name" : _e, _d, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, nameA = "name"] = [2, "trimmer", "trimming"] -6 > -7 > nameA = "name" -8 > -9 > nameA = "name" -10> ] = [2, "trimmer", "trimming"], -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [, nameA = "name"] = [2, "trimmer", "trimming"] +4 > +5 > nameA = "name" +6 > +7 > nameA = "name" +8 > ] = [2, "trimmer", "trimming"], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(21, 1) Source(30, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(30, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(30, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) -5 >Emitted(21, 37) Source(30, 53) + SourceIndex(0) -6 >Emitted(21, 39) Source(30, 9) + SourceIndex(0) -7 >Emitted(21, 49) Source(30, 23) + SourceIndex(0) -8 >Emitted(21, 51) Source(30, 9) + SourceIndex(0) -9 >Emitted(21, 86) Source(30, 23) + SourceIndex(0) -10>Emitted(21, 92) Source(30, 55) + SourceIndex(0) -11>Emitted(21, 93) Source(30, 56) + SourceIndex(0) -12>Emitted(21, 96) Source(30, 59) + SourceIndex(0) -13>Emitted(21, 97) Source(30, 60) + SourceIndex(0) -14>Emitted(21, 99) Source(30, 62) + SourceIndex(0) -15>Emitted(21, 100) Source(30, 63) + SourceIndex(0) -16>Emitted(21, 103) Source(30, 66) + SourceIndex(0) -17>Emitted(21, 104) Source(30, 67) + SourceIndex(0) -18>Emitted(21, 106) Source(30, 69) + SourceIndex(0) -19>Emitted(21, 107) Source(30, 70) + SourceIndex(0) -20>Emitted(21, 109) Source(30, 72) + SourceIndex(0) -21>Emitted(21, 111) Source(30, 74) + SourceIndex(0) -22>Emitted(21, 112) Source(30, 75) + SourceIndex(0) +2 >Emitted(21, 6) Source(30, 6) + SourceIndex(0) +3 >Emitted(21, 37) Source(30, 53) + SourceIndex(0) +4 >Emitted(21, 39) Source(30, 9) + SourceIndex(0) +5 >Emitted(21, 49) Source(30, 23) + SourceIndex(0) +6 >Emitted(21, 51) Source(30, 9) + SourceIndex(0) +7 >Emitted(21, 86) Source(30, 23) + SourceIndex(0) +8 >Emitted(21, 92) Source(30, 55) + SourceIndex(0) +9 >Emitted(21, 93) Source(30, 56) + SourceIndex(0) +10>Emitted(21, 96) Source(30, 59) + SourceIndex(0) +11>Emitted(21, 97) Source(30, 60) + SourceIndex(0) +12>Emitted(21, 99) Source(30, 62) + SourceIndex(0) +13>Emitted(21, 100) Source(30, 63) + SourceIndex(0) +14>Emitted(21, 103) Source(30, 66) + SourceIndex(0) +15>Emitted(21, 104) Source(30, 67) + SourceIndex(0) +16>Emitted(21, 106) Source(30, 69) + SourceIndex(0) +17>Emitted(21, 107) Source(30, 70) + SourceIndex(0) +18>Emitted(21, 109) Source(30, 72) + SourceIndex(0) +19>Emitted(21, 111) Source(30, 74) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -632,7 +593,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -651,115 +612,103 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(22, 24) Source(31, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(23, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) + >} +1 >Emitted(23, 2) Source(32, 2) + SourceIndex(0) --- >>>for (_f = multiRobotA[1], _g = _f === void 0 ? ["none", "none"] : _f, _h = _g[0], primarySkillA = _h === void 0 ? "primary" : _h, _j = _g[1], secondarySkillA = _j === void 0 ? "secondary" : _j, multiRobotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ([, -5 > [ +2 >for ([, +3 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -6 > -7 > [ +4 > +5 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -8 > -9 > primarySkillA = "primary" -10> -11> primarySkillA = "primary" -12> , +6 > +7 > primarySkillA = "primary" +8 > +9 > primarySkillA = "primary" +10> , > -13> secondarySkillA = "secondary" -14> -15> secondarySkillA = "secondary" -16> +11> secondarySkillA = "secondary" +12> +13> secondarySkillA = "secondary" +14> > ] = ["none", "none"]] = -17> multiRobotA -18> , -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +15> multiRobotA +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(24, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(24, 4) Source(33, 4) + SourceIndex(0) -3 >Emitted(24, 5) Source(33, 5) + SourceIndex(0) -4 >Emitted(24, 6) Source(33, 9) + SourceIndex(0) -5 >Emitted(24, 25) Source(36, 21) + SourceIndex(0) -6 >Emitted(24, 27) Source(33, 9) + SourceIndex(0) -7 >Emitted(24, 69) Source(36, 21) + SourceIndex(0) -8 >Emitted(24, 71) Source(34, 5) + SourceIndex(0) -9 >Emitted(24, 81) Source(34, 30) + SourceIndex(0) -10>Emitted(24, 83) Source(34, 5) + SourceIndex(0) -11>Emitted(24, 129) Source(34, 30) + SourceIndex(0) -12>Emitted(24, 131) Source(35, 5) + SourceIndex(0) -13>Emitted(24, 141) Source(35, 34) + SourceIndex(0) -14>Emitted(24, 143) Source(35, 5) + SourceIndex(0) -15>Emitted(24, 193) Source(35, 34) + SourceIndex(0) -16>Emitted(24, 195) Source(36, 25) + SourceIndex(0) -17>Emitted(24, 206) Source(36, 36) + SourceIndex(0) -18>Emitted(24, 208) Source(36, 38) + SourceIndex(0) -19>Emitted(24, 209) Source(36, 39) + SourceIndex(0) -20>Emitted(24, 212) Source(36, 42) + SourceIndex(0) -21>Emitted(24, 213) Source(36, 43) + SourceIndex(0) -22>Emitted(24, 215) Source(36, 45) + SourceIndex(0) -23>Emitted(24, 216) Source(36, 46) + SourceIndex(0) -24>Emitted(24, 219) Source(36, 49) + SourceIndex(0) -25>Emitted(24, 220) Source(36, 50) + SourceIndex(0) -26>Emitted(24, 222) Source(36, 52) + SourceIndex(0) -27>Emitted(24, 223) Source(36, 53) + SourceIndex(0) -28>Emitted(24, 225) Source(36, 55) + SourceIndex(0) -29>Emitted(24, 227) Source(36, 57) + SourceIndex(0) -30>Emitted(24, 228) Source(36, 58) + SourceIndex(0) +2 >Emitted(24, 6) Source(33, 9) + SourceIndex(0) +3 >Emitted(24, 25) Source(36, 21) + SourceIndex(0) +4 >Emitted(24, 27) Source(33, 9) + SourceIndex(0) +5 >Emitted(24, 69) Source(36, 21) + SourceIndex(0) +6 >Emitted(24, 71) Source(34, 5) + SourceIndex(0) +7 >Emitted(24, 81) Source(34, 30) + SourceIndex(0) +8 >Emitted(24, 83) Source(34, 5) + SourceIndex(0) +9 >Emitted(24, 129) Source(34, 30) + SourceIndex(0) +10>Emitted(24, 131) Source(35, 5) + SourceIndex(0) +11>Emitted(24, 141) Source(35, 34) + SourceIndex(0) +12>Emitted(24, 143) Source(35, 5) + SourceIndex(0) +13>Emitted(24, 193) Source(35, 34) + SourceIndex(0) +14>Emitted(24, 195) Source(36, 25) + SourceIndex(0) +15>Emitted(24, 206) Source(36, 36) + SourceIndex(0) +16>Emitted(24, 208) Source(36, 38) + SourceIndex(0) +17>Emitted(24, 209) Source(36, 39) + SourceIndex(0) +18>Emitted(24, 212) Source(36, 42) + SourceIndex(0) +19>Emitted(24, 213) Source(36, 43) + SourceIndex(0) +20>Emitted(24, 215) Source(36, 45) + SourceIndex(0) +21>Emitted(24, 216) Source(36, 46) + SourceIndex(0) +22>Emitted(24, 219) Source(36, 49) + SourceIndex(0) +23>Emitted(24, 220) Source(36, 50) + SourceIndex(0) +24>Emitted(24, 222) Source(36, 52) + SourceIndex(0) +25>Emitted(24, 223) Source(36, 53) + SourceIndex(0) +26>Emitted(24, 225) Source(36, 55) + SourceIndex(0) +27>Emitted(24, 227) Source(36, 57) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -770,7 +719,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -789,118 +738,106 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(25, 32) Source(37, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(26, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(26, 2) Source(38, 2) + SourceIndex(0) + >} +1 >Emitted(26, 2) Source(38, 2) + SourceIndex(0) --- >>>for (_k = getMultiRobot(), _l = _k[1], _m = _l === void 0 ? ["none", "none"] : _l, _o = _m[0], primarySkillA = _o === void 0 ? "primary" : _o, _p = _m[1], secondarySkillA = _p === void 0 ? "secondary" : _p, _k, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^^^^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^^^^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, [ +2 >for ( +3 > [, [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"]] = getMultiRobot() -6 > -7 > [ +4 > +5 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -8 > -9 > [ +6 > +7 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -10> -11> primarySkillA = "primary" -12> -13> primarySkillA = "primary" -14> , +8 > +9 > primarySkillA = "primary" +10> +11> primarySkillA = "primary" +12> , > -15> secondarySkillA = "secondary" -16> -17> secondarySkillA = "secondary" -18> +13> secondarySkillA = "secondary" +14> +15> secondarySkillA = "secondary" +16> > ] = ["none", "none"]] = getMultiRobot(), -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(27, 1) Source(39, 1) + SourceIndex(0) -2 >Emitted(27, 4) Source(39, 4) + SourceIndex(0) -3 >Emitted(27, 5) Source(39, 5) + SourceIndex(0) -4 >Emitted(27, 6) Source(39, 6) + SourceIndex(0) -5 >Emitted(27, 26) Source(42, 40) + SourceIndex(0) -6 >Emitted(27, 28) Source(39, 9) + SourceIndex(0) -7 >Emitted(27, 38) Source(42, 21) + SourceIndex(0) -8 >Emitted(27, 40) Source(39, 9) + SourceIndex(0) -9 >Emitted(27, 82) Source(42, 21) + SourceIndex(0) -10>Emitted(27, 84) Source(40, 5) + SourceIndex(0) -11>Emitted(27, 94) Source(40, 30) + SourceIndex(0) -12>Emitted(27, 96) Source(40, 5) + SourceIndex(0) -13>Emitted(27, 142) Source(40, 30) + SourceIndex(0) -14>Emitted(27, 144) Source(41, 5) + SourceIndex(0) -15>Emitted(27, 154) Source(41, 34) + SourceIndex(0) -16>Emitted(27, 156) Source(41, 5) + SourceIndex(0) -17>Emitted(27, 206) Source(41, 34) + SourceIndex(0) -18>Emitted(27, 212) Source(42, 42) + SourceIndex(0) -19>Emitted(27, 213) Source(42, 43) + SourceIndex(0) -20>Emitted(27, 216) Source(42, 46) + SourceIndex(0) -21>Emitted(27, 217) Source(42, 47) + SourceIndex(0) -22>Emitted(27, 219) Source(42, 49) + SourceIndex(0) -23>Emitted(27, 220) Source(42, 50) + SourceIndex(0) -24>Emitted(27, 223) Source(42, 53) + SourceIndex(0) -25>Emitted(27, 224) Source(42, 54) + SourceIndex(0) -26>Emitted(27, 226) Source(42, 56) + SourceIndex(0) -27>Emitted(27, 227) Source(42, 57) + SourceIndex(0) -28>Emitted(27, 229) Source(42, 59) + SourceIndex(0) -29>Emitted(27, 231) Source(42, 61) + SourceIndex(0) -30>Emitted(27, 232) Source(42, 62) + SourceIndex(0) +2 >Emitted(27, 6) Source(39, 6) + SourceIndex(0) +3 >Emitted(27, 26) Source(42, 40) + SourceIndex(0) +4 >Emitted(27, 28) Source(39, 9) + SourceIndex(0) +5 >Emitted(27, 38) Source(42, 21) + SourceIndex(0) +6 >Emitted(27, 40) Source(39, 9) + SourceIndex(0) +7 >Emitted(27, 82) Source(42, 21) + SourceIndex(0) +8 >Emitted(27, 84) Source(40, 5) + SourceIndex(0) +9 >Emitted(27, 94) Source(40, 30) + SourceIndex(0) +10>Emitted(27, 96) Source(40, 5) + SourceIndex(0) +11>Emitted(27, 142) Source(40, 30) + SourceIndex(0) +12>Emitted(27, 144) Source(41, 5) + SourceIndex(0) +13>Emitted(27, 154) Source(41, 34) + SourceIndex(0) +14>Emitted(27, 156) Source(41, 5) + SourceIndex(0) +15>Emitted(27, 206) Source(41, 34) + SourceIndex(0) +16>Emitted(27, 212) Source(42, 42) + SourceIndex(0) +17>Emitted(27, 213) Source(42, 43) + SourceIndex(0) +18>Emitted(27, 216) Source(42, 46) + SourceIndex(0) +19>Emitted(27, 217) Source(42, 47) + SourceIndex(0) +20>Emitted(27, 219) Source(42, 49) + SourceIndex(0) +21>Emitted(27, 220) Source(42, 50) + SourceIndex(0) +22>Emitted(27, 223) Source(42, 53) + SourceIndex(0) +23>Emitted(27, 224) Source(42, 54) + SourceIndex(0) +24>Emitted(27, 226) Source(42, 56) + SourceIndex(0) +25>Emitted(27, 227) Source(42, 57) + SourceIndex(0) +26>Emitted(27, 229) Source(42, 59) + SourceIndex(0) +27>Emitted(27, 231) Source(42, 61) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -911,7 +848,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -930,118 +867,106 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(28, 32) Source(43, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(29, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(44, 2) + SourceIndex(0) + >} +1 >Emitted(29, 2) Source(44, 2) + SourceIndex(0) --- >>>for (_q = ["trimmer", ["trimming", "edging"]], _r = _q[1], _s = _r === void 0 ? ["none", "none"] : _r, _t = _s[0], primarySkillA = _t === void 0 ? "primary" : _t, _u = _s[1], secondarySkillA = _u === void 0 ? "secondary" : _u, _q, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^^^^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^^^^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [, [ +2 >for ( +3 > [, [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] -6 > -7 > [ +4 > +5 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -8 > -9 > [ +6 > +7 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -10> -11> primarySkillA = "primary" -12> -13> primarySkillA = "primary" -14> , +8 > +9 > primarySkillA = "primary" +10> +11> primarySkillA = "primary" +12> , > -15> secondarySkillA = "secondary" -16> -17> secondarySkillA = "secondary" -18> +13> secondarySkillA = "secondary" +14> +15> secondarySkillA = "secondary" +16> > ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(30, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(45, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(45, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(45, 6) + SourceIndex(0) -5 >Emitted(30, 46) Source(48, 60) + SourceIndex(0) -6 >Emitted(30, 48) Source(45, 9) + SourceIndex(0) -7 >Emitted(30, 58) Source(48, 21) + SourceIndex(0) -8 >Emitted(30, 60) Source(45, 9) + SourceIndex(0) -9 >Emitted(30, 102) Source(48, 21) + SourceIndex(0) -10>Emitted(30, 104) Source(46, 5) + SourceIndex(0) -11>Emitted(30, 114) Source(46, 30) + SourceIndex(0) -12>Emitted(30, 116) Source(46, 5) + SourceIndex(0) -13>Emitted(30, 162) Source(46, 30) + SourceIndex(0) -14>Emitted(30, 164) Source(47, 5) + SourceIndex(0) -15>Emitted(30, 174) Source(47, 34) + SourceIndex(0) -16>Emitted(30, 176) Source(47, 5) + SourceIndex(0) -17>Emitted(30, 226) Source(47, 34) + SourceIndex(0) -18>Emitted(30, 232) Source(48, 62) + SourceIndex(0) -19>Emitted(30, 233) Source(48, 63) + SourceIndex(0) -20>Emitted(30, 236) Source(48, 66) + SourceIndex(0) -21>Emitted(30, 237) Source(48, 67) + SourceIndex(0) -22>Emitted(30, 239) Source(48, 69) + SourceIndex(0) -23>Emitted(30, 240) Source(48, 70) + SourceIndex(0) -24>Emitted(30, 243) Source(48, 73) + SourceIndex(0) -25>Emitted(30, 244) Source(48, 74) + SourceIndex(0) -26>Emitted(30, 246) Source(48, 76) + SourceIndex(0) -27>Emitted(30, 247) Source(48, 77) + SourceIndex(0) -28>Emitted(30, 249) Source(48, 79) + SourceIndex(0) -29>Emitted(30, 251) Source(48, 81) + SourceIndex(0) -30>Emitted(30, 252) Source(48, 82) + SourceIndex(0) +2 >Emitted(30, 6) Source(45, 6) + SourceIndex(0) +3 >Emitted(30, 46) Source(48, 60) + SourceIndex(0) +4 >Emitted(30, 48) Source(45, 9) + SourceIndex(0) +5 >Emitted(30, 58) Source(48, 21) + SourceIndex(0) +6 >Emitted(30, 60) Source(45, 9) + SourceIndex(0) +7 >Emitted(30, 102) Source(48, 21) + SourceIndex(0) +8 >Emitted(30, 104) Source(46, 5) + SourceIndex(0) +9 >Emitted(30, 114) Source(46, 30) + SourceIndex(0) +10>Emitted(30, 116) Source(46, 5) + SourceIndex(0) +11>Emitted(30, 162) Source(46, 30) + SourceIndex(0) +12>Emitted(30, 164) Source(47, 5) + SourceIndex(0) +13>Emitted(30, 174) Source(47, 34) + SourceIndex(0) +14>Emitted(30, 176) Source(47, 5) + SourceIndex(0) +15>Emitted(30, 226) Source(47, 34) + SourceIndex(0) +16>Emitted(30, 232) Source(48, 62) + SourceIndex(0) +17>Emitted(30, 233) Source(48, 63) + SourceIndex(0) +18>Emitted(30, 236) Source(48, 66) + SourceIndex(0) +19>Emitted(30, 237) Source(48, 67) + SourceIndex(0) +20>Emitted(30, 239) Source(48, 69) + SourceIndex(0) +21>Emitted(30, 240) Source(48, 70) + SourceIndex(0) +22>Emitted(30, 243) Source(48, 73) + SourceIndex(0) +23>Emitted(30, 244) Source(48, 74) + SourceIndex(0) +24>Emitted(30, 246) Source(48, 76) + SourceIndex(0) +25>Emitted(30, 247) Source(48, 77) + SourceIndex(0) +26>Emitted(30, 249) Source(48, 79) + SourceIndex(0) +27>Emitted(30, 251) Source(48, 81) + SourceIndex(0) --- >>> console.log(primarySkillA); 1 >^^^^ @@ -1052,7 +977,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1071,84 +996,72 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(31, 32) Source(49, 32) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(32, 1) Source(50, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(50, 2) + SourceIndex(0) + >} +1 >Emitted(32, 2) Source(50, 2) + SourceIndex(0) --- >>>for (_v = robotA[0], numberB = _v === void 0 ? -1 : _v, robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > > -2 >for -3 > -4 > ([ -5 > numberB = -1 -6 > -7 > numberB = -1 -8 > ] = -9 > robotA -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ([ +3 > numberB = -1 +4 > +5 > numberB = -1 +6 > ] = +7 > robotA +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(33, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(52, 7) + SourceIndex(0) -5 >Emitted(33, 20) Source(52, 19) + SourceIndex(0) -6 >Emitted(33, 22) Source(52, 7) + SourceIndex(0) -7 >Emitted(33, 55) Source(52, 19) + SourceIndex(0) -8 >Emitted(33, 57) Source(52, 23) + SourceIndex(0) -9 >Emitted(33, 63) Source(52, 29) + SourceIndex(0) -10>Emitted(33, 65) Source(52, 31) + SourceIndex(0) -11>Emitted(33, 66) Source(52, 32) + SourceIndex(0) -12>Emitted(33, 69) Source(52, 35) + SourceIndex(0) -13>Emitted(33, 70) Source(52, 36) + SourceIndex(0) -14>Emitted(33, 72) Source(52, 38) + SourceIndex(0) -15>Emitted(33, 73) Source(52, 39) + SourceIndex(0) -16>Emitted(33, 76) Source(52, 42) + SourceIndex(0) -17>Emitted(33, 77) Source(52, 43) + SourceIndex(0) -18>Emitted(33, 79) Source(52, 45) + SourceIndex(0) -19>Emitted(33, 80) Source(52, 46) + SourceIndex(0) -20>Emitted(33, 82) Source(52, 48) + SourceIndex(0) -21>Emitted(33, 84) Source(52, 50) + SourceIndex(0) -22>Emitted(33, 85) Source(52, 51) + SourceIndex(0) +2 >Emitted(33, 6) Source(52, 7) + SourceIndex(0) +3 >Emitted(33, 20) Source(52, 19) + SourceIndex(0) +4 >Emitted(33, 22) Source(52, 7) + SourceIndex(0) +5 >Emitted(33, 55) Source(52, 19) + SourceIndex(0) +6 >Emitted(33, 57) Source(52, 23) + SourceIndex(0) +7 >Emitted(33, 63) Source(52, 29) + SourceIndex(0) +8 >Emitted(33, 65) Source(52, 31) + SourceIndex(0) +9 >Emitted(33, 66) Source(52, 32) + SourceIndex(0) +10>Emitted(33, 69) Source(52, 35) + SourceIndex(0) +11>Emitted(33, 70) Source(52, 36) + SourceIndex(0) +12>Emitted(33, 72) Source(52, 38) + SourceIndex(0) +13>Emitted(33, 73) Source(52, 39) + SourceIndex(0) +14>Emitted(33, 76) Source(52, 42) + SourceIndex(0) +15>Emitted(33, 77) Source(52, 43) + SourceIndex(0) +16>Emitted(33, 79) Source(52, 45) + SourceIndex(0) +17>Emitted(33, 80) Source(52, 46) + SourceIndex(0) +18>Emitted(33, 82) Source(52, 48) + SourceIndex(0) +19>Emitted(33, 84) Source(52, 50) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1159,7 +1072,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1178,83 +1091,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(34, 26) Source(53, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(35, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) + >} +1 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) --- >>>for (_w = getRobot(), _x = _w[0], numberB = _x === void 0 ? -1 : _x, _w, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberB = -1] = getRobot() -6 > -7 > numberB = -1 -8 > -9 > numberB = -1 -10> ] = getRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [numberB = -1] = getRobot() +4 > +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(36, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(36, 4) Source(55, 4) + SourceIndex(0) -3 >Emitted(36, 5) Source(55, 5) + SourceIndex(0) -4 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) -5 >Emitted(36, 21) Source(55, 33) + SourceIndex(0) -6 >Emitted(36, 23) Source(55, 7) + SourceIndex(0) -7 >Emitted(36, 33) Source(55, 19) + SourceIndex(0) -8 >Emitted(36, 35) Source(55, 7) + SourceIndex(0) -9 >Emitted(36, 68) Source(55, 19) + SourceIndex(0) -10>Emitted(36, 74) Source(55, 35) + SourceIndex(0) -11>Emitted(36, 75) Source(55, 36) + SourceIndex(0) -12>Emitted(36, 78) Source(55, 39) + SourceIndex(0) -13>Emitted(36, 79) Source(55, 40) + SourceIndex(0) -14>Emitted(36, 81) Source(55, 42) + SourceIndex(0) -15>Emitted(36, 82) Source(55, 43) + SourceIndex(0) -16>Emitted(36, 85) Source(55, 46) + SourceIndex(0) -17>Emitted(36, 86) Source(55, 47) + SourceIndex(0) -18>Emitted(36, 88) Source(55, 49) + SourceIndex(0) -19>Emitted(36, 89) Source(55, 50) + SourceIndex(0) -20>Emitted(36, 91) Source(55, 52) + SourceIndex(0) -21>Emitted(36, 93) Source(55, 54) + SourceIndex(0) -22>Emitted(36, 94) Source(55, 55) + SourceIndex(0) +2 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) +3 >Emitted(36, 21) Source(55, 33) + SourceIndex(0) +4 >Emitted(36, 23) Source(55, 7) + SourceIndex(0) +5 >Emitted(36, 33) Source(55, 19) + SourceIndex(0) +6 >Emitted(36, 35) Source(55, 7) + SourceIndex(0) +7 >Emitted(36, 68) Source(55, 19) + SourceIndex(0) +8 >Emitted(36, 74) Source(55, 35) + SourceIndex(0) +9 >Emitted(36, 75) Source(55, 36) + SourceIndex(0) +10>Emitted(36, 78) Source(55, 39) + SourceIndex(0) +11>Emitted(36, 79) Source(55, 40) + SourceIndex(0) +12>Emitted(36, 81) Source(55, 42) + SourceIndex(0) +13>Emitted(36, 82) Source(55, 43) + SourceIndex(0) +14>Emitted(36, 85) Source(55, 46) + SourceIndex(0) +15>Emitted(36, 86) Source(55, 47) + SourceIndex(0) +16>Emitted(36, 88) Source(55, 49) + SourceIndex(0) +17>Emitted(36, 89) Source(55, 50) + SourceIndex(0) +18>Emitted(36, 91) Source(55, 52) + SourceIndex(0) +19>Emitted(36, 93) Source(55, 54) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1265,7 +1166,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1284,83 +1185,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(37, 26) Source(56, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(38, 1) Source(57, 1) + SourceIndex(0) -2 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) + >} +1 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) --- >>>for (_y = [2, "trimmer", "trimming"], _z = _y[0], numberB = _z === void 0 ? -1 : _z, _y, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberB = -1] = [2, "trimmer", "trimming"] -6 > -7 > numberB = -1 -8 > -9 > numberB = -1 -10> ] = [2, "trimmer", "trimming"], -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [numberB = -1] = [2, "trimmer", "trimming"] +4 > +5 > numberB = -1 +6 > +7 > numberB = -1 +8 > ] = [2, "trimmer", "trimming"], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(39, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(58, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(58, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(58, 6) + SourceIndex(0) -5 >Emitted(39, 37) Source(58, 49) + SourceIndex(0) -6 >Emitted(39, 39) Source(58, 7) + SourceIndex(0) -7 >Emitted(39, 49) Source(58, 19) + SourceIndex(0) -8 >Emitted(39, 51) Source(58, 7) + SourceIndex(0) -9 >Emitted(39, 84) Source(58, 19) + SourceIndex(0) -10>Emitted(39, 90) Source(58, 51) + SourceIndex(0) -11>Emitted(39, 91) Source(58, 52) + SourceIndex(0) -12>Emitted(39, 94) Source(58, 55) + SourceIndex(0) -13>Emitted(39, 95) Source(58, 56) + SourceIndex(0) -14>Emitted(39, 97) Source(58, 58) + SourceIndex(0) -15>Emitted(39, 98) Source(58, 59) + SourceIndex(0) -16>Emitted(39, 101) Source(58, 62) + SourceIndex(0) -17>Emitted(39, 102) Source(58, 63) + SourceIndex(0) -18>Emitted(39, 104) Source(58, 65) + SourceIndex(0) -19>Emitted(39, 105) Source(58, 66) + SourceIndex(0) -20>Emitted(39, 107) Source(58, 68) + SourceIndex(0) -21>Emitted(39, 109) Source(58, 70) + SourceIndex(0) -22>Emitted(39, 110) Source(58, 71) + SourceIndex(0) +2 >Emitted(39, 6) Source(58, 6) + SourceIndex(0) +3 >Emitted(39, 37) Source(58, 49) + SourceIndex(0) +4 >Emitted(39, 39) Source(58, 7) + SourceIndex(0) +5 >Emitted(39, 49) Source(58, 19) + SourceIndex(0) +6 >Emitted(39, 51) Source(58, 7) + SourceIndex(0) +7 >Emitted(39, 84) Source(58, 19) + SourceIndex(0) +8 >Emitted(39, 90) Source(58, 51) + SourceIndex(0) +9 >Emitted(39, 91) Source(58, 52) + SourceIndex(0) +10>Emitted(39, 94) Source(58, 55) + SourceIndex(0) +11>Emitted(39, 95) Source(58, 56) + SourceIndex(0) +12>Emitted(39, 97) Source(58, 58) + SourceIndex(0) +13>Emitted(39, 98) Source(58, 59) + SourceIndex(0) +14>Emitted(39, 101) Source(58, 62) + SourceIndex(0) +15>Emitted(39, 102) Source(58, 63) + SourceIndex(0) +16>Emitted(39, 104) Source(58, 65) + SourceIndex(0) +17>Emitted(39, 105) Source(58, 66) + SourceIndex(0) +18>Emitted(39, 107) Source(58, 68) + SourceIndex(0) +19>Emitted(39, 109) Source(58, 70) + SourceIndex(0) --- >>> console.log(numberB); 1 >^^^^ @@ -1371,7 +1260,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1390,83 +1279,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(40, 26) Source(59, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(41, 1) Source(60, 1) + SourceIndex(0) -2 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) + >} +1 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) --- >>>for (_0 = multiRobotA[0], nameB = _0 === void 0 ? "name" : _0, multiRobotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ([ -5 > nameB = "name" -6 > -7 > nameB = "name" -8 > ] = -9 > multiRobotA -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ([ +3 > nameB = "name" +4 > +5 > nameB = "name" +6 > ] = +7 > multiRobotA +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(42, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(42, 4) Source(61, 4) + SourceIndex(0) -3 >Emitted(42, 5) Source(61, 5) + SourceIndex(0) -4 >Emitted(42, 6) Source(61, 7) + SourceIndex(0) -5 >Emitted(42, 25) Source(61, 21) + SourceIndex(0) -6 >Emitted(42, 27) Source(61, 7) + SourceIndex(0) -7 >Emitted(42, 62) Source(61, 21) + SourceIndex(0) -8 >Emitted(42, 64) Source(61, 25) + SourceIndex(0) -9 >Emitted(42, 75) Source(61, 36) + SourceIndex(0) -10>Emitted(42, 77) Source(61, 38) + SourceIndex(0) -11>Emitted(42, 78) Source(61, 39) + SourceIndex(0) -12>Emitted(42, 81) Source(61, 42) + SourceIndex(0) -13>Emitted(42, 82) Source(61, 43) + SourceIndex(0) -14>Emitted(42, 84) Source(61, 45) + SourceIndex(0) -15>Emitted(42, 85) Source(61, 46) + SourceIndex(0) -16>Emitted(42, 88) Source(61, 49) + SourceIndex(0) -17>Emitted(42, 89) Source(61, 50) + SourceIndex(0) -18>Emitted(42, 91) Source(61, 52) + SourceIndex(0) -19>Emitted(42, 92) Source(61, 53) + SourceIndex(0) -20>Emitted(42, 94) Source(61, 55) + SourceIndex(0) -21>Emitted(42, 96) Source(61, 57) + SourceIndex(0) -22>Emitted(42, 97) Source(61, 58) + SourceIndex(0) +2 >Emitted(42, 6) Source(61, 7) + SourceIndex(0) +3 >Emitted(42, 25) Source(61, 21) + SourceIndex(0) +4 >Emitted(42, 27) Source(61, 7) + SourceIndex(0) +5 >Emitted(42, 62) Source(61, 21) + SourceIndex(0) +6 >Emitted(42, 64) Source(61, 25) + SourceIndex(0) +7 >Emitted(42, 75) Source(61, 36) + SourceIndex(0) +8 >Emitted(42, 77) Source(61, 38) + SourceIndex(0) +9 >Emitted(42, 78) Source(61, 39) + SourceIndex(0) +10>Emitted(42, 81) Source(61, 42) + SourceIndex(0) +11>Emitted(42, 82) Source(61, 43) + SourceIndex(0) +12>Emitted(42, 84) Source(61, 45) + SourceIndex(0) +13>Emitted(42, 85) Source(61, 46) + SourceIndex(0) +14>Emitted(42, 88) Source(61, 49) + SourceIndex(0) +15>Emitted(42, 89) Source(61, 50) + SourceIndex(0) +16>Emitted(42, 91) Source(61, 52) + SourceIndex(0) +17>Emitted(42, 92) Source(61, 53) + SourceIndex(0) +18>Emitted(42, 94) Source(61, 55) + SourceIndex(0) +19>Emitted(42, 96) Source(61, 57) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1477,7 +1354,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1496,83 +1373,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(43, 24) Source(62, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(44, 1) Source(63, 1) + SourceIndex(0) -2 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) + >} +1 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) --- >>>for (_1 = getMultiRobot(), _2 = _1[0], nameB = _2 === void 0 ? "name" : _2, _1, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameB = "name"] = getMultiRobot() -6 > -7 > nameB = "name" -8 > -9 > nameB = "name" -10> ] = getMultiRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [nameB = "name"] = getMultiRobot() +4 > +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = getMultiRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(45, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(64, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(64, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) -5 >Emitted(45, 26) Source(64, 40) + SourceIndex(0) -6 >Emitted(45, 28) Source(64, 7) + SourceIndex(0) -7 >Emitted(45, 38) Source(64, 21) + SourceIndex(0) -8 >Emitted(45, 40) Source(64, 7) + SourceIndex(0) -9 >Emitted(45, 75) Source(64, 21) + SourceIndex(0) -10>Emitted(45, 81) Source(64, 42) + SourceIndex(0) -11>Emitted(45, 82) Source(64, 43) + SourceIndex(0) -12>Emitted(45, 85) Source(64, 46) + SourceIndex(0) -13>Emitted(45, 86) Source(64, 47) + SourceIndex(0) -14>Emitted(45, 88) Source(64, 49) + SourceIndex(0) -15>Emitted(45, 89) Source(64, 50) + SourceIndex(0) -16>Emitted(45, 92) Source(64, 53) + SourceIndex(0) -17>Emitted(45, 93) Source(64, 54) + SourceIndex(0) -18>Emitted(45, 95) Source(64, 56) + SourceIndex(0) -19>Emitted(45, 96) Source(64, 57) + SourceIndex(0) -20>Emitted(45, 98) Source(64, 59) + SourceIndex(0) -21>Emitted(45, 100) Source(64, 61) + SourceIndex(0) -22>Emitted(45, 101) Source(64, 62) + SourceIndex(0) +2 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) +3 >Emitted(45, 26) Source(64, 40) + SourceIndex(0) +4 >Emitted(45, 28) Source(64, 7) + SourceIndex(0) +5 >Emitted(45, 38) Source(64, 21) + SourceIndex(0) +6 >Emitted(45, 40) Source(64, 7) + SourceIndex(0) +7 >Emitted(45, 75) Source(64, 21) + SourceIndex(0) +8 >Emitted(45, 81) Source(64, 42) + SourceIndex(0) +9 >Emitted(45, 82) Source(64, 43) + SourceIndex(0) +10>Emitted(45, 85) Source(64, 46) + SourceIndex(0) +11>Emitted(45, 86) Source(64, 47) + SourceIndex(0) +12>Emitted(45, 88) Source(64, 49) + SourceIndex(0) +13>Emitted(45, 89) Source(64, 50) + SourceIndex(0) +14>Emitted(45, 92) Source(64, 53) + SourceIndex(0) +15>Emitted(45, 93) Source(64, 54) + SourceIndex(0) +16>Emitted(45, 95) Source(64, 56) + SourceIndex(0) +17>Emitted(45, 96) Source(64, 57) + SourceIndex(0) +18>Emitted(45, 98) Source(64, 59) + SourceIndex(0) +19>Emitted(45, 100) Source(64, 61) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1583,7 +1448,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1602,83 +1467,71 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(46, 24) Source(65, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(47, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(47, 2) Source(66, 2) + SourceIndex(0) + >} +1 >Emitted(47, 2) Source(66, 2) + SourceIndex(0) --- >>>for (_3 = ["trimmer", ["trimming", "edging"]], _4 = _3[0], nameB = _4 === void 0 ? "name" : _4, _3, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameB = "name"] = ["trimmer", ["trimming", "edging"]] -6 > -7 > nameB = "name" -8 > -9 > nameB = "name" -10> ] = ["trimmer", ["trimming", "edging"]], -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > [nameB = "name"] = ["trimmer", ["trimming", "edging"]] +4 > +5 > nameB = "name" +6 > +7 > nameB = "name" +8 > ] = ["trimmer", ["trimming", "edging"]], +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(48, 1) Source(67, 1) + SourceIndex(0) -2 >Emitted(48, 4) Source(67, 4) + SourceIndex(0) -3 >Emitted(48, 5) Source(67, 5) + SourceIndex(0) -4 >Emitted(48, 6) Source(67, 6) + SourceIndex(0) -5 >Emitted(48, 46) Source(67, 60) + SourceIndex(0) -6 >Emitted(48, 48) Source(67, 7) + SourceIndex(0) -7 >Emitted(48, 58) Source(67, 21) + SourceIndex(0) -8 >Emitted(48, 60) Source(67, 7) + SourceIndex(0) -9 >Emitted(48, 95) Source(67, 21) + SourceIndex(0) -10>Emitted(48, 101) Source(67, 62) + SourceIndex(0) -11>Emitted(48, 102) Source(67, 63) + SourceIndex(0) -12>Emitted(48, 105) Source(67, 66) + SourceIndex(0) -13>Emitted(48, 106) Source(67, 67) + SourceIndex(0) -14>Emitted(48, 108) Source(67, 69) + SourceIndex(0) -15>Emitted(48, 109) Source(67, 70) + SourceIndex(0) -16>Emitted(48, 112) Source(67, 73) + SourceIndex(0) -17>Emitted(48, 113) Source(67, 74) + SourceIndex(0) -18>Emitted(48, 115) Source(67, 76) + SourceIndex(0) -19>Emitted(48, 116) Source(67, 77) + SourceIndex(0) -20>Emitted(48, 118) Source(67, 79) + SourceIndex(0) -21>Emitted(48, 120) Source(67, 81) + SourceIndex(0) -22>Emitted(48, 121) Source(67, 82) + SourceIndex(0) +2 >Emitted(48, 6) Source(67, 6) + SourceIndex(0) +3 >Emitted(48, 46) Source(67, 60) + SourceIndex(0) +4 >Emitted(48, 48) Source(67, 7) + SourceIndex(0) +5 >Emitted(48, 58) Source(67, 21) + SourceIndex(0) +6 >Emitted(48, 60) Source(67, 7) + SourceIndex(0) +7 >Emitted(48, 95) Source(67, 21) + SourceIndex(0) +8 >Emitted(48, 101) Source(67, 62) + SourceIndex(0) +9 >Emitted(48, 102) Source(67, 63) + SourceIndex(0) +10>Emitted(48, 105) Source(67, 66) + SourceIndex(0) +11>Emitted(48, 106) Source(67, 67) + SourceIndex(0) +12>Emitted(48, 108) Source(67, 69) + SourceIndex(0) +13>Emitted(48, 109) Source(67, 70) + SourceIndex(0) +14>Emitted(48, 112) Source(67, 73) + SourceIndex(0) +15>Emitted(48, 113) Source(67, 74) + SourceIndex(0) +16>Emitted(48, 115) Source(67, 76) + SourceIndex(0) +17>Emitted(48, 116) Source(67, 77) + SourceIndex(0) +18>Emitted(48, 118) Source(67, 79) + SourceIndex(0) +19>Emitted(48, 120) Source(67, 81) + SourceIndex(0) --- >>> console.log(nameB); 1 >^^^^ @@ -1689,7 +1542,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1708,108 +1561,96 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(49, 24) Source(68, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(50, 1) Source(69, 1) + SourceIndex(0) -2 >Emitted(50, 2) Source(69, 2) + SourceIndex(0) + >} +1 >Emitted(50, 2) Source(69, 2) + SourceIndex(0) --- >>>for (_5 = robotA[0], numberA2 = _5 === void 0 ? -1 : _5, _6 = robotA[1], nameA2 = _6 === void 0 ? "name" : _6, _7 = robotA[2], skillA2 = _7 === void 0 ? "skill" : _7, robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > > -2 >for -3 > -4 > ([ -5 > numberA2 = -1 -6 > -7 > numberA2 = -1 -8 > , -9 > nameA2 = "name" -10> -11> nameA2 = "name" -12> , -13> skillA2 = "skill" -14> -15> skillA2 = "skill" -16> ] = -17> robotA -18> , -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +2 >for ([ +3 > numberA2 = -1 +4 > +5 > numberA2 = -1 +6 > , +7 > nameA2 = "name" +8 > +9 > nameA2 = "name" +10> , +11> skillA2 = "skill" +12> +13> skillA2 = "skill" +14> ] = +15> robotA +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(51, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(51, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(51, 6) Source(71, 7) + SourceIndex(0) -5 >Emitted(51, 20) Source(71, 20) + SourceIndex(0) -6 >Emitted(51, 22) Source(71, 7) + SourceIndex(0) -7 >Emitted(51, 56) Source(71, 20) + SourceIndex(0) -8 >Emitted(51, 58) Source(71, 22) + SourceIndex(0) -9 >Emitted(51, 72) Source(71, 37) + SourceIndex(0) -10>Emitted(51, 74) Source(71, 22) + SourceIndex(0) -11>Emitted(51, 110) Source(71, 37) + SourceIndex(0) -12>Emitted(51, 112) Source(71, 39) + SourceIndex(0) -13>Emitted(51, 126) Source(71, 56) + SourceIndex(0) -14>Emitted(51, 128) Source(71, 39) + SourceIndex(0) -15>Emitted(51, 166) Source(71, 56) + SourceIndex(0) -16>Emitted(51, 168) Source(71, 60) + SourceIndex(0) -17>Emitted(51, 174) Source(71, 66) + SourceIndex(0) -18>Emitted(51, 176) Source(71, 68) + SourceIndex(0) -19>Emitted(51, 177) Source(71, 69) + SourceIndex(0) -20>Emitted(51, 180) Source(71, 72) + SourceIndex(0) -21>Emitted(51, 181) Source(71, 73) + SourceIndex(0) -22>Emitted(51, 183) Source(71, 75) + SourceIndex(0) -23>Emitted(51, 184) Source(71, 76) + SourceIndex(0) -24>Emitted(51, 187) Source(71, 79) + SourceIndex(0) -25>Emitted(51, 188) Source(71, 80) + SourceIndex(0) -26>Emitted(51, 190) Source(71, 82) + SourceIndex(0) -27>Emitted(51, 191) Source(71, 83) + SourceIndex(0) -28>Emitted(51, 193) Source(71, 85) + SourceIndex(0) -29>Emitted(51, 195) Source(71, 87) + SourceIndex(0) -30>Emitted(51, 196) Source(71, 88) + SourceIndex(0) +2 >Emitted(51, 6) Source(71, 7) + SourceIndex(0) +3 >Emitted(51, 20) Source(71, 20) + SourceIndex(0) +4 >Emitted(51, 22) Source(71, 7) + SourceIndex(0) +5 >Emitted(51, 56) Source(71, 20) + SourceIndex(0) +6 >Emitted(51, 58) Source(71, 22) + SourceIndex(0) +7 >Emitted(51, 72) Source(71, 37) + SourceIndex(0) +8 >Emitted(51, 74) Source(71, 22) + SourceIndex(0) +9 >Emitted(51, 110) Source(71, 37) + SourceIndex(0) +10>Emitted(51, 112) Source(71, 39) + SourceIndex(0) +11>Emitted(51, 126) Source(71, 56) + SourceIndex(0) +12>Emitted(51, 128) Source(71, 39) + SourceIndex(0) +13>Emitted(51, 166) Source(71, 56) + SourceIndex(0) +14>Emitted(51, 168) Source(71, 60) + SourceIndex(0) +15>Emitted(51, 174) Source(71, 66) + SourceIndex(0) +16>Emitted(51, 176) Source(71, 68) + SourceIndex(0) +17>Emitted(51, 177) Source(71, 69) + SourceIndex(0) +18>Emitted(51, 180) Source(71, 72) + SourceIndex(0) +19>Emitted(51, 181) Source(71, 73) + SourceIndex(0) +20>Emitted(51, 183) Source(71, 75) + SourceIndex(0) +21>Emitted(51, 184) Source(71, 76) + SourceIndex(0) +22>Emitted(51, 187) Source(71, 79) + SourceIndex(0) +23>Emitted(51, 188) Source(71, 80) + SourceIndex(0) +24>Emitted(51, 190) Source(71, 82) + SourceIndex(0) +25>Emitted(51, 191) Source(71, 83) + SourceIndex(0) +26>Emitted(51, 193) Source(71, 85) + SourceIndex(0) +27>Emitted(51, 195) Source(71, 87) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1820,7 +1661,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1839,107 +1680,95 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(52, 25) Source(72, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(53, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(53, 2) Source(73, 2) + SourceIndex(0) + >} +1 >Emitted(53, 2) Source(73, 2) + SourceIndex(0) --- >>>for (_8 = getRobot(), _9 = _8[0], numberA2 = _9 === void 0 ? -1 : _9, _10 = _8[1], nameA2 = _10 === void 0 ? "name" : _10, _11 = _8[2], skillA2 = _11 === void 0 ? "skill" : _11, _8, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^^^^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^^^^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() -6 > -7 > numberA2 = -1 -8 > -9 > numberA2 = -1 -10> , -11> nameA2 = "name" -12> -13> nameA2 = "name" -14> , -15> skillA2 = "skill" -16> -17> skillA2 = "skill" -18> ] = getRobot(), -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +2 >for ( +3 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot() +4 > +5 > numberA2 = -1 +6 > +7 > numberA2 = -1 +8 > , +9 > nameA2 = "name" +10> +11> nameA2 = "name" +12> , +13> skillA2 = "skill" +14> +15> skillA2 = "skill" +16> ] = getRobot(), +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(54, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(54, 4) Source(74, 4) + SourceIndex(0) -3 >Emitted(54, 5) Source(74, 5) + SourceIndex(0) -4 >Emitted(54, 6) Source(74, 6) + SourceIndex(0) -5 >Emitted(54, 21) Source(74, 70) + SourceIndex(0) -6 >Emitted(54, 23) Source(74, 7) + SourceIndex(0) -7 >Emitted(54, 33) Source(74, 20) + SourceIndex(0) -8 >Emitted(54, 35) Source(74, 7) + SourceIndex(0) -9 >Emitted(54, 69) Source(74, 20) + SourceIndex(0) -10>Emitted(54, 71) Source(74, 22) + SourceIndex(0) -11>Emitted(54, 82) Source(74, 37) + SourceIndex(0) -12>Emitted(54, 84) Source(74, 22) + SourceIndex(0) -13>Emitted(54, 122) Source(74, 37) + SourceIndex(0) -14>Emitted(54, 124) Source(74, 39) + SourceIndex(0) -15>Emitted(54, 135) Source(74, 56) + SourceIndex(0) -16>Emitted(54, 137) Source(74, 39) + SourceIndex(0) -17>Emitted(54, 177) Source(74, 56) + SourceIndex(0) -18>Emitted(54, 183) Source(74, 72) + SourceIndex(0) -19>Emitted(54, 184) Source(74, 73) + SourceIndex(0) -20>Emitted(54, 187) Source(74, 76) + SourceIndex(0) -21>Emitted(54, 188) Source(74, 77) + SourceIndex(0) -22>Emitted(54, 190) Source(74, 79) + SourceIndex(0) -23>Emitted(54, 191) Source(74, 80) + SourceIndex(0) -24>Emitted(54, 194) Source(74, 83) + SourceIndex(0) -25>Emitted(54, 195) Source(74, 84) + SourceIndex(0) -26>Emitted(54, 197) Source(74, 86) + SourceIndex(0) -27>Emitted(54, 198) Source(74, 87) + SourceIndex(0) -28>Emitted(54, 200) Source(74, 89) + SourceIndex(0) -29>Emitted(54, 202) Source(74, 91) + SourceIndex(0) -30>Emitted(54, 203) Source(74, 92) + SourceIndex(0) +2 >Emitted(54, 6) Source(74, 6) + SourceIndex(0) +3 >Emitted(54, 21) Source(74, 70) + SourceIndex(0) +4 >Emitted(54, 23) Source(74, 7) + SourceIndex(0) +5 >Emitted(54, 33) Source(74, 20) + SourceIndex(0) +6 >Emitted(54, 35) Source(74, 7) + SourceIndex(0) +7 >Emitted(54, 69) Source(74, 20) + SourceIndex(0) +8 >Emitted(54, 71) Source(74, 22) + SourceIndex(0) +9 >Emitted(54, 82) Source(74, 37) + SourceIndex(0) +10>Emitted(54, 84) Source(74, 22) + SourceIndex(0) +11>Emitted(54, 122) Source(74, 37) + SourceIndex(0) +12>Emitted(54, 124) Source(74, 39) + SourceIndex(0) +13>Emitted(54, 135) Source(74, 56) + SourceIndex(0) +14>Emitted(54, 137) Source(74, 39) + SourceIndex(0) +15>Emitted(54, 177) Source(74, 56) + SourceIndex(0) +16>Emitted(54, 183) Source(74, 72) + SourceIndex(0) +17>Emitted(54, 184) Source(74, 73) + SourceIndex(0) +18>Emitted(54, 187) Source(74, 76) + SourceIndex(0) +19>Emitted(54, 188) Source(74, 77) + SourceIndex(0) +20>Emitted(54, 190) Source(74, 79) + SourceIndex(0) +21>Emitted(54, 191) Source(74, 80) + SourceIndex(0) +22>Emitted(54, 194) Source(74, 83) + SourceIndex(0) +23>Emitted(54, 195) Source(74, 84) + SourceIndex(0) +24>Emitted(54, 197) Source(74, 86) + SourceIndex(0) +25>Emitted(54, 198) Source(74, 87) + SourceIndex(0) +26>Emitted(54, 200) Source(74, 89) + SourceIndex(0) +27>Emitted(54, 202) Source(74, 91) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -1950,7 +1779,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1969,107 +1798,95 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(55, 25) Source(75, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(56, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(56, 2) Source(76, 2) + SourceIndex(0) + >} +1 >Emitted(56, 2) Source(76, 2) + SourceIndex(0) --- >>>for (_12 = [2, "trimmer", "trimming"], _13 = _12[0], numberA2 = _13 === void 0 ? -1 : _13, _14 = _12[1], nameA2 = _14 === void 0 ? "name" : _14, _15 = _12[2], skillA2 = _15 === void 0 ? "skill" : _15, _12, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^^^^^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^^^^^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] -6 > -7 > numberA2 = -1 -8 > -9 > numberA2 = -1 -10> , -11> nameA2 = "name" -12> -13> nameA2 = "name" -14> , -15> skillA2 = "skill" -16> -17> skillA2 = "skill" -18> ] = [2, "trimmer", "trimming"], -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +2 >for ( +3 > [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] +4 > +5 > numberA2 = -1 +6 > +7 > numberA2 = -1 +8 > , +9 > nameA2 = "name" +10> +11> nameA2 = "name" +12> , +13> skillA2 = "skill" +14> +15> skillA2 = "skill" +16> ] = [2, "trimmer", "trimming"], +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(57, 1) Source(77, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(77, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(77, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(77, 6) + SourceIndex(0) -5 >Emitted(57, 38) Source(77, 86) + SourceIndex(0) -6 >Emitted(57, 40) Source(77, 7) + SourceIndex(0) -7 >Emitted(57, 52) Source(77, 20) + SourceIndex(0) -8 >Emitted(57, 54) Source(77, 7) + SourceIndex(0) -9 >Emitted(57, 90) Source(77, 20) + SourceIndex(0) -10>Emitted(57, 92) Source(77, 22) + SourceIndex(0) -11>Emitted(57, 104) Source(77, 37) + SourceIndex(0) -12>Emitted(57, 106) Source(77, 22) + SourceIndex(0) -13>Emitted(57, 144) Source(77, 37) + SourceIndex(0) -14>Emitted(57, 146) Source(77, 39) + SourceIndex(0) -15>Emitted(57, 158) Source(77, 56) + SourceIndex(0) -16>Emitted(57, 160) Source(77, 39) + SourceIndex(0) -17>Emitted(57, 200) Source(77, 56) + SourceIndex(0) -18>Emitted(57, 207) Source(77, 88) + SourceIndex(0) -19>Emitted(57, 208) Source(77, 89) + SourceIndex(0) -20>Emitted(57, 211) Source(77, 92) + SourceIndex(0) -21>Emitted(57, 212) Source(77, 93) + SourceIndex(0) -22>Emitted(57, 214) Source(77, 95) + SourceIndex(0) -23>Emitted(57, 215) Source(77, 96) + SourceIndex(0) -24>Emitted(57, 218) Source(77, 99) + SourceIndex(0) -25>Emitted(57, 219) Source(77, 100) + SourceIndex(0) -26>Emitted(57, 221) Source(77, 102) + SourceIndex(0) -27>Emitted(57, 222) Source(77, 103) + SourceIndex(0) -28>Emitted(57, 224) Source(77, 105) + SourceIndex(0) -29>Emitted(57, 226) Source(77, 107) + SourceIndex(0) -30>Emitted(57, 227) Source(77, 108) + SourceIndex(0) +2 >Emitted(57, 6) Source(77, 6) + SourceIndex(0) +3 >Emitted(57, 38) Source(77, 86) + SourceIndex(0) +4 >Emitted(57, 40) Source(77, 7) + SourceIndex(0) +5 >Emitted(57, 52) Source(77, 20) + SourceIndex(0) +6 >Emitted(57, 54) Source(77, 7) + SourceIndex(0) +7 >Emitted(57, 90) Source(77, 20) + SourceIndex(0) +8 >Emitted(57, 92) Source(77, 22) + SourceIndex(0) +9 >Emitted(57, 104) Source(77, 37) + SourceIndex(0) +10>Emitted(57, 106) Source(77, 22) + SourceIndex(0) +11>Emitted(57, 144) Source(77, 37) + SourceIndex(0) +12>Emitted(57, 146) Source(77, 39) + SourceIndex(0) +13>Emitted(57, 158) Source(77, 56) + SourceIndex(0) +14>Emitted(57, 160) Source(77, 39) + SourceIndex(0) +15>Emitted(57, 200) Source(77, 56) + SourceIndex(0) +16>Emitted(57, 207) Source(77, 88) + SourceIndex(0) +17>Emitted(57, 208) Source(77, 89) + SourceIndex(0) +18>Emitted(57, 211) Source(77, 92) + SourceIndex(0) +19>Emitted(57, 212) Source(77, 93) + SourceIndex(0) +20>Emitted(57, 214) Source(77, 95) + SourceIndex(0) +21>Emitted(57, 215) Source(77, 96) + SourceIndex(0) +22>Emitted(57, 218) Source(77, 99) + SourceIndex(0) +23>Emitted(57, 219) Source(77, 100) + SourceIndex(0) +24>Emitted(57, 221) Source(77, 102) + SourceIndex(0) +25>Emitted(57, 222) Source(77, 103) + SourceIndex(0) +26>Emitted(57, 224) Source(77, 105) + SourceIndex(0) +27>Emitted(57, 226) Source(77, 107) + SourceIndex(0) --- >>> console.log(nameA2); 1 >^^^^ @@ -2080,7 +1897,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2099,127 +1916,115 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(58, 25) Source(78, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(59, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(59, 2) Source(79, 2) + SourceIndex(0) + >} +1 >Emitted(59, 2) Source(79, 2) + SourceIndex(0) --- >>>for (var _16 = multiRobotA[0], nameMA_1 = _16 === void 0 ? "noName" : _16, _17 = multiRobotA[1], _18 = _17 === void 0 ? ["none", "none"] : _17, _19 = _18[0], primarySkillA_1 = _19 === void 0 ? "primary" : _19, _20 = _18[1], secondarySkillA_1 = _20 === void 0 ? "secondary" : _20, i_1 = 0; i_1 < 1; i_1++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^ -19> ^^ -20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -21> ^^ -22> ^^^ -23> ^^^ -24> ^ -25> ^^ -26> ^^^ -27> ^^^ -28> ^ -29> ^^ -30> ^^^ -31> ^^ -32> ^^ -33> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^ +21> ^^^ +22> ^ +23> ^^ +24> ^^^ +25> ^^^ +26> ^ +27> ^^ +28> ^^^ +29> ^^ +30> ^^ 1-> > -2 >for -3 > -4 > (let - > [ -5 > -6 > nameMA = "noName" -7 > -8 > nameMA = "noName" -9 > , +2 >for (let + > [ +3 > +4 > nameMA = "noName" +5 > +6 > nameMA = "noName" +7 > , > -10> [ +8 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -11> -12> [ +9 > +10> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -13> -14> primarySkillA = "primary" -15> -16> primarySkillA = "primary" -17> , +11> +12> primarySkillA = "primary" +13> +14> primarySkillA = "primary" +15> , > -18> secondarySkillA = "secondary" -19> -20> secondarySkillA = "secondary" -21> +16> secondarySkillA = "secondary" +17> +18> secondarySkillA = "secondary" +19> > ] = ["none", "none"] > ] = multiRobotA, -22> i -23> = -24> 0 -25> ; -26> i -27> < -28> 1 -29> ; -30> i -31> ++ -32> ) -33> { +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) 1->Emitted(60, 1) Source(80, 1) + SourceIndex(0) -2 >Emitted(60, 4) Source(80, 4) + SourceIndex(0) -3 >Emitted(60, 5) Source(80, 5) + SourceIndex(0) -4 >Emitted(60, 6) Source(81, 6) + SourceIndex(0) -5 >Emitted(60, 10) Source(81, 6) + SourceIndex(0) -6 >Emitted(60, 30) Source(81, 23) + SourceIndex(0) -7 >Emitted(60, 32) Source(81, 6) + SourceIndex(0) -8 >Emitted(60, 74) Source(81, 23) + SourceIndex(0) -9 >Emitted(60, 76) Source(82, 9) + SourceIndex(0) -10>Emitted(60, 96) Source(85, 29) + SourceIndex(0) -11>Emitted(60, 98) Source(82, 9) + SourceIndex(0) -12>Emitted(60, 143) Source(85, 29) + SourceIndex(0) -13>Emitted(60, 145) Source(83, 13) + SourceIndex(0) -14>Emitted(60, 157) Source(83, 38) + SourceIndex(0) -15>Emitted(60, 159) Source(83, 13) + SourceIndex(0) -16>Emitted(60, 209) Source(83, 38) + SourceIndex(0) -17>Emitted(60, 211) Source(84, 13) + SourceIndex(0) -18>Emitted(60, 223) Source(84, 42) + SourceIndex(0) -19>Emitted(60, 225) Source(84, 13) + SourceIndex(0) -20>Emitted(60, 279) Source(84, 42) + SourceIndex(0) -21>Emitted(60, 281) Source(86, 22) + SourceIndex(0) -22>Emitted(60, 284) Source(86, 23) + SourceIndex(0) -23>Emitted(60, 287) Source(86, 26) + SourceIndex(0) -24>Emitted(60, 288) Source(86, 27) + SourceIndex(0) -25>Emitted(60, 290) Source(86, 29) + SourceIndex(0) -26>Emitted(60, 293) Source(86, 30) + SourceIndex(0) -27>Emitted(60, 296) Source(86, 33) + SourceIndex(0) -28>Emitted(60, 297) Source(86, 34) + SourceIndex(0) -29>Emitted(60, 299) Source(86, 36) + SourceIndex(0) -30>Emitted(60, 302) Source(86, 37) + SourceIndex(0) -31>Emitted(60, 304) Source(86, 39) + SourceIndex(0) -32>Emitted(60, 306) Source(86, 41) + SourceIndex(0) -33>Emitted(60, 307) Source(86, 42) + SourceIndex(0) +2 >Emitted(60, 6) Source(81, 6) + SourceIndex(0) +3 >Emitted(60, 10) Source(81, 6) + SourceIndex(0) +4 >Emitted(60, 30) Source(81, 23) + SourceIndex(0) +5 >Emitted(60, 32) Source(81, 6) + SourceIndex(0) +6 >Emitted(60, 74) Source(81, 23) + SourceIndex(0) +7 >Emitted(60, 76) Source(82, 9) + SourceIndex(0) +8 >Emitted(60, 96) Source(85, 29) + SourceIndex(0) +9 >Emitted(60, 98) Source(82, 9) + SourceIndex(0) +10>Emitted(60, 143) Source(85, 29) + SourceIndex(0) +11>Emitted(60, 145) Source(83, 13) + SourceIndex(0) +12>Emitted(60, 157) Source(83, 38) + SourceIndex(0) +13>Emitted(60, 159) Source(83, 13) + SourceIndex(0) +14>Emitted(60, 209) Source(83, 38) + SourceIndex(0) +15>Emitted(60, 211) Source(84, 13) + SourceIndex(0) +16>Emitted(60, 223) Source(84, 42) + SourceIndex(0) +17>Emitted(60, 225) Source(84, 13) + SourceIndex(0) +18>Emitted(60, 279) Source(84, 42) + SourceIndex(0) +19>Emitted(60, 281) Source(86, 22) + SourceIndex(0) +20>Emitted(60, 284) Source(86, 23) + SourceIndex(0) +21>Emitted(60, 287) Source(86, 26) + SourceIndex(0) +22>Emitted(60, 288) Source(86, 27) + SourceIndex(0) +23>Emitted(60, 290) Source(86, 29) + SourceIndex(0) +24>Emitted(60, 293) Source(86, 30) + SourceIndex(0) +25>Emitted(60, 296) Source(86, 33) + SourceIndex(0) +26>Emitted(60, 297) Source(86, 34) + SourceIndex(0) +27>Emitted(60, 299) Source(86, 36) + SourceIndex(0) +28>Emitted(60, 302) Source(86, 37) + SourceIndex(0) +29>Emitted(60, 304) Source(86, 39) + SourceIndex(0) +30>Emitted(60, 306) Source(86, 41) + SourceIndex(0) --- >>> console.log(nameMA_1); 1 >^^^^ @@ -2230,7 +2035,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2249,134 +2054,122 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(61, 27) Source(87, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(62, 1) Source(88, 1) + SourceIndex(0) -2 >Emitted(62, 2) Source(88, 2) + SourceIndex(0) + >} +1 >Emitted(62, 2) Source(88, 2) + SourceIndex(0) --- >>>for (_21 = getMultiRobot(), _22 = _21[0], nameMA = _22 === void 0 ? "noName" : _22, _23 = _21[1], _24 = _23 === void 0 ? ["none", "none"] : _23, _25 = _24[0], primarySkillA = _25 === void 0 ? "primary" : _25, _26 = _24[1], secondarySkillA = _26 === void 0 ? "secondary" : _26, _21, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -22> ^^^^^^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^^ -29> ^ -30> ^^ -31> ^ -32> ^^ -33> ^^ -34> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^^^^^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameMA = "noName", +2 >for ( +3 > [nameMA = "noName", > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] > ] = getMultiRobot() -6 > -7 > nameMA = "noName" -8 > -9 > nameMA = "noName" -10> , +4 > +5 > nameMA = "noName" +6 > +7 > nameMA = "noName" +8 > , > -11> [ +9 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -12> -13> [ +10> +11> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -14> -15> primarySkillA = "primary" -16> -17> primarySkillA = "primary" -18> , +12> +13> primarySkillA = "primary" +14> +15> primarySkillA = "primary" +16> , > -19> secondarySkillA = "secondary" -20> -21> secondarySkillA = "secondary" -22> +17> secondarySkillA = "secondary" +18> +19> secondarySkillA = "secondary" +20> > ] = ["none", "none"] > ] = getMultiRobot(), -23> i -24> = -25> 0 -26> ; -27> i -28> < -29> 1 -30> ; -31> i -32> ++ -33> ) -34> { +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) 1->Emitted(63, 1) Source(89, 1) + SourceIndex(0) -2 >Emitted(63, 4) Source(89, 4) + SourceIndex(0) -3 >Emitted(63, 5) Source(89, 5) + SourceIndex(0) -4 >Emitted(63, 6) Source(89, 6) + SourceIndex(0) -5 >Emitted(63, 27) Source(94, 20) + SourceIndex(0) -6 >Emitted(63, 29) Source(89, 7) + SourceIndex(0) -7 >Emitted(63, 41) Source(89, 24) + SourceIndex(0) -8 >Emitted(63, 43) Source(89, 7) + SourceIndex(0) -9 >Emitted(63, 83) Source(89, 24) + SourceIndex(0) -10>Emitted(63, 85) Source(90, 5) + SourceIndex(0) -11>Emitted(63, 97) Source(93, 25) + SourceIndex(0) -12>Emitted(63, 99) Source(90, 5) + SourceIndex(0) -13>Emitted(63, 144) Source(93, 25) + SourceIndex(0) -14>Emitted(63, 146) Source(91, 9) + SourceIndex(0) -15>Emitted(63, 158) Source(91, 34) + SourceIndex(0) -16>Emitted(63, 160) Source(91, 9) + SourceIndex(0) -17>Emitted(63, 208) Source(91, 34) + SourceIndex(0) -18>Emitted(63, 210) Source(92, 9) + SourceIndex(0) -19>Emitted(63, 222) Source(92, 38) + SourceIndex(0) -20>Emitted(63, 224) Source(92, 9) + SourceIndex(0) -21>Emitted(63, 276) Source(92, 38) + SourceIndex(0) -22>Emitted(63, 283) Source(94, 22) + SourceIndex(0) -23>Emitted(63, 284) Source(94, 23) + SourceIndex(0) -24>Emitted(63, 287) Source(94, 26) + SourceIndex(0) -25>Emitted(63, 288) Source(94, 27) + SourceIndex(0) -26>Emitted(63, 290) Source(94, 29) + SourceIndex(0) -27>Emitted(63, 291) Source(94, 30) + SourceIndex(0) -28>Emitted(63, 294) Source(94, 33) + SourceIndex(0) -29>Emitted(63, 295) Source(94, 34) + SourceIndex(0) -30>Emitted(63, 297) Source(94, 36) + SourceIndex(0) -31>Emitted(63, 298) Source(94, 37) + SourceIndex(0) -32>Emitted(63, 300) Source(94, 39) + SourceIndex(0) -33>Emitted(63, 302) Source(94, 41) + SourceIndex(0) -34>Emitted(63, 303) Source(94, 42) + SourceIndex(0) +2 >Emitted(63, 6) Source(89, 6) + SourceIndex(0) +3 >Emitted(63, 27) Source(94, 20) + SourceIndex(0) +4 >Emitted(63, 29) Source(89, 7) + SourceIndex(0) +5 >Emitted(63, 41) Source(89, 24) + SourceIndex(0) +6 >Emitted(63, 43) Source(89, 7) + SourceIndex(0) +7 >Emitted(63, 83) Source(89, 24) + SourceIndex(0) +8 >Emitted(63, 85) Source(90, 5) + SourceIndex(0) +9 >Emitted(63, 97) Source(93, 25) + SourceIndex(0) +10>Emitted(63, 99) Source(90, 5) + SourceIndex(0) +11>Emitted(63, 144) Source(93, 25) + SourceIndex(0) +12>Emitted(63, 146) Source(91, 9) + SourceIndex(0) +13>Emitted(63, 158) Source(91, 34) + SourceIndex(0) +14>Emitted(63, 160) Source(91, 9) + SourceIndex(0) +15>Emitted(63, 208) Source(91, 34) + SourceIndex(0) +16>Emitted(63, 210) Source(92, 9) + SourceIndex(0) +17>Emitted(63, 222) Source(92, 38) + SourceIndex(0) +18>Emitted(63, 224) Source(92, 9) + SourceIndex(0) +19>Emitted(63, 276) Source(92, 38) + SourceIndex(0) +20>Emitted(63, 283) Source(94, 22) + SourceIndex(0) +21>Emitted(63, 284) Source(94, 23) + SourceIndex(0) +22>Emitted(63, 287) Source(94, 26) + SourceIndex(0) +23>Emitted(63, 288) Source(94, 27) + SourceIndex(0) +24>Emitted(63, 290) Source(94, 29) + SourceIndex(0) +25>Emitted(63, 291) Source(94, 30) + SourceIndex(0) +26>Emitted(63, 294) Source(94, 33) + SourceIndex(0) +27>Emitted(63, 295) Source(94, 34) + SourceIndex(0) +28>Emitted(63, 297) Source(94, 36) + SourceIndex(0) +29>Emitted(63, 298) Source(94, 37) + SourceIndex(0) +30>Emitted(63, 300) Source(94, 39) + SourceIndex(0) +31>Emitted(63, 302) Source(94, 41) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2387,7 +2180,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2406,134 +2199,122 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(64, 25) Source(95, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(65, 1) Source(96, 1) + SourceIndex(0) -2 >Emitted(65, 2) Source(96, 2) + SourceIndex(0) + >} +1 >Emitted(65, 2) Source(96, 2) + SourceIndex(0) --- >>>for (_27 = ["trimmer", ["trimming", "edging"]], _28 = _27[0], nameMA = _28 === void 0 ? "noName" : _28, _29 = _27[1], _30 = _29 === void 0 ? ["none", "none"] : _29, _31 = _30[0], primarySkillA = _31 === void 0 ? "primary" : _31, _32 = _30[1], secondarySkillA = _32 === void 0 ? "secondary" : _32, _27, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -22> ^^^^^^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^^ -29> ^ -30> ^^ -31> ^ -32> ^^ -33> ^^ -34> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^^^^^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [nameMA = "noName", +2 >for ( +3 > [nameMA = "noName", > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] > ] = ["trimmer", ["trimming", "edging"]] -6 > -7 > nameMA = "noName" -8 > -9 > nameMA = "noName" -10> , +4 > +5 > nameMA = "noName" +6 > +7 > nameMA = "noName" +8 > , > -11> [ +9 > [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -12> -13> [ +10> +11> [ > primarySkillA = "primary", > secondarySkillA = "secondary" > ] = ["none", "none"] -14> -15> primarySkillA = "primary" -16> -17> primarySkillA = "primary" -18> , +12> +13> primarySkillA = "primary" +14> +15> primarySkillA = "primary" +16> , > -19> secondarySkillA = "secondary" -20> -21> secondarySkillA = "secondary" -22> +17> secondarySkillA = "secondary" +18> +19> secondarySkillA = "secondary" +20> > ] = ["none", "none"] > ] = ["trimmer", ["trimming", "edging"]], -23> i -24> = -25> 0 -26> ; -27> i -28> < -29> 1 -30> ; -31> i -32> ++ -33> ) -34> { +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) 1->Emitted(66, 1) Source(97, 1) + SourceIndex(0) -2 >Emitted(66, 4) Source(97, 4) + SourceIndex(0) -3 >Emitted(66, 5) Source(97, 5) + SourceIndex(0) -4 >Emitted(66, 6) Source(97, 6) + SourceIndex(0) -5 >Emitted(66, 47) Source(102, 40) + SourceIndex(0) -6 >Emitted(66, 49) Source(97, 7) + SourceIndex(0) -7 >Emitted(66, 61) Source(97, 24) + SourceIndex(0) -8 >Emitted(66, 63) Source(97, 7) + SourceIndex(0) -9 >Emitted(66, 103) Source(97, 24) + SourceIndex(0) -10>Emitted(66, 105) Source(98, 5) + SourceIndex(0) -11>Emitted(66, 117) Source(101, 25) + SourceIndex(0) -12>Emitted(66, 119) Source(98, 5) + SourceIndex(0) -13>Emitted(66, 164) Source(101, 25) + SourceIndex(0) -14>Emitted(66, 166) Source(99, 9) + SourceIndex(0) -15>Emitted(66, 178) Source(99, 34) + SourceIndex(0) -16>Emitted(66, 180) Source(99, 9) + SourceIndex(0) -17>Emitted(66, 228) Source(99, 34) + SourceIndex(0) -18>Emitted(66, 230) Source(100, 9) + SourceIndex(0) -19>Emitted(66, 242) Source(100, 38) + SourceIndex(0) -20>Emitted(66, 244) Source(100, 9) + SourceIndex(0) -21>Emitted(66, 296) Source(100, 38) + SourceIndex(0) -22>Emitted(66, 303) Source(102, 42) + SourceIndex(0) -23>Emitted(66, 304) Source(102, 43) + SourceIndex(0) -24>Emitted(66, 307) Source(102, 46) + SourceIndex(0) -25>Emitted(66, 308) Source(102, 47) + SourceIndex(0) -26>Emitted(66, 310) Source(102, 49) + SourceIndex(0) -27>Emitted(66, 311) Source(102, 50) + SourceIndex(0) -28>Emitted(66, 314) Source(102, 53) + SourceIndex(0) -29>Emitted(66, 315) Source(102, 54) + SourceIndex(0) -30>Emitted(66, 317) Source(102, 56) + SourceIndex(0) -31>Emitted(66, 318) Source(102, 57) + SourceIndex(0) -32>Emitted(66, 320) Source(102, 59) + SourceIndex(0) -33>Emitted(66, 322) Source(102, 61) + SourceIndex(0) -34>Emitted(66, 323) Source(102, 62) + SourceIndex(0) +2 >Emitted(66, 6) Source(97, 6) + SourceIndex(0) +3 >Emitted(66, 47) Source(102, 40) + SourceIndex(0) +4 >Emitted(66, 49) Source(97, 7) + SourceIndex(0) +5 >Emitted(66, 61) Source(97, 24) + SourceIndex(0) +6 >Emitted(66, 63) Source(97, 7) + SourceIndex(0) +7 >Emitted(66, 103) Source(97, 24) + SourceIndex(0) +8 >Emitted(66, 105) Source(98, 5) + SourceIndex(0) +9 >Emitted(66, 117) Source(101, 25) + SourceIndex(0) +10>Emitted(66, 119) Source(98, 5) + SourceIndex(0) +11>Emitted(66, 164) Source(101, 25) + SourceIndex(0) +12>Emitted(66, 166) Source(99, 9) + SourceIndex(0) +13>Emitted(66, 178) Source(99, 34) + SourceIndex(0) +14>Emitted(66, 180) Source(99, 9) + SourceIndex(0) +15>Emitted(66, 228) Source(99, 34) + SourceIndex(0) +16>Emitted(66, 230) Source(100, 9) + SourceIndex(0) +17>Emitted(66, 242) Source(100, 38) + SourceIndex(0) +18>Emitted(66, 244) Source(100, 9) + SourceIndex(0) +19>Emitted(66, 296) Source(100, 38) + SourceIndex(0) +20>Emitted(66, 303) Source(102, 42) + SourceIndex(0) +21>Emitted(66, 304) Source(102, 43) + SourceIndex(0) +22>Emitted(66, 307) Source(102, 46) + SourceIndex(0) +23>Emitted(66, 308) Source(102, 47) + SourceIndex(0) +24>Emitted(66, 310) Source(102, 49) + SourceIndex(0) +25>Emitted(66, 311) Source(102, 50) + SourceIndex(0) +26>Emitted(66, 314) Source(102, 53) + SourceIndex(0) +27>Emitted(66, 315) Source(102, 54) + SourceIndex(0) +28>Emitted(66, 317) Source(102, 56) + SourceIndex(0) +29>Emitted(66, 318) Source(102, 57) + SourceIndex(0) +30>Emitted(66, 320) Source(102, 59) + SourceIndex(0) +31>Emitted(66, 322) Source(102, 61) + SourceIndex(0) --- >>> console.log(nameMA); 1 >^^^^ @@ -2544,7 +2325,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2563,90 +2344,78 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(67, 25) Source(103, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(68, 1) Source(104, 1) + SourceIndex(0) -2 >Emitted(68, 2) Source(104, 2) + SourceIndex(0) + >} +1 >Emitted(68, 2) Source(104, 2) + SourceIndex(0) --- >>>for (_33 = robotA[0], numberA3 = _33 === void 0 ? -1 : _33, robotAInfo = robotA.slice(1), robotA, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > > -2 >for -3 > -4 > ([ -5 > numberA3 = -1 -6 > -7 > numberA3 = -1 -8 > , -9 > ...robotAInfo -10> ] = -11> robotA -12> , -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ([ +3 > numberA3 = -1 +4 > +5 > numberA3 = -1 +6 > , +7 > ...robotAInfo +8 > ] = +9 > robotA +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(69, 1) Source(106, 1) + SourceIndex(0) -2 >Emitted(69, 4) Source(106, 4) + SourceIndex(0) -3 >Emitted(69, 5) Source(106, 5) + SourceIndex(0) -4 >Emitted(69, 6) Source(106, 7) + SourceIndex(0) -5 >Emitted(69, 21) Source(106, 20) + SourceIndex(0) -6 >Emitted(69, 23) Source(106, 7) + SourceIndex(0) -7 >Emitted(69, 59) Source(106, 20) + SourceIndex(0) -8 >Emitted(69, 61) Source(106, 22) + SourceIndex(0) -9 >Emitted(69, 89) Source(106, 35) + SourceIndex(0) -10>Emitted(69, 91) Source(106, 39) + SourceIndex(0) -11>Emitted(69, 97) Source(106, 45) + SourceIndex(0) -12>Emitted(69, 99) Source(106, 47) + SourceIndex(0) -13>Emitted(69, 100) Source(106, 48) + SourceIndex(0) -14>Emitted(69, 103) Source(106, 51) + SourceIndex(0) -15>Emitted(69, 104) Source(106, 52) + SourceIndex(0) -16>Emitted(69, 106) Source(106, 54) + SourceIndex(0) -17>Emitted(69, 107) Source(106, 55) + SourceIndex(0) -18>Emitted(69, 110) Source(106, 58) + SourceIndex(0) -19>Emitted(69, 111) Source(106, 59) + SourceIndex(0) -20>Emitted(69, 113) Source(106, 61) + SourceIndex(0) -21>Emitted(69, 114) Source(106, 62) + SourceIndex(0) -22>Emitted(69, 116) Source(106, 64) + SourceIndex(0) -23>Emitted(69, 118) Source(106, 66) + SourceIndex(0) -24>Emitted(69, 119) Source(106, 67) + SourceIndex(0) +2 >Emitted(69, 6) Source(106, 7) + SourceIndex(0) +3 >Emitted(69, 21) Source(106, 20) + SourceIndex(0) +4 >Emitted(69, 23) Source(106, 7) + SourceIndex(0) +5 >Emitted(69, 59) Source(106, 20) + SourceIndex(0) +6 >Emitted(69, 61) Source(106, 22) + SourceIndex(0) +7 >Emitted(69, 89) Source(106, 35) + SourceIndex(0) +8 >Emitted(69, 91) Source(106, 39) + SourceIndex(0) +9 >Emitted(69, 97) Source(106, 45) + SourceIndex(0) +10>Emitted(69, 99) Source(106, 47) + SourceIndex(0) +11>Emitted(69, 100) Source(106, 48) + SourceIndex(0) +12>Emitted(69, 103) Source(106, 51) + SourceIndex(0) +13>Emitted(69, 104) Source(106, 52) + SourceIndex(0) +14>Emitted(69, 106) Source(106, 54) + SourceIndex(0) +15>Emitted(69, 107) Source(106, 55) + SourceIndex(0) +16>Emitted(69, 110) Source(106, 58) + SourceIndex(0) +17>Emitted(69, 111) Source(106, 59) + SourceIndex(0) +18>Emitted(69, 113) Source(106, 61) + SourceIndex(0) +19>Emitted(69, 114) Source(106, 62) + SourceIndex(0) +20>Emitted(69, 116) Source(106, 64) + SourceIndex(0) +21>Emitted(69, 118) Source(106, 66) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2657,7 +2426,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2676,89 +2445,77 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(70, 27) Source(107, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(71, 1) Source(108, 1) + SourceIndex(0) -2 >Emitted(71, 2) Source(108, 2) + SourceIndex(0) + >} +1 >Emitted(71, 2) Source(108, 2) + SourceIndex(0) --- >>>for (_34 = getRobot(), _35 = _34[0], numberA3 = _35 === void 0 ? -1 : _35, robotAInfo = _34.slice(1), _34, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA3 = -1, ...robotAInfo] = getRobot() -6 > -7 > numberA3 = -1 -8 > -9 > numberA3 = -1 -10> , -11> ...robotAInfo -12> ] = getRobot(), -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > [numberA3 = -1, ...robotAInfo] = getRobot() +4 > +5 > numberA3 = -1 +6 > +7 > numberA3 = -1 +8 > , +9 > ...robotAInfo +10> ] = getRobot(), +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(72, 1) Source(109, 1) + SourceIndex(0) -2 >Emitted(72, 4) Source(109, 4) + SourceIndex(0) -3 >Emitted(72, 5) Source(109, 5) + SourceIndex(0) -4 >Emitted(72, 6) Source(109, 6) + SourceIndex(0) -5 >Emitted(72, 22) Source(109, 49) + SourceIndex(0) -6 >Emitted(72, 24) Source(109, 7) + SourceIndex(0) -7 >Emitted(72, 36) Source(109, 20) + SourceIndex(0) -8 >Emitted(72, 38) Source(109, 7) + SourceIndex(0) -9 >Emitted(72, 74) Source(109, 20) + SourceIndex(0) -10>Emitted(72, 76) Source(109, 22) + SourceIndex(0) -11>Emitted(72, 101) Source(109, 35) + SourceIndex(0) -12>Emitted(72, 108) Source(109, 51) + SourceIndex(0) -13>Emitted(72, 109) Source(109, 52) + SourceIndex(0) -14>Emitted(72, 112) Source(109, 55) + SourceIndex(0) -15>Emitted(72, 113) Source(109, 56) + SourceIndex(0) -16>Emitted(72, 115) Source(109, 58) + SourceIndex(0) -17>Emitted(72, 116) Source(109, 59) + SourceIndex(0) -18>Emitted(72, 119) Source(109, 62) + SourceIndex(0) -19>Emitted(72, 120) Source(109, 63) + SourceIndex(0) -20>Emitted(72, 122) Source(109, 65) + SourceIndex(0) -21>Emitted(72, 123) Source(109, 66) + SourceIndex(0) -22>Emitted(72, 125) Source(109, 68) + SourceIndex(0) -23>Emitted(72, 127) Source(109, 70) + SourceIndex(0) -24>Emitted(72, 128) Source(109, 71) + SourceIndex(0) +2 >Emitted(72, 6) Source(109, 6) + SourceIndex(0) +3 >Emitted(72, 22) Source(109, 49) + SourceIndex(0) +4 >Emitted(72, 24) Source(109, 7) + SourceIndex(0) +5 >Emitted(72, 36) Source(109, 20) + SourceIndex(0) +6 >Emitted(72, 38) Source(109, 7) + SourceIndex(0) +7 >Emitted(72, 74) Source(109, 20) + SourceIndex(0) +8 >Emitted(72, 76) Source(109, 22) + SourceIndex(0) +9 >Emitted(72, 101) Source(109, 35) + SourceIndex(0) +10>Emitted(72, 108) Source(109, 51) + SourceIndex(0) +11>Emitted(72, 109) Source(109, 52) + SourceIndex(0) +12>Emitted(72, 112) Source(109, 55) + SourceIndex(0) +13>Emitted(72, 113) Source(109, 56) + SourceIndex(0) +14>Emitted(72, 115) Source(109, 58) + SourceIndex(0) +15>Emitted(72, 116) Source(109, 59) + SourceIndex(0) +16>Emitted(72, 119) Source(109, 62) + SourceIndex(0) +17>Emitted(72, 120) Source(109, 63) + SourceIndex(0) +18>Emitted(72, 122) Source(109, 65) + SourceIndex(0) +19>Emitted(72, 123) Source(109, 66) + SourceIndex(0) +20>Emitted(72, 125) Source(109, 68) + SourceIndex(0) +21>Emitted(72, 127) Source(109, 70) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2769,7 +2526,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2788,89 +2545,77 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(73, 27) Source(110, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(74, 1) Source(111, 1) + SourceIndex(0) -2 >Emitted(74, 2) Source(111, 2) + SourceIndex(0) + >} +1 >Emitted(74, 2) Source(111, 2) + SourceIndex(0) --- >>>for (_36 = [2, "trimmer", "trimming"], _37 = _36[0], numberA3 = _37 === void 0 ? -1 : _37, robotAInfo = _36.slice(1), _36, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] -6 > -7 > numberA3 = -1 -8 > -9 > numberA3 = -1 -10> , -11> ...robotAInfo -12> ] = [2, "trimmer", "trimming"], -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > [numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"] +4 > +5 > numberA3 = -1 +6 > +7 > numberA3 = -1 +8 > , +9 > ...robotAInfo +10> ] = [2, "trimmer", "trimming"], +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(75, 1) Source(112, 1) + SourceIndex(0) -2 >Emitted(75, 4) Source(112, 4) + SourceIndex(0) -3 >Emitted(75, 5) Source(112, 5) + SourceIndex(0) -4 >Emitted(75, 6) Source(112, 6) + SourceIndex(0) -5 >Emitted(75, 38) Source(112, 72) + SourceIndex(0) -6 >Emitted(75, 40) Source(112, 7) + SourceIndex(0) -7 >Emitted(75, 52) Source(112, 20) + SourceIndex(0) -8 >Emitted(75, 54) Source(112, 7) + SourceIndex(0) -9 >Emitted(75, 90) Source(112, 20) + SourceIndex(0) -10>Emitted(75, 92) Source(112, 22) + SourceIndex(0) -11>Emitted(75, 117) Source(112, 35) + SourceIndex(0) -12>Emitted(75, 124) Source(112, 74) + SourceIndex(0) -13>Emitted(75, 125) Source(112, 75) + SourceIndex(0) -14>Emitted(75, 128) Source(112, 78) + SourceIndex(0) -15>Emitted(75, 129) Source(112, 79) + SourceIndex(0) -16>Emitted(75, 131) Source(112, 81) + SourceIndex(0) -17>Emitted(75, 132) Source(112, 82) + SourceIndex(0) -18>Emitted(75, 135) Source(112, 85) + SourceIndex(0) -19>Emitted(75, 136) Source(112, 86) + SourceIndex(0) -20>Emitted(75, 138) Source(112, 88) + SourceIndex(0) -21>Emitted(75, 139) Source(112, 89) + SourceIndex(0) -22>Emitted(75, 141) Source(112, 91) + SourceIndex(0) -23>Emitted(75, 143) Source(112, 93) + SourceIndex(0) -24>Emitted(75, 144) Source(112, 94) + SourceIndex(0) +2 >Emitted(75, 6) Source(112, 6) + SourceIndex(0) +3 >Emitted(75, 38) Source(112, 72) + SourceIndex(0) +4 >Emitted(75, 40) Source(112, 7) + SourceIndex(0) +5 >Emitted(75, 52) Source(112, 20) + SourceIndex(0) +6 >Emitted(75, 54) Source(112, 7) + SourceIndex(0) +7 >Emitted(75, 90) Source(112, 20) + SourceIndex(0) +8 >Emitted(75, 92) Source(112, 22) + SourceIndex(0) +9 >Emitted(75, 117) Source(112, 35) + SourceIndex(0) +10>Emitted(75, 124) Source(112, 74) + SourceIndex(0) +11>Emitted(75, 125) Source(112, 75) + SourceIndex(0) +12>Emitted(75, 128) Source(112, 78) + SourceIndex(0) +13>Emitted(75, 129) Source(112, 79) + SourceIndex(0) +14>Emitted(75, 131) Source(112, 81) + SourceIndex(0) +15>Emitted(75, 132) Source(112, 82) + SourceIndex(0) +16>Emitted(75, 135) Source(112, 85) + SourceIndex(0) +17>Emitted(75, 136) Source(112, 86) + SourceIndex(0) +18>Emitted(75, 138) Source(112, 88) + SourceIndex(0) +19>Emitted(75, 139) Source(112, 89) + SourceIndex(0) +20>Emitted(75, 141) Source(112, 91) + SourceIndex(0) +21>Emitted(75, 143) Source(112, 93) + SourceIndex(0) --- >>> console.log(numberA3); 1 >^^^^ @@ -2881,7 +2626,7 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2900,14 +2645,11 @@ sourceFile:sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2. 8 >Emitted(76, 27) Source(113, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(77, 1) Source(114, 1) + SourceIndex(0) -2 >Emitted(77, 2) Source(114, 2) + SourceIndex(0) + >} +1 >Emitted(77, 2) Source(114, 2) + SourceIndex(0) --- >>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37; >>>//# sourceMappingURL=sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map index a0295550f0b..8ab0fd1faa5 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,kBAAW,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,uBAAW,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,mDAAW,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAO,IAAA,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAO,IAAA,2BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAO,IAAA,qFAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAEzD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,kBAAW,EAAE,oBAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAA0C,EAAzC,eAAW,EAAE,iBAAa,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,2CAA6E,EAA5E,eAAW,EAAE,iBAAa,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,uBAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,oBAAsF,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjH,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,8EACgF,EAD/E,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAErE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;IACI,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,KAAU,IAAA,kBAAW,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,uBAAW,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,mDAAW,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAW,IAAA,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/F,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAW,IAAA,2BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAW,IAAA,qFAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAEzD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,KAAU,IAAA,kBAAW,EAAE,oBAAa,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,eAA0C,EAAzC,eAAW,EAAE,iBAAa,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,2CAA6E,EAA5E,eAAW,EAAE,iBAAa,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACvG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,uBAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAmB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC3G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,oBAAsF,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChH,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,8EACgF,EAD/E,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAErE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt index 5ea0b7e360d..fd27abea9d7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.sourcemap.txt @@ -147,21 +147,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts --- >>> return robot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robot -5 > ; +2 > return +3 > robot +4 > ; 1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) -2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) -3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) -4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) -5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +2 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +4 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) --- >>>} 1 > @@ -182,21 +179,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts --- >>> return multiRobot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobot -5 > ; +2 > return +3 > multiRobot +4 > ; 1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) -2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) -3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) -4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) -5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +2 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +3 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +4 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) --- >>>} 1 > @@ -210,64 +204,55 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts --- >>>for (var nameA = robot.name, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA -7 > } = robot, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let { +3 > +4 > name: nameA +5 > } = robot, +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(9, 4) Source(26, 4) + SourceIndex(0) -3 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) -4 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) -5 >Emitted(9, 10) Source(26, 11) + SourceIndex(0) -6 >Emitted(9, 28) Source(26, 22) + SourceIndex(0) -7 >Emitted(9, 30) Source(26, 34) + SourceIndex(0) -8 >Emitted(9, 31) Source(26, 35) + SourceIndex(0) -9 >Emitted(9, 34) Source(26, 38) + SourceIndex(0) -10>Emitted(9, 35) Source(26, 39) + SourceIndex(0) -11>Emitted(9, 37) Source(26, 41) + SourceIndex(0) -12>Emitted(9, 38) Source(26, 42) + SourceIndex(0) -13>Emitted(9, 41) Source(26, 45) + SourceIndex(0) -14>Emitted(9, 42) Source(26, 46) + SourceIndex(0) -15>Emitted(9, 44) Source(26, 48) + SourceIndex(0) -16>Emitted(9, 45) Source(26, 49) + SourceIndex(0) -17>Emitted(9, 47) Source(26, 51) + SourceIndex(0) -18>Emitted(9, 49) Source(26, 53) + SourceIndex(0) -19>Emitted(9, 50) Source(26, 54) + SourceIndex(0) +2 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) +3 >Emitted(9, 10) Source(26, 11) + SourceIndex(0) +4 >Emitted(9, 28) Source(26, 22) + SourceIndex(0) +5 >Emitted(9, 30) Source(26, 34) + SourceIndex(0) +6 >Emitted(9, 31) Source(26, 35) + SourceIndex(0) +7 >Emitted(9, 34) Source(26, 38) + SourceIndex(0) +8 >Emitted(9, 35) Source(26, 39) + SourceIndex(0) +9 >Emitted(9, 37) Source(26, 41) + SourceIndex(0) +10>Emitted(9, 38) Source(26, 42) + SourceIndex(0) +11>Emitted(9, 41) Source(26, 45) + SourceIndex(0) +12>Emitted(9, 42) Source(26, 46) + SourceIndex(0) +13>Emitted(9, 44) Source(26, 48) + SourceIndex(0) +14>Emitted(9, 45) Source(26, 49) + SourceIndex(0) +15>Emitted(9, 47) Source(26, 51) + SourceIndex(0) +16>Emitted(9, 49) Source(26, 53) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -278,7 +263,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -297,74 +282,62 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(10, 24) Source(27, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(11, 1) Source(28, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) + >} +1 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) --- >>>for (var nameA = getRobot().name, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA -7 > } = getRobot(), -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let { +3 > +4 > name: nameA +5 > } = getRobot(), +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(12, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(12, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(12, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) -5 >Emitted(12, 10) Source(29, 11) + SourceIndex(0) -6 >Emitted(12, 33) Source(29, 22) + SourceIndex(0) -7 >Emitted(12, 35) Source(29, 39) + SourceIndex(0) -8 >Emitted(12, 36) Source(29, 40) + SourceIndex(0) -9 >Emitted(12, 39) Source(29, 43) + SourceIndex(0) -10>Emitted(12, 40) Source(29, 44) + SourceIndex(0) -11>Emitted(12, 42) Source(29, 46) + SourceIndex(0) -12>Emitted(12, 43) Source(29, 47) + SourceIndex(0) -13>Emitted(12, 46) Source(29, 50) + SourceIndex(0) -14>Emitted(12, 47) Source(29, 51) + SourceIndex(0) -15>Emitted(12, 49) Source(29, 53) + SourceIndex(0) -16>Emitted(12, 50) Source(29, 54) + SourceIndex(0) -17>Emitted(12, 52) Source(29, 56) + SourceIndex(0) -18>Emitted(12, 54) Source(29, 58) + SourceIndex(0) -19>Emitted(12, 55) Source(29, 59) + SourceIndex(0) +2 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) +3 >Emitted(12, 10) Source(29, 11) + SourceIndex(0) +4 >Emitted(12, 33) Source(29, 22) + SourceIndex(0) +5 >Emitted(12, 35) Source(29, 39) + SourceIndex(0) +6 >Emitted(12, 36) Source(29, 40) + SourceIndex(0) +7 >Emitted(12, 39) Source(29, 43) + SourceIndex(0) +8 >Emitted(12, 40) Source(29, 44) + SourceIndex(0) +9 >Emitted(12, 42) Source(29, 46) + SourceIndex(0) +10>Emitted(12, 43) Source(29, 47) + SourceIndex(0) +11>Emitted(12, 46) Source(29, 50) + SourceIndex(0) +12>Emitted(12, 47) Source(29, 51) + SourceIndex(0) +13>Emitted(12, 49) Source(29, 53) + SourceIndex(0) +14>Emitted(12, 50) Source(29, 54) + SourceIndex(0) +15>Emitted(12, 52) Source(29, 56) + SourceIndex(0) +16>Emitted(12, 54) Source(29, 58) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -375,7 +348,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -394,74 +367,62 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(13, 24) Source(30, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) + >} +1 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) --- >>>for (var nameA = { name: "trimmer", skill: "trimming" }.name, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^ -18> ^^ -19> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^ +16> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA -7 > } = { name: "trimmer", skill: "trimming" }, -8 > i -9 > = -10> 0 -11> ; -12> i -13> < -14> 1 -15> ; -16> i -17> ++ -18> ) -19> { +2 >for (let { +3 > +4 > name: nameA +5 > } = { name: "trimmer", skill: "trimming" }, +6 > i +7 > = +8 > 0 +9 > ; +10> i +11> < +12> 1 +13> ; +14> i +15> ++ +16> ) 1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) -5 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) -6 >Emitted(15, 61) Source(32, 22) + SourceIndex(0) -7 >Emitted(15, 63) Source(32, 74) + SourceIndex(0) -8 >Emitted(15, 64) Source(32, 75) + SourceIndex(0) -9 >Emitted(15, 67) Source(32, 78) + SourceIndex(0) -10>Emitted(15, 68) Source(32, 79) + SourceIndex(0) -11>Emitted(15, 70) Source(32, 81) + SourceIndex(0) -12>Emitted(15, 71) Source(32, 82) + SourceIndex(0) -13>Emitted(15, 74) Source(32, 85) + SourceIndex(0) -14>Emitted(15, 75) Source(32, 86) + SourceIndex(0) -15>Emitted(15, 77) Source(32, 88) + SourceIndex(0) -16>Emitted(15, 78) Source(32, 89) + SourceIndex(0) -17>Emitted(15, 80) Source(32, 91) + SourceIndex(0) -18>Emitted(15, 82) Source(32, 93) + SourceIndex(0) -19>Emitted(15, 83) Source(32, 94) + SourceIndex(0) +2 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) +3 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) +4 >Emitted(15, 61) Source(32, 22) + SourceIndex(0) +5 >Emitted(15, 63) Source(32, 74) + SourceIndex(0) +6 >Emitted(15, 64) Source(32, 75) + SourceIndex(0) +7 >Emitted(15, 67) Source(32, 78) + SourceIndex(0) +8 >Emitted(15, 68) Source(32, 79) + SourceIndex(0) +9 >Emitted(15, 70) Source(32, 81) + SourceIndex(0) +10>Emitted(15, 71) Source(32, 82) + SourceIndex(0) +11>Emitted(15, 74) Source(32, 85) + SourceIndex(0) +12>Emitted(15, 75) Source(32, 86) + SourceIndex(0) +13>Emitted(15, 77) Source(32, 88) + SourceIndex(0) +14>Emitted(15, 78) Source(32, 89) + SourceIndex(0) +15>Emitted(15, 80) Source(32, 91) + SourceIndex(0) +16>Emitted(15, 82) Source(32, 93) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -472,7 +433,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -491,86 +452,74 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(17, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) + >} +1 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) --- >>>for (var _a = multiRobot.skills, primaryA = _a.primary, secondaryA = _a.secondary, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > skills: { primary: primaryA, secondary: secondaryA } -7 > -8 > primary: primaryA -9 > , -10> secondary: secondaryA -11> } } = multiRobot, -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let { +3 > +4 > skills: { primary: primaryA, secondary: secondaryA } +5 > +6 > primary: primaryA +7 > , +8 > secondary: secondaryA +9 > } } = multiRobot, +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(18, 6) Source(35, 12) + SourceIndex(0) -5 >Emitted(18, 10) Source(35, 12) + SourceIndex(0) -6 >Emitted(18, 32) Source(35, 64) + SourceIndex(0) -7 >Emitted(18, 34) Source(35, 22) + SourceIndex(0) -8 >Emitted(18, 55) Source(35, 39) + SourceIndex(0) -9 >Emitted(18, 57) Source(35, 41) + SourceIndex(0) -10>Emitted(18, 82) Source(35, 62) + SourceIndex(0) -11>Emitted(18, 84) Source(35, 81) + SourceIndex(0) -12>Emitted(18, 85) Source(35, 82) + SourceIndex(0) -13>Emitted(18, 88) Source(35, 85) + SourceIndex(0) -14>Emitted(18, 89) Source(35, 86) + SourceIndex(0) -15>Emitted(18, 91) Source(35, 88) + SourceIndex(0) -16>Emitted(18, 92) Source(35, 89) + SourceIndex(0) -17>Emitted(18, 95) Source(35, 92) + SourceIndex(0) -18>Emitted(18, 96) Source(35, 93) + SourceIndex(0) -19>Emitted(18, 98) Source(35, 95) + SourceIndex(0) -20>Emitted(18, 99) Source(35, 96) + SourceIndex(0) -21>Emitted(18, 101) Source(35, 98) + SourceIndex(0) -22>Emitted(18, 103) Source(35, 100) + SourceIndex(0) -23>Emitted(18, 104) Source(35, 101) + SourceIndex(0) +2 >Emitted(18, 6) Source(35, 12) + SourceIndex(0) +3 >Emitted(18, 10) Source(35, 12) + SourceIndex(0) +4 >Emitted(18, 32) Source(35, 64) + SourceIndex(0) +5 >Emitted(18, 34) Source(35, 22) + SourceIndex(0) +6 >Emitted(18, 55) Source(35, 39) + SourceIndex(0) +7 >Emitted(18, 57) Source(35, 41) + SourceIndex(0) +8 >Emitted(18, 82) Source(35, 62) + SourceIndex(0) +9 >Emitted(18, 84) Source(35, 81) + SourceIndex(0) +10>Emitted(18, 85) Source(35, 82) + SourceIndex(0) +11>Emitted(18, 88) Source(35, 85) + SourceIndex(0) +12>Emitted(18, 89) Source(35, 86) + SourceIndex(0) +13>Emitted(18, 91) Source(35, 88) + SourceIndex(0) +14>Emitted(18, 92) Source(35, 89) + SourceIndex(0) +15>Emitted(18, 95) Source(35, 92) + SourceIndex(0) +16>Emitted(18, 96) Source(35, 93) + SourceIndex(0) +17>Emitted(18, 98) Source(35, 95) + SourceIndex(0) +18>Emitted(18, 99) Source(35, 96) + SourceIndex(0) +19>Emitted(18, 101) Source(35, 98) + SourceIndex(0) +20>Emitted(18, 103) Source(35, 100) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -581,7 +530,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -600,86 +549,74 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(19, 27) Source(36, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(20, 1) Source(37, 1) + SourceIndex(0) -2 >Emitted(20, 2) Source(37, 2) + SourceIndex(0) + >} +1 >Emitted(20, 2) Source(37, 2) + SourceIndex(0) --- >>>for (var _b = getMultiRobot().skills, primaryA = _b.primary, secondaryA = _b.secondary, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > skills: { primary: primaryA, secondary: secondaryA } -7 > -8 > primary: primaryA -9 > , -10> secondary: secondaryA -11> } } = getMultiRobot(), -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let { +3 > +4 > skills: { primary: primaryA, secondary: secondaryA } +5 > +6 > primary: primaryA +7 > , +8 > secondary: secondaryA +9 > } } = getMultiRobot(), +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(21, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(38, 12) + SourceIndex(0) -5 >Emitted(21, 10) Source(38, 12) + SourceIndex(0) -6 >Emitted(21, 37) Source(38, 64) + SourceIndex(0) -7 >Emitted(21, 39) Source(38, 22) + SourceIndex(0) -8 >Emitted(21, 60) Source(38, 39) + SourceIndex(0) -9 >Emitted(21, 62) Source(38, 41) + SourceIndex(0) -10>Emitted(21, 87) Source(38, 62) + SourceIndex(0) -11>Emitted(21, 89) Source(38, 86) + SourceIndex(0) -12>Emitted(21, 90) Source(38, 87) + SourceIndex(0) -13>Emitted(21, 93) Source(38, 90) + SourceIndex(0) -14>Emitted(21, 94) Source(38, 91) + SourceIndex(0) -15>Emitted(21, 96) Source(38, 93) + SourceIndex(0) -16>Emitted(21, 97) Source(38, 94) + SourceIndex(0) -17>Emitted(21, 100) Source(38, 97) + SourceIndex(0) -18>Emitted(21, 101) Source(38, 98) + SourceIndex(0) -19>Emitted(21, 103) Source(38, 100) + SourceIndex(0) -20>Emitted(21, 104) Source(38, 101) + SourceIndex(0) -21>Emitted(21, 106) Source(38, 103) + SourceIndex(0) -22>Emitted(21, 108) Source(38, 105) + SourceIndex(0) -23>Emitted(21, 109) Source(38, 106) + SourceIndex(0) +2 >Emitted(21, 6) Source(38, 12) + SourceIndex(0) +3 >Emitted(21, 10) Source(38, 12) + SourceIndex(0) +4 >Emitted(21, 37) Source(38, 64) + SourceIndex(0) +5 >Emitted(21, 39) Source(38, 22) + SourceIndex(0) +6 >Emitted(21, 60) Source(38, 39) + SourceIndex(0) +7 >Emitted(21, 62) Source(38, 41) + SourceIndex(0) +8 >Emitted(21, 87) Source(38, 62) + SourceIndex(0) +9 >Emitted(21, 89) Source(38, 86) + SourceIndex(0) +10>Emitted(21, 90) Source(38, 87) + SourceIndex(0) +11>Emitted(21, 93) Source(38, 90) + SourceIndex(0) +12>Emitted(21, 94) Source(38, 91) + SourceIndex(0) +13>Emitted(21, 96) Source(38, 93) + SourceIndex(0) +14>Emitted(21, 97) Source(38, 94) + SourceIndex(0) +15>Emitted(21, 100) Source(38, 97) + SourceIndex(0) +16>Emitted(21, 101) Source(38, 98) + SourceIndex(0) +17>Emitted(21, 103) Source(38, 100) + SourceIndex(0) +18>Emitted(21, 104) Source(38, 101) + SourceIndex(0) +19>Emitted(21, 106) Source(38, 103) + SourceIndex(0) +20>Emitted(21, 108) Source(38, 105) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -690,7 +627,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -709,88 +646,76 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(22, 27) Source(39, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(23, 1) Source(40, 1) + SourceIndex(0) -2 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) + >} +1 >Emitted(23, 2) Source(40, 2) + SourceIndex(0) --- >>>for (var _c = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, primaryA = _c.primary, secondaryA = _c.secondary, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > skills: { primary: primaryA, secondary: secondaryA } -7 > -8 > primary: primaryA -9 > , -10> secondary: secondaryA -11> } } = +2 >for (let { +3 > +4 > skills: { primary: primaryA, secondary: secondaryA } +5 > +6 > primary: primaryA +7 > , +8 > secondary: secondaryA +9 > } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) -3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) -4 >Emitted(24, 6) Source(41, 12) + SourceIndex(0) -5 >Emitted(24, 10) Source(41, 12) + SourceIndex(0) -6 >Emitted(24, 95) Source(41, 64) + SourceIndex(0) -7 >Emitted(24, 97) Source(41, 22) + SourceIndex(0) -8 >Emitted(24, 118) Source(41, 39) + SourceIndex(0) -9 >Emitted(24, 120) Source(41, 41) + SourceIndex(0) -10>Emitted(24, 145) Source(41, 62) + SourceIndex(0) -11>Emitted(24, 147) Source(43, 5) + SourceIndex(0) -12>Emitted(24, 148) Source(43, 6) + SourceIndex(0) -13>Emitted(24, 151) Source(43, 9) + SourceIndex(0) -14>Emitted(24, 152) Source(43, 10) + SourceIndex(0) -15>Emitted(24, 154) Source(43, 12) + SourceIndex(0) -16>Emitted(24, 155) Source(43, 13) + SourceIndex(0) -17>Emitted(24, 158) Source(43, 16) + SourceIndex(0) -18>Emitted(24, 159) Source(43, 17) + SourceIndex(0) -19>Emitted(24, 161) Source(43, 19) + SourceIndex(0) -20>Emitted(24, 162) Source(43, 20) + SourceIndex(0) -21>Emitted(24, 164) Source(43, 22) + SourceIndex(0) -22>Emitted(24, 166) Source(43, 24) + SourceIndex(0) -23>Emitted(24, 167) Source(43, 25) + SourceIndex(0) +2 >Emitted(24, 6) Source(41, 12) + SourceIndex(0) +3 >Emitted(24, 10) Source(41, 12) + SourceIndex(0) +4 >Emitted(24, 95) Source(41, 64) + SourceIndex(0) +5 >Emitted(24, 97) Source(41, 22) + SourceIndex(0) +6 >Emitted(24, 118) Source(41, 39) + SourceIndex(0) +7 >Emitted(24, 120) Source(41, 41) + SourceIndex(0) +8 >Emitted(24, 145) Source(41, 62) + SourceIndex(0) +9 >Emitted(24, 147) Source(43, 5) + SourceIndex(0) +10>Emitted(24, 148) Source(43, 6) + SourceIndex(0) +11>Emitted(24, 151) Source(43, 9) + SourceIndex(0) +12>Emitted(24, 152) Source(43, 10) + SourceIndex(0) +13>Emitted(24, 154) Source(43, 12) + SourceIndex(0) +14>Emitted(24, 155) Source(43, 13) + SourceIndex(0) +15>Emitted(24, 158) Source(43, 16) + SourceIndex(0) +16>Emitted(24, 159) Source(43, 17) + SourceIndex(0) +17>Emitted(24, 161) Source(43, 19) + SourceIndex(0) +18>Emitted(24, 162) Source(43, 20) + SourceIndex(0) +19>Emitted(24, 164) Source(43, 22) + SourceIndex(0) +20>Emitted(24, 166) Source(43, 24) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -801,7 +726,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -820,81 +745,69 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(25, 27) Source(44, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(26, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(26, 2) Source(45, 2) + SourceIndex(0) + >} +1 >Emitted(26, 2) Source(45, 2) + SourceIndex(0) --- >>>for (var nameA = robot.name, skillA = robot.skill, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA -7 > , -8 > skill: skillA -9 > } = robot, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let { +3 > +4 > name: nameA +5 > , +6 > skill: skillA +7 > } = robot, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(27, 1) Source(47, 1) + SourceIndex(0) -2 >Emitted(27, 4) Source(47, 4) + SourceIndex(0) -3 >Emitted(27, 5) Source(47, 5) + SourceIndex(0) -4 >Emitted(27, 6) Source(47, 11) + SourceIndex(0) -5 >Emitted(27, 10) Source(47, 11) + SourceIndex(0) -6 >Emitted(27, 28) Source(47, 22) + SourceIndex(0) -7 >Emitted(27, 30) Source(47, 24) + SourceIndex(0) -8 >Emitted(27, 50) Source(47, 37) + SourceIndex(0) -9 >Emitted(27, 52) Source(47, 49) + SourceIndex(0) -10>Emitted(27, 53) Source(47, 50) + SourceIndex(0) -11>Emitted(27, 56) Source(47, 53) + SourceIndex(0) -12>Emitted(27, 57) Source(47, 54) + SourceIndex(0) -13>Emitted(27, 59) Source(47, 56) + SourceIndex(0) -14>Emitted(27, 60) Source(47, 57) + SourceIndex(0) -15>Emitted(27, 63) Source(47, 60) + SourceIndex(0) -16>Emitted(27, 64) Source(47, 61) + SourceIndex(0) -17>Emitted(27, 66) Source(47, 63) + SourceIndex(0) -18>Emitted(27, 67) Source(47, 64) + SourceIndex(0) -19>Emitted(27, 69) Source(47, 66) + SourceIndex(0) -20>Emitted(27, 71) Source(47, 68) + SourceIndex(0) -21>Emitted(27, 72) Source(47, 69) + SourceIndex(0) +2 >Emitted(27, 6) Source(47, 11) + SourceIndex(0) +3 >Emitted(27, 10) Source(47, 11) + SourceIndex(0) +4 >Emitted(27, 28) Source(47, 22) + SourceIndex(0) +5 >Emitted(27, 30) Source(47, 24) + SourceIndex(0) +6 >Emitted(27, 50) Source(47, 37) + SourceIndex(0) +7 >Emitted(27, 52) Source(47, 49) + SourceIndex(0) +8 >Emitted(27, 53) Source(47, 50) + SourceIndex(0) +9 >Emitted(27, 56) Source(47, 53) + SourceIndex(0) +10>Emitted(27, 57) Source(47, 54) + SourceIndex(0) +11>Emitted(27, 59) Source(47, 56) + SourceIndex(0) +12>Emitted(27, 60) Source(47, 57) + SourceIndex(0) +13>Emitted(27, 63) Source(47, 60) + SourceIndex(0) +14>Emitted(27, 64) Source(47, 61) + SourceIndex(0) +15>Emitted(27, 66) Source(47, 63) + SourceIndex(0) +16>Emitted(27, 67) Source(47, 64) + SourceIndex(0) +17>Emitted(27, 69) Source(47, 66) + SourceIndex(0) +18>Emitted(27, 71) Source(47, 68) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -905,7 +818,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -924,86 +837,74 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(28, 24) Source(48, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(29, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(49, 2) + SourceIndex(0) + >} +1 >Emitted(29, 2) Source(49, 2) + SourceIndex(0) --- >>>for (var _d = getRobot(), nameA = _d.name, skillA = _d.skill, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > {name: nameA, skill: skillA } = getRobot() -7 > -8 > name: nameA -9 > , -10> skill: skillA -11> } = getRobot(), -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let +3 > +4 > {name: nameA, skill: skillA } = getRobot() +5 > +6 > name: nameA +7 > , +8 > skill: skillA +9 > } = getRobot(), +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(30, 1) Source(50, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(50, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(50, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(50, 10) + SourceIndex(0) -5 >Emitted(30, 10) Source(50, 10) + SourceIndex(0) -6 >Emitted(30, 25) Source(50, 52) + SourceIndex(0) -7 >Emitted(30, 27) Source(50, 11) + SourceIndex(0) -8 >Emitted(30, 42) Source(50, 22) + SourceIndex(0) -9 >Emitted(30, 44) Source(50, 24) + SourceIndex(0) -10>Emitted(30, 61) Source(50, 37) + SourceIndex(0) -11>Emitted(30, 63) Source(50, 54) + SourceIndex(0) -12>Emitted(30, 64) Source(50, 55) + SourceIndex(0) -13>Emitted(30, 67) Source(50, 58) + SourceIndex(0) -14>Emitted(30, 68) Source(50, 59) + SourceIndex(0) -15>Emitted(30, 70) Source(50, 61) + SourceIndex(0) -16>Emitted(30, 71) Source(50, 62) + SourceIndex(0) -17>Emitted(30, 74) Source(50, 65) + SourceIndex(0) -18>Emitted(30, 75) Source(50, 66) + SourceIndex(0) -19>Emitted(30, 77) Source(50, 68) + SourceIndex(0) -20>Emitted(30, 78) Source(50, 69) + SourceIndex(0) -21>Emitted(30, 80) Source(50, 71) + SourceIndex(0) -22>Emitted(30, 82) Source(50, 73) + SourceIndex(0) -23>Emitted(30, 83) Source(50, 74) + SourceIndex(0) +2 >Emitted(30, 6) Source(50, 10) + SourceIndex(0) +3 >Emitted(30, 10) Source(50, 10) + SourceIndex(0) +4 >Emitted(30, 25) Source(50, 52) + SourceIndex(0) +5 >Emitted(30, 27) Source(50, 11) + SourceIndex(0) +6 >Emitted(30, 42) Source(50, 22) + SourceIndex(0) +7 >Emitted(30, 44) Source(50, 24) + SourceIndex(0) +8 >Emitted(30, 61) Source(50, 37) + SourceIndex(0) +9 >Emitted(30, 63) Source(50, 54) + SourceIndex(0) +10>Emitted(30, 64) Source(50, 55) + SourceIndex(0) +11>Emitted(30, 67) Source(50, 58) + SourceIndex(0) +12>Emitted(30, 68) Source(50, 59) + SourceIndex(0) +13>Emitted(30, 70) Source(50, 61) + SourceIndex(0) +14>Emitted(30, 71) Source(50, 62) + SourceIndex(0) +15>Emitted(30, 74) Source(50, 65) + SourceIndex(0) +16>Emitted(30, 75) Source(50, 66) + SourceIndex(0) +17>Emitted(30, 77) Source(50, 68) + SourceIndex(0) +18>Emitted(30, 78) Source(50, 69) + SourceIndex(0) +19>Emitted(30, 80) Source(50, 71) + SourceIndex(0) +20>Emitted(30, 82) Source(50, 73) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1014,7 +915,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1033,86 +934,74 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(31, 24) Source(51, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(32, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(52, 2) + SourceIndex(0) + >} +1 >Emitted(32, 2) Source(52, 2) + SourceIndex(0) --- >>>for (var _e = { name: "trimmer", skill: "trimming" }, nameA = _e.name, skillA = _e.skill, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^ -22> ^^ -23> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^ +20> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } -7 > -8 > name: nameA -9 > , -10> skill: skillA -11> } = { name: "trimmer", skill: "trimming" }, -12> i -13> = -14> 0 -15> ; -16> i -17> < -18> 1 -19> ; -20> i -21> ++ -22> ) -23> { +2 >for (let +3 > +4 > {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } +5 > +6 > name: nameA +7 > , +8 > skill: skillA +9 > } = { name: "trimmer", skill: "trimming" }, +10> i +11> = +12> 0 +13> ; +14> i +15> < +16> 1 +17> ; +18> i +19> ++ +20> ) 1->Emitted(33, 1) Source(53, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(53, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(53, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(53, 10) + SourceIndex(0) -5 >Emitted(33, 10) Source(53, 10) + SourceIndex(0) -6 >Emitted(33, 53) Source(53, 87) + SourceIndex(0) -7 >Emitted(33, 55) Source(53, 11) + SourceIndex(0) -8 >Emitted(33, 70) Source(53, 22) + SourceIndex(0) -9 >Emitted(33, 72) Source(53, 24) + SourceIndex(0) -10>Emitted(33, 89) Source(53, 37) + SourceIndex(0) -11>Emitted(33, 91) Source(53, 89) + SourceIndex(0) -12>Emitted(33, 92) Source(53, 90) + SourceIndex(0) -13>Emitted(33, 95) Source(53, 93) + SourceIndex(0) -14>Emitted(33, 96) Source(53, 94) + SourceIndex(0) -15>Emitted(33, 98) Source(53, 96) + SourceIndex(0) -16>Emitted(33, 99) Source(53, 97) + SourceIndex(0) -17>Emitted(33, 102) Source(53, 100) + SourceIndex(0) -18>Emitted(33, 103) Source(53, 101) + SourceIndex(0) -19>Emitted(33, 105) Source(53, 103) + SourceIndex(0) -20>Emitted(33, 106) Source(53, 104) + SourceIndex(0) -21>Emitted(33, 108) Source(53, 106) + SourceIndex(0) -22>Emitted(33, 110) Source(53, 108) + SourceIndex(0) -23>Emitted(33, 111) Source(53, 109) + SourceIndex(0) +2 >Emitted(33, 6) Source(53, 10) + SourceIndex(0) +3 >Emitted(33, 10) Source(53, 10) + SourceIndex(0) +4 >Emitted(33, 53) Source(53, 87) + SourceIndex(0) +5 >Emitted(33, 55) Source(53, 11) + SourceIndex(0) +6 >Emitted(33, 70) Source(53, 22) + SourceIndex(0) +7 >Emitted(33, 72) Source(53, 24) + SourceIndex(0) +8 >Emitted(33, 89) Source(53, 37) + SourceIndex(0) +9 >Emitted(33, 91) Source(53, 89) + SourceIndex(0) +10>Emitted(33, 92) Source(53, 90) + SourceIndex(0) +11>Emitted(33, 95) Source(53, 93) + SourceIndex(0) +12>Emitted(33, 96) Source(53, 94) + SourceIndex(0) +13>Emitted(33, 98) Source(53, 96) + SourceIndex(0) +14>Emitted(33, 99) Source(53, 97) + SourceIndex(0) +15>Emitted(33, 102) Source(53, 100) + SourceIndex(0) +16>Emitted(33, 103) Source(53, 101) + SourceIndex(0) +17>Emitted(33, 105) Source(53, 103) + SourceIndex(0) +18>Emitted(33, 106) Source(53, 104) + SourceIndex(0) +19>Emitted(33, 108) Source(53, 106) + SourceIndex(0) +20>Emitted(33, 110) Source(53, 108) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1123,7 +1012,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1142,92 +1031,80 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(34, 24) Source(54, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(35, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(35, 2) Source(55, 2) + SourceIndex(0) + >} +1 >Emitted(35, 2) Source(55, 2) + SourceIndex(0) --- >>>for (var nameA = multiRobot.name, _f = multiRobot.skills, primaryA = _f.primary, secondaryA = _f.secondary, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA -7 > , -8 > skills: { primary: primaryA, secondary: secondaryA } -9 > -10> primary: primaryA -11> , -12> secondary: secondaryA -13> } } = multiRobot, -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let { +3 > +4 > name: nameA +5 > , +6 > skills: { primary: primaryA, secondary: secondaryA } +7 > +8 > primary: primaryA +9 > , +10> secondary: secondaryA +11> } } = multiRobot, +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(36, 1) Source(56, 1) + SourceIndex(0) -2 >Emitted(36, 4) Source(56, 4) + SourceIndex(0) -3 >Emitted(36, 5) Source(56, 5) + SourceIndex(0) -4 >Emitted(36, 6) Source(56, 11) + SourceIndex(0) -5 >Emitted(36, 10) Source(56, 11) + SourceIndex(0) -6 >Emitted(36, 33) Source(56, 22) + SourceIndex(0) -7 >Emitted(36, 35) Source(56, 24) + SourceIndex(0) -8 >Emitted(36, 57) Source(56, 76) + SourceIndex(0) -9 >Emitted(36, 59) Source(56, 34) + SourceIndex(0) -10>Emitted(36, 80) Source(56, 51) + SourceIndex(0) -11>Emitted(36, 82) Source(56, 53) + SourceIndex(0) -12>Emitted(36, 107) Source(56, 74) + SourceIndex(0) -13>Emitted(36, 109) Source(56, 93) + SourceIndex(0) -14>Emitted(36, 110) Source(56, 94) + SourceIndex(0) -15>Emitted(36, 113) Source(56, 97) + SourceIndex(0) -16>Emitted(36, 114) Source(56, 98) + SourceIndex(0) -17>Emitted(36, 116) Source(56, 100) + SourceIndex(0) -18>Emitted(36, 117) Source(56, 101) + SourceIndex(0) -19>Emitted(36, 120) Source(56, 104) + SourceIndex(0) -20>Emitted(36, 121) Source(56, 105) + SourceIndex(0) -21>Emitted(36, 123) Source(56, 107) + SourceIndex(0) -22>Emitted(36, 124) Source(56, 108) + SourceIndex(0) -23>Emitted(36, 126) Source(56, 110) + SourceIndex(0) -24>Emitted(36, 128) Source(56, 112) + SourceIndex(0) -25>Emitted(36, 129) Source(56, 113) + SourceIndex(0) +2 >Emitted(36, 6) Source(56, 11) + SourceIndex(0) +3 >Emitted(36, 10) Source(56, 11) + SourceIndex(0) +4 >Emitted(36, 33) Source(56, 22) + SourceIndex(0) +5 >Emitted(36, 35) Source(56, 24) + SourceIndex(0) +6 >Emitted(36, 57) Source(56, 76) + SourceIndex(0) +7 >Emitted(36, 59) Source(56, 34) + SourceIndex(0) +8 >Emitted(36, 80) Source(56, 51) + SourceIndex(0) +9 >Emitted(36, 82) Source(56, 53) + SourceIndex(0) +10>Emitted(36, 107) Source(56, 74) + SourceIndex(0) +11>Emitted(36, 109) Source(56, 93) + SourceIndex(0) +12>Emitted(36, 110) Source(56, 94) + SourceIndex(0) +13>Emitted(36, 113) Source(56, 97) + SourceIndex(0) +14>Emitted(36, 114) Source(56, 98) + SourceIndex(0) +15>Emitted(36, 116) Source(56, 100) + SourceIndex(0) +16>Emitted(36, 117) Source(56, 101) + SourceIndex(0) +17>Emitted(36, 120) Source(56, 104) + SourceIndex(0) +18>Emitted(36, 121) Source(56, 105) + SourceIndex(0) +19>Emitted(36, 123) Source(56, 107) + SourceIndex(0) +20>Emitted(36, 124) Source(56, 108) + SourceIndex(0) +21>Emitted(36, 126) Source(56, 110) + SourceIndex(0) +22>Emitted(36, 128) Source(56, 112) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1238,7 +1115,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1257,98 +1134,86 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(37, 27) Source(57, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(38, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(38, 2) Source(58, 2) + SourceIndex(0) + >} +1 >Emitted(38, 2) Source(58, 2) + SourceIndex(0) --- >>>for (var _g = getMultiRobot(), nameA = _g.name, _h = _g.skills, primaryA = _h.primary, secondaryA = _h.secondary, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^ -26> ^^ -27> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() -7 > -8 > name: nameA -9 > , -10> skills: { primary: primaryA, secondary: secondaryA } -11> -12> primary: primaryA -13> , -14> secondary: secondaryA -15> } } = getMultiRobot(), -16> i -17> = -18> 0 -19> ; -20> i -21> < -22> 1 -23> ; -24> i -25> ++ -26> ) -27> { +2 >for (let +3 > +4 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +5 > +6 > name: nameA +7 > , +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = getMultiRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) 1->Emitted(39, 1) Source(59, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(59, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(59, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(59, 10) + SourceIndex(0) -5 >Emitted(39, 10) Source(59, 10) + SourceIndex(0) -6 >Emitted(39, 30) Source(59, 96) + SourceIndex(0) -7 >Emitted(39, 32) Source(59, 11) + SourceIndex(0) -8 >Emitted(39, 47) Source(59, 22) + SourceIndex(0) -9 >Emitted(39, 49) Source(59, 24) + SourceIndex(0) -10>Emitted(39, 63) Source(59, 76) + SourceIndex(0) -11>Emitted(39, 65) Source(59, 34) + SourceIndex(0) -12>Emitted(39, 86) Source(59, 51) + SourceIndex(0) -13>Emitted(39, 88) Source(59, 53) + SourceIndex(0) -14>Emitted(39, 113) Source(59, 74) + SourceIndex(0) -15>Emitted(39, 115) Source(59, 98) + SourceIndex(0) -16>Emitted(39, 116) Source(59, 99) + SourceIndex(0) -17>Emitted(39, 119) Source(59, 102) + SourceIndex(0) -18>Emitted(39, 120) Source(59, 103) + SourceIndex(0) -19>Emitted(39, 122) Source(59, 105) + SourceIndex(0) -20>Emitted(39, 123) Source(59, 106) + SourceIndex(0) -21>Emitted(39, 126) Source(59, 109) + SourceIndex(0) -22>Emitted(39, 127) Source(59, 110) + SourceIndex(0) -23>Emitted(39, 129) Source(59, 112) + SourceIndex(0) -24>Emitted(39, 130) Source(59, 113) + SourceIndex(0) -25>Emitted(39, 132) Source(59, 115) + SourceIndex(0) -26>Emitted(39, 134) Source(59, 117) + SourceIndex(0) -27>Emitted(39, 135) Source(59, 118) + SourceIndex(0) +2 >Emitted(39, 6) Source(59, 10) + SourceIndex(0) +3 >Emitted(39, 10) Source(59, 10) + SourceIndex(0) +4 >Emitted(39, 30) Source(59, 96) + SourceIndex(0) +5 >Emitted(39, 32) Source(59, 11) + SourceIndex(0) +6 >Emitted(39, 47) Source(59, 22) + SourceIndex(0) +7 >Emitted(39, 49) Source(59, 24) + SourceIndex(0) +8 >Emitted(39, 63) Source(59, 76) + SourceIndex(0) +9 >Emitted(39, 65) Source(59, 34) + SourceIndex(0) +10>Emitted(39, 86) Source(59, 51) + SourceIndex(0) +11>Emitted(39, 88) Source(59, 53) + SourceIndex(0) +12>Emitted(39, 113) Source(59, 74) + SourceIndex(0) +13>Emitted(39, 115) Source(59, 98) + SourceIndex(0) +14>Emitted(39, 116) Source(59, 99) + SourceIndex(0) +15>Emitted(39, 119) Source(59, 102) + SourceIndex(0) +16>Emitted(39, 120) Source(59, 103) + SourceIndex(0) +17>Emitted(39, 122) Source(59, 105) + SourceIndex(0) +18>Emitted(39, 123) Source(59, 106) + SourceIndex(0) +19>Emitted(39, 126) Source(59, 109) + SourceIndex(0) +20>Emitted(39, 127) Source(59, 110) + SourceIndex(0) +21>Emitted(39, 129) Source(59, 112) + SourceIndex(0) +22>Emitted(39, 130) Source(59, 113) + SourceIndex(0) +23>Emitted(39, 132) Source(59, 115) + SourceIndex(0) +24>Emitted(39, 134) Source(59, 117) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1359,7 +1224,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1378,101 +1243,89 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(40, 27) Source(60, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(41, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(41, 2) Source(61, 2) + SourceIndex(0) + >} +1 >Emitted(41, 2) Source(61, 2) + SourceIndex(0) --- >>>for (var _j = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _j.name, _k = _j.skills, primaryA = _k.primary, secondaryA = _k.secondary, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^ -26> ^^ -27> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +2 >for (let +3 > +4 > {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -7 > -8 > name: nameA -9 > , -10> skills: { primary: primaryA, secondary: secondaryA } -11> -12> primary: primaryA -13> , -14> secondary: secondaryA -15> } } = +5 > +6 > name: nameA +7 > , +8 > skills: { primary: primaryA, secondary: secondaryA } +9 > +10> primary: primaryA +11> , +12> secondary: secondaryA +13> } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > -16> i -17> = -18> 0 -19> ; -20> i -21> < -22> 1 -23> ; -24> i -25> ++ -26> ) -27> { +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) 1->Emitted(42, 1) Source(62, 1) + SourceIndex(0) -2 >Emitted(42, 4) Source(62, 4) + SourceIndex(0) -3 >Emitted(42, 5) Source(62, 5) + SourceIndex(0) -4 >Emitted(42, 6) Source(62, 10) + SourceIndex(0) -5 >Emitted(42, 10) Source(62, 10) + SourceIndex(0) -6 >Emitted(42, 88) Source(63, 90) + SourceIndex(0) -7 >Emitted(42, 90) Source(62, 11) + SourceIndex(0) -8 >Emitted(42, 105) Source(62, 22) + SourceIndex(0) -9 >Emitted(42, 107) Source(62, 24) + SourceIndex(0) -10>Emitted(42, 121) Source(62, 76) + SourceIndex(0) -11>Emitted(42, 123) Source(62, 34) + SourceIndex(0) -12>Emitted(42, 144) Source(62, 51) + SourceIndex(0) -13>Emitted(42, 146) Source(62, 53) + SourceIndex(0) -14>Emitted(42, 171) Source(62, 74) + SourceIndex(0) -15>Emitted(42, 173) Source(64, 5) + SourceIndex(0) -16>Emitted(42, 174) Source(64, 6) + SourceIndex(0) -17>Emitted(42, 177) Source(64, 9) + SourceIndex(0) -18>Emitted(42, 178) Source(64, 10) + SourceIndex(0) -19>Emitted(42, 180) Source(64, 12) + SourceIndex(0) -20>Emitted(42, 181) Source(64, 13) + SourceIndex(0) -21>Emitted(42, 184) Source(64, 16) + SourceIndex(0) -22>Emitted(42, 185) Source(64, 17) + SourceIndex(0) -23>Emitted(42, 187) Source(64, 19) + SourceIndex(0) -24>Emitted(42, 188) Source(64, 20) + SourceIndex(0) -25>Emitted(42, 190) Source(64, 22) + SourceIndex(0) -26>Emitted(42, 192) Source(64, 24) + SourceIndex(0) -27>Emitted(42, 193) Source(64, 25) + SourceIndex(0) +2 >Emitted(42, 6) Source(62, 10) + SourceIndex(0) +3 >Emitted(42, 10) Source(62, 10) + SourceIndex(0) +4 >Emitted(42, 88) Source(63, 90) + SourceIndex(0) +5 >Emitted(42, 90) Source(62, 11) + SourceIndex(0) +6 >Emitted(42, 105) Source(62, 22) + SourceIndex(0) +7 >Emitted(42, 107) Source(62, 24) + SourceIndex(0) +8 >Emitted(42, 121) Source(62, 76) + SourceIndex(0) +9 >Emitted(42, 123) Source(62, 34) + SourceIndex(0) +10>Emitted(42, 144) Source(62, 51) + SourceIndex(0) +11>Emitted(42, 146) Source(62, 53) + SourceIndex(0) +12>Emitted(42, 171) Source(62, 74) + SourceIndex(0) +13>Emitted(42, 173) Source(64, 5) + SourceIndex(0) +14>Emitted(42, 174) Source(64, 6) + SourceIndex(0) +15>Emitted(42, 177) Source(64, 9) + SourceIndex(0) +16>Emitted(42, 178) Source(64, 10) + SourceIndex(0) +17>Emitted(42, 180) Source(64, 12) + SourceIndex(0) +18>Emitted(42, 181) Source(64, 13) + SourceIndex(0) +19>Emitted(42, 184) Source(64, 16) + SourceIndex(0) +20>Emitted(42, 185) Source(64, 17) + SourceIndex(0) +21>Emitted(42, 187) Source(64, 19) + SourceIndex(0) +22>Emitted(42, 188) Source(64, 20) + SourceIndex(0) +23>Emitted(42, 190) Source(64, 22) + SourceIndex(0) +24>Emitted(42, 192) Source(64, 24) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1483,7 +1336,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1502,13 +1355,10 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern.ts 8 >Emitted(43, 27) Source(65, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(44, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(44, 2) Source(66, 2) + SourceIndex(0) + >} +1 >Emitted(44, 2) Source(66, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map index 1c3f77da043..d930336adfe 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPattern2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAG,kBAAW,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAA4B,EAA1B,eAAW,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,2CAA+D,EAA7D,eAAW,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAG,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,oBAA0E,EAAxE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,8EACoF,EADlF,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAG,iBAAI,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAAqB,EAAnB,cAAI,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,2CAAwD,EAAtD,cAAI,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAG,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,oBAAoD,EAAlD,cAA8B,EAApB,oBAAO,EAAE,wBAAS,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,8EACoF,EADlF,cAA8B,EAApB,oBAAO,EAAE,wBAAS;IAE/B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAGD,GAAG,CAAC,CAAG,kBAAW,EAAE,oBAAa,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAA2C,EAAzC,eAAW,EAAE,iBAAa,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,2CAA8E,EAA5E,eAAW,EAAE,iBAAa,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAG,uBAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,oBAAuF,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,8EACoF,EADlF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAElE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAG,iBAAI,EAAE,mBAAK,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAA4B,EAA1B,cAAI,EAAE,gBAAK,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,2CAA+D,EAA7D,cAAI,EAAE,gBAAK,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAG,sBAAI,EAAE,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,oBAA0D,EAAxD,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,8EACoF,EADlF,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS;IAErC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;IACI,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,KAAO,kBAAW,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAA4B,EAA1B,eAAW,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,2CAA+D,EAA7D,eAAW,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAO,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC3F,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,oBAA0E,EAAxE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,8EACoF,EADlF,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAO,iBAAI,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAAqB,EAAnB,cAAI,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,2CAAwD,EAAtD,cAAI,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC9E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAO,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,oBAAoD,EAAlD,cAA8B,EAApB,oBAAO,EAAE,wBAAS,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,8EACoF,EADlF,cAA8B,EAApB,oBAAO,EAAE,wBAAS;IAE/B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,KAAO,kBAAW,EAAE,oBAAa,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAA2C,EAAzC,eAAW,EAAE,iBAAa,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,2CAA8E,EAA5E,eAAW,EAAE,iBAAa,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAO,uBAAW,EAAE,sBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,oBAAuF,EAArF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC7G,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,8EACoF,EADlF,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAElE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAO,iBAAI,EAAE,mBAAK,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAA4B,EAA1B,cAAI,EAAE,gBAAK,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,2CAA+D,EAA7D,cAAI,EAAE,gBAAK,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAO,sBAAI,EAAE,sBAA8B,EAApB,oBAAO,EAAE,wBAAS,EAAO,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC3E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,oBAA0D,EAAxD,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS,MAAwB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,8EACoF,EADlF,cAAI,EAAE,cAA8B,EAApB,oBAAO,EAAE,wBAAS;IAErC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt index 1f6bd10d5f5..7b8177f93a8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.sourcemap.txt @@ -147,21 +147,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts --- >>> return robot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robot -5 > ; +2 > return +3 > robot +4 > ; 1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) -2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) -3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) -4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) -5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +2 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +4 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) --- >>>} 1 > @@ -182,21 +179,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts --- >>> return multiRobot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobot -5 > ; +2 > return +3 > multiRobot +4 > ; 1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) -2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) -3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) -4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) -5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +2 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +3 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +4 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) --- >>>} 1 > @@ -284,67 +278,58 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts --- >>>for (nameA = robot.name, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > > -2 >for -3 > -4 > ({ -5 > name: nameA -6 > } = -7 > robot -8 > , -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ({ +3 > name: nameA +4 > } = +5 > robot +6 > , +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(11, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(11, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(11, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(11, 6) Source(29, 8) + SourceIndex(0) -5 >Emitted(11, 24) Source(29, 19) + SourceIndex(0) -6 >Emitted(11, 26) Source(29, 24) + SourceIndex(0) -7 >Emitted(11, 31) Source(29, 29) + SourceIndex(0) -8 >Emitted(11, 33) Source(29, 31) + SourceIndex(0) -9 >Emitted(11, 34) Source(29, 32) + SourceIndex(0) -10>Emitted(11, 37) Source(29, 35) + SourceIndex(0) -11>Emitted(11, 38) Source(29, 36) + SourceIndex(0) -12>Emitted(11, 40) Source(29, 38) + SourceIndex(0) -13>Emitted(11, 41) Source(29, 39) + SourceIndex(0) -14>Emitted(11, 44) Source(29, 42) + SourceIndex(0) -15>Emitted(11, 45) Source(29, 43) + SourceIndex(0) -16>Emitted(11, 47) Source(29, 45) + SourceIndex(0) -17>Emitted(11, 48) Source(29, 46) + SourceIndex(0) -18>Emitted(11, 50) Source(29, 48) + SourceIndex(0) -19>Emitted(11, 52) Source(29, 50) + SourceIndex(0) -20>Emitted(11, 53) Source(29, 51) + SourceIndex(0) +2 >Emitted(11, 6) Source(29, 8) + SourceIndex(0) +3 >Emitted(11, 24) Source(29, 19) + SourceIndex(0) +4 >Emitted(11, 26) Source(29, 24) + SourceIndex(0) +5 >Emitted(11, 31) Source(29, 29) + SourceIndex(0) +6 >Emitted(11, 33) Source(29, 31) + SourceIndex(0) +7 >Emitted(11, 34) Source(29, 32) + SourceIndex(0) +8 >Emitted(11, 37) Source(29, 35) + SourceIndex(0) +9 >Emitted(11, 38) Source(29, 36) + SourceIndex(0) +10>Emitted(11, 40) Source(29, 38) + SourceIndex(0) +11>Emitted(11, 41) Source(29, 39) + SourceIndex(0) +12>Emitted(11, 44) Source(29, 42) + SourceIndex(0) +13>Emitted(11, 45) Source(29, 43) + SourceIndex(0) +14>Emitted(11, 47) Source(29, 45) + SourceIndex(0) +15>Emitted(11, 48) Source(29, 46) + SourceIndex(0) +16>Emitted(11, 50) Source(29, 48) + SourceIndex(0) +17>Emitted(11, 52) Source(29, 50) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -355,7 +340,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -374,77 +359,65 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(13, 1) Source(31, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) + >} +1 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) --- >>>for (_a = getRobot(), nameA = _a.name, _a, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name: nameA } = getRobot() -6 > -7 > name: nameA -8 > } = getRobot(), -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > { name: nameA } = getRobot() +4 > +5 > name: nameA +6 > } = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) -5 >Emitted(14, 21) Source(32, 34) + SourceIndex(0) -6 >Emitted(14, 23) Source(32, 8) + SourceIndex(0) -7 >Emitted(14, 38) Source(32, 19) + SourceIndex(0) -8 >Emitted(14, 44) Source(32, 36) + SourceIndex(0) -9 >Emitted(14, 45) Source(32, 37) + SourceIndex(0) -10>Emitted(14, 48) Source(32, 40) + SourceIndex(0) -11>Emitted(14, 49) Source(32, 41) + SourceIndex(0) -12>Emitted(14, 51) Source(32, 43) + SourceIndex(0) -13>Emitted(14, 52) Source(32, 44) + SourceIndex(0) -14>Emitted(14, 55) Source(32, 47) + SourceIndex(0) -15>Emitted(14, 56) Source(32, 48) + SourceIndex(0) -16>Emitted(14, 58) Source(32, 50) + SourceIndex(0) -17>Emitted(14, 59) Source(32, 51) + SourceIndex(0) -18>Emitted(14, 61) Source(32, 53) + SourceIndex(0) -19>Emitted(14, 63) Source(32, 55) + SourceIndex(0) -20>Emitted(14, 64) Source(32, 56) + SourceIndex(0) +2 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) +3 >Emitted(14, 21) Source(32, 34) + SourceIndex(0) +4 >Emitted(14, 23) Source(32, 8) + SourceIndex(0) +5 >Emitted(14, 38) Source(32, 19) + SourceIndex(0) +6 >Emitted(14, 44) Source(32, 36) + SourceIndex(0) +7 >Emitted(14, 45) Source(32, 37) + SourceIndex(0) +8 >Emitted(14, 48) Source(32, 40) + SourceIndex(0) +9 >Emitted(14, 49) Source(32, 41) + SourceIndex(0) +10>Emitted(14, 51) Source(32, 43) + SourceIndex(0) +11>Emitted(14, 52) Source(32, 44) + SourceIndex(0) +12>Emitted(14, 55) Source(32, 47) + SourceIndex(0) +13>Emitted(14, 56) Source(32, 48) + SourceIndex(0) +14>Emitted(14, 58) Source(32, 50) + SourceIndex(0) +15>Emitted(14, 59) Source(32, 51) + SourceIndex(0) +16>Emitted(14, 61) Source(32, 53) + SourceIndex(0) +17>Emitted(14, 63) Source(32, 55) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -455,7 +428,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -474,77 +447,65 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(15, 24) Source(33, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(16, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) + >} +1 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) --- >>>for (_b = { name: "trimmer", skill: "trimming" }, nameA = _b.name, _b, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name: nameA } = { name: "trimmer", skill: "trimming" } -6 > -7 > name: nameA -8 > } = { name: "trimmer", skill: "trimming" }, -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > { name: nameA } = { name: "trimmer", skill: "trimming" } +4 > +5 > name: nameA +6 > } = { name: "trimmer", skill: "trimming" }, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(17, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(17, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(17, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) -5 >Emitted(17, 49) Source(35, 69) + SourceIndex(0) -6 >Emitted(17, 51) Source(35, 8) + SourceIndex(0) -7 >Emitted(17, 66) Source(35, 19) + SourceIndex(0) -8 >Emitted(17, 72) Source(35, 71) + SourceIndex(0) -9 >Emitted(17, 73) Source(35, 72) + SourceIndex(0) -10>Emitted(17, 76) Source(35, 75) + SourceIndex(0) -11>Emitted(17, 77) Source(35, 76) + SourceIndex(0) -12>Emitted(17, 79) Source(35, 78) + SourceIndex(0) -13>Emitted(17, 80) Source(35, 79) + SourceIndex(0) -14>Emitted(17, 83) Source(35, 82) + SourceIndex(0) -15>Emitted(17, 84) Source(35, 83) + SourceIndex(0) -16>Emitted(17, 86) Source(35, 85) + SourceIndex(0) -17>Emitted(17, 87) Source(35, 86) + SourceIndex(0) -18>Emitted(17, 89) Source(35, 88) + SourceIndex(0) -19>Emitted(17, 91) Source(35, 90) + SourceIndex(0) -20>Emitted(17, 92) Source(35, 91) + SourceIndex(0) +2 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) +3 >Emitted(17, 49) Source(35, 69) + SourceIndex(0) +4 >Emitted(17, 51) Source(35, 8) + SourceIndex(0) +5 >Emitted(17, 66) Source(35, 19) + SourceIndex(0) +6 >Emitted(17, 72) Source(35, 71) + SourceIndex(0) +7 >Emitted(17, 73) Source(35, 72) + SourceIndex(0) +8 >Emitted(17, 76) Source(35, 75) + SourceIndex(0) +9 >Emitted(17, 77) Source(35, 76) + SourceIndex(0) +10>Emitted(17, 79) Source(35, 78) + SourceIndex(0) +11>Emitted(17, 80) Source(35, 79) + SourceIndex(0) +12>Emitted(17, 83) Source(35, 82) + SourceIndex(0) +13>Emitted(17, 84) Source(35, 83) + SourceIndex(0) +14>Emitted(17, 86) Source(35, 85) + SourceIndex(0) +15>Emitted(17, 87) Source(35, 86) + SourceIndex(0) +16>Emitted(17, 89) Source(35, 88) + SourceIndex(0) +17>Emitted(17, 91) Source(35, 90) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -555,7 +516,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -574,89 +535,77 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(19, 1) Source(37, 1) + SourceIndex(0) -2 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) + >} +1 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) --- >>>for (_c = multiRobot.skills, primaryA = _c.primary, secondaryA = _c.secondary, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ({ -5 > skills: { primary: primaryA, secondary: secondaryA } -6 > -7 > primary: primaryA -8 > , -9 > secondary: secondaryA -10> } } = -11> multiRobot -12> , -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ({ +3 > skills: { primary: primaryA, secondary: secondaryA } +4 > +5 > primary: primaryA +6 > , +7 > secondary: secondaryA +8 > } } = +9 > multiRobot +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(20, 6) Source(38, 8) + SourceIndex(0) -5 >Emitted(20, 28) Source(38, 60) + SourceIndex(0) -6 >Emitted(20, 30) Source(38, 18) + SourceIndex(0) -7 >Emitted(20, 51) Source(38, 35) + SourceIndex(0) -8 >Emitted(20, 53) Source(38, 37) + SourceIndex(0) -9 >Emitted(20, 78) Source(38, 58) + SourceIndex(0) -10>Emitted(20, 80) Source(38, 65) + SourceIndex(0) -11>Emitted(20, 90) Source(38, 75) + SourceIndex(0) -12>Emitted(20, 92) Source(38, 77) + SourceIndex(0) -13>Emitted(20, 93) Source(38, 78) + SourceIndex(0) -14>Emitted(20, 96) Source(38, 81) + SourceIndex(0) -15>Emitted(20, 97) Source(38, 82) + SourceIndex(0) -16>Emitted(20, 99) Source(38, 84) + SourceIndex(0) -17>Emitted(20, 100) Source(38, 85) + SourceIndex(0) -18>Emitted(20, 103) Source(38, 88) + SourceIndex(0) -19>Emitted(20, 104) Source(38, 89) + SourceIndex(0) -20>Emitted(20, 106) Source(38, 91) + SourceIndex(0) -21>Emitted(20, 107) Source(38, 92) + SourceIndex(0) -22>Emitted(20, 109) Source(38, 94) + SourceIndex(0) -23>Emitted(20, 111) Source(38, 96) + SourceIndex(0) -24>Emitted(20, 112) Source(38, 97) + SourceIndex(0) +2 >Emitted(20, 6) Source(38, 8) + SourceIndex(0) +3 >Emitted(20, 28) Source(38, 60) + SourceIndex(0) +4 >Emitted(20, 30) Source(38, 18) + SourceIndex(0) +5 >Emitted(20, 51) Source(38, 35) + SourceIndex(0) +6 >Emitted(20, 53) Source(38, 37) + SourceIndex(0) +7 >Emitted(20, 78) Source(38, 58) + SourceIndex(0) +8 >Emitted(20, 80) Source(38, 65) + SourceIndex(0) +9 >Emitted(20, 90) Source(38, 75) + SourceIndex(0) +10>Emitted(20, 92) Source(38, 77) + SourceIndex(0) +11>Emitted(20, 93) Source(38, 78) + SourceIndex(0) +12>Emitted(20, 96) Source(38, 81) + SourceIndex(0) +13>Emitted(20, 97) Source(38, 82) + SourceIndex(0) +14>Emitted(20, 99) Source(38, 84) + SourceIndex(0) +15>Emitted(20, 100) Source(38, 85) + SourceIndex(0) +16>Emitted(20, 103) Source(38, 88) + SourceIndex(0) +17>Emitted(20, 104) Source(38, 89) + SourceIndex(0) +18>Emitted(20, 106) Source(38, 91) + SourceIndex(0) +19>Emitted(20, 107) Source(38, 92) + SourceIndex(0) +20>Emitted(20, 109) Source(38, 94) + SourceIndex(0) +21>Emitted(20, 111) Source(38, 96) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -667,7 +616,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -686,89 +635,77 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(21, 27) Source(39, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(22, 1) Source(40, 1) + SourceIndex(0) -2 >Emitted(22, 2) Source(40, 2) + SourceIndex(0) + >} +1 >Emitted(22, 2) Source(40, 2) + SourceIndex(0) --- >>>for (_d = getMultiRobot(), _e = _d.skills, primaryA = _e.primary, secondaryA = _e.secondary, _d, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() -6 > -7 > skills: { primary: primaryA, secondary: secondaryA } -8 > -9 > primary: primaryA -10> , -11> secondary: secondaryA -12> } } = getMultiRobot(), -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > { skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +4 > +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = getMultiRobot(), +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(23, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(23, 4) Source(41, 4) + SourceIndex(0) -3 >Emitted(23, 5) Source(41, 5) + SourceIndex(0) -4 >Emitted(23, 6) Source(41, 6) + SourceIndex(0) -5 >Emitted(23, 26) Source(41, 80) + SourceIndex(0) -6 >Emitted(23, 28) Source(41, 8) + SourceIndex(0) -7 >Emitted(23, 42) Source(41, 60) + SourceIndex(0) -8 >Emitted(23, 44) Source(41, 18) + SourceIndex(0) -9 >Emitted(23, 65) Source(41, 35) + SourceIndex(0) -10>Emitted(23, 67) Source(41, 37) + SourceIndex(0) -11>Emitted(23, 92) Source(41, 58) + SourceIndex(0) -12>Emitted(23, 98) Source(41, 82) + SourceIndex(0) -13>Emitted(23, 99) Source(41, 83) + SourceIndex(0) -14>Emitted(23, 102) Source(41, 86) + SourceIndex(0) -15>Emitted(23, 103) Source(41, 87) + SourceIndex(0) -16>Emitted(23, 105) Source(41, 89) + SourceIndex(0) -17>Emitted(23, 106) Source(41, 90) + SourceIndex(0) -18>Emitted(23, 109) Source(41, 93) + SourceIndex(0) -19>Emitted(23, 110) Source(41, 94) + SourceIndex(0) -20>Emitted(23, 112) Source(41, 96) + SourceIndex(0) -21>Emitted(23, 113) Source(41, 97) + SourceIndex(0) -22>Emitted(23, 115) Source(41, 99) + SourceIndex(0) -23>Emitted(23, 117) Source(41, 101) + SourceIndex(0) -24>Emitted(23, 118) Source(41, 102) + SourceIndex(0) +2 >Emitted(23, 6) Source(41, 6) + SourceIndex(0) +3 >Emitted(23, 26) Source(41, 80) + SourceIndex(0) +4 >Emitted(23, 28) Source(41, 8) + SourceIndex(0) +5 >Emitted(23, 42) Source(41, 60) + SourceIndex(0) +6 >Emitted(23, 44) Source(41, 18) + SourceIndex(0) +7 >Emitted(23, 65) Source(41, 35) + SourceIndex(0) +8 >Emitted(23, 67) Source(41, 37) + SourceIndex(0) +9 >Emitted(23, 92) Source(41, 58) + SourceIndex(0) +10>Emitted(23, 98) Source(41, 82) + SourceIndex(0) +11>Emitted(23, 99) Source(41, 83) + SourceIndex(0) +12>Emitted(23, 102) Source(41, 86) + SourceIndex(0) +13>Emitted(23, 103) Source(41, 87) + SourceIndex(0) +14>Emitted(23, 105) Source(41, 89) + SourceIndex(0) +15>Emitted(23, 106) Source(41, 90) + SourceIndex(0) +16>Emitted(23, 109) Source(41, 93) + SourceIndex(0) +17>Emitted(23, 110) Source(41, 94) + SourceIndex(0) +18>Emitted(23, 112) Source(41, 96) + SourceIndex(0) +19>Emitted(23, 113) Source(41, 97) + SourceIndex(0) +20>Emitted(23, 115) Source(41, 99) + SourceIndex(0) +21>Emitted(23, 117) Source(41, 101) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -779,7 +716,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -798,51 +735,42 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(24, 27) Source(42, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(25, 1) Source(43, 1) + SourceIndex(0) -2 >Emitted(25, 2) Source(43, 2) + SourceIndex(0) + >} +1 >Emitted(25, 2) Source(43, 2) + SourceIndex(0) --- >>>for (_f = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _g = _f.skills, primaryA = _g.primary, secondaryA = _g.secondary, _f, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { skills: { primary: primaryA, secondary: secondaryA } } = +2 >for ( +3 > { skills: { primary: primaryA, secondary: secondaryA } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > skills: { primary: primaryA, secondary: secondaryA } -8 > -9 > primary: primaryA -10> , -11> secondary: secondaryA +4 > +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA 1->Emitted(26, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(26, 4) Source(44, 4) + SourceIndex(0) -3 >Emitted(26, 5) Source(44, 5) + SourceIndex(0) -4 >Emitted(26, 6) Source(44, 6) + SourceIndex(0) -5 >Emitted(26, 84) Source(45, 90) + SourceIndex(0) -6 >Emitted(26, 86) Source(44, 8) + SourceIndex(0) -7 >Emitted(26, 100) Source(44, 60) + SourceIndex(0) -8 >Emitted(26, 102) Source(44, 18) + SourceIndex(0) -9 >Emitted(26, 123) Source(44, 35) + SourceIndex(0) -10>Emitted(26, 125) Source(44, 37) + SourceIndex(0) -11>Emitted(26, 150) Source(44, 58) + SourceIndex(0) +2 >Emitted(26, 6) Source(44, 6) + SourceIndex(0) +3 >Emitted(26, 84) Source(45, 90) + SourceIndex(0) +4 >Emitted(26, 86) Source(44, 8) + SourceIndex(0) +5 >Emitted(26, 100) Source(44, 60) + SourceIndex(0) +6 >Emitted(26, 102) Source(44, 18) + SourceIndex(0) +7 >Emitted(26, 123) Source(44, 35) + SourceIndex(0) +8 >Emitted(26, 125) Source(44, 37) + SourceIndex(0) +9 >Emitted(26, 150) Source(44, 58) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -857,8 +785,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > @@ -873,7 +800,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> i 11> ++ 12> ) -13> { 1 >Emitted(27, 5) Source(46, 5) + SourceIndex(0) 2 >Emitted(27, 6) Source(46, 6) + SourceIndex(0) 3 >Emitted(27, 9) Source(46, 9) + SourceIndex(0) @@ -886,7 +812,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10>Emitted(27, 20) Source(46, 20) + SourceIndex(0) 11>Emitted(27, 22) Source(46, 22) + SourceIndex(0) 12>Emitted(27, 24) Source(46, 24) + SourceIndex(0) -13>Emitted(27, 25) Source(46, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -897,7 +822,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -916,77 +841,65 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(28, 27) Source(47, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(29, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(48, 2) + SourceIndex(0) + >} +1 >Emitted(29, 2) Source(48, 2) + SourceIndex(0) --- >>>for (name = robot.name, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ({ -5 > name -6 > } = -7 > robot -8 > , -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ({ +3 > name +4 > } = +5 > robot +6 > , +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(30, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(49, 8) + SourceIndex(0) -5 >Emitted(30, 23) Source(49, 12) + SourceIndex(0) -6 >Emitted(30, 25) Source(49, 17) + SourceIndex(0) -7 >Emitted(30, 30) Source(49, 22) + SourceIndex(0) -8 >Emitted(30, 32) Source(49, 24) + SourceIndex(0) -9 >Emitted(30, 33) Source(49, 25) + SourceIndex(0) -10>Emitted(30, 36) Source(49, 28) + SourceIndex(0) -11>Emitted(30, 37) Source(49, 29) + SourceIndex(0) -12>Emitted(30, 39) Source(49, 31) + SourceIndex(0) -13>Emitted(30, 40) Source(49, 32) + SourceIndex(0) -14>Emitted(30, 43) Source(49, 35) + SourceIndex(0) -15>Emitted(30, 44) Source(49, 36) + SourceIndex(0) -16>Emitted(30, 46) Source(49, 38) + SourceIndex(0) -17>Emitted(30, 47) Source(49, 39) + SourceIndex(0) -18>Emitted(30, 49) Source(49, 41) + SourceIndex(0) -19>Emitted(30, 51) Source(49, 43) + SourceIndex(0) -20>Emitted(30, 52) Source(49, 44) + SourceIndex(0) +2 >Emitted(30, 6) Source(49, 8) + SourceIndex(0) +3 >Emitted(30, 23) Source(49, 12) + SourceIndex(0) +4 >Emitted(30, 25) Source(49, 17) + SourceIndex(0) +5 >Emitted(30, 30) Source(49, 22) + SourceIndex(0) +6 >Emitted(30, 32) Source(49, 24) + SourceIndex(0) +7 >Emitted(30, 33) Source(49, 25) + SourceIndex(0) +8 >Emitted(30, 36) Source(49, 28) + SourceIndex(0) +9 >Emitted(30, 37) Source(49, 29) + SourceIndex(0) +10>Emitted(30, 39) Source(49, 31) + SourceIndex(0) +11>Emitted(30, 40) Source(49, 32) + SourceIndex(0) +12>Emitted(30, 43) Source(49, 35) + SourceIndex(0) +13>Emitted(30, 44) Source(49, 36) + SourceIndex(0) +14>Emitted(30, 46) Source(49, 38) + SourceIndex(0) +15>Emitted(30, 47) Source(49, 39) + SourceIndex(0) +16>Emitted(30, 49) Source(49, 41) + SourceIndex(0) +17>Emitted(30, 51) Source(49, 43) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -997,7 +910,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1016,77 +929,65 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(31, 24) Source(50, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(32, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(51, 2) + SourceIndex(0) + >} +1 >Emitted(32, 2) Source(51, 2) + SourceIndex(0) --- >>>for (_h = getRobot(), name = _h.name, _h, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name } = getRobot() -6 > -7 > name -8 > } = getRobot(), -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > { name } = getRobot() +4 > +5 > name +6 > } = getRobot(), +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(33, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(52, 6) + SourceIndex(0) -5 >Emitted(33, 21) Source(52, 27) + SourceIndex(0) -6 >Emitted(33, 23) Source(52, 8) + SourceIndex(0) -7 >Emitted(33, 37) Source(52, 12) + SourceIndex(0) -8 >Emitted(33, 43) Source(52, 29) + SourceIndex(0) -9 >Emitted(33, 44) Source(52, 30) + SourceIndex(0) -10>Emitted(33, 47) Source(52, 33) + SourceIndex(0) -11>Emitted(33, 48) Source(52, 34) + SourceIndex(0) -12>Emitted(33, 50) Source(52, 36) + SourceIndex(0) -13>Emitted(33, 51) Source(52, 37) + SourceIndex(0) -14>Emitted(33, 54) Source(52, 40) + SourceIndex(0) -15>Emitted(33, 55) Source(52, 41) + SourceIndex(0) -16>Emitted(33, 57) Source(52, 43) + SourceIndex(0) -17>Emitted(33, 58) Source(52, 44) + SourceIndex(0) -18>Emitted(33, 60) Source(52, 46) + SourceIndex(0) -19>Emitted(33, 62) Source(52, 48) + SourceIndex(0) -20>Emitted(33, 63) Source(52, 49) + SourceIndex(0) +2 >Emitted(33, 6) Source(52, 6) + SourceIndex(0) +3 >Emitted(33, 21) Source(52, 27) + SourceIndex(0) +4 >Emitted(33, 23) Source(52, 8) + SourceIndex(0) +5 >Emitted(33, 37) Source(52, 12) + SourceIndex(0) +6 >Emitted(33, 43) Source(52, 29) + SourceIndex(0) +7 >Emitted(33, 44) Source(52, 30) + SourceIndex(0) +8 >Emitted(33, 47) Source(52, 33) + SourceIndex(0) +9 >Emitted(33, 48) Source(52, 34) + SourceIndex(0) +10>Emitted(33, 50) Source(52, 36) + SourceIndex(0) +11>Emitted(33, 51) Source(52, 37) + SourceIndex(0) +12>Emitted(33, 54) Source(52, 40) + SourceIndex(0) +13>Emitted(33, 55) Source(52, 41) + SourceIndex(0) +14>Emitted(33, 57) Source(52, 43) + SourceIndex(0) +15>Emitted(33, 58) Source(52, 44) + SourceIndex(0) +16>Emitted(33, 60) Source(52, 46) + SourceIndex(0) +17>Emitted(33, 62) Source(52, 48) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1097,7 +998,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1116,77 +1017,65 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(34, 24) Source(53, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(35, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) + >} +1 >Emitted(35, 2) Source(54, 2) + SourceIndex(0) --- >>>for (_j = { name: "trimmer", skill: "trimming" }, name = _j.name, _j, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^^^^^ -9 > ^ -10> ^^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^ -19> ^^ -20> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^^^^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^ +17> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name } = { name: "trimmer", skill: "trimming" } -6 > -7 > name -8 > } = { name: "trimmer", skill: "trimming" }, -9 > i -10> = -11> 0 -12> ; -13> i -14> < -15> 1 -16> ; -17> i -18> ++ -19> ) -20> { +2 >for ( +3 > { name } = { name: "trimmer", skill: "trimming" } +4 > +5 > name +6 > } = { name: "trimmer", skill: "trimming" }, +7 > i +8 > = +9 > 0 +10> ; +11> i +12> < +13> 1 +14> ; +15> i +16> ++ +17> ) 1->Emitted(36, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(36, 4) Source(55, 4) + SourceIndex(0) -3 >Emitted(36, 5) Source(55, 5) + SourceIndex(0) -4 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) -5 >Emitted(36, 49) Source(55, 62) + SourceIndex(0) -6 >Emitted(36, 51) Source(55, 8) + SourceIndex(0) -7 >Emitted(36, 65) Source(55, 12) + SourceIndex(0) -8 >Emitted(36, 71) Source(55, 64) + SourceIndex(0) -9 >Emitted(36, 72) Source(55, 65) + SourceIndex(0) -10>Emitted(36, 75) Source(55, 68) + SourceIndex(0) -11>Emitted(36, 76) Source(55, 69) + SourceIndex(0) -12>Emitted(36, 78) Source(55, 71) + SourceIndex(0) -13>Emitted(36, 79) Source(55, 72) + SourceIndex(0) -14>Emitted(36, 82) Source(55, 75) + SourceIndex(0) -15>Emitted(36, 83) Source(55, 76) + SourceIndex(0) -16>Emitted(36, 85) Source(55, 78) + SourceIndex(0) -17>Emitted(36, 86) Source(55, 79) + SourceIndex(0) -18>Emitted(36, 88) Source(55, 81) + SourceIndex(0) -19>Emitted(36, 90) Source(55, 83) + SourceIndex(0) -20>Emitted(36, 91) Source(55, 84) + SourceIndex(0) +2 >Emitted(36, 6) Source(55, 6) + SourceIndex(0) +3 >Emitted(36, 49) Source(55, 62) + SourceIndex(0) +4 >Emitted(36, 51) Source(55, 8) + SourceIndex(0) +5 >Emitted(36, 65) Source(55, 12) + SourceIndex(0) +6 >Emitted(36, 71) Source(55, 64) + SourceIndex(0) +7 >Emitted(36, 72) Source(55, 65) + SourceIndex(0) +8 >Emitted(36, 75) Source(55, 68) + SourceIndex(0) +9 >Emitted(36, 76) Source(55, 69) + SourceIndex(0) +10>Emitted(36, 78) Source(55, 71) + SourceIndex(0) +11>Emitted(36, 79) Source(55, 72) + SourceIndex(0) +12>Emitted(36, 82) Source(55, 75) + SourceIndex(0) +13>Emitted(36, 83) Source(55, 76) + SourceIndex(0) +14>Emitted(36, 85) Source(55, 78) + SourceIndex(0) +15>Emitted(36, 86) Source(55, 79) + SourceIndex(0) +16>Emitted(36, 88) Source(55, 81) + SourceIndex(0) +17>Emitted(36, 90) Source(55, 83) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1197,7 +1086,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1216,89 +1105,77 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(37, 24) Source(56, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(38, 1) Source(57, 1) + SourceIndex(0) -2 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) + >} +1 >Emitted(38, 2) Source(57, 2) + SourceIndex(0) --- >>>for (_k = multiRobot.skills, primary = _k.primary, secondary = _k.secondary, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^ +10> ^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ({ -5 > skills: { primary, secondary } -6 > -7 > primary -8 > , -9 > secondary -10> } } = -11> multiRobot -12> , -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ({ +3 > skills: { primary, secondary } +4 > +5 > primary +6 > , +7 > secondary +8 > } } = +9 > multiRobot +10> , +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(39, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(58, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(58, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(58, 8) + SourceIndex(0) -5 >Emitted(39, 28) Source(58, 38) + SourceIndex(0) -6 >Emitted(39, 30) Source(58, 18) + SourceIndex(0) -7 >Emitted(39, 50) Source(58, 25) + SourceIndex(0) -8 >Emitted(39, 52) Source(58, 27) + SourceIndex(0) -9 >Emitted(39, 76) Source(58, 36) + SourceIndex(0) -10>Emitted(39, 78) Source(58, 43) + SourceIndex(0) -11>Emitted(39, 88) Source(58, 53) + SourceIndex(0) -12>Emitted(39, 90) Source(58, 55) + SourceIndex(0) -13>Emitted(39, 91) Source(58, 56) + SourceIndex(0) -14>Emitted(39, 94) Source(58, 59) + SourceIndex(0) -15>Emitted(39, 95) Source(58, 60) + SourceIndex(0) -16>Emitted(39, 97) Source(58, 62) + SourceIndex(0) -17>Emitted(39, 98) Source(58, 63) + SourceIndex(0) -18>Emitted(39, 101) Source(58, 66) + SourceIndex(0) -19>Emitted(39, 102) Source(58, 67) + SourceIndex(0) -20>Emitted(39, 104) Source(58, 69) + SourceIndex(0) -21>Emitted(39, 105) Source(58, 70) + SourceIndex(0) -22>Emitted(39, 107) Source(58, 72) + SourceIndex(0) -23>Emitted(39, 109) Source(58, 74) + SourceIndex(0) -24>Emitted(39, 110) Source(58, 75) + SourceIndex(0) +2 >Emitted(39, 6) Source(58, 8) + SourceIndex(0) +3 >Emitted(39, 28) Source(58, 38) + SourceIndex(0) +4 >Emitted(39, 30) Source(58, 18) + SourceIndex(0) +5 >Emitted(39, 50) Source(58, 25) + SourceIndex(0) +6 >Emitted(39, 52) Source(58, 27) + SourceIndex(0) +7 >Emitted(39, 76) Source(58, 36) + SourceIndex(0) +8 >Emitted(39, 78) Source(58, 43) + SourceIndex(0) +9 >Emitted(39, 88) Source(58, 53) + SourceIndex(0) +10>Emitted(39, 90) Source(58, 55) + SourceIndex(0) +11>Emitted(39, 91) Source(58, 56) + SourceIndex(0) +12>Emitted(39, 94) Source(58, 59) + SourceIndex(0) +13>Emitted(39, 95) Source(58, 60) + SourceIndex(0) +14>Emitted(39, 97) Source(58, 62) + SourceIndex(0) +15>Emitted(39, 98) Source(58, 63) + SourceIndex(0) +16>Emitted(39, 101) Source(58, 66) + SourceIndex(0) +17>Emitted(39, 102) Source(58, 67) + SourceIndex(0) +18>Emitted(39, 104) Source(58, 69) + SourceIndex(0) +19>Emitted(39, 105) Source(58, 70) + SourceIndex(0) +20>Emitted(39, 107) Source(58, 72) + SourceIndex(0) +21>Emitted(39, 109) Source(58, 74) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1309,7 +1186,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1328,89 +1205,77 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(40, 27) Source(59, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(41, 1) Source(60, 1) + SourceIndex(0) -2 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) + >} +1 >Emitted(41, 2) Source(60, 2) + SourceIndex(0) --- >>>for (_l = getMultiRobot(), _m = _l.skills, primary = _m.primary, secondary = _m.secondary, _l, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^^^^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^ -18> ^^^ -19> ^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^^^^^ +11> ^ +12> ^^^ +13> ^ +14> ^^ +15> ^ +16> ^^^ +17> ^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { skills: { primary, secondary } } = getMultiRobot() -6 > -7 > skills: { primary, secondary } -8 > -9 > primary -10> , -11> secondary -12> } } = getMultiRobot(), -13> i -14> = -15> 0 -16> ; -17> i -18> < -19> 1 -20> ; -21> i -22> ++ -23> ) -24> { +2 >for ( +3 > { skills: { primary, secondary } } = getMultiRobot() +4 > +5 > skills: { primary, secondary } +6 > +7 > primary +8 > , +9 > secondary +10> } } = getMultiRobot(), +11> i +12> = +13> 0 +14> ; +15> i +16> < +17> 1 +18> ; +19> i +20> ++ +21> ) 1->Emitted(42, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(42, 4) Source(61, 4) + SourceIndex(0) -3 >Emitted(42, 5) Source(61, 5) + SourceIndex(0) -4 >Emitted(42, 6) Source(61, 6) + SourceIndex(0) -5 >Emitted(42, 26) Source(61, 58) + SourceIndex(0) -6 >Emitted(42, 28) Source(61, 8) + SourceIndex(0) -7 >Emitted(42, 42) Source(61, 38) + SourceIndex(0) -8 >Emitted(42, 44) Source(61, 18) + SourceIndex(0) -9 >Emitted(42, 64) Source(61, 25) + SourceIndex(0) -10>Emitted(42, 66) Source(61, 27) + SourceIndex(0) -11>Emitted(42, 90) Source(61, 36) + SourceIndex(0) -12>Emitted(42, 96) Source(61, 60) + SourceIndex(0) -13>Emitted(42, 97) Source(61, 61) + SourceIndex(0) -14>Emitted(42, 100) Source(61, 64) + SourceIndex(0) -15>Emitted(42, 101) Source(61, 65) + SourceIndex(0) -16>Emitted(42, 103) Source(61, 67) + SourceIndex(0) -17>Emitted(42, 104) Source(61, 68) + SourceIndex(0) -18>Emitted(42, 107) Source(61, 71) + SourceIndex(0) -19>Emitted(42, 108) Source(61, 72) + SourceIndex(0) -20>Emitted(42, 110) Source(61, 74) + SourceIndex(0) -21>Emitted(42, 111) Source(61, 75) + SourceIndex(0) -22>Emitted(42, 113) Source(61, 77) + SourceIndex(0) -23>Emitted(42, 115) Source(61, 79) + SourceIndex(0) -24>Emitted(42, 116) Source(61, 80) + SourceIndex(0) +2 >Emitted(42, 6) Source(61, 6) + SourceIndex(0) +3 >Emitted(42, 26) Source(61, 58) + SourceIndex(0) +4 >Emitted(42, 28) Source(61, 8) + SourceIndex(0) +5 >Emitted(42, 42) Source(61, 38) + SourceIndex(0) +6 >Emitted(42, 44) Source(61, 18) + SourceIndex(0) +7 >Emitted(42, 64) Source(61, 25) + SourceIndex(0) +8 >Emitted(42, 66) Source(61, 27) + SourceIndex(0) +9 >Emitted(42, 90) Source(61, 36) + SourceIndex(0) +10>Emitted(42, 96) Source(61, 60) + SourceIndex(0) +11>Emitted(42, 97) Source(61, 61) + SourceIndex(0) +12>Emitted(42, 100) Source(61, 64) + SourceIndex(0) +13>Emitted(42, 101) Source(61, 65) + SourceIndex(0) +14>Emitted(42, 103) Source(61, 67) + SourceIndex(0) +15>Emitted(42, 104) Source(61, 68) + SourceIndex(0) +16>Emitted(42, 107) Source(61, 71) + SourceIndex(0) +17>Emitted(42, 108) Source(61, 72) + SourceIndex(0) +18>Emitted(42, 110) Source(61, 74) + SourceIndex(0) +19>Emitted(42, 111) Source(61, 75) + SourceIndex(0) +20>Emitted(42, 113) Source(61, 77) + SourceIndex(0) +21>Emitted(42, 115) Source(61, 79) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1421,7 +1286,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1440,51 +1305,42 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(43, 27) Source(62, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(44, 1) Source(63, 1) + SourceIndex(0) -2 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) + >} +1 >Emitted(44, 2) Source(63, 2) + SourceIndex(0) --- >>>for (_o = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _p = _o.skills, primary = _p.primary, secondary = _p.secondary, _o, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { skills: { primary, secondary } } = +2 >for ( +3 > { skills: { primary, secondary } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > skills: { primary, secondary } -8 > -9 > primary -10> , -11> secondary +4 > +5 > skills: { primary, secondary } +6 > +7 > primary +8 > , +9 > secondary 1->Emitted(45, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(64, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(64, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) -5 >Emitted(45, 84) Source(65, 90) + SourceIndex(0) -6 >Emitted(45, 86) Source(64, 8) + SourceIndex(0) -7 >Emitted(45, 100) Source(64, 38) + SourceIndex(0) -8 >Emitted(45, 102) Source(64, 18) + SourceIndex(0) -9 >Emitted(45, 122) Source(64, 25) + SourceIndex(0) -10>Emitted(45, 124) Source(64, 27) + SourceIndex(0) -11>Emitted(45, 148) Source(64, 36) + SourceIndex(0) +2 >Emitted(45, 6) Source(64, 6) + SourceIndex(0) +3 >Emitted(45, 84) Source(65, 90) + SourceIndex(0) +4 >Emitted(45, 86) Source(64, 8) + SourceIndex(0) +5 >Emitted(45, 100) Source(64, 38) + SourceIndex(0) +6 >Emitted(45, 102) Source(64, 18) + SourceIndex(0) +7 >Emitted(45, 122) Source(64, 25) + SourceIndex(0) +8 >Emitted(45, 124) Source(64, 27) + SourceIndex(0) +9 >Emitted(45, 148) Source(64, 36) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -1499,8 +1355,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > @@ -1515,7 +1370,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> i 11> ++ 12> ) -13> { 1 >Emitted(46, 5) Source(66, 5) + SourceIndex(0) 2 >Emitted(46, 6) Source(66, 6) + SourceIndex(0) 3 >Emitted(46, 9) Source(66, 9) + SourceIndex(0) @@ -1528,7 +1382,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10>Emitted(46, 20) Source(66, 20) + SourceIndex(0) 11>Emitted(46, 22) Source(66, 22) + SourceIndex(0) 12>Emitted(46, 24) Source(66, 24) + SourceIndex(0) -13>Emitted(46, 25) Source(66, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -1539,7 +1392,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -1558,85 +1411,73 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(47, 27) Source(67, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(48, 1) Source(68, 1) + SourceIndex(0) -2 >Emitted(48, 2) Source(68, 2) + SourceIndex(0) + >} +1 >Emitted(48, 2) Source(68, 2) + SourceIndex(0) --- >>>for (nameA = robot.name, skillA = robot.skill, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > > > -2 >for -3 > -4 > ({ -5 > name: nameA -6 > , -7 > skill: skillA -8 > } = -9 > robot -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ({ +3 > name: nameA +4 > , +5 > skill: skillA +6 > } = +7 > robot +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(49, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(71, 8) + SourceIndex(0) -5 >Emitted(49, 24) Source(71, 19) + SourceIndex(0) -6 >Emitted(49, 26) Source(71, 21) + SourceIndex(0) -7 >Emitted(49, 46) Source(71, 34) + SourceIndex(0) -8 >Emitted(49, 48) Source(71, 39) + SourceIndex(0) -9 >Emitted(49, 53) Source(71, 44) + SourceIndex(0) -10>Emitted(49, 55) Source(71, 46) + SourceIndex(0) -11>Emitted(49, 56) Source(71, 47) + SourceIndex(0) -12>Emitted(49, 59) Source(71, 50) + SourceIndex(0) -13>Emitted(49, 60) Source(71, 51) + SourceIndex(0) -14>Emitted(49, 62) Source(71, 53) + SourceIndex(0) -15>Emitted(49, 63) Source(71, 54) + SourceIndex(0) -16>Emitted(49, 66) Source(71, 57) + SourceIndex(0) -17>Emitted(49, 67) Source(71, 58) + SourceIndex(0) -18>Emitted(49, 69) Source(71, 60) + SourceIndex(0) -19>Emitted(49, 70) Source(71, 61) + SourceIndex(0) -20>Emitted(49, 72) Source(71, 63) + SourceIndex(0) -21>Emitted(49, 74) Source(71, 65) + SourceIndex(0) -22>Emitted(49, 75) Source(71, 66) + SourceIndex(0) +2 >Emitted(49, 6) Source(71, 8) + SourceIndex(0) +3 >Emitted(49, 24) Source(71, 19) + SourceIndex(0) +4 >Emitted(49, 26) Source(71, 21) + SourceIndex(0) +5 >Emitted(49, 46) Source(71, 34) + SourceIndex(0) +6 >Emitted(49, 48) Source(71, 39) + SourceIndex(0) +7 >Emitted(49, 53) Source(71, 44) + SourceIndex(0) +8 >Emitted(49, 55) Source(71, 46) + SourceIndex(0) +9 >Emitted(49, 56) Source(71, 47) + SourceIndex(0) +10>Emitted(49, 59) Source(71, 50) + SourceIndex(0) +11>Emitted(49, 60) Source(71, 51) + SourceIndex(0) +12>Emitted(49, 62) Source(71, 53) + SourceIndex(0) +13>Emitted(49, 63) Source(71, 54) + SourceIndex(0) +14>Emitted(49, 66) Source(71, 57) + SourceIndex(0) +15>Emitted(49, 67) Source(71, 58) + SourceIndex(0) +16>Emitted(49, 69) Source(71, 60) + SourceIndex(0) +17>Emitted(49, 70) Source(71, 61) + SourceIndex(0) +18>Emitted(49, 72) Source(71, 63) + SourceIndex(0) +19>Emitted(49, 74) Source(71, 65) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1647,7 +1488,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1666,83 +1507,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(50, 24) Source(72, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(51, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(51, 2) Source(73, 2) + SourceIndex(0) + >} +1 >Emitted(51, 2) Source(73, 2) + SourceIndex(0) --- >>>for (_q = getRobot(), nameA = _q.name, skillA = _q.skill, _q, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name: nameA, skill: skillA } = getRobot() -6 > -7 > name: nameA -8 > , -9 > skill: skillA -10> } = getRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > { name: nameA, skill: skillA } = getRobot() +4 > +5 > name: nameA +6 > , +7 > skill: skillA +8 > } = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(52, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(52, 4) Source(74, 4) + SourceIndex(0) -3 >Emitted(52, 5) Source(74, 5) + SourceIndex(0) -4 >Emitted(52, 6) Source(74, 6) + SourceIndex(0) -5 >Emitted(52, 21) Source(74, 49) + SourceIndex(0) -6 >Emitted(52, 23) Source(74, 8) + SourceIndex(0) -7 >Emitted(52, 38) Source(74, 19) + SourceIndex(0) -8 >Emitted(52, 40) Source(74, 21) + SourceIndex(0) -9 >Emitted(52, 57) Source(74, 34) + SourceIndex(0) -10>Emitted(52, 63) Source(74, 51) + SourceIndex(0) -11>Emitted(52, 64) Source(74, 52) + SourceIndex(0) -12>Emitted(52, 67) Source(74, 55) + SourceIndex(0) -13>Emitted(52, 68) Source(74, 56) + SourceIndex(0) -14>Emitted(52, 70) Source(74, 58) + SourceIndex(0) -15>Emitted(52, 71) Source(74, 59) + SourceIndex(0) -16>Emitted(52, 74) Source(74, 62) + SourceIndex(0) -17>Emitted(52, 75) Source(74, 63) + SourceIndex(0) -18>Emitted(52, 77) Source(74, 65) + SourceIndex(0) -19>Emitted(52, 78) Source(74, 66) + SourceIndex(0) -20>Emitted(52, 80) Source(74, 68) + SourceIndex(0) -21>Emitted(52, 82) Source(74, 70) + SourceIndex(0) -22>Emitted(52, 83) Source(74, 71) + SourceIndex(0) +2 >Emitted(52, 6) Source(74, 6) + SourceIndex(0) +3 >Emitted(52, 21) Source(74, 49) + SourceIndex(0) +4 >Emitted(52, 23) Source(74, 8) + SourceIndex(0) +5 >Emitted(52, 38) Source(74, 19) + SourceIndex(0) +6 >Emitted(52, 40) Source(74, 21) + SourceIndex(0) +7 >Emitted(52, 57) Source(74, 34) + SourceIndex(0) +8 >Emitted(52, 63) Source(74, 51) + SourceIndex(0) +9 >Emitted(52, 64) Source(74, 52) + SourceIndex(0) +10>Emitted(52, 67) Source(74, 55) + SourceIndex(0) +11>Emitted(52, 68) Source(74, 56) + SourceIndex(0) +12>Emitted(52, 70) Source(74, 58) + SourceIndex(0) +13>Emitted(52, 71) Source(74, 59) + SourceIndex(0) +14>Emitted(52, 74) Source(74, 62) + SourceIndex(0) +15>Emitted(52, 75) Source(74, 63) + SourceIndex(0) +16>Emitted(52, 77) Source(74, 65) + SourceIndex(0) +17>Emitted(52, 78) Source(74, 66) + SourceIndex(0) +18>Emitted(52, 80) Source(74, 68) + SourceIndex(0) +19>Emitted(52, 82) Source(74, 70) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1753,7 +1582,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1772,83 +1601,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(53, 24) Source(75, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(54, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(54, 2) Source(76, 2) + SourceIndex(0) + >} +1 >Emitted(54, 2) Source(76, 2) + SourceIndex(0) --- >>>for (_r = { name: "trimmer", skill: "trimming" }, nameA = _r.name, skillA = _r.skill, _r, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } -6 > -7 > name: nameA -8 > , -9 > skill: skillA -10> } = { name: "trimmer", skill: "trimming" }, -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > { name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming" } +4 > +5 > name: nameA +6 > , +7 > skill: skillA +8 > } = { name: "trimmer", skill: "trimming" }, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(55, 1) Source(77, 1) + SourceIndex(0) -2 >Emitted(55, 4) Source(77, 4) + SourceIndex(0) -3 >Emitted(55, 5) Source(77, 5) + SourceIndex(0) -4 >Emitted(55, 6) Source(77, 6) + SourceIndex(0) -5 >Emitted(55, 49) Source(77, 84) + SourceIndex(0) -6 >Emitted(55, 51) Source(77, 8) + SourceIndex(0) -7 >Emitted(55, 66) Source(77, 19) + SourceIndex(0) -8 >Emitted(55, 68) Source(77, 21) + SourceIndex(0) -9 >Emitted(55, 85) Source(77, 34) + SourceIndex(0) -10>Emitted(55, 91) Source(77, 86) + SourceIndex(0) -11>Emitted(55, 92) Source(77, 87) + SourceIndex(0) -12>Emitted(55, 95) Source(77, 90) + SourceIndex(0) -13>Emitted(55, 96) Source(77, 91) + SourceIndex(0) -14>Emitted(55, 98) Source(77, 93) + SourceIndex(0) -15>Emitted(55, 99) Source(77, 94) + SourceIndex(0) -16>Emitted(55, 102) Source(77, 97) + SourceIndex(0) -17>Emitted(55, 103) Source(77, 98) + SourceIndex(0) -18>Emitted(55, 105) Source(77, 100) + SourceIndex(0) -19>Emitted(55, 106) Source(77, 101) + SourceIndex(0) -20>Emitted(55, 108) Source(77, 103) + SourceIndex(0) -21>Emitted(55, 110) Source(77, 105) + SourceIndex(0) -22>Emitted(55, 111) Source(77, 106) + SourceIndex(0) +2 >Emitted(55, 6) Source(77, 6) + SourceIndex(0) +3 >Emitted(55, 49) Source(77, 84) + SourceIndex(0) +4 >Emitted(55, 51) Source(77, 8) + SourceIndex(0) +5 >Emitted(55, 66) Source(77, 19) + SourceIndex(0) +6 >Emitted(55, 68) Source(77, 21) + SourceIndex(0) +7 >Emitted(55, 85) Source(77, 34) + SourceIndex(0) +8 >Emitted(55, 91) Source(77, 86) + SourceIndex(0) +9 >Emitted(55, 92) Source(77, 87) + SourceIndex(0) +10>Emitted(55, 95) Source(77, 90) + SourceIndex(0) +11>Emitted(55, 96) Source(77, 91) + SourceIndex(0) +12>Emitted(55, 98) Source(77, 93) + SourceIndex(0) +13>Emitted(55, 99) Source(77, 94) + SourceIndex(0) +14>Emitted(55, 102) Source(77, 97) + SourceIndex(0) +15>Emitted(55, 103) Source(77, 98) + SourceIndex(0) +16>Emitted(55, 105) Source(77, 100) + SourceIndex(0) +17>Emitted(55, 106) Source(77, 101) + SourceIndex(0) +18>Emitted(55, 108) Source(77, 103) + SourceIndex(0) +19>Emitted(55, 110) Source(77, 105) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1859,7 +1676,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1878,95 +1695,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(56, 24) Source(78, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(57, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(57, 2) Source(79, 2) + SourceIndex(0) + >} +1 >Emitted(57, 2) Source(79, 2) + SourceIndex(0) --- >>>for (nameA = multiRobot.name, _s = multiRobot.skills, primaryA = _s.primary, secondaryA = _s.secondary, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ({ -5 > name: nameA -6 > , -7 > skills: { primary: primaryA, secondary: secondaryA } -8 > -9 > primary: primaryA -10> , -11> secondary: secondaryA -12> } } = -13> multiRobot -14> , -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ({ +3 > name: nameA +4 > , +5 > skills: { primary: primaryA, secondary: secondaryA } +6 > +7 > primary: primaryA +8 > , +9 > secondary: secondaryA +10> } } = +11> multiRobot +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(58, 1) Source(80, 1) + SourceIndex(0) -2 >Emitted(58, 4) Source(80, 4) + SourceIndex(0) -3 >Emitted(58, 5) Source(80, 5) + SourceIndex(0) -4 >Emitted(58, 6) Source(80, 8) + SourceIndex(0) -5 >Emitted(58, 29) Source(80, 19) + SourceIndex(0) -6 >Emitted(58, 31) Source(80, 21) + SourceIndex(0) -7 >Emitted(58, 53) Source(80, 73) + SourceIndex(0) -8 >Emitted(58, 55) Source(80, 31) + SourceIndex(0) -9 >Emitted(58, 76) Source(80, 48) + SourceIndex(0) -10>Emitted(58, 78) Source(80, 50) + SourceIndex(0) -11>Emitted(58, 103) Source(80, 71) + SourceIndex(0) -12>Emitted(58, 105) Source(80, 78) + SourceIndex(0) -13>Emitted(58, 115) Source(80, 88) + SourceIndex(0) -14>Emitted(58, 117) Source(80, 90) + SourceIndex(0) -15>Emitted(58, 118) Source(80, 91) + SourceIndex(0) -16>Emitted(58, 121) Source(80, 94) + SourceIndex(0) -17>Emitted(58, 122) Source(80, 95) + SourceIndex(0) -18>Emitted(58, 124) Source(80, 97) + SourceIndex(0) -19>Emitted(58, 125) Source(80, 98) + SourceIndex(0) -20>Emitted(58, 128) Source(80, 101) + SourceIndex(0) -21>Emitted(58, 129) Source(80, 102) + SourceIndex(0) -22>Emitted(58, 131) Source(80, 104) + SourceIndex(0) -23>Emitted(58, 132) Source(80, 105) + SourceIndex(0) -24>Emitted(58, 134) Source(80, 107) + SourceIndex(0) -25>Emitted(58, 136) Source(80, 109) + SourceIndex(0) -26>Emitted(58, 137) Source(80, 110) + SourceIndex(0) +2 >Emitted(58, 6) Source(80, 8) + SourceIndex(0) +3 >Emitted(58, 29) Source(80, 19) + SourceIndex(0) +4 >Emitted(58, 31) Source(80, 21) + SourceIndex(0) +5 >Emitted(58, 53) Source(80, 73) + SourceIndex(0) +6 >Emitted(58, 55) Source(80, 31) + SourceIndex(0) +7 >Emitted(58, 76) Source(80, 48) + SourceIndex(0) +8 >Emitted(58, 78) Source(80, 50) + SourceIndex(0) +9 >Emitted(58, 103) Source(80, 71) + SourceIndex(0) +10>Emitted(58, 105) Source(80, 78) + SourceIndex(0) +11>Emitted(58, 115) Source(80, 88) + SourceIndex(0) +12>Emitted(58, 117) Source(80, 90) + SourceIndex(0) +13>Emitted(58, 118) Source(80, 91) + SourceIndex(0) +14>Emitted(58, 121) Source(80, 94) + SourceIndex(0) +15>Emitted(58, 122) Source(80, 95) + SourceIndex(0) +16>Emitted(58, 124) Source(80, 97) + SourceIndex(0) +17>Emitted(58, 125) Source(80, 98) + SourceIndex(0) +18>Emitted(58, 128) Source(80, 101) + SourceIndex(0) +19>Emitted(58, 129) Source(80, 102) + SourceIndex(0) +20>Emitted(58, 131) Source(80, 104) + SourceIndex(0) +21>Emitted(58, 132) Source(80, 105) + SourceIndex(0) +22>Emitted(58, 134) Source(80, 107) + SourceIndex(0) +23>Emitted(58, 136) Source(80, 109) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1977,7 +1782,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1996,95 +1801,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(59, 27) Source(81, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(60, 1) Source(82, 1) + SourceIndex(0) -2 >Emitted(60, 2) Source(82, 2) + SourceIndex(0) + >} +1 >Emitted(60, 2) Source(82, 2) + SourceIndex(0) --- >>>for (_t = getMultiRobot(), nameA = _t.name, _u = _t.skills, primaryA = _u.primary, secondaryA = _u.secondary, _t, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() -6 > -7 > name: nameA -8 > , -9 > skills: { primary: primaryA, secondary: secondaryA } -10> -11> primary: primaryA -12> , -13> secondary: secondaryA -14> } } = getMultiRobot(), -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = getMultiRobot() +4 > +5 > name: nameA +6 > , +7 > skills: { primary: primaryA, secondary: secondaryA } +8 > +9 > primary: primaryA +10> , +11> secondary: secondaryA +12> } } = getMultiRobot(), +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(61, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(83, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(83, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(83, 6) + SourceIndex(0) -5 >Emitted(61, 26) Source(83, 93) + SourceIndex(0) -6 >Emitted(61, 28) Source(83, 8) + SourceIndex(0) -7 >Emitted(61, 43) Source(83, 19) + SourceIndex(0) -8 >Emitted(61, 45) Source(83, 21) + SourceIndex(0) -9 >Emitted(61, 59) Source(83, 73) + SourceIndex(0) -10>Emitted(61, 61) Source(83, 31) + SourceIndex(0) -11>Emitted(61, 82) Source(83, 48) + SourceIndex(0) -12>Emitted(61, 84) Source(83, 50) + SourceIndex(0) -13>Emitted(61, 109) Source(83, 71) + SourceIndex(0) -14>Emitted(61, 115) Source(83, 95) + SourceIndex(0) -15>Emitted(61, 116) Source(83, 96) + SourceIndex(0) -16>Emitted(61, 119) Source(83, 99) + SourceIndex(0) -17>Emitted(61, 120) Source(83, 100) + SourceIndex(0) -18>Emitted(61, 122) Source(83, 102) + SourceIndex(0) -19>Emitted(61, 123) Source(83, 103) + SourceIndex(0) -20>Emitted(61, 126) Source(83, 106) + SourceIndex(0) -21>Emitted(61, 127) Source(83, 107) + SourceIndex(0) -22>Emitted(61, 129) Source(83, 109) + SourceIndex(0) -23>Emitted(61, 130) Source(83, 110) + SourceIndex(0) -24>Emitted(61, 132) Source(83, 112) + SourceIndex(0) -25>Emitted(61, 134) Source(83, 114) + SourceIndex(0) -26>Emitted(61, 135) Source(83, 115) + SourceIndex(0) +2 >Emitted(61, 6) Source(83, 6) + SourceIndex(0) +3 >Emitted(61, 26) Source(83, 93) + SourceIndex(0) +4 >Emitted(61, 28) Source(83, 8) + SourceIndex(0) +5 >Emitted(61, 43) Source(83, 19) + SourceIndex(0) +6 >Emitted(61, 45) Source(83, 21) + SourceIndex(0) +7 >Emitted(61, 59) Source(83, 73) + SourceIndex(0) +8 >Emitted(61, 61) Source(83, 31) + SourceIndex(0) +9 >Emitted(61, 82) Source(83, 48) + SourceIndex(0) +10>Emitted(61, 84) Source(83, 50) + SourceIndex(0) +11>Emitted(61, 109) Source(83, 71) + SourceIndex(0) +12>Emitted(61, 115) Source(83, 95) + SourceIndex(0) +13>Emitted(61, 116) Source(83, 96) + SourceIndex(0) +14>Emitted(61, 119) Source(83, 99) + SourceIndex(0) +15>Emitted(61, 120) Source(83, 100) + SourceIndex(0) +16>Emitted(61, 122) Source(83, 102) + SourceIndex(0) +17>Emitted(61, 123) Source(83, 103) + SourceIndex(0) +18>Emitted(61, 126) Source(83, 106) + SourceIndex(0) +19>Emitted(61, 127) Source(83, 107) + SourceIndex(0) +20>Emitted(61, 129) Source(83, 109) + SourceIndex(0) +21>Emitted(61, 130) Source(83, 110) + SourceIndex(0) +22>Emitted(61, 132) Source(83, 112) + SourceIndex(0) +23>Emitted(61, 134) Source(83, 114) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -2095,7 +1888,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2114,57 +1907,48 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(62, 27) Source(84, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(63, 1) Source(85, 1) + SourceIndex(0) -2 >Emitted(63, 2) Source(85, 2) + SourceIndex(0) + >} +1 >Emitted(63, 2) Source(85, 2) + SourceIndex(0) --- >>>for (_v = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, nameA = _v.name, _w = _v.skills, primaryA = _w.primary, secondaryA = _w.secondary, _v, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = +2 >for ( +3 > { name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > name: nameA -8 > , -9 > skills: { primary: primaryA, secondary: secondaryA } -10> -11> primary: primaryA -12> , -13> secondary: secondaryA +4 > +5 > name: nameA +6 > , +7 > skills: { primary: primaryA, secondary: secondaryA } +8 > +9 > primary: primaryA +10> , +11> secondary: secondaryA 1->Emitted(64, 1) Source(86, 1) + SourceIndex(0) -2 >Emitted(64, 4) Source(86, 4) + SourceIndex(0) -3 >Emitted(64, 5) Source(86, 5) + SourceIndex(0) -4 >Emitted(64, 6) Source(86, 6) + SourceIndex(0) -5 >Emitted(64, 84) Source(87, 90) + SourceIndex(0) -6 >Emitted(64, 86) Source(86, 8) + SourceIndex(0) -7 >Emitted(64, 101) Source(86, 19) + SourceIndex(0) -8 >Emitted(64, 103) Source(86, 21) + SourceIndex(0) -9 >Emitted(64, 117) Source(86, 73) + SourceIndex(0) -10>Emitted(64, 119) Source(86, 31) + SourceIndex(0) -11>Emitted(64, 140) Source(86, 48) + SourceIndex(0) -12>Emitted(64, 142) Source(86, 50) + SourceIndex(0) -13>Emitted(64, 167) Source(86, 71) + SourceIndex(0) +2 >Emitted(64, 6) Source(86, 6) + SourceIndex(0) +3 >Emitted(64, 84) Source(87, 90) + SourceIndex(0) +4 >Emitted(64, 86) Source(86, 8) + SourceIndex(0) +5 >Emitted(64, 101) Source(86, 19) + SourceIndex(0) +6 >Emitted(64, 103) Source(86, 21) + SourceIndex(0) +7 >Emitted(64, 117) Source(86, 73) + SourceIndex(0) +8 >Emitted(64, 119) Source(86, 31) + SourceIndex(0) +9 >Emitted(64, 140) Source(86, 48) + SourceIndex(0) +10>Emitted(64, 142) Source(86, 50) + SourceIndex(0) +11>Emitted(64, 167) Source(86, 71) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -2179,8 +1963,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > @@ -2195,7 +1978,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> i 11> ++ 12> ) -13> { 1 >Emitted(65, 5) Source(88, 5) + SourceIndex(0) 2 >Emitted(65, 6) Source(88, 6) + SourceIndex(0) 3 >Emitted(65, 9) Source(88, 9) + SourceIndex(0) @@ -2208,7 +1990,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10>Emitted(65, 20) Source(88, 20) + SourceIndex(0) 11>Emitted(65, 22) Source(88, 22) + SourceIndex(0) 12>Emitted(65, 24) Source(88, 24) + SourceIndex(0) -13>Emitted(65, 25) Source(88, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -2219,7 +2000,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -2238,83 +2019,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(66, 27) Source(89, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(67, 1) Source(90, 1) + SourceIndex(0) -2 >Emitted(67, 2) Source(90, 2) + SourceIndex(0) + >} +1 >Emitted(67, 2) Source(90, 2) + SourceIndex(0) --- >>>for (name = robot.name, skill = robot.skill, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ({ -5 > name -6 > , -7 > skill -8 > } = -9 > robot -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ({ +3 > name +4 > , +5 > skill +6 > } = +7 > robot +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(68, 1) Source(91, 1) + SourceIndex(0) -2 >Emitted(68, 4) Source(91, 4) + SourceIndex(0) -3 >Emitted(68, 5) Source(91, 5) + SourceIndex(0) -4 >Emitted(68, 6) Source(91, 8) + SourceIndex(0) -5 >Emitted(68, 23) Source(91, 12) + SourceIndex(0) -6 >Emitted(68, 25) Source(91, 14) + SourceIndex(0) -7 >Emitted(68, 44) Source(91, 19) + SourceIndex(0) -8 >Emitted(68, 46) Source(91, 24) + SourceIndex(0) -9 >Emitted(68, 51) Source(91, 29) + SourceIndex(0) -10>Emitted(68, 53) Source(91, 31) + SourceIndex(0) -11>Emitted(68, 54) Source(91, 32) + SourceIndex(0) -12>Emitted(68, 57) Source(91, 35) + SourceIndex(0) -13>Emitted(68, 58) Source(91, 36) + SourceIndex(0) -14>Emitted(68, 60) Source(91, 38) + SourceIndex(0) -15>Emitted(68, 61) Source(91, 39) + SourceIndex(0) -16>Emitted(68, 64) Source(91, 42) + SourceIndex(0) -17>Emitted(68, 65) Source(91, 43) + SourceIndex(0) -18>Emitted(68, 67) Source(91, 45) + SourceIndex(0) -19>Emitted(68, 68) Source(91, 46) + SourceIndex(0) -20>Emitted(68, 70) Source(91, 48) + SourceIndex(0) -21>Emitted(68, 72) Source(91, 50) + SourceIndex(0) -22>Emitted(68, 73) Source(91, 51) + SourceIndex(0) +2 >Emitted(68, 6) Source(91, 8) + SourceIndex(0) +3 >Emitted(68, 23) Source(91, 12) + SourceIndex(0) +4 >Emitted(68, 25) Source(91, 14) + SourceIndex(0) +5 >Emitted(68, 44) Source(91, 19) + SourceIndex(0) +6 >Emitted(68, 46) Source(91, 24) + SourceIndex(0) +7 >Emitted(68, 51) Source(91, 29) + SourceIndex(0) +8 >Emitted(68, 53) Source(91, 31) + SourceIndex(0) +9 >Emitted(68, 54) Source(91, 32) + SourceIndex(0) +10>Emitted(68, 57) Source(91, 35) + SourceIndex(0) +11>Emitted(68, 58) Source(91, 36) + SourceIndex(0) +12>Emitted(68, 60) Source(91, 38) + SourceIndex(0) +13>Emitted(68, 61) Source(91, 39) + SourceIndex(0) +14>Emitted(68, 64) Source(91, 42) + SourceIndex(0) +15>Emitted(68, 65) Source(91, 43) + SourceIndex(0) +16>Emitted(68, 67) Source(91, 45) + SourceIndex(0) +17>Emitted(68, 68) Source(91, 46) + SourceIndex(0) +18>Emitted(68, 70) Source(91, 48) + SourceIndex(0) +19>Emitted(68, 72) Source(91, 50) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -2325,7 +2094,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2344,83 +2113,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(69, 24) Source(92, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(70, 1) Source(93, 1) + SourceIndex(0) -2 >Emitted(70, 2) Source(93, 2) + SourceIndex(0) + >} +1 >Emitted(70, 2) Source(93, 2) + SourceIndex(0) --- >>>for (_x = getRobot(), name = _x.name, skill = _x.skill, _x, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name, skill } = getRobot() -6 > -7 > name -8 > , -9 > skill -10> } = getRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > { name, skill } = getRobot() +4 > +5 > name +6 > , +7 > skill +8 > } = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(71, 1) Source(94, 1) + SourceIndex(0) -2 >Emitted(71, 4) Source(94, 4) + SourceIndex(0) -3 >Emitted(71, 5) Source(94, 5) + SourceIndex(0) -4 >Emitted(71, 6) Source(94, 6) + SourceIndex(0) -5 >Emitted(71, 21) Source(94, 34) + SourceIndex(0) -6 >Emitted(71, 23) Source(94, 8) + SourceIndex(0) -7 >Emitted(71, 37) Source(94, 12) + SourceIndex(0) -8 >Emitted(71, 39) Source(94, 14) + SourceIndex(0) -9 >Emitted(71, 55) Source(94, 19) + SourceIndex(0) -10>Emitted(71, 61) Source(94, 36) + SourceIndex(0) -11>Emitted(71, 62) Source(94, 37) + SourceIndex(0) -12>Emitted(71, 65) Source(94, 40) + SourceIndex(0) -13>Emitted(71, 66) Source(94, 41) + SourceIndex(0) -14>Emitted(71, 68) Source(94, 43) + SourceIndex(0) -15>Emitted(71, 69) Source(94, 44) + SourceIndex(0) -16>Emitted(71, 72) Source(94, 47) + SourceIndex(0) -17>Emitted(71, 73) Source(94, 48) + SourceIndex(0) -18>Emitted(71, 75) Source(94, 50) + SourceIndex(0) -19>Emitted(71, 76) Source(94, 51) + SourceIndex(0) -20>Emitted(71, 78) Source(94, 53) + SourceIndex(0) -21>Emitted(71, 80) Source(94, 55) + SourceIndex(0) -22>Emitted(71, 81) Source(94, 56) + SourceIndex(0) +2 >Emitted(71, 6) Source(94, 6) + SourceIndex(0) +3 >Emitted(71, 21) Source(94, 34) + SourceIndex(0) +4 >Emitted(71, 23) Source(94, 8) + SourceIndex(0) +5 >Emitted(71, 37) Source(94, 12) + SourceIndex(0) +6 >Emitted(71, 39) Source(94, 14) + SourceIndex(0) +7 >Emitted(71, 55) Source(94, 19) + SourceIndex(0) +8 >Emitted(71, 61) Source(94, 36) + SourceIndex(0) +9 >Emitted(71, 62) Source(94, 37) + SourceIndex(0) +10>Emitted(71, 65) Source(94, 40) + SourceIndex(0) +11>Emitted(71, 66) Source(94, 41) + SourceIndex(0) +12>Emitted(71, 68) Source(94, 43) + SourceIndex(0) +13>Emitted(71, 69) Source(94, 44) + SourceIndex(0) +14>Emitted(71, 72) Source(94, 47) + SourceIndex(0) +15>Emitted(71, 73) Source(94, 48) + SourceIndex(0) +16>Emitted(71, 75) Source(94, 50) + SourceIndex(0) +17>Emitted(71, 76) Source(94, 51) + SourceIndex(0) +18>Emitted(71, 78) Source(94, 53) + SourceIndex(0) +19>Emitted(71, 80) Source(94, 55) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -2431,7 +2188,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2450,83 +2207,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(72, 24) Source(95, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(73, 1) Source(96, 1) + SourceIndex(0) -2 >Emitted(73, 2) Source(96, 2) + SourceIndex(0) + >} +1 >Emitted(73, 2) Source(96, 2) + SourceIndex(0) --- >>>for (_y = { name: "trimmer", skill: "trimming" }, name = _y.name, skill = _y.skill, _y, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name, skill } = { name: "trimmer", skill: "trimming" } -6 > -7 > name -8 > , -9 > skill -10> } = { name: "trimmer", skill: "trimming" }, -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > { name, skill } = { name: "trimmer", skill: "trimming" } +4 > +5 > name +6 > , +7 > skill +8 > } = { name: "trimmer", skill: "trimming" }, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(74, 1) Source(97, 1) + SourceIndex(0) -2 >Emitted(74, 4) Source(97, 4) + SourceIndex(0) -3 >Emitted(74, 5) Source(97, 5) + SourceIndex(0) -4 >Emitted(74, 6) Source(97, 6) + SourceIndex(0) -5 >Emitted(74, 49) Source(97, 69) + SourceIndex(0) -6 >Emitted(74, 51) Source(97, 8) + SourceIndex(0) -7 >Emitted(74, 65) Source(97, 12) + SourceIndex(0) -8 >Emitted(74, 67) Source(97, 14) + SourceIndex(0) -9 >Emitted(74, 83) Source(97, 19) + SourceIndex(0) -10>Emitted(74, 89) Source(97, 71) + SourceIndex(0) -11>Emitted(74, 90) Source(97, 72) + SourceIndex(0) -12>Emitted(74, 93) Source(97, 75) + SourceIndex(0) -13>Emitted(74, 94) Source(97, 76) + SourceIndex(0) -14>Emitted(74, 96) Source(97, 78) + SourceIndex(0) -15>Emitted(74, 97) Source(97, 79) + SourceIndex(0) -16>Emitted(74, 100) Source(97, 82) + SourceIndex(0) -17>Emitted(74, 101) Source(97, 83) + SourceIndex(0) -18>Emitted(74, 103) Source(97, 85) + SourceIndex(0) -19>Emitted(74, 104) Source(97, 86) + SourceIndex(0) -20>Emitted(74, 106) Source(97, 88) + SourceIndex(0) -21>Emitted(74, 108) Source(97, 90) + SourceIndex(0) -22>Emitted(74, 109) Source(97, 91) + SourceIndex(0) +2 >Emitted(74, 6) Source(97, 6) + SourceIndex(0) +3 >Emitted(74, 49) Source(97, 69) + SourceIndex(0) +4 >Emitted(74, 51) Source(97, 8) + SourceIndex(0) +5 >Emitted(74, 65) Source(97, 12) + SourceIndex(0) +6 >Emitted(74, 67) Source(97, 14) + SourceIndex(0) +7 >Emitted(74, 83) Source(97, 19) + SourceIndex(0) +8 >Emitted(74, 89) Source(97, 71) + SourceIndex(0) +9 >Emitted(74, 90) Source(97, 72) + SourceIndex(0) +10>Emitted(74, 93) Source(97, 75) + SourceIndex(0) +11>Emitted(74, 94) Source(97, 76) + SourceIndex(0) +12>Emitted(74, 96) Source(97, 78) + SourceIndex(0) +13>Emitted(74, 97) Source(97, 79) + SourceIndex(0) +14>Emitted(74, 100) Source(97, 82) + SourceIndex(0) +15>Emitted(74, 101) Source(97, 83) + SourceIndex(0) +16>Emitted(74, 103) Source(97, 85) + SourceIndex(0) +17>Emitted(74, 104) Source(97, 86) + SourceIndex(0) +18>Emitted(74, 106) Source(97, 88) + SourceIndex(0) +19>Emitted(74, 108) Source(97, 90) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -2537,7 +2282,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2556,95 +2301,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(75, 24) Source(98, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(76, 1) Source(99, 1) + SourceIndex(0) -2 >Emitted(76, 2) Source(99, 2) + SourceIndex(0) + >} +1 >Emitted(76, 2) Source(99, 2) + SourceIndex(0) --- >>>for (name = multiRobot.name, _z = multiRobot.skills, primary = _z.primary, secondary = _z.secondary, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ({ -5 > name -6 > , -7 > skills: { primary, secondary } -8 > -9 > primary -10> , -11> secondary -12> } } = -13> multiRobot -14> , -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ({ +3 > name +4 > , +5 > skills: { primary, secondary } +6 > +7 > primary +8 > , +9 > secondary +10> } } = +11> multiRobot +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(77, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(77, 4) Source(100, 4) + SourceIndex(0) -3 >Emitted(77, 5) Source(100, 5) + SourceIndex(0) -4 >Emitted(77, 6) Source(100, 8) + SourceIndex(0) -5 >Emitted(77, 28) Source(100, 12) + SourceIndex(0) -6 >Emitted(77, 30) Source(100, 14) + SourceIndex(0) -7 >Emitted(77, 52) Source(100, 44) + SourceIndex(0) -8 >Emitted(77, 54) Source(100, 24) + SourceIndex(0) -9 >Emitted(77, 74) Source(100, 31) + SourceIndex(0) -10>Emitted(77, 76) Source(100, 33) + SourceIndex(0) -11>Emitted(77, 100) Source(100, 42) + SourceIndex(0) -12>Emitted(77, 102) Source(100, 49) + SourceIndex(0) -13>Emitted(77, 112) Source(100, 59) + SourceIndex(0) -14>Emitted(77, 114) Source(100, 61) + SourceIndex(0) -15>Emitted(77, 115) Source(100, 62) + SourceIndex(0) -16>Emitted(77, 118) Source(100, 65) + SourceIndex(0) -17>Emitted(77, 119) Source(100, 66) + SourceIndex(0) -18>Emitted(77, 121) Source(100, 68) + SourceIndex(0) -19>Emitted(77, 122) Source(100, 69) + SourceIndex(0) -20>Emitted(77, 125) Source(100, 72) + SourceIndex(0) -21>Emitted(77, 126) Source(100, 73) + SourceIndex(0) -22>Emitted(77, 128) Source(100, 75) + SourceIndex(0) -23>Emitted(77, 129) Source(100, 76) + SourceIndex(0) -24>Emitted(77, 131) Source(100, 78) + SourceIndex(0) -25>Emitted(77, 133) Source(100, 80) + SourceIndex(0) -26>Emitted(77, 134) Source(100, 81) + SourceIndex(0) +2 >Emitted(77, 6) Source(100, 8) + SourceIndex(0) +3 >Emitted(77, 28) Source(100, 12) + SourceIndex(0) +4 >Emitted(77, 30) Source(100, 14) + SourceIndex(0) +5 >Emitted(77, 52) Source(100, 44) + SourceIndex(0) +6 >Emitted(77, 54) Source(100, 24) + SourceIndex(0) +7 >Emitted(77, 74) Source(100, 31) + SourceIndex(0) +8 >Emitted(77, 76) Source(100, 33) + SourceIndex(0) +9 >Emitted(77, 100) Source(100, 42) + SourceIndex(0) +10>Emitted(77, 102) Source(100, 49) + SourceIndex(0) +11>Emitted(77, 112) Source(100, 59) + SourceIndex(0) +12>Emitted(77, 114) Source(100, 61) + SourceIndex(0) +13>Emitted(77, 115) Source(100, 62) + SourceIndex(0) +14>Emitted(77, 118) Source(100, 65) + SourceIndex(0) +15>Emitted(77, 119) Source(100, 66) + SourceIndex(0) +16>Emitted(77, 121) Source(100, 68) + SourceIndex(0) +17>Emitted(77, 122) Source(100, 69) + SourceIndex(0) +18>Emitted(77, 125) Source(100, 72) + SourceIndex(0) +19>Emitted(77, 126) Source(100, 73) + SourceIndex(0) +20>Emitted(77, 128) Source(100, 75) + SourceIndex(0) +21>Emitted(77, 129) Source(100, 76) + SourceIndex(0) +22>Emitted(77, 131) Source(100, 78) + SourceIndex(0) +23>Emitted(77, 133) Source(100, 80) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -2655,7 +2388,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2674,95 +2407,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(78, 27) Source(101, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(79, 1) Source(102, 1) + SourceIndex(0) -2 >Emitted(79, 2) Source(102, 2) + SourceIndex(0) + >} +1 >Emitted(79, 2) Source(102, 2) + SourceIndex(0) --- >>>for (_0 = getMultiRobot(), name = _0.name, _1 = _0.skills, primary = _1.primary, secondary = _1.secondary, _0, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name, skills: { primary, secondary } } = getMultiRobot() -6 > -7 > name -8 > , -9 > skills: { primary, secondary } -10> -11> primary -12> , -13> secondary -14> } } = getMultiRobot(), -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > { name, skills: { primary, secondary } } = getMultiRobot() +4 > +5 > name +6 > , +7 > skills: { primary, secondary } +8 > +9 > primary +10> , +11> secondary +12> } } = getMultiRobot(), +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(80, 1) Source(103, 1) + SourceIndex(0) -2 >Emitted(80, 4) Source(103, 4) + SourceIndex(0) -3 >Emitted(80, 5) Source(103, 5) + SourceIndex(0) -4 >Emitted(80, 6) Source(103, 6) + SourceIndex(0) -5 >Emitted(80, 26) Source(103, 64) + SourceIndex(0) -6 >Emitted(80, 28) Source(103, 8) + SourceIndex(0) -7 >Emitted(80, 42) Source(103, 12) + SourceIndex(0) -8 >Emitted(80, 44) Source(103, 14) + SourceIndex(0) -9 >Emitted(80, 58) Source(103, 44) + SourceIndex(0) -10>Emitted(80, 60) Source(103, 24) + SourceIndex(0) -11>Emitted(80, 80) Source(103, 31) + SourceIndex(0) -12>Emitted(80, 82) Source(103, 33) + SourceIndex(0) -13>Emitted(80, 106) Source(103, 42) + SourceIndex(0) -14>Emitted(80, 112) Source(103, 66) + SourceIndex(0) -15>Emitted(80, 113) Source(103, 67) + SourceIndex(0) -16>Emitted(80, 116) Source(103, 70) + SourceIndex(0) -17>Emitted(80, 117) Source(103, 71) + SourceIndex(0) -18>Emitted(80, 119) Source(103, 73) + SourceIndex(0) -19>Emitted(80, 120) Source(103, 74) + SourceIndex(0) -20>Emitted(80, 123) Source(103, 77) + SourceIndex(0) -21>Emitted(80, 124) Source(103, 78) + SourceIndex(0) -22>Emitted(80, 126) Source(103, 80) + SourceIndex(0) -23>Emitted(80, 127) Source(103, 81) + SourceIndex(0) -24>Emitted(80, 129) Source(103, 83) + SourceIndex(0) -25>Emitted(80, 131) Source(103, 85) + SourceIndex(0) -26>Emitted(80, 132) Source(103, 86) + SourceIndex(0) +2 >Emitted(80, 6) Source(103, 6) + SourceIndex(0) +3 >Emitted(80, 26) Source(103, 64) + SourceIndex(0) +4 >Emitted(80, 28) Source(103, 8) + SourceIndex(0) +5 >Emitted(80, 42) Source(103, 12) + SourceIndex(0) +6 >Emitted(80, 44) Source(103, 14) + SourceIndex(0) +7 >Emitted(80, 58) Source(103, 44) + SourceIndex(0) +8 >Emitted(80, 60) Source(103, 24) + SourceIndex(0) +9 >Emitted(80, 80) Source(103, 31) + SourceIndex(0) +10>Emitted(80, 82) Source(103, 33) + SourceIndex(0) +11>Emitted(80, 106) Source(103, 42) + SourceIndex(0) +12>Emitted(80, 112) Source(103, 66) + SourceIndex(0) +13>Emitted(80, 113) Source(103, 67) + SourceIndex(0) +14>Emitted(80, 116) Source(103, 70) + SourceIndex(0) +15>Emitted(80, 117) Source(103, 71) + SourceIndex(0) +16>Emitted(80, 119) Source(103, 73) + SourceIndex(0) +17>Emitted(80, 120) Source(103, 74) + SourceIndex(0) +18>Emitted(80, 123) Source(103, 77) + SourceIndex(0) +19>Emitted(80, 124) Source(103, 78) + SourceIndex(0) +20>Emitted(80, 126) Source(103, 80) + SourceIndex(0) +21>Emitted(80, 127) Source(103, 81) + SourceIndex(0) +22>Emitted(80, 129) Source(103, 83) + SourceIndex(0) +23>Emitted(80, 131) Source(103, 85) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -2773,7 +2494,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2792,57 +2513,48 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(81, 27) Source(104, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(82, 1) Source(105, 1) + SourceIndex(0) -2 >Emitted(82, 2) Source(105, 2) + SourceIndex(0) + >} +1 >Emitted(82, 2) Source(105, 2) + SourceIndex(0) --- >>>for (_2 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, name = _2.name, _3 = _2.skills, primary = _3.primary, secondary = _3.secondary, _2, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { name, skills: { primary, secondary } } = +2 >for ( +3 > { name, skills: { primary, secondary } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > name -8 > , -9 > skills: { primary, secondary } -10> -11> primary -12> , -13> secondary +4 > +5 > name +6 > , +7 > skills: { primary, secondary } +8 > +9 > primary +10> , +11> secondary 1->Emitted(83, 1) Source(106, 1) + SourceIndex(0) -2 >Emitted(83, 4) Source(106, 4) + SourceIndex(0) -3 >Emitted(83, 5) Source(106, 5) + SourceIndex(0) -4 >Emitted(83, 6) Source(106, 6) + SourceIndex(0) -5 >Emitted(83, 84) Source(107, 90) + SourceIndex(0) -6 >Emitted(83, 86) Source(106, 8) + SourceIndex(0) -7 >Emitted(83, 100) Source(106, 12) + SourceIndex(0) -8 >Emitted(83, 102) Source(106, 14) + SourceIndex(0) -9 >Emitted(83, 116) Source(106, 44) + SourceIndex(0) -10>Emitted(83, 118) Source(106, 24) + SourceIndex(0) -11>Emitted(83, 138) Source(106, 31) + SourceIndex(0) -12>Emitted(83, 140) Source(106, 33) + SourceIndex(0) -13>Emitted(83, 164) Source(106, 42) + SourceIndex(0) +2 >Emitted(83, 6) Source(106, 6) + SourceIndex(0) +3 >Emitted(83, 84) Source(107, 90) + SourceIndex(0) +4 >Emitted(83, 86) Source(106, 8) + SourceIndex(0) +5 >Emitted(83, 100) Source(106, 12) + SourceIndex(0) +6 >Emitted(83, 102) Source(106, 14) + SourceIndex(0) +7 >Emitted(83, 116) Source(106, 44) + SourceIndex(0) +8 >Emitted(83, 118) Source(106, 24) + SourceIndex(0) +9 >Emitted(83, 138) Source(106, 31) + SourceIndex(0) +10>Emitted(83, 140) Source(106, 33) + SourceIndex(0) +11>Emitted(83, 164) Source(106, 42) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -2857,8 +2569,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > } } = > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > @@ -2873,7 +2584,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10> i 11> ++ 12> ) -13> { 1 >Emitted(84, 5) Source(108, 5) + SourceIndex(0) 2 >Emitted(84, 6) Source(108, 6) + SourceIndex(0) 3 >Emitted(84, 9) Source(108, 9) + SourceIndex(0) @@ -2886,7 +2596,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 10>Emitted(84, 20) Source(108, 20) + SourceIndex(0) 11>Emitted(84, 22) Source(108, 22) + SourceIndex(0) 12>Emitted(84, 24) Source(108, 24) + SourceIndex(0) -13>Emitted(84, 25) Source(108, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -2897,7 +2606,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -2916,14 +2625,11 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPattern2.ts 8 >Emitted(85, 27) Source(109, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(86, 1) Source(110, 1) + SourceIndex(0) -2 >Emitted(86, 2) Source(110, 2) + SourceIndex(0) + >} +1 >Emitted(86, 2) Source(110, 2) + SourceIndex(0) --- >>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3; >>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map index 0e96b80e749..d41172893b0 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,eAAqB,EAArB,qCAAqB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,oBAAsB,EAAtB,qCAAsB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAM,IAAA,gDAAsB,EAAtB,qCAAsB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,IAAA,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,IAAA,2BAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CACA,IAAA,qFAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAM,IAAA,eAAsB,EAAtB,qCAAsB,EAAE,gBAAuB,EAAvB,qCAAuB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,eAA+D,EAA9D,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,2CAAkG,EAAjG,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7H,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,IAAA,oBAAsB,EAAtB,qCAAsB,EACtB,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,oBAMU,EALf,YAAsB,EAAtB,qCAAsB,EACtB,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAK,IAAA,+EAMgF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;IACI,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,KAAU,IAAA,eAAqB,EAArB,qCAAqB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,oBAAsB,EAAtB,qCAAsB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAU,IAAA,gDAAsB,EAAtB,qCAAsB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACI,IAAA,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KACI,IAAA,2BAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KACI,IAAA,qFAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,KAAU,IAAA,eAAsB,EAAtB,qCAAsB,EAAE,gBAAuB,EAAvB,qCAAuB,EAAY,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,eAA+D,EAA9D,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACzF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAS,IAAA,2CAAkG,EAAjG,YAAsB,EAAtB,qCAAsB,EAAE,aAAuB,EAAvB,qCAAuB,EAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5H,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACI,IAAA,oBAAsB,EAAtB,qCAAsB,EACtB,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAE3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,oBAMU,EALf,YAAsB,EAAtB,qCAAsB,EACtB,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAS,IAAA,+EAMgF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt index ebe3dccdad7..fbf911aab7a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.sourcemap.txt @@ -147,21 +147,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. --- >>> return robot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robot -5 > ; +2 > return +3 > robot +4 > ; 1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) -2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) -3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) -4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) -5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +2 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +4 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) --- >>>} 1 > @@ -182,21 +179,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. --- >>> return multiRobot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobot -5 > ; +2 > return +3 > multiRobot +4 > ; 1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) -2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) -3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) -4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) -5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +2 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +3 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +4 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) --- >>>} 1 > @@ -210,70 +204,61 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. --- >>>for (var _a = robot.name, nameA = _a === void 0 ? "noName" : _a, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA= "noName" -7 > -8 > name: nameA= "noName" -9 > } = robot, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let { +3 > +4 > name: nameA= "noName" +5 > +6 > name: nameA= "noName" +7 > } = robot, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(9, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(9, 4) Source(26, 4) + SourceIndex(0) -3 >Emitted(9, 5) Source(26, 5) + SourceIndex(0) -4 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) -5 >Emitted(9, 10) Source(26, 11) + SourceIndex(0) -6 >Emitted(9, 25) Source(26, 32) + SourceIndex(0) -7 >Emitted(9, 27) Source(26, 11) + SourceIndex(0) -8 >Emitted(9, 64) Source(26, 32) + SourceIndex(0) -9 >Emitted(9, 66) Source(26, 44) + SourceIndex(0) -10>Emitted(9, 67) Source(26, 45) + SourceIndex(0) -11>Emitted(9, 70) Source(26, 48) + SourceIndex(0) -12>Emitted(9, 71) Source(26, 49) + SourceIndex(0) -13>Emitted(9, 73) Source(26, 51) + SourceIndex(0) -14>Emitted(9, 74) Source(26, 52) + SourceIndex(0) -15>Emitted(9, 77) Source(26, 55) + SourceIndex(0) -16>Emitted(9, 78) Source(26, 56) + SourceIndex(0) -17>Emitted(9, 80) Source(26, 58) + SourceIndex(0) -18>Emitted(9, 81) Source(26, 59) + SourceIndex(0) -19>Emitted(9, 83) Source(26, 61) + SourceIndex(0) -20>Emitted(9, 85) Source(26, 63) + SourceIndex(0) -21>Emitted(9, 86) Source(26, 64) + SourceIndex(0) +2 >Emitted(9, 6) Source(26, 11) + SourceIndex(0) +3 >Emitted(9, 10) Source(26, 11) + SourceIndex(0) +4 >Emitted(9, 25) Source(26, 32) + SourceIndex(0) +5 >Emitted(9, 27) Source(26, 11) + SourceIndex(0) +6 >Emitted(9, 64) Source(26, 32) + SourceIndex(0) +7 >Emitted(9, 66) Source(26, 44) + SourceIndex(0) +8 >Emitted(9, 67) Source(26, 45) + SourceIndex(0) +9 >Emitted(9, 70) Source(26, 48) + SourceIndex(0) +10>Emitted(9, 71) Source(26, 49) + SourceIndex(0) +11>Emitted(9, 73) Source(26, 51) + SourceIndex(0) +12>Emitted(9, 74) Source(26, 52) + SourceIndex(0) +13>Emitted(9, 77) Source(26, 55) + SourceIndex(0) +14>Emitted(9, 78) Source(26, 56) + SourceIndex(0) +15>Emitted(9, 80) Source(26, 58) + SourceIndex(0) +16>Emitted(9, 81) Source(26, 59) + SourceIndex(0) +17>Emitted(9, 83) Source(26, 61) + SourceIndex(0) +18>Emitted(9, 85) Source(26, 63) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -284,7 +269,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -303,80 +288,68 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(10, 24) Source(27, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(11, 1) Source(28, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) + >} +1 >Emitted(11, 2) Source(28, 2) + SourceIndex(0) --- >>>for (var _b = getRobot().name, nameA = _b === void 0 ? "noName" : _b, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA = "noName" -7 > -8 > name: nameA = "noName" -9 > } = getRobot(), -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let { +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > } = getRobot(), +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(12, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(12, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(12, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) -5 >Emitted(12, 10) Source(29, 11) + SourceIndex(0) -6 >Emitted(12, 30) Source(29, 33) + SourceIndex(0) -7 >Emitted(12, 32) Source(29, 11) + SourceIndex(0) -8 >Emitted(12, 69) Source(29, 33) + SourceIndex(0) -9 >Emitted(12, 71) Source(29, 50) + SourceIndex(0) -10>Emitted(12, 72) Source(29, 51) + SourceIndex(0) -11>Emitted(12, 75) Source(29, 54) + SourceIndex(0) -12>Emitted(12, 76) Source(29, 55) + SourceIndex(0) -13>Emitted(12, 78) Source(29, 57) + SourceIndex(0) -14>Emitted(12, 79) Source(29, 58) + SourceIndex(0) -15>Emitted(12, 82) Source(29, 61) + SourceIndex(0) -16>Emitted(12, 83) Source(29, 62) + SourceIndex(0) -17>Emitted(12, 85) Source(29, 64) + SourceIndex(0) -18>Emitted(12, 86) Source(29, 65) + SourceIndex(0) -19>Emitted(12, 88) Source(29, 67) + SourceIndex(0) -20>Emitted(12, 90) Source(29, 69) + SourceIndex(0) -21>Emitted(12, 91) Source(29, 70) + SourceIndex(0) +2 >Emitted(12, 6) Source(29, 11) + SourceIndex(0) +3 >Emitted(12, 10) Source(29, 11) + SourceIndex(0) +4 >Emitted(12, 30) Source(29, 33) + SourceIndex(0) +5 >Emitted(12, 32) Source(29, 11) + SourceIndex(0) +6 >Emitted(12, 69) Source(29, 33) + SourceIndex(0) +7 >Emitted(12, 71) Source(29, 50) + SourceIndex(0) +8 >Emitted(12, 72) Source(29, 51) + SourceIndex(0) +9 >Emitted(12, 75) Source(29, 54) + SourceIndex(0) +10>Emitted(12, 76) Source(29, 55) + SourceIndex(0) +11>Emitted(12, 78) Source(29, 57) + SourceIndex(0) +12>Emitted(12, 79) Source(29, 58) + SourceIndex(0) +13>Emitted(12, 82) Source(29, 61) + SourceIndex(0) +14>Emitted(12, 83) Source(29, 62) + SourceIndex(0) +15>Emitted(12, 85) Source(29, 64) + SourceIndex(0) +16>Emitted(12, 86) Source(29, 65) + SourceIndex(0) +17>Emitted(12, 88) Source(29, 67) + SourceIndex(0) +18>Emitted(12, 90) Source(29, 69) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -387,7 +360,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -406,80 +379,68 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(13, 24) Source(30, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(14, 1) Source(31, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) + >} +1 >Emitted(14, 2) Source(31, 2) + SourceIndex(0) --- >>>for (var _c = { name: "trimmer", skill: "trimming" }.name, nameA = _c === void 0 ? "noName" : _c, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^ -20> ^^ -21> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^ +18> ^^ 1-> > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA = "noName" -7 > -8 > name: nameA = "noName" -9 > } = { name: "trimmer", skill: "trimming" }, -10> i -11> = -12> 0 -13> ; -14> i -15> < -16> 1 -17> ; -18> i -19> ++ -20> ) -21> { +2 >for (let { +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > } = { name: "trimmer", skill: "trimming" }, +8 > i +9 > = +10> 0 +11> ; +12> i +13> < +14> 1 +15> ; +16> i +17> ++ +18> ) 1->Emitted(15, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(15, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(15, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) -5 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) -6 >Emitted(15, 58) Source(32, 33) + SourceIndex(0) -7 >Emitted(15, 60) Source(32, 11) + SourceIndex(0) -8 >Emitted(15, 97) Source(32, 33) + SourceIndex(0) -9 >Emitted(15, 99) Source(32, 85) + SourceIndex(0) -10>Emitted(15, 100) Source(32, 86) + SourceIndex(0) -11>Emitted(15, 103) Source(32, 89) + SourceIndex(0) -12>Emitted(15, 104) Source(32, 90) + SourceIndex(0) -13>Emitted(15, 106) Source(32, 92) + SourceIndex(0) -14>Emitted(15, 107) Source(32, 93) + SourceIndex(0) -15>Emitted(15, 110) Source(32, 96) + SourceIndex(0) -16>Emitted(15, 111) Source(32, 97) + SourceIndex(0) -17>Emitted(15, 113) Source(32, 99) + SourceIndex(0) -18>Emitted(15, 114) Source(32, 100) + SourceIndex(0) -19>Emitted(15, 116) Source(32, 102) + SourceIndex(0) -20>Emitted(15, 118) Source(32, 104) + SourceIndex(0) -21>Emitted(15, 119) Source(32, 105) + SourceIndex(0) +2 >Emitted(15, 6) Source(32, 11) + SourceIndex(0) +3 >Emitted(15, 10) Source(32, 11) + SourceIndex(0) +4 >Emitted(15, 58) Source(32, 33) + SourceIndex(0) +5 >Emitted(15, 60) Source(32, 11) + SourceIndex(0) +6 >Emitted(15, 97) Source(32, 33) + SourceIndex(0) +7 >Emitted(15, 99) Source(32, 85) + SourceIndex(0) +8 >Emitted(15, 100) Source(32, 86) + SourceIndex(0) +9 >Emitted(15, 103) Source(32, 89) + SourceIndex(0) +10>Emitted(15, 104) Source(32, 90) + SourceIndex(0) +11>Emitted(15, 106) Source(32, 92) + SourceIndex(0) +12>Emitted(15, 107) Source(32, 93) + SourceIndex(0) +13>Emitted(15, 110) Source(32, 96) + SourceIndex(0) +14>Emitted(15, 111) Source(32, 97) + SourceIndex(0) +15>Emitted(15, 113) Source(32, 99) + SourceIndex(0) +16>Emitted(15, 114) Source(32, 100) + SourceIndex(0) +17>Emitted(15, 116) Source(32, 102) + SourceIndex(0) +18>Emitted(15, 118) Source(32, 104) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -490,7 +451,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -509,114 +470,102 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(16, 24) Source(33, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(17, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) + >} +1 >Emitted(17, 2) Source(34, 2) + SourceIndex(0) --- >>>for (var _d = multiRobot.skills, _e = _d === void 0 ? { primary: "none", secondary: "none" } : _d, _f = _e.primary, primaryA = _f === void 0 ? "primary" : _f, _g = _e.secondary, secondaryA = _g === void 0 ? "secondary" : _g, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^ -28> ^^ -29> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ 1-> > -2 >for -3 > -4 > (let { - > -5 > -6 > skills: { +2 >for (let { + > +3 > +4 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -7 > -8 > skills: { +5 > +6 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -9 > -10> primary: primaryA = "primary" -11> -12> primary: primaryA = "primary" -13> , +7 > +8 > primary: primaryA = "primary" +9 > +10> primary: primaryA = "primary" +11> , > -14> secondary: secondaryA = "secondary" -15> -16> secondary: secondaryA = "secondary" -17> +12> secondary: secondaryA = "secondary" +13> +14> secondary: secondaryA = "secondary" +15> > } = { primary: "none", secondary: "none" } > } = multiRobot, -18> i -19> = -20> 0 -21> ; -22> i -23> < -24> 1 -25> ; -26> i -27> ++ -28> ) -29> { +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) 1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(18, 6) Source(36, 5) + SourceIndex(0) -5 >Emitted(18, 10) Source(36, 5) + SourceIndex(0) -6 >Emitted(18, 32) Source(39, 47) + SourceIndex(0) -7 >Emitted(18, 34) Source(36, 5) + SourceIndex(0) -8 >Emitted(18, 98) Source(39, 47) + SourceIndex(0) -9 >Emitted(18, 100) Source(37, 9) + SourceIndex(0) -10>Emitted(18, 115) Source(37, 38) + SourceIndex(0) -11>Emitted(18, 117) Source(37, 9) + SourceIndex(0) -12>Emitted(18, 158) Source(37, 38) + SourceIndex(0) -13>Emitted(18, 160) Source(38, 9) + SourceIndex(0) -14>Emitted(18, 177) Source(38, 44) + SourceIndex(0) -15>Emitted(18, 179) Source(38, 9) + SourceIndex(0) -16>Emitted(18, 224) Source(38, 44) + SourceIndex(0) -17>Emitted(18, 226) Source(40, 17) + SourceIndex(0) -18>Emitted(18, 227) Source(40, 18) + SourceIndex(0) -19>Emitted(18, 230) Source(40, 21) + SourceIndex(0) -20>Emitted(18, 231) Source(40, 22) + SourceIndex(0) -21>Emitted(18, 233) Source(40, 24) + SourceIndex(0) -22>Emitted(18, 234) Source(40, 25) + SourceIndex(0) -23>Emitted(18, 237) Source(40, 28) + SourceIndex(0) -24>Emitted(18, 238) Source(40, 29) + SourceIndex(0) -25>Emitted(18, 240) Source(40, 31) + SourceIndex(0) -26>Emitted(18, 241) Source(40, 32) + SourceIndex(0) -27>Emitted(18, 243) Source(40, 34) + SourceIndex(0) -28>Emitted(18, 245) Source(40, 36) + SourceIndex(0) -29>Emitted(18, 246) Source(40, 37) + SourceIndex(0) +2 >Emitted(18, 6) Source(36, 5) + SourceIndex(0) +3 >Emitted(18, 10) Source(36, 5) + SourceIndex(0) +4 >Emitted(18, 32) Source(39, 47) + SourceIndex(0) +5 >Emitted(18, 34) Source(36, 5) + SourceIndex(0) +6 >Emitted(18, 98) Source(39, 47) + SourceIndex(0) +7 >Emitted(18, 100) Source(37, 9) + SourceIndex(0) +8 >Emitted(18, 115) Source(37, 38) + SourceIndex(0) +9 >Emitted(18, 117) Source(37, 9) + SourceIndex(0) +10>Emitted(18, 158) Source(37, 38) + SourceIndex(0) +11>Emitted(18, 160) Source(38, 9) + SourceIndex(0) +12>Emitted(18, 177) Source(38, 44) + SourceIndex(0) +13>Emitted(18, 179) Source(38, 9) + SourceIndex(0) +14>Emitted(18, 224) Source(38, 44) + SourceIndex(0) +15>Emitted(18, 226) Source(40, 17) + SourceIndex(0) +16>Emitted(18, 227) Source(40, 18) + SourceIndex(0) +17>Emitted(18, 230) Source(40, 21) + SourceIndex(0) +18>Emitted(18, 231) Source(40, 22) + SourceIndex(0) +19>Emitted(18, 233) Source(40, 24) + SourceIndex(0) +20>Emitted(18, 234) Source(40, 25) + SourceIndex(0) +21>Emitted(18, 237) Source(40, 28) + SourceIndex(0) +22>Emitted(18, 238) Source(40, 29) + SourceIndex(0) +23>Emitted(18, 240) Source(40, 31) + SourceIndex(0) +24>Emitted(18, 241) Source(40, 32) + SourceIndex(0) +25>Emitted(18, 243) Source(40, 34) + SourceIndex(0) +26>Emitted(18, 245) Source(40, 36) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -627,7 +576,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -646,114 +595,102 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(19, 27) Source(41, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(20, 1) Source(42, 1) + SourceIndex(0) -2 >Emitted(20, 2) Source(42, 2) + SourceIndex(0) + >} +1 >Emitted(20, 2) Source(42, 2) + SourceIndex(0) --- >>>for (var _h = getMultiRobot().skills, _j = _h === void 0 ? { primary: "none", secondary: "none" } : _h, _k = _j.primary, primaryA = _k === void 0 ? "primary" : _k, _l = _j.secondary, secondaryA = _l === void 0 ? "secondary" : _l, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^ -28> ^^ -29> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ 1-> > -2 >for -3 > -4 > (let { - > -5 > -6 > skills: { +2 >for (let { + > +3 > +4 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -7 > -8 > skills: { +5 > +6 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -9 > -10> primary: primaryA = "primary" -11> -12> primary: primaryA = "primary" -13> , +7 > +8 > primary: primaryA = "primary" +9 > +10> primary: primaryA = "primary" +11> , > -14> secondary: secondaryA = "secondary" -15> -16> secondary: secondaryA = "secondary" -17> +12> secondary: secondaryA = "secondary" +13> +14> secondary: secondaryA = "secondary" +15> > } = { primary: "none", secondary: "none" } > } = getMultiRobot(), -18> i -19> = -20> 0 -21> ; -22> i -23> < -24> 1 -25> ; -26> i -27> ++ -28> ) -29> { +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) 1->Emitted(21, 1) Source(43, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(43, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(43, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(44, 5) + SourceIndex(0) -5 >Emitted(21, 10) Source(44, 5) + SourceIndex(0) -6 >Emitted(21, 37) Source(47, 47) + SourceIndex(0) -7 >Emitted(21, 39) Source(44, 5) + SourceIndex(0) -8 >Emitted(21, 103) Source(47, 47) + SourceIndex(0) -9 >Emitted(21, 105) Source(45, 9) + SourceIndex(0) -10>Emitted(21, 120) Source(45, 38) + SourceIndex(0) -11>Emitted(21, 122) Source(45, 9) + SourceIndex(0) -12>Emitted(21, 163) Source(45, 38) + SourceIndex(0) -13>Emitted(21, 165) Source(46, 9) + SourceIndex(0) -14>Emitted(21, 182) Source(46, 44) + SourceIndex(0) -15>Emitted(21, 184) Source(46, 9) + SourceIndex(0) -16>Emitted(21, 229) Source(46, 44) + SourceIndex(0) -17>Emitted(21, 231) Source(48, 22) + SourceIndex(0) -18>Emitted(21, 232) Source(48, 23) + SourceIndex(0) -19>Emitted(21, 235) Source(48, 26) + SourceIndex(0) -20>Emitted(21, 236) Source(48, 27) + SourceIndex(0) -21>Emitted(21, 238) Source(48, 29) + SourceIndex(0) -22>Emitted(21, 239) Source(48, 30) + SourceIndex(0) -23>Emitted(21, 242) Source(48, 33) + SourceIndex(0) -24>Emitted(21, 243) Source(48, 34) + SourceIndex(0) -25>Emitted(21, 245) Source(48, 36) + SourceIndex(0) -26>Emitted(21, 246) Source(48, 37) + SourceIndex(0) -27>Emitted(21, 248) Source(48, 39) + SourceIndex(0) -28>Emitted(21, 250) Source(48, 41) + SourceIndex(0) -29>Emitted(21, 251) Source(48, 42) + SourceIndex(0) +2 >Emitted(21, 6) Source(44, 5) + SourceIndex(0) +3 >Emitted(21, 10) Source(44, 5) + SourceIndex(0) +4 >Emitted(21, 37) Source(47, 47) + SourceIndex(0) +5 >Emitted(21, 39) Source(44, 5) + SourceIndex(0) +6 >Emitted(21, 103) Source(47, 47) + SourceIndex(0) +7 >Emitted(21, 105) Source(45, 9) + SourceIndex(0) +8 >Emitted(21, 120) Source(45, 38) + SourceIndex(0) +9 >Emitted(21, 122) Source(45, 9) + SourceIndex(0) +10>Emitted(21, 163) Source(45, 38) + SourceIndex(0) +11>Emitted(21, 165) Source(46, 9) + SourceIndex(0) +12>Emitted(21, 182) Source(46, 44) + SourceIndex(0) +13>Emitted(21, 184) Source(46, 9) + SourceIndex(0) +14>Emitted(21, 229) Source(46, 44) + SourceIndex(0) +15>Emitted(21, 231) Source(48, 22) + SourceIndex(0) +16>Emitted(21, 232) Source(48, 23) + SourceIndex(0) +17>Emitted(21, 235) Source(48, 26) + SourceIndex(0) +18>Emitted(21, 236) Source(48, 27) + SourceIndex(0) +19>Emitted(21, 238) Source(48, 29) + SourceIndex(0) +20>Emitted(21, 239) Source(48, 30) + SourceIndex(0) +21>Emitted(21, 242) Source(48, 33) + SourceIndex(0) +22>Emitted(21, 243) Source(48, 34) + SourceIndex(0) +23>Emitted(21, 245) Source(48, 36) + SourceIndex(0) +24>Emitted(21, 246) Source(48, 37) + SourceIndex(0) +25>Emitted(21, 248) Source(48, 39) + SourceIndex(0) +26>Emitted(21, 250) Source(48, 41) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -764,7 +701,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -783,115 +720,103 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(22, 27) Source(49, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(23, 1) Source(50, 1) + SourceIndex(0) -2 >Emitted(23, 2) Source(50, 2) + SourceIndex(0) + >} +1 >Emitted(23, 2) Source(50, 2) + SourceIndex(0) --- >>>for (var _m = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }.skills, _o = _m === void 0 ? { primary: "none", secondary: "none" } : _m, _p = _o.primary, primaryA = _p === void 0 ? "primary" : _p, _q = _o.secondary, secondaryA = _q === void 0 ? "secondary" : _q, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^ -28> ^^ -29> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^ +26> ^^ 1-> > -2 >for -3 > -4 > (let { - > -5 > -6 > skills: { +2 >for (let { + > +3 > +4 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -7 > -8 > skills: { +5 > +6 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -9 > -10> primary: primaryA = "primary" -11> -12> primary: primaryA = "primary" -13> , +7 > +8 > primary: primaryA = "primary" +9 > +10> primary: primaryA = "primary" +11> , > -14> secondary: secondaryA = "secondary" -15> -16> secondary: secondaryA = "secondary" -17> +12> secondary: secondaryA = "secondary" +13> +14> secondary: secondaryA = "secondary" +15> > } = { primary: "none", secondary: "none" } > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > -18> i -19> = -20> 0 -21> ; -22> i -23> < -24> 1 -25> ; -26> i -27> ++ -28> ) -29> { +16> i +17> = +18> 0 +19> ; +20> i +21> < +22> 1 +23> ; +24> i +25> ++ +26> ) 1->Emitted(24, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(24, 4) Source(51, 4) + SourceIndex(0) -3 >Emitted(24, 5) Source(51, 5) + SourceIndex(0) -4 >Emitted(24, 6) Source(52, 5) + SourceIndex(0) -5 >Emitted(24, 10) Source(52, 5) + SourceIndex(0) -6 >Emitted(24, 95) Source(55, 47) + SourceIndex(0) -7 >Emitted(24, 97) Source(52, 5) + SourceIndex(0) -8 >Emitted(24, 161) Source(55, 47) + SourceIndex(0) -9 >Emitted(24, 163) Source(53, 9) + SourceIndex(0) -10>Emitted(24, 178) Source(53, 38) + SourceIndex(0) -11>Emitted(24, 180) Source(53, 9) + SourceIndex(0) -12>Emitted(24, 221) Source(53, 38) + SourceIndex(0) -13>Emitted(24, 223) Source(54, 9) + SourceIndex(0) -14>Emitted(24, 240) Source(54, 44) + SourceIndex(0) -15>Emitted(24, 242) Source(54, 9) + SourceIndex(0) -16>Emitted(24, 287) Source(54, 44) + SourceIndex(0) -17>Emitted(24, 289) Source(57, 5) + SourceIndex(0) -18>Emitted(24, 290) Source(57, 6) + SourceIndex(0) -19>Emitted(24, 293) Source(57, 9) + SourceIndex(0) -20>Emitted(24, 294) Source(57, 10) + SourceIndex(0) -21>Emitted(24, 296) Source(57, 12) + SourceIndex(0) -22>Emitted(24, 297) Source(57, 13) + SourceIndex(0) -23>Emitted(24, 300) Source(57, 16) + SourceIndex(0) -24>Emitted(24, 301) Source(57, 17) + SourceIndex(0) -25>Emitted(24, 303) Source(57, 19) + SourceIndex(0) -26>Emitted(24, 304) Source(57, 20) + SourceIndex(0) -27>Emitted(24, 306) Source(57, 22) + SourceIndex(0) -28>Emitted(24, 308) Source(57, 24) + SourceIndex(0) -29>Emitted(24, 309) Source(57, 25) + SourceIndex(0) +2 >Emitted(24, 6) Source(52, 5) + SourceIndex(0) +3 >Emitted(24, 10) Source(52, 5) + SourceIndex(0) +4 >Emitted(24, 95) Source(55, 47) + SourceIndex(0) +5 >Emitted(24, 97) Source(52, 5) + SourceIndex(0) +6 >Emitted(24, 161) Source(55, 47) + SourceIndex(0) +7 >Emitted(24, 163) Source(53, 9) + SourceIndex(0) +8 >Emitted(24, 178) Source(53, 38) + SourceIndex(0) +9 >Emitted(24, 180) Source(53, 9) + SourceIndex(0) +10>Emitted(24, 221) Source(53, 38) + SourceIndex(0) +11>Emitted(24, 223) Source(54, 9) + SourceIndex(0) +12>Emitted(24, 240) Source(54, 44) + SourceIndex(0) +13>Emitted(24, 242) Source(54, 9) + SourceIndex(0) +14>Emitted(24, 287) Source(54, 44) + SourceIndex(0) +15>Emitted(24, 289) Source(57, 5) + SourceIndex(0) +16>Emitted(24, 290) Source(57, 6) + SourceIndex(0) +17>Emitted(24, 293) Source(57, 9) + SourceIndex(0) +18>Emitted(24, 294) Source(57, 10) + SourceIndex(0) +19>Emitted(24, 296) Source(57, 12) + SourceIndex(0) +20>Emitted(24, 297) Source(57, 13) + SourceIndex(0) +21>Emitted(24, 300) Source(57, 16) + SourceIndex(0) +22>Emitted(24, 301) Source(57, 17) + SourceIndex(0) +23>Emitted(24, 303) Source(57, 19) + SourceIndex(0) +24>Emitted(24, 304) Source(57, 20) + SourceIndex(0) +25>Emitted(24, 306) Source(57, 22) + SourceIndex(0) +26>Emitted(24, 308) Source(57, 24) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -902,7 +827,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -921,93 +846,81 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(25, 27) Source(58, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(26, 1) Source(59, 1) + SourceIndex(0) -2 >Emitted(26, 2) Source(59, 2) + SourceIndex(0) + >} +1 >Emitted(26, 2) Source(59, 2) + SourceIndex(0) --- >>>for (var _r = robot.name, nameA = _r === void 0 ? "noName" : _r, _s = robot.skill, skillA = _s === void 0 ? "skill" : _s, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^ -15> ^^^ -16> ^ -17> ^^ -18> ^ -19> ^^^ -20> ^ -21> ^^ -22> ^ -23> ^^ -24> ^^ -25> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +17> ^^^ +18> ^ +19> ^^ +20> ^ +21> ^^ +22> ^^ 1-> > > -2 >for -3 > -4 > (let { -5 > -6 > name: nameA = "noName" -7 > -8 > name: nameA = "noName" -9 > , -10> skill: skillA = "skill" -11> -12> skill: skillA = "skill" -13> } = robot, -14> i -15> = -16> 0 -17> ; -18> i -19> < -20> 1 -21> ; -22> i -23> ++ -24> ) -25> { +2 >for (let { +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , +8 > skill: skillA = "skill" +9 > +10> skill: skillA = "skill" +11> } = robot, +12> i +13> = +14> 0 +15> ; +16> i +17> < +18> 1 +19> ; +20> i +21> ++ +22> ) 1->Emitted(27, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(27, 4) Source(61, 4) + SourceIndex(0) -3 >Emitted(27, 5) Source(61, 5) + SourceIndex(0) -4 >Emitted(27, 6) Source(61, 11) + SourceIndex(0) -5 >Emitted(27, 10) Source(61, 11) + SourceIndex(0) -6 >Emitted(27, 25) Source(61, 33) + SourceIndex(0) -7 >Emitted(27, 27) Source(61, 11) + SourceIndex(0) -8 >Emitted(27, 64) Source(61, 33) + SourceIndex(0) -9 >Emitted(27, 66) Source(61, 35) + SourceIndex(0) -10>Emitted(27, 82) Source(61, 58) + SourceIndex(0) -11>Emitted(27, 84) Source(61, 35) + SourceIndex(0) -12>Emitted(27, 121) Source(61, 58) + SourceIndex(0) -13>Emitted(27, 123) Source(61, 70) + SourceIndex(0) -14>Emitted(27, 124) Source(61, 71) + SourceIndex(0) -15>Emitted(27, 127) Source(61, 74) + SourceIndex(0) -16>Emitted(27, 128) Source(61, 75) + SourceIndex(0) -17>Emitted(27, 130) Source(61, 77) + SourceIndex(0) -18>Emitted(27, 131) Source(61, 78) + SourceIndex(0) -19>Emitted(27, 134) Source(61, 81) + SourceIndex(0) -20>Emitted(27, 135) Source(61, 82) + SourceIndex(0) -21>Emitted(27, 137) Source(61, 84) + SourceIndex(0) -22>Emitted(27, 138) Source(61, 85) + SourceIndex(0) -23>Emitted(27, 140) Source(61, 87) + SourceIndex(0) -24>Emitted(27, 142) Source(61, 89) + SourceIndex(0) -25>Emitted(27, 143) Source(61, 90) + SourceIndex(0) +2 >Emitted(27, 6) Source(61, 11) + SourceIndex(0) +3 >Emitted(27, 10) Source(61, 11) + SourceIndex(0) +4 >Emitted(27, 25) Source(61, 33) + SourceIndex(0) +5 >Emitted(27, 27) Source(61, 11) + SourceIndex(0) +6 >Emitted(27, 64) Source(61, 33) + SourceIndex(0) +7 >Emitted(27, 66) Source(61, 35) + SourceIndex(0) +8 >Emitted(27, 82) Source(61, 58) + SourceIndex(0) +9 >Emitted(27, 84) Source(61, 35) + SourceIndex(0) +10>Emitted(27, 121) Source(61, 58) + SourceIndex(0) +11>Emitted(27, 123) Source(61, 70) + SourceIndex(0) +12>Emitted(27, 124) Source(61, 71) + SourceIndex(0) +13>Emitted(27, 127) Source(61, 74) + SourceIndex(0) +14>Emitted(27, 128) Source(61, 75) + SourceIndex(0) +15>Emitted(27, 130) Source(61, 77) + SourceIndex(0) +16>Emitted(27, 131) Source(61, 78) + SourceIndex(0) +17>Emitted(27, 134) Source(61, 81) + SourceIndex(0) +18>Emitted(27, 135) Source(61, 82) + SourceIndex(0) +19>Emitted(27, 137) Source(61, 84) + SourceIndex(0) +20>Emitted(27, 138) Source(61, 85) + SourceIndex(0) +21>Emitted(27, 140) Source(61, 87) + SourceIndex(0) +22>Emitted(27, 142) Source(61, 89) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1018,7 +931,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1037,98 +950,86 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(28, 24) Source(62, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(29, 1) Source(63, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(63, 2) + SourceIndex(0) + >} +1 >Emitted(29, 2) Source(63, 2) + SourceIndex(0) --- >>>for (var _t = getRobot(), _u = _t.name, nameA = _u === void 0 ? "noName" : _u, _v = _t.skill, skillA = _v === void 0 ? "skill" : _v, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^ -26> ^^ -27> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > {name: nameA = "noName", skill: skillA = "skill" } = getRobot() -7 > -8 > name: nameA = "noName" -9 > -10> name: nameA = "noName" -11> , -12> skill: skillA = "skill" -13> -14> skill: skillA = "skill" -15> } = getRobot(), -16> i -17> = -18> 0 -19> ; -20> i -21> < -22> 1 -23> ; -24> i -25> ++ -26> ) -27> { +2 >for (let +3 > +4 > {name: nameA = "noName", skill: skillA = "skill" } = getRobot() +5 > +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , +10> skill: skillA = "skill" +11> +12> skill: skillA = "skill" +13> } = getRobot(), +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) 1->Emitted(30, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(64, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(64, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(64, 10) + SourceIndex(0) -5 >Emitted(30, 10) Source(64, 10) + SourceIndex(0) -6 >Emitted(30, 25) Source(64, 73) + SourceIndex(0) -7 >Emitted(30, 27) Source(64, 11) + SourceIndex(0) -8 >Emitted(30, 39) Source(64, 33) + SourceIndex(0) -9 >Emitted(30, 41) Source(64, 11) + SourceIndex(0) -10>Emitted(30, 78) Source(64, 33) + SourceIndex(0) -11>Emitted(30, 80) Source(64, 35) + SourceIndex(0) -12>Emitted(30, 93) Source(64, 58) + SourceIndex(0) -13>Emitted(30, 95) Source(64, 35) + SourceIndex(0) -14>Emitted(30, 132) Source(64, 58) + SourceIndex(0) -15>Emitted(30, 134) Source(64, 75) + SourceIndex(0) -16>Emitted(30, 135) Source(64, 76) + SourceIndex(0) -17>Emitted(30, 138) Source(64, 79) + SourceIndex(0) -18>Emitted(30, 139) Source(64, 80) + SourceIndex(0) -19>Emitted(30, 141) Source(64, 82) + SourceIndex(0) -20>Emitted(30, 142) Source(64, 83) + SourceIndex(0) -21>Emitted(30, 145) Source(64, 86) + SourceIndex(0) -22>Emitted(30, 146) Source(64, 87) + SourceIndex(0) -23>Emitted(30, 148) Source(64, 89) + SourceIndex(0) -24>Emitted(30, 149) Source(64, 90) + SourceIndex(0) -25>Emitted(30, 151) Source(64, 92) + SourceIndex(0) -26>Emitted(30, 153) Source(64, 94) + SourceIndex(0) -27>Emitted(30, 154) Source(64, 95) + SourceIndex(0) +2 >Emitted(30, 6) Source(64, 10) + SourceIndex(0) +3 >Emitted(30, 10) Source(64, 10) + SourceIndex(0) +4 >Emitted(30, 25) Source(64, 73) + SourceIndex(0) +5 >Emitted(30, 27) Source(64, 11) + SourceIndex(0) +6 >Emitted(30, 39) Source(64, 33) + SourceIndex(0) +7 >Emitted(30, 41) Source(64, 11) + SourceIndex(0) +8 >Emitted(30, 78) Source(64, 33) + SourceIndex(0) +9 >Emitted(30, 80) Source(64, 35) + SourceIndex(0) +10>Emitted(30, 93) Source(64, 58) + SourceIndex(0) +11>Emitted(30, 95) Source(64, 35) + SourceIndex(0) +12>Emitted(30, 132) Source(64, 58) + SourceIndex(0) +13>Emitted(30, 134) Source(64, 75) + SourceIndex(0) +14>Emitted(30, 135) Source(64, 76) + SourceIndex(0) +15>Emitted(30, 138) Source(64, 79) + SourceIndex(0) +16>Emitted(30, 139) Source(64, 80) + SourceIndex(0) +17>Emitted(30, 141) Source(64, 82) + SourceIndex(0) +18>Emitted(30, 142) Source(64, 83) + SourceIndex(0) +19>Emitted(30, 145) Source(64, 86) + SourceIndex(0) +20>Emitted(30, 146) Source(64, 87) + SourceIndex(0) +21>Emitted(30, 148) Source(64, 89) + SourceIndex(0) +22>Emitted(30, 149) Source(64, 90) + SourceIndex(0) +23>Emitted(30, 151) Source(64, 92) + SourceIndex(0) +24>Emitted(30, 153) Source(64, 94) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1139,7 +1040,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1158,98 +1059,86 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(31, 24) Source(65, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(32, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) + >} +1 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) --- >>>for (var _w = { name: "trimmer", skill: "trimming" }, _x = _w.name, nameA = _x === void 0 ? "noName" : _x, _y = _w.skill, skillA = _y === void 0 ? "skill" : _y, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^ -17> ^^^ -18> ^ -19> ^^ -20> ^ -21> ^^^ -22> ^ -23> ^^ -24> ^ -25> ^^ -26> ^^ -27> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^ +15> ^^^ +16> ^ +17> ^^ +18> ^ +19> ^^^ +20> ^ +21> ^^ +22> ^ +23> ^^ +24> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } -7 > -8 > name: nameA = "noName" -9 > -10> name: nameA = "noName" -11> , -12> skill: skillA = "skill" -13> -14> skill: skillA = "skill" -15> } = { name: "trimmer", skill: "trimming" }, -16> i -17> = -18> 0 -19> ; -20> i -21> < -22> 1 -23> ; -24> i -25> ++ -26> ) -27> { +2 >for (let +3 > +4 > {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } +5 > +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , +10> skill: skillA = "skill" +11> +12> skill: skillA = "skill" +13> } = { name: "trimmer", skill: "trimming" }, +14> i +15> = +16> 0 +17> ; +18> i +19> < +20> 1 +21> ; +22> i +23> ++ +24> ) 1->Emitted(33, 1) Source(67, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(67, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(67, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(67, 10) + SourceIndex(0) -5 >Emitted(33, 10) Source(67, 10) + SourceIndex(0) -6 >Emitted(33, 53) Source(67, 108) + SourceIndex(0) -7 >Emitted(33, 55) Source(67, 11) + SourceIndex(0) -8 >Emitted(33, 67) Source(67, 33) + SourceIndex(0) -9 >Emitted(33, 69) Source(67, 11) + SourceIndex(0) -10>Emitted(33, 106) Source(67, 33) + SourceIndex(0) -11>Emitted(33, 108) Source(67, 35) + SourceIndex(0) -12>Emitted(33, 121) Source(67, 58) + SourceIndex(0) -13>Emitted(33, 123) Source(67, 35) + SourceIndex(0) -14>Emitted(33, 160) Source(67, 58) + SourceIndex(0) -15>Emitted(33, 162) Source(67, 110) + SourceIndex(0) -16>Emitted(33, 163) Source(67, 111) + SourceIndex(0) -17>Emitted(33, 166) Source(67, 114) + SourceIndex(0) -18>Emitted(33, 167) Source(67, 115) + SourceIndex(0) -19>Emitted(33, 169) Source(67, 117) + SourceIndex(0) -20>Emitted(33, 170) Source(67, 118) + SourceIndex(0) -21>Emitted(33, 173) Source(67, 121) + SourceIndex(0) -22>Emitted(33, 174) Source(67, 122) + SourceIndex(0) -23>Emitted(33, 176) Source(67, 124) + SourceIndex(0) -24>Emitted(33, 177) Source(67, 125) + SourceIndex(0) -25>Emitted(33, 179) Source(67, 127) + SourceIndex(0) -26>Emitted(33, 181) Source(67, 129) + SourceIndex(0) -27>Emitted(33, 182) Source(67, 130) + SourceIndex(0) +2 >Emitted(33, 6) Source(67, 10) + SourceIndex(0) +3 >Emitted(33, 10) Source(67, 10) + SourceIndex(0) +4 >Emitted(33, 53) Source(67, 108) + SourceIndex(0) +5 >Emitted(33, 55) Source(67, 11) + SourceIndex(0) +6 >Emitted(33, 67) Source(67, 33) + SourceIndex(0) +7 >Emitted(33, 69) Source(67, 11) + SourceIndex(0) +8 >Emitted(33, 106) Source(67, 33) + SourceIndex(0) +9 >Emitted(33, 108) Source(67, 35) + SourceIndex(0) +10>Emitted(33, 121) Source(67, 58) + SourceIndex(0) +11>Emitted(33, 123) Source(67, 35) + SourceIndex(0) +12>Emitted(33, 160) Source(67, 58) + SourceIndex(0) +13>Emitted(33, 162) Source(67, 110) + SourceIndex(0) +14>Emitted(33, 163) Source(67, 111) + SourceIndex(0) +15>Emitted(33, 166) Source(67, 114) + SourceIndex(0) +16>Emitted(33, 167) Source(67, 115) + SourceIndex(0) +17>Emitted(33, 169) Source(67, 117) + SourceIndex(0) +18>Emitted(33, 170) Source(67, 118) + SourceIndex(0) +19>Emitted(33, 173) Source(67, 121) + SourceIndex(0) +20>Emitted(33, 174) Source(67, 122) + SourceIndex(0) +21>Emitted(33, 176) Source(67, 124) + SourceIndex(0) +22>Emitted(33, 177) Source(67, 125) + SourceIndex(0) +23>Emitted(33, 179) Source(67, 127) + SourceIndex(0) +24>Emitted(33, 181) Source(67, 129) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1260,7 +1149,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1279,127 +1168,115 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(34, 24) Source(68, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(35, 1) Source(69, 1) + SourceIndex(0) -2 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) + >} +1 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) --- >>>for (var _z = multiRobot.name, nameA = _z === void 0 ? "noName" : _z, _0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primaryA = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondaryA = _3 === void 0 ? "secondary" : _3, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -21> ^^ -22> ^ -23> ^^^ -24> ^ -25> ^^ -26> ^ -27> ^^^ -28> ^ -29> ^^ -30> ^ -31> ^^ -32> ^^ -33> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^ +21> ^^^ +22> ^ +23> ^^ +24> ^ +25> ^^^ +26> ^ +27> ^^ +28> ^ +29> ^^ +30> ^^ 1-> > -2 >for -3 > -4 > (let { - > -5 > -6 > name: nameA = "noName" -7 > -8 > name: nameA = "noName" -9 > , +2 >for (let { + > +3 > +4 > name: nameA = "noName" +5 > +6 > name: nameA = "noName" +7 > , > -10> skills: { +8 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -11> -12> skills: { +9 > +10> skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -13> -14> primary: primaryA = "primary" -15> -16> primary: primaryA = "primary" -17> , +11> +12> primary: primaryA = "primary" +13> +14> primary: primaryA = "primary" +15> , > -18> secondary: secondaryA = "secondary" -19> -20> secondary: secondaryA = "secondary" -21> +16> secondary: secondaryA = "secondary" +17> +18> secondary: secondaryA = "secondary" +19> > } = { primary: "none", secondary: "none" } > } = multiRobot, -22> i -23> = -24> 0 -25> ; -26> i -27> < -28> 1 -29> ; -30> i -31> ++ -32> ) -33> { +20> i +21> = +22> 0 +23> ; +24> i +25> < +26> 1 +27> ; +28> i +29> ++ +30> ) 1->Emitted(36, 1) Source(70, 1) + SourceIndex(0) -2 >Emitted(36, 4) Source(70, 4) + SourceIndex(0) -3 >Emitted(36, 5) Source(70, 5) + SourceIndex(0) -4 >Emitted(36, 6) Source(71, 5) + SourceIndex(0) -5 >Emitted(36, 10) Source(71, 5) + SourceIndex(0) -6 >Emitted(36, 30) Source(71, 27) + SourceIndex(0) -7 >Emitted(36, 32) Source(71, 5) + SourceIndex(0) -8 >Emitted(36, 69) Source(71, 27) + SourceIndex(0) -9 >Emitted(36, 71) Source(72, 5) + SourceIndex(0) -10>Emitted(36, 93) Source(75, 47) + SourceIndex(0) -11>Emitted(36, 95) Source(72, 5) + SourceIndex(0) -12>Emitted(36, 159) Source(75, 47) + SourceIndex(0) -13>Emitted(36, 161) Source(73, 9) + SourceIndex(0) -14>Emitted(36, 176) Source(73, 38) + SourceIndex(0) -15>Emitted(36, 178) Source(73, 9) + SourceIndex(0) -16>Emitted(36, 219) Source(73, 38) + SourceIndex(0) -17>Emitted(36, 221) Source(74, 9) + SourceIndex(0) -18>Emitted(36, 238) Source(74, 44) + SourceIndex(0) -19>Emitted(36, 240) Source(74, 9) + SourceIndex(0) -20>Emitted(36, 285) Source(74, 44) + SourceIndex(0) -21>Emitted(36, 287) Source(76, 17) + SourceIndex(0) -22>Emitted(36, 288) Source(76, 18) + SourceIndex(0) -23>Emitted(36, 291) Source(76, 21) + SourceIndex(0) -24>Emitted(36, 292) Source(76, 22) + SourceIndex(0) -25>Emitted(36, 294) Source(76, 24) + SourceIndex(0) -26>Emitted(36, 295) Source(76, 25) + SourceIndex(0) -27>Emitted(36, 298) Source(76, 28) + SourceIndex(0) -28>Emitted(36, 299) Source(76, 29) + SourceIndex(0) -29>Emitted(36, 301) Source(76, 31) + SourceIndex(0) -30>Emitted(36, 302) Source(76, 32) + SourceIndex(0) -31>Emitted(36, 304) Source(76, 34) + SourceIndex(0) -32>Emitted(36, 306) Source(76, 36) + SourceIndex(0) -33>Emitted(36, 307) Source(76, 37) + SourceIndex(0) +2 >Emitted(36, 6) Source(71, 5) + SourceIndex(0) +3 >Emitted(36, 10) Source(71, 5) + SourceIndex(0) +4 >Emitted(36, 30) Source(71, 27) + SourceIndex(0) +5 >Emitted(36, 32) Source(71, 5) + SourceIndex(0) +6 >Emitted(36, 69) Source(71, 27) + SourceIndex(0) +7 >Emitted(36, 71) Source(72, 5) + SourceIndex(0) +8 >Emitted(36, 93) Source(75, 47) + SourceIndex(0) +9 >Emitted(36, 95) Source(72, 5) + SourceIndex(0) +10>Emitted(36, 159) Source(75, 47) + SourceIndex(0) +11>Emitted(36, 161) Source(73, 9) + SourceIndex(0) +12>Emitted(36, 176) Source(73, 38) + SourceIndex(0) +13>Emitted(36, 178) Source(73, 9) + SourceIndex(0) +14>Emitted(36, 219) Source(73, 38) + SourceIndex(0) +15>Emitted(36, 221) Source(74, 9) + SourceIndex(0) +16>Emitted(36, 238) Source(74, 44) + SourceIndex(0) +17>Emitted(36, 240) Source(74, 9) + SourceIndex(0) +18>Emitted(36, 285) Source(74, 44) + SourceIndex(0) +19>Emitted(36, 287) Source(76, 17) + SourceIndex(0) +20>Emitted(36, 288) Source(76, 18) + SourceIndex(0) +21>Emitted(36, 291) Source(76, 21) + SourceIndex(0) +22>Emitted(36, 292) Source(76, 22) + SourceIndex(0) +23>Emitted(36, 294) Source(76, 24) + SourceIndex(0) +24>Emitted(36, 295) Source(76, 25) + SourceIndex(0) +25>Emitted(36, 298) Source(76, 28) + SourceIndex(0) +26>Emitted(36, 299) Source(76, 29) + SourceIndex(0) +27>Emitted(36, 301) Source(76, 31) + SourceIndex(0) +28>Emitted(36, 302) Source(76, 32) + SourceIndex(0) +29>Emitted(36, 304) Source(76, 34) + SourceIndex(0) +30>Emitted(36, 306) Source(76, 36) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1410,7 +1287,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1429,138 +1306,126 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(37, 27) Source(77, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(38, 1) Source(78, 1) + SourceIndex(0) -2 >Emitted(38, 2) Source(78, 2) + SourceIndex(0) + >} +1 >Emitted(38, 2) Source(78, 2) + SourceIndex(0) --- >>>for (var _4 = getMultiRobot(), _5 = _4.name, nameA = _5 === void 0 ? "noName" : _5, _6 = _4.skills, _7 = _6 === void 0 ? { primary: "none", secondary: "none" } : _6, _8 = _7.primary, primaryA = _8 === void 0 ? "primary" : _8, _9 = _7.secondary, secondaryA = _9 === void 0 ? "secondary" : _9, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^^^^^^^^^^^^^^^^^ -21> ^^ -22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^^ -30> ^ -31> ^^ -32> ^ -33> ^^ -34> ^^ -35> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^^ +28> ^ +29> ^^ +30> ^ +31> ^^ +32> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > { +2 >for (let +3 > +4 > { > name: nameA = "noName", > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } > } = getMultiRobot() -7 > -8 > name: nameA = "noName" -9 > -10> name: nameA = "noName" -11> , +5 > +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , > -12> skills: { +10> skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -13> -14> skills: { +11> +12> skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -15> -16> primary: primaryA = "primary" -17> -18> primary: primaryA = "primary" -19> , +13> +14> primary: primaryA = "primary" +15> +16> primary: primaryA = "primary" +17> , > -20> secondary: secondaryA = "secondary" -21> -22> secondary: secondaryA = "secondary" -23> +18> secondary: secondaryA = "secondary" +19> +20> secondary: secondaryA = "secondary" +21> > } = { primary: "none", secondary: "none" } > } = getMultiRobot(), -24> i -25> = -26> 0 -27> ; -28> i -29> < -30> 1 -31> ; -32> i -33> ++ -34> ) -35> { +22> i +23> = +24> 0 +25> ; +26> i +27> < +28> 1 +29> ; +30> i +31> ++ +32> ) 1->Emitted(39, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(79, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(79, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(79, 10) + SourceIndex(0) -5 >Emitted(39, 10) Source(79, 10) + SourceIndex(0) -6 >Emitted(39, 30) Source(85, 20) + SourceIndex(0) -7 >Emitted(39, 32) Source(80, 5) + SourceIndex(0) -8 >Emitted(39, 44) Source(80, 27) + SourceIndex(0) -9 >Emitted(39, 46) Source(80, 5) + SourceIndex(0) -10>Emitted(39, 83) Source(80, 27) + SourceIndex(0) -11>Emitted(39, 85) Source(81, 5) + SourceIndex(0) -12>Emitted(39, 99) Source(84, 47) + SourceIndex(0) -13>Emitted(39, 101) Source(81, 5) + SourceIndex(0) -14>Emitted(39, 165) Source(84, 47) + SourceIndex(0) -15>Emitted(39, 167) Source(82, 9) + SourceIndex(0) -16>Emitted(39, 182) Source(82, 38) + SourceIndex(0) -17>Emitted(39, 184) Source(82, 9) + SourceIndex(0) -18>Emitted(39, 225) Source(82, 38) + SourceIndex(0) -19>Emitted(39, 227) Source(83, 9) + SourceIndex(0) -20>Emitted(39, 244) Source(83, 44) + SourceIndex(0) -21>Emitted(39, 246) Source(83, 9) + SourceIndex(0) -22>Emitted(39, 291) Source(83, 44) + SourceIndex(0) -23>Emitted(39, 293) Source(85, 22) + SourceIndex(0) -24>Emitted(39, 294) Source(85, 23) + SourceIndex(0) -25>Emitted(39, 297) Source(85, 26) + SourceIndex(0) -26>Emitted(39, 298) Source(85, 27) + SourceIndex(0) -27>Emitted(39, 300) Source(85, 29) + SourceIndex(0) -28>Emitted(39, 301) Source(85, 30) + SourceIndex(0) -29>Emitted(39, 304) Source(85, 33) + SourceIndex(0) -30>Emitted(39, 305) Source(85, 34) + SourceIndex(0) -31>Emitted(39, 307) Source(85, 36) + SourceIndex(0) -32>Emitted(39, 308) Source(85, 37) + SourceIndex(0) -33>Emitted(39, 310) Source(85, 39) + SourceIndex(0) -34>Emitted(39, 312) Source(85, 41) + SourceIndex(0) -35>Emitted(39, 313) Source(85, 42) + SourceIndex(0) +2 >Emitted(39, 6) Source(79, 10) + SourceIndex(0) +3 >Emitted(39, 10) Source(79, 10) + SourceIndex(0) +4 >Emitted(39, 30) Source(85, 20) + SourceIndex(0) +5 >Emitted(39, 32) Source(80, 5) + SourceIndex(0) +6 >Emitted(39, 44) Source(80, 27) + SourceIndex(0) +7 >Emitted(39, 46) Source(80, 5) + SourceIndex(0) +8 >Emitted(39, 83) Source(80, 27) + SourceIndex(0) +9 >Emitted(39, 85) Source(81, 5) + SourceIndex(0) +10>Emitted(39, 99) Source(84, 47) + SourceIndex(0) +11>Emitted(39, 101) Source(81, 5) + SourceIndex(0) +12>Emitted(39, 165) Source(84, 47) + SourceIndex(0) +13>Emitted(39, 167) Source(82, 9) + SourceIndex(0) +14>Emitted(39, 182) Source(82, 38) + SourceIndex(0) +15>Emitted(39, 184) Source(82, 9) + SourceIndex(0) +16>Emitted(39, 225) Source(82, 38) + SourceIndex(0) +17>Emitted(39, 227) Source(83, 9) + SourceIndex(0) +18>Emitted(39, 244) Source(83, 44) + SourceIndex(0) +19>Emitted(39, 246) Source(83, 9) + SourceIndex(0) +20>Emitted(39, 291) Source(83, 44) + SourceIndex(0) +21>Emitted(39, 293) Source(85, 22) + SourceIndex(0) +22>Emitted(39, 294) Source(85, 23) + SourceIndex(0) +23>Emitted(39, 297) Source(85, 26) + SourceIndex(0) +24>Emitted(39, 298) Source(85, 27) + SourceIndex(0) +25>Emitted(39, 300) Source(85, 29) + SourceIndex(0) +26>Emitted(39, 301) Source(85, 30) + SourceIndex(0) +27>Emitted(39, 304) Source(85, 33) + SourceIndex(0) +28>Emitted(39, 305) Source(85, 34) + SourceIndex(0) +29>Emitted(39, 307) Source(85, 36) + SourceIndex(0) +30>Emitted(39, 308) Source(85, 37) + SourceIndex(0) +31>Emitted(39, 310) Source(85, 39) + SourceIndex(0) +32>Emitted(39, 312) Source(85, 41) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1571,7 +1436,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1590,139 +1455,127 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(40, 27) Source(86, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(41, 1) Source(87, 1) + SourceIndex(0) -2 >Emitted(41, 2) Source(87, 2) + SourceIndex(0) + >} +1 >Emitted(41, 2) Source(87, 2) + SourceIndex(0) --- >>>for (var _10 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _11 = _10.name, nameA = _11 === void 0 ? "noName" : _11, _12 = _10.skills, _13 = _12 === void 0 ? { primary: "none", secondary: "none" } : _12, _14 = _13.primary, primaryA = _14 === void 0 ? "primary" : _14, _15 = _13.secondary, secondaryA = _15 === void 0 ? "secondary" : _15, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -11> ^^ -12> ^^^^^^^^^^^^^^^^ -13> ^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -15> ^^ -16> ^^^^^^^^^^^^^^^^^ -17> ^^ -18> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -19> ^^ -20> ^^^^^^^^^^^^^^^^^^^ -21> ^^ -22> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -23> ^^ -24> ^ -25> ^^^ -26> ^ -27> ^^ -28> ^ -29> ^^^ -30> ^ -31> ^^ -32> ^ -33> ^^ -34> ^^ -35> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +5 > ^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +9 > ^^ +10> ^^^^^^^^^^^^^^^^ +11> ^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +13> ^^ +14> ^^^^^^^^^^^^^^^^^ +15> ^^ +16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +17> ^^ +18> ^^^^^^^^^^^^^^^^^^^ +19> ^^ +20> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +21> ^^ +22> ^ +23> ^^^ +24> ^ +25> ^^ +26> ^ +27> ^^^ +28> ^ +29> ^^ +30> ^ +31> ^^ +32> ^^ 1-> > -2 >for -3 > -4 > (let -5 > -6 > { +2 >for (let +3 > +4 > { > name: nameA = "noName", > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -7 > -8 > name: nameA = "noName" -9 > -10> name: nameA = "noName" -11> , +5 > +6 > name: nameA = "noName" +7 > +8 > name: nameA = "noName" +9 > , > -12> skills: { +10> skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -13> -14> skills: { +11> +12> skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -15> -16> primary: primaryA = "primary" -17> -18> primary: primaryA = "primary" -19> , +13> +14> primary: primaryA = "primary" +15> +16> primary: primaryA = "primary" +17> , > -20> secondary: secondaryA = "secondary" -21> -22> secondary: secondaryA = "secondary" -23> +18> secondary: secondaryA = "secondary" +19> +20> secondary: secondaryA = "secondary" +21> > } = { primary: "none", secondary: "none" } > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, > -24> i -25> = -26> 0 -27> ; -28> i -29> < -30> 1 -31> ; -32> i -33> ++ -34> ) -35> { +22> i +23> = +24> 0 +25> ; +26> i +27> < +28> 1 +29> ; +30> i +31> ++ +32> ) 1->Emitted(42, 1) Source(88, 1) + SourceIndex(0) -2 >Emitted(42, 4) Source(88, 4) + SourceIndex(0) -3 >Emitted(42, 5) Source(88, 5) + SourceIndex(0) -4 >Emitted(42, 6) Source(88, 10) + SourceIndex(0) -5 >Emitted(42, 10) Source(88, 10) + SourceIndex(0) -6 >Emitted(42, 89) Source(94, 90) + SourceIndex(0) -7 >Emitted(42, 91) Source(89, 5) + SourceIndex(0) -8 >Emitted(42, 105) Source(89, 27) + SourceIndex(0) -9 >Emitted(42, 107) Source(89, 5) + SourceIndex(0) -10>Emitted(42, 146) Source(89, 27) + SourceIndex(0) -11>Emitted(42, 148) Source(90, 5) + SourceIndex(0) -12>Emitted(42, 164) Source(93, 47) + SourceIndex(0) -13>Emitted(42, 166) Source(90, 5) + SourceIndex(0) -14>Emitted(42, 233) Source(93, 47) + SourceIndex(0) -15>Emitted(42, 235) Source(91, 9) + SourceIndex(0) -16>Emitted(42, 252) Source(91, 38) + SourceIndex(0) -17>Emitted(42, 254) Source(91, 9) + SourceIndex(0) -18>Emitted(42, 297) Source(91, 38) + SourceIndex(0) -19>Emitted(42, 299) Source(92, 9) + SourceIndex(0) -20>Emitted(42, 318) Source(92, 44) + SourceIndex(0) -21>Emitted(42, 320) Source(92, 9) + SourceIndex(0) -22>Emitted(42, 367) Source(92, 44) + SourceIndex(0) -23>Emitted(42, 369) Source(95, 5) + SourceIndex(0) -24>Emitted(42, 370) Source(95, 6) + SourceIndex(0) -25>Emitted(42, 373) Source(95, 9) + SourceIndex(0) -26>Emitted(42, 374) Source(95, 10) + SourceIndex(0) -27>Emitted(42, 376) Source(95, 12) + SourceIndex(0) -28>Emitted(42, 377) Source(95, 13) + SourceIndex(0) -29>Emitted(42, 380) Source(95, 16) + SourceIndex(0) -30>Emitted(42, 381) Source(95, 17) + SourceIndex(0) -31>Emitted(42, 383) Source(95, 19) + SourceIndex(0) -32>Emitted(42, 384) Source(95, 20) + SourceIndex(0) -33>Emitted(42, 386) Source(95, 22) + SourceIndex(0) -34>Emitted(42, 388) Source(95, 24) + SourceIndex(0) -35>Emitted(42, 389) Source(95, 25) + SourceIndex(0) +2 >Emitted(42, 6) Source(88, 10) + SourceIndex(0) +3 >Emitted(42, 10) Source(88, 10) + SourceIndex(0) +4 >Emitted(42, 89) Source(94, 90) + SourceIndex(0) +5 >Emitted(42, 91) Source(89, 5) + SourceIndex(0) +6 >Emitted(42, 105) Source(89, 27) + SourceIndex(0) +7 >Emitted(42, 107) Source(89, 5) + SourceIndex(0) +8 >Emitted(42, 146) Source(89, 27) + SourceIndex(0) +9 >Emitted(42, 148) Source(90, 5) + SourceIndex(0) +10>Emitted(42, 164) Source(93, 47) + SourceIndex(0) +11>Emitted(42, 166) Source(90, 5) + SourceIndex(0) +12>Emitted(42, 233) Source(93, 47) + SourceIndex(0) +13>Emitted(42, 235) Source(91, 9) + SourceIndex(0) +14>Emitted(42, 252) Source(91, 38) + SourceIndex(0) +15>Emitted(42, 254) Source(91, 9) + SourceIndex(0) +16>Emitted(42, 297) Source(91, 38) + SourceIndex(0) +17>Emitted(42, 299) Source(92, 9) + SourceIndex(0) +18>Emitted(42, 318) Source(92, 44) + SourceIndex(0) +19>Emitted(42, 320) Source(92, 9) + SourceIndex(0) +20>Emitted(42, 367) Source(92, 44) + SourceIndex(0) +21>Emitted(42, 369) Source(95, 5) + SourceIndex(0) +22>Emitted(42, 370) Source(95, 6) + SourceIndex(0) +23>Emitted(42, 373) Source(95, 9) + SourceIndex(0) +24>Emitted(42, 374) Source(95, 10) + SourceIndex(0) +25>Emitted(42, 376) Source(95, 12) + SourceIndex(0) +26>Emitted(42, 377) Source(95, 13) + SourceIndex(0) +27>Emitted(42, 380) Source(95, 16) + SourceIndex(0) +28>Emitted(42, 381) Source(95, 17) + SourceIndex(0) +29>Emitted(42, 383) Source(95, 19) + SourceIndex(0) +30>Emitted(42, 384) Source(95, 20) + SourceIndex(0) +31>Emitted(42, 386) Source(95, 22) + SourceIndex(0) +32>Emitted(42, 388) Source(95, 24) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1733,7 +1586,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1752,13 +1605,10 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues. 8 >Emitted(43, 27) Source(96, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(44, 1) Source(97, 1) + SourceIndex(0) -2 >Emitted(44, 2) Source(97, 2) + SourceIndex(0) + >} +1 >Emitted(44, 2) Source(97, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map index dd248e89944..e629b258ec8 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AACD;IACI,MAAM,CAAC,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAE,eAAsB,EAAtB,qCAAsB,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAAsC,EAArC,YAAsB,EAAtB,qCAAsB,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,2CAAyE,EAAxE,YAAsB,EAAtB,qCAAsB,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEvC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,MAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,8EAKoF,EAJrF,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC;IAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAG,eAAe,EAAf,oCAAe,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,eAAgC,EAA9B,YAAe,EAAf,oCAAe,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,2CAAmE,EAAjE,YAAe,EAAf,oCAAe,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,sBAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,EAE3B,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,MAEV,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,8EAKoF,EAJrF,eAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAGD,GAAG,CAAC,CAAE,gBAAsB,EAAtB,uCAAsB,EAAE,iBAAuB,EAAvB,uCAAuB,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,gBAA+D,EAA9D,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,OAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,4CAAkG,EAAjG,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,OAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACzH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,qBAAsB,EAAtB,uCAAsB,EACtB,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAEvC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,qBAMc,EALf,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,OAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,+EAMoF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG,CAAC,CAAG,gBAAe,EAAf,sCAAe,EAAE,iBAAe,EAAf,sCAAe,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,gBAAiD,EAA/C,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,OAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,4CAAoF,EAAlF,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,OAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CACA,qBAAe,EAAf,sCAAe,EACf,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,EAE3B,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,qBAMc,EALf,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,OAEV,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AACD,GAAG,CAAC,CAAC,+EAMoF,EALrF,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IACpB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,KAAK,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtD,IAAI,UAAU,GAAe,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACjG;IACI,OAAO,KAAK,CAAC;AACjB,CAAC;AACD;IACI,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,KAAM,eAAsB,EAAtB,qCAAsB,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAAsC,EAArC,YAAsB,EAAtB,qCAAsB,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,2CAAyE,EAAxE,YAAsB,EAAtB,qCAAsB,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACI,sBAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,EAEvC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC,MAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,8EAKoF,EAJrF,cAG0C,EAH1C,gEAG0C,EAFtC,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAmC,EAAnC,6CAAmC;IAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,KAAO,eAAe,EAAf,oCAAe,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,eAAgC,EAA9B,YAAe,EAAf,oCAAe,MAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACtD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,2CAAmE,EAAjE,YAAe,EAAf,oCAAe,MAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACzF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACI,sBAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,EAE3B,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,oBAKc,EAJf,cAG0C,EAH1C,gEAG0C,EAFtC,eAAmB,EAAnB,wCAAmB,EACnB,iBAAuB,EAAvB,4CAAuB,MAEV,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,8EAKoF,EAJrF,eAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,KAAM,gBAAsB,EAAtB,uCAAsB,EAAE,iBAAuB,EAAvB,uCAAuB,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAChF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,gBAA+D,EAA9D,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,OAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACrF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,4CAAkG,EAAjG,cAAsB,EAAtB,uCAAsB,EAAE,eAAuB,EAAvB,uCAAuB,OAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACxH,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACI,qBAAsB,EAAtB,uCAAsB,EACtB,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,EAEvC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,qBAMc,EALf,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC,OAEtB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,+EAMoF,EALrF,cAAsB,EAAtB,uCAAsB,EACtB,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,KAAO,gBAAe,EAAf,sCAAe,EAAE,iBAAe,EAAf,sCAAe,EAAK,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAClE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,gBAAiD,EAA/C,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,OAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACvE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAK,4CAAoF,EAAlF,cAAe,EAAf,sCAAe,EAAE,eAAe,EAAf,sCAAe,OAAoD,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC1G,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACI,qBAAe,EAAf,sCAAe,EACf,uBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,EAE3B,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,qBAMc,EALf,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB,OAEV,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACpC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAK,+EAMoF,EALrF,cAAe,EAAf,sCAAe,EACf,gBAG0C,EAH1C,mEAG0C,EAFtC,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt index 97271e8f3d0..a4887d243e1 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.sourcemap.txt @@ -147,21 +147,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 --- >>> return robot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^ +4 > ^ 1->function getRobot() { > -2 > return -3 > -4 > robot -5 > ; +2 > return +3 > robot +4 > ; 1->Emitted(4, 5) Source(20, 5) + SourceIndex(0) -2 >Emitted(4, 11) Source(20, 11) + SourceIndex(0) -3 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) -4 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) -5 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) +2 >Emitted(4, 12) Source(20, 12) + SourceIndex(0) +3 >Emitted(4, 17) Source(20, 17) + SourceIndex(0) +4 >Emitted(4, 18) Source(20, 18) + SourceIndex(0) --- >>>} 1 > @@ -182,21 +179,18 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 --- >>> return multiRobot; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^ +4 > ^ 1->function getMultiRobot() { > -2 > return -3 > -4 > multiRobot -5 > ; +2 > return +3 > multiRobot +4 > ; 1->Emitted(7, 5) Source(23, 5) + SourceIndex(0) -2 >Emitted(7, 11) Source(23, 11) + SourceIndex(0) -3 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) -4 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) -5 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) +2 >Emitted(7, 12) Source(23, 12) + SourceIndex(0) +3 >Emitted(7, 22) Source(23, 22) + SourceIndex(0) +4 >Emitted(7, 23) Source(23, 23) + SourceIndex(0) --- >>>} 1 > @@ -284,73 +278,64 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 --- >>>for (_a = robot.name, nameA = _a === void 0 ? "noName" : _a, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > > -2 >for -3 > -4 > ({ -5 > name: nameA = "noName" -6 > -7 > name: nameA = "noName" -8 > } = -9 > robot -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ({ +3 > name: nameA = "noName" +4 > +5 > name: nameA = "noName" +6 > } = +7 > robot +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(11, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(11, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(11, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(11, 6) Source(29, 7) + SourceIndex(0) -5 >Emitted(11, 21) Source(29, 29) + SourceIndex(0) -6 >Emitted(11, 23) Source(29, 7) + SourceIndex(0) -7 >Emitted(11, 60) Source(29, 29) + SourceIndex(0) -8 >Emitted(11, 62) Source(29, 34) + SourceIndex(0) -9 >Emitted(11, 67) Source(29, 39) + SourceIndex(0) -10>Emitted(11, 69) Source(29, 41) + SourceIndex(0) -11>Emitted(11, 70) Source(29, 42) + SourceIndex(0) -12>Emitted(11, 73) Source(29, 45) + SourceIndex(0) -13>Emitted(11, 74) Source(29, 46) + SourceIndex(0) -14>Emitted(11, 76) Source(29, 48) + SourceIndex(0) -15>Emitted(11, 77) Source(29, 49) + SourceIndex(0) -16>Emitted(11, 80) Source(29, 52) + SourceIndex(0) -17>Emitted(11, 81) Source(29, 53) + SourceIndex(0) -18>Emitted(11, 83) Source(29, 55) + SourceIndex(0) -19>Emitted(11, 84) Source(29, 56) + SourceIndex(0) -20>Emitted(11, 86) Source(29, 58) + SourceIndex(0) -21>Emitted(11, 88) Source(29, 60) + SourceIndex(0) -22>Emitted(11, 89) Source(29, 61) + SourceIndex(0) +2 >Emitted(11, 6) Source(29, 7) + SourceIndex(0) +3 >Emitted(11, 21) Source(29, 29) + SourceIndex(0) +4 >Emitted(11, 23) Source(29, 7) + SourceIndex(0) +5 >Emitted(11, 60) Source(29, 29) + SourceIndex(0) +6 >Emitted(11, 62) Source(29, 34) + SourceIndex(0) +7 >Emitted(11, 67) Source(29, 39) + SourceIndex(0) +8 >Emitted(11, 69) Source(29, 41) + SourceIndex(0) +9 >Emitted(11, 70) Source(29, 42) + SourceIndex(0) +10>Emitted(11, 73) Source(29, 45) + SourceIndex(0) +11>Emitted(11, 74) Source(29, 46) + SourceIndex(0) +12>Emitted(11, 76) Source(29, 48) + SourceIndex(0) +13>Emitted(11, 77) Source(29, 49) + SourceIndex(0) +14>Emitted(11, 80) Source(29, 52) + SourceIndex(0) +15>Emitted(11, 81) Source(29, 53) + SourceIndex(0) +16>Emitted(11, 83) Source(29, 55) + SourceIndex(0) +17>Emitted(11, 84) Source(29, 56) + SourceIndex(0) +18>Emitted(11, 86) Source(29, 58) + SourceIndex(0) +19>Emitted(11, 88) Source(29, 60) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -361,7 +346,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -380,83 +365,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(12, 24) Source(30, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(13, 1) Source(31, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) + >} +1 >Emitted(13, 2) Source(31, 2) + SourceIndex(0) --- >>>for (_b = getRobot(), _c = _b.name, nameA = _c === void 0 ? "noName" : _c, _b, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > {name: nameA = "noName" } = getRobot() -6 > -7 > name: nameA = "noName" -8 > -9 > name: nameA = "noName" -10> } = getRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > {name: nameA = "noName" } = getRobot() +4 > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > } = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) -5 >Emitted(14, 21) Source(32, 44) + SourceIndex(0) -6 >Emitted(14, 23) Source(32, 7) + SourceIndex(0) -7 >Emitted(14, 35) Source(32, 29) + SourceIndex(0) -8 >Emitted(14, 37) Source(32, 7) + SourceIndex(0) -9 >Emitted(14, 74) Source(32, 29) + SourceIndex(0) -10>Emitted(14, 80) Source(32, 46) + SourceIndex(0) -11>Emitted(14, 81) Source(32, 47) + SourceIndex(0) -12>Emitted(14, 84) Source(32, 50) + SourceIndex(0) -13>Emitted(14, 85) Source(32, 51) + SourceIndex(0) -14>Emitted(14, 87) Source(32, 53) + SourceIndex(0) -15>Emitted(14, 88) Source(32, 54) + SourceIndex(0) -16>Emitted(14, 91) Source(32, 57) + SourceIndex(0) -17>Emitted(14, 92) Source(32, 58) + SourceIndex(0) -18>Emitted(14, 94) Source(32, 60) + SourceIndex(0) -19>Emitted(14, 95) Source(32, 61) + SourceIndex(0) -20>Emitted(14, 97) Source(32, 63) + SourceIndex(0) -21>Emitted(14, 99) Source(32, 65) + SourceIndex(0) -22>Emitted(14, 100) Source(32, 66) + SourceIndex(0) +2 >Emitted(14, 6) Source(32, 6) + SourceIndex(0) +3 >Emitted(14, 21) Source(32, 44) + SourceIndex(0) +4 >Emitted(14, 23) Source(32, 7) + SourceIndex(0) +5 >Emitted(14, 35) Source(32, 29) + SourceIndex(0) +6 >Emitted(14, 37) Source(32, 7) + SourceIndex(0) +7 >Emitted(14, 74) Source(32, 29) + SourceIndex(0) +8 >Emitted(14, 80) Source(32, 46) + SourceIndex(0) +9 >Emitted(14, 81) Source(32, 47) + SourceIndex(0) +10>Emitted(14, 84) Source(32, 50) + SourceIndex(0) +11>Emitted(14, 85) Source(32, 51) + SourceIndex(0) +12>Emitted(14, 87) Source(32, 53) + SourceIndex(0) +13>Emitted(14, 88) Source(32, 54) + SourceIndex(0) +14>Emitted(14, 91) Source(32, 57) + SourceIndex(0) +15>Emitted(14, 92) Source(32, 58) + SourceIndex(0) +16>Emitted(14, 94) Source(32, 60) + SourceIndex(0) +17>Emitted(14, 95) Source(32, 61) + SourceIndex(0) +18>Emitted(14, 97) Source(32, 63) + SourceIndex(0) +19>Emitted(14, 99) Source(32, 65) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -467,7 +440,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -486,83 +459,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(15, 24) Source(33, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(16, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) + >} +1 >Emitted(16, 2) Source(34, 2) + SourceIndex(0) --- >>>for (_d = { name: "trimmer", skill: "trimming" }, _e = _d.name, nameA = _e === void 0 ? "noName" : _e, _d, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } -6 > -7 > name: nameA = "noName" -8 > -9 > name: nameA = "noName" -10> } = { name: "trimmer", skill: "trimming" }, -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" } +4 > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > } = { name: "trimmer", skill: "trimming" }, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(17, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(17, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(17, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) -5 >Emitted(17, 49) Source(35, 79) + SourceIndex(0) -6 >Emitted(17, 51) Source(35, 7) + SourceIndex(0) -7 >Emitted(17, 63) Source(35, 29) + SourceIndex(0) -8 >Emitted(17, 65) Source(35, 7) + SourceIndex(0) -9 >Emitted(17, 102) Source(35, 29) + SourceIndex(0) -10>Emitted(17, 108) Source(35, 81) + SourceIndex(0) -11>Emitted(17, 109) Source(35, 82) + SourceIndex(0) -12>Emitted(17, 112) Source(35, 85) + SourceIndex(0) -13>Emitted(17, 113) Source(35, 86) + SourceIndex(0) -14>Emitted(17, 115) Source(35, 88) + SourceIndex(0) -15>Emitted(17, 116) Source(35, 89) + SourceIndex(0) -16>Emitted(17, 119) Source(35, 92) + SourceIndex(0) -17>Emitted(17, 120) Source(35, 93) + SourceIndex(0) -18>Emitted(17, 122) Source(35, 95) + SourceIndex(0) -19>Emitted(17, 123) Source(35, 96) + SourceIndex(0) -20>Emitted(17, 125) Source(35, 98) + SourceIndex(0) -21>Emitted(17, 127) Source(35, 100) + SourceIndex(0) -22>Emitted(17, 128) Source(35, 101) + SourceIndex(0) +2 >Emitted(17, 6) Source(35, 6) + SourceIndex(0) +3 >Emitted(17, 49) Source(35, 79) + SourceIndex(0) +4 >Emitted(17, 51) Source(35, 7) + SourceIndex(0) +5 >Emitted(17, 63) Source(35, 29) + SourceIndex(0) +6 >Emitted(17, 65) Source(35, 7) + SourceIndex(0) +7 >Emitted(17, 102) Source(35, 29) + SourceIndex(0) +8 >Emitted(17, 108) Source(35, 81) + SourceIndex(0) +9 >Emitted(17, 109) Source(35, 82) + SourceIndex(0) +10>Emitted(17, 112) Source(35, 85) + SourceIndex(0) +11>Emitted(17, 113) Source(35, 86) + SourceIndex(0) +12>Emitted(17, 115) Source(35, 88) + SourceIndex(0) +13>Emitted(17, 116) Source(35, 89) + SourceIndex(0) +14>Emitted(17, 119) Source(35, 92) + SourceIndex(0) +15>Emitted(17, 120) Source(35, 93) + SourceIndex(0) +16>Emitted(17, 122) Source(35, 95) + SourceIndex(0) +17>Emitted(17, 123) Source(35, 96) + SourceIndex(0) +18>Emitted(17, 125) Source(35, 98) + SourceIndex(0) +19>Emitted(17, 127) Source(35, 100) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -573,7 +534,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -592,117 +553,105 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(18, 24) Source(36, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(19, 1) Source(37, 1) + SourceIndex(0) -2 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) + >} +1 >Emitted(19, 2) Source(37, 2) + SourceIndex(0) --- >>>for (_f = multiRobot.skills, _g = _f === void 0 ? { primary: "none", secondary: "none" } : _f, _h = _g.primary, primaryA = _h === void 0 ? "primary" : _h, _j = _g.secondary, secondaryA = _j === void 0 ? "secondary" : _j, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ({ - > -5 > skills: { +2 >for ({ + > +3 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -6 > -7 > skills: { +4 > +5 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -8 > -9 > primary: primaryA = "primary" -10> -11> primary: primaryA = "primary" -12> , +6 > +7 > primary: primaryA = "primary" +8 > +9 > primary: primaryA = "primary" +10> , > -13> secondary: secondaryA = "secondary" -14> -15> secondary: secondaryA = "secondary" -16> +11> secondary: secondaryA = "secondary" +12> +13> secondary: secondaryA = "secondary" +14> > } = { primary: "none", secondary: "none" } > } = -17> multiRobot -18> , -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +15> multiRobot +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(20, 6) Source(39, 5) + SourceIndex(0) -5 >Emitted(20, 28) Source(42, 47) + SourceIndex(0) -6 >Emitted(20, 30) Source(39, 5) + SourceIndex(0) -7 >Emitted(20, 94) Source(42, 47) + SourceIndex(0) -8 >Emitted(20, 96) Source(40, 9) + SourceIndex(0) -9 >Emitted(20, 111) Source(40, 38) + SourceIndex(0) -10>Emitted(20, 113) Source(40, 9) + SourceIndex(0) -11>Emitted(20, 154) Source(40, 38) + SourceIndex(0) -12>Emitted(20, 156) Source(41, 9) + SourceIndex(0) -13>Emitted(20, 173) Source(41, 44) + SourceIndex(0) -14>Emitted(20, 175) Source(41, 9) + SourceIndex(0) -15>Emitted(20, 220) Source(41, 44) + SourceIndex(0) -16>Emitted(20, 222) Source(43, 5) + SourceIndex(0) -17>Emitted(20, 232) Source(43, 15) + SourceIndex(0) -18>Emitted(20, 234) Source(43, 17) + SourceIndex(0) -19>Emitted(20, 235) Source(43, 18) + SourceIndex(0) -20>Emitted(20, 238) Source(43, 21) + SourceIndex(0) -21>Emitted(20, 239) Source(43, 22) + SourceIndex(0) -22>Emitted(20, 241) Source(43, 24) + SourceIndex(0) -23>Emitted(20, 242) Source(43, 25) + SourceIndex(0) -24>Emitted(20, 245) Source(43, 28) + SourceIndex(0) -25>Emitted(20, 246) Source(43, 29) + SourceIndex(0) -26>Emitted(20, 248) Source(43, 31) + SourceIndex(0) -27>Emitted(20, 249) Source(43, 32) + SourceIndex(0) -28>Emitted(20, 251) Source(43, 34) + SourceIndex(0) -29>Emitted(20, 253) Source(43, 36) + SourceIndex(0) -30>Emitted(20, 254) Source(43, 37) + SourceIndex(0) +2 >Emitted(20, 6) Source(39, 5) + SourceIndex(0) +3 >Emitted(20, 28) Source(42, 47) + SourceIndex(0) +4 >Emitted(20, 30) Source(39, 5) + SourceIndex(0) +5 >Emitted(20, 94) Source(42, 47) + SourceIndex(0) +6 >Emitted(20, 96) Source(40, 9) + SourceIndex(0) +7 >Emitted(20, 111) Source(40, 38) + SourceIndex(0) +8 >Emitted(20, 113) Source(40, 9) + SourceIndex(0) +9 >Emitted(20, 154) Source(40, 38) + SourceIndex(0) +10>Emitted(20, 156) Source(41, 9) + SourceIndex(0) +11>Emitted(20, 173) Source(41, 44) + SourceIndex(0) +12>Emitted(20, 175) Source(41, 9) + SourceIndex(0) +13>Emitted(20, 220) Source(41, 44) + SourceIndex(0) +14>Emitted(20, 222) Source(43, 5) + SourceIndex(0) +15>Emitted(20, 232) Source(43, 15) + SourceIndex(0) +16>Emitted(20, 234) Source(43, 17) + SourceIndex(0) +17>Emitted(20, 235) Source(43, 18) + SourceIndex(0) +18>Emitted(20, 238) Source(43, 21) + SourceIndex(0) +19>Emitted(20, 239) Source(43, 22) + SourceIndex(0) +20>Emitted(20, 241) Source(43, 24) + SourceIndex(0) +21>Emitted(20, 242) Source(43, 25) + SourceIndex(0) +22>Emitted(20, 245) Source(43, 28) + SourceIndex(0) +23>Emitted(20, 246) Source(43, 29) + SourceIndex(0) +24>Emitted(20, 248) Source(43, 31) + SourceIndex(0) +25>Emitted(20, 249) Source(43, 32) + SourceIndex(0) +26>Emitted(20, 251) Source(43, 34) + SourceIndex(0) +27>Emitted(20, 253) Source(43, 36) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -713,7 +662,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -732,121 +681,109 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(21, 27) Source(44, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(22, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(22, 2) Source(45, 2) + SourceIndex(0) + >} +1 >Emitted(22, 2) Source(45, 2) + SourceIndex(0) --- >>>for (_k = getMultiRobot(), _l = _k.skills, _m = _l === void 0 ? { primary: "none", secondary: "none" } : _l, _o = _m.primary, primaryA = _o === void 0 ? "primary" : _o, _p = _m.secondary, secondaryA = _p === void 0 ? "secondary" : _p, _k, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^^^^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^^^^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } > } = getMultiRobot() -6 > -7 > skills: { +4 > +5 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -8 > -9 > skills: { +6 > +7 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -10> -11> primary: primaryA = "primary" -12> -13> primary: primaryA = "primary" -14> , +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , > -15> secondary: secondaryA = "secondary" -16> -17> secondary: secondaryA = "secondary" -18> +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" +16> > } = { primary: "none", secondary: "none" } > } = getMultiRobot(), -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(23, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(23, 4) Source(46, 4) + SourceIndex(0) -3 >Emitted(23, 5) Source(46, 5) + SourceIndex(0) -4 >Emitted(23, 6) Source(46, 6) + SourceIndex(0) -5 >Emitted(23, 26) Source(51, 20) + SourceIndex(0) -6 >Emitted(23, 28) Source(47, 5) + SourceIndex(0) -7 >Emitted(23, 42) Source(50, 47) + SourceIndex(0) -8 >Emitted(23, 44) Source(47, 5) + SourceIndex(0) -9 >Emitted(23, 108) Source(50, 47) + SourceIndex(0) -10>Emitted(23, 110) Source(48, 9) + SourceIndex(0) -11>Emitted(23, 125) Source(48, 38) + SourceIndex(0) -12>Emitted(23, 127) Source(48, 9) + SourceIndex(0) -13>Emitted(23, 168) Source(48, 38) + SourceIndex(0) -14>Emitted(23, 170) Source(49, 9) + SourceIndex(0) -15>Emitted(23, 187) Source(49, 44) + SourceIndex(0) -16>Emitted(23, 189) Source(49, 9) + SourceIndex(0) -17>Emitted(23, 234) Source(49, 44) + SourceIndex(0) -18>Emitted(23, 240) Source(51, 22) + SourceIndex(0) -19>Emitted(23, 241) Source(51, 23) + SourceIndex(0) -20>Emitted(23, 244) Source(51, 26) + SourceIndex(0) -21>Emitted(23, 245) Source(51, 27) + SourceIndex(0) -22>Emitted(23, 247) Source(51, 29) + SourceIndex(0) -23>Emitted(23, 248) Source(51, 30) + SourceIndex(0) -24>Emitted(23, 251) Source(51, 33) + SourceIndex(0) -25>Emitted(23, 252) Source(51, 34) + SourceIndex(0) -26>Emitted(23, 254) Source(51, 36) + SourceIndex(0) -27>Emitted(23, 255) Source(51, 37) + SourceIndex(0) -28>Emitted(23, 257) Source(51, 39) + SourceIndex(0) -29>Emitted(23, 259) Source(51, 41) + SourceIndex(0) -30>Emitted(23, 260) Source(51, 42) + SourceIndex(0) +2 >Emitted(23, 6) Source(46, 6) + SourceIndex(0) +3 >Emitted(23, 26) Source(51, 20) + SourceIndex(0) +4 >Emitted(23, 28) Source(47, 5) + SourceIndex(0) +5 >Emitted(23, 42) Source(50, 47) + SourceIndex(0) +6 >Emitted(23, 44) Source(47, 5) + SourceIndex(0) +7 >Emitted(23, 108) Source(50, 47) + SourceIndex(0) +8 >Emitted(23, 110) Source(48, 9) + SourceIndex(0) +9 >Emitted(23, 125) Source(48, 38) + SourceIndex(0) +10>Emitted(23, 127) Source(48, 9) + SourceIndex(0) +11>Emitted(23, 168) Source(48, 38) + SourceIndex(0) +12>Emitted(23, 170) Source(49, 9) + SourceIndex(0) +13>Emitted(23, 187) Source(49, 44) + SourceIndex(0) +14>Emitted(23, 189) Source(49, 9) + SourceIndex(0) +15>Emitted(23, 234) Source(49, 44) + SourceIndex(0) +16>Emitted(23, 240) Source(51, 22) + SourceIndex(0) +17>Emitted(23, 241) Source(51, 23) + SourceIndex(0) +18>Emitted(23, 244) Source(51, 26) + SourceIndex(0) +19>Emitted(23, 245) Source(51, 27) + SourceIndex(0) +20>Emitted(23, 247) Source(51, 29) + SourceIndex(0) +21>Emitted(23, 248) Source(51, 30) + SourceIndex(0) +22>Emitted(23, 251) Source(51, 33) + SourceIndex(0) +23>Emitted(23, 252) Source(51, 34) + SourceIndex(0) +24>Emitted(23, 254) Source(51, 36) + SourceIndex(0) +25>Emitted(23, 255) Source(51, 37) + SourceIndex(0) +26>Emitted(23, 257) Source(51, 39) + SourceIndex(0) +27>Emitted(23, 259) Source(51, 41) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -857,7 +794,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -876,80 +813,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(24, 27) Source(52, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(25, 1) Source(53, 1) + SourceIndex(0) -2 >Emitted(25, 2) Source(53, 2) + SourceIndex(0) + >} +1 >Emitted(25, 2) Source(53, 2) + SourceIndex(0) --- >>>for (_q = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _r = _q.skills, _s = _r === void 0 ? { primary: "none", secondary: "none" } : _r, _t = _s.primary, primaryA = _t === void 0 ? "primary" : _t, _u = _s.secondary, secondaryA = _u === void 0 ? "secondary" : _u, _q, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > skills: { +4 > +5 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -8 > -9 > skills: { +6 > +7 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -10> -11> primary: primaryA = "primary" -12> -13> primary: primaryA = "primary" -14> , +8 > +9 > primary: primaryA = "primary" +10> +11> primary: primaryA = "primary" +12> , > -15> secondary: secondaryA = "secondary" -16> -17> secondary: secondaryA = "secondary" +13> secondary: secondaryA = "secondary" +14> +15> secondary: secondaryA = "secondary" 1->Emitted(26, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(26, 4) Source(54, 4) + SourceIndex(0) -3 >Emitted(26, 5) Source(54, 5) + SourceIndex(0) -4 >Emitted(26, 6) Source(54, 6) + SourceIndex(0) -5 >Emitted(26, 84) Source(59, 90) + SourceIndex(0) -6 >Emitted(26, 86) Source(55, 5) + SourceIndex(0) -7 >Emitted(26, 100) Source(58, 47) + SourceIndex(0) -8 >Emitted(26, 102) Source(55, 5) + SourceIndex(0) -9 >Emitted(26, 166) Source(58, 47) + SourceIndex(0) -10>Emitted(26, 168) Source(56, 9) + SourceIndex(0) -11>Emitted(26, 183) Source(56, 38) + SourceIndex(0) -12>Emitted(26, 185) Source(56, 9) + SourceIndex(0) -13>Emitted(26, 226) Source(56, 38) + SourceIndex(0) -14>Emitted(26, 228) Source(57, 9) + SourceIndex(0) -15>Emitted(26, 245) Source(57, 44) + SourceIndex(0) -16>Emitted(26, 247) Source(57, 9) + SourceIndex(0) -17>Emitted(26, 292) Source(57, 44) + SourceIndex(0) +2 >Emitted(26, 6) Source(54, 6) + SourceIndex(0) +3 >Emitted(26, 84) Source(59, 90) + SourceIndex(0) +4 >Emitted(26, 86) Source(55, 5) + SourceIndex(0) +5 >Emitted(26, 100) Source(58, 47) + SourceIndex(0) +6 >Emitted(26, 102) Source(55, 5) + SourceIndex(0) +7 >Emitted(26, 166) Source(58, 47) + SourceIndex(0) +8 >Emitted(26, 168) Source(56, 9) + SourceIndex(0) +9 >Emitted(26, 183) Source(56, 38) + SourceIndex(0) +10>Emitted(26, 185) Source(56, 9) + SourceIndex(0) +11>Emitted(26, 226) Source(56, 38) + SourceIndex(0) +12>Emitted(26, 228) Source(57, 9) + SourceIndex(0) +13>Emitted(26, 245) Source(57, 44) + SourceIndex(0) +14>Emitted(26, 247) Source(57, 9) + SourceIndex(0) +15>Emitted(26, 292) Source(57, 44) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -964,8 +892,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > > } = { primary: "none", secondary: "none" } >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, @@ -981,7 +908,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> i 11> ++ 12> ) -13> { 1 >Emitted(27, 5) Source(60, 5) + SourceIndex(0) 2 >Emitted(27, 6) Source(60, 6) + SourceIndex(0) 3 >Emitted(27, 9) Source(60, 9) + SourceIndex(0) @@ -994,7 +920,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10>Emitted(27, 20) Source(60, 20) + SourceIndex(0) 11>Emitted(27, 22) Source(60, 22) + SourceIndex(0) 12>Emitted(27, 24) Source(60, 24) + SourceIndex(0) -13>Emitted(27, 25) Source(60, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -1005,7 +930,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -1024,84 +949,72 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(28, 27) Source(61, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(29, 1) Source(62, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(62, 2) + SourceIndex(0) + >} +1 >Emitted(29, 2) Source(62, 2) + SourceIndex(0) --- >>>for (_v = robot.name, name = _v === void 0 ? "noName" : _v, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^ -10> ^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > > -2 >for -3 > -4 > ({ -5 > name = "noName" -6 > -7 > name = "noName" -8 > } = -9 > robot -10> , -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ({ +3 > name = "noName" +4 > +5 > name = "noName" +6 > } = +7 > robot +8 > , +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(30, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(64, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(64, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(64, 8) + SourceIndex(0) -5 >Emitted(30, 21) Source(64, 23) + SourceIndex(0) -6 >Emitted(30, 23) Source(64, 8) + SourceIndex(0) -7 >Emitted(30, 59) Source(64, 23) + SourceIndex(0) -8 >Emitted(30, 61) Source(64, 28) + SourceIndex(0) -9 >Emitted(30, 66) Source(64, 33) + SourceIndex(0) -10>Emitted(30, 68) Source(64, 35) + SourceIndex(0) -11>Emitted(30, 69) Source(64, 36) + SourceIndex(0) -12>Emitted(30, 72) Source(64, 39) + SourceIndex(0) -13>Emitted(30, 73) Source(64, 40) + SourceIndex(0) -14>Emitted(30, 75) Source(64, 42) + SourceIndex(0) -15>Emitted(30, 76) Source(64, 43) + SourceIndex(0) -16>Emitted(30, 79) Source(64, 46) + SourceIndex(0) -17>Emitted(30, 80) Source(64, 47) + SourceIndex(0) -18>Emitted(30, 82) Source(64, 49) + SourceIndex(0) -19>Emitted(30, 83) Source(64, 50) + SourceIndex(0) -20>Emitted(30, 85) Source(64, 52) + SourceIndex(0) -21>Emitted(30, 87) Source(64, 54) + SourceIndex(0) -22>Emitted(30, 88) Source(64, 55) + SourceIndex(0) +2 >Emitted(30, 6) Source(64, 8) + SourceIndex(0) +3 >Emitted(30, 21) Source(64, 23) + SourceIndex(0) +4 >Emitted(30, 23) Source(64, 8) + SourceIndex(0) +5 >Emitted(30, 59) Source(64, 23) + SourceIndex(0) +6 >Emitted(30, 61) Source(64, 28) + SourceIndex(0) +7 >Emitted(30, 66) Source(64, 33) + SourceIndex(0) +8 >Emitted(30, 68) Source(64, 35) + SourceIndex(0) +9 >Emitted(30, 69) Source(64, 36) + SourceIndex(0) +10>Emitted(30, 72) Source(64, 39) + SourceIndex(0) +11>Emitted(30, 73) Source(64, 40) + SourceIndex(0) +12>Emitted(30, 75) Source(64, 42) + SourceIndex(0) +13>Emitted(30, 76) Source(64, 43) + SourceIndex(0) +14>Emitted(30, 79) Source(64, 46) + SourceIndex(0) +15>Emitted(30, 80) Source(64, 47) + SourceIndex(0) +16>Emitted(30, 82) Source(64, 49) + SourceIndex(0) +17>Emitted(30, 83) Source(64, 50) + SourceIndex(0) +18>Emitted(30, 85) Source(64, 52) + SourceIndex(0) +19>Emitted(30, 87) Source(64, 54) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1112,7 +1025,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1131,83 +1044,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(31, 24) Source(65, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(32, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) + >} +1 >Emitted(32, 2) Source(66, 2) + SourceIndex(0) --- >>>for (_w = getRobot(), _x = _w.name, name = _x === void 0 ? "noName" : _x, _w, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name = "noName" } = getRobot() -6 > -7 > name = "noName" -8 > -9 > name = "noName" -10> } = getRobot(), -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > { name = "noName" } = getRobot() +4 > +5 > name = "noName" +6 > +7 > name = "noName" +8 > } = getRobot(), +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(33, 1) Source(67, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(67, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(67, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(67, 6) + SourceIndex(0) -5 >Emitted(33, 21) Source(67, 38) + SourceIndex(0) -6 >Emitted(33, 23) Source(67, 8) + SourceIndex(0) -7 >Emitted(33, 35) Source(67, 23) + SourceIndex(0) -8 >Emitted(33, 37) Source(67, 8) + SourceIndex(0) -9 >Emitted(33, 73) Source(67, 23) + SourceIndex(0) -10>Emitted(33, 79) Source(67, 40) + SourceIndex(0) -11>Emitted(33, 80) Source(67, 41) + SourceIndex(0) -12>Emitted(33, 83) Source(67, 44) + SourceIndex(0) -13>Emitted(33, 84) Source(67, 45) + SourceIndex(0) -14>Emitted(33, 86) Source(67, 47) + SourceIndex(0) -15>Emitted(33, 87) Source(67, 48) + SourceIndex(0) -16>Emitted(33, 90) Source(67, 51) + SourceIndex(0) -17>Emitted(33, 91) Source(67, 52) + SourceIndex(0) -18>Emitted(33, 93) Source(67, 54) + SourceIndex(0) -19>Emitted(33, 94) Source(67, 55) + SourceIndex(0) -20>Emitted(33, 96) Source(67, 57) + SourceIndex(0) -21>Emitted(33, 98) Source(67, 59) + SourceIndex(0) -22>Emitted(33, 99) Source(67, 60) + SourceIndex(0) +2 >Emitted(33, 6) Source(67, 6) + SourceIndex(0) +3 >Emitted(33, 21) Source(67, 38) + SourceIndex(0) +4 >Emitted(33, 23) Source(67, 8) + SourceIndex(0) +5 >Emitted(33, 35) Source(67, 23) + SourceIndex(0) +6 >Emitted(33, 37) Source(67, 8) + SourceIndex(0) +7 >Emitted(33, 73) Source(67, 23) + SourceIndex(0) +8 >Emitted(33, 79) Source(67, 40) + SourceIndex(0) +9 >Emitted(33, 80) Source(67, 41) + SourceIndex(0) +10>Emitted(33, 83) Source(67, 44) + SourceIndex(0) +11>Emitted(33, 84) Source(67, 45) + SourceIndex(0) +12>Emitted(33, 86) Source(67, 47) + SourceIndex(0) +13>Emitted(33, 87) Source(67, 48) + SourceIndex(0) +14>Emitted(33, 90) Source(67, 51) + SourceIndex(0) +15>Emitted(33, 91) Source(67, 52) + SourceIndex(0) +16>Emitted(33, 93) Source(67, 54) + SourceIndex(0) +17>Emitted(33, 94) Source(67, 55) + SourceIndex(0) +18>Emitted(33, 96) Source(67, 57) + SourceIndex(0) +19>Emitted(33, 98) Source(67, 59) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1218,7 +1119,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1237,83 +1138,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(34, 24) Source(68, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(35, 1) Source(69, 1) + SourceIndex(0) -2 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) + >} +1 >Emitted(35, 2) Source(69, 2) + SourceIndex(0) --- >>>for (_y = { name: "trimmer", skill: "trimming" }, _z = _y.name, name = _z === void 0 ? "noName" : _z, _y, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^^^^^ -11> ^ -12> ^^^ -13> ^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^ -21> ^^ -22> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^^^^^ +9 > ^ +10> ^^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^ +19> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name = "noName" } = { name: "trimmer", skill: "trimming" } -6 > -7 > name = "noName" -8 > -9 > name = "noName" -10> } = { name: "trimmer", skill: "trimming" }, -11> i -12> = -13> 0 -14> ; -15> i -16> < -17> 1 -18> ; -19> i -20> ++ -21> ) -22> { +2 >for ( +3 > { name = "noName" } = { name: "trimmer", skill: "trimming" } +4 > +5 > name = "noName" +6 > +7 > name = "noName" +8 > } = { name: "trimmer", skill: "trimming" }, +9 > i +10> = +11> 0 +12> ; +13> i +14> < +15> 1 +16> ; +17> i +18> ++ +19> ) 1->Emitted(36, 1) Source(70, 1) + SourceIndex(0) -2 >Emitted(36, 4) Source(70, 4) + SourceIndex(0) -3 >Emitted(36, 5) Source(70, 5) + SourceIndex(0) -4 >Emitted(36, 6) Source(70, 6) + SourceIndex(0) -5 >Emitted(36, 49) Source(70, 73) + SourceIndex(0) -6 >Emitted(36, 51) Source(70, 8) + SourceIndex(0) -7 >Emitted(36, 63) Source(70, 23) + SourceIndex(0) -8 >Emitted(36, 65) Source(70, 8) + SourceIndex(0) -9 >Emitted(36, 101) Source(70, 23) + SourceIndex(0) -10>Emitted(36, 107) Source(70, 75) + SourceIndex(0) -11>Emitted(36, 108) Source(70, 76) + SourceIndex(0) -12>Emitted(36, 111) Source(70, 79) + SourceIndex(0) -13>Emitted(36, 112) Source(70, 80) + SourceIndex(0) -14>Emitted(36, 114) Source(70, 82) + SourceIndex(0) -15>Emitted(36, 115) Source(70, 83) + SourceIndex(0) -16>Emitted(36, 118) Source(70, 86) + SourceIndex(0) -17>Emitted(36, 119) Source(70, 87) + SourceIndex(0) -18>Emitted(36, 121) Source(70, 89) + SourceIndex(0) -19>Emitted(36, 122) Source(70, 90) + SourceIndex(0) -20>Emitted(36, 124) Source(70, 92) + SourceIndex(0) -21>Emitted(36, 126) Source(70, 94) + SourceIndex(0) -22>Emitted(36, 127) Source(70, 95) + SourceIndex(0) +2 >Emitted(36, 6) Source(70, 6) + SourceIndex(0) +3 >Emitted(36, 49) Source(70, 73) + SourceIndex(0) +4 >Emitted(36, 51) Source(70, 8) + SourceIndex(0) +5 >Emitted(36, 63) Source(70, 23) + SourceIndex(0) +6 >Emitted(36, 65) Source(70, 8) + SourceIndex(0) +7 >Emitted(36, 101) Source(70, 23) + SourceIndex(0) +8 >Emitted(36, 107) Source(70, 75) + SourceIndex(0) +9 >Emitted(36, 108) Source(70, 76) + SourceIndex(0) +10>Emitted(36, 111) Source(70, 79) + SourceIndex(0) +11>Emitted(36, 112) Source(70, 80) + SourceIndex(0) +12>Emitted(36, 114) Source(70, 82) + SourceIndex(0) +13>Emitted(36, 115) Source(70, 83) + SourceIndex(0) +14>Emitted(36, 118) Source(70, 86) + SourceIndex(0) +15>Emitted(36, 119) Source(70, 87) + SourceIndex(0) +16>Emitted(36, 121) Source(70, 89) + SourceIndex(0) +17>Emitted(36, 122) Source(70, 90) + SourceIndex(0) +18>Emitted(36, 124) Source(70, 92) + SourceIndex(0) +19>Emitted(36, 126) Source(70, 94) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1324,7 +1213,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1343,117 +1232,105 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(37, 24) Source(71, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(38, 1) Source(72, 1) + SourceIndex(0) -2 >Emitted(38, 2) Source(72, 2) + SourceIndex(0) + >} +1 >Emitted(38, 2) Source(72, 2) + SourceIndex(0) --- >>>for (_0 = multiRobot.skills, _1 = _0 === void 0 ? { primary: "none", secondary: "none" } : _0, _2 = _1.primary, primary = _2 === void 0 ? "primary" : _2, _3 = _1.secondary, secondary = _3 === void 0 ? "secondary" : _3, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ({ - > -5 > skills: { +2 >for ({ + > +3 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -6 > -7 > skills: { +4 > +5 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -8 > -9 > primary = "primary" -10> -11> primary = "primary" -12> , +6 > +7 > primary = "primary" +8 > +9 > primary = "primary" +10> , > -13> secondary = "secondary" -14> -15> secondary = "secondary" -16> +11> secondary = "secondary" +12> +13> secondary = "secondary" +14> > } = { primary: "none", secondary: "none" } > } = -17> multiRobot -18> , -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +15> multiRobot +16> , +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(39, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(73, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(73, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(74, 5) + SourceIndex(0) -5 >Emitted(39, 28) Source(77, 47) + SourceIndex(0) -6 >Emitted(39, 30) Source(74, 5) + SourceIndex(0) -7 >Emitted(39, 94) Source(77, 47) + SourceIndex(0) -8 >Emitted(39, 96) Source(75, 9) + SourceIndex(0) -9 >Emitted(39, 111) Source(75, 28) + SourceIndex(0) -10>Emitted(39, 113) Source(75, 9) + SourceIndex(0) -11>Emitted(39, 153) Source(75, 28) + SourceIndex(0) -12>Emitted(39, 155) Source(76, 9) + SourceIndex(0) -13>Emitted(39, 172) Source(76, 32) + SourceIndex(0) -14>Emitted(39, 174) Source(76, 9) + SourceIndex(0) -15>Emitted(39, 218) Source(76, 32) + SourceIndex(0) -16>Emitted(39, 220) Source(78, 5) + SourceIndex(0) -17>Emitted(39, 230) Source(78, 15) + SourceIndex(0) -18>Emitted(39, 232) Source(78, 17) + SourceIndex(0) -19>Emitted(39, 233) Source(78, 18) + SourceIndex(0) -20>Emitted(39, 236) Source(78, 21) + SourceIndex(0) -21>Emitted(39, 237) Source(78, 22) + SourceIndex(0) -22>Emitted(39, 239) Source(78, 24) + SourceIndex(0) -23>Emitted(39, 240) Source(78, 25) + SourceIndex(0) -24>Emitted(39, 243) Source(78, 28) + SourceIndex(0) -25>Emitted(39, 244) Source(78, 29) + SourceIndex(0) -26>Emitted(39, 246) Source(78, 31) + SourceIndex(0) -27>Emitted(39, 247) Source(78, 32) + SourceIndex(0) -28>Emitted(39, 249) Source(78, 34) + SourceIndex(0) -29>Emitted(39, 251) Source(78, 36) + SourceIndex(0) -30>Emitted(39, 252) Source(78, 37) + SourceIndex(0) +2 >Emitted(39, 6) Source(74, 5) + SourceIndex(0) +3 >Emitted(39, 28) Source(77, 47) + SourceIndex(0) +4 >Emitted(39, 30) Source(74, 5) + SourceIndex(0) +5 >Emitted(39, 94) Source(77, 47) + SourceIndex(0) +6 >Emitted(39, 96) Source(75, 9) + SourceIndex(0) +7 >Emitted(39, 111) Source(75, 28) + SourceIndex(0) +8 >Emitted(39, 113) Source(75, 9) + SourceIndex(0) +9 >Emitted(39, 153) Source(75, 28) + SourceIndex(0) +10>Emitted(39, 155) Source(76, 9) + SourceIndex(0) +11>Emitted(39, 172) Source(76, 32) + SourceIndex(0) +12>Emitted(39, 174) Source(76, 9) + SourceIndex(0) +13>Emitted(39, 218) Source(76, 32) + SourceIndex(0) +14>Emitted(39, 220) Source(78, 5) + SourceIndex(0) +15>Emitted(39, 230) Source(78, 15) + SourceIndex(0) +16>Emitted(39, 232) Source(78, 17) + SourceIndex(0) +17>Emitted(39, 233) Source(78, 18) + SourceIndex(0) +18>Emitted(39, 236) Source(78, 21) + SourceIndex(0) +19>Emitted(39, 237) Source(78, 22) + SourceIndex(0) +20>Emitted(39, 239) Source(78, 24) + SourceIndex(0) +21>Emitted(39, 240) Source(78, 25) + SourceIndex(0) +22>Emitted(39, 243) Source(78, 28) + SourceIndex(0) +23>Emitted(39, 244) Source(78, 29) + SourceIndex(0) +24>Emitted(39, 246) Source(78, 31) + SourceIndex(0) +25>Emitted(39, 247) Source(78, 32) + SourceIndex(0) +26>Emitted(39, 249) Source(78, 34) + SourceIndex(0) +27>Emitted(39, 251) Source(78, 36) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1464,7 +1341,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1483,121 +1360,109 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(40, 27) Source(79, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(41, 1) Source(80, 1) + SourceIndex(0) -2 >Emitted(41, 2) Source(80, 2) + SourceIndex(0) + >} +1 >Emitted(41, 2) Source(80, 2) + SourceIndex(0) --- >>>for (_4 = getMultiRobot(), _5 = _4.skills, _6 = _5 === void 0 ? { primary: "none", secondary: "none" } : _5, _7 = _6.primary, primary = _7 === void 0 ? "primary" : _7, _8 = _6.secondary, secondary = _8 === void 0 ? "secondary" : _8, _4, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^^^^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^ -29> ^^ -30> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^^^^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^ +27> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } > } = getMultiRobot() -6 > -7 > skills: { +4 > +5 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -8 > -9 > skills: { +6 > +7 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -10> -11> primary = "primary" -12> -13> primary = "primary" -14> , +8 > +9 > primary = "primary" +10> +11> primary = "primary" +12> , > -15> secondary = "secondary" -16> -17> secondary = "secondary" -18> +13> secondary = "secondary" +14> +15> secondary = "secondary" +16> > } = { primary: "none", secondary: "none" } > } = getMultiRobot(), -19> i -20> = -21> 0 -22> ; -23> i -24> < -25> 1 -26> ; -27> i -28> ++ -29> ) -30> { +17> i +18> = +19> 0 +20> ; +21> i +22> < +23> 1 +24> ; +25> i +26> ++ +27> ) 1->Emitted(42, 1) Source(81, 1) + SourceIndex(0) -2 >Emitted(42, 4) Source(81, 4) + SourceIndex(0) -3 >Emitted(42, 5) Source(81, 5) + SourceIndex(0) -4 >Emitted(42, 6) Source(81, 6) + SourceIndex(0) -5 >Emitted(42, 26) Source(86, 20) + SourceIndex(0) -6 >Emitted(42, 28) Source(82, 5) + SourceIndex(0) -7 >Emitted(42, 42) Source(85, 47) + SourceIndex(0) -8 >Emitted(42, 44) Source(82, 5) + SourceIndex(0) -9 >Emitted(42, 108) Source(85, 47) + SourceIndex(0) -10>Emitted(42, 110) Source(83, 9) + SourceIndex(0) -11>Emitted(42, 125) Source(83, 28) + SourceIndex(0) -12>Emitted(42, 127) Source(83, 9) + SourceIndex(0) -13>Emitted(42, 167) Source(83, 28) + SourceIndex(0) -14>Emitted(42, 169) Source(84, 9) + SourceIndex(0) -15>Emitted(42, 186) Source(84, 32) + SourceIndex(0) -16>Emitted(42, 188) Source(84, 9) + SourceIndex(0) -17>Emitted(42, 232) Source(84, 32) + SourceIndex(0) -18>Emitted(42, 238) Source(86, 22) + SourceIndex(0) -19>Emitted(42, 239) Source(86, 23) + SourceIndex(0) -20>Emitted(42, 242) Source(86, 26) + SourceIndex(0) -21>Emitted(42, 243) Source(86, 27) + SourceIndex(0) -22>Emitted(42, 245) Source(86, 29) + SourceIndex(0) -23>Emitted(42, 246) Source(86, 30) + SourceIndex(0) -24>Emitted(42, 249) Source(86, 33) + SourceIndex(0) -25>Emitted(42, 250) Source(86, 34) + SourceIndex(0) -26>Emitted(42, 252) Source(86, 36) + SourceIndex(0) -27>Emitted(42, 253) Source(86, 37) + SourceIndex(0) -28>Emitted(42, 255) Source(86, 39) + SourceIndex(0) -29>Emitted(42, 257) Source(86, 41) + SourceIndex(0) -30>Emitted(42, 258) Source(86, 42) + SourceIndex(0) +2 >Emitted(42, 6) Source(81, 6) + SourceIndex(0) +3 >Emitted(42, 26) Source(86, 20) + SourceIndex(0) +4 >Emitted(42, 28) Source(82, 5) + SourceIndex(0) +5 >Emitted(42, 42) Source(85, 47) + SourceIndex(0) +6 >Emitted(42, 44) Source(82, 5) + SourceIndex(0) +7 >Emitted(42, 108) Source(85, 47) + SourceIndex(0) +8 >Emitted(42, 110) Source(83, 9) + SourceIndex(0) +9 >Emitted(42, 125) Source(83, 28) + SourceIndex(0) +10>Emitted(42, 127) Source(83, 9) + SourceIndex(0) +11>Emitted(42, 167) Source(83, 28) + SourceIndex(0) +12>Emitted(42, 169) Source(84, 9) + SourceIndex(0) +13>Emitted(42, 186) Source(84, 32) + SourceIndex(0) +14>Emitted(42, 188) Source(84, 9) + SourceIndex(0) +15>Emitted(42, 232) Source(84, 32) + SourceIndex(0) +16>Emitted(42, 238) Source(86, 22) + SourceIndex(0) +17>Emitted(42, 239) Source(86, 23) + SourceIndex(0) +18>Emitted(42, 242) Source(86, 26) + SourceIndex(0) +19>Emitted(42, 243) Source(86, 27) + SourceIndex(0) +20>Emitted(42, 245) Source(86, 29) + SourceIndex(0) +21>Emitted(42, 246) Source(86, 30) + SourceIndex(0) +22>Emitted(42, 249) Source(86, 33) + SourceIndex(0) +23>Emitted(42, 250) Source(86, 34) + SourceIndex(0) +24>Emitted(42, 252) Source(86, 36) + SourceIndex(0) +25>Emitted(42, 253) Source(86, 37) + SourceIndex(0) +26>Emitted(42, 255) Source(86, 39) + SourceIndex(0) +27>Emitted(42, 257) Source(86, 41) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -1608,7 +1473,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1627,80 +1492,71 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(43, 27) Source(87, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(44, 1) Source(88, 1) + SourceIndex(0) -2 >Emitted(44, 2) Source(88, 2) + SourceIndex(0) + >} +1 >Emitted(44, 2) Source(88, 2) + SourceIndex(0) --- >>>for (_9 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _10 = _9.skills, _11 = _10 === void 0 ? { primary: "none", secondary: "none" } : _10, _12 = _11.primary, primary = _12 === void 0 ? "primary" : _12, _13 = _11.secondary, secondary = _13 === void 0 ? "secondary" : _13, _9, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > skills: { +4 > +5 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -8 > -9 > skills: { +6 > +7 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -10> -11> primary = "primary" -12> -13> primary = "primary" -14> , +8 > +9 > primary = "primary" +10> +11> primary = "primary" +12> , > -15> secondary = "secondary" -16> -17> secondary = "secondary" +13> secondary = "secondary" +14> +15> secondary = "secondary" 1->Emitted(45, 1) Source(89, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(89, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(89, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(89, 6) + SourceIndex(0) -5 >Emitted(45, 84) Source(94, 90) + SourceIndex(0) -6 >Emitted(45, 86) Source(90, 5) + SourceIndex(0) -7 >Emitted(45, 101) Source(93, 47) + SourceIndex(0) -8 >Emitted(45, 103) Source(90, 5) + SourceIndex(0) -9 >Emitted(45, 170) Source(93, 47) + SourceIndex(0) -10>Emitted(45, 172) Source(91, 9) + SourceIndex(0) -11>Emitted(45, 189) Source(91, 28) + SourceIndex(0) -12>Emitted(45, 191) Source(91, 9) + SourceIndex(0) -13>Emitted(45, 233) Source(91, 28) + SourceIndex(0) -14>Emitted(45, 235) Source(92, 9) + SourceIndex(0) -15>Emitted(45, 254) Source(92, 32) + SourceIndex(0) -16>Emitted(45, 256) Source(92, 9) + SourceIndex(0) -17>Emitted(45, 302) Source(92, 32) + SourceIndex(0) +2 >Emitted(45, 6) Source(89, 6) + SourceIndex(0) +3 >Emitted(45, 84) Source(94, 90) + SourceIndex(0) +4 >Emitted(45, 86) Source(90, 5) + SourceIndex(0) +5 >Emitted(45, 101) Source(93, 47) + SourceIndex(0) +6 >Emitted(45, 103) Source(90, 5) + SourceIndex(0) +7 >Emitted(45, 170) Source(93, 47) + SourceIndex(0) +8 >Emitted(45, 172) Source(91, 9) + SourceIndex(0) +9 >Emitted(45, 189) Source(91, 28) + SourceIndex(0) +10>Emitted(45, 191) Source(91, 9) + SourceIndex(0) +11>Emitted(45, 233) Source(91, 28) + SourceIndex(0) +12>Emitted(45, 235) Source(92, 9) + SourceIndex(0) +13>Emitted(45, 254) Source(92, 32) + SourceIndex(0) +14>Emitted(45, 256) Source(92, 9) + SourceIndex(0) +15>Emitted(45, 302) Source(92, 32) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -1715,8 +1571,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > > } = { primary: "none", secondary: "none" } >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, @@ -1732,7 +1587,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> i 11> ++ 12> ) -13> { 1 >Emitted(46, 5) Source(95, 5) + SourceIndex(0) 2 >Emitted(46, 6) Source(95, 6) + SourceIndex(0) 3 >Emitted(46, 9) Source(95, 9) + SourceIndex(0) @@ -1745,7 +1599,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10>Emitted(46, 20) Source(95, 20) + SourceIndex(0) 11>Emitted(46, 22) Source(95, 22) + SourceIndex(0) 12>Emitted(46, 24) Source(95, 24) + SourceIndex(0) -13>Emitted(46, 25) Source(95, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -1756,7 +1609,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -1775,97 +1628,85 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(47, 27) Source(96, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(48, 1) Source(97, 1) + SourceIndex(0) -2 >Emitted(48, 2) Source(97, 2) + SourceIndex(0) + >} +1 >Emitted(48, 2) Source(97, 2) + SourceIndex(0) --- >>>for (_14 = robot.name, nameA = _14 === void 0 ? "noName" : _14, _15 = robot.skill, skillA = _15 === void 0 ? "skill" : _15, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > > > -2 >for -3 > -4 > ({ -5 > name: nameA = "noName" -6 > -7 > name: nameA = "noName" -8 > , -9 > skill: skillA = "skill" -10> -11> skill: skillA = "skill" -12> } = -13> robot -14> , -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ({ +3 > name: nameA = "noName" +4 > +5 > name: nameA = "noName" +6 > , +7 > skill: skillA = "skill" +8 > +9 > skill: skillA = "skill" +10> } = +11> robot +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(49, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(100, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(100, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(100, 7) + SourceIndex(0) -5 >Emitted(49, 22) Source(100, 29) + SourceIndex(0) -6 >Emitted(49, 24) Source(100, 7) + SourceIndex(0) -7 >Emitted(49, 63) Source(100, 29) + SourceIndex(0) -8 >Emitted(49, 65) Source(100, 31) + SourceIndex(0) -9 >Emitted(49, 82) Source(100, 54) + SourceIndex(0) -10>Emitted(49, 84) Source(100, 31) + SourceIndex(0) -11>Emitted(49, 123) Source(100, 54) + SourceIndex(0) -12>Emitted(49, 125) Source(100, 59) + SourceIndex(0) -13>Emitted(49, 130) Source(100, 64) + SourceIndex(0) -14>Emitted(49, 132) Source(100, 66) + SourceIndex(0) -15>Emitted(49, 133) Source(100, 67) + SourceIndex(0) -16>Emitted(49, 136) Source(100, 70) + SourceIndex(0) -17>Emitted(49, 137) Source(100, 71) + SourceIndex(0) -18>Emitted(49, 139) Source(100, 73) + SourceIndex(0) -19>Emitted(49, 140) Source(100, 74) + SourceIndex(0) -20>Emitted(49, 143) Source(100, 77) + SourceIndex(0) -21>Emitted(49, 144) Source(100, 78) + SourceIndex(0) -22>Emitted(49, 146) Source(100, 80) + SourceIndex(0) -23>Emitted(49, 147) Source(100, 81) + SourceIndex(0) -24>Emitted(49, 149) Source(100, 83) + SourceIndex(0) -25>Emitted(49, 151) Source(100, 85) + SourceIndex(0) -26>Emitted(49, 152) Source(100, 86) + SourceIndex(0) +2 >Emitted(49, 6) Source(100, 7) + SourceIndex(0) +3 >Emitted(49, 22) Source(100, 29) + SourceIndex(0) +4 >Emitted(49, 24) Source(100, 7) + SourceIndex(0) +5 >Emitted(49, 63) Source(100, 29) + SourceIndex(0) +6 >Emitted(49, 65) Source(100, 31) + SourceIndex(0) +7 >Emitted(49, 82) Source(100, 54) + SourceIndex(0) +8 >Emitted(49, 84) Source(100, 31) + SourceIndex(0) +9 >Emitted(49, 123) Source(100, 54) + SourceIndex(0) +10>Emitted(49, 125) Source(100, 59) + SourceIndex(0) +11>Emitted(49, 130) Source(100, 64) + SourceIndex(0) +12>Emitted(49, 132) Source(100, 66) + SourceIndex(0) +13>Emitted(49, 133) Source(100, 67) + SourceIndex(0) +14>Emitted(49, 136) Source(100, 70) + SourceIndex(0) +15>Emitted(49, 137) Source(100, 71) + SourceIndex(0) +16>Emitted(49, 139) Source(100, 73) + SourceIndex(0) +17>Emitted(49, 140) Source(100, 74) + SourceIndex(0) +18>Emitted(49, 143) Source(100, 77) + SourceIndex(0) +19>Emitted(49, 144) Source(100, 78) + SourceIndex(0) +20>Emitted(49, 146) Source(100, 80) + SourceIndex(0) +21>Emitted(49, 147) Source(100, 81) + SourceIndex(0) +22>Emitted(49, 149) Source(100, 83) + SourceIndex(0) +23>Emitted(49, 151) Source(100, 85) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1876,7 +1717,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -1895,95 +1736,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(50, 24) Source(101, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(51, 1) Source(102, 1) + SourceIndex(0) -2 >Emitted(51, 2) Source(102, 2) + SourceIndex(0) + >} +1 >Emitted(51, 2) Source(102, 2) + SourceIndex(0) --- >>>for (_16 = getRobot(), _17 = _16.name, nameA = _17 === void 0 ? "noName" : _17, _18 = _16.skill, skillA = _18 === void 0 ? "skill" : _18, _16, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > {name: nameA = "noName", skill: skillA = "skill" } = getRobot() -6 > -7 > name: nameA = "noName" -8 > -9 > name: nameA = "noName" -10> , -11> skill: skillA = "skill" -12> -13> skill: skillA = "skill" -14> } = getRobot(), -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > {name: nameA = "noName", skill: skillA = "skill" } = getRobot() +4 > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , +9 > skill: skillA = "skill" +10> +11> skill: skillA = "skill" +12> } = getRobot(), +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(52, 1) Source(103, 1) + SourceIndex(0) -2 >Emitted(52, 4) Source(103, 4) + SourceIndex(0) -3 >Emitted(52, 5) Source(103, 5) + SourceIndex(0) -4 >Emitted(52, 6) Source(103, 6) + SourceIndex(0) -5 >Emitted(52, 22) Source(103, 69) + SourceIndex(0) -6 >Emitted(52, 24) Source(103, 7) + SourceIndex(0) -7 >Emitted(52, 38) Source(103, 29) + SourceIndex(0) -8 >Emitted(52, 40) Source(103, 7) + SourceIndex(0) -9 >Emitted(52, 79) Source(103, 29) + SourceIndex(0) -10>Emitted(52, 81) Source(103, 31) + SourceIndex(0) -11>Emitted(52, 96) Source(103, 54) + SourceIndex(0) -12>Emitted(52, 98) Source(103, 31) + SourceIndex(0) -13>Emitted(52, 137) Source(103, 54) + SourceIndex(0) -14>Emitted(52, 144) Source(103, 71) + SourceIndex(0) -15>Emitted(52, 145) Source(103, 72) + SourceIndex(0) -16>Emitted(52, 148) Source(103, 75) + SourceIndex(0) -17>Emitted(52, 149) Source(103, 76) + SourceIndex(0) -18>Emitted(52, 151) Source(103, 78) + SourceIndex(0) -19>Emitted(52, 152) Source(103, 79) + SourceIndex(0) -20>Emitted(52, 155) Source(103, 82) + SourceIndex(0) -21>Emitted(52, 156) Source(103, 83) + SourceIndex(0) -22>Emitted(52, 158) Source(103, 85) + SourceIndex(0) -23>Emitted(52, 159) Source(103, 86) + SourceIndex(0) -24>Emitted(52, 161) Source(103, 88) + SourceIndex(0) -25>Emitted(52, 163) Source(103, 90) + SourceIndex(0) -26>Emitted(52, 164) Source(103, 91) + SourceIndex(0) +2 >Emitted(52, 6) Source(103, 6) + SourceIndex(0) +3 >Emitted(52, 22) Source(103, 69) + SourceIndex(0) +4 >Emitted(52, 24) Source(103, 7) + SourceIndex(0) +5 >Emitted(52, 38) Source(103, 29) + SourceIndex(0) +6 >Emitted(52, 40) Source(103, 7) + SourceIndex(0) +7 >Emitted(52, 79) Source(103, 29) + SourceIndex(0) +8 >Emitted(52, 81) Source(103, 31) + SourceIndex(0) +9 >Emitted(52, 96) Source(103, 54) + SourceIndex(0) +10>Emitted(52, 98) Source(103, 31) + SourceIndex(0) +11>Emitted(52, 137) Source(103, 54) + SourceIndex(0) +12>Emitted(52, 144) Source(103, 71) + SourceIndex(0) +13>Emitted(52, 145) Source(103, 72) + SourceIndex(0) +14>Emitted(52, 148) Source(103, 75) + SourceIndex(0) +15>Emitted(52, 149) Source(103, 76) + SourceIndex(0) +16>Emitted(52, 151) Source(103, 78) + SourceIndex(0) +17>Emitted(52, 152) Source(103, 79) + SourceIndex(0) +18>Emitted(52, 155) Source(103, 82) + SourceIndex(0) +19>Emitted(52, 156) Source(103, 83) + SourceIndex(0) +20>Emitted(52, 158) Source(103, 85) + SourceIndex(0) +21>Emitted(52, 159) Source(103, 86) + SourceIndex(0) +22>Emitted(52, 161) Source(103, 88) + SourceIndex(0) +23>Emitted(52, 163) Source(103, 90) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -1994,7 +1823,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2013,95 +1842,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(53, 24) Source(104, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(54, 1) Source(105, 1) + SourceIndex(0) -2 >Emitted(54, 2) Source(105, 2) + SourceIndex(0) + >} +1 >Emitted(54, 2) Source(105, 2) + SourceIndex(0) --- >>>for (_19 = { name: "trimmer", skill: "trimming" }, _20 = _19.name, nameA = _20 === void 0 ? "noName" : _20, _21 = _19.skill, skillA = _21 === void 0 ? "skill" : _21, _19, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } -6 > -7 > name: nameA = "noName" -8 > -9 > name: nameA = "noName" -10> , -11> skill: skillA = "skill" -12> -13> skill: skillA = "skill" -14> } = { name: "trimmer", skill: "trimming" }, -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > {name: nameA = "noName", skill: skillA = "skill" } = { name: "trimmer", skill: "trimming" } +4 > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , +9 > skill: skillA = "skill" +10> +11> skill: skillA = "skill" +12> } = { name: "trimmer", skill: "trimming" }, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(55, 1) Source(106, 1) + SourceIndex(0) -2 >Emitted(55, 4) Source(106, 4) + SourceIndex(0) -3 >Emitted(55, 5) Source(106, 5) + SourceIndex(0) -4 >Emitted(55, 6) Source(106, 6) + SourceIndex(0) -5 >Emitted(55, 50) Source(106, 104) + SourceIndex(0) -6 >Emitted(55, 52) Source(106, 7) + SourceIndex(0) -7 >Emitted(55, 66) Source(106, 29) + SourceIndex(0) -8 >Emitted(55, 68) Source(106, 7) + SourceIndex(0) -9 >Emitted(55, 107) Source(106, 29) + SourceIndex(0) -10>Emitted(55, 109) Source(106, 31) + SourceIndex(0) -11>Emitted(55, 124) Source(106, 54) + SourceIndex(0) -12>Emitted(55, 126) Source(106, 31) + SourceIndex(0) -13>Emitted(55, 165) Source(106, 54) + SourceIndex(0) -14>Emitted(55, 172) Source(106, 106) + SourceIndex(0) -15>Emitted(55, 173) Source(106, 107) + SourceIndex(0) -16>Emitted(55, 176) Source(106, 110) + SourceIndex(0) -17>Emitted(55, 177) Source(106, 111) + SourceIndex(0) -18>Emitted(55, 179) Source(106, 113) + SourceIndex(0) -19>Emitted(55, 180) Source(106, 114) + SourceIndex(0) -20>Emitted(55, 183) Source(106, 117) + SourceIndex(0) -21>Emitted(55, 184) Source(106, 118) + SourceIndex(0) -22>Emitted(55, 186) Source(106, 120) + SourceIndex(0) -23>Emitted(55, 187) Source(106, 121) + SourceIndex(0) -24>Emitted(55, 189) Source(106, 123) + SourceIndex(0) -25>Emitted(55, 191) Source(106, 125) + SourceIndex(0) -26>Emitted(55, 192) Source(106, 126) + SourceIndex(0) +2 >Emitted(55, 6) Source(106, 6) + SourceIndex(0) +3 >Emitted(55, 50) Source(106, 104) + SourceIndex(0) +4 >Emitted(55, 52) Source(106, 7) + SourceIndex(0) +5 >Emitted(55, 66) Source(106, 29) + SourceIndex(0) +6 >Emitted(55, 68) Source(106, 7) + SourceIndex(0) +7 >Emitted(55, 107) Source(106, 29) + SourceIndex(0) +8 >Emitted(55, 109) Source(106, 31) + SourceIndex(0) +9 >Emitted(55, 124) Source(106, 54) + SourceIndex(0) +10>Emitted(55, 126) Source(106, 31) + SourceIndex(0) +11>Emitted(55, 165) Source(106, 54) + SourceIndex(0) +12>Emitted(55, 172) Source(106, 106) + SourceIndex(0) +13>Emitted(55, 173) Source(106, 107) + SourceIndex(0) +14>Emitted(55, 176) Source(106, 110) + SourceIndex(0) +15>Emitted(55, 177) Source(106, 111) + SourceIndex(0) +16>Emitted(55, 179) Source(106, 113) + SourceIndex(0) +17>Emitted(55, 180) Source(106, 114) + SourceIndex(0) +18>Emitted(55, 183) Source(106, 117) + SourceIndex(0) +19>Emitted(55, 184) Source(106, 118) + SourceIndex(0) +20>Emitted(55, 186) Source(106, 120) + SourceIndex(0) +21>Emitted(55, 187) Source(106, 121) + SourceIndex(0) +22>Emitted(55, 189) Source(106, 123) + SourceIndex(0) +23>Emitted(55, 191) Source(106, 125) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -2112,7 +1929,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2131,130 +1948,118 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(56, 24) Source(107, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(57, 1) Source(108, 1) + SourceIndex(0) -2 >Emitted(57, 2) Source(108, 2) + SourceIndex(0) + >} +1 >Emitted(57, 2) Source(108, 2) + SourceIndex(0) --- >>>for (_22 = multiRobot.name, nameA = _22 === void 0 ? "noName" : _22, _23 = multiRobot.skills, _24 = _23 === void 0 ? { primary: "none", secondary: "none" } : _23, _25 = _24.primary, primaryA = _25 === void 0 ? "primary" : _25, _26 = _24.secondary, secondaryA = _26 === void 0 ? "secondary" : _26, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^^ -29> ^ -30> ^^ -31> ^ -32> ^^ -33> ^^ -34> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ 1-> > -2 >for -3 > -4 > ({ - > -5 > name: nameA = "noName" -6 > -7 > name: nameA = "noName" -8 > , +2 >for ({ + > +3 > name: nameA = "noName" +4 > +5 > name: nameA = "noName" +6 > , > -9 > skills: { +7 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -10> -11> skills: { +8 > +9 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -12> -13> primary: primaryA = "primary" -14> -15> primary: primaryA = "primary" -16> , +10> +11> primary: primaryA = "primary" +12> +13> primary: primaryA = "primary" +14> , > -17> secondary: secondaryA = "secondary" -18> -19> secondary: secondaryA = "secondary" -20> +15> secondary: secondaryA = "secondary" +16> +17> secondary: secondaryA = "secondary" +18> > } = { primary: "none", secondary: "none" } > } = -21> multiRobot -22> , -23> i -24> = -25> 0 -26> ; -27> i -28> < -29> 1 -30> ; -31> i -32> ++ -33> ) -34> { +19> multiRobot +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) 1->Emitted(58, 1) Source(109, 1) + SourceIndex(0) -2 >Emitted(58, 4) Source(109, 4) + SourceIndex(0) -3 >Emitted(58, 5) Source(109, 5) + SourceIndex(0) -4 >Emitted(58, 6) Source(110, 5) + SourceIndex(0) -5 >Emitted(58, 27) Source(110, 27) + SourceIndex(0) -6 >Emitted(58, 29) Source(110, 5) + SourceIndex(0) -7 >Emitted(58, 68) Source(110, 27) + SourceIndex(0) -8 >Emitted(58, 70) Source(111, 5) + SourceIndex(0) -9 >Emitted(58, 93) Source(114, 47) + SourceIndex(0) -10>Emitted(58, 95) Source(111, 5) + SourceIndex(0) -11>Emitted(58, 162) Source(114, 47) + SourceIndex(0) -12>Emitted(58, 164) Source(112, 9) + SourceIndex(0) -13>Emitted(58, 181) Source(112, 38) + SourceIndex(0) -14>Emitted(58, 183) Source(112, 9) + SourceIndex(0) -15>Emitted(58, 226) Source(112, 38) + SourceIndex(0) -16>Emitted(58, 228) Source(113, 9) + SourceIndex(0) -17>Emitted(58, 247) Source(113, 44) + SourceIndex(0) -18>Emitted(58, 249) Source(113, 9) + SourceIndex(0) -19>Emitted(58, 296) Source(113, 44) + SourceIndex(0) -20>Emitted(58, 298) Source(115, 5) + SourceIndex(0) -21>Emitted(58, 308) Source(115, 15) + SourceIndex(0) -22>Emitted(58, 310) Source(115, 17) + SourceIndex(0) -23>Emitted(58, 311) Source(115, 18) + SourceIndex(0) -24>Emitted(58, 314) Source(115, 21) + SourceIndex(0) -25>Emitted(58, 315) Source(115, 22) + SourceIndex(0) -26>Emitted(58, 317) Source(115, 24) + SourceIndex(0) -27>Emitted(58, 318) Source(115, 25) + SourceIndex(0) -28>Emitted(58, 321) Source(115, 28) + SourceIndex(0) -29>Emitted(58, 322) Source(115, 29) + SourceIndex(0) -30>Emitted(58, 324) Source(115, 31) + SourceIndex(0) -31>Emitted(58, 325) Source(115, 32) + SourceIndex(0) -32>Emitted(58, 327) Source(115, 34) + SourceIndex(0) -33>Emitted(58, 329) Source(115, 36) + SourceIndex(0) -34>Emitted(58, 330) Source(115, 37) + SourceIndex(0) +2 >Emitted(58, 6) Source(110, 5) + SourceIndex(0) +3 >Emitted(58, 27) Source(110, 27) + SourceIndex(0) +4 >Emitted(58, 29) Source(110, 5) + SourceIndex(0) +5 >Emitted(58, 68) Source(110, 27) + SourceIndex(0) +6 >Emitted(58, 70) Source(111, 5) + SourceIndex(0) +7 >Emitted(58, 93) Source(114, 47) + SourceIndex(0) +8 >Emitted(58, 95) Source(111, 5) + SourceIndex(0) +9 >Emitted(58, 162) Source(114, 47) + SourceIndex(0) +10>Emitted(58, 164) Source(112, 9) + SourceIndex(0) +11>Emitted(58, 181) Source(112, 38) + SourceIndex(0) +12>Emitted(58, 183) Source(112, 9) + SourceIndex(0) +13>Emitted(58, 226) Source(112, 38) + SourceIndex(0) +14>Emitted(58, 228) Source(113, 9) + SourceIndex(0) +15>Emitted(58, 247) Source(113, 44) + SourceIndex(0) +16>Emitted(58, 249) Source(113, 9) + SourceIndex(0) +17>Emitted(58, 296) Source(113, 44) + SourceIndex(0) +18>Emitted(58, 298) Source(115, 5) + SourceIndex(0) +19>Emitted(58, 308) Source(115, 15) + SourceIndex(0) +20>Emitted(58, 310) Source(115, 17) + SourceIndex(0) +21>Emitted(58, 311) Source(115, 18) + SourceIndex(0) +22>Emitted(58, 314) Source(115, 21) + SourceIndex(0) +23>Emitted(58, 315) Source(115, 22) + SourceIndex(0) +24>Emitted(58, 317) Source(115, 24) + SourceIndex(0) +25>Emitted(58, 318) Source(115, 25) + SourceIndex(0) +26>Emitted(58, 321) Source(115, 28) + SourceIndex(0) +27>Emitted(58, 322) Source(115, 29) + SourceIndex(0) +28>Emitted(58, 324) Source(115, 31) + SourceIndex(0) +29>Emitted(58, 325) Source(115, 32) + SourceIndex(0) +30>Emitted(58, 327) Source(115, 34) + SourceIndex(0) +31>Emitted(58, 329) Source(115, 36) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -2265,7 +2070,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2284,135 +2089,123 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(59, 27) Source(116, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(60, 1) Source(117, 1) + SourceIndex(0) -2 >Emitted(60, 2) Source(117, 2) + SourceIndex(0) + >} +1 >Emitted(60, 2) Source(117, 2) + SourceIndex(0) --- >>>for (_27 = getMultiRobot(), _28 = _27.name, nameA = _28 === void 0 ? "noName" : _28, _29 = _27.skills, _30 = _29 === void 0 ? { primary: "none", secondary: "none" } : _29, _31 = _30.primary, primaryA = _31 === void 0 ? "primary" : _31, _32 = _30.secondary, secondaryA = _32 === void 0 ? "secondary" : _32, _27, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -22> ^^^^^^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^^ -29> ^ -30> ^^ -31> ^ -32> ^^ -33> ^^ -34> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^^^^^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > name: nameA = "noName", > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } > } = getMultiRobot() -6 > -7 > name: nameA = "noName" -8 > -9 > name: nameA = "noName" -10> , +4 > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , > -11> skills: { +9 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -12> -13> skills: { +10> +11> skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -14> -15> primary: primaryA = "primary" -16> -17> primary: primaryA = "primary" -18> , +12> +13> primary: primaryA = "primary" +14> +15> primary: primaryA = "primary" +16> , > -19> secondary: secondaryA = "secondary" -20> -21> secondary: secondaryA = "secondary" -22> +17> secondary: secondaryA = "secondary" +18> +19> secondary: secondaryA = "secondary" +20> > } = { primary: "none", secondary: "none" } > } = getMultiRobot(), -23> i -24> = -25> 0 -26> ; -27> i -28> < -29> 1 -30> ; -31> i -32> ++ -33> ) -34> { +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) 1->Emitted(61, 1) Source(118, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(118, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(118, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(118, 6) + SourceIndex(0) -5 >Emitted(61, 27) Source(124, 20) + SourceIndex(0) -6 >Emitted(61, 29) Source(119, 5) + SourceIndex(0) -7 >Emitted(61, 43) Source(119, 27) + SourceIndex(0) -8 >Emitted(61, 45) Source(119, 5) + SourceIndex(0) -9 >Emitted(61, 84) Source(119, 27) + SourceIndex(0) -10>Emitted(61, 86) Source(120, 5) + SourceIndex(0) -11>Emitted(61, 102) Source(123, 47) + SourceIndex(0) -12>Emitted(61, 104) Source(120, 5) + SourceIndex(0) -13>Emitted(61, 171) Source(123, 47) + SourceIndex(0) -14>Emitted(61, 173) Source(121, 9) + SourceIndex(0) -15>Emitted(61, 190) Source(121, 38) + SourceIndex(0) -16>Emitted(61, 192) Source(121, 9) + SourceIndex(0) -17>Emitted(61, 235) Source(121, 38) + SourceIndex(0) -18>Emitted(61, 237) Source(122, 9) + SourceIndex(0) -19>Emitted(61, 256) Source(122, 44) + SourceIndex(0) -20>Emitted(61, 258) Source(122, 9) + SourceIndex(0) -21>Emitted(61, 305) Source(122, 44) + SourceIndex(0) -22>Emitted(61, 312) Source(124, 22) + SourceIndex(0) -23>Emitted(61, 313) Source(124, 23) + SourceIndex(0) -24>Emitted(61, 316) Source(124, 26) + SourceIndex(0) -25>Emitted(61, 317) Source(124, 27) + SourceIndex(0) -26>Emitted(61, 319) Source(124, 29) + SourceIndex(0) -27>Emitted(61, 320) Source(124, 30) + SourceIndex(0) -28>Emitted(61, 323) Source(124, 33) + SourceIndex(0) -29>Emitted(61, 324) Source(124, 34) + SourceIndex(0) -30>Emitted(61, 326) Source(124, 36) + SourceIndex(0) -31>Emitted(61, 327) Source(124, 37) + SourceIndex(0) -32>Emitted(61, 329) Source(124, 39) + SourceIndex(0) -33>Emitted(61, 331) Source(124, 41) + SourceIndex(0) -34>Emitted(61, 332) Source(124, 42) + SourceIndex(0) +2 >Emitted(61, 6) Source(118, 6) + SourceIndex(0) +3 >Emitted(61, 27) Source(124, 20) + SourceIndex(0) +4 >Emitted(61, 29) Source(119, 5) + SourceIndex(0) +5 >Emitted(61, 43) Source(119, 27) + SourceIndex(0) +6 >Emitted(61, 45) Source(119, 5) + SourceIndex(0) +7 >Emitted(61, 84) Source(119, 27) + SourceIndex(0) +8 >Emitted(61, 86) Source(120, 5) + SourceIndex(0) +9 >Emitted(61, 102) Source(123, 47) + SourceIndex(0) +10>Emitted(61, 104) Source(120, 5) + SourceIndex(0) +11>Emitted(61, 171) Source(123, 47) + SourceIndex(0) +12>Emitted(61, 173) Source(121, 9) + SourceIndex(0) +13>Emitted(61, 190) Source(121, 38) + SourceIndex(0) +14>Emitted(61, 192) Source(121, 9) + SourceIndex(0) +15>Emitted(61, 235) Source(121, 38) + SourceIndex(0) +16>Emitted(61, 237) Source(122, 9) + SourceIndex(0) +17>Emitted(61, 256) Source(122, 44) + SourceIndex(0) +18>Emitted(61, 258) Source(122, 9) + SourceIndex(0) +19>Emitted(61, 305) Source(122, 44) + SourceIndex(0) +20>Emitted(61, 312) Source(124, 22) + SourceIndex(0) +21>Emitted(61, 313) Source(124, 23) + SourceIndex(0) +22>Emitted(61, 316) Source(124, 26) + SourceIndex(0) +23>Emitted(61, 317) Source(124, 27) + SourceIndex(0) +24>Emitted(61, 319) Source(124, 29) + SourceIndex(0) +25>Emitted(61, 320) Source(124, 30) + SourceIndex(0) +26>Emitted(61, 323) Source(124, 33) + SourceIndex(0) +27>Emitted(61, 324) Source(124, 34) + SourceIndex(0) +28>Emitted(61, 326) Source(124, 36) + SourceIndex(0) +29>Emitted(61, 327) Source(124, 37) + SourceIndex(0) +30>Emitted(61, 329) Source(124, 39) + SourceIndex(0) +31>Emitted(61, 331) Source(124, 41) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -2423,7 +2216,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2442,94 +2235,85 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(62, 27) Source(125, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(63, 1) Source(126, 1) + SourceIndex(0) -2 >Emitted(63, 2) Source(126, 2) + SourceIndex(0) + >} +1 >Emitted(63, 2) Source(126, 2) + SourceIndex(0) --- >>>for (_33 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _34 = _33.name, nameA = _34 === void 0 ? "noName" : _34, _35 = _33.skills, _36 = _35 === void 0 ? { primary: "none", secondary: "none" } : _35, _37 = _36.primary, primaryA = _37 === void 0 ? "primary" : _37, _38 = _36.secondary, secondaryA = _38 === void 0 ? "secondary" : _38, _33, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > name: nameA = "noName", > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > name: nameA = "noName" -8 > -9 > name: nameA = "noName" -10> , +4 > +5 > name: nameA = "noName" +6 > +7 > name: nameA = "noName" +8 > , > -11> skills: { +9 > skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -12> -13> skills: { +10> +11> skills: { > primary: primaryA = "primary", > secondary: secondaryA = "secondary" > } = { primary: "none", secondary: "none" } -14> -15> primary: primaryA = "primary" -16> -17> primary: primaryA = "primary" -18> , +12> +13> primary: primaryA = "primary" +14> +15> primary: primaryA = "primary" +16> , > -19> secondary: secondaryA = "secondary" -20> -21> secondary: secondaryA = "secondary" +17> secondary: secondaryA = "secondary" +18> +19> secondary: secondaryA = "secondary" 1->Emitted(64, 1) Source(127, 1) + SourceIndex(0) -2 >Emitted(64, 4) Source(127, 4) + SourceIndex(0) -3 >Emitted(64, 5) Source(127, 5) + SourceIndex(0) -4 >Emitted(64, 6) Source(127, 6) + SourceIndex(0) -5 >Emitted(64, 85) Source(133, 90) + SourceIndex(0) -6 >Emitted(64, 87) Source(128, 5) + SourceIndex(0) -7 >Emitted(64, 101) Source(128, 27) + SourceIndex(0) -8 >Emitted(64, 103) Source(128, 5) + SourceIndex(0) -9 >Emitted(64, 142) Source(128, 27) + SourceIndex(0) -10>Emitted(64, 144) Source(129, 5) + SourceIndex(0) -11>Emitted(64, 160) Source(132, 47) + SourceIndex(0) -12>Emitted(64, 162) Source(129, 5) + SourceIndex(0) -13>Emitted(64, 229) Source(132, 47) + SourceIndex(0) -14>Emitted(64, 231) Source(130, 9) + SourceIndex(0) -15>Emitted(64, 248) Source(130, 38) + SourceIndex(0) -16>Emitted(64, 250) Source(130, 9) + SourceIndex(0) -17>Emitted(64, 293) Source(130, 38) + SourceIndex(0) -18>Emitted(64, 295) Source(131, 9) + SourceIndex(0) -19>Emitted(64, 314) Source(131, 44) + SourceIndex(0) -20>Emitted(64, 316) Source(131, 9) + SourceIndex(0) -21>Emitted(64, 363) Source(131, 44) + SourceIndex(0) +2 >Emitted(64, 6) Source(127, 6) + SourceIndex(0) +3 >Emitted(64, 85) Source(133, 90) + SourceIndex(0) +4 >Emitted(64, 87) Source(128, 5) + SourceIndex(0) +5 >Emitted(64, 101) Source(128, 27) + SourceIndex(0) +6 >Emitted(64, 103) Source(128, 5) + SourceIndex(0) +7 >Emitted(64, 142) Source(128, 27) + SourceIndex(0) +8 >Emitted(64, 144) Source(129, 5) + SourceIndex(0) +9 >Emitted(64, 160) Source(132, 47) + SourceIndex(0) +10>Emitted(64, 162) Source(129, 5) + SourceIndex(0) +11>Emitted(64, 229) Source(132, 47) + SourceIndex(0) +12>Emitted(64, 231) Source(130, 9) + SourceIndex(0) +13>Emitted(64, 248) Source(130, 38) + SourceIndex(0) +14>Emitted(64, 250) Source(130, 9) + SourceIndex(0) +15>Emitted(64, 293) Source(130, 38) + SourceIndex(0) +16>Emitted(64, 295) Source(131, 9) + SourceIndex(0) +17>Emitted(64, 314) Source(131, 44) + SourceIndex(0) +18>Emitted(64, 316) Source(131, 9) + SourceIndex(0) +19>Emitted(64, 363) Source(131, 44) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -2544,8 +2328,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > > } = { primary: "none", secondary: "none" } >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, @@ -2561,7 +2344,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> i 11> ++ 12> ) -13> { 1 >Emitted(65, 5) Source(134, 5) + SourceIndex(0) 2 >Emitted(65, 6) Source(134, 6) + SourceIndex(0) 3 >Emitted(65, 9) Source(134, 9) + SourceIndex(0) @@ -2574,7 +2356,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10>Emitted(65, 20) Source(134, 20) + SourceIndex(0) 11>Emitted(65, 22) Source(134, 22) + SourceIndex(0) 12>Emitted(65, 24) Source(134, 24) + SourceIndex(0) -13>Emitted(65, 25) Source(134, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -2585,7 +2366,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -2604,96 +2385,84 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(66, 27) Source(135, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(67, 1) Source(136, 1) + SourceIndex(0) -2 >Emitted(67, 2) Source(136, 2) + SourceIndex(0) + >} +1 >Emitted(67, 2) Source(136, 2) + SourceIndex(0) --- >>>for (_39 = robot.name, name = _39 === void 0 ? "noName" : _39, _40 = robot.skill, skill = _40 === void 0 ? "skill" : _40, robot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > > -2 >for -3 > -4 > ({ -5 > name = "noName" -6 > -7 > name = "noName" -8 > , -9 > skill = "skill" -10> -11> skill = "skill" -12> } = -13> robot -14> , -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ({ +3 > name = "noName" +4 > +5 > name = "noName" +6 > , +7 > skill = "skill" +8 > +9 > skill = "skill" +10> } = +11> robot +12> , +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(68, 1) Source(138, 1) + SourceIndex(0) -2 >Emitted(68, 4) Source(138, 4) + SourceIndex(0) -3 >Emitted(68, 5) Source(138, 5) + SourceIndex(0) -4 >Emitted(68, 6) Source(138, 8) + SourceIndex(0) -5 >Emitted(68, 22) Source(138, 23) + SourceIndex(0) -6 >Emitted(68, 24) Source(138, 8) + SourceIndex(0) -7 >Emitted(68, 62) Source(138, 23) + SourceIndex(0) -8 >Emitted(68, 64) Source(138, 25) + SourceIndex(0) -9 >Emitted(68, 81) Source(138, 40) + SourceIndex(0) -10>Emitted(68, 83) Source(138, 25) + SourceIndex(0) -11>Emitted(68, 121) Source(138, 40) + SourceIndex(0) -12>Emitted(68, 123) Source(138, 45) + SourceIndex(0) -13>Emitted(68, 128) Source(138, 50) + SourceIndex(0) -14>Emitted(68, 130) Source(138, 52) + SourceIndex(0) -15>Emitted(68, 131) Source(138, 53) + SourceIndex(0) -16>Emitted(68, 134) Source(138, 56) + SourceIndex(0) -17>Emitted(68, 135) Source(138, 57) + SourceIndex(0) -18>Emitted(68, 137) Source(138, 59) + SourceIndex(0) -19>Emitted(68, 138) Source(138, 60) + SourceIndex(0) -20>Emitted(68, 141) Source(138, 63) + SourceIndex(0) -21>Emitted(68, 142) Source(138, 64) + SourceIndex(0) -22>Emitted(68, 144) Source(138, 66) + SourceIndex(0) -23>Emitted(68, 145) Source(138, 67) + SourceIndex(0) -24>Emitted(68, 147) Source(138, 69) + SourceIndex(0) -25>Emitted(68, 149) Source(138, 71) + SourceIndex(0) -26>Emitted(68, 150) Source(138, 72) + SourceIndex(0) +2 >Emitted(68, 6) Source(138, 8) + SourceIndex(0) +3 >Emitted(68, 22) Source(138, 23) + SourceIndex(0) +4 >Emitted(68, 24) Source(138, 8) + SourceIndex(0) +5 >Emitted(68, 62) Source(138, 23) + SourceIndex(0) +6 >Emitted(68, 64) Source(138, 25) + SourceIndex(0) +7 >Emitted(68, 81) Source(138, 40) + SourceIndex(0) +8 >Emitted(68, 83) Source(138, 25) + SourceIndex(0) +9 >Emitted(68, 121) Source(138, 40) + SourceIndex(0) +10>Emitted(68, 123) Source(138, 45) + SourceIndex(0) +11>Emitted(68, 128) Source(138, 50) + SourceIndex(0) +12>Emitted(68, 130) Source(138, 52) + SourceIndex(0) +13>Emitted(68, 131) Source(138, 53) + SourceIndex(0) +14>Emitted(68, 134) Source(138, 56) + SourceIndex(0) +15>Emitted(68, 135) Source(138, 57) + SourceIndex(0) +16>Emitted(68, 137) Source(138, 59) + SourceIndex(0) +17>Emitted(68, 138) Source(138, 60) + SourceIndex(0) +18>Emitted(68, 141) Source(138, 63) + SourceIndex(0) +19>Emitted(68, 142) Source(138, 64) + SourceIndex(0) +20>Emitted(68, 144) Source(138, 66) + SourceIndex(0) +21>Emitted(68, 145) Source(138, 67) + SourceIndex(0) +22>Emitted(68, 147) Source(138, 69) + SourceIndex(0) +23>Emitted(68, 149) Source(138, 71) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -2704,7 +2473,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2723,95 +2492,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(69, 24) Source(139, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(70, 1) Source(140, 1) + SourceIndex(0) -2 >Emitted(70, 2) Source(140, 2) + SourceIndex(0) + >} +1 >Emitted(70, 2) Source(140, 2) + SourceIndex(0) --- >>>for (_41 = getRobot(), _42 = _41.name, name = _42 === void 0 ? "noName" : _42, _43 = _41.skill, skill = _43 === void 0 ? "skill" : _43, _41, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name = "noName", skill = "skill" } = getRobot() -6 > -7 > name = "noName" -8 > -9 > name = "noName" -10> , -11> skill = "skill" -12> -13> skill = "skill" -14> } = getRobot(), -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > { name = "noName", skill = "skill" } = getRobot() +4 > +5 > name = "noName" +6 > +7 > name = "noName" +8 > , +9 > skill = "skill" +10> +11> skill = "skill" +12> } = getRobot(), +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(71, 1) Source(141, 1) + SourceIndex(0) -2 >Emitted(71, 4) Source(141, 4) + SourceIndex(0) -3 >Emitted(71, 5) Source(141, 5) + SourceIndex(0) -4 >Emitted(71, 6) Source(141, 6) + SourceIndex(0) -5 >Emitted(71, 22) Source(141, 55) + SourceIndex(0) -6 >Emitted(71, 24) Source(141, 8) + SourceIndex(0) -7 >Emitted(71, 38) Source(141, 23) + SourceIndex(0) -8 >Emitted(71, 40) Source(141, 8) + SourceIndex(0) -9 >Emitted(71, 78) Source(141, 23) + SourceIndex(0) -10>Emitted(71, 80) Source(141, 25) + SourceIndex(0) -11>Emitted(71, 95) Source(141, 40) + SourceIndex(0) -12>Emitted(71, 97) Source(141, 25) + SourceIndex(0) -13>Emitted(71, 135) Source(141, 40) + SourceIndex(0) -14>Emitted(71, 142) Source(141, 57) + SourceIndex(0) -15>Emitted(71, 143) Source(141, 58) + SourceIndex(0) -16>Emitted(71, 146) Source(141, 61) + SourceIndex(0) -17>Emitted(71, 147) Source(141, 62) + SourceIndex(0) -18>Emitted(71, 149) Source(141, 64) + SourceIndex(0) -19>Emitted(71, 150) Source(141, 65) + SourceIndex(0) -20>Emitted(71, 153) Source(141, 68) + SourceIndex(0) -21>Emitted(71, 154) Source(141, 69) + SourceIndex(0) -22>Emitted(71, 156) Source(141, 71) + SourceIndex(0) -23>Emitted(71, 157) Source(141, 72) + SourceIndex(0) -24>Emitted(71, 159) Source(141, 74) + SourceIndex(0) -25>Emitted(71, 161) Source(141, 76) + SourceIndex(0) -26>Emitted(71, 162) Source(141, 77) + SourceIndex(0) +2 >Emitted(71, 6) Source(141, 6) + SourceIndex(0) +3 >Emitted(71, 22) Source(141, 55) + SourceIndex(0) +4 >Emitted(71, 24) Source(141, 8) + SourceIndex(0) +5 >Emitted(71, 38) Source(141, 23) + SourceIndex(0) +6 >Emitted(71, 40) Source(141, 8) + SourceIndex(0) +7 >Emitted(71, 78) Source(141, 23) + SourceIndex(0) +8 >Emitted(71, 80) Source(141, 25) + SourceIndex(0) +9 >Emitted(71, 95) Source(141, 40) + SourceIndex(0) +10>Emitted(71, 97) Source(141, 25) + SourceIndex(0) +11>Emitted(71, 135) Source(141, 40) + SourceIndex(0) +12>Emitted(71, 142) Source(141, 57) + SourceIndex(0) +13>Emitted(71, 143) Source(141, 58) + SourceIndex(0) +14>Emitted(71, 146) Source(141, 61) + SourceIndex(0) +15>Emitted(71, 147) Source(141, 62) + SourceIndex(0) +16>Emitted(71, 149) Source(141, 64) + SourceIndex(0) +17>Emitted(71, 150) Source(141, 65) + SourceIndex(0) +18>Emitted(71, 153) Source(141, 68) + SourceIndex(0) +19>Emitted(71, 154) Source(141, 69) + SourceIndex(0) +20>Emitted(71, 156) Source(141, 71) + SourceIndex(0) +21>Emitted(71, 157) Source(141, 72) + SourceIndex(0) +22>Emitted(71, 159) Source(141, 74) + SourceIndex(0) +23>Emitted(71, 161) Source(141, 76) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -2822,7 +2579,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2841,95 +2598,83 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(72, 24) Source(142, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(73, 1) Source(143, 1) + SourceIndex(0) -2 >Emitted(73, 2) Source(143, 2) + SourceIndex(0) + >} +1 >Emitted(73, 2) Source(143, 2) + SourceIndex(0) --- >>>for (_44 = { name: "trimmer", skill: "trimming" }, _45 = _44.name, name = _45 === void 0 ? "noName" : _45, _46 = _44.skill, skill = _46 === void 0 ? "skill" : _46, _44, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^^^^^^ -15> ^ -16> ^^^ -17> ^ -18> ^^ -19> ^ -20> ^^^ -21> ^ -22> ^^ -23> ^ -24> ^^ -25> ^^ -26> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^^^^^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^ +18> ^^^ +19> ^ +20> ^^ +21> ^ +22> ^^ +23> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } -6 > -7 > name = "noName" -8 > -9 > name = "noName" -10> , -11> skill = "skill" -12> -13> skill = "skill" -14> } = { name: "trimmer", skill: "trimming" }, -15> i -16> = -17> 0 -18> ; -19> i -20> < -21> 1 -22> ; -23> i -24> ++ -25> ) -26> { +2 >for ( +3 > { name = "noName", skill = "skill" } = { name: "trimmer", skill: "trimming" } +4 > +5 > name = "noName" +6 > +7 > name = "noName" +8 > , +9 > skill = "skill" +10> +11> skill = "skill" +12> } = { name: "trimmer", skill: "trimming" }, +13> i +14> = +15> 0 +16> ; +17> i +18> < +19> 1 +20> ; +21> i +22> ++ +23> ) 1->Emitted(74, 1) Source(144, 1) + SourceIndex(0) -2 >Emitted(74, 4) Source(144, 4) + SourceIndex(0) -3 >Emitted(74, 5) Source(144, 5) + SourceIndex(0) -4 >Emitted(74, 6) Source(144, 6) + SourceIndex(0) -5 >Emitted(74, 50) Source(144, 90) + SourceIndex(0) -6 >Emitted(74, 52) Source(144, 8) + SourceIndex(0) -7 >Emitted(74, 66) Source(144, 23) + SourceIndex(0) -8 >Emitted(74, 68) Source(144, 8) + SourceIndex(0) -9 >Emitted(74, 106) Source(144, 23) + SourceIndex(0) -10>Emitted(74, 108) Source(144, 25) + SourceIndex(0) -11>Emitted(74, 123) Source(144, 40) + SourceIndex(0) -12>Emitted(74, 125) Source(144, 25) + SourceIndex(0) -13>Emitted(74, 163) Source(144, 40) + SourceIndex(0) -14>Emitted(74, 170) Source(144, 92) + SourceIndex(0) -15>Emitted(74, 171) Source(144, 93) + SourceIndex(0) -16>Emitted(74, 174) Source(144, 96) + SourceIndex(0) -17>Emitted(74, 175) Source(144, 97) + SourceIndex(0) -18>Emitted(74, 177) Source(144, 99) + SourceIndex(0) -19>Emitted(74, 178) Source(144, 100) + SourceIndex(0) -20>Emitted(74, 181) Source(144, 103) + SourceIndex(0) -21>Emitted(74, 182) Source(144, 104) + SourceIndex(0) -22>Emitted(74, 184) Source(144, 106) + SourceIndex(0) -23>Emitted(74, 185) Source(144, 107) + SourceIndex(0) -24>Emitted(74, 187) Source(144, 109) + SourceIndex(0) -25>Emitted(74, 189) Source(144, 111) + SourceIndex(0) -26>Emitted(74, 190) Source(144, 112) + SourceIndex(0) +2 >Emitted(74, 6) Source(144, 6) + SourceIndex(0) +3 >Emitted(74, 50) Source(144, 90) + SourceIndex(0) +4 >Emitted(74, 52) Source(144, 8) + SourceIndex(0) +5 >Emitted(74, 66) Source(144, 23) + SourceIndex(0) +6 >Emitted(74, 68) Source(144, 8) + SourceIndex(0) +7 >Emitted(74, 106) Source(144, 23) + SourceIndex(0) +8 >Emitted(74, 108) Source(144, 25) + SourceIndex(0) +9 >Emitted(74, 123) Source(144, 40) + SourceIndex(0) +10>Emitted(74, 125) Source(144, 25) + SourceIndex(0) +11>Emitted(74, 163) Source(144, 40) + SourceIndex(0) +12>Emitted(74, 170) Source(144, 92) + SourceIndex(0) +13>Emitted(74, 171) Source(144, 93) + SourceIndex(0) +14>Emitted(74, 174) Source(144, 96) + SourceIndex(0) +15>Emitted(74, 175) Source(144, 97) + SourceIndex(0) +16>Emitted(74, 177) Source(144, 99) + SourceIndex(0) +17>Emitted(74, 178) Source(144, 100) + SourceIndex(0) +18>Emitted(74, 181) Source(144, 103) + SourceIndex(0) +19>Emitted(74, 182) Source(144, 104) + SourceIndex(0) +20>Emitted(74, 184) Source(144, 106) + SourceIndex(0) +21>Emitted(74, 185) Source(144, 107) + SourceIndex(0) +22>Emitted(74, 187) Source(144, 109) + SourceIndex(0) +23>Emitted(74, 189) Source(144, 111) + SourceIndex(0) --- >>> console.log(nameA); 1 >^^^^ @@ -2940,7 +2685,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -2959,130 +2704,118 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(75, 24) Source(145, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(76, 1) Source(146, 1) + SourceIndex(0) -2 >Emitted(76, 2) Source(146, 2) + SourceIndex(0) + >} +1 >Emitted(76, 2) Source(146, 2) + SourceIndex(0) --- >>>for (_47 = multiRobot.name, name = _47 === void 0 ? "noName" : _47, _48 = multiRobot.skills, _49 = _48 === void 0 ? { primary: "none", secondary: "none" } : _48, _50 = _49.primary, primary = _50 === void 0 ? "primary" : _50, _51 = _49.secondary, secondary = _51 === void 0 ? "secondary" : _51, multiRobot, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^ -22> ^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^^ -29> ^ -30> ^^ -31> ^ -32> ^^ -33> ^^ -34> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^ +20> ^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ 1-> > -2 >for -3 > -4 > ({ - > -5 > name = "noName" -6 > -7 > name = "noName" -8 > , +2 >for ({ + > +3 > name = "noName" +4 > +5 > name = "noName" +6 > , > -9 > skills: { +7 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -10> -11> skills: { +8 > +9 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -12> -13> primary = "primary" -14> -15> primary = "primary" -16> , +10> +11> primary = "primary" +12> +13> primary = "primary" +14> , > -17> secondary = "secondary" -18> -19> secondary = "secondary" -20> +15> secondary = "secondary" +16> +17> secondary = "secondary" +18> > } = { primary: "none", secondary: "none" } > } = -21> multiRobot -22> , -23> i -24> = -25> 0 -26> ; -27> i -28> < -29> 1 -30> ; -31> i -32> ++ -33> ) -34> { +19> multiRobot +20> , +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) 1->Emitted(77, 1) Source(147, 1) + SourceIndex(0) -2 >Emitted(77, 4) Source(147, 4) + SourceIndex(0) -3 >Emitted(77, 5) Source(147, 5) + SourceIndex(0) -4 >Emitted(77, 6) Source(148, 5) + SourceIndex(0) -5 >Emitted(77, 27) Source(148, 20) + SourceIndex(0) -6 >Emitted(77, 29) Source(148, 5) + SourceIndex(0) -7 >Emitted(77, 67) Source(148, 20) + SourceIndex(0) -8 >Emitted(77, 69) Source(149, 5) + SourceIndex(0) -9 >Emitted(77, 92) Source(152, 47) + SourceIndex(0) -10>Emitted(77, 94) Source(149, 5) + SourceIndex(0) -11>Emitted(77, 161) Source(152, 47) + SourceIndex(0) -12>Emitted(77, 163) Source(150, 9) + SourceIndex(0) -13>Emitted(77, 180) Source(150, 28) + SourceIndex(0) -14>Emitted(77, 182) Source(150, 9) + SourceIndex(0) -15>Emitted(77, 224) Source(150, 28) + SourceIndex(0) -16>Emitted(77, 226) Source(151, 9) + SourceIndex(0) -17>Emitted(77, 245) Source(151, 32) + SourceIndex(0) -18>Emitted(77, 247) Source(151, 9) + SourceIndex(0) -19>Emitted(77, 293) Source(151, 32) + SourceIndex(0) -20>Emitted(77, 295) Source(153, 5) + SourceIndex(0) -21>Emitted(77, 305) Source(153, 15) + SourceIndex(0) -22>Emitted(77, 307) Source(153, 17) + SourceIndex(0) -23>Emitted(77, 308) Source(153, 18) + SourceIndex(0) -24>Emitted(77, 311) Source(153, 21) + SourceIndex(0) -25>Emitted(77, 312) Source(153, 22) + SourceIndex(0) -26>Emitted(77, 314) Source(153, 24) + SourceIndex(0) -27>Emitted(77, 315) Source(153, 25) + SourceIndex(0) -28>Emitted(77, 318) Source(153, 28) + SourceIndex(0) -29>Emitted(77, 319) Source(153, 29) + SourceIndex(0) -30>Emitted(77, 321) Source(153, 31) + SourceIndex(0) -31>Emitted(77, 322) Source(153, 32) + SourceIndex(0) -32>Emitted(77, 324) Source(153, 34) + SourceIndex(0) -33>Emitted(77, 326) Source(153, 36) + SourceIndex(0) -34>Emitted(77, 327) Source(153, 37) + SourceIndex(0) +2 >Emitted(77, 6) Source(148, 5) + SourceIndex(0) +3 >Emitted(77, 27) Source(148, 20) + SourceIndex(0) +4 >Emitted(77, 29) Source(148, 5) + SourceIndex(0) +5 >Emitted(77, 67) Source(148, 20) + SourceIndex(0) +6 >Emitted(77, 69) Source(149, 5) + SourceIndex(0) +7 >Emitted(77, 92) Source(152, 47) + SourceIndex(0) +8 >Emitted(77, 94) Source(149, 5) + SourceIndex(0) +9 >Emitted(77, 161) Source(152, 47) + SourceIndex(0) +10>Emitted(77, 163) Source(150, 9) + SourceIndex(0) +11>Emitted(77, 180) Source(150, 28) + SourceIndex(0) +12>Emitted(77, 182) Source(150, 9) + SourceIndex(0) +13>Emitted(77, 224) Source(150, 28) + SourceIndex(0) +14>Emitted(77, 226) Source(151, 9) + SourceIndex(0) +15>Emitted(77, 245) Source(151, 32) + SourceIndex(0) +16>Emitted(77, 247) Source(151, 9) + SourceIndex(0) +17>Emitted(77, 293) Source(151, 32) + SourceIndex(0) +18>Emitted(77, 295) Source(153, 5) + SourceIndex(0) +19>Emitted(77, 305) Source(153, 15) + SourceIndex(0) +20>Emitted(77, 307) Source(153, 17) + SourceIndex(0) +21>Emitted(77, 308) Source(153, 18) + SourceIndex(0) +22>Emitted(77, 311) Source(153, 21) + SourceIndex(0) +23>Emitted(77, 312) Source(153, 22) + SourceIndex(0) +24>Emitted(77, 314) Source(153, 24) + SourceIndex(0) +25>Emitted(77, 315) Source(153, 25) + SourceIndex(0) +26>Emitted(77, 318) Source(153, 28) + SourceIndex(0) +27>Emitted(77, 319) Source(153, 29) + SourceIndex(0) +28>Emitted(77, 321) Source(153, 31) + SourceIndex(0) +29>Emitted(77, 322) Source(153, 32) + SourceIndex(0) +30>Emitted(77, 324) Source(153, 34) + SourceIndex(0) +31>Emitted(77, 326) Source(153, 36) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -3093,7 +2826,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -3112,135 +2845,123 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(78, 27) Source(154, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(79, 1) Source(155, 1) + SourceIndex(0) -2 >Emitted(79, 2) Source(155, 2) + SourceIndex(0) + >} +1 >Emitted(79, 2) Source(155, 2) + SourceIndex(0) --- >>>for (_52 = getMultiRobot(), _53 = _52.name, name = _53 === void 0 ? "noName" : _53, _54 = _52.skills, _55 = _54 === void 0 ? { primary: "none", secondary: "none" } : _54, _56 = _55.primary, primary = _56 === void 0 ? "primary" : _56, _57 = _55.secondary, secondary = _57 === void 0 ? "secondary" : _57, _52, i = 0; i < 1; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -22> ^^^^^^^ -23> ^ -24> ^^^ -25> ^ -26> ^^ -27> ^ -28> ^^^ -29> ^ -30> ^^ -31> ^ -32> ^^ -33> ^^ -34> ^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +20> ^^^^^^^ +21> ^ +22> ^^^ +23> ^ +24> ^^ +25> ^ +26> ^^^ +27> ^ +28> ^^ +29> ^ +30> ^^ +31> ^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > name = "noName", > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } > } = getMultiRobot() -6 > -7 > name = "noName" -8 > -9 > name = "noName" -10> , +4 > +5 > name = "noName" +6 > +7 > name = "noName" +8 > , > -11> skills: { +9 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -12> -13> skills: { +10> +11> skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -14> -15> primary = "primary" -16> -17> primary = "primary" -18> , +12> +13> primary = "primary" +14> +15> primary = "primary" +16> , > -19> secondary = "secondary" -20> -21> secondary = "secondary" -22> +17> secondary = "secondary" +18> +19> secondary = "secondary" +20> > } = { primary: "none", secondary: "none" } > } = getMultiRobot(), -23> i -24> = -25> 0 -26> ; -27> i -28> < -29> 1 -30> ; -31> i -32> ++ -33> ) -34> { +21> i +22> = +23> 0 +24> ; +25> i +26> < +27> 1 +28> ; +29> i +30> ++ +31> ) 1->Emitted(80, 1) Source(156, 1) + SourceIndex(0) -2 >Emitted(80, 4) Source(156, 4) + SourceIndex(0) -3 >Emitted(80, 5) Source(156, 5) + SourceIndex(0) -4 >Emitted(80, 6) Source(156, 6) + SourceIndex(0) -5 >Emitted(80, 27) Source(162, 20) + SourceIndex(0) -6 >Emitted(80, 29) Source(157, 5) + SourceIndex(0) -7 >Emitted(80, 43) Source(157, 20) + SourceIndex(0) -8 >Emitted(80, 45) Source(157, 5) + SourceIndex(0) -9 >Emitted(80, 83) Source(157, 20) + SourceIndex(0) -10>Emitted(80, 85) Source(158, 5) + SourceIndex(0) -11>Emitted(80, 101) Source(161, 47) + SourceIndex(0) -12>Emitted(80, 103) Source(158, 5) + SourceIndex(0) -13>Emitted(80, 170) Source(161, 47) + SourceIndex(0) -14>Emitted(80, 172) Source(159, 9) + SourceIndex(0) -15>Emitted(80, 189) Source(159, 28) + SourceIndex(0) -16>Emitted(80, 191) Source(159, 9) + SourceIndex(0) -17>Emitted(80, 233) Source(159, 28) + SourceIndex(0) -18>Emitted(80, 235) Source(160, 9) + SourceIndex(0) -19>Emitted(80, 254) Source(160, 32) + SourceIndex(0) -20>Emitted(80, 256) Source(160, 9) + SourceIndex(0) -21>Emitted(80, 302) Source(160, 32) + SourceIndex(0) -22>Emitted(80, 309) Source(162, 22) + SourceIndex(0) -23>Emitted(80, 310) Source(162, 23) + SourceIndex(0) -24>Emitted(80, 313) Source(162, 26) + SourceIndex(0) -25>Emitted(80, 314) Source(162, 27) + SourceIndex(0) -26>Emitted(80, 316) Source(162, 29) + SourceIndex(0) -27>Emitted(80, 317) Source(162, 30) + SourceIndex(0) -28>Emitted(80, 320) Source(162, 33) + SourceIndex(0) -29>Emitted(80, 321) Source(162, 34) + SourceIndex(0) -30>Emitted(80, 323) Source(162, 36) + SourceIndex(0) -31>Emitted(80, 324) Source(162, 37) + SourceIndex(0) -32>Emitted(80, 326) Source(162, 39) + SourceIndex(0) -33>Emitted(80, 328) Source(162, 41) + SourceIndex(0) -34>Emitted(80, 329) Source(162, 42) + SourceIndex(0) +2 >Emitted(80, 6) Source(156, 6) + SourceIndex(0) +3 >Emitted(80, 27) Source(162, 20) + SourceIndex(0) +4 >Emitted(80, 29) Source(157, 5) + SourceIndex(0) +5 >Emitted(80, 43) Source(157, 20) + SourceIndex(0) +6 >Emitted(80, 45) Source(157, 5) + SourceIndex(0) +7 >Emitted(80, 83) Source(157, 20) + SourceIndex(0) +8 >Emitted(80, 85) Source(158, 5) + SourceIndex(0) +9 >Emitted(80, 101) Source(161, 47) + SourceIndex(0) +10>Emitted(80, 103) Source(158, 5) + SourceIndex(0) +11>Emitted(80, 170) Source(161, 47) + SourceIndex(0) +12>Emitted(80, 172) Source(159, 9) + SourceIndex(0) +13>Emitted(80, 189) Source(159, 28) + SourceIndex(0) +14>Emitted(80, 191) Source(159, 9) + SourceIndex(0) +15>Emitted(80, 233) Source(159, 28) + SourceIndex(0) +16>Emitted(80, 235) Source(160, 9) + SourceIndex(0) +17>Emitted(80, 254) Source(160, 32) + SourceIndex(0) +18>Emitted(80, 256) Source(160, 9) + SourceIndex(0) +19>Emitted(80, 302) Source(160, 32) + SourceIndex(0) +20>Emitted(80, 309) Source(162, 22) + SourceIndex(0) +21>Emitted(80, 310) Source(162, 23) + SourceIndex(0) +22>Emitted(80, 313) Source(162, 26) + SourceIndex(0) +23>Emitted(80, 314) Source(162, 27) + SourceIndex(0) +24>Emitted(80, 316) Source(162, 29) + SourceIndex(0) +25>Emitted(80, 317) Source(162, 30) + SourceIndex(0) +26>Emitted(80, 320) Source(162, 33) + SourceIndex(0) +27>Emitted(80, 321) Source(162, 34) + SourceIndex(0) +28>Emitted(80, 323) Source(162, 36) + SourceIndex(0) +29>Emitted(80, 324) Source(162, 37) + SourceIndex(0) +30>Emitted(80, 326) Source(162, 39) + SourceIndex(0) +31>Emitted(80, 328) Source(162, 41) + SourceIndex(0) --- >>> console.log(primaryA); 1 >^^^^ @@ -3251,7 +2972,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > console 3 > . @@ -3270,94 +2991,85 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(81, 27) Source(163, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(82, 1) Source(164, 1) + SourceIndex(0) -2 >Emitted(82, 2) Source(164, 2) + SourceIndex(0) + >} +1 >Emitted(82, 2) Source(164, 2) + SourceIndex(0) --- >>>for (_58 = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, _59 = _58.name, name = _59 === void 0 ? "noName" : _59, _60 = _58.skills, _61 = _60 === void 0 ? { primary: "none", secondary: "none" } : _60, _62 = _61.primary, primary = _62 === void 0 ? "primary" : _62, _63 = _61.secondary, secondary = _63 === void 0 ? "secondary" : _63, _58, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^^^^^^^^^^^^^ -16> ^^ -17> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -18> ^^ -19> ^^^^^^^^^^^^^^^^^^^ -20> ^^ -21> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^^^^^^^^^^^^^ +14> ^^ +15> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +16> ^^ +17> ^^^^^^^^^^^^^^^^^^^ +18> ^^ +19> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > { +2 >for ( +3 > { > name = "noName", > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } > } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } -6 > -7 > name = "noName" -8 > -9 > name = "noName" -10> , +4 > +5 > name = "noName" +6 > +7 > name = "noName" +8 > , > -11> skills: { +9 > skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -12> -13> skills: { +10> +11> skills: { > primary = "primary", > secondary = "secondary" > } = { primary: "none", secondary: "none" } -14> -15> primary = "primary" -16> -17> primary = "primary" -18> , +12> +13> primary = "primary" +14> +15> primary = "primary" +16> , > -19> secondary = "secondary" -20> -21> secondary = "secondary" +17> secondary = "secondary" +18> +19> secondary = "secondary" 1->Emitted(83, 1) Source(165, 1) + SourceIndex(0) -2 >Emitted(83, 4) Source(165, 4) + SourceIndex(0) -3 >Emitted(83, 5) Source(165, 5) + SourceIndex(0) -4 >Emitted(83, 6) Source(165, 6) + SourceIndex(0) -5 >Emitted(83, 85) Source(171, 90) + SourceIndex(0) -6 >Emitted(83, 87) Source(166, 5) + SourceIndex(0) -7 >Emitted(83, 101) Source(166, 20) + SourceIndex(0) -8 >Emitted(83, 103) Source(166, 5) + SourceIndex(0) -9 >Emitted(83, 141) Source(166, 20) + SourceIndex(0) -10>Emitted(83, 143) Source(167, 5) + SourceIndex(0) -11>Emitted(83, 159) Source(170, 47) + SourceIndex(0) -12>Emitted(83, 161) Source(167, 5) + SourceIndex(0) -13>Emitted(83, 228) Source(170, 47) + SourceIndex(0) -14>Emitted(83, 230) Source(168, 9) + SourceIndex(0) -15>Emitted(83, 247) Source(168, 28) + SourceIndex(0) -16>Emitted(83, 249) Source(168, 9) + SourceIndex(0) -17>Emitted(83, 291) Source(168, 28) + SourceIndex(0) -18>Emitted(83, 293) Source(169, 9) + SourceIndex(0) -19>Emitted(83, 312) Source(169, 32) + SourceIndex(0) -20>Emitted(83, 314) Source(169, 9) + SourceIndex(0) -21>Emitted(83, 360) Source(169, 32) + SourceIndex(0) +2 >Emitted(83, 6) Source(165, 6) + SourceIndex(0) +3 >Emitted(83, 85) Source(171, 90) + SourceIndex(0) +4 >Emitted(83, 87) Source(166, 5) + SourceIndex(0) +5 >Emitted(83, 101) Source(166, 20) + SourceIndex(0) +6 >Emitted(83, 103) Source(166, 5) + SourceIndex(0) +7 >Emitted(83, 141) Source(166, 20) + SourceIndex(0) +8 >Emitted(83, 143) Source(167, 5) + SourceIndex(0) +9 >Emitted(83, 159) Source(170, 47) + SourceIndex(0) +10>Emitted(83, 161) Source(167, 5) + SourceIndex(0) +11>Emitted(83, 228) Source(170, 47) + SourceIndex(0) +12>Emitted(83, 230) Source(168, 9) + SourceIndex(0) +13>Emitted(83, 247) Source(168, 28) + SourceIndex(0) +14>Emitted(83, 249) Source(168, 9) + SourceIndex(0) +15>Emitted(83, 291) Source(168, 28) + SourceIndex(0) +16>Emitted(83, 293) Source(169, 9) + SourceIndex(0) +17>Emitted(83, 312) Source(169, 32) + SourceIndex(0) +18>Emitted(83, 314) Source(169, 9) + SourceIndex(0) +19>Emitted(83, 360) Source(169, 32) + SourceIndex(0) --- >>> i = 0; i < 1; i++) { 1 >^^^^ @@ -3372,8 +3084,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> ^ 11> ^^ 12> ^^ -13> ^ -14> ^^^-> +13> ^^^^-> 1 > > } = { primary: "none", secondary: "none" } >} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, @@ -3389,7 +3100,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10> i 11> ++ 12> ) -13> { 1 >Emitted(84, 5) Source(172, 5) + SourceIndex(0) 2 >Emitted(84, 6) Source(172, 6) + SourceIndex(0) 3 >Emitted(84, 9) Source(172, 9) + SourceIndex(0) @@ -3402,7 +3112,6 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 10>Emitted(84, 20) Source(172, 20) + SourceIndex(0) 11>Emitted(84, 22) Source(172, 22) + SourceIndex(0) 12>Emitted(84, 24) Source(172, 24) + SourceIndex(0) -13>Emitted(84, 25) Source(172, 25) + SourceIndex(0) --- >>> console.log(primaryA); 1->^^^^ @@ -3413,7 +3122,7 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 6 > ^^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -3432,14 +3141,11 @@ sourceFile:sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2 8 >Emitted(85, 27) Source(173, 27) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(86, 1) Source(174, 1) + SourceIndex(0) -2 >Emitted(86, 2) Source(174, 2) + SourceIndex(0) + >} +1 >Emitted(86, 2) Source(174, 2) + SourceIndex(0) --- >>>var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63; >>>//# sourceMappingURL=sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map index f9218ab62eb..0f8b51b04c7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfArrayBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAnB,IAAA,iBAAS,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAxB,IAAA,WAAS,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAA7B,IAAA,WAAS,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6C,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAAnD,IAAA,sBAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAA6C,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAAxD,IAAA,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAA6C,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAAlE,IAAA,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlB,IAAA,yBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvB,IAAA,mBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAA5B,IAAA,mBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAgB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArB,IAAA,4BAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAgB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1B,IAAA,iBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAgB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAApC,IAAA,iBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAAoC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAArC,IAAA,iBAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAoC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA1C,IAAA,WAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAoC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB;IAA/C,IAAA,aAA2B,EAA1B,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAzD,IAAA,wBAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAA9D,IAAA,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAmD,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAAxE,IAAA,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAkC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;IAAnC,IAAA,mBAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAkC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;IAAxC,IAAA,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAkC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAA7C,IAAA,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAlC,IAAA,6CAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAA6B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAAvC,IAAA,mCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAA6B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAAjD,IAAA,mCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,KAAsB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAnB,IAAA,iBAAS,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAsB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAxB,IAAA,WAAS,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAsB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAA7B,IAAA,WAAS,EAAN,aAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAiD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAAnD,IAAA,sBAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAiD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAAxD,IAAA,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAAiD,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAAlE,IAAA,WAAoC,EAAjC,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACvC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAAsB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlB,IAAA,yBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAsB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvB,IAAA,mBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAsB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAA5B,IAAA,mBAAO;IACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAoB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArB,IAAA,4BAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAoB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1B,IAAA,iBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAoB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAApC,IAAA,iBAAK;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAwC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAArC,IAAA,iBAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAwC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA1C,IAAA,WAA2B,EAA1B,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAwC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB;IAA/C,IAAA,aAA2B,EAA1B,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAuD,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAzD,IAAA,wBAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAuD,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAA9D,IAAA,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAuD,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAAxE,IAAA,cAA0C,EAAzC,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IAC7C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAAsC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;IAAnC,IAAA,mBAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAsC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;IAAxC,IAAA,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAsC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAA7C,IAAA,cAAyB,EAAxB,iBAAQ,EAAE,yBAAa;IAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAiC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAlC,IAAA,6CAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAAiC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAAvC,IAAA,mCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAAiC,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAAjD,IAAA,mCAAkB;IACxB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt index 9c039efbea8..25ccfe11207 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.sourcemap.txt @@ -134,21 +134,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) --- >>>} 1 > @@ -294,21 +291,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) -4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) -5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +4 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) --- >>>} 1 > @@ -322,40 +316,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > -2 >for -3 > -4 > (let [, nameA] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [, nameA] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) -3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) -4 >Emitted(13, 6) Source(21, 23) + SourceIndex(0) -5 >Emitted(13, 16) Source(21, 29) + SourceIndex(0) -6 >Emitted(13, 18) Source(21, 23) + SourceIndex(0) -7 >Emitted(13, 35) Source(21, 29) + SourceIndex(0) -8 >Emitted(13, 37) Source(21, 23) + SourceIndex(0) -9 >Emitted(13, 57) Source(21, 29) + SourceIndex(0) -10>Emitted(13, 59) Source(21, 23) + SourceIndex(0) -11>Emitted(13, 63) Source(21, 29) + SourceIndex(0) +2 >Emitted(13, 6) Source(21, 23) + SourceIndex(0) +3 >Emitted(13, 16) Source(21, 29) + SourceIndex(0) +4 >Emitted(13, 18) Source(21, 23) + SourceIndex(0) +5 >Emitted(13, 35) Source(21, 29) + SourceIndex(0) +6 >Emitted(13, 37) Source(21, 23) + SourceIndex(0) +7 >Emitted(13, 57) Source(21, 29) + SourceIndex(0) +8 >Emitted(13, 59) Source(21, 23) + SourceIndex(0) +9 >Emitted(13, 63) Source(21, 29) + SourceIndex(0) --- >>> var _a = robots_1[_i], nameA = _a[1]; 1 >^^^^ @@ -410,45 +398,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > (let [, nameA] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [, nameA] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(17, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(17, 4) Source(24, 4) + SourceIndex(0) -3 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) -4 >Emitted(17, 6) Source(24, 23) + SourceIndex(0) -5 >Emitted(17, 16) Source(24, 34) + SourceIndex(0) -6 >Emitted(17, 18) Source(24, 23) + SourceIndex(0) -7 >Emitted(17, 23) Source(24, 23) + SourceIndex(0) -8 >Emitted(17, 32) Source(24, 32) + SourceIndex(0) -9 >Emitted(17, 34) Source(24, 34) + SourceIndex(0) -10>Emitted(17, 36) Source(24, 23) + SourceIndex(0) -11>Emitted(17, 50) Source(24, 34) + SourceIndex(0) -12>Emitted(17, 52) Source(24, 23) + SourceIndex(0) -13>Emitted(17, 56) Source(24, 34) + SourceIndex(0) +2 >Emitted(17, 6) Source(24, 23) + SourceIndex(0) +3 >Emitted(17, 16) Source(24, 34) + SourceIndex(0) +4 >Emitted(17, 18) Source(24, 23) + SourceIndex(0) +5 >Emitted(17, 23) Source(24, 23) + SourceIndex(0) +6 >Emitted(17, 32) Source(24, 32) + SourceIndex(0) +7 >Emitted(17, 34) Source(24, 34) + SourceIndex(0) +8 >Emitted(17, 36) Source(24, 23) + SourceIndex(0) +9 >Emitted(17, 50) Source(24, 34) + SourceIndex(0) +10>Emitted(17, 52) Source(24, 23) + SourceIndex(0) +11>Emitted(17, 56) Source(24, 34) + SourceIndex(0) --- >>> var _d = _c[_b], nameA = _d[1]; 1 >^^^^ @@ -503,51 +485,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ 1-> > -2 >for -3 > -4 > (let [, nameA] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [, nameA] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(27, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(27, 23) + SourceIndex(0) -5 >Emitted(21, 16) Source(27, 39) + SourceIndex(0) -6 >Emitted(21, 18) Source(27, 23) + SourceIndex(0) -7 >Emitted(21, 24) Source(27, 24) + SourceIndex(0) -8 >Emitted(21, 30) Source(27, 30) + SourceIndex(0) -9 >Emitted(21, 32) Source(27, 32) + SourceIndex(0) -10>Emitted(21, 38) Source(27, 38) + SourceIndex(0) -11>Emitted(21, 39) Source(27, 39) + SourceIndex(0) -12>Emitted(21, 41) Source(27, 23) + SourceIndex(0) -13>Emitted(21, 55) Source(27, 39) + SourceIndex(0) -14>Emitted(21, 57) Source(27, 23) + SourceIndex(0) -15>Emitted(21, 61) Source(27, 39) + SourceIndex(0) +2 >Emitted(21, 6) Source(27, 23) + SourceIndex(0) +3 >Emitted(21, 16) Source(27, 39) + SourceIndex(0) +4 >Emitted(21, 18) Source(27, 23) + SourceIndex(0) +5 >Emitted(21, 24) Source(27, 24) + SourceIndex(0) +6 >Emitted(21, 30) Source(27, 30) + SourceIndex(0) +7 >Emitted(21, 32) Source(27, 32) + SourceIndex(0) +8 >Emitted(21, 38) Source(27, 38) + SourceIndex(0) +9 >Emitted(21, 39) Source(27, 39) + SourceIndex(0) +10>Emitted(21, 41) Source(27, 23) + SourceIndex(0) +11>Emitted(21, 55) Source(27, 39) + SourceIndex(0) +12>Emitted(21, 57) Source(27, 23) + SourceIndex(0) +13>Emitted(21, 61) Source(27, 39) + SourceIndex(0) --- >>> var _g = _f[_e], nameA = _g[1]; 1 >^^^^ @@ -602,40 +578,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, [primarySkillA, secondarySkillA]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let [, [primarySkillA, secondarySkillA]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(25, 1) Source(30, 1) + SourceIndex(0) -2 >Emitted(25, 4) Source(30, 4) + SourceIndex(0) -3 >Emitted(25, 5) Source(30, 5) + SourceIndex(0) -4 >Emitted(25, 6) Source(30, 50) + SourceIndex(0) -5 >Emitted(25, 16) Source(30, 61) + SourceIndex(0) -6 >Emitted(25, 18) Source(30, 50) + SourceIndex(0) -7 >Emitted(25, 45) Source(30, 61) + SourceIndex(0) -8 >Emitted(25, 47) Source(30, 50) + SourceIndex(0) -9 >Emitted(25, 72) Source(30, 61) + SourceIndex(0) -10>Emitted(25, 74) Source(30, 50) + SourceIndex(0) -11>Emitted(25, 78) Source(30, 61) + SourceIndex(0) +2 >Emitted(25, 6) Source(30, 50) + SourceIndex(0) +3 >Emitted(25, 16) Source(30, 61) + SourceIndex(0) +4 >Emitted(25, 18) Source(30, 50) + SourceIndex(0) +5 >Emitted(25, 45) Source(30, 61) + SourceIndex(0) +6 >Emitted(25, 47) Source(30, 50) + SourceIndex(0) +7 >Emitted(25, 72) Source(30, 61) + SourceIndex(0) +8 >Emitted(25, 74) Source(30, 50) + SourceIndex(0) +9 >Emitted(25, 78) Source(30, 61) + SourceIndex(0) --- >>> var _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; 1->^^^^ @@ -702,46 +672,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, [primarySkillA, secondarySkillA]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let [, [primarySkillA, secondarySkillA]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(29, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(29, 4) Source(33, 4) + SourceIndex(0) -3 >Emitted(29, 5) Source(33, 5) + SourceIndex(0) -4 >Emitted(29, 6) Source(33, 50) + SourceIndex(0) -5 >Emitted(29, 16) Source(33, 66) + SourceIndex(0) -6 >Emitted(29, 18) Source(33, 50) + SourceIndex(0) -7 >Emitted(29, 23) Source(33, 50) + SourceIndex(0) -8 >Emitted(29, 37) Source(33, 64) + SourceIndex(0) -9 >Emitted(29, 39) Source(33, 66) + SourceIndex(0) -10>Emitted(29, 41) Source(33, 50) + SourceIndex(0) -11>Emitted(29, 55) Source(33, 66) + SourceIndex(0) -12>Emitted(29, 57) Source(33, 50) + SourceIndex(0) -13>Emitted(29, 61) Source(33, 66) + SourceIndex(0) +2 >Emitted(29, 6) Source(33, 50) + SourceIndex(0) +3 >Emitted(29, 16) Source(33, 66) + SourceIndex(0) +4 >Emitted(29, 18) Source(33, 50) + SourceIndex(0) +5 >Emitted(29, 23) Source(33, 50) + SourceIndex(0) +6 >Emitted(29, 37) Source(33, 64) + SourceIndex(0) +7 >Emitted(29, 39) Source(33, 66) + SourceIndex(0) +8 >Emitted(29, 41) Source(33, 50) + SourceIndex(0) +9 >Emitted(29, 55) Source(33, 66) + SourceIndex(0) +10>Emitted(29, 57) Source(33, 50) + SourceIndex(0) +11>Emitted(29, 61) Source(33, 66) + SourceIndex(0) --- >>> var _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; 1->^^^^ @@ -808,52 +772,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, [primarySkillA, secondarySkillA]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for (let [, [primarySkillA, secondarySkillA]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(33, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(36, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(36, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(36, 50) + SourceIndex(0) -5 >Emitted(33, 16) Source(36, 76) + SourceIndex(0) -6 >Emitted(33, 18) Source(36, 50) + SourceIndex(0) -7 >Emitted(33, 24) Source(36, 51) + SourceIndex(0) -8 >Emitted(33, 35) Source(36, 62) + SourceIndex(0) -9 >Emitted(33, 37) Source(36, 64) + SourceIndex(0) -10>Emitted(33, 48) Source(36, 75) + SourceIndex(0) -11>Emitted(33, 49) Source(36, 76) + SourceIndex(0) -12>Emitted(33, 51) Source(36, 50) + SourceIndex(0) -13>Emitted(33, 65) Source(36, 76) + SourceIndex(0) -14>Emitted(33, 67) Source(36, 50) + SourceIndex(0) -15>Emitted(33, 71) Source(36, 76) + SourceIndex(0) +2 >Emitted(33, 6) Source(36, 50) + SourceIndex(0) +3 >Emitted(33, 16) Source(36, 76) + SourceIndex(0) +4 >Emitted(33, 18) Source(36, 50) + SourceIndex(0) +5 >Emitted(33, 24) Source(36, 51) + SourceIndex(0) +6 >Emitted(33, 35) Source(36, 62) + SourceIndex(0) +7 >Emitted(33, 37) Source(36, 64) + SourceIndex(0) +8 >Emitted(33, 48) Source(36, 75) + SourceIndex(0) +9 >Emitted(33, 49) Source(36, 76) + SourceIndex(0) +10>Emitted(33, 51) Source(36, 50) + SourceIndex(0) +11>Emitted(33, 65) Source(36, 76) + SourceIndex(0) +12>Emitted(33, 67) Source(36, 50) + SourceIndex(0) +13>Emitted(33, 71) Source(36, 76) + SourceIndex(0) --- >>> var _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; 1->^^^^ @@ -920,40 +878,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > -2 >for -3 > -4 > (let [numberB] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [numberB] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(37, 1) Source(40, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(40, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(40, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(40, 23) + SourceIndex(0) -5 >Emitted(37, 16) Source(40, 29) + SourceIndex(0) -6 >Emitted(37, 18) Source(40, 23) + SourceIndex(0) -7 >Emitted(37, 35) Source(40, 29) + SourceIndex(0) -8 >Emitted(37, 37) Source(40, 23) + SourceIndex(0) -9 >Emitted(37, 57) Source(40, 29) + SourceIndex(0) -10>Emitted(37, 59) Source(40, 23) + SourceIndex(0) -11>Emitted(37, 63) Source(40, 29) + SourceIndex(0) +2 >Emitted(37, 6) Source(40, 23) + SourceIndex(0) +3 >Emitted(37, 16) Source(40, 29) + SourceIndex(0) +4 >Emitted(37, 18) Source(40, 23) + SourceIndex(0) +5 >Emitted(37, 35) Source(40, 29) + SourceIndex(0) +6 >Emitted(37, 37) Source(40, 23) + SourceIndex(0) +7 >Emitted(37, 57) Source(40, 29) + SourceIndex(0) +8 >Emitted(37, 59) Source(40, 23) + SourceIndex(0) +9 >Emitted(37, 63) Source(40, 29) + SourceIndex(0) --- >>> var numberB = robots_2[_u][0]; 1 >^^^^ @@ -1002,45 +954,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > (let [numberB] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [numberB] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(41, 1) Source(43, 1) + SourceIndex(0) -2 >Emitted(41, 4) Source(43, 4) + SourceIndex(0) -3 >Emitted(41, 5) Source(43, 5) + SourceIndex(0) -4 >Emitted(41, 6) Source(43, 23) + SourceIndex(0) -5 >Emitted(41, 16) Source(43, 34) + SourceIndex(0) -6 >Emitted(41, 18) Source(43, 23) + SourceIndex(0) -7 >Emitted(41, 23) Source(43, 23) + SourceIndex(0) -8 >Emitted(41, 32) Source(43, 32) + SourceIndex(0) -9 >Emitted(41, 34) Source(43, 34) + SourceIndex(0) -10>Emitted(41, 36) Source(43, 23) + SourceIndex(0) -11>Emitted(41, 50) Source(43, 34) + SourceIndex(0) -12>Emitted(41, 52) Source(43, 23) + SourceIndex(0) -13>Emitted(41, 56) Source(43, 34) + SourceIndex(0) +2 >Emitted(41, 6) Source(43, 23) + SourceIndex(0) +3 >Emitted(41, 16) Source(43, 34) + SourceIndex(0) +4 >Emitted(41, 18) Source(43, 23) + SourceIndex(0) +5 >Emitted(41, 23) Source(43, 23) + SourceIndex(0) +6 >Emitted(41, 32) Source(43, 32) + SourceIndex(0) +7 >Emitted(41, 34) Source(43, 34) + SourceIndex(0) +8 >Emitted(41, 36) Source(43, 23) + SourceIndex(0) +9 >Emitted(41, 50) Source(43, 34) + SourceIndex(0) +10>Emitted(41, 52) Source(43, 23) + SourceIndex(0) +11>Emitted(41, 56) Source(43, 34) + SourceIndex(0) --- >>> var numberB = _w[_v][0]; 1 >^^^^ @@ -1089,51 +1035,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ 1-> > -2 >for -3 > -4 > (let [numberB] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [numberB] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(45, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(46, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(46, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(46, 23) + SourceIndex(0) -5 >Emitted(45, 16) Source(46, 39) + SourceIndex(0) -6 >Emitted(45, 18) Source(46, 23) + SourceIndex(0) -7 >Emitted(45, 24) Source(46, 24) + SourceIndex(0) -8 >Emitted(45, 30) Source(46, 30) + SourceIndex(0) -9 >Emitted(45, 32) Source(46, 32) + SourceIndex(0) -10>Emitted(45, 38) Source(46, 38) + SourceIndex(0) -11>Emitted(45, 39) Source(46, 39) + SourceIndex(0) -12>Emitted(45, 41) Source(46, 23) + SourceIndex(0) -13>Emitted(45, 55) Source(46, 39) + SourceIndex(0) -14>Emitted(45, 57) Source(46, 23) + SourceIndex(0) -15>Emitted(45, 61) Source(46, 39) + SourceIndex(0) +2 >Emitted(45, 6) Source(46, 23) + SourceIndex(0) +3 >Emitted(45, 16) Source(46, 39) + SourceIndex(0) +4 >Emitted(45, 18) Source(46, 23) + SourceIndex(0) +5 >Emitted(45, 24) Source(46, 24) + SourceIndex(0) +6 >Emitted(45, 30) Source(46, 30) + SourceIndex(0) +7 >Emitted(45, 32) Source(46, 32) + SourceIndex(0) +8 >Emitted(45, 38) Source(46, 38) + SourceIndex(0) +9 >Emitted(45, 39) Source(46, 39) + SourceIndex(0) +10>Emitted(45, 41) Source(46, 23) + SourceIndex(0) +11>Emitted(45, 55) Source(46, 39) + SourceIndex(0) +12>Emitted(45, 57) Source(46, 23) + SourceIndex(0) +13>Emitted(45, 61) Source(46, 39) + SourceIndex(0) --- >>> var numberB = _y[_x][0]; 1 >^^^^ @@ -1182,39 +1122,33 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > -2 >for -3 > -4 > (let [nameB] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let [nameB] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(49, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(49, 21) + SourceIndex(0) -5 >Emitted(49, 16) Source(49, 32) + SourceIndex(0) -6 >Emitted(49, 18) Source(49, 21) + SourceIndex(0) -7 >Emitted(49, 45) Source(49, 32) + SourceIndex(0) -8 >Emitted(49, 47) Source(49, 21) + SourceIndex(0) -9 >Emitted(49, 72) Source(49, 32) + SourceIndex(0) -10>Emitted(49, 74) Source(49, 21) + SourceIndex(0) -11>Emitted(49, 78) Source(49, 32) + SourceIndex(0) +2 >Emitted(49, 6) Source(49, 21) + SourceIndex(0) +3 >Emitted(49, 16) Source(49, 32) + SourceIndex(0) +4 >Emitted(49, 18) Source(49, 21) + SourceIndex(0) +5 >Emitted(49, 45) Source(49, 32) + SourceIndex(0) +6 >Emitted(49, 47) Source(49, 21) + SourceIndex(0) +7 >Emitted(49, 72) Source(49, 32) + SourceIndex(0) +8 >Emitted(49, 74) Source(49, 21) + SourceIndex(0) +9 >Emitted(49, 78) Source(49, 32) + SourceIndex(0) --- >>> var nameB = multiRobots_2[_z][0]; 1 >^^^^ @@ -1263,45 +1197,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > (let [nameB] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let [nameB] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(53, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(53, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(53, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(53, 6) Source(52, 21) + SourceIndex(0) -5 >Emitted(53, 16) Source(52, 37) + SourceIndex(0) -6 >Emitted(53, 18) Source(52, 21) + SourceIndex(0) -7 >Emitted(53, 23) Source(52, 21) + SourceIndex(0) -8 >Emitted(53, 37) Source(52, 35) + SourceIndex(0) -9 >Emitted(53, 39) Source(52, 37) + SourceIndex(0) -10>Emitted(53, 41) Source(52, 21) + SourceIndex(0) -11>Emitted(53, 55) Source(52, 37) + SourceIndex(0) -12>Emitted(53, 57) Source(52, 21) + SourceIndex(0) -13>Emitted(53, 61) Source(52, 37) + SourceIndex(0) +2 >Emitted(53, 6) Source(52, 21) + SourceIndex(0) +3 >Emitted(53, 16) Source(52, 37) + SourceIndex(0) +4 >Emitted(53, 18) Source(52, 21) + SourceIndex(0) +5 >Emitted(53, 23) Source(52, 21) + SourceIndex(0) +6 >Emitted(53, 37) Source(52, 35) + SourceIndex(0) +7 >Emitted(53, 39) Source(52, 37) + SourceIndex(0) +8 >Emitted(53, 41) Source(52, 21) + SourceIndex(0) +9 >Emitted(53, 55) Source(52, 37) + SourceIndex(0) +10>Emitted(53, 57) Source(52, 21) + SourceIndex(0) +11>Emitted(53, 61) Source(52, 37) + SourceIndex(0) --- >>> var nameB = _1[_0][0]; 1 >^^^^ @@ -1350,51 +1278,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ 1-> > -2 >for -3 > -4 > (let [nameB] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for (let [nameB] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(57, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(55, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(55, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(55, 21) + SourceIndex(0) -5 >Emitted(57, 16) Source(55, 47) + SourceIndex(0) -6 >Emitted(57, 18) Source(55, 21) + SourceIndex(0) -7 >Emitted(57, 24) Source(55, 22) + SourceIndex(0) -8 >Emitted(57, 35) Source(55, 33) + SourceIndex(0) -9 >Emitted(57, 37) Source(55, 35) + SourceIndex(0) -10>Emitted(57, 48) Source(55, 46) + SourceIndex(0) -11>Emitted(57, 49) Source(55, 47) + SourceIndex(0) -12>Emitted(57, 51) Source(55, 21) + SourceIndex(0) -13>Emitted(57, 65) Source(55, 47) + SourceIndex(0) -14>Emitted(57, 67) Source(55, 21) + SourceIndex(0) -15>Emitted(57, 71) Source(55, 47) + SourceIndex(0) +2 >Emitted(57, 6) Source(55, 21) + SourceIndex(0) +3 >Emitted(57, 16) Source(55, 47) + SourceIndex(0) +4 >Emitted(57, 18) Source(55, 21) + SourceIndex(0) +5 >Emitted(57, 24) Source(55, 22) + SourceIndex(0) +6 >Emitted(57, 35) Source(55, 33) + SourceIndex(0) +7 >Emitted(57, 37) Source(55, 35) + SourceIndex(0) +8 >Emitted(57, 48) Source(55, 46) + SourceIndex(0) +9 >Emitted(57, 49) Source(55, 47) + SourceIndex(0) +10>Emitted(57, 51) Source(55, 21) + SourceIndex(0) +11>Emitted(57, 65) Source(55, 47) + SourceIndex(0) +12>Emitted(57, 67) Source(55, 21) + SourceIndex(0) +13>Emitted(57, 71) Source(55, 47) + SourceIndex(0) --- >>> var nameB = _3[_2][0]; 1 >^^^^ @@ -1443,41 +1365,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > (let [numberA2, nameA2, skillA2] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [numberA2, nameA2, skillA2] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(61, 1) Source(59, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(59, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(59, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(59, 41) + SourceIndex(0) -5 >Emitted(61, 16) Source(59, 47) + SourceIndex(0) -6 >Emitted(61, 18) Source(59, 41) + SourceIndex(0) -7 >Emitted(61, 35) Source(59, 47) + SourceIndex(0) -8 >Emitted(61, 37) Source(59, 41) + SourceIndex(0) -9 >Emitted(61, 57) Source(59, 47) + SourceIndex(0) -10>Emitted(61, 59) Source(59, 41) + SourceIndex(0) -11>Emitted(61, 63) Source(59, 47) + SourceIndex(0) +2 >Emitted(61, 6) Source(59, 41) + SourceIndex(0) +3 >Emitted(61, 16) Source(59, 47) + SourceIndex(0) +4 >Emitted(61, 18) Source(59, 41) + SourceIndex(0) +5 >Emitted(61, 35) Source(59, 47) + SourceIndex(0) +6 >Emitted(61, 37) Source(59, 41) + SourceIndex(0) +7 >Emitted(61, 57) Source(59, 47) + SourceIndex(0) +8 >Emitted(61, 59) Source(59, 41) + SourceIndex(0) +9 >Emitted(61, 63) Source(59, 47) + SourceIndex(0) --- >>> var _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; 1->^^^^ @@ -1544,46 +1460,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA2, nameA2, skillA2] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [numberA2, nameA2, skillA2] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(65, 1) Source(62, 1) + SourceIndex(0) -2 >Emitted(65, 4) Source(62, 4) + SourceIndex(0) -3 >Emitted(65, 5) Source(62, 5) + SourceIndex(0) -4 >Emitted(65, 6) Source(62, 41) + SourceIndex(0) -5 >Emitted(65, 16) Source(62, 52) + SourceIndex(0) -6 >Emitted(65, 18) Source(62, 41) + SourceIndex(0) -7 >Emitted(65, 23) Source(62, 41) + SourceIndex(0) -8 >Emitted(65, 32) Source(62, 50) + SourceIndex(0) -9 >Emitted(65, 34) Source(62, 52) + SourceIndex(0) -10>Emitted(65, 36) Source(62, 41) + SourceIndex(0) -11>Emitted(65, 50) Source(62, 52) + SourceIndex(0) -12>Emitted(65, 52) Source(62, 41) + SourceIndex(0) -13>Emitted(65, 56) Source(62, 52) + SourceIndex(0) +2 >Emitted(65, 6) Source(62, 41) + SourceIndex(0) +3 >Emitted(65, 16) Source(62, 52) + SourceIndex(0) +4 >Emitted(65, 18) Source(62, 41) + SourceIndex(0) +5 >Emitted(65, 23) Source(62, 41) + SourceIndex(0) +6 >Emitted(65, 32) Source(62, 50) + SourceIndex(0) +7 >Emitted(65, 34) Source(62, 52) + SourceIndex(0) +8 >Emitted(65, 36) Source(62, 41) + SourceIndex(0) +9 >Emitted(65, 50) Source(62, 52) + SourceIndex(0) +10>Emitted(65, 52) Source(62, 41) + SourceIndex(0) +11>Emitted(65, 56) Source(62, 52) + SourceIndex(0) --- >>> var _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; 1->^^^^ @@ -1650,52 +1560,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA2, nameA2, skillA2] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [numberA2, nameA2, skillA2] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(69, 1) Source(65, 1) + SourceIndex(0) -2 >Emitted(69, 4) Source(65, 4) + SourceIndex(0) -3 >Emitted(69, 5) Source(65, 5) + SourceIndex(0) -4 >Emitted(69, 6) Source(65, 41) + SourceIndex(0) -5 >Emitted(69, 16) Source(65, 57) + SourceIndex(0) -6 >Emitted(69, 18) Source(65, 41) + SourceIndex(0) -7 >Emitted(69, 25) Source(65, 42) + SourceIndex(0) -8 >Emitted(69, 31) Source(65, 48) + SourceIndex(0) -9 >Emitted(69, 33) Source(65, 50) + SourceIndex(0) -10>Emitted(69, 39) Source(65, 56) + SourceIndex(0) -11>Emitted(69, 40) Source(65, 57) + SourceIndex(0) -12>Emitted(69, 42) Source(65, 41) + SourceIndex(0) -13>Emitted(69, 57) Source(65, 57) + SourceIndex(0) -14>Emitted(69, 59) Source(65, 41) + SourceIndex(0) -15>Emitted(69, 63) Source(65, 57) + SourceIndex(0) +2 >Emitted(69, 6) Source(65, 41) + SourceIndex(0) +3 >Emitted(69, 16) Source(65, 57) + SourceIndex(0) +4 >Emitted(69, 18) Source(65, 41) + SourceIndex(0) +5 >Emitted(69, 25) Source(65, 42) + SourceIndex(0) +6 >Emitted(69, 31) Source(65, 48) + SourceIndex(0) +7 >Emitted(69, 33) Source(65, 50) + SourceIndex(0) +8 >Emitted(69, 39) Source(65, 56) + SourceIndex(0) +9 >Emitted(69, 40) Source(65, 57) + SourceIndex(0) +10>Emitted(69, 42) Source(65, 41) + SourceIndex(0) +11>Emitted(69, 57) Source(65, 57) + SourceIndex(0) +12>Emitted(69, 59) Source(65, 41) + SourceIndex(0) +13>Emitted(69, 63) Source(65, 57) + SourceIndex(0) --- >>> var _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; 1->^^^^ @@ -1762,40 +1666,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [nameMA, [primarySkillA, secondarySkillA]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let [nameMA, [primarySkillA, secondarySkillA]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(73, 1) Source(68, 1) + SourceIndex(0) -2 >Emitted(73, 4) Source(68, 4) + SourceIndex(0) -3 >Emitted(73, 5) Source(68, 5) + SourceIndex(0) -4 >Emitted(73, 6) Source(68, 56) + SourceIndex(0) -5 >Emitted(73, 17) Source(68, 67) + SourceIndex(0) -6 >Emitted(73, 19) Source(68, 56) + SourceIndex(0) -7 >Emitted(73, 46) Source(68, 67) + SourceIndex(0) -8 >Emitted(73, 48) Source(68, 56) + SourceIndex(0) -9 >Emitted(73, 74) Source(68, 67) + SourceIndex(0) -10>Emitted(73, 76) Source(68, 56) + SourceIndex(0) -11>Emitted(73, 81) Source(68, 67) + SourceIndex(0) +2 >Emitted(73, 6) Source(68, 56) + SourceIndex(0) +3 >Emitted(73, 17) Source(68, 67) + SourceIndex(0) +4 >Emitted(73, 19) Source(68, 56) + SourceIndex(0) +5 >Emitted(73, 46) Source(68, 67) + SourceIndex(0) +6 >Emitted(73, 48) Source(68, 56) + SourceIndex(0) +7 >Emitted(73, 74) Source(68, 67) + SourceIndex(0) +8 >Emitted(73, 76) Source(68, 56) + SourceIndex(0) +9 >Emitted(73, 81) Source(68, 67) + SourceIndex(0) --- >>> var _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; 1->^^^^ @@ -1868,46 +1766,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [nameMA, [primarySkillA, secondarySkillA]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let [nameMA, [primarySkillA, secondarySkillA]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(77, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(77, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(77, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(77, 6) Source(71, 56) + SourceIndex(0) -5 >Emitted(77, 17) Source(71, 72) + SourceIndex(0) -6 >Emitted(77, 19) Source(71, 56) + SourceIndex(0) -7 >Emitted(77, 25) Source(71, 56) + SourceIndex(0) -8 >Emitted(77, 39) Source(71, 70) + SourceIndex(0) -9 >Emitted(77, 41) Source(71, 72) + SourceIndex(0) -10>Emitted(77, 43) Source(71, 56) + SourceIndex(0) -11>Emitted(77, 59) Source(71, 72) + SourceIndex(0) -12>Emitted(77, 61) Source(71, 56) + SourceIndex(0) -13>Emitted(77, 66) Source(71, 72) + SourceIndex(0) +2 >Emitted(77, 6) Source(71, 56) + SourceIndex(0) +3 >Emitted(77, 17) Source(71, 72) + SourceIndex(0) +4 >Emitted(77, 19) Source(71, 56) + SourceIndex(0) +5 >Emitted(77, 25) Source(71, 56) + SourceIndex(0) +6 >Emitted(77, 39) Source(71, 70) + SourceIndex(0) +7 >Emitted(77, 41) Source(71, 72) + SourceIndex(0) +8 >Emitted(77, 43) Source(71, 56) + SourceIndex(0) +9 >Emitted(77, 59) Source(71, 72) + SourceIndex(0) +10>Emitted(77, 61) Source(71, 56) + SourceIndex(0) +11>Emitted(77, 66) Source(71, 72) + SourceIndex(0) --- >>> var _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; 1->^^^^ @@ -1980,52 +1872,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [nameMA, [primarySkillA, secondarySkillA]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for (let [nameMA, [primarySkillA, secondarySkillA]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(81, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(81, 4) Source(74, 4) + SourceIndex(0) -3 >Emitted(81, 5) Source(74, 5) + SourceIndex(0) -4 >Emitted(81, 6) Source(74, 56) + SourceIndex(0) -5 >Emitted(81, 17) Source(74, 82) + SourceIndex(0) -6 >Emitted(81, 19) Source(74, 56) + SourceIndex(0) -7 >Emitted(81, 26) Source(74, 57) + SourceIndex(0) -8 >Emitted(81, 37) Source(74, 68) + SourceIndex(0) -9 >Emitted(81, 39) Source(74, 70) + SourceIndex(0) -10>Emitted(81, 50) Source(74, 81) + SourceIndex(0) -11>Emitted(81, 51) Source(74, 82) + SourceIndex(0) -12>Emitted(81, 53) Source(74, 56) + SourceIndex(0) -13>Emitted(81, 69) Source(74, 82) + SourceIndex(0) -14>Emitted(81, 71) Source(74, 56) + SourceIndex(0) -15>Emitted(81, 76) Source(74, 82) + SourceIndex(0) +2 >Emitted(81, 6) Source(74, 56) + SourceIndex(0) +3 >Emitted(81, 17) Source(74, 82) + SourceIndex(0) +4 >Emitted(81, 19) Source(74, 56) + SourceIndex(0) +5 >Emitted(81, 26) Source(74, 57) + SourceIndex(0) +6 >Emitted(81, 37) Source(74, 68) + SourceIndex(0) +7 >Emitted(81, 39) Source(74, 70) + SourceIndex(0) +8 >Emitted(81, 50) Source(74, 81) + SourceIndex(0) +9 >Emitted(81, 51) Source(74, 82) + SourceIndex(0) +10>Emitted(81, 53) Source(74, 56) + SourceIndex(0) +11>Emitted(81, 69) Source(74, 82) + SourceIndex(0) +12>Emitted(81, 71) Source(74, 56) + SourceIndex(0) +13>Emitted(81, 76) Source(74, 82) + SourceIndex(0) --- >>> var _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; 1->^^^^ @@ -2098,41 +1984,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > (let [numberA3, ...robotAInfo] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [numberA3, ...robotAInfo] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(85, 1) Source(78, 1) + SourceIndex(0) -2 >Emitted(85, 4) Source(78, 4) + SourceIndex(0) -3 >Emitted(85, 5) Source(78, 5) + SourceIndex(0) -4 >Emitted(85, 6) Source(78, 39) + SourceIndex(0) -5 >Emitted(85, 17) Source(78, 45) + SourceIndex(0) -6 >Emitted(85, 19) Source(78, 39) + SourceIndex(0) -7 >Emitted(85, 36) Source(78, 45) + SourceIndex(0) -8 >Emitted(85, 38) Source(78, 39) + SourceIndex(0) -9 >Emitted(85, 59) Source(78, 45) + SourceIndex(0) -10>Emitted(85, 61) Source(78, 39) + SourceIndex(0) -11>Emitted(85, 66) Source(78, 45) + SourceIndex(0) +2 >Emitted(85, 6) Source(78, 39) + SourceIndex(0) +3 >Emitted(85, 17) Source(78, 45) + SourceIndex(0) +4 >Emitted(85, 19) Source(78, 39) + SourceIndex(0) +5 >Emitted(85, 36) Source(78, 45) + SourceIndex(0) +6 >Emitted(85, 38) Source(78, 39) + SourceIndex(0) +7 >Emitted(85, 59) Source(78, 45) + SourceIndex(0) +8 >Emitted(85, 61) Source(78, 39) + SourceIndex(0) +9 >Emitted(85, 66) Source(78, 45) + SourceIndex(0) --- >>> var _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); 1->^^^^ @@ -2193,46 +2073,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA3, ...robotAInfo] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [numberA3, ...robotAInfo] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(89, 1) Source(81, 1) + SourceIndex(0) -2 >Emitted(89, 4) Source(81, 4) + SourceIndex(0) -3 >Emitted(89, 5) Source(81, 5) + SourceIndex(0) -4 >Emitted(89, 6) Source(81, 39) + SourceIndex(0) -5 >Emitted(89, 17) Source(81, 50) + SourceIndex(0) -6 >Emitted(89, 19) Source(81, 39) + SourceIndex(0) -7 >Emitted(89, 25) Source(81, 39) + SourceIndex(0) -8 >Emitted(89, 34) Source(81, 48) + SourceIndex(0) -9 >Emitted(89, 36) Source(81, 50) + SourceIndex(0) -10>Emitted(89, 38) Source(81, 39) + SourceIndex(0) -11>Emitted(89, 54) Source(81, 50) + SourceIndex(0) -12>Emitted(89, 56) Source(81, 39) + SourceIndex(0) -13>Emitted(89, 61) Source(81, 50) + SourceIndex(0) +2 >Emitted(89, 6) Source(81, 39) + SourceIndex(0) +3 >Emitted(89, 17) Source(81, 50) + SourceIndex(0) +4 >Emitted(89, 19) Source(81, 39) + SourceIndex(0) +5 >Emitted(89, 25) Source(81, 39) + SourceIndex(0) +6 >Emitted(89, 34) Source(81, 48) + SourceIndex(0) +7 >Emitted(89, 36) Source(81, 50) + SourceIndex(0) +8 >Emitted(89, 38) Source(81, 39) + SourceIndex(0) +9 >Emitted(89, 54) Source(81, 50) + SourceIndex(0) +10>Emitted(89, 56) Source(81, 39) + SourceIndex(0) +11>Emitted(89, 61) Source(81, 50) + SourceIndex(0) --- >>> var _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); 1->^^^^ @@ -2293,52 +2167,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA3, ...robotAInfo] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [numberA3, ...robotAInfo] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(93, 1) Source(84, 1) + SourceIndex(0) -2 >Emitted(93, 4) Source(84, 4) + SourceIndex(0) -3 >Emitted(93, 5) Source(84, 5) + SourceIndex(0) -4 >Emitted(93, 6) Source(84, 39) + SourceIndex(0) -5 >Emitted(93, 17) Source(84, 55) + SourceIndex(0) -6 >Emitted(93, 19) Source(84, 39) + SourceIndex(0) -7 >Emitted(93, 26) Source(84, 40) + SourceIndex(0) -8 >Emitted(93, 32) Source(84, 46) + SourceIndex(0) -9 >Emitted(93, 34) Source(84, 48) + SourceIndex(0) -10>Emitted(93, 40) Source(84, 54) + SourceIndex(0) -11>Emitted(93, 41) Source(84, 55) + SourceIndex(0) -12>Emitted(93, 43) Source(84, 39) + SourceIndex(0) -13>Emitted(93, 59) Source(84, 55) + SourceIndex(0) -14>Emitted(93, 61) Source(84, 39) + SourceIndex(0) -15>Emitted(93, 66) Source(84, 55) + SourceIndex(0) +2 >Emitted(93, 6) Source(84, 39) + SourceIndex(0) +3 >Emitted(93, 17) Source(84, 55) + SourceIndex(0) +4 >Emitted(93, 19) Source(84, 39) + SourceIndex(0) +5 >Emitted(93, 26) Source(84, 40) + SourceIndex(0) +6 >Emitted(93, 32) Source(84, 46) + SourceIndex(0) +7 >Emitted(93, 34) Source(84, 48) + SourceIndex(0) +8 >Emitted(93, 40) Source(84, 54) + SourceIndex(0) +9 >Emitted(93, 41) Source(84, 55) + SourceIndex(0) +10>Emitted(93, 43) Source(84, 39) + SourceIndex(0) +11>Emitted(93, 59) Source(84, 55) + SourceIndex(0) +12>Emitted(93, 61) Source(84, 39) + SourceIndex(0) +13>Emitted(93, 66) Source(84, 55) + SourceIndex(0) --- >>> var _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); 1->^^^^ @@ -2399,39 +2267,33 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ 1-> > -2 >for -3 > -4 > (let [...multiRobotAInfo] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let [...multiRobotAInfo] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(97, 1) Source(87, 1) + SourceIndex(0) -2 >Emitted(97, 4) Source(87, 4) + SourceIndex(0) -3 >Emitted(97, 5) Source(87, 5) + SourceIndex(0) -4 >Emitted(97, 6) Source(87, 34) + SourceIndex(0) -5 >Emitted(97, 17) Source(87, 45) + SourceIndex(0) -6 >Emitted(97, 19) Source(87, 34) + SourceIndex(0) -7 >Emitted(97, 46) Source(87, 45) + SourceIndex(0) -8 >Emitted(97, 48) Source(87, 34) + SourceIndex(0) -9 >Emitted(97, 74) Source(87, 45) + SourceIndex(0) -10>Emitted(97, 76) Source(87, 34) + SourceIndex(0) -11>Emitted(97, 81) Source(87, 45) + SourceIndex(0) +2 >Emitted(97, 6) Source(87, 34) + SourceIndex(0) +3 >Emitted(97, 17) Source(87, 45) + SourceIndex(0) +4 >Emitted(97, 19) Source(87, 34) + SourceIndex(0) +5 >Emitted(97, 46) Source(87, 45) + SourceIndex(0) +6 >Emitted(97, 48) Source(87, 34) + SourceIndex(0) +7 >Emitted(97, 74) Source(87, 45) + SourceIndex(0) +8 >Emitted(97, 76) Source(87, 34) + SourceIndex(0) +9 >Emitted(97, 81) Source(87, 45) + SourceIndex(0) --- >>> var multiRobotAInfo = multiRobots_4[_31].slice(0); 1 >^^^^ @@ -2480,45 +2342,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ 1-> > -2 >for -3 > -4 > (let [...multiRobotAInfo] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let [...multiRobotAInfo] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(101, 1) Source(90, 1) + SourceIndex(0) -2 >Emitted(101, 4) Source(90, 4) + SourceIndex(0) -3 >Emitted(101, 5) Source(90, 5) + SourceIndex(0) -4 >Emitted(101, 6) Source(90, 34) + SourceIndex(0) -5 >Emitted(101, 17) Source(90, 50) + SourceIndex(0) -6 >Emitted(101, 19) Source(90, 34) + SourceIndex(0) -7 >Emitted(101, 25) Source(90, 34) + SourceIndex(0) -8 >Emitted(101, 39) Source(90, 48) + SourceIndex(0) -9 >Emitted(101, 41) Source(90, 50) + SourceIndex(0) -10>Emitted(101, 43) Source(90, 34) + SourceIndex(0) -11>Emitted(101, 59) Source(90, 50) + SourceIndex(0) -12>Emitted(101, 61) Source(90, 34) + SourceIndex(0) -13>Emitted(101, 66) Source(90, 50) + SourceIndex(0) +2 >Emitted(101, 6) Source(90, 34) + SourceIndex(0) +3 >Emitted(101, 17) Source(90, 50) + SourceIndex(0) +4 >Emitted(101, 19) Source(90, 34) + SourceIndex(0) +5 >Emitted(101, 25) Source(90, 34) + SourceIndex(0) +6 >Emitted(101, 39) Source(90, 48) + SourceIndex(0) +7 >Emitted(101, 41) Source(90, 50) + SourceIndex(0) +8 >Emitted(101, 43) Source(90, 34) + SourceIndex(0) +9 >Emitted(101, 59) Source(90, 50) + SourceIndex(0) +10>Emitted(101, 61) Source(90, 34) + SourceIndex(0) +11>Emitted(101, 66) Source(90, 50) + SourceIndex(0) --- >>> var multiRobotAInfo = _33[_32].slice(0); 1 >^^^^ @@ -2567,51 +2423,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern.ts --- >>>for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ 1-> > -2 >for -3 > -4 > (let [...multiRobotAInfo] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for (let [...multiRobotAInfo] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(105, 1) Source(93, 1) + SourceIndex(0) -2 >Emitted(105, 4) Source(93, 4) + SourceIndex(0) -3 >Emitted(105, 5) Source(93, 5) + SourceIndex(0) -4 >Emitted(105, 6) Source(93, 34) + SourceIndex(0) -5 >Emitted(105, 17) Source(93, 60) + SourceIndex(0) -6 >Emitted(105, 19) Source(93, 34) + SourceIndex(0) -7 >Emitted(105, 26) Source(93, 35) + SourceIndex(0) -8 >Emitted(105, 37) Source(93, 46) + SourceIndex(0) -9 >Emitted(105, 39) Source(93, 48) + SourceIndex(0) -10>Emitted(105, 50) Source(93, 59) + SourceIndex(0) -11>Emitted(105, 51) Source(93, 60) + SourceIndex(0) -12>Emitted(105, 53) Source(93, 34) + SourceIndex(0) -13>Emitted(105, 69) Source(93, 60) + SourceIndex(0) -14>Emitted(105, 71) Source(93, 34) + SourceIndex(0) -15>Emitted(105, 76) Source(93, 60) + SourceIndex(0) +2 >Emitted(105, 6) Source(93, 34) + SourceIndex(0) +3 >Emitted(105, 17) Source(93, 60) + SourceIndex(0) +4 >Emitted(105, 19) Source(93, 34) + SourceIndex(0) +5 >Emitted(105, 26) Source(93, 35) + SourceIndex(0) +6 >Emitted(105, 37) Source(93, 46) + SourceIndex(0) +7 >Emitted(105, 39) Source(93, 48) + SourceIndex(0) +8 >Emitted(105, 50) Source(93, 59) + SourceIndex(0) +9 >Emitted(105, 51) Source(93, 60) + SourceIndex(0) +10>Emitted(105, 53) Source(93, 34) + SourceIndex(0) +11>Emitted(105, 69) Source(93, 60) + SourceIndex(0) +12>Emitted(105, 71) Source(93, 34) + SourceIndex(0) +13>Emitted(105, 76) Source(93, 60) + SourceIndex(0) --- >>> var multiRobotAInfo = _35[_34].slice(0); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map index 1a42ddf3907..65dd50f9c59 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfArrayBindingPattern2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,GAAG,CAAC,CAAc,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAAhB,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAc,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAArB,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAc,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;iBAA1B,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;4BAAhD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAAyC,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;iBAArD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAAyC,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;iBAA/D,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAc,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlB,yBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAc,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvB,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAc,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAA5B,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAY,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArB,4BAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1B,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAApC,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAAgC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAApC,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAgC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAAzC,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAAgC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB;mBAA9C,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BAAxD,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAA7D,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA+C,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;oBAAvE,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAA8B,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAAlC,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA8B,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAAvC,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA8B,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;oBAA5C,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAlC,6CAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAAyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAAvC,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,GAAG,CAAC,CAAyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAAjD,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPattern2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,KAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAAhB,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAArB,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;iBAA1B,aAAK;IACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA6C,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;4BAAhD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAA6C,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;iBAArD,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAA6C,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;iBAA/D,UAAgC,EAA/B,qBAAa,EAAE,uBAAe;IACnC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAAkB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlB,yBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAkB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvB,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAkB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAA5B,mBAAO;IACT,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAgB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArB,4BAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1B,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAApC,iBAAK;IACP,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAoC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAApC,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAoC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAAzC,gBAAQ,EAAE,cAAM,EAAE,eAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAoC,UAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,eAAgB,EAAhB,IAAgB;mBAA9C,iBAAQ,EAAE,eAAM,EAAE,gBAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAmD,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BAAxD,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAmD,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAA7D,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAmD,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;oBAAvE,eAAM,EAAE,YAAgC,EAA/B,sBAAa,EAAE,wBAAe;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAAkC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAAlC,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAkC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAAvC,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAkC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;oBAA5C,iBAAQ,EAAE,yBAAa;IACzB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAA6B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAlC,6CAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAA6B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAAvC,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC;AACD,KAA6B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAAjD,mCAAkB;IACpB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;CAChC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt index f670f9eda1f..161ecb025cd 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.sourcemap.txt @@ -134,21 +134,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) --- >>>} 1 > @@ -294,21 +291,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) -4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) -5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +4 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) --- >>>} 1 > @@ -434,40 +428,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > -2 >for -3 > -4 > ([, nameA] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([, nameA] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(17, 4) Source(26, 4) + SourceIndex(0) -3 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) -4 >Emitted(17, 6) Source(26, 19) + SourceIndex(0) -5 >Emitted(17, 16) Source(26, 25) + SourceIndex(0) -6 >Emitted(17, 18) Source(26, 19) + SourceIndex(0) -7 >Emitted(17, 35) Source(26, 25) + SourceIndex(0) -8 >Emitted(17, 37) Source(26, 19) + SourceIndex(0) -9 >Emitted(17, 57) Source(26, 25) + SourceIndex(0) -10>Emitted(17, 59) Source(26, 19) + SourceIndex(0) -11>Emitted(17, 63) Source(26, 25) + SourceIndex(0) +2 >Emitted(17, 6) Source(26, 19) + SourceIndex(0) +3 >Emitted(17, 16) Source(26, 25) + SourceIndex(0) +4 >Emitted(17, 18) Source(26, 19) + SourceIndex(0) +5 >Emitted(17, 35) Source(26, 25) + SourceIndex(0) +6 >Emitted(17, 37) Source(26, 19) + SourceIndex(0) +7 >Emitted(17, 57) Source(26, 25) + SourceIndex(0) +8 >Emitted(17, 59) Source(26, 19) + SourceIndex(0) +9 >Emitted(17, 63) Source(26, 25) + SourceIndex(0) --- >>> _a = robots_1[_i], nameA = _a[1]; 1 >^^^^^^^^^^^^^^^^^^^^^^^ @@ -513,45 +501,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > ([, nameA] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([, nameA] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(21, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(29, 19) + SourceIndex(0) -5 >Emitted(21, 16) Source(29, 30) + SourceIndex(0) -6 >Emitted(21, 18) Source(29, 19) + SourceIndex(0) -7 >Emitted(21, 23) Source(29, 19) + SourceIndex(0) -8 >Emitted(21, 32) Source(29, 28) + SourceIndex(0) -9 >Emitted(21, 34) Source(29, 30) + SourceIndex(0) -10>Emitted(21, 36) Source(29, 19) + SourceIndex(0) -11>Emitted(21, 50) Source(29, 30) + SourceIndex(0) -12>Emitted(21, 52) Source(29, 19) + SourceIndex(0) -13>Emitted(21, 56) Source(29, 30) + SourceIndex(0) +2 >Emitted(21, 6) Source(29, 19) + SourceIndex(0) +3 >Emitted(21, 16) Source(29, 30) + SourceIndex(0) +4 >Emitted(21, 18) Source(29, 19) + SourceIndex(0) +5 >Emitted(21, 23) Source(29, 19) + SourceIndex(0) +6 >Emitted(21, 32) Source(29, 28) + SourceIndex(0) +7 >Emitted(21, 34) Source(29, 30) + SourceIndex(0) +8 >Emitted(21, 36) Source(29, 19) + SourceIndex(0) +9 >Emitted(21, 50) Source(29, 30) + SourceIndex(0) +10>Emitted(21, 52) Source(29, 19) + SourceIndex(0) +11>Emitted(21, 56) Source(29, 30) + SourceIndex(0) --- >>> _d = _c[_b], nameA = _d[1]; 1 >^^^^^^^^^^^^^^^^^ @@ -597,51 +579,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _e = 0, _f = [robotA, robotB]; _e < _f.length; _e++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ 1-> > -2 >for -3 > -4 > ([, nameA] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([, nameA] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(25, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(25, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(25, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(25, 6) Source(32, 19) + SourceIndex(0) -5 >Emitted(25, 16) Source(32, 35) + SourceIndex(0) -6 >Emitted(25, 18) Source(32, 19) + SourceIndex(0) -7 >Emitted(25, 24) Source(32, 20) + SourceIndex(0) -8 >Emitted(25, 30) Source(32, 26) + SourceIndex(0) -9 >Emitted(25, 32) Source(32, 28) + SourceIndex(0) -10>Emitted(25, 38) Source(32, 34) + SourceIndex(0) -11>Emitted(25, 39) Source(32, 35) + SourceIndex(0) -12>Emitted(25, 41) Source(32, 19) + SourceIndex(0) -13>Emitted(25, 55) Source(32, 35) + SourceIndex(0) -14>Emitted(25, 57) Source(32, 19) + SourceIndex(0) -15>Emitted(25, 61) Source(32, 35) + SourceIndex(0) +2 >Emitted(25, 6) Source(32, 19) + SourceIndex(0) +3 >Emitted(25, 16) Source(32, 35) + SourceIndex(0) +4 >Emitted(25, 18) Source(32, 19) + SourceIndex(0) +5 >Emitted(25, 24) Source(32, 20) + SourceIndex(0) +6 >Emitted(25, 30) Source(32, 26) + SourceIndex(0) +7 >Emitted(25, 32) Source(32, 28) + SourceIndex(0) +8 >Emitted(25, 38) Source(32, 34) + SourceIndex(0) +9 >Emitted(25, 39) Source(32, 35) + SourceIndex(0) +10>Emitted(25, 41) Source(32, 19) + SourceIndex(0) +11>Emitted(25, 55) Source(32, 35) + SourceIndex(0) +12>Emitted(25, 57) Source(32, 19) + SourceIndex(0) +13>Emitted(25, 61) Source(32, 35) + SourceIndex(0) --- >>> _g = _f[_e], nameA = _g[1]; 1 >^^^^^^^^^^^^^^^^^ @@ -687,40 +663,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, [primarySkillA, secondarySkillA]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ([, [primarySkillA, secondarySkillA]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(29, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(29, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(29, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(29, 6) Source(35, 46) + SourceIndex(0) -5 >Emitted(29, 16) Source(35, 57) + SourceIndex(0) -6 >Emitted(29, 18) Source(35, 46) + SourceIndex(0) -7 >Emitted(29, 45) Source(35, 57) + SourceIndex(0) -8 >Emitted(29, 47) Source(35, 46) + SourceIndex(0) -9 >Emitted(29, 72) Source(35, 57) + SourceIndex(0) -10>Emitted(29, 74) Source(35, 46) + SourceIndex(0) -11>Emitted(29, 78) Source(35, 57) + SourceIndex(0) +2 >Emitted(29, 6) Source(35, 46) + SourceIndex(0) +3 >Emitted(29, 16) Source(35, 57) + SourceIndex(0) +4 >Emitted(29, 18) Source(35, 46) + SourceIndex(0) +5 >Emitted(29, 45) Source(35, 57) + SourceIndex(0) +6 >Emitted(29, 47) Source(35, 46) + SourceIndex(0) +7 >Emitted(29, 72) Source(35, 57) + SourceIndex(0) +8 >Emitted(29, 74) Source(35, 46) + SourceIndex(0) +9 >Emitted(29, 78) Source(35, 57) + SourceIndex(0) --- >>> _j = multiRobots_1[_h], _k = _j[1], primarySkillA = _k[0], secondarySkillA = _k[1]; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -778,46 +748,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _l = 0, _m = getMultiRobots(); _l < _m.length; _l++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, [primarySkillA, secondarySkillA]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ([, [primarySkillA, secondarySkillA]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(33, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(38, 46) + SourceIndex(0) -5 >Emitted(33, 16) Source(38, 62) + SourceIndex(0) -6 >Emitted(33, 18) Source(38, 46) + SourceIndex(0) -7 >Emitted(33, 23) Source(38, 46) + SourceIndex(0) -8 >Emitted(33, 37) Source(38, 60) + SourceIndex(0) -9 >Emitted(33, 39) Source(38, 62) + SourceIndex(0) -10>Emitted(33, 41) Source(38, 46) + SourceIndex(0) -11>Emitted(33, 55) Source(38, 62) + SourceIndex(0) -12>Emitted(33, 57) Source(38, 46) + SourceIndex(0) -13>Emitted(33, 61) Source(38, 62) + SourceIndex(0) +2 >Emitted(33, 6) Source(38, 46) + SourceIndex(0) +3 >Emitted(33, 16) Source(38, 62) + SourceIndex(0) +4 >Emitted(33, 18) Source(38, 46) + SourceIndex(0) +5 >Emitted(33, 23) Source(38, 46) + SourceIndex(0) +6 >Emitted(33, 37) Source(38, 60) + SourceIndex(0) +7 >Emitted(33, 39) Source(38, 62) + SourceIndex(0) +8 >Emitted(33, 41) Source(38, 46) + SourceIndex(0) +9 >Emitted(33, 55) Source(38, 62) + SourceIndex(0) +10>Emitted(33, 57) Source(38, 46) + SourceIndex(0) +11>Emitted(33, 61) Source(38, 62) + SourceIndex(0) --- >>> _o = _m[_l], _p = _o[1], primarySkillA = _p[0], secondarySkillA = _p[1]; 1->^^^^^^^^^^^^^^^^^ @@ -875,52 +839,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _q = 0, _r = [multiRobotA, multiRobotB]; _q < _r.length; _q++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, [primarySkillA, secondarySkillA]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for ([, [primarySkillA, secondarySkillA]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(37, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(41, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(41, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(41, 46) + SourceIndex(0) -5 >Emitted(37, 16) Source(41, 72) + SourceIndex(0) -6 >Emitted(37, 18) Source(41, 46) + SourceIndex(0) -7 >Emitted(37, 24) Source(41, 47) + SourceIndex(0) -8 >Emitted(37, 35) Source(41, 58) + SourceIndex(0) -9 >Emitted(37, 37) Source(41, 60) + SourceIndex(0) -10>Emitted(37, 48) Source(41, 71) + SourceIndex(0) -11>Emitted(37, 49) Source(41, 72) + SourceIndex(0) -12>Emitted(37, 51) Source(41, 46) + SourceIndex(0) -13>Emitted(37, 65) Source(41, 72) + SourceIndex(0) -14>Emitted(37, 67) Source(41, 46) + SourceIndex(0) -15>Emitted(37, 71) Source(41, 72) + SourceIndex(0) +2 >Emitted(37, 6) Source(41, 46) + SourceIndex(0) +3 >Emitted(37, 16) Source(41, 72) + SourceIndex(0) +4 >Emitted(37, 18) Source(41, 46) + SourceIndex(0) +5 >Emitted(37, 24) Source(41, 47) + SourceIndex(0) +6 >Emitted(37, 35) Source(41, 58) + SourceIndex(0) +7 >Emitted(37, 37) Source(41, 60) + SourceIndex(0) +8 >Emitted(37, 48) Source(41, 71) + SourceIndex(0) +9 >Emitted(37, 49) Source(41, 72) + SourceIndex(0) +10>Emitted(37, 51) Source(41, 46) + SourceIndex(0) +11>Emitted(37, 65) Source(41, 72) + SourceIndex(0) +12>Emitted(37, 67) Source(41, 46) + SourceIndex(0) +13>Emitted(37, 71) Source(41, 72) + SourceIndex(0) --- >>> _s = _r[_q], _t = _s[1], primarySkillA = _t[0], secondarySkillA = _t[1]; 1->^^^^^^^^^^^^^^^^^ @@ -978,40 +936,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _u = 0, robots_2 = robots; _u < robots_2.length; _u++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > -2 >for -3 > -4 > ([numberB] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([numberB] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(41, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(41, 4) Source(45, 4) + SourceIndex(0) -3 >Emitted(41, 5) Source(45, 5) + SourceIndex(0) -4 >Emitted(41, 6) Source(45, 19) + SourceIndex(0) -5 >Emitted(41, 16) Source(45, 25) + SourceIndex(0) -6 >Emitted(41, 18) Source(45, 19) + SourceIndex(0) -7 >Emitted(41, 35) Source(45, 25) + SourceIndex(0) -8 >Emitted(41, 37) Source(45, 19) + SourceIndex(0) -9 >Emitted(41, 57) Source(45, 25) + SourceIndex(0) -10>Emitted(41, 59) Source(45, 19) + SourceIndex(0) -11>Emitted(41, 63) Source(45, 25) + SourceIndex(0) +2 >Emitted(41, 6) Source(45, 19) + SourceIndex(0) +3 >Emitted(41, 16) Source(45, 25) + SourceIndex(0) +4 >Emitted(41, 18) Source(45, 19) + SourceIndex(0) +5 >Emitted(41, 35) Source(45, 25) + SourceIndex(0) +6 >Emitted(41, 37) Source(45, 19) + SourceIndex(0) +7 >Emitted(41, 57) Source(45, 25) + SourceIndex(0) +8 >Emitted(41, 59) Source(45, 19) + SourceIndex(0) +9 >Emitted(41, 63) Source(45, 25) + SourceIndex(0) --- >>> numberB = robots_2[_u][0]; 1 >^^^^ @@ -1057,45 +1009,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _v = 0, _w = getRobots(); _v < _w.length; _v++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > ([numberB] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([numberB] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(45, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(48, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(48, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(48, 19) + SourceIndex(0) -5 >Emitted(45, 16) Source(48, 30) + SourceIndex(0) -6 >Emitted(45, 18) Source(48, 19) + SourceIndex(0) -7 >Emitted(45, 23) Source(48, 19) + SourceIndex(0) -8 >Emitted(45, 32) Source(48, 28) + SourceIndex(0) -9 >Emitted(45, 34) Source(48, 30) + SourceIndex(0) -10>Emitted(45, 36) Source(48, 19) + SourceIndex(0) -11>Emitted(45, 50) Source(48, 30) + SourceIndex(0) -12>Emitted(45, 52) Source(48, 19) + SourceIndex(0) -13>Emitted(45, 56) Source(48, 30) + SourceIndex(0) +2 >Emitted(45, 6) Source(48, 19) + SourceIndex(0) +3 >Emitted(45, 16) Source(48, 30) + SourceIndex(0) +4 >Emitted(45, 18) Source(48, 19) + SourceIndex(0) +5 >Emitted(45, 23) Source(48, 19) + SourceIndex(0) +6 >Emitted(45, 32) Source(48, 28) + SourceIndex(0) +7 >Emitted(45, 34) Source(48, 30) + SourceIndex(0) +8 >Emitted(45, 36) Source(48, 19) + SourceIndex(0) +9 >Emitted(45, 50) Source(48, 30) + SourceIndex(0) +10>Emitted(45, 52) Source(48, 19) + SourceIndex(0) +11>Emitted(45, 56) Source(48, 30) + SourceIndex(0) --- >>> numberB = _w[_v][0]; 1 >^^^^ @@ -1142,51 +1088,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _x = 0, _y = [robotA, robotB]; _x < _y.length; _x++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ 1-> > -2 >for -3 > -4 > ([numberB] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([numberB] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(49, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(51, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(51, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(51, 19) + SourceIndex(0) -5 >Emitted(49, 16) Source(51, 35) + SourceIndex(0) -6 >Emitted(49, 18) Source(51, 19) + SourceIndex(0) -7 >Emitted(49, 24) Source(51, 20) + SourceIndex(0) -8 >Emitted(49, 30) Source(51, 26) + SourceIndex(0) -9 >Emitted(49, 32) Source(51, 28) + SourceIndex(0) -10>Emitted(49, 38) Source(51, 34) + SourceIndex(0) -11>Emitted(49, 39) Source(51, 35) + SourceIndex(0) -12>Emitted(49, 41) Source(51, 19) + SourceIndex(0) -13>Emitted(49, 55) Source(51, 35) + SourceIndex(0) -14>Emitted(49, 57) Source(51, 19) + SourceIndex(0) -15>Emitted(49, 61) Source(51, 35) + SourceIndex(0) +2 >Emitted(49, 6) Source(51, 19) + SourceIndex(0) +3 >Emitted(49, 16) Source(51, 35) + SourceIndex(0) +4 >Emitted(49, 18) Source(51, 19) + SourceIndex(0) +5 >Emitted(49, 24) Source(51, 20) + SourceIndex(0) +6 >Emitted(49, 30) Source(51, 26) + SourceIndex(0) +7 >Emitted(49, 32) Source(51, 28) + SourceIndex(0) +8 >Emitted(49, 38) Source(51, 34) + SourceIndex(0) +9 >Emitted(49, 39) Source(51, 35) + SourceIndex(0) +10>Emitted(49, 41) Source(51, 19) + SourceIndex(0) +11>Emitted(49, 55) Source(51, 35) + SourceIndex(0) +12>Emitted(49, 57) Source(51, 19) + SourceIndex(0) +13>Emitted(49, 61) Source(51, 35) + SourceIndex(0) --- >>> numberB = _y[_x][0]; 1 >^^^^ @@ -1233,39 +1173,33 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _z = 0, multiRobots_2 = multiRobots; _z < multiRobots_2.length; _z++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > -2 >for -3 > -4 > ([nameB] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ([nameB] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(53, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(53, 4) Source(54, 4) + SourceIndex(0) -3 >Emitted(53, 5) Source(54, 5) + SourceIndex(0) -4 >Emitted(53, 6) Source(54, 17) + SourceIndex(0) -5 >Emitted(53, 16) Source(54, 28) + SourceIndex(0) -6 >Emitted(53, 18) Source(54, 17) + SourceIndex(0) -7 >Emitted(53, 45) Source(54, 28) + SourceIndex(0) -8 >Emitted(53, 47) Source(54, 17) + SourceIndex(0) -9 >Emitted(53, 72) Source(54, 28) + SourceIndex(0) -10>Emitted(53, 74) Source(54, 17) + SourceIndex(0) -11>Emitted(53, 78) Source(54, 28) + SourceIndex(0) +2 >Emitted(53, 6) Source(54, 17) + SourceIndex(0) +3 >Emitted(53, 16) Source(54, 28) + SourceIndex(0) +4 >Emitted(53, 18) Source(54, 17) + SourceIndex(0) +5 >Emitted(53, 45) Source(54, 28) + SourceIndex(0) +6 >Emitted(53, 47) Source(54, 17) + SourceIndex(0) +7 >Emitted(53, 72) Source(54, 28) + SourceIndex(0) +8 >Emitted(53, 74) Source(54, 17) + SourceIndex(0) +9 >Emitted(53, 78) Source(54, 28) + SourceIndex(0) --- >>> nameB = multiRobots_2[_z][0]; 1 >^^^^ @@ -1311,45 +1245,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _0 = 0, _1 = getMultiRobots(); _0 < _1.length; _0++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > ([nameB] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ([nameB] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(57, 1) Source(57, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(57, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(57, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(57, 17) + SourceIndex(0) -5 >Emitted(57, 16) Source(57, 33) + SourceIndex(0) -6 >Emitted(57, 18) Source(57, 17) + SourceIndex(0) -7 >Emitted(57, 23) Source(57, 17) + SourceIndex(0) -8 >Emitted(57, 37) Source(57, 31) + SourceIndex(0) -9 >Emitted(57, 39) Source(57, 33) + SourceIndex(0) -10>Emitted(57, 41) Source(57, 17) + SourceIndex(0) -11>Emitted(57, 55) Source(57, 33) + SourceIndex(0) -12>Emitted(57, 57) Source(57, 17) + SourceIndex(0) -13>Emitted(57, 61) Source(57, 33) + SourceIndex(0) +2 >Emitted(57, 6) Source(57, 17) + SourceIndex(0) +3 >Emitted(57, 16) Source(57, 33) + SourceIndex(0) +4 >Emitted(57, 18) Source(57, 17) + SourceIndex(0) +5 >Emitted(57, 23) Source(57, 17) + SourceIndex(0) +6 >Emitted(57, 37) Source(57, 31) + SourceIndex(0) +7 >Emitted(57, 39) Source(57, 33) + SourceIndex(0) +8 >Emitted(57, 41) Source(57, 17) + SourceIndex(0) +9 >Emitted(57, 55) Source(57, 33) + SourceIndex(0) +10>Emitted(57, 57) Source(57, 17) + SourceIndex(0) +11>Emitted(57, 61) Source(57, 33) + SourceIndex(0) --- >>> nameB = _1[_0][0]; 1 >^^^^ @@ -1396,51 +1324,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _2 = 0, _3 = [multiRobotA, multiRobotB]; _2 < _3.length; _2++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ 1-> > -2 >for -3 > -4 > ([nameB] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for ([nameB] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(61, 1) Source(60, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(60, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(60, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(60, 17) + SourceIndex(0) -5 >Emitted(61, 16) Source(60, 43) + SourceIndex(0) -6 >Emitted(61, 18) Source(60, 17) + SourceIndex(0) -7 >Emitted(61, 24) Source(60, 18) + SourceIndex(0) -8 >Emitted(61, 35) Source(60, 29) + SourceIndex(0) -9 >Emitted(61, 37) Source(60, 31) + SourceIndex(0) -10>Emitted(61, 48) Source(60, 42) + SourceIndex(0) -11>Emitted(61, 49) Source(60, 43) + SourceIndex(0) -12>Emitted(61, 51) Source(60, 17) + SourceIndex(0) -13>Emitted(61, 65) Source(60, 43) + SourceIndex(0) -14>Emitted(61, 67) Source(60, 17) + SourceIndex(0) -15>Emitted(61, 71) Source(60, 43) + SourceIndex(0) +2 >Emitted(61, 6) Source(60, 17) + SourceIndex(0) +3 >Emitted(61, 16) Source(60, 43) + SourceIndex(0) +4 >Emitted(61, 18) Source(60, 17) + SourceIndex(0) +5 >Emitted(61, 24) Source(60, 18) + SourceIndex(0) +6 >Emitted(61, 35) Source(60, 29) + SourceIndex(0) +7 >Emitted(61, 37) Source(60, 31) + SourceIndex(0) +8 >Emitted(61, 48) Source(60, 42) + SourceIndex(0) +9 >Emitted(61, 49) Source(60, 43) + SourceIndex(0) +10>Emitted(61, 51) Source(60, 17) + SourceIndex(0) +11>Emitted(61, 65) Source(60, 43) + SourceIndex(0) +12>Emitted(61, 67) Source(60, 17) + SourceIndex(0) +13>Emitted(61, 71) Source(60, 43) + SourceIndex(0) --- >>> nameB = _3[_2][0]; 1 >^^^^ @@ -1487,41 +1409,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _4 = 0, robots_3 = robots; _4 < robots_3.length; _4++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > ([numberA2, nameA2, skillA2] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([numberA2, nameA2, skillA2] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(65, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(65, 4) Source(64, 4) + SourceIndex(0) -3 >Emitted(65, 5) Source(64, 5) + SourceIndex(0) -4 >Emitted(65, 6) Source(64, 37) + SourceIndex(0) -5 >Emitted(65, 16) Source(64, 43) + SourceIndex(0) -6 >Emitted(65, 18) Source(64, 37) + SourceIndex(0) -7 >Emitted(65, 35) Source(64, 43) + SourceIndex(0) -8 >Emitted(65, 37) Source(64, 37) + SourceIndex(0) -9 >Emitted(65, 57) Source(64, 43) + SourceIndex(0) -10>Emitted(65, 59) Source(64, 37) + SourceIndex(0) -11>Emitted(65, 63) Source(64, 43) + SourceIndex(0) +2 >Emitted(65, 6) Source(64, 37) + SourceIndex(0) +3 >Emitted(65, 16) Source(64, 43) + SourceIndex(0) +4 >Emitted(65, 18) Source(64, 37) + SourceIndex(0) +5 >Emitted(65, 35) Source(64, 43) + SourceIndex(0) +6 >Emitted(65, 37) Source(64, 37) + SourceIndex(0) +7 >Emitted(65, 57) Source(64, 43) + SourceIndex(0) +8 >Emitted(65, 59) Source(64, 37) + SourceIndex(0) +9 >Emitted(65, 63) Source(64, 43) + SourceIndex(0) --- >>> _5 = robots_3[_4], numberA2 = _5[0], nameA2 = _5[1], skillA2 = _5[2]; 1->^^^^^^^^^^^^^^^^^^^^^^^ @@ -1579,46 +1495,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _6 = 0, _7 = getRobots(); _6 < _7.length; _6++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([numberA2, nameA2, skillA2] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([numberA2, nameA2, skillA2] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(69, 1) Source(67, 1) + SourceIndex(0) -2 >Emitted(69, 4) Source(67, 4) + SourceIndex(0) -3 >Emitted(69, 5) Source(67, 5) + SourceIndex(0) -4 >Emitted(69, 6) Source(67, 37) + SourceIndex(0) -5 >Emitted(69, 16) Source(67, 48) + SourceIndex(0) -6 >Emitted(69, 18) Source(67, 37) + SourceIndex(0) -7 >Emitted(69, 23) Source(67, 37) + SourceIndex(0) -8 >Emitted(69, 32) Source(67, 46) + SourceIndex(0) -9 >Emitted(69, 34) Source(67, 48) + SourceIndex(0) -10>Emitted(69, 36) Source(67, 37) + SourceIndex(0) -11>Emitted(69, 50) Source(67, 48) + SourceIndex(0) -12>Emitted(69, 52) Source(67, 37) + SourceIndex(0) -13>Emitted(69, 56) Source(67, 48) + SourceIndex(0) +2 >Emitted(69, 6) Source(67, 37) + SourceIndex(0) +3 >Emitted(69, 16) Source(67, 48) + SourceIndex(0) +4 >Emitted(69, 18) Source(67, 37) + SourceIndex(0) +5 >Emitted(69, 23) Source(67, 37) + SourceIndex(0) +6 >Emitted(69, 32) Source(67, 46) + SourceIndex(0) +7 >Emitted(69, 34) Source(67, 48) + SourceIndex(0) +8 >Emitted(69, 36) Source(67, 37) + SourceIndex(0) +9 >Emitted(69, 50) Source(67, 48) + SourceIndex(0) +10>Emitted(69, 52) Source(67, 37) + SourceIndex(0) +11>Emitted(69, 56) Source(67, 48) + SourceIndex(0) --- >>> _8 = _7[_6], numberA2 = _8[0], nameA2 = _8[1], skillA2 = _8[2]; 1->^^^^^^^^^^^^^^^^^ @@ -1676,52 +1586,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _9 = 0, _10 = [robotA, robotB]; _9 < _10.length; _9++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([numberA2, nameA2, skillA2] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([numberA2, nameA2, skillA2] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(73, 1) Source(70, 1) + SourceIndex(0) -2 >Emitted(73, 4) Source(70, 4) + SourceIndex(0) -3 >Emitted(73, 5) Source(70, 5) + SourceIndex(0) -4 >Emitted(73, 6) Source(70, 37) + SourceIndex(0) -5 >Emitted(73, 16) Source(70, 53) + SourceIndex(0) -6 >Emitted(73, 18) Source(70, 37) + SourceIndex(0) -7 >Emitted(73, 25) Source(70, 38) + SourceIndex(0) -8 >Emitted(73, 31) Source(70, 44) + SourceIndex(0) -9 >Emitted(73, 33) Source(70, 46) + SourceIndex(0) -10>Emitted(73, 39) Source(70, 52) + SourceIndex(0) -11>Emitted(73, 40) Source(70, 53) + SourceIndex(0) -12>Emitted(73, 42) Source(70, 37) + SourceIndex(0) -13>Emitted(73, 57) Source(70, 53) + SourceIndex(0) -14>Emitted(73, 59) Source(70, 37) + SourceIndex(0) -15>Emitted(73, 63) Source(70, 53) + SourceIndex(0) +2 >Emitted(73, 6) Source(70, 37) + SourceIndex(0) +3 >Emitted(73, 16) Source(70, 53) + SourceIndex(0) +4 >Emitted(73, 18) Source(70, 37) + SourceIndex(0) +5 >Emitted(73, 25) Source(70, 38) + SourceIndex(0) +6 >Emitted(73, 31) Source(70, 44) + SourceIndex(0) +7 >Emitted(73, 33) Source(70, 46) + SourceIndex(0) +8 >Emitted(73, 39) Source(70, 52) + SourceIndex(0) +9 >Emitted(73, 40) Source(70, 53) + SourceIndex(0) +10>Emitted(73, 42) Source(70, 37) + SourceIndex(0) +11>Emitted(73, 57) Source(70, 53) + SourceIndex(0) +12>Emitted(73, 59) Source(70, 37) + SourceIndex(0) +13>Emitted(73, 63) Source(70, 53) + SourceIndex(0) --- >>> _11 = _10[_9], numberA2 = _11[0], nameA2 = _11[1], skillA2 = _11[2]; 1->^^^^^^^^^^^^^^^^^^^ @@ -1779,40 +1683,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _12 = 0, multiRobots_3 = multiRobots; _12 < multiRobots_3.length; _12++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([nameMA, [primarySkillA, secondarySkillA]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ([nameMA, [primarySkillA, secondarySkillA]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(77, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(77, 4) Source(73, 4) + SourceIndex(0) -3 >Emitted(77, 5) Source(73, 5) + SourceIndex(0) -4 >Emitted(77, 6) Source(73, 52) + SourceIndex(0) -5 >Emitted(77, 17) Source(73, 63) + SourceIndex(0) -6 >Emitted(77, 19) Source(73, 52) + SourceIndex(0) -7 >Emitted(77, 46) Source(73, 63) + SourceIndex(0) -8 >Emitted(77, 48) Source(73, 52) + SourceIndex(0) -9 >Emitted(77, 74) Source(73, 63) + SourceIndex(0) -10>Emitted(77, 76) Source(73, 52) + SourceIndex(0) -11>Emitted(77, 81) Source(73, 63) + SourceIndex(0) +2 >Emitted(77, 6) Source(73, 52) + SourceIndex(0) +3 >Emitted(77, 17) Source(73, 63) + SourceIndex(0) +4 >Emitted(77, 19) Source(73, 52) + SourceIndex(0) +5 >Emitted(77, 46) Source(73, 63) + SourceIndex(0) +6 >Emitted(77, 48) Source(73, 52) + SourceIndex(0) +7 >Emitted(77, 74) Source(73, 63) + SourceIndex(0) +8 >Emitted(77, 76) Source(73, 52) + SourceIndex(0) +9 >Emitted(77, 81) Source(73, 63) + SourceIndex(0) --- >>> _13 = multiRobots_3[_12], nameMA = _13[0], _14 = _13[1], primarySkillA = _14[0], secondarySkillA = _14[1]; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1876,46 +1774,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _15 = 0, _16 = getMultiRobots(); _15 < _16.length; _15++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([nameMA, [primarySkillA, secondarySkillA]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ([nameMA, [primarySkillA, secondarySkillA]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(81, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(81, 4) Source(76, 4) + SourceIndex(0) -3 >Emitted(81, 5) Source(76, 5) + SourceIndex(0) -4 >Emitted(81, 6) Source(76, 52) + SourceIndex(0) -5 >Emitted(81, 17) Source(76, 68) + SourceIndex(0) -6 >Emitted(81, 19) Source(76, 52) + SourceIndex(0) -7 >Emitted(81, 25) Source(76, 52) + SourceIndex(0) -8 >Emitted(81, 39) Source(76, 66) + SourceIndex(0) -9 >Emitted(81, 41) Source(76, 68) + SourceIndex(0) -10>Emitted(81, 43) Source(76, 52) + SourceIndex(0) -11>Emitted(81, 59) Source(76, 68) + SourceIndex(0) -12>Emitted(81, 61) Source(76, 52) + SourceIndex(0) -13>Emitted(81, 66) Source(76, 68) + SourceIndex(0) +2 >Emitted(81, 6) Source(76, 52) + SourceIndex(0) +3 >Emitted(81, 17) Source(76, 68) + SourceIndex(0) +4 >Emitted(81, 19) Source(76, 52) + SourceIndex(0) +5 >Emitted(81, 25) Source(76, 52) + SourceIndex(0) +6 >Emitted(81, 39) Source(76, 66) + SourceIndex(0) +7 >Emitted(81, 41) Source(76, 68) + SourceIndex(0) +8 >Emitted(81, 43) Source(76, 52) + SourceIndex(0) +9 >Emitted(81, 59) Source(76, 68) + SourceIndex(0) +10>Emitted(81, 61) Source(76, 52) + SourceIndex(0) +11>Emitted(81, 66) Source(76, 68) + SourceIndex(0) --- >>> _17 = _16[_15], nameMA = _17[0], _18 = _17[1], primarySkillA = _18[0], secondarySkillA = _18[1]; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1979,52 +1871,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([nameMA, [primarySkillA, secondarySkillA]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for ([nameMA, [primarySkillA, secondarySkillA]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(85, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(85, 4) Source(79, 4) + SourceIndex(0) -3 >Emitted(85, 5) Source(79, 5) + SourceIndex(0) -4 >Emitted(85, 6) Source(79, 52) + SourceIndex(0) -5 >Emitted(85, 17) Source(79, 78) + SourceIndex(0) -6 >Emitted(85, 19) Source(79, 52) + SourceIndex(0) -7 >Emitted(85, 26) Source(79, 53) + SourceIndex(0) -8 >Emitted(85, 37) Source(79, 64) + SourceIndex(0) -9 >Emitted(85, 39) Source(79, 66) + SourceIndex(0) -10>Emitted(85, 50) Source(79, 77) + SourceIndex(0) -11>Emitted(85, 51) Source(79, 78) + SourceIndex(0) -12>Emitted(85, 53) Source(79, 52) + SourceIndex(0) -13>Emitted(85, 69) Source(79, 78) + SourceIndex(0) -14>Emitted(85, 71) Source(79, 52) + SourceIndex(0) -15>Emitted(85, 76) Source(79, 78) + SourceIndex(0) +2 >Emitted(85, 6) Source(79, 52) + SourceIndex(0) +3 >Emitted(85, 17) Source(79, 78) + SourceIndex(0) +4 >Emitted(85, 19) Source(79, 52) + SourceIndex(0) +5 >Emitted(85, 26) Source(79, 53) + SourceIndex(0) +6 >Emitted(85, 37) Source(79, 64) + SourceIndex(0) +7 >Emitted(85, 39) Source(79, 66) + SourceIndex(0) +8 >Emitted(85, 50) Source(79, 77) + SourceIndex(0) +9 >Emitted(85, 51) Source(79, 78) + SourceIndex(0) +10>Emitted(85, 53) Source(79, 52) + SourceIndex(0) +11>Emitted(85, 69) Source(79, 78) + SourceIndex(0) +12>Emitted(85, 71) Source(79, 52) + SourceIndex(0) +13>Emitted(85, 76) Source(79, 78) + SourceIndex(0) --- >>> _21 = _20[_19], nameMA = _21[0], _22 = _21[1], primarySkillA = _22[0], secondarySkillA = _22[1]; 1->^^^^^^^^^^^^^^^^^^^^ @@ -2088,41 +1974,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _23 = 0, robots_4 = robots; _23 < robots_4.length; _23++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^-> 1-> > > -2 >for -3 > -4 > ([numberA3, ...robotAInfo] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([numberA3, ...robotAInfo] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(89, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(89, 4) Source(83, 4) + SourceIndex(0) -3 >Emitted(89, 5) Source(83, 5) + SourceIndex(0) -4 >Emitted(89, 6) Source(83, 35) + SourceIndex(0) -5 >Emitted(89, 17) Source(83, 41) + SourceIndex(0) -6 >Emitted(89, 19) Source(83, 35) + SourceIndex(0) -7 >Emitted(89, 36) Source(83, 41) + SourceIndex(0) -8 >Emitted(89, 38) Source(83, 35) + SourceIndex(0) -9 >Emitted(89, 59) Source(83, 41) + SourceIndex(0) -10>Emitted(89, 61) Source(83, 35) + SourceIndex(0) -11>Emitted(89, 66) Source(83, 41) + SourceIndex(0) +2 >Emitted(89, 6) Source(83, 35) + SourceIndex(0) +3 >Emitted(89, 17) Source(83, 41) + SourceIndex(0) +4 >Emitted(89, 19) Source(83, 35) + SourceIndex(0) +5 >Emitted(89, 36) Source(83, 41) + SourceIndex(0) +6 >Emitted(89, 38) Source(83, 35) + SourceIndex(0) +7 >Emitted(89, 59) Source(83, 41) + SourceIndex(0) +8 >Emitted(89, 61) Source(83, 35) + SourceIndex(0) +9 >Emitted(89, 66) Source(83, 41) + SourceIndex(0) --- >>> _24 = robots_4[_23], numberA3 = _24[0], robotAInfo = _24.slice(1); 1->^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2174,46 +2054,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _25 = 0, _26 = getRobots(); _25 < _26.length; _25++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^-> 1-> > -2 >for -3 > -4 > ([numberA3, ...robotAInfo] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([numberA3, ...robotAInfo] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(93, 1) Source(86, 1) + SourceIndex(0) -2 >Emitted(93, 4) Source(86, 4) + SourceIndex(0) -3 >Emitted(93, 5) Source(86, 5) + SourceIndex(0) -4 >Emitted(93, 6) Source(86, 35) + SourceIndex(0) -5 >Emitted(93, 17) Source(86, 46) + SourceIndex(0) -6 >Emitted(93, 19) Source(86, 35) + SourceIndex(0) -7 >Emitted(93, 25) Source(86, 35) + SourceIndex(0) -8 >Emitted(93, 34) Source(86, 44) + SourceIndex(0) -9 >Emitted(93, 36) Source(86, 46) + SourceIndex(0) -10>Emitted(93, 38) Source(86, 35) + SourceIndex(0) -11>Emitted(93, 54) Source(86, 46) + SourceIndex(0) -12>Emitted(93, 56) Source(86, 35) + SourceIndex(0) -13>Emitted(93, 61) Source(86, 46) + SourceIndex(0) +2 >Emitted(93, 6) Source(86, 35) + SourceIndex(0) +3 >Emitted(93, 17) Source(86, 46) + SourceIndex(0) +4 >Emitted(93, 19) Source(86, 35) + SourceIndex(0) +5 >Emitted(93, 25) Source(86, 35) + SourceIndex(0) +6 >Emitted(93, 34) Source(86, 44) + SourceIndex(0) +7 >Emitted(93, 36) Source(86, 46) + SourceIndex(0) +8 >Emitted(93, 38) Source(86, 35) + SourceIndex(0) +9 >Emitted(93, 54) Source(86, 46) + SourceIndex(0) +10>Emitted(93, 56) Source(86, 35) + SourceIndex(0) +11>Emitted(93, 61) Source(86, 46) + SourceIndex(0) --- >>> _27 = _26[_25], numberA3 = _27[0], robotAInfo = _27.slice(1); 1->^^^^^^^^^^^^^^^^^^^^ @@ -2265,52 +2139,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _28 = 0, _29 = [robotA, robotB]; _28 < _29.length; _28++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^-> 1-> > -2 >for -3 > -4 > ([numberA3, ...robotAInfo] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([numberA3, ...robotAInfo] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(97, 1) Source(89, 1) + SourceIndex(0) -2 >Emitted(97, 4) Source(89, 4) + SourceIndex(0) -3 >Emitted(97, 5) Source(89, 5) + SourceIndex(0) -4 >Emitted(97, 6) Source(89, 35) + SourceIndex(0) -5 >Emitted(97, 17) Source(89, 51) + SourceIndex(0) -6 >Emitted(97, 19) Source(89, 35) + SourceIndex(0) -7 >Emitted(97, 26) Source(89, 36) + SourceIndex(0) -8 >Emitted(97, 32) Source(89, 42) + SourceIndex(0) -9 >Emitted(97, 34) Source(89, 44) + SourceIndex(0) -10>Emitted(97, 40) Source(89, 50) + SourceIndex(0) -11>Emitted(97, 41) Source(89, 51) + SourceIndex(0) -12>Emitted(97, 43) Source(89, 35) + SourceIndex(0) -13>Emitted(97, 59) Source(89, 51) + SourceIndex(0) -14>Emitted(97, 61) Source(89, 35) + SourceIndex(0) -15>Emitted(97, 66) Source(89, 51) + SourceIndex(0) +2 >Emitted(97, 6) Source(89, 35) + SourceIndex(0) +3 >Emitted(97, 17) Source(89, 51) + SourceIndex(0) +4 >Emitted(97, 19) Source(89, 35) + SourceIndex(0) +5 >Emitted(97, 26) Source(89, 36) + SourceIndex(0) +6 >Emitted(97, 32) Source(89, 42) + SourceIndex(0) +7 >Emitted(97, 34) Source(89, 44) + SourceIndex(0) +8 >Emitted(97, 40) Source(89, 50) + SourceIndex(0) +9 >Emitted(97, 41) Source(89, 51) + SourceIndex(0) +10>Emitted(97, 43) Source(89, 35) + SourceIndex(0) +11>Emitted(97, 59) Source(89, 51) + SourceIndex(0) +12>Emitted(97, 61) Source(89, 35) + SourceIndex(0) +13>Emitted(97, 66) Source(89, 51) + SourceIndex(0) --- >>> _30 = _29[_28], numberA3 = _30[0], robotAInfo = _30.slice(1); 1->^^^^^^^^^^^^^^^^^^^^ @@ -2362,39 +2230,33 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _31 = 0, multiRobots_4 = multiRobots; _31 < multiRobots_4.length; _31++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ 1-> > -2 >for -3 > -4 > ([...multiRobotAInfo] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ([...multiRobotAInfo] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(101, 1) Source(92, 1) + SourceIndex(0) -2 >Emitted(101, 4) Source(92, 4) + SourceIndex(0) -3 >Emitted(101, 5) Source(92, 5) + SourceIndex(0) -4 >Emitted(101, 6) Source(92, 30) + SourceIndex(0) -5 >Emitted(101, 17) Source(92, 41) + SourceIndex(0) -6 >Emitted(101, 19) Source(92, 30) + SourceIndex(0) -7 >Emitted(101, 46) Source(92, 41) + SourceIndex(0) -8 >Emitted(101, 48) Source(92, 30) + SourceIndex(0) -9 >Emitted(101, 74) Source(92, 41) + SourceIndex(0) -10>Emitted(101, 76) Source(92, 30) + SourceIndex(0) -11>Emitted(101, 81) Source(92, 41) + SourceIndex(0) +2 >Emitted(101, 6) Source(92, 30) + SourceIndex(0) +3 >Emitted(101, 17) Source(92, 41) + SourceIndex(0) +4 >Emitted(101, 19) Source(92, 30) + SourceIndex(0) +5 >Emitted(101, 46) Source(92, 41) + SourceIndex(0) +6 >Emitted(101, 48) Source(92, 30) + SourceIndex(0) +7 >Emitted(101, 74) Source(92, 41) + SourceIndex(0) +8 >Emitted(101, 76) Source(92, 30) + SourceIndex(0) +9 >Emitted(101, 81) Source(92, 41) + SourceIndex(0) --- >>> multiRobotAInfo = multiRobots_4[_31].slice(0); 1 >^^^^ @@ -2440,45 +2302,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _32 = 0, _33 = getMultiRobots(); _32 < _33.length; _32++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ 1-> > -2 >for -3 > -4 > ([...multiRobotAInfo] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ([...multiRobotAInfo] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(105, 1) Source(95, 1) + SourceIndex(0) -2 >Emitted(105, 4) Source(95, 4) + SourceIndex(0) -3 >Emitted(105, 5) Source(95, 5) + SourceIndex(0) -4 >Emitted(105, 6) Source(95, 30) + SourceIndex(0) -5 >Emitted(105, 17) Source(95, 46) + SourceIndex(0) -6 >Emitted(105, 19) Source(95, 30) + SourceIndex(0) -7 >Emitted(105, 25) Source(95, 30) + SourceIndex(0) -8 >Emitted(105, 39) Source(95, 44) + SourceIndex(0) -9 >Emitted(105, 41) Source(95, 46) + SourceIndex(0) -10>Emitted(105, 43) Source(95, 30) + SourceIndex(0) -11>Emitted(105, 59) Source(95, 46) + SourceIndex(0) -12>Emitted(105, 61) Source(95, 30) + SourceIndex(0) -13>Emitted(105, 66) Source(95, 46) + SourceIndex(0) +2 >Emitted(105, 6) Source(95, 30) + SourceIndex(0) +3 >Emitted(105, 17) Source(95, 46) + SourceIndex(0) +4 >Emitted(105, 19) Source(95, 30) + SourceIndex(0) +5 >Emitted(105, 25) Source(95, 30) + SourceIndex(0) +6 >Emitted(105, 39) Source(95, 44) + SourceIndex(0) +7 >Emitted(105, 41) Source(95, 46) + SourceIndex(0) +8 >Emitted(105, 43) Source(95, 30) + SourceIndex(0) +9 >Emitted(105, 59) Source(95, 46) + SourceIndex(0) +10>Emitted(105, 61) Source(95, 30) + SourceIndex(0) +11>Emitted(105, 66) Source(95, 46) + SourceIndex(0) --- >>> multiRobotAInfo = _33[_32].slice(0); 1 >^^^^ @@ -2524,51 +2380,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPattern2.ts --- >>>for (var _34 = 0, _35 = [multiRobotA, multiRobotB]; _34 < _35.length; _34++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ 1-> > -2 >for -3 > -4 > ([...multiRobotAInfo] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for ([...multiRobotAInfo] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(109, 1) Source(98, 1) + SourceIndex(0) -2 >Emitted(109, 4) Source(98, 4) + SourceIndex(0) -3 >Emitted(109, 5) Source(98, 5) + SourceIndex(0) -4 >Emitted(109, 6) Source(98, 30) + SourceIndex(0) -5 >Emitted(109, 17) Source(98, 56) + SourceIndex(0) -6 >Emitted(109, 19) Source(98, 30) + SourceIndex(0) -7 >Emitted(109, 26) Source(98, 31) + SourceIndex(0) -8 >Emitted(109, 37) Source(98, 42) + SourceIndex(0) -9 >Emitted(109, 39) Source(98, 44) + SourceIndex(0) -10>Emitted(109, 50) Source(98, 55) + SourceIndex(0) -11>Emitted(109, 51) Source(98, 56) + SourceIndex(0) -12>Emitted(109, 53) Source(98, 30) + SourceIndex(0) -13>Emitted(109, 69) Source(98, 56) + SourceIndex(0) -14>Emitted(109, 71) Source(98, 30) + SourceIndex(0) -15>Emitted(109, 76) Source(98, 56) + SourceIndex(0) +2 >Emitted(109, 6) Source(98, 30) + SourceIndex(0) +3 >Emitted(109, 17) Source(98, 56) + SourceIndex(0) +4 >Emitted(109, 19) Source(98, 30) + SourceIndex(0) +5 >Emitted(109, 26) Source(98, 31) + SourceIndex(0) +6 >Emitted(109, 37) Source(98, 42) + SourceIndex(0) +7 >Emitted(109, 39) Source(98, 44) + SourceIndex(0) +8 >Emitted(109, 50) Source(98, 55) + SourceIndex(0) +9 >Emitted(109, 51) Source(98, 56) + SourceIndex(0) +10>Emitted(109, 53) Source(98, 30) + SourceIndex(0) +11>Emitted(109, 69) Source(98, 56) + SourceIndex(0) +12>Emitted(109, 71) Source(98, 30) + SourceIndex(0) +13>Emitted(109, 76) Source(98, 56) + SourceIndex(0) --- >>> multiRobotAInfo = _35[_34].slice(0); 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map index 69f896d1274..b8aaf2f71ad 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAA6B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAA9B,IAAA,iBAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAnC,IAAA,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6B,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAAxC,IAAA,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAGyB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAH/B,IAAA,sBAGgB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAHpC,IAAA,WAGgB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAH9C,IAAA,WAGgB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,IAAA,oBAAY,EAAZ,iCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,IAAA,eAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAjC,IAAA,iBAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAA2B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAhC,IAAA,2BAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA2B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAArC,IAAA,iBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA2B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAA/C,IAAA,iBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA8D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;IAA/D,IAAA,mBAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA8D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;IAApE,IAAA,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA8D,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAzE,IAAA,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAH/B,IAAA,wBAGgB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAHpC,IAAA,cAGgB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAH9C,IAAA,cAGgB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAuC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;IAAxC,IAAA,mBAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;IAA7C,IAAA,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAlD,IAAA,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,KAAiC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAA9B,IAAA,iBAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAiC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAnC,IAAA,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAiC,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;IAAxC,IAAA,WAAoB,EAAjB,UAAgB,EAAhB,qCAAgB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAG6B,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAH/B,IAAA,sBAGgB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAG6B,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAHpC,IAAA,WAGgB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAG6B,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;IAH9C,IAAA,WAGgB,EAHb,UAGY,EAHZ,8CAGY,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAA2B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,IAAA,oBAAY,EAAZ,iCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAA2B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,IAAA,eAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAA2B,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAjC,IAAA,iBAAY,EAAZ,mCAAY;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAA+B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAhC,IAAA,2BAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA+B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAArC,IAAA,iBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA+B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAA/C,IAAA,iBAAgB,EAAhB,uCAAgB;IACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAkE,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;IAA/D,IAAA,mBAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAkE,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;IAApE,IAAA,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAAkE,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAzE,IAAA,cAAqD,EAApD,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACzD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAG6B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAH/B,IAAA,wBAGgB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAG6B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAHpC,IAAA,cAGgB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAG6B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAH9C,IAAA,cAGgB,EAHf,YAAiB,EAAjB,wCAAiB,EAAE,YAGL,EAHK,iDAGL,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAA2C,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;IAAxC,IAAA,mBAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAA2C,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;IAA7C,IAAA,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAA2C,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAlD,IAAA,cAA8B,EAA7B,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAClC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt index d59dc00248d..4c399a3c923 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.sourcemap.txt @@ -134,21 +134,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) --- >>>} 1 > @@ -294,21 +291,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) -4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) -5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +4 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) --- >>>} 1 > @@ -322,41 +316,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > (let [, nameA = "noName"] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [, nameA = "noName"] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(13, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(13, 4) Source(21, 4) + SourceIndex(0) -3 >Emitted(13, 5) Source(21, 5) + SourceIndex(0) -4 >Emitted(13, 6) Source(21, 34) + SourceIndex(0) -5 >Emitted(13, 16) Source(21, 40) + SourceIndex(0) -6 >Emitted(13, 18) Source(21, 34) + SourceIndex(0) -7 >Emitted(13, 35) Source(21, 40) + SourceIndex(0) -8 >Emitted(13, 37) Source(21, 34) + SourceIndex(0) -9 >Emitted(13, 57) Source(21, 40) + SourceIndex(0) -10>Emitted(13, 59) Source(21, 34) + SourceIndex(0) -11>Emitted(13, 63) Source(21, 40) + SourceIndex(0) +2 >Emitted(13, 6) Source(21, 34) + SourceIndex(0) +3 >Emitted(13, 16) Source(21, 40) + SourceIndex(0) +4 >Emitted(13, 18) Source(21, 34) + SourceIndex(0) +5 >Emitted(13, 35) Source(21, 40) + SourceIndex(0) +6 >Emitted(13, 37) Source(21, 34) + SourceIndex(0) +7 >Emitted(13, 57) Source(21, 40) + SourceIndex(0) +8 >Emitted(13, 59) Source(21, 34) + SourceIndex(0) +9 >Emitted(13, 63) Source(21, 40) + SourceIndex(0) --- >>> var _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; 1->^^^^ @@ -417,46 +405,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, nameA = "noName"] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [, nameA = "noName"] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(17, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(17, 4) Source(24, 4) + SourceIndex(0) -3 >Emitted(17, 5) Source(24, 5) + SourceIndex(0) -4 >Emitted(17, 6) Source(24, 34) + SourceIndex(0) -5 >Emitted(17, 16) Source(24, 45) + SourceIndex(0) -6 >Emitted(17, 18) Source(24, 34) + SourceIndex(0) -7 >Emitted(17, 23) Source(24, 34) + SourceIndex(0) -8 >Emitted(17, 32) Source(24, 43) + SourceIndex(0) -9 >Emitted(17, 34) Source(24, 45) + SourceIndex(0) -10>Emitted(17, 36) Source(24, 34) + SourceIndex(0) -11>Emitted(17, 50) Source(24, 45) + SourceIndex(0) -12>Emitted(17, 52) Source(24, 34) + SourceIndex(0) -13>Emitted(17, 56) Source(24, 45) + SourceIndex(0) +2 >Emitted(17, 6) Source(24, 34) + SourceIndex(0) +3 >Emitted(17, 16) Source(24, 45) + SourceIndex(0) +4 >Emitted(17, 18) Source(24, 34) + SourceIndex(0) +5 >Emitted(17, 23) Source(24, 34) + SourceIndex(0) +6 >Emitted(17, 32) Source(24, 43) + SourceIndex(0) +7 >Emitted(17, 34) Source(24, 45) + SourceIndex(0) +8 >Emitted(17, 36) Source(24, 34) + SourceIndex(0) +9 >Emitted(17, 50) Source(24, 45) + SourceIndex(0) +10>Emitted(17, 52) Source(24, 34) + SourceIndex(0) +11>Emitted(17, 56) Source(24, 45) + SourceIndex(0) --- >>> var _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; 1->^^^^ @@ -517,52 +499,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, nameA = "noName"] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [, nameA = "noName"] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(21, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(27, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(27, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(27, 34) + SourceIndex(0) -5 >Emitted(21, 16) Source(27, 50) + SourceIndex(0) -6 >Emitted(21, 18) Source(27, 34) + SourceIndex(0) -7 >Emitted(21, 24) Source(27, 35) + SourceIndex(0) -8 >Emitted(21, 30) Source(27, 41) + SourceIndex(0) -9 >Emitted(21, 32) Source(27, 43) + SourceIndex(0) -10>Emitted(21, 38) Source(27, 49) + SourceIndex(0) -11>Emitted(21, 39) Source(27, 50) + SourceIndex(0) -12>Emitted(21, 41) Source(27, 34) + SourceIndex(0) -13>Emitted(21, 55) Source(27, 50) + SourceIndex(0) -14>Emitted(21, 57) Source(27, 34) + SourceIndex(0) -15>Emitted(21, 61) Source(27, 50) + SourceIndex(0) +2 >Emitted(21, 6) Source(27, 34) + SourceIndex(0) +3 >Emitted(21, 16) Source(27, 50) + SourceIndex(0) +4 >Emitted(21, 18) Source(27, 34) + SourceIndex(0) +5 >Emitted(21, 24) Source(27, 35) + SourceIndex(0) +6 >Emitted(21, 30) Source(27, 41) + SourceIndex(0) +7 >Emitted(21, 32) Source(27, 43) + SourceIndex(0) +8 >Emitted(21, 38) Source(27, 49) + SourceIndex(0) +9 >Emitted(21, 39) Source(27, 50) + SourceIndex(0) +10>Emitted(21, 41) Source(27, 34) + SourceIndex(0) +11>Emitted(21, 55) Source(27, 50) + SourceIndex(0) +12>Emitted(21, 57) Source(27, 34) + SourceIndex(0) +13>Emitted(21, 61) Source(27, 50) + SourceIndex(0) --- >>> var _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; 1->^^^^ @@ -623,43 +599,37 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(25, 1) Source(30, 1) + SourceIndex(0) -2 >Emitted(25, 4) Source(30, 4) + SourceIndex(0) -3 >Emitted(25, 5) Source(30, 5) + SourceIndex(0) -4 >Emitted(25, 6) Source(33, 30) + SourceIndex(0) -5 >Emitted(25, 16) Source(33, 41) + SourceIndex(0) -6 >Emitted(25, 18) Source(33, 30) + SourceIndex(0) -7 >Emitted(25, 45) Source(33, 41) + SourceIndex(0) -8 >Emitted(25, 47) Source(33, 30) + SourceIndex(0) -9 >Emitted(25, 72) Source(33, 41) + SourceIndex(0) -10>Emitted(25, 74) Source(33, 30) + SourceIndex(0) -11>Emitted(25, 78) Source(33, 41) + SourceIndex(0) +2 >Emitted(25, 6) Source(33, 30) + SourceIndex(0) +3 >Emitted(25, 16) Source(33, 41) + SourceIndex(0) +4 >Emitted(25, 18) Source(33, 30) + SourceIndex(0) +5 >Emitted(25, 45) Source(33, 41) + SourceIndex(0) +6 >Emitted(25, 47) Source(33, 30) + SourceIndex(0) +7 >Emitted(25, 72) Source(33, 41) + SourceIndex(0) +8 >Emitted(25, 74) Source(33, 30) + SourceIndex(0) +9 >Emitted(25, 78) Source(33, 41) + SourceIndex(0) --- >>> var _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; 1->^^^^ @@ -755,49 +725,43 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(29, 1) Source(36, 1) + SourceIndex(0) -2 >Emitted(29, 4) Source(36, 4) + SourceIndex(0) -3 >Emitted(29, 5) Source(36, 5) + SourceIndex(0) -4 >Emitted(29, 6) Source(39, 30) + SourceIndex(0) -5 >Emitted(29, 16) Source(39, 46) + SourceIndex(0) -6 >Emitted(29, 18) Source(39, 30) + SourceIndex(0) -7 >Emitted(29, 23) Source(39, 30) + SourceIndex(0) -8 >Emitted(29, 37) Source(39, 44) + SourceIndex(0) -9 >Emitted(29, 39) Source(39, 46) + SourceIndex(0) -10>Emitted(29, 41) Source(39, 30) + SourceIndex(0) -11>Emitted(29, 55) Source(39, 46) + SourceIndex(0) -12>Emitted(29, 57) Source(39, 30) + SourceIndex(0) -13>Emitted(29, 61) Source(39, 46) + SourceIndex(0) +2 >Emitted(29, 6) Source(39, 30) + SourceIndex(0) +3 >Emitted(29, 16) Source(39, 46) + SourceIndex(0) +4 >Emitted(29, 18) Source(39, 30) + SourceIndex(0) +5 >Emitted(29, 23) Source(39, 30) + SourceIndex(0) +6 >Emitted(29, 37) Source(39, 44) + SourceIndex(0) +7 >Emitted(29, 39) Source(39, 46) + SourceIndex(0) +8 >Emitted(29, 41) Source(39, 30) + SourceIndex(0) +9 >Emitted(29, 55) Source(39, 46) + SourceIndex(0) +10>Emitted(29, 57) Source(39, 30) + SourceIndex(0) +11>Emitted(29, 61) Source(39, 46) + SourceIndex(0) --- >>> var _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; 1->^^^^ @@ -893,55 +857,49 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [, [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for (let [, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(33, 1) Source(42, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(42, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(42, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(45, 30) + SourceIndex(0) -5 >Emitted(33, 16) Source(45, 56) + SourceIndex(0) -6 >Emitted(33, 18) Source(45, 30) + SourceIndex(0) -7 >Emitted(33, 24) Source(45, 31) + SourceIndex(0) -8 >Emitted(33, 35) Source(45, 42) + SourceIndex(0) -9 >Emitted(33, 37) Source(45, 44) + SourceIndex(0) -10>Emitted(33, 48) Source(45, 55) + SourceIndex(0) -11>Emitted(33, 49) Source(45, 56) + SourceIndex(0) -12>Emitted(33, 51) Source(45, 30) + SourceIndex(0) -13>Emitted(33, 65) Source(45, 56) + SourceIndex(0) -14>Emitted(33, 67) Source(45, 30) + SourceIndex(0) -15>Emitted(33, 71) Source(45, 56) + SourceIndex(0) +2 >Emitted(33, 6) Source(45, 30) + SourceIndex(0) +3 >Emitted(33, 16) Source(45, 56) + SourceIndex(0) +4 >Emitted(33, 18) Source(45, 30) + SourceIndex(0) +5 >Emitted(33, 24) Source(45, 31) + SourceIndex(0) +6 >Emitted(33, 35) Source(45, 42) + SourceIndex(0) +7 >Emitted(33, 37) Source(45, 44) + SourceIndex(0) +8 >Emitted(33, 48) Source(45, 55) + SourceIndex(0) +9 >Emitted(33, 49) Source(45, 56) + SourceIndex(0) +10>Emitted(33, 51) Source(45, 30) + SourceIndex(0) +11>Emitted(33, 65) Source(45, 56) + SourceIndex(0) +12>Emitted(33, 67) Source(45, 30) + SourceIndex(0) +13>Emitted(33, 71) Source(45, 56) + SourceIndex(0) --- >>> var _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; 1->^^^^ @@ -1037,41 +995,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^-> 1-> > > -2 >for -3 > -4 > (let [numberB = -1] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [numberB = -1] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(37, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(49, 28) + SourceIndex(0) -5 >Emitted(37, 16) Source(49, 34) + SourceIndex(0) -6 >Emitted(37, 18) Source(49, 28) + SourceIndex(0) -7 >Emitted(37, 35) Source(49, 34) + SourceIndex(0) -8 >Emitted(37, 37) Source(49, 28) + SourceIndex(0) -9 >Emitted(37, 57) Source(49, 34) + SourceIndex(0) -10>Emitted(37, 59) Source(49, 28) + SourceIndex(0) -11>Emitted(37, 63) Source(49, 34) + SourceIndex(0) +2 >Emitted(37, 6) Source(49, 28) + SourceIndex(0) +3 >Emitted(37, 16) Source(49, 34) + SourceIndex(0) +4 >Emitted(37, 18) Source(49, 28) + SourceIndex(0) +5 >Emitted(37, 35) Source(49, 34) + SourceIndex(0) +6 >Emitted(37, 37) Source(49, 28) + SourceIndex(0) +7 >Emitted(37, 57) Source(49, 34) + SourceIndex(0) +8 >Emitted(37, 59) Source(49, 28) + SourceIndex(0) +9 >Emitted(37, 63) Source(49, 34) + SourceIndex(0) --- >>> var _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; 1->^^^^ @@ -1126,46 +1078,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberB = -1] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [numberB = -1] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(41, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(41, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(41, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(41, 6) Source(52, 28) + SourceIndex(0) -5 >Emitted(41, 16) Source(52, 39) + SourceIndex(0) -6 >Emitted(41, 18) Source(52, 28) + SourceIndex(0) -7 >Emitted(41, 23) Source(52, 28) + SourceIndex(0) -8 >Emitted(41, 32) Source(52, 37) + SourceIndex(0) -9 >Emitted(41, 34) Source(52, 39) + SourceIndex(0) -10>Emitted(41, 36) Source(52, 28) + SourceIndex(0) -11>Emitted(41, 50) Source(52, 39) + SourceIndex(0) -12>Emitted(41, 52) Source(52, 28) + SourceIndex(0) -13>Emitted(41, 56) Source(52, 39) + SourceIndex(0) +2 >Emitted(41, 6) Source(52, 28) + SourceIndex(0) +3 >Emitted(41, 16) Source(52, 39) + SourceIndex(0) +4 >Emitted(41, 18) Source(52, 28) + SourceIndex(0) +5 >Emitted(41, 23) Source(52, 28) + SourceIndex(0) +6 >Emitted(41, 32) Source(52, 37) + SourceIndex(0) +7 >Emitted(41, 34) Source(52, 39) + SourceIndex(0) +8 >Emitted(41, 36) Source(52, 28) + SourceIndex(0) +9 >Emitted(41, 50) Source(52, 39) + SourceIndex(0) +10>Emitted(41, 52) Source(52, 28) + SourceIndex(0) +11>Emitted(41, 56) Source(52, 39) + SourceIndex(0) --- >>> var _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; 1->^^^^ @@ -1220,51 +1166,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ 1-> > -2 >for -3 > -4 > (let [numberB = -1] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [numberB = -1] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(45, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(55, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(55, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(55, 28) + SourceIndex(0) -5 >Emitted(45, 17) Source(55, 44) + SourceIndex(0) -6 >Emitted(45, 19) Source(55, 28) + SourceIndex(0) -7 >Emitted(45, 26) Source(55, 29) + SourceIndex(0) -8 >Emitted(45, 32) Source(55, 35) + SourceIndex(0) -9 >Emitted(45, 34) Source(55, 37) + SourceIndex(0) -10>Emitted(45, 40) Source(55, 43) + SourceIndex(0) -11>Emitted(45, 41) Source(55, 44) + SourceIndex(0) -12>Emitted(45, 43) Source(55, 28) + SourceIndex(0) -13>Emitted(45, 59) Source(55, 44) + SourceIndex(0) -14>Emitted(45, 61) Source(55, 28) + SourceIndex(0) -15>Emitted(45, 66) Source(55, 44) + SourceIndex(0) +2 >Emitted(45, 6) Source(55, 28) + SourceIndex(0) +3 >Emitted(45, 17) Source(55, 44) + SourceIndex(0) +4 >Emitted(45, 19) Source(55, 28) + SourceIndex(0) +5 >Emitted(45, 26) Source(55, 29) + SourceIndex(0) +6 >Emitted(45, 32) Source(55, 35) + SourceIndex(0) +7 >Emitted(45, 34) Source(55, 37) + SourceIndex(0) +8 >Emitted(45, 40) Source(55, 43) + SourceIndex(0) +9 >Emitted(45, 41) Source(55, 44) + SourceIndex(0) +10>Emitted(45, 43) Source(55, 28) + SourceIndex(0) +11>Emitted(45, 59) Source(55, 44) + SourceIndex(0) +12>Emitted(45, 61) Source(55, 28) + SourceIndex(0) +13>Emitted(45, 66) Source(55, 44) + SourceIndex(0) --- >>> var _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; 1 >^^^^ @@ -1319,39 +1259,33 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ 1-> > -2 >for -3 > -4 > (let [nameB = "noName"] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let [nameB = "noName"] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(49, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(58, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(58, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(58, 32) + SourceIndex(0) -5 >Emitted(49, 17) Source(58, 43) + SourceIndex(0) -6 >Emitted(49, 19) Source(58, 32) + SourceIndex(0) -7 >Emitted(49, 46) Source(58, 43) + SourceIndex(0) -8 >Emitted(49, 48) Source(58, 32) + SourceIndex(0) -9 >Emitted(49, 74) Source(58, 43) + SourceIndex(0) -10>Emitted(49, 76) Source(58, 32) + SourceIndex(0) -11>Emitted(49, 81) Source(58, 43) + SourceIndex(0) +2 >Emitted(49, 6) Source(58, 32) + SourceIndex(0) +3 >Emitted(49, 17) Source(58, 43) + SourceIndex(0) +4 >Emitted(49, 19) Source(58, 32) + SourceIndex(0) +5 >Emitted(49, 46) Source(58, 43) + SourceIndex(0) +6 >Emitted(49, 48) Source(58, 32) + SourceIndex(0) +7 >Emitted(49, 74) Source(58, 43) + SourceIndex(0) +8 >Emitted(49, 76) Source(58, 32) + SourceIndex(0) +9 >Emitted(49, 81) Source(58, 43) + SourceIndex(0) --- >>> var _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; 1 >^^^^ @@ -1406,46 +1340,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^-> 1-> > -2 >for -3 > -4 > (let [nameB = "noName"] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let [nameB = "noName"] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(53, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(53, 4) Source(61, 4) + SourceIndex(0) -3 >Emitted(53, 5) Source(61, 5) + SourceIndex(0) -4 >Emitted(53, 6) Source(61, 32) + SourceIndex(0) -5 >Emitted(53, 17) Source(61, 48) + SourceIndex(0) -6 >Emitted(53, 19) Source(61, 32) + SourceIndex(0) -7 >Emitted(53, 25) Source(61, 32) + SourceIndex(0) -8 >Emitted(53, 39) Source(61, 46) + SourceIndex(0) -9 >Emitted(53, 41) Source(61, 48) + SourceIndex(0) -10>Emitted(53, 43) Source(61, 32) + SourceIndex(0) -11>Emitted(53, 59) Source(61, 48) + SourceIndex(0) -12>Emitted(53, 61) Source(61, 32) + SourceIndex(0) -13>Emitted(53, 66) Source(61, 48) + SourceIndex(0) +2 >Emitted(53, 6) Source(61, 32) + SourceIndex(0) +3 >Emitted(53, 17) Source(61, 48) + SourceIndex(0) +4 >Emitted(53, 19) Source(61, 32) + SourceIndex(0) +5 >Emitted(53, 25) Source(61, 32) + SourceIndex(0) +6 >Emitted(53, 39) Source(61, 46) + SourceIndex(0) +7 >Emitted(53, 41) Source(61, 48) + SourceIndex(0) +8 >Emitted(53, 43) Source(61, 32) + SourceIndex(0) +9 >Emitted(53, 59) Source(61, 48) + SourceIndex(0) +10>Emitted(53, 61) Source(61, 32) + SourceIndex(0) +11>Emitted(53, 66) Source(61, 48) + SourceIndex(0) --- >>> var _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; 1->^^^^ @@ -1500,51 +1428,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ 1-> > -2 >for -3 > -4 > (let [nameB = "noName"] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for (let [nameB = "noName"] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(57, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(64, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(64, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(64, 32) + SourceIndex(0) -5 >Emitted(57, 17) Source(64, 58) + SourceIndex(0) -6 >Emitted(57, 19) Source(64, 32) + SourceIndex(0) -7 >Emitted(57, 26) Source(64, 33) + SourceIndex(0) -8 >Emitted(57, 37) Source(64, 44) + SourceIndex(0) -9 >Emitted(57, 39) Source(64, 46) + SourceIndex(0) -10>Emitted(57, 50) Source(64, 57) + SourceIndex(0) -11>Emitted(57, 51) Source(64, 58) + SourceIndex(0) -12>Emitted(57, 53) Source(64, 32) + SourceIndex(0) -13>Emitted(57, 69) Source(64, 58) + SourceIndex(0) -14>Emitted(57, 71) Source(64, 32) + SourceIndex(0) -15>Emitted(57, 76) Source(64, 58) + SourceIndex(0) +2 >Emitted(57, 6) Source(64, 32) + SourceIndex(0) +3 >Emitted(57, 17) Source(64, 58) + SourceIndex(0) +4 >Emitted(57, 19) Source(64, 32) + SourceIndex(0) +5 >Emitted(57, 26) Source(64, 33) + SourceIndex(0) +6 >Emitted(57, 37) Source(64, 44) + SourceIndex(0) +7 >Emitted(57, 39) Source(64, 46) + SourceIndex(0) +8 >Emitted(57, 50) Source(64, 57) + SourceIndex(0) +9 >Emitted(57, 51) Source(64, 58) + SourceIndex(0) +10>Emitted(57, 53) Source(64, 32) + SourceIndex(0) +11>Emitted(57, 69) Source(64, 58) + SourceIndex(0) +12>Emitted(57, 71) Source(64, 32) + SourceIndex(0) +13>Emitted(57, 76) Source(64, 58) + SourceIndex(0) --- >>> var _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; 1 >^^^^ @@ -1599,41 +1521,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(61, 1) Source(68, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(68, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(68, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(68, 67) + SourceIndex(0) -5 >Emitted(61, 17) Source(68, 73) + SourceIndex(0) -6 >Emitted(61, 19) Source(68, 67) + SourceIndex(0) -7 >Emitted(61, 36) Source(68, 73) + SourceIndex(0) -8 >Emitted(61, 38) Source(68, 67) + SourceIndex(0) -9 >Emitted(61, 59) Source(68, 73) + SourceIndex(0) -10>Emitted(61, 61) Source(68, 67) + SourceIndex(0) -11>Emitted(61, 66) Source(68, 73) + SourceIndex(0) +2 >Emitted(61, 6) Source(68, 67) + SourceIndex(0) +3 >Emitted(61, 17) Source(68, 73) + SourceIndex(0) +4 >Emitted(61, 19) Source(68, 67) + SourceIndex(0) +5 >Emitted(61, 36) Source(68, 73) + SourceIndex(0) +6 >Emitted(61, 38) Source(68, 67) + SourceIndex(0) +7 >Emitted(61, 59) Source(68, 73) + SourceIndex(0) +8 >Emitted(61, 61) Source(68, 67) + SourceIndex(0) +9 >Emitted(61, 66) Source(68, 73) + SourceIndex(0) --- >>> var _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; 1->^^^^ @@ -1718,46 +1634,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(65, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(65, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(65, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(65, 6) Source(71, 67) + SourceIndex(0) -5 >Emitted(65, 17) Source(71, 78) + SourceIndex(0) -6 >Emitted(65, 19) Source(71, 67) + SourceIndex(0) -7 >Emitted(65, 25) Source(71, 67) + SourceIndex(0) -8 >Emitted(65, 34) Source(71, 76) + SourceIndex(0) -9 >Emitted(65, 36) Source(71, 78) + SourceIndex(0) -10>Emitted(65, 38) Source(71, 67) + SourceIndex(0) -11>Emitted(65, 54) Source(71, 78) + SourceIndex(0) -12>Emitted(65, 56) Source(71, 67) + SourceIndex(0) -13>Emitted(65, 61) Source(71, 78) + SourceIndex(0) +2 >Emitted(65, 6) Source(71, 67) + SourceIndex(0) +3 >Emitted(65, 17) Source(71, 78) + SourceIndex(0) +4 >Emitted(65, 19) Source(71, 67) + SourceIndex(0) +5 >Emitted(65, 25) Source(71, 67) + SourceIndex(0) +6 >Emitted(65, 34) Source(71, 76) + SourceIndex(0) +7 >Emitted(65, 36) Source(71, 78) + SourceIndex(0) +8 >Emitted(65, 38) Source(71, 67) + SourceIndex(0) +9 >Emitted(65, 54) Source(71, 78) + SourceIndex(0) +10>Emitted(65, 56) Source(71, 67) + SourceIndex(0) +11>Emitted(65, 61) Source(71, 78) + SourceIndex(0) --- >>> var _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; 1->^^^^ @@ -1842,52 +1752,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(69, 1) Source(74, 1) + SourceIndex(0) -2 >Emitted(69, 4) Source(74, 4) + SourceIndex(0) -3 >Emitted(69, 5) Source(74, 5) + SourceIndex(0) -4 >Emitted(69, 6) Source(74, 67) + SourceIndex(0) -5 >Emitted(69, 17) Source(74, 83) + SourceIndex(0) -6 >Emitted(69, 19) Source(74, 67) + SourceIndex(0) -7 >Emitted(69, 26) Source(74, 68) + SourceIndex(0) -8 >Emitted(69, 32) Source(74, 74) + SourceIndex(0) -9 >Emitted(69, 34) Source(74, 76) + SourceIndex(0) -10>Emitted(69, 40) Source(74, 82) + SourceIndex(0) -11>Emitted(69, 41) Source(74, 83) + SourceIndex(0) -12>Emitted(69, 43) Source(74, 67) + SourceIndex(0) -13>Emitted(69, 59) Source(74, 83) + SourceIndex(0) -14>Emitted(69, 61) Source(74, 67) + SourceIndex(0) -15>Emitted(69, 66) Source(74, 83) + SourceIndex(0) +2 >Emitted(69, 6) Source(74, 67) + SourceIndex(0) +3 >Emitted(69, 17) Source(74, 83) + SourceIndex(0) +4 >Emitted(69, 19) Source(74, 67) + SourceIndex(0) +5 >Emitted(69, 26) Source(74, 68) + SourceIndex(0) +6 >Emitted(69, 32) Source(74, 74) + SourceIndex(0) +7 >Emitted(69, 34) Source(74, 76) + SourceIndex(0) +8 >Emitted(69, 40) Source(74, 82) + SourceIndex(0) +9 >Emitted(69, 41) Source(74, 83) + SourceIndex(0) +10>Emitted(69, 43) Source(74, 67) + SourceIndex(0) +11>Emitted(69, 59) Source(74, 83) + SourceIndex(0) +12>Emitted(69, 61) Source(74, 67) + SourceIndex(0) +13>Emitted(69, 66) Source(74, 83) + SourceIndex(0) --- >>> var _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; 1->^^^^ @@ -1972,43 +1876,37 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [nameMA = "noName", [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(73, 1) Source(77, 1) + SourceIndex(0) -2 >Emitted(73, 4) Source(77, 4) + SourceIndex(0) -3 >Emitted(73, 5) Source(77, 5) + SourceIndex(0) -4 >Emitted(73, 6) Source(80, 30) + SourceIndex(0) -5 >Emitted(73, 17) Source(80, 41) + SourceIndex(0) -6 >Emitted(73, 19) Source(80, 30) + SourceIndex(0) -7 >Emitted(73, 46) Source(80, 41) + SourceIndex(0) -8 >Emitted(73, 48) Source(80, 30) + SourceIndex(0) -9 >Emitted(73, 74) Source(80, 41) + SourceIndex(0) -10>Emitted(73, 76) Source(80, 30) + SourceIndex(0) -11>Emitted(73, 81) Source(80, 41) + SourceIndex(0) +2 >Emitted(73, 6) Source(80, 30) + SourceIndex(0) +3 >Emitted(73, 17) Source(80, 41) + SourceIndex(0) +4 >Emitted(73, 19) Source(80, 30) + SourceIndex(0) +5 >Emitted(73, 46) Source(80, 41) + SourceIndex(0) +6 >Emitted(73, 48) Source(80, 30) + SourceIndex(0) +7 >Emitted(73, 74) Source(80, 41) + SourceIndex(0) +8 >Emitted(73, 76) Source(80, 30) + SourceIndex(0) +9 >Emitted(73, 81) Source(80, 41) + SourceIndex(0) --- >>> var _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; 1->^^^^ @@ -2116,49 +2014,43 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [nameMA = "noName", [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(77, 1) Source(83, 1) + SourceIndex(0) -2 >Emitted(77, 4) Source(83, 4) + SourceIndex(0) -3 >Emitted(77, 5) Source(83, 5) + SourceIndex(0) -4 >Emitted(77, 6) Source(86, 30) + SourceIndex(0) -5 >Emitted(77, 17) Source(86, 46) + SourceIndex(0) -6 >Emitted(77, 19) Source(86, 30) + SourceIndex(0) -7 >Emitted(77, 25) Source(86, 30) + SourceIndex(0) -8 >Emitted(77, 39) Source(86, 44) + SourceIndex(0) -9 >Emitted(77, 41) Source(86, 46) + SourceIndex(0) -10>Emitted(77, 43) Source(86, 30) + SourceIndex(0) -11>Emitted(77, 59) Source(86, 46) + SourceIndex(0) -12>Emitted(77, 61) Source(86, 30) + SourceIndex(0) -13>Emitted(77, 66) Source(86, 46) + SourceIndex(0) +2 >Emitted(77, 6) Source(86, 30) + SourceIndex(0) +3 >Emitted(77, 17) Source(86, 46) + SourceIndex(0) +4 >Emitted(77, 19) Source(86, 30) + SourceIndex(0) +5 >Emitted(77, 25) Source(86, 30) + SourceIndex(0) +6 >Emitted(77, 39) Source(86, 44) + SourceIndex(0) +7 >Emitted(77, 41) Source(86, 46) + SourceIndex(0) +8 >Emitted(77, 43) Source(86, 30) + SourceIndex(0) +9 >Emitted(77, 59) Source(86, 46) + SourceIndex(0) +10>Emitted(77, 61) Source(86, 30) + SourceIndex(0) +11>Emitted(77, 66) Source(86, 46) + SourceIndex(0) --- >>> var _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; 1->^^^^ @@ -2266,55 +2158,49 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [nameMA = "noName", [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for (let [nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(81, 1) Source(89, 1) + SourceIndex(0) -2 >Emitted(81, 4) Source(89, 4) + SourceIndex(0) -3 >Emitted(81, 5) Source(89, 5) + SourceIndex(0) -4 >Emitted(81, 6) Source(92, 30) + SourceIndex(0) -5 >Emitted(81, 17) Source(92, 56) + SourceIndex(0) -6 >Emitted(81, 19) Source(92, 30) + SourceIndex(0) -7 >Emitted(81, 26) Source(92, 31) + SourceIndex(0) -8 >Emitted(81, 37) Source(92, 42) + SourceIndex(0) -9 >Emitted(81, 39) Source(92, 44) + SourceIndex(0) -10>Emitted(81, 50) Source(92, 55) + SourceIndex(0) -11>Emitted(81, 51) Source(92, 56) + SourceIndex(0) -12>Emitted(81, 53) Source(92, 30) + SourceIndex(0) -13>Emitted(81, 69) Source(92, 56) + SourceIndex(0) -14>Emitted(81, 71) Source(92, 30) + SourceIndex(0) -15>Emitted(81, 76) Source(92, 56) + SourceIndex(0) +2 >Emitted(81, 6) Source(92, 30) + SourceIndex(0) +3 >Emitted(81, 17) Source(92, 56) + SourceIndex(0) +4 >Emitted(81, 19) Source(92, 30) + SourceIndex(0) +5 >Emitted(81, 26) Source(92, 31) + SourceIndex(0) +6 >Emitted(81, 37) Source(92, 42) + SourceIndex(0) +7 >Emitted(81, 39) Source(92, 44) + SourceIndex(0) +8 >Emitted(81, 50) Source(92, 55) + SourceIndex(0) +9 >Emitted(81, 51) Source(92, 56) + SourceIndex(0) +10>Emitted(81, 53) Source(92, 30) + SourceIndex(0) +11>Emitted(81, 69) Source(92, 56) + SourceIndex(0) +12>Emitted(81, 71) Source(92, 30) + SourceIndex(0) +13>Emitted(81, 76) Source(92, 56) + SourceIndex(0) --- >>> var _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; 1->^^^^ @@ -2422,41 +2308,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > (let [numberA3 = -1, ...robotAInfo] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let [numberA3 = -1, ...robotAInfo] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(85, 1) Source(96, 1) + SourceIndex(0) -2 >Emitted(85, 4) Source(96, 4) + SourceIndex(0) -3 >Emitted(85, 5) Source(96, 5) + SourceIndex(0) -4 >Emitted(85, 6) Source(96, 44) + SourceIndex(0) -5 >Emitted(85, 17) Source(96, 50) + SourceIndex(0) -6 >Emitted(85, 19) Source(96, 44) + SourceIndex(0) -7 >Emitted(85, 36) Source(96, 50) + SourceIndex(0) -8 >Emitted(85, 38) Source(96, 44) + SourceIndex(0) -9 >Emitted(85, 59) Source(96, 50) + SourceIndex(0) -10>Emitted(85, 61) Source(96, 44) + SourceIndex(0) -11>Emitted(85, 66) Source(96, 50) + SourceIndex(0) +2 >Emitted(85, 6) Source(96, 44) + SourceIndex(0) +3 >Emitted(85, 17) Source(96, 50) + SourceIndex(0) +4 >Emitted(85, 19) Source(96, 44) + SourceIndex(0) +5 >Emitted(85, 36) Source(96, 50) + SourceIndex(0) +6 >Emitted(85, 38) Source(96, 44) + SourceIndex(0) +7 >Emitted(85, 59) Source(96, 50) + SourceIndex(0) +8 >Emitted(85, 61) Source(96, 44) + SourceIndex(0) +9 >Emitted(85, 66) Source(96, 50) + SourceIndex(0) --- >>> var _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); 1->^^^^ @@ -2523,46 +2403,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA3 = -1, ...robotAInfo] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let [numberA3 = -1, ...robotAInfo] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(89, 1) Source(99, 1) + SourceIndex(0) -2 >Emitted(89, 4) Source(99, 4) + SourceIndex(0) -3 >Emitted(89, 5) Source(99, 5) + SourceIndex(0) -4 >Emitted(89, 6) Source(99, 44) + SourceIndex(0) -5 >Emitted(89, 17) Source(99, 55) + SourceIndex(0) -6 >Emitted(89, 19) Source(99, 44) + SourceIndex(0) -7 >Emitted(89, 25) Source(99, 44) + SourceIndex(0) -8 >Emitted(89, 34) Source(99, 53) + SourceIndex(0) -9 >Emitted(89, 36) Source(99, 55) + SourceIndex(0) -10>Emitted(89, 38) Source(99, 44) + SourceIndex(0) -11>Emitted(89, 54) Source(99, 55) + SourceIndex(0) -12>Emitted(89, 56) Source(99, 44) + SourceIndex(0) -13>Emitted(89, 61) Source(99, 55) + SourceIndex(0) +2 >Emitted(89, 6) Source(99, 44) + SourceIndex(0) +3 >Emitted(89, 17) Source(99, 55) + SourceIndex(0) +4 >Emitted(89, 19) Source(99, 44) + SourceIndex(0) +5 >Emitted(89, 25) Source(99, 44) + SourceIndex(0) +6 >Emitted(89, 34) Source(99, 53) + SourceIndex(0) +7 >Emitted(89, 36) Source(99, 55) + SourceIndex(0) +8 >Emitted(89, 38) Source(99, 44) + SourceIndex(0) +9 >Emitted(89, 54) Source(99, 55) + SourceIndex(0) +10>Emitted(89, 56) Source(99, 44) + SourceIndex(0) +11>Emitted(89, 61) Source(99, 55) + SourceIndex(0) --- >>> var _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); 1->^^^^ @@ -2629,52 +2503,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let [numberA3 = -1, ...robotAInfo] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for (let [numberA3 = -1, ...robotAInfo] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(93, 1) Source(102, 1) + SourceIndex(0) -2 >Emitted(93, 4) Source(102, 4) + SourceIndex(0) -3 >Emitted(93, 5) Source(102, 5) + SourceIndex(0) -4 >Emitted(93, 6) Source(102, 44) + SourceIndex(0) -5 >Emitted(93, 17) Source(102, 60) + SourceIndex(0) -6 >Emitted(93, 19) Source(102, 44) + SourceIndex(0) -7 >Emitted(93, 26) Source(102, 45) + SourceIndex(0) -8 >Emitted(93, 32) Source(102, 51) + SourceIndex(0) -9 >Emitted(93, 34) Source(102, 53) + SourceIndex(0) -10>Emitted(93, 40) Source(102, 59) + SourceIndex(0) -11>Emitted(93, 41) Source(102, 60) + SourceIndex(0) -12>Emitted(93, 43) Source(102, 44) + SourceIndex(0) -13>Emitted(93, 59) Source(102, 60) + SourceIndex(0) -14>Emitted(93, 61) Source(102, 44) + SourceIndex(0) -15>Emitted(93, 66) Source(102, 60) + SourceIndex(0) +2 >Emitted(93, 6) Source(102, 44) + SourceIndex(0) +3 >Emitted(93, 17) Source(102, 60) + SourceIndex(0) +4 >Emitted(93, 19) Source(102, 44) + SourceIndex(0) +5 >Emitted(93, 26) Source(102, 45) + SourceIndex(0) +6 >Emitted(93, 32) Source(102, 51) + SourceIndex(0) +7 >Emitted(93, 34) Source(102, 53) + SourceIndex(0) +8 >Emitted(93, 40) Source(102, 59) + SourceIndex(0) +9 >Emitted(93, 41) Source(102, 60) + SourceIndex(0) +10>Emitted(93, 43) Source(102, 44) + SourceIndex(0) +11>Emitted(93, 59) Source(102, 60) + SourceIndex(0) +12>Emitted(93, 61) Source(102, 44) + SourceIndex(0) +13>Emitted(93, 66) Source(102, 60) + SourceIndex(0) --- >>> var _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); 1->^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map index f0224061c2b..b35507fd908 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,GAAG,CAAC,CAAyB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAA3B,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAAhC,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyB,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;iBAArC,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAGyB,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;4BAHhC,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;iBAHrC,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,GAAG,CAAC,CAGyB,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;iBAH/C,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,GAAG,CAAC,CAAmB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,oBAAY,EAAZ,iCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAmB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,eAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAmB,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAjC,iBAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,GAAG,CAAC,CAAuB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAhC,2BAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAArC,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAA/C,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA0D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAA9D,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA0D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAAnE,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAA0D,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;oBAAxE,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BAHlC,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAHvC,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,GAAG,CAAC,CAGyB,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;oBAHjD,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,GAAG,CAAC,CAAmC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAAvC,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAmC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAA5C,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAmC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;oBAAjD,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC9B;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzE,IAAI,WAAW,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7C;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClE,IAAI,OAAe,EAAE,KAAa,CAAC;AACnC,IAAI,QAAgB,EAAE,MAAc,EAAE,OAAe,EAAE,MAAc,CAAC;AACtE,IAAI,QAAgB,EAAE,UAA+B,EAAE,eAA8C,CAAC;AAEtG,KAA6B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAA3B,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA6B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAAhC,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA6B,UAAgB,EAAhB,MAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,cAAgB,EAAhB,IAAgB;iBAArC,UAAgB,EAAhB,qCAAgB;IACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAG6B,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;4BAHhC,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAG6B,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;iBAHrC,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AACD,KAG6B,UAA0B,EAA1B,MAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,cAA0B,EAA1B,IAA0B;iBAH/C,UAGgB,EAHhB,8CAGgB,EAFpB,UAAyB,EAAzB,8CAAyB,EACzB,UAA6B,EAA7B,kDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,KAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,oBAAY,EAAZ,iCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,eAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAAuB,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;IAAjC,iBAAY,EAAZ,mCAAY;IACd,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB;AACD,KAA2B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IAAhC,2BAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA2B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAArC,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA2B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;IAA/C,iBAAgB,EAAhB,uCAAgB;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAA8D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAA9D,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAA8D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAAnE,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAA8D,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;oBAAxE,YAAa,EAAb,oCAAa,EAAE,YAAiB,EAAjB,wCAAiB,EAAE,YAAiB,EAAjB,wCAAiB;IACrD,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAG6B,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BAHlC,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAG6B,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAHvC,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AACD,KAG6B,WAA0B,EAA1B,OAAC,WAAW,EAAE,WAAW,CAAC,EAA1B,gBAA0B,EAA1B,KAA0B;oBAHjD,YAAiB,EAAjB,wCAAiB,EAAE,YAGD,EAHC,iDAGD,EAFpB,YAAyB,EAAzB,gDAAyB,EACzB,YAA6B,EAA7B,oDAA6B;IAE7B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,KAAuC,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAAvC,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAuC,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAA5C,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAuC,WAAgB,EAAhB,OAAC,MAAM,EAAE,MAAM,CAAC,EAAhB,gBAAgB,EAAhB,KAAgB;oBAAjD,YAAa,EAAb,oCAAa,EAAE,yBAAa;IAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt index f9ab0c470e7..3ab100eddc0 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.sourcemap.txt @@ -134,21 +134,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(11, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(11, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(11, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) --- >>>} 1 > @@ -294,21 +291,18 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(11, 5) Source(18, 5) + SourceIndex(0) -2 >Emitted(11, 11) Source(18, 11) + SourceIndex(0) -3 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) -4 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) -5 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) +2 >Emitted(11, 12) Source(18, 12) + SourceIndex(0) +3 >Emitted(11, 23) Source(18, 23) + SourceIndex(0) +4 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) --- >>>} 1 > @@ -434,41 +428,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > ([, nameA = "noName"] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([, nameA = "noName"] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(17, 1) Source(26, 1) + SourceIndex(0) -2 >Emitted(17, 4) Source(26, 4) + SourceIndex(0) -3 >Emitted(17, 5) Source(26, 5) + SourceIndex(0) -4 >Emitted(17, 6) Source(26, 30) + SourceIndex(0) -5 >Emitted(17, 16) Source(26, 36) + SourceIndex(0) -6 >Emitted(17, 18) Source(26, 30) + SourceIndex(0) -7 >Emitted(17, 35) Source(26, 36) + SourceIndex(0) -8 >Emitted(17, 37) Source(26, 30) + SourceIndex(0) -9 >Emitted(17, 57) Source(26, 36) + SourceIndex(0) -10>Emitted(17, 59) Source(26, 30) + SourceIndex(0) -11>Emitted(17, 63) Source(26, 36) + SourceIndex(0) +2 >Emitted(17, 6) Source(26, 30) + SourceIndex(0) +3 >Emitted(17, 16) Source(26, 36) + SourceIndex(0) +4 >Emitted(17, 18) Source(26, 30) + SourceIndex(0) +5 >Emitted(17, 35) Source(26, 36) + SourceIndex(0) +6 >Emitted(17, 37) Source(26, 30) + SourceIndex(0) +7 >Emitted(17, 57) Source(26, 36) + SourceIndex(0) +8 >Emitted(17, 59) Source(26, 30) + SourceIndex(0) +9 >Emitted(17, 63) Source(26, 36) + SourceIndex(0) --- >>> _a = robots_1[_i], _b = _a[1], nameA = _b === void 0 ? "noName" : _b; 1->^^^^^^^^^^^^^^^^^^^^^^^ @@ -520,46 +508,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _c = 0, _d = getRobots(); _c < _d.length; _c++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, nameA = "noName"] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([, nameA = "noName"] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(21, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(21, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(21, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(21, 6) Source(29, 30) + SourceIndex(0) -5 >Emitted(21, 16) Source(29, 41) + SourceIndex(0) -6 >Emitted(21, 18) Source(29, 30) + SourceIndex(0) -7 >Emitted(21, 23) Source(29, 30) + SourceIndex(0) -8 >Emitted(21, 32) Source(29, 39) + SourceIndex(0) -9 >Emitted(21, 34) Source(29, 41) + SourceIndex(0) -10>Emitted(21, 36) Source(29, 30) + SourceIndex(0) -11>Emitted(21, 50) Source(29, 41) + SourceIndex(0) -12>Emitted(21, 52) Source(29, 30) + SourceIndex(0) -13>Emitted(21, 56) Source(29, 41) + SourceIndex(0) +2 >Emitted(21, 6) Source(29, 30) + SourceIndex(0) +3 >Emitted(21, 16) Source(29, 41) + SourceIndex(0) +4 >Emitted(21, 18) Source(29, 30) + SourceIndex(0) +5 >Emitted(21, 23) Source(29, 30) + SourceIndex(0) +6 >Emitted(21, 32) Source(29, 39) + SourceIndex(0) +7 >Emitted(21, 34) Source(29, 41) + SourceIndex(0) +8 >Emitted(21, 36) Source(29, 30) + SourceIndex(0) +9 >Emitted(21, 50) Source(29, 41) + SourceIndex(0) +10>Emitted(21, 52) Source(29, 30) + SourceIndex(0) +11>Emitted(21, 56) Source(29, 41) + SourceIndex(0) --- >>> _e = _d[_c], _f = _e[1], nameA = _f === void 0 ? "noName" : _f; 1->^^^^^^^^^^^^^^^^^ @@ -611,52 +593,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _g = 0, _h = [robotA, robotB]; _g < _h.length; _g++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, nameA = "noName"] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([, nameA = "noName"] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(25, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(25, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(25, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(25, 6) Source(32, 30) + SourceIndex(0) -5 >Emitted(25, 16) Source(32, 46) + SourceIndex(0) -6 >Emitted(25, 18) Source(32, 30) + SourceIndex(0) -7 >Emitted(25, 24) Source(32, 31) + SourceIndex(0) -8 >Emitted(25, 30) Source(32, 37) + SourceIndex(0) -9 >Emitted(25, 32) Source(32, 39) + SourceIndex(0) -10>Emitted(25, 38) Source(32, 45) + SourceIndex(0) -11>Emitted(25, 39) Source(32, 46) + SourceIndex(0) -12>Emitted(25, 41) Source(32, 30) + SourceIndex(0) -13>Emitted(25, 55) Source(32, 46) + SourceIndex(0) -14>Emitted(25, 57) Source(32, 30) + SourceIndex(0) -15>Emitted(25, 61) Source(32, 46) + SourceIndex(0) +2 >Emitted(25, 6) Source(32, 30) + SourceIndex(0) +3 >Emitted(25, 16) Source(32, 46) + SourceIndex(0) +4 >Emitted(25, 18) Source(32, 30) + SourceIndex(0) +5 >Emitted(25, 24) Source(32, 31) + SourceIndex(0) +6 >Emitted(25, 30) Source(32, 37) + SourceIndex(0) +7 >Emitted(25, 32) Source(32, 39) + SourceIndex(0) +8 >Emitted(25, 38) Source(32, 45) + SourceIndex(0) +9 >Emitted(25, 39) Source(32, 46) + SourceIndex(0) +10>Emitted(25, 41) Source(32, 30) + SourceIndex(0) +11>Emitted(25, 55) Source(32, 46) + SourceIndex(0) +12>Emitted(25, 57) Source(32, 30) + SourceIndex(0) +13>Emitted(25, 61) Source(32, 46) + SourceIndex(0) --- >>> _j = _h[_g], _k = _j[1], nameA = _k === void 0 ? "noName" : _k; 1->^^^^^^^^^^^^^^^^^ @@ -708,43 +684,37 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _l = 0, multiRobots_1 = multiRobots; _l < multiRobots_1.length; _l++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(29, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(29, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(29, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(29, 6) Source(38, 30) + SourceIndex(0) -5 >Emitted(29, 16) Source(38, 41) + SourceIndex(0) -6 >Emitted(29, 18) Source(38, 30) + SourceIndex(0) -7 >Emitted(29, 45) Source(38, 41) + SourceIndex(0) -8 >Emitted(29, 47) Source(38, 30) + SourceIndex(0) -9 >Emitted(29, 72) Source(38, 41) + SourceIndex(0) -10>Emitted(29, 74) Source(38, 30) + SourceIndex(0) -11>Emitted(29, 78) Source(38, 41) + SourceIndex(0) +2 >Emitted(29, 6) Source(38, 30) + SourceIndex(0) +3 >Emitted(29, 16) Source(38, 41) + SourceIndex(0) +4 >Emitted(29, 18) Source(38, 30) + SourceIndex(0) +5 >Emitted(29, 45) Source(38, 41) + SourceIndex(0) +6 >Emitted(29, 47) Source(38, 30) + SourceIndex(0) +7 >Emitted(29, 72) Source(38, 41) + SourceIndex(0) +8 >Emitted(29, 74) Source(38, 30) + SourceIndex(0) +9 >Emitted(29, 78) Source(38, 41) + SourceIndex(0) --- >>> _m = multiRobots_1[_l], _o = _m[1], _p = _o === void 0 ? ["skill1", "skill2"] : _o, _q = _p[0], primarySkillA = _q === void 0 ? "primary" : _q, _r = _p[1], secondarySkillA = _r === void 0 ? "secondary" : _r; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -828,49 +798,43 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _s = 0, _t = getMultiRobots(); _s < _t.length; _s++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(33, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(33, 4) Source(41, 4) + SourceIndex(0) -3 >Emitted(33, 5) Source(41, 5) + SourceIndex(0) -4 >Emitted(33, 6) Source(44, 30) + SourceIndex(0) -5 >Emitted(33, 16) Source(44, 46) + SourceIndex(0) -6 >Emitted(33, 18) Source(44, 30) + SourceIndex(0) -7 >Emitted(33, 23) Source(44, 30) + SourceIndex(0) -8 >Emitted(33, 37) Source(44, 44) + SourceIndex(0) -9 >Emitted(33, 39) Source(44, 46) + SourceIndex(0) -10>Emitted(33, 41) Source(44, 30) + SourceIndex(0) -11>Emitted(33, 55) Source(44, 46) + SourceIndex(0) -12>Emitted(33, 57) Source(44, 30) + SourceIndex(0) -13>Emitted(33, 61) Source(44, 46) + SourceIndex(0) +2 >Emitted(33, 6) Source(44, 30) + SourceIndex(0) +3 >Emitted(33, 16) Source(44, 46) + SourceIndex(0) +4 >Emitted(33, 18) Source(44, 30) + SourceIndex(0) +5 >Emitted(33, 23) Source(44, 30) + SourceIndex(0) +6 >Emitted(33, 37) Source(44, 44) + SourceIndex(0) +7 >Emitted(33, 39) Source(44, 46) + SourceIndex(0) +8 >Emitted(33, 41) Source(44, 30) + SourceIndex(0) +9 >Emitted(33, 55) Source(44, 46) + SourceIndex(0) +10>Emitted(33, 57) Source(44, 30) + SourceIndex(0) +11>Emitted(33, 61) Source(44, 46) + SourceIndex(0) --- >>> _u = _t[_s], _v = _u[1], _w = _v === void 0 ? ["skill1", "skill2"] : _v, _x = _w[0], primarySkillA = _x === void 0 ? "primary" : _x, _y = _w[1], secondarySkillA = _y === void 0 ? "secondary" : _y; 1->^^^^^^^^^^^^^^^^^ @@ -954,55 +918,49 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _z = 0, _0 = [multiRobotA, multiRobotB]; _z < _0.length; _z++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([, [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for ([, [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(37, 1) Source(47, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(47, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(47, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(50, 30) + SourceIndex(0) -5 >Emitted(37, 16) Source(50, 56) + SourceIndex(0) -6 >Emitted(37, 18) Source(50, 30) + SourceIndex(0) -7 >Emitted(37, 24) Source(50, 31) + SourceIndex(0) -8 >Emitted(37, 35) Source(50, 42) + SourceIndex(0) -9 >Emitted(37, 37) Source(50, 44) + SourceIndex(0) -10>Emitted(37, 48) Source(50, 55) + SourceIndex(0) -11>Emitted(37, 49) Source(50, 56) + SourceIndex(0) -12>Emitted(37, 51) Source(50, 30) + SourceIndex(0) -13>Emitted(37, 65) Source(50, 56) + SourceIndex(0) -14>Emitted(37, 67) Source(50, 30) + SourceIndex(0) -15>Emitted(37, 71) Source(50, 56) + SourceIndex(0) +2 >Emitted(37, 6) Source(50, 30) + SourceIndex(0) +3 >Emitted(37, 16) Source(50, 56) + SourceIndex(0) +4 >Emitted(37, 18) Source(50, 30) + SourceIndex(0) +5 >Emitted(37, 24) Source(50, 31) + SourceIndex(0) +6 >Emitted(37, 35) Source(50, 42) + SourceIndex(0) +7 >Emitted(37, 37) Source(50, 44) + SourceIndex(0) +8 >Emitted(37, 48) Source(50, 55) + SourceIndex(0) +9 >Emitted(37, 49) Source(50, 56) + SourceIndex(0) +10>Emitted(37, 51) Source(50, 30) + SourceIndex(0) +11>Emitted(37, 65) Source(50, 56) + SourceIndex(0) +12>Emitted(37, 67) Source(50, 30) + SourceIndex(0) +13>Emitted(37, 71) Source(50, 56) + SourceIndex(0) --- >>> _1 = _0[_z], _2 = _1[1], _3 = _2 === void 0 ? ["skill1", "skill2"] : _2, _4 = _3[0], primarySkillA = _4 === void 0 ? "primary" : _4, _5 = _3[1], secondarySkillA = _5 === void 0 ? "secondary" : _5; 1->^^^^^^^^^^^^^^^^^ @@ -1086,40 +1044,34 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _6 = 0, robots_2 = robots; _6 < robots_2.length; _6++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > -2 >for -3 > -4 > ([numberB = -1] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([numberB = -1] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(41, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(41, 4) Source(54, 4) + SourceIndex(0) -3 >Emitted(41, 5) Source(54, 5) + SourceIndex(0) -4 >Emitted(41, 6) Source(54, 24) + SourceIndex(0) -5 >Emitted(41, 16) Source(54, 30) + SourceIndex(0) -6 >Emitted(41, 18) Source(54, 24) + SourceIndex(0) -7 >Emitted(41, 35) Source(54, 30) + SourceIndex(0) -8 >Emitted(41, 37) Source(54, 24) + SourceIndex(0) -9 >Emitted(41, 57) Source(54, 30) + SourceIndex(0) -10>Emitted(41, 59) Source(54, 24) + SourceIndex(0) -11>Emitted(41, 63) Source(54, 30) + SourceIndex(0) +2 >Emitted(41, 6) Source(54, 24) + SourceIndex(0) +3 >Emitted(41, 16) Source(54, 30) + SourceIndex(0) +4 >Emitted(41, 18) Source(54, 24) + SourceIndex(0) +5 >Emitted(41, 35) Source(54, 30) + SourceIndex(0) +6 >Emitted(41, 37) Source(54, 24) + SourceIndex(0) +7 >Emitted(41, 57) Source(54, 30) + SourceIndex(0) +8 >Emitted(41, 59) Source(54, 24) + SourceIndex(0) +9 >Emitted(41, 63) Source(54, 30) + SourceIndex(0) --- >>> _7 = robots_2[_6][0], numberB = _7 === void 0 ? -1 : _7; 1 >^^^^ @@ -1171,46 +1123,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _8 = 0, _9 = getRobots(); _8 < _9.length; _8++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^-> 1-> > -2 >for -3 > -4 > ([numberB = -1] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([numberB = -1] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(45, 1) Source(57, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(57, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(57, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(57, 24) + SourceIndex(0) -5 >Emitted(45, 16) Source(57, 35) + SourceIndex(0) -6 >Emitted(45, 18) Source(57, 24) + SourceIndex(0) -7 >Emitted(45, 23) Source(57, 24) + SourceIndex(0) -8 >Emitted(45, 32) Source(57, 33) + SourceIndex(0) -9 >Emitted(45, 34) Source(57, 35) + SourceIndex(0) -10>Emitted(45, 36) Source(57, 24) + SourceIndex(0) -11>Emitted(45, 50) Source(57, 35) + SourceIndex(0) -12>Emitted(45, 52) Source(57, 24) + SourceIndex(0) -13>Emitted(45, 56) Source(57, 35) + SourceIndex(0) +2 >Emitted(45, 6) Source(57, 24) + SourceIndex(0) +3 >Emitted(45, 16) Source(57, 35) + SourceIndex(0) +4 >Emitted(45, 18) Source(57, 24) + SourceIndex(0) +5 >Emitted(45, 23) Source(57, 24) + SourceIndex(0) +6 >Emitted(45, 32) Source(57, 33) + SourceIndex(0) +7 >Emitted(45, 34) Source(57, 35) + SourceIndex(0) +8 >Emitted(45, 36) Source(57, 24) + SourceIndex(0) +9 >Emitted(45, 50) Source(57, 35) + SourceIndex(0) +10>Emitted(45, 52) Source(57, 24) + SourceIndex(0) +11>Emitted(45, 56) Source(57, 35) + SourceIndex(0) --- >>> _10 = _9[_8][0], numberB = _10 === void 0 ? -1 : _10; 1->^^^^ @@ -1262,51 +1208,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _11 = 0, _12 = [robotA, robotB]; _11 < _12.length; _11++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ 1-> > -2 >for -3 > -4 > ([numberB = -1] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([numberB = -1] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(49, 1) Source(60, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(60, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(60, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(60, 24) + SourceIndex(0) -5 >Emitted(49, 17) Source(60, 40) + SourceIndex(0) -6 >Emitted(49, 19) Source(60, 24) + SourceIndex(0) -7 >Emitted(49, 26) Source(60, 25) + SourceIndex(0) -8 >Emitted(49, 32) Source(60, 31) + SourceIndex(0) -9 >Emitted(49, 34) Source(60, 33) + SourceIndex(0) -10>Emitted(49, 40) Source(60, 39) + SourceIndex(0) -11>Emitted(49, 41) Source(60, 40) + SourceIndex(0) -12>Emitted(49, 43) Source(60, 24) + SourceIndex(0) -13>Emitted(49, 59) Source(60, 40) + SourceIndex(0) -14>Emitted(49, 61) Source(60, 24) + SourceIndex(0) -15>Emitted(49, 66) Source(60, 40) + SourceIndex(0) +2 >Emitted(49, 6) Source(60, 24) + SourceIndex(0) +3 >Emitted(49, 17) Source(60, 40) + SourceIndex(0) +4 >Emitted(49, 19) Source(60, 24) + SourceIndex(0) +5 >Emitted(49, 26) Source(60, 25) + SourceIndex(0) +6 >Emitted(49, 32) Source(60, 31) + SourceIndex(0) +7 >Emitted(49, 34) Source(60, 33) + SourceIndex(0) +8 >Emitted(49, 40) Source(60, 39) + SourceIndex(0) +9 >Emitted(49, 41) Source(60, 40) + SourceIndex(0) +10>Emitted(49, 43) Source(60, 24) + SourceIndex(0) +11>Emitted(49, 59) Source(60, 40) + SourceIndex(0) +12>Emitted(49, 61) Source(60, 24) + SourceIndex(0) +13>Emitted(49, 66) Source(60, 40) + SourceIndex(0) --- >>> _13 = _12[_11][0], numberB = _13 === void 0 ? -1 : _13; 1 >^^^^ @@ -1358,39 +1298,33 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ 1-> > -2 >for -3 > -4 > ([nameB = "noName"] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ([nameB = "noName"] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(53, 1) Source(63, 1) + SourceIndex(0) -2 >Emitted(53, 4) Source(63, 4) + SourceIndex(0) -3 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) -4 >Emitted(53, 6) Source(63, 28) + SourceIndex(0) -5 >Emitted(53, 17) Source(63, 39) + SourceIndex(0) -6 >Emitted(53, 19) Source(63, 28) + SourceIndex(0) -7 >Emitted(53, 46) Source(63, 39) + SourceIndex(0) -8 >Emitted(53, 48) Source(63, 28) + SourceIndex(0) -9 >Emitted(53, 74) Source(63, 39) + SourceIndex(0) -10>Emitted(53, 76) Source(63, 28) + SourceIndex(0) -11>Emitted(53, 81) Source(63, 39) + SourceIndex(0) +2 >Emitted(53, 6) Source(63, 28) + SourceIndex(0) +3 >Emitted(53, 17) Source(63, 39) + SourceIndex(0) +4 >Emitted(53, 19) Source(63, 28) + SourceIndex(0) +5 >Emitted(53, 46) Source(63, 39) + SourceIndex(0) +6 >Emitted(53, 48) Source(63, 28) + SourceIndex(0) +7 >Emitted(53, 74) Source(63, 39) + SourceIndex(0) +8 >Emitted(53, 76) Source(63, 28) + SourceIndex(0) +9 >Emitted(53, 81) Source(63, 39) + SourceIndex(0) --- >>> _15 = multiRobots_2[_14][0], nameB = _15 === void 0 ? "noName" : _15; 1 >^^^^ @@ -1442,45 +1376,39 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _16 = 0, _17 = getMultiRobots(); _16 < _17.length; _16++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ 1-> > -2 >for -3 > -4 > ([nameB = "noName"] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ([nameB = "noName"] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(57, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(66, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(66, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(66, 28) + SourceIndex(0) -5 >Emitted(57, 17) Source(66, 44) + SourceIndex(0) -6 >Emitted(57, 19) Source(66, 28) + SourceIndex(0) -7 >Emitted(57, 25) Source(66, 28) + SourceIndex(0) -8 >Emitted(57, 39) Source(66, 42) + SourceIndex(0) -9 >Emitted(57, 41) Source(66, 44) + SourceIndex(0) -10>Emitted(57, 43) Source(66, 28) + SourceIndex(0) -11>Emitted(57, 59) Source(66, 44) + SourceIndex(0) -12>Emitted(57, 61) Source(66, 28) + SourceIndex(0) -13>Emitted(57, 66) Source(66, 44) + SourceIndex(0) +2 >Emitted(57, 6) Source(66, 28) + SourceIndex(0) +3 >Emitted(57, 17) Source(66, 44) + SourceIndex(0) +4 >Emitted(57, 19) Source(66, 28) + SourceIndex(0) +5 >Emitted(57, 25) Source(66, 28) + SourceIndex(0) +6 >Emitted(57, 39) Source(66, 42) + SourceIndex(0) +7 >Emitted(57, 41) Source(66, 44) + SourceIndex(0) +8 >Emitted(57, 43) Source(66, 28) + SourceIndex(0) +9 >Emitted(57, 59) Source(66, 44) + SourceIndex(0) +10>Emitted(57, 61) Source(66, 28) + SourceIndex(0) +11>Emitted(57, 66) Source(66, 44) + SourceIndex(0) --- >>> _18 = _17[_16][0], nameB = _18 === void 0 ? "noName" : _18; 1 >^^^^ @@ -1532,51 +1460,45 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _19 = 0, _20 = [multiRobotA, multiRobotB]; _19 < _20.length; _19++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ 1-> > -2 >for -3 > -4 > ([nameB = "noName"] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for ([nameB = "noName"] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(61, 1) Source(69, 1) + SourceIndex(0) -2 >Emitted(61, 4) Source(69, 4) + SourceIndex(0) -3 >Emitted(61, 5) Source(69, 5) + SourceIndex(0) -4 >Emitted(61, 6) Source(69, 28) + SourceIndex(0) -5 >Emitted(61, 17) Source(69, 54) + SourceIndex(0) -6 >Emitted(61, 19) Source(69, 28) + SourceIndex(0) -7 >Emitted(61, 26) Source(69, 29) + SourceIndex(0) -8 >Emitted(61, 37) Source(69, 40) + SourceIndex(0) -9 >Emitted(61, 39) Source(69, 42) + SourceIndex(0) -10>Emitted(61, 50) Source(69, 53) + SourceIndex(0) -11>Emitted(61, 51) Source(69, 54) + SourceIndex(0) -12>Emitted(61, 53) Source(69, 28) + SourceIndex(0) -13>Emitted(61, 69) Source(69, 54) + SourceIndex(0) -14>Emitted(61, 71) Source(69, 28) + SourceIndex(0) -15>Emitted(61, 76) Source(69, 54) + SourceIndex(0) +2 >Emitted(61, 6) Source(69, 28) + SourceIndex(0) +3 >Emitted(61, 17) Source(69, 54) + SourceIndex(0) +4 >Emitted(61, 19) Source(69, 28) + SourceIndex(0) +5 >Emitted(61, 26) Source(69, 29) + SourceIndex(0) +6 >Emitted(61, 37) Source(69, 40) + SourceIndex(0) +7 >Emitted(61, 39) Source(69, 42) + SourceIndex(0) +8 >Emitted(61, 50) Source(69, 53) + SourceIndex(0) +9 >Emitted(61, 51) Source(69, 54) + SourceIndex(0) +10>Emitted(61, 53) Source(69, 28) + SourceIndex(0) +11>Emitted(61, 69) Source(69, 54) + SourceIndex(0) +12>Emitted(61, 71) Source(69, 28) + SourceIndex(0) +13>Emitted(61, 76) Source(69, 54) + SourceIndex(0) --- >>> _21 = _20[_19][0], nameB = _21 === void 0 ? "noName" : _21; 1 >^^^^ @@ -1628,41 +1550,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _22 = 0, robots_3 = robots; _22 < robots_3.length; _22++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(65, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(65, 4) Source(73, 4) + SourceIndex(0) -3 >Emitted(65, 5) Source(73, 5) + SourceIndex(0) -4 >Emitted(65, 6) Source(73, 63) + SourceIndex(0) -5 >Emitted(65, 17) Source(73, 69) + SourceIndex(0) -6 >Emitted(65, 19) Source(73, 63) + SourceIndex(0) -7 >Emitted(65, 36) Source(73, 69) + SourceIndex(0) -8 >Emitted(65, 38) Source(73, 63) + SourceIndex(0) -9 >Emitted(65, 59) Source(73, 69) + SourceIndex(0) -10>Emitted(65, 61) Source(73, 63) + SourceIndex(0) -11>Emitted(65, 66) Source(73, 69) + SourceIndex(0) +2 >Emitted(65, 6) Source(73, 63) + SourceIndex(0) +3 >Emitted(65, 17) Source(73, 69) + SourceIndex(0) +4 >Emitted(65, 19) Source(73, 63) + SourceIndex(0) +5 >Emitted(65, 36) Source(73, 69) + SourceIndex(0) +6 >Emitted(65, 38) Source(73, 63) + SourceIndex(0) +7 >Emitted(65, 59) Source(73, 69) + SourceIndex(0) +8 >Emitted(65, 61) Source(73, 63) + SourceIndex(0) +9 >Emitted(65, 66) Source(73, 69) + SourceIndex(0) --- >>> _23 = robots_3[_22], _24 = _23[0], numberA2 = _24 === void 0 ? -1 : _24, _25 = _23[1], nameA2 = _25 === void 0 ? "noName" : _25, _26 = _23[2], skillA2 = _26 === void 0 ? "skill" : _26; 1->^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1738,46 +1654,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _27 = 0, _28 = getRobots(); _27 < _28.length; _27++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(69, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(69, 4) Source(76, 4) + SourceIndex(0) -3 >Emitted(69, 5) Source(76, 5) + SourceIndex(0) -4 >Emitted(69, 6) Source(76, 63) + SourceIndex(0) -5 >Emitted(69, 17) Source(76, 74) + SourceIndex(0) -6 >Emitted(69, 19) Source(76, 63) + SourceIndex(0) -7 >Emitted(69, 25) Source(76, 63) + SourceIndex(0) -8 >Emitted(69, 34) Source(76, 72) + SourceIndex(0) -9 >Emitted(69, 36) Source(76, 74) + SourceIndex(0) -10>Emitted(69, 38) Source(76, 63) + SourceIndex(0) -11>Emitted(69, 54) Source(76, 74) + SourceIndex(0) -12>Emitted(69, 56) Source(76, 63) + SourceIndex(0) -13>Emitted(69, 61) Source(76, 74) + SourceIndex(0) +2 >Emitted(69, 6) Source(76, 63) + SourceIndex(0) +3 >Emitted(69, 17) Source(76, 74) + SourceIndex(0) +4 >Emitted(69, 19) Source(76, 63) + SourceIndex(0) +5 >Emitted(69, 25) Source(76, 63) + SourceIndex(0) +6 >Emitted(69, 34) Source(76, 72) + SourceIndex(0) +7 >Emitted(69, 36) Source(76, 74) + SourceIndex(0) +8 >Emitted(69, 38) Source(76, 63) + SourceIndex(0) +9 >Emitted(69, 54) Source(76, 74) + SourceIndex(0) +10>Emitted(69, 56) Source(76, 63) + SourceIndex(0) +11>Emitted(69, 61) Source(76, 74) + SourceIndex(0) --- >>> _29 = _28[_27], _30 = _29[0], numberA2 = _30 === void 0 ? -1 : _30, _31 = _29[1], nameA2 = _31 === void 0 ? "noName" : _31, _32 = _29[2], skillA2 = _32 === void 0 ? "skill" : _32; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1853,52 +1763,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _33 = 0, _34 = [robotA, robotB]; _33 < _34.length; _33++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(73, 1) Source(79, 1) + SourceIndex(0) -2 >Emitted(73, 4) Source(79, 4) + SourceIndex(0) -3 >Emitted(73, 5) Source(79, 5) + SourceIndex(0) -4 >Emitted(73, 6) Source(79, 63) + SourceIndex(0) -5 >Emitted(73, 17) Source(79, 79) + SourceIndex(0) -6 >Emitted(73, 19) Source(79, 63) + SourceIndex(0) -7 >Emitted(73, 26) Source(79, 64) + SourceIndex(0) -8 >Emitted(73, 32) Source(79, 70) + SourceIndex(0) -9 >Emitted(73, 34) Source(79, 72) + SourceIndex(0) -10>Emitted(73, 40) Source(79, 78) + SourceIndex(0) -11>Emitted(73, 41) Source(79, 79) + SourceIndex(0) -12>Emitted(73, 43) Source(79, 63) + SourceIndex(0) -13>Emitted(73, 59) Source(79, 79) + SourceIndex(0) -14>Emitted(73, 61) Source(79, 63) + SourceIndex(0) -15>Emitted(73, 66) Source(79, 79) + SourceIndex(0) +2 >Emitted(73, 6) Source(79, 63) + SourceIndex(0) +3 >Emitted(73, 17) Source(79, 79) + SourceIndex(0) +4 >Emitted(73, 19) Source(79, 63) + SourceIndex(0) +5 >Emitted(73, 26) Source(79, 64) + SourceIndex(0) +6 >Emitted(73, 32) Source(79, 70) + SourceIndex(0) +7 >Emitted(73, 34) Source(79, 72) + SourceIndex(0) +8 >Emitted(73, 40) Source(79, 78) + SourceIndex(0) +9 >Emitted(73, 41) Source(79, 79) + SourceIndex(0) +10>Emitted(73, 43) Source(79, 63) + SourceIndex(0) +11>Emitted(73, 59) Source(79, 79) + SourceIndex(0) +12>Emitted(73, 61) Source(79, 63) + SourceIndex(0) +13>Emitted(73, 66) Source(79, 79) + SourceIndex(0) --- >>> _35 = _34[_33], _36 = _35[0], numberA2 = _36 === void 0 ? -1 : _36, _37 = _35[1], nameA2 = _37 === void 0 ? "noName" : _37, _38 = _35[2], skillA2 = _38 === void 0 ? "skill" : _38; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1974,43 +1878,37 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([nameMA = "noName", [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(77, 1) Source(82, 1) + SourceIndex(0) -2 >Emitted(77, 4) Source(82, 4) + SourceIndex(0) -3 >Emitted(77, 5) Source(82, 5) + SourceIndex(0) -4 >Emitted(77, 6) Source(85, 30) + SourceIndex(0) -5 >Emitted(77, 17) Source(85, 41) + SourceIndex(0) -6 >Emitted(77, 19) Source(85, 30) + SourceIndex(0) -7 >Emitted(77, 46) Source(85, 41) + SourceIndex(0) -8 >Emitted(77, 48) Source(85, 30) + SourceIndex(0) -9 >Emitted(77, 74) Source(85, 41) + SourceIndex(0) -10>Emitted(77, 76) Source(85, 30) + SourceIndex(0) -11>Emitted(77, 81) Source(85, 41) + SourceIndex(0) +2 >Emitted(77, 6) Source(85, 30) + SourceIndex(0) +3 >Emitted(77, 17) Source(85, 41) + SourceIndex(0) +4 >Emitted(77, 19) Source(85, 30) + SourceIndex(0) +5 >Emitted(77, 46) Source(85, 41) + SourceIndex(0) +6 >Emitted(77, 48) Source(85, 30) + SourceIndex(0) +7 >Emitted(77, 74) Source(85, 41) + SourceIndex(0) +8 >Emitted(77, 76) Source(85, 30) + SourceIndex(0) +9 >Emitted(77, 81) Source(85, 41) + SourceIndex(0) --- >>> _40 = multiRobots_3[_39], _41 = _40[0], nameMA = _41 === void 0 ? "noName" : _41, _42 = _40[1], _43 = _42 === void 0 ? ["skill1", "skill2"] : _42, _44 = _43[0], primarySkillA = _44 === void 0 ? "primary" : _44, _45 = _43[1], secondarySkillA = _45 === void 0 ? "secondary" : _45; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2106,49 +2004,43 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([nameMA = "noName", [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(81, 1) Source(88, 1) + SourceIndex(0) -2 >Emitted(81, 4) Source(88, 4) + SourceIndex(0) -3 >Emitted(81, 5) Source(88, 5) + SourceIndex(0) -4 >Emitted(81, 6) Source(91, 30) + SourceIndex(0) -5 >Emitted(81, 17) Source(91, 46) + SourceIndex(0) -6 >Emitted(81, 19) Source(91, 30) + SourceIndex(0) -7 >Emitted(81, 25) Source(91, 30) + SourceIndex(0) -8 >Emitted(81, 39) Source(91, 44) + SourceIndex(0) -9 >Emitted(81, 41) Source(91, 46) + SourceIndex(0) -10>Emitted(81, 43) Source(91, 30) + SourceIndex(0) -11>Emitted(81, 59) Source(91, 46) + SourceIndex(0) -12>Emitted(81, 61) Source(91, 30) + SourceIndex(0) -13>Emitted(81, 66) Source(91, 46) + SourceIndex(0) +2 >Emitted(81, 6) Source(91, 30) + SourceIndex(0) +3 >Emitted(81, 17) Source(91, 46) + SourceIndex(0) +4 >Emitted(81, 19) Source(91, 30) + SourceIndex(0) +5 >Emitted(81, 25) Source(91, 30) + SourceIndex(0) +6 >Emitted(81, 39) Source(91, 44) + SourceIndex(0) +7 >Emitted(81, 41) Source(91, 46) + SourceIndex(0) +8 >Emitted(81, 43) Source(91, 30) + SourceIndex(0) +9 >Emitted(81, 59) Source(91, 46) + SourceIndex(0) +10>Emitted(81, 61) Source(91, 30) + SourceIndex(0) +11>Emitted(81, 66) Source(91, 46) + SourceIndex(0) --- >>> _48 = _47[_46], _49 = _48[0], nameMA = _49 === void 0 ? "noName" : _49, _50 = _48[1], _51 = _50 === void 0 ? ["skill1", "skill2"] : _50, _52 = _51[0], primarySkillA = _52 === void 0 ? "primary" : _52, _53 = _51[1], secondarySkillA = _53 === void 0 ? "secondary" : _53; 1->^^^^^^^^^^^^^^^^^^^^ @@ -2244,55 +2136,49 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _54 = 0, _55 = [multiRobotA, multiRobotB]; _54 < _55.length; _54++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^^^^^^ -9 > ^^ -10> ^^^^^^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^^^^^^ +7 > ^^ +8 > ^^^^^^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([nameMA = "noName", [ - > primarySkillA = "primary", - > secondarySkillA = "secondary" - > ] = ["skill1", "skill2"]] of -5 > [multiRobotA, multiRobotB] -6 > -7 > [ -8 > multiRobotA -9 > , -10> multiRobotB -11> ] -12> -13> [multiRobotA, multiRobotB] -14> -15> [multiRobotA, multiRobotB] +2 >for ([nameMA = "noName", [ + > primarySkillA = "primary", + > secondarySkillA = "secondary" + >] = ["skill1", "skill2"]] of +3 > [multiRobotA, multiRobotB] +4 > +5 > [ +6 > multiRobotA +7 > , +8 > multiRobotB +9 > ] +10> +11> [multiRobotA, multiRobotB] +12> +13> [multiRobotA, multiRobotB] 1->Emitted(85, 1) Source(94, 1) + SourceIndex(0) -2 >Emitted(85, 4) Source(94, 4) + SourceIndex(0) -3 >Emitted(85, 5) Source(94, 5) + SourceIndex(0) -4 >Emitted(85, 6) Source(97, 30) + SourceIndex(0) -5 >Emitted(85, 17) Source(97, 56) + SourceIndex(0) -6 >Emitted(85, 19) Source(97, 30) + SourceIndex(0) -7 >Emitted(85, 26) Source(97, 31) + SourceIndex(0) -8 >Emitted(85, 37) Source(97, 42) + SourceIndex(0) -9 >Emitted(85, 39) Source(97, 44) + SourceIndex(0) -10>Emitted(85, 50) Source(97, 55) + SourceIndex(0) -11>Emitted(85, 51) Source(97, 56) + SourceIndex(0) -12>Emitted(85, 53) Source(97, 30) + SourceIndex(0) -13>Emitted(85, 69) Source(97, 56) + SourceIndex(0) -14>Emitted(85, 71) Source(97, 30) + SourceIndex(0) -15>Emitted(85, 76) Source(97, 56) + SourceIndex(0) +2 >Emitted(85, 6) Source(97, 30) + SourceIndex(0) +3 >Emitted(85, 17) Source(97, 56) + SourceIndex(0) +4 >Emitted(85, 19) Source(97, 30) + SourceIndex(0) +5 >Emitted(85, 26) Source(97, 31) + SourceIndex(0) +6 >Emitted(85, 37) Source(97, 42) + SourceIndex(0) +7 >Emitted(85, 39) Source(97, 44) + SourceIndex(0) +8 >Emitted(85, 50) Source(97, 55) + SourceIndex(0) +9 >Emitted(85, 51) Source(97, 56) + SourceIndex(0) +10>Emitted(85, 53) Source(97, 30) + SourceIndex(0) +11>Emitted(85, 69) Source(97, 56) + SourceIndex(0) +12>Emitted(85, 71) Source(97, 30) + SourceIndex(0) +13>Emitted(85, 76) Source(97, 56) + SourceIndex(0) --- >>> _56 = _55[_54], _57 = _56[0], nameMA = _57 === void 0 ? "noName" : _57, _58 = _56[1], _59 = _58 === void 0 ? ["skill1", "skill2"] : _58, _60 = _59[0], primarySkillA = _60 === void 0 ? "primary" : _60, _61 = _59[1], secondarySkillA = _61 === void 0 ? "secondary" : _61; 1->^^^^^^^^^^^^^^^^^^^^ @@ -2388,41 +2274,35 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > ([numberA3 = -1, ...robotAInfo] of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ([numberA3 = -1, ...robotAInfo] of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(89, 1) Source(101, 1) + SourceIndex(0) -2 >Emitted(89, 4) Source(101, 4) + SourceIndex(0) -3 >Emitted(89, 5) Source(101, 5) + SourceIndex(0) -4 >Emitted(89, 6) Source(101, 40) + SourceIndex(0) -5 >Emitted(89, 17) Source(101, 46) + SourceIndex(0) -6 >Emitted(89, 19) Source(101, 40) + SourceIndex(0) -7 >Emitted(89, 36) Source(101, 46) + SourceIndex(0) -8 >Emitted(89, 38) Source(101, 40) + SourceIndex(0) -9 >Emitted(89, 59) Source(101, 46) + SourceIndex(0) -10>Emitted(89, 61) Source(101, 40) + SourceIndex(0) -11>Emitted(89, 66) Source(101, 46) + SourceIndex(0) +2 >Emitted(89, 6) Source(101, 40) + SourceIndex(0) +3 >Emitted(89, 17) Source(101, 46) + SourceIndex(0) +4 >Emitted(89, 19) Source(101, 40) + SourceIndex(0) +5 >Emitted(89, 36) Source(101, 46) + SourceIndex(0) +6 >Emitted(89, 38) Source(101, 40) + SourceIndex(0) +7 >Emitted(89, 59) Source(101, 46) + SourceIndex(0) +8 >Emitted(89, 61) Source(101, 40) + SourceIndex(0) +9 >Emitted(89, 66) Source(101, 46) + SourceIndex(0) --- >>> _63 = robots_4[_62], _64 = _63[0], numberA3 = _64 === void 0 ? -1 : _64, robotAInfo = _63.slice(1); 1->^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2480,46 +2360,40 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _65 = 0, _66 = getRobots(); _65 < _66.length; _65++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([numberA3 = -1, ...robotAInfo] of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ([numberA3 = -1, ...robotAInfo] of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(93, 1) Source(104, 1) + SourceIndex(0) -2 >Emitted(93, 4) Source(104, 4) + SourceIndex(0) -3 >Emitted(93, 5) Source(104, 5) + SourceIndex(0) -4 >Emitted(93, 6) Source(104, 40) + SourceIndex(0) -5 >Emitted(93, 17) Source(104, 51) + SourceIndex(0) -6 >Emitted(93, 19) Source(104, 40) + SourceIndex(0) -7 >Emitted(93, 25) Source(104, 40) + SourceIndex(0) -8 >Emitted(93, 34) Source(104, 49) + SourceIndex(0) -9 >Emitted(93, 36) Source(104, 51) + SourceIndex(0) -10>Emitted(93, 38) Source(104, 40) + SourceIndex(0) -11>Emitted(93, 54) Source(104, 51) + SourceIndex(0) -12>Emitted(93, 56) Source(104, 40) + SourceIndex(0) -13>Emitted(93, 61) Source(104, 51) + SourceIndex(0) +2 >Emitted(93, 6) Source(104, 40) + SourceIndex(0) +3 >Emitted(93, 17) Source(104, 51) + SourceIndex(0) +4 >Emitted(93, 19) Source(104, 40) + SourceIndex(0) +5 >Emitted(93, 25) Source(104, 40) + SourceIndex(0) +6 >Emitted(93, 34) Source(104, 49) + SourceIndex(0) +7 >Emitted(93, 36) Source(104, 51) + SourceIndex(0) +8 >Emitted(93, 38) Source(104, 40) + SourceIndex(0) +9 >Emitted(93, 54) Source(104, 51) + SourceIndex(0) +10>Emitted(93, 56) Source(104, 40) + SourceIndex(0) +11>Emitted(93, 61) Source(104, 51) + SourceIndex(0) --- >>> _67 = _66[_65], _68 = _67[0], numberA3 = _68 === void 0 ? -1 : _68, robotAInfo = _67.slice(1); 1->^^^^^^^^^^^^^^^^^^^^ @@ -2577,52 +2451,46 @@ sourceFile:sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues --- >>>for (var _69 = 0, _70 = [robotA, robotB]; _69 < _70.length; _69++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^^^^^ -9 > ^^ -10> ^^^^^^ -11> ^ -12> ^^ -13> ^^^^^^^^^^^^^^^^ -14> ^^ -15> ^^^^^ -16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^^^^^ +7 > ^^ +8 > ^^^^^^ +9 > ^ +10> ^^ +11> ^^^^^^^^^^^^^^^^ +12> ^^ +13> ^^^^^ +14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ([numberA3 = -1, ...robotAInfo] of -5 > [robotA, robotB] -6 > -7 > [ -8 > robotA -9 > , -10> robotB -11> ] -12> -13> [robotA, robotB] -14> -15> [robotA, robotB] +2 >for ([numberA3 = -1, ...robotAInfo] of +3 > [robotA, robotB] +4 > +5 > [ +6 > robotA +7 > , +8 > robotB +9 > ] +10> +11> [robotA, robotB] +12> +13> [robotA, robotB] 1->Emitted(97, 1) Source(107, 1) + SourceIndex(0) -2 >Emitted(97, 4) Source(107, 4) + SourceIndex(0) -3 >Emitted(97, 5) Source(107, 5) + SourceIndex(0) -4 >Emitted(97, 6) Source(107, 40) + SourceIndex(0) -5 >Emitted(97, 17) Source(107, 56) + SourceIndex(0) -6 >Emitted(97, 19) Source(107, 40) + SourceIndex(0) -7 >Emitted(97, 26) Source(107, 41) + SourceIndex(0) -8 >Emitted(97, 32) Source(107, 47) + SourceIndex(0) -9 >Emitted(97, 34) Source(107, 49) + SourceIndex(0) -10>Emitted(97, 40) Source(107, 55) + SourceIndex(0) -11>Emitted(97, 41) Source(107, 56) + SourceIndex(0) -12>Emitted(97, 43) Source(107, 40) + SourceIndex(0) -13>Emitted(97, 59) Source(107, 56) + SourceIndex(0) -14>Emitted(97, 61) Source(107, 40) + SourceIndex(0) -15>Emitted(97, 66) Source(107, 56) + SourceIndex(0) +2 >Emitted(97, 6) Source(107, 40) + SourceIndex(0) +3 >Emitted(97, 17) Source(107, 56) + SourceIndex(0) +4 >Emitted(97, 19) Source(107, 40) + SourceIndex(0) +5 >Emitted(97, 26) Source(107, 41) + SourceIndex(0) +6 >Emitted(97, 32) Source(107, 47) + SourceIndex(0) +7 >Emitted(97, 34) Source(107, 49) + SourceIndex(0) +8 >Emitted(97, 40) Source(107, 55) + SourceIndex(0) +9 >Emitted(97, 41) Source(107, 56) + SourceIndex(0) +10>Emitted(97, 43) Source(107, 40) + SourceIndex(0) +11>Emitted(97, 59) Source(107, 56) + SourceIndex(0) +12>Emitted(97, 61) Source(107, 40) + SourceIndex(0) +13>Emitted(97, 66) Source(107, 56) + SourceIndex(0) --- >>> _71 = _70[_69], _72 = _71[0], numberA3 = _72 === void 0 ? -1 : _72, robotAInfo = _71.slice(1); 1->^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map index 3fe49ed9ef9..040c20c53ae 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfObjectBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,IAAA,yBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,IAAA,mBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAA7F,IAAA,mBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAiE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArE,IAAA,6BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAiE,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1E,IAAA,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAiE,UACS,EADT,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADT,cACS,EADT,IACS;IADnE,IAAA,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAEzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAAsC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvC,IAAA,iBAA6B,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAsC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5C,IAAA,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAsC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAA7G,IAAA,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAAnF,IAAA,sBAAoE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAAxF,IAAA,WAAoE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6E,UACH,EADG,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjJ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADG,cACH,EADG,IACH;IADrE,IAAA,WAAoE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,KAA2B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,IAAA,yBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA2B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,IAAA,mBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA2B,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAA7F,IAAA,mBAAW;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAqE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArE,IAAA,6BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAqE,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1E,IAAA,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAqE,UACS,EADT,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADT,cACS,EADT,IACS;IADnE,IAAA,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAEzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,KAA0C,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvC,IAAA,iBAA6B,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA0C,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5C,IAAA,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA0C,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAA7G,IAAA,WAA6B,EAA5B,eAAW,EAAE,iBAAa;IAChC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAiF,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAAnF,IAAA,sBAAoE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAiF,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAAxF,IAAA,WAAoE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAiF,UACH,EADG,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjJ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADG,cACH,EADG,IACH;IADrE,IAAA,WAAoE,EAAnE,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt index a22c02644c2..b5edc634d61 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.sourcemap.txt @@ -246,21 +246,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) --- >>>} 1 > @@ -282,21 +279,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) --- >>>} 1 > @@ -310,40 +304,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > -2 >for -3 > -4 > (let {name: nameA } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let {name: nameA } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(10, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(10, 6) Source(29, 28) + SourceIndex(0) -5 >Emitted(10, 16) Source(29, 34) + SourceIndex(0) -6 >Emitted(10, 18) Source(29, 28) + SourceIndex(0) -7 >Emitted(10, 35) Source(29, 34) + SourceIndex(0) -8 >Emitted(10, 37) Source(29, 28) + SourceIndex(0) -9 >Emitted(10, 57) Source(29, 34) + SourceIndex(0) -10>Emitted(10, 59) Source(29, 28) + SourceIndex(0) -11>Emitted(10, 63) Source(29, 34) + SourceIndex(0) +2 >Emitted(10, 6) Source(29, 28) + SourceIndex(0) +3 >Emitted(10, 16) Source(29, 34) + SourceIndex(0) +4 >Emitted(10, 18) Source(29, 28) + SourceIndex(0) +5 >Emitted(10, 35) Source(29, 34) + SourceIndex(0) +6 >Emitted(10, 37) Source(29, 28) + SourceIndex(0) +7 >Emitted(10, 57) Source(29, 34) + SourceIndex(0) +8 >Emitted(10, 59) Source(29, 28) + SourceIndex(0) +9 >Emitted(10, 63) Source(29, 34) + SourceIndex(0) --- >>> var nameA = robots_1[_i].name; 1 >^^^^ @@ -392,45 +380,39 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > (let {name: nameA } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let {name: nameA } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(14, 6) Source(32, 28) + SourceIndex(0) -5 >Emitted(14, 16) Source(32, 39) + SourceIndex(0) -6 >Emitted(14, 18) Source(32, 28) + SourceIndex(0) -7 >Emitted(14, 23) Source(32, 28) + SourceIndex(0) -8 >Emitted(14, 32) Source(32, 37) + SourceIndex(0) -9 >Emitted(14, 34) Source(32, 39) + SourceIndex(0) -10>Emitted(14, 36) Source(32, 28) + SourceIndex(0) -11>Emitted(14, 50) Source(32, 39) + SourceIndex(0) -12>Emitted(14, 52) Source(32, 28) + SourceIndex(0) -13>Emitted(14, 56) Source(32, 39) + SourceIndex(0) +2 >Emitted(14, 6) Source(32, 28) + SourceIndex(0) +3 >Emitted(14, 16) Source(32, 39) + SourceIndex(0) +4 >Emitted(14, 18) Source(32, 28) + SourceIndex(0) +5 >Emitted(14, 23) Source(32, 28) + SourceIndex(0) +6 >Emitted(14, 32) Source(32, 37) + SourceIndex(0) +7 >Emitted(14, 34) Source(32, 39) + SourceIndex(0) +8 >Emitted(14, 36) Source(32, 28) + SourceIndex(0) +9 >Emitted(14, 50) Source(32, 39) + SourceIndex(0) +10>Emitted(14, 52) Source(32, 28) + SourceIndex(0) +11>Emitted(14, 56) Source(32, 39) + SourceIndex(0) --- >>> var nameA = _b[_a].name; 1 >^^^^ @@ -479,99 +461,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > (let {name: nameA } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for (let {name: nameA } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(18, 6) Source(35, 28) + SourceIndex(0) -5 >Emitted(18, 16) Source(35, 104) + SourceIndex(0) -6 >Emitted(18, 18) Source(35, 28) + SourceIndex(0) -7 >Emitted(18, 24) Source(35, 29) + SourceIndex(0) -8 >Emitted(18, 26) Source(35, 31) + SourceIndex(0) -9 >Emitted(18, 30) Source(35, 35) + SourceIndex(0) -10>Emitted(18, 32) Source(35, 37) + SourceIndex(0) -11>Emitted(18, 39) Source(35, 44) + SourceIndex(0) -12>Emitted(18, 41) Source(35, 46) + SourceIndex(0) -13>Emitted(18, 46) Source(35, 51) + SourceIndex(0) -14>Emitted(18, 48) Source(35, 53) + SourceIndex(0) -15>Emitted(18, 56) Source(35, 61) + SourceIndex(0) -16>Emitted(18, 58) Source(35, 63) + SourceIndex(0) -17>Emitted(18, 60) Source(35, 65) + SourceIndex(0) -18>Emitted(18, 62) Source(35, 67) + SourceIndex(0) -19>Emitted(18, 66) Source(35, 71) + SourceIndex(0) -20>Emitted(18, 68) Source(35, 73) + SourceIndex(0) -21>Emitted(18, 77) Source(35, 82) + SourceIndex(0) -22>Emitted(18, 79) Source(35, 84) + SourceIndex(0) -23>Emitted(18, 84) Source(35, 89) + SourceIndex(0) -24>Emitted(18, 86) Source(35, 91) + SourceIndex(0) -25>Emitted(18, 96) Source(35, 101) + SourceIndex(0) -26>Emitted(18, 98) Source(35, 103) + SourceIndex(0) -27>Emitted(18, 99) Source(35, 104) + SourceIndex(0) -28>Emitted(18, 101) Source(35, 28) + SourceIndex(0) -29>Emitted(18, 115) Source(35, 104) + SourceIndex(0) -30>Emitted(18, 117) Source(35, 28) + SourceIndex(0) -31>Emitted(18, 121) Source(35, 104) + SourceIndex(0) +2 >Emitted(18, 6) Source(35, 28) + SourceIndex(0) +3 >Emitted(18, 16) Source(35, 104) + SourceIndex(0) +4 >Emitted(18, 18) Source(35, 28) + SourceIndex(0) +5 >Emitted(18, 24) Source(35, 29) + SourceIndex(0) +6 >Emitted(18, 26) Source(35, 31) + SourceIndex(0) +7 >Emitted(18, 30) Source(35, 35) + SourceIndex(0) +8 >Emitted(18, 32) Source(35, 37) + SourceIndex(0) +9 >Emitted(18, 39) Source(35, 44) + SourceIndex(0) +10>Emitted(18, 41) Source(35, 46) + SourceIndex(0) +11>Emitted(18, 46) Source(35, 51) + SourceIndex(0) +12>Emitted(18, 48) Source(35, 53) + SourceIndex(0) +13>Emitted(18, 56) Source(35, 61) + SourceIndex(0) +14>Emitted(18, 58) Source(35, 63) + SourceIndex(0) +15>Emitted(18, 60) Source(35, 65) + SourceIndex(0) +16>Emitted(18, 62) Source(35, 67) + SourceIndex(0) +17>Emitted(18, 66) Source(35, 71) + SourceIndex(0) +18>Emitted(18, 68) Source(35, 73) + SourceIndex(0) +19>Emitted(18, 77) Source(35, 82) + SourceIndex(0) +20>Emitted(18, 79) Source(35, 84) + SourceIndex(0) +21>Emitted(18, 84) Source(35, 89) + SourceIndex(0) +22>Emitted(18, 86) Source(35, 91) + SourceIndex(0) +23>Emitted(18, 96) Source(35, 101) + SourceIndex(0) +24>Emitted(18, 98) Source(35, 103) + SourceIndex(0) +25>Emitted(18, 99) Source(35, 104) + SourceIndex(0) +26>Emitted(18, 101) Source(35, 28) + SourceIndex(0) +27>Emitted(18, 115) Source(35, 104) + SourceIndex(0) +28>Emitted(18, 117) Source(35, 28) + SourceIndex(0) +29>Emitted(18, 121) Source(35, 104) + SourceIndex(0) --- >>> var nameA = _d[_c].name; 1 >^^^^ @@ -620,40 +596,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(22, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(22, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(22, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(22, 6) Source(38, 70) + SourceIndex(0) -5 >Emitted(22, 16) Source(38, 81) + SourceIndex(0) -6 >Emitted(22, 18) Source(38, 70) + SourceIndex(0) -7 >Emitted(22, 45) Source(38, 81) + SourceIndex(0) -8 >Emitted(22, 47) Source(38, 70) + SourceIndex(0) -9 >Emitted(22, 72) Source(38, 81) + SourceIndex(0) -10>Emitted(22, 74) Source(38, 70) + SourceIndex(0) -11>Emitted(22, 78) Source(38, 81) + SourceIndex(0) +2 >Emitted(22, 6) Source(38, 70) + SourceIndex(0) +3 >Emitted(22, 16) Source(38, 81) + SourceIndex(0) +4 >Emitted(22, 18) Source(38, 70) + SourceIndex(0) +5 >Emitted(22, 45) Source(38, 81) + SourceIndex(0) +6 >Emitted(22, 47) Source(38, 70) + SourceIndex(0) +7 >Emitted(22, 72) Source(38, 81) + SourceIndex(0) +8 >Emitted(22, 74) Source(38, 70) + SourceIndex(0) +9 >Emitted(22, 78) Source(38, 81) + SourceIndex(0) --- >>> var _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; 1->^^^^ @@ -714,46 +684,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(26, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(26, 4) Source(41, 4) + SourceIndex(0) -3 >Emitted(26, 5) Source(41, 5) + SourceIndex(0) -4 >Emitted(26, 6) Source(41, 70) + SourceIndex(0) -5 >Emitted(26, 16) Source(41, 86) + SourceIndex(0) -6 >Emitted(26, 18) Source(41, 70) + SourceIndex(0) -7 >Emitted(26, 23) Source(41, 70) + SourceIndex(0) -8 >Emitted(26, 37) Source(41, 84) + SourceIndex(0) -9 >Emitted(26, 39) Source(41, 86) + SourceIndex(0) -10>Emitted(26, 41) Source(41, 70) + SourceIndex(0) -11>Emitted(26, 55) Source(41, 86) + SourceIndex(0) -12>Emitted(26, 57) Source(41, 70) + SourceIndex(0) -13>Emitted(26, 61) Source(41, 86) + SourceIndex(0) +2 >Emitted(26, 6) Source(41, 70) + SourceIndex(0) +3 >Emitted(26, 16) Source(41, 86) + SourceIndex(0) +4 >Emitted(26, 18) Source(41, 70) + SourceIndex(0) +5 >Emitted(26, 23) Source(41, 70) + SourceIndex(0) +6 >Emitted(26, 37) Source(41, 84) + SourceIndex(0) +7 >Emitted(26, 39) Source(41, 86) + SourceIndex(0) +8 >Emitted(26, 41) Source(41, 70) + SourceIndex(0) +9 >Emitted(26, 55) Source(41, 86) + SourceIndex(0) +10>Emitted(26, 57) Source(41, 70) + SourceIndex(0) +11>Emitted(26, 61) Source(41, 86) + SourceIndex(0) --- >>> var _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; 1->^^^^ @@ -814,80 +778,74 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { skills: { primary: primaryA, secondary: secondaryA } } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for (let { skills: { primary: primaryA, secondary: secondaryA } } of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(30, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(44, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(44, 70) + SourceIndex(0) -5 >Emitted(30, 16) Source(45, 79) + SourceIndex(0) -6 >Emitted(30, 18) Source(44, 70) + SourceIndex(0) -7 >Emitted(30, 24) Source(44, 71) + SourceIndex(0) -8 >Emitted(30, 26) Source(44, 73) + SourceIndex(0) -9 >Emitted(30, 30) Source(44, 77) + SourceIndex(0) -10>Emitted(30, 32) Source(44, 79) + SourceIndex(0) -11>Emitted(30, 39) Source(44, 86) + SourceIndex(0) -12>Emitted(30, 41) Source(44, 88) + SourceIndex(0) -13>Emitted(30, 47) Source(44, 94) + SourceIndex(0) -14>Emitted(30, 49) Source(44, 96) + SourceIndex(0) -15>Emitted(30, 51) Source(44, 98) + SourceIndex(0) -16>Emitted(30, 58) Source(44, 105) + SourceIndex(0) -17>Emitted(30, 60) Source(44, 107) + SourceIndex(0) -18>Emitted(30, 68) Source(44, 115) + SourceIndex(0) -19>Emitted(30, 70) Source(44, 117) + SourceIndex(0) -20>Emitted(30, 79) Source(44, 126) + SourceIndex(0) -21>Emitted(30, 81) Source(44, 128) + SourceIndex(0) -22>Emitted(30, 87) Source(44, 134) + SourceIndex(0) -23>Emitted(30, 89) Source(44, 136) + SourceIndex(0) -24>Emitted(30, 91) Source(44, 138) + SourceIndex(0) +2 >Emitted(30, 6) Source(44, 70) + SourceIndex(0) +3 >Emitted(30, 16) Source(45, 79) + SourceIndex(0) +4 >Emitted(30, 18) Source(44, 70) + SourceIndex(0) +5 >Emitted(30, 24) Source(44, 71) + SourceIndex(0) +6 >Emitted(30, 26) Source(44, 73) + SourceIndex(0) +7 >Emitted(30, 30) Source(44, 77) + SourceIndex(0) +8 >Emitted(30, 32) Source(44, 79) + SourceIndex(0) +9 >Emitted(30, 39) Source(44, 86) + SourceIndex(0) +10>Emitted(30, 41) Source(44, 88) + SourceIndex(0) +11>Emitted(30, 47) Source(44, 94) + SourceIndex(0) +12>Emitted(30, 49) Source(44, 96) + SourceIndex(0) +13>Emitted(30, 51) Source(44, 98) + SourceIndex(0) +14>Emitted(30, 58) Source(44, 105) + SourceIndex(0) +15>Emitted(30, 60) Source(44, 107) + SourceIndex(0) +16>Emitted(30, 68) Source(44, 115) + SourceIndex(0) +17>Emitted(30, 70) Source(44, 117) + SourceIndex(0) +18>Emitted(30, 79) Source(44, 126) + SourceIndex(0) +19>Emitted(30, 81) Source(44, 128) + SourceIndex(0) +20>Emitted(30, 87) Source(44, 134) + SourceIndex(0) +21>Emitted(30, 89) Source(44, 136) + SourceIndex(0) +22>Emitted(30, 91) Source(44, 138) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { 1->^^^^ @@ -1023,41 +981,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^-> 1-> > > -2 >for -3 > -4 > (let {name: nameA, skill: skillA } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let {name: nameA, skill: skillA } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(35, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(35, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(35, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(35, 6) Source(49, 43) + SourceIndex(0) -5 >Emitted(35, 16) Source(49, 49) + SourceIndex(0) -6 >Emitted(35, 18) Source(49, 43) + SourceIndex(0) -7 >Emitted(35, 35) Source(49, 49) + SourceIndex(0) -8 >Emitted(35, 37) Source(49, 43) + SourceIndex(0) -9 >Emitted(35, 57) Source(49, 49) + SourceIndex(0) -10>Emitted(35, 59) Source(49, 43) + SourceIndex(0) -11>Emitted(35, 63) Source(49, 49) + SourceIndex(0) +2 >Emitted(35, 6) Source(49, 43) + SourceIndex(0) +3 >Emitted(35, 16) Source(49, 49) + SourceIndex(0) +4 >Emitted(35, 18) Source(49, 43) + SourceIndex(0) +5 >Emitted(35, 35) Source(49, 49) + SourceIndex(0) +6 >Emitted(35, 37) Source(49, 43) + SourceIndex(0) +7 >Emitted(35, 57) Source(49, 49) + SourceIndex(0) +8 >Emitted(35, 59) Source(49, 43) + SourceIndex(0) +9 >Emitted(35, 63) Source(49, 49) + SourceIndex(0) --- >>> var _p = robots_2[_o], nameA = _p.name, skillA = _p.skill; 1->^^^^ @@ -1118,46 +1070,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _q = 0, _r = getRobots(); _q < _r.length; _q++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^-> 1-> > -2 >for -3 > -4 > (let {name: nameA, skill: skillA } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let {name: nameA, skill: skillA } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(39, 1) Source(52, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(52, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(52, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(52, 43) + SourceIndex(0) -5 >Emitted(39, 16) Source(52, 54) + SourceIndex(0) -6 >Emitted(39, 18) Source(52, 43) + SourceIndex(0) -7 >Emitted(39, 23) Source(52, 43) + SourceIndex(0) -8 >Emitted(39, 32) Source(52, 52) + SourceIndex(0) -9 >Emitted(39, 34) Source(52, 54) + SourceIndex(0) -10>Emitted(39, 36) Source(52, 43) + SourceIndex(0) -11>Emitted(39, 50) Source(52, 54) + SourceIndex(0) -12>Emitted(39, 52) Source(52, 43) + SourceIndex(0) -13>Emitted(39, 56) Source(52, 54) + SourceIndex(0) +2 >Emitted(39, 6) Source(52, 43) + SourceIndex(0) +3 >Emitted(39, 16) Source(52, 54) + SourceIndex(0) +4 >Emitted(39, 18) Source(52, 43) + SourceIndex(0) +5 >Emitted(39, 23) Source(52, 43) + SourceIndex(0) +6 >Emitted(39, 32) Source(52, 52) + SourceIndex(0) +7 >Emitted(39, 34) Source(52, 54) + SourceIndex(0) +8 >Emitted(39, 36) Source(52, 43) + SourceIndex(0) +9 >Emitted(39, 50) Source(52, 54) + SourceIndex(0) +10>Emitted(39, 52) Source(52, 43) + SourceIndex(0) +11>Emitted(39, 56) Source(52, 54) + SourceIndex(0) --- >>> var _s = _r[_q], nameA = _s.name, skillA = _s.skill; 1->^^^^ @@ -1218,99 +1164,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _t = 0, _u = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _t < _u.length; _t++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > (let {name: nameA, skill: skillA } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for (let {name: nameA, skill: skillA } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(43, 1) Source(55, 1) + SourceIndex(0) -2 >Emitted(43, 4) Source(55, 4) + SourceIndex(0) -3 >Emitted(43, 5) Source(55, 5) + SourceIndex(0) -4 >Emitted(43, 6) Source(55, 43) + SourceIndex(0) -5 >Emitted(43, 16) Source(55, 119) + SourceIndex(0) -6 >Emitted(43, 18) Source(55, 43) + SourceIndex(0) -7 >Emitted(43, 24) Source(55, 44) + SourceIndex(0) -8 >Emitted(43, 26) Source(55, 46) + SourceIndex(0) -9 >Emitted(43, 30) Source(55, 50) + SourceIndex(0) -10>Emitted(43, 32) Source(55, 52) + SourceIndex(0) -11>Emitted(43, 39) Source(55, 59) + SourceIndex(0) -12>Emitted(43, 41) Source(55, 61) + SourceIndex(0) -13>Emitted(43, 46) Source(55, 66) + SourceIndex(0) -14>Emitted(43, 48) Source(55, 68) + SourceIndex(0) -15>Emitted(43, 56) Source(55, 76) + SourceIndex(0) -16>Emitted(43, 58) Source(55, 78) + SourceIndex(0) -17>Emitted(43, 60) Source(55, 80) + SourceIndex(0) -18>Emitted(43, 62) Source(55, 82) + SourceIndex(0) -19>Emitted(43, 66) Source(55, 86) + SourceIndex(0) -20>Emitted(43, 68) Source(55, 88) + SourceIndex(0) -21>Emitted(43, 77) Source(55, 97) + SourceIndex(0) -22>Emitted(43, 79) Source(55, 99) + SourceIndex(0) -23>Emitted(43, 84) Source(55, 104) + SourceIndex(0) -24>Emitted(43, 86) Source(55, 106) + SourceIndex(0) -25>Emitted(43, 96) Source(55, 116) + SourceIndex(0) -26>Emitted(43, 98) Source(55, 118) + SourceIndex(0) -27>Emitted(43, 99) Source(55, 119) + SourceIndex(0) -28>Emitted(43, 101) Source(55, 43) + SourceIndex(0) -29>Emitted(43, 115) Source(55, 119) + SourceIndex(0) -30>Emitted(43, 117) Source(55, 43) + SourceIndex(0) -31>Emitted(43, 121) Source(55, 119) + SourceIndex(0) +2 >Emitted(43, 6) Source(55, 43) + SourceIndex(0) +3 >Emitted(43, 16) Source(55, 119) + SourceIndex(0) +4 >Emitted(43, 18) Source(55, 43) + SourceIndex(0) +5 >Emitted(43, 24) Source(55, 44) + SourceIndex(0) +6 >Emitted(43, 26) Source(55, 46) + SourceIndex(0) +7 >Emitted(43, 30) Source(55, 50) + SourceIndex(0) +8 >Emitted(43, 32) Source(55, 52) + SourceIndex(0) +9 >Emitted(43, 39) Source(55, 59) + SourceIndex(0) +10>Emitted(43, 41) Source(55, 61) + SourceIndex(0) +11>Emitted(43, 46) Source(55, 66) + SourceIndex(0) +12>Emitted(43, 48) Source(55, 68) + SourceIndex(0) +13>Emitted(43, 56) Source(55, 76) + SourceIndex(0) +14>Emitted(43, 58) Source(55, 78) + SourceIndex(0) +15>Emitted(43, 60) Source(55, 80) + SourceIndex(0) +16>Emitted(43, 62) Source(55, 82) + SourceIndex(0) +17>Emitted(43, 66) Source(55, 86) + SourceIndex(0) +18>Emitted(43, 68) Source(55, 88) + SourceIndex(0) +19>Emitted(43, 77) Source(55, 97) + SourceIndex(0) +20>Emitted(43, 79) Source(55, 99) + SourceIndex(0) +21>Emitted(43, 84) Source(55, 104) + SourceIndex(0) +22>Emitted(43, 86) Source(55, 106) + SourceIndex(0) +23>Emitted(43, 96) Source(55, 116) + SourceIndex(0) +24>Emitted(43, 98) Source(55, 118) + SourceIndex(0) +25>Emitted(43, 99) Source(55, 119) + SourceIndex(0) +26>Emitted(43, 101) Source(55, 43) + SourceIndex(0) +27>Emitted(43, 115) Source(55, 119) + SourceIndex(0) +28>Emitted(43, 117) Source(55, 43) + SourceIndex(0) +29>Emitted(43, 121) Source(55, 119) + SourceIndex(0) --- >>> var _v = _u[_t], nameA = _v.name, skillA = _v.skill; 1 >^^^^ @@ -1371,40 +1311,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _w = 0, multiRobots_2 = multiRobots; _w < multiRobots_2.length; _w++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(47, 1) Source(58, 1) + SourceIndex(0) -2 >Emitted(47, 4) Source(58, 4) + SourceIndex(0) -3 >Emitted(47, 5) Source(58, 5) + SourceIndex(0) -4 >Emitted(47, 6) Source(58, 82) + SourceIndex(0) -5 >Emitted(47, 16) Source(58, 93) + SourceIndex(0) -6 >Emitted(47, 18) Source(58, 82) + SourceIndex(0) -7 >Emitted(47, 45) Source(58, 93) + SourceIndex(0) -8 >Emitted(47, 47) Source(58, 82) + SourceIndex(0) -9 >Emitted(47, 72) Source(58, 93) + SourceIndex(0) -10>Emitted(47, 74) Source(58, 82) + SourceIndex(0) -11>Emitted(47, 78) Source(58, 93) + SourceIndex(0) +2 >Emitted(47, 6) Source(58, 82) + SourceIndex(0) +3 >Emitted(47, 16) Source(58, 93) + SourceIndex(0) +4 >Emitted(47, 18) Source(58, 82) + SourceIndex(0) +5 >Emitted(47, 45) Source(58, 93) + SourceIndex(0) +6 >Emitted(47, 47) Source(58, 82) + SourceIndex(0) +7 >Emitted(47, 72) Source(58, 93) + SourceIndex(0) +8 >Emitted(47, 74) Source(58, 82) + SourceIndex(0) +9 >Emitted(47, 78) Source(58, 93) + SourceIndex(0) --- >>> var _x = multiRobots_2[_w], nameA = _x.name, _y = _x.skills, primaryA = _y.primary, secondaryA = _y.secondary; 1->^^^^ @@ -1477,46 +1411,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _z = 0, _0 = getMultiRobots(); _z < _0.length; _z++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(51, 1) Source(61, 1) + SourceIndex(0) -2 >Emitted(51, 4) Source(61, 4) + SourceIndex(0) -3 >Emitted(51, 5) Source(61, 5) + SourceIndex(0) -4 >Emitted(51, 6) Source(61, 82) + SourceIndex(0) -5 >Emitted(51, 16) Source(61, 98) + SourceIndex(0) -6 >Emitted(51, 18) Source(61, 82) + SourceIndex(0) -7 >Emitted(51, 23) Source(61, 82) + SourceIndex(0) -8 >Emitted(51, 37) Source(61, 96) + SourceIndex(0) -9 >Emitted(51, 39) Source(61, 98) + SourceIndex(0) -10>Emitted(51, 41) Source(61, 82) + SourceIndex(0) -11>Emitted(51, 55) Source(61, 98) + SourceIndex(0) -12>Emitted(51, 57) Source(61, 82) + SourceIndex(0) -13>Emitted(51, 61) Source(61, 98) + SourceIndex(0) +2 >Emitted(51, 6) Source(61, 82) + SourceIndex(0) +3 >Emitted(51, 16) Source(61, 98) + SourceIndex(0) +4 >Emitted(51, 18) Source(61, 82) + SourceIndex(0) +5 >Emitted(51, 23) Source(61, 82) + SourceIndex(0) +6 >Emitted(51, 37) Source(61, 96) + SourceIndex(0) +7 >Emitted(51, 39) Source(61, 98) + SourceIndex(0) +8 >Emitted(51, 41) Source(61, 82) + SourceIndex(0) +9 >Emitted(51, 55) Source(61, 98) + SourceIndex(0) +10>Emitted(51, 57) Source(61, 82) + SourceIndex(0) +11>Emitted(51, 61) Source(61, 98) + SourceIndex(0) --- >>> var _1 = _0[_z], nameA = _1.name, _2 = _1.skills, primaryA = _2.primary, secondaryA = _2.secondary; 1->^^^^ @@ -1589,80 +1517,74 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern.ts --- >>>for (var _3 = 0, _4 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(55, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(55, 4) Source(64, 4) + SourceIndex(0) -3 >Emitted(55, 5) Source(64, 5) + SourceIndex(0) -4 >Emitted(55, 6) Source(64, 82) + SourceIndex(0) -5 >Emitted(55, 16) Source(65, 79) + SourceIndex(0) -6 >Emitted(55, 18) Source(64, 82) + SourceIndex(0) -7 >Emitted(55, 24) Source(64, 83) + SourceIndex(0) -8 >Emitted(55, 26) Source(64, 85) + SourceIndex(0) -9 >Emitted(55, 30) Source(64, 89) + SourceIndex(0) -10>Emitted(55, 32) Source(64, 91) + SourceIndex(0) -11>Emitted(55, 39) Source(64, 98) + SourceIndex(0) -12>Emitted(55, 41) Source(64, 100) + SourceIndex(0) -13>Emitted(55, 47) Source(64, 106) + SourceIndex(0) -14>Emitted(55, 49) Source(64, 108) + SourceIndex(0) -15>Emitted(55, 51) Source(64, 110) + SourceIndex(0) -16>Emitted(55, 58) Source(64, 117) + SourceIndex(0) -17>Emitted(55, 60) Source(64, 119) + SourceIndex(0) -18>Emitted(55, 68) Source(64, 127) + SourceIndex(0) -19>Emitted(55, 70) Source(64, 129) + SourceIndex(0) -20>Emitted(55, 79) Source(64, 138) + SourceIndex(0) -21>Emitted(55, 81) Source(64, 140) + SourceIndex(0) -22>Emitted(55, 87) Source(64, 146) + SourceIndex(0) -23>Emitted(55, 89) Source(64, 148) + SourceIndex(0) -24>Emitted(55, 91) Source(64, 150) + SourceIndex(0) +2 >Emitted(55, 6) Source(64, 82) + SourceIndex(0) +3 >Emitted(55, 16) Source(65, 79) + SourceIndex(0) +4 >Emitted(55, 18) Source(64, 82) + SourceIndex(0) +5 >Emitted(55, 24) Source(64, 83) + SourceIndex(0) +6 >Emitted(55, 26) Source(64, 85) + SourceIndex(0) +7 >Emitted(55, 30) Source(64, 89) + SourceIndex(0) +8 >Emitted(55, 32) Source(64, 91) + SourceIndex(0) +9 >Emitted(55, 39) Source(64, 98) + SourceIndex(0) +10>Emitted(55, 41) Source(64, 100) + SourceIndex(0) +11>Emitted(55, 47) Source(64, 106) + SourceIndex(0) +12>Emitted(55, 49) Source(64, 108) + SourceIndex(0) +13>Emitted(55, 51) Source(64, 110) + SourceIndex(0) +14>Emitted(55, 58) Source(64, 117) + SourceIndex(0) +15>Emitted(55, 60) Source(64, 119) + SourceIndex(0) +16>Emitted(55, 68) Source(64, 127) + SourceIndex(0) +17>Emitted(55, 70) Source(64, 129) + SourceIndex(0) +18>Emitted(55, 79) Source(64, 138) + SourceIndex(0) +19>Emitted(55, 81) Source(64, 140) + SourceIndex(0) +20>Emitted(55, 87) Source(64, 146) + SourceIndex(0) +21>Emitted(55, 89) Source(64, 148) + SourceIndex(0) +22>Emitted(55, 91) Source(64, 150) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _3 < _4.length; _3++) { 1->^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map index 47fdde05e22..86dded9905b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfObjectBindingPattern2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAAmB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,yBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAA7F,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA6D,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArE,6BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6D,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1E,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAA6D,UACa,EADb,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADb,cACa,EADb,IACa;IADvE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAY,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAhB,wBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAArB,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAY,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAtF,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAuC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAA/C,6BAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAApD,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAAuC,UACmC,EADnC,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC3G,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADnC,cACmC,EADnC,IACmC;IADvE,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAE/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,GAAG,CAAC,CAAkC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAAtC,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAA3C,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;iBAA5G,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;6BAAlF,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAAvF,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAyE,WACC,EADD,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC7I,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADD,gBACC,EADD,KACC;oBADxE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IAEjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAAvB,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAA5B,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAmB,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E;oBAA7F,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BAArD,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAA1D,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAC8B,EAD9B,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChH,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9B,gBAC8B,EAD9B,KAC8B;oBADxE,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IAEpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPattern2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,KAAuB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAvB,yBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAuB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAA5B,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAuB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAA7F,mBAAW;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAiE,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAArE,6BAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAiE,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAA1E,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IACrD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAiE,UACa,EADb,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACjI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADb,cACa,EADb,IACa;IADvE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB;IAErD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAAgB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAhB,wBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAArB,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAtF,kBAAI;IACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA2C,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAA/C,6BAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAA2C,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAApD,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAC/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAA2C,UACmC,EADnC,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC3G,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADnC,cACmC,EADnC,IACmC;IADvE,kBAA8B,EAApB,oBAAO,EAAE,wBAAS;IAE/B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,KAAsC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;uBAAtC,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAsC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;iBAA3C,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAsC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;iBAA5G,eAAW,EAAE,iBAAa;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA6E,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;6BAAlF,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA6E,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAAvF,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA6E,WACC,EADD,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC7I,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADD,gBACC,EADD,KACC;oBADxE,gBAAW,EAAE,gBAAoD,EAA1C,sBAAiB,EAAE,0BAAqB;IAEjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAuB,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAAvB,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAuB,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAA5B,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAuB,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E;oBAA7F,eAAI,EAAE,iBAAK;IACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgD,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BAArD,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgD,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBAA1D,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IACpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgD,WAC8B,EAD9B,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChH,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9B,gBAC8B,EAD9B,KAC8B;oBADxE,eAAI,EAAE,gBAA8B,EAApB,qBAAO,EAAE,yBAAS;IAEpC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt index b246504de7a..e646f0120b2 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.sourcemap.txt @@ -246,21 +246,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) --- >>>} 1 > @@ -282,21 +279,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) --- >>>} 1 > @@ -384,40 +378,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > -2 >for -3 > -4 > ({name: nameA } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({name: nameA } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(12, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(12, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(12, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(12, 6) Source(32, 24) + SourceIndex(0) -5 >Emitted(12, 16) Source(32, 30) + SourceIndex(0) -6 >Emitted(12, 18) Source(32, 24) + SourceIndex(0) -7 >Emitted(12, 35) Source(32, 30) + SourceIndex(0) -8 >Emitted(12, 37) Source(32, 24) + SourceIndex(0) -9 >Emitted(12, 57) Source(32, 30) + SourceIndex(0) -10>Emitted(12, 59) Source(32, 24) + SourceIndex(0) -11>Emitted(12, 63) Source(32, 30) + SourceIndex(0) +2 >Emitted(12, 6) Source(32, 24) + SourceIndex(0) +3 >Emitted(12, 16) Source(32, 30) + SourceIndex(0) +4 >Emitted(12, 18) Source(32, 24) + SourceIndex(0) +5 >Emitted(12, 35) Source(32, 30) + SourceIndex(0) +6 >Emitted(12, 37) Source(32, 24) + SourceIndex(0) +7 >Emitted(12, 57) Source(32, 30) + SourceIndex(0) +8 >Emitted(12, 59) Source(32, 24) + SourceIndex(0) +9 >Emitted(12, 63) Source(32, 30) + SourceIndex(0) --- >>> nameA = robots_1[_i].name; 1 >^^^^ @@ -463,45 +451,39 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _a = 0, _b = getRobots(); _a < _b.length; _a++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > ({name: nameA } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({name: nameA } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(16, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(16, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(16, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(16, 6) Source(35, 24) + SourceIndex(0) -5 >Emitted(16, 16) Source(35, 35) + SourceIndex(0) -6 >Emitted(16, 18) Source(35, 24) + SourceIndex(0) -7 >Emitted(16, 23) Source(35, 24) + SourceIndex(0) -8 >Emitted(16, 32) Source(35, 33) + SourceIndex(0) -9 >Emitted(16, 34) Source(35, 35) + SourceIndex(0) -10>Emitted(16, 36) Source(35, 24) + SourceIndex(0) -11>Emitted(16, 50) Source(35, 35) + SourceIndex(0) -12>Emitted(16, 52) Source(35, 24) + SourceIndex(0) -13>Emitted(16, 56) Source(35, 35) + SourceIndex(0) +2 >Emitted(16, 6) Source(35, 24) + SourceIndex(0) +3 >Emitted(16, 16) Source(35, 35) + SourceIndex(0) +4 >Emitted(16, 18) Source(35, 24) + SourceIndex(0) +5 >Emitted(16, 23) Source(35, 24) + SourceIndex(0) +6 >Emitted(16, 32) Source(35, 33) + SourceIndex(0) +7 >Emitted(16, 34) Source(35, 35) + SourceIndex(0) +8 >Emitted(16, 36) Source(35, 24) + SourceIndex(0) +9 >Emitted(16, 50) Source(35, 35) + SourceIndex(0) +10>Emitted(16, 52) Source(35, 24) + SourceIndex(0) +11>Emitted(16, 56) Source(35, 35) + SourceIndex(0) --- >>> nameA = _b[_a].name; 1 >^^^^ @@ -548,99 +530,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _c = 0, _d = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _c < _d.length; _c++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > ({name: nameA } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({name: nameA } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(20, 6) Source(38, 24) + SourceIndex(0) -5 >Emitted(20, 16) Source(38, 100) + SourceIndex(0) -6 >Emitted(20, 18) Source(38, 24) + SourceIndex(0) -7 >Emitted(20, 24) Source(38, 25) + SourceIndex(0) -8 >Emitted(20, 26) Source(38, 27) + SourceIndex(0) -9 >Emitted(20, 30) Source(38, 31) + SourceIndex(0) -10>Emitted(20, 32) Source(38, 33) + SourceIndex(0) -11>Emitted(20, 39) Source(38, 40) + SourceIndex(0) -12>Emitted(20, 41) Source(38, 42) + SourceIndex(0) -13>Emitted(20, 46) Source(38, 47) + SourceIndex(0) -14>Emitted(20, 48) Source(38, 49) + SourceIndex(0) -15>Emitted(20, 56) Source(38, 57) + SourceIndex(0) -16>Emitted(20, 58) Source(38, 59) + SourceIndex(0) -17>Emitted(20, 60) Source(38, 61) + SourceIndex(0) -18>Emitted(20, 62) Source(38, 63) + SourceIndex(0) -19>Emitted(20, 66) Source(38, 67) + SourceIndex(0) -20>Emitted(20, 68) Source(38, 69) + SourceIndex(0) -21>Emitted(20, 77) Source(38, 78) + SourceIndex(0) -22>Emitted(20, 79) Source(38, 80) + SourceIndex(0) -23>Emitted(20, 84) Source(38, 85) + SourceIndex(0) -24>Emitted(20, 86) Source(38, 87) + SourceIndex(0) -25>Emitted(20, 96) Source(38, 97) + SourceIndex(0) -26>Emitted(20, 98) Source(38, 99) + SourceIndex(0) -27>Emitted(20, 99) Source(38, 100) + SourceIndex(0) -28>Emitted(20, 101) Source(38, 24) + SourceIndex(0) -29>Emitted(20, 115) Source(38, 100) + SourceIndex(0) -30>Emitted(20, 117) Source(38, 24) + SourceIndex(0) -31>Emitted(20, 121) Source(38, 100) + SourceIndex(0) +2 >Emitted(20, 6) Source(38, 24) + SourceIndex(0) +3 >Emitted(20, 16) Source(38, 100) + SourceIndex(0) +4 >Emitted(20, 18) Source(38, 24) + SourceIndex(0) +5 >Emitted(20, 24) Source(38, 25) + SourceIndex(0) +6 >Emitted(20, 26) Source(38, 27) + SourceIndex(0) +7 >Emitted(20, 30) Source(38, 31) + SourceIndex(0) +8 >Emitted(20, 32) Source(38, 33) + SourceIndex(0) +9 >Emitted(20, 39) Source(38, 40) + SourceIndex(0) +10>Emitted(20, 41) Source(38, 42) + SourceIndex(0) +11>Emitted(20, 46) Source(38, 47) + SourceIndex(0) +12>Emitted(20, 48) Source(38, 49) + SourceIndex(0) +13>Emitted(20, 56) Source(38, 57) + SourceIndex(0) +14>Emitted(20, 58) Source(38, 59) + SourceIndex(0) +15>Emitted(20, 60) Source(38, 61) + SourceIndex(0) +16>Emitted(20, 62) Source(38, 63) + SourceIndex(0) +17>Emitted(20, 66) Source(38, 67) + SourceIndex(0) +18>Emitted(20, 68) Source(38, 69) + SourceIndex(0) +19>Emitted(20, 77) Source(38, 78) + SourceIndex(0) +20>Emitted(20, 79) Source(38, 80) + SourceIndex(0) +21>Emitted(20, 84) Source(38, 85) + SourceIndex(0) +22>Emitted(20, 86) Source(38, 87) + SourceIndex(0) +23>Emitted(20, 96) Source(38, 97) + SourceIndex(0) +24>Emitted(20, 98) Source(38, 99) + SourceIndex(0) +25>Emitted(20, 99) Source(38, 100) + SourceIndex(0) +26>Emitted(20, 101) Source(38, 24) + SourceIndex(0) +27>Emitted(20, 115) Source(38, 100) + SourceIndex(0) +28>Emitted(20, 117) Source(38, 24) + SourceIndex(0) +29>Emitted(20, 121) Source(38, 100) + SourceIndex(0) --- >>> nameA = _d[_c].name; 1 >^^^^ @@ -687,40 +663,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _e = 0, multiRobots_1 = multiRobots; _e < multiRobots_1.length; _e++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) -3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) -4 >Emitted(24, 6) Source(41, 66) + SourceIndex(0) -5 >Emitted(24, 16) Source(41, 77) + SourceIndex(0) -6 >Emitted(24, 18) Source(41, 66) + SourceIndex(0) -7 >Emitted(24, 45) Source(41, 77) + SourceIndex(0) -8 >Emitted(24, 47) Source(41, 66) + SourceIndex(0) -9 >Emitted(24, 72) Source(41, 77) + SourceIndex(0) -10>Emitted(24, 74) Source(41, 66) + SourceIndex(0) -11>Emitted(24, 78) Source(41, 77) + SourceIndex(0) +2 >Emitted(24, 6) Source(41, 66) + SourceIndex(0) +3 >Emitted(24, 16) Source(41, 77) + SourceIndex(0) +4 >Emitted(24, 18) Source(41, 66) + SourceIndex(0) +5 >Emitted(24, 45) Source(41, 77) + SourceIndex(0) +6 >Emitted(24, 47) Source(41, 66) + SourceIndex(0) +7 >Emitted(24, 72) Source(41, 77) + SourceIndex(0) +8 >Emitted(24, 74) Source(41, 66) + SourceIndex(0) +9 >Emitted(24, 78) Source(41, 77) + SourceIndex(0) --- >>> _f = multiRobots_1[_e].skills, primaryA = _f.primary, secondaryA = _f.secondary; 1->^^^^ @@ -778,46 +748,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _g = 0, _h = getMultiRobots(); _g < _h.length; _g++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(28, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(28, 4) Source(44, 4) + SourceIndex(0) -3 >Emitted(28, 5) Source(44, 5) + SourceIndex(0) -4 >Emitted(28, 6) Source(44, 66) + SourceIndex(0) -5 >Emitted(28, 16) Source(44, 82) + SourceIndex(0) -6 >Emitted(28, 18) Source(44, 66) + SourceIndex(0) -7 >Emitted(28, 23) Source(44, 66) + SourceIndex(0) -8 >Emitted(28, 37) Source(44, 80) + SourceIndex(0) -9 >Emitted(28, 39) Source(44, 82) + SourceIndex(0) -10>Emitted(28, 41) Source(44, 66) + SourceIndex(0) -11>Emitted(28, 55) Source(44, 82) + SourceIndex(0) -12>Emitted(28, 57) Source(44, 66) + SourceIndex(0) -13>Emitted(28, 61) Source(44, 82) + SourceIndex(0) +2 >Emitted(28, 6) Source(44, 66) + SourceIndex(0) +3 >Emitted(28, 16) Source(44, 82) + SourceIndex(0) +4 >Emitted(28, 18) Source(44, 66) + SourceIndex(0) +5 >Emitted(28, 23) Source(44, 66) + SourceIndex(0) +6 >Emitted(28, 37) Source(44, 80) + SourceIndex(0) +7 >Emitted(28, 39) Source(44, 82) + SourceIndex(0) +8 >Emitted(28, 41) Source(44, 66) + SourceIndex(0) +9 >Emitted(28, 55) Source(44, 82) + SourceIndex(0) +10>Emitted(28, 57) Source(44, 66) + SourceIndex(0) +11>Emitted(28, 61) Source(44, 82) + SourceIndex(0) --- >>> _j = _h[_g].skills, primaryA = _j.primary, secondaryA = _j.secondary; 1->^^^^ @@ -875,80 +839,74 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _k = 0, _l = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary: primaryA, secondary: secondaryA } } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({ skills: { primary: primaryA, secondary: secondaryA } } of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(32, 1) Source(47, 1) + SourceIndex(0) -2 >Emitted(32, 4) Source(47, 4) + SourceIndex(0) -3 >Emitted(32, 5) Source(47, 5) + SourceIndex(0) -4 >Emitted(32, 6) Source(47, 66) + SourceIndex(0) -5 >Emitted(32, 16) Source(48, 79) + SourceIndex(0) -6 >Emitted(32, 18) Source(47, 66) + SourceIndex(0) -7 >Emitted(32, 24) Source(47, 67) + SourceIndex(0) -8 >Emitted(32, 26) Source(47, 69) + SourceIndex(0) -9 >Emitted(32, 30) Source(47, 73) + SourceIndex(0) -10>Emitted(32, 32) Source(47, 75) + SourceIndex(0) -11>Emitted(32, 39) Source(47, 82) + SourceIndex(0) -12>Emitted(32, 41) Source(47, 84) + SourceIndex(0) -13>Emitted(32, 47) Source(47, 90) + SourceIndex(0) -14>Emitted(32, 49) Source(47, 92) + SourceIndex(0) -15>Emitted(32, 51) Source(47, 94) + SourceIndex(0) -16>Emitted(32, 58) Source(47, 101) + SourceIndex(0) -17>Emitted(32, 60) Source(47, 103) + SourceIndex(0) -18>Emitted(32, 68) Source(47, 111) + SourceIndex(0) -19>Emitted(32, 70) Source(47, 113) + SourceIndex(0) -20>Emitted(32, 79) Source(47, 122) + SourceIndex(0) -21>Emitted(32, 81) Source(47, 124) + SourceIndex(0) -22>Emitted(32, 87) Source(47, 130) + SourceIndex(0) -23>Emitted(32, 89) Source(47, 132) + SourceIndex(0) -24>Emitted(32, 91) Source(47, 134) + SourceIndex(0) +2 >Emitted(32, 6) Source(47, 66) + SourceIndex(0) +3 >Emitted(32, 16) Source(48, 79) + SourceIndex(0) +4 >Emitted(32, 18) Source(47, 66) + SourceIndex(0) +5 >Emitted(32, 24) Source(47, 67) + SourceIndex(0) +6 >Emitted(32, 26) Source(47, 69) + SourceIndex(0) +7 >Emitted(32, 30) Source(47, 73) + SourceIndex(0) +8 >Emitted(32, 32) Source(47, 75) + SourceIndex(0) +9 >Emitted(32, 39) Source(47, 82) + SourceIndex(0) +10>Emitted(32, 41) Source(47, 84) + SourceIndex(0) +11>Emitted(32, 47) Source(47, 90) + SourceIndex(0) +12>Emitted(32, 49) Source(47, 92) + SourceIndex(0) +13>Emitted(32, 51) Source(47, 94) + SourceIndex(0) +14>Emitted(32, 58) Source(47, 101) + SourceIndex(0) +15>Emitted(32, 60) Source(47, 103) + SourceIndex(0) +16>Emitted(32, 68) Source(47, 111) + SourceIndex(0) +17>Emitted(32, 70) Source(47, 113) + SourceIndex(0) +18>Emitted(32, 79) Source(47, 122) + SourceIndex(0) +19>Emitted(32, 81) Source(47, 124) + SourceIndex(0) +20>Emitted(32, 87) Source(47, 130) + SourceIndex(0) +21>Emitted(32, 89) Source(47, 132) + SourceIndex(0) +22>Emitted(32, 91) Source(47, 134) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _k < _l.length; _k++) { 1->^^^^ @@ -1081,39 +1039,33 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _o = 0, robots_2 = robots; _o < robots_2.length; _o++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > -2 >for -3 > -4 > ({name } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({name } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(37, 1) Source(51, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(51, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(51, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(51, 17) + SourceIndex(0) -5 >Emitted(37, 16) Source(51, 23) + SourceIndex(0) -6 >Emitted(37, 18) Source(51, 17) + SourceIndex(0) -7 >Emitted(37, 35) Source(51, 23) + SourceIndex(0) -8 >Emitted(37, 37) Source(51, 17) + SourceIndex(0) -9 >Emitted(37, 57) Source(51, 23) + SourceIndex(0) -10>Emitted(37, 59) Source(51, 17) + SourceIndex(0) -11>Emitted(37, 63) Source(51, 23) + SourceIndex(0) +2 >Emitted(37, 6) Source(51, 17) + SourceIndex(0) +3 >Emitted(37, 16) Source(51, 23) + SourceIndex(0) +4 >Emitted(37, 18) Source(51, 17) + SourceIndex(0) +5 >Emitted(37, 35) Source(51, 23) + SourceIndex(0) +6 >Emitted(37, 37) Source(51, 17) + SourceIndex(0) +7 >Emitted(37, 57) Source(51, 23) + SourceIndex(0) +8 >Emitted(37, 59) Source(51, 17) + SourceIndex(0) +9 >Emitted(37, 63) Source(51, 23) + SourceIndex(0) --- >>> name = robots_2[_o].name; 1 >^^^^ @@ -1159,45 +1111,39 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _p = 0, _q = getRobots(); _p < _q.length; _p++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > ({name } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({name } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(41, 1) Source(54, 1) + SourceIndex(0) -2 >Emitted(41, 4) Source(54, 4) + SourceIndex(0) -3 >Emitted(41, 5) Source(54, 5) + SourceIndex(0) -4 >Emitted(41, 6) Source(54, 17) + SourceIndex(0) -5 >Emitted(41, 16) Source(54, 28) + SourceIndex(0) -6 >Emitted(41, 18) Source(54, 17) + SourceIndex(0) -7 >Emitted(41, 23) Source(54, 17) + SourceIndex(0) -8 >Emitted(41, 32) Source(54, 26) + SourceIndex(0) -9 >Emitted(41, 34) Source(54, 28) + SourceIndex(0) -10>Emitted(41, 36) Source(54, 17) + SourceIndex(0) -11>Emitted(41, 50) Source(54, 28) + SourceIndex(0) -12>Emitted(41, 52) Source(54, 17) + SourceIndex(0) -13>Emitted(41, 56) Source(54, 28) + SourceIndex(0) +2 >Emitted(41, 6) Source(54, 17) + SourceIndex(0) +3 >Emitted(41, 16) Source(54, 28) + SourceIndex(0) +4 >Emitted(41, 18) Source(54, 17) + SourceIndex(0) +5 >Emitted(41, 23) Source(54, 17) + SourceIndex(0) +6 >Emitted(41, 32) Source(54, 26) + SourceIndex(0) +7 >Emitted(41, 34) Source(54, 28) + SourceIndex(0) +8 >Emitted(41, 36) Source(54, 17) + SourceIndex(0) +9 >Emitted(41, 50) Source(54, 28) + SourceIndex(0) +10>Emitted(41, 52) Source(54, 17) + SourceIndex(0) +11>Emitted(41, 56) Source(54, 28) + SourceIndex(0) --- >>> name = _q[_p].name; 1 >^^^^ @@ -1244,99 +1190,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _r = 0, _s = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _r < _s.length; _r++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > ({name } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({name } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(45, 1) Source(57, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(57, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(57, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(57, 17) + SourceIndex(0) -5 >Emitted(45, 16) Source(57, 93) + SourceIndex(0) -6 >Emitted(45, 18) Source(57, 17) + SourceIndex(0) -7 >Emitted(45, 24) Source(57, 18) + SourceIndex(0) -8 >Emitted(45, 26) Source(57, 20) + SourceIndex(0) -9 >Emitted(45, 30) Source(57, 24) + SourceIndex(0) -10>Emitted(45, 32) Source(57, 26) + SourceIndex(0) -11>Emitted(45, 39) Source(57, 33) + SourceIndex(0) -12>Emitted(45, 41) Source(57, 35) + SourceIndex(0) -13>Emitted(45, 46) Source(57, 40) + SourceIndex(0) -14>Emitted(45, 48) Source(57, 42) + SourceIndex(0) -15>Emitted(45, 56) Source(57, 50) + SourceIndex(0) -16>Emitted(45, 58) Source(57, 52) + SourceIndex(0) -17>Emitted(45, 60) Source(57, 54) + SourceIndex(0) -18>Emitted(45, 62) Source(57, 56) + SourceIndex(0) -19>Emitted(45, 66) Source(57, 60) + SourceIndex(0) -20>Emitted(45, 68) Source(57, 62) + SourceIndex(0) -21>Emitted(45, 77) Source(57, 71) + SourceIndex(0) -22>Emitted(45, 79) Source(57, 73) + SourceIndex(0) -23>Emitted(45, 84) Source(57, 78) + SourceIndex(0) -24>Emitted(45, 86) Source(57, 80) + SourceIndex(0) -25>Emitted(45, 96) Source(57, 90) + SourceIndex(0) -26>Emitted(45, 98) Source(57, 92) + SourceIndex(0) -27>Emitted(45, 99) Source(57, 93) + SourceIndex(0) -28>Emitted(45, 101) Source(57, 17) + SourceIndex(0) -29>Emitted(45, 115) Source(57, 93) + SourceIndex(0) -30>Emitted(45, 117) Source(57, 17) + SourceIndex(0) -31>Emitted(45, 121) Source(57, 93) + SourceIndex(0) +2 >Emitted(45, 6) Source(57, 17) + SourceIndex(0) +3 >Emitted(45, 16) Source(57, 93) + SourceIndex(0) +4 >Emitted(45, 18) Source(57, 17) + SourceIndex(0) +5 >Emitted(45, 24) Source(57, 18) + SourceIndex(0) +6 >Emitted(45, 26) Source(57, 20) + SourceIndex(0) +7 >Emitted(45, 30) Source(57, 24) + SourceIndex(0) +8 >Emitted(45, 32) Source(57, 26) + SourceIndex(0) +9 >Emitted(45, 39) Source(57, 33) + SourceIndex(0) +10>Emitted(45, 41) Source(57, 35) + SourceIndex(0) +11>Emitted(45, 46) Source(57, 40) + SourceIndex(0) +12>Emitted(45, 48) Source(57, 42) + SourceIndex(0) +13>Emitted(45, 56) Source(57, 50) + SourceIndex(0) +14>Emitted(45, 58) Source(57, 52) + SourceIndex(0) +15>Emitted(45, 60) Source(57, 54) + SourceIndex(0) +16>Emitted(45, 62) Source(57, 56) + SourceIndex(0) +17>Emitted(45, 66) Source(57, 60) + SourceIndex(0) +18>Emitted(45, 68) Source(57, 62) + SourceIndex(0) +19>Emitted(45, 77) Source(57, 71) + SourceIndex(0) +20>Emitted(45, 79) Source(57, 73) + SourceIndex(0) +21>Emitted(45, 84) Source(57, 78) + SourceIndex(0) +22>Emitted(45, 86) Source(57, 80) + SourceIndex(0) +23>Emitted(45, 96) Source(57, 90) + SourceIndex(0) +24>Emitted(45, 98) Source(57, 92) + SourceIndex(0) +25>Emitted(45, 99) Source(57, 93) + SourceIndex(0) +26>Emitted(45, 101) Source(57, 17) + SourceIndex(0) +27>Emitted(45, 115) Source(57, 93) + SourceIndex(0) +28>Emitted(45, 117) Source(57, 17) + SourceIndex(0) +29>Emitted(45, 121) Source(57, 93) + SourceIndex(0) --- >>> name = _s[_r].name; 1 >^^^^ @@ -1383,40 +1323,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _t = 0, multiRobots_2 = multiRobots; _t < multiRobots_2.length; _t++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary, secondary } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({ skills: { primary, secondary } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(49, 1) Source(60, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(60, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(60, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(60, 44) + SourceIndex(0) -5 >Emitted(49, 16) Source(60, 55) + SourceIndex(0) -6 >Emitted(49, 18) Source(60, 44) + SourceIndex(0) -7 >Emitted(49, 45) Source(60, 55) + SourceIndex(0) -8 >Emitted(49, 47) Source(60, 44) + SourceIndex(0) -9 >Emitted(49, 72) Source(60, 55) + SourceIndex(0) -10>Emitted(49, 74) Source(60, 44) + SourceIndex(0) -11>Emitted(49, 78) Source(60, 55) + SourceIndex(0) +2 >Emitted(49, 6) Source(60, 44) + SourceIndex(0) +3 >Emitted(49, 16) Source(60, 55) + SourceIndex(0) +4 >Emitted(49, 18) Source(60, 44) + SourceIndex(0) +5 >Emitted(49, 45) Source(60, 55) + SourceIndex(0) +6 >Emitted(49, 47) Source(60, 44) + SourceIndex(0) +7 >Emitted(49, 72) Source(60, 55) + SourceIndex(0) +8 >Emitted(49, 74) Source(60, 44) + SourceIndex(0) +9 >Emitted(49, 78) Source(60, 55) + SourceIndex(0) --- >>> _u = multiRobots_2[_t].skills, primary = _u.primary, secondary = _u.secondary; 1->^^^^ @@ -1474,46 +1408,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _v = 0, _w = getMultiRobots(); _v < _w.length; _v++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary, secondary } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({ skills: { primary, secondary } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(53, 1) Source(63, 1) + SourceIndex(0) -2 >Emitted(53, 4) Source(63, 4) + SourceIndex(0) -3 >Emitted(53, 5) Source(63, 5) + SourceIndex(0) -4 >Emitted(53, 6) Source(63, 44) + SourceIndex(0) -5 >Emitted(53, 16) Source(63, 60) + SourceIndex(0) -6 >Emitted(53, 18) Source(63, 44) + SourceIndex(0) -7 >Emitted(53, 23) Source(63, 44) + SourceIndex(0) -8 >Emitted(53, 37) Source(63, 58) + SourceIndex(0) -9 >Emitted(53, 39) Source(63, 60) + SourceIndex(0) -10>Emitted(53, 41) Source(63, 44) + SourceIndex(0) -11>Emitted(53, 55) Source(63, 60) + SourceIndex(0) -12>Emitted(53, 57) Source(63, 44) + SourceIndex(0) -13>Emitted(53, 61) Source(63, 60) + SourceIndex(0) +2 >Emitted(53, 6) Source(63, 44) + SourceIndex(0) +3 >Emitted(53, 16) Source(63, 60) + SourceIndex(0) +4 >Emitted(53, 18) Source(63, 44) + SourceIndex(0) +5 >Emitted(53, 23) Source(63, 44) + SourceIndex(0) +6 >Emitted(53, 37) Source(63, 58) + SourceIndex(0) +7 >Emitted(53, 39) Source(63, 60) + SourceIndex(0) +8 >Emitted(53, 41) Source(63, 44) + SourceIndex(0) +9 >Emitted(53, 55) Source(63, 60) + SourceIndex(0) +10>Emitted(53, 57) Source(63, 44) + SourceIndex(0) +11>Emitted(53, 61) Source(63, 60) + SourceIndex(0) --- >>> _x = _w[_v].skills, primary = _x.primary, secondary = _x.secondary; 1->^^^^ @@ -1571,80 +1499,74 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _y = 0, _z = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary, secondary } } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({ skills: { primary, secondary } } of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(57, 1) Source(66, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(66, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(66, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(66, 44) + SourceIndex(0) -5 >Emitted(57, 16) Source(67, 79) + SourceIndex(0) -6 >Emitted(57, 18) Source(66, 44) + SourceIndex(0) -7 >Emitted(57, 24) Source(66, 45) + SourceIndex(0) -8 >Emitted(57, 26) Source(66, 47) + SourceIndex(0) -9 >Emitted(57, 30) Source(66, 51) + SourceIndex(0) -10>Emitted(57, 32) Source(66, 53) + SourceIndex(0) -11>Emitted(57, 39) Source(66, 60) + SourceIndex(0) -12>Emitted(57, 41) Source(66, 62) + SourceIndex(0) -13>Emitted(57, 47) Source(66, 68) + SourceIndex(0) -14>Emitted(57, 49) Source(66, 70) + SourceIndex(0) -15>Emitted(57, 51) Source(66, 72) + SourceIndex(0) -16>Emitted(57, 58) Source(66, 79) + SourceIndex(0) -17>Emitted(57, 60) Source(66, 81) + SourceIndex(0) -18>Emitted(57, 68) Source(66, 89) + SourceIndex(0) -19>Emitted(57, 70) Source(66, 91) + SourceIndex(0) -20>Emitted(57, 79) Source(66, 100) + SourceIndex(0) -21>Emitted(57, 81) Source(66, 102) + SourceIndex(0) -22>Emitted(57, 87) Source(66, 108) + SourceIndex(0) -23>Emitted(57, 89) Source(66, 110) + SourceIndex(0) -24>Emitted(57, 91) Source(66, 112) + SourceIndex(0) +2 >Emitted(57, 6) Source(66, 44) + SourceIndex(0) +3 >Emitted(57, 16) Source(67, 79) + SourceIndex(0) +4 >Emitted(57, 18) Source(66, 44) + SourceIndex(0) +5 >Emitted(57, 24) Source(66, 45) + SourceIndex(0) +6 >Emitted(57, 26) Source(66, 47) + SourceIndex(0) +7 >Emitted(57, 30) Source(66, 51) + SourceIndex(0) +8 >Emitted(57, 32) Source(66, 53) + SourceIndex(0) +9 >Emitted(57, 39) Source(66, 60) + SourceIndex(0) +10>Emitted(57, 41) Source(66, 62) + SourceIndex(0) +11>Emitted(57, 47) Source(66, 68) + SourceIndex(0) +12>Emitted(57, 49) Source(66, 70) + SourceIndex(0) +13>Emitted(57, 51) Source(66, 72) + SourceIndex(0) +14>Emitted(57, 58) Source(66, 79) + SourceIndex(0) +15>Emitted(57, 60) Source(66, 81) + SourceIndex(0) +16>Emitted(57, 68) Source(66, 89) + SourceIndex(0) +17>Emitted(57, 70) Source(66, 91) + SourceIndex(0) +18>Emitted(57, 79) Source(66, 100) + SourceIndex(0) +19>Emitted(57, 81) Source(66, 102) + SourceIndex(0) +20>Emitted(57, 87) Source(66, 108) + SourceIndex(0) +21>Emitted(57, 89) Source(66, 110) + SourceIndex(0) +22>Emitted(57, 91) Source(66, 112) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _y < _z.length; _y++) { 1->^^^^ @@ -1777,41 +1699,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _1 = 0, robots_3 = robots; _1 < robots_3.length; _1++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ 1-> > > > -2 >for -3 > -4 > ({name: nameA, skill: skillA } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({name: nameA, skill: skillA } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(62, 1) Source(72, 1) + SourceIndex(0) -2 >Emitted(62, 4) Source(72, 4) + SourceIndex(0) -3 >Emitted(62, 5) Source(72, 5) + SourceIndex(0) -4 >Emitted(62, 6) Source(72, 39) + SourceIndex(0) -5 >Emitted(62, 16) Source(72, 45) + SourceIndex(0) -6 >Emitted(62, 18) Source(72, 39) + SourceIndex(0) -7 >Emitted(62, 35) Source(72, 45) + SourceIndex(0) -8 >Emitted(62, 37) Source(72, 39) + SourceIndex(0) -9 >Emitted(62, 57) Source(72, 45) + SourceIndex(0) -10>Emitted(62, 59) Source(72, 39) + SourceIndex(0) -11>Emitted(62, 63) Source(72, 45) + SourceIndex(0) +2 >Emitted(62, 6) Source(72, 39) + SourceIndex(0) +3 >Emitted(62, 16) Source(72, 45) + SourceIndex(0) +4 >Emitted(62, 18) Source(72, 39) + SourceIndex(0) +5 >Emitted(62, 35) Source(72, 45) + SourceIndex(0) +6 >Emitted(62, 37) Source(72, 39) + SourceIndex(0) +7 >Emitted(62, 57) Source(72, 45) + SourceIndex(0) +8 >Emitted(62, 59) Source(72, 39) + SourceIndex(0) +9 >Emitted(62, 63) Source(72, 45) + SourceIndex(0) --- >>> _2 = robots_3[_1], nameA = _2.name, skillA = _2.skill; 1 >^^^^^^^^^^^^^^^^^^^^^^^ @@ -1863,45 +1779,39 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _3 = 0, _4 = getRobots(); _3 < _4.length; _3++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ 1-> > -2 >for -3 > -4 > ({name: nameA, skill: skillA } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({name: nameA, skill: skillA } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(66, 1) Source(75, 1) + SourceIndex(0) -2 >Emitted(66, 4) Source(75, 4) + SourceIndex(0) -3 >Emitted(66, 5) Source(75, 5) + SourceIndex(0) -4 >Emitted(66, 6) Source(75, 39) + SourceIndex(0) -5 >Emitted(66, 16) Source(75, 50) + SourceIndex(0) -6 >Emitted(66, 18) Source(75, 39) + SourceIndex(0) -7 >Emitted(66, 23) Source(75, 39) + SourceIndex(0) -8 >Emitted(66, 32) Source(75, 48) + SourceIndex(0) -9 >Emitted(66, 34) Source(75, 50) + SourceIndex(0) -10>Emitted(66, 36) Source(75, 39) + SourceIndex(0) -11>Emitted(66, 50) Source(75, 50) + SourceIndex(0) -12>Emitted(66, 52) Source(75, 39) + SourceIndex(0) -13>Emitted(66, 56) Source(75, 50) + SourceIndex(0) +2 >Emitted(66, 6) Source(75, 39) + SourceIndex(0) +3 >Emitted(66, 16) Source(75, 50) + SourceIndex(0) +4 >Emitted(66, 18) Source(75, 39) + SourceIndex(0) +5 >Emitted(66, 23) Source(75, 39) + SourceIndex(0) +6 >Emitted(66, 32) Source(75, 48) + SourceIndex(0) +7 >Emitted(66, 34) Source(75, 50) + SourceIndex(0) +8 >Emitted(66, 36) Source(75, 39) + SourceIndex(0) +9 >Emitted(66, 50) Source(75, 50) + SourceIndex(0) +10>Emitted(66, 52) Source(75, 39) + SourceIndex(0) +11>Emitted(66, 56) Source(75, 50) + SourceIndex(0) --- >>> _5 = _4[_3], nameA = _5.name, skillA = _5.skill; 1 >^^^^^^^^^^^^^^^^^ @@ -1953,99 +1863,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _6 = 0, _7 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _6 < _7.length; _6++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > ({name: nameA, skill: skillA } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({name: nameA, skill: skillA } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(70, 1) Source(78, 1) + SourceIndex(0) -2 >Emitted(70, 4) Source(78, 4) + SourceIndex(0) -3 >Emitted(70, 5) Source(78, 5) + SourceIndex(0) -4 >Emitted(70, 6) Source(78, 39) + SourceIndex(0) -5 >Emitted(70, 16) Source(78, 115) + SourceIndex(0) -6 >Emitted(70, 18) Source(78, 39) + SourceIndex(0) -7 >Emitted(70, 24) Source(78, 40) + SourceIndex(0) -8 >Emitted(70, 26) Source(78, 42) + SourceIndex(0) -9 >Emitted(70, 30) Source(78, 46) + SourceIndex(0) -10>Emitted(70, 32) Source(78, 48) + SourceIndex(0) -11>Emitted(70, 39) Source(78, 55) + SourceIndex(0) -12>Emitted(70, 41) Source(78, 57) + SourceIndex(0) -13>Emitted(70, 46) Source(78, 62) + SourceIndex(0) -14>Emitted(70, 48) Source(78, 64) + SourceIndex(0) -15>Emitted(70, 56) Source(78, 72) + SourceIndex(0) -16>Emitted(70, 58) Source(78, 74) + SourceIndex(0) -17>Emitted(70, 60) Source(78, 76) + SourceIndex(0) -18>Emitted(70, 62) Source(78, 78) + SourceIndex(0) -19>Emitted(70, 66) Source(78, 82) + SourceIndex(0) -20>Emitted(70, 68) Source(78, 84) + SourceIndex(0) -21>Emitted(70, 77) Source(78, 93) + SourceIndex(0) -22>Emitted(70, 79) Source(78, 95) + SourceIndex(0) -23>Emitted(70, 84) Source(78, 100) + SourceIndex(0) -24>Emitted(70, 86) Source(78, 102) + SourceIndex(0) -25>Emitted(70, 96) Source(78, 112) + SourceIndex(0) -26>Emitted(70, 98) Source(78, 114) + SourceIndex(0) -27>Emitted(70, 99) Source(78, 115) + SourceIndex(0) -28>Emitted(70, 101) Source(78, 39) + SourceIndex(0) -29>Emitted(70, 115) Source(78, 115) + SourceIndex(0) -30>Emitted(70, 117) Source(78, 39) + SourceIndex(0) -31>Emitted(70, 121) Source(78, 115) + SourceIndex(0) +2 >Emitted(70, 6) Source(78, 39) + SourceIndex(0) +3 >Emitted(70, 16) Source(78, 115) + SourceIndex(0) +4 >Emitted(70, 18) Source(78, 39) + SourceIndex(0) +5 >Emitted(70, 24) Source(78, 40) + SourceIndex(0) +6 >Emitted(70, 26) Source(78, 42) + SourceIndex(0) +7 >Emitted(70, 30) Source(78, 46) + SourceIndex(0) +8 >Emitted(70, 32) Source(78, 48) + SourceIndex(0) +9 >Emitted(70, 39) Source(78, 55) + SourceIndex(0) +10>Emitted(70, 41) Source(78, 57) + SourceIndex(0) +11>Emitted(70, 46) Source(78, 62) + SourceIndex(0) +12>Emitted(70, 48) Source(78, 64) + SourceIndex(0) +13>Emitted(70, 56) Source(78, 72) + SourceIndex(0) +14>Emitted(70, 58) Source(78, 74) + SourceIndex(0) +15>Emitted(70, 60) Source(78, 76) + SourceIndex(0) +16>Emitted(70, 62) Source(78, 78) + SourceIndex(0) +17>Emitted(70, 66) Source(78, 82) + SourceIndex(0) +18>Emitted(70, 68) Source(78, 84) + SourceIndex(0) +19>Emitted(70, 77) Source(78, 93) + SourceIndex(0) +20>Emitted(70, 79) Source(78, 95) + SourceIndex(0) +21>Emitted(70, 84) Source(78, 100) + SourceIndex(0) +22>Emitted(70, 86) Source(78, 102) + SourceIndex(0) +23>Emitted(70, 96) Source(78, 112) + SourceIndex(0) +24>Emitted(70, 98) Source(78, 114) + SourceIndex(0) +25>Emitted(70, 99) Source(78, 115) + SourceIndex(0) +26>Emitted(70, 101) Source(78, 39) + SourceIndex(0) +27>Emitted(70, 115) Source(78, 115) + SourceIndex(0) +28>Emitted(70, 117) Source(78, 39) + SourceIndex(0) +29>Emitted(70, 121) Source(78, 115) + SourceIndex(0) --- >>> _8 = _7[_6], nameA = _8.name, skillA = _8.skill; 1 >^^^^^^^^^^^^^^^^^ @@ -2097,40 +2001,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _9 = 0, multiRobots_3 = multiRobots; _9 < multiRobots_3.length; _9++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(74, 1) Source(81, 1) + SourceIndex(0) -2 >Emitted(74, 4) Source(81, 4) + SourceIndex(0) -3 >Emitted(74, 5) Source(81, 5) + SourceIndex(0) -4 >Emitted(74, 6) Source(81, 78) + SourceIndex(0) -5 >Emitted(74, 16) Source(81, 89) + SourceIndex(0) -6 >Emitted(74, 18) Source(81, 78) + SourceIndex(0) -7 >Emitted(74, 45) Source(81, 89) + SourceIndex(0) -8 >Emitted(74, 47) Source(81, 78) + SourceIndex(0) -9 >Emitted(74, 72) Source(81, 89) + SourceIndex(0) -10>Emitted(74, 74) Source(81, 78) + SourceIndex(0) -11>Emitted(74, 78) Source(81, 89) + SourceIndex(0) +2 >Emitted(74, 6) Source(81, 78) + SourceIndex(0) +3 >Emitted(74, 16) Source(81, 89) + SourceIndex(0) +4 >Emitted(74, 18) Source(81, 78) + SourceIndex(0) +5 >Emitted(74, 45) Source(81, 89) + SourceIndex(0) +6 >Emitted(74, 47) Source(81, 78) + SourceIndex(0) +7 >Emitted(74, 72) Source(81, 89) + SourceIndex(0) +8 >Emitted(74, 74) Source(81, 78) + SourceIndex(0) +9 >Emitted(74, 78) Source(81, 89) + SourceIndex(0) --- >>> _10 = multiRobots_3[_9], nameA = _10.name, _11 = _10.skills, primaryA = _11.primary, secondaryA = _11.secondary; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2194,46 +2092,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _12 = 0, _13 = getMultiRobots(); _12 < _13.length; _12++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(78, 1) Source(84, 1) + SourceIndex(0) -2 >Emitted(78, 4) Source(84, 4) + SourceIndex(0) -3 >Emitted(78, 5) Source(84, 5) + SourceIndex(0) -4 >Emitted(78, 6) Source(84, 78) + SourceIndex(0) -5 >Emitted(78, 17) Source(84, 94) + SourceIndex(0) -6 >Emitted(78, 19) Source(84, 78) + SourceIndex(0) -7 >Emitted(78, 25) Source(84, 78) + SourceIndex(0) -8 >Emitted(78, 39) Source(84, 92) + SourceIndex(0) -9 >Emitted(78, 41) Source(84, 94) + SourceIndex(0) -10>Emitted(78, 43) Source(84, 78) + SourceIndex(0) -11>Emitted(78, 59) Source(84, 94) + SourceIndex(0) -12>Emitted(78, 61) Source(84, 78) + SourceIndex(0) -13>Emitted(78, 66) Source(84, 94) + SourceIndex(0) +2 >Emitted(78, 6) Source(84, 78) + SourceIndex(0) +3 >Emitted(78, 17) Source(84, 94) + SourceIndex(0) +4 >Emitted(78, 19) Source(84, 78) + SourceIndex(0) +5 >Emitted(78, 25) Source(84, 78) + SourceIndex(0) +6 >Emitted(78, 39) Source(84, 92) + SourceIndex(0) +7 >Emitted(78, 41) Source(84, 94) + SourceIndex(0) +8 >Emitted(78, 43) Source(84, 78) + SourceIndex(0) +9 >Emitted(78, 59) Source(84, 94) + SourceIndex(0) +10>Emitted(78, 61) Source(84, 78) + SourceIndex(0) +11>Emitted(78, 66) Source(84, 94) + SourceIndex(0) --- >>> _14 = _13[_12], nameA = _14.name, _15 = _14.skills, primaryA = _15.primary, secondaryA = _15.secondary; 1->^^^^^^^^^^^^^^^^^^^^ @@ -2297,80 +2189,74 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _16 = 0, _17 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({name: nameA, skills: { primary: primaryA, secondary: secondaryA } } of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(82, 1) Source(87, 1) + SourceIndex(0) -2 >Emitted(82, 4) Source(87, 4) + SourceIndex(0) -3 >Emitted(82, 5) Source(87, 5) + SourceIndex(0) -4 >Emitted(82, 6) Source(87, 78) + SourceIndex(0) -5 >Emitted(82, 17) Source(88, 79) + SourceIndex(0) -6 >Emitted(82, 19) Source(87, 78) + SourceIndex(0) -7 >Emitted(82, 26) Source(87, 79) + SourceIndex(0) -8 >Emitted(82, 28) Source(87, 81) + SourceIndex(0) -9 >Emitted(82, 32) Source(87, 85) + SourceIndex(0) -10>Emitted(82, 34) Source(87, 87) + SourceIndex(0) -11>Emitted(82, 41) Source(87, 94) + SourceIndex(0) -12>Emitted(82, 43) Source(87, 96) + SourceIndex(0) -13>Emitted(82, 49) Source(87, 102) + SourceIndex(0) -14>Emitted(82, 51) Source(87, 104) + SourceIndex(0) -15>Emitted(82, 53) Source(87, 106) + SourceIndex(0) -16>Emitted(82, 60) Source(87, 113) + SourceIndex(0) -17>Emitted(82, 62) Source(87, 115) + SourceIndex(0) -18>Emitted(82, 70) Source(87, 123) + SourceIndex(0) -19>Emitted(82, 72) Source(87, 125) + SourceIndex(0) -20>Emitted(82, 81) Source(87, 134) + SourceIndex(0) -21>Emitted(82, 83) Source(87, 136) + SourceIndex(0) -22>Emitted(82, 89) Source(87, 142) + SourceIndex(0) -23>Emitted(82, 91) Source(87, 144) + SourceIndex(0) -24>Emitted(82, 93) Source(87, 146) + SourceIndex(0) +2 >Emitted(82, 6) Source(87, 78) + SourceIndex(0) +3 >Emitted(82, 17) Source(88, 79) + SourceIndex(0) +4 >Emitted(82, 19) Source(87, 78) + SourceIndex(0) +5 >Emitted(82, 26) Source(87, 79) + SourceIndex(0) +6 >Emitted(82, 28) Source(87, 81) + SourceIndex(0) +7 >Emitted(82, 32) Source(87, 85) + SourceIndex(0) +8 >Emitted(82, 34) Source(87, 87) + SourceIndex(0) +9 >Emitted(82, 41) Source(87, 94) + SourceIndex(0) +10>Emitted(82, 43) Source(87, 96) + SourceIndex(0) +11>Emitted(82, 49) Source(87, 102) + SourceIndex(0) +12>Emitted(82, 51) Source(87, 104) + SourceIndex(0) +13>Emitted(82, 53) Source(87, 106) + SourceIndex(0) +14>Emitted(82, 60) Source(87, 113) + SourceIndex(0) +15>Emitted(82, 62) Source(87, 115) + SourceIndex(0) +16>Emitted(82, 70) Source(87, 123) + SourceIndex(0) +17>Emitted(82, 72) Source(87, 125) + SourceIndex(0) +18>Emitted(82, 81) Source(87, 134) + SourceIndex(0) +19>Emitted(82, 83) Source(87, 136) + SourceIndex(0) +20>Emitted(82, 89) Source(87, 142) + SourceIndex(0) +21>Emitted(82, 91) Source(87, 144) + SourceIndex(0) +22>Emitted(82, 93) Source(87, 146) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _16 < _17.length; _16++) { 1->^^^^ @@ -2510,39 +2396,33 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _20 = 0, robots_4 = robots; _20 < robots_4.length; _20++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ 1-> > -2 >for -3 > -4 > ({name, skill } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({name, skill } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(87, 1) Source(91, 1) + SourceIndex(0) -2 >Emitted(87, 4) Source(91, 4) + SourceIndex(0) -3 >Emitted(87, 5) Source(91, 5) + SourceIndex(0) -4 >Emitted(87, 6) Source(91, 24) + SourceIndex(0) -5 >Emitted(87, 17) Source(91, 30) + SourceIndex(0) -6 >Emitted(87, 19) Source(91, 24) + SourceIndex(0) -7 >Emitted(87, 36) Source(91, 30) + SourceIndex(0) -8 >Emitted(87, 38) Source(91, 24) + SourceIndex(0) -9 >Emitted(87, 59) Source(91, 30) + SourceIndex(0) -10>Emitted(87, 61) Source(91, 24) + SourceIndex(0) -11>Emitted(87, 66) Source(91, 30) + SourceIndex(0) +2 >Emitted(87, 6) Source(91, 24) + SourceIndex(0) +3 >Emitted(87, 17) Source(91, 30) + SourceIndex(0) +4 >Emitted(87, 19) Source(91, 24) + SourceIndex(0) +5 >Emitted(87, 36) Source(91, 30) + SourceIndex(0) +6 >Emitted(87, 38) Source(91, 24) + SourceIndex(0) +7 >Emitted(87, 59) Source(91, 30) + SourceIndex(0) +8 >Emitted(87, 61) Source(91, 24) + SourceIndex(0) +9 >Emitted(87, 66) Source(91, 30) + SourceIndex(0) --- >>> _21 = robots_4[_20], name = _21.name, skill = _21.skill; 1 >^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2594,45 +2474,39 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _22 = 0, _23 = getRobots(); _22 < _23.length; _22++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ 1-> > -2 >for -3 > -4 > ({name, skill } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({name, skill } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(91, 1) Source(94, 1) + SourceIndex(0) -2 >Emitted(91, 4) Source(94, 4) + SourceIndex(0) -3 >Emitted(91, 5) Source(94, 5) + SourceIndex(0) -4 >Emitted(91, 6) Source(94, 24) + SourceIndex(0) -5 >Emitted(91, 17) Source(94, 35) + SourceIndex(0) -6 >Emitted(91, 19) Source(94, 24) + SourceIndex(0) -7 >Emitted(91, 25) Source(94, 24) + SourceIndex(0) -8 >Emitted(91, 34) Source(94, 33) + SourceIndex(0) -9 >Emitted(91, 36) Source(94, 35) + SourceIndex(0) -10>Emitted(91, 38) Source(94, 24) + SourceIndex(0) -11>Emitted(91, 54) Source(94, 35) + SourceIndex(0) -12>Emitted(91, 56) Source(94, 24) + SourceIndex(0) -13>Emitted(91, 61) Source(94, 35) + SourceIndex(0) +2 >Emitted(91, 6) Source(94, 24) + SourceIndex(0) +3 >Emitted(91, 17) Source(94, 35) + SourceIndex(0) +4 >Emitted(91, 19) Source(94, 24) + SourceIndex(0) +5 >Emitted(91, 25) Source(94, 24) + SourceIndex(0) +6 >Emitted(91, 34) Source(94, 33) + SourceIndex(0) +7 >Emitted(91, 36) Source(94, 35) + SourceIndex(0) +8 >Emitted(91, 38) Source(94, 24) + SourceIndex(0) +9 >Emitted(91, 54) Source(94, 35) + SourceIndex(0) +10>Emitted(91, 56) Source(94, 24) + SourceIndex(0) +11>Emitted(91, 61) Source(94, 35) + SourceIndex(0) --- >>> _24 = _23[_22], name = _24.name, skill = _24.skill; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -2684,99 +2558,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _25 = 0, _26 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _25 < _26.length; _25++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^^ 1-> > -2 >for -3 > -4 > ({name, skill } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({name, skill } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(95, 1) Source(97, 1) + SourceIndex(0) -2 >Emitted(95, 4) Source(97, 4) + SourceIndex(0) -3 >Emitted(95, 5) Source(97, 5) + SourceIndex(0) -4 >Emitted(95, 6) Source(97, 24) + SourceIndex(0) -5 >Emitted(95, 17) Source(97, 100) + SourceIndex(0) -6 >Emitted(95, 19) Source(97, 24) + SourceIndex(0) -7 >Emitted(95, 26) Source(97, 25) + SourceIndex(0) -8 >Emitted(95, 28) Source(97, 27) + SourceIndex(0) -9 >Emitted(95, 32) Source(97, 31) + SourceIndex(0) -10>Emitted(95, 34) Source(97, 33) + SourceIndex(0) -11>Emitted(95, 41) Source(97, 40) + SourceIndex(0) -12>Emitted(95, 43) Source(97, 42) + SourceIndex(0) -13>Emitted(95, 48) Source(97, 47) + SourceIndex(0) -14>Emitted(95, 50) Source(97, 49) + SourceIndex(0) -15>Emitted(95, 58) Source(97, 57) + SourceIndex(0) -16>Emitted(95, 60) Source(97, 59) + SourceIndex(0) -17>Emitted(95, 62) Source(97, 61) + SourceIndex(0) -18>Emitted(95, 64) Source(97, 63) + SourceIndex(0) -19>Emitted(95, 68) Source(97, 67) + SourceIndex(0) -20>Emitted(95, 70) Source(97, 69) + SourceIndex(0) -21>Emitted(95, 79) Source(97, 78) + SourceIndex(0) -22>Emitted(95, 81) Source(97, 80) + SourceIndex(0) -23>Emitted(95, 86) Source(97, 85) + SourceIndex(0) -24>Emitted(95, 88) Source(97, 87) + SourceIndex(0) -25>Emitted(95, 98) Source(97, 97) + SourceIndex(0) -26>Emitted(95, 100) Source(97, 99) + SourceIndex(0) -27>Emitted(95, 101) Source(97, 100) + SourceIndex(0) -28>Emitted(95, 103) Source(97, 24) + SourceIndex(0) -29>Emitted(95, 119) Source(97, 100) + SourceIndex(0) -30>Emitted(95, 121) Source(97, 24) + SourceIndex(0) -31>Emitted(95, 126) Source(97, 100) + SourceIndex(0) +2 >Emitted(95, 6) Source(97, 24) + SourceIndex(0) +3 >Emitted(95, 17) Source(97, 100) + SourceIndex(0) +4 >Emitted(95, 19) Source(97, 24) + SourceIndex(0) +5 >Emitted(95, 26) Source(97, 25) + SourceIndex(0) +6 >Emitted(95, 28) Source(97, 27) + SourceIndex(0) +7 >Emitted(95, 32) Source(97, 31) + SourceIndex(0) +8 >Emitted(95, 34) Source(97, 33) + SourceIndex(0) +9 >Emitted(95, 41) Source(97, 40) + SourceIndex(0) +10>Emitted(95, 43) Source(97, 42) + SourceIndex(0) +11>Emitted(95, 48) Source(97, 47) + SourceIndex(0) +12>Emitted(95, 50) Source(97, 49) + SourceIndex(0) +13>Emitted(95, 58) Source(97, 57) + SourceIndex(0) +14>Emitted(95, 60) Source(97, 59) + SourceIndex(0) +15>Emitted(95, 62) Source(97, 61) + SourceIndex(0) +16>Emitted(95, 64) Source(97, 63) + SourceIndex(0) +17>Emitted(95, 68) Source(97, 67) + SourceIndex(0) +18>Emitted(95, 70) Source(97, 69) + SourceIndex(0) +19>Emitted(95, 79) Source(97, 78) + SourceIndex(0) +20>Emitted(95, 81) Source(97, 80) + SourceIndex(0) +21>Emitted(95, 86) Source(97, 85) + SourceIndex(0) +22>Emitted(95, 88) Source(97, 87) + SourceIndex(0) +23>Emitted(95, 98) Source(97, 97) + SourceIndex(0) +24>Emitted(95, 100) Source(97, 99) + SourceIndex(0) +25>Emitted(95, 101) Source(97, 100) + SourceIndex(0) +26>Emitted(95, 103) Source(97, 24) + SourceIndex(0) +27>Emitted(95, 119) Source(97, 100) + SourceIndex(0) +28>Emitted(95, 121) Source(97, 24) + SourceIndex(0) +29>Emitted(95, 126) Source(97, 100) + SourceIndex(0) --- >>> _27 = _26[_25], name = _27.name, skill = _27.skill; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -2828,40 +2696,34 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _28 = 0, multiRobots_4 = multiRobots; _28 < multiRobots_4.length; _28++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name, skills: { primary, secondary } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({name, skills: { primary, secondary } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(99, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(99, 4) Source(100, 4) + SourceIndex(0) -3 >Emitted(99, 5) Source(100, 5) + SourceIndex(0) -4 >Emitted(99, 6) Source(100, 49) + SourceIndex(0) -5 >Emitted(99, 17) Source(100, 60) + SourceIndex(0) -6 >Emitted(99, 19) Source(100, 49) + SourceIndex(0) -7 >Emitted(99, 46) Source(100, 60) + SourceIndex(0) -8 >Emitted(99, 48) Source(100, 49) + SourceIndex(0) -9 >Emitted(99, 74) Source(100, 60) + SourceIndex(0) -10>Emitted(99, 76) Source(100, 49) + SourceIndex(0) -11>Emitted(99, 81) Source(100, 60) + SourceIndex(0) +2 >Emitted(99, 6) Source(100, 49) + SourceIndex(0) +3 >Emitted(99, 17) Source(100, 60) + SourceIndex(0) +4 >Emitted(99, 19) Source(100, 49) + SourceIndex(0) +5 >Emitted(99, 46) Source(100, 60) + SourceIndex(0) +6 >Emitted(99, 48) Source(100, 49) + SourceIndex(0) +7 >Emitted(99, 74) Source(100, 60) + SourceIndex(0) +8 >Emitted(99, 76) Source(100, 49) + SourceIndex(0) +9 >Emitted(99, 81) Source(100, 60) + SourceIndex(0) --- >>> _29 = multiRobots_4[_28], name = _29.name, _30 = _29.skills, primary = _30.primary, secondary = _30.secondary; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2925,46 +2787,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _31 = 0, _32 = getMultiRobots(); _31 < _32.length; _31++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name, skills: { primary, secondary } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({name, skills: { primary, secondary } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(103, 1) Source(103, 1) + SourceIndex(0) -2 >Emitted(103, 4) Source(103, 4) + SourceIndex(0) -3 >Emitted(103, 5) Source(103, 5) + SourceIndex(0) -4 >Emitted(103, 6) Source(103, 49) + SourceIndex(0) -5 >Emitted(103, 17) Source(103, 65) + SourceIndex(0) -6 >Emitted(103, 19) Source(103, 49) + SourceIndex(0) -7 >Emitted(103, 25) Source(103, 49) + SourceIndex(0) -8 >Emitted(103, 39) Source(103, 63) + SourceIndex(0) -9 >Emitted(103, 41) Source(103, 65) + SourceIndex(0) -10>Emitted(103, 43) Source(103, 49) + SourceIndex(0) -11>Emitted(103, 59) Source(103, 65) + SourceIndex(0) -12>Emitted(103, 61) Source(103, 49) + SourceIndex(0) -13>Emitted(103, 66) Source(103, 65) + SourceIndex(0) +2 >Emitted(103, 6) Source(103, 49) + SourceIndex(0) +3 >Emitted(103, 17) Source(103, 65) + SourceIndex(0) +4 >Emitted(103, 19) Source(103, 49) + SourceIndex(0) +5 >Emitted(103, 25) Source(103, 49) + SourceIndex(0) +6 >Emitted(103, 39) Source(103, 63) + SourceIndex(0) +7 >Emitted(103, 41) Source(103, 65) + SourceIndex(0) +8 >Emitted(103, 43) Source(103, 49) + SourceIndex(0) +9 >Emitted(103, 59) Source(103, 65) + SourceIndex(0) +10>Emitted(103, 61) Source(103, 49) + SourceIndex(0) +11>Emitted(103, 66) Source(103, 65) + SourceIndex(0) --- >>> _33 = _32[_31], name = _33.name, _34 = _33.skills, primary = _34.primary, secondary = _34.secondary; 1->^^^^^^^^^^^^^^^^^^^^ @@ -3028,80 +2884,74 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPattern2.ts --- >>>for (var _35 = 0, _36 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name, skills: { primary, secondary } } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({name, skills: { primary, secondary } } of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(107, 1) Source(106, 1) + SourceIndex(0) -2 >Emitted(107, 4) Source(106, 4) + SourceIndex(0) -3 >Emitted(107, 5) Source(106, 5) + SourceIndex(0) -4 >Emitted(107, 6) Source(106, 49) + SourceIndex(0) -5 >Emitted(107, 17) Source(107, 79) + SourceIndex(0) -6 >Emitted(107, 19) Source(106, 49) + SourceIndex(0) -7 >Emitted(107, 26) Source(106, 50) + SourceIndex(0) -8 >Emitted(107, 28) Source(106, 52) + SourceIndex(0) -9 >Emitted(107, 32) Source(106, 56) + SourceIndex(0) -10>Emitted(107, 34) Source(106, 58) + SourceIndex(0) -11>Emitted(107, 41) Source(106, 65) + SourceIndex(0) -12>Emitted(107, 43) Source(106, 67) + SourceIndex(0) -13>Emitted(107, 49) Source(106, 73) + SourceIndex(0) -14>Emitted(107, 51) Source(106, 75) + SourceIndex(0) -15>Emitted(107, 53) Source(106, 77) + SourceIndex(0) -16>Emitted(107, 60) Source(106, 84) + SourceIndex(0) -17>Emitted(107, 62) Source(106, 86) + SourceIndex(0) -18>Emitted(107, 70) Source(106, 94) + SourceIndex(0) -19>Emitted(107, 72) Source(106, 96) + SourceIndex(0) -20>Emitted(107, 81) Source(106, 105) + SourceIndex(0) -21>Emitted(107, 83) Source(106, 107) + SourceIndex(0) -22>Emitted(107, 89) Source(106, 113) + SourceIndex(0) -23>Emitted(107, 91) Source(106, 115) + SourceIndex(0) -24>Emitted(107, 93) Source(106, 117) + SourceIndex(0) +2 >Emitted(107, 6) Source(106, 49) + SourceIndex(0) +3 >Emitted(107, 17) Source(107, 79) + SourceIndex(0) +4 >Emitted(107, 19) Source(106, 49) + SourceIndex(0) +5 >Emitted(107, 26) Source(106, 50) + SourceIndex(0) +6 >Emitted(107, 28) Source(106, 52) + SourceIndex(0) +7 >Emitted(107, 32) Source(106, 56) + SourceIndex(0) +8 >Emitted(107, 34) Source(106, 58) + SourceIndex(0) +9 >Emitted(107, 41) Source(106, 65) + SourceIndex(0) +10>Emitted(107, 43) Source(106, 67) + SourceIndex(0) +11>Emitted(107, 49) Source(106, 73) + SourceIndex(0) +12>Emitted(107, 51) Source(106, 75) + SourceIndex(0) +13>Emitted(107, 53) Source(106, 77) + SourceIndex(0) +14>Emitted(107, 60) Source(106, 84) + SourceIndex(0) +15>Emitted(107, 62) Source(106, 86) + SourceIndex(0) +16>Emitted(107, 70) Source(106, 94) + SourceIndex(0) +17>Emitted(107, 72) Source(106, 96) + SourceIndex(0) +18>Emitted(107, 81) Source(106, 105) + SourceIndex(0) +19>Emitted(107, 83) Source(106, 107) + SourceIndex(0) +20>Emitted(107, 89) Source(106, 113) + SourceIndex(0) +21>Emitted(107, 91) Source(106, 115) + SourceIndex(0) +22>Emitted(107, 93) Source(106, 117) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _35 < _36.length; _35++) { 1->^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map index 87f1e878b55..ded47f3d17f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,GAAG,CAAC,CAAkC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlC,IAAA,sBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvC,IAAA,gBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAkC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAxG,IAAA,gBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CACkD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IADtD,IAAA,6BACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CACkD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAD3D,IAAA,kBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAEA,UAC0E,EAD1E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAClF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD1E,cAC0E,EAD1E,IAC0E;IAHnE,IAAA,kBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAInF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAA6D,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAA9D,IAAA,iBAAoD,EAAnD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8D,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAApE,IAAA,WAAqD,EAApD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8D,UAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,eAA4E,EAA5E,IAA4E;IAArI,IAAA,aAAqD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IANP,IAAA,wBAMR,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IANZ,IAAA,cAMR,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;IAPrE,IAAA,cAMR,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,KAAsC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlC,IAAA,sBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAsC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvC,IAAA,gBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAsC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAxG,IAAA,gBAAsB,EAAtB,qCAAsB;IAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACsD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IADtD,IAAA,6BACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KACsD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAD3D,IAAA,kBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAEnF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAEI,UAC0E,EAD1E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAClF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD1E,cAC0E,EAD1E,IAC0E;IAHnE,IAAA,kBACqC,EADrC,sEACqC,EAD3B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAInF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,KAAiE,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAA9D,IAAA,iBAAoD,EAAnD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAkE,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAApE,IAAA,WAAqD,EAApD,YAAsB,EAAtB,qCAAsB,EAAE,aAAyB,EAAzB,uCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAkE,UAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,eAA4E,EAA5E,IAA4E;IAArI,IAAA,aAAqD,EAApD,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;IANP,IAAA,wBAMR,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IANZ,IAAA,cAMR,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;IAPrE,IAAA,cAMR,EALG,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt index 2b43f2fc360..c671abf622a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.sourcemap.txt @@ -246,21 +246,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) --- >>>} 1 > @@ -282,21 +279,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) --- >>>} 1 > @@ -310,41 +304,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > (let {name: nameA = "noName" } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let {name: nameA = "noName" } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(10, 1) Source(29, 1) + SourceIndex(0) -2 >Emitted(10, 4) Source(29, 4) + SourceIndex(0) -3 >Emitted(10, 5) Source(29, 5) + SourceIndex(0) -4 >Emitted(10, 6) Source(29, 39) + SourceIndex(0) -5 >Emitted(10, 16) Source(29, 45) + SourceIndex(0) -6 >Emitted(10, 18) Source(29, 39) + SourceIndex(0) -7 >Emitted(10, 35) Source(29, 45) + SourceIndex(0) -8 >Emitted(10, 37) Source(29, 39) + SourceIndex(0) -9 >Emitted(10, 57) Source(29, 45) + SourceIndex(0) -10>Emitted(10, 59) Source(29, 39) + SourceIndex(0) -11>Emitted(10, 63) Source(29, 45) + SourceIndex(0) +2 >Emitted(10, 6) Source(29, 39) + SourceIndex(0) +3 >Emitted(10, 16) Source(29, 45) + SourceIndex(0) +4 >Emitted(10, 18) Source(29, 39) + SourceIndex(0) +5 >Emitted(10, 35) Source(29, 45) + SourceIndex(0) +6 >Emitted(10, 37) Source(29, 39) + SourceIndex(0) +7 >Emitted(10, 57) Source(29, 45) + SourceIndex(0) +8 >Emitted(10, 59) Source(29, 39) + SourceIndex(0) +9 >Emitted(10, 63) Source(29, 45) + SourceIndex(0) --- >>> var _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; 1->^^^^ @@ -399,46 +387,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let {name: nameA = "noName" } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let {name: nameA = "noName" } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(14, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(14, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(14, 6) Source(32, 39) + SourceIndex(0) -5 >Emitted(14, 16) Source(32, 50) + SourceIndex(0) -6 >Emitted(14, 18) Source(32, 39) + SourceIndex(0) -7 >Emitted(14, 23) Source(32, 39) + SourceIndex(0) -8 >Emitted(14, 32) Source(32, 48) + SourceIndex(0) -9 >Emitted(14, 34) Source(32, 50) + SourceIndex(0) -10>Emitted(14, 36) Source(32, 39) + SourceIndex(0) -11>Emitted(14, 50) Source(32, 50) + SourceIndex(0) -12>Emitted(14, 52) Source(32, 39) + SourceIndex(0) -13>Emitted(14, 56) Source(32, 50) + SourceIndex(0) +2 >Emitted(14, 6) Source(32, 39) + SourceIndex(0) +3 >Emitted(14, 16) Source(32, 50) + SourceIndex(0) +4 >Emitted(14, 18) Source(32, 39) + SourceIndex(0) +5 >Emitted(14, 23) Source(32, 39) + SourceIndex(0) +6 >Emitted(14, 32) Source(32, 48) + SourceIndex(0) +7 >Emitted(14, 34) Source(32, 50) + SourceIndex(0) +8 >Emitted(14, 36) Source(32, 39) + SourceIndex(0) +9 >Emitted(14, 50) Source(32, 50) + SourceIndex(0) +10>Emitted(14, 52) Source(32, 39) + SourceIndex(0) +11>Emitted(14, 56) Source(32, 50) + SourceIndex(0) --- >>> var _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; 1->^^^^ @@ -493,99 +475,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > (let {name: nameA = "noName" } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for (let {name: nameA = "noName" } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(18, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(18, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(18, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(18, 6) Source(35, 39) + SourceIndex(0) -5 >Emitted(18, 16) Source(35, 115) + SourceIndex(0) -6 >Emitted(18, 18) Source(35, 39) + SourceIndex(0) -7 >Emitted(18, 24) Source(35, 40) + SourceIndex(0) -8 >Emitted(18, 26) Source(35, 42) + SourceIndex(0) -9 >Emitted(18, 30) Source(35, 46) + SourceIndex(0) -10>Emitted(18, 32) Source(35, 48) + SourceIndex(0) -11>Emitted(18, 39) Source(35, 55) + SourceIndex(0) -12>Emitted(18, 41) Source(35, 57) + SourceIndex(0) -13>Emitted(18, 46) Source(35, 62) + SourceIndex(0) -14>Emitted(18, 48) Source(35, 64) + SourceIndex(0) -15>Emitted(18, 56) Source(35, 72) + SourceIndex(0) -16>Emitted(18, 58) Source(35, 74) + SourceIndex(0) -17>Emitted(18, 60) Source(35, 76) + SourceIndex(0) -18>Emitted(18, 62) Source(35, 78) + SourceIndex(0) -19>Emitted(18, 66) Source(35, 82) + SourceIndex(0) -20>Emitted(18, 68) Source(35, 84) + SourceIndex(0) -21>Emitted(18, 77) Source(35, 93) + SourceIndex(0) -22>Emitted(18, 79) Source(35, 95) + SourceIndex(0) -23>Emitted(18, 84) Source(35, 100) + SourceIndex(0) -24>Emitted(18, 86) Source(35, 102) + SourceIndex(0) -25>Emitted(18, 96) Source(35, 112) + SourceIndex(0) -26>Emitted(18, 98) Source(35, 114) + SourceIndex(0) -27>Emitted(18, 99) Source(35, 115) + SourceIndex(0) -28>Emitted(18, 101) Source(35, 39) + SourceIndex(0) -29>Emitted(18, 115) Source(35, 115) + SourceIndex(0) -30>Emitted(18, 117) Source(35, 39) + SourceIndex(0) -31>Emitted(18, 121) Source(35, 115) + SourceIndex(0) +2 >Emitted(18, 6) Source(35, 39) + SourceIndex(0) +3 >Emitted(18, 16) Source(35, 115) + SourceIndex(0) +4 >Emitted(18, 18) Source(35, 39) + SourceIndex(0) +5 >Emitted(18, 24) Source(35, 40) + SourceIndex(0) +6 >Emitted(18, 26) Source(35, 42) + SourceIndex(0) +7 >Emitted(18, 30) Source(35, 46) + SourceIndex(0) +8 >Emitted(18, 32) Source(35, 48) + SourceIndex(0) +9 >Emitted(18, 39) Source(35, 55) + SourceIndex(0) +10>Emitted(18, 41) Source(35, 57) + SourceIndex(0) +11>Emitted(18, 46) Source(35, 62) + SourceIndex(0) +12>Emitted(18, 48) Source(35, 64) + SourceIndex(0) +13>Emitted(18, 56) Source(35, 72) + SourceIndex(0) +14>Emitted(18, 58) Source(35, 74) + SourceIndex(0) +15>Emitted(18, 60) Source(35, 76) + SourceIndex(0) +16>Emitted(18, 62) Source(35, 78) + SourceIndex(0) +17>Emitted(18, 66) Source(35, 82) + SourceIndex(0) +18>Emitted(18, 68) Source(35, 84) + SourceIndex(0) +19>Emitted(18, 77) Source(35, 93) + SourceIndex(0) +20>Emitted(18, 79) Source(35, 95) + SourceIndex(0) +21>Emitted(18, 84) Source(35, 100) + SourceIndex(0) +22>Emitted(18, 86) Source(35, 102) + SourceIndex(0) +23>Emitted(18, 96) Source(35, 112) + SourceIndex(0) +24>Emitted(18, 98) Source(35, 114) + SourceIndex(0) +25>Emitted(18, 99) Source(35, 115) + SourceIndex(0) +26>Emitted(18, 101) Source(35, 39) + SourceIndex(0) +27>Emitted(18, 115) Source(35, 115) + SourceIndex(0) +28>Emitted(18, 117) Source(35, 39) + SourceIndex(0) +29>Emitted(18, 121) Source(35, 115) + SourceIndex(0) --- >>> var _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; 1 >^^^^ @@ -640,41 +616,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = - > { primary: "nosKill", secondary: "noSkill" } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(22, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(22, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(22, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(22, 6) Source(39, 55) + SourceIndex(0) -5 >Emitted(22, 16) Source(39, 66) + SourceIndex(0) -6 >Emitted(22, 18) Source(39, 55) + SourceIndex(0) -7 >Emitted(22, 45) Source(39, 66) + SourceIndex(0) -8 >Emitted(22, 47) Source(39, 55) + SourceIndex(0) -9 >Emitted(22, 72) Source(39, 66) + SourceIndex(0) -10>Emitted(22, 74) Source(39, 55) + SourceIndex(0) -11>Emitted(22, 78) Source(39, 66) + SourceIndex(0) +2 >Emitted(22, 6) Source(39, 55) + SourceIndex(0) +3 >Emitted(22, 16) Source(39, 66) + SourceIndex(0) +4 >Emitted(22, 18) Source(39, 55) + SourceIndex(0) +5 >Emitted(22, 45) Source(39, 66) + SourceIndex(0) +6 >Emitted(22, 47) Source(39, 55) + SourceIndex(0) +7 >Emitted(22, 72) Source(39, 66) + SourceIndex(0) +8 >Emitted(22, 74) Source(39, 55) + SourceIndex(0) +9 >Emitted(22, 78) Source(39, 66) + SourceIndex(0) --- >>> var _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; 1->^^^^ @@ -756,47 +726,41 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = - > { primary: "nosKill", secondary: "noSkill" } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(26, 1) Source(42, 1) + SourceIndex(0) -2 >Emitted(26, 4) Source(42, 4) + SourceIndex(0) -3 >Emitted(26, 5) Source(42, 5) + SourceIndex(0) -4 >Emitted(26, 6) Source(43, 55) + SourceIndex(0) -5 >Emitted(26, 16) Source(43, 71) + SourceIndex(0) -6 >Emitted(26, 18) Source(43, 55) + SourceIndex(0) -7 >Emitted(26, 23) Source(43, 55) + SourceIndex(0) -8 >Emitted(26, 37) Source(43, 69) + SourceIndex(0) -9 >Emitted(26, 39) Source(43, 71) + SourceIndex(0) -10>Emitted(26, 41) Source(43, 55) + SourceIndex(0) -11>Emitted(26, 55) Source(43, 71) + SourceIndex(0) -12>Emitted(26, 57) Source(43, 55) + SourceIndex(0) -13>Emitted(26, 61) Source(43, 71) + SourceIndex(0) +2 >Emitted(26, 6) Source(43, 55) + SourceIndex(0) +3 >Emitted(26, 16) Source(43, 71) + SourceIndex(0) +4 >Emitted(26, 18) Source(43, 55) + SourceIndex(0) +5 >Emitted(26, 23) Source(43, 55) + SourceIndex(0) +6 >Emitted(26, 37) Source(43, 69) + SourceIndex(0) +7 >Emitted(26, 39) Source(43, 71) + SourceIndex(0) +8 >Emitted(26, 41) Source(43, 55) + SourceIndex(0) +9 >Emitted(26, 55) Source(43, 71) + SourceIndex(0) +10>Emitted(26, 57) Source(43, 55) + SourceIndex(0) +11>Emitted(26, 61) Source(43, 71) + SourceIndex(0) --- >>> var _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; 1->^^^^ @@ -878,85 +842,79 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^ -9 > ^^ -10> ^^^^ -11> ^^ -12> ^^^^^^^ -13> ^^ -14> ^^^^^^ -15> ^^ -16> ^^ -17> ^^^^^^^ -18> ^^ -19> ^^^^^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^^ -24> ^^ -25> ^^ -26> ^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^ +8 > ^^^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^^ +14> ^^ +15> ^^^^^^^ +16> ^^ +17> ^^^^^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^^ +22> ^^ +23> ^^ +24> ^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = - > { primary: "nosKill", secondary: "noSkill" } } of - > -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of + > +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > -8 > [ -9 > { -10> name -11> : -12> "mower" -13> , -14> skills -15> : -16> { -17> primary -18> : -19> "mowing" -20> , -21> secondary -22> : -23> "none" -24> } -25> } +4 > +5 > +6 > [ +7 > { +8 > name +9 > : +10> "mower" +11> , +12> skills +13> : +14> { +15> primary +16> : +17> "mowing" +18> , +19> secondary +20> : +21> "none" +22> } +23> } 1->Emitted(30, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(30, 4) Source(46, 4) + SourceIndex(0) -3 >Emitted(30, 5) Source(46, 5) + SourceIndex(0) -4 >Emitted(30, 6) Source(48, 5) + SourceIndex(0) -5 >Emitted(30, 16) Source(49, 79) + SourceIndex(0) -6 >Emitted(30, 18) Source(48, 5) + SourceIndex(0) -7 >Emitted(30, 23) Source(48, 19) + SourceIndex(0) -8 >Emitted(30, 24) Source(48, 20) + SourceIndex(0) -9 >Emitted(30, 26) Source(48, 22) + SourceIndex(0) -10>Emitted(30, 30) Source(48, 26) + SourceIndex(0) -11>Emitted(30, 32) Source(48, 28) + SourceIndex(0) -12>Emitted(30, 39) Source(48, 35) + SourceIndex(0) -13>Emitted(30, 41) Source(48, 37) + SourceIndex(0) -14>Emitted(30, 47) Source(48, 43) + SourceIndex(0) -15>Emitted(30, 49) Source(48, 45) + SourceIndex(0) -16>Emitted(30, 51) Source(48, 47) + SourceIndex(0) -17>Emitted(30, 58) Source(48, 54) + SourceIndex(0) -18>Emitted(30, 60) Source(48, 56) + SourceIndex(0) -19>Emitted(30, 68) Source(48, 64) + SourceIndex(0) -20>Emitted(30, 70) Source(48, 66) + SourceIndex(0) -21>Emitted(30, 79) Source(48, 75) + SourceIndex(0) -22>Emitted(30, 81) Source(48, 77) + SourceIndex(0) -23>Emitted(30, 87) Source(48, 83) + SourceIndex(0) -24>Emitted(30, 89) Source(48, 85) + SourceIndex(0) -25>Emitted(30, 91) Source(48, 87) + SourceIndex(0) +2 >Emitted(30, 6) Source(48, 5) + SourceIndex(0) +3 >Emitted(30, 16) Source(49, 79) + SourceIndex(0) +4 >Emitted(30, 18) Source(48, 5) + SourceIndex(0) +5 >Emitted(30, 23) Source(48, 19) + SourceIndex(0) +6 >Emitted(30, 24) Source(48, 20) + SourceIndex(0) +7 >Emitted(30, 26) Source(48, 22) + SourceIndex(0) +8 >Emitted(30, 30) Source(48, 26) + SourceIndex(0) +9 >Emitted(30, 32) Source(48, 28) + SourceIndex(0) +10>Emitted(30, 39) Source(48, 35) + SourceIndex(0) +11>Emitted(30, 41) Source(48, 37) + SourceIndex(0) +12>Emitted(30, 47) Source(48, 43) + SourceIndex(0) +13>Emitted(30, 49) Source(48, 45) + SourceIndex(0) +14>Emitted(30, 51) Source(48, 47) + SourceIndex(0) +15>Emitted(30, 58) Source(48, 54) + SourceIndex(0) +16>Emitted(30, 60) Source(48, 56) + SourceIndex(0) +17>Emitted(30, 68) Source(48, 64) + SourceIndex(0) +18>Emitted(30, 70) Source(48, 66) + SourceIndex(0) +19>Emitted(30, 79) Source(48, 75) + SourceIndex(0) +20>Emitted(30, 81) Source(48, 77) + SourceIndex(0) +21>Emitted(30, 87) Source(48, 83) + SourceIndex(0) +22>Emitted(30, 89) Source(48, 85) + SourceIndex(0) +23>Emitted(30, 91) Source(48, 87) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { 1->^^^^ @@ -1115,41 +1073,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(35, 1) Source(53, 1) + SourceIndex(0) -2 >Emitted(35, 4) Source(53, 4) + SourceIndex(0) -3 >Emitted(35, 5) Source(53, 5) + SourceIndex(0) -4 >Emitted(35, 6) Source(53, 66) + SourceIndex(0) -5 >Emitted(35, 16) Source(53, 72) + SourceIndex(0) -6 >Emitted(35, 18) Source(53, 66) + SourceIndex(0) -7 >Emitted(35, 35) Source(53, 72) + SourceIndex(0) -8 >Emitted(35, 37) Source(53, 66) + SourceIndex(0) -9 >Emitted(35, 57) Source(53, 72) + SourceIndex(0) -10>Emitted(35, 59) Source(53, 66) + SourceIndex(0) -11>Emitted(35, 63) Source(53, 72) + SourceIndex(0) +2 >Emitted(35, 6) Source(53, 66) + SourceIndex(0) +3 >Emitted(35, 16) Source(53, 72) + SourceIndex(0) +4 >Emitted(35, 18) Source(53, 66) + SourceIndex(0) +5 >Emitted(35, 35) Source(53, 72) + SourceIndex(0) +6 >Emitted(35, 37) Source(53, 66) + SourceIndex(0) +7 >Emitted(35, 57) Source(53, 72) + SourceIndex(0) +8 >Emitted(35, 59) Source(53, 66) + SourceIndex(0) +9 >Emitted(35, 63) Source(53, 72) + SourceIndex(0) --- >>> var _1 = robots_2[_0], _2 = _1.name, nameA = _2 === void 0 ? "noName" : _2, _3 = _1.skill, skillA = _3 === void 0 ? "noSkill" : _3; 1->^^^^ @@ -1222,46 +1174,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _4 = 0, _5 = getRobots(); _4 < _5.length; _4++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(39, 1) Source(56, 1) + SourceIndex(0) -2 >Emitted(39, 4) Source(56, 4) + SourceIndex(0) -3 >Emitted(39, 5) Source(56, 5) + SourceIndex(0) -4 >Emitted(39, 6) Source(56, 67) + SourceIndex(0) -5 >Emitted(39, 16) Source(56, 78) + SourceIndex(0) -6 >Emitted(39, 18) Source(56, 67) + SourceIndex(0) -7 >Emitted(39, 23) Source(56, 67) + SourceIndex(0) -8 >Emitted(39, 32) Source(56, 76) + SourceIndex(0) -9 >Emitted(39, 34) Source(56, 78) + SourceIndex(0) -10>Emitted(39, 36) Source(56, 67) + SourceIndex(0) -11>Emitted(39, 50) Source(56, 78) + SourceIndex(0) -12>Emitted(39, 52) Source(56, 67) + SourceIndex(0) -13>Emitted(39, 56) Source(56, 78) + SourceIndex(0) +2 >Emitted(39, 6) Source(56, 67) + SourceIndex(0) +3 >Emitted(39, 16) Source(56, 78) + SourceIndex(0) +4 >Emitted(39, 18) Source(56, 67) + SourceIndex(0) +5 >Emitted(39, 23) Source(56, 67) + SourceIndex(0) +6 >Emitted(39, 32) Source(56, 76) + SourceIndex(0) +7 >Emitted(39, 34) Source(56, 78) + SourceIndex(0) +8 >Emitted(39, 36) Source(56, 67) + SourceIndex(0) +9 >Emitted(39, 50) Source(56, 78) + SourceIndex(0) +10>Emitted(39, 52) Source(56, 67) + SourceIndex(0) +11>Emitted(39, 56) Source(56, 78) + SourceIndex(0) --- >>> var _6 = _5[_4], _7 = _6.name, nameA = _7 === void 0 ? "noName" : _7, _8 = _6.skill, skillA = _8 === void 0 ? "noSkill" : _8; 1->^^^^ @@ -1334,100 +1280,94 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _9 = 0, _10 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _9 < _10.length; _9++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ -32> ^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ +30> ^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let {name: nameA = "noName", skill: skillA = "noSkill" } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for (let {name: nameA = "noName", skill: skillA = "noSkill" } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(43, 1) Source(59, 1) + SourceIndex(0) -2 >Emitted(43, 4) Source(59, 4) + SourceIndex(0) -3 >Emitted(43, 5) Source(59, 5) + SourceIndex(0) -4 >Emitted(43, 6) Source(59, 67) + SourceIndex(0) -5 >Emitted(43, 16) Source(59, 143) + SourceIndex(0) -6 >Emitted(43, 18) Source(59, 67) + SourceIndex(0) -7 >Emitted(43, 25) Source(59, 68) + SourceIndex(0) -8 >Emitted(43, 27) Source(59, 70) + SourceIndex(0) -9 >Emitted(43, 31) Source(59, 74) + SourceIndex(0) -10>Emitted(43, 33) Source(59, 76) + SourceIndex(0) -11>Emitted(43, 40) Source(59, 83) + SourceIndex(0) -12>Emitted(43, 42) Source(59, 85) + SourceIndex(0) -13>Emitted(43, 47) Source(59, 90) + SourceIndex(0) -14>Emitted(43, 49) Source(59, 92) + SourceIndex(0) -15>Emitted(43, 57) Source(59, 100) + SourceIndex(0) -16>Emitted(43, 59) Source(59, 102) + SourceIndex(0) -17>Emitted(43, 61) Source(59, 104) + SourceIndex(0) -18>Emitted(43, 63) Source(59, 106) + SourceIndex(0) -19>Emitted(43, 67) Source(59, 110) + SourceIndex(0) -20>Emitted(43, 69) Source(59, 112) + SourceIndex(0) -21>Emitted(43, 78) Source(59, 121) + SourceIndex(0) -22>Emitted(43, 80) Source(59, 123) + SourceIndex(0) -23>Emitted(43, 85) Source(59, 128) + SourceIndex(0) -24>Emitted(43, 87) Source(59, 130) + SourceIndex(0) -25>Emitted(43, 97) Source(59, 140) + SourceIndex(0) -26>Emitted(43, 99) Source(59, 142) + SourceIndex(0) -27>Emitted(43, 100) Source(59, 143) + SourceIndex(0) -28>Emitted(43, 102) Source(59, 67) + SourceIndex(0) -29>Emitted(43, 117) Source(59, 143) + SourceIndex(0) -30>Emitted(43, 119) Source(59, 67) + SourceIndex(0) -31>Emitted(43, 123) Source(59, 143) + SourceIndex(0) +2 >Emitted(43, 6) Source(59, 67) + SourceIndex(0) +3 >Emitted(43, 16) Source(59, 143) + SourceIndex(0) +4 >Emitted(43, 18) Source(59, 67) + SourceIndex(0) +5 >Emitted(43, 25) Source(59, 68) + SourceIndex(0) +6 >Emitted(43, 27) Source(59, 70) + SourceIndex(0) +7 >Emitted(43, 31) Source(59, 74) + SourceIndex(0) +8 >Emitted(43, 33) Source(59, 76) + SourceIndex(0) +9 >Emitted(43, 40) Source(59, 83) + SourceIndex(0) +10>Emitted(43, 42) Source(59, 85) + SourceIndex(0) +11>Emitted(43, 47) Source(59, 90) + SourceIndex(0) +12>Emitted(43, 49) Source(59, 92) + SourceIndex(0) +13>Emitted(43, 57) Source(59, 100) + SourceIndex(0) +14>Emitted(43, 59) Source(59, 102) + SourceIndex(0) +15>Emitted(43, 61) Source(59, 104) + SourceIndex(0) +16>Emitted(43, 63) Source(59, 106) + SourceIndex(0) +17>Emitted(43, 67) Source(59, 110) + SourceIndex(0) +18>Emitted(43, 69) Source(59, 112) + SourceIndex(0) +19>Emitted(43, 78) Source(59, 121) + SourceIndex(0) +20>Emitted(43, 80) Source(59, 123) + SourceIndex(0) +21>Emitted(43, 85) Source(59, 128) + SourceIndex(0) +22>Emitted(43, 87) Source(59, 130) + SourceIndex(0) +23>Emitted(43, 97) Source(59, 140) + SourceIndex(0) +24>Emitted(43, 99) Source(59, 142) + SourceIndex(0) +25>Emitted(43, 100) Source(59, 143) + SourceIndex(0) +26>Emitted(43, 102) Source(59, 67) + SourceIndex(0) +27>Emitted(43, 117) Source(59, 143) + SourceIndex(0) +28>Emitted(43, 119) Source(59, 67) + SourceIndex(0) +29>Emitted(43, 123) Source(59, 143) + SourceIndex(0) --- >>> var _11 = _10[_9], _12 = _11.name, nameA = _12 === void 0 ? "noName" : _12, _13 = _11.skill, skillA = _13 === void 0 ? "noSkill" : _13; 1->^^^^ @@ -1500,46 +1440,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _14 = 0, multiRobots_2 = multiRobots; _14 < multiRobots_2.length; _14++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { - > name: nameA = "noName", - > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(47, 1) Source(62, 1) + SourceIndex(0) -2 >Emitted(47, 4) Source(62, 4) + SourceIndex(0) -3 >Emitted(47, 5) Source(62, 5) + SourceIndex(0) -4 >Emitted(47, 6) Source(68, 6) + SourceIndex(0) -5 >Emitted(47, 17) Source(68, 17) + SourceIndex(0) -6 >Emitted(47, 19) Source(68, 6) + SourceIndex(0) -7 >Emitted(47, 46) Source(68, 17) + SourceIndex(0) -8 >Emitted(47, 48) Source(68, 6) + SourceIndex(0) -9 >Emitted(47, 74) Source(68, 17) + SourceIndex(0) -10>Emitted(47, 76) Source(68, 6) + SourceIndex(0) -11>Emitted(47, 81) Source(68, 17) + SourceIndex(0) +2 >Emitted(47, 6) Source(68, 6) + SourceIndex(0) +3 >Emitted(47, 17) Source(68, 17) + SourceIndex(0) +4 >Emitted(47, 19) Source(68, 6) + SourceIndex(0) +5 >Emitted(47, 46) Source(68, 17) + SourceIndex(0) +6 >Emitted(47, 48) Source(68, 6) + SourceIndex(0) +7 >Emitted(47, 74) Source(68, 17) + SourceIndex(0) +8 >Emitted(47, 76) Source(68, 6) + SourceIndex(0) +9 >Emitted(47, 81) Source(68, 17) + SourceIndex(0) --- >>> var _15 = multiRobots_2[_14], _16 = _15.name, nameA = _16 === void 0 ? "noName" : _16, _17 = _15.skills, _18 = _17 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _17, _19 = _18.primary, primaryA = _19 === void 0 ? "primary" : _19, _20 = _18.secondary, secondaryA = _20 === void 0 ? "secondary" : _20; 1->^^^^ @@ -1652,52 +1586,46 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _21 = 0, _22 = getMultiRobots(); _21 < _22.length; _21++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { - > name: nameA = "noName", - > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(51, 1) Source(71, 1) + SourceIndex(0) -2 >Emitted(51, 4) Source(71, 4) + SourceIndex(0) -3 >Emitted(51, 5) Source(71, 5) + SourceIndex(0) -4 >Emitted(51, 6) Source(77, 6) + SourceIndex(0) -5 >Emitted(51, 17) Source(77, 22) + SourceIndex(0) -6 >Emitted(51, 19) Source(77, 6) + SourceIndex(0) -7 >Emitted(51, 25) Source(77, 6) + SourceIndex(0) -8 >Emitted(51, 39) Source(77, 20) + SourceIndex(0) -9 >Emitted(51, 41) Source(77, 22) + SourceIndex(0) -10>Emitted(51, 43) Source(77, 6) + SourceIndex(0) -11>Emitted(51, 59) Source(77, 22) + SourceIndex(0) -12>Emitted(51, 61) Source(77, 6) + SourceIndex(0) -13>Emitted(51, 66) Source(77, 22) + SourceIndex(0) +2 >Emitted(51, 6) Source(77, 6) + SourceIndex(0) +3 >Emitted(51, 17) Source(77, 22) + SourceIndex(0) +4 >Emitted(51, 19) Source(77, 6) + SourceIndex(0) +5 >Emitted(51, 25) Source(77, 6) + SourceIndex(0) +6 >Emitted(51, 39) Source(77, 20) + SourceIndex(0) +7 >Emitted(51, 41) Source(77, 22) + SourceIndex(0) +8 >Emitted(51, 43) Source(77, 6) + SourceIndex(0) +9 >Emitted(51, 59) Source(77, 22) + SourceIndex(0) +10>Emitted(51, 61) Source(77, 6) + SourceIndex(0) +11>Emitted(51, 66) Source(77, 22) + SourceIndex(0) --- >>> var _23 = _22[_21], _24 = _23.name, nameA = _24 === void 0 ? "noName" : _24, _25 = _23.skills, _26 = _25 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _25, _27 = _26.primary, primaryA = _27 === void 0 ? "primary" : _27, _28 = _26.secondary, secondaryA = _28 === void 0 ? "secondary" : _28; 1->^^^^ @@ -1810,89 +1738,83 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _29 = 0, _30 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^ -9 > ^^ -10> ^^^^ -11> ^^ -12> ^^^^^^^ -13> ^^ -14> ^^^^^^ -15> ^^ -16> ^^ -17> ^^^^^^^ -18> ^^ -19> ^^^^^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^^ -24> ^^ -25> ^^ -26> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^ +7 > ^^ +8 > ^^^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^^ +14> ^^ +15> ^^^^^^^ +16> ^^ +17> ^^^^^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^^ +22> ^^ +23> ^^ +24> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > (let { - > name: nameA = "noName", - > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for (let { + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > -8 > [ -9 > { -10> name -11> : -12> "mower" -13> , -14> skills -15> : -16> { -17> primary -18> : -19> "mowing" -20> , -21> secondary -22> : -23> "none" -24> } -25> } +4 > +5 > +6 > [ +7 > { +8 > name +9 > : +10> "mower" +11> , +12> skills +13> : +14> { +15> primary +16> : +17> "mowing" +18> , +19> secondary +20> : +21> "none" +22> } +23> } 1->Emitted(55, 1) Source(80, 1) + SourceIndex(0) -2 >Emitted(55, 4) Source(80, 4) + SourceIndex(0) -3 >Emitted(55, 5) Source(80, 5) + SourceIndex(0) -4 >Emitted(55, 6) Source(86, 6) + SourceIndex(0) -5 >Emitted(55, 17) Source(87, 79) + SourceIndex(0) -6 >Emitted(55, 19) Source(86, 6) + SourceIndex(0) -7 >Emitted(55, 25) Source(86, 20) + SourceIndex(0) -8 >Emitted(55, 26) Source(86, 21) + SourceIndex(0) -9 >Emitted(55, 28) Source(86, 23) + SourceIndex(0) -10>Emitted(55, 32) Source(86, 27) + SourceIndex(0) -11>Emitted(55, 34) Source(86, 29) + SourceIndex(0) -12>Emitted(55, 41) Source(86, 36) + SourceIndex(0) -13>Emitted(55, 43) Source(86, 38) + SourceIndex(0) -14>Emitted(55, 49) Source(86, 44) + SourceIndex(0) -15>Emitted(55, 51) Source(86, 46) + SourceIndex(0) -16>Emitted(55, 53) Source(86, 48) + SourceIndex(0) -17>Emitted(55, 60) Source(86, 55) + SourceIndex(0) -18>Emitted(55, 62) Source(86, 57) + SourceIndex(0) -19>Emitted(55, 70) Source(86, 65) + SourceIndex(0) -20>Emitted(55, 72) Source(86, 67) + SourceIndex(0) -21>Emitted(55, 81) Source(86, 76) + SourceIndex(0) -22>Emitted(55, 83) Source(86, 78) + SourceIndex(0) -23>Emitted(55, 89) Source(86, 84) + SourceIndex(0) -24>Emitted(55, 91) Source(86, 86) + SourceIndex(0) -25>Emitted(55, 93) Source(86, 88) + SourceIndex(0) +2 >Emitted(55, 6) Source(86, 6) + SourceIndex(0) +3 >Emitted(55, 17) Source(87, 79) + SourceIndex(0) +4 >Emitted(55, 19) Source(86, 6) + SourceIndex(0) +5 >Emitted(55, 25) Source(86, 20) + SourceIndex(0) +6 >Emitted(55, 26) Source(86, 21) + SourceIndex(0) +7 >Emitted(55, 28) Source(86, 23) + SourceIndex(0) +8 >Emitted(55, 32) Source(86, 27) + SourceIndex(0) +9 >Emitted(55, 34) Source(86, 29) + SourceIndex(0) +10>Emitted(55, 41) Source(86, 36) + SourceIndex(0) +11>Emitted(55, 43) Source(86, 38) + SourceIndex(0) +12>Emitted(55, 49) Source(86, 44) + SourceIndex(0) +13>Emitted(55, 51) Source(86, 46) + SourceIndex(0) +14>Emitted(55, 53) Source(86, 48) + SourceIndex(0) +15>Emitted(55, 60) Source(86, 55) + SourceIndex(0) +16>Emitted(55, 62) Source(86, 57) + SourceIndex(0) +17>Emitted(55, 70) Source(86, 65) + SourceIndex(0) +18>Emitted(55, 72) Source(86, 67) + SourceIndex(0) +19>Emitted(55, 81) Source(86, 76) + SourceIndex(0) +20>Emitted(55, 83) Source(86, 78) + SourceIndex(0) +21>Emitted(55, 89) Source(86, 84) + SourceIndex(0) +22>Emitted(55, 91) Source(86, 86) + SourceIndex(0) +23>Emitted(55, 93) Source(86, 88) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _29 < _30.length; _29++) { 1->^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map index 645808f0709..1fb3063f3ed 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,GAAG,CAAC,CAA8B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlC,sBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvC,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA8B,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAxG,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CACkD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAD1D,6BACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CACkD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAD/D,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAEA,UAC8E,EAD9E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC9E,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9E,cAC8E,EAD9E,IAC8E;IAH3E,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAI/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,GAAG,CAAC,CAAwB,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAA3B,sBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAwB,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAhC,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAAwB,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAjG,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAKC,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAJZ,6BAGgD,EAHhD,uEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAKC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAJjB,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,GAAG,CAAC,CAKC,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;IAL1E,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,GAAG,CAAC,CAAyD,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAA7D,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA0D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAAnE,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA0D,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E;oBAApI,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BALZ,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBALjB,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;oBAN1E,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,GAAG,CAAC,CAA4C,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAA/C,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAApD,cAAe,EAAf,sCAAe,EAAE,eAAiB,EAAjB,wCAAiB;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAA4C,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E;oBAArH,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BALZ,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBALjB,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,GAAG,CAAC,CAMC,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;oBAN1E,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAgBA,IAAI,MAAM,GAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACnG,IAAI,WAAW,GAAiB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAChG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAE/E;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;IACI,OAAO,WAAW,CAAC;AACvB,CAAC;AAED,IAAI,KAAa,EAAE,QAAgB,EAAE,UAAkB,EAAE,CAAS,EAAE,MAAc,CAAC;AACnF,IAAI,IAAY,EAAE,OAAe,EAAE,SAAiB,EAAE,KAAa,CAAC;AAEpE,KAAkC,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAAlC,sBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAkC,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAvC,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAkC,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAxG,gBAAsB,EAAtB,qCAAsB;IACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KACsD,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAD1D,6BACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KACsD,UAAgB,EAAhB,KAAA,cAAc,EAAE,EAAhB,cAAgB,EAAhB,IAAgB;IAD/D,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAE/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAEI,UAC8E,EAD9E,KAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IAC9E,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EAD9E,cAC8E,EAD9E,IAC8E;IAH3E,kBACyC,EADzC,sEACyC,EAD/B,eAA6B,EAA7B,yCAA6B,EAAE,iBAAmC,EAAnC,6CAAmC;IAI/E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAED,KAA4B,UAAM,EAAN,iBAAM,EAAN,oBAAM,EAAN,IAAM;IAA3B,sBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA4B,UAAW,EAAX,KAAA,SAAS,EAAE,EAAX,cAAW,EAAX,IAAW;IAAhC,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA4B,UAA4E,EAA5E,MAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,cAA4E,EAA5E,IAA4E;IAAjG,gBAAe,EAAf,oCAAe;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAKK,UAAW,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW;IAJZ,6BAGgD,EAHhD,uEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAKK,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;IAJjB,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AACD,KAKK,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;IAL1E,qBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;CACzB;AAGD,KAA6D,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAA7D,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA8D,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAAnE,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAA8D,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E;oBAApI,cAAsB,EAAtB,uCAAsB,EAAE,eAAyB,EAAzB,yCAAyB;IACnD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BALZ,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBALjB,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAGvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WACyE,EADzE,MAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACnF,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;oBAN1E,cAAsB,EAAtB,uCAAsB,EACtB,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAA6B,EAA7B,2CAA6B,EAC7B,mBAAmC,EAAnC,+CAAmC;IAIvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AAED,KAAgD,WAAM,EAAN,iBAAM,EAAN,qBAAM,EAAN,KAAM;yBAA/C,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgD,WAAW,EAAX,MAAA,SAAS,EAAE,EAAX,gBAAW,EAAX,KAAW;oBAApD,cAAe,EAAf,sCAAe,EAAE,eAAiB,EAAjB,wCAAiB;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAAgD,WAA4E,EAA5E,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAA5E,gBAA4E,EAA5E,KAA4E;oBAArH,cAAe,EAAf,sCAAe,EAAE,eAAkB,EAAlB,wCAAkB;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WAAW,EAAX,2BAAW,EAAX,0BAAW,EAAX,KAAW;8BALZ,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WAAgB,EAAhB,MAAA,cAAc,EAAE,EAAhB,gBAAgB,EAAhB,KAAgB;oBALjB,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAG3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;AACD,KAMK,WACyE,EADzE,OAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;IACrE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,EADzE,gBACyE,EADzE,KACyE;oBAN1E,cAAe,EAAf,sCAAe,EACf,gBAGgD,EAHhD,yEAGgD,EAF5C,iBAAmB,EAAnB,0CAAmB,EACnB,mBAAuB,EAAvB,8CAAuB;IAI3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt index 82d95b72094..9efe6ce7960 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.sourcemap.txt @@ -246,21 +246,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>> return robots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobots() { > -2 > return -3 > -4 > robots -5 > ; +2 > return +3 > robots +4 > ; 1->Emitted(5, 5) Source(22, 5) + SourceIndex(0) -2 >Emitted(5, 11) Source(22, 11) + SourceIndex(0) -3 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) -4 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) -5 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) +2 >Emitted(5, 12) Source(22, 12) + SourceIndex(0) +3 >Emitted(5, 18) Source(22, 18) + SourceIndex(0) +4 >Emitted(5, 19) Source(22, 19) + SourceIndex(0) --- >>>} 1 > @@ -282,21 +279,18 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>> return multiRobots; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobots() { > -2 > return -3 > -4 > multiRobots -5 > ; +2 > return +3 > multiRobots +4 > ; 1->Emitted(8, 5) Source(26, 5) + SourceIndex(0) -2 >Emitted(8, 11) Source(26, 11) + SourceIndex(0) -3 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) -4 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) -5 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) +2 >Emitted(8, 12) Source(26, 12) + SourceIndex(0) +3 >Emitted(8, 23) Source(26, 23) + SourceIndex(0) +4 >Emitted(8, 24) Source(26, 24) + SourceIndex(0) --- >>>} 1 > @@ -384,41 +378,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _i = 0, robots_1 = robots; _i < robots_1.length; _i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^-> 1-> > > -2 >for -3 > -4 > ({name: nameA = "noName" } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({name: nameA = "noName" } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(12, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(12, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(12, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(12, 6) Source(32, 35) + SourceIndex(0) -5 >Emitted(12, 16) Source(32, 41) + SourceIndex(0) -6 >Emitted(12, 18) Source(32, 35) + SourceIndex(0) -7 >Emitted(12, 35) Source(32, 41) + SourceIndex(0) -8 >Emitted(12, 37) Source(32, 35) + SourceIndex(0) -9 >Emitted(12, 57) Source(32, 41) + SourceIndex(0) -10>Emitted(12, 59) Source(32, 35) + SourceIndex(0) -11>Emitted(12, 63) Source(32, 41) + SourceIndex(0) +2 >Emitted(12, 6) Source(32, 35) + SourceIndex(0) +3 >Emitted(12, 16) Source(32, 41) + SourceIndex(0) +4 >Emitted(12, 18) Source(32, 35) + SourceIndex(0) +5 >Emitted(12, 35) Source(32, 41) + SourceIndex(0) +6 >Emitted(12, 37) Source(32, 35) + SourceIndex(0) +7 >Emitted(12, 57) Source(32, 41) + SourceIndex(0) +8 >Emitted(12, 59) Source(32, 35) + SourceIndex(0) +9 >Emitted(12, 63) Source(32, 41) + SourceIndex(0) --- >>> _a = robots_1[_i].name, nameA = _a === void 0 ? "noName" : _a; 1->^^^^ @@ -470,46 +458,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _b = 0, _c = getRobots(); _b < _c.length; _b++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^-> 1-> > -2 >for -3 > -4 > ({name: nameA = "noName" } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({name: nameA = "noName" } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(16, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(16, 4) Source(35, 4) + SourceIndex(0) -3 >Emitted(16, 5) Source(35, 5) + SourceIndex(0) -4 >Emitted(16, 6) Source(35, 35) + SourceIndex(0) -5 >Emitted(16, 16) Source(35, 46) + SourceIndex(0) -6 >Emitted(16, 18) Source(35, 35) + SourceIndex(0) -7 >Emitted(16, 23) Source(35, 35) + SourceIndex(0) -8 >Emitted(16, 32) Source(35, 44) + SourceIndex(0) -9 >Emitted(16, 34) Source(35, 46) + SourceIndex(0) -10>Emitted(16, 36) Source(35, 35) + SourceIndex(0) -11>Emitted(16, 50) Source(35, 46) + SourceIndex(0) -12>Emitted(16, 52) Source(35, 35) + SourceIndex(0) -13>Emitted(16, 56) Source(35, 46) + SourceIndex(0) +2 >Emitted(16, 6) Source(35, 35) + SourceIndex(0) +3 >Emitted(16, 16) Source(35, 46) + SourceIndex(0) +4 >Emitted(16, 18) Source(35, 35) + SourceIndex(0) +5 >Emitted(16, 23) Source(35, 35) + SourceIndex(0) +6 >Emitted(16, 32) Source(35, 44) + SourceIndex(0) +7 >Emitted(16, 34) Source(35, 46) + SourceIndex(0) +8 >Emitted(16, 36) Source(35, 35) + SourceIndex(0) +9 >Emitted(16, 50) Source(35, 46) + SourceIndex(0) +10>Emitted(16, 52) Source(35, 35) + SourceIndex(0) +11>Emitted(16, 56) Source(35, 46) + SourceIndex(0) --- >>> _d = _c[_b].name, nameA = _d === void 0 ? "noName" : _d; 1->^^^^ @@ -561,99 +543,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _e = 0, _f = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _e < _f.length; _e++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > ({name: nameA = "noName" } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({name: nameA = "noName" } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(20, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(20, 4) Source(38, 4) + SourceIndex(0) -3 >Emitted(20, 5) Source(38, 5) + SourceIndex(0) -4 >Emitted(20, 6) Source(38, 35) + SourceIndex(0) -5 >Emitted(20, 16) Source(38, 111) + SourceIndex(0) -6 >Emitted(20, 18) Source(38, 35) + SourceIndex(0) -7 >Emitted(20, 24) Source(38, 36) + SourceIndex(0) -8 >Emitted(20, 26) Source(38, 38) + SourceIndex(0) -9 >Emitted(20, 30) Source(38, 42) + SourceIndex(0) -10>Emitted(20, 32) Source(38, 44) + SourceIndex(0) -11>Emitted(20, 39) Source(38, 51) + SourceIndex(0) -12>Emitted(20, 41) Source(38, 53) + SourceIndex(0) -13>Emitted(20, 46) Source(38, 58) + SourceIndex(0) -14>Emitted(20, 48) Source(38, 60) + SourceIndex(0) -15>Emitted(20, 56) Source(38, 68) + SourceIndex(0) -16>Emitted(20, 58) Source(38, 70) + SourceIndex(0) -17>Emitted(20, 60) Source(38, 72) + SourceIndex(0) -18>Emitted(20, 62) Source(38, 74) + SourceIndex(0) -19>Emitted(20, 66) Source(38, 78) + SourceIndex(0) -20>Emitted(20, 68) Source(38, 80) + SourceIndex(0) -21>Emitted(20, 77) Source(38, 89) + SourceIndex(0) -22>Emitted(20, 79) Source(38, 91) + SourceIndex(0) -23>Emitted(20, 84) Source(38, 96) + SourceIndex(0) -24>Emitted(20, 86) Source(38, 98) + SourceIndex(0) -25>Emitted(20, 96) Source(38, 108) + SourceIndex(0) -26>Emitted(20, 98) Source(38, 110) + SourceIndex(0) -27>Emitted(20, 99) Source(38, 111) + SourceIndex(0) -28>Emitted(20, 101) Source(38, 35) + SourceIndex(0) -29>Emitted(20, 115) Source(38, 111) + SourceIndex(0) -30>Emitted(20, 117) Source(38, 35) + SourceIndex(0) -31>Emitted(20, 121) Source(38, 111) + SourceIndex(0) +2 >Emitted(20, 6) Source(38, 35) + SourceIndex(0) +3 >Emitted(20, 16) Source(38, 111) + SourceIndex(0) +4 >Emitted(20, 18) Source(38, 35) + SourceIndex(0) +5 >Emitted(20, 24) Source(38, 36) + SourceIndex(0) +6 >Emitted(20, 26) Source(38, 38) + SourceIndex(0) +7 >Emitted(20, 30) Source(38, 42) + SourceIndex(0) +8 >Emitted(20, 32) Source(38, 44) + SourceIndex(0) +9 >Emitted(20, 39) Source(38, 51) + SourceIndex(0) +10>Emitted(20, 41) Source(38, 53) + SourceIndex(0) +11>Emitted(20, 46) Source(38, 58) + SourceIndex(0) +12>Emitted(20, 48) Source(38, 60) + SourceIndex(0) +13>Emitted(20, 56) Source(38, 68) + SourceIndex(0) +14>Emitted(20, 58) Source(38, 70) + SourceIndex(0) +15>Emitted(20, 60) Source(38, 72) + SourceIndex(0) +16>Emitted(20, 62) Source(38, 74) + SourceIndex(0) +17>Emitted(20, 66) Source(38, 78) + SourceIndex(0) +18>Emitted(20, 68) Source(38, 80) + SourceIndex(0) +19>Emitted(20, 77) Source(38, 89) + SourceIndex(0) +20>Emitted(20, 79) Source(38, 91) + SourceIndex(0) +21>Emitted(20, 84) Source(38, 96) + SourceIndex(0) +22>Emitted(20, 86) Source(38, 98) + SourceIndex(0) +23>Emitted(20, 96) Source(38, 108) + SourceIndex(0) +24>Emitted(20, 98) Source(38, 110) + SourceIndex(0) +25>Emitted(20, 99) Source(38, 111) + SourceIndex(0) +26>Emitted(20, 101) Source(38, 35) + SourceIndex(0) +27>Emitted(20, 115) Source(38, 111) + SourceIndex(0) +28>Emitted(20, 117) Source(38, 35) + SourceIndex(0) +29>Emitted(20, 121) Source(38, 111) + SourceIndex(0) --- >>> _g = _f[_e].name, nameA = _g === void 0 ? "noName" : _g; 1 >^^^^ @@ -705,41 +681,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _h = 0, multiRobots_1 = multiRobots; _h < multiRobots_1.length; _h++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = - > { primary: "nosKill", secondary: "noSkill" } } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(24, 1) Source(41, 1) + SourceIndex(0) -2 >Emitted(24, 4) Source(41, 4) + SourceIndex(0) -3 >Emitted(24, 5) Source(41, 5) + SourceIndex(0) -4 >Emitted(24, 6) Source(42, 55) + SourceIndex(0) -5 >Emitted(24, 16) Source(42, 66) + SourceIndex(0) -6 >Emitted(24, 18) Source(42, 55) + SourceIndex(0) -7 >Emitted(24, 45) Source(42, 66) + SourceIndex(0) -8 >Emitted(24, 47) Source(42, 55) + SourceIndex(0) -9 >Emitted(24, 72) Source(42, 66) + SourceIndex(0) -10>Emitted(24, 74) Source(42, 55) + SourceIndex(0) -11>Emitted(24, 78) Source(42, 66) + SourceIndex(0) +2 >Emitted(24, 6) Source(42, 55) + SourceIndex(0) +3 >Emitted(24, 16) Source(42, 66) + SourceIndex(0) +4 >Emitted(24, 18) Source(42, 55) + SourceIndex(0) +5 >Emitted(24, 45) Source(42, 66) + SourceIndex(0) +6 >Emitted(24, 47) Source(42, 55) + SourceIndex(0) +7 >Emitted(24, 72) Source(42, 66) + SourceIndex(0) +8 >Emitted(24, 74) Source(42, 55) + SourceIndex(0) +9 >Emitted(24, 78) Source(42, 66) + SourceIndex(0) --- >>> _j = multiRobots_1[_h].skills, _k = _j === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _j, _l = _k.primary, primaryA = _l === void 0 ? "primary" : _l, _m = _k.secondary, secondaryA = _m === void 0 ? "secondary" : _m; 1->^^^^ @@ -818,47 +788,41 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _o = 0, _p = getMultiRobots(); _o < _p.length; _o++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = - > { primary: "nosKill", secondary: "noSkill" } } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(28, 1) Source(45, 1) + SourceIndex(0) -2 >Emitted(28, 4) Source(45, 4) + SourceIndex(0) -3 >Emitted(28, 5) Source(45, 5) + SourceIndex(0) -4 >Emitted(28, 6) Source(46, 55) + SourceIndex(0) -5 >Emitted(28, 16) Source(46, 71) + SourceIndex(0) -6 >Emitted(28, 18) Source(46, 55) + SourceIndex(0) -7 >Emitted(28, 23) Source(46, 55) + SourceIndex(0) -8 >Emitted(28, 37) Source(46, 69) + SourceIndex(0) -9 >Emitted(28, 39) Source(46, 71) + SourceIndex(0) -10>Emitted(28, 41) Source(46, 55) + SourceIndex(0) -11>Emitted(28, 55) Source(46, 71) + SourceIndex(0) -12>Emitted(28, 57) Source(46, 55) + SourceIndex(0) -13>Emitted(28, 61) Source(46, 71) + SourceIndex(0) +2 >Emitted(28, 6) Source(46, 55) + SourceIndex(0) +3 >Emitted(28, 16) Source(46, 71) + SourceIndex(0) +4 >Emitted(28, 18) Source(46, 55) + SourceIndex(0) +5 >Emitted(28, 23) Source(46, 55) + SourceIndex(0) +6 >Emitted(28, 37) Source(46, 69) + SourceIndex(0) +7 >Emitted(28, 39) Source(46, 71) + SourceIndex(0) +8 >Emitted(28, 41) Source(46, 55) + SourceIndex(0) +9 >Emitted(28, 55) Source(46, 71) + SourceIndex(0) +10>Emitted(28, 57) Source(46, 55) + SourceIndex(0) +11>Emitted(28, 61) Source(46, 71) + SourceIndex(0) --- >>> _q = _p[_o].skills, _r = _q === void 0 ? { primary: "nosKill", secondary: "noSkill" } : _q, _s = _r.primary, primaryA = _s === void 0 ? "primary" : _s, _t = _r.secondary, secondaryA = _t === void 0 ? "secondary" : _t; 1->^^^^ @@ -937,85 +901,79 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _u = 0, _v = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^ -9 > ^^ -10> ^^^^ -11> ^^ -12> ^^^^^^^ -13> ^^ -14> ^^^^^^ -15> ^^ -16> ^^ -17> ^^^^^^^ -18> ^^ -19> ^^^^^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^^ -24> ^^ -25> ^^ -26> ^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^ +7 > ^^ +8 > ^^^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^^ +14> ^^ +15> ^^^^^^^ +16> ^^ +17> ^^^^^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^^ +22> ^^ +23> ^^ +24> ^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = - > { primary: "nosKill", secondary: "noSkill" } } of - > -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = + > { primary: "nosKill", secondary: "noSkill" } } of + > +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > -8 > [ -9 > { -10> name -11> : -12> "mower" -13> , -14> skills -15> : -16> { -17> primary -18> : -19> "mowing" -20> , -21> secondary -22> : -23> "none" -24> } -25> } +4 > +5 > +6 > [ +7 > { +8 > name +9 > : +10> "mower" +11> , +12> skills +13> : +14> { +15> primary +16> : +17> "mowing" +18> , +19> secondary +20> : +21> "none" +22> } +23> } 1->Emitted(32, 1) Source(49, 1) + SourceIndex(0) -2 >Emitted(32, 4) Source(49, 4) + SourceIndex(0) -3 >Emitted(32, 5) Source(49, 5) + SourceIndex(0) -4 >Emitted(32, 6) Source(51, 5) + SourceIndex(0) -5 >Emitted(32, 16) Source(52, 83) + SourceIndex(0) -6 >Emitted(32, 18) Source(51, 5) + SourceIndex(0) -7 >Emitted(32, 23) Source(51, 19) + SourceIndex(0) -8 >Emitted(32, 24) Source(51, 20) + SourceIndex(0) -9 >Emitted(32, 26) Source(51, 22) + SourceIndex(0) -10>Emitted(32, 30) Source(51, 26) + SourceIndex(0) -11>Emitted(32, 32) Source(51, 28) + SourceIndex(0) -12>Emitted(32, 39) Source(51, 35) + SourceIndex(0) -13>Emitted(32, 41) Source(51, 37) + SourceIndex(0) -14>Emitted(32, 47) Source(51, 43) + SourceIndex(0) -15>Emitted(32, 49) Source(51, 45) + SourceIndex(0) -16>Emitted(32, 51) Source(51, 47) + SourceIndex(0) -17>Emitted(32, 58) Source(51, 54) + SourceIndex(0) -18>Emitted(32, 60) Source(51, 56) + SourceIndex(0) -19>Emitted(32, 68) Source(51, 64) + SourceIndex(0) -20>Emitted(32, 70) Source(51, 66) + SourceIndex(0) -21>Emitted(32, 79) Source(51, 75) + SourceIndex(0) -22>Emitted(32, 81) Source(51, 77) + SourceIndex(0) -23>Emitted(32, 87) Source(51, 83) + SourceIndex(0) -24>Emitted(32, 89) Source(51, 85) + SourceIndex(0) -25>Emitted(32, 91) Source(51, 87) + SourceIndex(0) +2 >Emitted(32, 6) Source(51, 5) + SourceIndex(0) +3 >Emitted(32, 16) Source(52, 83) + SourceIndex(0) +4 >Emitted(32, 18) Source(51, 5) + SourceIndex(0) +5 >Emitted(32, 23) Source(51, 19) + SourceIndex(0) +6 >Emitted(32, 24) Source(51, 20) + SourceIndex(0) +7 >Emitted(32, 26) Source(51, 22) + SourceIndex(0) +8 >Emitted(32, 30) Source(51, 26) + SourceIndex(0) +9 >Emitted(32, 32) Source(51, 28) + SourceIndex(0) +10>Emitted(32, 39) Source(51, 35) + SourceIndex(0) +11>Emitted(32, 41) Source(51, 37) + SourceIndex(0) +12>Emitted(32, 47) Source(51, 43) + SourceIndex(0) +13>Emitted(32, 49) Source(51, 45) + SourceIndex(0) +14>Emitted(32, 51) Source(51, 47) + SourceIndex(0) +15>Emitted(32, 58) Source(51, 54) + SourceIndex(0) +16>Emitted(32, 60) Source(51, 56) + SourceIndex(0) +17>Emitted(32, 68) Source(51, 64) + SourceIndex(0) +18>Emitted(32, 70) Source(51, 66) + SourceIndex(0) +19>Emitted(32, 79) Source(51, 75) + SourceIndex(0) +20>Emitted(32, 81) Source(51, 77) + SourceIndex(0) +21>Emitted(32, 87) Source(51, 83) + SourceIndex(0) +22>Emitted(32, 89) Source(51, 85) + SourceIndex(0) +23>Emitted(32, 91) Source(51, 87) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _u < _v.length; _u++) { 1->^^^^ @@ -1171,41 +1129,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _0 = 0, robots_2 = robots; _0 < robots_2.length; _0++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^-> 1-> > > -2 >for -3 > -4 > ({ name = "noName" } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({ name = "noName" } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(37, 1) Source(56, 1) + SourceIndex(0) -2 >Emitted(37, 4) Source(56, 4) + SourceIndex(0) -3 >Emitted(37, 5) Source(56, 5) + SourceIndex(0) -4 >Emitted(37, 6) Source(56, 29) + SourceIndex(0) -5 >Emitted(37, 16) Source(56, 35) + SourceIndex(0) -6 >Emitted(37, 18) Source(56, 29) + SourceIndex(0) -7 >Emitted(37, 35) Source(56, 35) + SourceIndex(0) -8 >Emitted(37, 37) Source(56, 29) + SourceIndex(0) -9 >Emitted(37, 57) Source(56, 35) + SourceIndex(0) -10>Emitted(37, 59) Source(56, 29) + SourceIndex(0) -11>Emitted(37, 63) Source(56, 35) + SourceIndex(0) +2 >Emitted(37, 6) Source(56, 29) + SourceIndex(0) +3 >Emitted(37, 16) Source(56, 35) + SourceIndex(0) +4 >Emitted(37, 18) Source(56, 29) + SourceIndex(0) +5 >Emitted(37, 35) Source(56, 35) + SourceIndex(0) +6 >Emitted(37, 37) Source(56, 29) + SourceIndex(0) +7 >Emitted(37, 57) Source(56, 35) + SourceIndex(0) +8 >Emitted(37, 59) Source(56, 29) + SourceIndex(0) +9 >Emitted(37, 63) Source(56, 35) + SourceIndex(0) --- >>> _1 = robots_2[_0].name, name = _1 === void 0 ? "noName" : _1; 1->^^^^ @@ -1257,46 +1209,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _2 = 0, _3 = getRobots(); _2 < _3.length; _2++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^ -14> ^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^ +12> ^^^^^-> 1-> > -2 >for -3 > -4 > ({ name = "noName" } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({ name = "noName" } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(41, 1) Source(59, 1) + SourceIndex(0) -2 >Emitted(41, 4) Source(59, 4) + SourceIndex(0) -3 >Emitted(41, 5) Source(59, 5) + SourceIndex(0) -4 >Emitted(41, 6) Source(59, 29) + SourceIndex(0) -5 >Emitted(41, 16) Source(59, 40) + SourceIndex(0) -6 >Emitted(41, 18) Source(59, 29) + SourceIndex(0) -7 >Emitted(41, 23) Source(59, 29) + SourceIndex(0) -8 >Emitted(41, 32) Source(59, 38) + SourceIndex(0) -9 >Emitted(41, 34) Source(59, 40) + SourceIndex(0) -10>Emitted(41, 36) Source(59, 29) + SourceIndex(0) -11>Emitted(41, 50) Source(59, 40) + SourceIndex(0) -12>Emitted(41, 52) Source(59, 29) + SourceIndex(0) -13>Emitted(41, 56) Source(59, 40) + SourceIndex(0) +2 >Emitted(41, 6) Source(59, 29) + SourceIndex(0) +3 >Emitted(41, 16) Source(59, 40) + SourceIndex(0) +4 >Emitted(41, 18) Source(59, 29) + SourceIndex(0) +5 >Emitted(41, 23) Source(59, 29) + SourceIndex(0) +6 >Emitted(41, 32) Source(59, 38) + SourceIndex(0) +7 >Emitted(41, 34) Source(59, 40) + SourceIndex(0) +8 >Emitted(41, 36) Source(59, 29) + SourceIndex(0) +9 >Emitted(41, 50) Source(59, 40) + SourceIndex(0) +10>Emitted(41, 52) Source(59, 29) + SourceIndex(0) +11>Emitted(41, 56) Source(59, 40) + SourceIndex(0) --- >>> _4 = _3[_2].name, name = _4 === void 0 ? "noName" : _4; 1->^^^^ @@ -1348,99 +1294,93 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _5 = 0, _6 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _5 < _6.length; _5++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^ +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^ 1-> > -2 >for -3 > -4 > ({ name = "noName" } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({ name = "noName" } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(45, 1) Source(62, 1) + SourceIndex(0) -2 >Emitted(45, 4) Source(62, 4) + SourceIndex(0) -3 >Emitted(45, 5) Source(62, 5) + SourceIndex(0) -4 >Emitted(45, 6) Source(62, 29) + SourceIndex(0) -5 >Emitted(45, 16) Source(62, 105) + SourceIndex(0) -6 >Emitted(45, 18) Source(62, 29) + SourceIndex(0) -7 >Emitted(45, 24) Source(62, 30) + SourceIndex(0) -8 >Emitted(45, 26) Source(62, 32) + SourceIndex(0) -9 >Emitted(45, 30) Source(62, 36) + SourceIndex(0) -10>Emitted(45, 32) Source(62, 38) + SourceIndex(0) -11>Emitted(45, 39) Source(62, 45) + SourceIndex(0) -12>Emitted(45, 41) Source(62, 47) + SourceIndex(0) -13>Emitted(45, 46) Source(62, 52) + SourceIndex(0) -14>Emitted(45, 48) Source(62, 54) + SourceIndex(0) -15>Emitted(45, 56) Source(62, 62) + SourceIndex(0) -16>Emitted(45, 58) Source(62, 64) + SourceIndex(0) -17>Emitted(45, 60) Source(62, 66) + SourceIndex(0) -18>Emitted(45, 62) Source(62, 68) + SourceIndex(0) -19>Emitted(45, 66) Source(62, 72) + SourceIndex(0) -20>Emitted(45, 68) Source(62, 74) + SourceIndex(0) -21>Emitted(45, 77) Source(62, 83) + SourceIndex(0) -22>Emitted(45, 79) Source(62, 85) + SourceIndex(0) -23>Emitted(45, 84) Source(62, 90) + SourceIndex(0) -24>Emitted(45, 86) Source(62, 92) + SourceIndex(0) -25>Emitted(45, 96) Source(62, 102) + SourceIndex(0) -26>Emitted(45, 98) Source(62, 104) + SourceIndex(0) -27>Emitted(45, 99) Source(62, 105) + SourceIndex(0) -28>Emitted(45, 101) Source(62, 29) + SourceIndex(0) -29>Emitted(45, 115) Source(62, 105) + SourceIndex(0) -30>Emitted(45, 117) Source(62, 29) + SourceIndex(0) -31>Emitted(45, 121) Source(62, 105) + SourceIndex(0) +2 >Emitted(45, 6) Source(62, 29) + SourceIndex(0) +3 >Emitted(45, 16) Source(62, 105) + SourceIndex(0) +4 >Emitted(45, 18) Source(62, 29) + SourceIndex(0) +5 >Emitted(45, 24) Source(62, 30) + SourceIndex(0) +6 >Emitted(45, 26) Source(62, 32) + SourceIndex(0) +7 >Emitted(45, 30) Source(62, 36) + SourceIndex(0) +8 >Emitted(45, 32) Source(62, 38) + SourceIndex(0) +9 >Emitted(45, 39) Source(62, 45) + SourceIndex(0) +10>Emitted(45, 41) Source(62, 47) + SourceIndex(0) +11>Emitted(45, 46) Source(62, 52) + SourceIndex(0) +12>Emitted(45, 48) Source(62, 54) + SourceIndex(0) +13>Emitted(45, 56) Source(62, 62) + SourceIndex(0) +14>Emitted(45, 58) Source(62, 64) + SourceIndex(0) +15>Emitted(45, 60) Source(62, 66) + SourceIndex(0) +16>Emitted(45, 62) Source(62, 68) + SourceIndex(0) +17>Emitted(45, 66) Source(62, 72) + SourceIndex(0) +18>Emitted(45, 68) Source(62, 74) + SourceIndex(0) +19>Emitted(45, 77) Source(62, 83) + SourceIndex(0) +20>Emitted(45, 79) Source(62, 85) + SourceIndex(0) +21>Emitted(45, 84) Source(62, 90) + SourceIndex(0) +22>Emitted(45, 86) Source(62, 92) + SourceIndex(0) +23>Emitted(45, 96) Source(62, 102) + SourceIndex(0) +24>Emitted(45, 98) Source(62, 104) + SourceIndex(0) +25>Emitted(45, 99) Source(62, 105) + SourceIndex(0) +26>Emitted(45, 101) Source(62, 29) + SourceIndex(0) +27>Emitted(45, 115) Source(62, 105) + SourceIndex(0) +28>Emitted(45, 117) Source(62, 29) + SourceIndex(0) +29>Emitted(45, 121) Source(62, 105) + SourceIndex(0) --- >>> _7 = _6[_5].name, name = _7 === void 0 ? "noName" : _7; 1 >^^^^ @@ -1492,45 +1432,39 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _8 = 0, multiRobots_2 = multiRobots; _8 < multiRobots_2.length; _8++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > skills: { - > primary = "primary", - > secondary = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(49, 1) Source(65, 1) + SourceIndex(0) -2 >Emitted(49, 4) Source(65, 4) + SourceIndex(0) -3 >Emitted(49, 5) Source(65, 5) + SourceIndex(0) -4 >Emitted(49, 6) Source(70, 6) + SourceIndex(0) -5 >Emitted(49, 16) Source(70, 17) + SourceIndex(0) -6 >Emitted(49, 18) Source(70, 6) + SourceIndex(0) -7 >Emitted(49, 45) Source(70, 17) + SourceIndex(0) -8 >Emitted(49, 47) Source(70, 6) + SourceIndex(0) -9 >Emitted(49, 72) Source(70, 17) + SourceIndex(0) -10>Emitted(49, 74) Source(70, 6) + SourceIndex(0) -11>Emitted(49, 78) Source(70, 17) + SourceIndex(0) +2 >Emitted(49, 6) Source(70, 6) + SourceIndex(0) +3 >Emitted(49, 16) Source(70, 17) + SourceIndex(0) +4 >Emitted(49, 18) Source(70, 6) + SourceIndex(0) +5 >Emitted(49, 45) Source(70, 17) + SourceIndex(0) +6 >Emitted(49, 47) Source(70, 6) + SourceIndex(0) +7 >Emitted(49, 72) Source(70, 17) + SourceIndex(0) +8 >Emitted(49, 74) Source(70, 6) + SourceIndex(0) +9 >Emitted(49, 78) Source(70, 17) + SourceIndex(0) --- >>> _9 = multiRobots_2[_8].skills, _10 = _9 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _9, _11 = _10.primary, primary = _11 === void 0 ? "primary" : _11, _12 = _10.secondary, secondary = _12 === void 0 ? "secondary" : _12; 1->^^^^ @@ -1615,51 +1549,45 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _13 = 0, _14 = getMultiRobots(); _13 < _14.length; _13++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > skills: { - > primary = "primary", - > secondary = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(53, 1) Source(73, 1) + SourceIndex(0) -2 >Emitted(53, 4) Source(73, 4) + SourceIndex(0) -3 >Emitted(53, 5) Source(73, 5) + SourceIndex(0) -4 >Emitted(53, 6) Source(78, 6) + SourceIndex(0) -5 >Emitted(53, 17) Source(78, 22) + SourceIndex(0) -6 >Emitted(53, 19) Source(78, 6) + SourceIndex(0) -7 >Emitted(53, 25) Source(78, 6) + SourceIndex(0) -8 >Emitted(53, 39) Source(78, 20) + SourceIndex(0) -9 >Emitted(53, 41) Source(78, 22) + SourceIndex(0) -10>Emitted(53, 43) Source(78, 6) + SourceIndex(0) -11>Emitted(53, 59) Source(78, 22) + SourceIndex(0) -12>Emitted(53, 61) Source(78, 6) + SourceIndex(0) -13>Emitted(53, 66) Source(78, 22) + SourceIndex(0) +2 >Emitted(53, 6) Source(78, 6) + SourceIndex(0) +3 >Emitted(53, 17) Source(78, 22) + SourceIndex(0) +4 >Emitted(53, 19) Source(78, 6) + SourceIndex(0) +5 >Emitted(53, 25) Source(78, 6) + SourceIndex(0) +6 >Emitted(53, 39) Source(78, 20) + SourceIndex(0) +7 >Emitted(53, 41) Source(78, 22) + SourceIndex(0) +8 >Emitted(53, 43) Source(78, 6) + SourceIndex(0) +9 >Emitted(53, 59) Source(78, 22) + SourceIndex(0) +10>Emitted(53, 61) Source(78, 6) + SourceIndex(0) +11>Emitted(53, 66) Source(78, 22) + SourceIndex(0) --- >>> _15 = _14[_13].skills, _16 = _15 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _15, _17 = _16.primary, primary = _17 === void 0 ? "primary" : _17, _18 = _16.secondary, secondary = _18 === void 0 ? "secondary" : _18; 1->^^^^ @@ -1744,85 +1672,79 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _19 = 0, _20 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > skills: { - > primary = "primary", - > secondary = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({ + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(57, 1) Source(81, 1) + SourceIndex(0) -2 >Emitted(57, 4) Source(81, 4) + SourceIndex(0) -3 >Emitted(57, 5) Source(81, 5) + SourceIndex(0) -4 >Emitted(57, 6) Source(86, 6) + SourceIndex(0) -5 >Emitted(57, 17) Source(87, 79) + SourceIndex(0) -6 >Emitted(57, 19) Source(86, 6) + SourceIndex(0) -7 >Emitted(57, 26) Source(86, 7) + SourceIndex(0) -8 >Emitted(57, 28) Source(86, 9) + SourceIndex(0) -9 >Emitted(57, 32) Source(86, 13) + SourceIndex(0) -10>Emitted(57, 34) Source(86, 15) + SourceIndex(0) -11>Emitted(57, 41) Source(86, 22) + SourceIndex(0) -12>Emitted(57, 43) Source(86, 24) + SourceIndex(0) -13>Emitted(57, 49) Source(86, 30) + SourceIndex(0) -14>Emitted(57, 51) Source(86, 32) + SourceIndex(0) -15>Emitted(57, 53) Source(86, 34) + SourceIndex(0) -16>Emitted(57, 60) Source(86, 41) + SourceIndex(0) -17>Emitted(57, 62) Source(86, 43) + SourceIndex(0) -18>Emitted(57, 70) Source(86, 51) + SourceIndex(0) -19>Emitted(57, 72) Source(86, 53) + SourceIndex(0) -20>Emitted(57, 81) Source(86, 62) + SourceIndex(0) -21>Emitted(57, 83) Source(86, 64) + SourceIndex(0) -22>Emitted(57, 89) Source(86, 70) + SourceIndex(0) -23>Emitted(57, 91) Source(86, 72) + SourceIndex(0) -24>Emitted(57, 93) Source(86, 74) + SourceIndex(0) +2 >Emitted(57, 6) Source(86, 6) + SourceIndex(0) +3 >Emitted(57, 17) Source(87, 79) + SourceIndex(0) +4 >Emitted(57, 19) Source(86, 6) + SourceIndex(0) +5 >Emitted(57, 26) Source(86, 7) + SourceIndex(0) +6 >Emitted(57, 28) Source(86, 9) + SourceIndex(0) +7 >Emitted(57, 32) Source(86, 13) + SourceIndex(0) +8 >Emitted(57, 34) Source(86, 15) + SourceIndex(0) +9 >Emitted(57, 41) Source(86, 22) + SourceIndex(0) +10>Emitted(57, 43) Source(86, 24) + SourceIndex(0) +11>Emitted(57, 49) Source(86, 30) + SourceIndex(0) +12>Emitted(57, 51) Source(86, 32) + SourceIndex(0) +13>Emitted(57, 53) Source(86, 34) + SourceIndex(0) +14>Emitted(57, 60) Source(86, 41) + SourceIndex(0) +15>Emitted(57, 62) Source(86, 43) + SourceIndex(0) +16>Emitted(57, 70) Source(86, 51) + SourceIndex(0) +17>Emitted(57, 72) Source(86, 53) + SourceIndex(0) +18>Emitted(57, 81) Source(86, 62) + SourceIndex(0) +19>Emitted(57, 83) Source(86, 64) + SourceIndex(0) +20>Emitted(57, 89) Source(86, 70) + SourceIndex(0) +21>Emitted(57, 91) Source(86, 72) + SourceIndex(0) +22>Emitted(57, 93) Source(86, 74) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _19 < _20.length; _19++) { 1->^^^^ @@ -1983,42 +1905,36 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _25 = 0, robots_3 = robots; _25 < robots_3.length; _25++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > > -2 >for -3 > -4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(62, 1) Source(92, 1) + SourceIndex(0) -2 >Emitted(62, 4) Source(92, 4) + SourceIndex(0) -3 >Emitted(62, 5) Source(92, 5) + SourceIndex(0) -4 >Emitted(62, 6) Source(92, 62) + SourceIndex(0) -5 >Emitted(62, 17) Source(92, 68) + SourceIndex(0) -6 >Emitted(62, 19) Source(92, 62) + SourceIndex(0) -7 >Emitted(62, 36) Source(92, 68) + SourceIndex(0) -8 >Emitted(62, 38) Source(92, 62) + SourceIndex(0) -9 >Emitted(62, 59) Source(92, 68) + SourceIndex(0) -10>Emitted(62, 61) Source(92, 62) + SourceIndex(0) -11>Emitted(62, 66) Source(92, 68) + SourceIndex(0) +2 >Emitted(62, 6) Source(92, 62) + SourceIndex(0) +3 >Emitted(62, 17) Source(92, 68) + SourceIndex(0) +4 >Emitted(62, 19) Source(92, 62) + SourceIndex(0) +5 >Emitted(62, 36) Source(92, 68) + SourceIndex(0) +6 >Emitted(62, 38) Source(92, 62) + SourceIndex(0) +7 >Emitted(62, 59) Source(92, 68) + SourceIndex(0) +8 >Emitted(62, 61) Source(92, 62) + SourceIndex(0) +9 >Emitted(62, 66) Source(92, 68) + SourceIndex(0) --- >>> _26 = robots_3[_25], _27 = _26.name, nameA = _27 === void 0 ? "noName" : _27, _28 = _26.skill, skillA = _28 === void 0 ? "noSkill" : _28; 1->^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2082,46 +1998,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _29 = 0, _30 = getRobots(); _29 < _30.length; _29++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(66, 1) Source(95, 1) + SourceIndex(0) -2 >Emitted(66, 4) Source(95, 4) + SourceIndex(0) -3 >Emitted(66, 5) Source(95, 5) + SourceIndex(0) -4 >Emitted(66, 6) Source(95, 63) + SourceIndex(0) -5 >Emitted(66, 17) Source(95, 74) + SourceIndex(0) -6 >Emitted(66, 19) Source(95, 63) + SourceIndex(0) -7 >Emitted(66, 25) Source(95, 63) + SourceIndex(0) -8 >Emitted(66, 34) Source(95, 72) + SourceIndex(0) -9 >Emitted(66, 36) Source(95, 74) + SourceIndex(0) -10>Emitted(66, 38) Source(95, 63) + SourceIndex(0) -11>Emitted(66, 54) Source(95, 74) + SourceIndex(0) -12>Emitted(66, 56) Source(95, 63) + SourceIndex(0) -13>Emitted(66, 61) Source(95, 74) + SourceIndex(0) +2 >Emitted(66, 6) Source(95, 63) + SourceIndex(0) +3 >Emitted(66, 17) Source(95, 74) + SourceIndex(0) +4 >Emitted(66, 19) Source(95, 63) + SourceIndex(0) +5 >Emitted(66, 25) Source(95, 63) + SourceIndex(0) +6 >Emitted(66, 34) Source(95, 72) + SourceIndex(0) +7 >Emitted(66, 36) Source(95, 74) + SourceIndex(0) +8 >Emitted(66, 38) Source(95, 63) + SourceIndex(0) +9 >Emitted(66, 54) Source(95, 74) + SourceIndex(0) +10>Emitted(66, 56) Source(95, 63) + SourceIndex(0) +11>Emitted(66, 61) Source(95, 74) + SourceIndex(0) --- >>> _31 = _30[_29], _32 = _31.name, nameA = _32 === void 0 ? "noName" : _32, _33 = _31.skill, skillA = _33 === void 0 ? "noSkill" : _33; 1->^^^^^^^^^^^^^^^^^^^^ @@ -2185,100 +2095,94 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _34 = 0, _35 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _34 < _35.length; _34++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^^ -32> ^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^^ +30> ^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({name: nameA = "noName", skill: skillA = "noSkill" } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({name: nameA = "noName", skill: skillA = "noSkill" } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(70, 1) Source(98, 1) + SourceIndex(0) -2 >Emitted(70, 4) Source(98, 4) + SourceIndex(0) -3 >Emitted(70, 5) Source(98, 5) + SourceIndex(0) -4 >Emitted(70, 6) Source(98, 63) + SourceIndex(0) -5 >Emitted(70, 17) Source(98, 139) + SourceIndex(0) -6 >Emitted(70, 19) Source(98, 63) + SourceIndex(0) -7 >Emitted(70, 26) Source(98, 64) + SourceIndex(0) -8 >Emitted(70, 28) Source(98, 66) + SourceIndex(0) -9 >Emitted(70, 32) Source(98, 70) + SourceIndex(0) -10>Emitted(70, 34) Source(98, 72) + SourceIndex(0) -11>Emitted(70, 41) Source(98, 79) + SourceIndex(0) -12>Emitted(70, 43) Source(98, 81) + SourceIndex(0) -13>Emitted(70, 48) Source(98, 86) + SourceIndex(0) -14>Emitted(70, 50) Source(98, 88) + SourceIndex(0) -15>Emitted(70, 58) Source(98, 96) + SourceIndex(0) -16>Emitted(70, 60) Source(98, 98) + SourceIndex(0) -17>Emitted(70, 62) Source(98, 100) + SourceIndex(0) -18>Emitted(70, 64) Source(98, 102) + SourceIndex(0) -19>Emitted(70, 68) Source(98, 106) + SourceIndex(0) -20>Emitted(70, 70) Source(98, 108) + SourceIndex(0) -21>Emitted(70, 79) Source(98, 117) + SourceIndex(0) -22>Emitted(70, 81) Source(98, 119) + SourceIndex(0) -23>Emitted(70, 86) Source(98, 124) + SourceIndex(0) -24>Emitted(70, 88) Source(98, 126) + SourceIndex(0) -25>Emitted(70, 98) Source(98, 136) + SourceIndex(0) -26>Emitted(70, 100) Source(98, 138) + SourceIndex(0) -27>Emitted(70, 101) Source(98, 139) + SourceIndex(0) -28>Emitted(70, 103) Source(98, 63) + SourceIndex(0) -29>Emitted(70, 119) Source(98, 139) + SourceIndex(0) -30>Emitted(70, 121) Source(98, 63) + SourceIndex(0) -31>Emitted(70, 126) Source(98, 139) + SourceIndex(0) +2 >Emitted(70, 6) Source(98, 63) + SourceIndex(0) +3 >Emitted(70, 17) Source(98, 139) + SourceIndex(0) +4 >Emitted(70, 19) Source(98, 63) + SourceIndex(0) +5 >Emitted(70, 26) Source(98, 64) + SourceIndex(0) +6 >Emitted(70, 28) Source(98, 66) + SourceIndex(0) +7 >Emitted(70, 32) Source(98, 70) + SourceIndex(0) +8 >Emitted(70, 34) Source(98, 72) + SourceIndex(0) +9 >Emitted(70, 41) Source(98, 79) + SourceIndex(0) +10>Emitted(70, 43) Source(98, 81) + SourceIndex(0) +11>Emitted(70, 48) Source(98, 86) + SourceIndex(0) +12>Emitted(70, 50) Source(98, 88) + SourceIndex(0) +13>Emitted(70, 58) Source(98, 96) + SourceIndex(0) +14>Emitted(70, 60) Source(98, 98) + SourceIndex(0) +15>Emitted(70, 62) Source(98, 100) + SourceIndex(0) +16>Emitted(70, 64) Source(98, 102) + SourceIndex(0) +17>Emitted(70, 68) Source(98, 106) + SourceIndex(0) +18>Emitted(70, 70) Source(98, 108) + SourceIndex(0) +19>Emitted(70, 79) Source(98, 117) + SourceIndex(0) +20>Emitted(70, 81) Source(98, 119) + SourceIndex(0) +21>Emitted(70, 86) Source(98, 124) + SourceIndex(0) +22>Emitted(70, 88) Source(98, 126) + SourceIndex(0) +23>Emitted(70, 98) Source(98, 136) + SourceIndex(0) +24>Emitted(70, 100) Source(98, 138) + SourceIndex(0) +25>Emitted(70, 101) Source(98, 139) + SourceIndex(0) +26>Emitted(70, 103) Source(98, 63) + SourceIndex(0) +27>Emitted(70, 119) Source(98, 139) + SourceIndex(0) +28>Emitted(70, 121) Source(98, 63) + SourceIndex(0) +29>Emitted(70, 126) Source(98, 139) + SourceIndex(0) --- >>> _36 = _35[_34], _37 = _36.name, nameA = _37 === void 0 ? "noName" : _37, _38 = _36.skill, skillA = _38 === void 0 ? "noSkill" : _38; 1->^^^^^^^^^^^^^^^^^^^^ @@ -2342,46 +2246,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _39 = 0, multiRobots_3 = multiRobots; _39 < multiRobots_3.length; _39++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > name: nameA = "noName", - > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(74, 1) Source(101, 1) + SourceIndex(0) -2 >Emitted(74, 4) Source(101, 4) + SourceIndex(0) -3 >Emitted(74, 5) Source(101, 5) + SourceIndex(0) -4 >Emitted(74, 6) Source(107, 6) + SourceIndex(0) -5 >Emitted(74, 17) Source(107, 17) + SourceIndex(0) -6 >Emitted(74, 19) Source(107, 6) + SourceIndex(0) -7 >Emitted(74, 46) Source(107, 17) + SourceIndex(0) -8 >Emitted(74, 48) Source(107, 6) + SourceIndex(0) -9 >Emitted(74, 74) Source(107, 17) + SourceIndex(0) -10>Emitted(74, 76) Source(107, 6) + SourceIndex(0) -11>Emitted(74, 81) Source(107, 17) + SourceIndex(0) +2 >Emitted(74, 6) Source(107, 6) + SourceIndex(0) +3 >Emitted(74, 17) Source(107, 17) + SourceIndex(0) +4 >Emitted(74, 19) Source(107, 6) + SourceIndex(0) +5 >Emitted(74, 46) Source(107, 17) + SourceIndex(0) +6 >Emitted(74, 48) Source(107, 6) + SourceIndex(0) +7 >Emitted(74, 74) Source(107, 17) + SourceIndex(0) +8 >Emitted(74, 76) Source(107, 6) + SourceIndex(0) +9 >Emitted(74, 81) Source(107, 17) + SourceIndex(0) --- >>> _40 = multiRobots_3[_39], _41 = _40.name, nameA = _41 === void 0 ? "noName" : _41, _42 = _40.skills, _43 = _42 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _42, _44 = _43.primary, primaryA = _44 === void 0 ? "primary" : _44, _45 = _43.secondary, secondaryA = _45 === void 0 ? "secondary" : _45; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2479,52 +2377,46 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _46 = 0, _47 = getMultiRobots(); _46 < _47.length; _46++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > name: nameA = "noName", - > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(78, 1) Source(110, 1) + SourceIndex(0) -2 >Emitted(78, 4) Source(110, 4) + SourceIndex(0) -3 >Emitted(78, 5) Source(110, 5) + SourceIndex(0) -4 >Emitted(78, 6) Source(116, 6) + SourceIndex(0) -5 >Emitted(78, 17) Source(116, 22) + SourceIndex(0) -6 >Emitted(78, 19) Source(116, 6) + SourceIndex(0) -7 >Emitted(78, 25) Source(116, 6) + SourceIndex(0) -8 >Emitted(78, 39) Source(116, 20) + SourceIndex(0) -9 >Emitted(78, 41) Source(116, 22) + SourceIndex(0) -10>Emitted(78, 43) Source(116, 6) + SourceIndex(0) -11>Emitted(78, 59) Source(116, 22) + SourceIndex(0) -12>Emitted(78, 61) Source(116, 6) + SourceIndex(0) -13>Emitted(78, 66) Source(116, 22) + SourceIndex(0) +2 >Emitted(78, 6) Source(116, 6) + SourceIndex(0) +3 >Emitted(78, 17) Source(116, 22) + SourceIndex(0) +4 >Emitted(78, 19) Source(116, 6) + SourceIndex(0) +5 >Emitted(78, 25) Source(116, 6) + SourceIndex(0) +6 >Emitted(78, 39) Source(116, 20) + SourceIndex(0) +7 >Emitted(78, 41) Source(116, 22) + SourceIndex(0) +8 >Emitted(78, 43) Source(116, 6) + SourceIndex(0) +9 >Emitted(78, 59) Source(116, 22) + SourceIndex(0) +10>Emitted(78, 61) Source(116, 6) + SourceIndex(0) +11>Emitted(78, 66) Source(116, 22) + SourceIndex(0) --- >>> _48 = _47[_46], _49 = _48.name, nameA = _49 === void 0 ? "noName" : _49, _50 = _48.skills, _51 = _50 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _50, _52 = _51.primary, primaryA = _52 === void 0 ? "primary" : _52, _53 = _51.secondary, secondaryA = _53 === void 0 ? "secondary" : _53; 1->^^^^^^^^^^^^^^^^^^^^ @@ -2622,89 +2514,83 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _54 = 0, _55 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^ -9 > ^^ -10> ^^^^ -11> ^^ -12> ^^^^^^^ -13> ^^ -14> ^^^^^^ -15> ^^ -16> ^^ -17> ^^^^^^^ -18> ^^ -19> ^^^^^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^^ -24> ^^ -25> ^^ -26> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^ +7 > ^^ +8 > ^^^^ +9 > ^^ +10> ^^^^^^^ +11> ^^ +12> ^^^^^^ +13> ^^ +14> ^^ +15> ^^^^^^^ +16> ^^ +17> ^^^^^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^^ +22> ^^ +23> ^^ +24> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > name: nameA = "noName", - > skills: { - > primary: primaryA = "primary", - > secondary: secondaryA = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({ + > name: nameA = "noName", + > skills: { + > primary: primaryA = "primary", + > secondary: secondaryA = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > -8 > [ -9 > { -10> name -11> : -12> "mower" -13> , -14> skills -15> : -16> { -17> primary -18> : -19> "mowing" -20> , -21> secondary -22> : -23> "none" -24> } -25> } +4 > +5 > +6 > [ +7 > { +8 > name +9 > : +10> "mower" +11> , +12> skills +13> : +14> { +15> primary +16> : +17> "mowing" +18> , +19> secondary +20> : +21> "none" +22> } +23> } 1->Emitted(82, 1) Source(119, 1) + SourceIndex(0) -2 >Emitted(82, 4) Source(119, 4) + SourceIndex(0) -3 >Emitted(82, 5) Source(119, 5) + SourceIndex(0) -4 >Emitted(82, 6) Source(125, 6) + SourceIndex(0) -5 >Emitted(82, 17) Source(126, 79) + SourceIndex(0) -6 >Emitted(82, 19) Source(125, 6) + SourceIndex(0) -7 >Emitted(82, 25) Source(125, 20) + SourceIndex(0) -8 >Emitted(82, 26) Source(125, 21) + SourceIndex(0) -9 >Emitted(82, 28) Source(125, 23) + SourceIndex(0) -10>Emitted(82, 32) Source(125, 27) + SourceIndex(0) -11>Emitted(82, 34) Source(125, 29) + SourceIndex(0) -12>Emitted(82, 41) Source(125, 36) + SourceIndex(0) -13>Emitted(82, 43) Source(125, 38) + SourceIndex(0) -14>Emitted(82, 49) Source(125, 44) + SourceIndex(0) -15>Emitted(82, 51) Source(125, 46) + SourceIndex(0) -16>Emitted(82, 53) Source(125, 48) + SourceIndex(0) -17>Emitted(82, 60) Source(125, 55) + SourceIndex(0) -18>Emitted(82, 62) Source(125, 57) + SourceIndex(0) -19>Emitted(82, 70) Source(125, 65) + SourceIndex(0) -20>Emitted(82, 72) Source(125, 67) + SourceIndex(0) -21>Emitted(82, 81) Source(125, 76) + SourceIndex(0) -22>Emitted(82, 83) Source(125, 78) + SourceIndex(0) -23>Emitted(82, 89) Source(125, 84) + SourceIndex(0) -24>Emitted(82, 91) Source(125, 86) + SourceIndex(0) -25>Emitted(82, 93) Source(125, 88) + SourceIndex(0) +2 >Emitted(82, 6) Source(125, 6) + SourceIndex(0) +3 >Emitted(82, 17) Source(126, 79) + SourceIndex(0) +4 >Emitted(82, 19) Source(125, 6) + SourceIndex(0) +5 >Emitted(82, 25) Source(125, 20) + SourceIndex(0) +6 >Emitted(82, 26) Source(125, 21) + SourceIndex(0) +7 >Emitted(82, 28) Source(125, 23) + SourceIndex(0) +8 >Emitted(82, 32) Source(125, 27) + SourceIndex(0) +9 >Emitted(82, 34) Source(125, 29) + SourceIndex(0) +10>Emitted(82, 41) Source(125, 36) + SourceIndex(0) +11>Emitted(82, 43) Source(125, 38) + SourceIndex(0) +12>Emitted(82, 49) Source(125, 44) + SourceIndex(0) +13>Emitted(82, 51) Source(125, 46) + SourceIndex(0) +14>Emitted(82, 53) Source(125, 48) + SourceIndex(0) +15>Emitted(82, 60) Source(125, 55) + SourceIndex(0) +16>Emitted(82, 62) Source(125, 57) + SourceIndex(0) +17>Emitted(82, 70) Source(125, 65) + SourceIndex(0) +18>Emitted(82, 72) Source(125, 67) + SourceIndex(0) +19>Emitted(82, 81) Source(125, 76) + SourceIndex(0) +20>Emitted(82, 83) Source(125, 78) + SourceIndex(0) +21>Emitted(82, 89) Source(125, 84) + SourceIndex(0) +22>Emitted(82, 91) Source(125, 86) + SourceIndex(0) +23>Emitted(82, 93) Source(125, 88) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _54 < _55.length; _54++) { 1->^^^^ @@ -2878,41 +2764,35 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _62 = 0, robots_4 = robots; _62 < robots_4.length; _62++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > > -2 >for -3 > -4 > ({ name = "noName", skill = "noSkill" } of -5 > robots -6 > -7 > robots -8 > -9 > robots -10> -11> robots +2 >for ({ name = "noName", skill = "noSkill" } of +3 > robots +4 > +5 > robots +6 > +7 > robots +8 > +9 > robots 1->Emitted(87, 1) Source(130, 1) + SourceIndex(0) -2 >Emitted(87, 4) Source(130, 4) + SourceIndex(0) -3 >Emitted(87, 5) Source(130, 5) + SourceIndex(0) -4 >Emitted(87, 6) Source(130, 49) + SourceIndex(0) -5 >Emitted(87, 17) Source(130, 55) + SourceIndex(0) -6 >Emitted(87, 19) Source(130, 49) + SourceIndex(0) -7 >Emitted(87, 36) Source(130, 55) + SourceIndex(0) -8 >Emitted(87, 38) Source(130, 49) + SourceIndex(0) -9 >Emitted(87, 59) Source(130, 55) + SourceIndex(0) -10>Emitted(87, 61) Source(130, 49) + SourceIndex(0) -11>Emitted(87, 66) Source(130, 55) + SourceIndex(0) +2 >Emitted(87, 6) Source(130, 49) + SourceIndex(0) +3 >Emitted(87, 17) Source(130, 55) + SourceIndex(0) +4 >Emitted(87, 19) Source(130, 49) + SourceIndex(0) +5 >Emitted(87, 36) Source(130, 55) + SourceIndex(0) +6 >Emitted(87, 38) Source(130, 49) + SourceIndex(0) +7 >Emitted(87, 59) Source(130, 55) + SourceIndex(0) +8 >Emitted(87, 61) Source(130, 49) + SourceIndex(0) +9 >Emitted(87, 66) Source(130, 55) + SourceIndex(0) --- >>> _63 = robots_4[_62], _64 = _63.name, name = _64 === void 0 ? "noName" : _64, _65 = _63.skill, skill = _65 === void 0 ? "noSkill" : _65; 1->^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -2976,46 +2856,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _66 = 0, _67 = getRobots(); _66 < _67.length; _66++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ name = "noName", skill = "noSkill" } of -5 > getRobots() -6 > -7 > -8 > getRobots -9 > () -10> -11> getRobots() -12> -13> getRobots() +2 >for ({ name = "noName", skill = "noSkill" } of +3 > getRobots() +4 > +5 > +6 > getRobots +7 > () +8 > +9 > getRobots() +10> +11> getRobots() 1->Emitted(91, 1) Source(133, 1) + SourceIndex(0) -2 >Emitted(91, 4) Source(133, 4) + SourceIndex(0) -3 >Emitted(91, 5) Source(133, 5) + SourceIndex(0) -4 >Emitted(91, 6) Source(133, 49) + SourceIndex(0) -5 >Emitted(91, 17) Source(133, 60) + SourceIndex(0) -6 >Emitted(91, 19) Source(133, 49) + SourceIndex(0) -7 >Emitted(91, 25) Source(133, 49) + SourceIndex(0) -8 >Emitted(91, 34) Source(133, 58) + SourceIndex(0) -9 >Emitted(91, 36) Source(133, 60) + SourceIndex(0) -10>Emitted(91, 38) Source(133, 49) + SourceIndex(0) -11>Emitted(91, 54) Source(133, 60) + SourceIndex(0) -12>Emitted(91, 56) Source(133, 49) + SourceIndex(0) -13>Emitted(91, 61) Source(133, 60) + SourceIndex(0) +2 >Emitted(91, 6) Source(133, 49) + SourceIndex(0) +3 >Emitted(91, 17) Source(133, 60) + SourceIndex(0) +4 >Emitted(91, 19) Source(133, 49) + SourceIndex(0) +5 >Emitted(91, 25) Source(133, 49) + SourceIndex(0) +6 >Emitted(91, 34) Source(133, 58) + SourceIndex(0) +7 >Emitted(91, 36) Source(133, 60) + SourceIndex(0) +8 >Emitted(91, 38) Source(133, 49) + SourceIndex(0) +9 >Emitted(91, 54) Source(133, 60) + SourceIndex(0) +10>Emitted(91, 56) Source(133, 49) + SourceIndex(0) +11>Emitted(91, 61) Source(133, 60) + SourceIndex(0) --- >>> _68 = _67[_66], _69 = _68.name, name = _69 === void 0 ? "noName" : _69, _70 = _68.skill, skill = _70 === void 0 ? "noSkill" : _70; 1->^^^^^^^^^^^^^^^^^^^^ @@ -3079,100 +2953,94 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _71 = 0, _72 = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; _71 < _72.length; _71++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^ -15> ^^^^^^^^ -16> ^^ -17> ^^ -18> ^^ -19> ^^^^ -20> ^^ -21> ^^^^^^^^^ -22> ^^ -23> ^^^^^ -24> ^^ -25> ^^^^^^^^^^ -26> ^^ -27> ^ -28> ^^ -29> ^^^^^^^^^^^^^^^^ -30> ^^ -31> ^^^^^ -32> ^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^ +13> ^^^^^^^^ +14> ^^ +15> ^^ +16> ^^ +17> ^^^^ +18> ^^ +19> ^^^^^^^^^ +20> ^^ +21> ^^^^^ +22> ^^ +23> ^^^^^^^^^^ +24> ^^ +25> ^ +26> ^^ +27> ^^^^^^^^^^^^^^^^ +28> ^^ +29> ^^^^^ +30> ^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ name = "noName", skill = "noSkill" } of -5 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skill -14> : -15> "mowing" -16> } -17> , -18> { -19> name -20> : -21> "trimmer" -22> , -23> skill -24> : -25> "trimming" -26> } -27> ] -28> -29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] -30> -31> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +2 >for ({ name = "noName", skill = "noSkill" } of +3 > [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skill +12> : +13> "mowing" +14> } +15> , +16> { +17> name +18> : +19> "trimmer" +20> , +21> skill +22> : +23> "trimming" +24> } +25> ] +26> +27> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] +28> +29> [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] 1->Emitted(95, 1) Source(136, 1) + SourceIndex(0) -2 >Emitted(95, 4) Source(136, 4) + SourceIndex(0) -3 >Emitted(95, 5) Source(136, 5) + SourceIndex(0) -4 >Emitted(95, 6) Source(136, 49) + SourceIndex(0) -5 >Emitted(95, 17) Source(136, 125) + SourceIndex(0) -6 >Emitted(95, 19) Source(136, 49) + SourceIndex(0) -7 >Emitted(95, 26) Source(136, 50) + SourceIndex(0) -8 >Emitted(95, 28) Source(136, 52) + SourceIndex(0) -9 >Emitted(95, 32) Source(136, 56) + SourceIndex(0) -10>Emitted(95, 34) Source(136, 58) + SourceIndex(0) -11>Emitted(95, 41) Source(136, 65) + SourceIndex(0) -12>Emitted(95, 43) Source(136, 67) + SourceIndex(0) -13>Emitted(95, 48) Source(136, 72) + SourceIndex(0) -14>Emitted(95, 50) Source(136, 74) + SourceIndex(0) -15>Emitted(95, 58) Source(136, 82) + SourceIndex(0) -16>Emitted(95, 60) Source(136, 84) + SourceIndex(0) -17>Emitted(95, 62) Source(136, 86) + SourceIndex(0) -18>Emitted(95, 64) Source(136, 88) + SourceIndex(0) -19>Emitted(95, 68) Source(136, 92) + SourceIndex(0) -20>Emitted(95, 70) Source(136, 94) + SourceIndex(0) -21>Emitted(95, 79) Source(136, 103) + SourceIndex(0) -22>Emitted(95, 81) Source(136, 105) + SourceIndex(0) -23>Emitted(95, 86) Source(136, 110) + SourceIndex(0) -24>Emitted(95, 88) Source(136, 112) + SourceIndex(0) -25>Emitted(95, 98) Source(136, 122) + SourceIndex(0) -26>Emitted(95, 100) Source(136, 124) + SourceIndex(0) -27>Emitted(95, 101) Source(136, 125) + SourceIndex(0) -28>Emitted(95, 103) Source(136, 49) + SourceIndex(0) -29>Emitted(95, 119) Source(136, 125) + SourceIndex(0) -30>Emitted(95, 121) Source(136, 49) + SourceIndex(0) -31>Emitted(95, 126) Source(136, 125) + SourceIndex(0) +2 >Emitted(95, 6) Source(136, 49) + SourceIndex(0) +3 >Emitted(95, 17) Source(136, 125) + SourceIndex(0) +4 >Emitted(95, 19) Source(136, 49) + SourceIndex(0) +5 >Emitted(95, 26) Source(136, 50) + SourceIndex(0) +6 >Emitted(95, 28) Source(136, 52) + SourceIndex(0) +7 >Emitted(95, 32) Source(136, 56) + SourceIndex(0) +8 >Emitted(95, 34) Source(136, 58) + SourceIndex(0) +9 >Emitted(95, 41) Source(136, 65) + SourceIndex(0) +10>Emitted(95, 43) Source(136, 67) + SourceIndex(0) +11>Emitted(95, 48) Source(136, 72) + SourceIndex(0) +12>Emitted(95, 50) Source(136, 74) + SourceIndex(0) +13>Emitted(95, 58) Source(136, 82) + SourceIndex(0) +14>Emitted(95, 60) Source(136, 84) + SourceIndex(0) +15>Emitted(95, 62) Source(136, 86) + SourceIndex(0) +16>Emitted(95, 64) Source(136, 88) + SourceIndex(0) +17>Emitted(95, 68) Source(136, 92) + SourceIndex(0) +18>Emitted(95, 70) Source(136, 94) + SourceIndex(0) +19>Emitted(95, 79) Source(136, 103) + SourceIndex(0) +20>Emitted(95, 81) Source(136, 105) + SourceIndex(0) +21>Emitted(95, 86) Source(136, 110) + SourceIndex(0) +22>Emitted(95, 88) Source(136, 112) + SourceIndex(0) +23>Emitted(95, 98) Source(136, 122) + SourceIndex(0) +24>Emitted(95, 100) Source(136, 124) + SourceIndex(0) +25>Emitted(95, 101) Source(136, 125) + SourceIndex(0) +26>Emitted(95, 103) Source(136, 49) + SourceIndex(0) +27>Emitted(95, 119) Source(136, 125) + SourceIndex(0) +28>Emitted(95, 121) Source(136, 49) + SourceIndex(0) +29>Emitted(95, 126) Source(136, 125) + SourceIndex(0) --- >>> _73 = _72[_71], _74 = _73.name, name = _74 === void 0 ? "noName" : _74, _75 = _73.skill, skill = _75 === void 0 ? "noSkill" : _75; 1->^^^^^^^^^^^^^^^^^^^^ @@ -3236,46 +3104,40 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _76 = 0, multiRobots_4 = multiRobots; _76 < multiRobots_4.length; _76++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -8 > ^^ -9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ -10> ^^ -11> ^^^^^ -12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^^ +9 > ^^^^^ +10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > name = "noName", - > skills: { - > primary = "primary", - > secondary = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > multiRobots -6 > -7 > multiRobots -8 > -9 > multiRobots -10> -11> multiRobots +2 >for ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > multiRobots +4 > +5 > multiRobots +6 > +7 > multiRobots +8 > +9 > multiRobots 1->Emitted(99, 1) Source(139, 1) + SourceIndex(0) -2 >Emitted(99, 4) Source(139, 4) + SourceIndex(0) -3 >Emitted(99, 5) Source(139, 5) + SourceIndex(0) -4 >Emitted(99, 6) Source(145, 6) + SourceIndex(0) -5 >Emitted(99, 17) Source(145, 17) + SourceIndex(0) -6 >Emitted(99, 19) Source(145, 6) + SourceIndex(0) -7 >Emitted(99, 46) Source(145, 17) + SourceIndex(0) -8 >Emitted(99, 48) Source(145, 6) + SourceIndex(0) -9 >Emitted(99, 74) Source(145, 17) + SourceIndex(0) -10>Emitted(99, 76) Source(145, 6) + SourceIndex(0) -11>Emitted(99, 81) Source(145, 17) + SourceIndex(0) +2 >Emitted(99, 6) Source(145, 6) + SourceIndex(0) +3 >Emitted(99, 17) Source(145, 17) + SourceIndex(0) +4 >Emitted(99, 19) Source(145, 6) + SourceIndex(0) +5 >Emitted(99, 46) Source(145, 17) + SourceIndex(0) +6 >Emitted(99, 48) Source(145, 6) + SourceIndex(0) +7 >Emitted(99, 74) Source(145, 17) + SourceIndex(0) +8 >Emitted(99, 76) Source(145, 6) + SourceIndex(0) +9 >Emitted(99, 81) Source(145, 17) + SourceIndex(0) --- >>> _77 = multiRobots_4[_76], _78 = _77.name, name = _78 === void 0 ? "noName" : _78, _79 = _77.skills, _80 = _79 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _79, _81 = _80.primary, primary = _81 === void 0 ? "primary" : _81, _82 = _80.secondary, secondary = _82 === void 0 ? "secondary" : _82; 1->^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -3373,52 +3235,46 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _83 = 0, _84 = getMultiRobots(); _83 < _84.length; _83++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^ -8 > ^^^^^^^^^^^^^^ -9 > ^^ -10> ^^ -11> ^^^^^^^^^^^^^^^^ -12> ^^ -13> ^^^^^ -14> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^ +6 > ^^^^^^^^^^^^^^ +7 > ^^ +8 > ^^ +9 > ^^^^^^^^^^^^^^^^ +10> ^^ +11> ^^^^^ +12> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > name = "noName", - > skills: { - > primary = "primary", - > secondary = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > getMultiRobots() -6 > -7 > -8 > getMultiRobots -9 > () -10> -11> getMultiRobots() -12> -13> getMultiRobots() +2 >for ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > getMultiRobots() +4 > +5 > +6 > getMultiRobots +7 > () +8 > +9 > getMultiRobots() +10> +11> getMultiRobots() 1->Emitted(103, 1) Source(148, 1) + SourceIndex(0) -2 >Emitted(103, 4) Source(148, 4) + SourceIndex(0) -3 >Emitted(103, 5) Source(148, 5) + SourceIndex(0) -4 >Emitted(103, 6) Source(154, 6) + SourceIndex(0) -5 >Emitted(103, 17) Source(154, 22) + SourceIndex(0) -6 >Emitted(103, 19) Source(154, 6) + SourceIndex(0) -7 >Emitted(103, 25) Source(154, 6) + SourceIndex(0) -8 >Emitted(103, 39) Source(154, 20) + SourceIndex(0) -9 >Emitted(103, 41) Source(154, 22) + SourceIndex(0) -10>Emitted(103, 43) Source(154, 6) + SourceIndex(0) -11>Emitted(103, 59) Source(154, 22) + SourceIndex(0) -12>Emitted(103, 61) Source(154, 6) + SourceIndex(0) -13>Emitted(103, 66) Source(154, 22) + SourceIndex(0) +2 >Emitted(103, 6) Source(154, 6) + SourceIndex(0) +3 >Emitted(103, 17) Source(154, 22) + SourceIndex(0) +4 >Emitted(103, 19) Source(154, 6) + SourceIndex(0) +5 >Emitted(103, 25) Source(154, 6) + SourceIndex(0) +6 >Emitted(103, 39) Source(154, 20) + SourceIndex(0) +7 >Emitted(103, 41) Source(154, 22) + SourceIndex(0) +8 >Emitted(103, 43) Source(154, 6) + SourceIndex(0) +9 >Emitted(103, 59) Source(154, 22) + SourceIndex(0) +10>Emitted(103, 61) Source(154, 6) + SourceIndex(0) +11>Emitted(103, 66) Source(154, 22) + SourceIndex(0) --- >>> _85 = _84[_83], _86 = _85.name, name = _86 === void 0 ? "noName" : _86, _87 = _85.skills, _88 = _87 === void 0 ? { primary: "noSkill", secondary: "noSkill" } : _87, _89 = _88.primary, primary = _89 === void 0 ? "primary" : _89, _90 = _88.secondary, secondary = _90 === void 0 ? "secondary" : _90; 1->^^^^^^^^^^^^^^^^^^^^ @@ -3516,86 +3372,80 @@ sourceFile:sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValue --- >>>for (var _91 = 0, _92 = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^ -6 > ^^ -7 > ^^^^^^^ -8 > ^^ -9 > ^^^^ -10> ^^ -11> ^^^^^^^ -12> ^^ -13> ^^^^^^ -14> ^^ -15> ^^ -16> ^^^^^^^ -17> ^^ -18> ^^^^^^^^ -19> ^^ -20> ^^^^^^^^^ -21> ^^ -22> ^^^^^^ -23> ^^ -24> ^^ -25> ^^^^^^^^^^^^^^^-> +2 >^^^^^ +3 > ^^^^^^^^^^^ +4 > ^^ +5 > ^^^^^^^ +6 > ^^ +7 > ^^^^ +8 > ^^ +9 > ^^^^^^^ +10> ^^ +11> ^^^^^^ +12> ^^ +13> ^^ +14> ^^^^^^^ +15> ^^ +16> ^^^^^^^^ +17> ^^ +18> ^^^^^^^^^ +19> ^^ +20> ^^^^^^ +21> ^^ +22> ^^ +23> ^^^^^^^^^^^^^^^-> 1-> > -2 >for -3 > -4 > ({ - > name = "noName", - > skills: { - > primary = "primary", - > secondary = "secondary" - > } = { primary: "noSkill", secondary: "noSkill" } - > } of -5 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, +2 >for ({ + > name = "noName", + > skills: { + > primary = "primary", + > secondary = "secondary" + > } = { primary: "noSkill", secondary: "noSkill" } + >} of +3 > [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, > { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] -6 > -7 > [ -8 > { -9 > name -10> : -11> "mower" -12> , -13> skills -14> : -15> { -16> primary -17> : -18> "mowing" -19> , -20> secondary -21> : -22> "none" -23> } -24> } +4 > +5 > [ +6 > { +7 > name +8 > : +9 > "mower" +10> , +11> skills +12> : +13> { +14> primary +15> : +16> "mowing" +17> , +18> secondary +19> : +20> "none" +21> } +22> } 1->Emitted(107, 1) Source(157, 1) + SourceIndex(0) -2 >Emitted(107, 4) Source(157, 4) + SourceIndex(0) -3 >Emitted(107, 5) Source(157, 5) + SourceIndex(0) -4 >Emitted(107, 6) Source(163, 6) + SourceIndex(0) -5 >Emitted(107, 17) Source(164, 79) + SourceIndex(0) -6 >Emitted(107, 19) Source(163, 6) + SourceIndex(0) -7 >Emitted(107, 26) Source(163, 7) + SourceIndex(0) -8 >Emitted(107, 28) Source(163, 9) + SourceIndex(0) -9 >Emitted(107, 32) Source(163, 13) + SourceIndex(0) -10>Emitted(107, 34) Source(163, 15) + SourceIndex(0) -11>Emitted(107, 41) Source(163, 22) + SourceIndex(0) -12>Emitted(107, 43) Source(163, 24) + SourceIndex(0) -13>Emitted(107, 49) Source(163, 30) + SourceIndex(0) -14>Emitted(107, 51) Source(163, 32) + SourceIndex(0) -15>Emitted(107, 53) Source(163, 34) + SourceIndex(0) -16>Emitted(107, 60) Source(163, 41) + SourceIndex(0) -17>Emitted(107, 62) Source(163, 43) + SourceIndex(0) -18>Emitted(107, 70) Source(163, 51) + SourceIndex(0) -19>Emitted(107, 72) Source(163, 53) + SourceIndex(0) -20>Emitted(107, 81) Source(163, 62) + SourceIndex(0) -21>Emitted(107, 83) Source(163, 64) + SourceIndex(0) -22>Emitted(107, 89) Source(163, 70) + SourceIndex(0) -23>Emitted(107, 91) Source(163, 72) + SourceIndex(0) -24>Emitted(107, 93) Source(163, 74) + SourceIndex(0) +2 >Emitted(107, 6) Source(163, 6) + SourceIndex(0) +3 >Emitted(107, 17) Source(164, 79) + SourceIndex(0) +4 >Emitted(107, 19) Source(163, 6) + SourceIndex(0) +5 >Emitted(107, 26) Source(163, 7) + SourceIndex(0) +6 >Emitted(107, 28) Source(163, 9) + SourceIndex(0) +7 >Emitted(107, 32) Source(163, 13) + SourceIndex(0) +8 >Emitted(107, 34) Source(163, 15) + SourceIndex(0) +9 >Emitted(107, 41) Source(163, 22) + SourceIndex(0) +10>Emitted(107, 43) Source(163, 24) + SourceIndex(0) +11>Emitted(107, 49) Source(163, 30) + SourceIndex(0) +12>Emitted(107, 51) Source(163, 32) + SourceIndex(0) +13>Emitted(107, 53) Source(163, 34) + SourceIndex(0) +14>Emitted(107, 60) Source(163, 41) + SourceIndex(0) +15>Emitted(107, 62) Source(163, 43) + SourceIndex(0) +16>Emitted(107, 70) Source(163, 51) + SourceIndex(0) +17>Emitted(107, 72) Source(163, 53) + SourceIndex(0) +18>Emitted(107, 81) Source(163, 62) + SourceIndex(0) +19>Emitted(107, 83) Source(163, 64) + SourceIndex(0) +20>Emitted(107, 89) Source(163, 70) + SourceIndex(0) +21>Emitted(107, 91) Source(163, 72) + SourceIndex(0) +22>Emitted(107, 93) Source(163, 74) + SourceIndex(0) --- >>> { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; _91 < _92.length; _91++) { 1->^^^^ diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map index d23d39085be..0dff86fd1d4 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatement.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatement.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,IAAA,mBAAW,CAAY;AACvB,IAAA,mBAAW,EAAE,qBAAa,CAAY;AACxC,IAAA,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAC/E,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatement.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,IAAA,mBAAW,CAAY;AACvB,IAAA,mBAAW,EAAE,qBAAa,CAAY;AACxC,IAAA,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAC/E,IAAI,KAAK,IAAI,KAAK,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;KACI;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt index c017267f22a..c00af2dfdbc 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.sourcemap.txt @@ -194,37 +194,25 @@ sourceFile:sourceMapValidationDestructuringVariableStatement.ts --- >>>if (nameA == nameB) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^-> 1 > > -2 >if -3 > -4 > ( -5 > nameA -6 > == -7 > nameB -8 > ) -9 > -10> { +2 >if ( +3 > nameA +4 > == +5 > nameB +6 > ) 1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) -2 >Emitted(7, 3) Source(14, 3) + SourceIndex(0) -3 >Emitted(7, 4) Source(14, 4) + SourceIndex(0) -4 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) -5 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) -6 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) -7 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) -8 >Emitted(7, 20) Source(14, 20) + SourceIndex(0) -9 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) -10>Emitted(7, 22) Source(14, 22) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) +4 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) +5 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) +6 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) --- >>> console.log(skillB); 1->^^^^ @@ -235,7 +223,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatement.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -254,30 +242,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatement.ts 8 >Emitted(8, 25) Source(15, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^-> +1 >^ +2 > ^^^^^^-> 1 > - > -2 >} -1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) + >} +1 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) --- >>>else { -1-> -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^-> +1->^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1-> - > -2 >else -3 > -4 > { -1->Emitted(10, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(10, 5) Source(17, 5) + SourceIndex(0) -3 >Emitted(10, 6) Source(17, 6) + SourceIndex(0) -4 >Emitted(10, 7) Source(17, 7) + SourceIndex(0) + >else +1->Emitted(10, 6) Source(17, 6) + SourceIndex(0) --- >>> console.log(nameC); 1->^^^^ @@ -288,7 +264,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatement.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -307,13 +283,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatement.ts 8 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) + >} +1 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map index ad8a81464b4..5b9c754af1b 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatement1.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatement1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement1.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACvD,IAAA,CAAS,EAAI,mBAAW,CAAY;AACpC,IAAA,CAAS,EAAI,mBAAW,EAAE,qBAAa,CAAY;AACnD,IAAA,CAAS,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAEpF,IAAA,mBAAW,EAAa,CAAC,GAAG,KAAK,CAAC;AAClC,IAAA,mBAAW,EAAE,qBAAa,EAAa,CAAC,GAAG,QAAQ,CAAC;AACtD,IAAA,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,CAAC,GAAG,KAAK,CAAC;AAE1F,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAa,EAAE,GAAE,OAAO,CAAC;AACrD,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAE,qBAAa,EAAa,EAAE,GAAG,OAAO,CAAC;AACrE,IAAI,CAAC,GAAG,KAAK,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,EAAE,GAAG,KAAK,CAAC;AACtG,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatement1.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatement1.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACvD,IAAA,CAAS,EAAI,mBAAW,CAAY;AACpC,IAAA,CAAS,EAAI,mBAAW,EAAE,qBAAa,CAAY;AACnD,IAAA,CAAS,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,CAA+C;AAEpF,IAAA,mBAAW,EAAa,CAAC,GAAG,KAAK,CAAC;AAClC,IAAA,mBAAW,EAAE,qBAAa,EAAa,CAAC,GAAG,QAAQ,CAAC;AACtD,IAAA,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,CAAC,GAAG,KAAK,CAAC;AAE1F,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAa,EAAE,GAAE,OAAO,CAAC;AACrD,IAAI,CAAC,GAAG,KAAK,EAAI,mBAAW,EAAE,qBAAa,EAAa,EAAE,GAAG,OAAO,CAAC;AACrE,IAAI,CAAC,GAAG,KAAK,EAAE,8CAA0E,EAAxE,eAAW,EAAE,iBAAa,EAAgD,EAAE,GAAG,KAAK,CAAC;AACtG,IAAI,KAAK,IAAI,KAAK,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;KACI;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt index 889170266b3..16a63b61c34 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.sourcemap.txt @@ -452,37 +452,25 @@ sourceFile:sourceMapValidationDestructuringVariableStatement1.ts --- >>>if (nameA == nameB) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^-> 1 > > -2 >if -3 > -4 > ( -5 > nameA -6 > == -7 > nameB -8 > ) -9 > -10> { +2 >if ( +3 > nameA +4 > == +5 > nameB +6 > ) 1 >Emitted(13, 1) Source(22, 1) + SourceIndex(0) -2 >Emitted(13, 3) Source(22, 3) + SourceIndex(0) -3 >Emitted(13, 4) Source(22, 4) + SourceIndex(0) -4 >Emitted(13, 5) Source(22, 5) + SourceIndex(0) -5 >Emitted(13, 10) Source(22, 10) + SourceIndex(0) -6 >Emitted(13, 14) Source(22, 14) + SourceIndex(0) -7 >Emitted(13, 19) Source(22, 19) + SourceIndex(0) -8 >Emitted(13, 20) Source(22, 20) + SourceIndex(0) -9 >Emitted(13, 21) Source(22, 21) + SourceIndex(0) -10>Emitted(13, 22) Source(22, 22) + SourceIndex(0) +2 >Emitted(13, 5) Source(22, 5) + SourceIndex(0) +3 >Emitted(13, 10) Source(22, 10) + SourceIndex(0) +4 >Emitted(13, 14) Source(22, 14) + SourceIndex(0) +5 >Emitted(13, 19) Source(22, 19) + SourceIndex(0) +6 >Emitted(13, 21) Source(22, 21) + SourceIndex(0) --- >>> console.log(skillB); 1->^^^^ @@ -493,7 +481,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatement1.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -512,30 +500,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatement1.ts 8 >Emitted(14, 25) Source(23, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^-> +1 >^ +2 > ^^^^^^-> 1 > - > -2 >} -1 >Emitted(15, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(24, 2) + SourceIndex(0) + >} +1 >Emitted(15, 2) Source(24, 2) + SourceIndex(0) --- >>>else { -1-> -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^-> +1->^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1-> - > -2 >else -3 > -4 > { -1->Emitted(16, 1) Source(25, 1) + SourceIndex(0) -2 >Emitted(16, 5) Source(25, 5) + SourceIndex(0) -3 >Emitted(16, 6) Source(25, 6) + SourceIndex(0) -4 >Emitted(16, 7) Source(25, 7) + SourceIndex(0) + >else +1->Emitted(16, 6) Source(25, 6) + SourceIndex(0) --- >>> console.log(nameC); 1->^^^^ @@ -546,7 +522,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatement1.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -565,13 +541,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatement1.ts 8 >Emitted(17, 24) Source(26, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(18, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(18, 2) Source(27, 2) + SourceIndex(0) + >} +1 >Emitted(18, 2) Source(27, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatement1.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map index 85d004a7ec6..919575fe393 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAGxC,IAAA,iBAAK,CAAW;AAClB,IAAA,mBAAO,CAAW;AAClB,IAAA,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,CAAW;AAEpC,IAAA,6CAAQ,CAAoC;AAC7C,IAAA,oCAA0D,EAAzD,eAAO,EAAE,aAAK,EAAE,cAAM,CAAoC;AAE1D,IAAA,oBAAQ,EAAE,4BAAa,CAAW;AAEvC,EAAE,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAGxC,IAAA,iBAAK,CAAW;AAClB,IAAA,mBAAO,CAAW;AAClB,IAAA,oBAAQ,EAAE,kBAAM,EAAE,mBAAO,CAAW;AAEpC,IAAA,6CAAQ,CAAoC;AAC7C,IAAA,oCAA0D,EAAzD,eAAO,EAAE,aAAK,EAAE,cAAM,CAAoC;AAE1D,IAAA,oBAAQ,EAAE,4BAAa,CAAW;AAEvC,IAAI,KAAK,IAAI,MAAM,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt index fbb082b4ecc..da763a77037 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.sourcemap.txt @@ -225,38 +225,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern. --- >>>if (nameA == nameA2) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameA -6 > == -7 > nameA2 -8 > ) -9 > -10> { +2 >if ( +3 > nameA +4 > == +5 > nameA2 +6 > ) 1 >Emitted(9, 1) Source(18, 1) + SourceIndex(0) -2 >Emitted(9, 3) Source(18, 3) + SourceIndex(0) -3 >Emitted(9, 4) Source(18, 4) + SourceIndex(0) -4 >Emitted(9, 5) Source(18, 5) + SourceIndex(0) -5 >Emitted(9, 10) Source(18, 10) + SourceIndex(0) -6 >Emitted(9, 14) Source(18, 14) + SourceIndex(0) -7 >Emitted(9, 20) Source(18, 20) + SourceIndex(0) -8 >Emitted(9, 21) Source(18, 21) + SourceIndex(0) -9 >Emitted(9, 22) Source(18, 22) + SourceIndex(0) -10>Emitted(9, 23) Source(18, 23) + SourceIndex(0) +2 >Emitted(9, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(9, 10) Source(18, 10) + SourceIndex(0) +4 >Emitted(9, 14) Source(18, 14) + SourceIndex(0) +5 >Emitted(9, 20) Source(18, 20) + SourceIndex(0) +6 >Emitted(9, 22) Source(18, 22) + SourceIndex(0) --- >>> console.log(skillA2); 1->^^^^ @@ -267,7 +255,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern. 6 > ^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -286,13 +274,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern. 8 >Emitted(10, 26) Source(19, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(11, 1) Source(20, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(20, 2) + SourceIndex(0) + >} +1 >Emitted(11, 2) Source(20, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map index 30ce8c0ea8a..f33092aef99 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,IAAA,uBAAM,CAAgB;AACxB,IAAA,uBAAM,CAAgB;AACtB,IAAA,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AAExD,IAAA,6CAAM,CAAsC;AAC7C,IAAA,sCAA+E,EAA9E,eAAO,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAuC;AAE/E,IAAA,sCAAkB,CAAgB;AAEvC,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,IAAA,uBAAM,CAAgB;AACxB,IAAA,uBAAM,CAAgB;AACtB,IAAA,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AAExD,IAAA,6CAAM,CAAsC;AAC7C,IAAA,sCAA+E,EAA9E,eAAO,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAuC;AAE/E,IAAA,sCAAkB,CAAgB;AAEvC,IAAI,MAAM,IAAI,MAAM,EAAE;IAClB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt index fb2170d1b46..d445ea559c9 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.sourcemap.txt @@ -242,38 +242,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern2 --- >>>if (nameMB == nameMA) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^^ -6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^^^^^^^^^^^^^^-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameMB -6 > == -7 > nameMA -8 > ) -9 > -10> { +2 >if ( +3 > nameMB +4 > == +5 > nameMA +6 > ) 1 >Emitted(9, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(9, 3) Source(17, 3) + SourceIndex(0) -3 >Emitted(9, 4) Source(17, 4) + SourceIndex(0) -4 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) -5 >Emitted(9, 11) Source(17, 11) + SourceIndex(0) -6 >Emitted(9, 15) Source(17, 15) + SourceIndex(0) -7 >Emitted(9, 21) Source(17, 21) + SourceIndex(0) -8 >Emitted(9, 22) Source(17, 22) + SourceIndex(0) -9 >Emitted(9, 23) Source(17, 23) + SourceIndex(0) -10>Emitted(9, 24) Source(17, 24) + SourceIndex(0) +2 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(9, 11) Source(17, 11) + SourceIndex(0) +4 >Emitted(9, 15) Source(17, 15) + SourceIndex(0) +5 >Emitted(9, 21) Source(17, 21) + SourceIndex(0) +6 >Emitted(9, 23) Source(17, 23) + SourceIndex(0) --- >>> console.log(skillA[0] + skillA[1]); 1->^^^^ @@ -292,7 +280,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern2 14> ^ 15> ^ 16> ^ -1-> +1->{ > 2 > console 3 > . @@ -327,13 +315,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern2 16>Emitted(10, 40) Source(18, 40) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) + >} +1 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map index 1b6c788952d..fb277d42811 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAA6B,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClG,IAAI,eAA8C,CAAC;AAEhD,iBAAK,CAAW;AACnB,gBAAuB,EAApB,aAAK,CAAgB;AACxB,+BAAsC,EAAnC,aAAK,CAA+B;AACpC,4BAAW,CAAgB;AAC9B,qBAAkC,EAA/B,mBAAW,CAAqB;AACnC,sCAAmD,EAAhD,mBAAW,CAAsC;AAEnD,mBAAO,CAAW;AAClB,wBAAO,CAAgB;AACvB,uCAAO,CAA+B;AACtC,uBAAM,CAAgB;AACtB,4BAAM,CAAqB;AAC3B,+CAAM,CAAwC;AAE9C,mBAAO,EAAE,iBAAK,EAAE,kBAAM,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,aAAK,EAAE,cAAM,CAAgB;AACvC,+BAAqD,EAApD,eAAO,EAAE,aAAK,EAAE,cAAM,CAA+B;AACrD,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AACzD,qBAA6D,EAA5D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAsB;AAC9D,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAyC;AAEhF,mBAAO,EAAE,4BAAa,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,wBAAa,CAAgB;AACvC,+BAA4D,EAA3D,eAAO,EAAE,wBAAa,CAAsC;AAC5D,sCAAkB,CAAgB;AAClC,2CAAkB,CAAqB;AACvC,8DAAkB,CAAwC;AAE3D,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAA6B,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAClG,IAAI,eAA8C,CAAC;AAEhD,iBAAK,CAAW;AACnB,gBAAuB,EAApB,aAAK,CAAgB;AACxB,+BAAsC,EAAnC,aAAK,CAA+B;AACpC,4BAAW,CAAgB;AAC9B,qBAAkC,EAA/B,mBAAW,CAAqB;AACnC,sCAAmD,EAAhD,mBAAW,CAAsC;AAEnD,mBAAO,CAAW;AAClB,wBAAO,CAAgB;AACvB,uCAAO,CAA+B;AACtC,uBAAM,CAAgB;AACtB,4BAAM,CAAqB;AAC3B,+CAAM,CAAwC;AAE9C,mBAAO,EAAE,iBAAK,EAAE,kBAAM,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,aAAK,EAAE,cAAM,CAAgB;AACvC,+BAAqD,EAApD,eAAO,EAAE,aAAK,EAAE,cAAM,CAA+B;AACrD,uBAAM,EAAE,mBAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAiB;AACzD,qBAA6D,EAA5D,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAsB;AAC9D,wCAAgF,EAA/E,cAAM,EAAE,UAAgC,EAA/B,qBAAa,EAAE,uBAAe,CAAyC;AAEhF,mBAAO,EAAE,4BAAa,CAAW;AAClC,gBAAsC,EAArC,eAAO,EAAE,wBAAa,CAAgB;AACvC,+BAA4D,EAA3D,eAAO,EAAE,wBAAa,CAAsC;AAC5D,sCAAkB,CAAgB;AAClC,2CAAkB,CAAqB;AACvC,8DAAkB,CAAwC;AAE3D,IAAI,KAAK,IAAI,KAAK,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;IACI,OAAO,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt index 466b36630c3..71a98499b88 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.sourcemap.txt @@ -763,38 +763,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern3 --- >>>if (nameA == nameB) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameA -6 > == -7 > nameB -8 > ) -9 > -10> { +2 >if ( +3 > nameA +4 > == +5 > nameB +6 > ) 1 >Emitted(33, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(33, 3) Source(46, 3) + SourceIndex(0) -3 >Emitted(33, 4) Source(46, 4) + SourceIndex(0) -4 >Emitted(33, 5) Source(46, 5) + SourceIndex(0) -5 >Emitted(33, 10) Source(46, 10) + SourceIndex(0) -6 >Emitted(33, 14) Source(46, 14) + SourceIndex(0) -7 >Emitted(33, 19) Source(46, 19) + SourceIndex(0) -8 >Emitted(33, 20) Source(46, 20) + SourceIndex(0) -9 >Emitted(33, 21) Source(46, 21) + SourceIndex(0) -10>Emitted(33, 22) Source(46, 22) + SourceIndex(0) +2 >Emitted(33, 5) Source(46, 5) + SourceIndex(0) +3 >Emitted(33, 10) Source(46, 10) + SourceIndex(0) +4 >Emitted(33, 14) Source(46, 14) + SourceIndex(0) +5 >Emitted(33, 19) Source(46, 19) + SourceIndex(0) +6 >Emitted(33, 21) Source(46, 21) + SourceIndex(0) --- >>> console.log(skillB); 1->^^^^ @@ -805,7 +793,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern3 6 > ^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -824,14 +812,11 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern3 8 >Emitted(34, 25) Source(47, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(35, 1) Source(48, 1) + SourceIndex(0) -2 >Emitted(35, 2) Source(48, 2) + SourceIndex(0) + >} +1 >Emitted(35, 2) Source(48, 2) + SourceIndex(0) --- >>>function getRobotB() { 1-> @@ -843,21 +828,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern3 --- >>> return robotB; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobotB() { > -2 > return -3 > -4 > robotB -5 > ; +2 > return +3 > robotB +4 > ; 1->Emitted(37, 5) Source(51, 5) + SourceIndex(0) -2 >Emitted(37, 11) Source(51, 11) + SourceIndex(0) -3 >Emitted(37, 12) Source(51, 12) + SourceIndex(0) -4 >Emitted(37, 18) Source(51, 18) + SourceIndex(0) -5 >Emitted(37, 19) Source(51, 19) + SourceIndex(0) +2 >Emitted(37, 12) Source(51, 12) + SourceIndex(0) +3 >Emitted(37, 18) Source(51, 18) + SourceIndex(0) +4 >Emitted(37, 19) Source(51, 19) + SourceIndex(0) --- >>>} 1 > @@ -879,21 +861,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPattern3 --- >>> return multiRobotB; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobotB() { > -2 > return -3 > -4 > multiRobotB -5 > ; +2 > return +3 > multiRobotB +4 > ; 1->Emitted(40, 5) Source(55, 5) + SourceIndex(0) -2 >Emitted(40, 11) Source(55, 11) + SourceIndex(0) -3 >Emitted(40, 12) Source(55, 12) + SourceIndex(0) -4 >Emitted(40, 23) Source(55, 23) + SourceIndex(0) -5 >Emitted(40, 24) Source(55, 24) + SourceIndex(0) +2 >Emitted(40, 12) Source(55, 12) + SourceIndex(0) +3 >Emitted(40, 23) Source(55, 23) + SourceIndex(0) +4 >Emitted(40, 24) Source(55, 24) + SourceIndex(0) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map index eb622ca275b..a35c7f2596f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAExC,IAAA,cAAgB,EAAhB,qCAAgB,CAAW;AAC7B,IAAA,cAAY,EAAZ,iCAAY,CAAW;AACvB,IAAA,cAAa,EAAb,kCAAa,EAAE,cAAiB,EAAjB,sCAAiB,EAAE,cAAmB,EAAnB,wCAAmB,CAAW;AAEhE,IAAA,uCAAa,EAAb,kCAAa,CAAoC;AAClD,IAAA,oCAAsF,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAgB,EAAhB,qCAAgB,EAAE,UAAkB,EAAlB,uCAAkB,CAAoC;AAEtF,IAAA,cAAa,EAAb,kCAAa,EAAE,4BAAa,CAAW;AAE5C,EAAE,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts"],"names":[],"mappings":"AAIA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAExC,IAAA,cAAgB,EAAhB,qCAAgB,CAAW;AAC7B,IAAA,cAAY,EAAZ,iCAAY,CAAW;AACvB,IAAA,cAAa,EAAb,kCAAa,EAAE,cAAiB,EAAjB,sCAAiB,EAAE,cAAmB,EAAnB,wCAAmB,CAAW;AAEhE,IAAA,uCAAa,EAAb,kCAAa,CAAoC;AAClD,IAAA,oCAAsF,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAgB,EAAhB,qCAAgB,EAAE,UAAkB,EAAlB,uCAAkB,CAAoC;AAEtF,IAAA,cAAa,EAAb,kCAAa,EAAE,4BAAa,CAAW;AAE5C,IAAI,KAAK,IAAI,MAAM,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;CACxB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt index 93c8e84f4cd..dfa51e18e6e 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.sourcemap.txt @@ -284,38 +284,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD --- >>>if (nameA == nameA2) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameA -6 > == -7 > nameA2 -8 > ) -9 > -10> { +2 >if ( +3 > nameA +4 > == +5 > nameA2 +6 > ) 1 >Emitted(9, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(9, 3) Source(17, 3) + SourceIndex(0) -3 >Emitted(9, 4) Source(17, 4) + SourceIndex(0) -4 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) -5 >Emitted(9, 10) Source(17, 10) + SourceIndex(0) -6 >Emitted(9, 14) Source(17, 14) + SourceIndex(0) -7 >Emitted(9, 20) Source(17, 20) + SourceIndex(0) -8 >Emitted(9, 21) Source(17, 21) + SourceIndex(0) -9 >Emitted(9, 22) Source(17, 22) + SourceIndex(0) -10>Emitted(9, 23) Source(17, 23) + SourceIndex(0) +2 >Emitted(9, 5) Source(17, 5) + SourceIndex(0) +3 >Emitted(9, 10) Source(17, 10) + SourceIndex(0) +4 >Emitted(9, 14) Source(17, 14) + SourceIndex(0) +5 >Emitted(9, 20) Source(17, 20) + SourceIndex(0) +6 >Emitted(9, 22) Source(17, 22) + SourceIndex(0) --- >>> console.log(skillA2); 1->^^^^ @@ -326,7 +314,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD 6 > ^^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -345,13 +333,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD 8 >Emitted(10, 26) Source(18, 26) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(11, 1) Source(19, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) + >} +1 >Emitted(11, 2) Source(19, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map index d7290353064..844b6f3169f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,IAAA,mBAA+B,EAA/B,oDAA+B,CAAgB;AACjD,IAAA,mBAAiB,EAAjB,sCAAiB,CAAiB;AAClC,IAAA,mBAAiB,EAAjB,sCAAiB,EAAE,mBAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAA0C;AAEpH,IAAA,yCAAiB,EAAjB,sCAAiB,CAAuC;AACzD,IAAA,sCAA2I,EAA1I,UAAkB,EAAlB,uCAAkB,EAAE,UAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAgE;AAEhJ,EAAE,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts"],"names":[],"mappings":"AAIA,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,IAAA,mBAA+B,EAA/B,oDAA+B,CAAgB;AACjD,IAAA,mBAAiB,EAAjB,sCAAiB,CAAiB;AAClC,IAAA,mBAAiB,EAAjB,sCAAiB,EAAE,mBAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAA0C;AAEpH,IAAA,yCAAiB,EAAjB,sCAAiB,CAAuC;AACzD,IAAA,sCAA2I,EAA1I,UAAkB,EAAlB,uCAAkB,EAAE,UAAiF,EAAjF,gDAAiF,EAAhF,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAgE;AAEhJ,IAAI,MAAM,IAAI,MAAM,EAAE;IAClB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CACtC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt index fc4aa48b1ce..99d2e65cfe7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.sourcemap.txt @@ -292,38 +292,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD --- >>>if (nameMB == nameMA) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^^ -6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^^^^^^^^^^^^^^-> +2 >^^^^ +3 > ^^^^^^ +4 > ^^^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameMB -6 > == -7 > nameMA -8 > ) -9 > -10> { +2 >if ( +3 > nameMB +4 > == +5 > nameMA +6 > ) 1 >Emitted(8, 1) Source(15, 1) + SourceIndex(0) -2 >Emitted(8, 3) Source(15, 3) + SourceIndex(0) -3 >Emitted(8, 4) Source(15, 4) + SourceIndex(0) -4 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) -5 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) -6 >Emitted(8, 15) Source(15, 15) + SourceIndex(0) -7 >Emitted(8, 21) Source(15, 21) + SourceIndex(0) -8 >Emitted(8, 22) Source(15, 22) + SourceIndex(0) -9 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) -10>Emitted(8, 24) Source(15, 24) + SourceIndex(0) +2 >Emitted(8, 5) Source(15, 5) + SourceIndex(0) +3 >Emitted(8, 11) Source(15, 11) + SourceIndex(0) +4 >Emitted(8, 15) Source(15, 15) + SourceIndex(0) +5 >Emitted(8, 21) Source(15, 21) + SourceIndex(0) +6 >Emitted(8, 23) Source(15, 23) + SourceIndex(0) --- >>> console.log(skillA[0] + skillA[1]); 1->^^^^ @@ -342,7 +330,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD 14> ^ 15> ^ 16> ^ -1-> +1->{ > 2 > console 3 > . @@ -377,13 +365,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD 16>Emitted(9, 40) Source(16, 40) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(10, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(17, 2) + SourceIndex(0) + >} +1 >Emitted(10, 2) Source(17, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map index 1b7453826e4..26fa07141be 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAAqB,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAC1F,IAAI,eAAsC,CAAC;AAExC,cAAqB,EAArB,0CAAqB,CAAW;AACnC,gBAAuC,EAApC,UAAqB,EAArB,0CAAqB,CAAgB;AACxC,+BAAsD,EAAnD,UAAqB,EAArB,0CAAqB,CAA+B;AACpD,mBAAgB,EAAhB,qCAAgB,CAAgB;AACnC,qBAAuC,EAApC,UAAgB,EAAhB,qCAAgB,CAAqB;AACxC,sCAAwD,EAArD,UAAgB,EAAhB,qCAAgB,CAAsC;AAExD,cAAY,EAAZ,iCAAY,CAAW;AACvB,mBAAY,EAAZ,iCAAY,CAAgB;AAC5B,kCAAY,EAAZ,iCAAY,CAA+B;AAC3C,mBAAsB,EAAtB,2CAAsB,CAAgB;AACtC,wBAAsB,EAAtB,2CAAsB,CAAqB;AAC3C,2CAAsB,EAAtB,2CAAsB,CAAwC;AAE9D,cAAY,EAAZ,iCAAY,EAAE,cAAqB,EAArB,0CAAqB,EAAE,cAAkB,EAAlB,uCAAkB,CAAW;AACnE,gBAAuE,EAAtE,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAAgB;AACxE,+BAAsF,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAA+B;AACtF,mBAAsB,EAAtB,2CAAsB,EAAE,mBAA6D,EAA7D,4BAA6D,EAA5D,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAsB;AACtG,qBAA0G,EAAzG,UAAsB,EAAtB,2CAAsB,EAAE,WAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CAA2B;AAC3G,yCACuC,EADtC,YAAsB,EAAtB,6CAAsB,EAAE,YAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CACxC;AAEvC,eAAY,EAAZ,mCAAY,EAAE,4BAAa,CAAW;AACvC,iBAA2C,EAA1C,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAgB;AAC5C,gCAAiE,EAAhE,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAsC;AAElE,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;IACI,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAED;IACI,MAAM,CAAC,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts"],"names":[],"mappings":"AAMA,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC3C,IAAI,MAAM,GAAU,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAC/C,IAAI,WAAW,GAAsB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,WAAW,GAAsB,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEzE,IAAI,KAAa,EAAE,OAAe,EAAE,KAAa,EAAE,MAAc,CAAC;AAClE,IAAI,UAA+B,CAAC;AAEpC,IAAI,WAAqB,EAAE,MAAc,EAAE,aAAqB,EAAE,eAAuB,CAAC;AAC1F,IAAI,eAAsC,CAAC;AAExC,cAAqB,EAArB,0CAAqB,CAAW;AACnC,gBAAuC,EAApC,UAAqB,EAArB,0CAAqB,CAAgB;AACxC,+BAAsD,EAAnD,UAAqB,EAArB,0CAAqB,CAA+B;AACpD,mBAAgB,EAAhB,qCAAgB,CAAgB;AACnC,qBAAuC,EAApC,UAAgB,EAAhB,qCAAgB,CAAqB;AACxC,sCAAwD,EAArD,UAAgB,EAAhB,qCAAgB,CAAsC;AAExD,cAAY,EAAZ,iCAAY,CAAW;AACvB,mBAAY,EAAZ,iCAAY,CAAgB;AAC5B,kCAAY,EAAZ,iCAAY,CAA+B;AAC3C,mBAAsB,EAAtB,2CAAsB,CAAgB;AACtC,wBAAsB,EAAtB,2CAAsB,CAAqB;AAC3C,2CAAsB,EAAtB,2CAAsB,CAAwC;AAE9D,cAAY,EAAZ,iCAAY,EAAE,cAAqB,EAArB,0CAAqB,EAAE,cAAkB,EAAlB,uCAAkB,CAAW;AACnE,gBAAuE,EAAtE,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAAgB;AACxE,+BAAsF,EAArF,UAAY,EAAZ,iCAAY,EAAE,UAAqB,EAArB,0CAAqB,EAAE,UAAkB,EAAlB,uCAAkB,CAA+B;AACtF,mBAAsB,EAAtB,2CAAsB,EAAE,mBAA6D,EAA7D,4BAA6D,EAA5D,UAAyB,EAAzB,8CAAyB,EAAE,UAA2B,EAA3B,gDAA2B,CAAsB;AACtG,qBAA0G,EAAzG,UAAsB,EAAtB,2CAAsB,EAAE,WAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CAA2B;AAC3G,yCACuC,EADtC,YAAsB,EAAtB,6CAAsB,EAAE,YAA6D,EAA7D,+BAA6D,EAA5D,YAAyB,EAAzB,gDAAyB,EAAE,YAA2B,EAA3B,kDAA2B,CACxC;AAEvC,eAAY,EAAZ,mCAAY,EAAE,4BAAa,CAAW;AACvC,iBAA2C,EAA1C,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAgB;AAC5C,gCAAiE,EAAhE,YAAY,EAAZ,mCAAY,EAAE,yBAAa,CAAsC;AAElE,IAAI,KAAK,IAAI,KAAK,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED;IACI,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;IACI,OAAO,WAAW,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt index c9784dc30a3..4e4dade674c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.sourcemap.txt @@ -944,38 +944,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD --- >>>if (nameA == nameB) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameA -6 > == -7 > nameB -8 > ) -9 > -10> { +2 >if ( +3 > nameA +4 > == +5 > nameB +6 > ) 1 >Emitted(30, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(30, 3) Source(44, 3) + SourceIndex(0) -3 >Emitted(30, 4) Source(44, 4) + SourceIndex(0) -4 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) -5 >Emitted(30, 10) Source(44, 10) + SourceIndex(0) -6 >Emitted(30, 14) Source(44, 14) + SourceIndex(0) -7 >Emitted(30, 19) Source(44, 19) + SourceIndex(0) -8 >Emitted(30, 20) Source(44, 20) + SourceIndex(0) -9 >Emitted(30, 21) Source(44, 21) + SourceIndex(0) -10>Emitted(30, 22) Source(44, 22) + SourceIndex(0) +2 >Emitted(30, 5) Source(44, 5) + SourceIndex(0) +3 >Emitted(30, 10) Source(44, 10) + SourceIndex(0) +4 >Emitted(30, 14) Source(44, 14) + SourceIndex(0) +5 >Emitted(30, 19) Source(44, 19) + SourceIndex(0) +6 >Emitted(30, 21) Source(44, 21) + SourceIndex(0) --- >>> console.log(skillB); 1->^^^^ @@ -986,7 +974,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD 6 > ^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -1005,14 +993,11 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD 8 >Emitted(31, 25) Source(45, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(32, 1) Source(46, 1) + SourceIndex(0) -2 >Emitted(32, 2) Source(46, 2) + SourceIndex(0) + >} +1 >Emitted(32, 2) Source(46, 2) + SourceIndex(0) --- >>>function getRobotB() { 1-> @@ -1024,21 +1009,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD --- >>> return robotB; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^ +4 > ^ 1->function getRobotB() { > -2 > return -3 > -4 > robotB -5 > ; +2 > return +3 > robotB +4 > ; 1->Emitted(34, 5) Source(49, 5) + SourceIndex(0) -2 >Emitted(34, 11) Source(49, 11) + SourceIndex(0) -3 >Emitted(34, 12) Source(49, 12) + SourceIndex(0) -4 >Emitted(34, 18) Source(49, 18) + SourceIndex(0) -5 >Emitted(34, 19) Source(49, 19) + SourceIndex(0) +2 >Emitted(34, 12) Source(49, 12) + SourceIndex(0) +3 >Emitted(34, 18) Source(49, 18) + SourceIndex(0) +4 >Emitted(34, 19) Source(49, 19) + SourceIndex(0) --- >>>} 1 > @@ -1060,21 +1042,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatementArrayBindingPatternD --- >>> return multiRobotB; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^^^ +4 > ^ 1->function getMultiRobotB() { > -2 > return -3 > -4 > multiRobotB -5 > ; +2 > return +3 > multiRobotB +4 > ; 1->Emitted(37, 5) Source(53, 5) + SourceIndex(0) -2 >Emitted(37, 11) Source(53, 11) + SourceIndex(0) -3 >Emitted(37, 12) Source(53, 12) + SourceIndex(0) -4 >Emitted(37, 23) Source(53, 23) + SourceIndex(0) -5 >Emitted(37, 24) Source(53, 24) + SourceIndex(0) +2 >Emitted(37, 12) Source(53, 12) + SourceIndex(0) +3 >Emitted(37, 23) Source(53, 23) + SourceIndex(0) +4 >Emitted(37, 24) Source(53, 24) + SourceIndex(0) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map index 75b4ebb7e4c..4c0852ad1d2 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementDefaultValues.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,IAAA,gBAAwB,EAAxB,uCAAwB,CAAY;AACpC,IAAA,gBAAwB,EAAxB,uCAAwB,EAAE,iBAAoC,EAApC,kDAAoC,CAAY;AAC5E,IAAA,8CAA8G,EAA5G,YAAwB,EAAxB,uCAAwB,EAAE,aAAoC,EAApC,kDAAoC,CAA+C;AACnH,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementDefaultValues.ts"],"names":[],"mappings":"AAOA,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvD,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AACrD,IAAA,gBAAwB,EAAxB,uCAAwB,CAAY;AACpC,IAAA,gBAAwB,EAAxB,uCAAwB,EAAE,iBAAoC,EAApC,kDAAoC,CAAY;AAC5E,IAAA,8CAA8G,EAA5G,YAAwB,EAAxB,uCAAwB,EAAE,aAAoC,EAApC,kDAAoC,CAA+C;AACnH,IAAI,KAAK,IAAI,KAAK,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;KACI;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt index e11d56c5037..c426313b33c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.sourcemap.txt @@ -225,37 +225,25 @@ sourceFile:sourceMapValidationDestructuringVariableStatementDefaultValues.ts --- >>>if (nameA == nameB) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^^-> 1 > > -2 >if -3 > -4 > ( -5 > nameA -6 > == -7 > nameB -8 > ) -9 > -10> { +2 >if ( +3 > nameA +4 > == +5 > nameB +6 > ) 1 >Emitted(7, 1) Source(14, 1) + SourceIndex(0) -2 >Emitted(7, 3) Source(14, 3) + SourceIndex(0) -3 >Emitted(7, 4) Source(14, 4) + SourceIndex(0) -4 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) -5 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) -6 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) -7 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) -8 >Emitted(7, 20) Source(14, 20) + SourceIndex(0) -9 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) -10>Emitted(7, 22) Source(14, 22) + SourceIndex(0) +2 >Emitted(7, 5) Source(14, 5) + SourceIndex(0) +3 >Emitted(7, 10) Source(14, 10) + SourceIndex(0) +4 >Emitted(7, 14) Source(14, 14) + SourceIndex(0) +5 >Emitted(7, 19) Source(14, 19) + SourceIndex(0) +6 >Emitted(7, 21) Source(14, 21) + SourceIndex(0) --- >>> console.log(skillB); 1->^^^^ @@ -266,7 +254,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementDefaultValues.ts 6 > ^^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -285,30 +273,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatementDefaultValues.ts 8 >Emitted(8, 25) Source(15, 25) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^-> +1 >^ +2 > ^^^^^^-> 1 > - > -2 >} -1 >Emitted(9, 1) Source(16, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) + >} +1 >Emitted(9, 2) Source(16, 2) + SourceIndex(0) --- >>>else { -1-> -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^-> +1->^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1-> - > -2 >else -3 > -4 > { -1->Emitted(10, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(10, 5) Source(17, 5) + SourceIndex(0) -3 >Emitted(10, 6) Source(17, 6) + SourceIndex(0) -4 >Emitted(10, 7) Source(17, 7) + SourceIndex(0) + >else +1->Emitted(10, 6) Source(17, 6) + SourceIndex(0) --- >>> console.log(nameC); 1->^^^^ @@ -319,7 +295,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementDefaultValues.ts 6 > ^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -338,13 +314,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatementDefaultValues.ts 8 >Emitted(11, 24) Source(18, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(12, 1) Source(19, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) + >} +1 >Emitted(12, 2) Source(19, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map index c0f2dad3fd5..ed0fe05cb3c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAExF,IAAA,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AAChE,IAAA,mBAAW,EAAE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AAC/E,IAAA,mFAAsJ,EAApJ,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAsF;AAE3J,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAExF,IAAA,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AAChE,IAAA,mBAAW,EAAE,kBAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAc;AAC/E,IAAA,mFAAsJ,EAApJ,eAAW,EAAE,cAAoD,EAA1C,qBAAiB,EAAE,yBAAqB,CAAsF;AAE3J,IAAI,KAAK,IAAI,KAAK,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;KACI;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt index 32fcd1552b3..1779c517c68 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.sourcemap.txt @@ -260,38 +260,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP --- >>>if (nameB == nameB) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameB -6 > == -7 > nameB -8 > ) -9 > -10> { +2 >if ( +3 > nameB +4 > == +5 > nameB +6 > ) 1 >Emitted(6, 1) Source(18, 1) + SourceIndex(0) -2 >Emitted(6, 3) Source(18, 3) + SourceIndex(0) -3 >Emitted(6, 4) Source(18, 4) + SourceIndex(0) -4 >Emitted(6, 5) Source(18, 5) + SourceIndex(0) -5 >Emitted(6, 10) Source(18, 10) + SourceIndex(0) -6 >Emitted(6, 14) Source(18, 14) + SourceIndex(0) -7 >Emitted(6, 19) Source(18, 19) + SourceIndex(0) -8 >Emitted(6, 20) Source(18, 20) + SourceIndex(0) -9 >Emitted(6, 21) Source(18, 21) + SourceIndex(0) -10>Emitted(6, 22) Source(18, 22) + SourceIndex(0) +2 >Emitted(6, 5) Source(18, 5) + SourceIndex(0) +3 >Emitted(6, 10) Source(18, 10) + SourceIndex(0) +4 >Emitted(6, 14) Source(18, 14) + SourceIndex(0) +5 >Emitted(6, 19) Source(18, 19) + SourceIndex(0) +6 >Emitted(6, 21) Source(18, 21) + SourceIndex(0) --- >>> console.log(nameC); 1->^^^^ @@ -302,7 +290,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 6 > ^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -321,30 +309,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 8 >Emitted(7, 24) Source(19, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^-> +1 >^ +2 > ^^^^^^-> 1 > - > -2 >} -1 >Emitted(8, 1) Source(20, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(20, 2) + SourceIndex(0) + >} +1 >Emitted(8, 2) Source(20, 2) + SourceIndex(0) --- >>>else { -1-> -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^-> +1->^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1-> - > -2 >else -3 > -4 > { -1->Emitted(9, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(21, 5) + SourceIndex(0) -3 >Emitted(9, 6) Source(21, 6) + SourceIndex(0) -4 >Emitted(9, 7) Source(21, 7) + SourceIndex(0) + >else +1->Emitted(9, 6) Source(21, 6) + SourceIndex(0) --- >>> console.log(nameC); 1->^^^^ @@ -355,7 +331,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 6 > ^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -374,13 +350,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 8 >Emitted(10, 24) Source(22, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(11, 1) Source(23, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(23, 2) + SourceIndex(0) + >} +1 >Emitted(11, 2) Source(23, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map index 80bfe76492a..73e04a6e433 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map] -{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAG1F,IAAA,kBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AAEP,IAAA,gBAA+B,EAA/B,8CAA+B,EAC/B,kBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AACP,IAAA,mFAMqF,EALrF,YAA+B,EAA/B,8CAA+B,EAC/B,cAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAEiD;AAE1F,EAAE,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AACD,IAAI,CAAC,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js","sourceRoot":"","sources":["sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts"],"names":[],"mappings":"AAUA,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;AACxF,IAAI,MAAM,GAAU,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AAG1F,IAAA,kBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AAEP,IAAA,gBAA+B,EAA/B,8CAA+B,EAC/B,kBAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAE9B;AACP,IAAA,mFAMqF,EALrF,YAA+B,EAA/B,8CAA+B,EAC/B,cAGgD,EAHhD,sEAGgD,EAF5C,eAA6B,EAA7B,yCAA6B,EAC7B,iBAAiC,EAAjC,2CAAiC,CAEiD;AAE1F,IAAI,KAAK,IAAI,KAAK,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB;KACI;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;CACtB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt index cf4629d28d0..1051abf21b6 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.sourcemap.txt @@ -364,38 +364,26 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP --- >>>if (nameB == nameB) { 1 > -2 >^^ -3 > ^ -4 > ^ -5 > ^^^^^ -6 > ^^^^ -7 > ^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^^-> +2 >^^^^ +3 > ^^^^^ +4 > ^^^^ +5 > ^^^^^ +6 > ^^ +7 > ^^^^-> 1 > > > -2 >if -3 > -4 > ( -5 > nameB -6 > == -7 > nameB -8 > ) -9 > -10> { +2 >if ( +3 > nameB +4 > == +5 > nameB +6 > ) 1 >Emitted(6, 1) Source(35, 1) + SourceIndex(0) -2 >Emitted(6, 3) Source(35, 3) + SourceIndex(0) -3 >Emitted(6, 4) Source(35, 4) + SourceIndex(0) -4 >Emitted(6, 5) Source(35, 5) + SourceIndex(0) -5 >Emitted(6, 10) Source(35, 10) + SourceIndex(0) -6 >Emitted(6, 14) Source(35, 14) + SourceIndex(0) -7 >Emitted(6, 19) Source(35, 19) + SourceIndex(0) -8 >Emitted(6, 20) Source(35, 20) + SourceIndex(0) -9 >Emitted(6, 21) Source(35, 21) + SourceIndex(0) -10>Emitted(6, 22) Source(35, 22) + SourceIndex(0) +2 >Emitted(6, 5) Source(35, 5) + SourceIndex(0) +3 >Emitted(6, 10) Source(35, 10) + SourceIndex(0) +4 >Emitted(6, 14) Source(35, 14) + SourceIndex(0) +5 >Emitted(6, 19) Source(35, 19) + SourceIndex(0) +6 >Emitted(6, 21) Source(35, 21) + SourceIndex(0) --- >>> console.log(nameC); 1->^^^^ @@ -406,7 +394,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 6 > ^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -425,30 +413,18 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 8 >Emitted(7, 24) Source(36, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^-> +1 >^ +2 > ^^^^^^-> 1 > - > -2 >} -1 >Emitted(8, 1) Source(37, 1) + SourceIndex(0) -2 >Emitted(8, 2) Source(37, 2) + SourceIndex(0) + >} +1 >Emitted(8, 2) Source(37, 2) + SourceIndex(0) --- >>>else { -1-> -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^^^^^^-> +1->^^^^^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1-> - > -2 >else -3 > -4 > { -1->Emitted(9, 1) Source(38, 1) + SourceIndex(0) -2 >Emitted(9, 5) Source(38, 5) + SourceIndex(0) -3 >Emitted(9, 6) Source(38, 6) + SourceIndex(0) -4 >Emitted(9, 7) Source(38, 7) + SourceIndex(0) + >else +1->Emitted(9, 6) Source(38, 6) + SourceIndex(0) --- >>> console.log(nameC); 1->^^^^ @@ -459,7 +435,7 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 6 > ^^^^^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > console 3 > . @@ -478,13 +454,10 @@ sourceFile:sourceMapValidationDestructuringVariableStatementNestedObjectBindingP 8 >Emitted(10, 24) Source(39, 24) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(11, 1) Source(40, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(40, 2) + SourceIndex(0) + >} +1 >Emitted(11, 2) Source(40, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDo.js.map b/tests/baselines/reference/sourceMapValidationDo.js.map index 4bb53f54b04..c2e667c5b00 100644 --- a/tests/baselines/reference/sourceMapValidationDo.js.map +++ b/tests/baselines/reference/sourceMapValidationDo.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationDo.js.map] -{"version":3,"file":"sourceMapValidationDo.js","sourceRoot":"","sources":["sourceMapValidationDo.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,GACA,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE;AACjB,GAAG,CAAC;IACA,CAAC,EAAE,CAAC;AACR,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationDo.js","sourceRoot":"","sources":["sourceMapValidationDo.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,CAAC,CAAC;AACV,GACA;IACI,CAAC,EAAE,CAAC;CACP,QAAQ,CAAC,GAAG,EAAE,EAAE;AACjB,GAAG;IACC,CAAC,EAAE,CAAC;CACP,QAAQ,CAAC,GAAG,EAAE,EAAE"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationDo.sourcemap.txt b/tests/baselines/reference/sourceMapValidationDo.sourcemap.txt index 5ce87662c69..181538a12fe 100644 --- a/tests/baselines/reference/sourceMapValidationDo.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationDo.sourcemap.txt @@ -31,16 +31,13 @@ sourceFile:sourceMapValidationDo.ts >>>do { 1 > 2 >^^^ -3 > ^ -4 > ^^^^^-> +3 > ^^^^^^-> 1 > > 2 >do > -3 > { 1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 4) Source(3, 1) + SourceIndex(0) -3 >Emitted(2, 5) Source(3, 2) + SourceIndex(0) --- >>> i++; 1->^^^^ @@ -48,7 +45,7 @@ sourceFile:sourceMapValidationDo.ts 3 > ^^ 4 > ^ 5 > ^^^^^^^^^^-> -1-> +1->{ > 2 > i 3 > ++ @@ -59,41 +56,35 @@ sourceFile:sourceMapValidationDo.ts 4 >Emitted(3, 9) Source(4, 9) + SourceIndex(0) --- >>>} while (i < 10); -1-> -2 >^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^ -6 > ^^ -7 > ^^ +1->^ +2 > ^^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^^ 1-> - > -2 >} -3 > while ( -4 > i -5 > < -6 > 10 -7 > ); -1->Emitted(4, 1) Source(5, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(5, 2) + SourceIndex(0) -3 >Emitted(4, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(4, 11) Source(5, 11) + SourceIndex(0) -5 >Emitted(4, 14) Source(5, 14) + SourceIndex(0) -6 >Emitted(4, 16) Source(5, 16) + SourceIndex(0) -7 >Emitted(4, 18) Source(5, 18) + SourceIndex(0) + >} +2 > while ( +3 > i +4 > < +5 > 10 +6 > ); +1->Emitted(4, 2) Source(5, 2) + SourceIndex(0) +2 >Emitted(4, 10) Source(5, 10) + SourceIndex(0) +3 >Emitted(4, 11) Source(5, 11) + SourceIndex(0) +4 >Emitted(4, 14) Source(5, 14) + SourceIndex(0) +5 >Emitted(4, 16) Source(5, 16) + SourceIndex(0) +6 >Emitted(4, 18) Source(5, 18) + SourceIndex(0) --- >>>do { 1 > 2 >^^^ -3 > ^ -4 > ^^^^^-> +3 > ^^^^^^-> 1 > > 2 >do -3 > { 1 >Emitted(5, 1) Source(6, 1) + SourceIndex(0) 2 >Emitted(5, 4) Source(6, 4) + SourceIndex(0) -3 >Emitted(5, 5) Source(6, 5) + SourceIndex(0) --- >>> i++; 1->^^^^ @@ -101,7 +92,7 @@ sourceFile:sourceMapValidationDo.ts 3 > ^^ 4 > ^ 5 > ^^^^^^^^^^-> -1-> +1->{ > 2 > i 3 > ++ @@ -112,28 +103,25 @@ sourceFile:sourceMapValidationDo.ts 4 >Emitted(6, 9) Source(7, 9) + SourceIndex(0) --- >>>} while (i < 20); -1-> -2 >^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^ -6 > ^^ -7 > ^^ -8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1->^ +2 > ^^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^^ +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> - > -2 >} -3 > while ( -4 > i -5 > < -6 > 20 -7 > ); -1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(8, 2) + SourceIndex(0) -3 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) -4 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) -5 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) -6 >Emitted(7, 16) Source(8, 16) + SourceIndex(0) -7 >Emitted(7, 18) Source(8, 18) + SourceIndex(0) + >} +2 > while ( +3 > i +4 > < +5 > 20 +6 > ); +1->Emitted(7, 2) Source(8, 2) + SourceIndex(0) +2 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +3 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) +4 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +5 >Emitted(7, 16) Source(8, 16) + SourceIndex(0) +6 >Emitted(7, 18) Source(8, 18) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationDo.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.js.map b/tests/baselines/reference/sourceMapValidationFor.js.map index 5d6491ae1e5..7894850ee9b 100644 --- a/tests/baselines/reference/sourceMapValidationFor.js.map +++ b/tests/baselines/reference/sourceMapValidationFor.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationFor.js.map] -{"version":3,"file":"sourceMapValidationFor.js","sourceRoot":"","sources":["sourceMapValidationFor.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EACvB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAI,CAAC;IACvB,CAAC,EAAE,CAAC;IACJ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACT,QAAQ,CAAC;IACb,CAAC;AACL,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAClB,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AACvB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAChB,CAAC;AACD,CAAC;AACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,CAAC;IACN,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,IACL,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AAC1C,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationFor.js","sourceRoot":"","sources":["sourceMapValidationFor.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;IACzB,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;CAC3B;AACD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EACvB;IACI,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;CAC3B;AACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAAI;IACtB,CAAC,EAAE,CAAC;IACJ,IAAI,CAAC,IAAI,CAAC,EAAE;QACR,SAAS;KACZ;CACJ;AACD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,GAClB;IACI,CAAC,EAAE,CAAC;CACP;AACD,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE;CACrB;AACD,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAChB;CACC;AACD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;CACnB;AACD,SAAS;IACL,CAAC,EAAE,CAAC;CACP;AACD,SACA;IACI,CAAC,EAAE,CAAC;CACP;AACD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;CACxC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt index 583e60d75cf..c5aed783531 100644 --- a/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationFor.sourcemap.txt @@ -10,56 +10,47 @@ sourceFile:sourceMapValidationFor.ts ------------------------------------------------------------------- >>>for (var i = 0; i < 10; i++) { 1 > -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^ -13> ^^ -14> ^ -15> ^^ -16> ^^ -17> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^^ +11> ^^ +12> ^ +13> ^^ +14> ^^ 1 > -2 >for -3 > -4 > ( -5 > var -6 > i -7 > = -8 > 0 -9 > ; -10> i -11> < -12> 10 -13> ; -14> i -15> ++ -16> ) -17> { +2 >for ( +3 > var +4 > i +5 > = +6 > 0 +7 > ; +8 > i +9 > < +10> 10 +11> ; +12> i +13> ++ +14> ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) -3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -7 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) -8 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -9 >Emitted(1, 17) Source(1, 17) + SourceIndex(0) -10>Emitted(1, 18) Source(1, 18) + SourceIndex(0) -11>Emitted(1, 21) Source(1, 21) + SourceIndex(0) -12>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -13>Emitted(1, 25) Source(1, 25) + SourceIndex(0) -14>Emitted(1, 26) Source(1, 26) + SourceIndex(0) -15>Emitted(1, 28) Source(1, 28) + SourceIndex(0) -16>Emitted(1, 30) Source(1, 30) + SourceIndex(0) -17>Emitted(1, 31) Source(1, 31) + SourceIndex(0) +2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(1, 14) Source(1, 14) + SourceIndex(0) +6 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +7 >Emitted(1, 17) Source(1, 17) + SourceIndex(0) +8 >Emitted(1, 18) Source(1, 18) + SourceIndex(0) +9 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) +10>Emitted(1, 23) Source(1, 23) + SourceIndex(0) +11>Emitted(1, 25) Source(1, 25) + SourceIndex(0) +12>Emitted(1, 26) Source(1, 26) + SourceIndex(0) +13>Emitted(1, 28) Source(1, 28) + SourceIndex(0) +14>Emitted(1, 30) Source(1, 30) + SourceIndex(0) --- >>> WScript.Echo("i: " + i); 1 >^^^^ @@ -72,7 +63,7 @@ sourceFile:sourceMapValidationFor.ts 8 > ^ 9 > ^ 10> ^ -1 > +1 >{ > 2 > WScript 3 > . @@ -95,67 +86,55 @@ sourceFile:sourceMapValidationFor.ts 10>Emitted(2, 29) Source(2, 29) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) + >} +1 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) --- >>>for (i = 0; i < 10; i++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^ -7 > ^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^^ -12> ^^ -13> ^ -14> ^^ -15> ^^ -16> ^ -17> ^^^-> +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^^ +10> ^^ +11> ^ +12> ^^ +13> ^^ +14> ^^^^-> 1-> > -2 >for -3 > -4 > ( -5 > i -6 > = -7 > 0 -8 > ; -9 > i -10> < -11> 10 -12> ; -13> i -14> ++ -15> ) +2 >for ( +3 > i +4 > = +5 > 0 +6 > ; +7 > i +8 > < +9 > 10 +10> ; +11> i +12> ++ +13> ) > -16> { 1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) -3 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -4 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) -5 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) -6 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) -7 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) -8 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) -9 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) -10>Emitted(4, 17) Source(4, 17) + SourceIndex(0) -11>Emitted(4, 19) Source(4, 19) + SourceIndex(0) -12>Emitted(4, 21) Source(4, 21) + SourceIndex(0) -13>Emitted(4, 22) Source(4, 22) + SourceIndex(0) -14>Emitted(4, 24) Source(4, 24) + SourceIndex(0) -15>Emitted(4, 26) Source(5, 1) + SourceIndex(0) -16>Emitted(4, 27) Source(5, 2) + SourceIndex(0) +2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +4 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) +5 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) +6 >Emitted(4, 13) Source(4, 13) + SourceIndex(0) +7 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) +8 >Emitted(4, 17) Source(4, 17) + SourceIndex(0) +9 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) +10>Emitted(4, 21) Source(4, 21) + SourceIndex(0) +11>Emitted(4, 22) Source(4, 22) + SourceIndex(0) +12>Emitted(4, 24) Source(4, 24) + SourceIndex(0) +13>Emitted(4, 26) Source(5, 1) + SourceIndex(0) --- >>> WScript.Echo("i: " + i); 1->^^^^ @@ -168,7 +147,7 @@ sourceFile:sourceMapValidationFor.ts 8 > ^ 9 > ^ 10> ^ -1-> +1->{ > 2 > WScript 3 > . @@ -191,59 +170,47 @@ sourceFile:sourceMapValidationFor.ts 10>Emitted(5, 29) Source(6, 29) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(6, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(7, 2) + SourceIndex(0) + >} +1 >Emitted(6, 2) Source(7, 2) + SourceIndex(0) --- >>>for (var j = 0; j < 10;) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^ -13> ^^^ -14> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^^ +11> ^^^ 1-> > -2 >for -3 > -4 > ( -5 > var -6 > j -7 > = -8 > 0 -9 > ; -10> j -11> < -12> 10 -13> ; ) -14> { +2 >for ( +3 > var +4 > j +5 > = +6 > 0 +7 > ; +8 > j +9 > < +10> 10 +11> ; ) 1->Emitted(7, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(7, 4) Source(8, 4) + SourceIndex(0) -3 >Emitted(7, 5) Source(8, 5) + SourceIndex(0) -4 >Emitted(7, 6) Source(8, 6) + SourceIndex(0) -5 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) -6 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) -7 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) -8 >Emitted(7, 15) Source(8, 15) + SourceIndex(0) -9 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) -10>Emitted(7, 18) Source(8, 18) + SourceIndex(0) -11>Emitted(7, 21) Source(8, 21) + SourceIndex(0) -12>Emitted(7, 23) Source(8, 23) + SourceIndex(0) -13>Emitted(7, 26) Source(8, 27) + SourceIndex(0) -14>Emitted(7, 27) Source(8, 28) + SourceIndex(0) +2 >Emitted(7, 6) Source(8, 6) + SourceIndex(0) +3 >Emitted(7, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(7, 11) Source(8, 11) + SourceIndex(0) +5 >Emitted(7, 14) Source(8, 14) + SourceIndex(0) +6 >Emitted(7, 15) Source(8, 15) + SourceIndex(0) +7 >Emitted(7, 17) Source(8, 17) + SourceIndex(0) +8 >Emitted(7, 18) Source(8, 18) + SourceIndex(0) +9 >Emitted(7, 21) Source(8, 21) + SourceIndex(0) +10>Emitted(7, 23) Source(8, 23) + SourceIndex(0) +11>Emitted(7, 26) Source(8, 27) + SourceIndex(0) --- >>> j++; 1 >^^^^ @@ -251,7 +218,7 @@ sourceFile:sourceMapValidationFor.ts 3 > ^^ 4 > ^ 5 > ^^^^^^^^^^-> -1 > +1 >{ > 2 > j 3 > ++ @@ -263,118 +230,88 @@ sourceFile:sourceMapValidationFor.ts --- >>> if (j == 1) { 1->^^^^ -2 > ^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^^ -7 > ^ -8 > ^ -9 > ^ -10> ^ -11> ^-> +2 > ^^^^ +3 > ^ +4 > ^^^^ +5 > ^ +6 > ^^ +7 > ^^-> 1-> > -2 > if -3 > -4 > ( -5 > j -6 > == -7 > 1 -8 > ) -9 > -10> { +2 > if ( +3 > j +4 > == +5 > 1 +6 > ) 1->Emitted(9, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(9, 7) Source(10, 7) + SourceIndex(0) -3 >Emitted(9, 8) Source(10, 8) + SourceIndex(0) -4 >Emitted(9, 9) Source(10, 9) + SourceIndex(0) -5 >Emitted(9, 10) Source(10, 10) + SourceIndex(0) -6 >Emitted(9, 14) Source(10, 14) + SourceIndex(0) -7 >Emitted(9, 15) Source(10, 15) + SourceIndex(0) -8 >Emitted(9, 16) Source(10, 16) + SourceIndex(0) -9 >Emitted(9, 17) Source(10, 17) + SourceIndex(0) -10>Emitted(9, 18) Source(10, 18) + SourceIndex(0) +2 >Emitted(9, 9) Source(10, 9) + SourceIndex(0) +3 >Emitted(9, 10) Source(10, 10) + SourceIndex(0) +4 >Emitted(9, 14) Source(10, 14) + SourceIndex(0) +5 >Emitted(9, 15) Source(10, 15) + SourceIndex(0) +6 >Emitted(9, 17) Source(10, 17) + SourceIndex(0) --- >>> continue; 1->^^^^^^^^ -2 > ^^^^^^^^ -3 > ^ -1-> +2 > ^^^^^^^^^ +1->{ > -2 > continue -3 > ; +2 > continue; 1->Emitted(10, 9) Source(11, 9) + SourceIndex(0) -2 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) -3 >Emitted(10, 18) Source(11, 18) + SourceIndex(0) +2 >Emitted(10, 18) Source(11, 18) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ +1 >^^^^^ 1 > - > -2 > } -1 >Emitted(11, 5) Source(12, 5) + SourceIndex(0) -2 >Emitted(11, 6) Source(12, 6) + SourceIndex(0) + > } +1 >Emitted(11, 6) Source(12, 6) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(12, 1) Source(13, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(13, 2) + SourceIndex(0) + >} +1 >Emitted(12, 2) Source(13, 2) + SourceIndex(0) --- >>>for (j = 0; j < 10;) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^ -7 > ^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^^ -12> ^^^ -13> ^ +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^^ +10> ^^^ 1-> > -2 >for -3 > -4 > ( -5 > j -6 > = -7 > 0 -8 > ; -9 > j -10> < -11> 10 -12> ;) +2 >for ( +3 > j +4 > = +5 > 0 +6 > ; +7 > j +8 > < +9 > 10 +10> ;) > -13> { 1->Emitted(13, 1) Source(14, 1) + SourceIndex(0) -2 >Emitted(13, 4) Source(14, 4) + SourceIndex(0) -3 >Emitted(13, 5) Source(14, 5) + SourceIndex(0) -4 >Emitted(13, 6) Source(14, 6) + SourceIndex(0) -5 >Emitted(13, 7) Source(14, 7) + SourceIndex(0) -6 >Emitted(13, 10) Source(14, 10) + SourceIndex(0) -7 >Emitted(13, 11) Source(14, 11) + SourceIndex(0) -8 >Emitted(13, 13) Source(14, 13) + SourceIndex(0) -9 >Emitted(13, 14) Source(14, 14) + SourceIndex(0) -10>Emitted(13, 17) Source(14, 17) + SourceIndex(0) -11>Emitted(13, 19) Source(14, 19) + SourceIndex(0) -12>Emitted(13, 22) Source(15, 1) + SourceIndex(0) -13>Emitted(13, 23) Source(15, 2) + SourceIndex(0) +2 >Emitted(13, 6) Source(14, 6) + SourceIndex(0) +3 >Emitted(13, 7) Source(14, 7) + SourceIndex(0) +4 >Emitted(13, 10) Source(14, 10) + SourceIndex(0) +5 >Emitted(13, 11) Source(14, 11) + SourceIndex(0) +6 >Emitted(13, 13) Source(14, 13) + SourceIndex(0) +7 >Emitted(13, 14) Source(14, 14) + SourceIndex(0) +8 >Emitted(13, 17) Source(14, 17) + SourceIndex(0) +9 >Emitted(13, 19) Source(14, 19) + SourceIndex(0) +10>Emitted(13, 22) Source(15, 1) + SourceIndex(0) --- >>> j++; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > j 3 > ++ @@ -385,196 +322,142 @@ sourceFile:sourceMapValidationFor.ts 4 >Emitted(14, 9) Source(16, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(15, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(17, 2) + SourceIndex(0) + >} +1 >Emitted(15, 2) Source(17, 2) + SourceIndex(0) --- >>>for (var k = 0;; k++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^^ -10> ^ -11> ^^ -12> ^^ -13> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^^ +8 > ^ +9 > ^^ +10> ^^ 1-> > -2 >for -3 > -4 > ( -5 > var -6 > k -7 > = -8 > 0 -9 > ;; -10> k -11> ++ -12> ) -13> { +2 >for ( +3 > var +4 > k +5 > = +6 > 0 +7 > ;; +8 > k +9 > ++ +10> ) 1->Emitted(16, 1) Source(18, 1) + SourceIndex(0) -2 >Emitted(16, 4) Source(18, 4) + SourceIndex(0) -3 >Emitted(16, 5) Source(18, 5) + SourceIndex(0) -4 >Emitted(16, 6) Source(18, 6) + SourceIndex(0) -5 >Emitted(16, 10) Source(18, 10) + SourceIndex(0) -6 >Emitted(16, 11) Source(18, 11) + SourceIndex(0) -7 >Emitted(16, 14) Source(18, 14) + SourceIndex(0) -8 >Emitted(16, 15) Source(18, 15) + SourceIndex(0) -9 >Emitted(16, 18) Source(18, 18) + SourceIndex(0) -10>Emitted(16, 19) Source(18, 19) + SourceIndex(0) -11>Emitted(16, 21) Source(18, 21) + SourceIndex(0) -12>Emitted(16, 23) Source(18, 23) + SourceIndex(0) -13>Emitted(16, 24) Source(18, 24) + SourceIndex(0) +2 >Emitted(16, 6) Source(18, 6) + SourceIndex(0) +3 >Emitted(16, 10) Source(18, 10) + SourceIndex(0) +4 >Emitted(16, 11) Source(18, 11) + SourceIndex(0) +5 >Emitted(16, 14) Source(18, 14) + SourceIndex(0) +6 >Emitted(16, 15) Source(18, 15) + SourceIndex(0) +7 >Emitted(16, 18) Source(18, 18) + SourceIndex(0) +8 >Emitted(16, 19) Source(18, 19) + SourceIndex(0) +9 >Emitted(16, 21) Source(18, 21) + SourceIndex(0) +10>Emitted(16, 23) Source(18, 23) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(17, 1) Source(19, 1) + SourceIndex(0) -2 >Emitted(17, 2) Source(19, 2) + SourceIndex(0) +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^-> +1 >{ + >} +1 >Emitted(17, 2) Source(19, 2) + SourceIndex(0) --- >>>for (k = 0;; k++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^^ -12> ^ +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^^ +7 > ^ +8 > ^^ +9 > ^^ 1-> > -2 >for -3 > -4 > ( -5 > k -6 > = -7 > 0 -8 > ;; -9 > k -10> ++ -11> ) +2 >for ( +3 > k +4 > = +5 > 0 +6 > ;; +7 > k +8 > ++ +9 > ) > -12> { 1->Emitted(18, 1) Source(20, 1) + SourceIndex(0) -2 >Emitted(18, 4) Source(20, 4) + SourceIndex(0) -3 >Emitted(18, 5) Source(20, 5) + SourceIndex(0) -4 >Emitted(18, 6) Source(20, 6) + SourceIndex(0) -5 >Emitted(18, 7) Source(20, 7) + SourceIndex(0) -6 >Emitted(18, 10) Source(20, 10) + SourceIndex(0) -7 >Emitted(18, 11) Source(20, 11) + SourceIndex(0) -8 >Emitted(18, 14) Source(20, 14) + SourceIndex(0) -9 >Emitted(18, 15) Source(20, 15) + SourceIndex(0) -10>Emitted(18, 17) Source(20, 17) + SourceIndex(0) -11>Emitted(18, 19) Source(21, 1) + SourceIndex(0) -12>Emitted(18, 20) Source(21, 2) + SourceIndex(0) +2 >Emitted(18, 6) Source(20, 6) + SourceIndex(0) +3 >Emitted(18, 7) Source(20, 7) + SourceIndex(0) +4 >Emitted(18, 10) Source(20, 10) + SourceIndex(0) +5 >Emitted(18, 11) Source(20, 11) + SourceIndex(0) +6 >Emitted(18, 14) Source(20, 14) + SourceIndex(0) +7 >Emitted(18, 15) Source(20, 15) + SourceIndex(0) +8 >Emitted(18, 17) Source(20, 17) + SourceIndex(0) +9 >Emitted(18, 19) Source(21, 1) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(19, 1) Source(22, 1) + SourceIndex(0) -2 >Emitted(19, 2) Source(22, 2) + SourceIndex(0) +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^-> +1 >{ + >} +1 >Emitted(19, 2) Source(22, 2) + SourceIndex(0) --- >>>for (; k < 10; k++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^^^ -8 > ^^ -9 > ^^ -10> ^ -11> ^^ -12> ^^ -13> ^ +2 >^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^^ +7 > ^ +8 > ^^ +9 > ^^ 1-> > -2 >for -3 > -4 > ( -5 > ; -6 > k -7 > < -8 > 10 -9 > ; -10> k -11> ++ -12> ) -13> { +2 >for (; +3 > k +4 > < +5 > 10 +6 > ; +7 > k +8 > ++ +9 > ) 1->Emitted(20, 1) Source(23, 1) + SourceIndex(0) -2 >Emitted(20, 4) Source(23, 4) + SourceIndex(0) -3 >Emitted(20, 5) Source(23, 5) + SourceIndex(0) -4 >Emitted(20, 6) Source(23, 6) + SourceIndex(0) -5 >Emitted(20, 8) Source(23, 8) + SourceIndex(0) -6 >Emitted(20, 9) Source(23, 9) + SourceIndex(0) -7 >Emitted(20, 12) Source(23, 12) + SourceIndex(0) -8 >Emitted(20, 14) Source(23, 14) + SourceIndex(0) -9 >Emitted(20, 16) Source(23, 16) + SourceIndex(0) -10>Emitted(20, 17) Source(23, 17) + SourceIndex(0) -11>Emitted(20, 19) Source(23, 19) + SourceIndex(0) -12>Emitted(20, 21) Source(23, 21) + SourceIndex(0) -13>Emitted(20, 22) Source(23, 22) + SourceIndex(0) +2 >Emitted(20, 8) Source(23, 8) + SourceIndex(0) +3 >Emitted(20, 9) Source(23, 9) + SourceIndex(0) +4 >Emitted(20, 12) Source(23, 12) + SourceIndex(0) +5 >Emitted(20, 14) Source(23, 14) + SourceIndex(0) +6 >Emitted(20, 16) Source(23, 16) + SourceIndex(0) +7 >Emitted(20, 17) Source(23, 17) + SourceIndex(0) +8 >Emitted(20, 19) Source(23, 19) + SourceIndex(0) +9 >Emitted(20, 21) Source(23, 21) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(21, 1) Source(24, 1) + SourceIndex(0) -2 >Emitted(21, 2) Source(24, 2) + SourceIndex(0) +1 >^ +2 > ^^^^^^^^^^-> +1 >{ + >} +1 >Emitted(21, 2) Source(24, 2) + SourceIndex(0) --- >>>for (;;) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ +2 >^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > ;;) -6 > { +2 >for (;;) 1->Emitted(22, 1) Source(25, 1) + SourceIndex(0) -2 >Emitted(22, 4) Source(25, 4) + SourceIndex(0) -3 >Emitted(22, 5) Source(25, 5) + SourceIndex(0) -4 >Emitted(22, 6) Source(25, 6) + SourceIndex(0) -5 >Emitted(22, 10) Source(25, 10) + SourceIndex(0) -6 >Emitted(22, 11) Source(25, 11) + SourceIndex(0) +2 >Emitted(22, 10) Source(25, 10) + SourceIndex(0) --- >>> i++; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > i 3 > ++ @@ -585,43 +468,28 @@ sourceFile:sourceMapValidationFor.ts 4 >Emitted(23, 9) Source(26, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(24, 1) Source(27, 1) + SourceIndex(0) -2 >Emitted(24, 2) Source(27, 2) + SourceIndex(0) + >} +1 >Emitted(24, 2) Source(27, 2) + SourceIndex(0) --- >>>for (;;) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ +2 >^^^^^^^^^ 1-> > -2 >for -3 > -4 > ( -5 > ;;) - > -6 > { +2 >for (;;) + > 1->Emitted(25, 1) Source(28, 1) + SourceIndex(0) -2 >Emitted(25, 4) Source(28, 4) + SourceIndex(0) -3 >Emitted(25, 5) Source(28, 5) + SourceIndex(0) -4 >Emitted(25, 6) Source(28, 6) + SourceIndex(0) -5 >Emitted(25, 10) Source(29, 1) + SourceIndex(0) -6 >Emitted(25, 11) Source(29, 2) + SourceIndex(0) +2 >Emitted(25, 10) Source(29, 1) + SourceIndex(0) --- >>> i++; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > i 3 > ++ @@ -632,98 +500,83 @@ sourceFile:sourceMapValidationFor.ts 4 >Emitted(26, 9) Source(30, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(27, 1) Source(31, 1) + SourceIndex(0) -2 >Emitted(27, 2) Source(31, 2) + SourceIndex(0) + >} +1 >Emitted(27, 2) Source(31, 2) + SourceIndex(0) --- >>>for (i = 0, j = 20; j < 20, i < 20; j++) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^ -7 > ^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^^ -12> ^^ -13> ^ -14> ^^^ -15> ^^ -16> ^^ -17> ^ -18> ^^^ -19> ^^ -20> ^^ -21> ^ -22> ^^ -23> ^^ -24> ^ +2 >^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^^ +10> ^^ +11> ^ +12> ^^^ +13> ^^ +14> ^^ +15> ^ +16> ^^^ +17> ^^ +18> ^^ +19> ^ +20> ^^ +21> ^^ 1-> > -2 >for -3 > -4 > ( -5 > i -6 > = -7 > 0 -8 > , -9 > j -10> = -11> 20 -12> ; -13> j -14> < -15> 20 -16> , -17> i -18> < -19> 20 -20> ; -21> j -22> ++ -23> ) -24> { +2 >for ( +3 > i +4 > = +5 > 0 +6 > , +7 > j +8 > = +9 > 20 +10> ; +11> j +12> < +13> 20 +14> , +15> i +16> < +17> 20 +18> ; +19> j +20> ++ +21> ) 1->Emitted(28, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(28, 4) Source(32, 4) + SourceIndex(0) -3 >Emitted(28, 5) Source(32, 5) + SourceIndex(0) -4 >Emitted(28, 6) Source(32, 6) + SourceIndex(0) -5 >Emitted(28, 7) Source(32, 7) + SourceIndex(0) -6 >Emitted(28, 10) Source(32, 10) + SourceIndex(0) -7 >Emitted(28, 11) Source(32, 11) + SourceIndex(0) -8 >Emitted(28, 13) Source(32, 13) + SourceIndex(0) -9 >Emitted(28, 14) Source(32, 14) + SourceIndex(0) -10>Emitted(28, 17) Source(32, 17) + SourceIndex(0) -11>Emitted(28, 19) Source(32, 19) + SourceIndex(0) -12>Emitted(28, 21) Source(32, 21) + SourceIndex(0) -13>Emitted(28, 22) Source(32, 22) + SourceIndex(0) -14>Emitted(28, 25) Source(32, 25) + SourceIndex(0) -15>Emitted(28, 27) Source(32, 27) + SourceIndex(0) -16>Emitted(28, 29) Source(32, 29) + SourceIndex(0) -17>Emitted(28, 30) Source(32, 30) + SourceIndex(0) -18>Emitted(28, 33) Source(32, 33) + SourceIndex(0) -19>Emitted(28, 35) Source(32, 35) + SourceIndex(0) -20>Emitted(28, 37) Source(32, 37) + SourceIndex(0) -21>Emitted(28, 38) Source(32, 38) + SourceIndex(0) -22>Emitted(28, 40) Source(32, 40) + SourceIndex(0) -23>Emitted(28, 42) Source(32, 42) + SourceIndex(0) -24>Emitted(28, 43) Source(32, 43) + SourceIndex(0) +2 >Emitted(28, 6) Source(32, 6) + SourceIndex(0) +3 >Emitted(28, 7) Source(32, 7) + SourceIndex(0) +4 >Emitted(28, 10) Source(32, 10) + SourceIndex(0) +5 >Emitted(28, 11) Source(32, 11) + SourceIndex(0) +6 >Emitted(28, 13) Source(32, 13) + SourceIndex(0) +7 >Emitted(28, 14) Source(32, 14) + SourceIndex(0) +8 >Emitted(28, 17) Source(32, 17) + SourceIndex(0) +9 >Emitted(28, 19) Source(32, 19) + SourceIndex(0) +10>Emitted(28, 21) Source(32, 21) + SourceIndex(0) +11>Emitted(28, 22) Source(32, 22) + SourceIndex(0) +12>Emitted(28, 25) Source(32, 25) + SourceIndex(0) +13>Emitted(28, 27) Source(32, 27) + SourceIndex(0) +14>Emitted(28, 29) Source(32, 29) + SourceIndex(0) +15>Emitted(28, 30) Source(32, 30) + SourceIndex(0) +16>Emitted(28, 33) Source(32, 33) + SourceIndex(0) +17>Emitted(28, 35) Source(32, 35) + SourceIndex(0) +18>Emitted(28, 37) Source(32, 37) + SourceIndex(0) +19>Emitted(28, 38) Source(32, 38) + SourceIndex(0) +20>Emitted(28, 40) Source(32, 40) + SourceIndex(0) +21>Emitted(28, 42) Source(32, 42) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(29, 1) Source(33, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(33, 2) + SourceIndex(0) +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >{ + >} +1 >Emitted(29, 2) Source(33, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationFor.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.js.map b/tests/baselines/reference/sourceMapValidationForIn.js.map index 2281e36f605..a50e9ab4f07 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.js.map +++ b/tests/baselines/reference/sourceMapValidationForIn.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationForIn.js.map] -{"version":3,"file":"sourceMapValidationForIn.js","sourceRoot":"","sources":["sourceMapValidationForIn.ts"],"names":[],"mappings":"AAAA,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AACD,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,CACtB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC;AACD,GAAG,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CACjB,CAAC;IACG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationForIn.js","sourceRoot":"","sources":["sourceMapValidationForIn.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,CAAC,IAAI,MAAM,EAAE;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACnB;AACD,KAAK,CAAC,IAAI,MAAM,EAAE;IACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACnB;AACD,KAAK,IAAI,EAAE,IAAI,MAAM,EACrB;IACI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;CACpB;AACD,KAAK,CAAC,IAAI,MAAM,EAChB;IACI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt index e84bb2323c4..2efbb140522 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationForIn.sourcemap.txt @@ -10,38 +10,26 @@ sourceFile:sourceMapValidationForIn.ts ------------------------------------------------------------------- >>>for (var x in String) { 1 > -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^ +6 > ^^^^^^ +7 > ^^ 1 > -2 >for -3 > -4 > ( -5 > var -6 > x -7 > in -8 > String -9 > ) -10> -11> { +2 >for ( +3 > var +4 > x +5 > in +6 > String +7 > ) 1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 4) Source(1, 4) + SourceIndex(0) -3 >Emitted(1, 5) Source(1, 5) + SourceIndex(0) -4 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) -5 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) -6 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -7 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) -8 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) -9 >Emitted(1, 22) Source(1, 22) + SourceIndex(0) -10>Emitted(1, 23) Source(1, 23) + SourceIndex(0) -11>Emitted(1, 24) Source(1, 24) + SourceIndex(0) +2 >Emitted(1, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(1, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(1, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(1, 21) Source(1, 21) + SourceIndex(0) +7 >Emitted(1, 23) Source(1, 23) + SourceIndex(0) --- >>> WScript.Echo(x); 1 >^^^^ @@ -52,7 +40,7 @@ sourceFile:sourceMapValidationForIn.ts 6 > ^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > WScript 3 > . @@ -71,48 +59,33 @@ sourceFile:sourceMapValidationForIn.ts 8 >Emitted(2, 21) Source(2, 21) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(3, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) + >} +1 >Emitted(3, 2) Source(3, 2) + SourceIndex(0) --- >>>for (x in String) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^-> +2 >^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^-> 1-> > -2 >for -3 > -4 > ( -5 > x -6 > in -7 > String -8 > ) -9 > -10> { +2 >for ( +3 > x +4 > in +5 > String +6 > ) 1->Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 4) Source(4, 4) + SourceIndex(0) -3 >Emitted(4, 5) Source(4, 5) + SourceIndex(0) -4 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) -5 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) -6 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) -7 >Emitted(4, 17) Source(4, 17) + SourceIndex(0) -8 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) -9 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) -10>Emitted(4, 20) Source(4, 20) + SourceIndex(0) +2 >Emitted(4, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(4, 7) + SourceIndex(0) +4 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) +5 >Emitted(4, 17) Source(4, 17) + SourceIndex(0) +6 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) --- >>> WScript.Echo(x); 1->^^^^ @@ -123,7 +96,7 @@ sourceFile:sourceMapValidationForIn.ts 6 > ^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > WScript 3 > . @@ -142,51 +115,36 @@ sourceFile:sourceMapValidationForIn.ts 8 >Emitted(5, 21) Source(5, 21) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) + >} +1 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) --- >>>for (var x2 in String) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^^ -7 > ^^^^ -8 > ^^^^^^ -9 > ^ -10> ^ -11> ^ +2 >^^^^^ +3 > ^^^^ +4 > ^^ +5 > ^^^^ +6 > ^^^^^^ +7 > ^^ 1-> > -2 >for -3 > -4 > ( -5 > var -6 > x2 -7 > in -8 > String -9 > ) -10> - > -11> { +2 >for ( +3 > var +4 > x2 +5 > in +6 > String +7 > ) + > 1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(7, 4) Source(7, 4) + SourceIndex(0) -3 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) -4 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) -5 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) -6 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) -7 >Emitted(7, 16) Source(7, 16) + SourceIndex(0) -8 >Emitted(7, 22) Source(7, 22) + SourceIndex(0) -9 >Emitted(7, 23) Source(7, 23) + SourceIndex(0) -10>Emitted(7, 24) Source(8, 1) + SourceIndex(0) -11>Emitted(7, 25) Source(8, 2) + SourceIndex(0) +2 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) +3 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) +4 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) +5 >Emitted(7, 16) Source(7, 16) + SourceIndex(0) +6 >Emitted(7, 22) Source(7, 22) + SourceIndex(0) +7 >Emitted(7, 24) Source(8, 1) + SourceIndex(0) --- >>> WScript.Echo(x2); 1 >^^^^ @@ -197,7 +155,7 @@ sourceFile:sourceMapValidationForIn.ts 6 > ^^ 7 > ^ 8 > ^ -1 > +1 >{ > 2 > WScript 3 > . @@ -216,49 +174,34 @@ sourceFile:sourceMapValidationForIn.ts 8 >Emitted(8, 22) Source(9, 22) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(9, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(10, 2) + SourceIndex(0) + >} +1 >Emitted(9, 2) Source(10, 2) + SourceIndex(0) --- >>>for (x in String) { 1-> -2 >^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^^ -7 > ^^^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^^-> +2 >^^^^^ +3 > ^ +4 > ^^^^ +5 > ^^^^^^ +6 > ^^ +7 > ^^^-> 1-> > -2 >for -3 > -4 > ( -5 > x -6 > in -7 > String -8 > ) -9 > - > -10> { +2 >for ( +3 > x +4 > in +5 > String +6 > ) + > 1->Emitted(10, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(10, 4) Source(11, 4) + SourceIndex(0) -3 >Emitted(10, 5) Source(11, 5) + SourceIndex(0) -4 >Emitted(10, 6) Source(11, 6) + SourceIndex(0) -5 >Emitted(10, 7) Source(11, 7) + SourceIndex(0) -6 >Emitted(10, 11) Source(11, 11) + SourceIndex(0) -7 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) -8 >Emitted(10, 18) Source(11, 18) + SourceIndex(0) -9 >Emitted(10, 19) Source(12, 1) + SourceIndex(0) -10>Emitted(10, 20) Source(12, 2) + SourceIndex(0) +2 >Emitted(10, 6) Source(11, 6) + SourceIndex(0) +3 >Emitted(10, 7) Source(11, 7) + SourceIndex(0) +4 >Emitted(10, 11) Source(11, 11) + SourceIndex(0) +5 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) +6 >Emitted(10, 19) Source(12, 1) + SourceIndex(0) --- >>> WScript.Echo(x); 1->^^^^ @@ -269,7 +212,7 @@ sourceFile:sourceMapValidationForIn.ts 6 > ^ 7 > ^ 8 > ^ -1-> +1->{ > 2 > WScript 3 > . @@ -288,13 +231,10 @@ sourceFile:sourceMapValidationForIn.ts 8 >Emitted(11, 21) Source(13, 21) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(12, 1) Source(14, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(14, 2) + SourceIndex(0) + >} +1 >Emitted(12, 2) Source(14, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationForIn.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map index 0ab0bdac146..e38c75feec0 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationFunctionExpressions.js.map] -{"version":3,"file":"sourceMapValidationFunctionExpressions.js","sourceRoot":"","sources":["sourceMapValidationFunctionExpressions.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,KAAK,GAAG,UAAC,QAAgB;IACzB,SAAS,EAAE,CAAC;IACZ,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC,CAAA;AACD,KAAK,CAAC,OAAO,CAAC,CAAC;AACf,IAAI,aAAa,GAAG,cAAM,OAAA,SAAS,EAAE,EAAX,CAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationFunctionExpressions.js","sourceRoot":"","sources":["sourceMapValidationFunctionExpressions.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,KAAK,GAAG,UAAC,QAAgB;IACzB,SAAS,EAAE,CAAC;IACZ,OAAO,SAAS,CAAC;AACrB,CAAC,CAAA;AACD,KAAK,CAAC,OAAO,CAAC,CAAC;AACf,IAAI,aAAa,GAAG,cAAM,OAAA,SAAS,EAAE,EAAX,CAAW,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt index 722afe1f9d9..c2f41933c26 100644 --- a/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationFunctionExpressions.sourcemap.txt @@ -68,21 +68,18 @@ sourceFile:sourceMapValidationFunctionExpressions.ts --- >>> return greetings; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^ +4 > ^ 1-> > -2 > return -3 > -4 > greetings -5 > ; +2 > return +3 > greetings +4 > ; 1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) -3 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) -4 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) -5 >Emitted(4, 22) Source(4, 22) + SourceIndex(0) +2 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) +3 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) +4 >Emitted(4, 22) Source(4, 22) + SourceIndex(0) --- >>>}; 1 > diff --git a/tests/baselines/reference/sourceMapValidationFunctions.js.map b/tests/baselines/reference/sourceMapValidationFunctions.js.map index a6913fe2369..f3d3a6416aa 100644 --- a/tests/baselines/reference/sourceMapValidationFunctions.js.map +++ b/tests/baselines/reference/sourceMapValidationFunctions.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationFunctions.js.map] -{"version":3,"file":"sourceMapValidationFunctions.js","sourceRoot":"","sources":["sourceMapValidationFunctions.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,eAAe,QAAgB;IAC3B,SAAS,EAAE,CAAC;IACZ,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC;AACD,gBAAgB,QAAgB,EAAE,CAAM,EAAE,CAAU;IAAlB,kBAAA,EAAA,MAAM;IAAc,oBAAuB;SAAvB,UAAuB,EAAvB,qBAAuB,EAAvB,IAAuB;QAAvB,mCAAuB;;IACzE,SAAS,EAAE,CAAC;IACZ,MAAM,CAAC,SAAS,CAAC;AACrB,CAAC;AACD,aAAa,QAAgB,EAAE,CAAM,EAAE,CAAU;IAAlB,kBAAA,EAAA,MAAM;IAAc,oBAAuB;SAAvB,UAAuB,EAAvB,qBAAuB,EAAvB,IAAuB;QAAvB,mCAAuB;;IAEtE,MAAM,CAAC;AACX,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationFunctions.js","sourceRoot":"","sources":["sourceMapValidationFunctions.ts"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,eAAe,QAAgB;IAC3B,SAAS,EAAE,CAAC;IACZ,OAAO,SAAS,CAAC;AACrB,CAAC;AACD,gBAAgB,QAAgB,EAAE,CAAM,EAAE,CAAU;IAAlB,kBAAA,EAAA,MAAM;IAAc,oBAAuB;SAAvB,UAAuB,EAAvB,qBAAuB,EAAvB,IAAuB;QAAvB,mCAAuB;;IACzE,SAAS,EAAE,CAAC;IACZ,OAAO,SAAS,CAAC;AACrB,CAAC;AACD,aAAa,QAAgB,EAAE,CAAM,EAAE,CAAU;IAAlB,kBAAA,EAAA,MAAM;IAAc,oBAAuB;SAAvB,UAAuB,EAAvB,qBAAuB,EAAvB,IAAuB;QAAvB,mCAAuB;;IAEtE,OAAO;AACX,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFunctions.sourcemap.txt b/tests/baselines/reference/sourceMapValidationFunctions.sourcemap.txt index 9dabdf3d8f2..e92fc9ae277 100644 --- a/tests/baselines/reference/sourceMapValidationFunctions.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationFunctions.sourcemap.txt @@ -59,21 +59,18 @@ sourceFile:sourceMapValidationFunctions.ts --- >>> return greetings; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^ +4 > ^ 1-> > -2 > return -3 > -4 > greetings -5 > ; +2 > return +3 > greetings +4 > ; 1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 11) Source(4, 11) + SourceIndex(0) -3 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) -4 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) -5 >Emitted(4, 22) Source(4, 22) + SourceIndex(0) +2 >Emitted(4, 12) Source(4, 12) + SourceIndex(0) +3 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) +4 >Emitted(4, 22) Source(4, 22) + SourceIndex(0) --- >>>} 1 > @@ -180,21 +177,18 @@ sourceFile:sourceMapValidationFunctions.ts --- >>> return greetings; 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^^^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^^^^^^ +4 > ^ 1-> > -2 > return -3 > -4 > greetings -5 > ; +2 > return +3 > greetings +4 > ; 1->Emitted(13, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(13, 11) Source(8, 11) + SourceIndex(0) -3 >Emitted(13, 12) Source(8, 12) + SourceIndex(0) -4 >Emitted(13, 21) Source(8, 21) + SourceIndex(0) -5 >Emitted(13, 22) Source(8, 22) + SourceIndex(0) +2 >Emitted(13, 12) Source(8, 12) + SourceIndex(0) +3 >Emitted(13, 21) Source(8, 21) + SourceIndex(0) +4 >Emitted(13, 22) Source(8, 22) + SourceIndex(0) --- >>>} 1 > @@ -285,16 +279,13 @@ sourceFile:sourceMapValidationFunctions.ts >>> } >>> return; 1 >^^^^ -2 > ^^^^^^ -3 > ^ +2 > ^^^^^^^ 1 >) >{ > -2 > return -3 > ; +2 > return; 1 >Emitted(21, 5) Source(12, 5) + SourceIndex(0) -2 >Emitted(21, 11) Source(12, 11) + SourceIndex(0) -3 >Emitted(21, 12) Source(12, 12) + SourceIndex(0) +2 >Emitted(21, 12) Source(12, 12) + SourceIndex(0) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMapValidationIfElse.js.map b/tests/baselines/reference/sourceMapValidationIfElse.js.map index d0414b5c1a5..a0c71a71bf0 100644 --- a/tests/baselines/reference/sourceMapValidationIfElse.js.map +++ b/tests/baselines/reference/sourceMapValidationIfElse.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationIfElse.js.map] -{"version":3,"file":"sourceMapValidationIfElse.js","sourceRoot":"","sources":["sourceMapValidationIfElse.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACV,CAAC,EAAE,CAAC;AACR,CAAC;AAAC,IAAI,CACN,CAAC;AACD,CAAC;AACD,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CACZ,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC;AACD,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACf,CAAC,EAAE,CAAC;AACR,CAAC;AAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjB,CAAC,IAAI,EAAE,CAAC;AACZ,CAAC;AAAC,IAAI,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC;AACR,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationIfElse.js","sourceRoot":"","sources":["sourceMapValidationIfElse.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,IAAI,CAAC,IAAI,EAAE,EAAE;IACT,CAAC,EAAE,CAAC;CACP;KACD;CACC;AACD,IAAI,CAAC,IAAI,EAAE,EACX;IACI,CAAC,EAAE,CAAC;CACP;KACI,IAAI,CAAC,IAAI,EAAE,EAAE;IACd,CAAC,EAAE,CAAC;CACP;KAAM,IAAI,CAAC,IAAI,EAAE,EAAE;IAChB,CAAC,IAAI,EAAE,CAAC;CACX;KAAM;IACH,CAAC,EAAE,CAAC;CACP"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationIfElse.sourcemap.txt b/tests/baselines/reference/sourceMapValidationIfElse.sourcemap.txt index 100f44400d3..052f6b91052 100644 --- a/tests/baselines/reference/sourceMapValidationIfElse.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationIfElse.sourcemap.txt @@ -31,43 +31,31 @@ sourceFile:sourceMapValidationIfElse.ts --- >>>if (i == 10) { 1-> -2 >^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^^ -7 > ^^ -8 > ^ -9 > ^ -10> ^ +2 >^^^^ +3 > ^ +4 > ^^^^ +5 > ^^ +6 > ^^ 1-> > -2 >if -3 > -4 > ( -5 > i -6 > == -7 > 10 -8 > ) -9 > -10> { +2 >if ( +3 > i +4 > == +5 > 10 +6 > ) 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 3) Source(2, 3) + SourceIndex(0) -3 >Emitted(2, 4) Source(2, 4) + SourceIndex(0) -4 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -5 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) -6 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -7 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -8 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) -9 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) -10>Emitted(2, 15) Source(2, 15) + SourceIndex(0) +2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) +3 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) +4 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) +6 >Emitted(2, 14) Source(2, 14) + SourceIndex(0) --- >>> i++; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > i 3 > ++ @@ -78,80 +66,53 @@ sourceFile:sourceMapValidationIfElse.ts 4 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^-> +1 >^ +2 > ^^^^^^-> 1 > - > -2 >} -1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) + >} +1 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) --- >>>else { -1-> -2 >^^^^ -3 > ^ -4 > ^ -1-> -2 >else -3 > - > -4 > { -1->Emitted(5, 1) Source(4, 3) + SourceIndex(0) -2 >Emitted(5, 5) Source(4, 7) + SourceIndex(0) -3 >Emitted(5, 6) Source(5, 1) + SourceIndex(0) -4 >Emitted(5, 7) Source(5, 2) + SourceIndex(0) +1->^^^^^ +1-> else + > +1->Emitted(5, 6) Source(5, 1) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(6, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) +1 >^ +2 > ^^^^^^^^^^^^^^-> +1 >{ + >} +1 >Emitted(6, 2) Source(6, 2) + SourceIndex(0) --- >>>if (i == 10) { 1-> -2 >^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^^ -7 > ^^ -8 > ^ -9 > ^ -10> ^ +2 >^^^^ +3 > ^ +4 > ^^^^ +5 > ^^ +6 > ^^ 1-> > -2 >if -3 > -4 > ( -5 > i -6 > == -7 > 10 -8 > ) -9 > - > -10> { +2 >if ( +3 > i +4 > == +5 > 10 +6 > ) + > 1->Emitted(7, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(7, 3) Source(7, 3) + SourceIndex(0) -3 >Emitted(7, 4) Source(7, 4) + SourceIndex(0) -4 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) -5 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) -6 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) -7 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) -8 >Emitted(7, 13) Source(7, 13) + SourceIndex(0) -9 >Emitted(7, 14) Source(8, 1) + SourceIndex(0) -10>Emitted(7, 15) Source(8, 2) + SourceIndex(0) +2 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) +3 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) +4 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) +5 >Emitted(7, 12) Source(7, 12) + SourceIndex(0) +6 >Emitted(7, 14) Source(8, 1) + SourceIndex(0) --- >>> i++; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > i 3 > ++ @@ -162,60 +123,39 @@ sourceFile:sourceMapValidationIfElse.ts 4 >Emitted(8, 9) Source(9, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(9, 1) Source(10, 1) + SourceIndex(0) -2 >Emitted(9, 2) Source(10, 2) + SourceIndex(0) + >} +1 >Emitted(9, 2) Source(10, 2) + SourceIndex(0) --- >>>else if (i == 20) { -1-> -2 >^^^^ -3 > ^ -4 > ^^ -5 > ^ -6 > ^ -7 > ^ -8 > ^^^^ -9 > ^^ -10> ^ -11> ^ -12> ^ +1->^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^ +5 > ^^ +6 > ^^ 1-> - > -2 >else -3 > -4 > if -5 > -6 > ( -7 > i -8 > == -9 > 20 -10> ) -11> -12> { -1->Emitted(10, 1) Source(11, 1) + SourceIndex(0) -2 >Emitted(10, 5) Source(11, 5) + SourceIndex(0) -3 >Emitted(10, 6) Source(11, 6) + SourceIndex(0) -4 >Emitted(10, 8) Source(11, 8) + SourceIndex(0) -5 >Emitted(10, 9) Source(11, 9) + SourceIndex(0) -6 >Emitted(10, 10) Source(11, 10) + SourceIndex(0) -7 >Emitted(10, 11) Source(11, 11) + SourceIndex(0) -8 >Emitted(10, 15) Source(11, 15) + SourceIndex(0) -9 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) -10>Emitted(10, 18) Source(11, 18) + SourceIndex(0) -11>Emitted(10, 19) Source(11, 19) + SourceIndex(0) -12>Emitted(10, 20) Source(11, 20) + SourceIndex(0) + >else +2 > if ( +3 > i +4 > == +5 > 20 +6 > ) +1->Emitted(10, 6) Source(11, 6) + SourceIndex(0) +2 >Emitted(10, 10) Source(11, 10) + SourceIndex(0) +3 >Emitted(10, 11) Source(11, 11) + SourceIndex(0) +4 >Emitted(10, 15) Source(11, 15) + SourceIndex(0) +5 >Emitted(10, 17) Source(11, 17) + SourceIndex(0) +6 >Emitted(10, 19) Source(11, 19) + SourceIndex(0) --- >>> i--; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > i 3 > -- @@ -226,52 +166,31 @@ sourceFile:sourceMapValidationIfElse.ts 4 >Emitted(11, 9) Source(12, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(12, 1) Source(13, 1) + SourceIndex(0) -2 >Emitted(12, 2) Source(13, 2) + SourceIndex(0) + >} +1 >Emitted(12, 2) Source(13, 2) + SourceIndex(0) --- >>>else if (i == 30) { -1-> -2 >^^^^ -3 > ^ -4 > ^^ -5 > ^ -6 > ^ -7 > ^ -8 > ^^^^ -9 > ^^ -10> ^ -11> ^ -12> ^ -1-> -2 >else -3 > -4 > if -5 > -6 > ( -7 > i -8 > == -9 > 30 -10> ) -11> -12> { -1->Emitted(13, 1) Source(13, 3) + SourceIndex(0) -2 >Emitted(13, 5) Source(13, 7) + SourceIndex(0) -3 >Emitted(13, 6) Source(13, 8) + SourceIndex(0) -4 >Emitted(13, 8) Source(13, 10) + SourceIndex(0) -5 >Emitted(13, 9) Source(13, 11) + SourceIndex(0) -6 >Emitted(13, 10) Source(13, 12) + SourceIndex(0) -7 >Emitted(13, 11) Source(13, 13) + SourceIndex(0) -8 >Emitted(13, 15) Source(13, 17) + SourceIndex(0) -9 >Emitted(13, 17) Source(13, 19) + SourceIndex(0) -10>Emitted(13, 18) Source(13, 20) + SourceIndex(0) -11>Emitted(13, 19) Source(13, 21) + SourceIndex(0) -12>Emitted(13, 20) Source(13, 22) + SourceIndex(0) +1->^^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^^ +5 > ^^ +6 > ^^ +1-> else +2 > if ( +3 > i +4 > == +5 > 30 +6 > ) +1->Emitted(13, 6) Source(13, 8) + SourceIndex(0) +2 >Emitted(13, 10) Source(13, 12) + SourceIndex(0) +3 >Emitted(13, 11) Source(13, 13) + SourceIndex(0) +4 >Emitted(13, 15) Source(13, 17) + SourceIndex(0) +5 >Emitted(13, 17) Source(13, 19) + SourceIndex(0) +6 >Emitted(13, 19) Source(13, 21) + SourceIndex(0) --- >>> i += 70; 1 >^^^^ @@ -279,7 +198,7 @@ sourceFile:sourceMapValidationIfElse.ts 3 > ^^^^ 4 > ^^ 5 > ^ -1 > +1 >{ > 2 > i 3 > += @@ -292,36 +211,24 @@ sourceFile:sourceMapValidationIfElse.ts 5 >Emitted(14, 13) Source(14, 13) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^-> +1 >^ +2 > ^^^^^^-> 1 > - > -2 >} -1 >Emitted(15, 1) Source(15, 1) + SourceIndex(0) -2 >Emitted(15, 2) Source(15, 2) + SourceIndex(0) + >} +1 >Emitted(15, 2) Source(15, 2) + SourceIndex(0) --- >>>else { -1-> -2 >^^^^ -3 > ^ -4 > ^ -5 > ^^^-> -1-> -2 >else -3 > -4 > { -1->Emitted(16, 1) Source(15, 3) + SourceIndex(0) -2 >Emitted(16, 5) Source(15, 7) + SourceIndex(0) -3 >Emitted(16, 6) Source(15, 8) + SourceIndex(0) -4 >Emitted(16, 7) Source(15, 9) + SourceIndex(0) +1->^^^^^ +2 > ^^^^-> +1-> else +1->Emitted(16, 6) Source(15, 8) + SourceIndex(0) --- >>> i--; 1->^^^^ 2 > ^ 3 > ^^ 4 > ^ -1-> +1->{ > 2 > i 3 > -- @@ -332,13 +239,10 @@ sourceFile:sourceMapValidationIfElse.ts 4 >Emitted(17, 9) Source(16, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(18, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(18, 2) Source(17, 2) + SourceIndex(0) + >} +1 >Emitted(18, 2) Source(17, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationIfElse.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationModule.js.map b/tests/baselines/reference/sourceMapValidationModule.js.map index 357f455d4fd..d6da3e1b363 100644 --- a/tests/baselines/reference/sourceMapValidationModule.js.map +++ b/tests/baselines/reference/sourceMapValidationModule.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationModule.js.map] -{"version":3,"file":"sourceMapValidationModule.js","sourceRoot":"","sources":["sourceMapValidationModule.ts"],"names":[],"mappings":"AAAA,IAAO,EAAE,CAGR;AAHD,WAAO,EAAE;IACL,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,EAAE,CAAC;AACR,CAAC,EAHM,EAAE,KAAF,EAAE,QAGR;AACD,IAAO,EAAE,CAQR;AARD,WAAO,EAAE;IACL,IAAO,EAAE,CAER;IAFD,WAAO,EAAE;QACM,IAAC,GAAG,EAAE,CAAC;IACtB,CAAC,EAFM,EAAE,KAAF,EAAE,QAER;IAED;QACI,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAChB,CAAC;IAFe,MAAG,MAElB,CAAA;AACL,CAAC,EARM,EAAE,KAAF,EAAE,QAQR"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationModule.js","sourceRoot":"","sources":["sourceMapValidationModule.ts"],"names":[],"mappings":"AAAA,IAAO,EAAE,CAGR;AAHD,WAAO,EAAE;IACL,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,EAAE,CAAC;AACR,CAAC,EAHM,EAAE,KAAF,EAAE,QAGR;AACD,IAAO,EAAE,CAQR;AARD,WAAO,EAAE;IACL,IAAO,EAAE,CAER;IAFD,WAAO,EAAE;QACM,IAAC,GAAG,EAAE,CAAC;IACtB,CAAC,EAFM,EAAE,KAAF,EAAE,QAER;IAED;QACI,OAAO,EAAE,CAAC,CAAC,CAAC;IAChB,CAAC;IAFe,MAAG,MAElB,CAAA;AACL,CAAC,EARM,EAAE,KAAF,EAAE,QAQR"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationModule.sourcemap.txt b/tests/baselines/reference/sourceMapValidationModule.sourcemap.txt index 3b2174a7310..04e3935a0d6 100644 --- a/tests/baselines/reference/sourceMapValidationModule.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationModule.sourcemap.txt @@ -222,27 +222,24 @@ sourceFile:sourceMapValidationModule.ts --- >>> return m4.x; 1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^ -5 > ^ -6 > ^ -7 > ^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ +5 > ^ +6 > ^ 1->export function foo() { > -2 > return -3 > -4 > m4 -5 > . -6 > x -7 > ; +2 > return +3 > m4 +4 > . +5 > x +6 > ; 1->Emitted(13, 9) Source(11, 9) + SourceIndex(0) -2 >Emitted(13, 15) Source(11, 15) + SourceIndex(0) -3 >Emitted(13, 16) Source(11, 16) + SourceIndex(0) -4 >Emitted(13, 18) Source(11, 18) + SourceIndex(0) -5 >Emitted(13, 19) Source(11, 19) + SourceIndex(0) -6 >Emitted(13, 20) Source(11, 20) + SourceIndex(0) -7 >Emitted(13, 21) Source(11, 21) + SourceIndex(0) +2 >Emitted(13, 16) Source(11, 16) + SourceIndex(0) +3 >Emitted(13, 18) Source(11, 18) + SourceIndex(0) +4 >Emitted(13, 19) Source(11, 19) + SourceIndex(0) +5 >Emitted(13, 20) Source(11, 20) + SourceIndex(0) +6 >Emitted(13, 21) Source(11, 21) + SourceIndex(0) --- >>> } 1 >^^^^ diff --git a/tests/baselines/reference/sourceMapValidationStatements.js.map b/tests/baselines/reference/sourceMapValidationStatements.js.map index 40d65e0106c..307db0e4b43 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.js.map +++ b/tests/baselines/reference/sourceMapValidationStatements.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationStatements.js.map] -{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":[],"mappings":"AAAA;IACI,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1B,CAAC,IAAI,CAAC,CAAC;QACP,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACT,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,CAAC,IAAI,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;IACR,CAAC;IACD,IAAI,CAAC,GAAG;QACJ,CAAC;QACD,CAAC;QACD,CAAC;KACJ,CAAC;IACF,IAAI,GAAG,GAAG;QACN,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,OAAO;KACb,CAAC;IACF,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACD,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;IACnB,CAAC;IAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACb,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAClB,CAAC;IACL,CAAC;IACD,IAAI,CAAC;QACD,MAAM,IAAI,KAAK,EAAE,CAAC;IACtB,CAAC;IAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACV,IAAI,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;YAAS,CAAC;QACP,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,GAAG,EAAE,CAAC;QACR,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACZ,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,KAAK,CAAC,EAAE,CAAC;YACL,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QAEV,CAAC;QACD,SAAS,CAAC;YACN,CAAC,IAAI,CAAC,CAAC;YACP,CAAC,GAAG,EAAE,CAAC;YACP,KAAK,CAAC;QAEV,CAAC;IACL,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;QACZ,CAAC,EAAE,CAAC;IACR,CAAC;IACD,GAAG,CAAC;QACA,CAAC,EAAE,CAAC;IACR,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAC;IACf,CAAC,GAAG,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,KAAK,CAAC,CAAC;IACR,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,CAAC;AACX,CAAC;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationStatements.js","sourceRoot":"","sources":["sourceMapValidationStatements.ts"],"names":[],"mappings":"AAAA;IACI,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;QACzB,CAAC,IAAI,CAAC,CAAC;QACP,CAAC,IAAI,CAAC,CAAC;KACV;IACD,IAAI,CAAC,GAAG,EAAE,EAAE;QACR,CAAC,IAAI,CAAC,CAAC;KACV;SAAM;QACH,CAAC,IAAI,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;KACP;IACD,IAAI,CAAC,GAAG;QACJ,CAAC;QACD,CAAC;QACD,CAAC;KACJ,CAAC;IACF,IAAI,GAAG,GAAG;QACN,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,OAAO;KACb,CAAC;IACF,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE;QACb,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,EAAE,CAAC;KACd;IACD,IAAI;QACA,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;KAClB;IAAC,OAAO,CAAC,EAAE;QACR,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACZ,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;SACd;aAAM;YACH,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;SACjB;KACJ;IACD,IAAI;QACA,MAAM,IAAI,KAAK,EAAE,CAAC;KACrB;IAAC,OAAO,EAAE,EAAE;QACT,IAAI,CAAC,GAAG,EAAE,CAAC;KACd;YAAS;QACN,CAAC,GAAG,EAAE,CAAC;KACV;IACD,MAAM,GAAG,EAAE;QACP,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,EAAE,CAAC;KACV;IACD,QAAQ,GAAG,CAAC,CAAC,EAAE;QACX,KAAK,CAAC,CAAC,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,MAAM;SAET;QACD,KAAK,CAAC,CAAC,CAAC;YACJ,CAAC,EAAE,CAAC;YACJ,MAAM;SAET;QACD,OAAO,CAAC,CAAC;YACL,CAAC,IAAI,CAAC,CAAC;YACP,CAAC,GAAG,EAAE,CAAC;YACP,MAAM;SAET;KACJ;IACD,OAAO,CAAC,GAAG,EAAE,EAAE;QACX,CAAC,EAAE,CAAC;KACP;IACD,GAAG;QACC,CAAC,EAAE,CAAC;KACP,QAAQ,CAAC,GAAG,CAAC,EAAC;IACf,CAAC,GAAG,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC,KAAK,CAAC,CAAC;IACR,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO;AACX,CAAC;AACD,IAAI,CAAC,GAAG;IACJ,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC;AACF,CAAC,EAAE,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt index aec7eaafc06..60cf0af5caf 100644 --- a/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationStatements.sourcemap.txt @@ -54,57 +54,48 @@ sourceFile:sourceMapValidationStatements.ts --- >>> for (var i = 0; i < 10; i++) { 1->^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^ -9 > ^^ -10> ^ -11> ^^^ -12> ^^ -13> ^^ -14> ^ -15> ^^ -16> ^^ -17> ^ +2 > ^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^ +6 > ^ +7 > ^^ +8 > ^ +9 > ^^^ +10> ^^ +11> ^^ +12> ^ +13> ^^ +14> ^^ 1-> > -2 > for -3 > -4 > ( -5 > var -6 > i -7 > = -8 > 0 -9 > ; -10> i -11> < -12> 10 -13> ; -14> i -15> ++ -16> ) -17> { +2 > for ( +3 > var +4 > i +5 > = +6 > 0 +7 > ; +8 > i +9 > < +10> 10 +11> ; +12> i +13> ++ +14> ) 1->Emitted(4, 5) Source(4, 5) + SourceIndex(0) -2 >Emitted(4, 8) Source(4, 8) + SourceIndex(0) -3 >Emitted(4, 9) Source(4, 9) + SourceIndex(0) -4 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) -5 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) -6 >Emitted(4, 15) Source(4, 15) + SourceIndex(0) -7 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) -8 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) -9 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) -10>Emitted(4, 22) Source(4, 22) + SourceIndex(0) -11>Emitted(4, 25) Source(4, 25) + SourceIndex(0) -12>Emitted(4, 27) Source(4, 27) + SourceIndex(0) -13>Emitted(4, 29) Source(4, 29) + SourceIndex(0) -14>Emitted(4, 30) Source(4, 30) + SourceIndex(0) -15>Emitted(4, 32) Source(4, 32) + SourceIndex(0) -16>Emitted(4, 34) Source(4, 34) + SourceIndex(0) -17>Emitted(4, 35) Source(4, 35) + SourceIndex(0) +2 >Emitted(4, 10) Source(4, 10) + SourceIndex(0) +3 >Emitted(4, 14) Source(4, 14) + SourceIndex(0) +4 >Emitted(4, 15) Source(4, 15) + SourceIndex(0) +5 >Emitted(4, 18) Source(4, 18) + SourceIndex(0) +6 >Emitted(4, 19) Source(4, 19) + SourceIndex(0) +7 >Emitted(4, 21) Source(4, 21) + SourceIndex(0) +8 >Emitted(4, 22) Source(4, 22) + SourceIndex(0) +9 >Emitted(4, 25) Source(4, 25) + SourceIndex(0) +10>Emitted(4, 27) Source(4, 27) + SourceIndex(0) +11>Emitted(4, 29) Source(4, 29) + SourceIndex(0) +12>Emitted(4, 30) Source(4, 30) + SourceIndex(0) +13>Emitted(4, 32) Source(4, 32) + SourceIndex(0) +14>Emitted(4, 34) Source(4, 34) + SourceIndex(0) --- >>> x += i; 1 >^^^^^^^^ @@ -113,7 +104,7 @@ sourceFile:sourceMapValidationStatements.ts 4 > ^ 5 > ^ 6 > ^-> -1 > +1 >{ > 2 > x 3 > += @@ -144,47 +135,32 @@ sourceFile:sourceMapValidationStatements.ts 5 >Emitted(6, 16) Source(6, 16) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(7, 5) Source(7, 5) + SourceIndex(0) -2 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) + > } +1 >Emitted(7, 6) Source(7, 6) + SourceIndex(0) --- >>> if (x > 17) { 1->^^^^ -2 > ^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^ -7 > ^^ -8 > ^ -9 > ^ -10> ^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^ +6 > ^^ 1-> > -2 > if -3 > -4 > ( -5 > x -6 > > -7 > 17 -8 > ) -9 > -10> { +2 > if ( +3 > x +4 > > +5 > 17 +6 > ) 1->Emitted(8, 5) Source(8, 5) + SourceIndex(0) -2 >Emitted(8, 7) Source(8, 7) + SourceIndex(0) -3 >Emitted(8, 8) Source(8, 8) + SourceIndex(0) -4 >Emitted(8, 9) Source(8, 9) + SourceIndex(0) -5 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) -6 >Emitted(8, 13) Source(8, 13) + SourceIndex(0) -7 >Emitted(8, 15) Source(8, 15) + SourceIndex(0) -8 >Emitted(8, 16) Source(8, 16) + SourceIndex(0) -9 >Emitted(8, 17) Source(8, 17) + SourceIndex(0) -10>Emitted(8, 18) Source(8, 18) + SourceIndex(0) +2 >Emitted(8, 9) Source(8, 9) + SourceIndex(0) +3 >Emitted(8, 10) Source(8, 10) + SourceIndex(0) +4 >Emitted(8, 13) Source(8, 13) + SourceIndex(0) +5 >Emitted(8, 15) Source(8, 15) + SourceIndex(0) +6 >Emitted(8, 17) Source(8, 17) + SourceIndex(0) --- >>> x /= 9; 1 >^^^^^^^^ @@ -192,7 +168,7 @@ sourceFile:sourceMapValidationStatements.ts 3 > ^^^^ 4 > ^ 5 > ^ -1 > +1 >{ > 2 > x 3 > /= @@ -205,29 +181,17 @@ sourceFile:sourceMapValidationStatements.ts 5 >Emitted(9, 16) Source(9, 16) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^-> +1 >^^^^^ +2 > ^^^^^^-> 1 > - > -2 > } -1 >Emitted(10, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(10, 6) Source(10, 6) + SourceIndex(0) + > } +1 >Emitted(10, 6) Source(10, 6) + SourceIndex(0) --- >>> else { -1->^^^^ -2 > ^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^-> -1-> -2 > else -3 > -4 > { -1->Emitted(11, 5) Source(10, 7) + SourceIndex(0) -2 >Emitted(11, 9) Source(10, 11) + SourceIndex(0) -3 >Emitted(11, 10) Source(10, 12) + SourceIndex(0) -4 >Emitted(11, 11) Source(10, 13) + SourceIndex(0) +1->^^^^^^^^^ +2 > ^^^^^^^^-> +1-> else +1->Emitted(11, 10) Source(10, 12) + SourceIndex(0) --- >>> x += 10; 1->^^^^^^^^ @@ -235,7 +199,7 @@ sourceFile:sourceMapValidationStatements.ts 3 > ^^^^ 4 > ^^ 5 > ^ -1-> +1->{ > 2 > x 3 > += @@ -263,14 +227,11 @@ sourceFile:sourceMapValidationStatements.ts 4 >Emitted(13, 13) Source(12, 13) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(14, 5) Source(13, 5) + SourceIndex(0) -2 >Emitted(14, 6) Source(13, 6) + SourceIndex(0) + > } +1 >Emitted(14, 6) Source(13, 6) + SourceIndex(0) --- >>> var a = [ 1->^^^^ @@ -384,42 +345,31 @@ sourceFile:sourceMapValidationStatements.ts --- >>> for (var j in a) { 1->^^^^ -2 > ^^^ -3 > ^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^ -10> ^ -11> ^ +2 > ^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^ +6 > ^ +7 > ^^ +8 > ^-> 1-> > -2 > for -3 > -4 > ( -5 > var -6 > j -7 > in -8 > a -9 > ) -10> -11> { +2 > for ( +3 > var +4 > j +5 > in +6 > a +7 > ) 1->Emitted(24, 5) Source(23, 5) + SourceIndex(0) -2 >Emitted(24, 8) Source(23, 8) + SourceIndex(0) -3 >Emitted(24, 9) Source(23, 9) + SourceIndex(0) -4 >Emitted(24, 10) Source(23, 10) + SourceIndex(0) -5 >Emitted(24, 14) Source(23, 14) + SourceIndex(0) -6 >Emitted(24, 15) Source(23, 15) + SourceIndex(0) -7 >Emitted(24, 19) Source(23, 19) + SourceIndex(0) -8 >Emitted(24, 20) Source(23, 20) + SourceIndex(0) -9 >Emitted(24, 21) Source(23, 21) + SourceIndex(0) -10>Emitted(24, 22) Source(23, 22) + SourceIndex(0) -11>Emitted(24, 23) Source(23, 23) + SourceIndex(0) +2 >Emitted(24, 10) Source(23, 10) + SourceIndex(0) +3 >Emitted(24, 14) Source(23, 14) + SourceIndex(0) +4 >Emitted(24, 15) Source(23, 15) + SourceIndex(0) +5 >Emitted(24, 19) Source(23, 19) + SourceIndex(0) +6 >Emitted(24, 20) Source(23, 20) + SourceIndex(0) +7 >Emitted(24, 22) Source(23, 22) + SourceIndex(0) --- >>> obj.z = a[j]; -1 >^^^^^^^^ +1->^^^^^^^^ 2 > ^^^ 3 > ^ 4 > ^ @@ -429,7 +379,7 @@ sourceFile:sourceMapValidationStatements.ts 8 > ^ 9 > ^ 10> ^ -1 > +1->{ > 2 > obj 3 > . @@ -440,7 +390,7 @@ sourceFile:sourceMapValidationStatements.ts 8 > j 9 > ] 10> ; -1 >Emitted(25, 9) Source(24, 9) + SourceIndex(0) +1->Emitted(25, 9) Source(24, 9) + SourceIndex(0) 2 >Emitted(25, 12) Source(24, 12) + SourceIndex(0) 3 >Emitted(25, 13) Source(24, 13) + SourceIndex(0) 4 >Emitted(25, 14) Source(24, 14) + SourceIndex(0) @@ -473,27 +423,21 @@ sourceFile:sourceMapValidationStatements.ts 6 >Emitted(26, 20) Source(25, 20) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^-> +1 >^^^^^ +2 > ^^^^^-> 1 > - > -2 > } -1 >Emitted(27, 5) Source(26, 5) + SourceIndex(0) -2 >Emitted(27, 6) Source(26, 6) + SourceIndex(0) + > } +1 >Emitted(27, 6) Source(26, 6) + SourceIndex(0) --- >>> try { 1->^^^^ 2 > ^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^-> 1-> > 2 > try -3 > { 1->Emitted(28, 5) Source(27, 5) + SourceIndex(0) 2 >Emitted(28, 9) Source(27, 9) + SourceIndex(0) -3 >Emitted(28, 10) Source(27, 10) + SourceIndex(0) --- >>> obj.q = "ohhh"; 1->^^^^^^^^ @@ -503,7 +447,7 @@ sourceFile:sourceMapValidationStatements.ts 5 > ^^^ 6 > ^^^^^^ 7 > ^ -1-> +1->{ > 2 > obj 3 > . @@ -520,80 +464,53 @@ sourceFile:sourceMapValidationStatements.ts 7 >Emitted(29, 24) Source(28, 24) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(30, 5) Source(29, 5) + SourceIndex(0) -2 >Emitted(30, 6) Source(29, 6) + SourceIndex(0) + > } +1 >Emitted(30, 6) Source(29, 6) + SourceIndex(0) --- >>> catch (e) { 1->^^^^ -2 > ^^^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^^^^^^^^-> +2 > ^^^^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^^^^^^^^-> 1-> -2 > catch -3 > -4 > ( -5 > e -6 > ) -7 > -8 > { +2 > catch ( +3 > e +4 > ) 1->Emitted(31, 5) Source(29, 7) + SourceIndex(0) -2 >Emitted(31, 10) Source(29, 12) + SourceIndex(0) -3 >Emitted(31, 11) Source(29, 13) + SourceIndex(0) -4 >Emitted(31, 12) Source(29, 14) + SourceIndex(0) -5 >Emitted(31, 13) Source(29, 15) + SourceIndex(0) -6 >Emitted(31, 14) Source(29, 16) + SourceIndex(0) -7 >Emitted(31, 15) Source(29, 17) + SourceIndex(0) -8 >Emitted(31, 16) Source(29, 18) + SourceIndex(0) +2 >Emitted(31, 12) Source(29, 14) + SourceIndex(0) +3 >Emitted(31, 13) Source(29, 15) + SourceIndex(0) +4 >Emitted(31, 15) Source(29, 17) + SourceIndex(0) --- >>> if (obj.z < 10) { 1->^^^^^^^^ -2 > ^^ -3 > ^ -4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^^^ -9 > ^^ -10> ^ -11> ^ -12> ^ -1-> +2 > ^^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^^ +8 > ^^ +1->{ > -2 > if -3 > -4 > ( -5 > obj -6 > . -7 > z -8 > < -9 > 10 -10> ) -11> -12> { +2 > if ( +3 > obj +4 > . +5 > z +6 > < +7 > 10 +8 > ) 1->Emitted(32, 9) Source(30, 9) + SourceIndex(0) -2 >Emitted(32, 11) Source(30, 11) + SourceIndex(0) -3 >Emitted(32, 12) Source(30, 12) + SourceIndex(0) -4 >Emitted(32, 13) Source(30, 13) + SourceIndex(0) -5 >Emitted(32, 16) Source(30, 16) + SourceIndex(0) -6 >Emitted(32, 17) Source(30, 17) + SourceIndex(0) -7 >Emitted(32, 18) Source(30, 18) + SourceIndex(0) -8 >Emitted(32, 21) Source(30, 21) + SourceIndex(0) -9 >Emitted(32, 23) Source(30, 23) + SourceIndex(0) -10>Emitted(32, 24) Source(30, 24) + SourceIndex(0) -11>Emitted(32, 25) Source(30, 25) + SourceIndex(0) -12>Emitted(32, 26) Source(30, 26) + SourceIndex(0) +2 >Emitted(32, 13) Source(30, 13) + SourceIndex(0) +3 >Emitted(32, 16) Source(30, 16) + SourceIndex(0) +4 >Emitted(32, 17) Source(30, 17) + SourceIndex(0) +5 >Emitted(32, 18) Source(30, 18) + SourceIndex(0) +6 >Emitted(32, 21) Source(30, 21) + SourceIndex(0) +7 >Emitted(32, 23) Source(30, 23) + SourceIndex(0) +8 >Emitted(32, 25) Source(30, 25) + SourceIndex(0) --- >>> obj.z = 12; 1 >^^^^^^^^^^^^ @@ -603,7 +520,7 @@ sourceFile:sourceMapValidationStatements.ts 5 > ^^^ 6 > ^^ 7 > ^ -1 > +1 >{ > 2 > obj 3 > . @@ -620,29 +537,17 @@ sourceFile:sourceMapValidationStatements.ts 7 >Emitted(33, 24) Source(31, 24) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^-> +1 >^^^^^^^^^ +2 > ^^^^^^-> 1 > - > -2 > } -1 >Emitted(34, 9) Source(32, 9) + SourceIndex(0) -2 >Emitted(34, 10) Source(32, 10) + SourceIndex(0) + > } +1 >Emitted(34, 10) Source(32, 10) + SourceIndex(0) --- >>> else { -1->^^^^^^^^ -2 > ^^^^ -3 > ^ -4 > ^ -5 > ^^^^^^^^^^^^^-> -1-> -2 > else -3 > -4 > { -1->Emitted(35, 9) Source(32, 11) + SourceIndex(0) -2 >Emitted(35, 13) Source(32, 15) + SourceIndex(0) -3 >Emitted(35, 14) Source(32, 16) + SourceIndex(0) -4 >Emitted(35, 15) Source(32, 17) + SourceIndex(0) +1->^^^^^^^^^^^^^ +2 > ^^^^^^^^^^^^^^-> +1-> else +1->Emitted(35, 14) Source(32, 16) + SourceIndex(0) --- >>> obj.q = "hmm"; 1->^^^^^^^^^^^^ @@ -652,7 +557,7 @@ sourceFile:sourceMapValidationStatements.ts 5 > ^^^ 6 > ^^^^^ 7 > ^ -1-> +1->{ > 2 > obj 3 > . @@ -669,36 +574,27 @@ sourceFile:sourceMapValidationStatements.ts 7 >Emitted(36, 27) Source(33, 27) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ +1 >^^^^^^^^^ 1 > - > -2 > } -1 >Emitted(37, 9) Source(34, 9) + SourceIndex(0) -2 >Emitted(37, 10) Source(34, 10) + SourceIndex(0) + > } +1 >Emitted(37, 10) Source(34, 10) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^-> +1 >^^^^^ +2 > ^^^^^-> 1 > - > -2 > } -1 >Emitted(38, 5) Source(35, 5) + SourceIndex(0) -2 >Emitted(38, 6) Source(35, 6) + SourceIndex(0) + > } +1 >Emitted(38, 6) Source(35, 6) + SourceIndex(0) --- >>> try { 1->^^^^ 2 > ^^^^ -3 > ^ -4 > ^^^^^^^^^^^^^^^^^^-> +3 > ^^^^^^^^^^^^^^^^^^^-> 1-> > 2 > try -3 > { 1->Emitted(39, 5) Source(36, 5) + SourceIndex(0) 2 >Emitted(39, 9) Source(36, 9) + SourceIndex(0) -3 >Emitted(39, 10) Source(36, 10) + SourceIndex(0) --- >>> throw new Error(); 1->^^^^^^^^ @@ -707,7 +603,7 @@ sourceFile:sourceMapValidationStatements.ts 4 > ^^^^^ 5 > ^^ 6 > ^ -1-> +1->{ > 2 > throw 3 > new @@ -722,41 +618,26 @@ sourceFile:sourceMapValidationStatements.ts 6 >Emitted(40, 27) Source(37, 27) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(41, 5) Source(38, 5) + SourceIndex(0) -2 >Emitted(41, 6) Source(38, 6) + SourceIndex(0) + > } +1 >Emitted(41, 6) Source(38, 6) + SourceIndex(0) --- >>> catch (e1) { 1->^^^^ -2 > ^^^^^ -3 > ^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^-> +2 > ^^^^^^^ +3 > ^^ +4 > ^^ +5 > ^^^^^-> 1-> -2 > catch -3 > -4 > ( -5 > e1 -6 > ) -7 > -8 > { +2 > catch ( +3 > e1 +4 > ) 1->Emitted(42, 5) Source(38, 7) + SourceIndex(0) -2 >Emitted(42, 10) Source(38, 12) + SourceIndex(0) -3 >Emitted(42, 11) Source(38, 13) + SourceIndex(0) -4 >Emitted(42, 12) Source(38, 14) + SourceIndex(0) -5 >Emitted(42, 14) Source(38, 16) + SourceIndex(0) -6 >Emitted(42, 15) Source(38, 17) + SourceIndex(0) -7 >Emitted(42, 16) Source(38, 18) + SourceIndex(0) -8 >Emitted(42, 17) Source(38, 19) + SourceIndex(0) +2 >Emitted(42, 12) Source(38, 14) + SourceIndex(0) +3 >Emitted(42, 14) Source(38, 16) + SourceIndex(0) +4 >Emitted(42, 16) Source(38, 18) + SourceIndex(0) --- >>> var b = e1; 1->^^^^^^^^ @@ -765,7 +646,7 @@ sourceFile:sourceMapValidationStatements.ts 4 > ^^^ 5 > ^^ 6 > ^ -1-> +1->{ > 2 > var 3 > b @@ -780,23 +661,17 @@ sourceFile:sourceMapValidationStatements.ts 6 >Emitted(43, 20) Source(39, 20) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(44, 5) Source(40, 5) + SourceIndex(0) -2 >Emitted(44, 6) Source(40, 6) + SourceIndex(0) + > } +1 >Emitted(44, 6) Source(40, 6) + SourceIndex(0) --- >>> finally { 1->^^^^^^^^^^^^ -2 > ^ -3 > ^^^-> +2 > ^^^^-> 1-> finally -2 > { 1->Emitted(45, 13) Source(40, 15) + SourceIndex(0) -2 >Emitted(45, 14) Source(40, 16) + SourceIndex(0) --- >>> y = 70; 1->^^^^^^^^ @@ -804,7 +679,7 @@ sourceFile:sourceMapValidationStatements.ts 3 > ^^^ 4 > ^^ 5 > ^ -1-> +1->{ > 2 > y 3 > = @@ -817,32 +692,26 @@ sourceFile:sourceMapValidationStatements.ts 5 >Emitted(46, 16) Source(41, 16) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(47, 5) Source(42, 5) + SourceIndex(0) -2 >Emitted(47, 6) Source(42, 6) + SourceIndex(0) + > } +1 >Emitted(47, 6) Source(42, 6) + SourceIndex(0) --- >>> with (obj) { 1->^^^^ 2 > ^^^^^^ 3 > ^^^ 4 > ^^ -5 > ^ 1-> > 2 > with ( 3 > obj 4 > ) -5 > { 1->Emitted(48, 5) Source(43, 5) + SourceIndex(0) 2 >Emitted(48, 11) Source(43, 11) + SourceIndex(0) 3 >Emitted(48, 14) Source(43, 14) + SourceIndex(0) 4 >Emitted(48, 16) Source(43, 16) + SourceIndex(0) -5 >Emitted(48, 17) Source(43, 17) + SourceIndex(0) --- >>> i = 2; 1 >^^^^^^^^ @@ -851,7 +720,7 @@ sourceFile:sourceMapValidationStatements.ts 4 > ^ 5 > ^ 6 > ^^-> -1 > +1 >{ > 2 > i 3 > = @@ -882,174 +751,152 @@ sourceFile:sourceMapValidationStatements.ts 5 >Emitted(50, 16) Source(45, 16) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(51, 5) Source(46, 5) + SourceIndex(0) -2 >Emitted(51, 6) Source(46, 6) + SourceIndex(0) + > } +1 >Emitted(51, 6) Source(46, 6) + SourceIndex(0) --- >>> switch (obj.z) { 1->^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^ -5 > ^^^ -6 > ^ -7 > ^ -8 > ^ -9 > ^ -10> ^ +2 > ^^^^^^^^ +3 > ^^^ +4 > ^ +5 > ^ +6 > ^^ 1-> > -2 > switch -3 > -4 > ( -5 > obj -6 > . -7 > z -8 > ) -9 > -10> { +2 > switch ( +3 > obj +4 > . +5 > z +6 > ) 1->Emitted(52, 5) Source(47, 5) + SourceIndex(0) -2 >Emitted(52, 11) Source(47, 11) + SourceIndex(0) -3 >Emitted(52, 12) Source(47, 12) + SourceIndex(0) -4 >Emitted(52, 13) Source(47, 13) + SourceIndex(0) -5 >Emitted(52, 16) Source(47, 16) + SourceIndex(0) -6 >Emitted(52, 17) Source(47, 17) + SourceIndex(0) -7 >Emitted(52, 18) Source(47, 18) + SourceIndex(0) -8 >Emitted(52, 19) Source(47, 19) + SourceIndex(0) -9 >Emitted(52, 20) Source(47, 20) + SourceIndex(0) -10>Emitted(52, 21) Source(47, 21) + SourceIndex(0) +2 >Emitted(52, 13) Source(47, 13) + SourceIndex(0) +3 >Emitted(52, 16) Source(47, 16) + SourceIndex(0) +4 >Emitted(52, 17) Source(47, 17) + SourceIndex(0) +5 >Emitted(52, 18) Source(47, 18) + SourceIndex(0) +6 >Emitted(52, 20) Source(47, 20) + SourceIndex(0) --- >>> case 0: { 1 >^^^^^^^^ 2 > ^^^^^ 3 > ^ -4 > ^^ -5 > ^ -1 > +4 > ^ +5 > ^ +6 > ^-> +1 >{ > 2 > case 3 > 0 -4 > : -5 > { +4 > : +5 > 1 >Emitted(53, 9) Source(48, 9) + SourceIndex(0) 2 >Emitted(53, 14) Source(48, 14) + SourceIndex(0) 3 >Emitted(53, 15) Source(48, 15) + SourceIndex(0) -4 >Emitted(53, 17) Source(48, 17) + SourceIndex(0) -5 >Emitted(53, 18) Source(48, 18) + SourceIndex(0) +4 >Emitted(53, 16) Source(48, 16) + SourceIndex(0) +5 >Emitted(53, 17) Source(48, 17) + SourceIndex(0) --- >>> x++; -1 >^^^^^^^^^^^^ +1->^^^^^^^^^^^^ 2 > ^ 3 > ^^ 4 > ^ 5 > ^^^-> -1 > +1->{ > 2 > x 3 > ++ 4 > ; -1 >Emitted(54, 13) Source(49, 13) + SourceIndex(0) +1->Emitted(54, 13) Source(49, 13) + SourceIndex(0) 2 >Emitted(54, 14) Source(49, 14) + SourceIndex(0) 3 >Emitted(54, 16) Source(49, 16) + SourceIndex(0) 4 >Emitted(54, 17) Source(49, 17) + SourceIndex(0) --- >>> break; 1->^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1-> > -2 > break -3 > ; +2 > break; 1->Emitted(55, 13) Source(50, 13) + SourceIndex(0) -2 >Emitted(55, 18) Source(50, 18) + SourceIndex(0) -3 >Emitted(55, 19) Source(50, 19) + SourceIndex(0) +2 >Emitted(55, 19) Source(50, 19) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^-> +1 >^^^^^^^^^ +2 > ^^^^^^^^^-> 1 > > - > -2 > } -1 >Emitted(56, 9) Source(52, 9) + SourceIndex(0) -2 >Emitted(56, 10) Source(52, 10) + SourceIndex(0) + > } +1 >Emitted(56, 10) Source(52, 10) + SourceIndex(0) --- >>> case 1: { 1->^^^^^^^^ 2 > ^^^^^ 3 > ^ -4 > ^^ -5 > ^ +4 > ^ +5 > ^ +6 > ^-> 1-> > 2 > case 3 > 1 -4 > : -5 > { +4 > : +5 > 1->Emitted(57, 9) Source(53, 9) + SourceIndex(0) 2 >Emitted(57, 14) Source(53, 14) + SourceIndex(0) 3 >Emitted(57, 15) Source(53, 15) + SourceIndex(0) -4 >Emitted(57, 17) Source(53, 17) + SourceIndex(0) -5 >Emitted(57, 18) Source(53, 18) + SourceIndex(0) +4 >Emitted(57, 16) Source(53, 16) + SourceIndex(0) +5 >Emitted(57, 17) Source(53, 17) + SourceIndex(0) --- >>> x--; -1 >^^^^^^^^^^^^ +1->^^^^^^^^^^^^ 2 > ^ 3 > ^^ 4 > ^ 5 > ^^^-> -1 > +1->{ > 2 > x 3 > -- 4 > ; -1 >Emitted(58, 13) Source(54, 13) + SourceIndex(0) +1->Emitted(58, 13) Source(54, 13) + SourceIndex(0) 2 >Emitted(58, 14) Source(54, 14) + SourceIndex(0) 3 >Emitted(58, 16) Source(54, 16) + SourceIndex(0) 4 >Emitted(58, 17) Source(54, 17) + SourceIndex(0) --- >>> break; 1->^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1-> > -2 > break -3 > ; +2 > break; 1->Emitted(59, 13) Source(55, 13) + SourceIndex(0) -2 >Emitted(59, 18) Source(55, 18) + SourceIndex(0) -3 >Emitted(59, 19) Source(55, 19) + SourceIndex(0) +2 >Emitted(59, 19) Source(55, 19) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^-> +1 >^^^^^^^^^ +2 > ^^^^^^^^^^-> 1 > > - > -2 > } -1 >Emitted(60, 9) Source(57, 9) + SourceIndex(0) -2 >Emitted(60, 10) Source(57, 10) + SourceIndex(0) + > } +1 >Emitted(60, 10) Source(57, 10) + SourceIndex(0) --- >>> default: { 1->^^^^^^^^ -2 > ^^^^^^^^^ -3 > ^ -4 > ^^-> +2 > ^^^^^^^ +3 > ^ +4 > ^ +5 > ^^^-> 1-> > -2 > default: -3 > { +2 > default +3 > : +4 > 1->Emitted(61, 9) Source(58, 9) + SourceIndex(0) -2 >Emitted(61, 18) Source(58, 18) + SourceIndex(0) -3 >Emitted(61, 19) Source(58, 19) + SourceIndex(0) +2 >Emitted(61, 16) Source(58, 16) + SourceIndex(0) +3 >Emitted(61, 17) Source(58, 17) + SourceIndex(0) +4 >Emitted(61, 18) Source(58, 18) + SourceIndex(0) --- >>> x *= 2; 1->^^^^^^^^^^^^ @@ -1058,7 +905,7 @@ sourceFile:sourceMapValidationStatements.ts 4 > ^ 5 > ^ 6 > ^-> -1-> +1->{ > 2 > x 3 > *= @@ -1090,35 +937,26 @@ sourceFile:sourceMapValidationStatements.ts --- >>> break; 1 >^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1 > > -2 > break -3 > ; +2 > break; 1 >Emitted(64, 13) Source(61, 13) + SourceIndex(0) -2 >Emitted(64, 18) Source(61, 18) + SourceIndex(0) -3 >Emitted(64, 19) Source(61, 19) + SourceIndex(0) +2 >Emitted(64, 19) Source(61, 19) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ +1 >^^^^^^^^^ 1 > > - > -2 > } -1 >Emitted(65, 9) Source(63, 9) + SourceIndex(0) -2 >Emitted(65, 10) Source(63, 10) + SourceIndex(0) + > } +1 >Emitted(65, 10) Source(63, 10) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^^-> +1 >^^^^^ +2 > ^^^^^^^^^^^^^^^^-> 1 > - > -2 > } -1 >Emitted(66, 5) Source(64, 5) + SourceIndex(0) -2 >Emitted(66, 6) Source(64, 6) + SourceIndex(0) + > } +1 >Emitted(66, 6) Source(64, 6) + SourceIndex(0) --- >>> while (x < 10) { 1->^^^^ @@ -1127,7 +965,6 @@ sourceFile:sourceMapValidationStatements.ts 4 > ^^^ 5 > ^^ 6 > ^^ -7 > ^ 1-> > 2 > while ( @@ -1135,21 +972,19 @@ sourceFile:sourceMapValidationStatements.ts 4 > < 5 > 10 6 > ) -7 > { 1->Emitted(67, 5) Source(65, 5) + SourceIndex(0) 2 >Emitted(67, 12) Source(65, 12) + SourceIndex(0) 3 >Emitted(67, 13) Source(65, 13) + SourceIndex(0) 4 >Emitted(67, 16) Source(65, 16) + SourceIndex(0) 5 >Emitted(67, 18) Source(65, 18) + SourceIndex(0) 6 >Emitted(67, 20) Source(65, 20) + SourceIndex(0) -7 >Emitted(67, 21) Source(65, 21) + SourceIndex(0) --- >>> x++; 1 >^^^^^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > x 3 > ++ @@ -1160,27 +995,21 @@ sourceFile:sourceMapValidationStatements.ts 4 >Emitted(68, 13) Source(66, 13) + SourceIndex(0) --- >>> } -1 >^^^^ -2 > ^ -3 > ^^^^-> +1 >^^^^^ +2 > ^^^^-> 1 > - > -2 > } -1 >Emitted(69, 5) Source(67, 5) + SourceIndex(0) -2 >Emitted(69, 6) Source(67, 6) + SourceIndex(0) + > } +1 >Emitted(69, 6) Source(67, 6) + SourceIndex(0) --- >>> do { 1->^^^^ 2 > ^^^ -3 > ^ -4 > ^^^^^-> +3 > ^^^^^^-> 1-> > 2 > do -3 > { 1->Emitted(70, 5) Source(68, 5) + SourceIndex(0) 2 >Emitted(70, 8) Source(68, 8) + SourceIndex(0) -3 >Emitted(70, 9) Source(68, 9) + SourceIndex(0) --- >>> x--; 1->^^^^^^^^ @@ -1188,7 +1017,7 @@ sourceFile:sourceMapValidationStatements.ts 3 > ^^ 4 > ^ 5 > ^^^^^^^^^-> -1-> +1->{ > 2 > x 3 > -- @@ -1199,28 +1028,25 @@ sourceFile:sourceMapValidationStatements.ts 4 >Emitted(71, 13) Source(69, 13) + SourceIndex(0) --- >>> } while (x > 4); -1->^^^^ -2 > ^ -3 > ^^^^^^^^ -4 > ^ -5 > ^^^ -6 > ^ -7 > ^^ +1->^^^^^ +2 > ^^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^ 1-> - > -2 > } -3 > while ( -4 > x -5 > > -6 > 4 -7 > ) -1->Emitted(72, 5) Source(70, 5) + SourceIndex(0) -2 >Emitted(72, 6) Source(70, 6) + SourceIndex(0) -3 >Emitted(72, 14) Source(70, 14) + SourceIndex(0) -4 >Emitted(72, 15) Source(70, 15) + SourceIndex(0) -5 >Emitted(72, 18) Source(70, 18) + SourceIndex(0) -6 >Emitted(72, 19) Source(70, 19) + SourceIndex(0) -7 >Emitted(72, 21) Source(70, 20) + SourceIndex(0) + > } +2 > while ( +3 > x +4 > > +5 > 4 +6 > ) +1->Emitted(72, 6) Source(70, 6) + SourceIndex(0) +2 >Emitted(72, 14) Source(70, 14) + SourceIndex(0) +3 >Emitted(72, 15) Source(70, 15) + SourceIndex(0) +4 >Emitted(72, 18) Source(70, 18) + SourceIndex(0) +5 >Emitted(72, 19) Source(70, 19) + SourceIndex(0) +6 >Emitted(72, 21) Source(70, 20) + SourceIndex(0) --- >>> x = y; 1 >^^^^ @@ -1436,15 +1262,12 @@ sourceFile:sourceMapValidationStatements.ts --- >>> return; 1 >^^^^ -2 > ^^^^^^ -3 > ^ +2 > ^^^^^^^ 1 > > -2 > return -3 > ; +2 > return; 1 >Emitted(79, 5) Source(77, 5) + SourceIndex(0) -2 >Emitted(79, 11) Source(77, 11) + SourceIndex(0) -3 >Emitted(79, 12) Source(77, 12) + SourceIndex(0) +2 >Emitted(79, 12) Source(77, 12) + SourceIndex(0) --- >>>} 1 > diff --git a/tests/baselines/reference/sourceMapValidationSwitch.js.map b/tests/baselines/reference/sourceMapValidationSwitch.js.map index fcaa1a45cc5..11f94a972ed 100644 --- a/tests/baselines/reference/sourceMapValidationSwitch.js.map +++ b/tests/baselines/reference/sourceMapValidationSwitch.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationSwitch.js.map] -{"version":3,"file":"sourceMapValidationSwitch.js","sourceRoot":"","sources":["sourceMapValidationSwitch.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACR,KAAK,CAAC;QACF,CAAC,EAAE,CAAC;QACJ,KAAK,CAAC;IACV,KAAK,EAAE;QACH,CAAC;YACG,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QACV,CAAC;IACL;QACI,CAAC,GAAG,CAAC,GAAE,EAAE,CAAC;AAClB,CAAC;AACD,MAAM,CAAC,CAAC,CAAC,CAAC,CACV,CAAC;IACG,KAAK,CAAC;QACF,CAAC,EAAE,CAAC;QACJ,KAAK,CAAC;IACV,KAAK,EAAE;QACH,CAAC;YACG,CAAC,EAAE,CAAC;YACJ,KAAK,CAAC;QACV,CAAC;IACL;QACI,CAAC;YACG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACf,CAAC;AACT,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationSwitch.js","sourceRoot":"","sources":["sourceMapValidationSwitch.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,QAAQ,CAAC,EAAE;IACP,KAAK,CAAC;QACF,CAAC,EAAE,CAAC;QACJ,MAAM;IACV,KAAK,EAAE;QACH;YACI,CAAC,EAAE,CAAC;YACJ,MAAM;SACT;IACL;QACI,CAAC,GAAG,CAAC,GAAE,EAAE,CAAC;CACjB;AACD,QAAQ,CAAC,EACT;IACI,KAAK,CAAC;QACF,CAAC,EAAE,CAAC;QACJ,MAAM;IACV,KAAK,EAAE;QACH;YACI,CAAC,EAAE,CAAC;YACJ,MAAM;SACT;IACL;QACI;YACI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;SACd;CACR"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationSwitch.sourcemap.txt b/tests/baselines/reference/sourceMapValidationSwitch.sourcemap.txt index 4caa189efef..54dcef4e845 100644 --- a/tests/baselines/reference/sourceMapValidationSwitch.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationSwitch.sourcemap.txt @@ -31,41 +31,30 @@ sourceFile:sourceMapValidationSwitch.ts --- >>>switch (x) { 1-> -2 >^^^^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ +2 >^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^-> 1-> > -2 >switch -3 > -4 > ( -5 > x -6 > ) -7 > -8 > { +2 >switch ( +3 > x +4 > ) 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -3 >Emitted(2, 8) Source(2, 8) + SourceIndex(0) -4 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) -5 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) -6 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) -7 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -8 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) +2 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(2, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) --- >>> case 5: -1 >^^^^ +1->^^^^ 2 > ^^^^^ 3 > ^ 4 > ^^^-> -1 > +1->{ > 2 > case 3 > 5 -1 >Emitted(3, 5) Source(3, 5) + SourceIndex(0) +1->Emitted(3, 5) Source(3, 5) + SourceIndex(0) 2 >Emitted(3, 10) Source(3, 10) + SourceIndex(0) 3 >Emitted(3, 11) Source(3, 11) + SourceIndex(0) --- @@ -87,15 +76,12 @@ sourceFile:sourceMapValidationSwitch.ts --- >>> break; 1->^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1-> > -2 > break -3 > ; +2 > break; 1->Emitted(5, 9) Source(5, 9) + SourceIndex(0) -2 >Emitted(5, 14) Source(5, 14) + SourceIndex(0) -3 >Emitted(5, 15) Source(5, 15) + SourceIndex(0) +2 >Emitted(5, 15) Source(5, 15) + SourceIndex(0) --- >>> case 10: 1 >^^^^ @@ -111,13 +97,10 @@ sourceFile:sourceMapValidationSwitch.ts --- >>> { 1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^^^-> +2 > ^^^^^^^^^-> 1 >: > -2 > { 1 >Emitted(7, 9) Source(7, 9) + SourceIndex(0) -2 >Emitted(7, 10) Source(7, 10) + SourceIndex(0) --- >>> x--; 1->^^^^^^^^^^^^ @@ -125,7 +108,7 @@ sourceFile:sourceMapValidationSwitch.ts 3 > ^^ 4 > ^ 5 > ^^^-> -1-> +1->{ > 2 > x 3 > -- @@ -137,25 +120,19 @@ sourceFile:sourceMapValidationSwitch.ts --- >>> break; 1->^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1-> > -2 > break -3 > ; +2 > break; 1->Emitted(9, 13) Source(9, 13) + SourceIndex(0) -2 >Emitted(9, 18) Source(9, 18) + SourceIndex(0) -3 >Emitted(9, 19) Source(9, 19) + SourceIndex(0) +2 >Emitted(9, 19) Source(9, 19) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^-> +1 >^^^^^^^^^ +2 > ^^^^-> 1 > - > -2 > } -1 >Emitted(10, 9) Source(10, 9) + SourceIndex(0) -2 >Emitted(10, 10) Source(10, 10) + SourceIndex(0) + > } +1 >Emitted(10, 10) Source(10, 10) + SourceIndex(0) --- >>> default: 1->^^^^ @@ -189,53 +166,39 @@ sourceFile:sourceMapValidationSwitch.ts 7 >Emitted(12, 20) Source(12, 19) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(13, 1) Source(13, 1) + SourceIndex(0) -2 >Emitted(13, 2) Source(13, 2) + SourceIndex(0) + >} +1 >Emitted(13, 2) Source(13, 2) + SourceIndex(0) --- >>>switch (x) { 1-> -2 >^^^^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ +2 >^^^^^^^^ +3 > ^ +4 > ^^ +5 > ^-> 1-> > -2 >switch -3 > -4 > ( -5 > x -6 > ) -7 > - > -8 > { +2 >switch ( +3 > x +4 > ) + > 1->Emitted(14, 1) Source(14, 1) + SourceIndex(0) -2 >Emitted(14, 7) Source(14, 7) + SourceIndex(0) -3 >Emitted(14, 8) Source(14, 8) + SourceIndex(0) -4 >Emitted(14, 9) Source(14, 9) + SourceIndex(0) -5 >Emitted(14, 10) Source(14, 10) + SourceIndex(0) -6 >Emitted(14, 11) Source(14, 11) + SourceIndex(0) -7 >Emitted(14, 12) Source(15, 1) + SourceIndex(0) -8 >Emitted(14, 13) Source(15, 2) + SourceIndex(0) +2 >Emitted(14, 9) Source(14, 9) + SourceIndex(0) +3 >Emitted(14, 10) Source(14, 10) + SourceIndex(0) +4 >Emitted(14, 12) Source(15, 1) + SourceIndex(0) --- >>> case 5: -1 >^^^^ +1->^^^^ 2 > ^^^^^ 3 > ^ 4 > ^^^-> -1 > +1->{ > 2 > case 3 > 5 -1 >Emitted(15, 5) Source(16, 5) + SourceIndex(0) +1->Emitted(15, 5) Source(16, 5) + SourceIndex(0) 2 >Emitted(15, 10) Source(16, 10) + SourceIndex(0) 3 >Emitted(15, 11) Source(16, 11) + SourceIndex(0) --- @@ -257,15 +220,12 @@ sourceFile:sourceMapValidationSwitch.ts --- >>> break; 1->^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1-> > -2 > break -3 > ; +2 > break; 1->Emitted(17, 9) Source(18, 9) + SourceIndex(0) -2 >Emitted(17, 14) Source(18, 14) + SourceIndex(0) -3 >Emitted(17, 15) Source(18, 15) + SourceIndex(0) +2 >Emitted(17, 15) Source(18, 15) + SourceIndex(0) --- >>> case 10: 1 >^^^^ @@ -281,13 +241,10 @@ sourceFile:sourceMapValidationSwitch.ts --- >>> { 1 >^^^^^^^^ -2 > ^ -3 > ^^^^^^^^-> +2 > ^^^^^^^^^-> 1 >: > -2 > { 1 >Emitted(19, 9) Source(20, 9) + SourceIndex(0) -2 >Emitted(19, 10) Source(20, 10) + SourceIndex(0) --- >>> x--; 1->^^^^^^^^^^^^ @@ -295,7 +252,7 @@ sourceFile:sourceMapValidationSwitch.ts 3 > ^^ 4 > ^ 5 > ^^^-> -1-> +1->{ > 2 > x 3 > -- @@ -307,25 +264,19 @@ sourceFile:sourceMapValidationSwitch.ts --- >>> break; 1->^^^^^^^^^^^^ -2 > ^^^^^ -3 > ^ +2 > ^^^^^^ 1-> > -2 > break -3 > ; +2 > break; 1->Emitted(21, 13) Source(22, 13) + SourceIndex(0) -2 >Emitted(21, 18) Source(22, 18) + SourceIndex(0) -3 >Emitted(21, 19) Source(22, 19) + SourceIndex(0) +2 >Emitted(21, 19) Source(22, 19) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ -3 > ^^^^-> +1 >^^^^^^^^^ +2 > ^^^^-> 1 > - > -2 > } -1 >Emitted(22, 9) Source(23, 9) + SourceIndex(0) -2 >Emitted(22, 10) Source(23, 10) + SourceIndex(0) + > } +1 >Emitted(22, 10) Source(23, 10) + SourceIndex(0) --- >>> default: 1->^^^^ @@ -336,13 +287,10 @@ sourceFile:sourceMapValidationSwitch.ts --- >>> { 1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^^^^^^^^^-> +2 > ^^^^^^^^^^^^^^^^-> 1->default: > -2 > { 1->Emitted(24, 9) Source(25, 9) + SourceIndex(0) -2 >Emitted(24, 10) Source(25, 10) + SourceIndex(0) --- >>> x = x * 10; 1->^^^^^^^^^^^^ @@ -352,7 +300,7 @@ sourceFile:sourceMapValidationSwitch.ts 5 > ^^^ 6 > ^^ 7 > ^ -1-> +1->{ > 2 > x 3 > = @@ -369,22 +317,16 @@ sourceFile:sourceMapValidationSwitch.ts 7 >Emitted(25, 24) Source(26, 24) + SourceIndex(0) --- >>> } -1 >^^^^^^^^ -2 > ^ +1 >^^^^^^^^^ 1 > - > -2 > } -1 >Emitted(26, 9) Source(27, 9) + SourceIndex(0) -2 >Emitted(26, 10) Source(27, 10) + SourceIndex(0) + > } +1 >Emitted(26, 10) Source(27, 10) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(27, 1) Source(28, 1) + SourceIndex(0) -2 >Emitted(27, 2) Source(28, 2) + SourceIndex(0) + >} +1 >Emitted(27, 2) Source(28, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationSwitch.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationTryCatchFinally.js.map b/tests/baselines/reference/sourceMapValidationTryCatchFinally.js.map index 8b8690b470d..ff1a6a94770 100644 --- a/tests/baselines/reference/sourceMapValidationTryCatchFinally.js.map +++ b/tests/baselines/reference/sourceMapValidationTryCatchFinally.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationTryCatchFinally.js.map] -{"version":3,"file":"sourceMapValidationTryCatchFinally.js","sourceRoot":"","sources":["sourceMapValidationTryCatchFinally.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,IAAI,CAAC;IACD,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACT,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;QAAS,CAAC;IACP,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AACf,CAAC;AACD,IACA,CAAC;IACG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,IAAI,KAAK,EAAE,CAAC;AACtB,CAAC;AACD,KAAK,CAAC,CAAC,CAAC,CAAC,CACT,CAAC;IACG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;QAED,CAAC;IACG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AACf,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationTryCatchFinally.js","sourceRoot":"","sources":["sourceMapValidationTryCatchFinally.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,IAAI;IACA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACb;AAAC,OAAO,CAAC,EAAE;IACR,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACb;QAAS;IACN,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;CACd;AACD,IACA;IACI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,IAAI,KAAK,EAAE,CAAC;CACrB;AACD,OAAO,CAAC,EACR;IACI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CACb;QAED;IACI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;CACd"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationTryCatchFinally.sourcemap.txt b/tests/baselines/reference/sourceMapValidationTryCatchFinally.sourcemap.txt index 845ec5eeb27..a1bf274085a 100644 --- a/tests/baselines/reference/sourceMapValidationTryCatchFinally.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationTryCatchFinally.sourcemap.txt @@ -31,15 +31,12 @@ sourceFile:sourceMapValidationTryCatchFinally.ts >>>try { 1 > 2 >^^^^ -3 > ^ -4 > ^^^^^^^^^^-> +3 > ^^^^^^^^^^^-> 1 > > 2 >try -3 > { 1 >Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 5) Source(2, 5) + SourceIndex(0) -3 >Emitted(2, 6) Source(2, 6) + SourceIndex(0) --- >>> x = x + 1; 1->^^^^ @@ -49,7 +46,7 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 5 > ^^^ 6 > ^ 7 > ^ -1-> +1->{ > 2 > x 3 > = @@ -66,41 +63,26 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 7 >Emitted(3, 15) Source(3, 15) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) + >} +1 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) --- >>>catch (e) { 1-> -2 >^^^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^-> +2 >^^^^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^-> 1-> -2 >catch -3 > -4 > ( -5 > e -6 > ) -7 > -8 > { +2 >catch ( +3 > e +4 > ) 1->Emitted(5, 1) Source(4, 3) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 8) + SourceIndex(0) -3 >Emitted(5, 7) Source(4, 9) + SourceIndex(0) -4 >Emitted(5, 8) Source(4, 10) + SourceIndex(0) -5 >Emitted(5, 9) Source(4, 11) + SourceIndex(0) -6 >Emitted(5, 10) Source(4, 12) + SourceIndex(0) -7 >Emitted(5, 11) Source(4, 13) + SourceIndex(0) -8 >Emitted(5, 12) Source(4, 14) + SourceIndex(0) +2 >Emitted(5, 8) Source(4, 10) + SourceIndex(0) +3 >Emitted(5, 9) Source(4, 11) + SourceIndex(0) +4 >Emitted(5, 11) Source(4, 13) + SourceIndex(0) --- >>> x = x - 1; 1->^^^^ @@ -110,7 +92,7 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 5 > ^^^ 6 > ^ 7 > ^ -1-> +1->{ > 2 > x 3 > = @@ -127,23 +109,17 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 7 >Emitted(6, 15) Source(5, 15) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) + >} +1 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) --- >>>finally { 1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^-> +2 > ^^^^^^^^-> 1-> finally -2 > { 1->Emitted(8, 9) Source(6, 11) + SourceIndex(0) -2 >Emitted(8, 10) Source(6, 12) + SourceIndex(0) --- >>> x = x * 10; 1->^^^^ @@ -153,7 +129,7 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 5 > ^^^ 6 > ^^ 7 > ^ -1-> +1->{ > 2 > x 3 > = @@ -170,28 +146,22 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 7 >Emitted(9, 16) Source(7, 16) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^-> +1 >^ +2 > ^^^^^-> 1 > - > -2 >} -1 >Emitted(10, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(8, 2) + SourceIndex(0) + >} +1 >Emitted(10, 2) Source(8, 2) + SourceIndex(0) --- >>>try { 1-> 2 >^^^^ -3 > ^ -4 > ^^^^^^^^^^-> +3 > ^^^^^^^^^^^-> 1-> > 2 >try > -3 > { 1->Emitted(11, 1) Source(9, 1) + SourceIndex(0) 2 >Emitted(11, 5) Source(10, 1) + SourceIndex(0) -3 >Emitted(11, 6) Source(10, 2) + SourceIndex(0) --- >>> x = x + 1; 1->^^^^ @@ -202,7 +172,7 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 6 > ^ 7 > ^ 8 > ^^^^^^^^^-> -1-> +1->{ > 2 > x 3 > = @@ -240,43 +210,28 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 6 >Emitted(13, 23) Source(12, 23) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(14, 1) Source(13, 1) + SourceIndex(0) -2 >Emitted(14, 2) Source(13, 2) + SourceIndex(0) + >} +1 >Emitted(14, 2) Source(13, 2) + SourceIndex(0) --- >>>catch (e) { 1-> -2 >^^^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -9 > ^^^^-> +2 >^^^^^^^ +3 > ^ +4 > ^^ +5 > ^^^^^-> 1-> > -2 >catch -3 > -4 > ( -5 > e -6 > ) -7 > - > -8 > { +2 >catch ( +3 > e +4 > ) + > 1->Emitted(15, 1) Source(14, 1) + SourceIndex(0) -2 >Emitted(15, 6) Source(14, 6) + SourceIndex(0) -3 >Emitted(15, 7) Source(14, 7) + SourceIndex(0) -4 >Emitted(15, 8) Source(14, 8) + SourceIndex(0) -5 >Emitted(15, 9) Source(14, 9) + SourceIndex(0) -6 >Emitted(15, 10) Source(14, 10) + SourceIndex(0) -7 >Emitted(15, 11) Source(15, 1) + SourceIndex(0) -8 >Emitted(15, 12) Source(15, 2) + SourceIndex(0) +2 >Emitted(15, 8) Source(14, 8) + SourceIndex(0) +3 >Emitted(15, 9) Source(14, 9) + SourceIndex(0) +4 >Emitted(15, 11) Source(15, 1) + SourceIndex(0) --- >>> x = x - 1; 1->^^^^ @@ -286,7 +241,7 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 5 > ^^^ 6 > ^ 7 > ^ -1-> +1->{ > 2 > x 3 > = @@ -303,25 +258,19 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 7 >Emitted(16, 15) Source(16, 15) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(17, 1) Source(17, 1) + SourceIndex(0) -2 >Emitted(17, 2) Source(17, 2) + SourceIndex(0) + >} +1 >Emitted(17, 2) Source(17, 2) + SourceIndex(0) --- >>>finally { 1->^^^^^^^^ -2 > ^ -3 > ^^^^^^^-> +2 > ^^^^^^^^-> 1-> >finally > -2 > { 1->Emitted(18, 9) Source(19, 1) + SourceIndex(0) -2 >Emitted(18, 10) Source(19, 2) + SourceIndex(0) --- >>> x = x * 10; 1->^^^^ @@ -331,7 +280,7 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 5 > ^^^ 6 > ^^ 7 > ^ -1-> +1->{ > 2 > x 3 > = @@ -348,13 +297,10 @@ sourceFile:sourceMapValidationTryCatchFinally.ts 7 >Emitted(19, 16) Source(20, 16) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(20, 1) Source(21, 1) + SourceIndex(0) -2 >Emitted(20, 2) Source(21, 2) + SourceIndex(0) + >} +1 >Emitted(20, 2) Source(21, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationTryCatchFinally.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWhile.js.map b/tests/baselines/reference/sourceMapValidationWhile.js.map index a3b977c79d4..d5c2b22f309 100644 --- a/tests/baselines/reference/sourceMapValidationWhile.js.map +++ b/tests/baselines/reference/sourceMapValidationWhile.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationWhile.js.map] -{"version":3,"file":"sourceMapValidationWhile.js","sourceRoot":"","sources":["sourceMapValidationWhile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;IACb,CAAC,EAAE,CAAC;AACR,CAAC;AACD,OAAO,CAAC,IAAI,EAAE,EACd,CAAC;IACG,CAAC,EAAE,CAAC;AACR,CAAC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationWhile.js","sourceRoot":"","sources":["sourceMapValidationWhile.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG,EAAE,CAAC;AACX,OAAO,CAAC,IAAI,EAAE,EAAE;IACZ,CAAC,EAAE,CAAC;CACP;AACD,OAAO,CAAC,IAAI,EAAE,EACd;IACI,CAAC,EAAE,CAAC;CACP"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWhile.sourcemap.txt b/tests/baselines/reference/sourceMapValidationWhile.sourcemap.txt index df653c57e83..a1d8799e04d 100644 --- a/tests/baselines/reference/sourceMapValidationWhile.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationWhile.sourcemap.txt @@ -36,7 +36,6 @@ sourceFile:sourceMapValidationWhile.ts 4 > ^^^^ 5 > ^^ 6 > ^^ -7 > ^ 1-> > 2 >while ( @@ -44,21 +43,19 @@ sourceFile:sourceMapValidationWhile.ts 4 > == 5 > 10 6 > ) -7 > { 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 8) Source(2, 8) + SourceIndex(0) 3 >Emitted(2, 9) Source(2, 9) + SourceIndex(0) 4 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) 5 >Emitted(2, 15) Source(2, 15) + SourceIndex(0) 6 >Emitted(2, 17) Source(2, 17) + SourceIndex(0) -7 >Emitted(2, 18) Source(2, 18) + SourceIndex(0) --- >>> a++; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > a 3 > ++ @@ -69,14 +66,11 @@ sourceFile:sourceMapValidationWhile.ts 4 >Emitted(3, 9) Source(3, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(4, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) + >} +1 >Emitted(4, 2) Source(4, 2) + SourceIndex(0) --- >>>while (a == 10) { 1-> @@ -85,7 +79,6 @@ sourceFile:sourceMapValidationWhile.ts 4 > ^^^^ 5 > ^^ 6 > ^^ -7 > ^ 1-> > 2 >while ( @@ -94,21 +87,19 @@ sourceFile:sourceMapValidationWhile.ts 5 > 10 6 > ) > -7 > { 1->Emitted(5, 1) Source(5, 1) + SourceIndex(0) 2 >Emitted(5, 8) Source(5, 8) + SourceIndex(0) 3 >Emitted(5, 9) Source(5, 9) + SourceIndex(0) 4 >Emitted(5, 13) Source(5, 13) + SourceIndex(0) 5 >Emitted(5, 15) Source(5, 15) + SourceIndex(0) 6 >Emitted(5, 17) Source(6, 1) + SourceIndex(0) -7 >Emitted(5, 18) Source(6, 2) + SourceIndex(0) --- >>> a++; 1 >^^^^ 2 > ^ 3 > ^^ 4 > ^ -1 > +1 >{ > 2 > a 3 > ++ @@ -119,13 +110,10 @@ sourceFile:sourceMapValidationWhile.ts 4 >Emitted(6, 9) Source(7, 9) + SourceIndex(0) --- >>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 >^ +2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > - > -2 >} -1 >Emitted(7, 1) Source(8, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(8, 2) + SourceIndex(0) + >} +1 >Emitted(7, 2) Source(8, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationWhile.js.map \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWithComments.js.map b/tests/baselines/reference/sourceMapValidationWithComments.js.map index 4b41c707235..04b643a3054 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.js.map +++ b/tests/baselines/reference/sourceMapValidationWithComments.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationWithComments.js.map] -{"version":3,"file":"sourceMapValidationWithComments.js","sourceRoot":"","sources":["sourceMapValidationWithComments.ts"],"names":[],"mappings":"AAAA;IAAA;IAoBA,CAAC;IAlBiB,oBAAS,GAAvB;QAEI,2BAA2B;QAC3B,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,yBAAyB;QAGzB,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC;IACL,iBAAC;AAAD,CAAC,AApBD,IAoBC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationWithComments.js","sourceRoot":"","sources":["sourceMapValidationWithComments.ts"],"names":[],"mappings":"AAAA;IAAA;IAoBA,CAAC;IAlBiB,oBAAS,GAAvB;QAEI,2BAA2B;QAC3B,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,yBAAyB;QAGzB,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,iBAAC;AAAD,CAAC,AApBD,IAoBC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt index 506f662e37d..e3f75270edb 100644 --- a/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationWithComments.sourcemap.txt @@ -247,23 +247,20 @@ sourceFile:sourceMapValidationWithComments.ts --- >>> return true; 1 >^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^^ -5 > ^ +2 > ^^^^^^^ +3 > ^^^^ +4 > ^ 1 > > > > -2 > return -3 > -4 > true -5 > ; +2 > return +3 > true +4 > ; 1 >Emitted(17, 9) Source(19, 9) + SourceIndex(0) -2 >Emitted(17, 15) Source(19, 15) + SourceIndex(0) -3 >Emitted(17, 16) Source(19, 16) + SourceIndex(0) -4 >Emitted(17, 20) Source(19, 20) + SourceIndex(0) -5 >Emitted(17, 21) Source(19, 21) + SourceIndex(0) +2 >Emitted(17, 16) Source(19, 16) + SourceIndex(0) +3 >Emitted(17, 20) Source(19, 20) + SourceIndex(0) +4 >Emitted(17, 21) Source(19, 21) + SourceIndex(0) --- >>> }; 1 >^^^^ diff --git a/tests/baselines/reference/switchCaseInternalComments.js b/tests/baselines/reference/switchCaseInternalComments.js new file mode 100644 index 00000000000..396e9ed4fee --- /dev/null +++ b/tests/baselines/reference/switchCaseInternalComments.js @@ -0,0 +1,17 @@ +//// [switchCaseInternalComments.ts] +/*-1*/ foo /*0*/ : /*1*/ switch /*2*/ ( /*3*/ false /*4*/ ) /*5*/ { + /*6*/ case /*7*/ false /*8*/ : /*9*/ + /*10*/ break /*11*/ foo /*12*/; + /*13*/ default /*14*/ : /*15*/ + /*16*/ case /*17*/ false /*18*/ : /*19*/ { /*20*/ + /*21*/ } /*22*/ +} + +//// [switchCaseInternalComments.js] +/*-1*/ foo /*0*/: /*1*/ switch /*2*/ ( /*3*/false /*4*/) /*5*/ { + /*6*/ case /*7*/ false /*8*/: /*9*/ + /*10*/ break /*11*/ foo /*12*/; + /*13*/ default /*14*/: /*15*/ + /*16*/ case /*17*/ false /*18*/: /*19*/ { /*20*/ + /*21*/ } /*22*/ +} diff --git a/tests/baselines/reference/switchCaseInternalComments.symbols b/tests/baselines/reference/switchCaseInternalComments.symbols new file mode 100644 index 00000000000..cd05cf82602 --- /dev/null +++ b/tests/baselines/reference/switchCaseInternalComments.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/switchCaseInternalComments.ts === +/*-1*/ foo /*0*/ : /*1*/ switch /*2*/ ( /*3*/ false /*4*/ ) /*5*/ { +No type information for this code. /*6*/ case /*7*/ false /*8*/ : /*9*/ +No type information for this code. /*10*/ break /*11*/ foo /*12*/; +No type information for this code. /*13*/ default /*14*/ : /*15*/ +No type information for this code. /*16*/ case /*17*/ false /*18*/ : /*19*/ { /*20*/ +No type information for this code. /*21*/ } /*22*/ +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/switchCaseInternalComments.types b/tests/baselines/reference/switchCaseInternalComments.types new file mode 100644 index 00000000000..16b1684105e --- /dev/null +++ b/tests/baselines/reference/switchCaseInternalComments.types @@ -0,0 +1,17 @@ +=== tests/cases/compiler/switchCaseInternalComments.ts === +/*-1*/ foo /*0*/ : /*1*/ switch /*2*/ ( /*3*/ false /*4*/ ) /*5*/ { +>foo : any +>false : false + + /*6*/ case /*7*/ false /*8*/ : /*9*/ +>false : false + + /*10*/ break /*11*/ foo /*12*/; +>foo : any + + /*13*/ default /*14*/ : /*15*/ + /*16*/ case /*17*/ false /*18*/ : /*19*/ { /*20*/ +>false : false + + /*21*/ } /*22*/ +} diff --git a/tests/baselines/reference/switchStatementsWithMultipleDefaults.js b/tests/baselines/reference/switchStatementsWithMultipleDefaults.js index e41d8c016ef..3e272133dee 100644 --- a/tests/baselines/reference/switchStatementsWithMultipleDefaults.js +++ b/tests/baselines/reference/switchStatementsWithMultipleDefaults.js @@ -35,7 +35,7 @@ var x = 10; switch (x) { case 1: case 2: - default:// No issues. + default: // No issues. break; default: // Error; second 'default' clause. default: // Error; third 'default' clause. @@ -43,12 +43,12 @@ switch (x) { x *= x; } switch (x) { - default:// No issues. + default: // No issues. break; case 100: switch (x * x) { default: // No issues. - default:// Error; second 'default' clause. + default: // Error; second 'default' clause. break; case 10000: x /= x; diff --git a/tests/baselines/reference/switchStatementsWithMultipleDefaults1.js b/tests/baselines/reference/switchStatementsWithMultipleDefaults1.js index d733ce38a7b..93a5ebc4259 100644 --- a/tests/baselines/reference/switchStatementsWithMultipleDefaults1.js +++ b/tests/baselines/reference/switchStatementsWithMultipleDefaults1.js @@ -17,7 +17,7 @@ var x = 10; switch (x) { case 1: case 2: - default:// No issues. + default: // No issues. break; default: // Error; second 'default' clause. default: // Error; third 'default' clause. diff --git a/tests/baselines/reference/tryStatementInternalComments.js b/tests/baselines/reference/tryStatementInternalComments.js new file mode 100644 index 00000000000..83cbafd9648 --- /dev/null +++ b/tests/baselines/reference/tryStatementInternalComments.js @@ -0,0 +1,17 @@ +//// [tryStatementInternalComments.ts] +/*1*/ try /*2*/ { /*3*/ + /*4*/ throw /*5*/ "no" /*6*/; +/*7*/} /*8*/ catch /*9*/ ( /*10*/ e /*11*/ ) /*12*/ { /*13*/ + +/*14*/} /*15*/ finally /*16*/ { /*17*/ + +/*18*/} /*19*/ + +//// [tryStatementInternalComments.js] +/*1*/ try /*2*/ { /*3*/ + /*4*/ throw /*5*/ "no" /*6*/; + /*7*/ } /*8*/ +catch /*9*/ ( /*10*/e /*11*/) /*12*/ { /*13*/ + /*14*/ } /*15*/ +finally /*16*/ { /*17*/ + /*18*/ } /*19*/ diff --git a/tests/baselines/reference/tryStatementInternalComments.symbols b/tests/baselines/reference/tryStatementInternalComments.symbols new file mode 100644 index 00000000000..e1aeba76157 --- /dev/null +++ b/tests/baselines/reference/tryStatementInternalComments.symbols @@ -0,0 +1,9 @@ +=== tests/cases/compiler/tryStatementInternalComments.ts === +/*1*/ try /*2*/ { /*3*/ + /*4*/ throw /*5*/ "no" /*6*/; +/*7*/} /*8*/ catch /*9*/ ( /*10*/ e /*11*/ ) /*12*/ { /*13*/ +>e : Symbol(e, Decl(tryStatementInternalComments.ts, 2, 26)) + +/*14*/} /*15*/ finally /*16*/ { /*17*/ + +/*18*/} /*19*/ diff --git a/tests/baselines/reference/tryStatementInternalComments.types b/tests/baselines/reference/tryStatementInternalComments.types new file mode 100644 index 00000000000..565b7f78982 --- /dev/null +++ b/tests/baselines/reference/tryStatementInternalComments.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/tryStatementInternalComments.ts === +/*1*/ try /*2*/ { /*3*/ + /*4*/ throw /*5*/ "no" /*6*/; +>"no" : "no" + +/*7*/} /*8*/ catch /*9*/ ( /*10*/ e /*11*/ ) /*12*/ { /*13*/ +>e : any + +/*14*/} /*15*/ finally /*16*/ { /*17*/ + +/*18*/} /*19*/ diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index 349b06b40f6..d3542729ee2 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -106,11 +106,11 @@ var numOrStr; var str; if (is) string > (numOrStr === undefined); -{ +{ // Error str = numOrStr; // Error, no narrowing occurred } if ((numOrStr === undefined)) is; string; -{ +{ // Error } diff --git a/tests/baselines/reference/typeGuardIntersectionTypes.js b/tests/baselines/reference/typeGuardIntersectionTypes.js index 4b5e8a4b1cc..5a7bc055330 100644 --- a/tests/baselines/reference/typeGuardIntersectionTypes.js +++ b/tests/baselines/reference/typeGuardIntersectionTypes.js @@ -152,10 +152,12 @@ function identifyBeast(beast) { log("unknown - " + beast.legs + " legs, wings"); } } + // All non-winged beasts with legs else { log("manbearpig - " + beast.legs + " legs, no wings"); } } + // All beasts without legs else { if (hasWings(beast)) { log("quetzalcoatl - no legs, wings"); diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfOther.js b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js index 49d751fc555..f782e10a3bc 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfOther.js +++ b/tests/baselines/reference/typeGuardOfFormTypeOfOther.js @@ -122,7 +122,7 @@ if (typeof boolOrC === "Object") { else { var r4 = boolOrC; // boolean } -if (typeof strOrC === "Object") { +if (typeof strOrC === "Object") { // comparison is OK with cast c = strOrC; // error: but no narrowing to C } else { diff --git a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js index 40ef6587e75..65862b8acd2 100644 --- a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js +++ b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.js @@ -204,7 +204,7 @@ if (obj18 instanceof Function) { // can't narrow type from 'any' to 'Function' //// [typeGuardsWithInstanceOfByConstructorSignature.js] var obj1; -if (obj1 instanceof A) { +if (obj1 instanceof A) { // narrowed to A. obj1.foo; obj1.bar; } @@ -214,7 +214,7 @@ if (obj2 instanceof A) { obj2.bar; } var obj3; -if (obj3 instanceof B) { +if (obj3 instanceof B) { // narrowed to B. obj3.foo = 1; obj3.foo = "str"; obj3.bar = "str"; @@ -226,7 +226,7 @@ if (obj4 instanceof B) { obj4.bar = "str"; } var obj5; -if (obj5 instanceof C) { +if (obj5 instanceof C) { // narrowed to C1|C2. obj5.foo; obj5.c; obj5.bar1; @@ -239,7 +239,7 @@ if (obj6 instanceof C) { obj6.bar2; } var obj7; -if (obj7 instanceof D) { +if (obj7 instanceof D) { // narrowed to D. obj7.foo; obj7.bar; } @@ -249,7 +249,7 @@ if (obj8 instanceof D) { obj8.bar; } var obj9; -if (obj9 instanceof E) { +if (obj9 instanceof E) { // narrowed to E1 | E2 obj9.foo; obj9.bar1; obj9.bar2; @@ -261,7 +261,7 @@ if (obj10 instanceof E) { obj10.bar2; } var obj11; -if (obj11 instanceof F) { +if (obj11 instanceof F) { // can't type narrowing, construct signature returns any. obj11.foo; obj11.bar; } @@ -271,7 +271,7 @@ if (obj12 instanceof F) { obj12.bar; } var obj13; -if (obj13 instanceof G) { +if (obj13 instanceof G) { // narrowed to G1. G1 is return type of prototype property. obj13.foo1; obj13.foo2; } @@ -281,7 +281,7 @@ if (obj14 instanceof G) { obj14.foo2; } var obj15; -if (obj15 instanceof H) { +if (obj15 instanceof H) { // narrowed to H. obj15.foo; obj15.bar; } @@ -291,12 +291,12 @@ if (obj16 instanceof H) { obj16.foo2; } var obj17; -if (obj17 instanceof Object) { +if (obj17 instanceof Object) { // can't narrow type from 'any' to 'Object' obj17.foo1; obj17.foo2; } var obj18; -if (obj18 instanceof Function) { +if (obj18 instanceof Function) { // can't narrow type from 'any' to 'Function' obj18.foo1; obj18.foo2; } diff --git a/tests/baselines/reference/unknownSymbols2.js b/tests/baselines/reference/unknownSymbols2.js index b158f5c9503..03439352704 100644 --- a/tests/baselines/reference/unknownSymbols2.js +++ b/tests/baselines/reference/unknownSymbols2.js @@ -42,7 +42,7 @@ var M; } try { } - catch (asdf) { + catch (asdf) { // no error } switch (asdf) { case qwerty: diff --git a/tests/baselines/reference/variableDeclarationInnerCommentEmit.js b/tests/baselines/reference/variableDeclarationInnerCommentEmit.js new file mode 100644 index 00000000000..46ddc3021c3 --- /dev/null +++ b/tests/baselines/reference/variableDeclarationInnerCommentEmit.js @@ -0,0 +1,14 @@ +//// [variableDeclarationInnerCommentEmit.ts] +var a = /*some comment*/ null; +var b /*some comment*/ = null; +var /*some comment*/ c = null; + +// no space +var a=/*some comment*/null; + +//// [variableDeclarationInnerCommentEmit.js] +var a = /*some comment*/ null; +var b /*some comment*/ = null; +var /*some comment*/ c = null; +// no space +var a = /*some comment*/ null; diff --git a/tests/baselines/reference/variableDeclarationInnerCommentEmit.symbols b/tests/baselines/reference/variableDeclarationInnerCommentEmit.symbols new file mode 100644 index 00000000000..99ad2198b4d --- /dev/null +++ b/tests/baselines/reference/variableDeclarationInnerCommentEmit.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/variableDeclarationInnerCommentEmit.ts === +var a = /*some comment*/ null; +>a : Symbol(a, Decl(variableDeclarationInnerCommentEmit.ts, 0, 3), Decl(variableDeclarationInnerCommentEmit.ts, 5, 3)) + +var b /*some comment*/ = null; +>b : Symbol(b, Decl(variableDeclarationInnerCommentEmit.ts, 1, 3)) + +var /*some comment*/ c = null; +>c : Symbol(c, Decl(variableDeclarationInnerCommentEmit.ts, 2, 3)) + +// no space +var a=/*some comment*/null; +>a : Symbol(a, Decl(variableDeclarationInnerCommentEmit.ts, 0, 3), Decl(variableDeclarationInnerCommentEmit.ts, 5, 3)) + diff --git a/tests/baselines/reference/variableDeclarationInnerCommentEmit.types b/tests/baselines/reference/variableDeclarationInnerCommentEmit.types new file mode 100644 index 00000000000..c644a15a7c6 --- /dev/null +++ b/tests/baselines/reference/variableDeclarationInnerCommentEmit.types @@ -0,0 +1,18 @@ +=== tests/cases/compiler/variableDeclarationInnerCommentEmit.ts === +var a = /*some comment*/ null; +>a : any +>null : null + +var b /*some comment*/ = null; +>b : any +>null : null + +var /*some comment*/ c = null; +>c : any +>null : null + +// no space +var a=/*some comment*/null; +>a : any +>null : null + diff --git a/tests/baselines/reference/whileStatementInnerComments.js b/tests/baselines/reference/whileStatementInnerComments.js new file mode 100644 index 00000000000..e2d3f0a2bfc --- /dev/null +++ b/tests/baselines/reference/whileStatementInnerComments.js @@ -0,0 +1,9 @@ +//// [whileStatementInnerComments.ts] +/*a*/ while /*b*/ ( /*c*/ false /*d*/ ) /*e*/ {} + +/*a*/ do /*b*/ {} /*c*/ while /*d*/ ( /*e*/ true /*f*/ ); + + +//// [whileStatementInnerComments.js] +/*a*/ while /*b*/ ( /*c*/false /*d*/) /*e*/ { } +/*a*/ do /*b*/ { } /*c*/ while /*d*/ ( /*e*/true /*f*/); diff --git a/tests/baselines/reference/whileStatementInnerComments.symbols b/tests/baselines/reference/whileStatementInnerComments.symbols new file mode 100644 index 00000000000..2f7b5a3317b --- /dev/null +++ b/tests/baselines/reference/whileStatementInnerComments.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/whileStatementInnerComments.ts === +/*a*/ while /*b*/ ( /*c*/ false /*d*/ ) /*e*/ {} +No type information for this code. +No type information for this code./*a*/ do /*b*/ {} /*c*/ while /*d*/ ( /*e*/ true /*f*/ ); +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/whileStatementInnerComments.types b/tests/baselines/reference/whileStatementInnerComments.types new file mode 100644 index 00000000000..fa827e6c132 --- /dev/null +++ b/tests/baselines/reference/whileStatementInnerComments.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/whileStatementInnerComments.ts === +/*a*/ while /*b*/ ( /*c*/ false /*d*/ ) /*e*/ {} +>false : false + +/*a*/ do /*b*/ {} /*c*/ while /*d*/ ( /*e*/ true /*f*/ ); +>true : true + diff --git a/tests/baselines/reference/withStatement.js b/tests/baselines/reference/withStatement.js index e4224482059..5bd152cfae7 100644 --- a/tests/baselines/reference/withStatement.js +++ b/tests/baselines/reference/withStatement.js @@ -13,7 +13,7 @@ with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error //// [withStatement.js] -with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { +with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error bing = true; // no error bang = true; // no error function bar() { } diff --git a/tests/baselines/reference/withStatementErrors.js b/tests/baselines/reference/withStatementErrors.js index a5db8edc5af..85801c3fcc4 100644 --- a/tests/baselines/reference/withStatementErrors.js +++ b/tests/baselines/reference/withStatementErrors.js @@ -19,7 +19,7 @@ with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error //// [withStatementErrors.js] -with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { +with (ooo.eee.oo.ah_ah.ting.tang.walla.walla) { // error bing = true; // no error bang = true; // no error function bar() { } // no error diff --git a/tests/baselines/reference/withStatementInternalComments.js b/tests/baselines/reference/withStatementInternalComments.js new file mode 100644 index 00000000000..e85e3ac9b88 --- /dev/null +++ b/tests/baselines/reference/withStatementInternalComments.js @@ -0,0 +1,7 @@ +//// [withStatementInternalComments.ts] +// @ts-ignore +/*1*/ with /*2*/ ( /*3*/ false /*4*/ ) /*5*/ {} + +//// [withStatementInternalComments.js] +// @ts-ignore +/*1*/ with /*2*/ ( /*3*/false /*4*/) /*5*/ { } diff --git a/tests/baselines/reference/withStatementInternalComments.symbols b/tests/baselines/reference/withStatementInternalComments.symbols new file mode 100644 index 00000000000..1424bf2ecc1 --- /dev/null +++ b/tests/baselines/reference/withStatementInternalComments.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/withStatementInternalComments.ts === +// @ts-ignore +No type information for this code./*1*/ with /*2*/ ( /*3*/ false /*4*/ ) /*5*/ {} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/withStatementInternalComments.types b/tests/baselines/reference/withStatementInternalComments.types new file mode 100644 index 00000000000..8663249ae64 --- /dev/null +++ b/tests/baselines/reference/withStatementInternalComments.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/withStatementInternalComments.ts === +// @ts-ignore +/*1*/ with /*2*/ ( /*3*/ false /*4*/ ) /*5*/ {} +>false : false + diff --git a/tests/baselines/reference/yieldExpressionInnerCommentEmit.js b/tests/baselines/reference/yieldExpressionInnerCommentEmit.js new file mode 100644 index 00000000000..a8a4ce2fe6f --- /dev/null +++ b/tests/baselines/reference/yieldExpressionInnerCommentEmit.js @@ -0,0 +1,18 @@ +//// [yieldExpressionInnerCommentEmit.ts] +function * foo2() { + /*comment1*/ yield 1; + yield /*comment2*/ 2; + yield 3 /*comment3*/ + yield */*comment4*/ [4]; + yield /*comment5*/* [5]; +} + + +//// [yieldExpressionInnerCommentEmit.js] +function* foo2() { + /*comment1*/ yield 1; + yield /*comment2*/ 2; + yield 3; /*comment3*/ + yield* /*comment4*/ [4]; + yield /*comment5*/* [5]; +} diff --git a/tests/baselines/reference/yieldExpressionInnerCommentEmit.symbols b/tests/baselines/reference/yieldExpressionInnerCommentEmit.symbols new file mode 100644 index 00000000000..7fb071f3462 --- /dev/null +++ b/tests/baselines/reference/yieldExpressionInnerCommentEmit.symbols @@ -0,0 +1,11 @@ +=== tests/cases/compiler/yieldExpressionInnerCommentEmit.ts === +function * foo2() { +>foo2 : Symbol(foo2, Decl(yieldExpressionInnerCommentEmit.ts, 0, 0)) + + /*comment1*/ yield 1; + yield /*comment2*/ 2; + yield 3 /*comment3*/ + yield */*comment4*/ [4]; + yield /*comment5*/* [5]; +} + diff --git a/tests/baselines/reference/yieldExpressionInnerCommentEmit.types b/tests/baselines/reference/yieldExpressionInnerCommentEmit.types new file mode 100644 index 00000000000..d6d384712f7 --- /dev/null +++ b/tests/baselines/reference/yieldExpressionInnerCommentEmit.types @@ -0,0 +1,27 @@ +=== tests/cases/compiler/yieldExpressionInnerCommentEmit.ts === +function * foo2() { +>foo2 : () => IterableIterator + + /*comment1*/ yield 1; +>yield 1 : any +>1 : 1 + + yield /*comment2*/ 2; +>yield /*comment2*/ 2 : any +>2 : 2 + + yield 3 /*comment3*/ +>yield 3 : any +>3 : 3 + + yield */*comment4*/ [4]; +>yield */*comment4*/ [4] : any +>[4] : number[] +>4 : 4 + + yield /*comment5*/* [5]; +>yield /*comment5*/* [5] : any +>[5] : number[] +>5 : 5 +} + diff --git a/tests/cases/compiler/awaitExpressionInnerCommentEmit.ts b/tests/cases/compiler/awaitExpressionInnerCommentEmit.ts new file mode 100644 index 00000000000..68cc1f94a93 --- /dev/null +++ b/tests/cases/compiler/awaitExpressionInnerCommentEmit.ts @@ -0,0 +1,6 @@ +// @target: esnext +async function foo() { + /*comment1*/ await 1; + await /*comment2*/ 2; + await 3 /*comment3*/ +} \ No newline at end of file diff --git a/tests/cases/compiler/continueStatementInternalComments.ts b/tests/cases/compiler/continueStatementInternalComments.ts new file mode 100644 index 00000000000..66cca90a081 --- /dev/null +++ b/tests/cases/compiler/continueStatementInternalComments.ts @@ -0,0 +1,3 @@ +foo: for (;;) { + /*1*/ continue /*2*/ foo /*3*/; +} \ No newline at end of file diff --git a/tests/cases/compiler/elementAccessExpressionInternalComments.ts b/tests/cases/compiler/elementAccessExpressionInternalComments.ts new file mode 100644 index 00000000000..89a7f68b49f --- /dev/null +++ b/tests/cases/compiler/elementAccessExpressionInternalComments.ts @@ -0,0 +1,7 @@ +/*0*/ Array /*1*/[ /*2*/ "toString" /*3*/ ] /*4*/; /*5*/ + +/*0*/ Array + // single line + /*1*/[ /*2*/ "toString" + // single line + /*3*/ ] /*4*/ diff --git a/tests/cases/compiler/emptyArgumentsListComment.ts b/tests/cases/compiler/emptyArgumentsListComment.ts new file mode 100644 index 00000000000..4a435018f69 --- /dev/null +++ b/tests/cases/compiler/emptyArgumentsListComment.ts @@ -0,0 +1,10 @@ +declare var a; + +a(/*1*/); +a( + /*first*/ + // foo + /*middle*/ + // bar + /*last*/ +); diff --git a/tests/cases/compiler/forStatementInnerComments.ts b/tests/cases/compiler/forStatementInnerComments.ts new file mode 100644 index 00000000000..14ef4554b06 --- /dev/null +++ b/tests/cases/compiler/forStatementInnerComments.ts @@ -0,0 +1,7 @@ +// @target: es6 +declare var a; +/*0*/ for /*1*/ ( /*2*/ var /*3*/ x /*4*/ in /*5*/ a /*6*/) /*7*/ {} +/*0*/ for /*1*/ ( /*2*/ var /*3*/ y /*4*/ of /*5*/ a /*6*/) /*7*/ {} +/*0*/ for /*1*/ ( /*2*/ x /*3*/ in /*4*/ a /*5*/) /*6*/ {} +/*0*/ for /*1*/ ( /*2*/ y /*3*/ of /*4*/ a /*5*/) /*6*/ {} +/*0*/ for /*1*/ ( /*2*/ a /*3*/ ; /*4*/ a /*5*/ ; /*6*/ a /*7*/) /*8*/ {} diff --git a/tests/cases/compiler/ifStatementInternalComments.ts b/tests/cases/compiler/ifStatementInternalComments.ts new file mode 100644 index 00000000000..d7f110e753d --- /dev/null +++ b/tests/cases/compiler/ifStatementInternalComments.ts @@ -0,0 +1,3 @@ +/*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} + +/*1*/ if /*2*/ ( /*3*/ true /*4*/ ) /*5*/ {} /*6*/ else /*7*/ {} diff --git a/tests/cases/compiler/importExportInternalComments.ts b/tests/cases/compiler/importExportInternalComments.ts new file mode 100644 index 00000000000..64119078f3d --- /dev/null +++ b/tests/cases/compiler/importExportInternalComments.ts @@ -0,0 +1,15 @@ +// @target: esnext +// @filename: include.d.ts +declare module "foo"; + +// @filename: default.ts +/*1*/ export /*2*/ default /*3*/ Array /*4*/; + +// @filename: index.ts +/*1*/ import /*2*/ D /*3*/, /*4*/ { /*5*/ A /*6*/, /*7*/ B /*8*/ as /*9*/ C /*10*/ } /*11*/ from /*12*/ "foo"; +/*1*/ import /*2*/ * /*3*/ as /*4*/ foo /*5*/ from /*6*/ "foo"; + +void D, A, C, foo; // Use the variables to prevent ellision + +/*1*/ export /*2*/ { /*3*/ A /*4*/, /*5*/ B /*6*/ as /*7*/ C /*8*/ } /*9*/ from /*10*/ "foo"; +/*1*/ export /*2*/ * /*3*/ from /*4*/ "foo" \ No newline at end of file diff --git a/tests/cases/compiler/keywordExpressionInternalComments.ts b/tests/cases/compiler/keywordExpressionInternalComments.ts new file mode 100644 index 00000000000..ddfa5b5d80a --- /dev/null +++ b/tests/cases/compiler/keywordExpressionInternalComments.ts @@ -0,0 +1,4 @@ +/*1*/ new /*2*/ Array /*3*/; +/*1*/ typeof /*2*/ Array /*3*/; +/*1*/ void /*2*/ Array /*3*/; +/*1*/ delete /*2*/ Array.toString /*3*/; diff --git a/tests/cases/compiler/parenthesizedExpressionInternalComments.ts b/tests/cases/compiler/parenthesizedExpressionInternalComments.ts new file mode 100644 index 00000000000..7a912a89931 --- /dev/null +++ b/tests/cases/compiler/parenthesizedExpressionInternalComments.ts @@ -0,0 +1,10 @@ +/*1*/(/*2*/ "foo" /*3*/)/*4*/ +; + +// open +/*1*/( + // next + /*2*/"foo" + //close + /*3*/)/*4*/ +; diff --git a/tests/cases/compiler/propertyAccessExpressionInnerComments.ts b/tests/cases/compiler/propertyAccessExpressionInnerComments.ts new file mode 100644 index 00000000000..f4efc986b38 --- /dev/null +++ b/tests/cases/compiler/propertyAccessExpressionInnerComments.ts @@ -0,0 +1,14 @@ +/*1*/Array/*2*/./*3*/toString/*4*/ + +/*1*/Array +/*2*/./*3*/ + // Single-line comment + toString/*4*/ + +/*1*/Array/*2*/./*3*/ + // Single-line comment + toString/*4*/ + +/*1*/Array + // Single-line comment + /*2*/./*3*/toString/*4*/ diff --git a/tests/cases/compiler/switchCaseInternalComments.ts b/tests/cases/compiler/switchCaseInternalComments.ts new file mode 100644 index 00000000000..d8a808577e8 --- /dev/null +++ b/tests/cases/compiler/switchCaseInternalComments.ts @@ -0,0 +1,7 @@ +/*-1*/ foo /*0*/ : /*1*/ switch /*2*/ ( /*3*/ false /*4*/ ) /*5*/ { + /*6*/ case /*7*/ false /*8*/ : /*9*/ + /*10*/ break /*11*/ foo /*12*/; + /*13*/ default /*14*/ : /*15*/ + /*16*/ case /*17*/ false /*18*/ : /*19*/ { /*20*/ + /*21*/ } /*22*/ +} \ No newline at end of file diff --git a/tests/cases/compiler/tryStatementInternalComments.ts b/tests/cases/compiler/tryStatementInternalComments.ts new file mode 100644 index 00000000000..de0114b6840 --- /dev/null +++ b/tests/cases/compiler/tryStatementInternalComments.ts @@ -0,0 +1,7 @@ +/*1*/ try /*2*/ { /*3*/ + /*4*/ throw /*5*/ "no" /*6*/; +/*7*/} /*8*/ catch /*9*/ ( /*10*/ e /*11*/ ) /*12*/ { /*13*/ + +/*14*/} /*15*/ finally /*16*/ { /*17*/ + +/*18*/} /*19*/ \ No newline at end of file diff --git a/tests/cases/compiler/variableDeclarationInnerCommentEmit.ts b/tests/cases/compiler/variableDeclarationInnerCommentEmit.ts new file mode 100644 index 00000000000..7aa034f065e --- /dev/null +++ b/tests/cases/compiler/variableDeclarationInnerCommentEmit.ts @@ -0,0 +1,6 @@ +var a = /*some comment*/ null; +var b /*some comment*/ = null; +var /*some comment*/ c = null; + +// no space +var a=/*some comment*/null; \ No newline at end of file diff --git a/tests/cases/compiler/whileStatementInnerComments.ts b/tests/cases/compiler/whileStatementInnerComments.ts new file mode 100644 index 00000000000..dbf7fa06933 --- /dev/null +++ b/tests/cases/compiler/whileStatementInnerComments.ts @@ -0,0 +1,3 @@ +/*a*/ while /*b*/ ( /*c*/ false /*d*/ ) /*e*/ {} + +/*a*/ do /*b*/ {} /*c*/ while /*d*/ ( /*e*/ true /*f*/ ); diff --git a/tests/cases/compiler/withStatementInternalComments.ts b/tests/cases/compiler/withStatementInternalComments.ts new file mode 100644 index 00000000000..e0de23f3f75 --- /dev/null +++ b/tests/cases/compiler/withStatementInternalComments.ts @@ -0,0 +1,2 @@ +// @ts-ignore +/*1*/ with /*2*/ ( /*3*/ false /*4*/ ) /*5*/ {} \ No newline at end of file diff --git a/tests/cases/compiler/yieldExpressionInnerCommentEmit.ts b/tests/cases/compiler/yieldExpressionInnerCommentEmit.ts new file mode 100644 index 00000000000..188aafa260d --- /dev/null +++ b/tests/cases/compiler/yieldExpressionInnerCommentEmit.ts @@ -0,0 +1,8 @@ +// @target: es6 +function * foo2() { + /*comment1*/ yield 1; + yield /*comment2*/ 2; + yield 3 /*comment3*/ + yield */*comment4*/ [4]; + yield /*comment5*/* [5]; +} From 8dfcc364bbb44f26911c454caa30c35d11f8f21e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 3 Mar 2018 09:26:40 -0800 Subject: [PATCH 292/298] Defer distributive conditional type when check type is generic --- src/compiler/checker.ts | 74 ++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5e1933e185f..259714fe6f7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7899,6 +7899,7 @@ namespace ts { } else if (flags & TypeFlags.Any) { includes |= TypeIncludes.Any; + if (type === wildcardType) includes |= TypeIncludes.Wildcard; } else if (flags & TypeFlags.Never) { includes |= TypeIncludes.Never; @@ -7950,7 +7951,7 @@ namespace ts { return neverType; } if (includes & TypeIncludes.Any) { - return anyType; + return includes & TypeIncludes.Wildcard ? wildcardType : anyType; } if (includes & TypeIncludes.EmptyObject && !(includes & TypeIncludes.ObjectType)) { typeSet.push(emptyObjectType); @@ -8188,6 +8189,9 @@ namespace ts { } function getIndexedAccessType(objectType: Type, indexType: Type, accessNode?: ElementAccessExpression | IndexedAccessTypeNode): Type { + if (objectType === wildcardType || indexType === wildcardType) { + return wildcardType; + } // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in @@ -8253,37 +8257,45 @@ namespace ts { function getConditionalType(root: ConditionalRoot, mapper: TypeMapper): Type { const checkType = instantiateType(root.checkType, mapper); const extendsType = instantiateType(root.extendsType, mapper); - // Return falseType for a definitely false extends check. We check an instantations of the two - // types with type parameters mapped to the wildcard type, the most permissive instantiations - // possible (the wildcard type is assignable to and from all types). If those are not related, - // then no instatiations will be and we can just return the false branch type. - if (!typeMaybeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { - return instantiateType(root.falseType, mapper); + if (checkType === wildcardType || extendsType === wildcardType) { + return wildcardType; } - // The check could be true for some instantiation - let combinedMapper: TypeMapper; - if (root.inferTypeParameters) { - const inferences = map(root.inferTypeParameters, createInferenceInfo); - // We don't want inferences from constraints as they may cause us to eagerly resolve the - // conditional type instead of deferring resolution. Also, we always want strict function - // types rules (i.e. proper contravariance) for inferences. - inferTypes(inferences, checkType, extendsType, InferencePriority.NoConstraints | InferencePriority.AlwaysStrict); - // We infer {} when there are no candidates for a type parameter - const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || emptyObjectType); - combinedMapper = combineTypeMappers(mapper, createTypeMapper(root.inferTypeParameters, inferredTypes)); - } - // Return union of trueType and falseType for 'any' since it matches anything - if (checkType.flags & TypeFlags.Any) { - return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); - } - // Instantiate the extends type including inferences for 'infer T' type parameters - const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; - // Return trueType for a definitely true extends check. The definitely assignable relation excludes - // type variable constraints from consideration. Without the definitely assignable relation, the type - // type Foo = T extends { x: string } ? string : number - // would immediately resolve to 'string' instead of being deferred. - if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { - return instantiateType(root.trueType, combinedMapper || mapper); + // If this is a distributive conditional type and the check type is generic, we need to defer + // resolution of the conditional type such that a later instantiation will properly distribute + // over union types. + if (!root.isDistributive || !maybeTypeOfKind(checkType, TypeFlags.Instantiable)) { + // Return falseType for a definitely false extends check. We check an instantations of the two + // types with type parameters mapped to the wildcard type, the most permissive instantiations + // possible (the wildcard type is assignable to and from all types). If those are not related, + // then no instatiations will be and we can just return the false branch type. + if (!isTypeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { + return instantiateType(root.falseType, mapper); + } + // The check could be true for some instantiation + let combinedMapper: TypeMapper; + if (root.inferTypeParameters) { + const inferences = map(root.inferTypeParameters, createInferenceInfo); + // We don't want inferences from constraints as they may cause us to eagerly resolve the + // conditional type instead of deferring resolution. Also, we always want strict function + // types rules (i.e. proper contravariance) for inferences. + inferTypes(inferences, checkType, extendsType, InferencePriority.NoConstraints | InferencePriority.AlwaysStrict); + // We infer {} when there are no candidates for a type parameter + const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || emptyObjectType); + combinedMapper = combineTypeMappers(mapper, createTypeMapper(root.inferTypeParameters, inferredTypes)); + } + // Return union of trueType and falseType for 'any' since it matches anything + if (checkType.flags & TypeFlags.Any) { + return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); + } + // Instantiate the extends type including inferences for 'infer T' type parameters + const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; + // Return trueType for a definitely true extends check. The definitely assignable relation excludes + // type variable constraints from consideration. Without the definitely assignable relation, the type + // type Foo = T extends { x: string } ? string : number + // would immediately resolve to 'string' instead of being deferred. + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + return instantiateType(root.trueType, combinedMapper || mapper); + } } // Return a deferred type for a check that is neither definitely true nor definitely false const erasedCheckType = getActualTypeParameter(checkType); From c1aa0bdb84d8930237d0758f1d0066b804d4b52a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 3 Mar 2018 18:04:27 -0800 Subject: [PATCH 293/298] Accept new baselines --- tests/baselines/reference/inferTypes1.types | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index 4ca78f65081..f7cdc69943f 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -312,7 +312,7 @@ type T60 = infer U; // Error >U : U type T61 = infer A extends infer B ? infer C : infer D; // Error ->T61 : {} +>T61 : T61 >T : T >A : A >B : B From 081a394927ed67536cf9cf4df52b94fb85c5c932 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 3 Mar 2018 18:08:36 -0800 Subject: [PATCH 294/298] Add regression test --- .../conformance/types/conditional/inferTypes1.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/cases/conformance/types/conditional/inferTypes1.ts b/tests/cases/conformance/types/conditional/inferTypes1.ts index 671d68c3247..1defacc08cc 100644 --- a/tests/cases/conformance/types/conditional/inferTypes1.ts +++ b/tests/cases/conformance/types/conditional/inferTypes1.ts @@ -135,3 +135,18 @@ type C2 = S extends A2 ? [T, U] : never; type A = T extends string ? { [P in T]: void; } : T; type B = string extends T ? { [P in T]: void; } : T; // Error + +// Repro from #22302 + +type MatchingKeys = + K extends keyof T ? T[K] extends U ? K : never : never; + +type VoidKeys = MatchingKeys; + +interface test { + a: 1, + b: void +} + +type T80 = MatchingKeys; +type T81 = VoidKeys; From 6569f45812304e84376d950e6040d89a01287cb5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 3 Mar 2018 18:08:42 -0800 Subject: [PATCH 295/298] Accept new baselines --- .../reference/inferTypes1.errors.txt | 15 +++++++ tests/baselines/reference/inferTypes1.js | 15 +++++++ tests/baselines/reference/inferTypes1.symbols | 44 +++++++++++++++++++ tests/baselines/reference/inferTypes1.types | 44 +++++++++++++++++++ 4 files changed, 118 insertions(+) diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index b36528f721d..5531ec08c7f 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -191,4 +191,19 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type B = string extends T ? { [P in T]: void; } : T; // Error ~ !!! error TS2322: Type 'T' is not assignable to type 'string'. + + // Repro from #22302 + + type MatchingKeys = + K extends keyof T ? T[K] extends U ? K : never : never; + + type VoidKeys = MatchingKeys; + + interface test { + a: 1, + b: void + } + + type T80 = MatchingKeys; + type T81 = VoidKeys; \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.js b/tests/baselines/reference/inferTypes1.js index bc53f238997..6e41cfe1998 100644 --- a/tests/baselines/reference/inferTypes1.js +++ b/tests/baselines/reference/inferTypes1.js @@ -133,6 +133,21 @@ type C2 = S extends A2 ? [T, U] : never; type A = T extends string ? { [P in T]: void; } : T; type B = string extends T ? { [P in T]: void; } : T; // Error + +// Repro from #22302 + +type MatchingKeys = + K extends keyof T ? T[K] extends U ? K : never : never; + +type VoidKeys = MatchingKeys; + +interface test { + a: 1, + b: void +} + +type T80 = MatchingKeys; +type T81 = VoidKeys; //// [inferTypes1.js] diff --git a/tests/baselines/reference/inferTypes1.symbols b/tests/baselines/reference/inferTypes1.symbols index 784482e72c9..9e09eaea21d 100644 --- a/tests/baselines/reference/inferTypes1.symbols +++ b/tests/baselines/reference/inferTypes1.symbols @@ -575,3 +575,47 @@ type B = string extends T ? { [P in T]: void; } : T; // Error >T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) >T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) +// Repro from #22302 + +type MatchingKeys = +>MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 133, 55)) +>T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) +>U : Symbol(U, Decl(inferTypes1.ts, 137, 20)) +>K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) +>T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) +>T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) + + K extends keyof T ? T[K] extends U ? K : never : never; +>K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) +>T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) +>T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) +>K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) +>U : Symbol(U, Decl(inferTypes1.ts, 137, 20)) +>K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) + +type VoidKeys = MatchingKeys; +>VoidKeys : Symbol(VoidKeys, Decl(inferTypes1.ts, 138, 59)) +>T : Symbol(T, Decl(inferTypes1.ts, 140, 14)) +>MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 133, 55)) +>T : Symbol(T, Decl(inferTypes1.ts, 140, 14)) + +interface test { +>test : Symbol(test, Decl(inferTypes1.ts, 140, 41)) + + a: 1, +>a : Symbol(test.a, Decl(inferTypes1.ts, 142, 16)) + + b: void +>b : Symbol(test.b, Decl(inferTypes1.ts, 143, 9)) +} + +type T80 = MatchingKeys; +>T80 : Symbol(T80, Decl(inferTypes1.ts, 145, 1)) +>MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 133, 55)) +>test : Symbol(test, Decl(inferTypes1.ts, 140, 41)) + +type T81 = VoidKeys; +>T81 : Symbol(T81, Decl(inferTypes1.ts, 147, 36)) +>VoidKeys : Symbol(VoidKeys, Decl(inferTypes1.ts, 138, 59)) +>test : Symbol(test, Decl(inferTypes1.ts, 140, 41)) + diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index f7cdc69943f..523dd669e4c 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -582,3 +582,47 @@ type B = string extends T ? { [P in T]: void; } : T; // Error >T : T >T : T +// Repro from #22302 + +type MatchingKeys = +>MatchingKeys : MatchingKeys +>T : T +>U : U +>K : K +>T : T +>T : T + + K extends keyof T ? T[K] extends U ? K : never : never; +>K : K +>T : T +>T : T +>K : K +>U : U +>K : K + +type VoidKeys = MatchingKeys; +>VoidKeys : MatchingKeys +>T : T +>MatchingKeys : MatchingKeys +>T : T + +interface test { +>test : test + + a: 1, +>a : 1 + + b: void +>b : void +} + +type T80 = MatchingKeys; +>T80 : "b" +>MatchingKeys : MatchingKeys +>test : test + +type T81 = VoidKeys; +>T81 : "b" +>VoidKeys : MatchingKeys +>test : test + From 6fcc99e80047a8172a7d13dc784582931a927cbf Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Mar 2018 16:28:22 -0800 Subject: [PATCH 296/298] Properly check inferred constraints for 'infer X' type variables --- src/compiler/checker.ts | 143 ++++++++++++++++++++-------------------- src/compiler/types.ts | 3 +- 2 files changed, 75 insertions(+), 71 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 259714fe6f7..054fb78d802 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8260,28 +8260,18 @@ namespace ts { if (checkType === wildcardType || extendsType === wildcardType) { return wildcardType; } - // If this is a distributive conditional type and the check type is generic, we need to defer + // If this is a distributive conditional type and the check type is generic we need to defer // resolution of the conditional type such that a later instantiation will properly distribute // over union types. if (!root.isDistributive || !maybeTypeOfKind(checkType, TypeFlags.Instantiable)) { - // Return falseType for a definitely false extends check. We check an instantations of the two - // types with type parameters mapped to the wildcard type, the most permissive instantiations - // possible (the wildcard type is assignable to and from all types). If those are not related, - // then no instatiations will be and we can just return the false branch type. - if (!isTypeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(extendsType))) { - return instantiateType(root.falseType, mapper); - } - // The check could be true for some instantiation let combinedMapper: TypeMapper; if (root.inferTypeParameters) { - const inferences = map(root.inferTypeParameters, createInferenceInfo); + const context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, InferenceFlags.None); // We don't want inferences from constraints as they may cause us to eagerly resolve the // conditional type instead of deferring resolution. Also, we always want strict function // types rules (i.e. proper contravariance) for inferences. - inferTypes(inferences, checkType, extendsType, InferencePriority.NoConstraints | InferencePriority.AlwaysStrict); - // We infer {} when there are no candidates for a type parameter - const inferredTypes = map(inferences, inference => getTypeFromInference(inference) || emptyObjectType); - combinedMapper = combineTypeMappers(mapper, createTypeMapper(root.inferTypeParameters, inferredTypes)); + inferTypes(context.inferences, checkType, extendsType, InferencePriority.NoConstraints | InferencePriority.AlwaysStrict); + combinedMapper = combineTypeMappers(mapper, context); } // Return union of trueType and falseType for 'any' since it matches anything if (checkType.flags & TypeFlags.Any) { @@ -8289,6 +8279,13 @@ namespace ts { } // Instantiate the extends type including inferences for 'infer T' type parameters const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; + // Return falseType for a definitely false extends check. We check an instantations of the two + // types with type parameters mapped to the wildcard type, the most permissive instantiations + // possible (the wildcard type is assignable to and from all types). If those are not related, + // then no instatiations will be and we can just return the false branch type. + if (!isTypeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(inferredExtendsType))) { + return instantiateType(root.falseType, mapper); + } // Return trueType for a definitely true extends check. The definitely assignable relation excludes // type variable constraints from consideration. Without the definitely assignable relation, the type // type Foo = T extends { x: string } ? string : number @@ -8734,12 +8731,12 @@ namespace ts { } function isInferenceContext(mapper: TypeMapper): mapper is InferenceContext { - return !!(mapper).signature; + return !!(mapper).typeParameters; } function cloneTypeMapper(mapper: TypeMapper): TypeMapper { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | InferenceFlags.NoDefault, mapper.compareTypes, mapper.inferences) : + createInferenceContext(mapper.typeParameters, mapper.signature, mapper.flags | InferenceFlags.NoDefault, mapper.compareTypes, mapper.inferences) : mapper; } @@ -11394,9 +11391,10 @@ namespace ts { } } - function createInferenceContext(signature: Signature, flags: InferenceFlags, compareTypes?: TypeComparer, baseInferences?: InferenceInfo[]): InferenceContext { - const inferences = baseInferences ? map(baseInferences, cloneInferenceInfo) : map(signature.typeParameters, createInferenceInfo); + function createInferenceContext(typeParameters: TypeParameter[], signature: Signature, flags: InferenceFlags, compareTypes?: TypeComparer, baseInferences?: InferenceInfo[]): InferenceContext { + const inferences = baseInferences ? map(baseInferences, cloneInferenceInfo) : map(typeParameters, createInferenceInfo); const context = mapper as InferenceContext; + context.typeParameters = typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; @@ -11525,7 +11523,7 @@ namespace ts { const templateType = getTemplateTypeFromMappedType(target); const inference = createInferenceInfo(typeParameter); inferTypes([inference], sourceType, templateType); - return getTypeFromInference(inference) || emptyObjectType; + return getTypeFromInference(inference); } function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean) { @@ -11544,7 +11542,7 @@ namespace ts { function getTypeFromInference(inference: InferenceInfo) { return inference.candidates ? getUnionType(inference.candidates, UnionReduction.Subtype) : inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : - undefined; + emptyObjectType; } function inferTypes(inferences: InferenceInfo[], originalSource: Type, originalTarget: Type, priority: InferencePriority = 0) { @@ -11917,63 +11915,68 @@ namespace ts { const inference = context.inferences[index]; let inferredType = inference.inferredType; if (!inferredType) { - if (inference.candidates) { - // Extract all object literal types and replace them with a single widened and normalized type. - const candidates = widenObjectLiteralCandidates(inference.candidates); - // We widen inferred literal types if - // all inferences were made to top-level ocurrences of the type parameter, and - // the type parameter has no constraint or its constraint includes no primitive or literal types, and - // the type parameter was fixed during inference or does not occur at top-level in the return type. - const signature = context.signature; - const widenLiteralTypes = inference.topLevel && - !hasPrimitiveConstraint(inference.typeParameter) && - (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); - const baseCandidates = widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; - // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if - // union types were requested or if all inferences were made from the return type position, infer a - // union type. Otherwise, infer a common supertype. - const unwidenedType = context.flags & InferenceFlags.InferUnionTypes || inference.priority & InferencePriority.ReturnType ? - getUnionType(baseCandidates, UnionReduction.Subtype) : - getCommonSupertype(baseCandidates); - inferredType = getWidenedType(unwidenedType); - // If we have inferred 'never' but have contravariant candidates. To get a more specific type we - // infer from the contravariant candidates instead. - if (inferredType.flags & TypeFlags.Never && inference.contraCandidates) { + const signature = context.signature; + if (signature) { + if (inference.candidates) { + // Extract all object literal types and replace them with a single widened and normalized type. + const candidates = widenObjectLiteralCandidates(inference.candidates); + // We widen inferred literal types if + // all inferences were made to top-level ocurrences of the type parameter, and + // the type parameter has no constraint or its constraint includes no primitive or literal types, and + // the type parameter was fixed during inference or does not occur at top-level in the return type. + const widenLiteralTypes = inference.topLevel && + !hasPrimitiveConstraint(inference.typeParameter) && + (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + const baseCandidates = widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates; + // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if + // union types were requested or if all inferences were made from the return type position, infer a + // union type. Otherwise, infer a common supertype. + const unwidenedType = context.flags & InferenceFlags.InferUnionTypes || inference.priority & InferencePriority.ReturnType ? + getUnionType(baseCandidates, UnionReduction.Subtype) : + getCommonSupertype(baseCandidates); + inferredType = getWidenedType(unwidenedType); + // If we have inferred 'never' but have contravariant candidates. To get a more specific type we + // infer from the contravariant candidates instead. + if (inferredType.flags & TypeFlags.Never && inference.contraCandidates) { + inferredType = getCommonSubtype(inference.contraCandidates); + } + } + else if (inference.contraCandidates) { + // We only have contravariant inferences, infer the best common subtype of those inferredType = getCommonSubtype(inference.contraCandidates); } - } - else if (inference.contraCandidates) { - // We only have contravariant inferences, infer the best common subtype of those - inferredType = getCommonSubtype(inference.contraCandidates); - } - else if (context.flags & InferenceFlags.NoDefault) { - // We use silentNeverType as the wildcard that signals no inferences. - inferredType = silentNeverType; - } - else { - // Infer either the default or the empty object type when no inferences were - // made. It is important to remember that in this case, inference still - // succeeds, meaning there is no error for not having inference candidates. An - // inference error only occurs when there are *conflicting* candidates, i.e. - // candidates with no common supertype. - const defaultType = getDefaultFromTypeParameter(inference.typeParameter); - if (defaultType) { - // Instantiate the default type. Any forward reference to a type - // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, - combineTypeMappers( - createBackreferenceMapper(context.signature.typeParameters, index), - context)); + else if (context.flags & InferenceFlags.NoDefault) { + // We use silentNeverType as the wildcard that signals no inferences. + inferredType = silentNeverType; } else { - inferredType = getDefaultTypeArgumentType(!!(context.flags & InferenceFlags.AnyDefault)); + // Infer either the default or the empty object type when no inferences were + // made. It is important to remember that in this case, inference still + // succeeds, meaning there is no error for not having inference candidates. An + // inference error only occurs when there are *conflicting* candidates, i.e. + // candidates with no common supertype. + const defaultType = getDefaultFromTypeParameter(inference.typeParameter); + if (defaultType) { + // Instantiate the default type. Any forward reference to a type + // parameter should be instantiated to the empty object type. + inferredType = instantiateType(defaultType, + combineTypeMappers( + createBackreferenceMapper(context.signature.typeParameters, index), + context)); + } + else { + inferredType = getDefaultTypeArgumentType(!!(context.flags & InferenceFlags.AnyDefault)); + } } } + else { + inferredType = getTypeFromInference(inference); + } inferredType = getWidenedUniqueESSymbolType(inferredType); inference.inferredType = inferredType; - const constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); + const constraint = getConstraintOfTypeParameter(inference.typeParameter); if (constraint) { const instantiatedConstraint = instantiateType(constraint, context); if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { @@ -15403,7 +15406,7 @@ namespace ts { for (const signature of signatures) { if (signature.typeParameters) { const isJavascript = isInJavaScriptFile(node); - const inferenceContext = createInferenceContext(signature, /*flags*/ isJavascript ? InferenceFlags.AnyDefault : InferenceFlags.None); + const inferenceContext = createInferenceContext(signature.typeParameters, signature, /*flags*/ isJavascript ? InferenceFlags.AnyDefault : InferenceFlags.None); const typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } @@ -16707,7 +16710,7 @@ namespace ts { // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature: Signature, contextualSignature: Signature, contextualMapper?: TypeMapper, compareTypes?: TypeComparer): Signature { - const context = createInferenceContext(signature, InferenceFlags.InferUnionTypes, compareTypes); + const context = createInferenceContext(signature.typeParameters, signature, InferenceFlags.InferUnionTypes, compareTypes); forEachMatchingParameterType(contextualSignature, signature, (source, target) => { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); @@ -17473,7 +17476,7 @@ namespace ts { let candidate: Signature; const inferenceContext = originalCandidate.typeParameters ? - createInferenceContext(originalCandidate, /*flags*/ isInJavaScriptFile(node) ? InferenceFlags.AnyDefault : InferenceFlags.None) : + createInferenceContext(originalCandidate.typeParameters, originalCandidate, /*flags*/ isInJavaScriptFile(node) ? InferenceFlags.AnyDefault : InferenceFlags.None) : undefined; while (true) { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b933d6853af..5e2bce4d72e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3966,7 +3966,8 @@ namespace ts { /* @internal */ export interface InferenceContext extends TypeMapper { - signature: Signature; // Generic signature for which inferences are made + typeParameters: TypeParameter[]; // Type parameters for which inferences are made + signature: Signature; // Generic signature for which inferences are made (if any) inferences: InferenceInfo[]; // Inferences made for each type parameter flags: InferenceFlags; // Inference flags compareTypes: TypeComparer; // Type comparer function From 19e07eaea63210d1afc8045adab72f418341edc3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Mar 2018 16:49:06 -0800 Subject: [PATCH 297/298] Add tests --- .../types/conditional/inferTypes1.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/cases/conformance/types/conditional/inferTypes1.ts b/tests/cases/conformance/types/conditional/inferTypes1.ts index 1defacc08cc..8907cf79d91 100644 --- a/tests/cases/conformance/types/conditional/inferTypes1.ts +++ b/tests/cases/conformance/types/conditional/inferTypes1.ts @@ -90,6 +90,15 @@ type T76 = { x: T }; type T77 = T extends T76 ? T76 : never; type T78 = T extends T76 ? T76 : never; +type Foo = [T, U]; +type Bar = T extends Foo ? Foo : never; + +type T90 = Bar<[string, string]>; // [string, string] +type T91 = Bar<[string, "a"]>; // [string, "a"] +type T92 = Bar<[string, "a"] & { x: string }>; // [string, "a"] +type T93 = Bar<["a", string]>; // never +type T94 = Bar<[number, number]>; // never + // Example from #21496 type JsonifiedObject = { [K in keyof T]: Jsonified }; @@ -150,3 +159,11 @@ interface test { type T80 = MatchingKeys; type T81 = VoidKeys; + +// Repro from #22221 + +type MustBeString = T; +type EnsureIsString = T extends MustBeString ? U : never; + +type Test1 = EnsureIsString<"hello">; // "hello" +type Test2 = EnsureIsString<42>; // never From f97ab4d3efd638cb878642f849dcd66ddbe5d5dc Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 4 Mar 2018 16:49:13 -0800 Subject: [PATCH 298/298] Accept new baselines --- .../reference/inferTypes1.errors.txt | 19 +- tests/baselines/reference/inferTypes1.js | 17 + tests/baselines/reference/inferTypes1.symbols | 309 +++++++++++------- tests/baselines/reference/inferTypes1.types | 63 ++++ 4 files changed, 284 insertions(+), 124 deletions(-) diff --git a/tests/baselines/reference/inferTypes1.errors.txt b/tests/baselines/reference/inferTypes1.errors.txt index 5531ec08c7f..3b627a0557f 100644 --- a/tests/baselines/reference/inferTypes1.errors.txt +++ b/tests/baselines/reference/inferTypes1.errors.txt @@ -17,7 +17,7 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS2304: C tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS4081: Exported type alias 'T62' has or is using private name 'U'. tests/cases/conformance/types/conditional/inferTypes1.ts(81,44): error TS2344: Type 'U' does not satisfy the constraint 'string'. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: Type 'T' is not assignable to type 'string'. +tests/cases/conformance/types/conditional/inferTypes1.ts(143,40): error TS2322: Type 'T' is not assignable to type 'string'. ==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ==== @@ -144,6 +144,15 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type T77 = T extends T76 ? T76 : never; type T78 = T extends T76 ? T76 : never; + type Foo = [T, U]; + type Bar = T extends Foo ? Foo : never; + + type T90 = Bar<[string, string]>; // [string, string] + type T91 = Bar<[string, "a"]>; // [string, "a"] + type T92 = Bar<[string, "a"] & { x: string }>; // [string, "a"] + type T93 = Bar<["a", string]>; // never + type T94 = Bar<[number, number]>; // never + // Example from #21496 type JsonifiedObject = { [K in keyof T]: Jsonified }; @@ -206,4 +215,12 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(134,40): error TS2322: type T80 = MatchingKeys; type T81 = VoidKeys; + + // Repro from #22221 + + type MustBeString = T; + type EnsureIsString = T extends MustBeString ? U : never; + + type Test1 = EnsureIsString<"hello">; // "hello" + type Test2 = EnsureIsString<42>; // never \ No newline at end of file diff --git a/tests/baselines/reference/inferTypes1.js b/tests/baselines/reference/inferTypes1.js index 6e41cfe1998..909fbf29982 100644 --- a/tests/baselines/reference/inferTypes1.js +++ b/tests/baselines/reference/inferTypes1.js @@ -88,6 +88,15 @@ type T76 = { x: T }; type T77 = T extends T76 ? T76 : never; type T78 = T extends T76 ? T76 : never; +type Foo = [T, U]; +type Bar = T extends Foo ? Foo : never; + +type T90 = Bar<[string, string]>; // [string, string] +type T91 = Bar<[string, "a"]>; // [string, "a"] +type T92 = Bar<[string, "a"] & { x: string }>; // [string, "a"] +type T93 = Bar<["a", string]>; // never +type T94 = Bar<[number, number]>; // never + // Example from #21496 type JsonifiedObject = { [K in keyof T]: Jsonified }; @@ -148,6 +157,14 @@ interface test { type T80 = MatchingKeys; type T81 = VoidKeys; + +// Repro from #22221 + +type MustBeString = T; +type EnsureIsString = T extends MustBeString ? U : never; + +type Test1 = EnsureIsString<"hello">; // "hello" +type Test2 = EnsureIsString<42>; // never //// [inferTypes1.js] diff --git a/tests/baselines/reference/inferTypes1.symbols b/tests/baselines/reference/inferTypes1.symbols index 9e09eaea21d..b1e82a16f5f 100644 --- a/tests/baselines/reference/inferTypes1.symbols +++ b/tests/baselines/reference/inferTypes1.symbols @@ -406,216 +406,279 @@ type T78 = T extends T76 ? T76 : never; >X : Symbol(X, Decl(inferTypes1.ts, 87, 33), Decl(inferTypes1.ts, 87, 42)) >X : Symbol(X, Decl(inferTypes1.ts, 87, 33), Decl(inferTypes1.ts, 87, 42)) +type Foo = [T, U]; +>Foo : Symbol(Foo, Decl(inferTypes1.ts, 87, 66)) +>T : Symbol(T, Decl(inferTypes1.ts, 89, 9)) +>U : Symbol(U, Decl(inferTypes1.ts, 89, 26)) +>T : Symbol(T, Decl(inferTypes1.ts, 89, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 89, 9)) +>U : Symbol(U, Decl(inferTypes1.ts, 89, 26)) + +type Bar = T extends Foo ? Foo : never; +>Bar : Symbol(Bar, Decl(inferTypes1.ts, 89, 49)) +>T : Symbol(T, Decl(inferTypes1.ts, 90, 9)) +>T : Symbol(T, Decl(inferTypes1.ts, 90, 9)) +>Foo : Symbol(Foo, Decl(inferTypes1.ts, 87, 66)) +>X : Symbol(X, Decl(inferTypes1.ts, 90, 33)) +>Y : Symbol(Y, Decl(inferTypes1.ts, 90, 42)) +>Foo : Symbol(Foo, Decl(inferTypes1.ts, 87, 66)) +>X : Symbol(X, Decl(inferTypes1.ts, 90, 33)) +>Y : Symbol(Y, Decl(inferTypes1.ts, 90, 42)) + +type T90 = Bar<[string, string]>; // [string, string] +>T90 : Symbol(T90, Decl(inferTypes1.ts, 90, 66)) +>Bar : Symbol(Bar, Decl(inferTypes1.ts, 89, 49)) + +type T91 = Bar<[string, "a"]>; // [string, "a"] +>T91 : Symbol(T91, Decl(inferTypes1.ts, 92, 33)) +>Bar : Symbol(Bar, Decl(inferTypes1.ts, 89, 49)) + +type T92 = Bar<[string, "a"] & { x: string }>; // [string, "a"] +>T92 : Symbol(T92, Decl(inferTypes1.ts, 93, 30)) +>Bar : Symbol(Bar, Decl(inferTypes1.ts, 89, 49)) +>x : Symbol(x, Decl(inferTypes1.ts, 94, 32)) + +type T93 = Bar<["a", string]>; // never +>T93 : Symbol(T93, Decl(inferTypes1.ts, 94, 46)) +>Bar : Symbol(Bar, Decl(inferTypes1.ts, 89, 49)) + +type T94 = Bar<[number, number]>; // never +>T94 : Symbol(T94, Decl(inferTypes1.ts, 95, 30)) +>Bar : Symbol(Bar, Decl(inferTypes1.ts, 89, 49)) + // Example from #21496 type JsonifiedObject = { [K in keyof T]: Jsonified }; ->JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 87, 66)) ->T : Symbol(T, Decl(inferTypes1.ts, 91, 21)) ->K : Symbol(K, Decl(inferTypes1.ts, 91, 44)) ->T : Symbol(T, Decl(inferTypes1.ts, 91, 21)) ->Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 91, 77)) ->T : Symbol(T, Decl(inferTypes1.ts, 91, 21)) ->K : Symbol(K, Decl(inferTypes1.ts, 91, 44)) +>JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 96, 33)) +>T : Symbol(T, Decl(inferTypes1.ts, 100, 21)) +>K : Symbol(K, Decl(inferTypes1.ts, 100, 44)) +>T : Symbol(T, Decl(inferTypes1.ts, 100, 21)) +>Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 100, 77)) +>T : Symbol(T, Decl(inferTypes1.ts, 100, 21)) +>K : Symbol(K, Decl(inferTypes1.ts, 100, 44)) type Jsonified = ->Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 91, 77)) ->T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) +>Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 100, 77)) +>T : Symbol(T, Decl(inferTypes1.ts, 102, 15)) T extends string | number | boolean | null ? T ->T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) ->T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 102, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 102, 15)) : T extends undefined | Function ? never // undefined and functions are removed ->T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 102, 15)) >Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) : T extends { toJSON(): infer R } ? R // toJSON is called if it exists (e.g. Date) ->T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) ->toJSON : Symbol(toJSON, Decl(inferTypes1.ts, 96, 17)) ->R : Symbol(R, Decl(inferTypes1.ts, 96, 33)) ->R : Symbol(R, Decl(inferTypes1.ts, 96, 33)) +>T : Symbol(T, Decl(inferTypes1.ts, 102, 15)) +>toJSON : Symbol(toJSON, Decl(inferTypes1.ts, 105, 17)) +>R : Symbol(R, Decl(inferTypes1.ts, 105, 33)) +>R : Symbol(R, Decl(inferTypes1.ts, 105, 33)) : T extends object ? JsonifiedObject ->T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) ->JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 87, 66)) ->T : Symbol(T, Decl(inferTypes1.ts, 93, 15)) +>T : Symbol(T, Decl(inferTypes1.ts, 102, 15)) +>JsonifiedObject : Symbol(JsonifiedObject, Decl(inferTypes1.ts, 96, 33)) +>T : Symbol(T, Decl(inferTypes1.ts, 102, 15)) : "what is this"; type Example = { ->Example : Symbol(Example, Decl(inferTypes1.ts, 98, 21)) +>Example : Symbol(Example, Decl(inferTypes1.ts, 107, 21)) str: "literalstring", ->str : Symbol(str, Decl(inferTypes1.ts, 100, 16)) +>str : Symbol(str, Decl(inferTypes1.ts, 109, 16)) fn: () => void, ->fn : Symbol(fn, Decl(inferTypes1.ts, 101, 25)) +>fn : Symbol(fn, Decl(inferTypes1.ts, 110, 25)) date: Date, ->date : Symbol(date, Decl(inferTypes1.ts, 102, 19)) +>date : Symbol(date, Decl(inferTypes1.ts, 111, 19)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) customClass: MyClass, ->customClass : Symbol(customClass, Decl(inferTypes1.ts, 103, 15)) ->MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 110, 1)) +>customClass : Symbol(customClass, Decl(inferTypes1.ts, 112, 15)) +>MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 119, 1)) obj: { ->obj : Symbol(obj, Decl(inferTypes1.ts, 104, 25)) +>obj : Symbol(obj, Decl(inferTypes1.ts, 113, 25)) prop: "property", ->prop : Symbol(prop, Decl(inferTypes1.ts, 105, 10)) +>prop : Symbol(prop, Decl(inferTypes1.ts, 114, 10)) clz: MyClass, ->clz : Symbol(clz, Decl(inferTypes1.ts, 106, 25)) ->MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 110, 1)) +>clz : Symbol(clz, Decl(inferTypes1.ts, 115, 25)) +>MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 119, 1)) nested: { attr: Date } ->nested : Symbol(nested, Decl(inferTypes1.ts, 107, 21)) ->attr : Symbol(attr, Decl(inferTypes1.ts, 108, 17)) +>nested : Symbol(nested, Decl(inferTypes1.ts, 116, 21)) +>attr : Symbol(attr, Decl(inferTypes1.ts, 117, 17)) >Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }, } declare class MyClass { ->MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 110, 1)) +>MyClass : Symbol(MyClass, Decl(inferTypes1.ts, 119, 1)) toJSON(): "correct"; ->toJSON : Symbol(MyClass.toJSON, Decl(inferTypes1.ts, 112, 23)) +>toJSON : Symbol(MyClass.toJSON, Decl(inferTypes1.ts, 121, 23)) } type JsonifiedExample = Jsonified; ->JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 114, 1)) ->Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 91, 77)) ->Example : Symbol(Example, Decl(inferTypes1.ts, 98, 21)) +>JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 123, 1)) +>Jsonified : Symbol(Jsonified, Decl(inferTypes1.ts, 100, 77)) +>Example : Symbol(Example, Decl(inferTypes1.ts, 107, 21)) declare let ex: JsonifiedExample; ->ex : Symbol(ex, Decl(inferTypes1.ts, 117, 11)) ->JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 114, 1)) +>ex : Symbol(ex, Decl(inferTypes1.ts, 126, 11)) +>JsonifiedExample : Symbol(JsonifiedExample, Decl(inferTypes1.ts, 123, 1)) const z1: "correct" = ex.customClass; ->z1 : Symbol(z1, Decl(inferTypes1.ts, 118, 5)) ->ex.customClass : Symbol(customClass, Decl(inferTypes1.ts, 103, 15)) ->ex : Symbol(ex, Decl(inferTypes1.ts, 117, 11)) ->customClass : Symbol(customClass, Decl(inferTypes1.ts, 103, 15)) +>z1 : Symbol(z1, Decl(inferTypes1.ts, 127, 5)) +>ex.customClass : Symbol(customClass, Decl(inferTypes1.ts, 112, 15)) +>ex : Symbol(ex, Decl(inferTypes1.ts, 126, 11)) +>customClass : Symbol(customClass, Decl(inferTypes1.ts, 112, 15)) const z2: string = ex.obj.nested.attr; ->z2 : Symbol(z2, Decl(inferTypes1.ts, 119, 5)) ->ex.obj.nested.attr : Symbol(attr, Decl(inferTypes1.ts, 108, 17)) ->ex.obj.nested : Symbol(nested, Decl(inferTypes1.ts, 107, 21)) ->ex.obj : Symbol(obj, Decl(inferTypes1.ts, 104, 25)) ->ex : Symbol(ex, Decl(inferTypes1.ts, 117, 11)) ->obj : Symbol(obj, Decl(inferTypes1.ts, 104, 25)) ->nested : Symbol(nested, Decl(inferTypes1.ts, 107, 21)) ->attr : Symbol(attr, Decl(inferTypes1.ts, 108, 17)) +>z2 : Symbol(z2, Decl(inferTypes1.ts, 128, 5)) +>ex.obj.nested.attr : Symbol(attr, Decl(inferTypes1.ts, 117, 17)) +>ex.obj.nested : Symbol(nested, Decl(inferTypes1.ts, 116, 21)) +>ex.obj : Symbol(obj, Decl(inferTypes1.ts, 113, 25)) +>ex : Symbol(ex, Decl(inferTypes1.ts, 126, 11)) +>obj : Symbol(obj, Decl(inferTypes1.ts, 113, 25)) +>nested : Symbol(nested, Decl(inferTypes1.ts, 116, 21)) +>attr : Symbol(attr, Decl(inferTypes1.ts, 117, 17)) // Repros from #21631 type A1> = [T, U]; ->A1 : Symbol(A1, Decl(inferTypes1.ts, 119, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 123, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 123, 10)) ->A1 : Symbol(A1, Decl(inferTypes1.ts, 119, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 123, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 123, 10)) +>A1 : Symbol(A1, Decl(inferTypes1.ts, 128, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 132, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 132, 10)) +>A1 : Symbol(A1, Decl(inferTypes1.ts, 128, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 132, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 132, 10)) type B1 = S extends A1 ? [T, U] : never; ->B1 : Symbol(B1, Decl(inferTypes1.ts, 123, 44)) ->S : Symbol(S, Decl(inferTypes1.ts, 124, 8)) ->S : Symbol(S, Decl(inferTypes1.ts, 124, 8)) ->A1 : Symbol(A1, Decl(inferTypes1.ts, 119, 38)) ->T : Symbol(T, Decl(inferTypes1.ts, 124, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 124, 40)) ->T : Symbol(T, Decl(inferTypes1.ts, 124, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 124, 40)) +>B1 : Symbol(B1, Decl(inferTypes1.ts, 132, 44)) +>S : Symbol(S, Decl(inferTypes1.ts, 133, 8)) +>S : Symbol(S, Decl(inferTypes1.ts, 133, 8)) +>A1 : Symbol(A1, Decl(inferTypes1.ts, 128, 38)) +>T : Symbol(T, Decl(inferTypes1.ts, 133, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 133, 40)) +>T : Symbol(T, Decl(inferTypes1.ts, 133, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 133, 40)) type A2 = [T, U]; ->A2 : Symbol(A2, Decl(inferTypes1.ts, 124, 61)) ->T : Symbol(T, Decl(inferTypes1.ts, 126, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 126, 10)) ->T : Symbol(T, Decl(inferTypes1.ts, 126, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 126, 10)) +>A2 : Symbol(A2, Decl(inferTypes1.ts, 133, 61)) +>T : Symbol(T, Decl(inferTypes1.ts, 135, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 135, 10)) +>T : Symbol(T, Decl(inferTypes1.ts, 135, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 135, 10)) type B2 = S extends A2 ? [T, U] : never; ->B2 : Symbol(B2, Decl(inferTypes1.ts, 126, 36)) ->S : Symbol(S, Decl(inferTypes1.ts, 127, 8)) ->S : Symbol(S, Decl(inferTypes1.ts, 127, 8)) ->A2 : Symbol(A2, Decl(inferTypes1.ts, 124, 61)) ->T : Symbol(T, Decl(inferTypes1.ts, 127, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 127, 40)) ->T : Symbol(T, Decl(inferTypes1.ts, 127, 31)) ->U : Symbol(U, Decl(inferTypes1.ts, 127, 40)) +>B2 : Symbol(B2, Decl(inferTypes1.ts, 135, 36)) +>S : Symbol(S, Decl(inferTypes1.ts, 136, 8)) +>S : Symbol(S, Decl(inferTypes1.ts, 136, 8)) +>A2 : Symbol(A2, Decl(inferTypes1.ts, 133, 61)) +>T : Symbol(T, Decl(inferTypes1.ts, 136, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 136, 40)) +>T : Symbol(T, Decl(inferTypes1.ts, 136, 31)) +>U : Symbol(U, Decl(inferTypes1.ts, 136, 40)) type C2 = S extends A2 ? [T, U] : never; ->C2 : Symbol(C2, Decl(inferTypes1.ts, 127, 61)) ->S : Symbol(S, Decl(inferTypes1.ts, 128, 8)) ->U : Symbol(U, Decl(inferTypes1.ts, 128, 10)) ->S : Symbol(S, Decl(inferTypes1.ts, 128, 8)) ->A2 : Symbol(A2, Decl(inferTypes1.ts, 124, 61)) ->T : Symbol(T, Decl(inferTypes1.ts, 128, 47)) ->U : Symbol(U, Decl(inferTypes1.ts, 128, 10)) ->T : Symbol(T, Decl(inferTypes1.ts, 128, 47)) ->U : Symbol(U, Decl(inferTypes1.ts, 128, 10)) +>C2 : Symbol(C2, Decl(inferTypes1.ts, 136, 61)) +>S : Symbol(S, Decl(inferTypes1.ts, 137, 8)) +>U : Symbol(U, Decl(inferTypes1.ts, 137, 10)) +>S : Symbol(S, Decl(inferTypes1.ts, 137, 8)) +>A2 : Symbol(A2, Decl(inferTypes1.ts, 133, 61)) +>T : Symbol(T, Decl(inferTypes1.ts, 137, 47)) +>U : Symbol(U, Decl(inferTypes1.ts, 137, 10)) +>T : Symbol(T, Decl(inferTypes1.ts, 137, 47)) +>U : Symbol(U, Decl(inferTypes1.ts, 137, 10)) // Repro from #21735 type A = T extends string ? { [P in T]: void; } : T; ->A : Symbol(A, Decl(inferTypes1.ts, 128, 71)) ->T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) ->P : Symbol(P, Decl(inferTypes1.ts, 132, 34)) ->T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 132, 7)) +>A : Symbol(A, Decl(inferTypes1.ts, 137, 71)) +>T : Symbol(T, Decl(inferTypes1.ts, 141, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 141, 7)) +>P : Symbol(P, Decl(inferTypes1.ts, 141, 34)) +>T : Symbol(T, Decl(inferTypes1.ts, 141, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 141, 7)) type B = string extends T ? { [P in T]: void; } : T; // Error ->B : Symbol(B, Decl(inferTypes1.ts, 132, 55)) ->T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) ->P : Symbol(P, Decl(inferTypes1.ts, 133, 34)) ->T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) ->T : Symbol(T, Decl(inferTypes1.ts, 133, 7)) +>B : Symbol(B, Decl(inferTypes1.ts, 141, 55)) +>T : Symbol(T, Decl(inferTypes1.ts, 142, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 142, 7)) +>P : Symbol(P, Decl(inferTypes1.ts, 142, 34)) +>T : Symbol(T, Decl(inferTypes1.ts, 142, 7)) +>T : Symbol(T, Decl(inferTypes1.ts, 142, 7)) // Repro from #22302 type MatchingKeys = ->MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 133, 55)) ->T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) ->U : Symbol(U, Decl(inferTypes1.ts, 137, 20)) ->K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) ->T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) ->T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) +>MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 142, 55)) +>T : Symbol(T, Decl(inferTypes1.ts, 146, 18)) +>U : Symbol(U, Decl(inferTypes1.ts, 146, 20)) +>K : Symbol(K, Decl(inferTypes1.ts, 146, 23)) +>T : Symbol(T, Decl(inferTypes1.ts, 146, 18)) +>T : Symbol(T, Decl(inferTypes1.ts, 146, 18)) K extends keyof T ? T[K] extends U ? K : never : never; ->K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) ->T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) ->T : Symbol(T, Decl(inferTypes1.ts, 137, 18)) ->K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) ->U : Symbol(U, Decl(inferTypes1.ts, 137, 20)) ->K : Symbol(K, Decl(inferTypes1.ts, 137, 23)) +>K : Symbol(K, Decl(inferTypes1.ts, 146, 23)) +>T : Symbol(T, Decl(inferTypes1.ts, 146, 18)) +>T : Symbol(T, Decl(inferTypes1.ts, 146, 18)) +>K : Symbol(K, Decl(inferTypes1.ts, 146, 23)) +>U : Symbol(U, Decl(inferTypes1.ts, 146, 20)) +>K : Symbol(K, Decl(inferTypes1.ts, 146, 23)) type VoidKeys = MatchingKeys; ->VoidKeys : Symbol(VoidKeys, Decl(inferTypes1.ts, 138, 59)) ->T : Symbol(T, Decl(inferTypes1.ts, 140, 14)) ->MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 133, 55)) ->T : Symbol(T, Decl(inferTypes1.ts, 140, 14)) +>VoidKeys : Symbol(VoidKeys, Decl(inferTypes1.ts, 147, 59)) +>T : Symbol(T, Decl(inferTypes1.ts, 149, 14)) +>MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 142, 55)) +>T : Symbol(T, Decl(inferTypes1.ts, 149, 14)) interface test { ->test : Symbol(test, Decl(inferTypes1.ts, 140, 41)) +>test : Symbol(test, Decl(inferTypes1.ts, 149, 41)) a: 1, ->a : Symbol(test.a, Decl(inferTypes1.ts, 142, 16)) +>a : Symbol(test.a, Decl(inferTypes1.ts, 151, 16)) b: void ->b : Symbol(test.b, Decl(inferTypes1.ts, 143, 9)) +>b : Symbol(test.b, Decl(inferTypes1.ts, 152, 9)) } type T80 = MatchingKeys; ->T80 : Symbol(T80, Decl(inferTypes1.ts, 145, 1)) ->MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 133, 55)) ->test : Symbol(test, Decl(inferTypes1.ts, 140, 41)) +>T80 : Symbol(T80, Decl(inferTypes1.ts, 154, 1)) +>MatchingKeys : Symbol(MatchingKeys, Decl(inferTypes1.ts, 142, 55)) +>test : Symbol(test, Decl(inferTypes1.ts, 149, 41)) type T81 = VoidKeys; ->T81 : Symbol(T81, Decl(inferTypes1.ts, 147, 36)) ->VoidKeys : Symbol(VoidKeys, Decl(inferTypes1.ts, 138, 59)) ->test : Symbol(test, Decl(inferTypes1.ts, 140, 41)) +>T81 : Symbol(T81, Decl(inferTypes1.ts, 156, 36)) +>VoidKeys : Symbol(VoidKeys, Decl(inferTypes1.ts, 147, 59)) +>test : Symbol(test, Decl(inferTypes1.ts, 149, 41)) + +// Repro from #22221 + +type MustBeString = T; +>MustBeString : Symbol(MustBeString, Decl(inferTypes1.ts, 157, 26)) +>T : Symbol(T, Decl(inferTypes1.ts, 161, 18)) +>T : Symbol(T, Decl(inferTypes1.ts, 161, 18)) + +type EnsureIsString = T extends MustBeString ? U : never; +>EnsureIsString : Symbol(EnsureIsString, Decl(inferTypes1.ts, 161, 40)) +>T : Symbol(T, Decl(inferTypes1.ts, 162, 20)) +>T : Symbol(T, Decl(inferTypes1.ts, 162, 20)) +>MustBeString : Symbol(MustBeString, Decl(inferTypes1.ts, 157, 26)) +>U : Symbol(U, Decl(inferTypes1.ts, 162, 53)) +>U : Symbol(U, Decl(inferTypes1.ts, 162, 53)) + +type Test1 = EnsureIsString<"hello">; // "hello" +>Test1 : Symbol(Test1, Decl(inferTypes1.ts, 162, 69)) +>EnsureIsString : Symbol(EnsureIsString, Decl(inferTypes1.ts, 161, 40)) + +type Test2 = EnsureIsString<42>; // never +>Test2 : Symbol(Test2, Decl(inferTypes1.ts, 164, 37)) +>EnsureIsString : Symbol(EnsureIsString, Decl(inferTypes1.ts, 161, 40)) diff --git a/tests/baselines/reference/inferTypes1.types b/tests/baselines/reference/inferTypes1.types index 523dd669e4c..1d0a48c5169 100644 --- a/tests/baselines/reference/inferTypes1.types +++ b/tests/baselines/reference/inferTypes1.types @@ -412,6 +412,46 @@ type T78 = T extends T76 ? T76 : never; >X : X >X : X +type Foo = [T, U]; +>Foo : [T, U] +>T : T +>U : U +>T : T +>T : T +>U : U + +type Bar = T extends Foo ? Foo : never; +>Bar : Bar +>T : T +>T : T +>Foo : [T, U] +>X : X +>Y : Y +>Foo : [T, U] +>X : X +>Y : Y + +type T90 = Bar<[string, string]>; // [string, string] +>T90 : [string, string] +>Bar : Bar + +type T91 = Bar<[string, "a"]>; // [string, "a"] +>T91 : [string, "a"] +>Bar : Bar + +type T92 = Bar<[string, "a"] & { x: string }>; // [string, "a"] +>T92 : [string, "a"] +>Bar : Bar +>x : string + +type T93 = Bar<["a", string]>; // never +>T93 : never +>Bar : Bar + +type T94 = Bar<[number, number]>; // never +>T94 : never +>Bar : Bar + // Example from #21496 type JsonifiedObject = { [K in keyof T]: Jsonified }; @@ -626,3 +666,26 @@ type T81 = VoidKeys; >VoidKeys : MatchingKeys >test : test +// Repro from #22221 + +type MustBeString = T; +>MustBeString : T +>T : T +>T : T + +type EnsureIsString = T extends MustBeString ? U : never; +>EnsureIsString : EnsureIsString +>T : T +>T : T +>MustBeString : T +>U : U +>U : U + +type Test1 = EnsureIsString<"hello">; // "hello" +>Test1 : "hello" +>EnsureIsString : EnsureIsString + +type Test2 = EnsureIsString<42>; // never +>Test2 : never +>EnsureIsString : EnsureIsString +